dont crash when loading states into newppu which were taken on oldppu
This commit is contained in:
parent
83275f30d7
commit
50c0c2e5e4
|
@ -289,6 +289,11 @@ struct PPUREGS {
|
|||
|
||||
int newppu_get_scanline() { return ppur.status.sl; }
|
||||
int newppu_get_dot() { return ppur.status.cycle; }
|
||||
void newppu_hacky_emergency_reset()
|
||||
{
|
||||
if(ppur.status.end_cycle == 0)
|
||||
ppur.reset();
|
||||
}
|
||||
|
||||
static void makeppulut(void) {
|
||||
int x;
|
||||
|
|
|
@ -11,6 +11,7 @@ extern void (*GameHBIRQHook)(void), (*GameHBIRQHook2)(void);
|
|||
|
||||
int newppu_get_scanline();
|
||||
int newppu_get_dot();
|
||||
void newppu_hacky_emergency_reset();
|
||||
|
||||
/* For cart.c and banksw.h, mostly */
|
||||
extern uint8 NTARAM[0x800], *vnapage[4];
|
||||
|
|
|
@ -974,8 +974,12 @@ void FCEUI_LoadState(const char *fname, bool display_message)
|
|||
loadStateFailed = 1;
|
||||
return; // state doesn't exist; exit cleanly
|
||||
}
|
||||
|
||||
if (FCEUSS_Load(fname, display_message))
|
||||
{
|
||||
//in case we're loading a savestate made with old ppu, we need to make sure ppur's regs used for dividing are ready to go
|
||||
newppu_hacky_emergency_reset();
|
||||
|
||||
//mbg todo netplay
|
||||
#if 0
|
||||
if(FCEUnetplay)
|
||||
|
|
Loading…
Reference in New Issue