Match and link CPreFrontEnd

Former-commit-id: 2cd913399f
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-17 14:47:47 +03:00
parent c90ff954d5
commit 0ad2519985
7 changed files with 74 additions and 12 deletions

View File

@ -3,13 +3,13 @@
.section .data
.balign 8
.global lbl_803EC010
lbl_803EC010:
.global __vt__12CPreFrontEnd
__vt__12CPreFrontEnd:
# ROM: 0x3E9010
.4byte 0
.4byte 0
.4byte __dt__12CPreFrontEndFv
.4byte OnIOWinMessage__12CPreFrontEndFRC20CArchitectureMessage
.4byte OnMessage__12CPreFrontEndFRC20CArchitectureMessageR18CArchitectureQueue
.4byte GetIsContinueDraw__6CIOWinCFv
.4byte Draw__12CPreFrontEndCFv
.4byte PreDraw__6CIOWinCFv
@ -27,9 +27,9 @@ __dt__12CPreFrontEndFv:
/* 8029E4B8 0029B418 93 C1 00 08 */ stw r30, 8(r1)
/* 8029E4BC 0029B41C 7C 7E 1B 79 */ or. r30, r3, r3
/* 8029E4C0 0029B420 41 82 00 28 */ beq lbl_8029E4E8
/* 8029E4C4 0029B424 3C A0 80 3F */ lis r5, lbl_803EC010@ha
/* 8029E4C4 0029B424 3C A0 80 3F */ lis r5, __vt__12CPreFrontEnd@ha
/* 8029E4C8 0029B428 38 80 00 00 */ li r4, 0
/* 8029E4CC 0029B42C 38 05 C0 10 */ addi r0, r5, lbl_803EC010@l
/* 8029E4CC 0029B42C 38 05 C0 10 */ addi r0, r5, __vt__12CPreFrontEnd@l
/* 8029E4D0 0029B430 90 1E 00 00 */ stw r0, 0(r30)
/* 8029E4D4 0029B434 4B DB 46 D1 */ bl __dt__6CIOWinFv
/* 8029E4D8 0029B438 7F E0 07 35 */ extsh. r0, r31
@ -57,8 +57,8 @@ Draw__12CPreFrontEndCFv:
/* 8029E520 0029B480 38 21 00 10 */ addi r1, r1, 0x10
/* 8029E524 0029B484 4E 80 00 20 */ blr
.global OnIOWinMessage__12CPreFrontEndFRC20CArchitectureMessage
OnIOWinMessage__12CPreFrontEndFRC20CArchitectureMessage:
.global OnMessage__12CPreFrontEndFRC20CArchitectureMessageR18CArchitectureQueue
OnMessage__12CPreFrontEndFRC20CArchitectureMessageR18CArchitectureQueue:
/* 8029E528 0029B488 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8029E52C 0029B48C 7C 08 02 A6 */ mflr r0
/* 8029E530 0029B490 90 01 00 14 */ stw r0, 0x14(r1)
@ -127,9 +127,9 @@ __ct__12CPreFrontEndFv:
/* 8029E60C 0029B56C 4B DB 46 01 */ bl "__ct__6CIOWinFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>"
/* 8029E610 0029B570 38 61 00 08 */ addi r3, r1, 8
/* 8029E614 0029B574 48 09 F4 CD */ bl "internal_dereference__Q24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>Fv"
/* 8029E618 0029B578 3C 60 80 3F */ lis r3, lbl_803EC010@ha
/* 8029E618 0029B578 3C 60 80 3F */ lis r3, __vt__12CPreFrontEnd@ha
/* 8029E61C 0029B57C 38 00 00 00 */ li r0, 0
/* 8029E620 0029B580 38 83 C0 10 */ addi r4, r3, lbl_803EC010@l
/* 8029E620 0029B580 38 83 C0 10 */ addi r4, r3, __vt__12CPreFrontEnd@l
/* 8029E624 0029B584 7F E3 FB 78 */ mr r3, r31
/* 8029E628 0029B588 90 9F 00 00 */ stw r4, 0(r31)
/* 8029E62C 0029B58C 98 1F 00 14 */ stb r0, 0x14(r31)

View File

@ -383,7 +383,7 @@ LIBS = [
["MetroidPrime/Tweaks/CTweakSlideShow", True],
"MetroidPrime/CArtifactDoll",
"MetroidPrime/CProjectedShadow",
"MetroidPrime/CPreFrontEnd",
["MetroidPrime/CPreFrontEnd", True],
"MetroidPrime/CGameCubeDoll",
"MetroidPrime/ScriptObjects/CScriptProjectedShadow",
"MetroidPrime/ScriptObjects/CEnergyBall",

View File

@ -60,6 +60,7 @@ public:
CMain();
~CMain();
bool LoadAudio();
void UpdateStreamedAudio();
void RegisterResourceTweaks();
void ResetGameState();

View File

@ -0,0 +1,18 @@
#ifndef _CPREFRONTEND
#define _CPREFRONTEND
#include "MetroidPrime/CIOWin.hpp"
class CPreFrontEnd : public CIOWin {
public:
CPreFrontEnd();
~CPreFrontEnd();
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&);
void Draw() const;
private:
bool x14_resourceTweaksRegistered;
};
#endif // _CPREFRONTEND

View File

@ -350,7 +350,7 @@ METROIDPRIME :=\
$(BUILD_DIR)/src/MetroidPrime/Tweaks/CTweakSlideShow.o\
$(BUILD_DIR)/asm/MetroidPrime/CArtifactDoll.o\
$(BUILD_DIR)/asm/MetroidPrime/CProjectedShadow.o\
$(BUILD_DIR)/asm/MetroidPrime/CPreFrontEnd.o\
$(BUILD_DIR)/src/MetroidPrime/CPreFrontEnd.o\
$(BUILD_DIR)/asm/MetroidPrime/CGameCubeDoll.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptProjectedShadow.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CEnergyBall.o\

View File

@ -0,0 +1,43 @@
#include "MetroidPrime/CPreFrontEnd.hpp"
#include "MetroidPrime/CMain.hpp"
#include "MetroidPrime/CMemoryCard.hpp"
#include "Kyoto/CResFactory.hpp"
#include "Kyoto/Graphics/CGraphics.hpp"
CPreFrontEnd::CPreFrontEnd()
: CIOWin(rstl::string_l("Pre front-end window")), x14_resourceTweaksRegistered(false) {}
CIOWin::EMessageReturn CPreFrontEnd::OnMessage(const CArchitectureMessage& msg,
CArchitectureQueue&) {
if (msg.GetType() == kAM_TimerTick) {
if (!gpResourceFactory->GetResLoader().AreAllPaksLoaded())
return kMR_Exit;
if (!x14_resourceTweaksRegistered) {
gpMain->RegisterResourceTweaks();
x14_resourceTweaksRegistered = true;
}
gpResourceFactory->AsyncIdle(1000000);
gpMain->MemoryCardInitializePump();
if (!gpMemoryCard)
return kMR_Exit;
if (!gpMain->LoadAudio())
return kMR_Exit;
return kMR_RemoveIOWinAndExit;
} else {
return kMR_Normal;
}
}
void CPreFrontEnd::Draw() const {
CGraphics::SetIsBeginSceneClearFb(true);
}
CPreFrontEnd::~CPreFrontEnd() {}

View File

@ -6,7 +6,7 @@ void SPositionHistory::AddValue(const CVector3f& pos) {
if (x4_values.size() >= 16) {
return;
}
if (x4_values.size() == 0) {
if (x4_values.empty()) {
x4_values.push_back(pos);
return;
}