Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force-enable coprocessor delayed-sync while creating a save-state. #330

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bsnes/sfc/system/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ auto System::run() -> void {
}

auto System::runToSave() -> void {
// Enable coprocessor delayed sync if it is off - this is extremely important
// for coprocessor games, as many will not sync correctly for states when the
// option is off.
bool delay_sync_prev = configuration.hacks.coprocessor.delayedSync;
configuration.hacks.coprocessor.delayedSync = true;

auto method = configuration.system.serialization.method;

//these games will periodically deadlock when using "Fast" synchronization
Expand All @@ -30,6 +36,9 @@ auto System::runToSave() -> void {

scheduler.mode = Scheduler::Mode::Run;
scheduler.active = cpu.thread;

// Restore coprocessor delayed sync to whatever it was previous to the state save operation
configuration.hacks.coprocessor.delayedSync = delay_sync_prev;
}

auto System::runToSaveFast() -> void {
Expand Down