diff --git a/dist/iidx/iidxhook-09.conf b/dist/iidx/iidxhook-09.conf index d673be7..0e14033 100755 --- a/dist/iidx/iidxhook-09.conf +++ b/dist/iidx/iidxhook-09.conf @@ -52,6 +52,9 @@ misc.disable_clock_set=false # Stub calls to rteffect.dll (10th to DistorteD) misc.rteffect_stub=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security boot version (e.g. GEC02). sec.boot_version=GEC02 diff --git a/dist/iidx/iidxhook-10.conf b/dist/iidx/iidxhook-10.conf index c24ddbf..a2e1504 100755 --- a/dist/iidx/iidxhook-10.conf +++ b/dist/iidx/iidxhook-10.conf @@ -52,6 +52,9 @@ misc.disable_clock_set=false # Stub calls to rteffect.dll (10th to DistorteD) misc.rteffect_stub=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security boot version (e.g. GEC02). sec.boot_version=GEC02 diff --git a/dist/iidx/iidxhook-11.conf b/dist/iidx/iidxhook-11.conf index 89d32e8..9fc9a79 100755 --- a/dist/iidx/iidxhook-11.conf +++ b/dist/iidx/iidxhook-11.conf @@ -52,6 +52,9 @@ misc.disable_clock_set=false # Stub calls to rteffect.dll (10th to DistorteD) misc.rteffect_stub=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security boot version (e.g. GEC02). sec.boot_version=GEC02 diff --git a/dist/iidx/iidxhook-12.conf b/dist/iidx/iidxhook-12.conf index 77d01fa..e279e16 100755 --- a/dist/iidx/iidxhook-12.conf +++ b/dist/iidx/iidxhook-12.conf @@ -55,6 +55,9 @@ misc.disable_clock_set=false # Stub calls to rteffect.dll (10th to DistorteD) misc.rteffect_stub=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security boot version (e.g. GEC02). sec.boot_version=GEC02 diff --git a/dist/iidx/iidxhook-13.conf b/dist/iidx/iidxhook-13.conf index ae27d21..25a2d50 100755 --- a/dist/iidx/iidxhook-13.conf +++ b/dist/iidx/iidxhook-13.conf @@ -55,6 +55,9 @@ misc.disable_clock_set=false # Stub calls to rteffect.dll (10th to DistorteD) misc.rteffect_stub=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security boot version (e.g. GEC02). sec.boot_version=GEC02 diff --git a/dist/iidx/iidxhook-14.conf b/dist/iidx/iidxhook-14.conf index 7dc6ec5..d8c7645 100755 --- a/dist/iidx/iidxhook-14.conf +++ b/dist/iidx/iidxhook-14.conf @@ -46,5 +46,8 @@ gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security black plug mcode id string (e.g. GQC02JAA). sec.black_plug_mcode=GQGLDJAA \ No newline at end of file diff --git a/dist/iidx/iidxhook-15.conf b/dist/iidx/iidxhook-15.conf index e30913a..4d35e15 100755 --- a/dist/iidx/iidxhook-15.conf +++ b/dist/iidx/iidxhook-15.conf @@ -46,5 +46,8 @@ gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security black plug mcode id string (e.g. GQC02JAA). sec.black_plug_mcode=GQHDDJAA \ No newline at end of file diff --git a/dist/iidx/iidxhook-16.conf b/dist/iidx/iidxhook-16.conf index 182ba38..e30f7d7 100755 --- a/dist/iidx/iidxhook-16.conf +++ b/dist/iidx/iidxhook-16.conf @@ -49,5 +49,8 @@ gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security black plug mcode id string (e.g. GQC02JAA). sec.black_plug_mcode=GQI00JAA \ No newline at end of file diff --git a/dist/iidx/iidxhook-17.conf b/dist/iidx/iidxhook-17.conf index bbbeeae..04a471f 100755 --- a/dist/iidx/iidxhook-17.conf +++ b/dist/iidx/iidxhook-17.conf @@ -49,5 +49,8 @@ gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security black plug mcode id string (e.g. GQC02JAA). sec.black_plug_mcode=GCJDJJAA \ No newline at end of file diff --git a/dist/iidx/iidxhook-18-cn.conf b/dist/iidx/iidxhook-18-cn.conf index d5b72dc..8eed203 100644 --- a/dist/iidx/iidxhook-18-cn.conf +++ b/dist/iidx/iidxhook-18-cn.conf @@ -46,5 +46,8 @@ gfx.diagonal_tearing_fix=false # Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware io.disable_io_emu=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security black plug mcode id string (e.g. GQC02JAA). sec.black_plug_mcode=GKJDZCAA diff --git a/dist/iidx/iidxhook-18.conf b/dist/iidx/iidxhook-18.conf index acfe017..51a5995 100755 --- a/dist/iidx/iidxhook-18.conf +++ b/dist/iidx/iidxhook-18.conf @@ -44,4 +44,7 @@ gfx.diagonal_tearing_fix=false io.disable_card_reader_emu=false # Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware -io.disable_io_emu=false \ No newline at end of file +io.disable_io_emu=false + +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ \ No newline at end of file diff --git a/dist/iidx/iidxhook-19.conf b/dist/iidx/iidxhook-19.conf index 35f1870..3f07d94 100755 --- a/dist/iidx/iidxhook-19.conf +++ b/dist/iidx/iidxhook-19.conf @@ -41,4 +41,7 @@ gfx.diagonal_tearing_fix=false io.disable_card_reader_emu=false # Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware -io.disable_io_emu=false \ No newline at end of file +io.disable_io_emu=false + +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ \ No newline at end of file diff --git a/dist/iidx/iidxhook-20-cn.conf b/dist/iidx/iidxhook-20-cn.conf index 187b6a8..0c4e207 100644 --- a/dist/iidx/iidxhook-20-cn.conf +++ b/dist/iidx/iidxhook-20-cn.conf @@ -43,5 +43,8 @@ gfx.diagonal_tearing_fix=false # Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware io.disable_io_emu=false +# Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data +misc.settings_path=.\ + # Security black plug mcode id string (e.g. GQC02JAA). sec.black_plug_mcode=GKJDZCAA diff --git a/src/main/iidxhook-util/config-misc.c b/src/main/iidxhook-util/config-misc.c index 56a15dc..acdb749 100644 --- a/src/main/iidxhook-util/config-misc.c +++ b/src/main/iidxhook-util/config-misc.c @@ -6,9 +6,11 @@ #define IIDXHOOK_CONFIG_MISC_DISABLE_CLOCK_SET_KEY "misc.disable_clock_set" #define IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY "misc.rteffect_stub" +#define IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY "misc.settings_path" #define IIDXHOOK_CONFIG_MISC_DEFAULT_DISABLE_CLOCK_SET_VALUE false #define IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE false +#define IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE ".\\" void iidxhook_config_misc_init(struct cconfig *config) { @@ -23,6 +25,12 @@ void iidxhook_config_misc_init(struct cconfig *config) IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY, IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE, "Stub calls to rteffect.dll (10th to DistorteD)"); + + cconfig_util_set_str( + config, + IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY, + IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE, + "Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data"); } void iidxhook_config_misc_get( @@ -51,4 +59,17 @@ void iidxhook_config_misc_get( IIDXHOOK_CONFIG_MISC_RTEFFECT_STUB_KEY, IIDXHOOK_CONFIG_MISC_DEFAULT_RTEFFECT_STUB_VALUE); } + + if (!cconfig_util_get_str( + config, + IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY, + config_misc->settings_path, + sizeof(config_misc->settings_path), + IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE)) { + log_warning( + "Invalid value for key '%s' specified, fallback " + "to default '%s'", + IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY, + IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE); + } } diff --git a/src/main/iidxhook-util/config-misc.h b/src/main/iidxhook-util/config-misc.h index 7391ac0..743e83d 100644 --- a/src/main/iidxhook-util/config-misc.h +++ b/src/main/iidxhook-util/config-misc.h @@ -1,11 +1,14 @@ #ifndef IIDXHOOK_CONFIG_MISC_H #define IIDXHOOK_CONFIG_MISC_H +#include + #include "cconfig/cconfig.h" struct iidxhook_config_misc { bool disable_clock_set; bool rteffect_stub; + char settings_path[MAX_PATH]; }; void iidxhook_config_misc_init(struct cconfig *config); diff --git a/src/main/iidxhook-util/settings.c b/src/main/iidxhook-util/settings.c index 40933b1..761b3f8 100644 --- a/src/main/iidxhook-util/settings.c +++ b/src/main/iidxhook-util/settings.c @@ -13,6 +13,7 @@ #include "util/defs.h" #include "util/fs.h" #include "util/log.h" +#include "util/mem.h" #include "util/str.h" /* ------------------------------------------------------------------------- */ @@ -32,6 +33,24 @@ static const struct hook_symbol settings_hook_syms[] = { }; static bool settings_folders_checked; +static char settings_path[MAX_PATH] = ".\\"; + +/* ------------------------------------------------------------------------- */ + +static void settings_build_new_path(const char* orig_path, char* new_path, size_t new_path_len) +{ + size_t settings_path_len; + + settings_path_len = strlen(settings_path); + + log_assert(settings_path_len + strlen(orig_path) < new_path_len); + + strcpy(new_path, settings_path); + strcat(new_path, orig_path); + + /* Remove : of drive letter. Multiple \ are fine and handled by windows */ + new_path[settings_path_len + 1] = '\\'; +} /* ------------------------------------------------------------------------- */ @@ -44,8 +63,8 @@ BOOL WINAPI my_CreateDirectoryA( lpPathName[1] == ':') { char new_path[MAX_PATH]; - strcpy(new_path, lpPathName); - new_path[1] = '\\'; + settings_build_new_path(lpPathName, new_path, sizeof(new_path)); + log_misc("(CreateDir) Remapped settings path %s", new_path); return real_CreateDirectoryA(new_path, lpSecurityAttributes); @@ -61,43 +80,88 @@ void settings_hook_init(void) hook_table_apply( NULL, "kernel32.dll", settings_hook_syms, lengthof(settings_hook_syms)); - log_info("Inserted settings hooks"); + log_info("Inserted settings hooks, settings path: %s", settings_path); +} + +void settings_hook_set_path(const char* path) +{ + size_t len; + + len = strlen(path); + + log_assert(path > 0); + log_assert(len < MAX_PATH); + + strcpy(settings_path, path); + + /* Ensure trailing \\ to allow simple concatinations in hooks */ + if (settings_path[len - 1] != '\\') { + log_assert(len + 1 < MAX_PATH); + + settings_path[len] = '\\'; + settings_path[len + 1] = '\0'; + } + + log_info("Settings path: %s", settings_path); } HRESULT settings_hook_dispatch_irp(struct irp *irp) { if (irp->op == IRP_OP_OPEN && - (irp->open_filename[0] == L'd' || irp->open_filename[0] == L'e' || - irp->open_filename[0] == L'f') && - irp->open_filename[1] == L':') { - char *log_str; + (irp->open_filename[0] == L'd' || irp->open_filename[0] == L'e' || + irp->open_filename[0] == L'f') && + irp->open_filename[1] == L':') { + HRESULT result; + char new_path[MAX_PATH]; + const wchar_t *old_filename_wstr; + wchar_t *filename_wstr; + char *filename_cstr; - ((wchar_t *) irp->open_filename)[1] = L'\\'; + log_assert(wstr_narrow(irp->open_filename, &filename_cstr)); - wstr_narrow(irp->open_filename, &log_str); - log_misc("Remapped settings path %s", log_str); - free(log_str); + settings_build_new_path(filename_cstr, new_path, sizeof(new_path)); - /* Create local settings folders if not available */ + free(filename_cstr); + + log_misc("Remapped settings path to %s", new_path); + + filename_wstr = str_widen(new_path); + + /* Temporarily swap open_filename */ + old_filename_wstr = irp->open_filename; + irp->open_filename = filename_wstr; + + /* Create settings folders if not available */ if (!settings_folders_checked) { settings_folders_checked = true; for (char c = 'd'; c <= 'f'; c++) { - char str[3]; + char new_path_folder[MAX_PATH]; + size_t settings_path_len = strlen(settings_path); - str[0] = c; - str[1] = '\\'; - str[2] = '\0'; + log_assert(settings_path_len + 3 < MAX_PATH); - if (!path_exists(str)) { - log_misc("Creating local settings folder %s\\", str); - CreateDirectoryA(str, NULL); + strcpy(new_path_folder, settings_path); + + new_path_folder[settings_path_len] = c; + new_path_folder[settings_path_len + 1] = '\\'; + new_path_folder[settings_path_len + 2] = '\0'; + + if (!path_exists(new_path_folder)) { + log_misc("Creating local settings folder %s", new_path_folder); + CreateDirectoryA(new_path_folder, NULL); } } } - return iohook_invoke_next(irp); + result = iohook_invoke_next(irp); + + /* Revert to original irp */ + irp->open_filename = old_filename_wstr; + free(filename_wstr); + + return result; } return iohook_invoke_next(irp); diff --git a/src/main/iidxhook-util/settings.h b/src/main/iidxhook-util/settings.h index 17dce31..5632f8d 100644 --- a/src/main/iidxhook-util/settings.h +++ b/src/main/iidxhook-util/settings.h @@ -4,12 +4,21 @@ #include "hook/iohook.h" /** - * Remaps the paths for the settings drives d:\, e:\ and f:\ - * to local folders e\ and f\. - * Needed on IIDX 9th to Sirius. + * Remaps the paths for storing "settings data" that are usually stored on the + * drives d:\, e:\ and f:\ by the game. This defaults to the local folders + * d\, e\ and f\. + * + * Required hook for 9th to Lincle. */ void settings_hook_init(void); +/** + * Change the path where settings file are stored. + * + * @param path Destination path for storage, relative or absolute. + */ +void settings_hook_set_path(const char* path); + /** * iohook dispatch function */ diff --git a/src/main/iidxhook1/dllmain.c b/src/main/iidxhook1/dllmain.c index f8d9d53..2eadfeb 100644 --- a/src/main/iidxhook1/dllmain.c +++ b/src/main/iidxhook1/dllmain.c @@ -191,6 +191,12 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) effector_hook_init(); } + /* Settings paths */ + + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + /* Direct3D and USER32 hooks */ iidxhook1_setup_d3d9_hooks(&config_gfx, &config_iidxhook1); diff --git a/src/main/iidxhook2/dllmain.c b/src/main/iidxhook2/dllmain.c index fbcf65e..7927de2 100644 --- a/src/main/iidxhook2/dllmain.c +++ b/src/main/iidxhook2/dllmain.c @@ -184,6 +184,12 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) effector_hook_init(); } + /* Settings paths */ + + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + /* Direct3D and USER32 hooks */ iidxhook2_setup_d3d9_hooks(&config_gfx, &config_iidxhook2); diff --git a/src/main/iidxhook3/dllmain.c b/src/main/iidxhook3/dllmain.c index 67dd09a..45697bd 100644 --- a/src/main/iidxhook3/dllmain.c +++ b/src/main/iidxhook3/dllmain.c @@ -181,6 +181,12 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) eamuse_set_addr(&config_eamuse.server); eamuse_check_connection(); + /* Settings paths */ + + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + /* Direct3D and USER32 hooks */ iidxhook3_setup_d3d9_hooks(&config_gfx); diff --git a/src/main/iidxhook4-cn/dllmain.c b/src/main/iidxhook4-cn/dllmain.c index 550a418..d8dc096 100644 --- a/src/main/iidxhook4-cn/dllmain.c +++ b/src/main/iidxhook4-cn/dllmain.c @@ -29,6 +29,7 @@ #include "iidxhook-util/config-gfx.h" #include "iidxhook-util/config-io.h" #include "iidxhook-util/config-sec.h" +#include "iidxhook-util/config-misc.h" #include "iidxhook-util/d3d9.h" #include "iidxhook-util/settings.h" @@ -117,6 +118,7 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) struct iidxhook_util_config_eamuse config_eamuse; struct iidxhook_config_gfx config_gfx; struct iidxhook_config_sec config_sec; + struct iidxhook_config_misc config_misc; if (iidxhook_init_check) { return real_OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId); @@ -134,6 +136,7 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) iidxhook_config_gfx_init(config); iidxhook_config_io_init(config); iidxhook_config_sec_init(config); + iidxhook_config_misc_init(config); if (!cconfig_hook_config_init( config, @@ -147,6 +150,7 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) iidxhook_config_gfx_get(&config_gfx, config); iidxhook_config_io_get(&config_io, config); iidxhook_config_sec_get(&config_sec, config); + iidxhook_config_misc_get(&config_misc, config); cconfig_finit(config); @@ -169,6 +173,10 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId) iidxhook4_cn_setup_d3d9_hooks(&config_gfx); + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + if (!config_io.disable_io_emu) { log_info("Starting IIDX IO backend"); diff --git a/src/main/iidxhook4/dllmain.c b/src/main/iidxhook4/dllmain.c index 0d85bc5..8c291d8 100644 --- a/src/main/iidxhook4/dllmain.c +++ b/src/main/iidxhook4/dllmain.c @@ -29,6 +29,7 @@ #include "iidxhook-util/chart-patch.h" #include "iidxhook-util/config-gfx.h" #include "iidxhook-util/config-io.h" +#include "iidxhook-util/config-misc.h" #include "iidxhook-util/d3d9.h" #include "iidxhook-util/log-server.h" #include "iidxhook-util/settings.h" @@ -100,6 +101,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) struct cconfig *config; struct iidxhook_config_gfx config_gfx; + struct iidxhook_config_misc config_misc; log_server_init(); log_info("-------------------------------------------------------------"); @@ -110,6 +112,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) iidxhook_config_gfx_init(config); iidxhook_config_io_init(config); + iidxhook_config_misc_init(config); if (!cconfig_hook_config_init( config, @@ -122,6 +125,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) iidxhook_config_gfx_get(&config_gfx, config); iidxhook_config_io_get(&config_io, config); + iidxhook_config_misc_get(&config_misc, config); cconfig_finit(config); @@ -130,6 +134,10 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) iidxhook4_setup_d3d9_hooks(&config_gfx); + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + if (!config_io.disable_io_emu) { log_info("Starting IIDX IO backend"); diff --git a/src/main/iidxhook5-cn/dllmain.c b/src/main/iidxhook5-cn/dllmain.c index fbf66b0..4700eb2 100644 --- a/src/main/iidxhook5-cn/dllmain.c +++ b/src/main/iidxhook5-cn/dllmain.c @@ -29,6 +29,7 @@ #include "iidxhook-util/config-gfx.h" #include "iidxhook-util/config-io.h" #include "iidxhook-util/config-sec.h" +#include "iidxhook-util/config-misc.h" #include "iidxhook-util/d3d9.h" #include "iidxhook-util/settings.h" @@ -98,6 +99,7 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass) struct iidxhook_util_config_eamuse config_eamuse; struct iidxhook_config_gfx config_gfx; struct iidxhook_config_sec config_sec; + struct iidxhook_config_misc config_misc; if (iidxhook_init_check) { return real_RegisterClassA(lpWndClass); @@ -115,6 +117,7 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass) iidxhook_config_gfx_init(config); iidxhook_config_io_init(config); iidxhook_config_sec_init(config); + iidxhook_config_misc_init(config); if (!cconfig_hook_config_init( config, @@ -128,6 +131,7 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass) iidxhook_config_gfx_get(&config_gfx, config); iidxhook_config_io_get(&config_io, config); iidxhook_config_sec_get(&config_sec, config); + iidxhook_config_misc_get(&config_misc, config); cconfig_finit(config); @@ -150,6 +154,10 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass) iidxhook5_cn_setup_d3d9_hooks(&config_gfx); + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + if (!config_io.disable_io_emu) { log_info("Starting IIDX IO backend"); diff --git a/src/main/iidxhook5/dllmain.c b/src/main/iidxhook5/dllmain.c index 738a4c8..a533d34 100644 --- a/src/main/iidxhook5/dllmain.c +++ b/src/main/iidxhook5/dllmain.c @@ -28,6 +28,7 @@ #include "iidxhook-util/acio.h" #include "iidxhook-util/config-gfx.h" #include "iidxhook-util/config-io.h" +#include "iidxhook-util/config-misc.h" #include "iidxhook-util/d3d9.h" #include "iidxhook-util/log-server.h" #include "iidxhook-util/settings.h" @@ -82,6 +83,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) struct cconfig *config; struct iidxhook_config_gfx config_gfx; + struct iidxhook_config_misc config_misc; log_server_init(); log_info("-------------------------------------------------------------"); @@ -92,6 +94,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) iidxhook_config_gfx_init(config); iidxhook_config_io_init(config); + iidxhook_config_misc_init(config); if (!cconfig_hook_config_init( config, @@ -104,6 +107,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) iidxhook_config_gfx_get(&config_gfx, config); iidxhook_config_io_get(&config_io, config); + iidxhook_config_misc_get(&config_misc, config); cconfig_finit(config); @@ -112,6 +116,10 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param) iidxhook5_setup_d3d9_hooks(&config_gfx); + if (strlen(config_misc.settings_path) > 0) { + settings_hook_set_path(config_misc.settings_path); + } + if (!config_io.disable_io_emu) { log_info("Starting IIDX IO backend");