Fix a bunch of m symbols

This commit is contained in:
robojumper
2025-07-24 13:55:13 +02:00
parent e8350dc568
commit 39be7ff72c
18 changed files with 98 additions and 69 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ bool banm_c::createAllocator(mAllocator_c *alloc, u32 *pStart) {
i1 = mHeap::frmHeapCost(i2, 0x20);
*pStart = ROUND_UP(i1, 0x20);
mpFrameHeap = mHeap::createFrmHeap(
i2, (EGG::Heap *)alloc->mHeap, "アニメ切り替え用アロケータ(m3d::banm_c::m_heap)", internal::l_alignment, 0
i2, (EGG::Heap *)alloc->mHeap, "アニメ切り替え用アロケータ(m3d::banm_c::m_heap)", internal::l_alignment,
mHeap::OPT_NONE
);
mAllocator.attach(mpFrameHeap, 0x20);
return true;
+2 -2
View File
@@ -56,7 +56,7 @@ void mShadow_c::create(
// Maybe an Inline?
EGG::FrmHeap **heap = mpFrmHeaps;
for (int i = 0; i < 2; i++) {
heap[0] = mHeap::createFrmHeap(heapSize, mpHeap, "ShadowTmp", 0x4, 0);
heap[0] = mHeap::createFrmHeap(heapSize, mpHeap, "ShadowTmp", 0x4, mHeap::OPT_NONE);
heap[0]->recordState(FRM_HEAP_STATE);
heap++;
}
@@ -519,7 +519,7 @@ void mShadowChild_c::updateMtx() {
mVec3_c a(mQuat.v.x, mQuat.v.y, mQuat.v.z);
a += mPositionMaybe * GetOffset();
mVec3_c b(mQuat.v.x, mQuat.v.y, mQuat.v.z);
b -= mPositionMaybe * field_0x13C;
+4 -4
View File
@@ -35,7 +35,7 @@ mHeapAllocator_c::~mHeapAllocator_c() {
destroyHeap();
}
bool mHeapAllocator_c::replaceWithNewFrmHeap(s32 size, EGG::Heap *newHeap, char *heapName, s32 align, u32 attrs) {
bool mHeapAllocator_c::createFrmHeap(u32 size, EGG::Heap *newHeap, const char *heapName, u32 align, mHeap::AllocOptBit_t attrs) {
destroyHeap();
EGG::Heap *heap = mHeap::createFrmHeap(size, newHeap, heapName, align, attrs);
if (heap == nullptr) {
@@ -45,7 +45,7 @@ bool mHeapAllocator_c::replaceWithNewFrmHeap(s32 size, EGG::Heap *newHeap, char
return true;
}
bool mHeapAllocator_c::replaceWithNewExpHeap(s32 size, EGG::Heap *newHeap, char *heapName, s32 align, u32 attrs) {
bool mHeapAllocator_c::createExpHeap(u32 size, EGG::Heap *newHeap, const char *heapName, u32 align, mHeap::AllocOptBit_t attrs) {
destroyHeap();
EGG::Heap *heap = mHeap::createExpHeap(size, newHeap, heapName, align, attrs);
if (heap == nullptr) {
@@ -79,8 +79,8 @@ s32 mHeapAllocator_c::adjustExpHeap() {
return mHeap::adjustExpHeap(EGG::Heap::toExpHeap(heap));
}
bool mHeapAllocator_c::createNewTempFrmHeap(s32 size, EGG::Heap *newHeap, char *heapName, s32 align, u32 attrs) {
if (!replaceWithNewFrmHeap(size, newHeap, heapName, align, attrs)) {
bool mHeapAllocator_c::createFrmHeapToCurrent(u32 size, EGG::Heap *newHeap, const char *heapName, u32 align, mHeap::AllocOptBit_t attrs) {
if (!createFrmHeap(size, newHeap, heapName, align, attrs)) {
return false;
}
mHeap::saveCurrentHeap();
+15 -8
View File
@@ -165,8 +165,10 @@ static void *loadToMainRAM(
return result;
}
static int ConvertPathToEntrynum(const char *path, u8 *);
int ConvertPathToEntrynum(const char *path) {
return ::ConvertPathToEntrynum(path, nullptr);
return mDvd::ConvertPathToEntrynum(path, nullptr);
}
u32 IsExistPath(const char *path) {
@@ -374,8 +376,10 @@ mDvd_mountMemArchive_c::mDvd_mountMemArchive_c(int mountDirection) {
mAmountRead = 0;
}
namespace mDvd {
/** 802ef7c0 */
int findPathWithCompressedExtension(const char *name, u8 *outType) {
static int ConvertPathToEntrynumASD_(const char *name, u8 *outType) {
u8 type;
char buf[256];
int num;
@@ -434,10 +438,11 @@ void setAutoStreamDecomp(bool arg) {
}
/** 802ef940 */
bool getAutoStreamDecomp() {
bool isAutoStreamDecomp() {
return mDvd::l_IsAutoStreamDecomp;
}
/** 802ef950 */
static int ConvertPathToEntrynum(const char *path, u8 *outType) {
int num = DVDConvertPathToEntrynum(path);
@@ -445,22 +450,24 @@ static int ConvertPathToEntrynum(const char *path, u8 *outType) {
if (outType != nullptr) {
*outType = 0;
}
} else if (getAutoStreamDecomp()) {
num = findPathWithCompressedExtension(path, outType);
} else if (mDvd::isAutoStreamDecomp()) {
num = mDvd::ConvertPathToEntrynumASD_(path, outType);
}
return num;
}
/** 802ef9d0 */
static int ConvertPathToEntrynum_Thunk(const char *path, u8 *outType) {
static int ConvertPathToEntrynumWithWarning(const char *path, u8 *outType) {
return ConvertPathToEntrynum(path, outType);
}
}
/** 802ef9e0 */
mDvd_mountMemArchive_c *mDvd_mountMemArchive_c::create(const char *path, u8 mountDirection, EGG::Heap *heap) {
u8 type;
mDvd_mountMemArchive_c *cmd = nullptr;
int entryNum = ConvertPathToEntrynum_Thunk(path, &type);
int entryNum = mDvd::ConvertPathToEntrynumWithWarning(path, &type);
if (entryNum != -1) {
cmd = new mDvd_mountMemArchive_c(mountDirection);
if (cmd != nullptr) {
@@ -596,7 +603,7 @@ mDvd_toMainRam_normal_c::mDvd_toMainRam_normal_c(int mountDirection) : mDvd_toMa
/** 802eff90 */
mDvd_toMainRam_normal_c *mDvd_toMainRam_normal_c::create(const char *path, int mountDirection, EGG::Heap *heap) {
u8 type;
int entryNum = ConvertPathToEntrynum_Thunk(path, &type);
int entryNum = mDvd::ConvertPathToEntrynumWithWarning(path, &type);
mDvd_toMainRam_normal_c *cmd;
if (entryNum == -1) {
cmd = nullptr;
+9 -9
View File
@@ -22,7 +22,7 @@ const char *const mHeap::s_GameHeapNames[4] = {
0,
};
u16 mHeap::copyAttribute(u32 arg) {
u16 mHeap::GetOptFlag(AllocOptBit_t arg) {
u16 result = 0;
if ((arg & 1) != 0) {
@@ -40,7 +40,7 @@ u16 mHeap::copyAttribute(u32 arg) {
EGG::Heap *mHeap::setCurrentHeap(EGG::Heap *heap) {
return heap->becomeCurrentHeap();
}
EGG::Heap *mHeap::createExpHeap(size_t size, EGG::Heap *parentHeap, const char *name, u32 align, u32 attrs) {
EGG::Heap *mHeap::createExpHeap(size_t size, EGG::Heap *parentHeap, const char *name, u32 align, AllocOptBit_t attrs) {
if (parentHeap == nullptr) {
parentHeap = EGG::Heap::sCurrentHeap;
}
@@ -58,7 +58,7 @@ EGG::Heap *mHeap::createExpHeap(size_t size, EGG::Heap *parentHeap, const char *
void *mem = parentHeap->alloc(size, align);
EGG::ExpHeap *heap = nullptr;
if (mem != nullptr) {
heap = EGG::ExpHeap::create(mem, size, copyAttribute(attrs));
heap = EGG::ExpHeap::create(mem, size, GetOptFlag(attrs));
if (heap == nullptr) {
parentHeap->free(mem);
} else if (name != nullptr) {
@@ -86,7 +86,7 @@ size_t mHeap::expHeapCost(size_t size, u32 align) {
return size + (~(a)&b);
}
EGG::FrmHeap *mHeap::createFrmHeap(size_t size, EGG::Heap *parent, const char *name, size_t align, size_t attrs) {
EGG::FrmHeap *mHeap::createFrmHeap(size_t size, EGG::Heap *parent, const char *name, size_t align, AllocOptBit_t attrs) {
if (parent == nullptr) {
parent = EGG::Heap::sCurrentHeap;
}
@@ -104,7 +104,7 @@ EGG::FrmHeap *mHeap::createFrmHeap(size_t size, EGG::Heap *parent, const char *n
void *mem = parent->alloc(size, align);
EGG::FrmHeap *heap = nullptr;
if (mem != nullptr) {
heap = EGG::FrmHeap::create(mem, size, copyAttribute(attrs));
heap = EGG::FrmHeap::create(mem, size, GetOptFlag(attrs));
if (heap == nullptr) {
parent->free(mem);
} else if (name != nullptr) {
@@ -167,8 +167,8 @@ void mHeap::restoreCurrentHeap() {
s_SavedCurrentHeap = nullptr;
}
EGG::FrmHeap *mHeap::makeFrmHeapAndUpdate(size_t size, EGG::Heap *parentHeap, const char *name, u32 align, u32 unk) {
EGG::FrmHeap *heap = createFrmHeap(size, parentHeap, name, align, unk);
EGG::FrmHeap *mHeap::createFrmHeapToCurrent(size_t size, EGG::Heap *parentHeap, const char *name, u32 align, AllocOptBit_t opt) {
EGG::FrmHeap *heap = createFrmHeap(size, parentHeap, name, align, opt);
if (heap != nullptr) {
s_SavedCurrentHeap = setCurrentHeap(heap);
}
@@ -209,6 +209,6 @@ EGG::AssertHeap *mHeap::createAssertHeap(EGG::Heap *parent) {
return g_assertHeap;
}
EGG::FrmHeap *mHeap::makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, u32 flags) {
return makeFrmHeapAndUpdate(size, g_gameHeaps[0], name, align, flags);
EGG::FrmHeap *mHeap::makeHeapOnCurrentGameHeap(size_t size, const char *name, u32 align, AllocOptBit_t flags) {
return createFrmHeapToCurrent(size, g_gameHeaps[0], name, align, flags);
}