Named load_compressed_asset_from_rom

This commit is contained in:
David Benepe
2021-07-09 10:53:21 -05:00
parent 2521c5c86a
commit fac6c97536
9 changed files with 41 additions and 11 deletions
@@ -1,4 +1,4 @@
glabel func_80076CF0
glabel load_compressed_asset_from_rom
/* 0778F0 80076CF0 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 0778F4 80076CF4 3C028012 */ lui $v0, %hi(gAssetsLookupTable) # $v0, 0x8012
/* 0778F8 80076CF8 8C424290 */ lw $v0, %lo(gAssetsLookupTable)($v0)
@@ -60,7 +60,7 @@ glabel func_80076CF0
/* 0779D0 80076DD0 AFA70024 */ sw $a3, 0x24($sp)
/* 0779D4 80076DD4 8FA50024 */ lw $a1, 0x24($sp)
/* 0779D8 80076DD8 8FA4001C */ lw $a0, 0x1c($sp)
/* 0779DC 80076DDC 0C031886 */ jal func_800C6218
/* 0779DC 80076DDC 0C031886 */ jal gzip_inflate
/* 0779E0 80076DE0 00000000 */ nop
/* 0779E4 80076DE4 8FA20024 */ lw $v0, 0x24($sp)
/* 0779E8 80076DE8 00000000 */ nop
@@ -120,7 +120,7 @@ glabel func_8000C8F8
/* 00D6B4 8000CAB4 02003025 */ move $a2, $s0
/* 00D6B8 8000CAB8 8FA40034 */ lw $a0, 0x34($sp)
/* 00D6BC 8000CABC 8FA50048 */ lw $a1, 0x48($sp)
/* 00D6C0 8000CAC0 0C031886 */ jal func_800C6218
/* 00D6C0 8000CAC0 0C031886 */ jal gzip_inflate
/* 00D6C4 8000CAC4 00000000 */ nop
/* 00D6C8 8000CAC8 8FA4003C */ lw $a0, 0x3c($sp)
/* 00D6CC 8000CACC 0C01C450 */ jal free_from_memory_pool
@@ -84,7 +84,7 @@ glabel func_8002C0C4
/* 02CDE4 8002C1E4 0C01DB9A */ jal load_asset_to_address
/* 02CDE8 8002C1E8 02603825 */ move $a3, $s3
/* 02CDEC 8002C1EC 8E250000 */ lw $a1, ($s1)
/* 02CDF0 8002C1F0 0C031886 */ jal func_800C6218
/* 02CDF0 8002C1F0 0C031886 */ jal gzip_inflate
/* 02CDF4 8002C1F4 02002025 */ move $a0, $s0
/* 02CDF8 8002C1F8 8E840000 */ lw $a0, ($s4)
/* 02CDFC 8002C1FC 0C01C450 */ jal free_from_memory_pool
@@ -94,7 +94,7 @@ glabel func_8005F99C
/* 0606EC 8005FAEC 0C01DB9A */ jal load_asset_to_address
/* 0606F0 8005FAF0 00008825 */ move $s1, $zero
/* 0606F4 8005FAF4 8FA40030 */ lw $a0, 0x30($sp)
/* 0606F8 8005FAF8 0C031886 */ jal func_800C6218
/* 0606F8 8005FAF8 0C031886 */ jal gzip_inflate
/* 0606FC 8005FAFC 02402825 */ move $a1, $s2
/* 060700 8005FB00 8E4D0000 */ lw $t5, ($s2)
/* 060704 8005FB04 8E4F0004 */ lw $t7, 4($s2)
@@ -107,7 +107,7 @@ glabel func_80061A00
/* 062784 80061B84 02002025 */ move $a0, $s0
/* 062788 80061B88 03314021 */ addu $t0, $t9, $s1
/* 06278C 80061B8C 8D050000 */ lw $a1, ($t0)
/* 062790 80061B90 0C031886 */ jal func_800C6218
/* 062790 80061B90 0C031886 */ jal gzip_inflate
/* 062794 80061B94 00000000 */ nop
/* 062798 80061B98 8EA90044 */ lw $t1, 0x44($s5)
/* 06279C 80061B9C 26940004 */ addiu $s4, $s4, 4
@@ -137,7 +137,7 @@ glabel func_8007AE74
/* 07BC68 8007B068 01603825 */ move $a3, $t3
/* 07BC6C 8007B06C 8FA40034 */ lw $a0, 0x34($sp)
/* 07BC70 8007B070 02602825 */ move $a1, $s3
/* 07BC74 8007B074 0C031886 */ jal func_800C6218
/* 07BC74 8007B074 0C031886 */ jal gzip_inflate
/* 07BC78 8007B078 24840020 */ addiu $a0, $a0, 0x20
/* 07BC7C 8007B07C 8FAD003C */ lw $t5, 0x3c($sp)
/* 07BC80 8007B080 00000000 */ nop
+4 -3
View File
@@ -63,8 +63,9 @@ s32 *load_asset_section_from_rom(u32 assetIndex) {
}
#ifdef NON_MATCHING
// Unused.
// This has regalloc & stack issues.
u8 *func_80076CF0(u32 assetIndex, s32 arg1) {
u8 *load_compressed_asset_from_rom(u32 assetIndex, s32 arg1) {
s32 size;
s32 sp2C;
s32 start;
@@ -96,11 +97,11 @@ u8 *func_80076CF0(u32 assetIndex, s32 arg1) {
}
temp_a1 = (temp_v0_3 + sp2C) - size;
dmacopy(temp_a0, temp_a1, size);
func_800C6218(temp_a1, temp_v0_3);
gzip_inflate(temp_a1, temp_v0_3);
return temp_v0_3;
}
#else
GLOBAL_ASM("asm/non_matchings/asset_loading/load_asset_section_from_rom.s")
GLOBAL_ASM("asm/non_matchings/asset_loading/load_compressed_asset_from_rom.s")
#endif
/**
+29
View File
@@ -42,7 +42,36 @@ GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_8005F850.s")
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_8005F99C.s")
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_8005FCD0.s")
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_8005FF40.s")
#if 1
void func_80060058(void *arg0) {
s32 i;
for (i = 0; i < arg0->unk22; i++) {
if (arg0->unk0[i].unk0 != NULL) {
func_8007B2BC(arg0->unk0[i].unk0);
}
}
if (arg0->unkC != NULL) {
free_from_memory_pool(arg0->unkC);
}
if (arg0->unk10 != NULL) {
free_from_memory_pool(arg0->unk10);
}
if (arg0->unk40 != NULL) {
free_from_memory_pool(arg0->unk40);
}
if (arg0->unk44 != NULL) {
for (i = 0; i < arg0->unk48; i++) {
free_from_memory_pool((u8*)arg0->unk44[i] - 4);
}
free_from_memory_pool(arg0->unk44);
}
free_from_memory_pool(arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_80060058.s")
#endif
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_8006017C.s")
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_80060910.s")
GLOBAL_ASM("asm/non_matchings/unknown_05F690/func_80060AC8.s")
+1 -1
View File
@@ -635,7 +635,7 @@ s32 func_800C61DC(s32 arg0, s32 arg1) {
s32 gzip_inflate_block(void);
u8* func_800C6218(u8* arg0, u8* arg1) {
u8* gzip_inflate(u8* arg0, u8* arg1) {
gzip_inflate_input = arg0 + 5; // The compression header is 5 bytes.
gzip_inflate_output = arg1;
gzip_num_bits = 0;