Make direct console input routines go through int16, rather than

reading directly from the console driver.
This commit is contained in:
Ove Kaaven 2000-07-29 14:34:28 +00:00 committed by Alexandre Julliard
parent e4e99a5dfc
commit 9f5ef0b410
1 changed files with 11 additions and 9 deletions

View File

@ -29,11 +29,10 @@
#include "heap.h" #include "heap.h"
#include "msdos.h" #include "msdos.h"
#include "ldt.h" #include "ldt.h"
#include "task.h"
#include "options.h" #include "options.h"
#include "miscemu.h" #include "miscemu.h"
#include "task.h"
#include "dosexe.h" /* for the MZ_SUPPORTED define */ #include "dosexe.h" /* for the MZ_SUPPORTED define */
#include "module.h"
#include "debugtools.h" #include "debugtools.h"
#include "console.h" #include "console.h"
@ -1151,27 +1150,28 @@ void WINAPI DOS3Call( CONTEXT86 *context )
break; break;
case 0x06: /* DIRECT CONSOLE IN/OUTPUT */ case 0x06: /* DIRECT CONSOLE IN/OUTPUT */
/* FIXME: Use DOSDEV_Peek/Read/Write(DOSDEV_Console(),...) !! */
if (DL_reg(context) == 0xff) { if (DL_reg(context) == 0xff) {
static char scan = 0; static char scan = 0;
TRACE("Direct Console Input\n"); TRACE("Direct Console Input\n");
if (scan) { if (scan) {
/* return pending scancode */ /* return pending scancode */
AL_reg(context) = scan; AL_reg(context) = scan;
EFL_reg(context) &= ~0x40; /* clear ZF */ RESET_ZFLAG(context);
scan = 0; scan = 0;
} else { } else {
char ascii; char ascii;
if (CONSOLE_CheckForKeystroke(&scan,&ascii)) { if (INT_Int16ReadChar(&ascii,&scan,TRUE)) {
CONSOLE_GetKeystroke(&scan,&ascii); INT_Int16ReadChar(&ascii,&scan,FALSE);
/* return ASCII code */ /* return ASCII code */
AL_reg(context) = ascii; AL_reg(context) = ascii;
EFL_reg(context) &= ~0x40; /* clear ZF */ RESET_ZFLAG(context);
/* return scan code on next call only if ascii==0 */ /* return scan code on next call only if ascii==0 */
if (ascii) scan = 0; if (ascii) scan = 0;
} else { } else {
/* nothing pending, clear everything */ /* nothing pending, clear everything */
AL_reg(context) = 0; AL_reg(context) = 0;
EFL_reg(context) |= 0x40; /* set ZF */ SET_ZFLAG(context);
scan = 0; /* just in case */ scan = 0; /* just in case */
} }
} }
@ -1182,13 +1182,15 @@ void WINAPI DOS3Call( CONTEXT86 *context )
break; break;
case 0x07: /* DIRECT CHARACTER INPUT WITHOUT ECHO */ case 0x07: /* DIRECT CHARACTER INPUT WITHOUT ECHO */
/* FIXME: Use DOSDEV_Peek/Read(DOSDEV_Console(),...) !! */
TRACE("DIRECT CHARACTER INPUT WITHOUT ECHO\n"); TRACE("DIRECT CHARACTER INPUT WITHOUT ECHO\n");
AL_reg(context) = CONSOLE_GetCharacter(); INT_Int16ReadChar(&AL_reg(context), NULL, FALSE);
break; break;
case 0x08: /* CHARACTER INPUT WITHOUT ECHO */ case 0x08: /* CHARACTER INPUT WITHOUT ECHO */
/* FIXME: Use DOSDEV_Peek/Read(DOSDEV_Console(),...) !! */
TRACE("CHARACTER INPUT WITHOUT ECHO\n"); TRACE("CHARACTER INPUT WITHOUT ECHO\n");
AL_reg(context) = CONSOLE_GetCharacter(); INT_Int16ReadChar(&AL_reg(context), NULL, FALSE);
break; break;
case 0x09: /* WRITE STRING TO STANDARD OUTPUT */ case 0x09: /* WRITE STRING TO STANDARD OUTPUT */