From dfc1e133974b2c47e36fcf64dc71031f917a6be6 Mon Sep 17 00:00:00 2001 From: Tau Date: Sun, 3 Nov 2019 15:38:15 -0500 Subject: [PATCH] cardhook: Fold back into chunihook And so the cycle goes on. --- cardhook/dllmain.c | 54 ------------------------------------------- cardhook/meson.build | 21 ----------------- chunihook/config.c | 3 +++ chunihook/config.h | 3 +++ chunihook/dllmain.c | 3 +++ chunihook/meson.build | 1 + meson.build | 1 - 7 files changed, 10 insertions(+), 76 deletions(-) delete mode 100644 cardhook/dllmain.c delete mode 100644 cardhook/meson.build diff --git a/cardhook/dllmain.c b/cardhook/dllmain.c deleted file mode 100644 index ad67a27..0000000 --- a/cardhook/dllmain.c +++ /dev/null @@ -1,54 +0,0 @@ -#include - -#include - -#include "board/config.h" -#include "board/sg-reader.h" - -#include "hook/process.h" - -#include "hooklib/serial.h" -#include "hooklib/spike.h" - -#include "platform/config.h" -#include "platform/dns.h" - -#include "util/dprintf.h" - -static struct aime_config app_aime_config; -static struct dns_config app_dns_config; -static process_entry_t app_startup; - -static DWORD CALLBACK app_pre_startup(void) -{ - dprintf("--- Begin %s ---\n", __func__); - - aime_config_load(&app_aime_config, L".\\segatools.ini"); - dns_config_load(&app_dns_config, L".\\segatools.ini"); - spike_hook_init(L".\\segatools.ini"); - - serial_hook_init(); - sg_reader_hook_init(&app_aime_config, 12); - dns_platform_hook_init(&app_dns_config); - - dprintf("--- End %s ---\n", __func__); - - return app_startup(); -} - -BOOL WINAPI DllMain(HMODULE mod, DWORD cause, void *ctx) -{ - HRESULT hr; - - if (cause != DLL_PROCESS_ATTACH) { - return TRUE; - } - - hr = process_hijack_startup(app_pre_startup, &app_startup); - - if (!SUCCEEDED(hr)) { - dprintf("Failed to hijack process startup: %x\n", (int) hr); - } - - return SUCCEEDED(hr); -} diff --git a/cardhook/meson.build b/cardhook/meson.build deleted file mode 100644 index 1dd59f2..0000000 --- a/cardhook/meson.build +++ /dev/null @@ -1,21 +0,0 @@ -shared_library( - 'cardhook', - name_prefix : '', - include_directories: inc, - implicit_include_directories : false, - c_pch : '../precompiled.h', - dependencies : [ - capnhook.get_variable('hook_dep'), - capnhook.get_variable('hooklib_dep'), - ], - link_with : [ - aimeio_dll, - board_lib, - hooklib_lib, - platform_lib, - util_lib, - ], - sources : [ - 'dllmain.c', - ], -) diff --git a/chunihook/config.c b/chunihook/config.c index 3c6632e..20bb33f 100644 --- a/chunihook/config.c +++ b/chunihook/config.c @@ -6,6 +6,8 @@ #include "amex/config.h" +#include "board/config.h" + #include "chunihook/config.h" #include "hooklib/config.h" @@ -31,6 +33,7 @@ void chuni_hook_config_load( platform_config_load(&cfg->platform, filename); amex_config_load(&cfg->amex, filename); + aime_config_load(&cfg->aime, filename); gfx_config_load(&cfg->gfx, filename); slider_config_load(&cfg->slider, filename); } diff --git a/chunihook/config.h b/chunihook/config.h index 1185992..4b7a683 100644 --- a/chunihook/config.h +++ b/chunihook/config.h @@ -5,6 +5,8 @@ #include "amex/config.h" +#include "board/config.h" + #include "hooklib/config.h" #include "platform/config.h" @@ -16,6 +18,7 @@ struct slider_config { struct chuni_hook_config { struct platform_config platform; struct amex_config amex; + struct aime_config aime; struct gfx_config gfx; struct slider_config slider; }; diff --git a/chunihook/dllmain.c b/chunihook/dllmain.c index d9ec27b..6c1dcf7 100644 --- a/chunihook/dllmain.c +++ b/chunihook/dllmain.c @@ -5,6 +5,8 @@ #include "amex/amex.h" +#include "board/sg-reader.h" + #include "chunihook/config.h" #include "chunihook/jvs.h" #include "chunihook/slider.h" @@ -60,6 +62,7 @@ static DWORD CALLBACK chuni_pre_startup(void) amex_hook_init(&chuni_hook_cfg.amex, chunithm_jvs_init); slider_hook_init(&chuni_hook_cfg.slider); + sg_reader_hook_init(&chuni_hook_cfg.aime, 12); /* Initialize debug helpers */ diff --git a/chunihook/meson.build b/chunihook/meson.build index ebb3403..f341d0f 100644 --- a/chunihook/meson.build +++ b/chunihook/meson.build @@ -9,6 +9,7 @@ shared_library( capnhook.get_variable('hooklib_dep'), ], link_with : [ + aimeio_dll, amex_lib, board_lib, chuniio_dll, diff --git a/meson.build b/meson.build index a3ae212..d77c704 100644 --- a/meson.build +++ b/meson.build @@ -46,7 +46,6 @@ subdir('divaio') subdir('idzio') subdir('mu3io') -subdir('cardhook') subdir('chunihook') subdir('divahook') subdir('idzhook')