C64: Split out VIC phase1/phase2
This commit is contained in:
parent
85bc92b688
commit
dbf6b39e7f
|
@ -156,7 +156,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
{
|
||||
_vicBank = (0x3 - ((Cia1.PrA | ~Cia1.DdrA) & 0x3)) << 14;
|
||||
|
||||
Vic.ExecutePhase();
|
||||
Vic.ExecutePhase1();
|
||||
CartPort.ExecutePhase();
|
||||
Cassette.ExecutePhase();
|
||||
Serial.ExecutePhase();
|
||||
|
@ -164,6 +164,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
Cia0.ExecutePhase();
|
||||
Cia1.ExecutePhase();
|
||||
Cpu.ExecutePhase();
|
||||
Vic.ExecutePhase2();
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
public sealed partial class Vic
|
||||
{
|
||||
private const int BaResetCounter = 6;
|
||||
private const int BaResetCounter = 3;
|
||||
private const int PipelineUpdateVc = 0x00000001; // vc/rc rule 2
|
||||
private const int PipelineSpriteCrunch = 0x00000002;
|
||||
private const int PipelineUpdateMcBase = 0x00000004;
|
||||
|
@ -227,7 +227,7 @@
|
|||
{
|
||||
_parseAddr = spr.Mc | (spr.Pointer << 6);
|
||||
spr.Sr |= ReadMemory(_parseAddr) << ((0x30 - (_parseFetch & 0x30)) >> 1);
|
||||
spr.Mc++;
|
||||
spr.Mc = (spr.Mc + 1) & 0x3F;
|
||||
spr.Loaded |= 0x800000;
|
||||
}
|
||||
else if ((_parseFetch & 0xF0) == 0x20)
|
||||
|
|
|
@ -188,7 +188,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
|
||||
public int CyclesPerSecond => _cyclesPerSec;
|
||||
|
||||
public void ExecutePhase()
|
||||
public void ExecutePhase1()
|
||||
{
|
||||
// phi1
|
||||
|
||||
|
@ -248,7 +248,16 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
}
|
||||
_spriteSpriteCollisionClearPending = false;
|
||||
}
|
||||
|
||||
// render
|
||||
ParseCycle();
|
||||
UpdateBa();
|
||||
UpdatePins();
|
||||
Render();
|
||||
}
|
||||
|
||||
public void ExecutePhase2()
|
||||
{
|
||||
// phi2
|
||||
|
||||
// start of rasterline
|
||||
|
@ -302,15 +311,11 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
|
||||
// render
|
||||
ParseCycle();
|
||||
UpdateBa();
|
||||
Render();
|
||||
ParseCycle();
|
||||
UpdateBa();
|
||||
UpdatePins();
|
||||
Render();
|
||||
_extraColorModeBuffer = _extraColorMode;
|
||||
}
|
||||
|
||||
|
||||
private void UpdateBa()
|
||||
{
|
||||
if (_ba)
|
||||
|
|
Loading…
Reference in New Issue