X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FVideoPort.c;h=75267c35aa40b30aacfe994df7ed0aab705d2632;hb=8c1952f0d742014666df8ec2191458d9117625b5;hp=5d972f56542df74a1622b545852491f3d5b3d65e;hpb=4f67228034eca76d85ff3e05571deb965e065791;p=picodrive.git diff --git a/Pico/VideoPort.c b/Pico/VideoPort.c index 5d972f5..75267c3 100644 --- a/Pico/VideoPort.c +++ b/Pico/VideoPort.c @@ -58,6 +58,7 @@ static unsigned int VideoRead() return d; } +#if 0 // calculate the number of cycles 68k->VDP dma operation would take static int DmaSlowBurn(int len) { @@ -75,6 +76,7 @@ static int DmaSlowBurn(int len) return burn; } +#endif static int GetDmaLength() { @@ -93,14 +95,15 @@ static void DmaSlow(int len) u16 *pd=0, *pdend, *r; unsigned int a=Pico.video.addr, a2, d; unsigned char inc=Pico.video.reg[0xf]; - unsigned int source, burn; + unsigned int source; // , burn; source =Pico.video.reg[0x15]<<1; source|=Pico.video.reg[0x16]<<9; source|=Pico.video.reg[0x17]<<17; - dprintf("DmaSlow[%i] %06x->%04x len %i inc=%i blank %i [%i|%i]", Pico.video.type, source, a, len, inc, - (Pico.video.status&8)||!(Pico.video.reg[1]&0x40), Pico.m.scanline, SekCyclesDone()); + dprintf("DmaSlow[%i] %06x->%04x len %i inc=%i blank %i [%i|%i] @ %x", + Pico.video.type, source, a, len, inc, (Pico.video.status&8)||!(Pico.video.reg[1]&0x40), + Pico.m.scanline, SekCyclesDone(), SekPc); if ((source&0xe00000)==0xe00000) { pd=(u16 *)(Pico.ram+(source&0xfffe)); pdend=(u16 *)(Pico.ram+0x10000); } // Ram else if(source>3; // hack + SekSetCyclesLeft(SekCyclesLeft - CheckDMA()); +// CheckDMA(); // dprintf("DmaSlow burn: %i @ %06x", burn, SekPc); switch (Pico.video.type) @@ -138,8 +145,6 @@ static void DmaSlow(int len) break; case 3: // cram - dprintf("DmaSlow[%i] %06x->%04x len %i inc=%i blank %i [%i|%i]", Pico.video.type, source, a, len, inc, - (Pico.video.status&8)||!(Pico.video.reg[1]&0x40), Pico.m.scanline, SekCyclesDone()); Pico.m.dirtyPal = 1; r = Pico.cram; for(a2=a&0x7f; len; len--) @@ -184,7 +189,8 @@ static void DmaCopy(int len) dprintf("DmaCopy len %i [%i|%i]", len, Pico.m.scanline, SekCyclesDone()); Pico.m.dma_bytes += len; - Pico.video.status|=2; // dma busy + if(Pico.m.scanline != -1) + Pico.video.status|=2; // dma busy source =Pico.video.reg[0x15]; source|=Pico.video.reg[0x16]<<8; @@ -217,7 +223,8 @@ static void DmaFill(int data) dprintf("DmaFill len %i inc %i [%i|%i]", len, inc, Pico.m.scanline, SekCyclesDone()); Pico.m.dma_bytes += len; - Pico.video.status|=2; // dma busy + if(Pico.m.scanline != -1) + Pico.video.status|=2; // dma busy (in accurate mode) // from Charles MacDonald's genvdp.txt: // Write lower byte to address specified @@ -314,8 +321,8 @@ void PicoVideoWrite(unsigned int a,unsigned short d) { // Register write: int num=(d>>8)&0x1f; - //if(num==00) dprintf("hint_onoff: %i->%i [%i|%i] pend=%i @ %06x", (pvid->reg[0]&0x10)>>4, (d&0x10)>>4, Pico.m.scanline, SekCyclesDone(), (pvid->pending_ints&0x10)>>4, SekPc); - //if(num==01) dprintf("vint_onoff: %i->%i [%i|%i] pend=%i @ %06x", (pvid->reg[1]&0x20)>>5, (d&0x20)>>5, Pico.m.scanline, SekCyclesDone(), (pvid->pending_ints&0x20)>>5, SekPc); + if(num==00) dprintf("hint_onoff: %i->%i [%i|%i] pend=%i @ %06x", (pvid->reg[0]&0x10)>>4, (d&0x10)>>4, Pico.m.scanline, SekCyclesDone(), (pvid->pending_ints&0x10)>>4, SekPc); + if(num==01) dprintf("vint_onoff: %i->%i [%i|%i] pend=%i @ %06x", (pvid->reg[1]&0x20)>>5, (d&0x20)>>5, Pico.m.scanline, SekCyclesDone(), (pvid->pending_ints&0x20)>>5, SekPc); //if(num==01) dprintf("set_blank: %i @ %06x [%i|%i]", !((d&0x40)>>6), SekPc, Pico.m.scanline, SekCyclesDone()); //if(num==05) dprintf("spr_set: %i @ %06x [%i|%i]", (unsigned char)d, SekPc, Pico.m.scanline, SekCyclesDone()); //if(num==10) dprintf("hint_set: %i @ %06x [%i|%i]", (unsigned char)d, SekPc, Pico.m.scanline, SekCyclesDone()); @@ -411,7 +418,7 @@ unsigned int PicoVideoRead(unsigned int a) hc=hcounts_40[lineCycles]; else hc=hcounts_32[lineCycles]; - if(lineCycles > 488-12) d++; // Wheel of Fortune + //if(lineCycles > 488-12) d++; // Wheel of Fortune } else { // get approximate V-Counter d=vcounts[SekCyclesDone()>>8];