diff --git a/src/main/jbhook/Module.mk b/src/main/jbhook/Module.mk index 5ea146d..ef8c79e 100644 --- a/src/main/jbhook/Module.mk +++ b/src/main/jbhook/Module.mk @@ -5,6 +5,7 @@ deplibs_jbhook := \ ldflags_jbhook := \ -lws2_32 \ + -liphlpapi \ libs_jbhook := \ acioemu \ diff --git a/src/main/jbhook/dllmain.c b/src/main/jbhook/dllmain.c index 13d4338..f34f35e 100644 --- a/src/main/jbhook/dllmain.c +++ b/src/main/jbhook/dllmain.c @@ -10,6 +10,7 @@ #include "hook/iohook.h" +#include "hooklib/adapter.h" #include "hooklib/app.h" #include "hooklib/rs232.h" #include "hooklib/setupapi.h" @@ -133,6 +134,10 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx) app_hook_init(my_dll_entry_init, my_dll_entry_main); iohook_init(jbhook_handlers, lengthof(jbhook_handlers)); + if (!options.disable_adapteremu) { + adapter_hook_init(); + } + if (!options.disable_cardemu) { rs232_hook_init(); } diff --git a/src/main/jbhook/options.c b/src/main/jbhook/options.c index 06177b2..e384480 100644 --- a/src/main/jbhook/options.c +++ b/src/main/jbhook/options.c @@ -37,6 +37,7 @@ void options_init(struct options *options) options->window_framed = false; options->disable_p4ioemu = false; options->disable_cardemu = false; + options->disable_adapteremu = false; } bool options_read_cmdline(struct options *options, int argc, const char **argv) @@ -64,6 +65,11 @@ bool options_read_cmdline(struct options *options, int argc, const char **argv) break; } + case 'a': { + options->disable_adapteremu = true; + break; + } + case 'c': { options->disable_cardemu = true; break; @@ -90,6 +96,7 @@ void options_print_usage(void) " -h Print this usage message\n" " -w Run the game windowed\n" " -f Run the game in a framed window (needs -w option)\n" + " -a Disable adapter hook\n" " -c Disable card emulation (e.g. when running on a " "real cab)\n" " -p Disable p4io emulation (e.g. when running on a " diff --git a/src/main/jbhook/options.h b/src/main/jbhook/options.h index 4985d77..840318d 100644 --- a/src/main/jbhook/options.h +++ b/src/main/jbhook/options.h @@ -9,6 +9,7 @@ struct options { bool window_framed; bool disable_p4ioemu; bool disable_cardemu; + bool disable_adapteremu; }; void options_init_from_cmdline(struct options *options);