From da7d643e51c12488e27bb76cc04be493af0efa08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 16 Nov 2013 23:11:54 +0000 Subject: [PATCH] [NTVDM] - Use MAX/MINSHORT instead of CRT macros. - Include only the relevant headers. svn path=/branches/ntvdm/; revision=61014 --- subsystems/ntvdm/ntvdm.h | 7 ++++++- subsystems/ntvdm/vga.c | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/subsystems/ntvdm/ntvdm.h b/subsystems/ntvdm/ntvdm.h index b9710bffe60..073d6998511 100644 --- a/subsystems/ntvdm/ntvdm.h +++ b/subsystems/ntvdm/ntvdm.h @@ -16,7 +16,12 @@ #include #define WIN32_NO_STATUS -#include +#include +#include +#include +#include +#include +#include #include diff --git a/subsystems/ntvdm/vga.c b/subsystems/ntvdm/vga.c index e527d39c255..4609e3d417f 100644 --- a/subsystems/ntvdm/vga.c +++ b/subsystems/ntvdm/vga.c @@ -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 */