summaryrefslogtreecommitdiff
path: root/src/m
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-07-24 13:55:13 +0200
committerrobojumper <robojumper@gmail.com>2025-07-24 13:55:13 +0200
commit39be7ff72cd374e2d915487e90987c8518c4a395 (patch)
treee091d030fbb85ec5b82d37b6260f91ac3cc86be1 /src/m
parente8350dc5681fd9d689f25474674d0e930263bda2 (diff)
Fix a bunch of m symbols
Diffstat (limited to 'src/m')
-rw-r--r--src/m/m3d/m_banm.cpp3
-rw-r--r--src/m/m3d/m_shadow.cpp4
-rw-r--r--src/m/m_allocator.cpp8
-rw-r--r--src/m/m_dvd.cpp23
-rw-r--r--src/m/m_heap.cpp18
5 files changed, 32 insertions, 24 deletions
diff --git a/src/m/m3d/m_banm.cpp b/src/m/m3d/m_banm.cpp
index 047e5972..53a4a81b 100644
--- a/src/m/m3d/m_banm.cpp
+++ b/src/m/m3d/m_banm.cpp
@@ -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;
diff --git a/src/m/m3d/m_shadow.cpp b/src/m/m3d/m_shadow.cpp
index da0246ef..668a6669 100644
--- a/src/m/m3d/m_shadow.cpp
+++ b/src/m/m3d/m_shadow.cpp
@@ -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;
diff --git a/src/m/m_allocator.cpp b/src/m/m_allocator.cpp
index 1c6a56f0..25334c5c 100644
--- a/src/m/m_allocator.cpp
+++ b/src/m/m_allocator.cpp
@@ -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();
diff --git a/src/m/m_dvd.cpp b/src/m/m_dvd.cpp
index cfee7660..49c2eba8 100644
--- a/src/m/m_dvd.cpp
+++ b/src/m/m_dvd.cpp
@@ -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;
diff --git a/src/m/m_heap.cpp b/src/m/m_heap.cpp
index f2767ac0..eb6bc6da 100644
--- a/src/m/m_heap.cpp
+++ b/src/m/m_heap.cpp
@@ -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);
}