Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/constants/sjis_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,15 @@

// [Translation: Assert Heap (mHeap::assertHeap)]
#define ASSERT_HEAP_NAME "アサートヒープ(mHeap::assertHeap)"

// [Translation: Effect manager]
#define EFFECT_HEAP_1_NAME "エフェクト管理"

// [Translation: Effect resources]
#define EFFECT_HEAP_2_NAME "エフェクトリソース"

// [Translation: Font manager]
#define FONT_MANAGER_HEAP_NAME "フォント管理"

// [Translation: Message manager]
#define MESSAGE_MANAGER_HEAP_NAME "メッセージ管理"
15 changes: 15 additions & 0 deletions include/constants/system_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
/// @addtogroup constants
/// @{

#define ARENA_LO 0x806e0000 ///< The start of the arena.
#define ARENA_HI 0x817f0000 ///< The end of the arena.

#define HEAP_SIZE_ARCHIVE 0x1200000 ///< The size of the heap used for loading archives.
#define HEAP_SIZE_COMMAND 0x1000 ///< The size of the heap used for commands.
#define HEAP_SIZE_DYLINK 0x500000 ///< The size of the heap used for dynamic libraries.
#define HEAP_SIZE_EFFECT_MANAGER1 0x100000 ///< The size of the first heap used for the effect manager.
#define HEAP_SIZE_EFFECT_MANAGER2 0x280000 ///< The size of the second heap used for the effect manager.
#define HEAP_SIZE_FONT_MANAGER 0x400000 ///< The size of the heap used for the font manager.
#define HEAP_SIZE_GAME1 0x980000 ///< The size of the first game heap.
#define HEAP_SIZE_GAME2 0x700000 ///< The size of the second game heap.
#define HEAP_SIZE_MESSAGE_MANAGER 0xc800 ///< The size of the heap used for the message manager.
#define HEAP_SIZE_REPLAY_DATA 0x1c2000 ///< The size of the heap used for replay data.
#define HEAP_SIZE_TEXTURE_BUFFER 0x2a0000 ///< The size of the heap used for texture buffers.

#define SAVE_MAGIC "SMNP" ///< The savegame's magic.
#define SAVE_REVISION_MAJOR 14 ///< The savegame's major revision number.
#define SAVE_REVISION_MINOR 0 ///< The savegame's minor revision number.
Expand Down
4 changes: 4 additions & 0 deletions include/game/bases/d_audio.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <game/framework/f_profile.hpp>
#include <game/mLib/m_vec.hpp>
#include <lib/egg/core/eggHeap.h>
#include <nw4r/snd.h>
#include <nw4r/math.h>

Expand Down Expand Up @@ -32,6 +33,8 @@ class SndObjctCmnMap : public NMSndObject<4> {
};

