state: setup banks before CPUs on load
authornotaz <notasas@gmail.com>
Fri, 29 Sep 2017 21:17:04 +0000 (00:17 +0300)
committernotaz <notasas@gmail.com>
Fri, 6 Oct 2017 22:36:59 +0000 (01:36 +0300)
pico/state.c

index 88b8655..3cd41b2 100644 (file)
@@ -589,6 +589,9 @@ readend:
   if (PicoAHW & PAHW_32X)\r
     Pico32xStateLoaded(1);\r
 \r
+  if (PicoLoadStateHook != NULL)\r
+    PicoLoadStateHook();\r
+\r
   // must unpack 68k and z80 after banks are set up\r
   if (!(PicoAHW & PAHW_SMS))\r
     SekUnpackCpu(buff_m68k, 0);\r
@@ -683,8 +686,6 @@ static int pico_state_internal(void *afile, int is_save)
       ret = state_load_legacy(afile);\r
     }\r
 \r
-    if (PicoLoadStateHook != NULL)\r
-      PicoLoadStateHook();\r
     Pico.m.dirtyPal = 1;\r
   }\r
 \r