This commit is contained in:
Donkey Kong 2023-03-14 01:27:02 +10:30
parent 9a02f57051
commit ad2984ad56
7 changed files with 245 additions and 16 deletions

View File

@ -9,7 +9,7 @@ void *malloc(s32 size);
s32 rand(void);
void *memcpy(void *dest, void *src, u32 n);
void *getPointerTableFile(s32 pointerTableIndex, s32 fileIndex, s32 arg2, s32 arg3);
void *getPointerTableFile(s32 pointerTableIndex, s32 fileIndex, s32 arg2, u8 arg3);
void loadExits(s32 map);
void setFlag(s16 flagIndex, u8 newValue, u8 flagType); // TODO: Can we use the FlagTypes enum?
u8 isFlagSet(s16 flagIndex, u8 flagType); // TODO: Can we use the FlagTypes enum?

View File

@ -2753,7 +2753,7 @@ us,.code,func_806E5C2C,72,yes
us,.code,func_806F5CE4,156,yes
us,.code,func_806CA048,160,yes
us,.code,func_806DCA7C,1252,no
us,.code,func_8066ADA0,324,no
us,.code,func_8066ADA0,324,yes
us,.code,func_806F4750,40,yes
us,.code,func_80684850,176,yes
us,.code,func_806E0654,64,yes

1 version section function length matching
2753 us .code func_806F5CE4 156 yes
2754 us .code func_806CA048 160 yes
2755 us .code func_806DCA7C 1252 no
2756 us .code func_8066ADA0 324 no yes
2757 us .code func_806F4750 40 yes
2758 us .code func_80684850 176 yes
2759 us .code func_806E0654 64 yes

View File

@ -2753,7 +2753,7 @@ us,.code,func_806E5C2C,72,yes
us,.code,func_806F5CE4,156,yes
us,.code,func_806CA048,160,yes
us,.code,func_806DCA7C,1252,no
us,.code,func_8066ADA0,324,no
us,.code,func_8066ADA0,324,yes
us,.code,func_806F4750,40,yes
us,.code,func_80684850,176,yes
us,.code,func_806E0654,64,yes

1 version section function length matching
2753 us .code func_806F5CE4 156 yes
2754 us .code func_806CA048 160 yes
2755 us .code func_806DCA7C 1252 no
2756 us .code func_8066ADA0 324 no yes
2757 us .code func_806F4750 40 yes
2758 us .code func_80684850 176 yes
2759 us .code func_806E0654 64 yes

View File

