[NTVDM]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 16 Nov 2013 23:11:54 +0000 (23:11 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 16 Nov 2013 23:11:54 +0000 (23:11 +0000)
- Use MAX/MINSHORT instead of CRT macros.
- Include only the relevant headers.

svn path=/branches/ntvdm/; revision=61014

subsystems/ntvdm/ntvdm.h
subsystems/ntvdm/vga.c

index b9710bf..073d699 100644 (file)
 #include <conio.h>
 
 #define WIN32_NO_STATUS
-#include <windows.h>
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <wincon.h>
+#include <winnls.h>
+#include <winuser.h>
 
 #include <debug.h>
 
index e527d39..4609e3d 100644 (file)
@@ -132,17 +132,17 @@ static inline INT VgaGetAddressSize(VOID)
     if (VgaCrtcRegisters[VGA_CRTC_UNDERLINE_REG] & VGA_CRTC_UNDERLINE_DWORD)
     {
         /* Double-word addressing */
-        return 4;
+        return 4; // sizeof(DWORD)
     }
     
     if (VgaCrtcRegisters[VGA_CRTC_MODE_CONTROL_REG] & VGA_CRTC_MODE_CONTROL_BYTE)
     {
         /* Byte addressing */
-        return 1;
+        return 1; // sizeof(BYTE)
     }
 
     /* Word addressing */
-    return 2;
+    return 2; // sizeof(WORD)
 }
 
 static inline DWORD VgaTranslateReadAddress(DWORD Address)
@@ -265,8 +265,8 @@ static inline VOID VgaMarkForUpdate(SHORT Row, SHORT Column)
     /* Check if this is the first time the rectangle is updated */
     if (!NeedsUpdate)
     {
-        UpdateRectangle.Left = UpdateRectangle.Top = SHRT_MAX;
-        UpdateRectangle.Right = UpdateRectangle.Bottom = SHRT_MIN;
+        UpdateRectangle.Left = UpdateRectangle.Top = MAXSHORT;
+        UpdateRectangle.Right = UpdateRectangle.Bottom = MINSHORT;
     }
 
     /* Expand the rectangle to include the point */