From: notaz Date: Sun, 6 Jul 2008 17:54:24 +0000 (+0000) Subject: bugfix for 68k core on save load X-Git-Tag: v1.85~433 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=374498bcabc88b6f46d77b38b23328c982e84d60;p=picodrive.git bugfix for 68k core on save load git-svn-id: file:///home/notaz/opt/svn/PicoDrive@529 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/Pico/cd/Area.c b/Pico/cd/Area.c index a402d4ea..c4bb2ed6 100644 --- a/Pico/cd/Area.c +++ b/Pico/cd/Area.c @@ -192,7 +192,7 @@ static int g_read_offs = 0; 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(); @@ -213,8 +213,7 @@ PICO_INTERNAL int PicoCdLoadState(void *file) switch (buff[0]) { case CHUNK_M68K: - CHECKED_READ_BUFF(buff); - PicoAreaUnpackCpu(buff, 0); + CHECKED_READ_BUFF(buff_m68k); break; case CHUNK_Z80: @@ -237,8 +236,7 @@ PICO_INTERNAL int PicoCdLoadState(void *file) // 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; @@ -285,7 +283,11 @@ PICO_INTERNAL int PicoCdLoadState(void *file) 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; } diff --git a/Pico/cd/Memory.c b/Pico/cd/Memory.c index b404ae7e..c140976a 100644 --- a/Pico/cd/Memory.c +++ b/Pico/cd/Memory.c @@ -289,7 +289,7 @@ void s68k_reg_write8(u32 a, u32 d) return; // only m68k can change WP case 3: { int dold = Pico_mcd->s68k_regs[3]; - //printf("s68k_regs w3: %02x @%06x\n", (u8)d, SekPcS68k); + //elprintf(EL_STATUS, "s68k_regs w3: %02x s@%06x", (u8)d, SekPcS68k); d &= 0x1d; d |= dold&0xc2; if (d&4) {