mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 04:23:32 +00:00
[NTVDM]: Fix a bug introduced in revision 64324, where I didn't restore the original values of CF and AX. Fix some keyboard issues in Mystery Mansion.
svn path=/trunk/; revision=64360
This commit is contained in:
parent
7ac429e063
commit
7eae9e6636
1 changed files with 12 additions and 4 deletions
|
@ -194,6 +194,7 @@ static VOID WINAPI BiosKeyboardService(LPWORD Stack)
|
||||||
// Keyboard IRQ 1
|
// Keyboard IRQ 1
|
||||||
static VOID WINAPI BiosKeyboardIrq(LPWORD Stack)
|
static VOID WINAPI BiosKeyboardIrq(LPWORD Stack)
|
||||||
{
|
{
|
||||||
|
BOOLEAN SkipScanCode;
|
||||||
BYTE ScanCode, VirtualKey;
|
BYTE ScanCode, VirtualKey;
|
||||||
WORD Character;
|
WORD Character;
|
||||||
|
|
||||||
|
@ -204,18 +205,25 @@ static VOID WINAPI BiosKeyboardIrq(LPWORD Stack)
|
||||||
* In return, if CF is set we continue processing the scan code
|
* In return, if CF is set we continue processing the scan code
|
||||||
* stored in AL, and if not, we skip it.
|
* stored in AL, and if not, we skip it.
|
||||||
*/
|
*/
|
||||||
|
BYTE CF, AX;
|
||||||
|
CF = getCF();
|
||||||
|
AX = getAX();
|
||||||
|
|
||||||
setCF(1);
|
setCF(1);
|
||||||
setAL(IOReadB(PS2_DATA_PORT));
|
setAL(IOReadB(PS2_DATA_PORT));
|
||||||
setAH(0x4F);
|
setAH(0x4F);
|
||||||
Int32Call(&BiosContext, BIOS_MISC_INTERRUPT);
|
Int32Call(&BiosContext, BIOS_MISC_INTERRUPT);
|
||||||
|
|
||||||
/* Check whether CL is clear. If so, skip the scan code. */
|
|
||||||
if (getCF() == 0) goto Quit;
|
|
||||||
/**/setCF(0);/**/ // FIXME: HACK: Reset CF otherwise we enter in an infinite loop.
|
|
||||||
|
|
||||||
/* Retrieve the modified scan code in AL */
|
/* Retrieve the modified scan code in AL */
|
||||||
|
SkipScanCode = (getCF() == 0);
|
||||||
ScanCode = getAL();
|
ScanCode = getAL();
|
||||||
|
|
||||||
|
setAX(AX);
|
||||||
|
setCF(CF);
|
||||||
|
|
||||||
|
/* Check whether CF is clear. If so, skip the scan code. */
|
||||||
|
if (SkipScanCode) goto Quit;
|
||||||
|
|
||||||
/* Get the corresponding virtual key code */
|
/* Get the corresponding virtual key code */
|
||||||
VirtualKey = MapVirtualKey(ScanCode & 0x7F, MAPVK_VSC_TO_VK);
|
VirtualKey = MapVirtualKey(ScanCode & 0x7F, MAPVK_VSC_TO_VK);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue