CErrorOutputWindow progress

This commit is contained in:
Luke Street 2025-01-29 18:38:05 -07:00
parent 7140b818a3
commit 9562b0dce0
7 changed files with 115 additions and 95 deletions

View File

@ -10963,13 +10963,13 @@ ProjectPointToPlane__11CWallWalkerFRC9CVector3fRC9CVector3fRC9CVector3f = .text:
__ct__11CWallWalkerFUi9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>Q210CPatterned11EFlavorTypeRC11CEntityInfoRC12CTransform4fRC10CModelDataRC14CPatternedInfoQ210CPatterned13EMovementTypeQ210CPatterned13EColliderType9EBodyTypeRC16CActorParametersUiUi = .text:0x80269260; // type:function size:0x218 scope:global __ct__11CWallWalkerFUi9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>Q210CPatterned11EFlavorTypeRC11CEntityInfoRC12CTransform4fRC10CModelDataRC14CPatternedInfoQ210CPatterned13EMovementTypeQ210CPatterned13EColliderType9EBodyTypeRC16CActorParametersUiUi = .text:0x80269260; // type:function size:0x218 scope:global
fn_80269478 = .text:0x80269478; // type:function size:0x2C fn_80269478 = .text:0x80269478; // type:function size:0x2C
fn_802694A4 = .text:0x802694A4; // type:function size:0x20 fn_802694A4 = .text:0x802694A4; // type:function size:0x20
fn_802694C4 = .text:0x802694C4; // type:function size:0x134 fn_802694C4__18CErrorOutputWindowFQ218CErrorOutputWindow6EState = .text:0x802694C4; // type:function size:0x134
fn_802695F8 = .text:0x802695F8; // type:function size:0x2D0 fn_802695F8__18CErrorOutputWindowCFv = .text:0x802695F8; // type:function size:0x2D0
Draw__18CErrorOutputWindowCFv = .text:0x802698C8; // type:function size:0x70 scope:global Draw__18CErrorOutputWindowCFv = .text:0x802698C8; // type:function size:0x70 scope:global
UpdateWindow__18CErrorOutputWindowFv = .text:0x80269938; // type:function size:0x1D0 scope:global UpdateWindow__18CErrorOutputWindowFv = .text:0x80269938; // type:function size:0x1D0 scope:global
OnMessage__18CErrorOutputWindowFRC20CArchitectureMessageR18CArchitectureQueue = .text:0x80269B08; // type:function size:0x98 scope:global OnMessage__18CErrorOutputWindowFRC20CArchitectureMessageR18CArchitectureQueue = .text:0x80269B08; // type:function size:0x98 scope:global
GetIsContinueDraw__18CErrorOutputWindowCFv = .text:0x80269BA0; // type:function size:0x20 scope:global GetIsContinueDraw__18CErrorOutputWindowCFv = .text:0x80269BA0; // type:function size:0x20 scope:global
__ct__18CErrorOutputWindowFb = .text:0x80269BC0; // type:function size:0xC0 scope:global __ct__18CErrorOutputWindowFQ218CErrorOutputWindow5EFlag = .text:0x80269BC0; // type:function size:0xC0 scope:global
SetPoint__Q220CRainSplashGenerator11SRainSplashFRC9CVector3f = .text:0x80269C80; // type:function size:0x80 scope:global SetPoint__Q220CRainSplashGenerator11SRainSplashFRC9CVector3f = .text:0x80269C80; // type:function size:0x80 scope:global
IsActive__Q220CRainSplashGenerator11SRainSplashCFv = .text:0x80269D00; // type:function size:0x40 scope:global IsActive__Q220CRainSplashGenerator11SRainSplashCFv = .text:0x80269D00; // type:function size:0x40 scope:global
Draw__Q220CRainSplashGenerator11SRainSplashCFffRC9CVector3f = .text:0x80269D40; // type:function size:0x8C scope:global Draw__Q220CRainSplashGenerator11SRainSplashCFffRC9CVector3f = .text:0x80269D40; // type:function size:0x8C scope:global
@ -18569,8 +18569,8 @@ lbl_803E9E10 = .data:0x803E9E10; // type:object size:0x2D0
lbl_803EA0E0 = .data:0x803EA0E0; // type:object size:0x10 lbl_803EA0E0 = .data:0x803EA0E0; // type:object size:0x10
lbl_803EA0F0 = .data:0x803EA0F0; // type:object size:0x2D0 lbl_803EA0F0 = .data:0x803EA0F0; // type:object size:0x2D0
lbl_803EA3C0 = .data:0x803EA3C0; // type:object size:0x1C lbl_803EA3C0 = .data:0x803EA3C0; // type:object size:0x1C
jumptable_803EA3DC = .data:0x803EA3DC; // type:object size:0x34 scope:local @443 = .data:0x803EA3DC; // type:object size:0x34 scope:local
lbl_803EA410 = .data:0x803EA410; // type:object size:0x380 @wstringBase0 = .data:0x803EA410; // type:object size:0x380 scope:local data:wstring_table
lbl_803EA790 = .data:0x803EA790; // type:object size:0x10 lbl_803EA790 = .data:0x803EA790; // type:object size:0x10
lbl_803EA7A0 = .data:0x803EA7A0; // type:object size:0xC data:4byte lbl_803EA7A0 = .data:0x803EA7A0; // type:object size:0xC data:4byte
lbl_803EA7AC = .data:0x803EA7AC; // type:object size:0xC data:4byte lbl_803EA7AC = .data:0x803EA7AC; // type:object size:0xC data:4byte

View File

@ -10963,13 +10963,13 @@ ProjectPointToPlane__11CWallWalkerFRC9CVector3fRC9CVector3fRC9CVector3f = .text:
__ct__11CWallWalkerFUi9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>Q210CPatterned11EFlavorTypeRC11CEntityInfoRC12CTransform4fRC10CModelDataRC14CPatternedInfoQ210CPatterned13EMovementTypeQ210CPatterned13EColliderType9EBodyTypeRC16CActorParametersUiUi = .text:0x802692DC; // type:function size:0x218 scope:global __ct__11CWallWalkerFUi9TUniqueIdRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>Q210CPatterned11EFlavorTypeRC11CEntityInfoRC12CTransform4fRC10CModelDataRC14CPatternedInfoQ210CPatterned13EMovementTypeQ210CPatterned13EColliderType9EBodyTypeRC16CActorParametersUiUi = .text:0x802692DC; // type:function size:0x218 scope:global
fn_80269478 = .text:0x802694F4; // type:function size:0x2C scope:global fn_80269478 = .text:0x802694F4; // type:function size:0x2C scope:global
fn_802694A4 = .text:0x80269520; // type:function size:0x20 scope:global fn_802694A4 = .text:0x80269520; // type:function size:0x20 scope:global
fn_802694C4__18CErrorOutputWindowFi = .text:0x80269540; // type:function size:0x134 scope:global fn_802694C4__18CErrorOutputWindowFQ218CErrorOutputWindow6EState = .text:0x80269540; // type:function size:0x134 scope:global
fn_802695F8__18CErrorOutputWindowCFv = .text:0x80269674; // type:function size:0x2D0 scope:global fn_802695F8__18CErrorOutputWindowCFv = .text:0x80269674; // type:function size:0x2D0 scope:global
Draw__18CErrorOutputWindowCFv = .text:0x80269944; // type:function size:0x70 scope:global Draw__18CErrorOutputWindowCFv = .text:0x80269944; // type:function size:0x70 scope:global
UpdateWindow__18CErrorOutputWindowFv = .text:0x802699B4; // type:function size:0x1D0 scope:global UpdateWindow__18CErrorOutputWindowFv = .text:0x802699B4; // type:function size:0x1D0 scope:global
OnMessage__18CErrorOutputWindowFRC20CArchitectureMessageR18CArchitectureQueue = .text:0x80269B84; // type:function size:0x98 scope:global OnMessage__18CErrorOutputWindowFRC20CArchitectureMessageR18CArchitectureQueue = .text:0x80269B84; // type:function size:0x98 scope:global
GetIsContinueDraw__18CErrorOutputWindowCFv = .text:0x80269C1C; // type:function size:0x20 scope:global GetIsContinueDraw__18CErrorOutputWindowCFv = .text:0x80269C1C; // type:function size:0x20 scope:global
__ct__18CErrorOutputWindowFb = .text:0x80269C3C; // type:function size:0xC0 scope:global __ct__18CErrorOutputWindowFQ218CErrorOutputWindow5EFlag = .text:0x80269C3C; // type:function size:0xC0 scope:global
SetPoint__Q220CRainSplashGenerator11SRainSplashFRC9CVector3f = .text:0x80269CFC; // type:function size:0x80 scope:global SetPoint__Q220CRainSplashGenerator11SRainSplashFRC9CVector3f = .text:0x80269CFC; // type:function size:0x80 scope:global
IsActive__Q220CRainSplashGenerator11SRainSplashCFv = .text:0x80269D7C; // type:function size:0x40 scope:global IsActive__Q220CRainSplashGenerator11SRainSplashCFv = .text:0x80269D7C; // type:function size:0x40 scope:global
Draw__Q220CRainSplashGenerator11SRainSplashCFffRC9CVector3f = .text:0x80269DBC; // type:function size:0x8C scope:global Draw__Q220CRainSplashGenerator11SRainSplashCFffRC9CVector3f = .text:0x80269DBC; // type:function size:0x8C scope:global
@ -18604,8 +18604,8 @@ lbl_803E9FF0 = .data:0x803E9FF0; // type:object size:0x2D0
lbl_803EA2C0 = .data:0x803EA2C0; // type:object size:0x10 lbl_803EA2C0 = .data:0x803EA2C0; // type:object size:0x10
lbl_803EA2D0 = .data:0x803EA2D0; // type:object size:0x2D0 lbl_803EA2D0 = .data:0x803EA2D0; // type:object size:0x2D0
lbl_803EA5A0 = .data:0x803EA5A0; // type:object size:0x1C lbl_803EA5A0 = .data:0x803EA5A0; // type:object size:0x1C
jumptable_803EA5BC = .data:0x803EA5BC; // type:object size:0x34 scope:local @443 = .data:0x803EA5BC; // type:object size:0x34 scope:local
lbl_803EA5F0 = .data:0x803EA5F0; // type:object size:0x380 @wstringBase0 = .data:0x803EA5F0; // type:object size:0x380 scope:local data:wstring_table
lbl_803EA970 = .data:0x803EA970; // type:object size:0x10 lbl_803EA970 = .data:0x803EA970; // type:object size:0x10
lbl_803EA980 = .data:0x803EA980; // type:object size:0xC data:4byte lbl_803EA980 = .data:0x803EA980; // type:object size:0xC data:4byte
lbl_803EA98C = .data:0x803EA98C; // type:object size:0xC data:4byte lbl_803EA98C = .data:0x803EA98C; // type:object size:0xC data:4byte

View File

@ -309,7 +309,7 @@ public:
static float GetDepthNear() { return mDepthNear; } static float GetDepthNear() { return mDepthNear; }
static float GetDepthFar() { return mDepthFar; } static float GetDepthFar() { return mDepthFar; }
static bool IsBeginSceneClearFb(); static bool IsBeginSceneClearFb() { return mIsBeginSceneClearFb; }
static void SetIsBeginSceneClearFb(bool); static void SetIsBeginSceneClearFb(bool);
static void BeginScene(); static void BeginScene();
static void EndScene(); static void EndScene();

View File

@ -95,9 +95,14 @@ public:
void AllocatePhazonSuitMaskTexture(); void AllocatePhazonSuitMaskTexture();
uchar x8_pad[0x310]; uchar x8_pad[0x310];
bool x318_24_ : 1; bool x318_24_reflectionDirty : 1;
bool x318_25_ : 1; bool x318_25_drawWireframe : 1;
bool x318_26_ : 1; bool x318_26_requestRGBA6 : 1;
bool x318_27_currentRGBA6 : 1;
bool x318_28_disableFog : 1;
bool x318_29_thermalVisor : 1;
bool x318_30_inAreaDraw : 1;
bool x318_31_persistRGBA6 : 1;
}; };
extern CCubeRenderer* gpRender; extern CCubeRenderer* gpRender;

View File

@ -7,7 +7,12 @@
class CErrorOutputWindow : public CIOWin { class CErrorOutputWindow : public CIOWin {
public: public:
CErrorOutputWindow(bool); enum EFlag {
kF_Zero,
kF_One,
};
CErrorOutputWindow(EFlag);
~CErrorOutputWindow() override; ~CErrorOutputWindow() override;
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) override; EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) override;
@ -16,17 +21,24 @@ public:
void UpdateWindow(); void UpdateWindow();
void sub_802694c4(int);
void sub_802695f8() const;
private: private:
int x14_state; enum EState {
kS_Zero,
kS_One,
kS_Two,
kS_Three,
};
EState x14_state;
bool x18_24_ : 1; bool x18_24_ : 1;
bool x18_25_ : 1; bool x18_25_ : 1;
bool x18_26_ : 1; bool x18_26_ : 1;
bool x18_27_ : 1; bool x18_27_ : 1;
bool x18_28_ : 1; bool x18_28_ : 1;
const wchar_t* x1c_msg; const wchar_t* x1c_msg;
void fn_802694C4(EState);
void fn_802695F8() const;
}; };
#endif // _CERROROUTPUTWINDOW #endif // _CERROROUTPUTWINDOW

