diff --git a/Package.mk b/Package.mk index f79a357..e85047f 100644 --- a/Package.mk +++ b/Package.mk @@ -179,6 +179,7 @@ $(BUILD_DIR_ZIP)/mai2.zip: $(V)cp $(BUILD_DIR_64)/subprojects/capnhook/inject/inject.exe \ $(BUILD_DIR_GAMES_64)/mai2hook/mai2hook.dll \ $(DIST_DIR)/mai2/segatools.ini \ + $(DIST_DIR)/mai2/config_hook.json \ $(DIST_DIR)/mai2/launch.bat \ $(BUILD_DIR_ZIP)/mai2 $(V)cp pki/billing.pub \ diff --git a/dist/ekt/segatools_satellite.ini b/dist/ekt/segatools_satellite.ini index 1f3474c..a07a2b2 100644 --- a/dist/ekt/segatools_satellite.ini +++ b/dist/ekt/segatools_satellite.ini @@ -77,6 +77,12 @@ enable=1 ; modding frameworks such as BepInEx. targetAssembly= +[gfx] +; Enables the graphics hook. +enable=1 +; Enable DPI awareness for the game process, preventing Windows from stretching the game window if a DPI scaling higher than 100% is used +dpiAware=1 + [printer] ; G-Printec CX-7000 Printer printer emulation setting. enable=1 diff --git a/dist/ekt/segatools_terminal.ini b/dist/ekt/segatools_terminal.ini index bfb74ee..71c0195 100644 --- a/dist/ekt/segatools_terminal.ini +++ b/dist/ekt/segatools_terminal.ini @@ -80,6 +80,12 @@ enable=1 ; modding frameworks such as BepInEx. targetAssembly= +[gfx] +; Enables the graphics hook. +enable=1 +; Enable DPI awareness for the game process, preventing Windows from stretching the game window if a DPI scaling higher than 100% is used +dpiAware=1 + ; ----------------------------------------------------------------------------- ; LED settings ; ----------------------------------------------------------------------------- diff --git a/dist/mercury/segatools.ini b/dist/mercury/segatools.ini index 07fdffb..d866a6b 100644 --- a/dist/mercury/segatools.ini +++ b/dist/mercury/segatools.ini @@ -129,6 +129,10 @@ path= ; world. An improved solution will be provided later. [io4] +; Only enables input when the game's main window is focused. Needs to be +; disabled for WACVR. +foreground=0 + ; Test button virtual-key code. Default is the F1 key. test=0x70 ; Service button virtual-key code. Default is the F2 key. diff --git a/dist/mu3/segatools.ini b/dist/mu3/segatools.ini index 784800d..dc72f69 100644 --- a/dist/mu3/segatools.ini +++ b/dist/mu3/segatools.ini @@ -90,7 +90,6 @@ enable=1 ; Enable DPI awareness for the game process, preventing Windows from stretching the game window if a DPI scaling higher than 100% is used dpiAware=1 - [unity] ; Enable Unity hook. This will allow you to run custom .NET code before the game enable=1 diff --git a/games/ekthook/config.c b/games/ekthook/config.c index e3f015b..e98cafe 100644 --- a/games/ekthook/config.c +++ b/games/ekthook/config.c @@ -3,6 +3,8 @@ #include "board/config.h" +#include "gfxhook/config.h" + #include "ekthook/config.h" #include "ekthook/ekt-dll.h" @@ -98,6 +100,7 @@ void ekt_hook_config_load( platform_config_load(&cfg->platform, filename); aime_config_load(&cfg->aime, filename); io4_config_load(&cfg->io4, filename); + gfx_config_load(&cfg->gfx, filename); dvd_config_load(&cfg->dvd, filename); led15093_config_load(&cfg->led15093, filename); y3_config_load(&cfg->y3, filename); diff --git a/games/ekthook/config.h b/games/ekthook/config.h index 358e3b9..5584443 100644 --- a/games/ekthook/config.h +++ b/games/ekthook/config.h @@ -6,6 +6,8 @@ #include "board/config.h" #include "board/led15093.h" +#include "gfxhook/gfx.h" + #include "ekthook/ekt-dll.h" #include "hooklib/config.h" @@ -20,6 +22,7 @@ struct ekt_hook_config { struct platform_config platform; struct aime_config aime; struct io4_config io4; + struct gfx_config gfx; struct dvd_config dvd; struct led15093_config led15093; struct y3_config y3; diff --git a/games/ekthook/dllmain.c b/games/ekthook/dllmain.c index a449df4..159d149 100644 --- a/games/ekthook/dllmain.c +++ b/games/ekthook/dllmain.c @@ -29,6 +29,12 @@ #include "board/sg-reader.h" #include "board/led15093.h" +#include "gfxhook/d3d9.h" +#include "gfxhook/d3d11.h" +#include "gfxhook/dxgi.h" +#include "gfxhook/gfx.h" + + #include "hook/process.h" #include "hook/iohook.h" @@ -103,6 +109,9 @@ static DWORD CALLBACK ekt_pre_startup(void) /* Hook Win32 APIs */ dvd_hook_init(&ekt_hook_cfg.dvd, ekt_hook_mod); + gfx_hook_init(&ekt_hook_cfg.gfx); + gfx_d3d11_hook_init(&ekt_hook_cfg.gfx, ekt_hook_mod); + gfx_dxgi_hook_init(&ekt_hook_cfg.gfx, ekt_hook_mod); serial_hook_init(); createprocess_push_hook_w(L"fsutil", L"", L"", true, true); diff --git a/games/ekthook/ekthook.def b/games/ekthook/ekthook.def index f03d8d8..634623a 100644 --- a/games/ekthook/ekthook.def +++ b/games/ekthook/ekthook.def @@ -1,6 +1,11 @@ LIBRARY ekthook EXPORTS + CreateDXGIFactory + CreateDXGIFactory1 + CreateDXGIFactory2 + D3D11CreateDevice + D3D11CreateDeviceAndSwapChain aime_io_get_api_version aime_io_init aime_io_led_set_color diff --git a/games/ekthook/meson.build b/games/ekthook/meson.build index 2b3ef34..8ef7850 100644 --- a/games/ekthook/meson.build +++ b/games/ekthook/meson.build @@ -11,6 +11,7 @@ shared_library( link_with : [ aimeio_lib, board_lib, + gfxhook_lib, ektio_lib, hooklib_lib, jvs_lib,