A drop-in replacement for TVicHW32.dll that allows MK6Emu to run on modern Windows (10/11) without requiring Win2000 compatibility mode or the original kernel-mode hardware I/O driver. Also replaces KEYBOARDCONNECTOR.exe with a built-in keyboard hook.
TVicHW32 stubs: The original TVicHW32.dll is a kernel-mode driver library for direct hardware I/O port access (by EnTech Taiwan). It requires a .SYS/.VXD driver that won't load on modern Windows due to driver signing requirements. Since MK6Emu doesn't need real hardware I/O, the shim stubs all 10 imported functions — OpenTVicHW32 returns a fake handle, all port read/write functions are no-ops, and MapPhysToLinear allocates a zeroed memory block.
Version spoofing: MK6Emu's audio initialization (DirectSound/waveOut) fails on Windows Vista+ because the app or its MFC runtime branches on the OS version. The shim uses IAT (Import Address Table) hooking to intercept GetVersion and GetVersionExA calls, making the app believe it's running on Windows 2000 SP4 (version 5.0, build 2195). This causes the audio subsystem to take the legacy initialization path, which works correctly through the modern WASAPI translation layer.
Keyboard connector: A low-level keyboard hook (WH_KEYBOARD_LL) replaces the external KEYBOARDCONNECTOR.exe AutoHotkey app. The hook is active whenever the "MK6 Emulator" window or any "Roms Screen" window is in the foreground, and inactive for all other applications.
These keys are sent as keystrokes to the emulator window when a Roms Screen is in the foreground:
| Key | Function |
|---|---|
1-8 |
Top button row (Reserve/Gamble, Bet lines) |
Q W E R T Y U I |
Bottom button row (Take Win, Play Reels, etc.) |
Space |
Equivalent to 'Y' (Play largest number of lines) |
F4 |
Toggle panel visibility |
| Key | Button | Function |
|---|---|---|
CapsLock |
Button17 | Audit |
F |
Button18 | Jackpot |
A |
Button19 | Logic |
S |
Button20 | Main-Opt |
D |
Button21 | Main-Mec |
Enter |
Button22 | Coins |
| Key | Action |
|---|---|
G |
Credit payout combo: finds the "Collect" / "Take Win" button by label (any position), clicks it, then clicks Jackpot (Button18) twice. Falls back to q key if no matching button is found. |
Shift |
Toggle fullscreen (Alt+Enter) and move cursor off-screen |
Escape |
Close emulator |
The shim exports the following functions by ordinal (matching the original DLL's export table):
| Ordinal | Function | Behavior |
|---|---|---|
| 1 | OpenTVicHW32 |
Returns a fake handle (always succeeds) |
| 2 | CloseTVicHW32 |
No-op |
| 3 | GetActiveHW |
Returns the fake handle |
| 12 | GetPortByte |
Returns 0 |
| 13 | SetPortByte |
No-op |
| 14 | GetPortWord |
Returns 0 |
| 15 | SetPortWord |
No-op |
| 16 | GetPortLong |
Returns 0 |
| 17 | SetPortLong |
No-op |
| 30 | MapPhysToLinear |
Allocates zeroed memory via VirtualAlloc |
A C compiler targeting 32-bit Windows (PE32). The EXE is a 32-bit application.
i686-w64-mingw32-gcc -shared -nostdlib -o TVicHW32.dll TVicHW32.c TVicHW32.def -lkernel32 -luser32 -O2 -Wl,--enable-stdcall-fixup -Wl,-e,_DllMain@12cl /LD /O2 TVicHW32.c /link /DEF:TVicHW32.def /OUT:TVicHW32.dll /NODEFAULTLIB kernel32.lib user32.libbuild.bat- Back up the original
TVicHW32.dllin the MK6Emu directory. - Copy the built
TVicHW32.dllinto the MK6Emu directory. - Run
MK6Emu.exe— no compatibility mode needed, noKEYBOARDCONNECTOR.exeneeded.
When the shim DLL loads (DllMain at DLL_PROCESS_ATTACH, before WinMain), it:
- Resolves the addresses of the real
GetVersionandGetVersionExAinkernel32.dll - Walks the main executable's PE import table
- Finds the IAT entries pointing to those functions
- Overwrites them with pointers to the shim's replacements that return Windows 2000 version info
This is the same technique Windows' own Application Compatibility Engine (apphelp.dll) uses when you set compatibility mode on an executable.
MIT