View File

@ -2,42 +2,46 @@
#include "MetroidPrime/CArchitectureMessage.hpp" #include "MetroidPrime/CArchitectureMessage.hpp"
#include "MetaRender/CCubeRenderer.hpp"
#include "Kyoto/Graphics/CGraphics.hpp" #include "Kyoto/Graphics/CGraphics.hpp"
#include "MetaRender/CCubeRenderer.hpp"
#include "MetroidPrime/CIOWin.hpp"
#include "MetroidPrime/CMemoryCardDriver.hpp"
#include "dolphin/dvd.h" #include "dolphin/dvd.h"
CErrorOutputWindow::CErrorOutputWindow(bool flag) CErrorOutputWindow::CErrorOutputWindow(EFlag flag)
: CIOWin(rstl::string_l("Error Output Window")) : CIOWin(rstl::string_l("Error output window"))
, x14_state(0) , x14_state(kS_Zero)
, x18_24_(false) , x18_24_(false)
, x18_25_(true) , x18_25_(true)
, x18_26_(true) , x18_26_(true)
, x18_27_(true) , x18_27_(true)
, x18_28_(flag) , x18_28_(flag == kF_Zero)
, x1c_msg(nullptr) , x1c_msg(nullptr) {}
{} bool CErrorOutputWindow::GetIsContinueDraw() const { return x14_state < kS_Two; }
bool CErrorOutputWindow::GetIsContinueDraw() const { return x14_state == 2; }
CIOWin::EMessageReturn CErrorOutputWindow::OnMessage(const CArchitectureMessage& msg, CIOWin::EMessageReturn CErrorOutputWindow::OnMessage(const CArchitectureMessage& msg,
CArchitectureQueue&) { CArchitectureQueue&) {
switch (msg.GetType()) { switch (msg.GetType()) {
case kAM_UserInput: case kAM_UserInput:
return CIOWin::EMessageReturn((-x14_state | x14_state) >> 0x1f); if (x14_state != kS_Zero) {
return kMR_Exit;
}
return kMR_Normal;
case kAM_FrameBegin: case kAM_FrameBegin:
UpdateWindow(); UpdateWindow();
// fallthrough
case kAM_TimerTick: case kAM_TimerTick:
case kAM_FrameEnd: case kAM_FrameEnd:
{ if (x14_state < kS_One) {
int result = x14_state ^ 1; return kMR_Exit;
result = (result >> 1) - ((result & x14_state) >> 0x1f);
return CIOWin::EMessageReturn(result);
} }
return kMR_Normal;
default:
break; break;
} }
return kMR_Normal; return kMR_Normal;
@ -45,90 +49,89 @@ CIOWin::EMessageReturn CErrorOutputWindow::OnMessage(const CArchitectureMessage&
void CErrorOutputWindow::UpdateWindow() { void CErrorOutputWindow::UpdateWindow() {
if (x14_state == 1) { if (x14_state == 1) {
sub_802694c4(2); fn_802694C4(kS_Two);
return; return;
} }
s32 driveStatus = DVDGetDriveStatus(); s32 driveStatus = DVDGetDriveStatus();
const wchar_t* errMsg = nullptr; const wchar_t* errMsg = nullptr;
int flagThing = (-x14_state | x14_state) >> 0x1f; bool flagThing = x14_state != kS_Zero;
static s32 s_LastDvdStatus = 0; static s32 s_LastDvdStatus = 0;
if (driveStatus != s_LastDvdStatus) { if (driveStatus != s_LastDvdStatus) {
s_LastDvdStatus = driveStatus; s_LastDvdStatus = driveStatus;
} }
if (true) { switch (driveStatus) {
switch (driveStatus) case 5:
{ errMsg = L"The Disc Cover is open.\nIf you want to continue the game,\nplease close the Disc "
case 4: L"Cover.";
errMsg = L"Please insert the\nMetroid Prime Game Disc"; break;
break; case 4:
errMsg = L"Please insert the\nMetroid Prime Game Disc.";
case 5: break;
errMsg = L"The Disc Cover is open.\nIf you want to continue the game,\nplease close the Disc Cover."; case 6:
break; errMsg = L"This is not the\nMetroid Prime Game Disc.\n \nPlease insert the\nMetroid Prime "
L"Game Disc.";
case 6: break;
errMsg = L"This is not the\nMetroid Prime Game Disc.\n \nPlease insert the\nMetroid Prime Game Disc."; case -1:
break; errMsg = L"An error has occurred. Turn the\npower off and refer to the\nNintendo "
L"GameCube\nInstruction Booklet\nfor further instructions.";
case 0xb: break;
errMsg = L"The Game Disc could not be read.\nPlease read the Nintendo GameCube\nInstruction Booklet\nfor more information."; case 0xb:
break; errMsg = L"The Game Disc could not be read.\nPlease read the Nintendo GameCube\nInstruction "
L"Booklet\nfor more information.";
case -1: break;
errMsg = L"An error has occurred. Turn the\npower off and refer to the\nNintendo GameCube\nInstruction Booklet\nfor further instructions."; default:
break;
default: }
break; bool flag = false;
} if (driveStatus != 2 && driveStatus != 1) {
bool flag = false; flagThing = errMsg != nullptr;
if (driveStatus != 2 && driveStatus != 1 && errMsg) { if (errMsg != nullptr) {
if (x1c_msg != nullptr && errMsg != x1c_msg) { if (x1c_msg != nullptr && errMsg != x1c_msg) {
flag = true; flag = true;
} }
x1c_msg = errMsg; x1c_msg = errMsg;
} }
if (flagThing == 0) { }
if (x14_state != 0) { if (!flagThing) {
if (x18_26_) { if (x14_state != kS_Zero) {
CGraphics::SetIsBeginSceneClearFb(x18_24_); if (x18_28_) {
} CGraphics::SetIsBeginSceneClearFb(x18_24_);
sub_802694c4(0);
} }
} else if (x14_state == 3) { fn_802694C4(kS_Zero);
if (flag) { }
if (x18_26_) { } else if (x14_state != kS_Three) {
CGraphics::SetIsBeginSceneClearFb(x18_24_); if (x14_state == kS_Zero) {
} x18_24_ = CGraphics::IsBeginSceneClearFb();
sub_802694c4(2); }
fn_802694C4(EState(x14_state + 1));
} else {
if (flag) {
if (x18_28_) {
CGraphics::SetIsBeginSceneClearFb(x18_24_);
} }
} else { fn_802694C4(kS_Two);
if (x14_state == 0) {
x18_24_ = CGraphics::IsBeginSceneClearFb();
}
sub_802694c4(x14_state + 1);
} }
} }
} }
void CErrorOutputWindow::Draw() const { void CErrorOutputWindow::Draw() const {
// SCOPED_GRAPHICS_DEBUG_GROUP("CErrorOutputWindow::Draw", zeus::skGreen);
switch (x14_state) { switch (x14_state) {
case 0: case 0:
break; break;
case 2: case 2:
sub_802695f8(); fn_802695F8();
case 1: case 1:
case 3: case 3:
CGraphics::SetIsBeginSceneClearFb(false); CGraphics::SetIsBeginSceneClearFb(false);
if (gpRender != NULL) { if (gpRender != NULL) {
gpRender->x318_26_ = true; gpRender->x318_26_requestRGBA6 = true;
} }
break; break;
} }
} }
void CErrorOutputWindow::sub_802695f8() const {} void CErrorOutputWindow::fn_802695F8() const {}
void CErrorOutputWindow::sub_802694c4(int) {} void CErrorOutputWindow::fn_802694C4(EState) {}

View File

@ -283,7 +283,7 @@ CGameArchitectureSupport::CGameArchitectureSupport(COsContext& osContext)
x58_ioWinMgr.AddIOWin(rs_new CMainFlow(), 0, 0); x58_ioWinMgr.AddIOWin(rs_new CMainFlow(), 0, 0);
x58_ioWinMgr.AddIOWin(rs_new CConsoleOutputWindow(8, 5.f, 0.75f), 100, 0); x58_ioWinMgr.AddIOWin(rs_new CConsoleOutputWindow(8, 5.f, 0.75f), 100, 0);
x58_ioWinMgr.AddIOWin(rs_new CAudioStateWin(), 100, -1); x58_ioWinMgr.AddIOWin(rs_new CAudioStateWin(), 100, -1);
x58_ioWinMgr.AddIOWin(rs_new CErrorOutputWindow(false), 10000, 100000); x58_ioWinMgr.AddIOWin(rs_new CErrorOutputWindow(CErrorOutputWindow::kF_Zero), 10000, 100000);
InitializeApplicationUI(x44_guiSys); InitializeApplicationUI(x44_guiSys);
CGuiSys::SetGlobalGuiSys(&x44_guiSys); CGuiSys::SetGlobalGuiSys(&x44_guiSys);
gpController = x30_inputGenerator.GetController(); gpController = x30_inputGenerator.GetController();