mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 21:01:23 +00:00
[NTVDM]: Fix INT 10h, AH=09h/0Ah by correctly advancing the write position (but scrolling is not supported in those functions), and make VidBiosDrawGlyph support using or not the attribute byte (for text modes only).
svn path=/trunk/; revision=68088
This commit is contained in:
parent
07d842f6c6
commit
d15ab1916a
1 changed files with 36 additions and 20 deletions
|
@ -2561,7 +2561,7 @@ static BOOLEAN VidBiosSetVideoPage(BYTE PageNumber)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID VidBiosDrawGlyph(WORD CharData, BYTE Page, BYTE Row, BYTE Column)
|
static VOID VidBiosDrawGlyph(WORD CharData, BOOLEAN UseAttr, BYTE Page, BYTE Row, BYTE Column)
|
||||||
{
|
{
|
||||||
switch (Bda->VideoMode)
|
switch (Bda->VideoMode)
|
||||||
{
|
{
|
||||||
|
@ -2576,8 +2576,7 @@ static VOID VidBiosDrawGlyph(WORD CharData, BYTE Page, BYTE Row, BYTE Column)
|
||||||
Page * Bda->VideoPageSize +
|
Page * Bda->VideoPageSize +
|
||||||
(Row * Bda->ScreenColumns + Column) * sizeof(WORD)),
|
(Row * Bda->ScreenColumns + Column) * sizeof(WORD)),
|
||||||
(LPVOID)&CharData,
|
(LPVOID)&CharData,
|
||||||
sizeof(WORD));
|
UseAttr ? sizeof(WORD) : sizeof(BYTE));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2831,7 +2830,7 @@ static VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page)
|
||||||
|
|
||||||
/* Erase the existing character */
|
/* Erase the existing character */
|
||||||
CharData = MAKEWORD(' ', Attribute);
|
CharData = MAKEWORD(' ', Attribute);
|
||||||
VidBiosDrawGlyph(CharData, Page, Row, Column);
|
VidBiosDrawGlyph(CharData, TRUE, Page, Row, Column);
|
||||||
}
|
}
|
||||||
else if (Character == '\t')
|
else if (Character == '\t')
|
||||||
{
|
{
|
||||||
|
@ -2857,10 +2856,8 @@ static VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page)
|
||||||
{
|
{
|
||||||
/* Default character */
|
/* Default character */
|
||||||
|
|
||||||
/* Write the character */
|
/* Write the character and advance the cursor */
|
||||||
VidBiosDrawGlyph(CharData, Page, Row, Column);
|
VidBiosDrawGlyph(CharData, TRUE, Page, Row, Column);
|
||||||
|
|
||||||
/* Advance the cursor */
|
|
||||||
Column++;
|
Column++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2957,7 +2954,7 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
|
||||||
/* Read Character and Attribute at Cursor Position */
|
/* Read Character and Attribute at Cursor Position */
|
||||||
case 0x08:
|
case 0x08:
|
||||||
{
|
{
|
||||||
WORD CharacterData;
|
WORD CharData;
|
||||||
BYTE Page = getBH();
|
BYTE Page = getBH();
|
||||||
DWORD Offset;
|
DWORD Offset;
|
||||||
|
|
||||||
|
@ -2972,11 +2969,11 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
|
||||||
/* Read from the video memory */
|
/* Read from the video memory */
|
||||||
EmulatorReadMemory(&EmulatorContext,
|
EmulatorReadMemory(&EmulatorContext,
|
||||||
TO_LINEAR(TEXT_VIDEO_SEG, Offset),
|
TO_LINEAR(TEXT_VIDEO_SEG, Offset),
|
||||||
(LPVOID)&CharacterData,
|
(LPVOID)&CharData,
|
||||||
sizeof(WORD));
|
sizeof(WORD));
|
||||||
|
|
||||||
/* Return the character data in AX */
|
/* Return the character data in AX */
|
||||||
setAX(CharacterData);
|
setAX(CharData);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2986,21 +2983,40 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack)
|
||||||
/* Write Character only (PCjr: + Attribute) at Cursor Position */
|
/* Write Character only (PCjr: + Attribute) at Cursor Position */
|
||||||
case 0x0A:
|
case 0x0A:
|
||||||
{
|
{
|
||||||
WORD CharacterData = MAKEWORD(getAL(), getBL());
|
WORD Counter = getCX();
|
||||||
|
WORD CharData = MAKEWORD(getAL(), getBL());
|
||||||
|
BOOLEAN UseAttr = (getAH() == 0x09);
|
||||||
BYTE Page = getBH();
|
BYTE Page = getBH();
|
||||||
DWORD Counter = getCX();
|
BYTE Row, Column;
|
||||||
|
|
||||||
/* Check if the page exists */
|
/* Check if the page exists */
|
||||||
if (Page >= BIOS_MAX_PAGES) break;
|
if (Page >= BIOS_MAX_PAGES) break;
|
||||||
|
|
||||||
|
/* Get the cursor location */
|
||||||
|
// VidBiosGetCursorPosition(&Row, &Column, Page);
|
||||||
|
Row = HIBYTE(Bda->CursorPosition[Page]);
|
||||||
|
Column = LOBYTE(Bda->CursorPosition[Page]);
|
||||||
|
|
||||||
/* Write to video memory a certain number of times */
|
/* Write to video memory a certain number of times */
|
||||||
while (Counter > 0)
|
while (Counter-- > 0)
|
||||||
{
|
{
|
||||||
VidBiosDrawGlyph(CharacterData,
|
/* Write the character and advance the position */
|
||||||
CharacterData,
|
VidBiosDrawGlyph(CharData, UseAttr, Page, Row, Column);
|
||||||
HIBYTE(Bda->CursorPosition[Page]),
|
Column++;
|
||||||
LOBYTE(Bda->CursorPosition[Page]));
|
|
||||||
Counter--;
|
/* Check if it passed the end of the row */
|
||||||
|
if (Column >= Bda->ScreenColumns)
|
||||||
|
{
|
||||||
|
/* Return to the first column and go to the next line */
|
||||||
|
Column = 0;
|
||||||
|
Row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Contrary to the "Teletype Output" function, the screen is not scrolled */
|
||||||
|
if (Row > Bda->ScreenRows)
|
||||||
|
{
|
||||||
|
Row = Bda->ScreenRows;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue