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

@ -200,26 +200,26 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
OBSEL_NAMEBASE = 50,
OBSEL_NAMESEL = 51,
OBSEL_SIZE = 52,
//$2131 CGADSUB
CGADSUB_MODE = 60,
CGADSUB_HALF = 61,
CGADSUB_BG4 = 62,
CGADSUB_BG3 = 63,
CGADSUB_BG2 = 64,
CGADSUB_BG1 = 65,
CGADSUB_OBJ = 66,
//$2131 CGADSUB
CGADSUB_MODE = 60,
CGADSUB_HALF = 61,
CGADSUB_BG4 = 62,
CGADSUB_BG3 = 63,
CGADSUB_BG2 = 64,
CGADSUB_BG1 = 65,
CGADSUB_OBJ = 66,
CGADSUB_BACKDROP = 67,
//$212C TM
TM_BG1 =70,
TM_BG2 =71,
TM_BG3 =72,
TM_BG4 =73,
TM_OBJ =74,
//$212D TM
TS_BG1 =80,
TS_BG2 =81,
TS_BG3 =82,
TS_BG4 =83,
//$212C TM
TM_BG1 =70,
TM_BG2 =71,
TM_BG3 =72,
TM_BG4 =73,
TM_OBJ =74,
//$212D TM
TS_BG1 =80,
TS_BG2 =81,
TS_BG3 =82,
TS_BG4 =83,
TS_OBJ =84
}

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
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();
}