notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
final fixes for UIQ3
[picodrive.git]
/
Pico
/
cd
/
Area.c
diff --git
a/Pico/cd/Area.c
b/Pico/cd/Area.c
index
1a4d271
..
164d272
100644
(file)
--- a/
Pico/cd/Area.c
+++ b/
Pico/cd/Area.c
@@
-121,8
+121,10
@@
PICO_INTERNAL int PicoCdSaveState(void *file)
}
if (PicoOpt&3)
CHECKED_WRITE(CHUNK_PSG, 28*4, sn76496_regs);
}
if (PicoOpt&3)
CHECKED_WRITE(CHUNK_PSG, 28*4, sn76496_regs);
- if (PicoOpt&1)
+ if (PicoOpt&1) {
+ ym2612_pack_state();
CHECKED_WRITE(CHUNK_FM, 0x200+4, ym2612_regs);
CHECKED_WRITE(CHUNK_FM, 0x200+4, ym2612_regs);
+ }
if (PicoAHW & PAHW_MCD)
{
if (PicoAHW & PAHW_MCD)
{
@@
-172,7
+174,7
@@
static int g_read_offs = 0;
// when is eof really set?
#define CHECKED_READ(len,data) \
if (areaRead(data, 1, len, file) != len) { \
// when is eof really set?
#define CHECKED_READ(len,data) \
if (areaRead(data, 1, len, file) != len) { \
- if (len == 1 && areaEof(file))
return 0
; \
+ if (len == 1 && areaEof(file))
goto readend
; \
R_ERROR_RETURN("areaRead: premature EOF\n"); \
return 1; \
} \
R_ERROR_RETURN("areaRead: premature EOF\n"); \
return 1; \
} \
@@
-190,7
+192,7
@@
static int g_read_offs = 0;
PICO_INTERNAL int PicoCdLoadState(void *file)
{
PICO_INTERNAL int PicoCdLoadState(void *file)
{
- unsigned char buff[0x60];
+ unsigned char buff[0x60]
, buff_m68k[0x60], buff_s68k[0x60]
;
int ver, len;
void *ym2612_regs = YM2612GetRegs();
int ver, len;
void *ym2612_regs = YM2612GetRegs();
@@
-211,8
+213,7
@@
PICO_INTERNAL int PicoCdLoadState(void *file)
switch (buff[0])
{
case CHUNK_M68K:
switch (buff[0])
{
case CHUNK_M68K:
- CHECKED_READ_BUFF(buff);
- PicoAreaUnpackCpu(buff, 0);
+ CHECKED_READ_BUFF(buff_m68k);
break;
case CHUNK_Z80:
break;
case CHUNK_Z80:
@@
-235,8
+236,7
@@
PICO_INTERNAL int PicoCdLoadState(void *file)
// cd stuff
case CHUNK_S68K:
// cd stuff
case CHUNK_S68K:
- CHECKED_READ_BUFF(buff);
- PicoAreaUnpackCpu(buff, 1);
+ CHECKED_READ_BUFF(buff_s68k);
break;
case CHUNK_PRG_RAM: CHECKED_READ_BUFF(Pico_mcd->prg_ram); break;
break;
case CHUNK_PRG_RAM: CHECKED_READ_BUFF(Pico_mcd->prg_ram); break;
@@
-269,6
+269,7
@@
PICO_INTERNAL int PicoCdLoadState(void *file)
breakswitch:;
}
breakswitch:;
}
+readend:
if (PicoAHW & PAHW_MCD)
{
/* after load events */
if (PicoAHW & PAHW_MCD)
{
/* after load events */
@@
-283,7
+284,11
@@
PICO_INTERNAL int PicoCdLoadState(void *file)
cdda_start_play();
// restore hint vector
*(unsigned short *)(Pico_mcd->bios + 0x72) = Pico_mcd->m.hint_vector;
cdda_start_play();
// restore hint vector
*(unsigned short *)(Pico_mcd->bios + 0x72) = Pico_mcd->m.hint_vector;
+
+ // must unpack after other CD stuff is loaded
+ PicoAreaUnpackCpu(buff_s68k, 1);
}
}
+ PicoAreaUnpackCpu(buff_m68k, 0);
return 0;
}
return 0;
}
@@
-320,6
+325,7
@@
int PicoCdLoadStateGfx(void *file)
}
}
}
}
+readend:
return 0;
}
return 0;
}