Skip to content

Commit

Permalink
arm7: stub EXTKEYIN register
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Jan 2, 2024
1 parent 702f452 commit 716b96b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/dual/src/nds/arm7/memory.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#include <SDL.h>

#include <dual/nds/arm7/memory.hpp>

namespace dual::nds::arm7 {
Expand Down Expand Up @@ -35,6 +37,17 @@ namespace dual::nds::arm7 {
return atom::read<T>(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<T, u8 >) return m_io.ReadByte(address);
if constexpr(std::is_same_v<T, u16>) return m_io.ReadHalf(address);
if constexpr(std::is_same_v<T, u32>) return m_io.ReadWord(address);
Expand Down

0 comments on commit 716b96b

Please sign in to comment.