ZXHawk: 128k/+2 High-port contention now reporting properly in fusetest

This commit is contained in:
Asnivor 2018-06-08 13:43:40 +01:00
parent 7ced9fdc6a
commit faec0fb0e5
6 changed files with 71 additions and 1 deletions

View File

@ -297,7 +297,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
case MachineType.ZXSpectrum128:
case MachineType.ZXSpectrum128Plus2:
if ((lastPortAddr & 0xc000) == 0x4000)
if ((lastPortAddr & 0xc000) == 0x4000 || (lastPortAddr & 0xc000) == 0xc000 && _machine.ContendedBankPaged())
highByte407f = true;
if (highByte407f)

View File

@ -161,6 +161,13 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// <param name="addr"></param>
public abstract bool IsContended(ushort addr);
/// <summary>
/// Returns TRUE if there is a contended bank paged in
/// </summary>
/// <returns></returns>
public abstract bool ContendedBankPaged();
#endregion
#region Helper Methods

View File

@ -232,6 +232,24 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return false;
}
/// <summary>
/// Returns TRUE if there is a contended bank paged in
/// </summary>
/// <returns></returns>
public override bool ContendedBankPaged()
{
switch (RAMPaged)
{
case 1:
case 3:
case 5:
case 7:
return true;
}
return false;
}
/// <summary>
/// ULA reads the memory at the specified address
/// (No memory contention)

View File

@ -425,6 +425,24 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return false;
}
/// <summary>
/// Returns TRUE if there is a contended bank paged in
/// </summary>
/// <returns></returns>
public override bool ContendedBankPaged()
{
switch (RAMPaged)
{
case 4:
case 5:
case 6:
case 7:
return true;
}
return false;
}
/// <summary>
/// ULA reads the memory at the specified address
/// (No memory contention)

View File

@ -426,6 +426,24 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return false;
}
/// <summary>
/// Returns TRUE if there is a contended bank paged in
/// </summary>
/// <returns></returns>
public override bool ContendedBankPaged()
{
switch (RAMPaged)
{
case 4:
case 5:
case 6:
case 7:
return true;
}
return false;
}
/// <summary>
/// ULA reads the memory at the specified address
/// (No memory contention)

View File

@ -123,6 +123,15 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return false;
}
/// <summary>
/// Returns TRUE if there is a contended bank paged in
/// </summary>
/// <returns></returns>
public override bool ContendedBankPaged()
{
return false;
}
/// <summary>
/// Sets up the ROM
/// </summary>