diff --git a/Makefile b/Makefile index 5c53185b..0cba6b44 100755 --- a/Makefile +++ b/Makefile @@ -74,21 +74,23 @@ endif ######## Extract Assets & Microcode ######## -NEED_TO_EXTRACT = no +DUMMY != python3 ./tools/python/check_if_need_to_extract.py $(VERSION) -ifeq ($(wildcard ./assets/.*),) - NEED_TO_EXTRACT = yes -endif -ifeq ($(wildcard ./ucode/.*),) - NEED_TO_EXTRACT = yes -endif - -ifeq ($(NEED_TO_EXTRACT),yes) - DUMMY != ./extract.sh $(VERSION) >&2 || echo FAIL - ifeq ($(DUMMY),FAIL) - $(error Failed to extract assets) - endif -endif +# NEED_TO_EXTRACT = no +# +# ifeq ($(wildcard ./assets/.*),) +# NEED_TO_EXTRACT = yes +# endif +# ifeq ($(wildcard ./ucode/.*),) +# NEED_TO_EXTRACT = yes +# endif +# +# ifeq ($(NEED_TO_EXTRACT),yes) +# DUMMY != ./extract.sh $(VERSION) >&2 || echo FAIL +# ifeq ($(DUMMY),FAIL) +# $(error Failed to extract assets) +# endif +# endif ##### Generate linker file ##### diff --git a/asm/non_matchings/audio/func_8000232C.s b/asm/non_matchings/audio/func_8000232C.s index 8cf865db..477abdb5 100644 --- a/asm/non_matchings/audio/func_8000232C.s +++ b/asm/non_matchings/audio/func_8000232C.s @@ -16,7 +16,7 @@ glabel func_8000232C /* 002F64 80002364 24040027 */ li $a0, 39 /* 002F68 80002368 11C0007B */ beqz $t6, .L80002558 /* 002F6C 8000236C 8FBF0024 */ lw $ra, 0x24($sp) -/* 002F70 80002370 0C01DBBA */ jal func_80076EE8 +/* 002F70 80002370 0C01DBBA */ jal get_rom_offset_of_asset /* 002F74 80002374 00002825 */ move $a1, $zero /* 002F78 80002378 92630000 */ lbu $v1, ($s3) /* 002F7C 8000237C 3C0F8011 */ lui $t7, %hi(ALSeqFile_80115CF8) # $t7, 0x8011 @@ -31,7 +31,7 @@ glabel func_8000232C /* 002FA0 800023A0 8D670000 */ lw $a3, ($t3) /* 002FA4 800023A4 24040027 */ li $a0, 39 /* 002FA8 800023A8 02202825 */ move $a1, $s1 -/* 002FAC 800023AC 0C01DB9A */ jal func_80076E68 +/* 002FAC 800023AC 0C01DB9A */ jal load_asset_to_address /* 002FB0 800023B0 01023023 */ subu $a2, $t0, $v0 /* 002FB4 800023B4 02402025 */ move $a0, $s2 /* 002FB8 800023B8 0C031FFF */ jal alCSeqNew diff --git a/asm/non_matchings/memory/func_80070EF8.s b/asm/non_matchings/memory/allocate_at_address_in_main_pool.s similarity index 99% rename from asm/non_matchings/memory/func_80070EF8.s rename to asm/non_matchings/memory/allocate_at_address_in_main_pool.s index 33ee097a..846d05c5 100644 --- a/asm/non_matchings/memory/func_80070EF8.s +++ b/asm/non_matchings/memory/allocate_at_address_in_main_pool.s @@ -1,4 +1,4 @@ -glabel func_80070EF8 +glabel allocate_at_address_in_main_pool /* 071AF8 80070EF8 27BDFFB8 */ addiu $sp, $sp, -0x48 /* 071AFC 80070EFC AFBF002C */ sw $ra, 0x2c($sp) /* 071B00 80070F00 AFB20028 */ sw $s2, 0x28($sp) diff --git a/asm/non_matchings/memory/func_8007164C.s b/asm/non_matchings/memory/free_memory_pool_slot.s similarity index 99% rename from asm/non_matchings/memory/func_8007164C.s rename to asm/non_matchings/memory/free_memory_pool_slot.s index 117f29d0..7665006f 100644 --- a/asm/non_matchings/memory/func_8007164C.s +++ b/asm/non_matchings/memory/free_memory_pool_slot.s @@ -1,4 +1,4 @@ -glabel func_8007164C +glabel free_memory_pool_slot /* 07224C 8007164C 240A0014 */ li $t2, 20 /* 072250 80071650 00AA0019 */ multu $a1, $t2 /* 072254 80071654 3C0F8012 */ lui $t7, %hi(gMemoryPools) # $t7, 0x8012 diff --git a/asm/non_matchings/memory/func_80071278.s b/asm/non_matchings/memory/free_slot_containing_address.s similarity index 95% rename from asm/non_matchings/memory/func_80071278.s rename to asm/non_matchings/memory/free_slot_containing_address.s index c5bccb0d..d99b2724 100644 --- a/asm/non_matchings/memory/func_80071278.s +++ b/asm/non_matchings/memory/free_slot_containing_address.s @@ -1,7 +1,7 @@ -glabel func_80071278 +glabel free_slot_containing_address /* 071E78 80071278 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 071E7C 8007127C AFBF0014 */ sw $ra, 0x14($sp) -/* 071E80 80071280 0C01C57B */ jal func_800715EC +/* 071E80 80071280 0C01C57B */ jal get_memory_pool_index_containing_address /* 071E84 80071284 AFA40020 */ sw $a0, 0x20($sp) /* 071E88 80071288 00027100 */ sll $t6, $v0, 4 /* 071E8C 8007128C 3C038012 */ lui $v1, %hi(gMemoryPools+8) # $v1, 0x8012 @@ -28,7 +28,7 @@ glabel func_80071278 /* 071EDC 800712DC 8FBF0014 */ lw $ra, 0x14($sp) .L800712E0: /* 071EE0 800712E0 8FA40018 */ lw $a0, 0x18($sp) -/* 071EE4 800712E4 0C01C593 */ jal func_8007164C +/* 071EE4 800712E4 0C01C593 */ jal free_memory_pool_slot /* 071EE8 800712E8 00000000 */ nop /* 071EEC 800712EC 10000006 */ b .L80071308 /* 071EF0 800712F0 8FBF0014 */ lw $ra, 0x14($sp) @@ -79,7 +79,7 @@ glabel func_80071278 /* 071F90 80071390 00000000 */ nop /* 071F94 80071394 16620005 */ bne $s3, $v0, .L800713AC /* 071F98 80071398 00000000 */ nop -/* 071F9C 8007139C 0C01C593 */ jal func_8007164C +/* 071F9C 8007139C 0C01C593 */ jal free_memory_pool_slot /* 071FA0 800713A0 02002825 */ move $a1, $s0 /* 071FA4 800713A4 86220008 */ lh $v0, 8($s1) /* 071FA8 800713A8 00000000 */ nop @@ -90,7 +90,7 @@ glabel func_80071278 /* 071FB8 800713B8 00000000 */ nop /* 071FBC 800713BC 16790005 */ bne $s3, $t9, .L800713D4 /* 071FC0 800713C0 00000000 */ nop -/* 071FC4 800713C4 0C01C593 */ jal func_8007164C +/* 071FC4 800713C4 0C01C593 */ jal free_memory_pool_slot /* 071FC8 800713C8 02002825 */ move $a1, $s0 /* 071FCC 800713CC 10000007 */ b .L800713EC /* 071FD0 800713D0 8630000C */ lh $s0, 0xc($s1) diff --git a/asm/non_matchings/memory/func_80071198.s b/asm/non_matchings/memory/func_80071198.s index 282be2c3..cdfde8bd 100644 --- a/asm/non_matchings/memory/func_80071198.s +++ b/asm/non_matchings/memory/func_80071198.s @@ -5,15 +5,15 @@ glabel func_80071198 /* 071DA4 800711A4 AFB1001C */ sw $s1, 0x1c($sp) /* 071DA8 800711A8 0C01BD44 */ jal func_8006F510 /* 071DAC 800711AC AFB00018 */ sw $s0, 0x18($sp) -/* 071DB0 800711B0 3C118012 */ lui $s1, %hi(D_80123DC8) # $s1, 0x8012 -/* 071DB4 800711B4 26313DC8 */ addiu $s1, %lo(D_80123DC8) # addiu $s1, $s1, 0x3dc8 +/* 071DB0 800711B0 3C118012 */ lui $s1, %hi(gFreeQueueCount) # $s1, 0x8012 +/* 071DB4 800711B4 26313DC8 */ addiu $s1, %lo(gFreeQueueCount) # addiu $s1, $s1, 0x3dc8 /* 071DB8 800711B8 8E230000 */ lw $v1, ($s1) /* 071DBC 800711BC AFA20028 */ sw $v0, 0x28($sp) /* 071DC0 800711C0 18600024 */ blez $v1, .L80071254 -/* 071DC4 800711C4 3C108012 */ lui $s0, %hi(D_801235C8) # $s0, 0x8012 -/* 071DC8 800711C8 3C128012 */ lui $s2, %hi(D_801235C8) # $s2, 0x8012 -/* 071DCC 800711CC 265235C8 */ addiu $s2, %lo(D_801235C8) # addiu $s2, $s2, 0x35c8 -/* 071DD0 800711D0 261035C8 */ addiu $s0, %lo(D_801235C8) # addiu $s0, $s0, 0x35c8 +/* 071DC4 800711C4 3C108012 */ lui $s0, %hi(gFreeQueue) # $s0, 0x8012 +/* 071DC8 800711C8 3C128012 */ lui $s2, %hi(gFreeQueue) # $s2, 0x8012 +/* 071DCC 800711CC 265235C8 */ addiu $s2, %lo(gFreeQueue) # addiu $s2, $s2, 0x35c8 +/* 071DD0 800711D0 261035C8 */ addiu $s0, %lo(gFreeQueue) # addiu $s0, $s0, 0x35c8 .L800711D4: /* 071DD4 800711D4 920E0004 */ lbu $t6, 4($s0) /* 071DD8 800711D8 00000000 */ nop @@ -22,10 +22,10 @@ glabel func_80071198 /* 071DE4 800711E4 17000013 */ bnez $t8, .L80071234 /* 071DE8 800711E8 A20F0004 */ sb $t7, 4($s0) /* 071DEC 800711EC 8E040000 */ lw $a0, ($s0) -/* 071DF0 800711F0 0C01C49E */ jal func_80071278 +/* 071DF0 800711F0 0C01C49E */ jal free_slot_containing_address /* 071DF4 800711F4 00000000 */ nop /* 071DF8 800711F8 8E230000 */ lw $v1, ($s1) -/* 071DFC 800711FC 3C0C8012 */ lui $t4, %hi(D_801235C8) # $t4, 0x8012 +/* 071DFC 800711FC 3C0C8012 */ lui $t4, %hi(gFreeQueue) # $t4, 0x8012 /* 071E00 80071200 0003C8C0 */ sll $t9, $v1, 3 /* 071E04 80071204 02591021 */ addu $v0, $s2, $t9 /* 071E08 80071208 8C48FFF8 */ lw $t0, -8($v0) @@ -33,15 +33,15 @@ glabel func_80071198 /* 071E10 80071210 AE080000 */ sw $t0, ($s0) /* 071E14 80071214 9049FFFC */ lbu $t1, -4($v0) /* 071E18 80071218 000A58C0 */ sll $t3, $t2, 3 -/* 071E1C 8007121C 258C35C8 */ addiu $t4, %lo(D_801235C8) # addiu $t4, $t4, 0x35c8 +/* 071E1C 8007121C 258C35C8 */ addiu $t4, %lo(gFreeQueue) # addiu $t4, $t4, 0x35c8 /* 071E20 80071220 016C2021 */ addu $a0, $t3, $t4 /* 071E24 80071224 AE2A0000 */ sw $t2, ($s1) /* 071E28 80071228 01401825 */ move $v1, $t2 /* 071E2C 8007122C 10000006 */ b .L80071248 /* 071E30 80071230 A2090004 */ sb $t1, 4($s0) .L80071234: -/* 071E34 80071234 3C0E8012 */ lui $t6, %hi(D_801235C8) # $t6, 0x8012 -/* 071E38 80071238 25CE35C8 */ addiu $t6, %lo(D_801235C8) # addiu $t6, $t6, 0x35c8 +/* 071E34 80071234 3C0E8012 */ lui $t6, %hi(gFreeQueue) # $t6, 0x8012 +/* 071E38 80071238 25CE35C8 */ addiu $t6, %lo(gFreeQueue) # addiu $t6, $t6, 0x35c8 /* 071E3C 8007123C 000368C0 */ sll $t5, $v1, 3 /* 071E40 80071240 01AE2021 */ addu $a0, $t5, $t6 /* 071E44 80071244 26100008 */ addiu $s0, $s0, 8 diff --git a/asm/non_matchings/memory/func_80071478.s b/asm/non_matchings/memory/func_80071478.s deleted file mode 100644 index 574bc704..00000000 --- a/asm/non_matchings/memory/func_80071478.s +++ /dev/null @@ -1,54 +0,0 @@ -glabel func_80071478 -/* 072078 80071478 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 07207C 8007147C AFBF001C */ sw $ra, 0x1c($sp) -/* 072080 80071480 AFB00018 */ sw $s0, 0x18($sp) -/* 072084 80071484 0C01BD44 */ jal func_8006F510 -/* 072088 80071488 00808025 */ move $s0, $a0 -/* 07208C 8007148C AFA20020 */ sw $v0, 0x20($sp) -/* 072090 80071490 0C01C57B */ jal func_800715EC -/* 072094 80071494 02002025 */ move $a0, $s0 -/* 072098 80071498 00027100 */ sll $t6, $v0, 4 -/* 07209C 8007149C 3C048012 */ lui $a0, %hi(gMemoryPools+8) # $a0, 0x8012 -/* 0720A0 800714A0 008E2021 */ addu $a0, $a0, $t6 -/* 0720A4 800714A4 8C843588 */ lw $a0, %lo(gMemoryPools+8)($a0) -/* 0720A8 800714A8 00001825 */ move $v1, $zero -/* 0720AC 800714AC 2409FFFF */ li $t1, -1 -/* 0720B0 800714B0 24080004 */ li $t0, 4 -/* 0720B4 800714B4 24070001 */ li $a3, 1 -/* 0720B8 800714B8 24060014 */ li $a2, 20 -.L800714BC: -/* 0720BC 800714BC 00660019 */ multu $v1, $a2 -/* 0720C0 800714C0 00007812 */ mflo $t7 -/* 0720C4 800714C4 01E42821 */ addu $a1, $t7, $a0 -/* 0720C8 800714C8 8CB80000 */ lw $t8, ($a1) -/* 0720CC 800714CC 00000000 */ nop -/* 0720D0 800714D0 1618000D */ bne $s0, $t8, .L80071508 -/* 0720D4 800714D4 00000000 */ nop -/* 0720D8 800714D8 84A20008 */ lh $v0, 8($a1) -/* 0720DC 800714DC 00000000 */ nop -/* 0720E0 800714E0 10E20003 */ beq $a3, $v0, .L800714F0 -/* 0720E4 800714E4 34590002 */ ori $t9, $v0, 2 -/* 0720E8 800714E8 15020007 */ bne $t0, $v0, .L80071508 -/* 0720EC 800714EC 34590002 */ ori $t9, $v0, 2 -.L800714F0: -/* 0720F0 800714F0 A4B90008 */ sh $t9, 8($a1) -/* 0720F4 800714F4 8FA40020 */ lw $a0, 0x20($sp) -/* 0720F8 800714F8 0C01BD4F */ jal func_8006F53C -/* 0720FC 800714FC 00000000 */ nop -/* 072100 80071500 10000009 */ b .L80071528 -/* 072104 80071504 24020001 */ li $v0, 1 -.L80071508: -/* 072108 80071508 84A3000C */ lh $v1, 0xc($a1) -/* 07210C 8007150C 00000000 */ nop -/* 072110 80071510 1469FFEA */ bne $v1, $t1, .L800714BC -/* 072114 80071514 00000000 */ nop -/* 072118 80071518 8FA40020 */ lw $a0, 0x20($sp) -/* 07211C 8007151C 0C01BD4F */ jal func_8006F53C -/* 072120 80071520 00000000 */ nop -/* 072124 80071524 00001025 */ move $v0, $zero -.L80071528: -/* 072128 80071528 8FBF001C */ lw $ra, 0x1c($sp) -/* 07212C 8007152C 8FB00018 */ lw $s0, 0x18($sp) -/* 072130 80071530 03E00008 */ jr $ra -/* 072134 80071534 27BD0030 */ addiu $sp, $sp, 0x30 - diff --git a/asm/non_matchings/memory/func_80071538.s b/asm/non_matchings/memory/func_80071538.s deleted file mode 100644 index b16ec814..00000000 --- a/asm/non_matchings/memory/func_80071538.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_80071538 -/* 072138 80071538 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 07213C 8007153C AFBF0014 */ sw $ra, 0x14($sp) -/* 072140 80071540 0C01BD44 */ jal func_8006F510 -/* 072144 80071544 AFA40028 */ sw $a0, 0x28($sp) -/* 072148 80071548 8FA40028 */ lw $a0, 0x28($sp) -/* 07214C 8007154C 0C01C57B */ jal func_800715EC -/* 072150 80071550 AFA20018 */ sw $v0, 0x18($sp) -/* 072154 80071554 00027100 */ sll $t6, $v0, 4 -/* 072158 80071558 3C048012 */ lui $a0, %hi(gMemoryPools+8) # $a0, 0x8012 -/* 07215C 8007155C 008E2021 */ addu $a0, $a0, $t6 -/* 072160 80071560 8FA70028 */ lw $a3, 0x28($sp) -/* 072164 80071564 8C843588 */ lw $a0, %lo(gMemoryPools+8)($a0) -/* 072168 80071568 00001825 */ move $v1, $zero -/* 07216C 8007156C 2406FFFF */ li $a2, -1 -/* 072170 80071570 24050014 */ li $a1, 20 -.L80071574: -/* 072174 80071574 00650019 */ multu $v1, $a1 -/* 072178 80071578 00007812 */ mflo $t7 -/* 07217C 8007157C 01E41021 */ addu $v0, $t7, $a0 -/* 072180 80071580 8C580000 */ lw $t8, ($v0) -/* 072184 80071584 00000000 */ nop -/* 072188 80071588 14F8000C */ bne $a3, $t8, .L800715BC -/* 07218C 8007158C 00000000 */ nop -/* 072190 80071590 84430008 */ lh $v1, 8($v0) -/* 072194 80071594 00000000 */ nop -/* 072198 80071598 30790002 */ andi $t9, $v1, 2 -/* 07219C 8007159C 13200007 */ beqz $t9, .L800715BC -/* 0721A0 800715A0 38680002 */ xori $t0, $v1, 2 -/* 0721A4 800715A4 A4480008 */ sh $t0, 8($v0) -/* 0721A8 800715A8 8FA40018 */ lw $a0, 0x18($sp) -/* 0721AC 800715AC 0C01BD4F */ jal func_8006F53C -/* 0721B0 800715B0 00000000 */ nop -/* 0721B4 800715B4 10000009 */ b .L800715DC -/* 0721B8 800715B8 24020001 */ li $v0, 1 -.L800715BC: -/* 0721BC 800715BC 8443000C */ lh $v1, 0xc($v0) -/* 0721C0 800715C0 00000000 */ nop -/* 0721C4 800715C4 1466FFEB */ bne $v1, $a2, .L80071574 -/* 0721C8 800715C8 00000000 */ nop -/* 0721CC 800715CC 8FA40018 */ lw $a0, 0x18($sp) -/* 0721D0 800715D0 0C01BD4F */ jal func_8006F53C -/* 0721D4 800715D4 00000000 */ nop -/* 0721D8 800715D8 00001025 */ move $v0, $zero -.L800715DC: -/* 0721DC 800715DC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0721E0 800715E0 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0721E4 800715E4 03E00008 */ jr $ra -/* 0721E8 800715E8 00000000 */ nop - diff --git a/asm/non_matchings/memory/func_800715EC.s b/asm/non_matchings/memory/func_800715EC.s deleted file mode 100644 index 2fb01e1a..00000000 --- a/asm/non_matchings/memory/func_800715EC.s +++ /dev/null @@ -1,29 +0,0 @@ -glabel func_800715EC -/* 0721EC 800715EC 3C038012 */ lui $v1, %hi(gNumberOfMemoryPools) # $v1, 0x8012 -/* 0721F0 800715F0 8C6335C0 */ lw $v1, %lo(gNumberOfMemoryPools)($v1) -/* 0721F4 800715F4 00802825 */ move $a1, $a0 -/* 0721F8 800715F8 18600012 */ blez $v1, .L80071644 -/* 0721FC 800715FC 00037100 */ sll $t6, $v1, 4 -/* 072200 80071600 3C0F8012 */ lui $t7, %hi(gMemoryPools) # $t7, 0x8012 -/* 072204 80071604 25EF3580 */ addiu $t7, %lo(gMemoryPools) # addiu $t7, $t7, 0x3580 -/* 072208 80071608 01CF1021 */ addu $v0, $t6, $t7 -.L8007160C: -/* 07220C 8007160C 8C440008 */ lw $a0, 8($v0) -/* 072210 80071610 00000000 */ nop -/* 072214 80071614 0085082B */ sltu $at, $a0, $a1 -/* 072218 80071618 10200007 */ beqz $at, .L80071638 -/* 07221C 8007161C 00000000 */ nop -/* 072220 80071620 8C58000C */ lw $t8, 0xc($v0) -/* 072224 80071624 00000000 */ nop -/* 072228 80071628 0304C821 */ addu $t9, $t8, $a0 -/* 07222C 8007162C 00B9082B */ sltu $at, $a1, $t9 -/* 072230 80071630 14200004 */ bnez $at, .L80071644 -/* 072234 80071634 00000000 */ nop -.L80071638: -/* 072238 80071638 2463FFFF */ addiu $v1, $v1, -1 -/* 07223C 8007163C 1C60FFF3 */ bgtz $v1, .L8007160C -/* 072240 80071640 2442FFF0 */ addiu $v0, $v0, -0x10 -.L80071644: -/* 072244 80071644 03E00008 */ jr $ra -/* 072248 80071648 00601025 */ move $v0, $v1 - diff --git a/asm/non_matchings/memory/func_80071A24.s b/asm/non_matchings/memory/func_80071A24.s deleted file mode 100644 index 190df96d..00000000 --- a/asm/non_matchings/memory/func_80071A24.s +++ /dev/null @@ -1,242 +0,0 @@ -.rdata -glabel D_800E7528 -.asciz "RED %d\n" -glabel D_800E7530 -.asciz "GREEN %d\n" -.ascii "\0\0" # padding -glabel D_800E753C -.asciz "BLUE %d\n" -.ascii "\0\0\0" # padding -glabel D_800E7548 -.asciz "YELLOW %d\n" -.ascii "\0" # padding -glabel D_800E7554 -.asciz "MAGENTA %d\n" -glabel D_800E7560 -.asciz "CYAN %d\n" -.ascii "\0\0\0" # padding -glabel D_800E756C -.asciz "WHITE %d\n" -.ascii "\0\0" # padding -glabel D_800E7578 -.asciz "GREY %d\n" -.ascii "\0\0\0" # padding -glabel D_800E7584 -.asciz "ORANGE %d\n\n" - -.text -glabel func_80071A24 -/* 072624 80071A24 3C028012 */ lui $v0, %hi(gMemoryPools+8) # $v0, 0x8012 -/* 072628 80071A28 8C423588 */ lw $v0, %lo(gMemoryPools+8)($v0) -/* 07262C 80071A2C 00001825 */ move $v1, $zero -/* 072630 80071A30 00002825 */ move $a1, $zero -/* 072634 80071A34 24060640 */ li $a2, 1600 -.L80071A38: -/* 072638 80071A38 844E0008 */ lh $t6, 8($v0) -/* 07263C 80071A3C 24A50004 */ addiu $a1, $a1, 4 -/* 072640 80071A40 11C00006 */ beqz $t6, .L80071A5C -/* 072644 80071A44 00000000 */ nop -/* 072648 80071A48 8C4F0010 */ lw $t7, 0x10($v0) -/* 07264C 80071A4C 00000000 */ nop -/* 072650 80071A50 148F0002 */ bne $a0, $t7, .L80071A5C -/* 072654 80071A54 00000000 */ nop -/* 072658 80071A58 24630001 */ addiu $v1, $v1, 1 -.L80071A5C: -/* 07265C 80071A5C 8458001C */ lh $t8, 0x1c($v0) -/* 072660 80071A60 24420014 */ addiu $v0, $v0, 0x14 -/* 072664 80071A64 13000006 */ beqz $t8, .L80071A80 -/* 072668 80071A68 00000000 */ nop -/* 07266C 80071A6C 8C590010 */ lw $t9, 0x10($v0) -/* 072670 80071A70 00000000 */ nop -/* 072674 80071A74 14990002 */ bne $a0, $t9, .L80071A80 -/* 072678 80071A78 00000000 */ nop -/* 07267C 80071A7C 24630001 */ addiu $v1, $v1, 1 -.L80071A80: -/* 072680 80071A80 8448001C */ lh $t0, 0x1c($v0) -/* 072684 80071A84 24420014 */ addiu $v0, $v0, 0x14 -/* 072688 80071A88 11000006 */ beqz $t0, .L80071AA4 -/* 07268C 80071A8C 00000000 */ nop -/* 072690 80071A90 8C490010 */ lw $t1, 0x10($v0) -/* 072694 80071A94 00000000 */ nop -/* 072698 80071A98 14890002 */ bne $a0, $t1, .L80071AA4 -/* 07269C 80071A9C 00000000 */ nop -/* 0726A0 80071AA0 24630001 */ addiu $v1, $v1, 1 -.L80071AA4: -/* 0726A4 80071AA4 844A001C */ lh $t2, 0x1c($v0) -/* 0726A8 80071AA8 24420014 */ addiu $v0, $v0, 0x14 -/* 0726AC 80071AAC 11400006 */ beqz $t2, .L80071AC8 -/* 0726B0 80071AB0 00000000 */ nop -/* 0726B4 80071AB4 8C4B0010 */ lw $t3, 0x10($v0) -/* 0726B8 80071AB8 00000000 */ nop -/* 0726BC 80071ABC 148B0002 */ bne $a0, $t3, .L80071AC8 -/* 0726C0 80071AC0 00000000 */ nop -/* 0726C4 80071AC4 24630001 */ addiu $v1, $v1, 1 -.L80071AC8: -/* 0726C8 80071AC8 14A6FFDB */ bne $a1, $a2, .L80071A38 -/* 0726CC 80071ACC 24420014 */ addiu $v0, $v0, 0x14 -/* 0726D0 80071AD0 03E00008 */ jr $ra -/* 0726D4 80071AD4 00601025 */ move $v0, $v1 - -/* 0726D8 80071AD8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0726DC 80071ADC AFBF0014 */ sw $ra, 0x14($sp) -/* 0726E0 80071AE0 3C04FF00 */ lui $a0, (0xFF0000FF >> 16) # lui $a0, 0xff00 -/* 0726E4 80071AE4 0C01C689 */ jal func_80071A24 -/* 0726E8 80071AE8 348400FF */ ori $a0, (0xFF0000FF & 0xFFFF) # ori $a0, $a0, 0xff -/* 0726EC 80071AEC 3C0400FF */ lui $a0, (0x00FF00FF >> 16) # lui $a0, 0xff -/* 0726F0 80071AF0 0C01C689 */ jal func_80071A24 -/* 0726F4 80071AF4 348400FF */ ori $a0, (0x00FF00FF & 0xFFFF) # ori $a0, $a0, 0xff -/* 0726F8 80071AF8 0C01C689 */ jal func_80071A24 -/* 0726FC 80071AFC 3404FFFF */ li $a0, 65535 -/* 072700 80071B00 3C04FFFF */ lui $a0, (0xFFFF00FF >> 16) # lui $a0, 0xffff -/* 072704 80071B04 0C01C689 */ jal func_80071A24 -/* 072708 80071B08 348400FF */ ori $a0, (0xFFFF00FF & 0xFFFF) # ori $a0, $a0, 0xff -/* 07270C 80071B0C 3C04FF00 */ lui $a0, (0xFF00FFFF >> 16) # lui $a0, 0xff00 -/* 072710 80071B10 0C01C689 */ jal func_80071A24 -/* 072714 80071B14 3484FFFF */ ori $a0, (0xFF00FFFF & 0xFFFF) # ori $a0, $a0, 0xffff -/* 072718 80071B18 3C0400FF */ lui $a0, (0x00FFFFFF >> 16) # lui $a0, 0xff -/* 07271C 80071B1C 0C01C689 */ jal func_80071A24 -/* 072720 80071B20 3484FFFF */ ori $a0, (0x00FFFFFF & 0xFFFF) # ori $a0, $a0, 0xffff -/* 072724 80071B24 0C01C689 */ jal func_80071A24 -/* 072728 80071B28 2404FFFF */ li $a0, -1 -/* 07272C 80071B2C 3C047F7F */ lui $a0, (0x7F7F7FFF >> 16) # lui $a0, 0x7f7f -/* 072730 80071B30 0C01C689 */ jal func_80071A24 -/* 072734 80071B34 34847FFF */ ori $a0, (0x7F7F7FFF & 0xFFFF) # ori $a0, $a0, 0x7fff -/* 072738 80071B38 3C04FF7F */ lui $a0, (0xFF7F7FFF >> 16) # lui $a0, 0xff7f -/* 07273C 80071B3C 0C01C689 */ jal func_80071A24 -/* 072740 80071B40 34847FFF */ ori $a0, (0xFF7F7FFF & 0xFFFF) # ori $a0, $a0, 0x7fff -/* 072744 80071B44 8FBF0014 */ lw $ra, 0x14($sp) -/* 072748 80071B48 27BD0018 */ addiu $sp, $sp, 0x18 -/* 07274C 80071B4C 03E00008 */ jr $ra -/* 072750 80071B50 00000000 */ nop - -/* 072754 80071B54 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 072758 80071B58 AFBF0014 */ sw $ra, 0x14($sp) -/* 07275C 80071B5C 00002025 */ move $a0, $zero -/* 072760 80071B60 00002825 */ move $a1, $zero -/* 072764 80071B64 00003025 */ move $a2, $zero -/* 072768 80071B68 0C02D8AD */ jal func_800B62B4 -/* 07276C 80071B6C 24070080 */ li $a3, 128 -/* 072770 80071B70 3C04FF00 */ lui $a0, (0xFF0000FF >> 16) # lui $a0, 0xff00 -/* 072774 80071B74 0C01C689 */ jal func_80071A24 -/* 072778 80071B78 348400FF */ ori $a0, (0xFF0000FF & 0xFFFF) # ori $a0, $a0, 0xff -/* 07277C 80071B7C 3C04800E */ lui $a0, %hi(D_800E7528) # $a0, 0x800e -/* 072780 80071B80 24847528 */ addiu $a0, %lo(D_800E7528) # addiu $a0, $a0, 0x7528 -/* 072784 80071B84 0C02D7B7 */ jal render_printf -/* 072788 80071B88 00402825 */ move $a1, $v0 -/* 07278C 80071B8C 3C0400FF */ lui $a0, (0x00FF00FF >> 16) # lui $a0, 0xff -/* 072790 80071B90 0C01C689 */ jal func_80071A24 -/* 072794 80071B94 348400FF */ ori $a0, (0x00FF00FF & 0xFFFF) # ori $a0, $a0, 0xff -/* 072798 80071B98 3C04800E */ lui $a0, %hi(D_800E7530) # $a0, 0x800e -/* 07279C 80071B9C 24847530 */ addiu $a0, %lo(D_800E7530) # addiu $a0, $a0, 0x7530 -/* 0727A0 80071BA0 0C02D7B7 */ jal render_printf -/* 0727A4 80071BA4 00402825 */ move $a1, $v0 -/* 0727A8 80071BA8 0C01C689 */ jal func_80071A24 -/* 0727AC 80071BAC 3404FFFF */ li $a0, 65535 -/* 0727B0 80071BB0 3C04800E */ lui $a0, %hi(D_800E753C) # $a0, 0x800e -/* 0727B4 80071BB4 2484753C */ addiu $a0, %lo(D_800E753C) # addiu $a0, $a0, 0x753c -/* 0727B8 80071BB8 0C02D7B7 */ jal render_printf -/* 0727BC 80071BBC 00402825 */ move $a1, $v0 -/* 0727C0 80071BC0 3C04FFFF */ lui $a0, (0xFFFF00FF >> 16) # lui $a0, 0xffff -/* 0727C4 80071BC4 0C01C689 */ jal func_80071A24 -/* 0727C8 80071BC8 348400FF */ ori $a0, (0xFFFF00FF & 0xFFFF) # ori $a0, $a0, 0xff -/* 0727CC 80071BCC 3C04800E */ lui $a0, %hi(D_800E7548) # $a0, 0x800e -/* 0727D0 80071BD0 24847548 */ addiu $a0, %lo(D_800E7548) # addiu $a0, $a0, 0x7548 -/* 0727D4 80071BD4 0C02D7B7 */ jal render_printf -/* 0727D8 80071BD8 00402825 */ move $a1, $v0 -/* 0727DC 80071BDC 3C04FF00 */ lui $a0, (0xFF00FFFF >> 16) # lui $a0, 0xff00 -/* 0727E0 80071BE0 0C01C689 */ jal func_80071A24 -/* 0727E4 80071BE4 3484FFFF */ ori $a0, (0xFF00FFFF & 0xFFFF) # ori $a0, $a0, 0xffff -/* 0727E8 80071BE8 3C04800E */ lui $a0, %hi(D_800E7554) # $a0, 0x800e -/* 0727EC 80071BEC 24847554 */ addiu $a0, %lo(D_800E7554) # addiu $a0, $a0, 0x7554 -/* 0727F0 80071BF0 0C02D7B7 */ jal render_printf -/* 0727F4 80071BF4 00402825 */ move $a1, $v0 -/* 0727F8 80071BF8 3C0400FF */ lui $a0, (0x00FFFFFF >> 16) # lui $a0, 0xff -/* 0727FC 80071BFC 0C01C689 */ jal func_80071A24 -/* 072800 80071C00 3484FFFF */ ori $a0, (0x00FFFFFF & 0xFFFF) # ori $a0, $a0, 0xffff -/* 072804 80071C04 3C04800E */ lui $a0, %hi(D_800E7560) # $a0, 0x800e -/* 072808 80071C08 24847560 */ addiu $a0, %lo(D_800E7560) # addiu $a0, $a0, 0x7560 -/* 07280C 80071C0C 0C02D7B7 */ jal render_printf -/* 072810 80071C10 00402825 */ move $a1, $v0 -/* 072814 80071C14 0C01C689 */ jal func_80071A24 -/* 072818 80071C18 2404FFFF */ li $a0, -1 -/* 07281C 80071C1C 3C04800E */ lui $a0, %hi(D_800E756C) # $a0, 0x800e -/* 072820 80071C20 2484756C */ addiu $a0, %lo(D_800E756C) # addiu $a0, $a0, 0x756c -/* 072824 80071C24 0C02D7B7 */ jal render_printf -/* 072828 80071C28 00402825 */ move $a1, $v0 -/* 07282C 80071C2C 3C047F7F */ lui $a0, (0x7F7F7FFF >> 16) # lui $a0, 0x7f7f -/* 072830 80071C30 0C01C689 */ jal func_80071A24 -/* 072834 80071C34 34847FFF */ ori $a0, (0x7F7F7FFF & 0xFFFF) # ori $a0, $a0, 0x7fff -/* 072838 80071C38 3C04800E */ lui $a0, %hi(D_800E7578) # $a0, 0x800e -/* 07283C 80071C3C 24847578 */ addiu $a0, %lo(D_800E7578) # addiu $a0, $a0, 0x7578 -/* 072840 80071C40 0C02D7B7 */ jal render_printf -/* 072844 80071C44 00402825 */ move $a1, $v0 -/* 072848 80071C48 3C04FF7F */ lui $a0, (0xFF7F7FFF >> 16) # lui $a0, 0xff7f -/* 07284C 80071C4C 0C01C689 */ jal func_80071A24 -/* 072850 80071C50 34847FFF */ ori $a0, (0xFF7F7FFF & 0xFFFF) # ori $a0, $a0, 0x7fff -/* 072854 80071C54 3C04800E */ lui $a0, %hi(D_800E7584) # $a0, 0x800e -/* 072858 80071C58 24847584 */ addiu $a0, %lo(D_800E7584) # addiu $a0, $a0, 0x7584 -/* 07285C 80071C5C 0C02D7B7 */ jal render_printf -/* 072860 80071C60 00402825 */ move $a1, $v0 -/* 072864 80071C64 8FBF0014 */ lw $ra, 0x14($sp) -/* 072868 80071C68 27BD0018 */ addiu $sp, $sp, 0x18 -/* 07286C 80071C6C 03E00008 */ jr $ra -/* 072870 80071C70 00000000 */ nop - -/* 072874 80071C74 3C038012 */ lui $v1, %hi(gNumberOfMemoryPools) # $v1, 0x8012 -/* 072878 80071C78 8C6335C0 */ lw $v1, %lo(gNumberOfMemoryPools)($v1) -/* 07287C 80071C7C 3C0E8012 */ lui $t6, %hi(gMemoryPools) # $t6, 0x8012 -/* 072880 80071C80 04600017 */ bltz $v1, .L80071CE0 -/* 072884 80071C84 25C43580 */ addiu $a0, $t6, %lo(gMemoryPools) -/* 072888 80071C88 00037900 */ sll $t7, $v1, 4 -/* 07288C 80071C8C 01E44021 */ addu $t0, $t7, $a0 -/* 072890 80071C90 240C0014 */ li $t4, 20 -/* 072894 80071C94 240BFFFF */ li $t3, -1 -.L80071C98: -/* 072898 80071C98 8C830008 */ lw $v1, 8($a0) -/* 07289C 80071C9C 24840010 */ addiu $a0, $a0, 0x10 -/* 0728A0 80071CA0 00601025 */ move $v0, $v1 -.L80071CA4: -/* 0728A4 80071CA4 84450008 */ lh $a1, 8($v0) -/* 0728A8 80071CA8 8447000C */ lh $a3, 0xc($v0) -/* 0728AC 80071CAC 10A00001 */ beqz $a1, .L80071CB4 -/* 0728B0 80071CB0 00E03025 */ move $a2, $a3 -.L80071CB4: -/* 0728B4 80071CB4 10CB0005 */ beq $a2, $t3, .L80071CCC -/* 0728B8 80071CB8 00000000 */ nop -/* 0728BC 80071CBC 00EC0019 */ multu $a3, $t4 -/* 0728C0 80071CC0 0000C012 */ mflo $t8 -/* 0728C4 80071CC4 00781021 */ addu $v0, $v1, $t8 -/* 0728C8 80071CC8 00000000 */ nop -.L80071CCC: -/* 0728CC 80071CCC 14CBFFF5 */ bne $a2, $t3, .L80071CA4 -/* 0728D0 80071CD0 00000000 */ nop -/* 0728D4 80071CD4 0104082B */ sltu $at, $t0, $a0 -/* 0728D8 80071CD8 1020FFEF */ beqz $at, .L80071C98 -/* 0728DC 80071CDC 00000000 */ nop -.L80071CE0: -/* 0728E0 80071CE0 03E00008 */ jr $ra -/* 0728E4 80071CE4 00000000 */ nop - -/* 0728E8 80071CE8 3C028012 */ lui $v0, %hi(gNumberOfMemoryPools) # $v0, 0x8012 -/* 0728EC 80071CEC 8C4235C0 */ lw $v0, %lo(gNumberOfMemoryPools)($v0) -/* 0728F0 80071CF0 2405FFFF */ li $a1, -1 -/* 0728F4 80071CF4 1045000C */ beq $v0, $a1, .L80071D28 -/* 0728F8 80071CF8 24440001 */ addiu $a0, $v0, 1 -/* 0728FC 80071CFC 308E0003 */ andi $t6, $a0, 3 -/* 072900 80071D00 000E2023 */ negu $a0, $t6 -/* 072904 80071D04 10800005 */ beqz $a0, .L80071D1C -/* 072908 80071D08 00821821 */ addu $v1, $a0, $v0 -.L80071D0C: -/* 07290C 80071D0C 2442FFFF */ addiu $v0, $v0, -1 -/* 072910 80071D10 1462FFFE */ bne $v1, $v0, .L80071D0C -/* 072914 80071D14 00000000 */ nop -/* 072918 80071D18 10450003 */ beq $v0, $a1, .L80071D28 -.L80071D1C: -/* 07291C 80071D1C 2442FFFC */ addiu $v0, $v0, -4 -.L80071D20: -/* 072920 80071D20 1445FFFF */ bne $v0, $a1, .L80071D20 -/* 072924 80071D24 2442FFFC */ addiu $v0, $v0, -4 -.L80071D28: -/* 072928 80071D28 03E00008 */ jr $ra -/* 07292C 80071D2C 00000000 */ nop - diff --git a/asm/non_matchings/memory/func_80071C74.s b/asm/non_matchings/memory/func_80071C74.s new file mode 100644 index 00000000..5ed68067 --- /dev/null +++ b/asm/non_matchings/memory/func_80071C74.s @@ -0,0 +1,37 @@ +# Unused? + +glabel func_80071C74 +/* 072874 80071C74 3C038012 */ lui $v1, %hi(gNumberOfMemoryPools) # $v1, 0x8012 +/* 072878 80071C78 8C6335C0 */ lw $v1, %lo(gNumberOfMemoryPools)($v1) +/* 07287C 80071C7C 3C0E8012 */ lui $t6, %hi(gMemoryPools) # $t6, 0x8012 +/* 072880 80071C80 04600017 */ bltz $v1, .L80071CE0 +/* 072884 80071C84 25C43580 */ addiu $a0, $t6, %lo(gMemoryPools) +/* 072888 80071C88 00037900 */ sll $t7, $v1, 4 +/* 07288C 80071C8C 01E44021 */ addu $t0, $t7, $a0 +/* 072890 80071C90 240C0014 */ li $t4, 20 +/* 072894 80071C94 240BFFFF */ li $t3, -1 +.L80071C98: +/* 072898 80071C98 8C830008 */ lw $v1, 8($a0) +/* 07289C 80071C9C 24840010 */ addiu $a0, $a0, 0x10 +/* 0728A0 80071CA0 00601025 */ move $v0, $v1 +.L80071CA4: +/* 0728A4 80071CA4 84450008 */ lh $a1, 8($v0) +/* 0728A8 80071CA8 8447000C */ lh $a3, 0xc($v0) +/* 0728AC 80071CAC 10A00001 */ beqz $a1, .L80071CB4 +/* 0728B0 80071CB0 00E03025 */ move $a2, $a3 +.L80071CB4: +/* 0728B4 80071CB4 10CB0005 */ beq $a2, $t3, .L80071CCC +/* 0728B8 80071CB8 00000000 */ nop +/* 0728BC 80071CBC 00EC0019 */ multu $a3, $t4 +/* 0728C0 80071CC0 0000C012 */ mflo $t8 +/* 0728C4 80071CC4 00781021 */ addu $v0, $v1, $t8 +/* 0728C8 80071CC8 00000000 */ nop +.L80071CCC: +/* 0728CC 80071CCC 14CBFFF5 */ bne $a2, $t3, .L80071CA4 +/* 0728D0 80071CD0 00000000 */ nop +/* 0728D4 80071CD4 0104082B */ sltu $at, $t0, $a0 +/* 0728D8 80071CD8 1020FFEF */ beqz $at, .L80071C98 +/* 0728DC 80071CDC 00000000 */ nop +.L80071CE0: +/* 0728E0 80071CE0 03E00008 */ jr $ra +/* 0728E4 80071CE4 00000000 */ nop \ No newline at end of file diff --git a/asm/non_matchings/memory/func_80071CE8.s b/asm/non_matchings/memory/func_80071CE8.s new file mode 100644 index 00000000..a1a8bae4 --- /dev/null +++ b/asm/non_matchings/memory/func_80071CE8.s @@ -0,0 +1,25 @@ +# Unused? + +glabel func_80071CE8 +/* 0728E8 80071CE8 3C028012 */ lui $v0, %hi(gNumberOfMemoryPools) # $v0, 0x8012 +/* 0728EC 80071CEC 8C4235C0 */ lw $v0, %lo(gNumberOfMemoryPools)($v0) +/* 0728F0 80071CF0 2405FFFF */ li $a1, -1 +/* 0728F4 80071CF4 1045000C */ beq $v0, $a1, .L80071D28 +/* 0728F8 80071CF8 24440001 */ addiu $a0, $v0, 1 +/* 0728FC 80071CFC 308E0003 */ andi $t6, $a0, 3 +/* 072900 80071D00 000E2023 */ negu $a0, $t6 +/* 072904 80071D04 10800005 */ beqz $a0, .L80071D1C +/* 072908 80071D08 00821821 */ addu $v1, $a0, $v0 +.L80071D0C: +/* 07290C 80071D0C 2442FFFF */ addiu $v0, $v0, -1 +/* 072910 80071D10 1462FFFE */ bne $v1, $v0, .L80071D0C +/* 072914 80071D14 00000000 */ nop +/* 072918 80071D18 10450003 */ beq $v0, $a1, .L80071D28 +.L80071D1C: +/* 07291C 80071D1C 2442FFFC */ addiu $v0, $v0, -4 +.L80071D20: +/* 072920 80071D20 1445FFFF */ bne $v0, $a1, .L80071D20 +/* 072924 80071D24 2442FFFC */ addiu $v0, $v0, -4 +.L80071D28: +/* 072928 80071D28 03E00008 */ jr $ra +/* 07292C 80071D2C 00000000 */ nop \ No newline at end of file diff --git a/asm/non_matchings/memory/get_memory_color_tag_count.s b/asm/non_matchings/memory/get_memory_color_tag_count.s new file mode 100644 index 00000000..c8904487 --- /dev/null +++ b/asm/non_matchings/memory/get_memory_color_tag_count.s @@ -0,0 +1,51 @@ +glabel get_memory_color_tag_count +/* 072624 80071A24 3C028012 */ lui $v0, %hi(gMemoryPools+8) # $v0, 0x8012 +/* 072628 80071A28 8C423588 */ lw $v0, %lo(gMemoryPools+8)($v0) +/* 07262C 80071A2C 00001825 */ move $v1, $zero +/* 072630 80071A30 00002825 */ move $a1, $zero +/* 072634 80071A34 24060640 */ li $a2, 1600 +.L80071A38: +/* 072638 80071A38 844E0008 */ lh $t6, 8($v0) +/* 07263C 80071A3C 24A50004 */ addiu $a1, $a1, 4 +/* 072640 80071A40 11C00006 */ beqz $t6, .L80071A5C +/* 072644 80071A44 00000000 */ nop +/* 072648 80071A48 8C4F0010 */ lw $t7, 0x10($v0) +/* 07264C 80071A4C 00000000 */ nop +/* 072650 80071A50 148F0002 */ bne $a0, $t7, .L80071A5C +/* 072654 80071A54 00000000 */ nop +/* 072658 80071A58 24630001 */ addiu $v1, $v1, 1 +.L80071A5C: +/* 07265C 80071A5C 8458001C */ lh $t8, 0x1c($v0) +/* 072660 80071A60 24420014 */ addiu $v0, $v0, 0x14 +/* 072664 80071A64 13000006 */ beqz $t8, .L80071A80 +/* 072668 80071A68 00000000 */ nop +/* 07266C 80071A6C 8C590010 */ lw $t9, 0x10($v0) +/* 072670 80071A70 00000000 */ nop +/* 072674 80071A74 14990002 */ bne $a0, $t9, .L80071A80 +/* 072678 80071A78 00000000 */ nop +/* 07267C 80071A7C 24630001 */ addiu $v1, $v1, 1 +.L80071A80: +/* 072680 80071A80 8448001C */ lh $t0, 0x1c($v0) +/* 072684 80071A84 24420014 */ addiu $v0, $v0, 0x14 +/* 072688 80071A88 11000006 */ beqz $t0, .L80071AA4 +/* 07268C 80071A8C 00000000 */ nop +/* 072690 80071A90 8C490010 */ lw $t1, 0x10($v0) +/* 072694 80071A94 00000000 */ nop +/* 072698 80071A98 14890002 */ bne $a0, $t1, .L80071AA4 +/* 07269C 80071A9C 00000000 */ nop +/* 0726A0 80071AA0 24630001 */ addiu $v1, $v1, 1 +.L80071AA4: +/* 0726A4 80071AA4 844A001C */ lh $t2, 0x1c($v0) +/* 0726A8 80071AA8 24420014 */ addiu $v0, $v0, 0x14 +/* 0726AC 80071AAC 11400006 */ beqz $t2, .L80071AC8 +/* 0726B0 80071AB0 00000000 */ nop +/* 0726B4 80071AB4 8C4B0010 */ lw $t3, 0x10($v0) +/* 0726B8 80071AB8 00000000 */ nop +/* 0726BC 80071ABC 148B0002 */ bne $a0, $t3, .L80071AC8 +/* 0726C0 80071AC0 00000000 */ nop +/* 0726C4 80071AC4 24630001 */ addiu $v1, $v1, 1 +.L80071AC8: +/* 0726C8 80071AC8 14A6FFDB */ bne $a1, $a2, .L80071A38 +/* 0726CC 80071ACC 24420014 */ addiu $v0, $v0, 0x14 +/* 0726D0 80071AD0 03E00008 */ jr $ra +/* 0726D4 80071AD4 00601025 */ move $v0, $v1 diff --git a/asm/non_matchings/menu/func_8007F900.s b/asm/non_matchings/menu/func_8007F900.s index 0ce18a38..c9169f6b 100644 --- a/asm/non_matchings/menu/func_8007F900.s +++ b/asm/non_matchings/menu/func_8007F900.s @@ -7,7 +7,7 @@ glabel func_8007F900 /* 080514 8007F914 14600009 */ bnez $v1, .L8007F93C /* 080518 8007F918 00802825 */ move $a1, $a0 /* 08051C 8007F91C 24040009 */ li $a0, 9 -/* 080520 8007F920 0C01DB16 */ jal func_80076C58 +/* 080520 8007F920 0C01DB16 */ jal load_asset_section_from_rom /* 080524 8007F924 AFA50018 */ sw $a1, 0x18($sp) /* 080528 8007F928 3C09800E */ lui $t1, %hi(D_800DF49C) # $t1, 0x800e /* 08052C 8007F92C 2529F49C */ addiu $t1, %lo(D_800DF49C) # addiu $t1, $t1, -0xb64 @@ -42,7 +42,7 @@ glabel func_8007F900 /* 080590 8007F990 00E63823 */ subu $a3, $a3, $a2 /* 080594 8007F994 10A00179 */ beqz $a1, .L8007FF7C /* 080598 8007F998 8FBF0014 */ lw $ra, 0x14($sp) -/* 08059C 8007F99C 0C01DB9A */ jal func_80076E68 +/* 08059C 8007F99C 0C01DB9A */ jal load_asset_to_address /* 0805A0 8007F9A0 24040008 */ li $a0, 8 /* 0805A4 8007F9A4 3C09800E */ lui $t1, %hi(D_800DF49C) # $t1, 0x800e /* 0805A8 8007F9A8 2529F49C */ addiu $t1, %lo(D_800DF49C) # addiu $t1, $t1, -0xb64 diff --git a/asm/non_matchings/menu/func_8008AD44.s b/asm/non_matchings/menu/func_8008AD44.s index 5e7a3246..ce601dfc 100644 --- a/asm/non_matchings/menu/func_8008AD44.s +++ b/asm/non_matchings/menu/func_8008AD44.s @@ -80,10 +80,10 @@ glabel func_8008AD44 /* 08BA5C 8008AE5C 00002025 */ move $a0, $zero /* 08BA60 8008AE60 00002825 */ move $a1, $zero /* 08BA64 8008AE64 00003025 */ move $a2, $zero -/* 08BA68 8008AE68 0C02D8AD */ jal func_800B62B4 +/* 08BA68 8008AE68 0C02D8AD */ jal set_render_printf_background_color /* 08BA6C 8008AE6C 24070080 */ li $a3, 128 /* 08BA70 8008AE70 24040020 */ li $a0, 32 -/* 08BA74 8008AE74 0C02D8D7 */ jal func_800B635C +/* 08BA74 8008AE74 0C02D8D7 */ jal set_render_printf_position /* 08BA78 8008AE78 24050088 */ li $a1, 136 /* 08BA7C 8008AE7C 3C05800E */ lui $a1, %hi(D_800E1E14) # $a1, 0x800e /* 08BA80 8008AE80 8CA51E14 */ lw $a1, %lo(D_800E1E14)($a1) diff --git a/asm/non_matchings/menu/func_8009C6D4.s b/asm/non_matchings/menu/func_8009C6D4.s index b68acb9f..84c6f7ec 100644 --- a/asm/non_matchings/menu/func_8009C6D4.s +++ b/asm/non_matchings/menu/func_8009C6D4.s @@ -7,7 +7,7 @@ glabel func_8009C6D4 /* 09D2E8 8009C6E8 14C00026 */ bnez $a2, .L8009C784 /* 09D2EC 8009C6EC 00803825 */ move $a3, $a0 /* 09D2F0 8009C6F0 24040012 */ li $a0, 18 -/* 09D2F4 8009C6F4 0C01DB16 */ jal func_80076C58 +/* 09D2F4 8009C6F4 0C01DB16 */ jal load_asset_section_from_rom /* 09D2F8 8009C6F8 AFA70038 */ sw $a3, 0x38($sp) /* 09D2FC 8009C6FC 3C05800E */ lui $a1, %hi(D_800DF754) # $a1, 0x800e /* 09D300 8009C700 24A5F754 */ addiu $a1, %lo(D_800DF754) # addiu $a1, $a1, -0x8ac diff --git a/asm/non_matchings/unknown_003260/audioNewThread.s b/asm/non_matchings/unknown_003260/audioNewThread.s index 80ec1e15..2c165049 100644 --- a/asm/non_matchings/unknown_003260/audioNewThread.s +++ b/asm/non_matchings/unknown_003260/audioNewThread.s @@ -74,7 +74,7 @@ glabel audioNewThread /* 003374 80002774 24010006 */ li $at, 6 /* 003378 80002778 1701001B */ bne $t8, $at, .L800027E8 /* 00337C 8000277C 00000000 */ nop -/* 003380 80002780 0C01DB16 */ jal func_80076C58 +/* 003380 80002780 0C01DB16 */ jal load_asset_section_from_rom /* 003384 80002784 24040026 */ li $a0, 38 /* 003388 80002788 8C590024 */ lw $t9, 0x24($v0) /* 00338C 8000278C 8C490020 */ lw $t1, 0x20($v0) @@ -88,7 +88,7 @@ glabel audioNewThread /* 0033AC 800027AC 00408825 */ move $s1, $v0 /* 0033B0 800027B0 24040027 */ li $a0, 39 /* 0033B4 800027B4 00402825 */ move $a1, $v0 -/* 0033B8 800027B8 0C01DB9A */ jal func_80076E68 +/* 0033B8 800027B8 0C01DB9A */ jal load_asset_to_address /* 0033BC 800027BC 02003825 */ move $a3, $s0 /* 0033C0 800027C0 3C048011 */ lui $a0, %hi(ALGlobals_801161D0) # $a0, 0x8011 /* 0033C4 800027C4 AE710020 */ sw $s1, 0x20($s3) @@ -200,7 +200,7 @@ glabel audioNewThread /* 003550 80002950 3C0600FF */ lui $a2, (0x00FFFFFF >> 16) # lui $a2, 0xff /* 003554 80002954 34C6FFFF */ ori $a2, (0x00FFFFFF & 0xFFFF) # ori $a2, $a2, 0xffff /* 003558 80002958 01842823 */ subu $a1, $t4, $a0 -/* 00355C 8000295C 0C01C3BE */ jal func_80070EF8 +/* 00355C 8000295C 0C01C3BE */ jal allocate_at_address_in_main_pool /* 003560 80002960 00801025 */ move $v0, $a0 /* 003564 80002964 3C108011 */ lui $s0, %hi(D_80115F98) # $s0, 0x8011 /* 003568 80002968 3C118011 */ lui $s1, %hi(D_80115FA0+4) # $s1, 0x8011 diff --git a/asm/non_matchings/unknown_005740/func_80004B40.s b/asm/non_matchings/unknown_005740/func_80004B40.s index 3e2ca7b4..9107328e 100644 --- a/asm/non_matchings/unknown_005740/func_80004B40.s +++ b/asm/non_matchings/unknown_005740/func_80004B40.s @@ -34,7 +34,7 @@ glabel func_80004B40 /* 0057A4 80004BA4 3C01800E */ lui $at, %hi(D_800DC6D8) # $at, 0x800e /* 0057A8 80004BA8 AC20C6D8 */ sw $zero, %lo(D_800DC6D8)($at) .L80004BAC: -/* 0057AC 80004BAC 0C01DB16 */ jal func_80076C58 +/* 0057AC 80004BAC 0C01DB16 */ jal load_asset_section_from_rom /* 0057B0 80004BB0 24040026 */ li $a0, 38 /* 0057B4 80004BB4 0013B080 */ sll $s6, $s3, 2 /* 0057B8 80004BB8 02D3B021 */ addu $s6, $s6, $s3 @@ -57,7 +57,7 @@ glabel func_80004B40 /* 0057FC 80004BFC 24040027 */ li $a0, 39 /* 005800 80004C00 00402825 */ move $a1, $v0 /* 005804 80004C04 02203025 */ move $a2, $s1 -/* 005808 80004C08 0C01DB9A */ jal func_80076E68 +/* 005808 80004C08 0C01DB9A */ jal load_asset_to_address /* 00580C 80004C0C 2407004C */ li $a3, 76 /* 005810 80004C10 240400E0 */ li $a0, 224 /* 005814 80004C14 0C01C327 */ jal allocate_from_main_pool_safe diff --git a/asm/non_matchings/unknown_00BC20/func_8000C718.s b/asm/non_matchings/unknown_00BC20/func_8000C718.s index 72e0ce2a..42eac649 100644 --- a/asm/non_matchings/unknown_00BC20/func_8000C718.s +++ b/asm/non_matchings/unknown_00BC20/func_8000C718.s @@ -37,7 +37,7 @@ glabel func_8000C718 /* 00D3A0 8000C7A0 10400021 */ beqz $v0, .L8000C828 /* 00D3A4 8000C7A4 00402825 */ move $a1, $v0 /* 00D3A8 8000C7A8 24040022 */ li $a0, 34 -/* 00D3AC 8000C7AC 0C01DB9A */ jal func_80076E68 +/* 00D3AC 8000C7AC 0C01DB9A */ jal load_asset_to_address /* 00D3B0 8000C7B0 AFA2001C */ sw $v0, 0x1c($sp) /* 00D3B4 8000C7B4 8FA5001C */ lw $a1, 0x1c($sp) /* 00D3B8 8000C7B8 00000000 */ nop diff --git a/asm/non_matchings/unknown_00BC20/func_8000C8F8.s b/asm/non_matchings/unknown_00BC20/func_8000C8F8.s index 5c1c59fc..08e34197 100644 --- a/asm/non_matchings/unknown_00BC20/func_8000C8F8.s +++ b/asm/non_matchings/unknown_00BC20/func_8000C8F8.s @@ -75,7 +75,7 @@ glabel func_8000C8F8 /* 00D60C 8000CA0C AFA20048 */ sw $v0, 0x48($sp) /* 00D610 8000CA10 AFA50028 */ sw $a1, 0x28($sp) /* 00D614 8000CA14 24040014 */ li $a0, 20 -/* 00D618 8000CA18 0C01DB16 */ jal func_80076C58 +/* 00D618 8000CA18 0C01DB16 */ jal load_asset_section_from_rom /* 00D61C 8000CA1C AC38AEA8 */ sw $t8, %lo(D_8011AEA8)($at) /* 00D620 8000CA20 8C590000 */ lw $t9, ($v0) /* 00D624 8000CA24 2405FFFF */ li $a1, -1 @@ -116,7 +116,7 @@ glabel func_8000C8F8 /* 00D6A4 8000CAA4 24A50020 */ addiu $a1, $a1, 0x20 /* 00D6A8 8000CAA8 AFA50034 */ sw $a1, 0x34($sp) /* 00D6AC 8000CAAC 24040015 */ li $a0, 21 -/* 00D6B0 8000CAB0 0C01DB9A */ jal func_80076E68 +/* 00D6B0 8000CAB0 0C01DB9A */ jal load_asset_to_address /* 00D6B4 8000CAB4 02003025 */ move $a2, $s0 /* 00D6B8 8000CAB8 8FA40034 */ lw $a0, 0x34($sp) /* 00D6BC 8000CABC 8FA50048 */ lw $a1, 0x48($sp) diff --git a/asm/non_matchings/unknown_00BC20/func_80017E98.s b/asm/non_matchings/unknown_00BC20/func_80017E98.s index 65ac2762..c6c1cc22 100644 --- a/asm/non_matchings/unknown_00BC20/func_80017E98.s +++ b/asm/non_matchings/unknown_00BC20/func_80017E98.s @@ -154,7 +154,7 @@ glabel func_80017E98 /* 018CD4 800180D4 1120000A */ beqz $t1, .L80018100 /* 018CD8 800180D8 AC39AED0 */ sw $t9, %lo(D_8011AED0)($at) /* 018CDC 800180DC 24040014 */ li $a0, 20 -/* 018CE0 800180E0 0C02D8D7 */ jal func_800B635C +/* 018CE0 800180E0 0C02D8D7 */ jal set_render_printf_position /* 018CE4 800180E4 240500DC */ li $a1, 220 /* 018CE8 800180E8 3C04800E */ lui $a0, %hi(D_800E50D4) # $a0, 0x800e /* 018CEC 800180EC 248450D4 */ addiu $a0, %lo(D_800E50D4) # addiu $a0, $a0, 0x50d4 diff --git a/asm/non_matchings/unknown_00BC20/func_8001B2F0.s b/asm/non_matchings/unknown_00BC20/func_8001B2F0.s index cc3f9127..801dd597 100644 --- a/asm/non_matchings/unknown_00BC20/func_8001B2F0.s +++ b/asm/non_matchings/unknown_00BC20/func_8001B2F0.s @@ -6,7 +6,7 @@ glabel func_8001B2F0 /* 01BF00 8001B300 3C058012 */ lui $a1, %hi(D_8011AE84) # $a1, 0x8012 /* 01BF04 8001B304 24A5AE84 */ addiu $a1, %lo(D_8011AE84) # addiu $a1, $a1, -0x517c /* 01BF08 8001B308 A4A20000 */ sh $v0, ($a1) -/* 01BF0C 8001B30C 0C01DB16 */ jal func_80076C58 +/* 01BF0C 8001B30C 0C01DB16 */ jal load_asset_section_from_rom /* 01BF10 8001B310 24040030 */ li $a0, 48 /* 01BF14 8001B314 3C058012 */ lui $a1, %hi(D_8011AE84) # $a1, 0x8012 /* 01BF18 8001B318 8FA60028 */ lw $a2, 0x28($sp) diff --git a/asm/non_matchings/unknown_0255E0/func_8002C0C4.s b/asm/non_matchings/unknown_0255E0/func_8002C0C4.s index d54a8ff7..198777d9 100644 --- a/asm/non_matchings/unknown_0255E0/func_8002C0C4.s +++ b/asm/non_matchings/unknown_0255E0/func_8002C0C4.s @@ -43,7 +43,7 @@ glabel func_8002C0C4 /* 02CD50 8002C150 AC22D374 */ sw $v0, %lo(D_8011D374)($at) /* 02CD54 8002C154 3C018012 */ lui $at, %hi(D_8011D378) # $at, 0x8012 /* 02CD58 8002C158 AC20D378 */ sw $zero, %lo(D_8011D378)($at) -/* 02CD5C 8002C15C 0C01DB16 */ jal func_80076C58 +/* 02CD5C 8002C15C 0C01DB16 */ jal load_asset_section_from_rom /* 02CD60 8002C160 2404001A */ li $a0, 26 /* 02CD64 8002C164 3C148012 */ lui $s4, %hi(D_8011D310) # $s4, 0x8012 /* 02CD68 8002C168 2694D310 */ addiu $s4, %lo(D_8011D310) # addiu $s4, $s4, -0x2cf0 @@ -81,7 +81,7 @@ glabel func_8002C0C4 .L8002C1DC: /* 02CDDC 8002C1DC 020F8023 */ subu $s0, $s0, $t7 /* 02CDE0 8002C1E0 02002825 */ move $a1, $s0 -/* 02CDE4 8002C1E4 0C01DB9A */ jal func_80076E68 +/* 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 @@ -301,7 +301,7 @@ glabel func_8002C0C4 /* 02D12C 8002C52C 8CA5D30C */ lw $a1, %lo(D_8011D30C)($a1) /* 02D130 8002C530 3C06FFFF */ lui $a2, (0xFFFF00FF >> 16) # lui $a2, 0xffff /* 02D134 8002C534 34C600FF */ ori $a2, (0xFFFF00FF & 0xFFFF) # ori $a2, $a2, 0xff -/* 02D138 8002C538 0C01C3BE */ jal func_80070EF8 +/* 02D138 8002C538 0C01C3BE */ jal allocate_at_address_in_main_pool /* 02D13C 8002C53C 02602025 */ move $a0, $s3 /* 02D140 8002C540 0C01C42C */ jal func_800710B0 /* 02D144 8002C544 24040002 */ li $a0, 2 diff --git a/asm/non_matchings/unknown_043920/func_8004DE38.s b/asm/non_matchings/unknown_043920/func_8004DE38.s index 8b059dd6..12c42ff6 100644 --- a/asm/non_matchings/unknown_043920/func_8004DE38.s +++ b/asm/non_matchings/unknown_043920/func_8004DE38.s @@ -252,7 +252,7 @@ glabel func_8004DE38 .L8004E168: /* 04ED68 8004E168 00002825 */ move $a1, $zero /* 04ED6C 8004E16C 00003025 */ move $a2, $zero -/* 04ED70 8004E170 0C02D8AD */ jal func_800B62B4 +/* 04ED70 8004E170 0C02D8AD */ jal set_render_printf_background_color /* 04ED74 8004E174 24070080 */ li $a3, 128 /* 04ED78 8004E178 0C008D07 */ jal func_8002341C /* 04ED7C 8004E17C 00000000 */ nop diff --git a/asm/non_matchings/unknown_043920/func_80059A68.s b/asm/non_matchings/unknown_043920/func_80059A68.s index 92c5a39f..0b299f71 100644 --- a/asm/non_matchings/unknown_043920/func_80059A68.s +++ b/asm/non_matchings/unknown_043920/func_80059A68.s @@ -14,7 +14,7 @@ glabel func_80059A68 /* 05A698 80059A98 8FA60028 */ lw $a2, 0x28($sp) /* 05A69C 80059A9C 8FA7002C */ lw $a3, 0x2c($sp) /* 05A6A0 80059AA0 24040031 */ li $a0, 49 -/* 05A6A4 80059AA4 0C01DB9A */ jal func_80076E68 +/* 05A6A4 80059AA4 0C01DB9A */ jal load_asset_to_address /* 05A6A8 80059AA8 00402825 */ move $a1, $v0 /* 05A6AC 80059AAC 3C038012 */ lui $v1, %hi(D_8011D590) # $v1, 0x8012 /* 05A6B0 80059AB0 2463D590 */ addiu $v1, %lo(D_8011D590) # addiu $v1, $v1, -0x2a70 diff --git a/asm/non_matchings/unknown_05F690/func_8005F850.s b/asm/non_matchings/unknown_05F690/func_8005F850.s index 3508edb0..f3ac26ad 100644 --- a/asm/non_matchings/unknown_05F690/func_8005F850.s +++ b/asm/non_matchings/unknown_05F690/func_8005F850.s @@ -17,7 +17,7 @@ glabel func_8005F850 /* 06048C 8005F88C AC20D62C */ sw $zero, %lo(D_8011D62C)($at) /* 060490 8005F890 3C018012 */ lui $at, %hi(D_8011D634) # $at, 0x8012 /* 060494 8005F894 AC20D634 */ sw $zero, %lo(D_8011D634)($at) -/* 060498 8005F898 0C01DB16 */ jal func_80076C58 +/* 060498 8005F898 0C01DB16 */ jal load_asset_section_from_rom /* 06049C 8005F89C 2404001C */ li $a0, 28 /* 0604A0 8005F8A0 3C058012 */ lui $a1, %hi(D_8011D630) # $a1, 0x8012 /* 0604A4 8005F8A4 3C078012 */ lui $a3, %hi(D_8011D620) # $a3, 0x8012 @@ -44,11 +44,11 @@ glabel func_8005F850 .L8005F8F4: /* 0604F4 8005F8F4 246BFFFF */ addiu $t3, $v1, -1 /* 0604F8 8005F8F8 ACAB0000 */ sw $t3, ($a1) -/* 0604FC 8005F8FC 0C01DB16 */ jal func_80076C58 +/* 0604FC 8005F8FC 0C01DB16 */ jal load_asset_section_from_rom /* 060500 8005F900 2404001E */ li $a0, 30 /* 060504 8005F904 3C018012 */ lui $at, %hi(D_8011D638) # $at, 0x8012 /* 060508 8005F908 AC22D638 */ sw $v0, %lo(D_8011D638)($at) -/* 06050C 8005F90C 0C01DB16 */ jal func_80076C58 +/* 06050C 8005F90C 0C01DB16 */ jal load_asset_section_from_rom /* 060510 8005F910 2404001F */ li $a0, 31 /* 060514 8005F914 3C018012 */ lui $at, %hi(D_8011D63C) # $at, 0x8012 /* 060518 8005F918 3C0500FF */ lui $a1, (0x00FF00FF >> 16) # lui $a1, 0xff diff --git a/asm/non_matchings/unknown_05F690/func_8005F99C.s b/asm/non_matchings/unknown_05F690/func_8005F99C.s index 8b75f5a2..cd971863 100644 --- a/asm/non_matchings/unknown_05F690/func_8005F99C.s +++ b/asm/non_matchings/unknown_05F690/func_8005F99C.s @@ -91,7 +91,7 @@ glabel func_8005F99C /* 0606E0 8005FAE0 AFA50030 */ sw $a1, 0x30($sp) /* 0606E4 8005FAE4 2404001D */ li $a0, 29 /* 0606E8 8005FAE8 02003025 */ move $a2, $s0 -/* 0606EC 8005FAEC 0C01DB9A */ jal func_80076E68 +/* 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 diff --git a/asm/non_matchings/unknown_05F690/func_80061A00.s b/asm/non_matchings/unknown_05F690/func_80061A00.s index adaebaf3..897ad4a4 100644 --- a/asm/non_matchings/unknown_05F690/func_80061A00.s +++ b/asm/non_matchings/unknown_05F690/func_80061A00.s @@ -101,7 +101,7 @@ glabel func_80061A00 /* 06276C 80061B6C 0017C080 */ sll $t8, $s7, 2 /* 062770 80061B70 0300B825 */ move $s7, $t8 /* 062774 80061B74 02002825 */ move $a1, $s0 -/* 062778 80061B78 0C01DB9A */ jal func_80076E68 +/* 062778 80061B78 0C01DB9A */ jal load_asset_to_address /* 06277C 80061B7C 24040020 */ li $a0, 32 /* 062780 80061B80 8EB90044 */ lw $t9, 0x44($s5) /* 062784 80061B84 02002025 */ move $a0, $s0 diff --git a/asm/non_matchings/unknown_066AA0/func_8006A6B0.s b/asm/non_matchings/unknown_066AA0/func_8006A6B0.s index e97dfecd..0eccc382 100644 --- a/asm/non_matchings/unknown_066AA0/func_8006A6B0.s +++ b/asm/non_matchings/unknown_066AA0/func_8006A6B0.s @@ -10,7 +10,7 @@ glabel func_8006A6B0 /* 06B2D0 8006A6D0 0C01C327 */ jal allocate_from_main_pool_safe /* 06B2D4 8006A6D4 240400C4 */ li $a0, 196 /* 06B2D8 8006A6D8 AFA20044 */ sw $v0, 0x44($sp) -/* 06B2DC 8006A6DC 0C01DB16 */ jal func_80076C58 +/* 06B2DC 8006A6DC 0C01DB16 */ jal load_asset_section_from_rom /* 06B2E0 8006A6E0 24040016 */ li $a0, 22 /* 06B2E4 8006A6E4 3C138012 */ lui $s3, %hi(D_80121160) # $s3, 0x8012 /* 06B2E8 8006A6E8 26731160 */ addiu $s3, %lo(D_80121160) # addiu $s3, $s3, 0x1160 @@ -79,7 +79,7 @@ glabel func_8006A6B0 /* 06B3D4 8006A7D4 8DC60000 */ lw $a2, ($t6) /* 06B3D8 8006A7D8 AFA3002C */ sw $v1, 0x2c($sp) /* 06B3DC 8006A7DC 24040017 */ li $a0, 23 -/* 06B3E0 8006A7E0 0C01DB9A */ jal func_80076E68 +/* 06B3E0 8006A7E0 0C01DB9A */ jal load_asset_to_address /* 06B3E4 8006A7E4 240700C4 */ li $a3, 196 /* 06B3E8 8006A7E8 8E050000 */ lw $a1, ($s0) /* 06B3EC 8006A7EC 3C098012 */ lui $t1, %hi(D_80121174) # $t1, 0x8012 @@ -211,7 +211,7 @@ glabel func_8006A6B0 /* 06B5C4 8006A9C4 8FA40044 */ lw $a0, 0x44($sp) /* 06B5C8 8006A9C8 0C01C450 */ jal func_80071140 /* 06B5CC 8006A9CC 00000000 */ nop -/* 06B5D0 8006A9D0 0C01DB16 */ jal func_80076C58 +/* 06B5D0 8006A9D0 0C01DB16 */ jal load_asset_section_from_rom /* 06B5D4 8006A9D4 24040018 */ li $a0, 24 /* 06B5D8 8006A9D8 AE620000 */ sw $v0, ($s3) /* 06B5DC 8006A9DC 8C460000 */ lw $a2, ($v0) @@ -246,7 +246,7 @@ glabel func_8006A6B0 /* 06B648 8006AA48 AE020000 */ sw $v0, ($s0) /* 06B64C 8006AA4C 24040019 */ li $a0, 25 /* 06B650 8006AA50 00402825 */ move $a1, $v0 -/* 06B654 8006AA54 0C01DB9A */ jal func_80076E68 +/* 06B654 8006AA54 0C01DB9A */ jal load_asset_to_address /* 06B658 8006AA58 00003025 */ move $a2, $zero /* 06B65C 8006AA5C 3C038012 */ lui $v1, %hi(D_8012116C) # $v1, 0x8012 /* 06B660 8006AA60 2463116C */ addiu $v1, %lo(D_8012116C) # addiu $v1, $v1, 0x116c diff --git a/asm/non_matchings/unknown_066AA0/func_8006BFC8.s b/asm/non_matchings/unknown_066AA0/func_8006BFC8.s index 27da0a08..50602948 100644 --- a/asm/non_matchings/unknown_066AA0/func_8006BFC8.s +++ b/asm/non_matchings/unknown_066AA0/func_8006BFC8.s @@ -58,7 +58,7 @@ glabel func_8006BFC8 /* 06CC90 8006C090 00000000 */ nop /* 06CC94 8006C094 24100005 */ li $s0, 5 .L8006C098: -/* 06CC98 8006C098 0C01DB16 */ jal func_80076C58 +/* 06CC98 8006C098 0C01DB16 */ jal load_asset_section_from_rom /* 06CC9C 8006C09C 24040001 */ li $a0, 1 /* 06CCA0 8006C0A0 3C088012 */ lui $t0, %hi(D_80121160) # $t0, 0x8012 /* 06CCA4 8006C0A4 25081160 */ addiu $t0, %lo(D_80121160) # addiu $t0, $t0, 0x1160 @@ -102,7 +102,7 @@ glabel func_8006BFC8 /* 06CD30 8006C130 8FA60020 */ lw $a2, 0x20($sp) /* 06CD34 8006C134 AC620000 */ sw $v0, ($v1) /* 06CD38 8006C138 00002025 */ move $a0, $zero -/* 06CD3C 8006C13C 0C01DB9A */ jal func_80076E68 +/* 06CD3C 8006C13C 0C01DB9A */ jal load_asset_to_address /* 06CD40 8006C140 00402825 */ move $a1, $v0 /* 06CD44 8006C144 3C048012 */ lui $a0, %hi(D_80121160) # $a0, 0x8012 /* 06CD48 8006C148 8C841160 */ lw $a0, %lo(D_80121160)($a0) diff --git a/asm/non_matchings/unknown_066AA0/func_8006ECFC.s b/asm/non_matchings/unknown_066AA0/func_8006ECFC.s index 4a8e1ccc..8244f16d 100644 --- a/asm/non_matchings/unknown_066AA0/func_8006ECFC.s +++ b/asm/non_matchings/unknown_066AA0/func_8006ECFC.s @@ -54,13 +54,13 @@ glabel func_8006ECFC /* 06F9CC 8006EDCC AFA90020 */ sw $t1, 0x20($sp) /* 06F9D0 8006EDD0 AFA70028 */ sw $a3, 0x28($sp) /* 06F9D4 8006EDD4 AFA3002C */ sw $v1, 0x2c($sp) -/* 06F9D8 8006EDD8 0C01C3BE */ jal func_80070EF8 +/* 06F9D8 8006EDD8 0C01C3BE */ jal allocate_at_address_in_main_pool /* 06F9DC 8006EDDC AFA80024 */ sw $t0, 0x24($sp) /* 06F9E0 8006EDE0 8E250004 */ lw $a1, 4($s1) /* 06F9E4 8006EDE4 3C06FFFF */ lui $a2, (0xFFFF00FF >> 16) # lui $a2, 0xffff /* 06F9E8 8006EDE8 AE220000 */ sw $v0, ($s1) /* 06F9EC 8006EDEC 34C600FF */ ori $a2, (0xFFFF00FF & 0xFFFF) # ori $a2, $a2, 0xff -/* 06F9F0 8006EDF0 0C01C3BE */ jal func_80070EF8 +/* 06F9F0 8006EDF0 0C01C3BE */ jal allocate_at_address_in_main_pool /* 06F9F4 8006EDF4 02002025 */ move $a0, $s0 /* 06F9F8 8006EDF8 8E300000 */ lw $s0, ($s1) /* 06F9FC 8006EDFC AE220004 */ sw $v0, 4($s1) diff --git a/asm/non_matchings/unknown_066AA0/load_level.s b/asm/non_matchings/unknown_066AA0/load_level.s index cd329d1b..aea2bd0d 100644 --- a/asm/non_matchings/unknown_066AA0/load_level.s +++ b/asm/non_matchings/unknown_066AA0/load_level.s @@ -48,7 +48,7 @@ glabel load_level /* 06BEF0 8006B2F0 0C01BAA4 */ jal get_settings /* 06BEF4 8006B2F4 00000000 */ nop /* 06BEF8 8006B2F8 AFA20040 */ sw $v0, 0x40($sp) -/* 06BEFC 8006B2FC 0C01DB16 */ jal func_80076C58 +/* 06BEFC 8006B2FC 0C01DB16 */ jal load_asset_section_from_rom /* 06BF00 8006B300 24040016 */ li $a0, 22 /* 06BF04 8006B304 3C098012 */ lui $t1, %hi(D_80121160) # $t1, 0x8012 /* 06BF08 8006B308 25291160 */ addiu $t1, %lo(D_80121160) # addiu $t1, $t1, 0x1160 @@ -87,7 +87,7 @@ glabel load_level /* 06BF80 8006B380 AE220000 */ sw $v0, ($s1) /* 06BF84 8006B384 24040017 */ li $a0, 23 /* 06BF88 8006B388 00402825 */ move $a1, $v0 -/* 06BF8C 8006B38C 0C01DB9A */ jal func_80076E68 +/* 06BF8C 8006B38C 0C01DB9A */ jal load_asset_to_address /* 06BF90 8006B390 02003025 */ move $a2, $s0 /* 06BF94 8006B394 3C01800E */ lui $at, %hi(D_800DD330) # $at, 0x800e /* 06BF98 8006B398 8FB80060 */ lw $t8, 0x60($sp) @@ -294,7 +294,7 @@ glabel load_level /* 06C284 8006B684 AE220000 */ sw $v0, ($s1) /* 06C288 8006B688 24040017 */ li $a0, 23 /* 06C28C 8006B68C 00402825 */ move $a1, $v0 -/* 06C290 8006B690 0C01DB9A */ jal func_80076E68 +/* 06C290 8006B690 0C01DB9A */ jal load_asset_to_address /* 06C294 8006B694 02003025 */ move $a2, $s0 .L8006B698: /* 06C298 8006B698 3C048012 */ lui $a0, %hi(D_80121160) # $a0, 0x8012 diff --git a/asm/non_matchings/unknown_072E50/func_80076C58.s b/asm/non_matchings/unknown_072E50/func_80076C58.s deleted file mode 100644 index e748775d..00000000 --- a/asm/non_matchings/unknown_072E50/func_80076C58.s +++ /dev/null @@ -1,144 +0,0 @@ -glabel func_80076C58 -/* 077858 80076C58 3C038012 */ lui $v1, %hi(D_80124290) # $v1, 0x8012 -/* 07785C 80076C5C 8C634290 */ lw $v1, %lo(D_80124290)($v1) -/* 077860 80076C60 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 077864 80076C64 AFBF0014 */ sw $ra, 0x14($sp) -/* 077868 80076C68 8C6E0000 */ lw $t6, ($v1) -/* 07786C 80076C6C 00803025 */ move $a2, $a0 -/* 077870 80076C70 01C4082B */ sltu $at, $t6, $a0 -/* 077874 80076C74 10200003 */ beqz $at, .L80076C84 -/* 077878 80076C78 24C60001 */ addiu $a2, $a2, 1 -/* 07787C 80076C7C 10000018 */ b .L80076CE0 -/* 077880 80076C80 00001025 */ move $v0, $zero -.L80076C84: -/* 077884 80076C84 00067880 */ sll $t7, $a2, 2 -/* 077888 80076C88 01E31021 */ addu $v0, $t7, $v1 -/* 07788C 80076C8C 8C470000 */ lw $a3, ($v0) -/* 077890 80076C90 8C580004 */ lw $t8, 4($v0) -/* 077894 80076C94 3C057F7F */ lui $a1, (0x7F7F7FFF >> 16) # lui $a1, 0x7f7f -/* 077898 80076C98 03072023 */ subu $a0, $t8, $a3 -/* 07789C 80076C9C AFA4001C */ sw $a0, 0x1c($sp) -/* 0778A0 80076CA0 34A57FFF */ ori $a1, (0x7F7F7FFF & 0xFFFF) # ori $a1, $a1, 0x7fff -/* 0778A4 80076CA4 0C01C327 */ jal allocate_from_main_pool_safe -/* 0778A8 80076CA8 AFA70018 */ sw $a3, 0x18($sp) -/* 0778AC 80076CAC 8FA70018 */ lw $a3, 0x18($sp) -/* 0778B0 80076CB0 14400003 */ bnez $v0, .L80076CC0 -/* 0778B4 80076CB4 00402825 */ move $a1, $v0 -/* 0778B8 80076CB8 10000009 */ b .L80076CE0 -/* 0778BC 80076CBC 00001025 */ move $v0, $zero -.L80076CC0: -/* 0778C0 80076CC0 3C19000F */ lui $t9, %hi(__ASSETS_LUT_END) # $t9, 0xf -/* 0778C4 80076CC4 2739CC30 */ addiu $t9, %lo(__ASSETS_LUT_END) # addiu $t9, $t9, -0x33d0 -/* 0778C8 80076CC8 8FA6001C */ lw $a2, 0x1c($sp) -/* 0778CC 80076CCC 00F92021 */ addu $a0, $a3, $t9 -/* 0778D0 80076CD0 0C01DBDE */ jal dmacopy -/* 0778D4 80076CD4 AFA50020 */ sw $a1, 0x20($sp) -/* 0778D8 80076CD8 8FA20020 */ lw $v0, 0x20($sp) -/* 0778DC 80076CDC 00000000 */ nop -.L80076CE0: -/* 0778E0 80076CE0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0778E4 80076CE4 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0778E8 80076CE8 03E00008 */ jr $ra -/* 0778EC 80076CEC 00000000 */ nop - -/* 0778F0 80076CF0 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0778F4 80076CF4 3C028012 */ lui $v0, %hi(D_80124290) # $v0, 0x8012 -/* 0778F8 80076CF8 8C424290 */ lw $v0, %lo(D_80124290)($v0) -/* 0778FC 80076CFC AFBF0014 */ sw $ra, 0x14($sp) -/* 077900 80076D00 AFA5003C */ sw $a1, 0x3c($sp) -/* 077904 80076D04 8C4E0000 */ lw $t6, ($v0) -/* 077908 80076D08 00803025 */ move $a2, $a0 -/* 07790C 80076D0C 01C4082B */ sltu $at, $t6, $a0 -/* 077910 80076D10 10200003 */ beqz $at, .L80076D20 -/* 077914 80076D14 24C60001 */ addiu $a2, $a2, 1 -/* 077918 80076D18 10000034 */ b .L80076DEC -/* 07791C 80076D1C 00001025 */ move $v0, $zero -.L80076D20: -/* 077920 80076D20 00067880 */ sll $t7, $a2, 2 -/* 077924 80076D24 01E23821 */ addu $a3, $t7, $v0 -/* 077928 80076D28 8CE30000 */ lw $v1, ($a3) -/* 07792C 80076D2C 8CF80004 */ lw $t8, 4($a3) -/* 077930 80076D30 24040008 */ li $a0, 8 -/* 077934 80076D34 0303C823 */ subu $t9, $t8, $v1 -/* 077938 80076D38 AFB90034 */ sw $t9, 0x34($sp) -/* 07793C 80076D3C 2405FFFF */ li $a1, -1 -/* 077940 80076D40 0C01C327 */ jal allocate_from_main_pool_safe -/* 077944 80076D44 AFA30030 */ sw $v1, 0x30($sp) -/* 077948 80076D48 8FA30030 */ lw $v1, 0x30($sp) -/* 07794C 80076D4C 3C08000F */ lui $t0, %hi(__ASSETS_LUT_END) # $t0, 0xf -/* 077950 80076D50 2508CC30 */ addiu $t0, %lo(__ASSETS_LUT_END) # addiu $t0, $t0, -0x33d0 -/* 077954 80076D54 00682021 */ addu $a0, $v1, $t0 -/* 077958 80076D58 AFA20028 */ sw $v0, 0x28($sp) -/* 07795C 80076D5C AFA40020 */ sw $a0, 0x20($sp) -/* 077960 80076D60 00402825 */ move $a1, $v0 -/* 077964 80076D64 0C01DBDE */ jal dmacopy -/* 077968 80076D68 24060008 */ li $a2, 8 -/* 07796C 80076D6C 8FA40028 */ lw $a0, 0x28($sp) -/* 077970 80076D70 0C03186B */ jal byteswap32 -/* 077974 80076D74 00000000 */ nop -/* 077978 80076D78 8FA9003C */ lw $t1, 0x3c($sp) -/* 07797C 80076D7C 8FA40028 */ lw $a0, 0x28($sp) -/* 077980 80076D80 00495021 */ addu $t2, $v0, $t1 -/* 077984 80076D84 0C01C450 */ jal func_80071140 -/* 077988 80076D88 AFAA002C */ sw $t2, 0x2c($sp) -/* 07798C 80076D8C 8FAB002C */ lw $t3, 0x2c($sp) -/* 077990 80076D90 8FAC003C */ lw $t4, 0x3c($sp) -/* 077994 80076D94 3C057F7F */ lui $a1, (0x7F7F7FFF >> 16) # lui $a1, 0x7f7f -/* 077998 80076D98 34A57FFF */ ori $a1, (0x7F7F7FFF & 0xFFFF) # ori $a1, $a1, 0x7fff -/* 07799C 80076D9C 0C01C327 */ jal allocate_from_main_pool_safe -/* 0779A0 80076DA0 016C2021 */ addu $a0, $t3, $t4 -/* 0779A4 80076DA4 14400003 */ bnez $v0, .L80076DB4 -/* 0779A8 80076DA8 00403825 */ move $a3, $v0 -/* 0779AC 80076DAC 1000000F */ b .L80076DEC -/* 0779B0 80076DB0 00001025 */ move $v0, $zero -.L80076DB4: -/* 0779B4 80076DB4 8FAD002C */ lw $t5, 0x2c($sp) -/* 0779B8 80076DB8 8FA60034 */ lw $a2, 0x34($sp) -/* 0779BC 80076DBC 00ED7021 */ addu $t6, $a3, $t5 -/* 0779C0 80076DC0 8FA40020 */ lw $a0, 0x20($sp) -/* 0779C4 80076DC4 01C62823 */ subu $a1, $t6, $a2 -/* 0779C8 80076DC8 AFA5001C */ sw $a1, 0x1c($sp) -/* 0779CC 80076DCC 0C01DBDE */ jal dmacopy -/* 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 -/* 0779E0 80076DE0 00000000 */ nop -/* 0779E4 80076DE4 8FA20024 */ lw $v0, 0x24($sp) -/* 0779E8 80076DE8 00000000 */ nop -.L80076DEC: -/* 0779EC 80076DEC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0779F0 80076DF0 27BD0038 */ addiu $sp, $sp, 0x38 -/* 0779F4 80076DF4 03E00008 */ jr $ra -/* 0779F8 80076DF8 00000000 */ nop - -/* 0779FC 80076DFC 3C088012 */ lui $t0, %hi(D_80124290) # $t0, 0x8012 -/* 077A00 80076E00 8D084290 */ lw $t0, %lo(D_80124290)($t0) -/* 077A04 80076E04 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 077A08 80076E08 AFBF0014 */ sw $ra, 0x14($sp) -/* 077A0C 80076E0C 8D0E0000 */ lw $t6, ($t0) -/* 077A10 80076E10 00803825 */ move $a3, $a0 -/* 077A14 80076E14 01C4082B */ sltu $at, $t6, $a0 -/* 077A18 80076E18 10200003 */ beqz $at, .L80076E28 -/* 077A1C 80076E1C 24E70001 */ addiu $a3, $a3, 1 -/* 077A20 80076E20 1000000D */ b .L80076E58 -/* 077A24 80076E24 00001025 */ move $v0, $zero -.L80076E28: -/* 077A28 80076E28 00077880 */ sll $t7, $a3, 2 -/* 077A2C 80076E2C 01E81021 */ addu $v0, $t7, $t0 -/* 077A30 80076E30 8C430000 */ lw $v1, ($v0) -/* 077A34 80076E34 8C580004 */ lw $t8, 4($v0) -/* 077A38 80076E38 3C19000F */ lui $t9, %hi(__ASSETS_LUT_END) # $t9, 0xf -/* 077A3C 80076E3C 2739CC30 */ addiu $t9, %lo(__ASSETS_LUT_END) # addiu $t9, $t9, -0x33d0 -/* 077A40 80076E40 03033023 */ subu $a2, $t8, $v1 -/* 077A44 80076E44 AFA60018 */ sw $a2, 0x18($sp) -/* 077A48 80076E48 0C01DBDE */ jal dmacopy -/* 077A4C 80076E4C 00792021 */ addu $a0, $v1, $t9 -/* 077A50 80076E50 8FA20018 */ lw $v0, 0x18($sp) -/* 077A54 80076E54 00000000 */ nop -.L80076E58: -/* 077A58 80076E58 8FBF0014 */ lw $ra, 0x14($sp) -/* 077A5C 80076E5C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 077A60 80076E60 03E00008 */ jr $ra -/* 077A64 80076E64 00000000 */ nop - diff --git a/asm/non_matchings/unknown_072E50/load_asset_section_from_rom.s b/asm/non_matchings/unknown_072E50/load_asset_section_from_rom.s new file mode 100644 index 00000000..b1711a5f --- /dev/null +++ b/asm/non_matchings/unknown_072E50/load_asset_section_from_rom.s @@ -0,0 +1,71 @@ +glabel func_80076CF0 +/* 0778F0 80076CF0 27BDFFC8 */ addiu $sp, $sp, -0x38 +/* 0778F4 80076CF4 3C028012 */ lui $v0, %hi(gAssetsLookupTable) # $v0, 0x8012 +/* 0778F8 80076CF8 8C424290 */ lw $v0, %lo(gAssetsLookupTable)($v0) +/* 0778FC 80076CFC AFBF0014 */ sw $ra, 0x14($sp) +/* 077900 80076D00 AFA5003C */ sw $a1, 0x3c($sp) +/* 077904 80076D04 8C4E0000 */ lw $t6, ($v0) +/* 077908 80076D08 00803025 */ move $a2, $a0 +/* 07790C 80076D0C 01C4082B */ sltu $at, $t6, $a0 +/* 077910 80076D10 10200003 */ beqz $at, .L80076D20 +/* 077914 80076D14 24C60001 */ addiu $a2, $a2, 1 +/* 077918 80076D18 10000034 */ b .L80076DEC +/* 07791C 80076D1C 00001025 */ move $v0, $zero +.L80076D20: +/* 077920 80076D20 00067880 */ sll $t7, $a2, 2 +/* 077924 80076D24 01E23821 */ addu $a3, $t7, $v0 +/* 077928 80076D28 8CE30000 */ lw $v1, ($a3) +/* 07792C 80076D2C 8CF80004 */ lw $t8, 4($a3) +/* 077930 80076D30 24040008 */ li $a0, 8 +/* 077934 80076D34 0303C823 */ subu $t9, $t8, $v1 +/* 077938 80076D38 AFB90034 */ sw $t9, 0x34($sp) +/* 07793C 80076D3C 2405FFFF */ li $a1, -1 +/* 077940 80076D40 0C01C327 */ jal allocate_from_main_pool_safe +/* 077944 80076D44 AFA30030 */ sw $v1, 0x30($sp) +/* 077948 80076D48 8FA30030 */ lw $v1, 0x30($sp) +/* 07794C 80076D4C 3C08000F */ lui $t0, %hi(__ASSETS_LUT_END) # $t0, 0xf +/* 077950 80076D50 2508CC30 */ addiu $t0, %lo(__ASSETS_LUT_END) # addiu $t0, $t0, -0x33d0 +/* 077954 80076D54 00682021 */ addu $a0, $v1, $t0 +/* 077958 80076D58 AFA20028 */ sw $v0, 0x28($sp) +/* 07795C 80076D5C AFA40020 */ sw $a0, 0x20($sp) +/* 077960 80076D60 00402825 */ move $a1, $v0 +/* 077964 80076D64 0C01DBDE */ jal dmacopy +/* 077968 80076D68 24060008 */ li $a2, 8 +/* 07796C 80076D6C 8FA40028 */ lw $a0, 0x28($sp) +/* 077970 80076D70 0C03186B */ jal byteswap32 +/* 077974 80076D74 00000000 */ nop +/* 077978 80076D78 8FA9003C */ lw $t1, 0x3c($sp) +/* 07797C 80076D7C 8FA40028 */ lw $a0, 0x28($sp) +/* 077980 80076D80 00495021 */ addu $t2, $v0, $t1 +/* 077984 80076D84 0C01C450 */ jal func_80071140 +/* 077988 80076D88 AFAA002C */ sw $t2, 0x2c($sp) +/* 07798C 80076D8C 8FAB002C */ lw $t3, 0x2c($sp) +/* 077990 80076D90 8FAC003C */ lw $t4, 0x3c($sp) +/* 077994 80076D94 3C057F7F */ lui $a1, (0x7F7F7FFF >> 16) # lui $a1, 0x7f7f +/* 077998 80076D98 34A57FFF */ ori $a1, (0x7F7F7FFF & 0xFFFF) # ori $a1, $a1, 0x7fff +/* 07799C 80076D9C 0C01C327 */ jal allocate_from_main_pool_safe +/* 0779A0 80076DA0 016C2021 */ addu $a0, $t3, $t4 +/* 0779A4 80076DA4 14400003 */ bnez $v0, .L80076DB4 +/* 0779A8 80076DA8 00403825 */ move $a3, $v0 +/* 0779AC 80076DAC 1000000F */ b .L80076DEC +/* 0779B0 80076DB0 00001025 */ move $v0, $zero +.L80076DB4: +/* 0779B4 80076DB4 8FAD002C */ lw $t5, 0x2c($sp) +/* 0779B8 80076DB8 8FA60034 */ lw $a2, 0x34($sp) +/* 0779BC 80076DBC 00ED7021 */ addu $t6, $a3, $t5 +/* 0779C0 80076DC0 8FA40020 */ lw $a0, 0x20($sp) +/* 0779C4 80076DC4 01C62823 */ subu $a1, $t6, $a2 +/* 0779C8 80076DC8 AFA5001C */ sw $a1, 0x1c($sp) +/* 0779CC 80076DCC 0C01DBDE */ jal dmacopy +/* 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 +/* 0779E0 80076DE0 00000000 */ nop +/* 0779E4 80076DE4 8FA20024 */ lw $v0, 0x24($sp) +/* 0779E8 80076DE8 00000000 */ nop +.L80076DEC: +/* 0779EC 80076DEC 8FBF0014 */ lw $ra, 0x14($sp) +/* 0779F0 80076DF0 27BD0038 */ addiu $sp, $sp, 0x38 +/* 0779F4 80076DF4 03E00008 */ jr $ra +/* 0779F8 80076DF8 00000000 */ nop diff --git a/asm/non_matchings/unknown_07B870/func_8007AC70.s b/asm/non_matchings/unknown_07B870/func_8007AC70.s index 3281e335..74ab26ce 100644 --- a/asm/non_matchings/unknown_07B870/func_8007AC70.s +++ b/asm/non_matchings/unknown_07B870/func_8007AC70.s @@ -17,12 +17,12 @@ glabel func_8007AC70 /* 07B8AC 8007ACAC AC206330 */ sw $zero, %lo(D_80126330)($at) /* 07B8B0 8007ACB0 3C018012 */ lui $at, %hi(D_80126340) # $at, 0x8012 /* 07B8B4 8007ACB4 AC206340 */ sw $zero, %lo(D_80126340)($at) -/* 07B8B8 8007ACB8 0C01DB16 */ jal func_80076C58 +/* 07B8B8 8007ACB8 0C01DB16 */ jal load_asset_section_from_rom /* 07B8BC 8007ACBC 24040005 */ li $a0, 5 /* 07B8C0 8007ACC0 3C058012 */ lui $a1, %hi(D_80126320) # $a1, 0x8012 /* 07B8C4 8007ACC4 24A56320 */ addiu $a1, %lo(D_80126320) # addiu $a1, $a1, 0x6320 /* 07B8C8 8007ACC8 ACA20000 */ sw $v0, ($a1) -/* 07B8CC 8007ACCC 0C01DB16 */ jal func_80076C58 +/* 07B8CC 8007ACCC 0C01DB16 */ jal load_asset_section_from_rom /* 07B8D0 8007ACD0 24040003 */ li $a0, 3 /* 07B8D4 8007ACD4 3C058012 */ lui $a1, %hi(D_80126320) # $a1, 0x8012 /* 07B8D8 8007ACD8 24A56320 */ addiu $a1, %lo(D_80126320) # addiu $a1, $a1, 0x6320 @@ -70,7 +70,7 @@ glabel func_8007AC70 /* 07B970 8007AD70 AC226350 */ sw $v0, %lo(D_80126350)($at) /* 07B974 8007AD74 3C018012 */ lui $at, %hi(D_80126358) # $at, 0x8012 /* 07B978 8007AD78 AC206358 */ sw $zero, %lo(D_80126358)($at) -/* 07B97C 8007AD7C 0C01DB16 */ jal func_80076C58 +/* 07B97C 8007AD7C 0C01DB16 */ jal load_asset_section_from_rom /* 07B980 8007AD80 2404000D */ li $a0, 13 /* 07B984 8007AD84 3C058012 */ lui $a1, %hi(D_80126348) # $a1, 0x8012 /* 07B988 8007AD88 3C068012 */ lui $a2, %hi(D_80126354) # $a2, 0x8012 diff --git a/asm/non_matchings/unknown_07B870/func_8007AE74.s b/asm/non_matchings/unknown_07B870/func_8007AE74.s index 8ef83c12..eb5b5813 100644 --- a/asm/non_matchings/unknown_07B870/func_8007AE74.s +++ b/asm/non_matchings/unknown_07B870/func_8007AE74.s @@ -68,7 +68,7 @@ glabel func_8007AE74 /* 07BB64 8007AF64 AFB30050 */ sw $s3, 0x50($sp) /* 07BB68 8007AF68 02602025 */ move $a0, $s3 /* 07BB6C 8007AF6C 24070028 */ li $a3, 40 -/* 07BB70 8007AF70 0C01DB9A */ jal func_80076E68 +/* 07BB70 8007AF70 0C01DB9A */ jal load_asset_to_address /* 07BB74 8007AF74 02403025 */ move $a2, $s2 /* 07BB78 8007AF78 8E830000 */ lw $v1, ($s4) /* 07BB7C 8007AF7C 8FAE0058 */ lw $t6, 0x58($sp) @@ -95,7 +95,7 @@ glabel func_8007AE74 /* 07BBCC 8007AFCC 8FA70058 */ lw $a3, 0x58($sp) /* 07BBD0 8007AFD0 02602825 */ move $a1, $s3 /* 07BBD4 8007AFD4 02403025 */ move $a2, $s2 -/* 07BBD8 8007AFD8 0C01DB9A */ jal func_80076E68 +/* 07BBD8 8007AFD8 0C01DB9A */ jal load_asset_to_address /* 07BBDC 8007AFDC 00008825 */ move $s1, $zero /* 07BBE0 8007AFE0 1000002A */ b .L8007B08C /* 07BBE4 8007AFE4 00000000 */ nop @@ -133,7 +133,7 @@ glabel func_8007AE74 /* 07BC58 8007B058 AFA50034 */ sw $a1, 0x34($sp) /* 07BC5C 8007B05C 02403025 */ move $a2, $s2 /* 07BC60 8007B060 00008825 */ move $s1, $zero -/* 07BC64 8007B064 0C01DB9A */ jal func_80076E68 +/* 07BC64 8007B064 0C01DB9A */ jal load_asset_to_address /* 07BC68 8007B068 01603825 */ move $a3, $t3 /* 07BC6C 8007B06C 8FA40034 */ lw $a0, 0x34($sp) /* 07BC70 8007B070 02602825 */ move $a1, $s3 @@ -199,7 +199,7 @@ glabel func_8007AE74 /* 07BD4C 8007B14C 8D4A632C */ lw $t2, %lo(D_8012632C)($t2) /* 07BD50 8007B150 86660008 */ lh $a2, 8($s3) /* 07BD54 8007B154 24070020 */ li $a3, 32 -/* 07BD58 8007B158 0C01DB9A */ jal func_80076E68 +/* 07BD58 8007B158 0C01DB9A */ jal load_asset_to_address /* 07BD5C 8007B15C 014C2821 */ addu $a1, $t2, $t4 /* 07BD60 8007B160 3C0B8012 */ lui $t3, %hi(D_80126340) # $t3, 0x8012 /* 07BD64 8007B164 8D6B6340 */ lw $t3, %lo(D_80126340)($t3) @@ -232,7 +232,7 @@ glabel func_8007AE74 /* 07BDC8 8007B1C8 8F39632C */ lw $t9, %lo(D_8012632C)($t9) /* 07BDCC 8007B1CC 86660008 */ lh $a2, 8($s3) /* 07BDD0 8007B1D0 24070080 */ li $a3, 128 -/* 07BDD4 8007B1D4 0C01DB9A */ jal func_80076E68 +/* 07BDD4 8007B1D4 0C01DB9A */ jal load_asset_to_address /* 07BDD8 8007B1D8 03302821 */ addu $a1, $t9, $s0 /* 07BDDC 8007B1DC 3C038012 */ lui $v1, %hi(D_80126340) # $v1, 0x8012 /* 07BDE0 8007B1E0 24636340 */ addiu $v1, %lo(D_80126340) # addiu $v1, $v1, 0x6340 diff --git a/asm/non_matchings/unknown_07B870/func_8007C12C.s b/asm/non_matchings/unknown_07B870/func_8007C12C.s index 80f74f1d..7318f321 100644 --- a/asm/non_matchings/unknown_07B870/func_8007C12C.s +++ b/asm/non_matchings/unknown_07B870/func_8007C12C.s @@ -86,7 +86,7 @@ glabel func_8007C12C /* 07CE58 8007C258 AFA80044 */ sw $t0, 0x44($sp) /* 07CE5C 8007C25C 2404000C */ li $a0, 12 /* 07CE60 8007C260 01A63823 */ subu $a3, $t5, $a2 -/* 07CE64 8007C264 0C01DB9A */ jal func_80076E68 +/* 07CE64 8007C264 0C01DB9A */ jal load_asset_to_address /* 07CE68 8007C268 02802825 */ move $a1, $s4 /* 07CE6C 8007C26C 86850002 */ lh $a1, 2($s4) /* 07CE70 8007C270 24040010 */ li $a0, 16 diff --git a/asm/non_matchings/unknown_07B870/func_8007C57C.s b/asm/non_matchings/unknown_07B870/func_8007C57C.s index 0edd32a6..13f84ccd 100644 --- a/asm/non_matchings/unknown_07B870/func_8007C57C.s +++ b/asm/non_matchings/unknown_07B870/func_8007C57C.s @@ -38,7 +38,7 @@ glabel func_8007C57C /* 07D200 8007C600 8FA40018 */ lw $a0, 0x18($sp) /* 07D204 8007C604 1180000A */ beqz $t4, .L8007C630 /* 07D208 8007C608 01663823 */ subu $a3, $t3, $a2 -/* 07D20C 8007C60C 0C01DB9A */ jal func_80076E68 +/* 07D20C 8007C60C 0C01DB9A */ jal load_asset_to_address /* 07D210 8007C610 24070028 */ li $a3, 40 /* 07D214 8007C614 3C038012 */ lui $v1, %hi(D_8012636C) # $v1, 0x8012 /* 07D218 8007C618 8C63636C */ lw $v1, %lo(D_8012636C)($v1) @@ -124,7 +124,7 @@ glabel func_8007C57C /* 07D33C 8007C73C 2404000C */ li $a0, 12 /* 07D340 8007C740 00008025 */ move $s0, $zero /* 07D344 8007C744 02202825 */ move $a1, $s1 -/* 07D348 8007C748 0C01DB9A */ jal func_80076E68 +/* 07D348 8007C748 0C01DB9A */ jal load_asset_to_address /* 07D34C 8007C74C 01A63823 */ subu $a3, $t5, $a2 /* 07D350 8007C750 862E0002 */ lh $t6, 2($s1) /* 07D354 8007C754 00000000 */ nop diff --git a/asm/non_matchings/unknown_07B870/func_8007C8E0.s b/asm/non_matchings/unknown_07B870/func_8007C8E0.s index da201170..201719a3 100644 --- a/asm/non_matchings/unknown_07B870/func_8007C8E0.s +++ b/asm/non_matchings/unknown_07B870/func_8007C8E0.s @@ -36,7 +36,7 @@ glabel func_8007C8E0 /* 07D560 8007C960 8E736350 */ lw $s3, %lo(D_80126350)($s3) /* 07D564 8007C964 2404000C */ li $a0, 12 /* 07D568 8007C968 01463823 */ subu $a3, $t2, $a2 -/* 07D56C 8007C96C 0C01DB9A */ jal func_80076E68 +/* 07D56C 8007C96C 0C01DB9A */ jal load_asset_to_address /* 07D570 8007C970 02602825 */ move $a1, $s3 /* 07D574 8007C974 926B000C */ lbu $t3, 0xc($s3) /* 07D578 8007C978 866C0000 */ lh $t4, ($s3) diff --git a/asm/non_matchings/unknown_07B870/func_8007CA68.s b/asm/non_matchings/unknown_07B870/func_8007CA68.s index b5e9a2cb..15006e53 100644 --- a/asm/non_matchings/unknown_07B870/func_8007CA68.s +++ b/asm/non_matchings/unknown_07B870/func_8007CA68.s @@ -37,7 +37,7 @@ glabel func_8007CA68 /* 07D6EC 8007CAEC 8E526350 */ lw $s2, %lo(D_80126350)($s2) /* 07D6F0 8007CAF0 2404000C */ li $a0, 12 /* 07D6F4 8007CAF4 01263823 */ subu $a3, $t1, $a2 -/* 07D6F8 8007CAF8 0C01DB9A */ jal func_80076E68 +/* 07D6F8 8007CAF8 0C01DB9A */ jal load_asset_to_address /* 07D6FC 8007CAFC 02402825 */ move $a1, $s2 /* 07D700 8007CB00 864A0002 */ lh $t2, 2($s2) /* 07D704 8007CB04 8FB70050 */ lw $s7, 0x50($sp) diff --git a/asm/non_matchings/unknown_09F8F0/func_8009ECF0.s b/asm/non_matchings/unknown_09F8F0/func_8009ECF0.s index 71c3bd8f..92b548f8 100644 --- a/asm/non_matchings/unknown_09F8F0/func_8009ECF0.s +++ b/asm/non_matchings/unknown_09F8F0/func_8009ECF0.s @@ -19,7 +19,7 @@ glabel func_8009ECF0 /* 09F934 8009ED34 AC227184 */ sw $v0, %lo(D_80127184)($at) /* 09F938 8009ED38 3C018012 */ lui $at, %hi(D_80127188) # $at, 0x8012 /* 09F93C 8009ED3C A0227188 */ sb $v0, %lo(D_80127188)($at) -/* 09F940 8009ED40 0C01DB16 */ jal func_80076C58 +/* 09F940 8009ED40 0C01DB16 */ jal load_asset_section_from_rom /* 09F944 8009ED44 24040011 */ li $a0, 17 /* 09F948 8009ED48 3C068012 */ lui $a2, %hi(D_80126CF8) # $a2, 0x8012 /* 09F94C 8009ED4C 3C118012 */ lui $s1, %hi(D_80126CF0) # $s1, 0x8012 diff --git a/asm/non_matchings/unknown_09F8F0/func_800AB1F0.s b/asm/non_matchings/unknown_09F8F0/func_800AB1F0.s index 108231ac..089ab32b 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800AB1F0.s +++ b/asm/non_matchings/unknown_09F8F0/func_800AB1F0.s @@ -41,7 +41,7 @@ glabel func_800AB1F0 /* 0ABE8C 800AB28C 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0ABE90 800AB290 15600018 */ bnez $t3, .L800AB2F4 /* 0ABE94 800AB294 AFBF0014 */ sw $ra, 0x14($sp) -/* 0ABE98 800AB298 0C01DB16 */ jal func_80076C58 +/* 0ABE98 800AB298 0C01DB16 */ jal load_asset_section_from_rom /* 0ABE9C 800AB29C 24040013 */ li $a0, 19 /* 0ABEA0 800AB2A0 3C04800E */ lui $a0, %hi(D_800E2920) # $a0, 0x800e /* 0ABEA4 800AB2A4 3C07800E */ lui $a3, %hi(D_800E291C) # $a3, 0x800e diff --git a/asm/non_matchings/unknown_0AEE70/func_800AE530.s b/asm/non_matchings/unknown_0AEE70/func_800AE530.s index ace222fe..f8c0c779 100644 --- a/asm/non_matchings/unknown_0AEE70/func_800AE530.s +++ b/asm/non_matchings/unknown_0AEE70/func_800AE530.s @@ -8,7 +8,7 @@ glabel func_800AE530 /* 0AF148 800AE548 AFB10018 */ sw $s1, 0x18($sp) /* 0AF14C 800AE54C 0C02B924 */ jal func_800AE490 /* 0AF150 800AE550 AFB00014 */ sw $s0, 0x14($sp) -/* 0AF154 800AE554 0C01DB16 */ jal func_80076C58 +/* 0AF154 800AE554 0C01DB16 */ jal load_asset_section_from_rom /* 0AF158 800AE558 24040028 */ li $a0, 40 /* 0AF15C 800AE55C 3C05800E */ lui $a1, %hi(D_800E2CE8) # $a1, 0x800e /* 0AF160 800AE560 2406FFFF */ li $a2, -1 @@ -33,7 +33,7 @@ glabel func_800AE530 /* 0AF1A8 800AE5A8 14CAFFFA */ bne $a2, $t2, .L800AE594 /* 0AF1AC 800AE5AC 24790001 */ addiu $t9, $v1, 1 .L800AE5B0: -/* 0AF1B0 800AE5B0 0C01DB16 */ jal func_80076C58 +/* 0AF1B0 800AE5B0 0C01DB16 */ jal load_asset_section_from_rom /* 0AF1B4 800AE5B4 24040029 */ li $a0, 41 /* 0AF1B8 800AE5B8 3C05800E */ lui $a1, %hi(D_800E2CE8) # $a1, 0x800e /* 0AF1BC 800AE5BC 24A52CE8 */ addiu $a1, %lo(D_800E2CE8) # addiu $a1, $a1, 0x2ce8 @@ -59,7 +59,7 @@ glabel func_800AE530 /* 0AF208 800AE608 00000000 */ nop /* 0AF20C 800AE60C 00008825 */ move $s1, $zero .L800AE610: -/* 0AF210 800AE610 0C01DB16 */ jal func_80076C58 +/* 0AF210 800AE610 0C01DB16 */ jal load_asset_section_from_rom /* 0AF214 800AE614 2404002A */ li $a0, 42 /* 0AF218 800AE618 2406FFFF */ li $a2, -1 /* 0AF21C 800AE61C 3C12800E */ lui $s2, %hi(D_800E2CF4) # $s2, 0x800e @@ -84,7 +84,7 @@ glabel func_800AE530 /* 0AF264 800AE664 14CDFFFA */ bne $a2, $t5, .L800AE650 /* 0AF268 800AE668 246A0001 */ addiu $t2, $v1, 1 .L800AE66C: -/* 0AF26C 800AE66C 0C01DB16 */ jal func_80076C58 +/* 0AF26C 800AE66C 0C01DB16 */ jal load_asset_section_from_rom /* 0AF270 800AE670 2404002B */ li $a0, 43 /* 0AF274 800AE674 8E4E0000 */ lw $t6, ($s2) /* 0AF278 800AE678 3C15800E */ lui $s5, %hi(D_800E2CF8) # $s5, 0x800e diff --git a/asm/non_matchings/unknown_0AEE70/func_800AE728.s b/asm/non_matchings/unknown_0AEE70/func_800AE728.s index 28ae152c..08217873 100644 --- a/asm/non_matchings/unknown_0AEE70/func_800AE728.s +++ b/asm/non_matchings/unknown_0AEE70/func_800AE728.s @@ -408,7 +408,7 @@ glabel func_800AE728 /* 0AF910 800AED10 00000000 */ nop /* 0AF914 800AED14 15C00034 */ bnez $t6, .L800AEDE8 /* 0AF918 800AED18 8FBF003C */ lw $ra, 0x3c($sp) -/* 0AF91C 800AED1C 0C01DB16 */ jal func_80076C58 +/* 0AF91C 800AED1C 0C01DB16 */ jal load_asset_section_from_rom /* 0AF920 800AED20 00008825 */ move $s1, $zero /* 0AF924 800AED24 3C06800E */ lui $a2, %hi(D_800E2E64) # $a2, 0x800e /* 0AF928 800AED28 24C62E64 */ addiu $a2, %lo(D_800E2E64) # addiu $a2, $a2, 0x2e64 diff --git a/asm/non_matchings/unknown_0AEE70/func_800B5F78.s b/asm/non_matchings/unknown_0AEE70/func_800B5F78.s index 622aa73e..cc92ae25 100644 --- a/asm/non_matchings/unknown_0AEE70/func_800B5F78.s +++ b/asm/non_matchings/unknown_0AEE70/func_800B5F78.s @@ -172,46 +172,4 @@ glabel func_800B5F78 /* 0B6E04 800B6204 03E00008 */ jr $ra /* 0B6E08 800B6208 00000000 */ nop -/* 0B6E0C 800B620C 3C028013 */ lui $v0, %hi(D_801285D8) # $v0, 0x8013 -/* 0B6E10 800B6210 244285D8 */ addiu $v0, %lo(D_801285D8) # addiu $v0, $v0, -0x7a28 -/* 0B6E14 800B6214 8C490000 */ lw $t1, ($v0) -/* 0B6E18 800B6218 AFA40000 */ sw $a0, ($sp) -/* 0B6E1C 800B621C AFA50004 */ sw $a1, 4($sp) -/* 0B6E20 800B6220 AFA60008 */ sw $a2, 8($sp) -/* 0B6E24 800B6224 AFA7000C */ sw $a3, 0xc($sp) -/* 0B6E28 800B6228 24080081 */ li $t0, 129 -/* 0B6E2C 800B622C A1280000 */ sb $t0, ($t1) -/* 0B6E30 800B6230 8C4A0000 */ lw $t2, ($v0) -/* 0B6E34 800B6234 00A07825 */ move $t7, $a1 -/* 0B6E38 800B6238 254B0001 */ addiu $t3, $t2, 1 -/* 0B6E3C 800B623C AC4B0000 */ sw $t3, ($v0) -/* 0B6E40 800B6240 A1640000 */ sb $a0, ($t3) -/* 0B6E44 800B6244 8C4D0000 */ lw $t5, ($v0) -/* 0B6E48 800B6248 01E02825 */ move $a1, $t7 -/* 0B6E4C 800B624C 25AE0001 */ addiu $t6, $t5, 1 -/* 0B6E50 800B6250 00C0C025 */ move $t8, $a2 -/* 0B6E54 800B6254 AC4E0000 */ sw $t6, ($v0) -/* 0B6E58 800B6258 03003025 */ move $a2, $t8 -/* 0B6E5C 800B625C A1C50000 */ sb $a1, ($t6) -/* 0B6E60 800B6260 8C580000 */ lw $t8, ($v0) -/* 0B6E64 800B6264 00E0C825 */ move $t9, $a3 -/* 0B6E68 800B6268 03203825 */ move $a3, $t9 -/* 0B6E6C 800B626C 27190001 */ addiu $t9, $t8, 1 -/* 0B6E70 800B6270 AC590000 */ sw $t9, ($v0) -/* 0B6E74 800B6274 A3260000 */ sb $a2, ($t9) -/* 0B6E78 800B6278 8C490000 */ lw $t1, ($v0) -/* 0B6E7C 800B627C 00000000 */ nop -/* 0B6E80 800B6280 252A0001 */ addiu $t2, $t1, 1 -/* 0B6E84 800B6284 AC4A0000 */ sw $t2, ($v0) -/* 0B6E88 800B6288 A1470000 */ sb $a3, ($t2) -/* 0B6E8C 800B628C 8C4C0000 */ lw $t4, ($v0) -/* 0B6E90 800B6290 00000000 */ nop -/* 0B6E94 800B6294 258D0001 */ addiu $t5, $t4, 1 -/* 0B6E98 800B6298 AC4D0000 */ sw $t5, ($v0) -/* 0B6E9C 800B629C A1A00000 */ sb $zero, ($t5) -/* 0B6EA0 800B62A0 8C4F0000 */ lw $t7, ($v0) -/* 0B6EA4 800B62A4 00000000 */ nop -/* 0B6EA8 800B62A8 25F80001 */ addiu $t8, $t7, 1 -/* 0B6EAC 800B62AC 03E00008 */ jr $ra -/* 0B6EB0 800B62B0 AC580000 */ sw $t8, ($v0) diff --git a/asm/non_matchings/unknown_0AEE70/func_800B635C.s b/asm/non_matchings/unknown_0AEE70/func_800B63F4.s similarity index 68% rename from asm/non_matchings/unknown_0AEE70/func_800B635C.s rename to asm/non_matchings/unknown_0AEE70/func_800B63F4.s index 2c8cd647..7fc0d454 100644 --- a/asm/non_matchings/unknown_0AEE70/func_800B635C.s +++ b/asm/non_matchings/unknown_0AEE70/func_800B63F4.s @@ -1,43 +1,5 @@ -glabel func_800B635C -/* 0B6F5C 800B635C 3C068013 */ lui $a2, %hi(D_801285D8) # $a2, 0x8013 -/* 0B6F60 800B6360 24C685D8 */ addiu $a2, %lo(D_801285D8) # addiu $a2, $a2, -0x7a28 -/* 0B6F64 800B6364 8CD90000 */ lw $t9, ($a2) -/* 0B6F68 800B6368 AFA40000 */ sw $a0, ($sp) -/* 0B6F6C 800B636C AFA50004 */ sw $a1, 4($sp) -/* 0B6F70 800B6370 24180082 */ li $t8, 130 -/* 0B6F74 800B6374 A3380000 */ sb $t8, ($t9) -/* 0B6F78 800B6378 8CC80000 */ lw $t0, ($a2) -/* 0B6F7C 800B637C 00A07825 */ move $t7, $a1 -/* 0B6F80 800B6380 25090001 */ addiu $t1, $t0, 1 -/* 0B6F84 800B6384 ACC90000 */ sw $t1, ($a2) -/* 0B6F88 800B6388 A1240000 */ sb $a0, ($t1) -/* 0B6F8C 800B638C 8CCC0000 */ lw $t4, ($a2) -/* 0B6F90 800B6390 01E02825 */ move $a1, $t7 -/* 0B6F94 800B6394 258D0001 */ addiu $t5, $t4, 1 -/* 0B6F98 800B6398 ACCD0000 */ sw $t5, ($a2) -/* 0B6F9C 800B639C 00047A03 */ sra $t7, $a0, 8 -/* 0B6FA0 800B63A0 A1AF0000 */ sb $t7, ($t5) -/* 0B6FA4 800B63A4 8CD90000 */ lw $t9, ($a2) -/* 0B6FA8 800B63A8 00057203 */ sra $t6, $a1, 8 -/* 0B6FAC 800B63AC 27280001 */ addiu $t0, $t9, 1 -/* 0B6FB0 800B63B0 ACC80000 */ sw $t0, ($a2) -/* 0B6FB4 800B63B4 A1050000 */ sb $a1, ($t0) -/* 0B6FB8 800B63B8 8CCB0000 */ lw $t3, ($a2) -/* 0B6FBC 800B63BC 00000000 */ nop -/* 0B6FC0 800B63C0 256C0001 */ addiu $t4, $t3, 1 -/* 0B6FC4 800B63C4 ACCC0000 */ sw $t4, ($a2) -/* 0B6FC8 800B63C8 A18E0000 */ sb $t6, ($t4) -/* 0B6FCC 800B63CC 8CD80000 */ lw $t8, ($a2) -/* 0B6FD0 800B63D0 00000000 */ nop -/* 0B6FD4 800B63D4 27190001 */ addiu $t9, $t8, 1 -/* 0B6FD8 800B63D8 ACD90000 */ sw $t9, ($a2) -/* 0B6FDC 800B63DC A3200000 */ sb $zero, ($t9) -/* 0B6FE0 800B63E0 8CC90000 */ lw $t1, ($a2) -/* 0B6FE4 800B63E4 00000000 */ nop -/* 0B6FE8 800B63E8 252A0001 */ addiu $t2, $t1, 1 -/* 0B6FEC 800B63EC 03E00008 */ jr $ra -/* 0B6FF0 800B63F0 ACCA0000 */ sw $t2, ($a2) - +# Unused? +glabel func_800B63F4 /* 0B6FF4 800B63F4 27BDFEC8 */ addiu $sp, $sp, -0x138 /* 0B6FF8 800B63F8 AFBF0014 */ sw $ra, 0x14($sp) /* 0B6FFC 800B63FC AFA40138 */ sw $a0, 0x138($sp) @@ -126,5 +88,4 @@ glabel func_800B635C /* 0B712C 800B652C 8FBF0014 */ lw $ra, 0x14($sp) /* 0B7130 800B6530 27BD0138 */ addiu $sp, $sp, 0x138 /* 0B7134 800B6534 03E00008 */ jr $ra -/* 0B7138 800B6538 00E01025 */ move $v0, $a3 - +/* 0B7138 800B6538 00E01025 */ move $v0, $a3 \ No newline at end of file diff --git a/asm/non_matchings/unknown_0AEE70/render_epc_lock_up_display.s b/asm/non_matchings/unknown_0AEE70/render_epc_lock_up_display.s index 60ee2366..a66d70a5 100644 --- a/asm/non_matchings/unknown_0AEE70/render_epc_lock_up_display.s +++ b/asm/non_matchings/unknown_0AEE70/render_epc_lock_up_display.s @@ -99,7 +99,7 @@ glabel render_epc_lock_up_display /* 0B8450 800B7850 24040010 */ li $a0, 16 /* 0B8454 800B7854 24050020 */ li $a1, 32 /* 0B8458 800B7858 ADC10008 */ sw $at, 8($t6) -/* 0B845C 800B785C 0C02D8D7 */ jal func_800B635C +/* 0B845C 800B785C 0C02D8D7 */ jal set_render_printf_position /* 0B8460 800B7860 ADC80004 */ sw $t0, 4($t6) /* 0B8464 800B7864 3C03800E */ lui $v1, %hi(D_800E3024) # $v1, 0x800e /* 0B8468 800B7868 24633024 */ addiu $v1, %lo(D_800E3024) # addiu $v1, $v1, 0x3024 diff --git a/asm/non_matchings/unknown_0AEE70/func_800B62B4.s b/asm/non_matchings/unknown_0AEE70/set_render_printf_background_color.s similarity index 98% rename from asm/non_matchings/unknown_0AEE70/func_800B62B4.s rename to asm/non_matchings/unknown_0AEE70/set_render_printf_background_color.s index 54aa5d9c..57107330 100644 --- a/asm/non_matchings/unknown_0AEE70/func_800B62B4.s +++ b/asm/non_matchings/unknown_0AEE70/set_render_printf_background_color.s @@ -1,4 +1,4 @@ -glabel func_800B62B4 +glabel set_render_printf_background_color /* 0B6EB4 800B62B4 3C028013 */ lui $v0, %hi(D_801285D8) # $v0, 0x8013 /* 0B6EB8 800B62B8 244285D8 */ addiu $v0, %lo(D_801285D8) # addiu $v0, $v0, -0x7a28 /* 0B6EBC 800B62BC 8C490000 */ lw $t1, ($v0) diff --git a/asm/non_matchings/unknown_0AEE70/set_render_printf_color.s b/asm/non_matchings/unknown_0AEE70/set_render_printf_color.s new file mode 100644 index 00000000..3ed2daeb --- /dev/null +++ b/asm/non_matchings/unknown_0AEE70/set_render_printf_color.s @@ -0,0 +1,43 @@ +glabel set_render_printf_color +/* 0B6E0C 800B620C 3C028013 */ lui $v0, %hi(D_801285D8) # $v0, 0x8013 +/* 0B6E10 800B6210 244285D8 */ addiu $v0, %lo(D_801285D8) # addiu $v0, $v0, -0x7a28 +/* 0B6E14 800B6214 8C490000 */ lw $t1, ($v0) +/* 0B6E18 800B6218 AFA40000 */ sw $a0, ($sp) +/* 0B6E1C 800B621C AFA50004 */ sw $a1, 4($sp) +/* 0B6E20 800B6220 AFA60008 */ sw $a2, 8($sp) +/* 0B6E24 800B6224 AFA7000C */ sw $a3, 0xc($sp) +/* 0B6E28 800B6228 24080081 */ li $t0, 129 +/* 0B6E2C 800B622C A1280000 */ sb $t0, ($t1) +/* 0B6E30 800B6230 8C4A0000 */ lw $t2, ($v0) +/* 0B6E34 800B6234 00A07825 */ move $t7, $a1 +/* 0B6E38 800B6238 254B0001 */ addiu $t3, $t2, 1 +/* 0B6E3C 800B623C AC4B0000 */ sw $t3, ($v0) +/* 0B6E40 800B6240 A1640000 */ sb $a0, ($t3) +/* 0B6E44 800B6244 8C4D0000 */ lw $t5, ($v0) +/* 0B6E48 800B6248 01E02825 */ move $a1, $t7 +/* 0B6E4C 800B624C 25AE0001 */ addiu $t6, $t5, 1 +/* 0B6E50 800B6250 00C0C025 */ move $t8, $a2 +/* 0B6E54 800B6254 AC4E0000 */ sw $t6, ($v0) +/* 0B6E58 800B6258 03003025 */ move $a2, $t8 +/* 0B6E5C 800B625C A1C50000 */ sb $a1, ($t6) +/* 0B6E60 800B6260 8C580000 */ lw $t8, ($v0) +/* 0B6E64 800B6264 00E0C825 */ move $t9, $a3 +/* 0B6E68 800B6268 03203825 */ move $a3, $t9 +/* 0B6E6C 800B626C 27190001 */ addiu $t9, $t8, 1 +/* 0B6E70 800B6270 AC590000 */ sw $t9, ($v0) +/* 0B6E74 800B6274 A3260000 */ sb $a2, ($t9) +/* 0B6E78 800B6278 8C490000 */ lw $t1, ($v0) +/* 0B6E7C 800B627C 00000000 */ nop +/* 0B6E80 800B6280 252A0001 */ addiu $t2, $t1, 1 +/* 0B6E84 800B6284 AC4A0000 */ sw $t2, ($v0) +/* 0B6E88 800B6288 A1470000 */ sb $a3, ($t2) +/* 0B6E8C 800B628C 8C4C0000 */ lw $t4, ($v0) +/* 0B6E90 800B6290 00000000 */ nop +/* 0B6E94 800B6294 258D0001 */ addiu $t5, $t4, 1 +/* 0B6E98 800B6298 AC4D0000 */ sw $t5, ($v0) +/* 0B6E9C 800B629C A1A00000 */ sb $zero, ($t5) +/* 0B6EA0 800B62A0 8C4F0000 */ lw $t7, ($v0) +/* 0B6EA4 800B62A4 00000000 */ nop +/* 0B6EA8 800B62A8 25F80001 */ addiu $t8, $t7, 1 +/* 0B6EAC 800B62AC 03E00008 */ jr $ra +/* 0B6EB0 800B62B0 AC580000 */ sw $t8, ($v0) diff --git a/asm/non_matchings/unknown_0AEE70/set_render_printf_position.s b/asm/non_matchings/unknown_0AEE70/set_render_printf_position.s new file mode 100644 index 00000000..69800eca --- /dev/null +++ b/asm/non_matchings/unknown_0AEE70/set_render_printf_position.s @@ -0,0 +1,42 @@ +glabel set_render_printf_position +/* 0B6F5C 800B635C 3C068013 */ lui $a2, %hi(D_801285D8) # $a2, 0x8013 +/* 0B6F60 800B6360 24C685D8 */ addiu $a2, %lo(D_801285D8) # addiu $a2, $a2, -0x7a28 +/* 0B6F64 800B6364 8CD90000 */ lw $t9, ($a2) +/* 0B6F68 800B6368 AFA40000 */ sw $a0, ($sp) +/* 0B6F6C 800B636C AFA50004 */ sw $a1, 4($sp) +/* 0B6F70 800B6370 24180082 */ li $t8, 130 +/* 0B6F74 800B6374 A3380000 */ sb $t8, ($t9) +/* 0B6F78 800B6378 8CC80000 */ lw $t0, ($a2) +/* 0B6F7C 800B637C 00A07825 */ move $t7, $a1 +/* 0B6F80 800B6380 25090001 */ addiu $t1, $t0, 1 +/* 0B6F84 800B6384 ACC90000 */ sw $t1, ($a2) +/* 0B6F88 800B6388 A1240000 */ sb $a0, ($t1) +/* 0B6F8C 800B638C 8CCC0000 */ lw $t4, ($a2) +/* 0B6F90 800B6390 01E02825 */ move $a1, $t7 +/* 0B6F94 800B6394 258D0001 */ addiu $t5, $t4, 1 +/* 0B6F98 800B6398 ACCD0000 */ sw $t5, ($a2) +/* 0B6F9C 800B639C 00047A03 */ sra $t7, $a0, 8 +/* 0B6FA0 800B63A0 A1AF0000 */ sb $t7, ($t5) +/* 0B6FA4 800B63A4 8CD90000 */ lw $t9, ($a2) +/* 0B6FA8 800B63A8 00057203 */ sra $t6, $a1, 8 +/* 0B6FAC 800B63AC 27280001 */ addiu $t0, $t9, 1 +/* 0B6FB0 800B63B0 ACC80000 */ sw $t0, ($a2) +/* 0B6FB4 800B63B4 A1050000 */ sb $a1, ($t0) +/* 0B6FB8 800B63B8 8CCB0000 */ lw $t3, ($a2) +/* 0B6FBC 800B63BC 00000000 */ nop +/* 0B6FC0 800B63C0 256C0001 */ addiu $t4, $t3, 1 +/* 0B6FC4 800B63C4 ACCC0000 */ sw $t4, ($a2) +/* 0B6FC8 800B63C8 A18E0000 */ sb $t6, ($t4) +/* 0B6FCC 800B63CC 8CD80000 */ lw $t8, ($a2) +/* 0B6FD0 800B63D0 00000000 */ nop +/* 0B6FD4 800B63D4 27190001 */ addiu $t9, $t8, 1 +/* 0B6FD8 800B63D8 ACD90000 */ sw $t9, ($a2) +/* 0B6FDC 800B63DC A3200000 */ sb $zero, ($t9) +/* 0B6FE0 800B63E0 8CC90000 */ lw $t1, ($a2) +/* 0B6FE4 800B63E4 00000000 */ nop +/* 0B6FE8 800B63E8 252A0001 */ addiu $t2, $t1, 1 +/* 0B6FEC 800B63EC 03E00008 */ jr $ra +/* 0B6FF0 800B63F0 ACCA0000 */ sw $t2, ($a2) + + + diff --git a/asm/non_matchings/unknown_0B8920/func_800C3048.s b/asm/non_matchings/unknown_0B8920/func_800C3048.s index 0c31c710..893a0f0b 100644 --- a/asm/non_matchings/unknown_0B8920/func_800C3048.s +++ b/asm/non_matchings/unknown_0B8920/func_800C3048.s @@ -20,7 +20,7 @@ glabel func_800C3048 /* 0C3C90 800C3090 3C018013 */ lui $at, %hi(D_8012A7A4) # $at, 0x8013 /* 0C3C94 800C3094 0C030A7C */ jal func_800C29F0 /* 0C3C98 800C3098 AC20A7A4 */ sw $zero, %lo(D_8012A7A4)($at) -/* 0C3C9C 800C309C 0C01DBCC */ jal func_80076F30 +/* 0C3C9C 800C309C 0C01DBCC */ jal get_size_of_asset_section /* 0C3CA0 800C30A0 24040007 */ li $a0, 7 /* 0C3CA4 800C30A4 00024883 */ sra $t1, $v0, 2 /* 0C3CA8 800C30A8 252AFFFE */ addiu $t2, $t1, -2 diff --git a/asm/non_matchings/unknown_0B8920/func_800C31EC.s b/asm/non_matchings/unknown_0B8920/func_800C31EC.s index ab417459..fdadacd4 100644 --- a/asm/non_matchings/unknown_0B8920/func_800C31EC.s +++ b/asm/non_matchings/unknown_0B8920/func_800C31EC.s @@ -41,7 +41,7 @@ glabel func_800C31EC /* 0C3E74 800C3274 8CA5A780 */ lw $a1, %lo(D_8012A780)($a1) /* 0C3E78 800C3278 0006C080 */ sll $t8, $a2, 2 /* 0C3E7C 800C327C 03003025 */ move $a2, $t8 -/* 0C3E80 800C3280 0C01DB9A */ jal func_80076E68 +/* 0C3E80 800C3280 0C01DB9A */ jal load_asset_to_address /* 0C3E84 800C3284 24070010 */ li $a3, 16 /* 0C3E88 800C3288 3C048013 */ lui $a0, %hi(D_8012A780) # $a0, 0x8013 /* 0C3E8C 800C328C 8C84A780 */ lw $a0, %lo(D_8012A780)($a0) @@ -66,7 +66,7 @@ glabel func_800C31EC /* 0C3ED8 800C32D8 00AF2821 */ addu $a1, $a1, $t7 /* 0C3EDC 800C32DC 8CA5A7C8 */ lw $a1, %lo(D_8012A7C8)($a1) /* 0C3EE0 800C32E0 24040006 */ li $a0, 6 -/* 0C3EE4 800C32E4 0C01DB9A */ jal func_80076E68 +/* 0C3EE4 800C32E4 0C01DB9A */ jal load_asset_to_address /* 0C3EE8 800C32E8 01093026 */ xor $a2, $t0, $t1 /* 0C3EEC 800C32EC 8E180000 */ lw $t8, ($s0) /* 0C3EF0 800C32F0 3C0A8013 */ lui $t2, %hi(D_8012A7C8) # $t2, 0x8013 @@ -92,7 +92,7 @@ glabel func_800C31EC /* 0C3F3C 800C333C 8CA5A798 */ lw $a1, %lo(D_8012A798)($a1) /* 0C3F40 800C3340 24040006 */ li $a0, 6 /* 0C3F44 800C3344 01093026 */ xor $a2, $t0, $t1 -/* 0C3F48 800C3348 0C01DB9A */ jal func_80076E68 +/* 0C3F48 800C3348 0C01DB9A */ jal load_asset_to_address /* 0C3F4C 800C334C AFA70024 */ sw $a3, 0x24($sp) /* 0C3F50 800C3350 8E030000 */ lw $v1, ($s0) /* 0C3F54 800C3354 3C198013 */ lui $t9, %hi(D_8012A798) # $t9, 0x8013 diff --git a/asm/non_matchings/unknown_0B8920/func_800C3C00.s b/asm/non_matchings/unknown_0B8920/func_800C3C00.s index 17ccbefc..220a6a88 100644 --- a/asm/non_matchings/unknown_0B8920/func_800C3C00.s +++ b/asm/non_matchings/unknown_0B8920/func_800C3C00.s @@ -1,7 +1,7 @@ glabel func_800C3C00 /* 0C4800 800C3C00 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0C4804 800C3C04 AFBF0014 */ sw $ra, 0x14($sp) -/* 0C4808 800C3C08 0C01DB16 */ jal func_80076C58 +/* 0C4808 800C3C08 0C01DB16 */ jal load_asset_section_from_rom /* 0C480C 800C3C0C 2404002C */ li $a0, 44 /* 0C4810 800C3C10 3C038013 */ lui $v1, %hi(D_8012A7E4) # $v1, 0x8013 /* 0C4814 800C3C14 2463A7E4 */ addiu $v1, %lo(D_8012A7E4) # addiu $v1, $v1, -0x581c diff --git a/extract-ver/us_1.0.config.json b/extract-ver/us_1.0.config.json index a77b631b..46bcf24e 100644 --- a/extract-ver/us_1.0.config.json +++ b/extract-ver/us_1.0.config.json @@ -60,32 +60,49 @@ "assets" : { "sections": [ { + "name": "UNKNOWN_0", "type": "Binary", "folder": "unknown_0", "table": 1 }, - { "type": "Table" }, + { + "name": "UNKNOWN_0_TABLE", + "type": "Table" + }, { + "name": "TEXTURES_3D", "type": "Textures", "folder": "textures/3d", "table": 3, "flip-textures": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] }, - { "type": "Table" }, + { + "name": "TEXTURES_3D_TABLE", + "type": "Table" + }, { + "name": "TEXTURES_2D", "type": "Textures", "folder": "textures/2d", "table": 5, "flip-textures" : [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] }, - { "type": "Table" }, + { + "name": "TEXTURES_2D_TABLE", + "type": "Table" + }, { + "name": "GAME_TEXT", "type": "GameText", "folder": "text/game", "table": 7 }, - { "type": "Table" }, + { + "name": "GAME_TEXT_TABLE", + "type": "Table" + }, { + "name": "MENU_TEXT", "type": "MenuText", "folder": "text/menu", "table": 9, @@ -96,17 +113,35 @@ "japanese_menu_text" ] }, - { "type": "Table" }, - { "type": "Empty", "table": 11}, - { "type": "Table" }, + { + "name": "MENU_TEXT_TABLE", + "type": "Table" + }, + { + "name": "EMPTY_10", + "type": "Empty", + "table": 11 + }, + { + "name": "EMPTY_10_TABLE", + "type": "Table" + }, { + "name": "SPRITES", "type": "Sprites", "folder": "sprites", "table": 13 }, - { "type": "Table" }, - { "type": "Empty" }, + { + "name": "SPRITES_TABLE", + "type": "Table" + }, + { + "name": "EMPTY_14", + "type": "Empty" + }, { + "name": "MISC", "type": "Miscellaneous", "folder": "misc", "table": 16, @@ -184,30 +219,44 @@ "" ] }, - { "type": "Table" }, + { + "name": "MISC_TABLE", + "type": "Table" + }, { + "name": "HUD_ELEMENT_IDS", "type": "Binary", "folder": "ids", "filenames": [ "hud_element_ids" ] }, { + "name": "MENU_ELEMENT_IDS", "type": "Binary", "folder": "ids", "filenames": [ "menu_element_ids" ] }, { + "name": "UNKNOWN_19", "type": "Binary", "folder": "bin", "filenames": [ "unknown_table" ] }, - { "type": "Table" }, + { + "name": "LEVEL_OBJECT_MAPS_TABLE", + "type": "Table" + }, { + "name": "LEVEL_OBJECT_MAPS", "type": "LevelObjectMap", "folder": "levels/objectMaps", "table": 20 }, - { "type": "Table" }, + { + "name": "LEVEL_HEADERS_TABLE", + "type": "Table" + }, { + "name": "LEVEL_HEADERS", "type": "LevelHeaders", "folder": "levels/headers", "table": 22, @@ -279,8 +328,12 @@ "LastBitB" ] }, - { "type": "Table" }, + { + "name": "LEVEL_NAMES_TABLE", + "type": "Table" + }, { + "name": "LEVEL_NAMES", "type": "LevelNames", "folder": "levels/names", "table": 24, @@ -352,78 +405,123 @@ "LastBitB" ] }, - { "type": "Table" }, + { + "name": "LEVEL_MODELS_TABLE", + "type": "Table" + }, { + "name": "LEVEL_MODELS", "type": "LevelModels", "folder": "levels/models", "table": 26 }, - { "type": "Table" }, + { + "name": "OBJECT_MODELS_TABLE", + "type": "Table" + }, { + "name": "OBJECT_MODELS", "type": "ObjectModels", "folder": "objects/models", "table": 28 }, { + "name": "ANIMATION_IDS", "type": "Binary", "folder": "objects", "filenames": [ "animation_ids" ] }, - { "type": "Table" }, + { + "name": "OBJECT_ANIMATIONS_TABLE", + "type": "Table" + }, { + "name": "OBJECT_ANIMATIONS", "type": "ObjectAnimations", "folder": "objects/animations", "table": 31 }, - { "type": "Table" }, + { + "name": "OBJECT_HEADERS_TABLE", + "type": "Table" + }, { + "name": "OBJECT_HEADERS", "type": "ObjectHeaders", "folder": "objects/headers", "table": 33 }, { + "name": "LEVEL_OBJECT_TRANSLATION_TABLE", "type": "Binary", "folder": "objects", "filenames": [ "level_object_translation_table" ] }, - { "type": "Table" }, - { "type": "Empty", "table": 36 }, - { "type": "Table" }, + { + "name": "EMPTY_37_TABLE", + "type": "Table" + }, + { + "name": "EMPTY_37", + "type": "Empty", + "table": 36 + }, + { + "name": "AUDIO_TABLE", + "type": "Table" + }, { + "name": "AUDIO", "type": "Audio", "folder": "audio", "table": 38 }, - { "type": "Table" }, + { + "name": "PARTICLES_TABLE", + "type": "Table" + }, { + "name": "PARTICLES", "type": "Particles", "folder": "particles/particles", "table": 40 }, - { "type": "Table" }, + { + "name": "PARTICLE_BEHAVIORS_TABLE", + "type": "Table" + }, { + "name": "PARTICLE_BEHAVIORS", "type": "ParticleBehaviors", "folder": "particles/behaviors", "table": 42 }, { + "name": "BINARY_44", "type": "Binary", "folder": "fonts" }, { + "name": "BINARY_45", "type": "Binary", "folder": "fonts" }, { + "name": "BINARY_46", "type": "Binary", "folder": "fonts" }, { + "name": "BINARY_47", "type": "Binary", "folder": "ids" }, - { "type": "Table" }, + { + "name": "TTGHOSTS_TABLE", + "type": "Table" + }, { + "name": "TTGHOSTS", "type": "TTGhosts", "folder": "tt_ghosts", "table": 48, diff --git a/extract-ver/us_1.0.config.json.md5 b/extract-ver/us_1.0.config.json.md5 new file mode 100644 index 00000000..473ca8bd --- /dev/null +++ b/extract-ver/us_1.0.config.json.md5 @@ -0,0 +1 @@ +14cd0ceb997280e5b1fc9922be89d275 \ No newline at end of file diff --git a/extract.sh b/extract.sh index af661af1..fb8ecc4e 100755 --- a/extract.sh +++ b/extract.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [[ $# == 0 || (($1 != "us_1.0") && ($1 != "us_1.1") && ($1 != "eu_1.0") && ($1 != "eu_1.1") && ($1 != "jp"))]]; then echo 'Usage: ./extract.sh ' echo 'Acceptable versions: us_1.0, us_1.1, eu_1.0, eu_1.1, jp' @@ -7,18 +9,18 @@ fi echo 'Extracting Assets...' # Remove assets directory if it exists. -ASSETS_DIR="./assets/${$1}" +ASSETS_DIR="./assets/$1" if [ -d "$ASSETS_DIR" ]; then rm -r $ASSETS_DIR fi # Remove ucode directory if it exists. -UCODE_DIR="./ucode/${$1}" +UCODE_DIR="./ucode/$1" if [ -d "$UCODE_DIR" ]; then rm -r $UCODE_DIR fi -if ! ./tools/dkr_extractor "$1" ./extract-ver ./baseroms .; then +if ! ./tools/dkr_extractor "$1" ./extract-ver ./baseroms . ; then exit 1 fi diff --git a/include/asset_sections.h b/include/asset_sections.h new file mode 100644 index 00000000..3dbea764 --- /dev/null +++ b/include/asset_sections.h @@ -0,0 +1,57 @@ +/* This file was generated by generate_ld.py */ + +#ifndef _ASSET_SECTIONS_H_ +#define _ASSET_SECTIONS_H_ + +#define ASSET_UNKNOWN_0 0 +#define ASSET_UNKNOWN_0_TABLE 1 +#define ASSET_TEXTURES_3D 2 +#define ASSET_TEXTURES_3D_TABLE 3 +#define ASSET_TEXTURES_2D 4 +#define ASSET_TEXTURES_2D_TABLE 5 +#define ASSET_GAME_TEXT 6 +#define ASSET_GAME_TEXT_TABLE 7 +#define ASSET_MENU_TEXT 8 +#define ASSET_MENU_TEXT_TABLE 9 +#define ASSET_EMPTY_10 10 +#define ASSET_EMPTY_10_TABLE 11 +#define ASSET_SPRITES 12 +#define ASSET_SPRITES_TABLE 13 +#define ASSET_EMPTY_14 14 +#define ASSET_MISC 15 +#define ASSET_MISC_TABLE 16 +#define ASSET_HUD_ELEMENT_IDS 17 +#define ASSET_MENU_ELEMENT_IDS 18 +#define ASSET_UNKNOWN_19 19 +#define ASSET_LEVEL_OBJECT_MAPS_TABLE 20 +#define ASSET_LEVEL_OBJECT_MAPS 21 +#define ASSET_LEVEL_HEADERS_TABLE 22 +#define ASSET_LEVEL_HEADERS 23 +#define ASSET_LEVEL_NAMES_TABLE 24 +#define ASSET_LEVEL_NAMES 25 +#define ASSET_LEVEL_MODELS_TABLE 26 +#define ASSET_LEVEL_MODELS 27 +#define ASSET_OBJECT_MODELS_TABLE 28 +#define ASSET_OBJECT_MODELS 29 +#define ASSET_ANIMATION_IDS 30 +#define ASSET_OBJECT_ANIMATIONS_TABLE 31 +#define ASSET_OBJECT_ANIMATIONS 32 +#define ASSET_OBJECT_HEADERS_TABLE 33 +#define ASSET_OBJECT_HEADERS 34 +#define ASSET_LEVEL_OBJECT_TRANSLATION_TABLE 35 +#define ASSET_EMPTY_37_TABLE 36 +#define ASSET_EMPTY_37 37 +#define ASSET_AUDIO_TABLE 38 +#define ASSET_AUDIO 39 +#define ASSET_PARTICLES_TABLE 40 +#define ASSET_PARTICLES 41 +#define ASSET_PARTICLE_BEHAVIORS_TABLE 42 +#define ASSET_PARTICLE_BEHAVIORS 43 +#define ASSET_BINARY_44 44 +#define ASSET_BINARY_45 45 +#define ASSET_BINARY_46 46 +#define ASSET_BINARY_47 47 +#define ASSET_TTGHOSTS_TABLE 48 +#define ASSET_TTGHOSTS 49 + +#endif diff --git a/include/types.h b/include/types.h index 04b872e3..a713e4a3 100644 --- a/include/types.h +++ b/include/types.h @@ -39,4 +39,6 @@ typedef s32 ptrdiff_t; //#include //#endif +#define stubbed_printf + #endif diff --git a/src/audio.c b/src/audio.c index e7e20294..a3769e57 100644 --- a/src/audio.c +++ b/src/audio.c @@ -2,10 +2,11 @@ /* RAM_POS: 0x80000450 */ #include "audio.h" +#include "memory.h" #include "types.h" #include "macros.h" - +#include "asset_sections.h" #include "audio_internal.h" @@ -124,7 +125,7 @@ void func_80000968(s32 arg0); ALCSPlayer* func_80002224(s32, s32); void func_8000B010(ALCSPlayer*, u8); void *allocate_from_main_pool_safe(u32, u32); -void *func_80076C58(u32); +void *load_asset_section_from_rom(u32); void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size); void audio_init(u32 arg0){ @@ -135,39 +136,36 @@ void audio_init(u32 arg0){ u32 seq_max_len; u32 tmp2; audioMgrConfig audConfig; - - // Uncomment this to test shiftibilty! - //*((s32*)0x803FFFFC) = 0xDEADBEEF; seq_max_len = 0; alHeapInit(&gALHeap, gBssSectionStart, AUDIO_HEAP_SIZE); - reg_s2 = func_80076C58(38); - ALBankFile_80115D14 = (ALBankFile*) allocate_from_main_pool_safe(reg_s2[2] - reg_s2[1], 0x00FFFFFF); - func_80076E68(39, ALBankFile_80115D14, reg_s2[1], reg_s2[2] - reg_s2[1]); - alBnkfNew(ALBankFile_80115D14, func_80076EE8(39, reg_s2[2])); + reg_s2 = load_asset_section_from_rom(ASSET_AUDIO_TABLE); + ALBankFile_80115D14 = (ALBankFile*) allocate_from_main_pool_safe(reg_s2[2] - reg_s2[1], COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D14, reg_s2[1], reg_s2[2] - reg_s2[1]); + alBnkfNew(ALBankFile_80115D14, get_rom_offset_of_asset(ASSET_AUDIO, reg_s2[2])); D_80115D28 = reg_s2[7] - reg_s2[6]; - D_80115D18 = (unk80115D18 *) allocate_from_main_pool_safe(D_80115D28, 0x00FFFFFF); - func_80076E68(39, D_80115D18, reg_s2[6], D_80115D28); + D_80115D18 = (unk80115D18 *) allocate_from_main_pool_safe(D_80115D28, COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, D_80115D18, reg_s2[6], D_80115D28); D_80115D20 = D_80115D28/10; D_80115D2C = reg_s2[6]-reg_s2[5]; - D_80115D1C = (unk80115D1C *) allocate_from_main_pool_safe(D_80115D2C, 0x00FFFFFF); - func_80076E68(39, D_80115D1C, reg_s2[5], D_80115D2C); + D_80115D1C = (unk80115D1C *) allocate_from_main_pool_safe(D_80115D2C, COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, D_80115D1C, reg_s2[5], D_80115D2C); D_80115D24 = D_80115D2C/3; - ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(reg_s2[0], 0x00FFFFFF); - func_80076E68(39, ALBankFile_80115D10, 0, reg_s2[0]); - alBnkfNew(ALBankFile_80115D10, func_80076EE8(39, reg_s2[0])); + ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(reg_s2[0], COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D10, 0, reg_s2[0]); + alBnkfNew(ALBankFile_80115D10, get_rom_offset_of_asset(ASSET_AUDIO, reg_s2[0])); ALSeqFile_80115CF8 = (ALSeqFile *) alHeapDBAlloc(0,0,&gALHeap,1,4); - func_80076E68(39, ALSeqFile_80115CF8, reg_s2[4], 4); + load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, reg_s2[4], 4); seqfSize = (ALSeqFile_80115CF8->seqCount)*8 + 4; - ALSeqFile_80115CF8 = allocate_from_main_pool_safe(seqfSize, 0x00FFFFFF); - func_80076E68(39, ALSeqFile_80115CF8, reg_s2[4], seqfSize); - alSeqFileNew(ALSeqFile_80115CF8, func_80076EE8(39, reg_s2[4])); - D_80115D0C = (u32 *)allocate_from_main_pool_safe( (ALSeqFile_80115CF8->seqCount)*4, 0x00FFFFFF); + ALSeqFile_80115CF8 = allocate_from_main_pool_safe(seqfSize, COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, reg_s2[4], seqfSize); + alSeqFileNew(ALSeqFile_80115CF8, get_rom_offset_of_asset(ASSET_AUDIO, reg_s2[4])); + D_80115D0C = (u32 *)allocate_from_main_pool_safe( (ALSeqFile_80115CF8->seqCount)*4, COLOR_TAG_CYAN); for(iCnt = 0; iCnt < ALSeqFile_80115CF8->seqCount; iCnt++){ @@ -194,8 +192,8 @@ void audio_init(u32 arg0){ gMusicPlayer = func_80002224(24, 120); func_8000B010(gMusicPlayer, 18); gSndFxPlayer = func_80002224(16, 50); - D_80115CFC = allocate_from_main_pool_safe( seq_max_len, 0x00FFFFFF); - D_80115D00 = allocate_from_main_pool_safe( seq_max_len, 0x00FFFFFF); + D_80115CFC = allocate_from_main_pool_safe( seq_max_len, COLOR_TAG_CYAN); + D_80115D00 = allocate_from_main_pool_safe( seq_max_len, COLOR_TAG_CYAN); audConfig.unk04 = 150; audConfig.unk00 = 32; audConfig.maxChannels = 16; @@ -883,8 +881,8 @@ GLOBAL_ASM("asm/non_matchings/audio/func_8000232C.s") #else void func_8000232C(ALCSPlayer* seqp, void* ptr, u8* arg2, ALCSeq* seq){ if(alCSPGetState(seqp) == AL_STOPPED && *arg2){ - /*func_80076E68(39, ptr, - (u32)((ALSeqFile_80115CF8->seqArray)[*arg2]) - func_80076EE8(39,0), + /*load_asset_to_address(ASSET_AUDIO, ptr, + (u32)((ALSeqFile_80115CF8->seqArray)[*arg2]) - get_rom_offset_of_asset(ASSET_AUDIO,0), *((u32*)(((*arg2) << 3) + D_80115D0C)));*/ alCSeqNew(seq, ptr); alCSPSetSeq(seqp, seq); diff --git a/src/memory.c b/src/memory.c index 5973c9a3..265e9ece 100644 --- a/src/memory.c +++ b/src/memory.c @@ -26,16 +26,7 @@ const char D_800E7400[] = "\n*** mm Error *** ---> Can't fix the specified block const char D_800E7438[] = "\n*** mm Error *** ---> Can't unfix the specified block.\n"; const char D_800E7474[] = "Colour %x >> %d\n"; const char D_800E7488[] = "Unable to record %d slots, colours overflowed table.\n"; -const char D_800E74C0[] = "RED %d\n"; -const char D_800E74C8[] = "GREEN %d\n"; -const char D_800E74D4[] = "BLUE %d\n"; -const char D_800E74E0[] = "YELLOW %d\n"; -const char D_800E74EC[] = "MAGENTA %d\n"; -const char D_800E74F8[] = "CYAN %d\n"; -const char D_800E7504[] = "WHITE %d\n"; -const char D_800E7510[] = "GREY %d\n"; -const char D_800E751C[] = "ORANGE %d\n\n"; - + /*********************************/ /************ .bss ************/ @@ -51,11 +42,15 @@ typedef struct unk80070BE4_8_0 { typedef struct MemoryPoolSlot { /* 0x00 */ unk80070BE4_8_0 *unk0; /* 0x04 */ s32 size; -/* 0x08 */ s16 isTaken; +/* 0x08 */ s16 flags; + // 0x00 = Slot is free + // 0x01 = Slot is being used? + // 0x02 = ??? + // 0x04 = ??? /* 0x0A */ s16 prevIndex; /* 0x0C */ s16 nextIndex; /* 0x0E */ s16 index; -/* 0x10 */ s32 unk10; +/* 0x10 */ u32 colorTag; } MemoryPoolSlot; /* Size: 0x10 bytes */ @@ -76,15 +71,14 @@ s32 gNumberOfMemoryPools; s32 D_801235C4; /* Size: 0x8 bytes */ -typedef struct unk801235C8 { - u32 unk0; +typedef struct FreeQueueSlot { + void *dataAddress; s8 unk4; - u8 pad5[3]; -} unk801235C8; +} FreeQueueSlot; -unk801235C8 D_801235C8[256]; +FreeQueueSlot gFreeQueue[256]; -s32 D_80123DC8; +s32 gFreeQueueCount; s32 D_80123DCC; s32 D_80123DD0[64]; s32 D_80123ED0[64]; @@ -102,15 +96,17 @@ typedef struct unk800B7D10 { } unk800B7D10; unk800B7D10 *get_stack_pointer(void); -MemoryPoolSlot *allocate_from_memory_pool(s32, s32, s32); +MemoryPoolSlot *allocate_from_memory_pool(s32, s32, u32); -MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *arg0, s32 size, s32 arg2); +MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *arg0, s32 size, s32 numSlots); void func_800710B0(s32); -void* allocate_from_main_pool_safe(s32, s32); +void* allocate_from_main_pool_safe(s32, u32); s32 *func_8006F510(void); void func_8006F53C(s32*); -void func_80071440(TextureHeader *texHeader); +void func_80071440(void *dataAddress); + +s32 get_memory_pool_index_containing_address(u8 *address); /** * Creates the main memory pool. @@ -123,7 +119,7 @@ void init_main_memory_pool(void) { new_memory_pool(&D_8012D3F0, RAM_END - (s32)(&D_8012D3F0), MAIN_POOL_SLOT_COUNT); } func_800710B0(2); - D_80123DC8 = 0; + gFreeQueueCount = 0; } /** @@ -137,14 +133,13 @@ MemoryPoolSlot *new_sub_memory_pool(s32 poolDataSize, s32 numSlots) { MemoryPoolSlot *newPool; size = poolDataSize + (numSlots * sizeof(MemoryPoolSlot)); - slots = (MemoryPoolSlot *)allocate_from_main_pool_safe(size, 0xFFFFFFFF); + slots = (MemoryPoolSlot *)allocate_from_main_pool_safe(size, COLOR_TAG_WHITE); newPool = new_memory_pool(slots, size, numSlots); func_8006F53C(temp); return newPool; } #ifdef NON_MATCHING - MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *slots, s32 poolSize, s32 numSlots) { s32 i; MemoryPool *pool; @@ -169,7 +164,7 @@ MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *slots, s32 poolSize, s32 numSlot firstSlot->unk0 = temp3; } firstSlot->size = poolSize - (numSlots * sizeof(MemoryPoolSlot)); - firstSlot->isTaken = 0; + firstSlot->flags = 0; firstSlot->prevIndex = -1; firstSlot->nextIndex = -1; @@ -181,24 +176,24 @@ MemoryPoolSlot *new_memory_pool(MemoryPoolSlot *slots, s32 poolSize, s32 numSlot GLOBAL_ASM("asm/non_matchings/memory/new_memory_pool.s") #endif -void *allocate_from_main_pool_safe(s32 size, s32 mask) { +void *allocate_from_main_pool_safe(s32 size, u32 colorTag) { void *temp_v0; if (size == 0) { - func_800B7460(*(s32 *)((u8 *)get_stack_pointer() + 0x14), size, mask); + func_800B7460(*(s32 *)((u8 *)get_stack_pointer() + 0x14), size, colorTag); } - temp_v0 = allocate_from_memory_pool(0, size, mask); + temp_v0 = allocate_from_memory_pool(0, size, colorTag); if (temp_v0 == (void *)NULL) { - func_800B7460(*(s32 *)((u8 *)get_stack_pointer() + 0x14), size, mask); + func_800B7460(*(s32 *)((u8 *)get_stack_pointer() + 0x14), size, colorTag); } return temp_v0; } -MemoryPoolSlot *allocate_from_main_pool(s32 size, s32 arg1) { - return allocate_from_memory_pool(0, size, arg1); +MemoryPoolSlot *allocate_from_main_pool(s32 size, u32 colorTag) { + return allocate_from_memory_pool(0, size, colorTag); } #ifdef NON_MATCHING -MemoryPoolSlot *allocate_from_memory_pool(s32 memoryPoolIndex, s32 size, s32 arg2) { +MemoryPoolSlot *allocate_from_memory_pool(s32 memoryPoolIndex, s32 size, u32 colorTag) { MemoryPool *pool; MemoryPoolSlot *curSlot; MemoryPoolSlot *slots; @@ -220,14 +215,14 @@ MemoryPoolSlot *allocate_from_memory_pool(s32 memoryPoolIndex, s32 size, s32 arg phi_s0 = -1; while(phi_a0 != -1) { curSlot = &pool->slots[phi_a0]; - if (!curSlot->isTaken && curSlot->size >= size && curSlot->size < phi_a2) { + if (!curSlot->flags && curSlot->size >= size && curSlot->size < phi_a2) { phi_s0 = phi_a0; phi_a2 = curSlot->size; } phi_a0 = curSlot->nextIndex; } if (phi_s0 != -1) { - allocate_memory_pool_slot(memoryPoolIndex, phi_s0, size, TRUE, FALSE, arg2); + allocate_memory_pool_slot(memoryPoolIndex, phi_s0, size, TRUE, FALSE, colorTag); func_8006F53C(sp28); return pool->slots[phi_s0].unk0; } @@ -249,14 +244,56 @@ void *allocate_from_pool_containing_slots(MemoryPoolSlot *slots, s32 size) { return (void *)NULL; } -GLOBAL_ASM("asm/non_matchings/memory/func_80070EF8.s") +#ifdef NON_MATCHING +void *allocate_at_address_in_main_pool(s32 size, u8* address, u32 colorTag) { + s32 *sp38; + s32 s0; + MemoryPoolSlot *curSlot; + MemoryPoolSlot* slots; + + sp38 = func_8006F510(); + if ((gMemoryPools[0].curNumSlots + 1) == gMemoryPools[0].maxNumSlots) { + func_8006F53C(sp38); + } else { + s0 = 0; + if (size & 0xF) { + size = _ALIGN16(size); // The size of the pool should be 16-byte aligned + } + slots = gMemoryPools[0].slots; + while(s0 != -1) { + curSlot = &slots[s0]; + if (curSlot->flags == 0) { + if ((address >= (u8*)curSlot->unk0) && (((u8*)curSlot->unk0 + curSlot->size) >= (address + size))) { + if (address == (u8*)curSlot->unk0) { + allocate_memory_pool_slot(0, s0, size, 1, 0, colorTag); + func_8006F53C(sp38); + return curSlot->unk0; + } else { + s0 = allocate_memory_pool_slot(0, s0, address - (u8*)curSlot->unk0, 0, 1, colorTag); + allocate_memory_pool_slot(0, s0, size, 1, 0, colorTag); + func_8006F53C(sp38); + return slots[s0].unk0; + } + } + } + s0 = curSlot->nextIndex; + } + func_8006F53C(sp38); + } + return NULL; +} +#else +GLOBAL_ASM("asm/non_matchings/memory/allocate_at_address_in_main_pool.s") +#endif + +void free_slot_containing_address(u8 *address); void func_800710B0(s32 arg0) { s32 *sp2C = func_8006F510(); D_80123DCC = arg0; if (arg0 == 0) { - while (D_80123DC8 > 0) { - func_80071278(D_801235C8[--D_80123DC8].unk0); + while (gFreeQueueCount > 0) { + free_slot_containing_address(gFreeQueue[--gFreeQueueCount].dataAddress); } } func_8006F53C(sp2C); @@ -266,7 +303,7 @@ void func_800710B0(s32 arg0) { void func_80071140(void *data) { s32 *sp1C = func_8006F510(); if (D_80123DCC == 0) { - func_80071278(data); + free_slot_containing_address(data); } else { func_80071440(data); } @@ -274,21 +311,186 @@ void func_80071140(void *data) { } GLOBAL_ASM("asm/non_matchings/memory/func_80071198.s") -GLOBAL_ASM("asm/non_matchings/memory/func_80071278.s") -void func_80071440(TextureHeader *texHeader) { - D_801235C8[D_80123DC8].unk0 = texHeader; - D_801235C8[D_80123DC8].unk4 = D_80123DCC; - D_80123DC8++; -} - -GLOBAL_ASM("asm/non_matchings/memory/func_80071478.s") -GLOBAL_ASM("asm/non_matchings/memory/func_80071538.s") -GLOBAL_ASM("asm/non_matchings/memory/func_800715EC.s") -GLOBAL_ASM("asm/non_matchings/memory/func_8007164C.s") +void free_memory_pool_slot(s32 poolIndex, s32 slotIndex); #ifdef NON_MATCHING -s32 allocate_memory_pool_slot(s32 memoryPoolIndex, s32 slotIndex, s32 size, s32 slotIsTaken, s32 newSlotIsTaken, s32 arg5) { +void free_slot_containing_address(u8 *address) { + s32 poolIndex; + s32 slotIndex; + MemoryPoolSlot *slots; + MemoryPoolSlot *slot; + + poolIndex = get_memory_pool_index_containing_address(address); + slots = gMemoryPools[poolIndex].slots; + for(slotIndex = 0; slotIndex != -1; slotIndex = slot->nextIndex) { + slot = &slots[slotIndex]; + if (address == (u8*)slot->unk0) { + if (slot->flags == 1 || slot->flags == 4) { + free_memory_pool_slot(poolIndex, slotIndex); + } + break; + } + } +} + +// Unused? +void func_80071314(void) { + s32 *sp40; + MemoryPool *pool; + MemoryPoolSlot *slot; + s32 poolIndex; + s32 slotIndex; + + sp40 = func_8006F510(); + + for (poolIndex = gNumberOfMemoryPools; poolIndex != -1; poolIndex--) { + pool = &gMemoryPools[poolIndex]; + for(slotIndex = 0; slotIndex != -1; slotIndex = slot->nextIndex) { + slot = &pool->slots[slotIndex]; + if (slot->flags == 1) { + free_memory_pool_slot(poolIndex, slotIndex); + } + if (slot->flags == 4 && pool->curNumSlots == 1) { + free_memory_pool_slot(poolIndex, slotIndex); + } else { + func_8006F53C(sp40); + return; + } + } + } + func_8006F53C(sp40); +} + +#else +GLOBAL_ASM("asm/non_matchings/memory/free_slot_containing_address.s") +#endif + +void func_80071440(void* data) { + gFreeQueue[gFreeQueueCount].dataAddress = data; + gFreeQueue[gFreeQueueCount].unk4 = D_80123DCC; + gFreeQueueCount++; +} + +s32 func_80071478(u8 *address) { + s32 slotIndex; + MemoryPoolSlot *slot; + MemoryPool *pool; + s32 *sp18; + + sp18 = func_8006F510(); + pool = &gMemoryPools[get_memory_pool_index_containing_address(address)]; + slotIndex = 0; + while(slotIndex != -1) { + slot = slotIndex + pool->slots; // `slot = &pool->slots[slotIndex];` does not match. + if (address == (u8*)slot->unk0) { + if (slot->flags == 1 || slot->flags == 4) { + slot->flags |= 2; + func_8006F53C(sp18); + return 1; + } + } + slotIndex = slot->nextIndex; + } + func_8006F53C(sp18); + return 0; +} + +s32 func_80071538(u8 *address) { + s32 slotIndex; + MemoryPoolSlot *slot; + MemoryPool *pool; + s32 *sp18; + + sp18 = func_8006F510(); + pool = &gMemoryPools[get_memory_pool_index_containing_address(address)]; + slotIndex = 0; + while(slotIndex != -1) { + slot = slotIndex + pool->slots; // `slot = &pool->slots[slotIndex];` does not match. + if (address == (u8*)slot->unk0) { + if (slot->flags & 2) { + slot->flags ^= 2; + func_8006F53C(sp18); + return 1; + } + } + slotIndex = slot->nextIndex; + } + func_8006F53C(sp18); + return 0; +} + +s32 get_memory_pool_index_containing_address(u8 *address) { + s32 i; + MemoryPool *pool; + + for(i = gNumberOfMemoryPools; i > 0; i--) { + pool = &gMemoryPools[i]; + if ((u8*)pool->slots >= address) { + continue; + } + if(address < pool->size + (u8*)pool->slots) { + break; + } + } + return i; +} + +#ifdef NON_MATCHING +// Regalloc issues +void free_memory_pool_slot(s32 poolIndex, s32 slotIndex) { + s32 nextIndex, prevIndex, tempNextIndex; + MemoryPool *pool; + MemoryPoolSlot *slots; + MemoryPoolSlot *slot; + MemoryPoolSlot *nextSlot; + MemoryPoolSlot *prevSlot; + + pool = &gMemoryPools[poolIndex]; + slots = pool->slots; + slot = &slots[slotIndex]; + prevIndex = slot->prevIndex; + nextIndex = slot->nextIndex; + nextSlot = &slots[nextIndex]; + prevSlot = &slots[prevIndex]; + slot->flags = 0; + + if (nextIndex != -1) { + if(nextSlot->flags == 0) { + slot->size += nextSlot->size; + tempNextIndex = nextSlot->nextIndex; + slot->nextIndex = tempNextIndex; + if (tempNextIndex != -1) { + slots[tempNextIndex].prevIndex = slotIndex; + } + pool->curNumSlots--; + slots[pool->curNumSlots].index = nextIndex; + } + } + if (prevIndex != -1) { + if(prevSlot->flags == 0) { + prevSlot->size += slot->size; + tempNextIndex = slot->nextIndex; + prevSlot->nextIndex = tempNextIndex; + if (tempNextIndex != -1) { + slots[tempNextIndex].prevIndex = prevIndex; + } + pool->curNumSlots--; + slots[pool->curNumSlots].index = slotIndex; + } + } +} + +// Unused? +MemoryPoolSlot *func_80071774(s32 poolIndex) { + return gMemoryPools[poolIndex].slots; +} +#else +GLOBAL_ASM("asm/non_matchings/memory/free_memory_pool_slot.s") +#endif + +#ifdef NON_MATCHING +s32 allocate_memory_pool_slot(s32 memoryPoolIndex, s32 slotIndex, s32 size, s32 slotIsTaken, s32 newSlotIsTaken, u32 colorTag) { s32 slotSize; s32 newIndex; s32 futureIndex; @@ -299,16 +501,16 @@ s32 allocate_memory_pool_slot(s32 memoryPoolIndex, s32 slotIndex, s32 size, s32 pool = &gMemoryPools[memoryPoolIndex]; slot = &pool->slots[slotIndex]; slotSize = slot->size; - slot->isTaken = slotIsTaken; + slot->flags = slotIsTaken; slot->size = size; - slot->unk10 = arg5; + slot->colorTag = colorTag; if (size < slotSize) { newIndex = pool->slots[pool->curNumSlots].index; pool->curNumSlots++; newSlot = &pool->slots[newIndex]; newSlot->unk0 = ((u8*)slot->unk0) + size; newSlot->size = slotSize - size; - newSlot->isTaken = newSlotIsTaken; + newSlot->flags = newSlotIsTaken; futureIndex = slot->nextIndex; newSlot->prevIndex = slotIndex; newSlot->nextIndex = futureIndex; @@ -326,72 +528,59 @@ GLOBAL_ASM("asm/non_matchings/memory/allocate_memory_pool_slot.s") GLOBAL_ASM("asm/non_matchings/memory/func_80071850.s") -GLOBAL_ASM("asm/non_matchings/memory/func_80071A24.s") -#if 1 -GLOBAL_ASM("asm/non_matchings/memory/func_80071D30.s") -#else -void func_8007164C(s32 arg0, s16 arg1) { - s16 temp_a2; - s16 temp_t0; - s16 temp_t1; - s16 temp_t1_2; - s32 temp_lo; - s32 temp_lo_2; - s32 temp_t5; - s32 temp_t5_2; - s32 temp_v0; - void *temp_a0; - void *temp_a0_2; - void *temp_a3; - void *temp_v1; - - temp_v1 = (arg0 * 0x10) + &gMemoryPools; - temp_v0 = temp_v1->unk8; - temp_a3 = (arg1 * 0x14) + temp_v0; - temp_a2 = temp_a3->unkC; - temp_t0 = temp_a3->unkA; - temp_a3->unk8 = (u16)0; - if (temp_a2 != -1) { - temp_a0 = (temp_a2 * 0x14) + temp_v0; - if (temp_a0->unk8 == 0) { - temp_a3->unk4 = (s32) (temp_a3->unk4 + temp_a0->unk4); - temp_t1 = temp_a0->unkC; - temp_a3->unkC = temp_t1; - if (temp_t1 != -1) { - (temp_v0 + (temp_t1 * 0x14))->unkA = arg1; - } - temp_t5 = temp_v1->unk4 - 1; - temp_lo = temp_t5 * 0x14; - temp_v1->unk4 = temp_t5; - (temp_v0 + temp_lo)->unkE = temp_a2; - } - } - if (temp_t0 != -1) { - temp_a0_2 = (temp_t0 * 0x14) + temp_v0; - if (temp_a0_2->unk8 == 0) { - temp_a0_2->unk4 = (s32) (temp_a0_2->unk4 + temp_a3->unk4); - temp_t1_2 = temp_a3->unkC; - temp_a0_2->unkC = temp_t1_2; - if (temp_t1_2 != -1) { - (temp_v0 + (temp_t1_2 * 0x14))->unkA = temp_t0; - } - temp_t5_2 = temp_v1->unk4 - 1; - temp_lo_2 = temp_t5_2 * 0x14; - temp_v1->unk4 = temp_t5_2; - (temp_v0 + temp_lo_2)->unkE = arg1; +#ifdef NON_MATCHING +s32 get_memory_color_tag_count(s32 arg0) { + s32 i, count; + count = 0; + for(i = 0; i < 80; i++) { // Issue with this loop + if ((gMemoryPools[0].slots[i].flags) && (arg0 == gMemoryPools[0].slots[i].colorTag)) { + count++; } } + return count; } +#else +GLOBAL_ASM("asm/non_matchings/memory/get_memory_color_tag_count.s") #endif +/** + * Unused. + * Prints out the counts for each color tag in the main pool. + */ +void print_memory_color_tags(void) { + stubbed_printf("RED %d\n", get_memory_color_tag_count(COLOR_TAG_RED)); + stubbed_printf("GREEN %d\n", get_memory_color_tag_count(COLOR_TAG_GREEN)); + stubbed_printf("BLUE %d\n", get_memory_color_tag_count(COLOR_TAG_BLUE)); + stubbed_printf("YELLOW %d\n", get_memory_color_tag_count(COLOR_TAG_YELLOW)); + stubbed_printf("MAGENTA %d\n", get_memory_color_tag_count(COLOR_TAG_MAGENTA)); + stubbed_printf("CYAN %d\n", get_memory_color_tag_count(COLOR_TAG_CYAN)); + stubbed_printf("WHITE %d\n", get_memory_color_tag_count(COLOR_TAG_WHITE)); + stubbed_printf("GREY %d\n", get_memory_color_tag_count(COLOR_TAG_GRAY)); + stubbed_printf("ORANGE %d\n\n", get_memory_color_tag_count(COLOR_TAG_ORANGE)); +} + +/** + * Unused. + * Draws the counts for each color tag in the main pool. + * See: https://tcrf.net/Diddy_Kong_Racing#Current_Colors + */ +void render_memory_color_tags(void) { + set_render_printf_background_color(0, 0, 0, 128); + render_printf("RED %d\n", get_memory_color_tag_count(COLOR_TAG_RED)); + render_printf("GREEN %d\n", get_memory_color_tag_count(COLOR_TAG_GREEN)); + render_printf("BLUE %d\n", get_memory_color_tag_count(COLOR_TAG_BLUE)); + render_printf("YELLOW %d\n", get_memory_color_tag_count(COLOR_TAG_YELLOW)); + render_printf("MAGENTA %d\n", get_memory_color_tag_count(COLOR_TAG_MAGENTA)); + render_printf("CYAN %d\n", get_memory_color_tag_count(COLOR_TAG_CYAN)); + render_printf("WHITE %d\n", get_memory_color_tag_count(COLOR_TAG_WHITE)); + render_printf("GREY %d\n", get_memory_color_tag_count(COLOR_TAG_GRAY)); + render_printf("ORANGE %d\n\n", get_memory_color_tag_count(COLOR_TAG_ORANGE)); +} + +GLOBAL_ASM("asm/non_matchings/memory/func_80071C74.s") +GLOBAL_ASM("asm/non_matchings/memory/func_80071CE8.s") +GLOBAL_ASM("asm/non_matchings/memory/func_80071D30.s") GLOBAL_ASM("asm/non_matchings/memory/func_80071E58.s") GLOBAL_ASM("asm/non_matchings/memory/func_80071F80.s") GLOBAL_ASM("asm/non_matchings/memory/func_800720DC.s") - - - - - - - diff --git a/src/memory.h b/src/memory.h index 876ec5d4..8ee632b8 100644 --- a/src/memory.h +++ b/src/memory.h @@ -1,4 +1,15 @@ -#ifndef _UNKNOWN_071730_H_ -#define _UNKNOWN_071730_H_ +#ifndef _MEMORY_H_ +#define _MEMORY_H_ + +#define COLOR_TAG_RED 0xFF0000FF +#define COLOR_TAG_GREEN 0x00FF00FF +#define COLOR_TAG_BLUE 0x0000FFFF +#define COLOR_TAG_YELLOW 0xFFFF00FF +#define COLOR_TAG_MAGENTA 0xFF00FFFF +#define COLOR_TAG_CYAN 0x00FFFFFF +#define COLOR_TAG_WHITE 0xFFFFFFFF +#define COLOR_TAG_GRAY 0x7F7F7FFF +#define COLOR_TAG_ORANGE 0xFF7F7FFF +#define COLOR_TAG_BLACK 0x000000FF #endif \ No newline at end of file diff --git a/src/menu.c b/src/menu.c index af4d7233..08570ff7 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2,6 +2,7 @@ /* RAM_POS: 0x8007F900 */ #include "menu.h" +#include "memory.h" #include "types.h" #include "macros.h" @@ -2305,8 +2306,8 @@ void menu_save_options_init(void) { gMenuDelay = 0; D_801263E0 = 1; D_801263D8 = 0; - D_80126A64 = (s32)allocate_from_main_pool_safe(0x800, 0xFFFFFFFF); - D_80126A0C = (s32)allocate_from_main_pool_safe(0xA00, 0xFFFFFFFF); + D_80126A64 = (s32)allocate_from_main_pool_safe(0x800, COLOR_TAG_WHITE); + D_80126A0C = (s32)allocate_from_main_pool_safe(0xA00, COLOR_TAG_WHITE); D_80126A04 = (s32)(D_80126A0C + 0x500); D_80126A08 = 0; D_80126BD4 = 0; @@ -2582,7 +2583,7 @@ void func_800887E8(void) { s32 i; // Starting point - D_80126AA0[0] = allocate_from_main_pool_safe(0x200, 0xFFFFFFFF); + D_80126AA0[0] = allocate_from_main_pool_safe(0x200, COLOR_TAG_WHITE); // Fills in the table. for(i = 1; i < 16; i++) { @@ -4369,7 +4370,7 @@ void func_8009C8A4(s16 *arg0) { s32 get_random_number_from_range(s32, s32); void func_8009C904(s32 arg0) { if (D_800DF75C == NULL) { - D_800DF75C = allocate_from_main_pool_safe(sizeof(unk800DF510) * 18, 0xFF0000FF); + D_800DF75C = allocate_from_main_pool_safe(sizeof(unk800DF510) * 18, COLOR_TAG_RED); } D_800DF75C[arg0].unk0 = D_800DF510[arg0].unk0; diff --git a/src/unknown_003260.c b/src/unknown_003260.c index 1ef04f7e..99f85b46 100644 --- a/src/unknown_003260.c +++ b/src/unknown_003260.c @@ -2,6 +2,7 @@ /* RAM_POS: 0x80002660 */ #include "unknown_003260.h" +#include "memory.h" #define AL_SNDP_PLAY_EVT (1 << 0) #define AL_SNDP_STOP_EVT (1 << 1) @@ -111,10 +112,10 @@ void audioNewThread(ALSynConfig* c, OSPri p, s32 arg2){ } if(c->fxType == AL_FX_CUSTOM){ - reg_v0 = func_80076C58(38); + reg_v0 = load_asset_section_from_rom(ASSET_AUDIO_TABLE); tmp_size = reg_v0[9]-reg_v0[8]; - reg_s0 = allocate_from_main_pool_safe(tmp_size, 0x00FFFFFF, reg_v0[8]); - func_80076E68(39,reg_s0, reg_v0[8],tmp_size); + reg_s0 = allocate_from_main_pool_safe(tmp_size, COLOR_TAG_CYAN); + load_asset_to_address(39,reg_s0, reg_v0[8],tmp_size); c->params = reg_s0; c[1].maxVVoices = 0; alInit(&ALGlobals_801161D0, c); diff --git a/src/unknown_003260.h b/src/unknown_003260.h index 4a8e10d3..b8c483ad 100644 --- a/src/unknown_003260.h +++ b/src/unknown_003260.h @@ -4,6 +4,7 @@ #include "types.h" #include "macros.h" #include "audio_internal.h" +#include "asset_sections.h" #include "libultra_internal.h" typedef struct unk800DC6BC_40 { diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 01012854..d13bbdc8 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -2,12 +2,13 @@ /* RAM_POS: 0x8000B020 */ #include "unknown_00BC20.h" +#include "memory.h" #include "types.h" #include "macros.h" #include "structs.h" #include "fast3d.h" - +#include "asset_sections.h" /************ .data ************/ @@ -282,7 +283,7 @@ void func_8000C460(void); void *new_sub_memory_pool(s32, u32); void *allocate_from_main_pool_safe(s32, u32); -s32 *func_80076C58(s32); +s32 *load_asset_section_from_rom(s32); void particlePtrList_addObject(Player *); void particlePtrList_flush(void); void func_8001D258(f32, f32, s32, s32, s32); @@ -350,44 +351,44 @@ void func_8000BF8C(void) { func_8001D258(0.67f, 0.33f, 0, -0x2000, 0); D_8011AE68 = (s32*)new_sub_memory_pool(0x15800, 0x200); - particlePtrList = (Player **)allocate_from_main_pool_safe(0x320, 0xFFFF); - D_8011AE6C = (s32*)allocate_from_main_pool_safe(0x50, 0xFFFF); - D_8011AE74 = (s32*)allocate_from_main_pool_safe(0x200, 0xFFFF); - D_8011AECC = (unknown8011AECC*)allocate_from_main_pool_safe(0xE10, 0xFFFF); - D_8011AEDC = (s32*)allocate_from_main_pool_safe(0x50, 0xFFFF); - playerStructArray_Ptr = (s32*)allocate_from_main_pool_safe(0x28, 0xFFFF); - D_8011AEEC = (s32*)allocate_from_main_pool_safe(0x28, 0xFFFF); - D_8011AEE8 = (s32*)allocate_from_main_pool_safe(0x28, 0xFFFF); - D_8011AF04 = (s32*)allocate_from_main_pool_safe(0x200, 0xFFFF); - D_8011ADCC = (s32*)allocate_from_main_pool_safe(8, 0xFFFF); - D_8011AFF4 = (s32*)allocate_from_main_pool_safe(0x400, 0xFFFF); - D_8011AEB8 = (s32*)func_80076C58(0x23); - D_8011AEBC = (func_80076F30(0x23) >> 1) - 1; + particlePtrList = (Player **)allocate_from_main_pool_safe(0x320, COLOR_TAG_BLUE); + D_8011AE6C = (s32*)allocate_from_main_pool_safe(0x50, COLOR_TAG_BLUE); + D_8011AE74 = (s32*)allocate_from_main_pool_safe(0x200, COLOR_TAG_BLUE); + D_8011AECC = (unknown8011AECC*)allocate_from_main_pool_safe(0xE10, COLOR_TAG_BLUE); + D_8011AEDC = (s32*)allocate_from_main_pool_safe(0x50, COLOR_TAG_BLUE); + playerStructArray_Ptr = (s32*)allocate_from_main_pool_safe(0x28, COLOR_TAG_BLUE); + D_8011AEEC = (s32*)allocate_from_main_pool_safe(0x28, COLOR_TAG_BLUE); + D_8011AEE8 = (s32*)allocate_from_main_pool_safe(0x28, COLOR_TAG_BLUE); + D_8011AF04 = (s32*)allocate_from_main_pool_safe(0x200, COLOR_TAG_BLUE); + D_8011ADCC = (s32*)allocate_from_main_pool_safe(8, COLOR_TAG_BLUE); + D_8011AFF4 = (s32*)allocate_from_main_pool_safe(0x400, COLOR_TAG_BLUE); + D_8011AEB8 = (s32*)load_asset_section_from_rom(ASSET_LEVEL_OBJECT_TRANSLATION_TABLE); + D_8011AEBC = (get_size_of_asset_section(ASSET_LEVEL_OBJECT_TRANSLATION_TABLE) >> 1) - 1; while (D_8011AEB8[D_8011AEBC] == 0) { D_8011AEBC--; } - D_8011AD58 = (s32*)allocate_from_main_pool_safe(0x800, 0xFFFF); - D_8011AD64 = func_80076C58(0x21); + D_8011AD58 = (s32*)allocate_from_main_pool_safe(0x800, COLOR_TAG_BLUE); + D_8011AD64 = load_asset_section_from_rom(ASSET_OBJECT_HEADERS_TABLE); D_8011AD68 = 0; while (-1 != D_8011AD64[D_8011AD68]) { D_8011AD68++; } D_8011AD68--; - D_8011AE48 = (s32*)allocate_from_main_pool_safe(D_8011AD68 << 2, 0xFFFFFFFF); - D_8011AE4C = (s32*)allocate_from_main_pool_safe(D_8011AD68, 0xFFFFFFFF); + D_8011AE48 = (s32*)allocate_from_main_pool_safe(D_8011AD68 << 2, COLOR_TAG_WHITE); + D_8011AE4C = (s32*)allocate_from_main_pool_safe(D_8011AD68, COLOR_TAG_WHITE); for (i = 0; i < D_8011AD68; i++) { (*D_8011AE4C)[i] = 0; } - D_8011AD6C = func_80076C58(0xF); - D_8011AD70 = func_80076C58(0x10); + D_8011AD6C = load_asset_section_from_rom(ASSET_MISC); + D_8011AD70 = load_asset_section_from_rom(ASSET_MISC_TABLE); D_8011ADA0 = 0; while (-1 != D_8011AD70[D_8011ADA0]) { D_8011ADA0++; } func_8000C2D8(&D_8011AD6C[D_8011AD70[65]], (D_8011AD70[66] - D_8011AD70[65]) * 4); - objPtrList = (Player**)allocate_from_main_pool_safe(0x800, 0xFFFF); + objPtrList = (Player**)allocate_from_main_pool_safe(0x800, COLOR_TAG_BLUE); D_8011ADC4 = 0; gTimeTrialEnabled = 0; D_8011AEF5 = 0; diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index 3fa3bf60..e99cbd08 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -288,9 +288,9 @@ void func_800249F0(u32 arg0, u32 arg1, s32 arg2, u32 arg3, u32 arg4, u32 arg5, u D_8011B0FC = 0; i = 0; do{ - D_8011D350[i] = allocate_from_main_pool_safe(3200, 0xFFFF00FF); - D_8011D320[i] = allocate_from_main_pool_safe(12800, 0xFFFF00FF); - D_8011D338[i] = allocate_from_main_pool_safe(20000, 0xFFFF00FF); + D_8011D350[i] = allocate_from_main_pool_safe(3200, COLOR_TAG_YELLOW); + D_8011D320[i] = allocate_from_main_pool_safe(12800, COLOR_TAG_YELLOW); + D_8011D338[i] = allocate_from_main_pool_safe(20000, COLOR_TAG_YELLOW); }while(&D_8011D338[++i] != &D_8011D348); D_8011B0C8 = 0; diff --git a/src/unknown_043920.c b/src/unknown_043920.c index 60abe1c8..dd72ce96 100644 --- a/src/unknown_043920.c +++ b/src/unknown_043920.c @@ -2,6 +2,7 @@ /* RAM_POS: 0x80042D20 */ #include "unknown_043920.h" +#include "memory.h" #include "types.h" #include "macros.h" @@ -517,7 +518,7 @@ GLOBAL_ASM("asm/non_matchings/unknown_043920/func_80059208.s") GLOBAL_ASM("asm/non_matchings/unknown_043920/func_80059790.s") void func_800598D0(void) { - D_8011D590[0] = allocate_from_main_pool_safe(0x21C0, 0xFF0000FF); + D_8011D590[0] = allocate_from_main_pool_safe(0x21C0, COLOR_TAG_RED); D_8011D590[1] = D_8011D590[0] + 0x10E0; D_8011D590[2] = 0; D_8011D5A0[0] = 0; diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 6062d2a6..a10365ad 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -2,11 +2,13 @@ /* RAM_POS: 0x8006A6B0 */ #include "unknown_06B2B0.h" +#include "memory.h" #include "types.h" #include "macros.h" #include "structs.h" #include "fast3d.h" +#include "asset_sections.h" #include "menu.h" /************ .rodata ************/ @@ -264,8 +266,8 @@ GLOBAL_ASM("asm/non_matchings/unknown_066AA0/load_level.s") #else Settings *get_settings(void); -s32 *func_80076C58(s32); -LevelHeader *allocate_from_main_pool_safe(s32, s32); +s32 *load_asset_section_from_rom(s32); +void *allocate_from_main_pool_safe(s32, s32); void func_8006C1AC(s32 arg0, s32 arg1, s32 arg2, s32 arg3); void func_8006C2E4(void); s16 func_8006C2F0(void); @@ -292,7 +294,7 @@ void load_level(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { s32 phi_s0_3; s32 phi_s0_5; s32 phi_v1_9; - s32 temp, temp2; + s32 size, offset; func_80072708(); if (arg4 == -1) { @@ -313,7 +315,7 @@ void load_level(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { } settings = get_settings(); - D_80121160 = func_80076C58(0x16); + D_80121160 = load_asset_section_from_rom(ASSET_LEVEL_HEADERS_TABLE); phi_v1 = 0; while (-1 != D_80121160[phi_v1]) { phi_v1++; @@ -322,10 +324,10 @@ void load_level(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { if (arg0 >= phi_v1) { arg0 = 0; } - temp2 = D_80121160[arg0]; - temp = D_80121160[arg0 + 1] - temp2; - gCurrentLevelHeader = allocate_from_main_pool_safe(temp, 0xFFFF00FF); - func_80076E68(0x17, gCurrentLevelHeader, temp2, temp); + offset = D_80121160[arg0]; + size = D_80121160[arg0 + 1] - offset; + gCurrentLevelHeader = (LevelHeader*)allocate_from_main_pool_safe(size, COLOR_TAG_YELLOW); + load_asset_to_address(ASSET_LEVEL_HEADERS, gCurrentLevelHeader, offset, size); D_800DD330 = 0; sp44 = arg0; if (gCurrentLevelHeader->race_type == 0) { @@ -390,10 +392,10 @@ void load_level(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { D_800DD32C = 0; if (sp44 != arg0) { func_80071140(gCurrentLevelHeader); - temp2 = D_80121160[arg0]; - temp = D_80121160[arg0 + 1] - temp2; - gCurrentLevelHeader = allocate_from_main_pool_safe(temp, 0xFFFF00FF); - func_80076E68(0x17, gCurrentLevelHeader, temp2, temp); + offset = D_80121160[arg0]; + size = D_80121160[arg0 + 1] - offset; + gCurrentLevelHeader = allocate_from_main_pool_safe(size, COLOR_TAG_YELLOW); + load_asset_to_address(ASSET_LEVEL_HEADERS, gCurrentLevelHeader, offset, size); } func_80071140(D_80121160); func_8006BFC8(&gCurrentLevelHeader->unk20); @@ -577,7 +579,7 @@ void func_8006BEFC(void) { } Settings *get_settings(void); -s32 *func_80076C58(s32); +s32 *load_asset_section_from_rom(s32); #ifdef NON_MATCHING void func_8006BFC8(s8 *arg0) { @@ -615,7 +617,7 @@ void func_8006BFC8(s8 *arg0) { if (func_8006DA0C() == 1) { phi_s0 = 5; } - D_80121160 = func_80076C58(1); + D_80121160 = load_asset_section_from_rom(ASSET_UNKNOWN_0_TABLE); phi_v1 = 0; while (-1 != (s32)D_80121160[phi_v1]) { phi_v1++; @@ -626,8 +628,8 @@ void func_8006BFC8(s8 *arg0) { } temp2 = D_80121160[phi_s0]; temp = D_80121160[phi_s0 + 1] - temp2; - D_801211C0[0] = allocate_from_main_pool_safe(temp, 0xFFFF00FF); - func_80076E68(0, D_801211C0[0], temp2, temp); + D_801211C0[0] = allocate_from_main_pool_safe(temp, COLOR_TAG_YELLOW); + load_asset_to_address(ASSET_UNKNOWN_0, D_801211C0[0], temp2, temp); func_80071140(D_80121160); } #else @@ -788,7 +790,6 @@ void func_8006C3E0(void) { void render(void) { s32 phi_v0; s32 phi_v0_2; - s32 i; if (D_800DD380 == 8) { D_801211F8 = D_801211F0[D_801234E8]; @@ -1303,7 +1304,7 @@ extern unk80121200 *D_80121200[3]; extern unk80121210 *D_80121210[3]; extern unk80121220 *D_80121220[3]; -void *allocate_from_main_pool_safe(s32, s32); // Allocates memory? +void *allocate_from_main_pool_safe(s32, s32); void func_8006EFDC(void) { s32 size; @@ -1316,7 +1317,7 @@ void func_8006EFDC(void) { (D_800DD3DC * sizeof(unk80121200)) + (D_800DD3CC * sizeof(unk80121210)); - current = (s8*)allocate_from_main_pool_safe(size, 0xFF0000FF); + current = (s8*)allocate_from_main_pool_safe(size, COLOR_TAG_RED); D_801211F0[0] = (Gfx*)current; current += (D_800DD3BC * sizeof(Gfx)); D_80121200[0] = (unk80121200*)current; @@ -1325,7 +1326,7 @@ void func_8006EFDC(void) { current += (D_800DD3CC * sizeof(unk80121210)); D_80121220[0] = (unk80121220*)current; - current = (s8*)allocate_from_main_pool_safe(size, 0xFFFF00FF); + current = (s8*)allocate_from_main_pool_safe(size, COLOR_TAG_YELLOW); D_801211F0[1] = (Gfx*)current; current += (D_800DD3BC * sizeof(Gfx)); D_80121200[1] = (unk80121200*)current; diff --git a/src/unknown_072E50.c b/src/unknown_072E50.c index 98166ecf..38097260 100644 --- a/src/unknown_072E50.c +++ b/src/unknown_072E50.c @@ -2,6 +2,7 @@ /* RAM_POS: 0x80072250 */ #include "unknown_072E50.h" +#include "memory.h" #include "types.h" #include "macros.h" @@ -153,7 +154,7 @@ s32 func_80076AF4(s32 arg0, s32 arg1) { s32 ret; ret = 6; - temp = allocate_from_main_pool_safe(0x100, 0xFF); + temp = allocate_from_main_pool_safe(0x100, COLOR_TAG_BLACK); if (func_80076610(arg0, arg1, temp, 0x100) == 0) { switch(*temp) { case 0x47414D44: // GAMD diff --git a/src/unknown_0777A0.c b/src/unknown_0777A0.c index 1dec65a3..b44545e3 100644 --- a/src/unknown_0777A0.c +++ b/src/unknown_0777A0.c @@ -2,7 +2,9 @@ /* RAM_POS: 0x80076BA0 */ #include "unknown_0777A0.h" +#include "memory.h" +//#include "assets.h" #include "types.h" #include "macros.h" #include "ultra64.h" @@ -15,7 +17,7 @@ OSMesgQueue D_80124220; OSMesg D_80124238; s32 D_80124240[14]; OSMesgQueue D_80124278; -s32 *D_80124290; +s32 *gAssetsLookupTable; /*******************************/ @@ -27,69 +29,67 @@ s32 func_80071478(s32*); void dmacopy(u32 romOffset, u8 *ramAddress, s32 numBytes); void func_80076BA0(void) { - u32 size; - osCreateMesgQueue(&D_80124278, &D_80124238, 0x10); + u32 assetTableSize; + osCreateMesgQueue(&D_80124278, &D_80124238, 16); osCreateMesgQueue(&D_80124220, &D_80124218, 1); - osCreatePiManager(0x96, &D_80124278, &D_80124238, 0x10); - size = &__ASSETS_LUT_END - &__ASSETS_LUT_START; - D_80124290 = (s32*)allocate_from_main_pool_safe(size, 0x7F7F7FFF); - func_80071478(D_80124290); - dmacopy(&__ASSETS_LUT_START, D_80124290, size); + osCreatePiManager(150, &D_80124278, &D_80124238, 16); + assetTableSize = &__ASSETS_LUT_END - &__ASSETS_LUT_START; + gAssetsLookupTable = (s32*)allocate_from_main_pool_safe(assetTableSize, COLOR_TAG_GRAY); + func_80071478(gAssetsLookupTable); + dmacopy(&__ASSETS_LUT_START, gAssetsLookupTable, assetTableSize); } - -#if 1 -GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076C58.s") -#else -// This function is OK -s32 *func_80076C58(u32 arg0) { - s32 *temp; - s32 *temp2; +/** + * Returns the memory address containing an asset section loaded from ROM. + */ +s32 *load_asset_section_from_rom(u32 assetIndex) { + s32 *index; + s32 *out; s32 size; s32 start; - if (D_80124290[0] < arg0) { + if (gAssetsLookupTable[0] < assetIndex) { return NULL; } - arg0++; - temp = arg0 + D_80124290; - start = *temp; - size = *(temp + 1) - start; - temp2 = (s32*)allocate_from_main_pool_safe(size, 0x7F7F7FFF); - if (temp2 == NULL) { + assetIndex++; + index = assetIndex + gAssetsLookupTable; + start = *index; + size = *(index + 1) - start; + out = (s32*)allocate_from_main_pool_safe(size, COLOR_TAG_GRAY); + if (out == NULL) { return NULL; } - dmacopy(start + &__ASSETS_LUT_END, temp2, size); - return temp2; + dmacopy(start + &__ASSETS_LUT_END, out, size); + return out; } -// Unused? +#ifdef NON_MATCHING // This has regalloc & stack issues. -u8 *func_80076CF0(u32 arg0, s32 arg1) { +u8 *func_80076CF0(u32 assetIndex, s32 arg1) { s32 size; s32 sp2C; s32 start; - s32 *temp; + s32 *index; u8 *temp_a1; u8 *temp_v0_2; u8 *temp_v0_3; u8 *temp_a0; - if (D_80124290[0] < arg0) { + if (gAssetsLookupTable[0] < assetIndex) { return NULL; } - arg0++; - temp = arg0 + D_80124290; - start = *temp; - size = *(temp + 1) - start; + assetIndex++; + index = assetIndex + gAssetsLookupTable; + start = *index; + size = *(index + 1) - start; - temp_v0_2 = (u8*)allocate_from_main_pool_safe(8, 0xFFFFFFFF); + temp_v0_2 = (u8*)allocate_from_main_pool_safe(8, COLOR_TAG_WHITE); temp_a0 = start + &__ASSETS_LUT_END; dmacopy(temp_a0, temp_v0_2, 8); sp2C = byteswap32(temp_v0_2) + arg1; func_80071140(temp_v0_2); - temp_v0_3 = (u8*)allocate_from_main_pool_safe(sp2C + arg1, 0x7F7F7FFF); + temp_v0_3 = (u8*)allocate_from_main_pool_safe(sp2C + arg1, COLOR_TAG_GRAY); if (temp_v0_3 == NULL) { return NULL; @@ -99,66 +99,86 @@ u8 *func_80076CF0(u32 arg0, s32 arg1) { func_800C6218(temp_a1, temp_v0_3); return temp_v0_3; } - -// Unused? -// This function is OK -s32 func_80076DFC(u32 arg0, s32 *arg1) { - s32 start; - s32 size; - u8 *temp; - if (D_80124290[0] < arg0) { - return 0; - } - arg0++; - temp = arg0 + D_80124290; - start = *temp; - size = *(temp + 1) - start; - dmacopy(start + &__ASSETS_LUT_END, arg1, size); - return size; -} +#else +GLOBAL_ASM("asm/non_matchings/unknown_072E50/load_asset_section_from_rom.s") #endif -s32 func_80076E68(u32 arg0, s32 *arg1, s32 arg2, s32 arg3) { - s32 *temp; - s32 temp2; +/** + * Unused. + * Loads an asset section to a specific memory address. + * Returns the size of asset section. + */ +s32 load_asset_section_from_rom_to_address(u32 assetIndex, s32 *address) { + s32 start; + s32 size; + s32 *index; + if (gAssetsLookupTable[0] < assetIndex) { + return 0; + } + assetIndex++; + index = assetIndex + gAssetsLookupTable; + start = *index; + size = *(index + 1) - start; + dmacopy(start + &__ASSETS_LUT_END, address, size); + return size; +} + +/** + * Loads part of an asset section to a specific memory address. + * Returns the size argument. + */ +s32 load_asset_to_address(u32 assetIndex, s32 *address, s32 assetOffset, s32 size) { + s32 *index; + s32 start; - if (arg3 == 0 || D_80124290[0] < arg0) { + if (size == 0 || gAssetsLookupTable[0] < assetIndex) { return 0; } - arg0++; - temp = arg0 + D_80124290; - temp2 = *temp + arg2; - dmacopy(temp2 + &__ASSETS_LUT_END, arg1, arg3); - return arg3; + assetIndex++; + index = assetIndex + gAssetsLookupTable; + start = *index + assetOffset; + dmacopy(start + &__ASSETS_LUT_END, address, size); + return size; } -u8 *func_80076EE8(u32 arg0, s32 arg1) { - s32 *temp; - s32 temp2; - s32 temp3; - if (D_80124290[0] < arg0) { +/** + * Returns a rom offset of an asset given its asset section and a local offset. + */ +u8 *get_rom_offset_of_asset(u32 assetIndex, s32 assetOffset) { + s32 *index; + s32 start; + + if (gAssetsLookupTable[0] < assetIndex) { return NULL; } - arg0++; - temp = arg0 + D_80124290; - temp3 = *temp + arg1; - return temp3 + &__ASSETS_LUT_END; + + assetIndex++; + index = assetIndex + gAssetsLookupTable; + start = *index + assetOffset; + return start + &__ASSETS_LUT_END; } -s32 func_80076F30(u32 arg0) { - s32 *temp; +/** + * Returns the size of an asset section. + */ +s32 get_size_of_asset_section(u32 assetIndex) { + s32 *index; - if (D_80124290[0] < arg0) { + if (gAssetsLookupTable[0] < assetIndex) { return 0; } - arg0++; - temp = arg0 + D_80124290; - return *(temp + 1) - *temp; + + assetIndex++; + index = assetIndex + gAssetsLookupTable; + return *(index + 1) - *index; } -#define MAX_TRANSFER_SIZE 0x5000 // Why did they pick 20 KB as the transfer limit? +#define MAX_TRANSFER_SIZE 0x5000 +/** + * Copies data from the game cartridge to a ram address. + */ void dmacopy(u32 romOffset, u8 *ramAddress, s32 numBytes) { s32 sp4C; s32 numBytesToDMA; diff --git a/src/unknown_080240.c b/src/unknown_080240.c index 59e63cb3..6ce93102 100644 --- a/src/unknown_080240.c +++ b/src/unknown_080240.c @@ -2,10 +2,12 @@ /* RAM_POS: 0x8007F640 */ #include "unknown_080240.h" +#include "memory.h" #include "types.h" #include "macros.h" #include "fast3d.h" +#include "asset_sections.h" /************ .data ************/ @@ -17,12 +19,13 @@ Gfx D_800DF440[] = { /*******************************/ +// Unused? u32 func_8007F640(s32 arg0) { u32 someAddr; s32 count, start, size; s32 *lut; - lut = (s32 *)func_80076C58(0xB); // Returns a lookup table? + lut = (s32 *)load_asset_section_from_rom(ASSET_EMPTY_10_TABLE); count = 0; @@ -43,9 +46,9 @@ u32 func_8007F640(s32 arg0) { start = lut[arg0]; size = lut[arg0 + 1] - start; - someAddr = allocate_from_main_pool_safe(size, 0xFFFF); + someAddr = allocate_from_main_pool_safe(size, COLOR_TAG_BLUE); - func_80076E68(10, someAddr, start, size); + load_asset_to_address(ASSET_EMPTY_10, someAddr, start, size); func_80071140(lut); return someAddr; diff --git a/src/unknown_0B3D40.c b/src/unknown_0B3D40.c index 172e4689..f647032e 100644 --- a/src/unknown_0B3D40.c +++ b/src/unknown_0B3D40.c @@ -69,8 +69,10 @@ GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/sprintf.s") GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B5E88.s") GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/render_printf.s") GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B5F78.s") -GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B62B4.s") -GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B635C.s") +GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/set_render_printf_color.s") +GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/set_render_printf_background_color.s") +GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/set_render_printf_position.s") +GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B63F4.s") GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B653C.s") GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B695C.s") GLOBAL_ASM("asm/non_matchings/unknown_0AEE70/func_800B69FC.s") diff --git a/src/unknown_0B7A50.c b/src/unknown_0B7A50.c index 5e8638c5..1c01c5fb 100644 --- a/src/unknown_0B7A50.c +++ b/src/unknown_0B7A50.c @@ -335,7 +335,7 @@ void render_epc_lock_up_display(void) { s3 = 0; - func_800B635C(0x10, 0x20); + set_render_printf_position(0x10, 0x20); switch (D_800E3024) { case 0: diff --git a/src/unknown_0C4800.c b/src/unknown_0C4800.c index 6606103f..7e4808f2 100644 --- a/src/unknown_0C4800.c +++ b/src/unknown_0C4800.c @@ -1,8 +1,11 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x800C3C00 */ +#include "memory.h" + #include "types.h" #include "macros.h" +#include "asset_sections.h" #include "libultra_internal.h" /************ .data ************/ @@ -231,7 +234,7 @@ GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3C00.s") extern u32* D_8012A7E4; void func_800C3C00(void){ s32 i; - D_8012A7E4 = func_80076C58(44); + D_8012A7E4 = load_asset_section_from_rom(ASSET_BINARY_44); D_8012A7E0 = *(D_8012A7E4++); for(i = 0; i< D_8012A7E0; i++){ D_8012A7E0[] @@ -603,8 +606,8 @@ void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgC void func_800C6170(void) { - D_800E3760 = allocate_from_main_pool_safe(0x2800, 0xFF); - D_800E3764 = allocate_from_main_pool_safe(0x10, 0xFF); + D_800E3760 = allocate_from_main_pool_safe(0x2800, COLOR_TAG_BLACK); + D_800E3764 = allocate_from_main_pool_safe(0x10, COLOR_TAG_BLACK); } // Returns the little-endian value from a byte array. @@ -618,7 +621,7 @@ s32 byteswap32(u8* arg0) { } s32 func_800C61DC(s32 arg0, s32 arg1) { - func_80076E68(arg0, D_800E3764, arg1, 8); + load_asset_to_address(arg0, D_800E3764, arg1, 8); return byteswap32(D_800E3764); } diff --git a/tools/dkr_extractor_classes/config.cpp b/tools/dkr_extractor_classes/config.cpp index a403005a..fb7900bc 100644 --- a/tools/dkr_extractor_classes/config.cpp +++ b/tools/dkr_extractor_classes/config.cpp @@ -169,6 +169,10 @@ void ExtractConfig::extract(ROM& rom, json::JSON& assetsJson) { json::JSON outputAsset = json::Object(); outputAsset["type"] = type; + if(section.hasKey("name")) { + outputAsset["name"] = section["name"].ToString(); + } + if(type == "Table") { assetsJson["assets"].append(outputAsset); continue; diff --git a/tools/python/check_if_need_to_extract.py b/tools/python/check_if_need_to_extract.py new file mode 100644 index 00000000..2031888f --- /dev/null +++ b/tools/python/check_if_need_to_extract.py @@ -0,0 +1,36 @@ +import argparse +import hashlib +import subprocess +from file_util import FileUtil + +parser = argparse.ArgumentParser(description="") +parser.add_argument("version", help="DKR version.", choices=['us_1.0']) +args = parser.parse_args() + +version = args.version + +extractConfigsDirectory = './extract-ver' +assetsDirectory = './assets' +ucodeDirectory = './assets' +extractConfigFilename = extractConfigsDirectory + '/' + version + '.config.json' +configChecksumFilename = extractConfigFilename + '.md5' + +needToExtract = False + +if not FileUtil.does_file_exist(assetsDirectory): + needToExtract = True +elif not FileUtil.does_file_exist(ucodeDirectory): + needToExtract = True +elif not FileUtil.does_file_exist(configChecksumFilename): + needToExtract = True +else: + md5Calculated = hashlib.md5(FileUtil.get_bytes_from_file(extractConfigFilename)).hexdigest() + md5Saved = FileUtil.get_text_from_file(configChecksumFilename) + if md5Calculated != md5Saved: + needToExtract = True + +if needToExtract: + md5Calculated = hashlib.md5(FileUtil.get_bytes_from_file(extractConfigFilename)).hexdigest() + FileUtil.write_text_to_file(configChecksumFilename, md5Calculated) + subprocess.run(['./extract.sh', version]) + \ No newline at end of file diff --git a/tools/python/generate_assets.py b/tools/python/generate_assets.py index df9abd42..23551bf1 100644 --- a/tools/python/generate_assets.py +++ b/tools/python/generate_assets.py @@ -5,6 +5,9 @@ import os from file_util import FileUtil +INCLUDE_DIRECTORY = './include' +ASSETS_INCLUDE = INCLUDE_DIRECTORY + '/asset_sections.h' + class GenerateAssets: def __init__(self, rootDir, version): self.ASSETS_FILENAME = rootDir + '/asm/assets/assets.s' @@ -22,6 +25,8 @@ class GenerateAssets: assetsJSON = json.load(jsonFile) assets = assetsJSON['assets'] + self.generate_asset_sections_header_file(assets) + assetsTextFinal = '# This file was generated by generate_ld.py\n\n' assetsTextFinal += '.include "macros.inc"\n\n' @@ -132,4 +137,14 @@ class GenerateAssets: def generate_ucode_file(self, label, path): return 'glabel ' + label + '\n.incbin "' + self.BUILD_DIR + '/' + path + '"\n' + def generate_asset_sections_header_file(self, assets): + out = '/* This file was generated by generate_ld.py */\n' + out += '\n#ifndef _ASSET_SECTIONS_H_\n#define _ASSET_SECTIONS_H_\n\n' + for i in range(0, len(assets)): + asset = assets[i] + out += '#define ASSET_' + asset['name'] + ' ' + str(i) + '\n' + + out += '\n#endif\n' + with open(ASSETS_INCLUDE, "w") as assetSectionsFile: + assetSectionsFile.write(out)