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);