Decompile Game_16 (#167)

* 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.
This commit is contained in:
Aurel
2026-05-23 17:10:58 +02:00
committed by GitHub
parent 0bb7400136
commit 51640eb100
6 changed files with 95 additions and 20 deletions
+22 -3
View File
@@ -7,6 +7,9 @@
#include "Render/FadeControl.hpp"
#include "System/OverlayManager.hpp"
class Game;
typedef void (*UnkCallback)(Game *);
typedef GameMode *(*GameModeCreateFunc)(GameModeId modeId);
struct GameModeData {
@@ -24,13 +27,29 @@ struct GameModeData {
};
extern const GameModeData gGameModes[];
extern "C" void func_ov016_0211fab8(void *, void (*)(), void *, unk32);
class Game_0c {
public:
/* 00 */ PAD(0x00, 0xC0);
Game_0c(UnkCallback callback, void *param2, u32 param3) {
func_ov016_0211fab8(this, (void (*)()) callback, param2, param3);
}
};
class FadeControl_Derived1 : public FadeControl {
public:
FadeControl_Derived1() {}
};
class Game {
public:
/* 000 */ GameModeId mModeId;
/* 004 */ GameModeId mPrevModeId;
/* 008 */ GameMode *mMode;
/* 00c */ unk8 mUnk_00c[0xc0];
/* 0cc */ FadeControl mFadeControl;
/* 00c */ Game_0c mUnk_00c;
/* 0cc */ FadeControl_Derived1 mFadeControl;
/* 0f0 */ u16 mUnk_0f0;
/* 0f2 */ vu16 mUnk_0f2;
/* 0f4 */ s32 mUnk_0f4;
@@ -55,7 +74,7 @@ public:
void Run();
bool func_0202cec8(s32 param1, bool param2);
void func_0202cf34();
void func_0202cf44();
static void func_0202cf44(Game *game);
void func_ov016_0211fd68();
};