mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTVDM]: We can call now directly the interrupts instead of the internal functions BiosPeekCharacter and VidBiosPrintCharacter (so that if some program hooks them, we behave correctly).
svn path=/branches/ntvdm/; revision=62311
This commit is contained in:
parent
b33a34bec1
commit
6f5166457c
6 changed files with 35 additions and 10 deletions
|
@ -81,7 +81,7 @@ static BOOLEAN BiosKbdBufferPop(VOID)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
WORD BiosPeekCharacter(VOID)
|
||||
static WORD BiosPeekCharacter(VOID)
|
||||
{
|
||||
WORD CharacterData = 0;
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
WORD BiosPeekCharacter(VOID);
|
||||
WORD BiosGetCharacter(VOID);
|
||||
|
||||
BOOLEAN KbdBios32Initialize(HANDLE ConsoleInput);
|
||||
|
|
|
@ -1045,7 +1045,7 @@ static BOOLEAN VidBiosSetVideoPage(BYTE PageNumber)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page)
|
||||
static VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page)
|
||||
{
|
||||
WORD CharData = MAKEWORD(Character, Attribute);
|
||||
BYTE Row, Column;
|
||||
|
|
|
@ -36,8 +36,6 @@ enum
|
|||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page);
|
||||
|
||||
BOOLEAN VidBios32Initialize(HANDLE BiosConsoleOutput);
|
||||
VOID VidBios32Cleanup(VOID);
|
||||
|
||||
|
|
|
@ -93,8 +93,18 @@ BOOLEAN DosCheckInput(VOID)
|
|||
|
||||
if (IsConsoleHandle(Handle))
|
||||
{
|
||||
/* Save AX */
|
||||
USHORT AX = getAX();
|
||||
|
||||
/* Call the BIOS */
|
||||
return (BiosPeekCharacter() != 0xFFFF);
|
||||
setAH(0x01); // or 0x11 for enhanced, but what to choose?
|
||||
Int32Call(&DosContext, BIOS_KBD_INTERRUPT);
|
||||
|
||||
/* Restore AX */
|
||||
setAX(AX);
|
||||
|
||||
/* Return keyboard status */
|
||||
return (getZF() == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -809,8 +809,23 @@ WORD DosWriteFile(WORD FileHandle, LPVOID Buffer, WORD Count, LPWORD BytesWritte
|
|||
{
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
/* Call the BIOS to print the character */
|
||||
VidBiosPrintCharacter(((LPBYTE)Buffer)[i], DOS_CHAR_ATTRIBUTE, Bda->VideoPage);
|
||||
/* Save AX and BX */
|
||||
USHORT AX = getAX();
|
||||
USHORT BX = getBX();
|
||||
|
||||
/* Set the parameters */
|
||||
setAL(((PCHAR)Buffer)[i]);
|
||||
setBL(DOS_CHAR_ATTRIBUTE);
|
||||
setBH(Bda->VideoPage);
|
||||
|
||||
/* Call the BIOS INT 10h, AH=0Eh "Teletype Output" */
|
||||
setAH(0x0E);
|
||||
Int32Call(&DosContext, BIOS_VIDEO_INTERRUPT);
|
||||
|
||||
/* Restore AX and BX */
|
||||
setBX(BX);
|
||||
setAX(AX);
|
||||
|
||||
BytesWritten32++;
|
||||
}
|
||||
}
|
||||
|
@ -2513,14 +2528,17 @@ VOID WINAPI DosFastConOut(LPWORD Stack)
|
|||
USHORT AX = getAX();
|
||||
USHORT BX = getBX();
|
||||
|
||||
/* Set the parameters (AL = character, already set) */
|
||||
setBL(DOS_CHAR_ATTRIBUTE);
|
||||
setBH(Bda->VideoPage);
|
||||
|
||||
/* Call the BIOS INT 10h, AH=0Eh "Teletype Output" */
|
||||
setAH(0x0E);
|
||||
Int32Call(&DosContext, 0x10);
|
||||
Int32Call(&DosContext, BIOS_VIDEO_INTERRUPT);
|
||||
|
||||
/* Restore AX and BX */
|
||||
setAX(AX);
|
||||
setBX(BX);
|
||||
setAX(AX);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue