X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FVideoPort.c;h=f5d4e1b8bb64ea19a7820636a858a4f9df7856f7;hb=5de27868df4df82d38901a804ec6fb32eb6ab5a6;hp=ffbda060cc604639add8029f147898f0a51f9c4b;hpb=3aa1e148a28da9b4e10e824984f7b3a4908b1ace;p=picodrive.git diff --git a/Pico/VideoPort.c b/Pico/VideoPort.c index ffbda06..f5d4e1b 100644 --- a/Pico/VideoPort.c +++ b/Pico/VideoPort.c @@ -22,6 +22,7 @@ typedef unsigned int u32; #define UTYPES_DEFINED #endif +int (*PicoDmaHook)(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp) = NULL; static __inline void AutoIncrement(void) { @@ -104,7 +105,7 @@ static void DmaSlow(int len) if ((source&0xe00000)==0xe00000) { // Ram pd=(u16 *)(Pico.ram+(source&0xfffe)); pdend=(u16 *)(Pico.ram+0x10000); - } else if(PicoMCD & 1) { + } else if (PicoMCD & 1) { elprintf(EL_VDPDMA, "DmaSlow CD, r3=%02x", Pico_mcd->s68k_regs[3]); if(source<0x20000) { // Bios area pd=(u16 *)(Pico_mcd->bios+(source&~1)); @@ -129,15 +130,17 @@ static void DmaSlow(int len) pd=(u16 *)(prg_ram+(source&0x1fffe)); pdend=(u16 *)(prg_ram+0x20000); } else { - elprintf(EL_VDPDMA|EL_ANOMALY, "DmaSlow FIXME: unsupported src"); + elprintf(EL_VDPDMA|EL_ANOMALY, "DmaSlow[%i] %06x->%04x: FIXME: unsupported src", Pico.video.type, source, a); return; } } else { - if(source%04x: invalid src", Pico.video.type, source, a); return; } } @@ -374,29 +377,24 @@ PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d) //if(num==01) dprintf("set_blank: %i @ %06x [%i|%i]", !((d&0x40)>>6), SekPc, Pico.m.scanline, SekCyclesDone()); //if(num==10) dprintf("hint_set: %i @ %06x [%i|%i]", (unsigned char)d, SekPc, Pico.m.scanline, SekCyclesDone()); pvid->reg[num]=(unsigned char)d; -#if !(defined(EMU_C68K) && defined(EMU_M68K)) // not debugging Cyclone +#ifndef EMU_CORE_DEBUG // update IRQ level (Lemmings, Wiz 'n' Liz intro, ... ) // may break if done improperly: // International Superstar Soccer Deluxe (crash), Street Racer (logos), Burning Force (gfx), - // Fatal Rewind (hang), Sesame Street Counting Cafe - if(num < 2) { -#ifdef EMU_C68K - // hack: make sure we do not touch the irq line if Cyclone is just about to take the IRQ - if (PicoCpuCM68k.irq <= (PicoCpuCM68k.srh&7)) { -#endif - int lines, pints; + // Fatal Rewind (crash), Sesame Street Counting Cafe + if (num < 2) + { + if (!SekShouldInterrupt) // hack + { + int lines, pints, irq=0; lines = (pvid->reg[1] & 0x20) | (pvid->reg[0] & 0x10); pints = (pvid->pending_ints&lines); - if(pints & 0x20) SekInterrupt(6); - else if(pints & 0x10) SekInterrupt(4); - else SekInterrupt(0); -#ifdef EMU_C68K - // adjust cycles for Cyclone so it would take the int "in time" - if(PicoCpuCM68k.irq) { - SekEndRun(24); - } + if(pints & 0x20) irq = 6; + else if(pints & 0x10) irq = 4; + SekInterrupt(irq); // update line + + if (irq) SekEndRun(24); // make it delayed } -#endif } else #endif