From dc987c46ac47dced73919340a2611a0a4d16fdd7 Mon Sep 17 00:00:00 2001 From: CrazyRedMachine Date: Wed, 3 Jan 2024 14:38:50 +0100 Subject: [PATCH] expose base_offset as an option --- dist/popnhax/popnhax.xml | 2 ++ popnhax/config.h | 1 + popnhax/dllmain.cc | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dist/popnhax/popnhax.xml b/dist/popnhax/popnhax.xml index 524f003..ea8830a 100644 --- a/dist/popnhax/popnhax.xml +++ b/dist/popnhax/popnhax.xml @@ -104,6 +104,8 @@ 0 + + 0 0 diff --git a/popnhax/config.h b/popnhax/config.h index 50d16eb..df8c72b 100644 --- a/popnhax/config.h +++ b/popnhax/config.h @@ -51,6 +51,7 @@ struct popnhax_config { uint8_t survival_gauge; bool survival_iidx; bool survival_spicy; + int8_t base_offset; }; #endif diff --git a/popnhax/dllmain.cc b/popnhax/dllmain.cc index 58346b4..cff4bb8 100644 --- a/popnhax/dllmain.cc +++ b/popnhax/dllmain.cc @@ -182,6 +182,8 @@ PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U8, struct popnhax_config, hispeed_auto, "/popnhax/hispeed_auto") PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U16, struct popnhax_config, hispeed_default_bpm, "/popnhax/hispeed_default_bpm") +PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_S8, struct popnhax_config, base_offset, + "/popnhax/base_offset") PSMAP_END enum BufferIndexes { @@ -5485,8 +5487,12 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv patch_disable_keysound(); } + if (config.base_offset){ + patch_add_to_base_offset(config.base_offset); + } + if (config.keysound_offset){ - /* must be called _after_ force_hd_timing */ + /* must be called _after_ force_hd_timing and base_offset */ patch_keysound_offset(config.keysound_offset); }