From 0e281cb97535523a3d1a4f668bc84321bc39fb46 Mon Sep 17 00:00:00 2001 From: TakaRikka <38417346+TakaRikka@users.noreply.github.com> Date: Sun, 29 Dec 2024 07:53:54 -0800 Subject: [PATCH] various matches / cleanup (#2271) * cleanup various TUs * checkpoint * d_attention doc --- config/GZ2E01/splits.txt | 3 +- configure.py | 8 +- include/JSystem/J3DGraphBase/J3DShape.h | 2 +- include/JSystem/JGadget/linklist.h | 45 +- include/JSystem/JUtility/JUTConsole.h | 9 +- include/JSystem/JUtility/JUTException.h | 2 +- include/d/actor/d_a_swc00.h | 1 - include/d/d_attention.h | 48 +- include/d/d_msg_class.h | 40 +- include/dolphin/gf/GFPixel.h | 3 + include/dolphin/gx.h | 4 + include/m_Do/m_Do_ext.h | 6 +- src/JSystem/JFramework/JFWSystem.cpp | 90 +- src/JSystem/JGadget/linklist.cpp | 8 +- src/JSystem/JKernel/JKRDvdAramRipper.cpp | 10 +- src/JSystem/JMessage/control.cpp | 9 +- src/JSystem/JMessage/locale.cpp | 10 +- src/JSystem/JMessage/processor.cpp | 19 +- src/JSystem/JMessage/resource.cpp | 7 +- src/JSystem/JStudio/JStudio/ctb.cpp | 9 +- src/JSystem/JStudio/JStudio/functionvalue.cpp | 19 +- src/JSystem/JStudio/JStudio/fvb.cpp | 12 +- src/JSystem/JStudio/JStudio/jstudio-math.cpp | 19 +- .../JStudio/JStudio/jstudio-object.cpp | 67 +- src/JSystem/JStudio/JStudio/stb.cpp | 18 +- .../JStudio/JStudio_JStage/object-actor.cpp | 17 +- .../JStudio/JStudio_JStage/object-light.cpp | 18 +- src/JSystem/JUtility/JUTAssert.cpp | 5 +- src/JSystem/JUtility/JUTConsole.cpp | 165 +-- src/JSystem/JUtility/JUTException.cpp | 308 ++--- .../JUtility/JUTFontData_Ascfont_fix12.cpp | 4 +- src/JSystem/JUtility/JUTXfb.cpp | 15 +- src/d/actor/d_a_balloon_2D.cpp | 15 +- src/d/actor/d_a_bg.cpp | 37 +- src/d/actor/d_a_bg_obj.cpp | 35 +- src/d/actor/d_a_e_ym.cpp | 78 +- src/d/actor/d_a_grass.cpp | 8 +- src/d/actor/d_a_kytag13.cpp | 25 +- src/d/actor/d_a_obj_bosswarp.cpp | 8 +- src/d/actor/d_a_obj_carry.cpp | 32 +- src/d/actor/d_a_obj_crope.cpp | 15 +- src/d/actor/d_a_obj_dmelevator.cpp | 7 - src/d/actor/d_a_obj_fmobj.cpp | 11 +- src/d/actor/d_a_obj_hbombkoya.cpp | 8 +- src/d/actor/d_a_obj_ice_l.cpp | 15 +- src/d/actor/d_a_obj_item.cpp | 9 +- src/d/actor/d_a_obj_lv4CandleDemoTag.cpp | 8 +- src/d/actor/d_a_obj_master_sword.cpp | 16 +- src/d/actor/d_a_obj_swBallA.cpp | 15 +- src/d/actor/d_a_obj_swBallB.cpp | 7 +- src/d/actor/d_a_obj_zrTurara.cpp | 9 +- src/d/actor/d_a_scene_exit.cpp | 10 +- src/d/actor/d_a_swc00.cpp | 10 +- src/d/actor/d_a_tag_wljump.cpp | 114 +- src/d/actor/d_a_vrbox2.cpp | 16 +- src/d/actor/d_grass.inc | 36 +- src/d/d_attention.cpp | 817 ++++++------- src/d/d_msg_class.cpp | 1010 +++++++---------- src/d/d_msg_scrn_talk.cpp | 8 +- src/d/d_msg_unit.cpp | 10 +- src/d/d_npc_lib.cpp | 12 +- src/m_Do/m_Do_ext.cpp | 729 ++++++++++-- 62 files changed, 1865 insertions(+), 2265 deletions(-) diff --git a/config/GZ2E01/splits.txt b/config/GZ2E01/splits.txt index cbb0830cb25..1adfa5bf152 100644 --- a/config/GZ2E01/splits.txt +++ b/config/GZ2E01/splits.txt @@ -2580,7 +2580,7 @@ JSystem/JUtility/JUTException.cpp: .rodata start:0x8039D490 end:0x8039D9A0 .data start:0x803CC620 end:0x803CC6B8 .bss start:0x80434578 end:0x80434870 - .sdata start:0x804508F0 end:0x80450900 + .sdata start:0x804508F0 end:0x804508F8 .sbss start:0x80451508 end:0x80451528 .sdata2 start:0x80456050 end:0x80456060 @@ -2594,6 +2594,7 @@ JSystem/JUtility/JUTDirectPrint.cpp: JSystem/JUtility/JUTAssert.cpp: .text start:0x802E495C end:0x802E4C54 .bss start:0x80434870 end:0x804349B0 + .sdata start:0x804508F8 end:0x80450900 .sbss start:0x80451530 end:0x80451538 .sdata2 start:0x804560B8 end:0x804560D0 diff --git a/configure.py b/configure.py index 8ccbe2ae26a..e71456304fa 100644 --- a/configure.py +++ b/configure.py @@ -668,7 +668,7 @@ config.libs = [ JSystemLib( "JFramework", [ - Object(NonMatching, "JSystem/JFramework/JFWSystem.cpp"), + Object(Equivalent, "JSystem/JFramework/JFWSystem.cpp"), Object(Matching, "JSystem/JFramework/JFWDisplay.cpp"), ], ), @@ -943,14 +943,14 @@ config.libs = [ Object(Matching, "JSystem/JUtility/JUTResFont.cpp", extra_cflags=['-pragma "nosyminline off"']), Object(Matching, "JSystem/JUtility/JUTDbPrint.cpp"), Object(Matching, "JSystem/JUtility/JUTGamePad.cpp"), - Object(NonMatching, "JSystem/JUtility/JUTException.cpp"), + Object(Matching, "JSystem/JUtility/JUTException.cpp"), Object(Matching, "JSystem/JUtility/JUTDirectPrint.cpp"), Object(Matching, "JSystem/JUtility/JUTAssert.cpp"), Object(Matching, "JSystem/JUtility/JUTVideo.cpp"), - Object(NonMatching, "JSystem/JUtility/JUTXfb.cpp"), + Object(Equivalent, "JSystem/JUtility/JUTXfb.cpp"), Object(Matching, "JSystem/JUtility/JUTFader.cpp"), Object(Matching, "JSystem/JUtility/JUTProcBar.cpp", extra_cflags=['-pragma "nosyminline off"']), - Object(NonMatching, "JSystem/JUtility/JUTConsole.cpp"), + Object(Matching, "JSystem/JUtility/JUTConsole.cpp"), Object(Matching, "JSystem/JUtility/JUTDirectFile.cpp"), Object(Matching, "JSystem/JUtility/JUTFontData_Ascfont_fix12.cpp"), ], diff --git a/include/JSystem/J3DGraphBase/J3DShape.h b/include/JSystem/J3DGraphBase/J3DShape.h index 512a8fe2891..91e9b4484af 100644 --- a/include/JSystem/J3DGraphBase/J3DShape.h +++ b/include/JSystem/J3DGraphBase/J3DShape.h @@ -127,7 +127,7 @@ public: GXVtxDescList* getVtxDesc() const { return mVtxDesc; } J3DMaterial* getMaterial() const { return mMaterial; } - u32 getIndex() const { return mIndex; } + u16 getIndex() const { return mIndex; } u32 getPipeline() const { return (mFlags >> 2) & 0x07; } u32 getTexMtxLoadType() const { return mFlags & 0xF000; } u32 getMtxGroupNum() const { return mMtxGroupNum; } diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h index 70a15a12763..4fb6a627dfe 100644 --- a/include/JSystem/JGadget/linklist.h +++ b/include/JSystem/JGadget/linklist.h @@ -22,24 +22,10 @@ struct TNodeLinkList { struct iterator { explicit iterator(TLinkListNode* pNode) { node = pNode; } - iterator& operator++() { - node = node->getNext(); - return *this; - } - iterator& operator--() { - node = node->getPrev(); - return *this; - } - iterator operator++(int) { - const iterator old(*this); - (void)++*this; - return old; - } - iterator operator--(int) { - const iterator old(*this); - (void)--*this; - return old; - } + iterator& operator++() { node = node->getNext(); return *this; } + iterator& operator--() { node = node->getPrev(); return *this; } + iterator operator++(int) { const iterator old(*this); (void)++*this; return old; } + iterator operator--(int) { const iterator old(*this); (void)--*this; return old; } friend bool operator==(iterator a, iterator b) { return a.node == b.node; } friend bool operator!=(iterator a, iterator b) { return !(a == b); } @@ -52,27 +38,12 @@ struct TNodeLinkList { struct const_iterator { explicit const_iterator(TLinkListNode* pNode) { node = pNode; } - const_iterator(const const_iterator& iter) { *this = iter; } explicit const_iterator(iterator it) { node = it.node; } - const_iterator& operator++() { - node = node->getNext(); - return *this; - } - const_iterator& operator--() { - node = node->getPrev(); - return *this; - } - const_iterator operator++(int) { - const const_iterator old(*this); - (void)++*this; - return old; - } - const_iterator operator--(int) { - const const_iterator old(*this); - (void)--*this; - return old; - } + const_iterator& operator++() { node = node->getNext(); return *this; } + const_iterator& operator--() { node = node->getPrev(); return *this; } + const_iterator operator++(int) { const const_iterator old(*this); (void)++*this; return old; } + const_iterator operator--(int) { const const_iterator old(*this); (void)--*this; return old; } friend bool operator==(const_iterator a, const_iterator b) { return a.node == b.node; } friend bool operator!=(const_iterator a, const_iterator b) { return !(a == b); } diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h index d454a2b14d5..233469b6529 100644 --- a/include/JSystem/JUtility/JUTConsole.h +++ b/include/JSystem/JUtility/JUTConsole.h @@ -93,7 +93,7 @@ public: void scrollToFirstLine() { scroll(-mMaxLines); } /* 0x18 */ JGadget::TLinkListNode mListNode; - /* 0x20 */ u32 field_0x20; + /* 0x20 */ unsigned int field_0x20; /* 0x24 */ int mMaxLines; /* 0x28 */ u8* mBuf; /* 0x2C */ bool field_0x2c; @@ -133,11 +133,16 @@ public: JUTConsole* getDirectConsole() const { return mDirectConsole; } - static JUTConsoleManager* getManager() { return sManager; } + static JUTConsoleManager* const getManager() { return sManager; } static JUTConsoleManager* sManager; +#ifdef __MWERKS__ typedef JGadget::TLinkList ConsoleList; +#else + // clangd does not support offsetof in template arguments. + typedef JGadget::TLinkList ConsoleList; +#endif private: /* 0x00 */ ConsoleList soLink_; diff --git a/include/JSystem/JUtility/JUTException.h b/include/JSystem/JUtility/JUTException.h index b9b6829ae26..3f568afd777 100644 --- a/include/JSystem/JUtility/JUTException.h +++ b/include/JSystem/JUtility/JUTException.h @@ -118,7 +118,7 @@ private: static OSMessageQueue sMessageQueue; static const char* sCpuExpName[17]; static JSUList sMapFileList; - static OSMessage sMessageBuffer[1 + 1 /* padding */]; + static OSMessage sMessageBuffer[1]; static JUTException* sErrorManager; static OSErrorHandler sPreUserCallback; static OSErrorHandler sPostUserCallback; diff --git a/include/d/actor/d_a_swc00.h b/include/d/actor/d_a_swc00.h index 51e918b7b0e..ffe22553bb8 100644 --- a/include/d/actor/d_a_swc00.h +++ b/include/d/actor/d_a_swc00.h @@ -21,7 +21,6 @@ public: /* 805A1A94 */ void actionEvent(); /* 805A1AF0 */ void actionDead(); -private: /* 0x568 */ cXyz field_0x568; /* 0x574 */ cXyz field_0x574; /* 0x580 */ u16 mEventID; diff --git a/include/d/d_attention.h b/include/d/d_attention.h index 958a9f36839..56898d10157 100644 --- a/include/d/d_attention.h +++ b/include/d/d_attention.h @@ -36,13 +36,10 @@ public: u8 getChangeItem() { return mChangeItem; } private: - /* 0x00 */ u32 field_0x0; + /* 0x00 */ fpc_ProcID mRequestActorID; /* 0x04 */ int field_0x4; - /* 0x08 */ f32 field_0x8; - /* 0x0C */ u8 field_0xc; - /* 0x0D */ u8 field_0xd; - /* 0x0E */ u8 field_0xe; - /* 0x0F */ u8 field_0xf; + /* 0x08 */ f32 mDistance; + /* 0x0C */ u8 mCatchItemNo; /* 0x10 */ fpc_ProcID mCatghTargetID; /* 0x14 */ u8 mChangeItem; }; // Size: 0x18 @@ -70,9 +67,18 @@ public: public: dAttParam_c() {} /* 80070038 */ dAttParam_c(s32); - /* 80070110 */ virtual ~dAttParam_c(); + enum EFlag { + EFlag_HOLD_MODE = (1 << 0), + EFlag_SWMODE_DEBUG = (1 << 1), + EFlag_VALID = (1 << 2), + EFlag_KEEP = (1 << 3), + EFlag_ARROW_OFF = (1 << 4), + EFlag_LIST_DEBUG = (1 << 14), + EFlag_MARGIN_DEBUG = (1 << 15), + }; + bool CheckFlag(u16 flag) { return mFlags & flag; } /* 0x40 vtable */ @@ -88,9 +94,9 @@ public: fopAc_ac_c* getLookTarget() { return convPId(mLookTargetID); } private: - u32 field_0x0; - s32 field_0x4; - f32 field_0x8; + fpc_ProcID mRequestActorID; + int field_0x4; + f32 mDistance; fpc_ProcID mLookTargetID; }; // Size: 0x10 @@ -129,12 +135,14 @@ public: /* 0x11C */ mDoExt_bpkAnm mImpactBpk; /* 0x134 */ mDoExt_brkAnm mImpactBrk; /* 0x14C */ mDoExt_btkAnm mImpactBtk; - /* 0x164 */ cXyz field_0x164; - /* 0x170 */ u8 field_0x170; - /* 0x171 */ u8 field_0x171; - /* 0x172 */ u8 field_0x172; + /* 0x164 */ f32 mCursorSizeX; + /* 0x168 */ f32 mCursorSizeY; + /* 0x16C */ f32 mCursorOffsetY; + /* 0x170 */ u8 mDrawType; + /* 0x171 */ u8 mAlphaAnmFrameMax; + /* 0x172 */ u8 mAlphaAnmFrame; /* 0x173 */ u8 field_0x173; - /* 0x174 */ u8 field_0x174; + /* 0x174 */ u8 mAlphaAnmPlayDirection; /* 0x175 */ u8 field_0x175; }; @@ -156,16 +164,16 @@ struct dist_entry { }; // Size: 0x1C struct type_tbl_entry { - s16 field_0x0; - u16 field_0x2; + s16 type; + u16 mask; }; class dAttention_c { public: enum EState { - ST_NONE, - ST_LOCK, - ST_RELEASE, + EState_NONE, + EState_LOCK, + EState_RELEASE, }; dAttention_c() {} diff --git a/include/d/d_msg_class.h b/include/d/d_msg_class.h index 7fb11c35fa5..fc3b3e9a8b4 100644 --- a/include/d/d_msg_class.h +++ b/include/d/d_msg_class.h @@ -63,13 +63,19 @@ struct jmessage_tReference : public JMessage::TReference { /* 802298DC */ bool isLightSend(); /* 8022994C */ bool isLightEnd(); /* 802299AC */ void decideOutFontRupeeColor(int); - /* 80232A20 */ cXyz getActorPos(); + /* 80232A20 */ cXyz getActorPos() { return mActorPos; } /* 80238C78 */ void setActorPos(cXyz pos) { mActorPos = pos; } bool isSelectSetCancelFlag() { return mSelectSetCancelFlag != 0; } BOOL isSelectRubyFlag(int i_flag) { - return mSelectRubyFlag & (u8)(1 << i_flag) ? 1 : 0; + BOOL var_r31; + if (mSelectRubyFlag & (u8)(1 << i_flag)) { + var_r31 = true; + } else { + var_r31 = false; + } + return var_r31; } bool isBatchFlag() { return mBatchFlag; } @@ -98,7 +104,7 @@ struct jmessage_tReference : public JMessage::TReference { void offSelectRubyFlag(int i_flag) { mSelectRubyFlag &= ~(u8)(1 << i_flag); } void setPageEndCount(s16 i_endCount) { mPageEndCount = i_endCount; } void onBombNameUseFlag() { mBombNameUseFlag = 1; } - void onSelectRubyFlag(int i_flag) { mSelectRubyFlag |= (1 << i_flag); } + void onSelectRubyFlag(int i_flag) { mSelectRubyFlag |= (u8)(1 << i_flag); } void setpStatus(u16* status) { mpStatus = status; } void setObjectPtr(dMsgObject_c* ptr) { mpObjectPtr = ptr; } void setCountBackUp() { mCharactor.mCountBackUp = mCharactor.field_0x40e; } @@ -140,6 +146,15 @@ struct jmessage_tReference : public JMessage::TReference { } } + void addLineLength(int param_0, f32 param_1, f32 param_2) { + mStrLength[param_0] += param_1; + mSpaceLength[param_0] += param_2; + } + + void addSelLength(int param_0, f32 param_1) { + mSelLength[param_0] += param_1; + } + dMsgObject_c* getObjectPtr() { return mpObjectPtr; } u8 getForm() { return mForm; } u8 getNowLightCount() { return mNowLightCount; } @@ -179,6 +194,9 @@ struct jmessage_tReference : public JMessage::TReference { u8 getFukiPosType() { return mFukiPosType; } u16 getStatus() { return *mpStatus; } u8 getArrange() { return mArrange; } + f32 getSelFontSize() { return mSelFontSize; } + f32 getSelCharSpace() { return mSelCharSpace; } + u16 getLineScale(int i_no) { return mLineScale[i_no]; } struct CharSoundInfo { u16 data[0x200]; @@ -186,7 +204,7 @@ struct jmessage_tReference : public JMessage::TReference { s16 field_0x40e; s16 mCountBackUp; }; - CharSoundInfo getCharSoundInfo() { return mCharactor;} + CharSoundInfo getCharSoundInfo() { return mCharactor; } u32 getDemoFrame() { return mDemoFrame; } u32 getRevoMessageID() { return mRevoMessageID; } f32 getCharAllAlphaRate() { return mCharAllAlphaRate; } @@ -296,9 +314,9 @@ struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor { /* 0x45 */ u8 mSelectType; /* 0x46 */ u8 field_0x46; /* 0x47 */ u8 field_0x47; - /* 0x48 */ s8 field_0x48; + /* 0x48 */ u8 field_0x48; /* 0x49 */ s8 field_0x49; - /* 0x4A */ u8 mPageLineMax; + /* 0x4A */ s8 mPageLineMax; /* 0x4B */ s8 field_0x4b; /* 0x4C */ u8 field_0x4c; /* 0x4D */ u8 field_0x4d; @@ -315,7 +333,7 @@ struct jmessage_tSequenceProcessor : public JMessage::TSequenceProcessor, /* 8022CB10 */ void messageSePlay(u8, u8, cXyz*); /* 8022CBE8 */ void calcStringLength(); - /* 8023299C */ virtual ~jmessage_tSequenceProcessor(); + /* 8023299C */ virtual ~jmessage_tSequenceProcessor() {} /* 8022B654 */ virtual void do_reset(); /* 8022B658 */ virtual void do_begin(void const*, char const*); /* 8022BA3C */ virtual void do_end(); @@ -379,7 +397,7 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor { /* 8022F734 */ void push_word(); /* 8022F784 */ void getCharInfo(f32, f32, f32, f32, f32); - /* 8023293C */ virtual ~jmessage_tRenderingProcessor(); + /* 8023293C */ virtual ~jmessage_tRenderingProcessor() {} /* 8022CDC8 */ virtual void do_reset(); /* 8022CDCC */ virtual void do_begin(void const*, char const*); /* 8022CFD8 */ virtual void do_end(); @@ -451,7 +469,7 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor { struct jmessage_string_tControl : public JMessage::TControl { /* 8022FB5C */ jmessage_string_tControl(); - /* 802328DC */ virtual ~jmessage_string_tControl(); + /* 802328DC */ virtual ~jmessage_string_tControl() {} }; struct jmessage_string_tReference : public JMessage::TReference { @@ -517,7 +535,7 @@ struct jmessage_string_tSequenceProcessor : public JMessage::TSequenceProcessor, /* 80230A08 */ jmessage_string_tSequenceProcessor(jmessage_string_tReference const*, jmessage_string_tControl*); - /* 80232858 */ virtual ~jmessage_string_tSequenceProcessor(); + /* 80232858 */ virtual ~jmessage_string_tSequenceProcessor() {} /* 80230ABC */ virtual void do_reset(); /* 80230AC0 */ virtual void do_begin(void const*, char const*); /* 80230B7C */ virtual void do_end(); @@ -545,7 +563,7 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso /* 802326E4 */ void do_numset(s16); /* 802327BC */ void push_word(char const*); - /* 802327F8 */ virtual ~jmessage_string_tRenderingProcessor(); + /* 802327F8 */ virtual ~jmessage_string_tRenderingProcessor() {} /* 80230C5C */ virtual void do_reset(); /* 80230CA0 */ virtual void do_begin(void const*, char const*); /* 80230CE8 */ virtual void do_end(); diff --git a/include/dolphin/gf/GFPixel.h b/include/dolphin/gf/GFPixel.h index bffbc6a7db5..8af003ea828 100644 --- a/include/dolphin/gf/GFPixel.h +++ b/include/dolphin/gf/GFPixel.h @@ -5,5 +5,8 @@ void GFSetFog(GXFogType param_0, f32 param_1, f32 param_2, f32 param_3, f32 param_4, GXColor param_5); +void GFSetBlendModeEtc(GXBlendMode param_0, GXBlendFactor param_1, GXBlendFactor param_2, + GXLogicOp param_3, u8 param_4, u8 param_5, u8 param_6); +void GFSetZMode(u8 param_0, GXCompare param_1, u8 param_2); #endif /* GFPIXEL_H */ diff --git a/include/dolphin/gx.h b/include/dolphin/gx.h index 8dc15f688ea..b9fa1486d93 100644 --- a/include/dolphin/gx.h +++ b/include/dolphin/gx.h @@ -111,6 +111,10 @@ static inline void GXNormal3f32(const f32 x, const f32 y, const f32 z) { GXWGFifo.f32 = z; } +static inline void GXNormal1x16(const u16 x) { + GXWGFifo.u16 = x; +} + static inline void GXPosition2f32(const f32 x, const f32 z) { GXWGFifo.f32 = x; GXWGFifo.f32 = z; diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 1e0cc7f4e32..36788aad6b5 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -375,7 +375,7 @@ public: /* 80011348 */ mDoExt_McaMorf2(J3DModelData*, mDoExt_McaMorfCallBack1_c*, mDoExt_McaMorfCallBack2_c*, J3DAnmTransform*, J3DAnmTransform*, int, f32, int, int, Z2Creature*, u32, u32); - /* 80011464 */ void create(J3DModelData*, mDoExt_McaMorfCallBack1_c*, + /* 80011464 */ int create(J3DModelData*, mDoExt_McaMorfCallBack1_c*, mDoExt_McaMorfCallBack2_c*, J3DAnmTransform*, J3DAnmTransform*, int, f32, int, int, Z2Creature*, u32, u32); /* 800116B4 */ void ERROR_EXIT(); @@ -479,14 +479,14 @@ STATIC_ASSERT(sizeof(mDoExt_MtxCalcAnmBlendTblOld) == 0x10); class mDoExt_3Dline_c { public: - /* 800123D0 */ void init(u16, int, int); + /* 800123D0 */ int init(u16, int, int); /* 800126BC */ mDoExt_3Dline_c(); /* 0x00 */ cXyz* field_0x0; /* 0x04 */ f32* field_0x4; /* 0x08 */ cXyz* field_0x8; /* 0x0C */ cXyz* field_0xc; - /* 0x10 */ void* field_0x10; + /* 0x10 */ u8* field_0x10; /* 0x14 */ void* field_0x14; /* 0x18 */ f32* field_0x18; /* 0x1C */ f32* field_0x1c; diff --git a/src/JSystem/JFramework/JFWSystem.cpp b/src/JSystem/JFramework/JFWSystem.cpp index 03c2f014d82..283804f3ac4 100644 --- a/src/JSystem/JFramework/JFWSystem.cpp +++ b/src/JSystem/JFramework/JFWSystem.cpp @@ -15,70 +15,14 @@ #include "JSystem/JUtility/JUTException.h" #include "JSystem/JUtility/JUTResFont.h" #include "JSystem/JUtility/JUTDbPrint.h" -#include "dol2asm.h" -#include "dolphin/types.h" -// -// Forward References: -// +extern u8 const JUTResFONT_Ascfont_fix12[16736]; -extern "C" void firstInit__9JFWSystemFv(); -extern "C" void init__9JFWSystemFv(); -extern "C" u32 maxStdHeaps__Q29JFWSystem11CSetUpParam; -extern "C" u32 sysHeapSize__Q29JFWSystem11CSetUpParam; -extern "C" u32 fifoBufSize__Q29JFWSystem11CSetUpParam; -extern "C" u32 aramAudioBufSize__Q29JFWSystem11CSetUpParam; -extern "C" u32 aramGraphBufSize__Q29JFWSystem11CSetUpParam; -extern "C" u32 streamPriority__Q29JFWSystem11CSetUpParam; -extern "C" u32 decompPriority__Q29JFWSystem11CSetUpParam; -extern "C" u32 aPiecePriority__Q29JFWSystem11CSetUpParam; -extern "C" void* systemFontRes__Q29JFWSystem11CSetUpParam; -extern "C" void* renderMode__Q29JFWSystem11CSetUpParam; -extern "C" u32 exConsoleBufferSize__Q29JFWSystem11CSetUpParam[1 + 1 /* padding */]; -extern "C" u8 rootHeap__9JFWSystem[4]; -extern "C" u8 systemHeap__9JFWSystem[4]; -extern "C" u8 mainThread__9JFWSystem[4]; -extern "C" u8 debugPrint__9JFWSystem[4]; -extern "C" u8 systemFont__9JFWSystem[4]; -extern "C" u8 systemConsoleManager__9JFWSystem[4]; -extern "C" u8 systemConsole__9JFWSystem[4]; - -// -// External References: -// - -extern "C" void alloc__7JKRHeapFUli(); -extern "C" void* __nw__FUl(); -extern "C" void createRoot__10JKRExpHeapFib(); -extern "C" void create__10JKRExpHeapFUlP7JKRHeapb(); -extern "C" void __ct__9JKRThreadFP8OSThreadi(); -extern "C" void create__7JKRAramFUlUllll(); -extern "C" void __ct__12JUTGraphFifoFUl(); -extern "C" void __ct__10JUTResFontFPC7ResFONTP7JKRHeap(); -extern "C" void start__10JUTDbPrintFP7JUTFontP7JKRHeap(); -extern "C" void changeFont__10JUTDbPrintFP7JUTFont(); -extern "C" void init__10JUTGamePadFv(); -extern "C" void create__12JUTExceptionFP14JUTDirectPrint(); -extern "C" void createConsole__12JUTExceptionFPvUl(); -extern "C" void start__14JUTDirectPrintFv(); -extern "C" void create__12JUTAssertionFv(); -extern "C" void createManager__8JUTVideoFPC16_GXRenderModeObj(); -extern "C" void create__10JUTConsoleFUiUiP7JKRHeap(); -extern "C" void createManager__17JUTConsoleManagerFP7JKRHeap(); -extern "C" void OSInit(); -extern "C" void DVDInit(); -extern "C" extern u8 const JUTResFONT_Ascfont_fix12[16736]; - -// -// Declarations: -// - -/* ############################################################################################## */ /* 80450770-80450774 0001F0 0004+00 1/1 1/1 0/0 .sdata maxStdHeaps__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA s32 JFWSystem::CSetUpParam::maxStdHeaps = 2; +s32 JFWSystem::CSetUpParam::maxStdHeaps = 2; /* 80450774-80450778 0001F4 0004+00 1/1 1/1 0/0 .sdata sysHeapSize__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::sysHeapSize = 0x400000; +u32 JFWSystem::CSetUpParam::sysHeapSize = 0x400000; /* 804511A0-804511A4 0006A0 0004+00 2/2 0/0 0/0 .sbss rootHeap__9JFWSystem */ JKRExpHeap* JFWSystem::rootHeap; @@ -94,40 +38,38 @@ void JFWSystem::firstInit() { systemHeap = JKRExpHeap::create(CSetUpParam::sysHeapSize, rootHeap, false); } -/* ############################################################################################## */ /* 80450778-8045077C 0001F8 0004+00 1/1 1/1 0/0 .sdata fifoBufSize__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::fifoBufSize = 0x40000; +u32 JFWSystem::CSetUpParam::fifoBufSize = 0x40000; /* 8045077C-80450780 0001FC 0004+00 1/1 1/1 0/0 .sdata aramAudioBufSize__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::aramAudioBufSize = 0x800000; +u32 JFWSystem::CSetUpParam::aramAudioBufSize = 0x800000; /* 80450780-80450784 000200 0004+00 1/1 1/1 0/0 .sdata aramGraphBufSize__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::aramGraphBufSize = 0x600000; +u32 JFWSystem::CSetUpParam::aramGraphBufSize = 0x600000; /* 80450784-80450788 000204 0004+00 1/1 0/0 0/0 .sdata streamPriority__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::streamPriority = 8; +u32 JFWSystem::CSetUpParam::streamPriority = 8; /* 80450788-8045078C 000208 0004+00 1/1 0/0 0/0 .sdata decompPriority__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::decompPriority = 7; +u32 JFWSystem::CSetUpParam::decompPriority = 7; /* 8045078C-80450790 00020C 0004+00 1/1 0/0 0/0 .sdata aPiecePriority__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::aPiecePriority = 6; +u32 JFWSystem::CSetUpParam::aPiecePriority = 6; /* 80450790-80450794 -00001 0004+00 1/1 0/0 0/0 .sdata systemFontRes__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA ResFONT* JFWSystem::CSetUpParam::systemFontRes = (ResFONT*)&JUTResFONT_Ascfont_fix12; +ResFONT* JFWSystem::CSetUpParam::systemFontRes = (ResFONT*)&JUTResFONT_Ascfont_fix12; /* 80450794-80450798 -00001 0004+00 1/1 1/1 0/0 .sdata renderMode__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = - (GXRenderModeObj*)&GXNtsc480IntDf; +GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = &GXNtsc480IntDf; /* 80450798-804507A0 000218 0004+04 1/1 0/0 0/0 .sdata * exConsoleBufferSize__Q29JFWSystem11CSetUpParam */ -SECTION_SDATA u32 JFWSystem::CSetUpParam::exConsoleBufferSize = 0x24FC; +u32 JFWSystem::CSetUpParam::exConsoleBufferSize = 0x24FC; /* 804511A8-804511AC 0006A8 0004+00 1/1 0/0 0/0 .sbss mainThread__9JFWSystem */ JKRThread* JFWSystem::mainThread; @@ -148,7 +90,7 @@ JUTConsole* JFWSystem::systemConsole; static u8 sInitCalled; /* 80271D18-80272040 26C658 0328+00 0/0 1/1 0/0 .text init__9JFWSystemFv */ -// NONMATCHING - just regalloc in the beginning +// NONMATCHING - regalloc, equivalent void JFWSystem::init() { if (rootHeap == NULL) { firstInit(); @@ -161,9 +103,7 @@ void JFWSystem::init() { mainThread = new JKRThread(OSGetCurrentThread(), 4); JUTVideo::createManager(CSetUpParam::renderMode); - - u32 fifoSize = CSetUpParam::fifoBufSize; - JUTGraphFifo* fifo = new JUTGraphFifo(fifoSize); + JUTCreateFifo(CSetUpParam::fifoBufSize); JUTGamePad::init(); @@ -199,4 +139,4 @@ void JFWSystem::init() { void* buffer = systemHeap->alloc(CSetUpParam::exConsoleBufferSize, 4); JUTException::createConsole(buffer, CSetUpParam::exConsoleBufferSize); -} \ No newline at end of file +} diff --git a/src/JSystem/JGadget/linklist.cpp b/src/JSystem/JGadget/linklist.cpp index ca42335e241..0c23895a880 100644 --- a/src/JSystem/JGadget/linklist.cpp +++ b/src/JSystem/JGadget/linklist.cpp @@ -119,13 +119,7 @@ JGadget::TNodeLinkList::iterator JGadget::TNodeLinkList::Erase(TLinkListNode* p) /* 802DCBF8-802DCCC8 2D7538 00D0+00 0/0 2/2 0/0 .text * Remove__Q27JGadget13TNodeLinkListFPQ27JGadget13TLinkListNode */ -// missing stack -#ifdef NONMATCHING +// NONMATCHING - missing stack void JGadget::TNodeLinkList::Remove(TLinkListNode* p) { remove_if(TPRIsEqual_pointer_(p)); } -#else -void JGadget::TNodeLinkList::Remove(JGadget::TLinkListNode* param_0) { - // NONMATCHING -} -#endif \ No newline at end of file diff --git a/src/JSystem/JKernel/JKRDvdAramRipper.cpp b/src/JSystem/JKernel/JKRDvdAramRipper.cpp index b5c370cc23b..e62baa67140 100644 --- a/src/JSystem/JKernel/JKRDvdAramRipper.cpp +++ b/src/JSystem/JKernel/JKRDvdAramRipper.cpp @@ -518,8 +518,7 @@ static u8* firstSrcData() { } /* 802DB49C-802DB580 2D5DDC 00E4+00 1/1 0/0 0/0 .text nextSrcData__FPUc */ -// regalloc -#ifdef NONMATCHING +// NONMATCHING - regalloc static u8* nextSrcData(u8* src) { u8* dest; u32 size = szpEnd - src; @@ -547,11 +546,6 @@ static u8* nextSrcData(u8* src) { } return dest; } -#else -static u8* nextSrcData(u8* param_0) { - // NONMATCHING -} -#endif /* 802DB580-802DB5E8 2D5EC0 0068+00 1/1 0/0 0/0 .text dmaBufferFlush__FUl */ static u32 dmaBufferFlush(u32 param_1) { @@ -562,4 +556,4 @@ static u32 dmaBufferFlush(u32 param_1) { JKRAramPiece::orderSync(0, (u32)dmaBuf, param_1, size, NULL); dmaCurrent = dmaBuf; return size; -} \ No newline at end of file +} diff --git a/src/JSystem/JMessage/control.cpp b/src/JSystem/JMessage/control.cpp index e3597c15b4c..4df07dd994d 100644 --- a/src/JSystem/JMessage/control.cpp +++ b/src/JSystem/JMessage/control.cpp @@ -66,7 +66,7 @@ int JMessage::TControl::update() { } /* 802A76BC-802A77E8 2A1FFC 012C+00 0/0 5/5 0/0 .text render__Q28JMessage8TControlFv */ -#ifdef NONMATCHING +// NONMATCHING void JMessage::TControl::render() { if (isReady_render_()) { pRenderingProcessor_->setBegin_messageEntryText(pResourceCache_, pEntry_, field_0x20); @@ -74,11 +74,6 @@ void JMessage::TControl::render() { pRenderingProcessor_->process(pszText_update_current_); } } -#else -void JMessage::TControl::render() { - // NONMATCHING -} -#endif /* 802A77E8-802A78F4 2A2128 010C+00 0/0 1/1 0/0 .text setMessageCode__Q28JMessage8TControlFUsUs */ int JMessage::TControl::setMessageCode(u16 param_0, u16 param_1) { @@ -114,4 +109,4 @@ bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* field_0x20 = pMessageText_begin_; oStack_renderingProcessor_.clear(); return true; -} \ No newline at end of file +} diff --git a/src/JSystem/JMessage/locale.cpp b/src/JSystem/JMessage/locale.cpp index 106d87f419c..ad40686faab 100644 --- a/src/JSystem/JMessage/locale.cpp +++ b/src/JSystem/JMessage/locale.cpp @@ -4,6 +4,7 @@ // #include "JSystem/JMessage/locale.h" +#include // // Forward References: @@ -22,7 +23,7 @@ extern "C" void parseCharacter_UTF8__Q28JMessage6localeFPPCc(); /* 802A9528-802A958C 2A3E68 0064+00 0/0 1/0 0/0 .text * parseCharacter_ShiftJIS__Q28JMessage6localeFPPCc */ -#ifdef NONMATCHING +// NONMATCHING int JMessage::locale::parseCharacter_ShiftJIS(char const** str) { int c; int ret; @@ -43,14 +44,9 @@ int JMessage::locale::parseCharacter_ShiftJIS(char const** str) { return ret; } -#else -int JMessage::locale::parseCharacter_ShiftJIS(char const** param_0) { - // NONMATCHING -} -#endif /* 802A958C-802A968C 2A3ECC 0100+00 0/0 1/0 0/0 .text parseCharacter_UTF8__Q28JMessage6localeFPPCc */ int JMessage::locale::parseCharacter_UTF8(char const** param_0) { // NONMATCHING -} \ No newline at end of file +} diff --git a/src/JSystem/JMessage/processor.cpp b/src/JSystem/JMessage/processor.cpp index 068045f4cf4..fe33fcddd71 100644 --- a/src/JSystem/JMessage/processor.cpp +++ b/src/JSystem/JMessage/processor.cpp @@ -5,6 +5,7 @@ #include "JSystem/JMessage/processor.h" #include "JSystem/JMessage/control.h" +#include "JSystem/JUtility/JUTAssert.h" // // Forward References: @@ -151,8 +152,7 @@ const JMessage::TResource* JMessage::TProcessor::getResource_groupID(u16 groupID /* 802A7CD4-802A7E38 2A2614 0164+00 0/0 1/1 0/0 .text * toMessageCode_messageID__Q28JMessage10TProcessorCFUlUlPb */ -// TContainerEnumerator_const stack issues -#ifdef NONMATCHING +// NONMATCHING - TContainerEnumerator_const stack issues u32 JMessage::TProcessor::toMessageCode_messageID(u32 param_0, u32 param_1, bool* param_2) const { const TResource* this_00 = getResourceCache(); @@ -177,12 +177,6 @@ u32 JMessage::TProcessor::toMessageCode_messageID(u32 param_0, u32 param_1, } return -1; } -#else -u32 JMessage::TProcessor::toMessageCode_messageID(u32 param_0, u32 param_1, - bool* param_2) const { - // NONMATCHING -} -#endif /* 802A7E38-802A7EDC 2A2778 00A4+00 1/1 0/0 0/0 .text * on_select_begin__Q28JMessage10TProcessorFPFPQ28JMessage10TProcessor_PCcPCvPCcUl */ @@ -611,18 +605,13 @@ void JMessage::TSequenceProcessor::do_tag_(u32 uTag, void const* data, u32 uSize /* 802A892C-802A8944 2A326C 0018+00 1/1 0/0 0/0 .text * process_setMessageIndex_reserved___Q28JMessage18TSequenceProcessorFUs */ -#ifdef NONMATCHING +// NONMATCHING void JMessage::TSequenceProcessor::process_setMessageIndex_reserved_(u16 u16Index) { JUT_ASSERT(890, u16Index >= 0xff00); if (u16Index != -1) { return; } } -#else -void JMessage::TSequenceProcessor::process_setMessageIndex_reserved_(u16 param_0) { - // NONMATCHING -} -#endif /* 802A8944-802A89B8 2A3284 0074+00 4/4 0/0 0/0 .text * process_setMessageCode___Q28JMessage18TSequenceProcessorFPCQ28JMessage18TSequenceProcessorUsUs */ @@ -750,4 +739,4 @@ const char* JMessage::TProcessor::on_message(u32 param_0) const { * getMessageText_messageCode__Q28JMessage10TProcessorCFUl */ const char* JMessage::TProcessor::getMessageText_messageCode(u32 param_0) const { return getMessageText_messageCode(param_0 >> 0x10, param_0 & 0xFFFF); -} \ No newline at end of file +} diff --git a/src/JSystem/JMessage/resource.cpp b/src/JSystem/JMessage/resource.cpp index aaf809ba816..7c829f5ab73 100644 --- a/src/JSystem/JMessage/resource.cpp +++ b/src/JSystem/JMessage/resource.cpp @@ -247,7 +247,7 @@ JMessage::TParse::~TParse() {} /* 802A91B8-802A92F4 2A3AF8 013C+00 1/0 0/0 0/0 .text * parseHeader_next__Q28JMessage6TParseFPPCvPUlUl */ -#ifdef NONMATCHING +// NONMATCHING bool JMessage::TParse::parseHeader_next(void const** ppData_inout, u32* puBlock_out, u32 param_2) { const void* pData = *ppData_inout; @@ -287,11 +287,6 @@ bool JMessage::TParse::parseHeader_next(void const** ppData_inout, u32* puBlock_ return 1; } } -#else -bool JMessage::TParse::parseHeader_next(void const** param_0, u32* param_1, u32 param_2) { - // NONMATCHING -} -#endif /* 802A92F4-802A9490 2A3C34 019C+00 1/0 0/0 0/0 .text * parseBlock_next__Q28JMessage6TParseFPPCvPUlUl */ diff --git a/src/JSystem/JStudio/JStudio/ctb.cpp b/src/JSystem/JStudio/JStudio/ctb.cpp index 9644dc978ad..f24235d5f5b 100644 --- a/src/JSystem/JStudio/JStudio/ctb.cpp +++ b/src/JSystem/JStudio/JStudio/ctb.cpp @@ -7,6 +7,7 @@ #include "iterator.h" #include "string.h" #include "dol2asm.h" +#include // // Types: @@ -166,8 +167,7 @@ void JStudio::ctb::TControl::destroyObject_all() { } /* 80281190-80281230 27BAD0 00A0+00 1/1 0/0 0/0 .text getObject__Q37JStudio3ctb8TControlFPCvUl */ -// TPRObject_ID_equal issues -#ifdef NONMATCHING +// NONMATCHING - TPRObject_ID_equal issues JStudio::ctb::TObject* JStudio::ctb::TControl::getObject(void const* param_0, u32 param_1) { JGadget::TLinkList::iterator begin = mList.begin(); JGadget::TLinkList::iterator end = mList.end(); @@ -177,11 +177,6 @@ JStudio::ctb::TObject* JStudio::ctb::TControl::getObject(void const* param_0, u3 } return NULL; } -#else -JStudio::ctb::TObject* JStudio::ctb::TControl::getObject(void const* param_0, u32 param_1) { - // NONMATCHING -} -#endif /* 80281230-80281274 27BB70 0044+00 0/0 1/1 0/0 .text getObject_index__Q37JStudio3ctb8TControlFUl */ diff --git a/src/JSystem/JStudio/JStudio/functionvalue.cpp b/src/JSystem/JStudio/JStudio/functionvalue.cpp index 4c6095c7a0e..584bdd0e7a7 100644 --- a/src/JSystem/JStudio/JStudio/functionvalue.cpp +++ b/src/JSystem/JStudio/JStudio/functionvalue.cpp @@ -392,8 +392,7 @@ f64 interpolateValue_hermite(f64 c0, f64 c1, f64 x, f64 c2, f64 x2, f64 c3, f64 /* 80281774-802817D8 27C0B4 0064+00 1/1 0/0 0/0 .text * interpolateValue_BSpline_uniform__Q27JStudio13functionvalueFddddd */ -// really minor regalloc. -#ifdef NONMATCHING +// NONMATCHING - really minor regalloc. f64 interpolateValue_BSpline_uniform(f64 f1, f64 f2, f64 f3, f64 f4, f64 f5) { // pow3(1.0 - f1) f64 f6 = (1.0 - f1); @@ -412,12 +411,6 @@ f64 interpolateValue_BSpline_uniform(f64 f1, f64 f2, f64 f3, f64 f4, f64 f5) { return temp5 + (temp * f2 + f8 * f5) * 0.5 + temp3; } -#else -f64 interpolateValue_BSpline_uniform(f64 param_0, f64 param_1, f64 param_2, f64 param_3, - f64 param_4) { - // NONMATCHING -} -#endif /* 802817D8-802818B8 27C118 00E0+00 1/1 0/0 0/0 .text * interpolateValue_BSpline_nonuniform__Q27JStudio13functionvalueFdPCdPCd */ @@ -790,8 +783,7 @@ void TFunctionValue_transition::prepare() { /* 802824F4-802826BC 27CE34 01C8+00 1/0 0/0 0/0 .text * getValue__Q27JStudio25TFunctionValue_transitionFd */ -// regalloc. Maybe return value related. -#ifdef NONMATCHING +// NONMATCHING - regalloc. Maybe return value related. f64 TFunctionValue_transition::getValue(f64 param_1) { f64 progress = range_getParameter_progress(param_1); f64 dVar3 = range_getParameter_outside(progress); @@ -830,11 +822,6 @@ f64 TFunctionValue_transition::getValue(f64 param_1) { } } } -#else -f64 TFunctionValue_transition::getValue(f64 param_0) { - // NONMATCHING -} -#endif TFunctionValue_list::TFunctionValue_list() : _44(NULL), uData_(0), _50(NAN), pfnUpdate_(NULL) {} @@ -1307,4 +1294,4 @@ extern "C" void func_802838C8(void* _this, JStudio::TFunctionValue_hermite::TIterator_data_ param_2, f64 const& param_3, std::less param_4) { // NONMATCHING -} \ No newline at end of file +} diff --git a/src/JSystem/JStudio/JStudio/fvb.cpp b/src/JSystem/JStudio/JStudio/fvb.cpp index ec4d0b7cb24..562560d2b69 100644 --- a/src/JSystem/JStudio/JStudio/fvb.cpp +++ b/src/JSystem/JStudio/JStudio/fvb.cpp @@ -302,7 +302,7 @@ namespace fvb { TObject::~TObject() {} -#ifdef NONMATCHING +// NONMATCHING void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { ASSERT(pfv_ != 0); @@ -449,14 +449,6 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { JUT_EXPECT(pData == pNext); pfv_->prepare(); } -#else -/* 80283FC8-802841EC 27E908 0224+00 2/1 0/0 0/0 .text - * prepare__Q37JStudio3fvb7TObjectFRCQ47JStudio3fvb4data13TParse_TBlockPQ37JStudio3fvb8TControl */ -void TObject::prepare(data::TParse_TBlock const& param_0, TControl* param_1) { - // NONMATCHING -} - -#endif namespace { TFunctionValue_composite::TData getCompositeData_raw_(const void* arg1) { @@ -790,4 +782,4 @@ bool TParse::parseBlock_next(void const** ppData_inout, u32* puData_out, u32 fla } } // namespace fvb -} // namespace JStudio \ No newline at end of file +} // namespace JStudio diff --git a/src/JSystem/JStudio/JStudio/jstudio-math.cpp b/src/JSystem/JStudio/JStudio/jstudio-math.cpp index 00ff6216c1c..81a876131b0 100644 --- a/src/JSystem/JStudio/JStudio/jstudio-math.cpp +++ b/src/JSystem/JStudio/JStudio/jstudio-math.cpp @@ -4,6 +4,8 @@ // #include "JSystem/JStudio/JStudio/jstudio-math.h" +#include "JSystem/JGeometry.h" +#include "JSystem/TPosition3.hh" #include "dol2asm.h" #include "math.h" @@ -41,8 +43,7 @@ SECTION_SDATA2 static u8 lit_489[4] = { }; /* 802859DC-80285B44 28031C 0168+00 1/1 0/0 0/0 .text getRotation_xyz__Q27JStudio4mathFPA4_ffff */ -// regalloc -#ifdef NONMATCHING +// NONMATCHING - regalloc void JStudio::math::getRotation_xyz(MtxP param_1, f32 x, f32 y, f32 z) { x = DEG_TO_RAD(x); f32 cosx = cos(x); @@ -71,11 +72,6 @@ void JStudio::math::getRotation_xyz(MtxP param_1, f32 x, f32 y, f32 z) { param_1[1][3] = 0.0f; param_1[2][3] = 0.0f; } -#else -void JStudio::math::getRotation_xyz(MtxP param_0, f32 param_1, f32 param_2, f32 param_3) { - // NONMATCHING -} -#endif /* 80285B44-80285BCC 280484 0088+00 0/0 2/2 0/0 .text * getTransformation_SRxyzT__Q27JStudio4mathFPA4_fRC3VecRC3VecRC3Vec */ @@ -115,8 +111,7 @@ SECTION_SDATA2 static f64 lit_628 = 57.29577951308232; /* 80285BCC-80285E0C 28050C 0240+00 0/0 2/2 0/0 .text * getFromTransformation_SRxyzT__Q27JStudio4mathFP3VecP3VecP3VecPA4_Cf */ -// getEulerXYZ is not inlined -#ifdef NONMATCHING +// NONMATCHING - getEulerXYZ is not inlined void JStudio::math::getFromTransformation_SRxyzT(Vec* param_1, Vec* param_2, Vec* param_3, CMtxP param_4) { getFromTransformation_S(param_4, param_1); @@ -145,9 +140,3 @@ void JStudio::math::getFromTransformation_SRxyzT(Vec* param_1, Vec* param_2, Vec param_2->y = local_a0.y; param_2->z = local_a0.z; } -#else -void JStudio::math::getFromTransformation_SRxyzT(Vec* param_0, Vec* param_1, Vec* param_2, - CMtxP param_3) { - // NONMATCHING -} -#endif \ No newline at end of file diff --git a/src/JSystem/JStudio/JStudio/jstudio-object.cpp b/src/JSystem/JStudio/JStudio/jstudio-object.cpp index bba128613e6..f021932f035 100644 --- a/src/JSystem/JStudio/JStudio/jstudio-object.cpp +++ b/src/JSystem/JStudio/JStudio/jstudio-object.cpp @@ -1589,19 +1589,13 @@ void JStudio::TObject::forward_value(u32 param_0) { } /* 8028679C-802867D4 2810DC 0038+00 9/0 0/0 0/0 .text do_begin__Q27JStudio7TObjectFv */ -#ifdef NONMATCHING +// NONMATCHING void JStudio::TObject::do_begin() { TAdaptor* adaptor = getAdaptor(); if (adaptor != NULL) { adaptor->adaptor_do_begin(); } } -#else -// void JStudio::TObject::do_begin() { -extern "C" void do_begin__Q27JStudio7TObjectFv() { - // NONMATCHING -} -#endif /* 802867D4-8028680C 281114 0038+00 9/0 0/0 0/0 .text do_end__Q27JStudio7TObjectFv */ void JStudio::TObject::do_end() { @@ -1633,14 +1627,9 @@ JStudio::TObject::TObject(JStudio::stb::data::TParse_TBlock_object const& param_ /* 802868B0-80286910 2811F0 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio14TAdaptor_actorFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_actor::~TAdaptor_actor() { } -#else -JStudio::TAdaptor_actor::~TAdaptor_actor() { - // NONMATCHING -} -#endif /* 80286910-8028694C 281250 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio13TObject_actorFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio14TAdaptor_actor @@ -1686,13 +1675,8 @@ void JStudio::TObject_actor::do_paragraph(u32 param_0, void const* param_1, u32 } /* 80286C9C-80286CFC 2815DC 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio21TAdaptor_ambientLightFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_ambientLight::~TAdaptor_ambientLight() {} -#else -JStudio::TAdaptor_ambientLight::~TAdaptor_ambientLight() { - // NONMATCHING -} -#endif /* 80286CFC-80286D38 28163C 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio20TObject_ambientLightFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio21TAdaptor_ambientLight @@ -1740,13 +1724,8 @@ void JStudio::TObject_ambientLight::do_paragraph(u32 param_0, void const* param_ /* 80286E1C-80286E7C 28175C 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio15TAdaptor_cameraFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_camera::~TAdaptor_camera() {} -#else -JStudio::TAdaptor_camera::~TAdaptor_camera() { - // NONMATCHING -} -#endif /* 80286E7C-80286EB8 2817BC 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio14TObject_cameraFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio15TAdaptor_camera @@ -1803,13 +1782,8 @@ void JStudio::TObject_camera::do_paragraph(u32 param_0, void const* param_1, u32 } /* 8028717C-802871DC 281ABC 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio12TAdaptor_fogFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_fog::~TAdaptor_fog() {} -#else -JStudio::TAdaptor_fog::~TAdaptor_fog() { - // NONMATCHING -} -#endif /* 802871DC-80287218 281B1C 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio11TObject_fogFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio12TAdaptor_fog @@ -1846,13 +1820,8 @@ void JStudio::TObject_fog::do_paragraph(u32 param_0, void const* param_1, u32 pa /* 80287308-80287368 281C48 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio14TAdaptor_lightFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_light::~TAdaptor_light() {} -#else -JStudio::TAdaptor_light::~TAdaptor_light() { - // NONMATCHING -} -#endif /* 80287368-802873A4 281CA8 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio13TObject_lightFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio14TAdaptor_light @@ -1895,8 +1864,7 @@ JStudio::TObject_message::TObject_message(JStudio::stb::data::TParse_TBlock_obje /* 8028767C-8028770C 281FBC 0090+00 1/0 0/0 0/0 .text * do_paragraph__Q27JStudio15TObject_messageFUlPCvUl */ -// param_1 &= 0x1f is out of place + unsure about the pmfn -#ifdef NONMATCHING +// NONMATCHING - param_1 &= 0x1f is out of place + unsure about the pmfn void JStudio::TObject_message::do_paragraph(u32 param_1, void const* param_2, u32 param_3) { TAdaptor* adaptor = getAdaptor(); if (adaptor != NULL) { @@ -1915,20 +1883,10 @@ void JStudio::TObject_message::do_paragraph(u32 param_1, void const* param_2, u3 } } -#else -void JStudio::TObject_message::do_paragraph(u32 param_0, void const* param_1, u32 param_2) { - // NONMATCHING -} -#endif /* 8028770C-8028776C 28204C 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio17TAdaptor_particleFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_particle::~TAdaptor_particle() {} -#else -JStudio::TAdaptor_particle::~TAdaptor_particle() { - // NONMATCHING -} -#endif /* 8028776C-802877A8 2820AC 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio16TObject_particleFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio17TAdaptor_particle @@ -1944,13 +1902,8 @@ void JStudio::TObject_particle::do_paragraph(u32 param_0, void const* param_1, u /* 80287B3C-80287B9C 28247C 0060+00 0/0 1/1 0/0 .text __dt__Q27JStudio14TAdaptor_soundFv */ -#ifdef NONMATCHING +// NONMATCHING JStudio::TAdaptor_sound::~TAdaptor_sound() {} -#else -JStudio::TAdaptor_sound::~TAdaptor_sound() { - // NONMATCHING -} -#endif /* 80287B9C-80287BD8 2824DC 003C+00 0/0 1/1 0/0 .text * __ct__Q27JStudio13TObject_soundFRCQ47JStudio3stb4data20TParse_TBlock_objectPQ27JStudio14TAdaptor_sound @@ -2376,4 +2329,4 @@ SECTION_DEAD static char const* const pad_8039AB82 = "\0\0\0\0\0"; // extern u8 data_804511F8[8]; // u8 data_804511F8[8]; -/* 8039AB78-8039AB78 0271D8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ \ No newline at end of file +/* 8039AB78-8039AB78 0271D8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/JSystem/JStudio/JStudio/stb.cpp b/src/JSystem/JStudio/JStudio/stb.cpp index 52b6c1d7981..1f13b25cb5a 100644 --- a/src/JSystem/JStudio/JStudio/stb.cpp +++ b/src/JSystem/JStudio/JStudio/stb.cpp @@ -359,8 +359,7 @@ void TControl::destroyObject_all() { } /* 80289364-80289404 283CA4 00A0+00 1/1 0/0 0/0 .text getObject__Q37JStudio3stb8TControlFPCvUl */ -// TPRObject_ID_equal copy issue -#ifdef NONMATCHING +// NONMATCHING - TPRObject_ID_equal copy issue TObject* TControl::getObject(void const* param_0, u32 param_1) { JGadget::TLinkList::iterator begin = mObjectContainer.begin(); JGadget::TLinkList::iterator end = mObjectContainer.end(); @@ -370,11 +369,6 @@ TObject* TControl::getObject(void const* param_0, u32 param_1) { } return NULL; } -#else -TObject* TControl::getObject(void const* param_0, u32 param_1) { - // NONMATCHING -} -#endif /* 80289404-802894B4 283D44 00B0+00 0/0 1/1 0/0 .text reset__Q37JStudio3stb8TControlFv */ void TControl::reset() { @@ -388,8 +382,7 @@ void TControl::reset() { /* 802894B4-802895B4 283DF4 0100+00 0/0 2/2 0/0 .text forward__Q37JStudio3stb8TControlFUl */ -// regalloc -#ifdef NONMATCHING +// NONMATCHING - regalloc u8 TControl::forward(u32 param_0) { _54 = mObject_control.getSuspend(); u8 rv = mObject_control.forward(param_0); @@ -411,11 +404,6 @@ u8 TControl::forward(u32 param_0) { setStatus_(uVar7 | (uVar6 << 0x10)); return rv; } -#else -u8 TControl::forward(u32 param_0) { - // NONMATCHING -} -#endif TFactory::~TFactory() {} @@ -545,4 +533,4 @@ extern "C" void func_80289928(void* _this, JGadget::TLinkList::iterator param_1, JStudio::object::TPRObject_ID_equal param_2) { // NONMATCHING -} \ No newline at end of file +} diff --git a/src/JSystem/JStudio/JStudio_JStage/object-actor.cpp b/src/JSystem/JStudio/JStudio_JStage/object-actor.cpp index 73afde1c9dc..7ba626bac4d 100644 --- a/src/JSystem/JStudio/JStudio_JStage/object-actor.cpp +++ b/src/JSystem/JStudio/JStudio_JStage/object-actor.cpp @@ -322,8 +322,7 @@ void JStudio_JStage::TAdaptor_actor::adaptor_do_prepare() { /* 8028A7B4-8028A8D8 2850F4 0124+00 1/0 0/0 0/0 .text * adaptor_do_begin__Q214JStudio_JStage14TAdaptor_actorFv */ -// instruction order -#ifdef NONMATCHING +// NONMATCHING - instruction order void JStudio_JStage::TAdaptor_actor::adaptor_do_begin() { adaptor_object_begin_(); JStage::TActor* pActor = get_pJSG_(); @@ -345,11 +344,6 @@ void JStudio_JStage::TAdaptor_actor::adaptor_do_begin() { pAnimOutput++; } } -#else -void JStudio_JStage::TAdaptor_actor::adaptor_do_begin() { - // NONMATCHING -} -#endif /* 8028A8D8-8028A92C 285218 0054+00 1/0 0/0 0/0 .text * adaptor_do_end__Q214JStudio_JStage14TAdaptor_actorFv */ @@ -676,14 +670,9 @@ void JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()( /* 8028B138-8028B198 285A78 0060+00 2/1 0/0 0/0 .text * __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv */ -#ifdef NONMATCHING +// NONMATCHING JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::~TVVOutput_ANIMATION_FRAME_() { } -#else -JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::~TVVOutput_ANIMATION_FRAME_() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 803C5864-803C5888 022984 0010+14 2/2 0/0 0/0 .data @@ -731,4 +720,4 @@ extern "C" void func_8028B580(void* _this) { extern "C" void func_8028B5E0(void* _this, f32 param_0, JStudio::TAdaptor* param_1) /* const */ { // NONMATCHING -} \ No newline at end of file +} diff --git a/src/JSystem/JStudio/JStudio_JStage/object-light.cpp b/src/JSystem/JStudio/JStudio_JStage/object-light.cpp index a40be19f86b..6bc49090c87 100644 --- a/src/JSystem/JStudio/JStudio_JStage/object-light.cpp +++ b/src/JSystem/JStudio/JStudio_JStage/object-light.cpp @@ -125,8 +125,7 @@ SECTION_SDATA2 static f32 lit_850 = 57.295780181884766f; /* 8028CCB0-8028CF68 2875F0 02B8+00 1/0 0/0 0/0 .text * adaptor_do_begin__Q214JStudio_JStage14TAdaptor_lightFv */ -// regalloc -#ifdef NONMATCHING +// NONMATCHING - regalloc void JStudio_JStage::TAdaptor_light::adaptor_do_begin() { adaptor_object_begin_(); JStage::TLight* pLightObj = get_pJSG_(); @@ -154,11 +153,6 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_begin() { VECAdd(&finalTransform->position, &finalTransform->direction, &VStack_c4); adaptor_setVariableValue_Vec(sauVariableValue_3_TARGET_POSITION_XYZ, VStack_c4); } -#else -void JStudio_JStage::TAdaptor_light::adaptor_do_begin() { - // NONMATCHING -} -#endif /* 8028CF68-8028CFBC 2878A8 0054+00 1/0 0/0 0/0 .text * adaptor_do_end__Q214JStudio_JStage14TAdaptor_lightFv */ @@ -172,8 +166,7 @@ SECTION_SDATA2 static f32 lit_898 = 0.01745329238474369f; /* 8028CFBC-8028D18C 2878FC 01D0+00 1/0 0/0 0/0 .text * adaptor_do_update__Q214JStudio_JStage14TAdaptor_lightFUl */ -// float regalloc -#ifdef NONMATCHING +// NONMATCHING - float regalloc void JStudio_JStage::TAdaptor_light::adaptor_do_update(u32 param_1) { JStage::TLight* lightObj = get_pJSG_(); const JStudio::TObject* pObject = adaptor_getObject(); @@ -209,11 +202,6 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_update(u32 param_1) { lightObj->JSGSetDirection(pTrans->direction); pJSGObject_->JSGUpdate(); } -#else -void JStudio_JStage::TAdaptor_light::adaptor_do_update(u32 param_0) { - // NONMATCHING -} -#endif /* 8028D18C-8028D1B0 287ACC 0024+00 1/0 0/0 0/0 .text * adaptor_do_data__Q214JStudio_JStage14TAdaptor_lightFPCvUlPCvUl */ @@ -263,4 +251,4 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_ENABLE(JStudio::data::TEOperatio void JStudio_JStage::TAdaptor_light::TVVOutput_direction_::operator()( f32 param_0, JStudio::TAdaptor* param_1) const { ((JStudio_JStage::TAdaptor_light*)param_1)->field_0x11c = field_0x8; -} \ No newline at end of file +} diff --git a/src/JSystem/JUtility/JUTAssert.cpp b/src/JSystem/JUtility/JUTAssert.cpp index 61bed4e37ec..e6715ef1c49 100644 --- a/src/JSystem/JUtility/JUTAssert.cpp +++ b/src/JSystem/JUtility/JUTAssert.cpp @@ -9,6 +9,9 @@ #include "JSystem/JUtility/JUTDirectPrint.h" #include "stdio.h" +/* 804508F8-80450900 000378 0008+00 0/0 3/3 0/0 .sdata None */ +bool sAssertVisible = true; + namespace JUTAssertion { /* 802E495C-802E4960 2DF29C 0004+00 0/0 1/1 0/0 .text create__12JUTAssertionFv */ @@ -222,4 +225,4 @@ void setMessageCount(int msg_count) { sMessageLife = msg_count <= 0 ? 0 : msg_count; } -}; // namespace JUTAssertion \ No newline at end of file +}; // namespace JUTAssertion diff --git a/src/JSystem/JUtility/JUTConsole.cpp b/src/JSystem/JUtility/JUTConsole.cpp index 63cdf38f0a0..27a941cc9ba 100644 --- a/src/JSystem/JUtility/JUTConsole.cpp +++ b/src/JSystem/JUtility/JUTConsole.cpp @@ -1,118 +1,44 @@ -// -// Generated By: dol2asm -// Translation Unit: JUTConsole -// - #include "JSystem/JUtility/JUTConsole.h" #include "JSystem/J2DGraph/J2DOrthoGraph.h" #include "JSystem/JKernel/JKRHeap.h" #include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JUtility/JUTDirectPrint.h" #include "JSystem/JUtility/JUTVideo.h" -#include "dol2asm.h" -#include "stdio.h" +#include -// -// Forward References: -// - -extern "C" void create__10JUTConsoleFUiUiP7JKRHeap(); -extern "C" void create__10JUTConsoleFUiPvUl(); -extern "C" void __ct__10JUTConsoleFUiUib(); -extern "C" void __dt__10JUTConsoleFv(); -extern "C" void getObjectSizeFromBufferSize__10JUTConsoleFUiUi(); -extern "C" void getLineFromObjectSize__10JUTConsoleFUlUi(); -extern "C" void clear__10JUTConsoleFv(); -extern "C" void doDraw__10JUTConsoleCFQ210JUTConsole12EConsoleType(); -extern "C" void print_f__10JUTConsoleFPCce(); -extern "C" void print__10JUTConsoleFPCc(); -extern "C" void dumpToTerminal__10JUTConsoleFUi(); -extern "C" void scroll__10JUTConsoleFi(); -extern "C" void getUsedLine__10JUTConsoleCFv(); -extern "C" void getLineOffset__10JUTConsoleCFv(); -extern "C" void __ct__17JUTConsoleManagerFv(); -extern "C" void createManager__17JUTConsoleManagerFP7JKRHeap(); -extern "C" void appendConsole__17JUTConsoleManagerFP10JUTConsole(); -extern "C" void removeConsole__17JUTConsoleManagerFP10JUTConsole(); -extern "C" void draw__17JUTConsoleManagerCFv(); -extern "C" void drawDirect__17JUTConsoleManagerCFb(); -extern "C" void setDirectConsole__17JUTConsoleManagerFP10JUTConsole(); -extern "C" void JUTReportConsole(const char* message); -extern "C" void JUTWarningConsole_f(const char* fmt, ...); -extern "C" void JUTWarningConsole(const char*); -extern "C" extern char const* const JUTConsole__stringBase0; -extern "C" u8 sManager__17JUTConsoleManager[4]; - -// -// External References: -// - -extern "C" void alloc__7JKRHeapFUliP7JKRHeap(); -extern "C" void* __nw__FUlP7JKRHeapi(); -extern "C" void __dl__FPv(); -extern "C" void __ct__11JKRDisposerFv(); -extern "C" void __dt__11JKRDisposerFv(); -extern "C" void -Insert__Q27JGadget13TNodeLinkListFQ37JGadget13TNodeLinkList8iteratorPQ27JGadget13TLinkListNode(); -extern "C" void Remove__Q27JGadget13TNodeLinkListFPQ27JGadget13TLinkListNode(); -extern "C" void setCharColor__7JUTFontFQ28JUtility6TColor(); -extern "C" void drawString_size_scale__7JUTFontFffffPCcUlb(); -extern "C" void erase__14JUTDirectPrintFiiii(); -extern "C" void drawString__14JUTDirectPrintFUsUsPc(); -extern "C" void setCharColor__14JUTDirectPrintFQ28JUtility6TColor(); -extern "C" void __ct__13J2DOrthoGraphFffffff(); -extern "C" void setPort__13J2DOrthoGraphFv(); -extern "C" void J2DFillBox__FffffQ28JUtility6TColor(); -extern "C" u32 VIGetRetraceCount(); -extern "C" void _savegpr_20(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_20(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__14J2DGrafContext[10]; -extern "C" extern void* __vt__13J2DOrthoGraph[10]; -extern "C" u8 sCurrentHeap__7JKRHeap[4]; -extern "C" u8 sDirectPrint__14JUTDirectPrint[4 + 4 /* padding */]; -extern "C" u8 sManager__8JUTVideo[4]; - -// -// Declarations: -// - -/* ############################################################################################## */ /* 80451570-80451574 000A70 0004+00 4/4 7/7 0/0 .sbss sManager__17JUTConsoleManager */ JUTConsoleManager* JUTConsoleManager::sManager; /* 802E7354-802E73E4 2E1C94 0090+00 0/0 1/1 0/0 .text create__10JUTConsoleFUiUiP7JKRHeap */ -JUTConsole* JUTConsole::create(unsigned int param_0, unsigned int maxLines, JKRHeap* p_heap) { - JUTConsoleManager* pManager = JUTConsoleManager::sManager; +JUTConsole* JUTConsole::create(unsigned int param_0, unsigned int maxLines, JKRHeap* pHeap) { + JUTConsoleManager* pManager = JUTConsoleManager::getManager(); + JUT_ASSERT(33, pManager != 0); - void* buffer = JKRHeap::alloc(getObjectSizeFromBufferSize(param_0, maxLines), 0, p_heap); - u8* tmpBuf = (u8*)buffer; + u8* buffer = (u8*)JKRAllocFromHeap(pHeap, getObjectSizeFromBufferSize(param_0, maxLines), 0); - JUTConsole* newConsole = new (tmpBuf) JUTConsole(param_0, maxLines, true); - newConsole->mBuf = tmpBuf + sizeof(JUTConsole); - newConsole->clear(); + JUTConsole* console = new (buffer) JUTConsole(param_0, maxLines, true); + console->mBuf = buffer + sizeof(JUTConsole); + console->clear(); - pManager->appendConsole(newConsole); - return newConsole; + pManager->appendConsole(console); + return console; } /* 802E73E4-802E746C 2E1D24 0088+00 0/0 1/1 0/0 .text create__10JUTConsoleFUiPvUl */ JUTConsole* JUTConsole::create(unsigned int param_0, void* buffer, u32 bufferSize) { - JUTConsoleManager* pManager = JUTConsoleManager::sManager; + JUTConsoleManager* pManager = JUTConsoleManager::getManager(); + JUT_ASSERT(59, pManager != 0); + + JUT_ASSERT(62, ( (u32)buffer & 0x3 ) == 0); u32 maxLines = getLineFromObjectSize(bufferSize, param_0); - JUTConsole* newConsole = new (buffer) JUTConsole(param_0, maxLines, false); - newConsole->mBuf = (u8*)buffer + sizeof(JUTConsole); - newConsole->clear(); + JUTConsole* console = new (buffer) JUTConsole(param_0, maxLines, false); + console->mBuf = (u8*)buffer + sizeof(JUTConsole); + console->clear(); - pManager->appendConsole(newConsole); - return newConsole; + pManager->appendConsole(console); + return console; } /* 802E746C-802E755C 2E1DAC 00F0+00 2/2 0/0 0/0 .text __ct__10JUTConsoleFUiUib */ @@ -143,6 +69,7 @@ JUTConsole::JUTConsole(unsigned int param_0, unsigned int maxLines, bool param_2 /* 802E755C-802E75CC 2E1E9C 0070+00 1/0 0/0 0/0 .text __dt__10JUTConsoleFv */ JUTConsole::~JUTConsole() { + JUT_ASSERT(154, JUTConsoleManager::getManager()); JUTConsoleManager::getManager()->removeConsole(this); } @@ -167,6 +94,7 @@ void JUTConsole::clear() { for (u32 i = 0; i < mMaxLines; i++) { setLineAttr(i, 0); } + setLineAttr(0, -1); *getLinePtr(0) = 0; } @@ -330,6 +258,8 @@ void JUTConsole::print(char const* str) { /* 802E7F30-802E7F7C 2E2870 004C+00 1/1 1/1 0/0 .text JUTConsole_print_f_va_ */ extern "C" void JUTConsole_print_f_va_(JUTConsole* console, const char* fmt, va_list args) { + JUT_ASSERT(563, console!=0); + char buf[1024]; vsnprintf(buf, sizeof(buf), fmt, args); console->print(buf); @@ -427,8 +357,10 @@ JUTConsoleManager::JUTConsoleManager() { /* 802E81F4-802E8240 2E2B34 004C+00 0/0 1/1 0/0 .text createManager__17JUTConsoleManagerFP7JKRHeap */ JUTConsoleManager* JUTConsoleManager::createManager(JKRHeap* pHeap) { + JUT_ASSERT(0x39c, sManager == 0); + if (pHeap == NULL) { - pHeap = JKRHeap::sCurrentHeap; + pHeap = JKRGetCurrentHeap(); } JUTConsoleManager* manager = new (pHeap, 0) JUTConsoleManager(); @@ -440,6 +372,8 @@ JUTConsoleManager* JUTConsoleManager::createManager(JKRHeap* pHeap) { * appendConsole__17JUTConsoleManagerFP10JUTConsole */ void JUTConsoleManager::appendConsole(JUTConsole* console) { JUT_ASSERT(961, sManager != 0 && console != 0); + + JUT_ASSERT(964, soLink_.Find( console ) == soLink_.end()); soLink_.Push_back(console); if (mActiveConsole == NULL) { @@ -470,8 +404,6 @@ void JUTConsoleManager::removeConsole(JUTConsole* console) { } /* 802E8384-802E8450 2E2CC4 00CC+00 0/0 1/1 0/0 .text draw__17JUTConsoleManagerCFv */ -// missing stack var, different from tww/pik2 -#ifdef NONMATCHING void JUTConsoleManager::draw() const { ConsoleList::const_iterator iter = soLink_.begin(); ConsoleList::const_iterator end = soLink_.end(); @@ -485,11 +417,6 @@ void JUTConsoleManager::draw() const { if (mActiveConsole != NULL) mActiveConsole->doDraw(JUTConsole::CONSOLE_TYPE_0); } -#else -void JUTConsoleManager::draw() const { - // NONMATCHING -} -#endif /* 802E8450-802E84C4 2E2D90 0074+00 0/0 5/5 0/0 .text drawDirect__17JUTConsoleManagerCFb */ @@ -510,24 +437,23 @@ void JUTConsoleManager::drawDirect(bool waitRetrace) const { /* 802E84C4-802E8520 2E2E04 005C+00 0/0 2/2 0/0 .text * setDirectConsole__17JUTConsoleManagerFP10JUTConsole */ -void JUTConsoleManager::setDirectConsole(JUTConsole* p_console) { +void JUTConsoleManager::setDirectConsole(JUTConsole* console) { if (mDirectConsole != NULL) { appendConsole(mDirectConsole); } - if (p_console != NULL) { - removeConsole(p_console); + if (console != NULL) { + removeConsole(console); } - mDirectConsole = p_console; + mDirectConsole = console; } -/* ############################################################################################## */ /* 80451574-80451578 000A74 0004+00 2/1 0/0 0/0 .sbss sReportConsole */ static JUTConsole* sReportConsole; /* 802E8520-802E8528 2E2E60 0008+00 1/1 1/1 0/0 .text JUTSetReportConsole */ -extern "C" void JUTSetReportConsole(JUTConsole* p_console) { - sReportConsole = p_console; +extern "C" void JUTSetReportConsole(JUTConsole* console) { + sReportConsole = console; } /* 802E8528-802E8530 -00001 0008+00 0/0 0/0 0/0 .text JUTGetReportConsole */ @@ -535,13 +461,12 @@ extern "C" JUTConsole* JUTGetReportConsole() { return sReportConsole; } -/* ############################################################################################## */ /* 80451578-80451580 000A78 0004+04 2/1 0/0 0/0 .sbss sWarningConsole */ static JUTConsole* sWarningConsole; /* 802E8530-802E8538 2E2E70 0008+00 1/1 1/1 0/0 .text JUTSetWarningConsole */ -extern "C" void JUTSetWarningConsole(JUTConsole* p_console) { - sWarningConsole = p_console; +extern "C" void JUTSetWarningConsole(JUTConsole* console) { + sWarningConsole = console; } /* 802E8538-802E8540 -00001 0008+00 0/0 0/0 0/0 .text JUTGetWarningConsole */ @@ -571,18 +496,10 @@ extern "C" void JUTReportConsole_f(const char* fmt, ...) { va_end(args); } -/* ############################################################################################## */ -/* 8039D9A8-8039D9A8 02A008 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8039D9B7 = - "\n:::dump of console[%x]----------------\n"; -SECTION_DEAD static char const* const stringBase_8039D9E0 = - ":::dump of console[%x] END------------\n"; -SECTION_DEAD static char const* const stringBase_8039DA08 = "%s"; -/* @stringBase0 padding */ -SECTION_DEAD static char const* const pad_8039DA0B = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -#pragma pop +static void dummyString() { + DEAD_STRING("\n:::dump of console[%x]----------------\n"); + DEAD_STRING(":::dump of console[%x] END------------\n"); +} /* 802E8648-802E867C 2E2F88 0034+00 0/0 6/6 0/0 .text JUTReportConsole */ void JUTReportConsole(const char* message) { @@ -614,4 +531,4 @@ void JUTWarningConsole_f(const char* fmt, ...) { /* 802E86FC-802E8730 2E303C 0034+00 0/0 2/2 0/0 .text JUTWarningConsole */ void JUTWarningConsole(const char* message) { JUTReportConsole_f("%s", message); -} \ No newline at end of file +} diff --git a/src/JSystem/JUtility/JUTException.cpp b/src/JSystem/JUtility/JUTException.cpp index f8fb1c0ac63..e6ee2765d00 100644 --- a/src/JSystem/JUtility/JUTException.cpp +++ b/src/JSystem/JUtility/JUTException.cpp @@ -6,69 +6,20 @@ #include "JSystem/JUtility/JUTException.h" #include "JSystem/JUtility/JUTConsole.h" #include "JSystem/JUtility/JUTDirectPrint.h" -#include "math.h" -#include "stdio.h" -#include "stdlib.h" -#include "dol2asm.h" -#include "dolphin/base/PPCArch.h" -#include "dolphin/os.h" -#include "global.h" - -// -// Forward References: -// - -extern "C" void run__12JUTExceptionFv(); -extern "C" void __dt__12JUTExceptionFv(); -extern "C" void printContext__12JUTExceptionFUsP9OSContextUlUl(); -extern "C" void createFB__12JUTExceptionFv(); -extern "C" void panic_f_va__12JUTExceptionFPCciPCcP16__va_list_struct(); - -extern "C" extern char const* const JUTException__stringBase0; -extern "C" u8 sMessageQueue__12JUTException[32]; -extern "C" u8 sMessageBuffer__12JUTException[4 + 4 /* padding */]; -extern "C" u8 sErrorManager__12JUTException[4]; - -extern "C" u8 msr__12JUTException[4]; -extern "C" u8 fpscr__12JUTException[4]; -extern "C" u8 sPreUserCallback__12JUTException[4]; -extern "C" u8 sConsole__12JUTException[4]; - -// -// External References: -// - -extern "C" void changeFrameBuffer__14JUTDirectPrintFPvUsUs(); -extern "C" void _savegpr_25(); -extern "C" void _restgpr_25(); -extern "C" void _savegpr_28(); -extern "C" void _restgpr_28(); -extern "C" void OSYieldThread(); -extern "C" void OSFillFPUContext(OSContext*); -extern "C" void print_f__10JUTConsoleFPCce(); -extern "C" OSContext* OSGetCurrentContext(); -extern "C" extern _GXRenderModeObj GXNtsc480Int; -extern "C" void _restgpr_16(); -extern "C" void fopen__13JUTDirectFileFPCc(); -extern "C" void fclose__13JUTDirectFileFv(); -extern "C" void fgets__13JUTDirectFileFPvi(); -extern "C" void print__10JUTConsoleFPCc(); -extern "C" void __ct__13JUTDirectFileFv(); -extern "C" void __dt__13JUTDirectFileFv(); -extern "C" void _savegpr_16(); - -// -// Declarations: -// +#include "JSystem/JUtility/JUTDirectFile.h" +#include +#include +#include +#include /* 803CC620-803CC640 029740 0020+00 3/3 0/0 0/0 .data sMessageQueue__12JUTException */ -SECTION_DATA OSMessageQueue JUTException::sMessageQueue = {0}; +OSMessageQueue JUTException::sMessageQueue = {0}; /* 803CC640-803CC660 029760 0020+00 1/1 0/0 0/0 .data c3bcnt */ -SECTION_DATA static OSTime c3bcnt[4] = {0, 0, 0, 0}; +static OSTime c3bcnt[4] = {0, 0, 0, 0}; /* 803CC660-803CC6A4 -00001 0044+00 1/1 0/0 0/0 .data sCpuExpName__12JUTException */ -SECTION_DATA const char* JUTException::sCpuExpName[17] = { +const char* JUTException::sCpuExpName[17] = { "SYSTEM RESET", "MACHINE CHECK", "DSI", @@ -132,9 +83,8 @@ JUTException* JUTException::create(JUTDirectPrint* directPrint) { return sErrorManager; } -/* ############################################################################################## */ /* 804508F0-804508F8 000370 0004+04 1/1 0/0 0/0 .sdata sMessageBuffer__12JUTException */ -SECTION_SDATA OSMessage JUTException::sMessageBuffer[1 + 1 /* padding */] = {0}; +OSMessage JUTException::sMessageBuffer[1] = {0}; struct CallbackObject { /* 0x00 */ OSErrorHandler callback; @@ -179,9 +129,7 @@ void* JUTException::run() { } } -/* ############################################################################################## */ /* 80434578-8043458C 061298 0014+00 2/2 0/0 0/0 .bss exCallbackObject */ - STATIC_ASSERT(sizeof(CallbackObject) == 0x14); static CallbackObject exCallbackObject; @@ -304,16 +252,6 @@ void JUTException::showFloatSub(int index, f32 value) { } } -/* ############################################################################################## */ -/* 8039D490-8039D490 029AF0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8039D5B7 = - "-------------------------------- FPR\n"; -SECTION_DEAD static char const* const stringBase_8039D5DD = " "; -SECTION_DEAD static char const* const stringBase_8039D5DF = "\n"; -#pragma pop - /* 802E2454-802E2578 2DCD94 0124+00 1/1 0/0 0/0 .text showFloat__12JUTExceptionFP9OSContext */ void JUTException::showFloat(OSContext* context) { if (!sConsole) { @@ -968,147 +906,132 @@ bool JUTException::queryMapAddress(char* mapPath, u32 address, s32 section_id, u return false; } -/* ############################################################################################## */ -/* 8039D490-8039D490 029AF0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8039D97E = " [%08X]: .%s [%08X: %XH]\n %s\n"; -/* @stringBase0 padding */ -SECTION_DEAD static char const* const pad_8039D99E = "\0"; -#pragma pop - /* 802E3C90-802E3FEC 2DE5D0 035C+00 1/1 0/0 0/0 .text * queryMapAddress_single__12JUTExceptionFPcUllPUlPUlPcUlbb */ // 2 additional instructions (addi r5,r1,8) related to section_name variable. -#ifdef NONMATCHING bool JUTException::queryMapAddress_single(char* mapPath, u32 address, s32 section_id, u32* out_addr, u32* out_size, char* out_line, u32 line_length, bool print, bool begin_with_newline) { if (!mapPath) { - return false; - } + return false; + } - char section_name[16]; - char buffer[0x200]; - JUTDirectFile file; - int i = 0; - if (!file.fopen(mapPath)) { - return false; - } + char section_name[16]; + char buffer[0x200]; + JUTDirectFile file; + int section_idx = 0; + if (!file.fopen(mapPath)) { + return false; + } - bool result = 0; - do { - char* src = buffer; - int found_section = 0; - do { - i++; - while (true) { - while (true) { - int length = file.fgets(buffer, ARRAY_SIZE(buffer)); - if (length < 0) - goto next_section; - if (buffer[0] == '.') - break; - } + bool result = false; + bool found_section; - int i = 0; - char* src = buffer + 1; - for (; *src != '\0'; i++, src++) { - section_name[i] = *src; - if (*src == ' ' || i == 0xf) - break; - } + while (true) { + section_idx++; + found_section = false; + while (true) { + char* src; + char* dst; - section_name[i] = 0; - if (*src == 0) - break; + if (file.fgets(buffer, ARRAY_SIZE(buffer)) < 0) + break; + if (buffer[0] != '.') + continue; - if (src[1] == 's' && src[2] == 'e' && src[3] == 'c' && src[4] == 't') { - found_section = true; - break; - } - } - if ((found_section & 0xFF) == 0) - goto end; - } while (section_id >= 0 && section_id != i); - next_section:; + int i = 0; + src = buffer + 1; + while (*src != '\0') { + section_name[i] = *src; + if (*src == ' ' || i == 0xf) + break; + i++; + src++; + } - u32 addr; - int size; - do { - int length; - do { - length = file.fgets(buffer, ARRAY_SIZE(buffer)); - if (length <= 4) - goto next_symbol; - } while ((length < 28) || (buffer[28] != '4')); + section_name[i] = 0; + if (*src == 0) + break; - addr = strtol(buffer + 19, NULL, 16); - addr = ((buffer[18] - '0') << 28) | addr; - size = strtol(buffer + 11, NULL, 16); - } while (addr > address || address >= addr + size); + if (src[1] == 's' && src[2] == 'e' && src[3] == 'c' && src[4] == 't') { + found_section = true; + break; + } + } - if (out_addr) - *out_addr = addr; + if (!found_section) + break; - if (out_size) - *out_size = size; + if (section_id >= 0 && section_id != section_idx) + continue; - if (out_line) { - src = buffer + 0x1e; - char* dst = out_line; - u32 length = 0; - for (; length < line_length - 1; src++) { - u32 ch = *(u8*)src; - if (ch < ' ' && ch != '\t') - break; - if (((int)ch == ' ' || ch == '\t') && (length != 0)) { - if (dst[-1] != ' ') { - *dst = ' '; - dst++; - length++; - } - } else { - *dst = ch; - dst++; - length++; - } - } - if (length != 0 && dst[-1] == ' ') { - dst--; - } - *dst = 0; - if (print) { - if (begin_with_newline) { - sConsole->print("\n"); - } - sConsole->print_f(" [%08X]: .%s [%08X: %XH]\n %s\n", address, section_name, addr, - size, out_line); - begin_with_newline = false; - } - } + int length; - result = true; + while (true) { + if ((length = file.fgets(buffer, ARRAY_SIZE(buffer))) <= 4) + break; + if ((length < 28)) + continue; + if (buffer[28] == '4') { + u32 addr = ((buffer[18] - '0') << 28) | strtol(buffer + 19, NULL, 16); + int size = strtol(buffer + 11, NULL, 16); + if ((addr <= address && address < addr + size)) { + if (out_addr) + *out_addr = addr; - next_symbol:; - } while ((result & 0xFF) == 0 && section_id >= 0 && section_id != i); + if (out_size) + *out_size = size; - if (print && begin_with_newline) { - sConsole->print("\n"); - } + if (out_line) { + const u8* src = (const u8*)&buffer[0x1e]; + u8* dst = (u8*)out_line; + u32 i = 0; -end: - file.fclose(); - bool bresult = result != false; - return bresult; + for (i = 0; i < line_length - 1; ++src) { + if ((u32)(*src) < ' ' && (u32)*src != '\t') + break; + if ((*src == ' ' || (u32)*src == '\t') && (i != 0)) { + if (dst[-1] != ' ') { + *dst = ' '; + dst++; + ++i; + } + } else { + *dst++ = *src; + i++; + } + } + if (i != 0 && dst[-1] == ' ') { + dst--; + i--; + } + *dst = 0; + if (print) { + if (begin_with_newline) { + sConsole->print("\n"); + } + sConsole->print_f(" [%08X]: .%s [%08X: %XH]\n %s\n", address, section_name, addr, size, out_line); + begin_with_newline = false; + } + } + result = true; + break; + } + } + } + + if (!result && (section_id < 0 || section_id != section_idx)) { + continue; + } + if (print && begin_with_newline) { + sConsole->print("\n"); + } + break; + } + + file.fclose(); + return result ? true : false; } -#else -bool JUTException::queryMapAddress_single(char* param_0, u32 param_1, s32 param_2, u32* param_3, - u32* param_4, char* param_5, u32 param_6, - bool param_7, bool param_8) { - // NONMATCHING -} -#endif /* 802E3FEC-802E40CC 2DE92C 00E0+00 0/0 1/1 0/0 .text createConsole__12JUTExceptionFPvUl */ @@ -1146,8 +1069,3 @@ JUTExternalFB::JUTExternalFB(_GXRenderModeObj* renderMode, GXGamma gamma, void* /* 802E40EC-802E414C 2DEA2C 0060+00 1/0 0/0 0/0 .text __dt__12JUTExceptionFv */ JUTException::~JUTException() {} - -/* ############################################################################################## - */ -/* 804508F8-80450900 000378 0008+00 0/0 3/3 0/0 .sdata None */ -SECTION_SDATA extern bool sAssertVisible = true; diff --git a/src/JSystem/JUtility/JUTFontData_Ascfont_fix12.cpp b/src/JSystem/JUtility/JUTFontData_Ascfont_fix12.cpp index 993a74797b4..ad5010c3fa2 100644 --- a/src/JSystem/JUtility/JUTFontData_Ascfont_fix12.cpp +++ b/src/JSystem/JUtility/JUTFontData_Ascfont_fix12.cpp @@ -1,7 +1,7 @@ #include /* 8039DA20-803A1B80 02A080 4160+00 0/0 1/0 0/0 .rodata JUTResFONT_Ascfont_fix12 */ -extern u8 const JUTResFONT_Ascfont_fix12[16736] = { +extern u8 const JUTResFONT_Ascfont_fix12[16736] ALIGN_DECL(32) = { 0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, @@ -1048,4 +1048,4 @@ extern u8 const JUTResFONT_Ascfont_fix12[16736] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; \ No newline at end of file +}; diff --git a/src/JSystem/JUtility/JUTXfb.cpp b/src/JSystem/JUtility/JUTXfb.cpp index 91752954844..6032693d36a 100644 --- a/src/JSystem/JUtility/JUTXfb.cpp +++ b/src/JSystem/JUtility/JUTXfb.cpp @@ -55,27 +55,22 @@ void JUTXfb::common_init(int bufNum) { /* 802E5260-802E5308 2DFBA0 00A8+00 1/1 0/0 0/0 .text * __ct__6JUTXfbFPC16_GXRenderModeObjP7JKRHeapQ26JUTXfb10EXfbNumber */ -#ifdef NONMATCHING -JUTXfb::JUTXfb(_GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) { +// NONMATCHING - regswap, equivalent +JUTXfb::JUTXfb(GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) { common_init(xfbNum); if (pObj) { initiate(pObj->fb_width, pObj->xfb_height, pHeap, xfbNum); } else { - //_GXRenderModeObj* renderObj = JUTVideo::getManager()->getRenderMode(); u16 fb_width = JUTVideo::getManager()->getRenderMode()->fb_width; u16 efb_height = JUTVideo::getManager()->getRenderMode()->efb_height; u16 xfb_height = JUTVideo::getManager()->getRenderMode()->xfb_height; f32 scale_factor = GXGetYScaleFactor(efb_height, xfb_height); + u16 xfb_lines = GXGetNumXfbLines(efb_height, scale_factor); - initiate(fb_width, GXGetNumXfbLines(efb_height, scale_factor), pHeap, xfbNum); + initiate(fb_width, xfb_lines, pHeap, xfbNum); } } -#else -JUTXfb::JUTXfb(_GXRenderModeObj const* param_0, JKRHeap* param_1, - JUTXfb::EXfbNumber param_2){// NONMATCHING -} -#endif JUTXfb* JUTXfb::sManager; @@ -132,4 +127,4 @@ void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber mBuffer[2] = NULL; mXfbAllocated[2] = false; } -} \ No newline at end of file +} diff --git a/src/d/actor/d_a_balloon_2D.cpp b/src/d/actor/d_a_balloon_2D.cpp index 5b7e5e4821e..f151d2707a7 100644 --- a/src/d/actor/d_a_balloon_2D.cpp +++ b/src/d/actor/d_a_balloon_2D.cpp @@ -550,8 +550,7 @@ COMPILER_STRIP_GATE(0x806555E4, &lit_4175); #pragma pop /* 80654730-80654E8C 001350 075C+00 1/1 0/0 0/0 .text drawAddScore__13daBalloon2D_cFv */ -// field_0x0.x, regalloc -#ifdef NONMATCHING +// NONMATCHING - field_0x0.x, regalloc void daBalloon2D_c::drawAddScore() { for (int i = 19; i >= 0; i--) { if (field_0x5f8[i].field_0xe != 0) { @@ -633,11 +632,6 @@ void daBalloon2D_c::drawAddScore() { } } } -#else -void daBalloon2D_c::drawAddScore() { - // NONMATCHING -} -#endif /* 80654E8C-80655250 001AAC 03C4+00 2/2 0/0 0/0 .text setHIO__13daBalloon2D_cFb */ void daBalloon2D_c::setHIO(bool param_1) { @@ -724,16 +718,11 @@ SECTION_DATA extern void* __vt__Q213daBalloon2D_c6c_list[4] = { }; /* 80655250-80655304 001E70 00B4+00 1/0 0/0 0/0 .text daBalloon2D_create__FP13daBalloon2D_c */ -#ifdef NONMATCHING +// NONMATCHING - vtable static int daBalloon2D_create(daBalloon2D_c* i_this) { fopAcM_SetupActor(i_this, daBalloon2D_c); return i_this->create(); } -#else -static int daBalloon2D_create(daBalloon2D_c* param_0) { - // NONMATCHING -} -#endif /* 80655304-80655340 001F24 003C+00 2/2 0/0 0/0 .text __dt__Q213daBalloon2D_c10CHeadScoreFv */ daBalloon2D_c::CHeadScore::~CHeadScore() { diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index 5ca934a4916..5a7eb322ea0 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -10,6 +10,11 @@ #include "dol2asm.h" #include "JSystem/J3DGraphBase/J3DMaterial.h" #include "string.h" +#include "d/d_bg_w.h" +#include "m_Do/m_Do_lib.h" +#include "d/d_demo.h" +#include "JSystem/JKernel/JKRExpHeap.h" +#include "JSystem/JKernel/JKRSolidHeap.h" // // Forward References: @@ -389,8 +394,7 @@ SECTION_DEAD static char const* const stringBase_804593C6 = "room.plc"; #pragma pop /* 804582B8-80458750 000738 0498+00 2/2 0/0 1/1 .text createHeap__6daBg_cFv */ -// regalloc, but equivalent -#ifdef NONMATCHING +// NONMATCHING - regalloc, but equivalent int daBg_c::createHeap() { const char* arcName = setArcName(); s32 prm = fopAcM_GetParam(this); @@ -505,11 +509,6 @@ int daBg_c::createHeap() { return 1; } -#else -int daBg_c::createHeap() { - // NONMATCHING -} -#endif /* 80458750-80458788 000BD0 0038+00 1/1 0/0 0/0 .text __ct__11J3DLightObjFv */ // J3DLightObj::J3DLightObj() { @@ -590,8 +589,7 @@ SECTION_DEAD static char const* const stringBase_80459418 = "MA00_Kusa"; #pragma pop /* 804588C4-80458F38 000D44 0674+00 1/1 0/0 0/0 .text draw__6daBg_cFv */ -// just regalloc + some reorder issues -#ifdef NONMATCHING +// NONMATCHING - just regalloc + some reorder issues int daBg_c::draw() { int roomNo = fopAcM_GetParam(this); daBg_unkData* bgData = mBgData; @@ -742,11 +740,6 @@ int daBg_c::draw() { return 1; } -#else -int daBg_c::draw() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 804593A4-804593A8 000030 0004+00 1/1 0/0 0/0 .rodata @4524 */ @@ -801,14 +794,13 @@ static int daBg_Create(fopAc_ac_c* i_this) { } /* 8045906C-8045933C 0014EC 02D0+00 1/1 0/0 0/0 .text create__6daBg_cFv */ -// regalloc -#ifdef NONMATCHING +// NONMATCHING - regalloc int daBg_c::create() { int roomNo = fopAcM_GetParam(this); field_0x5f0 = 0; field_0x5f1 = 0; - if (mHeap == NULL) { + if (this->heap == NULL) { fopAcM_SetupActor(this, daBg_c); home.roomNo = roomNo; @@ -816,13 +808,13 @@ int daBg_c::create() { JKRExpHeap* heap = dStage_roomControl_c::getMemoryBlock(roomNo); if (heap != NULL) { - mHeap = JKRSolidHeap::create(-1, heap, false); + this->heap = JKRSolidHeap::create(-1, heap, false); - JKRHeap* old = mDoExt_setCurrentHeap(mHeap); + JKRHeap* old = mDoExt_setCurrentHeap(this->heap); createHeap(); mDoExt_setCurrentHeap(old); - mHeap->adjustSize(); + this->heap->adjustSize(); } else if (!fopAcM_entrySolidHeap(this, checkCreateHeap, 0x80020040)) { return cPhs_ERROR_e; } @@ -888,11 +880,6 @@ int daBg_c::create() { dComIfGp_roomControl_onStatusFlag(roomNo, 0x10); return cPhs_COMPLEATE_e; } -#else -int daBg_c::create() { - // NONMATCHING -} -#endif /* 8045933C-8045936C 0017BC 0030+00 1/0 0/0 0/0 .text calc__11J3DTexNoAnmCFPUs */ // void J3DTexNoAnm::calc(u16* param_0) const { diff --git a/src/d/actor/d_a_bg_obj.cpp b/src/d/actor/d_a_bg_obj.cpp index 16ffe35ad7e..05552942d9b 100644 --- a/src/d/actor/d_a_bg_obj.cpp +++ b/src/d/actor/d_a_bg_obj.cpp @@ -318,16 +318,14 @@ SECTION_DEAD static char const* const stringBase_8045CA86 = "データブロッ /* 80459904-80459B64 000324 0260+00 1/1 0/0 1/1 .text Set__Q29daBgObj_c11spec_data_cFPv */ -// close-ish -#ifdef NONMATCHING - -int daBgObj_c::spec_data_c::Set(void* i_ptr) { +// NONMATCHING - close-ish +bool daBgObj_c::spec_data_c::Set(void* i_ptr) { spec_dat* data = (spec_dat*)i_ptr; mSpecType = data->field_0x0; switch (mSpecType) { - case 0: + case 0: { u8 block_type = data->field_0x4; u8* block_p = (u8*)data + 4; @@ -350,7 +348,8 @@ int daBgObj_c::spec_data_c::Set(void* i_ptr) { block_type = *block_p; } while (1); break; - case 1: + } + case 1: { u16 temp_r3 = data->field_0x2; field_0x02 = temp_r3 & 0xF; field_0x03 = (temp_r3 >> 0xE) & 3; @@ -386,7 +385,8 @@ int daBgObj_c::spec_data_c::Set(void* i_ptr) { block_type = *block_p; } while (1); break; - case 2: + } + case 2: { u16 temp_r3_2 = data->field_0x2; field_0x02 = temp_r3_2 & 0xF; field_0x03 = (temp_r3_2 >> 0xE) & 3; @@ -426,17 +426,13 @@ int daBgObj_c::spec_data_c::Set(void* i_ptr) { block_type = *block_p; } while (1); break; + } default: return 0; } return 1; } -#else -bool daBgObj_c::spec_data_c::Set(void* param_0) { - // NONMATCHING -} -#endif /* 80459B64-80459BB4 000584 0050+00 4/4 0/0 0/0 .text release__9daBgObj_cFP4dBgW */ void daBgObj_c::release(dBgW* param_0) { @@ -968,7 +964,7 @@ BOOL daBgObj_c::checkDestroy() { /* 8045B534-8045B5E0 001F54 00AC+00 2/2 0/0 0/0 .text checkHitAt__9daBgObj_cFP8cCcD_Obj */ -#ifdef NONMATCHING +// NONMATCHING BOOL daBgObj_c::checkHitAt(cCcD_Obj* i_hitObj) { u32 hit_flags = 0; u32 var_r8 = 0; @@ -995,11 +991,6 @@ BOOL daBgObj_c::checkHitAt(cCcD_Obj* i_hitObj) { return hit_flags != 0; } -#else -BOOL daBgObj_c::checkHitAt(cCcD_Obj* param_0) { - // NONMATCHING -} -#endif /* 8045B5E0-8045B7FC 002000 021C+00 1/1 0/0 0/0 .text orderWait_tri__9daBgObj_cFv */ void daBgObj_c::orderWait_tri() { @@ -1047,8 +1038,7 @@ void daBgObj_c::orderWait_tri() { /* 8045B7FC-8045B9C4 00221C 01C8+00 1/1 0/0 0/0 .text orderWait_cyl__9daBgObj_cFv */ -// r30/r31 swap -#ifdef NONMATCHING +// NONMATCHING - r30/r31 swap void daBgObj_c::orderWait_cyl() { if (mCyl.ChkTgHit()) { if (checkHitAt(mCyl.GetTgHitObj())) { @@ -1086,11 +1076,6 @@ void daBgObj_c::orderWait_cyl() { dComIfG_Ccsp()->Set(&mCyl); } -#else -void daBgObj_c::orderWait_cyl() { - // NONMATCHING -} -#endif /* 8045B9C4-8045BB38 0023E4 0174+00 1/1 0/0 0/0 .text orderWait_spec__9daBgObj_cFv */ void daBgObj_c::orderWait_spec() { diff --git a/src/d/actor/d_a_e_ym.cpp b/src/d/actor/d_a_e_ym.cpp index 74d60e72acb..6c172b36222 100644 --- a/src/d/actor/d_a_e_ym.cpp +++ b/src/d/actor/d_a_e_ym.cpp @@ -669,8 +669,7 @@ COMPILER_STRIP_GATE(0x808159E8, &lit_4102); #pragma pop /* 808083CC-80808678 00038C 02AC+00 1/1 0/0 0/0 .text draw__8daE_YM_cFv */ -// one instruction order mismatch (probably causes regalloc issue) -#ifdef NONMATCHING +// NONMATCHING - one instruction order mismatch (probably causes regalloc issue) int daE_YM_c::draw() { if (field_0x71d) { return 1; @@ -738,11 +737,6 @@ int daE_YM_c::draw() { return 1; } -#else -int daE_YM_c::draw() { - // NONMATCHING -} -#endif /* 80808678-80808698 000638 0020+00 1/0 0/0 0/0 .text daE_YM_Draw__FP8daE_YM_c */ static int daE_YM_Draw(daE_YM_c* i_this) { @@ -753,11 +747,8 @@ static int daE_YM_Draw(daE_YM_c* i_this) { /* 80815D28-80815D2C 000008 0004+00 2/2 0/0 0/0 .bss None */ static u8 data_80815D28[4]; -/* 80815D2C-80815D38 00000C 000C+00 1/1 0/0 0/0 .bss @3941 */ -static u8 lit_3941[12]; - /* 80815D38-80815D5C 000018 0024+00 18/18 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[36]; +static daE_YM_HIO_c l_HIO; /* 80815D5C-80815D60 00003C 0004+00 3/3 0/0 0/0 .bss m_near_obj */ static fopAc_ac_c* m_near_obj; @@ -1850,8 +1841,7 @@ SECTION_DEAD static char const* const stringBase_80815AFE = "E_ym"; #pragma pop /* 80814BA4-80815224 00CB64 0680+00 2/1 0/0 0/0 .text create__8daE_YM_cFv */ -// literals / small issue -#ifdef NONMATCHING +// NONMATCHING - literals / small issue int daE_YM_c::create() { fopAcM_SetupActor(this, daE_YM_c); @@ -2023,11 +2013,6 @@ int daE_YM_c::create() { return phase; } -#else -int daE_YM_c::create() { - // NONMATCHING -} -#endif /* 80815224-8081526C 00D1E4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ // cM3dGSph::~cM3dGSph() { @@ -2063,60 +2048,3 @@ extern "C" void __dt__12dBgS_AcchCirFv() { static int daE_YM_Create(daE_YM_c* i_this) { return i_this->create(); } - -/* 80815410-80815458 00D3D0 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 80815458-808154A0 00D418 0048+00 2/1 0/0 0/0 .text __dt__12daE_YM_HIO_cFv */ -daE_YM_HIO_c::~daE_YM_HIO_c() { - // NONMATCHING -} - -/* 808154A0-808154DC 00D460 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_ym_cpp */ -void __sinit_d_a_e_ym_cpp(){// NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x808154A0, __sinit_d_a_e_ym_cpp); -#pragma pop - -/* 808154DC-808154E4 00D49C 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_808154DC() { - // NONMATCHING -} - -/* 808154E4-808154EC 00D4A4 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_808154E4() { - // NONMATCHING -} - -/* 808154EC-80815900 00D4AC 0414+00 1/1 0/0 0/0 .text - * setMidnaBindEffect__FP13fopEn_enemy_cP15Z2CreatureEnemyP4cXyzP4cXyz */ -static void setMidnaBindEffect(fopEn_enemy_c* param_0, Z2CreatureEnemy* param_1, cXyz* param_2, - cXyz* param_3) { - // NONMATCHING -} - -/* 80815900-8081593C 00D8C0 003C+00 1/1 0/0 0/0 .text __dt__4cXyzFv */ -// cXyz::~cXyz() { -extern "C" void __dt__4cXyzFv() { - // NONMATCHING -} - -/* 8081593C-80815958 00D8FC 001C+00 2/2 0/0 0/0 .text getLeftHandPos__9daPy_py_cCFv */ -// void daPy_py_c::getLeftHandPos() const { -extern "C" void getLeftHandPos__9daPy_py_cCFv() { - // NONMATCHING -} - -/* 80815958-80815980 00D918 0028+00 1/1 0/0 0/0 .text getPos__13daTag_FWall_cFUc */ -// void daTag_FWall_c::getPos(u8 param_0) { -extern "C" void getPos__13daTag_FWall_cFUc() { - // NONMATCHING -} - -/* 80815AEC-80815AEC 000158 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/actor/d_a_grass.cpp b/src/d/actor/d_a_grass.cpp index a1f09f8b76c..f90cd91c481 100644 --- a/src/d/actor/d_a_grass.cpp +++ b/src/d/actor/d_a_grass.cpp @@ -2248,8 +2248,7 @@ SECTION_DEAD static char const* const stringBase_805231CE = "D_MN07A"; #pragma pop /* 8051C304-8051D6CC 0006A4 13C8+00 1/1 0/0 0/0 .text create__9daGrass_cFv */ -// matches except for static data -#ifdef NONMATCHING +// NONMATCHING - matches except for static data int daGrass_c::create() { static csXyz l_setType0[] = { csXyz(0, 0, 0), csXyz(3, 0, -50), csXyz(-2, 0, 50), csXyz(50, 0, 27), @@ -2414,11 +2413,6 @@ int daGrass_c::create() { fopAcM_setStageLayer(this); return cPhs_COMPLEATE_e; } -#else -int daGrass_c::create() { - // NONMATCHING -} -#endif int daGrass_c::Delete() { if (m_myObj == this) { diff --git a/src/d/actor/d_a_kytag13.cpp b/src/d/actor/d_a_kytag13.cpp index 15530c56a4c..c3594fe933b 100644 --- a/src/d/actor/d_a_kytag13.cpp +++ b/src/d/actor/d_a_kytag13.cpp @@ -446,8 +446,7 @@ SECTION_DATA extern void* __vt__14dBgS_ObjGndChk[12] = { /* 8085F2B0-80860148 000130 0E98+00 1/1 0/0 0/0 .text * daKytag13_Execute_standard__FP13kytag13_class */ -// some regalloc -#ifdef NONMATCHING +// NONMATCHING - some regalloc static int daKytag13_Execute_standard(kytag13_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; dKankyo_snow_Packet* snow_packet = g_env_light.mpSnowPacket; @@ -536,7 +535,7 @@ static int daKytag13_Execute_standard(kytag13_class* i_this) { switch (snow_packet->mSnowEff[i].mStatus) { case 0: - snow_packet->mSnowEff[i].mWindSpeed = (4.0f * i_this->field_0x574) + cM_rndF(6.0f); + snow_packet->mSnowEff[i].mWindSpeed = (4.0f * i_this->mSpeed) + cM_rndF(6.0f); snow_packet->mSnowEff[i].mGravity = temp_f28; snow_packet->mSnowEff[i].mTimer = 0; snow_packet->mSnowEff[i].mPosition.x = sp40.x + cM_rndFX(500.0f * a_this->scale.x); @@ -754,11 +753,6 @@ static int daKytag13_Execute_standard(kytag13_class* i_this) { return 1; } -#else -static void daKytag13_Execute_standard(kytag13_class* i_this) { - // NONMATCHING -} -#endif /* 80860148-808601C0 000FC8 0078+00 4/3 0/0 0/0 .text __dt__14dBgS_ObjGndChkFv */ // dBgS_ObjGndChk::~dBgS_ObjGndChk() { @@ -852,18 +846,3 @@ static int daKytag13_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } - -/* 80860450-80860458 0012D0 0008+00 1/0 0/0 0/0 .text @20@__dt__14dBgS_ObjGndChkFv */ -static void func_80860450() { - // NONMATCHING -} - -/* 80860458-80860460 0012D8 0008+00 1/0 0/0 0/0 .text @76@__dt__14dBgS_ObjGndChkFv */ -static void func_80860458() { - // NONMATCHING -} - -/* 80860460-80860468 0012E0 0008+00 1/0 0/0 0/0 .text @60@__dt__14dBgS_ObjGndChkFv */ -static void func_80860460() { - // NONMATCHING -} diff --git a/src/d/actor/d_a_obj_bosswarp.cpp b/src/d/actor/d_a_obj_bosswarp.cpp index 37fa429a936..a0a0540f2be 100644 --- a/src/d/actor/d_a_obj_bosswarp.cpp +++ b/src/d/actor/d_a_obj_bosswarp.cpp @@ -678,8 +678,7 @@ SECTION_DEAD static char const* const stringBase_8057B64F = "Timer"; #pragma pop /* 8057AA94-8057B0D8 0014D4 0644+00 11/8 0/0 0/0 .text demoProc__15daObjBossWarp_cFv */ -#ifdef NONMATCHING -// regalloc +// NONMATCHING - regalloc int daObjBossWarp_c::demoProc() { static char* action_table[15] = { "WAIT", @@ -878,11 +877,6 @@ int daObjBossWarp_c::demoProc() { return 1; } -#else -int daObjBossWarp_c::demoProc() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 8057B4BC-8057B4C0 00015C 0004+00 0/0 0/0 0/0 .rodata @4491 */ diff --git a/src/d/actor/d_a_obj_carry.cpp b/src/d/actor/d_a_obj_carry.cpp index 787f3dc0e45..0cbbfd90ec2 100644 --- a/src/d/actor/d_a_obj_carry.cpp +++ b/src/d/actor/d_a_obj_carry.cpp @@ -2134,8 +2134,7 @@ COMPILER_STRIP_GATE(0x8047A394, &lit_3962); /* 8046F3E4-8046F4AC 000464 00C8+00 1/0 0/0 0/0 .text * CoHitCallBackBokkuri__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */ -#ifdef NONMATCHING -// literals +// NONMATCHING - literals static void CoHitCallBackBokkuri(fopAc_ac_c* param_0, dCcD_GObjInf* param_1, fopAc_ac_c* param_2, dCcD_GObjInf* param_3) { daObjCarry_c* _param_0 = static_cast(param_0); @@ -2155,12 +2154,6 @@ static void CoHitCallBackBokkuri(fopAc_ac_c* param_0, dCcD_GObjInf* param_1, } } } -#else -static void CoHitCallBackBokkuri(fopAc_ac_c* param_0, dCcD_GObjInf* param_1, - fopAc_ac_c* param_2, dCcD_GObjInf* param_3) { - // NONMATCHING -} -#endif /* 8046F4AC-8046F52C 00052C 0080+00 1/1 0/0 0/0 .text s_swA_sub__FPvPv */ static void* s_swA_sub(void* param_0, void* param_1) { @@ -2728,8 +2721,7 @@ s32 daObjCarry_c::CreateInit_Lv8Ball() { } /* 80470B5C-80470BF4 001BDC 0098+00 1/1 0/0 0/0 .text CreateHeap__12daObjCarry_cFv */ -#ifdef NONMATCHING -// 1 instruction in wrong place +// NONMATCHING - 1 instruction in wrong place s32 daObjCarry_c::CreateHeap() { s32 l_modelFlag; J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(getArcName(),getBmdName()); @@ -2748,14 +2740,9 @@ s32 daObjCarry_c::CreateHeap() { return 1; } -#else -s32 daObjCarry_c::CreateHeap() { - // NONMATCHING -} -#endif /* 80470BF4-80470CF0 001C74 00FC+00 1/1 0/0 0/0 .text create__12daObjCarry_cFv */ -#ifdef NONMATCHING +// NONMATCHING cPhs__Step daObjCarry_c::create() { cPhs__Step step; preInit(); @@ -2770,16 +2757,11 @@ cPhs__Step daObjCarry_c::create() { } if (step == cPhs_NEXT_e) { - return; + return step; } return step; } -#else -cPhs__Step daObjCarry_c::create() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 8047A3D4-8047A3E0 000AC8 000C+00 1/1 0/0 0/0 .rodata l_event_bitA$4815 */ @@ -2973,15 +2955,9 @@ COMPILER_STRIP_GATE(0x8047A424, &lit_5876); #pragma pop /* 80472B54-80472D8C 003BD4 0238+00 1/1 0/0 0/0 .text crr_pos__12daObjCarry_cFv */ -#ifdef NONMATCHING -void daObjCarry_c::crr_pos() { - -} -#else void daObjCarry_c::crr_pos() { // NONMATCHING } -#endif /* 80472D8C-80472E5C 003E0C 00D0+00 1/1 0/0 0/0 .text check_sink__12daObjCarry_cFPf */ void daObjCarry_c::check_sink(f32* param_0) { diff --git a/src/d/actor/d_a_obj_crope.cpp b/src/d/actor/d_a_obj_crope.cpp index e9f202b86ad..f6ea83e9fdd 100644 --- a/src/d/actor/d_a_obj_crope.cpp +++ b/src/d/actor/d_a_obj_crope.cpp @@ -401,15 +401,10 @@ static int daObjCrope_Create(fopAc_ac_c* i_this) { } /* 80BCD524-80BCD69C 0008C4 0178+00 1/1 0/0 0/0 .text __dt__12daObjCrope_cFv */ -#ifdef NONMATCHING +// NONMATCHING daObjCrope_c::~daObjCrope_c() { dComIfG_resDelete(&mPhase, l_arcName); } -#else -daObjCrope_c::~daObjCrope_c() { - // NONMATCHING -} -#endif /* 80BCD69C-80BCD6C4 000A3C 0028+00 1/0 0/0 0/0 .text daObjCrope_Delete__FP12daObjCrope_c */ @@ -457,8 +452,7 @@ COMPILER_STRIP_GATE(0x80BCEB24, &lit_4119); /* 80BCD6C4-80BCD9EC 000A64 0328+00 3/3 0/0 0/0 .text setNormalRopePos__12daObjCrope_cFv */ -// Horrible regalloc -#ifdef NONMATCHING +// NONMATCHING - Horrible regalloc void daObjCrope_c::setNormalRopePos() { cXyz* pdVar4; cXyz* pVVar5; @@ -522,11 +516,6 @@ void daObjCrope_c::setNormalRopePos() { this_01++; } } -#else -void daObjCrope_c::setNormalRopePos() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 80BCEB28-80BCEB2C 00005C 0004+00 1/2 0/0 0/0 .rodata @4407 */ diff --git a/src/d/actor/d_a_obj_dmelevator.cpp b/src/d/actor/d_a_obj_dmelevator.cpp index d14e45c6369..7de77381dd9 100644 --- a/src/d/actor/d_a_obj_dmelevator.cpp +++ b/src/d/actor/d_a_obj_dmelevator.cpp @@ -846,17 +846,10 @@ SECTION_DEAD static char const* const stringBase_80BDF93C = "Timer"; #pragma pop /* 80BDFAB0-80BDFAB8 -00001 0008+00 1/1 0/0 0/0 .data action_table$4279 */ -#ifdef NONMATCHING static char* action_table[2] = { "WAIT", "MOVE", }; -#else -SECTION_DATA static void* action_table[2] = { - (void*)(((char*)&d_a_obj_dmelevator__stringBase0) + 0x46), - (void*)(((char*)&d_a_obj_dmelevator__stringBase0) + 0x4B), -}; -#endif /* 80BDF16C-80BDF320 0018EC 01B4+00 3/3 0/0 0/0 .text demoProc__17daObjDmElevator_cFv */ int daObjDmElevator_c::demoProc() { diff --git a/src/d/actor/d_a_obj_fmobj.cpp b/src/d/actor/d_a_obj_fmobj.cpp index 957775053b4..2d1c38f43a2 100644 --- a/src/d/actor/d_a_obj_fmobj.cpp +++ b/src/d/actor/d_a_obj_fmobj.cpp @@ -7,6 +7,7 @@ #include "d/d_bg_w.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" +#include "SSystem/SComponent/c_math.h" #include "dol2asm.h" // @@ -138,8 +139,7 @@ COMPILER_STRIP_GATE(0x8057CF70, &lit_3745); /* 8057CDE0-8057CF60 000280 0180+00 1/0 0/0 0/0 .text daObj_Fmobj_Create__FP10fopAc_ac_c */ -// reg alloc -#ifdef NONMATCHING +// NONMATCHING - reg alloc static int daObj_Fmobj_Create(fopAc_ac_c* i_this) { obj_fmobj_class* a_this = (obj_fmobj_class*)i_this; fopAcM_SetupActor(a_this, obj_fmobj_class); @@ -168,18 +168,13 @@ static int daObj_Fmobj_Create(fopAc_ac_c* i_this) { a_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); mDoMtx_stack_c::transM(0.0f, -30.0f, 0.0f); - MTXCopy(mDoMtx_stack_c::get(), a_this->mDzbMtx); + MTXCopy(mDoMtx_stack_c::get(), a_this->mBgMtx); a_this->mpBgW->Move(); } return phase; } -#else -static int daObj_Fmobj_Create(fopAc_ac_c* param_0) { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 8057CF80-8057CFA0 -00001 0020+00 1/0 0/0 0/0 .data l_daObj_Fmobj_Method */ diff --git a/src/d/actor/d_a_obj_hbombkoya.cpp b/src/d/actor/d_a_obj_hbombkoya.cpp index 1ed5cb6c8e7..bf5a1aa5fad 100644 --- a/src/d/actor/d_a_obj_hbombkoya.cpp +++ b/src/d/actor/d_a_obj_hbombkoya.cpp @@ -359,18 +359,12 @@ int daObjHBombkoya_c::Delete() { /* 80C1C1A8-80C1C2BC 0009A8 0114+00 1/0 0/0 0/0 .text * daObjHBombkoya_create1st__FP16daObjHBombkoya_c */ -// vtable issues, read more below -#ifdef NONMATCHING +// NONMATCHING - vtable issues, read more below static int daObjHBombkoya_create1st(daObjHBombkoya_c* i_this) { fopAcM_SetupActor(i_this, daObjHBombkoya_c); return i_this->create1st(); } -#else -static void daObjHBombkoya_create1st(daObjHBombkoya_c* param_0) { - // NONMATCHING -} -#endif /* 80C1C2BC-80C1C304 000ABC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ // cM3dGCyl::~cM3dGCyl() { diff --git a/src/d/actor/d_a_obj_ice_l.cpp b/src/d/actor/d_a_obj_ice_l.cpp index cf737efa9df..8f83aa88711 100644 --- a/src/d/actor/d_a_obj_ice_l.cpp +++ b/src/d/actor/d_a_obj_ice_l.cpp @@ -182,8 +182,7 @@ COMPILER_STRIP_GATE(0x80C207C8, &lit_3741); /* 80C1FA60-80C1FCCC 0000E0 026C+00 1/1 0/0 0/0 .text Check_RideOn__12daObjIce_l_cF4cXyz */ -// float match issues -#ifdef NONMATCHING +// NONMATCHING - float match issues int daObjIce_l_c::Check_RideOn(cXyz param_0) { fopAc_ac_c* player_p = (fopAc_ac_c*)daPy_getPlayerActorClass(); s16 var_r29 = 0; @@ -212,11 +211,6 @@ int daObjIce_l_c::Check_RideOn(cXyz param_0) { cLib_addCalc(&field_0x5a0, var_r29, 0.015f, 100.0f, 0.0f); return 0; } -#else -int daObjIce_l_c::Check_RideOn(cXyz param_0) { - // NONMATCHING -} -#endif /* 80C1FCCC-80C1FCF8 00034C 002C+00 1/1 0/0 0/0 .text initBaseMtx__12daObjIce_l_cFv */ void daObjIce_l_c::initBaseMtx() { @@ -562,7 +556,7 @@ COMPILER_STRIP_GATE(0x80C20818, &lit_4003); /* 80C203C4-80C206AC 000A44 02E8+00 1/0 0/0 0/0 .text Execute__12daObjIce_l_cFPPA3_A4_f */ -#ifdef NONMATCHING +// NONMATCHING int daObjIce_l_c::Execute(Mtx** param_0) { daPy_py_c* player_p = daPy_getPlayerActorClass(); fopAcM_GetPosition(player_p); @@ -597,11 +591,6 @@ int daObjIce_l_c::Execute(Mtx** param_0) { setBaseMtx(); return 1; } -#else -int daObjIce_l_c::Execute(Mtx** param_0) { - // NONMATCHING -} -#endif /* 80C206AC-80C20750 000D2C 00A4+00 1/0 0/0 0/0 .text Draw__12daObjIce_l_cFv */ int daObjIce_l_c::Draw() { diff --git a/src/d/actor/d_a_obj_item.cpp b/src/d/actor/d_a_obj_item.cpp index be4f48e3969..ec1f32b0cb4 100644 --- a/src/d/actor/d_a_obj_item.cpp +++ b/src/d/actor/d_a_obj_item.cpp @@ -106,9 +106,8 @@ void daItem_c::setBaseMtx_1() { /* 8015B254-8015B320 155B94 00CC+00 2/2 0/0 0/0 .text * itemGetCoCallBack__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */ -// matches, but pushes up weak daPy_py_c functions incorrectly +// NONMATCHING - matches, but pushes up weak daPy_py_c functions incorrectly // might need other TUs that use daPy_py_c weaks to be finished first -#ifdef NONMATCHING static void itemGetCoCallBack(fopAc_ac_c* i_coActorA, dCcD_GObjInf* i_coObjInfA, fopAc_ac_c* i_coActorB, dCcD_GObjInf* i_coObjInfB) { daItem_c* a_coActorA = (daItem_c*)i_coActorA; @@ -127,12 +126,6 @@ static void itemGetCoCallBack(fopAc_ac_c* i_coActorA, dCcD_GObjInf* i_coObjInfA, } } } -#else -static void itemGetCoCallBack(fopAc_ac_c* param_0, dCcD_GObjInf* param_1, fopAc_ac_c* param_2, - dCcD_GObjInf* param_3) { - // NONMATCHING -} -#endif /* 8015B320-8015B3D8 155C60 00B8+00 2/2 0/0 0/0 .text * itemGetTgCallBack__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */ diff --git a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp index d36617e3839..53e46af13f0 100644 --- a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp +++ b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp @@ -205,8 +205,7 @@ void dalv4CandleDemoTag_c::setBaseMtx() { } /* 80C5CA90-80C5CBA4 000190 0114+00 1/1 0/0 0/0 .text create__20dalv4CandleDemoTag_cFv */ -// vtables need work -#ifdef NONMATCHING +// NONMATCHING - vtables need work int dalv4CandleDemoTag_c::create() { fopAcM_SetupActor(this, dalv4CandleDemoTag_c); @@ -230,11 +229,6 @@ int dalv4CandleDemoTag_c::create() { return cPhs_COMPLEATE_e; } -#else -int dalv4CandleDemoTag_c::create() { - // NONMATCHING -} -#endif /* 80C5CBA4-80C5CBE8 0002A4 0044+00 1/1 0/0 0/0 .text Execute__20dalv4CandleDemoTag_cFv */ diff --git a/src/d/actor/d_a_obj_master_sword.cpp b/src/d/actor/d_a_obj_master_sword.cpp index 421d1aab350..67f5a8d4ed1 100644 --- a/src/d/actor/d_a_obj_master_sword.cpp +++ b/src/d/actor/d_a_obj_master_sword.cpp @@ -437,8 +437,7 @@ void daObjMasterSword_c::setAction(daObjMasterSword_c::Mode_e i_mode) { /* 80C90F6C-80C9120C 0004EC 02A0+00 1/1 0/0 0/0 .text create_init__18daObjMasterSword_cFv */ -// matches, but weak function emission is hella weird. cant be linked til its fixed -#ifdef NONMATCHING +// NONMATCHING - matches, but weak function emission is hella weird. cant be linked til its fixed void daObjMasterSword_c::create_init() { fopAcM_setCullSizeBox2(this, mpModel->getModelData()); initCollision(); @@ -464,11 +463,6 @@ void daObjMasterSword_c::create_init() { setAction(MODE_0_e); } -#else -void daObjMasterSword_c::create_init() { - // NONMATCHING -} -#endif /* 80C9120C-80C9127C 00078C 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ // dBgS_ObjAcch::~dBgS_ObjAcch() { @@ -514,16 +508,10 @@ static int daObjMasterSword_Delete(daObjMasterSword_c* i_this) { } /* 80C91448-80C915E8 0009C8 01A0+00 1/1 0/0 0/0 .text __dt__18daObjMasterSword_cFv */ -// vtables issues -#ifdef NONMATCHING +// NONMATCHING - vtables issues daObjMasterSword_c::~daObjMasterSword_c() { dComIfG_resDelete(&mPhase, l_arcName); } -#else -daObjMasterSword_c::~daObjMasterSword_c() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 80C91960-80C91968 000020 0008+00 1/1 0/0 0/0 .rodata @4030 */ diff --git a/src/d/actor/d_a_obj_swBallA.cpp b/src/d/actor/d_a_obj_swBallA.cpp index b25c82d9b98..88a081e3851 100644 --- a/src/d/actor/d_a_obj_swBallA.cpp +++ b/src/d/actor/d_a_obj_swBallA.cpp @@ -412,19 +412,19 @@ extern "C" void __dt__12J3DFrameCtrlFv() { } /* 80CF3970-80CF3A90 0006F0 0120+00 1/1 0/0 0/0 .text create__14daObjSwBallA_cFv */ -#ifdef NONMATCHING +// NONMATCHING int daObjSwBallA_c::create() { fopAcM_SetupActor(this, daObjSwBallA_c); if (field_0x5c4 == 0) { field_0x5c4 = 1; - field_0x5c6 = orig.angle.x; - field_0x5c8 = orig.angle.z; + field_0x5c6 = home.angle.x; + field_0x5c8 = home.angle.z; shape_angle.x = 0; current.angle.x = 0; - orig.angle.x = 0; + home.angle.x = 0; shape_angle.z = 0; current.angle.z = 0; - orig.angle.z = 0; + home.angle.z = 0; } int res = dComIfG_resLoad(&field_0x57c, l_arcName); if (res == cPhs_COMPLEATE_e) { @@ -436,11 +436,6 @@ int daObjSwBallA_c::create() { } return res; } -#else -int daObjSwBallA_c::create() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 80CF452C-80CF4530 000024 0004+00 1/1 0/0 0/0 .bss None */ diff --git a/src/d/actor/d_a_obj_swBallB.cpp b/src/d/actor/d_a_obj_swBallB.cpp index 0d65f5d3562..25d7f215e79 100644 --- a/src/d/actor/d_a_obj_swBallB.cpp +++ b/src/d/actor/d_a_obj_swBallB.cpp @@ -640,7 +640,7 @@ void daObjSwBallB_c::PutCrrPos() { /* 80CF56A4-80CF582C 001164 0188+00 1/1 0/0 0/0 .text draw__14daObjSwBallB_cFv */ -#ifdef NONMATCHING +// NONMATCHING int daObjSwBallB_c::draw() { g_env_light.settingTevStruct(0, ¤t.pos, &tevStr); g_env_light.setLightTevColorType_MAJI(mModel, &tevStr); @@ -662,11 +662,6 @@ int daObjSwBallB_c::draw() { dComIfGd_setList(); return 1; } -#else -int daObjSwBallB_c::draw() { - // NONMATCHING -} -#endif /* 80CF582C-80CF5860 0012EC 0034+00 1/1 0/0 0/0 .text _delete__14daObjSwBallB_cFv */ int daObjSwBallB_c::_delete() { diff --git a/src/d/actor/d_a_obj_zrTurara.cpp b/src/d/actor/d_a_obj_zrTurara.cpp index 39c0e63c917..116da45325f 100644 --- a/src/d/actor/d_a_obj_zrTurara.cpp +++ b/src/d/actor/d_a_obj_zrTurara.cpp @@ -7,6 +7,7 @@ #include "d/d_bg_w.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" +#include "SSystem/SComponent/c_math.h" #include "dol2asm.h" // @@ -500,8 +501,7 @@ COMPILER_STRIP_GATE(0x80D415F8, &lit_4060); #pragma pop /* 80D410E0-80D412A0 000C60 01C0+00 1/0 0/0 0/0 .text modeBreak__12daZrTurara_cFv */ -#ifdef NONMATCHING -// regalloc +// NONMATCHING - regalloc void daZrTurara_c::modeBreak() { cXyz scale(mScaleF, mScaleF, mScaleF); mParticleKey = dComIfGp_particle_set(mParticleKey, 0x8a98, ¤t.pos, NULL, &scale); @@ -525,11 +525,6 @@ void daZrTurara_c::modeBreak() { } } } -#else -void daZrTurara_c::modeBreak() { - // NONMATCHING -} -#endif /* 80D412A0-80D412AC 000E20 000C+00 2/2 0/0 0/0 .text init_modeEnd__12daZrTurara_cFv */ void daZrTurara_c::init_modeEnd() { diff --git a/src/d/actor/d_a_scene_exit.cpp b/src/d/actor/d_a_scene_exit.cpp index 2c43627b806..687dd3e77c4 100644 --- a/src/d/actor/d_a_scene_exit.cpp +++ b/src/d/actor/d_a_scene_exit.cpp @@ -6,6 +6,7 @@ #include "d/actor/d_a_scene_exit.h" #include "dol2asm.h" #include "d/d_com_inf_game.h" +#include "d/actor/d_a_player.h" #include "m_Do/m_Do_mtx.h" // @@ -120,9 +121,7 @@ COMPILER_STRIP_GATE(0x80485CA8, &lit_3842); #pragma pop /* 80485A50-80485C90 000290 0240+00 1/1 0/0 0/0 .text execute__8daScex_cFv */ -// regalloc -// this matches debug but not retail :/ -#ifdef NONMATCHING +// NONMATCHING - regalloc, this matches debug but not retail :/ int daScex_c::execute() { daPy_py_c* player = daPy_getPlayerActorClass(); cXyz spC; @@ -164,11 +163,6 @@ int daScex_c::execute() { return 1; } -#else -int daScex_c::execute() { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 80485CAC-80485CCC -00001 0020+00 1/0 0/0 0/0 .data l_daScex_Method */ diff --git a/src/d/actor/d_a_swc00.cpp b/src/d/actor/d_a_swc00.cpp index 63fdc40bb51..895d11cb0d5 100644 --- a/src/d/actor/d_a_swc00.cpp +++ b/src/d/actor/d_a_swc00.cpp @@ -64,10 +64,9 @@ inline int daSwc00_getShape(daSwc00_c* i_this) { } /* 805A13F8-805A15DC 000078 01E4+00 1/1 0/0 0/0 .text hitCheck__FP9daSwc00_c */ -// r30 / r31 swap -#ifdef NONMATCHING +// NONMATCHING - r30 / r31 swap static bool hitCheck(daSwc00_c* i_swc) { - fopAc_ac_c* playerAc = daPy_getPlayerActorClass(); + fopAc_ac_c* playerAc = (fopAc_ac_c*)daPy_getPlayerActorClass(); fopAc_ac_c* player; if (daSwc00_getCondition(i_swc) == 2) { @@ -105,11 +104,6 @@ static bool hitCheck(daSwc00_c* i_swc) { return false; } -#else -static bool hitCheck(daSwc00_c* param_0) { - // NONMATCHING -} -#endif /* 805A15DC-805A15FC 00025C 0020+00 1/0 0/0 0/0 .text daSwc00_Execute__FP9daSwc00_c */ static int daSwc00_Execute(daSwc00_c* i_this) { diff --git a/src/d/actor/d_a_tag_wljump.cpp b/src/d/actor/d_a_tag_wljump.cpp index dce69348101..4cc02f64ed1 100644 --- a/src/d/actor/d_a_tag_wljump.cpp +++ b/src/d/actor/d_a_tag_wljump.cpp @@ -7,6 +7,8 @@ #include "dol2asm.h" #include "d/d_path.h" #include "d/d_procname.h" +#include "d/actor/d_a_player.h" +#include "d/actor/d_a_midna.h" #include "JSystem/JKernel/JKRHeap.h" // @@ -104,8 +106,7 @@ static int daTagWljump_Delete(daTagWljump_c* param_0) { /* ############################################################################################## */ /* 80D65090-80D6587C 000250 07EC+00 1/1 0/0 0/0 .text execute__13daTagWljump_cFv */ -// reg swap -#ifdef NONMATCHING +// NONMATCHING - reg swap int daTagWljump_c::execute() { attention_info.flags = 0; if (field_0x56c[1]) { @@ -203,8 +204,8 @@ int daTagWljump_c::execute() { if (uVar6 == field_0x5c4->m_num) { field_0x568 = -1; } - } else if (field_0x56b) { - field_0x56b = 0; + } else if (mNextCheckFlg) { + mNextCheckFlg = 0; if (field_0x56a < field_0x568) { field_0x568++; if (field_0x5c4->m_num == field_0x568) { @@ -220,7 +221,7 @@ int daTagWljump_c::execute() { eyePos.set(pPoint->m_position.x, pPoint->m_position.y, pPoint->m_position.z); attention_info.position = eyePos; attention_info.position.y += 220.0f; - field_0x5c8 = pPoint->field_0x3 * 10.0f; + mLandArea = pPoint->mArg0 * 10.0f; if (pPoint->field_0x1 == 1) { shape_angle.z = 1; } else { @@ -260,109 +261,6 @@ int daTagWljump_c::execute() { return 1; } -#else -/* 80D658CC-80D658D0 000000 0004+00 1/1 0/0 0/0 .rodata @4044 */ -SECTION_RODATA static f32 const lit_4044 = 1.0f; -COMPILER_STRIP_GATE(0x80D658CC, &lit_4044); - -/* 80D658D0-80D658D4 000004 0004+00 0/1 0/0 0/0 .rodata @4045 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4045 = -1.0f; -COMPILER_STRIP_GATE(0x80D658D0, &lit_4045); -#pragma pop - -/* 80D658D4-80D658DC 000008 0004+04 0/1 0/0 0/0 .rodata @4046 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4046[4 + 4 /* padding */] = { - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80D658D4, &lit_4046); -#pragma pop - -/* 80D658DC-80D658E4 000010 0008+00 0/1 0/0 0/0 .rodata @4047 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4047[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80D658DC, &lit_4047); -#pragma pop - -/* 80D658E4-80D658EC 000018 0008+00 0/1 0/0 0/0 .rodata @4048 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4048[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80D658E4, &lit_4048); -#pragma pop - -/* 80D658EC-80D658F4 000020 0008+00 0/1 0/0 0/0 .rodata @4049 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4049[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80D658EC, &lit_4049); -#pragma pop - -/* 80D658F4-80D658F8 000028 0004+00 0/1 0/0 0/0 .rodata @4050 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4050 = 5.0f; -COMPILER_STRIP_GATE(0x80D658F4, &lit_4050); -#pragma pop - -/* 80D658F8-80D658FC 00002C 0004+00 0/1 0/0 0/0 .rodata @4051 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4051 = 10.0f; -COMPILER_STRIP_GATE(0x80D658F8, &lit_4051); -#pragma pop - -/* 80D658FC-80D65904 000030 0004+04 0/1 0/0 0/0 .rodata @4052 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4052[1 + 1 /* padding */] = { - 220.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x80D658FC, &lit_4052); -#pragma pop - -/* 80D65904-80D6590C 000038 0008+00 0/1 0/0 0/0 .rodata @4054 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4054[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80D65904, &lit_4054); -#pragma pop - -/* 80D6590C-80D65914 000040 0008+00 0/1 0/0 0/0 .rodata @4055 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4055[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80D6590C, &lit_4055); -#pragma pop - -int daTagWljump_c::execute() { - // NONMATCHING -} -#endif /* 80D6587C-80D6589C 000A3C 0020+00 1/0 0/0 0/0 .text daTagWljump_Execute__FP13daTagWljump_c */ static int daTagWljump_Execute(daTagWljump_c* param_0) { diff --git a/src/d/actor/d_a_vrbox2.cpp b/src/d/actor/d_a_vrbox2.cpp index 2ded84120c9..a8ca282f1a6 100644 --- a/src/d/actor/d_a_vrbox2.cpp +++ b/src/d/actor/d_a_vrbox2.cpp @@ -186,8 +186,7 @@ SECTION_DEAD static char const* const stringBase_80499ACC = "F_SP127"; static s16 mangZ; /* 80498ACC-804990DC 0000CC 0610+00 1/0 0/0 0/0 .text daVrbox2_Draw__FP12vrbox2_class */ -// reg alloc -#ifdef NONMATCHING +// NONMATCHING - reg alloc static int daVrbox2_Draw(vrbox2_class* i_this) { cXyz sp14; cXyz sp8; @@ -345,11 +344,6 @@ static int daVrbox2_Draw(vrbox2_class* i_this) { return 1; } -#else -static int daVrbox2_Draw(vrbox2_class* param_0) { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 80499AA4-80499AA8 000038 0004+00 0/1 0/0 0/0 .rodata @4069 */ @@ -415,8 +409,7 @@ SECTION_DEAD static char const* const stringBase_80499AD4 = "R_SP30"; #pragma pop /* 804990DC-804997E8 0006DC 070C+00 1/1 0/0 0/0 .text daVrbox2_color_set__FP12vrbox2_class */ -// some regalloc at the end -#ifdef NONMATCHING +// NONMATCHING - some regalloc at the end static int daVrbox2_color_set(vrbox2_class* i_this) { dKankyo_sun_Packet* sun_p = g_env_light.mpSunPacket; @@ -590,11 +583,6 @@ static int daVrbox2_color_set(vrbox2_class* i_this) { return 1; } -#else -static int daVrbox2_color_set(vrbox2_class* param_0) { - // NONMATCHING -} -#endif /* 804997E8-8049982C 000DE8 0044+00 1/0 0/0 0/0 .text daVrbox2_Execute__FP12vrbox2_class */ diff --git a/src/d/actor/d_grass.inc b/src/d/actor/d_grass.inc index 6dd01f54b19..38033a4629c 100644 --- a/src/d/actor/d_grass.inc +++ b/src/d/actor/d_grass.inc @@ -1,3 +1,6 @@ +#include "d/actor/d_a_grass.h" +#include "d/d_com_inf_game.h" +#include "d/actor/d_a_player.h" #include "JSystem/J3DGraphBase/J3DDrawBuffer.h" #include "SSystem/SComponent/c_lib.h" #include "f_op/f_op_overlap_mng.h" @@ -23,8 +26,7 @@ void dGrass_data_c::Direction_Set(fopAc_ac_c* param_0, u32 param_1, int param_2, /* 8051E1C8-8051EB4C 002568 0984+00 1/1 0/0 0/0 .text * WorkAt__13dGrass_data_cFP10fopAc_ac_cUliP15dCcMassS_HitInfUs */ -// literals / regswap, equivalent? -#ifdef NONMATCHING +// NONMATCHING - literals / regswap, equivalent? void dGrass_data_c::WorkAt(fopAc_ac_c* param_0, u32 param_1, int i_roomNo, dCcMassS_HitInf* param_3, u16 i_particleID) { cCcD_Obj* hit_obj = param_3->GetAtHitObj(); @@ -47,8 +49,8 @@ void dGrass_data_c::WorkAt(fopAc_ac_c* param_0, u32 param_1, int i_roomNo, dCcMa WorkAt_NoCutAnim(param_0, param_1, i_roomNo, param_3, hit_obj); return; } - } else if (daPy_getPlayerActorClass()->getCutType() >= CUT_TYPE_NM_RIGHT && - daPy_getPlayerActorClass()->getCutType() <= CUT_TYPE_FINISH_VERTICAL) + } else if (daPy_getPlayerActorClass()->getCutType() >= daPy_py_c::CUT_TYPE_NM_RIGHT && + daPy_getPlayerActorClass()->getCutType() <= daPy_py_c::CUT_TYPE_FINISH_VERTICAL) { if (m_pos.abs(player_p->current.pos) > 158.0f) { if (m_pos.abs(player_p->current.pos) < 200.0f) { @@ -56,22 +58,22 @@ void dGrass_data_c::WorkAt(fopAc_ac_c* param_0, u32 param_1, int i_roomNo, dCcMa } return; } - } else if (daPy_getPlayerActorClass()->getCutType() == CUT_TYPE_TURN_RIGHT || - daPy_getPlayerActorClass()->getCutType() == CUT_TYPE_TURN_LEFT) + } else if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_TURN_RIGHT || + daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_TURN_LEFT) { if (m_pos.abs(player_p->current.pos) > 200.0f) { WorkAt_NoCutAnim(param_0, param_1, i_roomNo, param_3, hit_obj); return; } - } else if (daPy_getPlayerActorClass()->getCutType() == CUT_TYPE_LARGE_TURN_RIGHT || - daPy_getPlayerActorClass()->getCutType() == CUT_TYPE_LARGE_TURN_LEFT) + } else if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_LARGE_TURN_RIGHT || + daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_LARGE_TURN_LEFT) { if (m_pos.abs(player_p->current.pos) > 500.0f) { WorkAt_NoCutAnim(param_0, param_1, i_roomNo, param_3, hit_obj); return; } - } else if (daPy_getPlayerActorClass()->getCutType() == CUT_TYPE_NM_VERTICAL || - daPy_getPlayerActorClass()->getCutType() == CUT_TYPE_NM_STAB) + } else if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_NM_VERTICAL || + daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_NM_STAB) { if (m_pos.abs(player_p->current.pos) > 158.0f) { return; @@ -117,12 +119,6 @@ void dGrass_data_c::WorkAt(fopAc_ac_c* param_0, u32 param_1, int i_roomNo, dCcMa mDoAud_seStart(JA_SE_LK_CUT_GRASS, &m_pos, 0, dComIfGp_getReverb(i_roomNo)); } } -#else -void dGrass_data_c::WorkAt(fopAc_ac_c* param_0, u32 param_1, int param_2, - dCcMassS_HitInf* param_3, u16 param_4) { - // NONMATCHING -} -#endif /* 8051EB4C-8051EB88 002EEC 003C+00 3/3 0/0 0/0 .text __dt__5csXyzFv */ // csXyz::~csXyz() { @@ -227,8 +223,7 @@ static f32 checkGroundY(cXyz& param_0) { } /* 80520030-8052067C 0043D0 064C+00 1/1 0/0 0/0 .text update__15dGrass_packet_cFv */ -// mostly matches except literals, some regalloc, and one out of order block -#ifdef NONMATCHING +// NONMATCHING - mostly matches except literals, some regalloc, and one out of order block void dGrass_packet_c::update() { static s16 mAngleZ[1500]; @@ -347,11 +342,6 @@ void dGrass_packet_c::update() { mDoLib_clipper::resetFar(); dComIfGd_getListPacket()->entryImm(this, 0); } -#else -void dGrass_packet_c::update() { - // NONMATCHING -} -#endif /* 8052067C-80520770 004A1C 00F4+00 1/1 0/0 0/0 .text * setData__15dGrass_packet_cFP13dGrass_data_ciR4cXyziUcUcsUc */ diff --git a/src/d/d_attention.cpp b/src/d/d_attention.cpp index 2cf5691d430..227fc0fc166 100644 --- a/src/d/d_attention.cpp +++ b/src/d/d_attention.cpp @@ -4,18 +4,19 @@ // #include "d/d_attention.h" -#include "JSystem/J3DGraphBase/J3DMaterial.h" #include "JSystem/JKernel/JKRSolidHeap.h" #include "d/actor/d_a_player.h" #include "d/d_com_inf_game.h" -#include "dol2asm.h" #include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_controller_pad.h" +#define DRAW_TYPE_YELLOW 0 +#define DRAW_TYPE_RED 1 + class dAttDrawParam_c { public: /* 80070158 */ dAttDrawParam_c(); - /* 80073FC4 */ virtual ~dAttDrawParam_c(); + /* 80073FC4 */ virtual ~dAttDrawParam_c() {} /* 0x4 */ s8 field_0x4; /* 0x8 */ f32 mCursorDistance; @@ -32,22 +33,25 @@ static bool padLockButton(s32 i_padNo) { /* 803A9BF8-803A9C04 006D18 000C+00 2/2 0/0 0/0 .data loc_type_tbl__12dAttention_c */ type_tbl_entry dAttention_c::loc_type_tbl[3] = { - {0, 1}, - {1, 2}, - {2, 4}, + {fopAc_attn_LOCK_e, 0x1}, + {fopAc_attn_TALK_e, 0x2}, + {fopAc_attn_BATTLE_e, 0x4}, }; /* 803A9C04-803A9C18 006D24 0014+00 1/1 0/0 0/0 .data act_type_tbl__12dAttention_c */ type_tbl_entry dAttention_c::act_type_tbl[5] = { - {3, 8}, {4, 16}, {5, 32}, {6, 64}, {7, 128}, + {fopAc_attn_SPEAK_e, 0x8}, + {fopAc_attn_CARRY_e, 0x10}, + {fopAc_attn_DOOR_e, 0x20}, + {fopAc_attn_JUEL_e, 0x40}, + {fopAc_attn_ETC_e, 0x80}, }; /* 80450F58-80450F60 000458 0008+00 0/0 2/2 0/0 .sbss None */ -extern bool on_final_boss_stg; -bool on_final_boss_stg; +static bool l_isFinalBossStg; /* 80070038-80070110 06A978 00D8+00 1/1 0/0 0/0 .text __ct__11dAttParam_cFl */ -dAttParam_c::dAttParam_c(s32 param_0) { +dAttParam_c::dAttParam_c(s32) { field_0x4 = 45.0f; field_0x8 = 30.0f; field_0xc = 90.0f; @@ -72,10 +76,9 @@ dAttParam_c::dAttParam_c(s32 param_0) { field_0x38 = 1.7f; field_0x3c = 1.0f; - on_final_boss_stg = strcmp(dComIfGp_getStartStageName(), "D_MN09B") == 0; + l_isFinalBossStg = strcmp(dComIfGp_getStartStageName(), "D_MN09B") == 0; } - /* 80070110-80070158 06AA50 0048+00 2/1 0/0 0/0 .text __dt__11dAttParam_cFv */ dAttParam_c::~dAttParam_c() {} @@ -87,95 +90,103 @@ dAttDrawParam_c::dAttDrawParam_c() { /* 80070178-80070198 06AAB8 0020+00 1/0 0/0 0/0 .text * execute__19dAttDraw_CallBack_cFUsP16J3DTransformInfo */ -int dAttDraw_CallBack_c::execute(u16 param_0, J3DTransformInfo* param_1) { +int dAttDraw_CallBack_c::execute(u16 param_0, J3DTransformInfo* transform) { if (param_0 == 0) { - param_1->mTranslate.y *= 0.6f; + transform->mTranslate.y *= 0.6f; } return 1; } /* 80424B0C-80424B20 05182C 0010+04 3/3 0/0 0/0 .bss g_AttDwHIO */ -static dAttDrawParam_c g_AttDwHIO; +dAttDrawParam_c g_AttDwHIO; /* 80070198-80070774 06AAD8 05DC+00 0/0 1/1 0/0 .text __ct__12dAttention_cFP10fopAc_ac_cUl */ dAttention_c::dAttention_c(fopAc_ac_c* i_player, u32 i_padNo) { mpPlayer = i_player; mPadNo = i_padNo; - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; field_0x32e = 0; field_0x32f = 0; mCheckObjectOffset = 0; mActionOffset = 0; mLockOnOffset = 0; - initList(-1); + initList(0xFFFFFFFF); mPlayerAttentionFlags = 0; field_0x32a = 0; - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; field_0x32b = 4; field_0x32c = 0; mAttnBlockTimer = 0; heap = mDoExt_createSolidHeapFromGameToCurrent(0x9000, 0); + JUT_ASSERT(0x198, heap != 0); J3DModelData* modelDataR = (J3DModelData*)dComIfG_getObjectRes("Always", 0x25); + JUT_ASSERT(0x1BB, modelDataR); + J3DModelData* modelDataY = (J3DModelData*)dComIfG_getObjectRes("Always", 0x26); + JUT_ASSERT(0x1BF, modelDataY); for (int i = 0; i < 2; i++) { - draw[i].mModel[0] = mDoExt_J3DModel__create(modelDataY, 0x80000, 0x11000285); - draw[i].mModel[1] = mDoExt_J3DModel__create(modelDataR, 0x80000, 0x11000285); + draw[i].mModel[DRAW_TYPE_YELLOW] = mDoExt_J3DModel__create(modelDataY, 0x80000, 0x11000285); + JUT_ASSERT(0x1CA, draw[i].mModel[DRAW_TYPE_YELLOW] != 0); - void* res = dComIfG_getObjectRes("Always", 0x11); - draw[i].mNoticeCursorBck[0].init((J3DAnmTransform*)res, TRUE, 2, 1.0f, 0, -1, false); + draw[i].mModel[DRAW_TYPE_RED] = mDoExt_J3DModel__create(modelDataR, 0x80000, 0x11000285); + JUT_ASSERT(0x1D4, draw[i].mModel[DRAW_TYPE_RED] != 0); - res = dComIfG_getObjectRes("Always", 0x2B); - draw[i].mNoticeCursorBpk[0].init(modelDataY, (J3DAnmColor*)res, TRUE, 2, 1.0f, 0, -1); + int res; + res = draw[i].mNoticeCursorBck[DRAW_TYPE_YELLOW].init((J3DAnmTransform*)dComIfG_getObjectRes("Always", 0x11), TRUE, 2, 1.0f, 0, -1, false); + JUT_ASSERT(0x1DC, res == 1); - res = dComIfG_getObjectRes("Always", 0x37); - draw[i].mNoticeCursorBrk[0].init(modelDataY, (J3DAnmTevRegKey*)res, TRUE, 2, 1.0f, 0, -1); + res = draw[i].mNoticeCursorBpk[DRAW_TYPE_YELLOW].init(modelDataY, (J3DAnmColor*)dComIfG_getObjectRes("Always", 0x2B), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x1E4, res == 1); - res = dComIfG_getObjectRes("Always", 0x3F); - draw[i].mNoticeCursorBtk[0].init(modelDataY, (J3DAnmTextureSRTKey*)res, TRUE, 2, 1.0f, 0, + res = draw[i].mNoticeCursorBrk[DRAW_TYPE_YELLOW].init(modelDataY, (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", 0x37), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x1EC, res == 1); + + res = draw[i].mNoticeCursorBtk[DRAW_TYPE_YELLOW].init(modelDataY, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Always", 0x3F), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x1F4, res == 1); - res = dComIfG_getObjectRes("Always", 0x38); - draw[i].mNoticeCursor02Brk[0].init(modelDataY, (J3DAnmTevRegKey*)res, TRUE, 2, 1.0f, 0, -1); + res = draw[i].mNoticeCursor02Brk[DRAW_TYPE_YELLOW].init(modelDataY, (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", 0x38), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x1FC, res == 1); + + res = draw[i].mNoticeCursorBck[DRAW_TYPE_RED].init((J3DAnmTransform*)dComIfG_getObjectRes("Always", 0x10), TRUE, 2, 1.0f, 0, -1, false); + JUT_ASSERT(0x204, res == 1); - res = dComIfG_getObjectRes("Always", 0x10); - draw[i].mNoticeCursorBck[1].init((J3DAnmTransform*)res, TRUE, 2, 1.0f, 0, -1, false); + res = draw[i].mNoticeCursorBpk[DRAW_TYPE_RED].init(modelDataR, (J3DAnmColor*)dComIfG_getObjectRes("Always", 0x2A), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x20B, res == 1); - res = dComIfG_getObjectRes("Always", 0x2A); - draw[i].mNoticeCursorBpk[1].init(modelDataR, (J3DAnmColor*)res, TRUE, 2, 1.0f, 0, -1); + res = draw[i].mNoticeCursorBrk[DRAW_TYPE_RED].init(modelDataR, (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", 0x35), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x212, res == 1); - res = dComIfG_getObjectRes("Always", 0x35); - draw[i].mNoticeCursorBrk[1].init(modelDataR, (J3DAnmTevRegKey*)res, TRUE, 2, 1.0f, 0, -1); - - res = dComIfG_getObjectRes("Always", 0x3E); - draw[i].mNoticeCursorBtk[1].init(modelDataR, (J3DAnmTextureSRTKey*)res, TRUE, 2, 1.0f, 0, + res = draw[i].mNoticeCursorBtk[DRAW_TYPE_RED].init(modelDataR, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Always", 0x3E), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x219, res == 1); - res = dComIfG_getObjectRes("Always", 0x36); - draw[i].mNoticeCursor02Brk[1].init(modelDataR, (J3DAnmTevRegKey*)res, TRUE, 2, 1.0f, 0, -1); + res = draw[i].mNoticeCursor02Brk[DRAW_TYPE_RED].init(modelDataR, (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", 0x36), TRUE, 2, 1.0f, 0, -1); + JUT_ASSERT(0x220, res == 1); - res = dComIfG_getObjectRes("Always", 0xC); - draw[i].mImpactBck.init((J3DAnmTransform*)res, TRUE, 0, 1.0f, 0, -1, false); + res = draw[i].mImpactBck.init((J3DAnmTransform*)dComIfG_getObjectRes("Always", 0xC), TRUE, 0, 1.0f, 0, -1, false); + JUT_ASSERT(0x228, res == 1); - res = dComIfG_getObjectRes("Always", 0x29); - draw[i].mImpactBpk.init(modelDataR, (J3DAnmColor*)res, TRUE, 0, 1.0f, 0, -1); + res = draw[i].mImpactBpk.init(modelDataR, (J3DAnmColor*)dComIfG_getObjectRes("Always", 0x29), TRUE, 0, 1.0f, 0, -1); + JUT_ASSERT(0x22F, res == 1); - res = dComIfG_getObjectRes("Always", 0x32); - draw[i].mImpactBrk.init(modelDataR, (J3DAnmTevRegKey*)res, TRUE, 0, 1.0f, 0, -1); + res = draw[i].mImpactBrk.init(modelDataR, (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", 0x32), TRUE, 0, 1.0f, 0, -1); + JUT_ASSERT(0x236, res == 1); - res = dComIfG_getObjectRes("Always", 0x3D); - draw[i].mImpactBtk.init(modelDataR, (J3DAnmTextureSRTKey*)res, TRUE, 0, 1.0f, 0, -1); + res = draw[i].mImpactBtk.init(modelDataR, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Always", 0x3D), TRUE, 0, 1.0f, 0, -1); + JUT_ASSERT(0x23D, res == 1); - draw[i].field_0x170 = 0; - draw[i].field_0x171 = 1; - draw[i].field_0x172 = 0; - draw[i].field_0x174 = 1; + draw[i].mDrawType = DRAW_TYPE_YELLOW; + draw[i].mAlphaAnmFrameMax = 1; + draw[i].mAlphaAnmFrame = 0; + draw[i].mAlphaAnmPlayDirection = 1; draw[i].field_0x173 = 2; draw[i].field_0x175 = 0; } @@ -196,7 +207,6 @@ dAttention_c::dAttention_c(fopAc_ac_c* i_player, u32 i_padNo) { g_AttDwHIO.field_0x4 = -1; } - /* 80070774-80070844 06B0B4 00D0+00 0/0 2/2 0/0 .text __dt__12dAttention_cFv */ dAttention_c::~dAttention_c() { if (heap != NULL) { @@ -206,9 +216,9 @@ dAttention_c::~dAttention_c() { } /* 80070844-80070880 06B184 003C+00 2/2 2/2 8/8 .text GetLockonList__12dAttention_cFl */ -dAttList_c* dAttention_c::GetLockonList(s32 param_0) { +dAttList_c* dAttention_c::GetLockonList(s32 i_no) { if (mLockonCount != 0) { - return &mLockOnList[(mLockOnOffset + param_0) % mLockonCount]; + return &mLockOnList[(mLockOnOffset + i_no) % mLockonCount]; } return NULL; @@ -219,8 +229,10 @@ dAttList_c* dAttention_c::getActionBtnB() { int i; dAttList_c* list = GetLockonList(0); - if (list != NULL && list->getActor() != NULL && list->mType == 1 && LockonTruth() && - !(list->getActor()->attention_info.flags & 0x2000000)) { + if (list != NULL && list->getActor() != NULL && + list->mType == fopAc_attn_TALK_e && LockonTruth() && + !(list->getActor()->attention_info.flags & 0x2000000)) + { return list; } @@ -229,7 +241,7 @@ dAttList_c* dAttention_c::getActionBtnB() { } for (i = 0; i < mActionCount; i++) { - if (mActionList[i].mType == 3) { + if (mActionList[i].mType == fopAc_attn_SPEAK_e) { if (!(mActionList[i].getActor()->attention_info.flags & 0x2000000)) { return &mActionList[i]; } @@ -246,7 +258,7 @@ dAttList_c* dAttention_c::getActionBtnXY() { int i; dAttList_c* list = GetLockonList(0); - if (list != NULL && list->getActor() != NULL && list->mType == 1 && LockonTruth()) { + if (list != NULL && list->getActor() != NULL && list->mType == fopAc_attn_TALK_e && LockonTruth()) { if (list->getActor()->eventInfo.chkCondition(dEvtCnd_CANTALKITEM_e)) { return list; } @@ -259,7 +271,7 @@ dAttList_c* dAttention_c::getActionBtnXY() { } for (i = 0; i < mActionCount; i++) { - if (mActionList[i].mType == 3) { + if (mActionList[i].mType == fopAc_attn_SPEAK_e) { if (mActionList[i].getActor()->eventInfo.chkCondition(dEvtCnd_CANTALKITEM_e)) { return &mActionList[i]; } @@ -273,10 +285,10 @@ dAttList_c* dAttention_c::getActionBtnXY() { int dAttention_c::loc_type_num = 3; /* 80070A70-80070AC0 06B3B0 0050+00 1/1 0/0 0/0 .text chkAttMask__12dAttention_cFUlUl */ -int dAttention_c::chkAttMask(u32 param_0, u32 param_1) { +int dAttention_c::chkAttMask(u32 i_type, u32 i_mask) { for (int i = 0; i < loc_type_num; i++) { - if (param_0 == loc_type_tbl[i].field_0x0) { - return param_1 & loc_type_tbl[i].field_0x2; + if (i_type == loc_type_tbl[i].type) { + return i_mask & loc_type_tbl[i].mask; } } @@ -284,24 +296,24 @@ int dAttention_c::chkAttMask(u32 param_0, u32 param_1) { } /* 80070AC0-80070B2C 06B400 006C+00 2/2 0/0 0/0 .text check_event_condition__FUlUs */ -static int check_event_condition(u32 i_listType, u16 i_condition) { - switch (i_listType) { - case 3: - case 1: - if (!(i_condition & 1)) { +static int check_event_condition(u32 i_attnType, u16 i_condition) { + switch (i_attnType) { + case fopAc_attn_SPEAK_e: + case fopAc_attn_TALK_e: + if (!(i_condition & dEvtCnd_CANTALK_e)) { return true; } break; - case 4: - case 2: + case fopAc_attn_CARRY_e: + case fopAc_attn_BATTLE_e: break; - case 5: - if (!(i_condition & 4)) { + case fopAc_attn_DOOR_e: + if (!(i_condition & dEvtCnd_CANDOOR_e)) { return true; } break; - case 6: - if (!(i_condition & 4)) { + case fopAc_attn_JUEL_e: + if (!(i_condition & dEvtCnd_CANDOOR_e)) { return true; } break; @@ -315,7 +327,7 @@ int dAttention_c::act_type_num = 5; /* 80450668-8045066C 0000E8 0004+00 1/1 0/0 0/0 .sdata chk_type_tbl__12dAttention_c */ type_tbl_entry dAttention_c::chk_type_tbl[1] = { - {8, 256}, + {fopAc_attn_CHECK_e, 0x100}, }; /* 8045066C-80450670 0000EC 0004+00 1/1 0/0 0/0 .sdata chk_type_num__12dAttention_c */ @@ -325,9 +337,9 @@ int dAttention_c::chk_type_num = 1; static bool attn_opt_hold = true; /* 80070B2C-80070BF4 06B46C 00C8+00 2/2 0/0 0/0 .text check_flontofplayer__FUlss */ -static int check_flontofplayer(u32 param_0, s16 param_1, s16 param_2) { +static int check_flontofplayer(u32 i_checkMask, s16 i_ang1, s16 i_ang2) { static int ftp_table[9] = { - 4, 1, 2, 8, 16, 32, 64, 128, 256, + 0x4, 0x1, 0x2, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, }; static s16 ang_table[3] = { @@ -338,25 +350,25 @@ static int check_flontofplayer(u32 param_0, s16 param_1, s16 param_2) { 0x0AAA, 0x2000, 0x2AAA, 0x4000, 0x4E38, 0x6000, }; - if (param_1 < 0) { - param_1 = -param_1; + if (i_ang1 < 0) { + i_ang1 = -i_ang1; } - if (param_2 < 0) { - param_2 = -param_2; + if (i_ang2 < 0) { + i_ang2 = -i_ang2; } for (int i = 0; i < 3; i++) { - if (param_0 & ftp_table[i]) { - if (param_1 > ang_table[i]) { + if (i_checkMask & ftp_table[i]) { + if (i_ang1 > ang_table[i]) { return true; } } } for (int i = 8; i > 2; i--) { - if (param_0 & ftp_table[i]) { - if (param_2 > ang_table2[i - 3]) { + if (i_checkMask & ftp_table[i]) { + if (i_ang2 > ang_table2[i - 3]) { return true; } } @@ -366,34 +378,33 @@ static int check_flontofplayer(u32 param_0, s16 param_1, s16 param_2) { } /* 80070BF4-80070C40 06B534 004C+00 2/2 0/0 0/0 .text distace_weight__Ffsf */ -static f32 distace_weight(f32 param_0, s16 param_1, f32 param_2) { - f32 tmp = param_1 / 32768.0f; - return param_0 * ((1.0f - param_2) + (param_2 * (tmp * tmp))); +static f32 distace_weight(f32 i_distance, s16 i_angle, f32 i_ratio) { + f32 tmp = i_angle / (f32)0x8000; + return i_distance * ((1.0f - i_ratio) + (i_ratio * (tmp * tmp))); } - /* 80070C40-80070CA0 06B580 0060+00 2/2 0/0 0/0 .text distace_angle_adjust__Ffsf */ -static f32 distace_angle_adjust(f32 param_0, s16 param_1, f32 param_2) { - f32 tmp = param_1 / 32768.0f; +static f32 distace_angle_adjust(f32 i_distAdjust, s16 i_angle, f32 i_ratio) { + f32 tmp = i_angle / (f32)0x8000; if (tmp < 0.0f) { tmp = -tmp; } - return param_0 * ((1.0f - param_2) + (param_2 * ((1.0f - tmp) * (1.0f - tmp)))); + return i_distAdjust * ((1.0f - i_ratio) + (i_ratio * ((1.0f - tmp) * (1.0f - tmp)))); } /* 80070CA0-80070E90 06B5E0 01F0+00 3/3 0/0 0/0 .text check_distace__FP4cXyzsP4cXyzffff */ -static BOOL check_distace(cXyz* param_0, s16 param_1, cXyz* param_2, f32 param_3, f32 param_4, - f32 param_5, f32 param_6) { - cXyz tmp = *param_2 - *param_0; +static BOOL check_distace(cXyz* i_pos, s16 i_angle, cXyz* i_attnPos, f32 i_distMax, f32 i_distAdjust, + f32 i_max_y, f32 i_min_y) { + cXyz dist = *i_attnPos - *i_pos; - if (tmp.y <= param_6 || tmp.y >= param_5) { + if (dist.y <= i_min_y || dist.y >= i_max_y) { return false; } - f32 adjust = param_3 + distace_angle_adjust(param_4, param_1, 1.0f); - if (adjust < tmp.absXZ()) { + f32 adjust = i_distMax + distace_angle_adjust(i_distAdjust, i_angle, 1.0f); + if (adjust < dist.absXZ()) { return false; } @@ -402,14 +413,14 @@ static BOOL check_distace(cXyz* param_0, s16 param_1, cXyz* param_2, f32 param_3 /* 80070E90-800710C0 06B7D0 0230+00 2/2 0/0 0/0 .text * calcWeight__12dAttention_cFiP10fopAc_ac_cfssPUl */ -f32 dAttention_c::calcWeight(int param_0, fopAc_ac_c* param_1, f32 param_2, s16 param_3, - s16 param_4, u32* param_5) { +f32 dAttention_c::calcWeight(int i_listType, fopAc_ac_c* i_actor, f32 i_distance, s16 i_angle, + s16 i_invAngle, u32* i_attnType) { int i; int num; type_tbl_entry* table; - switch (param_0) { - case 0x4C: + switch (i_listType) { + case 'L': if (chkFlag(0x4000)) { return 0.0f; } @@ -418,52 +429,53 @@ f32 dAttention_c::calcWeight(int param_0, fopAc_ac_c* param_1, f32 param_2, s16 table = loc_type_tbl; break; default: - case 0x41: + OS_REPORT("attention: %d: illegal type\n", 0x419); + case 'A': num = act_type_num; table = act_type_tbl; break; - case 0x43: + case 'C': num = chk_type_num; table = chk_type_tbl; break; } f32 weight = 0.0f; - f32 dvar14 = -1.0f; + f32 max_weight = -1.0f; daPy_py_c* player = daPy_getPlayerActorClass(); if (player != NULL) { - if (param_1 == fopAcM_SearchByID(player->getGrabActorID())) { + if (i_actor == fopAcM_SearchByID(player->getGrabActorID())) { return 0.0f; } } for (i = 0; i < num; i++) { - f32 dvar12; - type_tbl_entry* entry = &table[i]; + f32 dist_weight; + type_tbl_entry* type_tbl_entry = &table[i]; - if (mPlayerAttentionFlags & entry->field_0x2 & param_1->attention_info.flags) { - u8 index = param_1->attention_info.distances[entry->field_0x0]; - dist_entry* d_entry = &dist_table[index]; + if (mPlayerAttentionFlags & type_tbl_entry->mask & i_actor->attention_info.flags) { + u8 dist_index = i_actor->attention_info.distances[type_tbl_entry->type]; + dist_entry* dist_tbl_entry = &dist_table[dist_index]; - if (fopAcM_checkStatus(param_1, 0x20000000) || - check_event_condition(entry->field_0x0, param_1->eventInfo.getCondition())) { - dvar12 = 0.0f; - } else if (check_flontofplayer(d_entry->mAngleSelect, param_3, param_4)) { - dvar12 = 0.0f; - } else if (!check_distace(&mOwnerAttnPos, param_3, ¶m_1->attention_info.position, - d_entry->mDistMax, d_entry->mDistanceAdjust, d_entry->mUpperY, - d_entry->mLowerY)) { - dvar12 = 0.0f; + if (fopAcM_checkStatus(i_actor, 0x20000000) || + check_event_condition(type_tbl_entry->type, i_actor->eventInfo.getCondition())) { + dist_weight = 0.0f; + } else if (check_flontofplayer(dist_tbl_entry->mAngleSelect, i_angle, i_invAngle)) { + dist_weight = 0.0f; + } else if (!check_distace(&mOwnerAttnPos, i_angle, &i_actor->attention_info.position, + dist_tbl_entry->mDistMax, dist_tbl_entry->mDistanceAdjust, dist_tbl_entry->mUpperY, + dist_tbl_entry->mLowerY)) { + dist_weight = 0.0f; } else { - dvar12 = distace_weight(param_2, param_3, 0.5f); + dist_weight = distace_weight(i_distance, i_angle, 0.5f); } - f32 dvar13 = d_entry->mWeight; - if (dvar12 > 0.0f && dvar13 > dvar14) { - dvar14 = dvar13; - weight = dvar12 / dvar13; - *param_5 = entry->field_0x0; + f32 dist_tbl_weight = dist_tbl_entry->mWeight; + if (dist_weight > 0.0f && dist_tbl_weight > max_weight) { + max_weight = dist_tbl_weight; + weight = dist_weight / dist_tbl_weight; + *i_attnType = type_tbl_entry->type; } } } @@ -473,42 +485,42 @@ f32 dAttention_c::calcWeight(int param_0, fopAc_ac_c* param_1, f32 param_2, s16 /* 800710C0-80071240 06BA00 0180+00 1/1 0/0 0/0 .text * setList__12dAttention_cFiP10fopAc_ac_cff7cSAngleUl */ -void dAttention_c::setList(int param_0, fopAc_ac_c* param_1, f32 param_2, f32 param_3, - cSAngle param_4, u32 param_5) { +void dAttention_c::setList(int i_listType, fopAc_ac_c* i_actor, f32 i_weight, f32 i_distance, + cSAngle i_angle, u32 i_attnType) { int max; - int* num; + int* list_count; s32 maxIndex; dAttList_c* list; - switch (param_0) { - case 0x4C: + switch (i_listType) { + case 'L': if (chkFlag(0x4000)) return; - if (mLockonCount >= 1 && param_1 == mLockOnList[0].getActor() && param_5 == mLockOnList[0].mType) { + if (mLockonCount >= 1 && i_actor == mLockOnList[0].getActor() && i_attnType == mLockOnList[0].mType) { return; } max = 8; - num = &mLockonCount; + list_count = &mLockonCount; list = mLockOnList; break; default: - case 0x41: + case 'A': max = 4; - num = &mActionCount; + list_count = &mActionCount; list = mActionList; break; - case 0x43: + case 'C': max = 4; - num = &mCheckObjectCount; + list_count = &mCheckObjectCount; list = mCheckObjectList; break; } f32 weight = 0.0f; - if (param_2 > weight) { - if (*num < max) { - maxIndex = *num; - (*num)++; + if (i_weight > weight) { + if (*list_count < max) { + maxIndex = *list_count; + (*list_count)++; } else { f32 maxWeight = weight; s32 i = 0; @@ -521,12 +533,12 @@ void dAttention_c::setList(int param_0, fopAc_ac_c* param_1, f32 param_2, f32 pa } } - if (list[maxIndex].mWeight > param_2) { - list[maxIndex].setActor(param_1); - list[maxIndex].mWeight = param_2; - list[maxIndex].mDistance = param_3; - list[maxIndex].mAngle = param_4; - list[maxIndex].mType = param_5; + if (list[maxIndex].mWeight > i_weight) { + list[maxIndex].setActor(i_actor); + list[maxIndex].mWeight = i_weight; + list[maxIndex].mDistance = i_distance; + list[maxIndex].mAngle = i_angle; + list[maxIndex].mType = i_attnType; } } } @@ -534,41 +546,46 @@ void dAttention_c::setList(int param_0, fopAc_ac_c* param_1, f32 param_2, f32 pa /* 80071240-8007138C 06BB80 014C+00 6/6 0/0 0/0 .text initList__12dAttention_cFUl */ void dAttention_c::initList(u32 flags) { mPlayerAttentionFlags = flags; - if (chkFlag(0x4000) == 0) { + + if (!chkFlag(0x4000)) { int lockonIndex; - mLockonCount = lockonIndex = mLockTargetID != -1 ? 1 : 0; + mLockonCount = lockonIndex = mLockTargetID != fpcM_ERROR_PROCESS_ID_e ? 1 : 0; if (mLockOnOffset != 0) { memcpy(mLockOnList, mLockOnList + mLockOnOffset, sizeof(dAttList_c)); mLockOnList[0].mWeight = 0.0f; } + mLockOnOffset = 0; for (; lockonIndex < 8; lockonIndex++) { mLockOnList[lockonIndex].setActor(NULL); mLockOnList[lockonIndex].mWeight = FLT_MAX; } } + int i; mActionCount = mActionOffset = i = 0; for (; i < 4; i++) { mActionList[i].setActor(NULL); mActionList[i].mWeight = FLT_MAX; } + mCheckObjectCount = mCheckObjectOffset = i = 0; for (; i < 4; i++) { mCheckObjectList[i].setActor(NULL); mCheckObjectList[i].mWeight = FLT_MAX; } + setFlag(0x1000); } /* 8007138C-800713CC 06BCCC 0040+00 1/1 0/0 0/0 .text select_attention__FP10fopAc_ac_cPv */ -static int select_attention(fopAc_ac_c* param_0, void* i_attention) { - if (param_0->attention_info.flags == 0) { +static int select_attention(fopAc_ac_c* i_actor, void* i_attention) { + if (i_actor->attention_info.flags == 0) { return 0; } - return ((dAttention_c*)i_attention)->SelectAttention(param_0); + return ((dAttention_c*)i_attention)->SelectAttention(i_actor); } /* 800713CC-80071424 06BD0C 0058+00 4/4 0/0 0/0 .text makeList__12dAttention_cFv */ @@ -589,30 +606,35 @@ void dAttention_c::setOwnerAttentionPos() { /* 80071488-8007167C 06BDC8 01F4+00 1/1 0/0 0/0 .text * SelectAttention__12dAttention_cFP10fopAc_ac_c */ -int dAttention_c::SelectAttention(fopAc_ac_c* param_0) { - cSAngle acStack_4c; - cSAngle acStack_50; - if (param_0 == mpPlayer || mpPlayer == NULL) { +int dAttention_c::SelectAttention(fopAc_ac_c* i_actor) { + cSAngle angle; + cSAngle inv_angle; + if (i_actor == mpPlayer || mpPlayer == NULL) { return 0; } + mPlayerAttentionFlags = mpPlayer->attention_info.flags; - cSGlobe acStack_40(param_0->attention_info.position - mOwnerAttnPos); - acStack_4c = acStack_40.U() - fopAcM_GetShapeAngle_p(mpPlayer)->y; - acStack_50 = cSAngle(acStack_40.U().Inv()) - fopAcM_GetShapeAngle_p(param_0)->y; - u32 local_48; - if ((param_0->attention_info.flags & 7) != 0 && chkFlag(0x4000) == 0) - { - f32 dVar5 = calcWeight(0x4c, param_0, acStack_40.R(), acStack_4c.Val(), acStack_50.Val(), &local_48); - setList(0x4c, param_0, dVar5, acStack_40.R(), acStack_4c, local_48); + + cSGlobe globe(i_actor->attention_info.position - mOwnerAttnPos); + angle = globe.U() - fopAcM_GetShapeAngle_p(mpPlayer)->y; + inv_angle = cSAngle(globe.U().Inv()) - fopAcM_GetShapeAngle_p(i_actor)->y; + + u32 attn_type; + if ((i_actor->attention_info.flags & 7) && !chkFlag(0x4000)) { + f32 weight = calcWeight('L', i_actor, globe.R(), angle.Val(), inv_angle.Val(), &attn_type); + setList('L', i_actor, weight, globe.R(), angle, attn_type); } - if ((param_0->attention_info.flags & 0xf8) != 0) { - f32 dVar5 = calcWeight(0x41, param_0, acStack_40.R(), acStack_4c.Val(), acStack_50.Val(), &local_48); - setList(0x41, param_0, dVar5, acStack_40.R(), acStack_4c, local_48); + + if (i_actor->attention_info.flags & 0xF8) { + f32 weight = calcWeight('A', i_actor, globe.R(), angle.Val(), inv_angle.Val(), &attn_type); + setList('A', i_actor, weight, globe.R(), angle, attn_type); } - if (((param_0->attention_info).flags & 0x100) != 0) { - f32 dVar5 = calcWeight(0x43, param_0, acStack_40.R(), acStack_4c.Val(), acStack_50.Val(), &local_48); - setList(0x43, param_0, dVar5, acStack_40.R(), acStack_4c, local_48); + + if (i_actor->attention_info.flags & 0x100) { + f32 weight = calcWeight('C', i_actor, globe.R(), angle.Val(), inv_angle.Val(), &attn_type); + setList('C', i_actor, weight, globe.R(), angle, attn_type); } + return 0; } @@ -621,17 +643,17 @@ void dAttention_c::sortList() { int i; int j; int count; - dAttList_c temp; + dAttList_c swap; dAttList_c* list; if (!chkFlag(0x4000)) { list = mLockOnList; - for (i = (mLockTargetID != -1) ? 1 : 0, count = mLockonCount; i < count - 1; i++) { + for (i = (mLockTargetID != fpcM_ERROR_PROCESS_ID_e) ? 1 : 0, count = mLockonCount; i < count - 1; i++) { for (j = i + 1; j < count; j++) { if (list[i].mWeight > list[j].mWeight) { - memcpy(&temp, &list[j], sizeof(dAttList_c)); + memcpy(&swap, &list[j], sizeof(dAttList_c)); memcpy(&list[j], &list[i], sizeof(dAttList_c)); - memcpy(&list[i], &temp, sizeof(dAttList_c)); + memcpy(&list[i], &swap, sizeof(dAttList_c)); } } } @@ -642,9 +664,9 @@ void dAttention_c::sortList() { for (i = 0; i < count - 1; i++) { for (j = i + 1; j < count; j++) { if (list[i].mWeight > list[j].mWeight) { - memcpy(&temp, &list[j], sizeof(dAttList_c)); + memcpy(&swap, &list[j], sizeof(dAttList_c)); memcpy(&list[j], &list[i], sizeof(dAttList_c)); - memcpy(&list[i], &temp, sizeof(dAttList_c)); + memcpy(&list[i], &swap, sizeof(dAttList_c)); } } } @@ -654,9 +676,9 @@ void dAttention_c::sortList() { for (i = 0; i < count - 1; i++) { for (j = i + 1; j < count; j++) { if (list[i].mWeight > list[j].mWeight) { - memcpy(&temp, &list[j], sizeof(dAttList_c)); + memcpy(&swap, &list[j], sizeof(dAttList_c)); memcpy(&list[j], &list[i], sizeof(dAttList_c)); - memcpy(&list[i], &temp, sizeof(dAttList_c)); + memcpy(&list[i], &swap, sizeof(dAttList_c)); } } } @@ -664,15 +686,15 @@ void dAttention_c::sortList() { /* 800718A4-80071960 06C1E4 00BC+00 2/2 0/0 0/0 .text stockAttention__12dAttention_cFv */ void dAttention_c::stockAttention() { - fopAc_ac_c* target = LockonTarget(0); + fopAc_ac_c* lockon_actor = LockonTarget(0); - initList(-1); + initList(0xFFFFFFFF); if (makeList()) { sortList(); } - if (target != mLockOnList[0].getActor()) { - if (target != NULL) { + if (lockon_actor != mLockOnList[0].getActor()) { + if (lockon_actor != NULL) { if (mLockOnList[0].getActor() != NULL) { setFlag(2); } @@ -702,7 +724,7 @@ fopAc_ac_c* dAttention_c::nextAttention() { } fopAc_ac_c* actor = fopAcM_SearchByID(mLockTargetID); - initList(-1); + initList(0xFFFFFFFF); if (makeList()) { sortList(); @@ -717,8 +739,8 @@ fopAc_ac_c* dAttention_c::nextAttention() { /* 80071A68-80071A98 06C3A8 0030+00 3/3 0/0 0/0 .text freeAttention__12dAttention_cFv */ int dAttention_c::freeAttention() { - mLockTargetID = -1; - initList(-1); + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; + initList(0xFFFFFFFF); return 0; } @@ -741,7 +763,7 @@ bool dAttention_c::chaseAttention() { a2 = g2.U() - fopAcM_GetShapeAngle_p(actor)->y; u32 type; - f32 weight = calcWeight(0x4C, actor, g1.R(), a1.Val(), a2.Val(), &type); + f32 weight = calcWeight('L', actor, g1.R(), a1.Val(), a2.Val(), &type); if (weight <= 0.0f) { type = mLockOnList[offset].mType; int tbl_idx = actor->attention_info.distances[type]; @@ -800,18 +822,17 @@ f32 dAttention_c::EnemyDistance(fopAc_ac_c* i_actor) { return distance; } - /* 80071D6C-80071DEC 06C6AC 0080+00 1/1 0/0 0/0 .text sound_attention__FP10fopAc_ac_cPv */ -static int sound_attention(fopAc_ac_c* param_0, void* i_attention) { - f32 dist = ((dAttention_c*)i_attention)->EnemyDistance(param_0); +static int sound_attention(fopAc_ac_c* i_actor, void* i_attention) { + f32 dist = ((dAttention_c*)i_attention)->EnemyDistance(i_actor); if (dist < 0.0f) { return 0; } if (dist < ((dAttention_c*)i_attention)->mEnemyDist) { - ((dAttention_c*)i_attention)->mEnemyActorID = fopAcM_GetID(param_0); + ((dAttention_c*)i_attention)->mEnemyActorID = fopAcM_GetID(i_actor); ((dAttention_c*)i_attention)->mEnemyDist = dist; } @@ -821,7 +842,7 @@ static int sound_attention(fopAc_ac_c* param_0, void* i_attention) { /* 80071DEC-80071E84 06C72C 0098+00 1/1 0/0 0/0 .text runSoundProc__12dAttention_cFv */ void dAttention_c::runSoundProc() { - mEnemyActorID = -1; + mEnemyActorID = fpcM_ERROR_PROCESS_ID_e; mEnemyDist = 10000.0f; if (!chkFlag(0x80000000)) { @@ -838,10 +859,10 @@ void dAttention_c::runSoundProc() { void dAttention_c::runDrawProc() { if ((mFlags >> 3) & 1) { draw[0].setAlphaAnm(mAttParam.mAttnCursorAppearFrames, 0); - draw[0].setAnm(1, mAttParam.field_0x3c); - draw[0].field_0x164.x = mAttParam.mAttnCursorScaleX; - draw[0].field_0x164.y = mAttParam.mAttnCursorScaleY; - draw[0].field_0x164.z = mAttParam.mAttnCursorOffsetY; + draw[0].setAnm(DRAW_TYPE_RED, mAttParam.field_0x3c); + draw[0].mCursorSizeX = mAttParam.mAttnCursorScaleX; + draw[0].mCursorSizeY = mAttParam.mAttnCursorScaleY; + draw[0].mCursorOffsetY = mAttParam.mAttnCursorOffsetY; draw[0].field_0x175 = 1; if (!dComIfGp_checkPlayerStatus0(0, 0x36a02311) || @@ -860,22 +881,22 @@ void dAttention_c::runDrawProc() { lockSoundStart(Z2SE_SY_L_FOCUS_RESET); } } else if (chkFlag(0x1)) { - draw[0].setAnm(0, mAttParam.field_0x38); + draw[0].setAnm(DRAW_TYPE_YELLOW, mAttParam.field_0x38); draw[0].setAlphaAnm(mAttParam.mAttnCursorAppearFrames, 0); - draw[0].field_0x164.x = mAttParam.mSelCursorScaleX; - draw[0].field_0x164.y = mAttParam.mSelCursorScaleY; - draw[0].field_0x164.z = mAttParam.mSelCursorOffsetY; + draw[0].mCursorSizeX = mAttParam.mSelCursorScaleX; + draw[0].mCursorSizeY = mAttParam.mSelCursorScaleY; + draw[0].mCursorOffsetY = mAttParam.mSelCursorOffsetY; draw[0].field_0x175 = 0; setFlag(0x40000000); } else if (chkFlag(0x2)) { draw[0].setAlphaAnm(mAttParam.mAttnCursorAppearFrames, 0); - draw[1].setAnm(0, mAttParam.field_0x38); + draw[1].setAnm(DRAW_TYPE_YELLOW, mAttParam.field_0x38); draw[1].setAlphaAnm(mAttParam.mAttnCursorDisappearFrames, 1); - draw[1].field_0x164.x = mAttParam.mSelCursorScaleX; - draw[1].field_0x164.y = mAttParam.mSelCursorScaleY; - draw[1].field_0x164.z = mAttParam.mSelCursorOffsetY; + draw[1].mCursorSizeX = mAttParam.mSelCursorScaleX; + draw[1].mCursorSizeY = mAttParam.mSelCursorScaleY; + draw[1].mCursorOffsetY = mAttParam.mSelCursorOffsetY; draw[1].field_0x175 = 0; setFlag(0x40000000); } else if (mLockonCount <= 0 && field_0x328 == 0) { @@ -884,7 +905,7 @@ void dAttention_c::runDrawProc() { setFlag(0x40000000); } - if (mAttnStatus == ST_LOCK) { + if (mAttnStatus == EState_LOCK) { if (draw[0].field_0x173 == 3) { draw[0].field_0x173 = 4; clrFlag(0x40000000); @@ -901,7 +922,7 @@ void dAttention_c::runDebugDisp() {} /* 800720F8-800722A0 06CA38 01A8+00 1/1 0/0 0/0 .text checkButton__12dAttention_cFv */ void dAttention_c::checkButton() { - if (on_final_boss_stg && dComIfGp_roomControl_getStayNo() == 0 && + if (l_isFinalBossStg && dComIfGp_roomControl_getStayNo() == 0 && !dComIfGs_isSaveDunSwitch(1)) { if (field_0x32b == 1 && LockonTarget(0) != NULL && chkFlag(0x20000000)) { setFlag(0x1000000); @@ -969,38 +990,38 @@ int dAttention_c::lostCheck() { /* 80072344-800725F0 06CC84 02AC+00 1/1 0/0 0/0 .text judgementStatus4Hold__12dAttention_cFv */ void dAttention_c::judgementStatus4Hold() { switch (mAttnStatus) { - case ST_NONE: + case EState_NONE: field_0x32f = 0; field_0x32e = 0; - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; stockAttention(); if (field_0x32b == 0 && triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; field_0x32e = 15; } break; - case ST_LOCK: + case EState_LOCK: mLockTargetID = LockonTargetPId(0); field_0x32f = 0; if (lostCheck()) { - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; stockAttention(); if (triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; } else { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); setFlag(0x800000); } } else if (field_0x32b == 4) { - mAttnStatus = ST_RELEASE; + mAttnStatus = EState_RELEASE; setFlag(0x10); field_0x32f = 10; } else if (field_0x32e == 0) { - initList(-1); + initList(0xFFFFFFFF); if (makeList()) { sortList(); @@ -1012,31 +1033,31 @@ void dAttention_c::judgementStatus4Hold() { } break; - case ST_RELEASE: + case EState_RELEASE: setFlag(0x40); if (lostCheck()) { - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; stockAttention(); if (triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; } else { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); setFlag(0x800000); } } else if (field_0x32b == 0) { if (nextAttention()) { setFlag(0x8); - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; field_0x32e = 15; } else { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); } } else if (LockonTarget(0) == NULL || field_0x32f == 0) { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); } @@ -1049,7 +1070,7 @@ void dAttention_c::judgementStatus4Hold() { if (!chkFlag(0x1000)) { setFlag(0x4000); - initList(-1); + initList(0xFFFFFFFF); if (makeList()) { sortList(); @@ -1060,49 +1081,49 @@ void dAttention_c::judgementStatus4Hold() { /* 800725F0-80072924 06CF30 0334+00 1/1 0/0 0/0 .text judgementStatus4Switch__12dAttention_cFv */ void dAttention_c::judgementStatus4Switch() { switch (mAttnStatus) { - case ST_NONE: - mLockTargetID = -1; + case EState_NONE: + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; stockAttention(); field_0x32f = 0; field_0x32e = 0; if (field_0x32b == 0 && triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; field_0x32e = 15; field_0x32f = 15; } break; - case ST_LOCK: + case EState_LOCK: mLockTargetID = LockonTargetPId(0); if (field_0x32f == 0) { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); } else if (lostCheck()) { - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; stockAttention(); if (triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; } else { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); setFlag(0x800000); } } else if (field_0x32b == 0) { if (mDoCPd_c::getStickY(mPadNo) < -0.9f) { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); } else if (nextAttention()) { setFlag(0x8); - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; field_0x32e = 15; } else { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); } } else if (field_0x32e == 0) { - initList(-1); + initList(0xFFFFFFFF); if (makeList()) { sortList(); @@ -1122,30 +1143,30 @@ void dAttention_c::judgementStatus4Switch() { } break; - case ST_RELEASE: + case EState_RELEASE: setFlag(0x40); if (lostCheck()) { - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; stockAttention(); if (triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; } else { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); setFlag(0x800000); } } else if (field_0x32b == 0) { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; if (triggerProc()) { - mAttnStatus = ST_LOCK; + mAttnStatus = EState_LOCK; field_0x32e = 15; field_0x32f = 15; } } else if (LockonTarget(0) == NULL || field_0x32f == 0) { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; freeAttention(); } @@ -1154,7 +1175,7 @@ void dAttention_c::judgementStatus4Switch() { if (!chkFlag(0x1000)) { setFlag(0x4000); - initList(-1); + initList(0xFFFFFFFF); if (makeList()) { sortList(); @@ -1186,12 +1207,12 @@ int dAttention_c::Run() { setOwnerAttentionPos(); if (dComIfGp_event_runCheck() || chkFlag(0x10000)) { - mAttnStatus = ST_NONE; + mAttnStatus = EState_NONE; field_0x32b = 4; field_0x32c = 0; clrFlag(0x20000000); clrFlag(0x10000000); - mLockTargetID = -1; + mLockTargetID = fpcM_ERROR_PROCESS_ID_e; freeAttention(); } else { checkButton(); @@ -1236,7 +1257,7 @@ int dAttention_c::Run() { runDrawProc(); runDebugDisp(); - if (mAttnStatus == ST_LOCK) { + if (mAttnStatus == EState_LOCK) { dComIfGp_onCameraAttentionStatus(mPadNo, 1); } else { dComIfGp_offCameraAttentionStatus(mPadNo, 1); @@ -1251,19 +1272,19 @@ int dAttention_c::Run() { /* 80072BD4-80072D80 06D514 01AC+00 0/0 1/1 0/0 .text Draw__12dAttention_cFv */ void dAttention_c::Draw() { - if (mAttParam.CheckFlag(0x10)) { + if (mAttParam.CheckFlag(dAttParam_c::EFlag_ARROW_OFF)) { draw[0].field_0x173 = 3; draw[1].field_0x173 = 3; return; } - Mtx tmp; - MTXInverse(dComIfGd_getViewRotMtx(), tmp); - fopAc_ac_c* target = LockonTarget(0); + Mtx inv_m; + MTXInverse(dComIfGd_getViewRotMtx(), inv_m); + fopAc_ac_c* lockon_actor = LockonTarget(0); if (!dComIfGp_event_runCheck()) { - if (target != NULL) { - draw[0].draw(target->attention_info.position, tmp); + if (lockon_actor != NULL) { + draw[0].draw(lockon_actor->attention_info.position, inv_m); if (mLockonCount >= 2 && draw[1].field_0x173 == 2) { int listIdx = mLockOnOffset; @@ -1275,21 +1296,21 @@ void dAttention_c::Draw() { } if (mLockOnList[listIdx].getActor() != NULL) { fopAc_ac_c* actor = mLockOnList[listIdx].getActor(); - draw[1].draw(actor->attention_info.position, tmp); + draw[1].draw(actor->attention_info.position, inv_m); } } - mTargetActorID = fopAcM_GetID(target); - mDrawAttnPos = target->attention_info.position; + mTargetActorID = fopAcM_GetID(lockon_actor); + mDrawAttnPos = lockon_actor->attention_info.position; field_0x328 = 0; } else if (field_0x328 > 0) { fopAc_ac_c* actor = fopAcM_SearchByID(mTargetActorID); if (actor != NULL) { - draw[0].draw(actor->attention_info.position, tmp); + draw[0].draw(actor->attention_info.position, inv_m); mDrawAttnPos = actor->attention_info.position; } else { - draw[0].draw(mDrawAttnPos, tmp); + draw[0].draw(mDrawAttnPos, inv_m); } } } @@ -1304,20 +1325,20 @@ void dAttention_c::lockSoundStart(u32 i_sfxID) { } /* 80072DD8-80072FE8 06D718 0210+00 1/1 0/0 0/0 .text setAnm__10dAttDraw_cFUcf */ -void dAttDraw_c::setAnm(u8 param_0, f32 param_1) { - field_0x170 = param_0; - mNoticeCursorBck[field_0x170].reset(); - mNoticeCursorBck[field_0x170].setPlaySpeed(param_1); - mNoticeCursorBpk[field_0x170].reset(); - mNoticeCursorBpk[field_0x170].setPlaySpeed(param_1); - mNoticeCursorBrk[field_0x170].reset(); - mNoticeCursorBrk[field_0x170].setPlaySpeed(param_1); - mNoticeCursor02Brk[field_0x170].reset(); - mNoticeCursor02Brk[field_0x170].setPlaySpeed(param_1); - mNoticeCursorBtk[field_0x170].reset(); - mNoticeCursorBtk[field_0x170].setPlaySpeed(param_1); +void dAttDraw_c::setAnm(u8 i_drawType, f32 i_anmSpeed) { + mDrawType = i_drawType; + mNoticeCursorBck[mDrawType].reset(); + mNoticeCursorBck[mDrawType].setPlaySpeed(i_anmSpeed); + mNoticeCursorBpk[mDrawType].reset(); + mNoticeCursorBpk[mDrawType].setPlaySpeed(i_anmSpeed); + mNoticeCursorBrk[mDrawType].reset(); + mNoticeCursorBrk[mDrawType].setPlaySpeed(i_anmSpeed); + mNoticeCursor02Brk[mDrawType].reset(); + mNoticeCursor02Brk[mDrawType].setPlaySpeed(i_anmSpeed); + mNoticeCursorBtk[mDrawType].reset(); + mNoticeCursorBtk[mDrawType].setPlaySpeed(i_anmSpeed); - if (field_0x170 == 1) { + if (mDrawType == DRAW_TYPE_RED) { mImpactBck.reset(); mImpactBpk.reset(); mImpactBrk.reset(); @@ -1326,24 +1347,25 @@ void dAttDraw_c::setAnm(u8 param_0, f32 param_1) { } /* 80072FE8-80073004 06D928 001C+00 1/1 0/0 0/0 .text setAlphaAnm__10dAttDraw_cFUcUc */ -void dAttDraw_c::setAlphaAnm(u8 param_0, u8 param_1) { - field_0x171 = param_0; - field_0x172 = 0; +void dAttDraw_c::setAlphaAnm(u8 i_frameMax, u8 i_playDirection) { + mAlphaAnmFrameMax = i_frameMax; + mAlphaAnmFrame = 0; field_0x173 = 2; - field_0x174 = param_1; + mAlphaAnmPlayDirection = i_playDirection; } /* 80073004-800732AC 06D944 02A8+00 1/1 0/0 0/0 .text alphaAnm__10dAttDraw_cFv */ void dAttDraw_c::alphaAnm() { - f32 dVar9 = (f32)field_0x172 / (f32)field_0x171; - f32 dVar8; - if (field_0x174 == 1) { - dVar8 = 1.0f - dVar9; + f32 anm_ratio = (f32)mAlphaAnmFrame / (f32)mAlphaAnmFrameMax; + f32 alpha_ratio; + if (mAlphaAnmPlayDirection == 1) { + alpha_ratio = 1.0f - anm_ratio; } else { - dVar8 = dVar9; + alpha_ratio = anm_ratio; } - if (dVar9 == 1.0f) { - if (field_0x170 == 1 && field_0x174 == 0) { + + if (anm_ratio == 1.0f) { + if (mDrawType == DRAW_TYPE_RED && mAlphaAnmPlayDirection == 0) { if (mImpactBck.isStop() && mImpactBpk.isStop() && mImpactBrk.isStop() && mImpactBtk.isStop()) { field_0x175 = 0; field_0x173 = 3; @@ -1352,22 +1374,25 @@ void dAttDraw_c::alphaAnm() { field_0x173 = 3; } } - if (field_0x172 < field_0x171) { - field_0x172++; + + if (mAlphaAnmFrame < mAlphaAnmFrameMax) { + mAlphaAnmFrame++; } - J3DModelData* modelData = mModel[field_0x170]->getModelData(); - for (int iVar4 = 0; iVar4 < modelData->getMaterialNum(); iVar4++) { - J3DMaterial* material = modelData->getMaterialNodePointer(iVar4); - J3DGXColor* pJVar5 = (J3DGXColor*)material->getTevKColor(0); - pJVar5->a = 255.0f * dVar8; - material->setTevKColor(0, pJVar5); + + J3DModelData* modelData = mModel[mDrawType]->getModelData(); + for (int i = 0; i < modelData->getMaterialNum(); i++) { + J3DMaterial* material = modelData->getMaterialNodePointer(i); + J3DGXColor* color = (J3DGXColor*)material->getTevKColor(0); + color->a = 255.0f * alpha_ratio; + material->setTevKColor(0, color); } + if (field_0x175 == 0) { - mNoticeCursorBck[field_0x170].play(); - mNoticeCursorBpk[field_0x170].play(); - mNoticeCursorBrk[field_0x170].play(); - mNoticeCursorBtk[field_0x170].play(); - mNoticeCursor02Brk[field_0x170].play(); + mNoticeCursorBck[mDrawType].play(); + mNoticeCursorBpk[mDrawType].play(); + mNoticeCursorBrk[mDrawType].play(); + mNoticeCursorBtk[mDrawType].play(); + mNoticeCursor02Brk[mDrawType].play(); } else { mImpactBck.play(); mImpactBpk.play(); @@ -1377,27 +1402,26 @@ void dAttDraw_c::alphaAnm() { } /* 800732B0-8007353C 06DBF0 028C+00 1/1 0/0 0/0 .text draw__10dAttDraw_cFR4cXyzPA4_f */ -void dAttDraw_c::draw(cXyz& param_0, Mtx param_1) { - J3DModelData* modelData = mModel[field_0x170]->getModelData(); +void dAttDraw_c::draw(cXyz& i_pos, Mtx i_mtx) { + J3DModelData* modelData = mModel[mDrawType]->getModelData(); - mDoMtx_stack_c::transS(param_0.x, param_0.y + field_0x164.z, param_0.z); - mDoMtx_stack_c::concat(param_1); - mModel[field_0x170]->setBaseTRMtx(mDoMtx_stack_c::get()); + mDoMtx_stack_c::transS(i_pos.x, i_pos.y + mCursorOffsetY, i_pos.z); + mDoMtx_stack_c::concat(i_mtx); + mModel[mDrawType]->setBaseTRMtx(mDoMtx_stack_c::get()); view_class* view = dComIfGd_getView(); - f32 temp_f31 = tan(0.01745329238474369f * (0.5f * view->fovy)); + f32 temp_f31 = tan(DEG_TO_RAD(0.5f * view->fovy)); f32 temp_f30 = (-100.0f - g_AttDwHIO.mCursorDistance) / temp_f31; - cXyz tmp; - MTXMultVec(dComIfGd_getViewMtx(), ¶m_0, &tmp); + cXyz view_pos; + MTXMultVec(dComIfGd_getViewMtx(), &i_pos, &view_pos); - f32 var_f2 = 1.0f; - if (tmp.z < temp_f30) { - var_f2 = (tmp.z * temp_f31) / (-100.0f - g_AttDwHIO.mCursorDistance); + f32 size = 1.0f; + if (view_pos.z < temp_f30) { + size = (view_pos.z * temp_f31) / (-100.0f - g_AttDwHIO.mCursorDistance); } - mModel[field_0x170]->setBaseScale( - cXyz(field_0x164.x * var_f2, field_0x164.y * var_f2, field_0x164.x * var_f2)); + mModel[mDrawType]->setBaseScale(cXyz(mCursorSizeX * size, mCursorSizeY * size, mCursorSizeX * size)); alphaAnm(); @@ -1407,30 +1431,30 @@ void dAttDraw_c::draw(cXyz& param_0, Mtx param_1) { mImpactBrk.entry(modelData); mImpactBtk.entry(modelData); } else { - mNoticeCursorBck[field_0x170].entry(modelData); - mNoticeCursorBpk[field_0x170].entry(modelData); - mNoticeCursorBrk[field_0x170].entry(modelData); - mNoticeCursorBtk[field_0x170].entry(modelData); - mNoticeCursor02Brk[field_0x170].entry(modelData); + mNoticeCursorBck[mDrawType].entry(modelData); + mNoticeCursorBpk[mDrawType].entry(modelData); + mNoticeCursorBrk[mDrawType].entry(modelData); + mNoticeCursorBtk[mDrawType].entry(modelData); + mNoticeCursor02Brk[mDrawType].entry(modelData); } dComIfGd_setList3Dlast(); - mDoExt_modelUpdateDL(mModel[field_0x170]); + mDoExt_modelUpdateDL(mModel[mDrawType]); dComIfGd_setList(); } /* 8007353C-800735DC 06DE7C 00A0+00 8/8 13/13 21/21 .text LockonTarget__12dAttention_cFl */ -fopAc_ac_c* dAttention_c::LockonTarget(s32 param_0) { +fopAc_ac_c* dAttention_c::LockonTarget(s32 i_no) { if (dComIfGp_checkPlayerStatus0(0, 0x36A02311) || dComIfGp_checkPlayerStatus1(0, 0x11)) { return NULL; } - if (param_0 >= mLockonCount) { + if (i_no >= mLockonCount) { return NULL; } - int listIdx = mLockOnOffset + param_0; + int listIdx = mLockOnOffset + i_no; if (listIdx >= mLockonCount) { listIdx -= mLockonCount; } @@ -1455,24 +1479,24 @@ f32 dAttention_c::LockonReleaseDistanse() { } int idx = actor->attention_info.distances[mLockOnList[mLockOnOffset].mType]; - cSGlobe tmp_g(actor->attention_info.position - mOwnerAttnPos); - cSAngle tmp_a(tmp_g.U() - fopAcM_GetShapeAngle_p(mpPlayer)->y); + cSGlobe globe(actor->attention_info.position - mOwnerAttnPos); + cSAngle angle(globe.U() - fopAcM_GetShapeAngle_p(mpPlayer)->y); - return distace_angle_adjust(dist_table[idx].mDistanceAdjust, tmp_a, 1.0f) + dist_table[idx].mDistMaxRelease; + return distace_angle_adjust(dist_table[idx].mDistanceAdjust, angle, 1.0f) + dist_table[idx].mDistMaxRelease; } /* 800736CC-80073734 06E00C 0068+00 2/2 0/0 0/0 .text LockonTargetPId__12dAttention_cFl */ -fpc_ProcID dAttention_c::LockonTargetPId(s32 param_0) { +fpc_ProcID dAttention_c::LockonTargetPId(s32 i_no) { if (dComIfGp_checkPlayerStatus0(0, 0x36A02311) || dComIfGp_checkPlayerStatus1(0, 0x11)) { return fpcM_ERROR_PROCESS_ID_e; } - if (param_0 >= mLockonCount) { + if (i_no >= mLockonCount) { return fpcM_ERROR_PROCESS_ID_e; } - int listIdx = mLockOnOffset + param_0; + int listIdx = mLockOnOffset + i_no; if (listIdx >= mLockonCount) { listIdx -= mLockonCount; } @@ -1481,12 +1505,12 @@ fpc_ProcID dAttention_c::LockonTargetPId(s32 param_0) { } /* 80073734-8007378C 06E074 0058+00 0/0 3/3 2/2 .text ActionTarget__12dAttention_cFl */ -fopAc_ac_c* dAttention_c::ActionTarget(s32 param_0) { - if (param_0 >= mActionCount) { +fopAc_ac_c* dAttention_c::ActionTarget(s32 i_no) { + if (i_no >= mActionCount) { return NULL; } - int listIdx = mActionOffset + param_0; + int listIdx = mActionOffset + i_no; if (listIdx >= mActionCount) { listIdx -= mActionCount; } @@ -1496,12 +1520,12 @@ fopAc_ac_c* dAttention_c::ActionTarget(s32 param_0) { /* 8007378C-800737E4 06E0CC 0058+00 0/0 3/3 0/0 .text CheckObjectTarget__12dAttention_cFl */ -fopAc_ac_c* dAttention_c::CheckObjectTarget(s32 param_0) { - if (param_0 >= mCheckObjectCount) { +fopAc_ac_c* dAttention_c::CheckObjectTarget(s32 i_no) { + if (i_no >= mCheckObjectCount) { return NULL; } - int listIdx = mCheckObjectOffset + param_0; + int listIdx = mCheckObjectOffset + i_no; if (listIdx >= mCheckObjectCount) { listIdx -= mCheckObjectCount; } @@ -1512,14 +1536,14 @@ fopAc_ac_c* dAttention_c::CheckObjectTarget(s32 param_0) { /* 800737E4-80073838 06E124 0054+00 3/3 53/53 37/37 .text LockonTruth__12dAttention_cFv */ bool dAttention_c::LockonTruth() { - return (mAttnStatus == ST_LOCK || mAttnStatus == ST_RELEASE) && LockonTarget(0); + return (mAttnStatus == EState_LOCK || mAttnStatus == EState_RELEASE) && LockonTarget(0) != NULL; } /* 80073838-80073864 06E178 002C+00 0/0 1/1 0/0 .text * checkDistance__12dAttention_cFP4cXyzsP4cXyzffff */ -int dAttention_c::checkDistance(cXyz* param_0, s16 param_1, cXyz* param_2, f32 param_3, f32 param_4, - f32 param_5, f32 param_6) { - return check_distace(param_0, param_1, param_2, param_3, param_4, param_5, param_6); +int dAttention_c::checkDistance(cXyz* i_pos, s16 i_angle, cXyz* i_attnPos, f32 i_distMax, f32 i_distAdjust, + f32 i_max_y, f32 i_min_y) { + return check_distace(i_pos, i_angle, i_attnPos, i_distMax, i_distAdjust, i_max_y, i_min_y); } /* 80073864-80073898 06E1A4 0034+00 11/11 3/3 8/8 .text getActor__10dAttList_cFv */ @@ -1558,15 +1582,15 @@ int dAttHint_c::request(fopAc_ac_c* i_actor, int i_priority) { /* 80073958-80073970 06E298 0018+00 1/1 0/0 0/0 .text init__10dAttHint_cFv */ void dAttHint_c::init() { - mHintActorID = -1; - field_0x8 = -1; + mHintActorID = fpcM_ERROR_PROCESS_ID_e; + field_0x8 = fpcM_ERROR_PROCESS_ID_e; mPriority = 0x200; } /* 80073970-8007398C 06E2B0 001C+00 1/1 0/0 0/0 .text proc__10dAttHint_cFv */ void dAttHint_c::proc() { field_0x8 = mHintActorID; - mHintActorID = -1; + mHintActorID = fpcM_ERROR_PROCESS_ID_e; mPriority = 0x200; } @@ -1577,61 +1601,72 @@ fopAc_ac_c* dAttCatch_c::convPId(fpc_ProcID i_id) { /* 800739BC-800739DC 06E2FC 0020+00 1/1 0/0 0/0 .text init__11dAttCatch_cFv */ void dAttCatch_c::init() { - field_0xc = 0x67; - field_0x0 = -1; - mCatghTargetID = -1; + mCatchItemNo = fpcNm_ITEM_WATER_BOTTLE; + mRequestActorID = fpcM_ERROR_PROCESS_ID_e; + mCatghTargetID = fpcM_ERROR_PROCESS_ID_e; field_0x4 = 3; } /* 800739DC-80073A08 06E31C 002C+00 1/1 0/0 0/0 .text proc__11dAttCatch_cFv */ void dAttCatch_c::proc() { - mCatghTargetID = field_0x0; - mChangeItem = field_0xc; - field_0x0 = -1; + mCatghTargetID = mRequestActorID; + mChangeItem = mCatchItemNo; + mRequestActorID = fpcM_ERROR_PROCESS_ID_e; field_0x4 = 3; - field_0xc = 0x67; + mCatchItemNo = fpcNm_ITEM_WATER_BOTTLE; +} + +// FAKEMATCH: this fixes regalloc in `dAttCatch_c::request` but breaks most other calls +// some more accurate fix should be found eventually +inline fopAc_ac_c* dComIfGp_getPlayer_fakematch(int idx) { + daAlink_c* const link = (daAlink_c* const)g_dComIfG_gameInfo.play.getPlayer(idx); + fopAc_ac_c* player = (fopAc_ac_c*)link; + return player; } /* 80073A08-80073CA4 06E348 029C+00 0/0 0/0 10/10 .text * request__11dAttCatch_cFP10fopAc_ac_cUcfffsi */ -// NONMATCHING regalloc -// This is a weird one. Some solution was found that changes dComIfGp_getPlayer but it is incompatible -// with other calls. -// https://decomp.me/scratch/aMCEI -int dAttCatch_c::request(fopAc_ac_c* param_1, u8 param_2, f32 param_3, f32 param_4, - f32 param_5, s16 param_6, int param_7) { - fopAc_ac_c* player = dComIfGp_getPlayer(0); +int dAttCatch_c::request(fopAc_ac_c* i_reqActor, u8 i_itemNo, f32 i_horizontalDist, f32 i_upDist, + f32 i_downDist, s16 i_angle, int param_7) { + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer_fakematch(0); if (param_7 > field_0x4) { return 0; } - cXyz acStack_48 = param_1->attention_info.position - player->attention_info.position; - if (acStack_48.y < param_5 || acStack_48.y > param_4) { + + cXyz vec_to_player = i_reqActor->attention_info.position - player->attention_info.position; + if (vec_to_player.y < i_downDist || vec_to_player.y > i_upDist) { return 0; } - f32 dVar7 = acStack_48.absXZ(); - if (dVar7 > param_3) { + + f32 player_xz_dist = vec_to_player.absXZ(); + if (player_xz_dist > i_horizontalDist) { return 0; } - if (param_6 != 0) { - cSGlobe acStack_50(acStack_48); - s16 sVar5 = acStack_50.U() - fopAcM_GetShapeAngle_p(player)->y; - if (sVar5 < 0) { - sVar5 = -sVar5; + + if (i_angle != 0) { + cSGlobe globe(vec_to_player); + csXyz* player_angle_p = fopAcM_GetShapeAngle_p(player); + + s16 angle = globe.U() - player_angle_p->y; + if (angle < 0) { + angle = -angle; } - if (sVar5 == -0x8000) { - sVar5 = 0x7fff; + if (angle == -0x8000) { + angle = 0x7fff; } - if (sVar5 > param_6) { + if (angle > i_angle) { return 0; } } - if (param_7 < field_0x4 || dVar7 < field_0x8) { + + if (param_7 < field_0x4 || player_xz_dist < mDistance) { field_0x4 = param_7; - field_0xc = param_2; - field_0x0 = fopAcM_GetID(param_1); - field_0x8 = dVar7; + mCatchItemNo = i_itemNo; + mRequestActorID = fopAcM_GetID(i_reqActor); + mDistance = player_xz_dist; return 1; } + return 0; } @@ -1642,55 +1677,57 @@ fopAc_ac_c* dAttLook_c::convPId(fpc_ProcID i_id) { /* 80073CD4-80073CEC 06E614 0018+00 1/1 0/0 0/0 .text init__10dAttLook_cFv */ void dAttLook_c::init() { - field_0x0 = -1; - mLookTargetID = -1; + mRequestActorID = fpcM_ERROR_PROCESS_ID_e; + mLookTargetID = fpcM_ERROR_PROCESS_ID_e; field_0x4 = 3; } /* 80073CEC-80073D08 06E62C 001C+00 1/1 0/0 0/0 .text proc__10dAttLook_cFv */ void dAttLook_c::proc() { - mLookTargetID = field_0x0; - field_0x0 = -1; + mLookTargetID = mRequestActorID; + mRequestActorID = fpcM_ERROR_PROCESS_ID_e; field_0x4 = 3; } /* 80073D08-80073FC4 06E648 02BC+00 0/0 0/0 7/7 .text request__10dAttLook_cFP10fopAc_ac_cfffsi */ -int dAttLook_c::request(fopAc_ac_c* param_1, f32 param_2, f32 param_3, f32 param_4, - s16 param_5, int param_6) { +int dAttLook_c::request(fopAc_ac_c* i_reqActor, f32 i_horizontalDist, f32 i_upDist, f32 i_downDist, + s16 i_angle, int param_6) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); if (param_6 > field_0x4) { return 0; } - cXyz acStack_48 = param_1->eyePos - player->eyePos; - if (acStack_48.y < param_4 || acStack_48.y > param_3) { + + cXyz vec_to_player = i_reqActor->eyePos - player->eyePos; + if (vec_to_player.y < i_downDist || vec_to_player.y > i_upDist) { return 0; } - f32 dVar7 = acStack_48.absXZ(); - if (dVar7 > param_2) { + + f32 player_xz_dist = vec_to_player.absXZ(); + if (player_xz_dist > i_horizontalDist) { return 0; } - if (param_5 != 0) { - acStack_48 = param_1->current.pos - player->current.pos; - cSGlobe acStack_50(acStack_48); - s16 sVar5 = acStack_50.U() - fopAcM_GetShapeAngle_p(player)->y; - if (sVar5 < 0) { - sVar5 = -sVar5; + + if (i_angle != 0) { + vec_to_player = i_reqActor->current.pos - player->current.pos; + cSGlobe globe(vec_to_player); + s16 angle = globe.U() - fopAcM_GetShapeAngle_p(player)->y; + if (angle < 0) { + angle = -angle; } - if (sVar5 == -0x8000) { - sVar5 = 0x7fff; + if (angle == -0x8000) { + angle = 0x7fff; } - if (sVar5 > param_5) { + if (angle > i_angle) { return 0; } } - if (param_6 < field_0x4 || dVar7 < field_0x8) { + + if (param_6 < field_0x4 || player_xz_dist < mDistance) { field_0x4 = param_6; - field_0x0 = fopAcM_GetID(param_1); - field_0x8 = dVar7; + mRequestActorID = fopAcM_GetID(i_reqActor); + mDistance = player_xz_dist; return 1; } + return 0; } - -/* 80073FC4-8007400C 06E904 0048+00 2/1 0/0 0/0 .text __dt__15dAttDrawParam_cFv */ -dAttDrawParam_c::~dAttDrawParam_c() {} diff --git a/src/d/d_msg_class.cpp b/src/d/d_msg_class.cpp index f7171e1f5e9..539d28cbfd7 100644 --- a/src/d/d_msg_class.cpp +++ b/src/d/d_msg_class.cpp @@ -294,12 +294,10 @@ static bool checkCharInfoCharactor(int c) { return false; } -/* ############################################################################################## */ -/* 804510C0-804510C8 0005C0 0003+05 1/1 0/0 0/0 .sbss mMoji$3770 */ -static char mMoji[3]; - /* 802285CC-80228608 222F0C 003C+00 3/3 0/0 0/0 .text changeCodeToChar__FUs */ -static const char* changeCodeToChar(u16 param_0) { +static char* changeCodeToChar(u16 param_0) { + static char mMoji[3]; + mMoji[0] = mMoji[1] = mMoji[2] = '\0'; mMoji[0] = param_0 >> 8; @@ -313,88 +311,129 @@ static const char* changeCodeToChar(u16 param_0) { return mMoji; } -/* ############################################################################################## */ -/* 803BFDF8-803BFE78 01CF18 0080+00 1/1 0/0 0/0 .data char_table$3795 */ -SECTION_DATA static u16 char_table[64] = { - 0x0000, 0x8142, 0x8175, 0x8176, 0x8141, 0x8145, 0x8392, 0x8340, 0x8342, 0x8344, 0x8346, - 0x8348, 0x8383, 0x8385, 0x8387, 0x8362, 0x815B, 0x8341, 0x8343, 0x8345, 0x8347, 0x8349, - 0x834A, 0x834C, 0x834E, 0x8350, 0x8352, 0x8354, 0x8356, 0x8358, 0x835A, 0x835C, 0x835E, - 0x8360, 0x8363, 0x8365, 0x8367, 0x8369, 0x836A, 0x836B, 0x836C, 0x836D, 0x836E, 0x8371, - 0x8374, 0x8377, 0x837A, 0x837D, 0x837E, 0x8380, 0x8381, 0x8382, 0x8384, 0x8386, 0x8388, - 0x8389, 0x838A, 0x838B, 0x838C, 0x838D, 0x838F, 0x8393, 0x814A, 0x814B, -}; - -/* 803BFE78-803BFF78 -00001 0100+00 1/1 0/0 0/0 .data @3831 */ -SECTION_DATA static void* lit_3831[64] = { - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xB0), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xBC), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xC8), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xD4), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xE0), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xEC), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0xF8), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x104), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x110), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x11C), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x128), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x134), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x140), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x14C), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x158), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x164), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x170), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x17C), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x188), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x194), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1A0), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1AC), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1B8), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1C4), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1D0), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1DC), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1E8), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x228), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x1F4), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x200), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x20C), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x218), - (void*)(((char*)change1ByteTo2Bytes__Fi) + 0x224), -}; - /* 80228608-80228838 222F48 0230+00 5/4 0/0 0/0 .text change1ByteTo2Bytes__Fi */ static u16 change1ByteTo2Bytes(int param_0) { - // NONMATCHING + static u16 char_table[] = { + 0x0000, 0x8142, 0x8175, 0x8176, 0x8141, 0x8145, 0x8392, 0x8340, 0x8342, 0x8344, 0x8346, + 0x8348, 0x8383, 0x8385, 0x8387, 0x8362, 0x815B, 0x8341, 0x8343, 0x8345, 0x8347, 0x8349, + 0x834A, 0x834C, 0x834E, 0x8350, 0x8352, 0x8354, 0x8356, 0x8358, 0x835A, 0x835C, 0x835E, + 0x8360, 0x8363, 0x8365, 0x8367, 0x8369, 0x836A, 0x836B, 0x836C, 0x836D, 0x836E, 0x8371, + 0x8374, 0x8377, 0x837A, 0x837D, 0x837E, 0x8380, 0x8381, 0x8382, 0x8384, 0x8386, 0x8388, + 0x8389, 0x838A, 0x838B, 0x838C, 0x838D, 0x838F, 0x8393, 0x814A, 0x814B, + }; + + u16 var_r30 = param_0; + if (param_0 >= '0' && param_0 <= '9') { + var_r30 = param_0 + 0x821F; + } else if (param_0 >= 'A' && param_0 <= 'Z') { + var_r30 = param_0 + 0x8230; + } else if (param_0 >= 'a' && param_0 <= 'z') { + var_r30 = param_0 + 0x8251; + } else if (param_0 >= 0xA0 && param_0 <= 0xDF) { + int sp8 = param_0 - 0xA0; + var_r30 = char_table[sp8]; + } else { + switch (param_0) { + case 0x20: + var_r30 = 0x8140; + break; + case 0x21: + var_r30 = 0x8149; + break; + case 0x22: + var_r30 = 0x8168; + break; + case 0x23: + var_r30 = 0x8194; + break; + case 0x24: + var_r30 = 0x8190; + break; + case 0x25: + var_r30 = 0x8193; + break; + case 0x26: + var_r30 = 0x8195; + break; + case 0x27: + var_r30 = 0x8166; + break; + case 0x28: + var_r30 = 0x8169; + break; + case 0x29: + var_r30 = 0x816a; + break; + case 0x2A: + var_r30 = 0x8196; + break; + case 0x2B: + var_r30 = 0x817b; + break; + case 0x2C: + var_r30 = 0x8143; + break; + case 0x2D: + var_r30 = 0x817c; + break; + case 0x2E: + var_r30 = 0x8144; + break; + case 0x2F: + var_r30 = 0x815e; + break; + case 0x3A: + var_r30 = 0x8146; + break; + case 0x3B: + var_r30 = 0x8147; + break; + case 0x3C: + var_r30 = 0x8171; + break; + case 0x3D: + var_r30 = 0x8181; + break; + case 0x3E: + var_r30 = 0x8172; + break; + case 0x3F: + var_r30 = 0x8148; + break; + case 0x4B: + var_r30 = 0x816d; + break; + case 0x4C: + var_r30 = 0x818f; + break; + case 0x4D: + var_r30 = 0x816e; + break; + case 0x4E: + var_r30 = 0x813f; + break; + case 0x4F: + var_r30 = 0x8151; + break; + case 0x5B: + var_r30 = 0x816f; + break; + case 0x5C: + var_r30 = 0x8162; + break; + case 0x5D: + var_r30 = 0x8170; + break; + case 0x5E: + var_r30 = 0x8140; + break; + case 0x5F: + var_r30 = 0; + break; + } + } + + return var_r30; } /* 80228838-802288A8 223178 0070+00 8/8 0/0 0/0 .text changeKataToHira__Fi */ @@ -537,212 +576,6 @@ static u8 getPohNum() { return num; } -/* ############################################################################################## */ -/* 803BFFA0-803BFFD0 -00001 0030+00 1/1 0/0 0/0 .data @5158 */ -SECTION_DATA static void* lit_5158[12] = { - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xCE8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xCF8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xD08), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xD24), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xD40), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xD5C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xD78), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xD94), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xDB0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xDCC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xDE8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xDE8), -}; - -/* 803BFFD0-803C000C -00001 003C+00 1/1 0/0 0/0 .data @5157 */ -SECTION_DATA static void* lit_5157[15] = { - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x9DC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xA60), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xA84), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xB5C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xB98), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xBB4), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xBD8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xC84), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xC14), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xAA8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xADC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xAFC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xB1C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xC38), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0xC5C), -}; - -/* 803C000C-803C0044 -00001 0038+00 1/1 0/0 0/0 .data @5156 */ -SECTION_DATA static void* lit_5156[14] = { - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x7FC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x818), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x834), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x850), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x870), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x890), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x8B0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x8D0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x8F0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x910), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x930), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x950), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x970), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x990), -}; - -/* 803C0044-803C0144 -00001 0100+00 1/1 0/0 0/0 .data @5155 */ -SECTION_DATA static void* lit_5155[64] = { - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x2A8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1D8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1E8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x278), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x278), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1E8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1E8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1E8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x450), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x510), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x5E0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x5CC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x610), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x64C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x2E4), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x69C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x6C0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x298), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x34C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x37C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x3AC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x66C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x6C8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x700), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x5E0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x5CC), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x320), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1E8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x734), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x79C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x65C), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x3F0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x420), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1E8), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x1F0), - (void*)(((char*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl) + 0x230), -}; - -/* 803C0144-803C0208 -00001 00C4+00 1/1 0/0 0/0 .data @5269 */ -SECTION_DATA static void* lit_5269[49] = { - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x90), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x98), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xA0), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xA8), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xB0), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xB8), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xC0), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xC8), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xD0), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xD8), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xE0), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xE8), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xF0), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0xF8), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x100), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x108), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x110), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x118), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x120), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x128), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x13C), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x130), - (void*)(((char*)do_space__26jmessage_tMeasureProcessorFUl) + 0x138), -}; - -/* 803C0208-803C0230 -00001 0028+00 1/1 0/0 0/0 .data @5735 */ -SECTION_DATA static void* lit_5735[10] = { - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x314), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x350), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x36C), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x350), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x380), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x314), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x314), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x380), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x350), - (void*)(((char*)do_isReady__27jmessage_tSequenceProcessorFv) + 0x350), -}; - -/* 80454A58-80454A5C 003058 0004+00 1/1 0/0 0/0 .sdata2 @4025 */ -SECTION_SDATA2 static f32 lit_4025 = 9.0f / 10.0f; - -/* 80454A5C-80454A60 00305C 0004+00 14/14 0/0 0/0 .sdata2 @4026 */ -SECTION_SDATA2 static f32 lit_4026 = 0.5f; - -/* 80454A60-80454A64 003060 0004+00 25/25 0/0 0/0 .sdata2 @4027 */ -SECTION_SDATA2 static u8 lit_4027[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* 80454A64-80454A68 003064 0004+00 23/23 0/0 0/0 .sdata2 @4028 */ -SECTION_SDATA2 static f32 lit_4028 = 1.0f; - /* 80228B04-80228CB4 223444 01B0+00 0/0 1/1 0/0 .text __ct__19jmessage_tReferenceFv */ jmessage_tReference::jmessage_tReference() { mpStick = new STControl(5, 2, 3, 2, 0.9f, 0.5f, 0, 0x2000); @@ -805,19 +638,12 @@ jmessage_tReference::jmessage_tReference() { mNowTagScale = 0; } - /* 80228CB4-80228D28 2235F4 0074+00 1/0 0/0 0/0 .text __dt__19jmessage_tReferenceFv */ -// jmessage_tReference::~jmessage_tReference() { -extern "C" void __dt__19jmessage_tReferenceFv() { - // NONMATCHING +jmessage_tReference::~jmessage_tReference() { + delete mpStick; + mpStick = NULL; } -/* ############################################################################################## */ -/* 80454A68-80454A70 003068 0008+00 1/1 0/0 0/0 .sdata2 @4078 */ -SECTION_SDATA2 static u8 lit_4078[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - /* 80228D28-80228DE0 223668 00B8+00 1/1 0/0 0/0 .text calcDistance__19jmessage_tReferenceFv */ void jmessage_tReference::calcDistance() { if (mActorPos.x == 0.0f && mActorPos.y == 0.0f && mActorPos.z == 0.0f) { @@ -829,7 +655,6 @@ void jmessage_tReference::calcDistance() { } } - /* 80228DE0-80228E6C 223720 008C+00 5/5 0/0 0/0 .text getLineMax__19jmessage_tReferenceFv */ u8 jmessage_tReference::getLineMax() { @@ -982,7 +807,6 @@ void jmessage_tReference::pageSend() { mTopTagScale = mNowTagScale; } - /* ############################################################################################## */ /* 80454A78-80454A7C 003078 0004+00 4/4 0/0 0/0 .sdata2 @4291 */ SECTION_SDATA2 static f32 lit_4291 = -1.0f; @@ -1046,7 +870,6 @@ void jmessage_tReference::selectMessage() { } } - /* 802294A8-80229730 223DE8 0288+00 0/0 1/1 0/0 .text inputNumber__19jmessage_tReferenceFv */ void jmessage_tReference::inputNumber() { mpStick->checkTrigger(); @@ -1124,7 +947,6 @@ void jmessage_tReference::inputNumber() { getObjectPtr()->setInputValue(new_input_val); } - /* 80229730-80229744 224070 0014+00 5/5 0/0 0/0 .text getWord__19jmessage_tReferenceFi */ char* jmessage_tReference::getWord(int i_no) { return mWord[i_no]; @@ -1290,7 +1112,7 @@ jmessage_tMeasureProcessor::jmessage_tMeasureProcessor(jmessage_tReference const jmessage_tReference* reference_p = (jmessage_tReference*)getReference(); reference_p->resetCharactor(); - field_0x38 = lit_4028; + field_0x38 = 1.0f; mTotalLineCnt = 0; field_0x3e = 0; field_0x40 = 0; @@ -1371,36 +1193,118 @@ void jmessage_tMeasureProcessor::do_begin(void const* param_0, char const* param } } - /* 80229CB4-80229E3C 2245F4 0188+00 1/0 0/0 0/0 .text do_end__26jmessage_tMeasureProcessorFv */ void jmessage_tMeasureProcessor::do_end() { - // NONMATCHING + if (field_0x49 == 0) { + field_0x3e++; + } + + jmessage_tReference* ref = (jmessage_tReference*)getReference(); + + if (field_0x46 == 0) { + if (field_0x49 > 1) { + ref->setPageLine(field_0x40, field_0x3e - (field_0x49 - 1)); + ref->setPageLineMax(field_0x40, field_0x3e - (field_0x49 - 1)); + } else { + ref->setPageLine(field_0x40, field_0x3e); + ref->setPageLineMax(field_0x40, field_0x3e); + } + } + + ref->setPageEndCount(field_0x40); + do_pageType(field_0x3e); + Z2GetSpeechMgr2()->setString(ref->getCharSoundInfo().data, ref->getCharSoundInfo().field_0x40c, field_0x4c, field_0x42); } /* 80229E3C-8022A268 22477C 042C+00 1/0 0/0 0/0 .text do_character__26jmessage_tMeasureProcessorFi */ void jmessage_tMeasureProcessor::do_character(int param_0) { - // NONMATCHING + jmessage_tReference* ref = (jmessage_tReference*)getReference(); + JUTFont* font = ref->getFont(); + + if (field_0x44 == 0) { + if (font->isLeadByte_ShiftJIS(param_0)) { + if (!isOutfontKanjiCode(param_0)) { + u16 var_r25 = change1ByteTo2Bytes(param_0); + ref->setCharactor(changeKataToHira(var_r25)); + } + } else if (param_0 < 0x8800 && !isOutfontKanjiCode(param_0)) { + ref->setCharactor(changeKataToHira(param_0)); + } + } + + if (param_0 == 10) { + mTotalLineCnt++; + field_0x3e++; + + if (field_0x44 != 0) { + ref->setLineArrange(mTotalLineCnt, 1); + field_0x44--; + } + + field_0x48 = 0; + + if (field_0x49 != 0) { + field_0x49++; + } else { + field_0x49 = 1; + } + + if (mSelectType == 0 && field_0x3e >= mPageLineMax) { + ref->setPageLine(field_0x40, mPageLineMax - (field_0x49 - 1)); + ref->setPageLineMax(field_0x40, field_0x3e); + do_pageType(mPageLineMax - (field_0x49 - 1)); + + if (field_0x46 == 0) { + field_0x40++; + } + + field_0x3e = 0; + mPageLineMax = ref->getLineMax(); + field_0x49 = 0; + + if (field_0x46 == 0 && field_0x38 > 1.0f && field_0x48 == 0) { + field_0x48 = 1; + mPageLineMax--; + JUT_ASSERT(0x665, mPageLineMax > 0); + ref->setPageType(field_0x40, 2); + } + } + + if (mTotalLineCnt < ((4)*10)) { + JUT_ASSERT(0x672, mTotalLineCnt < ((4)*10)); + } + } else { + if (field_0x49 != 0) { + field_0x49 = 0; + } + + ref->addLineLength(mTotalLineCnt, field_0x38 * font->getWidth(param_0) / (f32)font->getCellWidth(), 1.0f); + + if (field_0x46 != 0) { + f32 var_f31 = ref->getSelFontSize() / (f32)font->getCellWidth(); + ref->addSelLength(field_0x46 - 1, (var_f31 * (field_0x38 * font->getWidth(param_0))) + ref->getSelCharSpace()); + } + + if (field_0x38 > 1.0f) { + if (field_0x3e == 1 && ref->getPageType(field_0x40) == 2) { + ref->setPageType(field_0x40, 4); + ref->setLineScale(mTotalLineCnt, ref->getLineScale(0)); + } else if (field_0x3e == 2 && ref->getPageType(field_0x40) == 4) { + ref->setPageType(field_0x40, 5); + ref->setLineScale(mTotalLineCnt, ref->getLineScale(0)); + } + } + } } -/* ############################################################################################## */ -/* 80399610-80399610 025C70 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80399610 = "'"; -SECTION_DEAD static char const* const stringBase_80399612 = "s"; -SECTION_DEAD static char const* const stringBase_80399614 = "%d"; -#pragma pop - -/* 80454A7C-80454A80 00307C 0004+00 5/5 0/0 0/0 .sdata2 @5151 */ -SECTION_SDATA2 static f32 lit_5151 = 100.0f; - -/* 80454A80-80454A88 003080 0008+00 5/5 0/0 0/0 .sdata2 @5154 */ -SECTION_SDATA2 static f64 lit_5154 = 4503599627370496.0 /* cast u32 to float */; +static void dummyString() { + DEAD_STRING("'"); + DEAD_STRING("s"); +} /* 8022A268-8022B0B0 224BA8 0E48+00 5/0 0/0 0/0 .text do_tag__26jmessage_tMeasureProcessorFUlPCvUl */ -#ifdef NONMATCHING bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_size) { jmessage_tReference* reference_p = (jmessage_tReference*)getReference(); @@ -1648,9 +1552,10 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz case 0x37: u8 bomb_type = fpcNm_ITEM_NORMAL_BOMB; - if (*(u8*)i_data == 1) { + const u8 spA = *(u8*)i_data; + if (spA == 1) { bomb_type = fpcNm_ITEM_WATER_BOMB; - } else if (*(u8*)i_data == 2) { + } else if (spA == 2) { bomb_type = fpcNm_ITEM_POKE_BOMB; } @@ -1717,10 +1622,11 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz char buffer_0[40]; switch (i_tag & 0xFF00FFFF) { case 0: - if (*(u8*)i_data == 0) { + const u8 sp9 = *(u8*)i_data; + if (sp9 == 0) { int msg_time_ms = dMeter2Info_getMsgTimeMs(); dMsgUnit_setTag(4, msg_time_ms, buffer_0); - } else if (*(u8*)i_data == 2) { + } else if (sp9 == 2) { int race_time = dComIfGs_getRaceGameTime(); dMsgUnit_setTag(4, race_time, buffer_0); } else { @@ -1790,7 +1696,7 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz dMsgUnit_setTag(0x10001, (u32)dComIfGp_getMessageCountNumber(), buffer_0); break; case 7: - int now_count = dMeter2Info_getNowCount(); + u8 now_count = dMeter2Info_getNowCount(); dMsgUnit_setTag(8, now_count, buffer_0); break; default: @@ -1868,20 +1774,162 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz return false; } -#else -bool jmessage_tMeasureProcessor::do_tag(u32 param_0, void const* param_1, u32 param_2) { - // NONMATCHING -} -#endif /* 8022B0B0-8022B18C 2259F0 00DC+00 2/2 0/0 0/0 .text do_scale__26jmessage_tMeasureProcessorFf */ void jmessage_tMeasureProcessor::do_scale(f32 param_0) { - // NONMATCHING + jmessage_tReference* ref = (jmessage_tReference*)getReference(); + field_0x38 = param_0 * ref->getDistanceScale(); + + if (field_0x38 > 1.0f && field_0x48 == 0) { + field_0x48 = 1; + mPageLineMax--; + JUT_ASSERT(0x930, mPageLineMax > 0); + + if (field_0x3e == 0) { + ref->setPageType(field_0x40, 2); + } else if (field_0x3e == 2 && mPageLineMax == 3) { + if (ref->getPageType(field_0x40) == 4) { + ref->setPageType(field_0x40, 5); + } else { + ref->setPageType(field_0x40, 8); + } + } else { + ref->setPageType(field_0x40, 3); + if (field_0x3e == 1 && ref->getPageType(field_0x40) == 2) { + ref->setPageType(field_0x40, 4); + } + } + } } /* 8022B18C-8022B3EC 225ACC 0260+00 2/1 0/0 0/0 .text do_space__26jmessage_tMeasureProcessorFUl */ -void jmessage_tMeasureProcessor::do_space(u32 param_0) { - // NONMATCHING +void jmessage_tMeasureProcessor::do_space(u32 i_tag) { + jmessage_tReference* ref = (jmessage_tReference*)getReference(); + f32 var_f31 = field_0x38; + + if (field_0x44 == 0) { + u16 var_r30 = 0xFFFF; + switch (i_tag & 0xFF0000) { + case 0: + switch (i_tag) { + case 10: + var_r30 = 0xFFE0; + break; + case 11: + var_r30 = 0xFFE1; + break; + case 12: + var_r30 = 0xFFE2; + break; + case 13: + var_r30 = 0xFFE3; + break; + case 14: + var_r30 = 0xFFE4; + break; + case 15: + var_r30 = 0xFFE5; + break; + case 16: + var_r30 = 0xFFE6; + break; + case 17: + var_r30 = 0xFFE7; + break; + case 18: + var_r30 = 0xFFE8; + break; + case 19: + var_r30 = 0xFFE9; + break; + case 20: + var_r30 = 0xFFEA; + break; + case 21: + var_r30 = 0xFFEB; + break; + case 22: + var_r30 = 0xFFEC; + break; + case 23: + var_r30 = 0xFFED; + break; + case 24: + var_r30 = 0xFFEE; + break; + case 25: + var_r30 = 0xFFF0; + break; + case 26: + var_r30 = 0xFFF1; + break; + case 27: + var_r30 = 0xFFF2; + break; + case 28: + var_r30 = 0xFFF3; + break; + case 29: + var_r30 = 0xFFF4; + break; + case 57: + var_r30 = 0xFFF5; + break; + case 58: + var_r30 = 0xFFF6; + break; + } + + ref->setCharactor(var_r30); + break; + case 0x30000: + switch (i_tag & 0xFF00FFFF) { + case 3: + case 4: + case 5: + ref->setCharactor(0xFFFF); + break; + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + ref->setCharactor(0xFFFF); + break; + case 16: + case 17: + case 18: + case 19: + case 20: + case 6: + case 7: + case 1: + case 2: + ref->setCharactor(0xFFFF); + } + break; + case 0x60000: + switch (i_tag) { + case 10: + case 11: + ref->setCharactor(0xFFFF); + break; + } + break; + } + } + + if (field_0x49 != 0) { + field_0x49 = 0; + } + + ref->addLineLength(mTotalLineCnt, var_f31, 1.0f); + if (field_0x46 != 0) { + ref->addSelLength(field_0x46 - 1, var_f31); + } } /* 8022B3EC-8022B454 225D2C 0068+00 3/3 0/0 0/0 .text do_pageType__26jmessage_tMeasureProcessorFi @@ -1906,8 +1954,25 @@ void jmessage_tMeasureProcessor::do_name1() {} /* 8022B458-8022B4E0 225D98 0088+00 1/1 0/0 0/0 .text * do_rubyset__26jmessage_tMeasureProcessorFPCvUl */ +// NONMATCHING - issue with or void jmessage_tMeasureProcessor::do_rubyset(void const* param_0, u32 param_1) { - // NONMATCHING + if (field_0x44 == 0) { + u8 var_r28 = param_1 - 1; + u8* var_r30 = (u8*)param_0; + int var_r29 = 0; + + var_r30++; + + jmessage_tReference* ref = (jmessage_tReference*)getReference(); + while (var_r29 < var_r28) { + s8 sp10 = var_r30[var_r29++]; + s8 sp11 = var_r30[var_r29++]; + s8 sp12 = 0; + + int var_r26 = (sp10 << 8) | sp11; + ref->setCharactor(changeKataToHira(var_r26)); + } + } } /* 8022B4E0-8022B558 225E20 0078+00 1/1 0/0 0/0 .text push_word__26jmessage_tMeasureProcessorFPc @@ -1921,7 +1986,7 @@ void jmessage_tMeasureProcessor::push_word(char* param_0) { /* 8022B558-8022B5F4 225E98 009C+00 0/0 1/1 0/0 .text * __ct__27jmessage_tSequenceProcessorFPC19jmessage_tReferenceP17jmessage_tControl */ -#ifdef NONMATCHING +// NONMATCHING jmessage_tSequenceProcessor::jmessage_tSequenceProcessor(jmessage_tReference const* param_0, jmessage_tControl* param_1) : JMessage::TSequenceProcessor(param_0, param_1), jmessage_tMeasureProcessor(param_0) { @@ -1940,19 +2005,9 @@ jmessage_tSequenceProcessor::jmessage_tSequenceProcessor(jmessage_tReference con field_0xb3 = 0; field_0xb4 = 0; } -#else -jmessage_tSequenceProcessor::jmessage_tSequenceProcessor(jmessage_tReference const* param_0, - jmessage_tControl* param_1) - : JMessage::TSequenceProcessor(param_0, param_1), jmessage_tMeasureProcessor(param_0) { - // NONMATCHING -} -#endif /* 8022B5F4-8022B654 225F34 0060+00 1/0 0/0 0/0 .text __dt__26jmessage_tMeasureProcessorFv */ -// jmessage_tMeasureProcessor::~jmessage_tMeasureProcessor() { -extern "C" void __dt__26jmessage_tMeasureProcessorFv() { - // NONMATCHING -} +jmessage_tMeasureProcessor::~jmessage_tMeasureProcessor() {} /* 8022B654-8022B658 225F94 0004+00 1/0 0/0 0/0 .text do_reset__27jmessage_tSequenceProcessorFv */ void jmessage_tSequenceProcessor::do_reset() {} @@ -2388,8 +2443,7 @@ void jmessage_tSequenceProcessor::do_space(u32 param_0) { /* 8022CA24-8022CAAC 227364 0088+00 1/1 0/0 0/0 .text * do_rubyset__27jmessage_tSequenceProcessorFPCvUl */ -// or logic -#ifdef NONMATCHING +// NONMATCHING - or logic void jmessage_tSequenceProcessor::do_rubyset(void const* param_0, u32 param_1) { if (field_0xac == 0) { u8 size = param_1 - 1; @@ -2404,11 +2458,6 @@ void jmessage_tSequenceProcessor::do_rubyset(void const* param_0, u32 param_1) { } } } -#else -void jmessage_tSequenceProcessor::do_rubyset(void const* param_0, u32 param_1) { - // NONMATCHING -} -#endif /* 8022CAAC-8022CB10 2273EC 0064+00 1/1 0/0 0/0 .text push_word__27jmessage_tSequenceProcessorFv */ @@ -2584,7 +2633,6 @@ void jmessage_tRenderingProcessor::resetRendering() { *mpCharInfoCnt = 0; } - /* ############################################################################################## */ /* 80399610-80399610 025C70 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ #pragma push @@ -2728,8 +2776,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* param_0, bool param_1, bool p /* 8022F148-8022F384 229A88 023C+00 1/1 0/0 0/0 .text * do_rubyset__28jmessage_tRenderingProcessorFPCvUl */ -// buffer initialization -#ifdef NONMATCHING +// NONMATCHING - buffer initialization void jmessage_tRenderingProcessor::do_rubyset(void const* param_0, u32 param_1) { jmessage_tReference* pRef = (jmessage_tReference*) getReference(); JUTFont* pFont = pRef->getFont(); @@ -2764,11 +2811,6 @@ void jmessage_tRenderingProcessor::do_rubyset(void const* param_0, u32 param_1) field_0x130 = field_0x48 - mTextInitPosX; } } -#else -void jmessage_tRenderingProcessor::do_rubyset(void const* param_0, u32 param_1) { - // NONMATCHING -} -#endif /* ############################################################################################## */ /* 80399610-80399610 025C70 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -2807,7 +2849,6 @@ void jmessage_tRenderingProcessor::do_rubystrcat(char* param_1, char* param_2, f } } - /* 8022F53C-8022F540 229E7C 0004+00 1/1 0/0 0/0 .text do_name1__28jmessage_tRenderingProcessorFv */ void jmessage_tRenderingProcessor::do_name1() {} @@ -2884,7 +2925,6 @@ jmessage_string_tReference::jmessage_string_tReference() { resetCharactor(); } - /* 8022F94C-8022F9AC 22A28C 0060+00 1/0 0/0 0/0 .text __dt__26jmessage_string_tReferenceFv */ // jmessage_string_tReference::~jmessage_string_tReference() { extern "C" void __dt__26jmessage_string_tReferenceFv() { @@ -2916,7 +2956,6 @@ void jmessage_string_tReference::init(J2DTextBox* panePtr, J2DTextBox* runyPaneP } } - /* 8022FA2C-8022FA30 22A36C 0004+00 3/3 0/0 0/0 .text * setCharactor__26jmessage_string_tReferenceFUs */ void jmessage_string_tReference::setCharactor(u16 param_0) {} @@ -2943,7 +2982,6 @@ f32 jmessage_string_tReference::getLineLength(int lineNo) { return 0.0f; } - /* 8022FA6C-8022FA98 22A3AC 002C+00 2/2 0/0 0/0 .text * addLineLength__26jmessage_string_tReferenceFif */ void jmessage_string_tReference::addLineLength(int lineNo, f32 length) { @@ -2962,7 +3000,6 @@ f32 jmessage_string_tReference::getOutfontLength(int param_0) { return 0.0f; } - /* 8022FACC-8022FAF0 22A40C 0024+00 1/1 0/0 0/0 .text * setOutfontLength__26jmessage_string_tReferenceFif */ void jmessage_string_tReference::setOutfontLength(int param_0, f32 param_1) { @@ -2982,7 +3019,6 @@ void jmessage_string_tReference::clearOutfontLength(int param_0) { } } - /* 8022FB24-8022FB5C 22A464 0038+00 4/4 0/0 0/0 .text * getLineCountNowPage__26jmessage_string_tReferenceFv */ s16 jmessage_string_tReference::getLineCountNowPage() { @@ -3058,7 +3094,6 @@ void jmessage_string_tMeasureProcessor::do_character(int param_0) { } } - /* 803C056C-803C059C -00001 0030+00 1/1 0/0 0/0 .data @7487 */ SECTION_DATA static void* lit_7487[12] = { (void*)(((char*)do_tag__33jmessage_string_tMeasureProcessorFUlPCvUl) + 0x940), @@ -3203,8 +3238,7 @@ jmessage_string_tSequenceProcessor::jmessage_string_tSequenceProcessor( /* 80230A5C-80230ABC 22B39C 0060+00 1/0 0/0 0/0 .text __dt__33jmessage_string_tMeasureProcessorFv */ -// jmessage_string_tMeasureProcessor::~jmessage_string_tMeasureProcessor() { -extern "C" void __dt__33jmessage_string_tMeasureProcessorFv() { +jmessage_string_tMeasureProcessor::~jmessage_string_tMeasureProcessor() { // NONMATCHING } @@ -3299,7 +3333,6 @@ void jmessage_string_tRenderingProcessor::do_reset() { field_0x486[0] = 0; } - /* 80230CA0-80230CE8 22B5E0 0048+00 1/0 0/0 0/0 .text * do_begin__35jmessage_string_tRenderingProcessorFPCvPCc */ void jmessage_string_tRenderingProcessor::do_begin(void const* param_0, char const* param_1) { @@ -3483,8 +3516,7 @@ bool jmessage_string_tRenderingProcessor::do_tag(u32 param_0, void const* param_ /* 80231D70-80231EF0 22C6B0 0180+00 2/2 0/0 0/0 .text * do_widthcenter__35jmessage_string_tRenderingProcessorFv */ -// float load order -#ifdef NONMATCHING +// NONMATCHING - float load order void jmessage_string_tRenderingProcessor::do_widthcenter() { if (getLineCountNowPage() >= 0 && mpReference->getPanePtr() != NULL) { if (mpReference->isFlag(1) == 0) { @@ -3510,16 +3542,10 @@ void jmessage_string_tRenderingProcessor::do_widthcenter() { } } } -#else -void jmessage_string_tRenderingProcessor::do_widthcenter() { - // NONMATCHING -} -#endif /* 80231EF0-80232044 22C830 0154+00 1/1 0/0 0/0 .text * do_heightcenter__35jmessage_string_tRenderingProcessorFv */ -// Instruction order -#ifdef NONMATCHING +// NONMATCHING - Instruction order void jmessage_string_tRenderingProcessor::do_heightcenter() { if (mpReference->getLineCountNowPage() >= 0 && mpReference->getPanePtr() != NULL) { if (mpReference->isFlag(2) == 0) { @@ -3543,11 +3569,6 @@ void jmessage_string_tRenderingProcessor::do_heightcenter() { } } } -#else -void jmessage_string_tRenderingProcessor::do_heightcenter() { - // NONMATCHING -} -#endif /* 80232044-802320B0 22C984 006C+00 7/7 0/0 0/0 .text * do_strcat__35jmessage_string_tRenderingProcessorFPc */ @@ -3562,8 +3583,7 @@ void jmessage_string_tRenderingProcessor::do_strcat(char* param_0) { /* 802320B0-80232260 22C9F0 01B0+00 1/1 0/0 0/0 .text * do_rubyset__35jmessage_string_tRenderingProcessorFPCvUl */ -// array char assignment -#ifdef NONMATCHING +// NONMATCHING - array char assignment void jmessage_string_tRenderingProcessor::do_rubyset(void const* param_0, u32 param_1) { if (getLineCountNowPage() >= 0) { if (mpReference->getRubyPanePtr() != NULL) { @@ -3594,11 +3614,6 @@ void jmessage_string_tRenderingProcessor::do_rubyset(void const* param_0, u32 pa } } } -#else -void jmessage_string_tRenderingProcessor::do_rubyset(void const* param_0, u32 param_1) { - // NONMATCHING -} -#endif /* 80232260-802322CC 22CBA0 006C+00 2/2 0/0 0/0 .text * do_rubystrcat__35jmessage_string_tRenderingProcessorFPc */ @@ -3646,7 +3661,6 @@ void jmessage_string_tRenderingProcessor::do_scale(f32 param_0) { do_strcat(buffer); } - /* 80232690-802326E4 22CFD0 0054+00 1/1 0/0 0/0 .text * do_linedown__35jmessage_string_tRenderingProcessorFs */ void jmessage_string_tRenderingProcessor::do_linedown(s16 param_0) { @@ -3676,205 +3690,3 @@ void jmessage_string_tRenderingProcessor::push_word(char const* param_0) { strcpy(field_0x486, param_0); stack_pushCurrent(field_0x486); } - -/* 802327F8-80232858 22D138 0060+00 1/0 0/0 0/0 .text - * __dt__35jmessage_string_tRenderingProcessorFv */ -// jmessage_string_tRenderingProcessor::~jmessage_string_tRenderingProcessor() { -extern "C" void __dt__35jmessage_string_tRenderingProcessorFv() { - // NONMATCHING -} - -/* 80232858-802328DC 22D198 0084+00 1/0 0/0 0/0 .text __dt__34jmessage_string_tSequenceProcessorFv - */ -// jmessage_string_tSequenceProcessor::~jmessage_string_tSequenceProcessor() { -extern "C" void __dt__34jmessage_string_tSequenceProcessorFv() { - // NONMATCHING -} - -/* 802328DC-8023293C 22D21C 0060+00 1/0 0/0 0/0 .text __dt__24jmessage_string_tControlFv - */ -// jmessage_string_tControl::~jmessage_string_tControl() { -extern "C" void __dt__24jmessage_string_tControlFv() { - // NONMATCHING -} - -/* 8023293C-8023299C 22D27C 0060+00 1/0 0/0 0/0 .text __dt__28jmessage_tRenderingProcessorFv */ -// jmessage_tRenderingProcessor::~jmessage_tRenderingProcessor() { -extern "C" void __dt__28jmessage_tRenderingProcessorFv() { - // NONMATCHING -} - -/* 8023299C-80232A20 22D2DC 0084+00 1/0 0/0 0/0 .text __dt__27jmessage_tSequenceProcessorFv */ -// jmessage_tSequenceProcessor::~jmessage_tSequenceProcessor() { -extern "C" void __dt__27jmessage_tSequenceProcessorFv() { - // NONMATCHING -} - -/* 80232A20-80232A3C 22D360 001C+00 2/2 0/0 0/0 .text getActorPos__19jmessage_tReferenceFv */ -cXyz jmessage_tReference::getActorPos() { - // NONMATCHING -} - -/* 803C0908-803C0948 01DA28 0040+00 2/2 0/0 0/0 .data __vt__35jmessage_string_tRenderingProcessor - */ -SECTION_DATA extern void* __vt__35jmessage_string_tRenderingProcessor[16] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__35jmessage_string_tRenderingProcessorFv, - (void*)do_reset__35jmessage_string_tRenderingProcessorFv, - (void*)do_begin__35jmessage_string_tRenderingProcessorFPCvPCc, - (void*)do_end__35jmessage_string_tRenderingProcessorFv, - (void*)do_character__35jmessage_string_tRenderingProcessorFi, - (void*)do_tag__35jmessage_string_tRenderingProcessorFUlPCvUl, - (void*)do_select_begin__Q28JMessage10TProcessorFUl, - (void*)do_select_end__Q28JMessage10TProcessorFv, - (void*)do_select_separate__Q28JMessage10TProcessorFv, - (void*)do_resetStatus___Q28JMessage10TProcessorFPCc, - (void*)do_setBegin_isReady___Q28JMessage10TProcessorCFv, - (void*)do_begin___Q28JMessage19TRenderingProcessorFPCvPCc, - (void*)do_end___Q28JMessage19TRenderingProcessorFv, - (void*)do_tag___Q28JMessage19TRenderingProcessorFUlPCvUl, -}; - -/* 803C0948-803C09A0 01DA68 0058+00 2/2 0/0 0/0 .data __vt__34jmessage_string_tSequenceProcessor - */ -SECTION_DATA extern void* __vt__34jmessage_string_tSequenceProcessor[22] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__34jmessage_string_tSequenceProcessorFv, - (void*)do_reset__34jmessage_string_tSequenceProcessorFv, - (void*)do_begin__34jmessage_string_tSequenceProcessorFPCvPCc, - (void*)do_end__34jmessage_string_tSequenceProcessorFv, - (void*)do_character__34jmessage_string_tSequenceProcessorFi, - (void*)do_tag__34jmessage_string_tSequenceProcessorFUlPCvUl, - (void*)do_select_begin__Q28JMessage10TProcessorFUl, - (void*)do_select_end__Q28JMessage10TProcessorFv, - (void*)do_select_separate__Q28JMessage10TProcessorFv, - (void*)do_resetStatus___Q28JMessage18TSequenceProcessorFPCc, - (void*)do_setBegin_isReady___Q28JMessage18TSequenceProcessorCFv, - (void*)do_begin___Q28JMessage18TSequenceProcessorFPCvPCc, - (void*)do_end___Q28JMessage18TSequenceProcessorFv, - (void*)do_tag___Q28JMessage18TSequenceProcessorFUlPCvUl, - (void*)do_isReady__34jmessage_string_tSequenceProcessorFv, - (void*)do_jump_isReady__34jmessage_string_tSequenceProcessorFv, - (void*)do_jump__34jmessage_string_tSequenceProcessorFPCvPCc, - (void*)do_branch_query__Q28JMessage18TSequenceProcessorFUl, - (void*)do_branch_queryResult__Q28JMessage18TSequenceProcessorFv, - (void*)do_branch__Q28JMessage18TSequenceProcessorFPCvPCc, -}; - -/* 803C09A0-803C09E0 01DAC0 0040+00 3/3 0/0 0/0 .data __vt__33jmessage_string_tMeasureProcessor */ -SECTION_DATA extern void* __vt__33jmessage_string_tMeasureProcessor[16] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__33jmessage_string_tMeasureProcessorFv, - (void*)do_reset__Q28JMessage10TProcessorFv, - (void*)do_begin__33jmessage_string_tMeasureProcessorFPCvPCc, - (void*)do_end__33jmessage_string_tMeasureProcessorFv, - (void*)do_character__33jmessage_string_tMeasureProcessorFi, - (void*)do_tag__33jmessage_string_tMeasureProcessorFUlPCvUl, - (void*)do_select_begin__Q28JMessage10TProcessorFUl, - (void*)do_select_end__Q28JMessage10TProcessorFv, - (void*)do_select_separate__Q28JMessage10TProcessorFv, - (void*)do_resetStatus___Q28JMessage10TProcessorFPCc, - (void*)do_setBegin_isReady___Q28JMessage10TProcessorCFv, - (void*)do_begin___Q28JMessage19TRenderingProcessorFPCvPCc, - (void*)do_end___Q28JMessage19TRenderingProcessorFv, - (void*)do_tag___Q28JMessage19TRenderingProcessorFUlPCvUl, -}; - -/* 803C09E0-803C09EC 01DB00 000C+00 2/2 0/0 0/0 .data __vt__24jmessage_string_tControl */ -SECTION_DATA extern void* __vt__24jmessage_string_tControl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__24jmessage_string_tControlFv, -}; - -/* 803C09EC-803C09FC 01DB0C 0010+00 2/2 0/0 0/0 .data __vt__26jmessage_string_tReference - */ -SECTION_DATA extern void* __vt__26jmessage_string_tReference[4] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__26jmessage_string_tReferenceFv, - (void*)do_word__Q28JMessage10TReferenceCFUl, -}; - -/* 803C09FC-803C0A3C 01DB1C 0040+00 2/2 0/0 0/0 .data __vt__28jmessage_tRenderingProcessor */ -SECTION_DATA extern void* __vt__28jmessage_tRenderingProcessor[16] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__28jmessage_tRenderingProcessorFv, - (void*)do_reset__28jmessage_tRenderingProcessorFv, - (void*)do_begin__28jmessage_tRenderingProcessorFPCvPCc, - (void*)do_end__28jmessage_tRenderingProcessorFv, - (void*)do_character__28jmessage_tRenderingProcessorFi, - (void*)do_tag__28jmessage_tRenderingProcessorFUlPCvUl, - (void*)do_select_begin__Q28JMessage10TProcessorFUl, - (void*)do_select_end__Q28JMessage10TProcessorFv, - (void*)do_select_separate__Q28JMessage10TProcessorFv, - (void*)do_resetStatus___Q28JMessage10TProcessorFPCc, - (void*)do_setBegin_isReady___Q28JMessage10TProcessorCFv, - (void*)do_begin___Q28JMessage19TRenderingProcessorFPCvPCc, - (void*)do_end___Q28JMessage19TRenderingProcessorFv, - (void*)do_tag___Q28JMessage19TRenderingProcessorFUlPCvUl, -}; - -/* 803C0A3C-803C0A94 01DB5C 0058+00 2/2 0/0 0/0 .data __vt__27jmessage_tSequenceProcessor - */ -SECTION_DATA extern void* __vt__27jmessage_tSequenceProcessor[22] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__27jmessage_tSequenceProcessorFv, - (void*)do_reset__27jmessage_tSequenceProcessorFv, - (void*)do_begin__27jmessage_tSequenceProcessorFPCvPCc, - (void*)do_end__27jmessage_tSequenceProcessorFv, - (void*)do_character__27jmessage_tSequenceProcessorFi, - (void*)do_tag__27jmessage_tSequenceProcessorFUlPCvUl, - (void*)do_select_begin__Q28JMessage10TProcessorFUl, - (void*)do_select_end__Q28JMessage10TProcessorFv, - (void*)do_select_separate__Q28JMessage10TProcessorFv, - (void*)do_resetStatus___Q28JMessage18TSequenceProcessorFPCc, - (void*)do_setBegin_isReady___Q28JMessage18TSequenceProcessorCFv, - (void*)do_begin___Q28JMessage18TSequenceProcessorFPCvPCc, - (void*)do_end___Q28JMessage18TSequenceProcessorFv, - (void*)do_tag___Q28JMessage18TSequenceProcessorFUlPCvUl, - (void*)do_isReady__27jmessage_tSequenceProcessorFv, - (void*)do_jump_isReady__27jmessage_tSequenceProcessorFv, - (void*)do_jump__27jmessage_tSequenceProcessorFPCvPCc, - (void*)do_branch_query__Q28JMessage18TSequenceProcessorFUl, - (void*)do_branch_queryResult__Q28JMessage18TSequenceProcessorFv, - (void*)do_branch__Q28JMessage18TSequenceProcessorFPCvPCc, -}; - -/* 803C0A94-803C0AD4 01DBB4 0040+00 3/3 0/0 0/0 .data __vt__26jmessage_tMeasureProcessor - */ -SECTION_DATA extern void* __vt__26jmessage_tMeasureProcessor[16] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__26jmessage_tMeasureProcessorFv, - (void*)do_reset__Q28JMessage10TProcessorFv, - (void*)do_begin__26jmessage_tMeasureProcessorFPCvPCc, - (void*)do_end__26jmessage_tMeasureProcessorFv, - (void*)do_character__26jmessage_tMeasureProcessorFi, - (void*)do_tag__26jmessage_tMeasureProcessorFUlPCvUl, - (void*)do_select_begin__Q28JMessage10TProcessorFUl, - (void*)do_select_end__Q28JMessage10TProcessorFv, - (void*)do_select_separate__Q28JMessage10TProcessorFv, - (void*)do_resetStatus___Q28JMessage10TProcessorFPCc, - (void*)do_setBegin_isReady___Q28JMessage10TProcessorCFv, - (void*)do_begin___Q28JMessage19TRenderingProcessorFPCvPCc, - (void*)do_end___Q28JMessage19TRenderingProcessorFv, - (void*)do_tag___Q28JMessage19TRenderingProcessorFUlPCvUl, -}; - -/* 803C0AD4-803C0AE8 01DBF4 0010+04 2/2 0/0 0/0 .data __vt__19jmessage_tReference */ -SECTION_DATA extern void* __vt__19jmessage_tReference[4 + 1 /* padding */] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__19jmessage_tReferenceFv, - (void*)do_word__Q28JMessage10TReferenceCFUl, - /* padding */ - NULL, -}; - -/* 80399610-80399610 025C70 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/d_msg_scrn_talk.cpp b/src/d/d_msg_scrn_talk.cpp index 2df137b0e66..979585678eb 100644 --- a/src/d/d_msg_scrn_talk.cpp +++ b/src/d/d_msg_scrn_talk.cpp @@ -417,8 +417,7 @@ SECTION_SDATA2 static f32 lit_4278 = 4.0f / 5.0f; SECTION_SDATA2 static f32 lit_4279 = -1.0f; /* 80247E4C-802480F0 24278C 02A4+00 1/0 0/0 0/0 .text drawSelf__14dMsgScrnTalk_cFv */ -// regalloc -#ifdef NONMATCHING +// NONMATCHING - regalloc void dMsgScrnTalk_c::drawSelf() { CharInfo_c* pCharInfo; J2DGrafContext* grafContext = dComIfGp_getCurrentGrafPort(); @@ -474,11 +473,6 @@ void dMsgScrnTalk_c::drawSelf() { } mpArrow_c->draw(); } -#else -void dMsgScrnTalk_c::drawSelf() { - // NONMATCHING -} -#endif /* 802480F0-80248114 242A30 0024+00 1/0 0/0 0/0 .text arwAnimeInit__14dMsgScrnTalk_cFv */ void dMsgScrnTalk_c::arwAnimeInit() { diff --git a/src/d/d_msg_unit.cpp b/src/d/d_msg_unit.cpp index c2350428bd7..020cdbd43c1 100644 --- a/src/d/d_msg_unit.cpp +++ b/src/d/d_msg_unit.cpp @@ -71,8 +71,7 @@ SECTION_SDATA2 static f32 lit_3704[1 + 1 /* padding */] = { SECTION_SDATA2 static f64 lit_3707 = 4503601774854144.0 /* cast s32 to float */; /* 80238CEC-8023907C 23362C 0390+00 0/0 5/5 0/0 .text setTag__10dMsgUnit_cFiiPcb */ -// regalloc + mulli issue -#ifdef NONMATCHING +// NONMATCHING - regalloc + mulli issue void dMsgUnit_c::setTag(int param_1, int param_2, char* param_3, bool param_4) { *param_3 = 0; if (param_1 == 0x10000) { @@ -149,11 +148,6 @@ void dMsgUnit_c::setTag(int param_1, int param_2, char* param_3, bool param_4) { } } } -#else -void dMsgUnit_c::setTag(int param_0, int param_1, char* param_2, bool param_3) { - // NONMATCHING -} -#endif /* 804510D0-804510D8 0005D0 0004+04 1/1 5/5 0/0 .sbss g_msg_unit */ -dMsgUnit_c g_msg_unit; \ No newline at end of file +dMsgUnit_c g_msg_unit; diff --git a/src/d/d_npc_lib.cpp b/src/d/d_npc_lib.cpp index b81daee65a6..b87ca8f9eb4 100644 --- a/src/d/d_npc_lib.cpp +++ b/src/d/d_npc_lib.cpp @@ -5,6 +5,7 @@ #include "d/d_npc_lib.h" #include "dol2asm.h" +#include "SSystem/SComponent/c_math.h" // // Forward References: @@ -114,8 +115,7 @@ SECTION_SDATA2 static f64 lit_3873 = 4503601774854144.0 /* cast s32 to float */; /* 80251534-80251B60 24BE74 062C+00 0/0 0/0 2/2 .text * action__16dNpcLib_lookat_cF4cXyz4cXyzP10fopAc_ac_cPA4_fi */ -// regswap, equivalent -#ifdef NONMATCHING +// NONMATCHING - regswap, equivalent void dNpcLib_lookat_c::action(cXyz param_0, cXyz param_1, fopAc_ac_c* param_2, Mtx param_3, int param_4) { cXyz spA0; @@ -190,12 +190,6 @@ void dNpcLib_lookat_c::action(cXyz param_0, cXyz param_1, fopAc_ac_c* param_2, M field_0x64[i].z = 0; } } -#else -void dNpcLib_lookat_c::action(cXyz param_0, cXyz param_1, fopAc_ac_c* param_2, Mtx param_3, - int param_4) { - // NONMATCHING -} -#endif /* 80251B60-80251B64 24C4A0 0004+00 0/0 0/0 2/2 .text dbView__16dNpcLib_lookat_cFv */ void dNpcLib_lookat_c::dbView() {} @@ -259,4 +253,4 @@ int dNpcLib_lookat_c::limitter(s16* o_value, s16 param_1, s16 param_2, s16 param } /* 80252094-8025217C 24C9D4 00E8+00 1/0 0/0 0/0 .text __dt__16dNpcLib_lookat_cFv */ -dNpcLib_lookat_c::~dNpcLib_lookat_c() {} \ No newline at end of file +dNpcLib_lookat_c::~dNpcLib_lookat_c() {} diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index 0859c03d6cc..228ece62dc5 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -16,6 +16,7 @@ #include "d/d_com_inf_game.h" #include "dol2asm.h" #include "dolphin/gx/GXDraw.h" +#include #include "global.h" #include "m_Do/m_Do_mtx.h" @@ -209,49 +210,8 @@ void mDoExt_brkAnm::entry(J3DMaterialTable* i_matTable, f32 i_frame) { i_matTable->entryTevRegAnimator(mpAnm); } -/* ############################################################################################## */ -/* 803A3020-803A30C0 000140 0085+1B 1/1 0/0 0/0 .data l_invisibleMat$7041 */ -static u8 l_invisibleMat[133] ALIGN_DECL(32) = { - 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, - 0x00, 0x04, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFC, 0x61, 0xC1, - 0x08, 0xFF, 0xF0, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, - 0x00, 0x00, 0x17, 0x61, 0xEE, 0x00, 0x00, 0x00, 0x61, 0xEF, 0x00, 0x00, 0x00, 0x61, 0xF0, - 0x00, 0x00, 0x00, 0x61, 0xF1, 0x00, 0x00, 0x00, 0x61, 0xF2, 0x00, 0x00, 0x00, 0x61, 0x41, - 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, - 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 803A30C0-803A3160 0001E0 0084+1C 1/1 0/0 0/0 .data l_matDL */ -static u8 l_matDL[132] ALIGN_DECL(32) = { - 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, - 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x7F, 0x32, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, - 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0x28, 0x38, - 0x00, 0x00, 0x61, 0xC0, 0x28, 0xF6, 0xAF, 0x61, 0xC1, 0x08, 0xFF, 0xE0, 0x61, 0x43, 0x00, - 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x17, 0x61, 0x41, 0x00, 0x00, 0x0C, 0x61, 0xF3, 0x7F, - 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, - 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 803A3160-803A31F0 000280 008D+03 1/1 0/0 0/0 .data l_mat1DL */ -static u8 l_mat1DL[141] ALIGN_DECL(32) = { - 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xCF, 0x00, 0x10, - 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x7F, - 0x32, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0C, 0xFF, - 0xFF, 0xFF, 0xFF, 0x61, 0x28, 0x38, 0x00, 0x40, 0x61, 0xC0, 0x28, 0xFA, 0x8F, 0x61, 0xC1, 0x08, - 0xFF, 0xF0, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x17, 0x61, 0x41, 0x00, 0x00, - 0x0C, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, - 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - /* 8000D7DC-8000D8E4 00811C 0108+00 0/0 18/18 85/85 .text * init__13mDoExt_bckAnmFP15J3DAnmTransformiifssb */ -// NONMATCHING J3DMtxCalcAnimation inheritance int mDoExt_bckAnm::init(J3DAnmTransform* i_bck, int i_play, int i_attr, f32 i_rate, s16 i_startF, s16 i_endF, bool i_modify) { JUT_ASSERT(614, (i_modify || isCurrentSolidHeap()) && i_bck != 0); @@ -1150,66 +1110,77 @@ int mDoExt_McaMorf::create(J3DModelData* modelData, mDoExt_McaMorfCallBack1_c* c /* 80010074-8001037C 00A9B4 0308+00 1/0 0/0 0/0 .text calc__14mDoExt_McaMorfFv */ // NONMATCHING regalloc void mDoExt_McaMorf::calc() { - if (!mpModel) { + if (mpModel == NULL) { return; } + u16 jntNo = getJoint()->getJntNo(); j3dSys.setCurrentMtxCalc(this); - J3DTransformInfo info1; - J3DTransformInfo* infoPtr; + + Mtx sp68; + J3DTransformInfo sp48; + J3DTransformInfo sp28; + J3DTransformInfo* var_r29; if (mpTransformInfo == NULL) { - infoPtr = &info1; + var_r29 = &sp48; } else { - infoPtr = &mpTransformInfo[jntNo]; + var_r29 = &mpTransformInfo[jntNo]; } - Quaternion quat1; - Quaternion* quatPtr; + + Quaternion sp18; + Quaternion* var_r27; if (mpQuat == NULL) { - quatPtr = &quat1; + var_r27 = &sp18; } else { - quatPtr = &mpQuat[jntNo]; + var_r27 = &mpQuat[jntNo]; } - if (!mpAnm) { - *infoPtr = mpModel->getModelData()->getJointNodePointer(jntNo)->getTransformInfo(); - if (mpCallback1) { - mpCallback1->execute(jntNo, infoPtr); + + if (mpAnm == NULL) { + *var_r29 = mpModel->getModelData()->getJointNodePointer(jntNo)->getTransformInfo(); + if (mpCallback1 != NULL) { + mpCallback1->execute(jntNo, var_r29); } - JMAEulerToQuat(infoPtr->mRotation.x, infoPtr->mRotation.y, infoPtr->mRotation.z, quatPtr); - J3DMtxCalcCalcTransformMaya::calcTransform(*infoPtr); - } else if (mCurMorf >= 1.0f || !mpTransformInfo || !mpQuat) { - getTransform(jntNo, infoPtr); - if (mpCallback1) { - mpCallback1->execute(jntNo, infoPtr); + + JMAEulerToQuat(var_r29->mRotation.x, var_r29->mRotation.y, var_r29->mRotation.z, var_r27); + J3DMtxCalcCalcTransformMaya::calcTransform(*var_r29); + } else if (mCurMorf >= 1.0f || mpTransformInfo == NULL || mpQuat == NULL) { + getTransform(jntNo, var_r29); + if (mpCallback1 != NULL) { + mpCallback1->execute(jntNo, var_r29); } - JMAEulerToQuat(infoPtr->mRotation.x, infoPtr->mRotation.y, infoPtr->mRotation.z, quatPtr); - J3DMtxCalcCalcTransformMaya::calcTransform(*infoPtr); + JMAEulerToQuat(var_r29->mRotation.x, var_r29->mRotation.y, var_r29->mRotation.z, var_r27); + J3DMtxCalcCalcTransformMaya::calcTransform(*var_r29); } else { - f32 f31; + f32 var_f31; if (field_0x52) { - f31 = 1.0f; + var_f31 = 1.0f; } else { - f31 = (mCurMorf - mPrevMorf) / (1.0f - mPrevMorf); + var_f31 = (mCurMorf - mPrevMorf) / (1.0f - mPrevMorf); } - f32 f30 = 1.0f - f31; - J3DTransformInfo info2; - Quaternion quat2; - getTransform(jntNo, &info2); - if (mpCallback1) { - mpCallback1->execute(jntNo, &info2); + f32 var_f30 = 1.0f - var_f31; + + Quaternion sp8; + getTransform(jntNo, &sp28); + + if (mpCallback1 != NULL) { + mpCallback1->execute(jntNo, &sp28); } - JMAEulerToQuat(info2.mRotation.x, info2.mRotation.y, info2.mRotation.z, &quat2); - JMAQuatLerp(quatPtr, &quat2, f31, quatPtr); - Mtx mtx; - mDoMtx_quat(mtx, quatPtr); - infoPtr->mTranslate.x = infoPtr->mTranslate.x * f30 + info2.mTranslate.x * f31; - infoPtr->mTranslate.y = infoPtr->mTranslate.y * f30 + info2.mTranslate.y * f31; - infoPtr->mTranslate.z = infoPtr->mTranslate.z * f30 + info2.mTranslate.z * f31; - infoPtr->mScale.x = infoPtr->mScale.x * f30 + info2.mScale.x * f31; - infoPtr->mScale.y = infoPtr->mScale.y * f30 + info2.mScale.y * f31; - infoPtr->mScale.z = infoPtr->mScale.z * f30 + info2.mScale.z * f31; - mDoExt_setJ3DData(mtx, infoPtr, jntNo); + + JMAEulerToQuat(sp28.mRotation.x, sp28.mRotation.y, sp28.mRotation.z, &sp8); + JMAQuatLerp(var_r27, &sp8, var_f31, var_r27); + + mDoMtx_quat(sp68, var_r27); + + var_r29->mTranslate.x = var_r29->mTranslate.x * var_f30 + sp28.mTranslate.x * var_f31; + var_r29->mTranslate.y = var_r29->mTranslate.y * var_f30 + sp28.mTranslate.y * var_f31; + var_r29->mTranslate.z = var_r29->mTranslate.z * var_f30 + sp28.mTranslate.z * var_f31; + var_r29->mScale.x = var_r29->mScale.x * var_f30 + sp28.mScale.x * var_f31; + var_r29->mScale.y = var_r29->mScale.y * var_f30 + sp28.mScale.y * var_f31; + var_r29->mScale.z = var_r29->mScale.z * var_f30 + sp28.mScale.z * var_f31; + mDoExt_setJ3DData(sp68, var_r29, jntNo); } - if (mpCallback2) { + + if (mpCallback2 != NULL) { mpCallback2->execute(jntNo); } } @@ -1631,11 +1602,72 @@ mDoExt_McaMorf2::~mDoExt_McaMorf2() { /* 80011464-800116B4 00BDA4 0250+00 1/1 0/0 0/0 .text * create__15mDoExt_McaMorf2FP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformP15J3DAnmTransformifiiP10Z2CreatureUlUl */ -void mDoExt_McaMorf2::create(J3DModelData* param_0, mDoExt_McaMorfCallBack1_c* param_1, + int mDoExt_McaMorf2::create(J3DModelData* param_0, mDoExt_McaMorfCallBack1_c* param_1, mDoExt_McaMorfCallBack2_c* param_2, J3DAnmTransform* param_3, J3DAnmTransform* param_4, int param_5, f32 param_6, int param_7, int param_8, Z2Creature* param_9, u32 param_10, u32 param_11) { - // NONMATCHING + mpModel = NULL; + mpTransformInfo = NULL; + mpQuat = NULL; + mpSound = NULL; + + if (param_0 == NULL) { + return 0; + } + + if (param_0->getMaterialNodePointer(0)->getSharedDisplayListObj() != NULL && param_10 == 0) { + if (param_0->isLocked()) { + param_10 = 0x20000; + } else { + param_10 = 0x80000; + } + } + + mpModel = mDoExt_J3DModel__create(param_0, param_10, param_11); + if (mpModel == NULL) { + return 0; + } + + if (param_10 != 0x80000) { + mDoExt_changeMaterial(mpModel); + } + + mpSound = param_9; + + setAnm(param_3, param_4, 0.0f, param_5, 0.0f, param_6, param_7, param_8); + mPrevMorf = -1.0f; + + mpTransformInfo = new J3DTransformInfo[param_0->getJointNum()]; + if (mpTransformInfo == NULL) { + ERROR_EXIT(); + return 0; + } + + mpQuat = new Quaternion[param_0->getJointNum()]; + if (mpQuat == NULL) { + ERROR_EXIT(); + return 0; + } + + J3DTransformInfo* var_r29 = mpTransformInfo; + Quaternion* var_r26 = mpQuat; + J3DModelData* model_data = mpModel->getModelData(); + int sp3C = model_data->getJointNum(); + + for (int i = 0; i < sp3C; i++) { + J3DJoint* sp30 = model_data->getJointNodePointer(i); + J3DTransformInfo* sp2C = &sp30->getTransformInfo(); + + *var_r29 = *sp2C; + JMAEulerToQuat(var_r29->mRotation.x, var_r29->mRotation.y, var_r29->mRotation.z, var_r26); + + var_r29++; + var_r26++; + } + + mpCallback1 = param_1; + mpCallback2 = param_2; + return 1; } /* 800116B4-800116F4 00BFF4 0040+00 1/1 0/0 0/0 .text ERROR_EXIT__15mDoExt_McaMorf2Fv */ @@ -1654,15 +1686,217 @@ void mDoExt_McaMorf2::ERROR_EXIT() { } /* 800116F4-80011D70 00C034 067C+00 1/0 0/0 0/0 .text calc__15mDoExt_McaMorf2Fv */ +// NONMATCHING - float regswap, equivalent void mDoExt_McaMorf2::calc() { - // NONMATCHING + if (mpModel != NULL) { + u16 jnt_no = J3DMtxCalc::getJoint()->getJntNo(); + j3dSys.setCurrentMtxCalc(this); + + J3DTransformInfo spF0[2]; + Mtx spC0; + + J3DTransformInfo spA0; + J3DTransformInfo sp80; + J3DTransformInfo* var_r30; + if (mpTransformInfo == NULL) { + var_r30 = &spA0; + } else { + var_r30 = &mpTransformInfo[jnt_no]; + } + + Quaternion sp60[2]; + Quaternion sp40[2]; + + Quaternion sp30; + Quaternion sp20; + Quaternion* var_r27; + if (mpQuat == NULL) { + var_r27 = &sp30; + } else { + var_r27 = &mpQuat[jnt_no]; + } + + if (mpAnm == NULL) { + *var_r30 = mpModel->getModelData()->getJointNodePointer(jnt_no)->getTransformInfo(); + + if (mpCallback1 != NULL) { + mpCallback1->execute(jnt_no, var_r30); + } + + JMAEulerToQuat(var_r30->mRotation.x, var_r30->mRotation.y, var_r30->mRotation.z, + var_r27); + J3DMtxCalcCalcTransformMaya::calcTransform(*var_r30); + } else if (mCurMorf >= 1.0f || mpTransformInfo == NULL || mpQuat == NULL) { + mpAnm->getTransform(jnt_no, &spF0[0]); + if (field_0x40 == NULL) { + if (mpCallback1 != NULL) { + mpCallback1->execute(jnt_no, &spF0[0]); + } + + JMAEulerToQuat(spF0[0].mRotation.x, spF0[0].mRotation.y, spF0[0].mRotation.z, + var_r27); + J3DMtxCalcCalcTransformMaya::calcTransform(spF0[0]); + *var_r30 = spF0[0]; + } else { + field_0x40->getTransform(jnt_no, &spF0[1]); + + f32 sp1C; + f32 sp18; + sp18 = 1.0f - field_0x44; + sp1C = field_0x44; + + var_r30->mScale.x = spF0[0].mScale.x * sp18 + + spF0[1].mScale.x * sp1C; + var_r30->mScale.y = spF0[0].mScale.y * sp18 + + spF0[1].mScale.y * sp1C; + var_r30->mScale.z = spF0[0].mScale.z * sp18 + + spF0[1].mScale.z * sp1C; + var_r30->mTranslate.x = spF0[0].mTranslate.x * sp18 + + spF0[1].mTranslate.x * sp1C; + var_r30->mTranslate.y = spF0[0].mTranslate.y * sp18 + + spF0[1].mTranslate.y * sp1C; + var_r30->mTranslate.z = spF0[0].mTranslate.z * sp18 + + spF0[1].mTranslate.z * sp1C; + + for (int i = 0; i < 2; i++) { + JMAEulerToQuat(spF0[i].mRotation.x, spF0[i].mRotation.y, spF0[i].mRotation.z, &sp60[i]); + } + + f32 var_f29 = sp1C / (sp18 + sp1C); + + JMAQuatLerp(&sp60[0], &sp60[1], var_f29, var_r27); + mDoMtx_quat(spC0, var_r27); + mDoExt_setJ3DData(spC0, var_r30, jnt_no); + } + } else if (field_0x40 == NULL) { + f32 var_f31 = (mCurMorf - mPrevMorf) / (1.0f - mPrevMorf); + f32 var_f30 = 1.0f - var_f31; + + mpAnm->getTransform(jnt_no, &sp80); + if (mpCallback1 != NULL) { + mpCallback1->execute(jnt_no, &sp80); + } + + JMAEulerToQuat(sp80.mRotation.x, sp80.mRotation.y, sp80.mRotation.z, &sp20); + JMAQuatLerp(var_r27, &sp20, var_f31, var_r27); + mDoMtx_quat(spC0, var_r27); + + var_r30->mTranslate.x = var_r30->mTranslate.x * var_f30 + + sp80.mTranslate.x * var_f31; + var_r30->mTranslate.y = var_r30->mTranslate.y * var_f30 + + sp80.mTranslate.y * var_f31; + var_r30->mTranslate.z = var_r30->mTranslate.z * var_f30 + + sp80.mTranslate.z * var_f31; + var_r30->mScale.x = var_r30->mScale.x * var_f30 + + sp80.mScale.x * var_f31; + var_r30->mScale.y = var_r30->mScale.y * var_f30 + + sp80.mScale.y * var_f31; + var_r30->mScale.z = var_r30->mScale.z * var_f30 + + sp80.mScale.z * var_f31; + + mDoExt_setJ3DData(spC0, var_r30, jnt_no); + } else { + mpAnm->getTransform(jnt_no, &spF0[0]); + field_0x40->getTransform(jnt_no, &spF0[1]); + + f32 sp14, sp10; + sp10 = 1.0f - field_0x44; + sp14 = field_0x44; + + sp80.mScale.x = spF0[0].mScale.x * sp10 + + spF0[1].mScale.x * sp14; + sp80.mScale.y = spF0[0].mScale.y * sp10 + + spF0[1].mScale.y * sp14; + sp80.mScale.z = spF0[0].mScale.z * sp10 + + spF0[1].mScale.z * sp14; + sp80.mTranslate.x = spF0[0].mTranslate.x * sp10 + + spF0[1].mTranslate.x * sp14; + sp80.mTranslate.y = spF0[0].mTranslate.y * sp10 + + spF0[1].mTranslate.y * sp14; + sp80.mTranslate.z = spF0[0].mTranslate.z * sp10 + + spF0[1].mTranslate.z * sp14; + + for (int i = 0; i < 2; i++) { + JMAEulerToQuat(spF0[i].mRotation.x, spF0[i].mRotation.y, spF0[i].mRotation.z, &sp40[i]); + } + + f32 var_f31 = sp14 / (sp10 + sp14); + JMAQuatLerp(&sp40[0], &sp40[1], var_f31, &sp20); + + var_f31 = (mCurMorf - mPrevMorf) / (1.0f - mPrevMorf); + f32 var_f30 = 1.0f - var_f31; + JMAQuatLerp(var_r27, &sp20, var_f31, var_r27); + + var_r30->mTranslate.x = var_r30->mTranslate.x * var_f30 + + sp80.mTranslate.x * var_f31; + var_r30->mTranslate.y = var_r30->mTranslate.y * var_f30 + + sp80.mTranslate.y * var_f31; + var_r30->mTranslate.z = var_r30->mTranslate.z * var_f30 + + sp80.mTranslate.z * var_f31; + var_r30->mScale.x = var_r30->mScale.x * var_f30 + + sp80.mScale.x * var_f31; + var_r30->mScale.y = var_r30->mScale.y * var_f30 + + sp80.mScale.y * var_f31; + var_r30->mScale.z = var_r30->mScale.z * var_f30 + + sp80.mScale.z * var_f31; + + mDoMtx_quat(spC0, var_r27); + mDoExt_setJ3DData(spC0, var_r30, jnt_no); + } + + if (mpCallback2 != NULL) { + mpCallback2->execute(jnt_no); + } + } } /* 80011D70-80011FCC 00C6B0 025C+00 1/1 0/0 2/2 .text * setAnm__15mDoExt_McaMorf2FP15J3DAnmTransformP15J3DAnmTransformfiffff */ void mDoExt_McaMorf2::setAnm(J3DAnmTransform* param_0, J3DAnmTransform* param_1, f32 param_2, - int param_3, f32 param_4, f32 param_5, f32 param_6, f32 param_7) { - // NONMATCHING + int i_attr, f32 i_morf, f32 i_speed, f32 i_start, f32 i_end) { + mpAnm = param_0; + field_0x40 = param_1; + field_0x44 = param_2; + + setStartFrame(i_start); + + if (i_end < 0.0f) { + if (mpAnm == NULL) { + mFrameCtrl.init(0); + } else { + mFrameCtrl.init(mpAnm->getFrameMax()); + } + } else { + mFrameCtrl.init(i_end); + } + + if (i_attr < 0) { + i_attr = param_0->getAttribute(); + } + + setPlayMode(i_attr); + setPlaySpeed(i_speed); + + if (i_speed >= 0.0f) { + setFrame(i_start); + } else { + setFrame(mFrameCtrl.getEnd()); + } + + setLoopFrame(getFrame()); + setMorf(i_morf); + + if (mpSound != NULL) { + if (param_2 < 0.5f) { + mpBas = ((mDoExt_transAnmBas*)param_0)->getBas(); + } else { + mpBas = ((mDoExt_transAnmBas*)param_1)->getBas(); + } + + if (mpBas != NULL) { + mpSound->initAnime(mpBas, getPlaySpeed() >= 0.0f, getLoopFrame(), getFrame()); + } + } } /* 80011FCC-800120A0 00C90C 00D4+00 0/0 0/0 2/2 .text setAnmRate__15mDoExt_McaMorf2Ff */ @@ -1735,26 +1969,187 @@ void mDoExt_McaMorf2::stopZelAnime() { } /* 80012220-800123D0 00CB60 01B0+00 1/0 0/0 0/0 .text draw__19mDoExt_invJntPacketFv */ -// void mDoExt_invJntPacket::draw() { -extern "C" void draw__19mDoExt_invJntPacketFv() { - // NONMATCHING +void mDoExt_invJntPacket::draw() { + J3DShape::resetVcdVatCache(); + + if (field_0x16) { + J3DModelData* sp20 = field_0x10->getModelData(); + J3DJoint* sp1C = sp20->getJointNodePointer(field_0x14); + + for (J3DMaterial* mesh = sp1C->getMesh(); mesh != NULL; mesh = mesh->getNext()) { + mesh->load(); + J3DMatPacket* sp18 = field_0x10->getMatPacket(mesh->getIndex()); + sp18->callDL(); + GFSetZMode(1, GX_LEQUAL, 1); + GFSetBlendModeEtc(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_CLEAR, 0, 0, 1); + + J3DShapePacket* shapePkt = sp18->getShapePacket(); + JUT_ASSERT(0x1393, shapePkt != 0); + shapePkt->getShape()->loadPreDrawSetting(); + + do { + if (!shapePkt->getShape()->checkFlag(1)) { + if (shapePkt->getDisplayListObj() != NULL) { + shapePkt->getDisplayListObj()->callDL(); + } + + shapePkt->drawFast(); + } + + shapePkt = (J3DShapePacket*)shapePkt->getNextPacket(); + } while (shapePkt != NULL); + } + } else { + static u8 l_invisibleMat[] ALIGN_DECL(32) = { + 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, + 0x00, 0x04, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFC, 0x61, 0xC1, + 0x08, 0xFF, 0xF0, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, + 0x00, 0x00, 0x17, 0x61, 0xEE, 0x00, 0x00, 0x00, 0x61, 0xEF, 0x00, 0x00, 0x00, 0x61, 0xF0, + 0x00, 0x00, 0x00, 0x61, 0xF1, 0x00, 0x00, 0x00, 0x61, 0xF2, 0x00, 0x00, 0x00, 0x61, 0x41, + 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + GXCallDisplayList(l_invisibleMat, 0x80); + + J3DModelData* sp14 = field_0x10->getModelData(); + J3DJoint* sp10 = sp14->getJointNodePointer(field_0x14); + J3DMaterial* mesh = sp10->getMesh(); + + sp14->getShapeNodePointer(0)->loadPreDrawSetting(); + + for (; mesh != NULL; mesh = mesh->getNext()) { + J3DShape* spC = mesh->getShape(); + if (!spC->checkFlag(1)) { + J3DShapePacket* shapePkt = field_0x10->getShapePacket(spC->getIndex()); + shapePkt->drawFast(); + } + } + } + + J3DShape::resetVcdVatCache(); + GFSetBlendModeEtc(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_CLEAR, 1, 0, 1); } /* 800123D0-800125DC 00CD10 020C+00 2/2 0/0 0/0 .text init__15mDoExt_3Dline_cFUsii */ -void mDoExt_3Dline_c::init(u16 param_0, int param_1, int param_2) { - // NONMATCHING +// NONMATCHING - regalloc, probably some types are wrong +int mDoExt_3Dline_c::init(u16 param_0, int param_1, int param_2) { + field_0x0 = new cXyz[param_0]; + if (field_0x0 == NULL) { + return 0; + } + + if (param_1 != 0) { + field_0x4 = new f32[param_1]; + if (field_0x4 == NULL) { + return 0; + } + } else { + field_0x4 = NULL; + } + + int sp20 = param_0 * 2; + + field_0x8 = new cXyz[sp20]; + if (field_0x8 == NULL) { + return 0; + } + + field_0xc = new cXyz[sp20]; + if (field_0xc == NULL) { + return 0; + } + + field_0x10 = new u8[param_0 * 3]; + if (field_0x10 == NULL) { + return 0; + } + + field_0x14 = new u8[param_0 * 3]; + if (field_0x14 == NULL) { + return 0; + } + + if (param_2 != 0) { + field_0x18 = new f32[sp20]; + if (field_0x18 == NULL) { + return 0; + } + + field_0x1c = new f32[sp20]; + if (field_0x1c == NULL) { + return 0; + } + + f32* var_r28 = field_0x18; + f32* var_r27 = field_0x1c; + for (int i = 0; i < param_0; i++) { + var_r28[0] = 0.0f; + var_r27[0] = 0.0f; + + var_r28[2] = 1.0f; + var_r27[2] = 1.0f; + + var_r28 += 4; + var_r27 += 4; + } + } + + return 1; } /* 800125E0-800126BC 00CF20 00DC+00 0/0 0/0 12/12 .text init__19mDoExt_3DlineMat0_cFUsUsi */ int mDoExt_3DlineMat0_c::init(u16 param_0, u16 param_1, int param_2) { - // NONMATCHING + field_0x10 = param_0; + field_0x12 = param_1; + + field_0x18 = new mDoExt_3Dline_c[param_0]; + if (field_0x18 == NULL) { + return 0; + } + + for (int i = 0; i < param_0; i++) { + if (!field_0x18[i].init(param_1, param_2, 0)) { + return 0; + } + } + + field_0x4 = NULL; + field_0x16 = 0; + return 1; } /* 800126BC-800126C0 00CFFC 0004+00 2/2 0/0 0/0 .text __ct__15mDoExt_3Dline_cFv */ -mDoExt_3Dline_c::mDoExt_3Dline_c() { - /* empty function */ -} +mDoExt_3Dline_c::mDoExt_3Dline_c() {} + +/* 803A30C0-803A3160 0001E0 0084+1C 1/1 0/0 0/0 .data l_matDL */ +static u8 l_matDL[132] ALIGN_DECL(32) = { + 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, + 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x7F, 0x32, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, + 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0x28, 0x38, + 0x00, 0x00, 0x61, 0xC0, 0x28, 0xF6, 0xAF, 0x61, 0xC1, 0x08, 0xFF, 0xE0, 0x61, 0x43, 0x00, + 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x17, 0x61, 0x41, 0x00, 0x00, 0x0C, 0x61, 0xF3, 0x7F, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, + 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +/* 803A3160-803A31F0 000280 008D+03 1/1 0/0 0/0 .data l_mat1DL */ +static u8 l_mat1DL[141] ALIGN_DECL(32) = { + 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xCF, 0x00, 0x10, + 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x7F, + 0x32, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0C, 0xFF, + 0xFF, 0xFF, 0xFF, 0x61, 0x28, 0x38, 0x00, 0x40, 0x61, 0xC0, 0x28, 0xFA, 0x8F, 0x61, 0xC1, 0x08, + 0xFF, 0xF0, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x17, 0x61, 0x41, 0x00, 0x00, + 0x0C, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, + 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; /* 800126C0-80012774 00D000 00B4+00 1/0 0/0 0/0 .text setMaterial__19mDoExt_3DlineMat0_cFv */ void mDoExt_3DlineMat0_c::setMaterial() { @@ -1773,21 +2168,151 @@ void mDoExt_3DlineMat0_c::setMaterial() { } /* 80012774-80012874 00D0B4 0100+00 1/0 0/0 0/0 .text draw__19mDoExt_3DlineMat0_cFv */ +// NONMATCHING - issues with the iterators void mDoExt_3DlineMat0_c::draw() { - // NONMATCHING + GXSetTevColor(GX_TEVREG2, field_0x8); + + if (field_0xc != NULL) { + dKy_Global_amb_set(field_0xc); + } + + mDoExt_3Dline_c* var_r28 = field_0x18; + int var_r26 = (field_0x14 & 0x7FFF) << 1; + + for (int i = 0; i < field_0x10; i++) { + GXSetArray(GX_VA_POS, var_r28[field_0x16].field_0x8, sizeof(cXyz)); + GXSetArray(GX_VA_NRM, var_r28[field_0x16].field_0x10, 3); + + GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, var_r26); + for (u16 j = 0; j < (u16)var_r26;) { + GXPosition1x16(j); + GXNormal1x16(j); + j++; + + GXPosition1x16(j); + GXNormal1x16(j); + j++; + } + GXEnd(); + var_r28++; + } + + field_0x16 ^= 1; } /* 80012874-80012E3C 00D1B4 05C8+00 0/0 0/0 2/2 .text * update__19mDoExt_3DlineMat0_cFifR8_GXColorUsP12dKy_tevstr_c */ -void mDoExt_3DlineMat0_c::update(int param_0, f32 param_1, _GXColor& param_2, u16 param_3, +void mDoExt_3DlineMat0_c::update(int param_0, f32 param_1, GXColor& param_2, u16 param_3, dKy_tevstr_c* param_4) { // NONMATCHING } /* 80012E3C-80013360 00D77C 0524+00 0/0 0/0 9/9 .text * update__19mDoExt_3DlineMat0_cFiR8_GXColorP12dKy_tevstr_c */ -void mDoExt_3DlineMat0_c::update(int param_0, _GXColor& param_1, dKy_tevstr_c* param_2) { - // NONMATCHING +// NONMATCHING +void mDoExt_3DlineMat0_c::update(int param_0, GXColor& param_1, dKy_tevstr_c* param_2) { + field_0x8 = param_1; + field_0xc = param_2; + + if (param_0 < 0) { + field_0x14 = field_0x12; + } else if (param_0 > field_0x12) { + field_0x14 = field_0x12; + } else { + field_0x14 = param_0; + } + + view_class* view_p = dComIfGd_getView(); + mDoExt_3Dline_c* sp30 = field_0x18; + int sp2C = field_0x14 * 2; + int sp28 = field_0x14 * 12; + + cXyz sp134; + cXyz sp128; + cXyz sp11C; + cXyz sp110; + + for (int i = 0; i < field_0x10; i++) { + cXyz* pos_p = sp30->field_0x0; + f32* size_p = sp30->field_0x4; + JUT_ASSERT(0x1545, size_p != 0); + + cXyz* sp20 = &sp30->field_0x8[field_0x16]; + cXyz* sp24 = sp20; + + u8* sp1C = &sp30->field_0x10[field_0x16]; + + u8* var_r30 = sp1C; + u8* var_r29 = var_r30 + 3; + + sp128 = pos_p[1] - pos_p[0]; + sp134 = pos_p[0] - view_p->lookat.eye; + sp128 = sp128.outprod(sp134); + sp128.normalizeZP(); + + var_r30[0] = sp128.x * 64.0f; + var_r30[1] = sp128.y * 64.0f; + var_r30[2] = sp128.z * 64.0f; + var_r29[0] = -sp1C[0]; + var_r29[1] = -sp1C[1]; + var_r29[2] = -sp1C[2]; + + sp128 *= *size_p; + sp20[0] = pos_p[0] + sp128; + sp20[1] = pos_p[0] - sp128; + + pos_p++; + + sp11C = pos_p[0] + sp128; + sp110 = pos_p[0] - sp128; + + for (int sp10 = field_0x14 - 2; sp10 > 0; sp10--) { + sp128 = pos_p[1] - pos_p[0]; + sp134 = pos_p[0] - view_p->lookat.eye; + sp128 = sp128.outprod(sp134); + sp128.normalizeZP(); + + var_r30 += 6; + var_r29 += 6; + + var_r30[0] = sp128.x * 64.0f; + var_r30[1] = sp128.y * 64.0f; + var_r30[2] = sp128.z * 64.0f; + var_r29[0] = -sp1C[0]; + var_r29[1] = -sp1C[1]; + var_r29[2] = -sp1C[2]; + + sp128 *= *size_p; + sp11C += pos_p[0] + sp128; + sp110 += pos_p[0] - sp128; + *sp24 = sp11C * 0.5f; + *sp20 = sp110 * 0.5f; + + pos_p++; + + sp11C = pos_p[0] + sp128; + sp110 = pos_p[0] - sp128; + } + + var_r29 += 3; + + var_r29[0] = var_r30[0]; + var_r29[1] = var_r30[1]; + var_r29[2] = var_r30[2]; + + var_r30 += 3; + var_r29 += 3; + + var_r29[0] = var_r30[0]; + var_r29[1] = var_r30[1]; + var_r29[2] = var_r30[2]; + + *sp24 = sp11C; + *sp20 = sp110; + + DCStoreRangeNoSync(sp20, sp2C); + DCStoreRangeNoSync(sp1C, sp28); + } } /* 80013360-800134F8 00DCA0 0198+00 0/0 0/0 19/19 .text init__19mDoExt_3DlineMat1_cFUsUsP7ResTIMGi @@ -1849,6 +2374,7 @@ void mDoExt_3DlineMatSortPacket::draw() { J3DShape::resetVcdVatCache(); } +#ifdef DEBUG void drawCube(MtxP mtx, cXyz* pos, const GXColor& color) { GXSetArray(GX_VA_POS, pos, sizeof(cXyz)); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); @@ -1940,6 +2466,7 @@ void mDoExt_cylinderPacket::draw() { GXSetCurrentMtx(0); GXDrawCylinder(8); } +#endif /* 80014804-8001494C 00F144 0148+00 3/3 0/0 0/0 .text * mDoExt_initFontCommon__FPP7JUTFontPP7ResFONTP7JKRHeapPCcP10JKRArchiveUcUlUl */