From 716b96bd6f247a52733b38998988bbc29984d7bc Mon Sep 17 00:00:00 2001 From: fleroviux Date: Tue, 2 Jan 2024 23:27:22 +0100 Subject: [PATCH] arm7: stub EXTKEYIN register --- src/dual/src/nds/arm7/memory.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dual/src/nds/arm7/memory.cpp b/src/dual/src/nds/arm7/memory.cpp index 721a48b..c1a4204 100644 --- a/src/dual/src/nds/arm7/memory.cpp +++ b/src/dual/src/nds/arm7/memory.cpp @@ -1,4 +1,6 @@ +#include + #include namespace dual::nds::arm7 { @@ -35,6 +37,17 @@ namespace dual::nds::arm7 { return atom::read(m_swram.arm7.data, address & m_swram.arm7.mask); } case 0x04: { + if(address == 0x04000136) { + const u8* key_state = SDL_GetKeyboardState(nullptr); + + u16 extkeyinput = 0x3Fu; + + if(key_state[SDL_SCANCODE_Q]) extkeyinput &= ~1u; + if(key_state[SDL_SCANCODE_W]) extkeyinput &= ~2u; + + return extkeyinput; + } + if constexpr(std::is_same_v) return m_io.ReadByte(address); if constexpr(std::is_same_v) return m_io.ReadHalf(address); if constexpr(std::is_same_v) return m_io.ReadWord(address);