From ebd7e3feed369cc482ec7b5f537c4d363f81eb60 Mon Sep 17 00:00:00 2001 From: TakaRikka <38417346+TakaRikka@users.noreply.github.com> Date: Tue, 12 Nov 2024 02:41:55 -0800 Subject: [PATCH] d_error_msg mostly done, little Z2LinkMgr work (#2248) --- config/GZ2E01/splits.txt | 5 +- include/JSystem/J2DGraph/J2DTextBox.h | 14 +- include/JSystem/JFramework/JFWDisplay.h | 1 + include/JSystem/JUtility/JUTFont.h | 3 + include/Z2AudioLib/Z2AudioMgr.h | 3 +- include/Z2AudioLib/Z2Creature.h | 4 +- include/Z2AudioLib/Z2SoundHandles.h | 7 + include/d/d_error_msg.h | 8 +- include/m_Do/m_Do_graphic.h | 1 + src/Z2AudioLib/Z2LinkMgr.cpp | 434 ++++++++---------------- src/d/actor/d_a_alink.cpp | 8 + src/d/d_error_msg.cpp | 354 ++++++++++++------- src/d/d_eye_hl.cpp | 24 -- src/d/d_file_sel_warning.cpp | 6 +- 14 files changed, 416 insertions(+), 456 deletions(-) diff --git a/config/GZ2E01/splits.txt b/config/GZ2E01/splits.txt index f6d63d45a85..cbb0830cb25 100644 --- a/config/GZ2E01/splits.txt +++ b/config/GZ2E01/splits.txt @@ -739,12 +739,13 @@ d/d_model.cpp: d/d_eye_hl.cpp: .text start:0x8009C964 end:0x8009CB88 .rodata start:0x8037B100 end:0x8037B140 - .sbss start:0x80450FA8 end:0x80450FC0 + .sbss start:0x80450FA8 end:0x80450FB0 .sdata2 start:0x80452C10 end:0x80452C18 d/d_error_msg.cpp: .text start:0x8009CB88 end:0x8009D87C .rodata start:0x8037B140 end:0x8038D658 + .sbss start:0x80450FB0 end:0x80450FB8 .sdata2 start:0x80452C18 end:0x80452C50 .sbss2 start:0x80456B78 end:0x80456B80 @@ -785,7 +786,7 @@ d/actor/d_a_alink.cpp: .data start:0x803AF990 end:0x803B3610 .bss start:0x80425508 end:0x80425708 .sdata start:0x80450690 end:0x804506A8 - .sbss start:0x80450FC0 end:0x80450FD8 + .sbss start:0x80450FB8 end:0x80450FD8 .sdata2 start:0x80452C50 end:0x804533A8 d/actor/d_a_itembase.cpp: diff --git a/include/JSystem/J2DGraph/J2DTextBox.h b/include/JSystem/J2DGraph/J2DTextBox.h index dc8604e26b9..2663da76215 100644 --- a/include/JSystem/J2DGraph/J2DTextBox.h +++ b/include/JSystem/J2DGraph/J2DTextBox.h @@ -76,7 +76,11 @@ class J2DTextBox : public J2DPane { /* 8021C7F4 */ virtual JUTFont* getFont() const { return mFont; } /* 80254408 */ virtual bool setBlack(JUtility::TColor); /* 80186C84 */ virtual bool setWhite(JUtility::TColor white) { mWhiteColor = white; return true; } - /* 8019230C */ virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor); + /* 8019230C */ virtual bool setBlackWhite(JUtility::TColor black, JUtility::TColor white) { + mBlackColor = black; + mWhiteColor = white; + return true; + } /* 801DFA34 */ virtual JUtility::TColor getBlack() const { return mBlackColor; } @@ -126,6 +130,14 @@ class J2DTextBox : public J2DPane { mGradientColor = i_GradientColor; } + void setCharColor(JUtility::TColor i_charColor) { + mCharColor.set(i_charColor); + } + + void setGradColor(JUtility::TColor i_GradientColor) { + mGradientColor.set(i_GradientColor); + } + void setCharSpace(f32 space) { mCharSpacing = space; } f32 getCharSpace() const { return mCharSpacing; } void setLineSpace(f32 space) { mLineSpacing = space; } diff --git a/include/JSystem/JFramework/JFWDisplay.h b/include/JSystem/JFramework/JFWDisplay.h index 5aa79d3792b..69ae5bfc376 100644 --- a/include/JSystem/JFramework/JFWDisplay.h +++ b/include/JSystem/JFramework/JFWDisplay.h @@ -98,6 +98,7 @@ class JFWDisplay { void setDrawDoneMethod(EDrawDone drawDone) { mDrawDoneMethod = drawDone; } void setFader(JUTFader* fader) { mFader = fader; } + void resetFader() { setFader(NULL); } JUTFader* getFader() const { return mFader; } void setClearColor(JUtility::TColor color) { mClearColor = color; } diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h index ec7c7a10992..310148f42fa 100644 --- a/include/JSystem/JUtility/JUTFont.h +++ b/include/JSystem/JUtility/JUTFont.h @@ -100,6 +100,9 @@ class JUTFont { static bool isLeadByte_ShiftJIS(int b) { return (b >= 0x81 && b <= 0x9f) || (b >= 0xe0 && b <= 0xfc); } + static bool isLeadByte_EUC(int b) { + return (b >= 0xA1 && b <= 0xFE) || b == 0x8E; + } void initialize_state(); void setCharColor(JUtility::TColor col1); diff --git a/include/Z2AudioLib/Z2AudioMgr.h b/include/Z2AudioLib/Z2AudioMgr.h index b118ef2e973..106b78aebba 100644 --- a/include/Z2AudioLib/Z2AudioMgr.h +++ b/include/Z2AudioLib/Z2AudioMgr.h @@ -29,8 +29,9 @@ class Z2AudioMgr : public Z2SeMgr, public Z2SeqMgr, public Z2SceneMgr, public Z2 void resetRecover(); bool hasReset() const; - static Z2AudioMgr* getInterface() { return mAudioMgrPtr; } + bool isResetting() { return mResettingFlag; } + static Z2AudioMgr* getInterface() { return mAudioMgrPtr; } static Z2AudioMgr* mAudioMgrPtr; /* 0x0514 */ virtual bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3 const*); diff --git a/include/Z2AudioLib/Z2Creature.h b/include/Z2AudioLib/Z2Creature.h index 8387da2bdd7..54e26ddad02 100644 --- a/include/Z2AudioLib/Z2Creature.h +++ b/include/Z2AudioLib/Z2Creature.h @@ -64,8 +64,8 @@ class Z2CreatureLink : public Z2Creature, public Z2LinkSoundStarter { void setRiding(bool); void setMagnetized(bool); void setWolfEyeOpen(bool); - void startLinkSound(JAISoundID, u32, s8); - void startLinkSoundLevel(JAISoundID, u32, s8); + Z2SoundHandlePool* startLinkSound(JAISoundID, u32, s8); + JAISoundHandle* startLinkSoundLevel(JAISoundID, u32, s8); void startLinkVoice(JAISoundID, s8); void startLinkVoiceLevel(JAISoundID, s8); void startLinkSwordSound(JAISoundID, u32, s8); diff --git a/include/Z2AudioLib/Z2SoundHandles.h b/include/Z2AudioLib/Z2SoundHandles.h index 352dbaa99d7..117661fb792 100644 --- a/include/Z2AudioLib/Z2SoundHandles.h +++ b/include/Z2AudioLib/Z2SoundHandles.h @@ -30,6 +30,13 @@ class Z2SoundHandles : protected JSUList { void stopAllSounds(u32 fadeout); + void stopSound(JAISoundID soundID, u32 param_1) { + JAISoundHandle* phandle = getHandleSoundID(soundID); + if (phandle != NULL) { + (*phandle)->stop(param_1); + } + } + void setPos(const JGeometry::TVec3& pos); int getNumHandles() const { return getNumLinks(); } diff --git a/include/d/d_error_msg.h b/include/d/d_error_msg.h index e161f967750..b38c67403f1 100644 --- a/include/d/d_error_msg.h +++ b/include/d/d_error_msg.h @@ -8,14 +8,8 @@ struct dShutdownErrorMsg_c { }; struct dDvdErrorMsg_c { - /* 8009D194 */ void draw(s32); + /* 8009D194 */ static void draw(s32); /* 8009D354 */ static u8 execute(); }; -struct J2DOrthoGraph { - /* 802E96D0 */ J2DOrthoGraph(f32, f32, f32, f32, f32, f32); - /* 802E97B4 */ void setPort(); - /* 802E980C */ void setOrtho(JGeometry::TBox2 const&, f32, f32); -}; - #endif /* D_D_ERROR_MSG_H */ diff --git a/include/m_Do/m_Do_graphic.h b/include/m_Do/m_Do_graphic.h index 2c002c191f1..fa458c501b0 100644 --- a/include/m_Do/m_Do_graphic.h +++ b/include/m_Do/m_Do_graphic.h @@ -7,6 +7,7 @@ class JUTFader; int mDoGph_Create(); +void mDoGph_drawFilterQuad(s8 param_0, s8 param_1); extern bool data_80450BE7; // AutoForcus diff --git a/src/Z2AudioLib/Z2LinkMgr.cpp b/src/Z2AudioLib/Z2LinkMgr.cpp index 7481b744118..96664f7dc79 100644 --- a/src/Z2AudioLib/Z2LinkMgr.cpp +++ b/src/Z2AudioLib/Z2LinkMgr.cpp @@ -9,10 +9,6 @@ #include "dol2asm.h" #include "global.h" -// -// Types: -// - struct Z2SoundObjCoach { /* 802C54B8 */ Z2SoundObjCoach(); /* 802C54FC */ void init(Vec*, u8); @@ -21,126 +17,12 @@ struct Z2SoundObjCoach { /* 802C57C0 */ int startSound(JAISoundID, u32, s8); }; -// -// Forward References: -// - -extern "C" void setLinkGroupInfo__14Z2CreatureLinkFUc(); -extern "C" void setLinkHp__14Z2CreatureLinkFll(); -extern "C" void setLinkSwordType__14Z2CreatureLinkFll(); -extern "C" void setLinkShieldType__14Z2CreatureLinkFll(); -extern "C" void setLinkBootsType__14Z2CreatureLinkFl(); -extern "C" void __ct__14Z2CreatureLinkFv(); -extern "C" void __dt__18Z2LinkSoundStarterFv(); -extern "C" void __dt__14Z2CreatureLinkFv(); -extern "C" void deleteObject__14Z2CreatureLinkFv(); -extern "C" void init__14Z2CreatureLinkFP3VecP3VecP3Vec(); -extern "C" void initKantera__14Z2CreatureLinkFP3Vec(); -extern "C" void deleteKantera__14Z2CreatureLinkFv(); -extern "C" void setKanteraState__14Z2CreatureLinkFUc(); -extern "C" void framework__14Z2CreatureLinkFUlSc(); -extern "C" void setSinkDepth__14Z2CreatureLinkFSc(); -extern "C" void setRiding__14Z2CreatureLinkFb(); -extern "C" void setMagnetized__14Z2CreatureLinkFb(); -extern "C" void setWolfEyeOpen__14Z2CreatureLinkFb(); -extern "C" void startLinkSound__14Z2CreatureLinkF10JAISoundIDUlSc(); -extern "C" void startLinkSoundLevel__14Z2CreatureLinkF10JAISoundIDUlSc(); -extern "C" void startLinkVoice__14Z2CreatureLinkF10JAISoundIDSc(); -extern "C" void startLinkVoiceLevel__14Z2CreatureLinkF10JAISoundIDSc(); -extern "C" void startLinkSwordSound__14Z2CreatureLinkF10JAISoundIDUlSc(); -extern "C" void startCollisionSE__14Z2CreatureLinkFUlUl(); -extern "C" void startHitItemSE__14Z2CreatureLinkFUlUlP14Z2SoundObjBasef(); -extern "C" void setResumeAttack__14Z2CreatureLinkFb(); -extern "C" void __ct__18Z2LinkSoundStarterFv(); -extern "C" void func_802C4928(); -extern "C" void __ct__14Z2CreatureRideFv(); -extern "C" void __dt__18Z2RideSoundStarterFv(); -extern "C" void __dt__14Z2CreatureRideFv(); -extern "C" void deleteObject__14Z2CreatureRideFv(); -extern "C" void init__14Z2CreatureRideFP3VecP3VecUcUc(); -extern "C" void setLinkRiding__14Z2CreatureRideFb(); -extern "C" void __ct__18Z2RideSoundStarterFP14Z2CreatureRide(); -extern "C" void func_802C5284(); -extern "C" void __ct__15Z2SoundObjCoachFv(); -extern "C" void init__15Z2SoundObjCoachFP3VecUc(); -extern "C" void startWheelSound__15Z2SoundObjCoachFf(); -extern "C" void startFireSound__15Z2SoundObjCoachFUs(); -extern "C" void startSound__15Z2SoundObjCoachF10JAISoundIDUlSc(); -extern "C" static void func_802C588C(); -extern "C" static void func_802C5894(); -extern "C" u8 mLinkPtr__14Z2CreatureLink[4 + 4 /* padding */]; - -// -// External References: -// - -extern "C" void isEventBit__11dSv_event_cCFUs(); -extern "C" void stop__8JAISoundFUl(); -extern "C" void moveVolume__18JAISoundParamsMoveFfUl(); -extern "C" void movePitch__18JAISoundParamsMoveFfUl(); -extern "C" void __dt__15JAISoundStarterFv(); -extern "C" void linearTransform__6Z2CalcFfffffb(); -extern "C" void getParamByExp__6Z2CalcFffffffQ26Z2Calc9CurveSign(); -extern "C" void __ct__14Z2SoundStarterFb(); -extern "C" void func_802AABF4(); -extern "C" void func_802AAC3C(); -extern "C" void setPortData__14Z2SoundStarterFP14JAISoundHandleUlUsSc(); -extern "C" void getHandleSoundID__14Z2SoundHandlesF10JAISoundID(); -extern "C" void stopAllSounds__14Z2SoundHandlesFUl(); -extern "C" void isActive__14Z2SoundHandlesCFv(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void seStartLevel__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void setBattleSeqState__8Z2SeqMgrFUc(); -extern "C" void setBattleLastHit__8Z2SeqMgrFUc(); -extern "C" void setFxForceOff__11Z2FxLineMgrFb(); -extern "C" void setTargetVolume__10Z2AudienceFfi(); -extern "C" void __ct__14Z2SoundObjBaseFv(); -extern "C" void __dt__14Z2SoundObjBaseFv(); -extern "C" void init__14Z2SoundObjBaseFP3VecUc(); -extern "C" void deleteObject__14Z2SoundObjBaseFv(); -extern "C" void framework__14Z2SoundObjBaseFUlSc(); -extern "C" void dispose__14Z2SoundObjBaseFv(); -extern "C" void stopOK__14Z2SoundObjBaseFR17Z2SoundHandlePool(); -extern "C" void startSound__14Z2SoundObjBaseF10JAISoundIDUlSc(); -extern "C" void startLevelSound__14Z2SoundObjBaseF10JAISoundIDUlSc(); -extern "C" void startCollisionSE__14Z2SoundObjBaseFUlUlP14Z2SoundObjBase(); -extern "C" void __ct__16Z2SoundObjSimpleFv(); -extern "C" void setGhostEnemyState__13Z2SoundObjMgrFUc(); -extern "C" void __ct__10Z2CreatureFv(); -extern "C" void __dt__10Z2CreatureFv(); -extern "C" void deleteObject__10Z2CreatureFv(); -extern "C" void init__10Z2CreatureFP3VecP3VecUcUc(); -extern "C" void init__10Z2CreatureFP3VecP3VecP3VecUcUcUc(); -extern "C" void setSoundStarter__10Z2CreatureFP14Z2SoundStarter(); -extern "C" void framework__10Z2CreatureFUlSc(); -extern "C" void startCreatureSound__10Z2CreatureF10JAISoundIDUlSc(); -extern "C" void startCreatureSoundLevel__10Z2CreatureF10JAISoundIDUlSc(); -extern "C" void startCreatureVoice__10Z2CreatureF10JAISoundIDSc(); -extern "C" void startCreatureVoiceLevel__10Z2CreatureF10JAISoundIDSc(); -extern "C" void startCreatureExtraSound__10Z2CreatureF10JAISoundIDUlSc(); -extern "C" void startCreatureExtraSoundLevel__10Z2CreatureF10JAISoundIDUlSc(); -extern "C" void startCollisionSE__10Z2CreatureFUlUl(); -extern "C" void __dl__FPv(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */]; -extern "C" extern void* __vt__14Z2SoundStarter[5 + 1 /* padding */]; -extern "C" extern void* __vt__16Z2SoundObjSimple[8]; - -// -// Declarations: -// - /* 802C321C-802C3220 2BDB5C 0004+00 0/0 1/1 0/0 .text setLinkGroupInfo__14Z2CreatureLinkFUc */ void Z2CreatureLink::setLinkGroupInfo(u8) {} /* 802C3220-802C3228 -00001 0008+00 0/0 0/0 0/0 .text setLinkHp__14Z2CreatureLinkFll */ -void Z2CreatureLink::setLinkHp(s32 hp, s32) { - mLinkHp = hp; +void Z2CreatureLink::setLinkHp(s32 i_hp, s32) { + mLinkHp = i_hp; } /* 802C3228-802C328C 2BDB68 0064+00 0/0 1/1 0/0 .text setLinkSwordType__14Z2CreatureLinkFll */ @@ -182,75 +64,6 @@ void Z2CreatureLink::setLinkBootsType(s32 i_bootsType) { } } -/* ############################################################################################## */ -/* 803CB8F0-803CB910 028A10 0020+00 1/1 0/0 1/1 .data __vt__15Z2SoundObjCoach */ -SECTION_DATA extern void* __vt__15Z2SoundObjCoach[8] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)framework__14Z2SoundObjBaseFUlSc, - (void*)dispose__14Z2SoundObjBaseFv, - (void*)stopOK__14Z2SoundObjBaseFR17Z2SoundHandlePool, - (void*)init__15Z2SoundObjCoachFP3VecUc, - (void*)startSound__15Z2SoundObjCoachF10JAISoundIDUlSc, - (void*)startLevelSound__14Z2SoundObjBaseF10JAISoundIDUlSc, -}; - -/* 803CB910-803CB924 028A30 0014+00 3/3 0/0 0/0 .data __vt__18Z2RideSoundStarter */ -SECTION_DATA extern void* __vt__18Z2RideSoundStarter[5] = { - (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__18Z2RideSoundStarterFv, - (void*)func_802AABF4, (void*)func_802C5284, -}; - -/* 803CB924-803CB96C 028A44 0048+00 2/2 0/0 0/0 .data __vt__14Z2CreatureRide */ -SECTION_DATA extern void* __vt__14Z2CreatureRide[18] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)deleteObject__14Z2CreatureRideFv, - (void*)setSoundStarter__10Z2CreatureFP14Z2SoundStarter, - (void*)framework__10Z2CreatureFUlSc, - (void*)startCreatureSound__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCreatureSoundLevel__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCreatureVoice__10Z2CreatureF10JAISoundIDSc, - (void*)startCreatureVoiceLevel__10Z2CreatureF10JAISoundIDSc, - (void*)startCreatureExtraSound__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCreatureExtraSoundLevel__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCollisionSE__10Z2CreatureFUlUl, - (void*)NULL, - (void*)NULL, - (void*)func_802C5894, - (void*)func_802AABF4, - (void*)func_802C5284, - (void*)__dt__14Z2CreatureRideFv, -}; - -/* 803CB96C-803CB980 028A8C 0014+00 3/3 0/0 0/0 .data __vt__18Z2LinkSoundStarter */ -SECTION_DATA extern void* __vt__18Z2LinkSoundStarter[5] = { - (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__18Z2LinkSoundStarterFv, - (void*)func_802AABF4, (void*)func_802C4928, -}; - -/* 803CB980-803CB9C8 028AA0 0048+00 2/2 0/0 0/0 .data __vt__14Z2CreatureLink */ -SECTION_DATA extern void* __vt__14Z2CreatureLink[18] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)deleteObject__14Z2CreatureLinkFv, - (void*)setSoundStarter__10Z2CreatureFP14Z2SoundStarter, - (void*)framework__14Z2CreatureLinkFUlSc, - (void*)startCreatureSound__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCreatureSoundLevel__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCreatureVoice__10Z2CreatureF10JAISoundIDSc, - (void*)startCreatureVoiceLevel__10Z2CreatureF10JAISoundIDSc, - (void*)startCreatureExtraSound__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCreatureExtraSoundLevel__10Z2CreatureF10JAISoundIDUlSc, - (void*)startCollisionSE__14Z2CreatureLinkFUlUl, - (void*)NULL, - (void*)NULL, - (void*)func_802C588C, - (void*)func_802AABF4, - (void*)func_802C4928, - (void*)__dt__14Z2CreatureLinkFv, -}; - /* 80451360-80451368 000860 0004+04 3/3 15/15 0/0 .sbss mLinkPtr__14Z2CreatureLink */ Z2CreatureLink* Z2CreatureLink::mLinkPtr; @@ -282,13 +95,11 @@ Z2CreatureLink::Z2CreatureLink() { } /* 802C3464-802C3500 2BDDA4 009C+00 1/0 0/0 0/0 .text __dt__18Z2LinkSoundStarterFv */ -inline Z2LinkSoundStarter::~Z2LinkSoundStarter() { - // NONMATCHING -} +inline Z2LinkSoundStarter::~Z2LinkSoundStarter() {} /* 802C3500-802C35F8 2BDE40 00F8+00 2/1 1/1 0/0 .text __dt__14Z2CreatureLinkFv */ Z2CreatureLink::~Z2CreatureLink() { - // NONMATCHING + deleteObject(); } /* 802C35F8-802C3638 2BDF38 0040+00 1/0 0/0 0/0 .text deleteObject__14Z2CreatureLinkFv */ @@ -302,6 +113,8 @@ void Z2CreatureLink::deleteObject() { /* 802C3638-802C3710 2BDF78 00D8+00 0/0 1/1 0/0 .text init__14Z2CreatureLinkFP3VecP3VecP3Vec */ void Z2CreatureLink::init(Vec* param_0, Vec* param_1, Vec* param_2) { + OS_REPORT("[Z2CreatureLink::init]"); + Z2Creature::init(param_0, param_1, param_2, 6, 1, 2); Z2GetAudience()->getLinkMic()->setPosPtr(getCurrentPos()); @@ -339,57 +152,55 @@ void Z2CreatureLink::setKanteraState(u8 i_state) { mKanteraState = i_state; } -/* ############################################################################################## */ -/* 80455C98-80455C9C 004298 0004+00 9/9 0/0 0/0 .sdata2 @3721 */ -SECTION_SDATA2 static f32 lit_3721 = 1.0f; - -/* 80455C9C-80455CA0 00429C 0004+00 2/2 0/0 0/0 .sdata2 @3722 */ -SECTION_SDATA2 static f32 lit_3722 = -1.0f; - -/* 80455CA0-80455CA8 0042A0 0004+04 11/11 0/0 0/0 .sdata2 @3723 */ -SECTION_SDATA2 static f32 lit_3723[1 + 1 /* padding */] = { - 0.0f, - /* padding */ - 0.0f, -}; - -/* 80455CA8-80455CB0 0042A8 0008+00 1/1 0/0 0/0 .sdata2 @3724 */ -SECTION_SDATA2 static f64 lit_3724 = 0.5; - -/* 80455CB0-80455CB8 0042B0 0008+00 1/1 0/0 0/0 .sdata2 @3725 */ -SECTION_SDATA2 static f64 lit_3725 = 3.0; - -/* 80455CB8-80455CC0 0042B8 0008+00 1/1 0/0 0/0 .sdata2 @3726 */ -SECTION_SDATA2 static u8 lit_3726[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - /* 802C3780-802C3A64 2BE0C0 02E4+00 1/0 0/0 0/0 .text framework__14Z2CreatureLinkFUlSc */ void Z2CreatureLink::framework(u32 param_0, s8 param_1) { - // NONMATCHING -} - -/* void Z2CreatureLink::framework(u32 param_0, s8 param_1) { Z2Creature::framework(param_0, param_1); if (mKantera.isAlive()) { mKantera.framework(param_0, param_1); } - if (field_0xc1 != -1) { + if (field_0xc1 != 0xFF) { field_0xc1++; } - if (mMagnetized) { + if (mWolfEyeOpen) { Z2GetSeMgr()->seStartLevel(Z2SE_WOLF_SENSE_OPEN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } - if (isInWater() && Z2GetStatusMgr()->getCameraInWaterDepthRatio() > 0.0f) { - if (startLinkSoundLevel() && ) { + if (isInWater()) { + f32 var_f31 = Z2GetStatusMgr()->getCameraInWaterDepthRatio(); + if (var_f31 > 0.0f) { + JAISoundHandle* var_r29 = startLinkSoundLevel(Z2SE_AL_UNDERWATER_BUBBLE, 0, -1); + if (var_r29 != NULL && *var_r29) { + (*var_r29)->getAuxiliary().moveVolume(var_f31, 0); + } + } + } + if (mMagnetized) { + startLinkSoundLevel(Z2SE_AL_MAGNETIZED, 0, -1); + } + + mMoveSpeed = 0; + + if (getCurrentPos() != NULL) { + field_0xb4.y = getCurrentPos()->y; + mMoveSpeed = sqrtf(VECSquareDistance(getCurrentPos(), &field_0xb4)); + field_0xb4.x = getCurrentPos()->x; + field_0xb4.z = getCurrentPos()->z; + } + + if (Z2GetStatusMgr()->getDemoStatus() == 10) { + mMovingTime = 180; + } else if (mMoveSpeed < 5) { + if (mMovingTime < 180) { + mMovingTime++; } + } else if (mMovingTime != 0) { + mMovingTime--; } -} */ +} /* 802C3A64-802C3A6C -00001 0008+00 0/0 0/0 0/0 .text setSinkDepth__14Z2CreatureLinkFSc */ @@ -403,7 +214,7 @@ void Z2CreatureLink::setRiding(bool i_isRiding) { if (i_isRiding) { Z2GetAudience()->setTargetVolume(0.35f, 0); } else { - Z2GetAudience()->setTargetVolume(FLOAT_LABEL(lit_3723), 0); + Z2GetAudience()->setTargetVolume(0.0f, 0); } mRiding = i_isRiding; @@ -432,77 +243,114 @@ void Z2CreatureLink::setWolfEyeOpen(bool i_wolfEyeOpen) { } } - -/* ############################################################################################## */ -/* 80455CC4-80455CC8 0042C4 0004+00 1/1 0/0 0/0 .sdata2 @3834 */ -SECTION_SDATA2 static f32 lit_3834 = 32.0f; - -/* 80455CC8-80455CCC 0042C8 0004+00 4/4 0/0 0/0 .sdata2 @3835 */ -SECTION_SDATA2 static f32 lit_3835 = 127.0f; - -/* 80455CCC-80455CD0 0042CC 0004+00 2/2 0/0 0/0 .sdata2 @3836 */ -SECTION_SDATA2 static f32 lit_3836 = 2.0f / 5.0f; - -/* 80455CD0-80455CD4 0042D0 0004+00 4/4 0/0 0/0 .sdata2 @3837 */ -SECTION_SDATA2 static f32 lit_3837 = 7.0f / 10.0f; - -/* 80455CD4-80455CD8 0042D4 0004+00 3/3 0/0 0/0 .sdata2 @3838 */ -SECTION_SDATA2 static f32 lit_3838 = 23.0f; - -/* 80455CD8-80455CE0 0042D8 0004+04 4/4 0/0 0/0 .sdata2 @3839 */ -SECTION_SDATA2 static f32 lit_3839[1 + 1 /* padding */] = { - 0.5f, - /* padding */ - 0.0f, -}; - -/* 80455CE0-80455CE8 0042E0 0008+00 3/3 0/0 0/0 .sdata2 @3842 */ -SECTION_SDATA2 static f64 lit_3842 = 4503601774854144.0 /* cast s32 to float */; - /* 802C3BD4-802C3E68 2BE514 0294+00 3/3 3/3 0/0 .text * startLinkSound__14Z2CreatureLinkF10JAISoundIDUlSc */ -void Z2CreatureLink::startLinkSound(JAISoundID param_0, u32 param_1, s8 param_2) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80455CE8-80455CEC 0042E8 0004+00 1/1 0/0 0/0 .sdata2 @3941 */ -SECTION_SDATA2 static f32 lit_3941 = 30.0f; - -/* 80455CEC-80455CF0 0042EC 0004+00 3/3 0/0 0/0 .sdata2 @3942 */ -SECTION_SDATA2 static f32 lit_3942 = 3.0f / 10.0f; - -/* 80455CF0-80455CF4 0042F0 0004+00 4/4 0/0 0/0 .sdata2 @3943 */ -SECTION_SDATA2 static f32 lit_3943 = 4.0f / 5.0f; - -/* 80455CF4-80455CF8 0042F4 0004+00 1/1 0/0 0/0 .sdata2 @3944 */ -SECTION_SDATA2 static f32 lit_3944 = 180.0f; - -/* 80455CF8-80455CFC 0042F8 0004+00 1/1 0/0 0/0 .sdata2 @3945 */ -SECTION_SDATA2 static f32 lit_3945 = 120.0f; - -/* 80455CFC-80455D00 0042FC 0004+00 4/4 0/0 0/0 .sdata2 @3946 */ -SECTION_SDATA2 static f32 lit_3946 = 3.0f / 5.0f; - -/* 80455D00-80455D04 004300 0004+00 1/1 0/0 0/0 .sdata2 @3947 */ -SECTION_SDATA2 static f32 lit_3947 = 80.0f; +// stopSound seems to store to the stack twice +Z2SoundHandlePool* Z2CreatureLink::startLinkSound(JAISoundID i_soundID, u32 param_1, s8 param_2) { + Z2SoundHandlePool* var_r30 = startCreatureSound(i_soundID, param_1, param_2); + + switch (i_soundID) { + case Z2SE_AL_DAMAGE_NORMAL: + case Z2SE_AL_DAMAGE_LARGE: + case Z2SE_AL_FREEZE: + Z2GetSeqMgr()->onEnemyDamage(); + break; + case Z2SE_LK_HS_SHOOT: + mSoundObjAnime.stopSound(Z2SE_AL_HS_OPEN, 0); + break; + case Z2SE_AL_SINK_SAND_OUT: + if (var_r30 != NULL && *var_r30) { + f32 var_f31 = Z2Calc::linearTransform(mSinkDepth, 32.0f, 127.0f, 0.4f, 1.0f, false); + f32 var_f30 = Z2Calc::linearTransform(mSinkDepth, 32.0f, 127.0f, 1.0f, 0.7f, false); + + (*var_r30)->getAuxiliary().moveVolume(var_f31, 0); + (*var_r30)->getAuxiliary().movePitch(var_f30, 0); + } + break; + case Z2SE_AL_SINK_SNOW_OUT: + if (var_r30 != NULL && *var_r30) { + f32 var_f29 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 0.5f, 1.0f, false); + f32 var_f28 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 1.0f, 0.7f, false); + + (*var_r30)->getAuxiliary().moveVolume(var_f29, 0); + (*var_r30)->getAuxiliary().movePitch(var_f28, 0); + } + break; + } -/* 80455D04-80455D08 004304 0004+00 1/1 0/0 0/0 .sdata2 @3948 */ -SECTION_SDATA2 static f32 lit_3948 = 6.0f / 5.0f; + return var_r30; +} -/* 80455D08-80455D0C 004308 0004+00 2/2 0/0 0/0 .sdata2 @3949 */ -SECTION_SDATA2 static f32 lit_3949 = 0.25f; +/* 802C3E68-802C4320 2BE7A8 04B8+00 1/1 3/3 0/0 .text + * startLinkSoundLevel__14Z2CreatureLinkF10JAISoundIDUlSc */ +// NONMATCHING - small issue with i_soundID in startCreatureSoundLevel call +JAISoundHandle* Z2CreatureLink::startLinkSoundLevel(JAISoundID i_soundID, u32 param_1, s8 param_2) { + if (i_soundID == Z2SE_AL_LIGHTNING_SW_GLOW && (Z2GetStatusMgr()->getDemoStatus() == 2 || !Z2GetSceneMgr()->isInGame())) { + return NULL; + } -/* 80455D0C-80455D10 00430C 0004+00 1/1 0/0 0/0 .sdata2 @3950 */ -SECTION_SDATA2 static f32 lit_3950 = 11.0f / 10.0f; + Z2SoundHandlePool* temp_r3 = startCreatureSoundLevel(i_soundID, param_1, param_2); + if (temp_r3 != NULL && *temp_r3) { + f32 var_f31 = 1.0f; + f32 var_f30 = 1.0f; + int var_r30 = 0; + + switch (i_soundID) { + case Z2SE_AL_SINK_SAND_LEVEL: + if (mSinkDepth > 0) { + var_f31 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 127.0f, 0.4f, 1.0f, true); + var_f30 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 127.0f, 1.0f, 0.7f, true); + } + break; + case Z2SE_AL_SINK_SNOW_LEVEL: + if (mSinkDepth > 0) { + var_f31 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 0.7f, 1.0f, true); + var_f30 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 1.0f, 0.7f, true); + } + break; + case Z2SE_AL_SPINNER_RIDE: + var_f30 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 30.0f, 0.3f, 0.8f, 1.0f, Z2Calc::CURVE_SIGN_0); + + if (mMoveSpeed == 0 && mMovingTime > 120) { + var_f31 = Z2Calc::getParamByExp(mMovingTime, 180.0f, 120.0f, 0.6f, 0.0f, 0.4f, Z2Calc::CURVE_SIGN_0); + } else { + var_f31 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 30.0f, 0.6f, 0.4f, 1.0f, Z2Calc::CURVE_SIGN_0); + } + break; + case Z2SE_AL_SPINNER_RAIL: + var_f30 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.3f, 0.8f, 1.2f, Z2Calc::CURVE_SIGN_0); + break; + case Z2SE_AL_SNOBO_RIDE: + case Z2SE_AL_SNOBO_BREAK: + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[266]) && Z2GetSeqMgr()->getSubBgmID() != Z2BGM_SNOW_BOARD) { + var_f31 = 0.0f; + var_r30 = 0; + } else if (mMoveSpeed == 0) { + var_f31 = 0.0f; + var_r30 = 10; + } else { + var_f31 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.25f, 0.4f, 1.0f, Z2Calc::CURVE_SIGN_0); + } + + var_f30 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.3f, 0.5f, 1.1f, Z2Calc::CURVE_SIGN_0); + break; + case Z2SE_AL_LIGHTNING_SW_GLOW: + f32 temp_f1_2 = (*temp_r3)->getAuxiliary().mTransition.mVolume.mDest; + if (Z2GetStatusMgr()->getDemoStatus() == 2 && temp_f1_2 != 0.3f) { + var_f31 = 0.3f; + var_r30 = 45; + } else if (temp_f1_2 != 1.0f) { + var_f31 = 1.0f; + var_r30 = 45; + } + break; + } -/* 80455D10-80455D18 004310 0008+00 2/2 0/0 0/0 .sdata2 @3954 */ -SECTION_SDATA2 static f64 lit_3954 = 4503599627370496.0 /* cast u32 to float */; + (*temp_r3)->getAuxiliary().moveVolume(var_f31, var_r30); + (*temp_r3)->getAuxiliary().movePitch(var_f30, 0); + } -/* 802C3E68-802C4320 2BE7A8 04B8+00 1/1 3/3 0/0 .text - * startLinkSoundLevel__14Z2CreatureLinkF10JAISoundIDUlSc */ -void Z2CreatureLink::startLinkSoundLevel(JAISoundID param_0, u32 param_1, s8 param_2) { - // NONMATCHING + return temp_r3; } /* 802C4320-802C45B0 2BEC60 0290+00 1/1 1/1 0/0 .text @@ -684,4 +532,4 @@ void Z2SoundObjCoach::startFireSound(u16 param_0) { * startSound__15Z2SoundObjCoachF10JAISoundIDUlSc */ int Z2SoundObjCoach::startSound(JAISoundID param_0, u32 param_1, s8 param_2) { // NONMATCHING -} \ No newline at end of file +} diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 4823cd6053f..35351699f14 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -50,6 +50,14 @@ #include "d/actor/d_a_tag_mwait.h" #include "d/actor/d_a_canoe.h" +/* 80450FB8-80450FBC -00001 0004+00 0/0 1/1 0/0 .sbss None */ +extern u8 struct_80450FB8[4]; +u8 struct_80450FB8[4]; + +/* 80450FBC-80450FC0 -00001 0004+00 0/0 1/1 0/0 .sbss None */ +extern u8 struct_80450FBC[4]; +u8 struct_80450FBC[4]; + static fopAc_ac_c* daAlink_searchTagKandelaar(fopAc_ac_c* i_actor, void* i_data); /* 8009D87C-8009D884 0981BC 0008+00 0/0 1/1 0/0 .text getE3Zhint__9daAlink_cFv */ diff --git a/src/d/d_error_msg.cpp b/src/d/d_error_msg.cpp index b6bb7c91f24..06c13abf61f 100644 --- a/src/d/d_error_msg.cpp +++ b/src/d/d_error_msg.cpp @@ -1,157 +1,265 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_error_msg -// +/** + * d_error_msg.cpp + * Disk Error Message screen handler + */ +#include #include "d/d_error_msg.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" static void messageSet__FUlb(); -extern "C" void draw__14dDvdErrorMsg_cFl(); -extern "C" void execute__14dDvdErrorMsg_cFv(); -extern "C" static void drawCapture__FUc(); -extern "C" void execute__19dShutdownErrorMsg_cFv(); -extern "C" extern char const* const d_d_error_msg__stringBase0; - -// -// External References: -// - -// extern "C" void OSReport_Error(); -extern "C" void mDoAud_resetRecover__Fv(); -extern "C" void beginRender__13mDoGph_gInf_cFv(); -extern "C" void mDoGph_drawFilterQuad__FScSc(); -extern "C" void mDoRst_reset__FiUli(); -extern "C" void cLib_chaseUC__FPUcUcUc(); -extern "C" void resetProcess__10Z2AudioMgrFUlb(); -extern "C" void __ct__10JUTResFontFPC7ResFONTP7JKRHeap(); -extern "C" void __dt__10JUTResFontFv(); -extern "C" void __ct__13J2DOrthoGraphFffffff(); -extern "C" void setPort__13J2DOrthoGraphFv(); -extern "C" void func_802E980C(); -extern "C" void func_802FC800(); -extern "C" void __dt__10J2DPictureFv(); -extern "C" void draw__10J2DPictureFffffbbb(); -extern "C" void func_802FFBC4(); -extern "C" void initiate__10J2DTextBoxFPC7ResFONTPCcs18J2DTextBoxHBinding18J2DTextBoxVBinding(); -extern "C" void __dt__10J2DTextBoxFv(); -extern "C" void draw__10J2DTextBoxFfff18J2DTextBoxHBinding(); -extern "C" void drawInit__6J3DSysFv(); -extern "C" void GXClearVtxDesc(); -extern "C" void _savegpr_27(); -extern "C" void _restgpr_27(); -extern "C" extern void* __vt__14J2DGrafContext[10]; -extern "C" extern void* __vt__13J2DOrthoGraph[10]; -extern "C" u8 mFrameBufferTexObj__13mDoGph_gInf_c[32]; -extern "C" extern u8 data_80450688[8]; -extern "C" extern u8 mInitFlag__17mDoAud_zelAudio_c[4]; -extern "C" u8 mFrameBufferTimg__13mDoGph_gInf_c[4]; -extern "C" u8 mFrameBufferTex__13mDoGph_gInf_c[4]; -extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */]; -extern "C" extern u8 struct_80450FB0[8]; -extern "C" u8 sManager__10JFWDisplay[4]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -// -// Declarations: -// - -/* 8037B140-8037B180 0077A0 0040+00 1/1 0/0 0/0 .rodata black_tex */ -#include "assets/black_tex.h" +#include "JSystem/J2DGraph/J2DTextBox.h" +#include "JSystem/J2DGraph/J2DPicture.h" +#include "JSystem/J2DGraph/J2DOrthoGraph.h" +#include "JSystem/JUtility/JUTResFont.h" +#include "m_Do/m_Do_graphic.h" +#include "JSystem/JUtility/JUTTexture.h" +#include "m_Do/m_Do_Reset.h" -/* 8037B180-8037B3E0 0077E0 0260+00 1/1 0/0 0/0 .rodata msg_data */ +#include "assets/black_tex.h" #include "assets/msg_data.h" - -/* 8037B3E0-8038D640 -00001 12260+00 1/1 0/0 0/0 .rodata font_data */ #include "assets/font_data.h" -/* 80452C18-80452C1C 001218 0004+00 3/3 0/0 0/0 .sdata2 @3758 */ -SECTION_SDATA2 static u8 lit_3758[4] = { - 0x00, - 0x00, - 0x00, - 0x00, +#define MSG_READING_DISC 0 +#define MSG_COVER_OPEN 1 +#define MSG_NO_DISK 2 +#define MSG_WRONG_DISK 3 +#define MSG_READ_ERROR 4 +#define MSG_FATAL_ERROR 5 + +// made up +struct BMG_INF1 : JUTDataBlockHeader { + /* 0x08 */ u8 m08[0x10 - 0x08]; + /* 0x10 */ u32 entries[6]; }; -/* 80452C1C-80452C20 00121C 0004+00 2/2 0/0 0/0 .sdata2 @3759 */ -SECTION_SDATA2 static f32 lit_3759 = 608.0f; +/* 8009CB88-8009D194 0974C8 060C+00 1/1 0/0 0/0 .text messageSet__FUlb */ +static void messageSet(u32 status, bool i_drawBg) { + BMG_INF1* inf1 = (BMG_INF1*)&msg_data[0x20]; + const char* msg_p = (const char*)((u8*)inf1->getNext() + sizeof(JUTDataBlockHeader) + inf1->entries[status]); -/* 80452C20-80452C24 001220 0004+00 1/1 0/0 0/0 .sdata2 @3760 */ -SECTION_SDATA2 static f32 lit_3760 = 200.0f; + JUT_ASSERT(std::strlen(msg_p)-1 < 512); -/* 80452C24-80452C28 001224 0004+00 2/2 0/0 0/0 .sdata2 @3761 */ -SECTION_SDATA2 static f32 lit_3761 = 448.0f; + J2DTextBox tpane('TEXT1', JGeometry::TBox2(0.0f, 0.0f, 608.0f, 200.0f), (ResFONT*)font_data, msg_p, 512, HBIND_CENTER, VBIND_CENTER); + J2DTextBox spane('TEXT2', JGeometry::TBox2(0.0f, 0.0f, 608.0f, 200.0f), (ResFONT*)font_data, msg_p, 512, HBIND_CENTER, VBIND_CENTER); + J2DPicture ppane('PICT1', JGeometry::TBox2(0.0f, 0.0f, 608.0f, 448.0f), (ResTIMG*)black_tex, NULL); -/* 80452C28-80452C2C 001228 0004+00 1/1 0/0 0/0 .sdata2 @3762 */ -SECTION_SDATA2 static f32 lit_3762 = 23.0f; + JUTResFont font((ResFONT*)font_data, NULL); + JUTFont* pfont = (JUTFont*)&font; -/* 80452C2C-80452C30 00122C 0004+00 1/1 0/0 0/0 .sdata2 @3763 */ -SECTION_SDATA2 static f32 lit_3763 = 22.0f; + JUtility::TColor tcharcolor(0xC8, 0xC8, 0xC8, 0xFF); + JUtility::TColor scharcolor(0xFF, 0xFF, 0xFF, 0xFF); + JUtility::TColor tgradcolor(0xFF, 0xFF, 0xFF, 0xFF); + JUtility::TColor sgradcolor(0xFF, 0xFF, 0xAD, 0xFF); + JUtility::TColor twhite(0xC8, 0xC8, 0xC8, 0xFF); + JUtility::TColor swhite(0x00, 0x00, 0x00, 0xFF); + JUtility::TColor tblack(0x00, 0x00, 0x00, 0x00); + JUtility::TColor sblack(0x00, 0x00, 0x00, 0x00); -/* 80452C30-80452C34 001230 0004+00 3/3 0/0 0/0 .sdata2 @3764 */ -SECTION_SDATA2 static f32 lit_3764 = 1.0f; + J2DTextBox::TFontSize size; + size.mSizeX = 23.0f; + size.mSizeY = 22.0f; -/* 80452C34-80452C38 001234 0004+00 1/1 0/0 0/0 .sdata2 @3765 */ -SECTION_SDATA2 static f32 lit_3765 = 0.5f; + tpane.setFontSize(size); + tpane.setCharSpace(1.0f); + tpane.setLineSpace(23.0f); + tpane.setCharColor(tcharcolor); + tpane.setGradColor(tgradcolor); + tpane.setBlackWhite(tblack, twhite); + + spane.setFontSize(size); + spane.setCharSpace(1.0f); + spane.setLineSpace(23.0f); + spane.setCharColor(scharcolor); + spane.setGradColor(sgradcolor); + spane.setBlackWhite(sblack, swhite); -/* 80452C38-80452C3C 001238 0004+00 1/1 0/0 0/0 .sdata2 @3766 */ -SECTION_SDATA2 static f32 lit_3766 = 2.0f; + const int lineMax = 10; -/* 80452C3C-80452C40 00123C 0004+00 2/2 0/0 0/0 .sdata2 @3767 */ -SECTION_SDATA2 static f32 lit_3767 = 10.0f; + f32 height = 23.0f; + f32 maxWidth = 0.0f; + int cnt = 0; + f32 lineWidth[lineMax]; + for (int i = 0; i < lineMax; i++) { + lineWidth[i] = 0.0f; + } -/* 80452C40-80452C48 001240 0008+00 1/1 0/0 0/0 .sdata2 @3769 */ -SECTION_SDATA2 static f64 lit_3769 = 4503601774854144.0 /* cast s32 to float */; + for (; *msg_p != '\0'; msg_p++) { + if (*msg_p == '\n') { + height += 23.0f; + cnt++; + JUT_ASSERT(cnt < lineMax); + continue; + } -/* 8009CB88-8009D194 0974C8 060C+00 1/1 0/0 0/0 .text messageSet__FUlb */ -static void messageSet(u32 param_0, bool param_1) { - // NONMATCHING -} + int c = (u8)*msg_p; + if (pfont->isLeadByte_EUC(c)) { + msg_p++; + c = (c << 8) | (u8)*msg_p; + } -/* ############################################################################################## */ -/* 80452C48-80452C50 001248 0004+04 1/1 0/0 0/0 .sdata2 @3835 */ -SECTION_SDATA2 static f32 lit_3835[1 + 1 /* padding */] = { - -1.0f, - /* padding */ - 0.0f, -}; + lineWidth[cnt] += 1.0f + size.mSizeX * ((f32)pfont->getWidth(c) / (f32)pfont->getCellWidth()); + } -/* 8009D194-8009D354 097AD4 01C0+00 1/1 0/0 0/0 .text draw__14dDvdErrorMsg_cFl */ -void dDvdErrorMsg_c::draw(s32 param_0) { - // NONMATCHING + for (int i = 0; i < lineMax; i++) { + f32 width = lineWidth[i]; + if (maxWidth < width) + maxWidth = width; + } + + f32 temp_0 = 0.0f; // fixes load order + f32 x = temp_0 + ((608.0f - maxWidth) / 2); + f32 y = temp_0 + ((448.0f - height) / 2); + + if (i_drawBg) { + ppane.mAlpha = 0x82; + ppane.draw(0.0f, 0.0f, 608.0f, 448.0f, false, false, false); + } + + spane.draw(x + 2.0f, y + 10.0f + 2.0f, 608.0f, HBIND_LEFT); + tpane.draw(x, y + 10.0f, 608.0f, HBIND_LEFT); } -/* ############################################################################################## */ -/* 8038D640-8038D640 019CA0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8038D640 = "DVD Error !! <%d>\n"; -/* @stringBase0 padding */ -SECTION_DEAD static char const* const pad_8038D653 = "\0\0\0\0"; -#pragma pop +/* 8009D194-8009D354 097AD4 01C0+00 1/1 0/0 0/0 .text draw__14dDvdErrorMsg_cFl */ +void dDvdErrorMsg_c::draw(s32 status) { + JUtility::TColor backColor = g_clearColor; + JFWDisplay::getManager()->setClearColor(backColor); + mDoGph_gInf_c::beginRender(); + GXSetAlphaUpdate(GX_FALSE); + j3dSys.drawInit(); + + J2DOrthoGraph draw2D(0.0f, 0.0f, 608.0f, 448.0f, -1.0f, 1.0f); + draw2D.setOrtho(0.0f, 0.0f, 608.0f, 448.0f, -1.0f, 1.0f); + draw2D.setPort(); + dComIfGp_setCurrentGrafPort(&draw2D); + + if (status == DVD_STATE_NO_DISK) { + messageSet(MSG_NO_DISK, true); + } else if (status == DVD_STATE_COVER_OPEN) { + messageSet(MSG_COVER_OPEN, true); + } else if (status == DVD_STATE_FATAL_ERROR) { + messageSet(MSG_FATAL_ERROR, true); + } else if (status == DVD_STATE_WRONG_DISK) { + messageSet(MSG_WRONG_DISK, true); + } else if (status == DVD_STATE_RETRY) { + messageSet(MSG_READ_ERROR, true); + } else if (status == DVD_STATE_BUSY) { + messageSet(MSG_READING_DISC, true); + } + + mDoGph_gInf_c::endRender(); + JFWDisplay::getManager()->resetFader(); +} /* 8009D354-8009D410 097C94 00BC+00 0/0 1/1 0/0 .text execute__14dDvdErrorMsg_cFv */ u8 dDvdErrorMsg_c::execute() { - // NONMATCHING + static u8 l_dvdError; + + s32 drive_status = DVDGetDriveStatus(); + if (drive_status != DVD_STATE_END && drive_status != DVD_STATE_BUSY && !l_dvdError) { + l_dvdError = true; + } + + if (l_dvdError) { + OSReport_Error("DVD Error !! <%d>\n", drive_status); + + if (drive_status == DVD_STATE_END) { + l_dvdError = false; + } else if (mDoRst::isReset() && + (drive_status == DVD_STATE_NO_DISK || drive_status == DVD_STATE_COVER_OPEN || drive_status == DVD_STATE_WRONG_DISK || drive_status == DVD_STATE_RETRY)) + { + mDoRst::onReturnToMenu(); + } else { + draw(drive_status); + } + } + + return l_dvdError; } -/* ############################################################################################## */ -/* 80456B78-80456B80 000018 0004+04 1/1 0/0 0/0 .sbss2 @3873 */ -SECTION_SBSS2 static u8 lit_3873[4 + 4 /* padding */]; +static u8 l_captureAlpha = 0xFF; /* 8009D410-8009D790 097D50 0380+00 1/1 0/0 0/0 .text drawCapture__FUc */ -static void drawCapture(u8 param_0) { - // NONMATCHING +// NONMATCHING - stack too small +static void drawCapture(u8 alpha) { + static bool l_texCopied = false; + + if (!l_texCopied) { + GXSetTexCopySrc(0, 0, 608, 448); + GXSetTexCopyDst(304, 224, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_TRUE); + GXCopyTex(mDoGph_gInf_c::getFrameBufferTex(), GX_FALSE); + l_texCopied = true; + } + + JFWDisplay::getManager()->setClearColor(g_clearColor); + mDoGph_gInf_c::beginRender(); + GXSetAlphaUpdate(GX_FALSE); + j3dSys.drawInit(); + + GXInitTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), mDoGph_gInf_c::getFrameBufferTex(), 304, 224, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObjLOD(mDoGph_gInf_c::getFrameBufferTexObj(), GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1); + GXLoadTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), GX_TEXMAP0); + GXSetNumChans(0); + GXSetNumIndStages(0); + GXSetNumTexGens(1); + GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, GX_PTIDENTITY); + GXSetNumTevStages(1); + + GXColor color = {0, 0, 0, alpha}; + GXSetTevColor(GX_TEVREG0, color); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_A0, GX_CC_ZERO); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetZCompLoc(GX_TRUE); + GXSetZMode(GX_DISABLE, GX_ALWAYS, GX_DISABLE); + GXSetBlendMode(GX_BM_NONE, GX_BL_SRC_ALPHA, GX_BL_ONE, GX_LO_CLEAR); + GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0); + GXSetFog(GX_FOG_NONE, 0.0f, 0.0f, 0.0f, 0.0f, g_clearColor); + GXSetFogRangeAdj(GX_DISABLE, 0, NULL); + GXSetCullMode(GX_CULL_NONE); + GXSetDither(GX_ENABLE); + + Mtx m; + C_MTXOrtho(m, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f); + GXLoadPosMtxImm(g_mDoMtx_identity, GX_PNMTX0); + GXSetProjection(m, GX_ORTHOGRAPHIC); + GXSetCurrentMtx(0); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_DIRECT); + GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_RGB8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGB8, 0); + + mDoGph_drawFilterQuad(1, 1); + mDoGph_gInf_c::endRender(); + JFWDisplay::getManager()->resetFader(); } /* 8009D790-8009D87C 0980D0 00EC+00 0/0 1/1 0/0 .text execute__19dShutdownErrorMsg_cFv */ bool dShutdownErrorMsg_c::execute() { - // NONMATCHING -} + if (!mDoRst::isShutdown() && !mDoRst::isReturnToMenu()) { + return false; + } + + if (l_captureAlpha == 0xFF) { + if (Z2AudioMgr::getInterface()->isResetting() && !mDoAud_resetRecover()) { + drawCapture(l_captureAlpha); + return true; + } -/* 8038D640-8038D640 019CA0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ + if (mDoAud_zelAudio_c::isInitFlag()) { + Z2AudioMgr::getInterface()->resetProcess(0x10, true); + } + } + + drawCapture(l_captureAlpha); + + if (cLib_chaseUC(&l_captureAlpha, 0, 15) != 0) { + if (mDoRst::isReturnToMenu()) { + mDoRst_reset(1, 0x80000000, 0); + } else { + mDoRst_reset(1, 1, 1); + } + } + + return true; +} diff --git a/src/d/d_eye_hl.cpp b/src/d/d_eye_hl.cpp index 29a364c41a3..4d5cec696e0 100644 --- a/src/d/d_eye_hl.cpp +++ b/src/d/d_eye_hl.cpp @@ -90,27 +90,3 @@ void dEyeHL_mng_c::remove(dEyeHL_c* i_obj) { i_obj->m_next = NULL; } } - -/* ############################################################################################## */ -/* 80450FB0-80450FB8 -00001 0008+00 0/0 2/2 0/0 .sbss None */ -/* 80450FB0 0001+00 data_80450FB0 None */ -/* 80450FB1 0001+00 data_80450FB1 None */ -/* 80450FB2 0006+00 data_80450FB2 None */ -extern u8 struct_80450FB0[8]; -u8 struct_80450FB0[8] ALIGN_DECL(8); - -/* 80450FB8-80450FBC -00001 0004+00 0/0 1/1 0/0 .sbss None */ -/* 80450FB8 0001+00 data_80450FB8 None */ -/* 80450FB9 0001+00 data_80450FB9 None */ -/* 80450FBA 0001+00 data_80450FBA None */ -/* 80450FBB 0001+00 data_80450FBB None */ -extern u8 struct_80450FB8[4]; -u8 struct_80450FB8[4]; - -/* 80450FBC-80450FC0 -00001 0004+00 0/0 1/1 0/0 .sbss None */ -/* 80450FBC 0001+00 data_80450FBC None */ -/* 80450FBD 0003+00 data_80450FBD None */ -extern u8 struct_80450FBC[4]; -u8 struct_80450FBC[4]; - -/* 8037B100-8037B100 007760 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/d_file_sel_warning.cpp b/src/d/d_file_sel_warning.cpp index 716908c5552..ed5559c4ac4 100644 --- a/src/d/d_file_sel_warning.cpp +++ b/src/d/d_file_sel_warning.cpp @@ -247,12 +247,12 @@ void dFile_warning_c::setFontColor(JUtility::TColor param_0, JUtility::TColor pa /* 8019230C-80192354 18CC4C 0048+00 0/0 1/0 0/0 .text * setBlackWhite__10J2DTextBoxFQ28JUtility6TColorQ28JUtility6TColor */ -bool J2DTextBox::setBlackWhite(JUtility::TColor param_0, JUtility::TColor param_1) { +/* bool J2DTextBox::setBlackWhite(JUtility::TColor param_0, JUtility::TColor param_1) { // NONMATCHING -} +} */ /* 80192354-8019238C 18CC94 0038+00 1/0 0/0 0/0 .text draw__16dDlst_FileWarn_cFv */ void dDlst_FileWarn_c::draw() { J2DGrafContext* graf_ctx = dComIfGp_getCurrentGrafPort(); Scr->draw(0.0f, 0.0f, graf_ctx); -} \ No newline at end of file +}