From f572be9781f5a964081011f068ad1472c4df986c Mon Sep 17 00:00:00 2001 From: Eblo <7004497+Eblo@users.noreply.github.com> Date: Sat, 10 Jan 2026 14:13:29 -0500 Subject: [PATCH] Implement reset --- src/port/console/DevConsole.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/port/console/DevConsole.cpp b/src/port/console/DevConsole.cpp index 5a69a4aa..215e46f4 100644 --- a/src/port/console/DevConsole.cpp +++ b/src/port/console/DevConsole.cpp @@ -14,12 +14,30 @@ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console")) \ ->SendInfoMessage +#include "game/level_update.h" +#include "game/ingame_menu.h" +#include "engine/geo_layout.h" +// #include "game/area.h" +// #include "game/main.h" extern "C" { void handle_nmi_request(void); +void thread5_game_loop(void); +void clear_areas(void); +extern s8 gResetTimer; // main.h +extern s16 gMenuOptSelectIndex; // area.h +extern struct Area* gCurrentArea; // area.h +extern s16 gMenuMode; // ingame_menu.c +extern u32 gGlobalTimer; // game_init.c } static bool ResetHandler(std::shared_ptr Console, std::vector args, std::string* output) { + // FIXME: Consistently seems to crash at alloc_only_pool_alloc after 4 times of loading into a level and resetting handle_nmi_request(); + gResetTimer = 0; + clear_areas(); + gHudDisplay.flags = HUD_DISPLAY_NONE; + gMenuMode = MENU_MODE_NONE; + thread5_game_loop(); return 0; }