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();
switch (buff[0])
{
case CHUNK_M68K:
- CHECKED_READ_BUFF(buff);
- PicoAreaUnpackCpu(buff, 0);
+ CHECKED_READ_BUFF(buff_m68k);
break;
case CHUNK_Z80:
// 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;
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; // only m68k can change WP\r
case 3: {\r
int dold = Pico_mcd->s68k_regs[3];\r
- //printf("s68k_regs w3: %02x @%06x\n", (u8)d, SekPcS68k);\r
+ //elprintf(EL_STATUS, "s68k_regs w3: %02x s@%06x", (u8)d, SekPcS68k);\r
d &= 0x1d;\r
d |= dold&0xc2;\r
if (d&4) {\r