add more sorting to inline'd asm for JSystem, move m_Do_main over to using newly defined JKRHeap and JKRExpHeap headers

This commit is contained in:
unknown 2020-11-29 12:57:11 -05:00
parent 92cfb378f3
commit 58afa9ed78
No known key found for this signature in database
GPG Key ID: 4312662758CE7D5A
63 changed files with 58 additions and 62 deletions

View File

@ -2,7 +2,7 @@
#define __JKRDISPOSER_H__
#include "dolphin/types.h"
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JSupport/JSUList/JSUList.h"
class JKRHeap;
class JKRDisposer {

View File

@ -0,0 +1,5 @@
class JKRExpHeap {
public:
s32 getTotalUsedSize() const;
};

View File

@ -1,6 +1,6 @@
#include "dolphin/types.h"
#include "JSystem/JKernel/JKRDisposer.h"
#include "JSystem/JKernel/JKRDisposer/JKRDisposer.h"
typedef void (*JKRErrorHandler)(void*, unsigned long, int);
class JKRHeap : JKRDisposer {
@ -29,7 +29,7 @@ class JKRHeap : JKRDisposer {
static s32 getSize(void* ptr, JKRHeap* heap);
s32 getSize(void* ptr);
u32 getFreeSize();
s32 getFreeSize();
u32 getMaxFreeBlock();
u32 getTotalFreeSize();
u8 changeGroupID(u8 param_1);

View File

@ -1,15 +1,6 @@
#include "dolphin/types.h"
class JKRExpHeap {
public:
s32 getTotalUsedSize() const;
};
class JKRHeap {
public:
s32 getFreeSize();
};
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
#include "JSystem/JKernel/JKRExpHeap/JKRExpHeap.h"
class HeapCheck {
public:

View File

@ -1,6 +1,6 @@
#include "JSystem/JKernel/JKRDisposer.h"
#include "JSystem/JKernel/JKRDisposer/JKRDisposer.h"
#include "global.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
// #include "JSystem/JKernel/asm/func_802D147C.s"
JKRDisposer::JKRDisposer() : __vt(lbl_803CC0F0), ptr_link(this) {
@ -22,6 +22,6 @@ JKRDisposer::~JKRDisposer() {
#else
asm JKRDisposer::~JKRDisposer() {
nofralloc
#include "JSystem/JKernel/asm/func_802D14E4.s"
#include "JSystem/JKernel/JKRDisposer/asm/func_802D14E4.s"
}
#endif

View File

@ -1,4 +1,4 @@
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
#include "global.h"
#ifdef NONMATCHING
@ -7,211 +7,211 @@ JKRHeap::JKRHeap(void* data, u32 size, JKRHeap* parent, bool error_handler) {
#else
asm JKRHeap::JKRHeap(void* data, u32 size, JKRHeap* parent, bool error_handler) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE138.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE138.s"
}
#endif
asm JKRHeap::~JKRHeap() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE264.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE264.s"
}
asm bool JKRHeap::initArena(char**, u32*, int) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE378.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE378.s"
}
asm void JKRHeap::becomeSystemHeap() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE428.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE428.s"
}
asm void JKRHeap::becomeCurrentHeap() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE438.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE438.s"
}
asm void JKRHeap::destroy() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE448.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE448.s"
}
asm void* JKRHeap::alloc(u32 size, int alignment, JKRHeap* heap) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE474.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE474.s"
}
asm void* JKRHeap::alloc(u32 size, int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE4D4.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE4D4.s"
}
asm void JKRHeap::free(void* ptr, JKRHeap* heap) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE500.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE500.s"
}
asm void JKRHeap::free(void* ptr) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE548.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE548.s"
}
asm void JKRHeap::callAllDisposer() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE574.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE574.s"
}
asm void JKRHeap::freeAll() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE5CC.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE5CC.s"
}
asm void JKRHeap::freeTail() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE5F8.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE5F8.s"
}
asm s32 JKRHeap::resize(void* ptr, u32 size, JKRHeap* heap) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE624.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE624.s"
}
asm s32 JKRHeap::resize(void* ptr, u32 size) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE684.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE684.s"
}
asm s32 JKRHeap::getSize(void* ptr, JKRHeap* heap) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE6B0.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE6B0.s"
}
asm s32 JKRHeap::getSize(void* ptr) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE700.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE700.s"
}
asm u32 JKRHeap::getFreeSize() {
asm s32 JKRHeap::getFreeSize() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE72C.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE72C.s"
}
asm u32 JKRHeap::getMaxFreeBlock() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE758.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE758.s"
}
asm u32 JKRHeap::getTotalFreeSize() {
nofralloc
#include "JSystem/JKernel/asm/func_802CE784.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE784.s"
}
asm u8 JKRHeap::changeGroupID(u8 param_1) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE7B0.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE7B0.s"
}
asm u32 JKRHeap::getMaxAllocatableSize(int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE7DC.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE7DC.s"
}
asm JKRHeap* JKRHeap::findFromRoot(void* ptr) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE83C.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE83C.s"
}
asm JKRHeap* JKRHeap::find(void* ptr) const {
nofralloc
#include "JSystem/JKernel/asm/func_802CE894.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE894.s"
}
asm JKRHeap* JKRHeap::findAllHeap(void* ptr) const {
nofralloc
#include "JSystem/JKernel/asm/func_802CE93C.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE93C.s"
}
asm void JKRHeap::dispose_subroutine(u32 begin, u32 end) {
nofralloc
#include "JSystem/JKernel/asm/func_802CE9E4.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CE9E4.s"
}
asm void JKRHeap::dispose(void* ptr, u32 size) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEA78.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEA78.s"
}
asm void JKRHeap::dispose(void* begin, void* end) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEAA0.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEAA0.s"
}
asm void JKRHeap::dispose() {
nofralloc
#include "JSystem/JKernel/asm/func_802CEAC0.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEAC0.s"
}
asm void JKRHeap::copyMemory(void* dst, void* src, u32 size) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEB18.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEB18.s"
}
asm void JKRHeap::JKRDefaultMemoryErrorRoutine(JKRHeap* heap, u32 size, int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEB40.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEB40.s"
}
asm bool JKRHeap::setErrorFlag(bool param_1) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEB78.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEB78.s"
}
asm JKRErrorHandler JKRHeap::setErrorHandler(JKRErrorHandler param_1) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEB88.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEB88.s"
}
asm bool JKRHeap::isSubHeap(JKRHeap* heap) const {
nofralloc
#include "JSystem/JKernel/asm/func_802CEBA8.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEBA8.s"
}
asm void* operator new(u32 size) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEC4C.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEC4C.s"
}
asm void* operator new(u32 size, int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEC74.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEC74.s"
}
asm void* operator new(u32 size, JKRHeap* heap, int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CEC98.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CEC98.s"
}
asm void* operator new[](u32 size) {
nofralloc
#include "JSystem/JKernel/asm/func_802CECC4.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CECC4.s"
}
asm void* operator new[](u32 size, int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CECEC.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CECEC.s"
}
asm void* operator new[](u32 size, JKRHeap* heap, int alignment) {
nofralloc
#include "JSystem/JKernel/asm/func_802CED10.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CED10.s"
}
asm void operator delete(void* ptr) {
nofralloc
#include "JSystem/JKernel/asm/func_802CED3C.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CED3C.s"
}
asm void operator delete[](void* ptr) {
nofralloc
#include "JSystem/JKernel/asm/func_802CED60.s"
#include "JSystem/JKernel/JKRHeap/asm/func_802CED60.s"
}

View File

@ -1,4 +1,4 @@
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JSupport/JSUList/JSUList.h"
#include "global.h"
// #include "JSupport/asm/func_802DBDFC.s"