2021-10-03 21:04:03 +00:00
|
|
|
#ifndef _SYSTEM_H
|
|
|
|
#define _SYSTEM_H
|
|
|
|
|
|
|
|
#include "types.h"
|
2021-11-02 03:35:18 +00:00
|
|
|
#include "DvdThreadCommand.h"
|
2021-10-03 21:04:03 +00:00
|
|
|
|
2021-12-06 00:22:31 +00:00
|
|
|
struct Graphics;
|
|
|
|
struct OSContext;
|
|
|
|
|
2021-10-04 17:51:29 +00:00
|
|
|
void Pikmin2DefaultMemoryErrorRoutine(void*, u32, s32);
|
|
|
|
void kando_panic_f(bool, const char*, s32, const char*, ...);
|
2022-01-12 03:31:11 +00:00
|
|
|
extern void preUserCallback(unsigned short, OSContext*, unsigned long, unsigned long);
|
2021-10-04 11:51:11 +00:00
|
|
|
|
2021-10-19 10:18:55 +00:00
|
|
|
typedef s32 ERenderMode;
|
|
|
|
|
|
|
|
namespace Game {
|
2021-12-06 00:22:31 +00:00
|
|
|
namespace CommonSaveData {
|
2022-01-04 13:51:21 +00:00
|
|
|
struct Mgr;
|
2021-10-19 10:18:55 +00:00
|
|
|
};
|
|
|
|
} // namespace Game
|
|
|
|
|
2021-10-03 21:04:03 +00:00
|
|
|
struct System {
|
2022-01-12 03:31:11 +00:00
|
|
|
enum LanguageID { LANG_ENGLISH = 0, LANG_FRENCH, LANG_GERMAN, LANG_HOL_UNUSED, LANG_ITALIAN, LANG_JAPANESE, LANG_SPANISH };
|
2021-10-19 10:18:55 +00:00
|
|
|
struct FragmentationChecker {
|
|
|
|
FragmentationChecker(char*, bool);
|
|
|
|
~FragmentationChecker();
|
|
|
|
};
|
|
|
|
|
2021-10-11 02:05:19 +00:00
|
|
|
System();
|
|
|
|
~System();
|
2021-10-19 10:18:55 +00:00
|
|
|
|
|
|
|
static struct _GXRenderModeObj* getRenderModeObj();
|
|
|
|
static void assert_fragmentation(char*);
|
|
|
|
static void createSoundSystem();
|
|
|
|
static void loadSoundResource();
|
2021-10-11 02:05:19 +00:00
|
|
|
static void initialize();
|
2021-10-19 10:18:55 +00:00
|
|
|
|
|
|
|
void enableCPULockDetector(int);
|
|
|
|
int disableCPULockDetector();
|
|
|
|
void construct();
|
|
|
|
void constructWithDvdAccessFirst();
|
|
|
|
void constructWithDvdAccessSecond();
|
2021-10-19 12:10:46 +00:00
|
|
|
void createRomFont(struct JKRHeap*);
|
2021-10-19 10:18:55 +00:00
|
|
|
void destroyRomFont();
|
|
|
|
void loadResourceFirst();
|
|
|
|
void loadResourceSecond();
|
2021-10-11 02:05:19 +00:00
|
|
|
int run();
|
2021-10-19 10:18:55 +00:00
|
|
|
static float getTime();
|
|
|
|
void clearOptionBlockSaveFlag();
|
|
|
|
void setOptionBlockSaveFlag();
|
|
|
|
Game::CommonSaveData::Mgr* getPlayCommonData();
|
|
|
|
void dvdLoadUseCallBack(struct DvdThreadCommand*, struct IDelegate*);
|
|
|
|
void deleteThreads();
|
|
|
|
struct JFWDisplay* setCurrentDisplay(struct JFWDisplay*);
|
|
|
|
u32 clearCurrentDisplay(struct JFWDisplay*);
|
2021-12-15 18:49:16 +00:00
|
|
|
bool beginFrame();
|
2021-10-19 10:18:55 +00:00
|
|
|
void endFrame();
|
|
|
|
void beginRender();
|
|
|
|
void endRender();
|
|
|
|
ERenderMode setRenderMode(ERenderMode);
|
|
|
|
void changeRenderMode(ERenderMode);
|
2021-12-06 00:22:31 +00:00
|
|
|
// Possibilities: HeapStatus*, bool, ???
|
2021-10-19 10:18:55 +00:00
|
|
|
u32 heapStatusStart(char*, JKRHeap*);
|
|
|
|
void heapStatusEnd(char*);
|
|
|
|
void heapStatusDump(bool);
|
|
|
|
void heapStatusIndividual();
|
|
|
|
void heapStatusNormal();
|
|
|
|
void resetOn(bool);
|
|
|
|
void resetPermissionOn();
|
|
|
|
bool isResetActive();
|
|
|
|
void activeGP();
|
|
|
|
void inactiveGP();
|
|
|
|
bool isDvdErrorOccured();
|
|
|
|
void initCurrentHeapMutex();
|
|
|
|
void startChangeCurrentHeap(JKRHeap*);
|
|
|
|
void endChangeCurrentHeap();
|
|
|
|
void addGenNode(struct CNode*);
|
|
|
|
void initGenNode();
|
|
|
|
void refreshGenNode();
|
|
|
|
void setFrameRate(int);
|
|
|
|
bool dvdLoadSyncNoBlock(struct DvdThreadCommand*);
|
|
|
|
int dvdLoadSyncAllNoBlock();
|
2021-10-03 21:04:03 +00:00
|
|
|
|
2021-12-06 00:22:31 +00:00
|
|
|
f32 _00; // _00
|
|
|
|
f32 _04; // _04
|
|
|
|
f32 _08; // _08
|
|
|
|
u8 _0C[0xC]; // _0C
|
|
|
|
struct JKRHeap* _18; // _18
|
|
|
|
u32 m_cpuRetraceCount; // _1C
|
|
|
|
u32 m_cpuLockCount; // _20
|
|
|
|
Graphics* m_gfx; // _24
|
|
|
|
struct SysTimers* m_timers; // _28
|
|
|
|
u32 _2C; // _2C
|
|
|
|
u32 _30; // _30
|
|
|
|
u32 _34; // _34
|
|
|
|
struct JKRHeap* m_sysHeap; // _38
|
|
|
|
struct GameFlow* m_gameFlow; // _3C
|
|
|
|
struct DvdThread* m_dvdThread; // _40
|
|
|
|
struct ResetManager* m_resetMgr; // _44
|
|
|
|
struct DvdStatus* m_dvdStatus; // _48
|
|
|
|
struct JFWDisplay* m_display; // _4C
|
|
|
|
struct HeapStatus* m_heapStatus; // _50
|
|
|
|
float m_secondsPerFrame; // _54
|
|
|
|
struct JKRTask* m_task; // _58
|
|
|
|
struct MemoryCardMgr* m_cardMgr; // _5C
|
|
|
|
struct Game::CommonSaveData::Mgr* m_playData; // _60
|
|
|
|
float m_fpsFactor; // _64
|
|
|
|
DvdThreadCommand m_threadCommand; // _68
|
|
|
|
int m_region; // _D4
|
|
|
|
u32 m_flags; // _D8
|
|
|
|
struct JUTRomFont* m_romFont; // _DC
|
2021-10-03 21:04:03 +00:00
|
|
|
};
|
|
|
|
|
2021-12-23 15:14:01 +00:00
|
|
|
extern System* sys;
|
2021-11-01 02:25:00 +00:00
|
|
|
|
2021-10-14 19:43:06 +00:00
|
|
|
#endif
|