1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-11-15 02:37:37 +01:00

jbhook: add adapter hook

This commit is contained in:
233596621999a3accb78d883a9ab4d1f3460d772 2020-06-12 23:41:23 +02:00
parent 77527e346b
commit e5331fbc7c
4 changed files with 14 additions and 0 deletions

View File

@ -5,6 +5,7 @@ deplibs_jbhook := \
ldflags_jbhook := \ ldflags_jbhook := \
-lws2_32 \ -lws2_32 \
-liphlpapi \
libs_jbhook := \ libs_jbhook := \
acioemu \ acioemu \

View File

@ -10,6 +10,7 @@
#include "hook/iohook.h" #include "hook/iohook.h"
#include "hooklib/adapter.h"
#include "hooklib/app.h" #include "hooklib/app.h"
#include "hooklib/rs232.h" #include "hooklib/rs232.h"
#include "hooklib/setupapi.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); app_hook_init(my_dll_entry_init, my_dll_entry_main);
iohook_init(jbhook_handlers, lengthof(jbhook_handlers)); iohook_init(jbhook_handlers, lengthof(jbhook_handlers));
if (!options.disable_adapteremu) {
adapter_hook_init();
}
if (!options.disable_cardemu) { if (!options.disable_cardemu) {
rs232_hook_init(); rs232_hook_init();
} }

View File

@ -37,6 +37,7 @@ void options_init(struct options *options)
options->window_framed = false; options->window_framed = false;
options->disable_p4ioemu = false; options->disable_p4ioemu = false;
options->disable_cardemu = false; options->disable_cardemu = false;
options->disable_adapteremu = false;
} }
bool options_read_cmdline(struct options *options, int argc, const char **argv) 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; break;
} }
case 'a': {
options->disable_adapteremu = true;
break;
}
case 'c': { case 'c': {
options->disable_cardemu = true; options->disable_cardemu = true;
break; break;
@ -90,6 +96,7 @@ void options_print_usage(void)
" -h Print this usage message\n" " -h Print this usage message\n"
" -w Run the game windowed\n" " -w Run the game windowed\n"
" -f Run the game in a framed window (needs -w option)\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 " " -c Disable card emulation (e.g. when running on a "
"real cab)\n" "real cab)\n"
" -p Disable p4io emulation (e.g. when running on a " " -p Disable p4io emulation (e.g. when running on a "

View File

@ -9,6 +9,7 @@ struct options {
bool window_framed; bool window_framed;
bool disable_p4ioemu; bool disable_p4ioemu;
bool disable_cardemu; bool disable_cardemu;
bool disable_adapteremu;
}; };
void options_init_from_cmdline(struct options *options); void options_init_from_cmdline(struct options *options);