From 3e416d33ddb73e807a4191c985d0b248d5ca4ff6 Mon Sep 17 00:00:00 2001 From: David Benepe Date: Wed, 6 Apr 2022 19:58:23 -0400 Subject: [PATCH] Decompiled 4 functions from unknown_0ABDF0 --- README.md | 48 +-- .../font/{func_800C4170.s => load_font.s} | 2 +- .../font/{func_800C422C.s => unload_font.s} | 2 +- asm/non_matchings/game_ui/func_800AB1F0.s | 74 ---- asm/non_matchings/game_ui/func_800AB35C.s | 93 ----- asm/non_matchings/game_ui/func_800ABB34.s | 80 ---- asm/non_matchings/game_ui/func_800ABC5C.s | 147 -------- .../menu/menu_game_select_init.s | 2 +- asm/non_matchings/menu/menu_ghost_data_init.s | 2 +- .../menu/menu_track_select_init.s | 2 +- .../menu/menu_trophy_race_rankings_init.s | 2 +- .../menu/menu_trophy_race_round_init.s | 2 +- include/asset_sections.h | 57 --- lib/src/mips1/al/alFxNew.c | 12 +- src/asset_loading.c | 55 ++- src/asset_loading.h | 1 + src/audio.c | 18 +- src/fade_transition.c | 2 +- src/font.c | 16 +- src/font.h | 6 +- src/game.c | 24 +- src/game_text.c | 4 +- src/game_text.h | 2 +- src/gzip.c | 4 +- src/memory.c | 38 +- src/memory.h | 20 +- src/menu.c | 348 +++++++++--------- src/object_models.c | 8 +- src/objects.c | 32 +- src/particles.c | 2 +- src/racer.c | 8 +- src/save_data.c | 20 +- src/screen_asset.c | 2 +- src/screen_asset.h | 2 +- src/textures_sprites.c | 2 +- src/textures_sprites.h | 2 +- src/unknown_003260.c | 2 +- src/unknown_003260.h | 2 +- src/unknown_008C40.c | 6 +- src/unknown_0255E0.c | 6 +- src/unknown_032760.c | 2 +- src/unknown_0ABDF0.c | 170 ++++++++- src/unknown_0ABDF0.h | 13 +- src/video.c | 8 +- tools/python/generate_assets.py | 2 + tools/python/generate_ld.py | 18 +- 46 files changed, 531 insertions(+), 839 deletions(-) rename asm/non_matchings/font/{func_800C4170.s => load_font.s} (99%) rename asm/non_matchings/font/{func_800C422C.s => unload_font.s} (99%) delete mode 100644 asm/non_matchings/game_ui/func_800AB1F0.s delete mode 100644 asm/non_matchings/game_ui/func_800AB35C.s delete mode 100644 asm/non_matchings/game_ui/func_800ABB34.s delete mode 100644 asm/non_matchings/game_ui/func_800ABC5C.s delete mode 100644 include/asset_sections.h diff --git a/README.md b/README.md index abc18124..61447f8f 100755 --- a/README.md +++ b/README.md @@ -113,31 +113,31 @@ s32 is_drumstick_unlocked(void) { } ``` -As of Feburary 23rd, 2022, this is our current score: +As of April 6th, 2022, this is our current score: ``` - ===================================================================== - ADVENTURE ONE (ASM -> C Decompilation) - -------------------------- 21.15% Complete -------------------------- - # Decompiled functions: 1048 - # GLOBAL_ASM remaining: 699 - # NON_MATCHING functions: 6 - # NON_EQUIVALENT WIP functions: 91 - ---------------------------- Game Status ---------------------------- - Balloons: 11/47, Keys: 1/4, Trophies: 0/5 - T.T. Amulets: 1/4, Wizpig Amulets: 0/4 - --------------------------------------------------------------------- - We are collecting silver coins in Hot Top Volcano. (8/8 silver coins) - ===================================================================== - ADVENTURE TWO (Cleanup & Documentation) - -------------------------- 2.73% Complete -------------------------- - # Documented functions: 141 - # Undocumented remaining: 1606 - ---------------------------- Game Status ---------------------------- - Balloons: 1/47, Keys: 0/4, Trophies: 0/5 - T.T. Amulets: 0/4, Wizpig Amulets: 0/4 - --------------------------------------------------------------------- - We are collecting the second balloon on Timber's Island. - ===================================================================== + ======================================================== + ADVENTURE ONE (ASM -> C Decompilation) + ------------------- 22.11% Complete -------------------- + # Decompiled functions: 1068 + # GLOBAL_ASM remaining: 680 + # NON_MATCHING functions: 8 + # NON_EQUIVALENT WIP functions: 109 + --------------------- Game Status ---------------------- + Balloons: 12/47, Keys: 1/4, Trophies: 0/5 + T.T. Amulets: 1/4, Wizpig Amulets: 0/4 + -------------------------------------------------------- + We are racing in the rematch against Trickytops. + ======================================================== + ADVENTURE TWO (Cleanup & Documentation) + ------------------- 2.73% Complete -------------------- + # Documented functions: 141 + # Undocumented remaining: 1607 + --------------------- Game Status ---------------------- + Balloons: 1/47, Keys: 0/4, Trophies: 0/5 + T.T. Amulets: 0/4, Wizpig Amulets: 0/4 + -------------------------------------------------------- + We are collecting the second balloon on Timber's Island. + ======================================================== ``` --- diff --git a/asm/non_matchings/font/func_800C4170.s b/asm/non_matchings/font/load_font.s similarity index 99% rename from asm/non_matchings/font/func_800C4170.s rename to asm/non_matchings/font/load_font.s index 45969de3..27fc97e8 100644 --- a/asm/non_matchings/font/func_800C4170.s +++ b/asm/non_matchings/font/load_font.s @@ -1,4 +1,4 @@ -glabel func_800C4170 +glabel load_font /* 0C4D70 800C4170 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 0C4D74 800C4174 3C0E8013 */ lui $t6, %hi(gNumberOfFonts) # $t6, 0x8013 /* 0C4D78 800C4178 8DCEA7E0 */ lw $t6, %lo(gNumberOfFonts)($t6) diff --git a/asm/non_matchings/font/func_800C422C.s b/asm/non_matchings/font/unload_font.s similarity index 99% rename from asm/non_matchings/font/func_800C422C.s rename to asm/non_matchings/font/unload_font.s index 2d1af972..78a1affb 100644 --- a/asm/non_matchings/font/func_800C422C.s +++ b/asm/non_matchings/font/unload_font.s @@ -1,4 +1,4 @@ -glabel func_800C422C +glabel unload_font /* 0C4E2C 800C422C 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 0C4E30 800C4230 3C0E8013 */ lui $t6, %hi(gNumberOfFonts) # $t6, 0x8013 /* 0C4E34 800C4234 8DCEA7E0 */ lw $t6, %lo(gNumberOfFonts)($t6) diff --git a/asm/non_matchings/game_ui/func_800AB1F0.s b/asm/non_matchings/game_ui/func_800AB1F0.s deleted file mode 100644 index 089ab32b..00000000 --- a/asm/non_matchings/game_ui/func_800AB1F0.s +++ /dev/null @@ -1,74 +0,0 @@ -glabel func_800AB1F0 -/* 0ABDF0 800AB1F0 3C03800E */ lui $v1, %hi(D_800E28D8) # $v1, 0x800e -/* 0ABDF4 800AB1F4 246328D8 */ addiu $v1, %lo(D_800E28D8) # addiu $v1, $v1, 0x28d8 -/* 0ABDF8 800AB1F8 AC600000 */ sw $zero, ($v1) -/* 0ABDFC 800AB1FC AC600004 */ sw $zero, 4($v1) -/* 0ABE00 800AB200 3C01800E */ lui $at, %hi(D_800E28D4) # $at, 0x800e -/* 0ABE04 800AB204 AC2028D4 */ sw $zero, %lo(D_800E28D4)($at) -/* 0ABE08 800AB208 3C028012 */ lui $v0, %hi(D_80127C00) # $v0, 0x8012 -/* 0ABE0C 800AB20C 3C018012 */ lui $at, %hi(D_80127BB0) # $at, 0x8012 -/* 0ABE10 800AB210 240E0006 */ li $t6, 6 -/* 0ABE14 800AB214 24427C00 */ addiu $v0, %lo(D_80127C00) # addiu $v0, $v0, 0x7c00 -/* 0ABE18 800AB218 AC207BB0 */ sw $zero, %lo(D_80127BB0)($at) -/* 0ABE1C 800AB21C 000EC080 */ sll $t8, $t6, 2 -/* 0ABE20 800AB220 AC4E0000 */ sw $t6, ($v0) -/* 0ABE24 800AB224 AC580000 */ sw $t8, ($v0) -/* 0ABE28 800AB228 00184043 */ sra $t0, $t8, 1 -/* 0ABE2C 800AB22C 3C018012 */ lui $at, %hi(D_80127C04) # $at, 0x8012 -/* 0ABE30 800AB230 3C04800E */ lui $a0, %hi(D_800E2914) # $a0, 0x800e -/* 0ABE34 800AB234 AC287C04 */ sw $t0, %lo(D_80127C04)($at) -/* 0ABE38 800AB238 24842914 */ addiu $a0, %lo(D_800E2914) # addiu $a0, $a0, 0x2914 -/* 0ABE3C 800AB23C AC800000 */ sw $zero, ($a0) -/* 0ABE40 800AB240 AC800004 */ sw $zero, 4($a0) -/* 0ABE44 800AB244 3C01800E */ lui $at, %hi(D_800E290C) # $at, 0x800e -/* 0ABE48 800AB248 3C058012 */ lui $a1, %hi(D_80127BF8) # $a1, 0x8012 -/* 0ABE4C 800AB24C AC20290C */ sw $zero, %lo(D_800E290C)($at) -/* 0ABE50 800AB250 24A57BF8 */ addiu $a1, %lo(D_80127BF8) # addiu $a1, $a1, 0x7bf8 -/* 0ABE54 800AB254 2406FFFF */ li $a2, -1 -/* 0ABE58 800AB258 2409FE00 */ li $t1, -512 -/* 0ABE5C 800AB25C A4A60000 */ sh $a2, ($a1) -/* 0ABE60 800AB260 A4A90002 */ sh $t1, 2($a1) -/* 0ABE64 800AB264 3C01800E */ lui $at, %hi(D_800E2A80) # $at, 0x800e -/* 0ABE68 800AB268 AC202A80 */ sw $zero, %lo(D_800E2A80)($at) -/* 0ABE6C 800AB26C 3C01800E */ lui $at, %hi(D_800E2A84) # $at, 0x800e -/* 0ABE70 800AB270 240A0001 */ li $t2, 1 -/* 0ABE74 800AB274 AC2A2A84 */ sw $t2, %lo(D_800E2A84)($at) -/* 0ABE78 800AB278 3C07800E */ lui $a3, %hi(D_800E291C) # $a3, 0x800e -/* 0ABE7C 800AB27C 3C01800E */ lui $at, %hi(D_800E2A88) # $at, 0x800e -/* 0ABE80 800AB280 24E7291C */ addiu $a3, %lo(D_800E291C) # addiu $a3, $a3, 0x291c -/* 0ABE84 800AB284 AC202A88 */ sw $zero, %lo(D_800E2A88)($at) -/* 0ABE88 800AB288 8CEB0000 */ lw $t3, ($a3) -/* 0ABE8C 800AB28C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0ABE90 800AB290 15600018 */ bnez $t3, .L800AB2F4 -/* 0ABE94 800AB294 AFBF0014 */ sw $ra, 0x14($sp) -/* 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 -/* 0ABEA8 800AB2A8 24E7291C */ addiu $a3, %lo(D_800E291C) # addiu $a3, $a3, 0x291c -/* 0ABEAC 800AB2AC 24842920 */ addiu $a0, %lo(D_800E2920) # addiu $a0, $a0, 0x2920 -/* 0ABEB0 800AB2B0 00006080 */ sll $t4, $zero, 2 -/* 0ABEB4 800AB2B4 ACE20000 */ sw $v0, ($a3) -/* 0ABEB8 800AB2B8 AC800000 */ sw $zero, ($a0) -/* 0ABEBC 800AB2BC 004C6821 */ addu $t5, $v0, $t4 -/* 0ABEC0 800AB2C0 8DAE0000 */ lw $t6, ($t5) -/* 0ABEC4 800AB2C4 2406FFFF */ li $a2, -1 -/* 0ABEC8 800AB2C8 00402825 */ move $a1, $v0 -/* 0ABECC 800AB2CC 10CE0009 */ beq $a2, $t6, .L800AB2F4 -/* 0ABED0 800AB2D0 00001825 */ move $v1, $zero -/* 0ABED4 800AB2D4 246F0001 */ addiu $t7, $v1, 1 -.L800AB2D8: -/* 0ABED8 800AB2D8 000FC080 */ sll $t8, $t7, 2 -/* 0ABEDC 800AB2DC 00B8C821 */ addu $t9, $a1, $t8 -/* 0ABEE0 800AB2E0 AC8F0000 */ sw $t7, ($a0) -/* 0ABEE4 800AB2E4 8F280000 */ lw $t0, ($t9) -/* 0ABEE8 800AB2E8 01E01825 */ move $v1, $t7 -/* 0ABEEC 800AB2EC 14C8FFFA */ bne $a2, $t0, .L800AB2D8 -/* 0ABEF0 800AB2F0 246F0001 */ addiu $t7, $v1, 1 -.L800AB2F4: -/* 0ABEF4 800AB2F4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0ABEF8 800AB2F8 3C018012 */ lui $at, %hi(D_80127C08) # $at, 0x8012 -/* 0ABEFC 800AB2FC AC207C08 */ sw $zero, %lo(D_80127C08)($at) -/* 0ABF00 800AB300 03E00008 */ jr $ra -/* 0ABF04 800AB304 27BD0018 */ addiu $sp, $sp, 0x18 - diff --git a/asm/non_matchings/game_ui/func_800AB35C.s b/asm/non_matchings/game_ui/func_800AB35C.s deleted file mode 100644 index e2b95e2a..00000000 --- a/asm/non_matchings/game_ui/func_800AB35C.s +++ /dev/null @@ -1,93 +0,0 @@ -glabel func_800AB35C -/* 0ABF5C 800AB35C 3C04800E */ lui $a0, %hi(D_800E290C) # $a0, 0x800e -/* 0ABF60 800AB360 8C84290C */ lw $a0, %lo(D_800E290C)($a0) -/* 0ABF64 800AB364 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0ABF68 800AB368 10800005 */ beqz $a0, .L800AB380 -/* 0ABF6C 800AB36C AFBF0014 */ sw $ra, 0x14($sp) -/* 0ABF70 800AB370 0C01C450 */ jal free_from_memory_pool -/* 0ABF74 800AB374 00000000 */ nop -/* 0ABF78 800AB378 3C01800E */ lui $at, %hi(D_800E290C) # $at, 0x800e -/* 0ABF7C 800AB37C AC20290C */ sw $zero, %lo(D_800E290C)($at) -.L800AB380: -/* 0ABF80 800AB380 3C02800E */ lui $v0, %hi(D_800E2914) # $v0, 0x800e -/* 0ABF84 800AB384 24422914 */ addiu $v0, %lo(D_800E2914) # addiu $v0, $v0, 0x2914 -/* 0ABF88 800AB388 8C440000 */ lw $a0, ($v0) -/* 0ABF8C 800AB38C 00000000 */ nop -/* 0ABF90 800AB390 10800006 */ beqz $a0, .L800AB3AC -/* 0ABF94 800AB394 00000000 */ nop -/* 0ABF98 800AB398 0C01C450 */ jal free_from_memory_pool -/* 0ABF9C 800AB39C 00000000 */ nop -/* 0ABFA0 800AB3A0 3C02800E */ lui $v0, %hi(D_800E2914) # $v0, 0x800e -/* 0ABFA4 800AB3A4 24422914 */ addiu $v0, %lo(D_800E2914) # addiu $v0, $v0, 0x2914 -/* 0ABFA8 800AB3A8 AC400000 */ sw $zero, ($v0) -.L800AB3AC: -/* 0ABFAC 800AB3AC 8C440004 */ lw $a0, 4($v0) -/* 0ABFB0 800AB3B0 00000000 */ nop -/* 0ABFB4 800AB3B4 10800006 */ beqz $a0, .L800AB3D0 -/* 0ABFB8 800AB3B8 00000000 */ nop -/* 0ABFBC 800AB3BC 0C01C450 */ jal free_from_memory_pool -/* 0ABFC0 800AB3C0 00000000 */ nop -/* 0ABFC4 800AB3C4 3C02800E */ lui $v0, %hi(D_800E2914) # $v0, 0x800e -/* 0ABFC8 800AB3C8 24422914 */ addiu $v0, %lo(D_800E2914) # addiu $v0, $v0, 0x2914 -/* 0ABFCC 800AB3CC AC400004 */ sw $zero, 4($v0) -.L800AB3D0: -/* 0ABFD0 800AB3D0 3C04800E */ lui $a0, %hi(D_800E28D4) # $a0, 0x800e -/* 0ABFD4 800AB3D4 8C8428D4 */ lw $a0, %lo(D_800E28D4)($a0) -/* 0ABFD8 800AB3D8 00000000 */ nop -/* 0ABFDC 800AB3DC 10800005 */ beqz $a0, .L800AB3F4 -/* 0ABFE0 800AB3E0 00000000 */ nop -/* 0ABFE4 800AB3E4 0C01C450 */ jal free_from_memory_pool -/* 0ABFE8 800AB3E8 00000000 */ nop -/* 0ABFEC 800AB3EC 3C01800E */ lui $at, %hi(D_800E28D4) # $at, 0x800e -/* 0ABFF0 800AB3F0 AC2028D4 */ sw $zero, %lo(D_800E28D4)($at) -.L800AB3F4: -/* 0ABFF4 800AB3F4 3C02800E */ lui $v0, %hi(D_800E28D8) # $v0, 0x800e -/* 0ABFF8 800AB3F8 244228D8 */ addiu $v0, %lo(D_800E28D8) # addiu $v0, $v0, 0x28d8 -/* 0ABFFC 800AB3FC 8C440000 */ lw $a0, ($v0) -/* 0AC000 800AB400 00000000 */ nop -/* 0AC004 800AB404 10800006 */ beqz $a0, .L800AB420 -/* 0AC008 800AB408 00000000 */ nop -/* 0AC00C 800AB40C 0C01C450 */ jal free_from_memory_pool -/* 0AC010 800AB410 00000000 */ nop -/* 0AC014 800AB414 3C02800E */ lui $v0, %hi(D_800E28D8) # $v0, 0x800e -/* 0AC018 800AB418 244228D8 */ addiu $v0, %lo(D_800E28D8) # addiu $v0, $v0, 0x28d8 -/* 0AC01C 800AB41C AC400000 */ sw $zero, ($v0) -.L800AB420: -/* 0AC020 800AB420 8C440008 */ lw $a0, 8($v0) -/* 0AC024 800AB424 00000000 */ nop -/* 0AC028 800AB428 10800006 */ beqz $a0, .L800AB444 -/* 0AC02C 800AB42C 00000000 */ nop -/* 0AC030 800AB430 0C01ECAF */ jal free_texture -/* 0AC034 800AB434 00000000 */ nop -/* 0AC038 800AB438 3C02800E */ lui $v0, %hi(D_800E28D8) # $v0, 0x800e -/* 0AC03C 800AB43C 244228D8 */ addiu $v0, %lo(D_800E28D8) # addiu $v0, $v0, 0x28d8 -/* 0AC040 800AB440 AC400008 */ sw $zero, 8($v0) -.L800AB444: -/* 0AC044 800AB444 3C04800E */ lui $a0, %hi(D_800E2910) # $a0, 0x800e -/* 0AC048 800AB448 8C842910 */ lw $a0, %lo(D_800E2910)($a0) -/* 0AC04C 800AB44C 00000000 */ nop -/* 0AC050 800AB450 10800005 */ beqz $a0, .L800AB468 -/* 0AC054 800AB454 00000000 */ nop -/* 0AC058 800AB458 0C01C450 */ jal free_from_memory_pool -/* 0AC05C 800AB45C 00000000 */ nop -/* 0AC060 800AB460 3C01800E */ lui $at, %hi(D_800E2910) # $at, 0x800e -/* 0AC064 800AB464 AC202910 */ sw $zero, %lo(D_800E2910)($at) -.L800AB468: -/* 0AC068 800AB468 3C01800E */ lui $at, %hi(D_800E2A88) # $at, 0x800e -/* 0AC06C 800AB46C AC202A88 */ sw $zero, %lo(D_800E2A88)($at) -/* 0AC070 800AB470 3C01800E */ lui $at, %hi(D_800E2A80) # $at, 0x800e -/* 0AC074 800AB474 3C0F800E */ lui $t7, %hi(D_800E2C5C) # $t7, 0x800e -/* 0AC078 800AB478 8DEF2C5C */ lw $t7, %lo(D_800E2C5C)($t7) -/* 0AC07C 800AB47C AC202A80 */ sw $zero, %lo(D_800E2A80)($at) -/* 0AC080 800AB480 3C01800E */ lui $at, %hi(D_800E2A84) # $at, 0x800e -/* 0AC084 800AB484 240E0001 */ li $t6, 1 -/* 0AC088 800AB488 11E00003 */ beqz $t7, .L800AB498 -/* 0AC08C 800AB48C AC2E2A84 */ sw $t6, %lo(D_800E2A84)($at) -/* 0AC090 800AB490 0C02B488 */ jal func_800AD220 -/* 0AC094 800AB494 00000000 */ nop -.L800AB498: -/* 0AC098 800AB498 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AC09C 800AB49C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0AC0A0 800AB4A0 03E00008 */ jr $ra -/* 0AC0A4 800AB4A4 00000000 */ nop - diff --git a/asm/non_matchings/game_ui/func_800ABB34.s b/asm/non_matchings/game_ui/func_800ABB34.s deleted file mode 100644 index 1696e98c..00000000 --- a/asm/non_matchings/game_ui/func_800ABB34.s +++ /dev/null @@ -1,80 +0,0 @@ -glabel func_800ABB34 -/* 0AC734 800ABB34 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0AC738 800ABB38 AFB40028 */ sw $s4, 0x28($sp) -/* 0AC73C 800ABB3C 3C14800E */ lui $s4, %hi(D_800E28D8) # $s4, 0x800e -/* 0AC740 800ABB40 269428D8 */ addiu $s4, %lo(D_800E28D8) # addiu $s4, $s4, 0x28d8 -/* 0AC744 800ABB44 8E820004 */ lw $v0, 4($s4) -/* 0AC748 800ABB48 3C0E0001 */ lui $t6, 1 -/* 0AC74C 800ABB4C 01C2001A */ div $zero, $t6, $v0 -/* 0AC750 800ABB50 AFB5002C */ sw $s5, 0x2c($sp) -/* 0AC754 800ABB54 AFB60030 */ sw $s6, 0x30($sp) -/* 0AC758 800ABB58 AFB20020 */ sw $s2, 0x20($sp) -/* 0AC75C 800ABB5C AFB1001C */ sw $s1, 0x1c($sp) -/* 0AC760 800ABB60 AFB00018 */ sw $s0, 0x18($sp) -/* 0AC764 800ABB64 AFBF0034 */ sw $ra, 0x34($sp) -/* 0AC768 800ABB68 AFB30024 */ sw $s3, 0x24($sp) -/* 0AC76C 800ABB6C 14400002 */ bnez $v0, .L800ABB78 -/* 0AC770 800ABB70 00000000 */ nop -/* 0AC774 800ABB74 0007000D */ break 7 -.L800ABB78: -/* 0AC778 800ABB78 2401FFFF */ li $at, -1 -/* 0AC77C 800ABB7C 14410004 */ bne $v0, $at, .L800ABB90 -/* 0AC780 800ABB80 3C018000 */ lui $at, 0x8000 -/* 0AC784 800ABB84 15C10002 */ bne $t6, $at, .L800ABB90 -/* 0AC788 800ABB88 00000000 */ nop -/* 0AC78C 800ABB8C 0006000D */ break 6 -.L800ABB90: -/* 0AC790 800ABB90 00008825 */ move $s1, $zero -/* 0AC794 800ABB94 00008025 */ move $s0, $zero -/* 0AC798 800ABB98 00009025 */ move $s2, $zero -/* 0AC79C 800ABB9C 3C16FFFC */ lui $s6, 0xfffc -/* 0AC7A0 800ABBA0 0000A812 */ mflo $s5 -/* 0AC7A4 800ABBA4 1840001C */ blez $v0, .L800ABC18 -.L800ABBA8: -/* 0AC7A8 800ABBA8 02209825 */ move $s3, $s1 -/* 0AC7AC 800ABBAC 00137C00 */ sll $t7, $s3, 0x10 -/* 0AC7B0 800ABBB0 000F9C03 */ sra $s3, $t7, 0x10 -/* 0AC7B4 800ABBB4 00132400 */ sll $a0, $s3, 0x10 -/* 0AC7B8 800ABBB8 0004CC03 */ sra $t9, $a0, 0x10 -/* 0AC7BC 800ABBBC 0C01C20B */ jal func_8007082C -/* 0AC7C0 800ABBC0 03202025 */ move $a0, $t9 -/* 0AC7C4 800ABBC4 8E890000 */ lw $t1, ($s4) -/* 0AC7C8 800ABBC8 000240C0 */ sll $t0, $v0, 3 -/* 0AC7CC 800ABBCC 01305021 */ addu $t2, $t1, $s0 -/* 0AC7D0 800ABBD0 AD480000 */ sw $t0, ($t2) -/* 0AC7D4 800ABBD4 8E8B0000 */ lw $t3, ($s4) -/* 0AC7D8 800ABBD8 00132400 */ sll $a0, $s3, 0x10 -/* 0AC7DC 800ABBDC 00046C03 */ sra $t5, $a0, 0x10 -/* 0AC7E0 800ABBE0 01706021 */ addu $t4, $t3, $s0 -/* 0AC7E4 800ABBE4 AD960004 */ sw $s6, 4($t4) -/* 0AC7E8 800ABBE8 0C01C20C */ jal func_80070830 -/* 0AC7EC 800ABBEC 01A02025 */ move $a0, $t5 -/* 0AC7F0 800ABBF0 8E8F0000 */ lw $t7, ($s4) -/* 0AC7F4 800ABBF4 00027040 */ sll $t6, $v0, 1 -/* 0AC7F8 800ABBF8 01F0C021 */ addu $t8, $t7, $s0 -/* 0AC7FC 800ABBFC AF0E0008 */ sw $t6, 8($t8) -/* 0AC800 800ABC00 8E990004 */ lw $t9, 4($s4) -/* 0AC804 800ABC04 26520001 */ addiu $s2, $s2, 1 -/* 0AC808 800ABC08 0259082A */ slt $at, $s2, $t9 -/* 0AC80C 800ABC0C 2610000C */ addiu $s0, $s0, 0xc -/* 0AC810 800ABC10 1420FFE5 */ bnez $at, .L800ABBA8 -/* 0AC814 800ABC14 02358821 */ addu $s1, $s1, $s5 -.L800ABC18: -/* 0AC818 800ABC18 3C09800E */ lui $t1, %hi(D_800E291C) # $t1, 0x800e -/* 0AC81C 800ABC1C 8D29291C */ lw $t1, %lo(D_800E291C)($t1) -/* 0AC820 800ABC20 00000000 */ nop -/* 0AC824 800ABC24 8D240000 */ lw $a0, ($t1) -/* 0AC828 800ABC28 0C01EB9D */ jal load_texture -/* 0AC82C 800ABC2C 00000000 */ nop -/* 0AC830 800ABC30 8FBF0034 */ lw $ra, 0x34($sp) -/* 0AC834 800ABC34 AE820008 */ sw $v0, 8($s4) -/* 0AC838 800ABC38 8FB40028 */ lw $s4, 0x28($sp) -/* 0AC83C 800ABC3C 8FB00018 */ lw $s0, 0x18($sp) -/* 0AC840 800ABC40 8FB1001C */ lw $s1, 0x1c($sp) -/* 0AC844 800ABC44 8FB20020 */ lw $s2, 0x20($sp) -/* 0AC848 800ABC48 8FB30024 */ lw $s3, 0x24($sp) -/* 0AC84C 800ABC4C 8FB5002C */ lw $s5, 0x2c($sp) -/* 0AC850 800ABC50 8FB60030 */ lw $s6, 0x30($sp) -/* 0AC854 800ABC54 03E00008 */ jr $ra -/* 0AC858 800ABC58 27BD0038 */ addiu $sp, $sp, 0x38 - diff --git a/asm/non_matchings/game_ui/func_800ABC5C.s b/asm/non_matchings/game_ui/func_800ABC5C.s deleted file mode 100644 index 470a4252..00000000 --- a/asm/non_matchings/game_ui/func_800ABC5C.s +++ /dev/null @@ -1,147 +0,0 @@ -glabel func_800ABC5C -/* 0AC85C 800ABC5C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0AC860 800ABC60 AFB00018 */ sw $s0, 0x18($sp) -/* 0AC864 800ABC64 8FB00034 */ lw $s0, 0x34($sp) -/* 0AC868 800ABC68 AFBF001C */ sw $ra, 0x1c($sp) -/* 0AC86C 800ABC6C 1A00007A */ blez $s0, .L800ABE58 -/* 0AC870 800ABC70 3C028012 */ lui $v0, %hi(D_80127BB8) # $v0, 0x8012 -/* 0AC874 800ABC74 24427BB8 */ addiu $v0, %lo(D_80127BB8) # addiu $v0, $v0, 0x7bb8 -/* 0AC878 800ABC78 8C4E0014 */ lw $t6, 0x14($v0) -/* 0AC87C 800ABC7C 00000000 */ nop -/* 0AC880 800ABC80 148E0011 */ bne $a0, $t6, .L800ABCC8 -/* 0AC884 800ABC84 00000000 */ nop -/* 0AC888 800ABC88 8C4F0020 */ lw $t7, 0x20($v0) -/* 0AC88C 800ABC8C 00000000 */ nop -/* 0AC890 800ABC90 14AF000D */ bne $a1, $t7, .L800ABCC8 -/* 0AC894 800ABC94 00000000 */ nop -/* 0AC898 800ABC98 8C58002C */ lw $t8, 0x2c($v0) -/* 0AC89C 800ABC9C 00000000 */ nop -/* 0AC8A0 800ABCA0 14D80009 */ bne $a2, $t8, .L800ABCC8 -/* 0AC8A4 800ABCA4 00000000 */ nop -/* 0AC8A8 800ABCA8 8C590000 */ lw $t9, ($v0) -/* 0AC8AC 800ABCAC 8FA30030 */ lw $v1, 0x30($sp) -/* 0AC8B0 800ABCB0 14F90005 */ bne $a3, $t9, .L800ABCC8 -/* 0AC8B4 800ABCB4 00000000 */ nop -/* 0AC8B8 800ABCB8 8C480030 */ lw $t0, 0x30($v0) -/* 0AC8BC 800ABCBC 00000000 */ nop -/* 0AC8C0 800ABCC0 10680065 */ beq $v1, $t0, .L800ABE58 -/* 0AC8C4 800ABCC4 00000000 */ nop -.L800ABCC8: -/* 0AC8C8 800ABCC8 8C49000C */ lw $t1, 0xc($v0) -/* 0AC8CC 800ABCCC 8C4C0018 */ lw $t4, 0x18($v0) -/* 0AC8D0 800ABCD0 00895023 */ subu $t2, $a0, $t1 -/* 0AC8D4 800ABCD4 0150001A */ div $zero, $t2, $s0 -/* 0AC8D8 800ABCD8 00AC6823 */ subu $t5, $a1, $t4 -/* 0AC8DC 800ABCDC 8C4F0024 */ lw $t7, 0x24($v0) -/* 0AC8E0 800ABCE0 AC440014 */ sw $a0, 0x14($v0) -/* 0AC8E4 800ABCE4 00CFC023 */ subu $t8, $a2, $t7 -/* 0AC8E8 800ABCE8 AC450020 */ sw $a1, 0x20($v0) -/* 0AC8EC 800ABCEC AC46002C */ sw $a2, 0x2c($v0) -/* 0AC8F0 800ABCF0 3C08800E */ lui $t0, %hi(D_800E2C5C) # $t0, 0x800e -/* 0AC8F4 800ABCF4 8FA30030 */ lw $v1, 0x30($sp) -/* 0AC8F8 800ABCF8 16000002 */ bnez $s0, .L800ABD04 -/* 0AC8FC 800ABCFC 00000000 */ nop -/* 0AC900 800ABD00 0007000D */ break 7 -.L800ABD04: -/* 0AC904 800ABD04 2401FFFF */ li $at, -1 -/* 0AC908 800ABD08 16010004 */ bne $s0, $at, .L800ABD1C -/* 0AC90C 800ABD0C 3C018000 */ lui $at, 0x8000 -/* 0AC910 800ABD10 15410002 */ bne $t2, $at, .L800ABD1C -/* 0AC914 800ABD14 00000000 */ nop -/* 0AC918 800ABD18 0006000D */ break 6 -.L800ABD1C: -/* 0AC91C 800ABD1C 00005812 */ mflo $t3 -/* 0AC920 800ABD20 AC4B0010 */ sw $t3, 0x10($v0) -/* 0AC924 800ABD24 00000000 */ nop -/* 0AC928 800ABD28 01B0001A */ div $zero, $t5, $s0 -/* 0AC92C 800ABD2C 16000002 */ bnez $s0, .L800ABD38 -/* 0AC930 800ABD30 00000000 */ nop -/* 0AC934 800ABD34 0007000D */ break 7 -.L800ABD38: -/* 0AC938 800ABD38 2401FFFF */ li $at, -1 -/* 0AC93C 800ABD3C 16010004 */ bne $s0, $at, .L800ABD50 -/* 0AC940 800ABD40 3C018000 */ lui $at, 0x8000 -/* 0AC944 800ABD44 15A10002 */ bne $t5, $at, .L800ABD50 -/* 0AC948 800ABD48 00000000 */ nop -/* 0AC94C 800ABD4C 0006000D */ break 6 -.L800ABD50: -/* 0AC950 800ABD50 00007012 */ mflo $t6 -/* 0AC954 800ABD54 AC4E001C */ sw $t6, 0x1c($v0) -/* 0AC958 800ABD58 00000000 */ nop -/* 0AC95C 800ABD5C 0310001A */ div $zero, $t8, $s0 -/* 0AC960 800ABD60 16000002 */ bnez $s0, .L800ABD6C -/* 0AC964 800ABD64 00000000 */ nop -/* 0AC968 800ABD68 0007000D */ break 7 -.L800ABD6C: -/* 0AC96C 800ABD6C 2401FFFF */ li $at, -1 -/* 0AC970 800ABD70 16010004 */ bne $s0, $at, .L800ABD84 -/* 0AC974 800ABD74 3C018000 */ lui $at, 0x8000 -/* 0AC978 800ABD78 17010002 */ bne $t8, $at, .L800ABD84 -/* 0AC97C 800ABD7C 00000000 */ nop -/* 0AC980 800ABD80 0006000D */ break 6 -.L800ABD84: -/* 0AC984 800ABD84 0000C812 */ mflo $t9 -/* 0AC988 800ABD88 AC590028 */ sw $t9, 0x28($v0) -/* 0AC98C 800ABD8C 8D082C5C */ lw $t0, %lo(D_800E2C5C)($t0) -/* 0AC990 800ABD90 00000000 */ nop -/* 0AC994 800ABD94 15000023 */ bnez $t0, .L800ABE24 -/* 0AC998 800ABD98 00000000 */ nop -/* 0AC99C 800ABD9C 8C490000 */ lw $t1, ($v0) -/* 0AC9A0 800ABDA0 8C4C0030 */ lw $t4, 0x30($v0) -/* 0AC9A4 800ABDA4 00E95023 */ subu $t2, $a3, $t1 -/* 0AC9A8 800ABDA8 0150001A */ div $zero, $t2, $s0 -/* 0AC9AC 800ABDAC 006C6823 */ subu $t5, $v1, $t4 -/* 0AC9B0 800ABDB0 16000002 */ bnez $s0, .L800ABDBC -/* 0AC9B4 800ABDB4 00000000 */ nop -/* 0AC9B8 800ABDB8 0007000D */ break 7 -.L800ABDBC: -/* 0AC9BC 800ABDBC 2401FFFF */ li $at, -1 -/* 0AC9C0 800ABDC0 16010004 */ bne $s0, $at, .L800ABDD4 -/* 0AC9C4 800ABDC4 3C018000 */ lui $at, 0x8000 -/* 0AC9C8 800ABDC8 15410002 */ bne $t2, $at, .L800ABDD4 -/* 0AC9CC 800ABDCC 00000000 */ nop -/* 0AC9D0 800ABDD0 0006000D */ break 6 -.L800ABDD4: -/* 0AC9D4 800ABDD4 AC470008 */ sw $a3, 8($v0) -/* 0AC9D8 800ABDD8 AC430038 */ sw $v1, 0x38($v0) -/* 0AC9DC 800ABDDC AC50003C */ sw $s0, 0x3c($v0) -/* 0AC9E0 800ABDE0 00005812 */ mflo $t3 -/* 0AC9E4 800ABDE4 AC4B0004 */ sw $t3, 4($v0) -/* 0AC9E8 800ABDE8 00000000 */ nop -/* 0AC9EC 800ABDEC 01B0001A */ div $zero, $t5, $s0 -/* 0AC9F0 800ABDF0 16000002 */ bnez $s0, .L800ABDFC -/* 0AC9F4 800ABDF4 00000000 */ nop -/* 0AC9F8 800ABDF8 0007000D */ break 7 -.L800ABDFC: -/* 0AC9FC 800ABDFC 2401FFFF */ li $at, -1 -/* 0ACA00 800ABE00 16010004 */ bne $s0, $at, .L800ABE14 -/* 0ACA04 800ABE04 3C018000 */ lui $at, 0x8000 -/* 0ACA08 800ABE08 15A10002 */ bne $t5, $at, .L800ABE14 -/* 0ACA0C 800ABE0C 00000000 */ nop -/* 0ACA10 800ABE10 0006000D */ break 6 -.L800ABE14: -/* 0ACA14 800ABE14 00007012 */ mflo $t6 -/* 0ACA18 800ABE18 AC4E0034 */ sw $t6, 0x34($v0) -/* 0ACA1C 800ABE1C 1000000F */ b .L800ABE5C -/* 0ACA20 800ABE20 8FBF001C */ lw $ra, 0x1c($sp) -.L800ABE24: -/* 0ACA24 800ABE24 44902000 */ mtc1 $s0, $f4 -/* 0ACA28 800ABE28 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0ACA2C 800ABE2C 468021A0 */ cvt.s.w $f6, $f4 -/* 0ACA30 800ABE30 44814000 */ mtc1 $at, $f8 -/* 0ACA34 800ABE34 AC470000 */ sw $a3, ($v0) -/* 0ACA38 800ABE38 46083283 */ div.s $f10, $f6, $f8 -/* 0ACA3C 800ABE3C AC430030 */ sw $v1, 0x30($v0) -/* 0ACA40 800ABE40 AC40003C */ sw $zero, 0x3c($v0) -/* 0ACA44 800ABE44 24E40001 */ addiu $a0, $a3, 1 -/* 0ACA48 800ABE48 24650001 */ addiu $a1, $v1, 1 -/* 0ACA4C 800ABE4C 44065000 */ mfc1 $a2, $f10 -/* 0ACA50 800ABE50 0C02B4B1 */ jal func_800AD2C4 -/* 0ACA54 800ABE54 00000000 */ nop -.L800ABE58: -/* 0ACA58 800ABE58 8FBF001C */ lw $ra, 0x1c($sp) -.L800ABE5C: -/* 0ACA5C 800ABE5C 8FB00018 */ lw $s0, 0x18($sp) -/* 0ACA60 800ABE60 03E00008 */ jr $ra -/* 0ACA64 800ABE64 27BD0020 */ addiu $sp, $sp, 0x20 - diff --git a/asm/non_matchings/menu/menu_game_select_init.s b/asm/non_matchings/menu/menu_game_select_init.s index 7bdc46f9..25219ab0 100644 --- a/asm/non_matchings/menu/menu_game_select_init.s +++ b/asm/non_matchings/menu/menu_game_select_init.s @@ -30,7 +30,7 @@ glabel menu_game_select_init /* 08D178 8008C578 24040043 */ li $a0, 67 /* 08D17C 8008C57C 0C01FFFB */ jal func_8007FFEC /* 08D180 8008C580 24040003 */ li $a0, 3 -/* 08D184 8008C584 0C03105C */ jal func_800C4170 +/* 08D184 8008C584 0C03105C */ jal load_font /* 08D188 8008C588 24040002 */ li $a0, 2 /* 08D18C 8008C58C 0C0002CD */ jal play_music /* 08D190 8008C590 2404001A */ li $a0, 26 diff --git a/asm/non_matchings/menu/menu_ghost_data_init.s b/asm/non_matchings/menu/menu_ghost_data_init.s index ff1ec4fe..b80b27c9 100644 --- a/asm/non_matchings/menu/menu_ghost_data_init.s +++ b/asm/non_matchings/menu/menu_ghost_data_init.s @@ -33,7 +33,7 @@ glabel menu_ghost_data_init /* 09A6D4 80099AD4 3C04800E */ lui $a0, %hi(D_800E174C) # $a0, 0x800e /* 09A6D8 80099AD8 0C027229 */ jal allocate_menu_images /* 09A6DC 80099ADC 2484174C */ addiu $a0, %lo(D_800E174C) # addiu $a0, $a0, 0x174c -/* 09A6E0 80099AE0 0C03105C */ jal func_800C4170 +/* 09A6E0 80099AE0 0C03105C */ jal load_font /* 09A6E4 80099AE4 24040002 */ li $a0, 2 /* 09A6E8 80099AE8 3C028012 */ lui $v0, %hi(D_80126550) # $v0, 0x8012 /* 09A6EC 80099AEC 24426550 */ addiu $v0, %lo(D_80126550) # addiu $v0, $v0, 0x6550 diff --git a/asm/non_matchings/menu/menu_track_select_init.s b/asm/non_matchings/menu/menu_track_select_init.s index a09b35e3..e1e840ca 100644 --- a/asm/non_matchings/menu/menu_track_select_init.s +++ b/asm/non_matchings/menu/menu_track_select_init.s @@ -10,7 +10,7 @@ glabel menu_track_select_init /* 08F3C0 8008E7C0 AFB20028 */ sw $s2, 0x28($sp) /* 08F3C4 8008E7C4 AFB10024 */ sw $s1, 0x24($sp) /* 08F3C8 8008E7C8 AFB00020 */ sw $s0, 0x20($sp) -/* 08F3CC 8008E7CC 0C03105C */ jal func_800C4170 +/* 08F3CC 8008E7CC 0C03105C */ jal load_font /* 08F3D0 8008E7D0 24040002 */ li $a0, 2 /* 08F3D4 8008E7D4 0C01BAA4 */ jal get_settings /* 08F3D8 8008E7D8 00000000 */ nop diff --git a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s index fad66c55..d3a7fa25 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s @@ -301,7 +301,7 @@ glabel menu_trophy_race_rankings_init /* 099A54 80098E54 1420FFF5 */ bnez $at, .L80098E2C /* 099A58 80098E58 24840001 */ addiu $a0, $a0, 1 .L80098E5C: -/* 099A5C 80098E5C 0C03105C */ jal func_800C4170 +/* 099A5C 80098E5C 0C03105C */ jal load_font /* 099A60 80098E60 24040002 */ li $a0, 2 /* 099A64 80098E64 0C0002F8 */ jal set_music_player_voice_limit /* 099A68 80098E68 24040018 */ li $a0, 24 diff --git a/asm/non_matchings/menu/menu_trophy_race_round_init.s b/asm/non_matchings/menu/menu_trophy_race_round_init.s index 2f284c7a..7acb4fbb 100644 --- a/asm/non_matchings/menu/menu_trophy_race_round_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_init.s @@ -75,7 +75,7 @@ glabel menu_trophy_race_round_init /* 098F78 80098378 3C01800E */ lui $at, %hi(D_800E0980) # $at, 0x800e /* 098F7C 8009837C 240B000A */ li $t3, 10 /* 098F80 80098380 AC2B0980 */ sw $t3, %lo(D_800E0980)($at) -/* 098F84 80098384 0C03105C */ jal func_800C4170 +/* 098F84 80098384 0C03105C */ jal load_font /* 098F88 80098388 24040002 */ li $a0, 2 /* 098F8C 8009838C 0C0002F8 */ jal set_music_player_voice_limit /* 098F90 80098390 24040018 */ li $a0, 24 diff --git a/include/asset_sections.h b/include/asset_sections.h deleted file mode 100644 index ba6105b3..00000000 --- a/include/asset_sections.h +++ /dev/null @@ -1,57 +0,0 @@ -/* 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_SCREENS 10 -#define ASSET_SCREENS_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/lib/src/mips1/al/alFxNew.c b/lib/src/mips1/al/alFxNew.c index 6987fc3d..dbddc017 100644 --- a/lib/src/mips1/al/alFxNew.c +++ b/lib/src/mips1/al/alFxNew.c @@ -134,8 +134,8 @@ void alFxNew(ALFx *r, ALSynConfig *c, s16 bus, UNUSED ALHeap *hp) { j = 0; r->section_count = param[j++]; r->length = param[j++]; - r->delay = allocate_from_main_pool_safe(sizeof(ALDelay) * r->section_count, COLOR_TAG_CYAN); - r->base = allocate_from_main_pool_safe(sizeof(s16) * r->length, COLOR_TAG_CYAN); + r->delay = allocate_from_main_pool_safe(sizeof(ALDelay) * r->section_count, COLOUR_TAG_CYAN); + r->base = allocate_from_main_pool_safe(sizeof(s16) * r->length, COLOUR_TAG_CYAN); r->input = r->base; for ( k=0; k < r->length; k++) r->base[k] = 0; @@ -167,8 +167,8 @@ void alFxNew(ALFx *r, ALSynConfig *c, s16 bus, UNUSED ALHeap *hp) { d->rsgain = (((f32) param[j++])/CONVERT) * LENGTH; d->rsval = 1.0; d->rsdelta = 0.0; - d->rs = allocate_from_main_pool_safe(sizeof(ALResampler), COLOR_TAG_CYAN); - d->rs->state = allocate_from_main_pool_safe(sizeof(RESAMPLE_STATE), COLOR_TAG_CYAN); + d->rs = allocate_from_main_pool_safe(sizeof(ALResampler), COLOUR_TAG_CYAN); + d->rs->state = allocate_from_main_pool_safe(sizeof(RESAMPLE_STATE), COLOUR_TAG_CYAN); d->rs->delta = 0.0; d->rs->first = 1; } else { @@ -177,8 +177,8 @@ void alFxNew(ALFx *r, ALSynConfig *c, s16 bus, UNUSED ALHeap *hp) { j++; } if (param[j]) { - d->lp = allocate_from_main_pool_safe(sizeof(ALLowPass), COLOR_TAG_CYAN); - d->lp->fstate = allocate_from_main_pool_safe(sizeof(POLEF_STATE), COLOR_TAG_CYAN); + d->lp = allocate_from_main_pool_safe(sizeof(ALLowPass), COLOUR_TAG_CYAN); + d->lp->fstate = allocate_from_main_pool_safe(sizeof(POLEF_STATE), COLOUR_TAG_CYAN); d->lp->fc = param[j++]; init_lpfilter(d->lp); } else { diff --git a/src/asset_loading.c b/src/asset_loading.c index 4f4f1ca2..7804a652 100644 --- a/src/asset_loading.c +++ b/src/asset_loading.c @@ -2,7 +2,6 @@ /* RAM_POS: 0x80076BA0 */ #include "asset_loading.h" -#include "memory.h" //#include "assets.h" #include "macros.h" @@ -28,7 +27,7 @@ void func_80076BA0(void) { osCreateMesgQueue(&gDmaMesgQueue, &gDmaMesg, 1); osCreatePiManager((OSPri)150, &gPIMesgQueue, gPIMesgBuf, ARRAY_COUNT(gPIMesgBuf)); assetTableSize = &__ASSETS_LUT_END - &__ASSETS_LUT_START; - gAssetsLookupTable = (u32 *)allocate_from_main_pool_safe(assetTableSize, COLOR_TAG_GRAY); + gAssetsLookupTable = (u32 *)allocate_from_main_pool_safe(assetTableSize, COLOUR_TAG_GREY); func_80071478((u8 *)gAssetsLookupTable); dmacopy((u32)&__ASSETS_LUT_START, (u32)gAssetsLookupTable, (s32)assetTableSize); } @@ -48,7 +47,7 @@ u32 *load_asset_section_from_rom(u32 assetIndex) { index = assetIndex + gAssetsLookupTable; start = *index; size = *(index + 1) - start; - out = (u32 *)allocate_from_main_pool_safe(size, COLOR_TAG_GRAY); + out = (u32 *)allocate_from_main_pool_safe(size, COLOUR_TAG_GREY); if (out == 0) { return 0; } @@ -56,43 +55,37 @@ u32 *load_asset_section_from_rom(u32 assetIndex) { return out; } -#ifdef NON_EQUIVALENT -// Unused. -// This has regalloc & stack issues. -u8 *load_compressed_asset_from_rom(u32 assetIndex, s32 arg1) { +#ifdef NON_MATCHING +// 99.8% matching; has a single stack issue. see: https://decomp.me/scratch/MyWiR +u8 *load_compressed_asset_from_rom(u32 assetIndex, s32 extraMemory) { s32 size; - s32 sp2C; s32 start; + s32 totalSpace; + u8 *gzipHeaderRamPos; + u8 *out; s32 *index; - u8 *temp_a1; - u8 *temp_v0_2; - u8 *temp_v0_3; - u8 *temp_a0; - + u8 *ramPos; if (gAssetsLookupTable[0] < assetIndex) { return NULL; } - assetIndex++; - index = assetIndex + gAssetsLookupTable; - start = *index; - size = *(index + 1) - start; - - 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; - free_from_memory_pool(temp_v0_2); - temp_v0_3 = (u8 *)allocate_from_main_pool_safe(sp2C + arg1, COLOR_TAG_GRAY); - - if (temp_v0_3 == NULL) { + out = assetIndex + gAssetsLookupTable; + index = out; + start = index[0]; + size = index[1] - start; + gzipHeaderRamPos = (u8 *) allocate_from_main_pool_safe(8, COLOUR_TAG_WHITE); + dmacopy((u32) (start + (&__ASSETS_LUT_END)), gzipHeaderRamPos, 8); + totalSpace = byteswap32(gzipHeaderRamPos) + extraMemory; + free_from_memory_pool(gzipHeaderRamPos); + out = (u8 *) allocate_from_main_pool_safe(totalSpace + extraMemory, COLOUR_TAG_GREY); + if (out == NULL){ return NULL; } - temp_a1 = (temp_v0_3 + sp2C) - size; - dmacopy(temp_a0, temp_a1, size); - gzip_inflate(temp_a1, temp_v0_3); - return temp_v0_3; + ramPos = (out + totalSpace) - size; + totalSpace = size; + dmacopy((u32) (start + (&__ASSETS_LUT_END)), ramPos, size); + gzip_inflate(ramPos, out); + return out; } #else GLOBAL_ASM("asm/non_matchings/asset_loading/load_compressed_asset_from_rom.s") diff --git a/src/asset_loading.h b/src/asset_loading.h index 7fe72fef..e3d38f92 100644 --- a/src/asset_loading.h +++ b/src/asset_loading.h @@ -3,6 +3,7 @@ #include "types.h" #include "gzip.h" +#include "memory.h" void func_80076BA0(void); u32 *load_asset_section_from_rom(u32 assetIndex); diff --git a/src/audio.c b/src/audio.c index c768f155..fca72d12 100644 --- a/src/audio.c +++ b/src/audio.c @@ -6,7 +6,7 @@ #include "types.h" #include "macros.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "asset_loading.h" #include "audio_internal.h" #include "unknown_003260.h" @@ -107,31 +107,31 @@ void audio_init(OSSched *arg0) { alHeapInit(&gALHeap, gBssSectionStart, AUDIO_HEAP_SIZE); addrPtr = load_asset_section_from_rom(ASSET_AUDIO_TABLE); - ALBankFile_80115D14 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[2] - addrPtr[1], COLOR_TAG_CYAN); + ALBankFile_80115D14 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[2] - addrPtr[1], COLOUR_TAG_CYAN); load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D14, addrPtr[1], addrPtr[2] - addrPtr[1]); alBnkfNew(ALBankFile_80115D14, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[2])); sSoundEffectsPoolSize = addrPtr[7] - addrPtr[6]; - sSoundEffectsPool = (unk80115D18 *)allocate_from_main_pool_safe(sSoundEffectsPoolSize, COLOR_TAG_CYAN); + sSoundEffectsPool = (unk80115D18 *)allocate_from_main_pool_safe(sSoundEffectsPoolSize, COLOUR_TAG_CYAN); load_asset_to_address(ASSET_AUDIO, sSoundEffectsPool, addrPtr[6], sSoundEffectsPoolSize); D_80115D20 = sSoundEffectsPoolSize / 10; sMusicPoolSize = addrPtr[6] - addrPtr[5]; - sMusicPool = (unk80115D1C *)allocate_from_main_pool_safe(sMusicPoolSize, COLOR_TAG_CYAN); + sMusicPool = (unk80115D1C *)allocate_from_main_pool_safe(sMusicPoolSize, COLOUR_TAG_CYAN); load_asset_to_address(ASSET_AUDIO, sMusicPool, addrPtr[5], sMusicPoolSize); D_80115D24 = sMusicPoolSize / 3; - ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[0], COLOR_TAG_CYAN); + ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[0], COLOUR_TAG_CYAN); load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D10, 0, addrPtr[0]); alBnkfNew(ALBankFile_80115D10, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[0])); ALSeqFile_80115CF8 = (ALSeqFile *)alHeapDBAlloc(0, 0, &gALHeap, 1, 4); load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, addrPtr[4], 4); seqfSize = (ALSeqFile_80115CF8->seqCount) * 8 + 4; - ALSeqFile_80115CF8 = allocate_from_main_pool_safe(seqfSize, COLOR_TAG_CYAN); + ALSeqFile_80115CF8 = allocate_from_main_pool_safe(seqfSize, COLOUR_TAG_CYAN); load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, addrPtr[4], seqfSize); alSeqFileNew(ALSeqFile_80115CF8, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[4])); - D_80115D0C = (u32 *)allocate_from_main_pool_safe((ALSeqFile_80115CF8->seqCount) * 4, COLOR_TAG_CYAN); + D_80115D0C = (u32 *)allocate_from_main_pool_safe((ALSeqFile_80115CF8->seqCount) * 4, COLOUR_TAG_CYAN); for (iCnt = 0; iCnt < ALSeqFile_80115CF8->seqCount; iCnt++) { (u32 *)((u32)ALSeqFile_80115CF8 + 8 + iCnt * 8); @@ -156,8 +156,8 @@ void audio_init(OSSched *arg0) { gMusicPlayer = func_80002224(24, 120); set_voice_limit(gMusicPlayer, 18); gSndFxPlayer = func_80002224(16, 50); - 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); + D_80115CFC = allocate_from_main_pool_safe(seq_max_len, COLOUR_TAG_CYAN); + D_80115D00 = allocate_from_main_pool_safe(seq_max_len, COLOUR_TAG_CYAN); audConfig.unk04 = 150; audConfig.unk00 = 32; audConfig.maxChannels = 16; diff --git a/src/fade_transition.c b/src/fade_transition.c index 3823603e..2d422846 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -6,7 +6,7 @@ #include "types.h" #include "macros.h" #include "f3ddkr.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "memory.h" #include "PR/libultra.h" #include "video.h" diff --git a/src/font.c b/src/font.c index 2d326f4b..dd06ba1d 100644 --- a/src/font.c +++ b/src/font.c @@ -88,7 +88,7 @@ void load_fonts(void) { u32 *fontAssetData; s32 i; - fontAssetData = load_asset_section_from_rom(ASSET_BINARY_44); + fontAssetData = load_asset_section_from_rom(ASSET_FONTS); gFonts = (FontData *)(fontAssetData); // ??? gNumberOfFonts = *(fontAssetData); @@ -98,7 +98,7 @@ void load_fonts(void) { gFonts[i].unk28[0] = 0; } - gDialogueBoxBackground = allocate_from_main_pool_safe(DIALOGUEBOXBACKGROUND_TOTAL_SIZE + unk8012A7EC_TOTAL_SIZE, COLOR_TAG_YELLOW); + gDialogueBoxBackground = allocate_from_main_pool_safe(DIALOGUEBOXBACKGROUND_TOTAL_SIZE + unk8012A7EC_TOTAL_SIZE, COLOUR_TAG_YELLOW); D_8012A7EC = (unk8012A7EC *)((u8 *)gDialogueBoxBackground + DIALOGUEBOXBACKGROUND_TOTAL_SIZE); for (i = 0; i < DIALOGUEBOXBACKGROUND_COUNT; i++) { @@ -146,8 +146,8 @@ void load_fonts(void) { (*D_8012A7EC)[i].textBGColourA = 0; (*D_8012A7EC)[i].unk1C = 0; } - func_800C4170(0); - func_800C4170(1); + load_font(0); + load_font(1); D_8012A7F0 = 0; } @@ -157,7 +157,7 @@ void func_800C4164(s32 arg0) { #ifdef NON_EQUIVALENT // Mostly has regalloc issues. -void func_800C4170(s32 fontID) { +void load_font(s32 fontID) { if (fontID < gNumberOfFonts) { FontData *fontData = &gFonts[fontID]; fontData->unk28[0]++; @@ -175,12 +175,12 @@ void func_800C4170(s32 fontID) { } } #else -GLOBAL_ASM("asm/non_matchings/font/func_800C4170.s") +GLOBAL_ASM("asm/non_matchings/font/load_font.s") #endif #ifdef NON_EQUIVALENT // Mostly has regalloc issues. -void func_800C422C(s32 fontID) { +void unload_font(s32 fontID) { if (fontID < gNumberOfFonts) { FontData *fontData = &gFonts[fontID]; if (fontData->unk28[0] > 0) { @@ -201,7 +201,7 @@ void func_800C422C(s32 fontID) { } } #else -GLOBAL_ASM("asm/non_matchings/font/func_800C422C.s") +GLOBAL_ASM("asm/non_matchings/font/unload_font.s") #endif /** diff --git a/src/font.h b/src/font.h index 71ed6fa7..2df5e243 100644 --- a/src/font.h +++ b/src/font.h @@ -9,7 +9,7 @@ #include "structs.h" #include "types.h" #include "macros.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "libultra_internal.h" #include "f3ddkr.h" #include "textures_sprites.h" @@ -212,8 +212,8 @@ void parse_string_with_number(unsigned char *input, char *output, s32 number); void s32_to_string(char** outString, s32 number); //Non Matching TextureHeader *func_800C4318(s32 font, u8 arg1); //Non Matching -void func_800C4170(s32 fontID); //Non Matching -void func_800C422C(s32 arg0); //Non Matching +void load_font(s32 fontID); //Non Matching +void unload_font(s32 arg0); //Non Matching void func_800C45A4(Gfx **dlist, DialogueBoxBackground *arg1, char *text, AlignmentFlags alignmentFlags, f32 arg4); //Non Matching s32 func_800C4DA0(u8 *text, s32 x, s32 font); //Non Matching void *render_dialogue_text(s32 arg0, s32 posX, s32 posY, char *text, s32 arg4, s32 arg5); //Non Matching diff --git a/src/game.c b/src/game.c index 7f58ecfc..e6d39367 100644 --- a/src/game.c +++ b/src/game.c @@ -11,7 +11,7 @@ #include "macros.h" #include "structs.h" #include "f3ddkr.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "asset_loading.h" #include "menu.h" #include "video.h" @@ -187,7 +187,7 @@ void func_8006A6B0(void) { s32 i, count, checksumCount; s32 temp; u8 *sp44; - sp44 = allocate_from_main_pool_safe(sizeof(LevelHeader), COLOR_TAG_YELLOW); + sp44 = allocate_from_main_pool_safe(sizeof(LevelHeader), COLOUR_TAG_YELLOW); gTempAssetTable = load_asset_section_from_rom(ASSET_LEVEL_HEADERS_TABLE); for (i = 0; i < 16; i++) { D_80121180[i] = 0; @@ -197,7 +197,7 @@ void func_8006A6B0(void) { gNumberOfLevelHeaders++; } gNumberOfLevelHeaders--; - D_8012117C = allocate_from_main_pool_safe(gNumberOfLevelHeaders * sizeof(unk8012117C), COLOR_TAG_YELLOW); + D_8012117C = allocate_from_main_pool_safe(gNumberOfLevelHeaders * sizeof(unk8012117C), COLOUR_TAG_YELLOW); gNumberOfWorlds = -1; gCurrentLevelHeader = sp44; for (i = 0; i < gNumberOfLevelHeaders; i++) { @@ -216,7 +216,7 @@ void func_8006A6B0(void) { D_8012117C[i].unk4 = gCurrentLevelHeader->unkB0; } gNumberOfWorlds++; - D_80121178 = allocate_from_main_pool_safe(gNumberOfWorlds, COLOR_TAG_YELLOW); + D_80121178 = allocate_from_main_pool_safe(gNumberOfWorlds, COLOUR_TAG_YELLOW); for (i = 0; i < gNumberOfWorlds; i++) { D_80121178[i] = -1; } @@ -236,8 +236,8 @@ void func_8006A6B0(void) { count--; temp = gTempAssetTable[count] - gTempAssetTable[0]; // Minor issue here. - gLevelNames = allocate_from_main_pool_safe(count * sizeof(s32), COLOR_TAG_YELLOW); - D_800DD310 = allocate_from_main_pool_safe(temp, COLOR_TAG_YELLOW); + gLevelNames = allocate_from_main_pool_safe(count * sizeof(s32), COLOUR_TAG_YELLOW); + D_800DD310 = allocate_from_main_pool_safe(temp, COLOUR_TAG_YELLOW); load_asset_to_address(ASSET_LEVEL_NAMES, D_800DD310, 0, temp); for (i = 0; i < count; i++) { gLevelNames[i] = &D_800DD310[gTempAssetTable[i]]; @@ -394,7 +394,7 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, } offset = gTempAssetTable[levelId]; size = gTempAssetTable[levelId + 1] - offset; - gCurrentLevelHeader = (LevelHeader *)allocate_from_main_pool_safe(size, COLOR_TAG_YELLOW); + gCurrentLevelHeader = (LevelHeader *)allocate_from_main_pool_safe(size, COLOUR_TAG_YELLOW); load_asset_to_address(ASSET_LEVEL_HEADERS, gCurrentLevelHeader, offset, size); D_800DD330 = 0; sp44 = levelId; @@ -464,7 +464,7 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, free_from_memory_pool(gCurrentLevelHeader); offset = gTempAssetTable[levelId]; size = gTempAssetTable[levelId + 1] - offset; - gCurrentLevelHeader = allocate_from_main_pool_safe(size, COLOR_TAG_YELLOW); + gCurrentLevelHeader = allocate_from_main_pool_safe(size, COLOUR_TAG_YELLOW); load_asset_to_address(ASSET_LEVEL_HEADERS, gCurrentLevelHeader, offset, size); } free_from_memory_pool(gTempAssetTable); @@ -731,7 +731,7 @@ void func_8006BFC8(s8 *arg0) { } temp2 = gTempAssetTable[phi_s0]; temp = gTempAssetTable[phi_s0 + 1] - temp2; - D_801211C0[0] = allocate_from_main_pool_safe(temp, COLOR_TAG_YELLOW); + D_801211C0[0] = allocate_from_main_pool_safe(temp, COLOUR_TAG_YELLOW); load_asset_to_address(ASSET_UNKNOWN_0, D_801211C0[0], temp2, temp); free_from_memory_pool(gTempAssetTable); } @@ -1677,7 +1677,7 @@ void calc_and_alloc_heap_for_settings(void) { sizes[13] = sizes[12] + dataSize; // courseTimesPtr[2] sizes[14] = sizes[13] + dataSize; // total size - gSettingsPtr = allocate_from_main_pool_safe(sizes[14], COLOR_TAG_WHITE); + gSettingsPtr = allocate_from_main_pool_safe(sizes[14], COLOUR_TAG_WHITE); gSettingsPtr->courseFlagsPtr = (s32 *)((u8 *)gSettingsPtr + sizes[0]); gSettingsPtr->balloonsPtr = (s16 *)((u8 *)gSettingsPtr + sizes[1]); gSettingsPtr->tajFlags = 0; @@ -1895,12 +1895,12 @@ void func_8006EFDC(void) { size4 = (gNumHudTrisPerPlayer[3] * sizeof(Triangle)); totalSize = size1 + size2 + size3 + size4; - gDisplayLists[0] = (u8 *)allocate_from_main_pool_safe(totalSize, COLOR_TAG_RED); + gDisplayLists[0] = (u8 *)allocate_from_main_pool_safe(totalSize, COLOUR_TAG_RED); gHudMatrices[0] = (u8 *)gDisplayLists[0] + size1; gHudVertices[0] = (u8 *)gHudMatrices[0] + size2; gHudTriangles[0] = (u8 *)gHudVertices[0] + size3; - gDisplayLists[1] = (u8 *)allocate_from_main_pool_safe(totalSize, COLOR_TAG_YELLOW); + gDisplayLists[1] = (u8 *)allocate_from_main_pool_safe(totalSize, COLOUR_TAG_YELLOW); gHudMatrices[1] = (u8 *)gDisplayLists[1] + size1; gHudVertices[1] = (u8 *)gHudMatrices[1] + size2; gHudTriangles[1] = (u8 *)gHudVertices[1] + size3; diff --git a/src/game_text.c b/src/game_text.c index 6deb99a2..fe0304a9 100644 --- a/src/game_text.c +++ b/src/game_text.c @@ -55,7 +55,7 @@ s32 D_8012A7DC; /*****************************/ void func_800C29F0(void) { - D_8012A7C8.unk0 = (u8 *)allocate_from_main_pool_safe(0x780, COLOR_TAG_GREEN); + D_8012A7C8.unk0 = (u8 *)allocate_from_main_pool_safe(0x780, COLOUR_TAG_GREEN); D_8012A7C8.unk4 = D_8012A7C8.unk0 + 0x3C0; D_8012A7D4 = 0; D_8012A7B6 = 0; @@ -119,7 +119,7 @@ void func_800C2F1C(s32 arg0) { void func_800C3048(void) { D_8012A78C = -1; - D_8012A780 = (u8 *)allocate_from_main_pool_safe(0x800, COLOR_TAG_GREEN); + D_8012A780 = (u8 *)allocate_from_main_pool_safe(0x800, COLOUR_TAG_GREEN); D_8012A798.unk0 = D_8012A780 + 0x80; D_8012A798.unk4 = D_8012A798.unk0 + 0x3C0; D_8012A7A4 = 0; diff --git a/src/game_text.h b/src/game_text.h index e0edf3c4..675e874f 100644 --- a/src/game_text.h +++ b/src/game_text.h @@ -4,7 +4,7 @@ #include "types.h" #include "macros.h" #include "f3ddkr.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "memory.h" #include "font.h" #include "PR/libultra.h" diff --git a/src/gzip.c b/src/gzip.c index e1b0b052..727c4dfd 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -22,8 +22,8 @@ s32 D_8012AAD8; /******************************/ void func_800C6170(void) { - D_800E3760 = (huft *)allocate_from_main_pool_safe(0x2800, COLOR_TAG_BLACK); - gAssetAddress = (s32 *)allocate_from_main_pool_safe(0x10, COLOR_TAG_BLACK); + D_800E3760 = (huft *)allocate_from_main_pool_safe(0x2800, COLOUR_TAG_BLACK); + gAssetAddress = (s32 *)allocate_from_main_pool_safe(0x10, COLOUR_TAG_BLACK); } /** diff --git a/src/memory.c b/src/memory.c index 4252134e..9d7e93d4 100644 --- a/src/memory.c +++ b/src/memory.c @@ -69,7 +69,7 @@ MemoryPoolSlot *new_sub_memory_pool(s32 poolDataSize, s32 numSlots) { MemoryPoolSlot *newPool; size = poolDataSize + (numSlots * sizeof(MemoryPoolSlot)); - slots = (MemoryPoolSlot *)allocate_from_main_pool_safe(size, COLOR_TAG_WHITE); + slots = (MemoryPoolSlot *)allocate_from_main_pool_safe(size, COLOUR_TAG_WHITE); newPool = new_memory_pool(slots, size, numSlots); func_8006F53C(temp); return newPool; @@ -563,15 +563,15 @@ GLOBAL_ASM("asm/non_matchings/memory/get_memory_colour_tag_count.s") * Unused. */ void print_memory_colour_tags(void) { - stubbed_printf("RED %d\n", get_memory_colour_tag_count(COLOR_TAG_RED)); - stubbed_printf("GREEN %d\n", get_memory_colour_tag_count(COLOR_TAG_GREEN)); - stubbed_printf("BLUE %d\n", get_memory_colour_tag_count(COLOR_TAG_BLUE)); - stubbed_printf("YELLOW %d\n", get_memory_colour_tag_count(COLOR_TAG_YELLOW)); - stubbed_printf("MAGENTA %d\n", get_memory_colour_tag_count(COLOR_TAG_MAGENTA)); - stubbed_printf("CYAN %d\n", get_memory_colour_tag_count(COLOR_TAG_CYAN)); - stubbed_printf("WHITE %d\n", get_memory_colour_tag_count(COLOR_TAG_WHITE)); - stubbed_printf("GREY %d\n", get_memory_colour_tag_count(COLOR_TAG_GRAY)); - stubbed_printf("ORANGE %d\n\n", get_memory_colour_tag_count(COLOR_TAG_ORANGE)); + stubbed_printf("RED %d\n", get_memory_colour_tag_count(COLOUR_TAG_RED)); + stubbed_printf("GREEN %d\n", get_memory_colour_tag_count(COLOUR_TAG_GREEN)); + stubbed_printf("BLUE %d\n", get_memory_colour_tag_count(COLOUR_TAG_BLUE)); + stubbed_printf("YELLOW %d\n", get_memory_colour_tag_count(COLOUR_TAG_YELLOW)); + stubbed_printf("MAGENTA %d\n", get_memory_colour_tag_count(COLOUR_TAG_MAGENTA)); + stubbed_printf("CYAN %d\n", get_memory_colour_tag_count(COLOUR_TAG_CYAN)); + stubbed_printf("WHITE %d\n", get_memory_colour_tag_count(COLOUR_TAG_WHITE)); + stubbed_printf("GREY %d\n", get_memory_colour_tag_count(COLOUR_TAG_GREY)); + stubbed_printf("ORANGE %d\n\n", get_memory_colour_tag_count(COLOUR_TAG_ORANGE)); } /** @@ -581,15 +581,15 @@ void print_memory_colour_tags(void) { */ void render_memory_colour_tags(void) { set_render_printf_background_colour(0, 0, 0, 128); - render_printf("RED %d\n", get_memory_colour_tag_count(COLOR_TAG_RED)); - render_printf("GREEN %d\n", get_memory_colour_tag_count(COLOR_TAG_GREEN)); - render_printf("BLUE %d\n", get_memory_colour_tag_count(COLOR_TAG_BLUE)); - render_printf("YELLOW %d\n", get_memory_colour_tag_count(COLOR_TAG_YELLOW)); - render_printf("MAGENTA %d\n", get_memory_colour_tag_count(COLOR_TAG_MAGENTA)); - render_printf("CYAN %d\n", get_memory_colour_tag_count(COLOR_TAG_CYAN)); - render_printf("WHITE %d\n", get_memory_colour_tag_count(COLOR_TAG_WHITE)); - render_printf("GREY %d\n", get_memory_colour_tag_count(COLOR_TAG_GRAY)); - render_printf("ORANGE %d\n\n", get_memory_colour_tag_count(COLOR_TAG_ORANGE)); + render_printf("RED %d\n", get_memory_colour_tag_count(COLOUR_TAG_RED)); + render_printf("GREEN %d\n", get_memory_colour_tag_count(COLOUR_TAG_GREEN)); + render_printf("BLUE %d\n", get_memory_colour_tag_count(COLOUR_TAG_BLUE)); + render_printf("YELLOW %d\n", get_memory_colour_tag_count(COLOUR_TAG_YELLOW)); + render_printf("MAGENTA %d\n", get_memory_colour_tag_count(COLOUR_TAG_MAGENTA)); + render_printf("CYAN %d\n", get_memory_colour_tag_count(COLOUR_TAG_CYAN)); + render_printf("WHITE %d\n", get_memory_colour_tag_count(COLOUR_TAG_WHITE)); + render_printf("GREY %d\n", get_memory_colour_tag_count(COLOUR_TAG_GREY)); + render_printf("ORANGE %d\n\n", get_memory_colour_tag_count(COLOUR_TAG_ORANGE)); } #ifdef NON_EQUIVALENT diff --git a/src/memory.h b/src/memory.h index 0f8d6154..9c324279 100644 --- a/src/memory.h +++ b/src/memory.h @@ -9,25 +9,25 @@ #define MAIN_POOL_SLOT_COUNT 1600 // Animation related? -#define COLOR_TAG_RED 0xFF0000FF +#define COLOUR_TAG_RED 0xFF0000FF // Object related? -#define COLOR_TAG_GREEN 0x00FF00FF +#define COLOUR_TAG_GREEN 0x00FF00FF // ??? -#define COLOR_TAG_BLUE 0x0000FFFF +#define COLOUR_TAG_BLUE 0x0000FFFF // ??? -#define COLOR_TAG_YELLOW 0xFFFF00FF +#define COLOUR_TAG_YELLOW 0xFFFF00FF // ??? -#define COLOR_TAG_MAGENTA 0xFF00FFFF +#define COLOUR_TAG_MAGENTA 0xFF00FFFF // Audio related? -#define COLOR_TAG_CYAN 0x00FFFFFF +#define COLOUR_TAG_CYAN 0x00FFFFFF // ??? -#define COLOR_TAG_WHITE 0xFFFFFFFF +#define COLOUR_TAG_WHITE 0xFFFFFFFF // ??? -#define COLOR_TAG_GRAY 0x7F7F7FFF +#define COLOUR_TAG_GREY 0x7F7F7FFF // ??? -#define COLOR_TAG_ORANGE 0xFF7F7FFF +#define COLOUR_TAG_ORANGE 0xFF7F7FFF // ??? -#define COLOR_TAG_BLACK 0x000000FF +#define COLOUR_TAG_BLACK 0x000000FF /* Size: 0x8 bytes */ typedef struct unk80070BE4_8_0 { diff --git a/src/menu.c b/src/menu.c index dedf70b6..f2e82ad0 100644 --- a/src/menu.c +++ b/src/menu.c @@ -6,7 +6,7 @@ #include "fade_transition.h" #include -#include "asset_sections.h" +#include "asset_enums.h" #include "types.h" #include "macros.h" #include "structs.h" @@ -512,13 +512,13 @@ s16 D_800DFCAC[4] = { }; MenuElement D_800DFCB4[7] = { - { 161, 32, 161, 33, 161, 32, 0, 0, 0, 255, 128, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 30, 160, 30, 160, 30, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 112, 160, 112, 160, 112, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 128, 160, 128, 160, 128, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 192, 160, 192, 160, 192, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 208, 160, 208, 160, 208, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, + { 161, 32, 161, 33, 161, 32, 0, 0, 0, 255, 128, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 30, 160, 30, 160, 30, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 112, 160, 112, 160, 112, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 128, 160, 128, 160, 128, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 192, 160, 192, 160, 192, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 208, 160, 208, 160, 208, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ASSET_FONTS_FUNFONT, 0, 0, { NULL }, 0, 0, 0, 0 }, }; s32 gShowControllerPakMenu = FALSE; @@ -604,41 +604,41 @@ s32 D_800DFFD0 = 0; s32 D_800DFFD4 = -1; MenuElement gCautionMenuTextElements[14] = { - { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 72, 160, 68, 160, 72, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 86, 160, 82, 160, 86, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 100, 160, 96, 160, 100, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 114, 160, 110, 160, 114, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 128, 160, 124, 160, 128, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 142, 160, 138, 160, 142, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 156, 160, 152, 160, 156, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 156, 160, 166, 160, 156, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 186, 160, 180, 160, 186, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 200, 160, 194, 160, 200, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 200, 160, 208, 160, 200, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, + { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 72, 160, 68, 160, 72, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 86, 160, 82, 160, 86, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 100, 160, 96, 160, 100, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 114, 160, 110, 160, 114, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 128, 160, 124, 160, 128, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 142, 160, 138, 160, 142, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 156, 160, 152, 160, 156, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 156, 160, 166, 160, 156, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 186, 160, 180, 160, 186, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 200, 160, 194, 160, 200, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 200, 160, 208, 160, 200, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; MenuElement gGameSelectTextElemsNoAdv2[7] = { - { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { -96, 39, -96, 39, -96, 39, 176, 224, 192, 255, 255, 0, 0, 7, { NULL }, 192, 44, 4, 4 }, - { 160, 104, 160, 104, 160, 104, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { -96, -9, -96, -9, -96, -9, 176, 224, 192, 255, 255, 0, 0, 7, { NULL }, 192, 44, 4, 4 }, - { 160, 152, 160, 152, 160, 152, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { -96, 39, -96, 39, -96, 39, 176, 224, 192, 255, 255, ASSET_FONTS_FUNFONT, 0, 7, { NULL }, 192, 44, 4, 4 }, + { 160, 104, 160, 104, 160, 104, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { -96, -9, -96, -9, -96, -9, 176, 224, 192, 255, 255, ASSET_FONTS_FUNFONT, 0, 7, { NULL }, 192, 44, 4, 4 }, + { 160, 152, 160, 152, 160, 152, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; MenuElement gGameSelectTextElemsWithAdv2[9] = { - { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { -112, 55, -112, 55, -112, 55, 176, 224, 192, 255, 255, 0, 0, 7, { NULL }, 224, 44, 4, 4 }, - { 160, 88, 160, 88, 160, 88, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { -112, 7, -112, 7, -112, 7, 176, 224, 192, 255, 255, 0, 0, 7, { NULL }, 224, 44, 4, 4 }, - { 160, 136, 160, 136, 160, 136, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { -112, -41, -112, -41, -112, -41, 176, 224, 192, 255, 255, 0, 0, 7, { NULL }, 224, 44, 4, 4 }, - { 160, 184, 160, 184, 160, 184, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { -112, 55, -112, 55, -112, 55, 176, 224, 192, 255, 255, ASSET_FONTS_FUNFONT, 0, 7, { NULL }, 224, 44, 4, 4 }, + { 160, 88, 160, 88, 160, 88, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { -112, 7, -112, 7, -112, 7, 176, 224, 192, 255, 255, ASSET_FONTS_FUNFONT, 0, 7, { NULL }, 224, 44, 4, 4 }, + { 160, 136, 160, 136, 160, 136, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { -112, -41, -112, -41, -112, -41, 176, 224, 192, 255, 255, ASSET_FONTS_FUNFONT, 0, 7, { NULL }, 224, 44, 4, 4 }, + { 160, 184, 160, 184, 160, 184, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; @@ -970,40 +970,40 @@ char *gRacePlacementsArray[8] = { }; MenuElement D_800E0BEC[8] = { - { 352, 172, 32, 172, -288, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 452, 166, 132, 166, -188, 166, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 560, 184, 240, 184, -80, 184, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 452, 180, 132, 180, -188, 180, 255, 192, 255, 0, 255, 0, 0, 1, { NULL }, 0, 0, 0, 0 }, - { 452, 198, 132, 198, -188, 198, 255, 192, 255, 0, 255, 0, 0, 1, { NULL }, 0, 0, 0, 0 }, - { 452, 216, 132, 216, -188, 216, 255, 192, 255, 0, 255, 0, 0, 1, { NULL }, 0, 0, 0, 0 }, - { 560, 200, 240, 200, -80, 200, 128, 255, 255, 0, 255, 0, 0, 1, { NULL }, 0, 0, 0, 0 }, + { 352, 172, 32, 172, -288, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 452, 166, 132, 166, -188, 166, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 560, 184, 240, 184, -80, 184, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 452, 180, 132, 180, -188, 180, 255, 192, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 1, { NULL }, 0, 0, 0, 0 }, + { 452, 198, 132, 198, -188, 198, 255, 192, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 1, { NULL }, 0, 0, 0, 0 }, + { 452, 216, 132, 216, -188, 216, 255, 192, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 1, { NULL }, 0, 0, 0, 0 }, + { 560, 200, 240, 200, -80, 200, 128, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 1, { NULL }, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; MenuElement D_800E0CEC[11] = { - { 575, 172, 255, 172, -65, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 542, 172, 222, 172, -98, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 509, 172, 189, 172, -131, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 476, 172, 156, 172, -164, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 443, 172, 123, 172, -197, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 410, 172, 90, 172, -230, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 377, 172, 57, 172, -263, 172, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 344, 172, 24, 172, -296, 166, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, - { 481, 166, 161, 166, -159, 166, 0, 0, 0, 255, 128, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 479, 164, 159, 164, -161, 164, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 575, 172, 255, 172, -65, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 542, 172, 222, 172, -98, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 509, 172, 189, 172, -131, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 476, 172, 156, 172, -164, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 443, 172, 123, 172, -197, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 410, 172, 90, 172, -230, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 377, 172, 57, 172, -263, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 344, 172, 24, 172, -296, 166, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 }, + { 481, 166, 161, 166, -159, 166, 0, 0, 0, 255, 128, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 479, 164, 159, 164, -161, 164, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; MenuElement D_800E0E4C[9] = { - { 481, 174, 161, 174, -159, 174, 0, 0, 0, 255, 128, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 479, 172, 159, 172, -161, 172, 255, 255, 255, 0, 255, 0, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 368, 192, 48, 192, -272, 192, 255, 64, 64, 96, 255, 0, 8, 0, { NULL }, 0, 0, 0, 0 }, - { 506, 187, 186, 187, -134, 187, 255, 192, 255, 0, 255, 0, 0, 1, { NULL }, 0, 0, 0, 0 }, - { 578, 192, 258, 192, -62, 192, 255, 128, 255, 96, 255, 0, 12, 0, { &D_80126390 }, 0, 0, 0, 0 }, - { 368, 212, 48, 212, -272, 212, 255, 64, 64, 96, 255, 0, 8, 0, { NULL }, 0, 0, 0, 0 }, - { 506, 207, 186, 207, -134, 207, 128, 255, 255, 0, 255, 0, 0, 1, { NULL }, 0, 0, 0, 0 }, - { 578, 212, 258, 212, -62, 212, 255, 128, 255, 96, 255, 0, 12, 0, { &D_80126394 }, 0, 0, 0, 0 }, + { 481, 174, 161, 174, -159, 174, 0, 0, 0, 255, 128, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 479, 172, 159, 172, -161, 172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 368, 192, 48, 192, -272, 192, 255, 64, 64, 96, 255, ASSET_FONTS_FUNFONT, 8, 0, { NULL }, 0, 0, 0, 0 }, + { 506, 187, 186, 187, -134, 187, 255, 192, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 1, { NULL }, 0, 0, 0, 0 }, + { 578, 192, 258, 192, -62, 192, 255, 128, 255, 96, 255, ASSET_FONTS_FUNFONT, 12, 0, { &D_80126390 }, 0, 0, 0, 0 }, + { 368, 212, 48, 212, -272, 212, 255, 64, 64, 96, 255, ASSET_FONTS_FUNFONT, 8, 0, { NULL }, 0, 0, 0, 0 }, + { 506, 207, 186, 207, -134, 207, 128, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 1, { NULL }, 0, 0, 0, 0 }, + { 578, 212, 258, 212, -62, 212, 255, 128, 255, 96, 255, ASSET_FONTS_FUNFONT, 12, 0, { &D_80126394 }, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; @@ -1058,49 +1058,49 @@ s16 D_800E1044 = -1; MenuElement D_800E1048[9][3] = { { - { 481, 35, 161, 35, -159, 35, 0, 0, 0, 255, 128, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 32, 160, 32, -160, 32, 255, 255, 255, 0, 255, 2, 12, 0, { NULL }, 0, 0, 0, 0 }, - { 64, -192, 64, 48, 64, 288, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 481, 35, 161, 35, -159, 35, 0, 0, 0, 255, 128, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 32, 160, 32, -160, 32, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 12, 0, { NULL }, 0, 0, 0, 0 }, + { 64, -192, 64, 48, 64, 288, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 32, -192, 32, 48, 32, 288, 255, 255, 255, 0, 255, 0, 0, 0, { gFirstPlace }, 0, 0, 0, 0 }, - { 130, -172, 130, 68, 130, 308, 255, 255, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[0] }, 0, 0, 0, 0 }, - { 64, -150, 64, 90, 64, 330, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 32, -192, 32, 48, 32, 288, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gFirstPlace }, 0, 0, 0, 0 }, + { 130, -172, 130, 68, 130, 308, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[0] }, 0, 0, 0, 0 }, + { 64, -150, 64, 90, 64, 330, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 32, -150, 32, 90, 32, 330, 255, 255, 255, 0, 255, 0, 0, 0, { gSecondPlace }, 0, 0, 0, 0 }, - { 130, -130, 130, 110, 130, 350, 255, 192, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[1] }, 0, 0, 0, 0 }, - { 64, -108, 64, 132, 64, 372, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 32, -150, 32, 90, 32, 330, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gSecondPlace }, 0, 0, 0, 0 }, + { 130, -130, 130, 110, 130, 350, 255, 192, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[1] }, 0, 0, 0, 0 }, + { 64, -108, 64, 132, 64, 372, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 32, -108, 32, 132, 32, 372, 255, 255, 255, 0, 255, 0, 0, 0, { gThirdPlace }, 0, 0, 0, 0 }, - { 130, -88, 130, 152, 130, 392, 255, 128, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[2] }, 0, 0, 0, 0 }, - { 64, -66, 64, 174, 64, 414, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 32, -108, 32, 132, 32, 372, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gThirdPlace }, 0, 0, 0, 0 }, + { 130, -88, 130, 152, 130, 392, 255, 128, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[2] }, 0, 0, 0, 0 }, + { 64, -66, 64, 174, 64, 414, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 32, -66, 32, 174, 32, 414, 255, 255, 255, 0, 255, 0, 0, 0, { gFourthPlace }, 0, 0, 0, 0 }, - { 130, -46, 130, 194, 130, 434, 255, 64, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[3] }, 0, 0, 0, 0 }, - { 220, 288, 220, 48, 220, -192, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 32, -66, 32, 174, 32, 414, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gFourthPlace }, 0, 0, 0, 0 }, + { 130, -46, 130, 194, 130, 434, 255, 64, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[3] }, 0, 0, 0, 0 }, + { 220, 288, 220, 48, 220, -192, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 188, 288, 188, 48, 188, -192, 255, 255, 255, 0, 255, 0, 0, 0, { gFifthPlace }, 0, 0, 0, 0 }, - { 286, 308, 286, 68, 286, -172, 255, 255, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[4] }, 0, 0, 0, 0 }, - { 220, 330, 220, 90, 220, -160, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 188, 288, 188, 48, 188, -192, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gFifthPlace }, 0, 0, 0, 0 }, + { 286, 308, 286, 68, 286, -172, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[4] }, 0, 0, 0, 0 }, + { 220, 330, 220, 90, 220, -160, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 188, 330, 188, 90, 188, -150, 255, 255, 255, 0, 255, 0, 0, 0, { gSixthPlace }, 0, 0, 0, 0 }, - { 286, 350, 286, 110, 286, -130, 255, 192, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[5] }, 0, 0, 0, 0 }, - { 220, 372, 220, 132, 220, -108, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 188, 330, 188, 90, 188, -150, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gSixthPlace }, 0, 0, 0, 0 }, + { 286, 350, 286, 110, 286, -130, 255, 192, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[5] }, 0, 0, 0, 0 }, + { 220, 372, 220, 132, 220, -108, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 188, 372, 188, 132, 188, -108, 255, 255, 255, 0, 255, 0, 0, 0, { gSeventhPlace }, 0, 0, 0, 0 }, - { 286, 392, 286, 152, 286, -88, 255, 128, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[6] }, 0, 0, 0, 0 }, - { 220, 414, 220, 174, 220, -66, 255, 255, 255, 0, 255, 0, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } + { 188, 372, 188, 132, 188, -108, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gSeventhPlace }, 0, 0, 0, 0 }, + { 286, 392, 286, 152, 286, -88, 255, 128, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[6] }, 0, 0, 0, 0 }, + { 220, 414, 220, 174, 220, -66, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 3, { &D_800E0A50 }, 0, 0, 0, 0 } }, { - { 188, 414, 188, 174, 188, -66, 255, 255, 255, 0, 255, 0, 0, 0, { gEighthPlace }, 0, 0, 0, 0 }, - { 286, 434, 286, 194, 286, -46, 255, 64, 255, 0, 255, 0, 4, 2, { &gTrophyRacePointsArray[7] }, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 } + { 188, 414, 188, 174, 188, -66, 255, 255, 255, 0, 255, ASSET_FONTS_FUNFONT, 0, 0, { gEighthPlace }, 0, 0, 0, 0 }, + { 286, 434, 286, 194, 286, -46, 255, 64, 255, 0, 255, ASSET_FONTS_FUNFONT, 4, 2, { &gTrophyRacePointsArray[7] }, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ASSET_FONTS_FUNFONT, 0, 0, { NULL }, 0, 0, 0, 0 } }, }; @@ -1354,14 +1354,14 @@ s32 gCheatsInCreditsArray[21] = { s32 gViewingCreditsFromCheat = 0; // Set to 1 if viewing credits from "WHODIDTHIS" cheat MenuElement D_800E1B50[9] = { - { 480, 104, 160, 104, -160, 104, 255, 0, 255, 48, 255, 0, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 104, 160, 104, -160, 104, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 104, 160, 104, -160, 104, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 104, 160, 104, -160, 104, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, - { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, 2, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 104, 160, 104, -160, 104, 255, 0, 255, 48, 255, ASSET_FONTS_FUNFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 104, 160, 104, -160, 104, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 104, 160, 104, -160, 104, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 104, 160, 104, -160, 104, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, + { 480, 132, 160, 132, -160, 132, 255, 255, 255, 0, 255, ASSET_FONTS_BIGFONT, 4, 0, { NULL }, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL }, 0, 0, 0, 0 }, }; @@ -1690,7 +1690,7 @@ void func_80081218(void) { get_number_of_levels_and_worlds(&numLevels, &numWorlds); sp20 = ((numLevels * 4) + (numWorlds * 2) + 0x11B) & ~3; sp28 = numLevels * 4; - D_80126530[0] = allocate_from_main_pool_safe(sp20 * 4, COLOR_TAG_WHITE); + D_80126530[0] = allocate_from_main_pool_safe(sp20 * 4, COLOUR_TAG_WHITE); D_80126530[0] = D_80126530[0]; D_80126530[0]->courseFlagsPtr = (u8 *)D_80126530[0] + sizeof(Settings); D_80126530[0]->balloonsPtr = (u8 *)D_80126530[0]->courseFlagsPtr + sp28; @@ -1705,7 +1705,7 @@ void func_80081218(void) { D_80126530[3]->balloonsPtr = (u8 *)D_80126530[3]->courseFlagsPtr + sp28; gCheatsAssetData = get_misc_asset(0x41); gNumberOfCheats = (s32)(*gCheatsAssetData); - gMenuText = allocate_from_main_pool_safe(1024 * sizeof(char *), COLOR_TAG_WHITE); + gMenuText = allocate_from_main_pool_safe(1024 * sizeof(char *), COLOUR_TAG_WHITE); load_menu_text(ENGLISH); for (i = 0; i < 128; i++) { D_80126550[i] = NULL; @@ -1899,7 +1899,7 @@ void show_timestamp(s32 frameCount, s32 xPos, s32 yPos, u8 red, u8 green, u8 blu sMenuGuiColourR = red; sMenuGuiColourG = green; sMenuGuiColourB = blue; - if (fontID == FONT_COLOURFUL) { + if (fontID == ASSET_FONTS_FUNFONT) { gMenuImageStack[0].unk10 = yPos; gMenuImageStack[1].unk10 = yPos - 2; imageIndex = 0; @@ -2178,7 +2178,7 @@ void print_missing_controller_text(Gfx **dl, s32 updateRate) { if (D_800DF46C & 0x10) { load_menu_text(get_language()); - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(255, 255, 255, 0, 0xFF); set_text_background_colour(0, 0, 0, 0); posY = 208; @@ -2239,7 +2239,7 @@ s32 menu_logo_screen_loop(s32 updateRate) { } // This uses doubles instead of floats for precision in the counting. if (sBootScreenTimer < 8.5) { - set_text_font(FONT_SMALL); + set_text_font(ASSET_FONTS_SMALLFONT); set_text_background_colour(0, 0, 0, 0); if ((sBootScreenTimer < 8.0) && (sBootScreenTimer >= 7.5)) { opacity = (8.0 - sBootScreenTimer) * 510.0; @@ -2321,8 +2321,8 @@ void menu_title_screen_init(void) { } set_music_player_voice_limit(0x1B); func_800660C0(); - set_text_font(FONT_COLOURFUL); - func_800C4170(2); + set_text_font(ASSET_FONTS_FUNFONT); + load_font(2); func_80000890(0); set_time_trial_enabled(FALSE); D_80126864 = 0; @@ -2349,7 +2349,7 @@ void func_80084118(void) { func_8009C4A8(sGameTitleTileTextures); set_music_player_voice_limit(0x10); func_800660D0(); - func_800C422C(2); + unload_font(2); func_80000890(1); } @@ -2357,8 +2357,8 @@ void menu_options_init(void) { D_801263BC = 0; gMenuDelay = 0; func_800C01D8(&sMenuTransitionFadeOut); - func_800C4170(2); - set_text_font(FONT_LARGE); + load_font(2); + set_text_font(ASSET_FONTS_BIGFONT); set_music_player_voice_limit(0x18); play_music(0x18); func_80000B18(); @@ -2370,7 +2370,7 @@ void func_800841B8(UNUSED s32 arg0) { s32 alpha; s32 yPos; - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_background_colour(0, 0, 0, 0); set_text_colour(0, 0, 0, 255, 128); draw_text(&sMenuCurrDisplayList, 161, 35, gMenuText[36], ALIGN_MIDDLE_CENTER); // OPTIONS @@ -2380,7 +2380,7 @@ void func_800841B8(UNUSED s32 arg0) { optionMenuTextIndex = 0; yPos = 76; - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); while (gOptionMenuStrings[optionMenuTextIndex] != NULL) { if (optionMenuTextIndex == D_800DF460) { @@ -2515,7 +2515,7 @@ GLOBAL_ASM("asm/non_matchings/menu/menu_options_loop.s") #endif void func_80084734(void) { - func_800C422C(2); + unload_font(2); } void menu_audio_options_init(void) { @@ -2541,7 +2541,7 @@ void menu_audio_options_init(void) { gAudioMenuStrings[3].unk2 = 0xC0; D_801263E0 = 4; } - func_800C4170(2); + load_font(2); } GLOBAL_ASM("asm/non_matchings/menu/func_80084854.s") @@ -2706,7 +2706,7 @@ void func_800851FC(void) { func_80000B18(); } func_8009C4A8(gOptionMenuTextures); - func_800C422C(2); + unload_font(2); } void menu_save_options_init(void) { @@ -2719,8 +2719,8 @@ void menu_save_options_init(void) { gMenuDelay = 0; D_801263E0 = 1; D_801263D8 = 0; - 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_80126A64 = (s32)allocate_from_main_pool_safe(0x800, COLOUR_TAG_WHITE); + D_80126A0C = (s32)allocate_from_main_pool_safe(0xA00, COLOUR_TAG_WHITE); D_80126A04 = (unk800860A8 *)(D_80126A0C + 0x500); D_80126A08 = 0; D_80126BD4 = 0; @@ -2731,7 +2731,7 @@ void menu_save_options_init(void) { func_8009C674(D_800DFC78); allocate_menu_images(D_800DFCAC); func_8007FFEC(0xA); - func_800C4170(2); + load_font(2); D_800DFC10[0].texture = D_80126550[71]; D_800DFC20[0].texture = D_80126550[72]; D_800DFC30[0].texture = D_80126550[75]; @@ -2873,7 +2873,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_80087734.s") GLOBAL_ASM("asm/non_matchings/menu/menu_save_options_loop.s") void func_80087EB8(void) { - func_800C422C(2); + unload_font(2); func_8007FF88(); func_8009C4A8(D_800DFC78); assign_dialogue_box_id(7); @@ -3104,7 +3104,7 @@ void func_800887E8(void) { s32 i; // Starting point - D_80126AA0[0] = allocate_from_main_pool_safe(0x200, COLOR_TAG_WHITE); + D_80126AA0[0] = allocate_from_main_pool_safe(0x200, COLOUR_TAG_WHITE); // Fills in the table. for (i = 1; i < 16; i++) { @@ -3137,7 +3137,7 @@ void func_800887E8(void) { } else { D_80126BB4 = 7; } - func_800C4170(2); + load_font(2); } #ifdef NON_EQUIVALENT @@ -3159,7 +3159,7 @@ void func_80088938(s32 arg0) { if (D_80126BC8 != 0) { draw_menu_elements(1, D_800DFCB4, 1.0f); } else if (gShowControllerPakMenu != 0) { - set_text_font(2); + set_text_font(ASSET_FONTS_BIGFONT); set_text_colour(0, 0, 0, 255, 128); draw_text(&sMenuCurrDisplayList, 161, 33, gMenuText[35], ALIGN_MIDDLE_CENTER); set_text_colour(255, 255, 255, 0, 255); @@ -3222,7 +3222,7 @@ void func_80088938(s32 arg0) { func_8007B3D0(&sMenuCurrDisplayList); } } else { - set_text_font(0); + set_text_font(ASSET_FONTS_FUNFONT); if (D_800DF460 == 16) { set_text_colour(255, 255, 255, alpha, 255); } else { @@ -3260,7 +3260,7 @@ void func_80088938(s32 arg0) { } if (D_80126C10 != 0) { set_text_colour(255, 255, 255, 0, 255); - set_text_font(2); + set_text_font(ASSET_FONTS_BIGFONT); draw_text(&sMenuCurrDisplayList, 160, 128, gMenuText[124], ALIGN_MIDDLE_CENTER); } } @@ -3273,7 +3273,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_800890AC.s") void func_800895A4(void) { func_8009C508(0x3F); free_from_memory_pool(D_80126AA0[0]); - func_800C422C(2); + unload_font(2); } void menu_magic_codes_init(void) { @@ -3292,7 +3292,7 @@ void menu_magic_codes_init(void) { set_current_dialogue_box_coords(7, 50, 50, 270, 132); set_current_dialogue_background_colour(7, 0, 0, 0, 128); assign_dialogue_box_id(7); - func_800C4170(2); + load_font(2); } #ifdef NON_EQUIVALENT @@ -3307,12 +3307,12 @@ void render_magic_codes_ui(s32 arg0) { set_text_background_colour(0, 0, 0, 0); render_dialogue_box(&sMenuCurrDisplayList, 0, 0, 7); - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_colour(0, 0, 0, 255, 128); draw_text(&sMenuCurrDisplayList, 161, 35, gMenuText[17], ALIGN_MIDDLE_CENTER); // gMenuText[17] = "MAGIC CODES" set_text_colour(255, 255, 255, 0, 255); draw_text(&sMenuCurrDisplayList, 160, 32, gMenuText[17], ALIGN_MIDDLE_CENTER); // gMenuText[17] = "MAGIC CODES" - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(255, 255, 255, 0, 255); c = 'A'; @@ -3349,7 +3349,7 @@ void render_magic_codes_ui(s32 arg0) { temp = 511 - temp; } - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); yPos = 164; yIncr = 16; if (osTvType == TV_TYPE_PAL) { @@ -3365,7 +3365,7 @@ void render_magic_codes_ui(s32 arg0) { draw_text(&sMenuCurrDisplayList, POS_CENTRED, yPos, gMagicCodeMenuStrings[i], ALIGN_MIDDLE_CENTER); yPos += yIncr; } - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(255, 255, 128, 128, 255); set_text_background_colour(0, 0, 128, 128); if (gOptionsMenuItemIndex == 4) { @@ -3386,7 +3386,7 @@ void render_magic_codes_ui(s32 arg0) { yPos = 134; } assign_dialogue_box_id(6); - set_dialogue_font(6, FONT_COLOURFUL); + set_dialogue_font(6, ASSET_FONTS_FUNFONT); set_current_dialogue_box_coords(6, 76, yPos - 28, 244, yPos + 28); set_current_dialogue_background_colour(6, 0, 0, 0, 160); yPos = 4; @@ -3423,7 +3423,7 @@ GLOBAL_ASM("asm/non_matchings/menu/render_magic_codes_ui.s") GLOBAL_ASM("asm/non_matchings/menu/menu_magic_codes_loop.s") void func_8008A4C8(void) { - func_800C422C(2); + unload_font(2); } void menu_magic_codes_list_init(void) { @@ -3431,7 +3431,7 @@ void menu_magic_codes_list_init(void) { gMenuDelay = 0; D_801263E0 = 0; gOptionsMenuItemIndex = (u16)0; - func_800C4170(2); + load_font(2); func_8009C6D4(0x3F); func_8008E4B0(); func_800C01D8(&sMenuTransitionFadeOut); @@ -3453,7 +3453,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { s32 i; set_text_background_colour(0, 0, 0, 0); - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_colour(0, 0, 0, 255, 128); draw_text(&sMenuCurrDisplayList, 161, 35, gMenuText[20], ALIGN_MIDDLE_CENTER); // MAGIC CODES LIST set_text_colour(255, 255, 255, 0, 255); @@ -3473,7 +3473,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { if (alpha >= 256) { alpha = 511 - alpha; } - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(255, 255, 255, 0, 255); for (i = D_801263E0; (i < D_801263E0 + D_80126C70) && (i < numOfUnlockedCheats); i++) { if (i == gOptionsMenuItemIndex) { @@ -3624,7 +3624,7 @@ GLOBAL_ASM("asm/non_matchings/menu/menu_magic_codes_list_loop.s") void func_8008AD1C(void) { func_8009C508(0x3F); - func_800C422C(2); + unload_font(2); } #ifdef NON_EQUIVALENT @@ -3639,7 +3639,7 @@ void calculate_and_display_rom_checksum(void) { numBytesLeft = &__ROM_END; numBytesLeft -= 0x1000; romOffset = 0x1000; - tempBuffer = allocate_from_main_pool_safe(0x5000, COLOR_TAG_BLACK); + tempBuffer = allocate_from_main_pool_safe(0x5000, COLOUR_TAG_BLACK); while (numBytesLeft > 0) { numBytes = numBytesLeft; @@ -3754,7 +3754,7 @@ void menu_character_select_init(void) { func_8009C674(D_800DFDC8); allocate_menu_images(D_800DFDCC); func_800C01D8(&sMenuTransitionFadeOut); - func_800C4170(2); + load_font(2); } /** @@ -3763,7 +3763,7 @@ void menu_character_select_init(void) { void draw_character_select_text(UNUSED s32 arg0) { s32 yPos; if (gMenuDelay >= -0x16 && gMenuDelay < 0x17) { - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_background_colour(0, 0, 0, 0); set_text_colour(0, 0, 0, 255, 128); // Draw "Player Select" text drop shadow @@ -3946,7 +3946,7 @@ void func_8008BFE8(s32 arg0, s8 *arg1, s32 arg2, u16 arg3, u16 arg4) { void func_8008C128(void) { func_8009C4A8((s16 *)&D_800DFDC8); set_free_queue_state(0); - func_800C422C(2); + unload_font(2); set_free_queue_state(2); D_800DFFD0 = 0; } @@ -3960,7 +3960,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_8008C168.s") void menu_caution_init(void) { gIgnorePlayerInput = 60; gMenuDelay = 0; - func_800C4170(2); + load_font(2); func_800C01D8(&sMenuTransitionFadeOut); gPlayerHasSeenCautionMenu = 1; } @@ -3991,10 +3991,10 @@ s32 menu_caution_loop(s32 updateRate) { } /** - * Explicitly says to unload the FONT_LARGE type. + * Explicitly says to unload the ASSET_FONTS_BIGFONT type. */ void unload_large_font(void) { - func_800C422C(FONT_LARGE); + unload_font(ASSET_FONTS_BIGFONT); } #ifdef NON_EQUIVALENT @@ -4012,7 +4012,7 @@ void menu_game_select_init(void) { D_801263D8 = 1; func_8009C6D4(0x43); func_8007FFEC(3); - func_800C4170(2); + load_font(2); play_music(0x1A); for (i = 0; i < 10; i++) { @@ -4176,7 +4176,7 @@ s32 menu_game_select_loop(s32 arg0) { } void func_8008CACC(void) { - func_800C422C(2); + unload_font(2); func_8007FF88(); func_8009C508(0x43); } @@ -4200,7 +4200,7 @@ void menu_file_select_init(void) { D_80126488 = 0; D_80126CC0 = 0; func_800C01D8(&sMenuTransitionFadeOut); - func_800C4170(2); + load_font(2); play_music(0x1A); for (i = 0; i < 10; i++) { if (i != D_801263B4.unk0) { @@ -4269,7 +4269,7 @@ void render_file_select_menu(UNUSED s32 updateRate) { } func_80080BC8(&sMenuCurrDisplayList); if (D_801263D8 == 0) { - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_background_colour(0, 0, 0, 0); s5 = 10; for (i = 0; i < 3; i++) { @@ -4302,7 +4302,7 @@ void render_file_select_menu(UNUSED s32 updateRate) { if (phi_v0_2 >= 0x100) { phi_v0_2 = 0x1FF - phi_v0_2; } - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_background_colour(0, 0, 0, 0); set_text_colour(255, 255, 255, 0, 255); for (i = 0; i < 3; i++) { @@ -4333,7 +4333,7 @@ void render_file_select_menu(UNUSED s32 updateRate) { } } } - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_colour(0, 0, 0, 255, 128); draw_text(&sMenuCurrDisplayList, 161, 19, gMenuText[76], ALIGN_TOP_CENTER); set_text_colour(255, 255, 255, 0, 255); @@ -4342,10 +4342,10 @@ void render_file_select_menu(UNUSED s32 updateRate) { y += 0xBB; if (D_80126484 != 0) { if (D_80126494 == 0) { - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); draw_text(&sMenuCurrDisplayList, 160, y, gMenuText[77], ALIGN_MIDDLE_CENTER); } else if (D_80126494 == 1) { - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); draw_text(&sMenuCurrDisplayList, 160, y, gMenuText[78], ALIGN_MIDDLE_CENTER); } else { draw_text(&sMenuCurrDisplayList, 160, y, &D_800E8234, ALIGN_MIDDLE_CENTER); @@ -4354,7 +4354,7 @@ void render_file_select_menu(UNUSED s32 updateRate) { } if (D_80126488 != 0) { if (D_80126494 == 0) { - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); draw_text(&sMenuCurrDisplayList, 160, y, gMenuText[79], ALIGN_MIDDLE_CENTER); } else { draw_text(&sMenuCurrDisplayList, 160, y, &D_800E8238, ALIGN_MIDDLE_CENTER); @@ -4455,7 +4455,7 @@ GLOBAL_ASM("asm/non_matchings/menu/menu_file_select_loop.s") void func_8008E428(void) { func_8009C4A8(D_800E0398); func_8007FF88(); - func_800C422C(2); + unload_font(2); } void func_8008E45C(void) { @@ -4582,7 +4582,7 @@ void func_8008F534(void) { func_8009C508(D_800E0710[i + 1]); } } - func_800C422C(2); + unload_font(2); func_8007FF88(); func_80000B28(); func_80000C2C(); @@ -4657,7 +4657,7 @@ void render_track_select_setup_ui(s32 updateRate) { sMenuGuiOpacity = 0; } sp7C = func_8006B0F8(gTrackIdForPreview); - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_colour(192, 192, 255, 0, sMenuGuiOpacity); set_text_background_colour(0, 0, 0, 0); draw_text(&sMenuCurrDisplayList, POS_CENTRED, 43, get_level_name(gTrackIdForPreview), ALIGN_MIDDLE_CENTER); // Draw track name? @@ -4680,7 +4680,7 @@ void render_track_select_setup_ui(s32 updateRate) { func_80080580(&sMenuCurrDisplayList, -(s4 >> 1), 0x78 - D_800E0700[1], s4, D_800E0700[3], D_800E0700[4], D_800E0700[5], sMenuGuiOpacity + 0xB0E0C000, D_8012665C); func_80080E6C(); - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); s7 = D_800E0700[7] + D_800E0700[1] + sp80; s7++; for (i = 0; i < 2; i++) { @@ -4701,7 +4701,7 @@ void render_track_select_setup_ui(s32 updateRate) { } } if (D_801269C8 < 4) { - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(255, 64, 64, 96, sMenuGuiOpacity); draw_text(&sMenuCurrDisplayList, 56, 72 + sp80, gMenuText[9], ALIGN_MIDDLE_LEFT); // gMenuText[9] = "BEST TIME" draw_text(&sMenuCurrDisplayList, 56, 92 + sp80, gMenuText[10], ALIGN_MIDDLE_LEFT); // gMenuText[10] = "BEST LAP" @@ -4827,7 +4827,7 @@ void render_track_select_setup_ui(s32 updateRate) { } func_80080580(&sMenuCurrDisplayList, -(s4 >> 1), 0x78 - D_800E06E4[1], s4, D_800E06E4[3], D_800E06E4[4], D_800E06E4[5], 0xB0E0C0FF, D_8012665C); func_80080E6C(); - set_text_font(FONT_COLOURFUL); + set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(0, 0, 0, 0xFF, 0x80); draw_text(&sMenuCurrDisplayList, D_800E06E4[6] + D_800E06E4[0] + 1, D_800E06E4[7] + D_800E06E4[1] + 1, gMenuText[136], ALIGN_MIDDLE_CENTER); set_text_colour(0xFF, 0xFF, 0xFF, 0, 0xFF); @@ -4885,7 +4885,7 @@ void render_track_select_setup_ui(s32 updateRate) { } if (D_801269C8 != 5) { if (((D_801263E0 == 2) && !sp74) || ((D_801263E0 == 3) && sp74) || (D_801263E0 == 4)) { - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); set_text_colour(0xFF, 0xFF, 0xFF, 0, sMenuGuiOpacity); if (D_801269C8 >= 4) { sp80 += 0x18; @@ -4976,7 +4976,7 @@ void menu_5_init(void) { D_801263BC = 0; gMenuDelay = 0; D_800E0980 = 0x1E; - func_800C4170(2); + load_font(2); load_level_for_menu(s0, -1, 1); } assign_dialogue_box_id(7); @@ -5099,7 +5099,7 @@ s32 menu_5_loop(s32 updateRate) { void func_80093A0C(void) { func_8009C4A8((s16 *)&D_800E0FB4); - func_800C422C(2); + unload_font(2); func_80000B28(); } @@ -5334,7 +5334,7 @@ void menu_11_init(void) { func_8009C674(D_800E0A24); allocate_menu_images(D_800E0A40); func_80094604(); - func_800C4170(2); + load_font(2); func_800C01D8(&sMenuTransitionFadeOut); set_music_player_voice_limit(0x18); play_music(0x18); @@ -5346,7 +5346,7 @@ GLOBAL_ASM("asm/non_matchings/menu/menu_results_loop.s") void func_800976CC(void) { func_8009C4A8(D_800E0A24); - func_800C422C(2); + unload_font(2); } /** @@ -5451,14 +5451,14 @@ void func_80097874(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 *arg4, s32 arg5, gCheatInputString = NULL; D_80126C3C = 0; D_80126C34 = 0; - func_800C4170(2); + load_font(2); } GLOBAL_ASM("asm/non_matchings/menu/func_80097918.s") GLOBAL_ASM("asm/non_matchings/menu/func_80097D10.s") void func_800981E8(void) { - func_800C422C(2); + unload_font(2); } // Gets triggered when entering trophy race in adventure mode. @@ -5503,7 +5503,7 @@ void menu_trophy_race_round_init(void) { gMenuDelay = 0; D_800E0980 = 10; - func_800C4170(2); + load_font(2); set_music_player_voice_limit(0x18); play_music(0x18); set_music_fade_timer(0x100); @@ -5532,7 +5532,7 @@ void draw_trophy_race_text(UNUSED s32 updateRate) { worldName = get_level_name(get_hub_area_id(gTrophyRaceWorldId)); levelName = get_level_name(levelIds[((gTrophyRaceWorldId - 1) * 6) + gTrophyRaceRound]); set_text_background_colour(0, 0, 0, 0); - set_text_font(FONT_LARGE); + set_text_font(ASSET_FONTS_BIGFONT); //Text Shadows first set_text_colour(0, 0, 0, 255, 128); draw_text(&sMenuCurrDisplayList, 161, 35, (char *)worldName, ALIGN_MIDDLE_CENTER); @@ -5587,7 +5587,7 @@ s32 menu_trophy_race_round_loop(s32 updateRate) { } void func_80098754(void) { - func_800C422C(2); + unload_font(2); } GLOBAL_ASM("asm/non_matchings/menu/func_80098774.s") @@ -5631,7 +5631,7 @@ GLOBAL_ASM("asm/non_matchings/menu/menu_trophy_race_rankings_loop.s") void func_80099600(void) { func_8009C4A8(D_800E1024); - func_800C422C(2); + unload_font(2); } s32 get_trophy_race_world_id(void) { @@ -5654,7 +5654,7 @@ void menu_ghost_data_init(void) { } func_8009C674(&D_800E1708); allocate_menu_images(&D_800E174C); - func_800C4170(2); + load_font(2); D_800E153C[0].texture = D_80126550[14]; D_800E153C[5].texture = D_80126550[15]; D_800E1594[0].texture = D_80126550[16]; @@ -5818,7 +5818,7 @@ s32 menu_ghost_data_loop(s32 updateRate) { void func_8009ABAC(void) { func_8009C4A8(D_800E1708); - func_800C422C(2); + unload_font(2); } void func_8009ABD8(s8 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { @@ -5893,7 +5893,7 @@ void menu_credits_init(void) { func_8009C674(D_800E17D8); allocate_menu_images(D_800E17F0); func_80094604(); - func_800C4170(2); + load_font(2); set_music_player_voice_limit(0x18); D_800E18F8 = (u16)0x1000; if (gViewingCreditsFromCheat) { @@ -5957,7 +5957,7 @@ void func_8009BCF0(void) { func_80066894(0, 0); set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, VIEWPORT_AUTO, VIEWPORT_AUTO); func_8009C4A8(D_800E17D8); - func_800C422C(2); + unload_font(2); func_8006F564(0); } @@ -6313,7 +6313,7 @@ void allocate_menu_images(s16 *imageSet) { void allocate_and_set_menu_image_properties(s32 imageID) { if (gMenuImageStack == NULL) { - gMenuImageStack = allocate_from_main_pool_safe(sizeof(unk800DF510) * 18, COLOR_TAG_RED); + gMenuImageStack = allocate_from_main_pool_safe(sizeof(unk800DF510) * 18, COLOUR_TAG_RED); } gMenuImageStack[imageID].unk0 = sMenuImageProperties[imageID].unk0; @@ -6480,7 +6480,7 @@ s32 taj_menu_loop(void) { } if ((sCurrentMenuID > 0) && (sCurrentMenuID < 4)) { set_current_dialogue_box_coords(1, 24, 16, 184, 124); - set_dialogue_font(1, FONT_COLOURFUL); + set_dialogue_font(1, ASSET_FONTS_FUNFONT); } sp2C = 0; buttonsPressed = get_buttons_pressed_from_player(0); @@ -6642,7 +6642,7 @@ s32 dialogue_race_defeat(void) { s32 playerInput; set_current_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x87); - set_dialogue_font(1, FONT_COLOURFUL); + set_dialogue_font(1, ASSET_FONTS_FUNFONT); state = 0; playerInput = get_buttons_pressed_from_player(0); sDialogueOptionMax = 0; @@ -6696,7 +6696,7 @@ s32 tt_menu_loop(void) { } else { set_current_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0xDC); } - set_dialogue_font(1, FONT_COLOURFUL); + set_dialogue_font(1, ASSET_FONTS_FUNFONT); currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); sDialogueOptionMax = 0; @@ -6900,7 +6900,7 @@ s32 trophy_race_cabinet_menu_loop(void) { s32 buttonsPressed; set_current_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x78); - set_dialogue_font(1, FONT_COLOURFUL); + set_dialogue_font(1, ASSET_FONTS_FUNFONT); currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); render_dialogue_text(1, POS_CENTRED, 6, gMenuText[70], 1, 4); // TROPHY RACE diff --git a/src/object_models.c b/src/object_models.c index 737711ca..3ca18fb1 100644 --- a/src/object_models.c +++ b/src/object_models.c @@ -4,7 +4,7 @@ #include "object_models.h" #include "macros.h" #include "memory.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "unknown_0255E0.h" #include "racer.h" @@ -46,8 +46,8 @@ void func_8005F850(void) { s32 i; s32 checksum; - D_8011D624 = allocate_from_main_pool_safe(0x230, COLOR_TAG_GREEN); - D_8011D628 = allocate_from_main_pool_safe(0x190, COLOR_TAG_GREEN); + D_8011D624 = allocate_from_main_pool_safe(0x230, COLOUR_TAG_GREEN); + D_8011D628 = allocate_from_main_pool_safe(0x190, COLOUR_TAG_GREEN); D_8011D62C = 0; D_8011D634 = 0; D_8011D620 = load_asset_section_from_rom(ASSET_OBJECT_MODELS_TABLE); @@ -58,7 +58,7 @@ void func_8005F850(void) { D_8011D630--; D_8011D638 = load_asset_section_from_rom(ASSET_ANIMATION_IDS); D_8011D63C = load_asset_section_from_rom(ASSET_OBJECT_ANIMATIONS_TABLE); - D_8011D644 = allocate_from_main_pool_safe(0xC00, COLOR_TAG_GREEN); + D_8011D644 = allocate_from_main_pool_safe(0xC00, COLOUR_TAG_GREEN); D_8011D640 = 0; // Anti-tamper check. diff --git a/src/objects.c b/src/objects.c index 7fa87e47..92845152 100644 --- a/src/objects.c +++ b/src/objects.c @@ -8,7 +8,7 @@ #include "macros.h" #include "structs.h" #include "level_object_entries.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "asset_loading.h" #include "thread0_epc.h" #include "save_data.h" @@ -323,31 +323,31 @@ void func_8000BF8C(void) { func_8001D258(0.67f, 0.33f, 0, -0x2000, 0); D_8011AE68 = (s32 *)new_sub_memory_pool(0x15800, 0x200); - gParticlePtrList = (Object **)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 = (u32 *)allocate_from_main_pool_safe(0x50, COLOR_TAG_BLUE); - gObjectStructArrayPtr = (Object *)allocate_from_main_pool_safe(0x28, COLOR_TAG_BLUE); - D_8011AEEC = (s32 *)allocate_from_main_pool_safe(0x28, COLOR_TAG_BLUE); - D_8011AEE8 = (Object **)allocate_from_main_pool_safe(0x28, COLOR_TAG_BLUE); - D_8011AF04 = (u32 *)allocate_from_main_pool_safe(0x200, COLOR_TAG_BLUE); - D_8011ADCC = (s8 *)allocate_from_main_pool_safe(8, COLOR_TAG_BLUE); - D_8011AFF4 = (unk800179D0 *)allocate_from_main_pool_safe(0x400, COLOR_TAG_BLUE); + gParticlePtrList = (Object **)allocate_from_main_pool_safe(0x320, COLOUR_TAG_BLUE); + D_8011AE6C = (s32 *)allocate_from_main_pool_safe(0x50, COLOUR_TAG_BLUE); + D_8011AE74 = (s32 *)allocate_from_main_pool_safe(0x200, COLOUR_TAG_BLUE); + D_8011AECC = (unknown8011AECC *)allocate_from_main_pool_safe(0xE10, COLOUR_TAG_BLUE); + D_8011AEDC = (u32 *)allocate_from_main_pool_safe(0x50, COLOUR_TAG_BLUE); + gObjectStructArrayPtr = (Object *)allocate_from_main_pool_safe(0x28, COLOUR_TAG_BLUE); + D_8011AEEC = (s32 *)allocate_from_main_pool_safe(0x28, COLOUR_TAG_BLUE); + D_8011AEE8 = (Object **)allocate_from_main_pool_safe(0x28, COLOUR_TAG_BLUE); + D_8011AF04 = (u32 *)allocate_from_main_pool_safe(0x200, COLOUR_TAG_BLUE); + D_8011ADCC = (s8 *)allocate_from_main_pool_safe(8, COLOUR_TAG_BLUE); + D_8011AFF4 = (unk800179D0 *)allocate_from_main_pool_safe(0x400, COLOUR_TAG_BLUE); gAssetsLvlObjTranslationTable = (s16 *)load_asset_section_from_rom(ASSET_LEVEL_OBJECT_TRANSLATION_TABLE); gAssetsLvlObjTranslationTableLength = (get_size_of_asset_section(ASSET_LEVEL_OBJECT_TRANSLATION_TABLE) >> 1) - 1; while (gAssetsLvlObjTranslationTable[gAssetsLvlObjTranslationTableLength] == 0) { gAssetsLvlObjTranslationTableLength--; } - D_8011AD58 = (s32 *)allocate_from_main_pool_safe(0x800, COLOR_TAG_BLUE); + D_8011AD58 = (s32 *)allocate_from_main_pool_safe(0x800, COLOUR_TAG_BLUE); gAssetsObjectHeadersTable = load_asset_section_from_rom(ASSET_OBJECT_HEADERS_TABLE); gAssetsObjectHeadersTableLength = 0; while (-1 != gAssetsObjectHeadersTable[gAssetsObjectHeadersTableLength]) { gAssetsObjectHeadersTableLength++; } gAssetsObjectHeadersTableLength--; - D_8011AE48 = (s32 *)allocate_from_main_pool_safe(gAssetsObjectHeadersTableLength * 4, COLOR_TAG_WHITE); - D_8011AE4C = (u8 *)allocate_from_main_pool_safe(gAssetsObjectHeadersTableLength, COLOR_TAG_WHITE); + D_8011AE48 = (s32 *)allocate_from_main_pool_safe(gAssetsObjectHeadersTableLength * 4, COLOUR_TAG_WHITE); + D_8011AE4C = (u8 *)allocate_from_main_pool_safe(gAssetsObjectHeadersTableLength, COLOUR_TAG_WHITE); for (i = 0; i < gAssetsObjectHeadersTableLength; i++) { (*D_8011AE4C)[i] = 0; @@ -361,7 +361,7 @@ void func_8000BF8C(void) { } decrypt_magic_codes(&gAssetsMiscSection[gAssetsMiscTable[65]], (gAssetsMiscTable[66] - gAssetsMiscTable[65]) * 4); - gObjPtrList = (Object **)allocate_from_main_pool_safe(0x800, COLOR_TAG_BLUE); + gObjPtrList = (Object **)allocate_from_main_pool_safe(0x800, COLOUR_TAG_BLUE); D_8011ADC4 = 0; gTimeTrialEnabled = 0; D_8011AEF5 = 0; diff --git a/src/particles.c b/src/particles.c index f2ef523a..a41b10a4 100644 --- a/src/particles.c +++ b/src/particles.c @@ -4,7 +4,7 @@ #include "particles.h" #include "types.h" #include "macros.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "memory.h" #include "textures_sprites.h" diff --git a/src/racer.c b/src/racer.c index c5d5d7d9..8ca91474 100644 --- a/src/racer.c +++ b/src/racer.c @@ -9,7 +9,7 @@ #include "types.h" #include "macros.h" #include "structs.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "save_data.h" #include "unknown_008C40.h" #include "objects.h" @@ -815,7 +815,7 @@ void get_timestamp_from_frames(s32 frameCount, s32 *minutes, s32 *seconds, s32 * } void func_800598D0(void) { - gGhostData[0] = allocate_from_main_pool_safe(0x21C0, COLOR_TAG_RED); + gGhostData[0] = allocate_from_main_pool_safe(0x21C0, COLOUR_TAG_RED); gGhostData[1] = (GhostNode *)gGhostData[0] + MAX_NUMBER_OF_GHOST_NODES; gGhostData[2] = NULL; // T.T. Ghost D_8011D5A0[0] = 0; @@ -867,13 +867,13 @@ s32 func_800599B8(s32 arg0, s32 arg1, s16 arg2, s16 *arg3, s16 *arg4) { * Returns 0 if successful, or 1 if an error occured. */ s32 load_tt_ghost(s32 ghostOffset, s32 size, s16 *outTime) { - GhostHeader *ghost = allocate_from_main_pool_safe(size, COLOR_TAG_RED); + GhostHeader *ghost = allocate_from_main_pool_safe(size, COLOUR_TAG_RED); if (ghost != NULL) { load_asset_to_address(ASSET_TTGHOSTS, ghost, ghostOffset, size); if (gGhostData[2] != NULL) { free_from_memory_pool(gGhostData[2]); } - gGhostData[2] = allocate_from_main_pool_safe(size - sizeof(GhostHeader), COLOR_TAG_WHITE); + gGhostData[2] = allocate_from_main_pool_safe(size - sizeof(GhostHeader), COLOUR_TAG_WHITE); if (gGhostData[2] != NULL) { *outTime = ghost->time; gTTGhostNodeCount = ghost->nodeCount; diff --git a/src/save_data.c b/src/save_data.c index 4b9409da..73e4af89 100644 --- a/src/save_data.c +++ b/src/save_data.c @@ -373,7 +373,7 @@ s32 read_game_data_from_controller_pak(s32 controllerIndex, u8 *fileExt, Setting ret = CONTROLLER_PAK_BAD_DATA; } if (ret == CONTROLLER_PAK_GOOD) { - alloc = allocate_from_main_pool_safe(fileSize, COLOR_TAG_BLACK); + alloc = allocate_from_main_pool_safe(fileSize, COLOUR_TAG_BLACK); ret = read_data_from_controller_pak(controllerIndex, fileNumber, (u8 *)alloc, fileSize); if (ret == CONTROLLER_PAK_GOOD) { @@ -407,7 +407,7 @@ s32 write_game_data_to_controller_pak(s32 controllerIndex, Settings *arg1) { s32 fileSize; fileSize = get_game_data_file_size(); // 256 bytes - gameData = allocate_from_main_pool_safe(fileSize, COLOR_TAG_WHITE); + gameData = allocate_from_main_pool_safe(fileSize, COLOUR_TAG_WHITE); *((s32 *)gameData) = GAMD; func_800732E8(arg1, gameData + 4); ret = func_80073C5C(controllerIndex, 3, &fileExt); @@ -444,7 +444,7 @@ s32 read_time_data_from_controller_pak(s32 controllerIndex, u8 *fileExt, Setting } if (status == CONTROLLER_PAK_GOOD) { - cpakData = allocate_from_main_pool_safe(fileSize, COLOR_TAG_BLACK); + cpakData = allocate_from_main_pool_safe(fileSize, COLOUR_TAG_BLACK); status = read_data_from_controller_pak(controllerIndex, fileNumber, (u8 *)cpakData, fileSize); if (status == CONTROLLER_PAK_GOOD) { @@ -475,7 +475,7 @@ s32 write_time_data_to_controller_pak(s32 controllerIndex, Settings *arg1) { u8 *fileExt; fileSize = get_time_data_file_size(); // 512 bytes - timeData = allocate_from_main_pool_safe(fileSize, COLOR_TAG_WHITE); + timeData = allocate_from_main_pool_safe(fileSize, COLOUR_TAG_WHITE); *((s32 *)timeData) = TIMD; func_800738A4(arg1, timeData + 4); ret = func_80073C5C(controllerIndex, 4, &fileExt); @@ -527,7 +527,7 @@ s32 write_save_data(s32 saveFileNum, Settings *settings) { } blocks = 5; - alloc = allocate_from_main_pool_safe(blocks * sizeof(u64), COLOR_TAG_WHITE); + alloc = allocate_from_main_pool_safe(blocks * sizeof(u64), COLOUR_TAG_WHITE); func_800732E8(settings, (u8 *)alloc); if (!is_reset_pressed()) { @@ -556,7 +556,7 @@ s32 read_eeprom_data(Settings *arg0, u8 arg1) { return -1; } - alloc = allocate_from_main_pool_safe(0x200, COLOR_TAG_WHITE); + alloc = allocate_from_main_pool_safe(0x200, COLOUR_TAG_WHITE); if (arg1 & 1) { s32 blocks = 24; @@ -593,7 +593,7 @@ s32 write_eeprom_data(Settings *arg0, u8 arg1) { return -1; } - alloc = allocate_from_main_pool_safe(0x200, COLOR_TAG_WHITE); + alloc = allocate_from_main_pool_safe(0x200, COLOUR_TAG_WHITE); func_800738A4(arg0, (u8 *)alloc); @@ -926,7 +926,7 @@ s32 get_controller_pak_file_list(s32 controllerIndex, s32 maxNumOfFilesToGet, u8 } files_used = maxNumOfFilesOnCpak * 24; - D_800DE440 = allocate_from_main_pool_safe(files_used, COLOR_TAG_BLACK); + D_800DE440 = allocate_from_main_pool_safe(files_used, COLOUR_TAG_BLACK); bzero(D_800DE440, files_used); temp_D_800DE440 = D_800DE440; @@ -1062,7 +1062,7 @@ s32 copy_controller_pak_data(s32 controllerIndex, s32 fileNumber, s32 secondCont return (controllerIndex << 30) | CONTROLLER_PAK_BAD_DATA; } - alloc = allocate_from_main_pool_safe(state.file_size, COLOR_TAG_BLACK); + alloc = allocate_from_main_pool_safe(state.file_size, COLOUR_TAG_BLACK); status = read_data_from_controller_pak(controllerIndex, fileNumber, alloc, state.file_size); start_reading_controller_data(controllerIndex); @@ -1314,7 +1314,7 @@ s32 get_file_type(s32 controllerIndex, s32 fileNum) { s32 ret; ret = 6; - data = allocate_from_main_pool_safe(0x100, COLOR_TAG_BLACK); + data = allocate_from_main_pool_safe(0x100, COLOUR_TAG_BLACK); if (read_data_from_controller_pak(controllerIndex, fileNum, (u8 *)data, 0x100) == CONTROLLER_PAK_GOOD) { switch (*data) { case GAMD: diff --git a/src/screen_asset.c b/src/screen_asset.c index b731fa13..4fa4aa27 100644 --- a/src/screen_asset.c +++ b/src/screen_asset.c @@ -42,7 +42,7 @@ UNUSED void *load_screen(s32 screenIndex) { start = screenTable[screenIndex]; size = screenTable[screenIndex + 1] - start; - someAddr = allocate_from_main_pool_safe(size, COLOR_TAG_BLUE); + someAddr = allocate_from_main_pool_safe(size, COLOUR_TAG_BLUE); load_asset_to_address(ASSET_SCREENS, someAddr, start, size); free_from_memory_pool(screenTable); diff --git a/src/screen_asset.h b/src/screen_asset.h index 1d20476f..0dc9d471 100644 --- a/src/screen_asset.h +++ b/src/screen_asset.h @@ -6,7 +6,7 @@ #include "types.h" #include "macros.h" #include "f3ddkr.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "asset_loading.h" #define SCREEN_HEIGHT_PART 6 diff --git a/src/textures_sprites.c b/src/textures_sprites.c index fb87dd57..21ec9fc5 100644 --- a/src/textures_sprites.c +++ b/src/textures_sprites.c @@ -8,7 +8,7 @@ /************ .data ************/ -u32 gTexColourTag = COLOR_TAG_MAGENTA; +u32 gTexColourTag = COLOUR_TAG_MAGENTA; s32 D_800DE7C4 = 1; // See "include/f3ddkr.h" for the defines diff --git a/src/textures_sprites.h b/src/textures_sprites.h index d0a881a0..cb02c986 100644 --- a/src/textures_sprites.h +++ b/src/textures_sprites.h @@ -1,7 +1,7 @@ #ifndef _TEXTURES_SPRITES_H_ #define _TEXTURES_SPRITES_H_ -#include "asset_sections.h" +#include "asset_enums.h" #include "types.h" #include "f3ddkr.h" #include "structs.h" diff --git a/src/unknown_003260.c b/src/unknown_003260.c index ae58df3c..7fb33fb9 100644 --- a/src/unknown_003260.c +++ b/src/unknown_003260.c @@ -100,7 +100,7 @@ void audioNewThread(ALSynConfig *c, OSPri p, OSSched *arg2) { // if (c->fxType == AL_FX_CUSTOM) { // 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, COLOR_TAG_CYAN); + // reg_s0 = allocate_from_main_pool_safe(tmp_size, COLOUR_TAG_CYAN); // load_asset_to_address(39, reg_s0, reg_v0[8], tmp_size); // c->params = reg_s0; // c[1].maxVVoices = 0; diff --git a/src/unknown_003260.h b/src/unknown_003260.h index 2f141e8f..446bc1a8 100644 --- a/src/unknown_003260.h +++ b/src/unknown_003260.h @@ -4,7 +4,7 @@ #include "types.h" #include "macros.h" #include "audio_internal.h" -#include "asset_sections.h" +#include "asset_enums.h" #include "libultra_internal.h" #include "sched.h" diff --git a/src/unknown_008C40.c b/src/unknown_008C40.c index 798bb222..1a88d9b2 100644 --- a/src/unknown_008C40.c +++ b/src/unknown_008C40.c @@ -43,9 +43,9 @@ void func_80008040(void) { s32 i; func_80002128(&D_80119C40, NULL, NULL); - D_80119C48 = allocate_from_main_pool_safe(1440, COLOR_TAG_CYAN); - //D_80119C50 = allocate_from_main_pool_safe(160, COLOR_TAG_CYAN); - D_80119C44 = allocate_from_main_pool_safe(160, COLOR_TAG_CYAN); + D_80119C48 = allocate_from_main_pool_safe(1440, COLOUR_TAG_CYAN); + //D_80119C50 = allocate_from_main_pool_safe(160, COLOUR_TAG_CYAN); + D_80119C44 = allocate_from_main_pool_safe(160, COLOUR_TAG_CYAN); D_800DC6E0 = 0; // phi_v1 = &D_80119C58; // do { diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index b263c31c..4e966514 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -233,9 +233,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, 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); + D_8011D350[i] = allocate_from_main_pool_safe(3200, COLOUR_TAG_YELLOW); + D_8011D320[i] = allocate_from_main_pool_safe(12800, COLOUR_TAG_YELLOW); + D_8011D338[i] = allocate_from_main_pool_safe(20000, COLOUR_TAG_YELLOW); } while ((s32)&D_8011D338[++i] != (s32)&D_8011D348); D_8011B0C8 = 0; diff --git a/src/unknown_032760.c b/src/unknown_032760.c index d94e1204..346b6a42 100644 --- a/src/unknown_032760.c +++ b/src/unknown_032760.c @@ -46,7 +46,7 @@ void func_80031BB8(s32 count) { s32 i; func_80031B60(); D_800DC958 = count; - D_800DC950 = allocate_from_main_pool_safe(D_800DC958 * (sizeof(s32 *) + sizeof(unk800DC954) + sizeof(unk800DC960) + sizeof(unk800DC964)), COLOR_TAG_MAGENTA); + D_800DC950 = allocate_from_main_pool_safe(D_800DC958 * (sizeof(s32 *) + sizeof(unk800DC954) + sizeof(unk800DC960) + sizeof(unk800DC964)), COLOUR_TAG_MAGENTA); D_800DC954 = &D_800DC950[D_800DC958]; D_800DC960 = &D_800DC954[D_800DC958]; D_800DC964 = &D_800DC960[D_800DC958]; diff --git a/src/unknown_0ABDF0.c b/src/unknown_0ABDF0.c index ac48b0c6..1507f76c 100644 --- a/src/unknown_0ABDF0.c +++ b/src/unknown_0ABDF0.c @@ -19,18 +19,18 @@ unk800E2850 D_800E2850[3] = { { 0, 0x08, 2, 0xFE000000, 0xFE000000, 0xFE000000, 0x03FFFFFF, 0x03FFFFFF, 0x03FFFFFF, 4, 4, 8, 8 }, }; -s32 D_800E28D4 = 0; +s32 *D_800E28D4 = 0; -unk800E2850 D_800E28D8 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +unk800E2850 D_800E28D8 = { NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Not sure about typing for the following. s32 D_800E2904 = 0; s32 D_800E2908 = 0; -s32 D_800E290C = 0; -s32 D_800E2910 = 0; -s32 D_800E2914[2] = { 0, 0 }; -s32 D_800E291C = 0; -s32 D_800E2920[2] = { 0, 0 }; +s32 *D_800E290C = NULL; +s32 *D_800E2910 = NULL; +s32 *D_800E2914[2] = { NULL, NULL }; +TextureHeader **D_800E291C = NULL; +s32 D_800E2920 = 0; Gfx D_800E2928[] = { gsDPPipeSync(), @@ -166,7 +166,31 @@ Object *D_80127C40[16]; /******************************/ -GLOBAL_ASM("asm/non_matchings/game_ui/func_800AB1F0.s") +void func_800AB1F0(void) { + D_800E28D8.unk0 = 0; + D_800E28D8.unk4 = 0; + D_800E28D4 = 0; + D_80127BB0 = 0; + D_80127C00 = 6; + D_80127C00 <<= 2; + D_80127C04 = D_80127C00 >> 1; + D_800E2914[0] = 0; + D_800E2914[1] = 0; + D_800E290C = 0; + D_80127BF8.unk0 = -1; + D_80127BF8.unk2 = -0x200; + D_800E2A80 = 0; + D_800E2A84 = 1; + D_800E2A88 = 0; + if (D_800E291C == NULL) { + D_800E291C = load_asset_section_from_rom(ASSET_UNKNOWN_19); + D_800E2920 = 0; + while ((s32)D_800E291C[D_800E2920] != -1) { + D_800E2920++; + } + } + D_80127C08 = 0; +} void func_800AB308(s16 arg0, s16 arg1) { if (D_80127BF8.unk2 < D_80127BF8.unk0) { @@ -178,11 +202,135 @@ void func_800AB308(s16 arg0, s16 arg1) { } } -GLOBAL_ASM("asm/non_matchings/game_ui/func_800AB35C.s") +#define FREE_MEM(mem) \ + tempMem = mem; \ + if (tempMem != 0) { \ + free_from_memory_pool(tempMem); \ + mem = NULL; \ + } + +#define FREE_TEX(tex) \ + tempTex = tex; \ + if (tempTex != 0) { \ + free_texture(tempTex); \ + tex = NULL; \ + } + +void func_800AB35C(void) { + TextureHeader *tempTex; + s32 *tempMem; + + FREE_MEM(D_800E290C); + FREE_MEM(D_800E2914[0]); + FREE_MEM(D_800E2914[1]); + FREE_MEM(D_800E28D4); + FREE_MEM(D_800E28D8.unk0); + FREE_TEX(D_800E28D8.unk8); + FREE_MEM(D_800E2910); + + D_800E2A88 = 0; + D_800E2A80 = 0; + D_800E2A84 = 1; + if (D_800E2C5C != 0) { + func_800AD220(); + } +} + GLOBAL_ASM("asm/non_matchings/game_ui/func_800AB4A8.s") -GLOBAL_ASM("asm/non_matchings/game_ui/func_800ABB34.s") -GLOBAL_ASM("asm/non_matchings/game_ui/func_800ABC5C.s") + +void func_800ABB34(void) { + s32 temp_v0; + s32 phi_s1; + s32 i; + + temp_v0 = 0x10000 / D_800E28D8.unk4; + phi_s1 = 0; + + for(i = 0; i < D_800E28D8.unk4; i++) { + D_800E28D8.unk0[i].unk0 = func_8007082C(phi_s1 & 0xFFFF) << 3; + D_800E28D8.unk0[i].unk4 = 0xFFFC0000; + D_800E28D8.unk0[i].unk8 = func_80070830(phi_s1 & 0xFFFF) << 1; + phi_s1 += temp_v0; + } + + D_800E28D8.unk8 = load_texture(*D_800E291C); +} + + +void func_800ABC5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { + if ((arg5 > 0) && ((arg0 != D_80127BB8[5]) || (arg1 != D_80127BB8[8]) || (arg2 != D_80127BB8[11]) + || (arg3 != D_80127BB8[0]) || (arg4 != D_80127BB8[12]))) { + D_80127BB8[5] = arg0; + D_80127BB8[8] = arg1; + D_80127BB8[11] = arg2; + D_80127BB8[4] = (s32) ((s32) (arg0 - D_80127BB8[3]) / arg5); + D_80127BB8[7] = (s32) ((s32) (arg1 - D_80127BB8[6]) / arg5); + D_80127BB8[10] = (s32) ((s32) (arg2 - D_80127BB8[9]) / arg5); + if (D_800E2C5C == 0) { + D_80127BB8[1] = (s32) ((s32) (arg3 - D_80127BB8[0]) / arg5); + D_80127BB8[13] = (s32) ((s32) (arg4 - D_80127BB8[12]) / arg5); + D_80127BB8[2] = arg3; + D_80127BB8[14] = arg4; + D_80127BB8[15] = arg5; + return; + } + D_80127BB8[0] = arg3; + D_80127BB8[12] = arg4; + D_80127BB8[15] = 0; + func_800AD2C4(arg3 + 1, arg4 + 1, (f32) arg5 / 60.0f); + } +} + + +#ifdef NON_EQUIVALENT +void func_800AD4B8(s32 arg0); +void func_800ABE68(s32* arg0, s32* arg1, s32* arg2, s32* arg3, s32 arg4) { + D_80127C0C = *arg0; + D_80127C10 = *arg1; + D_80127C14 = *arg2; + D_80127C18 = *arg3; + D_80127C1C = func_80069D20(); + D_80127C20 = func_80069DBC(); + if (D_800E2C5C != 0) { + func_800AD4B8(arg4); + } else { + if (D_80127BB8[15] > 0) { + if (arg4 < D_80127BB8[15]) { + D_80127BB8[0] += D_80127BB8[1] * arg4; + D_80127BB8[3] += D_80127BB8[4] * arg4; + D_80127BB8[6] += D_80127BB8[7] * arg4; + D_80127BB8[9] += D_80127BB8[10] * arg4; + D_80127BB8[12] += D_80127BB8[13] * arg4; + D_80127BB8[15] -= arg4; + } else { + D_80127BB8[0] = (s32) D_80127BB8[2]; + D_80127BB8[3] = (s32) D_80127BB8[5]; + D_80127BB8[6] = (s32) D_80127BB8[8]; + D_80127BB8[9] = (s32) D_80127BB8[11]; + D_80127BB8[12] = (s32) D_80127BB8[14]; + D_80127BB8[15] = 0; + } + } + D_80127BB4 = (D_80127BB0 * D_80127BB8[0]) >> 16; + D_80127BF8.unk4 = (D_80127BF8.unk0 + ((D_80127BF8.unk2 - D_80127BF8.unk0) * D_80127BB8[12])) >> 16; + + func_800AC0C8(arg4, &D_80127BF8); + if ((D_80127BB4 > 0) && (D_80127BF8.unk4 < (s32) D_80127BF8.unk0)) { + D_800E2904 = D_800E2914[D_80127C08]; + func_800AC21C(); + func_800AC5A4(); + D_80127C08 = 1 - D_80127C08; + } + } + *arg0 = D_80127C0C; + *arg1 = D_80127C10; + *arg2 = D_80127C14;s + *arg3 = D_80127C18; +} +#else GLOBAL_ASM("asm/non_matchings/game_ui/func_800ABE68.s") +#endif + GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC0C8.s") GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC21C.s") GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC5A4.s") diff --git a/src/unknown_0ABDF0.h b/src/unknown_0ABDF0.h index 5f14ee6e..edf5fa82 100644 --- a/src/unknown_0ABDF0.h +++ b/src/unknown_0ABDF0.h @@ -5,11 +5,17 @@ #include "textures_sprites.h" #include "audio.h" -/* Size: 0x2C Bytes */ -typedef struct unk800E2850 { +typedef struct unk800E2850_unk0 { s32 unk0; s32 unk4; s32 unk8; +} unk800E2850_unk0; + +/* Size: 0x2C Bytes */ +typedef struct unk800E2850 { + unk800E2850_unk0 *unk0; + s32 unk4; + s32 *unk8; s32 unkC; s32 unk10; s32 unk14; @@ -66,6 +72,7 @@ typedef struct unk800E2C2C { typedef struct { s16 unk0; s16 unk2; + //s16 unk4; } unk80127BF8; extern u32 osTvType; @@ -83,6 +90,8 @@ void func_800ADCBC(unk800E2C2C*, s32); f32 func_800707C4(s16); f32 func_800707F8(s16); +s32 func_8007082C(s16); +s32 func_80070830(s16); void func_800AB35C(void); void func_800AB1F0(void); diff --git a/src/video.c b/src/video.c index 3a6a6fa6..b8f818fd 100644 --- a/src/video.c +++ b/src/video.c @@ -236,17 +236,17 @@ void init_framebuffer(s32 index) { gVideoFbWidths[index] = gVideoModeResolutions[gVideoModeIndex & 7].width; gVideoFbHeights[index] = gVideoModeResolutions[gVideoModeIndex & 7].height; if (gVideoModeIndex >= 2) { - gVideoFramebuffers[index] = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOR_TAG_WHITE); + gVideoFramebuffers[index] = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOUR_TAG_WHITE); gVideoFramebuffers[index] = (u16 *)(((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F); if (gVideoDepthBuffer == NULL) { - gVideoDepthBuffer = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOR_TAG_WHITE); + gVideoDepthBuffer = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOUR_TAG_WHITE); gVideoDepthBuffer = (u16 *)(((s32)gVideoDepthBuffer + 0x3F) & ~0x3F); } } else { - gVideoFramebuffers[index] = allocate_from_main_pool_safe((gVideoFbWidths[index] * gVideoFbHeights[index] * 2) + 0x30, COLOR_TAG_WHITE); + gVideoFramebuffers[index] = allocate_from_main_pool_safe((gVideoFbWidths[index] * gVideoFbHeights[index] * 2) + 0x30, COLOUR_TAG_WHITE); gVideoFramebuffers[index] = (u16 *)(((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F); if (gVideoDepthBuffer == NULL) { - gVideoDepthBuffer = allocate_from_main_pool_safe((gVideoFbWidths[index] * gVideoFbHeights[index] * 2) + 0x30, COLOR_TAG_WHITE); + gVideoDepthBuffer = allocate_from_main_pool_safe((gVideoFbWidths[index] * gVideoFbHeights[index] * 2) + 0x30, COLOUR_TAG_WHITE); gVideoDepthBuffer = (u16 *)(((s32)gVideoDepthBuffer + 0x3F) & ~0x3F); } } diff --git a/tools/python/generate_assets.py b/tools/python/generate_assets.py index 11034d26..33918e40 100644 --- a/tools/python/generate_assets.py +++ b/tools/python/generate_assets.py @@ -26,6 +26,8 @@ class GenerateAssets: self.generate_ucode_files() def generate_assets_file(self): + with open(self.ASSETS_DIR + "/" + self.VERSION + '/ignoreMe.txt', 'w') as a_file: + a_file.write("This file is automatically generated by generate_assets.py, and is used to check if the assets have been updated.") args = ["tools/dkr_assets_tool", "-i", self.VERSION, self.ASSETS_DIR, INCLUDE_DIRECTORY, self.BUILD_DIR, self.ASSETS_ASM_DIR] createAssets = subprocess.Popen(args, stdout=subprocess.PIPE) createAssets.wait() diff --git a/tools/python/generate_ld.py b/tools/python/generate_ld.py index af10e734..53538f8b 100644 --- a/tools/python/generate_ld.py +++ b/tools/python/generate_ld.py @@ -228,19 +228,9 @@ class GenerateLD: files.sort(key = lambda x: (x[2], x[3])) # Sort tuples by RAM address and prioritize src files first. return files -checksum_file = './assets/' + VERSION + '/md5.txt' -if not os.path.exists('./dkr.ld') and os.path.exists(checksum_file): - os.remove(checksum_file) - -if os.path.exists(checksum_file): - with open(checksum_file, "rt") as a_file: - with open('./assets/' + VERSION + '/assets.json',"rb") as f: - bytes = f.read() # read file as bytes - readable_hash = hashlib.md5(bytes).hexdigest(); - compare_hash = a_file.read().rstrip() - if compare_hash != readable_hash: - with open(LD_NAME, 'w') as ldFile: - GenerateLD(ldFile) -else: +# A nice side-effect of the ./assets// directory being "read-only" is that we can write a file to it, +# and then if it gets deleted we'll know if the assets have been updated. +if not os.path.exists('./dkr.ld') or not os.path.exists('./assets/' + VERSION + '/ignoreMe.txt'): with open(LD_NAME, 'w') as ldFile: GenerateLD(ldFile) +