mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
32x, improve loading save state (memory leak, 68k hang)
This commit is contained in:
parent
cd18409722
commit
b1a6586688
2 changed files with 5 additions and 2 deletions
|
@ -618,6 +618,7 @@ void Pico32xStateLoaded(int is_early)
|
|||
|
||||
sh2s[0].m68krcycles_done = sh2s[1].m68krcycles_done = SekCyclesDone();
|
||||
p32x_update_irls(NULL, SekCyclesDone());
|
||||
p32x_timers_recalc();
|
||||
p32x_pwm_state_loaded();
|
||||
p32x_run_events(SekCyclesDone());
|
||||
}
|
||||
|
|
|
@ -2296,11 +2296,13 @@ void PicoMemSetup32x(void)
|
|||
unsigned int rs;
|
||||
int i;
|
||||
|
||||
if (Pico32xMem == NULL)
|
||||
Pico32xMem = plat_mmap(0x06000000, sizeof(*Pico32xMem), 0, 0);
|
||||
if (Pico32xMem == NULL) {
|
||||
elprintf(EL_STATUS, "OOM");
|
||||
return;
|
||||
}
|
||||
memset(Pico32xMem, 0, sizeof(struct Pico32xMem));
|
||||
|
||||
get_bios();
|
||||
|
||||
|
@ -2481,12 +2483,12 @@ void Pico32xMemStateLoaded(void)
|
|||
memset(Pico32xMem->pwm, 0, sizeof(Pico32xMem->pwm));
|
||||
Pico32x.dirty_pal = 1;
|
||||
|
||||
Pico32x.emu_flags &= ~(P32XF_68KCPOLL | P32XF_68KVPOLL);
|
||||
memset(&m68k_poll, 0, sizeof(m68k_poll));
|
||||
msh2.state = 0;
|
||||
msh2.poll_addr = msh2.poll_cycles = msh2.poll_cnt = 0;
|
||||
ssh2.state = 0;
|
||||
ssh2.poll_addr = ssh2.poll_cycles = ssh2.poll_cnt = 0;
|
||||
memset(sh2_poll_fifo, 0, sizeof(sh2_poll_fifo));
|
||||
|
||||
sh2_drc_flush_all();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue