From 738d02adf2e537c3088b6017e6956d9132d9c7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 13 Aug 2013 20:15:24 +0000 Subject: [PATCH] [NTVDM] Simplify the code svn path=/branches/ntvdm/; revision=59730 --- subsystems/ntvdm/bios.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/subsystems/ntvdm/bios.c b/subsystems/ntvdm/bios.c index 05dc773c149..1d58e14baf0 100644 --- a/subsystems/ntvdm/bios.c +++ b/subsystems/ntvdm/bios.c @@ -429,8 +429,12 @@ BOOLEAN BiosSetVideoMode(BYTE ModeNumber) BOOLEAN BiosSetVideoPage(BYTE PageNumber) { + /* Check if the page exists */ if (PageNumber >= BIOS_MAX_PAGES) return FALSE; + /* Check if this is the same page */ + if (PageNumber == Bda->VideoPage) return TRUE; + /* Set the values in the BDA */ Bda->VideoPage = PageNumber; Bda->VideoPageSize = BIOS_PAGE_SIZE; @@ -744,7 +748,6 @@ VOID BiosVideoService(LPWORD Stack) { BiosSetVideoMode(LOBYTE(Eax)); VgaClearMemory(); - break; } @@ -800,15 +803,7 @@ VOID BiosVideoService(LPWORD Stack) /* Select Active Display Page */ case 0x05: { - /* Check if the page exists */ - if (LOBYTE(Eax) >= BIOS_MAX_PAGES) break; - - /* Check if this is the same page */ - if (LOBYTE(Eax) == Bda->VideoPage) break; - - /* Change the video page */ BiosSetVideoPage(LOBYTE(Eax)); - break; }