From 3e0d421012eb4efb29576993ed7a78aa65b0cfce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 10 Jun 2015 01:30:30 +0000 Subject: [PATCH] [NTVDM] - Some INT --> UINT fixes. - Fix the third value of MemorySizes according to the specification, confirmed by Aleksander. svn path=/trunk/; revision=68099 --- reactos/subsystems/mvdm/ntvdm/bios/vidbios.c | 23 +++++++++---------- .../mvdm/ntvdm/hardware/video/vga.c | 4 ++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c b/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c index 8f5d50e9ff0..4b923a4e5eb 100644 --- a/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c +++ b/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c @@ -2120,7 +2120,7 @@ static __inline VOID VgaSetSinglePaletteRegister(BYTE Index, BYTE Value) static BOOLEAN VgaSetRegisters(PVGA_REGISTERS Registers) { - INT i; + UINT i; if (Registers == NULL) return FALSE; @@ -2389,21 +2389,21 @@ static inline BYTE VidBiosGetVideoMode(VOID) static inline VOID VidBiosClearScreen(VOID) { - static const DWORD MemoryMaps[4] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 }; - static const DWORD MemorySizes[4] = { 0x20000, 0x10000, 0x10000, 0x8000 }; + static const DWORD MemoryMaps[4] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 }; + static const DWORD MemorySizes[4] = { 0x20000, 0x10000, 0x08000, 0x08000 }; DWORD VideoAddress; - BYTE Buffer[0x20000]; DWORD BufferSize; BYTE Misc; + BYTE Buffer[0x20000]; /* Read the misc register */ IOWriteB(VGA_GC_INDEX, VGA_GC_MISC_REG); Misc = IOReadB(VGA_GC_DATA); - /* Get the video address */ + /* Get the video address and buffer size */ VideoAddress = MemoryMaps[(Misc >> 2) & 3]; - BufferSize = MemorySizes[(Misc >> 2) & 3]; + BufferSize = MemorySizes[(Misc >> 2) & 3]; if (Misc & 1) { @@ -2412,9 +2412,8 @@ static inline VOID VidBiosClearScreen(VOID) } else { - INT i; - /* Text mode */ + UINT i; for (i = 0; i < (BufferSize >> 1); i++) { ((PWORD)Buffer)[i] = MAKEWORD(' ', DEFAULT_ATTRIBUTE); @@ -3174,7 +3173,7 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack) /* Set All Palette Registers */ case 0x02: { - INT i; + UINT i; LPBYTE Buffer = SEG_OFF_TO_PTR(getES(), getDX()); /* Set the palette registers */ @@ -3258,7 +3257,7 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack) /* Get All Palette Registers */ case 0x09: { - INT i; + UINT i; LPBYTE Buffer = SEG_OFF_TO_PTR(getES(), getDX()); /* Get the palette registers */ @@ -3300,7 +3299,7 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack) /* Set Block of DAC Registers */ case 0x12: { - INT i; + UINT i; LPBYTE Buffer = SEG_OFF_TO_PTR(getES(), getDX()); /* Write the index */ @@ -3335,7 +3334,7 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack) /* Get Block of DAC Registers */ case 0x17: { - INT i; + UINT i; LPBYTE Buffer = SEG_OFF_TO_PTR(getES(), getDX()); /* Write the index */ diff --git a/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c b/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c index f11d1a691aa..b6fb591552e 100644 --- a/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c +++ b/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c @@ -771,7 +771,7 @@ static VOID VgaRestoreDefaultPalette(PPALETTEENTRY Entries, USHORT NumOfEntries) static BOOLEAN VgaInitializePalette(VOID) { - INT i; + UINT i; BOOLEAN Result = FALSE; LPLOGPALETTE Palette, TextPalette; @@ -1576,7 +1576,7 @@ static inline VOID VgaWriteCrtc(BYTE Data) static inline VOID VgaWriteDac(BYTE Data) { - INT i, PaletteIndex; + UINT i, PaletteIndex; PALETTEENTRY Entry; /* Set the value */