[nostalgia/core/gba] Add user input support
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user