From: notaz Date: Thu, 11 Feb 2010 14:04:14 +0000 (+0000) Subject: sms: some bugfixes X-Git-Tag: v1.85~184 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03065bb617aa86e7a4dfb943781fecb8db8836fb;p=picodrive.git sms: some bugfixes git-svn-id: file:///home/notaz/opt/svn/PicoDrive@870 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/pico/mode4.c b/pico/mode4.c index 4588a9a2..1b337a3b 100644 --- a/pico/mode4.c +++ b/pico/mode4.c @@ -260,6 +260,7 @@ void PicoDoHighPal555M4(void) t |= (t >> 4) & 0x08610861; *dpal = t; } + HighPal[0xe0] = 0; } static void FinalizeLineRGB555M4(int line) diff --git a/pico/sms.c b/pico/sms.c index cc75bffd..1e1e7487 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -257,6 +257,8 @@ void PicoFrameMS(void) for (y = 0; y < lines; y++) { pv->v_counter = Pico.m.scanline = y; + if (y > 218) + pv->v_counter = y - 6; if (y < lines_vis && !skip) PicoLineMode4(y); diff --git a/pico/state.c b/pico/state.c index 60a6f725..27c58a75 100644 --- a/pico/state.c +++ b/pico/state.c @@ -384,6 +384,10 @@ static int state_load(void *file) char header[8]; int ver, len; + memset(buff_m68k, 0, sizeof(buff_m68k)); + memset(buff_s68k, 0, sizeof(buff_s68k)); + memset(buff_z80, 0, sizeof(buff_z80)); + g_read_offs = 0; CHECKED_READ(8, header); if (strncmp(header, "PicoSMCD", 8) && strncmp(header, "PicoSEXT", 8)) @@ -408,7 +412,6 @@ static int state_load(void *file) case CHUNK_Z80: CHECKED_READ_BUFF(buff_z80); - z80_unpack(buff_z80); break; case CHUNK_RAM: CHECKED_READ_BUFF(Pico.ram); break; @@ -499,13 +502,15 @@ readend: if (!(Pico_mcd->s68k_regs[0x36] & 1) && (Pico_mcd->scd.Status_CDC & 1)) cdda_start_play(); - // must unpack after mem is set up SekUnpackCpu(buff_s68k, 1); } + // must unpack 68k and z80 after banks are set up if (!(PicoAHW & PAHW_SMS)) SekUnpackCpu(buff_m68k, 0); + z80_unpack(buff_z80); + if (PicoAHW & PAHW_32X) Pico32xStateLoaded();