From 2cd6dfde6fbc1f83656d0b2ed8d31eb5015e38aa Mon Sep 17 00:00:00 2001 From: kub Date: Mon, 3 Jan 2022 23:29:31 +0100 Subject: [PATCH] sms, fix FM state save/load --- pico/state.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pico/state.c b/pico/state.c index 6e3596fc..307e5d65 100644 --- a/pico/state.c +++ b/pico/state.c @@ -256,6 +256,7 @@ static int state_save(void *file) } else { CHECKED_WRITE_BUFF(CHUNK_SMS, Pico.ms); + CHECKED_WRITE_BUFF(CHUNK_YM2413, old_opll); } CHECKED_WRITE_BUFF(CHUNK_VRAM, PicoMem.vram); @@ -295,8 +296,6 @@ static int state_save(void *file) memcpy(buff, pcd_event_times, sizeof(pcd_event_times)); CHECKED_WRITE(CHUNK_CD_EVT, 0x40, buff); - CHECKED_WRITE(CHUNK_YM2413, sizeof(OPLL), &old_opll); - len = gfx_context_save(buf2); CHECKED_WRITE(CHUNK_CD_GFX, len, buf2); len = cdc_context_save(buf2); @@ -456,7 +455,7 @@ static int state_load(void *file) case CHUNK_IOPORTS: CHECKED_READ_BUFF(PicoMem.ioports); break; case CHUNK_PSG: CHECKED_READ2(28*4, sn76496_regs); break; - case CHUNK_YM2413: CHECKED_READ2(sizeof(OPLL), &old_opll); break; + case CHUNK_YM2413: CHECKED_READ_BUFF(old_opll); break; case CHUNK_FM: ym2612_regs = YM2612GetRegs(); CHECKED_READ2(0x200+4, ym2612_regs); -- 2.39.5