ddr: tweaks to mdxf i/o (#464)

## Link to GitHub Issue, if one exists
#452

## Description of change
* Split the MDXF I/O option into three: auto, thread, and backfill.
`auto` is the same as what `thread` used to be before this change (based
on I/O poll rate), but `thread` now always forces thread poll mode.
`auto` is the default (behavior wise, same as before)
* For the poll rate measurement, start polling after 20s mark to avoid
frame drops during game boot
* Minor code clean up

## Testing
manual test in windowed + full screen
This commit is contained in:
bicarus-dev
2025-12-20 01:37:56 -08:00
committed by GitHub
parent c38f42cb19
commit fbc8bc2502
4 changed files with 78 additions and 32 deletions
+2 -3
View File
@@ -1152,11 +1152,10 @@ int main_implementation(int argc, char *argv[]) {
}
if (options[launcher::Options::DDRP4IOBufferMode].is_active()) {
if (options[launcher::Options::DDRP4IOBufferMode].value_text() == "thread") {
acio::MDXF_BUFFER_FILL_MODE = acio::THREAD_MODE;
acio::MDXF_BUFFER_FILL_MODE = acio::MDXFBufferFillMode::THREAD_MODE;
} else if (options[launcher::Options::DDRP4IOBufferMode].value_text() == "backfill") {
acio::MDXF_BUFFER_FILL_MODE = acio::BACKFILL_MODE;
acio::MDXF_BUFFER_FILL_MODE = acio::MDXFBufferFillMode::BACKFILL_MODE;
}
// else - default (no value)
}
if (options[launcher::Options::MidiAlgoVer].is_active()) {
+4 -2
View File
@@ -2298,13 +2298,15 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
.desc =
"Remember to restart after changing this value.\n\n"
"Sets the algorithm used to populate entries to the buffer of controller polls read by the game.\n\n"
"Thread (default): Starts a thread to periodically insert polls into the buffer (falls back to Backfill if game's refresh rate is at least 120Hz).\n\n"
"Backfill: Fills the buffer on each frame with last known state info at short regular intervals up to the current time, then writes the current state.\n\n"
"auto (default): thread mode if <120Hz, backfill if >=120Hz\n\n"
"thread: starts a thread to periodically insert polls into the buffer\n\n"
"backfill: fills the buffer on each frame with last known state info at short regular intervals up to the current time, then writes the current state.\n\n"
"Only has an effect when emulating P4IO (arkmdxp4.dll)",
.type = OptionType::Enum,
.game_name = "Dance Dance Revolution",
.category = "Game Options (Advanced)",
.elements = {
{"auto", ""},
{"thread", ""},
{"backfill", ""},
},