From 42904782f797145916ddf30bee30f01a3b073f23 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Thu, 21 Nov 2019 17:33:08 +0200 Subject: [PATCH] Fix bios infinite loop caused by changes in f5a8ca8de8a5b007ace879f50fb97ead3e976347 [formerly e885e9ff1393dd14f5e4132c71a7641d658399cb] This commit removed the dummy iomem buffer, and the bios busy waits on REG_SOUNDBIAS in order to proceed. Former-commit-id: 1fb8e2b621bed22da55781adcaae748aaaf845b9 --- src/core/iodev.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/iodev.rs b/src/core/iodev.rs index 35c55ae..41dae65 100644 --- a/src/core/iodev.rs +++ b/src/core/iodev.rs @@ -26,6 +26,7 @@ pub struct IoDevices { pub post_boot_flag: bool, pub waitcnt: WaitControl, // TODO also implement 4000800 pub haltcnt: HaltState, + pub sound_bias: u16, mem: BoxedMemory, } @@ -42,6 +43,7 @@ impl IoDevices { haltcnt: HaltState::Running, keyinput: keypad::KEYINPUT_ALL_RELEASED, waitcnt: WaitControl(0), + sound_bias: 0x200, } } } @@ -96,6 +98,8 @@ impl Bus for IoDevices { REG_DMA2CNT_H => io.dmac.channels[2].ctrl.0, REG_DMA3CNT_H => io.dmac.channels[3].ctrl.0, + REG_SOUNDBIAS => io.sound_bias, + REG_WAITCNT => io.waitcnt.0, REG_POSTFLG => io.post_boot_flag as u16, @@ -234,6 +238,8 @@ impl Bus for IoDevices { io.dmac.write_16(channel_id, ofs % 12, value) } + REG_SOUNDBIAS => io.sound_bias = value & 0xc3fe, + REG_WAITCNT => io.waitcnt.0 = value, REG_POSTFLG => io.post_boot_flag = value != 0,