Detection method for 48k (or 128k in 48k mode) - needed for 'stop the tape 48k' tzx block command detection
This commit is contained in:
parent
213437362d
commit
baa46f3c99
|
@ -484,28 +484,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
}
|
}
|
||||||
|
|
||||||
_monitorTimeOut = 2000;
|
_monitorTimeOut = 2000;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if ((_machine.GetType() != typeof(ZX128) &&
|
|
||||||
_machine.GetType() != typeof(ZX128Plus2) &&
|
|
||||||
_machine.GetType() != typeof(ZX128Plus3)) ||
|
|
||||||
(_machine.GetType() == typeof(ZX128) ||
|
|
||||||
_machine.GetType() != typeof(ZX128Plus2) ||
|
|
||||||
_machine.GetType() != typeof(ZX128Plus3)) &&
|
|
||||||
_machine._ROMpaged == 1)
|
|
||||||
{
|
|
||||||
_machine.Spectrum.OSD_TapeStoppedAuto();
|
|
||||||
|
|
||||||
if (_currentDataBlockIndex >= _dataBlocks.Count())
|
|
||||||
RTZ();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
_monitorTimeOut = 2000;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,8 +494,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
_position = 0;
|
_position = 0;
|
||||||
_currentDataBlockIndex++;
|
_currentDataBlockIndex++;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (_currentDataBlockIndex >= _dataBlocks.Count())
|
if (_currentDataBlockIndex >= _dataBlocks.Count())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -102,21 +102,19 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper function to refresh memory array (probably not the best way to do things)
|
/// Detects whether this is a 48k machine (or a 128k in 48k mode)
|
||||||
/// </summary>
|
|
||||||
//public abstract void ReInitMemory();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Detects whether the 48k rom is resident (or paged in) at 0x0001
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual bool IsIn48kMode()
|
public virtual bool IsIn48kMode()
|
||||||
{
|
{
|
||||||
var data = ReadBus(0x0001);
|
if (this.GetType() == typeof(ZX48) ||
|
||||||
if (data == 0xaf)
|
this.GetType() == typeof(ZX16) ||
|
||||||
|
PagingDisabled)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
return false;
|
else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,61 +208,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
|
|
||||||
WriteBus(addr, value);
|
WriteBus(addr, value);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public override void ReInitMemory()
|
|
||||||
{
|
|
||||||
if (Memory.ContainsKey(0))
|
|
||||||
Memory[0] = ROM0;
|
|
||||||
else
|
|
||||||
Memory.Add(0, ROM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(1))
|
|
||||||
Memory[1] = ROM1;
|
|
||||||
else
|
|
||||||
Memory.Add(1, ROM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(2))
|
|
||||||
Memory[2] = RAM0;
|
|
||||||
else
|
|
||||||
Memory.Add(2, RAM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(3))
|
|
||||||
Memory[3] = RAM1;
|
|
||||||
else
|
|
||||||
Memory.Add(3, RAM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(4))
|
|
||||||
Memory[4] = RAM2;
|
|
||||||
else
|
|
||||||
Memory.Add(4, RAM2);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(5))
|
|
||||||
Memory[5] = RAM3;
|
|
||||||
else
|
|
||||||
Memory.Add(5, RAM3);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(6))
|
|
||||||
Memory[6] = RAM4;
|
|
||||||
else
|
|
||||||
Memory.Add(6, RAM4);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(7))
|
|
||||||
Memory[7] = RAM5;
|
|
||||||
else
|
|
||||||
Memory.Add(7, RAM5);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(8))
|
|
||||||
Memory[8] = RAM6;
|
|
||||||
else
|
|
||||||
Memory.Add(8, RAM6);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(9))
|
|
||||||
Memory[9] = RAM7;
|
|
||||||
else
|
|
||||||
Memory.Add(9, RAM7);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ULA reads the memory at the specified address
|
/// ULA reads the memory at the specified address
|
||||||
/// (No memory contention)
|
/// (No memory contention)
|
||||||
|
|
|
@ -48,16 +48,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
// process tape INs
|
// process tape INs
|
||||||
TapeDevice.ReadPort(port, ref result);
|
TapeDevice.ReadPort(port, ref result);
|
||||||
}
|
}
|
||||||
|
else if ((port & 0xc002) == 0xc000)
|
||||||
|
{
|
||||||
|
// AY sound chip
|
||||||
|
result = (int)AYDevice.PortRead();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// devices other than the ULA will respond here
|
// devices other than the ULA will respond here
|
||||||
// (e.g. the AY sound chip in a 128k spectrum)
|
|
||||||
|
|
||||||
// AY register activate
|
|
||||||
if ((port & 0xc002) == 0xc000)
|
|
||||||
{
|
|
||||||
result = (int)AYDevice.PortRead();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Kempston Mouse (not implemented yet)
|
// Kempston Mouse (not implemented yet)
|
||||||
|
|
||||||
|
|
|
@ -374,71 +374,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
|
|
||||||
WriteBus(addr, value);
|
WriteBus(addr, value);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public override void ReInitMemory()
|
|
||||||
{
|
|
||||||
if (Memory.ContainsKey(0))
|
|
||||||
Memory[0] = ROM0;
|
|
||||||
else
|
|
||||||
Memory.Add(0, ROM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(1))
|
|
||||||
Memory[1] = ROM1;
|
|
||||||
else
|
|
||||||
Memory.Add(1, ROM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(2))
|
|
||||||
Memory[2] = ROM2;
|
|
||||||
else
|
|
||||||
Memory.Add(2, ROM2);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(3))
|
|
||||||
Memory[3] = ROM3;
|
|
||||||
else
|
|
||||||
Memory.Add(3, ROM3);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(4))
|
|
||||||
Memory[4] = RAM0;
|
|
||||||
else
|
|
||||||
Memory.Add(4, RAM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(5))
|
|
||||||
Memory[5] = RAM1;
|
|
||||||
else
|
|
||||||
Memory.Add(5, RAM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(6))
|
|
||||||
Memory[6] = RAM2;
|
|
||||||
else
|
|
||||||
Memory.Add(6, RAM2);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(7))
|
|
||||||
Memory[7] = RAM3;
|
|
||||||
else
|
|
||||||
Memory.Add(7, RAM3);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(8))
|
|
||||||
Memory[8] = RAM4;
|
|
||||||
else
|
|
||||||
Memory.Add(8, RAM4);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(9))
|
|
||||||
Memory[9] = RAM5;
|
|
||||||
else
|
|
||||||
Memory.Add(9, RAM5);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(10))
|
|
||||||
Memory[10] = RAM6;
|
|
||||||
else
|
|
||||||
Memory.Add(10, RAM6);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(11))
|
|
||||||
Memory[11] = RAM7;
|
|
||||||
else
|
|
||||||
Memory.Add(11, RAM7);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ULA reads the memory at the specified address
|
/// ULA reads the memory at the specified address
|
||||||
/// (No memory contention)
|
/// (No memory contention)
|
||||||
|
|
|
@ -374,71 +374,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
|
|
||||||
WriteBus(addr, value);
|
WriteBus(addr, value);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public override void ReInitMemory()
|
|
||||||
{
|
|
||||||
if (Memory.ContainsKey(0))
|
|
||||||
Memory[0] = ROM0;
|
|
||||||
else
|
|
||||||
Memory.Add(0, ROM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(1))
|
|
||||||
Memory[1] = ROM1;
|
|
||||||
else
|
|
||||||
Memory.Add(1, ROM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(2))
|
|
||||||
Memory[2] = ROM2;
|
|
||||||
else
|
|
||||||
Memory.Add(2, ROM2);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(3))
|
|
||||||
Memory[3] = ROM3;
|
|
||||||
else
|
|
||||||
Memory.Add(3, ROM3);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(4))
|
|
||||||
Memory[4] = RAM0;
|
|
||||||
else
|
|
||||||
Memory.Add(4, RAM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(5))
|
|
||||||
Memory[5] = RAM1;
|
|
||||||
else
|
|
||||||
Memory.Add(5, RAM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(6))
|
|
||||||
Memory[6] = RAM2;
|
|
||||||
else
|
|
||||||
Memory.Add(6, RAM2);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(7))
|
|
||||||
Memory[7] = RAM3;
|
|
||||||
else
|
|
||||||
Memory.Add(7, RAM3);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(8))
|
|
||||||
Memory[8] = RAM4;
|
|
||||||
else
|
|
||||||
Memory.Add(8, RAM4);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(9))
|
|
||||||
Memory[9] = RAM5;
|
|
||||||
else
|
|
||||||
Memory.Add(9, RAM5);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(10))
|
|
||||||
Memory[10] = RAM6;
|
|
||||||
else
|
|
||||||
Memory.Add(10, RAM6);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(11))
|
|
||||||
Memory[11] = RAM7;
|
|
||||||
else
|
|
||||||
Memory.Add(11, RAM7);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ULA reads the memory at the specified address
|
/// ULA reads the memory at the specified address
|
||||||
/// (No memory contention)
|
/// (No memory contention)
|
||||||
|
|
|
@ -121,36 +121,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
WriteBus(addr, value);
|
WriteBus(addr, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public override void ReInitMemory()
|
|
||||||
{
|
|
||||||
if (Memory.ContainsKey(0))
|
|
||||||
Memory[0] = ROM0;
|
|
||||||
else
|
|
||||||
Memory.Add(0, ROM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(1))
|
|
||||||
Memory[1] = RAM0;
|
|
||||||
else
|
|
||||||
Memory.Add(1, RAM0);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(2))
|
|
||||||
Memory[2] = RAM1;
|
|
||||||
else
|
|
||||||
Memory.Add(2, RAM1);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(3))
|
|
||||||
Memory[3] = RAM2;
|
|
||||||
else
|
|
||||||
Memory.Add(3, RAM2);
|
|
||||||
|
|
||||||
if (Memory.ContainsKey(4))
|
|
||||||
Memory[4] = RAM3;
|
|
||||||
else
|
|
||||||
Memory.Add(4, RAM3);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets up the ROM
|
/// Sets up the ROM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue