Commit f7bd7adb authored by Ove Kaaven's avatar Ove Kaaven Committed by Alexandre Julliard

Added INT_Int16AddChar.

parent d88e7661
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment