From fb6d868bc3531e0e17aa2fd72dba1099a9b3b723 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Wed, 9 May 2018 15:58:02 +0100 Subject: [PATCH] Removed ROM code for slots that haven't been implemented yet --- mmu/mmu.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mmu/mmu.go b/mmu/mmu.go index d88ebc4..6c7950b 100644 --- a/mmu/mmu.go +++ b/mmu/mmu.go @@ -75,6 +75,14 @@ func MapSecondHalfOfIO(m *Memory) { } } +// emptySlot zeroes all RAM for a slot +func emptySlot(m *Memory, slot int) { + for i := slot * 0x100; i < (slot+1)*0x100; i++ { + m.PhysicalMemory.RomC1[i] = 0 + m.PhysicalMemory.RomC2[i] = 0 + } +} + func readApple2eROM(m *Memory) { bytes, err := ioutil.ReadFile(RomPath) if err != nil { @@ -91,6 +99,12 @@ func readApple2eROM(m *Memory) { for i := 0x0; i < 0x3000; i++ { m.PhysicalMemory.UpperROM[i] = bytes[i+0x1000] } + + // Empty slots that aren't yet implemented + emptySlot(m, 3) + emptySlot(m, 4) + emptySlot(m, 6) + emptySlot(m, 7) } func InitApple2eROM(m *Memory) {