summaryrefslogtreecommitdiff
path: root/src/16_Startup/Game
diff options
context:
space:
mode:
authorAurel <285191559+0Aurel@users.noreply.github.com>2026-05-23 17:10:58 +0200
committerGitHub <noreply@github.com>2026-05-23 17:10:58 +0200
commit51640eb100522a3986779599f057d72c8cb9e42e (patch)
tree96dd74c92bc9d024088cf506597973448140ec2e /src/16_Startup/Game
parent0bb7400136dd84c00abdaf96c5dbdb63c02f836f (diff)
Decompile Game_16 (#167)HEADmain
* Game_16 OK * Remove unnecessary FadeControl constructor definition * Define HW_RESET_PARAMETER_BUF macro to replace hardcoded address * Refactor Game constructor to use proper C++ initialization Address Yanis' review comments: - Make Game::func_0202cf44 static with Game* parameter to allow passing as callback pointer - Replace raw mUnk_00c array with Game_0c class containing constructor - Add Game_0c constructor with inline initialization calling func_ov016_0211fab8 - Add FadeControl_Derived1 class for mFadeControl member - Use C++ initializer list in Game constructor for mModeId, mPrevModeId, mMode, mUnk_00c, and mFadeControl * Fix Game constructor and FadeControl initialization - Use PAD macro in Game_0c instead of unk8 pad[] - Pass 'this' instead of 'pad' to func_ov016_0211fab8 - Add FadeControl constructor that calls _ZN11FadeControlC2Ev - FadeControl_Derived1 now uses empty constructor (base class ctor called automatically) - Update mUnk_00c.pad to mUnk_00c.pad_0x00 (PAD macro creates named member) - Add types.h include to nds/system.h * Remove explicit call to mangled constructor symbol - Removed _ZN11FadeControlC2Ev call from FadeControl constructor - FadeControl now has an empty constructor (called automatically by derived classes) - FadeControl_Derived1 uses empty constructor which calls base class ctor * Update symbols.txt for func_0202cf44 signature change Changed mangled name from _ZN4Game13func_0202cf44Ev to _ZN4Game13func_0202cf44EPS_ to reflect the function becoming static with a Game* parameter.
Diffstat (limited to 'src/16_Startup/Game')
-rw-r--r--src/16_Startup/Game/Game_16.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/16_Startup/Game/Game_16.cpp b/src/16_Startup/Game/Game_16.cpp
index 85e094b3..4a243706 100644
--- a/src/16_Startup/Game/Game_16.cpp
+++ b/src/16_Startup/Game/Game_16.cpp
@@ -1,4 +1,41 @@
#include "Game/Game.hpp"
-Game::Game() {}
-void Game::func_ov016_0211fd68() {}
+#include <nds/system.h>
+
+#include "GameStart/GameStart.hpp"
+#include "Render/FadeController.hpp"
+#include "System/OverlayManager.hpp"
+
+extern "C" void func_0200d938(void *);
+
+ARM Game::Game() :
+ mModeId(1),
+ mPrevModeId(1),
+ mMode(NULL),
+ mUnk_00c(Game::func_0202cf44, this, 0),
+ mFadeControl() {
+ mUnk_0f0 = 0;
+ mUnk_0f2 = 1;
+ mUnk_0f4 = 0;
+ mUnk_0f8 = 0;
+ mUnk_0fc = 0;
+ mUnk_0fe = 0;
+ mUnk_100 = false;
+ mUnk_101 = 0;
+ mUnk_102 = false;
+ mUnk_103 = 0;
+}
+
+ARM void Game::func_ov016_0211fd68() {
+ mFadeControl.Register();
+ mFadeControl.mUnk_20 = false;
+ gFadeController.func_0202d77c(&mFadeControl);
+ if (HW_RESET_PARAMETER_BUF == 2) {
+ gOverlayManager.LoadGameMode(1);
+ GameStart::func_ov008_02112e88();
+ gOverlayManager.UnloadGameMode();
+ mPrevModeId = 4;
+ mModeId = 3;
+ }
+ func_0200d938(mUnk_00c.pad_0x00);
+}