commodore64: fixed sprite DMA delay timing, should make very time-sensitive intros run better and some games as well

This commit is contained in:
saxxonpike 2012-12-02 22:15:08 +00:00
parent 2947cd92d0
commit 0907de61cc
3 changed files with 10 additions and 15 deletions

View File

@ -70,9 +70,6 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
public void ExecutePhase2()
{
if (chips.vic.BA)
freezeCpu = false;
if (chips.vic.AEC && !freezeCpu)
{
// the 6502 core expects active high
@ -88,6 +85,9 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
cpu.ExecuteOne();
}
// unfreeze cpu if BA is high
if (chips.vic.BA) freezeCpu = false;
// process unused pin TTL
if (unusedPinTTL0 == 0)
unusedPin0 = false;

View File

@ -58,13 +58,5 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
{
get { return bufWidth; }
}
private void WritePixel(uint pixel)
{
buf[bufOffset] = palette[pixel];
bufOffset++;
if (bufOffset == bufLength)
bufOffset = 0;
}
}
}

View File

@ -487,9 +487,9 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
pinBA = !badline;
break;
default:
cycleBAsprite0 = ba & 0x000F;
cycleBAsprite1 = ba & 0x00F0;
cycleBAsprite2 = ba & 0x0F00;
cycleBAsprite0 = (ba & 0x000F);
cycleBAsprite1 = (ba & 0x00F0) >> 4;
cycleBAsprite2 = (ba & 0x0F00) >> 8;
if ((cycleBAsprite0 < 8 && sprites[cycleBAsprite0].dma) ||
(cycleBAsprite1 < 8 && sprites[cycleBAsprite1].dma) ||
(cycleBAsprite2 < 8 && sprites[cycleBAsprite2].dma))
@ -609,7 +609,10 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
// render visible pixel
pixel = pixelBuffer[pixelBufferIndex];
WritePixel(pixel);
buf[bufOffset] = palette[pixel];
bufOffset++;
if (bufOffset == bufLength)
bufOffset = 0;
// put the pixel from the background buffer into the main buffer
pixel = pixelBackgroundBuffer[pixelBackgroundBufferIndex];