@ -17,7 +17,7 @@
<text x="38.5" y="14">global_asm</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="111.5" y="15" fill="#010101" fill-opacity=".3">16.1271%</text>
<text x="110.5" y="14">16.1271%</text>
<text x="111.5" y="15" fill="#010101" fill-opacity=".3">16.1534%</text>
<text x="110.5" y="14">16.1534%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h132v20H0z"/>
<path fill="#e04a00" d="M132 0h67v20H132z"/>
<path fill="#e04b00" d="M132 0h67v20H132z"/>
<path fill="url(#b)" d="M0 0h199v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@ -17,7 +17,7 @@
<text x="66.0" y="14">Donkey Kong 64 (US)</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="166.5" y="15" fill="#010101" fill-opacity=".3">16.6234%</text>
<text x="165.5" y="14">16.6234%</text>
<text x="166.5" y="15" fill="#010101" fill-opacity=".3">16.6430%</text>
<text x="165.5" y="14">16.6430%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -706,7 +706,45 @@ int func_80669C6C(GlobalASMStruct80 *arg0, f32 arg1) {
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_699B0/func_8066ACA4.s")
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_699B0/func_8066ADA0.s")
extern s32 D_8000DDCC;
extern void *D_807F9520;
extern s32 D_807F9528[];
extern s32 D_807F9628[];
extern s32 D_807F9678;
extern s32 D_807F9680;
extern s8 D_807FB220;
extern s8 D_807FB221;
void func_8060B140(s32, s32*, s32*, s32, s32, s32, s32);
void func_8066ADA0(void) {
s32 i;
s32 sp40;
sp40 = 0x80;
D_807F9520 = malloc(0x80);
func_8060B140(D_8000DDCC, D_807F9520, &sp40, 0, 0, 0, 0);
for (i = 0; i < 0x20; i++) {
D_807F9528[i] = 0;
D_807F95A8[i] = 0;
}
for (i = 0; i < 0x14; i++) {
D_807F9628[i] = 0;
}
D_807F9680 = 0;
D_807F967C = 0;
D_807F9678 = 0;
D_807F967D = 0;
for (i = 0; i < 0x20; i++) {
if (D_80748E18[i] != 0) {
D_807FB1A0[i] = getPointerTableFile(0x1A, i, 1, 1); // Uncompressed file sizes
} else {
D_807FB1A0[i] = NULL;
}
}
D_807FB220 = 0;
D_807FB221 = 0;
}
void func_8066AEE4(s32 arg0, s32 arg1) {
s32 sp24;
@ -727,7 +765,7 @@ s32 func_8066B020(s32 arg0, s32 arg1) {
s32 sp1C;
s32 sp18;
func_8066B5F4();
func_8066B5F4(arg0);
func_8066B4D4(arg0, arg1, &sp1C, &sp18);
if (sp18 == 0) {
return 0;
@ -742,7 +780,7 @@ s32 func_8066B06C(s32 arg0, s32 arg1) {
if (D_80748E18[arg0] != 0) {
sp18 = *(D_807FB1A0[arg0] + arg1);
} else {
func_8066B5F4();
func_8066B5F4(arg0);
func_8066B4D4(arg0, arg1, &sp1C, &sp18);
}
return sp18;
@ -758,14 +796,117 @@ void func_8066B0EC(s32 arg0) {
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_699B0/getPointerTableFile.s")
void func_8066B424(void) {
D_807F967D = 1;
}
//forward decl needed
void func_8066B4AC(s32,s32,s32);
s32 func_8066B9F4(void*);
void *func_806111BC(s32, s32);
s32 func_8066B5C8(s32, s32);
extern OSMesgQueue D_807656D0;
extern s32 D_807F9678;
extern s32 D_807F9680;
typedef struct {
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
} Struct807F9688;
typedef struct {
s32 unk0;
s32 unk4;
u8 unk8; // Used
u8 unk9;
u8 unkA;
u8 unkB;
} Struct807FA8A0;
extern Struct807F9688 D_807F9688[];
extern Struct807FA8A0 D_807FA8A0[];
/*
void *getPointerTableFile(s32 pointerTableIndex, s32 fileIndex, s32 arg2, u8 arg3) {
u32 sp50;
s32 temp;
s32 sp4C;
Struct807FA8A0 *var_v1;
void *var_v0;
void *sp40;
s32 var_a1;
s32 temp2;
func_8066B5F4(pointerTableIndex);
if (!arg3) {
if ((fileIndex >= 0x80000000) && (fileIndex < 0xA0000000)) {
func_8066B8C8(fileIndex, pointerTableIndex, 0);
D_807F967C = 0;
D_807F9678 = 0;
return fileIndex;
}
var_v0 = func_8066B5C8(pointerTableIndex, fileIndex);
if (var_v0 != 0) {
func_8066B8C8(var_v0, pointerTableIndex, fileIndex);
D_807F967C = 0;
D_807F9678 = 0;
return var_v0;
}
}
func_8066B4D4(pointerTableIndex, fileIndex, &sp50, &sp4C);
if (sp4C == 0) {
D_807F967C = 0;
D_807F9678 = 0;
return NULL;
}
var_a1 = sp4C;
if (D_80748E18[pointerTableIndex] != 0) {
var_a1 = D_807FB1A0[pointerTableIndex][fileIndex];
}
if (D_807F9678 == 0) {
var_v0 = malloc(var_a1);
} else {
var_v0 = func_806111BC(D_807F9678, var_a1);
}
if (arg2 != 0) {
if (D_80748E18[pointerTableIndex] != 0) {
sp40 = malloc(sp4C);
func_8060B140(sp50, sp40, &sp4C, 0, 0, 0, 0);
func_8066AEE4(sp40, var_v0);
} else {
func_8060B140(sp50, var_v0, &sp4C, 0, 0, 0, 0);
}
} else {
if (D_807F9680 == 0xC0) {
func_80732354(6, 0, 0, 0);
}
var_v1 = &D_807FA8A0[D_807F9680];
var_v1->unk8 = D_80748E18[pointerTableIndex];
if (D_80748E18[pointerTableIndex] != 0) {
var_v1 = &D_807FA8A0[D_807F9680];
var_v1->unk0 = malloc(sp4C);
var_v1->unk4 = var_v0;
} else {
var_v1->unk4 = var_v0;
var_v1->unk0 = var_v0;
}
osInvalDCache(var_v1->unk0, sp4C);
osPiStartDma(&D_807F9688[D_807F9680].unk0, 0, 0, sp50, D_807FA8A0[D_807F9680].unk0, sp4C, &D_807656D0);
D_807F9680 += 1;
}
func_8066B4AC(pointerTableIndex, fileIndex, var_v0);
func_8066B8C8(var_v0, pointerTableIndex, fileIndex);
D_807F967C = 0;
D_807F9678 = 0;
return var_v0;
}
*/
void func_8066B424(void) {
D_807F967D = 1;
}
// It's usually a file from a pointer table in arg0
void func_8066B434(void *arg0, s32 arg1, s32 arg2) {
s32 sp1C;
@ -818,6 +959,7 @@ void func_8066B7AC(s32 arg0, s32 arg1, s32 arg2) {
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_699B0/func_8066B7F4.s")
// Doable
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_699B0/func_8066B8C8.s")
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_699B0/func_8066B924.s")

View File

@ -2,5 +2,92 @@
#include "functions.h"
#include "variables.h"
// Does DMA, probably could match if we knew the struct types
#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_FE40/func_8060B140.s")
extern s8 D_80746834;
extern OSMesgQueue D_807655F0;
extern OSIoMesg D_807ECE00;
extern void *D_807ECE18;
/*
// Doable, datatype and stack issues
void func_8060B140(u32 arg0, u8 *arg1, s32 *arg2, u8 arg3, u8 arg4, u8 arg5, u8 *arg6) {
u8 *sp5C;
u8 *sp58;
u8 *sp50;
s32 var_v1;
u32 var_a0;
u32 var_s0;
u8 *var_s1;
sp58 = arg1;
if ((arg3 != 0) || (arg4 != 0)) {
if (arg3 & 0x80) {
sp5C = arg6;
arg6 += 0x3800;
} else if (arg6 != NULL) {
sp5C = 0x80024000;
} else {
sp50 = malloc(*arg2);
sp5C = sp50;
}
} else {
sp5C = arg1;
}
osInvalDCache(sp5C, *arg2);
var_v1 = *arg2;
var_s0 = 0;
var_s1 = sp5C;
var_a0 = var_v1 >> 0xE;
if (var_a0 != 0) {
do {
osPiStartDma(&D_807ECE00, 0, 0, arg0, var_s1, 0x4000, &D_807655F0);
D_80746834 = 4;
osRecvMesg(&D_807655F0, NULL, 1);
D_80746834 = 0;
var_s0 += 1;
var_v1 = *arg2;
arg0 += 0x4000;
var_s1 += 0x4000;
var_a0 = var_v1 >> 0xE;
} while (var_s0 < var_a0);
}
if (var_v1 - (var_a0 << 0xE) != 0) {
osPiStartDma(&D_807ECE00, 0, 0, arg0, var_s1, var_v1 - (var_a0 << 0xE), &D_807655F0);
D_80746834 = 5;
osRecvMesg(&D_807655F0, NULL, 1);
D_80746834 = 0;
}
D_807ECE18 = arg6;
if ((arg6 == NULL) && ((arg5 == 1) || (arg5 == 2))) {
D_807ECE18 = malloc(0x4000);
}
switch (arg5) {
case 1:
if (arg3 != 0) {
func_800024E0(&sp5C, &arg1, D_807ECE18);
}
if (arg4 != 0) {
func_800024E0(&sp5C, &arg1, D_807ECE18);
}
break;
case 2:
if (arg3 != 0) {
func_80002790(&sp5C, &arg1, D_807ECE18, arg3);
}
if (arg4 != 0) {
func_80002790(&sp5C, &arg1, D_807ECE18, arg4);
}
break;
}
if ((arg6 == NULL) && ((arg5 == 1) || (arg5 == 2))) {
func_8061130C(D_807ECE18);
}
if ((arg3 != 0) || (arg4 != 0)) {
*arg2 = arg1 - sp58;
if (arg6 == NULL) {
func_8061130C(sp50);
}
}
}
*/