Skip to content

Commit

Permalink
Fixed calling of KbdCharIn.
Browse files Browse the repository at this point in the history
It was just seven kinds of wrong before. Now it's gone from a stub to
barely-usable.  :)
  • Loading branch information
icculus committed Jan 4, 2018
1 parent 185a983 commit c2e4398
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions native/kbdcalls.c
Expand Up @@ -5,16 +5,17 @@ APIRET16 KbdCharIn(PKBDKEYINFO pkbci, USHORT fWait, HKBD hkbd)
{
TRACE_NATIVE("KbdCharIn(%p, %u, %u)", pkbci, fWait, hkbd);
FIXME("this is just enough to survive 'press any key'");
getchar();
memset(pkbci, '\0', sizeof (*pkbci));
pkbci->chChar = getchar();
return NO_ERROR;
} // kbdCharIn

static APIRET16 bridge16to32_KbdCharIn(uint8 *args)
{
const HKBD hkbd = *((HKBD *) args); args += 2;
const USHORT fWait = *((USHORT *) args); args += 2;
//PKBDKEYINFO pkbci = (PKBDKEYINFO) GLoaderState->convert1616to32(*((uint32*) args)); //args += 4;
return KbdCharIn(NULL/*FIXMEpkbci*/, fWait, hkbd);
LX_NATIVE_MODULE_16BIT_BRIDGE_ARG(HKBD, hkbd);
LX_NATIVE_MODULE_16BIT_BRIDGE_ARG(USHORT, fWait);
LX_NATIVE_MODULE_16BIT_BRIDGE_PTRARG(PKBDKEYINFO, pkbci);
return KbdCharIn(pkbci, fWait, hkbd);
} // bridge16to32_KbdCharIn

LX_NATIVE_MODULE_16BIT_SUPPORT()
Expand All @@ -28,7 +29,7 @@ LX_NATIVE_MODULE_DEINIT({
static int initKbdcalls(void)
{
LX_NATIVE_MODULE_INIT_16BIT_SUPPORT()
LX_NATIVE_INIT_16BIT_BRIDGE(KbdCharIn, 8)
LX_NATIVE_INIT_16BIT_BRIDGE(KbdCharIn, 6)
LX_NATIVE_MODULE_INIT_16BIT_SUPPORT_END()
return 1;
} // initViocalls
Expand Down

0 comments on commit c2e4398

Please sign in to comment.