[nostalgia/core] Cleanup

This commit is contained in:
2023-05-16 21:20:07 -05:00
parent 2c7e134606
commit f63fe6c995
8 changed files with 81 additions and 48 deletions
+3 -1
View File
@@ -6,6 +6,7 @@
#include <nostalgia/core/core.hpp>
#include "addresses.hpp"
#include "context.hpp"
#include "bios.hpp"
#include "irq.hpp"
#include "core.hpp"
@@ -18,7 +19,8 @@ UpdateHandler g_updateHandler = nullptr;
ox::Error run(Context *ctx) noexcept {
g_wakeupTime = 0;
while (ctx->running) {
const auto gbaCtx = static_cast<gba::Context*>(ctx);
while (gbaCtx->running) {
if (g_wakeupTime <= g_timerMs && g_updateHandler) {
auto sleepTime = g_updateHandler(ctx);
if (sleepTime >= 0) {