Merge pull request #614 from alyosha-tas/master

AtariHawk bug fixes pull request
This commit is contained in:
hegyak 2016-04-18 08:06:15 -07:00
commit 643e475ccc
3 changed files with 2252 additions and 411 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,89 +2,89 @@
namespace BizHawk.Emulation.Cores.Atari.Atari2600
{
public partial class TIA
{
private struct MissileData
{
public bool Enabled;
public bool ResetToPlayer;
public byte HPosCnt;
public byte Size;
public byte Number;
public byte Hm;
public byte Collisions;
public partial class TIA
{
private struct MissileData
{
public bool Enabled;
public bool ResetToPlayer;
public byte HPosCnt;
public byte Size;
public byte Number;
public byte Hm;
public byte Collisions;
public bool Tick()
{
var result = false;
public bool Tick()
{
var result = false;
// At hPosCnt == 0, start drawing the missile, if enabled
if (HPosCnt < (1 << Size))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
// At hPosCnt == 0, start drawing the missile, if enabled
if (HPosCnt < (1 << Size))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
if ((Number & 0x07) == 0x01 || ((Number & 0x07) == 0x03))
{
if (HPosCnt >= 16 && HPosCnt <= (16 + (1 << Size) - 1))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
}
if ((Number & 0x07) == 0x01 || ((Number & 0x07) == 0x03))
{
if (HPosCnt >= 16 && HPosCnt <= (16 + (1 << Size) - 1))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
}
if ((Number & 0x07) == 0x02 || ((Number & 0x07) == 0x03) || ((Number & 0x07) == 0x06))
{
if (HPosCnt >= 32 && HPosCnt <= (32 + (1 << Size) - 1))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
}
if ((Number & 0x07) == 0x02 || ((Number & 0x07) == 0x03) || ((Number & 0x07) == 0x06))
{
if (HPosCnt >= 32 && HPosCnt <= (32 + (1 << Size) - 1))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
}
if ((Number & 0x07) == 0x04 || (Number & 0x07) == 0x06)
{
if (HPosCnt >= 64 && HPosCnt <= (64 + (1 << Size) - 1))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
}
if ((Number & 0x07) == 0x04 || (Number & 0x07) == 0x06)
{
if (HPosCnt >= 64 && HPosCnt <= (64 + (1 << Size) - 1))
{
if (Enabled && !ResetToPlayer)
{
// Draw the missile
result = true;
}
}
}
// Increment the counter
HPosCnt++;
// Increment the counter
HPosCnt++;
// Counter loops at 160
HPosCnt %= 160;
// Counter loops at 160
HPosCnt %= 160;
return result;
}
return result;
}
public void SyncState(Serializer ser)
{
ser.BeginSection("Missile");
ser.Sync("enabled", ref Enabled);
ser.Sync("resetToPlayer", ref ResetToPlayer);
ser.Sync("hPosCnt", ref HPosCnt);
ser.Sync("size", ref Size);
ser.Sync("number", ref Number);
ser.Sync("HM", ref Hm);
ser.Sync("collisions", ref Collisions);
ser.EndSection();
}
}
}
public void SyncState(Serializer ser)
{
ser.BeginSection("Missile");
ser.Sync("enabled", ref Enabled);
ser.Sync("resetToPlayer", ref ResetToPlayer);
ser.Sync("hPosCnt", ref HPosCnt);
ser.Sync("size", ref Size);
ser.Sync("number", ref Number);
ser.Sync("HM", ref Hm);
ser.Sync("collisions", ref Collisions);
ser.EndSection();
}
}
}
}

1535
TIA.cs Normal file

File diff suppressed because it is too large Load Diff