mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
Live mod options: overrides end with their session's plan
Review (#602): live_option_values() was process-static and never cleared, so an override set in one session outlived mod_runtime_initialize and a new committed plan (committed 'eight', API still answered the old 'four'). Every plan change -- initialise, commit, the netplay plan (vanilla or negotiated) -- now drops the overrides. test_mod_runtime: a second session answers its own committed value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1124,6 +1124,17 @@ int main(int argc, char** argv) {
|
||||
std::string(value) == "four",
|
||||
"a refused live set must not change the value later reads see");
|
||||
option_changed_refuse = 0;
|
||||
/* A new session (initialise + commit) answers its own committed
|
||||
* plan, not the previous session's live override. */
|
||||
check(PSXRecompV4::mod_runtime_initialize(
|
||||
req_root, "SLUS-REQ", 0x80002000, {}, &error),
|
||||
error.c_str());
|
||||
check(PSXRecompV4::mod_runtime_commit(stock_path, &error),
|
||||
"the second session must commit");
|
||||
mod_runtime_activate_plugins();
|
||||
check(psx_mod_option_value("runtime.ram", "big-ram", "size", value, sizeof(value)) == 1 &&
|
||||
std::string(value) == "eight",
|
||||
"a live override must not outlive its session's plan");
|
||||
check(psx_mod_set_option_live("runtime.ram", "no-such-feature", "size", "x") == 0,
|
||||
"features outside the plan are not live-settable");
|
||||
check(psx_mod_save_selection() == 1, "saving the selection mid-session must succeed");
|
||||
|
||||
Reference in New Issue
Block a user