From: kub Date: Fri, 12 Apr 2024 18:08:33 +0000 (+0200) Subject: md, fix vdp reset handling X-Git-Tag: v2.00~79 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7661b80ef4a8543cfe598f2f08f57bebe542111;p=picodrive.git md, fix vdp reset handling --- diff --git a/pico/pico.c b/pico/pico.c index 1d60afd5..34026577 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -77,6 +77,15 @@ void PicoPower(void) // my MD1 VA6 console has this in IO PicoMem.ioports[1] = PicoMem.ioports[2] = PicoMem.ioports[3] = 0xff; + // powerup default VDP register values from TMSS BIOS + Pico.video.reg[0] = Pico.video.reg[1] = 0x04; + Pico.video.reg[0xc] = 0x81; + Pico.video.reg[0xf] = 0x02; + SATaddr = 0x0000; + SATmask = ~0x3ff; + + Pico.video.hint_irq = (PicoIn.AHW & PAHW_PICO ? 5 : 4); + if (PicoIn.AHW & PAHW_MCD) PicoPowerMCD(); diff --git a/pico/videoport.c b/pico/videoport.c index 1cf93a4b..b4d67677 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -982,6 +982,7 @@ PICO_INTERNAL_ASM void PicoVideoWrite(u32 a,unsigned short d) case 0x0c: // renderers should update their palettes if sh/hi mode is changed if ((d^dold)&8) Pico.m.dirtyPal = 1; + if ((d^dold)&1) Pico.est.rendstatus |= PDRAW_DIRTY_SPRITES; break; default: return; @@ -1164,22 +1165,14 @@ unsigned char PicoVideoRead8HV_L(int is_from_z80) void PicoVideoReset(void) { - Pico.video.hint_irq = (PicoIn.AHW & PAHW_PICO ? 5 : 4); Pico.video.pending_ints=0; + Pico.video.reg[1] &= ~0x40; // TODO verify display disabled after reset + Pico.video.reg[10] = 0xff; // HINT is turned off after reset + Pico.video.status = 0x3428 | Pico.m.pal; // 'always set' bits | vblank | collision | pal - // default VDP register values (based on Fusion) - Pico.video.reg[0] = Pico.video.reg[1] = 0x04; - Pico.video.reg[0xc] = 0x81; - Pico.video.reg[0xf] = 0x02; - SATaddr = 0x0000; - SATmask = ~0x1ff; - - memset(VdpSATCache, 0, sizeof(VdpSATCache)); memset(&VdpFIFO, 0, sizeof(VdpFIFO)); Pico.m.dirtyPal = 1; - Pico.video.status = 0x3428 | Pico.m.pal; // 'always set' bits | vblank | collision | pal - PicoDrawBgcDMA(NULL, 0, 0, 0, 0); PicoVideoFIFOMode(0, 1); }