From ca392ef6510f40e21f28be6f606df95b6ece4e1f Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 9 Oct 2006 16:37:27 +0000 Subject: [PATCH] Make sure the compiler doesn't optimize away writes to video memory svn path=/trunk/; revision=24473 --- reactos/drivers/base/bootvid/vid_vgatext.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/reactos/drivers/base/bootvid/vid_vgatext.c b/reactos/drivers/base/bootvid/vid_vgatext.c index d12089ee987..04232fd3721 100644 --- a/reactos/drivers/base/bootvid/vid_vgatext.c +++ b/reactos/drivers/base/bootvid/vid_vgatext.c @@ -61,7 +61,7 @@ static ULONG SizeX, SizeY; static VOID NTAPI VidpVgaTextClearDisplay(VOID) { - WORD *ptr = (WORD*)VidpMemory; + volatile WORD *ptr = (volatile WORD*)VidpMemory; ULONG i; for (i = 0; i < SizeX * SizeY; i++, ptr++) @@ -166,13 +166,12 @@ VidVgaTextSolidColorFill( static VOID NTAPI VidpVgaTextScrollDisplay(VOID) { - PUSHORT ptr; + volatile USHORT *ptr; int i; - ptr = (PUSHORT)VidpMemory + SizeX; - RtlMoveMemory(VidpMemory, ptr, SizeX * (SizeY - 1) * 2); + RtlMoveMemory(VidpMemory, (PUSHORT)VidpMemory + SizeX, SizeX * (SizeY - 1) * 2); - ptr = (PUSHORT)VidpMemory + (SizeX * (SizeY - 1)); + ptr = (volatile USHORT *)VidpMemory + (SizeX * (SizeY - 1)); for (i = 0; i < (int)SizeX; i++, ptr++) *ptr = (CHAR_ATTRIBUTE << 8) + ' '; } @@ -210,9 +209,9 @@ VidVgaTextDisplayString( } else if (*pch != '\r') { - PUSHORT ptr; + volatile USHORT *ptr; - ptr = (PUSHORT)VidpMemory + ((CursorY * SizeX) + CursorX); + ptr = (volatile USHORT *)VidpMemory + ((CursorY * SizeX) + CursorX); *ptr = (CHAR_ATTRIBUTE << 8) + *pch; CursorX++;