TIA: Removed code for cosmic ark starfield (to be added back later, in a cleaner way). Changed the definition of a frame to start with the first scanline where VSYNC is disabled.
MOS6507: Fixed a copy-paste mistake with SBC instructions where it would remove another cycle. This fixes the screen bounce issue with pitfall.
This commit is contained in:
parent
bb7e320f92
commit
5e65c7e977
|
@ -1230,7 +1230,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1265,7 +1264,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1300,7 +1298,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1334,7 +1331,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1379,7 +1375,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1407,7 +1402,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1446,7 +1440,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1481,7 +1474,6 @@ FlagT = true;// this seems wrong
|
||||||
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
FlagV = ((A ^ value8) & (A ^ temp) & 0x80) != 0;
|
||||||
FlagC = (hi & 0xFF00) == 0;
|
FlagC = (hi & 0xFF00) == 0;
|
||||||
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
A = (byte)((lo & 0x0F) | (hi & 0xF0));
|
||||||
PendingCycles--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -244,8 +244,6 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
public bool missile1Latch;
|
public bool missile1Latch;
|
||||||
public bool ballLatch;
|
public bool ballLatch;
|
||||||
|
|
||||||
public bool missile0inf;
|
|
||||||
|
|
||||||
public byte hmoveDelayCnt;
|
public byte hmoveDelayCnt;
|
||||||
|
|
||||||
public byte hmoveCnt;
|
public byte hmoveCnt;
|
||||||
|
@ -265,6 +263,7 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
|
|
||||||
|
|
||||||
bool vblankEnabled = false;
|
bool vblankEnabled = false;
|
||||||
|
bool vsyncEnabled = false;
|
||||||
|
|
||||||
List<uint[]> scanlinesBuffer = new List<uint[]>();
|
List<uint[]> scanlinesBuffer = new List<uint[]>();
|
||||||
uint[] scanline = new uint[160];
|
uint[] scanline = new uint[160];
|
||||||
|
@ -462,7 +461,6 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
hmove.player0Cnt = 0;
|
hmove.player0Cnt = 0;
|
||||||
|
|
||||||
hmove.missile0Latch = true;
|
hmove.missile0Latch = true;
|
||||||
hmove.missile0inf = false;
|
|
||||||
hmove.missile0Cnt = 0;
|
hmove.missile0Cnt = 0;
|
||||||
|
|
||||||
hmove.player1Latch = true;
|
hmove.player1Latch = true;
|
||||||
|
@ -512,7 +510,7 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// If the move counter still has a bit in common with the HM register
|
// If the move counter still has a bit in common with the HM register
|
||||||
if (hmove.missile0inf || ((15 - hmove.missile0Cnt) ^ ((player0.missile.HM & 0x07) | ((~(player0.missile.HM & 0x08)) & 0x08))) != 0x0F)
|
if (((15 - hmove.missile0Cnt) ^ ((player0.missile.HM & 0x07) | ((~(player0.missile.HM & 0x08)) & 0x08))) != 0x0F)
|
||||||
{
|
{
|
||||||
// "Clock-Stuffing"
|
// "Clock-Stuffing"
|
||||||
player0.missile.tick();
|
player0.missile.tick();
|
||||||
|
@ -520,10 +518,6 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
// Increase by 1, max of 15
|
// Increase by 1, max of 15
|
||||||
hmove.missile0Cnt++;
|
hmove.missile0Cnt++;
|
||||||
hmove.missile0Cnt %= 16;
|
hmove.missile0Cnt %= 16;
|
||||||
if (hmove.missile0Cnt == 0)
|
|
||||||
{
|
|
||||||
hmove.missile0inf = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -699,14 +693,24 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
if ((value & 0x02) != 0)
|
if ((value & 0x02) != 0)
|
||||||
{
|
{
|
||||||
// Frame is complete, output to buffer
|
// Frame is complete, output to buffer
|
||||||
outputFrame();
|
vsyncEnabled = true;
|
||||||
scanlinesBuffer.Clear();
|
|
||||||
frameComplete = true;
|
|
||||||
hsyncCnt = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// When VSYNC is disabled, this will be the first line of the new frame
|
||||||
Console.WriteLine("TIA VSYNC Off");
|
Console.WriteLine("TIA VSYNC Off");
|
||||||
|
|
||||||
|
// write to frame buffer
|
||||||
|
outputFrame();
|
||||||
|
// Clear all from last frame
|
||||||
|
scanlinesBuffer.Clear();
|
||||||
|
//Frame is done
|
||||||
|
frameComplete = true;
|
||||||
|
|
||||||
|
vsyncEnabled = false;
|
||||||
|
|
||||||
|
// Do not reset hsync, since we're on the first line of the new frame
|
||||||
|
//hsyncCnt = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (maskedAddr == 0x01) // VBLANK
|
else if (maskedAddr == 0x01) // VBLANK
|
||||||
|
|
Loading…
Reference in New Issue