[nostalgia/core/gba] Add user input support

This commit is contained in:
2020-07-18 01:19:07 -05:00
parent 72883285f2
commit e8151ac037
5 changed files with 45 additions and 0 deletions
+5
View File
@@ -62,6 +62,11 @@ using interrupt_handler = void (*)(void);
#define REG_BG2VOFS *reinterpret_cast<volatile uint32_t*>(0x0400001a)
#define REG_BG3VOFS *reinterpret_cast<volatile uint32_t*>(0x0400001e)
/////////////////////////////////////////////////////////////////
// User Input
#define REG_GAMEPAD *reinterpret_cast<volatile uint16_t*>(0x04000130)
/////////////////////////////////////////////////////////////////
// Memory Addresses
+5
View File
@@ -8,6 +8,7 @@
#include <nostalgia/core/config.hpp>
#include <nostalgia/core/core.hpp>
#include <nostalgia/core/input.hpp>
#include "addresses.hpp"
#include "bios.hpp"
@@ -54,4 +55,8 @@ uint64_t ticksMs() {
return g_timerMs;
}
bool buttonDown(Key k) {
return !(REG_GAMEPAD & k);
}
}