mirror of https://github.com/zeldaret/tp
Match resource.cpp with a small fake match (#2936)
This commit is contained in:
parent
2447d5a02a
commit
cfded01caa
|
|
@ -1089,7 +1089,7 @@ config.libs = [
|
|||
Object(MatchingFor(ALL_GCN), "JSystem/JMessage/control.cpp"),
|
||||
Object(MatchingFor(ALL_GCN, "ShieldD"), "JSystem/JMessage/data.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "JSystem/JMessage/processor.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/resource.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "JSystem/JMessage/resource.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "JSystem/JMessage/locale.cpp"),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -243,6 +243,8 @@ struct TLinkList : TNodeLinkList {
|
|||
return iterator(TNodeLinkList::Find(Element_toNode(element)));
|
||||
}
|
||||
void Remove(T* element) { TNodeLinkList::Remove(Element_toNode(element)); }
|
||||
|
||||
typedef T value_type;
|
||||
};
|
||||
|
||||
template <typename T, int I>
|
||||
|
|
@ -311,10 +313,10 @@ struct TEnumerator2 {
|
|||
Iterator end;
|
||||
};
|
||||
|
||||
template <typename T, int I>
|
||||
struct TContainerEnumerator : public TEnumerator2<typename TLinkList<T, I>::iterator, T> {
|
||||
inline TContainerEnumerator(TLinkList<T, I>* param_0)
|
||||
: TEnumerator2<typename TLinkList<T, I>::iterator, T>(param_0->begin(), param_0->end()) {}
|
||||
template <typename T>
|
||||
struct TContainerEnumerator : public TEnumerator2<typename T::iterator, typename T::value_type> {
|
||||
inline TContainerEnumerator(T& param_0)
|
||||
: TEnumerator2<typename T::iterator, typename T::value_type>(param_0.begin(), param_0.end()) {}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct data {
|
|||
u32* get_signature() const { return (u32*)(get() + 0x0); }
|
||||
u32 get_type() const { return *(u32*)(get() + 0x4); }
|
||||
u32 get_blockNumber() const { return *(u32*)(get() + 0xC); }
|
||||
u8 get_encoding() const { return *(u8*)(get() + 0x10); }
|
||||
u32 get_encoding() const { return *(u8*)(get() + 0x10); }
|
||||
};
|
||||
|
||||
// TParse_TBlock handles parsing the generic section header data
|
||||
|
|
|
|||
|
|
@ -100,10 +100,8 @@ JMessage::TResourceContainer::TCResource::TCResource() {}
|
|||
JMessage::TResourceContainer::TCResource::~TCResource() {
|
||||
JGADGET_ASSERTWARN(173, empty());
|
||||
}
|
||||
|
||||
// NONMATCHING - likely due to incorrect enumerator setup compared to debug
|
||||
JMessage::TResource* JMessage::TResourceContainer::TCResource::Get_groupID(u16 u16GroupID) {
|
||||
JGadget::TContainerEnumerator<TResource, 0> enumerator(this);
|
||||
JGadget::TContainerEnumerator<TResourceContainer::TCResource> enumerator(*this);
|
||||
while (enumerator) {
|
||||
const TResource* res = &(*enumerator);
|
||||
if (res->getGroupID() == u16GroupID)
|
||||
|
|
@ -117,9 +115,13 @@ JMessage::TResource* JMessage::TResourceContainer::TCResource::Do_create() {
|
|||
return new TResource();
|
||||
}
|
||||
|
||||
// NONMATCHING extra null comparison
|
||||
void JMessage::TResourceContainer::TCResource::Do_destroy(JMessage::TResource* pResource) {
|
||||
#if DEBUG
|
||||
delete pResource;
|
||||
#else
|
||||
// Fake Match - extra null comparison when not doing the conversion
|
||||
delete (void*)pResource;
|
||||
#endif
|
||||
}
|
||||
|
||||
JMessage::TResourceContainer::TResourceContainer() : encodingType_(0), pfnParseCharacter_(NULL) {}
|
||||
|
|
@ -141,14 +143,17 @@ void JMessage::TResourceContainer::setEncoding_(u8 e) {
|
|||
}
|
||||
|
||||
JMessage::TParse::TParse(JMessage::TResourceContainer* pContainer) {
|
||||
u8 sp8[5];
|
||||
JMessage::TResourceContainer* cont;
|
||||
JUT_ASSERT(324, pContainer!=NULL);
|
||||
pContainer_ = pContainer;
|
||||
cont = pContainer;
|
||||
pContainer_ = cont;
|
||||
pResource_ = NULL;
|
||||
sp8[0] = 0;
|
||||
}
|
||||
|
||||
JMessage::TParse::~TParse() {}
|
||||
|
||||
// NONMATCHING regalloc, missing clrlwi
|
||||
bool JMessage::TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 param_2) {
|
||||
JUT_ASSERT(343, ppData_inout!=NULL);
|
||||
JUT_ASSERT(344, puBlock_out!=NULL);
|
||||
|
|
@ -172,7 +177,7 @@ bool JMessage::TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_
|
|||
return false;
|
||||
}
|
||||
|
||||
u8 uEncoding = oHeader.get_encoding();
|
||||
const u8 uEncoding = oHeader.get_encoding();
|
||||
if (uEncoding != 0) {
|
||||
if (!pContainer_->isEncodingSettable(uEncoding)) {
|
||||
JGADGET_WARNMSG(369, "encoding not acceptable");
|
||||
|
|
|
|||
|
|
@ -80,8 +80,9 @@ void JStudio::TFactory::appendCreateObject(JStudio::TCreateObject* param_0) {
|
|||
mList.Push_back(param_0);
|
||||
}
|
||||
|
||||
|
||||
JStudio::TObject* JStudio::TFactory::create(JStudio::stb::data::TParse_TBlock_object const& param_0) {
|
||||
JGadget::TContainerEnumerator<TCreateObject, -4> aTStack_368(&mList);
|
||||
JGadget::TContainerEnumerator<JGadget::TLinkList<TCreateObject, -4> > aTStack_368(mList);
|
||||
while(aTStack_368) {
|
||||
TCreateObject& piVar1 = *aTStack_368;
|
||||
JStudio::TObject* obj;
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ TObject* TControl::getObject(void const* param_0, u32 param_1) {
|
|||
void TControl::reset() {
|
||||
resetStatus_();
|
||||
mObject_control.reset(NULL);
|
||||
JGadget::TContainerEnumerator<JStudio::stb::TObject, -12> aTStack_18(&mObjectContainer);
|
||||
JGadget::TContainerEnumerator<JGadget::TLinkList<JStudio::stb::TObject, -12> > aTStack_18(mObjectContainer);
|
||||
while (aTStack_18) {
|
||||
(*aTStack_18).reset(NULL);
|
||||
}
|
||||
|
|
@ -346,7 +346,7 @@ bool TControl::forward(u32 param_0) {
|
|||
bool rv = mObject_control.forward(param_0);
|
||||
int uVar7 = 0xf;
|
||||
int uVar6 = 0;
|
||||
JGadget::TContainerEnumerator<JStudio::stb::TObject, -12> aTStack_38(&mObjectContainer);
|
||||
JGadget::TContainerEnumerator<JGadget::TLinkList<JStudio::stb::TObject, -12> > aTStack_38(mObjectContainer);
|
||||
while (aTStack_38) {
|
||||
JStudio::stb::TObject& this_00 = *aTStack_38;
|
||||
rv = this_00.forward(param_0) || rv;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ inline ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last,
|
|||
template <class ForwardIterator, class T>
|
||||
ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& val) {
|
||||
// For some reason, calling the other lower_bound matches for debug, but not for retail:
|
||||
// return lower_bound(first, last, val, std::detail::less<T, T>());
|
||||
#if DEBUG
|
||||
return lower_bound(first, last, val, std::detail::less<T, T>());
|
||||
#else
|
||||
|
||||
typedef typename iterator_traits<ForwardIterator>::difference_type difference_type;
|
||||
difference_type len = std::distance(first, last);
|
||||
|
|
@ -50,6 +52,7 @@ ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T
|
|||
}
|
||||
|
||||
return first;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class ForwardIterator, class T, class Predicate>
|
||||
|
|
|
|||
Loading…
Reference in New Issue