From afb29a5a65410e43c168a5d309bd7e94ea9ab7ff Mon Sep 17 00:00:00 2001 From: MegaMech Date: Fri, 7 Apr 2023 22:13:28 -0600 Subject: [PATCH] Match memory.c, remove warnings, fix fake matches (#301) * Match memory, remove warnings, fix fake matches * label switch --- Makefile | 4 +- asm/bss_800029B0.s | 4 +- .../code_80005FD0/func_8000F2DC.s | 14 +- .../code_80057C60/func_8005D290.s | 74 +- .../code_8006E9C0/func_8006EEE8.s | 2 +- .../code_8006E9C0/func_8006F008.s | 18 +- .../code_80091750/func_80091B78.s | 18 +- .../code_80091750/func_80091FA4.s | 8 +- .../code_80091750/func_80093E60.s | 8 +- .../code_802AAA70/func_802AF314.s | 4 +- .../memory/display_list_unpack.s | 942 --------- asm/non_matchings/memory/func_802A86A8.s | 69 - asm/non_matchings/memory/func_802A884C.s | 62 - asm/non_matchings/memory/func_802A8940.s | 33 - asm/non_matchings/memory/func_802A89C0.s | 18 - asm/non_matchings/memory/func_802A8A04.s | 28 - asm/non_matchings/memory/func_802A8A70.s | 28 - asm/non_matchings/memory/func_802A8ADC.s | 28 - asm/non_matchings/memory/func_802A8B48.s | 28 - asm/non_matchings/memory/func_802A8BB4.s | 28 - asm/non_matchings/memory/func_802A8C20.s | 28 - asm/non_matchings/memory/func_802A8C8C.s | 28 - asm/non_matchings/memory/func_802A8CF8.s | 28 - asm/non_matchings/memory/func_802A8D64.s | 28 - asm/non_matchings/memory/func_802A8DD0.s | 28 - asm/non_matchings/memory/func_802A8E3C.s | 28 - asm/non_matchings/memory/func_802A8EA8.s | 28 - asm/non_matchings/memory/func_802A8F14.s | 28 - asm/non_matchings/memory/func_802A8F80.s | 174 -- asm/non_matchings/memory/func_802A91E4.s | 210 -- asm/non_matchings/memory/func_802A95B0.s | 50 - asm/non_matchings/memory/func_802A9674.s | 41 - asm/non_matchings/memory/func_802A9714.s | 65 - asm/non_matchings/memory/func_802A980C.s | 107 - asm/non_matchings/memory/func_802A99A4.s | 88 - asm/non_matchings/memory/func_802AA7C8.s | 54 - asm/non_matchings/memory/func_802AA88C.s | 36 - courses/courseTable.inc.c | 2 +- include/actor_types.h | 8 +- include/common_structs.h | 14 +- include/functions.h | 3 + include/segments.h | 1 + include/types.h | 30 +- src/actors.c | 296 +-- src/actors.h | 123 +- src/audio/external.h | 1 + src/camera.h | 2 + src/camera_junk.c | 1 + src/ceremony_and_credits.h | 2 + src/code_800029B0.c | 74 +- src/code_80004740.c | 2 +- src/code_80005FD0.c | 14 +- src/code_80005FD0.h | 5 +- src/code_800431B0.c | 2 +- src/code_800431B0.h | 2 +- src/code_80057C60.c | 78 +- src/code_80057C60.h | 3 +- src/code_8006E9C0.c | 20 +- src/code_80091750.c | 34 +- src/code_80091750.h | 4 + src/code_800AF9B0.c | 4 +- src/code_80280000.c | 31 +- src/code_80280000.h | 2 +- src/code_80280650.c | 4 +- src/code_80280650.h | 3 +- src/code_80281780.c | 14 +- src/code_80281780.h | 5 +- src/code_80281C40.c | 18 +- src/code_802AAA70.c | 4 +- src/code_802AAA70.h | 2 +- src/crash_screen.c | 6 +- src/kart_dma.c | 26 +- src/main.c | 97 +- src/main.h | 11 +- src/math_util.c | 4 +- src/math_util.h | 2 +- src/math_util_2.c | 15 +- src/math_util_2.h | 4 +- src/memory.c | 1856 ++++++++--------- src/memory.h | 62 +- src/profiler.c | 8 +- src/profiler.h | 1 + src/race_logic.c | 3 + src/race_logic.h | 1 + src/render_courses.c | 150 +- src/render_courses.h | 6 +- src/skybox_and_splitscreen.c | 305 +-- src/skybox_and_splitscreen.h | 5 +- src/spawn_players.c | 13 +- src/staff_ghosts.c | 38 +- src/staff_ghosts.h | 1 + 91 files changed, 1818 insertions(+), 4071 deletions(-) delete mode 100644 asm/non_matchings/memory/display_list_unpack.s delete mode 100644 asm/non_matchings/memory/func_802A86A8.s delete mode 100644 asm/non_matchings/memory/func_802A884C.s delete mode 100644 asm/non_matchings/memory/func_802A8940.s delete mode 100644 asm/non_matchings/memory/func_802A89C0.s delete mode 100644 asm/non_matchings/memory/func_802A8A04.s delete mode 100644 asm/non_matchings/memory/func_802A8A70.s delete mode 100644 asm/non_matchings/memory/func_802A8ADC.s delete mode 100644 asm/non_matchings/memory/func_802A8B48.s delete mode 100644 asm/non_matchings/memory/func_802A8BB4.s delete mode 100644 asm/non_matchings/memory/func_802A8C20.s delete mode 100644 asm/non_matchings/memory/func_802A8C8C.s delete mode 100644 asm/non_matchings/memory/func_802A8CF8.s delete mode 100644 asm/non_matchings/memory/func_802A8D64.s delete mode 100644 asm/non_matchings/memory/func_802A8DD0.s delete mode 100644 asm/non_matchings/memory/func_802A8E3C.s delete mode 100644 asm/non_matchings/memory/func_802A8EA8.s delete mode 100644 asm/non_matchings/memory/func_802A8F14.s delete mode 100644 asm/non_matchings/memory/func_802A8F80.s delete mode 100644 asm/non_matchings/memory/func_802A91E4.s delete mode 100644 asm/non_matchings/memory/func_802A95B0.s delete mode 100644 asm/non_matchings/memory/func_802A9674.s delete mode 100644 asm/non_matchings/memory/func_802A9714.s delete mode 100644 asm/non_matchings/memory/func_802A980C.s delete mode 100644 asm/non_matchings/memory/func_802A99A4.s delete mode 100644 asm/non_matchings/memory/func_802AA7C8.s delete mode 100644 asm/non_matchings/memory/func_802AA88C.s diff --git a/Makefile b/Makefile index 360a7f52f..6e17ae9a0 100644 --- a/Makefile +++ b/Makefile @@ -163,10 +163,10 @@ INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I $(BUILD_DIR)/include -I src -I . GRUCODE_CFLAGS = -DF3DEX_GBI -D_LANGUAGE_C # Check code syntax with host compiler -CC_CHECK := gcc -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) +CC_CHECK := gcc -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) -std=gnu90 -Wall -Wempty-body -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) ASFLAGS = -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) --defsym F3DEX_GBI=1 -CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(OPT_FLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS) +CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -woff 838 -signed $(OPT_FLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS) OBJCOPYFLAGS = --pad-to=0xC00000 --gap-fill=0xFF LDFLAGS = -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/$(TARGET).map --no-check-sections diff --git a/asm/bss_800029B0.s b/asm/bss_800029B0.s index 7aaf12974..997a9ccd3 100644 --- a/asm/bss_800029B0.s +++ b/asm/bss_800029B0.s @@ -142,10 +142,10 @@ glabel D_8015F708 glabel D_8015F718 .skip 12 -glabel D_8015F724 +glabel gFreeMemorySize .skip 4 -glabel gPrevLoadedAddress # 0x8015F728 +glabel gNextFreeMemoryAddress # 0x8015F728 ptr .skip 4 glabel gHeapEndPtr # 0x8015F72C diff --git a/asm/non_matchings/code_80005FD0/func_8000F2DC.s b/asm/non_matchings/code_80005FD0/func_8000F2DC.s index 7e105648f..5af41f522 100644 --- a/asm/non_matchings/code_80005FD0/func_8000F2DC.s +++ b/asm/non_matchings/code_80005FD0/func_8000F2DC.s @@ -26,7 +26,7 @@ glabel func_8000F2DC /* 00FF3C 8000F33C 944A0006 */ lhu $t2, 6($v0) /* 00FF40 8000F340 AC6A000C */ sw $t2, 0xc($v1) /* 00FF44 8000F344 94450008 */ lhu $a1, 8($v0) -/* 00FF48 8000F348 0C0A9EDC */ jal func_802A7B70 +/* 00FF48 8000F348 0C0A9EDC */ jal get_next_available_memory_addr /* 00FF4C 8000F34C 00052080 */ sll $a0, $a1, 2 /* 00FF50 8000F350 3C018016 */ lui $at, %hi(D_80163598) # $at, 0x8016 /* 00FF54 8000F354 3C118016 */ lui $s1, %hi(D_80163368) # $s1, 0x8016 @@ -49,32 +49,32 @@ glabel func_8000F2DC .L8000F398: /* 00FF98 8000F398 8E240000 */ lw $a0, ($s1) /* 00FF9C 8000F39C 000458C0 */ sll $t3, $a0, 3 -/* 00FFA0 8000F3A0 0C0A9EDC */ jal func_802A7B70 +/* 00FFA0 8000F3A0 0C0A9EDC */ jal get_next_available_memory_addr /* 00FFA4 8000F3A4 01602025 */ move $a0, $t3 /* 00FFA8 8000F3A8 8E240000 */ lw $a0, ($s1) /* 00FFAC 8000F3AC AE620000 */ sw $v0, ($s3) /* 00FFB0 8000F3B0 000460C0 */ sll $t4, $a0, 3 -/* 00FFB4 8000F3B4 0C0A9EDC */ jal func_802A7B70 +/* 00FFB4 8000F3B4 0C0A9EDC */ jal get_next_available_memory_addr /* 00FFB8 8000F3B8 01802025 */ move $a0, $t4 /* 00FFBC 8000F3BC 8E240000 */ lw $a0, ($s1) /* 00FFC0 8000F3C0 AE820000 */ sw $v0, ($s4) /* 00FFC4 8000F3C4 000468C0 */ sll $t5, $a0, 3 -/* 00FFC8 8000F3C8 0C0A9EDC */ jal func_802A7B70 +/* 00FFC8 8000F3C8 0C0A9EDC */ jal get_next_available_memory_addr /* 00FFCC 8000F3CC 01A02025 */ move $a0, $t5 /* 00FFD0 8000F3D0 8E240000 */ lw $a0, ($s1) /* 00FFD4 8000F3D4 AE420000 */ sw $v0, ($s2) /* 00FFD8 8000F3D8 00047040 */ sll $t6, $a0, 1 -/* 00FFDC 8000F3DC 0C0A9EDC */ jal func_802A7B70 +/* 00FFDC 8000F3DC 0C0A9EDC */ jal get_next_available_memory_addr /* 00FFE0 8000F3E0 01C02025 */ move $a0, $t6 /* 00FFE4 8000F3E4 8E240000 */ lw $a0, ($s1) /* 00FFE8 8000F3E8 AEC20000 */ sw $v0, ($s6) /* 00FFEC 8000F3EC 00047840 */ sll $t7, $a0, 1 -/* 00FFF0 8000F3F0 0C0A9EDC */ jal func_802A7B70 +/* 00FFF0 8000F3F0 0C0A9EDC */ jal get_next_available_memory_addr /* 00FFF4 8000F3F4 01E02025 */ move $a0, $t7 /* 00FFF8 8000F3F8 8E240000 */ lw $a0, ($s1) /* 00FFFC 8000F3FC AEE20000 */ sw $v0, ($s7) /* 010000 8000F400 0004C040 */ sll $t8, $a0, 1 -/* 010004 8000F404 0C0A9EDC */ jal func_802A7B70 +/* 010004 8000F404 0C0A9EDC */ jal get_next_available_memory_addr /* 010008 8000F408 03002025 */ move $a0, $t8 /* 01000C 8000F40C 26B50004 */ addiu $s5, $s5, 4 /* 010010 8000F410 02B0082B */ sltu $at, $s5, $s0 diff --git a/asm/non_matchings/code_80057C60/func_8005D290.s b/asm/non_matchings/code_80057C60/func_8005D290.s index 01fe6c95b..d62065ba9 100644 --- a/asm/non_matchings/code_80057C60/func_8005D290.s +++ b/asm/non_matchings/code_80057C60/func_8005D290.s @@ -4,63 +4,63 @@ glabel func_8005D290 /* 05DE98 8005D298 3C040F06 */ lui $a0, %hi(gTexture69C80C) # $a0, 0xf06 /* 05DE9C 8005D29C 2484A89C */ addiu $a0, %lo(gTexture69C80C) # addiu $a0, $a0, -0x5764 /* 05DEA0 8005D2A0 24050400 */ li $a1, 1024 -/* 05DEA4 8005D2A4 0C0AA13D */ jal func_802A84F4 +/* 05DEA4 8005D2A4 0C0AA13D */ jal dma_textures /* 05DEA8 8005D2A8 24060400 */ li $a2, 1024 /* 05DEAC 8005D2AC 3C018019 */ lui $at, %hi(D_8018D488) # $at, 0x8019 /* 05DEB0 8005D2B0 3C040F06 */ lui $a0, %hi(gTextureKartShadow) # $a0, 0xf06 /* 05DEB4 8005D2B4 AC22D488 */ sw $v0, %lo(D_8018D488)($at) /* 05DEB8 8005D2B8 248488C0 */ addiu $a0, %lo(gTextureKartShadow) # addiu $a0, $a0, -0x7740 /* 05DEBC 8005D2BC 24051000 */ li $a1, 4096 -/* 05DEC0 8005D2C0 0C0AA13D */ jal func_802A84F4 +/* 05DEC0 8005D2C0 0C0AA13D */ jal dma_textures /* 05DEC4 8005D2C4 24061000 */ li $a2, 4096 /* 05DEC8 8005D2C8 3C018019 */ lui $at, %hi(D_8018D474) # $at, 0x8019 /* 05DECC 8005D2CC 3C040F06 */ lui $a0, %hi(gTexture69B03C) # $a0, 0xf06 /* 05DED0 8005D2D0 AC22D474 */ sw $v0, %lo(D_8018D474)($at) /* 05DED4 8005D2D4 248490CC */ addiu $a0, %lo(gTexture69B03C) # addiu $a0, $a0, -0x6f34 /* 05DED8 8005D2D8 24050100 */ li $a1, 256 -/* 05DEDC 8005D2DC 0C0AA13D */ jal func_802A84F4 +/* 05DEDC 8005D2DC 0C0AA13D */ jal dma_textures /* 05DEE0 8005D2E0 24060100 */ li $a2, 256 /* 05DEE4 8005D2E4 3C018019 */ lui $at, %hi(D_8018D420) # $at, 0x8019 /* 05DEE8 8005D2E8 3C040F06 */ lui $a0, %hi(gTexture69B140) # $a0, 0xf06 /* 05DEEC 8005D2EC AC22D420 */ sw $v0, %lo(D_8018D420)($at) /* 05DEF0 8005D2F0 248491D0 */ addiu $a0, %lo(gTexture69B140) # addiu $a0, $a0, -0x6e30 /* 05DEF4 8005D2F4 24050400 */ li $a1, 1024 -/* 05DEF8 8005D2F8 0C0AA13D */ jal func_802A84F4 +/* 05DEF8 8005D2F8 0C0AA13D */ jal dma_textures /* 05DEFC 8005D2FC 24060400 */ li $a2, 1024 /* 05DF00 8005D300 3C018019 */ lui $at, %hi(D_8018D424) # $at, 0x8019 /* 05DF04 8005D304 3C040F06 */ lui $a0, %hi(gTexture69C1E8) # $a0, 0xf06 /* 05DF08 8005D308 AC22D424 */ sw $v0, %lo(D_8018D424)($at) /* 05DF0C 8005D30C 2484A278 */ addiu $a0, %lo(gTexture69C1E8) # addiu $a0, $a0, -0x5d88 /* 05DF10 8005D310 24050200 */ li $a1, 512 -/* 05DF14 8005D314 0C0AA13D */ jal func_802A84F4 +/* 05DF14 8005D314 0C0AA13D */ jal dma_textures /* 05DF18 8005D318 24060200 */ li $a2, 512 /* 05DF1C 8005D31C 3C018019 */ lui $at, %hi(D_8018D478) # $at, 0x8019 /* 05DF20 8005D320 3C040F06 */ lui $a0, %hi(gTexture69BA28) # $a0, 0xf06 /* 05DF24 8005D324 AC22D478 */ sw $v0, %lo(D_8018D478)($at) /* 05DF28 8005D328 24849AB8 */ addiu $a0, %lo(gTexture69BA28) # addiu $a0, $a0, -0x6548 /* 05DF2C 8005D32C 24050400 */ li $a1, 1024 -/* 05DF30 8005D330 0C0AA13D */ jal func_802A84F4 +/* 05DF30 8005D330 0C0AA13D */ jal dma_textures /* 05DF34 8005D334 24060400 */ li $a2, 1024 /* 05DF38 8005D338 3C018019 */ lui $at, %hi(D_8018D480) # $at, 0x8019 /* 05DF3C 8005D33C 3C040F06 */ lui $a0, %hi(gTexture69B960) # $a0, 0xf06 /* 05DF40 8005D340 AC22D480 */ sw $v0, %lo(D_8018D480)($at) /* 05DF44 8005D344 248499F0 */ addiu $a0, %lo(gTexture69B960) # addiu $a0, $a0, -0x6610 /* 05DF48 8005D348 24050400 */ li $a1, 1024 -/* 05DF4C 8005D34C 0C0AA13D */ jal func_802A84F4 +/* 05DF4C 8005D34C 0C0AA13D */ jal dma_textures /* 05DF50 8005D350 24060400 */ li $a2, 1024 /* 05DF54 8005D354 3C018019 */ lui $at, %hi(D_8018D484) # $at, 0x8019 /* 05DF58 8005D358 3C040F06 */ lui $a0, %hi(gTexture69C354) # $a0, 0xf06 /* 05DF5C 8005D35C AC22D484 */ sw $v0, %lo(D_8018D484)($at) /* 05DF60 8005D360 2484A3E4 */ addiu $a0, %lo(gTexture69C354) # addiu $a0, $a0, -0x5c1c /* 05DF64 8005D364 24050400 */ li $a1, 1024 -/* 05DF68 8005D368 0C0AA13D */ jal func_802A84F4 +/* 05DF68 8005D368 0C0AA13D */ jal dma_textures /* 05DF6C 8005D36C 24060400 */ li $a2, 1024 /* 05DF70 8005D370 3C018019 */ lui $at, %hi(D_8018D48C) # $at, 0x8019 /* 05DF74 8005D374 3C040F06 */ lui $a0, %hi(gTexture69C4E4) # $a0, 0xf06 /* 05DF78 8005D378 AC22D48C */ sw $v0, %lo(D_8018D48C)($at) /* 05DF7C 8005D37C 2484A574 */ addiu $a0, %lo(gTexture69C4E4) # addiu $a0, $a0, -0x5a8c /* 05DF80 8005D380 24050400 */ li $a1, 1024 -/* 05DF84 8005D384 0C0AA13D */ jal func_802A84F4 +/* 05DF84 8005D384 0C0AA13D */ jal dma_textures /* 05DF88 8005D388 24060400 */ li $a2, 1024 /* 05DF8C 8005D38C 3C018019 */ lui $at, %hi(D_8018D494) # $at, 0x8019 /* 05DF90 8005D390 3C0E8019 */ lui $t6, %hi(D_8018D48C) # $t6, 0x8019 @@ -71,196 +71,196 @@ glabel func_8005D290 /* 05DFA4 8005D3A4 24849408 */ addiu $a0, %lo(gTexture69B378) # addiu $a0, $a0, -0x6bf8 /* 05DFA8 8005D3A8 24051000 */ li $a1, 4096 /* 05DFAC 8005D3AC 24061000 */ li $a2, 4096 -/* 05DFB0 8005D3B0 0C0AA13D */ jal func_802A84F4 +/* 05DFB0 8005D3B0 0C0AA13D */ jal dma_textures /* 05DFB4 8005D3B4 AC2ED490 */ sw $t6, %lo(D_8018D490)($at) /* 05DFB8 8005D3B8 3C018019 */ lui $at, %hi(D_8018D498) # $at, 0x8019 /* 05DFBC 8005D3BC 3C040F06 */ lui $a0, %hi(D_0F05E19C) # $a0, 0xf06 /* 05DFC0 8005D3C0 AC22D498 */ sw $v0, %lo(D_8018D498)($at) /* 05DFC4 8005D3C4 2484E19C */ addiu $a0, %lo(D_0F05E19C) # addiu $a0, $a0, -0x1e64 /* 05DFC8 8005D3C8 24050800 */ li $a1, 2048 -/* 05DFCC 8005D3CC 0C0AA13D */ jal func_802A84F4 +/* 05DFCC 8005D3CC 0C0AA13D */ jal dma_textures /* 05DFD0 8005D3D0 24060800 */ li $a2, 2048 /* 05DFD4 8005D3D4 3C018019 */ lui $at, %hi(D_8018D4BC) # $at, 0x8019 /* 05DFD8 8005D3D8 3C040F06 */ lui $a0, %hi(D_0F05E3E0) # $a0, 0xf06 /* 05DFDC 8005D3DC AC22D4BC */ sw $v0, %lo(D_8018D4BC)($at) /* 05DFE0 8005D3E0 2484E3E0 */ addiu $a0, %lo(D_0F05E3E0) # addiu $a0, $a0, -0x1c20 /* 05DFE4 8005D3E4 24050800 */ li $a1, 2048 -/* 05DFE8 8005D3E8 0C0AA13D */ jal func_802A84F4 +/* 05DFE8 8005D3E8 0C0AA13D */ jal dma_textures /* 05DFEC 8005D3EC 24060800 */ li $a2, 2048 /* 05DFF0 8005D3F0 3C018019 */ lui $at, %hi(D_8018D4C0) # $at, 0x8019 /* 05DFF4 8005D3F4 3C040F06 */ lui $a0, %hi(gTexture69C9C4) # $a0, 0xf06 /* 05DFF8 8005D3F8 AC22D4C0 */ sw $v0, %lo(D_8018D4C0)($at) /* 05DFFC 8005D3FC 2484AA54 */ addiu $a0, %lo(gTexture69C9C4) # addiu $a0, $a0, -0x55ac /* 05E000 8005D400 24050200 */ li $a1, 512 -/* 05E004 8005D404 0C0AA13D */ jal func_802A84F4 +/* 05E004 8005D404 0C0AA13D */ jal dma_textures /* 05E008 8005D408 24060200 */ li $a2, 512 /* 05E00C 8005D40C 3C018019 */ lui $at, %hi(D_8018D49C) # $at, 0x8019 /* 05E010 8005D410 3C040F06 */ lui $a0, %hi(gTextureBoingExclamation) # $a0, 0xf06 /* 05E014 8005D414 AC22D49C */ sw $v0, %lo(D_8018D49C)($at) /* 05E018 8005D418 24849BA8 */ addiu $a0, %lo(gTextureBoingExclamation) # addiu $a0, $a0, -0x6458 /* 05E01C 8005D41C 24050800 */ li $a1, 2048 -/* 05E020 8005D420 0C0AA13D */ jal func_802A84F4 +/* 05E020 8005D420 0C0AA13D */ jal dma_textures /* 05E024 8005D424 24060800 */ li $a2, 2048 /* 05E028 8005D428 3C018019 */ lui $at, %hi(D_8018D4A0) # $at, 0x8019 /* 05E02C 8005D42C 3C040F06 */ lui $a0, %hi(D_0F05DDFC) # $a0, 0xf06 /* 05E030 8005D430 AC22D4A0 */ sw $v0, %lo(D_8018D4A0)($at) /* 05E034 8005D434 2484DDFC */ addiu $a0, %lo(D_0F05DDFC) # addiu $a0, $a0, -0x2204 /* 05E038 8005D438 24050800 */ li $a1, 2048 -/* 05E03C 8005D43C 0C0AA13D */ jal func_802A84F4 +/* 05E03C 8005D43C 0C0AA13D */ jal dma_textures /* 05E040 8005D440 24060800 */ li $a2, 2048 /* 05E044 8005D444 3C018019 */ lui $at, %hi(D_8018D4A4) # $at, 0x8019 /* 05E048 8005D448 3C040F06 */ lui $a0, %hi(D_0F05DFC0) # $a0, 0xf06 /* 05E04C 8005D44C AC22D4A4 */ sw $v0, %lo(D_8018D4A4)($at) /* 05E050 8005D450 2484DFC0 */ addiu $a0, %lo(D_0F05DFC0) # addiu $a0, $a0, -0x2040 /* 05E054 8005D454 24050800 */ li $a1, 2048 -/* 05E058 8005D458 0C0AA13D */ jal func_802A84F4 +/* 05E058 8005D458 0C0AA13D */ jal dma_textures /* 05E05C 8005D45C 24060800 */ li $a2, 2048 /* 05E060 8005D460 3C018019 */ lui $at, %hi(D_8018D4A8) # $at, 0x8019 /* 05E064 8005D464 3C040F06 */ lui $a0, %hi(D_0F05D674) # $a0, 0xf06 /* 05E068 8005D468 AC22D4A8 */ sw $v0, %lo(D_8018D4A8)($at) /* 05E06C 8005D46C 2484D674 */ addiu $a0, %lo(D_0F05D674) # addiu $a0, $a0, -0x298c /* 05E070 8005D470 24050800 */ li $a1, 2048 -/* 05E074 8005D474 0C0AA13D */ jal func_802A84F4 +/* 05E074 8005D474 0C0AA13D */ jal dma_textures /* 05E078 8005D478 24060800 */ li $a2, 2048 /* 05E07C 8005D47C 3C018019 */ lui $at, %hi(D_8018D4AC) # $at, 0x8019 /* 05E080 8005D480 3C040F06 */ lui $a0, %hi(D_0F05DA50) # $a0, 0xf06 /* 05E084 8005D484 AC22D4AC */ sw $v0, %lo(D_8018D4AC)($at) /* 05E088 8005D488 2484DA50 */ addiu $a0, %lo(D_0F05DA50) # addiu $a0, $a0, -0x25b0 /* 05E08C 8005D48C 24050800 */ li $a1, 2048 -/* 05E090 8005D490 0C0AA13D */ jal func_802A84F4 +/* 05E090 8005D490 0C0AA13D */ jal dma_textures /* 05E094 8005D494 24060800 */ li $a2, 2048 /* 05E098 8005D498 3C018019 */ lui $at, %hi(D_8018D4B0) # $at, 0x8019 /* 05E09C 8005D49C 3C040F06 */ lui $a0, %hi(D_0F05D1E8) # $a0, 0xf06 /* 05E0A0 8005D4A0 AC22D4B0 */ sw $v0, %lo(D_8018D4B0)($at) /* 05E0A4 8005D4A4 2484D1E8 */ addiu $a0, %lo(D_0F05D1E8) # addiu $a0, $a0, -0x2e18 /* 05E0A8 8005D4A8 24050800 */ li $a1, 2048 -/* 05E0AC 8005D4AC 0C0AA13D */ jal func_802A84F4 +/* 05E0AC 8005D4AC 0C0AA13D */ jal dma_textures /* 05E0B0 8005D4B0 24060800 */ li $a2, 2048 /* 05E0B4 8005D4B4 3C018019 */ lui $at, %hi(D_8018D4B4) # $at, 0x8019 /* 05E0B8 8005D4B8 3C040F06 */ lui $a0, %hi(D_0F05D420) # $a0, 0xf06 /* 05E0BC 8005D4BC AC22D4B4 */ sw $v0, %lo(D_8018D4B4)($at) /* 05E0C0 8005D4C0 2484D420 */ addiu $a0, %lo(D_0F05D420) # addiu $a0, $a0, -0x2be0 /* 05E0C4 8005D4C4 24050800 */ li $a1, 2048 -/* 05E0C8 8005D4C8 0C0AA13D */ jal func_802A84F4 +/* 05E0C8 8005D4C8 0C0AA13D */ jal dma_textures /* 05E0CC 8005D4CC 24060800 */ li $a2, 2048 /* 05E0D0 8005D4D0 3C018019 */ lui $at, %hi(D_8018D4B8) # $at, 0x8019 /* 05E0D4 8005D4D4 3C040F06 */ lui $a0, %hi(gTexture69CB84) # $a0, 0xf06 /* 05E0D8 8005D4D8 AC22D4B8 */ sw $v0, %lo(D_8018D4B8)($at) /* 05E0DC 8005D4DC 2484AC14 */ addiu $a0, %lo(gTexture69CB84) # addiu $a0, $a0, -0x53ec /* 05E0E0 8005D4E0 24050800 */ li $a1, 2048 -/* 05E0E4 8005D4E4 0C0AA13D */ jal func_802A84F4 +/* 05E0E4 8005D4E4 0C0AA13D */ jal dma_textures /* 05E0E8 8005D4E8 24060800 */ li $a2, 2048 /* 05E0EC 8005D4EC 3C018019 */ lui $at, %hi(D_8018D438) # $at, 0x8019 /* 05E0F0 8005D4F0 3C040F06 */ lui $a0, %hi(gTexture69CCEC) # $a0, 0xf06 /* 05E0F4 8005D4F4 AC22D438 */ sw $v0, %lo(D_8018D438)($at) /* 05E0F8 8005D4F8 2484AD7C */ addiu $a0, %lo(gTexture69CCEC) # addiu $a0, $a0, -0x5284 /* 05E0FC 8005D4FC 24050800 */ li $a1, 2048 -/* 05E100 8005D500 0C0AA13D */ jal func_802A84F4 +/* 05E100 8005D500 0C0AA13D */ jal dma_textures /* 05E104 8005D504 24060800 */ li $a2, 2048 /* 05E108 8005D508 3C018019 */ lui $at, %hi(D_8018D43C) # $at, 0x8019 /* 05E10C 8005D50C 3C040F06 */ lui $a0, %hi(gTexture69CEB8) # $a0, 0xf06 /* 05E110 8005D510 AC22D43C */ sw $v0, %lo(D_8018D43C)($at) /* 05E114 8005D514 2484AF48 */ addiu $a0, %lo(gTexture69CEB8) # addiu $a0, $a0, -0x50b8 /* 05E118 8005D518 24050800 */ li $a1, 2048 -/* 05E11C 8005D51C 0C0AA13D */ jal func_802A84F4 +/* 05E11C 8005D51C 0C0AA13D */ jal dma_textures /* 05E120 8005D520 24060800 */ li $a2, 2048 /* 05E124 8005D524 3C018019 */ lui $at, %hi(D_8018D440) # $at, 0x8019 /* 05E128 8005D528 3C040F06 */ lui $a0, %hi(gTexture69D148) # $a0, 0xf06 /* 05E12C 8005D52C AC22D440 */ sw $v0, %lo(D_8018D440)($at) /* 05E130 8005D530 2484B1D8 */ addiu $a0, %lo(gTexture69D148) # addiu $a0, $a0, -0x4e28 /* 05E134 8005D534 24050800 */ li $a1, 2048 -/* 05E138 8005D538 0C0AA13D */ jal func_802A84F4 +/* 05E138 8005D538 0C0AA13D */ jal dma_textures /* 05E13C 8005D53C 24060800 */ li $a2, 2048 /* 05E140 8005D540 3C018019 */ lui $at, %hi(D_8018D444) # $at, 0x8019 /* 05E144 8005D544 3C040F06 */ lui $a0, %hi(gTexture69D4E0) # $a0, 0xf06 /* 05E148 8005D548 AC22D444 */ sw $v0, %lo(D_8018D444)($at) /* 05E14C 8005D54C 2484B570 */ addiu $a0, %lo(gTexture69D4E0) # addiu $a0, $a0, -0x4a90 /* 05E150 8005D550 24050800 */ li $a1, 2048 -/* 05E154 8005D554 0C0AA13D */ jal func_802A84F4 +/* 05E154 8005D554 0C0AA13D */ jal dma_textures /* 05E158 8005D558 24060800 */ li $a2, 2048 /* 05E15C 8005D55C 3C018019 */ lui $at, %hi(D_8018D448) # $at, 0x8019 /* 05E160 8005D560 3C040F06 */ lui $a0, %hi(gTexture69D8FC) # $a0, 0xf06 /* 05E164 8005D564 AC22D448 */ sw $v0, %lo(D_8018D448)($at) /* 05E168 8005D568 2484B98C */ addiu $a0, %lo(gTexture69D8FC) # addiu $a0, $a0, -0x4674 /* 05E16C 8005D56C 24050800 */ li $a1, 2048 -/* 05E170 8005D570 0C0AA13D */ jal func_802A84F4 +/* 05E170 8005D570 0C0AA13D */ jal dma_textures /* 05E174 8005D574 24060800 */ li $a2, 2048 /* 05E178 8005D578 3C018019 */ lui $at, %hi(D_8018D44C) # $at, 0x8019 /* 05E17C 8005D57C 3C040F06 */ lui $a0, %hi(gTexture69DCB4) # $a0, 0xf06 /* 05E180 8005D580 AC22D44C */ sw $v0, %lo(D_8018D44C)($at) /* 05E184 8005D584 2484BD44 */ addiu $a0, %lo(gTexture69DCB4) # addiu $a0, $a0, -0x42bc /* 05E188 8005D588 24050800 */ li $a1, 2048 -/* 05E18C 8005D58C 0C0AA13D */ jal func_802A84F4 +/* 05E18C 8005D58C 0C0AA13D */ jal dma_textures /* 05E190 8005D590 24060800 */ li $a2, 2048 /* 05E194 8005D594 3C018019 */ lui $at, %hi(D_8018D450) # $at, 0x8019 /* 05E198 8005D598 3C040F06 */ lui $a0, %hi(gTexture69DFA0) # $a0, 0xf06 /* 05E19C 8005D59C AC22D450 */ sw $v0, %lo(D_8018D450)($at) /* 05E1A0 8005D5A0 2484C030 */ addiu $a0, %lo(gTexture69DFA0) # addiu $a0, $a0, -0x3fd0 /* 05E1A4 8005D5A4 24050800 */ li $a1, 2048 -/* 05E1A8 8005D5A8 0C0AA13D */ jal func_802A84F4 +/* 05E1A8 8005D5A8 0C0AA13D */ jal dma_textures /* 05E1AC 8005D5AC 24060800 */ li $a2, 2048 /* 05E1B0 8005D5B0 3C018019 */ lui $at, %hi(D_8018D454) # $at, 0x8019 /* 05E1B4 8005D5B4 3C040F06 */ lui $a0, %hi(gTexture69E25C) # $a0, 0xf06 /* 05E1B8 8005D5B8 AC22D454 */ sw $v0, %lo(D_8018D454)($at) /* 05E1BC 8005D5BC 2484C2EC */ addiu $a0, %lo(gTexture69E25C) # addiu $a0, $a0, -0x3d14 /* 05E1C0 8005D5C0 24050800 */ li $a1, 2048 -/* 05E1C4 8005D5C4 0C0AA13D */ jal func_802A84F4 +/* 05E1C4 8005D5C4 0C0AA13D */ jal dma_textures /* 05E1C8 8005D5C8 24060800 */ li $a2, 2048 /* 05E1CC 8005D5CC 3C018019 */ lui $at, %hi(D_8018D458) # $at, 0x8019 /* 05E1D0 8005D5D0 3C040F06 */ lui $a0, %hi(gTexture69E518) # $a0, 0xf06 /* 05E1D4 8005D5D4 AC22D458 */ sw $v0, %lo(D_8018D458)($at) /* 05E1D8 8005D5D8 2484C5A8 */ addiu $a0, %lo(gTexture69E518) # addiu $a0, $a0, -0x3a58 /* 05E1DC 8005D5DC 24050800 */ li $a1, 2048 -/* 05E1E0 8005D5E0 0C0AA13D */ jal func_802A84F4 +/* 05E1E0 8005D5E0 0C0AA13D */ jal dma_textures /* 05E1E4 8005D5E4 24060800 */ li $a2, 2048 /* 05E1E8 8005D5E8 3C018019 */ lui $at, %hi(D_8018D45C) # $at, 0x8019 /* 05E1EC 8005D5EC 3C040F06 */ lui $a0, %hi(gTexture69E7A8) # $a0, 0xf06 /* 05E1F0 8005D5F0 AC22D45C */ sw $v0, %lo(D_8018D45C)($at) /* 05E1F4 8005D5F4 2484C838 */ addiu $a0, %lo(gTexture69E7A8) # addiu $a0, $a0, -0x37c8 /* 05E1F8 8005D5F8 24050800 */ li $a1, 2048 -/* 05E1FC 8005D5FC 0C0AA13D */ jal func_802A84F4 +/* 05E1FC 8005D5FC 0C0AA13D */ jal dma_textures /* 05E200 8005D600 24060800 */ li $a2, 2048 /* 05E204 8005D604 3C018019 */ lui $at, %hi(D_8018D460) # $at, 0x8019 /* 05E208 8005D608 3C040F06 */ lui $a0, %hi(gTexture69EA18) # $a0, 0xf06 /* 05E20C 8005D60C AC22D460 */ sw $v0, %lo(D_8018D460)($at) /* 05E210 8005D610 2484CAA8 */ addiu $a0, %lo(gTexture69EA18) # addiu $a0, $a0, -0x3558 /* 05E214 8005D614 24050800 */ li $a1, 2048 -/* 05E218 8005D618 0C0AA13D */ jal func_802A84F4 +/* 05E218 8005D618 0C0AA13D */ jal dma_textures /* 05E21C 8005D61C 24060800 */ li $a2, 2048 /* 05E220 8005D620 3C018019 */ lui $at, %hi(D_8018D464) # $at, 0x8019 /* 05E224 8005D624 3C040F06 */ lui $a0, %hi(gTexture69EC54) # $a0, 0xf06 /* 05E228 8005D628 AC22D464 */ sw $v0, %lo(D_8018D464)($at) /* 05E22C 8005D62C 2484CCE4 */ addiu $a0, %lo(gTexture69EC54) # addiu $a0, $a0, -0x331c /* 05E230 8005D630 24050800 */ li $a1, 2048 -/* 05E234 8005D634 0C0AA13D */ jal func_802A84F4 +/* 05E234 8005D634 0C0AA13D */ jal dma_textures /* 05E238 8005D638 24060800 */ li $a2, 2048 /* 05E23C 8005D63C 3C018019 */ lui $at, %hi(D_8018D468) # $at, 0x8019 /* 05E240 8005D640 3C040F06 */ lui $a0, %hi(gTexture69EE38) # $a0, 0xf06 /* 05E244 8005D644 AC22D468 */ sw $v0, %lo(D_8018D468)($at) /* 05E248 8005D648 2484CEC8 */ addiu $a0, %lo(gTexture69EE38) # addiu $a0, $a0, -0x3138 /* 05E24C 8005D64C 24050800 */ li $a1, 2048 -/* 05E250 8005D650 0C0AA13D */ jal func_802A84F4 +/* 05E250 8005D650 0C0AA13D */ jal dma_textures /* 05E254 8005D654 24060800 */ li $a2, 2048 /* 05E258 8005D658 3C018019 */ lui $at, %hi(D_8018D46C) # $at, 0x8019 /* 05E25C 8005D65C 3C040F06 */ lui $a0, %hi(gTexture69EFE0) # $a0, 0xf06 /* 05E260 8005D660 AC22D46C */ sw $v0, %lo(D_8018D46C)($at) /* 05E264 8005D664 2484D070 */ addiu $a0, %lo(gTexture69EFE0) # addiu $a0, $a0, -0x2f90 /* 05E268 8005D668 24050800 */ li $a1, 2048 -/* 05E26C 8005D66C 0C0AA13D */ jal func_802A84F4 +/* 05E26C 8005D66C 0C0AA13D */ jal dma_textures /* 05E270 8005D670 24060800 */ li $a2, 2048 /* 05E274 8005D674 3C018019 */ lui $at, %hi(D_8018D470) # $at, 0x8019 /* 05E278 8005D678 3C040F06 */ lui $a0, %hi(gTextureLightningBolt0) # $a0, 0xf06 /* 05E27C 8005D67C AC22D470 */ sw $v0, %lo(D_8018D470)($at) /* 05E280 8005D680 2484E574 */ addiu $a0, %lo(gTextureLightningBolt0) # addiu $a0, $a0, -0x1a8c /* 05E284 8005D684 24050800 */ li $a1, 2048 -/* 05E288 8005D688 0C0AA13D */ jal func_802A84F4 +/* 05E288 8005D688 0C0AA13D */ jal dma_textures /* 05E28C 8005D68C 24060800 */ li $a2, 2048 /* 05E290 8005D690 3C018019 */ lui $at, %hi(D_8018D4C4) # $at, 0x8019 /* 05E294 8005D694 3C040F06 */ lui $a0, %hi(gTextureLightningBolt1) # $a0, 0xf06 /* 05E298 8005D698 AC22D4C4 */ sw $v0, %lo(D_8018D4C4)($at) /* 05E29C 8005D69C 2484E828 */ addiu $a0, %lo(gTextureLightningBolt1) # addiu $a0, $a0, -0x17d8 /* 05E2A0 8005D6A0 24050800 */ li $a1, 2048 -/* 05E2A4 8005D6A4 0C0AA13D */ jal func_802A84F4 +/* 05E2A4 8005D6A4 0C0AA13D */ jal dma_textures /* 05E2A8 8005D6A8 24060800 */ li $a2, 2048 /* 05E2AC 8005D6AC 8FBF0014 */ lw $ra, 0x14($sp) /* 05E2B0 8005D6B0 3C018019 */ lui $at, %hi(D_8018D4C8) # $at, 0x8019 diff --git a/asm/non_matchings/code_8006E9C0/func_8006EEE8.s b/asm/non_matchings/code_8006E9C0/func_8006EEE8.s index 7f023aaef..18d8fa125 100644 --- a/asm/non_matchings/code_8006E9C0/func_8006EEE8.s +++ b/asm/non_matchings/code_8006E9C0/func_8006EEE8.s @@ -11,7 +11,7 @@ glabel func_8006EEE8 /* 06FB0C 8006EF0C 008E2021 */ addu $a0, $a0, $t6 /* 06FB10 8006EF10 8C8454D0 */ lw $a0, %lo(gCourseOutlineTextures)($a0) # 0x54d0 /* 06FB14 8006EF14 AFA8001C */ sw $t0, 0x1c($sp) -/* 06FB18 8006EF18 0C0AA13D */ jal func_802A84F4 +/* 06FB18 8006EF18 0C0AA13D */ jal dma_textures /* 06FB1C 8006EF1C 00A03025 */ move $a2, $a1 /* 06FB20 8006EF20 8FA8001C */ lw $t0, 0x1c($sp) /* 06FB24 8006EF24 3C18800E */ lui $t8, %hi(D_800E5548) # $t8, 0x800e diff --git a/asm/non_matchings/code_8006E9C0/func_8006F008.s b/asm/non_matchings/code_8006E9C0/func_8006F008.s index 5d36c2bcb..35e666cb2 100644 --- a/asm/non_matchings/code_8006E9C0/func_8006F008.s +++ b/asm/non_matchings/code_8006E9C0/func_8006F008.s @@ -131,7 +131,7 @@ glabel L8006F0E4 /* 06FCE4 8006F0E4 3C040F0D */ lui $a0, %hi(gTextureExhaust5) # $a0, 0xf0d /* 06FCE8 8006F0E8 248470CC */ addiu $a0, %lo(gTextureExhaust5) # addiu $a0, $a0, 0x70cc /* 06FCEC 8006F0EC 24050443 */ li $a1, 1091 -/* 06FCF0 8006F0F0 0C0AA13D */ jal func_802A84F4 +/* 06FCF0 8006F0F0 0C0AA13D */ jal dma_textures /* 06FCF4 8006F0F4 24061000 */ li $a2, 4096 /* 06FCF8 8006F0F8 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 06FCFC 8006F0FC AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -198,7 +198,7 @@ glabel L8006F1E4 /* 06FDE4 8006F1E4 3C040F0D */ lui $a0, %hi(D_0F0D0E50) # $a0, 0xf0d /* 06FDE8 8006F1E8 24840E50 */ addiu $a0, %lo(D_0F0D0E50) # addiu $a0, $a0, 0xe50 /* 06FDEC 8006F1EC 24054CC2 */ li $a1, 19650 -/* 06FDF0 8006F1F0 0C0AA13D */ jal func_802A84F4 +/* 06FDF0 8006F1F0 0C0AA13D */ jal dma_textures /* 06FDF4 8006F1F4 3406D980 */ li $a2, 55680 /* 06FDF8 8006F1F8 3C018016 */ lui $at, %hi(D_80165880) # $at, 0x8016 /* 06FDFC 8006F1FC AC225880 */ sw $v0, %lo(D_80165880)($at) @@ -224,7 +224,7 @@ glabel L8006F248 /* 06FE48 8006F248 3C040F0D */ lui $a0, %hi(gTextureExhaust0) # $a0, 0xf0d /* 06FE4C 8006F24C 24845B14 */ addiu $a0, %lo(gTextureExhaust0) # addiu $a0, $a0, 0x5b14 /* 06FE50 8006F250 24050479 */ li $a1, 1145 -/* 06FE54 8006F254 0C0AA13D */ jal func_802A84F4 +/* 06FE54 8006F254 0C0AA13D */ jal dma_textures /* 06FE58 8006F258 24060C00 */ li $a2, 3072 /* 06FE5C 8006F25C 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 06FE60 8006F260 AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -271,7 +271,7 @@ glabel L8006F2FC /* 06FEFC 8006F2FC 3C040F0D */ lui $a0, %hi(gTextureExhaust3) # $a0, 0xf0d /* 06FF00 8006F300 2484690C */ addiu $a0, %lo(gTextureExhaust3) # addiu $a0, $a0, 0x690c /* 06FF04 8006F304 240503C8 */ li $a1, 968 -/* 06FF08 8006F308 0C0AA13D */ jal func_802A84F4 +/* 06FF08 8006F308 0C0AA13D */ jal dma_textures /* 06FF0C 8006F30C 24061000 */ li $a2, 4096 /* 06FF10 8006F310 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 06FF14 8006F314 AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -297,7 +297,7 @@ glabel L8006F360 /* 06FF60 8006F360 3C040F0D */ lui $a0, %hi(gTextureExhaust4) # $a0, 0xf0d /* 06FF64 8006F364 24846CD4 */ addiu $a0, %lo(gTextureExhaust4) # addiu $a0, $a0, 0x6cd4 /* 06FF68 8006F368 240503F8 */ li $a1, 1016 -/* 06FF6C 8006F36C 0C0AA13D */ jal func_802A84F4 +/* 06FF6C 8006F36C 0C0AA13D */ jal dma_textures /* 06FF70 8006F370 24061000 */ li $a2, 4096 /* 06FF74 8006F374 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 06FF78 8006F378 AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -332,7 +332,7 @@ glabel L8006F3E8 /* 06FFE8 8006F3E8 3C040F0D */ lui $a0, %hi(gTextureExhaust2) # $a0, 0xf0d /* 06FFEC 8006F3EC 24846418 */ addiu $a0, %lo(gTextureExhaust2) # addiu $a0, $a0, 0x6418 /* 06FFF0 8006F3F0 240504F4 */ li $a1, 1268 -/* 06FFF4 8006F3F4 0C0AA13D */ jal func_802A84F4 +/* 06FFF4 8006F3F4 0C0AA13D */ jal dma_textures /* 06FFF8 8006F3F8 24060C00 */ li $a2, 3072 /* 06FFFC 8006F3FC 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 070000 8006F400 AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -367,7 +367,7 @@ glabel L8006F470 /* 070070 8006F470 3C040F0D */ lui $a0, %hi(gTextureExhaust0) # $a0, 0xf0d /* 070074 8006F474 24845B14 */ addiu $a0, %lo(gTextureExhaust0) # addiu $a0, $a0, 0x5b14 /* 070078 8006F478 24050479 */ li $a1, 1145 -/* 07007C 8006F47C 0C0AA13D */ jal func_802A84F4 +/* 07007C 8006F47C 0C0AA13D */ jal dma_textures /* 070080 8006F480 24060C00 */ li $a2, 3072 /* 070084 8006F484 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 070088 8006F488 AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -412,7 +412,7 @@ glabel L8006F50C /* 07011C 8006F51C A5190000 */ sh $t9, ($t0) /* 070120 8006F520 248470CC */ addiu $a0, %lo(gTextureExhaust5) # addiu $a0, $a0, 0x70cc /* 070124 8006F524 24050443 */ li $a1, 1091 -/* 070128 8006F528 0C0AA13D */ jal func_802A84F4 +/* 070128 8006F528 0C0AA13D */ jal dma_textures /* 07012C 8006F52C 24061000 */ li $a2, 4096 /* 070130 8006F530 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 070134 8006F534 AC22D220 */ sw $v0, %lo(D_8018D220)($at) @@ -436,7 +436,7 @@ glabel L8006F578 /* 070178 8006F578 3C040F0D */ lui $a0, %hi(gTextureExhaust1) # $a0, 0xf0d /* 07017C 8006F57C 24845F90 */ addiu $a0, %lo(gTextureExhaust1) # addiu $a0, $a0, 0x5f90 /* 070180 8006F580 24050485 */ li $a1, 1157 -/* 070184 8006F584 0C0AA13D */ jal func_802A84F4 +/* 070184 8006F584 0C0AA13D */ jal dma_textures /* 070188 8006F588 24060C00 */ li $a2, 3072 /* 07018C 8006F58C 3C018019 */ lui $at, %hi(D_8018D220) # $at, 0x8019 /* 070190 8006F590 AC22D220 */ sw $v0, %lo(D_8018D220)($at) diff --git a/asm/non_matchings/code_80091750/func_80091B78.s b/asm/non_matchings/code_80091750/func_80091B78.s index dcafad343..ae33027b9 100644 --- a/asm/non_matchings/code_80091750/func_80091B78.s +++ b/asm/non_matchings/code_80091750/func_80091B78.s @@ -37,36 +37,36 @@ glabel func_80091B78 /* 0927FC 80091BFC 1639000C */ bne $s1, $t9, .L80091C30 /* 092800 80091C00 3C088016 */ lui $t0, %hi(D_8015F734) # $t0, 0x8016 /* 092804 80091C04 8D08F734 */ lw $t0, %lo(D_8015F734)($t0) -/* 092808 80091C08 3C018016 */ lui $at, %hi(gPrevLoadedAddress) # $at, 0x8016 +/* 092808 80091C08 3C018016 */ lui $at, %hi(gNextFreeMemoryAddress) # $at, 0x8016 /* 09280C 80091C0C 3C040082 */ lui $a0, %hi(_data_825800SegmentRomStart) # $a0, 0x82 /* 092810 80091C10 3C050083 */ lui $a1, %hi(_course_mario_raceway_dl_mio0SegmentRomStart) # $a1, 0x83 /* 092814 80091C14 24A584D0 */ addiu $a1, %lo(_course_mario_raceway_dl_mio0SegmentRomStart) # addiu $a1, $a1, -0x7b30 /* 092818 80091C18 24845800 */ addiu $a0, %lo(_data_825800SegmentRomStart) # addiu $a0, $a0, 0x5800 -/* 09281C 80091C1C 0C0AAA23 */ jal func_802AA88C -/* 092820 80091C20 AC28F728 */ sw $t0, %lo(gPrevLoadedAddress)($at) +/* 09281C 80091C1C 0C0AAA23 */ jal decompress_segments +/* 092820 80091C20 AC28F728 */ sw $t0, %lo(gNextFreeMemoryAddress)($at) /* 092824 80091C24 24040006 */ li $a0, 6 /* 092828 80091C28 0C0A9EE5 */ jal set_segment_base_addr /* 09282C 80091C2C 00402825 */ move $a1, $v0 .L80091C30: /* 092830 80091C30 3C098016 */ lui $t1, %hi(D_8015F734) # $t1, 0x8016 /* 092834 80091C34 8D29F734 */ lw $t1, %lo(D_8015F734)($t1) -/* 092838 80091C38 3C018016 */ lui $at, %hi(gPrevLoadedAddress) # $at, 0x8016 +/* 092838 80091C38 3C018016 */ lui $at, %hi(gNextFreeMemoryAddress) # $at, 0x8016 /* 09283C 80091C3C 3C040009 */ lui $a0, (0x000900B0 >> 16) # lui $a0, 9 /* 092840 80091C40 348400B0 */ ori $a0, (0x000900B0 & 0xFFFF) # ori $a0, $a0, 0xb0 -/* 092844 80091C44 0C0A9EDC */ jal func_802A7B70 -/* 092848 80091C48 AC29F728 */ sw $t1, %lo(gPrevLoadedAddress)($at) +/* 092844 80091C44 0C0A9EDC */ jal get_next_available_memory_addr +/* 092848 80091C48 AC29F728 */ sw $t1, %lo(gNextFreeMemoryAddress)($at) /* 09284C 80091C4C 3C018019 */ lui $at, %hi(D_8018D9B0) # $at, 0x8019 /* 092850 80091C50 AC22D9B0 */ sw $v0, %lo(D_8018D9B0)($at) -/* 092854 80091C54 0C0A9EDC */ jal func_802A7B70 +/* 092854 80091C54 0C0A9EDC */ jal get_next_available_memory_addr /* 092858 80091C58 3404CE00 */ li $a0, 52736 /* 09285C 80091C5C 3C018019 */ lui $at, %hi(D_8018D9B4) # $at, 0x8019 /* 092860 80091C60 3C040001 */ lui $a0, (0x00012C00 >> 16) # lui $a0, 1 /* 092864 80091C64 AC22D9B4 */ sw $v0, %lo(D_8018D9B4)($at) -/* 092868 80091C68 0C0A9EDC */ jal func_802A7B70 +/* 092868 80091C68 0C0A9EDC */ jal get_next_available_memory_addr /* 09286C 80091C6C 34842C00 */ ori $a0, (0x00012C00 & 0xFFFF) # ori $a0, $a0, 0x2c00 /* 092870 80091C70 3C018019 */ lui $at, %hi(D_8018D9B8) # $at, 0x8019 /* 092874 80091C74 AC22D9B8 */ sw $v0, %lo(D_8018D9B8)($at) -/* 092878 80091C78 0C0A9EDC */ jal func_802A7B70 +/* 092878 80091C78 0C0A9EDC */ jal get_next_available_memory_addr /* 09287C 80091C7C 24041000 */ li $a0, 4096 /* 092880 80091C80 3C018019 */ lui $at, %hi(D_8018D9C0) # $at, 0x8019 /* 092884 80091C84 0C02BE6C */ jal func_800AF9B0 diff --git a/asm/non_matchings/code_80091750/func_80091FA4.s b/asm/non_matchings/code_80091750/func_80091FA4.s index 543058c7c..ca317f84d 100644 --- a/asm/non_matchings/code_80091750/func_80091FA4.s +++ b/asm/non_matchings/code_80091750/func_80091FA4.s @@ -1,20 +1,20 @@ glabel func_80091FA4 /* 092BA4 80091FA4 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 092BA8 80091FA8 AFBF0014 */ sw $ra, 0x14($sp) -/* 092BAC 80091FAC 0C0A9EDC */ jal func_802A7B70 +/* 092BAC 80091FAC 0C0A9EDC */ jal get_next_available_memory_addr /* 092BB0 80091FB0 24042800 */ li $a0, 10240 /* 092BB4 80091FB4 3C018019 */ lui $at, %hi(D_8018D9B4) # $at, 0x8019 /* 092BB8 80091FB8 3C040001 */ lui $a0, (0x000124F8 >> 16) # lui $a0, 1 /* 092BBC 80091FBC AC22D9B4 */ sw $v0, %lo(D_8018D9B4)($at) -/* 092BC0 80091FC0 0C0A9EDC */ jal func_802A7B70 +/* 092BC0 80091FC0 0C0A9EDC */ jal get_next_available_memory_addr /* 092BC4 80091FC4 348424F8 */ ori $a0, (0x000124F8 & 0xFFFF) # ori $a0, $a0, 0x24f8 /* 092BC8 80091FC8 3C018019 */ lui $at, %hi(D_8018D9B0) # $at, 0x8019 /* 092BCC 80091FCC AC22D9B0 */ sw $v0, %lo(D_8018D9B0)($at) -/* 092BD0 80091FD0 0C0A9EDC */ jal func_802A7B70 +/* 092BD0 80091FD0 0C0A9EDC */ jal get_next_available_memory_addr /* 092BD4 80091FD4 24041000 */ li $a0, 4096 /* 092BD8 80091FD8 3C018019 */ lui $at, %hi(D_8018D9B8) # $at, 0x8019 /* 092BDC 80091FDC AC22D9B8 */ sw $v0, %lo(D_8018D9B8)($at) -/* 092BE0 80091FE0 0C0A9EDC */ jal func_802A7B70 +/* 092BE0 80091FE0 0C0A9EDC */ jal get_next_available_memory_addr /* 092BE4 80091FE4 24040004 */ li $a0, 4 /* 092BE8 80091FE8 3C018019 */ lui $at, %hi(D_8018D9BC) # $at, 0x8019 /* 092BEC 80091FEC AC22D9BC */ sw $v0, %lo(D_8018D9BC)($at) diff --git a/asm/non_matchings/code_80091750/func_80093E60.s b/asm/non_matchings/code_80091750/func_80093E60.s index 8c11ad81b..d2f88757f 100644 --- a/asm/non_matchings/code_80091750/func_80093E60.s +++ b/asm/non_matchings/code_80091750/func_80093E60.s @@ -1,20 +1,20 @@ glabel func_80093E60 /* 094A60 80093E60 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 094A64 80093E64 AFBF0014 */ sw $ra, 0x14($sp) -/* 094A68 80093E68 0C0A9EDC */ jal func_802A7B70 +/* 094A68 80093E68 0C0A9EDC */ jal get_next_available_memory_addr /* 094A6C 80093E6C 24042800 */ li $a0, 10240 /* 094A70 80093E70 3C018019 */ lui $at, %hi(D_8018D9B4) # $at, 0x8019 /* 094A74 80093E74 3C040001 */ lui $a0, (0x000124F8 >> 16) # lui $a0, 1 /* 094A78 80093E78 AC22D9B4 */ sw $v0, %lo(D_8018D9B4)($at) -/* 094A7C 80093E7C 0C0A9EDC */ jal func_802A7B70 +/* 094A7C 80093E7C 0C0A9EDC */ jal get_next_available_memory_addr /* 094A80 80093E80 348424F8 */ ori $a0, (0x000124F8 & 0xFFFF) # ori $a0, $a0, 0x24f8 /* 094A84 80093E84 3C018019 */ lui $at, %hi(D_8018D9B0) # $at, 0x8019 /* 094A88 80093E88 AC22D9B0 */ sw $v0, %lo(D_8018D9B0)($at) -/* 094A8C 80093E8C 0C0A9EDC */ jal func_802A7B70 +/* 094A8C 80093E8C 0C0A9EDC */ jal get_next_available_memory_addr /* 094A90 80093E90 24041000 */ li $a0, 4096 /* 094A94 80093E94 3C018019 */ lui $at, %hi(D_8018D9B8) # $at, 0x8019 /* 094A98 80093E98 AC22D9B8 */ sw $v0, %lo(D_8018D9B8)($at) -/* 094A9C 80093E9C 0C0A9EDC */ jal func_802A7B70 +/* 094A9C 80093E9C 0C0A9EDC */ jal get_next_available_memory_addr /* 094AA0 80093EA0 24040004 */ li $a0, 4 /* 094AA4 80093EA4 3C018019 */ lui $at, %hi(D_8018D9BC) # $at, 0x8019 /* 094AA8 80093EA8 AC22D9BC */ sw $v0, %lo(D_8018D9BC)($at) diff --git a/asm/non_matchings/code_802AAA70/func_802AF314.s b/asm/non_matchings/code_802AAA70/func_802AF314.s index 4f08c6577..50248a8c4 100644 --- a/asm/non_matchings/code_802AAA70/func_802AF314.s +++ b/asm/non_matchings/code_802AAA70/func_802AF314.s @@ -34,8 +34,8 @@ glabel func_802AF314 /* 1189A0 802AF390 3C148016 */ lui $s4, %hi(D_8015F58A) # $s4, 0x8016 /* 1189A4 802AF394 2694F58A */ addiu $s4, %lo(D_8015F58A) # addiu $s4, $s4, -0xa76 /* 1189A8 802AF398 A6800000 */ sh $zero, ($s4) -/* 1189AC 802AF39C 3C088016 */ lui $t0, %hi(gPrevLoadedAddress) # $t0, 0x8016 -/* 1189B0 802AF3A0 8D08F728 */ lw $t0, %lo(gPrevLoadedAddress)($t0) +/* 1189AC 802AF39C 3C088016 */ lui $t0, %hi(gNextFreeMemoryAddress) # $t0, 0x8016 +/* 1189B0 802AF3A0 8D08F728 */ lw $t0, %lo(gNextFreeMemoryAddress)($t0) /* 1189B4 802AF3A4 3C018016 */ lui $at, %hi(D_8015F584) # $at, 0x8016 /* 1189B8 802AF3A8 3C038016 */ lui $v1, %hi(D_8015F588) # $v1, 0x8016 /* 1189BC 802AF3AC AC28F584 */ sw $t0, %lo(D_8015F584)($at) diff --git a/asm/non_matchings/memory/display_list_unpack.s b/asm/non_matchings/memory/display_list_unpack.s deleted file mode 100644 index 78ce49ece..000000000 --- a/asm/non_matchings/memory/display_list_unpack.s +++ /dev/null @@ -1,942 +0,0 @@ -.section .late_rodata - -glabel jpt_802B9C94 -.word L802A9BB8, L802A9BDC, L802A9C00, L802A9C24 -.word L802A9C48, L802A9C6C, L802A9C90, L802A9CB4 -.word L802A9CD8, L802A9CFC, L802A9D20, L802A9D44 -.word L802A9D68, L802A9D8C, L802A9DB0, L802A9DD4 -.word L802A9DF8, L802A9E1C, L802A9E40, L802A9E64 -.word L802A9E88, L802A9EAC, L802A9EC8, L802A9EE4 -.word L802A9F38, L802A9F54, L802A9FC4, L802AA00C -.word L802AA030, L802AA054, L802AA078, L802AA09C -.word L802AA0C0, L802AA0E4, L802AA108, L802AA12C -.word L802AA150, L802AA174, L802AA198, L802AA1BC -.word L802AA1E0, L802AA684, L802AA714, L802AA780 -.word L802A9FE8, L802AA6F0, L802A9F00, L802A9F70 -.word L802AA6CC, L802A9B74, L802A9B74, L802AA204 -.word L802AA228, L802AA24C, L802AA270, L802AA294 -.word L802AA2B8, L802AA2DC, L802AA300, L802AA324 -.word L802AA348, L802AA36C, L802AA390, L802AA3B4 -.word L802AA3D8, L802AA3FC, L802AA420, L802AA444 -.word L802AA468, L802AA48C, L802AA4B0, L802AA4D4 -.word L802AA4F8, L802AA51C, L802AA540, L802AA564 -.word L802AA588, L802AA5AC, L802AA5D0, L802AA5F4 -.word L802AA618, L802AA63C, L802AA660, L802A9F1C -.word L802A9F8C, L802A9FA8, L802AA738, L802AA75C -.word L802AA6A8 - -.section .text - -glabel display_list_unpack -/* 113104 802A9AF4 00047602 */ srl $t6, $a0, 0x18 -/* 113108 802A9AF8 000E7880 */ sll $t7, $t6, 2 -/* 11310C 802A9AFC 3C188015 */ lui $t8, %hi(gSegmentTable) -/* 113110 802A9B00 030FC021 */ addu $t8, $t8, $t7 -/* 113114 802A9B04 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 113118 802A9B08 8F180258 */ lw $t8, %lo(gSegmentTable)($t8) -/* 11311C 802A9B0C 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 113120 802A9B10 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 113124 802A9B14 0081C824 */ and $t9, $a0, $at -/* 113128 802A9B18 AFB00018 */ sw $s0, 0x18($sp) -/* 11312C 802A9B1C 3C038016 */ lui $v1, %hi(gHeapEndPtr) # $v1, 0x8016 -/* 113130 802A9B20 3C018000 */ lui $at, 0x8000 -/* 113134 802A9B24 03198021 */ addu $s0, $t8, $t9 -/* 113138 802A9B28 2463F72C */ addiu $v1, %lo(gHeapEndPtr) # addiu $v1, $v1, -0x8d4 -/* 11313C 802A9B2C 02018021 */ addu $s0, $s0, $at -/* 113140 802A9B30 8C690000 */ lw $t1, ($v1) -/* 113144 802A9B34 2401FFF0 */ li $at, -16 -/* 113148 802A9B38 24A5000F */ addiu $a1, $a1, 0xf -/* 11314C 802A9B3C 00A14024 */ and $t0, $a1, $at -/* 113150 802A9B40 AFB1001C */ sw $s1, 0x1c($sp) -/* 113154 802A9B44 25050008 */ addiu $a1, $t0, 8 -/* 113158 802A9B48 01258823 */ subu $s1, $t1, $a1 -/* 11315C 802A9B4C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113160 802A9B50 AC710000 */ sw $s1, ($v1) -/* 113164 802A9B54 3C01802C */ lui $at, %hi(D_802BA270) # $at, 0x802c -/* 113168 802A9B58 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -/* 11316C 802A9B5C AFB20020 */ sw $s2, 0x20($sp) -/* 113170 802A9B60 AC20A270 */ sw $zero, %lo(D_802BA270)($at) -/* 113174 802A9B64 00C09025 */ move $s2, $a2 -/* 113178 802A9B68 AFBF0024 */ sw $ra, 0x24($sp) -/* 11317C 802A9B6C AFB1002C */ sw $s1, 0x2c($sp) -/* 113180 802A9B70 ACE00000 */ sw $zero, ($a3) -.L802A9B74: -glabel L802A9B74 -/* 113184 802A9B74 8CE30000 */ lw $v1, ($a3) -.L802A9B78: -/* 113188 802A9B78 240100FF */ li $at, 255 -/* 11318C 802A9B7C 00705821 */ addu $t3, $v1, $s0 -/* 113190 802A9B80 91640000 */ lbu $a0, ($t3) -/* 113194 802A9B84 246C0001 */ addiu $t4, $v1, 1 -/* 113198 802A9B88 ACEC0000 */ sw $t4, ($a3) -/* 11319C 802A9B8C 10810305 */ beq $a0, $at, .L802AA7A4 -/* 1131A0 802A9B90 00801025 */ move $v0, $a0 -/* 1131A4 802A9B94 2C810059 */ sltiu $at, $a0, 0x59 -/* 1131A8 802A9B98 5020FFF7 */ beql $at, $zero, .L802A9B78 -/* 1131AC 802A9B9C 8CE30000 */ lw $v1, ($a3) -/* 1131B0 802A9BA0 00046880 */ sll $t5, $a0, 2 -/* 1131B4 802A9BA4 3C01802C */ lui $at, %hi(jpt_802B9C94) -/* 1131B8 802A9BA8 002D0821 */ addu $at, $at, $t5 -/* 1131BC 802A9BAC 8C2D9C94 */ lw $t5, %lo(jpt_802B9C94)($at) -/* 1131C0 802A9BB0 01A00008 */ jr $t5 -/* 1131C4 802A9BB4 00000000 */ nop -glabel L802A9BB8 -/* 1131C8 802A9BB8 00023600 */ sll $a2, $v0, 0x18 -/* 1131CC 802A9BBC 00067603 */ sra $t6, $a2, 0x18 -/* 1131D0 802A9BC0 01C03025 */ move $a2, $t6 -/* 1131D4 802A9BC4 02202025 */ move $a0, $s1 -/* 1131D8 802A9BC8 0C0AA213 */ jal func_802A884C -/* 1131DC 802A9BCC 02002825 */ move $a1, $s0 -/* 1131E0 802A9BD0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1131E4 802A9BD4 1000FFE7 */ b .L802A9B74 -/* 1131E8 802A9BD8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9BDC -/* 1131EC 802A9BDC 00023600 */ sll $a2, $v0, 0x18 -/* 1131F0 802A9BE0 00067E03 */ sra $t7, $a2, 0x18 -/* 1131F4 802A9BE4 01E03025 */ move $a2, $t7 -/* 1131F8 802A9BE8 02202025 */ move $a0, $s1 -/* 1131FC 802A9BEC 0C0AA213 */ jal func_802A884C -/* 113200 802A9BF0 02002825 */ move $a1, $s0 -/* 113204 802A9BF4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113208 802A9BF8 1000FFDE */ b .L802A9B74 -/* 11320C 802A9BFC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9C00 -/* 113210 802A9C00 00023600 */ sll $a2, $v0, 0x18 -/* 113214 802A9C04 0006C603 */ sra $t8, $a2, 0x18 -/* 113218 802A9C08 03003025 */ move $a2, $t8 -/* 11321C 802A9C0C 02202025 */ move $a0, $s1 -/* 113220 802A9C10 0C0AA213 */ jal func_802A884C -/* 113224 802A9C14 02002825 */ move $a1, $s0 -/* 113228 802A9C18 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11322C 802A9C1C 1000FFD5 */ b .L802A9B74 -/* 113230 802A9C20 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9C24 -/* 113234 802A9C24 00023600 */ sll $a2, $v0, 0x18 -/* 113238 802A9C28 0006CE03 */ sra $t9, $a2, 0x18 -/* 11323C 802A9C2C 03203025 */ move $a2, $t9 -/* 113240 802A9C30 02202025 */ move $a0, $s1 -/* 113244 802A9C34 0C0AA213 */ jal func_802A884C -/* 113248 802A9C38 02002825 */ move $a1, $s0 -/* 11324C 802A9C3C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113250 802A9C40 1000FFCC */ b .L802A9B74 -/* 113254 802A9C44 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9C48 -/* 113258 802A9C48 00023600 */ sll $a2, $v0, 0x18 -/* 11325C 802A9C4C 00064603 */ sra $t0, $a2, 0x18 -/* 113260 802A9C50 01003025 */ move $a2, $t0 -/* 113264 802A9C54 02202025 */ move $a0, $s1 -/* 113268 802A9C58 0C0AA213 */ jal func_802A884C -/* 11326C 802A9C5C 02002825 */ move $a1, $s0 -/* 113270 802A9C60 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113274 802A9C64 1000FFC3 */ b .L802A9B74 -/* 113278 802A9C68 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9C6C -/* 11327C 802A9C6C 00023600 */ sll $a2, $v0, 0x18 -/* 113280 802A9C70 00064E03 */ sra $t1, $a2, 0x18 -/* 113284 802A9C74 01203025 */ move $a2, $t1 -/* 113288 802A9C78 02202025 */ move $a0, $s1 -/* 11328C 802A9C7C 0C0AA213 */ jal func_802A884C -/* 113290 802A9C80 02002825 */ move $a1, $s0 -/* 113294 802A9C84 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113298 802A9C88 1000FFBA */ b .L802A9B74 -/* 11329C 802A9C8C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9C90 -/* 1132A0 802A9C90 00023600 */ sll $a2, $v0, 0x18 -/* 1132A4 802A9C94 00065603 */ sra $t2, $a2, 0x18 -/* 1132A8 802A9C98 01403025 */ move $a2, $t2 -/* 1132AC 802A9C9C 02202025 */ move $a0, $s1 -/* 1132B0 802A9CA0 0C0AA213 */ jal func_802A884C -/* 1132B4 802A9CA4 02002825 */ move $a1, $s0 -/* 1132B8 802A9CA8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1132BC 802A9CAC 1000FFB1 */ b .L802A9B74 -/* 1132C0 802A9CB0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9CB4 -/* 1132C4 802A9CB4 00023600 */ sll $a2, $v0, 0x18 -/* 1132C8 802A9CB8 00065E03 */ sra $t3, $a2, 0x18 -/* 1132CC 802A9CBC 01603025 */ move $a2, $t3 -/* 1132D0 802A9CC0 02202025 */ move $a0, $s1 -/* 1132D4 802A9CC4 0C0AA213 */ jal func_802A884C -/* 1132D8 802A9CC8 02002825 */ move $a1, $s0 -/* 1132DC 802A9CCC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1132E0 802A9CD0 1000FFA8 */ b .L802A9B74 -/* 1132E4 802A9CD4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9CD8 -/* 1132E8 802A9CD8 00023600 */ sll $a2, $v0, 0x18 -/* 1132EC 802A9CDC 00066603 */ sra $t4, $a2, 0x18 -/* 1132F0 802A9CE0 01803025 */ move $a2, $t4 -/* 1132F4 802A9CE4 02202025 */ move $a0, $s1 -/* 1132F8 802A9CE8 0C0AA213 */ jal func_802A884C -/* 1132FC 802A9CEC 02002825 */ move $a1, $s0 -/* 113300 802A9CF0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113304 802A9CF4 1000FF9F */ b .L802A9B74 -/* 113308 802A9CF8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9CFC -/* 11330C 802A9CFC 00023600 */ sll $a2, $v0, 0x18 -/* 113310 802A9D00 00066E03 */ sra $t5, $a2, 0x18 -/* 113314 802A9D04 01A03025 */ move $a2, $t5 -/* 113318 802A9D08 02202025 */ move $a0, $s1 -/* 11331C 802A9D0C 0C0AA213 */ jal func_802A884C -/* 113320 802A9D10 02002825 */ move $a1, $s0 -/* 113324 802A9D14 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113328 802A9D18 1000FF96 */ b .L802A9B74 -/* 11332C 802A9D1C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9D20 -/* 113330 802A9D20 00023600 */ sll $a2, $v0, 0x18 -/* 113334 802A9D24 00067603 */ sra $t6, $a2, 0x18 -/* 113338 802A9D28 01C03025 */ move $a2, $t6 -/* 11333C 802A9D2C 02202025 */ move $a0, $s1 -/* 113340 802A9D30 0C0AA213 */ jal func_802A884C -/* 113344 802A9D34 02002825 */ move $a1, $s0 -/* 113348 802A9D38 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11334C 802A9D3C 1000FF8D */ b .L802A9B74 -/* 113350 802A9D40 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9D44 -/* 113354 802A9D44 00023600 */ sll $a2, $v0, 0x18 -/* 113358 802A9D48 00067E03 */ sra $t7, $a2, 0x18 -/* 11335C 802A9D4C 01E03025 */ move $a2, $t7 -/* 113360 802A9D50 02202025 */ move $a0, $s1 -/* 113364 802A9D54 0C0AA213 */ jal func_802A884C -/* 113368 802A9D58 02002825 */ move $a1, $s0 -/* 11336C 802A9D5C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113370 802A9D60 1000FF84 */ b .L802A9B74 -/* 113374 802A9D64 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9D68 -/* 113378 802A9D68 00023600 */ sll $a2, $v0, 0x18 -/* 11337C 802A9D6C 0006C603 */ sra $t8, $a2, 0x18 -/* 113380 802A9D70 03003025 */ move $a2, $t8 -/* 113384 802A9D74 02202025 */ move $a0, $s1 -/* 113388 802A9D78 0C0AA213 */ jal func_802A884C -/* 11338C 802A9D7C 02002825 */ move $a1, $s0 -/* 113390 802A9D80 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113394 802A9D84 1000FF7B */ b .L802A9B74 -/* 113398 802A9D88 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9D8C -/* 11339C 802A9D8C 00023600 */ sll $a2, $v0, 0x18 -/* 1133A0 802A9D90 0006CE03 */ sra $t9, $a2, 0x18 -/* 1133A4 802A9D94 03203025 */ move $a2, $t9 -/* 1133A8 802A9D98 02202025 */ move $a0, $s1 -/* 1133AC 802A9D9C 0C0AA213 */ jal func_802A884C -/* 1133B0 802A9DA0 02002825 */ move $a1, $s0 -/* 1133B4 802A9DA4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1133B8 802A9DA8 1000FF72 */ b .L802A9B74 -/* 1133BC 802A9DAC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9DB0 -/* 1133C0 802A9DB0 00023600 */ sll $a2, $v0, 0x18 -/* 1133C4 802A9DB4 00064603 */ sra $t0, $a2, 0x18 -/* 1133C8 802A9DB8 01003025 */ move $a2, $t0 -/* 1133CC 802A9DBC 02202025 */ move $a0, $s1 -/* 1133D0 802A9DC0 0C0AA213 */ jal func_802A884C -/* 1133D4 802A9DC4 02002825 */ move $a1, $s0 -/* 1133D8 802A9DC8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1133DC 802A9DCC 1000FF69 */ b .L802A9B74 -/* 1133E0 802A9DD0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9DD4 -/* 1133E4 802A9DD4 00023600 */ sll $a2, $v0, 0x18 -/* 1133E8 802A9DD8 00064E03 */ sra $t1, $a2, 0x18 -/* 1133EC 802A9DDC 01203025 */ move $a2, $t1 -/* 1133F0 802A9DE0 02202025 */ move $a0, $s1 -/* 1133F4 802A9DE4 0C0AA213 */ jal func_802A884C -/* 1133F8 802A9DE8 02002825 */ move $a1, $s0 -/* 1133FC 802A9DEC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113400 802A9DF0 1000FF60 */ b .L802A9B74 -/* 113404 802A9DF4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9DF8 -/* 113408 802A9DF8 00023600 */ sll $a2, $v0, 0x18 -/* 11340C 802A9DFC 00065603 */ sra $t2, $a2, 0x18 -/* 113410 802A9E00 01403025 */ move $a2, $t2 -/* 113414 802A9E04 02202025 */ move $a0, $s1 -/* 113418 802A9E08 0C0AA213 */ jal func_802A884C -/* 11341C 802A9E0C 02002825 */ move $a1, $s0 -/* 113420 802A9E10 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113424 802A9E14 1000FF57 */ b .L802A9B74 -/* 113428 802A9E18 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9E1C -/* 11342C 802A9E1C 00023600 */ sll $a2, $v0, 0x18 -/* 113430 802A9E20 00065E03 */ sra $t3, $a2, 0x18 -/* 113434 802A9E24 01603025 */ move $a2, $t3 -/* 113438 802A9E28 02202025 */ move $a0, $s1 -/* 11343C 802A9E2C 0C0AA213 */ jal func_802A884C -/* 113440 802A9E30 02002825 */ move $a1, $s0 -/* 113444 802A9E34 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113448 802A9E38 1000FF4E */ b .L802A9B74 -/* 11344C 802A9E3C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9E40 -/* 113450 802A9E40 00023600 */ sll $a2, $v0, 0x18 -/* 113454 802A9E44 00066603 */ sra $t4, $a2, 0x18 -/* 113458 802A9E48 01803025 */ move $a2, $t4 -/* 11345C 802A9E4C 02202025 */ move $a0, $s1 -/* 113460 802A9E50 0C0AA213 */ jal func_802A884C -/* 113464 802A9E54 02002825 */ move $a1, $s0 -/* 113468 802A9E58 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11346C 802A9E5C 1000FF45 */ b .L802A9B74 -/* 113470 802A9E60 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9E64 -/* 113474 802A9E64 00023600 */ sll $a2, $v0, 0x18 -/* 113478 802A9E68 00066E03 */ sra $t5, $a2, 0x18 -/* 11347C 802A9E6C 01A03025 */ move $a2, $t5 -/* 113480 802A9E70 02202025 */ move $a0, $s1 -/* 113484 802A9E74 0C0AA213 */ jal func_802A884C -/* 113488 802A9E78 02002825 */ move $a1, $s0 -/* 11348C 802A9E7C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113490 802A9E80 1000FF3C */ b .L802A9B74 -/* 113494 802A9E84 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9E88 -/* 113498 802A9E88 00023600 */ sll $a2, $v0, 0x18 -/* 11349C 802A9E8C 00067603 */ sra $t6, $a2, 0x18 -/* 1134A0 802A9E90 01C03025 */ move $a2, $t6 -/* 1134A4 802A9E94 02202025 */ move $a0, $s1 -/* 1134A8 802A9E98 0C0AA213 */ jal func_802A884C -/* 1134AC 802A9E9C 02002825 */ move $a1, $s0 -/* 1134B0 802A9EA0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1134B4 802A9EA4 1000FF33 */ b .L802A9B74 -/* 1134B8 802A9EA8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9EAC -/* 1134BC 802A9EAC 02202025 */ move $a0, $s1 -/* 1134C0 802A9EB0 02002825 */ move $a1, $s0 -/* 1134C4 802A9EB4 0C0AA2D2 */ jal func_802A8B48 -/* 1134C8 802A9EB8 02403025 */ move $a2, $s2 -/* 1134CC 802A9EBC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1134D0 802A9EC0 1000FF2C */ b .L802A9B74 -/* 1134D4 802A9EC4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9EC8 -/* 1134D8 802A9EC8 02202025 */ move $a0, $s1 -/* 1134DC 802A9ECC 02002825 */ move $a1, $s0 -/* 1134E0 802A9ED0 0C0AA2ED */ jal func_802A8BB4 -/* 1134E4 802A9ED4 02403025 */ move $a2, $s2 -/* 1134E8 802A9ED8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1134EC 802A9EDC 1000FF25 */ b .L802A9B74 -/* 1134F0 802A9EE0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9EE4 -/* 1134F4 802A9EE4 02202025 */ move $a0, $s1 -/* 1134F8 802A9EE8 02002825 */ move $a1, $s0 -/* 1134FC 802A9EEC 0C0AA308 */ jal func_802A8C20 -/* 113500 802A9EF0 02403025 */ move $a2, $s2 -/* 113504 802A9EF4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113508 802A9EF8 1000FF1E */ b .L802A9B74 -/* 11350C 802A9EFC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9F00 -/* 113510 802A9F00 02202025 */ move $a0, $s1 -/* 113514 802A9F04 02002825 */ move $a1, $s0 -/* 113518 802A9F08 0C0AA323 */ jal func_802A8C8C -/* 11351C 802A9F0C 02403025 */ move $a2, $s2 -/* 113520 802A9F10 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113524 802A9F14 1000FF17 */ b .L802A9B74 -/* 113528 802A9F18 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9F1C -/* 11352C 802A9F1C 02202025 */ move $a0, $s1 -/* 113530 802A9F20 02002825 */ move $a1, $s0 -/* 113534 802A9F24 0C0AA33E */ jal func_802A8CF8 -/* 113538 802A9F28 02403025 */ move $a2, $s2 -/* 11353C 802A9F2C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113540 802A9F30 1000FF10 */ b .L802A9B74 -/* 113544 802A9F34 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9F38 -/* 113548 802A9F38 02202025 */ move $a0, $s1 -/* 11354C 802A9F3C 02002825 */ move $a1, $s0 -/* 113550 802A9F40 0C0AA359 */ jal func_802A8D64 -/* 113554 802A9F44 02403025 */ move $a2, $s2 -/* 113558 802A9F48 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11355C 802A9F4C 1000FF09 */ b .L802A9B74 -/* 113560 802A9F50 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9F54 -/* 113564 802A9F54 02202025 */ move $a0, $s1 -/* 113568 802A9F58 02002825 */ move $a1, $s0 -/* 11356C 802A9F5C 0C0AA374 */ jal func_802A8DD0 -/* 113570 802A9F60 02403025 */ move $a2, $s2 -/* 113574 802A9F64 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113578 802A9F68 1000FF02 */ b .L802A9B74 -/* 11357C 802A9F6C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9F70 -/* 113580 802A9F70 02202025 */ move $a0, $s1 -/* 113584 802A9F74 02002825 */ move $a1, $s0 -/* 113588 802A9F78 0C0AA38F */ jal func_802A8E3C -/* 11358C 802A9F7C 02403025 */ move $a2, $s2 -/* 113590 802A9F80 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113594 802A9F84 1000FEFB */ b .L802A9B74 -/* 113598 802A9F88 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9F8C -/* 11359C 802A9F8C 02202025 */ move $a0, $s1 -/* 1135A0 802A9F90 02002825 */ move $a1, $s0 -/* 1135A4 802A9F94 0C0AA3AA */ jal func_802A8EA8 -/* 1135A8 802A9F98 02403025 */ move $a2, $s2 -/* 1135AC 802A9F9C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1135B0 802A9FA0 1000FEF4 */ b .L802A9B74 -/* 1135B4 802A9FA4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9FA8 -/* 1135B8 802A9FA8 02202025 */ move $a0, $s1 -/* 1135BC 802A9FAC 02002825 */ move $a1, $s0 -/* 1135C0 802A9FB0 0C0AA3C5 */ jal func_802A8F14 -/* 1135C4 802A9FB4 02403025 */ move $a2, $s2 -/* 1135C8 802A9FB8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1135CC 802A9FBC 1000FEED */ b .L802A9B74 -/* 1135D0 802A9FC0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9FC4 -/* 1135D4 802A9FC4 00023600 */ sll $a2, $v0, 0x18 -/* 1135D8 802A9FC8 00067E03 */ sra $t7, $a2, 0x18 -/* 1135DC 802A9FCC 01E03025 */ move $a2, $t7 -/* 1135E0 802A9FD0 02202025 */ move $a0, $s1 -/* 1135E4 802A9FD4 0C0AA3E0 */ jal func_802A8F80 -/* 1135E8 802A9FD8 02002825 */ move $a1, $s0 -/* 1135EC 802A9FDC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1135F0 802A9FE0 1000FEE4 */ b .L802A9B74 -/* 1135F4 802A9FE4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802A9FE8 -/* 1135F8 802A9FE8 00023600 */ sll $a2, $v0, 0x18 -/* 1135FC 802A9FEC 0006C603 */ sra $t8, $a2, 0x18 -/* 113600 802A9FF0 03003025 */ move $a2, $t8 -/* 113604 802A9FF4 02202025 */ move $a0, $s1 -/* 113608 802A9FF8 0C0AA3E0 */ jal func_802A8F80 -/* 11360C 802A9FFC 02002825 */ move $a1, $s0 -/* 113610 802AA000 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113614 802AA004 1000FEDB */ b .L802A9B74 -/* 113618 802AA008 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA00C -/* 11361C 802AA00C 00023600 */ sll $a2, $v0, 0x18 -/* 113620 802AA010 0006CE03 */ sra $t9, $a2, 0x18 -/* 113624 802AA014 03203025 */ move $a2, $t9 -/* 113628 802AA018 02202025 */ move $a0, $s1 -/* 11362C 802AA01C 0C0AA3E0 */ jal func_802A8F80 -/* 113630 802AA020 02002825 */ move $a1, $s0 -/* 113634 802AA024 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113638 802AA028 1000FED2 */ b .L802A9B74 -/* 11363C 802AA02C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA030 -/* 113640 802AA030 00023600 */ sll $a2, $v0, 0x18 -/* 113644 802AA034 00064603 */ sra $t0, $a2, 0x18 -/* 113648 802AA038 01003025 */ move $a2, $t0 -/* 11364C 802AA03C 02202025 */ move $a0, $s1 -/* 113650 802AA040 0C0AA3E0 */ jal func_802A8F80 -/* 113654 802AA044 02002825 */ move $a1, $s0 -/* 113658 802AA048 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11365C 802AA04C 1000FEC9 */ b .L802A9B74 -/* 113660 802AA050 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA054 -/* 113664 802AA054 00023600 */ sll $a2, $v0, 0x18 -/* 113668 802AA058 00064E03 */ sra $t1, $a2, 0x18 -/* 11366C 802AA05C 01203025 */ move $a2, $t1 -/* 113670 802AA060 02202025 */ move $a0, $s1 -/* 113674 802AA064 0C0AA3E0 */ jal func_802A8F80 -/* 113678 802AA068 02002825 */ move $a1, $s0 -/* 11367C 802AA06C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113680 802AA070 1000FEC0 */ b .L802A9B74 -/* 113684 802AA074 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA078 -/* 113688 802AA078 00023600 */ sll $a2, $v0, 0x18 -/* 11368C 802AA07C 00065603 */ sra $t2, $a2, 0x18 -/* 113690 802AA080 01403025 */ move $a2, $t2 -/* 113694 802AA084 02202025 */ move $a0, $s1 -/* 113698 802AA088 0C0AA3E0 */ jal func_802A8F80 -/* 11369C 802AA08C 02002825 */ move $a1, $s0 -/* 1136A0 802AA090 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1136A4 802AA094 1000FEB7 */ b .L802A9B74 -/* 1136A8 802AA098 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA09C -/* 1136AC 802AA09C 00023600 */ sll $a2, $v0, 0x18 -/* 1136B0 802AA0A0 00065E03 */ sra $t3, $a2, 0x18 -/* 1136B4 802AA0A4 01603025 */ move $a2, $t3 -/* 1136B8 802AA0A8 02202025 */ move $a0, $s1 -/* 1136BC 802AA0AC 0C0AA3E0 */ jal func_802A8F80 -/* 1136C0 802AA0B0 02002825 */ move $a1, $s0 -/* 1136C4 802AA0B4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1136C8 802AA0B8 1000FEAE */ b .L802A9B74 -/* 1136CC 802AA0BC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA0C0 -/* 1136D0 802AA0C0 00023600 */ sll $a2, $v0, 0x18 -/* 1136D4 802AA0C4 00066603 */ sra $t4, $a2, 0x18 -/* 1136D8 802AA0C8 01803025 */ move $a2, $t4 -/* 1136DC 802AA0CC 02202025 */ move $a0, $s1 -/* 1136E0 802AA0D0 0C0AA479 */ jal func_802A91E4 -/* 1136E4 802AA0D4 02002825 */ move $a1, $s0 -/* 1136E8 802AA0D8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1136EC 802AA0DC 1000FEA5 */ b .L802A9B74 -/* 1136F0 802AA0E0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA0E4 -/* 1136F4 802AA0E4 00023600 */ sll $a2, $v0, 0x18 -/* 1136F8 802AA0E8 00066E03 */ sra $t5, $a2, 0x18 -/* 1136FC 802AA0EC 01A03025 */ move $a2, $t5 -/* 113700 802AA0F0 02202025 */ move $a0, $s1 -/* 113704 802AA0F4 0C0AA479 */ jal func_802A91E4 -/* 113708 802AA0F8 02002825 */ move $a1, $s0 -/* 11370C 802AA0FC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113710 802AA100 1000FE9C */ b .L802A9B74 -/* 113714 802AA104 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA108 -/* 113718 802AA108 00023600 */ sll $a2, $v0, 0x18 -/* 11371C 802AA10C 00067603 */ sra $t6, $a2, 0x18 -/* 113720 802AA110 01C03025 */ move $a2, $t6 -/* 113724 802AA114 02202025 */ move $a0, $s1 -/* 113728 802AA118 0C0AA479 */ jal func_802A91E4 -/* 11372C 802AA11C 02002825 */ move $a1, $s0 -/* 113730 802AA120 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113734 802AA124 1000FE93 */ b .L802A9B74 -/* 113738 802AA128 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA12C -/* 11373C 802AA12C 00023600 */ sll $a2, $v0, 0x18 -/* 113740 802AA130 00067E03 */ sra $t7, $a2, 0x18 -/* 113744 802AA134 01E03025 */ move $a2, $t7 -/* 113748 802AA138 02202025 */ move $a0, $s1 -/* 11374C 802AA13C 0C0AA479 */ jal func_802A91E4 -/* 113750 802AA140 02002825 */ move $a1, $s0 -/* 113754 802AA144 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113758 802AA148 1000FE8A */ b .L802A9B74 -/* 11375C 802AA14C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA150 -/* 113760 802AA150 00023600 */ sll $a2, $v0, 0x18 -/* 113764 802AA154 0006C603 */ sra $t8, $a2, 0x18 -/* 113768 802AA158 03003025 */ move $a2, $t8 -/* 11376C 802AA15C 02202025 */ move $a0, $s1 -/* 113770 802AA160 0C0AA479 */ jal func_802A91E4 -/* 113774 802AA164 02002825 */ move $a1, $s0 -/* 113778 802AA168 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11377C 802AA16C 1000FE81 */ b .L802A9B74 -/* 113780 802AA170 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA174 -/* 113784 802AA174 00023600 */ sll $a2, $v0, 0x18 -/* 113788 802AA178 0006CE03 */ sra $t9, $a2, 0x18 -/* 11378C 802AA17C 03203025 */ move $a2, $t9 -/* 113790 802AA180 02202025 */ move $a0, $s1 -/* 113794 802AA184 0C0AA479 */ jal func_802A91E4 -/* 113798 802AA188 02002825 */ move $a1, $s0 -/* 11379C 802AA18C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1137A0 802AA190 1000FE78 */ b .L802A9B74 -/* 1137A4 802AA194 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA198 -/* 1137A8 802AA198 00023600 */ sll $a2, $v0, 0x18 -/* 1137AC 802AA19C 00064603 */ sra $t0, $a2, 0x18 -/* 1137B0 802AA1A0 01003025 */ move $a2, $t0 -/* 1137B4 802AA1A4 02202025 */ move $a0, $s1 -/* 1137B8 802AA1A8 0C0AA536 */ jal func_802A94D8 -/* 1137BC 802AA1AC 02002825 */ move $a1, $s0 -/* 1137C0 802AA1B0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1137C4 802AA1B4 1000FE6F */ b .L802A9B74 -/* 1137C8 802AA1B8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA1BC -/* 1137CC 802AA1BC 00023600 */ sll $a2, $v0, 0x18 -/* 1137D0 802AA1C0 00064E03 */ sra $t1, $a2, 0x18 -/* 1137D4 802AA1C4 01203025 */ move $a2, $t1 -/* 1137D8 802AA1C8 02202025 */ move $a0, $s1 -/* 1137DC 802AA1CC 0C0AA551 */ jal func_802A9544 -/* 1137E0 802AA1D0 02002825 */ move $a1, $s0 -/* 1137E4 802AA1D4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1137E8 802AA1D8 1000FE66 */ b .L802A9B74 -/* 1137EC 802AA1DC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA1E0 -/* 1137F0 802AA1E0 00023600 */ sll $a2, $v0, 0x18 -/* 1137F4 802AA1E4 00065603 */ sra $t2, $a2, 0x18 -/* 1137F8 802AA1E8 01403025 */ move $a2, $t2 -/* 1137FC 802AA1EC 02202025 */ move $a0, $s1 -/* 113800 802AA1F0 0C0AA56C */ jal func_802A95B0 -/* 113804 802AA1F4 02002825 */ move $a1, $s0 -/* 113808 802AA1F8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11380C 802AA1FC 1000FE5D */ b .L802A9B74 -/* 113810 802AA200 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA204 -/* 113814 802AA204 00023600 */ sll $a2, $v0, 0x18 -/* 113818 802AA208 00065E03 */ sra $t3, $a2, 0x18 -/* 11381C 802AA20C 01603025 */ move $a2, $t3 -/* 113820 802AA210 02202025 */ move $a0, $s1 -/* 113824 802AA214 0C0AA59D */ jal func_802A9674 -/* 113828 802AA218 02002825 */ move $a1, $s0 -/* 11382C 802AA21C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113830 802AA220 1000FE54 */ b .L802A9B74 -/* 113834 802AA224 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA228 -/* 113838 802AA228 00023600 */ sll $a2, $v0, 0x18 -/* 11383C 802AA22C 00066603 */ sra $t4, $a2, 0x18 -/* 113840 802AA230 01803025 */ move $a2, $t4 -/* 113844 802AA234 02202025 */ move $a0, $s1 -/* 113848 802AA238 0C0AA59D */ jal func_802A9674 -/* 11384C 802AA23C 02002825 */ move $a1, $s0 -/* 113850 802AA240 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113854 802AA244 1000FE4B */ b .L802A9B74 -/* 113858 802AA248 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA24C -/* 11385C 802AA24C 00023600 */ sll $a2, $v0, 0x18 -/* 113860 802AA250 00066E03 */ sra $t5, $a2, 0x18 -/* 113864 802AA254 01A03025 */ move $a2, $t5 -/* 113868 802AA258 02202025 */ move $a0, $s1 -/* 11386C 802AA25C 0C0AA59D */ jal func_802A9674 -/* 113870 802AA260 02002825 */ move $a1, $s0 -/* 113874 802AA264 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113878 802AA268 1000FE42 */ b .L802A9B74 -/* 11387C 802AA26C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA270 -/* 113880 802AA270 00023600 */ sll $a2, $v0, 0x18 -/* 113884 802AA274 00067603 */ sra $t6, $a2, 0x18 -/* 113888 802AA278 01C03025 */ move $a2, $t6 -/* 11388C 802AA27C 02202025 */ move $a0, $s1 -/* 113890 802AA280 0C0AA59D */ jal func_802A9674 -/* 113894 802AA284 02002825 */ move $a1, $s0 -/* 113898 802AA288 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11389C 802AA28C 1000FE39 */ b .L802A9B74 -/* 1138A0 802AA290 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA294 -/* 1138A4 802AA294 00023600 */ sll $a2, $v0, 0x18 -/* 1138A8 802AA298 00067E03 */ sra $t7, $a2, 0x18 -/* 1138AC 802AA29C 01E03025 */ move $a2, $t7 -/* 1138B0 802AA2A0 02202025 */ move $a0, $s1 -/* 1138B4 802AA2A4 0C0AA59D */ jal func_802A9674 -/* 1138B8 802AA2A8 02002825 */ move $a1, $s0 -/* 1138BC 802AA2AC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1138C0 802AA2B0 1000FE30 */ b .L802A9B74 -/* 1138C4 802AA2B4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA2B8 -/* 1138C8 802AA2B8 00023600 */ sll $a2, $v0, 0x18 -/* 1138CC 802AA2BC 0006C603 */ sra $t8, $a2, 0x18 -/* 1138D0 802AA2C0 03003025 */ move $a2, $t8 -/* 1138D4 802AA2C4 02202025 */ move $a0, $s1 -/* 1138D8 802AA2C8 0C0AA59D */ jal func_802A9674 -/* 1138DC 802AA2CC 02002825 */ move $a1, $s0 -/* 1138E0 802AA2D0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1138E4 802AA2D4 1000FE27 */ b .L802A9B74 -/* 1138E8 802AA2D8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA2DC -/* 1138EC 802AA2DC 00023600 */ sll $a2, $v0, 0x18 -/* 1138F0 802AA2E0 0006CE03 */ sra $t9, $a2, 0x18 -/* 1138F4 802AA2E4 03203025 */ move $a2, $t9 -/* 1138F8 802AA2E8 02202025 */ move $a0, $s1 -/* 1138FC 802AA2EC 0C0AA59D */ jal func_802A9674 -/* 113900 802AA2F0 02002825 */ move $a1, $s0 -/* 113904 802AA2F4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113908 802AA2F8 1000FE1E */ b .L802A9B74 -/* 11390C 802AA2FC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA300 -/* 113910 802AA300 00023600 */ sll $a2, $v0, 0x18 -/* 113914 802AA304 00064603 */ sra $t0, $a2, 0x18 -/* 113918 802AA308 01003025 */ move $a2, $t0 -/* 11391C 802AA30C 02202025 */ move $a0, $s1 -/* 113920 802AA310 0C0AA59D */ jal func_802A9674 -/* 113924 802AA314 02002825 */ move $a1, $s0 -/* 113928 802AA318 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 11392C 802AA31C 1000FE15 */ b .L802A9B74 -/* 113930 802AA320 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA324 -/* 113934 802AA324 00023600 */ sll $a2, $v0, 0x18 -/* 113938 802AA328 00064E03 */ sra $t1, $a2, 0x18 -/* 11393C 802AA32C 01203025 */ move $a2, $t1 -/* 113940 802AA330 02202025 */ move $a0, $s1 -/* 113944 802AA334 0C0AA59D */ jal func_802A9674 -/* 113948 802AA338 02002825 */ move $a1, $s0 -/* 11394C 802AA33C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113950 802AA340 1000FE0C */ b .L802A9B74 -/* 113954 802AA344 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA348 -/* 113958 802AA348 00023600 */ sll $a2, $v0, 0x18 -/* 11395C 802AA34C 00065603 */ sra $t2, $a2, 0x18 -/* 113960 802AA350 01403025 */ move $a2, $t2 -/* 113964 802AA354 02202025 */ move $a0, $s1 -/* 113968 802AA358 0C0AA59D */ jal func_802A9674 -/* 11396C 802AA35C 02002825 */ move $a1, $s0 -/* 113970 802AA360 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113974 802AA364 1000FE03 */ b .L802A9B74 -/* 113978 802AA368 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA36C -/* 11397C 802AA36C 00023600 */ sll $a2, $v0, 0x18 -/* 113980 802AA370 00065E03 */ sra $t3, $a2, 0x18 -/* 113984 802AA374 01603025 */ move $a2, $t3 -/* 113988 802AA378 02202025 */ move $a0, $s1 -/* 11398C 802AA37C 0C0AA59D */ jal func_802A9674 -/* 113990 802AA380 02002825 */ move $a1, $s0 -/* 113994 802AA384 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113998 802AA388 1000FDFA */ b .L802A9B74 -/* 11399C 802AA38C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA390 -/* 1139A0 802AA390 00023600 */ sll $a2, $v0, 0x18 -/* 1139A4 802AA394 00066603 */ sra $t4, $a2, 0x18 -/* 1139A8 802AA398 01803025 */ move $a2, $t4 -/* 1139AC 802AA39C 02202025 */ move $a0, $s1 -/* 1139B0 802AA3A0 0C0AA59D */ jal func_802A9674 -/* 1139B4 802AA3A4 02002825 */ move $a1, $s0 -/* 1139B8 802AA3A8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1139BC 802AA3AC 1000FDF1 */ b .L802A9B74 -/* 1139C0 802AA3B0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA3B4 -/* 1139C4 802AA3B4 00023600 */ sll $a2, $v0, 0x18 -/* 1139C8 802AA3B8 00066E03 */ sra $t5, $a2, 0x18 -/* 1139CC 802AA3BC 01A03025 */ move $a2, $t5 -/* 1139D0 802AA3C0 02202025 */ move $a0, $s1 -/* 1139D4 802AA3C4 0C0AA59D */ jal func_802A9674 -/* 1139D8 802AA3C8 02002825 */ move $a1, $s0 -/* 1139DC 802AA3CC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 1139E0 802AA3D0 1000FDE8 */ b .L802A9B74 -/* 1139E4 802AA3D4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA3D8 -/* 1139E8 802AA3D8 00023600 */ sll $a2, $v0, 0x18 -/* 1139EC 802AA3DC 00067603 */ sra $t6, $a2, 0x18 -/* 1139F0 802AA3E0 01C03025 */ move $a2, $t6 -/* 1139F4 802AA3E4 02202025 */ move $a0, $s1 -/* 1139F8 802AA3E8 0C0AA59D */ jal func_802A9674 -/* 1139FC 802AA3EC 02002825 */ move $a1, $s0 -/* 113A00 802AA3F0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113A04 802AA3F4 1000FDDF */ b .L802A9B74 -/* 113A08 802AA3F8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA3FC -/* 113A0C 802AA3FC 00023600 */ sll $a2, $v0, 0x18 -/* 113A10 802AA400 00067E03 */ sra $t7, $a2, 0x18 -/* 113A14 802AA404 01E03025 */ move $a2, $t7 -/* 113A18 802AA408 02202025 */ move $a0, $s1 -/* 113A1C 802AA40C 0C0AA59D */ jal func_802A9674 -/* 113A20 802AA410 02002825 */ move $a1, $s0 -/* 113A24 802AA414 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113A28 802AA418 1000FDD6 */ b .L802A9B74 -/* 113A2C 802AA41C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA420 -/* 113A30 802AA420 00023600 */ sll $a2, $v0, 0x18 -/* 113A34 802AA424 0006C603 */ sra $t8, $a2, 0x18 -/* 113A38 802AA428 03003025 */ move $a2, $t8 -/* 113A3C 802AA42C 02202025 */ move $a0, $s1 -/* 113A40 802AA430 0C0AA59D */ jal func_802A9674 -/* 113A44 802AA434 02002825 */ move $a1, $s0 -/* 113A48 802AA438 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113A4C 802AA43C 1000FDCD */ b .L802A9B74 -/* 113A50 802AA440 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA444 -/* 113A54 802AA444 00023600 */ sll $a2, $v0, 0x18 -/* 113A58 802AA448 0006CE03 */ sra $t9, $a2, 0x18 -/* 113A5C 802AA44C 03203025 */ move $a2, $t9 -/* 113A60 802AA450 02202025 */ move $a0, $s1 -/* 113A64 802AA454 0C0AA59D */ jal func_802A9674 -/* 113A68 802AA458 02002825 */ move $a1, $s0 -/* 113A6C 802AA45C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113A70 802AA460 1000FDC4 */ b .L802A9B74 -/* 113A74 802AA464 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA468 -/* 113A78 802AA468 00023600 */ sll $a2, $v0, 0x18 -/* 113A7C 802AA46C 00064603 */ sra $t0, $a2, 0x18 -/* 113A80 802AA470 01003025 */ move $a2, $t0 -/* 113A84 802AA474 02202025 */ move $a0, $s1 -/* 113A88 802AA478 0C0AA59D */ jal func_802A9674 -/* 113A8C 802AA47C 02002825 */ move $a1, $s0 -/* 113A90 802AA480 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113A94 802AA484 1000FDBB */ b .L802A9B74 -/* 113A98 802AA488 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA48C -/* 113A9C 802AA48C 00023600 */ sll $a2, $v0, 0x18 -/* 113AA0 802AA490 00064E03 */ sra $t1, $a2, 0x18 -/* 113AA4 802AA494 01203025 */ move $a2, $t1 -/* 113AA8 802AA498 02202025 */ move $a0, $s1 -/* 113AAC 802AA49C 0C0AA59D */ jal func_802A9674 -/* 113AB0 802AA4A0 02002825 */ move $a1, $s0 -/* 113AB4 802AA4A4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113AB8 802AA4A8 1000FDB2 */ b .L802A9B74 -/* 113ABC 802AA4AC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA4B0 -/* 113AC0 802AA4B0 00023600 */ sll $a2, $v0, 0x18 -/* 113AC4 802AA4B4 00065603 */ sra $t2, $a2, 0x18 -/* 113AC8 802AA4B8 01403025 */ move $a2, $t2 -/* 113ACC 802AA4BC 02202025 */ move $a0, $s1 -/* 113AD0 802AA4C0 0C0AA59D */ jal func_802A9674 -/* 113AD4 802AA4C4 02002825 */ move $a1, $s0 -/* 113AD8 802AA4C8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113ADC 802AA4CC 1000FDA9 */ b .L802A9B74 -/* 113AE0 802AA4D0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA4D4 -/* 113AE4 802AA4D4 00023600 */ sll $a2, $v0, 0x18 -/* 113AE8 802AA4D8 00065E03 */ sra $t3, $a2, 0x18 -/* 113AEC 802AA4DC 01603025 */ move $a2, $t3 -/* 113AF0 802AA4E0 02202025 */ move $a0, $s1 -/* 113AF4 802AA4E4 0C0AA59D */ jal func_802A9674 -/* 113AF8 802AA4E8 02002825 */ move $a1, $s0 -/* 113AFC 802AA4EC 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113B00 802AA4F0 1000FDA0 */ b .L802A9B74 -/* 113B04 802AA4F4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA4F8 -/* 113B08 802AA4F8 00023600 */ sll $a2, $v0, 0x18 -/* 113B0C 802AA4FC 00066603 */ sra $t4, $a2, 0x18 -/* 113B10 802AA500 01803025 */ move $a2, $t4 -/* 113B14 802AA504 02202025 */ move $a0, $s1 -/* 113B18 802AA508 0C0AA59D */ jal func_802A9674 -/* 113B1C 802AA50C 02002825 */ move $a1, $s0 -/* 113B20 802AA510 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113B24 802AA514 1000FD97 */ b .L802A9B74 -/* 113B28 802AA518 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA51C -/* 113B2C 802AA51C 00023600 */ sll $a2, $v0, 0x18 -/* 113B30 802AA520 00066E03 */ sra $t5, $a2, 0x18 -/* 113B34 802AA524 01A03025 */ move $a2, $t5 -/* 113B38 802AA528 02202025 */ move $a0, $s1 -/* 113B3C 802AA52C 0C0AA59D */ jal func_802A9674 -/* 113B40 802AA530 02002825 */ move $a1, $s0 -/* 113B44 802AA534 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113B48 802AA538 1000FD8E */ b .L802A9B74 -/* 113B4C 802AA53C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA540 -/* 113B50 802AA540 00023600 */ sll $a2, $v0, 0x18 -/* 113B54 802AA544 00067603 */ sra $t6, $a2, 0x18 -/* 113B58 802AA548 01C03025 */ move $a2, $t6 -/* 113B5C 802AA54C 02202025 */ move $a0, $s1 -/* 113B60 802AA550 0C0AA59D */ jal func_802A9674 -/* 113B64 802AA554 02002825 */ move $a1, $s0 -/* 113B68 802AA558 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113B6C 802AA55C 1000FD85 */ b .L802A9B74 -/* 113B70 802AA560 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA564 -/* 113B74 802AA564 00023600 */ sll $a2, $v0, 0x18 -/* 113B78 802AA568 00067E03 */ sra $t7, $a2, 0x18 -/* 113B7C 802AA56C 01E03025 */ move $a2, $t7 -/* 113B80 802AA570 02202025 */ move $a0, $s1 -/* 113B84 802AA574 0C0AA59D */ jal func_802A9674 -/* 113B88 802AA578 02002825 */ move $a1, $s0 -/* 113B8C 802AA57C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113B90 802AA580 1000FD7C */ b .L802A9B74 -/* 113B94 802AA584 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA588 -/* 113B98 802AA588 00023600 */ sll $a2, $v0, 0x18 -/* 113B9C 802AA58C 0006C603 */ sra $t8, $a2, 0x18 -/* 113BA0 802AA590 03003025 */ move $a2, $t8 -/* 113BA4 802AA594 02202025 */ move $a0, $s1 -/* 113BA8 802AA598 0C0AA59D */ jal func_802A9674 -/* 113BAC 802AA59C 02002825 */ move $a1, $s0 -/* 113BB0 802AA5A0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113BB4 802AA5A4 1000FD73 */ b .L802A9B74 -/* 113BB8 802AA5A8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA5AC -/* 113BBC 802AA5AC 00023600 */ sll $a2, $v0, 0x18 -/* 113BC0 802AA5B0 0006CE03 */ sra $t9, $a2, 0x18 -/* 113BC4 802AA5B4 03203025 */ move $a2, $t9 -/* 113BC8 802AA5B8 02202025 */ move $a0, $s1 -/* 113BCC 802AA5BC 0C0AA59D */ jal func_802A9674 -/* 113BD0 802AA5C0 02002825 */ move $a1, $s0 -/* 113BD4 802AA5C4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113BD8 802AA5C8 1000FD6A */ b .L802A9B74 -/* 113BDC 802AA5CC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA5D0 -/* 113BE0 802AA5D0 00023600 */ sll $a2, $v0, 0x18 -/* 113BE4 802AA5D4 00064603 */ sra $t0, $a2, 0x18 -/* 113BE8 802AA5D8 01003025 */ move $a2, $t0 -/* 113BEC 802AA5DC 02202025 */ move $a0, $s1 -/* 113BF0 802AA5E0 0C0AA59D */ jal func_802A9674 -/* 113BF4 802AA5E4 02002825 */ move $a1, $s0 -/* 113BF8 802AA5E8 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113BFC 802AA5EC 1000FD61 */ b .L802A9B74 -/* 113C00 802AA5F0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA5F4 -/* 113C04 802AA5F4 00023600 */ sll $a2, $v0, 0x18 -/* 113C08 802AA5F8 00064E03 */ sra $t1, $a2, 0x18 -/* 113C0C 802AA5FC 01203025 */ move $a2, $t1 -/* 113C10 802AA600 02202025 */ move $a0, $s1 -/* 113C14 802AA604 0C0AA59D */ jal func_802A9674 -/* 113C18 802AA608 02002825 */ move $a1, $s0 -/* 113C1C 802AA60C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113C20 802AA610 1000FD58 */ b .L802A9B74 -/* 113C24 802AA614 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA618 -/* 113C28 802AA618 00023600 */ sll $a2, $v0, 0x18 -/* 113C2C 802AA61C 00065603 */ sra $t2, $a2, 0x18 -/* 113C30 802AA620 01403025 */ move $a2, $t2 -/* 113C34 802AA624 02202025 */ move $a0, $s1 -/* 113C38 802AA628 0C0AA59D */ jal func_802A9674 -/* 113C3C 802AA62C 02002825 */ move $a1, $s0 -/* 113C40 802AA630 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113C44 802AA634 1000FD4F */ b .L802A9B74 -/* 113C48 802AA638 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA63C -/* 113C4C 802AA63C 00023600 */ sll $a2, $v0, 0x18 -/* 113C50 802AA640 00065E03 */ sra $t3, $a2, 0x18 -/* 113C54 802AA644 01603025 */ move $a2, $t3 -/* 113C58 802AA648 02202025 */ move $a0, $s1 -/* 113C5C 802AA64C 0C0AA59D */ jal func_802A9674 -/* 113C60 802AA650 02002825 */ move $a1, $s0 -/* 113C64 802AA654 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113C68 802AA658 1000FD46 */ b .L802A9B74 -/* 113C6C 802AA65C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA660 -/* 113C70 802AA660 00023600 */ sll $a2, $v0, 0x18 -/* 113C74 802AA664 00066603 */ sra $t4, $a2, 0x18 -/* 113C78 802AA668 01803025 */ move $a2, $t4 -/* 113C7C 802AA66C 02202025 */ move $a0, $s1 -/* 113C80 802AA670 0C0AA59D */ jal func_802A9674 -/* 113C84 802AA674 02002825 */ move $a1, $s0 -/* 113C88 802AA678 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113C8C 802AA67C 1000FD3D */ b .L802A9B74 -/* 113C90 802AA680 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA684 -/* 113C94 802AA684 00023600 */ sll $a2, $v0, 0x18 -/* 113C98 802AA688 00066E03 */ sra $t5, $a2, 0x18 -/* 113C9C 802AA68C 01A03025 */ move $a2, $t5 -/* 113CA0 802AA690 02202025 */ move $a0, $s1 -/* 113CA4 802AA694 0C0AA5C5 */ jal func_802A9714 -/* 113CA8 802AA698 02002825 */ move $a1, $s0 -/* 113CAC 802AA69C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113CB0 802AA6A0 1000FD34 */ b .L802A9B74 -/* 113CB4 802AA6A4 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA6A8 -/* 113CB8 802AA6A8 00023600 */ sll $a2, $v0, 0x18 -/* 113CBC 802AA6AC 00067603 */ sra $t6, $a2, 0x18 -/* 113CC0 802AA6B0 01C03025 */ move $a2, $t6 -/* 113CC4 802AA6B4 02202025 */ move $a0, $s1 -/* 113CC8 802AA6B8 0C0AA603 */ jal func_802A980C -/* 113CCC 802AA6BC 02002825 */ move $a1, $s0 -/* 113CD0 802AA6C0 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113CD4 802AA6C4 1000FD2B */ b .L802A9B74 -/* 113CD8 802AA6C8 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA6CC -/* 113CDC 802AA6CC 00023600 */ sll $a2, $v0, 0x18 -/* 113CE0 802AA6D0 00067E03 */ sra $t7, $a2, 0x18 -/* 113CE4 802AA6D4 01E03025 */ move $a2, $t7 -/* 113CE8 802AA6D8 02202025 */ move $a0, $s1 -/* 113CEC 802AA6DC 0C0AA669 */ jal func_802A99A4 -/* 113CF0 802AA6E0 02002825 */ move $a1, $s0 -/* 113CF4 802AA6E4 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113CF8 802AA6E8 1000FD22 */ b .L802A9B74 -/* 113CFC 802AA6EC 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA6F0 -/* 113D00 802AA6F0 00023600 */ sll $a2, $v0, 0x18 -/* 113D04 802AA6F4 0006C603 */ sra $t8, $a2, 0x18 -/* 113D08 802AA6F8 03003025 */ move $a2, $t8 -/* 113D0C 802AA6FC 02202025 */ move $a0, $s1 -/* 113D10 802AA700 0C0AA2B7 */ jal func_802A8ADC -/* 113D14 802AA704 02002825 */ move $a1, $s0 -/* 113D18 802AA708 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113D1C 802AA70C 1000FD19 */ b .L802A9B74 -/* 113D20 802AA710 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA714 -/* 113D24 802AA714 00023600 */ sll $a2, $v0, 0x18 -/* 113D28 802AA718 0006CE03 */ sra $t9, $a2, 0x18 -/* 113D2C 802AA71C 03203025 */ move $a2, $t9 -/* 113D30 802AA720 02202025 */ move $a0, $s1 -/* 113D34 802AA724 0C0AA270 */ jal func_802A89C0 -/* 113D38 802AA728 02002825 */ move $a1, $s0 -/* 113D3C 802AA72C 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113D40 802AA730 1000FD10 */ b .L802A9B74 -/* 113D44 802AA734 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA738 -/* 113D48 802AA738 00023600 */ sll $a2, $v0, 0x18 -/* 113D4C 802AA73C 00064603 */ sra $t0, $a2, 0x18 -/* 113D50 802AA740 01003025 */ move $a2, $t0 -/* 113D54 802AA744 02202025 */ move $a0, $s1 -/* 113D58 802AA748 0C0AA281 */ jal func_802A8A04 -/* 113D5C 802AA74C 02002825 */ move $a1, $s0 -/* 113D60 802AA750 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113D64 802AA754 1000FD07 */ b .L802A9B74 -/* 113D68 802AA758 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA75C -/* 113D6C 802AA75C 00023600 */ sll $a2, $v0, 0x18 -/* 113D70 802AA760 00064E03 */ sra $t1, $a2, 0x18 -/* 113D74 802AA764 01203025 */ move $a2, $t1 -/* 113D78 802AA768 02202025 */ move $a0, $s1 -/* 113D7C 802AA76C 0C0AA29C */ jal func_802A8A70 -/* 113D80 802AA770 02002825 */ move $a1, $s0 -/* 113D84 802AA774 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113D88 802AA778 1000FCFE */ b .L802A9B74 -/* 113D8C 802AA77C 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -glabel L802AA780 -/* 113D90 802AA780 00023600 */ sll $a2, $v0, 0x18 -/* 113D94 802AA784 00065603 */ sra $t2, $a2, 0x18 -/* 113D98 802AA788 01403025 */ move $a2, $t2 -/* 113D9C 802AA78C 02202025 */ move $a0, $s1 -/* 113DA0 802AA790 0C0AA250 */ jal func_802A8940 -/* 113DA4 802AA794 02002825 */ move $a1, $s0 -/* 113DA8 802AA798 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 113DAC 802AA79C 1000FCF5 */ b .L802A9B74 -/* 113DB0 802AA7A0 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -.L802AA7A4: -/* 113DB4 802AA7A4 24040007 */ li $a0, 7 -/* 113DB8 802AA7A8 0C0A9EE5 */ jal set_segment_base_addr -/* 113DBC 802AA7AC 8FA5002C */ lw $a1, 0x2c($sp) -/* 113DC0 802AA7B0 8FBF0024 */ lw $ra, 0x24($sp) -/* 113DC4 802AA7B4 8FB00018 */ lw $s0, 0x18($sp) -/* 113DC8 802AA7B8 8FB1001C */ lw $s1, 0x1c($sp) -/* 113DCC 802AA7BC 8FB20020 */ lw $s2, 0x20($sp) -/* 113DD0 802AA7C0 03E00008 */ jr $ra -/* 113DD4 802AA7C4 27BD0040 */ addiu $sp, $sp, 0x40 diff --git a/asm/non_matchings/memory/func_802A86A8.s b/asm/non_matchings/memory/func_802A86A8.s deleted file mode 100644 index 2f0948dd4..000000000 --- a/asm/non_matchings/memory/func_802A86A8.s +++ /dev/null @@ -1,69 +0,0 @@ -glabel func_802A86A8 -/* 111CB8 802A86A8 3C078016 */ lui $a3, %hi(gHeapEndPtr) # $a3, 0x8016 -/* 111CBC 802A86AC 24E7F72C */ addiu $a3, %lo(gHeapEndPtr) # addiu $a3, $a3, -0x8d4 -/* 111CC0 802A86B0 8CEE0000 */ lw $t6, ($a3) -/* 111CC4 802A86B4 00057900 */ sll $t7, $a1, 4 -/* 111CC8 802A86B8 25F8000F */ addiu $t8, $t7, 0xf -/* 111CCC 802A86BC 2401FFF0 */ li $at, -16 -/* 111CD0 802A86C0 0301C824 */ and $t9, $t8, $at -/* 111CD4 802A86C4 01D91823 */ subu $v1, $t6, $t9 -/* 111CD8 802A86C8 00801025 */ move $v0, $a0 -/* 111CDC 802A86CC ACE30000 */ sw $v1, ($a3) -/* 111CE0 802A86D0 10A00033 */ beqz $a1, .L802A87A0 -/* 111CE4 802A86D4 00003025 */ move $a2, $zero -/* 111CE8 802A86D8 3C09800E */ lui $t1, %hi(D_800DC608) # $t1, 0x800e -/* 111CEC 802A86DC 3C08800E */ lui $t0, %hi(gIsMirrorMode) # $t0, 0x800e -/* 111CF0 802A86E0 2508C604 */ addiu $t0, %lo(gIsMirrorMode) # addiu $t0, $t0, -0x39fc -/* 111CF4 802A86E4 2529C608 */ addiu $t1, %lo(D_800DC608) # addiu $t1, $t1, -0x39f8 -/* 111CF8 802A86E8 240A00FF */ li $t2, 255 -.L802A86EC: -/* 111CFC 802A86EC 8D0C0000 */ lw $t4, ($t0) -/* 111D00 802A86F0 51800006 */ beql $t4, $zero, .L802A870C -/* 111D04 802A86F4 84580000 */ lh $t8, ($v0) -/* 111D08 802A86F8 844D0000 */ lh $t5, ($v0) -/* 111D0C 802A86FC 000D7823 */ negu $t7, $t5 -/* 111D10 802A8700 10000003 */ b .L802A8710 -/* 111D14 802A8704 A46F0000 */ sh $t7, ($v1) -/* 111D18 802A8708 84580000 */ lh $t8, ($v0) -.L802A870C: -/* 111D1C 802A870C A4780000 */ sh $t8, ($v1) -.L802A8710: -/* 111D20 802A8710 844E0002 */ lh $t6, 2($v0) -/* 111D24 802A8714 C5280000 */ lwc1 $f8, ($t1) -/* 111D28 802A8718 24C60001 */ addiu $a2, $a2, 1 -/* 111D2C 802A871C 448E2000 */ mtc1 $t6, $f4 -/* 111D30 802A8720 00C5082B */ sltu $at, $a2, $a1 -/* 111D34 802A8724 24630010 */ addiu $v1, $v1, 0x10 -/* 111D38 802A8728 468021A0 */ cvt.s.w $f6, $f4 -/* 111D3C 802A872C 2442000E */ addiu $v0, $v0, 0xe -/* 111D40 802A8730 46083282 */ mul.s $f10, $f6, $f8 -/* 111D44 802A8734 4600540D */ trunc.w.s $f16, $f10 -/* 111D48 802A8738 440B8000 */ mfc1 $t3, $f16 -/* 111D4C 802A873C 00000000 */ nop -/* 111D50 802A8740 A46BFFF2 */ sh $t3, -0xe($v1) -/* 111D54 802A8744 844CFFF6 */ lh $t4, -0xa($v0) -/* 111D58 802A8748 8044FFFC */ lb $a0, -4($v0) -/* 111D5C 802A874C 8047FFFD */ lb $a3, -3($v0) -/* 111D60 802A8750 A46CFFF4 */ sh $t4, -0xc($v1) -/* 111D64 802A8754 844DFFF8 */ lh $t5, -8($v0) -/* 111D68 802A8758 309800FC */ andi $t8, $a0, 0xfc -/* 111D6C 802A875C 30EE00FC */ andi $t6, $a3, 0xfc -/* 111D70 802A8760 A46DFFF8 */ sh $t5, -8($v1) -/* 111D74 802A8764 844FFFFA */ lh $t7, -6($v0) -/* 111D78 802A8768 A078FFFC */ sb $t8, -4($v1) -/* 111D7C 802A876C A06EFFFD */ sb $t6, -3($v1) -/* 111D80 802A8770 A46FFFFA */ sh $t7, -6($v1) -/* 111D84 802A8774 8059FFFE */ lb $t9, -2($v0) -/* 111D88 802A8778 00077880 */ sll $t7, $a3, 2 -/* 111D8C 802A877C 31F8000C */ andi $t8, $t7, 0xc -/* 111D90 802A8780 308D0003 */ andi $t5, $a0, 3 -/* 111D94 802A8784 01B87025 */ or $t6, $t5, $t8 -/* 111D98 802A8788 A079FFFE */ sb $t9, -2($v1) -/* 111D9C 802A878C 000ECE00 */ sll $t9, $t6, 0x18 -/* 111DA0 802A8790 00195E03 */ sra $t3, $t9, 0x18 -/* 111DA4 802A8794 A46BFFF6 */ sh $t3, -0xa($v1) -/* 111DA8 802A8798 1420FFD4 */ bnez $at, .L802A86EC -/* 111DAC 802A879C A06AFFFF */ sb $t2, -1($v1) -.L802A87A0: -/* 111DB0 802A87A0 03E00008 */ jr $ra -/* 111DB4 802A87A4 00000000 */ nop diff --git a/asm/non_matchings/memory/func_802A884C.s b/asm/non_matchings/memory/func_802A884C.s deleted file mode 100644 index 950fc3948..000000000 --- a/asm/non_matchings/memory/func_802A884C.s +++ /dev/null @@ -1,62 +0,0 @@ -glabel func_802A884C -/* 111E5C 802A884C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 111E60 802A8850 3C19802C */ lui $t9, %hi(D_802B8CE8) # $t9, 0x802c -/* 111E64 802A8854 AFA5001C */ sw $a1, 0x1c($sp) -/* 111E68 802A8858 AFA60020 */ sw $a2, 0x20($sp) -/* 111E6C 802A885C 27398CE8 */ addiu $t9, %lo(D_802B8CE8) # addiu $t9, $t9, -0x7318 -/* 111E70 802A8860 8F210000 */ lw $at, ($t9) -/* 111E74 802A8864 8F2A0004 */ lw $t2, 4($t9) -/* 111E78 802A8868 27B80000 */ addiu $t8, $sp, 0 -/* 111E7C 802A886C 3C03802C */ lui $v1, %hi(D_802BA270) # $v1, 0x802c -/* 111E80 802A8870 2463A270 */ addiu $v1, %lo(D_802BA270) # addiu $v1, $v1, -0x5d90 -/* 111E84 802A8874 AF010000 */ sw $at, ($t8) -/* 111E88 802A8878 AF0A0004 */ sw $t2, 4($t8) -/* 111E8C 802A887C 8C6C0000 */ lw $t4, ($v1) -/* 111E90 802A8880 8FAB0000 */ lw $t3, ($sp) -/* 111E94 802A8884 00067600 */ sll $t6, $a2, 0x18 -/* 111E98 802A8888 000E3603 */ sra $a2, $t6, 0x18 -/* 111E9C 802A888C 000C68C0 */ sll $t5, $t4, 3 -/* 111EA0 802A8890 008D7021 */ addu $t6, $a0, $t5 -/* 111EA4 802A8894 ADCB0000 */ sw $t3, ($t6) -/* 111EA8 802A8898 8C690000 */ lw $t1, ($v1) -/* 111EAC 802A889C 8FAF0004 */ lw $t7, 4($sp) -/* 111EB0 802A88A0 3C0C0386 */ lui $t4, (0x03860010 >> 16) # lui $t4, 0x386 -/* 111EB4 802A88A4 000940C0 */ sll $t0, $t1, 3 -/* 111EB8 802A88A8 0088C021 */ addu $t8, $a0, $t0 -/* 111EBC 802A88AC AF0F0004 */ sw $t7, 4($t8) -/* 111EC0 802A88B0 8C790000 */ lw $t9, ($v1) -/* 111EC4 802A88B4 358C0010 */ ori $t4, (0x03860010 & 0xFFFF) # ori $t4, $t4, 0x10 -/* 111EC8 802A88B8 00061080 */ sll $v0, $a2, 2 -/* 111ECC 802A88BC 272A0001 */ addiu $t2, $t9, 1 -/* 111ED0 802A88C0 000A58C0 */ sll $t3, $t2, 3 -/* 111ED4 802A88C4 AC6A0000 */ sw $t2, ($v1) -/* 111ED8 802A88C8 008B7021 */ addu $t6, $a0, $t3 -/* 111EDC 802A88CC ADCC0000 */ sw $t4, ($t6) -/* 111EE0 802A88D0 8C680000 */ lw $t0, ($v1) -/* 111EE4 802A88D4 00461023 */ subu $v0, $v0, $a2 -/* 111EE8 802A88D8 3C010900 */ lui $at, (0x09000008 >> 16) # lui $at, 0x900 -/* 111EEC 802A88DC 34210008 */ ori $at, (0x09000008 & 0xFFFF) # ori $at, $at, 8 -/* 111EF0 802A88E0 000210C0 */ sll $v0, $v0, 3 -/* 111EF4 802A88E4 000878C0 */ sll $t7, $t0, 3 -/* 111EF8 802A88E8 008FC021 */ addu $t8, $a0, $t7 -/* 111EFC 802A88EC 00414821 */ addu $t1, $v0, $at -/* 111F00 802A88F0 AF090004 */ sw $t1, 4($t8) -/* 111F04 802A88F4 8C790000 */ lw $t9, ($v1) -/* 111F08 802A88F8 3C0D0388 */ lui $t5, (0x03880010 >> 16) # lui $t5, 0x388 -/* 111F0C 802A88FC 35AD0010 */ ori $t5, (0x03880010 & 0xFFFF) # ori $t5, $t5, 0x10 -/* 111F10 802A8900 272A0001 */ addiu $t2, $t9, 1 -/* 111F14 802A8904 000A60C0 */ sll $t4, $t2, 3 -/* 111F18 802A8908 AC6A0000 */ sw $t2, ($v1) -/* 111F1C 802A890C 008C7021 */ addu $t6, $a0, $t4 -/* 111F20 802A8910 ADCD0000 */ sw $t5, ($t6) -/* 111F24 802A8914 8C6F0000 */ lw $t7, ($v1) -/* 111F28 802A8918 3C010900 */ lui $at, 0x900 -/* 111F2C 802A891C 00414021 */ addu $t0, $v0, $at -/* 111F30 802A8920 000F48C0 */ sll $t1, $t7, 3 -/* 111F34 802A8924 0089C021 */ addu $t8, $a0, $t1 -/* 111F38 802A8928 AF080004 */ sw $t0, 4($t8) -/* 111F3C 802A892C 8C790000 */ lw $t9, ($v1) -/* 111F40 802A8930 27BD0018 */ addiu $sp, $sp, 0x18 -/* 111F44 802A8934 272A0001 */ addiu $t2, $t9, 1 -/* 111F48 802A8938 03E00008 */ jr $ra -/* 111F4C 802A893C AC6A0000 */ sw $t2, ($v1) diff --git a/asm/non_matchings/memory/func_802A8940.s b/asm/non_matchings/memory/func_802A8940.s deleted file mode 100644 index 02ec807bf..000000000 --- a/asm/non_matchings/memory/func_802A8940.s +++ /dev/null @@ -1,33 +0,0 @@ -glabel func_802A8940 -/* 111F50 802A8940 3C07802C */ lui $a3, %hi(D_802BA274) # $a3, 0x802c -/* 111F54 802A8944 24E7A274 */ addiu $a3, %lo(D_802BA274) # addiu $a3, $a3, -0x5d8c -/* 111F58 802A8948 8CE30000 */ lw $v1, ($a3) -/* 111F5C 802A894C 3C08802C */ lui $t0, %hi(D_802BA270) # $t0, 0x802c -/* 111F60 802A8950 2508A270 */ addiu $t0, %lo(D_802BA270) # addiu $t0, $t0, -0x5d90 -/* 111F64 802A8954 AFA60008 */ sw $a2, 8($sp) -/* 111F68 802A8958 00657021 */ addu $t6, $v1, $a1 -/* 111F6C 802A895C 246F0001 */ addiu $t7, $v1, 1 -/* 111F70 802A8960 91C20000 */ lbu $v0, ($t6) -/* 111F74 802A8964 8D0D0000 */ lw $t5, ($t0) -/* 111F78 802A8968 ACEF0000 */ sw $t7, ($a3) -/* 111F7C 802A896C 01E5C021 */ addu $t8, $t7, $a1 -/* 111F80 802A8970 93190000 */ lbu $t9, ($t8) -/* 111F84 802A8974 25EB0001 */ addiu $t3, $t7, 1 -/* 111F88 802A8978 000D70C0 */ sll $t6, $t5, 3 -/* 111F8C 802A897C ACEB0000 */ sw $t3, ($a3) -/* 111F90 802A8980 008E7821 */ addu $t7, $a0, $t6 -/* 111F94 802A8984 3C0C0600 */ lui $t4, 0x600 -/* 111F98 802A8988 ADEC0000 */ sw $t4, ($t7) -/* 111F9C 802A898C 00194A00 */ sll $t1, $t9, 8 -/* 111FA0 802A8990 8D190000 */ lw $t9, ($t0) -/* 111FA4 802A8994 01223025 */ or $a2, $t1, $v0 -/* 111FA8 802A8998 000650C0 */ sll $t2, $a2, 3 -/* 111FAC 802A899C 3C010700 */ lui $at, 0x700 -/* 111FB0 802A89A0 0141C021 */ addu $t8, $t2, $at -/* 111FB4 802A89A4 001948C0 */ sll $t1, $t9, 3 -/* 111FB8 802A89A8 00895021 */ addu $t2, $a0, $t1 -/* 111FBC 802A89AC AD580004 */ sw $t8, 4($t2) -/* 111FC0 802A89B0 8D0B0000 */ lw $t3, ($t0) -/* 111FC4 802A89B4 256D0001 */ addiu $t5, $t3, 1 -/* 111FC8 802A89B8 03E00008 */ jr $ra -/* 111FCC 802A89BC AD0D0000 */ sw $t5, ($t0) diff --git a/asm/non_matchings/memory/func_802A89C0.s b/asm/non_matchings/memory/func_802A89C0.s deleted file mode 100644 index 23b8b333b..000000000 --- a/asm/non_matchings/memory/func_802A89C0.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_802A89C0 -/* 111FD0 802A89C0 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 111FD4 802A89C4 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 111FD8 802A89C8 8C4F0000 */ lw $t7, ($v0) -/* 111FDC 802A89CC AFA50004 */ sw $a1, 4($sp) -/* 111FE0 802A89D0 AFA60008 */ sw $a2, 8($sp) -/* 111FE4 802A89D4 000FC0C0 */ sll $t8, $t7, 3 -/* 111FE8 802A89D8 0098C821 */ addu $t9, $a0, $t8 -/* 111FEC 802A89DC 3C0EB800 */ lui $t6, 0xb800 -/* 111FF0 802A89E0 AF2E0000 */ sw $t6, ($t9) -/* 111FF4 802A89E4 8C480000 */ lw $t0, ($v0) -/* 111FF8 802A89E8 000848C0 */ sll $t1, $t0, 3 -/* 111FFC 802A89EC 00895021 */ addu $t2, $a0, $t1 -/* 112000 802A89F0 AD400004 */ sw $zero, 4($t2) -/* 112004 802A89F4 8C4B0000 */ lw $t3, ($v0) -/* 112008 802A89F8 256C0001 */ addiu $t4, $t3, 1 -/* 11200C 802A89FC 03E00008 */ jr $ra -/* 112010 802A8A00 AC4C0000 */ sw $t4, ($v0) diff --git a/asm/non_matchings/memory/func_802A8A04.s b/asm/non_matchings/memory/func_802A8A04.s deleted file mode 100644 index c6306fed3..000000000 --- a/asm/non_matchings/memory/func_802A8A04.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8A04 -/* 112014 802A8A04 27BDFFF8 */ addiu $sp, $sp, -8 -/* 112018 802A8A08 3C0F802C */ lui $t7, %hi(D_802B8CF0) # $t7, 0x802c -/* 11201C 802A8A0C AFA5000C */ sw $a1, 0xc($sp) -/* 112020 802A8A10 AFA60010 */ sw $a2, 0x10($sp) -/* 112024 802A8A14 25EF8CF0 */ addiu $t7, %lo(D_802B8CF0) # addiu $t7, $t7, -0x7310 -/* 112028 802A8A18 8DE10000 */ lw $at, ($t7) -/* 11202C 802A8A1C 8DE80004 */ lw $t0, 4($t7) -/* 112030 802A8A20 27AE0000 */ addiu $t6, $sp, 0 -/* 112034 802A8A24 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112038 802A8A28 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 11203C 802A8A2C ADC10000 */ sw $at, ($t6) -/* 112040 802A8A30 ADC80004 */ sw $t0, 4($t6) -/* 112044 802A8A34 8C4A0000 */ lw $t2, ($v0) -/* 112048 802A8A38 8FA90000 */ lw $t1, ($sp) -/* 11204C 802A8A3C 000A58C0 */ sll $t3, $t2, 3 -/* 112050 802A8A40 008B6021 */ addu $t4, $a0, $t3 -/* 112054 802A8A44 AD890000 */ sw $t1, ($t4) -/* 112058 802A8A48 8C590000 */ lw $t9, ($v0) -/* 11205C 802A8A4C 8FAD0004 */ lw $t5, 4($sp) -/* 112060 802A8A50 0019C0C0 */ sll $t8, $t9, 3 -/* 112064 802A8A54 00987021 */ addu $t6, $a0, $t8 -/* 112068 802A8A58 ADCD0004 */ sw $t5, 4($t6) -/* 11206C 802A8A5C 8C4F0000 */ lw $t7, ($v0) -/* 112070 802A8A60 27BD0008 */ addiu $sp, $sp, 8 -/* 112074 802A8A64 25E80001 */ addiu $t0, $t7, 1 -/* 112078 802A8A68 03E00008 */ jr $ra -/* 11207C 802A8A6C AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8A70.s b/asm/non_matchings/memory/func_802A8A70.s deleted file mode 100644 index 3188e7be1..000000000 --- a/asm/non_matchings/memory/func_802A8A70.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8A70 -/* 112080 802A8A70 27BDFFF8 */ addiu $sp, $sp, -8 -/* 112084 802A8A74 3C0F802C */ lui $t7, %hi(D_802B8CF8) # $t7, 0x802c -/* 112088 802A8A78 AFA5000C */ sw $a1, 0xc($sp) -/* 11208C 802A8A7C AFA60010 */ sw $a2, 0x10($sp) -/* 112090 802A8A80 25EF8CF8 */ addiu $t7, %lo(D_802B8CF8) # addiu $t7, $t7, -0x7308 -/* 112094 802A8A84 8DE10000 */ lw $at, ($t7) -/* 112098 802A8A88 8DE80004 */ lw $t0, 4($t7) -/* 11209C 802A8A8C 27AE0000 */ addiu $t6, $sp, 0 -/* 1120A0 802A8A90 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 1120A4 802A8A94 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 1120A8 802A8A98 ADC10000 */ sw $at, ($t6) -/* 1120AC 802A8A9C ADC80004 */ sw $t0, 4($t6) -/* 1120B0 802A8AA0 8C4A0000 */ lw $t2, ($v0) -/* 1120B4 802A8AA4 8FA90000 */ lw $t1, ($sp) -/* 1120B8 802A8AA8 000A58C0 */ sll $t3, $t2, 3 -/* 1120BC 802A8AAC 008B6021 */ addu $t4, $a0, $t3 -/* 1120C0 802A8AB0 AD890000 */ sw $t1, ($t4) -/* 1120C4 802A8AB4 8C590000 */ lw $t9, ($v0) -/* 1120C8 802A8AB8 8FAD0004 */ lw $t5, 4($sp) -/* 1120CC 802A8ABC 0019C0C0 */ sll $t8, $t9, 3 -/* 1120D0 802A8AC0 00987021 */ addu $t6, $a0, $t8 -/* 1120D4 802A8AC4 ADCD0004 */ sw $t5, 4($t6) -/* 1120D8 802A8AC8 8C4F0000 */ lw $t7, ($v0) -/* 1120DC 802A8ACC 27BD0008 */ addiu $sp, $sp, 8 -/* 1120E0 802A8AD0 25E80001 */ addiu $t0, $t7, 1 -/* 1120E4 802A8AD4 03E00008 */ jr $ra -/* 1120E8 802A8AD8 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8ADC.s b/asm/non_matchings/memory/func_802A8ADC.s deleted file mode 100644 index 6d1fdb425..000000000 --- a/asm/non_matchings/memory/func_802A8ADC.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8ADC -/* 1120EC 802A8ADC 27BDFFF8 */ addiu $sp, $sp, -8 -/* 1120F0 802A8AE0 3C0F802C */ lui $t7, %hi(D_802B8D00) # $t7, 0x802c -/* 1120F4 802A8AE4 AFA5000C */ sw $a1, 0xc($sp) -/* 1120F8 802A8AE8 AFA60010 */ sw $a2, 0x10($sp) -/* 1120FC 802A8AEC 25EF8D00 */ addiu $t7, %lo(D_802B8D00) # addiu $t7, $t7, -0x7300 -/* 112100 802A8AF0 8DE10000 */ lw $at, ($t7) -/* 112104 802A8AF4 8DE80004 */ lw $t0, 4($t7) -/* 112108 802A8AF8 27AE0000 */ addiu $t6, $sp, 0 -/* 11210C 802A8AFC 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112110 802A8B00 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112114 802A8B04 ADC10000 */ sw $at, ($t6) -/* 112118 802A8B08 ADC80004 */ sw $t0, 4($t6) -/* 11211C 802A8B0C 8C4A0000 */ lw $t2, ($v0) -/* 112120 802A8B10 8FA90000 */ lw $t1, ($sp) -/* 112124 802A8B14 000A58C0 */ sll $t3, $t2, 3 -/* 112128 802A8B18 008B6021 */ addu $t4, $a0, $t3 -/* 11212C 802A8B1C AD890000 */ sw $t1, ($t4) -/* 112130 802A8B20 8C590000 */ lw $t9, ($v0) -/* 112134 802A8B24 8FAD0004 */ lw $t5, 4($sp) -/* 112138 802A8B28 0019C0C0 */ sll $t8, $t9, 3 -/* 11213C 802A8B2C 00987021 */ addu $t6, $a0, $t8 -/* 112140 802A8B30 ADCD0004 */ sw $t5, 4($t6) -/* 112144 802A8B34 8C4F0000 */ lw $t7, ($v0) -/* 112148 802A8B38 27BD0008 */ addiu $sp, $sp, 8 -/* 11214C 802A8B3C 25E80001 */ addiu $t0, $t7, 1 -/* 112150 802A8B40 03E00008 */ jr $ra -/* 112154 802A8B44 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8B48.s b/asm/non_matchings/memory/func_802A8B48.s deleted file mode 100644 index 091aca553..000000000 --- a/asm/non_matchings/memory/func_802A8B48.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8B48 -/* 112158 802A8B48 27BDFFF8 */ addiu $sp, $sp, -8 -/* 11215C 802A8B4C 3C0F802C */ lui $t7, %hi(D_802B8D08) # $t7, 0x802c -/* 112160 802A8B50 AFA5000C */ sw $a1, 0xc($sp) -/* 112164 802A8B54 AFA60010 */ sw $a2, 0x10($sp) -/* 112168 802A8B58 25EF8D08 */ addiu $t7, %lo(D_802B8D08) # addiu $t7, $t7, -0x72f8 -/* 11216C 802A8B5C 8DE10000 */ lw $at, ($t7) -/* 112170 802A8B60 8DE80004 */ lw $t0, 4($t7) -/* 112174 802A8B64 27AE0000 */ addiu $t6, $sp, 0 -/* 112178 802A8B68 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 11217C 802A8B6C 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112180 802A8B70 ADC10000 */ sw $at, ($t6) -/* 112184 802A8B74 ADC80004 */ sw $t0, 4($t6) -/* 112188 802A8B78 8C4A0000 */ lw $t2, ($v0) -/* 11218C 802A8B7C 8FA90000 */ lw $t1, ($sp) -/* 112190 802A8B80 000A58C0 */ sll $t3, $t2, 3 -/* 112194 802A8B84 008B6021 */ addu $t4, $a0, $t3 -/* 112198 802A8B88 AD890000 */ sw $t1, ($t4) -/* 11219C 802A8B8C 8C590000 */ lw $t9, ($v0) -/* 1121A0 802A8B90 8FAD0004 */ lw $t5, 4($sp) -/* 1121A4 802A8B94 0019C0C0 */ sll $t8, $t9, 3 -/* 1121A8 802A8B98 00987021 */ addu $t6, $a0, $t8 -/* 1121AC 802A8B9C ADCD0004 */ sw $t5, 4($t6) -/* 1121B0 802A8BA0 8C4F0000 */ lw $t7, ($v0) -/* 1121B4 802A8BA4 27BD0008 */ addiu $sp, $sp, 8 -/* 1121B8 802A8BA8 25E80001 */ addiu $t0, $t7, 1 -/* 1121BC 802A8BAC 03E00008 */ jr $ra -/* 1121C0 802A8BB0 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8BB4.s b/asm/non_matchings/memory/func_802A8BB4.s deleted file mode 100644 index 262263faf..000000000 --- a/asm/non_matchings/memory/func_802A8BB4.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8BB4 -/* 1121C4 802A8BB4 27BDFFF8 */ addiu $sp, $sp, -8 -/* 1121C8 802A8BB8 3C0F802C */ lui $t7, %hi(D_802B8D10) # $t7, 0x802c -/* 1121CC 802A8BBC AFA5000C */ sw $a1, 0xc($sp) -/* 1121D0 802A8BC0 AFA60010 */ sw $a2, 0x10($sp) -/* 1121D4 802A8BC4 25EF8D10 */ addiu $t7, %lo(D_802B8D10) # addiu $t7, $t7, -0x72f0 -/* 1121D8 802A8BC8 8DE10000 */ lw $at, ($t7) -/* 1121DC 802A8BCC 8DE80004 */ lw $t0, 4($t7) -/* 1121E0 802A8BD0 27AE0000 */ addiu $t6, $sp, 0 -/* 1121E4 802A8BD4 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 1121E8 802A8BD8 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 1121EC 802A8BDC ADC10000 */ sw $at, ($t6) -/* 1121F0 802A8BE0 ADC80004 */ sw $t0, 4($t6) -/* 1121F4 802A8BE4 8C4A0000 */ lw $t2, ($v0) -/* 1121F8 802A8BE8 8FA90000 */ lw $t1, ($sp) -/* 1121FC 802A8BEC 000A58C0 */ sll $t3, $t2, 3 -/* 112200 802A8BF0 008B6021 */ addu $t4, $a0, $t3 -/* 112204 802A8BF4 AD890000 */ sw $t1, ($t4) -/* 112208 802A8BF8 8C590000 */ lw $t9, ($v0) -/* 11220C 802A8BFC 8FAD0004 */ lw $t5, 4($sp) -/* 112210 802A8C00 0019C0C0 */ sll $t8, $t9, 3 -/* 112214 802A8C04 00987021 */ addu $t6, $a0, $t8 -/* 112218 802A8C08 ADCD0004 */ sw $t5, 4($t6) -/* 11221C 802A8C0C 8C4F0000 */ lw $t7, ($v0) -/* 112220 802A8C10 27BD0008 */ addiu $sp, $sp, 8 -/* 112224 802A8C14 25E80001 */ addiu $t0, $t7, 1 -/* 112228 802A8C18 03E00008 */ jr $ra -/* 11222C 802A8C1C AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8C20.s b/asm/non_matchings/memory/func_802A8C20.s deleted file mode 100644 index fe88f2da1..000000000 --- a/asm/non_matchings/memory/func_802A8C20.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8C20 -/* 112230 802A8C20 27BDFFF8 */ addiu $sp, $sp, -8 -/* 112234 802A8C24 3C0F802C */ lui $t7, %hi(D_802B8D18) # $t7, 0x802c -/* 112238 802A8C28 AFA5000C */ sw $a1, 0xc($sp) -/* 11223C 802A8C2C AFA60010 */ sw $a2, 0x10($sp) -/* 112240 802A8C30 25EF8D18 */ addiu $t7, %lo(D_802B8D18) # addiu $t7, $t7, -0x72e8 -/* 112244 802A8C34 8DE10000 */ lw $at, ($t7) -/* 112248 802A8C38 8DE80004 */ lw $t0, 4($t7) -/* 11224C 802A8C3C 27AE0000 */ addiu $t6, $sp, 0 -/* 112250 802A8C40 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112254 802A8C44 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112258 802A8C48 ADC10000 */ sw $at, ($t6) -/* 11225C 802A8C4C ADC80004 */ sw $t0, 4($t6) -/* 112260 802A8C50 8C4A0000 */ lw $t2, ($v0) -/* 112264 802A8C54 8FA90000 */ lw $t1, ($sp) -/* 112268 802A8C58 000A58C0 */ sll $t3, $t2, 3 -/* 11226C 802A8C5C 008B6021 */ addu $t4, $a0, $t3 -/* 112270 802A8C60 AD890000 */ sw $t1, ($t4) -/* 112274 802A8C64 8C590000 */ lw $t9, ($v0) -/* 112278 802A8C68 8FAD0004 */ lw $t5, 4($sp) -/* 11227C 802A8C6C 0019C0C0 */ sll $t8, $t9, 3 -/* 112280 802A8C70 00987021 */ addu $t6, $a0, $t8 -/* 112284 802A8C74 ADCD0004 */ sw $t5, 4($t6) -/* 112288 802A8C78 8C4F0000 */ lw $t7, ($v0) -/* 11228C 802A8C7C 27BD0008 */ addiu $sp, $sp, 8 -/* 112290 802A8C80 25E80001 */ addiu $t0, $t7, 1 -/* 112294 802A8C84 03E00008 */ jr $ra -/* 112298 802A8C88 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8C8C.s b/asm/non_matchings/memory/func_802A8C8C.s deleted file mode 100644 index 049a41bde..000000000 --- a/asm/non_matchings/memory/func_802A8C8C.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8C8C -/* 11229C 802A8C8C 27BDFFF8 */ addiu $sp, $sp, -8 -/* 1122A0 802A8C90 3C0F802C */ lui $t7, %hi(D_802B8D20) # $t7, 0x802c -/* 1122A4 802A8C94 AFA5000C */ sw $a1, 0xc($sp) -/* 1122A8 802A8C98 AFA60010 */ sw $a2, 0x10($sp) -/* 1122AC 802A8C9C 25EF8D20 */ addiu $t7, %lo(D_802B8D20) # addiu $t7, $t7, -0x72e0 -/* 1122B0 802A8CA0 8DE10000 */ lw $at, ($t7) -/* 1122B4 802A8CA4 8DE80004 */ lw $t0, 4($t7) -/* 1122B8 802A8CA8 27AE0000 */ addiu $t6, $sp, 0 -/* 1122BC 802A8CAC 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 1122C0 802A8CB0 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 1122C4 802A8CB4 ADC10000 */ sw $at, ($t6) -/* 1122C8 802A8CB8 ADC80004 */ sw $t0, 4($t6) -/* 1122CC 802A8CBC 8C4A0000 */ lw $t2, ($v0) -/* 1122D0 802A8CC0 8FA90000 */ lw $t1, ($sp) -/* 1122D4 802A8CC4 000A58C0 */ sll $t3, $t2, 3 -/* 1122D8 802A8CC8 008B6021 */ addu $t4, $a0, $t3 -/* 1122DC 802A8CCC AD890000 */ sw $t1, ($t4) -/* 1122E0 802A8CD0 8C590000 */ lw $t9, ($v0) -/* 1122E4 802A8CD4 8FAD0004 */ lw $t5, 4($sp) -/* 1122E8 802A8CD8 0019C0C0 */ sll $t8, $t9, 3 -/* 1122EC 802A8CDC 00987021 */ addu $t6, $a0, $t8 -/* 1122F0 802A8CE0 ADCD0004 */ sw $t5, 4($t6) -/* 1122F4 802A8CE4 8C4F0000 */ lw $t7, ($v0) -/* 1122F8 802A8CE8 27BD0008 */ addiu $sp, $sp, 8 -/* 1122FC 802A8CEC 25E80001 */ addiu $t0, $t7, 1 -/* 112300 802A8CF0 03E00008 */ jr $ra -/* 112304 802A8CF4 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8CF8.s b/asm/non_matchings/memory/func_802A8CF8.s deleted file mode 100644 index 9a26032c1..000000000 --- a/asm/non_matchings/memory/func_802A8CF8.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8CF8 -/* 112308 802A8CF8 27BDFFF8 */ addiu $sp, $sp, -8 -/* 11230C 802A8CFC 3C0F802C */ lui $t7, %hi(D_802B8D28) # $t7, 0x802c -/* 112310 802A8D00 AFA5000C */ sw $a1, 0xc($sp) -/* 112314 802A8D04 AFA60010 */ sw $a2, 0x10($sp) -/* 112318 802A8D08 25EF8D28 */ addiu $t7, %lo(D_802B8D28) # addiu $t7, $t7, -0x72d8 -/* 11231C 802A8D0C 8DE10000 */ lw $at, ($t7) -/* 112320 802A8D10 8DE80004 */ lw $t0, 4($t7) -/* 112324 802A8D14 27AE0000 */ addiu $t6, $sp, 0 -/* 112328 802A8D18 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 11232C 802A8D1C 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112330 802A8D20 ADC10000 */ sw $at, ($t6) -/* 112334 802A8D24 ADC80004 */ sw $t0, 4($t6) -/* 112338 802A8D28 8C4A0000 */ lw $t2, ($v0) -/* 11233C 802A8D2C 8FA90000 */ lw $t1, ($sp) -/* 112340 802A8D30 000A58C0 */ sll $t3, $t2, 3 -/* 112344 802A8D34 008B6021 */ addu $t4, $a0, $t3 -/* 112348 802A8D38 AD890000 */ sw $t1, ($t4) -/* 11234C 802A8D3C 8C590000 */ lw $t9, ($v0) -/* 112350 802A8D40 8FAD0004 */ lw $t5, 4($sp) -/* 112354 802A8D44 0019C0C0 */ sll $t8, $t9, 3 -/* 112358 802A8D48 00987021 */ addu $t6, $a0, $t8 -/* 11235C 802A8D4C ADCD0004 */ sw $t5, 4($t6) -/* 112360 802A8D50 8C4F0000 */ lw $t7, ($v0) -/* 112364 802A8D54 27BD0008 */ addiu $sp, $sp, 8 -/* 112368 802A8D58 25E80001 */ addiu $t0, $t7, 1 -/* 11236C 802A8D5C 03E00008 */ jr $ra -/* 112370 802A8D60 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8D64.s b/asm/non_matchings/memory/func_802A8D64.s deleted file mode 100644 index 36d0e59db..000000000 --- a/asm/non_matchings/memory/func_802A8D64.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8D64 -/* 112374 802A8D64 27BDFFF8 */ addiu $sp, $sp, -8 -/* 112378 802A8D68 3C0F802C */ lui $t7, %hi(D_802B8D30) # $t7, 0x802c -/* 11237C 802A8D6C AFA5000C */ sw $a1, 0xc($sp) -/* 112380 802A8D70 AFA60010 */ sw $a2, 0x10($sp) -/* 112384 802A8D74 25EF8D30 */ addiu $t7, %lo(D_802B8D30) # addiu $t7, $t7, -0x72d0 -/* 112388 802A8D78 8DE10000 */ lw $at, ($t7) -/* 11238C 802A8D7C 8DE80004 */ lw $t0, 4($t7) -/* 112390 802A8D80 27AE0000 */ addiu $t6, $sp, 0 -/* 112394 802A8D84 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112398 802A8D88 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 11239C 802A8D8C ADC10000 */ sw $at, ($t6) -/* 1123A0 802A8D90 ADC80004 */ sw $t0, 4($t6) -/* 1123A4 802A8D94 8C4A0000 */ lw $t2, ($v0) -/* 1123A8 802A8D98 8FA90000 */ lw $t1, ($sp) -/* 1123AC 802A8D9C 000A58C0 */ sll $t3, $t2, 3 -/* 1123B0 802A8DA0 008B6021 */ addu $t4, $a0, $t3 -/* 1123B4 802A8DA4 AD890000 */ sw $t1, ($t4) -/* 1123B8 802A8DA8 8C590000 */ lw $t9, ($v0) -/* 1123BC 802A8DAC 8FAD0004 */ lw $t5, 4($sp) -/* 1123C0 802A8DB0 0019C0C0 */ sll $t8, $t9, 3 -/* 1123C4 802A8DB4 00987021 */ addu $t6, $a0, $t8 -/* 1123C8 802A8DB8 ADCD0004 */ sw $t5, 4($t6) -/* 1123CC 802A8DBC 8C4F0000 */ lw $t7, ($v0) -/* 1123D0 802A8DC0 27BD0008 */ addiu $sp, $sp, 8 -/* 1123D4 802A8DC4 25E80001 */ addiu $t0, $t7, 1 -/* 1123D8 802A8DC8 03E00008 */ jr $ra -/* 1123DC 802A8DCC AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8DD0.s b/asm/non_matchings/memory/func_802A8DD0.s deleted file mode 100644 index 25581ce1c..000000000 --- a/asm/non_matchings/memory/func_802A8DD0.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8DD0 -/* 1123E0 802A8DD0 27BDFFF8 */ addiu $sp, $sp, -8 -/* 1123E4 802A8DD4 3C0F802C */ lui $t7, %hi(D_802B8D38) # $t7, 0x802c -/* 1123E8 802A8DD8 AFA5000C */ sw $a1, 0xc($sp) -/* 1123EC 802A8DDC AFA60010 */ sw $a2, 0x10($sp) -/* 1123F0 802A8DE0 25EF8D38 */ addiu $t7, %lo(D_802B8D38) # addiu $t7, $t7, -0x72c8 -/* 1123F4 802A8DE4 8DE10000 */ lw $at, ($t7) -/* 1123F8 802A8DE8 8DE80004 */ lw $t0, 4($t7) -/* 1123FC 802A8DEC 27AE0000 */ addiu $t6, $sp, 0 -/* 112400 802A8DF0 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112404 802A8DF4 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112408 802A8DF8 ADC10000 */ sw $at, ($t6) -/* 11240C 802A8DFC ADC80004 */ sw $t0, 4($t6) -/* 112410 802A8E00 8C4A0000 */ lw $t2, ($v0) -/* 112414 802A8E04 8FA90000 */ lw $t1, ($sp) -/* 112418 802A8E08 000A58C0 */ sll $t3, $t2, 3 -/* 11241C 802A8E0C 008B6021 */ addu $t4, $a0, $t3 -/* 112420 802A8E10 AD890000 */ sw $t1, ($t4) -/* 112424 802A8E14 8C590000 */ lw $t9, ($v0) -/* 112428 802A8E18 8FAD0004 */ lw $t5, 4($sp) -/* 11242C 802A8E1C 0019C0C0 */ sll $t8, $t9, 3 -/* 112430 802A8E20 00987021 */ addu $t6, $a0, $t8 -/* 112434 802A8E24 ADCD0004 */ sw $t5, 4($t6) -/* 112438 802A8E28 8C4F0000 */ lw $t7, ($v0) -/* 11243C 802A8E2C 27BD0008 */ addiu $sp, $sp, 8 -/* 112440 802A8E30 25E80001 */ addiu $t0, $t7, 1 -/* 112444 802A8E34 03E00008 */ jr $ra -/* 112448 802A8E38 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8E3C.s b/asm/non_matchings/memory/func_802A8E3C.s deleted file mode 100644 index 77d68ab70..000000000 --- a/asm/non_matchings/memory/func_802A8E3C.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8E3C -/* 11244C 802A8E3C 27BDFFF8 */ addiu $sp, $sp, -8 -/* 112450 802A8E40 3C0F802C */ lui $t7, %hi(D_802B8D40) # $t7, 0x802c -/* 112454 802A8E44 AFA5000C */ sw $a1, 0xc($sp) -/* 112458 802A8E48 AFA60010 */ sw $a2, 0x10($sp) -/* 11245C 802A8E4C 25EF8D40 */ addiu $t7, %lo(D_802B8D40) # addiu $t7, $t7, -0x72c0 -/* 112460 802A8E50 8DE10000 */ lw $at, ($t7) -/* 112464 802A8E54 8DE80004 */ lw $t0, 4($t7) -/* 112468 802A8E58 27AE0000 */ addiu $t6, $sp, 0 -/* 11246C 802A8E5C 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112470 802A8E60 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112474 802A8E64 ADC10000 */ sw $at, ($t6) -/* 112478 802A8E68 ADC80004 */ sw $t0, 4($t6) -/* 11247C 802A8E6C 8C4A0000 */ lw $t2, ($v0) -/* 112480 802A8E70 8FA90000 */ lw $t1, ($sp) -/* 112484 802A8E74 000A58C0 */ sll $t3, $t2, 3 -/* 112488 802A8E78 008B6021 */ addu $t4, $a0, $t3 -/* 11248C 802A8E7C AD890000 */ sw $t1, ($t4) -/* 112490 802A8E80 8C590000 */ lw $t9, ($v0) -/* 112494 802A8E84 8FAD0004 */ lw $t5, 4($sp) -/* 112498 802A8E88 0019C0C0 */ sll $t8, $t9, 3 -/* 11249C 802A8E8C 00987021 */ addu $t6, $a0, $t8 -/* 1124A0 802A8E90 ADCD0004 */ sw $t5, 4($t6) -/* 1124A4 802A8E94 8C4F0000 */ lw $t7, ($v0) -/* 1124A8 802A8E98 27BD0008 */ addiu $sp, $sp, 8 -/* 1124AC 802A8E9C 25E80001 */ addiu $t0, $t7, 1 -/* 1124B0 802A8EA0 03E00008 */ jr $ra -/* 1124B4 802A8EA4 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8EA8.s b/asm/non_matchings/memory/func_802A8EA8.s deleted file mode 100644 index 834b305ea..000000000 --- a/asm/non_matchings/memory/func_802A8EA8.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8EA8 -/* 1124B8 802A8EA8 27BDFFF8 */ addiu $sp, $sp, -8 -/* 1124BC 802A8EAC 3C0F802C */ lui $t7, %hi(D_802B8D48) # $t7, 0x802c -/* 1124C0 802A8EB0 AFA5000C */ sw $a1, 0xc($sp) -/* 1124C4 802A8EB4 AFA60010 */ sw $a2, 0x10($sp) -/* 1124C8 802A8EB8 25EF8D48 */ addiu $t7, %lo(D_802B8D48) # addiu $t7, $t7, -0x72b8 -/* 1124CC 802A8EBC 8DE10000 */ lw $at, ($t7) -/* 1124D0 802A8EC0 8DE80004 */ lw $t0, 4($t7) -/* 1124D4 802A8EC4 27AE0000 */ addiu $t6, $sp, 0 -/* 1124D8 802A8EC8 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 1124DC 802A8ECC 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 1124E0 802A8ED0 ADC10000 */ sw $at, ($t6) -/* 1124E4 802A8ED4 ADC80004 */ sw $t0, 4($t6) -/* 1124E8 802A8ED8 8C4A0000 */ lw $t2, ($v0) -/* 1124EC 802A8EDC 8FA90000 */ lw $t1, ($sp) -/* 1124F0 802A8EE0 000A58C0 */ sll $t3, $t2, 3 -/* 1124F4 802A8EE4 008B6021 */ addu $t4, $a0, $t3 -/* 1124F8 802A8EE8 AD890000 */ sw $t1, ($t4) -/* 1124FC 802A8EEC 8C590000 */ lw $t9, ($v0) -/* 112500 802A8EF0 8FAD0004 */ lw $t5, 4($sp) -/* 112504 802A8EF4 0019C0C0 */ sll $t8, $t9, 3 -/* 112508 802A8EF8 00987021 */ addu $t6, $a0, $t8 -/* 11250C 802A8EFC ADCD0004 */ sw $t5, 4($t6) -/* 112510 802A8F00 8C4F0000 */ lw $t7, ($v0) -/* 112514 802A8F04 27BD0008 */ addiu $sp, $sp, 8 -/* 112518 802A8F08 25E80001 */ addiu $t0, $t7, 1 -/* 11251C 802A8F0C 03E00008 */ jr $ra -/* 112520 802A8F10 AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8F14.s b/asm/non_matchings/memory/func_802A8F14.s deleted file mode 100644 index d69a736d1..000000000 --- a/asm/non_matchings/memory/func_802A8F14.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_802A8F14 -/* 112524 802A8F14 27BDFFF8 */ addiu $sp, $sp, -8 -/* 112528 802A8F18 3C0F802C */ lui $t7, %hi(D_802B8D50) # $t7, 0x802c -/* 11252C 802A8F1C AFA5000C */ sw $a1, 0xc($sp) -/* 112530 802A8F20 AFA60010 */ sw $a2, 0x10($sp) -/* 112534 802A8F24 25EF8D50 */ addiu $t7, %lo(D_802B8D50) # addiu $t7, $t7, -0x72b0 -/* 112538 802A8F28 8DE10000 */ lw $at, ($t7) -/* 11253C 802A8F2C 8DE80004 */ lw $t0, 4($t7) -/* 112540 802A8F30 27AE0000 */ addiu $t6, $sp, 0 -/* 112544 802A8F34 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112548 802A8F38 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 11254C 802A8F3C ADC10000 */ sw $at, ($t6) -/* 112550 802A8F40 ADC80004 */ sw $t0, 4($t6) -/* 112554 802A8F44 8C4A0000 */ lw $t2, ($v0) -/* 112558 802A8F48 8FA90000 */ lw $t1, ($sp) -/* 11255C 802A8F4C 000A58C0 */ sll $t3, $t2, 3 -/* 112560 802A8F50 008B6021 */ addu $t4, $a0, $t3 -/* 112564 802A8F54 AD890000 */ sw $t1, ($t4) -/* 112568 802A8F58 8C590000 */ lw $t9, ($v0) -/* 11256C 802A8F5C 8FAD0004 */ lw $t5, 4($sp) -/* 112570 802A8F60 0019C0C0 */ sll $t8, $t9, 3 -/* 112574 802A8F64 00987021 */ addu $t6, $a0, $t8 -/* 112578 802A8F68 ADCD0004 */ sw $t5, 4($t6) -/* 11257C 802A8F6C 8C4F0000 */ lw $t7, ($v0) -/* 112580 802A8F70 27BD0008 */ addiu $sp, $sp, 8 -/* 112584 802A8F74 25E80001 */ addiu $t0, $t7, 1 -/* 112588 802A8F78 03E00008 */ jr $ra -/* 11258C 802A8F7C AC480000 */ sw $t0, ($v0) diff --git a/asm/non_matchings/memory/func_802A8F80.s b/asm/non_matchings/memory/func_802A8F80.s deleted file mode 100644 index 4efa391df..000000000 --- a/asm/non_matchings/memory/func_802A8F80.s +++ /dev/null @@ -1,174 +0,0 @@ -.section .late_rodata - -glabel jpt_802B9C30 -.word L802A8FE0, L802A9014, L802A902C, L802A9044 -.word L802A9060, L802A907C, L802A9094, L802A9094 -.word L802A9094, L802A9094, L802A9094, L802A9094 -.word L802A9094, L802A9094, L802A9094, L802A9094 -.word L802A9094, L802A9094, L802A8FF8 - -.section .text - -glabel func_802A8F80 -/* 112590 802A8F80 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 112594 802A8F84 3C19802C */ lui $t9, %hi(D_802B8D58) # $t9, 0x802c -/* 112598 802A8F88 AFB00004 */ sw $s0, 4($sp) -/* 11259C 802A8F8C AFA60068 */ sw $a2, 0x68($sp) -/* 1125A0 802A8F90 27398D58 */ addiu $t9, %lo(D_802B8D58) # addiu $t9, $t9, -0x72a8 -/* 1125A4 802A8F94 8F210000 */ lw $at, ($t9) -/* 1125A8 802A8F98 00067600 */ sll $t6, $a2, 0x18 -/* 1125AC 802A8F9C 000E7E03 */ sra $t7, $t6, 0x18 -/* 1125B0 802A8FA0 27B80058 */ addiu $t8, $sp, 0x58 -/* 1125B4 802A8FA4 8F2D0004 */ lw $t5, 4($t9) -/* 1125B8 802A8FA8 25EEFFE6 */ addiu $t6, $t7, -0x1a -/* 1125BC 802A8FAC AF010000 */ sw $at, ($t8) -/* 1125C0 802A8FB0 2DC10013 */ sltiu $at, $t6, 0x13 -/* 1125C4 802A8FB4 00808025 */ move $s0, $a0 -/* 1125C8 802A8FB8 00A03825 */ move $a3, $a1 -/* 1125CC 802A8FBC 00001025 */ move $v0, $zero -/* 1125D0 802A8FC0 10200034 */ beqz $at, .L802A9094 -/* 1125D4 802A8FC4 AF0D0004 */ sw $t5, 4($t8) -/* 1125D8 802A8FC8 000E7080 */ sll $t6, $t6, 2 -/* 1125DC 802A8FCC 3C01802C */ lui $at, %hi(jpt_802B9C30) -/* 1125E0 802A8FD0 002E0821 */ addu $at, $at, $t6 -/* 1125E4 802A8FD4 8C2E9C30 */ lw $t6, %lo(jpt_802B9C30)($at) -/* 1125E8 802A8FD8 01C00008 */ jr $t6 -/* 1125EC 802A8FDC 00000000 */ nop -glabel L802A8FE0 -/* 1125F0 802A8FE0 24030020 */ li $v1, 32 -/* 1125F4 802A8FE4 240F0020 */ li $t7, 32 -/* 1125F8 802A8FE8 AFAF0044 */ sw $t7, 0x44($sp) -/* 1125FC 802A8FEC AFA00040 */ sw $zero, 0x40($sp) -/* 112600 802A8FF0 10000028 */ b .L802A9094 -/* 112604 802A8FF4 AFA30048 */ sw $v1, 0x48($sp) -glabel L802A8FF8 -/* 112608 802A8FF8 24030020 */ li $v1, 32 -/* 11260C 802A8FFC 240C0020 */ li $t4, 32 -/* 112610 802A9000 AFAC0044 */ sw $t4, 0x44($sp) -/* 112614 802A9004 AFA00040 */ sw $zero, 0x40($sp) -/* 112618 802A9008 24020100 */ li $v0, 256 -/* 11261C 802A900C 10000021 */ b .L802A9094 -/* 112620 802A9010 AFA30048 */ sw $v1, 0x48($sp) -glabel L802A9014 -/* 112624 802A9014 24030040 */ li $v1, 64 -/* 112628 802A9018 240B0020 */ li $t3, 32 -/* 11262C 802A901C AFAB0044 */ sw $t3, 0x44($sp) -/* 112630 802A9020 AFA00040 */ sw $zero, 0x40($sp) -/* 112634 802A9024 1000001B */ b .L802A9094 -/* 112638 802A9028 AFA30048 */ sw $v1, 0x48($sp) -glabel L802A902C -/* 11263C 802A902C 24030020 */ li $v1, 32 -/* 112640 802A9030 24180040 */ li $t8, 64 -/* 112644 802A9034 AFB80044 */ sw $t8, 0x44($sp) -/* 112648 802A9038 AFA00040 */ sw $zero, 0x40($sp) -/* 11264C 802A903C 10000015 */ b .L802A9094 -/* 112650 802A9040 AFA30048 */ sw $v1, 0x48($sp) -glabel L802A9044 -/* 112654 802A9044 24030020 */ li $v1, 32 -/* 112658 802A9048 24190020 */ li $t9, 32 -/* 11265C 802A904C 240D0003 */ li $t5, 3 -/* 112660 802A9050 AFB90044 */ sw $t9, 0x44($sp) -/* 112664 802A9054 AFAD0040 */ sw $t5, 0x40($sp) -/* 112668 802A9058 1000000E */ b .L802A9094 -/* 11266C 802A905C AFA30048 */ sw $v1, 0x48($sp) -glabel L802A9060 -/* 112670 802A9060 24030040 */ li $v1, 64 -/* 112674 802A9064 240E0020 */ li $t6, 32 -/* 112678 802A9068 240F0003 */ li $t7, 3 -/* 11267C 802A906C AFAE0044 */ sw $t6, 0x44($sp) -/* 112680 802A9070 AFAF0040 */ sw $t7, 0x40($sp) -/* 112684 802A9074 10000007 */ b .L802A9094 -/* 112688 802A9078 AFA30048 */ sw $v1, 0x48($sp) -glabel L802A907C -/* 11268C 802A907C 24030020 */ li $v1, 32 -/* 112690 802A9080 240C0040 */ li $t4, 64 -/* 112694 802A9084 240B0003 */ li $t3, 3 -/* 112698 802A9088 AFAC0044 */ sw $t4, 0x44($sp) -/* 11269C 802A908C AFAB0040 */ sw $t3, 0x40($sp) -/* 1126A0 802A9090 AFA30048 */ sw $v1, 0x48($sp) -.L802A9094: -glabel L802A9094 -/* 1126A4 802A9094 3C09802C */ lui $t1, %hi(D_802BA274) # $t1, 0x802c -/* 1126A8 802A9098 2529A274 */ addiu $t1, %lo(D_802BA274) # addiu $t1, $t1, -0x5d8c -/* 1126AC 802A909C 8D250000 */ lw $a1, ($t1) -/* 1126B0 802A90A0 3C0A802C */ lui $t2, %hi(D_802BA270) # $t2, 0x802c -/* 1126B4 802A90A4 254AA270 */ addiu $t2, %lo(D_802BA270) # addiu $t2, $t2, -0x5d90 -/* 1126B8 802A90A8 00A7C021 */ addu $t8, $a1, $a3 -/* 1126BC 802A90AC 93040000 */ lbu $a0, ($t8) -/* 1126C0 802A90B0 24B90001 */ addiu $t9, $a1, 1 -/* 1126C4 802A90B4 8D4B0000 */ lw $t3, ($t2) -/* 1126C8 802A90B8 AD390000 */ sw $t9, ($t1) -/* 1126CC 802A90BC 8FAC0058 */ lw $t4, 0x58($sp) -/* 1126D0 802A90C0 03277021 */ addu $t6, $t9, $a3 -/* 1126D4 802A90C4 272F0001 */ addiu $t7, $t9, 1 -/* 1126D8 802A90C8 3086000F */ andi $a2, $a0, 0xf -/* 1126DC 802A90CC 308800F0 */ andi $t0, $a0, 0xf0 -/* 1126E0 802A90D0 91C40000 */ lbu $a0, ($t6) -/* 1126E4 802A90D4 000BC0C0 */ sll $t8, $t3, 3 -/* 1126E8 802A90D8 8FA30048 */ lw $v1, 0x48($sp) -/* 1126EC 802A90DC AD2F0000 */ sw $t7, ($t1) -/* 1126F0 802A90E0 0218C821 */ addu $t9, $s0, $t8 -/* 1126F4 802A90E4 AF2C0000 */ sw $t4, ($t9) -/* 1126F8 802A90E8 8D4E0000 */ lw $t6, ($t2) -/* 1126FC 802A90EC 00086902 */ srl $t5, $t0, 4 -/* 112700 802A90F0 01A04025 */ move $t0, $t5 -/* 112704 802A90F4 8FAD005C */ lw $t5, 0x5c($sp) -/* 112708 802A90F8 000E78C0 */ sll $t7, $t6, 3 -/* 11270C 802A90FC 020F5821 */ addu $t3, $s0, $t7 -/* 112710 802A9100 AD6D0004 */ sw $t5, 4($t3) -/* 112714 802A9104 8D580000 */ lw $t8, ($t2) -/* 112718 802A9108 8FB90040 */ lw $t9, 0x40($sp) -/* 11271C 802A910C 00035840 */ sll $t3, $v1, 1 -/* 112720 802A9110 270C0001 */ addiu $t4, $t8, 1 -/* 112724 802A9114 AD4C0000 */ sw $t4, ($t2) -/* 112728 802A9118 25780007 */ addiu $t8, $t3, 7 -/* 11272C 802A911C 3C01F500 */ lui $at, 0xf500 -/* 112730 802A9120 00197540 */ sll $t6, $t9, 0x15 -/* 112734 802A9124 01C17825 */ or $t7, $t6, $at -/* 112738 802A9128 8D4B0000 */ lw $t3, ($t2) -/* 11273C 802A912C 3C010010 */ lui $at, 0x10 -/* 112740 802A9130 001860C3 */ sra $t4, $t8, 3 -/* 112744 802A9134 000CCA40 */ sll $t9, $t4, 9 -/* 112748 802A9138 01E16825 */ or $t5, $t7, $at -/* 11274C 802A913C 01B97025 */ or $t6, $t5, $t9 -/* 112750 802A9140 01C27825 */ or $t7, $t6, $v0 -/* 112754 802A9144 000BC0C0 */ sll $t8, $t3, 3 -/* 112758 802A9148 02186021 */ addu $t4, $s0, $t8 -/* 11275C 802A914C 308E00F0 */ andi $t6, $a0, 0xf0 -/* 112760 802A9150 000E5902 */ srl $t3, $t6, 4 -/* 112764 802A9154 308D000F */ andi $t5, $a0, 0xf -/* 112768 802A9158 AD8F0000 */ sw $t7, ($t4) -/* 11276C 802A915C 000DCC80 */ sll $t9, $t5, 0x12 -/* 112770 802A9160 000BC380 */ sll $t8, $t3, 0xe -/* 112774 802A9164 03387825 */ or $t7, $t9, $t8 -/* 112778 802A9168 8D590000 */ lw $t9, ($t2) -/* 11277C 802A916C 00066200 */ sll $t4, $a2, 8 -/* 112780 802A9170 01EC6825 */ or $t5, $t7, $t4 -/* 112784 802A9174 00087100 */ sll $t6, $t0, 4 -/* 112788 802A9178 0019C0C0 */ sll $t8, $t9, 3 -/* 11278C 802A917C 02187821 */ addu $t7, $s0, $t8 -/* 112790 802A9180 01AE5825 */ or $t3, $t5, $t6 -/* 112794 802A9184 ADEB0004 */ sw $t3, 4($t7) -/* 112798 802A9188 8D4C0000 */ lw $t4, ($t2) -/* 11279C 802A918C 3C0EF200 */ lui $t6, 0xf200 -/* 1127A0 802A9190 258D0001 */ addiu $t5, $t4, 1 -/* 1127A4 802A9194 000DC0C0 */ sll $t8, $t5, 3 -/* 1127A8 802A9198 AD4D0000 */ sw $t5, ($t2) -/* 1127AC 802A919C 02185821 */ addu $t3, $s0, $t8 -/* 1127B0 802A91A0 AD6E0000 */ sw $t6, ($t3) -/* 1127B4 802A91A4 8FB90044 */ lw $t9, 0x44($sp) -/* 1127B8 802A91A8 8D4F0000 */ lw $t7, ($t2) -/* 1127BC 802A91AC 246CFFFF */ addiu $t4, $v1, -1 -/* 1127C0 802A91B0 000C6B80 */ sll $t5, $t4, 0xe -/* 1127C4 802A91B4 2738FFFF */ addiu $t8, $t9, -1 -/* 1127C8 802A91B8 00187080 */ sll $t6, $t8, 2 -/* 1127CC 802A91BC 000F60C0 */ sll $t4, $t7, 3 -/* 1127D0 802A91C0 020CC821 */ addu $t9, $s0, $t4 -/* 1127D4 802A91C4 01AE5825 */ or $t3, $t5, $t6 -/* 1127D8 802A91C8 AF2B0004 */ sw $t3, 4($t9) -/* 1127DC 802A91CC 8D580000 */ lw $t8, ($t2) -/* 1127E0 802A91D0 8FB00004 */ lw $s0, 4($sp) -/* 1127E4 802A91D4 27BD0060 */ addiu $sp, $sp, 0x60 -/* 1127E8 802A91D8 270D0001 */ addiu $t5, $t8, 1 -/* 1127EC 802A91DC 03E00008 */ jr $ra -/* 1127F0 802A91E0 AD4D0000 */ sw $t5, ($t2) diff --git a/asm/non_matchings/memory/func_802A91E4.s b/asm/non_matchings/memory/func_802A91E4.s deleted file mode 100644 index 031252717..000000000 --- a/asm/non_matchings/memory/func_802A91E4.s +++ /dev/null @@ -1,210 +0,0 @@ -.section .late_rodata - -glabel jpt_802B9C7C -.word L802A9250, L802A9268, L802A9280, L802A9298 -.word L802A92B4, L802A92D0 - -.section .text - -glabel func_802A91E4 -/* 1127F4 802A91E4 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 1127F8 802A91E8 3C19802C */ lui $t9, %hi(D_802B8D60) # $t9, 0x802c -/* 1127FC 802A91EC AFA60060 */ sw $a2, 0x60($sp) -/* 112800 802A91F0 27398D60 */ addiu $t9, %lo(D_802B8D60) # addiu $t9, $t9, -0x72a0 -/* 112804 802A91F4 8F210000 */ lw $at, ($t9) -/* 112808 802A91F8 8F2F0004 */ lw $t7, 4($t9) -/* 11280C 802A91FC 27B80048 */ addiu $t8, $sp, 0x48 -/* 112810 802A9200 AF010000 */ sw $at, ($t8) -/* 112814 802A9204 AF0F0004 */ sw $t7, 4($t8) -/* 112818 802A9208 3C18802C */ lui $t8, %hi(D_802B8D68) # $t8, 0x802c -/* 11281C 802A920C 27188D68 */ addiu $t8, %lo(D_802B8D68) # addiu $t8, $t8, -0x7298 -/* 112820 802A9210 8F010000 */ lw $at, ($t8) -/* 112824 802A9214 00067600 */ sll $t6, $a2, 0x18 -/* 112828 802A9218 000E3603 */ sra $a2, $t6, 0x18 -/* 11282C 802A921C 27AE0040 */ addiu $t6, $sp, 0x40 -/* 112830 802A9220 8F0F0004 */ lw $t7, 4($t8) -/* 112834 802A9224 24D9FFE0 */ addiu $t9, $a2, -0x20 -/* 112838 802A9228 ADC10000 */ sw $at, ($t6) -/* 11283C 802A922C 2F210006 */ sltiu $at, $t9, 6 -/* 112840 802A9230 1020002D */ beqz $at, .L802A92E8 -/* 112844 802A9234 ADCF0004 */ sw $t7, 4($t6) -/* 112848 802A9238 0019C880 */ sll $t9, $t9, 2 -/* 11284C 802A923C 3C01802C */ lui $at, %hi(jpt_802B9C7C) -/* 112850 802A9240 00390821 */ addu $at, $at, $t9 -/* 112854 802A9244 8C399C7C */ lw $t9, %lo(jpt_802B9C7C)($at) -/* 112858 802A9248 03200008 */ jr $t9 -/* 11285C 802A924C 00000000 */ nop -glabel L802A9250 -/* 112860 802A9250 24020020 */ li $v0, 32 -/* 112864 802A9254 240E0020 */ li $t6, 32 -/* 112868 802A9258 AFAE0028 */ sw $t6, 0x28($sp) -/* 11286C 802A925C AFA00024 */ sw $zero, 0x24($sp) -/* 112870 802A9260 10000021 */ b .L802A92E8 -/* 112874 802A9264 AFA2002C */ sw $v0, 0x2c($sp) -glabel L802A9268 -/* 112878 802A9268 24020040 */ li $v0, 64 -/* 11287C 802A926C 24180020 */ li $t8, 32 -/* 112880 802A9270 AFB80028 */ sw $t8, 0x28($sp) -/* 112884 802A9274 AFA00024 */ sw $zero, 0x24($sp) -/* 112888 802A9278 1000001B */ b .L802A92E8 -/* 11288C 802A927C AFA2002C */ sw $v0, 0x2c($sp) -glabel L802A9280 -/* 112890 802A9280 24020020 */ li $v0, 32 -/* 112894 802A9284 240F0040 */ li $t7, 64 -/* 112898 802A9288 AFAF0028 */ sw $t7, 0x28($sp) -/* 11289C 802A928C AFA00024 */ sw $zero, 0x24($sp) -/* 1128A0 802A9290 10000015 */ b .L802A92E8 -/* 1128A4 802A9294 AFA2002C */ sw $v0, 0x2c($sp) -glabel L802A9298 -/* 1128A8 802A9298 24020020 */ li $v0, 32 -/* 1128AC 802A929C 24190020 */ li $t9, 32 -/* 1128B0 802A92A0 240E0003 */ li $t6, 3 -/* 1128B4 802A92A4 AFB90028 */ sw $t9, 0x28($sp) -/* 1128B8 802A92A8 AFAE0024 */ sw $t6, 0x24($sp) -/* 1128BC 802A92AC 1000000E */ b .L802A92E8 -/* 1128C0 802A92B0 AFA2002C */ sw $v0, 0x2c($sp) -glabel L802A92B4 -/* 1128C4 802A92B4 24020040 */ li $v0, 64 -/* 1128C8 802A92B8 24180020 */ li $t8, 32 -/* 1128CC 802A92BC 240F0003 */ li $t7, 3 -/* 1128D0 802A92C0 AFB80028 */ sw $t8, 0x28($sp) -/* 1128D4 802A92C4 AFAF0024 */ sw $t7, 0x24($sp) -/* 1128D8 802A92C8 10000007 */ b .L802A92E8 -/* 1128DC 802A92CC AFA2002C */ sw $v0, 0x2c($sp) -glabel L802A92D0 -/* 1128E0 802A92D0 24020020 */ li $v0, 32 -/* 1128E4 802A92D4 24190040 */ li $t9, 64 -/* 1128E8 802A92D8 240E0003 */ li $t6, 3 -/* 1128EC 802A92DC AFB90028 */ sw $t9, 0x28($sp) -/* 1128F0 802A92E0 AFAE0024 */ sw $t6, 0x24($sp) -/* 1128F4 802A92E4 AFA2002C */ sw $v0, 0x2c($sp) -.L802A92E8: -/* 1128F8 802A92E8 3C0B802C */ lui $t3, %hi(D_802BA274) # $t3, 0x802c -/* 1128FC 802A92EC 256BA274 */ addiu $t3, %lo(D_802BA274) # addiu $t3, $t3, -0x5d8c -/* 112900 802A92F0 8D630000 */ lw $v1, ($t3) -/* 112904 802A92F4 3C010500 */ lui $at, 0x500 -/* 112908 802A92F8 8FA80024 */ lw $t0, 0x24($sp) -/* 11290C 802A92FC 00A3C021 */ addu $t8, $a1, $v1 -/* 112910 802A9300 93060000 */ lbu $a2, ($t8) -/* 112914 802A9304 24790001 */ addiu $t9, $v1, 1 -/* 112918 802A9308 AD790000 */ sw $t9, ($t3) -/* 11291C 802A930C 27380001 */ addiu $t8, $t9, 1 -/* 112920 802A9310 00067AC0 */ sll $t7, $a2, 0xb -/* 112924 802A9314 01E13021 */ addu $a2, $t7, $at -/* 112928 802A9318 AD780000 */ sw $t8, ($t3) -/* 11292C 802A931C 03057821 */ addu $t7, $t8, $a1 -/* 112930 802A9320 91E70000 */ lbu $a3, ($t7) -/* 112934 802A9324 3C0C802C */ lui $t4, %hi(D_802BA270) # $t4, 0x802c -/* 112938 802A9328 27190001 */ addiu $t9, $t8, 1 -/* 11293C 802A932C 258CA270 */ addiu $t4, %lo(D_802BA270) # addiu $t4, $t4, -0x5d90 -/* 112940 802A9330 AD790000 */ sw $t9, ($t3) -/* 112944 802A9334 8D990000 */ lw $t9, ($t4) -/* 112948 802A9338 3C01FD00 */ lui $at, 0xfd00 -/* 11294C 802A933C 00087540 */ sll $t6, $t0, 0x15 -/* 112950 802A9340 01C1C025 */ or $t8, $t6, $at -/* 112954 802A9344 3C0D0010 */ lui $t5, 0x10 -/* 112958 802A9348 01C04025 */ move $t0, $t6 -/* 11295C 802A934C 030D7825 */ or $t7, $t8, $t5 -/* 112960 802A9350 001970C0 */ sll $t6, $t9, 3 -/* 112964 802A9354 8FA2002C */ lw $v0, 0x2c($sp) -/* 112968 802A9358 008EC021 */ addu $t8, $a0, $t6 -/* 11296C 802A935C AF0F0000 */ sw $t7, ($t8) -/* 112970 802A9360 8D990000 */ lw $t9, ($t4) -/* 112974 802A9364 3C01F500 */ lui $at, 0xf500 -/* 112978 802A9368 30E900F0 */ andi $t1, $a3, 0xf0 -/* 11297C 802A936C 001970C0 */ sll $t6, $t9, 3 -/* 112980 802A9370 008E7821 */ addu $t7, $a0, $t6 -/* 112984 802A9374 ADE60004 */ sw $a2, 4($t7) -/* 112988 802A9378 8D980000 */ lw $t8, ($t4) -/* 11298C 802A937C 8FAE0048 */ lw $t6, 0x48($sp) -/* 112990 802A9380 00022840 */ sll $a1, $v0, 1 -/* 112994 802A9384 27190001 */ addiu $t9, $t8, 1 -/* 112998 802A9388 AD990000 */ sw $t9, ($t4) -/* 11299C 802A938C 0019C0C0 */ sll $t8, $t9, 3 -/* 1129A0 802A9390 0098C821 */ addu $t9, $a0, $t8 -/* 1129A4 802A9394 AF2E0000 */ sw $t6, ($t9) -/* 1129A8 802A9398 8D980000 */ lw $t8, ($t4) -/* 1129AC 802A939C 8FAF004C */ lw $t7, 0x4c($sp) -/* 1129B0 802A93A0 240307FF */ li $v1, 2047 -/* 1129B4 802A93A4 001870C0 */ sll $t6, $t8, 3 -/* 1129B8 802A93A8 008EC821 */ addu $t9, $a0, $t6 -/* 1129BC 802A93AC AF2F0004 */ sw $t7, 4($t9) -/* 1129C0 802A93B0 8D980000 */ lw $t8, ($t4) -/* 1129C4 802A93B4 01017825 */ or $t7, $t0, $at -/* 1129C8 802A93B8 01EDC825 */ or $t9, $t7, $t5 -/* 1129CC 802A93BC 270E0001 */ addiu $t6, $t8, 1 -/* 1129D0 802A93C0 AD8E0000 */ sw $t6, ($t4) -/* 1129D4 802A93C4 8D8F0000 */ lw $t7, ($t4) -/* 1129D8 802A93C8 30F8000F */ andi $t8, $a3, 0xf -/* 1129DC 802A93CC 03387025 */ or $t6, $t9, $t8 -/* 1129E0 802A93D0 000FC8C0 */ sll $t9, $t7, 3 -/* 1129E4 802A93D4 0099C021 */ addu $t8, $a0, $t9 -/* 1129E8 802A93D8 AF0E0000 */ sw $t6, ($t8) -/* 1129EC 802A93DC 8D8E0000 */ lw $t6, ($t4) -/* 1129F0 802A93E0 00097902 */ srl $t7, $t1, 4 -/* 1129F4 802A93E4 000F4E00 */ sll $t1, $t7, 0x18 -/* 1129F8 802A93E8 000EC0C0 */ sll $t8, $t6, 3 -/* 1129FC 802A93EC 00987821 */ addu $t7, $a0, $t8 -/* 112A00 802A93F0 ADE90004 */ sw $t1, 4($t7) -/* 112A04 802A93F4 8D990000 */ lw $t9, ($t4) -/* 112A08 802A93F8 8FB80040 */ lw $t8, 0x40($sp) -/* 112A0C 802A93FC 272E0001 */ addiu $t6, $t9, 1 -/* 112A10 802A9400 AD8E0000 */ sw $t6, ($t4) -/* 112A14 802A9404 000EC8C0 */ sll $t9, $t6, 3 -/* 112A18 802A9408 00997021 */ addu $t6, $a0, $t9 -/* 112A1C 802A940C ADD80000 */ sw $t8, ($t6) -/* 112A20 802A9410 8D990000 */ lw $t9, ($t4) -/* 112A24 802A9414 8FAF0044 */ lw $t7, 0x44($sp) -/* 112A28 802A9418 0019C0C0 */ sll $t8, $t9, 3 -/* 112A2C 802A941C 00987021 */ addu $t6, $a0, $t8 -/* 112A30 802A9420 ADCF0004 */ sw $t7, 4($t6) -/* 112A34 802A9424 8FAF0028 */ lw $t7, 0x28($sp) -/* 112A38 802A9428 8D990000 */ lw $t9, ($t4) -/* 112A3C 802A942C 000570C2 */ srl $t6, $a1, 3 -/* 112A40 802A9430 004F0019 */ multu $v0, $t7 -/* 112A44 802A9434 27380001 */ addiu $t8, $t9, 1 -/* 112A48 802A9438 AD980000 */ sw $t8, ($t4) -/* 112A4C 802A943C 27BD0058 */ addiu $sp, $sp, 0x58 -/* 112A50 802A9440 00005012 */ mflo $t2 -/* 112A54 802A9444 254AFFFF */ addiu $t2, $t2, -1 -/* 112A58 802A9448 2D4107FF */ sltiu $at, $t2, 0x7ff -/* 112A5C 802A944C 10200003 */ beqz $at, .L802A945C -/* 112A60 802A9450 00000000 */ nop -/* 112A64 802A9454 10000001 */ b .L802A945C -/* 112A68 802A9458 01401825 */ move $v1, $t2 -.L802A945C: -/* 112A6C 802A945C 15C00003 */ bnez $t6, .L802A946C -/* 112A70 802A9460 01C02825 */ move $a1, $t6 -/* 112A74 802A9464 10000002 */ b .L802A9470 -/* 112A78 802A9468 24020001 */ li $v0, 1 -.L802A946C: -/* 112A7C 802A946C 00A01025 */ move $v0, $a1 -.L802A9470: -/* 112A80 802A9470 14A00003 */ bnez $a1, .L802A9480 -/* 112A84 802A9474 00A03025 */ move $a2, $a1 -/* 112A88 802A9478 10000001 */ b .L802A9480 -/* 112A8C 802A947C 24060001 */ li $a2, 1 -.L802A9480: -/* 112A90 802A9480 8D980000 */ lw $t8, ($t4) -/* 112A94 802A9484 3C19F300 */ lui $t9, 0xf300 -/* 112A98 802A9488 001878C0 */ sll $t7, $t8, 3 -/* 112A9C 802A948C 245807FF */ addiu $t8, $v0, 0x7ff -/* 112AA0 802A9490 0306001B */ divu $zero, $t8, $a2 -/* 112AA4 802A9494 008F7021 */ addu $t6, $a0, $t7 -/* 112AA8 802A9498 ADD90000 */ sw $t9, ($t6) -/* 112AAC 802A949C 00007812 */ mflo $t7 -/* 112AB0 802A94A0 01E9C825 */ or $t9, $t7, $t1 -/* 112AB4 802A94A4 8D8F0000 */ lw $t7, ($t4) -/* 112AB8 802A94A8 00037300 */ sll $t6, $v1, 0xc -/* 112ABC 802A94AC 032EC025 */ or $t8, $t9, $t6 -/* 112AC0 802A94B0 000FC8C0 */ sll $t9, $t7, 3 -/* 112AC4 802A94B4 00997021 */ addu $t6, $a0, $t9 -/* 112AC8 802A94B8 ADD80004 */ sw $t8, 4($t6) -/* 112ACC 802A94BC 8D8F0000 */ lw $t7, ($t4) -/* 112AD0 802A94C0 14C00002 */ bnez $a2, .L802A94CC -/* 112AD4 802A94C4 00000000 */ nop -/* 112AD8 802A94C8 0007000D */ break 7 -.L802A94CC: -/* 112ADC 802A94CC 25F90001 */ addiu $t9, $t7, 1 -/* 112AE0 802A94D0 03E00008 */ jr $ra -/* 112AE4 802A94D4 AD990000 */ sw $t9, ($t4) diff --git a/asm/non_matchings/memory/func_802A95B0.s b/asm/non_matchings/memory/func_802A95B0.s deleted file mode 100644 index 78695b329..000000000 --- a/asm/non_matchings/memory/func_802A95B0.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_802A95B0 -/* 112BC0 802A95B0 3C08802C */ lui $t0, %hi(D_802BA274) # $t0, 0x802c -/* 112BC4 802A95B4 2508A274 */ addiu $t0, %lo(D_802BA274) # addiu $t0, $t0, -0x5d8c -/* 112BC8 802A95B8 8D030000 */ lw $v1, ($t0) -/* 112BCC 802A95BC AFA60008 */ sw $a2, 8($sp) -/* 112BD0 802A95C0 3C09802C */ lui $t1, %hi(D_802BA270) # $t1, 0x802c -/* 112BD4 802A95C4 00657021 */ addu $t6, $v1, $a1 -/* 112BD8 802A95C8 246F0001 */ addiu $t7, $v1, 1 -/* 112BDC 802A95CC 91C20000 */ lbu $v0, ($t6) -/* 112BE0 802A95D0 AD0F0000 */ sw $t7, ($t0) -/* 112BE4 802A95D4 01E5C021 */ addu $t8, $t7, $a1 -/* 112BE8 802A95D8 93190000 */ lbu $t9, ($t8) -/* 112BEC 802A95DC 25ED0001 */ addiu $t5, $t7, 1 -/* 112BF0 802A95E0 AD0D0000 */ sw $t5, ($t0) -/* 112BF4 802A95E4 00195A00 */ sll $t3, $t9, 8 -/* 112BF8 802A95E8 01A57021 */ addu $t6, $t5, $a1 -/* 112BFC 802A95EC 01623025 */ or $a2, $t3, $v0 -/* 112C00 802A95F0 91C20000 */ lbu $v0, ($t6) -/* 112C04 802A95F4 00066100 */ sll $t4, $a2, 4 -/* 112C08 802A95F8 25AF0001 */ addiu $t7, $t5, 1 -/* 112C0C 802A95FC 3047003F */ andi $a3, $v0, 0x3f -/* 112C10 802A9600 01803025 */ move $a2, $t4 -/* 112C14 802A9604 AD0F0000 */ sw $t7, ($t0) -/* 112C18 802A9608 01E5C021 */ addu $t8, $t7, $a1 -/* 112C1C 802A960C 00076100 */ sll $t4, $a3, 4 -/* 112C20 802A9610 00075A80 */ sll $t3, $a3, 0xa -/* 112C24 802A9614 93020000 */ lbu $v0, ($t8) -/* 112C28 802A9618 016C6821 */ addu $t5, $t3, $t4 -/* 112C2C 802A961C 2529A270 */ addiu $t1, %lo(D_802BA270) # addiu $t1, $t1, -0x5d90 -/* 112C30 802A9620 25AEFFFF */ addiu $t6, $t5, -1 -/* 112C34 802A9624 8D2D0000 */ lw $t5, ($t1) -/* 112C38 802A9628 25F90001 */ addiu $t9, $t7, 1 -/* 112C3C 802A962C AD190000 */ sw $t9, ($t0) -/* 112C40 802A9630 3058003F */ andi $t8, $v0, 0x3f -/* 112C44 802A9634 3C0A0400 */ lui $t2, 0x400 -/* 112C48 802A9638 0018CC40 */ sll $t9, $t8, 0x11 -/* 112C4C 802A963C 032A5825 */ or $t3, $t9, $t2 -/* 112C50 802A9640 000D78C0 */ sll $t7, $t5, 3 -/* 112C54 802A9644 008FC021 */ addu $t8, $a0, $t7 -/* 112C58 802A9648 016E6025 */ or $t4, $t3, $t6 -/* 112C5C 802A964C AF0C0000 */ sw $t4, ($t8) -/* 112C60 802A9650 8D2B0000 */ lw $t3, ($t1) -/* 112C64 802A9654 00CAC821 */ addu $t9, $a2, $t2 -/* 112C68 802A9658 000B70C0 */ sll $t6, $t3, 3 -/* 112C6C 802A965C 008E6821 */ addu $t5, $a0, $t6 -/* 112C70 802A9660 ADB90004 */ sw $t9, 4($t5) -/* 112C74 802A9664 8D2F0000 */ lw $t7, ($t1) -/* 112C78 802A9668 25EC0001 */ addiu $t4, $t7, 1 -/* 112C7C 802A966C 03E00008 */ jr $ra -/* 112C80 802A9670 AD2C0000 */ sw $t4, ($t1) diff --git a/asm/non_matchings/memory/func_802A9674.s b/asm/non_matchings/memory/func_802A9674.s deleted file mode 100644 index 67cbe8e1c..000000000 --- a/asm/non_matchings/memory/func_802A9674.s +++ /dev/null @@ -1,41 +0,0 @@ -glabel func_802A9674 -/* 112C84 802A9674 3C09802C */ lui $t1, %hi(D_802BA274) # $t1, 0x802c -/* 112C88 802A9678 2529A274 */ addiu $t1, %lo(D_802BA274) # addiu $t1, $t1, -0x5d8c -/* 112C8C 802A967C 8D230000 */ lw $v1, ($t1) -/* 112C90 802A9680 AFA60008 */ sw $a2, 8($sp) -/* 112C94 802A9684 00067600 */ sll $t6, $a2, 0x18 -/* 112C98 802A9688 0065C021 */ addu $t8, $v1, $a1 -/* 112C9C 802A968C 24790001 */ addiu $t9, $v1, 1 -/* 112CA0 802A9690 93020000 */ lbu $v0, ($t8) -/* 112CA4 802A9694 AD390000 */ sw $t9, ($t1) -/* 112CA8 802A9698 03256021 */ addu $t4, $t9, $a1 -/* 112CAC 802A969C 918D0000 */ lbu $t5, ($t4) -/* 112CB0 802A96A0 000E3603 */ sra $a2, $t6, 0x18 -/* 112CB4 802A96A4 27380001 */ addiu $t8, $t9, 1 -/* 112CB8 802A96A8 3C0A802C */ lui $t2, %hi(D_802BA270) # $t2, 0x802c -/* 112CBC 802A96AC 24C8FFCE */ addiu $t0, $a2, -0x32 -/* 112CC0 802A96B0 254AA270 */ addiu $t2, %lo(D_802BA270) # addiu $t2, $t2, -0x5d90 -/* 112CC4 802A96B4 AD380000 */ sw $t8, ($t1) -/* 112CC8 802A96B8 000D7200 */ sll $t6, $t5, 8 -/* 112CCC 802A96BC 8D580000 */ lw $t8, ($t2) -/* 112CD0 802A96C0 0008CA80 */ sll $t9, $t0, 0xa -/* 112CD4 802A96C4 00086100 */ sll $t4, $t0, 4 -/* 112CD8 802A96C8 01C23825 */ or $a3, $t6, $v0 -/* 112CDC 802A96CC 032C6821 */ addu $t5, $t9, $t4 -/* 112CE0 802A96D0 00077900 */ sll $t7, $a3, 4 -/* 112CE4 802A96D4 3C0B0400 */ lui $t3, 0x400 -/* 112CE8 802A96D8 01E03825 */ move $a3, $t7 -/* 112CEC 802A96DC 25AEFFFF */ addiu $t6, $t5, -1 -/* 112CF0 802A96E0 0018C8C0 */ sll $t9, $t8, 3 -/* 112CF4 802A96E4 00996021 */ addu $t4, $a0, $t9 -/* 112CF8 802A96E8 01CB7825 */ or $t7, $t6, $t3 -/* 112CFC 802A96EC AD8F0000 */ sw $t7, ($t4) -/* 112D00 802A96F0 8D4E0000 */ lw $t6, ($t2) -/* 112D04 802A96F4 00EB6821 */ addu $t5, $a3, $t3 -/* 112D08 802A96F8 000EC0C0 */ sll $t8, $t6, 3 -/* 112D0C 802A96FC 0098C821 */ addu $t9, $a0, $t8 -/* 112D10 802A9700 AF2D0004 */ sw $t5, 4($t9) -/* 112D14 802A9704 8D4F0000 */ lw $t7, ($t2) -/* 112D18 802A9708 25EC0001 */ addiu $t4, $t7, 1 -/* 112D1C 802A970C 03E00008 */ jr $ra -/* 112D20 802A9710 AD4C0000 */ sw $t4, ($t2) diff --git a/asm/non_matchings/memory/func_802A9714.s b/asm/non_matchings/memory/func_802A9714.s deleted file mode 100644 index 80f6350c3..000000000 --- a/asm/non_matchings/memory/func_802A9714.s +++ /dev/null @@ -1,65 +0,0 @@ -glabel func_802A9714 -/* 112D24 802A9714 3C08802C */ lui $t0, %hi(D_802BA274) # $t0, 0x802c -/* 112D28 802A9718 2508A274 */ addiu $t0, %lo(D_802BA274) # addiu $t0, $t0, -0x5d8c -/* 112D2C 802A971C 8D030000 */ lw $v1, ($t0) -/* 112D30 802A9720 AFA40000 */ sw $a0, ($sp) -/* 112D34 802A9724 AFA60008 */ sw $a2, 8($sp) -/* 112D38 802A9728 00657021 */ addu $t6, $v1, $a1 -/* 112D3C 802A972C 91C20000 */ lbu $v0, ($t6) -/* 112D40 802A9730 246F0001 */ addiu $t7, $v1, 1 -/* 112D44 802A9734 AD0F0000 */ sw $t7, ($t0) -/* 112D48 802A9738 3C18800E */ lui $t8, %hi(gIsMirrorMode) # $t8, 0x800e -/* 112D4C 802A973C 8F18C604 */ lw $t8, %lo(gIsMirrorMode)($t8) -/* 112D50 802A9740 3044001F */ andi $a0, $v0, 0x1f -/* 112D54 802A9744 00023142 */ srl $a2, $v0, 5 -/* 112D58 802A9748 1300000D */ beqz $t8, .L802A9780 -/* 112D5C 802A974C 3047001F */ andi $a3, $v0, 0x1f -/* 112D60 802A9750 01E54821 */ addu $t1, $t7, $a1 -/* 112D64 802A9754 91220000 */ lbu $v0, ($t1) -/* 112D68 802A9758 30D90007 */ andi $t9, $a2, 7 -/* 112D6C 802A975C 25EA0001 */ addiu $t2, $t7, 1 -/* 112D70 802A9760 304B0003 */ andi $t3, $v0, 3 -/* 112D74 802A9764 00023882 */ srl $a3, $v0, 2 -/* 112D78 802A9768 000B60C0 */ sll $t4, $t3, 3 -/* 112D7C 802A976C 30ED001F */ andi $t5, $a3, 0x1f -/* 112D80 802A9770 AD0A0000 */ sw $t2, ($t0) -/* 112D84 802A9774 032C3025 */ or $a2, $t9, $t4 -/* 112D88 802A9778 1000000E */ b .L802A97B4 -/* 112D8C 802A977C 01A03825 */ move $a3, $t5 -.L802A9780: -/* 112D90 802A9780 8D030000 */ lw $v1, ($t0) -/* 112D94 802A9784 00023142 */ srl $a2, $v0, 5 -/* 112D98 802A9788 30CE0007 */ andi $t6, $a2, 7 -/* 112D9C 802A978C 00657821 */ addu $t7, $v1, $a1 -/* 112DA0 802A9790 91E20000 */ lbu $v0, ($t7) -/* 112DA4 802A9794 24780001 */ addiu $t8, $v1, 1 -/* 112DA8 802A9798 AD180000 */ sw $t8, ($t0) -/* 112DAC 802A979C 30590003 */ andi $t9, $v0, 3 -/* 112DB0 802A97A0 00022082 */ srl $a0, $v0, 2 -/* 112DB4 802A97A4 001948C0 */ sll $t1, $t9, 3 -/* 112DB8 802A97A8 308A001F */ andi $t2, $a0, 0x1f -/* 112DBC 802A97AC 01C93025 */ or $a2, $t6, $t1 -/* 112DC0 802A97B0 01402025 */ move $a0, $t2 -.L802A97B4: -/* 112DC4 802A97B4 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112DC8 802A97B8 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112DCC 802A97BC 8C4D0000 */ lw $t5, ($v0) -/* 112DD0 802A97C0 8FAC0000 */ lw $t4, ($sp) -/* 112DD4 802A97C4 3C0BBF00 */ lui $t3, 0xbf00 -/* 112DD8 802A97C8 000D70C0 */ sll $t6, $t5, 3 -/* 112DDC 802A97CC 018E7821 */ addu $t7, $t4, $t6 -/* 112DE0 802A97D0 ADEB0000 */ sw $t3, ($t7) -/* 112DE4 802A97D4 8C4F0000 */ lw $t7, ($v0) -/* 112DE8 802A97D8 8FAB0000 */ lw $t3, ($sp) -/* 112DEC 802A97DC 0007CC40 */ sll $t9, $a3, 0x11 -/* 112DF0 802A97E0 00065240 */ sll $t2, $a2, 9 -/* 112DF4 802A97E4 032A6825 */ or $t5, $t9, $t2 -/* 112DF8 802A97E8 00046040 */ sll $t4, $a0, 1 -/* 112DFC 802A97EC 000FC0C0 */ sll $t8, $t7, 3 -/* 112E00 802A97F0 01AC7025 */ or $t6, $t5, $t4 -/* 112E04 802A97F4 01784821 */ addu $t1, $t3, $t8 -/* 112E08 802A97F8 AD2E0004 */ sw $t6, 4($t1) -/* 112E0C 802A97FC 8C590000 */ lw $t9, ($v0) -/* 112E10 802A9800 272A0001 */ addiu $t2, $t9, 1 -/* 112E14 802A9804 03E00008 */ jr $ra -/* 112E18 802A9808 AC4A0000 */ sw $t2, ($v0) diff --git a/asm/non_matchings/memory/func_802A980C.s b/asm/non_matchings/memory/func_802A980C.s deleted file mode 100644 index 2212da57f..000000000 --- a/asm/non_matchings/memory/func_802A980C.s +++ /dev/null @@ -1,107 +0,0 @@ -glabel func_802A980C -/* 112E1C 802A980C 3C0B802C */ lui $t3, %hi(D_802BA274) # $t3, 0x802c -/* 112E20 802A9810 256BA274 */ addiu $t3, %lo(D_802BA274) # addiu $t3, $t3, -0x5d8c -/* 112E24 802A9814 8D630000 */ lw $v1, ($t3) -/* 112E28 802A9818 AFA40000 */ sw $a0, ($sp) -/* 112E2C 802A981C AFA60008 */ sw $a2, 8($sp) -/* 112E30 802A9820 00657021 */ addu $t6, $v1, $a1 -/* 112E34 802A9824 91C20000 */ lbu $v0, ($t6) -/* 112E38 802A9828 246F0001 */ addiu $t7, $v1, 1 -/* 112E3C 802A982C AD6F0000 */ sw $t7, ($t3) -/* 112E40 802A9830 3C06800E */ lui $a2, %hi(gIsMirrorMode) # $a2, 0x800e -/* 112E44 802A9834 8CC6C604 */ lw $a2, %lo(gIsMirrorMode)($a2) -/* 112E48 802A9838 3C01B100 */ lui $at, 0xb100 -/* 112E4C 802A983C 3044001F */ andi $a0, $v0, 0x1f -/* 112E50 802A9840 10C0000E */ beqz $a2, .L802A987C -/* 112E54 802A9844 3048001F */ andi $t0, $v0, 0x1f -/* 112E58 802A9848 00023942 */ srl $a3, $v0, 5 -/* 112E5C 802A984C 01E5C821 */ addu $t9, $t7, $a1 -/* 112E60 802A9850 93220000 */ lbu $v0, ($t9) -/* 112E64 802A9854 25EC0001 */ addiu $t4, $t7, 1 -/* 112E68 802A9858 30F80007 */ andi $t8, $a3, 7 -/* 112E6C 802A985C 304D0003 */ andi $t5, $v0, 3 -/* 112E70 802A9860 00024082 */ srl $t0, $v0, 2 -/* 112E74 802A9864 000D70C0 */ sll $t6, $t5, 3 -/* 112E78 802A9868 310F001F */ andi $t7, $t0, 0x1f -/* 112E7C 802A986C AD6C0000 */ sw $t4, ($t3) -/* 112E80 802A9870 030E3825 */ or $a3, $t8, $t6 -/* 112E84 802A9874 1000000E */ b .L802A98B0 -/* 112E88 802A9878 01E04025 */ move $t0, $t7 -.L802A987C: -/* 112E8C 802A987C 8D630000 */ lw $v1, ($t3) -/* 112E90 802A9880 00023942 */ srl $a3, $v0, 5 -/* 112E94 802A9884 30F80007 */ andi $t8, $a3, 7 -/* 112E98 802A9888 0065C821 */ addu $t9, $v1, $a1 -/* 112E9C 802A988C 93220000 */ lbu $v0, ($t9) -/* 112EA0 802A9890 246C0001 */ addiu $t4, $v1, 1 -/* 112EA4 802A9894 AD6C0000 */ sw $t4, ($t3) -/* 112EA8 802A9898 304D0003 */ andi $t5, $v0, 3 -/* 112EAC 802A989C 00022082 */ srl $a0, $v0, 2 -/* 112EB0 802A98A0 000D70C0 */ sll $t6, $t5, 3 -/* 112EB4 802A98A4 308F001F */ andi $t7, $a0, 0x1f -/* 112EB8 802A98A8 030E3825 */ or $a3, $t8, $t6 -/* 112EBC 802A98AC 01E02025 */ move $a0, $t7 -.L802A98B0: -/* 112EC0 802A98B0 8D630000 */ lw $v1, ($t3) -/* 112EC4 802A98B4 0065C021 */ addu $t8, $v1, $a1 -/* 112EC8 802A98B8 93020000 */ lbu $v0, ($t8) -/* 112ECC 802A98BC 24790001 */ addiu $t9, $v1, 1 -/* 112ED0 802A98C0 10C0000F */ beqz $a2, .L802A9900 -/* 112ED4 802A98C4 AD790000 */ sw $t9, ($t3) -/* 112ED8 802A98C8 3046001F */ andi $a2, $v0, 0x1f -/* 112EDC 802A98CC 00024942 */ srl $t1, $v0, 5 -/* 112EE0 802A98D0 03256821 */ addu $t5, $t9, $a1 -/* 112EE4 802A98D4 91A20000 */ lbu $v0, ($t5) -/* 112EE8 802A98D8 272E0001 */ addiu $t6, $t9, 1 -/* 112EEC 802A98DC 312C0007 */ andi $t4, $t1, 7 -/* 112EF0 802A98E0 304F0003 */ andi $t7, $v0, 3 -/* 112EF4 802A98E4 00025082 */ srl $t2, $v0, 2 -/* 112EF8 802A98E8 000FC0C0 */ sll $t8, $t7, 3 -/* 112EFC 802A98EC 3159001F */ andi $t9, $t2, 0x1f -/* 112F00 802A98F0 AD6E0000 */ sw $t6, ($t3) -/* 112F04 802A98F4 01984825 */ or $t1, $t4, $t8 -/* 112F08 802A98F8 1000000F */ b .L802A9938 -/* 112F0C 802A98FC 03205025 */ move $t2, $t9 -.L802A9900: -/* 112F10 802A9900 8D630000 */ lw $v1, ($t3) -/* 112F14 802A9904 304A001F */ andi $t2, $v0, 0x1f -/* 112F18 802A9908 00024942 */ srl $t1, $v0, 5 -/* 112F1C 802A990C 00656821 */ addu $t5, $v1, $a1 -/* 112F20 802A9910 91A20000 */ lbu $v0, ($t5) -/* 112F24 802A9914 312C0007 */ andi $t4, $t1, 7 -/* 112F28 802A9918 246E0001 */ addiu $t6, $v1, 1 -/* 112F2C 802A991C 304F0003 */ andi $t7, $v0, 3 -/* 112F30 802A9920 00023082 */ srl $a2, $v0, 2 -/* 112F34 802A9924 000FC0C0 */ sll $t8, $t7, 3 -/* 112F38 802A9928 30D9001F */ andi $t9, $a2, 0x1f -/* 112F3C 802A992C AD6E0000 */ sw $t6, ($t3) -/* 112F40 802A9930 01984825 */ or $t1, $t4, $t8 -/* 112F44 802A9934 03203025 */ move $a2, $t9 -.L802A9938: -/* 112F48 802A9938 00086C40 */ sll $t5, $t0, 0x11 -/* 112F4C 802A993C 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 112F50 802A9940 01A17025 */ or $t6, $t5, $at -/* 112F54 802A9944 0007C240 */ sll $t8, $a3, 9 -/* 112F58 802A9948 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 112F5C 802A994C 01D8C825 */ or $t9, $t6, $t8 -/* 112F60 802A9950 8C4E0000 */ lw $t6, ($v0) -/* 112F64 802A9954 8FAF0000 */ lw $t7, ($sp) -/* 112F68 802A9958 00046040 */ sll $t4, $a0, 1 -/* 112F6C 802A995C 032C6825 */ or $t5, $t9, $t4 -/* 112F70 802A9960 000EC0C0 */ sll $t8, $t6, 3 -/* 112F74 802A9964 01F8C821 */ addu $t9, $t7, $t8 -/* 112F78 802A9968 AF2D0000 */ sw $t5, ($t9) -/* 112F7C 802A996C 0009C240 */ sll $t8, $t1, 9 -/* 112F80 802A9970 000A7440 */ sll $t6, $t2, 0x11 -/* 112F84 802A9974 01D86825 */ or $t5, $t6, $t8 -/* 112F88 802A9978 8C4E0000 */ lw $t6, ($v0) -/* 112F8C 802A997C 8FAF0000 */ lw $t7, ($sp) -/* 112F90 802A9980 0006C840 */ sll $t9, $a2, 1 -/* 112F94 802A9984 01B96025 */ or $t4, $t5, $t9 -/* 112F98 802A9988 000EC0C0 */ sll $t8, $t6, 3 -/* 112F9C 802A998C 01F86821 */ addu $t5, $t7, $t8 -/* 112FA0 802A9990 ADAC0004 */ sw $t4, 4($t5) -/* 112FA4 802A9994 8C590000 */ lw $t9, ($v0) -/* 112FA8 802A9998 272E0001 */ addiu $t6, $t9, 1 -/* 112FAC 802A999C 03E00008 */ jr $ra -/* 112FB0 802A99A0 AC4E0000 */ sw $t6, ($v0) diff --git a/asm/non_matchings/memory/func_802A99A4.s b/asm/non_matchings/memory/func_802A99A4.s deleted file mode 100644 index c8d236bb7..000000000 --- a/asm/non_matchings/memory/func_802A99A4.s +++ /dev/null @@ -1,88 +0,0 @@ -glabel func_802A99A4 -/* 112FB4 802A99A4 3C09802C */ lui $t1, %hi(D_802BA274) # $t1, 0x802c -/* 112FB8 802A99A8 2529A274 */ addiu $t1, %lo(D_802BA274) # addiu $t1, $t1, -0x5d8c -/* 112FBC 802A99AC 8D230000 */ lw $v1, ($t1) -/* 112FC0 802A99B0 AFA40000 */ sw $a0, ($sp) -/* 112FC4 802A99B4 AFA60008 */ sw $a2, 8($sp) -/* 112FC8 802A99B8 00657021 */ addu $t6, $v1, $a1 -/* 112FCC 802A99BC 91C20000 */ lbu $v0, ($t6) -/* 112FD0 802A99C0 246F0001 */ addiu $t7, $v1, 1 -/* 112FD4 802A99C4 AD2F0000 */ sw $t7, ($t1) -/* 112FD8 802A99C8 3C18800E */ lui $t8, %hi(gIsMirrorMode) # $t8, 0x800e -/* 112FDC 802A99CC 8F18C604 */ lw $t8, %lo(gIsMirrorMode)($t8) -/* 112FE0 802A99D0 3044001F */ andi $a0, $v0, 0x1f -/* 112FE4 802A99D4 00023142 */ srl $a2, $v0, 5 -/* 112FE8 802A99D8 13000016 */ beqz $t8, .L802A9A34 -/* 112FEC 802A99DC 3048001F */ andi $t0, $v0, 0x1f -/* 112FF0 802A99E0 01E55021 */ addu $t2, $t7, $a1 -/* 112FF4 802A99E4 91420000 */ lbu $v0, ($t2) -/* 112FF8 802A99E8 25EB0001 */ addiu $t3, $t7, 1 -/* 112FFC 802A99EC AD2B0000 */ sw $t3, ($t1) -/* 113000 802A99F0 0165C021 */ addu $t8, $t3, $a1 -/* 113004 802A99F4 304C0003 */ andi $t4, $v0, 3 -/* 113008 802A99F8 00023882 */ srl $a3, $v0, 2 -/* 11300C 802A99FC 000241C2 */ srl $t0, $v0, 7 -/* 113010 802A9A00 93020000 */ lbu $v0, ($t8) -/* 113014 802A9A04 30D90007 */ andi $t9, $a2, 7 -/* 113018 802A9A08 000C68C0 */ sll $t5, $t4, 3 -/* 11301C 802A9A0C 032D3025 */ or $a2, $t9, $t5 -/* 113020 802A9A10 25790001 */ addiu $t9, $t3, 1 -/* 113024 802A9A14 304A000F */ andi $t2, $v0, 0xf -/* 113028 802A9A18 30EE001F */ andi $t6, $a3, 0x1f -/* 11302C 802A9A1C 310F0001 */ andi $t7, $t0, 1 -/* 113030 802A9A20 000A5840 */ sll $t3, $t2, 1 -/* 113034 802A9A24 01C03825 */ move $a3, $t6 -/* 113038 802A9A28 AD390000 */ sw $t9, ($t1) -/* 11303C 802A9A2C 10000017 */ b .L802A9A8C -/* 113040 802A9A30 01EB4025 */ or $t0, $t7, $t3 -.L802A9A34: -/* 113044 802A9A34 8D230000 */ lw $v1, ($t1) -/* 113048 802A9A38 00023942 */ srl $a3, $v0, 5 -/* 11304C 802A9A3C 30EC0007 */ andi $t4, $a3, 7 -/* 113050 802A9A40 00656821 */ addu $t5, $v1, $a1 -/* 113054 802A9A44 91A20000 */ lbu $v0, ($t5) -/* 113058 802A9A48 246E0001 */ addiu $t6, $v1, 1 -/* 11305C 802A9A4C AD2E0000 */ sw $t6, ($t1) -/* 113060 802A9A50 01C55821 */ addu $t3, $t6, $a1 -/* 113064 802A9A54 304F0003 */ andi $t7, $v0, 3 -/* 113068 802A9A58 00023082 */ srl $a2, $v0, 2 -/* 11306C 802A9A5C 000221C2 */ srl $a0, $v0, 7 -/* 113070 802A9A60 91620000 */ lbu $v0, ($t3) -/* 113074 802A9A64 000FC0C0 */ sll $t8, $t7, 3 -/* 113078 802A9A68 01983825 */ or $a3, $t4, $t8 -/* 11307C 802A9A6C 25CC0001 */ addiu $t4, $t6, 1 -/* 113080 802A9A70 304D000F */ andi $t5, $v0, 0xf -/* 113084 802A9A74 30D9001F */ andi $t9, $a2, 0x1f -/* 113088 802A9A78 308A0001 */ andi $t2, $a0, 1 -/* 11308C 802A9A7C 000D7040 */ sll $t6, $t5, 1 -/* 113090 802A9A80 03203025 */ move $a2, $t9 -/* 113094 802A9A84 AD2C0000 */ sw $t4, ($t1) -/* 113098 802A9A88 014E2025 */ or $a0, $t2, $t6 -.L802A9A8C: -/* 11309C 802A9A8C 3C02802C */ lui $v0, %hi(D_802BA270) # $v0, 0x802c -/* 1130A0 802A9A90 2442A270 */ addiu $v0, %lo(D_802BA270) # addiu $v0, $v0, -0x5d90 -/* 1130A4 802A9A94 8C590000 */ lw $t9, ($v0) -/* 1130A8 802A9A98 8FB80000 */ lw $t8, ($sp) -/* 1130AC 802A9A9C 3C0FB500 */ lui $t7, 0xb500 -/* 1130B0 802A9AA0 001950C0 */ sll $t2, $t9, 3 -/* 1130B4 802A9AA4 030A5821 */ addu $t3, $t8, $t2 -/* 1130B8 802A9AA8 AD6F0000 */ sw $t7, ($t3) -/* 1130BC 802A9AAC 0008CC40 */ sll $t9, $t0, 0x11 -/* 1130C0 802A9AB0 00046E40 */ sll $t5, $a0, 0x19 -/* 1130C4 802A9AB4 01B9C025 */ or $t8, $t5, $t9 -/* 1130C8 802A9AB8 8C590000 */ lw $t9, ($v0) -/* 1130CC 802A9ABC 8FAD0000 */ lw $t5, ($sp) -/* 1130D0 802A9AC0 00077A40 */ sll $t7, $a3, 9 -/* 1130D4 802A9AC4 030F5825 */ or $t3, $t8, $t7 -/* 1130D8 802A9AC8 00066040 */ sll $t4, $a2, 1 -/* 1130DC 802A9ACC 001950C0 */ sll $t2, $t9, 3 -/* 1130E0 802A9AD0 016C7025 */ or $t6, $t3, $t4 -/* 1130E4 802A9AD4 01AAC021 */ addu $t8, $t5, $t2 -/* 1130E8 802A9AD8 AF0E0004 */ sw $t6, 4($t8) -/* 1130EC 802A9ADC 8C4F0000 */ lw $t7, ($v0) -/* 1130F0 802A9AE0 25EB0001 */ addiu $t3, $t7, 1 -/* 1130F4 802A9AE4 03E00008 */ jr $ra -/* 1130F8 802A9AE8 AC4B0000 */ sw $t3, ($v0) - -/* 1130FC 802A9AEC 03E00008 */ jr $ra -/* 113100 802A9AF0 00000000 */ nop diff --git a/asm/non_matchings/memory/func_802AA7C8.s b/asm/non_matchings/memory/func_802AA7C8.s deleted file mode 100644 index edcd999ad..000000000 --- a/asm/non_matchings/memory/func_802AA7C8.s +++ /dev/null @@ -1,54 +0,0 @@ -glabel func_802AA7C8 -/* 113DD8 802AA7C8 00047602 */ srl $t6, $a0, 0x18 -/* 113DDC 802AA7CC 000E7880 */ sll $t7, $t6, 2 -/* 113DE0 802AA7D0 3C188015 */ lui $t8, %hi(gSegmentTable) -/* 113DE4 802AA7D4 030FC021 */ addu $t8, $t8, $t7 -/* 113DE8 802AA7D8 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 113DEC 802AA7DC 8F180258 */ lw $t8, %lo(gSegmentTable)($t8) -/* 113DF0 802AA7E0 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 113DF4 802AA7E4 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 113DF8 802AA7E8 0081C824 */ and $t9, $a0, $at -/* 113DFC 802AA7EC AFB00018 */ sw $s0, 0x18($sp) -/* 113E00 802AA7F0 3C018000 */ lui $at, 0x8000 -/* 113E04 802AA7F4 03198021 */ addu $s0, $t8, $t9 -/* 113E08 802AA7F8 02018021 */ addu $s0, $s0, $at -/* 113E0C 802AA7FC AFBF001C */ sw $ra, 0x1c($sp) -/* 113E10 802AA800 00001025 */ move $v0, $zero -/* 113E14 802AA804 02002825 */ move $a1, $s0 -.L802AA808: -/* 113E18 802AA808 8E040000 */ lw $a0, ($s0) -/* 113E1C 802AA80C 10800005 */ beqz $a0, .L802AA824 -/* 113E20 802AA810 00000000 */ nop -/* 113E24 802AA814 8E080008 */ lw $t0, 8($s0) -/* 113E28 802AA818 26100010 */ addiu $s0, $s0, 0x10 -/* 113E2C 802AA81C 1000FFFA */ b .L802AA808 -/* 113E30 802AA820 00481021 */ addu $v0, $v0, $t0 -.L802AA824: -/* 113E34 802AA824 3C038016 */ lui $v1, %hi(gHeapEndPtr) # $v1, 0x8016 -/* 113E38 802AA828 2463F72C */ addiu $v1, %lo(gHeapEndPtr) # addiu $v1, $v1, -0x8d4 -/* 113E3C 802AA82C 8C690000 */ lw $t1, ($v1) -/* 113E40 802AA830 00A08025 */ move $s0, $a1 -/* 113E44 802AA834 01225023 */ subu $t2, $t1, $v0 -/* 113E48 802AA838 AC6A0000 */ sw $t2, ($v1) -/* 113E4C 802AA83C AFAA0020 */ sw $t2, 0x20($sp) -.L802AA840: -/* 113E50 802AA840 8E040000 */ lw $a0, ($s0) -/* 113E54 802AA844 50800009 */ beql $a0, $zero, .L802AA86C -/* 113E58 802AA848 8FA50020 */ lw $a1, 0x20($sp) -/* 113E5C 802AA84C 8E050004 */ lw $a1, 4($s0) -/* 113E60 802AA850 0C0AA173 */ jal MIO0_0F -/* 113E64 802AA854 8E060008 */ lw $a2, 8($s0) -/* 113E68 802AA858 3C038016 */ lui $v1, %hi(gHeapEndPtr) # $v1, 0x8016 -/* 113E6C 802AA85C 2463F72C */ addiu $v1, %lo(gHeapEndPtr) # addiu $v1, $v1, -0x8d4 -/* 113E70 802AA860 1000FFF7 */ b .L802AA840 -/* 113E74 802AA864 26100010 */ addiu $s0, $s0, 0x10 -/* 113E78 802AA868 8FA50020 */ lw $a1, 0x20($sp) -.L802AA86C: -/* 113E7C 802AA86C 24040005 */ li $a0, 5 -/* 113E80 802AA870 0C0A9EE5 */ jal set_segment_base_addr -/* 113E84 802AA874 AC650000 */ sw $a1, ($v1) -/* 113E88 802AA878 8FBF001C */ lw $ra, 0x1c($sp) -/* 113E8C 802AA87C 8FB00018 */ lw $s0, 0x18($sp) -/* 113E90 802AA880 27BD0040 */ addiu $sp, $sp, 0x40 -/* 113E94 802AA884 03E00008 */ jr $ra -/* 113E98 802AA888 00000000 */ nop diff --git a/asm/non_matchings/memory/func_802AA88C.s b/asm/non_matchings/memory/func_802AA88C.s deleted file mode 100644 index b76fe3965..000000000 --- a/asm/non_matchings/memory/func_802AA88C.s +++ /dev/null @@ -1,36 +0,0 @@ -glabel func_802AA88C -/* 113E9C 802AA88C 00A03825 */ move $a3, $a1 -/* 113EA0 802AA890 3C0F8016 */ lui $t7, %hi(gHeapEndPtr) # $t7, 0x8016 -/* 113EA4 802AA894 8DEFF72C */ lw $t7, %lo(gHeapEndPtr)($t7) -/* 113EA8 802AA898 00E43023 */ subu $a2, $a3, $a0 -/* 113EAC 802AA89C 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 113EB0 802AA8A0 24C6000F */ addiu $a2, $a2, 0xf -/* 113EB4 802AA8A4 2401FFF0 */ li $at, -16 -/* 113EB8 802AA8A8 AFA40030 */ sw $a0, 0x30($sp) -/* 113EBC 802AA8AC 00802825 */ move $a1, $a0 -/* 113EC0 802AA8B0 00C17024 */ and $t6, $a2, $at -/* 113EC4 802AA8B4 AFBF0014 */ sw $ra, 0x14($sp) -/* 113EC8 802AA8B8 01EE2023 */ subu $a0, $t7, $t6 -/* 113ECC 802AA8BC 01C03025 */ move $a2, $t6 -/* 113ED0 802AA8C0 0C000456 */ jal dma_copy -/* 113ED4 802AA8C4 AFA40020 */ sw $a0, 0x20($sp) -/* 113ED8 802AA8C8 8FA40020 */ lw $a0, 0x20($sp) -/* 113EDC 802AA8CC 3C058016 */ lui $a1, %hi(gPrevLoadedAddress) # $a1, 0x8016 -/* 113EE0 802AA8D0 8CA5F728 */ lw $a1, %lo(gPrevLoadedAddress)($a1) -/* 113EE4 802AA8D4 8C830004 */ lw $v1, 4($a0) -/* 113EE8 802AA8D8 2401FFF0 */ li $at, -16 -/* 113EEC 802AA8DC AFA5001C */ sw $a1, 0x1c($sp) -/* 113EF0 802AA8E0 2463000F */ addiu $v1, $v1, 0xf -/* 113EF4 802AA8E4 0061C024 */ and $t8, $v1, $at -/* 113EF8 802AA8E8 0C010034 */ jal mio0decode -/* 113EFC 802AA8EC AFB80028 */ sw $t8, 0x28($sp) -/* 113F00 802AA8F0 3C048016 */ lui $a0, %hi(gPrevLoadedAddress) # $a0, 0x8016 -/* 113F04 802AA8F4 2484F728 */ addiu $a0, %lo(gPrevLoadedAddress) # addiu $a0, $a0, -0x8d8 -/* 113F08 802AA8F8 8FA30028 */ lw $v1, 0x28($sp) -/* 113F0C 802AA8FC 8C990000 */ lw $t9, ($a0) -/* 113F10 802AA900 8FBF0014 */ lw $ra, 0x14($sp) -/* 113F14 802AA904 8FA2001C */ lw $v0, 0x1c($sp) -/* 113F18 802AA908 03234021 */ addu $t0, $t9, $v1 -/* 113F1C 802AA90C AC880000 */ sw $t0, ($a0) -/* 113F20 802AA910 03E00008 */ jr $ra -/* 113F24 802AA914 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/courses/courseTable.inc.c b/courses/courseTable.inc.c index 9d50a2042..d4f42f600 100644 --- a/courses/courseTable.inc.c +++ b/courses/courseTable.inc.c @@ -205,7 +205,7 @@ struct courseTable gCourseTable[] = {{ _course_mario_raceway_offsetsSegmentRomStart, _course_mario_raceway_offsetsSegmentRomEnd, d_course_mario_raceway_vertex, d_course_mario_raceway_vertex_count, d_course_mario_raceway_packed, GET_OFFSET(d_course_mario_raceway_packed_end), - mario_raceway_textures, (u16) 0, (u16) 0x0000, + mario_raceway_textures, 0, 0x0000, }, { _course_choco_mountain_dl_mio0SegmentRomStart, _course_choco_mountain_dl_mio0SegmentRomEnd, _choco_mountain_vertexSegmentRomStart, _choco_mountain_vertexSegmentRomEnd, diff --git a/include/actor_types.h b/include/actor_types.h index ff252db76..5f37a2dd9 100644 --- a/include/actor_types.h +++ b/include/actor_types.h @@ -5,6 +5,10 @@ #include #include +//#pragma GCC diagnostic push +//#pragma GCC diagnostic ignored "-Wmicrosoft-extension" +//#pragma GCC diagnostic ignored "-Wmissing-member-name-in-structure-/-union" + /* gActorList should be understood to be populated by generic Actor structs. However, for human readability, many functions interacting with actor list elements expect one of the many @@ -329,4 +333,6 @@ struct BananaActor { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 -#endif +//#pragma GCC diagnostic pop + +#endif // ACTOR_TYPES_H diff --git a/include/common_structs.h b/include/common_structs.h index 25fc7e2a2..9d289d95a 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -148,12 +148,18 @@ typedef struct { // This struct is almost identical to the GBI Vtx_t type, // except that its missing the "flag" member. typedef struct { - s16 ob[3]; /* x, y, z */ - s16 tc[2]; /* texture coord */ - u8 ca[4]; /* color & alpha */ + s16 ob[3]; /* x, y, z */ + s16 tc[2]; /* texture coord */ + u8 ca[4]; /* color & alpha */ } mk64_Vtx; +typedef struct { + s16 ob[3]; /* x, y, z */ + s16 tc[2]; /* texture coord */ + s8 n[3]; /* color & alpha */ +} mk64_Vtx_n; + /* This struct has been copied (with only minor modifications) from https://github.com/micro500/mariokart64/wiki/Surface-Map @@ -291,7 +297,7 @@ typedef struct { /* 0x010C */ s16 unk_10C; /* 0x010E */ char unk_10E[0x2]; /* 0x0110 */ UnkActorInner unk_110; - /* 0x0150 */ f32 unk_150[9]; + /* 0x0150 */ Mat3 unk_150; /* 0x0174 */ Mat3 unk_174; /* 0x0198 */ KartBoundingBoxCorner boundingBoxCorners[4]; /* 0x01F8 */ f32 unk_1F8; diff --git a/include/functions.h b/include/functions.h index 4848ddb92..327c3fa6c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -5,6 +5,9 @@ void mio0decode(u8* arg0, u8* arg1); +// Unused mio0decode function. +void func_80040030(u8* arg0, u8* arg1); + void func_8000F2DC(void); void func_8000F628(void); void func_8006B7E4(Player* player, s32 arg1); diff --git a/include/segments.h b/include/segments.h index 63fc5fbc6..8ce0fece9 100644 --- a/include/segments.h +++ b/include/segments.h @@ -1,6 +1,7 @@ #ifndef SEGMENTS_H #define SEGMENTS_H +#define SEG_START 0x80000000 #define SEG_MAIN 0x80000400 #define SEG_80280000 0x80280000 #define SEG_8028DF00 0x8028DF00 diff --git a/include/types.h b/include/types.h index 130ef9fb8..65a869f84 100644 --- a/include/types.h +++ b/include/types.h @@ -49,7 +49,7 @@ struct UnkStruct_800DC5EC { /* 0x00 */ struct Controller *controllers; // gControllers ptr 800F6910 /* 0x04 */ Camera *camera; // Player camera ptr /* 0x08 */ Player *player; // Player ptr 800F6990 - /* 0x0C */ s32 unkC; // unk struct? + /* 0x0C */ s32 *unkC; // unk struct? /* 0x10 */ Vp viewport; /* 0x20 */ s32 pad[2]; /* 0x28 */ s16 cameraHeight; @@ -114,20 +114,22 @@ typedef struct { s8 unk; } coursePath; + +// dlRomStart, vertexRomStart, & vertexStart, are u8* because mio0 compressed. struct courseTable { - u32 *dlRomStart; // 0x00 ROM start for segment 6 DL data - u32 *dlRomEnd; // 0x04 ROM end for segment 6 DL data - u32 *vertexRomStart; // 0x08 ROM start for segment 4 vertex data - u32 *vertexRomEnd; // 0x0C ROM end for segment 7? - u32 *offsetRomStart; // 0x10 ROM start for uncompressed segment 9 texture and DL addresses - u32 *offsetRomEnd; // 0x14 ROM end for uncompressed segment 9 texture and DL addresses - mk64_Vtx *vertexStart; // 0x18 segmented address of vertex data - u32 vertexCount; // 0x1C number of vertices in vertex data - u32 *packedStart; // 0x20 packed display list start address - u32 *finalDL; // 0x24 - u32 *textures; // 0x20 segmented address of textures table - u16 unknown1; // 0x2C - u16 padding; // 0x2E + u8 *dlRomStart; // 0x00 ROM start for segment 6 DL data + u8 *dlRomEnd; // 0x04 ROM end for segment 6 DL data + u8 *vertexRomStart; // 0x08 ROM start for segment 4 vertex data + u8 *vertexRomEnd; // 0x0C ROM end for segment 7? + struct course_texture *offsetRomStart; // 0x10 ROM start for uncompressed segment 9 texture and DL addresses + struct course_texture *offsetRomEnd; // 0x14 ROM end for uncompressed segment 9 texture and DL addresses + u8 *vertexStart; // 0x18 segmented address of vertex data + u32 vertexCount; // 0x1C number of vertices in vertex data + u8 *packedStart; // 0x20 packed display list start address + uintptr_t finalDisplaylistOffset; // 0x24 + u32 *textures; // 0x20 segmented address of textures table + u16 unknown1; // 0x2C + u16 padding; // 0x2E }; extern mk64_Vtx d_course_mario_raceway_vertex[]; diff --git a/src/actors.c b/src/actors.c index 3602a6dab..939dedfca 100644 --- a/src/actors.c +++ b/src/actors.c @@ -2362,98 +2362,98 @@ void place_course_actors(void) { } void func_8029E158(void) { - set_segment_base_addr(3, gPrevLoadedAddress); - D_802BA050 = func_802A84F4(D_0F04CBE0, 0x00000257U, 0x00000400U); - func_802A84F4(D_0F04CE30, 0x00000242U, 0x00000400U); - func_802A84F4(D_0F04D080, 0x00000259U, 0x00000400U); - func_802A84F4(D_0F04D2D8, 0x00000256U, 0x00000400U); - func_802A84F4(D_0F04D538, 0x00000246U, 0x00000400U); - func_802A84F4(D_0F04D790, 0x0000025EU, 0x00000400U); - func_802A84F4(D_0F04D9FC, 0x0000025CU, 0x00000400U); - func_802A84F4(D_0F04DC5C, 0x00000254U, 0x00000400U); - D_802BA054 = func_802A84F4(D_0F04DEB0, 0x0000022AU, 0x00000400U); - func_802A84F4(D_0F04E0DC, 0x00000237U, 0x00000400U); - func_802A84F4(D_0F04E314, 0x0000023EU, 0x00000400U); - func_802A84F4(D_0F04E554, 0x00000243U, 0x00000400U); - func_802A84F4(D_0F04E798, 0x00000255U, 0x00000400U); - func_802A84F4(D_0F04E9F0, 0x00000259U, 0x00000400U); - func_802A84F4(D_0F04EC4C, 0x00000239U, 0x00000400U); - func_802A84F4(D_0F04EE88, 0x00000236U, 0x00000400U); - func_802A84F4(D_0F054C3C, 0x0000028EU, 0x00000800U); - func_802A84F4(D_0F054ECC, 0x000002FBU, 0x00000800U); - func_802A84F4(D_0F0551C8, 0x00000302U, 0x00000800U); - func_802A84F4(D_0F0554CC, 0x000003B4U, 0x00000800U); - func_802A84F4(D_0F055880, 0x0000031EU, 0x00000800U); - func_802A84F4(D_0F055BA0, 0x0000036EU, 0x00000800U); - func_802A84F4(D_0F055F10, 0x0000029CU, 0x00000800U); - func_802A84F4(D_0F0561AC, 0x0000025BU, 0x00000800U); - func_802A84F4(gTexture671A88, 0x00000400U, 0x00000800U); - func_802A84F4(gTexture6774D8, 0x00000400U, 0x00000800U); + set_segment_base_addr(3, (void *) gNextFreeMemoryAddress); + D_802BA050 = dma_textures(D_0F04CBE0, 0x00000257U, 0x00000400U); + dma_textures(D_0F04CE30, 0x00000242U, 0x00000400U); + dma_textures(D_0F04D080, 0x00000259U, 0x00000400U); + dma_textures(D_0F04D2D8, 0x00000256U, 0x00000400U); + dma_textures(D_0F04D538, 0x00000246U, 0x00000400U); + dma_textures(D_0F04D790, 0x0000025EU, 0x00000400U); + dma_textures(D_0F04D9FC, 0x0000025CU, 0x00000400U); + dma_textures(D_0F04DC5C, 0x00000254U, 0x00000400U); + D_802BA054 = dma_textures(D_0F04DEB0, 0x0000022AU, 0x00000400U); + dma_textures(D_0F04E0DC, 0x00000237U, 0x00000400U); + dma_textures(D_0F04E314, 0x0000023EU, 0x00000400U); + dma_textures(D_0F04E554, 0x00000243U, 0x00000400U); + dma_textures(D_0F04E798, 0x00000255U, 0x00000400U); + dma_textures(D_0F04E9F0, 0x00000259U, 0x00000400U); + dma_textures(D_0F04EC4C, 0x00000239U, 0x00000400U); + dma_textures(D_0F04EE88, 0x00000236U, 0x00000400U); + dma_textures(D_0F054C3C, 0x0000028EU, 0x00000800U); + dma_textures(D_0F054ECC, 0x000002FBU, 0x00000800U); + dma_textures(D_0F0551C8, 0x00000302U, 0x00000800U); + dma_textures(D_0F0554CC, 0x000003B4U, 0x00000800U); + dma_textures(D_0F055880, 0x0000031EU, 0x00000800U); + dma_textures(D_0F055BA0, 0x0000036EU, 0x00000800U); + dma_textures(D_0F055F10, 0x0000029CU, 0x00000800U); + dma_textures(D_0F0561AC, 0x0000025BU, 0x00000800U); + dma_textures(gTexture671A88, 0x00000400U, 0x00000800U); + dma_textures(gTexture6774D8, 0x00000400U, 0x00000800U); switch (gCurrentCourseId) { - case 0: - func_802A84F4(D_0F04F45C, 0x0000035BU, 0x00000800U); - D_802BA058 = func_802A84F4(D_0F056408, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F05662C, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F05688C, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F056AD0, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F056CF0, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F056EC8, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F057084, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F057288, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F057590, 0x000003E8U, 0x00000800U); + case COURSE_MARIO_RACEWAY: + dma_textures(D_0F04F45C, 0x0000035BU, 0x00000800U); + D_802BA058 = dma_textures(D_0F056408, 0x000003E8U, 0x00000800U); + dma_textures(D_0F05662C, 0x000003E8U, 0x00000800U); + dma_textures(D_0F05688C, 0x000003E8U, 0x00000800U); + dma_textures(D_0F056AD0, 0x000003E8U, 0x00000800U); + dma_textures(D_0F056CF0, 0x000003E8U, 0x00000800U); + dma_textures(D_0F056EC8, 0x000003E8U, 0x00000800U); + dma_textures(D_0F057084, 0x000003E8U, 0x00000800U); + dma_textures(D_0F057288, 0x000003E8U, 0x00000800U); + dma_textures(D_0F057590, 0x000003E8U, 0x00000800U); break; - case 2: - func_802A84F4(gTextureShrub, 0x000003FFU, 0x00000800U); + case COURSE_BOWSER_CASTLE: + dma_textures(gTextureShrub, 0x000003FFU, 0x00000800U); break; - case 4: - func_802A84F4(D_0F04F7A4, 0x000003E8U, 0x00000800U); + case COURSE_YOSHI_VALLEY: + dma_textures(D_0F04F7A4, 0x000003E8U, 0x00000800U); break; - case 5: - func_802A84F4(D_0F0513CC, 0x00000454U, 0x00000800U); - func_802A84F4(D_0F051820, 0x00000432U, 0x00000800U); + case COURSE_FRAPPE_SNOWLAND: + dma_textures(D_0F0513CC, 0x00000454U, 0x00000800U); + dma_textures(D_0F051820, 0x00000432U, 0x00000800U); break; - case 7: - func_802A84F4(D_0F04FB3C, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F050D50, 0x000003E8U, 0x00000800U); - D_802BA058 = func_802A84F4(D_0F056408, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F05662C, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F05688C, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F056AD0, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F056CF0, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F056EC8, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F057084, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F057288, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F057590, 0x000003E8U, 0x00000800U); + case COURSE_ROYAL_RACEWAY: + dma_textures(D_0F04FB3C, 0x000003E8U, 0x00000800U); + dma_textures(D_0F050D50, 0x000003E8U, 0x00000800U); + D_802BA058 = dma_textures(D_0F056408, 0x000003E8U, 0x00000800U); + dma_textures(D_0F05662C, 0x000003E8U, 0x00000800U); + dma_textures(D_0F05688C, 0x000003E8U, 0x00000800U); + dma_textures(D_0F056AD0, 0x000003E8U, 0x00000800U); + dma_textures(D_0F056CF0, 0x000003E8U, 0x00000800U); + dma_textures(D_0F056EC8, 0x000003E8U, 0x00000800U); + dma_textures(D_0F057084, 0x000003E8U, 0x00000800U); + dma_textures(D_0F057288, 0x000003E8U, 0x00000800U); + dma_textures(D_0F057590, 0x000003E8U, 0x00000800U); break; - case 8: - func_802A84F4(D_0F050468, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F050678, 0x000003E8U, 0x00000800U); + case COURSE_LUIGI_RACEWAY: + dma_textures(D_0F050468, 0x000003E8U, 0x00000800U); + dma_textures(D_0F050678, 0x000003E8U, 0x00000800U); break; - case 9: - func_802A84F4(D_0F04FE28, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F050118, 0x000003E8U, 0x00000800U); - func_802A84F4(D_0F051C54, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F051FD8, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F05232C, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F0526B8, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F052A20, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F052D3C, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F05300C, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F0532F8, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F05363C, 0x00000400U, 0x00000800U); - func_802A84F4(D_0F053950, 0x00000400U, 0x00000800U); + case COURSE_MOO_MOO_FARM: + dma_textures(D_0F04FE28, 0x000003E8U, 0x00000800U); + dma_textures(D_0F050118, 0x000003E8U, 0x00000800U); + dma_textures(D_0F051C54, 0x00000400U, 0x00000800U); + dma_textures(D_0F051FD8, 0x00000400U, 0x00000800U); + dma_textures(D_0F05232C, 0x00000400U, 0x00000800U); + dma_textures(D_0F0526B8, 0x00000400U, 0x00000800U); + dma_textures(D_0F052A20, 0x00000400U, 0x00000800U); + dma_textures(D_0F052D3C, 0x00000400U, 0x00000800U); + dma_textures(D_0F05300C, 0x00000400U, 0x00000800U); + dma_textures(D_0F0532F8, 0x00000400U, 0x00000800U); + dma_textures(D_0F05363C, 0x00000400U, 0x00000800U); + dma_textures(D_0F053950, 0x00000400U, 0x00000800U); break; - case 11: - func_802A84F4(D_0F053C34, 0x0000033EU, 0x00000800U); - func_802A84F4(D_0F053F74, 0x000002FBU, 0x00000800U); - func_802A84F4(D_0F054270, 0x000002A8U, 0x00000800U); - func_802A84F4(D_0F054518, 0x00000374U, 0x00000800U); - func_802A84F4(D_0F05488C, 0x000003AFU, 0x00000800U); + case COURSE_KALAMARI_DESERT: + dma_textures(D_0F053C34, 0x0000033EU, 0x00000800U); + dma_textures(D_0F053F74, 0x000002FBU, 0x00000800U); + dma_textures(D_0F054270, 0x000002A8U, 0x00000800U); + dma_textures(D_0F054518, 0x00000374U, 0x00000800U); + dma_textures(D_0F05488C, 0x000003AFU, 0x00000800U); break; - case 18: - func_802A84F4(D_0F057EB4, 0x0000032FU, 0x00000400U); - func_802A84F4(D_0F0581E4, 0x00000369U, 0x00000400U); - func_802A84F4(D_0F058550, 0x00000364U, 0x00000400U); + case COURSE_DK_JUNGLE: + dma_textures(D_0F057EB4, 0x0000032FU, 0x00000400U); + dma_textures(D_0F0581E4, 0x00000369U, 0x00000400U); + dma_textures(D_0F058550, 0x00000364U, 0x00000400U); break; } func_80297818(); @@ -4135,15 +4135,15 @@ void func_802A2F34(struct UnkStruct_800DC5EC *arg0) { } void func_802A3008(struct UnkStruct_800DC5EC *arg0) { - Camera *temp_s1 = arg0->camera; + Camera *camera = arg0->camera; u16 sp92 = arg0->pathCounter; s32 pad[12]; s32 i; struct Actor *actor; Vec3f sp4C = {0.0f, 5.0f, 10.0f}; - f32 sp48 = sins(temp_s1->rot[1] - 0x8000); // unk26; - f32 temp_f0 = coss(temp_s1->rot[1] - 0x8000); + f32 sp48 = sins(camera->rot[1] - 0x8000); // unk26; + f32 temp_f0 = coss(camera->rot[1] - 0x8000); D_801502C0[0][0] = temp_f0; @@ -4166,7 +4166,7 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) { if (gModeSelection != BATTLE) { - func_80297340(temp_s1); + func_80297340(camera); } D_8015F8E0 = 0; @@ -4178,186 +4178,186 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) { } switch (actor->type) { case 2: - func_80299144(temp_s1, D_801502C0, actor); + func_80299144(camera, D_801502C0, actor); break; case 3: - func_8029930C(temp_s1, D_801502C0, actor); + func_8029930C(camera, D_801502C0, actor); break; case 4: - func_802994D4(temp_s1, D_801502C0, actor); + func_802994D4(camera, D_801502C0, actor); break; case 19: - func_8029969C(temp_s1, D_801502C0, actor); + func_8029969C(camera, D_801502C0, actor); break; case 26: - func_80299864(temp_s1, D_801502C0, actor); + func_80299864(camera, D_801502C0, actor); break; case 28: - func_80299A2C(temp_s1, D_801502C0, actor); + func_80299A2C(camera, D_801502C0, actor); break; case 33: - func_80299BF4(temp_s1, D_801502C0, actor); + func_80299BF4(camera, D_801502C0, actor); break; case 29: - func_80299DBC(temp_s1, D_801502C0, actor); + func_80299DBC(camera, D_801502C0, actor); break; case 30: - func_80299EDC(temp_s1, D_801502C0, actor); + func_80299EDC(camera, D_801502C0, actor); break; case 31: - func_80299FFC(temp_s1, D_801502C0, actor); + func_80299FFC(camera, D_801502C0, actor); break; case 32: - func_8029A11C(temp_s1, D_801502C0, actor); + func_8029A11C(camera, D_801502C0, actor); break; case ACTOR_FALLING_ROCK: - func_8029CA90(temp_s1, (struct FallingRock *) actor); + func_8029CA90(camera, (struct FallingRock *) actor); break; case ACTOR_KIWANO_FRUIT: - func_8029A23C(temp_s1, D_801502C0, actor); + func_8029A23C(camera, D_801502C0, actor); break; case ACTOR_BANANA: - func_8029A8F4(temp_s1, D_801502C0, actor); + func_8029A8F4(camera, D_801502C0, actor); break; case ACTOR_GREEN_SHELL: - func_8029A690(temp_s1, D_801502C0, (struct ShellActor *) actor); + func_8029A690(camera, D_801502C0, (struct ShellActor *) actor); break; case ACTOR_RED_SHELL: - func_8029A75C(temp_s1, D_801502C0, (struct ShellActor *) actor); + func_8029A75C(camera, D_801502C0, (struct ShellActor *) actor); break; case ACTOR_BLUE_SPINY_SHELL: - func_8029A828(temp_s1, D_801502C0, (struct ShellActor *) actor); + func_8029A828(camera, D_801502C0, (struct ShellActor *) actor); break; case ACTOR_PIRANHA_PLANT: - func_80298328(temp_s1, D_801502C0, actor); + func_80298328(camera, D_801502C0, actor); break; case ACTOR_TRAIN_ENGINE: - func_8029B8E8(temp_s1, (struct TrainCar *) actor); + func_8029B8E8(camera, (struct TrainCar *) actor); break; case ACTOR_TRAIN_TENDER: - func_8029BFB0(temp_s1, (struct TrainCar *) actor); + func_8029BFB0(camera, (struct TrainCar *) actor); break; case ACTOR_TRAIN_PASSENGER_CAR: - func_8029C3CC(temp_s1, (struct TrainCar *) actor); + func_8029C3CC(camera, (struct TrainCar *) actor); break; case 18: - func_80297A50(temp_s1, D_801502C0, actor); + func_80297A50(camera, D_801502C0, actor); break; case 20: - func_8029AC18(temp_s1, D_801502C0, actor); + func_8029AC18(camera, D_801502C0, actor); break; case ACTOR_MARIO_RACEWAY_SIGN: - func_802A29BC(temp_s1, D_801502C0, actor); + func_802A29BC(camera, D_801502C0, actor); break; case ACTOR_WARIO_STADIUM_SIGN: - func_802A269C(temp_s1, actor); + func_802A269C(camera, actor); break; case ACTOR_PALM_TREE: - func_802A2C78(temp_s1, D_801502C0, actor); + func_802A2C78(camera, D_801502C0, actor); break; case ACTOR_PADDLE_WHEEL_BOAT: - func_8029AE1C(temp_s1, actor, D_801502C0, sp92); + func_8029AE1C(camera, actor, D_801502C0, sp92); break; case ACTOR_BOX_TRUCK: - func_8029B06C(temp_s1, actor); + func_8029B06C(camera, actor); break; case ACTOR_SCHOOL_BUS: - func_8029B2E4(temp_s1, actor); + func_8029B2E4(camera, actor); break; case ACTOR_TANKER_TRUCK: - func_8029B6EC(temp_s1, actor); + func_8029B6EC(camera, actor); break; case ACTOR_CAR: - func_8029B4E0(temp_s1, actor); + func_8029B4E0(camera, actor); break; case ACTOR_RAILROAD_CROSSING: - func_802A2AD0(temp_s1, actor); + func_802A2AD0(camera, actor); break; case ACTOR_YOSHI_VALLEY_EGG: - func_802A27A0(temp_s1, D_801502C0, actor, sp92); + func_802A27A0(camera, D_801502C0, actor, sp92); break; } } switch (gCurrentCourseId) { case COURSE_MOO_MOO_FARM: - func_802986B4(temp_s1, D_801502C0, actor); + func_802986B4(camera, D_801502C0, actor); break; case COURSE_DK_JUNGLE: - func_80298D7C(temp_s1, D_801502C0, actor); + func_80298D7C(camera, D_801502C0, actor); break; } } void update_simple_objects(void) { - struct Actor *phi_s0; + struct Actor *actor; s32 i; for (i = 0; i < ACTOR_LIST_SIZE; i++) { - phi_s0 = &gActorList[i]; - if (phi_s0->flags == 0) { + actor = &gActorList[i]; + if (actor->flags == 0) { continue; } - switch (phi_s0->type) { + switch (actor->type) { case ACTOR_FALLING_ROCK: - update_obj_falling_rocks(phi_s0); + update_obj_falling_rocks(actor); break; case ACTOR_GREEN_SHELL: - update_obj_green_shell(phi_s0); + update_obj_green_shell(actor); break; case ACTOR_RED_SHELL: - update_obj_red_blue_shell(phi_s0); + update_obj_red_blue_shell(actor); break; case ACTOR_BLUE_SPINY_SHELL: - update_obj_red_blue_shell(phi_s0); + update_obj_red_blue_shell(actor); break; case ACTOR_KIWANO_FRUIT: - update_obj_kiwano_fruit(phi_s0); + update_obj_kiwano_fruit(actor); break; case ACTOR_BANANA: - update_obj_banana(phi_s0); + update_obj_banana(actor); break; case ACTOR_PADDLE_WHEEL_BOAT: - update_obj_paddle_wheel(phi_s0); + update_obj_paddle_wheel(actor); break; case ACTOR_TRAIN_ENGINE: - update_obj_train_engine(phi_s0); + update_obj_train_engine(actor); break; case ACTOR_TRAIN_TENDER: - update_obj_train_car1(phi_s0); + update_obj_train_car1(actor); break; case ACTOR_TRAIN_PASSENGER_CAR: - update_obj_train_car2(phi_s0); + update_obj_train_car2(actor); break; case ACTOR_ITEM_BOX: - update_obj_item_box(phi_s0); + update_obj_item_box(actor); break; case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: - update_obj_item_box_hot_air_balloon(phi_s0); + update_obj_item_box_hot_air_balloon(actor); break; case ACTOR_FAKE_ITEM_BOX: - update_obj_fake_item_box(phi_s0); + update_obj_fake_item_box(actor); break; case ACTOR_PIRANHA_PLANT: - update_obj_piranha_plant(phi_s0); + update_obj_piranha_plant(actor); break; case ACTOR_BANANA_BUNCH: - update_obj_banana_bunch(phi_s0); + update_obj_banana_bunch(actor); break; case ACTOR_TRIPLE_GREEN_SHELL: - update_obj_triple_shell(phi_s0, ACTOR_GREEN_SHELL); + update_obj_triple_shell(actor, ACTOR_GREEN_SHELL); break; case ACTOR_TRIPLE_RED_SHELL: - update_obj_triple_shell(phi_s0, ACTOR_RED_SHELL); + update_obj_triple_shell(actor, ACTOR_RED_SHELL); break; case ACTOR_MARIO_RACEWAY_SIGN: - update_obj_mario_raceway_sign(phi_s0); + update_obj_mario_raceway_sign(actor); break; case ACTOR_WARIO_STADIUM_SIGN: - update_obj_wario_stadium_sign(phi_s0); + update_obj_wario_stadium_sign(actor); break; case ACTOR_RAILROAD_CROSSING: - update_obj_railroad_crossing(phi_s0); + update_obj_railroad_crossing(actor); break; case 2: case 3: @@ -4372,10 +4372,10 @@ void update_simple_objects(void) { case 31: case 32: case 33: - update_obj_trees_cacti_shrubs(phi_s0); + update_obj_trees_cacti_shrubs(actor); break; case ACTOR_YOSHI_VALLEY_EGG: - update_obj_yoshi_valley_egg(phi_s0); + update_obj_yoshi_valley_egg(actor); break; } } diff --git a/src/actors.h b/src/actors.h index ce39093e8..4396d68e2 100644 --- a/src/actors.h +++ b/src/actors.h @@ -4,6 +4,7 @@ #include "types.h" #include "actor_types.h" +void func_8029E158(void); void func_80296A50(struct ShellActor*); void actor_init(struct Actor*, f32*, s16*, f32*, s16); void func_80297230(Camera*, struct Actor*); @@ -321,67 +322,67 @@ extern Gfx D_0D0031E8[]; extern Gfx D_0D004B48[]; extern Gfx D_0D004BD8[]; -extern s8 D_0F04CBE0[]; -extern s8 D_0F04CE30[]; -extern s8 D_0F04D080[]; -extern s8 D_0F04D2D8[]; -extern s8 D_0F04D538[]; -extern s8 D_0F04D790[]; -extern s8 D_0F04D9FC[]; -extern s8 D_0F04DC5C[]; -extern s8 D_0F04DEB0[]; -extern s8 D_0F04E0DC[]; -extern s8 D_0F04E314[]; -extern s8 D_0F04E554[]; -extern s8 D_0F04E798[]; -extern s8 D_0F04E9F0[]; -extern s8 D_0F04EC4C[]; -extern s8 D_0F04EE88[]; -extern s8 D_0F04F45C[]; -extern s8 D_0F04F7A4[]; -extern s8 D_0F04FB3C[]; -extern s8 D_0F04FE28[]; -extern s8 D_0F050118[]; -extern s8 D_0F050468[]; -extern s8 D_0F050678[]; -extern s8 D_0F050D50[]; -extern s8 D_0F0513CC[]; -extern s8 D_0F051820[]; -extern s8 D_0F051C54[]; -extern s8 D_0F051FD8[]; -extern s8 D_0F05232C[]; -extern s8 D_0F0526B8[]; -extern s8 D_0F052A20[]; -extern s8 D_0F052D3C[]; -extern s8 D_0F05300C[]; -extern s8 D_0F0532F8[]; -extern s8 D_0F05363C[]; -extern s8 D_0F053950[]; -extern s8 D_0F053C34[]; -extern s8 D_0F053F74[]; -extern s8 D_0F054270[]; -extern s8 D_0F054518[]; -extern s8 D_0F05488C[]; -extern s8 D_0F054C3C[]; -extern s8 D_0F054ECC[]; -extern s8 D_0F0551C8[]; -extern s8 D_0F0554CC[]; -extern s8 D_0F055880[]; -extern s8 D_0F055BA0[]; -extern s8 D_0F055F10[]; -extern s8 D_0F0561AC[]; -extern s8 D_0F056408[]; -extern s8 D_0F05662C[]; -extern s8 D_0F05688C[]; -extern s8 D_0F056AD0[]; -extern s8 D_0F056CF0[]; -extern s8 D_0F056EC8[]; -extern s8 D_0F057084[]; -extern s8 D_0F057288[]; -extern s8 D_0F057590[]; -extern s8 D_0F057EB4[]; -extern s8 D_0F0581E4[]; -extern s8 D_0F058550[]; +extern u8 D_0F04CBE0[]; +extern u8 D_0F04CE30[]; +extern u8 D_0F04D080[]; +extern u8 D_0F04D2D8[]; +extern u8 D_0F04D538[]; +extern u8 D_0F04D790[]; +extern u8 D_0F04D9FC[]; +extern u8 D_0F04DC5C[]; +extern u8 D_0F04DEB0[]; +extern u8 D_0F04E0DC[]; +extern u8 D_0F04E314[]; +extern u8 D_0F04E554[]; +extern u8 D_0F04E798[]; +extern u8 D_0F04E9F0[]; +extern u8 D_0F04EC4C[]; +extern u8 D_0F04EE88[]; +extern u8 D_0F04F45C[]; +extern u8 D_0F04F7A4[]; +extern u8 D_0F04FB3C[]; +extern u8 D_0F04FE28[]; +extern u8 D_0F050118[]; +extern u8 D_0F050468[]; +extern u8 D_0F050678[]; +extern u8 D_0F050D50[]; +extern u8 D_0F0513CC[]; +extern u8 D_0F051820[]; +extern u8 D_0F051C54[]; +extern u8 D_0F051FD8[]; +extern u8 D_0F05232C[]; +extern u8 D_0F0526B8[]; +extern u8 D_0F052A20[]; +extern u8 D_0F052D3C[]; +extern u8 D_0F05300C[]; +extern u8 D_0F0532F8[]; +extern u8 D_0F05363C[]; +extern u8 D_0F053950[]; +extern u8 D_0F053C34[]; +extern u8 D_0F053F74[]; +extern u8 D_0F054270[]; +extern u8 D_0F054518[]; +extern u8 D_0F05488C[]; +extern u8 D_0F054C3C[]; +extern u8 D_0F054ECC[]; +extern u8 D_0F0551C8[]; +extern u8 D_0F0554CC[]; +extern u8 D_0F055880[]; +extern u8 D_0F055BA0[]; +extern u8 D_0F055F10[]; +extern u8 D_0F0561AC[]; +extern u8 D_0F056408[]; +extern u8 D_0F05662C[]; +extern u8 D_0F05688C[]; +extern u8 D_0F056AD0[]; +extern u8 D_0F056CF0[]; +extern u8 D_0F056EC8[]; +extern u8 D_0F057084[]; +extern u8 D_0F057288[]; +extern u8 D_0F057590[]; +extern u8 D_0F057EB4[]; +extern u8 D_0F0581E4[]; +extern u8 D_0F058550[]; extern s8 gTexture671A88[]; extern s8 gTexture6774D8[]; extern s8 gTextureShrub[]; diff --git a/src/audio/external.h b/src/audio/external.h index dfbc7aa3b..409b87280 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -140,6 +140,7 @@ void func_800CA49C(u8); void func_800CAACC(u8); void func_800CB134(); void func_800CB2C4(void); +void func_800C5CB8(void); // Based on SM64, this should be part of data.c's BSS section. Somehow. extern s32 gAudioErrorFlags; diff --git a/src/camera.h b/src/camera.h index e33fffa3a..8874e6147 100644 --- a/src/camera.h +++ b/src/camera.h @@ -61,6 +61,8 @@ void func_8001D794(Player*, Camera*, Vec3f, f32*, f32*, f32*, s16); void func_8001E0C4(Camera*, Player*, s8); void func_8001E8E8(Camera*, Player*, s8); void func_8001F87C(s32); +void func_8001EE98(Player*, Camera*, s8); +void func_8001F394(Player*, f32*); extern s32 D_80164A2C; extern f32 D_80164A30; diff --git a/src/camera_junk.c b/src/camera_junk.c index 0a3021ed2..5c2dd4eec 100644 --- a/src/camera_junk.c +++ b/src/camera_junk.c @@ -4,6 +4,7 @@ #include "camera.h" #include "camera_junk.h" #include "math_util.h" +#include "ceremony_and_credits.h" void setup_camera_ending_sequence(void) { Camera *camera; diff --git a/src/ceremony_and_credits.h b/src/ceremony_and_credits.h index c79bd8940..975984758 100644 --- a/src/ceremony_and_credits.h +++ b/src/ceremony_and_credits.h @@ -108,6 +108,8 @@ struct Cutscene { /* Function Prototypes */ +void init_cinematic_camera(void); +s32 func_80283648(Camera*); void vec3f_set_dupe(Vec3f, f32, f32, f32); void vec3s_set_dupe(Vec3s, s16, s16, s16); void vec3f_clear(Vec3f); diff --git a/src/code_800029B0.c b/src/code_800029B0.c index d1ad40e4e..f6337ac7a 100644 --- a/src/code_800029B0.c +++ b/src/code_800029B0.c @@ -1,6 +1,7 @@ #include #include #include "types.h" +#include "memory.h" #include "variables.h" #include "waypoints.h" #include "actors.h" @@ -9,14 +10,19 @@ #include "audio/external.h" #include "code_800029B0.h" #include +#include "code_802AAA70.h" +#include "memory.h" +#include "code_80091750.h" +#include "skybox_and_splitscreen.h" +#include "code_8006E9C0.h" +#include "spawn_players.h" +#include "staff_ghosts.h" +#include "render_courses.h" extern u16 D_800DC5A8; -extern struct Controller *gControllerOne[]; - extern s32 D_800DC510; extern u16 D_8015F6FE; -extern s16 D_800DC5B8; extern u16 D_80152308; extern s32 D_802BA038; extern s16 D_802BA048; @@ -32,39 +38,23 @@ extern s8 gCupSelection; extern s32 gScreenModeSelection; extern u32 D_8015F730; -extern u32 D_8015F734; -extern u32 gPrevLoadedAddress; +extern s32 D_8015F734; +extern u32 gNextFreeMemoryAddress; extern s32 D_80150120; extern f32 D_8015F738, D_8015F748, D_8015F758, D_8015F768, D_8015F778; extern Vec3f D_802B91C8; -// gfx? -extern s8 D_0F04F45C[]; -extern s8 D_0F04FE28[]; -extern s8 D_0F050118[]; -extern s8 D_0F051C54[]; -extern s8 D_0F051FD8[]; -extern s8 D_0F05232C[]; -extern s8 D_0F0526B8[]; -extern s8 D_0F052A20[]; -extern s8 D_0F052D3C[]; -extern s8 D_0F05300C[]; -extern s8 D_0F0532F8[]; -extern s8 D_0F05363C[]; -extern s8 D_0F053950[]; - extern struct ActorSpawnData D_06009570[]; extern struct ActorSpawnData D_06014330[]; extern f32 gCourseDirection; -extern s16 D_800DC5C8; s32 D_800DC5E0 = 32; -s16 D_800DC5E4 = 0; +u16 D_800DC5E4 = 0; // TODO: gPlayerWinningIndex (D_800DC5E8) accessed as word, D_800DC5EB as u8 s32 gPlayerWinningIndex = 0; @@ -75,9 +65,9 @@ struct UnkStruct_800DC5EC *D_800DC5F0 = &D_8015F480[1]; struct UnkStruct_800DC5EC *D_800DC5F4 = &D_8015F480[2]; struct UnkStruct_800DC5EC *D_800DC5F8 = &D_8015F480[3]; u16 D_800DC5FC = 0; -u8 *pAppNmiBuffer = &osAppNmiBuffer; +u8 *pAppNmiBuffer = (u8 *) &osAppNmiBuffer; s32 gIsMirrorMode = 0; -f32 D_800DC608 = 1.0f; +f32 vtxStretchY = 1.0f; Lights1 D_800DC610[] = { gdSPDefLights1(175, 175, 175, 255, 255, 255, 0, 0, 120), gdSPDefLights1(115, 115, 115, 255, 255, 255, 0, 0, 120), @@ -120,12 +110,12 @@ void setup_race(void) { if (gCurrentCourseId != gCurrentlyLoadedCourseId) { D_80150120 = 0; gCurrentlyLoadedCourseId = gCurrentCourseId; - gPrevLoadedAddress = D_8015F734; + gNextFreeMemoryAddress = D_8015F734; load_course(gCurrentCourseId); func_80295D88(); - D_8015F730 = gPrevLoadedAddress; + D_8015F730 = gNextFreeMemoryAddress; } else { - gPrevLoadedAddress = D_8015F730; + gNextFreeMemoryAddress = D_8015F730; } func_802969F8(); func_80005310(); @@ -162,7 +152,7 @@ void setup_race(void) { func_800CB2C4(); } - controller = *gControllerOne; + controller = gControllerOne; for (i = 0; i < 7; i++, controller++){ controller->rawStickX = 0; @@ -232,11 +222,11 @@ void func_80003040(void) { gCourseDirection = 1.0f; gPlayerCountSelection1 = 1; - set_segment_base_addr(3, (gPrevLoadedAddress + 0xFFFF7000)); + set_segment_base_addr(0x3, (void *) (gNextFreeMemoryAddress + 0xFFFF7000)); destroy_all_actors(); switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: - func_802A84F4(D_0F04F45C, 0x35B, 0x800); + dma_textures(D_0F04F45C, 0x35B, 0x800); place_segment_06(D_06009570); break; case COURSE_BOWSER_CASTLE: @@ -251,18 +241,18 @@ void func_80003040(void) { addActorToEmptySlot(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG); break; case COURSE_MOO_MOO_FARM: - func_802A84F4(D_0F04FE28, 0x3E8, 0x800); - func_802A84F4(D_0F050118, 0x3E8, 0x800); - func_802A84F4(D_0F051C54, 0x400, 0x800); - func_802A84F4(D_0F051FD8, 0x400, 0x800); - func_802A84F4(D_0F05232C, 0x400, 0x800); - func_802A84F4(D_0F0526B8, 0x400, 0x800); - func_802A84F4(D_0F052A20, 0x400, 0x800); - func_802A84F4(D_0F052D3C, 0x400, 0x800); - func_802A84F4(D_0F05300C, 0x400, 0x800); - func_802A84F4(D_0F0532F8, 0x400, 0x800); - func_802A84F4(D_0F05363C, 0x400, 0x800); - func_802A84F4(D_0F053950, 0x400, 0x800); + dma_textures(D_0F04FE28, 0x3E8, 0x800); + dma_textures(D_0F050118, 0x3E8, 0x800); + dma_textures(D_0F051C54, 0x400, 0x800); + dma_textures(D_0F051FD8, 0x400, 0x800); + dma_textures(D_0F05232C, 0x400, 0x800); + dma_textures(D_0F0526B8, 0x400, 0x800); + dma_textures(D_0F052A20, 0x400, 0x800); + dma_textures(D_0F052D3C, 0x400, 0x800); + dma_textures(D_0F05300C, 0x400, 0x800); + dma_textures(D_0F0532F8, 0x400, 0x800); + dma_textures(D_0F05363C, 0x400, 0x800); + dma_textures(D_0F053950, 0x400, 0x800); place_segment_06(D_06014330); break; case COURSE_SHERBET_LAND: diff --git a/src/code_80004740.c b/src/code_80004740.c index ea3053463..b802d2a26 100644 --- a/src/code_80004740.c +++ b/src/code_80004740.c @@ -274,7 +274,7 @@ GLOBAL_ASM("asm/non_matchings/code_80004740/func_80004DFC.s") s16 func_80004EAC(void *addr, s16 offset) { uintptr_t *item = segmented_to_virtual(addr); - struct stru_80004EAC *temp = segmented_to_virtual(item[offset]); + struct stru_80004EAC *temp = (struct stru_80004EAC *) segmented_to_virtual((void *) item[offset]); return temp->unk8 - 1; } \ No newline at end of file diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index d9b214fce..7f12f7d1d 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -4741,7 +4741,7 @@ void func_8000F2DC(void) { D_80163368->unk4 = (s32) temp_v0->unk2; D_80163368->unk8 = (s32) temp_v0->unk4; D_80163368->unkC = (s32) temp_v0->unk6; - D_80163598 = func_802A7B70(temp_v0->unk8 * 4); + D_80163598 = get_next_available_memory_addr(temp_v0->unk8 * 4); var_s5 = D_801645A0; var_s7 = D_80164590; var_s6 = D_80164580; @@ -4750,12 +4750,12 @@ void func_8000F2DC(void) { var_s3 = D_80164550; var_s1 = D_80163368; do { - *var_s3 = func_802A7B70(*var_s1 * 8); - *var_s4 = func_802A7B70(*var_s1 * 8); - *var_s2 = func_802A7B70(*var_s1 * 8); - *var_s6 = func_802A7B70(*var_s1 * 2); - *var_s7 = func_802A7B70(*var_s1 * 2); - temp_v0_2 = func_802A7B70(*var_s1 * 2); + *var_s3 = get_next_available_memory_addr(*var_s1 * 8); + *var_s4 = get_next_available_memory_addr(*var_s1 * 8); + *var_s2 = get_next_available_memory_addr(*var_s1 * 8); + *var_s6 = get_next_available_memory_addr(*var_s1 * 2); + *var_s7 = get_next_available_memory_addr(*var_s1 * 2); + temp_v0_2 = get_next_available_memory_addr(*var_s1 * 2); var_s5 += 4; var_s1 += 4; var_s3 += 4; diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h index 335f0ebb5..401ac8d41 100644 --- a/src/code_80005FD0.h +++ b/src/code_80005FD0.h @@ -28,6 +28,9 @@ struct unk_41F8 { /* Function Prototypes */ +void func_800070F4(void); +void func_80019DF4(void); +void func_80019E58(void); s16 func_80005FD0(Vec3f, Vec3f); s32 func_80006018(f32, f32, f32, f32, f32, f32, f32, f32); void func_80006114(Vec3f, Vec3f, s16); @@ -39,7 +42,7 @@ s32 func_80008E58(s32, s32); void func_80008F38(s32); void func_80009000(s32); void func_800090F0(s32, Player*); -void func_800097E0(); +void func_800097E0(void); void func_80009B60(s32); s32 func_8000B7E4(s32, u16); s32 func_8000B820(s32); diff --git a/src/code_800431B0.c b/src/code_800431B0.c index 0432f104d..2641eb03f 100644 --- a/src/code_800431B0.c +++ b/src/code_800431B0.c @@ -6986,7 +6986,7 @@ void func_800579F8(s32 arg0, s32 arg1, s8 *arg2, s32 arg3) { func_80057778(); } -void func_80057A50(s32 arg0, s32 arg1, s8 *arg2, s32 arg3) { +void func_80057A50(s32 arg0, s32 arg1, char *arg2, s32 arg3) { load_debug_font(); debug_print_string(&arg0, &arg1, arg2); func_8005762C(&arg0, &arg1, arg3, 10); diff --git a/src/code_800431B0.h b/src/code_800431B0.h index de70845f8..677617d60 100644 --- a/src/code_800431B0.h +++ b/src/code_800431B0.h @@ -383,7 +383,7 @@ void func_80057908(s32, s32, s8*, s32); void func_80057960(s32, s32, s8*, s32); void func_800579B8(s32, s32, s8*); void func_800579F8(s32, s32, s8*, s32); -void func_80057A50(s32, s32, s8*, s32); +void func_80057A50(s32, s32, char*, s32); void func_80057AA8(s32, s32, s8*, s32); void func_80057B14(s32, s32, s8*, s32); void func_80057B80(s32, s32, s8*, s32); diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 0305e10ae..836ca50d0 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -2314,7 +2314,7 @@ block_10: GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005C360.s") #endif -void func_8005C64C(s32 arg0) { +void func_8005C64C(s32 *arg0) { } @@ -2839,7 +2839,7 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005D1F4.s") #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802A84F4(? *, ?, ?); // extern +s32 dma_textures(? *, ?, ?); // extern extern ? D_0F05D1E8; extern ? D_0F05D420; extern ? D_0F05D674; @@ -2917,44 +2917,44 @@ extern ? gTextureLightningBolt0; extern ? gTextureLightningBolt1; void func_8005D290(void) { - D_8018D488 = func_802A84F4(&gTexture69C80C, 0x400, 0x400); - D_8018D474 = func_802A84F4(&gTextureKartShadow, 0x1000, 0x1000); - D_8018D420 = func_802A84F4(&gTexture69B03C, 0x100, 0x100); - D_8018D424 = func_802A84F4(&gTexture69B140, 0x400, 0x400); - D_8018D478 = func_802A84F4(&gTexture69C1E8, 0x200, 0x200); - D_8018D480 = func_802A84F4(&gTexture69BA28, 0x400, 0x400); - D_8018D484 = func_802A84F4(&gTexture69B960, 0x400, 0x400); - D_8018D48C = func_802A84F4(&gTexture69C354, 0x400, 0x400); - D_8018D494 = func_802A84F4(&gTexture69C4E4, 0x400, 0x400); + D_8018D488 = dma_textures(&gTexture69C80C, 0x400, 0x400); + D_8018D474 = dma_textures(&gTextureKartShadow, 0x1000, 0x1000); + D_8018D420 = dma_textures(&gTexture69B03C, 0x100, 0x100); + D_8018D424 = dma_textures(&gTexture69B140, 0x400, 0x400); + D_8018D478 = dma_textures(&gTexture69C1E8, 0x200, 0x200); + D_8018D480 = dma_textures(&gTexture69BA28, 0x400, 0x400); + D_8018D484 = dma_textures(&gTexture69B960, 0x400, 0x400); + D_8018D48C = dma_textures(&gTexture69C354, 0x400, 0x400); + D_8018D494 = dma_textures(&gTexture69C4E4, 0x400, 0x400); D_8018D490 = D_8018D48C; - D_8018D498 = func_802A84F4(&gTexture69B378, 0x1000, 0x1000); - D_8018D4BC = func_802A84F4(&D_0F05E19C, 0x800, 0x800); - D_8018D4C0 = func_802A84F4(&D_0F05E3E0, 0x800, 0x800); - D_8018D49C = func_802A84F4(&gTexture69C9C4, 0x200, 0x200); - D_8018D4A0 = func_802A84F4(&gTextureBoingExclamation, 0x800, 0x800); - D_8018D4A4 = func_802A84F4(&D_0F05DDFC, 0x800, 0x800); - D_8018D4A8 = func_802A84F4(&D_0F05DFC0, 0x800, 0x800); - D_8018D4AC = func_802A84F4(&D_0F05D674, 0x800, 0x800); - D_8018D4B0 = func_802A84F4(&D_0F05DA50, 0x800, 0x800); - D_8018D4B4 = func_802A84F4(&D_0F05D1E8, 0x800, 0x800); - D_8018D4B8 = func_802A84F4(&D_0F05D420, 0x800, 0x800); - D_8018D438 = func_802A84F4(&gTexture69CB84, 0x800, 0x800); - D_8018D43C = func_802A84F4(&gTexture69CCEC, 0x800, 0x800); - D_8018D440 = func_802A84F4(&gTexture69CEB8, 0x800, 0x800); - D_8018D444 = func_802A84F4(&gTexture69D148, 0x800, 0x800); - D_8018D448 = func_802A84F4(&gTexture69D4E0, 0x800, 0x800); - D_8018D44C = func_802A84F4(&gTexture69D8FC, 0x800, 0x800); - D_8018D450 = func_802A84F4(&gTexture69DCB4, 0x800, 0x800); - D_8018D454 = func_802A84F4(&gTexture69DFA0, 0x800, 0x800); - D_8018D458 = func_802A84F4(&gTexture69E25C, 0x800, 0x800); - D_8018D45C = func_802A84F4(&gTexture69E518, 0x800, 0x800); - D_8018D460 = func_802A84F4(&gTexture69E7A8, 0x800, 0x800); - D_8018D464 = func_802A84F4(&gTexture69EA18, 0x800, 0x800); - D_8018D468 = func_802A84F4(&gTexture69EC54, 0x800, 0x800); - D_8018D46C = func_802A84F4(&gTexture69EE38, 0x800, 0x800); - D_8018D470 = func_802A84F4(&gTexture69EFE0, 0x800, 0x800); - D_8018D4C4 = func_802A84F4(&gTextureLightningBolt0, 0x800, 0x800); - D_8018D4C8 = func_802A84F4(&gTextureLightningBolt1, 0x800, 0x800); + D_8018D498 = dma_textures(&gTexture69B378, 0x1000, 0x1000); + D_8018D4BC = dma_textures(&D_0F05E19C, 0x800, 0x800); + D_8018D4C0 = dma_textures(&D_0F05E3E0, 0x800, 0x800); + D_8018D49C = dma_textures(&gTexture69C9C4, 0x200, 0x200); + D_8018D4A0 = dma_textures(&gTextureBoingExclamation, 0x800, 0x800); + D_8018D4A4 = dma_textures(&D_0F05DDFC, 0x800, 0x800); + D_8018D4A8 = dma_textures(&D_0F05DFC0, 0x800, 0x800); + D_8018D4AC = dma_textures(&D_0F05D674, 0x800, 0x800); + D_8018D4B0 = dma_textures(&D_0F05DA50, 0x800, 0x800); + D_8018D4B4 = dma_textures(&D_0F05D1E8, 0x800, 0x800); + D_8018D4B8 = dma_textures(&D_0F05D420, 0x800, 0x800); + D_8018D438 = dma_textures(&gTexture69CB84, 0x800, 0x800); + D_8018D43C = dma_textures(&gTexture69CCEC, 0x800, 0x800); + D_8018D440 = dma_textures(&gTexture69CEB8, 0x800, 0x800); + D_8018D444 = dma_textures(&gTexture69D148, 0x800, 0x800); + D_8018D448 = dma_textures(&gTexture69D4E0, 0x800, 0x800); + D_8018D44C = dma_textures(&gTexture69D8FC, 0x800, 0x800); + D_8018D450 = dma_textures(&gTexture69DCB4, 0x800, 0x800); + D_8018D454 = dma_textures(&gTexture69DFA0, 0x800, 0x800); + D_8018D458 = dma_textures(&gTexture69E25C, 0x800, 0x800); + D_8018D45C = dma_textures(&gTexture69E518, 0x800, 0x800); + D_8018D460 = dma_textures(&gTexture69E7A8, 0x800, 0x800); + D_8018D464 = dma_textures(&gTexture69EA18, 0x800, 0x800); + D_8018D468 = dma_textures(&gTexture69EC54, 0x800, 0x800); + D_8018D46C = dma_textures(&gTexture69EE38, 0x800, 0x800); + D_8018D470 = dma_textures(&gTexture69EFE0, 0x800, 0x800); + D_8018D4C4 = dma_textures(&gTextureLightningBolt0, 0x800, 0x800); + D_8018D4C8 = dma_textures(&gTextureLightningBolt1, 0x800, 0x800); } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005D290.s") diff --git a/src/code_80057C60.h b/src/code_80057C60.h index d435c1ad6..431adf4dc 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -27,6 +27,7 @@ void func_80058C20(u32); void func_80058DB4(u32); void func_80058F48(); void func_80058F78(); +void func_80059AC8(void); void func_80059024(); void func_8005902C(); @@ -76,7 +77,7 @@ void func_8005AB20(); void func_8005B914(); void func_8005C360(f32); -void func_8005C64C(s32); +void func_8005C64C(s32*); void func_8005C654(s32*); void func_8005C65C(s32); void func_8005C6B4(s8, s16*, s16*, s16*); diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index c9ae6c87e..1ecee68d0 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -272,7 +272,7 @@ void func_8006EEE8(s32 courseId) { temp_t0 = courseId * 2; temp_a1 = D_800E5520[courseId]; sp1C = temp_t0; - D_8018D240 = func_802A84F4(gCourseOutlineTextures[courseId], (u32) temp_a1, (u32) temp_a1); + D_8018D240 = dma_textures(gCourseOutlineTextures[courseId], (u32) temp_a1, (u32) temp_a1); temp_v1 = &D_800E5548[temp_t0]; D_8018D2B0 = temp_v1->unk0; D_8018D2B8 = temp_v1->unk2; @@ -409,7 +409,7 @@ void func_8006F008(void) { } switch ((u32) gCurrentCourseId) { case 0: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust5, 0x00000443U, 0x00001000U); + D_8018D220 = dma_textures((s32) &gTextureExhaust5, 0x00000443U, 0x00001000U); D_8018D2A0 = 0.022f; D_8018D2E0 = 6; D_8018D2E8 = 0x001C; @@ -434,14 +434,14 @@ block_26: D_8018D2E8 = 0x0030; break; case 3: - D_80165880 = func_802A84F4((s32) &D_0F0D0E50, 0x00004CC2U, 0x0000D980U); + D_80165880 = dma_textures((s32) &D_0F0D0E50, 0x00004CC2U, 0x0000D980U); D_8018D2A0 = 0.016f; D_8018D2C0.unk0 = 0x0106; D_8018D2E0 = 0x0037; D_8018D2E8 = 0x0027; break; case 4: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust0, 0x00000479U, 0x00000C00U); + D_8018D220 = dma_textures((s32) &gTextureExhaust0, 0x00000479U, 0x00000C00U); D_8018D2A0 = 0.018f; D_8018D2E0 = 0x003D; D_8018D2E8 = 0x0026; @@ -456,14 +456,14 @@ block_26: D_8018D310 = 0x00FF; break; case 6: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust3, 0x000003C8U, 0x00001000U); + D_8018D220 = dma_textures((s32) &gTextureExhaust3, 0x000003C8U, 0x00001000U); D_8018D2A0 = 0.014f; D_8018D2C0.unk0 = 0x010C; D_8018D2E0 = 0x0028; D_8018D2E8 = 0x0015; break; case 7: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust4, 0x000003F8U, 0x00001000U); + D_8018D220 = dma_textures((s32) &gTextureExhaust4, 0x000003F8U, 0x00001000U); D_8018D2C0.unk0 = 0x0106; D_8018D2A0 = 0.014f; D_8018D2E0 = 0x0025; @@ -473,7 +473,7 @@ block_26: D_80165728 = -0x014A; break; case 8: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust2, 0x000004F4U, 0x00000C00U); + D_8018D220 = dma_textures((s32) &gTextureExhaust2, 0x000004F4U, 0x00000C00U); D_8018D2A0 = 0.0155f; D_8018D2C0.unk0 = 0x010F; D_8018D2E0 = 0x002D; @@ -483,7 +483,7 @@ block_26: D_80165728 = -0x00D7; break; case 9: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust0, 0x00000479U, 0x00000C00U); + D_8018D220 = dma_textures((s32) &gTextureExhaust0, 0x00000479U, 0x00000C00U); D_8018D2A0 = 0.0155f; D_8018D2C0.unk0 = 0x010F; D_8018D2E0 = 0x0012; @@ -498,13 +498,13 @@ block_26: case 11: D_8018D2C0.unk0 = 0x0107; D_8018D2D8.unk0 = 0x00A5; - D_8018D220 = func_802A84F4((s32) &gTextureExhaust5, 0x00000443U, 0x00001000U); + D_8018D220 = dma_textures((s32) &gTextureExhaust5, 0x00000443U, 0x00001000U); D_8018D2A0 = 0.015f; D_8018D2E0 = 0x0037; D_8018D2E8 = 0x001B; break; case 12: - D_8018D220 = func_802A84F4((s32) &gTextureExhaust1, 0x00000485U, 0x00000C00U); + D_8018D220 = dma_textures((s32) &gTextureExhaust1, 0x00000485U, 0x00000C00U); D_8018D2A0 = 0.015f; D_8018D2C0.unk0 = 0x0106; D_8018D2E0 = 0x0034; diff --git a/src/code_80091750.c b/src/code_80091750.c index 41945d2d0..d7da31a92 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -195,7 +195,7 @@ void swap_values(s32 *arg0, s32 *arg1) { s32 func_80091D74(); /* extern */ void func_800C97C4(s32); /* extern */ void func_800C9D0C(s32); /* extern */ -void *func_802AA88C(? *, ? *); /* extern */ +void *decompress_segments(? *, ? *); /* extern */ void load_save_data(); /* extern */ extern void *D_800DC5EC; extern s32 D_800E86A4; @@ -214,7 +214,7 @@ extern s8 D_8018EDF6; extern s8 D_8018EE0C; extern u32 _course_mario_raceway_dl_mio0SegmentRomStart; extern s32 _data_825800SegmentRomStart; -extern s32 gPrevLoadedAddress; +extern s32 gNextFreeMemoryAddress; static s8 D_800E852C = 1; void func_80091B78(void) { @@ -236,14 +236,14 @@ void func_80091B78(void) { } } if (gMenuSelection == LOGO_INTRO_MENU) { - gPrevLoadedAddress = D_8015F734; - set_segment_base_addr(6, func_802AA88C(&_data_825800SegmentRomStart, &_course_mario_raceway_dl_mio0SegmentRomStart)); + gNextFreeMemoryAddress = D_8015F734; + set_segment_base_addr(6, decompress_segments(&_data_825800SegmentRomStart, &_course_mario_raceway_dl_mio0SegmentRomStart)); } - gPrevLoadedAddress = D_8015F734; - D_8018D9B0 = func_802A7B70(0x000900B0); - D_8018D9B4 = func_802A7B70(0x0000CE00); - D_8018D9B8 = func_802A7B70(0x00012C00); - D_8018D9C0 = func_802A7B70(0x00001000); + gNextFreeMemoryAddress = D_8015F734; + D_8018D9B0 = get_next_available_memory_addr(0x000900B0); + D_8018D9B4 = get_next_available_memory_addr(0x0000CE00); + D_8018D9B8 = get_next_available_memory_addr(0x00012C00); + D_8018D9C0 = get_next_available_memory_addr(0x00001000); func_800AF9B0(); D_8018EE0C = 0; var_v0 = &D_8018E7AC; @@ -364,10 +364,10 @@ extern u8 gControllerBits; void func_80091FA4(void) { ? *var_v1; - D_8018D9B4 = func_802A7B70(0x00002800); - D_8018D9B0 = func_802A7B70(0x000124F8); - D_8018D9B8 = func_802A7B70(0x00001000); - D_8018D9BC = func_802A7B70(4); + D_8018D9B4 = get_next_available_memory_addr(0x00002800); + D_8018D9B0 = get_next_available_memory_addr(0x000124F8); + D_8018D9B8 = get_next_available_memory_addr(0x00001000); + D_8018D9BC = get_next_available_memory_addr(4); var_v1 = &D_8018E7AC; do { var_v1 += 1; @@ -1238,10 +1238,10 @@ extern s8 D_8018E838; void func_80093E60(void) { ? *var_v1; - D_8018D9B4 = func_802A7B70(0x00002800); - D_8018D9B0 = func_802A7B70(0x000124F8); - D_8018D9B8 = func_802A7B70(0x00001000); - D_8018D9BC = func_802A7B70(4); + D_8018D9B4 = get_next_available_memory_addr(0x00002800); + D_8018D9B0 = get_next_available_memory_addr(0x000124F8); + D_8018D9B8 = get_next_available_memory_addr(0x00001000); + D_8018D9BC = get_next_available_memory_addr(4); var_v1 = &D_8018E7AC; do { var_v1 += 1; diff --git a/src/code_80091750.h b/src/code_80091750.h index 56f1985ea..c789e5c02 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -58,6 +58,10 @@ typedef struct { /* Function Prototypes */ +void func_80091EE4(void); +void func_80091FA4(void); +void func_80093A30(s32); +void func_80093A5C(u32); f64 exponent_by_squaring(f64, s32); f64 func_80091A6C(f64, s32); f64 func_80091AC0(f64, s32*); diff --git a/src/code_800AF9B0.c b/src/code_800AF9B0.c index f185e6564..b53ddeed2 100644 --- a/src/code_800AF9B0.c +++ b/src/code_800AF9B0.c @@ -33,8 +33,8 @@ Vtx *D_8018EDBC; #define SQ(x) ((x) * (x)) void func_800AF9B0(void) { - D_8018EDB8 = (void *)func_802A7B70(480 * sizeof(Vtx)); - D_8018EDBC = (void *)func_802A7B70(480 * sizeof(Vtx)); + D_8018EDB8 = (void *)get_next_available_memory_addr(480 * sizeof(Vtx)); + D_8018EDBC = (void *)get_next_available_memory_addr(480 * sizeof(Vtx)); } // could be a normal vertex, not a color... diff --git a/src/code_80280000.c b/src/code_80280000.c index 78488f691..39de208d3 100644 --- a/src/code_80280000.c +++ b/src/code_80280000.c @@ -13,6 +13,14 @@ #include "code_80281780.h" #include "skybox_and_splitscreen.h" #include +#include "code_80091750.h" +#include "code_8006E9C0.h" +#include "code_800029B0.h" +#include "ceremony_and_credits.h" +#include "code_80281C40.h" +#include "code_80057C60.h" +#include "actors.h" +#include "render_courses.h" void func_80280000(void) { func_802966A0(); @@ -22,8 +30,10 @@ void func_80280000(void) { } void func_80280038(void) { + u16 perspNorm; Camera *camera = &cameras[0]; - u16 sp44[36]; + UNUSED s32 pad; + Mat4 matrix; D_80150112 = 0; D_80164AF0 = 0; @@ -32,15 +42,16 @@ void func_80280038(void) { func_802A53A4(); init_rdp(); func_80057FC4(0); + gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp44[37], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp44[37]); + guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); gCurrentCourseId = gCreditsCourseId; - mtxf_identity(&sp44); - func_802B4FF8(&sp44, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); func_80295A38(D_800DC5EC); func_802A3008(D_800DC5EC); func_80058090(0); @@ -114,10 +125,10 @@ void load_credits(void) { D_800DC5EC->screenStartY = 120; gScreenModeSelection = SCREEN_MODE_1P; gActiveScreenMode = SCREEN_MODE_1P; - gPrevLoadedAddress = D_8015F734; + gNextFreeMemoryAddress = D_8015F734; load_course(gCurrentCourseId); - D_8015F730 = gPrevLoadedAddress; - set_segment_base_addr(0xB, func_802AA88C(&_data_821D10SegmentRomStart, &_data_825800SegmentRomStart)); + D_8015F730 = gNextFreeMemoryAddress; + set_segment_base_addr(0xB, (void *) decompress_segments(&_data_821D10SegmentRomStart, &_data_825800SegmentRomStart)); D_8015F6EA = -0x15A1; D_8015F6EE = -0x15A1; D_8015F6F2 = -0x15A1; @@ -130,7 +141,7 @@ void load_credits(void) { D_8015F588 = 0; D_800DC5BC = 0; D_800DC5C8 = 0; - D_8015F580 = gPrevLoadedAddress; + D_8015F580 = (mk64_surface_map_ram *) gNextFreeMemoryAddress; camera->pos[0] = 1400.0f; camera->pos[1] = 300.0f; camera->pos[2] = 1400.0f; @@ -146,6 +157,6 @@ void load_credits(void) { func_80093E60(); func_80092688(); if (D_800DC5EC) {} - D_801625F8 = ((s32)gHeapEndPtr - gPrevLoadedAddress); + D_801625F8 = ((s32)gHeapEndPtr - gNextFreeMemoryAddress); D_801625FC = ((f32)D_801625F8 / 1000.0f); } diff --git a/src/code_80280000.h b/src/code_80280000.h index 1b0cbda1e..3c1f327ea 100644 --- a/src/code_80280000.h +++ b/src/code_80280000.h @@ -24,7 +24,7 @@ extern s32 D_802874A0; extern u16 D_80164714, D_80164716, D_80164718; extern u16 D_800DC5E4; -extern u32 D_802874FC; +extern s32 D_802874FC; extern u16 D_800DC518; diff --git a/src/code_80280650.c b/src/code_80280650.c index cc29f9d17..2c9c789b8 100644 --- a/src/code_80280650.c +++ b/src/code_80280650.c @@ -277,9 +277,9 @@ void func_80280FA8(s32 arg0) { void func_80280FB0(void) { D_802874E0 = 0; - D_802874F8 = func_802A7B70(0x3B60); + D_802874F8 = get_next_available_memory_addr(0x3B60); bzero(D_802874F8, 0x3B60); - func_80280734(&D_80284E88); + func_80280734((struct UnkStruct80280658 *)&D_80284E88); } void func_80280FFC(void) { diff --git a/src/code_80280650.h b/src/code_80280650.h index 5c505af0a..ac429226f 100644 --- a/src/code_80280650.h +++ b/src/code_80280650.h @@ -66,6 +66,7 @@ struct UnkStruct_8028088C { s32 unk3C; }; +void func_80281438(void); void func_80280650(); void func_80280658(struct UnkStruct_80280658*); struct UnkStruct_80280658 *func_802806C8(); @@ -96,7 +97,7 @@ extern struct UnkStruct_80280658 *D_80284E7C; extern s32 D_80284E88; extern s32 D_802874E0; extern s8 D_802874F4; -extern s32 D_802874D4; +extern Gfx *D_802874D4; extern s32 D_802874FC; extern Mat4 D_80287500; extern s16 D_80164AF0; diff --git a/src/code_80281780.c b/src/code_80281780.c index ac0b980a9..3f58bf9b6 100644 --- a/src/code_80281780.c +++ b/src/code_80281780.c @@ -11,6 +11,8 @@ #include "code_8006E9C0.h" #include "code_80280650.h" #include "code_80281780.h" +#include "code_80005FD0.h" +#include "code_802AAA70.h" // unk4 is buttonDown? void func_80281780(void) { @@ -93,13 +95,13 @@ void load_ending_sequence_royalraceway(void) { D_800DC5EC->screenStartX = 160; D_800DC5EC->screenStartY = 120; gScreenModeSelection = SCREEN_MODE_1P; - gPrevLoadedAddress = (s32) D_8015F734; + gNextFreeMemoryAddress = (s32) D_8015F734; gActiveScreenMode = SCREEN_MODE_1P; gModeSelection = GRAND_PRIX; load_course(gCurrentCourseId); - D_8015F730 = (s32) gPrevLoadedAddress; - set_segment_base_addr(0xB, func_802AA88C(&_data_821D10SegmentRomStart, &_data_825800SegmentRomStart)); - set_segment_base_addr(6, func_802AA88C(&_course_banshee_boardwalk_dl_mio0SegmentRomStart, &_course_yoshi_valley_dl_mio0SegmentRomStart)); + D_8015F730 = (s32) gNextFreeMemoryAddress; + set_segment_base_addr(0xB, (void *) decompress_segments(&_data_821D10SegmentRomStart, &_data_825800SegmentRomStart)); + set_segment_base_addr(6, (void *) decompress_segments(&_course_banshee_boardwalk_dl_mio0SegmentRomStart, &_course_yoshi_valley_dl_mio0SegmentRomStart)); D_8015F8E4 = -2000.0f; D_8015F6EA = -0x15A1; @@ -116,7 +118,7 @@ void load_ending_sequence_royalraceway(void) { D_8015F588 = (u16)0; D_800DC5BC = (u16)0; D_800DC5C8 = (u16)0; - D_8015F580 = (s32) gPrevLoadedAddress; + D_8015F580 = (mk64_surface_map_ram *) gNextFreeMemoryAddress; // @bug these segmented addresses need to be symbols for mobility // This syntax is required to match func_802AF5AC(0x70067E8, -1); @@ -138,6 +140,6 @@ void load_ending_sequence_royalraceway(void) { func_80280FB0(); func_802816B8(); func_80093E60(); - D_801625F8 = (s32) gHeapEndPtr - gPrevLoadedAddress; + D_801625F8 = (s32) gHeapEndPtr - gNextFreeMemoryAddress; D_801625FC = ((f32) D_801625F8 / 1000.0f); } diff --git a/src/code_80281780.h b/src/code_80281780.h index 5126e1bf3..3433a8eb1 100644 --- a/src/code_80281780.h +++ b/src/code_80281780.h @@ -9,9 +9,8 @@ void func_802818BC(void); void load_ending_sequence_royalraceway(void); -extern int func_802AA88C(); +extern int decompress_segments(); extern u32 set_segment_base_addr(); -extern void load_course(); extern void func_80093E60(); @@ -32,7 +31,7 @@ extern u16 D_800DC5BC; extern u16 D_800DC5C8; extern struct UnkStruct_800DC5EC *D_800DC5EC; -extern s32 gMenuSelectionFromEndingSequence; //D_80287550; +extern u32 gMenuSelectionFromEndingSequence; //D_80287550; extern s32 D_80287554; extern f32 D_801647A4; extern f32 D_80150130[]; diff --git a/src/code_80281C40.c b/src/code_80281C40.c index 481086a40..121bdd2d2 100644 --- a/src/code_80281C40.c +++ b/src/code_80281C40.c @@ -10,12 +10,13 @@ #include "code_80280650.h" #include "code_80281C40.h" #include "ceremony_and_credits.h" +#include "code_8001F980.h" void func_80281C40(void) { s32 i; for (i = 0; i < D_802874FC; i++) { - func_800579F8(D_80287560[i].unk0, D_80287560[i].unk2, D_80287560[i].unk8, D_80287560[i].unk4); + func_800579F8(D_80287560[i].unk0, D_80287560[i].unk2, (s8 *) D_80287560[i].unk8, D_80287560[i].unk4); } } @@ -30,10 +31,11 @@ void func_80281CB4(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { } void func_80281D00(void) { - // could be a struct, - // but for now we have the oddest way to match this function Camera *camera = &cameras[0]; - u16 sp64[46]; + UNUSED s32 pad[3]; + u16 perspNorm; + Mat4 matrix; + UNUSED s32 pad2[3]; func_802A53A4(); init_rdp(); @@ -48,13 +50,13 @@ void func_80281D00(void) { } func_8028150C(); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective((Mtx*) &gGfxPool->mtxPool[1], &sp64[39], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp64[39]); + guPerspective((Mtx*) &gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt((Mtx*) &gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(&sp64[6]); - func_802B4FF8(&sp64[6], 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); gSPDisplayList(gDisplayListHead++, &D_00284F70); func_800212B4(); gSPDisplayList(gDisplayListHead++, &D_00284EE0); diff --git a/src/code_802AAA70.c b/src/code_802AAA70.c index 1af3aa79c..2a2d242bb 100644 --- a/src/code_802AAA70.c +++ b/src/code_802AAA70.c @@ -2341,7 +2341,7 @@ extern s16 D_8015F6E8; extern s16 D_8015F6EA; extern s16 D_8015F6F0; extern s16 D_8015F6F2; -extern s32 gPrevLoadedAddress; +extern s32 gNextFreeMemoryAddress; void func_802AF314(void) { s32 sp4C; @@ -2368,7 +2368,7 @@ void func_802AF314(void) { var_v0->unk-E = 0; } while (var_v0 != &gNumActors); D_8015F58A = 0; - D_8015F584 = gPrevLoadedAddress; + D_8015F584 = gNextFreeMemoryAddress; var_s7 = 0; temp_s6 = (s32) (D_8015F6E8 - D_8015F6EA) / 32; temp_fp = (s32) (D_8015F6F0 - D_8015F6F2) / 32; diff --git a/src/code_802AAA70.h b/src/code_802AAA70.h index 6f838d459..c4bac8037 100644 --- a/src/code_802AAA70.h +++ b/src/code_802AAA70.h @@ -23,7 +23,7 @@ s32 func_802AF0FC(s16, s16, s16, s16, u16); void func_802AF314(); void func_802AF588(s32); void func_802AF5AC(s32, s8); -void func_802AF5D8(u32, s8, s32); +void func_802AF5D8(u32, s8, u16); void func_802AF7B4(uintptr_t, s32, s32); void func_802AF8BC(uintptr_t, s8, u8, u8, u8); void func_802AF9F0(Vec3f, f32, Vec3f); diff --git a/src/crash_screen.c b/src/crash_screen.c index 72b2cad31..fa7b6cace 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -6,7 +6,7 @@ OSThread D_80162790; ALIGNED8 u8 gDebugThreadStack[0x400]; OSMesgQueue D_80162D40; OSMesg D_80162D58; -uintptr_t pFramebuffer; +uintptr_t *pFramebuffer; s32 sButtonSequenceIndex; #define DRAW_CODE 0xFFFF @@ -219,7 +219,7 @@ void thread9_crash_screen(UNUSED void *arg0) if (thread) { // Run only on the first iteration. if (sCounter == 0) { - crash_screen_draw_square(pFramebuffer); + crash_screen_draw_square((u16 *)pFramebuffer); while(1) { @@ -238,7 +238,7 @@ void thread9_crash_screen(UNUSED void *arg0) break; } } - crash_screen_draw_info(pFramebuffer, thread); + crash_screen_draw_info((u16 *) pFramebuffer, thread); } if (sCounter < 5) { diff --git a/src/kart_dma.c b/src/kart_dma.c index 8b841d40e..351e8f238 100644 --- a/src/kart_dma.c +++ b/src/kart_dma.c @@ -128,22 +128,22 @@ void func_80027040(Player *player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) { if (((temp & 0x80) == 0x80) || ((temp & 0x40) == 0x40) || ((temp & 0x80000) == 0x80000) || ((temp & 0x800000) == 0x800000) || ((temp & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { if (player->unk_244[arg2] != 0) { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable1[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable1[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } else { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } } else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) || ((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], 0x780U); // I think there's something off with the "player->unk_0A8 >> 8" // I don't like that right-shift - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureGroup18s[player->characterId][player->unk_0A8 >> 8])], &D_802DFB80[arg4][arg3][arg1], 0x900, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureGroup18s[player->characterId][player->unk_0A8 >> 8])], &D_802DFB80[arg4][arg3][arg1], 0x900, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } else { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } } @@ -155,10 +155,10 @@ void func_80027560(Player *player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) { { if (player->unk_244[arg2] != 0) { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable1[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable1[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); } else { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); } } else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) || ((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) @@ -166,28 +166,28 @@ void func_80027560(Player *player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], 0x780); // I think there's something off with the "player->unk_0A8 >> 8" // I don't like that right-shift - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureGroup18s[player->characterId][player->unk_0A8 >> 8])], &D_802DFB80[arg4][arg3][arg1], 0x900, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureGroup18s[player->characterId][player->unk_0A8 >> 8])], &D_802DFB80[arg4][arg3][arg1], 0x900, &gDmaMesgQueue); } else { osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTable0[player->characterId][player->unk_24C[arg2]][player->unk_244[arg2]])], &D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); } } void func_80027A20(Player *player, s8 arg1, s8 arg2, s8 arg3) { // Weird typecasting is being done here. We define D_802F1F80 as a 3-dimensional u32 array, // but its better to understand it as a 3-dimensional struct_D_802F1F80 array. - struct_D_802F1F80 *temp_s0 = &D_802F1F80[arg3][arg2][arg1 << 7]; + struct_D_802F1F80 *temp_s0 = (struct_D_802F1F80 *) &D_802F1F80[arg3][arg2][arg1 << 7]; switch(gActiveScreenMode) { case SCREEN_MODE_1P: case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: osInvalDCache(temp_s0, sizeof(struct_D_802F1F80)); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartPalettes[player->characterId])], temp_s0, sizeof(struct_D_802F1F80), &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartPalettes[player->characterId])], temp_s0, sizeof(struct_D_802F1F80), &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); break; case SCREEN_MODE_3P_4P_SPLITSCREEN: osInvalDCache(temp_s0, sizeof(struct_D_802F1F80)); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartPalettes[player->characterId])], temp_s0, sizeof(struct_D_802F1F80), &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartPalettes[player->characterId])], temp_s0, sizeof(struct_D_802F1F80), &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); break; } @@ -195,11 +195,11 @@ void func_80027A20(Player *player, s8 arg1, s8 arg2, s8 arg3) { void func_80027BDC(UNUSED Player *player, s32 arg1, void *vAddr, u16 size) { osInvalDCache(vAddr, size); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(arg1)], vAddr, size, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(arg1)], vAddr, size, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } void func_80027C74(UNUSED Player *player, s32 arg1, void *vAddr, u16 size) { osInvalDCache(vAddr, size); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(arg1)], vAddr, size, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(arg1)], vAddr, size, &gDmaMesgQueue); } diff --git a/src/main.c b/src/main.c index dbd24a10c..419d2b980 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "types.h" #include "config.h" #include "profiler.h" @@ -19,6 +20,18 @@ #include "code_800431B0.h" #include "code_8008C1D0.h" #include "code_80281780.h" +#include "audio/external.h" +#include "code_800029B0.h" +#include "code_80280000.h" +#include "code_80280650.h" +#include "code_80091750.h" +#include "code_80057C60.h" +#include "profiler.h" +#include "code_80027D00.h" +#include "code_8001F980.h" +#include "render_courses.h" +#include "actors.h" +#include "staff_ghosts.h" // Declarations (not in this file) void func_80091B78(void); @@ -90,7 +103,7 @@ OSContStatus gControllerStatuses[4]; OSContPad gControllerPads[4]; u8 gControllerBits; -u8 D_8014F110[4096]; +struct UnkStruct_8015F584 D_8014F110[1024]; u16 gNumActors; u16 D_80150112; s32 D_80150114; @@ -119,7 +132,7 @@ Gfx *gDisplayListHead; struct SPTask *gGfxSPTask; s32 D_801502A0; s32 D_801502A4; -uintptr_t gPhysicalFramebuffers[3]; +u32 gPhysicalFramebuffers[3]; u32 D_801502B4; UNUSED u32 D_801502B8; UNUSED u32 D_801502BC; @@ -274,7 +287,7 @@ void create_gfx_task_structure(void) { void init_controllers(void) { osCreateMesgQueue(&gSIEventMesgQueue, &gSIEventMesgBuf[0], ARRAY_COUNT(gSIEventMesgBuf)); osSetEventMesg(OS_EVENT_SI, &gSIEventMesgQueue, (OSMesg) 0x33333333); - osContInit(&gSIEventMesgQueue, &gControllerBits, &gControllerStatuses); + osContInit(&gSIEventMesgQueue, &gControllerBits, gControllerStatuses); if ((gControllerBits & 1) == 0) { sIsController1Unplugged = TRUE; } else { @@ -323,7 +336,7 @@ void read_controllers(void) { osContStartReadData(&gSIEventMesgQueue); osRecvMesg(&gSIEventMesgQueue, &msg, OS_MESG_BLOCK); - osContGetReadData(&gControllerPads); + osContGetReadData(gControllerPads); update_controller(0); update_controller(1); update_controller(2); @@ -421,6 +434,7 @@ void config_gfx_pool(void) { * Yields to the VI framerate twice, locking the game at 30 FPS. * Selects the next framebuffer to be rendered and displayed. */ +void crash_screen_set_framebuffer(uintptr_t*); void display_and_vsync(void) { profiler_log_thread5_time(BEFORE_DISPLAY_LISTS); osRecvMesg(&gGfxVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); @@ -430,7 +444,7 @@ void display_and_vsync(void) { osViSwapBuffer((void *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[sRenderedFramebuffer])); profiler_log_thread5_time(THREAD5_END); osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); - crash_screen_set_framebuffer(gPhysicalFramebuffers[sRenderedFramebuffer]); + crash_screen_set_framebuffer((uintptr_t *) gPhysicalFramebuffers[sRenderedFramebuffer]); if (++sRenderedFramebuffer == 3) { sRenderedFramebuffer = 0; } @@ -441,33 +455,33 @@ void display_and_vsync(void) { } void init_seg_80280000(void) { - bzero(SEG_80280000, 0xDF00); + bzero((void *) SEG_80280000, 0xDF00); osWritebackDCacheAll(); - dma_copy(SEG_80280000, &_code_80280000SegmentRomStart, ALIGN16((u32)&_code_80280000SegmentRomEnd - (u32)&_code_80280000SegmentRomStart)); - osInvalICache(SEG_80280000, 0xDF00); - osInvalDCache(SEG_80280000, 0xDF00); + dma_copy((u8 *) SEG_80280000, (u8 *) &_code_80280000SegmentRomStart, ALIGN16((u32)&_code_80280000SegmentRomEnd - (u32)&_code_80280000SegmentRomStart)); + osInvalICache((void *) SEG_80280000, 0xDF00); + osInvalDCache((void *) SEG_80280000, 0xDF00); } void init_seg_8028DF00(void) { - bzero(SEG_8028DF00, 0x2C470); + bzero((void *) SEG_8028DF00, 0x2C470); osWritebackDCacheAll(); - dma_copy(SEG_8028DF00, &_code_8028DF00SegmentRomStart, ALIGN16((u32)&_code_8028DF00SegmentRomEnd - (u32)&_code_8028DF00SegmentRomStart)); - osInvalICache(SEG_8028DF00, 0x2C470); - osInvalDCache(SEG_8028DF00, 0x2C470); + dma_copy((u8 *) SEG_8028DF00, (u8 *) &_code_8028DF00SegmentRomStart, ALIGN16((u32)&_code_8028DF00SegmentRomEnd - (u32)&_code_8028DF00SegmentRomStart)); + osInvalICache((void *) SEG_8028DF00, 0x2C470); + osInvalDCache((void *) SEG_8028DF00, 0x2C470); } -void dma_copy(u8 *dest, u8 *arg1, u32 size) { +void dma_copy(u8 *dest, u8 *romAddr, u32 size) { osInvalDCache(dest, size); while(size > 0x100) { - osPiStartDma(&gDmaIoMesg, 0, 0, arg1, dest, 0x100, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) romAddr, dest, 0x100, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); size -= 0x100; - arg1 += 0x100; + romAddr += 0x100; dest += 0x100; } if (size != 0) { - osPiStartDma(&gDmaIoMesg, 0, 0, arg1, dest, size, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) romAddr, dest, size, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); } } @@ -479,33 +493,33 @@ void setup_game_memory(void) { UNUSED u32 pad[2]; u32 sp2C; u32 sp40; - s32 texture_seg; - s32 sp38; + uintptr_t texture_seg; + u32 sp38; UNUSED s32 unknown_padding; init_seg_8028DF00(); gHeapEndPtr = SEG_8028DF00; - set_segment_base_addr(0, 0x80000000); - func_802A7CF0(&D_801978D0, 0x80242F00); + set_segment_base_addr(0, (void *) SEG_START); + initialize_memory_pool((uintptr_t) &D_801978D0, (uintptr_t) 0x80242F00); func_80000BEC(); - osInvalDCache(SEG_802BA370, 0x5810); - osPiStartDma(&gDmaIoMesg, 0, 0, &_data_802BA370SegmentRomStart, SEG_802BA370, 0x5810, &gDmaMesgQueue); + osInvalDCache((void *) SEG_802BA370, 0x5810); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_data_802BA370SegmentRomStart, (void *) SEG_802BA370, 0x5810, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); - set_segment_base_addr(2, func_802A7D70(&_data_segment2SegmentRomStart, &_data_segment2SegmentRomEnd)); + set_segment_base_addr(2, (void *) load_data((uintptr_t) &_data_segment2SegmentRomStart, (uintptr_t) &_data_segment2SegmentRomEnd)); sp2C = (u32)&_common_texturesSegmentRomEnd - (u32)&_common_texturesSegmentRomStart; sp2C = ALIGN16(sp2C); texture_seg = SEG_8028DF00-sp2C; - osPiStartDma(&gDmaIoMesg, 0, 0, &_common_texturesSegmentRomStart, texture_seg, sp2C, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_common_texturesSegmentRomStart, (void *) texture_seg, sp2C, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); sp40 = *(u32 *)(texture_seg + 4); sp40 = ALIGN16(sp40); - sp38 = gPrevLoadedAddress; - mio0decode(texture_seg, sp38); - set_segment_base_addr(0xD, sp38); + sp38 = gNextFreeMemoryAddress; + mio0decode((u8 *) texture_seg, (u8 *) sp38); + set_segment_base_addr(0xD, (void *) sp38); - gPrevLoadedAddress += sp40; - D_8015F734 = gPrevLoadedAddress; + gNextFreeMemoryAddress += sp40; + D_8015F734 = gNextFreeMemoryAddress; } /** @@ -519,9 +533,7 @@ void game_init_clear_framebuffer(void) { void race_logic_loop(void) { s16 i; - s32 pad; u16 rotY; - f32 pad2 = 0; D_80150112 = 0; D_80164AF0 = 0; @@ -833,7 +845,7 @@ void game_state_handler(void) { update_menus(); init_rcp(); // gGfxPool->mtxPool->m or gGfxPool? - func_80094A64(gGfxPool->mtxPool->m); + func_80094A64((Mtx *) gGfxPool->mtxPool->m); break; case RACING: race_logic_loop(); @@ -855,7 +867,7 @@ void interrupt_gfx_sptask(void) { } void receive_new_tasks(void) { - s32 pad; + UNUSED s32 pad; struct SPTask *spTask; while(osRecvMesg(&gSPTaskMesgQueue, (OSMesg *) &spTask, OS_MESG_NOBLOCK) != -1) { @@ -959,7 +971,7 @@ void handle_sp_complete(void) { // handle_vblank tried to start an audio task while there was already a // gfx task running, so it had to interrupt the gfx task. That interruption // just finished. - if (osSpTaskYielded(curSPTask) == 0) { + if (osSpTaskYielded((OSTask *) curSPTask) == 0) { // The gfx task completed before we had time to interrupt it. // Mark it finished, just like below. curSPTask->state = SPTASK_STATE_FINISHED; @@ -998,13 +1010,14 @@ void thread3_video(UNUSED void *arg0) { s32 i; u64 *framebuffer1; OSMesg msg; - s32 pad[4]; + UNUSED s32 pad[4]; - gPhysicalFramebuffers[0] = (uintptr_t *) &gFramebuffer0; - gPhysicalFramebuffers[1] = (uintptr_t *) &gFramebuffer1; - gPhysicalFramebuffers[2] = (uintptr_t *) &gFramebuffer2; + gPhysicalFramebuffers[0] = (u32) &gFramebuffer0; + gPhysicalFramebuffers[1] = (u32) &gFramebuffer1; + gPhysicalFramebuffers[2] = (u32) &gFramebuffer2; - framebuffer1 = &gFramebuffer1; + // Clear framebuffer. + framebuffer1 = (u64 *) &gFramebuffer1; for (i = 0; i < 19200; i++) { framebuffer1[i] = 0; } @@ -1103,7 +1116,7 @@ void update_gamestate(void) { } void thread5_game_loop(UNUSED void *arg) { - osCreateMesgQueue(&gGfxVblankQueue, &gGfxMesgBuf, 1); + osCreateMesgQueue(&gGfxVblankQueue, gGfxMesgBuf, 1); osCreateMesgQueue(&gGameVblankQueue, &gGameMesgBuf, 1); init_controllers(); if (!wasSoftReset) { @@ -1145,7 +1158,7 @@ void thread5_game_loop(UNUSED void *arg) { void thread4_audio(UNUSED void *arg) { UNUSED u32 unused[3]; audio_init(); - osCreateMesgQueue(&sSoundMesgQueue, &sSoundMesgBuf, ARRAY_COUNT(sSoundMesgBuf)); + osCreateMesgQueue(&sSoundMesgQueue, sSoundMesgBuf, ARRAY_COUNT(sSoundMesgBuf)); set_vblank_handler(1, &sSoundVblankHandler, &sSoundMesgQueue, (OSMesg) 512); while (TRUE) { diff --git a/src/main.h b/src/main.h index adc737900..11f78a4d7 100644 --- a/src/main.h +++ b/src/main.h @@ -18,6 +18,11 @@ struct GfxPool { /* 0x28B20 */ struct SPTask spTask; }; // size = 0x28B70 +struct UnkStruct_8015F584 { + u16 unk0; + u16 unk2; +}; + void create_thread(OSThread*, OSId, void (*entry)(void *), void*, void*, OSPri); void main_func(); void thread1_idle(void*); @@ -62,7 +67,11 @@ void thread4_audio(void*); extern struct GfxPool *gGfxPool; extern Gfx *gDisplayListHead; extern struct Controller gControllers[8]; +extern struct Controller *gControllerOne; +extern s32 D_800DC568; +extern s32 D_800DC56C[]; +extern u32 gPhysicalFramebuffers[]; extern OSIoMesg gDmaIoMesg; extern OSMesg gMainReceivedMesg; extern OSMesgQueue gDmaMesgQueue; @@ -89,7 +98,7 @@ extern u64 gspF3DLXDataStart[]; extern u64 gGfxSPTaskOutputBuffer[]; extern u32 gGfxSPTaskOutputBufferSize; -extern u32 gPrevLoadedAddress; +extern u32 gNextFreeMemoryAddress; extern s32 D_8015F734; extern u8 _data_segment2SegmentRomStart[]; extern u8 _data_segment2SegmentRomEnd[]; diff --git a/src/math_util.c b/src/math_util.c index 185d9ecb2..8c8cf9abe 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -610,7 +610,7 @@ void func_802B6434(Vec3f arg0, Mat4 arg1) { arg0[2] = temp_f6; } -UNUSED void func_802B64B0(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { +UNUSED void func_802B64B0(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3) { } @@ -936,7 +936,7 @@ void func_802B71CC(Mat4 arg0, Mat4 arg1, Mat4 arg2) { product[3][1] = (arg1[3][0] * arg2[0][1]) + (arg1[3][1] * arg2[1][1]) + (arg1[3][2] * arg2[2][1]) + (arg1[3][3] * arg2[3][1]); product[3][2] = (arg1[3][0] * arg2[0][2]) + (arg1[3][1] * arg2[1][2]) + (arg1[3][2] * arg2[2][2]) + (arg1[3][3] * arg2[3][2]); product[3][3] = (arg1[3][0] * arg2[0][3]) + (arg1[3][1] * arg2[1][3]) + (arg1[3][2] * arg2[2][3]) + (arg1[3][3] * arg2[3][3]); - func_802B5398(arg0, product, 0x10); + func_802B5398((s32 *)arg0, (s32 *)product, 0x10); } #ifdef MIPS_TO_C diff --git a/src/math_util.h b/src/math_util.h index 738857877..c24c9385b 100644 --- a/src/math_util.h +++ b/src/math_util.h @@ -36,7 +36,7 @@ void func_802B5A44(Mat4, s16); void func_802B5AAC(Mat4, s16); void func_802B5CAC(s16, s16, Vec3f); void func_802B5D30(s16, s16, s32); -void func_802B5D64(u32, s16, s32, s32); +void func_802B5D64(uintptr_t, s16, s32, s32); void func_802B5F00(Mat4, f32); void func_802B5F74(Mat4, Vec3f, Vec3s); void func_802B60B4(Mat4, Vec3s, Vec3s); diff --git a/src/math_util_2.c b/src/math_util_2.c index f84876bf5..d873eb1b2 100644 --- a/src/math_util_2.c +++ b/src/math_util_2.c @@ -9,6 +9,7 @@ #include "memory.h" #include "code_802AAA70.h" +#include "code_8001F980.h" #pragma intrinsic (sqrtf) @@ -334,11 +335,11 @@ void func_80041480(s16 *arg0, s16 arg1, s16 arg2, s16 *arg3) { } } -s32 vec3f_set_dupe_2_electric_boogaloo(Vec3f arg0, f32 arg1, f32 arg2, f32 arg3) { +Vec3f *vec3f_set_dupe_2_electric_boogaloo(Vec3f arg0, f32 arg1, f32 arg2, f32 arg3) { arg0[0] = arg1; arg0[1] = arg2; arg0[2] = arg3; - return &arg0; + return (Vec3f *) &arg0; } Vec3f *func_80041530(Vec3f dest) { @@ -347,7 +348,7 @@ Vec3f *func_80041530(Vec3f dest) { dest[0] = dest[0] * invsqrt; dest[1] = dest[1] * invsqrt; dest[2] = dest[2] * invsqrt; - return &dest; + return (Vec3f *) &dest; } Vec3f *func_80041594(Vec3f arg0, Vec3f arg1, Vec3f arg2) { @@ -356,7 +357,7 @@ Vec3f *func_80041594(Vec3f arg0, Vec3f arg1, Vec3f arg2) { arg0[1] = (arg1[2] * arg2[0]) - (arg2[2] * arg1[0]); arg0[2] = (arg1[0] * arg2[1]) - (arg2[0] * arg1[1]); - return &arg0; + return (Vec3f *) &arg0; } UNUSED s32 func_80041608(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { @@ -473,7 +474,7 @@ void func_800419F8(void) { D_80165840[2] = sp24[2]; } -UNUSED func_80041A70(void) { +UNUSED void func_80041A70(void) { } @@ -601,7 +602,7 @@ extern s8 D_801658FE; extern Mtx D_80183D60[]; void func_80041D34(void) { - guOrtho(&D_80183D60, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); + guOrtho((Mtx *)D_80183D60, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); switch (gActiveScreenMode) { case SCREEN_MODE_1P: guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); @@ -645,7 +646,7 @@ UNUSED void func_80042000(u16 arg0) { Mat4 matrix; func_80041AD8(matrix, arg0); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], &matrix); + func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); D_8018D120++; diff --git a/src/math_util_2.h b/src/math_util_2.h index 294200ee9..cf433c4bc 100644 --- a/src/math_util_2.h +++ b/src/math_util_2.h @@ -48,7 +48,7 @@ s32 u16_step_down_towards(u16*, s32, s32); s32 s16_step_towards(s16*, s16, s16); s32 f32_step_towards(f32*, f32, f32); void func_80041480(s16*, s16, s16, s16*); -s32 vec3f_set_dupe_2_electric_boogaloo(Vec3f, f32, f32, f32); +Vec3f *vec3f_set_dupe_2_electric_boogaloo(Vec3f, f32, f32, f32); Vec3f *func_80041530(Vec3f dest); Vec3f *func_80041594(Vec3f, Vec3f, Vec3f); s32 func_80041658(f32, f32); @@ -66,7 +66,7 @@ void func_80041AD8(Mat4, u16); void func_80041B68(Mat4, f32); void func_80041BBC(Mat4, u16, f32); void func_80041C64(Mat4, s32, s32, u16, f32); -void func_80041D24(); +void func_80041D24(void); void func_80041D34(); void func_80041EF4(); void func_80042330(s32, s32, u16, f32); diff --git a/src/memory.c b/src/memory.c index 8775f3303..add9cd044 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1,24 +1,17 @@ #include #include #include -#include "types.h" - -// Includes from SM64 -//#include "buffers/buffers.h" -//#include "decompress.h" -//#include "game_init.h" +#include +#include +#include +#include #include "main.h" #include "memory.h" -#include "variables.h" -#include "common_structs.h" #include "math_util.h" -//#include "segment_symbols.h" -#include "segments.h" +s32 sGfxSeekPosition; +s32 sPackedSeekPosition; - -s32 D_802BA270; -s32 D_802BA274; u32 sPoolFreeSpace; struct MainPoolBlock *sPoolListHeadL; struct MainPoolBlock *sPoolListHeadR; @@ -30,19 +23,39 @@ struct UnkStruct_802B8CD4 D_802B8CD4[] = { }; s32 D_802B8CE4 = 0; // pad -s32 func_802A7B70(s32 segment) { - s32 old; - old = gPrevLoadedAddress; - segment = ALIGN16(segment); - gPrevLoadedAddress += segment; - return old; +/** + * @brief Returns the address of the next available memory location and updates the memory pointer + * to reference the next location of available memory based provided size to allocate. + * @param size of memory to allocate. + * @return Address of free memory + */ +u32 *get_next_available_memory_addr(u32 size) { + u32 *freeSpace = (u32 *)gNextFreeMemoryAddress; + size = ALIGN16(size); + gNextFreeMemoryAddress += size; + return freeSpace; } +/** + * @brief Stores the physical memory addr for segmented memory in `gSegmentTable` using the segment number as an index. + * + * This function takes a segment number and a pointer to a memory address, and stores the address in the `gSegmentTable` array + * at the specified segment index. The stored address is truncated to a 29-bit value to ensure that it fits within the + * memory address. This allows converting between segmented memory and physical memory. + * + * @param segment A segment number from 0x0 to 0xF to set the base address. + * @param addr A pointer containing the physical memory address of the data. + * @return The stored base address, truncated to a 29-bit value. + */ uintptr_t set_segment_base_addr(s32 segment, void *addr) { gSegmentTable[segment] = (uintptr_t) addr & 0x1FFFFFFF; return gSegmentTable[segment]; } +/** + * @brief Returns the physical memory location of a segment. + * @param permits segment numbers from 0x0 to 0xF. +*/ void *get_segment_base_addr(s32 segment) { return (void *) (gSegmentTable[segment] | 0x80000000); } @@ -65,24 +78,33 @@ void move_segment_table_to_dmem(void) { } } -void func_802A7CF0(s32 start, s32 end) { +/** + * @brief Sets the starting location for allocating memory and calculates pool size. + * + * Default memory size, 701.984 Kilobytes. +*/ +void initialize_memory_pool(uintptr_t poolStart, uintptr_t poolEnd) { - start = ALIGN16(start); - end &= ~0xF; + poolStart = ALIGN16(poolStart); + // Truncate to a 16-byte boundary. + poolEnd &= ~0xF; - D_8015F724 = (end - start) - 0x10; - gPrevLoadedAddress = start; + gFreeMemorySize = (poolEnd - poolStart) - 0x10; + gNextFreeMemoryAddress = poolStart; } -s32 func_802A7D1C(s32 arg0) { - s32 addr; +/** + * @brief Allocates memory and adjusts gFreeMemorySize. +*/ +void *allocate_memory(u32 size) { + u32 *freeSpace; - arg0 = ALIGN16(arg0); - D_8015F724 -= arg0; - addr = gPrevLoadedAddress; - gPrevLoadedAddress += arg0; + size = ALIGN16(size); + gFreeMemorySize -= size; + freeSpace = (u32 *) gNextFreeMemoryAddress; + gNextFreeMemoryAddress += size; - return addr; + return (void *) freeSpace; } UNUSED void func_802A7D54(s32 arg0, s32 arg1) { @@ -90,15 +112,18 @@ UNUSED void func_802A7D54(s32 arg0, s32 arg1) { gD_80150158[arg0].unk8 = arg1; } -s32 func_802A7D70(s32 arg0, s32 arg1) { - s32 temp_v0; - s32 temp_a2 = arg1 - arg0; +/** + * @brief Allocate and DMA. +*/ +void *load_data(uintptr_t startAddr, uintptr_t endAddr) { + void *allocated; + u32 size = endAddr - startAddr; - temp_v0 = func_802A7D1C(temp_a2); - if (temp_v0 != 0) { - dma_copy(temp_v0, arg0, temp_a2); + allocated = allocate_memory(size); + if (allocated != 0) { + dma_copy((u8 *)allocated, (u8 *)startAddr, size); } - return temp_v0; + return (void *) allocated; } UNUSED void main_pool_init(u32 start, u32 end) { @@ -120,7 +145,7 @@ UNUSED void main_pool_init(u32 start, u32 end) { * specified side of the pool (MEMORY_POOL_LEFT or MEMORY_POOL_RIGHT). * If there is not enough space, return NULL. */ -void *main_pool_alloc(u32 size, u32 side) { +UNUSED void *main_pool_alloc(u32 size, u32 side) { struct MainPoolBlock *newListHead; void *addr = NULL; @@ -149,7 +174,7 @@ void *main_pool_alloc(u32 size, u32 side) { * newer blocks are freed as well. * Return the amount of free space left in the pool. */ -u32 main_pool_free(void *addr) { +UNUSED u32 main_pool_free(void *addr) { struct MainPoolBlock *block = (struct MainPoolBlock *) ((u8 *) addr - 8); struct MainPoolBlock *oldListHead = (struct MainPoolBlock *) ((u8 *) addr - 8); @@ -212,15 +237,15 @@ UNUSED u32 main_pool_pop_state(void) { return sPoolFreeSpace; } // similar to sm64 dma_read -void *func_802A80B0(u8 *dest, u8 *srcStart, u8 *srcEnd) { - u32 addr; +UNUSED void *func_802A80B0(u8 *dest, u8 *srcStart, u8 *srcEnd) { + void *addr; u32 size = srcStart - dest; - addr = main_pool_alloc(size, srcEnd); + addr = main_pool_alloc(size, (u32) srcEnd); if (addr != 0) { osInvalDCache(addr, size); - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, dest, addr, size, + osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) dest, addr, size, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } @@ -228,7 +253,7 @@ void *func_802A80B0(u8 *dest, u8 *srcStart, u8 *srcEnd) { } // replaces call to dynamic_dma_read with dma_read. -UNUSED void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side) { +UNUSED void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u8 *side) { void *addr = func_802A80B0(srcStart, srcEnd, side); if (addr != NULL) { @@ -238,30 +263,28 @@ UNUSED void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side) { } // Similar to sm64 load_to_fixed_pool_addr? -UNUSED void *func_802A8190(s32 arg0, s32 arg1) { +UNUSED void *func_802A8190(s32 arg0, u8 *arg1) { //u32 srcSize = ALIGN16(srcEnd - srcStart); //u32 destSize = ALIGN16((u8 *) sPoolListHeadR - destAddr); - u32 addr; + void *addr; u32 temp_v0 = D_802B8CD4[arg0].unk4; u32 temp_v1 = D_802B8CD4[arg0].unk8; u32 temp_v2 = D_802B8CD4[arg0].unk2; - addr = func_802A80B0(temp_v0, temp_v1, arg1); + addr = func_802A80B0((u8 *) temp_v0, (u8 *) temp_v1, arg1); //dest = main_pool_alloc(destSize, MEMORY_POOL_RIGHT); if (addr != 0) { - set_segment_base_addr(temp_v2, addr); } - return addr; + return (void *) addr; } UNUSED void func_802A81EC(void) { - u32 addr; s32 temp_s0; s16 *phi_s1; s32 phi_s0; - phi_s1 = &D_802B8CD4; + phi_s1 = (s16 *) &D_802B8CD4; phi_s0 = 0; do { if ((*phi_s1 & 1) != 0) { @@ -282,7 +305,7 @@ UNUSED struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side) { if (addr != NULL) { subPool = (struct AllocOnlyPool *) addr; subPool->totalSpace = size; - subPool->usedSpace = (u8 *) addr + sizeof(struct AllocOnlyPool); + subPool->usedSpace = (s32) addr + sizeof(struct AllocOnlyPool); subPool->startPtr = 0; subPool->freePtr = (u8 *) addr + sizeof(struct AllocOnlyPool); } @@ -302,1055 +325,1016 @@ UNUSED u32 func_802A82AC(s32 arg0) { return phi_v1; } -s32 func_802A82E4(u8 *start, u8 *end) { - s32 dest; +/** + * @brief Returns pointer to mio0 compressed Vtx. + */ +u8 *dma_compressed_vtx(u8 *start, u8 *end) { + u8 *freeSpace; u32 size; size = ALIGN16(end - start); - dest = gPrevLoadedAddress; - dma_copy(dest, start, size); - gPrevLoadedAddress += size; - return dest; + freeSpace = (u8 *) gNextFreeMemoryAddress; + dma_copy(freeSpace, start, size); + gNextFreeMemoryAddress += size; + return freeSpace; } // unused mio0 decode func. UNUSED s32 func_802A8348(s32 arg0, s32 arg1, s32 arg2) { - s32 offset; - UNUSED s32 *pad; - s32 oldAddr; - s32 newAddr; + u32 offset; + UNUSED void *pad; + uintptr_t oldAddr; + void *newAddr; offset = ALIGN16(arg1 * arg2); - oldAddr = gPrevLoadedAddress; - newAddr = oldAddr + offset; + oldAddr = gNextFreeMemoryAddress; + newAddr = (void *) (oldAddr + offset); pad = &newAddr; osInvalDCache(newAddr, offset); - osPiStartDma(&gDmaIoMesg, 0, 0, &_other_texturesSegmentRomStart[arg0 & 0xFFFFFF], newAddr, offset, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_other_texturesSegmentRomStart[SEGMENT_OFFSET(arg0)], newAddr, offset, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); - func_80040030(newAddr, oldAddr); - gPrevLoadedAddress += offset; + func_80040030((u8 *) newAddr, (u8 *) oldAddr); + gNextFreeMemoryAddress += offset; return oldAddr; } -UNUSED s32 func_802A841C(s32 arg0, s32 arg1, s32 arg2) { - s32 temp_v0; - s32 temp_a0; - temp_v0 = gPrevLoadedAddress; +UNUSED u8 *func_802A841C(u8* arg0, s32 arg1, s32 arg2) { + u8 *temp_v0; + void *temp_a0; + temp_v0 = (u8 *) gNextFreeMemoryAddress; temp_a0 = temp_v0 + arg2; arg1 = ALIGN16(arg1); arg2 = ALIGN16(arg2); osInvalDCache(temp_a0, arg1); - osPiStartDma(&gDmaIoMesg, 0, 0, &_other_texturesSegmentRomStart[arg0 & 0xFFFFFF],temp_a0, arg1, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_other_texturesSegmentRomStart[SEGMENT_OFFSET(arg0)],temp_a0, arg1, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); - func_80040030(temp_a0, temp_v0); - gPrevLoadedAddress += arg2; + func_80040030((u8 *) temp_a0, temp_v0); + gNextFreeMemoryAddress += arg2; return temp_v0; } -s32 func_802A84F4(s32 arg0, u32 arg1, u32 arg2) { +u8 *dma_textures(u8 *arg0, u32 arg1, u32 arg2) { u8 *temp_v0; - u32 temp_a0; + void *temp_a0; - temp_v0 = gPrevLoadedAddress; + temp_v0 = (u8 *) gNextFreeMemoryAddress; temp_a0 = temp_v0 + arg2; arg1 = ALIGN16(arg1); arg2 = ALIGN16(arg2); - osInvalDCache(temp_a0, arg1); - osPiStartDma(&gDmaIoMesg, 0, 0, &_other_texturesSegmentRomStart[arg0 & 0xFFFFFF], temp_a0, arg1, &gDmaMesgQueue); + osInvalDCache((void *) temp_a0, arg1); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_other_texturesSegmentRomStart[SEGMENT_OFFSET(arg0)], (void *)temp_a0, arg1, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, (int) 1); - mio0decode(temp_a0, temp_v0); - gPrevLoadedAddress += arg2; + mio0decode((u8 *) temp_a0, temp_v0); + gNextFreeMemoryAddress += arg2; return temp_v0; } -u32 MIO0_0F(s32 arg0, u32 arg1, u32 arg2) { +u32 MIO0_0F(u8 *arg0, u32 arg1, u32 arg2) { u32 oldHeapEndPtr; - u8 *temp_v0; - u32 temp_a0; + void *temp_v0; arg1 = ALIGN16(arg1); arg2 = ALIGN16(arg2); oldHeapEndPtr = gHeapEndPtr; - temp_v0 = gPrevLoadedAddress; + temp_v0 = (void *) gNextFreeMemoryAddress; osInvalDCache(temp_v0, arg1); - osPiStartDma(&gDmaIoMesg, 0, 0, &_other_texturesSegmentRomStart[arg0 & 0xFFFFFF], temp_v0, arg1, &gDmaMesgQueue); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_other_texturesSegmentRomStart[SEGMENT_OFFSET(arg0)], temp_v0, arg1, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); - mio0decode(temp_v0, oldHeapEndPtr); + mio0decode((u8 *) temp_v0, (u8 *) oldHeapEndPtr); gHeapEndPtr += arg2; return oldHeapEndPtr; } -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern f32 D_800DC608; -extern s16 *gHeapEndPtr; - -void func_802A86A8(mk64_Vtx *arg0, u32 arg1) { - f32 temp_f6; - mk64_Vtx *var_v0; - s16 *var_v1; +void func_802A86A8(mk64_Vtx *data, u32 arg1) { + mk64_Vtx_n *vtx_n = (mk64_Vtx_n *) data; + Vtx *vtx; + s32 tmp = ALIGN16(arg1 * 0x10); + s32 i; s8 temp_a0; s8 temp_a3; - u32 var_a2; + s8 flags; - var_v1 = gHeapEndPtr - (((arg1 * 0x10) + 0xF) & ~0xF); - var_v0 = arg0; - gHeapEndPtr = var_v1; - var_a2 = 0; - if (arg1 != 0) { - do { - if (gIsMirrorMode != 0) { - *var_v1 = -var_v0->ob[0]; + gHeapEndPtr -= tmp; + vtx = (Vtx *) gHeapEndPtr; + + for (i = 0; i < arg1; i++) { + if (gIsMirrorMode) { + vtx->n.ob[0] = -vtx_n->ob[0]; } else { - *var_v1 = var_v0->ob[0]; + vtx->n.ob[0] = vtx_n->ob[0]; } - var_a2 += 1; - var_v1 += 0x10; - temp_f6 = (f32) var_v0->ob[1]; - var_v0 += 0xE; - var_v1->unk-E = (s16) (s32) (temp_f6 * D_800DC608); - temp_a0 = var_v0->unk-4; - temp_a3 = var_v0->unk-3; - var_v1->unk-C = (s16) var_v0->unk-A; - var_v1->unk-8 = (s16) var_v0->unk-8; - var_v1->unk-4 = (s8) (temp_a0 & 0xFC); - var_v1->unk-3 = (s8) (temp_a3 & 0xFC); - var_v1->unk-6 = (s16) var_v0->unk-6; - var_v1->unk-2 = (s8) var_v0->unk-2; - var_v1->unk-A = (s16) (s8) ((temp_a0 & 3) | ((temp_a3 * 4) & 0xC)); - var_v1->unk-1 = 0xFF; - } while (var_a2 < arg1); - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A86A8.s") -#endif -void func_802A87A8(s32 arg0, u32 vertexCount) { - s32 pad; + vtx->n.ob[1] = (vtx_n->ob[1] * vtxStretchY); + temp_a0 = vtx_n->n[0]; + temp_a3 = vtx_n->n[1]; + + flags = temp_a0 & 3; + flags |= (temp_a3 * 4) & 0xC; + + vtx->n.ob[2] = vtx_n->ob[2]; + vtx->n.tc[0] = vtx_n->tc[0]; + vtx->n.tc[1] = vtx_n->tc[1]; + vtx->n.n[0] = (temp_a0 & 0xFC); + vtx->n.n[1] = (temp_a3 & 0xFC); + vtx->n.n[2] = vtx_n->n[2]; + vtx->n.flag = flags; + vtx->n.a = 0xFF; + vtx++; + vtx_n++; + } +} + +void decompress_vtx(u8 *arg0, u32 vertexCount) { + s32 size = ALIGN16(vertexCount * 0x18); u32 segment = SEGMENT_NUMBER2(arg0); u32 offset = SEGMENT_OFFSET(arg0); - s32 old; - s32 addr = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); - s32 temp_v0 = ALIGN16(vertexCount * 0x18); + void *freeSpace; + u8 *vtxCompressed = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + UNUSED s32 pad; - old = gPrevLoadedAddress; - gPrevLoadedAddress += temp_v0; + freeSpace = (void *) gNextFreeMemoryAddress; + gNextFreeMemoryAddress += size; - mio0decode(addr, old); - func_802A86A8(old, vertexCount); - set_segment_base_addr(4, gHeapEndPtr); + mio0decode(vtxCompressed, (u8 *) freeSpace); + func_802A86A8((mk64_Vtx *) freeSpace, vertexCount); + set_segment_base_addr(4, (void *) gHeapEndPtr); } UNUSED void func_802A8844(void) { } -void func_802A884C(Gfx *arg0, u8 arg1, s8 arg2) { - s32 pad; +void unpack_lights(Gfx *arg0, UNUSED u8 *arg1, s8 arg2) { + UNUSED s32 pad; s32 a = (arg2 * 0x18) + 0x9000008; s32 b = (arg2 * 0x18) + 0x9000000; Gfx macro[] = {gsSPNumLights(NUMLIGHTS_1)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; - D_802BA270++; - arg0[D_802BA270].words.w0 = 0x3860010; + sGfxSeekPosition++; + arg0[sGfxSeekPosition].words.w0 = 0x3860010; - arg0[D_802BA270].words.w1 = a; + arg0[sGfxSeekPosition].words.w1 = a; - D_802BA270++; - arg0[D_802BA270].words.w0 = 0x3880010; - arg0[D_802BA270].words.w1 = b; - D_802BA270++; + sGfxSeekPosition++; + arg0[sGfxSeekPosition].words.w0 = 0x3880010; + arg0[sGfxSeekPosition].words.w1 = b; + sGfxSeekPosition++; } -void func_802A8940(Gfx *arg0, u8 *arg1, u8 arg2) { - - u32 temp_v0 = arg1[D_802BA274++]; - u32 temp_t7 = ((arg1[D_802BA274++]) << 8 | temp_v0) * 8; - arg0[D_802BA270].words.w0 = 0x6000000; - arg0[D_802BA270].words.w1 = 0x7000000 + temp_t7; - D_802BA270++; +void unpack_displaylist(Gfx *arg0, u8 *args, UNUSED s8 opcode) { + u32 temp_v0 = args[sPackedSeekPosition++]; + uintptr_t temp_t7 = ((args[sPackedSeekPosition++]) << 8 | temp_v0) * 8; + arg0[sGfxSeekPosition].words.w0 = 0x06000000; + // Segment seven addr + arg0[sGfxSeekPosition].words.w1 = 0x07000000 + temp_t7; + sGfxSeekPosition++; } -// end display list -void func_802A89C0(Gfx *arg0, u8 arg1, u8 arg2) { - arg0[D_802BA270].words.w0 = G_ENDDL << 24; - arg0[D_802BA270].words.w1 = 0; - D_802BA270++; +// end displaylist +void unpack_end_displaylist(Gfx *arg0, UNUSED u8 *arg1, UNUSED s8 arg2) { + arg0[sGfxSeekPosition].words.w0 = G_ENDDL << 24; + arg0[sGfxSeekPosition].words.w1 = 0; + sGfxSeekPosition++; } -void func_802A8A04(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_set_geometry_mode(Gfx *arg0, UNUSED u8 *arg1, UNUSED s8 arg2) { Gfx macro[] = {gsSPSetGeometryMode(G_CULL_BACK)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8A70(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_clear_geometry_mode(Gfx *arg0, UNUSED u8 *arg1, UNUSED s8 arg2) { Gfx macro[] = {gsSPClearGeometryMode(G_CULL_BACK)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8ADC(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_cull_displaylist(Gfx *arg0, UNUSED u8 *arg1, UNUSED s8 arg2) { Gfx macro[] = {gsSPCullDisplayList(0, 160)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8B48(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_combine_mode1(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8BB4(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_combine_mode2(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_MODULATERGBDECALA, G_CC_MODULATERGBDECALA)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8C20(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_combine_mode_shade(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8C8C(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_combine_mode4(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_MODULATERGBDECALA, G_CC_MODULATERGBDECALA)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8CF8(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_combine_mode5(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8D64(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_render_mode_opaque(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8DD0(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_render_mode_tex_edge(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8E3C(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_render_mode_translucent(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8EA8(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_render_mode_opaque_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_OPA_DECAL, G_RM_AA_ZB_OPA_DECAL)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A8F14(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_render_mode_translucent_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_XLU_DECAL, G_RM_AA_ZB_XLU_DECAL)}; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -Gfx D_802B8D58[] = {gsDPTileSync()}; +void unpack_tile_sync(Gfx *gfx, u8 *args, s8 opcode) { + Gfx tileSync[] = { gsDPTileSync() }; + u32 temp_a0; + u32 lo; + u32 hi; -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A8F80(Gfx *displayList, s32 arg1, s8 arg2) { - u32 sp58; - s32 sp48; - s32 sp44; - s32 sp40; - s32 temp_t5; - s32 temp_t9; - s32 var_v0; - s32 var_v1; - u8 temp_a0; - u8 temp_a0_2; + s32 width; + s32 height; + s32 fmt; + s32 siz; + s32 line; + s32 tmem; + s32 cms; + s32 masks; + s32 cmt; + s32 maskt; + s32 lrs; + s32 lrt; + UNUSED s32 pad[4]; - sp58.unk0 = D_802B8D58->words.w0; - var_v0 = 0; - sp58.unk4 = (u32) D_802B8D58->words.w1; - switch (arg2) { - case 26: - var_v1 = 0x00000020; - sp44 = 0x00000020; - sp40 = 0; -block_9: - sp48 = var_v1; - break; - case 44: - var_v1 = 0x00000020; - sp44 = 0x00000020; - sp40 = 0; - var_v0 = 0x100; - goto block_9; - case 27: - var_v1 = 0x00000040; - sp44 = 0x00000020; - sp40 = 0; - goto block_9; - case 28: - var_v1 = 0x00000020; - sp44 = 0x00000040; - sp40 = 0; - goto block_9; - case 29: - var_v1 = 0x00000020; - sp44 = 0x00000020; - sp40 = 3; - goto block_9; - case 30: - var_v1 = 0x00000040; - sp44 = 0x00000020; - sp40 = 3; - goto block_9; - case 31: - var_v1 = 0x00000020; - sp44 = 0x00000040; - sp40 = 3; - goto block_9; + tmem = 0; + switch (opcode) { + case 26: + width = 32; + height = 32; + fmt = 0; + break; + case 44: + width = 32; + height = 32; + fmt = 0; + tmem = 256; + break; + case 27: + width = 64; + height = 32; + fmt = 0; + break; + case 28: + width = 32; + height = 64; + fmt = 0; + break; + case 29: + width = 32; + height = 32; + fmt = 3; + break; + case 30: + width = 64; + height = 32; + fmt = 3; + break; + case 31: + width = 32; + height = 64; + fmt = 3; + break; } - temp_a0 = *(D_802BA274 + arg1); - temp_t9 = D_802BA274 + 1; - D_802BA274 = temp_t9; - temp_a0_2 = *(temp_t9 + arg1); - D_802BA274 = temp_t9 + 1; - displayList[D_802BA270].words.w0 = sp58; - displayList[D_802BA270].words.w1 = sp5C; - D_802BA270 += 1; - displayList[D_802BA270].words.w0 = (sp40 << 0x15) | 0xF5000000 | 0x100000 | (((s32) ((sp48 * 2) + 7) >> 3) << 9) | var_v0; - displayList[D_802BA270].words.w1 = ((temp_a0_2 & 0xF) << 0x12) | (((u32) (temp_a0_2 & 0xF0) >> 4) << 0xE) | ((temp_a0 & 0xF) << 8) | (((u32) (temp_a0 & 0xF0) >> 4) * 0x10); - temp_t5 = D_802BA270 + 1; - D_802BA270 = temp_t5; - displayList[temp_t5].words.w0 = 0xF2000000; - displayList[D_802BA270].words.w1 = ((sp48 - 1) << 0xE) | ((sp44 - 1) * 4); - D_802BA270 += 1; + + // Set arguments + + siz = G_IM_SIZ_16b_BYTES; + line = ((((width * 2) + 7) >> 3)); + + temp_a0 = args[sPackedSeekPosition++]; + cms = temp_a0 & 0xF; + masks = (temp_a0 & 0xF0) >> 4; + + temp_a0 = args[sPackedSeekPosition++]; + cmt = temp_a0 & 0xF; + maskt = (temp_a0 & 0xF0) >> 4; + + // Generate gfx + + gfx[sGfxSeekPosition].words.w0 = tileSync->words.w0; + gfx[sGfxSeekPosition].words.w1 = tileSync->words.w1; + sGfxSeekPosition++; + + lo = (G_SETTILE << 24) | (fmt << 21) | (siz << 19) | (line << 9) | tmem; + hi = ((cmt) << 18) | ((maskt) << 14) | ((cms) << 8) | ((masks) << 4); + + gfx[sGfxSeekPosition].words.w0 = lo; + gfx[sGfxSeekPosition].words.w1 = hi; + sGfxSeekPosition++; + + lrs = (width - 1) << 2; + lrt = (height - 1) << 2; + + lo = (G_SETTILESIZE << 24); + hi = (lrs << 12) | lrt; + + gfx[sGfxSeekPosition].words.w0 = lo; + gfx[sGfxSeekPosition].words.w1 = hi; + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A8F80.s") -#endif -Gfx D_802B8D60[] = { gsDPTileSync() }; -Gfx D_802B8D68[] = { gsDPLoadSync() }; +void unpack_tile_load_sync(Gfx *gfx, u8 *args, s8 opcode) { + UNUSED u32 var; + Gfx tileSync[] = { gsDPTileSync() }; + Gfx loadSync[] = { gsDPLoadSync() }; -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A91E4(Gfx *displayList, s32 arg1, s8 arg2) { - u32 sp48; - u32 sp40; - s32 sp2C; - s32 sp28; - s32 sp24; - s32 temp_t6; - s32 temp_t6_2; - s32 temp_t8; - s32 temp_t9; - s32 temp_t9_2; - s32 var_v0; - u32 temp_t1; - u32 temp_t2; - u32 temp_t6_3; - u32 var_a2; - u32 var_v0_2; - u32 var_v1; - u8 temp_a2; - u8 temp_a3; + u32 arg; + u32 lo; + u32 hi; + u32 addr; + u32 width; + u32 height; + u32 fmt; + u32 siz; + u32 tmem; + u32 tile; - sp48.unk0 = D_802B8D60->words.w0; - sp48.unk4 = (u32) D_802B8D60->words.w1; - sp40.unk0 = D_802B8D68->words.w0; - sp40.unk4 = (u32) D_802B8D68->words.w1; - switch (arg2) { - case 32: - var_v0 = 0x00000020; - sp28 = 0x00000020; - sp24 = 0; -block_8: - sp2C = var_v0; - break; - case 33: - var_v0 = 0x00000040; - sp28 = 0x00000020; - sp24 = 0; - goto block_8; - case 34: - var_v0 = 0x00000020; - sp28 = 0x00000040; - sp24 = 0; - goto block_8; - case 35: - var_v0 = 0x00000020; - sp28 = 0x00000020; - sp24 = 3; - goto block_8; - case 36: - var_v0 = 0x00000040; - sp28 = 0x00000020; - sp24 = 3; - goto block_8; - case 37: - var_v0 = 0x00000020; - sp28 = 0x00000040; - sp24 = 3; - goto block_8; + switch (opcode) { + case 32: + width = 32; + height = 32; + fmt = 0; + break; + case 33: + width = 64; + height = 32; + fmt = 0; + break; + case 34: + width = 32; + height = 64; + fmt = 0; + break; + case 35: + width = 32; + height = 32; + fmt = 3; + break; + case 36: + width = 64; + height = 32; + fmt = 3; + break; + case 37: + width = 32; + height = 64; + fmt = 3; + break; } - temp_a2 = *(arg1 + D_802BA274); - temp_t9 = D_802BA274 + 1; - D_802BA274 = temp_t9; - temp_t8 = temp_t9 + 1; - D_802BA274 = temp_t8; - temp_a3 = *(temp_t8 + arg1); - D_802BA274 = temp_t8 + 1; - temp_t6 = sp24 << 0x15; - displayList[D_802BA270].words.w0 = temp_t6 | 0xFD000000 | 0x100000; - displayList[D_802BA270].words.w1 = (temp_a2 << 0xB) + 0x05000000; - temp_t9_2 = D_802BA270 + 1; - D_802BA270 = temp_t9_2; - displayList[temp_t9_2].words.w0 = sp48; - var_v1 = 0x7FF; - displayList[D_802BA270].words.w1 = sp4C; - D_802BA270 += 1; - displayList[D_802BA270].words.w0 = temp_t6 | 0xF5000000 | 0x100000 | (temp_a3 & 0xF); - temp_t1 = ((u32) (temp_a3 & 0xF0) >> 4) << 0x18; - displayList[D_802BA270].words.w1 = temp_t1; - temp_t6_2 = D_802BA270 + 1; - D_802BA270 = temp_t6_2; - displayList[temp_t6_2].words.w0 = sp40; - displayList[D_802BA270].words.w1 = sp44; - temp_t6_3 = (u32) (sp2C * 2) >> 3; - D_802BA270 += 1; - temp_t2 = (sp2C * sp28) - 1; - if (temp_t2 < 0x7FFU) { - var_v1 = temp_t2; - } - if (temp_t6_3 == 0) { - var_v0_2 = 1; - } else { - var_v0_2 = temp_t6_3; - } - var_a2 = temp_t6_3; - if (temp_t6_3 == 0) { - var_a2 = 1; - } - displayList[D_802BA270].words.w0 = 0xF3000000; - displayList[D_802BA270].words.w1 = ((u32) (var_v0_2 + 0x7FF) / var_a2) | temp_t1 | (var_v1 << 0xC); - D_802BA270 += 1; + + // Set arguments + + // Waa? + var = args[sPackedSeekPosition]; + // Generates a texture address. + addr = SEGMENT_ADDR(0x05, args[sPackedSeekPosition++] << 11); + sPackedSeekPosition++; + arg = args[sPackedSeekPosition++]; + siz = G_IM_SIZ_16b; + tmem = (arg & 0xF); + tile = (arg & 0xF0) >> 4; + + // Generate gfx + + lo = (G_SETTIMG << 24) | (fmt << 21) | (siz << 19); + gfx[sGfxSeekPosition].words.w0 = lo; + gfx[sGfxSeekPosition].words.w1 = addr; + sGfxSeekPosition++; + + gfx[sGfxSeekPosition].words.w0 = tileSync->words.w0; + gfx[sGfxSeekPosition].words.w1 = tileSync->words.w1; + sGfxSeekPosition++; + + lo = (G_SETTILE << 24) | (fmt << 21) | (siz << 19) | tmem; + hi = tile << 24; + + gfx[sGfxSeekPosition].words.w0 = lo; + gfx[sGfxSeekPosition].words.w1 = hi; + sGfxSeekPosition++; + + gfx[sGfxSeekPosition].words.w0 = loadSync->words.w0; + gfx[sGfxSeekPosition].words.w1 = loadSync->words.w1; + sGfxSeekPosition++; + + lo = G_LOADBLOCK << 24; + hi = (tile << 24) | (MIN((width * height) - 1, 0x7FF) << 12) | CALC_DXT(width, G_IM_SIZ_16b_BYTES); + + gfx[sGfxSeekPosition].words.w0 = lo; + gfx[sGfxSeekPosition].words.w1 = hi; + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A91E4.s") -#endif -void func_802A94D8(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_texture_on(Gfx *arg0, UNUSED u8 *args, UNUSED s8 arg2) { Gfx macro[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON) }; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -void func_802A9544(Gfx *arg0, u8 arg1, u8 arg2) { +void unpack_texture_off(Gfx *arg0, UNUSED u8 *args, UNUSED s8 arg2) { Gfx macro[] = { gsSPTexture(0x1, 0x1, 0, G_TX_RENDERTILE, G_OFF) }; - arg0[D_802BA270].words.w0 = macro->words.w0; - arg0[D_802BA270].words.w1 = macro->words.w1; - D_802BA270++; + arg0[sGfxSeekPosition].words.w0 = macro->words.w0; + arg0[sGfxSeekPosition].words.w1 = macro->words.w1; + sGfxSeekPosition++; } -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A95B0(Gfx *displayList, u8 *arg1, s32 arg2) { - s32 temp_t5; - s32 temp_t7; - s32 temp_t7_2; - u8 temp_v0; +void unpack_vtx1(Gfx *gfx, u8 *args, UNUSED s8 arg2) { + u32 temp_t7; + u32 temp_t7_2; - temp_t7 = D_802BA274 + 1; - temp_v0 = arg1[D_802BA274]; - D_802BA274 = temp_t7; - temp_t5 = temp_t7 + 1; - D_802BA274 = temp_t5; - temp_t7_2 = temp_t5 + 1; - D_802BA274 = temp_t7_2; - D_802BA274 = temp_t7_2 + 1; - displayList[D_802BA270].words.w0 = ((arg1[temp_t7_2] & 0x3F) << 0x11) | 0x04000000 | (((arg1[temp_t5] & 0x3F) * 0x410) - 1); - displayList[D_802BA270].words.w1 = (((arg1[temp_t7] << 8) | temp_v0) * 0x10) + 0x04000000; - D_802BA270 += 1; + u32 temp = args[sPackedSeekPosition++]; + u32 temp2 = ((args[sPackedSeekPosition++] << 8) | temp) * 0x10; + + temp = args[sPackedSeekPosition++]; + temp_t7 = temp & 0x3F; + temp = args[sPackedSeekPosition++]; + temp_t7_2 = temp & 0x3F; + + gfx[sGfxSeekPosition].words.w0 = (G_VTX << 24) | (temp_t7_2 * 2 << 16) | (((temp_t7 << 10) + ((0x10 * temp_t7) - 1))); + gfx[sGfxSeekPosition].words.w1 = 0x04000000 + temp2; + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A95B0.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A9674(Gfx *displayList, u8 *arg1, s8 arg2) { - s32 temp_t9; - u8 temp_v0; +void unpack_vtx2(Gfx *gfx, u8 *args, s8 arg2) { + u32 temp_t9; + u32 temp_v1; + u32 temp_v2; - temp_t9 = D_802BA274 + 1; - temp_v0 = arg1[D_802BA274]; - D_802BA274 = temp_t9; - D_802BA274 = temp_t9 + 1; - displayList[D_802BA270].words.w0 = (((arg2 - 0x32) * 0x410) - 1) | 0x04000000; - displayList[D_802BA270].words.w1 = (((arg1[temp_t9] << 8) | temp_v0) * 0x10) + 0x04000000; - D_802BA270 += 1; + temp_v1 = args[sPackedSeekPosition++]; + temp_v2 = ((args[sPackedSeekPosition++] << 8) | temp_v1) * 0x10; + + temp_t9 = arg2 - 50; + + gfx[sGfxSeekPosition].words.w0 = (G_VTX << 24) | ((temp_t9 << 10) + (((temp_t9) * 0x10) - 1)); + gfx[sGfxSeekPosition].words.w1 = 0x4000000 + temp_v2; + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A9674.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A9714(Gfx *displayList, u8 *arg1, s32 arg2) { - s32 temp_t7; - s32 var_a0; - s32 var_a2; - s32 var_a3; - u8 temp_v0; - u8 temp_v0_2; - u8 temp_v0_3; +void unpack_triangle(Gfx *gfx, u8 *args, UNUSED s8 arg2) { + u32 temp_v0; + u32 phi_a0; + u32 phi_a2; + u32 phi_a3; - temp_v0 = arg1[D_802BA274]; - temp_t7 = D_802BA274 + 1; - D_802BA274 = temp_t7; - var_a0 = temp_v0 & 0x1F; - var_a3 = temp_v0 & 0x1F; - if (gIsMirrorMode != 0) { - temp_v0_2 = arg1[temp_t7]; - D_802BA274 = temp_t7 + 1; - var_a2 = ((temp_v0 >> 5) & 7) | ((temp_v0_2 & 3) * 8); - var_a3 = (temp_v0_2 >> 2) & 0x1F; + temp_v0 = args[sPackedSeekPosition++]; + + if (gIsMirrorMode) { + phi_a3 = temp_v0 & 0x1F; + phi_a2 = (temp_v0 >> 5) & 7; + temp_v0 = args[sPackedSeekPosition++]; + phi_a2 |= (temp_v0 & 3) * 8; + phi_a0 = (temp_v0 >> 2) & 0x1F; } else { - temp_v0_3 = arg1[D_802BA274]; - D_802BA274 += 1; - var_a2 = ((temp_v0 >> 5) & 7) | ((temp_v0_3 & 3) * 8); - var_a0 = (temp_v0_3 >> 2) & 0x1F; + phi_a0 = temp_v0 & 0x1F; + phi_a2 = (temp_v0 >> 5) & 7; + temp_v0 = args[sPackedSeekPosition++]; + phi_a2 |= (temp_v0 & 3) * 8; + phi_a3 = (temp_v0 >> 2) & 0x1F; } - displayList[D_802BA270].words.w0 = 0xBF000000; - displayList[D_802BA270].words.w1 = (var_a3 << 0x11) | (var_a2 << 9) | (var_a0 * 2); - D_802BA270 += 1; + gfx[sGfxSeekPosition].words.w0 = (G_TRI1 << 24); + gfx[sGfxSeekPosition].words.w1 = ((phi_a0 * 2) << 16) | ((phi_a2 * 2) << 8) | (phi_a3 * 2); + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A9714.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A980C(Gfx *displayList, u8 *arg1, s32 arg2) { - s32 temp_t7; - s32 temp_t8; - s32 temp_t9; - s32 temp_t9_2; - s32 var_a0; - s32 var_a2; - s32 var_a3; - s32 var_t0; - s32 var_t1; - s32 var_t2; - u8 temp_v0; - u8 temp_v0_2; - u8 temp_v0_3; - u8 temp_v0_4; - u8 temp_v0_5; - u8 temp_v0_6; +void unpack_quadrangle(Gfx *gfx, u8 *args, UNUSED s8 arg2) { + u32 temp_v0; + u32 phi_t0; + u32 phi_a3; + u32 phi_a0; + u32 phi_t2; + u32 phi_t1; + u32 phi_a2; - temp_v0 = arg1[D_802BA274]; - temp_t7 = D_802BA274 + 1; - D_802BA274 = temp_t7; - var_a0 = temp_v0 & 0x1F; - var_t0 = temp_v0 & 0x1F; - if (gIsMirrorMode != 0) { - temp_v0_2 = arg1[temp_t7]; - D_802BA274 = temp_t7 + 1; - var_a3 = ((temp_v0 >> 5) & 7) | ((temp_v0_2 & 3) * 8); - var_t0 = (temp_v0_2 >> 2) & 0x1F; + temp_v0 = args[sPackedSeekPosition++]; + + if (gIsMirrorMode) { + phi_t0 = temp_v0 & 0x1F; + phi_a3 = (temp_v0 >> 5) & 7; + temp_v0 = args[sPackedSeekPosition++]; + phi_a3 |= (temp_v0 & 3) * 8; + phi_a0 = (temp_v0 >> 2) & 0x1F; } else { - temp_v0_3 = arg1[D_802BA274]; - D_802BA274 += 1; - var_a3 = ((temp_v0 >> 5) & 7) | ((temp_v0_3 & 3) * 8); - var_a0 = (temp_v0_3 >> 2) & 0x1F; + phi_a0 = temp_v0 & 0x1F; + phi_a3 = (temp_v0 >> 5) & 7; + temp_v0 = args[sPackedSeekPosition++]; + phi_a3 |= (temp_v0 & 3) * 8; + phi_t0 = (temp_v0 >> 2) & 0x1F; } - temp_v0_4 = arg1[D_802BA274]; - temp_t9 = D_802BA274 + 1; - D_802BA274 = temp_t9; - if (gIsMirrorMode != 0) { - var_a2 = temp_v0_4 & 0x1F; - temp_v0_5 = arg1[temp_t9]; - D_802BA274 = temp_t9 + 1; - var_t1 = ((temp_v0_4 >> 5) & 7) | ((temp_v0_5 & 3) * 8); - var_t2 = (temp_v0_5 >> 2) & 0x1F; + + temp_v0 = args[sPackedSeekPosition++]; + + if (gIsMirrorMode) { + phi_a2 = temp_v0 & 0x1F; + phi_t1 = (temp_v0 >> 5) & 7; + temp_v0 = args[sPackedSeekPosition++]; + phi_t1 |= (temp_v0 & 3) * 8; + phi_t2 = (temp_v0 >> 2) & 0x1F; } else { - var_t2 = temp_v0_4 & 0x1F; - temp_v0_6 = arg1[D_802BA274]; - temp_t8 = (temp_v0_6 & 3) * 8; - temp_t9_2 = (temp_v0_6 >> 2) & 0x1F; - D_802BA274 += 1; - var_t1 = ((temp_v0_4 >> 5) & 7) | temp_t8; - var_a2 = temp_t9_2; + phi_t2 = temp_v0 & 0x1F; + phi_t1 = (temp_v0 >> 5) & 7; + temp_v0 = args[sPackedSeekPosition++]; + phi_t1 |= (temp_v0 & 3) * 8; + phi_a2 = (temp_v0 >> 2) & 0x1F; } - displayList[D_802BA270].words.w0 = (var_t0 << 0x11) | 0xB1000000 | (var_a3 << 9) | (var_a0 * 2); - displayList[D_802BA270].words.w1 = (var_t2 << 0x11) | (var_t1 << 9) | (var_a2 * 2); - D_802BA270 += 1; + gfx[sGfxSeekPosition].words.w0 = + (G_TRI2 << 24) | ((phi_a0 * 2) << 16) | ((phi_a3 * 2) << 8) | (phi_t0 * 2); + gfx[sGfxSeekPosition].words.w1 = ((phi_t2 * 2) << 16) | ((phi_t1 * 2) << 8) | (phi_a2 * 2); + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A980C.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void func_802A99A4(Gfx *displayList, u8 *arg1, s32 arg2) { - s32 temp_t3; - s32 temp_t6; - s32 temp_t7; - s32 var_a0; - s32 var_a2; - s32 var_a3; - s32 var_t0; - u8 temp_v0; - u8 temp_v0_2; - u8 temp_v0_3; +void unpack_spline_3D(Gfx *gfx, u8 *arg1, UNUSED s8 arg2) { + u32 temp_v0; + u32 phi_a0; + u32 phi_t0; + u32 phi_a3; + u32 phi_a2; + + temp_v0 = arg1[sPackedSeekPosition++]; - temp_v0 = arg1[D_802BA274]; - temp_t7 = D_802BA274 + 1; - D_802BA274 = temp_t7; - var_a0 = temp_v0 & 0x1F; - var_t0 = temp_v0 & 0x1F; if (gIsMirrorMode != 0) { - temp_v0_2 = arg1[temp_t7]; - temp_t3 = temp_t7 + 1; - D_802BA274 = temp_t3; - var_a2 = ((temp_v0 >> 5) & 7) | ((temp_v0_2 & 3) * 8); - var_a3 = (temp_v0_2 >> 2) & 0x1F; - D_802BA274 = temp_t3 + 1; - var_t0 = ((temp_v0_2 >> 7) & 1) | ((arg1[temp_t3] & 0xF) * 2); + phi_a0 = temp_v0 & 0x1F; + phi_a2 = ((temp_v0 >> 5) & 7); + temp_v0 = arg1[sPackedSeekPosition++]; + phi_a2 |= ((temp_v0 & 3) * 8); + phi_a3 = (temp_v0 >> 2) & 0x1F; + phi_t0 = ((temp_v0 >> 7) & 1); + temp_v0 = arg1[sPackedSeekPosition++]; + phi_t0 |= (temp_v0 & 0xF) * 2; } else { - temp_v0_3 = arg1[D_802BA274]; - temp_t6 = D_802BA274 + 1; - D_802BA274 = temp_t6; - var_a3 = ((temp_v0 >> 5) & 7) | ((temp_v0_3 & 3) * 8); - var_a2 = (temp_v0_3 >> 2) & 0x1F; - D_802BA274 = temp_t6 + 1; - var_a0 = ((temp_v0_3 >> 7) & 1) | ((arg1[temp_t6] & 0xF) * 2); + phi_t0 = temp_v0 & 0x1F; + phi_a3 = ((temp_v0 >> 5) & 7); + temp_v0 = arg1[sPackedSeekPosition++]; + phi_a3 |= ((temp_v0 & 3) * 8); + phi_a2 = (temp_v0 >> 2) & 0x1F; + phi_a0 = ((temp_v0 >> 7) & 1); + temp_v0 = arg1[sPackedSeekPosition++]; + phi_a0 |= (temp_v0 & 0xF) * 2; } - displayList[D_802BA270].words.w0 = 0xB5000000; - displayList[D_802BA270].words.w1 = (var_a0 << 0x19) | (var_t0 << 0x11) | (var_a3 << 9) | (var_a2 * 2); - D_802BA270 += 1; + gfx[sGfxSeekPosition].words.w0 = (G_LINE3D << 24); + gfx[sGfxSeekPosition].words.w1 = + ((phi_a0 * 2) << 24) | ((phi_t0 * 2) << 16) | ((phi_a3 * 2) << 8) | (phi_a2 * 2); + sGfxSeekPosition++; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A99A4.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -void func_802A8F80(Gfx *, u8, s8, s32 *); /* extern */ -void func_802A91E4(Gfx *, u8, s8, s32 *); /* extern */ -void func_802A95B0(Gfx *, u8, s8, s32 *); /* extern */ -void func_802A9674(Gfx *, u8, s8, s32 *); /* extern */ -void func_802A9714(Gfx *, u8, s8, s32 *); /* extern */ -void func_802A980C(Gfx *, u8, s8, s32 *); /* extern */ -void func_802A99A4(Gfx *, u8, s8, s32 *); /* extern */ -extern s32 D_802BA270; -extern s32 D_802BA274; -extern Gfx *gHeapEndPtr; +UNUSED void func_802A9AEC(void) { -void display_list_unpack(u32 arg0, s32 arg1, u8 arg2) { - Gfx *sp2C; - Gfx *temp_s1; - s32 temp_v1; - u8 temp_a0; - u8 temp_s0; +} - temp_s0 = gSegmentTable[arg0 >> 0x18] + (arg0 & 0xFFFFFF) + 0x80000000; - temp_s1 = gHeapEndPtr - (((arg1 + 0xF) & ~0xF) + 8); - gHeapEndPtr = temp_s1; - D_802BA270 = 0; - sp2C = temp_s1; - D_802BA274 = 0; -case 0x31: -case 0x32: -loop_1: - temp_v1 = D_802BA274; - temp_a0 = *(temp_v1 + temp_s0); - D_802BA274 = temp_v1 + 1; - switch (temp_a0) { /* irregular */ - case 0x0: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x1: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x2: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x3: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x4: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x5: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x6: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x7: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x8: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x9: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0xA: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0xB: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0xC: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0xD: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0xE: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0xF: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x10: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x11: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x12: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x13: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x14: - func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; - case 0x15: - func_802A8B48(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x16: - func_802A8BB4(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x17: - func_802A8C20(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x2E: - func_802A8C8C(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x53: - func_802A8CF8(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x18: - func_802A8D64(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x19: - func_802A8DD0(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x2F: - func_802A8E3C(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x54: - func_802A8EA8(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x55: - func_802A8F14(temp_s1, temp_s0, arg2); - goto loop_1; - case 0x1A: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x2C: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x1B: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x1C: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x1D: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x1E: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x1F: - func_802A8F80(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x20: - func_802A91E4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x21: - func_802A91E4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x22: - func_802A91E4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x23: - func_802A91E4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x24: - func_802A91E4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x25: - func_802A91E4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x26: - func_802A94D8(temp_s1, temp_s0, (u8) (s8) temp_a0); - goto loop_1; - case 0x27: - func_802A9544(temp_s1, temp_s0, (u8) (s8) temp_a0); - goto loop_1; - case 0x28: - func_802A95B0(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x33: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x34: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x35: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x36: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x37: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x38: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x39: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x3A: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x3B: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x3C: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x3D: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x3E: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x3F: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x40: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x41: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x42: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x43: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x44: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x45: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x46: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x47: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x48: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x49: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x4A: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x4B: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x4C: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x4D: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x4E: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x4F: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x50: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x51: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x52: - func_802A9674(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x29: - func_802A9714(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x58: - func_802A980C(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x30: - func_802A99A4(temp_s1, temp_s0, (s8) temp_a0, &D_802BA274); - goto loop_1; - case 0x2D: - func_802A8ADC(temp_s1, temp_s0, (u8) (s8) temp_a0); - goto loop_1; - case 0x2A: - func_802A89C0(temp_s1, temp_s0, (u8) (s8) temp_a0); - goto loop_1; - case 0x56: - func_802A8A04(temp_s1, temp_s0, (u8) (s8) temp_a0); - goto loop_1; - case 0x57: - func_802A8A70(temp_s1, temp_s0, (u8) (s8) temp_a0); - goto loop_1; - case 0x2B: - func_802A8940(temp_s1, (u8 *) temp_s0, (u8) (s8) temp_a0); - goto loop_1; +/** + * Unpacks course packed displaylists by iterating through each byte of the packed file. + * Each packed displaylist entry has an opcode and any number of arguments. + * The opcodes range from 0 to 87 which are used to run the relevant unpack function. + * The file pointer increments when arguments are used. This way, + * displaylist_unpack will always read an opcode and not an argument by accident. + * + * @warning opcodes that do not contain a definition in the switch are ignored. If an undefined opcode + * contained arguments the unpacker might try to unpack those arguments. + * This issue is prevented so long as the packed file adheres to correct opcodes and unpack code + * increments the file pointer the correct number of times. + */ +void displaylist_unpack(uintptr_t *data, uintptr_t finalDisplaylistOffset, u32 arg2) { + uintptr_t segment = SEGMENT_NUMBER2(data); + uintptr_t offset = SEGMENT_OFFSET(data); + u8 *packed_dl = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + + Gfx *gfx; + u32 addr; + + u8 opcode; + + finalDisplaylistOffset = ALIGN16(finalDisplaylistOffset) + 8; + gHeapEndPtr -= finalDisplaylistOffset; + addr = gHeapEndPtr; + gfx = (Gfx *) gHeapEndPtr; + sGfxSeekPosition = 0; + sPackedSeekPosition = 0; + + while(1) { + + // Seek to the next byte + opcode = packed_dl[sPackedSeekPosition++]; + + // Break when the eof has been reached denoted by opcode 0xFF + if (opcode == 0xFF) break; + + switch (opcode) { + case 0x0: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x1: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x2: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x3: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x4: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x5: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x6: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x7: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x8: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x9: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0xA: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0xB: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0xC: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0xD: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0xE: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0xF: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x10: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x11: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x12: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x13: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x14: + unpack_lights(gfx, packed_dl, opcode); + break; + case 0x15: + unpack_combine_mode1(gfx, packed_dl, arg2); + break; + case 0x16: + unpack_combine_mode2(gfx, packed_dl, arg2); + break; + case 0x17: + unpack_combine_mode_shade(gfx, packed_dl, arg2); + break; + case 0x2E: + unpack_combine_mode4(gfx, packed_dl, arg2); + break; + case 0x53: + unpack_combine_mode5(gfx, packed_dl, arg2); + break; + case 0x18: + unpack_render_mode_opaque(gfx, packed_dl, arg2); + break; + case 0x19: + unpack_render_mode_tex_edge(gfx, packed_dl, arg2); + break; + case 0x2F: + unpack_render_mode_translucent(gfx, packed_dl, arg2); + break; + case 0x54: + unpack_render_mode_opaque_decal(gfx, packed_dl, arg2); + break; + case 0x55: + unpack_render_mode_translucent_decal(gfx, packed_dl, arg2); + break; + case 0x1A: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x2C: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x1B: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x1C: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x1D: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x1E: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x1F: + unpack_tile_sync(gfx, packed_dl, opcode); + break; + case 0x20: + unpack_tile_load_sync(gfx, packed_dl, opcode); + break; + case 0x21: + unpack_tile_load_sync(gfx, packed_dl, opcode); + break; + case 0x22: + unpack_tile_load_sync(gfx, packed_dl, opcode); + break; + case 0x23: + unpack_tile_load_sync(gfx, packed_dl, opcode); + break; + case 0x24: + unpack_tile_load_sync(gfx, packed_dl, opcode); + break; + case 0x25: + unpack_tile_load_sync(gfx, packed_dl, opcode); + break; + case 0x26: + unpack_texture_on(gfx, packed_dl, opcode); + break; + case 0x27: + unpack_texture_off(gfx, packed_dl, opcode); + break; + case 0x28: + unpack_vtx1(gfx, packed_dl, opcode); + break; + case 0x33: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x34: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x35: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x36: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x37: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x38: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x39: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x3A: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x3B: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x3C: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x3D: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x3E: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x3F: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x40: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x41: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x42: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x43: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x44: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x45: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x46: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x47: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x48: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x49: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x4A: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x4B: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x4C: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x4D: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x4E: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x4F: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x50: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x51: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x52: + unpack_vtx2(gfx, packed_dl, opcode); + break; + case 0x29: + unpack_triangle(gfx, packed_dl, opcode); + break; + case 0x58: + unpack_quadrangle(gfx, packed_dl, opcode); + break; + case 0x30: + unpack_spline_3D(gfx, packed_dl, opcode); + break; + case 0x2D: + unpack_cull_displaylist(gfx, packed_dl, opcode); + break; + case 0x2A: + unpack_end_displaylist(gfx, packed_dl, opcode); + break; + case 0x56: + unpack_set_geometry_mode(gfx, packed_dl, opcode); + break; + case 0x57: + unpack_clear_geometry_mode(gfx, packed_dl, opcode); + break; + case 0x2B: + unpack_displaylist(gfx, packed_dl, opcode); + break; + default: + // Skip unknown values + break; + } } - set_segment_base_addr(7, sp2C); + set_segment_base_addr(0x7, (void *) addr); } -#else -GLOBAL_ASM("asm/non_matchings/memory/display_list_unpack.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -u32 MIO0_0F(s32, s32, s32); // extern -extern uintptr_t gSegmentTable; +struct UnkStr_802AA7C8 { + u8 *unk0; + u32 unk4; + u32 unk8; + u32 unkC; +}; -void func_802AA7C8(u32 arg0) { - void *sp20; - s32 temp_a0; - void *temp_s0; - void *temp_t2; - void *phi_s0; - s32 phi_v0; - void *phi_s0_2; +void decompress_textures(u32 *arg0) { + u32 segment = SEGMENT_NUMBER2(arg0); + u32 offset = SEGMENT_OFFSET(arg0); + struct UnkStr_802AA7C8 *phi_s0 = + (struct UnkStr_802AA7C8 *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + struct UnkStr_802AA7C8 *temp_s0; + u32 temp_t2; + u8 *temp_a0; + u32 phi_v0; + u32 sp20; - temp_s0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; - phi_s0 = temp_s0; phi_v0 = 0; -loop_1: - if (phi_s0->unk0 != 0) { - phi_s0 += 0x10; + temp_s0 = phi_s0; + while (TRUE) { + temp_a0 = phi_s0->unk0; + if ((temp_a0) == 0) { + break; + } phi_v0 += phi_s0->unk8; - goto loop_1; + phi_s0++; } - temp_t2 = gHeapEndPtr - phi_v0; - gHeapEndPtr = temp_t2; - sp20 = temp_t2; - phi_s0_2 = temp_s0; -loop_4: - temp_a0 = phi_s0_2->unk0; - if (temp_a0 != 0) { - MIO0_0F(temp_a0, phi_s0_2->unk4, phi_s0_2->unk8); - phi_s0_2 += 0x10; - goto loop_4; + phi_s0 = temp_s0; + gHeapEndPtr -= phi_v0; + sp20 = gHeapEndPtr; + + while (TRUE) { + temp_a0 = phi_s0->unk0; + if ((temp_a0) == 0) { + break; + } + MIO0_0F(temp_a0, phi_s0->unk4, phi_s0->unk8); + phi_s0++; } gHeapEndPtr = sp20; - set_segment_base_addr(5, sp20); + temp_t2 = gHeapEndPtr; + set_segment_base_addr(0x5, (void *) temp_t2); } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AA7C8.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022 -void *func_802AA88C(u8 *arg0, u8 *arg1) { - s32 sp28; - u8 *sp20; - u32 sp1C; - u32 temp_t6; - u8 *temp_a0; +void *decompress_segments(u8 *start, u8 *end) { + UNUSED u32 pad; + u32 sp28; + u32 size = ALIGN16(end - start); + u8 *heapEnd; + u32 *freeSpace; - temp_t6 = ((arg1 - arg0) + 0xF) & ~0xF; - temp_a0 = gHeapEndPtr - temp_t6; - sp20 = temp_a0; - dma_copy(temp_a0, arg0, temp_t6); - sp1C = gPrevLoadedAddress; - sp28 = (temp_a0->unk4 + 0xF) & ~0xF; - mio0decode(temp_a0, (u8 *) gPrevLoadedAddress); - gPrevLoadedAddress += sp28; - return (void *) sp1C; + heapEnd = (u8 *) gHeapEndPtr - size; + // sp20 = temp_a0; + dma_copy(heapEnd, start, size); + sp28 = *(u32 *) (heapEnd + 4); + sp28 = ALIGN16(sp28); + freeSpace = (u32 *) gNextFreeMemoryAddress; + mio0decode(heapEnd, (u8 *)freeSpace); + gNextFreeMemoryAddress += sp28; + return (void *)freeSpace; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AA88C.s") -#endif -s32 load_course(s32 courseId) { +/** + * @brief Loads & DMAs course data. Vtx, textures, displaylists, etc. + * @param courseId +*/ +u8 *load_course(s32 courseId) { UNUSED s32 pad[4]; - u32 *temp_v0; - u32 *dlRomStart; - u32 *dlRomEnd; - u32 *vertexRomStart; - u32 *vertexRomEnd; - s32 pad2; - s32 gamestate; + u8 *vtxCompressed; // mio0 compressed + u8 *courseDataRomStart; // mio0 compressed + u8 *courseDataRomEnd; + u8 *vertexRomStart; // mio0 compressed + u8 *vertexRomEnd; + UNUSED s32 pad2[2]; u32 *textures; - mk64_Vtx *vertexStart; - u32 *packedStart; + u8 *vertexStart; // mio0 compressed + u8 *packedStart; u32 vertexCount; - u32 *finalDL; - s32 unknown1; + uintptr_t finalDisplaylistOffset; + u32 unknown1; s32 prevLoadedAddress_saved; - s32 offsetRomStart; - s32 offsetRomEnd; + struct course_texture *offsetRomStart; + struct course_texture *offsetRomEnd; // Pointers to rom offsets - gamestate = gGamestate; - dlRomStart = gCourseTable[courseId].dlRomStart; - dlRomEnd = gCourseTable[courseId].dlRomEnd; + //gamestate = gGamestate; + courseDataRomStart = gCourseTable[courseId].dlRomStart; + courseDataRomEnd = gCourseTable[courseId].dlRomEnd; offsetRomStart = gCourseTable[courseId].offsetRomStart; offsetRomEnd = gCourseTable[courseId].offsetRomEnd; vertexRomStart = gCourseTable[courseId].vertexRomStart; @@ -1359,26 +1343,26 @@ s32 load_course(s32 courseId) { vertexStart = gCourseTable[courseId].vertexStart; packedStart = gCourseTable[courseId].packedStart; vertexCount = gCourseTable[courseId].vertexCount; - finalDL = gCourseTable[courseId].finalDL; + finalDisplaylistOffset = gCourseTable[courseId].finalDisplaylistOffset; unknown1 = gCourseTable[courseId].unknown1; - if ((gamestate == ENDING_SEQUENCE) || (gamestate == CREDITS_SEQUENCE)) { + if ((gGamestate == ENDING_SEQUENCE) || (gGamestate == CREDITS_SEQUENCE)) { gHeapEndPtr = SEG_80280000; } else { gHeapEndPtr = SEG_8028DF00; } - set_segment_base_addr(9, func_802A7D70(offsetRomStart, offsetRomEnd)); + set_segment_base_addr(9, load_data((uintptr_t)offsetRomStart, (uintptr_t) offsetRomEnd)); if (gGamestate != ENDING_SEQUENCE) { - set_segment_base_addr(6, func_802AA88C(dlRomStart, dlRomEnd)); + set_segment_base_addr(6, decompress_segments(courseDataRomStart, courseDataRomEnd)); } - prevLoadedAddress_saved = gPrevLoadedAddress; - temp_v0 = func_802A82E4((u8 *)vertexRomStart, (u8 *)vertexRomEnd); + prevLoadedAddress_saved = gNextFreeMemoryAddress; + vtxCompressed = dma_compressed_vtx(vertexRomStart, vertexRomEnd); - set_segment_base_addr(0xF, (void *)temp_v0); - func_802A87A8(vertexStart, vertexCount); - display_list_unpack(packedStart, finalDL, unknown1); - func_802AA7C8(textures); - gPrevLoadedAddress = prevLoadedAddress_saved; - return temp_v0; + set_segment_base_addr(0xF, (void *) vtxCompressed); + decompress_vtx(vertexStart, vertexCount); + displaylist_unpack((uintptr_t *) packedStart, finalDisplaylistOffset, unknown1); + decompress_textures(textures); + gNextFreeMemoryAddress = prevLoadedAddress_saved; + return vtxCompressed; } diff --git a/src/memory.h b/src/memory.h index fb66e7cdf..dde10da57 100644 --- a/src/memory.h +++ b/src/memory.h @@ -40,15 +40,18 @@ struct AllocOnlyPool { #define ALIGN4(val) (((val) + 0x3) & ~0x3) -s32 func_802A7B70(s32); +extern f32 vtxStretchY; + +u32 *get_next_available_memory_addr(u32); uintptr_t set_segment_base_addr(s32, void*); void *get_segment_base_addr(s32); void *segmented_to_virtual(const void *); void move_segment_table_to_dmem(); -void func_802A7CF0(s32, s32); -s32 func_802A7D1C(s32); +void initialize_memory_pool(uintptr_t, uintptr_t); +void *allocate_memory(u32); +void *load_data(uintptr_t, uintptr_t); void func_802A7D54(s32, s32); -s32 func_802A7D70(s32, s32); + void main_pool_init(u32, u32); void *main_pool_alloc(u32, u32); u32 main_pool_free(void*); @@ -57,41 +60,40 @@ s32 main_pool_available(); u32 main_pool_push_state(); u32 main_pool_pop_state(); void *func_802A80B0(u8*, u8*, u8*); -void *load_segment(s32, u8*, u8*, u32); -void *func_802A8190(s32, s32); void func_802A81EC(); struct AllocOnlyPool *alloc_only_pool_init(u32, u32); u32 func_802A82AC(s32); -s32 func_802A82E4(u8*, u8*); s32 func_802A8348(s32, s32, s32); -s32 func_802A841C(s32, s32, s32); -s32 func_802A84F4(s32, u32, u32); -u32 MIO0_0F(s32, u32, u32); +u8 *dma_textures(u8*, u32, u32); +u32 MIO0_0F(u8*, u32, u32); void func_802A8844(); -void func_802A884C(Gfx*, u8, s8); -void func_802A8940(Gfx*, u8*, u8); -void func_802A89C0(Gfx*, u8, u8); -void func_802A8A04(Gfx*, u8, u8); -void func_802A8A70(Gfx*, u8, u8); -void func_802A8ADC(Gfx*, u8, u8); -void func_802A8B48(Gfx*, u8, u8); -void func_802A8BB4(Gfx*, u8, u8); -void func_802A8C20(Gfx*, u8, u8); -void func_802A8C8C(Gfx*, u8, u8); -void func_802A8CF8(Gfx*, u8, u8); -void func_802A8D64(Gfx*, u8, u8); -void func_802A8DD0(Gfx*, u8, u8); -void func_802A8E3C(Gfx*, u8, u8); -void func_802A8EA8(Gfx*, u8, u8); -void func_802A8F14(Gfx*, u8, u8); -void func_802A94D8(Gfx*, u8, u8); -void func_802A9544(Gfx*, u8, u8); +void unpack_lights(Gfx*, u8*, s8); +void unpack_displaylist(Gfx*, u8*, s8); +void unpack_end_displaylist(Gfx*, u8*, s8); +void unpack_set_geometry_mode(Gfx*, u8*, s8); +void unpack_clear_geometry_mode(Gfx*, u8*, s8); +void unpack_cull_displaylist(Gfx*, u8*, s8); +void unpack_combine_mode1(Gfx*, u8*, u32); +void unpack_combine_mode2(Gfx*, u8*, u32); +void unpack_combine_mode_shade(Gfx*, u8*, u32); +void unpack_combine_mode4(Gfx*, u8*, u32); +void unpack_combine_mode5(Gfx*, u8*, u32); +void unpack_render_mode_opaque(Gfx*, u8*, u32); +void unpack_render_mode_tex_edge(Gfx*, u8*, u32); +void unpack_render_mode_translucent(Gfx*, u8*, u32); +void unpack_render_mode_opaque_decal(Gfx*, u8*, u32); +void unpack_render_mode_translucent_decal(Gfx*, u8*, u32); +void unpack_tile_sync(Gfx*, u8*, s8); +void unpack_tile_load_sync(Gfx*, u8*, s8); +void unpack_texture_on(Gfx*, u8*, s8); +void unpack_texture_off(Gfx*, u8*, s8); +u8 *load_course(s32); // main.c extern struct D_80150158 gD_80150158[]; extern s32 D_801502A0; -extern u32 D_8015F724; -extern u32 gPrevLoadedAddress; +extern u32 gFreeMemorySize; +extern u32 gNextFreeMemoryAddress; extern u32 gHeapEndPtr; extern u8 _other_texturesSegmentRomStart[]; diff --git a/src/profiler.c b/src/profiler.c index dd674fc40..8090e9dbb 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -3,11 +3,9 @@ #include "types.h" #include "profiler.h" #include "config.h" +#include "main.h" struct ProfilerFrameData gProfilerFrameData[2]; -extern u32 D_800DC568; -extern u32 D_800DC56C; -extern Gfx *gDisplayListHead; s32 gEnableResourceMeters = 0; @@ -213,7 +211,7 @@ void draw_profiler_mode_0(void) { // Two added lines in Mario Kart 64 D_800DC568 = (s32) (clockStart + renderDuration); - D_800DC56C = rdpDuration; + D_800DC56C[0] = rdpDuration; // Draw bottom profilers. @@ -227,8 +225,6 @@ void draw_profiler_mode_0(void) { draw_reference_profiler_bars(); } -extern struct Controller *gControllerOne; - // Similar to draw_screen_borders from SM64, with a hint of draw_profiler void resource_display(void) { gDPPipeSync(gDisplayListHead++); diff --git a/src/profiler.h b/src/profiler.h index 567f302be..2416f4d44 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -44,6 +44,7 @@ void profiler_log_thread4_time(void); void profiler_log_gfx_time(enum ProfilerGfxEvent eventID); void profiler_log_vblank_time(void); void draw_profiler(void); +void resource_display(void); extern s32 gEnableResourceMeters; diff --git a/src/race_logic.c b/src/race_logic.c index aeea42c06..91d61c7f0 100644 --- a/src/race_logic.c +++ b/src/race_logic.c @@ -12,9 +12,12 @@ #include "code_80057C60.h" #include "code_80071F00.h" #include "code_80091750.h" +#include "code_80005FD0.h" +#include "spawn_players.h" #include "audio/external.h" #include "race_logic.h" #include "skybox_and_splitscreen.h" +#include "math_util_2.h" extern Player *gPlayerTwo; extern Player *gPlayerThree; diff --git a/src/race_logic.h b/src/race_logic.h index eeb20932f..c4ef1dc20 100644 --- a/src/race_logic.h +++ b/src/race_logic.h @@ -3,6 +3,7 @@ /* Function Prototypes */ +void func_802903D8(Player*, Player*); void func_8028DF00(); void func_8028DF38(); void func_8028E028(); diff --git a/src/render_courses.c b/src/render_courses.c index a8025e635..f258018ca 100644 --- a/src/render_courses.c +++ b/src/render_courses.c @@ -4,12 +4,14 @@ #include #include #include +#include "main.h" #include "actors.h" #include "math_util.h" #include "memory.h" #include "code_80281780.h" #include "code_802AAA70.h" #include "render_courses.h" +#include "skybox_and_splitscreen.h" f32 gFloatArray802B8790[] = { 1.2, 1.0, 0.9, 0.7, 2.0, 1.8, 0.9, 2.3 @@ -42,7 +44,7 @@ s32 func_80290C20(Camera *camera) { void func_80290CAC(uintptr_t arg0) { s32 segment = SEGMENT_NUMBER2(arg0); s32 offset = SEGMENT_OFFSET(arg0); - struct Unk0CAC *data = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + struct Unk0CAC *data = (struct Unk0CAC *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); while(data->unk0 != 0) { if ((data->unk6 & 0x8000) != 0) { @@ -67,12 +69,13 @@ void func_80290CAC(uintptr_t arg0) { extern u16 D_80152300[]; -void load_surface_map(s32 arg0, struct UnkStruct_800DC5EC *arg1) { +void load_surface_map(uintptr_t arg0, struct UnkStruct_800DC5EC *arg1) { Player *temp_t1 = arg1->player; Camera *temp_a2 = arg1->camera; u32 segment = SEGMENT_NUMBER2(arg0); u32 offset = SEGMENT_OFFSET(arg0); - s32 *addr = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + // todo: Should be Gfx* + s32 *addr = (s32 *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); s16 var_a3; s16 temp_v1; s16 sp1E; @@ -959,10 +962,9 @@ GLOBAL_ASM("asm/non_matchings/render_courses/func_8029122C.s") #endif void render_mario_raceway(struct UnkStruct_800DC5EC *arg0) { - s32 pad; + UNUSED s32 pad; u16 sp22 = arg0->pathCounter; u16 temp_t0 = arg0->playerDirection; - void *temp_a1; gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1056,7 +1058,7 @@ void render_mario_raceway(struct UnkStruct_800DC5EC *arg0) { gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_packed_dl_3240); gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_packed_dl_14A0); - load_surface_map(mario_raceway_dls, arg0); + load_surface_map((uintptr_t) mario_raceway_dls, arg0); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); @@ -1068,7 +1070,7 @@ void render_mario_raceway(struct UnkStruct_800DC5EC *arg0) { } void render_choco_mountain(struct UnkStruct_800DC5EC *arg0) { - s32 pad[13]; + UNUSED s32 pad[13]; gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1094,7 +1096,7 @@ void render_choco_mountain(struct UnkStruct_800DC5EC *arg0) { gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_packed_dl_5868); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - load_surface_map(choco_mountain_dls, arg0); + load_surface_map((uintptr_t) choco_mountain_dls, arg0); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2); @@ -1128,7 +1130,7 @@ void render_bowsers_castle(struct UnkStruct_800DC5EC *arg0) { if (D_802B87BC > 255) { D_802B87BC = 0; } - load_surface_map(bowsers_castle_dls, arg0); + load_surface_map((uintptr_t) bowsers_castle_dls, arg0); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); @@ -1138,9 +1140,9 @@ void render_bowsers_castle(struct UnkStruct_800DC5EC *arg0) { void render_banshee_boardwalk(struct UnkStruct_800DC5EC *arg0) { Camera *camera = arg0->camera; Mat4 spCC; - s32 pad[6]; + UNUSED s32 pad[6]; Vec3f spA8; - s32 pad2[6]; + UNUSED s32 pad2[6]; gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); @@ -1162,7 +1164,7 @@ void render_banshee_boardwalk(struct UnkStruct_800DC5EC *arg0) { gSPDisplayList(gDisplayListHead++, d_course_banshee_boardwalk_packed_dl_4E60); gSPDisplayList(gDisplayListHead++, d_course_banshee_boardwalk_packed_dl_69B0); - load_surface_map(banshee_boardwalk_dls, arg0); + load_surface_map((uintptr_t) banshee_boardwalk_dls, arg0); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); @@ -1192,7 +1194,7 @@ void render_yoshi_valley(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - load_surface_map(yoshi_valley_dls, arg0); + load_surface_map((uintptr_t) yoshi_valley_dls, arg0); gDPPipeSync(gDisplayListHead++); } @@ -1210,7 +1212,7 @@ void render_frappe_snowland(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - load_surface_map(frappe_snowland_dls, arg0); + load_surface_map((uintptr_t) frappe_snowland_dls, arg0); } void render_koopa_troopa_beach(struct UnkStruct_800DC5EC *arg0) { @@ -1228,7 +1230,7 @@ void render_koopa_troopa_beach(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_packed_dl_9688); - load_surface_map(koopa_troopa_beach_dls, arg0); + load_surface_map((uintptr_t) koopa_troopa_beach_dls, arg0); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); @@ -1253,7 +1255,7 @@ void render_royal_raceway(struct UnkStruct_800DC5EC *arg0) { gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_packed_dl_A648); - load_surface_map(royal_raceway_dls, arg0); + load_surface_map((uintptr_t) royal_raceway_dls, arg0); gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_packed_dl_11A8); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); @@ -1265,7 +1267,7 @@ void render_royal_raceway(struct UnkStruct_800DC5EC *arg0) { void render_luigi_raceway(struct UnkStruct_800DC5EC *arg0) { - s32 pad; + UNUSED s32 pad; u16 sp22 = (u16)arg0->pathCounter; s16 prevFrame; @@ -1282,7 +1284,7 @@ void render_luigi_raceway(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - load_surface_map(luigi_raceway_dls, arg0); + load_surface_map((uintptr_t) luigi_raceway_dls, arg0); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); @@ -1306,22 +1308,22 @@ void render_luigi_raceway(struct UnkStruct_800DC5EC *arg0) { } switch (D_802B87D8) { case 0: - func_802A7658(D_800DC5DC, D_800DC5E0, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800)); + func_802A7658(D_800DC5DC, D_800DC5E0, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800)); break; case 1: - func_802A7658(D_800DC5DC + 64, D_800DC5E0, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x10800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x10800)); break; case 2: - func_802A7658(D_800DC5DC, D_800DC5E0 + 32, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x11800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 32, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x11800)); break; case 3: - func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x12800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x12800)); break; case 4: - func_802A7658(D_800DC5DC, D_800DC5E0 + 64, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x13800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 64, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x13800)); break; case 5: - func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x14800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x14800)); break; } } @@ -1329,11 +1331,11 @@ void render_luigi_raceway(struct UnkStruct_800DC5EC *arg0) { // Missing {} around if statements necessary for matching. void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) { - s32 pad[13]; + UNUSED s32 pad[13]; s16 temp_s0 = arg0->pathCounter; s16 temp_s1 = arg0->playerDirection; - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1343,7 +1345,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) { gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_packed_dl_5640); gSPFogPosition(gDisplayListHead++, D_802B87B0, D_802B87B4); - load_surface_map(moo_moo_farm_dls, arg0); + load_surface_map((uintptr_t) moo_moo_farm_dls, arg0); if ((temp_s0 < 14) && (temp_s0 > 10)) { if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1)) @@ -1393,9 +1395,9 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) { } void render_toads_turnpike(struct UnkStruct_800DC5EC *arg0) { - s32 pad[13]; + UNUSED s32 pad[13]; - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) &D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1406,7 +1408,7 @@ void render_toads_turnpike(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_PASS2); gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2); - load_surface_map(toads_turnpike_dls, arg0); + load_surface_map((uintptr_t) toads_turnpike_dls, arg0); gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_PASS2); @@ -1419,7 +1421,7 @@ void render_toads_turnpike(struct UnkStruct_800DC5EC *arg0) { void render_kalimari_desert(struct UnkStruct_800DC5EC *arg0) { - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1433,7 +1435,7 @@ void render_kalimari_desert(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - load_surface_map(kalimari_desert_dls, arg0); + load_surface_map((uintptr_t) kalimari_desert_dls, arg0); gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_packed_dl_1ED8); gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_packed_dl_1B18); gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_packed_dl_8330); @@ -1452,10 +1454,10 @@ void render_sherbet_land(struct UnkStruct_800DC5EC *arg0) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - load_surface_map(sherbet_land_dls, arg0); + load_surface_map((uintptr_t) sherbet_land_dls, arg0); } -void render_rainbow_road(struct UnkStruct_800DC5EC *arg0) { +void render_rainbow_road(UNUSED struct UnkStruct_800DC5EC *arg0) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); @@ -1481,7 +1483,7 @@ void render_wario_stadium(struct UnkStruct_800DC5EC *arg0) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATERGBA, G_CC_MODULATERGBA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - load_surface_map(wario_stadium_dls, arg0); + load_surface_map((uintptr_t) wario_stadium_dls, arg0); gSPDisplayList(gDisplayListHead++, d_course_wario_stadium_packed_dl_A228); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); @@ -1505,30 +1507,30 @@ void render_wario_stadium(struct UnkStruct_800DC5EC *arg0) { } switch (D_802B87D8) { case 0: - func_802A7658(D_800DC5DC, D_800DC5E0, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x8800)); + func_802A7658(D_800DC5DC, D_800DC5E0, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x8800)); break; case 1: - func_802A7658(D_800DC5DC + 64, D_800DC5E0, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x9800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x9800)); break; case 2: - func_802A7658(D_800DC5DC, D_800DC5E0 + 32, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xA800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 32, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xA800)); break; case 3: - func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xB800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xB800)); break; case 4: - func_802A7658(D_800DC5DC, D_800DC5E0 + 64, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xC800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 64, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xC800)); break; case 5: - func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xD800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xD800)); break; } } } -void render_block_fort(struct UnkStruct_800DC5EC *arg0) { +void render_block_fort(UNUSED struct UnkStruct_800DC5EC *arg0) { - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) &D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1536,8 +1538,8 @@ void render_block_fort(struct UnkStruct_800DC5EC *arg0) { } -void render_skyscraper(struct UnkStruct_800DC5EC *arg0) { - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); +void render_skyscraper(UNUSED struct UnkStruct_800DC5EC *arg0) { + func_802B5D64((uintptr_t) &D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1553,9 +1555,9 @@ void render_skyscraper(struct UnkStruct_800DC5EC *arg0) { } -void render_double_deck(struct UnkStruct_800DC5EC *arg0) { +void render_double_deck(UNUSED struct UnkStruct_800DC5EC *arg0) { - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1566,8 +1568,8 @@ void render_double_deck(struct UnkStruct_800DC5EC *arg0) { void render_dks_jungle_parkway(struct UnkStruct_800DC5EC *arg0) { - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); - func_802B5D64(&D_800DC610[1], D_802B87D4, D_802B87D0, 1); + func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) &D_800DC610[1], D_802B87D4, D_802B87D0, 1); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK | G_LIGHTING); @@ -1582,7 +1584,7 @@ void render_dks_jungle_parkway(struct UnkStruct_800DC5EC *arg0) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); - load_surface_map(dks_jungle_parkway_dls, arg0); + load_surface_map((uintptr_t) dks_jungle_parkway_dls, arg0); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); } @@ -1591,7 +1593,7 @@ void render_big_donut(struct UnkStruct_800DC5EC *arg0) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5D64(&D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); @@ -1673,7 +1675,7 @@ void func_8029569C(void) { void func_80295A38(struct UnkStruct_800DC5EC *arg0) { - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1); if (D_800DC518 != 0) { func_8029569C(); return; @@ -1758,14 +1760,14 @@ void func_80295BF8(s32 playerIndex) { } void func_80295C6C(void) { - gPrevLoadedAddress += ALIGN16(D_8015F588 * sizeof(mk64_surface_map_ram)); + gNextFreeMemoryAddress += ALIGN16(D_8015F588 * sizeof(mk64_surface_map_ram)); D_8015F6E8 += 20; D_8015F6F0 += 20; D_8015F6EA += -20; D_8015F6F2 += -20; D_8015F6EE += -20; func_802AF314(); - gPrevLoadedAddress += ALIGN16(D_8015F58A * 2); + gNextFreeMemoryAddress += ALIGN16(D_8015F58A * 2); } UNUSED void func_80295D50(s16 arg0, s16 arg1) { @@ -1779,8 +1781,6 @@ void func_80295D6C(void) { } void func_80295D88(void) { - f32 phi_f10; - gNumActors = 0; D_8015F6EA = 0; D_8015F6EE = 0; @@ -1793,7 +1793,7 @@ void func_80295D88(void) { func_80295D6C(); D_8015F58C = 0; D_8015F588 = 0; - D_8015F580 = gPrevLoadedAddress; + D_8015F580 = (mk64_surface_map_ram *) gNextFreeMemoryAddress; D_800DC5BC = 0; D_800DC5C8 = 0; switch (gCurrentCourseId) { @@ -1804,7 +1804,7 @@ void func_80295D88(void) { } else { func_802AF588(d_course_mario_raceway_packed_dl_2D68); } - func_80290CAC(&D_06009650); + func_80290CAC((uintptr_t) D_06009650); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; break; @@ -1827,13 +1827,13 @@ void func_80295D88(void) { nullify_displaylist(d_course_choco_mountain_packed_dl_340); nullify_displaylist(d_course_choco_mountain_packed_dl_3C8); } - func_80290CAC(&D_060072D0); + func_80290CAC((uintptr_t) &D_060072D0); func_802B5CAC(0x238E, 0x31C7, D_8015F590); func_80295C6C(); D_8015F8E4 = -80.0f; break; case COURSE_BOWSER_CASTLE: - func_80290CAC(&D_060093D8); + func_80290CAC((uintptr_t) D_060093D8); func_80295C6C(); func_802AF8BC(d_course_bowsers_castle_packed_dl_1350, 0x32, 0, 0, 0); D_8015F8E4 = -50.0f; @@ -1843,24 +1843,24 @@ void func_80295D88(void) { D_801625EC = 0; D_801625F4 = 0; D_801625F0 = 0; - func_80290CAC(D_0600B458); + func_80290CAC((uintptr_t) D_0600B458); func_80295C6C(); func_802AF8BC(d_course_banshee_boardwalk_packed_dl_878, 128, 0, 0, 0); D_8015F8E4 = -80.0f; break; case COURSE_YOSHI_VALLEY: - func_802B5D64(D_06016558, -0x38F0, 0x1C70, 1); - func_80290CAC(D_06018240); + func_802B5D64((uintptr_t) D_06016558, -0x38F0, 0x1C70, 1); + func_80290CAC((uintptr_t) D_06018240); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; break; case COURSE_FRAPPE_SNOWLAND: - func_80290CAC(D_060079A0); + func_80290CAC((uintptr_t) D_060079A0); func_80295C6C(); D_8015F8E4 = -50.0f; break; case COURSE_KOOPA_BEACH: - func_80290CAC(D_06018FD8); + func_80290CAC((uintptr_t) D_06018FD8); func_80295C6C(); func_802AF8BC(d_course_koopa_troopa_beach_packed_dl_ADE0, -0x6A, 255, 255, 255); func_802AF8BC(d_course_koopa_troopa_beach_packed_dl_A540, -0x6A, 255, 255, 255); @@ -1868,17 +1868,17 @@ void func_80295D88(void) { func_802AF8BC(d_course_koopa_troopa_beach_packed_dl_358, -0x6A, 255, 255, 255); break; case COURSE_ROYAL_RACEWAY: - func_80290CAC(D_0600DC28); + func_80290CAC((uintptr_t) D_0600DC28); func_80295C6C(); D_8015F8E4 = -60.0f; break; case COURSE_LUIGI_RACEWAY: - func_80290CAC(D_0600FF28); + func_80290CAC((uintptr_t) D_0600FF28); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; break; case COURSE_MOO_MOO_FARM: - func_80290CAC(D_060144B8); + func_80290CAC((uintptr_t) D_060144B8); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; break; @@ -1888,17 +1888,17 @@ void func_80295D88(void) { D_801625F0 = 4; D_802B87B0 = 993; D_802B87B4 = 1000; - func_80290CAC(D_06023B68); + func_80290CAC((uintptr_t) D_06023B68); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; break; case COURSE_KALAMARI_DESERT: - func_80290CAC(D_06023070); + func_80290CAC((uintptr_t) D_06023070); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; break; case COURSE_SHERBET_LAND: - func_80290CAC(D_06009C20); + func_80290CAC((uintptr_t) D_06009C20); func_80295C6C(); D_8015F8E4 = -18.0f; func_802AF8BC(d_course_sherbet_land_packed_dl_1EB8, -0x4C, 255, 255, 255); @@ -1906,7 +1906,7 @@ void func_80295D88(void) { break; case COURSE_RAINBOW_ROAD: D_800DC5C8 = 1; - func_80290CAC(D_06016440); + func_80290CAC((uintptr_t) D_06016440); func_80295C6C(); D_8015F8E4 = 0.0f; func_802AF8BC(d_course_rainbow_road_packed_dl_2068, -0x6A, 255, 255, 255); @@ -1917,7 +1917,7 @@ void func_80295D88(void) { } break; case COURSE_WARIO_STADIUM: - func_80290CAC(D_0600CC38); + func_80290CAC((uintptr_t) D_0600CC38); func_80295C6C(); D_8015F8E4 = D_8015F6EE - 10.0f; func_802AF8BC(d_course_wario_stadium_packed_dl_C50, 100, 255, 255, 255); @@ -1947,7 +1947,7 @@ void func_80295D88(void) { D_8015F8E4 = D_8015F6EE - 10.0f; break; case COURSE_DK_JUNGLE: - func_80290CAC(D_06014338); + func_80290CAC((uintptr_t) D_06014338); func_80295C6C(); D_8015F8E4 = -475.0f; func_802AF8BC(d_course_dks_jungle_parkway_packed_dl_3FA8, 120, 255, 255, 255); @@ -2001,7 +2001,7 @@ void func_802966A0(void) { if (D_802B87BC >= 0x100) { D_802B87BC = 0; } - func_802AF7B4(D_0600B278, 0, D_802B87BC); + func_802AF7B4((uintptr_t) D_0600B278, 0, D_802B87BC); break; case COURSE_ROYAL_RACEWAY: D_802B87BC -= 20; diff --git a/src/render_courses.h b/src/render_courses.h index ae4c46ba1..88813326a 100644 --- a/src/render_courses.h +++ b/src/render_courses.h @@ -8,9 +8,10 @@ struct Unk0CAC { u16 unk6; }; +void func_8029122C(struct UnkStruct_800DC5EC*, s32); s32 func_80290C20(Camera*); void func_80290CAC(uintptr_t); -void load_surface_map(s32, struct UnkStruct_800DC5EC*); +void load_surface_map(uintptr_t, struct UnkStruct_800DC5EC*); void func_80291198(); void func_802911C4(); void render_mario_raceway(struct UnkStruct_800DC5EC*); @@ -44,11 +45,10 @@ void func_802969F8(); extern Gfx *gDisplayListHead; extern s16 gCurrentCourseId; -extern u32 gPrevLoadedAddress; +extern u32 gNextFreeMemoryAddress; extern s32 gActiveScreenMode; extern u16 sRenderedFramebuffer; -extern uintptr_t *gPhysicalFramebuffers[]; extern uintptr_t gSegmentTable[]; extern Player gPlayers[]; diff --git a/src/skybox_and_splitscreen.c b/src/skybox_and_splitscreen.c index fd3dc97a9..68454b23e 100644 --- a/src/skybox_and_splitscreen.c +++ b/src/skybox_and_splitscreen.c @@ -6,57 +6,64 @@ #include #include #include +#include "memory.h" #include "camera.h" #include "common_textures.h" #include "skybox_and_splitscreen.h" +#include "code_8001F980.h" +#include "code_80057C60.h" +#include "code_80091750.h" +#include "actors.h" +#include "render_courses.h" +#include "math_util.h" + Vp D_802B8880[] = { - {640, 480, 511, 0, - 640, 480, 511, 0}, + {{{640, 480, 511, 0}, {640, 480, 511, 0}}}, }; Vtx D_802B8890[] = { - { SCREEN_WIDTH, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, - { SCREEN_WIDTH, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, + {{{ SCREEN_WIDTH, SCREEN_HEIGHT, -1 }, 0, { 0, 0 }, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1 }, 0, { 0, 0 }, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, 120, -1 }, 0, { 0, 0 }, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, SCREEN_HEIGHT, -1 }, 0, { 0, 0 }, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF }}}, + {{{ SCREEN_WIDTH, 0, -1 }, 0, { 0, 0 }, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 0, -1 }, 0, { 0, 0 }, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF }}}, }; Vtx D_802B8910[] = { - { SCREEN_WIDTH, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, - { SCREEN_WIDTH, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, + {{{ SCREEN_WIDTH, SCREEN_HEIGHT, -1 }, 0, { 0, 0 }, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1 }, 0, { 0, 0 }, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, 120, -1 }, 0, { 0, 0 }, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, SCREEN_HEIGHT, -1 }, 0, { 0, 0 }, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF }}}, + {{{ SCREEN_WIDTH, 0, -1 }, 0, { 0, 0 }, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 0, -1 }, 0, { 0, 0 }, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF }}}, }; -Vtx D_802B8990[] = { - { SCREEN_WIDTH, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, - { SCREEN_WIDTH, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, +Vtx D_802B8990[] = { + {{{ SCREEN_WIDTH, SCREEN_HEIGHT, -1}, 0, { 0, 0 }, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1}, 0, { 0, 0 }, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, 120, -1}, 0, { 0, 0 }, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, SCREEN_HEIGHT, -1}, 0, { 0, 0 }, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1}, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF }}}, + {{{ SCREEN_WIDTH, 0, -1}, 0, { 0, 0 }, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 0, -1}, 0, { 0, 0 }, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 120, -1}, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF }}}, }; Vtx D_802B8A10[] = { - { SCREEN_WIDTH, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x1E, 0x1E, 0xFF, 0xFF}, - { 0, SCREEN_HEIGHT, -1, 0, 0, 0, 0xC8, 0xC8, 0xFF, 0xFF}, - { SCREEN_WIDTH, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, - { SCREEN_WIDTH, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 0, -1, 0, 0, 0, 0x78, 0xFF, 0x78, 0xFF}, - { 0, 120, -1, 0, 0, 0, 0x00, 0xDC, 0x00, 0xFF}, + {{{ SCREEN_WIDTH, SCREEN_HEIGHT, -1}, 0, { 0, 0}, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1}, 0, { 0, 0}, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, 120, -1}, 0, { 0, 0}, { 0x1E, 0x1E, 0xFF, 0xFF }}}, + {{{ 0, SCREEN_HEIGHT, -1}, 0, { 0, 0}, { 0xC8, 0xC8, 0xFF, 0xFF }}}, + {{{ SCREEN_WIDTH, 120, -1}, 0, { 0, 0}, { 0x00, 0xDC, 0x00, 0xFF }}}, + {{{ SCREEN_WIDTH, 0, -1}, 0, { 0, 0}, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 0, -1}, 0, { 0, 0}, { 0x78, 0xFF, 0x78, 0xFF }}}, + {{{ 0, 120, -1}, 0, { 0, 0}, { 0x00, 0xDC, 0x00, 0xFF }}}, }; void func_802A3730(struct UnkStruct_800DC5EC *arg0) { @@ -107,10 +114,6 @@ UNUSED void func_802A38AC(void) { } void func_802A38B4(void) { - s32 temp_v0_3; - void *temp_v0; - void *temp_v0_2; - init_rdp(); select_framebuffer(); @@ -425,7 +428,7 @@ void func_802A450C(Vtx *skybox) { skybox[7].v.cn[2] = D_802B8BCC[gCurrentCourseId].unk4; } -void func_802A487C(Vtx *arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) { +void func_802A487C(Vtx *arg0, UNUSED struct UnkStruct_800DC5EC *arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED f32 *arg4) { init_rdp(); if (gCurrentCourseId != COURSE_RAINBOW_ROAD) { @@ -516,8 +519,6 @@ GLOBAL_ASM("asm/non_matchings/skybox/func_802A4A0C.s") #endif void func_802A4D18(void) { - f32 var_f10; - if (gGamestate != 4) { D_8015014C = 6800.0f; D_80150150 = 3.0f; @@ -616,9 +617,9 @@ void func_802A5004(void) { func_802A39E0(D_800DC5F0); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); + func_802A4A0C((Vtx *) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80057FC4(2); - func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); + func_802A487C((Vtx *) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80093A30(2); } } @@ -633,9 +634,9 @@ void func_802A50EC(void) { func_802A39E0(D_800DC5EC); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); + func_802A4A0C((Vtx *) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80057FC4(1); - func_802A487C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); + func_802A487C((Vtx *) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80093A30(1); } } @@ -650,9 +651,9 @@ void func_802A51D4(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); + func_802A4A0C((Vtx *) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80057FC4(3); - func_802A487C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); + func_802A487C((Vtx *) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80093A30(3); } } @@ -667,9 +668,9 @@ void func_802A52BC(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); + func_802A4A0C((Vtx *) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80057FC4(4); - func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); + func_802A487C((Vtx *) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80093A30(4); } } @@ -686,11 +687,11 @@ void func_802A53A4(void) { init_z_buffer(); select_framebuffer(); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); + func_802A4A0C((Vtx *) D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); if (gGamestate != CREDITS_SEQUENCE) { func_80057FC4(0); } - func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); + func_802A487C((Vtx *) D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); func_80093A30(0); } } @@ -705,9 +706,9 @@ void func_802A54A8(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); + func_802A4A0C((Vtx *) D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); func_80057FC4(8); - func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); + func_802A487C((Vtx *) D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); func_80093A30(8); } } @@ -722,9 +723,9 @@ void func_802A5590(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); + func_802A4A0C((Vtx *) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80057FC4(9); - func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); + func_802A487C((Vtx *) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80093A30(9); } } @@ -739,9 +740,9 @@ void func_802A5678(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[2]); + func_802A4A0C((Vtx *) D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[2]); func_80057FC4(10); - func_802A487C(&D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[2]); + func_802A487C((Vtx *) D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[2]); func_80093A30(10); } } @@ -775,9 +776,9 @@ void func_802A5760(void) { func_802A39E0(D_800DC5F8); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[3]); + func_802A4A0C(D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[3]); func_80057FC4(11); - func_802A487C(&D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[3]); + func_802A487C(D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[3]); func_80093A30(11); } } @@ -785,8 +786,10 @@ void func_802A5760(void) { void func_802A59A4(void) { Camera *camera = &cameras[0]; - u16 spAA[32]; - s32 sp5C[8]; + UNUSED s32 pad[4]; + u16 perspNorm; + UNUSED s32 pad2[3]; + Mat4 matrix; func_802A53A4(); init_rdp(); @@ -794,8 +797,8 @@ void func_802A59A4(void) { gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - guPerspective(&gGfxPool->mtxPool[1], &spAA[23], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, spAA[23]); + guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], @@ -803,16 +806,16 @@ void func_802A59A4(void) { camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp5C); - func_802B4FF8(sp5C, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp5C); - func_802B4FF8(sp5C, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5EC); func_80058090(0); @@ -833,25 +836,25 @@ void func_802A59A4(void) { void func_802A5CB4(void) { Camera *camera = &cameras[0]; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A50EC(); init_rdp(); func_802A3730(D_800DC5EC); - gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } @@ -860,8 +863,8 @@ void func_802A5CB4(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5EC); func_80058090(1); @@ -883,33 +886,32 @@ void func_802A5CB4(void) { void func_802A5FAC(void) { Camera *camera = &cameras[1]; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A5004(); init_rdp(); func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[2], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); - //D_801647A8, D_801647AC, D_801647B0, D_801647B4, D_801647B8, D_801647BC, D_801647C0, D_801647C4, D_801647C8); - if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F0); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5F0); func_80058090(2); @@ -931,32 +933,34 @@ void func_802A5FAC(void) { void func_802A62A4(void) { Camera *camera = &cameras[0]; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A51D4(); gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); init_rdp(); func_802A3730(D_800DC5EC); + gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5EC); func_80058090(3); @@ -978,32 +982,34 @@ void func_802A62A4(void) { void func_802A65B8(void) { Camera *camera = &cameras[1]; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A52BC(); gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); init_rdp(); func_802A3730(D_800DC5F0); + gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[2], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F0); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(&sp58); - func_802B4FF8(&sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5F0); func_80058090(4); @@ -1025,31 +1031,32 @@ void func_802A65B8(void) { void func_802A68CC(void) { Camera *camera = camera1; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A54A8(); init_rdp(); func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(&sp58); - func_802B4FF8(&sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(&sp58); - func_802B4FF8(&sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5EC); func_80058090(8); @@ -1071,31 +1078,32 @@ void func_802A68CC(void) { void func_802A6BB0(void) { Camera *camera = camera2; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A5590(); init_rdp(); func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[2], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F0); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5F0); func_80058090(9); @@ -1117,30 +1125,32 @@ void func_802A6BB0(void) { void func_802A6E94(void) { Camera *camera = camera3; - u16 sp9A[22]; - s32 sp58[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A5678(); init_rdp(); func_802A3730(D_800DC5F4); + gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[3], &sp9A[17], D_80150130[2], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp9A[17]); + guPerspective(&gGfxPool->mtxPool[3], &perspNorm, D_80150130[2], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[9], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F4); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp58); - func_802B4FF8(sp58, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5F4); func_80058090(10); @@ -1162,8 +1172,9 @@ void func_802A6E94(void) { void func_802A7178(void) { Camera *camera = camera4; - u16 sp92[22]; - s32 sp50[8]; + UNUSED s32 pad[2]; + u16 perspNorm; + Mat4 matrix; func_802A5760(); if (gPlayerCountSelection1 == 3) { @@ -1179,22 +1190,22 @@ void func_802A7178(void) { func_802A3730(D_800DC5F8); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[4], &sp92[17], D_80150130[3], D_80150148, D_80150150, D_8015014C, 1.0f); - gDPHalf1(gDisplayListHead++, sp92[17]); + guPerspective(&gGfxPool->mtxPool[4], &perspNorm, D_80150130[3], D_80150148, D_80150150, D_8015014C, 1.0f); + gDPHalf1(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[10], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp50); - func_802B4FF8(sp50, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } else { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F8); if (D_800DC5C8 == 1) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - mtxf_identity(sp50); - func_802B4FF8(sp50, 0); + mtxf_identity(matrix); + func_802B4FF8(matrix, 0); } func_802A3008(D_800DC5F8); func_80058090(11); @@ -1317,12 +1328,12 @@ void func_802A7728(void) { } else if (temp_v0 > 2) { temp_v0 = 0; } - func_802A7658(D_800DC5DC, D_800DC5E0, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0x8800)); - func_802A7658(D_800DC5DC + 64, D_800DC5E0, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0x9800)); - func_802A7658(D_800DC5DC, D_800DC5E0 + 32, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xA800)); - func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xB800)); - func_802A7658(D_800DC5DC, D_800DC5E0 + 64, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xC800)); - func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xD800)); + func_802A7658(D_800DC5DC, D_800DC5E0, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0x8800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0x9800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 32, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xA800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xB800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 64, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xC800)); + func_802A7658(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5]+0xD800)); } void func_802A7940(void) { @@ -1340,10 +1351,10 @@ void func_802A7940(void) { } else if (temp_v0 > 2) { temp_v0 = 0; } - func_802A7658(D_800DC5DC, D_800DC5E0, 0x40, 0x20, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800)); - func_802A7658(D_800DC5DC + 0x40, D_800DC5E0, 0x40, 0x20, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x10800)); - func_802A7658(D_800DC5DC, D_800DC5E0 + 0x20, 0x40, 0x20, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x11800)); - func_802A7658(D_800DC5DC + 0x40, D_800DC5E0 + 0x20, 0x40, 0x20, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x12800)); - func_802A7658(D_800DC5DC, D_800DC5E0 + 0x40, 0x40, 0x20, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x13800)); - func_802A7658(D_800DC5DC + 0x40, D_800DC5E0 + 0x40, 0x40, 0x20, PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x14800)); + func_802A7658(D_800DC5DC, D_800DC5E0, 0x40, 0x20, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800)); + func_802A7658(D_800DC5DC + 0x40, D_800DC5E0, 0x40, 0x20, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x10800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 0x20, 0x40, 0x20, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x11800)); + func_802A7658(D_800DC5DC + 0x40, D_800DC5E0 + 0x20, 0x40, 0x20, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x12800)); + func_802A7658(D_800DC5DC, D_800DC5E0 + 0x40, 0x40, 0x20, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x13800)); + func_802A7658(D_800DC5DC + 0x40, D_800DC5E0 + 0x40, 0x40, 0x20, (u16 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[temp_v0]), (u16 *) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x14800)); } diff --git a/src/skybox_and_splitscreen.h b/src/skybox_and_splitscreen.h index 7506ca6a0..5e25a2829 100644 --- a/src/skybox_and_splitscreen.h +++ b/src/skybox_and_splitscreen.h @@ -5,6 +5,8 @@ /* Function Prototypes */ +void func_802A4A0C(Vtx*, struct UnkStruct_800DC5EC*, s32, s32, f32*); + void func_802A3730(struct UnkStruct_800DC5EC*); void func_802A38AC(); void func_802A38B4(); @@ -24,7 +26,7 @@ void set_viewport(); void select_framebuffer(); void func_802A4300(); void func_802A450C(Vtx*); -void func_802A487C(Vtx*, s32, s32, s32, s32); +void func_802A487C(Vtx*, struct UnkStruct_800DC5EC*, s32, s32, f32*); void func_802A4D18(); void func_802A4EF4(); void func_802A5004(); @@ -65,7 +67,6 @@ extern s32 D_800E86A4; extern s32 gMenuSelectionFromQuit; extern u32 D_801502B4; -extern uintptr_t gPhysicalFramebuffers[3]; extern u16 sRenderingFramebuffer; extern s32 D_800DC5D0; extern s32 D_800DC5D4; diff --git a/src/spawn_players.c b/src/spawn_players.c index 990ac5409..bc1ca8a67 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -12,6 +12,7 @@ #include "code_802AAA70.h" #include "render_courses.h" #include "spawn_players.h" +#include "code_80005FD0.h" // arg4 is height? Or something like that? void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingColumn, f32 arg4, f32 arg5, u16 characterId, s16 playerType) { @@ -441,7 +442,7 @@ void func_80039F44(f32 *arg0, f32 *arg1, f32 arg2) { D_80165560[0] = rand; for (i = 1; i < 7; i++) { - u16* arr = D_800E3890[gCharacterSelections[0]]; + u16* arr = (u16 *) D_800E3890[gCharacterSelections[0]]; if (rand == arr[i]) { D_80165560[i] = arr[0]; } else { @@ -530,7 +531,7 @@ getRand: D_80165560[0] = rand; for (i = 1; i < 6; i++) { - u16* arr = D_800E3C50[gCharacterSelections[0]][gCharacterSelections[1]]; + u16* arr = (u16 *) D_800E3C50[gCharacterSelections[0]][gCharacterSelections[1]]; if (rand == arr[i]) { D_80165560[i] = arr[0]; } else { @@ -699,7 +700,7 @@ void func_8003C0F0(void) { s16 sp5C; s16 sp5A; s32 temp; - s32 pad[4]; + UNUSED s32 pad[4]; switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: case COURSE_CHOCO_MOUNTAIN: @@ -1018,12 +1019,12 @@ void func_8003CD98(Player *player, Camera *camera, s8 arg2, s8 arg3) { func_80027A20(player, arg2, arg3, 0); func_80027A20(player, arg2, arg3, 1); func_80027040(player, arg2, arg3, arg3, 0); - mio0decode(&D_802DFB80[0][arg3][arg2], &D_802BFB80[0][arg3][arg2]); + mio0decode((u8 *) &D_802DFB80[0][arg3][arg2], (u8 *) &D_802BFB80[0][arg3][arg2]); } else { func_80027A20(player, arg2, arg3, 0); func_80027A20(player, arg2, arg3, 1); func_80027040(player, (s8) (arg2 + 4), arg3, (s8) (arg3 - 2), 0); - mio0decode(&D_802DFB80[0][arg3 - 2][arg2 + 4], &D_802BFB80[0][arg3 - 2][arg2 + 4]); + mio0decode((u8 *) &D_802DFB80[0][arg3 - 2][arg2 + 4], (u8 *) &D_802BFB80[0][arg3 - 2][arg2 + 4]); } D_801650D0[arg3][arg2] = player->unk_244[arg3]; @@ -1035,7 +1036,7 @@ void func_8003CD98(Player *player, Camera *camera, s8 arg2, s8 arg3) { } void func_8003D080(void) { - s32 pad; + UNUSED s32 pad; Player* ptr = &gPlayers[0]; func_8005D290(); diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c index 3e46e9611..6bddea22e 100644 --- a/src/staff_ghosts.c +++ b/src/staff_ghosts.c @@ -6,6 +6,8 @@ #include "framebuffers.h" #include "code_800B45E0.h" #include "staff_ghosts.h" +#include "code_80091750.h" +#include "functions.h" extern s32 mio0encode(s32 input, s32, s32); extern s32 func_80040174(void *, s32, s32); @@ -52,13 +54,10 @@ s32 D_80162DFC; s32 D_80162E00; -u32 *D_800DC710 = &D_802BFB80[0][2][3]; -u32 *D_800DC714 = &D_802BFB80[1][1][3]; +u32 *D_800DC710 = (u32 *) &D_802BFB80[0][2][3]; +u32 *D_800DC714 = (u32 *) &D_802BFB80[1][1][3]; -extern OSIoMesg *gDmaIoMesg; extern u8 _kart_texturesSegmentRomStart; -extern OSMesgQueue gDmaMesgQueue; -extern OSMesg gMainReceivedMesg; extern s16 gCurrentCourseId; extern s32 gModeSelection; @@ -84,22 +83,22 @@ extern s32 D_80164394; extern s32 D_80164398; void func_80004EF0(void) { - D_80162DA4 = &D_802BFB80[0][2][3]; + D_80162DA4 = (u32 *) &D_802BFB80[0][2][3]; osInvalDCache(&D_80162DA4[0], 0x4000); - osPiStartDma(&gDmaIoMesg, 0, 0, (D_80162DC4 & 0xFFFFFF) + &_kart_texturesSegmentRomStart, D_80162DA4, 0x4000, &gDmaMesgQueue); - osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) ((D_80162DC4 & 0xFFFFFF) + &_kart_texturesSegmentRomStart), D_80162DA4, 0x4000, &gDmaMesgQueue); + osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); D_80162D9C = (*D_80162DA4 & 0xFF0000); D_80162DA0 = 0; } void func_80004FB0(void) { - D_80162DB4 = &D_802BFB80[0][D_80162DD0][3]; + D_80162DB4 = (u32 *) &D_802BFB80[0][D_80162DD0][3]; D_80162DAC = *D_80162DB4 & 0xFF0000; D_80162DB0 = 0; } void func_80004FF8(void) { - D_80162D94 = &D_802BFB80[0][D_80162DC8][3]; + D_80162D94 = (u32 *) &D_802BFB80[0][D_80162DC8][3]; D_80162D8C = (s32) *D_80162D94 & 0xFF0000; D_80162D90 = 0; } @@ -121,7 +120,7 @@ void set_staff_ghost(void) { D_80162DD6 = 1; D_80162DF4 = 1; } - D_80162DC4 = &d_mario_raceway_staff_ghost; + D_80162DC4 = (u32) &d_mario_raceway_staff_ghost; D_80162DE4 = 0; break; case COURSE_ROYAL_RACEWAY: @@ -133,7 +132,7 @@ void set_staff_ghost(void) { D_80162DD6 = 1; D_80162DF4 = 1; } - D_80162DC4 = &d_royal_raceway_staff_ghost; + D_80162DC4 = (u32) &d_royal_raceway_staff_ghost; D_80162DE4 = 6; break; case COURSE_LUIGI_RACEWAY: @@ -145,7 +144,7 @@ void set_staff_ghost(void) { D_80162DD6 = 1; D_80162DF4 = 1; } - D_80162DC4 = &d_luigi_raceway_staff_ghost; + D_80162DC4 = (u32) &d_luigi_raceway_staff_ghost; D_80162DE4 = 1; break; default: @@ -159,15 +158,15 @@ s32 func_800051C4(void) { if (D_80162D84 != 0) { // func_80040174 in mio0_decode.s - func_80040174(D_80162D80, (D_80162D84 * 4) + 0x20, D_800DC710); - phi_v0 = mio0encode(D_800DC710, (D_80162D84 * 4) + 0x20, D_800DC714); + func_80040174((void *) D_80162D80, (D_80162D84 * 4) + 0x20, (s32) D_800DC710); + phi_v0 = mio0encode((s32) D_800DC710, (D_80162D84 * 4) + 0x20, (s32) D_800DC714); return phi_v0 + 0x1e; } } void func_8000522C(void) { - D_80162D94 = &D_802BFB80[0][D_80162DC8][3]; - mio0decode(D_800DC714, D_80162D94); + D_80162D94 = (u32 *) &D_802BFB80[0][D_80162DC8][3]; + mio0decode((u8 *) D_800DC714, (u8 *) D_80162D94); D_80162D8C = (s32) (*D_80162D94 & 0xFF0000); D_80162D90 = 0; D_80162E00 = 1; @@ -218,11 +217,11 @@ void func_80005310(void) { } else { D_80162DD8 = 1U; - D_80162DBC = &D_802BFB80[0][D_80162DCC][3]; + D_80162DBC = (u32 *) &D_802BFB80[0][D_80162DCC][3]; D_80162DBC[0] = -1; D_80162DB8 = 0; D_80162DDC = 0; - func_80091EE4(&D_80162DC0); + func_80091EE4(); if (D_80162DD4 == 0) { func_80004FF8(); } @@ -414,7 +413,6 @@ void func_8000599C(void) { u32 phi_a3; u32 temp_v1; u32 temp_v2; - s16 new_var; u32 temp_v0; u32 temp_t0; u32 temp_a0_2; diff --git a/src/staff_ghosts.h b/src/staff_ghosts.h index 909650a46..a26c333cf 100644 --- a/src/staff_ghosts.h +++ b/src/staff_ghosts.h @@ -5,6 +5,7 @@ #include "common_structs.h" #include +void func_80005B18(void); void func_80004EF0(); void func_80004FB0(); void func_80004FF8();