diff --git a/src/nostalgia/core/core.hpp b/src/nostalgia/core/core.hpp index 621f34f0..a841bc88 100644 --- a/src/nostalgia/core/core.hpp +++ b/src/nostalgia/core/core.hpp @@ -16,7 +16,7 @@ namespace nostalgia::core { -using event_handler = int(*)(void); +using event_handler = int(*)(Context*); [[nodiscard]] ox::Error init(Context *ctx); diff --git a/src/nostalgia/core/gba/core.arm.cpp b/src/nostalgia/core/gba/core.arm.cpp index 421055ef..16780d13 100644 --- a/src/nostalgia/core/gba/core.arm.cpp +++ b/src/nostalgia/core/gba/core.arm.cpp @@ -21,11 +21,11 @@ extern volatile gba_timer_t g_timerMs; gba_timer_t g_wakeupTime; event_handler g_eventHandler = nullptr; -ox::Error run(Context*) { +ox::Error run(Context *ctx) { g_wakeupTime = 0; while (1) { if (g_wakeupTime <= g_timerMs && g_eventHandler) { - auto sleepTime = g_eventHandler(); + auto sleepTime = g_eventHandler(ctx); if (sleepTime >= 0) { g_wakeupTime = g_timerMs + static_cast(sleepTime); } else { diff --git a/src/nostalgia/player/main.cpp b/src/nostalgia/player/main.cpp index d939dc91..c74136f8 100644 --- a/src/nostalgia/player/main.cpp +++ b/src/nostalgia/player/main.cpp @@ -17,7 +17,7 @@ using namespace nostalgia; static unsigned spriteX = 72; static unsigned spriteY = 64; -static int mainLoop() { +static int mainLoop(core::Context*) { if (core::buttonDown(core::GamePad_Right)) { spriteX += 2; } else if (core::buttonDown(core::GamePad_Left)) {