Author: aandrejevic
Date: Sat Aug 10 19:30:14 2013
New Revision: 59690
URL:
http://svn.reactos.org/svn/reactos?rev=59690&view=rev
Log:
[NTVDM]
Optimize screen clearing by implementing it as a helper function in vga.c.
Modified:
branches/ntvdm/subsystems/ntvdm/bios.c
branches/ntvdm/subsystems/ntvdm/vga.c
branches/ntvdm/subsystems/ntvdm/vga.h
Modified: branches/ntvdm/subsystems/ntvdm/bios.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sat Aug 10 19:30:14 2013
@@ -255,31 +255,6 @@
}
}
-static VOID BiosClearScreen(VOID)
-{
- INT i;
- BYTE PlaneMask;
-
- /* Save the plane write register */
- VgaWritePort(VGA_SEQ_INDEX, VGA_SEQ_MASK_REG);
- PlaneMask = VgaReadPort(VGA_SEQ_DATA);
-
- /* Write to all planes */
- VgaWritePort(VGA_SEQ_DATA, 0x0F);
-
- /* Clear the screen */
- for (i = VgaGetVideoBaseAddress();
- i < VgaGetVideoLimitAddress();
- i += sizeof(DWORD))
- {
- DWORD Zero = 0;
- VgaWriteMemory(i, (LPVOID)&Zero, sizeof(DWORD));
- }
-
- /* Restore the plane write register */
- VgaWritePort(VGA_SEQ_DATA, PlaneMask);
-}
-
/* PUBLIC FUNCTIONS ***********************************************************/
BYTE BiosGetVideoMode(VOID)
@@ -654,7 +629,7 @@
case 0x00:
{
BiosSetVideoMode(LOBYTE(Eax));
- BiosClearScreen();
+ VgaClearMemory();
break;
}
Modified: branches/ntvdm/subsystems/ntvdm/vga.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Sat Aug 10 19:30:14 2013
@@ -1021,6 +1021,11 @@
}
}
+VOID VgaClearMemory(VOID)
+{
+ ZeroMemory(VgaMemory, sizeof(VgaMemory));
+}
+
VOID VgaInitialize(HANDLE TextHandle)
{
INT i, j;
Modified: branches/ntvdm/subsystems/ntvdm/vga.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.h?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] Sat Aug 10 19:30:14 2013
@@ -193,6 +193,7 @@
VOID VgaWriteMemory(DWORD Address, LPBYTE Buffer, DWORD Size);
BYTE VgaReadPort(WORD Port);
VOID VgaWritePort(WORD Port, BYTE Data);
+VOID VgaClearMemory(VOID);
VOID VgaInitialize(HANDLE TextHandle);
#endif // _VGA_H_