mirror of
https://github.com/zeldaret/ss
synced 2026-05-23 06:54:20 -04:00
100% eggSystem.cpp
This commit is contained in:
@@ -4897,7 +4897,7 @@ egg/core/eggUnk.cpp:
|
||||
|
||||
egg/core/eggSystem.cpp:
|
||||
.text start:0x80497170 end:0x8049752C align:16
|
||||
.data start:0x8056EA58 end:0x8056EAC8
|
||||
.data start:0x8056EA58 end:0x8056EA8C
|
||||
.sbss start:0x80576780 end:0x80576788
|
||||
|
||||
egg/core/eggDisplay.cpp:
|
||||
|
||||
@@ -39536,7 +39536,11 @@ __vt__Q23EGG7FrmHeap = .data:0x8056E9D0; // type:object size:0x30
|
||||
__vt__Q23EGG10AssertHeap = .data:0x8056EA00; // type:object size:0x30
|
||||
__vt__Q23EGG8Disposer = .data:0x8056EA30; // type:object size:0xC
|
||||
__vt__Q23EGG6Thread = .data:0x8056EA40; // type:object size:0x18
|
||||
lbl_8056EA58 = .data:0x8056EA58; // type:object size:0x70
|
||||
@8336 = .data:0x8056EA58; // type:object size:0xC data:string
|
||||
@8337 = .data:0x8056EA64; // type:object size:0xC data:string
|
||||
@8338 = .data:0x8056EA70; // type:object size:0xD data:string
|
||||
@8339 = .data:0x8056EA80; // type:object size:0xA data:string
|
||||
lbl_8056EA8C = .data:0x8056EA8C; // type:object size:0x3C
|
||||
__vt__Q23EGG7Display = .data:0x8056EAC8; // type:object size:0x20
|
||||
__vt__Q23EGG10ColorFader = .data:0x8056EAE8; // type:object size:0x24
|
||||
clear_z_TX__29@unnamed@eggAsyncDisplay_cpp@ = .data:0x8056EB20; // type:object size:0x40 scope:local align:32
|
||||
|
||||
+1
-1
@@ -1233,7 +1233,7 @@ config.libs = [
|
||||
Object(Matching, "egg/core/eggDisposer.cpp"),
|
||||
Object(Matching, "egg/core/eggThread.cpp"),
|
||||
Object(NonMatching, "egg/core/eggUnk.cpp"),
|
||||
Object(NonMatching, "egg/core/eggSystem.cpp"),
|
||||
Object(Matching, "egg/core/eggSystem.cpp"),
|
||||
Object(Matching, "egg/core/eggDisplay.cpp"),
|
||||
Object(Matching, "egg/core/eggColorFader.cpp"),
|
||||
Object(Matching, "egg/core/eggAsyncDisplay.cpp"),
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "egg/core/eggProcessMeter.h"
|
||||
#include "egg/core/eggPerformanceView.h"
|
||||
#include "egg/core/eggSystem.h"
|
||||
#include "nw4r/ut/ut_Color.h"
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef EGG_PROCESS_METER_H
|
||||
#define EGG_PROCESS_METER_H
|
||||
|
||||
#include "egg/core/eggThread.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class PerformanceView {
|
||||
public:
|
||||
// vtable at 0x0
|
||||
/* 0x08 */ virtual void measureBeginFrame() = 0;
|
||||
/* 0x0C */ virtual void measureEndFrame() = 0;
|
||||
/* 0x10 */ virtual void measureBeginRender() = 0;
|
||||
/* 0x14 */ virtual void measureEndRender() = 0;
|
||||
/* 0x18 */ virtual void callbackDrawSync(u16 token) = 0;
|
||||
/* 0x1C */ virtual void unused() = 0;
|
||||
/* 0x20 */ virtual void draw() = 0;
|
||||
/* 0x24 */ virtual void setVisible(bool visible) = 0;
|
||||
/* 0x28 */ virtual bool isVisible() = 0;
|
||||
};
|
||||
|
||||
class ProcessMeter : public Thread, public PerformanceView {};
|
||||
|
||||
}; // namespace EGG
|
||||
|
||||
#endif // EGG_PROCESS_METER_H
|
||||
@@ -1,14 +0,0 @@
|
||||
#ifndef EGG_PROCESS_METER_H
|
||||
#define EGG_PROCESS_METER_H
|
||||
|
||||
#include "egg/core/eggThread.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class PerformanceView {};
|
||||
|
||||
class ProcessMeter : public Thread, public PerformanceView {};
|
||||
|
||||
};
|
||||
|
||||
#endif // EGG_PROCESS_METER_H
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef EGG_SCENE_MANAGER_H
|
||||
#define EGG_SCENE_MANAGER_H
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class SceneManager {
|
||||
public:
|
||||
// vtable at 0x0
|
||||
/* 0x08 */ virtual void calc();
|
||||
/* 0x0C */ virtual void draw();
|
||||
/* 0x10 */ virtual void calcCurrentScene();
|
||||
/* 0x14 */ virtual void calcCurrentFader();
|
||||
/* 0x18 */ virtual void drawCurrentScene();
|
||||
/* 0x1C */ virtual void drawCurrentFader();
|
||||
/* 0x20 */ virtual void createDefaultFader();
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif // EGG_SCENE_MANAGER_H
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "common.h"
|
||||
#include "egg/core/eggVideo.h"
|
||||
|
||||
struct OSBootInfo;
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class Display;
|
||||
@@ -35,18 +37,18 @@ public:
|
||||
/* vt 0x38 */ virtual void initialize() = 0;
|
||||
|
||||
public:
|
||||
/* 0x04 */ u32 mRoot1HeapStart;
|
||||
/* 0x08 */ u32 mRoot1HeapEnd;
|
||||
/* 0x0C */ u32 mRoot2HeapStart;
|
||||
/* 0x10 */ u32 mRoot2HeapEnd;
|
||||
/* 0x04 */ void *mRoot1HeapStart;
|
||||
/* 0x08 */ void *mRoot1HeapEnd;
|
||||
/* 0x0C */ void *mRoot2HeapStart;
|
||||
/* 0x10 */ void *mRoot2HeapEnd;
|
||||
/* 0x14 */ u32 mMemSize;
|
||||
/* 0x18 */ Heap *mRootHeapMem1;
|
||||
/* 0x1C */ Heap *mRootHeapMem2;
|
||||
/* 0x20 */ Heap *mRootHeapDebug;
|
||||
/* 0x24 */ Heap *mSystemHeap;
|
||||
/* 0x28 */ Thread *mSystemThread;
|
||||
/* 0x2C */ u32 field_0x2C;
|
||||
/* 0x30 */ u32 mSystemHeapStart;
|
||||
/* 0x2C */ OSBootInfo *mBootInfo;
|
||||
/* 0x30 */ void *mSystemHeapStart;
|
||||
/* 0x34 */ u32 mSystemHeapSize;
|
||||
};
|
||||
class BaseSystem {
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
#include "egg/core/eggSystem.h"
|
||||
|
||||
#include "egg/audio/eggAudioMgr.h"
|
||||
#include "egg/core/eggController.h"
|
||||
#include "egg/core/eggDisplay.h"
|
||||
#include "egg/core/eggExpHeap.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "egg/core/eggPerformanceView.h"
|
||||
#include "egg/core/eggSceneManager.h"
|
||||
|
||||
#include "rvl/OS.h"
|
||||
|
||||
#define MB_TO_BYTES(mb) ((mb) * 1024 * 1024)
|
||||
#define RETAIL_MEM2_SIZE MB_TO_BYTES(64)
|
||||
|
||||
namespace EGG {
|
||||
|
||||
ConfigurationData *BaseSystem::mConfigData;
|
||||
|
||||
void ConfigurationData::initMemory() {
|
||||
void *pMEM1ArenaLo = OSGetMEM1ArenaLo();
|
||||
void *pMEM1ArenaHi = OSGetMEM1ArenaHi();
|
||||
void *pMEM2ArenaLo = OSGetMEM2ArenaLo();
|
||||
void *pMEM2ArenaHi = OSGetMEM2ArenaHi();
|
||||
|
||||
pMEM1ArenaLo = ROUND_UP_PTR(pMEM1ArenaLo, 32);
|
||||
pMEM1ArenaHi = ROUND_DOWN_PTR(pMEM1ArenaHi, 32);
|
||||
pMEM2ArenaLo = ROUND_UP_PTR(pMEM2ArenaLo, 32);
|
||||
pMEM2ArenaHi = ROUND_DOWN_PTR(pMEM2ArenaHi, 32);
|
||||
|
||||
mBootInfo = &OS_BOOT_INFO;
|
||||
mSystemHeapStart = pMEM1ArenaLo;
|
||||
mRoot1HeapStart = pMEM1ArenaLo;
|
||||
mRoot1HeapEnd = pMEM1ArenaHi;
|
||||
mRoot2HeapStart = pMEM2ArenaLo;
|
||||
mRoot2HeapEnd = pMEM2ArenaHi;
|
||||
mMemSize = mBootInfo->physMemSize;
|
||||
|
||||
OSSetMEM1ArenaLo(pMEM1ArenaHi);
|
||||
OSSetMEM1ArenaHi(pMEM1ArenaHi);
|
||||
OSSetMEM2ArenaLo(pMEM2ArenaHi);
|
||||
OSSetMEM2ArenaHi(pMEM2ArenaHi);
|
||||
|
||||
Heap::initialize();
|
||||
|
||||
void *root1HeapPtr = mRoot1HeapStart;
|
||||
u32 root1HeapSize = (u32)mRoot1HeapEnd - (u32)mRoot1HeapStart;
|
||||
|
||||
void *root2HeapPtr = mRoot2HeapStart;
|
||||
u32 root2HeapSize = (u32)mRoot2HeapEnd - (u32)mRoot2HeapStart;
|
||||
|
||||
u32 debugHeapSize;
|
||||
if (root2HeapSize >= RETAIL_MEM2_SIZE) {
|
||||
debugHeapSize = RETAIL_MEM2_SIZE;
|
||||
root2HeapSize = OSRoundDown32B(root2HeapSize - RETAIL_MEM2_SIZE);
|
||||
} else {
|
||||
debugHeapSize = 0;
|
||||
}
|
||||
void *debugHeapPtr = (void *)((u32)root2HeapPtr + root2HeapSize);
|
||||
|
||||
mRootHeapMem1 = ExpHeap::create(root1HeapPtr, root1HeapSize, 0);
|
||||
mRootHeapMem1->setName("EGGRootMEM1");
|
||||
|
||||
mRootHeapMem2 = ExpHeap::create(root2HeapPtr, root2HeapSize, 0);
|
||||
mRootHeapMem2->setName("EGGRootMEM2");
|
||||
|
||||
if (debugHeapSize > 0) {
|
||||
mRootHeapDebug = ExpHeap::create(debugHeapPtr, debugHeapSize, 0);
|
||||
mRootHeapDebug->setName("EGGRootDebug");
|
||||
} else {
|
||||
mRootHeapDebug = nullptr;
|
||||
}
|
||||
|
||||
mSystemHeap = ExpHeap::create(mSystemHeapSize, mRootHeapMem1, 0);
|
||||
mSystemHeap->setName("EGGSystem");
|
||||
mSystemHeap->becomeCurrentHeap();
|
||||
}
|
||||
|
||||
void ConfigurationData::run() {
|
||||
CoreControllerMgr *pControllerMgr = CoreControllerMgr::instance();
|
||||
|
||||
while (true) {
|
||||
getDisplay()->beginFrame();
|
||||
|
||||
onBeginFrame();
|
||||
|
||||
getPerfView()->measureBeginFrame();
|
||||
|
||||
pControllerMgr->beginFrame();
|
||||
|
||||
getDisplay()->beginRender();
|
||||
|
||||
getPerfView()->measureBeginRender();
|
||||
|
||||
getSceneMgr()->draw();
|
||||
|
||||
getPerfView()->draw();
|
||||
|
||||
getPerfView()->measureEndRender();
|
||||
|
||||
getDisplay()->endRender();
|
||||
|
||||
getSceneMgr()->calc();
|
||||
|
||||
pControllerMgr->endFrame();
|
||||
|
||||
if (getAudioMgr()) {
|
||||
getAudioMgr()->calc();
|
||||
}
|
||||
|
||||
getDisplay()->endFrame();
|
||||
|
||||
onEndFrame();
|
||||
|
||||
getPerfView()->measureEndFrame();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace EGG
|
||||
Reference in New Issue
Block a user