snes: fix crash with rewind enabled in tales of phantasia. the problem seems to be that during runtosave(), the smp hits a wait opcode (0xff), which it can't get out of. with this fix, the emulator no longer crashes, but the emulated game does crash. more research is needed.

This commit is contained in:
goyuken 2012-12-02 18:32:33 +00:00
parent 20d04f9914
commit 451f786660
4 changed files with 27 additions and 21 deletions

View File

@ -2,7 +2,9 @@ cd bsnes
mkdir obj
mkdir out
export BIZWINCFLAGS="-I. -O3 -masm=intel -DLIBCO_IMPORT -DLIBCO_MSVC -static-libgcc -static-libstdc++"
#for gdb debugging
#export BIZWINCFLAGS="-I. -O0 -g -masm=intel -DLIBCO_IMPORT -DLIBCO_MSVC -static-libgcc -static-libstdc++"
export TARGET_LIBSNES_LIBDEPS="-L ../libco_msvc_win32/release/ -llibco_msvc_win32 -static-libgcc -static-libstdc++"
profile=compatibility platform=win target=libsnes make -e -j
profile=compatibility platform=win target=libsnes make -e -j 4
cd ..
cp bsnes/out/snes.dll ../BizHawk.MultiClient/output/dll/libsneshawk.dll

View File

@ -540,6 +540,10 @@ void SMPcore::op_stw_dp() {
void SMPcore::op_wait() {
while(true) {
if(scheduler.sync == Scheduler::SynchronizeMode::All) {
regs.pc--; // repeat this opcode on next run
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
}
op_io();
op_io();
}