[NTVDM]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 13 Aug 2013 20:15:24 +0000 (20:15 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 13 Aug 2013 20:15:24 +0000 (20:15 +0000)
Simplify the code

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

subsystems/ntvdm/bios.c

index 05dc773..1d58e14 100644 (file)
@@ -429,8 +429,12 @@ BOOLEAN BiosSetVideoMode(BYTE ModeNumber)
 
 BOOLEAN BiosSetVideoPage(BYTE PageNumber)
 {
 
 BOOLEAN BiosSetVideoPage(BYTE PageNumber)
 {
+    /* Check if the page exists */
     if (PageNumber >= BIOS_MAX_PAGES) return FALSE;
 
     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;
     /* 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();
         {
             BiosSetVideoMode(LOBYTE(Eax));
             VgaClearMemory();
-
             break;
         }
 
             break;
         }
 
@@ -800,15 +803,7 @@ VOID BiosVideoService(LPWORD Stack)
         /* Select Active Display Page */
         case 0x05:
         {
         /* 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));
             BiosSetVideoPage(LOBYTE(Eax));
-
             break;
         }
 
             break;
         }