From f7bd7adb919afa7dd188c0dd7b11407881944dae Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Sat, 22 May 1999 11:27:40 +0000 Subject: [PATCH] Added INT_Int16AddChar. --- msdos/int16.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/msdos/int16.c b/msdos/int16.c index da9102f96ec..34fa4fa042d 100644 --- a/msdos/int16.c +++ b/msdos/int16.c @@ -12,6 +12,7 @@ #include "wincon.h" #include "debug.h" #include "winuser.h" +#include "miscemu.h" DEFAULT_DEBUG_CHANNEL(int16) @@ -122,3 +123,20 @@ void WINAPI INT_Int16Handler( CONTEXT *context ) } } +int WINAPI INT_Int16AddChar(BYTE ascii,BYTE scan) +{ + BIOSDATA *data = DOSMEM_BiosData(); + WORD CurOfs = data->FirstKbdCharPtr; + WORD NextOfs = CurOfs + 2; + + if (NextOfs >= data->KbdBufferEnd) NextOfs = data->KbdBufferStart; + /* check if buffer is full */ + if (NextOfs == data->NextKbdCharPtr) return 0; + + /* okay, insert character in ring buffer */ + ((BYTE*)data)[CurOfs] = ascii; + ((BYTE*)data)[CurOfs+1] = scan; + + data->FirstKbdCharPtr = NextOfs; + return 1; +}