sms, fix FM state save/load
authorkub <derkub@gmail.com>
Mon, 3 Jan 2022 22:29:31 +0000 (23:29 +0100)
committerkub <derkub@gmail.com>
Mon, 3 Jan 2022 22:29:31 +0000 (23:29 +0100)
pico/state.c

index 6e3596f..307e5d6 100644 (file)
@@ -256,6 +256,7 @@ static int state_save(void *file)
   }\r
   else {\r
     CHECKED_WRITE_BUFF(CHUNK_SMS, Pico.ms);\r
+    CHECKED_WRITE_BUFF(CHUNK_YM2413, old_opll);\r
   }\r
 \r
   CHECKED_WRITE_BUFF(CHUNK_VRAM,  PicoMem.vram);\r
@@ -295,8 +296,6 @@ static int state_save(void *file)
     memcpy(buff, pcd_event_times, sizeof(pcd_event_times));\r
     CHECKED_WRITE(CHUNK_CD_EVT, 0x40, buff);\r
 \r
-    CHECKED_WRITE(CHUNK_YM2413, sizeof(OPLL), &old_opll);\r
-\r
     len = gfx_context_save(buf2);\r
     CHECKED_WRITE(CHUNK_CD_GFX, len, buf2);\r
     len = cdc_context_save(buf2);\r
@@ -456,7 +455,7 @@ static int state_load(void *file)
 \r
       case CHUNK_IOPORTS: CHECKED_READ_BUFF(PicoMem.ioports); break;\r
       case CHUNK_PSG:     CHECKED_READ2(28*4, sn76496_regs); break;\r
-      case CHUNK_YM2413:  CHECKED_READ2(sizeof(OPLL), &old_opll); break;\r
+      case CHUNK_YM2413:  CHECKED_READ_BUFF(old_opll); break;\r
       case CHUNK_FM:\r
         ym2612_regs = YM2612GetRegs();\r
         CHECKED_READ2(0x200+4, ym2612_regs);\r