From 23cba4d117cc34f4fafce838eed8cef103fce79c Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Wed, 18 Jun 2025 01:11:53 -0400 Subject: [PATCH] getDemoIDData matched, fix up various inlines and template classes (#2489) * Fix debug build * getDemoIDData matched, fix up various inlines and template classes * Remove nonmatching comments --- config/GZ2E01/symbols.txt | 3 +- config/ShieldD/symbols.txt | 4 +- include/JSystem/JGadget/binary.h | 100 +++++++++++++----- include/JSystem/JStudio/JStudio/object-id.h | 2 +- .../JSystem/JStudio/JStudio/stb-data-parse.h | 13 ++- include/JSystem/JStudio/JStudio/stb.h | 45 +++++--- include/JSystem/JUtility/JUTFader.h | 2 +- include/JSystem/JUtility/TColor.h | 5 +- include/d/actor/d_a_obj_gra2.h | 4 + include/d/d_s_logo.h | 2 +- include/m_Do/m_Do_graphic.h | 4 +- src/JSystem/JMessage/processor.cpp | 18 ++-- .../JStudio/JStudio/stb-data-parse.cpp | 59 ++++++----- src/d/actor/d_a_alink_demo.inc | 1 - src/d/actor/d_a_e_gb.cpp | 2 +- src/d/actor/d_a_obj_flag3.cpp | 6 +- src/d/actor/d_a_title.cpp | 3 + src/d/d_demo.cpp | 1 - src/d/d_s_logo.cpp | 7 +- 19 files changed, 178 insertions(+), 103 deletions(-) diff --git a/config/GZ2E01/symbols.txt b/config/GZ2E01/symbols.txt index 68f6f957ea8..1dfe59bc329 100644 --- a/config/GZ2E01/symbols.txt +++ b/config/GZ2E01/symbols.txt @@ -21909,7 +21909,8 @@ struct_80450FB0 = .sbss:0x80450FB0; // type:object size:0x1 scope:global align:8 lbl_80450FB1 = .sbss:0x80450FB1; // type:object size:0x1 data:byte lbl_80450FB2 = .sbss:0x80450FB2; // type:object size:0x1 data:byte struct_80450FB8 = .sbss:0x80450FB8; // type:object size:0x4 scope:global align:4 data:byte -struct_80450FBC = .sbss:0x80450FBC; // type:object size:0x4 scope:global align:4 data:byte +init$33110 = .sbss:0x80450FBC; // type:object size:0x1 scope:local align:1 data:byte +init$33113 = .sbss:0x80450FBD; // type:object size:0x1 scope:local align:1 data:byte it$36766 = .sbss:0x80450FC0; // type:object size:0x4 scope:local align:4 data:4byte struct_80450FC4 = .sbss:0x80450FC4; // type:object size:0x4 scope:local align:4 data:byte m_eye_move_flg = .sbss:0x80450FC8; // type:object size:0x1 scope:local align:1 data:byte diff --git a/config/ShieldD/symbols.txt b/config/ShieldD/symbols.txt index 699be01b245..e4719ce5627 100644 --- a/config/ShieldD/symbols.txt +++ b/config/ShieldD/symbols.txt @@ -64483,8 +64483,8 @@ lbl_8074C890 = .sbss:0x8074C890; // type:object size:0x1 data:byte hash:0xB74E39 lbl_8074C891 = .sbss:0x8074C891; // type:object size:0x1 data:byte hash:0xC3C1301D dhash:0xBD2F6E4C lbl_8074C892 = .sbss:0x8074C892; // type:object size:0x1 data:byte hash:0xC3C1345F dhash:0xBD2F6E4C lbl_8074C893 = .sbss:0x8074C893; // type:object size:0x1 data:byte hash:0xC3C1491D dhash:0xBD2F6E4C -lbl_8074C894 = .sbss:0x8074C894; // type:object size:0x1 data:byte hash:0x2C9C4113 dhash:0xC335850F -lbl_8074C895 = .sbss:0x8074C895; // type:object size:0x1 data:byte hash:0xABFECE16 dhash:0xC335850F +@GUARD@daAlink_c_getDemoIDData__FP13dDemo_actor_cPiPiPiPUsPiPi@dummy = .sbss:0x8074C894; // type:object size:0x1 data:byte hash:0x2C9C4113 dhash:0xC335850F +@GUARD@daAlink_c_getDemoIDData__FP13dDemo_actor_cPiPiPiPUsPiPi@it@0 = .sbss:0x8074C895; // type:object size:0x1 data:byte hash:0xABFECE16 dhash:0xC335850F @LOCAL@daAlink_c_getDemoIDData__FP13dDemo_actor_cPiPiPiPUsPiPi@it@0 = .sbss:0x8074C898; // type:object size:0x4 scope:local hash:0x7C41017E dhash:0x7A3314A7 lbl_8074C89C = .sbss:0x8074C89C; // type:object size:0x1 data:byte hash:0x91B5CF4E dhash:0x3C2D8E6B lbl_8074C89D = .sbss:0x8074C89D; // type:object size:0x1 data:byte hash:0x1F6B40C0 dhash:0x3C2D8E6B diff --git a/include/JSystem/JGadget/binary.h b/include/JSystem/JGadget/binary.h index 71be3ed5530..24f7c96085e 100644 --- a/include/JSystem/JGadget/binary.h +++ b/include/JSystem/JGadget/binary.h @@ -2,6 +2,7 @@ #define BINARY_H #include "dolphin/types.h" +#include "JSystem/JGadget/search.h" namespace JGadget { namespace binary { @@ -26,11 +27,11 @@ struct TParseData { /* 0x0 */ const void* raw; }; -template +template struct TParseData_aligned : public TParseData { TParseData_aligned(const void* pContent) : TParseData(pContent) {} void setRaw(const void* p) { - /* if ((u32)p % T != 0) { + /* if ((u32)p % S != 0) { JUTWarn w; w << "misaligned : " << (u32)p; } */ @@ -63,41 +64,56 @@ struct TParse_header_block { template struct TParseValue_raw_ { typedef T ParseType; - static T parse(const void* data) { return *(T*)data; } + static T parse(const void* data) { return (T)*(T*)data; } +}; + +template +struct TParseValue_raw : public TParseValue_raw_ { + typedef TParseValue_raw_ InnerParseValueClass; }; template struct TParseValue_endian_big_ : public TParseValue_raw_ { - static T parse(const void* data) { return TParseValue_raw_::parse(data); } + static T parse(const void* data) { return TParseValue_raw_::parse(data); } }; -template class Parser> -struct TParseValue : public Parser { - static T parse(const void* data) { return Parser::parse(data); } +template +struct TParseValue : public Parser { + static typename Parser::ParseType parse(const void* data) { return Parser::parse(data); } - static T parse(const void* data, s32 advanceNum) { - return Parser::parse(advance(data, advanceNum)); + static typename Parser::ParseType parse(const void* data, s32 advanceNum) { + return Parser::parse(advance(data, advanceNum)); } static const void* advance(const void* data, s32 advanceNum) { - return (char*)data + (advanceNum * sizeof(T)); + return (char*)data + (advanceNum * sizeof(Parser::ParseType)); } }; template -struct TValueIterator { +struct TValueIterator + : public JGadget::TIterator< + std::random_access_iterator_tag, + typename Parser::ParseType, + ptrdiff_t, + typename Parser::ParseType*, + typename Parser::ParseType& + > + { + typedef typename Parser::ParseType ValueType; + TValueIterator(const void* begin) { - mBegin = begin; + mBegin = reinterpret_cast(begin); } const void* get() const { return mBegin; } typename Parser::ParseType operator*() const { - return Parser::parse(get()); + return TParseValue::parse(get()); } TValueIterator& operator++() { - const_cast(mBegin)++; + mBegin += size; return *this; } @@ -107,32 +123,68 @@ struct TValueIterator { return old; } - TValueIterator& operator+=(s32 v) { - const_cast(mBegin) += v; + TValueIterator& operator+=(s32 n) { + mBegin += size * n; return *this; } - const void* mBegin; + TValueIterator& operator--() { + mBegin -= size; + return *this; + } + + char const* mBegin; }; template -struct TValueIterator_raw : public TValueIterator, 1> { - TValueIterator_raw(const void* begin) : TValueIterator, 1>(begin) {} +struct TValueIterator_raw : public TValueIterator, sizeof(T)> { + TValueIterator_raw(const void* begin) : TValueIterator, sizeof(T)>(begin) {} + + friend bool operator==(TValueIterator, sizeof(T)> a, TValueIterator, sizeof(T)> b) { + return a.mBegin == b.mBegin; + } + + friend bool operator!=(TValueIterator, sizeof(T)> a, TValueIterator, sizeof(T)> b) { + return !operator==(a, b); + } + + friend TValueIterator, sizeof(T)> operator+(TValueIterator, sizeof(T)> a, s32 b) { + TValueIterator, sizeof(T)> it = a; + it += b; + return it; + } }; template -struct TParseValue_misaligned : TParseValue_raw_ { - static T parse(const void* data) { return TParseValue_raw_::parse(data); } +struct TParseValue_misaligned_ : public TParseValue_raw_ { + typedef T ParseType; + static T parse(const void* data) { return TParseValue_raw_::parse(data); } +}; + +template +struct TParseValue_misaligned : public TParseValue_raw_ { + typedef TParseValue_misaligned_ InnerParseValueClass; }; template struct TValueIterator_misaligned : public TValueIterator, sizeof(T)> { TValueIterator_misaligned(const void* begin) : TValueIterator, sizeof(T)>(begin) {} + + friend bool operator==(TValueIterator, sizeof(T)> a, TValueIterator, sizeof(T)> b) { + return a.mBegin == b.mBegin; + } + + friend bool operator!=(TValueIterator, sizeof(T)> a, TValueIterator, sizeof(T)> b) { + return !operator==(a, b); + } + + friend TValueIterator, sizeof(T)> operator+(TValueIterator, sizeof(T)> a, s32 b) { + TValueIterator, sizeof(T)> it(a); + it += b; + return it; + } }; - -inline bool operator==(TValueIterator, 4> a, TValueIterator, 4> b) { return a.mBegin == b.mBegin; } - } // namespace binary } // namespace JGadget diff --git a/include/JSystem/JStudio/JStudio/object-id.h b/include/JSystem/JStudio/JStudio/object-id.h index bd8ebf7234b..cd05ef494b4 100644 --- a/include/JSystem/JStudio/JStudio/object-id.h +++ b/include/JSystem/JStudio/JStudio/object-id.h @@ -28,7 +28,7 @@ struct TObject_ID : public TIDData { struct TPRObject_ID_equal : public TIDData { TPRObject_ID_equal(const void* id, u32 id_size) : TIDData(id, id_size) {} - TPRObject_ID_equal(const TPRObject_ID_equal& other) : TIDData(other.mID, other.mID_size) {} + ~TPRObject_ID_equal() {} bool operator()(TObject_ID const& id) const { return TIDData::isEqual(id.getIDData(), *this); } }; diff --git a/include/JSystem/JStudio/JStudio/stb-data-parse.h b/include/JSystem/JStudio/JStudio/stb-data-parse.h index f8c5bd470fa..57ba3378d8d 100644 --- a/include/JSystem/JStudio/JStudio/stb-data-parse.h +++ b/include/JSystem/JStudio/JStudio/stb-data-parse.h @@ -65,16 +65,16 @@ public: /* 80289A08 */ void getData(TData*) const; }; -struct TParse_TParagraph_data : public TParseData_aligned<4> { +struct TParse_TParagraph_data : public TParseData { struct TData { /* 0x00 */ u8 status; - /* 0x04 */ u32 dataSize; - /* 0x08 */ u32 _8; - /* 0x0C */ const void* fileCount; - /* 0x10 */ const void* _10; + /* 0x04 */ u32 entrySize; + /* 0x08 */ u32 entryCount; + /* 0x0C */ const void* content; + /* 0x10 */ const void* next; }; - TParse_TParagraph_data(const void* content) : TParseData_aligned<4>(content) {} + TParse_TParagraph_data(const void* content) : TParseData(content) {} /* 80289A80 */ void getData(TData* pData) const; }; @@ -90,7 +90,6 @@ public: u16 get_flag() const { return get()->flag; } u16 get_IDSize() const { return get()->id_size; } - u32 get_type() const { return get()->type; } const void* get_ID() const { return get()->id; } }; diff --git a/include/JSystem/JStudio/JStudio/stb.h b/include/JSystem/JStudio/JStudio/stb.h index 6582961688b..eae49fecedb 100644 --- a/include/JSystem/JStudio/JStudio/stb.h +++ b/include/JSystem/JStudio/JStudio/stb.h @@ -7,7 +7,7 @@ #include "dolphin/os.h" namespace JStudio { -struct TObject; +class TObject; namespace stb { class TControl; @@ -156,11 +156,10 @@ private: /* 0x54 */ s32 _54; }; -template +template struct TParseData : public data::TParse_TParagraph_data::TData { TParseData(const void* pContent) { - data::TParse_TParagraph_data data(pContent); - set(data); + set(data::TParse_TParagraph_data(pContent)); } TParseData() { @@ -171,45 +170,57 @@ struct TParseData : public data::TParse_TParagraph_data::TData { data.getData(this); } + void set(const void* pContent) { + set(data::TParse_TParagraph_data(pContent)); + } + bool isEnd() const { return status == 0; } bool empty() const { - return fileCount == NULL; + return content == NULL; } bool isValid() const { - return !empty() && status == 50; + return !empty() && status == S; } - const void* getContent() const { return fileCount; } + const void* getContent() const { return content; } - u32 size() const { return dataSize; } + u32 size() const { return entryCount; } }; -template > -struct TParseData_fixed : public TParseData { - TParseData_fixed(const void* pContent) : TParseData(pContent) {} - TParseData_fixed() : TParseData() {} +template > +struct TParseData_fixed : public TParseData { + TParseData_fixed(const void* pContent) : TParseData(pContent) {} + TParseData_fixed() : TParseData() {} const void* getNext() const { - return _10; + return this->next; } bool isValid() const { - return TParseData::isValid() && getNext() != NULL; + return TParseData::isValid() && getNext() != NULL; } Iterator begin() const { - return Iterator(fileCount); + return Iterator(this->content); } Iterator end() const { - Iterator i(fileCount); - i += size(); + Iterator i(this->content); + i += this->size(); return i; } + + typename Iterator::ValueType front() const { + return *begin(); + } + + typename Iterator::ValueType back() const { + return *--end(); + } }; struct TParseData_string : public TParseData<0x60> { diff --git a/include/JSystem/JUtility/JUTFader.h b/include/JSystem/JUtility/JUTFader.h index 7c308269a7b..f6d67ac03b0 100644 --- a/include/JSystem/JUtility/JUTFader.h +++ b/include/JSystem/JUtility/JUTFader.h @@ -25,7 +25,7 @@ public: /* 802E56DC */ virtual void draw(); s32 getStatus() const { return mStatus; } - void setColor(JUtility::TColor& color) { mColor.set(color); } + void setColor(JUtility::TColor color) { mColor.set(color); } /* 0x04 */ s32 mStatus; /* 0x08 */ u16 field_0x8; diff --git a/include/JSystem/JUtility/TColor.h b/include/JSystem/JUtility/TColor.h index 2691dff5366..0f2a684289f 100644 --- a/include/JSystem/JUtility/TColor.h +++ b/include/JSystem/JUtility/TColor.h @@ -28,7 +28,10 @@ struct TColor : public GXColor { } void set(u32 u32Color) { *(u32*)&r = u32Color; } - void set(GXColor gxColor) { *(GXColor*)&r = gxColor; } + void set(GXColor gxColor) { + GXColor* temp = this; + *temp = gxColor; + } }; } // namespace JUtility diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 5ae38ef7f7a..e289db8b3b5 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -86,6 +86,10 @@ public: typedef int (daObj_GrA_c::*MotionFunc)(int); typedef int (daObj_GrA_c::*Process)(void*); + enum { + NUMLOOKMODES_e = 4, + }; + class daObj_GrA_prtclMngr_c { public: /* 80C04E14 */ ~daObj_GrA_prtclMngr_c() {} diff --git a/include/d/d_s_logo.h b/include/d/d_s_logo.h index a199866e9f3..6a796c14e5b 100644 --- a/include/d/d_s_logo.h +++ b/include/d/d_s_logo.h @@ -95,7 +95,7 @@ public: /* 0x212 */ u16 field_0x212; /* 0x214 */ u16 field_0x214; /* 0x218 */ u32 field_0x218; - /* 0x21C */ void* buffer; + /* 0x21C */ void* dummyGameAlloc; /* 0x220 */ mDoDvdThd_mountXArchive_c* mpField0Command; /* 0x224 */ mDoDvdThd_mountXArchive_c* mpAlAnmCommand; /* 0x228 */ u8 field_0x228[4]; diff --git a/include/m_Do/m_Do_graphic.h b/include/m_Do/m_Do_graphic.h index e146e6db81a..ad330df0101 100644 --- a/include/m_Do/m_Do_graphic.h +++ b/include/m_Do/m_Do_graphic.h @@ -4,8 +4,6 @@ #include "JSystem/JFramework/JFWDisplay.h" #include "dolphin/mtx.h" -class JUTFader; - int mDoGph_Create(); void mDoGph_drawFilterQuad(s8 param_0, s8 param_1); @@ -61,7 +59,7 @@ public: static int startFadeOut(int param_0) { return JFWDisplay::getManager()->startFadeOut(param_0); } static int startFadeIn(int param_0) { return JFWDisplay::getManager()->startFadeIn(param_0); } - static void setFadeColor(JUtility::TColor color) { mFader->mColor.set(color); } + static void setFadeColor(JUtility::TColor& color) { mFader->setColor(color); } static void setClearColor(JUtility::TColor color) { JFWDisplay::getManager()->setClearColor(color); } static void setBackColor(GXColor& color) { mBackColor = color; } static void endFrame() { JFWDisplay::getManager()->endFrame(); } diff --git a/src/JSystem/JMessage/processor.cpp b/src/JSystem/JMessage/processor.cpp index a59b2d277dc..77ecc72bb5a 100644 --- a/src/JSystem/JMessage/processor.cpp +++ b/src/JSystem/JMessage/processor.cpp @@ -216,11 +216,11 @@ void JMessage::TProcessor::do_tag_(u32 uTag, void const* pData, u32 uSize) { switch (uCode & 0xFFFF) { case 4: JUT_ASSERT(331, uSize==4); - stack_pushCurrent(on_word(JGadget::binary::TParseValue::parse(pData))); + stack_pushCurrent(on_word(JGadget::binary::TParseValue >::parse(pData))); break; case 5: JUT_ASSERT(341, uSize==4); - stack_pushCurrent(on_message(JGadget::binary::TParseValue::parse(pData))); + stack_pushCurrent(on_message(JGadget::binary::TParseValue >::parse(pData))); break; default: JGADGET_WARNMSG1(351, "unknown system-tag-code : ", uCode & 0xFFFF); @@ -315,7 +315,7 @@ const char* JMessage::TProcessor::process_onSelect_limited_(JMessage::TProcessor JUT_ASSERT(457, rData.uRest>0); u16* puOffset = (u16*)rData.pOffset; - u16 uData = JGadget::binary::TParseValue::parse(puOffset); + u16 uData = JGadget::binary::TParseValue >::parse(puOffset); rData.pOffset = (void*)(puOffset + 1); return &rData.pcBase[uData]; @@ -331,7 +331,7 @@ const char* JMessage::TProcessor::process_onSelect_(JMessage::TProcessor* pThis) JUT_ASSERT(474, rData.uRest>0); u32* puOffset = (u32*)rData.pOffset; - u32 uData = JGadget::binary::TParseValue::parse(puOffset); + u32 uData = JGadget::binary::TParseValue >::parse(puOffset); rData.pOffset = (void*)(puOffset + 1); return &rData.pcBase[uData]; @@ -574,7 +574,7 @@ void JMessage::TSequenceProcessor::do_tag_(u32 uTag, void const* pData, u32 uSiz break; case 6: { JUT_ASSERT(807, uSize==4); - u32 u32Target = JGadget::binary::TParseValue::parse(pData); + u32 u32Target = JGadget::binary::TParseValue >::parse(pData); on_jump_register(process_onJump_, u32Target); break; } @@ -610,7 +610,7 @@ void JMessage::TSequenceProcessor::do_tag_(u32 uTag, void const* pData, u32 uSiz } case 0xF8: { u16* pu16Data = (u16*)pData; - u32 uNumber = JGadget::binary::TParseValue::parse(pu16Data); + u32 uNumber = JGadget::binary::TParseValue >::parse(pu16Data); JUT_ASSERT(859, uSize==2+2*uNumber); on_branch_register(process_onBranch_limited_, pu16Data + 1, uNumber); on_branch_query(uCode & 0xFFFF); @@ -618,7 +618,7 @@ void JMessage::TSequenceProcessor::do_tag_(u32 uTag, void const* pData, u32 uSiz } case 0xF7: { u16* pu16Data = (u16*)pData; - u32 uNumber = JGadget::binary::TParseValue::parse(pu16Data); + u32 uNumber = JGadget::binary::TParseValue >::parse(pu16Data); JUT_ASSERT(871, uSize==2+4*uNumber); on_branch_register(process_onBranch_, pu16Data + 1, uNumber); on_branch_query(uCode & 0xFFFF); @@ -689,7 +689,7 @@ JMessage::TSequenceProcessor::process_onBranch_limited_(JMessage::TSequenceProce JUT_ASSERT(942, rData.pTarget!=0); JUT_ASSERT(943, uTargetIndex::parse(rData.pTarget, uTargetIndex); + u16 u16Index = JGadget::binary::TParseValue >::parse(rData.pTarget, uTargetIndex); return process_setMessageIndex_(pProcessor, u16Index); } @@ -702,7 +702,7 @@ JMessage::TSequenceProcessor::process_onBranch_(JMessage::TSequenceProcessor con JUT_ASSERT(957, rData.pTarget!=0); JUT_ASSERT(958, uTargetIndex::parse(rData.pTarget, uTargetIndex); + u32 uCode = JGadget::binary::TParseValue >::parse(rData.pTarget, uTargetIndex); return process_setMessageCode_(pProcessor, uCode); } diff --git a/src/JSystem/JStudio/JStudio/stb-data-parse.cpp b/src/JSystem/JStudio/JStudio/stb-data-parse.cpp index 78242915279..9701cc3cc64 100644 --- a/src/JSystem/JStudio/JStudio/stb-data-parse.cpp +++ b/src/JSystem/JStudio/JStudio/stb-data-parse.cpp @@ -4,6 +4,7 @@ // #include "JSystem/JStudio/JStudio/stb-data-parse.h" +#include "JSystem/JUtility/JUTAssert.h" #include "dolphin/os.h" namespace JStudio { @@ -47,37 +48,37 @@ void TParse_TParagraph::getData(TData* pData) const { } } -void TParse_TParagraph_data::getData(data::TParse_TParagraph_data::TData* pData) const { - u8* set2; +void TParse_TParagraph_data::getData(TParse_TParagraph_data::TData* pData) const { + JUT_ASSERT(104, pData!=0); + pData->entrySize = 0; + pData->entryCount = 0; + pData->content = NULL; + pData->next = NULL; + u8* temp = (u8*)getRaw(); + u8* filedata = temp; + if (filedata == NULL) + return; + u8 r29 = *filedata; + pData->status = r29 & ~0x8; + if (!r29) + return; + filedata++; + u32 r28 = 1; + if (r29 & 8) { + r28 = *filedata; + filedata++; + } + pData->entryCount = r28; + pData->content = filedata; - int dSize = pData->dataSize = 0; - pData->_8 = 0; - pData->fileCount = NULL; - pData->_10 = NULL; - u8* filedata = (u8*)getRaw(); - if (filedata == NULL) - return; - u8 set = *filedata; - pData->status = set & ~0x8; - if (!set) - return; - int is8; - int set3 = 1; - is8 = set & 8; - // Probably fake match - if (set2 = (filedata + 1), is8) { - set3 = *set2++; - } - pData->_8 = set3; - pData->fileCount = set2; - - if (!(set & 7)) - return; - dSize = (gauDataSize_TEParagraph_data)[set &= 7]; - pData->dataSize = dSize; - pData->_10 = (u8*)set2 + (dSize * set3); + u8 r27 = r29 & 7; + if (r27 == 0) + return; + u32 dataSize = (gauDataSize_TEParagraph_data)[r27]; + pData->entrySize = dataSize; + pData->next = filedata + (dataSize * r28); } } // namespace data } // namespace stb -} // namespace JStudio \ No newline at end of file +} // namespace JStudio diff --git a/src/d/actor/d_a_alink_demo.inc b/src/d/actor/d_a_alink_demo.inc index 2657c1d21d3..280f9653411 100644 --- a/src/d/actor/d_a_alink_demo.inc +++ b/src/d/actor/d_a_alink_demo.inc @@ -1441,7 +1441,6 @@ f32 daAlink_c::setStickAnmData(J3DAnmBase* i_anm, int param_1, int param_2, u16 /* 80119464-801195C0 113DA4 015C+00 1/1 0/0 0/0 .text * daAlink_c_getDemoIDData__FP13dDemo_actor_cPiPiPiPUsPiPi */ -// NONMATCHING - some stack issues static int daAlink_c_getDemoIDData(dDemo_actor_c* param_0, int* param_1, int* param_2, int* param_3, u16* param_4, int* param_5, int* param_6) { JStudio::stb::TParseData_fixed<51, TValueIterator_misaligned > sp30(param_0->getPrm()->getData()); diff --git a/src/d/actor/d_a_e_gb.cpp b/src/d/actor/d_a_e_gb.cpp index 4c1b659b887..c57759a204c 100644 --- a/src/d/actor/d_a_e_gb.cpp +++ b/src/d/actor/d_a_e_gb.cpp @@ -1591,7 +1591,7 @@ static cPhs__Step daE_GB_Create(fopAc_ac_c* a_this) { u8 swBit = fopAcM_GetParam(a_this) >> 16; if (swBit != 0xFF) { if (dComIfGs_isSwitch(swBit, fopAcM_GetRoomNo(a_this))) { - OS_REPORT("E_gb やられ後なので再セットしません\n") + OS_REPORT("E_gb やられ後なので再セットしません\n"); return cPhs_ERROR_e; } } diff --git a/src/d/actor/d_a_obj_flag3.cpp b/src/d/actor/d_a_obj_flag3.cpp index 31a06b3b97b..3fdd64fdf31 100644 --- a/src/d/actor/d_a_obj_flag3.cpp +++ b/src/d/actor/d_a_obj_flag3.cpp @@ -8,9 +8,11 @@ #include "d/actor/d_a_set_bgobj.h" #include "d/d_com_inf_game.h" #include "dol2asm.h" +#include "d/d_a_obj.h" #ifdef DEBUG class daObjFlag3_Hio_c : public JORReflexible { +public: daObjFlag3_Hio_c() { mCount = 0; default_set(); @@ -23,7 +25,7 @@ class daObjFlag3_Hio_c : public JORReflexible { ctx->genSlider("重力", &mAttr.mGravity, -10.0f, 0.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18); ctx->genSlider("バネ係数", &mAttr.mSpringCoeeficient, 0.0f, 10.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18); - ctx->genSlider("減衰率", &mAttr.mAttenuationRate, 0.0f, 1.0f, 0, NULL, 0xffff, 0xffff, + ctx->genSlider("減衰率", &mAttr.mDecayRate, 0.0f, 1.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18); ctx->genSlider("風係数", &mAttr.mWindCoefficient, 0.0f, 100.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18); @@ -45,6 +47,8 @@ class daObjFlag3_Hio_c : public JORReflexible { /* 0x4 */ int mCount; /* 0x8 */ daObjFlag3_Attr_c mAttr; }; + +daObjFlag3_Hio_c M_hio; #endif /* 80BF0458-80BF046C 000000 0014+00 3/3 0/0 0/0 .rodata M_attr__12daObjFlag3_c */ diff --git a/src/d/actor/d_a_title.cpp b/src/d/actor/d_a_title.cpp index 6be3f83e8f9..727dffc93eb 100644 --- a/src/d/actor/d_a_title.cpp +++ b/src/d/actor/d_a_title.cpp @@ -241,8 +241,11 @@ void daTitle_c::nextScene_init() { void daTitle_c::nextScene_proc() { if (!fopOvlpM_IsPeek() && !mDoRst::isReset()) { scene_class* playScene = fopScnM_SearchByID(dStage_roomControl_c::getProcID()); + JUT_ASSERT(706, playScene != 0); fopScnM_ChangeReq(playScene, 13, 0, 5); +#if VERSION != VERSION_SHIELD_DEBUG mDoGph_gInf_c::setFadeColor(*(JUtility::TColor*)&g_blackColor); +#endif } } diff --git a/src/d/d_demo.cpp b/src/d/d_demo.cpp index 73d79cc635f..a9fde337c8f 100644 --- a/src/d/d_demo.cpp +++ b/src/d/d_demo.cpp @@ -225,7 +225,6 @@ const u8* dDemo_c::m_branchData; /* 80038338-80038490 032C78 0158+00 0/0 1/1 5/5 .text getDemoIDData__13dDemo_actor_cFPiPiPiPUsPUc */ -// NONMATCHING - some stack issues int dDemo_actor_c::getDemoIDData(int* param_0, int* param_1, int* param_2, u16* param_3, u8* param_4) { JStudio::stb::TParseData_fixed<51, TValueIterator_misaligned > data(getPrm()->getData()); diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index 3f89a59ba5f..f5f5afe456d 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -432,7 +432,7 @@ dScnLogo_c::~dScnLogo_c() { field_0x1d4->destroy(); field_0x1d0->destroy(); - JKRFree(buffer); + JKRFree(dummyGameAlloc); dComIfGp_particle_createCommon(mParticleCommand->getMemAddress()); dComIfGp_setFieldMapArchive2(mpField0Command->getArchive()); @@ -508,8 +508,9 @@ static int phase_0(dScnLogo_c* i_this) { mDoGph_gInf_c::setFadeColor(*(JUtility::TColor*)&g_blackColor); dComIfGp_particle_create(); - i_this->buffer = mDoExt_getGameHeap()->alloc(0x340000, -0x10); - i_this->field_0x1d0 = JKRExpHeap::create(i_this->buffer, 0x340000, NULL, false); + i_this->dummyGameAlloc = mDoExt_getGameHeap()->alloc(0x340000, -0x10); + JUT_ASSERT(1523, i_this->dummyGameAlloc != 0); + i_this->field_0x1d0 = JKRExpHeap::create(i_this->dummyGameAlloc, 0x340000, NULL, false); i_this->field_0x1d4 = JKRExpHeap::create(0x130000, i_this->field_0x1d0, false); return cPhs_NEXT_e;