Files
ph/include/Game/Game.hpp
T
Aurel 51640eb100 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.
2026-05-23 17:10:58 +02:00

83 lines
1.9 KiB
C++

#pragma once
#include "global.h"
#include "types.h"
#include "Game/GameMode.hpp"
#include "Render/FadeControl.hpp"
#include "System/OverlayManager.hpp"
class Game;
typedef void (*UnkCallback)(Game *);
typedef GameMode *(*GameModeCreateFunc)(GameModeId modeId);
struct GameModeData {
/* 00 */ u8 mUnk_00;
/* 01 */ u8 mUnk_01;
/* 02 */ u8 mUnk_02;
/* 03 */ u8 mUnk_03;
/* 04 */ OverlayId slot1Overlay;
/* 08 */ OverlayId slot2Overlay;
/* 0c */ OverlayId slot3Overlay;
/* 10 */ OverlayId slot12Overlay;
/* 14 */ GameModeCreateFunc mModeCreateFunc;
/* 18 */ void *mUnk_18;
/* 1c */
};
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 */ Game_0c mUnk_00c;
/* 0cc */ FadeControl_Derived1 mFadeControl;
/* 0f0 */ u16 mUnk_0f0;
/* 0f2 */ vu16 mUnk_0f2;
/* 0f4 */ s32 mUnk_0f4;
/* 0f8 */ vs32 mUnk_0f8;
/* 0fc */ u16 mUnk_0fc;
/* 0fe */ u16 mUnk_0fe;
/* 100 */ bool mUnk_100;
/* 101 */ u8 mUnk_101;
/* 102 */ bool mUnk_102;
/* 103 */ u8 mUnk_103;
/* 104 */
Game();
~Game();
void func_0202c678();
void func_0202c69c();
void EndGameMode();
bool StartGameMode();
static void func_0202c974(Game *game);
void func_0202c97c();
void Run();
bool func_0202cec8(s32 param1, bool param2);
void func_0202cf34();
static void func_0202cf44(Game *game);
void func_ov016_0211fd68();
};
extern Game gGame;