Moved the int 9 (keyboard) handler to dlls/winedos.
This commit is contained in:
parent
daf347ac8b
commit
e2c477b21a
|
@ -8,6 +8,7 @@ IMPORTS = user32 kernel32 ntdll
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
dosvm.c \
|
dosvm.c \
|
||||||
|
int09.c \
|
||||||
module.c
|
module.c
|
||||||
|
|
||||||
@MAKE_DLL_RULES@
|
@MAKE_DLL_RULES@
|
||||||
|
|
|
@ -693,3 +693,18 @@ void WINAPI DOSVM_QueueEvent( INT irq, INT priority, DOSRELAY relay, LPVOID data
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
BOOL WINAPI DOSVM_Init( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
|
||||||
|
{
|
||||||
|
TRACE_(module)("(0x%08x,%ld,%p)\n", hinstDLL, fdwReason, lpvReserved);
|
||||||
|
|
||||||
|
if (fdwReason == DLL_PROCESS_ATTACH) {
|
||||||
|
INT_SetWineHandler(9, INT_Int09Handler);
|
||||||
|
}
|
||||||
|
else if (fdwReason == DLL_PROCESS_DETACH)
|
||||||
|
{
|
||||||
|
INT_SetWineHandler(9, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -42,13 +42,10 @@ void WINAPI INT_Int09Handler( CONTEXT86 *context )
|
||||||
ch[0] = ascii;
|
ch[0] = ascii;
|
||||||
cnt = 1;
|
cnt = 1;
|
||||||
} else {
|
} else {
|
||||||
#if 0 /* FIXME: cannot call USER functions here */
|
|
||||||
UINT vkey = MapVirtualKeyA(scan&0x7f, 1);
|
UINT vkey = MapVirtualKeyA(scan&0x7f, 1);
|
||||||
/* as in TranslateMessage, windows/input.c */
|
BYTE keystate[256];
|
||||||
cnt = ToAscii(vkey, scan, QueueKeyStateTable, (LPWORD)ch, 0);
|
GetKeyboardState(keystate);
|
||||||
#else
|
cnt = ToAscii(vkey, scan, keystate, (LPWORD)ch, 0);
|
||||||
cnt = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (cnt>0) {
|
if (cnt>0) {
|
||||||
for (c2=0; c2<cnt; c2++)
|
for (c2=0; c2<cnt; c2++)
|
|
@ -1,5 +1,6 @@
|
||||||
name winedos
|
name winedos
|
||||||
type win32
|
type win32
|
||||||
|
init DOSVM_Init
|
||||||
|
|
||||||
import user32.dll
|
import user32.dll
|
||||||
import kernel32.dll
|
import kernel32.dll
|
||||||
|
@ -20,3 +21,5 @@ debug_channels (int module relay)
|
||||||
@ stdcall OutPIC(long long) DOSVM_PIC_ioport_out
|
@ stdcall OutPIC(long long) DOSVM_PIC_ioport_out
|
||||||
@ stdcall SetTimer(long) DOSVM_SetTimer
|
@ stdcall SetTimer(long) DOSVM_SetTimer
|
||||||
@ stdcall GetTimer() DOSVM_GetTimer
|
@ stdcall GetTimer() DOSVM_GetTimer
|
||||||
|
|
||||||
|
@ stdcall KbdReadScan(ptr) INT_Int09ReadScan
|
||||||
|
|
|
@ -12,7 +12,6 @@ C_SRCS = \
|
||||||
dosmem.c \
|
dosmem.c \
|
||||||
dpmi.c \
|
dpmi.c \
|
||||||
xms.c \
|
xms.c \
|
||||||
int09.c \
|
|
||||||
int10.c \
|
int10.c \
|
||||||
int11.c \
|
int11.c \
|
||||||
int12.c \
|
int12.c \
|
||||||
|
|
|
@ -16,7 +16,7 @@ DEFAULT_DEBUG_CHANNEL(int);
|
||||||
|
|
||||||
static INTPROC INT_WineHandler[256] = {
|
static INTPROC INT_WineHandler[256] = {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, INT_Int09Handler, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
INT_Int10Handler, INT_Int11Handler, INT_Int12Handler, INT_Int13Handler,
|
INT_Int10Handler, INT_Int11Handler, INT_Int12Handler, INT_Int13Handler,
|
||||||
0, INT_Int15Handler, INT_Int16Handler, INT_Int17Handler,
|
0, INT_Int15Handler, INT_Int16Handler, INT_Int17Handler,
|
||||||
0, 0, INT_Int1aHandler, 0, 0, 0, 0, 0,
|
0, 0, INT_Int1aHandler, 0, 0, 0, 0, 0,
|
||||||
|
|
|
@ -37,9 +37,9 @@ static struct {
|
||||||
BYTE ctrlbyte_ch;
|
BYTE ctrlbyte_ch;
|
||||||
WORD oldval;
|
WORD oldval;
|
||||||
} tmr_8253[3] = {
|
} tmr_8253[3] = {
|
||||||
{0xFFFF, FALSE, 0, FALSE, 0x06, 0},
|
{0xFFFF, FALSE, 0, FALSE, 0x36, 0},
|
||||||
{0x0012, FALSE, 0, FALSE, 0x44, 0},
|
{0x0012, FALSE, 0, FALSE, 0x74, 0},
|
||||||
{0x0001, FALSE, 0, FALSE, 0x86, 0},
|
{0x0001, FALSE, 0, FALSE, 0xB6, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int dummy_ctr = 0;
|
static int dummy_ctr = 0;
|
||||||
|
@ -345,7 +345,7 @@ DWORD IO_inport( int port, int size )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x60:
|
case 0x60:
|
||||||
res = INT_Int09ReadScan(NULL);
|
res = Dosvm.KbdReadScan ? Dosvm.KbdReadScan(NULL) : 0;
|
||||||
#if 0 /* what's this port got to do with parport ? */
|
#if 0 /* what's this port got to do with parport ? */
|
||||||
res = (DWORD)parport_8255[0];
|
res = (DWORD)parport_8255[0];
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue