expose base_offset as an option

This commit is contained in:
CrazyRedMachine 2024-01-03 14:38:50 +01:00
parent 4706d117a1
commit dc987c46ac
3 changed files with 10 additions and 1 deletions

View File

@ -104,6 +104,8 @@
<disable_multiboot __type="bool">0</disable_multiboot> <disable_multiboot __type="bool">0</disable_multiboot>
<!-- Timing and lanes --> <!-- Timing and lanes -->
<!-- Base visual offset (value will be added to the base SD (-60) and base HD (-76) values) -->
<base_offset __type="s8">0</base_offset>
<!-- Automatically play keysounds during songs --> <!-- Automatically play keysounds during songs -->
<disable_keysounds __type="bool">0</disable_keysounds> <disable_keysounds __type="bool">0</disable_keysounds>
<!-- Offset the keysounds by x ms (negative is earlier). With disable_keysounds, becomes an audio offset --> <!-- Offset the keysounds by x ms (negative is earlier). With disable_keysounds, becomes an audio offset -->

View File

@ -51,6 +51,7 @@ struct popnhax_config {
uint8_t survival_gauge; uint8_t survival_gauge;
bool survival_iidx; bool survival_iidx;
bool survival_spicy; bool survival_spicy;
int8_t base_offset;
}; };
#endif #endif

View File

@ -182,6 +182,8 @@ PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U8, struct popnhax_config, hispeed_auto,
"/popnhax/hispeed_auto") "/popnhax/hispeed_auto")
PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U16, struct popnhax_config, hispeed_default_bpm, PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U16, struct popnhax_config, hispeed_default_bpm,
"/popnhax/hispeed_default_bpm") "/popnhax/hispeed_default_bpm")
PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_S8, struct popnhax_config, base_offset,
"/popnhax/base_offset")
PSMAP_END PSMAP_END
enum BufferIndexes { enum BufferIndexes {
@ -5485,8 +5487,12 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
patch_disable_keysound(); patch_disable_keysound();
} }
if (config.base_offset){
patch_add_to_base_offset(config.base_offset);
}
if (config.keysound_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); patch_keysound_offset(config.keysound_offset);
} }