namespace dAudio {
void init(EGG::Heap *heap);
void execute();
void requestStartScene(ProfileName sceneProf); ///< Sets up game audio for the given scene.
void createSndObjctCmn();
void deleteSndObjctCmn();
Expand All @@ -43,6 +46,7 @@ namespace dAudio {
void FUN_8006a6a0(bool); ///< @unofficial
void setMainBgmNo(int);
void setBgmMode(int);
void updateBgmInfo();

int getRemotePlayer(int);
mVec2_c cvtSndObjctPos(const mVec2_c &);
Expand Down
14 changes: 14 additions & 0 deletions include/game/bases/d_dvd_err.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <lib/egg/core/eggHeap.h>

class dDvdErr_c {
public:
void draw();
void execute();
bool isErrorOccured();

static void createInstance(EGG::Heap *heap);

static dDvdErr_c *m_pInstance;
};
2 changes: 2 additions & 0 deletions include/game/bases/d_dylink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class dDynamicModuleControl : public DynamicModuleControlBase {
};

namespace dDyl {
void InitAsync();
bool InitAsyncIsDone();
int LinkASync(ProfileName);
bool Unlink(ProfileName);
};
4 changes: 4 additions & 0 deletions include/game/bases/d_effectmanager.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#pragma once

#include <game/mLib/m_vec.hpp>
#include <lib/egg/core/eggHeap.h>

class EffectManager_c {
public:
static void create(EGG::Heap *heap1, EGG::Heap *heap2);
static void setResource(void *breff, void *breft);
static void SetIceBallMissshitEffect(mVec3_c *);
static void SetIceBallEffect(mVec3_c *);
static void calcGroupForWm();
Expand Down
6 changes: 5 additions & 1 deletion include/game/bases/d_fader.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <types.h>
#include <game/mLib/m_fader.hpp>
#include <lib/egg/core/eggHeap.h>

class dFader_c : public mFader_c {
public:
Expand All @@ -10,6 +10,10 @@ class dFader_c : public mFader_c {
CIRCLE_MIDDLE
};

static void draw();
static void calc();

static void createFader(EGG::Heap *heap);
static void setFader(fader_type_e type);

/// @brief Starts a fade in with the @ref mFader_c::mFader "current fader".
Expand Down
4 changes: 3 additions & 1 deletion include/game/bases/d_font_manager.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#pragma once

#include <types.h>
#include <lib/egg/core/eggHeap.h>
#include <nw4r/ut.h>

class dFontMng_c {
public:
static bool create(EGG::Heap *heap);

static void *getResFontData(const char *name);
static u8 getResFontIndex(const char *name);
static nw4r::ut::Font *getFont(int index);
Expand Down
8 changes: 7 additions & 1 deletion include/game/bases/d_game_key.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <types.h>
#include <lib/egg/core/eggHeap.h>

class Remocon {
public:
Expand Down Expand Up @@ -31,11 +33,15 @@ class dGameKey_c {
public:
virtual ~dGameKey_c();

dGameKeyCore_c *mRemocon[4];
void read();

short getAccVerticalAngleX(int plNo) {
return mRemocon[plNo]->getAccVerticalAngleX() / 65536;
}

static void createInstance(EGG::Heap *heap);

dGameKeyCore_c *mRemocon[4];

static dGameKey_c *m_instance;
};
6 changes: 6 additions & 0 deletions include/game/bases/d_graph.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#pragma once

#include <lib/egg/core/eggHeap.h>

class dGraph_c {
public:
void painter();

static void create(EGG::Heap *heap, EGG::Heap *rootHeap1, EGG::Heap *rootHeap2);

void (*mpPainterFunc)();

static dGraph_c *ms_Instance;
Expand Down
15 changes: 11 additions & 4 deletions include/game/bases/d_hbm.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
#pragma once
#include <types.h>

#include <lib/egg/core/eggHeap.h>

/// @ingroup bases
namespace dHbm {
class Manage_c {
public:
bool Load();
void DrawMenu();
void DrawIcon();
void Calculate();

u8 mPad[0x1d8];
u32 mFlags;
static void CreateInstance(EGG::Heap *heap);
static dHbm::Manage_c *GetInstance(); ///< Gets a pointer to the instance of this class.

static dHbm::Manage_c* GetInstance(); ///< Gets a pointer to the instance of this class.
u8 mPad1[0x1d0];
u32 m_1d0;
u8 mPad2[0x4];
u32 mFlags;
};

} // namespace dHbm
2 changes: 2 additions & 0 deletions include/game/bases/d_message.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <types.h>
#include <egg/core/eggHeap.h>
#include <egg/core/eggMsgRes.h>

class MsgRes_c : public EGG::MsgRes {
Expand All @@ -11,5 +12,6 @@ class MsgRes_c : public EGG::MsgRes {

class dMessage_c {
public:
static bool create(EGG::Heap *heap);
static MsgRes_c *getMesRes();
};
4 changes: 3 additions & 1 deletion include/game/bases/d_nand_thread.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#pragma once

#include <types.h>
#include <lib/egg/core/eggHeap.h>

class dNandThread_c {
public:
void cmdExistCheck();
void cmdSpaceCheck();

static void create(EGG::Heap *heap);

u8 mPad[0x74];
int mState;
int mError;
Expand Down
8 changes: 8 additions & 0 deletions include/game/bases/d_pad.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

namespace dPad {

void beginPad_BR();
void endPad_BR();

} // namespace dPad
5 changes: 5 additions & 0 deletions include/game/bases/d_remocon_manager.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#pragma once

#include <lib/egg/core/eggHeap.h>

class dRemoconMng_c {
public:
class dConnect_c {
public:
static bool m_isBoot;
};

static void create(EGG::Heap *heap);
static void execute();
};
4 changes: 4 additions & 0 deletions include/game/bases/d_reset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ namespace dReset {
void PermitSoftReset(bool);
bool IsFaderBlank() const;
void ActiveSaveWindow(bool);
void Draw();
void Calculate();

bool isSafetyWait() const { return mModeInit == SAFETY_WAIT || mModeProc == SAFETY_WAIT; }

static void CreateInstance(EGG::Heap *heap);

EGG::Heap *mpHeap;
EGG::ColorFader *mpColorFader;

Expand Down
8 changes: 8 additions & 0 deletions include/game/bases/d_rom_font_manager.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include <lib/egg/core/eggHeap.h>

class dRomFontMgr_c {
public:
static void createInstance(EGG::Heap *heap);
};
14 changes: 9 additions & 5 deletions include/game/bases/d_s_stage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ class dScStage_c : public dScene_c {
LOOP_COUNT,
};

static void play();

typedef void (*changePosFunc)(mVec3_c *);
static void setChangePosFunc(int);

static void setTitleReplayRandomTable();

static void createReplayDataHeap(EGG::Heap *heap, ulong size, int options);

char pad[0x1198];
u8 mCurrWorld;
u8 mCurrCourse;
Expand All @@ -43,11 +52,6 @@ class dScStage_c : public dScene_c {
static dInfo_c::GameMode_e m_gameMode;
static Exit_e m_exitMode;

typedef void (*changePosFunc)(mVec3_c *);
static void setChangePosFunc(int);

static void setTitleReplayRandomTable();

static changePosFunc changePos;
static dScStage_c *m_instance;

Expand Down
4 changes: 4 additions & 0 deletions include/game/bases/d_save_mng.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <game/bases/d_mj2d_data.hpp>
#include <lib/egg/core/eggHeap.h>

class dSaveMng_c {
public:
Expand All @@ -10,6 +12,8 @@ class dSaveMng_c {
void startNandSave();
void startNandLoad();

static void create(EGG::Heap *heap);

u8 mPad[0x20];
dMj2dHeader_c mHeader;

Expand Down
53 changes: 46 additions & 7 deletions include/game/bases/d_system.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,59 @@
#pragma once

#include <game/sLib/s_Phase.hpp>
#include <game/mLib/m_dvd.hpp>
#include <lib/egg/core/eggHeap.h>
#include <lib/egg/core/eggExpHeap.h>
#include <nw4r/ut.h>

namespace dSys_c {
void create();
void setBlack(bool);
void setFrameRate(u8);
void setClearColor(nw4r::ut::Color color);
void execute();
}
/// @brief Main game handler class. Handles initialization and the main game loop.
/// @ingroup bases
class dSys_c {
public:
static void beginFrame(); ///< Marks the beginning of a frame.
static void endFrame(); ///< Marks the end of a frame.
static void beginRender();
static void endRender();
static bool setBlack(bool makeBlack);
static void calcAudio();
static void setFrameRate(u8 rate);
static void setClearColor(nw4r::ut::Color color);
static nw4r::ut::Color getClearColor();
static void create(); ///< Initializes the game.
static void execute(); ///< Executes one frame of the game loop.

static EGG::Heap *ms_RootHeapMem1;
static EGG::Heap *ms_RootHeapMem2;
};

/// @brief System initialization and management functions.
/// @ingroup bases
namespace dSystem {
sPhase_c::METHOD_RESULT_e createFontManagerPhase(void *);
sPhase_c::METHOD_RESULT_e createMessageManagerPhase(void *);
sPhase_c::METHOD_RESULT_e createEffectManagerPhase1(void *);
sPhase_c::METHOD_RESULT_e createEffectManagerPhase2(void *);
void createEffectManagerHeap(EGG::Heap *heap1, EGG::Heap *heap2);

void fixArena();
void fixHeapsSub(EGG::ExpHeap *heap, int size);
void fixHeaps();

extern const char sc_EffectManagerHeap1Name[];
extern const char sc_EffectManagerHeap2Name[];
extern const char sc_FontManagerHeapName[];
extern const char sc_MessageManagerHeapName[];

extern mDvd_toMainRam_c *l_breffCommand;
extern mDvd_toMainRam_c *l_breftCommand;

extern EGG::Heap *s_FontManagerHeap;
extern EGG::Heap *s_EffectManagerHeap1;
extern EGG::Heap *s_EffectManagerHeap2;
extern EGG::Heap *s_MessageManagerHeap;

extern void *s_OrgMEM1ArenaLo;
extern void *s_NewMEM1ArenaLo;
extern void *s_OrgMEM1ArenaHi;
extern void *s_NewMEM1ArenaHi;
}
Loading
Loading