Author: aandrejevic
Date: Wed Jun 19 22:53:16 2013
New Revision: 59261
URL:
http://svn.reactos.org/svn/reactos?rev=59261&view=rev
Log:
[NTVDM]
Implement up/down scrolling function in interrupt 0x10.
Modified:
branches/ntvdm/subsystems/ntvdm/bios.c
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] Wed Jun 19 22:53:16 2013
@@ -155,13 +155,16 @@
HANDLE ConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
INT CursorHeight;
BOOLEAN Invisible = FALSE;
- COORD CursorPosition;
+ COORD Position;
CONSOLE_CURSOR_INFO CursorInfo;
+ CHAR_INFO Character;
+ SMALL_RECT Rect;
DWORD Eax = EmulatorGetRegister(EMULATOR_REG_AX);
DWORD Ecx = EmulatorGetRegister(EMULATOR_REG_CX);
DWORD Edx = EmulatorGetRegister(EMULATOR_REG_DX);
-
- switch (LOBYTE(Eax))
+ DWORD Ebx = EmulatorGetRegister(EMULATOR_REG_BX);
+
+ switch (HIBYTE(Eax))
{
/* Set Text-Mode Cursor Shape */
case 0x01:
@@ -183,22 +186,32 @@
/* Set Cursor Position */
case 0x02:
{
- CursorPosition.X = LOBYTE(Edx);
- CursorPosition.Y = HIBYTE(Edx);
-
- SetConsoleCursorPosition(ConsoleOutput, CursorPosition);
- break;
- }
-
- /* Scroll Up Window */
+ Position.X = LOBYTE(Edx);
+ Position.Y = HIBYTE(Edx);
+
+ SetConsoleCursorPosition(ConsoleOutput, Position);
+ break;
+ }
+
+ /* Scroll Up/Down Window */
case 0x06:
- {
- break;
- }
-
- /* Scroll Down Window */
case 0x07:
{
+ Rect.Top = HIBYTE(Ecx);
+ Rect.Left = LOBYTE(Ecx);
+ Rect.Bottom = HIBYTE(Edx);
+ Rect.Right = LOBYTE(Edx);
+ Character.Char.UnicodeChar = L' ';
+ Character.Attributes = HIBYTE(Ebx);
+ Position.X = Rect.Left;
+ if (HIBYTE(Eax) == 0x06) Position.Y = Rect.Top - LOBYTE(Eax);
+ else Position.Y = Rect.Top + LOBYTE(Eax);
+
+ ScrollConsoleScreenBuffer(ConsoleOutput,
+ &Rect,
+ &Rect,
+ Position,
+ &Character);
break;
}