libretro, improve 32x save/load for run-ahead

This commit is contained in:
kub 2022-01-03 23:36:44 +01:00
parent b72662e224
commit 92f7a430ca
2 changed files with 8 additions and 0 deletions

View file

@ -872,9 +872,14 @@ int state_fseek(void *file, long offset, int whence)
size_t retro_serialize_size(void)
{
struct savestate_state state = { 0, };
unsigned AHW = PicoIn.AHW;
int ret;
/* we need the max possible size here, so include 32X for MD and MCD */
if (!(AHW & (PAHW_SMS|PAHW_PICO|PAHW_SVP)))
PicoIn.AHW |= PAHW_32X;
ret = PicoStateFP(&state, 1, NULL, state_skip, NULL, state_fseek);
PicoIn.AHW = AHW;
if (ret != 0)
return 0;