From 30f659767654d6bfaab64f9a4f036333712ab577 Mon Sep 17 00:00:00 2001 From: Matthew Berry Date: Thu, 27 Oct 2022 09:10:37 -0700 Subject: [PATCH] patch up additional registers that don't read open bus this makes all mgba suite io tests pass --- src/crab/gba/mmio.cr | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/crab/gba/mmio.cr b/src/crab/gba/mmio.cr index ef43f2c..2512273 100644 --- a/src/crab/gba/mmio.cr +++ b/src/crab/gba/mmio.cr @@ -12,7 +12,7 @@ module GBA when 0x060..0x0A7 then @gba.apu[io_addr] when 0x0B0..0x0DF then @gba.dma[io_addr] when 0x100..0x10F then @gba.timer[io_addr] - when 0x120..0x12B, 0x134..0x159 # todo: serial + when 0x120..0x12B, 0x134..0x15B # todo: serial if io_addr == 0x135 0x80_u8 else @@ -22,7 +22,10 @@ module GBA when 0x200..0x203, 0x208..0x209 then @gba.interrupts[io_addr] when 0x204..0x205 then @waitcnt.read_byte(io_addr & 1) - else @gba.bus.read_open_bus_value(io_addr) + when 0x206..0x207, + 0x20A..0x20B, + 0x302..0x303 then 0_u8 # do not read open bus + else @gba.bus.read_open_bus_value(io_addr) end end @@ -33,7 +36,7 @@ module GBA when 0x060..0x0A7 then @gba.apu[io_addr] = value when 0x0B0..0x0DF then @gba.dma[io_addr] = value when 0x100..0x10F then @gba.timer[io_addr] = value - when 0x120..0x12B, 0x134..0x159 # todo: serial + when 0x120..0x12B, 0x134..0x15B # todo: serial when 0x130..0x133 then @gba.keypad[io_addr] = value when 0x200..0x203, 0x208..0x209 then @gba.interrupts[io_addr] = value