Author: hbelusca Date: Sun Mar 2 18:41:22 2014 New Revision: 62381
URL: http://svn.reactos.org/svn/reactos?rev=62381&view=rev Log: [NTVDM]: Fix INT 10h, AH=8h,9h,Ah ; remove AH=12h because it corresponds to video "alternate function select" (and not scroll window). Stubplement INT 10h, AH=13h.
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bios... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] Sun Mar 2 18:41:22 2014 @@ -1152,7 +1152,7 @@ break; }
- /* Get Cursor Position */ + /* Get Cursor Position and Shape */ case 0x03: { /* Make sure the selected video page exists */ @@ -1191,22 +1191,20 @@
/* Call the internal function */ VidBiosScrollWindow((getAH() == 0x06) ? SCROLL_DIRECTION_UP - : SCROLL_DIRECTION_DOWN, - getAL(), - Rectangle, - Bda->VideoPage, - getBH()); - - break; - } - - /* Read/Write Character From Cursor Position */ + : SCROLL_DIRECTION_DOWN, + getAL(), + Rectangle, + Bda->VideoPage, + getBH()); + + break; + } + + /* Read Character and Attribute at Cursor Position */ case 0x08: - case 0x09: - case 0x0A: - { - WORD CharacterData = MAKEWORD(getAL(), getBL()); - BYTE Page = getBH(); + { + WORD CharacterData; + BYTE Page = getBH(); DWORD Offset;
/* Check if the page exists */ @@ -1214,27 +1212,47 @@
/* Find the offset of the character */ Offset = Page * Bda->VideoPageSize + - (HIBYTE(Bda->CursorPosition[Page]) * Bda->ScreenColumns + + (HIBYTE(Bda->CursorPosition[Page]) * Bda->ScreenColumns + LOBYTE(Bda->CursorPosition[Page])) * 2;
- if (getAH() == 0x08) + /* Read from the video memory */ + EmulatorReadMemory(&EmulatorContext, + TO_LINEAR(TEXT_VIDEO_SEG, Offset), + (LPVOID)&CharacterData, + sizeof(WORD)); + + /* Return the character data in AX */ + setAX(CharacterData); + + break; + } + + /* Write Character and Attribute at Cursor Position */ + case 0x09: + /* Write Character only (PCjr: + Attribute) at Cursor Position */ + case 0x0A: + { + WORD CharacterData = MAKEWORD(getAL(), getBL()); + BYTE Page = getBH(); + DWORD Offset, Counter = getCX(); + + /* Check if the page exists */ + if (Page >= BIOS_MAX_PAGES) break; + + /* Find the offset of the character */ + Offset = Page * Bda->VideoPageSize + + (HIBYTE(Bda->CursorPosition[Page]) * Bda->ScreenColumns + + LOBYTE(Bda->CursorPosition[Page])) * 2; + + /* Write to video memory a certain number of times */ + while (Counter > 0) { - /* Read from the video memory */ - EmulatorReadMemory(&EmulatorContext, - TO_LINEAR(TEXT_VIDEO_SEG, Offset), - (LPVOID)&CharacterData, - sizeof(WORD)); - - /* Return the character in AX */ - setAX(CharacterData); - } - else - { - /* Write to video memory */ EmulatorWriteMemory(&EmulatorContext, TO_LINEAR(TEXT_VIDEO_SEG, Offset), (LPVOID)&CharacterData, - (getBH() == 0x09) ? sizeof(WORD) : sizeof(BYTE)); + (getAH() == 0x09) ? sizeof(WORD) : sizeof(BYTE)); + Offset += 2; + Counter--; }
break; @@ -1460,18 +1478,18 @@ break; }
- /* Scroll Window */ + /* Alternate Function Select */ case 0x12: { - SMALL_RECT Rectangle = { getCL(), getCH(), getDL(), getDH() }; - - /* Call the internal function */ - VidBiosScrollWindow(getBL(), - getAL(), - Rectangle, - Bda->VideoPage, - DEFAULT_ATTRIBUTE); - + DPRINT1("BIOS Function INT 12h (Alternate Function Select), BX = 0x%04X NOT IMPLEMENTED\n", + getBX()); + break; + } + + /* Write String */ + case 0x13: + { + DPRINT1("BIOS Function INT 13h (Write String) is UNIMPLEMENTED\n"); break; }