diff --git a/config/GZ2E01/splits.txt b/config/GZ2E01/splits.txt index b9d94938551..1a68d1c3859 100644 --- a/config/GZ2E01/splits.txt +++ b/config/GZ2E01/splits.txt @@ -1008,7 +1008,7 @@ d/d_menu_collect.cpp: d/d_menu_dmap.cpp: .text start:0x801B7F20 end:0x801C084C .ctors start:0x8037385C end:0x80373860 - .rodata start:0x80395518 end:0x80395860 + .rodata start:0x80395518 end:0x8039584B .data start:0x803BC7E0 end:0x803BCB60 .sbss start:0x80451078 end:0x80451088 .sdata2 start:0x80453FE8 end:0x80454060 @@ -2013,7 +2013,7 @@ JSystem/JAudio2/JASAiCtrl.cpp: JSystem/JAudio2/JASAudioThread.cpp: .text start:0x8029CCDC end:0x8029D0B4 - .rodata start:0x8039B338 end:0x8039B360 + .rodata start:0x8039B338 end:0x8039B34C .data start:0x803C78E0 end:0x803C78F0 .bss start:0x80431C68 end:0x80431C78 .sbss start:0x804512D8 end:0x804512E0 diff --git a/configure.py b/configure.py index 40a047d052d..84de55f80f8 100755 --- a/configure.py +++ b/configure.py @@ -606,7 +606,7 @@ config.libs = [ Object(NonMatching, "d/d_home_button.cpp"), Object(NonMatching, "d/d_cursor_mng.cpp"), Object(MatchingFor(ALL_GCN), "d/d_stage.cpp"), - Object(Equivalent, "d/d_map.cpp"), # weak func order + Object(MatchingFor(ALL_GCN), "d/d_map.cpp"), Object(MatchingFor(ALL_GCN), "d/d_com_inf_game.cpp"), Object(MatchingFor(ALL_GCN), "d/d_com_static.cpp"), Object(MatchingFor(ALL_GCN), "d/d_com_inf_actor.cpp"), @@ -709,7 +709,7 @@ config.libs = [ Object(MatchingFor(ALL_GCN), "d/d_kantera_icon_meter.cpp"), Object(MatchingFor(ALL_GCN), "d/d_menu_calibration.cpp"), Object(NonMatching, "d/d_menu_collect.cpp"), - Object(NonMatching, "d/d_menu_dmap.cpp"), + Object(MatchingFor(ALL_GCN), "d/d_menu_dmap.cpp"), Object(MatchingFor(ALL_GCN), "d/d_menu_dmap_map.cpp"), Object(MatchingFor(ALL_GCN), "d/d_menu_map_common.cpp"), Object(MatchingFor(ALL_GCN), "d/d_menu_fishing.cpp"), @@ -968,7 +968,7 @@ config.libs = [ Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JASLfo.cpp"), Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JASOscillator.cpp"), Object(NonMatching, "JSystem/JAudio2/JASAiCtrl.cpp"), - Object(NonMatching, "JSystem/JAudio2/JASAudioThread.cpp"), + Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JASAudioThread.cpp"), Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JASAudioReseter.cpp"), Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JASDSPChannel.cpp"), Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JASDSPInterface.cpp"), @@ -1944,7 +1944,7 @@ config.libs = [ ActorRel(MatchingFor(ALL_GCN), "d_a_npc_tk"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_tkc"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_tkj2"), - ActorRel(NonMatching, "d_a_npc_tks"), + ActorRel(NonMatching, "d_a_npc_tks"), # weak func order (sinShort) ActorRel(MatchingFor(ALL_GCN), "d_a_npc_toby"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_tr"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_uri"), diff --git a/include/JSystem/J2DGraph/J2DPicture.h b/include/JSystem/J2DGraph/J2DPicture.h index 94165f44df5..c37a8c2d7f6 100644 --- a/include/JSystem/J2DGraph/J2DPicture.h +++ b/include/JSystem/J2DGraph/J2DPicture.h @@ -90,8 +90,8 @@ public: /* 802FF320 */ virtual void prepend(JUTTexture* param_0, f32 param_1) { insert(param_0, 0, param_1); } - /* 801BDD70 */ virtual bool insert(ResTIMG const*, u8, f32) { - // NONMATCHING + /* 801BDD70 */ virtual bool insert(ResTIMG const* param_0, u8 param_1, f32 param_2) { + return insert(param_0, NULL, param_1, param_2); } /* 802FD168 */ virtual bool insert(ResTIMG const*, JUTPalette*, u8, f32); /* 80020368 */ virtual bool insert(char const* param_0, u8 param_1, f32 param_2) { diff --git a/include/JSystem/JStudio/JStudio_JAudio2/control.h b/include/JSystem/JStudio/JStudio_JAudio2/control.h index 7671c6a1c00..8753338deea 100644 --- a/include/JSystem/JStudio/JStudio_JAudio2/control.h +++ b/include/JSystem/JStudio/JStudio_JAudio2/control.h @@ -93,11 +93,7 @@ struct TAdaptor_sound : public JStudio::TAdaptor_sound { void set_bPermit_onExit_notEnd_(bool param_1) { field_0x11c = param_1; } - #ifndef NONMATCHING static TVVOSetValue_ saoVVOSetValue_[6]; - #else - static u8 saoVVOSetValue_[72]; - #endif /* 0x114 */ TCreateObject* pCreateObject_; /* 0x118 */ JAISoundHandle opJAISoundHandle_; diff --git a/include/JSystem/JUtility/JUTAssert.h b/include/JSystem/JUtility/JUTAssert.h index e951fe4f98c..6fa2d62d5d1 100644 --- a/include/JSystem/JUtility/JUTAssert.h +++ b/include/JSystem/JUtility/JUTAssert.h @@ -30,9 +30,12 @@ #define JUT_LOG(LINE, ...) \ JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__) -#define JUT_CONFIRM(LINE, COND) \ +#define JUT_SET_CONFIRM(LINE, COND) \ JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, LINE, COND, #COND) +#define JUT_CONFIRM(LINE, COND) \ + JUT_SET_CONFIRM(LINE, COND) + #else #define JUT_ASSERT(...) (void)0; #define JUT_ASSERT_MSG(...) (void)0; diff --git a/include/d/actor/d_a_obj_mirror_6pole.h b/include/d/actor/d_a_obj_mirror_6pole.h index b02aa94e200..59d106e5824 100644 --- a/include/d/actor/d_a_obj_mirror_6pole.h +++ b/include/d/actor/d_a_obj_mirror_6pole.h @@ -50,18 +50,11 @@ public: dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[354]); } - void setAction(Mode_e i_action) { - mMode = i_action; - mAction = ActionTable[mMode]; + inline void setAction(Mode_e i_action); + inline void callInit(); + inline void callExecute(); - callInit(); - } - - void callInit() { (this->*mAction[0])(); } - - void callExecute() { (this->*mAction[1])(); } - - static actionFunc ActionTable[][2]; + static const actionFunc ActionTable[][2]; private: /* 0x568 */ J3DModel* mpModel; diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 0434be72adc..f6f4d9e20a9 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -32,12 +32,7 @@ class dDlst_base_c { public: dDlst_base_c() {} - // hack, remove later - #ifdef NO_INLINE_DLSTBASE_DRAW - virtual void draw(); - #else virtual void draw() {} - #endif }; class dDlst_snapShot_c : public dDlst_base_c { diff --git a/include/d/d_menu_dmap.h b/include/d/d_menu_dmap.h index d475c0a80e8..7735d9c41c9 100644 --- a/include/d/d_menu_dmap.h +++ b/include/d/d_menu_dmap.h @@ -25,7 +25,6 @@ struct dMenu_DmapMapCtrl_c; class renderingDmap_c : public renderingPlusDoor_c { public: /* 801C0380 */ virtual ~renderingDmap_c() {} - /* 801C051C */ renderingDmap_c() {} /* 801C0C48 */ virtual const GXColor* getColor(int); /* 801C0C10 */ virtual int getLineWidth(int); diff --git a/include/d/d_menu_dmap_map.h b/include/d/d_menu_dmap_map.h index 1147526cd00..6f24eae4f46 100644 --- a/include/d/d_menu_dmap_map.h +++ b/include/d/d_menu_dmap_map.h @@ -204,7 +204,6 @@ public: class dMenu_DmapMapCtrl_c : public dMenu_StageMapCtrl_c { public: - /* 801BD144 */ virtual ~dMenu_DmapMapCtrl_c() {} /* 801C2028 */ virtual bool isEnableZoomMove() const; /* 801C1B14 */ virtual void calcZoomCenter(f32*, f32*); /* 801C2598 */ virtual void getInitWholeMapScale(f32*, f32, f32, f32, f32); diff --git a/include/d/d_msg_flow.h b/include/d/d_msg_flow.h index f971439005e..b071f198dc0 100644 --- a/include/d/d_msg_flow.h +++ b/include/d/d_msg_flow.h @@ -182,7 +182,7 @@ public: u16 getSelectNum() { return query005(NULL, NULL, 0); } int getChoiceNo() { return (s16)mChoiceNo; } void setMsg(u32 msg) { mMsg = msg; } - bool checkEndFlow() { return field_0x26 == 1; } + bool checkEndFlow() { return (u32)field_0x26 == 1; } static queryFunc mQueryList[53]; static eventFunc mEventList[43]; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 318d8bd5ee7..7cffbbd2c9f 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -4,7 +4,6 @@ #include "SSystem/SComponent/c_lib.h" #include "d/d_kankyo.h" #include "d/d_kankyo_data.h" -#include "d/d_map_path_dmap.h" #include "f_op/f_op_actor_mng.h" #include "global.h" @@ -217,7 +216,7 @@ struct stage_tgsc_class { // MPAT struct map_path_class { /* 0x0 */ int num; - /* 0x4 */ dDrawPath_c::room_class* m_entries; + /* 0x4 */ void* m_entries; }; // RTBL diff --git a/src/JSystem/JAudio2/JASDSPInterface.cpp b/src/JSystem/JAudio2/JASDSPInterface.cpp index 927e76f363c..6f454458a76 100644 --- a/src/JSystem/JAudio2/JASDSPInterface.cpp +++ b/src/JSystem/JAudio2/JASDSPInterface.cpp @@ -85,7 +85,7 @@ void JASDsp::invalChannelAll() { } /* 8039B360-8039B3A0 0279C0 0040+00 1/1 0/0 0/0 .rodata DSPADPCM_FILTER__6JASDsp */ -u8 const JASDsp::DSPADPCM_FILTER[64] = { +u8 const ALIGN_DECL(32) JASDsp::DSPADPCM_FILTER[64] = { 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00, 0x10, 0x00, 0xF8, 0x00, 0x0E, 0x00, 0xFA, 0x00, 0x0C, 0x00, 0xFC, 0x00, 0x12, 0x00, 0xF6, 0x00, 0x10, 0x68, 0xF7, 0x38, 0x12, 0xC0, 0xF7, 0x04, 0x14, 0x00, 0xF4, 0x00, 0x08, 0x00, 0xF8, 0x00, @@ -93,7 +93,7 @@ u8 const JASDsp::DSPADPCM_FILTER[64] = { }; /* 8039B3A0-8039B8A0 -00001 0500+00 1/1 0/0 0/0 .rodata DSPRES_FILTER__6JASDsp */ -u32 const JASDsp::DSPRES_FILTER[320] = { +u32 const ALIGN_DECL(32) JASDsp::DSPRES_FILTER[320] = { 0x0C3966AD, 0x0D46FFDF, 0x0B396696, diff --git a/src/JSystem/JAudio2/JAUSectionHeap.cpp b/src/JSystem/JAudio2/JAUSectionHeap.cpp index 3cf6c7f2041..1defae31722 100644 --- a/src/JSystem/JAudio2/JAUSectionHeap.cpp +++ b/src/JSystem/JAudio2/JAUSectionHeap.cpp @@ -317,7 +317,7 @@ JASWaveBank* JAUSection::newWaveBank(u32 bank_no, void const* param_1) { s32 r27 = getHeap_()->getFreeSize(); JASWaveBank* waveBank = JASWSParser::createWaveBank(param_1, getHeap_()); if (waveBank) { - JUT_ASSERT(536, sectionHeap_->getWaveBankTable().getWaveBank( bank_no ) == 0); + JUT_ASSERT(536, sectionHeap_->getWaveBankTable().getWaveBank( bank_no ) == NULL); sectionHeap_->getWaveBankTable().registWaveBank(bank_no, waveBank); data_.registeredWaveBankTables.set(bank_no, true); data_.field_0xa0 += r27 - getHeap_()->getFreeSize(); @@ -355,10 +355,10 @@ JASBank* JAUSection::newBank(void const* param_0, u32 param_1) { JASBank* bank = JASBNKParser::createBank(param_0, getHeap_()); if (bank) { if (buildingBankTable_) { - JUT_ASSERT(660, buildingBankTable_->getBank( bank_no ) == 0); + JUT_ASSERT(660, buildingBankTable_->getBank( bank_no ) == NULL); buildingBankTable_->registBank(bank_no, bank); } else { - JUT_ASSERT(665, JASDefaultBankTable::getInstance() ->getBank( bank_no ) == 0); + JUT_ASSERT(665, JASDefaultBankTable::getInstance() ->getBank( bank_no ) == NULL); JASDefaultBankTable::getInstance()->registBank(bank_no, bank); data_.registeredBankTables.set(bank_no, true); } @@ -380,10 +380,10 @@ JASVoiceBank* JAUSection::newVoiceBank(u32 bank_no, u32 param_1) { JASBank* voiceBank = new JASVoiceBank(); if (voiceBank) { if (buildingBankTable_) { - JUT_ASSERT(696, buildingBankTable_->getBank( bank_no ) == 0); + JUT_ASSERT(696, buildingBankTable_->getBank( bank_no ) == NULL); buildingBankTable_->registBank(bank_no, voiceBank); } else { - JUT_ASSERT(701, JASDefaultBankTable::getInstance() ->getBank( bank_no ) == 0); + JUT_ASSERT(701, JASDefaultBankTable::getInstance() ->getBank( bank_no ) == NULL); JASDefaultBankTable::getInstance()->registBank(bank_no, voiceBank); data_.registeredBankTables.set(bank_no, true); } diff --git a/src/JSystem/JAudio2/JAUSeqCollection.cpp b/src/JSystem/JAudio2/JAUSeqCollection.cpp index 5316545061e..4cc4b1c3d99 100644 --- a/src/JSystem/JAudio2/JAUSeqCollection.cpp +++ b/src/JSystem/JAudio2/JAUSeqCollection.cpp @@ -60,7 +60,7 @@ JAUSeqDataMgr_SeqCollection::JAUSeqDataMgr_SeqCollection() { /* 802A67D0-802A67DC 2A1110 000C+00 1/0 0/0 0/0 .text * setSeqDataUser__27JAUSeqDataMgr_SeqCollectionFP14JAISeqDataUser */ bool JAUSeqDataMgr_SeqCollection::setSeqDataUser(JAISeqDataUser* param_0) { - JUT_ASSERT(60, user_ == 0); + JUT_ASSERT(60, user_ == NULL); user_ = param_0; return true; } diff --git a/src/JSystem/JKernel/JKRSolidHeap.cpp b/src/JSystem/JKernel/JKRSolidHeap.cpp index 07598d13fae..c30ff8c2aca 100644 --- a/src/JSystem/JKernel/JKRSolidHeap.cpp +++ b/src/JSystem/JKernel/JKRSolidHeap.cpp @@ -13,7 +13,7 @@ JKRSolidHeap* JKRSolidHeap::create(u32 size, JKRHeap* heap, bool useErrorHandler heap = getRootHeap(); } - if (size == 0xffffffff) { + if (size == -1) { size = heap->getMaxAllocatableSize(0x10); } diff --git a/src/JSystem/JMessage/processor.cpp b/src/JSystem/JMessage/processor.cpp index c6c9f3cbf6d..5155863aed8 100644 --- a/src/JSystem/JMessage/processor.cpp +++ b/src/JSystem/JMessage/processor.cpp @@ -748,9 +748,10 @@ void JMessage::TRenderingProcessor::do_tag_(u32 uTag, void const* pData, u32 uSi case 0: case 1: case 2: - case 3: + case 3: { JGADGET_WARNMSG1(1047, "system-tag-code ignored : ", uCode & 0xFFFF); break; + } case 6: break; case 7: diff --git a/src/JSystem/JStudio/JStudio/fvb.cpp b/src/JSystem/JStudio/JStudio/fvb.cpp index 3b64a264449..8ac57d6dda2 100644 --- a/src/JSystem/JStudio/JStudio/fvb.cpp +++ b/src/JSystem/JStudio/JStudio/fvb.cpp @@ -17,8 +17,8 @@ TObject::~TObject() { } void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { - JUT_ASSERT(35, pfv_!=0); - JUT_ASSERT(36, pControl!=0); + JUT_ASSERT(35, pfv_!=NULL); + JUT_ASSERT(36, pControl!=NULL); TFunctionValueAttributeSet set = pfv_->getAttributeSet(); const void* pNext = (const void*)rBlock.getNext(); const void* pData = (const void*)rBlock.getContent(); @@ -37,7 +37,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { break; case 0x10: { JGADGET_ASSERTWARN(61, u32Size>=4); - JUT_ASSERT(62, pContent!=0); + JUT_ASSERT(62, pContent!=NULL); TFunctionValueAttribute_refer* pfvaRefer = set.refer_get(); JGADGET_ASSERTWARN(64, pfvaRefer!=NULL); if (pfvaRefer == NULL) { @@ -63,7 +63,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { } break; case 0x11: { JGADGET_ASSERTWARN(93, u32Size>=4); - JUT_ASSERT(94, pContent!=0); + JUT_ASSERT(94, pContent!=NULL); TFunctionValueAttribute_refer* pfvaRefer = set.refer_get(); JGADGET_ASSERTWARN(96, pfvaRefer!=NULL); if (pfvaRefer == NULL) { @@ -88,7 +88,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { } break; case 0x12: { JGADGET_ASSERTWARN(121, u32Size==8); - JUT_ASSERT(122, pContent!=0); + JUT_ASSERT(122, pContent!=NULL); TFunctionValueAttribute_range* pfvaRange = set.range_get(); JGADGET_ASSERTWARN(124, pfvaRange!=NULL); if (pfvaRange == NULL) { @@ -100,7 +100,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { } break; case 0x13: { JGADGET_ASSERTWARN(138, u32Size==4); - JUT_ASSERT(139, pContent!=0); + JUT_ASSERT(139, pContent!=NULL); TFunctionValueAttribute_range* pfvaRange = set.range_get(); JGADGET_ASSERTWARN(141, pfvaRange!=NULL); if (pfvaRange == NULL) { @@ -113,7 +113,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { } break; case 0x14: { JGADGET_ASSERTWARN(156, u32Size==4); - JUT_ASSERT(157, pContent!=0); + JUT_ASSERT(157, pContent!=NULL); TFunctionValueAttribute_range* pfvaRange = set.range_get(); JGADGET_ASSERTWARN(159, pfvaRange!=NULL); if (pfvaRange == NULL) { @@ -126,7 +126,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { } break; case 0x15: { JGADGET_ASSERTWARN(174, u32Size==4); - JUT_ASSERT(175, pContent!=0); + JUT_ASSERT(175, pContent!=NULL); TFunctionValueAttribute_range* pfvaRange = set.range_get(); JGADGET_ASSERTWARN(177, pfvaRange!=NULL); if (pfvaRange == NULL) { @@ -140,7 +140,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { } break; case 0x16: { JGADGET_ASSERTWARN(193, u32Size==4); - JUT_ASSERT(194, pContent!=0); + JUT_ASSERT(194, pContent!=NULL); TFunctionValueAttribute_interpolate* pfvaInterpolate = set.interpolate_get(); JGADGET_ASSERTWARN(197, pfvaInterpolate!=NULL); if (pfvaInterpolate == NULL) { diff --git a/src/JSystem/JStudio/JStudio_JAudio2/object-sound.cpp b/src/JSystem/JStudio/JStudio_JAudio2/object-sound.cpp index 5a5e8d2d1d0..bf2e25ceace 100644 --- a/src/JSystem/JStudio/JStudio_JAudio2/object-sound.cpp +++ b/src/JSystem/JStudio/JStudio_JAudio2/object-sound.cpp @@ -8,6 +8,9 @@ #include "JSystem/JStudio/JStudio_JAudio2/control.h" #include "JSystem/JStudio/JStudio_JStage/control.h" +namespace JStudio_JAudio2 { +namespace { + /* 8028D728-8028D750 288068 0028+00 1/1 0/0 0/0 .text * setValue_VOLUME___Q215JStudio_JAudio226@unnamed@object_sound_cpp@FP8JAISoundf */ static void setValue_VOLUME_(JAISound *param_1, float param_2) { @@ -41,6 +44,9 @@ static void setValue_ECHO_(JAISound *param_1, float param_2) { param_1->getAuxiliary().moveFxMix(param_2, 0); } +}; // namespace +}; // namespace JStudio_JAudio2 + /* 8028D828-8028D8F4 288168 00CC+00 0/0 1/1 0/0 .text * __ct__Q215JStudio_JAudio214TAdaptor_soundFPQ215JStudio_JAudio213TCreateObject */ JStudio_JAudio2::TAdaptor_sound::TAdaptor_sound(JStudio_JAudio2::TCreateObject* param_1) : @@ -139,10 +145,11 @@ void JStudio_JAudio2::TAdaptor_sound::adaptor_do_update(u32 param_1) { field_0x130 = *pVVar2; if (field_0x11d) { switch(field_0x120) { - case 2: + case 2: { JAISoundStarter* soundStarter = pCreateObject_->get_pJAISoundStarter_(); soundStarter->startLevelSound(field_0x124, &opJAISoundHandle_, field_0x12c); break; + } case 1: field_0x120 = 2; break; diff --git a/src/JSystem/JUtility/JUTXfb.cpp b/src/JSystem/JUtility/JUTXfb.cpp index 3859c0b1cc2..b23fdae4847 100644 --- a/src/JSystem/JUtility/JUTXfb.cpp +++ b/src/JSystem/JUtility/JUTXfb.cpp @@ -7,6 +7,7 @@ #include "JSystem/JUtility/JUTXfb.h" #include "JSystem/JKernel/JKRHeap.h" +#include "JSystem/JUtility/JUTAssert.h" #include "dolphin/gx.h" void JUTXfb::clearIndex() { @@ -29,10 +30,10 @@ JUTXfb::JUTXfb(GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber x if (pObj) { initiate(pObj->fbWidth, pObj->xfbHeight, pHeap, xfbNum); } else { - u16 fbWidth = JUTVideo::getManager()->getRenderMode()->fbWidth; + u16 fbWidth = (u32)JUTVideo::getManager()->getRenderMode()->fbWidth; + u16 xfbHeight = (u32)JUTVideo::getManager()->getRenderMode()->xfbHeight; u16 efbHeight = (u32)JUTVideo::getManager()->getRenderMode()->efbHeight; - u16 xfb_height = JUTVideo::getManager()->getRenderMode()->xfbHeight; - f32 scale_factor = GXGetYScaleFactor(efbHeight, xfb_height); + f32 scale_factor = GXGetYScaleFactor(efbHeight, xfbHeight); u16 xfb_lines = GXGetNumXfbLines(efbHeight, scale_factor); initiate(fbWidth, xfb_lines, pHeap, xfbNum); @@ -55,6 +56,7 @@ void JUTXfb::delXfb(int xfbIdx) { } JUTXfb* JUTXfb::createManager(JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) { + JUT_CONFIRM(273, sManager == NULL); if (sManager == NULL) { sManager = new JUTXfb(NULL, pHeap, xfbNum); } @@ -62,24 +64,23 @@ JUTXfb* JUTXfb::createManager(JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) { } void JUTXfb::destroyManager() { + JUT_CONFIRM(344, sManager); delete sManager; sManager = NULL; } void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) { if (pHeap == NULL) { - pHeap = JKRHeap::getSystemHeap(); + pHeap = JKRGetSystemHeap(); } - int size = ((u32)width + 0xf & 0xfff0) * (u32)height * 2; + int size = (u16)((u16)width + 0xf & ~0xf) * height * 2; - void* buf = ::operator new[](size, pHeap, 0x20); - mBuffer[0] = buf; + mBuffer[0] = ::operator new[](size, pHeap, 0x20); mXfbAllocated[0] = true; if (xfbNum >= 2) { - buf = ::operator new[](size, pHeap, 0x20); - mBuffer[1] = buf; + mBuffer[1] = ::operator new[](size, pHeap, 0x20); mXfbAllocated[1] = true; } else { mBuffer[1] = NULL; @@ -87,8 +88,7 @@ void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber } if (xfbNum >= 3) { - buf = ::operator new[](size, pHeap, 0x20); - mBuffer[2] = buf; + mBuffer[2] = ::operator new[](size, pHeap, 0x20); mXfbAllocated[2] = true; } else { mBuffer[2] = NULL; diff --git a/src/SSystem/SComponent/c_xyz.cpp b/src/SSystem/SComponent/c_xyz.cpp index 7a647624164..75b8a3c1f23 100644 --- a/src/SSystem/SComponent/c_xyz.cpp +++ b/src/SSystem/SComponent/c_xyz.cpp @@ -59,7 +59,7 @@ cXyz cXyz::outprod(const Vec& vec) const { /* 80266CE4-80266D30 004C+00 s=0 e=10 z=1 None .text norm__4cXyzCFv */ cXyz cXyz::norm() const { Vec ret; - JUT_CONFIRM(251, isNearZeroSquare() == 0); + JUT_CONFIRM(251, isNearZeroSquare() == FALSE); PSVECNormalize(this, &ret); return ret; } diff --git a/src/d/actor/d_a_e_rdy.cpp b/src/d/actor/d_a_e_rdy.cpp index 1afcdf52942..f1932d99263 100644 --- a/src/d/actor/d_a_e_rdy.cpp +++ b/src/d/actor/d_a_e_rdy.cpp @@ -239,7 +239,7 @@ daE_RDY_HIO_c::daE_RDY_HIO_c() { } void daE_RDY_HIO_c::genMessage(JORMContext* context) { - // NONMATCHING + // DEBUG NONMATCHING } /* 8076BE80-8076BF6C 0001A0 00EC+00 23/23 0/0 0/0 .text anm_init__FP11e_rdy_classifUcf */ diff --git a/src/d/actor/d_a_e_ymb.cpp b/src/d/actor/d_a_e_ymb.cpp index b06bc750230..990a21b42ed 100644 --- a/src/d/actor/d_a_e_ymb.cpp +++ b/src/d/actor/d_a_e_ymb.cpp @@ -2946,7 +2946,6 @@ void daE_YMB_c::getBellyBitePos(cXyz* i_pos) { /* 80820128-808203D8 00A108 02B0+00 2/2 0/0 0/0 .text getDownLockPoint__9daE_YMB_cFv */ int daE_YMB_c::getDownLockPoint() { - // NONMATCHING if (field_0x6f4 >= 7) { return 1; } diff --git a/src/d/actor/d_a_mg_fish.cpp b/src/d/actor/d_a_mg_fish.cpp index 28cba5a79b2..2ef046bede2 100644 --- a/src/d/actor/d_a_mg_fish.cpp +++ b/src/d/actor/d_a_mg_fish.cpp @@ -2651,7 +2651,6 @@ static void mf_aqua(mg_fish_class* i_this) { /* 80531CD4-805322E0 008094 060C+00 1/1 0/0 0/0 .text ri_aqua__FP13mg_fish_class */ -// NONMATCHING - equivalent, but missing fmr instruction static void ri_aqua(mg_fish_class* i_this) { // Two different vectors in Debug, but this messes up the stack for GZ2E01. // cXyz commonXyz2; diff --git a/src/d/actor/d_a_npc_bou.cpp b/src/d/actor/d_a_npc_bou.cpp index a8d516a043b..4312f6ffe1f 100644 --- a/src/d/actor/d_a_npc_bou.cpp +++ b/src/d/actor/d_a_npc_bou.cpp @@ -1593,7 +1593,6 @@ int daNpc_Bou_c::talkwithJagar(void* param_0) { /* 80970F9C-8097146C 0040FC 04D0+00 3/0 0/0 0/0 .text talk__11daNpc_Bou_cFPv */ int daNpc_Bou_c::talk(void* param_0) { - // NONMATCHING daNpc_Jagar_c* jagar_p = NULL; switch (mMode) { case 0: diff --git a/src/d/actor/d_a_npc_doc.cpp b/src/d/actor/d_a_npc_doc.cpp index ed375e3a508..31b17c9eba6 100644 --- a/src/d/actor/d_a_npc_doc.cpp +++ b/src/d/actor/d_a_npc_doc.cpp @@ -322,7 +322,8 @@ int daNpc_Doc_c::ctrlJointCallBack(J3DJoint* i_joint, int param_1) { /* 809A7628-809A7660 000A88 0038+00 1/1 0/0 0/0 .text getType__11daNpc_Doc_cFv */ int daNpc_Doc_c::getType() { - switch (fopAcM_GetParam(this) & 0xFF) { + u8 r31 = fopAcM_GetParam(this) & 0xFF; + switch (r31) { case 0: return 0; case 1: diff --git a/src/d/actor/d_a_npc_moir.cpp b/src/d/actor/d_a_npc_moir.cpp index 33816544377..da3acb45bf0 100644 --- a/src/d/actor/d_a_npc_moir.cpp +++ b/src/d/actor/d_a_npc_moir.cpp @@ -1096,7 +1096,6 @@ static daNpcMoiR_c::Action2Fn dummy_4854() { /* 80A7D934-80A7DD94 0018B4 0460+00 1/0 0/0 0/0 .text wait_type0__11daNpcMoiR_cFPv */ bool daNpcMoiR_c::wait_type0(void* param_1) { - // NONMATCHING switch (field_0xe08) { case 0: setExpression(EXPR_NONE, -1.0f); @@ -1175,7 +1174,6 @@ void daNpcMoiR_c::setExpression(int i_expression, f32 i_morf) { /* 80A7DE04-80A7E668 001D84 0864+00 2/0 0/0 0/0 .text wait_type1__11daNpcMoiR_cFPv */ bool daNpcMoiR_c::wait_type1(void* param_1) { - // NONMATCHING f32 fVar1; switch (field_0xe08) { @@ -1275,7 +1273,6 @@ bool daNpcMoiR_c::wait_type1(void* param_1) { /* 80A7E668-80A7E8C0 0025E8 0258+00 1/0 0/0 0/0 .text wait_type2__11daNpcMoiR_cFPv */ bool daNpcMoiR_c::wait_type2(void* param_1) { - // NONMATCHING switch (field_0xe08) { case 0: setExpression(EXPR_FH_TAKAJO_HI, -1.0f); @@ -1421,7 +1418,6 @@ bool daNpcMoiR_c::talk(void* param_1) { /* 80A7EFBC-80A7F40C 002F3C 0450+00 2/0 0/0 0/0 .text multiTalk__11daNpcMoiR_cFPv */ BOOL daNpcMoiR_c::multiTalk(void* param_1) { - // NONMATCHING BOOL rv = FALSE; fopAc_ac_c* speakers[4] = {this, mActorMngr[1].getActorP(), mActorMngr[2].getActorP(), mActorMngr[3].getActorP()}; @@ -1479,7 +1475,6 @@ BOOL daNpcMoiR_c::multiTalk(void* param_1) { /* 80A7F40C-80A7F9AC 00338C 05A0+00 2/0 0/0 0/0 .text fight__11daNpcMoiR_cFPv */ bool daNpcMoiR_c::fight(void* param_1) { - // NONMATCHING f32 fVar1; int iVar1 = 1; diff --git a/src/d/actor/d_a_npc_pachi_besu.cpp b/src/d/actor/d_a_npc_pachi_besu.cpp index c396aaae5ba..b627d4f82fd 100644 --- a/src/d/actor/d_a_npc_pachi_besu.cpp +++ b/src/d/actor/d_a_npc_pachi_besu.cpp @@ -1136,7 +1136,7 @@ BOOL daNpc_Pachi_Besu_c::talk(void* param_1) { #ifdef DEBUG BOOL daNpc_Pachi_Besu_c::test(void* param_1) { - // NONMATCHING + // DEBUG NONMATCHING } #endif diff --git a/src/d/actor/d_a_npc_pachi_maro.cpp b/src/d/actor/d_a_npc_pachi_maro.cpp index 9b9fb82063f..435103f5d40 100644 --- a/src/d/actor/d_a_npc_pachi_maro.cpp +++ b/src/d/actor/d_a_npc_pachi_maro.cpp @@ -1101,7 +1101,6 @@ BOOL daNpc_Pachi_Maro_c::setAction(actionFunc action) { /* 80A99604-80A9986C 001A64 0268+00 2/0 0/0 0/0 .text wait__18daNpc_Pachi_Maro_cFPv */ int daNpc_Pachi_Maro_c::wait(void* param_1) { - // NONMATCHING int unused = 0; switch (mMode) { diff --git a/src/d/actor/d_a_npc_tks.cpp b/src/d/actor/d_a_npc_tks.cpp index 584785d3550..1bff4d51b00 100644 --- a/src/d/actor/d_a_npc_tks.cpp +++ b/src/d/actor/d_a_npc_tks.cpp @@ -357,7 +357,6 @@ cPhs__Step daNpcTks_c::Create() { /* 80B14ED0-80B1521C 000990 034C+00 1/1 0/0 0/0 .text CreateHeap__10daNpcTks_cFv */ int daNpcTks_c::CreateHeap() { - // NONMATCHING J3DModelData* mdlData_p = (J3DModelData*)dComIfG_getObjectRes(l_arcName, BMDR_TKS); JUT_ASSERT(410, NULL != mdlData_p); @@ -390,7 +389,9 @@ int daNpcTks_c::CreateHeap() { setMotion(MOT_WAIT_A, -1.0f, 0); if (mTksTsubo.mTsuboType < 2) { - mdlData_p = static_cast(dComIfG_getObjectRes(mTksTsubo.mTsuboType != 0 ? l_arcNames[2] : l_arcNames[1], 3)); + const char* sp30 = mTksTsubo.mTsuboType != 0 ? l_arcNames[2] : l_arcNames[1]; + int sp2C = mTksTsubo.mTsuboType != 0 ? 3 : 3; + mdlData_p = static_cast(dComIfG_getObjectRes(sp30, sp2C)); JUT_ASSERT(453, NULL != mdlData_p); @@ -589,7 +590,6 @@ void daNpcTks_c::setMotion(int i_motion, f32 i_morf, int param_3) { /* 80B1C4F8-80B1CB4C 007FB8 0654+00 1/0 0/0 0/0 .text main__10daNpcTks_cFv */ BOOL daNpcTks_c::main() { - // NONMATCHING if (field_0x138a && mTksTsubo.mCyl.ChkTgHit()) { if (mTksTsubo.mCyl.GetTgHitObj()->ChkAtType(AT_TYPE_BOOMERANG)) { setAction(&daNpcTks_c::damage); @@ -783,8 +783,8 @@ BOOL daNpcTks_c::setAction(actionFunc action) { int daNpcTks_c::getPlayerArea() { f32 fVar3, fVar2, fVar1; - fVar1 = pow(daNpcTks_Param_c::m.area_a_dist, 2.0); - fVar2 = pow(daNpcTks_Param_c::m.area_b_dist, 2.0); + fVar1 = std::pow(daNpcTks_Param_c::m.area_a_dist, 2.0f); + fVar2 = std::pow(daNpcTks_Param_c::m.area_b_dist, 2.0f); fVar3 = fopAcM_searchPlayerDistanceXZ2(this); if (fVar3 > 0.0f && fVar3 <= fVar2) { @@ -913,21 +913,23 @@ void daNpcTks_c::lookat() { } void daNpcTks_c::playTsuboAnm() { - if (mTksTsubo.field_0x586 != 0) { - if ((mAnmFlags & ANM_PLAY_MORF) != 0) { - f32 playSpeed = mTksTsubo.mpModelMorf->getPlaySpeed(); - - if ((mTksTsubo.mAnmFlags & ANM_PAUSE_MORF) != 0) { - mTksTsubo.mpModelMorf->setPlaySpeed(0.0f); - mTksTsubo.mpModelMorf->play(0, 0); - mTksTsubo.mpModelMorf->setPlaySpeed(playSpeed); - } else { - mTksTsubo.mpModelMorf->play(0, 0); - } - } - - mTksTsubo.mAnmFlags &= 0xFFFFEF38; + if (mTksTsubo.field_0x586 == 0) { + return; } + + if ((mAnmFlags & ANM_PLAY_MORF) != 0) { + f32 playSpeed = mTksTsubo.mpModelMorf->getPlaySpeed(); + + if ((mTksTsubo.mAnmFlags & ANM_PAUSE_MORF) != 0) { + mTksTsubo.mpModelMorf->setPlaySpeed(0.0f); + mTksTsubo.mpModelMorf->play(0, 0); + mTksTsubo.mpModelMorf->setPlaySpeed(playSpeed); + } else { + mTksTsubo.mpModelMorf->play(0, 0); + } + } + + mTksTsubo.mAnmFlags &= 0xFFFFEF38; }; BOOL daNpcTks_c::checkFindPlayer() { diff --git a/src/d/actor/d_a_npc_ykw.cpp b/src/d/actor/d_a_npc_ykw.cpp index 134df546f10..ef49ffc703c 100644 --- a/src/d/actor/d_a_npc_ykw.cpp +++ b/src/d/actor/d_a_npc_ykw.cpp @@ -15,6 +15,7 @@ #include "d/d_debug_viewer.h" #include "d/d_meter2_info.h" #include "d/d_timer.h" +#include "d/d_tresure.h" #include "f_op/f_op_camera_mng.h" #include "m_Do/m_Do_ext.h" diff --git a/src/d/actor/d_a_npc_zrz.cpp b/src/d/actor/d_a_npc_zrz.cpp index 066df7b26c3..0fe1ea5c2af 100644 --- a/src/d/actor/d_a_npc_zrz.cpp +++ b/src/d/actor/d_a_npc_zrz.cpp @@ -179,7 +179,6 @@ daNpc_zrZ_c::EventFn daNpc_zrZ_c::mEvtCutList[8] = { }; /* 80B93DCC-80B93F84 0000EC 01B8+00 1/1 0/0 0/0 .text __ct__11daNpc_zrZ_cFv */ -// NONMATCHING inlining daNpc_zrZ_c::daNpc_zrZ_c() { /* empty function */ } @@ -1308,7 +1307,6 @@ void daNpc_zrZ_c::lightPowerCalc(int param_0) { } /* 80B972EC-80B974BC 00360C 01D0+00 1/1 0/0 0/0 .text lightColorProc__11daNpc_zrZ_cFv */ -// NONMATCHING regalloc void daNpc_zrZ_c::lightColorProc() { static int const key_frame[4] = { 0, 50, 190, 220, diff --git a/src/d/actor/d_a_obj_cwall.cpp b/src/d/actor/d_a_obj_cwall.cpp index 6140d13e4a8..4c22994727d 100644 --- a/src/d/actor/d_a_obj_cwall.cpp +++ b/src/d/actor/d_a_obj_cwall.cpp @@ -14,8 +14,6 @@ #include "d/d_com_inf_game.h" #include "cmath.h" -// NONMATCHING - getRightHandPos is not generated at the end of the TU - /* 80BD6A4C-80BD6A88 0000EC 003C+00 1/1 0/0 0/0 .text initBaseMtx__12daObjCwall_cFv */ void daObjCwall_c::initBaseMtx() { mWallModel->setBaseScale(scale); diff --git a/src/d/actor/d_a_obj_hb.cpp b/src/d/actor/d_a_obj_hb.cpp index 6af9aaeca71..8bc2a60e8b9 100644 --- a/src/d/actor/d_a_obj_hb.cpp +++ b/src/d/actor/d_a_obj_hb.cpp @@ -655,7 +655,6 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80C1B1F4-80C1B4E8 001CB4 02F4+00 1/0 0/0 0/0 .text daOBJ_HB_Create__FP10fopAc_ac_c */ static cPhs__Step daOBJ_HB_Create(fopAc_ac_c* a_this) { - // NONMATCHING fopAcM_ct(a_this, obj_hb_class); obj_hb_class* i_this = (obj_hb_class*)a_this; diff --git a/src/d/actor/d_a_obj_ice_l.cpp b/src/d/actor/d_a_obj_ice_l.cpp index 412523f0270..4a264cedd0c 100644 --- a/src/d/actor/d_a_obj_ice_l.cpp +++ b/src/d/actor/d_a_obj_ice_l.cpp @@ -216,7 +216,6 @@ int daObjIce_l_c::Create() { /* 80C203C4-80C206AC 000A44 02E8+00 1/0 0/0 0/0 .text Execute__12daObjIce_l_cFPPA3_A4_f */ -// NONMATCHING int daObjIce_l_c::Execute(Mtx** param_0) { daPy_py_c* player_p = daPy_getPlayerActorClass(); cXyz& pos = fopAcM_GetPosition(player_p); diff --git a/src/d/actor/d_a_obj_ice_s.cpp b/src/d/actor/d_a_obj_ice_s.cpp index eb44abe2a10..165a02cf124 100644 --- a/src/d/actor/d_a_obj_ice_s.cpp +++ b/src/d/actor/d_a_obj_ice_s.cpp @@ -106,13 +106,12 @@ void daObjIce_s_c::setBaseMtx() { /* 80C20F48-80C21234 000688 02EC+00 1/1 0/0 0/0 .text * rideCallBack__FP4dBgWP10fopAc_ac_cP10fopAc_ac_c */ - // NONMATCHING - // reg alloc +// NONMATCHING - regalloc, equivalent static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3) { (void)param_1; daObjIce_s_c* ice = (daObjIce_s_c*)param_2; daPy_py_c* player = daPy_getPlayerActorClass(); - cXyz& playerPos = fopAcM_GetPosition(player); + cXyz* playerPos = &fopAcM_GetPosition(player); cXyz* pBallCenter = player->getIronBallCenterPos(); // !@bug misplaced ! operator. This condition is probably always false @@ -122,10 +121,10 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3 ice->field_0x5ac = 0x500; } else { ice->field_0x5a4 = -1.3f; - ice->Check_LinkRideOn(playerPos); + ice->Check_LinkRideOn(*playerPos); } - cXyz* icePos = &fopAcM_GetPosition(param_2); + cXyz* icePos = (cXyz*)&fopAcM_GetPosition(param_2); if (pBallCenter != NULL && icePos != NULL && icePos->absXZ(*pBallCenter) < ice->field_0x5c8.x * 600.0f) { ice->field_0x5d8 = 0x300; ice->field_0x5a4 = -11.0f; @@ -136,7 +135,7 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3 ice->field_0x5d8 = 0x300; ice->field_0x5a4 = -11.0f; ice->field_0x5ac = 0x1000; - ice->Check_RideOn(playerPos); + ice->Check_RideOn(*playerPos); } if (ice->field_0x5c5 == 0xff && fopAcM_GetName(param_3) == PROC_ALINK) @@ -144,7 +143,7 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3 ice->field_0x5d8 = 0x300; ice->field_0x5a4 = -11.0f; ice->field_0x5ac = 0x1000; - ice->Check_RideOn(playerPos); + ice->Check_RideOn(*playerPos); } } diff --git a/src/d/actor/d_a_obj_lv6SzGate.cpp b/src/d/actor/d_a_obj_lv6SzGate.cpp index 1f8cccff460..22b0d8988c2 100644 --- a/src/d/actor/d_a_obj_lv6SzGate.cpp +++ b/src/d/actor/d_a_obj_lv6SzGate.cpp @@ -25,7 +25,7 @@ daLv6SzGate_HIO_c::daLv6SzGate_HIO_c() { } void daLv6SzGate_HIO_c::genMessage(JORMContext* arg) { - // NONMATCHING + // DEBUG NONMATCHING } /* 80C75900-80C75A54 000180 0154+00 2/2 0/0 0/0 .text setBaseMtx__13daLv6SzGate_cFv */ diff --git a/src/d/actor/d_a_obj_lv7bridge.cpp b/src/d/actor/d_a_obj_lv7bridge.cpp index 6db7d96ada1..260ba1825d0 100644 --- a/src/d/actor/d_a_obj_lv7bridge.cpp +++ b/src/d/actor/d_a_obj_lv7bridge.cpp @@ -26,7 +26,7 @@ daObjLv7Brg_HIO_c::daObjLv7Brg_HIO_c() { } void daObjLv7Brg_HIO_c::genMessage(JORMContext* ctx) { - // NONMATCHING + // DEBUG NONMATCHING } static daObjLv7Brg_HIO_c l_HIO; diff --git a/src/d/actor/d_a_obj_mirror_6pole.cpp b/src/d/actor/d_a_obj_mirror_6pole.cpp index ca7c694628a..4cc0b70ce7e 100644 --- a/src/d/actor/d_a_obj_mirror_6pole.cpp +++ b/src/d/actor/d_a_obj_mirror_6pole.cpp @@ -7,22 +7,42 @@ #include "d/actor/d_a_obj_mirror_6pole.h" #include "d/d_procname.h" - -/* 80C95E18-80C95E2C 000078 0014+00 1/0 0/0 0/0 .text initWait__18daObjMirror6Pole_cFv */ -void daObjMirror6Pole_c::initWait() { - mpBck->setPlaySpeed(0.0f); -} +#include "f_op/f_op_actor_mng.h" /* 80C9654C-80C96550 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ static char* l_arcName = "MR-6Pole"; /* 80C96580-80C965B0 000054 0030+00 3/4 0/0 0/0 .data ActionTable__18daObjMirror6Pole_c */ -actionFunc daObjMirror6Pole_c::ActionTable[][2] = { +const actionFunc daObjMirror6Pole_c::ActionTable[][2] = { {&daObjMirror6Pole_c::initWait, &daObjMirror6Pole_c::executeWait}, {&daObjMirror6Pole_c::initDemo, &daObjMirror6Pole_c::executeDemo}, }; +void daObjMirror6Pole_c::setAction(Mode_e i_action) { + JUT_ASSERT(89, i_action < MODE_MAX_e); + Mode_e oldMode = mMode; + mMode = i_action; + mAction = (actionFunc*)ActionTable[mMode]; + + callInit(); +} + +void daObjMirror6Pole_c::callInit() { + JUT_ASSERT(123, mAction != NULL); + (this->*mAction[0])(); +} + +void daObjMirror6Pole_c::callExecute() { + JUT_ASSERT(136, mAction != NULL); + (this->*mAction[1])(); +} + +/* 80C95E18-80C95E2C 000078 0014+00 1/0 0/0 0/0 .text initWait__18daObjMirror6Pole_cFv */ +void daObjMirror6Pole_c::initWait() { + mpBck->setPlaySpeed(0.0f); +} + /* 80C95E2C-80C95E88 00008C 005C+00 1/0 0/0 0/0 .text executeWait__18daObjMirror6Pole_cFv */ void daObjMirror6Pole_c::executeWait() { @@ -67,27 +87,26 @@ void daObjMirror6Pole_c::create_init() { /* 80C95F50-80C95F70 0001B0 0020+00 1/1 0/0 0/0 .text * createHeapCallBack__18daObjMirror6Pole_cFP10fopAc_ac_c */ int daObjMirror6Pole_c::createHeapCallBack(fopAc_ac_c* i_this) { - return static_cast(i_this)->CreateHeap(); + daObjMirror6Pole_c* a_this = (daObjMirror6Pole_c*)i_this; + return a_this->CreateHeap(); } /* 80C95F70-80C961D8 0001D0 0268+00 1/1 0/0 0/0 .text CreateHeap__18daObjMirror6Pole_cFv */ int daObjMirror6Pole_c::CreateHeap() { + BOOL r26 = FALSE; J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 7); + JUT_ASSERT(318, modelData != NULL); mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); if (mpModel == NULL) { return 0; } J3DAnmTransform* bck = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 4); + JUT_ASSERT(327, bck != NULL); mpBck = new mDoExt_bckAnm(); - f32 speed; - if (isSwitch()) { - speed = 1.0f; - } else { - speed = 0.0f; - } + f32 speed = isSwitch() ? 1.0f : 0.0f; if (mpBck == NULL || !mpBck->init(bck, FALSE, J3DFrameCtrl::EMode_NONE, speed, 0, -1, false)) { return 0; @@ -117,6 +136,7 @@ int daObjMirror6Pole_c::create() { /* 80C96220-80C96328 000480 0108+00 1/0 0/0 0/0 .text daObjMirror6Pole_Create__FP10fopAc_ac_c */ static int daObjMirror6Pole_Create(fopAc_ac_c* i_this) { + fopAcM_RegisterCreateID(daObjMirror6Pole_c, i_this, "Obj_Mirror6Pole"); return static_cast(i_this)->create(); } @@ -127,6 +147,7 @@ daObjMirror6Pole_c::~daObjMirror6Pole_c() { /* 80C96328-80C96378 000588 0050+00 1/0 0/0 0/0 .text * daObjMirror6Pole_Delete__FP18daObjMirror6Pole_c */ static int daObjMirror6Pole_Delete(daObjMirror6Pole_c* i_this) { + fopAcM_RegisterDeleteID(i_this, "Obj_Mirror6Pole"); i_this->~daObjMirror6Pole_c(); return 1; } diff --git a/src/d/actor/d_a_obj_sw.cpp b/src/d/actor/d_a_obj_sw.cpp index 047ccfc09d1..e2df9dbdfd6 100644 --- a/src/d/actor/d_a_obj_sw.cpp +++ b/src/d/actor/d_a_obj_sw.cpp @@ -120,7 +120,6 @@ static void anm_init(obj_sc_s* i_this, int param_2, f32 i_morf, u8 i_mode, f32 i /* 80CF09A8-80CF1008 0003E8 0660+00 1/1 0/0 0/0 .text sc_build__FP12obj_sw_class */ static void sc_build(obj_sw_class* i_this) { - // NONMATCHING fopAc_ac_c* a_this = &i_this->actor; obj_sc_s* sc_p = i_this->field_0x5a8; cXyz sp24, sp30; @@ -285,7 +284,6 @@ static void sc_move(obj_sw_class* i_this) { /* 80CF1384-80CF1970 000DC4 05EC+00 1/1 0/0 0/0 .text demo_camera__FP12obj_sw_class */ static void demo_camera(obj_sw_class* i_this) { - // NONMATCHING fopAc_ac_c* a_this = &i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); @@ -408,7 +406,6 @@ static void demo_camera(obj_sw_class* i_this) { /* 80CF1970-80CF2160 0013B0 07F0+00 1/1 0/0 0/0 .text sc_action__FP12obj_sw_class */ static void sc_action(obj_sw_class* i_this) { - // NONMATCHING fopAc_ac_c* a_this = &i_this->actor; cXyz sp90; int swBit = fopAcM_GetParam(a_this) >> 24; @@ -545,7 +542,6 @@ static void sc_action(obj_sw_class* i_this) { /* 80CF2160-80CF2604 001BA0 04A4+00 1/1 0/0 0/0 .text sw_action__FP12obj_sw_class */ static void sw_action(obj_sw_class* i_this) { - // NONMATCHING f32 tmp; f32 fVar1; f32 fVar2; @@ -722,7 +718,6 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80CF29D4-80CF2F38 002414 0564+00 1/0 0/0 0/0 .text daObj_Sw_Create__FP10fopAc_ac_c */ static int daObj_Sw_Create(fopAc_ac_c* a_this) { - // NONMATCHING obj_sw_class* i_this = (obj_sw_class*)a_this; int phase; u32 i_size; diff --git a/src/d/actor/d_a_obj_timer.cpp b/src/d/actor/d_a_obj_timer.cpp index 55beed1766e..32823eeddd2 100644 --- a/src/d/actor/d_a_obj_timer.cpp +++ b/src/d/actor/d_a_obj_timer.cpp @@ -104,30 +104,31 @@ bool daObjTimer::Act_c::_execute() { } } +namespace daObjTimer { + namespace { /* 804855A4-804855C0 .text daObjTimer::@unnamed@d_a_obj_timer_cpp@::Mthd_Create */ - int Mthd_Create(fopAc_ac_c* i_this) { + int Mthd_Create(void* i_this) { return static_cast(i_this)->_create(); } /* 804855C4-804855E4 .text daObjTimer::@unnamed@d_a_obj_timer_cpp@::Mthd_Delete */ - int Mthd_Delete(fopAc_ac_c* i_this) { + int Mthd_Delete(void* i_this) { return static_cast(i_this)->_delete(); } /* 804855E8-80485608 .text daObjTimer::@unnamed@d_a_obj_timer_cpp@::Mthd_Execute */ - int Mthd_Execute(fopAc_ac_c* i_this) { - // NONMATCHING + int Mthd_Execute(void* i_this) { return static_cast(i_this)->_execute(); } /* 8048560C-80485610 .text daObjTimer::@unnamed@d_a_obj_timer_cpp@::Mthd_Draw */ - int Mthd_Draw(fopAc_ac_c* i_this) { + int Mthd_Draw(void* i_this) { return 1; } /* 80485614-80485618 .text daObjTimer::@unnamed@d_a_obj_timer_cpp@::Mthd_IsDelete */ - int Mthd_IsDelete(fopAc_ac_c* i_this) { + int Mthd_IsDelete(void* i_this) { return 1; } @@ -139,7 +140,9 @@ namespace { (process_method_func)Mthd_IsDelete, (process_method_func)Mthd_Draw, }; -} +} // namespace + +}; // namespace daObjTimer /* 804856B8-804856E8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Timer */ extern actor_process_profile_definition g_profile_Obj_Timer = { @@ -153,7 +156,7 @@ extern actor_process_profile_definition g_profile_Obj_Timer = { 0, // mParameters &g_fopAc_Method.base, // sub_method 22, // mPriority - &l_daTimer_Method, // sub_method + &daObjTimer::l_daTimer_Method, // sub_method 0x00040000, // mStatus fopAc_ACTOR_e, // mActorType fopAc_CULLBOX_0_e, // cullType diff --git a/src/d/actor/d_a_obj_web0.cpp b/src/d/actor/d_a_obj_web0.cpp index a3dfc53ca14..9ba80e6d79e 100644 --- a/src/d/actor/d_a_obj_web0.cpp +++ b/src/d/actor/d_a_obj_web0.cpp @@ -72,7 +72,6 @@ static void damage_check(obj_web0_class* i_this) { } /* 80D34794-80D34B24 000354 0390+00 2/1 0/0 0/0 .text daObj_Web0_Execute__FP14obj_web0_class */ -// NONMATCHING - reg alloc static int daObj_Web0_Execute(obj_web0_class* i_this) { fopAc_ac_c* base_p = i_this; fopAc_ac_c* player = (fopAc_ac_c*) dComIfGp_getPlayer(0); diff --git a/src/d/actor/d_flower.inc b/src/d/actor/d_flower.inc index 4ffd8562e0c..4389ef19a5e 100644 --- a/src/d/actor/d_flower.inc +++ b/src/d/actor/d_flower.inc @@ -810,7 +810,6 @@ void dFlower_packet_c::draw() { } /* 80522774-8052299C 006B14 0228+00 1/1 0/0 0/0 .text calc__16dFlower_packet_cFv */ -// NONMATCHING void dFlower_packet_c::calc() { dFlower_anm_c* anm_p = getAnm(); diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index b5c18181383..54716d735a1 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -5667,7 +5667,7 @@ void dKankyo_lightHIO_c::dKankyo_lightHIOInfoUpDateF() { } void dKankyo_lightHIO_c::listenPropertyEvent(const JORPropertyEvent* property) { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_vrboxHIO_c::dKankyo_vrboxHIO_c() { @@ -5691,15 +5691,15 @@ dKankyo_vrboxHIO_c::dKankyo_vrboxHIO_c() { } void dKankyo_vrboxHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_vrboxHIO_c::dKankyo_vrboxHIOInfoUpDateF() { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_vrboxHIO_c::listenPropertyEvent(const JORPropertyEvent* property) { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_bloomHIO_c::dKankyo_bloomHIO_c() { @@ -5714,63 +5714,63 @@ dKankyo_bloomHIO_c::dKankyo_bloomHIO_c() { } void dKankyo_bloomHIO_c::listenPropertyEvent(const JORPropertyEvent* property) { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_bloomHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_dungeonlightHIO_c::listenPropertyEvent(const JORPropertyEvent* property) {} dKankyo_navyHIO_c::dKankyo_navyHIO_c() { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_navyHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_efflightHIO_c::dKankyo_efflightHIO_c() { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_efflightHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_windHIO_c::dKankyo_windHIO_c() { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_demolightHIO_c::dKankyo_demolightHIO_c() { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_demolightHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_windHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_dungeonlightHIO_c::dKankyo_dungeonlightHIO_c() { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_dungeonlightHIO_c::genMessage(JORMContext* mctx) {} dKankyo_ParticlelightHIO_c::dKankyo_ParticlelightHIO_c() { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_ParticlelightHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } void dKankyo_ParticlelightHIO_c::listenPropertyEvent(const JORPropertyEvent* property) { - // NONMATCHING + // DEBUG NONMATCHING } dKankyo_HIO_c::dKankyo_HIO_c() { @@ -5779,7 +5779,7 @@ dKankyo_HIO_c::dKankyo_HIO_c() { } void dKankyo_HIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif diff --git a/src/d/d_map.cpp b/src/d/d_map.cpp index 05c96cc3cb6..c599eb4a705 100644 --- a/src/d/d_map.cpp +++ b/src/d/d_map.cpp @@ -3,10 +3,7 @@ * */ -// not sure if this object is supposed to have a PCH - -// including it completely messes up weak function ordering - -#define NO_INLINE_DLSTBASE_DRAW +#include "d/dolzel.h" // IWYU pragma: keep #include "d/d_map.h" #include "JSystem/JUtility/JUTTexture.h" @@ -1304,8 +1301,3 @@ dTres_c::typeGroupData_c* dMap_c::getFirstData(u8 param_0) { dTres_c::typeGroupData_c* dMap_c::getNextData(dTres_c::typeGroupData_c* param_0) { return renderingPlusDoorAndCursor_c::getNextData(param_0); } - -// TODO: this is supposed to be auto-generated, but its not getting put in the right order -void dDlst_base_c::draw() { - /* empty function */ -} diff --git a/src/d/d_map_path_dmap.cpp b/src/d/d_map_path_dmap.cpp index 469c9acfbce..97cfb748997 100644 --- a/src/d/d_map_path_dmap.cpp +++ b/src/d/d_map_path_dmap.cpp @@ -519,7 +519,7 @@ int dMpath_c::setPointer(dDrawPath_c::room_class* i_room, s8* param_1, s8* param #pragma optimization_level 2 void dMpath_c::setPointer(s8 i_roomNo, void* i_data, int i_mapLayerNo) { s32 roomNo; - dDrawPath_c::room_class* room = ((map_path_class*)i_data)->m_entries; + dDrawPath_c::room_class* room = (dDrawPath_c::room_class*)((map_path_class*)i_data)->m_entries; if (room != NULL) { roomNo = i_roomNo; @@ -954,17 +954,17 @@ bool renderingPlusDoor_c::checkDispDoorS(int param_0, int param_1, f32 param_2) return false; } +static Vec const l_100x100BoxVertexList[4] = { + {-50.0f, -50.0f, 0.0f}, + {50.0f, -50.0f, 0.0f}, + {50.0f, 50.0f, 0.0f}, + {-50.0f, 50.0f, 0.0f}, +}; + /* 80040838-800409B4 03B178 017C+00 1/1 0/0 0/0 .text * drawNormalDoorS__19renderingPlusDoor_cFPC21stage_tgsc_data_classiib */ void renderingPlusDoor_c::drawNormalDoorS(stage_tgsc_data_class const* i_doorData, int i_roomNo, int param_2, bool param_3) { - static Vec const l_100x100BoxVertexList[4] = { - {-50.0f, -50.0f, 0.0f}, - {50.0f, -50.0f, 0.0f}, - {50.0f, 50.0f, 0.0f}, - {-50.0f, 50.0f, 0.0f}, - }; - if (i_roomNo == dComIfGp_roomControl_getStayNo() || param_2 == dComIfGp_roomControl_getStayNo()) { GXSetTevColor(GX_TEVREG1, l_doorWhite); diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index f70d5d98e4a..a66c8af4c83 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -295,7 +295,13 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { static u64 const cont_bt[5] = {'cont_bt', 'cont_bt1', 'cont_bt2', 'cont_bt3', 'cont_bt4'}; static u64 const font_at[5] = {'font_at', 'font_at1', 'font_at2', 'font_at3', 'font_at4'}; static u64 const font_bt[5] = {'font_bt', 'font_bt1', 'font_bt2', 'font_bt3', 'font_bt4'}; - static u64 const c_tag[2] = {'f_text_s', 'f_text'}; + static u64 const c_tag[2] = { + #if VERSION == VERSION_GCN_JPN + 'c_text_s', 'c_text' + #else + 'f_text_s', 'f_text' + #endif + }; mButtonScreen = new J2DScreen(); JUT_ASSERT(916, mButtonScreen != NULL); @@ -335,12 +341,21 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { mpJButton = NULL; for (int i = 0; i < 5; i++) { + #if VERSION == VERSION_GCN_JPN + ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont()); + ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont()); + ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setString(32, ""); + ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setString(32, ""); + ((J2DTextBox*)mButtonScreen->search(font_at[i]))->hide(); + ((J2DTextBox*)mButtonScreen->search(font_bt[i]))->hide(); + #else ((J2DTextBox*)mButtonScreen->search(font_at[i]))->setFont(mDoExt_getMesgFont()); ((J2DTextBox*)mButtonScreen->search(font_bt[i]))->setFont(mDoExt_getMesgFont()); ((J2DTextBox*)mButtonScreen->search(font_at[i]))->setString(32, ""); ((J2DTextBox*)mButtonScreen->search(font_bt[i]))->setString(32, ""); ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->hide(); ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->hide(); + #endif } field_0xcf4 = new CPaneMgr(mButtonScreen, 'c_n', 2, NULL); @@ -366,7 +381,13 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { /* 801B8DE4-801B8EBC 1B3724 00D8+00 7/7 0/0 0/0 .text setAButtonString__14dMenu_DmapBg_cFUl */ void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) { - static u64 const cont_at[5] = {'font_at', 'font_at1', 'font_at2', 'font_at3', 'font_at4'}; + static u64 const cont_at[5] = { + #if VERSION == VERSION_GCN_JPN + 'cont_at', 'cont_at1', 'cont_at2', 'cont_at3', 'cont_at4' + #else + 'font_at', 'font_at1', 'font_at2', 'font_at3', 'font_at4' + #endif + }; for (int i = 0; i < 5; i++) { if (i_msgNo == 0) { strcpy(((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), ""); @@ -378,7 +399,13 @@ void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) { /* 801B8EBC-801B8F94 1B37FC 00D8+00 8/8 0/0 0/0 .text setBButtonString__14dMenu_DmapBg_cFUl */ void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) { - static u64 const cont_bt[5] = {'font_bt', 'font_bt1', 'font_bt2', 'font_bt3', 'font_bt4'}; + static u64 const cont_bt[5] = { + #if VERSION == VERSION_GCN_JPN + 'cont_bt', 'cont_bt1', 'cont_bt2', 'cont_bt3', 'cont_bt4' + #else + 'font_bt', 'font_bt1', 'font_bt2', 'font_bt3', 'font_bt4' + #endif + }; for (int i = 0; i < 5; i++) { if (i_msgNo == 0) { strcpy(((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), ""); @@ -399,7 +426,13 @@ dMenu_Dmap_c* dMenu_Dmap_c::myclass; /* 801B8F94-801B90BC 1B38D4 0128+00 1/1 0/0 0/0 .text setCButtonString__14dMenu_DmapBg_cFUl */ void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { - static u64 const c_tag[2] = {'f_text_s', 'f_text'}; + static u64 const c_tag[2] = { + #if VERSION == VERSION_GCN_JPN + 'c_text_s', 'c_text' + #else + 'f_text_s', 'f_text' + #endif + }; int i; u32 msgNo; @@ -482,8 +515,13 @@ void dMenu_DmapBg_c::baseScreenInit() { mpDrawCursor->setAlphaRate(1.0f); mpDrawCursor->setParam(0.95f, 0.9f, 0.1f, 0.6f, 0.5f); + #if VERSION == VERSION_GCN_JPN + J2DTextBox* uVar9 = (J2DTextBox*)mBaseScreen->search('t_t00'); + mBaseScreen->search('f_t_00')->hide(); + #else J2DTextBox* uVar9 = (J2DTextBox*)mBaseScreen->search('f_t_00'); mBaseScreen->search('t_t00')->hide(); + #endif uVar9->setFont(mDoExt_getSubFont()); uVar9->setString(32, ""); @@ -509,82 +547,90 @@ void dMenu_DmapBg_c::setFloorMessage() { 0x036E, 0x036F, 0x03DC, 0x03DD, 0x03D9, 0x03D8, }; - floor_textbox_1[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_1'); - floor_textbox_2[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_2'); - floor_textbox_3[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_3'); - mFloorScreen->search('floor7_1')->hide(); - mFloorScreen->search('floor7_2')->hide(); - mFloorScreen->search('floor7_3')->hide(); + #if VERSION == VERSION_GCN_JPN + #define FLOOR_TAG(A, B) ('ffoor0_0' | (A<<16) | (B)) + #define FFOOR_TAG(A, B) ('floor0_0' | (A<<16) | (B)) + #else + #define FLOOR_TAG(A, B) ('floor0_0' | (A<<16) | (B)) + #define FFOOR_TAG(A, B) ('ffoor0_0' | (A<<16) | (B)) + #endif + + floor_textbox_1[0] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(7, 1)); + floor_textbox_2[0] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(7, 2)); + floor_textbox_3[0] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(7, 3)); + mFloorScreen->search(FLOOR_TAG(7, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(7, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(7, 3))->hide(); floor_textbox_1[0]->setFont(mDoExt_getSubFont()); floor_textbox_2[0]->setFont(mDoExt_getSubFont()); floor_textbox_3[0]->setFont(mDoExt_getSubFont()); - floor_textbox_1[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_1'); - floor_textbox_2[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_2'); - floor_textbox_3[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_3'); - mFloorScreen->search('floor0_1')->hide(); - mFloorScreen->search('floor0_2')->hide(); - mFloorScreen->search('floor0_3')->hide(); + floor_textbox_1[1] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(0, 1)); + floor_textbox_2[1] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(0, 2)); + floor_textbox_3[1] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(0, 3)); + mFloorScreen->search(FLOOR_TAG(0, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(0, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(0, 3))->hide(); floor_textbox_1[1]->setFont(mDoExt_getSubFont()); floor_textbox_2[1]->setFont(mDoExt_getSubFont()); floor_textbox_3[1]->setFont(mDoExt_getSubFont()); - floor_textbox_1[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_1'); - floor_textbox_2[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_2'); - floor_textbox_3[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_3'); - mFloorScreen->search('floor1_1')->hide(); - mFloorScreen->search('floor1_2')->hide(); - mFloorScreen->search('floor1_3')->hide(); + floor_textbox_1[2] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(1, 1)); + floor_textbox_2[2] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(1, 2)); + floor_textbox_3[2] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(1, 3)); + mFloorScreen->search(FLOOR_TAG(1, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(1, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(1, 3))->hide(); floor_textbox_1[2]->setFont(mDoExt_getSubFont()); floor_textbox_2[2]->setFont(mDoExt_getSubFont()); floor_textbox_3[2]->setFont(mDoExt_getSubFont()); - floor_textbox_1[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_1'); - floor_textbox_2[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_2'); - floor_textbox_3[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_3'); - mFloorScreen->search('floor2_1')->hide(); - mFloorScreen->search('floor2_2')->hide(); - mFloorScreen->search('floor2_3')->hide(); + floor_textbox_1[3] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(2, 1)); + floor_textbox_2[3] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(2, 2)); + floor_textbox_3[3] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(2, 3)); + mFloorScreen->search(FLOOR_TAG(2, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(2, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(2, 3))->hide(); floor_textbox_1[3]->setFont(mDoExt_getSubFont()); floor_textbox_2[3]->setFont(mDoExt_getSubFont()); floor_textbox_3[3]->setFont(mDoExt_getSubFont()); - floor_textbox_1[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_1'); - floor_textbox_2[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_2'); - floor_textbox_3[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_3'); - mFloorScreen->search('floor3_1')->hide(); - mFloorScreen->search('floor3_2')->hide(); - mFloorScreen->search('floor3_3')->hide(); + floor_textbox_1[4] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(3, 1)); + floor_textbox_2[4] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(3, 2)); + floor_textbox_3[4] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(3, 3)); + mFloorScreen->search(FLOOR_TAG(3, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(3, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(3, 3))->hide(); floor_textbox_1[4]->setFont(mDoExt_getSubFont()); floor_textbox_2[4]->setFont(mDoExt_getSubFont()); floor_textbox_3[4]->setFont(mDoExt_getSubFont()); - floor_textbox_1[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_1'); - floor_textbox_2[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_2'); - floor_textbox_3[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_3'); - mFloorScreen->search('floor4_1')->hide(); - mFloorScreen->search('floor4_2')->hide(); - mFloorScreen->search('floor4_3')->hide(); + floor_textbox_1[5] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(4, 1)); + floor_textbox_2[5] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(4, 2)); + floor_textbox_3[5] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(4, 3)); + mFloorScreen->search(FLOOR_TAG(4, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(4, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(4, 3))->hide(); floor_textbox_1[5]->setFont(mDoExt_getSubFont()); floor_textbox_2[5]->setFont(mDoExt_getSubFont()); floor_textbox_3[5]->setFont(mDoExt_getSubFont()); - floor_textbox_1[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_1'); - floor_textbox_2[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_2'); - floor_textbox_3[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_3'); - mFloorScreen->search('floor5_1')->hide(); - mFloorScreen->search('floor5_2')->hide(); - mFloorScreen->search('floor5_3')->hide(); + floor_textbox_1[6] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(5, 1)); + floor_textbox_2[6] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(5, 2)); + floor_textbox_3[6] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(5, 3)); + mFloorScreen->search(FLOOR_TAG(5, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(5, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(5, 3))->hide(); floor_textbox_1[6]->setFont(mDoExt_getSubFont()); floor_textbox_2[6]->setFont(mDoExt_getSubFont()); floor_textbox_3[6]->setFont(mDoExt_getSubFont()); - floor_textbox_1[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_1'); - floor_textbox_2[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_2'); - floor_textbox_3[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_3'); - mFloorScreen->search('floor6_1')->hide(); - mFloorScreen->search('floor6_2')->hide(); - mFloorScreen->search('floor6_3')->hide(); + floor_textbox_1[7] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(6, 1)); + floor_textbox_2[7] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(6, 2)); + floor_textbox_3[7] = (J2DTextBox*)mFloorScreen->search(FFOOR_TAG(6, 3)); + mFloorScreen->search(FLOOR_TAG(6, 1))->hide(); + mFloorScreen->search(FLOOR_TAG(6, 2))->hide(); + mFloorScreen->search(FLOOR_TAG(6, 3))->hide(); floor_textbox_1[7]->setFont(mDoExt_getSubFont()); floor_textbox_2[7]->setFont(mDoExt_getSubFont()); floor_textbox_3[7]->setFont(mDoExt_getSubFont()); @@ -1998,7 +2044,6 @@ bool dMenu_Dmap_c::isClose() { } /* 801BE7E0-801BEAFC 1B9120 031C+00 0/0 1/1 0/0 .text _draw__12dMenu_Dmap_cFv */ -// NONMATCHING - not sure what the 2nd param of getGlobalVtxCenter is supposed to be void dMenu_Dmap_c::_draw() { if (mMapCtrl != NULL) { mMapCtrl->draw(); @@ -2044,7 +2089,9 @@ void dMenu_Dmap_c::_draw() { spC.y = mpDrawBg->mMapScreen[0]->search('center_n')->getGlbBounds().i.y + (mpDrawBg->mMapScreen[0]->search('center_n')->getHeight() / 2); CPaneMgr sp70; - Vec sp34 = sp70.getGlobalVtxCenter(mpDrawBg->getMapPane(), false, 0); + //!@bug It's unclear what this is supposed to be, but a stack pointer being converted to a bool is probably not intended. + u8 sp40[0x30]; + Vec sp34 = sp70.getGlobalVtxCenter(mpDrawBg->getMapPane(), (bool)sp40, 0); spC.x = sp34.x; spC.y = sp34.y; diff --git a/src/d/d_menu_dmap_map.cpp b/src/d/d_menu_dmap_map.cpp index a042c45dd53..09e59baa9cc 100644 --- a/src/d/d_menu_dmap_map.cpp +++ b/src/d/d_menu_dmap_map.cpp @@ -172,7 +172,7 @@ int renderingDmap_c::getLineWidth(int param_0) { } /* 80395860-80395950 -00001 00F0+00 1/1 0/0 0/0 .rodata l_paletteDmap_m */ -static u32 const l_paletteDmap_m[60] = { +static u32 const l_paletteDmap_m[60] ALIGN_DECL(32) = { 0x00000000, 0x00000000, 0x80008000, diff --git a/src/d/d_meter_HIO.cpp b/src/d/d_meter_HIO.cpp index 79d8ed40817..0a57e0d0d96 100644 --- a/src/d/d_meter_HIO.cpp +++ b/src/d/d_meter_HIO.cpp @@ -12,7 +12,7 @@ dMeter_menuHIO_c::dMeter_menuHIO_c() { #if DEBUG void dMeter_menuHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -60,7 +60,7 @@ dMeter_drawCollectHIO_c::dMeter_drawCollectHIO_c() { #if DEBUG void dMeter_drawCollectHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -96,7 +96,7 @@ dMeter_drawOptionHIO_c::dMeter_drawOptionHIO_c() { #if DEBUG void dMeter_drawOptionHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -140,7 +140,7 @@ dMeter_drawLetterHIO_c::dMeter_drawLetterHIO_c() { #if DEBUG void dMeter_drawLetterHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -239,7 +239,7 @@ dMeter_drawFishingHIO_c::dMeter_drawFishingHIO_c() { #if DEBUG void dMeter_drawFishingHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -272,7 +272,7 @@ dMeter_drawInsectHIO_c::dMeter_drawInsectHIO_c() { #if DEBUG void dMeter_drawInsectHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -288,7 +288,7 @@ dMeter_drawCalibrationHIO_c::dMeter_drawCalibrationHIO_c() { #if DEBUG void dMeter_drawCalibrationHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -330,7 +330,7 @@ dMeter_drawSkillHIO_c::dMeter_drawSkillHIO_c() { #if DEBUG void dMeter_drawSkillHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -558,7 +558,7 @@ dMeter_drawEmpButtonHIO_c::dMeter_drawEmpButtonHIO_c() { #if DEBUG void dMeter_drawEmpButtonHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -737,7 +737,7 @@ dMeter_drawMiniGameHIO_c::dMeter_drawMiniGameHIO_c() { #if DEBUG void dMeter_drawMiniGameHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -812,7 +812,7 @@ dMeter_drawLightDropHIO_c::dMeter_drawLightDropHIO_c() { #if DEBUG void dMeter_drawLightDropHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -1470,7 +1470,7 @@ void dMeter_drawHIO_c::updateOffWide() {} #if DEBUG void dMeter_drawHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } void dMeter_drawHIO_c::updateFMsgDebug() { @@ -1598,7 +1598,7 @@ void dMeter_ringHIO_c::updateOffWide() {} #if DEBUG void dMeter_ringHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -1712,7 +1712,7 @@ dMeter_mapIconHIO_c::dMeter_mapIconHIO_c() { #if DEBUG void dMeter_mapIconHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif @@ -1928,7 +1928,7 @@ dMeter_fmapHIO_c::~dMeter_fmapHIO_c() { #if DEBUG void dMeter_fmapHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } void dMeter_fmapHIO_c::listenPropertyEvent(const JORPropertyEvent*) { @@ -1964,7 +1964,7 @@ dMeter_cursorHIO_c::dMeter_cursorHIO_c() { #if DEBUG void dMeter_cursorHIO_c::genMessage(JORMContext* mctx) { - // NONMATCHING + // DEBUG NONMATCHING } #endif diff --git a/src/d/d_s_menu.cpp b/src/d/d_s_menu.cpp index 7c5aa27d08b..7df243c21a6 100644 --- a/src/d/d_s_menu.cpp +++ b/src/d/d_s_menu.cpp @@ -510,7 +510,7 @@ u8 dSm_read_stageset(u8* i_data) { return sp8; } -// NONMATCHING - regalloc / stack +// DEBUG NONMATCHING - regalloc / stack int dScnMenu_Draw(dScnMenu_c* i_this) { static dDlst_2DQuad_c effectQuad; static dDlst_2DQuad_c effectQuad2[40]; @@ -1132,7 +1132,7 @@ void setEnvData(menu_data_class* i_data) { } } -// NONMATCHING - some stack issues +// DEBUG NONMATCHING - some stack issues int dScnMenu_Execute(dScnMenu_c* i_this) { static const u8 l_autoCancel[2][2] = { {99, 99}, @@ -1567,7 +1567,6 @@ u8 search(menu_info_class* i_info) { return rt; } -// NONMATCHING - small regalloc int phase_2(dScnMenu_c* i_this) { if (!i_this->command->sync() || !i_this->fontCommand->sync()) { return cPhs_INIT_e; @@ -1606,7 +1605,7 @@ int phase_2(dScnMenu_c* i_this) { category_offset += menu_info->stage_data[i].field_0x41 * sizeof(menu_data_class); } - i_this->category_info = (menu_category_class*)((uintptr_t)i_this->command->getMemAddress() + category_offset); + i_this->category_info = (menu_category_class*)(&((u8*)i_this->command->getMemAddress())[category_offset]); JUT_ASSERT(3282, i_this->category_info != NULL); category_info = i_this->category_info; diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 9b2bf739c42..52f4377eafb 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -2293,7 +2293,7 @@ static int dStage_mapPathInitCommonLayer(dStage_dt_c* i_stage, void* i_data, int static int dStage_fieldMapMapPathInit(dStage_dt_c* i_stage, void* i_data, int param_2, void* param_3) { map_path_class* map_path = (map_path_class*)((int*)i_data + 1); - dDrawPath_c::room_class* room_p = map_path->m_entries; + dDrawPath_c::room_class* room_p = (dDrawPath_c::room_class*)map_path->m_entries; if (room_p == NULL) { return 1; } diff --git a/src/f_ap/f_ap_game.cpp b/src/f_ap/f_ap_game.cpp index b92d220f017..f3583e9c80d 100644 --- a/src/f_ap/f_ap_game.cpp +++ b/src/f_ap/f_ap_game.cpp @@ -18,6 +18,7 @@ #include "d/actor/d_a_midna.h" #include "d/d_model.h" #include "d/actor/d_a_grass.h" +#include "d/d_tresure.h" fapGm_HIO_c::fapGm_HIO_c() { mUsingHostIO = true; diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 86afed4d5c1..11af19bbcb5 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -345,10 +345,10 @@ BOOL fopAcM_createHeap(fopAc_ac_c* i_this, u32 size, u32 align) { align = 0x20; i_this->heap = mDoExt_createSolidHeapFromGameToCurrent(size, align); - if (i_this->heap == 0) { + if (i_this->heap == NULL) { // "fopAcM_createHeap allocation failure\n" OSReport_Error("fopAcM_createHeap 確保失敗\n"); - JUT_CONFIRM(0, i_this->heap != 0); + JUT_CONFIRM(0, i_this->heap != NULL); return FALSE; } diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index 579add2f413..132edace672 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -411,7 +411,7 @@ static void dummy2() { J3DTevSwapModeTable tevSwapModeTable; J3DIndTexOrder indTexOrder; - J3DTevStage* tevStage_p; + J3DTevStage* tevStage_p = NULL; J3DTevStageInfo tevStageInfo; tevStage_p->setTevStageInfo(tevStageInfo); J3DTevStage tevStage; @@ -452,7 +452,7 @@ static void dummy2() { peBlock->setBlend(blend); J3DZMode zMode; peBlock->setZMode(zMode); - u8 compLoc; + u8 compLoc = 0; peBlock->setZCompLoc(compLoc); colorBlock->getColorChanNum(); @@ -770,29 +770,68 @@ JKRExpHeap* mDoExt_getHostIOHeap() { return HostIOHeap; } +#ifdef DEBUG +extern u8 lbl_8074C3B9[1]; +#endif + /* 8000EE40-8000EED8 009780 0098+00 3/3 0/0 0/0 .text mDoExt_createSolidHeap__FUlP7JKRHeapUl */ static JKRSolidHeap* mDoExt_createSolidHeap(u32 i_size, JKRHeap* i_heap, u32 i_alignment) { if (i_heap == NULL) { - i_heap = JKRHeap::getCurrentHeap(); + i_heap = JKRGetCurrentHeap(); } JKRSolidHeap* createdHeap; - if (i_size == 0 || i_size == 0xFFFFFFFF) { - createdHeap = JKRSolidHeap::create(0xFFFFFFFF, i_heap, false); + if (i_size == 0 || i_size == -1) { + #ifdef DEBUG + if (lbl_8074C3B9[0] != 0) { + OS_REPORT("\x1b[44mmDoExt_createSolidHeap サイズ未設定\n\x1b[m"); + OS_REPORT("最大空き容量確保します %08x\n\x1b[m", i_heap->getFreeSize()); + } + #endif + createdHeap = JKRCreateSolidHeap(-1, i_heap, false); } else { + u32 solidHeapSize = ALIGN_NEXT(sizeof(JKRSolidHeap), 0x10); i_size = ALIGN_NEXT(i_size, 0x10); - i_size += 0x80; + i_size += solidHeapSize; if (0x10 < i_alignment) { i_size = (i_alignment - 0x10 + i_size); } - createdHeap = JKRSolidHeap::create(i_size, i_heap, false); + createdHeap = JKRCreateSolidHeap(i_size, i_heap, false); } if (createdHeap != NULL) { - createdHeap->setErrorFlag(true); + JKRSetErrorFlag(createdHeap, true); + #ifdef DEBUG + if (lbl_8074C3B9[0] != 0) { + u32 heapSize = createdHeap->getHeapSize(); + OS_REPORT( + "JKRCreateSolidHeap %08x i_size=%08x solidHeapSize=%08x\n", + createdHeap, + i_size, + heapSize + ); + } + #endif } +#ifdef DEBUG + if (createdHeap == NULL) { + OS_WARNING( + "mDoExt_createMaxSolidHeap : ソリッドヒープ%fKの確保に失敗 連続空き容量=%fK 残り空き容量=%f\n", + i_size / 1024.0f, + i_heap->getFreeSize() / 1024.0f, + i_heap->getTotalFreeSize() / 1024.0f + ); + static BOOL dumped = FALSE; + if (dumped == FALSE) { + dumped = TRUE; + i_heap->dump_sort(); + } + return createdHeap; + } +#endif + return createdHeap; } diff --git a/src/m_Do/m_Do_graphic.cpp b/src/m_Do/m_Do_graphic.cpp index df35dce4717..e9ac262f8ab 100644 --- a/src/m_Do/m_Do_graphic.cpp +++ b/src/m_Do/m_Do_graphic.cpp @@ -1411,7 +1411,7 @@ static void setLight() { } static void captureScreenSetProjection(Mtx44& m) { - // NONMATCHING + // DEBUG NONMATCHING } static void captureScreenSetPort() { @@ -1420,11 +1420,11 @@ static void captureScreenSetPort() { } static void captureScreenSetScissor(scissor_class* scissor) { - // NONMATCHING + // DEBUG NONMATCHING } static void captureScreenPerspDrawInfo(JPADrawInfo&) { - // NONMATCHING + // DEBUG NONMATCHING } /* 8000A58C-8000A604 004ECC 0078+00 1/1 0/0 0/0 .text drawItem3D__Fv */ diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index a717a82424c..bcb4f604df7 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -807,7 +807,7 @@ void main01(void) { } #if DEBUG -// NONMATCHING +// DEBUG NONMATCHING void parse_args(int argc, const char* argv[]) { int i;