summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2021-01-03 21:08:33 -0500
committerPheenoh <pheenoh@gmail.com>2021-01-03 21:08:33 -0500
commit6f22d27503fa0445fe2282cb6257449e5ae87734 (patch)
treec7993f2202ab7a8a14c29d903cab491f220822be /src
parentda3a14282827333ad9068891eebcfb43e9509286 (diff)
swap in memcpy for func_80003540, correct some minor issues in dvd.h and JKRDVDFile.h
Diffstat (limited to 'src')
-rw-r--r--src/m_Do/m_Do_main.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp
index 427d5d6a72..dbf281f51a 100644
--- a/src/m_Do/m_Do_main.cpp
+++ b/src/m_Do/m_Do_main.cpp
@@ -31,32 +31,26 @@ void HeapCheck::CheckHeap1(void) {
}
#ifdef NONMATCHING
-extern u8 lbl_803A2EF4[0x4c];
-extern u8 m_cpadInfo[0x100];
-
-void CheckHeap(u32 param_1) {
- HeapCheck* currentHeap;
- s32 unk;
-
+void CheckHeap(u32 controller_pad_no) {
mDoMch_HeapCheckAll();
OSCheckActiveThreads();
- unk = 0;
+ bool unk = false;
- if ((((m_cpadInfo + 0x30)[param_1 * 0x10] & 0xffffffef) == 0x60) &&
- (((m_cpadInfo + 0x30)[param_1 * 0x10] & 0x10) != 0)) {
- unk = 1;
+ // if L + R + Z is pressed...
+ if (((m_cpadInfo[controller_pad_no].mButtonFlags & ~0x10) == 0x60) && m_cpadInfo[controller_pad_no].mPressedButtonFlags & 0x10) {
+ unk = true;
}
for (int i = 0; i < 8; i++) {
- ((HeapCheck*)lbl_803A2EF4[i])->CheckHeap1();
-
+ HeapCheckTable[i]->CheckHeap1();
if (unk) {
- currentHeap = (HeapCheck*)lbl_803A2EF4[i * 4];
- s32 current_used_count = currentHeap->getUsedCount();
- currentHeap->used_count = current_used_count;
- s32 current_total_used_size = currentHeap->heap->getTotalUsedSize();
- currentHeap->total_used_size = current_total_used_size;
+ HeapCheck* currentHeap = HeapCheckTable[i];
+ s32 used_count = currentHeap->getUsedCount();
+
+ currentHeap->getUsedCountRef() = used_count;
+ used_count = currentHeap->getHeap()->getTotalUsedSize();
+ currentHeap->getTotalUsedSizeRef() = used_count;
}
}
}
@@ -122,16 +116,20 @@ asm void Debug_console(u32) {
}
#ifdef NONMATCHING
+extern u8 lbl_803739a0[0x310];
+extern char lbl_803a2ee0[20];
+extern void memcpy(void*,void*,int);
+
void LOAD_COPYDATE(void*) {
s32 dvd_status;
char buffer[32];
DVDFileInfo file_info;
- dvd_status = DVDOpen(lbl_803739a0 + 0x283, &file_info);
+ dvd_status = DVDOpen((const char*)lbl_803739a0 + 0x283, &file_info);
if (dvd_status) {
DVDReadPrio(&file_info, buffer, 32, 0, 2);
- memcpy(memcpy_string, buffer, 17);
+ memcpy(lbl_803a2ee0, buffer, 17);
DVDClose(&file_info);
}
return;