mirror of
https://github.com/PodeCaradox/GalaxyQuest-SteamFrame.git
synced 2026-10-18 20:01:20 +02:00
The sources of Petari (https://github.com/SMGCommunity/Petari), the Super Mario Galaxy decompilation by the SMGCommunity, at commit 0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and src/. Left out: the game data Petari keeps from the original executable, the error message archive (include/Game/System/ ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's own disc. The port's changes follow in the next commit, so `git diff petari-base -- decomp` shows them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
2.2 KiB
C++
89 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include "Game/Util/BothDirList.hpp"
|
|
#include "Game/Util/Color.hpp"
|
|
#include <JSystem/JUtility/JUTXfb.hpp>
|
|
#include <revolution.h>
|
|
|
|
typedef void (*PreRenderCallback)();
|
|
|
|
class MainLoopFrameworkAlarm : public OSAlarm {
|
|
public:
|
|
MainLoopFrameworkAlarm() : mLink(this) {
|
|
}
|
|
|
|
/* 0x30 */ u32 _30;
|
|
/* 0x34 */ MR::BothDirLink< MainLoopFrameworkAlarm > mLink;
|
|
|
|
static MR::BothDirList< MainLoopFrameworkAlarm > sList;
|
|
};
|
|
|
|
class MainLoopFramework {
|
|
public:
|
|
void setClearColor(Color8 color) {
|
|
mClearColor = color;
|
|
}
|
|
|
|
MainLoopFramework(void* pXfb1, void* pXfb2, void* pXfb3, bool useAlpha) : mClearColor(0xffffffff) {
|
|
ctor_subroutine(useAlpha);
|
|
JUTXfb::createManager(pXfb1, pXfb2, pXfb3);
|
|
}
|
|
|
|
~MainLoopFramework();
|
|
|
|
static MainLoopFramework* getManager() {
|
|
return sManager;
|
|
}
|
|
|
|
static MainLoopFramework* createManager(const GXRenderModeObj*, void*, void*, void*, bool);
|
|
void ctor_subroutine(bool);
|
|
void prepareCopyDisp();
|
|
void drawendXfb_single();
|
|
void exchangeXfb_double();
|
|
void exchangeXfb_triple();
|
|
void copyXfb_triple();
|
|
void preGX();
|
|
void endGX();
|
|
void waitForRetrace();
|
|
void beginRender();
|
|
void endRender();
|
|
void endFrame();
|
|
void waitBlanking(int);
|
|
void setTickRateFromFrame(u16);
|
|
void clearEfb(GXColor);
|
|
void clearEfb(int, int, int, int, GXColor);
|
|
void calcCombinationRatio();
|
|
static u32 frameToTick(f32);
|
|
static void setForOSResetSystem();
|
|
|
|
/* 0x0 */ Color8 mClearColor;
|
|
/* 0x4 */ u32 mClearZ;
|
|
/* 0x8 */ u16 mDispCopyGamma;
|
|
/* 0xA */ u16 mCopyClamp;
|
|
u32 _C;
|
|
/* 0x10 */ u16 mRetraceCount;
|
|
/* 0x14 */ u32 mTickDuration;
|
|
/* 0x18 */ bool mUseAlpha;
|
|
/* 0x19 */ bool mUseVFilter;
|
|
u8 _1A;
|
|
u8 _1B;
|
|
/* 0x1C */ f32 mCombinationRatio;
|
|
/* 0x20 */ OSTick mTick;
|
|
/* 0x24 */ s32 mLastFrameTime;
|
|
/* 0x28 */ s32 mLastVideoTickDelta;
|
|
/* 0x2C */ s32 mRenderInterval;
|
|
/* 0x30 */ s32 mRenderCounter;
|
|
/* 0x34 */ u8 mDoRenderFrame;
|
|
u8 _35;
|
|
u8 _36;
|
|
u8 _37;
|
|
/* 0x38 */ PreRenderCallback mPreRenderCallback;
|
|
/* 0x3C */ s16 mSingleBufferIndex;
|
|
u8 _3E;
|
|
|
|
u32 _pad1;
|
|
u32 _pad2;
|
|
|
|
static MainLoopFramework* sManager;
|
|
};
|