mirror of
https://github.com/zeldaret/tp
synced 2026-08-12 11:52:59 -04:00
JSUList.h templates and JKRHeap matches (#13)
* JSULink, JSUList, JSUTree and more matching in JKRHeap * Added JSUListIterator and decompiled JKRHeap::dispose_subroutine * more templates and JKRHeap functions * JKRDisposer! * only 4 functions not OK in JKRHeap * fixed: *this->getObject() Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
@@ -3,36 +3,17 @@
|
||||
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
|
||||
|
||||
// #include "JSystem/JKernel/asm/func_802D147C.s"
|
||||
JKRDisposer::JKRDisposer() : ptr_link(this) {
|
||||
this->heap = JKRHeap::findFromRoot(this);
|
||||
if (this->heap != 0) {
|
||||
this->heap->disposable_list.append(&this->ptr_link);
|
||||
JKRDisposer::JKRDisposer() : mLink(this) {
|
||||
this->mHeap = JKRHeap::findFromRoot(this);
|
||||
if (this->mHeap) {
|
||||
this->mHeap->appendDisposer(this);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Super close.
|
||||
|
||||
This is what we expected: (from Ghidra)
|
||||
if (this != (JKRDisposer *)&DAT_fffffff8) {
|
||||
JSUPtrLink::~JSUPtrLink(&this->ptr_link,0);
|
||||
}
|
||||
|
||||
But the compiler generate code like this instead: (no if and -1 instead of 0)
|
||||
JSUPtrLink::~JSUPtrLink(&this->ptr_link,-1);
|
||||
|
||||
Maybe we are using the wrong compiler?
|
||||
*/
|
||||
#ifdef NONMATCHING
|
||||
// #include "JSystem/JKernel/JKRDisposer/asm/func_802D14E4.s"
|
||||
JKRDisposer::~JKRDisposer() {
|
||||
JKRHeap* heap = this->heap;
|
||||
if (heap != 0) {
|
||||
heap->disposable_list.remove(&this->ptr_link);
|
||||
}
|
||||
JKRHeap* heap = this->mHeap;
|
||||
if (heap) {
|
||||
heap->removeDisposer(this);
|
||||
}
|
||||
}
|
||||
#else
|
||||
asm JKRDisposer::~JKRDisposer() {
|
||||
nofralloc
|
||||
#include "JSystem/JKernel/JKRDisposer/asm/func_802D14E4.s"
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user