mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-04-26 03:58:25 +00:00
Initial implementation of Alto I support. Still need proper Constants ROM for Alto I. Changed IDISP to use ACSOURCE ROM (small perf increase).
This commit is contained in:
@@ -7,6 +7,23 @@ namespace Contralto.Memory
|
||||
{
|
||||
public Memory()
|
||||
{
|
||||
// Set up handled addresses based on the system type.
|
||||
if (Configuration.SystemType == SystemType.AltoI)
|
||||
{
|
||||
_addresses = new MemoryRange[]
|
||||
{
|
||||
new MemoryRange(0, _memTop), // Main bank of RAM to 176777; IO page above this.
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_addresses = new MemoryRange[]
|
||||
{
|
||||
new MemoryRange(0, _memTop), // Main bank of RAM to 176777; IO page above this.
|
||||
new MemoryRange(_xmBanksStart, (ushort)(_xmBanksStart + 16)), // Memory bank registers
|
||||
};
|
||||
}
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
@@ -20,7 +37,7 @@ namespace Contralto.Memory
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
// 4 64K banks
|
||||
// 4 64K banks, regardless of system type. (Alto Is just won't use the extra memory.)
|
||||
_mem = new ushort[0x40000];
|
||||
_xmBanks = new ushort[16];
|
||||
}
|
||||
@@ -48,12 +65,12 @@ namespace Contralto.Memory
|
||||
{
|
||||
// Check for XM registers; this occurs regardless of XM flag since it's in the I/O page.
|
||||
if (address >= _xmBanksStart && address < _xmBanksStart + 16)
|
||||
{
|
||||
{
|
||||
_xmBanks[address - _xmBanksStart] = data;
|
||||
Log.Write(LogComponent.Memory, "XM register for task {0} set to bank {1} (normal), {2} (xm)",
|
||||
(TaskType)(address - _xmBanksStart),
|
||||
(data & 0xc) >> 2,
|
||||
(data & 0x3));
|
||||
(data & 0x3));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,7 +79,7 @@ namespace Contralto.Memory
|
||||
{
|
||||
Log.Write(LogComponent.Memory, "Extended memory write, bank {0} address {1}, data {2}", GetBankNumber(task, extendedMemory), Conversion.ToOctal(address), Conversion.ToOctal(data));
|
||||
} */
|
||||
address += 0x10000 * GetBankNumber(task, extendedMemory);
|
||||
address += 0x10000 * GetBankNumber(task, extendedMemory);
|
||||
|
||||
_mem[address] = data;
|
||||
}
|
||||
@@ -78,11 +95,7 @@ namespace Contralto.Memory
|
||||
return extendedMemory ? (_xmBanks[(int)task]) & 0x3 : ((_xmBanks[(int)task]) & 0xc) >> 2;
|
||||
}
|
||||
|
||||
private readonly MemoryRange[] _addresses =
|
||||
{
|
||||
new MemoryRange(0, _memTop), // Main bank of RAM to 176777; IO page above this.
|
||||
new MemoryRange(_xmBanksStart, (ushort)(_xmBanksStart + 16)), // Memory bank registers
|
||||
};
|
||||
private readonly MemoryRange[] _addresses;
|
||||
|
||||
private static readonly ushort _memTop = 0xfdff; // 176777
|
||||
private static readonly ushort _xmBanksStart = 0xffe0; // 177740
|
||||
|
||||
Reference in New Issue
Block a user