mirror of
https://github.com/livingcomputermuseum/sImlac.git
synced 2026-02-26 00:43:51 +00:00
Made memory size configurable. Defaults to 8KW.
This commit is contained in:
@@ -43,11 +43,11 @@ namespace imlac
|
||||
{
|
||||
_system = system;
|
||||
_mem = _system.Memory;
|
||||
_instructionCache = new Instruction[Memory.Size];
|
||||
|
||||
_iotDispatch = new IIOTDevice[0x200]; // 9 bits of IOT instructions
|
||||
|
||||
Reset();
|
||||
InitializeCache();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
@@ -119,6 +119,11 @@ namespace imlac
|
||||
return GetCachedInstruction(address).Disassemble(address);
|
||||
}
|
||||
|
||||
public void InitializeCache()
|
||||
{
|
||||
_instructionCache = new Instruction[Memory.Size];
|
||||
}
|
||||
|
||||
public void InvalidateCache(ushort address)
|
||||
{
|
||||
_instructionCache[address & Memory.SizeMask] = null;
|
||||
@@ -578,7 +583,7 @@ namespace imlac
|
||||
}
|
||||
|
||||
private ushort GetEffectiveAddress(ushort baseAddress)
|
||||
{
|
||||
{
|
||||
return (ushort)((_pc & (Memory.SizeMask & 0xf800)) | (baseAddress & 0x07ff));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user