From: kub Date: Mon, 3 Jan 2022 22:29:31 +0000 (+0100) Subject: sms, fix FM state save/load X-Git-Tag: v2.00~385 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cd6dfde6fbc1f83656d0b2ed8d31eb5015e38aa;p=picodrive.git sms, fix FM state save/load --- 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);