diff --git a/.github/workflows/clang-format-suggest.yml b/.github/workflows/clang-format-suggest.yml index 03759fffbb..e4304d0145 100644 --- a/.github/workflows/clang-format-suggest.yml +++ b/.github/workflows/clang-format-suggest.yml @@ -3,6 +3,8 @@ on: [pull_request] jobs: formatting-check: runs-on: ubuntu-24.04 + permissions: + pull-requests: write steps: - uses: actions/checkout@v4 - name: Install Dependance diff --git a/.github/workflows/clang-pr.yml b/.github/workflows/clang-pr.yml index 379bbe470a..1361a78471 100644 --- a/.github/workflows/clang-pr.yml +++ b/.github/workflows/clang-pr.yml @@ -1,5 +1,8 @@ name: clang-format PR -on: [push] +on: + push: + branches: + - master jobs: formatting-check: runs-on: ubuntu-24.04 @@ -15,6 +18,6 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: - commit-message: clang format - title: Applid Clang format on the branch + commit-message: Clang Format + title: Clang Format branch: clang-format diff --git a/Makefile b/Makefile index 8f122c2b5e..e4d98c41a6 100644 --- a/Makefile +++ b/Makefile @@ -32,31 +32,40 @@ $(eval $(call validate-option,COMPILER,ido gcc)) # Run make clean first DEBUG ?= 0 +# Avoid undefined behavior. Enables shiftability when making changes +AVOID_UB ?= 0 + # Compile with GCC GCC ?= 0 # VERSION - selects the version of the game to build -# us - builds the 1997 North American version -# eu - builds the 1997 1.1 PAL version +# us - builds the 1997 North American version +# eu.v10 - builds the 1997 1.0 PAL version +# eu.v11 - builds the 1997 1.1 PAL version VERSION ?= us -$(eval $(call validate-option,VERSION,us eu-1.0 eu-final)) +$(eval $(call validate-option,VERSION,us eu.v10 eu.v11)) ifeq ($(VERSION),us) DEFINES += VERSION_US=1 GRUCODE ?= f3dex_old -else ifeq ($(VERSION),eu-1.0) - DEFINES += VERSION_EU=1 VERSION_EU_1_0=1 +else ifeq ($(VERSION),eu.v10) + DEFINES += VERSION_EU=1 VERSION_EU_V10=1 GRUCODE ?= f3dex_old -else ifeq ($(VERSION),eu-final) - DEFINES += VERSION_EU=1 VERSION_EU_1_1=1 +else ifeq ($(VERSION),eu.v11) + DEFINES += VERSION_EU=1 VERSION_EU_V11=1 GRUCODE ?= f3dex_old endif ifeq ($(DEBUG),1) DEFINES += DEBUG=1 + DEFINES += AVOID_UB=1 COMPARE ?= 0 endif +ifeq ($(AVOID_UB),1) + DEFINES += AVOID_UB=1 +endif + TARGET := mk64.$(VERSION) BASEROM := baserom.$(VERSION).z64 @@ -244,7 +253,7 @@ include $(MAKEFILE_SPLIT) # These are files that need to be encoded into EUC-JP in order for the ROM to match # We filter them out from the regular C_FILES since we don't need nor want the # UTF-8 versions getting compiled -EUC_JP_FILES := src/ending/credits.c src/code_80005FD0.c src/code_80091750.c +EUC_JP_FILES := src/ending/credits.c src/cpu_vehicles_camera_path.c src/menu_items.c C_FILES := $(filter-out %.inc.c,$(filter-out $(EUC_JP_FILES),$(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)))) S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s)) # Include source files in courses/course_name/files.c but exclude .inc.c files. @@ -349,7 +358,7 @@ CC_CHECK ?= gcc CC_CHECK_CFLAGS := -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) -std=gnu90 -Wall -Wempty-body -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(DEF_INC_CFLAGS) # C compiler options -HIDE_WARNINGS := -woff 838,649 +HIDE_WARNINGS := -woff 838,649,807 CFLAGS = -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) $(MIPSISET) $(DEF_INC_CFLAGS) ifeq ($(COMPILER),gcc) CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra diff --git a/README.md b/README.md index ecb73561df..d8908bec4e 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,32 @@ # Mario Kart 64 -This work-in-progress decompilation of Mario Kart 64 pursues historical and educational elements within the game found via taking it apart and putting it back together. Inspiration to do so not only emanates from the game's hardware and technology but also its immensely positive effects on the cultures and families of nearly every nationality. +This decompilation of Mario Kart 64 pursues historical and educational elements within the game found via taking it apart and putting it back together. Inspiration to do so not only emanates from the game's hardware and technology but also its immensely positive effects on the cultures and families of nearly every nationality. This repository does not contain assets. Compiling requires asset extraction from a prior copy of the game. It supports and builds the following versions: -| ROM Output | Revision| SHA-1 Checksum | -|-------------------|---------|------------------------------------------| -| mk64.us.z64 | USA | 579c48e211ae952530ffc8738709f078d5dd215e | -| mk64.eu-1.0.z64 | EUR 1.0 | a729039453210b84f17019dda3f248d5888f7690 | -| mk64.eu-final.z64 | EUR 1.1 | f6b5f519dd57ea59e9f013cc64816e9d273b2329 | - -[![Linux Compile](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml/badge.svg)](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml) +| ROM Output | Revision| SHA-1 Checksum | +|-----------------|---------|------------------------------------------| +| mk64.us.z64 | USA | 579c48e211ae952530ffc8738709f078d5dd215e | +| mk64.eu.v10.z64 | EUR 1.0 | a729039453210b84f17019dda3f248d5888f7690 | +| mk64.eu.v11.z64 | EUR 1.1 | f6b5f519dd57ea59e9f013cc64816e9d273b2329 | ## Progress -Total progress consists of all code segments together. - -Game code progress consists of `main`, `ending` and `racing`. +[![Linux Compile](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml/badge.svg)](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml) ![Build Status](https://n64decomp.github.io/mk64/total_progress.svg) -![Build Status](https://n64decomp.github.io/mk64/game_progress.svg) - -![Build Status](https://n64decomp.github.io/mk64/asm_funcs.svg) -![Build Status](https://n64decomp.github.io/mk64/m2c_funcs.svg) -![Build Status](https://n64decomp.github.io/mk64/nonmatching_funcs.svg) - -- ![Build Status](https://n64decomp.github.io/mk64/seg_main_progress.svg) -- ![Build Status](https://n64decomp.github.io/mk64/seg_ending_progress.svg) -- ![Build Status](https://n64decomp.github.io/mk64/seg_racing_progress.svg) -- ![Build Status](https://n64decomp.github.io/mk64/audio_progress.svg) -- ![Build Status](https://n64decomp.github.io/mk64/libultra_progress.svg) ## Quick Start ``` git submodule update --init --recursive +OR +git clone https://github.com/n64decomp/mk64 --recurse-submodules ``` Extract assets ``` +make -C tools -j make assets -j make -j ``` @@ -50,7 +38,8 @@ See also, the comprehensive API and documentation which includes an overview of ## Current State -The code-base may change significanty overtime as naming and documentation continues. The code-base is shiftable. +The code-base may change significanty overtime as naming and documentation continues. +Adjustments to the game require compiling with AVOID_UB=1 to enable shiftability. Use DEBUG=1 to enable the games debug mode. Some menu textures are compressed using a format called tkmk00. A byte-matching compressor/decompressor does not yet exist. diff --git a/asm/eu_nonmatchings/audio_init.s b/asm/eu_nonmatchings/audio_init.s deleted file mode 100644 index ef8418275e..0000000000 --- a/asm/eu_nonmatchings/audio_init.s +++ /dev/null @@ -1,309 +0,0 @@ -.section .late_rodata -glabel D_800F2FE0 -.float 20.0304203 - -.section .text -glabel audio_init -/* BCCDC 800BC0DC 27BDFF70 */ addiu $sp, $sp, -0x90 -/* BCCE0 800BC0E0 3C0E800F */ lui $t6, %hi(gAudioLoadLock) -/* BCCE4 800BC0E4 AFBF002C */ sw $ra, 0x2C($sp) -/* BCCE8 800BC0E8 AFB50028 */ sw $s5, 0x28($sp) -/* BCCEC 800BC0EC AFB40024 */ sw $s4, 0x24($sp) -/* BCCF0 800BC0F0 AFB30020 */ sw $s3, 0x20($sp) -/* BCCF4 800BC0F4 AFB2001C */ sw $s2, 0x1C($sp) -/* BCCF8 800BC0F8 AFB10018 */ sw $s1, 0x18($sp) -/* BCCFC 800BC0FC AFB00014 */ sw $s0, 0x14($sp) -/* BCD00 800BC100 25CEA71C */ addiu $t6, $t6, %lo(gAudioLoadLock) -/* BCD04 800BC104 ADC00000 */ sw $zero, 0x0($t6) -/* BCD08 800BC108 3C04800F */ lui $a0, %hi(gAudioHeapSize) -/* BCD0C 800BC10C 8C84A710 */ lw $a0, %lo(gAudioHeapSize)($a0) -/* BCD10 800BC110 00001825 */ or $v1, $zero, $zero -/* BCD14 800BC114 3C0A803B */ lui $t2, %hi(gAudioGlobalsEndMarker) -/* BCD18 800BC118 04810003 */ bgez $a0, .L800BC128 -/* BCD1C 800BC11C 000478C3 */ sra $t7, $a0, 3 -/* BCD20 800BC120 24810007 */ addiu $at, $a0, 0x7 -/* BCD24 800BC124 000178C3 */ sra $t7, $at, 3 -.L800BC128: -/* BCD28 800BC128 19E0000C */ blez $t7, .L800BC15C -/* BCD2C 800BC12C 3C04803B */ lui $a0, %hi(gGfxSPTaskOutputBufferSize) -/* BCD30 800BC130 3C18803B */ lui $t8, %hi(gAudioHeap) -/* BCD34 800BC134 270271B0 */ addiu $v0, $t8, %lo(gAudioHeap) -/* BCD38 800BC138 000FC8C0 */ sll $t9, $t7, 3 -/* BCD3C 800BC13C 03221821 */ addu $v1, $t9, $v0 -.L800BC140: -/* BCD40 800BC140 24420008 */ addiu $v0, $v0, 0x8 -/* BCD44 800BC144 0043082B */ sltu $at, $v0, $v1 -/* BCD48 800BC148 24080000 */ addiu $t0, $zero, 0x0 -/* BCD4C 800BC14C 24090000 */ addiu $t1, $zero, 0x0 -/* BCD50 800BC150 AC49FFFC */ sw $t1, -0x4($v0) -/* BCD54 800BC154 1420FFFA */ bnez $at, .L800BC140 -/* BCD58 800BC158 AC48FFF8 */ sw $t0, -0x8($v0) -.L800BC15C: -/* BCD5C 800BC15C 2482F780 */ addiu $v0, $a0, %lo(gGfxSPTaskOutputBufferSize) -/* BCD60 800BC160 254A71A0 */ addiu $t2, $t2, %lo(gAudioGlobalsEndMarker) -/* BCD64 800BC164 01421823 */ subu $v1, $t2, $v0 -/* BCD68 800BC168 000380C2 */ srl $s0, $v1, 3 -/* BCD6C 800BC16C 06000008 */ bltz $s0, .L800BC190 -/* BCD70 800BC170 3C01800F */ lui $at, %hi(D_800F2FE0) -.L800BC174: -/* BCD74 800BC174 2610FFFF */ addiu $s0, $s0, -0x1 -/* BCD78 800BC178 240C0000 */ addiu $t4, $zero, 0x0 -/* BCD7C 800BC17C 240D0000 */ addiu $t5, $zero, 0x0 -/* BCD80 800BC180 AC4D0004 */ sw $t5, 0x4($v0) -/* BCD84 800BC184 AC4C0000 */ sw $t4, 0x0($v0) -/* BCD88 800BC188 0601FFFA */ bgez $s0, .L800BC174 -/* BCD8C 800BC18C 24420008 */ addiu $v0, $v0, 0x8 -.L800BC190: -/* BCD90 800BC190 C4242FE0 */ lwc1 $ft0, %lo(D_800F2FE0)($at) -/* BCD94 800BC194 3C01803B */ lui $at, %hi(D_803B7178) -/* BCD98 800BC198 240E0032 */ addiu $t6, $zero, 0x32 -/* BCD9C 800BC19C E4247178 */ swc1 $ft0, %lo(D_803B7178)($at) -/* BCDA0 800BC1A0 3C01803B */ lui $at, %hi(gRefreshRate) -/* BCDA4 800BC1A4 0C032FF6 */ jal port_eu_init -/* BCDA8 800BC1A8 AC2E717C */ sw $t6, %lo(gRefreshRate)($at) -/* BCDAC 800BC1AC 3C02803B */ lui $v0, %hi(gAiBufferLengths) -/* BCDB0 800BC1B0 3C04803B */ lui $a0, %hi(D_803B7192) -/* BCDB4 800BC1B4 24847192 */ addiu $a0, $a0, %lo(D_803B7192) -/* BCDB8 800BC1B8 2442718C */ addiu $v0, $v0, %lo(gAiBufferLengths) -/* BCDBC 800BC1BC 240300A0 */ addiu $v1, $zero, 0xA0 -.L800BC1C0: -/* BCDC0 800BC1C0 24420002 */ addiu $v0, $v0, 0x2 -/* BCDC4 800BC1C4 0044082B */ sltu $at, $v0, $a0 -/* BCDC8 800BC1C8 1420FFFD */ bnez $at, .L800BC1C0 -/* BCDCC 800BC1CC A443FFFE */ sh $v1, -0x2($v0) -/* BCDD0 800BC1D0 3C0F803B */ lui $t7, %hi(gAudioFrameCount) -/* BCDD4 800BC1D4 25EF70B8 */ addiu $t7, $t7, %lo(gAudioFrameCount) -/* BCDD8 800BC1D8 ADE00000 */ sw $zero, 0x0($t7) -/* BCDDC 800BC1DC 3C01803B */ lui $at, %hi(gAudioTaskIndex) -/* BCDE0 800BC1E0 AC2070C0 */ sw $zero, %lo(gAudioTaskIndex)($at) -/* BCDE4 800BC1E4 3C01803B */ lui $at, %hi(gCurrAiBufferIndex) -/* BCDE8 800BC1E8 AC2070C4 */ sw $zero, %lo(gCurrAiBufferIndex)($at) -/* BCDEC 800BC1EC 3C01803B */ lui $at, %hi(gAudioLibSoundMode) -/* BCDF0 800BC1F0 A02070B6 */ sb $zero, %lo(gAudioLibSoundMode)($at) -/* BCDF4 800BC1F4 3C02803B */ lui $v0, %hi(gAudioTasks) -/* BCDF8 800BC1F8 3C01803B */ lui $at, %hi(gAudioTask) -/* BCDFC 800BC1FC 244270D8 */ addiu $v0, $v0, %lo(gAudioTasks) -/* BCE00 800BC200 AC2070D4 */ sw $zero, %lo(gAudioTask)($at) -/* BCE04 800BC204 3C04803B */ lui $a0, %hi(D_803B6720) -/* BCE08 800BC208 3C05803B */ lui $a1, %hi(D_803B6738) -/* BCE0C 800BC20C AC400034 */ sw $zero, 0x34($v0) -/* BCE10 800BC210 AC400084 */ sw $zero, 0x84($v0) -/* BCE14 800BC214 24A56738 */ addiu $a1, $a1, %lo(D_803B6738) -/* BCE18 800BC218 24846720 */ addiu $a0, $a0, %lo(D_803B6720) -/* BCE1C 800BC21C 0C03337C */ jal osCreateMesgQueue -/* BCE20 800BC220 24060001 */ addiu $a2, $zero, 0x1 -/* BCE24 800BC224 3C04803B */ lui $a0, %hi(gCurrAudioFrameDmaQueue) -/* BCE28 800BC228 3C05803B */ lui $a1, %hi(gCurrAudioFrameDmaMesgBufs) -/* BCE2C 800BC22C 24A56020 */ addiu $a1, $a1, %lo(gCurrAudioFrameDmaMesgBufs) -/* BCE30 800BC230 24846008 */ addiu $a0, $a0, %lo(gCurrAudioFrameDmaQueue) -/* BCE34 800BC234 0C03337C */ jal osCreateMesgQueue -/* BCE38 800BC238 24060040 */ addiu $a2, $zero, 0x40 -/* BCE3C 800BC23C 3C01803B */ lui $at, %hi(gCurrAudioFrameDmaCount) -/* BCE40 800BC240 AC2070BC */ sw $zero, %lo(gCurrAudioFrameDmaCount)($at) -/* BCE44 800BC244 3C01803B */ lui $at, %hi(gSampleDmaNumListItems) -/* BCE48 800BC248 3C04800F */ lui $a0, %hi(gAudioInitPoolSize) -/* BCE4C 800BC24C AC206E58 */ sw $zero, %lo(gSampleDmaNumListItems)($at) -/* BCE50 800BC250 0C02E43C */ jal sound_init_main_pools -/* BCE54 800BC254 8C84A714 */ lw $a0, %lo(gAudioInitPoolSize)($a0) -/* BCE58 800BC258 3C06803B */ lui $a2, %hi(gAiBuffers) -/* BCE5C 800BC25C 3C14803B */ lui $s4, %hi(gAudioInitPool) -/* BCE60 800BC260 3C11803B */ lui $s1, %hi(gAiBufferLengths) -/* BCE64 800BC264 2631718C */ addiu $s1, $s1, %lo(gAiBufferLengths) -/* BCE68 800BC268 2694FBD8 */ addiu $s4, $s4, %lo(gAudioInitPool) -/* BCE6C 800BC26C 24C67180 */ addiu $a2, $a2, %lo(gAiBuffers) -/* BCE70 800BC270 24100AA0 */ addiu $s0, $zero, 0xAA0 -/* BCE74 800BC274 02802025 */ or $a0, $s4, $zero -.L800BC278: -/* BCE78 800BC278 24050AA0 */ addiu $a1, $zero, 0xAA0 -/* BCE7C 800BC27C 0C02E3FF */ jal soundAlloc -/* BCE80 800BC280 AFA6003C */ sw $a2, 0x3C($sp) -/* BCE84 800BC284 8FA6003C */ lw $a2, 0x3C($sp) -/* BCE88 800BC288 00001825 */ or $v1, $zero, $zero -/* BCE8C 800BC28C ACC20000 */ sw $v0, 0x0($a2) -.L800BC290: -/* BCE90 800BC290 8CD90000 */ lw $t9, 0x0($a2) -/* BCE94 800BC294 0323C021 */ addu $t8, $t9, $v1 -/* BCE98 800BC298 A7000000 */ sh $zero, 0x0($t8) -/* BCE9C 800BC29C 8CC80000 */ lw $t0, 0x0($a2) -/* BCEA0 800BC2A0 01034821 */ addu $t1, $t0, $v1 -/* BCEA4 800BC2A4 A5200002 */ sh $zero, 0x2($t1) -/* BCEA8 800BC2A8 8CCA0000 */ lw $t2, 0x0($a2) -/* BCEAC 800BC2AC 01435821 */ addu $t3, $t2, $v1 -/* BCEB0 800BC2B0 A5600004 */ sh $zero, 0x4($t3) -/* BCEB4 800BC2B4 8CCC0000 */ lw $t4, 0x0($a2) -/* BCEB8 800BC2B8 01836821 */ addu $t5, $t4, $v1 -/* BCEBC 800BC2BC 24630008 */ addiu $v1, $v1, 0x8 -/* BCEC0 800BC2C0 1470FFF3 */ bne $v1, $s0, .L800BC290 -/* BCEC4 800BC2C4 A5A00006 */ sh $zero, 0x6($t5) -/* BCEC8 800BC2C8 24C60004 */ addiu $a2, $a2, 0x4 -/* BCECC 800BC2CC 00D1082B */ sltu $at, $a2, $s1 -/* BCED0 800BC2D0 5420FFE9 */ bnel $at, $zero, .L800BC278 -/* BCED4 800BC2D4 02802025 */ or $a0, $s4, $zero -/* BCED8 800BC2D8 3C01803B */ lui $at, %hi(gAudioResetPresetIdToLoad) -/* BCEDC 800BC2DC 3C0F803B */ lui $t7, %hi(gAudioResetStatus) -/* BCEE0 800BC2E0 A0200501 */ sb $zero, %lo(gAudioResetPresetIdToLoad)($at) -/* BCEE4 800BC2E4 25EF0500 */ addiu $t7, $t7, %lo(gAudioResetStatus) -/* BCEE8 800BC2E8 240E0001 */ addiu $t6, $zero, 0x1 -/* BCEEC 800BC2EC 0C02E803 */ jal audio_shut_down_and_reset_step -/* BCEF0 800BC2F0 A1EE0000 */ sb $t6, 0x0($t7) -/* BCEF4 800BC2F4 3C11803B */ lui $s1, %hi(gSeqFileHeader) -/* BCEF8 800BC2F8 3C1200BC */ lui $s2, %hi(_sequencesSegmentRomStart) -/* BCEFC 800BC2FC 26526160 */ addiu $s2, $s2, %lo(_sequencesSegmentRomStart) -/* BCF00 800BC300 2631706C */ addiu $s1, $s1, %lo(gSeqFileHeader) -/* BCF04 800BC304 27B50060 */ addiu $s5, $sp, 0x60 -/* BCF08 800BC308 AE350000 */ sw $s5, 0x0($s1) -/* BCF0C 800BC30C 02A02825 */ or $a1, $s5, $zero -/* BCF10 800BC310 02402025 */ or $a0, $s2, $zero -/* BCF14 800BC314 0C02EAA0 */ jal audio_dma_copy_immediate -/* BCF18 800BC318 24060010 */ addiu $a2, $zero, 0x10 -/* BCF1C 800BC31C 8E390000 */ lw $t9, 0x0($s1) -/* BCF20 800BC320 3C02803B */ lui $v0, %hi(gSequenceCount) -/* BCF24 800BC324 2401FFF0 */ addiu $at, $zero, -0x10 -/* BCF28 800BC328 87380002 */ lh $t8, 0x2($t9) -/* BCF2C 800BC32C 2442707C */ addiu $v0, $v0, %lo(gSequenceCount) -/* BCF30 800BC330 02802025 */ or $a0, $s4, $zero -/* BCF34 800BC334 3310FFFF */ andi $s0, $t8, 0xFFFF -/* BCF38 800BC338 001040C0 */ sll $t0, $s0, 3 -/* BCF3C 800BC33C 01008025 */ or $s0, $t0, $zero -/* BCF40 800BC340 26100013 */ addiu $s0, $s0, 0x13 -/* BCF44 800BC344 02012824 */ and $a1, $s0, $at -/* BCF48 800BC348 00A08025 */ or $s0, $a1, $zero -/* BCF4C 800BC34C 0C02E3FF */ jal soundAlloc -/* BCF50 800BC350 A4580000 */ sh $t8, 0x0($v0) -/* BCF54 800BC354 AE220000 */ sw $v0, 0x0($s1) -/* BCF58 800BC358 02402025 */ or $a0, $s2, $zero -/* BCF5C 800BC35C 00402825 */ or $a1, $v0, $zero -/* BCF60 800BC360 0C02EAA0 */ jal audio_dma_copy_immediate -/* BCF64 800BC364 02003025 */ or $a2, $s0, $zero -/* BCF68 800BC368 8E240000 */ lw $a0, 0x0($s1) -/* BCF6C 800BC36C 0C02ED0F */ jal func_800BB43C -/* BCF70 800BC370 02402825 */ or $a1, $s2, $zero -/* BCF74 800BC374 3C110096 */ lui $s1, %hi(_audio_banksSegmentRomStart) -/* BCF78 800BC378 3C12803B */ lui $s2, %hi(gAlCtlHeader) -/* BCF7C 800BC37C 26527070 */ addiu $s2, $s2, %lo(gAlCtlHeader) -/* BCF80 800BC380 26316460 */ addiu $s1, $s1, %lo(_audio_banksSegmentRomStart) -/* BCF84 800BC384 AE550000 */ sw $s5, 0x0($s2) -/* BCF88 800BC388 02202025 */ or $a0, $s1, $zero -/* BCF8C 800BC38C 02A02825 */ or $a1, $s5, $zero -/* BCF90 800BC390 0C02EAA0 */ jal audio_dma_copy_immediate -/* BCF94 800BC394 24060010 */ addiu $a2, $zero, 0x10 -/* BCF98 800BC398 8E4A0000 */ lw $t2, 0x0($s2) -/* BCF9C 800BC39C 2401FFF0 */ addiu $at, $zero, -0x10 -/* BCFA0 800BC3A0 02802025 */ or $a0, $s4, $zero -/* BCFA4 800BC3A4 85530002 */ lh $s3, 0x2($t2) -/* BCFA8 800BC3A8 001380C0 */ sll $s0, $s3, 3 -/* BCFAC 800BC3AC 26100013 */ addiu $s0, $s0, 0x13 -/* BCFB0 800BC3B0 02012824 */ and $a1, $s0, $at -/* BCFB4 800BC3B4 0C02E3FF */ jal soundAlloc -/* BCFB8 800BC3B8 00A08025 */ or $s0, $a1, $zero -/* BCFBC 800BC3BC AE420000 */ sw $v0, 0x0($s2) -/* BCFC0 800BC3C0 02202025 */ or $a0, $s1, $zero -/* BCFC4 800BC3C4 00402825 */ or $a1, $v0, $zero -/* BCFC8 800BC3C8 0C02EAA0 */ jal audio_dma_copy_immediate -/* BCFCC 800BC3CC 02003025 */ or $a2, $s0, $zero -/* BCFD0 800BC3D0 8E440000 */ lw $a0, 0x0($s2) -/* BCFD4 800BC3D4 0C02ED0F */ jal func_800BB43C -/* BCFD8 800BC3D8 02202825 */ or $a1, $s1, $zero -/* BCFDC 800BC3DC 00132880 */ sll $a1, $s3, 2 -/* BCFE0 800BC3E0 00B32823 */ subu $a1, $a1, $s3 -/* BCFE4 800BC3E4 00052880 */ sll $a1, $a1, 2 -/* BCFE8 800BC3E8 0C02E3FF */ jal soundAlloc -/* BCFEC 800BC3EC 02802025 */ or $a0, $s4, $zero -/* BCFF0 800BC3F0 3C07803B */ lui $a3, %hi(gCtlEntries) -/* BCFF4 800BC3F4 24E77080 */ addiu $a3, $a3, %lo(gCtlEntries) -/* BCFF8 800BC3F8 ACE20000 */ sw $v0, 0x0($a3) -/* BCFFC 800BC3FC 1A600019 */ blez $s3, .L800BC464 -/* BD000 800BC400 00001825 */ or $v1, $zero, $zero -/* BD004 800BC404 00008825 */ or $s1, $zero, $zero -/* BD008 800BC408 00008025 */ or $s0, $zero, $zero -.L800BC40C: -/* BD00C 800BC40C 8E4C0000 */ lw $t4, 0x0($s2) -/* BD010 800BC410 02A02825 */ or $a1, $s5, $zero -/* BD014 800BC414 24060010 */ addiu $a2, $zero, 0x10 -/* BD018 800BC418 01916821 */ addu $t5, $t4, $s1 -/* BD01C 800BC41C 8DA40004 */ lw $a0, 0x4($t5) -/* BD020 800BC420 0C02EAA0 */ jal audio_dma_copy_immediate -/* BD024 800BC424 AFA3008C */ sw $v1, 0x8C($sp) -/* BD028 800BC428 3C07803B */ lui $a3, %hi(gCtlEntries) -/* BD02C 800BC42C 24E77080 */ addiu $a3, $a3, %lo(gCtlEntries) -/* BD030 800BC430 8CEF0000 */ lw $t7, 0x0($a3) -/* BD034 800BC434 8FAE0060 */ lw $t6, 0x60($sp) -/* BD038 800BC438 8FA3008C */ lw $v1, 0x8C($sp) -/* BD03C 800BC43C 01F0C821 */ addu $t9, $t7, $s0 -/* BD040 800BC440 A32E0001 */ sb $t6, 0x1($t9) -/* BD044 800BC444 8CE80000 */ lw $t0, 0x0($a3) -/* BD048 800BC448 8FB80064 */ lw $t8, 0x64($sp) -/* BD04C 800BC44C 24630001 */ addiu $v1, $v1, 0x1 -/* BD050 800BC450 01104821 */ addu $t1, $t0, $s0 -/* BD054 800BC454 2610000C */ addiu $s0, $s0, 0xC -/* BD058 800BC458 26310008 */ addiu $s1, $s1, 0x8 -/* BD05C 800BC45C 1473FFEB */ bne $v1, $s3, .L800BC40C -/* BD060 800BC460 A1380002 */ sb $t8, 0x2($t1) -.L800BC464: -/* BD064 800BC464 3C11803B */ lui $s1, %hi(gAlTbl) -/* BD068 800BC468 3C120098 */ lui $s2, %hi(_audio_tablesSegmentRomStart) -/* BD06C 800BC46C 26529CA0 */ addiu $s2, $s2, %lo(_audio_tablesSegmentRomStart) -/* BD070 800BC470 26317074 */ addiu $s1, $s1, %lo(gAlTbl) -/* BD074 800BC474 AE350000 */ sw $s5, 0x0($s1) -/* BD078 800BC478 02402025 */ or $a0, $s2, $zero -/* BD07C 800BC47C 02A02825 */ or $a1, $s5, $zero -/* BD080 800BC480 0C02EAA0 */ jal audio_dma_copy_immediate -/* BD084 800BC484 24060010 */ addiu $a2, $zero, 0x10 -/* BD088 800BC488 8E2A0000 */ lw $t2, 0x0($s1) -/* BD08C 800BC48C 2401FFF0 */ addiu $at, $zero, -0x10 -/* BD090 800BC490 02802025 */ or $a0, $s4, $zero -/* BD094 800BC494 85500002 */ lh $s0, 0x2($t2) -/* BD098 800BC498 001058C0 */ sll $t3, $s0, 3 -/* BD09C 800BC49C 01608025 */ or $s0, $t3, $zero -/* BD0A0 800BC4A0 26100013 */ addiu $s0, $s0, 0x13 -/* BD0A4 800BC4A4 02012824 */ and $a1, $s0, $at -/* BD0A8 800BC4A8 0C02E3FF */ jal soundAlloc -/* BD0AC 800BC4AC 00A08025 */ or $s0, $a1, $zero -/* BD0B0 800BC4B0 AE220000 */ sw $v0, 0x0($s1) -/* BD0B4 800BC4B4 02402025 */ or $a0, $s2, $zero -/* BD0B8 800BC4B8 00402825 */ or $a1, $v0, $zero -/* BD0BC 800BC4BC 0C02EAA0 */ jal audio_dma_copy_immediate -/* BD0C0 800BC4C0 02003025 */ or $a2, $s0, $zero -/* BD0C4 800BC4C4 8E240000 */ lw $a0, 0x0($s1) -/* BD0C8 800BC4C8 0C02ED0F */ jal func_800BB43C -/* BD0CC 800BC4CC 02402825 */ or $a1, $s2, $zero -/* BD0D0 800BC4D0 02802025 */ or $a0, $s4, $zero -/* BD0D4 800BC4D4 0C02E3FF */ jal soundAlloc -/* BD0D8 800BC4D8 24050100 */ addiu $a1, $zero, 0x100 -/* BD0DC 800BC4DC 3C03803B */ lui $v1, %hi(gAlBankSets) -/* BD0E0 800BC4E0 24637078 */ addiu $v1, $v1, %lo(gAlBankSets) -/* BD0E4 800BC4E4 3C0400BF */ lui $a0, %hi(_instrument_setsSegmentRomStart+0x20) -/* BD0E8 800BC4E8 AC620000 */ sw $v0, 0x0($v1) -/* BD0EC 800BC4EC 248493E0 */ addiu $a0, $a0, %lo(_instrument_setsSegmentRomStart+0x20) -/* BD0F0 800BC4F0 00402825 */ or $a1, $v0, $zero -/* BD0F4 800BC4F4 0C02EAA0 */ jal audio_dma_copy_immediate -/* BD0F8 800BC4F8 24060100 */ addiu $a2, $zero, 0x100 -/* BD0FC 800BC4FC 3C10800F */ lui $s0, %hi(D_800EA5D8) -/* BD100 800BC500 2610A718 */ addiu $s0, $s0, %lo(D_800EA5D8) -/* BD104 800BC504 8E050000 */ lw $a1, 0x0($s0) -/* BD108 800BC508 0C02E3FF */ jal soundAlloc -/* BD10C 800BC50C 02802025 */ or $a0, $s4, $zero -/* BD110 800BC510 3C04803B */ lui $a0, %hi(gUnkPool1) -/* BD114 800BC514 248401B8 */ addiu $a0, $a0, %lo(gUnkPool1) -/* BD118 800BC518 00402825 */ or $a1, $v0, $zero -/* BD11C 800BC51C 0C02E41F */ jal sound_alloc_pool_init -/* BD120 800BC520 8E060000 */ lw $a2, 0x0($s0) -/* BD124 800BC524 0C030499 */ jal init_sequence_players -/* BD128 800BC528 00000000 */ nop -/* BD12C 800BC52C 3C0D7655 */ lui $t5, (0x76557364 >> 16) -/* BD130 800BC530 3C0F800F */ lui $t7, %hi(gAudioLoadLock) -/* BD134 800BC534 25EFA71C */ addiu $t7, $t7, %lo(gAudioLoadLock) -/* BD138 800BC538 35AD7364 */ ori $t5, $t5, (0x76557364 & 0xFFFF) -/* BD13C 800BC53C ADED0000 */ sw $t5, 0x0($t7) -/* BD140 800BC540 8FBF002C */ lw $ra, 0x2C($sp) -/* BD144 800BC544 8FB50028 */ lw $s5, 0x28($sp) -/* BD148 800BC548 8FB40024 */ lw $s4, 0x24($sp) -/* BD14C 800BC54C 8FB30020 */ lw $s3, 0x20($sp) -/* BD150 800BC550 8FB2001C */ lw $s2, 0x1C($sp) -/* BD154 800BC554 8FB10018 */ lw $s1, 0x18($sp) -/* BD158 800BC558 8FB00014 */ lw $s0, 0x14($sp) -/* BD15C 800BC55C 03E00008 */ jr $ra -/* BD160 800BC560 27BD0090 */ addiu $sp, $sp, 0x90 -/* BD164 800BC564 00000000 */ nop -/* BD168 800BC568 00000000 */ nop -/* BD16C 800BC56C 00000000 */ nop diff --git a/asm/eu_nonmatchings/func_800C3724.s b/asm/eu_nonmatchings/func_800C3724.s deleted file mode 100644 index ec642d59e7..0000000000 --- a/asm/eu_nonmatchings/func_800C3724.s +++ /dev/null @@ -1,601 +0,0 @@ -.section .late_rodata - -glabel jpt_800F376C -.word L800C3DEC, L800C3E10, L800C3E30, L800C3E70 -.word L800C3E98, L800C3EBC, L800C3F04 - -.section .text - -glabel func_800C3724 -/* 0C43A4 800C37A4 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 0C43A8 800C37A8 AFB60048 */ sw $s6, 0x48($sp) -/* 0C43AC 800C37AC F7B40028 */ sdc1 $f20, 0x28($sp) -/* 0C43B0 800C37B0 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0C43B4 800C37B4 AFBE0050 */ sw $fp, 0x50($sp) -/* 0C43B8 800C37B8 AFB7004C */ sw $s7, 0x4c($sp) -/* 0C43BC 800C37BC AFB50044 */ sw $s5, 0x44($sp) -/* 0C43C0 800C37C0 3C168019 */ lui $s6, %hi(D_801930D0) # $s6, 0x8019 -/* 0C43C4 800C37C4 4481A000 */ mtc1 $at, $f20 -/* 0C43C8 800C37C8 03A0F025 */ move $fp, $sp -/* 0C43CC 800C37CC AFBF0054 */ sw $ra, 0x54($sp) -/* 0C43D0 800C37D0 AFB40040 */ sw $s4, 0x40($sp) -/* 0C43D4 800C37D4 AFB3003C */ sw $s3, 0x3c($sp) -/* 0C43D8 800C37D8 AFB20038 */ sw $s2, 0x38($sp) -/* 0C43DC 800C37DC AFB10034 */ sw $s1, 0x34($sp) -/* 0C43E0 800C37E0 AFB00030 */ sw $s0, 0x30($sp) -/* 0C43E4 800C37E4 26D63210 */ addiu $s6, %lo(D_801930D0) # addiu $s6, $s6, 0x3210 -/* 0C43E8 800C37E8 0000A825 */ move $s5, $zero -/* 0C43EC 800C37EC 2417024C */ li $s7, 588 -.L800C37F0: -/* 0C43F0 800C37F0 02B70019 */ multu $s5, $s7 -/* 0C43F4 800C37F4 00007012 */ mflo $t6 -/* 0C43F8 800C37F8 02CE9821 */ addu $s3, $s6, $t6 -/* 0C43FC 800C37FC 926F0012 */ lbu $t7, 0x12($s3) -/* 0C4400 800C3800 11E00048 */ beqz $t7, .L800C3924 -/* 0C4404 800C3804 0015C0C0 */ sll $t8, $s5, 3 -/* 0C4408 800C3808 0315C021 */ addu $t8, $t8, $s5 -/* 0C440C 800C380C 0018C080 */ sll $t8, $t8, 2 -/* 0C4410 800C3810 0315C021 */ addu $t8, $t8, $s5 -/* 0C4414 800C3814 0018C080 */ sll $t8, $t8, 2 -/* 0C4418 800C3818 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C441C 800C381C 0315C023 */ subu $t8, $t8, $s5 -/* 0C4420 800C3820 0018C080 */ sll $t8, $t8, 2 -/* 0C4424 800C3824 44810000 */ mtc1 $at, $f0 -/* 0C4428 800C3828 02D8A021 */ addu $s4, $s6, $t8 -/* 0C442C 800C382C 00009025 */ move $s2, $zero -/* 0C4430 800C3830 02A01025 */ move $v0, $s5 -/* 0C4434 800C3834 0292C821 */ addu $t9, $s4, $s2 -.L800C3838: -/* 0C4438 800C3838 932A000E */ lbu $t2, 0xe($t9) -/* 0C443C 800C383C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C4440 800C3840 448A2000 */ mtc1 $t2, $f4 -/* 0C4444 800C3844 05410004 */ bgez $t2, .L800C3858 -/* 0C4448 800C3848 468021A0 */ cvt.s.w $f6, $f4 -/* 0C444C 800C384C 44814000 */ mtc1 $at, $f8 -/* 0C4450 800C3850 00000000 */ nop -/* 0C4454 800C3854 46083180 */ add.s $f6, $f6, $f8 -.L800C3858: -/* 0C4458 800C3858 46143283 */ div.s $f10, $f6, $f20 -/* 0C445C 800C385C 26520001 */ addiu $s2, $s2, 1 -/* 0C4460 800C3860 324B00FF */ andi $t3, $s2, 0xff -/* 0C4464 800C3864 29610003 */ slti $at, $t3, 3 -/* 0C4468 800C3868 01609025 */ move $s2, $t3 -/* 0C446C 800C386C 460A0002 */ mul.s $f0, $f0, $f10 -/* 0C4470 800C3870 5420FFF1 */ bnezl $at, .L800C3838 -/* 0C4474 800C3874 0292C821 */ addu $t9, $s4, $s2 -/* 0C4478 800C3878 46140402 */ mul.s $f16, $f0, $f20 -/* 0C447C 800C387C 240A0001 */ li $t2, 1 -/* 0C4480 800C3880 926C0011 */ lbu $t4, 0x11($s3) -/* 0C4484 800C3884 3C014000 */ lui $at, 0x4000 -/* 0C4488 800C3888 00027E00 */ sll $t7, $v0, 0x18 -/* 0C448C 800C388C 000C6C00 */ sll $t5, $t4, 0x10 -/* 0C4490 800C3890 01A17025 */ or $t6, $t5, $at -/* 0C4494 800C3894 4459F800 */ cfc1 $t9, $31 -/* 0C4498 800C3898 44CAF800 */ ctc1 $t2, $31 -/* 0C449C 800C389C 01CFC025 */ or $t8, $t6, $t7 -/* 0C44A0 800C38A0 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 0C44A4 800C38A4 460084A4 */ cvt.w.s $f18, $f16 -/* 0C44A8 800C38A8 444AF800 */ cfc1 $t2, $31 -/* 0C44AC 800C38AC 00000000 */ nop -/* 0C44B0 800C38B0 314A0078 */ andi $t2, $t2, 0x78 -/* 0C44B4 800C38B4 51400013 */ beql $t2, $zero, .L800C3904 -/* 0C44B8 800C38B8 440A9000 */ mfc1 $t2, $f18 -/* 0C44BC 800C38BC 44819000 */ mtc1 $at, $f18 -/* 0C44C0 800C38C0 240A0001 */ li $t2, 1 -/* 0C44C4 800C38C4 46128481 */ sub.s $f18, $f16, $f18 -/* 0C44C8 800C38C8 44CAF800 */ ctc1 $t2, $31 -/* 0C44CC 800C38CC 00000000 */ nop -/* 0C44D0 800C38D0 460094A4 */ cvt.w.s $f18, $f18 -/* 0C44D4 800C38D4 444AF800 */ cfc1 $t2, $31 -/* 0C44D8 800C38D8 00000000 */ nop -/* 0C44DC 800C38DC 314A0078 */ andi $t2, $t2, 0x78 -/* 0C44E0 800C38E0 15400005 */ bnez $t2, .L800C38F8 -/* 0C44E4 800C38E4 00000000 */ nop -/* 0C44E8 800C38E8 440A9000 */ mfc1 $t2, $f18 -/* 0C44EC 800C38EC 3C018000 */ lui $at, 0x8000 -/* 0C44F0 800C38F0 10000007 */ b .L800C3910 -/* 0C44F4 800C38F4 01415025 */ or $t2, $t2, $at -.L800C38F8: -/* 0C44F8 800C38F8 10000005 */ b .L800C3910 -/* 0C44FC 800C38FC 240AFFFF */ li $t2, -1 -/* 0C4500 800C3900 440A9000 */ mfc1 $t2, $f18 -.L800C3904: -/* 0C4504 800C3904 00000000 */ nop -/* 0C4508 800C3908 0540FFFB */ bltz $t2, .L800C38F8 -/* 0C450C 800C390C 00000000 */ nop -.L800C3910: -/* 0C4510 800C3910 44D9F800 */ ctc1 $t9, $31 -/* 0C4514 800C3914 314B00FF */ andi $t3, $t2, 0xff -/* 0C4518 800C3918 0C030D16 */ jal func_800C3448 -/* 0C451C 800C391C 030B2025 */ or $a0, $t8, $t3 -/* 0C4520 800C3920 A2600012 */ sb $zero, 0x12($s3) -.L800C3924: -/* 0C4524 800C3924 9662000C */ lhu $v0, 0xc($s3) -/* 0C4528 800C3928 10400011 */ beqz $v0, .L800C3970 -/* 0C452C 800C392C 244CFFFF */ addiu $t4, $v0, -1 -/* 0C4530 800C3930 318DFFFF */ andi $t5, $t4, 0xffff -/* 0C4534 800C3934 11A00006 */ beqz $t5, .L800C3950 -/* 0C4538 800C3938 A66C000C */ sh $t4, 0xc($s3) -/* 0C453C 800C393C C6640000 */ lwc1 $f4, ($s3) -/* 0C4540 800C3940 C6680008 */ lwc1 $f8, 8($s3) -/* 0C4544 800C3944 46082181 */ sub.s $f6, $f4, $f8 -/* 0C4548 800C3948 10000003 */ b .L800C3958 -/* 0C454C 800C394C E6660000 */ swc1 $f6, ($s3) -.L800C3950: -/* 0C4550 800C3950 C66A0004 */ lwc1 $f10, 4($s3) -/* 0C4554 800C3954 E66A0000 */ swc1 $f10, ($s3) -.L800C3958: -/* 0C4558 800C3958 32A400FF */ andi $a0, $s5, 0xff -/* 0C455C 800C395C 00047400 */ sll $t6, $a0, 0x10 -/* 0C4560 800C3960 3C014100 */ lui $at, 0x4100 -/* 0C4564 800C3964 01C12025 */ or $a0, $t6, $at -/* 0C4568 800C3968 0C032F06 */ jal func_800CBB88 -/* 0C456C 800C396C 8E650000 */ lw $a1, ($s3) -.L800C3970: -/* 0C4570 800C3970 8E650014 */ lw $a1, 0x14($s3) -/* 0C4574 800C3974 10A00093 */ beqz $a1, .L800C3BC4 -/* 0C4578 800C3978 3C0100FF */ lui $at, 0xff -/* 0C457C 800C397C 00A11024 */ and $v0, $a1, $at -/* 0C4580 800C3980 0002CBC2 */ srl $t9, $v0, 0xf -/* 0C4584 800C3984 30A40FFF */ andi $a0, $a1, 0xfff -/* 0C4588 800C3988 332700FF */ andi $a3, $t9, 0xff -/* 0C458C 800C398C 00A01825 */ move $v1, $a1 -/* 0C4590 800C3990 332800FF */ andi $t0, $t9, 0xff -/* 0C4594 800C3994 14E00004 */ bnez $a3, .L800C39A8 -/* 0C4598 800C3998 3086FFFF */ andi $a2, $a0, 0xffff -/* 0C459C 800C399C 24E80001 */ addiu $t0, $a3, 1 -/* 0C45A0 800C39A0 310A00FF */ andi $t2, $t0, 0xff -/* 0C45A4 800C39A4 01404025 */ move $t0, $t2 -.L800C39A8: -/* 0C45A8 800C39A8 0015C080 */ sll $t8, $s5, 2 -/* 0C45AC 800C39AC 0315C021 */ addu $t8, $t8, $s5 -/* 0C45B0 800C39B0 0018C0C0 */ sll $t8, $t8, 3 -/* 0C45B4 800C39B4 0315C021 */ addu $t8, $t8, $s5 -/* 0C45B8 800C39B8 3C0B803B */ lui $t3, %hi(gSequencePlayers) # $t3, 0x803b -/* 0C45BC 800C39BC 256B1510 */ addiu $t3, %lo(gSequencePlayers) # addiu $t3, $t3, 0x1510 -/* 0C45C0 800C39C0 0018C0C0 */ sll $t8, $t8, 3 -/* 0C45C4 800C39C4 030B2821 */ addu $a1, $t8, $t3 -/* 0C45C8 800C39C8 8CAC0000 */ lw $t4, ($a1) -/* 0C45CC 800C39CC 24010030 */ li $at, 48 -/* 0C45D0 800C39D0 3062F000 */ andi $v0, $v1, 0xf000 -/* 0C45D4 800C39D4 000C6FC2 */ srl $t5, $t4, 0x1f -/* 0C45D8 800C39D8 51A0007A */ beql $t5, $zero, .L800C3BC4 -/* 0C45DC 800C39DC AE600014 */ sw $zero, 0x14($s3) -/* 0C45E0 800C39E0 94A90008 */ lhu $t1, 8($a1) -/* 0C45E4 800C39E4 00027B02 */ srl $t7, $v0, 0xc -/* 0C45E8 800C39E8 31F900FF */ andi $t9, $t7, 0xff -/* 0C45EC 800C39EC 0121001A */ div $zero, $t1, $at -/* 0C45F0 800C39F0 00004812 */ mflo $t1 -/* 0C45F4 800C39F4 24010001 */ li $at, 1 -/* 0C45F8 800C39F8 1321000C */ beq $t9, $at, .L800C3A2C -/* 0C45FC 800C39FC 3127FFFF */ andi $a3, $t1, 0xffff -/* 0C4600 800C3A00 24010002 */ li $at, 2 -/* 0C4604 800C3A04 1321000E */ beq $t9, $at, .L800C3A40 -/* 0C4608 800C3A08 3083FFFF */ andi $v1, $a0, 0xffff -/* 0C460C 800C3A0C 24010003 */ li $at, 3 -/* 0C4610 800C3A10 13210013 */ beq $t9, $at, .L800C3A60 -/* 0C4614 800C3A14 308CFFFF */ andi $t4, $a0, 0xffff -/* 0C4618 800C3A18 24010004 */ li $at, 4 -/* 0C461C 800C3A1C 53210048 */ beql $t9, $at, .L800C3B40 -/* 0C4620 800C3A20 96620018 */ lhu $v0, 0x18($s3) -/* 0C4624 800C3A24 1000004B */ b .L800C3B54 -/* 0C4628 800C3A28 96620018 */ lhu $v0, 0x18($s3) -.L800C3A2C: -/* 0C462C 800C3A2C 00873021 */ addu $a2, $a0, $a3 -/* 0C4630 800C3A30 30D8FFFF */ andi $t8, $a2, 0xffff -/* 0C4634 800C3A34 03003025 */ move $a2, $t8 -/* 0C4638 800C3A38 10000046 */ b .L800C3B54 -/* 0C463C 800C3A3C 96620018 */ lhu $v0, 0x18($s3) -.L800C3A40: -/* 0C4640 800C3A40 0067082A */ slt $at, $v1, $a3 -/* 0C4644 800C3A44 10200004 */ beqz $at, .L800C3A58 -/* 0C4648 800C3A48 00E01025 */ move $v0, $a3 -/* 0C464C 800C3A4C 00433023 */ subu $a2, $v0, $v1 -/* 0C4650 800C3A50 30CBFFFF */ andi $t3, $a2, 0xffff -/* 0C4654 800C3A54 01603025 */ move $a2, $t3 -.L800C3A58: -/* 0C4658 800C3A58 1000003E */ b .L800C3B54 -/* 0C465C 800C3A5C 96620018 */ lhu $v0, 0x18($s3) -.L800C3A60: -/* 0C4660 800C3A60 448C8000 */ mtc1 $t4, $f16 -/* 0C4664 800C3A64 44875000 */ mtc1 $a3, $f10 -/* 0C4668 800C3A68 05810005 */ bgez $t4, .L800C3A80 -/* 0C466C 800C3A6C 468084A0 */ cvt.s.w $f18, $f16 -/* 0C4670 800C3A70 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C4674 800C3A74 44812000 */ mtc1 $at, $f4 -/* 0C4678 800C3A78 00000000 */ nop -/* 0C467C 800C3A7C 46049480 */ add.s $f18, $f18, $f4 -.L800C3A80: -/* 0C4680 800C3A80 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0C4684 800C3A84 44814000 */ mtc1 $at, $f8 -/* 0C4688 800C3A88 46805420 */ cvt.s.w $f16, $f10 -/* 0C468C 800C3A8C 04E10005 */ bgez $a3, .L800C3AA4 -/* 0C4690 800C3A90 46089183 */ div.s $f6, $f18, $f8 -/* 0C4694 800C3A94 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C4698 800C3A98 44812000 */ mtc1 $at, $f4 -/* 0C469C 800C3A9C 00000000 */ nop -/* 0C46A0 800C3AA0 46048400 */ add.s $f16, $f16, $f4 -.L800C3AA4: -/* 0C46A4 800C3AA4 46068482 */ mul.s $f18, $f16, $f6 -/* 0C46A8 800C3AA8 24060001 */ li $a2, 1 -/* 0C46AC 800C3AAC 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 0C46B0 800C3AB0 444DF800 */ cfc1 $t5, $31 -/* 0C46B4 800C3AB4 44C6F800 */ ctc1 $a2, $31 -/* 0C46B8 800C3AB8 00000000 */ nop -/* 0C46BC 800C3ABC 46009224 */ cvt.w.s $f8, $f18 -/* 0C46C0 800C3AC0 4446F800 */ cfc1 $a2, $31 -/* 0C46C4 800C3AC4 00000000 */ nop -/* 0C46C8 800C3AC8 30C60078 */ andi $a2, $a2, 0x78 -/* 0C46CC 800C3ACC 50C00013 */ beql $a2, $zero, .L800C3B1C -/* 0C46D0 800C3AD0 44064000 */ mfc1 $a2, $f8 -/* 0C46D4 800C3AD4 44814000 */ mtc1 $at, $f8 -/* 0C46D8 800C3AD8 24060001 */ li $a2, 1 -/* 0C46DC 800C3ADC 46089201 */ sub.s $f8, $f18, $f8 -/* 0C46E0 800C3AE0 44C6F800 */ ctc1 $a2, $31 -/* 0C46E4 800C3AE4 00000000 */ nop -/* 0C46E8 800C3AE8 46004224 */ cvt.w.s $f8, $f8 -/* 0C46EC 800C3AEC 4446F800 */ cfc1 $a2, $31 -/* 0C46F0 800C3AF0 00000000 */ nop -/* 0C46F4 800C3AF4 30C60078 */ andi $a2, $a2, 0x78 -/* 0C46F8 800C3AF8 14C00005 */ bnez $a2, .L800C3B10 -/* 0C46FC 800C3AFC 00000000 */ nop -/* 0C4700 800C3B00 44064000 */ mfc1 $a2, $f8 -/* 0C4704 800C3B04 3C018000 */ lui $at, 0x8000 -/* 0C4708 800C3B08 10000007 */ b .L800C3B28 -/* 0C470C 800C3B0C 00C13025 */ or $a2, $a2, $at -.L800C3B10: -/* 0C4710 800C3B10 10000005 */ b .L800C3B28 -/* 0C4714 800C3B14 2406FFFF */ li $a2, -1 -/* 0C4718 800C3B18 44064000 */ mfc1 $a2, $f8 -.L800C3B1C: -/* 0C471C 800C3B1C 00000000 */ nop -/* 0C4720 800C3B20 04C0FFFB */ bltz $a2, .L800C3B10 -/* 0C4724 800C3B24 00000000 */ nop -.L800C3B28: -/* 0C4728 800C3B28 44CDF800 */ ctc1 $t5, $31 -/* 0C472C 800C3B2C 30CEFFFF */ andi $t6, $a2, 0xffff -/* 0C4730 800C3B30 01C03025 */ move $a2, $t6 -/* 0C4734 800C3B34 10000007 */ b .L800C3B54 -/* 0C4738 800C3B38 96620018 */ lhu $v0, 0x18($s3) -/* 0C473C 800C3B3C 96620018 */ lhu $v0, 0x18($s3) -.L800C3B40: -/* 0C4740 800C3B40 30E6FFFF */ andi $a2, $a3, 0xffff -/* 0C4744 800C3B44 10400003 */ beqz $v0, .L800C3B54 -/* 0C4748 800C3B48 00000000 */ nop -/* 0C474C 800C3B4C 10000001 */ b .L800C3B54 -/* 0C4750 800C3B50 3046FFFF */ andi $a2, $v0, 0xffff -.L800C3B54: -/* 0C4754 800C3B54 44898000 */ mtc1 $t1, $f16 -/* 0C4758 800C3B58 28C1012D */ slti $at, $a2, 0x12d -/* 0C475C 800C3B5C 14200002 */ bnez $at, .L800C3B68 -/* 0C4760 800C3B60 468080A0 */ cvt.s.w $f2, $f16 -/* 0C4764 800C3B64 2406012C */ li $a2, 300 -.L800C3B68: -/* 0C4768 800C3B68 44865000 */ mtc1 $a2, $f10 -/* 0C476C 800C3B6C 14400002 */ bnez $v0, .L800C3B78 -/* 0C4770 800C3B70 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C4774 800C3B74 A6670018 */ sh $a3, 0x18($s3) -.L800C3B78: -/* 0C4778 800C3B78 04C10004 */ bgez $a2, .L800C3B8C -/* 0C477C 800C3B7C 46805020 */ cvt.s.w $f0, $f10 -/* 0C4780 800C3B80 44812000 */ mtc1 $at, $f4 -/* 0C4784 800C3B84 00000000 */ nop -/* 0C4788 800C3B88 46040000 */ add.s $f0, $f0, $f4 -.L800C3B8C: -/* 0C478C 800C3B8C 44889000 */ mtc1 $t0, $f18 -/* 0C4790 800C3B90 E6600020 */ swc1 $f0, 0x20($s3) -/* 0C4794 800C3B94 E662001C */ swc1 $f2, 0x1c($s3) -/* 0C4798 800C3B98 46001181 */ sub.s $f6, $f2, $f0 -/* 0C479C 800C3B9C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C47A0 800C3BA0 05010004 */ bgez $t0, .L800C3BB4 -/* 0C47A4 800C3BA4 46809220 */ cvt.s.w $f8, $f18 -/* 0C47A8 800C3BA8 44815000 */ mtc1 $at, $f10 -/* 0C47AC 800C3BAC 00000000 */ nop -/* 0C47B0 800C3BB0 460A4200 */ add.s $f8, $f8, $f10 -.L800C3BB4: -/* 0C47B4 800C3BB4 46083103 */ div.s $f4, $f6, $f8 -/* 0C47B8 800C3BB8 A6680028 */ sh $t0, 0x28($s3) -/* 0C47BC 800C3BBC E6640024 */ swc1 $f4, 0x24($s3) -/* 0C47C0 800C3BC0 AE600014 */ sw $zero, 0x14($s3) -.L800C3BC4: -/* 0C47C4 800C3BC4 96620028 */ lhu $v0, 0x28($s3) -/* 0C47C8 800C3BC8 10400015 */ beqz $v0, .L800C3C20 -/* 0C47CC 800C3BCC 244FFFFF */ addiu $t7, $v0, -1 -/* 0C47D0 800C3BD0 32A300FF */ andi $v1, $s5, 0xff -/* 0C47D4 800C3BD4 0003CC00 */ sll $t9, $v1, 0x10 -/* 0C47D8 800C3BD8 31EAFFFF */ andi $t2, $t7, 0xffff -/* 0C47DC 800C3BDC A66F0028 */ sh $t7, 0x28($s3) -/* 0C47E0 800C3BE0 11400006 */ beqz $t2, .L800C3BFC -/* 0C47E4 800C3BE4 03201825 */ move $v1, $t9 -/* 0C47E8 800C3BE8 C670001C */ lwc1 $f16, 0x1c($s3) -/* 0C47EC 800C3BEC C6720024 */ lwc1 $f18, 0x24($s3) -/* 0C47F0 800C3BF0 46128281 */ sub.s $f10, $f16, $f18 -/* 0C47F4 800C3BF4 10000003 */ b .L800C3C04 -/* 0C47F8 800C3BF8 E66A001C */ swc1 $f10, 0x1c($s3) -.L800C3BFC: -/* 0C47FC 800C3BFC C6660020 */ lwc1 $f6, 0x20($s3) -/* 0C4800 800C3C00 E666001C */ swc1 $f6, 0x1c($s3) -.L800C3C04: -/* 0C4804 800C3C04 C668001C */ lwc1 $f8, 0x1c($s3) -/* 0C4808 800C3C08 3C014700 */ lui $at, 0x4700 -/* 0C480C 800C3C0C 00612025 */ or $a0, $v1, $at -/* 0C4810 800C3C10 4600410D */ trunc.w.s $f4, $f8 -/* 0C4814 800C3C14 44052000 */ mfc1 $a1, $f4 -/* 0C4818 800C3C18 0C032F12 */ jal func_800CBBB8 -/* 0C481C 800C3C1C 00000000 */ nop -.L800C3C20: -/* 0C4820 800C3C20 966B0246 */ lhu $t3, 0x246($s3) -/* 0C4824 800C3C24 1160002C */ beqz $t3, .L800C3CD8 -/* 0C4828 800C3C28 001560C0 */ sll $t4, $s5, 3 -/* 0C482C 800C3C2C 01956021 */ addu $t4, $t4, $s5 -/* 0C4830 800C3C30 000C6080 */ sll $t4, $t4, 2 -/* 0C4834 800C3C34 01956021 */ addu $t4, $t4, $s5 -/* 0C4838 800C3C38 000C6080 */ sll $t4, $t4, 2 -/* 0C483C 800C3C3C 01956023 */ subu $t4, $t4, $s5 -/* 0C4840 800C3C40 000C6080 */ sll $t4, $t4, 2 -/* 0C4844 800C3C44 02CCA021 */ addu $s4, $s6, $t4 -/* 0C4848 800C3C48 00008025 */ move $s0, $zero -.L800C3C4C: -/* 0C484C 800C3C4C 00102140 */ sll $a0, $s0, 5 -/* 0C4850 800C3C50 02841021 */ addu $v0, $s4, $a0 -/* 0C4854 800C3C54 94430050 */ lhu $v1, 0x50($v0) -/* 0C4858 800C3C58 32A600FF */ andi $a2, $s5, 0xff -/* 0C485C 800C3C5C 00067400 */ sll $t6, $a2, 0x10 -/* 0C4860 800C3C60 10600018 */ beqz $v1, .L800C3CC4 -/* 0C4864 800C3C64 246DFFFF */ addiu $t5, $v1, -1 -/* 0C4868 800C3C68 3C010100 */ lui $at, 0x100 -/* 0C486C 800C3C6C 31B9FFFF */ andi $t9, $t5, 0xffff -/* 0C4870 800C3C70 A44D0050 */ sh $t5, 0x50($v0) -/* 0C4874 800C3C74 13200006 */ beqz $t9, .L800C3C90 -/* 0C4878 800C3C78 01C13025 */ or $a2, $t6, $at -/* 0C487C 800C3C7C C4500044 */ lwc1 $f16, 0x44($v0) -/* 0C4880 800C3C80 C452004C */ lwc1 $f18, 0x4c($v0) -/* 0C4884 800C3C84 46128281 */ sub.s $f10, $f16, $f18 -/* 0C4888 800C3C88 10000009 */ b .L800C3CB0 -/* 0C488C 800C3C8C E44A0044 */ swc1 $f10, 0x44($v0) -.L800C3C90: -/* 0C4890 800C3C90 02641821 */ addu $v1, $s3, $a0 -/* 0C4894 800C3C94 C4660048 */ lwc1 $f6, 0x48($v1) -/* 0C4898 800C3C98 24180001 */ li $t8, 1 -/* 0C489C 800C3C9C 02185804 */ sllv $t3, $t8, $s0 -/* 0C48A0 800C3CA0 E4660044 */ swc1 $f6, 0x44($v1) -/* 0C48A4 800C3CA4 966A0246 */ lhu $t2, 0x246($s3) -/* 0C48A8 800C3CA8 014B6026 */ xor $t4, $t2, $t3 -/* 0C48AC 800C3CAC A66C0246 */ sh $t4, 0x246($s3) -.L800C3CB0: -/* 0C48B0 800C3CB0 320D00FF */ andi $t5, $s0, 0xff -/* 0C48B4 800C3CB4 000D7200 */ sll $t6, $t5, 8 -/* 0C48B8 800C3CB8 00CE2025 */ or $a0, $a2, $t6 -/* 0C48BC 800C3CBC 0C032F06 */ jal func_800CBB88 -/* 0C48C0 800C3CC0 8C450044 */ lw $a1, 0x44($v0) -.L800C3CC4: -/* 0C48C4 800C3CC4 26100001 */ addiu $s0, $s0, 1 -/* 0C48C8 800C3CC8 320F00FF */ andi $t7, $s0, 0xff -/* 0C48CC 800C3CCC 29E10010 */ slti $at, $t7, 0x10 -/* 0C48D0 800C3CD0 1420FFDE */ bnez $at, .L800C3C4C -/* 0C48D4 800C3CD4 01E08025 */ move $s0, $t7 -.L800C3CD8: -/* 0C48D8 800C3CD8 96790244 */ lhu $t9, 0x244($s3) -/* 0C48DC 800C3CDC 1320002C */ beqz $t9, .L800C3D90 -/* 0C48E0 800C3CE0 0015C0C0 */ sll $t8, $s5, 3 -/* 0C48E4 800C3CE4 0315C021 */ addu $t8, $t8, $s5 -/* 0C48E8 800C3CE8 0018C080 */ sll $t8, $t8, 2 -/* 0C48EC 800C3CEC 0315C021 */ addu $t8, $t8, $s5 -/* 0C48F0 800C3CF0 0018C080 */ sll $t8, $t8, 2 -/* 0C48F4 800C3CF4 0315C023 */ subu $t8, $t8, $s5 -/* 0C48F8 800C3CF8 0018C080 */ sll $t8, $t8, 2 -/* 0C48FC 800C3CFC 02D8A021 */ addu $s4, $s6, $t8 -/* 0C4900 800C3D00 00008025 */ move $s0, $zero -.L800C3D04: -/* 0C4904 800C3D04 00102140 */ sll $a0, $s0, 5 -/* 0C4908 800C3D08 02841021 */ addu $v0, $s4, $a0 -/* 0C490C 800C3D0C 94430060 */ lhu $v1, 0x60($v0) -/* 0C4910 800C3D10 32A600FF */ andi $a2, $s5, 0xff -/* 0C4914 800C3D14 00065C00 */ sll $t3, $a2, 0x10 -/* 0C4918 800C3D18 10600018 */ beqz $v1, .L800C3D7C -/* 0C491C 800C3D1C 246AFFFF */ addiu $t2, $v1, -1 -/* 0C4920 800C3D20 3C010400 */ lui $at, 0x400 -/* 0C4924 800C3D24 314DFFFF */ andi $t5, $t2, 0xffff -/* 0C4928 800C3D28 A44A0060 */ sh $t2, 0x60($v0) -/* 0C492C 800C3D2C 11A00006 */ beqz $t5, .L800C3D48 -/* 0C4930 800C3D30 01613025 */ or $a2, $t3, $at -/* 0C4934 800C3D34 C4480054 */ lwc1 $f8, 0x54($v0) -/* 0C4938 800C3D38 C444005C */ lwc1 $f4, 0x5c($v0) -/* 0C493C 800C3D3C 46044401 */ sub.s $f16, $f8, $f4 -/* 0C4940 800C3D40 10000009 */ b .L800C3D68 -/* 0C4944 800C3D44 E4500054 */ swc1 $f16, 0x54($v0) -.L800C3D48: -/* 0C4948 800C3D48 02641821 */ addu $v1, $s3, $a0 -/* 0C494C 800C3D4C C4720058 */ lwc1 $f18, 0x58($v1) -/* 0C4950 800C3D50 240F0001 */ li $t7, 1 -/* 0C4954 800C3D54 020FC804 */ sllv $t9, $t7, $s0 -/* 0C4958 800C3D58 E4720054 */ swc1 $f18, 0x54($v1) -/* 0C495C 800C3D5C 966E0244 */ lhu $t6, 0x244($s3) -/* 0C4960 800C3D60 01D9C026 */ xor $t8, $t6, $t9 -/* 0C4964 800C3D64 A6780244 */ sh $t8, 0x244($s3) -.L800C3D68: -/* 0C4968 800C3D68 320A00FF */ andi $t2, $s0, 0xff -/* 0C496C 800C3D6C 000A5A00 */ sll $t3, $t2, 8 -/* 0C4970 800C3D70 00CB2025 */ or $a0, $a2, $t3 -/* 0C4974 800C3D74 0C032F06 */ jal func_800CBB88 -/* 0C4978 800C3D78 8C450054 */ lw $a1, 0x54($v0) -.L800C3D7C: -/* 0C497C 800C3D7C 26100001 */ addiu $s0, $s0, 1 -/* 0C4980 800C3D80 320C00FF */ andi $t4, $s0, 0xff -/* 0C4984 800C3D84 29810010 */ slti $at, $t4, 0x10 -/* 0C4988 800C3D88 1420FFDE */ bnez $at, .L800C3D04 -/* 0C498C 800C3D8C 01808025 */ move $s0, $t4 -.L800C3D90: -/* 0C4990 800C3D90 926D0041 */ lbu $t5, 0x41($s3) -/* 0C4994 800C3D94 11A00089 */ beqz $t5, .L800C3FBC -/* 0C4998 800C3D98 3C04F000 */ lui $a0, 0xf000 -/* 0C499C 800C3D9C 0C030D7E */ jal func_800C357C_eu -/* 0C49A0 800C3DA0 00802825 */ move $a1, $a0 -/* 0C49A4 800C3DA4 54400004 */ bnezl $v0, .L800C3DB8 -/* 0C49A8 800C3DA8 92620040 */ lbu $v0, 0x40($s3) -/* 0C49AC 800C3DAC 10000088 */ b .L800C3FD0 -/* 0C49B0 800C3DB0 A2600041 */ sb $zero, 0x41($s3) -/* 0C49B4 800C3DB4 92620040 */ lbu $v0, 0x40($s3) -.L800C3DB8: -/* 0C49B8 800C3DB8 00157080 */ sll $t6, $s5, 2 -/* 0C49BC 800C3DBC 01D57021 */ addu $t6, $t6, $s5 -/* 0C49C0 800C3DC0 10400004 */ beqz $v0, .L800C3DD4 -/* 0C49C4 800C3DC4 000E70C0 */ sll $t6, $t6, 3 -/* 0C49C8 800C3DC8 244FFFFF */ addiu $t7, $v0, -1 -/* 0C49CC 800C3DCC 1000007B */ b .L800C3FBC -/* 0C49D0 800C3DD0 A26F0040 */ sb $t7, 0x40($s3) -.L800C3DD4: -/* 0C49D4 800C3DD4 01D57021 */ addu $t6, $t6, $s5 -/* 0C49D8 800C3DD8 000E70C0 */ sll $t6, $t6, 3 -/* 0C49DC 800C3DDC 3C19803B */ lui $t9, %hi(gSequencePlayers) # 0x803b -/* 0C49E0 800C3DE0 032EC821 */ addu $t9, $t9, $t6 -/* 0C49E4 800C3DE4 8F391510 */ lw $t9, %lo(gSequencePlayers)($t9) # 0x1510($t6) -/* 0C49E8 800C3DE8 0019C7C2 */ srl $t8, $t9, 0x1f -/* 0C49EC 800C3DEC 57000074 */ bnezl $t8, .L800C3FC0 -/* 0C49F0 800C3DF0 26B50001 */ addiu $s5, $s5, 1 -/* 0C49F4 800C3DF4 92630041 */ lbu $v1, 0x41($s3) -/* 0C49F8 800C3DF8 001550C0 */ sll $t2, $s5, 3 -/* 0C49FC 800C3DFC 01555021 */ addu $t2, $t2, $s5 -/* 0C4A00 800C3E00 1860006D */ blez $v1, .L800C3FB8 -/* 0C4A04 800C3E04 00009025 */ move $s2, $zero -/* 0C4A08 800C3E08 000A5080 */ sll $t2, $t2, 2 -/* 0C4A0C 800C3E0C 01555021 */ addu $t2, $t2, $s5 -/* 0C4A10 800C3E10 000A5080 */ sll $t2, $t2, 2 -/* 0C4A14 800C3E14 01555023 */ subu $t2, $t2, $s5 -/* 0C4A18 800C3E18 000A5080 */ sll $t2, $t2, 2 -/* 0C4A1C 800C3E1C 02CAA021 */ addu $s4, $s6, $t2 -.L800C3E20: -/* 0C4A20 800C3E20 00125880 */ sll $t3, $s2, 2 -/* 0C4A24 800C3E24 028B6021 */ addu $t4, $s4, $t3 -/* 0C4A28 800C3E28 8D82002C */ lw $v0, 0x2c($t4) -/* 0C4A2C 800C3E2C 3C0100F0 */ lui $at, 0xf0 -/* 0C4A30 800C3E30 00412024 */ and $a0, $v0, $at -/* 0C4A34 800C3E34 3C01000F */ lui $at, 0xf -/* 0C4A38 800C3E38 00046D02 */ srl $t5, $a0, 0x14 -/* 0C4A3C 800C3E3C 00418824 */ and $s1, $v0, $at -/* 0C4A40 800C3E40 31AF00FF */ andi $t7, $t5, 0xff -/* 0C4A44 800C3E44 3045FF00 */ andi $a1, $v0, 0xff00 -/* 0C4A48 800C3E48 00403025 */ move $a2, $v0 -/* 0C4A4C 800C3E4C 00117402 */ srl $t6, $s1, 0x10 -/* 0C4A50 800C3E50 0005C202 */ srl $t8, $a1, 8 -/* 0C4A54 800C3E54 30CB00FF */ andi $t3, $a2, 0xff -/* 0C4A58 800C3E58 2DE10007 */ sltiu $at, $t7, 7 -/* 0C4A5C 800C3E5C 31D100FF */ andi $s1, $t6, 0xff -/* 0C4A60 800C3E60 330500FF */ andi $a1, $t8, 0xff -/* 0C4A64 800C3E64 1020004F */ beqz $at, .L800C3FA4 -/* 0C4A68 800C3E68 01603025 */ move $a2, $t3 -/* 0C4A6C 800C3E6C 000F6080 */ sll $t4, $t7, 2 -/* 0C4A70 800C3E70 3C01800F */ lui $at, %hi(jpt_800F376C) # 0x800f -/* 0C4A74 800C3E74 002C0821 */ addu $at, $at, $t4 -/* 0C4A78 800C3E78 8C2C376C */ lw $t4, %lo(jpt_800F376C)($at) # 0x376c($at) -/* 0C4A7C 800C3E7C 01800008 */ jr $t4 -/* 0C4A80 800C3E80 00000000 */ nop -glabel L800C3DEC -/* 0C4A84 800C3E84 02370019 */ multu $s1, $s7 -/* 0C4A88 800C3E88 240F0001 */ li $t7, 1 -/* 0C4A8C 800C3E8C 240E007F */ li $t6, 127 -/* 0C4A90 800C3E90 00006812 */ mflo $t5 -/* 0C4A94 800C3E94 02CD8021 */ addu $s0, $s6, $t5 -/* 0C4A98 800C3E98 A20F0012 */ sb $t7, 0x12($s0) -/* 0C4A9C 800C3E9C A20E000F */ sb $t6, 0xf($s0) -/* 0C4AA0 800C3EA0 10000040 */ b .L800C3FA4 -/* 0C4AA4 800C3EA4 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E10 -/* 0C4AA8 800C3EA8 96790248 */ lhu $t9, 0x248($s3) -/* 0C4AAC 800C3EAC 3C013000 */ lui $at, 0x3000 -/* 0C4AB0 800C3EB0 00155600 */ sll $t2, $s5, 0x18 -/* 0C4AB4 800C3EB4 0321C025 */ or $t8, $t9, $at -/* 0C4AB8 800C3EB8 0C030D16 */ jal func_800C3448 -/* 0C4ABC 800C3EBC 030A2025 */ or $a0, $t8, $t2 -/* 0C4AC0 800C3EC0 10000038 */ b .L800C3FA4 -/* 0C4AC4 800C3EC4 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E30 -/* 0C4AC8 800C3EC8 02370019 */ multu $s1, $s7 -/* 0C4ACC 800C3ECC 00116E00 */ sll $t5, $s1, 0x18 -/* 0C4AD0 800C3ED0 3C010001 */ lui $at, 1 -/* 0C4AD4 800C3ED4 00005812 */ mflo $t3 -/* 0C4AD8 800C3ED8 02CB8021 */ addu $s0, $s6, $t3 -/* 0C4ADC 800C3EDC 960C0248 */ lhu $t4, 0x248($s0) -/* 0C4AE0 800C3EE0 018D2025 */ or $a0, $t4, $t5 -/* 0C4AE4 800C3EE4 00817825 */ or $t7, $a0, $at -/* 0C4AE8 800C3EE8 0C030D16 */ jal func_800C3448 -/* 0C4AEC 800C3EEC 01E02025 */ move $a0, $t7 -/* 0C4AF0 800C3EF0 240E0001 */ li $t6, 1 -/* 0C4AF4 800C3EF4 2419007F */ li $t9, 127 -/* 0C4AF8 800C3EF8 A20E0012 */ sb $t6, 0x12($s0) -/* 0C4AFC 800C3EFC A219000F */ sb $t9, 0xf($s0) -/* 0C4B00 800C3F00 10000028 */ b .L800C3FA4 -/* 0C4B04 800C3F04 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E70 -/* 0C4B08 800C3F08 3C01B000 */ lui $at, (0xB0003000 >> 16) # lui $at, 0xb000 -/* 0C4B0C 800C3F0C 34213000 */ ori $at, (0xB0003000 & 0xFFFF) # ori $at, $at, 0x3000 -/* 0C4B10 800C3F10 0011C600 */ sll $t8, $s1, 0x18 -/* 0C4B14 800C3F14 03015025 */ or $t2, $t8, $at -/* 0C4B18 800C3F18 00055C00 */ sll $t3, $a1, 0x10 -/* 0C4B1C 800C3F1C 014B6025 */ or $t4, $t2, $t3 -/* 0C4B20 800C3F20 0C030D16 */ jal func_800C3448 -/* 0C4B24 800C3F24 01862025 */ or $a0, $t4, $a2 -/* 0C4B28 800C3F28 1000001E */ b .L800C3FA4 -/* 0C4B2C 800C3F2C 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E98 -/* 0C4B30 800C3F30 3C01B000 */ lui $at, (0xB0004000 >> 16) # lui $at, 0xb000 -/* 0C4B34 800C3F34 34214000 */ ori $at, (0xB0004000 & 0xFFFF) # ori $at, $at, 0x4000 -/* 0C4B38 800C3F38 00116E00 */ sll $t5, $s1, 0x18 -/* 0C4B3C 800C3F3C 01A17825 */ or $t7, $t5, $at -/* 0C4B40 800C3F40 00067400 */ sll $t6, $a2, 0x10 -/* 0C4B44 800C3F44 0C030D16 */ jal func_800C3448 -/* 0C4B48 800C3F48 01EE2025 */ or $a0, $t7, $t6 -/* 0C4B4C 800C3F4C 10000015 */ b .L800C3FA4 -/* 0C4B50 800C3F50 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3EBC -/* 0C4B54 800C3F54 02370019 */ multu $s1, $s7 -/* 0C4B58 800C3F58 00116600 */ sll $t4, $s1, 0x18 -/* 0C4B5C 800C3F5C 3059FFFF */ andi $t9, $v0, 0xffff -/* 0C4B60 800C3F60 0000C012 */ mflo $t8 -/* 0C4B64 800C3F64 02D88021 */ addu $s0, $s6, $t8 -/* 0C4B68 800C3F68 920A0042 */ lbu $t2, 0x42($s0) -/* 0C4B6C 800C3F6C 000A5C00 */ sll $t3, $t2, 0x10 -/* 0C4B70 800C3F70 016C6825 */ or $t5, $t3, $t4 -/* 0C4B74 800C3F74 0C030D16 */ jal func_800C3448 -/* 0C4B78 800C3F78 01B92025 */ or $a0, $t5, $t9 -/* 0C4B7C 800C3F7C 322400FF */ andi $a0, $s1, 0xff -/* 0C4B80 800C3F80 24050001 */ li $a1, 1 -/* 0C4B84 800C3F84 2406007F */ li $a2, 127 -/* 0C4B88 800C3F88 0C030DD1 */ jal func_800C36C4 -/* 0C4B8C 800C3F8C 00003825 */ move $a3, $zero -/* 0C4B90 800C3F90 A2000042 */ sb $zero, 0x42($s0) -/* 0C4B94 800C3F94 10000003 */ b .L800C3FA4 -/* 0C4B98 800C3F98 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3F04 -/* 0C4B9C 800C3F9C A2650042 */ sb $a1, 0x42($s3) -/* 0C4BA0 800C3FA0 92630041 */ lbu $v1, 0x41($s3) -.L800C3FA4: -/* 0C4BA4 800C3FA4 26520001 */ addiu $s2, $s2, 1 -/* 0C4BA8 800C3FA8 324F00FF */ andi $t7, $s2, 0xff -/* 0C4BAC 800C3FAC 01E3082A */ slt $at, $t7, $v1 -/* 0C4BB0 800C3FB0 1420FF9B */ bnez $at, .L800C3E20 -/* 0C4BB4 800C3FB4 01E09025 */ move $s2, $t7 -.L800C3FB8: -/* 0C4BB8 800C3FB8 A2600041 */ sb $zero, 0x41($s3) -.L800C3FBC: -/* 0C4BBC 800C3FBC 26B50001 */ addiu $s5, $s5, 1 -.L800C3FC0: -/* 0C4BC0 800C3FC0 32AE00FF */ andi $t6, $s5, 0xff -/* 0C4BC4 800C3FC4 29C10003 */ slti $at, $t6, 3 -/* 0C4BC8 800C3FC8 1420FE09 */ bnez $at, .L800C37F0 -/* 0C4BCC 800C3FCC 01C0A825 */ move $s5, $t6 -.L800C3FD0: -/* 0C4BD0 800C3FD0 8FDF0054 */ lw $ra, 0x54($fp) -/* 0C4BD4 800C3FD4 03C0E825 */ move $sp, $fp -/* 0C4BD8 800C3FD8 D7D40028 */ ldc1 $f20, 0x28($fp) -/* 0C4BDC 800C3FDC 8FD00030 */ lw $s0, 0x30($fp) -/* 0C4BE0 800C3FE0 8FD10034 */ lw $s1, 0x34($fp) -/* 0C4BE4 800C3FE4 8FD20038 */ lw $s2, 0x38($fp) -/* 0C4BE8 800C3FE8 8FD3003C */ lw $s3, 0x3c($fp) -/* 0C4BEC 800C3FEC 8FD40040 */ lw $s4, 0x40($fp) -/* 0C4BF0 800C3FF0 8FD50044 */ lw $s5, 0x44($fp) -/* 0C4BF4 800C3FF4 8FD60048 */ lw $s6, 0x48($fp) -/* 0C4BF8 800C3FF8 8FD7004C */ lw $s7, 0x4c($fp) -/* 0C4BFC 800C3FFC 8FDE0050 */ lw $fp, 0x50($fp) -/* 0C4C00 800C4000 03E00008 */ jr $ra -/* 0C4C04 800C4004 27BD0058 */ addiu $sp, $sp, 0x58 diff --git a/asm/non_matchings/audio/external/func_800C16E8.s b/asm/non_matchings/audio/external/func_800C16E8.s deleted file mode 100644 index 08f7c79129..0000000000 --- a/asm/non_matchings/audio/external/func_800C16E8.s +++ /dev/null @@ -1,170 +0,0 @@ -.section .late_rodata - -glabel D_800F35C0 -.float 3.333333333 - -.section .text - -glabel func_800C16E8 -/* 0C22E8 800C16E8 27ADFFE8 */ addiu $t5, $sp, -0x18 -/* 0C22EC 800C16EC F5B40010 */ sdc1 $f20, 0x10($t5) -/* 0C22F0 800C16F0 E5AE001C */ swc1 $f14, 0x1c($t5) -/* 0C22F4 800C16F4 ADA60020 */ sw $a2, 0x20($t5) -/* 0C22F8 800C16F8 3C0F800F */ lui $t7, %hi(D_800EA1C0) # $t7, 0x800f -/* 0C22FC 800C16FC 91EFA1C0 */ lbu $t7, %lo(D_800EA1C0)($t7) -/* 0C2300 800C1700 30CE00FF */ andi $t6, $a2, 0xff -/* 0C2304 800C1704 01C03025 */ move $a2, $t6 -/* 0C2308 800C1708 15E00082 */ bnez $t7, .L800C1914 -/* 0C230C 800C170C 01A0E825 */ move $sp, $t5 -/* 0C2310 800C1710 3C18800F */ lui $t8, %hi(D_800EA0F4) # $t8, 0x800f -/* 0C2314 800C1714 9318A0F4 */ lbu $t8, %lo(D_800EA0F4)($t8) -/* 0C2318 800C1718 44802000 */ mtc1 $zero, $f4 -/* 0C231C 800C171C 44804000 */ mtc1 $zero, $f8 -/* 0C2320 800C1720 44805000 */ mtc1 $zero, $f10 -/* 0C2324 800C1724 13000009 */ beqz $t8, .L800C174C -/* 0C2328 800C1728 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0C232C 800C172C 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0C2330 800C1730 44818000 */ mtc1 $at, $f16 -/* 0C2334 800C1734 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0C2338 800C1738 44817000 */ mtc1 $at, $f14 -/* 0C233C 800C173C 3C014020 */ li $at, 0x40200000 # 2.500000 -/* 0C2340 800C1740 44819000 */ mtc1 $at, $f18 -/* 0C2344 800C1744 10000008 */ b .L800C1768 -/* 0C2348 800C1748 46008086 */ mov.s $f2, $f16 -.L800C174C: -/* 0C234C 800C174C 44811000 */ mtc1 $at, $f2 -/* 0C2350 800C1750 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0C2354 800C1754 44817000 */ mtc1 $at, $f14 -/* 0C2358 800C1758 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0C235C 800C175C 44818000 */ mtc1 $at, $f16 -/* 0C2360 800C1760 3C01800F */ lui $at, %hi(D_800F35C0) # $at, 0x800f -/* 0C2364 800C1764 C43235C0 */ lwc1 $f18, %lo(D_800F35C0)($at) -.L800C1768: -/* 0C2368 800C1768 4604603C */ c.lt.s $f12, $f4 -/* 0C236C 800C176C 00000000 */ nop -/* 0C2370 800C1770 45020004 */ bc1fl .L800C1784 -/* 0C2374 800C1774 46006506 */ mov.s $f20, $f12 -/* 0C2378 800C1778 10000002 */ b .L800C1784 -/* 0C237C 800C177C 46006507 */ neg.s $f20, $f12 -/* 0C2380 800C1780 46006506 */ mov.s $f20, $f12 -.L800C1784: -/* 0C2384 800C1784 4614103C */ c.lt.s $f2, $f20 -/* 0C2388 800C1788 00000000 */ nop -/* 0C238C 800C178C 45020003 */ bc1fl .L800C179C -/* 0C2390 800C1790 C5A6001C */ lwc1 $f6, 0x1c($t5) -/* 0C2394 800C1794 46001506 */ mov.s $f20, $f2 -/* 0C2398 800C1798 C5A6001C */ lwc1 $f6, 0x1c($t5) -.L800C179C: -/* 0C239C 800C179C 4608303C */ c.lt.s $f6, $f8 -/* 0C23A0 800C17A0 00000000 */ nop -/* 0C23A4 800C17A4 45020004 */ bc1fl .L800C17B8 -/* 0C23A8 800C17A8 C5A0001C */ lwc1 $f0, 0x1c($t5) -/* 0C23AC 800C17AC 10000002 */ b .L800C17B8 -/* 0C23B0 800C17B0 46003007 */ neg.s $f0, $f6 -/* 0C23B4 800C17B4 C5A0001C */ lwc1 $f0, 0x1c($t5) -.L800C17B8: -/* 0C23B8 800C17B8 4600103C */ c.lt.s $f2, $f0 -/* 0C23BC 800C17BC 00000000 */ nop -/* 0C23C0 800C17C0 45020003 */ bc1fl .L800C17D0 -/* 0C23C4 800C17C4 460A6032 */ c.eq.s $f12, $f10 -/* 0C23C8 800C17C8 46001006 */ mov.s $f0, $f2 -/* 0C23CC 800C17CC 460A6032 */ c.eq.s $f12, $f10 -.L800C17D0: -/* 0C23D0 800C17D0 00000000 */ nop -/* 0C23D4 800C17D4 4502000E */ bc1fl .L800C1810 -/* 0C23D8 800C17D8 44803000 */ mtc1 $zero, $f6 -/* 0C23DC 800C17DC C5A4001C */ lwc1 $f4, 0x1c($t5) -/* 0C23E0 800C17E0 44804000 */ mtc1 $zero, $f8 -/* 0C23E4 800C17E4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0C23E8 800C17E8 46082032 */ c.eq.s $f4, $f8 -/* 0C23EC 800C17EC 00000000 */ nop -/* 0C23F0 800C17F0 45020007 */ bc1fl .L800C1810 -/* 0C23F4 800C17F4 44803000 */ mtc1 $zero, $f6 -/* 0C23F8 800C17F8 44811000 */ mtc1 $at, $f2 -/* 0C23FC 800C17FC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C2400 800C1800 44816000 */ mtc1 $at, $f12 -/* 0C2404 800C1804 1000002C */ b .L800C18B8 -/* 0C2408 800C1808 4602603C */ c.lt.s $f12, $f2 -/* 0C240C 800C180C 44803000 */ mtc1 $zero, $f6 -.L800C1810: -/* 0C2410 800C1810 00000000 */ nop -/* 0C2414 800C1814 460C303E */ c.le.s $f6, $f12 -/* 0C2418 800C1818 00000000 */ nop -/* 0C241C 800C181C 4502000E */ bc1fl .L800C1858 -/* 0C2420 800C1820 44802000 */ mtc1 $zero, $f4 -/* 0C2424 800C1824 4614003E */ c.le.s $f0, $f20 -/* 0C2428 800C1828 00000000 */ nop -/* 0C242C 800C182C 4502000A */ bc1fl .L800C1858 -/* 0C2430 800C1830 44802000 */ mtc1 $zero, $f4 -/* 0C2434 800C1834 46007101 */ sub.s $f4, $f14, $f0 -/* 0C2438 800C1838 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C243C 800C183C 44816000 */ mtc1 $at, $f12 -/* 0C2440 800C1840 46147281 */ sub.s $f10, $f14, $f20 -/* 0C2444 800C1844 46048202 */ mul.s $f8, $f16, $f4 -/* 0C2448 800C1848 46085183 */ div.s $f6, $f10, $f8 -/* 0C244C 800C184C 10000019 */ b .L800C18B4 -/* 0C2450 800C1850 46066081 */ sub.s $f2, $f12, $f6 -/* 0C2454 800C1854 44802000 */ mtc1 $zero, $f4 -.L800C1858: -/* 0C2458 800C1858 00000000 */ nop -/* 0C245C 800C185C 4604603C */ c.lt.s $f12, $f4 -/* 0C2460 800C1860 00000000 */ nop -/* 0C2464 800C1864 4500000C */ bc1f .L800C1898 -/* 0C2468 800C1868 00000000 */ nop -/* 0C246C 800C186C 4614003E */ c.le.s $f0, $f20 -/* 0C2470 800C1870 00000000 */ nop -/* 0C2474 800C1874 45000008 */ bc1f .L800C1898 -/* 0C2478 800C1878 00000000 */ nop -/* 0C247C 800C187C 46007201 */ sub.s $f8, $f14, $f0 -/* 0C2480 800C1880 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C2484 800C1884 44816000 */ mtc1 $at, $f12 -/* 0C2488 800C1888 46147281 */ sub.s $f10, $f14, $f20 -/* 0C248C 800C188C 46088182 */ mul.s $f6, $f16, $f8 -/* 0C2490 800C1890 10000008 */ b .L800C18B4 -/* 0C2494 800C1894 46065083 */ div.s $f2, $f10, $f6 -.L800C1898: -/* 0C2498 800C1898 46009102 */ mul.s $f4, $f18, $f0 -/* 0C249C 800C189C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0C24A0 800C18A0 44815000 */ mtc1 $at, $f10 -/* 0C24A4 800C18A4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C24A8 800C18A8 46046203 */ div.s $f8, $f12, $f4 -/* 0C24AC 800C18AC 44816000 */ mtc1 $at, $f12 -/* 0C24B0 800C18B0 460A4080 */ add.s $f2, $f8, $f10 -.L800C18B4: -/* 0C24B4 800C18B4 4602603C */ c.lt.s $f12, $f2 -.L800C18B8: -/* 0C24B8 800C18B8 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0C24BC 800C18BC 44803000 */ mtc1 $zero, $f6 -/* 0C24C0 800C18C0 44812000 */ mtc1 $at, $f4 -/* 0C24C4 800C18C4 45020003 */ bc1fl .L800C18D4 -/* 0C24C8 800C18C8 4606103C */ c.lt.s $f2, $f6 -/* 0C24CC 800C18CC 46006086 */ mov.s $f2, $f12 -/* 0C24D0 800C18D0 4606103C */ c.lt.s $f2, $f6 -.L800C18D4: -/* 0C24D4 800C18D4 00000000 */ nop -/* 0C24D8 800C18D8 45000003 */ bc1f .L800C18E8 -/* 0C24DC 800C18DC 00000000 */ nop -/* 0C24E0 800C18E0 44801000 */ mtc1 $zero, $f2 -/* 0C24E4 800C18E4 00000000 */ nop -.L800C18E8: -/* 0C24E8 800C18E8 46041202 */ mul.s $f8, $f2, $f4 -/* 0C24EC 800C18EC 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0C24F0 800C18F0 44815000 */ mtc1 $at, $f10 -/* 0C24F4 800C18F4 00000000 */ nop -/* 0C24F8 800C18F8 460A4180 */ add.s $f6, $f8, $f10 -/* 0C24FC 800C18FC 4600310D */ trunc.w.s $f4, $f6 -/* 0C2500 800C1900 44022000 */ mfc1 $v0, $f4 -/* 0C2504 800C1904 00000000 */ nop -/* 0C2508 800C1908 00024600 */ sll $t0, $v0, 0x18 -/* 0C250C 800C190C 10000006 */ b .L800C1928 -/* 0C2510 800C1910 00081603 */ sra $v0, $t0, 0x18 -.L800C1914: -/* 0C2514 800C1914 30C20001 */ andi $v0, $a2, 1 -/* 0C2518 800C1918 000251C0 */ sll $t2, $v0, 7 -/* 0C251C 800C191C 01425023 */ subu $t2, $t2, $v0 -/* 0C2520 800C1920 000A5E00 */ sll $t3, $t2, 0x18 -/* 0C2524 800C1924 000B1603 */ sra $v0, $t3, 0x18 -.L800C1928: -/* 0C2528 800C1928 D5B40010 */ ldc1 $f20, 0x10($t5) -/* 0C252C 800C192C 03E00008 */ jr $ra -/* 0C2530 800C1930 25BD0018 */ addiu $sp, $t5, 0x18 diff --git a/asm/non_matchings/audio/external/func_800C284C.s b/asm/non_matchings/audio/external/func_800C284C.s deleted file mode 100644 index c84bca585a..0000000000 --- a/asm/non_matchings/audio/external/func_800C284C.s +++ /dev/null @@ -1,95 +0,0 @@ -glabel func_800C284C -/* 0C344C 800C284C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0C3450 800C2850 3C0F800F */ lui $t7, %hi(D_800EA1EC) # $t7, 0x800f -/* 0C3454 800C2854 91EFA1EC */ lbu $t7, %lo(D_800EA1EC)($t7) -/* 0C3458 800C2858 AFBE0028 */ sw $fp, 0x28($sp) -/* 0C345C 800C285C AFA7004C */ sw $a3, 0x4c($sp) -/* 0C3460 800C2860 30EEFFFF */ andi $t6, $a3, 0xffff -/* 0C3464 800C2864 01C03825 */ move $a3, $t6 -/* 0C3468 800C2868 03A0F025 */ move $fp, $sp -/* 0C346C 800C286C AFBF002C */ sw $ra, 0x2c($sp) -/* 0C3470 800C2870 AFA40040 */ sw $a0, 0x40($sp) -/* 0C3474 800C2874 AFA50044 */ sw $a1, 0x44($sp) -/* 0C3478 800C2878 11E00005 */ beqz $t7, .L800C2890 -/* 0C347C 800C287C AFA60048 */ sw $a2, 0x48($sp) -/* 0C3480 800C2880 93D80043 */ lbu $t8, 0x43($fp) -/* 0C3484 800C2884 24010002 */ li $at, 2 -/* 0C3488 800C2888 57010046 */ bnel $t8, $at, .L800C29A4 -/* 0C348C 800C288C 8FDF002C */ lw $ra, 0x2c($fp) -.L800C2890: -/* 0C3490 800C2890 93D90043 */ lbu $t9, 0x43($fp) -/* 0C3494 800C2894 93CB0047 */ lbu $t3, 0x47($fp) -/* 0C3498 800C2898 3C018200 */ lui $at, 0x8200 -/* 0C349C 800C289C 00191400 */ sll $v0, $t9, 0x10 -/* 0C34A0 800C28A0 00414825 */ or $t1, $v0, $at -/* 0C34A4 800C28A4 000B6200 */ sll $t4, $t3, 8 -/* 0C34A8 800C28A8 012C2025 */ or $a0, $t1, $t4 -/* 0C34AC 800C28AC AFC20034 */ sw $v0, 0x34($fp) -/* 0C34B0 800C28B0 0C032EEE */ jal func_800CBBB8 -/* 0C34B4 800C28B4 00E02825 */ move $a1, $a3 -/* 0C34B8 800C28B8 93CD0043 */ lbu $t5, 0x43($fp) -/* 0C34BC 800C28BC 3C0F8019 */ lui $t7, %hi(D_801930D0) # $t7, 0x8019 -/* 0C34C0 800C28C0 25EF30D0 */ addiu $t7, %lo(D_801930D0) # addiu $t7, $t7, 0x30d0 -/* 0C34C4 800C28C4 000D70C0 */ sll $t6, $t5, 3 -/* 0C34C8 800C28C8 01CD7021 */ addu $t6, $t6, $t5 -/* 0C34CC 800C28CC 000E7080 */ sll $t6, $t6, 2 -/* 0C34D0 800C28D0 01CD7021 */ addu $t6, $t6, $t5 -/* 0C34D4 800C28D4 000E7080 */ sll $t6, $t6, 2 -/* 0C34D8 800C28D8 01CD7023 */ subu $t6, $t6, $t5 -/* 0C34DC 800C28DC 000E7080 */ sll $t6, $t6, 2 -/* 0C34E0 800C28E0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C34E4 800C28E4 01CF3021 */ addu $a2, $t6, $t7 -/* 0C34E8 800C28E8 44810000 */ mtc1 $at, $f0 -/* 0C34EC 800C28EC C4C20000 */ lwc1 $f2, ($a2) -/* 0C34F0 800C28F0 93D9004B */ lbu $t9, 0x4b($fp) -/* 0C34F4 800C28F4 93D80047 */ lbu $t8, 0x47($fp) -/* 0C34F8 800C28F8 46020032 */ c.eq.s $f0, $f2 -/* 0C34FC 800C28FC 00194200 */ sll $t0, $t9, 8 -/* 0C3500 800C2900 8FC20034 */ lw $v0, 0x34($fp) -/* 0C3504 800C2904 03085025 */ or $t2, $t8, $t0 -/* 0C3508 800C2908 45010009 */ bc1t .L800C2930 -/* 0C350C 800C290C A4CA0248 */ sh $t2, 0x248($a2) -/* 0C3510 800C2910 3C014100 */ lui $at, 0x4100 -/* 0C3514 800C2914 44051000 */ mfc1 $a1, $f2 -/* 0C3518 800C2918 00412025 */ or $a0, $v0, $at -/* 0C351C 800C291C 0C032EE2 */ jal func_800CBB88 -/* 0C3520 800C2920 AFC60030 */ sw $a2, 0x30($fp) -/* 0C3524 800C2924 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C3528 800C2928 44810000 */ mtc1 $at, $f0 -/* 0C352C 800C292C 8FC60030 */ lw $a2, 0x30($fp) -.L800C2930: -/* 0C3530 800C2930 A4C00028 */ sh $zero, 0x28($a2) -/* 0C3534 800C2934 A4C00018 */ sh $zero, 0x18($a2) -/* 0C3538 800C2938 ACC00014 */ sw $zero, 0x14($a2) -/* 0C353C 800C293C 93CB0043 */ lbu $t3, 0x43($fp) -/* 0C3540 800C2940 3C0C8019 */ lui $t4, %hi(D_801930D0) # $t4, 0x8019 -/* 0C3544 800C2944 258C30D0 */ addiu $t4, %lo(D_801930D0) # addiu $t4, $t4, 0x30d0 -/* 0C3548 800C2948 000B48C0 */ sll $t1, $t3, 3 -/* 0C354C 800C294C 012B4821 */ addu $t1, $t1, $t3 -/* 0C3550 800C2950 00094880 */ sll $t1, $t1, 2 -/* 0C3554 800C2954 012B4821 */ addu $t1, $t1, $t3 -/* 0C3558 800C2958 00094880 */ sll $t1, $t1, 2 -/* 0C355C 800C295C 012B4823 */ subu $t1, $t1, $t3 -/* 0C3560 800C2960 00094880 */ sll $t1, $t1, 2 -/* 0C3564 800C2964 012C2021 */ addu $a0, $t1, $t4 -/* 0C3568 800C2968 00001825 */ move $v1, $zero -.L800C296C: -/* 0C356C 800C296C 00036940 */ sll $t5, $v1, 5 -/* 0C3570 800C2970 24630001 */ addiu $v1, $v1, 1 -/* 0C3574 800C2974 008D1021 */ addu $v0, $a0, $t5 -/* 0C3578 800C2978 306E00FF */ andi $t6, $v1, 0xff -/* 0C357C 800C297C 29C10010 */ slti $at, $t6, 0x10 -/* 0C3580 800C2980 01C01825 */ move $v1, $t6 -/* 0C3584 800C2984 E4400044 */ swc1 $f0, 0x44($v0) -/* 0C3588 800C2988 A4400050 */ sh $zero, 0x50($v0) -/* 0C358C 800C298C E4400054 */ swc1 $f0, 0x54($v0) -/* 0C3590 800C2990 1420FFF6 */ bnez $at, .L800C296C -/* 0C3594 800C2994 A4400060 */ sh $zero, 0x60($v0) -/* 0C3598 800C2998 A4C00244 */ sh $zero, 0x244($a2) -/* 0C359C 800C299C A4C00246 */ sh $zero, 0x246($a2) -/* 0C35A0 800C29A0 8FDF002C */ lw $ra, 0x2c($fp) -.L800C29A4: -/* 0C35A4 800C29A4 03C0E825 */ move $sp, $fp -/* 0C35A8 800C29A8 8FDE0028 */ lw $fp, 0x28($fp) -/* 0C35AC 800C29AC 03E00008 */ jr $ra -/* 0C35B0 800C29B0 27BD0040 */ addiu $sp, $sp, 0x40 diff --git a/asm/non_matchings/audio/external/func_800C2A2C.s b/asm/non_matchings/audio/external/func_800C2A2C.s deleted file mode 100644 index 8f1e8f93ec..0000000000 --- a/asm/non_matchings/audio/external/func_800C2A2C.s +++ /dev/null @@ -1,709 +0,0 @@ -.section .late_rodata - -glabel jpt_800F35EC -.word L800C2A80, L800C2AB8, L800C2AD8, L800C2CDC -.word L800C2E40, L800C2F04, L800C3008, L800C3118 -.word L800C3154, L800C31E4, L800C3218, L800C32B8 -.word L800C32EC, L800C3430, L800C3390, L800C33E0 - -.section .text - -glabel func_800C2A2C -/* 0C362C 800C2A2C 3C010F00 */ lui $at, 0xf00 -/* 0C3630 800C2A30 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0C3634 800C2A34 00815024 */ and $t2, $a0, $at -/* 0C3638 800C2A38 00047F02 */ srl $t7, $a0, 0x1c -/* 0C363C 800C2A3C 31F800FF */ andi $t8, $t7, 0xff -/* 0C3640 800C2A40 AFBE0028 */ sw $fp, 0x28($sp) -/* 0C3644 800C2A44 AFB00024 */ sw $s0, 0x24($sp) -/* 0C3648 800C2A48 000A7602 */ srl $t6, $t2, 0x18 -/* 0C364C 800C2A4C 2F010010 */ sltiu $at, $t8, 0x10 -/* 0C3650 800C2A50 00808025 */ move $s0, $a0 -/* 0C3654 800C2A54 03A0F025 */ move $fp, $sp -/* 0C3658 800C2A58 AFBF002C */ sw $ra, 0x2c($sp) -/* 0C365C 800C2A5C 01C05025 */ move $t2, $t6 -/* 0C3660 800C2A60 10200273 */ beqz $at, .L800C3430 -/* 0C3664 800C2A64 31C500FF */ andi $a1, $t6, 0xff -/* 0C3668 800C2A68 0018C080 */ sll $t8, $t8, 2 -/* 0C366C 800C2A6C 3C01800F */ lui $at, %hi(jpt_800F35EC) -/* 0C3670 800C2A70 00380821 */ addu $at, $at, $t8 -/* 0C3674 800C2A74 8C3835EC */ lw $t8, %lo(jpt_800F35EC)($at) -/* 0C3678 800C2A78 03000008 */ jr $t8 -/* 0C367C 800C2A7C 00000000 */ nop -glabel L800C2A80 -/* 0C3680 800C2A80 3C0100FF */ lui $at, 0xff -/* 0C3684 800C2A84 02013824 */ and $a3, $s0, $at -/* 0C3688 800C2A88 02002825 */ move $a1, $s0 -/* 0C368C 800C2A8C 3206FF00 */ andi $a2, $s0, 0xff00 -/* 0C3690 800C2A90 00067202 */ srl $t6, $a2, 8 -/* 0C3694 800C2A94 30B900FF */ andi $t9, $a1, 0xff -/* 0C3698 800C2A98 0007C342 */ srl $t8, $a3, 0xd -/* 0C369C 800C2A9C 3307FFFF */ andi $a3, $t8, 0xffff -/* 0C36A0 800C2AA0 03202825 */ move $a1, $t9 -/* 0C36A4 800C2AA4 31C600FF */ andi $a2, $t6, 0xff -/* 0C36A8 800C2AA8 0C030A13 */ jal func_800C284C -/* 0C36AC 800C2AAC 314400FF */ andi $a0, $t2, 0xff -/* 0C36B0 800C2AB0 10000260 */ b .L800C3434 -/* 0C36B4 800C2AB4 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C2AB8 -/* 0C36B8 800C2AB8 3C0100FF */ lui $at, 0xff -/* 0C36BC 800C2ABC 02012824 */ and $a1, $s0, $at -/* 0C36C0 800C2AC0 00057342 */ srl $t6, $a1, 0xd -/* 0C36C4 800C2AC4 31C5FFFF */ andi $a1, $t6, 0xffff -/* 0C36C8 800C2AC8 0C030A6D */ jal func_800C29B4 -/* 0C36CC 800C2ACC 314400FF */ andi $a0, $t2, 0xff -/* 0C36D0 800C2AD0 10000258 */ b .L800C3434 -/* 0C36D4 800C2AD4 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C2AD8 -/* 0C36D8 800C2AD8 3C028019 */ lui $v0, %hi(D_80192CC6) # $v0, 0x8019 -/* 0C36DC 800C2ADC 315800FF */ andi $t8, $t2, 0xff -/* 0C36E0 800C2AE0 24422CC6 */ addiu $v0, %lo(D_80192CC6) # addiu $v0, $v0, 0x2cc6 -/* 0C36E4 800C2AE4 00586021 */ addu $t4, $v0, $t8 -/* 0C36E8 800C2AE8 AFD8003C */ sw $t8, 0x3c($fp) -/* 0C36EC 800C2AEC 91890000 */ lbu $t1, ($t4) -/* 0C36F0 800C2AF0 0300C825 */ move $t9, $t8 -/* 0C36F4 800C2AF4 00001825 */ move $v1, $zero -/* 0C36F8 800C2AF8 19200023 */ blez $t1, .L800C2B88 -/* 0C36FC 800C2AFC 01205825 */ move $t3, $t1 -/* 0C3700 800C2B00 0018C080 */ sll $t8, $t8, 2 -/* 0C3704 800C2B04 0319C021 */ addu $t8, $t8, $t9 -/* 0C3708 800C2B08 3C0E8019 */ lui $t6, %hi(D_80192CA8) # $t6, 0x8019 -/* 0C370C 800C2B0C 25CE2CA8 */ addiu $t6, %lo(D_80192CA8) # addiu $t6, $t6, 0x2ca8 -/* 0C3710 800C2B10 0018C040 */ sll $t8, $t8, 1 -/* 0C3714 800C2B14 320400FF */ andi $a0, $s0, 0xff -/* 0C3718 800C2B18 AFC40048 */ sw $a0, 0x48($fp) -/* 0C371C 800C2B1C 030E3021 */ addu $a2, $t8, $t6 -.L800C2B20: -/* 0C3720 800C2B20 00037840 */ sll $t7, $v1, 1 -/* 0C3724 800C2B24 00CFC821 */ addu $t9, $a2, $t7 -/* 0C3728 800C2B28 93380000 */ lbu $t8, ($t9) -/* 0C372C 800C2B2C 00457821 */ addu $t7, $v0, $a1 -/* 0C3730 800C2B30 5498000F */ bnel $a0, $t8, .L800C2B70 -/* 0C3734 800C2B34 91F90000 */ lbu $t9, ($t7) -/* 0C3738 800C2B38 1460023D */ bnez $v1, .L800C3430 -/* 0C373C 800C2B3C 3206FF00 */ andi $a2, $s0, 0xff00 -/* 0C3740 800C2B40 3C0100FF */ lui $at, 0xff -/* 0C3744 800C2B44 02013824 */ and $a3, $s0, $at -/* 0C3748 800C2B48 0007CB42 */ srl $t9, $a3, 0xd -/* 0C374C 800C2B4C 00067202 */ srl $t6, $a2, 8 -/* 0C3750 800C2B50 31C600FF */ andi $a2, $t6, 0xff -/* 0C3754 800C2B54 3327FFFF */ andi $a3, $t9, 0xffff -/* 0C3758 800C2B58 93C4003F */ lbu $a0, 0x3f($fp) -/* 0C375C 800C2B5C 0C030A13 */ jal func_800C284C -/* 0C3760 800C2B60 93C5004B */ lbu $a1, 0x4b($fp) -/* 0C3764 800C2B64 10000233 */ b .L800C3434 -/* 0C3768 800C2B68 8FDF002C */ lw $ra, 0x2c($fp) -/* 0C376C 800C2B6C 91F90000 */ lbu $t9, ($t7) -.L800C2B70: -/* 0C3770 800C2B70 24630001 */ addiu $v1, $v1, 1 -/* 0C3774 800C2B74 306E00FF */ andi $t6, $v1, 0xff -/* 0C3778 800C2B78 01D9082A */ slt $at, $t6, $t9 -/* 0C377C 800C2B7C 1420FFE8 */ bnez $at, .L800C2B20 -/* 0C3780 800C2B80 01C01825 */ move $v1, $t6 -/* 0C3784 800C2B84 00001825 */ move $v1, $zero -.L800C2B88: -/* 0C3788 800C2B88 1960001B */ blez $t3, .L800C2BF8 -/* 0C378C 800C2B8C 312800FF */ andi $t0, $t1, 0xff -/* 0C3790 800C2B90 8FD8003C */ lw $t8, 0x3c($fp) -/* 0C3794 800C2B94 3C028019 */ lui $v0, %hi(D_80192CC6) # 0x8019 -/* 0C3798 800C2B98 3C0F8019 */ lui $t7, %hi(D_80192CA8) # $t7, 0x8019 -/* 0C379C 800C2B9C 00187080 */ sll $t6, $t8, 2 -/* 0C37A0 800C2BA0 3204FF00 */ andi $a0, $s0, 0xff00 -/* 0C37A4 800C2BA4 01D87021 */ addu $t6, $t6, $t8 -/* 0C37A8 800C2BA8 000E7040 */ sll $t6, $t6, 1 -/* 0C37AC 800C2BAC 0004CA02 */ srl $t9, $a0, 8 -/* 0C37B0 800C2BB0 25EF2CA8 */ addiu $t7, %lo(D_80192CA8) # addiu $t7, $t7, 0x2ca8 -/* 0C37B4 800C2BB4 00451021 */ addu $v0, $v0, $a1 -/* 0C37B8 800C2BB8 90422CC6 */ lbu $v0, %lo(D_80192CC6)($v0) # 0x2cc6($v0) -/* 0C37BC 800C2BBC 01CF3021 */ addu $a2, $t6, $t7 -/* 0C37C0 800C2BC0 332400FF */ andi $a0, $t9, 0xff -.L800C2BC4: -/* 0C37C4 800C2BC4 00037040 */ sll $t6, $v1, 1 -/* 0C37C8 800C2BC8 00CE7821 */ addu $t7, $a2, $t6 -/* 0C37CC 800C2BCC 91F90001 */ lbu $t9, 1($t7) -/* 0C37D0 800C2BD0 0099082A */ slt $at, $a0, $t9 -/* 0C37D4 800C2BD4 54200004 */ bnel $at, $zero, .L800C2BE8 -/* 0C37D8 800C2BD8 24630001 */ addiu $v1, $v1, 1 -/* 0C37DC 800C2BDC 306800FF */ andi $t0, $v1, 0xff -/* 0C37E0 800C2BE0 312300FF */ andi $v1, $t1, 0xff -/* 0C37E4 800C2BE4 24630001 */ addiu $v1, $v1, 1 -.L800C2BE8: -/* 0C37E8 800C2BE8 307800FF */ andi $t8, $v1, 0xff -/* 0C37EC 800C2BEC 0302082A */ slt $at, $t8, $v0 -/* 0C37F0 800C2BF0 1420FFF4 */ bnez $at, .L800C2BC4 -/* 0C37F4 800C2BF4 03001825 */ move $v1, $t8 -.L800C2BF8: -/* 0C37F8 800C2BF8 150B0003 */ bne $t0, $t3, .L800C2C08 -/* 0C37FC 800C2BFC 01005025 */ move $t2, $t0 -/* 0C3800 800C2C00 15400027 */ bnez $t2, .L800C2CA0 -/* 0C3804 800C2C04 00000000 */ nop -.L800C2C08: -/* 0C3808 800C2C08 8FD8003C */ lw $t8, 0x3c($fp) -/* 0C380C 800C2C0C 02006825 */ move $t5, $s0 -/* 0C3810 800C2C10 31AE00FF */ andi $t6, $t5, 0xff -/* 0C3814 800C2C14 3207FF00 */ andi $a3, $s0, 0xff00 -/* 0C3818 800C2C18 00077A02 */ srl $t7, $a3, 8 -/* 0C381C 800C2C1C 01C06825 */ move $t5, $t6 -/* 0C3820 800C2C20 31E700FF */ andi $a3, $t7, 0xff -/* 0C3824 800C2C24 00187080 */ sll $t6, $t8, 2 -/* 0C3828 800C2C28 3C0F8019 */ lui $t7, %hi(D_80192CA8) # $t7, 0x8019 -/* 0C382C 800C2C2C 01D87021 */ addu $t6, $t6, $t8 -/* 0C3830 800C2C30 000E7040 */ sll $t6, $t6, 1 -/* 0C3834 800C2C34 25EF2CA8 */ addiu $t7, %lo(D_80192CA8) # addiu $t7, $t7, 0x2ca8 -/* 0C3838 800C2C38 29610005 */ slti $at, $t3, 5 -/* 0C383C 800C2C3C 10200004 */ beqz $at, .L800C2C50 -/* 0C3840 800C2C40 01CF3021 */ addu $a2, $t6, $t7 -/* 0C3844 800C2C44 25390001 */ addiu $t9, $t1, 1 -/* 0C3848 800C2C48 A1990000 */ sb $t9, ($t4) -/* 0C384C 800C2C4C 332B00FF */ andi $t3, $t9, 0xff -.L800C2C50: -/* 0C3850 800C2C50 2563FFFF */ addiu $v1, $t3, -1 -/* 0C3854 800C2C54 306200FF */ andi $v0, $v1, 0xff -/* 0C3858 800C2C58 1142000D */ beq $t2, $v0, .L800C2C90 -/* 0C385C 800C2C5C 00401825 */ move $v1, $v0 -.L800C2C60: -/* 0C3860 800C2C60 00027840 */ sll $t7, $v0, 1 -/* 0C3864 800C2C64 00CF2821 */ addu $a1, $a2, $t7 -/* 0C3868 800C2C68 90B9FFFF */ lbu $t9, -1($a1) -/* 0C386C 800C2C6C 00037040 */ sll $t6, $v1, 1 -/* 0C3870 800C2C70 00CE2021 */ addu $a0, $a2, $t6 -/* 0C3874 800C2C74 A0990001 */ sb $t9, 1($a0) -/* 0C3878 800C2C78 90B8FFFE */ lbu $t8, -2($a1) -/* 0C387C 800C2C7C 2463FFFF */ addiu $v1, $v1, -1 -/* 0C3880 800C2C80 306200FF */ andi $v0, $v1, 0xff -/* 0C3884 800C2C84 00401825 */ move $v1, $v0 -/* 0C3888 800C2C88 1542FFF5 */ bne $t2, $v0, .L800C2C60 -/* 0C388C 800C2C8C A0980000 */ sb $t8, ($a0) -.L800C2C90: -/* 0C3890 800C2C90 00087840 */ sll $t7, $t0, 1 -/* 0C3894 800C2C94 00CF1021 */ addu $v0, $a2, $t7 -/* 0C3898 800C2C98 A0470001 */ sb $a3, 1($v0) -/* 0C389C 800C2C9C A04D0000 */ sb $t5, ($v0) -.L800C2CA0: -/* 0C38A0 800C2CA0 154001E3 */ bnez $t2, .L800C3430 -/* 0C38A4 800C2CA4 02002825 */ move $a1, $s0 -/* 0C38A8 800C2CA8 3C0100FF */ lui $at, 0xff -/* 0C38AC 800C2CAC 02013824 */ and $a3, $s0, $at -/* 0C38B0 800C2CB0 3206FF00 */ andi $a2, $s0, 0xff00 -/* 0C38B4 800C2CB4 0006C202 */ srl $t8, $a2, 8 -/* 0C38B8 800C2CB8 00077B42 */ srl $t7, $a3, 0xd -/* 0C38BC 800C2CBC 30B900FF */ andi $t9, $a1, 0xff -/* 0C38C0 800C2CC0 03202825 */ move $a1, $t9 -/* 0C38C4 800C2CC4 31E7FFFF */ andi $a3, $t7, 0xffff -/* 0C38C8 800C2CC8 330600FF */ andi $a2, $t8, 0xff -/* 0C38CC 800C2CCC 0C030A13 */ jal func_800C284C -/* 0C38D0 800C2CD0 93C4003F */ lbu $a0, 0x3f($fp) -/* 0C38D4 800C2CD4 100001D7 */ b .L800C3434 -/* 0C38D8 800C2CD8 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C2CDC -/* 0C38DC 800C2CDC 3C028019 */ lui $v0, %hi(D_80192CC6) # $v0, 0x8019 -/* 0C38E0 800C2CE0 315800FF */ andi $t8, $t2, 0xff -/* 0C38E4 800C2CE4 24422CC6 */ addiu $v0, %lo(D_80192CC6) # addiu $v0, $v0, 0x2cc6 -/* 0C38E8 800C2CE8 00586021 */ addu $t4, $v0, $t8 -/* 0C38EC 800C2CEC AFD8003C */ sw $t8, 0x3c($fp) -/* 0C38F0 800C2CF0 91890000 */ lbu $t1, ($t4) -/* 0C38F4 800C2CF4 3C028019 */ lui $v0, %hi(D_80192CC6) # 0x8019 -/* 0C38F8 800C2CF8 00001825 */ move $v1, $zero -/* 0C38FC 800C2CFC 01204025 */ move $t0, $t1 -/* 0C3900 800C2D00 19200018 */ blez $t1, .L800C2D64 -/* 0C3904 800C2D04 01205825 */ move $t3, $t1 -/* 0C3908 800C2D08 0018C880 */ sll $t9, $t8, 2 -/* 0C390C 800C2D0C 0338C821 */ addu $t9, $t9, $t8 -/* 0C3910 800C2D10 3C188019 */ lui $t8, %hi(D_80192CA8) # $t8, 0x8019 -/* 0C3914 800C2D14 02002025 */ move $a0, $s0 -/* 0C3918 800C2D18 308F00FF */ andi $t7, $a0, 0xff -/* 0C391C 800C2D1C 27182CA8 */ addiu $t8, %lo(D_80192CA8) # addiu $t8, $t8, 0x2ca8 -/* 0C3920 800C2D20 0019C840 */ sll $t9, $t9, 1 -/* 0C3924 800C2D24 00451021 */ addu $v0, $v0, $a1 -/* 0C3928 800C2D28 90422CC6 */ lbu $v0, %lo(D_80192CC6)($v0) # 0x2cc6($v0) -/* 0C392C 800C2D2C 03383021 */ addu $a2, $t9, $t8 -/* 0C3930 800C2D30 01E02025 */ move $a0, $t7 -.L800C2D34: -/* 0C3934 800C2D34 00037840 */ sll $t7, $v1, 1 -/* 0C3938 800C2D38 00CF7021 */ addu $t6, $a2, $t7 -/* 0C393C 800C2D3C 91D90000 */ lbu $t9, ($t6) -/* 0C3940 800C2D40 54990004 */ bnel $a0, $t9, .L800C2D54 -/* 0C3944 800C2D44 24630001 */ addiu $v1, $v1, 1 -/* 0C3948 800C2D48 306800FF */ andi $t0, $v1, 0xff -/* 0C394C 800C2D4C 312300FF */ andi $v1, $t1, 0xff -/* 0C3950 800C2D50 24630001 */ addiu $v1, $v1, 1 -.L800C2D54: -/* 0C3954 800C2D54 307800FF */ andi $t8, $v1, 0xff -/* 0C3958 800C2D58 0302082A */ slt $at, $t8, $v0 -/* 0C395C 800C2D5C 1420FFF5 */ bnez $at, .L800C2D34 -/* 0C3960 800C2D60 03001825 */ move $v1, $t8 -.L800C2D64: -/* 0C3964 800C2D64 110B001C */ beq $t0, $t3, .L800C2DD8 -/* 0C3968 800C2D68 01005025 */ move $t2, $t0 -/* 0C396C 800C2D6C 2567FFFF */ addiu $a3, $t3, -1 -/* 0C3970 800C2D70 0107082A */ slt $at, $t0, $a3 -/* 0C3974 800C2D74 10200016 */ beqz $at, .L800C2DD0 -/* 0C3978 800C2D78 310300FF */ andi $v1, $t0, 0xff -/* 0C397C 800C2D7C 8FCF003C */ lw $t7, 0x3c($fp) -/* 0C3980 800C2D80 3C198019 */ lui $t9, %hi(D_80192CA8) # $t9, 0x8019 -/* 0C3984 800C2D84 27392CA8 */ addiu $t9, %lo(D_80192CA8) # addiu $t9, $t9, 0x2ca8 -/* 0C3988 800C2D88 000F7080 */ sll $t6, $t7, 2 -/* 0C398C 800C2D8C 01CF7021 */ addu $t6, $t6, $t7 -/* 0C3990 800C2D90 000E7040 */ sll $t6, $t6, 1 -/* 0C3994 800C2D94 01D93021 */ addu $a2, $t6, $t9 -/* 0C3998 800C2D98 00601025 */ move $v0, $v1 -.L800C2D9C: -/* 0C399C 800C2D9C 00027840 */ sll $t7, $v0, 1 -/* 0C39A0 800C2DA0 00CF2821 */ addu $a1, $a2, $t7 -/* 0C39A4 800C2DA4 90AE0003 */ lbu $t6, 3($a1) -/* 0C39A8 800C2DA8 0003C040 */ sll $t8, $v1, 1 -/* 0C39AC 800C2DAC 00D82021 */ addu $a0, $a2, $t8 -/* 0C39B0 800C2DB0 24630001 */ addiu $v1, $v1, 1 -/* 0C39B4 800C2DB4 A08E0001 */ sb $t6, 1($a0) -/* 0C39B8 800C2DB8 90B90002 */ lbu $t9, 2($a1) -/* 0C39BC 800C2DBC 306200FF */ andi $v0, $v1, 0xff -/* 0C39C0 800C2DC0 0047082A */ slt $at, $v0, $a3 -/* 0C39C4 800C2DC4 00401825 */ move $v1, $v0 -/* 0C39C8 800C2DC8 1420FFF4 */ bnez $at, .L800C2D9C -/* 0C39CC 800C2DCC A0990000 */ sb $t9, ($a0) -.L800C2DD0: -/* 0C39D0 800C2DD0 252FFFFF */ addiu $t7, $t1, -1 -/* 0C39D4 800C2DD4 A18F0000 */ sb $t7, ($t4) -.L800C2DD8: -/* 0C39D8 800C2DD8 15400195 */ bnez $t2, .L800C3430 -/* 0C39DC 800C2DDC 3C0100FF */ lui $at, 0xff -/* 0C39E0 800C2DE0 02013824 */ and $a3, $s0, $at -/* 0C39E4 800C2DE4 00077342 */ srl $t6, $a3, 0xd -/* 0C39E8 800C2DE8 31C7FFFF */ andi $a3, $t6, 0xffff -/* 0C39EC 800C2DEC 30E5FFFF */ andi $a1, $a3, 0xffff -/* 0C39F0 800C2DF0 AFC7004C */ sw $a3, 0x4c($fp) -/* 0C39F4 800C2DF4 93C4003F */ lbu $a0, 0x3f($fp) -/* 0C39F8 800C2DF8 0C030A6D */ jal func_800C29B4 -/* 0C39FC 800C2DFC AFCC0034 */ sw $t4, 0x34($fp) -/* 0C3A00 800C2E00 8FCC0034 */ lw $t4, 0x34($fp) -/* 0C3A04 800C2E04 8FC4003C */ lw $a0, 0x3c($fp) -/* 0C3A08 800C2E08 8FC7004C */ lw $a3, 0x4c($fp) -/* 0C3A0C 800C2E0C 91980000 */ lbu $t8, ($t4) -/* 0C3A10 800C2E10 00047880 */ sll $t7, $a0, 2 -/* 0C3A14 800C2E14 01E47821 */ addu $t7, $t7, $a0 -/* 0C3A18 800C2E18 13000185 */ beqz $t8, .L800C3430 -/* 0C3A1C 800C2E1C 000F7840 */ sll $t7, $t7, 1 -/* 0C3A20 800C2E20 3C0E8019 */ lui $t6, %hi(D_80192CA8) # $t6, 0x8019 -/* 0C3A24 800C2E24 25CE2CA8 */ addiu $t6, %lo(D_80192CA8) # addiu $t6, $t6, 0x2ca8 -/* 0C3A28 800C2E28 01EE1021 */ addu $v0, $t7, $t6 -/* 0C3A2C 800C2E2C 90450000 */ lbu $a1, ($v0) -/* 0C3A30 800C2E30 0C030A13 */ jal func_800C284C -/* 0C3A34 800C2E34 90460001 */ lbu $a2, 1($v0) -/* 0C3A38 800C2E38 1000017E */ b .L800C3434 -/* 0C3A3C 800C2E3C 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C2E40 -/* 0C3A40 800C2E40 3C0100FF */ lui $at, 0xff -/* 0C3A44 800C2E44 02011024 */ and $v0, $s0, $at -/* 0C3A48 800C2E48 0002CBC2 */ srl $t9, $v0, 0xf -/* 0C3A4C 800C2E4C 332300FF */ andi $v1, $t9, 0xff -/* 0C3A50 800C2E50 14600004 */ bnez $v1, .L800C2E64 -/* 0C3A54 800C2E54 332500FF */ andi $a1, $t9, 0xff -/* 0C3A58 800C2E58 24650001 */ addiu $a1, $v1, 1 -/* 0C3A5C 800C2E5C 30B800FF */ andi $t8, $a1, 0xff -/* 0C3A60 800C2E60 03002825 */ move $a1, $t8 -.L800C2E64: -/* 0C3A64 800C2E64 314F00FF */ andi $t7, $t2, 0xff -/* 0C3A68 800C2E68 000F70C0 */ sll $t6, $t7, 3 -/* 0C3A6C 800C2E6C 01CF7021 */ addu $t6, $t6, $t7 -/* 0C3A70 800C2E70 000E7080 */ sll $t6, $t6, 2 -/* 0C3A74 800C2E74 01CF7021 */ addu $t6, $t6, $t7 -/* 0C3A78 800C2E78 000E7080 */ sll $t6, $t6, 2 -/* 0C3A7C 800C2E7C 321800FF */ andi $t8, $s0, 0xff -/* 0C3A80 800C2E80 44982000 */ mtc1 $t8, $f4 -/* 0C3A84 800C2E84 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3A88 800C2E88 01CF7023 */ subu $t6, $t6, $t7 -/* 0C3A8C 800C2E8C 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3A90 800C2E90 000E7080 */ sll $t6, $t6, 2 -/* 0C3A94 800C2E94 012E1021 */ addu $v0, $t1, $t6 -/* 0C3A98 800C2E98 07010005 */ bgez $t8, .L800C2EB0 -/* 0C3A9C 800C2E9C 468021A0 */ cvt.s.w $f6, $f4 -/* 0C3AA0 800C2EA0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C3AA4 800C2EA4 44814000 */ mtc1 $at, $f8 -/* 0C3AA8 800C2EA8 00000000 */ nop -/* 0C3AAC 800C2EAC 46083180 */ add.s $f6, $f6, $f8 -.L800C2EB0: -/* 0C3AB0 800C2EB0 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0C3AB4 800C2EB4 44815000 */ mtc1 $at, $f10 -/* 0C3AB8 800C2EB8 C4420000 */ lwc1 $f2, ($v0) -/* 0C3ABC 800C2EBC 460A3003 */ div.s $f0, $f6, $f10 -/* 0C3AC0 800C2EC0 46001032 */ c.eq.s $f2, $f0 -/* 0C3AC4 800C2EC4 E4400004 */ swc1 $f0, 4($v0) -/* 0C3AC8 800C2EC8 4503015A */ bc1tl .L800C3434 -/* 0C3ACC 800C2ECC 8FDF002C */ lw $ra, 0x2c($fp) -/* 0C3AD0 800C2ED0 C4500004 */ lwc1 $f16, 4($v0) -/* 0C3AD4 800C2ED4 44852000 */ mtc1 $a1, $f4 -/* 0C3AD8 800C2ED8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C3ADC 800C2EDC 46101481 */ sub.s $f18, $f2, $f16 -/* 0C3AE0 800C2EE0 04A10004 */ bgez $a1, .L800C2EF4 -/* 0C3AE4 800C2EE4 46802220 */ cvt.s.w $f8, $f4 -/* 0C3AE8 800C2EE8 44813000 */ mtc1 $at, $f6 -/* 0C3AEC 800C2EEC 00000000 */ nop -/* 0C3AF0 800C2EF0 46064200 */ add.s $f8, $f8, $f6 -.L800C2EF4: -/* 0C3AF4 800C2EF4 46089283 */ div.s $f10, $f18, $f8 -/* 0C3AF8 800C2EF8 A445000C */ sh $a1, 0xc($v0) -/* 0C3AFC 800C2EFC 1000014C */ b .L800C3430 -/* 0C3B00 800C2F00 E44A0008 */ swc1 $f10, 8($v0) -glabel L800C2F04 -/* 0C3B04 800C2F04 3C0100FF */ lui $at, 0xff -/* 0C3B08 800C2F08 02011024 */ and $v0, $s0, $at -/* 0C3B0C 800C2F0C 00027BC2 */ srl $t7, $v0, 0xf -/* 0C3B10 800C2F10 31E300FF */ andi $v1, $t7, 0xff -/* 0C3B14 800C2F14 14600004 */ bnez $v1, .L800C2F28 -/* 0C3B18 800C2F18 31E500FF */ andi $a1, $t7, 0xff -/* 0C3B1C 800C2F1C 24650001 */ addiu $a1, $v1, 1 -/* 0C3B20 800C2F20 30AE00FF */ andi $t6, $a1, 0xff -/* 0C3B24 800C2F24 01C02825 */ move $a1, $t6 -.L800C2F28: -/* 0C3B28 800C2F28 44858000 */ mtc1 $a1, $f16 -/* 0C3B2C 800C2F2C 00001825 */ move $v1, $zero -/* 0C3B30 800C2F30 04A10005 */ bgez $a1, .L800C2F48 -/* 0C3B34 800C2F34 468080A0 */ cvt.s.w $f2, $f16 -/* 0C3B38 800C2F38 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C3B3C 800C2F3C 44812000 */ mtc1 $at, $f4 -/* 0C3B40 800C2F40 00000000 */ nop -/* 0C3B44 800C2F44 46041080 */ add.s $f2, $f2, $f4 -.L800C2F48: -/* 0C3B48 800C2F48 314600FF */ andi $a2, $t2, 0xff -/* 0C3B4C 800C2F4C 0006C8C0 */ sll $t9, $a2, 3 -/* 0C3B50 800C2F50 0326C821 */ addu $t9, $t9, $a2 -/* 0C3B54 800C2F54 0019C880 */ sll $t9, $t9, 2 -/* 0C3B58 800C2F58 0326C821 */ addu $t9, $t9, $a2 -/* 0C3B5C 800C2F5C 0019C880 */ sll $t9, $t9, 2 -/* 0C3B60 800C2F60 320EFFFF */ andi $t6, $s0, 0xffff -/* 0C3B64 800C2F64 448E3000 */ mtc1 $t6, $f6 -/* 0C3B68 800C2F68 0326C823 */ subu $t9, $t9, $a2 -/* 0C3B6C 800C2F6C 3C188019 */ lui $t8, %hi(D_801930D0) # $t8, 0x8019 -/* 0C3B70 800C2F70 271830D0 */ addiu $t8, %lo(D_801930D0) # addiu $t8, $t8, 0x30d0 -/* 0C3B74 800C2F74 0019C880 */ sll $t9, $t9, 2 -/* 0C3B78 800C2F78 03382021 */ addu $a0, $t9, $t8 -/* 0C3B7C 800C2F7C 05C10005 */ bgez $t6, .L800C2F94 -/* 0C3B80 800C2F80 468034A0 */ cvt.s.w $f18, $f6 -/* 0C3B84 800C2F84 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C3B88 800C2F88 44814000 */ mtc1 $at, $f8 -/* 0C3B8C 800C2F8C 00000000 */ nop -/* 0C3B90 800C2F90 46089480 */ add.s $f18, $f18, $f8 -.L800C2F94: -/* 0C3B94 800C2F94 3C01447A */ li $at, 0x447A0000 # 1000.000000 -/* 0C3B98 800C2F98 44815000 */ mtc1 $at, $f10 -/* 0C3B9C 800C2F9C 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3BA0 800C2FA0 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3BA4 800C2FA4 460A9003 */ div.s $f0, $f18, $f10 -.L800C2FA8: -/* 0C3BA8 800C2FA8 0003C940 */ sll $t9, $v1, 5 -/* 0C3BAC 800C2FAC 00991021 */ addu $v0, $a0, $t9 -/* 0C3BB0 800C2FB0 C4500054 */ lwc1 $f16, 0x54($v0) -/* 0C3BB4 800C2FB4 24630001 */ addiu $v1, $v1, 1 -/* 0C3BB8 800C2FB8 307800FF */ andi $t8, $v1, 0xff -/* 0C3BBC 800C2FBC 46008101 */ sub.s $f4, $f16, $f0 -/* 0C3BC0 800C2FC0 2B010010 */ slti $at, $t8, 0x10 -/* 0C3BC4 800C2FC4 03001825 */ move $v1, $t8 -/* 0C3BC8 800C2FC8 E4400058 */ swc1 $f0, 0x58($v0) -/* 0C3BCC 800C2FCC 46022183 */ div.s $f6, $f4, $f2 -/* 0C3BD0 800C2FD0 A4450060 */ sh $a1, 0x60($v0) -/* 0C3BD4 800C2FD4 1420FFF4 */ bnez $at, .L800C2FA8 -/* 0C3BD8 800C2FD8 E446005C */ swc1 $f6, 0x5c($v0) -/* 0C3BDC 800C2FDC 000670C0 */ sll $t6, $a2, 3 -/* 0C3BE0 800C2FE0 01C67021 */ addu $t6, $t6, $a2 -/* 0C3BE4 800C2FE4 000E7080 */ sll $t6, $t6, 2 -/* 0C3BE8 800C2FE8 01C67021 */ addu $t6, $t6, $a2 -/* 0C3BEC 800C2FEC 000E7080 */ sll $t6, $t6, 2 -/* 0C3BF0 800C2FF0 01C67023 */ subu $t6, $t6, $a2 -/* 0C3BF4 800C2FF4 000E7080 */ sll $t6, $t6, 2 -/* 0C3BF8 800C2FF8 012EC821 */ addu $t9, $t1, $t6 -/* 0C3BFC 800C2FFC 340FFFFF */ li $t7, 65535 -/* 0C3C00 800C3000 1000010B */ b .L800C3430 -/* 0C3C04 800C3004 A72F0244 */ sh $t7, 0x244($t9) -glabel L800C3008 -/* 0C3C08 800C3008 3C0100FF */ lui $at, 0xff -/* 0C3C0C 800C300C 02011024 */ and $v0, $s0, $at -/* 0C3C10 800C3010 0002C3C2 */ srl $t8, $v0, 0xf -/* 0C3C14 800C3014 330300FF */ andi $v1, $t8, 0xff -/* 0C3C18 800C3018 14600004 */ bnez $v1, .L800C302C -/* 0C3C1C 800C301C 330500FF */ andi $a1, $t8, 0xff -/* 0C3C20 800C3020 24650001 */ addiu $a1, $v1, 1 -/* 0C3C24 800C3024 30AE00FF */ andi $t6, $a1, 0xff -/* 0C3C28 800C3028 01C02825 */ move $a1, $t6 -.L800C302C: -/* 0C3C2C 800C302C 314700FF */ andi $a3, $t2, 0xff -/* 0C3C30 800C3030 0007C0C0 */ sll $t8, $a3, 3 -/* 0C3C34 800C3034 0307C021 */ addu $t8, $t8, $a3 -/* 0C3C38 800C3038 0018C080 */ sll $t8, $t8, 2 -/* 0C3C3C 800C303C 0307C021 */ addu $t8, $t8, $a3 -/* 0C3C40 800C3040 0018C080 */ sll $t8, $t8, 2 -/* 0C3C44 800C3044 32060F00 */ andi $a2, $s0, 0xf00 -/* 0C3C48 800C3048 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3C4C 800C304C 00067A02 */ srl $t7, $a2, 8 -/* 0C3C50 800C3050 0307C023 */ subu $t8, $t8, $a3 -/* 0C3C54 800C3054 321900FF */ andi $t9, $s0, 0xff -/* 0C3C58 800C3058 44994000 */ mtc1 $t9, $f8 -/* 0C3C5C 800C305C 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3C60 800C3060 0018C080 */ sll $t8, $t8, 2 -/* 0C3C64 800C3064 31E600FF */ andi $a2, $t7, 0xff -/* 0C3C68 800C3068 00062140 */ sll $a0, $a2, 5 -/* 0C3C6C 800C306C 01387021 */ addu $t6, $t1, $t8 -/* 0C3C70 800C3070 01C41021 */ addu $v0, $t6, $a0 -/* 0C3C74 800C3074 07210005 */ bgez $t9, .L800C308C -/* 0C3C78 800C3078 468044A0 */ cvt.s.w $f18, $f8 -/* 0C3C7C 800C307C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C3C80 800C3080 44815000 */ mtc1 $at, $f10 -/* 0C3C84 800C3084 00000000 */ nop -/* 0C3C88 800C3088 460A9480 */ add.s $f18, $f18, $f10 -.L800C308C: -/* 0C3C8C 800C308C 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0C3C90 800C3090 44818000 */ mtc1 $at, $f16 -/* 0C3C94 800C3094 C4440044 */ lwc1 $f4, 0x44($v0) -/* 0C3C98 800C3098 46109003 */ div.s $f0, $f18, $f16 -/* 0C3C9C 800C309C 46002032 */ c.eq.s $f4, $f0 -/* 0C3CA0 800C30A0 E4400048 */ swc1 $f0, 0x48($v0) -/* 0C3CA4 800C30A4 450100E2 */ bc1t .L800C3430 -/* 0C3CA8 800C30A8 0007C0C0 */ sll $t8, $a3, 3 -/* 0C3CAC 800C30AC 0307C021 */ addu $t8, $t8, $a3 -/* 0C3CB0 800C30B0 0018C080 */ sll $t8, $t8, 2 -/* 0C3CB4 800C30B4 0307C021 */ addu $t8, $t8, $a3 -/* 0C3CB8 800C30B8 0018C080 */ sll $t8, $t8, 2 -/* 0C3CBC 800C30BC 0307C023 */ subu $t8, $t8, $a3 -/* 0C3CC0 800C30C0 0018C080 */ sll $t8, $t8, 2 -/* 0C3CC4 800C30C4 01381021 */ addu $v0, $t1, $t8 -/* 0C3CC8 800C30C8 00441821 */ addu $v1, $v0, $a0 -/* 0C3CCC 800C30CC C4660044 */ lwc1 $f6, 0x44($v1) -/* 0C3CD0 800C30D0 C4680048 */ lwc1 $f8, 0x48($v1) -/* 0C3CD4 800C30D4 44859000 */ mtc1 $a1, $f18 -/* 0C3CD8 800C30D8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C3CDC 800C30DC 46083281 */ sub.s $f10, $f6, $f8 -/* 0C3CE0 800C30E0 04A10004 */ bgez $a1, .L800C30F4 -/* 0C3CE4 800C30E4 46809420 */ cvt.s.w $f16, $f18 -/* 0C3CE8 800C30E8 44812000 */ mtc1 $at, $f4 -/* 0C3CEC 800C30EC 00000000 */ nop -/* 0C3CF0 800C30F0 46048400 */ add.s $f16, $f16, $f4 -.L800C30F4: -/* 0C3CF4 800C30F4 46105183 */ div.s $f6, $f10, $f16 -/* 0C3CF8 800C30F8 A4650050 */ sh $a1, 0x50($v1) -/* 0C3CFC 800C30FC 240F0001 */ li $t7, 1 -/* 0C3D00 800C3100 00CFC804 */ sllv $t9, $t7, $a2 -/* 0C3D04 800C3104 E466004C */ swc1 $f6, 0x4c($v1) -/* 0C3D08 800C3108 944E0244 */ lhu $t6, 0x244($v0) -/* 0C3D0C 800C310C 01D9C025 */ or $t8, $t6, $t9 -/* 0C3D10 800C3110 100000C7 */ b .L800C3430 -/* 0C3D14 800C3114 A4580244 */ sh $t8, 0x244($v0) -glabel L800C3118 -/* 0C3D18 800C3118 314E00FF */ andi $t6, $t2, 0xff -/* 0C3D1C 800C311C 000ECC00 */ sll $t9, $t6, 0x10 -/* 0C3D20 800C3120 3C014600 */ lui $at, 0x4600 -/* 0C3D24 800C3124 0321C025 */ or $t8, $t9, $at -/* 0C3D28 800C3128 3C0100FF */ lui $at, 0xff -/* 0C3D2C 800C312C 02017824 */ and $t7, $s0, $at -/* 0C3D30 800C3130 000FCC02 */ srl $t9, $t7, 0x10 -/* 0C3D34 800C3134 332F00FF */ andi $t7, $t9, 0xff -/* 0C3D38 800C3138 000F7200 */ sll $t6, $t7, 8 -/* 0C3D3C 800C313C 00107E00 */ sll $t7, $s0, 0x18 -/* 0C3D40 800C3140 000F2E03 */ sra $a1, $t7, 0x18 -/* 0C3D44 800C3144 0C032EFA */ jal func_800CBBE8 -/* 0C3D48 800C3148 030E2025 */ or $a0, $t8, $t6 -/* 0C3D4C 800C314C 100000B9 */ b .L800C3434 -/* 0C3D50 800C3150 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C3154 -/* 0C3D54 800C3154 314200FF */ andi $v0, $t2, 0xff -/* 0C3D58 800C3158 000278C0 */ sll $t7, $v0, 3 -/* 0C3D5C 800C315C 01E27821 */ addu $t7, $t7, $v0 -/* 0C3D60 800C3160 000F7880 */ sll $t7, $t7, 2 -/* 0C3D64 800C3164 01E27821 */ addu $t7, $t7, $v0 -/* 0C3D68 800C3168 000F7880 */ sll $t7, $t7, 2 -/* 0C3D6C 800C316C 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3D70 800C3170 01E27823 */ subu $t7, $t7, $v0 -/* 0C3D74 800C3174 32060F00 */ andi $a2, $s0, 0xf00 -/* 0C3D78 800C3178 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3D7C 800C317C 00067202 */ srl $t6, $a2, 8 -/* 0C3D80 800C3180 000F7880 */ sll $t7, $t7, 2 -/* 0C3D84 800C3184 012FC021 */ addu $t8, $t1, $t7 -/* 0C3D88 800C3188 31C600FF */ andi $a2, $t6, 0xff -/* 0C3D8C 800C318C 970E024A */ lhu $t6, 0x24a($t8) -/* 0C3D90 800C3190 24190001 */ li $t9, 1 -/* 0C3D94 800C3194 00D97804 */ sllv $t7, $t9, $a2 -/* 0C3D98 800C3198 01CFC024 */ and $t8, $t6, $t7 -/* 0C3D9C 800C319C 170000A4 */ bnez $t8, .L800C3430 -/* 0C3DA0 800C31A0 305900FF */ andi $t9, $v0, 0xff -/* 0C3DA4 800C31A4 00197400 */ sll $t6, $t9, 0x10 -/* 0C3DA8 800C31A8 3C010600 */ lui $at, 0x600 -/* 0C3DAC 800C31AC 30D800FF */ andi $t8, $a2, 0xff -/* 0C3DB0 800C31B0 0018CA00 */ sll $t9, $t8, 8 -/* 0C3DB4 800C31B4 01C17825 */ or $t7, $t6, $at -/* 0C3DB8 800C31B8 3C0100FF */ lui $at, 0xff -/* 0C3DBC 800C31BC 0201C024 */ and $t8, $s0, $at -/* 0C3DC0 800C31C0 01F97025 */ or $t6, $t7, $t9 -/* 0C3DC4 800C31C4 0018CC02 */ srl $t9, $t8, 0x10 -/* 0C3DC8 800C31C8 333800FF */ andi $t8, $t9, 0xff -/* 0C3DCC 800C31CC 0010CE00 */ sll $t9, $s0, 0x18 -/* 0C3DD0 800C31D0 00192E03 */ sra $a1, $t9, 0x18 -/* 0C3DD4 800C31D4 0C032EFA */ jal func_800CBBE8 -/* 0C3DD8 800C31D8 01D82025 */ or $a0, $t6, $t8 -/* 0C3DDC 800C31DC 10000095 */ b .L800C3434 -/* 0C3DE0 800C31E0 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C31E4 -/* 0C3DE4 800C31E4 314F00FF */ andi $t7, $t2, 0xff -/* 0C3DE8 800C31E8 000FC8C0 */ sll $t9, $t7, 3 -/* 0C3DEC 800C31EC 032FC821 */ addu $t9, $t9, $t7 -/* 0C3DF0 800C31F0 0019C880 */ sll $t9, $t9, 2 -/* 0C3DF4 800C31F4 032FC821 */ addu $t9, $t9, $t7 -/* 0C3DF8 800C31F8 0019C880 */ sll $t9, $t9, 2 -/* 0C3DFC 800C31FC 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3E00 800C3200 032FC823 */ subu $t9, $t9, $t7 -/* 0C3E04 800C3204 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3E08 800C3208 0019C880 */ sll $t9, $t9, 2 -/* 0C3E0C 800C320C 01397021 */ addu $t6, $t1, $t9 -/* 0C3E10 800C3210 10000087 */ b .L800C3430 -/* 0C3E14 800C3214 A5D0024A */ sh $s0, 0x24a($t6) -glabel L800C3218 -/* 0C3E18 800C3218 315900FF */ andi $t9, $t2, 0xff -/* 0C3E1C 800C321C 0019C400 */ sll $t8, $t9, 0x10 -/* 0C3E20 800C3220 3C010800 */ lui $at, 0x800 -/* 0C3E24 800C3224 02003825 */ move $a3, $s0 -/* 0C3E28 800C3228 30EFFFFF */ andi $t7, $a3, 0xffff -/* 0C3E2C 800C322C 03017025 */ or $t6, $t8, $at -/* 0C3E30 800C3230 24040001 */ li $a0, 1 -/* 0C3E34 800C3234 AFCE0048 */ sw $t6, 0x48($fp) -/* 0C3E38 800C3238 01E03825 */ move $a3, $t7 -/* 0C3E3C 800C323C 00001825 */ move $v1, $zero -.L800C3240: -/* 0C3E40 800C3240 00E4C824 */ and $t9, $a3, $a0 -/* 0C3E44 800C3244 13200003 */ beqz $t9, .L800C3254 -/* 0C3E48 800C3248 00801025 */ move $v0, $a0 -/* 0C3E4C 800C324C 10000002 */ b .L800C3258 -/* 0C3E50 800C3250 24060001 */ li $a2, 1 -.L800C3254: -/* 0C3E54 800C3254 00003025 */ move $a2, $zero -.L800C3258: -/* 0C3E58 800C3258 8FD80048 */ lw $t8, 0x48($fp) -/* 0C3E5C 800C325C 306E00FF */ andi $t6, $v1, 0xff -/* 0C3E60 800C3260 00062E00 */ sll $a1, $a2, 0x18 -/* 0C3E64 800C3264 0005CE03 */ sra $t9, $a1, 0x18 -/* 0C3E68 800C3268 000E7A00 */ sll $t7, $t6, 8 -/* 0C3E6C 800C326C 03202825 */ move $a1, $t9 -/* 0C3E70 800C3270 AFC2004C */ sw $v0, 0x4c($fp) -/* 0C3E74 800C3274 A3C3005B */ sb $v1, 0x5b($fp) -/* 0C3E78 800C3278 AFC70044 */ sw $a3, 0x44($fp) -/* 0C3E7C 800C327C 0C032EFA */ jal func_800CBBE8 -/* 0C3E80 800C3280 030F2025 */ or $a0, $t8, $t7 -/* 0C3E84 800C3284 93C3005B */ lbu $v1, 0x5b($fp) -/* 0C3E88 800C3288 8FC2004C */ lw $v0, 0x4c($fp) -/* 0C3E8C 800C328C 8FC70044 */ lw $a3, 0x44($fp) -/* 0C3E90 800C3290 24630001 */ addiu $v1, $v1, 1 -/* 0C3E94 800C3294 307800FF */ andi $t8, $v1, 0xff -/* 0C3E98 800C3298 00022040 */ sll $a0, $v0, 1 -/* 0C3E9C 800C329C 2B010010 */ slti $at, $t8, 0x10 -/* 0C3EA0 800C32A0 308EFFFF */ andi $t6, $a0, 0xffff -/* 0C3EA4 800C32A4 03001825 */ move $v1, $t8 -/* 0C3EA8 800C32A8 1420FFE5 */ bnez $at, .L800C3240 -/* 0C3EAC 800C32AC 01C02025 */ move $a0, $t6 -/* 0C3EB0 800C32B0 10000060 */ b .L800C3434 -/* 0C3EB4 800C32B4 8FDF002C */ lw $ra, 0x2c($fp) -glabel L800C32B8 -/* 0C3EB8 800C32B8 314F00FF */ andi $t7, $t2, 0xff -/* 0C3EBC 800C32BC 000FC8C0 */ sll $t9, $t7, 3 -/* 0C3EC0 800C32C0 032FC821 */ addu $t9, $t9, $t7 -/* 0C3EC4 800C32C4 0019C880 */ sll $t9, $t9, 2 -/* 0C3EC8 800C32C8 032FC821 */ addu $t9, $t9, $t7 -/* 0C3ECC 800C32CC 0019C880 */ sll $t9, $t9, 2 -/* 0C3ED0 800C32D0 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3ED4 800C32D4 032FC823 */ subu $t9, $t9, $t7 -/* 0C3ED8 800C32D8 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3EDC 800C32DC 0019C880 */ sll $t9, $t9, 2 -/* 0C3EE0 800C32E0 01397021 */ addu $t6, $t1, $t9 -/* 0C3EE4 800C32E4 10000052 */ b .L800C3430 -/* 0C3EE8 800C32E8 ADD00014 */ sw $s0, 0x14($t6) -glabel L800C32EC -/* 0C3EEC 800C32EC 3C0100F0 */ lui $at, 0xf0 -/* 0C3EF0 800C32F0 0201C024 */ and $t8, $s0, $at -/* 0C3EF4 800C32F4 00187D02 */ srl $t7, $t8, 0x14 -/* 0C3EF8 800C32F8 31F900FF */ andi $t9, $t7, 0xff -/* 0C3EFC 800C32FC 2401000F */ li $at, 15 -/* 0C3F00 800C3300 13210016 */ beq $t9, $at, .L800C335C -/* 0C3F04 800C3304 314E00FF */ andi $t6, $t2, 0xff -/* 0C3F08 800C3308 000EC0C0 */ sll $t8, $t6, 3 -/* 0C3F0C 800C330C 030EC021 */ addu $t8, $t8, $t6 -/* 0C3F10 800C3310 0018C080 */ sll $t8, $t8, 2 -/* 0C3F14 800C3314 030EC021 */ addu $t8, $t8, $t6 -/* 0C3F18 800C3318 0018C080 */ sll $t8, $t8, 2 -/* 0C3F1C 800C331C 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3F20 800C3320 030EC023 */ subu $t8, $t8, $t6 -/* 0C3F24 800C3324 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3F28 800C3328 0018C080 */ sll $t8, $t8, 2 -/* 0C3F2C 800C332C 01381021 */ addu $v0, $t1, $t8 -/* 0C3F30 800C3330 90480041 */ lbu $t0, 0x41($v0) -/* 0C3F34 800C3334 24180002 */ li $t8, 2 -/* 0C3F38 800C3338 250F0001 */ addiu $t7, $t0, 1 -/* 0C3F3C 800C333C 29010005 */ slti $at, $t0, 5 -/* 0C3F40 800C3340 1020003B */ beqz $at, .L800C3430 -/* 0C3F44 800C3344 A04F0041 */ sb $t7, 0x41($v0) -/* 0C3F48 800C3348 0008C880 */ sll $t9, $t0, 2 -/* 0C3F4C 800C334C 00597021 */ addu $t6, $v0, $t9 -/* 0C3F50 800C3350 ADD0002C */ sw $s0, 0x2c($t6) -/* 0C3F54 800C3354 10000036 */ b .L800C3430 -/* 0C3F58 800C3358 A0580040 */ sb $t8, 0x40($v0) -.L800C335C: -/* 0C3F5C 800C335C 314F00FF */ andi $t7, $t2, 0xff -/* 0C3F60 800C3360 000FC8C0 */ sll $t9, $t7, 3 -/* 0C3F64 800C3364 032FC821 */ addu $t9, $t9, $t7 -/* 0C3F68 800C3368 0019C880 */ sll $t9, $t9, 2 -/* 0C3F6C 800C336C 032FC821 */ addu $t9, $t9, $t7 -/* 0C3F70 800C3370 0019C880 */ sll $t9, $t9, 2 -/* 0C3F74 800C3374 3C098019 */ lui $t1, %hi(D_801930D0) # $t1, 0x8019 -/* 0C3F78 800C3378 032FC823 */ subu $t9, $t9, $t7 -/* 0C3F7C 800C337C 252930D0 */ addiu $t1, %lo(D_801930D0) # addiu $t1, $t1, 0x30d0 -/* 0C3F80 800C3380 0019C880 */ sll $t9, $t9, 2 -/* 0C3F84 800C3384 01397021 */ addu $t6, $t1, $t9 -/* 0C3F88 800C3388 10000029 */ b .L800C3430 -/* 0C3F8C 800C338C A1C00041 */ sb $zero, 0x41($t6) -glabel L800C3390 -/* 0C3F90 800C3390 32020F00 */ andi $v0, $s0, 0xf00 -/* 0C3F94 800C3394 0002C202 */ srl $t8, $v0, 8 -/* 0C3F98 800C3398 330F00FF */ andi $t7, $t8, 0xff -/* 0C3F9C 800C339C 11E00006 */ beqz $t7, .L800C33B8 -/* 0C3FA0 800C33A0 3C04F000 */ lui $a0, 0xf000 -/* 0C3FA4 800C33A4 24010001 */ li $at, 1 -/* 0C3FA8 800C33A8 11E1000A */ beq $t7, $at, .L800C33D4 -/* 0C3FAC 800C33AC 32190001 */ andi $t9, $s0, 1 -/* 0C3FB0 800C33B0 10000020 */ b .L800C3434 -/* 0C3FB4 800C33B4 8FDF002C */ lw $ra, 0x2c($fp) -.L800C33B8: -/* 0C3FB8 800C33B8 320E00FF */ andi $t6, $s0, 0xff -/* 0C3FBC 800C33BC 3C05800F */ lui $a1, %hi(D_800EA1F0) -/* 0C3FC0 800C33C0 00AE2821 */ addu $a1, $a1, $t6 -/* 0C3FC4 800C33C4 0C032EEE */ jal func_800CBBB8 -/* 0C3FC8 800C33C8 90A5A1F0 */ lbu $a1, %lo(D_800EA1F0)($a1) -/* 0C3FCC 800C33CC 10000019 */ b .L800C3434 -/* 0C3FD0 800C33D0 8FDF002C */ lw $ra, 0x2c($fp) -.L800C33D4: -/* 0C3FD4 800C33D4 3C01800F */ lui $at, %hi(D_800EA1EC) # $at, 0x800f -/* 0C3FD8 800C33D8 10000015 */ b .L800C3430 -/* 0C3FDC 800C33DC A039A1EC */ sb $t9, %lo(D_800EA1EC)($at) -glabel L800C33E0 -/* 0C3FE0 800C33E0 3202FF00 */ andi $v0, $s0, 0xff00 -/* 0C3FE4 800C33E4 00027202 */ srl $t6, $v0, 8 -/* 0C3FE8 800C33E8 3C01800F */ lui $at, %hi(D_800EA1C0) # $at, 0x800f -/* 0C3FEC 800C33EC 02001825 */ move $v1, $s0 -/* 0C3FF0 800C33F0 A02EA1C0 */ sb $t6, %lo(D_800EA1C0)($at) -/* 0C3FF4 800C33F4 306400FF */ andi $a0, $v1, 0xff -/* 0C3FF8 800C33F8 00801825 */ move $v1, $a0 -/* 0C3FFC 800C33FC AFC40048 */ sw $a0, 0x48($fp) -/* 0C4000 800C3400 0C0304FF */ jal audio_reset_session_eu -/* 0C4004 800C3404 AFCE004C */ sw $t6, 0x4c($fp) -/* 0C4008 800C3408 8FC5004C */ lw $a1, 0x4c($fp) -/* 0C400C 800C340C 8FCD0048 */ lw $t5, 0x48($fp) -/* 0C4010 800C3410 3C01800F */ lui $at, %hi(D_800EA1F4) # $at, 0x800f -/* 0C4014 800C3414 00057E00 */ sll $t7, $a1, 0x18 -/* 0C4018 800C3418 000F2E03 */ sra $a1, $t7, 0x18 -/* 0C401C 800C341C 3C044602 */ lui $a0, 0x4602 -/* 0C4020 800C3420 0C032EFA */ jal func_800CBBE8 -/* 0C4024 800C3424 A02DA1F4 */ sb $t5, %lo(D_800EA1F4)($at) -/* 0C4028 800C3428 0C031710 */ jal func_800C5C40 -/* 0C402C 800C342C 00000000 */ nop -.L800C3430: -glabel L800C3430 -/* 0C4030 800C3430 8FDF002C */ lw $ra, 0x2c($fp) -.L800C3434: -/* 0C4034 800C3434 03C0E825 */ move $sp, $fp -/* 0C4038 800C3438 8FD00024 */ lw $s0, 0x24($fp) -/* 0C403C 800C343C 8FDE0028 */ lw $fp, 0x28($fp) -/* 0C4040 800C3440 03E00008 */ jr $ra -/* 0C4044 800C3444 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/asm/non_matchings/audio/external/func_800C3724.s b/asm/non_matchings/audio/external/func_800C3724.s deleted file mode 100644 index 5c68a2a098..0000000000 --- a/asm/non_matchings/audio/external/func_800C3724.s +++ /dev/null @@ -1,593 +0,0 @@ -.section .late_rodata - -glabel jpt_800F362C -.word L800C3DEC, L800C3E10, L800C3E30, L800C3E70 -.word L800C3E98, L800C3EBC, L800C3F04 - -.section .text - -glabel func_800C3724 -/* 0C4324 800C3724 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 0C4328 800C3728 AFB60048 */ sw $s6, 0x48($sp) -/* 0C432C 800C372C F7B40028 */ sdc1 $f20, 0x28($sp) -/* 0C4330 800C3730 3C0142FE */ li $at, 0x42FE0000 # 127.000000 -/* 0C4334 800C3734 AFBE0050 */ sw $fp, 0x50($sp) -/* 0C4338 800C3738 AFB7004C */ sw $s7, 0x4c($sp) -/* 0C433C 800C373C AFB50044 */ sw $s5, 0x44($sp) -/* 0C4340 800C3740 3C168019 */ lui $s6, %hi(D_801930D0) # $s6, 0x8019 -/* 0C4344 800C3744 4481A000 */ mtc1 $at, $f20 -/* 0C4348 800C3748 03A0F025 */ move $fp, $sp -/* 0C434C 800C374C AFBF0054 */ sw $ra, 0x54($sp) -/* 0C4350 800C3750 AFB40040 */ sw $s4, 0x40($sp) -/* 0C4354 800C3754 AFB3003C */ sw $s3, 0x3c($sp) -/* 0C4358 800C3758 AFB20038 */ sw $s2, 0x38($sp) -/* 0C435C 800C375C AFB10034 */ sw $s1, 0x34($sp) -/* 0C4360 800C3760 AFB00030 */ sw $s0, 0x30($sp) -/* 0C4364 800C3764 26D630D0 */ addiu $s6, %lo(D_801930D0) # addiu $s6, $s6, 0x30d0 -/* 0C4368 800C3768 0000A825 */ move $s5, $zero -/* 0C436C 800C376C 2417024C */ li $s7, 588 -.L800C3770: -/* 0C4370 800C3770 02B70019 */ multu $s5, $s7 -/* 0C4374 800C3774 00007012 */ mflo $t6 -/* 0C4378 800C3778 02CE9821 */ addu $s3, $s6, $t6 -/* 0C437C 800C377C 926F0012 */ lbu $t7, 0x12($s3) -/* 0C4380 800C3780 11E00048 */ beqz $t7, .L800C38A4 -/* 0C4384 800C3784 0015C0C0 */ sll $t8, $s5, 3 -/* 0C4388 800C3788 0315C021 */ addu $t8, $t8, $s5 -/* 0C438C 800C378C 0018C080 */ sll $t8, $t8, 2 -/* 0C4390 800C3790 0315C021 */ addu $t8, $t8, $s5 -/* 0C4394 800C3794 0018C080 */ sll $t8, $t8, 2 -/* 0C4398 800C3798 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C439C 800C379C 0315C023 */ subu $t8, $t8, $s5 -/* 0C43A0 800C37A0 0018C080 */ sll $t8, $t8, 2 -/* 0C43A4 800C37A4 44810000 */ mtc1 $at, $f0 -/* 0C43A8 800C37A8 02D8A021 */ addu $s4, $s6, $t8 -/* 0C43AC 800C37AC 00009025 */ move $s2, $zero -/* 0C43B0 800C37B0 02A01025 */ move $v0, $s5 -/* 0C43B4 800C37B4 0292C821 */ addu $t9, $s4, $s2 -.L800C37B8: -/* 0C43B8 800C37B8 932A000E */ lbu $t2, 0xe($t9) -/* 0C43BC 800C37BC 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C43C0 800C37C0 448A2000 */ mtc1 $t2, $f4 -/* 0C43C4 800C37C4 05410004 */ bgez $t2, .L800C37D8 -/* 0C43C8 800C37C8 468021A0 */ cvt.s.w $f6, $f4 -/* 0C43CC 800C37CC 44814000 */ mtc1 $at, $f8 -/* 0C43D0 800C37D0 00000000 */ nop -/* 0C43D4 800C37D4 46083180 */ add.s $f6, $f6, $f8 -.L800C37D8: -/* 0C43D8 800C37D8 46143283 */ div.s $f10, $f6, $f20 -/* 0C43DC 800C37DC 26520001 */ addiu $s2, $s2, 1 -/* 0C43E0 800C37E0 324B00FF */ andi $t3, $s2, 0xff -/* 0C43E4 800C37E4 29610003 */ slti $at, $t3, 3 -/* 0C43E8 800C37E8 01609025 */ move $s2, $t3 -/* 0C43EC 800C37EC 460A0002 */ mul.s $f0, $f0, $f10 -/* 0C43F0 800C37F0 5420FFF1 */ bnel $at, $zero, .L800C37B8 -/* 0C43F4 800C37F4 0292C821 */ addu $t9, $s4, $s2 -/* 0C43F8 800C37F8 46140402 */ mul.s $f16, $f0, $f20 -/* 0C43FC 800C37FC 240A0001 */ li $t2, 1 -/* 0C4400 800C3800 926C0011 */ lbu $t4, 0x11($s3) -/* 0C4404 800C3804 3C014000 */ lui $at, 0x4000 -/* 0C4408 800C3808 00027E00 */ sll $t7, $v0, 0x18 -/* 0C440C 800C380C 000C6C00 */ sll $t5, $t4, 0x10 -/* 0C4410 800C3810 01A17025 */ or $t6, $t5, $at -/* 0C4414 800C3814 4459F800 */ cfc1 $t9, $31 -/* 0C4418 800C3818 44CAF800 */ ctc1 $t2, $31 -/* 0C441C 800C381C 01CFC025 */ or $t8, $t6, $t7 -/* 0C4420 800C3820 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 0C4424 800C3824 460084A4 */ cvt.w.s $f18, $f16 -/* 0C4428 800C3828 444AF800 */ cfc1 $t2, $31 -/* 0C442C 800C382C 00000000 */ nop -/* 0C4430 800C3830 314A0078 */ andi $t2, $t2, 0x78 -/* 0C4434 800C3834 51400013 */ beql $t2, $zero, .L800C3884 -/* 0C4438 800C3838 440A9000 */ mfc1 $t2, $f18 -/* 0C443C 800C383C 44819000 */ mtc1 $at, $f18 -/* 0C4440 800C3840 240A0001 */ li $t2, 1 -/* 0C4444 800C3844 46128481 */ sub.s $f18, $f16, $f18 -/* 0C4448 800C3848 44CAF800 */ ctc1 $t2, $31 -/* 0C444C 800C384C 00000000 */ nop -/* 0C4450 800C3850 460094A4 */ cvt.w.s $f18, $f18 -/* 0C4454 800C3854 444AF800 */ cfc1 $t2, $31 -/* 0C4458 800C3858 00000000 */ nop -/* 0C445C 800C385C 314A0078 */ andi $t2, $t2, 0x78 -/* 0C4460 800C3860 15400005 */ bnez $t2, .L800C3878 -/* 0C4464 800C3864 00000000 */ nop -/* 0C4468 800C3868 440A9000 */ mfc1 $t2, $f18 -/* 0C446C 800C386C 3C018000 */ lui $at, 0x8000 -/* 0C4470 800C3870 10000007 */ b .L800C3890 -/* 0C4474 800C3874 01415025 */ or $t2, $t2, $at -.L800C3878: -/* 0C4478 800C3878 10000005 */ b .L800C3890 -/* 0C447C 800C387C 240AFFFF */ li $t2, -1 -/* 0C4480 800C3880 440A9000 */ mfc1 $t2, $f18 -.L800C3884: -/* 0C4484 800C3884 00000000 */ nop -/* 0C4488 800C3888 0540FFFB */ bltz $t2, .L800C3878 -/* 0C448C 800C388C 00000000 */ nop -.L800C3890: -/* 0C4490 800C3890 44D9F800 */ ctc1 $t9, $31 -/* 0C4494 800C3894 314B00FF */ andi $t3, $t2, 0xff -/* 0C4498 800C3898 0C030D12 */ jal func_800C3448 -/* 0C449C 800C389C 030B2025 */ or $a0, $t8, $t3 -/* 0C44A0 800C38A0 A2600012 */ sb $zero, 0x12($s3) -.L800C38A4: -/* 0C44A4 800C38A4 9662000C */ lhu $v0, 0xc($s3) -/* 0C44A8 800C38A8 10400011 */ beqz $v0, .L800C38F0 -/* 0C44AC 800C38AC 244CFFFF */ addiu $t4, $v0, -1 -/* 0C44B0 800C38B0 318DFFFF */ andi $t5, $t4, 0xffff -/* 0C44B4 800C38B4 11A00006 */ beqz $t5, .L800C38D0 -/* 0C44B8 800C38B8 A66C000C */ sh $t4, 0xc($s3) -/* 0C44BC 800C38BC C6640000 */ lwc1 $f4, ($s3) -/* 0C44C0 800C38C0 C6680008 */ lwc1 $f8, 8($s3) -/* 0C44C4 800C38C4 46082181 */ sub.s $f6, $f4, $f8 -/* 0C44C8 800C38C8 10000003 */ b .L800C38D8 -/* 0C44CC 800C38CC E6660000 */ swc1 $f6, ($s3) -.L800C38D0: -/* 0C44D0 800C38D0 C66A0004 */ lwc1 $f10, 4($s3) -/* 0C44D4 800C38D4 E66A0000 */ swc1 $f10, ($s3) -.L800C38D8: -/* 0C44D8 800C38D8 32A400FF */ andi $a0, $s5, 0xff -/* 0C44DC 800C38DC 00047400 */ sll $t6, $a0, 0x10 -/* 0C44E0 800C38E0 3C014100 */ lui $at, 0x4100 -/* 0C44E4 800C38E4 01C12025 */ or $a0, $t6, $at -/* 0C44E8 800C38E8 0C032EE2 */ jal func_800CBB88 -/* 0C44EC 800C38EC 8E650000 */ lw $a1, ($s3) -.L800C38F0: -/* 0C44F0 800C38F0 8E650014 */ lw $a1, 0x14($s3) -/* 0C44F4 800C38F4 10A00093 */ beqz $a1, .L800C3B44 -/* 0C44F8 800C38F8 3C0100FF */ lui $at, 0xff -/* 0C44FC 800C38FC 00A11024 */ and $v0, $a1, $at -/* 0C4500 800C3900 0002CBC2 */ srl $t9, $v0, 0xf -/* 0C4504 800C3904 30A40FFF */ andi $a0, $a1, 0xfff -/* 0C4508 800C3908 332700FF */ andi $a3, $t9, 0xff -/* 0C450C 800C390C 00A01825 */ move $v1, $a1 -/* 0C4510 800C3910 332800FF */ andi $t0, $t9, 0xff -/* 0C4514 800C3914 14E00004 */ bnez $a3, .L800C3928 -/* 0C4518 800C3918 3086FFFF */ andi $a2, $a0, 0xffff -/* 0C451C 800C391C 24E80001 */ addiu $t0, $a3, 1 -/* 0C4520 800C3920 310A00FF */ andi $t2, $t0, 0xff -/* 0C4524 800C3924 01404025 */ move $t0, $t2 -.L800C3928: -/* 0C4528 800C3928 0015C080 */ sll $t8, $s5, 2 -/* 0C452C 800C392C 0315C021 */ addu $t8, $t8, $s5 -/* 0C4530 800C3930 0018C0C0 */ sll $t8, $t8, 3 -/* 0C4534 800C3934 0315C021 */ addu $t8, $t8, $s5 -/* 0C4538 800C3938 3C0B803B */ lui $t3, %hi(gSequencePlayers) # $t3, 0x803b -/* 0C453C 800C393C 256B1510 */ addiu $t3, %lo(gSequencePlayers) # addiu $t3, $t3, 0x1510 -/* 0C4540 800C3940 0018C0C0 */ sll $t8, $t8, 3 -/* 0C4544 800C3944 030B2821 */ addu $a1, $t8, $t3 -/* 0C4548 800C3948 8CAC0000 */ lw $t4, ($a1) -/* 0C454C 800C394C 24010030 */ li $at, 48 -/* 0C4550 800C3950 3062F000 */ andi $v0, $v1, 0xf000 -/* 0C4554 800C3954 000C6FC2 */ srl $t5, $t4, 0x1f -/* 0C4558 800C3958 51A0007A */ beql $t5, $zero, .L800C3B44 -/* 0C455C 800C395C AE600014 */ sw $zero, 0x14($s3) -/* 0C4560 800C3960 94A90008 */ lhu $t1, 8($a1) -/* 0C4564 800C3964 00027B02 */ srl $t7, $v0, 0xc -/* 0C4568 800C3968 31F900FF */ andi $t9, $t7, 0xff -/* 0C456C 800C396C 0121001A */ div $zero, $t1, $at -/* 0C4570 800C3970 00004812 */ mflo $t1 -/* 0C4574 800C3974 24010001 */ li $at, 1 -/* 0C4578 800C3978 1321000C */ beq $t9, $at, .L800C39AC -/* 0C457C 800C397C 3127FFFF */ andi $a3, $t1, 0xffff -/* 0C4580 800C3980 24010002 */ li $at, 2 -/* 0C4584 800C3984 1321000E */ beq $t9, $at, .L800C39C0 -/* 0C4588 800C3988 3083FFFF */ andi $v1, $a0, 0xffff -/* 0C458C 800C398C 24010003 */ li $at, 3 -/* 0C4590 800C3990 13210013 */ beq $t9, $at, .L800C39E0 -/* 0C4594 800C3994 308CFFFF */ andi $t4, $a0, 0xffff -/* 0C4598 800C3998 24010004 */ li $at, 4 -/* 0C459C 800C399C 53210048 */ beql $t9, $at, .L800C3AC0 -/* 0C45A0 800C39A0 96620018 */ lhu $v0, 0x18($s3) -/* 0C45A4 800C39A4 1000004B */ b .L800C3AD4 -/* 0C45A8 800C39A8 96620018 */ lhu $v0, 0x18($s3) -.L800C39AC: -/* 0C45AC 800C39AC 00873021 */ addu $a2, $a0, $a3 -/* 0C45B0 800C39B0 30D8FFFF */ andi $t8, $a2, 0xffff -/* 0C45B4 800C39B4 03003025 */ move $a2, $t8 -/* 0C45B8 800C39B8 10000046 */ b .L800C3AD4 -/* 0C45BC 800C39BC 96620018 */ lhu $v0, 0x18($s3) -.L800C39C0: -/* 0C45C0 800C39C0 0067082A */ slt $at, $v1, $a3 -/* 0C45C4 800C39C4 10200004 */ beqz $at, .L800C39D8 -/* 0C45C8 800C39C8 00E01025 */ move $v0, $a3 -/* 0C45CC 800C39CC 00433023 */ subu $a2, $v0, $v1 -/* 0C45D0 800C39D0 30CBFFFF */ andi $t3, $a2, 0xffff -/* 0C45D4 800C39D4 01603025 */ move $a2, $t3 -.L800C39D8: -/* 0C45D8 800C39D8 1000003E */ b .L800C3AD4 -/* 0C45DC 800C39DC 96620018 */ lhu $v0, 0x18($s3) -.L800C39E0: -/* 0C45E0 800C39E0 448C8000 */ mtc1 $t4, $f16 -/* 0C45E4 800C39E4 44875000 */ mtc1 $a3, $f10 -/* 0C45E8 800C39E8 05810005 */ bgez $t4, .L800C3A00 -/* 0C45EC 800C39EC 468084A0 */ cvt.s.w $f18, $f16 -/* 0C45F0 800C39F0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C45F4 800C39F4 44812000 */ mtc1 $at, $f4 -/* 0C45F8 800C39F8 00000000 */ nop -/* 0C45FC 800C39FC 46049480 */ add.s $f18, $f18, $f4 -.L800C3A00: -/* 0C4600 800C3A00 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0C4604 800C3A04 44814000 */ mtc1 $at, $f8 -/* 0C4608 800C3A08 46805420 */ cvt.s.w $f16, $f10 -/* 0C460C 800C3A0C 04E10005 */ bgez $a3, .L800C3A24 -/* 0C4610 800C3A10 46089183 */ div.s $f6, $f18, $f8 -/* 0C4614 800C3A14 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C4618 800C3A18 44812000 */ mtc1 $at, $f4 -/* 0C461C 800C3A1C 00000000 */ nop -/* 0C4620 800C3A20 46048400 */ add.s $f16, $f16, $f4 -.L800C3A24: -/* 0C4624 800C3A24 46068482 */ mul.s $f18, $f16, $f6 -/* 0C4628 800C3A28 24060001 */ li $a2, 1 -/* 0C462C 800C3A2C 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 0C4630 800C3A30 444DF800 */ cfc1 $t5, $31 -/* 0C4634 800C3A34 44C6F800 */ ctc1 $a2, $31 -/* 0C4638 800C3A38 00000000 */ nop -/* 0C463C 800C3A3C 46009224 */ cvt.w.s $f8, $f18 -/* 0C4640 800C3A40 4446F800 */ cfc1 $a2, $31 -/* 0C4644 800C3A44 00000000 */ nop -/* 0C4648 800C3A48 30C60078 */ andi $a2, $a2, 0x78 -/* 0C464C 800C3A4C 50C00013 */ beql $a2, $zero, .L800C3A9C -/* 0C4650 800C3A50 44064000 */ mfc1 $a2, $f8 -/* 0C4654 800C3A54 44814000 */ mtc1 $at, $f8 -/* 0C4658 800C3A58 24060001 */ li $a2, 1 -/* 0C465C 800C3A5C 46089201 */ sub.s $f8, $f18, $f8 -/* 0C4660 800C3A60 44C6F800 */ ctc1 $a2, $31 -/* 0C4664 800C3A64 00000000 */ nop -/* 0C4668 800C3A68 46004224 */ cvt.w.s $f8, $f8 -/* 0C466C 800C3A6C 4446F800 */ cfc1 $a2, $31 -/* 0C4670 800C3A70 00000000 */ nop -/* 0C4674 800C3A74 30C60078 */ andi $a2, $a2, 0x78 -/* 0C4678 800C3A78 14C00005 */ bnez $a2, .L800C3A90 -/* 0C467C 800C3A7C 00000000 */ nop -/* 0C4680 800C3A80 44064000 */ mfc1 $a2, $f8 -/* 0C4684 800C3A84 3C018000 */ lui $at, 0x8000 -/* 0C4688 800C3A88 10000007 */ b .L800C3AA8 -/* 0C468C 800C3A8C 00C13025 */ or $a2, $a2, $at -.L800C3A90: -/* 0C4690 800C3A90 10000005 */ b .L800C3AA8 -/* 0C4694 800C3A94 2406FFFF */ li $a2, -1 -/* 0C4698 800C3A98 44064000 */ mfc1 $a2, $f8 -.L800C3A9C: -/* 0C469C 800C3A9C 00000000 */ nop -/* 0C46A0 800C3AA0 04C0FFFB */ bltz $a2, .L800C3A90 -/* 0C46A4 800C3AA4 00000000 */ nop -.L800C3AA8: -/* 0C46A8 800C3AA8 44CDF800 */ ctc1 $t5, $31 -/* 0C46AC 800C3AAC 30CEFFFF */ andi $t6, $a2, 0xffff -/* 0C46B0 800C3AB0 01C03025 */ move $a2, $t6 -/* 0C46B4 800C3AB4 10000007 */ b .L800C3AD4 -/* 0C46B8 800C3AB8 96620018 */ lhu $v0, 0x18($s3) -/* 0C46BC 800C3ABC 96620018 */ lhu $v0, 0x18($s3) -.L800C3AC0: -/* 0C46C0 800C3AC0 30E6FFFF */ andi $a2, $a3, 0xffff -/* 0C46C4 800C3AC4 10400003 */ beqz $v0, .L800C3AD4 -/* 0C46C8 800C3AC8 00000000 */ nop -/* 0C46CC 800C3ACC 10000001 */ b .L800C3AD4 -/* 0C46D0 800C3AD0 3046FFFF */ andi $a2, $v0, 0xffff -.L800C3AD4: -/* 0C46D4 800C3AD4 44898000 */ mtc1 $t1, $f16 -/* 0C46D8 800C3AD8 28C1012D */ slti $at, $a2, 0x12d -/* 0C46DC 800C3ADC 14200002 */ bnez $at, .L800C3AE8 -/* 0C46E0 800C3AE0 468080A0 */ cvt.s.w $f2, $f16 -/* 0C46E4 800C3AE4 2406012C */ li $a2, 300 -.L800C3AE8: -/* 0C46E8 800C3AE8 44865000 */ mtc1 $a2, $f10 -/* 0C46EC 800C3AEC 14400002 */ bnez $v0, .L800C3AF8 -/* 0C46F0 800C3AF0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C46F4 800C3AF4 A6670018 */ sh $a3, 0x18($s3) -.L800C3AF8: -/* 0C46F8 800C3AF8 04C10004 */ bgez $a2, .L800C3B0C -/* 0C46FC 800C3AFC 46805020 */ cvt.s.w $f0, $f10 -/* 0C4700 800C3B00 44812000 */ mtc1 $at, $f4 -/* 0C4704 800C3B04 00000000 */ nop -/* 0C4708 800C3B08 46040000 */ add.s $f0, $f0, $f4 -.L800C3B0C: -/* 0C470C 800C3B0C 44889000 */ mtc1 $t0, $f18 -/* 0C4710 800C3B10 E6600020 */ swc1 $f0, 0x20($s3) -/* 0C4714 800C3B14 E662001C */ swc1 $f2, 0x1c($s3) -/* 0C4718 800C3B18 46001181 */ sub.s $f6, $f2, $f0 -/* 0C471C 800C3B1C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C4720 800C3B20 05010004 */ bgez $t0, .L800C3B34 -/* 0C4724 800C3B24 46809220 */ cvt.s.w $f8, $f18 -/* 0C4728 800C3B28 44815000 */ mtc1 $at, $f10 -/* 0C472C 800C3B2C 00000000 */ nop -/* 0C4730 800C3B30 460A4200 */ add.s $f8, $f8, $f10 -.L800C3B34: -/* 0C4734 800C3B34 46083103 */ div.s $f4, $f6, $f8 -/* 0C4738 800C3B38 A6680028 */ sh $t0, 0x28($s3) -/* 0C473C 800C3B3C E6640024 */ swc1 $f4, 0x24($s3) -/* 0C4740 800C3B40 AE600014 */ sw $zero, 0x14($s3) -.L800C3B44: -/* 0C4744 800C3B44 96620028 */ lhu $v0, 0x28($s3) -/* 0C4748 800C3B48 10400015 */ beqz $v0, .L800C3BA0 -/* 0C474C 800C3B4C 244FFFFF */ addiu $t7, $v0, -1 -/* 0C4750 800C3B50 32A300FF */ andi $v1, $s5, 0xff -/* 0C4754 800C3B54 0003CC00 */ sll $t9, $v1, 0x10 -/* 0C4758 800C3B58 31EAFFFF */ andi $t2, $t7, 0xffff -/* 0C475C 800C3B5C A66F0028 */ sh $t7, 0x28($s3) -/* 0C4760 800C3B60 11400006 */ beqz $t2, .L800C3B7C -/* 0C4764 800C3B64 03201825 */ move $v1, $t9 -/* 0C4768 800C3B68 C670001C */ lwc1 $f16, 0x1c($s3) -/* 0C476C 800C3B6C C6720024 */ lwc1 $f18, 0x24($s3) -/* 0C4770 800C3B70 46128281 */ sub.s $f10, $f16, $f18 -/* 0C4774 800C3B74 10000003 */ b .L800C3B84 -/* 0C4778 800C3B78 E66A001C */ swc1 $f10, 0x1c($s3) -.L800C3B7C: -/* 0C477C 800C3B7C C6660020 */ lwc1 $f6, 0x20($s3) -/* 0C4780 800C3B80 E666001C */ swc1 $f6, 0x1c($s3) -.L800C3B84: -/* 0C4784 800C3B84 C668001C */ lwc1 $f8, 0x1c($s3) -/* 0C4788 800C3B88 3C014700 */ lui $at, 0x4700 -/* 0C478C 800C3B8C 00612025 */ or $a0, $v1, $at -/* 0C4790 800C3B90 4600410D */ trunc.w.s $f4, $f8 -/* 0C4794 800C3B94 44052000 */ mfc1 $a1, $f4 -/* 0C4798 800C3B98 0C032EEE */ jal func_800CBBB8 -/* 0C479C 800C3B9C 00000000 */ nop -.L800C3BA0: -/* 0C47A0 800C3BA0 966B0246 */ lhu $t3, 0x246($s3) -/* 0C47A4 800C3BA4 1160002C */ beqz $t3, .L800C3C58 -/* 0C47A8 800C3BA8 001560C0 */ sll $t4, $s5, 3 -/* 0C47AC 800C3BAC 01956021 */ addu $t4, $t4, $s5 -/* 0C47B0 800C3BB0 000C6080 */ sll $t4, $t4, 2 -/* 0C47B4 800C3BB4 01956021 */ addu $t4, $t4, $s5 -/* 0C47B8 800C3BB8 000C6080 */ sll $t4, $t4, 2 -/* 0C47BC 800C3BBC 01956023 */ subu $t4, $t4, $s5 -/* 0C47C0 800C3BC0 000C6080 */ sll $t4, $t4, 2 -/* 0C47C4 800C3BC4 02CCA021 */ addu $s4, $s6, $t4 -/* 0C47C8 800C3BC8 00008025 */ move $s0, $zero -.L800C3BCC: -/* 0C47CC 800C3BCC 00102140 */ sll $a0, $s0, 5 -/* 0C47D0 800C3BD0 02841021 */ addu $v0, $s4, $a0 -/* 0C47D4 800C3BD4 94430050 */ lhu $v1, 0x50($v0) -/* 0C47D8 800C3BD8 32A600FF */ andi $a2, $s5, 0xff -/* 0C47DC 800C3BDC 00067400 */ sll $t6, $a2, 0x10 -/* 0C47E0 800C3BE0 10600018 */ beqz $v1, .L800C3C44 -/* 0C47E4 800C3BE4 246DFFFF */ addiu $t5, $v1, -1 -/* 0C47E8 800C3BE8 3C010100 */ lui $at, 0x100 -/* 0C47EC 800C3BEC 31B9FFFF */ andi $t9, $t5, 0xffff -/* 0C47F0 800C3BF0 A44D0050 */ sh $t5, 0x50($v0) -/* 0C47F4 800C3BF4 13200006 */ beqz $t9, .L800C3C10 -/* 0C47F8 800C3BF8 01C13025 */ or $a2, $t6, $at -/* 0C47FC 800C3BFC C4500044 */ lwc1 $f16, 0x44($v0) -/* 0C4800 800C3C00 C452004C */ lwc1 $f18, 0x4c($v0) -/* 0C4804 800C3C04 46128281 */ sub.s $f10, $f16, $f18 -/* 0C4808 800C3C08 10000009 */ b .L800C3C30 -/* 0C480C 800C3C0C E44A0044 */ swc1 $f10, 0x44($v0) -.L800C3C10: -/* 0C4810 800C3C10 02641821 */ addu $v1, $s3, $a0 -/* 0C4814 800C3C14 C4660048 */ lwc1 $f6, 0x48($v1) -/* 0C4818 800C3C18 24180001 */ li $t8, 1 -/* 0C481C 800C3C1C 02185804 */ sllv $t3, $t8, $s0 -/* 0C4820 800C3C20 E4660044 */ swc1 $f6, 0x44($v1) -/* 0C4824 800C3C24 966A0246 */ lhu $t2, 0x246($s3) -/* 0C4828 800C3C28 014B6026 */ xor $t4, $t2, $t3 -/* 0C482C 800C3C2C A66C0246 */ sh $t4, 0x246($s3) -.L800C3C30: -/* 0C4830 800C3C30 320D00FF */ andi $t5, $s0, 0xff -/* 0C4834 800C3C34 000D7200 */ sll $t6, $t5, 8 -/* 0C4838 800C3C38 00CE2025 */ or $a0, $a2, $t6 -/* 0C483C 800C3C3C 0C032EE2 */ jal func_800CBB88 -/* 0C4840 800C3C40 8C450044 */ lw $a1, 0x44($v0) -.L800C3C44: -/* 0C4844 800C3C44 26100001 */ addiu $s0, $s0, 1 -/* 0C4848 800C3C48 320F00FF */ andi $t7, $s0, 0xff -/* 0C484C 800C3C4C 29E10010 */ slti $at, $t7, 0x10 -/* 0C4850 800C3C50 1420FFDE */ bnez $at, .L800C3BCC -/* 0C4854 800C3C54 01E08025 */ move $s0, $t7 -.L800C3C58: -/* 0C4858 800C3C58 96790244 */ lhu $t9, 0x244($s3) -/* 0C485C 800C3C5C 1320002C */ beqz $t9, .L800C3D10 -/* 0C4860 800C3C60 0015C0C0 */ sll $t8, $s5, 3 -/* 0C4864 800C3C64 0315C021 */ addu $t8, $t8, $s5 -/* 0C4868 800C3C68 0018C080 */ sll $t8, $t8, 2 -/* 0C486C 800C3C6C 0315C021 */ addu $t8, $t8, $s5 -/* 0C4870 800C3C70 0018C080 */ sll $t8, $t8, 2 -/* 0C4874 800C3C74 0315C023 */ subu $t8, $t8, $s5 -/* 0C4878 800C3C78 0018C080 */ sll $t8, $t8, 2 -/* 0C487C 800C3C7C 02D8A021 */ addu $s4, $s6, $t8 -/* 0C4880 800C3C80 00008025 */ move $s0, $zero -.L800C3C84: -/* 0C4884 800C3C84 00102140 */ sll $a0, $s0, 5 -/* 0C4888 800C3C88 02841021 */ addu $v0, $s4, $a0 -/* 0C488C 800C3C8C 94430060 */ lhu $v1, 0x60($v0) -/* 0C4890 800C3C90 32A600FF */ andi $a2, $s5, 0xff -/* 0C4894 800C3C94 00065C00 */ sll $t3, $a2, 0x10 -/* 0C4898 800C3C98 10600018 */ beqz $v1, .L800C3CFC -/* 0C489C 800C3C9C 246AFFFF */ addiu $t2, $v1, -1 -/* 0C48A0 800C3CA0 3C010400 */ lui $at, 0x400 -/* 0C48A4 800C3CA4 314DFFFF */ andi $t5, $t2, 0xffff -/* 0C48A8 800C3CA8 A44A0060 */ sh $t2, 0x60($v0) -/* 0C48AC 800C3CAC 11A00006 */ beqz $t5, .L800C3CC8 -/* 0C48B0 800C3CB0 01613025 */ or $a2, $t3, $at -/* 0C48B4 800C3CB4 C4480054 */ lwc1 $f8, 0x54($v0) -/* 0C48B8 800C3CB8 C444005C */ lwc1 $f4, 0x5c($v0) -/* 0C48BC 800C3CBC 46044401 */ sub.s $f16, $f8, $f4 -/* 0C48C0 800C3CC0 10000009 */ b .L800C3CE8 -/* 0C48C4 800C3CC4 E4500054 */ swc1 $f16, 0x54($v0) -.L800C3CC8: -/* 0C48C8 800C3CC8 02641821 */ addu $v1, $s3, $a0 -/* 0C48CC 800C3CCC C4720058 */ lwc1 $f18, 0x58($v1) -/* 0C48D0 800C3CD0 240F0001 */ li $t7, 1 -/* 0C48D4 800C3CD4 020FC804 */ sllv $t9, $t7, $s0 -/* 0C48D8 800C3CD8 E4720054 */ swc1 $f18, 0x54($v1) -/* 0C48DC 800C3CDC 966E0244 */ lhu $t6, 0x244($s3) -/* 0C48E0 800C3CE0 01D9C026 */ xor $t8, $t6, $t9 -/* 0C48E4 800C3CE4 A6780244 */ sh $t8, 0x244($s3) -.L800C3CE8: -/* 0C48E8 800C3CE8 320A00FF */ andi $t2, $s0, 0xff -/* 0C48EC 800C3CEC 000A5A00 */ sll $t3, $t2, 8 -/* 0C48F0 800C3CF0 00CB2025 */ or $a0, $a2, $t3 -/* 0C48F4 800C3CF4 0C032EE2 */ jal func_800CBB88 -/* 0C48F8 800C3CF8 8C450054 */ lw $a1, 0x54($v0) -.L800C3CFC: -/* 0C48FC 800C3CFC 26100001 */ addiu $s0, $s0, 1 -/* 0C4900 800C3D00 320C00FF */ andi $t4, $s0, 0xff -/* 0C4904 800C3D04 29810010 */ slti $at, $t4, 0x10 -/* 0C4908 800C3D08 1420FFDE */ bnez $at, .L800C3C84 -/* 0C490C 800C3D0C 01808025 */ move $s0, $t4 -.L800C3D10: -/* 0C4910 800C3D10 92620041 */ lbu $v0, 0x41($s3) -/* 0C4914 800C3D14 50400084 */ beql $v0, $zero, .L800C3F28 -/* 0C4918 800C3D18 26B50001 */ addiu $s5, $s5, 1 -/* 0C491C 800C3D1C 92630040 */ lbu $v1, 0x40($s3) -/* 0C4920 800C3D20 00157880 */ sll $t7, $s5, 2 -/* 0C4924 800C3D24 01F57821 */ addu $t7, $t7, $s5 -/* 0C4928 800C3D28 10600004 */ beqz $v1, .L800C3D3C -/* 0C492C 800C3D2C 000F78C0 */ sll $t7, $t7, 3 -/* 0C4930 800C3D30 246DFFFF */ addiu $t5, $v1, -1 -/* 0C4934 800C3D34 1000007B */ b .L800C3F24 -/* 0C4938 800C3D38 A26D0040 */ sb $t5, 0x40($s3) -.L800C3D3C: -/* 0C493C 800C3D3C 01F57821 */ addu $t7, $t7, $s5 -/* 0C4940 800C3D40 000F78C0 */ sll $t7, $t7, 3 -/* 0C4944 800C3D44 3C0E803B */ lui $t6, %hi(gSequencePlayers) # 0x803b -/* 0C4948 800C3D48 01CF7021 */ addu $t6, $t6, $t7 -/* 0C494C 800C3D4C 8DCE1510 */ lw $t6, %lo(gSequencePlayers)($t6) # 0x1510($t6) -/* 0C4950 800C3D50 00009025 */ move $s2, $zero -/* 0C4954 800C3D54 000ECFC2 */ srl $t9, $t6, 0x1f -/* 0C4958 800C3D58 57200073 */ bnel $t9, $zero, .L800C3F28 -/* 0C495C 800C3D5C 26B50001 */ addiu $s5, $s5, 1 -/* 0C4960 800C3D60 1840006F */ blez $v0, .L800C3F20 -/* 0C4964 800C3D64 00401825 */ move $v1, $v0 -/* 0C4968 800C3D68 0015C0C0 */ sll $t8, $s5, 3 -/* 0C496C 800C3D6C 0315C021 */ addu $t8, $t8, $s5 -/* 0C4970 800C3D70 0018C080 */ sll $t8, $t8, 2 -/* 0C4974 800C3D74 0315C021 */ addu $t8, $t8, $s5 -/* 0C4978 800C3D78 0018C080 */ sll $t8, $t8, 2 -/* 0C497C 800C3D7C 0315C023 */ subu $t8, $t8, $s5 -/* 0C4980 800C3D80 0018C080 */ sll $t8, $t8, 2 -/* 0C4984 800C3D84 02D8A021 */ addu $s4, $s6, $t8 -.L800C3D88: -/* 0C4988 800C3D88 00125080 */ sll $t2, $s2, 2 -/* 0C498C 800C3D8C 028A5821 */ addu $t3, $s4, $t2 -/* 0C4990 800C3D90 8D62002C */ lw $v0, 0x2c($t3) -/* 0C4994 800C3D94 3C0100F0 */ lui $at, 0xf0 -/* 0C4998 800C3D98 00412024 */ and $a0, $v0, $at -/* 0C499C 800C3D9C 3C01000F */ lui $at, 0xf -/* 0C49A0 800C3DA0 00046502 */ srl $t4, $a0, 0x14 -/* 0C49A4 800C3DA4 00418824 */ and $s1, $v0, $at -/* 0C49A8 800C3DA8 318D00FF */ andi $t5, $t4, 0xff -/* 0C49AC 800C3DAC 3045FF00 */ andi $a1, $v0, 0xff00 -/* 0C49B0 800C3DB0 00403025 */ move $a2, $v0 -/* 0C49B4 800C3DB4 00117C02 */ srl $t7, $s1, 0x10 -/* 0C49B8 800C3DB8 0005CA02 */ srl $t9, $a1, 8 -/* 0C49BC 800C3DBC 30CA00FF */ andi $t2, $a2, 0xff -/* 0C49C0 800C3DC0 2DA10007 */ sltiu $at, $t5, 7 -/* 0C49C4 800C3DC4 31F100FF */ andi $s1, $t7, 0xff -/* 0C49C8 800C3DC8 332500FF */ andi $a1, $t9, 0xff -/* 0C49CC 800C3DCC 1020004F */ beqz $at, .L800C3F0C -/* 0C49D0 800C3DD0 01403025 */ move $a2, $t2 -/* 0C49D4 800C3DD4 000D5880 */ sll $t3, $t5, 2 -/* 0C49D8 800C3DD8 3C01800F */ lui $at, %hi(jpt_800F362C) -/* 0C49DC 800C3DDC 002B0821 */ addu $at, $at, $t3 -/* 0C49E0 800C3DE0 8C2B362C */ lw $t3, %lo(jpt_800F362C)($at) -/* 0C49E4 800C3DE4 01600008 */ jr $t3 -/* 0C49E8 800C3DE8 00000000 */ nop -glabel L800C3DEC -/* 0C49EC 800C3DEC 02370019 */ multu $s1, $s7 -/* 0C49F0 800C3DF0 240D0001 */ li $t5, 1 -/* 0C49F4 800C3DF4 240F007F */ li $t7, 127 -/* 0C49F8 800C3DF8 00006012 */ mflo $t4 -/* 0C49FC 800C3DFC 02CC8021 */ addu $s0, $s6, $t4 -/* 0C4A00 800C3E00 A20D0012 */ sb $t5, 0x12($s0) -/* 0C4A04 800C3E04 A20F000F */ sb $t7, 0xf($s0) -/* 0C4A08 800C3E08 10000040 */ b .L800C3F0C -/* 0C4A0C 800C3E0C 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E10 -/* 0C4A10 800C3E10 966E0248 */ lhu $t6, 0x248($s3) -/* 0C4A14 800C3E14 3C013000 */ lui $at, 0x3000 -/* 0C4A18 800C3E18 0015C600 */ sll $t8, $s5, 0x18 -/* 0C4A1C 800C3E1C 01C1C825 */ or $t9, $t6, $at -/* 0C4A20 800C3E20 0C030D12 */ jal func_800C3448 -/* 0C4A24 800C3E24 03382025 */ or $a0, $t9, $t8 -/* 0C4A28 800C3E28 10000038 */ b .L800C3F0C -/* 0C4A2C 800C3E2C 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E30 -/* 0C4A30 800C3E30 02370019 */ multu $s1, $s7 -/* 0C4A34 800C3E34 00116600 */ sll $t4, $s1, 0x18 -/* 0C4A38 800C3E38 3C010001 */ lui $at, 1 -/* 0C4A3C 800C3E3C 00005012 */ mflo $t2 -/* 0C4A40 800C3E40 02CA8021 */ addu $s0, $s6, $t2 -/* 0C4A44 800C3E44 960B0248 */ lhu $t3, 0x248($s0) -/* 0C4A48 800C3E48 016C2025 */ or $a0, $t3, $t4 -/* 0C4A4C 800C3E4C 00816825 */ or $t5, $a0, $at -/* 0C4A50 800C3E50 0C030D12 */ jal func_800C3448 -/* 0C4A54 800C3E54 01A02025 */ move $a0, $t5 -/* 0C4A58 800C3E58 240F0001 */ li $t7, 1 -/* 0C4A5C 800C3E5C 240E007F */ li $t6, 127 -/* 0C4A60 800C3E60 A20F0012 */ sb $t7, 0x12($s0) -/* 0C4A64 800C3E64 A20E000F */ sb $t6, 0xf($s0) -/* 0C4A68 800C3E68 10000028 */ b .L800C3F0C -/* 0C4A6C 800C3E6C 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E70 -/* 0C4A70 800C3E70 3C01B000 */ lui $at, (0xB0003000 >> 16) # lui $at, 0xb000 -/* 0C4A74 800C3E74 34213000 */ ori $at, (0xB0003000 & 0xFFFF) # ori $at, $at, 0x3000 -/* 0C4A78 800C3E78 0011CE00 */ sll $t9, $s1, 0x18 -/* 0C4A7C 800C3E7C 0321C025 */ or $t8, $t9, $at -/* 0C4A80 800C3E80 00055400 */ sll $t2, $a1, 0x10 -/* 0C4A84 800C3E84 030A5825 */ or $t3, $t8, $t2 -/* 0C4A88 800C3E88 0C030D12 */ jal func_800C3448 -/* 0C4A8C 800C3E8C 01662025 */ or $a0, $t3, $a2 -/* 0C4A90 800C3E90 1000001E */ b .L800C3F0C -/* 0C4A94 800C3E94 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3E98 -/* 0C4A98 800C3E98 3C01B000 */ lui $at, (0xB0004000 >> 16) # lui $at, 0xb000 -/* 0C4A9C 800C3E9C 34214000 */ ori $at, (0xB0004000 & 0xFFFF) # ori $at, $at, 0x4000 -/* 0C4AA0 800C3EA0 00116600 */ sll $t4, $s1, 0x18 -/* 0C4AA4 800C3EA4 01816825 */ or $t5, $t4, $at -/* 0C4AA8 800C3EA8 00067C00 */ sll $t7, $a2, 0x10 -/* 0C4AAC 800C3EAC 0C030D12 */ jal func_800C3448 -/* 0C4AB0 800C3EB0 01AF2025 */ or $a0, $t5, $t7 -/* 0C4AB4 800C3EB4 10000015 */ b .L800C3F0C -/* 0C4AB8 800C3EB8 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3EBC -/* 0C4ABC 800C3EBC 02370019 */ multu $s1, $s7 -/* 0C4AC0 800C3EC0 00115E00 */ sll $t3, $s1, 0x18 -/* 0C4AC4 800C3EC4 304EFFFF */ andi $t6, $v0, 0xffff -/* 0C4AC8 800C3EC8 0000C812 */ mflo $t9 -/* 0C4ACC 800C3ECC 02D98021 */ addu $s0, $s6, $t9 -/* 0C4AD0 800C3ED0 92180042 */ lbu $t8, 0x42($s0) -/* 0C4AD4 800C3ED4 00185400 */ sll $t2, $t8, 0x10 -/* 0C4AD8 800C3ED8 014B6025 */ or $t4, $t2, $t3 -/* 0C4ADC 800C3EDC 0C030D12 */ jal func_800C3448 -/* 0C4AE0 800C3EE0 018E2025 */ or $a0, $t4, $t6 -/* 0C4AE4 800C3EE4 322400FF */ andi $a0, $s1, 0xff -/* 0C4AE8 800C3EE8 24050001 */ li $a1, 1 -/* 0C4AEC 800C3EEC 2406007F */ li $a2, 127 -/* 0C4AF0 800C3EF0 0C030DB1 */ jal func_800C36C4 -/* 0C4AF4 800C3EF4 00003825 */ move $a3, $zero -/* 0C4AF8 800C3EF8 A2000042 */ sb $zero, 0x42($s0) -/* 0C4AFC 800C3EFC 10000003 */ b .L800C3F0C -/* 0C4B00 800C3F00 92630041 */ lbu $v1, 0x41($s3) -glabel L800C3F04 -/* 0C4B04 800C3F04 A2650042 */ sb $a1, 0x42($s3) -/* 0C4B08 800C3F08 92630041 */ lbu $v1, 0x41($s3) -.L800C3F0C: -/* 0C4B0C 800C3F0C 26520001 */ addiu $s2, $s2, 1 -/* 0C4B10 800C3F10 324D00FF */ andi $t5, $s2, 0xff -/* 0C4B14 800C3F14 01A3082A */ slt $at, $t5, $v1 -/* 0C4B18 800C3F18 1420FF9B */ bnez $at, .L800C3D88 -/* 0C4B1C 800C3F1C 01A09025 */ move $s2, $t5 -.L800C3F20: -/* 0C4B20 800C3F20 A2600041 */ sb $zero, 0x41($s3) -.L800C3F24: -/* 0C4B24 800C3F24 26B50001 */ addiu $s5, $s5, 1 -.L800C3F28: -/* 0C4B28 800C3F28 32AF00FF */ andi $t7, $s5, 0xff -/* 0C4B2C 800C3F2C 29E10003 */ slti $at, $t7, 3 -/* 0C4B30 800C3F30 1420FE0F */ bnez $at, .L800C3770 -/* 0C4B34 800C3F34 01E0A825 */ move $s5, $t7 -/* 0C4B38 800C3F38 8FDF0054 */ lw $ra, 0x54($fp) -/* 0C4B3C 800C3F3C 03C0E825 */ move $sp, $fp -/* 0C4B40 800C3F40 D7D40028 */ ldc1 $f20, 0x28($fp) -/* 0C4B44 800C3F44 8FD00030 */ lw $s0, 0x30($fp) -/* 0C4B48 800C3F48 8FD10034 */ lw $s1, 0x34($fp) -/* 0C4B4C 800C3F4C 8FD20038 */ lw $s2, 0x38($fp) -/* 0C4B50 800C3F50 8FD3003C */ lw $s3, 0x3c($fp) -/* 0C4B54 800C3F54 8FD40040 */ lw $s4, 0x40($fp) -/* 0C4B58 800C3F58 8FD50044 */ lw $s5, 0x44($fp) -/* 0C4B5C 800C3F5C 8FD60048 */ lw $s6, 0x48($fp) -/* 0C4B60 800C3F60 8FD7004C */ lw $s7, 0x4c($fp) -/* 0C4B64 800C3F64 8FDE0050 */ lw $fp, 0x50($fp) -/* 0C4B68 800C3F68 03E00008 */ jr $ra -/* 0C4B6C 800C3F6C 27BD0058 */ addiu $sp, $sp, 0x58 diff --git a/asm/non_matchings/audio/external/func_800C4398.s b/asm/non_matchings/audio/external/func_800C4398.s deleted file mode 100644 index 0e9b5c9cb1..0000000000 --- a/asm/non_matchings/audio/external/func_800C4398.s +++ /dev/null @@ -1,255 +0,0 @@ -.section .late_rodata - -glabel D_800F3664 -.float 100000.0 - -.section .text - -glabel func_800C4398 -/* 0C4F98 800C4398 3C0E800F */ lui $t6, %hi(sNumProcessedSoundRequests) # $t6, 0x800f -/* 0C4F9C 800C439C 91CEA1BC */ lbu $t6, %lo(sNumProcessedSoundRequests)($t6) -/* 0C4FA0 800C43A0 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 0C4FA4 800C43A4 3C188019 */ lui $t8, %hi(sSoundRequests) # $t8, 0x8019 -/* 0C4FA8 800C43A8 000E7880 */ sll $t7, $t6, 2 -/* 0C4FAC 800C43AC 01EE7823 */ subu $t7, $t7, $t6 -/* 0C4FB0 800C43B0 000F78C0 */ sll $t7, $t7, 3 -/* 0C4FB4 800C43B4 2718FC20 */ addiu $t8, %lo(sSoundRequests) # addiu $t8, $t8, -0x3e0 -/* 0C4FB8 800C43B8 AFBF002C */ sw $ra, 0x2c($sp) -/* 0C4FBC 800C43BC AFBE0028 */ sw $fp, 0x28($sp) -/* 0C4FC0 800C43C0 AFB00024 */ sw $s0, 0x24($sp) -/* 0C4FC4 800C43C4 01F83021 */ addu $a2, $t7, $t8 -/* 0C4FC8 800C43C8 8CC50000 */ lw $a1, ($a2) -/* 0C4FCC 800C43CC 03A0F025 */ move $fp, $sp -/* 0C4FD0 800C43D0 241F00FF */ li $ra, 255 -/* 0C4FD4 800C43D4 10A000D3 */ beqz $a1, .L800C4724 -/* 0C4FD8 800C43D8 3C01F000 */ lui $at, 0xf000 -/* 0C4FDC 800C43DC 00A16824 */ and $t5, $a1, $at -/* 0C4FE0 800C43E0 000DCF02 */ srl $t9, $t5, 0x1c -/* 0C4FE4 800C43E4 332E00FF */ andi $t6, $t9, 0xff -/* 0C4FE8 800C43E8 000E7900 */ sll $t7, $t6, 4 -/* 0C4FEC 800C43EC 01EE7823 */ subu $t7, $t7, $t6 -/* 0C4FF0 800C43F0 3C188019 */ lui $t8, %hi(sSoundBanks) # $t8, 0x8019 -/* 0C4FF4 800C43F4 27181420 */ addiu $t8, %lo(sSoundBanks) # addiu $t8, $t8, 0x1420 -/* 0C4FF8 800C43F8 000F7980 */ sll $t7, $t7, 6 -/* 0C4FFC 800C43FC 01F8C821 */ addu $t9, $t7, $t8 -/* 0C5000 800C4400 9323002B */ lbu $v1, 0x2b($t9) -/* 0C5004 800C4404 01C06825 */ move $t5, $t6 -/* 0C5008 800C4408 00003825 */ move $a3, $zero -/* 0C500C 800C440C 13E30078 */ beq $ra, $v1, .L800C45F0 -/* 0C5010 800C4410 00601025 */ move $v0, $v1 -/* 0C5014 800C4414 10600076 */ beqz $v1, .L800C45F0 -/* 0C5018 800C4418 000E7100 */ sll $t6, $t6, 4 -/* 0C501C 800C441C 01CD7023 */ subu $t6, $t6, $t5 -/* 0C5020 800C4420 000E7180 */ sll $t6, $t6, 6 -/* 0C5024 800C4424 01D84821 */ addu $t1, $t6, $t8 -/* 0C5028 800C4428 240C0030 */ li $t4, 48 -/* 0C502C 800C442C 8FAB003C */ lw $t3, 0x3c($sp) -/* 0C5030 800C4430 93AA0043 */ lbu $t2, 0x43($sp) -.L800C4434: -/* 0C5034 800C4434 006C0019 */ multu $v1, $t4 -/* 0C5038 800C4438 8CD90004 */ lw $t9, 4($a2) -/* 0C503C 800C443C 3C18800F */ lui $t8, %hi(D_800EA1C0) # $t8, 0x800f -/* 0C5040 800C4440 3C04800F */ lui $a0, %hi(D_800EA1A0) -/* 0C5044 800C4444 00007812 */ mflo $t7 -/* 0C5048 800C4448 012F8021 */ addu $s0, $t1, $t7 -/* 0C504C 800C444C 8E0E0000 */ lw $t6, ($s0) -/* 0C5050 800C4450 172E005A */ bne $t9, $t6, .L800C45BC -/* 0C5054 800C4454 00000000 */ nop -/* 0C5058 800C4458 9318A1C0 */ lbu $t8, %lo(D_800EA1C0)($t8) -/* 0C505C 800C445C 8CC50000 */ lw $a1, ($a2) -/* 0C5060 800C4460 8E020024 */ lw $v0, 0x24($s0) -/* 0C5064 800C4464 00187880 */ sll $t7, $t8, 2 -/* 0C5068 800C4468 01F87823 */ subu $t7, $t7, $t8 -/* 0C506C 800C446C 000F7840 */ sll $t7, $t7, 1 -/* 0C5070 800C4470 01EDC821 */ addu $t9, $t7, $t5 -/* 0C5074 800C4474 00992021 */ addu $a0, $a0, $t9 -/* 0C5078 800C4478 9084A1A0 */ lbu $a0, %lo(D_800EA1A0)($a0) -/* 0C507C 800C447C 14A20004 */ bne $a1, $v0, .L800C4490 -/* 0C5080 800C4480 00804025 */ move $t0, $a0 -/* 0C5084 800C4484 308700FF */ andi $a3, $a0, 0xff -/* 0C5088 800C4488 10000017 */ b .L800C44E8 -/* 0C508C 800C448C 00E01025 */ move $v0, $a3 -.L800C4490: -/* 0C5090 800C4490 14E00004 */ bnez $a3, .L800C44A4 -/* 0C5094 800C4494 304EFF00 */ andi $t6, $v0, 0xff00 -/* 0C5098 800C4498 306A00FF */ andi $t2, $v1, 0xff -/* 0C509C 800C449C 10000007 */ b .L800C44BC -/* 0C50A0 800C44A0 00405825 */ move $t3, $v0 -.L800C44A4: -/* 0C50A4 800C44A4 3178FF00 */ andi $t8, $t3, 0xff00 -/* 0C50A8 800C44A8 01D8082B */ sltu $at, $t6, $t8 -/* 0C50AC 800C44AC 50200004 */ beql $at, $zero, .L800C44C0 -/* 0C50B0 800C44B0 24E70001 */ addiu $a3, $a3, 1 -/* 0C50B4 800C44B4 306A00FF */ andi $t2, $v1, 0xff -/* 0C50B8 800C44B8 00405825 */ move $t3, $v0 -.L800C44BC: -/* 0C50BC 800C44BC 24E70001 */ addiu $a3, $a3, 1 -.L800C44C0: -/* 0C50C0 800C44C0 30E200FF */ andi $v0, $a3, 0xff -/* 0C50C4 800C44C4 14480008 */ bne $v0, $t0, .L800C44E8 -/* 0C50C8 800C44C8 00403825 */ move $a3, $v0 -/* 0C50CC 800C44CC 30B9FF00 */ andi $t9, $a1, 0xff00 -/* 0C50D0 800C44D0 316EFF00 */ andi $t6, $t3, 0xff00 -/* 0C50D4 800C44D4 032E082B */ sltu $at, $t9, $t6 -/* 0C50D8 800C44D8 14200003 */ bnez $at, .L800C44E8 -/* 0C50DC 800C44DC 00001825 */ move $v1, $zero -/* 0C50E0 800C44E0 10000001 */ b .L800C44E8 -/* 0C50E4 800C44E4 314300FF */ andi $v1, $t2, 0xff -.L800C44E8: -/* 0C50E8 800C44E8 14480034 */ bne $v0, $t0, .L800C45BC -/* 0C50EC 800C44EC 0005C100 */ sll $t8, $a1, 4 -/* 0C50F0 800C44F0 07000005 */ bltz $t8, .L800C4508 -/* 0C50F4 800C44F4 00057B40 */ sll $t7, $a1, 0xd -/* 0C50F8 800C44F8 05E00003 */ bltz $t7, .L800C4508 -/* 0C50FC 800C44FC 00000000 */ nop -/* 0C5100 800C4500 5543002E */ bnel $t2, $v1, .L800C45BC -/* 0C5104 800C4504 00001825 */ move $v1, $zero -.L800C4508: -/* 0C5108 800C4508 006C0019 */ multu $v1, $t4 -/* 0C510C 800C450C 0000C812 */ mflo $t9 -/* 0C5110 800C4510 01398021 */ addu $s0, $t1, $t9 -/* 0C5114 800C4514 8E0E0024 */ lw $t6, 0x24($s0) -/* 0C5118 800C4518 000EC300 */ sll $t8, $t6, 0xc -/* 0C511C 800C451C 07030016 */ bgezl $t8, .L800C4578 -/* 0C5120 800C4520 90D90008 */ lbu $t9, 8($a2) -/* 0C5124 800C4524 920F0028 */ lbu $t7, 0x28($s0) -/* 0C5128 800C4528 24010001 */ li $at, 1 -/* 0C512C 800C452C 51E10012 */ beql $t7, $at, .L800C4578 -/* 0C5130 800C4530 90D90008 */ lbu $t9, 8($a2) -/* 0C5134 800C4534 9204002C */ lbu $a0, 0x2c($s0) -/* 0C5138 800C4538 A3CD004F */ sb $t5, 0x4f($fp) -/* 0C513C 800C453C AFCB003C */ sw $t3, 0x3c($fp) -/* 0C5140 800C4540 A3CA0043 */ sb $t2, 0x43($fp) -/* 0C5144 800C4544 AFC90030 */ sw $t1, 0x30($fp) -/* 0C5148 800C4548 A3C7004D */ sb $a3, 0x4d($fp) -/* 0C514C 800C454C 0C03103C */ jal func_800C40F0 -/* 0C5150 800C4550 AFC60048 */ sw $a2, 0x48($fp) -/* 0C5154 800C4554 8FC60048 */ lw $a2, 0x48($fp) -/* 0C5158 800C4558 93C7004D */ lbu $a3, 0x4d($fp) -/* 0C515C 800C455C 8FC90030 */ lw $t1, 0x30($fp) -/* 0C5160 800C4560 93CA0043 */ lbu $t2, 0x43($fp) -/* 0C5164 800C4564 8FCB003C */ lw $t3, 0x3c($fp) -/* 0C5168 800C4568 240C0030 */ li $t4, 48 -/* 0C516C 800C456C 93CD004F */ lbu $t5, 0x4f($fp) -/* 0C5170 800C4570 241F00FF */ li $ra, 255 -/* 0C5174 800C4574 90D90008 */ lbu $t9, 8($a2) -.L800C4578: -/* 0C5178 800C4578 3C010100 */ lui $at, 0x100 -/* 0C517C 800C457C A219000C */ sb $t9, 0xc($s0) -/* 0C5180 800C4580 8CCE0000 */ lw $t6, ($a2) -/* 0C5184 800C4584 AE0E0024 */ sw $t6, 0x24($s0) -/* 0C5188 800C4588 8CD80000 */ lw $t8, ($a2) -/* 0C518C 800C458C 240E0002 */ li $t6, 2 -/* 0C5190 800C4590 A20E0029 */ sb $t6, 0x29($s0) -/* 0C5194 800C4594 03017824 */ and $t7, $t8, $at -/* 0C5198 800C4598 000FCE02 */ srl $t9, $t7, 0x18 -/* 0C519C 800C459C A2190028 */ sb $t9, 0x28($s0) -/* 0C51A0 800C45A0 8CD8000C */ lw $t8, 0xc($a2) -/* 0C51A4 800C45A4 AE180010 */ sw $t8, 0x10($s0) -/* 0C51A8 800C45A8 8CCF0010 */ lw $t7, 0x10($a2) -/* 0C51AC 800C45AC AE0F0014 */ sw $t7, 0x14($s0) -/* 0C51B0 800C45B0 8CD90014 */ lw $t9, 0x14($a2) -/* 0C51B4 800C45B4 AE190018 */ sw $t9, 0x18($s0) -/* 0C51B8 800C45B8 00001825 */ move $v1, $zero -.L800C45BC: -/* 0C51BC 800C45BC 10600006 */ beqz $v1, .L800C45D8 -/* 0C51C0 800C45C0 00601025 */ move $v0, $v1 -/* 0C51C4 800C45C4 006C0019 */ multu $v1, $t4 -/* 0C51C8 800C45C8 00007012 */ mflo $t6 -/* 0C51CC 800C45CC 012EC021 */ addu $t8, $t1, $t6 -/* 0C51D0 800C45D0 9303002B */ lbu $v1, 0x2b($t8) -/* 0C51D4 800C45D4 00601025 */ move $v0, $v1 -.L800C45D8: -/* 0C51D8 800C45D8 13E20005 */ beq $ra, $v0, .L800C45F0 -/* 0C51DC 800C45DC 00000000 */ nop -/* 0C51E0 800C45E0 1440FF94 */ bnez $v0, .L800C4434 -/* 0C51E4 800C45E4 00000000 */ nop -/* 0C51E8 800C45E8 AFCB003C */ sw $t3, 0x3c($fp) -/* 0C51EC 800C45EC A3CA0043 */ sb $t2, 0x43($fp) -.L800C45F0: -/* 0C51F0 800C45F0 3C0E8019 */ lui $t6, %hi(sSoundBankFreeListFront) # $t6, 0x8019 -/* 0C51F4 800C45F4 25CE2AA8 */ addiu $t6, %lo(sSoundBankFreeListFront) # addiu $t6, $t6, 0x2aa8 -/* 0C51F8 800C45F8 01AE3821 */ addu $a3, $t5, $t6 -/* 0C51FC 800C45FC 90E50000 */ lbu $a1, ($a3) -/* 0C5200 800C4600 240C0030 */ li $t4, 48 -/* 0C5204 800C4604 000D7900 */ sll $t7, $t5, 4 -/* 0C5208 800C4608 00AC0019 */ multu $a1, $t4 -/* 0C520C 800C460C 01ED7823 */ subu $t7, $t7, $t5 -/* 0C5210 800C4610 3C198019 */ lui $t9, %hi(sSoundBanks) # $t9, 0x8019 -/* 0C5214 800C4614 27391420 */ addiu $t9, %lo(sSoundBanks) # addiu $t9, $t9, 0x1420 -/* 0C5218 800C4618 000F7980 */ sll $t7, $t7, 6 -/* 0C521C 800C461C 01F94821 */ addu $t1, $t7, $t9 -/* 0C5220 800C4620 0000C012 */ mflo $t8 -/* 0C5224 800C4624 01384021 */ addu $t0, $t1, $t8 -/* 0C5228 800C4628 9103002B */ lbu $v1, 0x2b($t0) -/* 0C522C 800C462C 13E30034 */ beq $ra, $v1, .L800C4700 -/* 0C5230 800C4630 00000000 */ nop -/* 0C5234 800C4634 10400032 */ beqz $v0, .L800C4700 -/* 0C5238 800C4638 00000000 */ nop -/* 0C523C 800C463C 30A300FF */ andi $v1, $a1, 0xff -/* 0C5240 800C4640 006C0019 */ multu $v1, $t4 -/* 0C5244 800C4644 8CD90004 */ lw $t9, 4($a2) -/* 0C5248 800C4648 3C010100 */ lui $at, 0x100 -/* 0C524C 800C464C 00007812 */ mflo $t7 -/* 0C5250 800C4650 012F8021 */ addu $s0, $t1, $t7 -/* 0C5254 800C4654 AE190000 */ sw $t9, ($s0) -/* 0C5258 800C4658 8CCE0004 */ lw $t6, 4($a2) -/* 0C525C 800C465C 25D80004 */ addiu $t8, $t6, 4 -/* 0C5260 800C4660 AE180004 */ sw $t8, 4($s0) -/* 0C5264 800C4664 8CCF0004 */ lw $t7, 4($a2) -/* 0C5268 800C4668 25F90008 */ addiu $t9, $t7, 8 -/* 0C526C 800C466C AE190008 */ sw $t9, 8($s0) -/* 0C5270 800C4670 90CE0008 */ lbu $t6, 8($a2) -/* 0C5274 800C4674 A20E000C */ sb $t6, 0xc($s0) -/* 0C5278 800C4678 8CD8000C */ lw $t8, 0xc($a2) -/* 0C527C 800C467C AE180010 */ sw $t8, 0x10($s0) -/* 0C5280 800C4680 8CCF0010 */ lw $t7, 0x10($a2) -/* 0C5284 800C4684 AE0F0014 */ sw $t7, 0x14($s0) -/* 0C5288 800C4688 8CD90014 */ lw $t9, 0x14($a2) -/* 0C528C 800C468C AE190018 */ sw $t9, 0x18($s0) -/* 0C5290 800C4690 8CCE0000 */ lw $t6, ($a2) -/* 0C5294 800C4694 AE0E0024 */ sw $t6, 0x24($s0) -/* 0C5298 800C4698 8CD80000 */ lw $t8, ($a2) -/* 0C529C 800C469C 240E0002 */ li $t6, 2 -/* 0C52A0 800C46A0 A20E0029 */ sb $t6, 0x29($s0) -/* 0C52A4 800C46A4 03017824 */ and $t7, $t8, $at -/* 0C52A8 800C46A8 3C188019 */ lui $t8, %hi(sSoundBankUsedListBack) # $t8, 0x8019 -/* 0C52AC 800C46AC 27182AA0 */ addiu $t8, %lo(sSoundBankUsedListBack) # addiu $t8, $t8, 0x2aa0 -/* 0C52B0 800C46B0 01B81021 */ addu $v0, $t5, $t8 -/* 0C52B4 800C46B4 90440000 */ lbu $a0, ($v0) -/* 0C52B8 800C46B8 000FCE02 */ srl $t9, $t7, 0x18 -/* 0C52BC 800C46BC A2190028 */ sb $t9, 0x28($s0) -/* 0C52C0 800C46C0 008C0019 */ multu $a0, $t4 -/* 0C52C4 800C46C4 A204002A */ sb $a0, 0x2a($s0) -/* 0C52C8 800C46C8 00007812 */ mflo $t7 -/* 0C52CC 800C46CC 012FC821 */ addu $t9, $t1, $t7 -/* 0C52D0 800C46D0 A325002B */ sb $a1, 0x2b($t9) -/* 0C52D4 800C46D4 910E002B */ lbu $t6, 0x2b($t0) -/* 0C52D8 800C46D8 A0450000 */ sb $a1, ($v0) -/* 0C52DC 800C46DC 240200FF */ li $v0, 255 -/* 0C52E0 800C46E0 31D800FF */ andi $t8, $t6, 0xff -/* 0C52E4 800C46E4 030C0019 */ multu $t8, $t4 -/* 0C52E8 800C46E8 A0EE0000 */ sb $t6, ($a3) -/* 0C52EC 800C46EC 00007812 */ mflo $t7 -/* 0C52F0 800C46F0 012FC821 */ addu $t9, $t1, $t7 -/* 0C52F4 800C46F4 A322002A */ sb $v0, 0x2a($t9) -/* 0C52F8 800C46F8 1000000A */ b .L800C4724 -/* 0C52FC 800C46FC A202002B */ sb $v0, 0x2b($s0) -.L800C4700: -/* 0C5300 800C4700 57E30009 */ bnel $ra, $v1, .L800C4728 -/* 0C5304 800C4704 8FDF002C */ lw $ra, 0x2c($fp) -/* 0C5308 800C4708 8CC20004 */ lw $v0, 4($a2) -/* 0C530C 800C470C 3C0E800F */ lui $t6, %hi(D_800EA1C8) # $t6, 0x800f -/* 0C5310 800C4710 25CEA1C8 */ addiu $t6, %lo(D_800EA1C8) # addiu $t6, $t6, -0x5e38 -/* 0C5314 800C4714 11C20003 */ beq $t6, $v0, .L800C4724 -/* 0C5318 800C4718 3C01800F */ lui $at, %hi(D_800F3664) # $at, 0x800f -/* 0C531C 800C471C C4243664 */ lwc1 $f4, %lo(D_800F3664)($at) -/* 0C5320 800C4720 E4440004 */ swc1 $f4, 4($v0) -.L800C4724: -/* 0C5324 800C4724 8FDF002C */ lw $ra, 0x2c($fp) -.L800C4728: -/* 0C5328 800C4728 03C0E825 */ move $sp, $fp -/* 0C532C 800C472C 8FD00024 */ lw $s0, 0x24($fp) -/* 0C5330 800C4730 8FDE0028 */ lw $fp, 0x28($fp) -/* 0C5334 800C4734 03E00008 */ jr $ra -/* 0C5338 800C4738 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/asm/non_matchings/audio/external/func_800C4888.s b/asm/non_matchings/audio/external/func_800C4888.s deleted file mode 100644 index fe9b9b53ba..0000000000 --- a/asm/non_matchings/audio/external/func_800C4888.s +++ /dev/null @@ -1,530 +0,0 @@ -.section .late_rodata - -glabel D_800F366C -.float 4000000.0 - -glabel D_800F3670 -.float 10000000000.0 - -.section .text - -glabel func_800C4888 -/* 0C5488 800C4888 27BDFF30 */ addiu $sp, $sp, -0xd0 -/* 0C548C 800C488C AFBE0048 */ sw $fp, 0x48($sp) -/* 0C5490 800C4890 AFB5003C */ sw $s5, 0x3c($sp) -/* 0C5494 800C4894 AFB40038 */ sw $s4, 0x38($sp) -/* 0C5498 800C4898 AFB20030 */ sw $s2, 0x30($sp) -/* 0C549C 800C489C AFB1002C */ sw $s1, 0x2c($sp) -/* 0C54A0 800C48A0 3C027FFF */ lui $v0, (0x7FFFFFFF >> 16) # lui $v0, 0x7fff -/* 0C54A4 800C48A4 309500FF */ andi $s5, $a0, 0xff -/* 0C54A8 800C48A8 03A0F025 */ move $fp, $sp -/* 0C54AC 800C48AC AFBF004C */ sw $ra, 0x4c($sp) -/* 0C54B0 800C48B0 AFB70044 */ sw $s7, 0x44($sp) -/* 0C54B4 800C48B4 AFB60040 */ sw $s6, 0x40($sp) -/* 0C54B8 800C48B8 AFB30034 */ sw $s3, 0x34($sp) -/* 0C54BC 800C48BC AFB00028 */ sw $s0, 0x28($sp) -/* 0C54C0 800C48C0 AFA400D0 */ sw $a0, 0xd0($sp) -/* 0C54C4 800C48C4 00009025 */ move $s2, $zero -/* 0C54C8 800C48C8 3442FFFF */ ori $v0, (0x7FFFFFFF & 0xFFFF) # ori $v0, $v0, 0xffff -/* 0C54CC 800C48CC 27B1007C */ addiu $s1, $sp, 0x7c -/* 0C54D0 800C48D0 241400FF */ li $s4, 255 -/* 0C54D4 800C48D4 00005825 */ move $t3, $zero -.L800C48D8: -/* 0C54D8 800C48D8 000B70C0 */ sll $t6, $t3, 3 -/* 0C54DC 800C48DC 256B0001 */ addiu $t3, $t3, 1 -/* 0C54E0 800C48E0 316F00FF */ andi $t7, $t3, 0xff -/* 0C54E4 800C48E4 29E10008 */ slti $at, $t7, 8 -/* 0C54E8 800C48E8 022E3821 */ addu $a3, $s1, $t6 -/* 0C54EC 800C48EC 01E05825 */ move $t3, $t7 -/* 0C54F0 800C48F0 ACE20000 */ sw $v0, ($a3) -/* 0C54F4 800C48F4 1420FFF8 */ bnez $at, .L800C48D8 -/* 0C54F8 800C48F8 A0F40004 */ sb $s4, 4($a3) -/* 0C54FC 800C48FC 0015C100 */ sll $t8, $s5, 4 -/* 0C5500 800C4900 3C1F8019 */ lui $ra, %hi(sSoundBanks) # $ra, 0x8019 -/* 0C5504 800C4904 0315C023 */ subu $t8, $t8, $s5 -/* 0C5508 800C4908 27FF1420 */ addiu $ra, %lo(sSoundBanks) # addiu $ra, $ra, 0x1420 -/* 0C550C 800C490C 0018C180 */ sll $t8, $t8, 6 -/* 0C5510 800C4910 03F8C821 */ addu $t9, $ra, $t8 -/* 0C5514 800C4914 9333002B */ lbu $s3, 0x2b($t9) -/* 0C5518 800C4918 241700FF */ li $s7, 255 -/* 0C551C 800C491C 00008025 */ move $s0, $zero -/* 0C5520 800C4920 12F300F7 */ beq $s7, $s3, .L800C4D00 -/* 0C5524 800C4924 00157100 */ sll $t6, $s5, 4 -/* 0C5528 800C4928 01D57023 */ subu $t6, $t6, $s5 -/* 0C552C 800C492C 000E7180 */ sll $t6, $t6, 6 -/* 0C5530 800C4930 03EE7821 */ addu $t7, $ra, $t6 -/* 0C5534 800C4934 AFCF006C */ sw $t7, 0x6c($fp) -/* 0C5538 800C4938 24160030 */ li $s6, 48 -/* 0C553C 800C493C 240D0001 */ li $t5, 1 -/* 0C5540 800C4940 3C020800 */ lui $v0, 0x800 -.L800C4944: -/* 0C5544 800C4944 02760019 */ multu $s3, $s6 -/* 0C5548 800C4948 8FD8006C */ lw $t8, 0x6c($fp) -/* 0C554C 800C494C 32A400FF */ andi $a0, $s5, 0xff -/* 0C5550 800C4950 0000C812 */ mflo $t9 -/* 0C5554 800C4954 03195021 */ addu $t2, $t8, $t9 -/* 0C5558 800C4958 914E0028 */ lbu $t6, 0x28($t2) -/* 0C555C 800C495C 55AE0009 */ bnel $t5, $t6, .L800C4984 -/* 0C5560 800C4960 914F0029 */ lbu $t7, 0x29($t2) -/* 0C5564 800C4964 8D4F0024 */ lw $t7, 0x24($t2) -/* 0C5568 800C4968 01E2C024 */ and $t8, $t7, $v0 -/* 0C556C 800C496C 54580005 */ bnel $v0, $t8, .L800C4984 -/* 0C5570 800C4970 914F0029 */ lbu $t7, 0x29($t2) -/* 0C5574 800C4974 91590029 */ lbu $t9, 0x29($t2) -/* 0C5578 800C4978 272EFFFF */ addiu $t6, $t9, -1 -/* 0C557C 800C497C A14E0029 */ sb $t6, 0x29($t2) -/* 0C5580 800C4980 914F0029 */ lbu $t7, 0x29($t2) -.L800C4984: -/* 0C5584 800C4984 55E00009 */ bnel $t7, $zero, .L800C49AC -/* 0C5588 800C4988 91580028 */ lbu $t8, 0x28($t2) -/* 0C558C 800C498C 0C0311CF */ jal delete_sound_from_bank -/* 0C5590 800C4990 326500FF */ andi $a1, $s3, 0xff -/* 0C5594 800C4994 3C1F8019 */ lui $ra, %hi(sSoundBanks) # $ra, 0x8019 -/* 0C5598 800C4998 27FF1420 */ addiu $ra, %lo(sSoundBanks) # addiu $ra, $ra, 0x1420 -/* 0C559C 800C499C 240D0001 */ li $t5, 1 -/* 0C55A0 800C49A0 100000D0 */ b .L800C4CE4 -/* 0C55A4 800C49A4 3C020800 */ lui $v0, 0x800 -/* 0C55A8 800C49A8 91580028 */ lbu $t8, 0x28($t2) -.L800C49AC: -/* 0C55AC 800C49AC 130000CD */ beqz $t8, .L800C4CE4 -/* 0C55B0 800C49B0 00000000 */ nop -/* 0C55B4 800C49B4 8D420000 */ lw $v0, ($t2) -/* 0C55B8 800C49B8 3C19800F */ lui $t9, %hi(D_800EA1C8) # $t9, 0x800f -/* 0C55BC 800C49BC 2739A1C8 */ addiu $t9, %lo(D_800EA1C8) # addiu $t9, $t9, -0x5e38 -/* 0C55C0 800C49C0 57220005 */ bnel $t9, $v0, .L800C49D8 -/* 0C55C4 800C49C4 8D4E0008 */ lw $t6, 8($t2) -/* 0C55C8 800C49C8 44802000 */ mtc1 $zero, $f4 -/* 0C55CC 800C49CC 10000009 */ b .L800C49F4 -/* 0C55D0 800C49D0 E544001C */ swc1 $f4, 0x1c($t2) -/* 0C55D4 800C49D4 8D4E0008 */ lw $t6, 8($t2) -.L800C49D8: -/* 0C55D8 800C49D8 C4420000 */ lwc1 $f2, ($v0) -/* 0C55DC 800C49DC C5C00000 */ lwc1 $f0, ($t6) -/* 0C55E0 800C49E0 46000182 */ mul.s $f6, $f0, $f0 -/* 0C55E4 800C49E4 00000000 */ nop -/* 0C55E8 800C49E8 46021202 */ mul.s $f8, $f2, $f2 -/* 0C55EC 800C49EC 46083280 */ add.s $f10, $f6, $f8 -/* 0C55F0 800C49F0 E54A001C */ swc1 $f10, 0x1c($t2) -.L800C49F4: -/* 0C55F4 800C49F4 8D420024 */ lw $v0, 0x24($t2) -/* 0C55F8 800C49F8 3043FF00 */ andi $v1, $v0, 0xff00 -/* 0C55FC 800C49FC 00037A02 */ srl $t7, $v1, 8 -/* 0C5600 800C4A00 31F800FF */ andi $t8, $t7, 0xff -/* 0C5604 800C4A04 0002CAC0 */ sll $t9, $v0, 0xb -/* 0C5608 800C4A08 07210010 */ bgez $t9, .L800C4A4C -/* 0C560C 800C4A0C 03001825 */ move $v1, $t8 -/* 0C5610 800C4A10 02F81023 */ subu $v0, $s7, $t8 -/* 0C5614 800C4A14 00420019 */ multu $v0, $v0 -/* 0C5618 800C4A18 C542001C */ lwc1 $f2, 0x1c($t2) -/* 0C561C 800C4A1C 00007012 */ mflo $t6 -/* 0C5620 800C4A20 000E7880 */ sll $t7, $t6, 2 -/* 0C5624 800C4A24 01EE7823 */ subu $t7, $t7, $t6 -/* 0C5628 800C4A28 000F7880 */ sll $t7, $t7, 2 -/* 0C562C 800C4A2C 01EE7823 */ subu $t7, $t7, $t6 -/* 0C5630 800C4A30 000F7880 */ sll $t7, $t7, 2 -/* 0C5634 800C4A34 01EE7821 */ addu $t7, $t7, $t6 -/* 0C5638 800C4A38 000F78C0 */ sll $t7, $t7, 3 -/* 0C563C 800C4A3C 01EE7821 */ addu $t7, $t7, $t6 -/* 0C5640 800C4A40 000F7880 */ sll $t7, $t7, 2 -/* 0C5644 800C4A44 10000041 */ b .L800C4B4C -/* 0C5648 800C4A48 AD4F0020 */ sw $t7, 0x20($t2) -.L800C4A4C: -/* 0C564C 800C4A4C 4458F800 */ cfc1 $t8, $31 -/* 0C5650 800C4A50 24190001 */ li $t9, 1 -/* 0C5654 800C4A54 44D9F800 */ ctc1 $t9, $31 -/* 0C5658 800C4A58 C542001C */ lwc1 $f2, 0x1c($t2) -/* 0C565C 800C4A5C 02E31023 */ subu $v0, $s7, $v1 -/* 0C5660 800C4A60 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 0C5664 800C4A64 46001424 */ cvt.w.s $f16, $f2 -/* 0C5668 800C4A68 4459F800 */ cfc1 $t9, $31 -/* 0C566C 800C4A6C 00000000 */ nop -/* 0C5670 800C4A70 33390078 */ andi $t9, $t9, 0x78 -/* 0C5674 800C4A74 53200013 */ beql $t9, $zero, .L800C4AC4 -/* 0C5678 800C4A78 44198000 */ mfc1 $t9, $f16 -/* 0C567C 800C4A7C 44818000 */ mtc1 $at, $f16 -/* 0C5680 800C4A80 24190001 */ li $t9, 1 -/* 0C5684 800C4A84 46101401 */ sub.s $f16, $f2, $f16 -/* 0C5688 800C4A88 44D9F800 */ ctc1 $t9, $31 -/* 0C568C 800C4A8C 00000000 */ nop -/* 0C5690 800C4A90 46008424 */ cvt.w.s $f16, $f16 -/* 0C5694 800C4A94 4459F800 */ cfc1 $t9, $31 -/* 0C5698 800C4A98 00000000 */ nop -/* 0C569C 800C4A9C 33390078 */ andi $t9, $t9, 0x78 -/* 0C56A0 800C4AA0 17200005 */ bnez $t9, .L800C4AB8 -/* 0C56A4 800C4AA4 00000000 */ nop -/* 0C56A8 800C4AA8 44198000 */ mfc1 $t9, $f16 -/* 0C56AC 800C4AAC 3C018000 */ lui $at, 0x8000 -/* 0C56B0 800C4AB0 10000007 */ b .L800C4AD0 -/* 0C56B4 800C4AB4 0321C825 */ or $t9, $t9, $at -.L800C4AB8: -/* 0C56B8 800C4AB8 10000005 */ b .L800C4AD0 -/* 0C56BC 800C4ABC 2419FFFF */ li $t9, -1 -/* 0C56C0 800C4AC0 44198000 */ mfc1 $t9, $f16 -.L800C4AC4: -/* 0C56C4 800C4AC4 00000000 */ nop -/* 0C56C8 800C4AC8 0720FFFB */ bltz $t9, .L800C4AB8 -/* 0C56CC 800C4ACC 00000000 */ nop -.L800C4AD0: -/* 0C56D0 800C4AD0 00420019 */ multu $v0, $v0 -/* 0C56D4 800C4AD4 44D8F800 */ ctc1 $t8, $31 -/* 0C56D8 800C4AD8 44809000 */ mtc1 $zero, $f18 -/* 0C56DC 800C4ADC 3C0140C0 */ li $at, 0x40C00000 # 6.000000 -/* 0C56E0 800C4AE0 00007012 */ mflo $t6 -/* 0C56E4 800C4AE4 000E7880 */ sll $t7, $t6, 2 -/* 0C56E8 800C4AE8 01EE7823 */ subu $t7, $t7, $t6 -/* 0C56EC 800C4AEC 000F7880 */ sll $t7, $t7, 2 -/* 0C56F0 800C4AF0 01EE7823 */ subu $t7, $t7, $t6 -/* 0C56F4 800C4AF4 000F7880 */ sll $t7, $t7, 2 -/* 0C56F8 800C4AF8 01EE7821 */ addu $t7, $t7, $t6 -/* 0C56FC 800C4AFC 000F78C0 */ sll $t7, $t7, 3 -/* 0C5700 800C4B00 01EE7821 */ addu $t7, $t7, $t6 -/* 0C5704 800C4B04 8D4E0008 */ lw $t6, 8($t2) -/* 0C5708 800C4B08 000F7880 */ sll $t7, $t7, 2 -/* 0C570C 800C4B0C 032FC021 */ addu $t8, $t9, $t7 -/* 0C5710 800C4B10 AD580020 */ sw $t8, 0x20($t2) -/* 0C5714 800C4B14 C5C00000 */ lwc1 $f0, ($t6) -/* 0C5718 800C4B18 4600903C */ c.lt.s $f18, $f0 -/* 0C571C 800C4B1C 00000000 */ nop -/* 0C5720 800C4B20 4502000B */ bc1fl .L800C4B50 -/* 0C5724 800C4B24 8D430024 */ lw $v1, 0x24($t2) -/* 0C5728 800C4B28 44812000 */ mtc1 $at, $f4 -/* 0C572C 800C4B2C 0300C825 */ move $t9, $t8 -/* 0C5730 800C4B30 C542001C */ lwc1 $f2, 0x1c($t2) -/* 0C5734 800C4B34 46040182 */ mul.s $f6, $f0, $f4 -/* 0C5738 800C4B38 4600320D */ trunc.w.s $f8, $f6 -/* 0C573C 800C4B3C 44184000 */ mfc1 $t8, $f8 -/* 0C5740 800C4B40 00000000 */ nop -/* 0C5744 800C4B44 03387021 */ addu $t6, $t9, $t8 -/* 0C5748 800C4B48 AD4E0020 */ sw $t6, 0x20($t2) -.L800C4B4C: -/* 0C574C 800C4B4C 8D430024 */ lw $v1, 0x24($t2) -.L800C4B50: -/* 0C5750 800C4B50 3C010003 */ lui $at, 3 -/* 0C5754 800C4B54 00617824 */ and $t7, $v1, $at -/* 0C5758 800C4B58 000FCC02 */ srl $t9, $t7, 0x10 -/* 0C575C 800C4B5C 333800FF */ andi $t8, $t9, 0xff -/* 0C5760 800C4B60 1300000A */ beqz $t8, .L800C4B8C -/* 0C5764 800C4B64 3C01800F */ lui $at, %hi(D_800F3670) -/* 0C5768 800C4B68 03180019 */ multu $t8, $t8 -/* 0C576C 800C4B6C 3C01800F */ lui $at, %hi(D_800F366C) # $at, 0x800f -/* 0C5770 800C4B70 C42A366C */ lwc1 $f10, %lo(D_800F366C)($at) -/* 0C5774 800C4B74 00007012 */ mflo $t6 -/* 0C5778 800C4B78 448E8000 */ mtc1 $t6, $f16 -/* 0C577C 800C4B7C 00000000 */ nop -/* 0C5780 800C4B80 468084A0 */ cvt.s.w $f18, $f16 -/* 0C5784 800C4B84 10000002 */ b .L800C4B90 -/* 0C5788 800C4B88 46125003 */ div.s $f0, $f10, $f18 -.L800C4B8C: -/* 0C578C 800C4B8C C4203670 */ lwc1 $f0, %lo(D_800F3670)($at) -.L800C4B90: -/* 0C5790 800C4B90 4602003C */ c.lt.s $f0, $f2 -/* 0C5794 800C4B94 3C18800F */ lui $t8, %hi(D_800EA1C0) # $t8, 0x800f -/* 0C5798 800C4B98 4500001C */ bc1f .L800C4C0C -/* 0C579C 800C4B9C 00000000 */ nop -/* 0C57A0 800C4BA0 914F0028 */ lbu $t7, 0x28($t2) -/* 0C57A4 800C4BA4 24010004 */ li $at, 4 -/* 0C57A8 800C4BA8 00002825 */ move $a1, $zero -/* 0C57AC 800C4BAC 55E1004C */ bnel $t7, $at, .L800C4CE0 -/* 0C57B0 800C4BB0 327000FF */ andi $s0, $s3, 0xff -/* 0C57B4 800C4BB4 9159002C */ lbu $t9, 0x2c($t2) -/* 0C57B8 800C4BB8 3C010602 */ lui $at, 0x602 -/* 0C57BC 800C4BBC AFCA0068 */ sw $t2, 0x68($fp) -/* 0C57C0 800C4BC0 0019C200 */ sll $t8, $t9, 8 -/* 0C57C4 800C4BC4 0C032EFA */ jal func_800CBBE8 -/* 0C57C8 800C4BC8 03012025 */ or $a0, $t8, $at -/* 0C57CC 800C4BCC 8FCA0068 */ lw $t2, 0x68($fp) -/* 0C57D0 800C4BD0 3C1F8019 */ lui $ra, %hi(sSoundBanks) # $ra, 0x8019 -/* 0C57D4 800C4BD4 27FF1420 */ addiu $ra, %lo(sSoundBanks) # addiu $ra, $ra, 0x1420 -/* 0C57D8 800C4BD8 8D4F0024 */ lw $t7, 0x24($t2) -/* 0C57DC 800C4BDC 240D0001 */ li $t5, 1 -/* 0C57E0 800C4BE0 32A400FF */ andi $a0, $s5, 0xff -/* 0C57E4 800C4BE4 000FC900 */ sll $t9, $t7, 4 -/* 0C57E8 800C4BE8 0723003D */ bgezl $t9, .L800C4CE0 -/* 0C57EC 800C4BEC 327000FF */ andi $s0, $s3, 0xff -/* 0C57F0 800C4BF0 0C0311CF */ jal delete_sound_from_bank -/* 0C57F4 800C4BF4 326500FF */ andi $a1, $s3, 0xff -/* 0C57F8 800C4BF8 3C1F8019 */ lui $ra, %hi(sSoundBanks) # $ra, 0x8019 -/* 0C57FC 800C4BFC 27FF1420 */ addiu $ra, %lo(sSoundBanks) # addiu $ra, $ra, 0x1420 -/* 0C5800 800C4C00 240D0001 */ li $t5, 1 -/* 0C5804 800C4C04 10000035 */ b .L800C4CDC -/* 0C5808 800C4C08 321300FF */ andi $s3, $s0, 0xff -.L800C4C0C: -/* 0C580C 800C4C0C 9318A1C0 */ lbu $t8, %lo(D_800EA1C0)($t8) -/* 0C5810 800C4C10 3C0C800F */ lui $t4, %hi(D_800EA188) -/* 0C5814 800C4C14 00005825 */ move $t3, $zero -/* 0C5818 800C4C18 00187080 */ sll $t6, $t8, 2 -/* 0C581C 800C4C1C 01D87023 */ subu $t6, $t6, $t8 -/* 0C5820 800C4C20 000E7040 */ sll $t6, $t6, 1 -/* 0C5824 800C4C24 01D57821 */ addu $t7, $t6, $s5 -/* 0C5828 800C4C28 018F6021 */ addu $t4, $t4, $t7 -/* 0C582C 800C4C2C 918CA188 */ lbu $t4, %lo(D_800EA188)($t4) -/* 0C5830 800C4C30 01804825 */ move $t1, $t4 -/* 0C5834 800C4C34 19200029 */ blez $t1, .L800C4CDC -/* 0C5838 800C4C38 01204025 */ move $t0, $t1 -.L800C4C3C: -/* 0C583C 800C4C3C 000BC8C0 */ sll $t9, $t3, 3 -/* 0C5840 800C4C40 02393821 */ addu $a3, $s1, $t9 -/* 0C5844 800C4C44 8CF80000 */ lw $t8, ($a3) -/* 0C5848 800C4C48 8D430020 */ lw $v1, 0x20($t2) -/* 0C584C 800C4C4C 2502FFFF */ addiu $v0, $t0, -1 -/* 0C5850 800C4C50 304500FF */ andi $a1, $v0, 0xff -/* 0C5854 800C4C54 0303082B */ sltu $at, $t8, $v1 -/* 0C5858 800C4C58 1420001B */ bnez $at, .L800C4CC8 -/* 0C585C 800C4C5C 01603025 */ move $a2, $t3 -/* 0C5860 800C4C60 024C082A */ slt $at, $s2, $t4 -/* 0C5864 800C4C64 10200004 */ beqz $at, .L800C4C78 -/* 0C5868 800C4C68 304400FF */ andi $a0, $v0, 0xff -/* 0C586C 800C4C6C 26520001 */ addiu $s2, $s2, 1 -/* 0C5870 800C4C70 324E00FF */ andi $t6, $s2, 0xff -/* 0C5874 800C4C74 01C09025 */ move $s2, $t6 -.L800C4C78: -/* 0C5878 800C4C78 00C4082A */ slt $at, $a2, $a0 -/* 0C587C 800C4C7C 10200010 */ beqz $at, .L800C4CC0 -/* 0C5880 800C4C80 312B00FF */ andi $t3, $t1, 0xff -/* 0C5884 800C4C84 00A01825 */ move $v1, $a1 -.L800C4C88: -/* 0C5888 800C4C88 0003C8C0 */ sll $t9, $v1, 3 -/* 0C588C 800C4C8C 02391021 */ addu $v0, $s1, $t9 -/* 0C5890 800C4C90 8C58FFF8 */ lw $t8, -8($v0) -/* 0C5894 800C4C94 000578C0 */ sll $t7, $a1, 3 -/* 0C5898 800C4C98 022F2021 */ addu $a0, $s1, $t7 -/* 0C589C 800C4C9C 24A5FFFF */ addiu $a1, $a1, -1 -/* 0C58A0 800C4CA0 AC980000 */ sw $t8, ($a0) -/* 0C58A4 800C4CA4 904EFFFC */ lbu $t6, -4($v0) -/* 0C58A8 800C4CA8 30A300FF */ andi $v1, $a1, 0xff -/* 0C58AC 800C4CAC 00C3082A */ slt $at, $a2, $v1 -/* 0C58B0 800C4CB0 00602825 */ move $a1, $v1 -/* 0C58B4 800C4CB4 1420FFF4 */ bnez $at, .L800C4C88 -/* 0C58B8 800C4CB8 A08E0004 */ sb $t6, 4($a0) -/* 0C58BC 800C4CBC 8D430020 */ lw $v1, 0x20($t2) -.L800C4CC0: -/* 0C58C0 800C4CC0 ACE30000 */ sw $v1, ($a3) -/* 0C58C4 800C4CC4 A0F30004 */ sb $s3, 4($a3) -.L800C4CC8: -/* 0C58C8 800C4CC8 256B0001 */ addiu $t3, $t3, 1 -/* 0C58CC 800C4CCC 317900FF */ andi $t9, $t3, 0xff -/* 0C58D0 800C4CD0 0328082A */ slt $at, $t9, $t0 -/* 0C58D4 800C4CD4 1420FFD9 */ bnez $at, .L800C4C3C -/* 0C58D8 800C4CD8 03205825 */ move $t3, $t9 -.L800C4CDC: -/* 0C58DC 800C4CDC 327000FF */ andi $s0, $s3, 0xff -.L800C4CE0: -/* 0C58E0 800C4CE0 3C020800 */ lui $v0, 0x800 -.L800C4CE4: -/* 0C58E4 800C4CE4 02160019 */ multu $s0, $s6 -/* 0C58E8 800C4CE8 8FD8006C */ lw $t8, 0x6c($fp) -/* 0C58EC 800C4CEC 00007012 */ mflo $t6 -/* 0C58F0 800C4CF0 030E7821 */ addu $t7, $t8, $t6 -/* 0C58F4 800C4CF4 91F3002B */ lbu $s3, 0x2b($t7) -/* 0C58F8 800C4CF8 16F3FF12 */ bne $s7, $s3, .L800C4944 -/* 0C58FC 800C4CFC 00000000 */ nop -.L800C4D00: -/* 0C5900 800C4D00 3C19800F */ lui $t9, %hi(D_800EA1C0) # $t9, 0x800f -/* 0C5904 800C4D04 9339A1C0 */ lbu $t9, %lo(D_800EA1C0)($t9) -/* 0C5908 800C4D08 3C09800F */ lui $t1, %hi(D_800EA188) -/* 0C590C 800C4D0C 240D0001 */ li $t5, 1 -/* 0C5910 800C4D10 0019C080 */ sll $t8, $t9, 2 -/* 0C5914 800C4D14 0319C023 */ subu $t8, $t8, $t9 -/* 0C5918 800C4D18 0018C040 */ sll $t8, $t8, 1 -/* 0C591C 800C4D1C 03157021 */ addu $t6, $t8, $s5 -/* 0C5920 800C4D20 012E4821 */ addu $t1, $t1, $t6 -/* 0C5924 800C4D24 24160030 */ li $s6, 48 -/* 0C5928 800C4D28 9129A188 */ lbu $t1, %lo(D_800EA188)($t1) -/* 0C592C 800C4D2C 00005825 */ move $t3, $zero -/* 0C5930 800C4D30 1A40001E */ blez $s2, .L800C4DAC -/* 0C5934 800C4D34 02403025 */ move $a2, $s2 -/* 0C5938 800C4D38 00157900 */ sll $t7, $s5, 4 -/* 0C593C 800C4D3C 01F57823 */ subu $t7, $t7, $s5 -/* 0C5940 800C4D40 000F7980 */ sll $t7, $t7, 6 -/* 0C5944 800C4D44 03EFC821 */ addu $t9, $ra, $t7 -/* 0C5948 800C4D48 AFD9006C */ sw $t9, 0x6c($fp) -/* 0C594C 800C4D4C 24050003 */ li $a1, 3 -/* 0C5950 800C4D50 24040002 */ li $a0, 2 -.L800C4D54: -/* 0C5954 800C4D54 000B70C0 */ sll $t6, $t3, 3 -/* 0C5958 800C4D58 022E7821 */ addu $t7, $s1, $t6 -/* 0C595C 800C4D5C 91F90004 */ lbu $t9, 4($t7) -/* 0C5960 800C4D60 8FD8006C */ lw $t8, 0x6c($fp) -/* 0C5964 800C4D64 256B0001 */ addiu $t3, $t3, 1 -/* 0C5968 800C4D68 03360019 */ multu $t9, $s6 -/* 0C596C 800C4D6C 316F00FF */ andi $t7, $t3, 0xff -/* 0C5970 800C4D70 24010004 */ li $at, 4 -/* 0C5974 800C4D74 00007012 */ mflo $t6 -/* 0C5978 800C4D78 030E1021 */ addu $v0, $t8, $t6 -/* 0C597C 800C4D7C 90430028 */ lbu $v1, 0x28($v0) -/* 0C5980 800C4D80 15A30003 */ bne $t5, $v1, .L800C4D90 -/* 0C5984 800C4D84 00000000 */ nop -/* 0C5988 800C4D88 10000004 */ b .L800C4D9C -/* 0C598C 800C4D8C A0440028 */ sb $a0, 0x28($v0) -.L800C4D90: -/* 0C5990 800C4D90 54610003 */ bnel $v1, $at, .L800C4DA0 -/* 0C5994 800C4D94 01E6082A */ slt $at, $t7, $a2 -/* 0C5998 800C4D98 A0450028 */ sb $a1, 0x28($v0) -.L800C4D9C: -/* 0C599C 800C4D9C 01E6082A */ slt $at, $t7, $a2 -.L800C4DA0: -/* 0C59A0 800C4DA0 1420FFEC */ bnez $at, .L800C4D54 -/* 0C59A4 800C4DA4 01E05825 */ move $t3, $t7 -/* 0C59A8 800C4DA8 00005825 */ move $t3, $zero -.L800C4DAC: -/* 0C59AC 800C4DAC 19200080 */ blez $t1, .L800C4FB0 -/* 0C59B0 800C4DB0 01204025 */ move $t0, $t1 -/* 0C59B4 800C4DB4 3C188019 */ lui $t8, %hi(D_80192AB8) # $t8, 0x8019 -/* 0C59B8 800C4DB8 27182AB8 */ addiu $t8, %lo(D_80192AB8) # addiu $t8, $t8, 0x2ab8 -/* 0C59BC 800C4DBC 0015C980 */ sll $t9, $s5, 6 -/* 0C59C0 800C4DC0 03383021 */ addu $a2, $t9, $t8 -/* 0C59C4 800C4DC4 240C0003 */ li $t4, 3 -.L800C4DC8: -/* 0C59C8 800C4DC8 000B70C0 */ sll $t6, $t3, 3 -/* 0C59CC 800C4DCC 00CE9821 */ addu $s3, $a2, $t6 -/* 0C59D0 800C4DD0 92650004 */ lbu $a1, 4($s3) -/* 0C59D4 800C4DD4 00001825 */ move $v1, $zero -/* 0C59D8 800C4DD8 16E50003 */ bne $s7, $a1, .L800C4DE8 -/* 0C59DC 800C4DDC 00A01025 */ move $v0, $a1 -/* 0C59E0 800C4DE0 1000003A */ b .L800C4ECC -/* 0C59E4 800C4DE4 24030001 */ li $v1, 1 -.L800C4DE8: -/* 0C59E8 800C4DE8 00B60019 */ multu $a1, $s6 -/* 0C59EC 800C4DEC 00157900 */ sll $t7, $s5, 4 -/* 0C59F0 800C4DF0 01F57823 */ subu $t7, $t7, $s5 -/* 0C59F4 800C4DF4 000F7980 */ sll $t7, $t7, 6 -/* 0C59F8 800C4DF8 03EFC821 */ addu $t9, $ra, $t7 -/* 0C59FC 800C4DFC 24010004 */ li $at, 4 -/* 0C5A00 800C4E00 0000C012 */ mflo $t8 -/* 0C5A04 800C4E04 03382021 */ addu $a0, $t9, $t8 -/* 0C5A08 800C4E08 90870028 */ lbu $a3, 0x28($a0) -/* 0C5A0C 800C4E0C 14E10019 */ bne $a3, $at, .L800C4E74 -/* 0C5A10 800C4E10 00000000 */ nop -/* 0C5A14 800C4E14 8C8E0024 */ lw $t6, 0x24($a0) -/* 0C5A18 800C4E18 24190001 */ li $t9, 1 -/* 0C5A1C 800C4E1C 000E7900 */ sll $t7, $t6, 4 -/* 0C5A20 800C4E20 05E30012 */ bgezl $t7, .L800C4E6C -/* 0C5A24 800C4E24 A0990028 */ sb $t9, 0x28($a0) -/* 0C5A28 800C4E28 32A400FF */ andi $a0, $s5, 0xff -/* 0C5A2C 800C4E2C AFC60070 */ sw $a2, 0x70($fp) -/* 0C5A30 800C4E30 AFC80060 */ sw $t0, 0x60($fp) -/* 0C5A34 800C4E34 A3C900CE */ sb $t1, 0xce($fp) -/* 0C5A38 800C4E38 0C0311CF */ jal delete_sound_from_bank -/* 0C5A3C 800C4E3C A3CB00CC */ sb $t3, 0xcc($fp) -/* 0C5A40 800C4E40 3C1F8019 */ lui $ra, %hi(sSoundBanks) # $ra, 0x8019 -/* 0C5A44 800C4E44 27FF1420 */ addiu $ra, %lo(sSoundBanks) # addiu $ra, $ra, 0x1420 -/* 0C5A48 800C4E48 8FC60070 */ lw $a2, 0x70($fp) -/* 0C5A4C 800C4E4C 8FC80060 */ lw $t0, 0x60($fp) -/* 0C5A50 800C4E50 93C900CE */ lbu $t1, 0xce($fp) -/* 0C5A54 800C4E54 93CB00CC */ lbu $t3, 0xcc($fp) -/* 0C5A58 800C4E58 240C0003 */ li $t4, 3 -/* 0C5A5C 800C4E5C 240D0001 */ li $t5, 1 -/* 0C5A60 800C4E60 1000001A */ b .L800C4ECC -/* 0C5A64 800C4E64 24030001 */ li $v1, 1 -/* 0C5A68 800C4E68 A0990028 */ sb $t9, 0x28($a0) -.L800C4E6C: -/* 0C5A6C 800C4E6C 10000017 */ b .L800C4ECC -/* 0C5A70 800C4E70 24030001 */ li $v1, 1 -.L800C4E74: -/* 0C5A74 800C4E74 14E00004 */ bnez $a3, .L800C4E88 -/* 0C5A78 800C4E78 00000000 */ nop -/* 0C5A7C 800C4E7C A2740004 */ sb $s4, 4($s3) -/* 0C5A80 800C4E80 10000012 */ b .L800C4ECC -/* 0C5A84 800C4E84 24030001 */ li $v1, 1 -.L800C4E88: -/* 0C5A88 800C4E88 1900000D */ blez $t0, .L800C4EC0 -/* 0C5A8C 800C4E8C 00002825 */ move $a1, $zero -.L800C4E90: -/* 0C5A90 800C4E90 0005C0C0 */ sll $t8, $a1, 3 -/* 0C5A94 800C4E94 02382021 */ addu $a0, $s1, $t8 -/* 0C5A98 800C4E98 908E0004 */ lbu $t6, 4($a0) -/* 0C5A9C 800C4E9C 544E0004 */ bnel $v0, $t6, .L800C4EB0 -/* 0C5AA0 800C4EA0 24A50001 */ addiu $a1, $a1, 1 -/* 0C5AA4 800C4EA4 A0940004 */ sb $s4, 4($a0) -/* 0C5AA8 800C4EA8 312500FF */ andi $a1, $t1, 0xff -/* 0C5AAC 800C4EAC 24A50001 */ addiu $a1, $a1, 1 -.L800C4EB0: -/* 0C5AB0 800C4EB0 30AF00FF */ andi $t7, $a1, 0xff -/* 0C5AB4 800C4EB4 01E8082A */ slt $at, $t7, $t0 -/* 0C5AB8 800C4EB8 1420FFF5 */ bnez $at, .L800C4E90 -/* 0C5ABC 800C4EBC 01E02825 */ move $a1, $t7 -.L800C4EC0: -/* 0C5AC0 800C4EC0 2652FFFF */ addiu $s2, $s2, -1 -/* 0C5AC4 800C4EC4 325900FF */ andi $t9, $s2, 0xff -/* 0C5AC8 800C4EC8 03209025 */ move $s2, $t9 -.L800C4ECC: -/* 0C5ACC 800C4ECC 15A30033 */ bne $t5, $v1, .L800C4F9C -/* 0C5AD0 800C4ED0 00605025 */ move $t2, $v1 -/* 0C5AD4 800C4ED4 1900002E */ blez $t0, .L800C4F90 -/* 0C5AD8 800C4ED8 00002825 */ move $a1, $zero -.L800C4EDC: -/* 0C5ADC 800C4EDC 0005C0C0 */ sll $t8, $a1, 3 -/* 0C5AE0 800C4EE0 02382021 */ addu $a0, $s1, $t8 -/* 0C5AE4 800C4EE4 90870004 */ lbu $a3, 4($a0) -/* 0C5AE8 800C4EE8 12E70024 */ beq $s7, $a3, .L800C4F7C -/* 0C5AEC 800C4EEC 00E01025 */ move $v0, $a3 -/* 0C5AF0 800C4EF0 00F60019 */ multu $a3, $s6 -/* 0C5AF4 800C4EF4 00157100 */ sll $t6, $s5, 4 -/* 0C5AF8 800C4EF8 01D57023 */ subu $t6, $t6, $s5 -/* 0C5AFC 800C4EFC 000E7180 */ sll $t6, $t6, 6 -/* 0C5B00 800C4F00 03EE7821 */ addu $t7, $ra, $t6 -/* 0C5B04 800C4F04 0000C812 */ mflo $t9 -/* 0C5B08 800C4F08 01F9C021 */ addu $t8, $t7, $t9 -/* 0C5B0C 800C4F0C 930E0028 */ lbu $t6, 0x28($t8) -/* 0C5B10 800C4F10 518E001B */ beql $t4, $t6, .L800C4F80 -/* 0C5B14 800C4F14 24A50001 */ addiu $a1, $a1, 1 -/* 0C5B18 800C4F18 1900000E */ blez $t0, .L800C4F54 -/* 0C5B1C 800C4F1C 00008025 */ move $s0, $zero -.L800C4F20: -/* 0C5B20 800C4F20 001078C0 */ sll $t7, $s0, 3 -/* 0C5B24 800C4F24 00CFC821 */ addu $t9, $a2, $t7 -/* 0C5B28 800C4F28 93380004 */ lbu $t8, 4($t9) -/* 0C5B2C 800C4F2C 54580004 */ bnel $v0, $t8, .L800C4F40 -/* 0C5B30 800C4F30 26100001 */ addiu $s0, $s0, 1 -/* 0C5B34 800C4F34 00001825 */ move $v1, $zero -/* 0C5B38 800C4F38 313000FF */ andi $s0, $t1, 0xff -/* 0C5B3C 800C4F3C 26100001 */ addiu $s0, $s0, 1 -.L800C4F40: -/* 0C5B40 800C4F40 320E00FF */ andi $t6, $s0, 0xff -/* 0C5B44 800C4F44 01C8082A */ slt $at, $t6, $t0 -/* 0C5B48 800C4F48 1420FFF5 */ bnez $at, .L800C4F20 -/* 0C5B4C 800C4F4C 01C08025 */ move $s0, $t6 -/* 0C5B50 800C4F50 00605025 */ move $t2, $v1 -.L800C4F54: -/* 0C5B54 800C4F54 55AA000A */ bnel $t5, $t2, .L800C4F80 -/* 0C5B58 800C4F58 24A50001 */ addiu $a1, $a1, 1 -/* 0C5B5C 800C4F5C 25050001 */ addiu $a1, $t0, 1 -/* 0C5B60 800C4F60 2652FFFF */ addiu $s2, $s2, -1 -/* 0C5B64 800C4F64 30AF00FF */ andi $t7, $a1, 0xff -/* 0C5B68 800C4F68 325900FF */ andi $t9, $s2, 0xff -/* 0C5B6C 800C4F6C A2670004 */ sb $a3, 4($s3) -/* 0C5B70 800C4F70 A0940004 */ sb $s4, 4($a0) -/* 0C5B74 800C4F74 01E02825 */ move $a1, $t7 -/* 0C5B78 800C4F78 03209025 */ move $s2, $t9 -.L800C4F7C: -/* 0C5B7C 800C4F7C 24A50001 */ addiu $a1, $a1, 1 -.L800C4F80: -/* 0C5B80 800C4F80 30B800FF */ andi $t8, $a1, 0xff -/* 0C5B84 800C4F84 0308082A */ slt $at, $t8, $t0 -/* 0C5B88 800C4F88 1420FFD4 */ bnez $at, .L800C4EDC -/* 0C5B8C 800C4F8C 03002825 */ move $a1, $t8 -.L800C4F90: -/* 0C5B90 800C4F90 55050003 */ bnel $t0, $a1, .L800C4FA0 -/* 0C5B94 800C4F94 256B0001 */ addiu $t3, $t3, 1 -/* 0C5B98 800C4F98 A2740004 */ sb $s4, 4($s3) -.L800C4F9C: -/* 0C5B9C 800C4F9C 256B0001 */ addiu $t3, $t3, 1 -.L800C4FA0: -/* 0C5BA0 800C4FA0 316E00FF */ andi $t6, $t3, 0xff -/* 0C5BA4 800C4FA4 01C8082A */ slt $at, $t6, $t0 -/* 0C5BA8 800C4FA8 1420FF87 */ bnez $at, .L800C4DC8 -/* 0C5BAC 800C4FAC 01C05825 */ move $t3, $t6 -.L800C4FB0: -/* 0C5BB0 800C4FB0 8FDF004C */ lw $ra, 0x4c($fp) -/* 0C5BB4 800C4FB4 03C0E825 */ move $sp, $fp -/* 0C5BB8 800C4FB8 8FD00028 */ lw $s0, 0x28($fp) -/* 0C5BBC 800C4FBC 8FD1002C */ lw $s1, 0x2c($fp) -/* 0C5BC0 800C4FC0 8FD20030 */ lw $s2, 0x30($fp) -/* 0C5BC4 800C4FC4 8FD30034 */ lw $s3, 0x34($fp) -/* 0C5BC8 800C4FC8 8FD40038 */ lw $s4, 0x38($fp) -/* 0C5BCC 800C4FCC 8FD5003C */ lw $s5, 0x3c($fp) -/* 0C5BD0 800C4FD0 8FD60040 */ lw $s6, 0x40($fp) -/* 0C5BD4 800C4FD4 8FD70044 */ lw $s7, 0x44($fp) -/* 0C5BD8 800C4FD8 8FDE0048 */ lw $fp, 0x48($fp) -/* 0C5BDC 800C4FDC 03E00008 */ jr $ra -/* 0C5BE0 800C4FE0 27BD00D0 */ addiu $sp, $sp, 0xd0 diff --git a/asm/non_matchings/audio/external/func_800C4FE4.s b/asm/non_matchings/audio/external/func_800C4FE4.s deleted file mode 100644 index 291ff3e5c8..0000000000 --- a/asm/non_matchings/audio/external/func_800C4FE4.s +++ /dev/null @@ -1,172 +0,0 @@ -glabel func_800C4FE4 -/* 0C5BE4 800C4FE4 3C0E800F */ lui $t6, %hi(D_800EA1C0) # $t6, 0x800f -/* 0C5BE8 800C4FE8 91CEA1C0 */ lbu $t6, %lo(D_800EA1C0)($t6) -/* 0C5BEC 800C4FEC 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0C5BF0 800C4FF0 AFB30034 */ sw $s3, 0x34($sp) -/* 0C5BF4 800C4FF4 000E7880 */ sll $t7, $t6, 2 -/* 0C5BF8 800C4FF8 01EE7823 */ subu $t7, $t7, $t6 -/* 0C5BFC 800C4FFC 309300FF */ andi $s3, $a0, 0xff -/* 0C5C00 800C5000 000F7840 */ sll $t7, $t7, 1 -/* 0C5C04 800C5004 01F3C021 */ addu $t8, $t7, $s3 -/* 0C5C08 800C5008 3C03800F */ lui $v1, %hi(D_800EA188) -/* 0C5C0C 800C500C 00781821 */ addu $v1, $v1, $t8 -/* 0C5C10 800C5010 9063A188 */ lbu $v1, %lo(D_800EA188)($v1) -/* 0C5C14 800C5014 AFBE0048 */ sw $fp, 0x48($sp) -/* 0C5C18 800C5018 AFB40038 */ sw $s4, 0x38($sp) -/* 0C5C1C 800C501C 03A0F025 */ move $fp, $sp -/* 0C5C20 800C5020 AFBF004C */ sw $ra, 0x4c($sp) -/* 0C5C24 800C5024 AFB70044 */ sw $s7, 0x44($sp) -/* 0C5C28 800C5028 AFB60040 */ sw $s6, 0x40($sp) -/* 0C5C2C 800C502C AFB5003C */ sw $s5, 0x3c($sp) -/* 0C5C30 800C5030 AFB20030 */ sw $s2, 0x30($sp) -/* 0C5C34 800C5034 AFB1002C */ sw $s1, 0x2c($sp) -/* 0C5C38 800C5038 AFB00028 */ sw $s0, 0x28($sp) -/* 0C5C3C 800C503C AFA40068 */ sw $a0, 0x68($sp) -/* 0C5C40 800C5040 18600080 */ blez $v1, .L800C5244 -/* 0C5C44 800C5044 0000A025 */ move $s4, $zero -/* 0C5C48 800C5048 3C088019 */ lui $t0, %hi(D_80192AB8) # $t0, 0x8019 -/* 0C5C4C 800C504C 25082AB8 */ addiu $t0, %lo(D_80192AB8) # addiu $t0, $t0, 0x2ab8 -/* 0C5C50 800C5050 0013C980 */ sll $t9, $s3, 6 -/* 0C5C54 800C5054 03284821 */ addu $t1, $t9, $t0 -/* 0C5C58 800C5058 3C178019 */ lui $s7, %hi(D_801930D0) # $s7, 0x8019 -/* 0C5C5C 800C505C 3C16800F */ lui $s6, %hi(D_800EA1C4) # $s6, 0x800f -/* 0C5C60 800C5060 3C128019 */ lui $s2, %hi(D_80192C38) # $s2, 0x8019 -/* 0C5C64 800C5064 26522C38 */ addiu $s2, %lo(D_80192C38) # addiu $s2, $s2, 0x2c38 -/* 0C5C68 800C5068 26D6A1C4 */ addiu $s6, %lo(D_800EA1C4) # addiu $s6, $s6, -0x5e3c -/* 0C5C6C 800C506C 26F730D0 */ addiu $s7, %lo(D_801930D0) # addiu $s7, $s7, 0x30d0 -/* 0C5C70 800C5070 AFA90050 */ sw $t1, 0x50($sp) -/* 0C5C74 800C5074 3C150602 */ lui $s5, 0x602 -.L800C5078: -/* 0C5C78 800C5078 8FCA0050 */ lw $t2, 0x50($fp) -/* 0C5C7C 800C507C 001458C0 */ sll $t3, $s4, 3 -/* 0C5C80 800C5080 240100FF */ li $at, 255 -/* 0C5C84 800C5084 014B6021 */ addu $t4, $t2, $t3 -/* 0C5C88 800C5088 91910004 */ lbu $s1, 4($t4) -/* 0C5C8C 800C508C 00137100 */ sll $t6, $s3, 4 -/* 0C5C90 800C5090 3C04803B */ lui $a0, %hi(gSequencePlayers+0x2C0) # 0x803b -/* 0C5C94 800C5094 12210063 */ beq $s1, $at, .L800C5224 -/* 0C5C98 800C5098 01D37023 */ subu $t6, $t6, $s3 -/* 0C5C9C 800C509C 00117880 */ sll $t7, $s1, 2 -/* 0C5CA0 800C50A0 01F17823 */ subu $t7, $t7, $s1 -/* 0C5CA4 800C50A4 000F7900 */ sll $t7, $t7, 4 -/* 0C5CA8 800C50A8 000E7180 */ sll $t6, $t6, 6 -/* 0C5CAC 800C50AC 3C198019 */ lui $t9, %hi(sSoundBanks) # $t9, 0x8019 -/* 0C5CB0 800C50B0 92460000 */ lbu $a2, ($s2) -/* 0C5CB4 800C50B4 27391420 */ addiu $t9, %lo(sSoundBanks) # addiu $t9, $t9, 0x1420 -/* 0C5CB8 800C50B8 01CFC021 */ addu $t8, $t6, $t7 -/* 0C5CBC 800C50BC 03198021 */ addu $s0, $t8, $t9 -/* 0C5CC0 800C50C0 92020028 */ lbu $v0, 0x28($s0) -/* 0C5CC4 800C50C4 00066880 */ sll $t5, $a2, 2 -/* 0C5CC8 800C50C8 008D2021 */ addu $a0, $a0, $t5 -/* 0C5CCC 800C50CC 24010002 */ li $at, 2 -/* 0C5CD0 800C50D0 1441002D */ bne $v0, $at, .L800C5188 -/* 0C5CD4 800C50D4 8C8417D0 */ lw $a0, %lo(gSequencePlayers+0x2C0)($a0) # 0x17d0($a0) -/* 0C5CD8 800C50D8 8E080024 */ lw $t0, 0x24($s0) -/* 0C5CDC 800C50DC A206002C */ sb $a2, 0x2c($s0) -/* 0C5CE0 800C50E0 326400FF */ andi $a0, $s3, 0xff -/* 0C5CE4 800C50E4 00084B00 */ sll $t1, $t0, 0xc -/* 0C5CE8 800C50E8 0521000B */ bgez $t1, .L800C5118 -/* 0C5CEC 800C50EC 322500FF */ andi $a1, $s1, 0xff -/* 0C5CF0 800C50F0 924B0000 */ lbu $t3, ($s2) -/* 0C5CF4 800C50F4 96CA0000 */ lhu $t2, ($s6) -/* 0C5CF8 800C50F8 240C0001 */ li $t4, 1 -/* 0C5CFC 800C50FC 016C6804 */ sllv $t5, $t4, $t3 -/* 0C5D00 800C5100 240F0001 */ li $t7, 1 -/* 0C5D04 800C5104 24180028 */ li $t8, 40 -/* 0C5D08 800C5108 014D7025 */ or $t6, $t2, $t5 -/* 0C5D0C 800C510C A6CE0000 */ sh $t6, ($s6) -/* 0C5D10 800C5110 A2EF0012 */ sb $t7, 0x12($s7) -/* 0C5D14 800C5114 A2F80010 */ sb $t8, 0x10($s7) -.L800C5118: -/* 0C5D18 800C5118 0C030674 */ jal func_800C19D0 -/* 0C5D1C 800C511C 92460000 */ lbu $a2, ($s2) -/* 0C5D20 800C5120 92480000 */ lbu $t0, ($s2) -/* 0C5D24 800C5124 24050001 */ li $a1, 1 -/* 0C5D28 800C5128 00084A00 */ sll $t1, $t0, 8 -/* 0C5D2C 800C512C 0C032EFA */ jal func_800CBBE8 -/* 0C5D30 800C5130 01352025 */ or $a0, $t1, $s5 -/* 0C5D34 800C5134 924B0000 */ lbu $t3, ($s2) -/* 0C5D38 800C5138 8E0F0024 */ lw $t7, 0x24($s0) -/* 0C5D3C 800C513C 000B5200 */ sll $t2, $t3, 8 -/* 0C5D40 800C5140 01552025 */ or $a0, $t2, $s5 -/* 0C5D44 800C5144 348D0004 */ ori $t5, $a0, 4 -/* 0C5D48 800C5148 000FC600 */ sll $t8, $t7, 0x18 -/* 0C5D4C 800C514C 00182E03 */ sra $a1, $t8, 0x18 -/* 0C5D50 800C5150 0C032EFA */ jal func_800CBBE8 -/* 0C5D54 800C5154 01A02025 */ move $a0, $t5 -/* 0C5D58 800C5158 24080004 */ li $t0, 4 -/* 0C5D5C 800C515C A2080028 */ sb $t0, 0x28($s0) -/* 0C5D60 800C5160 3C09800F */ lui $t1, %hi(D_800EA1C0) # $t1, 0x800f -/* 0C5D64 800C5164 9129A1C0 */ lbu $t1, %lo(D_800EA1C0)($t1) -/* 0C5D68 800C5168 3C03800F */ lui $v1, %hi(D_800EA188) -/* 0C5D6C 800C516C 00096080 */ sll $t4, $t1, 2 -/* 0C5D70 800C5170 01896023 */ subu $t4, $t4, $t1 -/* 0C5D74 800C5174 000C6040 */ sll $t4, $t4, 1 -/* 0C5D78 800C5178 01935821 */ addu $t3, $t4, $s3 -/* 0C5D7C 800C517C 006B1821 */ addu $v1, $v1, $t3 -/* 0C5D80 800C5180 10000028 */ b .L800C5224 -/* 0C5D84 800C5184 9063A188 */ lbu $v1, %lo(D_800EA188)($v1) -.L800C5188: -/* 0C5D88 800C5188 908A005F */ lbu $t2, 0x5f($a0) -/* 0C5D8C 800C518C 24010080 */ li $at, 128 -/* 0C5D90 800C5190 30CD00FF */ andi $t5, $a2, 0xff -/* 0C5D94 800C5194 15410013 */ bne $t2, $at, .L800C51E4 -/* 0C5D98 800C5198 000D7200 */ sll $t6, $t5, 8 -/* 0C5D9C 800C519C 01D52025 */ or $a0, $t6, $s5 -/* 0C5DA0 800C51A0 348F0007 */ ori $t7, $a0, 7 -/* 0C5DA4 800C51A4 01E02025 */ move $a0, $t7 -/* 0C5DA8 800C51A8 0C032EFA */ jal func_800CBBE8 -/* 0C5DAC 800C51AC 00002825 */ move $a1, $zero -/* 0C5DB0 800C51B0 326400FF */ andi $a0, $s3, 0xff -/* 0C5DB4 800C51B4 0C0311CF */ jal delete_sound_from_bank -/* 0C5DB8 800C51B8 322500FF */ andi $a1, $s1, 0xff -/* 0C5DBC 800C51BC 3C18800F */ lui $t8, %hi(D_800EA1C0) # $t8, 0x800f -/* 0C5DC0 800C51C0 9318A1C0 */ lbu $t8, %lo(D_800EA1C0)($t8) -/* 0C5DC4 800C51C4 3C03800F */ lui $v1, %hi(D_800EA188) -/* 0C5DC8 800C51C8 0018C880 */ sll $t9, $t8, 2 -/* 0C5DCC 800C51CC 0338C823 */ subu $t9, $t9, $t8 -/* 0C5DD0 800C51D0 0019C840 */ sll $t9, $t9, 1 -/* 0C5DD4 800C51D4 03334021 */ addu $t0, $t9, $s3 -/* 0C5DD8 800C51D8 00681821 */ addu $v1, $v1, $t0 -/* 0C5DDC 800C51DC 10000011 */ b .L800C5224 -/* 0C5DE0 800C51E0 9063A188 */ lbu $v1, %lo(D_800EA188)($v1) -.L800C51E4: -/* 0C5DE4 800C51E4 24010003 */ li $at, 3 -/* 0C5DE8 800C51E8 1441000E */ bne $v0, $at, .L800C5224 -/* 0C5DEC 800C51EC 326400FF */ andi $a0, $s3, 0xff -/* 0C5DF0 800C51F0 0C030674 */ jal func_800C19D0 -/* 0C5DF4 800C51F4 322500FF */ andi $a1, $s1, 0xff -/* 0C5DF8 800C51F8 24090004 */ li $t1, 4 -/* 0C5DFC 800C51FC A2090028 */ sb $t1, 0x28($s0) -/* 0C5E00 800C5200 3C0C800F */ lui $t4, %hi(D_800EA1C0) # $t4, 0x800f -/* 0C5E04 800C5204 918CA1C0 */ lbu $t4, %lo(D_800EA1C0)($t4) -/* 0C5E08 800C5208 3C03800F */ lui $v1, %hi(D_800EA188) -/* 0C5E0C 800C520C 000C5880 */ sll $t3, $t4, 2 -/* 0C5E10 800C5210 016C5823 */ subu $t3, $t3, $t4 -/* 0C5E14 800C5214 000B5840 */ sll $t3, $t3, 1 -/* 0C5E18 800C5218 01735021 */ addu $t2, $t3, $s3 -/* 0C5E1C 800C521C 006A1821 */ addu $v1, $v1, $t2 -/* 0C5E20 800C5220 9063A188 */ lbu $v1, %lo(D_800EA188)($v1) -.L800C5224: -/* 0C5E24 800C5224 924D0000 */ lbu $t5, ($s2) -/* 0C5E28 800C5228 26940001 */ addiu $s4, $s4, 1 -/* 0C5E2C 800C522C 328F00FF */ andi $t7, $s4, 0xff -/* 0C5E30 800C5230 01E3082A */ slt $at, $t7, $v1 -/* 0C5E34 800C5234 25AE0001 */ addiu $t6, $t5, 1 -/* 0C5E38 800C5238 01E0A025 */ move $s4, $t7 -/* 0C5E3C 800C523C 1420FF8E */ bnez $at, .L800C5078 -/* 0C5E40 800C5240 A24E0000 */ sb $t6, ($s2) -.L800C5244: -/* 0C5E44 800C5244 8FDF004C */ lw $ra, 0x4c($fp) -/* 0C5E48 800C5248 03C0E825 */ move $sp, $fp -/* 0C5E4C 800C524C 8FD00028 */ lw $s0, 0x28($fp) -/* 0C5E50 800C5250 8FD1002C */ lw $s1, 0x2c($fp) -/* 0C5E54 800C5254 8FD20030 */ lw $s2, 0x30($fp) -/* 0C5E58 800C5258 8FD30034 */ lw $s3, 0x34($fp) -/* 0C5E5C 800C525C 8FD40038 */ lw $s4, 0x38($fp) -/* 0C5E60 800C5260 8FD5003C */ lw $s5, 0x3c($fp) -/* 0C5E64 800C5264 8FD60040 */ lw $s6, 0x40($fp) -/* 0C5E68 800C5268 8FD70044 */ lw $s7, 0x44($fp) -/* 0C5E6C 800C526C 8FDE0048 */ lw $fp, 0x48($fp) -/* 0C5E70 800C5270 03E00008 */ jr $ra -/* 0C5E74 800C5274 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/asm/non_matchings/audio/load/audio_init.s b/asm/non_matchings/audio/load/audio_init.s deleted file mode 100644 index 9ada92584e..0000000000 --- a/asm/non_matchings/audio/load/audio_init.s +++ /dev/null @@ -1,345 +0,0 @@ -.section .late_rodata - -glabel D_800F2EA0 -.float 20.0304203 - -glabel D_800F2EA4 -.float 16.546 - -glabel D_800F2EA8 -.float 16.713 - -.section .text - -glabel audio_init -/* 0BCCDC 800BC0DC 27BDFF70 */ addiu $sp, $sp, -0x90 -/* 0BCCE0 800BC0E0 3C0E800F */ lui $t6, %hi(gAudioLoadLock) # $t6, 0x800f -/* 0BCCE4 800BC0E4 AFBF002C */ sw $ra, 0x2c($sp) -/* 0BCCE8 800BC0E8 AFB50028 */ sw $s5, 0x28($sp) -/* 0BCCEC 800BC0EC AFB40024 */ sw $s4, 0x24($sp) -/* 0BCCF0 800BC0F0 AFB30020 */ sw $s3, 0x20($sp) -/* 0BCCF4 800BC0F4 AFB2001C */ sw $s2, 0x1c($sp) -/* 0BCCF8 800BC0F8 AFB10018 */ sw $s1, 0x18($sp) -/* 0BCCFC 800BC0FC AFB00014 */ sw $s0, 0x14($sp) -/* 0BCD00 800BC100 25CEA5DC */ addiu $t6, %lo(gAudioLoadLock) # addiu $t6, $t6, -0x5a24 -/* 0BCD04 800BC104 ADC00000 */ sw $zero, ($t6) -/* 0BCD08 800BC108 3C04800F */ lui $a0, %hi(gAudioHeapSize) # $a0, 0x800f -/* 0BCD0C 800BC10C 8C84A5D0 */ lw $a0, %lo(gAudioHeapSize)($a0) -/* 0BCD10 800BC110 00001825 */ move $v1, $zero -/* 0BCD14 800BC114 3C0A803B */ lui $t2, %hi(gAudioGlobalsEndMarker) # $t2, 0x803b -/* 0BCD18 800BC118 04810003 */ bgez $a0, .L800BC128 -/* 0BCD1C 800BC11C 000478C3 */ sra $t7, $a0, 3 -/* 0BCD20 800BC120 24810007 */ addiu $at, $a0, 7 -/* 0BCD24 800BC124 000178C3 */ sra $t7, $at, 3 -.L800BC128: -/* 0BCD28 800BC128 19E0000C */ blez $t7, .L800BC15C -/* 0BCD2C 800BC12C 3C04803B */ lui $a0, %hi(gGfxSPTaskOutputBufferSize) # 0x803b -/* 0BCD30 800BC130 3C18803B */ lui $t8, %hi(gAudioHeap) # 0x803b -/* 0BCD34 800BC134 270271B0 */ addiu $v0, $t8, %lo(gAudioHeap) # 0x71b0 -/* 0BCD38 800BC138 000FC8C0 */ sll $t9, $t7, 3 -/* 0BCD3C 800BC13C 03221821 */ addu $v1, $t9, $v0 -.L800BC140: -/* 0BCD40 800BC140 24420008 */ addiu $v0, $v0, 8 -/* 0BCD44 800BC144 0043082B */ sltu $at, $v0, $v1 -/* 0BCD48 800BC148 24080000 */ li $t0, 0 -/* 0BCD4C 800BC14C 24090000 */ li $t1, 0 -/* 0BCD50 800BC150 AC49FFFC */ sw $t1, -4($v0) -/* 0BCD54 800BC154 1420FFFA */ bnez $at, .L800BC140 -/* 0BCD58 800BC158 AC48FFF8 */ sw $t0, -8($v0) -.L800BC15C: -/* 0BCD5C 800BC15C 2482F780 */ addiu $v0, $a0, %lo(gGfxSPTaskOutputBufferSize) # -0x880 -/* 0BCD60 800BC160 254A71A0 */ addiu $t2, %lo(gAudioGlobalsEndMarker) # addiu $t2, $t2, 0x71a0 -/* 0BCD64 800BC164 01421823 */ subu $v1, $t2, $v0 -/* 0BCD68 800BC168 000380C2 */ srl $s0, $v1, 3 -/* 0BCD6C 800BC16C 06000007 */ bltz $s0, .L800BC18C -.L800BC170: -/* 0BCD70 800BC170 2610FFFF */ addiu $s0, $s0, -1 -/* 0BCD74 800BC174 240C0000 */ li $t4, 0 -/* 0BCD78 800BC178 240D0000 */ li $t5, 0 -/* 0BCD7C 800BC17C AC4D0004 */ sw $t5, 4($v0) -/* 0BCD80 800BC180 AC4C0000 */ sw $t4, ($v0) -/* 0BCD84 800BC184 0601FFFA */ bgez $s0, .L800BC170 -/* 0BCD88 800BC188 24420008 */ addiu $v0, $v0, 8 -.L800BC18C: -/* 0BCD8C 800BC18C 3C028000 */ lui $v0, %hi(osTvType) # $v0, 0x8000 -/* 0BCD90 800BC190 8C420300 */ lw $v0, %lo(osTvType)($v0) -/* 0BCD94 800BC194 10400007 */ beqz $v0, .L800BC1B4 -/* 0BCD98 800BC198 24010001 */ li $at, 1 -/* 0BCD9C 800BC19C 10410015 */ beq $v0, $at, .L800BC1F4 -/* 0BCDA0 800BC1A0 24010002 */ li $at, 2 -/* 0BCDA4 800BC1A4 1041000B */ beq $v0, $at, .L800BC1D4 -/* 0BCDA8 800BC1A8 00000000 */ nop -/* 0BCDAC 800BC1AC 10000011 */ b .L800BC1F4 -/* 0BCDB0 800BC1B0 00000000 */ nop -.L800BC1B4: -/* 0BCDB4 800BC1B4 3C01800F */ lui $at, %hi(D_800F2EA0) # $at, 0x800f -/* 0BCDB8 800BC1B8 C4242EA0 */ lwc1 $f4, %lo(D_800F2EA0)($at) -/* 0BCDBC 800BC1BC 3C01803B */ lui $at, %hi(D_803B7178) # $at, 0x803b -/* 0BCDC0 800BC1C0 240E0032 */ li $t6, 50 -/* 0BCDC4 800BC1C4 E4247178 */ swc1 $f4, %lo(D_803B7178)($at) -/* 0BCDC8 800BC1C8 3C01803B */ lui $at, %hi(gRefreshRate) # $at, 0x803b -/* 0BCDCC 800BC1CC 10000010 */ b .L800BC210 -/* 0BCDD0 800BC1D0 AC2E717C */ sw $t6, %lo(gRefreshRate)($at) -.L800BC1D4: -/* 0BCDD4 800BC1D4 3C01800F */ lui $at, %hi(D_800F2EA4) # $at, 0x800f -/* 0BCDD8 800BC1D8 C4262EA4 */ lwc1 $f6, %lo(D_800F2EA4)($at) -/* 0BCDDC 800BC1DC 3C01803B */ lui $at, %hi(D_803B7178) # $at, 0x803b -/* 0BCDE0 800BC1E0 240F003C */ li $t7, 60 -/* 0BCDE4 800BC1E4 E4267178 */ swc1 $f6, %lo(D_803B7178)($at) -/* 0BCDE8 800BC1E8 3C01803B */ lui $at, %hi(gRefreshRate) # $at, 0x803b -/* 0BCDEC 800BC1EC 10000008 */ b .L800BC210 -/* 0BCDF0 800BC1F0 AC2F717C */ sw $t7, %lo(gRefreshRate)($at) -.L800BC1F4: -/* 0BCDF4 800BC1F4 3C01800F */ lui $at, %hi(D_800F2EA8) # $at, 0x800f -/* 0BCDF8 800BC1F8 C4282EA8 */ lwc1 $f8, %lo(D_800F2EA8)($at) -/* 0BCDFC 800BC1FC 3C01803B */ lui $at, %hi(D_803B7178) # $at, 0x803b -/* 0BCE00 800BC200 2419003C */ li $t9, 60 -/* 0BCE04 800BC204 E4287178 */ swc1 $f8, %lo(D_803B7178)($at) -/* 0BCE08 800BC208 3C01803B */ lui $at, %hi(gRefreshRate) # $at, 0x803b -/* 0BCE0C 800BC20C AC39717C */ sw $t9, %lo(gRefreshRate)($at) -.L800BC210: -/* 0BCE10 800BC210 0C032FD2 */ jal port_eu_init -/* 0BCE14 800BC214 00000000 */ nop -/* 0BCE18 800BC218 3C02803B */ lui $v0, %hi(gAiBufferLengths) # $v0, 0x803b -/* 0BCE1C 800BC21C 3C04803B */ lui $a0, %hi(D_803B7192) # $a0, 0x803b -/* 0BCE20 800BC220 24847192 */ addiu $a0, %lo(D_803B7192) # addiu $a0, $a0, 0x7192 -/* 0BCE24 800BC224 2442718C */ addiu $v0, %lo(gAiBufferLengths) # addiu $v0, $v0, 0x718c -/* 0BCE28 800BC228 240300A0 */ li $v1, 160 -.L800BC22C: -/* 0BCE2C 800BC22C 24420002 */ addiu $v0, $v0, 2 -/* 0BCE30 800BC230 0044082B */ sltu $at, $v0, $a0 -/* 0BCE34 800BC234 1420FFFD */ bnez $at, .L800BC22C -/* 0BCE38 800BC238 A443FFFE */ sh $v1, -2($v0) -/* 0BCE3C 800BC23C 3C18803B */ lui $t8, %hi(gAudioFrameCount) # $t8, 0x803b -/* 0BCE40 800BC240 271870B8 */ addiu $t8, %lo(gAudioFrameCount) # addiu $t8, $t8, 0x70b8 -/* 0BCE44 800BC244 AF000000 */ sw $zero, ($t8) -/* 0BCE48 800BC248 3C01803B */ lui $at, %hi(gAudioTaskIndex) # $at, 0x803b -/* 0BCE4C 800BC24C AC2070C0 */ sw $zero, %lo(gAudioTaskIndex)($at) -/* 0BCE50 800BC250 3C01803B */ lui $at, %hi(gCurrAiBufferIndex) # $at, 0x803b -/* 0BCE54 800BC254 AC2070C4 */ sw $zero, %lo(gCurrAiBufferIndex)($at) -/* 0BCE58 800BC258 3C01803B */ lui $at, %hi(gAudioLibSoundMode) # $at, 0x803b -/* 0BCE5C 800BC25C A02070B6 */ sb $zero, %lo(gAudioLibSoundMode)($at) -/* 0BCE60 800BC260 3C02803B */ lui $v0, %hi(gAudioTasks) # $v0, 0x803b -/* 0BCE64 800BC264 3C01803B */ lui $at, %hi(gAudioTask) # $at, 0x803b -/* 0BCE68 800BC268 244270D8 */ addiu $v0, %lo(gAudioTasks) # addiu $v0, $v0, 0x70d8 -/* 0BCE6C 800BC26C AC2070D4 */ sw $zero, %lo(gAudioTask)($at) -/* 0BCE70 800BC270 3C04803B */ lui $a0, %hi(D_803B6720) # $a0, 0x803b -/* 0BCE74 800BC274 3C05803B */ lui $a1, %hi(D_803B6738) # $a1, 0x803b -/* 0BCE78 800BC278 AC400034 */ sw $zero, 0x34($v0) -/* 0BCE7C 800BC27C AC400084 */ sw $zero, 0x84($v0) -/* 0BCE80 800BC280 24A56738 */ addiu $a1, %lo(D_803B6738) # addiu $a1, $a1, 0x6738 -/* 0BCE84 800BC284 24846720 */ addiu $a0, %lo(D_803B6720) # addiu $a0, $a0, 0x6720 -/* 0BCE88 800BC288 0C033358 */ jal osCreateMesgQueue -/* 0BCE8C 800BC28C 24060001 */ li $a2, 1 -/* 0BCE90 800BC290 3C04803B */ lui $a0, %hi(gCurrAudioFrameDmaQueue) # $a0, 0x803b -/* 0BCE94 800BC294 3C05803B */ lui $a1, %hi(gCurrAudioFrameDmaMesgBufs) # $a1, 0x803b -/* 0BCE98 800BC298 24A56020 */ addiu $a1, %lo(gCurrAudioFrameDmaMesgBufs) # addiu $a1, $a1, 0x6020 -/* 0BCE9C 800BC29C 24846008 */ addiu $a0, %lo(gCurrAudioFrameDmaQueue) # addiu $a0, $a0, 0x6008 -/* 0BCEA0 800BC2A0 0C033358 */ jal osCreateMesgQueue -/* 0BCEA4 800BC2A4 24060040 */ li $a2, 64 -/* 0BCEA8 800BC2A8 3C01803B */ lui $at, %hi(gCurrAudioFrameDmaCount) # $at, 0x803b -/* 0BCEAC 800BC2AC AC2070BC */ sw $zero, %lo(gCurrAudioFrameDmaCount)($at) -/* 0BCEB0 800BC2B0 3C01803B */ lui $at, %hi(gSampleDmaNumListItems) # $at, 0x803b -/* 0BCEB4 800BC2B4 3C04800F */ lui $a0, %hi(gAudioInitPoolSize) # $a0, 0x800f -/* 0BCEB8 800BC2B8 AC206E58 */ sw $zero, %lo(gSampleDmaNumListItems)($at) -/* 0BCEBC 800BC2BC 0C02E43C */ jal sound_init_main_pools -/* 0BCEC0 800BC2C0 8C84A5D4 */ lw $a0, %lo(gAudioInitPoolSize)($a0) -/* 0BCEC4 800BC2C4 3C06803B */ lui $a2, %hi(gAiBuffers) # $a2, 0x803b -/* 0BCEC8 800BC2C8 3C14803B */ lui $s4, %hi(gAudioInitPool) # $s4, 0x803b -/* 0BCECC 800BC2CC 3C11803B */ lui $s1, %hi(gAiBufferLengths) # $s1, 0x803b -/* 0BCED0 800BC2D0 2631718C */ addiu $s1, %lo(gAiBufferLengths) # addiu $s1, $s1, 0x718c -/* 0BCED4 800BC2D4 2694FBD8 */ addiu $s4, %lo(gAudioInitPool) # addiu $s4, $s4, -0x428 -/* 0BCED8 800BC2D8 24C67180 */ addiu $a2, %lo(gAiBuffers) # addiu $a2, $a2, 0x7180 -/* 0BCEDC 800BC2DC 24100A00 */ li $s0, 2560 -/* 0BCEE0 800BC2E0 02802025 */ move $a0, $s4 -.L800BC2E4: -/* 0BCEE4 800BC2E4 24050A00 */ li $a1, 2560 -/* 0BCEE8 800BC2E8 0C02E3FF */ jal soundAlloc -/* 0BCEEC 800BC2EC AFA6003C */ sw $a2, 0x3c($sp) -/* 0BCEF0 800BC2F0 8FA6003C */ lw $a2, 0x3c($sp) -/* 0BCEF4 800BC2F4 00001825 */ move $v1, $zero -/* 0BCEF8 800BC2F8 ACC20000 */ sw $v0, ($a2) -.L800BC2FC: -/* 0BCEFC 800BC2FC 8CC80000 */ lw $t0, ($a2) -/* 0BCF00 800BC300 01034821 */ addu $t1, $t0, $v1 -/* 0BCF04 800BC304 A5200000 */ sh $zero, ($t1) -/* 0BCF08 800BC308 8CCA0000 */ lw $t2, ($a2) -/* 0BCF0C 800BC30C 01435821 */ addu $t3, $t2, $v1 -/* 0BCF10 800BC310 A5600002 */ sh $zero, 2($t3) -/* 0BCF14 800BC314 8CCC0000 */ lw $t4, ($a2) -/* 0BCF18 800BC318 01836821 */ addu $t5, $t4, $v1 -/* 0BCF1C 800BC31C A5A00004 */ sh $zero, 4($t5) -/* 0BCF20 800BC320 8CCE0000 */ lw $t6, ($a2) -/* 0BCF24 800BC324 01C37821 */ addu $t7, $t6, $v1 -/* 0BCF28 800BC328 24630008 */ addiu $v1, $v1, 8 -/* 0BCF2C 800BC32C 1470FFF3 */ bne $v1, $s0, .L800BC2FC -/* 0BCF30 800BC330 A5E00006 */ sh $zero, 6($t7) -/* 0BCF34 800BC334 24C60004 */ addiu $a2, $a2, 4 -/* 0BCF38 800BC338 00D1082B */ sltu $at, $a2, $s1 -/* 0BCF3C 800BC33C 5420FFE9 */ bnel $at, $zero, .L800BC2E4 -/* 0BCF40 800BC340 02802025 */ move $a0, $s4 -/* 0BCF44 800BC344 3C01803B */ lui $at, %hi(gAudioResetPresetIdToLoad) # $at, 0x803b -/* 0BCF48 800BC348 3C18803B */ lui $t8, %hi(gAudioResetStatus) # $t8, 0x803b -/* 0BCF4C 800BC34C A0200501 */ sb $zero, %lo(gAudioResetPresetIdToLoad)($at) -/* 0BCF50 800BC350 27180500 */ addiu $t8, %lo(gAudioResetStatus) # addiu $t8, $t8, 0x500 -/* 0BCF54 800BC354 24190001 */ li $t9, 1 -/* 0BCF58 800BC358 0C02E803 */ jal audio_shut_down_and_reset_step -/* 0BCF5C 800BC35C A3190000 */ sb $t9, ($t8) -/* 0BCF60 800BC360 3C11803B */ lui $s1, %hi(gSeqFileHeader) # $s1, 0x803b -/* 0BCF64 800BC364 3C1200BC */ lui $s2, %hi(_sequencesSegmentRomStart) # $s2, 0xbc -/* 0BCF68 800BC368 26525F60 */ addiu $s2, %lo(_sequencesSegmentRomStart) # addiu $s2, $s2, 0x5f60 -/* 0BCF6C 800BC36C 2631706C */ addiu $s1, %lo(gSeqFileHeader) # addiu $s1, $s1, 0x706c -/* 0BCF70 800BC370 27B50060 */ addiu $s5, $sp, 0x60 -/* 0BCF74 800BC374 AE350000 */ sw $s5, ($s1) -/* 0BCF78 800BC378 02A02825 */ move $a1, $s5 -/* 0BCF7C 800BC37C 02402025 */ move $a0, $s2 -/* 0BCF80 800BC380 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BCF84 800BC384 24060010 */ li $a2, 16 -/* 0BCF88 800BC388 8E280000 */ lw $t0, ($s1) -/* 0BCF8C 800BC38C 3C02803B */ lui $v0, %hi(gSequenceCount) # $v0, 0x803b -/* 0BCF90 800BC390 2401FFF0 */ li $at, -16 -/* 0BCF94 800BC394 85090002 */ lh $t1, 2($t0) -/* 0BCF98 800BC398 2442707C */ addiu $v0, %lo(gSequenceCount) # addiu $v0, $v0, 0x707c -/* 0BCF9C 800BC39C 02802025 */ move $a0, $s4 -/* 0BCFA0 800BC3A0 3130FFFF */ andi $s0, $t1, 0xffff -/* 0BCFA4 800BC3A4 001050C0 */ sll $t2, $s0, 3 -/* 0BCFA8 800BC3A8 01408025 */ move $s0, $t2 -/* 0BCFAC 800BC3AC 26100013 */ addiu $s0, $s0, 0x13 -/* 0BCFB0 800BC3B0 02012824 */ and $a1, $s0, $at -/* 0BCFB4 800BC3B4 00A08025 */ move $s0, $a1 -/* 0BCFB8 800BC3B8 0C02E3FF */ jal soundAlloc -/* 0BCFBC 800BC3BC A4490000 */ sh $t1, ($v0) -/* 0BCFC0 800BC3C0 AE220000 */ sw $v0, ($s1) -/* 0BCFC4 800BC3C4 02402025 */ move $a0, $s2 -/* 0BCFC8 800BC3C8 00402825 */ move $a1, $v0 -/* 0BCFCC 800BC3CC 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BCFD0 800BC3D0 02003025 */ move $a2, $s0 -/* 0BCFD4 800BC3D4 8E240000 */ lw $a0, ($s1) -/* 0BCFD8 800BC3D8 0C02ED0F */ jal func_800BB43C -/* 0BCFDC 800BC3DC 02402825 */ move $a1, $s2 -/* 0BCFE0 800BC3E0 3C110096 */ lui $s1, %hi(_audio_banksSegmentRomStart) # $s1, 0x96 -/* 0BCFE4 800BC3E4 3C12803B */ lui $s2, %hi(gAlCtlHeader) # $s2, 0x803b -/* 0BCFE8 800BC3E8 26527070 */ addiu $s2, %lo(gAlCtlHeader) # addiu $s2, $s2, 0x7070 -/* 0BCFEC 800BC3EC 26316260 */ addiu $s1, %lo(_audio_banksSegmentRomStart) # addiu $s1, $s1, 0x6260 -/* 0BCFF0 800BC3F0 AE550000 */ sw $s5, ($s2) -/* 0BCFF4 800BC3F4 02202025 */ move $a0, $s1 -/* 0BCFF8 800BC3F8 02A02825 */ move $a1, $s5 -/* 0BCFFC 800BC3FC 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BD000 800BC400 24060010 */ li $a2, 16 -/* 0BD004 800BC404 8E4C0000 */ lw $t4, ($s2) -/* 0BD008 800BC408 2401FFF0 */ li $at, -16 -/* 0BD00C 800BC40C 02802025 */ move $a0, $s4 -/* 0BD010 800BC410 85930002 */ lh $s3, 2($t4) -/* 0BD014 800BC414 001380C0 */ sll $s0, $s3, 3 -/* 0BD018 800BC418 26100013 */ addiu $s0, $s0, 0x13 -/* 0BD01C 800BC41C 02012824 */ and $a1, $s0, $at -/* 0BD020 800BC420 0C02E3FF */ jal soundAlloc -/* 0BD024 800BC424 00A08025 */ move $s0, $a1 -/* 0BD028 800BC428 AE420000 */ sw $v0, ($s2) -/* 0BD02C 800BC42C 02202025 */ move $a0, $s1 -/* 0BD030 800BC430 00402825 */ move $a1, $v0 -/* 0BD034 800BC434 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BD038 800BC438 02003025 */ move $a2, $s0 -/* 0BD03C 800BC43C 8E440000 */ lw $a0, ($s2) -/* 0BD040 800BC440 0C02ED0F */ jal func_800BB43C -/* 0BD044 800BC444 02202825 */ move $a1, $s1 -/* 0BD048 800BC448 00132880 */ sll $a1, $s3, 2 -/* 0BD04C 800BC44C 00B32823 */ subu $a1, $a1, $s3 -/* 0BD050 800BC450 00052880 */ sll $a1, $a1, 2 -/* 0BD054 800BC454 0C02E3FF */ jal soundAlloc -/* 0BD058 800BC458 02802025 */ move $a0, $s4 -/* 0BD05C 800BC45C 3C07803B */ lui $a3, %hi(gCtlEntries) # $a3, 0x803b -/* 0BD060 800BC460 24E77080 */ addiu $a3, %lo(gCtlEntries) # addiu $a3, $a3, 0x7080 -/* 0BD064 800BC464 ACE20000 */ sw $v0, ($a3) -/* 0BD068 800BC468 1A600019 */ blez $s3, .L800BC4D0 -/* 0BD06C 800BC46C 00001825 */ move $v1, $zero -/* 0BD070 800BC470 00008825 */ move $s1, $zero -/* 0BD074 800BC474 00008025 */ move $s0, $zero -.L800BC478: -/* 0BD078 800BC478 8E4E0000 */ lw $t6, ($s2) -/* 0BD07C 800BC47C 02A02825 */ move $a1, $s5 -/* 0BD080 800BC480 24060010 */ li $a2, 16 -/* 0BD084 800BC484 01D17821 */ addu $t7, $t6, $s1 -/* 0BD088 800BC488 8DE40004 */ lw $a0, 4($t7) -/* 0BD08C 800BC48C 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BD090 800BC490 AFA3008C */ sw $v1, 0x8c($sp) -/* 0BD094 800BC494 3C07803B */ lui $a3, %hi(gCtlEntries) # $a3, 0x803b -/* 0BD098 800BC498 24E77080 */ addiu $a3, %lo(gCtlEntries) # addiu $a3, $a3, 0x7080 -/* 0BD09C 800BC49C 8CF80000 */ lw $t8, ($a3) -/* 0BD0A0 800BC4A0 8FB90060 */ lw $t9, 0x60($sp) -/* 0BD0A4 800BC4A4 8FA3008C */ lw $v1, 0x8c($sp) -/* 0BD0A8 800BC4A8 03104021 */ addu $t0, $t8, $s0 -/* 0BD0AC 800BC4AC A1190001 */ sb $t9, 1($t0) -/* 0BD0B0 800BC4B0 8CEA0000 */ lw $t2, ($a3) -/* 0BD0B4 800BC4B4 8FA90064 */ lw $t1, 0x64($sp) -/* 0BD0B8 800BC4B8 24630001 */ addiu $v1, $v1, 1 -/* 0BD0BC 800BC4BC 01505821 */ addu $t3, $t2, $s0 -/* 0BD0C0 800BC4C0 2610000C */ addiu $s0, $s0, 0xc -/* 0BD0C4 800BC4C4 26310008 */ addiu $s1, $s1, 8 -/* 0BD0C8 800BC4C8 1473FFEB */ bne $v1, $s3, .L800BC478 -/* 0BD0CC 800BC4CC A1690002 */ sb $t1, 2($t3) -.L800BC4D0: -/* 0BD0D0 800BC4D0 3C11803B */ lui $s1, %hi(gAlTbl) # $s1, 0x803b -/* 0BD0D4 800BC4D4 3C120098 */ lui $s2, %hi(_audio_tablesSegmentRomStart) # $s2, 0x98 -/* 0BD0D8 800BC4D8 26529AA0 */ addiu $s2, %lo(_audio_tablesSegmentRomStart) # addiu $s2, $s2, -0x6560 -/* 0BD0DC 800BC4DC 26317074 */ addiu $s1, %lo(gAlTbl) # addiu $s1, $s1, 0x7074 -/* 0BD0E0 800BC4E0 AE350000 */ sw $s5, ($s1) -/* 0BD0E4 800BC4E4 02402025 */ move $a0, $s2 -/* 0BD0E8 800BC4E8 02A02825 */ move $a1, $s5 -/* 0BD0EC 800BC4EC 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BD0F0 800BC4F0 24060010 */ li $a2, 16 -/* 0BD0F4 800BC4F4 8E2C0000 */ lw $t4, ($s1) -/* 0BD0F8 800BC4F8 2401FFF0 */ li $at, -16 -/* 0BD0FC 800BC4FC 02802025 */ move $a0, $s4 -/* 0BD100 800BC500 85900002 */ lh $s0, 2($t4) -/* 0BD104 800BC504 001068C0 */ sll $t5, $s0, 3 -/* 0BD108 800BC508 01A08025 */ move $s0, $t5 -/* 0BD10C 800BC50C 26100013 */ addiu $s0, $s0, 0x13 -/* 0BD110 800BC510 02012824 */ and $a1, $s0, $at -/* 0BD114 800BC514 0C02E3FF */ jal soundAlloc -/* 0BD118 800BC518 00A08025 */ move $s0, $a1 -/* 0BD11C 800BC51C AE220000 */ sw $v0, ($s1) -/* 0BD120 800BC520 02402025 */ move $a0, $s2 -/* 0BD124 800BC524 00402825 */ move $a1, $v0 -/* 0BD128 800BC528 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BD12C 800BC52C 02003025 */ move $a2, $s0 -/* 0BD130 800BC530 8E240000 */ lw $a0, ($s1) -/* 0BD134 800BC534 0C02ED0F */ jal func_800BB43C -/* 0BD138 800BC538 02402825 */ move $a1, $s2 -/* 0BD13C 800BC53C 02802025 */ move $a0, $s4 -/* 0BD140 800BC540 0C02E3FF */ jal soundAlloc -/* 0BD144 800BC544 24050100 */ li $a1, 256 -/* 0BD148 800BC548 3C03803B */ lui $v1, %hi(gAlBankSets) # $v1, 0x803b -/* 0BD14C 800BC54C 24637078 */ addiu $v1, %lo(gAlBankSets) # addiu $v1, $v1, 0x7078 -/* 0BD150 800BC550 3C0400BF */ lui $a0, %hi(_instrument_setsSegmentRomStart) # $a0, 0xbf -/* 0BD154 800BC554 AC620000 */ sw $v0, ($v1) -/* 0BD158 800BC558 248490E0 */ addiu $a0, %lo(_instrument_setsSegmentRomStart) # addiu $a0, $a0, -0x6f20 -/* 0BD15C 800BC55C 00402825 */ move $a1, $v0 -/* 0BD160 800BC560 0C02EAA0 */ jal audio_dma_copy_immediate -/* 0BD164 800BC564 24060100 */ li $a2, 256 -/* 0BD168 800BC568 3C10800F */ lui $s0, %hi(D_800EA5D8) # $s0, 0x800f -/* 0BD16C 800BC56C 2610A5D8 */ addiu $s0, %lo(D_800EA5D8) # addiu $s0, $s0, -0x5a28 -/* 0BD170 800BC570 8E050000 */ lw $a1, ($s0) -/* 0BD174 800BC574 0C02E3FF */ jal soundAlloc -/* 0BD178 800BC578 02802025 */ move $a0, $s4 -/* 0BD17C 800BC57C 3C04803B */ lui $a0, %hi(gUnkPool1) # $a0, 0x803b -/* 0BD180 800BC580 248401B8 */ addiu $a0, %lo(gUnkPool1) # addiu $a0, $a0, 0x1b8 -/* 0BD184 800BC584 00402825 */ move $a1, $v0 -/* 0BD188 800BC588 0C02E41F */ jal sound_alloc_pool_init -/* 0BD18C 800BC58C 8E060000 */ lw $a2, ($s0) -/* 0BD190 800BC590 0C030497 */ jal init_sequence_players -/* 0BD194 800BC594 00000000 */ nop -/* 0BD198 800BC598 3C0F7655 */ lui $t7, (0x76557364 >> 16) # lui $t7, 0x7655 -/* 0BD19C 800BC59C 3C18800F */ lui $t8, %hi(gAudioLoadLock) # $t8, 0x800f -/* 0BD1A0 800BC5A0 2718A5DC */ addiu $t8, %lo(gAudioLoadLock) # addiu $t8, $t8, -0x5a24 -/* 0BD1A4 800BC5A4 35EF7364 */ ori $t7, (0x76557364 & 0xFFFF) # ori $t7, $t7, 0x7364 -/* 0BD1A8 800BC5A8 AF0F0000 */ sw $t7, ($t8) -/* 0BD1AC 800BC5AC 8FBF002C */ lw $ra, 0x2c($sp) -/* 0BD1B0 800BC5B0 8FB50028 */ lw $s5, 0x28($sp) -/* 0BD1B4 800BC5B4 8FB40024 */ lw $s4, 0x24($sp) -/* 0BD1B8 800BC5B8 8FB30020 */ lw $s3, 0x20($sp) -/* 0BD1BC 800BC5BC 8FB2001C */ lw $s2, 0x1c($sp) -/* 0BD1C0 800BC5C0 8FB10018 */ lw $s1, 0x18($sp) -/* 0BD1C4 800BC5C4 8FB00014 */ lw $s0, 0x14($sp) -/* 0BD1C8 800BC5C8 03E00008 */ jr $ra -/* 0BD1CC 800BC5CC 27BD0090 */ addiu $sp, $sp, 0x90 diff --git a/asm/non_matchings/audio/synthesis/func_800B86A0.s b/asm/non_matchings/audio/synthesis/func_800B86A0.s deleted file mode 100644 index 295ec1f170..0000000000 --- a/asm/non_matchings/audio/synthesis/func_800B86A0.s +++ /dev/null @@ -1,236 +0,0 @@ -glabel func_800B86A0 -/* 0B92A0 800B86A0 94AA0006 */ lhu $t2, 6($a1) -/* 0B92A4 800B86A4 94C20010 */ lhu $v0, 0x10($a2) -/* 0B92A8 800B86A8 000768C3 */ sra $t5, $a3, 3 -/* 0B92AC 800B86AC 000A7100 */ sll $t6, $t2, 4 -/* 0B92B0 800B86B0 31CFFFFF */ andi $t7, $t6, 0xffff -/* 0B92B4 800B86B4 01E27023 */ subu $t6, $t7, $v0 -/* 0B92B8 800B86B8 01CD001A */ div $zero, $t6, $t5 -/* 0B92BC 800B86BC 94AB0008 */ lhu $t3, 8($a1) -/* 0B92C0 800B86C0 94C30012 */ lhu $v1, 0x12($a2) -/* 0B92C4 800B86C4 01E05025 */ move $t2, $t7 -/* 0B92C8 800B86C8 000BC100 */ sll $t8, $t3, 4 -/* 0B92CC 800B86CC 00007812 */ mflo $t7 -/* 0B92D0 800B86D0 3319FFFF */ andi $t9, $t8, 0xffff -/* 0B92D4 800B86D4 03205825 */ move $t3, $t9 -/* 0B92D8 800B86D8 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 0B92DC 800B86DC AFAF0008 */ sw $t7, 8($sp) -/* 0B92E0 800B86E0 87B8000A */ lh $t8, 0xa($sp) -/* 0B92E4 800B86E4 00406025 */ move $t4, $v0 -/* 0B92E8 800B86E8 15A00002 */ bnez $t5, .L800B86F4 -/* 0B92EC 800B86EC 00000000 */ nop -/* 0B92F0 800B86F0 0007000D */ break 7 -.L800B86F4: -/* 0B92F4 800B86F4 2401FFFF */ li $at, -1 -/* 0B92F8 800B86F8 15A10004 */ bne $t5, $at, .L800B870C -/* 0B92FC 800B86FC 3C018000 */ lui $at, 0x8000 -/* 0B9300 800B8700 15C10002 */ bne $t6, $at, .L800B870C -/* 0B9304 800B8704 00000000 */ nop -/* 0B9308 800B8708 0006000D */ break 6 -.L800B870C: -/* 0B930C 800B870C 01637023 */ subu $t6, $t3, $v1 -/* 0B9310 800B8710 01CD001A */ div $zero, $t6, $t5 -/* 0B9314 800B8714 00007812 */ mflo $t7 -/* 0B9318 800B8718 AFAF0000 */ sw $t7, ($sp) -/* 0B931C 800B871C 03004025 */ move $t0, $t8 -/* 0B9320 800B8720 030D0019 */ multu $t8, $t5 -/* 0B9324 800B8724 0060C825 */ move $t9, $v1 -/* 0B9328 800B8728 AFA30004 */ sw $v1, 4($sp) -/* 0B932C 800B872C 15A00002 */ bnez $t5, .L800B8738 -/* 0B9330 800B8730 00000000 */ nop -/* 0B9334 800B8734 0007000D */ break 7 -.L800B8738: -/* 0B9338 800B8738 2401FFFF */ li $at, -1 -/* 0B933C 800B873C 15A10004 */ bne $t5, $at, .L800B8750 -/* 0B9340 800B8740 3C018000 */ lui $at, 0x8000 -/* 0B9344 800B8744 15C10002 */ bne $t6, $at, .L800B8750 -/* 0B9348 800B8748 00000000 */ nop -/* 0B934C 800B874C 0006000D */ break 6 -.L800B8750: -/* 0B9350 800B8750 87AE0002 */ lh $t6, 2($sp) -/* 0B9354 800B8754 00007812 */ mflo $t7 -/* 0B9358 800B8758 018F5021 */ addu $t2, $t4, $t7 -/* 0B935C 800B875C 3158FFFF */ andi $t8, $t2, 0xffff -/* 0B9360 800B8760 01CD0019 */ multu $t6, $t5 -/* 0B9364 800B8764 03005025 */ move $t2, $t8 -/* 0B9368 800B8768 A4CA0010 */ sh $t2, 0x10($a2) -/* 0B936C 800B876C 01C04825 */ move $t1, $t6 -/* 0B9370 800B8770 00805025 */ move $t2, $a0 -/* 0B9374 800B8774 3C011200 */ lui $at, 0x1200 -/* 0B9378 800B8778 00007812 */ mflo $t7 -/* 0B937C 800B877C 032F5821 */ addu $t3, $t9, $t7 -/* 0B9380 800B8780 3178FFFF */ andi $t8, $t3, 0xffff -/* 0B9384 800B8784 A4D80012 */ sh $t8, 0x12($a2) -/* 0B9388 800B8788 90AE0000 */ lbu $t6, ($a1) -/* 0B938C 800B878C 03005825 */ move $t3, $t8 -/* 0B9390 800B8790 00803025 */ move $a2, $a0 -/* 0B9394 800B8794 31D90001 */ andi $t9, $t6, 1 -/* 0B9398 800B8798 13200073 */ beqz $t9, .L800B8968 -/* 0B939C 800B879C 304F00FF */ andi $t7, $v0, 0xff -/* 0B93A0 800B87A0 3C0F0200 */ lui $t7, (0x02000200 >> 16) # lui $t7, 0x200 -/* 0B93A4 800B87A4 35EF0200 */ ori $t7, (0x02000200 & 0xFFFF) # ori $t7, $t7, 0x200 -/* 0B93A8 800B87A8 24180180 */ li $t8, 384 -/* 0B93AC 800B87AC ACD80004 */ sw $t8, 4($a2) -/* 0B93B0 800B87B0 ACCF0000 */ sw $t7, ($a2) -/* 0B93B4 800B87B4 90B90005 */ lbu $t9, 5($a1) -/* 0B93B8 800B87B8 304E00FF */ andi $t6, $v0, 0xff -/* 0B93BC 800B87BC 3C011200 */ lui $at, 0x1200 -/* 0B93C0 800B87C0 00197C00 */ sll $t7, $t9, 0x10 -/* 0B93C4 800B87C4 000ECA00 */ sll $t9, $t6, 8 -/* 0B93C8 800B87C8 01E1C025 */ or $t8, $t7, $at -/* 0B93CC 800B87CC 03197825 */ or $t7, $t8, $t9 -/* 0B93D0 800B87D0 306E00FF */ andi $t6, $v1, 0xff -/* 0B93D4 800B87D4 01EEC025 */ or $t8, $t7, $t6 -/* 0B93D8 800B87D8 24840008 */ addiu $a0, $a0, 8 -/* 0B93DC 800B87DC 00805025 */ move $t2, $a0 -/* 0B93E0 800B87E0 AD580000 */ sw $t8, ($t2) -/* 0B93E4 800B87E4 312EFFFF */ andi $t6, $t1, 0xffff -/* 0B93E8 800B87E8 00087C00 */ sll $t7, $t0, 0x10 -/* 0B93EC 800B87EC 01EEC025 */ or $t8, $t7, $t6 -/* 0B93F0 800B87F0 AD580004 */ sw $t8, 4($t2) -/* 0B93F4 800B87F4 24840008 */ addiu $a0, $a0, 8 -/* 0B93F8 800B87F8 00805825 */ move $t3, $a0 -/* 0B93FC 800B87FC 00407825 */ move $t7, $v0 -/* 0B9400 800B8800 3C191600 */ lui $t9, 0x1600 -/* 0B9404 800B8804 AD790000 */ sw $t9, ($t3) -/* 0B9408 800B8808 000F7400 */ sll $t6, $t7, 0x10 -/* 0B940C 800B880C 3078FFFF */ andi $t8, $v1, 0xffff -/* 0B9410 800B8810 01D8C825 */ or $t9, $t6, $t8 -/* 0B9414 800B8814 AD790004 */ sw $t9, 4($t3) -/* 0B9418 800B8818 8FA20064 */ lw $v0, 0x64($sp) -/* 0B941C 800B881C 24010001 */ li $at, 1 -/* 0B9420 800B8820 24840008 */ addiu $a0, $a0, 8 -/* 0B9424 800B8824 1041001E */ beq $v0, $at, .L800B88A0 -/* 0B9428 800B8828 97AF0062 */ lhu $t7, 0x62($sp) -/* 0B942C 800B882C 24010002 */ li $at, 2 -/* 0B9430 800B8830 10410034 */ beq $v0, $at, .L800B8904 -/* 0B9434 800B8834 97AF0062 */ lhu $t7, 0x62($sp) -/* 0B9438 800B8838 97AF0062 */ lhu $t7, 0x62($sp) -/* 0B943C 800B883C 8CA60000 */ lw $a2, ($a1) -/* 0B9440 800B8840 3C011300 */ lui $at, 0x1300 -/* 0B9444 800B8844 000F7103 */ sra $t6, $t7, 4 -/* 0B9448 800B8848 31D800FF */ andi $t8, $t6, 0xff -/* 0B944C 800B884C 0018CC00 */ sll $t9, $t8, 0x10 -/* 0B9450 800B8850 30EE00FF */ andi $t6, $a3, 0xff -/* 0B9454 800B8854 000EC200 */ sll $t8, $t6, 8 -/* 0B9458 800B8858 03217825 */ or $t7, $t9, $at -/* 0B945C 800B885C 01F8C825 */ or $t9, $t7, $t8 -/* 0B9460 800B8860 00067100 */ sll $t6, $a2, 4 -/* 0B9464 800B8864 000E7FC2 */ srl $t7, $t6, 0x1f -/* 0B9468 800B8868 31F80001 */ andi $t8, $t7, 1 -/* 0B946C 800B886C 00187040 */ sll $t6, $t8, 1 -/* 0B9470 800B8870 032E7825 */ or $t7, $t9, $t6 -/* 0B9474 800B8874 0006C140 */ sll $t8, $a2, 5 -/* 0B9478 800B8878 0018CFC2 */ srl $t9, $t8, 0x1f -/* 0B947C 800B887C 332E0001 */ andi $t6, $t9, 1 -/* 0B9480 800B8880 3C19546C */ lui $t9, (0x546C849C >> 16) # lui $t9, 0x546c -/* 0B9484 800B8884 00801025 */ move $v0, $a0 -/* 0B9488 800B8888 3739849C */ ori $t9, (0x546C849C & 0xFFFF) # ori $t9, $t9, 0x849c -/* 0B948C 800B888C 01EEC025 */ or $t8, $t7, $t6 -/* 0B9490 800B8890 AC580000 */ sw $t8, ($v0) -/* 0B9494 800B8894 AC590004 */ sw $t9, 4($v0) -/* 0B9498 800B8898 10000061 */ b .L800B8A20 -/* 0B949C 800B889C 24840008 */ addiu $a0, $a0, 8 -.L800B88A0: -/* 0B94A0 800B88A0 000F7103 */ sra $t6, $t7, 4 -/* 0B94A4 800B88A4 31D800FF */ andi $t8, $t6, 0xff -/* 0B94A8 800B88A8 8CA60000 */ lw $a2, ($a1) -/* 0B94AC 800B88AC 0018CC00 */ sll $t9, $t8, 0x10 -/* 0B94B0 800B88B0 30EE00FF */ andi $t6, $a3, 0xff -/* 0B94B4 800B88B4 000EC200 */ sll $t8, $t6, 8 -/* 0B94B8 800B88B8 3C011300 */ lui $at, 0x1300 -/* 0B94BC 800B88BC 03217825 */ or $t7, $t9, $at -/* 0B94C0 800B88C0 01F8C825 */ or $t9, $t7, $t8 -/* 0B94C4 800B88C4 00067100 */ sll $t6, $a2, 4 -/* 0B94C8 800B88C8 000E7FC2 */ srl $t7, $t6, 0x1f -/* 0B94CC 800B88CC 31F80001 */ andi $t8, $t7, 1 -/* 0B94D0 800B88D0 00187040 */ sll $t6, $t8, 1 -/* 0B94D4 800B88D4 032E7825 */ or $t7, $t9, $t6 -/* 0B94D8 800B88D8 0006C140 */ sll $t8, $a2, 5 -/* 0B94DC 800B88DC 0018CFC2 */ srl $t9, $t8, 0x1f -/* 0B94E0 800B88E0 332E0001 */ andi $t6, $t9, 1 -/* 0B94E4 800B88E4 3C19206C */ lui $t9, (0x206C849C >> 16) # lui $t9, 0x206c -/* 0B94E8 800B88E8 00801025 */ move $v0, $a0 -/* 0B94EC 800B88EC 3739849C */ ori $t9, (0x206C849C & 0xFFFF) # ori $t9, $t9, 0x849c -/* 0B94F0 800B88F0 01EEC025 */ or $t8, $t7, $t6 -/* 0B94F4 800B88F4 AC580000 */ sw $t8, ($v0) -/* 0B94F8 800B88F8 AC590004 */ sw $t9, 4($v0) -/* 0B94FC 800B88FC 10000048 */ b .L800B8A20 -/* 0B9500 800B8900 24840008 */ addiu $a0, $a0, 8 -.L800B8904: -/* 0B9504 800B8904 000F7103 */ sra $t6, $t7, 4 -/* 0B9508 800B8908 31D800FF */ andi $t8, $t6, 0xff -/* 0B950C 800B890C 8CA60000 */ lw $a2, ($a1) -/* 0B9510 800B8910 0018CC00 */ sll $t9, $t8, 0x10 -/* 0B9514 800B8914 30EE00FF */ andi $t6, $a3, 0xff -/* 0B9518 800B8918 000EC200 */ sll $t8, $t6, 8 -/* 0B951C 800B891C 3C011300 */ lui $at, 0x1300 -/* 0B9520 800B8920 03217825 */ or $t7, $t9, $at -/* 0B9524 800B8924 01F8C825 */ or $t9, $t7, $t8 -/* 0B9528 800B8928 00067100 */ sll $t6, $a2, 4 -/* 0B952C 800B892C 000E7FC2 */ srl $t7, $t6, 0x1f -/* 0B9530 800B8930 31F80001 */ andi $t8, $t7, 1 -/* 0B9534 800B8934 00187040 */ sll $t6, $t8, 1 -/* 0B9538 800B8938 032E7825 */ or $t7, $t9, $t6 -/* 0B953C 800B893C 0006C140 */ sll $t8, $a2, 5 -/* 0B9540 800B8940 0018CFC2 */ srl $t9, $t8, 0x1f -/* 0B9544 800B8944 332E0001 */ andi $t6, $t9, 1 -/* 0B9548 800B8948 3C195420 */ lui $t9, (0x5420849C >> 16) # lui $t9, 0x5420 -/* 0B954C 800B894C 00801025 */ move $v0, $a0 -/* 0B9550 800B8950 3739849C */ ori $t9, (0x5420849C & 0xFFFF) # ori $t9, $t9, 0x849c -/* 0B9554 800B8954 01EEC025 */ or $t8, $t7, $t6 -/* 0B9558 800B8958 AC580000 */ sw $t8, ($v0) -/* 0B955C 800B895C AC590004 */ sw $t9, 4($v0) -/* 0B9560 800B8960 1000002F */ b .L800B8A20 -/* 0B9564 800B8964 24840008 */ addiu $a0, $a0, 8 -.L800B8968: -/* 0B9568 800B8968 90AE0005 */ lbu $t6, 5($a1) -/* 0B956C 800B896C 24840008 */ addiu $a0, $a0, 8 -/* 0B9570 800B8970 00805825 */ move $t3, $a0 -/* 0B9574 800B8974 000EC400 */ sll $t8, $t6, 0x10 -/* 0B9578 800B8978 000F7200 */ sll $t6, $t7, 8 -/* 0B957C 800B897C 0301C825 */ or $t9, $t8, $at -/* 0B9580 800B8980 032EC025 */ or $t8, $t9, $t6 -/* 0B9584 800B8984 306F00FF */ andi $t7, $v1, 0xff -/* 0B9588 800B8988 030FC825 */ or $t9, $t8, $t7 -/* 0B958C 800B898C AD590000 */ sw $t9, ($t2) -/* 0B9590 800B8990 312FFFFF */ andi $t7, $t1, 0xffff -/* 0B9594 800B8994 0008C400 */ sll $t8, $t0, 0x10 -/* 0B9598 800B8998 030FC825 */ or $t9, $t8, $t7 -/* 0B959C 800B899C AD590004 */ sw $t9, 4($t2) -/* 0B95A0 800B89A0 3C0E1600 */ lui $t6, 0x1600 -/* 0B95A4 800B89A4 AD6E0000 */ sw $t6, ($t3) -/* 0B95A8 800B89A8 3079FFFF */ andi $t9, $v1, 0xffff -/* 0B95AC 800B89AC 00027C00 */ sll $t7, $v0, 0x10 -/* 0B95B0 800B89B0 01F97025 */ or $t6, $t7, $t9 -/* 0B95B4 800B89B4 AD6E0004 */ sw $t6, 4($t3) -/* 0B95B8 800B89B8 97B80062 */ lhu $t8, 0x62($sp) -/* 0B95BC 800B89BC 8CA60000 */ lw $a2, ($a1) -/* 0B95C0 800B89C0 3C011300 */ lui $at, 0x1300 -/* 0B95C4 800B89C4 00187903 */ sra $t7, $t8, 4 -/* 0B95C8 800B89C8 31F900FF */ andi $t9, $t7, 0xff -/* 0B95CC 800B89CC 00197400 */ sll $t6, $t9, 0x10 -/* 0B95D0 800B89D0 30EF00FF */ andi $t7, $a3, 0xff -/* 0B95D4 800B89D4 000FCA00 */ sll $t9, $t7, 8 -/* 0B95D8 800B89D8 01C1C025 */ or $t8, $t6, $at -/* 0B95DC 800B89DC 03197025 */ or $t6, $t8, $t9 -/* 0B95E0 800B89E0 00067900 */ sll $t7, $a2, 4 -/* 0B95E4 800B89E4 000FC7C2 */ srl $t8, $t7, 0x1f -/* 0B95E8 800B89E8 33190001 */ andi $t9, $t8, 1 -/* 0B95EC 800B89EC 00197840 */ sll $t7, $t9, 1 -/* 0B95F0 800B89F0 01CFC025 */ or $t8, $t6, $t7 -/* 0B95F4 800B89F4 0006C940 */ sll $t9, $a2, 5 -/* 0B95F8 800B89F8 24840008 */ addiu $a0, $a0, 8 -/* 0B95FC 800B89FC 001977C2 */ srl $t6, $t9, 0x1f -/* 0B9600 800B8A00 31CF0001 */ andi $t7, $t6, 1 -/* 0B9604 800B8A04 00806025 */ move $t4, $a0 -/* 0B9608 800B8A08 3C0E546C */ lui $t6, (0x546C849C >> 16) # lui $t6, 0x546c -/* 0B960C 800B8A0C 35CE849C */ ori $t6, (0x546C849C & 0xFFFF) # ori $t6, $t6, 0x849c -/* 0B9610 800B8A10 030FC825 */ or $t9, $t8, $t7 -/* 0B9614 800B8A14 AD990000 */ sw $t9, ($t4) -/* 0B9618 800B8A18 AD8E0004 */ sw $t6, 4($t4) -/* 0B961C 800B8A1C 24840008 */ addiu $a0, $a0, 8 -.L800B8A20: -/* 0B9620 800B8A20 00801025 */ move $v0, $a0 -/* 0B9624 800B8A24 03E00008 */ jr $ra -/* 0B9628 800B8A28 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/asm/non_matchings/audio/synthesis/synthesis_process_note.s b/asm/non_matchings/audio/synthesis/synthesis_process_note.s deleted file mode 100644 index a9c33f8350..0000000000 --- a/asm/non_matchings/audio/synthesis/synthesis_process_note.s +++ /dev/null @@ -1,658 +0,0 @@ -glabel synthesis_process_note -/* 0B8830 800B7C30 27BDFEC0 */ addiu $sp, $sp, -0x140 -/* 0B8834 800B7C34 3C18803B */ lui $t8, %hi(gNotes) # $t8, 0x803b -/* 0B8838 800B7C38 8F181508 */ lw $t8, %lo(gNotes)($t8) -/* 0B883C 800B7C3C 00047880 */ sll $t7, $a0, 2 -/* 0B8840 800B7C40 01E47823 */ subu $t7, $t7, $a0 -/* 0B8844 800B7C44 000F7980 */ sll $t7, $t7, 6 -/* 0B8848 800B7C48 01F8C821 */ addu $t9, $t7, $t8 -/* 0B884C 800B7C4C AFBF004C */ sw $ra, 0x4c($sp) -/* 0B8850 800B7C50 AFBE0048 */ sw $fp, 0x48($sp) -/* 0B8854 800B7C54 AFB70044 */ sw $s7, 0x44($sp) -/* 0B8858 800B7C58 AFB60040 */ sw $s6, 0x40($sp) -/* 0B885C 800B7C5C AFB5003C */ sw $s5, 0x3c($sp) -/* 0B8860 800B7C60 AFB40038 */ sw $s4, 0x38($sp) -/* 0B8864 800B7C64 AFB30034 */ sw $s3, 0x34($sp) -/* 0B8868 800B7C68 AFB20030 */ sw $s2, 0x30($sp) -/* 0B886C 800B7C6C AFB1002C */ sw $s1, 0x2c($sp) -/* 0B8870 800B7C70 AFB00028 */ sw $s0, 0x28($sp) -/* 0B8874 800B7C74 AFA40140 */ sw $a0, 0x140($sp) -/* 0B8878 800B7C78 AFA50144 */ sw $a1, 0x144($sp) -/* 0B887C 800B7C7C AFA7014C */ sw $a3, 0x14c($sp) -/* 0B8880 800B7C80 AFA00128 */ sw $zero, 0x128($sp) -/* 0B8884 800B7C84 AFB9008C */ sw $t9, 0x8c($sp) -/* 0B8888 800B7C88 8CAF0000 */ lw $t7, ($a1) -/* 0B888C 800B7C8C 24010001 */ li $at, 1 -/* 0B8890 800B7C90 00C0B825 */ move $s7, $a2 -/* 0B8894 800B7C94 000FC040 */ sll $t8, $t7, 1 -/* 0B8898 800B7C98 0018CFC2 */ srl $t9, $t8, 0x1f -/* 0B889C 800B7C9C 17210009 */ bne $t9, $at, .L800B7CC4 -/* 0B88A0 800B7CA0 00001825 */ move $v1, $zero -/* 0B88A4 800B7CA4 24030001 */ li $v1, 1 -/* 0B88A8 800B7CA8 A0C00000 */ sb $zero, ($a2) -/* 0B88AC 800B7CAC ACC00008 */ sw $zero, 8($a2) -/* 0B88B0 800B7CB0 A4C00004 */ sh $zero, 4($a2) -/* 0B88B4 800B7CB4 A4C00010 */ sh $zero, 0x10($a2) -/* 0B88B8 800B7CB8 A4C00012 */ sh $zero, 0x12($a2) -/* 0B88BC 800B7CBC A0C00002 */ sb $zero, 2($a2) -/* 0B88C0 800B7CC0 A0C00003 */ sb $zero, 3($a2) -.L800B7CC4: -/* 0B88C4 800B7CC4 8FAE0144 */ lw $t6, 0x144($sp) -/* 0B88C8 800B7CC8 02E03025 */ move $a2, $s7 -/* 0B88CC 800B7CCC 95CF000A */ lhu $t7, 0xa($t6) -/* 0B88D0 800B7CD0 A7AF0112 */ sh $t7, 0x112($sp) -/* 0B88D4 800B7CD4 95D80000 */ lhu $t8, ($t6) -/* 0B88D8 800B7CD8 33190001 */ andi $t9, $t8, 1 -/* 0B88DC 800B7CDC 8FB80150 */ lw $t8, 0x150($sp) -/* 0B88E0 800B7CE0 272E0001 */ addiu $t6, $t9, 1 -/* 0B88E4 800B7CE4 AFAE00B0 */ sw $t6, 0xb0($sp) -/* 0B88E8 800B7CE8 01F80019 */ multu $t7, $t8 -/* 0B88EC 800B7CEC 96EF0004 */ lhu $t7, 4($s7) -/* 0B88F0 800B7CF0 0000C812 */ mflo $t9 -/* 0B88F4 800B7CF4 00197040 */ sll $t6, $t9, 1 -/* 0B88F8 800B7CF8 01CF1021 */ addu $v0, $t6, $t7 -/* 0B88FC 800B7CFC A6E20004 */ sh $v0, 4($s7) -/* 0B8900 800B7D00 8FB90144 */ lw $t9, 0x144($sp) -/* 0B8904 800B7D04 00028402 */ srl $s0, $v0, 0x10 -/* 0B8908 800B7D08 02003825 */ move $a3, $s0 -/* 0B890C 800B7D0C 8F240000 */ lw $a0, ($t9) -/* 0B8910 800B7D10 8FB80144 */ lw $t8, 0x144($sp) -/* 0B8914 800B7D14 03202825 */ move $a1, $t9 -/* 0B8918 800B7D18 00047B80 */ sll $t7, $a0, 0xe -/* 0B891C 800B7D1C 05E3000E */ bgezl $t7, .L800B7D58 -/* 0B8920 800B7D20 8F0E000C */ lw $t6, 0xc($t8) -/* 0B8924 800B7D24 0C02E16D */ jal load_wave_samples -/* 0B8928 800B7D28 8FA40154 */ lw $a0, 0x154($sp) -/* 0B892C 800B7D2C 8EE60008 */ lw $a2, 8($s7) -/* 0B8930 800B7D30 0006C040 */ sll $t8, $a2, 1 -/* 0B8934 800B7D34 270E01A0 */ addiu $t6, $t8, 0x1a0 -/* 0B8938 800B7D38 A7AE009E */ sh $t6, 0x9e($sp) -/* 0B893C 800B7D3C 00D07821 */ addu $t7, $a2, $s0 -/* 0B8940 800B7D40 AEEF0008 */ sw $t7, 8($s7) -/* 0B8944 800B7D44 8FB90144 */ lw $t9, 0x144($sp) -/* 0B8948 800B7D48 8F240000 */ lw $a0, ($t9) -/* 0B894C 800B7D4C 100001CF */ b .L800B848C -/* 0B8950 800B7D50 AFA20154 */ sw $v0, 0x154($sp) -/* 0B8954 800B7D54 8F0E000C */ lw $t6, 0xc($t8) -.L800B7D58: -/* 0B8958 800B7D58 8DCF0000 */ lw $t7, ($t6) -/* 0B895C 800B7D5C AFAF0130 */ sw $t7, 0x130($sp) -/* 0B8960 800B7D60 8DF90008 */ lw $t9, 8($t7) -/* 0B8964 800B7D64 AFB9012C */ sw $t9, 0x12c($sp) -/* 0B8968 800B7D68 8F380004 */ lw $t8, 4($t9) -/* 0B896C 800B7D6C 8FB900B0 */ lw $t9, 0xb0($sp) -/* 0B8970 800B7D70 AFB800DC */ sw $t8, 0xdc($sp) -/* 0B8974 800B7D74 8DEE0004 */ lw $t6, 4($t7) -/* 0B8978 800B7D78 AFA000A0 */ sw $zero, 0xa0($sp) -/* 0B897C 800B7D7C AFA000AC */ sw $zero, 0xac($sp) -/* 0B8980 800B7D80 1B2001C2 */ blez $t9, .L800B848C -/* 0B8984 800B7D84 AFAE00EC */ sw $t6, 0xec($sp) -/* 0B8988 800B7D88 0002C402 */ srl $t8, $v0, 0x10 -/* 0B898C 800B7D8C AFB80050 */ sw $t8, 0x50($sp) -/* 0B8990 800B7D90 AFA30114 */ sw $v1, 0x114($sp) -/* 0B8994 800B7D94 8FB20154 */ lw $s2, 0x154($sp) -/* 0B8998 800B7D98 8FAF0130 */ lw $t7, 0x130($sp) -.L800B7D9C: -/* 0B899C 800B7D9C 8FAE00B0 */ lw $t6, 0xb0($sp) -/* 0B89A0 800B7DA0 24010001 */ li $at, 1 -/* 0B89A4 800B7DA4 8DE5000C */ lw $a1, 0xc($t7) -/* 0B89A8 800B7DA8 0000F025 */ move $fp, $zero -/* 0B89AC 800B7DAC 0000A025 */ move $s4, $zero -/* 0B89B0 800B7DB0 15C10003 */ bne $t6, $at, .L800B7DC0 -/* 0B89B4 800B7DB4 24A60008 */ addiu $a2, $a1, 8 -/* 0B89B8 800B7DB8 1000000B */ b .L800B7DE8 -/* 0B89BC 800B7DBC 8FAD0050 */ lw $t5, 0x50($sp) -.L800B7DC0: -/* 0B89C0 800B7DC0 8FB90050 */ lw $t9, 0x50($sp) -/* 0B89C4 800B7DC4 8FAE00AC */ lw $t6, 0xac($sp) -/* 0B89C8 800B7DC8 8FAD0050 */ lw $t5, 0x50($sp) -/* 0B89CC 800B7DCC 33380001 */ andi $t8, $t9, 1 -/* 0B89D0 800B7DD0 13000005 */ beqz $t8, .L800B7DE8 -/* 0B89D4 800B7DD4 2401FFFE */ li $at, -2 -/* 0B89D8 800B7DD8 03217824 */ and $t7, $t9, $at -/* 0B89DC 800B7DDC 000EC040 */ sll $t8, $t6, 1 -/* 0B89E0 800B7DE0 10000001 */ b .L800B7DE8 -/* 0B89E4 800B7DE4 01F86821 */ addu $t5, $t7, $t8 -.L800B7DE8: -/* 0B89E8 800B7DE8 8FB90128 */ lw $t9, 0x128($sp) -/* 0B89EC 800B7DEC 5326001B */ beql $t9, $a2, .L800B7E5C -/* 0B89F0 800B7DF0 00047AC0 */ sll $t7, $a0, 0xb -/* 0B89F4 800B7DF4 8CAE0000 */ lw $t6, ($a1) -/* 0B89F8 800B7DF8 8CB80004 */ lw $t8, 4($a1) -/* 0B89FC 800B7DFC 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 0B8A00 800B7E00 000E7900 */ sll $t7, $t6, 4 -/* 0B8A04 800B7E04 01F80019 */ multu $t7, $t8 -/* 0B8A08 800B7E08 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0B8A0C 800B7E0C 02401025 */ move $v0, $s2 -/* 0B8A10 800B7E10 26520008 */ addiu $s2, $s2, 8 -/* 0B8A14 800B7E14 00001812 */ mflo $v1 -/* 0B8A18 800B7E18 0061C824 */ and $t9, $v1, $at -/* 0B8A1C 800B7E1C 3C010B00 */ lui $at, 0xb00 -/* 0B8A20 800B7E20 03217025 */ or $t6, $t9, $at -/* 0B8A24 800B7E24 AC4E0000 */ sw $t6, ($v0) -/* 0B8A28 800B7E28 8FAF0144 */ lw $t7, 0x144($sp) -/* 0B8A2C 800B7E2C 3C018000 */ lui $at, 0x8000 -/* 0B8A30 800B7E30 8DF80000 */ lw $t8, ($t7) -/* 0B8A34 800B7E34 0018CAC0 */ sll $t9, $t8, 0xb -/* 0B8A38 800B7E38 00197742 */ srl $t6, $t9, 0x1d -/* 0B8A3C 800B7E3C 000E7840 */ sll $t7, $t6, 1 -/* 0B8A40 800B7E40 01E6C021 */ addu $t8, $t7, $a2 -/* 0B8A44 800B7E44 0301C821 */ addu $t9, $t8, $at -/* 0B8A48 800B7E48 AC590004 */ sw $t9, 4($v0) -/* 0B8A4C 800B7E4C 8FAE0144 */ lw $t6, 0x144($sp) -/* 0B8A50 800B7E50 8DC40000 */ lw $a0, ($t6) -/* 0B8A54 800B7E54 AFA60128 */ sw $a2, 0x128($sp) -/* 0B8A58 800B7E58 00047AC0 */ sll $t7, $a0, 0xb -.L800B7E5C: -/* 0B8A5C 800B7E5C 000FC742 */ srl $t8, $t7, 0x1d -/* 0B8A60 800B7E60 13000003 */ beqz $t8, .L800B7E70 -/* 0B8A64 800B7E64 3C19800F */ lui $t9, %hi(gUnknownData_800F6290) # $t9, 0x800f -/* 0B8A68 800B7E68 27396290 */ addiu $t9, %lo(gUnknownData_800F6290) # addiu $t9, $t9, 0x6290 -/* 0B8A6C 800B7E6C AFB90128 */ sw $t9, 0x128($sp) -.L800B7E70: -/* 0B8A70 800B7E70 51A0011F */ beql $t5, $zero, .L800B82F0 -/* 0B8A74 800B7E74 8FB900B0 */ lw $t9, 0xb0($sp) -/* 0B8A78 800B7E78 8EE60008 */ lw $a2, 8($s7) -.L800B7E7C: -/* 0B8A7C 800B7E7C 8FAE00DC */ lw $t6, 0xdc($sp) -/* 0B8A80 800B7E80 01BE2023 */ subu $a0, $t5, $fp -/* 0B8A84 800B7E84 30D3000F */ andi $s3, $a2, 0xf -/* 0B8A88 800B7E88 00005825 */ move $t3, $zero -/* 0B8A8C 800B7E8C 00006025 */ move $t4, $zero -/* 0B8A90 800B7E90 0080F825 */ move $ra, $a0 -/* 0B8A94 800B7E94 16600005 */ bnez $s3, .L800B7EAC -/* 0B8A98 800B7E98 01C61823 */ subu $v1, $t6, $a2 -/* 0B8A9C 800B7E9C 92EF0000 */ lbu $t7, ($s7) -/* 0B8AA0 800B7EA0 55E00003 */ bnel $t7, $zero, .L800B7EB0 -/* 0B8AA4 800B7EA4 24180010 */ li $t8, 16 -/* 0B8AA8 800B7EA8 24130010 */ li $s3, 16 -.L800B7EAC: -/* 0B8AAC 800B7EAC 24180010 */ li $t8, 16 -.L800B7EB0: -/* 0B8AB0 800B7EB0 03132823 */ subu $a1, $t8, $s3 -/* 0B8AB4 800B7EB4 0083082A */ slt $at, $a0, $v1 -/* 0B8AB8 800B7EB8 1020000C */ beqz $at, .L800B7EEC -/* 0B8ABC 800B7EBC 00A0A825 */ move $s5, $a1 -/* 0B8AC0 800B7EC0 00851023 */ subu $v0, $a0, $a1 -/* 0B8AC4 800B7EC4 2442000F */ addiu $v0, $v0, 0xf -/* 0B8AC8 800B7EC8 04410003 */ bgez $v0, .L800B7ED8 -/* 0B8ACC 800B7ECC 0002C903 */ sra $t9, $v0, 4 -/* 0B8AD0 800B7ED0 2441000F */ addiu $at, $v0, 0xf -/* 0B8AD4 800B7ED4 0001C903 */ sra $t9, $at, 4 -.L800B7ED8: -/* 0B8AD8 800B7ED8 00198900 */ sll $s1, $t9, 4 -/* 0B8ADC 800B7EDC 00B17021 */ addu $t6, $a1, $s1 -/* 0B8AE0 800B7EE0 03204025 */ move $t0, $t9 -/* 0B8AE4 800B7EE4 10000013 */ b .L800B7F34 -/* 0B8AE8 800B7EE8 01C4B023 */ subu $s6, $t6, $a0 -.L800B7EEC: -/* 0B8AEC 800B7EEC 00658823 */ subu $s1, $v1, $a1 -/* 0B8AF0 800B7EF0 1E200003 */ bgtz $s1, .L800B7F00 -/* 0B8AF4 800B7EF4 0000B025 */ move $s6, $zero -/* 0B8AF8 800B7EF8 00008825 */ move $s1, $zero -/* 0B8AFC 800B7EFC 0060A825 */ move $s5, $v1 -.L800B7F00: -/* 0B8B00 800B7F00 8FB8012C */ lw $t8, 0x12c($sp) -/* 0B8B04 800B7F04 2628000F */ addiu $t0, $s1, 0xf -/* 0B8B08 800B7F08 05010003 */ bgez $t0, .L800B7F18 -/* 0B8B0C 800B7F0C 00087903 */ sra $t7, $t0, 4 -/* 0B8B10 800B7F10 2501000F */ addiu $at, $t0, 0xf -/* 0B8B14 800B7F14 00017903 */ sra $t7, $at, 4 -.L800B7F18: -/* 0B8B18 800B7F18 8F190008 */ lw $t9, 8($t8) -/* 0B8B1C 800B7F1C 01E04025 */ move $t0, $t7 -/* 0B8B20 800B7F20 53200004 */ beql $t9, $zero, .L800B7F34 -/* 0B8B24 800B7F24 240B0001 */ li $t3, 1 -/* 0B8B28 800B7F28 10000002 */ b .L800B7F34 -/* 0B8B2C 800B7F2C 240C0001 */ li $t4, 1 -/* 0B8B30 800B7F30 240B0001 */ li $t3, 1 -.L800B7F34: -/* 0B8B34 800B7F34 11000044 */ beqz $t0, .L800B8048 -/* 0B8B38 800B7F38 00005025 */ move $t2, $zero -/* 0B8B3C 800B7F3C 8FAF0130 */ lw $t7, 0x130($sp) -/* 0B8B40 800B7F40 00D31023 */ subu $v0, $a2, $s3 -/* 0B8B44 800B7F44 24420010 */ addiu $v0, $v0, 0x10 -/* 0B8B48 800B7F48 91F80001 */ lbu $t8, 1($t7) -/* 0B8B4C 800B7F4C 04410003 */ bgez $v0, .L800B7F5C -/* 0B8B50 800B7F50 00027103 */ sra $t6, $v0, 4 -/* 0B8B54 800B7F54 2441000F */ addiu $at, $v0, 0xf -/* 0B8B58 800B7F58 00017103 */ sra $t6, $at, 4 -.L800B7F5C: -/* 0B8B5C 800B7F5C 24010081 */ li $at, 129 -/* 0B8B60 800B7F60 1701000C */ bne $t8, $at, .L800B7F94 -/* 0B8B64 800B7F64 01C01025 */ move $v0, $t6 -/* 0B8B68 800B7F68 000EC8C0 */ sll $t9, $t6, 3 -/* 0B8B6C 800B7F6C 000880C0 */ sll $s0, $t0, 3 -/* 0B8B70 800B7F70 02088021 */ addu $s0, $s0, $t0 -/* 0B8B74 800B7F74 032EC821 */ addu $t9, $t9, $t6 -/* 0B8B78 800B7F78 8FAE00EC */ lw $t6, 0xec($sp) -/* 0B8B7C 800B7F7C 2610001F */ addiu $s0, $s0, 0x1f -/* 0B8B80 800B7F80 2401FFF0 */ li $at, -16 -/* 0B8B84 800B7F84 02017824 */ and $t7, $s0, $at -/* 0B8B88 800B7F88 01E08025 */ move $s0, $t7 -/* 0B8B8C 800B7F8C 10000019 */ b .L800B7FF4 -/* 0B8B90 800B7F90 032E2021 */ addu $a0, $t9, $t6 -.L800B7F94: -/* 0B8B94 800B7F94 24030009 */ li $v1, 9 -/* 0B8B98 800B7F98 00430019 */ multu $v0, $v1 -/* 0B8B9C 800B7F9C 8FB900EC */ lw $t9, 0xec($sp) -/* 0B8BA0 800B7FA0 2401FFF0 */ li $at, -16 -/* 0B8BA4 800B7FA4 AFBF00D8 */ sw $ra, 0xd8($sp) -/* 0B8BA8 800B7FA8 8FA60114 */ lw $a2, 0x114($sp) -/* 0B8BAC 800B7FAC 26E70001 */ addiu $a3, $s7, 1 -/* 0B8BB0 800B7FB0 AFAB011C */ sw $t3, 0x11c($sp) -/* 0B8BB4 800B7FB4 AFAC0118 */ sw $t4, 0x118($sp) -/* 0B8BB8 800B7FB8 AFAD00E4 */ sw $t5, 0xe4($sp) -/* 0B8BBC 800B7FBC 0000C012 */ mflo $t8 -/* 0B8BC0 800B7FC0 03192021 */ addu $a0, $t8, $t9 -/* 0B8BC4 800B7FC4 00000000 */ nop -/* 0B8BC8 800B7FC8 01030019 */ multu $t0, $v1 -/* 0B8BCC 800B7FCC 00008012 */ mflo $s0 -/* 0B8BD0 800B7FD0 2610001F */ addiu $s0, $s0, 0x1f -/* 0B8BD4 800B7FD4 02012824 */ and $a1, $s0, $at -/* 0B8BD8 800B7FD8 0C02EB43 */ jal dma_sample_data -/* 0B8BDC 800B7FDC 00A08025 */ move $s0, $a1 -/* 0B8BE0 800B7FE0 8FAB011C */ lw $t3, 0x11c($sp) -/* 0B8BE4 800B7FE4 8FAC0118 */ lw $t4, 0x118($sp) -/* 0B8BE8 800B7FE8 8FAD00E4 */ lw $t5, 0xe4($sp) -/* 0B8BEC 800B7FEC 8FBF00D8 */ lw $ra, 0xd8($sp) -/* 0B8BF0 800B7FF0 00402025 */ move $a0, $v0 -.L800B7FF4: -/* 0B8BF4 800B7FF4 240F0540 */ li $t7, 1344 -/* 0B8BF8 800B7FF8 01F04823 */ subu $t1, $t7, $s0 -/* 0B8BFC 800B7FFC 0009C400 */ sll $t8, $t1, 0x10 -/* 0B8C00 800B8000 00107103 */ sra $t6, $s0, 4 -/* 0B8C04 800B8004 31CF00FF */ andi $t7, $t6, 0xff -/* 0B8C08 800B8008 00184C03 */ sra $t1, $t8, 0x10 -/* 0B8C0C 800B800C 000FC400 */ sll $t8, $t7, 0x10 -/* 0B8C10 800B8010 3C011400 */ lui $at, 0x1400 -/* 0B8C14 800B8014 0301C825 */ or $t9, $t8, $at -/* 0B8C18 800B8018 308A000F */ andi $t2, $a0, 0xf -/* 0B8C1C 800B801C 312EFFFF */ andi $t6, $t1, 0xffff -/* 0B8C20 800B8020 032E7825 */ or $t7, $t9, $t6 -/* 0B8C24 800B8024 008AC023 */ subu $t8, $a0, $t2 -/* 0B8C28 800B8028 3C018000 */ lui $at, 0x8000 -/* 0B8C2C 800B802C 02401825 */ move $v1, $s2 -/* 0B8C30 800B8030 0301C821 */ addu $t9, $t8, $at -/* 0B8C34 800B8034 AC790004 */ sw $t9, 4($v1) -/* 0B8C38 800B8038 AC6F0000 */ sw $t7, ($v1) -/* 0B8C3C 800B803C 92E50000 */ lbu $a1, ($s7) -/* 0B8C40 800B8040 1000000B */ b .L800B8070 -/* 0B8C44 800B8044 26520008 */ addiu $s2, $s2, 8 -.L800B8048: -/* 0B8C48 800B8048 000870C0 */ sll $t6, $t0, 3 -/* 0B8C4C 800B804C 01C87021 */ addu $t6, $t6, $t0 -/* 0B8C50 800B8050 25CF001F */ addiu $t7, $t6, 0x1f -/* 0B8C54 800B8054 31F8FFF0 */ andi $t8, $t7, 0xfff0 -/* 0B8C58 800B8058 24190540 */ li $t9, 1344 -/* 0B8C5C 800B805C 03384823 */ subu $t1, $t9, $t8 -/* 0B8C60 800B8060 00097400 */ sll $t6, $t1, 0x10 -/* 0B8C64 800B8064 00008825 */ move $s1, $zero -/* 0B8C68 800B8068 000E4C03 */ sra $t1, $t6, 0x10 -/* 0B8C6C 800B806C 92E50000 */ lbu $a1, ($s7) -.L800B8070: -/* 0B8C70 800B8070 10A0000D */ beqz $a1, .L800B80A8 -/* 0B8C74 800B8074 02401025 */ move $v0, $s2 -/* 0B8C78 800B8078 3C190F00 */ lui $t9, 0xf00 -/* 0B8C7C 800B807C AC590000 */ sw $t9, ($v0) -/* 0B8C80 800B8080 8FB80130 */ lw $t8, 0x130($sp) -/* 0B8C84 800B8084 3C018000 */ lui $at, (0x80000010 >> 16) # lui $at, 0x8000 -/* 0B8C88 800B8088 34210010 */ ori $at, (0x80000010 & 0xFFFF) # ori $at, $at, 0x10 -/* 0B8C8C 800B808C 8F0E0008 */ lw $t6, 8($t8) -/* 0B8C90 800B8090 24190002 */ li $t9, 2 -/* 0B8C94 800B8094 26520008 */ addiu $s2, $s2, 8 -/* 0B8C98 800B8098 01C17821 */ addu $t7, $t6, $at -/* 0B8C9C 800B809C AC4F0004 */ sw $t7, 4($v0) -/* 0B8CA0 800B80A0 AFB90114 */ sw $t9, 0x114($sp) -/* 0B8CA4 800B80A4 A2E00000 */ sb $zero, ($s7) -.L800B80A8: -/* 0B8CA8 800B80A8 17C0001E */ bnez $fp, .L800B8124 -/* 0B8CAC 800B80AC 02401825 */ move $v1, $s2 -/* 0B8CB0 800B80B0 012AC021 */ addu $t8, $t1, $t2 -/* 0B8CB4 800B80B4 330EFFFF */ andi $t6, $t8, 0xffff -/* 0B8CB8 800B80B8 3C010800 */ lui $at, 0x800 -/* 0B8CBC 800B80BC 01C17825 */ or $t7, $t6, $at -/* 0B8CC0 800B80C0 00113040 */ sll $a2, $s1, 1 -/* 0B8CC4 800B80C4 30D9FFFF */ andi $t9, $a2, 0xffff -/* 0B8CC8 800B80C8 3C0101A0 */ lui $at, 0x1a0 -/* 0B8CCC 800B80CC 02401025 */ move $v0, $s2 -/* 0B8CD0 800B80D0 0321C025 */ or $t8, $t9, $at -/* 0B8CD4 800B80D4 AC580004 */ sw $t8, 4($v0) -/* 0B8CD8 800B80D8 AC4F0000 */ sw $t7, ($v0) -/* 0B8CDC 800B80DC 8FAE0114 */ lw $t6, 0x114($sp) -/* 0B8CE0 800B80E0 26520008 */ addiu $s2, $s2, 8 -/* 0B8CE4 800B80E4 3C010100 */ lui $at, 0x100 -/* 0B8CE8 800B80E8 31CF00FF */ andi $t7, $t6, 0xff -/* 0B8CEC 800B80EC 000FCC00 */ sll $t9, $t7, 0x10 -/* 0B8CF0 800B80F0 0321C025 */ or $t8, $t9, $at -/* 0B8CF4 800B80F4 02401825 */ move $v1, $s2 -/* 0B8CF8 800B80F8 AC780000 */ sw $t8, ($v1) -/* 0B8CFC 800B80FC 8EEE000C */ lw $t6, 0xc($s7) -/* 0B8D00 800B8100 3C018000 */ lui $at, 0x8000 -/* 0B8D04 800B8104 0235C021 */ addu $t8, $s1, $s5 -/* 0B8D08 800B8108 01C17821 */ addu $t7, $t6, $at -/* 0B8D0C 800B810C AC6F0004 */ sw $t7, 4($v1) -/* 0B8D10 800B8110 0013C840 */ sll $t9, $s3, 1 -/* 0B8D14 800B8114 26520008 */ addiu $s2, $s2, 8 -/* 0B8D18 800B8118 AFB900FC */ sw $t9, 0xfc($sp) -/* 0B8D1C 800B811C 10000030 */ b .L800B81E0 -/* 0B8D20 800B8120 03163823 */ subu $a3, $t8, $s6 -.L800B8124: -/* 0B8D24 800B8124 012A7021 */ addu $t6, $t1, $t2 -/* 0B8D28 800B8128 31CFFFFF */ andi $t7, $t6, 0xffff -/* 0B8D2C 800B812C 3C010800 */ lui $at, 0x800 -/* 0B8D30 800B8130 01E1C825 */ or $t9, $t7, $at -/* 0B8D34 800B8134 2401FFF0 */ li $at, -16 -/* 0B8D38 800B8138 2682001F */ addiu $v0, $s4, 0x1f -/* 0B8D3C 800B813C 0041C024 */ and $t8, $v0, $at -/* 0B8D40 800B8140 270F01A0 */ addiu $t7, $t8, 0x1a0 -/* 0B8D44 800B8144 03001025 */ move $v0, $t8 -/* 0B8D48 800B8148 AC790000 */ sw $t9, ($v1) -/* 0B8D4C 800B814C 00113040 */ sll $a2, $s1, 1 -/* 0B8D50 800B8150 30D8FFFF */ andi $t8, $a2, 0xffff -/* 0B8D54 800B8154 000FCC00 */ sll $t9, $t7, 0x10 -/* 0B8D58 800B8158 03387025 */ or $t6, $t9, $t8 -/* 0B8D5C 800B815C AC6E0004 */ sw $t6, 4($v1) -/* 0B8D60 800B8160 8FAF0114 */ lw $t7, 0x114($sp) -/* 0B8D64 800B8164 26520008 */ addiu $s2, $s2, 8 -/* 0B8D68 800B8168 3C010100 */ lui $at, 0x100 -/* 0B8D6C 800B816C 31F900FF */ andi $t9, $t7, 0xff -/* 0B8D70 800B8170 0019C400 */ sll $t8, $t9, 0x10 -/* 0B8D74 800B8174 03017025 */ or $t6, $t8, $at -/* 0B8D78 800B8178 02402025 */ move $a0, $s2 -/* 0B8D7C 800B817C AC8E0000 */ sw $t6, ($a0) -/* 0B8D80 800B8180 8EEF000C */ lw $t7, 0xc($s7) -/* 0B8D84 800B8184 3C018000 */ lui $at, 0x8000 -/* 0B8D88 800B8188 0013C040 */ sll $t8, $s3, 1 -/* 0B8D8C 800B818C 01E1C821 */ addu $t9, $t7, $at -/* 0B8D90 800B8190 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 0B8D94 800B8194 00587021 */ addu $t6, $v0, $t8 -/* 0B8D98 800B8198 AC990004 */ sw $t9, 4($a0) -/* 0B8D9C 800B819C 25CF01A0 */ addiu $t7, $t6, 0x1a0 -/* 0B8DA0 800B81A0 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0B8DA4 800B81A4 01E1C824 */ and $t9, $t7, $at -/* 0B8DA8 800B81A8 3C010A00 */ lui $at, 0xa00 -/* 0B8DAC 800B81AC 26520008 */ addiu $s2, $s2, 8 -/* 0B8DB0 800B81B0 0321C025 */ or $t8, $t9, $at -/* 0B8DB4 800B81B4 02357021 */ addu $t6, $s1, $s5 -/* 0B8DB8 800B81B8 01D63823 */ subu $a3, $t6, $s6 -/* 0B8DBC 800B81BC 02402825 */ move $a1, $s2 -/* 0B8DC0 800B81C0 ACB80000 */ sw $t8, ($a1) -/* 0B8DC4 800B81C4 00077040 */ sll $t6, $a3, 1 -/* 0B8DC8 800B81C8 269901A0 */ addiu $t9, $s4, 0x1a0 -/* 0B8DCC 800B81CC 0019C400 */ sll $t8, $t9, 0x10 -/* 0B8DD0 800B81D0 31CFFFFF */ andi $t7, $t6, 0xffff -/* 0B8DD4 800B81D4 030FC825 */ or $t9, $t8, $t7 -/* 0B8DD8 800B81D8 ACB90004 */ sw $t9, 4($a1) -/* 0B8DDC 800B81DC 26520008 */ addiu $s2, $s2, 8 -.L800B81E0: -/* 0B8DE0 800B81E0 8FAE0114 */ lw $t6, 0x114($sp) -/* 0B8DE4 800B81E4 24010001 */ li $at, 1 -/* 0B8DE8 800B81E8 03C7F021 */ addu $fp, $fp, $a3 -/* 0B8DEC 800B81EC 11C10006 */ beq $t6, $at, .L800B8208 -/* 0B8DF0 800B81F0 24180020 */ li $t8, 32 -/* 0B8DF4 800B81F4 39C20002 */ xori $v0, $t6, 2 -/* 0B8DF8 800B81F8 10400007 */ beqz $v0, .L800B8218 -/* 0B8DFC 800B81FC AFA00114 */ sw $zero, 0x114($sp) -/* 0B8E00 800B8200 10000008 */ b .L800B8224 -/* 0B8E04 800B8204 0007C840 */ sll $t9, $a3, 1 -.L800B8208: -/* 0B8E08 800B8208 AFB800FC */ sw $t8, 0xfc($sp) -/* 0B8E0C 800B820C 24D40020 */ addiu $s4, $a2, 0x20 -/* 0B8E10 800B8210 1000000B */ b .L800B8240 -/* 0B8E14 800B8214 AFA00114 */ sw $zero, 0x114($sp) -.L800B8218: -/* 0B8E18 800B8218 00077840 */ sll $t7, $a3, 1 -/* 0B8E1C 800B821C 10000008 */ b .L800B8240 -/* 0B8E20 800B8220 01F4A021 */ addu $s4, $t7, $s4 -.L800B8224: -/* 0B8E24 800B8224 52800004 */ beql $s4, $zero, .L800B8238 -/* 0B8E28 800B8228 0267A021 */ addu $s4, $s3, $a3 -/* 0B8E2C 800B822C 10000004 */ b .L800B8240 -/* 0B8E30 800B8230 0334A021 */ addu $s4, $t9, $s4 -/* 0B8E34 800B8234 0267A021 */ addu $s4, $s3, $a3 -.L800B8238: -/* 0B8E38 800B8238 00147040 */ sll $t6, $s4, 1 -/* 0B8E3C 800B823C 01C0A025 */ move $s4, $t6 -.L800B8240: -/* 0B8E40 800B8240 1160001E */ beqz $t3, .L800B82BC -/* 0B8E44 800B8244 240F0001 */ li $t7, 1 -/* 0B8E48 800B8248 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 0B8E4C 800B824C 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0B8E50 800B8250 269801A0 */ addiu $t8, $s4, 0x1a0 -/* 0B8E54 800B8254 03017824 */ and $t7, $t8, $at -/* 0B8E58 800B8258 8FB00144 */ lw $s0, 0x144($sp) -/* 0B8E5C 800B825C 8FB1008C */ lw $s1, 0x8c($sp) -/* 0B8E60 800B8260 3C010200 */ lui $at, 0x200 -/* 0B8E64 800B8264 02401025 */ move $v0, $s2 -/* 0B8E68 800B8268 01BE7023 */ subu $t6, $t5, $fp -/* 0B8E6C 800B826C 000EC040 */ sll $t8, $t6, 1 -/* 0B8E70 800B8270 01E1C825 */ or $t9, $t7, $at -/* 0B8E74 800B8274 AC590000 */ sw $t9, ($v0) -/* 0B8E78 800B8278 AC580004 */ sw $t8, 4($v0) -/* 0B8E7C 800B827C 92190000 */ lbu $t9, ($s0) -/* 0B8E80 800B8280 26520008 */ addiu $s2, $s2, 8 -/* 0B8E84 800B8284 372E0020 */ ori $t6, $t9, 0x20 -/* 0B8E88 800B8288 A20E0000 */ sb $t6, ($s0) -/* 0B8E8C 800B828C 922F00B0 */ lbu $t7, 0xb0($s1) -/* 0B8E90 800B8290 35F90020 */ ori $t9, $t7, 0x20 -/* 0B8E94 800B8294 A23900B0 */ sb $t9, 0xb0($s1) -/* 0B8E98 800B8298 922E00B0 */ lbu $t6, 0xb0($s1) -/* 0B8E9C 800B829C 31D8FF7F */ andi $t8, $t6, 0xff7f -/* 0B8EA0 800B82A0 A23800B0 */ sb $t8, 0xb0($s1) -/* 0B8EA4 800B82A4 AFAD00E4 */ sw $t5, 0xe4($sp) -/* 0B8EA8 800B82A8 8FA50140 */ lw $a1, 0x140($sp) -/* 0B8EAC 800B82AC 0C02DBED */ jal func_800B6FB4 -/* 0B8EB0 800B82B0 8FA40158 */ lw $a0, 0x158($sp) -/* 0B8EB4 800B82B4 1000000D */ b .L800B82EC -/* 0B8EB8 800B82B8 8FAD00E4 */ lw $t5, 0xe4($sp) -.L800B82BC: -/* 0B8EBC 800B82BC 51800007 */ beql $t4, $zero, .L800B82DC -/* 0B8EC0 800B82C0 8EF80008 */ lw $t8, 8($s7) -/* 0B8EC4 800B82C4 A2EF0000 */ sb $t7, ($s7) -/* 0B8EC8 800B82C8 8FB9012C */ lw $t9, 0x12c($sp) -/* 0B8ECC 800B82CC 8F2E0000 */ lw $t6, ($t9) -/* 0B8ED0 800B82D0 10000004 */ b .L800B82E4 -/* 0B8ED4 800B82D4 AEEE0008 */ sw $t6, 8($s7) -/* 0B8ED8 800B82D8 8EF80008 */ lw $t8, 8($s7) -.L800B82DC: -/* 0B8EDC 800B82DC 031F7821 */ addu $t7, $t8, $ra -/* 0B8EE0 800B82E0 AEEF0008 */ sw $t7, 8($s7) -.L800B82E4: -/* 0B8EE4 800B82E4 57CDFEE5 */ bnel $fp, $t5, .L800B7E7C -/* 0B8EE8 800B82E8 8EE60008 */ lw $a2, 8($s7) -.L800B82EC: -/* 0B8EEC 800B82EC 8FB900B0 */ lw $t9, 0xb0($sp) -.L800B82F0: -/* 0B8EF0 800B82F0 24010001 */ li $at, 1 -/* 0B8EF4 800B82F4 8FB00144 */ lw $s0, 0x144($sp) -/* 0B8EF8 800B82F8 13210009 */ beq $t9, $at, .L800B8320 -/* 0B8EFC 800B82FC 8FB800FC */ lw $t8, 0xfc($sp) -/* 0B8F00 800B8300 24010002 */ li $at, 2 -/* 0B8F04 800B8304 1321000E */ beq $t9, $at, .L800B8340 -/* 0B8F08 800B8308 8FB800AC */ lw $t8, 0xac($sp) -/* 0B8F0C 800B830C 8E040000 */ lw $a0, ($s0) -/* 0B8F10 800B8310 00041880 */ sll $v1, $a0, 2 -/* 0B8F14 800B8314 000377C2 */ srl $t6, $v1, 0x1f -/* 0B8F18 800B8318 10000052 */ b .L800B8464 -/* 0B8F1C 800B831C 01C01825 */ move $v1, $t6 -.L800B8320: -/* 0B8F20 800B8320 8FB90144 */ lw $t9, 0x144($sp) -/* 0B8F24 800B8324 270F01A0 */ addiu $t7, $t8, 0x1a0 -/* 0B8F28 800B8328 A7AF009E */ sh $t7, 0x9e($sp) -/* 0B8F2C 800B832C 8F240000 */ lw $a0, ($t9) -/* 0B8F30 800B8330 00041880 */ sll $v1, $a0, 2 -/* 0B8F34 800B8334 000377C2 */ srl $t6, $v1, 0x1f -/* 0B8F38 800B8338 1000004A */ b .L800B8464 -/* 0B8F3C 800B833C 01C01825 */ move $v1, $t6 -.L800B8340: -/* 0B8F40 800B8340 13000009 */ beqz $t8, .L800B8368 -/* 0B8F44 800B8344 8FA50144 */ lw $a1, 0x144($sp) -/* 0B8F48 800B8348 24010001 */ li $at, 1 -/* 0B8F4C 800B834C 1301002E */ beq $t8, $at, .L800B8408 -/* 0B8F50 800B8350 02401025 */ move $v0, $s2 -/* 0B8F54 800B8354 8E040000 */ lw $a0, ($s0) -/* 0B8F58 800B8358 00041880 */ sll $v1, $a0, 2 -/* 0B8F5C 800B835C 00037FC2 */ srl $t7, $v1, 0x1f -/* 0B8F60 800B8360 10000040 */ b .L800B8464 -/* 0B8F64 800B8364 01E01825 */ move $v1, $t7 -.L800B8368: -/* 0B8F68 800B8368 02401025 */ move $v0, $s2 -/* 0B8F6C 800B836C 26520008 */ addiu $s2, $s2, 8 -/* 0B8F70 800B8370 05A10003 */ bgez $t5, .L800B8380 -/* 0B8F74 800B8374 000DC843 */ sra $t9, $t5, 1 -/* 0B8F78 800B8378 25A10001 */ addiu $at, $t5, 1 -/* 0B8F7C 800B837C 0001C843 */ sra $t9, $at, 1 -.L800B8380: -/* 0B8F80 800B8380 27380007 */ addiu $t8, $t9, 7 -/* 0B8F84 800B8384 330FFFF8 */ andi $t7, $t8, 0xfff8 -/* 0B8F88 800B8388 3C011100 */ lui $at, 0x1100 -/* 0B8F8C 800B838C 01E1C825 */ or $t9, $t7, $at -/* 0B8F90 800B8390 AC590000 */ sw $t9, ($v0) -/* 0B8F94 800B8394 8FAE00FC */ lw $t6, 0xfc($sp) -/* 0B8F98 800B8398 24180020 */ li $t8, 32 -/* 0B8F9C 800B839C 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 0B8FA0 800B83A0 25CF01A0 */ addiu $t7, $t6, 0x1a0 -/* 0B8FA4 800B83A4 000FCC00 */ sll $t9, $t7, 0x10 -/* 0B8FA8 800B83A8 372E0020 */ ori $t6, $t9, 0x20 -/* 0B8FAC 800B83AC AC4E0004 */ sw $t6, 4($v0) -/* 0B8FB0 800B83B0 AFAD00A0 */ sw $t5, 0xa0($sp) -/* 0B8FB4 800B83B4 A7B8009E */ sh $t8, 0x9e($sp) -/* 0B8FB8 800B83B8 8CA40000 */ lw $a0, ($a1) -/* 0B8FBC 800B83BC 02401025 */ move $v0, $s2 -/* 0B8FC0 800B83C0 25B90020 */ addiu $t9, $t5, 0x20 -/* 0B8FC4 800B83C4 00041880 */ sll $v1, $a0, 2 -/* 0B8FC8 800B83C8 00037FC2 */ srl $t7, $v1, 0x1f -/* 0B8FCC 800B83CC 11E00025 */ beqz $t7, .L800B8464 -/* 0B8FD0 800B83D0 01E01825 */ move $v1, $t7 -/* 0B8FD4 800B83D4 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0B8FD8 800B83D8 03217024 */ and $t6, $t9, $at -/* 0B8FDC 800B83DC 3C010200 */ lui $at, 0x200 -/* 0B8FE0 800B83E0 01C1C025 */ or $t8, $t6, $at -/* 0B8FE4 800B83E4 25AF0010 */ addiu $t7, $t5, 0x10 -/* 0B8FE8 800B83E8 AC4F0004 */ sw $t7, 4($v0) -/* 0B8FEC 800B83EC AC580000 */ sw $t8, ($v0) -/* 0B8FF0 800B83F0 8CA40000 */ lw $a0, ($a1) -/* 0B8FF4 800B83F4 26520008 */ addiu $s2, $s2, 8 -/* 0B8FF8 800B83F8 00041880 */ sll $v1, $a0, 2 -/* 0B8FFC 800B83FC 0003CFC2 */ srl $t9, $v1, 0x1f -/* 0B9000 800B8400 10000018 */ b .L800B8464 -/* 0B9004 800B8404 03201825 */ move $v1, $t9 -.L800B8408: -/* 0B9008 800B8408 26520008 */ addiu $s2, $s2, 8 -/* 0B900C 800B840C 05A10003 */ bgez $t5, .L800B841C -/* 0B9010 800B8410 000D7043 */ sra $t6, $t5, 1 -/* 0B9014 800B8414 25A10001 */ addiu $at, $t5, 1 -/* 0B9018 800B8418 00017043 */ sra $t6, $at, 1 -.L800B841C: -/* 0B901C 800B841C 25CF0007 */ addiu $t7, $t6, 7 -/* 0B9020 800B8420 31F9FFF8 */ andi $t9, $t7, 0xfff8 -/* 0B9024 800B8424 3C011100 */ lui $at, 0x1100 -/* 0B9028 800B8428 03217025 */ or $t6, $t9, $at -/* 0B902C 800B842C AC4E0000 */ sw $t6, ($v0) -/* 0B9030 800B8430 8FB800FC */ lw $t8, 0xfc($sp) -/* 0B9034 800B8434 271901A0 */ addiu $t9, $t8, 0x1a0 -/* 0B9038 800B8438 8FB800A0 */ lw $t8, 0xa0($sp) -/* 0B903C 800B843C 00197400 */ sll $t6, $t9, 0x10 -/* 0B9040 800B8440 270F0020 */ addiu $t7, $t8, 0x20 -/* 0B9044 800B8444 31F9FFFF */ andi $t9, $t7, 0xffff -/* 0B9048 800B8448 01D9C025 */ or $t8, $t6, $t9 -/* 0B904C 800B844C AC580004 */ sw $t8, 4($v0) -/* 0B9050 800B8450 8FAF0144 */ lw $t7, 0x144($sp) -/* 0B9054 800B8454 8DE40000 */ lw $a0, ($t7) -/* 0B9058 800B8458 00041880 */ sll $v1, $a0, 2 -/* 0B905C 800B845C 000377C2 */ srl $t6, $v1, 0x1f -/* 0B9060 800B8460 01C01825 */ move $v1, $t6 -.L800B8464: -/* 0B9064 800B8464 10600003 */ beqz $v1, .L800B8474 -/* 0B9068 800B8468 8FA200AC */ lw $v0, 0xac($sp) -/* 0B906C 800B846C 10000007 */ b .L800B848C -/* 0B9070 800B8470 AFB20154 */ sw $s2, 0x154($sp) -.L800B8474: -/* 0B9074 800B8474 8FB900B0 */ lw $t9, 0xb0($sp) -/* 0B9078 800B8478 24420001 */ addiu $v0, $v0, 1 -/* 0B907C 800B847C AFA200AC */ sw $v0, 0xac($sp) -/* 0B9080 800B8480 5459FE46 */ bnel $v0, $t9, .L800B7D9C -/* 0B9084 800B8484 8FAF0130 */ lw $t7, 0x130($sp) -/* 0B9088 800B8488 AFB20154 */ sw $s2, 0x154($sp) -.L800B848C: -/* 0B908C 800B848C 0004C040 */ sll $t8, $a0, 1 -/* 0B9090 800B8490 00187FC2 */ srl $t7, $t8, 0x1f -/* 0B9094 800B8494 24010001 */ li $at, 1 -/* 0B9098 800B8498 8FB20154 */ lw $s2, 0x154($sp) -/* 0B909C 800B849C 15E10006 */ bne $t7, $at, .L800B84B8 -/* 0B90A0 800B84A0 00001825 */ move $v1, $zero -/* 0B90A4 800B84A4 8FAE0144 */ lw $t6, 0x144($sp) -/* 0B90A8 800B84A8 24030001 */ li $v1, 1 -/* 0B90AC 800B84AC 91D90000 */ lbu $t9, ($t6) -/* 0B90B0 800B84B0 3338FFBF */ andi $t8, $t9, 0xffbf -/* 0B90B4 800B84B4 A1D80000 */ sb $t8, ($t6) -.L800B84B8: -/* 0B90B8 800B84B8 8FB30150 */ lw $s3, 0x150($sp) -/* 0B90BC 800B84BC 97B9009E */ lhu $t9, 0x9e($sp) -/* 0B90C0 800B84C0 02402025 */ move $a0, $s2 -/* 0B90C4 800B84C4 00133040 */ sll $a2, $s3, 1 -/* 0B90C8 800B84C8 00C09825 */ move $s3, $a2 -/* 0B90CC 800B84CC 02E02825 */ move $a1, $s7 -/* 0B90D0 800B84D0 97A70112 */ lhu $a3, 0x112($sp) -/* 0B90D4 800B84D4 AFA30014 */ sw $v1, 0x14($sp) -/* 0B90D8 800B84D8 AFA30114 */ sw $v1, 0x114($sp) -/* 0B90DC 800B84DC 0C02E191 */ jal final_resample -/* 0B90E0 800B84E0 AFB90010 */ sw $t9, 0x10($sp) -/* 0B90E4 800B84E4 8FB10144 */ lw $s1, 0x144($sp) -/* 0B90E8 800B84E8 00409025 */ move $s2, $v0 -/* 0B90EC 800B84EC 8FB40114 */ lw $s4, 0x114($sp) -/* 0B90F0 800B84F0 92380003 */ lbu $t8, 3($s1) -/* 0B90F4 800B84F4 02402025 */ move $a0, $s2 -/* 0B90F8 800B84F8 02E03025 */ move $a2, $s7 -/* 0B90FC 800B84FC 17000004 */ bnez $t8, .L800B8510 -/* 0B9100 800B8500 02202825 */ move $a1, $s1 -/* 0B9104 800B8504 92EE0002 */ lbu $t6, 2($s7) -/* 0B9108 800B8508 51C00004 */ beql $t6, $zero, .L800B851C -/* 0B910C 800B850C 922F0004 */ lbu $t7, 4($s1) -.L800B8510: -/* 0B9110 800B8510 1000000A */ b .L800B853C -/* 0B9114 800B8514 24100001 */ li $s0, 1 -/* 0B9118 800B8518 922F0004 */ lbu $t7, 4($s1) -.L800B851C: -/* 0B911C 800B851C 15E00005 */ bnez $t7, .L800B8534 -/* 0B9120 800B8520 00000000 */ nop -/* 0B9124 800B8524 92F90003 */ lbu $t9, 3($s7) -/* 0B9128 800B8528 00008025 */ move $s0, $zero -/* 0B912C 800B852C 13200003 */ beqz $t9, .L800B853C -/* 0B9130 800B8530 00000000 */ nop -.L800B8534: -/* 0B9134 800B8534 10000001 */ b .L800B853C -/* 0B9138 800B8538 24100002 */ li $s0, 2 -.L800B853C: -/* 0B913C 800B853C 8FA70150 */ lw $a3, 0x150($sp) -/* 0B9140 800B8540 AFA00010 */ sw $zero, 0x10($sp) -/* 0B9144 800B8544 AFB00014 */ sw $s0, 0x14($sp) -/* 0B9148 800B8548 0C02E1A8 */ jal func_800B86A0 -/* 0B914C 800B854C AFB40018 */ sw $s4, 0x18($sp) -/* 0B9150 800B8550 92380000 */ lbu $t8, ($s1) -/* 0B9154 800B8554 00409025 */ move $s2, $v0 -/* 0B9158 800B8558 00402025 */ move $a0, $v0 -/* 0B915C 800B855C 330E0001 */ andi $t6, $t8, 1 -/* 0B9160 800B8560 11C00007 */ beqz $t6, .L800B8580 -/* 0B9164 800B8564 02202825 */ move $a1, $s1 -/* 0B9168 800B8568 02E03025 */ move $a2, $s7 -/* 0B916C 800B856C 02603825 */ move $a3, $s3 -/* 0B9170 800B8570 AFB40010 */ sw $s4, 0x10($sp) -/* 0B9174 800B8574 0C02E28B */ jal note_apply_headset_pan_effects -/* 0B9178 800B8578 AFB00014 */ sw $s0, 0x14($sp) -/* 0B917C 800B857C 00409025 */ move $s2, $v0 -.L800B8580: -/* 0B9180 800B8580 8FBF004C */ lw $ra, 0x4c($sp) -/* 0B9184 800B8584 02401025 */ move $v0, $s2 -/* 0B9188 800B8588 8FB20030 */ lw $s2, 0x30($sp) -/* 0B918C 800B858C 8FB00028 */ lw $s0, 0x28($sp) -/* 0B9190 800B8590 8FB1002C */ lw $s1, 0x2c($sp) -/* 0B9194 800B8594 8FB30034 */ lw $s3, 0x34($sp) -/* 0B9198 800B8598 8FB40038 */ lw $s4, 0x38($sp) -/* 0B919C 800B859C 8FB5003C */ lw $s5, 0x3c($sp) -/* 0B91A0 800B85A0 8FB60040 */ lw $s6, 0x40($sp) -/* 0B91A4 800B85A4 8FB70044 */ lw $s7, 0x44($sp) -/* 0B91A8 800B85A8 8FBE0048 */ lw $fp, 0x48($sp) -/* 0B91AC 800B85AC 03E00008 */ jr $ra -/* 0B91B0 800B85B0 27BD0140 */ addiu $sp, $sp, 0x140 diff --git a/asm/non_matchings/code_80005FD0/func_800088D8.s b/asm/non_matchings/code_80005FD0/func_800088D8.s deleted file mode 100644 index efa8f6b18c..0000000000 --- a/asm/non_matchings/code_80005FD0/func_800088D8.s +++ /dev/null @@ -1,344 +0,0 @@ -glabel func_800088D8 -/* 0094D8 800088D8 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 0094DC 800088DC AFA5005C */ sw $a1, 0x5c($sp) -/* 0094E0 800088E0 00057400 */ sll $t6, $a1, 0x10 -/* 0094E4 800088E4 000E2C03 */ sra $a1, $t6, 0x10 -/* 0094E8 800088E8 3C0E8016 */ lui $t6, %hi(D_80163128) # $t6, 0x8016 -/* 0094EC 800088EC 00044080 */ sll $t0, $a0, 2 -/* 0094F0 800088F0 3C0F8016 */ lui $t7, %hi(D_80163150) # $t7, 0x8016 -/* 0094F4 800088F4 AFA60060 */ sw $a2, 0x60($sp) -/* 0094F8 800088F8 0006C400 */ sll $t8, $a2, 0x10 -/* 0094FC 800088FC 2402FFFF */ li $v0, -1 -/* 009500 80008900 25CE3128 */ addiu $t6, %lo(D_80163128) # addiu $t6, $t6, 0x3128 -/* 009504 80008904 25EF3150 */ addiu $t7, %lo(D_80163150) # addiu $t7, $t7, 0x3150 -/* 009508 80008908 00183403 */ sra $a2, $t8, 0x10 -/* 00950C 8000890C 010E6821 */ addu $t5, $t0, $t6 -/* 009510 80008910 010F6021 */ addu $t4, $t0, $t7 -/* 009514 80008914 ADA20000 */ sw $v0, ($t5) -/* 009518 80008918 AD820000 */ sw $v0, ($t4) -/* 00951C 8000891C 3C18800E */ lui $t8, %hi(gModeSelection) -/* 009520 80008920 8F18C53C */ lw $t8, %lo(gModeSelection)($t8) -/* 009524 80008924 24030001 */ li $v1, 1 -/* 009528 80008928 14780003 */ bne $v1, $t8, .L80008938 -/* 00952C 8000892C 00000000 */ nop -/* 009530 80008930 10000121 */ b .L80008DB8 -/* 009534 80008934 24020001 */ li $v0, 1 -.L80008938: -/* 009538 80008938 04A10003 */ bgez $a1, .L80008948 -/* 00953C 8000893C 28A10004 */ slti $at, $a1, 4 -/* 009540 80008940 1000011D */ b .L80008DB8 -/* 009544 80008944 24020001 */ li $v0, 1 -.L80008948: -/* 009548 80008948 14200002 */ bnez $at, .L80008954 -/* 00954C 8000894C 00045840 */ sll $t3, $a0, 1 -/* 009550 80008950 24050003 */ li $a1, 3 -.L80008954: -/* 009554 80008954 3C198016 */ lui $t9, %hi(D_80163330) # 0x8016 -/* 009558 80008958 032BC821 */ addu $t9, $t9, $t3 -/* 00955C 8000895C 97393330 */ lhu $t9, %lo(D_80163330)($t9) # 0x3330($t9) -/* 009560 80008960 000470C0 */ sll $t6, $a0, 3 -/* 009564 80008964 01C47023 */ subu $t6, $t6, $a0 -/* 009568 80008968 14790003 */ bne $v1, $t9, .L80008978 -/* 00956C 8000896C 000E7100 */ sll $t6, $t6, 4 -/* 009570 80008970 10000111 */ b .L80008DB8 -/* 009574 80008974 24020001 */ li $v0, 1 -.L80008978: -/* 009578 80008978 01C47023 */ subu $t6, $t6, $a0 -/* 00957C 8000897C 000E7080 */ sll $t6, $t6, 2 -/* 009580 80008980 01C47023 */ subu $t6, $t6, $a0 -/* 009584 80008984 3C0F800F */ lui $t7, %hi(gPlayers) # $t7, 0x800f -/* 009588 80008988 25EF6990 */ addiu $t7, %lo(gPlayers) # addiu $t7, $t7, 0x6990 -/* 00958C 8000898C 000E70C0 */ sll $t6, $t6, 3 -/* 009590 80008990 01CF4821 */ addu $t1, $t6, $t7 -/* 009594 80008994 95380000 */ lhu $t8, ($t1) -/* 009598 80008998 3C0E800E */ lui $t6, %hi(gCurrentCourseId) -/* 00959C 8000899C 33194000 */ andi $t9, $t8, 0x4000 -/* 0095A0 800089A0 13200003 */ beqz $t9, .L800089B0 -/* 0095A4 800089A4 00000000 */ nop -/* 0095A8 800089A8 10000103 */ b .L80008DB8 -/* 0095AC 800089AC 24020001 */ li $v0, 1 -.L800089B0: -/* 0095B0 800089B0 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 0095B4 800089B4 3C18800E */ lui $t8, %hi(D_800DCBB4) -/* 0095B8 800089B8 000550C0 */ sll $t2, $a1, 3 -/* 0095BC 800089BC 000E7880 */ sll $t7, $t6, 2 -/* 0095C0 800089C0 030FC021 */ addu $t8, $t8, $t7 -/* 0095C4 800089C4 8F18CBB4 */ lw $t8, %lo(D_800DCBB4)($t8) -/* 0095C8 800089C8 000AC840 */ sll $t9, $t2, 1 -/* 0095CC 800089CC 14C0008E */ bnez $a2, .L80008C08 -/* 0095D0 800089D0 03193821 */ addu $a3, $t8, $t9 -/* 0095D4 800089D4 3C0E800E */ lui $t6, %hi(gDemoMode) -/* 0095D8 800089D8 95CEC51C */ lhu $t6, %lo(gDemoMode)($t6) -/* 0095DC 800089DC 3C048016 */ lui $a0, %hi(D_80164450) # $a0, 0x8016 -/* 0095E0 800089E0 24844450 */ addiu $a0, %lo(D_80164450) # addiu $a0, $a0, 0x4450 -/* 0095E4 800089E4 146E003A */ bne $v1, $t6, .L80008AD0 -/* 0095E8 800089E8 0088C021 */ addu $t8, $a0, $t0 -/* 0095EC 800089EC 3C188016 */ lui $t8, %hi(D_80164378 + 0xE) # $t8, 0x8016 -/* 0095F0 800089F0 87184386 */ lh $t8, %lo(D_80164378 + 0xE)($t8) -/* 0095F4 800089F4 3C048016 */ lui $a0, %hi(D_80164450) # $a0, 0x8016 -/* 0095F8 800089F8 24844450 */ addiu $a0, %lo(D_80164450) # addiu $a0, $a0, 0x4450 -/* 0095FC 800089FC 0018C880 */ sll $t9, $t8, 2 -/* 009600 80008A00 00887821 */ addu $t7, $a0, $t0 -/* 009604 80008A04 00997021 */ addu $t6, $a0, $t9 -/* 009608 80008A08 85E20002 */ lh $v0, 2($t7) -/* 00960C 80008A0C 85C30002 */ lh $v1, 2($t6) -/* 009610 80008A10 29410018 */ slti $at, $t2, 0x18 -/* 009614 80008A14 00433023 */ subu $a2, $v0, $v1 -/* 009618 80008A18 04C10002 */ bgez $a2, .L80008A24 -/* 00961C 80008A1C 00C02825 */ move $a1, $a2 -/* 009620 80008A20 00062823 */ negu $a1, $a2 -.L80008A24: -/* 009624 80008A24 50200016 */ beql $at, $zero, .L80008A80 -/* 009628 80008A28 84E40000 */ lh $a0, ($a3) -/* 00962C 80008A2C 84E20000 */ lh $v0, ($a3) -/* 009630 80008A30 3C018016 */ lui $at, %hi(gLapCompletionPercentByPlayerId) -/* 009634 80008A34 00280821 */ addu $at, $at, $t0 -/* 009638 80008A38 84E30010 */ lh $v1, 0x10($a3) -/* 00963C 80008A3C C42044A8 */ lwc1 $f0, %lo(gLapCompletionPercentByPlayerId)($at) -/* 009640 80008A40 44822000 */ mtc1 $v0, $f4 -/* 009644 80008A44 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 009648 80008A48 44814000 */ mtc1 $at, $f8 -/* 00964C 80008A4C 468021A0 */ cvt.s.w $f6, $f4 -/* 009650 80008A50 44839000 */ mtc1 $v1, $f18 -/* 009654 80008A54 46004281 */ sub.s $f10, $f8, $f0 -/* 009658 80008A58 46809120 */ cvt.s.w $f4, $f18 -/* 00965C 80008A5C 460A3402 */ mul.s $f16, $f6, $f10 -/* 009660 80008A60 00000000 */ nop -/* 009664 80008A64 46002202 */ mul.s $f8, $f4, $f0 -/* 009668 80008A68 46104180 */ add.s $f6, $f8, $f16 -/* 00966C 80008A6C 4600328D */ trunc.w.s $f10, $f6 -/* 009670 80008A70 44045000 */ mfc1 $a0, $f10 -/* 009674 80008A74 10000002 */ b .L80008A80 -/* 009678 80008A78 00000000 */ nop -/* 00967C 80008A7C 84E40000 */ lh $a0, ($a3) -.L80008A80: -/* 009680 80008A80 0085082A */ slt $at, $a0, $a1 -/* 009684 80008A84 10200010 */ beqz $at, .L80008AC8 -/* 009688 80008A88 AD840000 */ sw $a0, ($t4) -/* 00968C 80008A8C 3C014190 */ li $at, 0x41900000 # 18.000000 -/* 009690 80008A90 44812000 */ mtc1 $at, $f4 -/* 009694 80008A94 C5320094 */ lwc1 $f18, 0x94($t1) -/* 009698 80008A98 3C014358 */ li $at, 0x43580000 # 216.000000 -/* 00969C 80008A9C 44818000 */ mtc1 $at, $f16 -/* 0096A0 80008AA0 46049203 */ div.s $f8, $f18, $f4 -/* 0096A4 80008AA4 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0096A8 80008AA8 44815000 */ mtc1 $at, $f10 -/* 0096AC 80008AAC 46104182 */ mul.s $f6, $f8, $f16 -/* 0096B0 80008AB0 4606503E */ c.le.s $f10, $f6 -/* 0096B4 80008AB4 00000000 */ nop -/* 0096B8 80008AB8 45000003 */ bc1f .L80008AC8 -/* 0096BC 80008ABC 00000000 */ nop -/* 0096C0 80008AC0 100000BD */ b .L80008DB8 -/* 0096C4 80008AC4 00001025 */ move $v0, $zero -.L80008AC8: -/* 0096C8 80008AC8 100000BB */ b .L80008DB8 -/* 0096CC 80008ACC 24020001 */ li $v0, 1 -.L80008AD0: -/* 0096D0 80008AD0 3C0F8016 */ lui $t7, %hi(gWaypointCountByPathIndex) # $t7, 0x8016 -/* 0096D4 80008AD4 95EF45C8 */ lhu $t7, %lo(gWaypointCountByPathIndex)($t7) -/* 0096D8 80008AD8 87020002 */ lh $v0, 2($t8) -/* 0096DC 80008ADC 24010003 */ li $at, 3 -/* 0096E0 80008AE0 000FC040 */ sll $t8, $t7, 1 -/* 0096E4 80008AE4 0301001A */ div $zero, $t8, $at -/* 0096E8 80008AE8 3C0B8016 */ lui $t3, %hi(D_80163478) # $t3, 0x8016 -/* 0096EC 80008AEC 856B3478 */ lh $t3, %lo(D_80163478)($t3) -/* 0096F0 80008AF0 3C0D8016 */ lui $t5, %hi(gGPCurrentRaceRankByPlayerId + 0x2) # 0x8016 -/* 0096F4 80008AF4 000BC880 */ sll $t9, $t3, 2 -/* 0096F8 80008AF8 00997021 */ addu $t6, $a0, $t9 -/* 0096FC 80008AFC 85C30002 */ lh $v1, 2($t6) -/* 009700 80008B00 01B96821 */ addu $t5, $t5, $t9 -/* 009704 80008B04 0000C812 */ mflo $t9 -/* 009708 80008B08 00432823 */ subu $a1, $v0, $v1 -/* 00970C 80008B0C 0325082A */ slt $at, $t9, $a1 -/* 009710 80008B10 1020000B */ beqz $at, .L80008B40 -/* 009714 80008B14 85AD43BA */ lh $t5, %lo(gGPCurrentRaceRankByPlayerId + 0x2)($t5) # 0x43ba($t5) -/* 009718 80008B18 29A10006 */ slti $at, $t5, 6 -/* 00971C 80008B1C 14200008 */ bnez $at, .L80008B40 -/* 009720 80008B20 000D7040 */ sll $t6, $t5, 1 -/* 009724 80008B24 3C0F8016 */ lui $t7, %hi(gLapCountByPlayerId - 0x1A) # 0x8016 -/* 009728 80008B28 01EE7821 */ addu $t7, $t7, $t6 -/* 00972C 80008B2C 85EF4376 */ lh $t7, %lo(gLapCountByPlayerId - 0x1A)($t7) # 0x4376($t7) -/* 009730 80008B30 000FC080 */ sll $t8, $t7, 2 -/* 009734 80008B34 0098C821 */ addu $t9, $a0, $t8 -/* 009738 80008B38 87230002 */ lh $v1, 2($t9) -/* 00973C 80008B3C 00432823 */ subu $a1, $v0, $v1 -.L80008B40: -/* 009740 80008B40 04A10002 */ bgez $a1, .L80008B4C -/* 009744 80008B44 29410018 */ slti $at, $t2, 0x18 -/* 009748 80008B48 00052823 */ negu $a1, $a1 -.L80008B4C: -/* 00974C 80008B4C 10200015 */ beqz $at, .L80008BA4 -/* 009750 80008B50 3C0F800E */ lui $t7, %hi(gCCSelection) -/* 009754 80008B54 84E20000 */ lh $v0, ($a3) -/* 009758 80008B58 3C018016 */ lui $at, %hi(gLapCompletionPercentByPlayerId) -/* 00975C 80008B5C 00280821 */ addu $at, $at, $t0 -/* 009760 80008B60 84E30010 */ lh $v1, 0x10($a3) -/* 009764 80008B64 C42044A8 */ lwc1 $f0, %lo(gLapCompletionPercentByPlayerId)($at) -/* 009768 80008B68 44829000 */ mtc1 $v0, $f18 -/* 00976C 80008B6C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 009770 80008B70 44814000 */ mtc1 $at, $f8 -/* 009774 80008B74 46809120 */ cvt.s.w $f4, $f18 -/* 009778 80008B78 44835000 */ mtc1 $v1, $f10 -/* 00977C 80008B7C 46004401 */ sub.s $f16, $f8, $f0 -/* 009780 80008B80 468054A0 */ cvt.s.w $f18, $f10 -/* 009784 80008B84 46102182 */ mul.s $f6, $f4, $f16 -/* 009788 80008B88 00000000 */ nop -/* 00978C 80008B8C 46009202 */ mul.s $f8, $f18, $f0 -/* 009790 80008B90 46064100 */ add.s $f4, $f8, $f6 -/* 009794 80008B94 4600240D */ trunc.w.s $f16, $f4 -/* 009798 80008B98 44048000 */ mfc1 $a0, $f16 -/* 00979C 80008B9C 10000002 */ b .L80008BA8 -/* 0097A0 80008BA0 00000000 */ nop -.L80008BA4: -/* 0097A4 80008BA4 84E40000 */ lh $a0, ($a3) -.L80008BA8: -/* 0097A8 80008BA8 8DEFC548 */ lw $t7, %lo(gCCSelection)($t7) -/* 0097AC 80008BAC 25F80001 */ addiu $t8, $t7, 1 -/* 0097B0 80008BB0 03040019 */ multu $t8, $a0 -/* 0097B4 80008BB4 00002012 */ mflo $a0 -/* 0097B8 80008BB8 0085082A */ slt $at, $a0, $a1 -/* 0097BC 80008BBC 10200010 */ beqz $at, .L80008C00 -/* 0097C0 80008BC0 AD840000 */ sw $a0, ($t4) -/* 0097C4 80008BC4 3C014190 */ li $at, 0x41900000 # 18.000000 -/* 0097C8 80008BC8 44819000 */ mtc1 $at, $f18 -/* 0097CC 80008BCC C52A0094 */ lwc1 $f10, 0x94($t1) -/* 0097D0 80008BD0 3C014358 */ li $at, 0x43580000 # 216.000000 -/* 0097D4 80008BD4 44813000 */ mtc1 $at, $f6 -/* 0097D8 80008BD8 46125203 */ div.s $f8, $f10, $f18 -/* 0097DC 80008BDC 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0097E0 80008BE0 44818000 */ mtc1 $at, $f16 -/* 0097E4 80008BE4 46064102 */ mul.s $f4, $f8, $f6 -/* 0097E8 80008BE8 4604803E */ c.le.s $f16, $f4 -/* 0097EC 80008BEC 00000000 */ nop -/* 0097F0 80008BF0 45000003 */ bc1f .L80008C00 -/* 0097F4 80008BF4 00000000 */ nop -/* 0097F8 80008BF8 1000006F */ b .L80008DB8 -/* 0097FC 80008BFC 00001025 */ move $v0, $zero -.L80008C00: -/* 009800 80008C00 1000006D */ b .L80008DB8 -/* 009804 80008C04 24020001 */ li $v0, 1 -.L80008C08: -/* 009808 80008C08 3C098016 */ lui $t1, %hi(D_80163344) # $t1, 0x8016 -/* 00980C 80008C0C 85293344 */ lh $t1, %lo(D_80163344)($t1) -/* 009810 80008C10 3C048016 */ lui $a0, %hi(D_80164450) # $a0, 0x8016 -/* 009814 80008C14 24844450 */ addiu $a0, %lo(D_80164450) # addiu $a0, $a0, 0x4450 -/* 009818 80008C18 00097080 */ sll $t6, $t1, 2 -/* 00981C 80008C1C 0088C821 */ addu $t9, $a0, $t0 -/* 009820 80008C20 008E7821 */ addu $t7, $a0, $t6 -/* 009824 80008C24 87220002 */ lh $v0, 2($t9) -/* 009828 80008C28 85E30002 */ lh $v1, 2($t7) -/* 00982C 80008C2C 3C048016 */ lui $a0, %hi(D_80163344) # $a0, 0x8016 -/* 009830 80008C30 24843344 */ addiu $a0, %lo(D_80163344) # addiu $a0, $a0, 0x3344 -/* 009834 80008C34 0062C023 */ subu $t8, $v1, $v0 -/* 009838 80008C38 AFB80010 */ sw $t8, 0x10($sp) -/* 00983C 80008C3C 07010002 */ bgez $t8, .L80008C48 -/* 009840 80008C40 03002825 */ move $a1, $t8 -/* 009844 80008C44 00182823 */ negu $a1, $t8 -.L80008C48: -/* 009848 80008C48 3C038016 */ lui $v1, %hi(D_80163348) # $v1, 0x8016 -/* 00984C 80008C4C 00001025 */ move $v0, $zero -/* 009850 80008C50 24633348 */ addiu $v1, %lo(D_80163348) # addiu $v1, $v1, 0x3348 -/* 009854 80008C54 948F0000 */ lhu $t7, ($a0) -.L80008C58: -/* 009858 80008C58 3C198016 */ lui $t9, %hi(gGPCurrentRaceRankByPlayerId) -/* 00985C 80008C5C 24840002 */ addiu $a0, $a0, 2 -/* 009860 80008C60 000FC080 */ sll $t8, $t7, 2 -/* 009864 80008C64 0338C821 */ addu $t9, $t9, $t8 -/* 009868 80008C68 8F3943B8 */ lw $t9, %lo(gGPCurrentRaceRankByPlayerId)($t9) -/* 00986C 80008C6C 0326082A */ slt $at, $t9, $a2 -/* 009870 80008C70 50200005 */ beql $at, $zero, .L80008C88 -/* 009874 80008C74 0083082B */ sltu $at, $a0, $v1 -/* 009878 80008C78 24420001 */ addiu $v0, $v0, 1 -/* 00987C 80008C7C 00027400 */ sll $t6, $v0, 0x10 -/* 009880 80008C80 000E1403 */ sra $v0, $t6, 0x10 -/* 009884 80008C84 0083082B */ sltu $at, $a0, $v1 -.L80008C88: -/* 009888 80008C88 5420FFF3 */ bnel $at, $zero, .L80008C58 -/* 00988C 80008C8C 948F0000 */ lhu $t7, ($a0) -/* 009890 80008C90 3C098019 */ lui $t1, %hi(gPlayerCount) # $t1, 0x8019 -/* 009894 80008C94 8129EDF3 */ lb $t1, %lo(gPlayerCount)($t1) -/* 009898 80008C98 3C188016 */ lui $t8, %hi(gGPCurrentRaceRankByPlayerId) -/* 00989C 80008C9C 00002025 */ move $a0, $zero -/* 0098A0 80008CA0 19200010 */ blez $t1, .L80008CE4 -/* 0098A4 80008CA4 270343B8 */ addiu $v1, $t8, %lo(gGPCurrentRaceRankByPlayerId) -/* 0098A8 80008CA8 0009C880 */ sll $t9, $t1, 2 -/* 0098AC 80008CAC 03237021 */ addu $t6, $t9, $v1 -/* 0098B0 80008CB0 AFAE0004 */ sw $t6, 4($sp) -/* 0098B4 80008CB4 8C6F0000 */ lw $t7, ($v1) -.L80008CB8: -/* 0098B8 80008CB8 8FAE0004 */ lw $t6, 4($sp) -/* 0098BC 80008CBC 01E6082A */ slt $at, $t7, $a2 -/* 0098C0 80008CC0 50200005 */ beql $at, $zero, .L80008CD8 -/* 0098C4 80008CC4 24630004 */ addiu $v1, $v1, 4 -/* 0098C8 80008CC8 24840001 */ addiu $a0, $a0, 1 -/* 0098CC 80008CCC 0004CC00 */ sll $t9, $a0, 0x10 -/* 0098D0 80008CD0 00192403 */ sra $a0, $t9, 0x10 -/* 0098D4 80008CD4 24630004 */ addiu $v1, $v1, 4 -.L80008CD8: -/* 0098D8 80008CD8 006E082B */ sltu $at, $v1, $t6 -/* 0098DC 80008CDC 5420FFF6 */ bnel $at, $zero, .L80008CB8 -/* 0098E0 80008CE0 8C6F0000 */ lw $t7, ($v1) -.L80008CE4: -/* 0098E4 80008CE4 00C2C823 */ subu $t9, $a2, $v0 -/* 0098E8 80008CE8 03244823 */ subu $t1, $t9, $a0 -/* 0098EC 80008CEC 0009C400 */ sll $t8, $t1, 0x10 -/* 0098F0 80008CF0 1C400003 */ bgtz $v0, .L80008D00 -/* 0098F4 80008CF4 00184C03 */ sra $t1, $t8, 0x10 -/* 0098F8 80008CF8 18800004 */ blez $a0, .L80008D0C -/* 0098FC 80008CFC 00000000 */ nop -.L80008D00: -/* 009900 80008D00 25290001 */ addiu $t1, $t1, 1 -/* 009904 80008D04 00097C00 */ sll $t7, $t1, 0x10 -/* 009908 80008D08 000F4C03 */ sra $t1, $t7, 0x10 -.L80008D0C: -/* 00990C 80008D0C 3C018016 */ lui $at, %hi(D_80164538) # 0x8016 -/* 009910 80008D10 002B0821 */ addu $at, $at, $t3 -/* 009914 80008D14 05200004 */ bltz $t1, .L80008D28 -/* 009918 80008D18 A4294538 */ sh $t1, %lo(D_80164538)($at) # 0x4538($at) -/* 00991C 80008D1C 29210008 */ slti $at, $t1, 8 -/* 009920 80008D20 54200004 */ bnel $at, $zero, .L80008D34 -/* 009924 80008D24 29410018 */ slti $at, $t2, 0x18 -.L80008D28: -/* 009928 80008D28 10000023 */ b .L80008DB8 -/* 00992C 80008D2C 00001025 */ move $v0, $zero -/* 009930 80008D30 29410018 */ slti $at, $t2, 0x18 -.L80008D34: -/* 009934 80008D34 10200017 */ beqz $at, .L80008D94 -/* 009938 80008D38 00097840 */ sll $t7, $t1, 1 -/* 00993C 80008D3C 0009C040 */ sll $t8, $t1, 1 -/* 009940 80008D40 00F83021 */ addu $a2, $a3, $t8 -/* 009944 80008D44 84C20000 */ lh $v0, ($a2) -/* 009948 80008D48 3C018016 */ lui $at, %hi(gLapCompletionPercentByPlayerId) -/* 00994C 80008D4C 00280821 */ addu $at, $at, $t0 -/* 009950 80008D50 84C30010 */ lh $v1, 0x10($a2) -/* 009954 80008D54 C42044A8 */ lwc1 $f0, %lo(gLapCompletionPercentByPlayerId)($at) -/* 009958 80008D58 44825000 */ mtc1 $v0, $f10 -/* 00995C 80008D5C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 009960 80008D60 44814000 */ mtc1 $at, $f8 -/* 009964 80008D64 468054A0 */ cvt.s.w $f18, $f10 -/* 009968 80008D68 44838000 */ mtc1 $v1, $f16 -/* 00996C 80008D6C 46004181 */ sub.s $f6, $f8, $f0 -/* 009970 80008D70 468082A0 */ cvt.s.w $f10, $f16 -/* 009974 80008D74 46069102 */ mul.s $f4, $f18, $f6 -/* 009978 80008D78 00000000 */ nop -/* 00997C 80008D7C 46005202 */ mul.s $f8, $f10, $f0 -/* 009980 80008D80 46044480 */ add.s $f18, $f8, $f4 -/* 009984 80008D84 4600918D */ trunc.w.s $f6, $f18 -/* 009988 80008D88 44043000 */ mfc1 $a0, $f6 -/* 00998C 80008D8C 10000003 */ b .L80008D9C -/* 009990 80008D90 00000000 */ nop -.L80008D94: -/* 009994 80008D94 00EFC821 */ addu $t9, $a3, $t7 -/* 009998 80008D98 87240000 */ lh $a0, ($t9) -.L80008D9C: -/* 00999C 80008D9C 0085082A */ slt $at, $a0, $a1 -/* 0099A0 80008DA0 ADA50000 */ sw $a1, ($t5) -/* 0099A4 80008DA4 10200003 */ beqz $at, .L80008DB4 -/* 0099A8 80008DA8 AD840000 */ sw $a0, ($t4) -/* 0099AC 80008DAC 10000002 */ b .L80008DB8 -/* 0099B0 80008DB0 24020001 */ li $v0, 1 -.L80008DB4: -/* 0099B4 80008DB4 00001025 */ move $v0, $zero -.L80008DB8: -/* 0099B8 80008DB8 03E00008 */ jr $ra -/* 0099BC 80008DBC 27BD0058 */ addiu $sp, $sp, 0x58 diff --git a/asm/non_matchings/code_80005FD0/func_8000929C.s b/asm/non_matchings/code_80005FD0/func_8000929C.s deleted file mode 100644 index f31cb788f7..0000000000 --- a/asm/non_matchings/code_80005FD0/func_8000929C.s +++ /dev/null @@ -1,372 +0,0 @@ -.section .late_rodata - -glabel D_800ECFA8 -.float 1300.0 - -glabel D_800ECFAC -.float -1300.0 - -.section .text - -glabel func_8000929C -/* 009E9C 8000929C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 009EA0 800092A0 AFBF0024 */ sw $ra, 0x24($sp) -/* 009EA4 800092A4 C4A0001C */ lwc1 $f0, 0x1c($a1) -/* 009EA8 800092A8 C4AC0014 */ lwc1 $f12, 0x14($a1) -/* 009EAC 800092AC C4AE0018 */ lwc1 $f14, 0x18($a1) -/* 009EB0 800092B0 3C0E8016 */ lui $t6, %hi(D_80163240) # $t6, 0x8016 -/* 009EB4 800092B4 3C018016 */ lui $at, %hi(D_801630E2) # $at, 0x8016 -/* 009EB8 800092B8 25CE3240 */ addiu $t6, %lo(D_80163240) # addiu $t6, $t6, 0x3240 -/* 009EBC 800092BC 00041040 */ sll $v0, $a0, 1 -/* 009EC0 800092C0 A42030E2 */ sh $zero, %lo(D_801630E2)($at) -/* 009EC4 800092C4 004E1821 */ addu $v1, $v0, $t6 -/* 009EC8 800092C8 A4600000 */ sh $zero, ($v1) -/* 009ECC 800092CC 3C0F8016 */ lui $t7, %hi(gNearestWaypointByPlayerId) # $t7, 0x8016 -/* 009ED0 800092D0 3C188016 */ lui $t8, %hi(D_80163448) # $t8, 0x8016 -/* 009ED4 800092D4 8F183448 */ lw $t8, %lo(D_80163448)($t8) -/* 009ED8 800092D8 25EF4438 */ addiu $t7, %lo(gNearestWaypointByPlayerId) # addiu $t7, $t7, 0x4438 -/* 009EDC 800092DC 004F4021 */ addu $t0, $v0, $t7 -/* 009EE0 800092E0 44060000 */ mfc1 $a2, $f0 -/* 009EE4 800092E4 85070000 */ lh $a3, ($t0) -/* 009EE8 800092E8 AFA80030 */ sw $t0, 0x30($sp) -/* 009EEC 800092EC AFA3002C */ sw $v1, 0x2c($sp) -/* 009EF0 800092F0 AFA50054 */ sw $a1, 0x54($sp) -/* 009EF4 800092F4 AFA40050 */ sw $a0, 0x50($sp) -/* 009EF8 800092F8 AFA40014 */ sw $a0, 0x14($sp) -/* 009EFC 800092FC AFA50010 */ sw $a1, 0x10($sp) -/* 009F00 80009300 E7A00044 */ swc1 $f0, 0x44($sp) -/* 009F04 80009304 E7AC004C */ swc1 $f12, 0x4c($sp) -/* 009F08 80009308 0C003349 */ jal func_8000CD24 -/* 009F0C 8000930C AFB80018 */ sw $t8, 0x18($sp) -/* 009F10 80009310 3C058016 */ lui $a1, %hi(sSomeNearestWaypoint) # $a1, 0x8016 -/* 009F14 80009314 24A52FCE */ addiu $a1, %lo(sSomeNearestWaypoint) # addiu $a1, $a1, 0x2fce -/* 009F18 80009318 A4A20000 */ sh $v0, ($a1) -/* 009F1C 8000931C 84A70000 */ lh $a3, ($a1) -/* 009F20 80009320 8FA80030 */ lw $t0, 0x30($sp) -/* 009F24 80009324 3C018016 */ lui $at, %hi(D_801630E0) # $at, 0x8016 -/* 009F28 80009328 A42730E0 */ sh $a3, %lo(D_801630E0)($at) -/* 009F2C 8000932C 95190000 */ lhu $t9, ($t0) -/* 009F30 80009330 8FA40050 */ lw $a0, 0x50($sp) -/* 009F34 80009334 C7AC004C */ lwc1 $f12, 0x4c($sp) -/* 009F38 80009338 10F9000C */ beq $a3, $t9, .L8000936C -/* 009F3C 8000933C 00E01825 */ move $v1, $a3 -/* 009F40 80009340 A5030000 */ sh $v1, ($t0) -/* 009F44 80009344 24090001 */ li $t1, 1 -/* 009F48 80009348 3C018016 */ lui $at, %hi(D_801630E2) # $at, 0x8016 -/* 009F4C 8000934C A42930E2 */ sh $t1, %lo(D_801630E2)($at) -/* 009F50 80009350 AFA40050 */ sw $a0, 0x50($sp) -/* 009F54 80009354 0C0023CE */ jal func_80008F38 -/* 009F58 80009358 E7AC004C */ swc1 $f12, 0x4c($sp) -/* 009F5C 8000935C 3C078016 */ lui $a3, %hi(sSomeNearestWaypoint) # $a3, 0x8016 -/* 009F60 80009360 84E72FCE */ lh $a3, %lo(sSomeNearestWaypoint)($a3) -/* 009F64 80009364 8FA40050 */ lw $a0, 0x50($sp) -/* 009F68 80009368 C7AC004C */ lwc1 $f12, 0x4c($sp) -.L8000936C: -/* 009F6C 8000936C 3C02800E */ lui $v0, %hi(gCurrentCourseId) -/* 009F70 80009370 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0) -/* 009F74 80009374 24010014 */ li $at, 20 -/* 009F78 80009378 30E5FFFF */ andi $a1, $a3, 0xffff -/* 009F7C 8000937C 14410005 */ bne $v0, $at, .L80009394 -/* 009F80 80009380 3C068016 */ lui $a2, %hi(D_80163448) # $a2, 0x8016 -/* 009F84 80009384 0C002E57 */ jal func_8000B95C -/* 009F88 80009388 8CC63448 */ lw $a2, %lo(D_80163448)($a2) -/* 009F8C 8000938C 10000111 */ b .L800097D4 -/* 009F90 80009390 8FBF0024 */ lw $ra, 0x24($sp) -.L80009394: -/* 009F94 80009394 28E10014 */ slti $at, $a3, 0x14 -/* 009F98 80009398 1420000B */ bnez $at, .L800093C8 -/* 009F9C 8000939C 3C0A8016 */ lui $t2, %hi(D_80163448) # $t2, 0x8016 -/* 009FA0 800093A0 8D4A3448 */ lw $t2, %lo(D_80163448)($t2) -/* 009FA4 800093A4 3C0C8016 */ lui $t4, %hi(gWaypointCountByPathIndex) # 0x8016 -/* 009FA8 800093A8 000A5840 */ sll $t3, $t2, 1 -/* 009FAC 800093AC 018B6021 */ addu $t4, $t4, $t3 -/* 009FB0 800093B0 958C45C8 */ lhu $t4, %lo(gWaypointCountByPathIndex)($t4) # 0x45c8($t4) -/* 009FB4 800093B4 258DFFEC */ addiu $t5, $t4, -0x14 -/* 009FB8 800093B8 01A7082A */ slt $at, $t5, $a3 -/* 009FBC 800093BC 14200002 */ bnez $at, .L800093C8 -/* 009FC0 800093C0 2401000B */ li $at, 11 -/* 009FC4 800093C4 144100BC */ bne $v0, $at, .L800096B8 -.L800093C8: -/* 009FC8 800093C8 2401000B */ li $at, 11 -/* 009FCC 800093CC 00001825 */ move $v1, $zero -/* 009FD0 800093D0 1441004A */ bne $v0, $at, .L800094FC -/* 009FD4 800093D4 00004025 */ move $t0, $zero -/* 009FD8 800093D8 8FAE0054 */ lw $t6, 0x54($sp) -/* 009FDC 800093DC 3C028016 */ lui $v0, %hi(D_801634EC) # $v0, 0x8016 -/* 009FE0 800093E0 244234EC */ addiu $v0, %lo(D_801634EC) # addiu $v0, $v0, 0x34ec -/* 009FE4 800093E4 A4400000 */ sh $zero, ($v0) -/* 009FE8 800093E8 8DCF00BC */ lw $t7, 0xbc($t6) -/* 009FEC 800093EC 24190001 */ li $t9, 1 -/* 009FF0 800093F0 3C09800E */ lui $t1, %hi(gIsMirrorMode) -/* 009FF4 800093F4 31F80200 */ andi $t8, $t7, 0x200 -/* 009FF8 800093F8 13000002 */ beqz $t8, .L80009404 -/* 009FFC 800093FC 3C01C396 */ li $at, 0xC3960000 # -300.000000 -/* 00A000 80009400 A4590000 */ sh $t9, ($v0) -.L80009404: -/* 00A004 80009404 8D29C604 */ lw $t1, %lo(gIsMirrorMode)($t1) -/* 00A008 80009408 51200020 */ beql $t1, $zero, .L8000948C -/* 00A00C 8000940C 44814000 */ mtc1 $at, $f8 -/* 00A010 80009410 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 00A014 80009414 44812000 */ mtc1 $at, $f4 -/* 00A018 80009418 3C01800F */ lui $at, %hi(D_800ECFA8) # -0.000000 -/* 00A01C 8000941C 00043880 */ sll $a3, $a0, 2 -/* 00A020 80009420 4604603C */ c.lt.s $f12, $f4 -/* 00A024 80009424 00000000 */ nop -/* 00A028 80009428 45000004 */ bc1f .L8000943C -/* 00A02C 8000942C 00000000 */ nop -/* 00A030 80009430 24030001 */ li $v1, 1 -/* 00A034 80009434 10000034 */ b .L80009508 -/* 00A038 80009438 24080001 */ li $t0, 1 -.L8000943C: -/* 00A03C 8000943C C426CFA8 */ lwc1 $f6, %lo(D_800ECFA8)($at) -/* 00A040 80009440 00045080 */ sll $t2, $a0, 2 -/* 00A044 80009444 3C0B8016 */ lui $t3, %hi(gLapCountByPlayerId) # 0x8016 -/* 00A048 80009448 4606603C */ c.lt.s $f12, $f6 -/* 00A04C 8000944C 016A5821 */ addu $t3, $t3, $t2 -/* 00A050 80009450 45000028 */ bc1f .L800094F4 -/* 00A054 80009454 00000000 */ nop -/* 00A058 80009458 8D6B4390 */ lw $t3, %lo(gLapCountByPlayerId)($t3) # 0x4390($t3) -/* 00A05C 8000945C 29610002 */ slti $at, $t3, 2 -/* 00A060 80009460 10200024 */ beqz $at, .L800094F4 -/* 00A064 80009464 00000000 */ nop -/* 00A068 80009468 844C0000 */ lh $t4, ($v0) -/* 00A06C 8000946C 24010001 */ li $at, 1 -/* 00A070 80009470 00043880 */ sll $a3, $a0, 2 -/* 00A074 80009474 1581001F */ bne $t4, $at, .L800094F4 -/* 00A078 80009478 00000000 */ nop -/* 00A07C 8000947C 24030001 */ li $v1, 1 -/* 00A080 80009480 10000021 */ b .L80009508 -/* 00A084 80009484 24080001 */ li $t0, 1 -/* 00A088 80009488 44814000 */ mtc1 $at, $f8 -.L8000948C: -/* 00A08C 8000948C 3C01800F */ lui $at, %hi(D_800ECFAC) # $at, 0x800f -/* 00A090 80009490 00043880 */ sll $a3, $a0, 2 -/* 00A094 80009494 460C403C */ c.lt.s $f8, $f12 -/* 00A098 80009498 00000000 */ nop -/* 00A09C 8000949C 45000004 */ bc1f .L800094B0 -/* 00A0A0 800094A0 00000000 */ nop -/* 00A0A4 800094A4 24030001 */ li $v1, 1 -/* 00A0A8 800094A8 10000017 */ b .L80009508 -/* 00A0AC 800094AC 24080001 */ li $t0, 1 -.L800094B0: -/* 00A0B0 800094B0 C42ACFAC */ lwc1 $f10, %lo(D_800ECFAC)($at) -/* 00A0B4 800094B4 00046880 */ sll $t5, $a0, 2 -/* 00A0B8 800094B8 3C0E8016 */ lui $t6, %hi(gLapCountByPlayerId) # 0x8016 -/* 00A0BC 800094BC 460C503C */ c.lt.s $f10, $f12 -/* 00A0C0 800094C0 01CD7021 */ addu $t6, $t6, $t5 -/* 00A0C4 800094C4 4500000B */ bc1f .L800094F4 -/* 00A0C8 800094C8 00000000 */ nop -/* 00A0CC 800094CC 8DCE4390 */ lw $t6, %lo(gLapCountByPlayerId)($t6) # 0x4390($t6) -/* 00A0D0 800094D0 29C10002 */ slti $at, $t6, 2 -/* 00A0D4 800094D4 10200007 */ beqz $at, .L800094F4 -/* 00A0D8 800094D8 00000000 */ nop -/* 00A0DC 800094DC 844F0000 */ lh $t7, ($v0) -/* 00A0E0 800094E0 24010001 */ li $at, 1 -/* 00A0E4 800094E4 15E10003 */ bne $t7, $at, .L800094F4 -/* 00A0E8 800094E8 00000000 */ nop -/* 00A0EC 800094EC 24030001 */ li $v1, 1 -/* 00A0F0 800094F0 24080001 */ li $t0, 1 -.L800094F4: -/* 00A0F4 800094F4 10000004 */ b .L80009508 -/* 00A0F8 800094F8 00043880 */ sll $a3, $a0, 2 -.L800094FC: -/* 00A0FC 800094FC 24030001 */ li $v1, 1 -/* 00A100 80009500 24080001 */ li $t0, 1 -/* 00A104 80009504 00043880 */ sll $a3, $a0, 2 -.L80009508: -/* 00A108 80009508 3C018016 */ lui $at, %hi(D_80163450) -/* 00A10C 8000950C 00270821 */ addu $at, $at, $a3 -/* 00A110 80009510 C4303450 */ lwc1 $f16, %lo(D_80163450)($at) -/* 00A114 80009514 3C018016 */ lui $at, %hi(D_8016344C) # $at, 0x8016 -/* 00A118 80009518 10600052 */ beqz $v1, .L80009664 -/* 00A11C 8000951C E7B00038 */ swc1 $f16, 0x38($sp) -/* 00A120 80009520 C420344C */ lwc1 $f0, %lo(D_8016344C)($at) -/* 00A124 80009524 C7B20044 */ lwc1 $f18, 0x44($sp) -/* 00A128 80009528 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 00A12C 8000952C 4600903E */ c.le.s $f18, $f0 -/* 00A130 80009530 00000000 */ nop -/* 00A134 80009534 4500004B */ bc1f .L80009664 -/* 00A138 80009538 00000000 */ nop -/* 00A13C 8000953C 4604003C */ c.lt.s $f0, $f4 -/* 00A140 80009540 3C188016 */ lui $t8, %hi(gLapCountByPlayerId) # $t8, 0x8016 -/* 00A144 80009544 27184390 */ addiu $t8, %lo(gLapCountByPlayerId) # addiu $t8, $t8, 0x4390 -/* 00A148 80009548 00F81021 */ addu $v0, $a3, $t8 -/* 00A14C 8000954C 45000045 */ bc1f .L80009664 -/* 00A150 80009550 00000000 */ nop -/* 00A154 80009554 8C590000 */ lw $t9, ($v0) -/* 00A158 80009558 3C0A800E */ lui $t2, %hi(gModeSelection) -/* 00A15C 8000955C 24010005 */ li $at, 5 -/* 00A160 80009560 27290001 */ addiu $t1, $t9, 1 -/* 00A164 80009564 AC490000 */ sw $t1, ($v0) -/* 00A168 80009568 8D4AC53C */ lw $t2, %lo(gModeSelection)($t2) -/* 00A16C 8000956C 5540001A */ bnel $t2, $zero, .L800095D8 -/* 00A170 80009570 8FAD002C */ lw $t5, 0x2c($sp) -/* 00A174 80009574 15210017 */ bne $t1, $at, .L800095D4 -/* 00A178 80009578 3C0C8016 */ lui $t4, %hi(D_80164408) # 0x8016 -/* 00A17C 8000957C 01876021 */ addu $t4, $t4, $a3 -/* 00A180 80009580 8D8C4408 */ lw $t4, %lo(D_80164408)($t4) # 0x4408($t4) -/* 00A184 80009584 24010007 */ li $at, 7 -/* 00A188 80009588 3C028016 */ lui $v0, %hi(gLapCountByPlayerId) # $v0, 0x8016 -/* 00A18C 8000958C 15810011 */ bne $t4, $at, .L800095D4 -/* 00A190 80009590 24424390 */ addiu $v0, %lo(gLapCountByPlayerId) # addiu $v0, $v0, 0x4390 -/* 00A194 80009594 3C038016 */ lui $v1, %hi(gLapCountByPlayerId + 0x20) # $v1, 0x8016 -/* 00A198 80009598 246343B0 */ addiu $v1, %lo(gLapCountByPlayerId + 0x20) # addiu $v1, $v1, 0x43b0 -.L8000959C: -/* 00A19C 8000959C 8C4D0000 */ lw $t5, ($v0) -/* 00A1A0 800095A0 8C4F0004 */ lw $t7, 4($v0) -/* 00A1A4 800095A4 8C590008 */ lw $t9, 8($v0) -/* 00A1A8 800095A8 8C4A000C */ lw $t2, 0xc($v0) -/* 00A1AC 800095AC 24420010 */ addiu $v0, $v0, 0x10 -/* 00A1B0 800095B0 25AEFFFF */ addiu $t6, $t5, -1 -/* 00A1B4 800095B4 25F8FFFF */ addiu $t8, $t7, -1 -/* 00A1B8 800095B8 2729FFFF */ addiu $t1, $t9, -1 -/* 00A1BC 800095BC 254BFFFF */ addiu $t3, $t2, -1 -/* 00A1C0 800095C0 AC4BFFFC */ sw $t3, -4($v0) -/* 00A1C4 800095C4 AC49FFF8 */ sw $t1, -8($v0) -/* 00A1C8 800095C8 AC58FFF4 */ sw $t8, -0xc($v0) -/* 00A1CC 800095CC 1443FFF3 */ bne $v0, $v1, .L8000959C -/* 00A1D0 800095D0 AC4EFFF0 */ sw $t6, -0x10($v0) -.L800095D4: -/* 00A1D4 800095D4 8FAD002C */ lw $t5, 0x2c($sp) -.L800095D8: -/* 00A1D8 800095D8 240C0001 */ li $t4, 1 -/* 00A1DC 800095DC A5AC0000 */ sh $t4, ($t5) -/* 00A1E0 800095E0 A7A80034 */ sh $t0, 0x34($sp) -/* 00A1E4 800095E4 AFA70030 */ sw $a3, 0x30($sp) -/* 00A1E8 800095E8 0C0023CE */ jal func_80008F38 -/* 00A1EC 800095EC AFA40050 */ sw $a0, 0x50($sp) -/* 00A1F0 800095F0 0C0046B9 */ jal reset_kart_ai_behaviour -/* 00A1F4 800095F4 8FA40050 */ lw $a0, 0x50($sp) -/* 00A1F8 800095F8 8FA40050 */ lw $a0, 0x50($sp) -/* 00A1FC 800095FC 3C0F8016 */ lui $t7, %hi(D_8016348C) # $t7, 0x8016 -/* 00A200 80009600 85EF348C */ lh $t7, %lo(D_8016348C)($t7) -/* 00A204 80009604 3C018016 */ lui $at, %hi(D_801642D8 + 0x6) # 0x8016 -/* 00A208 80009608 00047100 */ sll $t6, $a0, 4 -/* 00A20C 8000960C 002E0821 */ addu $at, $at, $t6 -/* 00A210 80009610 8FA70030 */ lw $a3, 0x30($sp) -/* 00A214 80009614 87A80034 */ lh $t0, 0x34($sp) -/* 00A218 80009618 15E00012 */ bnez $t7, .L80009664 -/* 00A21C 8000961C A42042DE */ sh $zero, %lo(D_801642D8 + 0x6)($at) # 0x42de($at) -/* 00A220 80009620 8FB80054 */ lw $t8, 0x54($sp) -/* 00A224 80009624 8FA50038 */ lw $a1, 0x38($sp) -/* 00A228 80009628 8FA60044 */ lw $a2, 0x44($sp) -/* 00A22C 8000962C 97190000 */ lhu $t9, ($t8) -/* 00A230 80009630 33290800 */ andi $t1, $t9, 0x800 -/* 00A234 80009634 1520000B */ bnez $t1, .L80009664 -/* 00A238 80009638 00000000 */ nop -/* 00A23C 8000963C AFA40050 */ sw $a0, 0x50($sp) -/* 00A240 80009640 AFA70030 */ sw $a3, 0x30($sp) -/* 00A244 80009644 0C002496 */ jal func_80009258 -/* 00A248 80009648 A7A80034 */ sh $t0, 0x34($sp) -/* 00A24C 8000964C 8FA70030 */ lw $a3, 0x30($sp) -/* 00A250 80009650 3C018016 */ lui $at, %hi(gTimePlayerLastTouchedFinishLine) -/* 00A254 80009654 8FA40050 */ lw $a0, 0x50($sp) -/* 00A258 80009658 00270821 */ addu $at, $at, $a3 -/* 00A25C 8000965C E420F898 */ swc1 $f0, %lo(gTimePlayerLastTouchedFinishLine)($at) -/* 00A260 80009660 87A80034 */ lh $t0, 0x34($sp) -.L80009664: -/* 00A264 80009664 11000014 */ beqz $t0, .L800096B8 -/* 00A268 80009668 3C018016 */ lui $at, %hi(D_8016344C) # $at, 0x8016 -/* 00A26C 8000966C C420344C */ lwc1 $f0, %lo(D_8016344C)($at) -/* 00A270 80009670 C7A60038 */ lwc1 $f6, 0x38($sp) -/* 00A274 80009674 C7A80044 */ lwc1 $f8, 0x44($sp) -/* 00A278 80009678 4600303E */ c.le.s $f6, $f0 -/* 00A27C 8000967C 00000000 */ nop -/* 00A280 80009680 4502000E */ bc1fl .L800096BC -/* 00A284 80009684 C7AA0044 */ lwc1 $f10, 0x44($sp) -/* 00A288 80009688 4608003C */ c.lt.s $f0, $f8 -/* 00A28C 8000968C 3C0A8016 */ lui $t2, %hi(gLapCountByPlayerId) # $t2, 0x8016 -/* 00A290 80009690 254A4390 */ addiu $t2, %lo(gLapCountByPlayerId) # addiu $t2, $t2, 0x4390 -/* 00A294 80009694 00EA1021 */ addu $v0, $a3, $t2 -/* 00A298 80009698 45020008 */ bc1fl .L800096BC -/* 00A29C 8000969C C7AA0044 */ lwc1 $f10, 0x44($sp) -/* 00A2A0 800096A0 8C4B0000 */ lw $t3, ($v0) -/* 00A2A4 800096A4 AFA40050 */ sw $a0, 0x50($sp) -/* 00A2A8 800096A8 256CFFFF */ addiu $t4, $t3, -1 -/* 00A2AC 800096AC 0C0023CE */ jal func_80008F38 -/* 00A2B0 800096B0 AC4C0000 */ sw $t4, ($v0) -/* 00A2B4 800096B4 8FA40050 */ lw $a0, 0x50($sp) -.L800096B8: -/* 00A2B8 800096B8 C7AA0044 */ lwc1 $f10, 0x44($sp) -.L800096BC: -/* 00A2BC 800096BC 00046880 */ sll $t5, $a0, 2 -/* 00A2C0 800096C0 3C018016 */ lui $at, %hi(D_80163450) -/* 00A2C4 800096C4 3C0E800E */ lui $t6, %hi(gCurrentCourseId) -/* 00A2C8 800096C8 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 00A2CC 800096CC 002D0821 */ addu $at, $at, $t5 -/* 00A2D0 800096D0 E42A3450 */ swc1 $f10, %lo(D_80163450)($at) -/* 00A2D4 800096D4 24010004 */ li $at, 4 -/* 00A2D8 800096D8 15C10013 */ bne $t6, $at, .L80009728 -/* 00A2DC 800096DC 3C0F8016 */ lui $t7, %hi(D_801630E2) # $t7, 0x8016 -/* 00A2E0 800096E0 85EF30E2 */ lh $t7, %lo(D_801630E2)($t7) -/* 00A2E4 800096E4 24010001 */ li $at, 1 -/* 00A2E8 800096E8 55E10010 */ bnel $t7, $at, .L8000972C -/* 00A2EC 800096EC 8FAA0054 */ lw $t2, 0x54($sp) -/* 00A2F0 800096F0 0C002400 */ jal func_80009000 -/* 00A2F4 800096F4 AFA40050 */ sw $a0, 0x50($sp) -/* 00A2F8 800096F8 8FB80054 */ lw $t8, 0x54($sp) -/* 00A2FC 800096FC 8FA40050 */ lw $a0, 0x50($sp) -/* 00A300 80009700 8FA50054 */ lw $a1, 0x54($sp) -/* 00A304 80009704 97020000 */ lhu $v0, ($t8) -/* 00A308 80009708 30594000 */ andi $t9, $v0, 0x4000 -/* 00A30C 8000970C 13200003 */ beqz $t9, .L8000971C -/* 00A310 80009710 30491000 */ andi $t1, $v0, 0x1000 -/* 00A314 80009714 51200005 */ beql $t1, $zero, .L8000972C -/* 00A318 80009718 8FAA0054 */ lw $t2, 0x54($sp) -.L8000971C: -/* 00A31C 8000971C 0C00243C */ jal func_800090F0 -/* 00A320 80009720 AFA40050 */ sw $a0, 0x50($sp) -/* 00A324 80009724 8FA40050 */ lw $a0, 0x50($sp) -.L80009728: -/* 00A328 80009728 8FAA0054 */ lw $t2, 0x54($sp) -.L8000972C: -/* 00A32C 8000972C 3C068016 */ lui $a2, %hi(D_80163448) # 0x8016 -/* 00A330 80009730 3C038016 */ lui $v1, %hi(sSomeNearestWaypoint) # 0x8016 -/* 00A334 80009734 95420000 */ lhu $v0, ($t2) -/* 00A338 80009738 304B4000 */ andi $t3, $v0, 0x4000 -/* 00A33C 8000973C 11600020 */ beqz $t3, .L800097C0 -/* 00A340 80009740 304C1000 */ andi $t4, $v0, 0x1000 -/* 00A344 80009744 1580001E */ bnez $t4, .L800097C0 -/* 00A348 80009748 01402825 */ move $a1, $t2 -/* 00A34C 8000974C 0C001974 */ jal func_800065D0 -/* 00A350 80009750 AFA40050 */ sw $a0, 0x50($sp) -/* 00A354 80009754 3C0D800E */ lui $t5, %hi(gModeSelection) -/* 00A358 80009758 8DADC53C */ lw $t5, %lo(gModeSelection)($t5) -/* 00A35C 8000975C 8FA40050 */ lw $a0, 0x50($sp) -/* 00A360 80009760 3C068016 */ lui $a2, %hi(D_80163448) # $a2, 0x8016 -/* 00A364 80009764 15A00013 */ bnez $t5, .L800097B4 -/* 00A368 80009768 3C038016 */ lui $v1, %hi(sSomeNearestWaypoint) # $v1, 0x8016 -/* 00A36C 8000976C 3C0E8019 */ lui $t6, %hi(gPlayerCount) # $t6, 0x8019 -/* 00A370 80009770 81CEEDF3 */ lb $t6, %lo(gPlayerCount)($t6) -/* 00A374 80009774 24010002 */ li $at, 2 -/* 00A378 80009778 15C1000E */ bne $t6, $at, .L800097B4 -/* 00A37C 8000977C 00000000 */ nop -/* 00A380 80009780 1480000C */ bnez $a0, .L800097B4 -/* 00A384 80009784 3C0F8016 */ lui $t7, %hi(D_80164408) # $t7, 0x8016 -/* 00A388 80009788 3C188016 */ lui $t8, %hi(D_80164408 + 0x4) # $t8, 0x8016 -/* 00A38C 8000978C 8F18440C */ lw $t8, %lo(D_80164408 + 0x4)($t8) -/* 00A390 80009790 8DEF4408 */ lw $t7, %lo(D_80164408)($t7) -/* 00A394 80009794 24190001 */ li $t9, 1 -/* 00A398 80009798 01F8082A */ slt $at, $t7, $t8 -/* 00A39C 8000979C 10200003 */ beqz $at, .L800097AC -/* 00A3A0 800097A0 3C018016 */ lui $at, %hi(D_80163478) # $at, 0x8016 -/* 00A3A4 800097A4 10000003 */ b .L800097B4 -/* 00A3A8 800097A8 A4203478 */ sh $zero, %lo(D_80163478)($at) -.L800097AC: -/* 00A3AC 800097AC 3C018016 */ lui $at, %hi(D_80163478) # $at, 0x8016 -/* 00A3B0 800097B0 A4393478 */ sh $t9, %lo(D_80163478)($at) -.L800097B4: -/* 00A3B4 800097B4 8CC63448 */ lw $a2, %lo(D_80163448)($a2) -/* 00A3B8 800097B8 10000003 */ b .L800097C8 -/* 00A3BC 800097BC 84632FCE */ lh $v1, %lo(sSomeNearestWaypoint)($v1) -.L800097C0: -/* 00A3C0 800097C0 8CC63448 */ lw $a2, %lo(D_80163448)($a2) # 0x3448($a2) -/* 00A3C4 800097C4 84632FCE */ lh $v1, %lo(sSomeNearestWaypoint)($v1) -.L800097C8: -/* 00A3C8 800097C8 0C002E57 */ jal func_8000B95C -/* 00A3CC 800097CC 3065FFFF */ andi $a1, $v1, 0xffff -/* 00A3D0 800097D0 8FBF0024 */ lw $ra, 0x24($sp) -.L800097D4: -/* 00A3D4 800097D4 27BD0050 */ addiu $sp, $sp, 0x50 -/* 00A3D8 800097D8 03E00008 */ jr $ra -/* 00A3DC 800097DC 00000000 */ nop diff --git a/asm/non_matchings/code_80005FD0/func_80009B60.s b/asm/non_matchings/code_80005FD0/func_80009B60.s deleted file mode 100644 index 87bb293601..0000000000 --- a/asm/non_matchings/code_80005FD0/func_80009B60.s +++ /dev/null @@ -1,1535 +0,0 @@ -.section .late_rodata - -glabel D_800ECFB0 -.float 4.3 - -glabel D_800ECFB4 -.float 8.33333333 - -glabel D_800ECFB8 -.float 0.9 - -glabel D_800ECFBC -.float -0.9 - -glabel D_800ECFC0 -.float 0.9 - -glabel D_800ECFC4 -.float -0.9 - -glabel D_800ECFC8 -.float 3.33333333 - -.section .text - -glabel func_80009B60 -/* 00A760 80009B60 3C0E800E */ lui $t6, %hi(gCurrentCourseId) -/* 00A764 80009B64 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 00A768 80009B68 3C01800E */ lui $at, %hi(gKartAICourseMaximumSeparation) -/* 00A76C 80009B6C 3C0A8016 */ lui $t2, %hi(D_80163100) # $t2, 0x8016 -/* 00A770 80009B70 000E7880 */ sll $t7, $t6, 2 -/* 00A774 80009B74 002F0821 */ addu $at, $at, $t7 -/* 00A778 80009B78 C424CA4C */ lwc1 $f4, %lo(gKartAICourseMaximumSeparation)($at) -/* 00A77C 80009B7C 27BDFF30 */ addiu $sp, $sp, -0xd0 -/* 00A780 80009B80 254A3100 */ addiu $t2, %lo(D_80163100) # addiu $t2, $t2, 0x3100 -/* 00A784 80009B84 4600218D */ trunc.w.s $f6, $f4 -/* 00A788 80009B88 00043880 */ sll $a3, $a0, 2 -/* 00A78C 80009B8C AFBF0014 */ sw $ra, 0x14($sp) -/* 00A790 80009B90 00802825 */ move $a1, $a0 -/* 00A794 80009B94 44193000 */ mfc1 $t9, $f6 -/* 00A798 80009B98 00EA1021 */ addu $v0, $a3, $t2 -/* 00A79C 80009B9C 07220565 */ bltzl $t9, .L8000B134 -/* 00A7A0 80009BA0 8FBF0014 */ lw $ra, 0x14($sp) -/* 00A7A4 80009BA4 8C4B0000 */ lw $t3, ($v0) -/* 00A7A8 80009BA8 3C088016 */ lui $t0, %hi(D_80163378) # $t0, 0x8016 -/* 00A7AC 80009BAC 25083378 */ addiu $t0, %lo(D_80163378) # addiu $t0, $t0, 0x3378 -/* 00A7B0 80009BB0 256C0001 */ addiu $t4, $t3, 1 -/* 00A7B4 80009BB4 1480000B */ bnez $a0, .L80009BE4 -/* 00A7B8 80009BB8 AC4C0000 */ sw $t4, ($v0) -/* 00A7BC 80009BBC 8D0D0000 */ lw $t5, ($t0) -/* 00A7C0 80009BC0 3C028016 */ lui $v0, %hi(D_80163488) # $v0, 0x8016 -/* 00A7C4 80009BC4 24423488 */ addiu $v0, %lo(D_80163488) # addiu $v0, $v0, 0x3488 -/* 00A7C8 80009BC8 25AE0001 */ addiu $t6, $t5, 1 -/* 00A7CC 80009BCC 31D80001 */ andi $t8, $t6, 1 -/* 00A7D0 80009BD0 13000004 */ beqz $t8, .L80009BE4 -/* 00A7D4 80009BD4 AD0E0000 */ sw $t6, ($t0) -/* 00A7D8 80009BD8 8C590000 */ lw $t9, ($v0) -/* 00A7DC 80009BDC 272A0001 */ addiu $t2, $t9, 1 -/* 00A7E0 80009BE0 AC4A0000 */ sw $t2, ($v0) -.L80009BE4: -/* 00A7E4 80009BE4 000558C0 */ sll $t3, $a1, 3 -/* 00A7E8 80009BE8 01655823 */ subu $t3, $t3, $a1 -/* 00A7EC 80009BEC 000B5900 */ sll $t3, $t3, 4 -/* 00A7F0 80009BF0 01655823 */ subu $t3, $t3, $a1 -/* 00A7F4 80009BF4 000B5880 */ sll $t3, $t3, 2 -/* 00A7F8 80009BF8 01655823 */ subu $t3, $t3, $a1 -/* 00A7FC 80009BFC 3C0C800F */ lui $t4, %hi(gPlayers) # $t4, 0x800f -/* 00A800 80009C00 258C6990 */ addiu $t4, %lo(gPlayers) # addiu $t4, $t4, 0x6990 -/* 00A804 80009C04 000B58C0 */ sll $t3, $t3, 3 -/* 00A808 80009C08 016C1821 */ addu $v1, $t3, $t4 -/* 00A80C 80009C0C 946D0000 */ lhu $t5, ($v1) -/* 00A810 80009C10 3C188016 */ lui $t8, %hi(D_801633E0) # $t8, 0x8016 -/* 00A814 80009C14 271833E0 */ addiu $t8, %lo(D_801633E0) # addiu $t8, $t8, 0x33e0 -/* 00A818 80009C18 31AE8000 */ andi $t6, $t5, 0x8000 -/* 00A81C 80009C1C 15C0000E */ bnez $t6, .L80009C58 -/* 00A820 80009C20 00053040 */ sll $a2, $a1, 1 -/* 00A824 80009C24 3C01C47A */ li $at, 0xC47A0000 # -1000.000000 -/* 00A828 80009C28 44810000 */ mtc1 $at, $f0 -/* 00A82C 80009C2C 3C018016 */ lui $at, %hi(D_80164450) # 0x8016 -/* 00A830 80009C30 00270821 */ addu $at, $at, $a3 -/* 00A834 80009C34 240FFFEC */ li $t7, -20 -/* 00A838 80009C38 AC2F4450 */ sw $t7, %lo(D_80164450)($at) # 0x4450($at) -/* 00A83C 80009C3C 3C018016 */ lui $at, %hi(gCourseCompletionPercentByPlayerId) -/* 00A840 80009C40 00270821 */ addu $at, $at, $a3 -/* 00A844 80009C44 E42044D0 */ swc1 $f0, %lo(gCourseCompletionPercentByPlayerId)($at) -/* 00A848 80009C48 3C018016 */ lui $at, %hi(gLapCompletionPercentByPlayerId) -/* 00A84C 80009C4C 00270821 */ addu $at, $at, $a3 -/* 00A850 80009C50 10000537 */ b .L8000B130 -/* 00A854 80009C54 E42044A8 */ swc1 $f0, %lo(gLapCompletionPercentByPlayerId)($at) -.L80009C58: -/* 00A858 80009C58 00D81021 */ addu $v0, $a2, $t8 -/* 00A85C 80009C5C A4400000 */ sh $zero, ($v0) -/* 00A860 80009C60 3C198016 */ lui $t9, %hi(gCourseMinX) # $t9, 0x8016 -/* 00A864 80009C64 8739F6EA */ lh $t9, %lo(gCourseMinX)($t9) -/* 00A868 80009C68 C4600014 */ lwc1 $f0, 0x14($v1) -/* 00A86C 80009C6C 240A0001 */ li $t2, 1 -/* 00A870 80009C70 44994000 */ mtc1 $t9, $f8 -/* 00A874 80009C74 3C0B8016 */ lui $t3, %hi(gCourseMaxX) # $t3, 0x8016 -/* 00A878 80009C78 240C0002 */ li $t4, 2 -/* 00A87C 80009C7C 468042A0 */ cvt.s.w $f10, $f8 -/* 00A880 80009C80 3C0D8016 */ lui $t5, %hi(gCourseMinZ) # $t5, 0x8016 -/* 00A884 80009C84 240E0003 */ li $t6, 3 -/* 00A888 80009C88 24180004 */ li $t8, 4 -/* 00A88C 80009C8C 3C0F8016 */ lui $t7, %hi(gCourseMaxZ) # $t7, 0x8016 -/* 00A890 80009C90 460A003C */ c.lt.s $f0, $f10 -/* 00A894 80009C94 00000000 */ nop -/* 00A898 80009C98 45000003 */ bc1f .L80009CA8 -/* 00A89C 80009C9C 00000000 */ nop -/* 00A8A0 80009CA0 A44A0000 */ sh $t2, ($v0) -/* 00A8A4 80009CA4 C4600014 */ lwc1 $f0, 0x14($v1) -.L80009CA8: -/* 00A8A8 80009CA8 856BF6E8 */ lh $t3, %lo(gCourseMaxX)($t3) -/* 00A8AC 80009CAC 448B8000 */ mtc1 $t3, $f16 -/* 00A8B0 80009CB0 00000000 */ nop -/* 00A8B4 80009CB4 468084A0 */ cvt.s.w $f18, $f16 -/* 00A8B8 80009CB8 4600903C */ c.lt.s $f18, $f0 -/* 00A8BC 80009CBC 00000000 */ nop -/* 00A8C0 80009CC0 45000002 */ bc1f .L80009CCC -/* 00A8C4 80009CC4 00000000 */ nop -/* 00A8C8 80009CC8 A44C0000 */ sh $t4, ($v0) -.L80009CCC: -/* 00A8CC 80009CCC 85ADF6F2 */ lh $t5, %lo(gCourseMinZ)($t5) -/* 00A8D0 80009CD0 C460001C */ lwc1 $f0, 0x1c($v1) -/* 00A8D4 80009CD4 448D2000 */ mtc1 $t5, $f4 -/* 00A8D8 80009CD8 00000000 */ nop -/* 00A8DC 80009CDC 468021A0 */ cvt.s.w $f6, $f4 -/* 00A8E0 80009CE0 4606003C */ c.lt.s $f0, $f6 -/* 00A8E4 80009CE4 00000000 */ nop -/* 00A8E8 80009CE8 45000003 */ bc1f .L80009CF8 -/* 00A8EC 80009CEC 00000000 */ nop -/* 00A8F0 80009CF0 A44E0000 */ sh $t6, ($v0) -/* 00A8F4 80009CF4 C460001C */ lwc1 $f0, 0x1c($v1) -.L80009CF8: -/* 00A8F8 80009CF8 85EFF6F0 */ lh $t7, %lo(gCourseMaxZ)($t7) -/* 00A8FC 80009CFC 448F4000 */ mtc1 $t7, $f8 -/* 00A900 80009D00 00000000 */ nop -/* 00A904 80009D04 468042A0 */ cvt.s.w $f10, $f8 -/* 00A908 80009D08 4600503C */ c.lt.s $f10, $f0 -/* 00A90C 80009D0C 00000000 */ nop -/* 00A910 80009D10 45020003 */ bc1fl .L80009D20 -/* 00A914 80009D14 846200CA */ lh $v0, 0xca($v1) -/* 00A918 80009D18 A4580000 */ sh $t8, ($v0) -/* 00A91C 80009D1C 846200CA */ lh $v0, 0xca($v1) -.L80009D20: -/* 00A920 80009D20 30590002 */ andi $t9, $v0, 2 -/* 00A924 80009D24 17200502 */ bnez $t9, .L8000B130 -/* 00A928 80009D28 304A0008 */ andi $t2, $v0, 8 -/* 00A92C 80009D2C 15400500 */ bnez $t2, .L8000B130 -/* 00A930 80009D30 3C028016 */ lui $v0, %hi(D_80163448) # $v0, 0x8016 -/* 00A934 80009D34 3C0B8016 */ lui $t3, %hi(gPathIndexByPlayerId) # 0x8016 -/* 00A938 80009D38 01665821 */ addu $t3, $t3, $a2 -/* 00A93C 80009D3C 956445B0 */ lhu $a0, %lo(gPathIndexByPlayerId)($t3) # 0x45b0($t3) -/* 00A940 80009D40 24423448 */ addiu $v0, %lo(D_80163448) # addiu $v0, $v0, 0x3448 -/* 00A944 80009D44 AFA30040 */ sw $v1, 0x40($sp) -/* 00A948 80009D48 AFA500D0 */ sw $a1, 0xd0($sp) -/* 00A94C 80009D4C AFA60034 */ sw $a2, 0x34($sp) -/* 00A950 80009D50 AFA70038 */ sw $a3, 0x38($sp) -/* 00A954 80009D54 0C002370 */ jal func_80008DC0 -/* 00A958 80009D58 AC440000 */ sw $a0, ($v0) -/* 00A95C 80009D5C 3C02800E */ lui $v0, %hi(gCurrentCourseId) -/* 00A960 80009D60 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0) -/* 00A964 80009D64 2401000A */ li $at, 10 -/* 00A968 80009D68 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00A96C 80009D6C 10410015 */ beq $v0, $at, .L80009DC4 -/* 00A970 80009D70 2401000B */ li $at, 11 -/* 00A974 80009D74 10410006 */ beq $v0, $at, .L80009D90 -/* 00A978 80009D78 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00A97C 80009D7C 24010012 */ li $at, 18 -/* 00A980 80009D80 1041000C */ beq $v0, $at, .L80009DB4 -/* 00A984 80009D84 00000000 */ nop -/* 00A988 80009D88 1000001A */ b .L80009DF4 -/* 00A98C 80009D8C 8FA50040 */ lw $a1, 0x40($sp) -.L80009D90: -/* 00A990 80009D90 0C004B70 */ jal func_80012DC0 -/* 00A994 80009D94 8FA50040 */ lw $a1, 0x40($sp) -/* 00A998 80009D98 8FAC00D0 */ lw $t4, 0xd0($sp) -/* 00A99C 80009D9C 55800015 */ bnel $t4, $zero, .L80009DF4 -/* 00A9A0 80009DA0 8FA50040 */ lw $a1, 0x40($sp) -/* 00A9A4 80009DA4 0C004C15 */ jal func_80013054 -/* 00A9A8 80009DA8 00000000 */ nop -/* 00A9AC 80009DAC 10000011 */ b .L80009DF4 -/* 00A9B0 80009DB0 8FA50040 */ lw $a1, 0x40($sp) -.L80009DB4: -/* 00A9B4 80009DB4 0C004E15 */ jal func_80013854 -/* 00A9B8 80009DB8 8FA40040 */ lw $a0, 0x40($sp) -/* 00A9BC 80009DBC 1000000D */ b .L80009DF4 -/* 00A9C0 80009DC0 8FA50040 */ lw $a1, 0x40($sp) -.L80009DC4: -/* 00A9C4 80009DC4 0C005231 */ jal func_800148C4 -/* 00A9C8 80009DC8 8FA50040 */ lw $a1, 0x40($sp) -/* 00A9CC 80009DCC 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00A9D0 80009DD0 0C005286 */ jal func_80014A18 -/* 00A9D4 80009DD4 8FA50040 */ lw $a1, 0x40($sp) -/* 00A9D8 80009DD8 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00A9DC 80009DDC 0C0052DB */ jal func_80014B6C -/* 00A9E0 80009DE0 8FA50040 */ lw $a1, 0x40($sp) -/* 00A9E4 80009DE4 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00A9E8 80009DE8 0C005330 */ jal func_80014CC0 -/* 00A9EC 80009DEC 8FA50040 */ lw $a1, 0x40($sp) -/* 00A9F0 80009DF0 8FA50040 */ lw $a1, 0x40($sp) -.L80009DF4: -/* 00A9F4 80009DF4 3C01FFBF */ lui $at, (0xFFBFFFFF >> 16) # lui $at, 0xffbf -/* 00A9F8 80009DF8 94AD0000 */ lhu $t5, ($a1) -/* 00A9FC 80009DFC 31AE0800 */ andi $t6, $t5, 0x800 -/* 00AA00 80009E00 11C00008 */ beqz $t6, .L80009E24 -/* 00AA04 80009E04 00000000 */ nop -/* 00AA08 80009E08 8CAF00BC */ lw $t7, 0xbc($a1) -/* 00AA0C 80009E0C 84B90044 */ lh $t9, 0x44($a1) -/* 00AA10 80009E10 3421FFFF */ ori $at, (0xFFBFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 00AA14 80009E14 01E1C024 */ and $t8, $t7, $at -/* 00AA18 80009E18 332AFFFE */ andi $t2, $t9, 0xfffe -/* 00AA1C 80009E1C ACB800BC */ sw $t8, 0xbc($a1) -/* 00AA20 80009E20 A4AA0044 */ sh $t2, 0x44($a1) -.L80009E24: -/* 00AA24 80009E24 0C0024A7 */ jal func_8000929C -/* 00AA28 80009E28 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AA2C 80009E2C 3C0B800E */ lui $t3, %hi(gCurrentCourseId) -/* 00AA30 80009E30 856BC5A0 */ lh $t3, %lo(gCurrentCourseId)($t3) -/* 00AA34 80009E34 24010014 */ li $at, 20 -/* 00AA38 80009E38 8FAC0034 */ lw $t4, 0x34($sp) -/* 00AA3C 80009E3C 1161000B */ beq $t3, $at, .L80009E6C -/* 00AA40 80009E40 3C0D8016 */ lui $t5, %hi(D_80163240) # 0x8016 -/* 00AA44 80009E44 01AC6821 */ addu $t5, $t5, $t4 -/* 00AA48 80009E48 95AD3240 */ lhu $t5, %lo(D_80163240)($t5) # 0x3240($t5) -/* 00AA4C 80009E4C 24010001 */ li $at, 1 -/* 00AA50 80009E50 8FAE00D0 */ lw $t6, 0xd0($sp) -/* 00AA54 80009E54 11A10003 */ beq $t5, $at, .L80009E64 -/* 00AA58 80009E58 00000000 */ nop -/* 00AA5C 80009E5C 55C00004 */ bnel $t6, $zero, .L80009E70 -/* 00AA60 80009E60 8FAF0040 */ lw $t7, 0x40($sp) -.L80009E64: -/* 00AA64 80009E64 0C0019F1 */ jal set_places -/* 00AA68 80009E68 00000000 */ nop -.L80009E6C: -/* 00AA6C 80009E6C 8FAF0040 */ lw $t7, 0x40($sp) -.L80009E70: -/* 00AA70 80009E70 3C0A8016 */ lui $t2, %hi(D_801630E2) # $t2, 0x8016 -/* 00AA74 80009E74 95F80000 */ lhu $t8, ($t7) -/* 00AA78 80009E78 33191000 */ andi $t9, $t8, 0x1000 -/* 00AA7C 80009E7C 532004AD */ beql $t9, $zero, .L8000B134 -/* 00AA80 80009E80 8FBF0014 */ lw $ra, 0x14($sp) -/* 00AA84 80009E84 854A30E2 */ lh $t2, %lo(D_801630E2)($t2) -/* 00AA88 80009E88 24010001 */ li $at, 1 -/* 00AA8C 80009E8C 15410007 */ bne $t2, $at, .L80009EAC -/* 00AA90 80009E90 3C0B800E */ lui $t3, %hi(gCurrentCourseId) -/* 00AA94 80009E94 856BC5A0 */ lh $t3, %lo(gCurrentCourseId)($t3) -/* 00AA98 80009E98 24010014 */ li $at, 20 -/* 00AA9C 80009E9C 11610003 */ beq $t3, $at, .L80009EAC -/* 00AAA0 80009EA0 00000000 */ nop -/* 00AAA4 80009EA4 0C00478E */ jal kart_ai_behaviour -/* 00AAA8 80009EA8 8FA400D0 */ lw $a0, 0xd0($sp) -.L80009EAC: -/* 00AAAC 80009EAC 3C0E8016 */ lui $t6, %hi(D_80163378) # $t6, 0x8016 -/* 00AAB0 80009EB0 8DCE3378 */ lw $t6, %lo(D_80163378)($t6) -/* 00AAB4 80009EB4 8FAC00D0 */ lw $t4, 0xd0($sp) -/* 00AAB8 80009EB8 31CF0001 */ andi $t7, $t6, 1 -/* 00AABC 80009EBC 318D0001 */ andi $t5, $t4, 1 -/* 00AAC0 80009EC0 11ED0003 */ beq $t7, $t5, .L80009ED0 -/* 00AAC4 80009EC4 AFAD0030 */ sw $t5, 0x30($sp) -/* 00AAC8 80009EC8 0C006B04 */ jal kart_ai_use_item_strategy -/* 00AACC 80009ECC 01802025 */ move $a0, $t4 -.L80009ED0: -/* 00AAD0 80009ED0 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AAD4 80009ED4 0C00267B */ jal func_800099EC -/* 00AAD8 80009ED8 8FA50040 */ lw $a1, 0x40($sp) -/* 00AADC 80009EDC 3C02800E */ lui $v0, %hi(gModeSelection) -/* 00AAE0 80009EE0 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 00AAE4 80009EE4 3C018016 */ lui $at, %hi(D_80162FD0) # $at, 0x8016 -/* 00AAE8 80009EE8 A4202FD0 */ sh $zero, %lo(D_80162FD0)($at) -/* 00AAEC 80009EEC 1040000A */ beqz $v0, .L80009F18 -/* 00AAF0 80009EF0 8FA80034 */ lw $t0, 0x34($sp) -/* 00AAF4 80009EF4 24090001 */ li $t1, 1 -/* 00AAF8 80009EF8 10490008 */ beq $v0, $t1, .L80009F1C -/* 00AAFC 80009EFC 24010002 */ li $at, 2 -/* 00AB00 80009F00 10410006 */ beq $v0, $at, .L80009F1C -/* 00AB04 80009F04 24010003 */ li $at, 3 -/* 00AB08 80009F08 10410004 */ beq $v0, $at, .L80009F1C -/* 00AB0C 80009F0C 00000000 */ nop -/* 00AB10 80009F10 10000002 */ b .L80009F1C -/* 00AB14 80009F14 00000000 */ nop -.L80009F18: -/* 00AB18 80009F18 24090001 */ li $t1, 1 -.L80009F1C: -/* 00AB1C 80009F1C 3C188016 */ lui $t8, %hi(D_801631E0) # $t8, 0x8016 -/* 00AB20 80009F20 8FB90040 */ lw $t9, 0x40($sp) -/* 00AB24 80009F24 271831E0 */ addiu $t8, %lo(D_801631E0) # addiu $t8, $t8, 0x31e0 -/* 00AB28 80009F28 01182821 */ addu $a1, $t0, $t8 -/* 00AB2C 80009F2C A4A00000 */ sh $zero, ($a1) -/* 00AB30 80009F30 8F2A00BC */ lw $t2, 0xbc($t9) -/* 00AB34 80009F34 3C0E800E */ lui $t6, %hi(gCurrentCourseId) -/* 00AB38 80009F38 3C0D8016 */ lui $t5, %hi(D_801646CC) # $t5, 0x8016 -/* 00AB3C 80009F3C 314B1000 */ andi $t3, $t2, 0x1000 -/* 00AB40 80009F40 11600007 */ beqz $t3, .L80009F60 -/* 00AB44 80009F44 00000000 */ nop -/* 00AB48 80009F48 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 00AB4C 80009F4C 24010014 */ li $at, 20 -/* 00AB50 80009F50 240F0001 */ li $t7, 1 -/* 00AB54 80009F54 11C10002 */ beq $t6, $at, .L80009F60 -/* 00AB58 80009F58 00000000 */ nop -/* 00AB5C 80009F5C A4AF0000 */ sh $t7, ($a1) -.L80009F60: -/* 00AB60 80009F60 95AD46CC */ lhu $t5, %lo(D_801646CC)($t5) -/* 00AB64 80009F64 3C02800E */ lui $v0, %hi(gCurrentCourseId) -/* 00AB68 80009F68 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0) -/* 00AB6C 80009F6C 112D0007 */ beq $t1, $t5, .L80009F8C -/* 00AB70 80009F70 8FAC0040 */ lw $t4, 0x40($sp) -/* 00AB74 80009F74 95980000 */ lhu $t8, ($t4) -/* 00AB78 80009F78 24010014 */ li $at, 20 -/* 00AB7C 80009F7C 33190800 */ andi $t9, $t8, 0x800 -/* 00AB80 80009F80 57200003 */ bnel $t9, $zero, .L80009F90 -/* 00AB84 80009F84 2401000A */ li $at, 10 -/* 00AB88 80009F88 1441000E */ bne $v0, $at, .L80009FC4 -.L80009F8C: -/* 00AB8C 80009F8C 2401000A */ li $at, 10 -.L80009F90: -/* 00AB90 80009F90 10410006 */ beq $v0, $at, .L80009FAC -/* 00AB94 80009F94 8FAA00D0 */ lw $t2, 0xd0($sp) -/* 00AB98 80009F98 44808000 */ mtc1 $zero, $f16 -/* 00AB9C 80009F9C 000A5900 */ sll $t3, $t2, 4 -/* 00ABA0 80009FA0 3C018016 */ lui $at, %hi(D_801634F8 + 4) -/* 00ABA4 80009FA4 002B0821 */ addu $at, $at, $t3 -/* 00ABA8 80009FA8 E43034FC */ swc1 $f16, %lo(D_801634F8 + 4)($at) -.L80009FAC: -/* 00ABAC 80009FAC 8FAE00D0 */ lw $t6, 0xd0($sp) -/* 00ABB0 80009FB0 44809000 */ mtc1 $zero, $f18 -/* 00ABB4 80009FB4 3C018016 */ lui $at, %hi(D_801634F8 + 12) -/* 00ABB8 80009FB8 000E7900 */ sll $t7, $t6, 4 -/* 00ABBC 80009FBC 002F0821 */ addu $at, $at, $t7 -/* 00ABC0 80009FC0 E4323504 */ swc1 $f18, %lo(D_801634F8 + 12)($at) -.L80009FC4: -/* 00ABC4 80009FC4 3C028016 */ lui $v0, %hi(D_80163448) # $v0, 0x8016 -/* 00ABC8 80009FC8 8C423448 */ lw $v0, %lo(D_80163448)($v0) -/* 00ABCC 80009FCC 3C0A8016 */ lui $t2, %hi(D_80164510) # $t2, 0x8016 -/* 00ABD0 80009FD0 254A4510 */ addiu $t2, %lo(D_80164510) # addiu $t2, $t2, 0x4510 -/* 00ABD4 80009FD4 1840000A */ blez $v0, .L8000A000 -/* 00ABD8 80009FD8 3C0B8016 */ lui $t3, %hi(gNearestWaypointByPlayerId) # $t3, 0x8016 -/* 00ABDC 80009FDC 8FAD00D0 */ lw $t5, 0xd0($sp) -/* 00ABE0 80009FE0 3C188016 */ lui $t8, %hi(D_801634F8) # $t8, 0x8016 -/* 00ABE4 80009FE4 44802000 */ mtc1 $zero, $f4 -/* 00ABE8 80009FE8 44803000 */ mtc1 $zero, $f6 -/* 00ABEC 80009FEC 271834F8 */ addiu $t8, %lo(D_801634F8) # addiu $t8, $t8, 0x34f8 -/* 00ABF0 80009FF0 000D6100 */ sll $t4, $t5, 4 -/* 00ABF4 80009FF4 01981821 */ addu $v1, $t4, $t8 -/* 00ABF8 80009FF8 E4640004 */ swc1 $f4, 4($v1) -/* 00ABFC 80009FFC E466000C */ swc1 $f6, 0xc($v1) -.L8000A000: -/* 00AC00 8000A000 256B4438 */ addiu $t3, %lo(gNearestWaypointByPlayerId) # addiu $t3, $t3, 0x4438 -/* 00AC04 8000A004 010B7021 */ addu $t6, $t0, $t3 -/* 00AC08 8000A008 8FB90038 */ lw $t9, 0x38($sp) -/* 00AC0C 8000A00C AFAE0024 */ sw $t6, 0x24($sp) -/* 00AC10 8000A010 00027880 */ sll $t7, $v0, 2 -/* 00AC14 8000A014 3C0D8016 */ lui $t5, %hi(D_80164550) # 0x8016 -/* 00AC18 8000A018 95D80000 */ lhu $t8, ($t6) -/* 00AC1C 8000A01C 01AF6821 */ addu $t5, $t5, $t7 -/* 00AC20 8000A020 8DAD4550 */ lw $t5, %lo(D_80164550)($t5) # 0x4550($t5) -/* 00AC24 8000A024 032A3021 */ addu $a2, $t9, $t2 -/* 00AC28 8000A028 0018C8C0 */ sll $t9, $t8, 3 -/* 00AC2C 8000A02C 01B95021 */ addu $t2, $t5, $t9 -/* 00AC30 8000A030 854B0002 */ lh $t3, 2($t2) -/* 00AC34 8000A034 3C01800F */ lui $at, %hi(D_800ECFB0) # $at, 0x800f -/* 00AC38 8000A038 C430CFB0 */ lwc1 $f16, %lo(D_800ECFB0)($at) -/* 00AC3C 8000A03C 448B4000 */ mtc1 $t3, $f8 -/* 00AC40 8000A040 3C0E8016 */ lui $t6, %hi(D_801631F8) # $t6, 0x8016 -/* 00AC44 8000A044 25CE31F8 */ addiu $t6, %lo(D_801631F8) # addiu $t6, $t6, 0x31f8 -/* 00AC48 8000A048 468042A0 */ cvt.s.w $f10, $f8 -/* 00AC4C 8000A04C 010E3821 */ addu $a3, $t0, $t6 -/* 00AC50 8000A050 94EF0000 */ lhu $t7, ($a3) -/* 00AC54 8000A054 46105480 */ add.s $f18, $f10, $f16 -/* 00AC58 8000A058 152F000E */ bne $t1, $t7, .L8000A094 -/* 00AC5C 8000A05C E4D20000 */ swc1 $f18, ($a2) -/* 00AC60 8000A060 94AC0000 */ lhu $t4, ($a1) -/* 00AC64 8000A064 8FA40040 */ lw $a0, 0x40($sp) -/* 00AC68 8000A068 5580000B */ bnel $t4, $zero, .L8000A098 -/* 00AC6C 8000A06C 94A30000 */ lhu $v1, ($a1) -/* 00AC70 8000A070 AFA5002C */ sw $a1, 0x2c($sp) -/* 00AC74 8000A074 AFA60028 */ sw $a2, 0x28($sp) -/* 00AC78 8000A078 0C00B931 */ jal func_8002E4C4 -/* 00AC7C 8000A07C AFA70020 */ sw $a3, 0x20($sp) -/* 00AC80 8000A080 8FA5002C */ lw $a1, 0x2c($sp) -/* 00AC84 8000A084 8FA60028 */ lw $a2, 0x28($sp) -/* 00AC88 8000A088 8FA70020 */ lw $a3, 0x20($sp) -/* 00AC8C 8000A08C 24090001 */ li $t1, 1 -/* 00AC90 8000A090 8FA80034 */ lw $t0, 0x34($sp) -.L8000A094: -/* 00AC94 8000A094 94A30000 */ lhu $v1, ($a1) -.L8000A098: -/* 00AC98 8000A098 8FB80040 */ lw $t8, 0x40($sp) -/* 00AC9C 8000A09C 3C02800E */ lui $v0, %hi(gCurrentCourseId) -/* 00ACA0 8000A0A0 55230005 */ bnel $t1, $v1, .L8000A0B8 -/* 00ACA4 8000A0A4 A4E30000 */ sh $v1, ($a3) -/* 00ACA8 8000A0A8 C4C40000 */ lwc1 $f4, ($a2) -/* 00ACAC 8000A0AC E7040018 */ swc1 $f4, 0x18($t8) -/* 00ACB0 8000A0B0 94A30000 */ lhu $v1, ($a1) -/* 00ACB4 8000A0B4 A4E30000 */ sh $v1, ($a3) -.L8000A0B8: -/* 00ACB8 8000A0B8 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0) -/* 00ACBC 8000A0BC 8FAD00D0 */ lw $t5, 0xd0($sp) -/* 00ACC0 8000A0C0 24010004 */ li $at, 4 -/* 00ACC4 8000A0C4 10410009 */ beq $v0, $at, .L8000A0EC -/* 00ACC8 8000A0C8 000DC900 */ sll $t9, $t5, 4 -/* 00ACCC 8000A0CC 2401000A */ li $at, 10 -/* 00ACD0 8000A0D0 1041000C */ beq $v0, $at, .L8000A104 -/* 00ACD4 8000A0D4 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00ACD8 8000A0D8 24010014 */ li $at, 20 -/* 00ACDC 8000A0DC 10410004 */ beq $v0, $at, .L8000A0F0 -/* 00ACE0 8000A0E0 00602025 */ move $a0, $v1 -/* 00ACE4 8000A0E4 10000013 */ b .L8000A134 -/* 00ACE8 8000A0E8 00000000 */ nop -.L8000A0EC: -/* 00ACEC 8000A0EC 00602025 */ move $a0, $v1 -.L8000A0F0: -/* 00ACF0 8000A0F0 44803000 */ mtc1 $zero, $f6 -/* 00ACF4 8000A0F4 3C018016 */ lui $at, %hi(D_801634F8 + 4) -/* 00ACF8 8000A0F8 00390821 */ addu $at, $at, $t9 -/* 00ACFC 8000A0FC 1000000D */ b .L8000A134 -/* 00AD00 8000A100 E42634FC */ swc1 $f6, %lo(D_801634F8 + 4)($at) -.L8000A104: -/* 00AD04 8000A104 0C005243 */ jal func_8001490C -/* 00AD08 8000A108 AFA5002C */ sw $a1, 0x2c($sp) -/* 00AD0C 8000A10C 0C005298 */ jal func_80014A60 -/* 00AD10 8000A110 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AD14 8000A114 0C0052ED */ jal func_80014BB4 -/* 00AD18 8000A118 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AD1C 8000A11C 0C005342 */ jal func_80014D08 -/* 00AD20 8000A120 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AD24 8000A124 8FA5002C */ lw $a1, 0x2c($sp) -/* 00AD28 8000A128 24090001 */ li $t1, 1 -/* 00AD2C 8000A12C 8FA80034 */ lw $t0, 0x34($sp) -/* 00AD30 8000A130 94A40000 */ lhu $a0, ($a1) -.L8000A134: -/* 00AD34 8000A134 152400FE */ bne $t1, $a0, .L8000A530 -/* 00AD38 8000A138 3C0C8016 */ lui $t4, %hi(D_801630E8) # 0x8016 -/* 00AD3C 8000A13C 8FAA0040 */ lw $t2, 0x40($sp) -/* 00AD40 8000A140 3C018016 */ lui $at, %hi(D_801630E8) # 0x8016 -/* 00AD44 8000A144 00280821 */ addu $at, $at, $t0 -/* 00AD48 8000A148 A42030E8 */ sh $zero, %lo(D_801630E8)($at) # 0x30e8($at) -/* 00AD4C 8000A14C 8D4B00BC */ lw $t3, 0xbc($t2) -/* 00AD50 8000A150 2401FFEF */ li $at, -17 -/* 00AD54 8000A154 3C0F8016 */ lui $t7, %hi(D_80163378) # $t7, 0x8016 -/* 00AD58 8000A158 01617024 */ and $t6, $t3, $at -/* 00AD5C 8000A15C AD4E00BC */ sw $t6, 0xbc($t2) -/* 00AD60 8000A160 8DEF3378 */ lw $t7, %lo(D_80163378)($t7) -/* 00AD64 8000A164 8FB80030 */ lw $t8, 0x30($sp) -/* 00AD68 8000A168 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 00AD6C 8000A16C 31EC0001 */ andi $t4, $t7, 1 -/* 00AD70 8000A170 1198000C */ beq $t4, $t8, .L8000A1A4 -/* 00AD74 8000A174 01402025 */ move $a0, $t2 -/* 00AD78 8000A178 0C00DA03 */ jal func_8003680C -/* 00AD7C 8000A17C 00002825 */ move $a1, $zero -/* 00AD80 8000A180 8FAD0038 */ lw $t5, 0x38($sp) -/* 00AD84 8000A184 3C058016 */ lui $a1, %hi(D_80163210) # 0x8016 -/* 00AD88 8000A188 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AD8C 8000A18C 00AD2821 */ addu $a1, $a1, $t5 -/* 00AD90 8000A190 8CA53210 */ lw $a1, %lo(D_80163210)($a1) # 0x3210($a1) -/* 00AD94 8000A194 0C002109 */ jal func_80008424 -/* 00AD98 8000A198 8FA60040 */ lw $a2, 0x40($sp) -/* 00AD9C 8000A19C 100003E5 */ b .L8000B134 -/* 00ADA0 8000A1A0 8FBF0014 */ lw $ra, 0x14($sp) -.L8000A1A4: -/* 00ADA4 8000A1A4 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 00ADA8 8000A1A8 18400016 */ blez $v0, .L8000A204 -/* 00ADAC 8000A1AC 28410003 */ slti $at, $v0, 3 -/* 00ADB0 8000A1B0 10200014 */ beqz $at, .L8000A204 -/* 00ADB4 8000A1B4 3C198016 */ lui $t9, %hi(D_80163330) # 0x8016 -/* 00ADB8 8000A1B8 0328C821 */ addu $t9, $t9, $t0 -/* 00ADBC 8000A1BC 97393330 */ lhu $t9, %lo(D_80163330)($t9) # 0x3330($t9) -/* 00ADC0 8000A1C0 3C0B8016 */ lui $t3, %hi(D_8016334C) # 0x8016 -/* 00ADC4 8000A1C4 01685821 */ addu $t3, $t3, $t0 -/* 00ADC8 8000A1C8 1539000E */ bne $t1, $t9, .L8000A204 -/* 00ADCC 8000A1CC 8FAE0038 */ lw $t6, 0x38($sp) -/* 00ADD0 8000A1D0 3C0F8016 */ lui $t7, %hi(gGPCurrentRaceRankByPlayerId) -/* 00ADD4 8000A1D4 01EE7821 */ addu $t7, $t7, $t6 -/* 00ADD8 8000A1D8 8DEF43B8 */ lw $t7, %lo(gGPCurrentRaceRankByPlayerId)($t7) -/* 00ADDC 8000A1DC 956B334C */ lhu $t3, %lo(D_8016334C)($t3) # 0x334c($t3) -/* 00ADE0 8000A1E0 3C0C8016 */ lui $t4, %hi(D_80163210) # $t4, 0x8016 -/* 00ADE4 8000A1E4 258C3210 */ addiu $t4, %lo(D_80163210) # addiu $t4, $t4, 0x3210 -/* 00ADE8 8000A1E8 016F082A */ slt $at, $t3, $t7 -/* 00ADEC 8000A1EC 10200005 */ beqz $at, .L8000A204 -/* 00ADF0 8000A1F0 3C01800F */ lui $at, %hi(D_800ECFB4) # $at, 0x800f -/* 00ADF4 8000A1F4 C428CFB4 */ lwc1 $f8, %lo(D_800ECFB4)($at) -/* 00ADF8 8000A1F8 01CC4021 */ addu $t0, $t6, $t4 -/* 00ADFC 8000A1FC 1000004B */ b .L8000A32C -/* 00AE00 8000A200 E5080000 */ swc1 $f8, ($t0) -.L8000A204: -/* 00AE04 8000A204 3C188016 */ lui $t8, %hi(D_80162FD0) # $t8, 0x8016 -/* 00AE08 8000A208 87182FD0 */ lh $t8, %lo(D_80162FD0)($t8) -/* 00AE0C 8000A20C 1538001C */ bne $t1, $t8, .L8000A280 -/* 00AE10 8000A210 3C0A800E */ lui $t2, %hi(gCurrentCourseId) -/* 00AE14 8000A214 854AC5A0 */ lh $t2, %lo(gCurrentCourseId)($t2) -/* 00AE18 8000A218 3C19800E */ lui $t9, %hi(gCCSelection) -/* 00AE1C 8000A21C 8F39C548 */ lw $t9, %lo(gCCSelection)($t9) -/* 00AE20 8000A220 8FAC00D0 */ lw $t4, 0xd0($sp) -/* 00AE24 8000A224 000A6900 */ sll $t5, $t2, 4 -/* 00AE28 8000A228 3C0A8016 */ lui $t2, %hi(D_801634F8) # $t2, 0x8016 -/* 00AE2C 8000A22C 254A34F8 */ addiu $t2, %lo(D_801634F8) # addiu $t2, $t2, 0x34f8 -/* 00AE30 8000A230 3C0E0D01 */ lui $t6, %hi(D_0D0096B8) # $t6, 0xd01 -/* 00AE34 8000A234 00195880 */ sll $t3, $t9, 2 -/* 00AE38 8000A238 000CC100 */ sll $t8, $t4, 4 -/* 00AE3C 8000A23C 030A1821 */ addu $v1, $t8, $t2 -/* 00AE40 8000A240 01AB7821 */ addu $t7, $t5, $t3 -/* 00AE44 8000A244 25CE96B8 */ addiu $t6, %lo(D_0D0096B8) # addiu $t6, $t6, -0x6948 -/* 00AE48 8000A248 01EE2021 */ addu $a0, $t7, $t6 -/* 00AE4C 8000A24C 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00AE50 8000A250 AFA30030 */ sw $v1, 0x30($sp) -/* 00AE54 8000A254 8FB90038 */ lw $t9, 0x38($sp) -/* 00AE58 8000A258 3C0D8016 */ lui $t5, %hi(D_80163210) # $t5, 0x8016 -/* 00AE5C 8000A25C 3C01BF00 */ li $at, 0xBF000000 # -0.500000 -/* 00AE60 8000A260 8FA30030 */ lw $v1, 0x30($sp) -/* 00AE64 8000A264 C44A0000 */ lwc1 $f10, ($v0) -/* 00AE68 8000A268 44818000 */ mtc1 $at, $f16 -/* 00AE6C 8000A26C 25AD3210 */ addiu $t5, %lo(D_80163210) # addiu $t5, $t5, 0x3210 -/* 00AE70 8000A270 032D4021 */ addu $t0, $t9, $t5 -/* 00AE74 8000A274 E50A0000 */ swc1 $f10, ($t0) -/* 00AE78 8000A278 1000002C */ b .L8000A32C -/* 00AE7C 8000A27C E4700004 */ swc1 $f16, 4($v1) -.L8000A280: -/* 00AE80 8000A280 3C0F8016 */ lui $t7, %hi(sSomeNearestWaypoint) # $t7, 0x8016 -/* 00AE84 8000A284 85EF2FCE */ lh $t7, %lo(sSomeNearestWaypoint)($t7) -/* 00AE88 8000A288 3C0B8016 */ lui $t3, %hi(D_801645E0) # $t3, 0x8016 -/* 00AE8C 8000A28C 8D6B45E0 */ lw $t3, %lo(D_801645E0)($t3) -/* 00AE90 8000A290 000F7040 */ sll $t6, $t7, 1 -/* 00AE94 8000A294 016E6021 */ addu $t4, $t3, $t6 -/* 00AE98 8000A298 85980000 */ lh $t8, ($t4) -/* 00AE9C 8000A29C 1B000012 */ blez $t8, .L8000A2E8 -/* 00AEA0 8000A2A0 3C0A800E */ lui $t2, %hi(gCurrentCourseId) -/* 00AEA4 8000A2A4 3C0D800E */ lui $t5, %hi(gCCSelection) -/* 00AEA8 8000A2A8 8DADC548 */ lw $t5, %lo(gCCSelection)($t5) -/* 00AEAC 8000A2AC 854AC5A0 */ lh $t2, %lo(gCurrentCourseId)($t2) -/* 00AEB0 8000A2B0 3C0E0D01 */ lui $t6, %hi(D_0D009418) # $t6, 0xd01 -/* 00AEB4 8000A2B4 000D7880 */ sll $t7, $t5, 2 -/* 00AEB8 8000A2B8 000AC900 */ sll $t9, $t2, 4 -/* 00AEBC 8000A2BC 032F5821 */ addu $t3, $t9, $t7 -/* 00AEC0 8000A2C0 25CE9418 */ addiu $t6, %lo(D_0D009418) # addiu $t6, $t6, -0x6be8 -/* 00AEC4 8000A2C4 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00AEC8 8000A2C8 016E2021 */ addu $a0, $t3, $t6 -/* 00AECC 8000A2CC 8FAC0038 */ lw $t4, 0x38($sp) -/* 00AED0 8000A2D0 3C188016 */ lui $t8, %hi(D_80163210) # $t8, 0x8016 -/* 00AED4 8000A2D4 C4520000 */ lwc1 $f18, ($v0) -/* 00AED8 8000A2D8 27183210 */ addiu $t8, %lo(D_80163210) # addiu $t8, $t8, 0x3210 -/* 00AEDC 8000A2DC 01984021 */ addu $t0, $t4, $t8 -/* 00AEE0 8000A2E0 10000012 */ b .L8000A32C -/* 00AEE4 8000A2E4 E5120000 */ swc1 $f18, ($t0) -.L8000A2E8: -/* 00AEE8 8000A2E8 3C0A800E */ lui $t2, %hi(gCurrentCourseId) -/* 00AEEC 8000A2EC 3C19800E */ lui $t9, %hi(gCCSelection) -/* 00AEF0 8000A2F0 8F39C548 */ lw $t9, %lo(gCCSelection)($t9) -/* 00AEF4 8000A2F4 854AC5A0 */ lh $t2, %lo(gCurrentCourseId)($t2) -/* 00AEF8 8000A2F8 3C0E0D01 */ lui $t6, %hi(D_0D009568) # $t6, 0xd01 -/* 00AEFC 8000A2FC 00197880 */ sll $t7, $t9, 2 -/* 00AF00 8000A300 000A6900 */ sll $t5, $t2, 4 -/* 00AF04 8000A304 01AF5821 */ addu $t3, $t5, $t7 -/* 00AF08 8000A308 25CE9568 */ addiu $t6, %lo(D_0D009568) # addiu $t6, $t6, -0x6a98 -/* 00AF0C 8000A30C 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00AF10 8000A310 016E2021 */ addu $a0, $t3, $t6 -/* 00AF14 8000A314 8FAC0038 */ lw $t4, 0x38($sp) -/* 00AF18 8000A318 C4440000 */ lwc1 $f4, ($v0) -/* 00AF1C 8000A31C 3C188016 */ lui $t8, %hi(D_80163210) # $t8, 0x8016 -/* 00AF20 8000A320 27183210 */ addiu $t8, %lo(D_80163210) # addiu $t8, $t8, 0x3210 -/* 00AF24 8000A324 01984021 */ addu $t0, $t4, $t8 -/* 00AF28 8000A328 E5040000 */ swc1 $f4, ($t0) -.L8000A32C: -/* 00AF2C 8000A32C 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AF30 8000A330 0C004C77 */ jal check_ai_crossing_distance -/* 00AF34 8000A334 AFA8003C */ sw $t0, 0x3c($sp) -/* 00AF38 8000A338 0C0034EE */ jal func_8000D3B8 -/* 00AF3C 8000A33C 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AF40 8000A340 3C058016 */ lui $a1, %hi(D_801630E0) # $a1, 0x8016 -/* 00AF44 8000A344 94A530E0 */ lhu $a1, %lo(D_801630E0)($a1) -/* 00AF48 8000A348 0C00350E */ jal func_8000D438 -/* 00AF4C 8000A34C 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AF50 8000A350 8FA60040 */ lw $a2, 0x40($sp) -/* 00AF54 8000A354 3C078016 */ lui $a3, %hi(D_80162FA0) # $a3, 0x8016 -/* 00AF58 8000A358 24E72FA0 */ addiu $a3, %lo(D_80162FA0) # addiu $a3, $a3, 0x2fa0 -/* 00AF5C 8000A35C 8CC200BC */ lw $v0, 0xbc($a2) -/* 00AF60 8000A360 C4E80000 */ lwc1 $f8, ($a3) -/* 00AF64 8000A364 C4EA0008 */ lwc1 $f10, 8($a3) -/* 00AF68 8000A368 C4C60014 */ lwc1 $f6, 0x14($a2) -/* 00AF6C 8000A36C C4D0001C */ lwc1 $f16, 0x1c($a2) -/* 00AF70 8000A370 304A0080 */ andi $t2, $v0, 0x80 -/* 00AF74 8000A374 46064001 */ sub.s $f0, $f8, $f6 -/* 00AF78 8000A378 8FA8003C */ lw $t0, 0x3c($sp) -/* 00AF7C 8000A37C 15400061 */ bnez $t2, .L8000A504 -/* 00AF80 8000A380 46105081 */ sub.s $f2, $f10, $f16 -/* 00AF84 8000A384 30590040 */ andi $t9, $v0, 0x40 -/* 00AF88 8000A388 1720005E */ bnez $t9, .L8000A504 -/* 00AF8C 8000A38C 304D0800 */ andi $t5, $v0, 0x800 -/* 00AF90 8000A390 55A0005D */ bnel $t5, $zero, .L8000A508 -/* 00AF94 8000A394 00C02025 */ move $a0, $a2 -/* 00AF98 8000A398 46000102 */ mul.s $f4, $f0, $f0 -/* 00AF9C 8000A39C 3C0145C8 */ li $at, 0x45C80000 # 6400.000000 -/* 00AFA0 8000A3A0 44819000 */ mtc1 $at, $f18 -/* 00AFA4 8000A3A4 46021182 */ mul.s $f6, $f2, $f2 -/* 00AFA8 8000A3A8 3C0B8016 */ lui $t3, %hi(D_801630E0) # 0x8016 -/* 00AFAC 8000A3AC 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016 -/* 00AFB0 8000A3B0 3C198016 */ lui $t9, %hi(D_80163448) # 0x8016 -/* 00AFB4 8000A3B4 3C0F8016 */ lui $t7, %hi(D_80164590) # 0x8016 -/* 00AFB8 8000A3B8 46062200 */ add.s $f8, $f4, $f6 -/* 00AFBC 8000A3BC 4608903C */ c.lt.s $f18, $f8 -/* 00AFC0 8000A3C0 00000000 */ nop -/* 00AFC4 8000A3C4 45000039 */ bc1f .L8000A4AC -/* 00AFC8 8000A3C8 00000000 */ nop -/* 00AFCC 8000A3CC 3C0F8016 */ lui $t7, %hi(D_80163448) # $t7, 0x8016 -/* 00AFD0 8000A3D0 8DEF3448 */ lw $t7, %lo(D_80163448)($t7) -/* 00AFD4 8000A3D4 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00AFD8 8000A3D8 55E0002B */ bnel $t7, $zero, .L8000A488 -/* 00AFDC 8000A3DC 8FA60040 */ lw $a2, 0x40($sp) -/* 00AFE0 8000A3E0 0C002C50 */ jal func_8000B140 -/* 00AFE4 8000A3E4 AFA8003C */ sw $t0, 0x3c($sp) -/* 00AFE8 8000A3E8 8FAB0034 */ lw $t3, 0x34($sp) -/* 00AFEC 8000A3EC 3C0E8016 */ lui $t6, %hi(D_80162FF8) # 0x8016 -/* 00AFF0 8000A3F0 3C078016 */ lui $a3, %hi(D_80162FA0) # $a3, 0x8016 -/* 00AFF4 8000A3F4 01CB7021 */ addu $t6, $t6, $t3 -/* 00AFF8 8000A3F8 85CE2FF8 */ lh $t6, %lo(D_80162FF8)($t6) # 0x2ff8($t6) -/* 00AFFC 8000A3FC 24E72FA0 */ addiu $a3, %lo(D_80162FA0) # addiu $a3, $a3, 0x2fa0 -/* 00B000 8000A400 8FA8003C */ lw $t0, 0x3c($sp) -/* 00B004 8000A404 19C0001F */ blez $t6, .L8000A484 -/* 00B008 8000A408 3C048016 */ lui $a0, %hi(D_801630E0) # $a0, 0x8016 -/* 00B00C 8000A40C 948430E0 */ lhu $a0, %lo(D_801630E0)($a0) -/* 00B010 8000A410 3C188016 */ lui $t8, %hi(D_80164430) # $t8, 0x8016 -/* 00B014 8000A414 97184430 */ lhu $t8, %lo(D_80164430)($t8) -/* 00B018 8000A418 24840005 */ addiu $a0, $a0, 5 -/* 00B01C 8000A41C 308CFFFF */ andi $t4, $a0, 0xffff -/* 00B020 8000A420 0198001A */ div $zero, $t4, $t8 -/* 00B024 8000A424 01802025 */ move $a0, $t4 -/* 00B028 8000A428 8FB90038 */ lw $t9, 0x38($sp) -/* 00B02C 8000A42C 17000002 */ bnez $t8, .L8000A438 -/* 00B030 8000A430 00000000 */ nop -/* 00B034 8000A434 0007000D */ break 7 -.L8000A438: -/* 00B038 8000A438 2401FFFF */ li $at, -1 -/* 00B03C 8000A43C 17010004 */ bne $t8, $at, .L8000A450 -/* 00B040 8000A440 3C018000 */ lui $at, 0x8000 -/* 00B044 8000A444 14810002 */ bne $a0, $at, .L8000A450 -/* 00B048 8000A448 00000000 */ nop -/* 00B04C 8000A44C 0006000D */ break 6 -.L8000A450: -/* 00B050 8000A450 00002010 */ mfhi $a0 -/* 00B054 8000A454 3C058016 */ lui $a1, %hi(D_80163090) # 0x8016 -/* 00B058 8000A458 308AFFFF */ andi $t2, $a0, 0xffff -/* 00B05C 8000A45C 3C068016 */ lui $a2, %hi(D_80163448 + 2) # $a2, 0x8016 -/* 00B060 8000A460 00B92821 */ addu $a1, $a1, $t9 -/* 00B064 8000A464 01402025 */ move $a0, $t2 -/* 00B068 8000A468 8CA53090 */ lw $a1, %lo(D_80163090)($a1) # 0x3090($a1) -/* 00B06C 8000A46C 84C6344A */ lh $a2, %lo(D_80163448 + 2)($a2) -/* 00B070 8000A470 0C002EF6 */ jal func_8000BBD8 -/* 00B074 8000A474 AFA8003C */ sw $t0, 0x3c($sp) -/* 00B078 8000A478 3C078016 */ lui $a3, %hi(D_80162FA0) # $a3, 0x8016 -/* 00B07C 8000A47C 24E72FA0 */ addiu $a3, %lo(D_80162FA0) # addiu $a3, $a3, 0x2fa0 -/* 00B080 8000A480 8FA8003C */ lw $t0, 0x3c($sp) -.L8000A484: -/* 00B084 8000A484 8FA60040 */ lw $a2, 0x40($sp) -.L8000A488: -/* 00B088 8000A488 00E02825 */ move $a1, $a3 -/* 00B08C 8000A48C AFA8003C */ sw $t0, 0x3c($sp) -/* 00B090 8000A490 0C0AD489 */ jal get_angle_between_two_vectors -/* 00B094 8000A494 24C40014 */ addiu $a0, $a2, 0x14 -/* 00B098 8000A498 8FA60040 */ lw $a2, 0x40($sp) -/* 00B09C 8000A49C 8FA8003C */ lw $t0, 0x3c($sp) -/* 00B0A0 8000A4A0 00026823 */ negu $t5, $v0 -/* 00B0A4 8000A4A4 10000017 */ b .L8000A504 -/* 00B0A8 8000A4A8 A4CD002E */ sh $t5, 0x2e($a2) -.L8000A4AC: -/* 00B0AC 8000A4AC 956B30E0 */ lhu $t3, %lo(D_801630E0)($t3) # 0x30e0($t3) -/* 00B0B0 8000A4B0 958C4430 */ lhu $t4, %lo(D_80164430)($t4) -/* 00B0B4 8000A4B4 8F393448 */ lw $t9, %lo(D_80163448)($t9) # 0x3448($t9) -/* 00B0B8 8000A4B8 256E0004 */ addiu $t6, $t3, 4 -/* 00B0BC 8000A4BC 01CC001A */ div $zero, $t6, $t4 -/* 00B0C0 8000A4C0 00196880 */ sll $t5, $t9, 2 -/* 00B0C4 8000A4C4 01ED7821 */ addu $t7, $t7, $t5 -/* 00B0C8 8000A4C8 8DEF4590 */ lw $t7, %lo(D_80164590)($t7) # 0x4590($t7) -/* 00B0CC 8000A4CC 0000C010 */ mfhi $t8 -/* 00B0D0 8000A4D0 00185040 */ sll $t2, $t8, 1 -/* 00B0D4 8000A4D4 15800002 */ bnez $t4, .L8000A4E0 -/* 00B0D8 8000A4D8 00000000 */ nop -/* 00B0DC 8000A4DC 0007000D */ break 7 -.L8000A4E0: -/* 00B0E0 8000A4E0 2401FFFF */ li $at, -1 -/* 00B0E4 8000A4E4 15810004 */ bne $t4, $at, .L8000A4F8 -/* 00B0E8 8000A4E8 3C018000 */ lui $at, 0x8000 -/* 00B0EC 8000A4EC 15C10002 */ bne $t6, $at, .L8000A4F8 -/* 00B0F0 8000A4F0 00000000 */ nop -/* 00B0F4 8000A4F4 0006000D */ break 6 -.L8000A4F8: -/* 00B0F8 8000A4F8 01EA5821 */ addu $t3, $t7, $t2 -/* 00B0FC 8000A4FC 856E0000 */ lh $t6, ($t3) -/* 00B100 8000A500 A4CE002E */ sh $t6, 0x2e($a2) -.L8000A504: -/* 00B104 8000A504 00C02025 */ move $a0, $a2 -.L8000A508: -/* 00B108 8000A508 00002825 */ move $a1, $zero -/* 00B10C 8000A50C 0C00DA03 */ jal func_8003680C -/* 00B110 8000A510 AFA8003C */ sw $t0, 0x3c($sp) -/* 00B114 8000A514 8FA8003C */ lw $t0, 0x3c($sp) -/* 00B118 8000A518 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00B11C 8000A51C 8FA60040 */ lw $a2, 0x40($sp) -/* 00B120 8000A520 0C002109 */ jal func_80008424 -/* 00B124 8000A524 8D050000 */ lw $a1, ($t0) -/* 00B128 8000A528 10000302 */ b .L8000B134 -/* 00B12C 8000A52C 8FBF0014 */ lw $ra, 0x14($sp) -.L8000A530: -/* 00B130 8000A530 258C30E8 */ addiu $t4, %lo(D_801630E8) # addiu $t4, $t4, 0x30e8 -/* 00B134 8000A534 010CC021 */ addu $t8, $t0, $t4 -/* 00B138 8000A538 AFB8002C */ sw $t8, 0x2c($sp) -/* 00B13C 8000A53C 87020000 */ lh $v0, ($t8) -/* 00B140 8000A540 2401FFFF */ li $at, -1 -/* 00B144 8000A544 8FAD0040 */ lw $t5, 0x40($sp) -/* 00B148 8000A548 51220004 */ beql $t1, $v0, .L8000A55C -/* 00B14C 8000A54C 8DAF00BC */ lw $t7, 0xbc($t5) -/* 00B150 8000A550 14410006 */ bne $v0, $at, .L8000A56C -/* 00B154 8000A554 00000000 */ nop -/* 00B158 8000A558 8DAF00BC */ lw $t7, 0xbc($t5) -.L8000A55C: -/* 00B15C 8000A55C 35EA0010 */ ori $t2, $t7, 0x10 -/* 00B160 8000A560 ADAA00BC */ sw $t2, 0xbc($t5) -/* 00B164 8000A564 8FAB002C */ lw $t3, 0x2c($sp) -/* 00B168 8000A568 85620000 */ lh $v0, ($t3) -.L8000A56C: -/* 00B16C 8000A56C 1040008A */ beqz $v0, .L8000A798 -/* 00B170 8000A570 8FAE0040 */ lw $t6, 0x40($sp) -/* 00B174 8000A574 25C40020 */ addiu $a0, $t6, 0x20 -/* 00B178 8000A578 0C0AD489 */ jal get_angle_between_two_vectors -/* 00B17C 8000A57C 25C50014 */ addiu $a1, $t6, 0x14 -/* 00B180 8000A580 8FAC0034 */ lw $t4, 0x34($sp) -/* 00B184 8000A584 3C188016 */ lui $t8, %hi(D_80163300) # $t8, 0x8016 -/* 00B188 8000A588 27183300 */ addiu $t8, %lo(D_80163300) # addiu $t8, $t8, 0x3300 -/* 00B18C 8000A58C 0002C823 */ negu $t9, $v0 -/* 00B190 8000A590 01981821 */ addu $v1, $t4, $t8 -/* 00B194 8000A594 A4790000 */ sh $t9, ($v1) -/* 00B198 8000A598 3C0F8016 */ lui $t7, %hi(sSomeNearestWaypoint) # $t7, 0x8016 -/* 00B19C 8000A59C 85EF2FCE */ lh $t7, %lo(sSomeNearestWaypoint)($t7) -/* 00B1A0 8000A5A0 3C0D8016 */ lui $t5, %hi(D_80164430) # $t5, 0x8016 -/* 00B1A4 8000A5A4 95AD4430 */ lhu $t5, %lo(D_80164430)($t5) -/* 00B1A8 8000A5A8 25EA0002 */ addiu $t2, $t7, 2 -/* 00B1AC 8000A5AC 3C0C8016 */ lui $t4, %hi(D_801631DC) # $t4, 0x8016 -/* 00B1B0 8000A5B0 014D001A */ div $zero, $t2, $t5 -/* 00B1B4 8000A5B4 8D8C31DC */ lw $t4, %lo(D_801631DC)($t4) -/* 00B1B8 8000A5B8 00005810 */ mfhi $t3 -/* 00B1BC 8000A5BC 000B7040 */ sll $t6, $t3, 1 -/* 00B1C0 8000A5C0 018EC021 */ addu $t8, $t4, $t6 -/* 00B1C4 8000A5C4 87190000 */ lh $t9, ($t8) -/* 00B1C8 8000A5C8 24060168 */ li $a2, 360 -/* 00B1CC 8000A5CC 3407FFFF */ li $a3, 65535 -/* 00B1D0 8000A5D0 03260019 */ multu $t9, $a2 -/* 00B1D4 8000A5D4 846B0000 */ lh $t3, ($v1) -/* 00B1D8 8000A5D8 15A00002 */ bnez $t5, .L8000A5E4 -/* 00B1DC 8000A5DC 00000000 */ nop -/* 00B1E0 8000A5E0 0007000D */ break 7 -.L8000A5E4: -/* 00B1E4 8000A5E4 2401FFFF */ li $at, -1 -/* 00B1E8 8000A5E8 15A10004 */ bne $t5, $at, .L8000A5FC -/* 00B1EC 8000A5EC 3C018000 */ lui $at, 0x8000 -/* 00B1F0 8000A5F0 15410002 */ bne $t2, $at, .L8000A5FC -/* 00B1F4 8000A5F4 00000000 */ nop -/* 00B1F8 8000A5F8 0006000D */ break 6 -.L8000A5FC: -/* 00B1FC 8000A5FC 00007812 */ mflo $t7 -/* 00B200 8000A600 00000000 */ nop -/* 00B204 8000A604 00000000 */ nop -/* 00B208 8000A608 01E7001A */ div $zero, $t7, $a3 -/* 00B20C 8000A60C 00002012 */ mflo $a0 -/* 00B210 8000A610 00045400 */ sll $t2, $a0, 0x10 -/* 00B214 8000A614 14E00002 */ bnez $a3, .L8000A620 -/* 00B218 8000A618 00000000 */ nop -/* 00B21C 8000A61C 0007000D */ break 7 -.L8000A620: -/* 00B220 8000A620 2401FFFF */ li $at, -1 -/* 00B224 8000A624 14E10004 */ bne $a3, $at, .L8000A638 -/* 00B228 8000A628 3C018000 */ lui $at, 0x8000 -/* 00B22C 8000A62C 15E10002 */ bne $t7, $at, .L8000A638 -/* 00B230 8000A630 00000000 */ nop -/* 00B234 8000A634 0006000D */ break 6 -.L8000A638: -/* 00B238 8000A638 01660019 */ multu $t3, $a2 -/* 00B23C 8000A63C 000A6C03 */ sra $t5, $t2, 0x10 -/* 00B240 8000A640 01A02025 */ move $a0, $t5 -/* 00B244 8000A644 00006012 */ mflo $t4 -/* 00B248 8000A648 00000000 */ nop -/* 00B24C 8000A64C 00000000 */ nop -/* 00B250 8000A650 0187001A */ div $zero, $t4, $a3 -/* 00B254 8000A654 14E00002 */ bnez $a3, .L8000A660 -/* 00B258 8000A658 00000000 */ nop -/* 00B25C 8000A65C 0007000D */ break 7 -.L8000A660: -/* 00B260 8000A660 2401FFFF */ li $at, -1 -/* 00B264 8000A664 14E10004 */ bne $a3, $at, .L8000A678 -/* 00B268 8000A668 3C018000 */ lui $at, 0x8000 -/* 00B26C 8000A66C 15810002 */ bne $t4, $at, .L8000A678 -/* 00B270 8000A670 00000000 */ nop -/* 00B274 8000A674 0006000D */ break 6 -.L8000A678: -/* 00B278 8000A678 00002812 */ mflo $a1 -/* 00B27C 8000A67C 00057400 */ sll $t6, $a1, 0x10 -/* 00B280 8000A680 000EC403 */ sra $t8, $t6, 0x10 -/* 00B284 8000A684 2881FF4C */ slti $at, $a0, -0xb4 -/* 00B288 8000A688 10200004 */ beqz $at, .L8000A69C -/* 00B28C 8000A68C 03002825 */ move $a1, $t8 -/* 00B290 8000A690 24840168 */ addiu $a0, $a0, 0x168 -/* 00B294 8000A694 0004CC00 */ sll $t9, $a0, 0x10 -/* 00B298 8000A698 00192403 */ sra $a0, $t9, 0x10 -.L8000A69C: -/* 00B29C 8000A69C 288100B5 */ slti $at, $a0, 0xb5 -/* 00B2A0 8000A6A0 54200005 */ bnel $at, $zero, .L8000A6B8 -/* 00B2A4 8000A6A4 28A1FF4C */ slti $at, $a1, -0xb4 -/* 00B2A8 8000A6A8 2484FE98 */ addiu $a0, $a0, -0x168 -/* 00B2AC 8000A6AC 00045400 */ sll $t2, $a0, 0x10 -/* 00B2B0 8000A6B0 000A2403 */ sra $a0, $t2, 0x10 -/* 00B2B4 8000A6B4 28A1FF4C */ slti $at, $a1, -0xb4 -.L8000A6B8: -/* 00B2B8 8000A6B8 50200005 */ beql $at, $zero, .L8000A6D0 -/* 00B2BC 8000A6BC 28A100B5 */ slti $at, $a1, 0xb5 -/* 00B2C0 8000A6C0 24A50168 */ addiu $a1, $a1, 0x168 -/* 00B2C4 8000A6C4 00055C00 */ sll $t3, $a1, 0x10 -/* 00B2C8 8000A6C8 000B2C03 */ sra $a1, $t3, 0x10 -/* 00B2CC 8000A6CC 28A100B5 */ slti $at, $a1, 0xb5 -.L8000A6D0: -/* 00B2D0 8000A6D0 54200005 */ bnel $at, $zero, .L8000A6E8 -/* 00B2D4 8000A6D4 00851023 */ subu $v0, $a0, $a1 -/* 00B2D8 8000A6D8 24A5FE98 */ addiu $a1, $a1, -0x168 -/* 00B2DC 8000A6DC 00057400 */ sll $t6, $a1, 0x10 -/* 00B2E0 8000A6E0 000E2C03 */ sra $a1, $t6, 0x10 -/* 00B2E4 8000A6E4 00851023 */ subu $v0, $a0, $a1 -.L8000A6E8: -/* 00B2E8 8000A6E8 00023400 */ sll $a2, $v0, 0x10 -/* 00B2EC 8000A6EC 00021C00 */ sll $v1, $v0, 0x10 -/* 00B2F0 8000A6F0 00067C03 */ sra $t7, $a2, 0x10 -/* 00B2F4 8000A6F4 0003CC03 */ sra $t9, $v1, 0x10 -/* 00B2F8 8000A6F8 29E1FF4C */ slti $at, $t7, -0xb4 -/* 00B2FC 8000A6FC 10200004 */ beqz $at, .L8000A710 -/* 00B300 8000A700 03201825 */ move $v1, $t9 -/* 00B304 8000A704 25E30168 */ addiu $v1, $t7, 0x168 -/* 00B308 8000A708 00035400 */ sll $t2, $v1, 0x10 -/* 00B30C 8000A70C 000A1C03 */ sra $v1, $t2, 0x10 -.L8000A710: -/* 00B310 8000A710 286100B5 */ slti $at, $v1, 0xb5 -/* 00B314 8000A714 14200004 */ bnez $at, .L8000A728 -/* 00B318 8000A718 8FA4002C */ lw $a0, 0x2c($sp) -/* 00B31C 8000A71C 2463FE98 */ addiu $v1, $v1, -0x168 -/* 00B320 8000A720 00035C00 */ sll $t3, $v1, 0x10 -/* 00B324 8000A724 000B1C03 */ sra $v1, $t3, 0x10 -.L8000A728: -/* 00B328 8000A728 84820000 */ lh $v0, ($a0) -/* 00B32C 8000A72C 2401FFFF */ li $at, -1 -/* 00B330 8000A730 10410005 */ beq $v0, $at, .L8000A748 -/* 00B334 8000A734 24010001 */ li $at, 1 -/* 00B338 8000A738 5041000F */ beql $v0, $at, .L8000A778 -/* 00B33C 8000A73C 2861FFFB */ slti $at, $v1, -5 -/* 00B340 8000A740 10000015 */ b .L8000A798 -/* 00B344 8000A744 00000000 */ nop -.L8000A748: -/* 00B348 8000A748 28610006 */ slti $at, $v1, 6 -/* 00B34C 8000A74C 14200007 */ bnez $at, .L8000A76C -/* 00B350 8000A750 00000000 */ nop -/* 00B354 8000A754 8FAE0040 */ lw $t6, 0x40($sp) -/* 00B358 8000A758 A4800000 */ sh $zero, ($a0) -/* 00B35C 8000A75C 2401FFEF */ li $at, -17 -/* 00B360 8000A760 8DD800BC */ lw $t8, 0xbc($t6) -/* 00B364 8000A764 0301C824 */ and $t9, $t8, $at -/* 00B368 8000A768 ADD900BC */ sw $t9, 0xbc($t6) -.L8000A76C: -/* 00B36C 8000A76C 1000000A */ b .L8000A798 -/* 00B370 8000A770 00000000 */ nop -/* 00B374 8000A774 2861FFFB */ slti $at, $v1, -5 -.L8000A778: -/* 00B378 8000A778 10200007 */ beqz $at, .L8000A798 -/* 00B37C 8000A77C 00000000 */ nop -/* 00B380 8000A780 8FAF0040 */ lw $t7, 0x40($sp) -/* 00B384 8000A784 A4800000 */ sh $zero, ($a0) -/* 00B388 8000A788 2401FFEF */ li $at, -17 -/* 00B38C 8000A78C 8DEA00BC */ lw $t2, 0xbc($t7) -/* 00B390 8000A790 01416824 */ and $t5, $t2, $at -/* 00B394 8000A794 ADED00BC */ sw $t5, 0xbc($t7) -.L8000A798: -/* 00B398 8000A798 3C0B8016 */ lui $t3, %hi(D_80163378) # $t3, 0x8016 -/* 00B39C 8000A79C 8D6B3378 */ lw $t3, %lo(D_80163378)($t3) -/* 00B3A0 8000A7A0 8FB80030 */ lw $t8, 0x30($sp) -/* 00B3A4 8000A7A4 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00B3A8 8000A7A8 316C0001 */ andi $t4, $t3, 1 -/* 00B3AC 8000A7AC 11980010 */ beq $t4, $t8, .L8000A7F0 -/* 00B3B0 8000A7B0 8FAA0040 */ lw $t2, 0x40($sp) -/* 00B3B4 8000A7B4 8FB90034 */ lw $t9, 0x34($sp) -/* 00B3B8 8000A7B8 3C058016 */ lui $a1, %hi(D_80163050) # 0x8016 -/* 00B3BC 8000A7BC 8FA40040 */ lw $a0, 0x40($sp) -/* 00B3C0 8000A7C0 00B92821 */ addu $a1, $a1, $t9 -/* 00B3C4 8000A7C4 0C00DA03 */ jal func_8003680C -/* 00B3C8 8000A7C8 84A53050 */ lh $a1, %lo(D_80163050)($a1) # 0x3050($a1) -/* 00B3CC 8000A7CC 8FAE0038 */ lw $t6, 0x38($sp) -/* 00B3D0 8000A7D0 3C058016 */ lui $a1, %hi(D_80163210) # 0x8016 -/* 00B3D4 8000A7D4 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00B3D8 8000A7D8 00AE2821 */ addu $a1, $a1, $t6 -/* 00B3DC 8000A7DC 8CA53210 */ lw $a1, %lo(D_80163210)($a1) # 0x3210($a1) -/* 00B3E0 8000A7E0 0C002109 */ jal func_80008424 -/* 00B3E4 8000A7E4 8FA60040 */ lw $a2, 0x40($sp) -/* 00B3E8 8000A7E8 10000252 */ b .L8000B134 -/* 00B3EC 8000A7EC 8FBF0014 */ lw $ra, 0x14($sp) -.L8000A7F0: -/* 00B3F0 8000A7F0 3C058016 */ lui $a1, %hi(sSomeNearestWaypoint) # $a1, 0x8016 -/* 00B3F4 8000A7F4 254D0014 */ addiu $t5, $t2, 0x14 -/* 00B3F8 8000A7F8 AFAD001C */ sw $t5, 0x1c($sp) -/* 00B3FC 8000A7FC 0C002DF9 */ jal func_8000B7E4 -/* 00B400 8000A800 94A52FCE */ lhu $a1, %lo(sSomeNearestWaypoint)($a1) -/* 00B404 8000A804 8FAF0038 */ lw $t7, 0x38($sp) -/* 00B408 8000A808 3C0B8016 */ lui $t3, %hi(D_801630B8) # $t3, 0x8016 -/* 00B40C 8000A80C 256B30B8 */ addiu $t3, %lo(D_801630B8) # addiu $t3, $t3, 0x30b8 -/* 00B410 8000A810 01EB1821 */ addu $v1, $t7, $t3 -/* 00B414 8000A814 AC620000 */ sw $v0, ($v1) -/* 00B418 8000A818 3C058016 */ lui $a1, %hi(sSomeNearestWaypoint) # $a1, 0x8016 -/* 00B41C 8000A81C 94A52FCE */ lhu $a1, %lo(sSomeNearestWaypoint)($a1) -/* 00B420 8000A820 AFA30028 */ sw $v1, 0x28($sp) -/* 00B424 8000A824 0C00350E */ jal func_8000D438 -/* 00B428 8000A828 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00B42C 8000A82C 3C02800E */ lui $v0, %hi(gCurrentCourseId) -/* 00B430 8000A830 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0) -/* 00B434 8000A834 24010014 */ li $at, 20 -/* 00B438 8000A838 8FA90038 */ lw $t1, 0x38($sp) -/* 00B43C 8000A83C 10410099 */ beq $v0, $at, .L8000AAA4 -/* 00B440 8000A840 00000000 */ nop -/* 00B444 8000A844 3C058016 */ lui $a1, %hi(D_80164450) # 0x8016 -/* 00B448 8000A848 00A92821 */ addu $a1, $a1, $t1 -/* 00B44C 8000A84C 8CA54450 */ lw $a1, %lo(D_80164450)($a1) # 0x4450($a1) -/* 00B450 8000A850 3C198016 */ lui $t9, %hi(D_801634F8) # $t9, 0x8016 -/* 00B454 8000A854 273934F8 */ addiu $t9, %lo(D_801634F8) # addiu $t9, $t9, 0x34f8 -/* 00B458 8000A858 28A1000B */ slti $at, $a1, 0xb -/* 00B45C 8000A85C 10200045 */ beqz $at, .L8000A974 -/* 00B460 8000A860 00000000 */ nop -/* 00B464 8000A864 8FAC00D0 */ lw $t4, 0xd0($sp) -/* 00B468 8000A868 3C048016 */ lui $a0, %hi(D_801630E0) # $a0, 0x8016 -/* 00B46C 8000A86C 948430E0 */ lhu $a0, %lo(D_801630E0)($a0) -/* 00B470 8000A870 000CC100 */ sll $t8, $t4, 4 -/* 00B474 8000A874 18A0001F */ blez $a1, .L8000A8F4 -/* 00B478 8000A878 03191821 */ addu $v1, $t8, $t9 -/* 00B47C 8000A87C 2401000A */ li $at, 10 -/* 00B480 8000A880 5441001D */ bnel $v0, $at, .L8000A8F8 -/* 00B484 8000A884 24840008 */ addiu $a0, $a0, 8 -/* 00B488 8000A888 24840014 */ addiu $a0, $a0, 0x14 -/* 00B48C 8000A88C 308EFFFF */ andi $t6, $a0, 0xffff -/* 00B490 8000A890 3C0A8016 */ lui $t2, %hi(D_80164430) # $t2, 0x8016 -/* 00B494 8000A894 954A4430 */ lhu $t2, %lo(D_80164430)($t2) -/* 00B498 8000A898 01C02025 */ move $a0, $t6 -/* 00B49C 8000A89C 24050000 */ li $a1, 0 -/* 00B4A0 8000A8A0 01CA001A */ div $zero, $t6, $t2 -/* 00B4A4 8000A8A4 15400002 */ bnez $t2, .L8000A8B0 -/* 00B4A8 8000A8A8 00000000 */ nop -/* 00B4AC 8000A8AC 0007000D */ break 7 -.L8000A8B0: -/* 00B4B0 8000A8B0 2401FFFF */ li $at, -1 -/* 00B4B4 8000A8B4 15410004 */ bne $t2, $at, .L8000A8C8 -/* 00B4B8 8000A8B8 3C018000 */ lui $at, 0x8000 -/* 00B4BC 8000A8BC 14810002 */ bne $a0, $at, .L8000A8C8 -/* 00B4C0 8000A8C0 00000000 */ nop -/* 00B4C4 8000A8C4 0006000D */ break 6 -.L8000A8C8: -/* 00B4C8 8000A8C8 00002010 */ mfhi $a0 -/* 00B4CC 8000A8CC 308DFFFF */ andi $t5, $a0, 0xffff -/* 00B4D0 8000A8D0 01A02025 */ move $a0, $t5 -/* 00B4D4 8000A8D4 00003025 */ move $a2, $zero -/* 00B4D8 8000A8D8 0C002EF6 */ jal func_8000BBD8 -/* 00B4DC 8000A8DC AFA30030 */ sw $v1, 0x30($sp) -/* 00B4E0 8000A8E0 8FA30030 */ lw $v1, 0x30($sp) -/* 00B4E4 8000A8E4 44805000 */ mtc1 $zero, $f10 -/* 00B4E8 8000A8E8 8FA90038 */ lw $t1, 0x38($sp) -/* 00B4EC 8000A8EC 10000021 */ b .L8000A974 -/* 00B4F0 8000A8F0 E46A0004 */ swc1 $f10, 4($v1) -.L8000A8F4: -/* 00B4F4 8000A8F4 24840008 */ addiu $a0, $a0, 8 -.L8000A8F8: -/* 00B4F8 8000A8F8 308FFFFF */ andi $t7, $a0, 0xffff -/* 00B4FC 8000A8FC 3C0B8016 */ lui $t3, %hi(D_80164430) # $t3, 0x8016 -/* 00B500 8000A900 956B4430 */ lhu $t3, %lo(D_80164430)($t3) -/* 00B504 8000A904 01E02025 */ move $a0, $t7 -/* 00B508 8000A908 3C188016 */ lui $t8, %hi(D_80163068) # $t8, 0x8016 -/* 00B50C 8000A90C 01EB001A */ div $zero, $t7, $t3 -/* 00B510 8000A910 15600002 */ bnez $t3, .L8000A91C -/* 00B514 8000A914 00000000 */ nop -/* 00B518 8000A918 0007000D */ break 7 -.L8000A91C: -/* 00B51C 8000A91C 2401FFFF */ li $at, -1 -/* 00B520 8000A920 15610004 */ bne $t3, $at, .L8000A934 -/* 00B524 8000A924 3C018000 */ lui $at, 0x8000 -/* 00B528 8000A928 14810002 */ bne $a0, $at, .L8000A934 -/* 00B52C 8000A92C 00000000 */ nop -/* 00B530 8000A930 0006000D */ break 6 -.L8000A934: -/* 00B534 8000A934 00002010 */ mfhi $a0 -/* 00B538 8000A938 27183068 */ addiu $t8, %lo(D_80163068) # addiu $t8, $t8, 0x3068 -/* 00B53C 8000A93C 308CFFFF */ andi $t4, $a0, 0xffff -/* 00B540 8000A940 01384021 */ addu $t0, $t1, $t8 -/* 00B544 8000A944 3C068016 */ lui $a2, %hi(D_80163448 + 2) # $a2, 0x8016 -/* 00B548 8000A948 01802025 */ move $a0, $t4 -/* 00B54C 8000A94C 84C6344A */ lh $a2, %lo(D_80163448 + 2)($a2) -/* 00B550 8000A950 8D050000 */ lw $a1, ($t0) -/* 00B554 8000A954 AFA80020 */ sw $t0, 0x20($sp) -/* 00B558 8000A958 0C002EF6 */ jal func_8000BBD8 -/* 00B55C 8000A95C AFA30030 */ sw $v1, 0x30($sp) -/* 00B560 8000A960 8FA80020 */ lw $t0, 0x20($sp) -/* 00B564 8000A964 8FA30030 */ lw $v1, 0x30($sp) -/* 00B568 8000A968 8FA90038 */ lw $t1, 0x38($sp) -/* 00B56C 8000A96C C5100000 */ lwc1 $f16, ($t0) -/* 00B570 8000A970 E4700000 */ swc1 $f16, ($v1) -.L8000A974: -/* 00B574 8000A974 3C198016 */ lui $t9, %hi(D_80162FD0) # $t9, 0x8016 -/* 00B578 8000A978 87392FD0 */ lh $t9, %lo(D_80162FD0)($t9) -/* 00B57C 8000A97C 24010001 */ li $at, 1 -/* 00B580 8000A980 8FAE0034 */ lw $t6, 0x34($sp) -/* 00B584 8000A984 1721001E */ bne $t9, $at, .L8000AA00 -/* 00B588 8000A988 3C0A8016 */ lui $t2, %hi(D_80162FF8) # 0x8016 -/* 00B58C 8000A98C 014E5021 */ addu $t2, $t2, $t6 -/* 00B590 8000A990 854A2FF8 */ lh $t2, %lo(D_80162FF8)($t2) # 0x2ff8($t2) -/* 00B594 8000A994 3C0F8016 */ lui $t7, %hi(D_80164430) # $t7, 0x8016 -/* 00B598 8000A998 15400019 */ bnez $t2, .L8000AA00 -/* 00B59C 8000A99C 00000000 */ nop -/* 00B5A0 8000A9A0 3C048016 */ lui $a0, %hi(D_801630E0) # $a0, 0x8016 -/* 00B5A4 8000A9A4 948430E0 */ lhu $a0, %lo(D_801630E0)($a0) -/* 00B5A8 8000A9A8 95EF4430 */ lhu $t7, %lo(D_80164430)($t7) -/* 00B5AC 8000A9AC 3C05BF33 */ lui $a1, (0xBF333333 >> 16) # lui $a1, 0xbf33 -/* 00B5B0 8000A9B0 24840007 */ addiu $a0, $a0, 7 -/* 00B5B4 8000A9B4 308DFFFF */ andi $t5, $a0, 0xffff -/* 00B5B8 8000A9B8 01AF001A */ div $zero, $t5, $t7 -/* 00B5BC 8000A9BC 01A02025 */ move $a0, $t5 -/* 00B5C0 8000A9C0 15E00002 */ bnez $t7, .L8000A9CC -/* 00B5C4 8000A9C4 00000000 */ nop -/* 00B5C8 8000A9C8 0007000D */ break 7 -.L8000A9CC: -/* 00B5CC 8000A9CC 2401FFFF */ li $at, -1 -/* 00B5D0 8000A9D0 15E10004 */ bne $t7, $at, .L8000A9E4 -/* 00B5D4 8000A9D4 3C018000 */ lui $at, 0x8000 -/* 00B5D8 8000A9D8 14810002 */ bne $a0, $at, .L8000A9E4 -/* 00B5DC 8000A9DC 00000000 */ nop -/* 00B5E0 8000A9E0 0006000D */ break 6 -.L8000A9E4: -/* 00B5E4 8000A9E4 00002010 */ mfhi $a0 -/* 00B5E8 8000A9E8 308BFFFF */ andi $t3, $a0, 0xffff -/* 00B5EC 8000A9EC 3C068016 */ lui $a2, %hi(D_80163448 + 2) # $a2, 0x8016 -/* 00B5F0 8000A9F0 01602025 */ move $a0, $t3 -/* 00B5F4 8000A9F4 84C6344A */ lh $a2, %lo(D_80163448 + 2)($a2) -/* 00B5F8 8000A9F8 0C002EF6 */ jal func_8000BBD8 -/* 00B5FC 8000A9FC 34A53333 */ ori $a1, (0xBF333333 & 0xFFFF) # ori $a1, $a1, 0x3333 -.L8000AA00: -/* 00B600 8000AA00 3C0C8016 */ lui $t4, %hi(D_80163448) # $t4, 0x8016 -/* 00B604 8000AA04 8D8C3448 */ lw $t4, %lo(D_80163448)($t4) -/* 00B608 8000AA08 3C198016 */ lui $t9, %hi(D_80162FF8) # $t9, 0x8016 -/* 00B60C 8000AA0C 27392FF8 */ addiu $t9, %lo(D_80162FF8) # addiu $t9, $t9, 0x2ff8 -/* 00B610 8000AA10 15800024 */ bnez $t4, .L8000AAA4 -/* 00B614 8000AA14 8FB80034 */ lw $t8, 0x34($sp) -/* 00B618 8000AA18 03197021 */ addu $t6, $t8, $t9 -/* 00B61C 8000AA1C AFAE003C */ sw $t6, 0x3c($sp) -/* 00B620 8000AA20 0C002C50 */ jal func_8000B140 -/* 00B624 8000AA24 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00B628 8000AA28 8FAA003C */ lw $t2, 0x3c($sp) -/* 00B62C 8000AA2C 3C0B8016 */ lui $t3, %hi(D_80164430) # $t3, 0x8016 -/* 00B630 8000AA30 8FB80038 */ lw $t8, 0x38($sp) -/* 00B634 8000AA34 854D0000 */ lh $t5, ($t2) -/* 00B638 8000AA38 19A0001A */ blez $t5, .L8000AAA4 -/* 00B63C 8000AA3C 00000000 */ nop -/* 00B640 8000AA40 3C048016 */ lui $a0, %hi(D_801630E0) # $a0, 0x8016 -/* 00B644 8000AA44 948430E0 */ lhu $a0, %lo(D_801630E0)($a0) -/* 00B648 8000AA48 956B4430 */ lhu $t3, %lo(D_80164430)($t3) -/* 00B64C 8000AA4C 3C058016 */ lui $a1, %hi(D_80163090) # 0x8016 -/* 00B650 8000AA50 24840005 */ addiu $a0, $a0, 5 -/* 00B654 8000AA54 308FFFFF */ andi $t7, $a0, 0xffff -/* 00B658 8000AA58 01EB001A */ div $zero, $t7, $t3 -/* 00B65C 8000AA5C 01E02025 */ move $a0, $t7 -/* 00B660 8000AA60 15600002 */ bnez $t3, .L8000AA6C -/* 00B664 8000AA64 00000000 */ nop -/* 00B668 8000AA68 0007000D */ break 7 -.L8000AA6C: -/* 00B66C 8000AA6C 2401FFFF */ li $at, -1 -/* 00B670 8000AA70 15610004 */ bne $t3, $at, .L8000AA84 -/* 00B674 8000AA74 3C018000 */ lui $at, 0x8000 -/* 00B678 8000AA78 14810002 */ bne $a0, $at, .L8000AA84 -/* 00B67C 8000AA7C 00000000 */ nop -/* 00B680 8000AA80 0006000D */ break 6 -.L8000AA84: -/* 00B684 8000AA84 00002010 */ mfhi $a0 -/* 00B688 8000AA88 308CFFFF */ andi $t4, $a0, 0xffff -/* 00B68C 8000AA8C 00B82821 */ addu $a1, $a1, $t8 -/* 00B690 8000AA90 3C068016 */ lui $a2, %hi(D_80163448 + 2) # $a2, 0x8016 -/* 00B694 8000AA94 01802025 */ move $a0, $t4 -/* 00B698 8000AA98 84C6344A */ lh $a2, %lo(D_80163448 + 2)($a2) -/* 00B69C 8000AA9C 0C002EF6 */ jal func_8000BBD8 -/* 00B6A0 8000AAA0 8CA53090 */ lw $a1, %lo(D_80163090)($a1) # 0x3090($a1) -.L8000AAA4: -/* 00B6A4 8000AAA4 3C0E800E */ lui $t6, %hi(gCurrentCourseId) -/* 00B6A8 8000AAA8 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 00B6AC 8000AAAC 8FA90038 */ lw $t1, 0x38($sp) -/* 00B6B0 8000AAB0 3C198016 */ lui $t9, %hi(D_80163068) # $t9, 0x8016 -/* 00B6B4 8000AAB4 27393068 */ addiu $t9, %lo(D_80163068) # addiu $t9, $t9, 0x3068 -/* 00B6B8 8000AAB8 24010014 */ li $at, 20 -/* 00B6BC 8000AABC 15C10038 */ bne $t6, $at, .L8000ABA0 -/* 00B6C0 8000AAC0 01394021 */ addu $t0, $t1, $t9 -/* 00B6C4 8000AAC4 8FAA0034 */ lw $t2, 0x34($sp) -/* 00B6C8 8000AAC8 3C028016 */ lui $v0, %hi(D_80163410) # 0x8016 -/* 00B6CC 8000AACC 24010003 */ li $at, 3 -/* 00B6D0 8000AAD0 004A1021 */ addu $v0, $v0, $t2 -/* 00B6D4 8000AAD4 84423410 */ lh $v0, %lo(D_80163410)($v0) # 0x3410($v0) -/* 00B6D8 8000AAD8 3C078016 */ lui $a3, %hi(D_80162FA0) # $a3, 0x8016 -/* 00B6DC 8000AADC 24E72FA0 */ addiu $a3, %lo(D_80162FA0) # addiu $a3, $a3, 0x2fa0 -/* 00B6E0 8000AAE0 10410005 */ beq $v0, $at, .L8000AAF8 -/* 00B6E4 8000AAE4 24010004 */ li $at, 4 -/* 00B6E8 8000AAE8 1041000C */ beq $v0, $at, .L8000AB1C -/* 00B6EC 8000AAEC 8FAD0024 */ lw $t5, 0x24($sp) -/* 00B6F0 8000AAF0 1000002B */ b .L8000ABA0 -/* 00B6F4 8000AAF4 00000000 */ nop -.L8000AAF8: -/* 00B6F8 8000AAF8 3C018016 */ lui $at, %hi(D_80163418) -/* 00B6FC 8000AAFC 00290821 */ addu $at, $at, $t1 -/* 00B700 8000AB00 C4243418 */ lwc1 $f4, %lo(D_80163418)($at) -/* 00B704 8000AB04 3C018016 */ lui $at, %hi(D_80163438) -/* 00B708 8000AB08 00290821 */ addu $at, $at, $t1 -/* 00B70C 8000AB0C E4E40000 */ swc1 $f4, ($a3) -/* 00B710 8000AB10 C4263438 */ lwc1 $f6, %lo(D_80163438)($at) -/* 00B714 8000AB14 10000022 */ b .L8000ABA0 -/* 00B718 8000AB18 E4E60008 */ swc1 $f6, 8($a3) -.L8000AB1C: -/* 00B71C 8000AB1C 8FAC0034 */ lw $t4, 0x34($sp) -/* 00B720 8000AB20 3C188016 */ lui $t8, %hi(gWaypointCountByPathIndex) # 0x8016 -/* 00B724 8000AB24 95AF0000 */ lhu $t7, ($t5) -/* 00B728 8000AB28 030CC021 */ addu $t8, $t8, $t4 -/* 00B72C 8000AB2C 971845C8 */ lhu $t8, %lo(gWaypointCountByPathIndex)($t8) # 0x45c8($t8) -/* 00B730 8000AB30 25EB000A */ addiu $t3, $t7, 0xa -/* 00B734 8000AB34 3C0A8016 */ lui $t2, %hi(D_80164550) # 0x8016 -/* 00B738 8000AB38 0178001A */ div $zero, $t3, $t8 -/* 00B73C 8000AB3C 01495021 */ addu $t2, $t2, $t1 -/* 00B740 8000AB40 8D4A4550 */ lw $t2, %lo(D_80164550)($t2) # 0x4550($t2) -/* 00B744 8000AB44 0000C810 */ mfhi $t9 -/* 00B748 8000AB48 001970C0 */ sll $t6, $t9, 3 -/* 00B74C 8000AB4C 01CA1021 */ addu $v0, $t6, $t2 -/* 00B750 8000AB50 844D0000 */ lh $t5, ($v0) -/* 00B754 8000AB54 3C078016 */ lui $a3, %hi(D_80162FA0) # $a3, 0x8016 -/* 00B758 8000AB58 24E72FA0 */ addiu $a3, %lo(D_80162FA0) # addiu $a3, $a3, 0x2fa0 -/* 00B75C 8000AB5C 448D9000 */ mtc1 $t5, $f18 -/* 00B760 8000AB60 17000002 */ bnez $t8, .L8000AB6C -/* 00B764 8000AB64 00000000 */ nop -/* 00B768 8000AB68 0007000D */ break 7 -.L8000AB6C: -/* 00B76C 8000AB6C 2401FFFF */ li $at, -1 -/* 00B770 8000AB70 17010004 */ bne $t8, $at, .L8000AB84 -/* 00B774 8000AB74 3C018000 */ lui $at, 0x8000 -/* 00B778 8000AB78 15610002 */ bne $t3, $at, .L8000AB84 -/* 00B77C 8000AB7C 00000000 */ nop -/* 00B780 8000AB80 0006000D */ break 6 -.L8000AB84: -/* 00B784 8000AB84 46809220 */ cvt.s.w $f8, $f18 -/* 00B788 8000AB88 E4E80000 */ swc1 $f8, ($a3) -/* 00B78C 8000AB8C 844F0004 */ lh $t7, 4($v0) -/* 00B790 8000AB90 448F5000 */ mtc1 $t7, $f10 -/* 00B794 8000AB94 00000000 */ nop -/* 00B798 8000AB98 46805420 */ cvt.s.w $f16, $f10 -/* 00B79C 8000AB9C E4F00008 */ swc1 $f16, 8($a3) -.L8000ABA0: -/* 00B7A0 8000ABA0 3C0C8016 */ lui $t4, %hi(D_80163178) # $t4, 0x8016 -/* 00B7A4 8000ABA4 3C078016 */ lui $a3, %hi(D_80162FA0) # 0x8016 -/* 00B7A8 8000ABA8 258C3178 */ addiu $t4, %lo(D_80163178) # addiu $t4, $t4, 0x3178 -/* 00B7AC 8000ABAC 24E52FA0 */ addiu $a1, $a3, %lo(D_80162FA0) # 0x2fa0 -/* 00B7B0 8000ABB0 012C1021 */ addu $v0, $t1, $t4 -/* 00B7B4 8000ABB4 C4460000 */ lwc1 $f6, ($v0) -/* 00B7B8 8000ABB8 C4A40000 */ lwc1 $f4, ($a1) -/* 00B7BC 8000ABBC 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 00B7C0 8000ABC0 44810000 */ mtc1 $at, $f0 -/* 00B7C4 8000ABC4 46062480 */ add.s $f18, $f4, $f6 -/* 00B7C8 8000ABC8 3C0B8016 */ lui $t3, %hi(D_801631A0) # $t3, 0x8016 -/* 00B7CC 8000ABCC 256B31A0 */ addiu $t3, %lo(D_801631A0) # addiu $t3, $t3, 0x31a0 -/* 00B7D0 8000ABD0 012B1821 */ addu $v1, $t1, $t3 -/* 00B7D4 8000ABD4 46009202 */ mul.s $f8, $f18, $f0 -/* 00B7D8 8000ABD8 C4AA0008 */ lwc1 $f10, 8($a1) -/* 00B7DC 8000ABDC E4A80000 */ swc1 $f8, ($a1) -/* 00B7E0 8000ABE0 C4700000 */ lwc1 $f16, ($v1) -/* 00B7E4 8000ABE4 C4B20000 */ lwc1 $f18, ($a1) -/* 00B7E8 8000ABE8 46105100 */ add.s $f4, $f10, $f16 -/* 00B7EC 8000ABEC 46002182 */ mul.s $f6, $f4, $f0 -/* 00B7F0 8000ABF0 E4A60008 */ swc1 $f6, 8($a1) -/* 00B7F4 8000ABF4 E4520000 */ swc1 $f18, ($v0) -/* 00B7F8 8000ABF8 C4A80008 */ lwc1 $f8, 8($a1) -/* 00B7FC 8000ABFC AFA80020 */ sw $t0, 0x20($sp) -/* 00B800 8000AC00 8FA4001C */ lw $a0, 0x1c($sp) -/* 00B804 8000AC04 0C0AD489 */ jal get_angle_between_two_vectors -/* 00B808 8000AC08 E4680000 */ swc1 $f8, ($v1) -/* 00B80C 8000AC0C 3C013FC0 */ li $at, 0x3FC00000 # 1.500000 -/* 00B810 8000AC10 44810000 */ mtc1 $at, $f0 -/* 00B814 8000AC14 3C014336 */ li $at, 0x43360000 # 182.000000 -/* 00B818 8000AC18 44816000 */ mtc1 $at, $f12 -/* 00B81C 8000AC1C 46000407 */ neg.s $f16, $f0 -/* 00B820 8000AC20 8FA70040 */ lw $a3, 0x40($sp) -/* 00B824 8000AC24 460C0082 */ mul.s $f2, $f0, $f12 -/* 00B828 8000AC28 00027023 */ negu $t6, $v0 -/* 00B82C 8000AC2C 84E4002E */ lh $a0, 0x2e($a3) -/* 00B830 8000AC30 460C8102 */ mul.s $f4, $f16, $f12 -/* 00B834 8000AC34 8FA80020 */ lw $t0, 0x20($sp) -/* 00B838 8000AC38 01C41823 */ subu $v1, $t6, $a0 -/* 00B83C 8000AC3C 00033400 */ sll $a2, $v1, 0x10 -/* 00B840 8000AC40 00035C00 */ sll $t3, $v1, 0x10 -/* 00B844 8000AC44 00065403 */ sra $t2, $a2, 0x10 -/* 00B848 8000AC48 4600128D */ trunc.w.s $f10, $f2 -/* 00B84C 8000AC4C 000BC403 */ sra $t8, $t3, 0x10 -/* 00B850 8000AC50 01403025 */ move $a2, $t2 -/* 00B854 8000AC54 4600218D */ trunc.w.s $f6, $f4 -/* 00B858 8000AC58 44055000 */ mfc1 $a1, $f10 -/* 00B85C 8000AC5C 3C0B800E */ lui $t3, %hi(gCurrentCourseId) -/* 00B860 8000AC60 3C03800E */ lui $v1, %hi(gKartAISteeringSensitivity) -/* 00B864 8000AC64 00057C00 */ sll $t7, $a1, 0x10 -/* 00B868 8000AC68 44023000 */ mfc1 $v0, $f6 -/* 00B86C 8000AC6C 000F6403 */ sra $t4, $t7, 0x10 -/* 00B870 8000AC70 0198082A */ slt $at, $t4, $t8 -/* 00B874 8000AC74 10200004 */ beqz $at, .L8000AC88 -/* 00B878 8000AC78 00025400 */ sll $t2, $v0, 0x10 -/* 00B87C 8000AC7C 00053400 */ sll $a2, $a1, 0x10 -/* 00B880 8000AC80 0006CC03 */ sra $t9, $a2, 0x10 -/* 00B884 8000AC84 03203025 */ move $a2, $t9 -.L8000AC88: -/* 00B888 8000AC88 000A6C03 */ sra $t5, $t2, 0x10 -/* 00B88C 8000AC8C 00CD082A */ slt $at, $a2, $t5 -/* 00B890 8000AC90 10200004 */ beqz $at, .L8000ACA4 -/* 00B894 8000AC94 3C188016 */ lui $t8, %hi(D_801631D8) # $t8, 0x8016 -/* 00B898 8000AC98 00023400 */ sll $a2, $v0, 0x10 -/* 00B89C 8000AC9C 00067C03 */ sra $t7, $a2, 0x10 -/* 00B8A0 8000ACA0 01E03025 */ move $a2, $t7 -.L8000ACA4: -/* 00B8A4 8000ACA4 8F1831D8 */ lw $t8, %lo(D_801631D8)($t8) -/* 00B8A8 8000ACA8 8FB90034 */ lw $t9, 0x34($sp) -/* 00B8AC 8000ACAC 856BC5A0 */ lh $t3, %lo(gCurrentCourseId)($t3) -/* 00B8B0 8000ACB0 24010002 */ li $at, 2 -/* 00B8B4 8000ACB4 03197021 */ addu $t6, $t8, $t9 -/* 00B8B8 8000ACB8 85C20000 */ lh $v0, ($t6) -/* 00B8BC 8000ACBC 000B6040 */ sll $t4, $t3, 1 -/* 00B8C0 8000ACC0 006C1821 */ addu $v1, $v1, $t4 -/* 00B8C4 8000ACC4 10410006 */ beq $v0, $at, .L8000ACE0 -/* 00B8C8 8000ACC8 8463CA20 */ lh $v1, %lo(gKartAISteeringSensitivity)($v1) -/* 00B8CC 8000ACCC 24010003 */ li $at, 3 -/* 00B8D0 8000ACD0 50410014 */ beql $v0, $at, .L8000AD24 -/* 00B8D4 8000ACD4 3C013F00 */ lui $at, 0x3f00 -/* 00B8D8 8000ACD8 10000021 */ b .L8000AD60 -/* 00B8DC 8000ACDC 8FAA0034 */ lw $t2, 0x34($sp) -.L8000ACE0: -/* 00B8E0 8000ACE0 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 00B8E4 8000ACE4 44819000 */ mtc1 $at, $f18 -/* 00B8E8 8000ACE8 C5000000 */ lwc1 $f0, ($t0) -/* 00B8EC 8000ACEC 3C01BF00 */ li $at, 0xBF000000 # -0.500000 -/* 00B8F0 8000ACF0 44814000 */ mtc1 $at, $f8 -/* 00B8F4 8000ACF4 4600903C */ c.lt.s $f18, $f0 -/* 00B8F8 8000ACF8 00000000 */ nop -/* 00B8FC 8000ACFC 45020003 */ bc1fl .L8000AD0C -/* 00B900 8000AD00 4608003C */ c.lt.s $f0, $f8 -/* 00B904 8000AD04 24030014 */ li $v1, 20 -/* 00B908 8000AD08 4608003C */ c.lt.s $f0, $f8 -.L8000AD0C: -/* 00B90C 8000AD0C 00000000 */ nop -/* 00B910 8000AD10 45020013 */ bc1fl .L8000AD60 -/* 00B914 8000AD14 8FAA0034 */ lw $t2, 0x34($sp) -/* 00B918 8000AD18 10000010 */ b .L8000AD5C -/* 00B91C 8000AD1C 24030035 */ li $v1, 53 -/* 00B920 8000AD20 3C013F00 */ li $at, 0x3F000000 # 0.500000 -.L8000AD24: -/* 00B924 8000AD24 44815000 */ mtc1 $at, $f10 -/* 00B928 8000AD28 C5000000 */ lwc1 $f0, ($t0) -/* 00B92C 8000AD2C 3C01BF00 */ li $at, 0xBF000000 # -0.500000 -/* 00B930 8000AD30 44818000 */ mtc1 $at, $f16 -/* 00B934 8000AD34 4600503C */ c.lt.s $f10, $f0 -/* 00B938 8000AD38 00000000 */ nop -/* 00B93C 8000AD3C 45020003 */ bc1fl .L8000AD4C -/* 00B940 8000AD40 4610003C */ c.lt.s $f0, $f16 -/* 00B944 8000AD44 24030035 */ li $v1, 53 -/* 00B948 8000AD48 4610003C */ c.lt.s $f0, $f16 -.L8000AD4C: -/* 00B94C 8000AD4C 00000000 */ nop -/* 00B950 8000AD50 45020003 */ bc1fl .L8000AD60 -/* 00B954 8000AD54 8FAA0034 */ lw $t2, 0x34($sp) -/* 00B958 8000AD58 24030014 */ li $v1, 20 -.L8000AD5C: -/* 00B95C 8000AD5C 8FAA0034 */ lw $t2, 0x34($sp) -.L8000AD60: -/* 00B960 8000AD60 3C0D8016 */ lui $t5, %hi(gKartAIBehaviourState) # 0x8016 -/* 00B964 8000AD64 24010002 */ li $at, 2 -/* 00B968 8000AD68 01AA6821 */ addu $t5, $t5, $t2 -/* 00B96C 8000AD6C 95AD32E8 */ lhu $t5, %lo(gKartAIBehaviourState)($t5) # 0x32e8($t5) -/* 00B970 8000AD70 15A10013 */ bne $t5, $at, .L8000ADC0 -/* 00B974 8000AD74 3C01800F */ lui $at, %hi(D_800ECFB8) # $at, 0x800f -/* 00B978 8000AD78 C424CFB8 */ lwc1 $f4, %lo(D_800ECFB8)($at) -/* 00B97C 8000AD7C C5000000 */ lwc1 $f0, ($t0) -/* 00B980 8000AD80 3C01800F */ lui $at, %hi(D_800ECFBC) # $at, 0x800f -/* 00B984 8000AD84 8FAF002C */ lw $t7, 0x2c($sp) -/* 00B988 8000AD88 4600203C */ c.lt.s $f4, $f0 -/* 00B98C 8000AD8C 00000000 */ nop -/* 00B990 8000AD90 45030007 */ bc1tl .L8000ADB0 -/* 00B994 8000AD94 A5E00000 */ sh $zero, ($t7) -/* 00B998 8000AD98 C426CFBC */ lwc1 $f6, %lo(D_800ECFBC)($at) -/* 00B99C 8000AD9C 4606003C */ c.lt.s $f0, $f6 -/* 00B9A0 8000ADA0 00000000 */ nop -/* 00B9A4 8000ADA4 45020007 */ bc1fl .L8000ADC4 -/* 00B9A8 8000ADA8 8CE200BC */ lw $v0, 0xbc($a3) -/* 00B9AC 8000ADAC A5E00000 */ sh $zero, ($t7) -.L8000ADB0: -/* 00B9B0 8000ADB0 8CEB00BC */ lw $t3, 0xbc($a3) -/* 00B9B4 8000ADB4 2401FFEF */ li $at, -17 -/* 00B9B8 8000ADB8 01616024 */ and $t4, $t3, $at -/* 00B9BC 8000ADBC ACEC00BC */ sw $t4, 0xbc($a3) -.L8000ADC0: -/* 00B9C0 8000ADC0 8CE200BC */ lw $v0, 0xbc($a3) -.L8000ADC4: -/* 00B9C4 8000ADC4 8FB9002C */ lw $t9, 0x2c($sp) -/* 00B9C8 8000ADC8 30580002 */ andi $t8, $v0, 2 -/* 00B9CC 8000ADCC 53000029 */ beql $t8, $zero, .L8000AE74 -/* 00B9D0 8000ADD0 3C011000 */ lui $at, 0x1000 -/* 00B9D4 8000ADD4 87220000 */ lh $v0, ($t9) -/* 00B9D8 8000ADD8 2401FFFF */ li $at, -1 -/* 00B9DC 8000ADDC 2405FFCB */ li $a1, -53 -/* 00B9E0 8000ADE0 1041001F */ beq $v0, $at, .L8000AE60 -/* 00B9E4 8000ADE4 8FAA0034 */ lw $t2, 0x34($sp) -/* 00B9E8 8000ADE8 24010001 */ li $at, 1 -/* 00B9EC 8000ADEC 10410017 */ beq $v0, $at, .L8000AE4C -/* 00B9F0 8000ADF0 24050035 */ li $a1, 53 -/* 00B9F4 8000ADF4 00C30019 */ multu $a2, $v1 -/* 00B9F8 8000ADF8 8FAE0034 */ lw $t6, 0x34($sp) -/* 00B9FC 8000ADFC 3C0A8016 */ lui $t2, %hi(D_80163050) # $t2, 0x8016 -/* 00BA00 8000AE00 254A3050 */ addiu $t2, %lo(D_80163050) # addiu $t2, $t2, 0x3050 -/* 00BA04 8000AE04 01CA1021 */ addu $v0, $t6, $t2 -/* 00BA08 8000AE08 844D0000 */ lh $t5, ($v0) -/* 00BA0C 8000AE0C 3C014000 */ li $at, 0x40000000 # 2.000000 -/* 00BA10 8000AE10 448D9000 */ mtc1 $t5, $f18 -/* 00BA14 8000AE14 00007812 */ mflo $t7 -/* 00BA18 8000AE18 448F5000 */ mtc1 $t7, $f10 -/* 00BA1C 8000AE1C 46809220 */ cvt.s.w $f8, $f18 -/* 00BA20 8000AE20 44819000 */ mtc1 $at, $f18 -/* 00BA24 8000AE24 46805420 */ cvt.s.w $f16, $f10 -/* 00BA28 8000AE28 46028103 */ div.s $f4, $f16, $f2 -/* 00BA2C 8000AE2C 46044180 */ add.s $f6, $f8, $f4 -/* 00BA30 8000AE30 46123283 */ div.s $f10, $f6, $f18 -/* 00BA34 8000AE34 4600540D */ trunc.w.s $f16, $f10 -/* 00BA38 8000AE38 44058000 */ mfc1 $a1, $f16 -/* 00BA3C 8000AE3C 00000000 */ nop -/* 00BA40 8000AE40 00056400 */ sll $t4, $a1, 0x10 -/* 00BA44 8000AE44 1000002A */ b .L8000AEF0 -/* 00BA48 8000AE48 000C2C03 */ sra $a1, $t4, 0x10 -.L8000AE4C: -/* 00BA4C 8000AE4C 8FB90034 */ lw $t9, 0x34($sp) -/* 00BA50 8000AE50 3C0E8016 */ lui $t6, %hi(D_80163050) # $t6, 0x8016 -/* 00BA54 8000AE54 25CE3050 */ addiu $t6, %lo(D_80163050) # addiu $t6, $t6, 0x3050 -/* 00BA58 8000AE58 10000025 */ b .L8000AEF0 -/* 00BA5C 8000AE5C 032E1021 */ addu $v0, $t9, $t6 -.L8000AE60: -/* 00BA60 8000AE60 3C0D8016 */ lui $t5, %hi(D_80163050) # $t5, 0x8016 -/* 00BA64 8000AE64 25AD3050 */ addiu $t5, %lo(D_80163050) # addiu $t5, $t5, 0x3050 -/* 00BA68 8000AE68 10000021 */ b .L8000AEF0 -/* 00BA6C 8000AE6C 014D1021 */ addu $v0, $t2, $t5 -/* 00BA70 8000AE70 3C011000 */ lui $at, (0x1000000C >> 16) # lui $at, 0x1000 -.L8000AE74: -/* 00BA74 8000AE74 3421000C */ ori $at, (0x1000000C & 0xFFFF) # ori $at, $at, 0xc -/* 00BA78 8000AE78 00417824 */ and $t7, $v0, $at -/* 00BA7C 8000AE7C 11E00007 */ beqz $t7, .L8000AE9C -/* 00BA80 8000AE80 00000000 */ nop -/* 00BA84 8000AE84 8FAB0034 */ lw $t3, 0x34($sp) -/* 00BA88 8000AE88 3C0C8016 */ lui $t4, %hi(D_80163050) # $t4, 0x8016 -/* 00BA8C 8000AE8C 258C3050 */ addiu $t4, %lo(D_80163050) # addiu $t4, $t4, 0x3050 -/* 00BA90 8000AE90 00002825 */ move $a1, $zero -/* 00BA94 8000AE94 10000016 */ b .L8000AEF0 -/* 00BA98 8000AE98 016C1021 */ addu $v0, $t3, $t4 -.L8000AE9C: -/* 00BA9C 8000AE9C 00C30019 */ multu $a2, $v1 -/* 00BAA0 8000AEA0 8FB80034 */ lw $t8, 0x34($sp) -/* 00BAA4 8000AEA4 3C198016 */ lui $t9, %hi(D_80163050) # $t9, 0x8016 -/* 00BAA8 8000AEA8 27393050 */ addiu $t9, %lo(D_80163050) # addiu $t9, $t9, 0x3050 -/* 00BAAC 8000AEAC 03191021 */ addu $v0, $t8, $t9 -/* 00BAB0 8000AEB0 844E0000 */ lh $t6, ($v0) -/* 00BAB4 8000AEB4 3C014000 */ li $at, 0x40000000 # 2.000000 -/* 00BAB8 8000AEB8 448E4000 */ mtc1 $t6, $f8 -/* 00BABC 8000AEBC 00005012 */ mflo $t2 -/* 00BAC0 8000AEC0 448A3000 */ mtc1 $t2, $f6 -/* 00BAC4 8000AEC4 46804120 */ cvt.s.w $f4, $f8 -/* 00BAC8 8000AEC8 44814000 */ mtc1 $at, $f8 -/* 00BACC 8000AECC 468034A0 */ cvt.s.w $f18, $f6 -/* 00BAD0 8000AED0 46029283 */ div.s $f10, $f18, $f2 -/* 00BAD4 8000AED4 460A2400 */ add.s $f16, $f4, $f10 -/* 00BAD8 8000AED8 46088183 */ div.s $f6, $f16, $f8 -/* 00BADC 8000AEDC 4600348D */ trunc.w.s $f18, $f6 -/* 00BAE0 8000AEE0 44059000 */ mfc1 $a1, $f18 -/* 00BAE4 8000AEE4 00000000 */ nop -/* 00BAE8 8000AEE8 00057C00 */ sll $t7, $a1, 0x10 -/* 00BAEC 8000AEEC 000F2C03 */ sra $a1, $t7, 0x10 -.L8000AEF0: -/* 00BAF0 8000AEF0 00E02025 */ move $a0, $a3 -/* 00BAF4 8000AEF4 AFA2003C */ sw $v0, 0x3c($sp) -/* 00BAF8 8000AEF8 A7A50094 */ sh $a1, 0x94($sp) -/* 00BAFC 8000AEFC 0C00DA03 */ jal func_8003680C -/* 00BB00 8000AF00 AFA80020 */ sw $t0, 0x20($sp) -/* 00BB04 8000AF04 8FA2003C */ lw $v0, 0x3c($sp) -/* 00BB08 8000AF08 87A50094 */ lh $a1, 0x94($sp) -/* 00BB0C 8000AF0C 8FAC0028 */ lw $t4, 0x28($sp) -/* 00BB10 8000AF10 24010001 */ li $at, 1 -/* 00BB14 8000AF14 A4450000 */ sh $a1, ($v0) -/* 00BB18 8000AF18 8D980000 */ lw $t8, ($t4) -/* 00BB1C 8000AF1C 8FA80020 */ lw $t0, 0x20($sp) -/* 00BB20 8000AF20 1301000D */ beq $t8, $at, .L8000AF58 -/* 00BB24 8000AF24 00000000 */ nop -/* 00BB28 8000AF28 8FB9002C */ lw $t9, 0x2c($sp) -/* 00BB2C 8000AF2C 24010001 */ li $at, 1 -/* 00BB30 8000AF30 87220000 */ lh $v0, ($t9) -/* 00BB34 8000AF34 10410008 */ beq $v0, $at, .L8000AF58 -/* 00BB38 8000AF38 2401FFFF */ li $at, -1 -/* 00BB3C 8000AF3C 10410006 */ beq $v0, $at, .L8000AF58 -/* 00BB40 8000AF40 8FAE0040 */ lw $t6, 0x40($sp) -/* 00BB44 8000AF44 8DCA00BC */ lw $t2, 0xbc($t6) -/* 00BB48 8000AF48 3C011000 */ lui $at, (0x1000000C >> 16) # lui $at, 0x1000 -/* 00BB4C 8000AF4C 3421000C */ ori $at, (0x1000000C & 0xFFFF) # ori $at, $at, 0xc -/* 00BB50 8000AF50 01416824 */ and $t5, $t2, $at -/* 00BB54 8000AF54 11A00014 */ beqz $t5, .L8000AFA8 -.L8000AF58: -/* 00BB58 8000AF58 3C0F800E */ lui $t7, %hi(gCurrentCourseId) -/* 00BB5C 8000AF5C 3C0C800E */ lui $t4, %hi(gCCSelection) -/* 00BB60 8000AF60 8D8CC548 */ lw $t4, %lo(gCCSelection)($t4) -/* 00BB64 8000AF64 85EFC5A0 */ lh $t7, %lo(gCurrentCourseId)($t7) -/* 00BB68 8000AF68 3C0E0D01 */ lui $t6, %hi(D_0D009418) # $t6, 0xd01 -/* 00BB6C 8000AF6C 000CC080 */ sll $t8, $t4, 2 -/* 00BB70 8000AF70 000F5900 */ sll $t3, $t7, 4 -/* 00BB74 8000AF74 0178C821 */ addu $t9, $t3, $t8 -/* 00BB78 8000AF78 25CE9418 */ addiu $t6, %lo(D_0D009418) # addiu $t6, $t6, -0x6be8 -/* 00BB7C 8000AF7C 032E2021 */ addu $a0, $t9, $t6 -/* 00BB80 8000AF80 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00BB84 8000AF84 AFA80020 */ sw $t0, 0x20($sp) -/* 00BB88 8000AF88 8FAA0038 */ lw $t2, 0x38($sp) -/* 00BB8C 8000AF8C 3C0D8016 */ lui $t5, %hi(D_80163028) # $t5, 0x8016 -/* 00BB90 8000AF90 C4440000 */ lwc1 $f4, ($v0) -/* 00BB94 8000AF94 25AD3028 */ addiu $t5, %lo(D_80163028) # addiu $t5, $t5, 0x3028 -/* 00BB98 8000AF98 014D1821 */ addu $v1, $t2, $t5 -/* 00BB9C 8000AF9C 8FA80020 */ lw $t0, 0x20($sp) -/* 00BBA0 8000AFA0 10000014 */ b .L8000AFF4 -/* 00BBA4 8000AFA4 E4640000 */ swc1 $f4, ($v1) -.L8000AFA8: -/* 00BBA8 8000AFA8 3C0F800E */ lui $t7, %hi(gCurrentCourseId) -/* 00BBAC 8000AFAC 3C0B800E */ lui $t3, %hi(gCCSelection) -/* 00BBB0 8000AFB0 8D6BC548 */ lw $t3, %lo(gCCSelection)($t3) -/* 00BBB4 8000AFB4 85EFC5A0 */ lh $t7, %lo(gCurrentCourseId)($t7) -/* 00BBB8 8000AFB8 3C0E0D01 */ lui $t6, %hi(D_0D009568) # $t6, 0xd01 -/* 00BBBC 8000AFBC 000BC080 */ sll $t8, $t3, 2 -/* 00BBC0 8000AFC0 000F6100 */ sll $t4, $t7, 4 -/* 00BBC4 8000AFC4 0198C821 */ addu $t9, $t4, $t8 -/* 00BBC8 8000AFC8 25CE9568 */ addiu $t6, %lo(D_0D009568) # addiu $t6, $t6, -0x6a98 -/* 00BBCC 8000AFCC 032E2021 */ addu $a0, $t9, $t6 -/* 00BBD0 8000AFD0 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00BBD4 8000AFD4 AFA80020 */ sw $t0, 0x20($sp) -/* 00BBD8 8000AFD8 8FAA0038 */ lw $t2, 0x38($sp) -/* 00BBDC 8000AFDC C44A0000 */ lwc1 $f10, ($v0) -/* 00BBE0 8000AFE0 3C0D8016 */ lui $t5, %hi(D_80163028) # $t5, 0x8016 -/* 00BBE4 8000AFE4 25AD3028 */ addiu $t5, %lo(D_80163028) # addiu $t5, $t5, 0x3028 -/* 00BBE8 8000AFE8 014D1821 */ addu $v1, $t2, $t5 -/* 00BBEC 8000AFEC 8FA80020 */ lw $t0, 0x20($sp) -/* 00BBF0 8000AFF0 E46A0000 */ swc1 $f10, ($v1) -.L8000AFF4: -/* 00BBF4 8000AFF4 3C01800F */ lui $at, %hi(D_800ECFC0) # $at, 0x800f -/* 00BBF8 8000AFF8 C430CFC0 */ lwc1 $f16, %lo(D_800ECFC0)($at) -/* 00BBFC 8000AFFC C5000000 */ lwc1 $f0, ($t0) -/* 00BC00 8000B000 3C0E0D01 */ lui $t6, %hi(D_0D009808) # $t6, 0xd01 -/* 00BC04 8000B004 3C01800F */ lui $at, %hi(D_800ECFC4) # $at, 0x800f -/* 00BC08 8000B008 4600803C */ c.lt.s $f16, $f0 -/* 00BC0C 8000B00C 25CE9808 */ addiu $t6, %lo(D_0D009808) # addiu $t6, $t6, -0x67f8 -/* 00BC10 8000B010 3C0F800E */ lui $t7, %hi(gCurrentCourseId) -/* 00BC14 8000B014 3C0C800E */ lui $t4, %hi(gCCSelection) -/* 00BC18 8000B018 45010006 */ bc1t .L8000B034 -/* 00BC1C 8000B01C 00000000 */ nop -/* 00BC20 8000B020 C428CFC4 */ lwc1 $f8, %lo(D_800ECFC4)($at) -/* 00BC24 8000B024 4608003C */ c.lt.s $f0, $f8 -/* 00BC28 8000B028 00000000 */ nop -/* 00BC2C 8000B02C 4500000C */ bc1f .L8000B060 -/* 00BC30 8000B030 00000000 */ nop -.L8000B034: -/* 00BC34 8000B034 85EFC5A0 */ lh $t7, %lo(gCurrentCourseId)($t7) -/* 00BC38 8000B038 8D8CC548 */ lw $t4, %lo(gCCSelection)($t4) -/* 00BC3C 8000B03C AFA30034 */ sw $v1, 0x34($sp) -/* 00BC40 8000B040 000F5900 */ sll $t3, $t7, 4 -/* 00BC44 8000B044 000CC080 */ sll $t8, $t4, 2 -/* 00BC48 8000B048 0178C821 */ addu $t9, $t3, $t8 -/* 00BC4C 8000B04C 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00BC50 8000B050 032E2021 */ addu $a0, $t9, $t6 -/* 00BC54 8000B054 8FA30034 */ lw $v1, 0x34($sp) -/* 00BC58 8000B058 C4460000 */ lwc1 $f6, ($v0) -/* 00BC5C 8000B05C E4660000 */ swc1 $f6, ($v1) -.L8000B060: -/* 00BC60 8000B060 3C0A8016 */ lui $t2, %hi(D_80162FD0) # $t2, 0x8016 -/* 00BC64 8000B064 854A2FD0 */ lh $t2, %lo(D_80162FD0)($t2) -/* 00BC68 8000B068 24010001 */ li $at, 1 -/* 00BC6C 8000B06C 3C0D800E */ lui $t5, %hi(gCurrentCourseId) -/* 00BC70 8000B070 1541000E */ bne $t2, $at, .L8000B0AC -/* 00BC74 8000B074 3C0C800E */ lui $t4, %hi(gCCSelection) -/* 00BC78 8000B078 85ADC5A0 */ lh $t5, %lo(gCurrentCourseId)($t5) -/* 00BC7C 8000B07C 8D8CC548 */ lw $t4, %lo(gCCSelection)($t4) -/* 00BC80 8000B080 3C190D01 */ lui $t9, %hi(D_0D0096B8) # $t9, 0xd01 -/* 00BC84 8000B084 000D7900 */ sll $t7, $t5, 4 -/* 00BC88 8000B088 000C5880 */ sll $t3, $t4, 2 -/* 00BC8C 8000B08C 01EBC021 */ addu $t8, $t7, $t3 -/* 00BC90 8000B090 273996B8 */ addiu $t9, %lo(D_0D0096B8) # addiu $t9, $t9, -0x6948 -/* 00BC94 8000B094 03192021 */ addu $a0, $t8, $t9 -/* 00BC98 8000B098 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 00BC9C 8000B09C AFA30034 */ sw $v1, 0x34($sp) -/* 00BCA0 8000B0A0 8FA30034 */ lw $v1, 0x34($sp) -/* 00BCA4 8000B0A4 C4520000 */ lwc1 $f18, ($v0) -/* 00BCA8 8000B0A8 E4720000 */ swc1 $f18, ($v1) -.L8000B0AC: -/* 00BCAC 8000B0AC 8FAE002C */ lw $t6, 0x2c($sp) -/* 00BCB0 8000B0B0 24010002 */ li $at, 2 -/* 00BCB4 8000B0B4 85C20000 */ lh $v0, ($t6) -/* 00BCB8 8000B0B8 10410004 */ beq $v0, $at, .L8000B0CC -/* 00BCBC 8000B0BC 2401FFFE */ li $at, -2 -/* 00BCC0 8000B0C0 10410002 */ beq $v0, $at, .L8000B0CC -/* 00BCC4 8000B0C4 24010003 */ li $at, 3 -/* 00BCC8 8000B0C8 14410003 */ bne $v0, $at, .L8000B0D8 -.L8000B0CC: -/* 00BCCC 8000B0CC 3C01800F */ lui $at, %hi(D_800ECFC8) # $at, 0x800f -/* 00BCD0 8000B0D0 C424CFC8 */ lwc1 $f4, %lo(D_800ECFC8)($at) -/* 00BCD4 8000B0D4 E4640000 */ swc1 $f4, ($v1) -.L8000B0D8: -/* 00BCD8 8000B0D8 C46A0000 */ lwc1 $f10, ($v1) -/* 00BCDC 8000B0DC 8FAA0040 */ lw $t2, 0x40($sp) -/* 00BCE0 8000B0E0 3C028016 */ lui $v0, %hi(D_8016320C) # $v0, 0x8016 -/* 00BCE4 8000B0E4 2442320C */ addiu $v0, %lo(D_8016320C) # addiu $v0, $v0, 0x320c -/* 00BCE8 8000B0E8 E44A0000 */ swc1 $f10, ($v0) -/* 00BCEC 8000B0EC 8D4D00BC */ lw $t5, 0xbc($t2) -/* 00BCF0 8000B0F0 3C01FFDF */ lui $at, (0xFFDFFFFF >> 16) # lui $at, 0xffdf -/* 00BCF4 8000B0F4 3421FFFF */ ori $at, (0xFFDFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 00BCF8 8000B0F8 01A16024 */ and $t4, $t5, $at -/* 00BCFC 8000B0FC AD4C00BC */ sw $t4, 0xbc($t2) -/* 00BD00 8000B100 8FAF0038 */ lw $t7, 0x38($sp) -/* 00BD04 8000B104 C4500000 */ lwc1 $f16, ($v0) -/* 00BD08 8000B108 3C018016 */ lui $at, %hi(D_80163210) -/* 00BD0C 8000B10C 002F0821 */ addu $at, $at, $t7 -/* 00BD10 8000B110 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00BD14 8000B114 0C004C77 */ jal check_ai_crossing_distance -/* 00BD18 8000B118 E4303210 */ swc1 $f16, %lo(D_80163210)($at) -/* 00BD1C 8000B11C 3C058016 */ lui $a1, %hi(D_8016320C) # $a1, 0x8016 -/* 00BD20 8000B120 8CA5320C */ lw $a1, %lo(D_8016320C)($a1) -/* 00BD24 8000B124 8FA400D0 */ lw $a0, 0xd0($sp) -/* 00BD28 8000B128 0C002109 */ jal func_80008424 -/* 00BD2C 8000B12C 8FA60040 */ lw $a2, 0x40($sp) -.L8000B130: -/* 00BD30 8000B130 8FBF0014 */ lw $ra, 0x14($sp) -.L8000B134: -/* 00BD34 8000B134 27BD00D0 */ addiu $sp, $sp, 0xd0 -/* 00BD38 8000B138 03E00008 */ jr $ra -/* 00BD3C 8000B13C 00000000 */ nop diff --git a/asm/non_matchings/code_80005FD0/func_8000B140.s b/asm/non_matchings/code_80005FD0/func_8000B140.s deleted file mode 100644 index 9089758eb4..0000000000 --- a/asm/non_matchings/code_80005FD0/func_8000B140.s +++ /dev/null @@ -1,469 +0,0 @@ -.section .late_rodata - -glabel D_800ECFCC -.float 0.2 - -glabel D_800ECFD0 -.float 0.2 - -glabel D_800ECFD4 -.float 0.2 - -.section .text - -glabel func_8000B140 -/* 00BD40 8000B140 000478C0 */ sll $t7, $a0, 3 -/* 00BD44 8000B144 01E47823 */ subu $t7, $t7, $a0 -/* 00BD48 8000B148 000F7900 */ sll $t7, $t7, 4 -/* 00BD4C 8000B14C 01E47823 */ subu $t7, $t7, $a0 -/* 00BD50 8000B150 000F7880 */ sll $t7, $t7, 2 -/* 00BD54 8000B154 01E47823 */ subu $t7, $t7, $a0 -/* 00BD58 8000B158 3C18800F */ lui $t8, %hi(gPlayers) # $t8, 0x800f -/* 00BD5C 8000B15C 27186990 */ addiu $t8, %lo(gPlayers) # addiu $t8, $t8, 0x6990 -/* 00BD60 8000B160 000F78C0 */ sll $t7, $t7, 3 -/* 00BD64 8000B164 27BDFF00 */ addiu $sp, $sp, -0x100 -/* 00BD68 8000B168 01F81821 */ addu $v1, $t7, $t8 -/* 00BD6C 8000B16C 8C6500BC */ lw $a1, 0xbc($v1) -/* 00BD70 8000B170 AFBF003C */ sw $ra, 0x3c($sp) -/* 00BD74 8000B174 F7BA0030 */ sdc1 $f26, 0x30($sp) -/* 00BD78 8000B178 30B90010 */ andi $t9, $a1, 0x10 -/* 00BD7C 8000B17C F7B80028 */ sdc1 $f24, 0x28($sp) -/* 00BD80 8000B180 F7B60020 */ sdc1 $f22, 0x20($sp) -/* 00BD84 8000B184 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 00BD88 8000B188 1720018F */ bnez $t9, .L8000B7C8 -/* 00BD8C 8000B18C AFA40100 */ sw $a0, 0x100($sp) -/* 00BD90 8000B190 00046840 */ sll $t5, $a0, 1 -/* 00BD94 8000B194 3C028016 */ lui $v0, %hi(D_801630E8) # 0x8016 -/* 00BD98 8000B198 004D1021 */ addu $v0, $v0, $t5 -/* 00BD9C 8000B19C 844230E8 */ lh $v0, %lo(D_801630E8)($v0) # 0x30e8($v0) -/* 00BDA0 8000B1A0 24010001 */ li $at, 1 -/* 00BDA4 8000B1A4 AFAD005C */ sw $t5, 0x5c($sp) -/* 00BDA8 8000B1A8 10410187 */ beq $v0, $at, .L8000B7C8 -/* 00BDAC 8000B1AC 2406FFFF */ li $a2, -1 -/* 00BDB0 8000B1B0 10C20185 */ beq $a2, $v0, .L8000B7C8 -/* 00BDB4 8000B1B4 3C0B8016 */ lui $t3, %hi(D_80163068) # $t3, 0x8016 -/* 00BDB8 8000B1B8 256B3068 */ addiu $t3, %lo(D_80163068) # addiu $t3, $t3, 0x3068 -/* 00BDBC 8000B1BC 00047880 */ sll $t7, $a0, 2 -/* 00BDC0 8000B1C0 016FC021 */ addu $t8, $t3, $t7 -/* 00BDC4 8000B1C4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 00BDC8 8000B1C8 AFB80054 */ sw $t8, 0x54($sp) -/* 00BDCC 8000B1CC AFAF0058 */ sw $t7, 0x58($sp) -/* 00BDD0 8000B1D0 4481D000 */ mtc1 $at, $f26 -/* 00BDD4 8000B1D4 C7000000 */ lwc1 $f0, ($t8) -/* 00BDD8 8000B1D8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 00BDDC 8000B1DC 461A003C */ c.lt.s $f0, $f26 -/* 00BDE0 8000B1E0 00000000 */ nop -/* 00BDE4 8000B1E4 45030179 */ bc1tl .L8000B7CC -/* 00BDE8 8000B1E8 8FBF003C */ lw $ra, 0x3c($sp) -/* 00BDEC 8000B1EC 4481C000 */ mtc1 $at, $f24 -/* 00BDF0 8000B1F0 00000000 */ nop -/* 00BDF4 8000B1F4 4600C03C */ c.lt.s $f24, $f0 -/* 00BDF8 8000B1F8 00000000 */ nop -/* 00BDFC 8000B1FC 45030173 */ bc1tl .L8000B7CC -/* 00BE00 8000B200 8FBF003C */ lw $ra, 0x3c($sp) -/* 00BE04 8000B204 94620254 */ lhu $v0, 0x254($v1) -/* 00BE08 8000B208 24010005 */ li $at, 5 -/* 00BE0C 8000B20C 1041016E */ beq $v0, $at, .L8000B7C8 -/* 00BE10 8000B210 24010007 */ li $at, 7 -/* 00BE14 8000B214 1041016C */ beq $v0, $at, .L8000B7C8 -/* 00BE18 8000B218 24010004 */ li $at, 4 -/* 00BE1C 8000B21C 1041016A */ beq $v0, $at, .L8000B7C8 -/* 00BE20 8000B220 30AC0200 */ andi $t4, $a1, 0x200 -/* 00BE24 8000B224 15800168 */ bnez $t4, .L8000B7C8 -/* 00BE28 8000B228 3C014190 */ li $at, 0x41900000 # 18.000000 -/* 00BE2C 8000B22C C4640094 */ lwc1 $f4, 0x94($v1) -/* 00BE30 8000B230 44813000 */ mtc1 $at, $f6 -/* 00BE34 8000B234 3C014358 */ li $at, 0x43580000 # 216.000000 -/* 00BE38 8000B238 44815000 */ mtc1 $at, $f10 -/* 00BE3C 8000B23C 46062203 */ div.s $f8, $f4, $f6 -/* 00BE40 8000B240 3C098016 */ lui $t1, %hi(gNearestWaypointByPlayerId) # 0x8016 -/* 00BE44 8000B244 012D4821 */ addu $t1, $t1, $t5 -/* 00BE48 8000B248 85294438 */ lh $t1, %lo(gNearestWaypointByPlayerId)($t1) # 0x4438($t1) -/* 00BE4C 8000B24C 240303E8 */ li $v1, 1000 -/* 00BE50 8000B250 27A5009C */ addiu $a1, $sp, 0x9c -/* 00BE54 8000B254 27A200B0 */ addiu $v0, $sp, 0xb0 -/* 00BE58 8000B258 27A400C0 */ addiu $a0, $sp, 0xc0 -/* 00BE5C 8000B25C 00005025 */ move $t2, $zero -/* 00BE60 8000B260 460A4582 */ mul.s $f22, $f8, $f10 -/* 00BE64 8000B264 00000000 */ nop -.L8000B268: -/* 00BE68 8000B268 24420002 */ addiu $v0, $v0, 2 -/* 00BE6C 8000B26C 0044082B */ sltu $at, $v0, $a0 -/* 00BE70 8000B270 24A50002 */ addiu $a1, $a1, 2 -/* 00BE74 8000B274 A4A6FFFE */ sh $a2, -2($a1) -/* 00BE78 8000B278 1420FFFB */ bnez $at, .L8000B268 -/* 00BE7C 8000B27C A443FFFE */ sh $v1, -2($v0) -/* 00BE80 8000B280 8FAE005C */ lw $t6, 0x5c($sp) -/* 00BE84 8000B284 3C0F8016 */ lui $t7, %hi(D_80163010) # $t7, 0x8016 -/* 00BE88 8000B288 25EF3010 */ addiu $t7, %lo(D_80163010) # addiu $t7, $t7, 0x3010 -/* 00BE8C 8000B28C 01CFC021 */ addu $t8, $t6, $t7 -/* 00BE90 8000B290 AFB8004C */ sw $t8, 0x4c($sp) -/* 00BE94 8000B294 87020000 */ lh $v0, ($t8) -/* 00BE98 8000B298 18400006 */ blez $v0, .L8000B2B4 -/* 00BE9C 8000B29C 2459FFFF */ addiu $t9, $v0, -1 -/* 00BEA0 8000B2A0 1F200004 */ bgtz $t9, .L8000B2B4 -/* 00BEA4 8000B2A4 A7190000 */ sh $t9, ($t8) -/* 00BEA8 8000B2A8 3C018016 */ lui $at, %hi(D_80162FF8) # 0x8016 -/* 00BEAC 8000B2AC 002E0821 */ addu $at, $at, $t6 -/* 00BEB0 8000B2B0 A4202FF8 */ sh $zero, %lo(D_80162FF8)($at) # 0x2ff8($at) -.L8000B2B4: -/* 00BEB4 8000B2B4 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 00BEB8 8000B2B8 4481A000 */ mtc1 $at, $f20 -/* 00BEBC 8000B2BC 00004025 */ move $t0, $zero -/* 00BEC0 8000B2C0 8FAC0100 */ lw $t4, 0x100($sp) -.L8000B2C4: -/* 00BEC4 8000B2C4 000868C0 */ sll $t5, $t0, 3 -/* 00BEC8 8000B2C8 01A86823 */ subu $t5, $t5, $t0 -/* 00BECC 8000B2CC 110C0047 */ beq $t0, $t4, .L8000B3EC -/* 00BED0 8000B2D0 000D6900 */ sll $t5, $t5, 4 -/* 00BED4 8000B2D4 01A86823 */ subu $t5, $t5, $t0 -/* 00BED8 8000B2D8 000D6880 */ sll $t5, $t5, 2 -/* 00BEDC 8000B2DC 01A86823 */ subu $t5, $t5, $t0 -/* 00BEE0 8000B2E0 3C0F800F */ lui $t7, %hi(gPlayers) # $t7, 0x800f -/* 00BEE4 8000B2E4 25EF6990 */ addiu $t7, %lo(gPlayers) # addiu $t7, $t7, 0x6990 -/* 00BEE8 8000B2E8 000D68C0 */ sll $t5, $t5, 3 -/* 00BEEC 8000B2EC 01AF1021 */ addu $v0, $t5, $t7 -/* 00BEF0 8000B2F0 94580000 */ lhu $t8, ($v0) -/* 00BEF4 8000B2F4 3C014190 */ li $at, 0x41900000 # 18.000000 -/* 00BEF8 8000B2F8 33198000 */ andi $t9, $t8, 0x8000 -/* 00BEFC 8000B2FC 5320003C */ beql $t9, $zero, .L8000B3F0 -/* 00BF00 8000B300 29410002 */ slti $at, $t2, 2 -/* 00BF04 8000B304 C4440094 */ lwc1 $f4, 0x94($v0) -/* 00BF08 8000B308 44813000 */ mtc1 $at, $f6 -/* 00BF0C 8000B30C 3C014358 */ li $at, 0x43580000 # 216.000000 -/* 00BF10 8000B310 44815000 */ mtc1 $at, $f10 -/* 00BF14 8000B314 46062203 */ div.s $f8, $f4, $f6 -/* 00BF18 8000B318 00087040 */ sll $t6, $t0, 1 -/* 00BF1C 8000B31C 3C038016 */ lui $v1, %hi(gNearestWaypointByPlayerId) # 0x8016 -/* 00BF20 8000B320 006E1821 */ addu $v1, $v1, $t6 -/* 00BF24 8000B324 4614B081 */ sub.s $f2, $f22, $f20 -/* 00BF28 8000B328 84634438 */ lh $v1, %lo(gNearestWaypointByPlayerId)($v1) # 0x4438($v1) -/* 00BF2C 8000B32C 3125FFFF */ andi $a1, $t1, 0xffff -/* 00BF30 8000B330 00003025 */ move $a2, $zero -/* 00BF34 8000B334 24070014 */ li $a3, 20 -/* 00BF38 8000B338 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016 -/* 00BF3C 8000B33C 3064FFFF */ andi $a0, $v1, 0xffff -/* 00BF40 8000B340 460A4002 */ mul.s $f0, $f8, $f10 -/* 00BF44 8000B344 4602003C */ c.lt.s $f0, $f2 -/* 00BF48 8000B348 00000000 */ nop -/* 00BF4C 8000B34C 45020028 */ bc1fl .L8000B3F0 -/* 00BF50 8000B350 29410002 */ slti $at, $t2, 2 -/* 00BF54 8000B354 958C4430 */ lhu $t4, %lo(D_80164430)($t4) -/* 00BF58 8000B358 A7A300E4 */ sh $v1, 0xe4($sp) -/* 00BF5C 8000B35C AFA800FC */ sw $t0, 0xfc($sp) -/* 00BF60 8000B360 A7A900E6 */ sh $t1, 0xe6($sp) -/* 00BF64 8000B364 AFAA00F0 */ sw $t2, 0xf0($sp) -/* 00BF68 8000B368 E7A000DC */ swc1 $f0, 0xdc($sp) -/* 00BF6C 8000B36C E7A20060 */ swc1 $f2, 0x60($sp) -/* 00BF70 8000B370 0C001EFE */ jal func_80007BF8 -/* 00BF74 8000B374 AFAC0010 */ sw $t4, 0x10($sp) -/* 00BF78 8000B378 3C0B8016 */ lui $t3, %hi(D_80163068) # $t3, 0x8016 -/* 00BF7C 8000B37C 256B3068 */ addiu $t3, %lo(D_80163068) # addiu $t3, $t3, 0x3068 -/* 00BF80 8000B380 87A300E4 */ lh $v1, 0xe4($sp) -/* 00BF84 8000B384 8FA800FC */ lw $t0, 0xfc($sp) -/* 00BF88 8000B388 87A900E6 */ lh $t1, 0xe6($sp) -/* 00BF8C 8000B38C 8FAA00F0 */ lw $t2, 0xf0($sp) -/* 00BF90 8000B390 C7A000DC */ lwc1 $f0, 0xdc($sp) -/* 00BF94 8000B394 18400015 */ blez $v0, .L8000B3EC -/* 00BF98 8000B398 C7A20060 */ lwc1 $f2, 0x60($sp) -/* 00BF9C 8000B39C 000A1040 */ sll $v0, $t2, 1 -/* 00BFA0 8000B3A0 03A26821 */ addu $t5, $sp, $v0 -/* 00BFA4 8000B3A4 00692823 */ subu $a1, $v1, $t1 -/* 00BFA8 8000B3A8 27AF00B0 */ addiu $t7, $sp, 0xb0 -/* 00BFAC 8000B3AC 000AC080 */ sll $t8, $t2, 2 -/* 00BFB0 8000B3B0 27B90074 */ addiu $t9, $sp, 0x74 -/* 00BFB4 8000B3B4 A5A8009C */ sh $t0, 0x9c($t5) -/* 00BFB8 8000B3B8 03192021 */ addu $a0, $t8, $t9 -/* 00BFBC 8000B3BC 18A00003 */ blez $a1, .L8000B3CC -/* 00BFC0 8000B3C0 004F3021 */ addu $a2, $v0, $t7 -/* 00BFC4 8000B3C4 10000006 */ b .L8000B3E0 -/* 00BFC8 8000B3C8 A4C50000 */ sh $a1, ($a2) -.L8000B3CC: -/* 00BFCC 8000B3CC 3C0E8016 */ lui $t6, %hi(D_80164430) # $t6, 0x8016 -/* 00BFD0 8000B3D0 95CE4430 */ lhu $t6, %lo(D_80164430)($t6) -/* 00BFD4 8000B3D4 006E6021 */ addu $t4, $v1, $t6 -/* 00BFD8 8000B3D8 01896823 */ subu $t5, $t4, $t1 -/* 00BFDC 8000B3DC A4CD0000 */ sh $t5, ($a2) -.L8000B3E0: -/* 00BFE0 8000B3E0 46001101 */ sub.s $f4, $f2, $f0 -/* 00BFE4 8000B3E4 254A0001 */ addiu $t2, $t2, 1 -/* 00BFE8 8000B3E8 E4840000 */ swc1 $f4, ($a0) -.L8000B3EC: -/* 00BFEC 8000B3EC 29410002 */ slti $at, $t2, 2 -.L8000B3F0: -/* 00BFF0 8000B3F0 10200004 */ beqz $at, .L8000B404 -/* 00BFF4 8000B3F4 25080001 */ addiu $t0, $t0, 1 -/* 00BFF8 8000B3F8 29010008 */ slti $at, $t0, 8 -/* 00BFFC 8000B3FC 5420FFB1 */ bnel $at, $zero, .L8000B2C4 -/* 00C000 8000B400 8FAC0100 */ lw $t4, 0x100($sp) -.L8000B404: -/* 00C004 8000B404 114000F0 */ beqz $t2, .L8000B7C8 -/* 00C008 8000B408 00004025 */ move $t0, $zero -/* 00C00C 8000B40C 4600C486 */ mov.s $f18, $f24 -/* 00C010 8000B410 194000BD */ blez $t2, .L8000B708 -/* 00C014 8000B414 4600D506 */ mov.s $f20, $f26 -/* 00C018 8000B418 31420001 */ andi $v0, $t2, 1 -/* 00C01C 8000B41C 1040003B */ beqz $v0, .L8000B50C -/* 00C020 8000B420 87A3009C */ lh $v1, 0x9c($sp) -/* 00C024 8000B424 00037880 */ sll $t7, $v1, 2 -/* 00C028 8000B428 016FC021 */ addu $t8, $t3, $t7 -/* 00C02C 8000B42C C7020000 */ lwc1 $f2, ($t8) -/* 00C030 8000B430 24080001 */ li $t0, 1 -/* 00C034 8000B434 4602D03C */ c.lt.s $f26, $f2 -/* 00C038 8000B438 00000000 */ nop -/* 00C03C 8000B43C 45000032 */ bc1f .L8000B508 -/* 00C040 8000B440 00000000 */ nop -/* 00C044 8000B444 4618103C */ c.lt.s $f2, $f24 -/* 00C048 8000B448 87A200B0 */ lh $v0, 0xb0($sp) -/* 00C04C 8000B44C 4500002E */ bc1f .L8000B508 -/* 00C050 8000B450 00000000 */ nop -/* 00C054 8000B454 44824000 */ mtc1 $v0, $f8 -/* 00C058 8000B458 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 00C05C 8000B45C 4481B000 */ mtc1 $at, $f22 -/* 00C060 8000B460 468042A0 */ cvt.s.w $f10, $f8 -/* 00C064 8000B464 3C01800F */ lui $at, %hi(D_800ECFCC) # $at, 0x800f -/* 00C068 8000B468 C426CFCC */ lwc1 $f6, %lo(D_800ECFCC)($at) -/* 00C06C 8000B46C 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 00C070 8000B470 C7A00074 */ lwc1 $f0, 0x74($sp) -/* 00C074 8000B474 4618C032 */ c.eq.s $f24, $f24 -/* 00C078 8000B478 46165100 */ add.s $f4, $f10, $f22 -/* 00C07C 8000B47C 4604B203 */ div.s $f8, $f22, $f4 -/* 00C080 8000B480 44812000 */ mtc1 $at, $f4 -/* 00C084 8000B484 46083282 */ mul.s $f10, $f6, $f8 -/* 00C088 8000B488 46040180 */ add.s $f6, $f0, $f4 -/* 00C08C 8000B48C 460A3202 */ mul.s $f8, $f6, $f10 -/* 00C090 8000B490 45000008 */ bc1f .L8000B4B4 -/* 00C094 8000B494 46164303 */ div.s $f12, $f8, $f22 -/* 00C098 8000B498 461AD032 */ c.eq.s $f26, $f26 -/* 00C09C 8000B49C 00000000 */ nop -/* 00C0A0 8000B4A0 45020005 */ bc1fl .L8000B4B8 -/* 00C0A4 8000B4A4 460C1381 */ sub.s $f14, $f2, $f12 -/* 00C0A8 8000B4A8 460C1481 */ sub.s $f18, $f2, $f12 -/* 00C0AC 8000B4AC 10000016 */ b .L8000B508 -/* 00C0B0 8000B4B0 460C1500 */ add.s $f20, $f2, $f12 -.L8000B4B4: -/* 00C0B4 8000B4B4 460C1381 */ sub.s $f14, $f2, $f12 -.L8000B4B8: -/* 00C0B8 8000B4B8 460C1400 */ add.s $f16, $f2, $f12 -/* 00C0BC 8000B4BC 4618703C */ c.lt.s $f14, $f24 -/* 00C0C0 8000B4C0 00000000 */ nop -/* 00C0C4 8000B4C4 45020008 */ bc1fl .L8000B4E8 -/* 00C0C8 8000B4C8 4610D03C */ c.lt.s $f26, $f16 -/* 00C0CC 8000B4CC 460C1100 */ add.s $f4, $f2, $f12 -/* 00C0D0 8000B4D0 4604C03C */ c.lt.s $f24, $f4 -/* 00C0D4 8000B4D4 00000000 */ nop -/* 00C0D8 8000B4D8 45020003 */ bc1fl .L8000B4E8 -/* 00C0DC 8000B4DC 4610D03C */ c.lt.s $f26, $f16 -/* 00C0E0 8000B4E0 46007486 */ mov.s $f18, $f14 -/* 00C0E4 8000B4E4 4610D03C */ c.lt.s $f26, $f16 -.L8000B4E8: -/* 00C0E8 8000B4E8 00000000 */ nop -/* 00C0EC 8000B4EC 45000006 */ bc1f .L8000B508 -/* 00C0F0 8000B4F0 00000000 */ nop -/* 00C0F4 8000B4F4 461A703C */ c.lt.s $f14, $f26 -/* 00C0F8 8000B4F8 00000000 */ nop -/* 00C0FC 8000B4FC 45000002 */ bc1f .L8000B508 -/* 00C100 8000B500 00000000 */ nop -/* 00C104 8000B504 46008506 */ mov.s $f20, $f16 -.L8000B508: -/* 00C108 8000B508 110A007F */ beq $t0, $t2, .L8000B708 -.L8000B50C: -/* 00C10C 8000B50C 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 00C110 8000B510 00081040 */ sll $v0, $t0, 1 -/* 00C114 8000B514 27B9009C */ addiu $t9, $sp, 0x9c -/* 00C118 8000B518 4481B000 */ mtc1 $at, $f22 -/* 00C11C 8000B51C 00592821 */ addu $a1, $v0, $t9 -/* 00C120 8000B520 27A400B0 */ addiu $a0, $sp, 0xb0 -/* 00C124 8000B524 27A30074 */ addiu $v1, $sp, 0x74 -.L8000B528: -/* 00C128 8000B528 84AE0000 */ lh $t6, ($a1) -/* 00C12C 8000B52C 000E6080 */ sll $t4, $t6, 2 -/* 00C130 8000B530 016C6821 */ addu $t5, $t3, $t4 -/* 00C134 8000B534 C5A20000 */ lwc1 $f2, ($t5) -/* 00C138 8000B538 4602D03C */ c.lt.s $f26, $f2 -/* 00C13C 8000B53C 00000000 */ nop -/* 00C140 8000B540 45020034 */ bc1fl .L8000B614 -/* 00C144 8000B544 84AC0002 */ lh $t4, 2($a1) -/* 00C148 8000B548 4618103C */ c.lt.s $f2, $f24 -/* 00C14C 8000B54C 00087880 */ sll $t7, $t0, 2 -/* 00C150 8000B550 006FC021 */ addu $t8, $v1, $t7 -/* 00C154 8000B554 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 00C158 8000B558 4500002D */ bc1f .L8000B610 -/* 00C15C 8000B55C 0082C821 */ addu $t9, $a0, $v0 -/* 00C160 8000B560 C7060000 */ lwc1 $f6, ($t8) -/* 00C164 8000B564 44815000 */ mtc1 $at, $f10 -/* 00C168 8000B568 872E0000 */ lh $t6, ($t9) -/* 00C16C 8000B56C 3C01800F */ lui $at, %hi(D_800ECFD0) # $at, 0x800f -/* 00C170 8000B570 460A3200 */ add.s $f8, $f6, $f10 -/* 00C174 8000B574 448E3000 */ mtc1 $t6, $f6 -/* 00C178 8000B578 C424CFD0 */ lwc1 $f4, %lo(D_800ECFD0)($at) -/* 00C17C 8000B57C 46189032 */ c.eq.s $f18, $f24 -/* 00C180 8000B580 468032A0 */ cvt.s.w $f10, $f6 -/* 00C184 8000B584 46165180 */ add.s $f6, $f10, $f22 -/* 00C188 8000B588 4606B283 */ div.s $f10, $f22, $f6 -/* 00C18C 8000B58C 460A2182 */ mul.s $f6, $f4, $f10 -/* 00C190 8000B590 00000000 */ nop -/* 00C194 8000B594 46064102 */ mul.s $f4, $f8, $f6 -/* 00C198 8000B598 45000008 */ bc1f .L8000B5BC -/* 00C19C 8000B59C 46162003 */ div.s $f0, $f4, $f22 -/* 00C1A0 8000B5A0 461AA032 */ c.eq.s $f20, $f26 -/* 00C1A4 8000B5A4 00000000 */ nop -/* 00C1A8 8000B5A8 45020005 */ bc1fl .L8000B5C0 -/* 00C1AC 8000B5AC 46001301 */ sub.s $f12, $f2, $f0 -/* 00C1B0 8000B5B0 46001481 */ sub.s $f18, $f2, $f0 -/* 00C1B4 8000B5B4 10000016 */ b .L8000B610 -/* 00C1B8 8000B5B8 46001500 */ add.s $f20, $f2, $f0 -.L8000B5BC: -/* 00C1BC 8000B5BC 46001301 */ sub.s $f12, $f2, $f0 -.L8000B5C0: -/* 00C1C0 8000B5C0 46001380 */ add.s $f14, $f2, $f0 -/* 00C1C4 8000B5C4 4612603C */ c.lt.s $f12, $f18 -/* 00C1C8 8000B5C8 00000000 */ nop -/* 00C1CC 8000B5CC 45020008 */ bc1fl .L8000B5F0 -/* 00C1D0 8000B5D0 460EA03C */ c.lt.s $f20, $f14 -/* 00C1D4 8000B5D4 46001280 */ add.s $f10, $f2, $f0 -/* 00C1D8 8000B5D8 460A903C */ c.lt.s $f18, $f10 -/* 00C1DC 8000B5DC 00000000 */ nop -/* 00C1E0 8000B5E0 45020003 */ bc1fl .L8000B5F0 -/* 00C1E4 8000B5E4 460EA03C */ c.lt.s $f20, $f14 -/* 00C1E8 8000B5E8 46006486 */ mov.s $f18, $f12 -/* 00C1EC 8000B5EC 460EA03C */ c.lt.s $f20, $f14 -.L8000B5F0: -/* 00C1F0 8000B5F0 00000000 */ nop -/* 00C1F4 8000B5F4 45020007 */ bc1fl .L8000B614 -/* 00C1F8 8000B5F8 84AC0002 */ lh $t4, 2($a1) -/* 00C1FC 8000B5FC 4614603C */ c.lt.s $f12, $f20 -/* 00C200 8000B600 00000000 */ nop -/* 00C204 8000B604 45020003 */ bc1fl .L8000B614 -/* 00C208 8000B608 84AC0002 */ lh $t4, 2($a1) -/* 00C20C 8000B60C 46007506 */ mov.s $f20, $f14 -.L8000B610: -/* 00C210 8000B610 84AC0002 */ lh $t4, 2($a1) -.L8000B614: -/* 00C214 8000B614 24A50004 */ addiu $a1, $a1, 4 -/* 00C218 8000B618 000C6880 */ sll $t5, $t4, 2 -/* 00C21C 8000B61C 016D7821 */ addu $t7, $t3, $t5 -/* 00C220 8000B620 C5E00000 */ lwc1 $f0, ($t7) -/* 00C224 8000B624 4600D03C */ c.lt.s $f26, $f0 -/* 00C228 8000B628 00000000 */ nop -/* 00C22C 8000B62C 45020034 */ bc1fl .L8000B700 -/* 00C230 8000B630 25080002 */ addiu $t0, $t0, 2 -/* 00C234 8000B634 4618003C */ c.lt.s $f0, $f24 -/* 00C238 8000B638 0008C080 */ sll $t8, $t0, 2 -/* 00C23C 8000B63C 0078C821 */ addu $t9, $v1, $t8 -/* 00C240 8000B640 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 00C244 8000B644 4500002D */ bc1f .L8000B6FC -/* 00C248 8000B648 00827021 */ addu $t6, $a0, $v0 -/* 00C24C 8000B64C C7280004 */ lwc1 $f8, 4($t9) -/* 00C250 8000B650 44813000 */ mtc1 $at, $f6 -/* 00C254 8000B654 85CC0002 */ lh $t4, 2($t6) -/* 00C258 8000B658 3C01800F */ lui $at, %hi(D_800ECFD4) # $at, 0x800f -/* 00C25C 8000B65C 46064100 */ add.s $f4, $f8, $f6 -/* 00C260 8000B660 448C4000 */ mtc1 $t4, $f8 -/* 00C264 8000B664 C42ACFD4 */ lwc1 $f10, %lo(D_800ECFD4)($at) -/* 00C268 8000B668 46189032 */ c.eq.s $f18, $f24 -/* 00C26C 8000B66C 468041A0 */ cvt.s.w $f6, $f8 -/* 00C270 8000B670 46163200 */ add.s $f8, $f6, $f22 -/* 00C274 8000B674 4608B183 */ div.s $f6, $f22, $f8 -/* 00C278 8000B678 46065202 */ mul.s $f8, $f10, $f6 -/* 00C27C 8000B67C 00000000 */ nop -/* 00C280 8000B680 46082282 */ mul.s $f10, $f4, $f8 -/* 00C284 8000B684 45000008 */ bc1f .L8000B6A8 -/* 00C288 8000B688 46165083 */ div.s $f2, $f10, $f22 -/* 00C28C 8000B68C 461AA032 */ c.eq.s $f20, $f26 -/* 00C290 8000B690 00000000 */ nop -/* 00C294 8000B694 45020005 */ bc1fl .L8000B6AC -/* 00C298 8000B698 46020301 */ sub.s $f12, $f0, $f2 -/* 00C29C 8000B69C 46020481 */ sub.s $f18, $f0, $f2 -/* 00C2A0 8000B6A0 10000016 */ b .L8000B6FC -/* 00C2A4 8000B6A4 46020500 */ add.s $f20, $f0, $f2 -.L8000B6A8: -/* 00C2A8 8000B6A8 46020301 */ sub.s $f12, $f0, $f2 -.L8000B6AC: -/* 00C2AC 8000B6AC 46020380 */ add.s $f14, $f0, $f2 -/* 00C2B0 8000B6B0 4612603C */ c.lt.s $f12, $f18 -/* 00C2B4 8000B6B4 00000000 */ nop -/* 00C2B8 8000B6B8 45020008 */ bc1fl .L8000B6DC -/* 00C2BC 8000B6BC 460EA03C */ c.lt.s $f20, $f14 -/* 00C2C0 8000B6C0 46020180 */ add.s $f6, $f0, $f2 -/* 00C2C4 8000B6C4 4606903C */ c.lt.s $f18, $f6 -/* 00C2C8 8000B6C8 00000000 */ nop -/* 00C2CC 8000B6CC 45020003 */ bc1fl .L8000B6DC -/* 00C2D0 8000B6D0 460EA03C */ c.lt.s $f20, $f14 -/* 00C2D4 8000B6D4 46006486 */ mov.s $f18, $f12 -/* 00C2D8 8000B6D8 460EA03C */ c.lt.s $f20, $f14 -.L8000B6DC: -/* 00C2DC 8000B6DC 00000000 */ nop -/* 00C2E0 8000B6E0 45020007 */ bc1fl .L8000B700 -/* 00C2E4 8000B6E4 25080002 */ addiu $t0, $t0, 2 -/* 00C2E8 8000B6E8 4614603C */ c.lt.s $f12, $f20 -/* 00C2EC 8000B6EC 00000000 */ nop -/* 00C2F0 8000B6F0 45020003 */ bc1fl .L8000B700 -/* 00C2F4 8000B6F4 25080002 */ addiu $t0, $t0, 2 -/* 00C2F8 8000B6F8 46007506 */ mov.s $f20, $f14 -.L8000B6FC: -/* 00C2FC 8000B6FC 25080002 */ addiu $t0, $t0, 2 -.L8000B700: -/* 00C300 8000B700 150AFF89 */ bne $t0, $t2, .L8000B528 -/* 00C304 8000B704 24420004 */ addiu $v0, $v0, 4 -.L8000B708: -/* 00C308 8000B708 4612A03C */ c.lt.s $f20, $f18 -/* 00C30C 8000B70C 8FAD0054 */ lw $t5, 0x54($sp) -/* 00C310 8000B710 4503002E */ bc1tl .L8000B7CC -/* 00C314 8000B714 8FBF003C */ lw $ra, 0x3c($sp) -/* 00C318 8000B718 C5A00000 */ lwc1 $f0, ($t5) -/* 00C31C 8000B71C 4612003C */ c.lt.s $f0, $f18 -/* 00C320 8000B720 00000000 */ nop -/* 00C324 8000B724 45030029 */ bc1tl .L8000B7CC -/* 00C328 8000B728 8FBF003C */ lw $ra, 0x3c($sp) -/* 00C32C 8000B72C 4600A03C */ c.lt.s $f20, $f0 -/* 00C330 8000B730 00000000 */ nop -/* 00C334 8000B734 45030025 */ bc1tl .L8000B7CC -/* 00C338 8000B738 8FBF003C */ lw $ra, 0x3c($sp) -/* 00C33C 8000B73C 4614C03C */ c.lt.s $f24, $f20 -/* 00C340 8000B740 8FAF005C */ lw $t7, 0x5c($sp) -/* 00C344 8000B744 3C188016 */ lui $t8, %hi(D_80162FF8) # $t8, 0x8016 -/* 00C348 8000B748 27182FF8 */ addiu $t8, %lo(D_80162FF8) # addiu $t8, $t8, 0x2ff8 -/* 00C34C 8000B74C 45000002 */ bc1f .L8000B758 -/* 00C350 8000B750 01F81021 */ addu $v0, $t7, $t8 -/* 00C354 8000B754 4600C506 */ mov.s $f20, $f24 -.L8000B758: -/* 00C358 8000B758 461A903C */ c.lt.s $f18, $f26 -/* 00C35C 8000B75C 8FAE004C */ lw $t6, 0x4c($sp) -/* 00C360 8000B760 4614C201 */ sub.s $f8, $f24, $f20 -/* 00C364 8000B764 8FB8004C */ lw $t8, 0x4c($sp) -/* 00C368 8000B768 45000002 */ bc1f .L8000B774 -/* 00C36C 8000B76C 24190002 */ li $t9, 2 -/* 00C370 8000B770 4600D486 */ mov.s $f18, $f26 -.L8000B774: -/* 00C374 8000B774 46189100 */ add.s $f4, $f18, $f24 -/* 00C378 8000B778 240C0001 */ li $t4, 1 -/* 00C37C 8000B77C 240F003C */ li $t7, 60 -/* 00C380 8000B780 4608203C */ c.lt.s $f4, $f8 -/* 00C384 8000B784 00000000 */ nop -/* 00C388 8000B788 4502000A */ bc1fl .L8000B7B4 -/* 00C38C 8000B78C A70F0000 */ sh $t7, ($t8) -/* 00C390 8000B790 2419003C */ li $t9, 60 -/* 00C394 8000B794 A5D90000 */ sh $t9, ($t6) -/* 00C398 8000B798 8FAD0058 */ lw $t5, 0x58($sp) -/* 00C39C 8000B79C 3C018016 */ lui $at, %hi(D_80163090) -/* 00C3A0 8000B7A0 A44C0000 */ sh $t4, ($v0) -/* 00C3A4 8000B7A4 002D0821 */ addu $at, $at, $t5 -/* 00C3A8 8000B7A8 10000007 */ b .L8000B7C8 -/* 00C3AC 8000B7AC E4343090 */ swc1 $f20, %lo(D_80163090)($at) -/* 00C3B0 8000B7B0 A70F0000 */ sh $t7, ($t8) -.L8000B7B4: -/* 00C3B4 8000B7B4 8FAE0058 */ lw $t6, 0x58($sp) -/* 00C3B8 8000B7B8 3C018016 */ lui $at, %hi(D_80163090) -/* 00C3BC 8000B7BC A4590000 */ sh $t9, ($v0) -/* 00C3C0 8000B7C0 002E0821 */ addu $at, $at, $t6 -/* 00C3C4 8000B7C4 E4323090 */ swc1 $f18, %lo(D_80163090)($at) -.L8000B7C8: -/* 00C3C8 8000B7C8 8FBF003C */ lw $ra, 0x3c($sp) -.L8000B7CC: -/* 00C3CC 8000B7CC D7B40018 */ ldc1 $f20, 0x18($sp) -/* 00C3D0 8000B7D0 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 00C3D4 8000B7D4 D7B80028 */ ldc1 $f24, 0x28($sp) -/* 00C3D8 8000B7D8 D7BA0030 */ ldc1 $f26, 0x30($sp) -/* 00C3DC 8000B7DC 03E00008 */ jr $ra -/* 00C3E0 8000B7E0 27BD0100 */ addiu $sp, $sp, 0x100 diff --git a/asm/non_matchings/code_80005FD0/func_80017054.s b/asm/non_matchings/code_80005FD0/func_80017054.s deleted file mode 100644 index de71136a5a..0000000000 --- a/asm/non_matchings/code_80005FD0/func_80017054.s +++ /dev/null @@ -1,466 +0,0 @@ -.section .late_rodata - -glabel D_800ED270 -.double -10000.0 - -glabel D_800ED278 -.double 10000.0 - -glabel D_800ED280 -.double 10000.0 - -.section .text - -glabel func_80017054 -/* 017C54 80017054 00077080 */ sll $t6, $a3, 2 -/* 017C58 80017058 3C0F8016 */ lui $t7, %hi(D_80164648) # $t7, 0x8016 -/* 017C5C 8001705C 25EF4648 */ addiu $t7, %lo(D_80164648) # addiu $t7, $t7, 0x4648 -/* 017C60 80017060 3C018016 */ lui $at, %hi(D_80164658) -/* 017C64 80017064 002E0821 */ addu $at, $at, $t6 -/* 017C68 80017068 01CF4821 */ addu $t1, $t6, $t7 -/* 017C6C 8001706C C5220000 */ lwc1 $f2, ($t1) -/* 017C70 80017070 C4244658 */ lwc1 $f4, %lo(D_80164658)($at) -/* 017C74 80017074 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 017C78 80017078 44814000 */ mtc1 $at, $f8 -/* 017C7C 8001707C 46022181 */ sub.s $f6, $f4, $f2 -/* 017C80 80017080 27BDFF48 */ addiu $sp, $sp, -0xb8 -/* 017C84 80017084 3C188016 */ lui $t8, %hi(D_80163DD8) # $t8, 0x8016 -/* 017C88 80017088 AFA500BC */ sw $a1, 0xbc($sp) -/* 017C8C 8001708C 46083282 */ mul.s $f10, $f6, $f8 -/* 017C90 80017090 27183DD8 */ addiu $t8, %lo(D_80163DD8) # addiu $t8, $t8, 0x3dd8 -/* 017C94 80017094 01D82821 */ addu $a1, $t6, $t8 -/* 017C98 80017098 8CAA0000 */ lw $t2, ($a1) -/* 017C9C 8001709C AFBF0024 */ sw $ra, 0x24($sp) -/* 017CA0 800170A0 AFB00020 */ sw $s0, 0x20($sp) -/* 017CA4 800170A4 AFA600C0 */ sw $a2, 0xc0($sp) -/* 017CA8 800170A8 460A1100 */ add.s $f4, $f2, $f10 -/* 017CAC 800170AC AFA700C4 */ sw $a3, 0xc4($sp) -/* 017CB0 800170B0 848200AE */ lh $v0, 0xae($a0) -/* 017CB4 800170B4 01C01825 */ move $v1, $t6 -/* 017CB8 800170B8 3C0F8016 */ lui $t7, %hi(gNearestWaypointByCameraId) # $t7, 0x8016 -/* 017CBC 800170BC E5240000 */ swc1 $f4, ($t1) -/* 017CC0 800170C0 3C0C8016 */ lui $t4, %hi(gWaypointCountByPathIndex) # 0x8016 -/* 017CC4 800170C4 3C018016 */ lui $at, %hi(D_80163238) # $at, 0x8016 -/* 017CC8 800170C8 25EF4668 */ addiu $t7, %lo(gNearestWaypointByCameraId) # addiu $t7, $t7, 0x4668 -/* 017CCC 800170CC 00077040 */ sll $t6, $a3, 1 -/* 017CD0 800170D0 000AC840 */ sll $t9, $t2, 1 -/* 017CD4 800170D4 01996021 */ addu $t4, $t4, $t9 -/* 017CD8 800170D8 01CF4021 */ addu $t0, $t6, $t7 -/* 017CDC 800170DC AC223238 */ sw $v0, %lo(D_80163238)($at) -/* 017CE0 800170E0 958C45C8 */ lhu $t4, %lo(gWaypointCountByPathIndex)($t4) # 0x45c8($t4) -/* 017CE4 800170E4 85070000 */ lh $a3, ($t0) -/* 017CE8 800170E8 00808025 */ move $s0, $a0 -/* 017CEC 800170EC AFAC0058 */ sw $t4, 0x58($sp) -/* 017CF0 800170F0 A7A70056 */ sh $a3, 0x56($sp) -/* 017CF4 800170F4 8C860008 */ lw $a2, 8($a0) -/* 017CF8 800170F8 C48E0004 */ lwc1 $f14, 4($a0) -/* 017CFC 800170FC C48C0000 */ lwc1 $f12, ($a0) -/* 017D00 80017100 AFA90048 */ sw $t1, 0x48($sp) -/* 017D04 80017104 AFA80040 */ sw $t0, 0x40($sp) -/* 017D08 80017108 AFA50044 */ sw $a1, 0x44($sp) -/* 017D0C 8001710C AFA3004C */ sw $v1, 0x4c($sp) -/* 017D10 80017110 AFAA005C */ sw $t2, 0x5c($sp) -/* 017D14 80017114 0C0034CF */ jal func_8000D33C -/* 017D18 80017118 AFAA0010 */ sw $t2, 0x10($sp) -/* 017D1C 8001711C 8FA90040 */ lw $t1, 0x40($sp) -/* 017D20 80017120 3C18800E */ lui $t8, %hi(gCurrentCourseId) -/* 017D24 80017124 24010004 */ li $at, 4 -/* 017D28 80017128 A5220000 */ sh $v0, ($t1) -/* 017D2C 8001712C 8718C5A0 */ lh $t8, %lo(gCurrentCourseId)($t8) -/* 017D30 80017130 57010018 */ bnel $t8, $at, .L80017194 -/* 017D34 80017134 8FA80058 */ lw $t0, 0x58($sp) -/* 017D38 80017138 85270000 */ lh $a3, ($t1) -/* 017D3C 8001713C 87B90056 */ lh $t9, 0x56($sp) -/* 017D40 80017140 53270014 */ beql $t9, $a3, .L80017194 -/* 017D44 80017144 8FA80058 */ lw $t0, 0x58($sp) -/* 017D48 80017148 24010001 */ li $at, 1 -/* 017D4C 8001714C 54E10011 */ bnel $a3, $at, .L80017194 -/* 017D50 80017150 8FA80058 */ lw $t0, 0x58($sp) -/* 017D54 80017154 0C0ADF8D */ jal random_int -/* 017D58 80017158 24040004 */ li $a0, 4 -/* 017D5C 8001715C 8FAC0044 */ lw $t4, 0x44($sp) -/* 017D60 80017160 AD820000 */ sw $v0, ($t4) -/* 017D64 80017164 AFA2005C */ sw $v0, 0x5c($sp) -/* 017D68 80017168 8FAD0040 */ lw $t5, 0x40($sp) -/* 017D6C 8001716C 8E060008 */ lw $a2, 8($s0) -/* 017D70 80017170 C60E0004 */ lwc1 $f14, 4($s0) -/* 017D74 80017174 C60C0000 */ lwc1 $f12, ($s0) -/* 017D78 80017178 85A70000 */ lh $a3, ($t5) -/* 017D7C 8001717C 0C0034CF */ jal func_8000D33C -/* 017D80 80017180 AFA20010 */ sw $v0, 0x10($sp) -/* 017D84 80017184 8FAE0040 */ lw $t6, 0x40($sp) -/* 017D88 80017188 A5C20000 */ sh $v0, ($t6) -/* 017D8C 8001718C 8FA90040 */ lw $t1, 0x40($sp) -/* 017D90 80017190 8FA80058 */ lw $t0, 0x58($sp) -.L80017194: -/* 017D94 80017194 85270000 */ lh $a3, ($t1) -/* 017D98 80017198 8FAE004C */ lw $t6, 0x4c($sp) -/* 017D9C 8001719C 87A6005E */ lh $a2, 0x5e($sp) -/* 017DA0 800171A0 24EF000A */ addiu $t7, $a3, 0xa -/* 017DA4 800171A4 01E8001A */ div $zero, $t7, $t0 -/* 017DA8 800171A8 24EC000B */ addiu $t4, $a3, 0xb -/* 017DAC 800171AC 00001010 */ mfhi $v0 -/* 017DB0 800171B0 0002C400 */ sll $t8, $v0, 0x10 -/* 017DB4 800171B4 15000002 */ bnez $t0, .L800171C0 -/* 017DB8 800171B8 00000000 */ nop -/* 017DBC 800171BC 0007000D */ break 7 -.L800171C0: -/* 017DC0 800171C0 2401FFFF */ li $at, -1 -/* 017DC4 800171C4 15010004 */ bne $t0, $at, .L800171D8 -/* 017DC8 800171C8 3C018000 */ lui $at, 0x8000 -/* 017DCC 800171CC 15E10002 */ bne $t7, $at, .L800171D8 -/* 017DD0 800171D0 00000000 */ nop -/* 017DD4 800171D4 0006000D */ break 6 -.L800171D8: -/* 017DD8 800171D8 0188001A */ div $zero, $t4, $t0 -/* 017DDC 800171DC 3C0F8016 */ lui $t7, %hi(D_80164688) # $t7, 0x8016 -/* 017DE0 800171E0 0018CC03 */ sra $t9, $t8, 0x10 -/* 017DE4 800171E4 25EF4688 */ addiu $t7, %lo(D_80164688) # addiu $t7, $t7, 0x4688 -/* 017DE8 800171E8 03201025 */ move $v0, $t9 -/* 017DEC 800171EC 00006810 */ mfhi $t5 -/* 017DF0 800171F0 01CF1821 */ addu $v1, $t6, $t7 -/* 017DF4 800171F4 15000002 */ bnez $t0, .L80017200 -/* 017DF8 800171F8 00000000 */ nop -/* 017DFC 800171FC 0007000D */ break 7 -.L80017200: -/* 017E00 80017200 2401FFFF */ li $at, -1 -/* 017E04 80017204 15010004 */ bne $t0, $at, .L80017218 -/* 017E08 80017208 3C018000 */ lui $at, 0x8000 -/* 017E0C 8001720C 15810002 */ bne $t4, $at, .L80017218 -/* 017E10 80017210 00000000 */ nop -/* 017E14 80017214 0006000D */ break 6 -.L80017218: -/* 017E18 80017218 A7AD006C */ sh $t5, 0x6c($sp) -/* 017E1C 8001721C 8C650000 */ lw $a1, ($v1) -/* 017E20 80017220 AFA30044 */ sw $v1, 0x44($sp) -/* 017E24 80017224 3044FFFF */ andi $a0, $v0, 0xffff -/* 017E28 80017228 0C002EF6 */ jal func_8000BBD8 -/* 017E2C 8001722C AFA6003C */ sw $a2, 0x3c($sp) -/* 017E30 80017230 3C038016 */ lui $v1, %hi(D_80162FA0) # $v1, 0x8016 -/* 017E34 80017234 24632FA0 */ addiu $v1, %lo(D_80162FA0) # addiu $v1, $v1, 0x2fa0 -/* 017E38 80017238 C4660000 */ lwc1 $f6, ($v1) -/* 017E3C 8001723C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 017E40 80017240 44810800 */ mtc1 $at, $f1 -/* 017E44 80017244 44800000 */ mtc1 $zero, $f0 -/* 017E48 80017248 46003221 */ cvt.d.s $f8, $f6 -/* 017E4C 8001724C C4660008 */ lwc1 $f6, 8($v1) -/* 017E50 80017250 46204282 */ mul.d $f10, $f8, $f0 -/* 017E54 80017254 8FB80044 */ lw $t8, 0x44($sp) -/* 017E58 80017258 46003221 */ cvt.d.s $f8, $f6 -/* 017E5C 8001725C 97A4006C */ lhu $a0, 0x6c($sp) -/* 017E60 80017260 87A6003E */ lh $a2, 0x3e($sp) -/* 017E64 80017264 46205120 */ cvt.s.d $f4, $f10 -/* 017E68 80017268 46204282 */ mul.d $f10, $f8, $f0 -/* 017E6C 8001726C E7A4008C */ swc1 $f4, 0x8c($sp) -/* 017E70 80017270 46205120 */ cvt.s.d $f4, $f10 -/* 017E74 80017274 E7A40084 */ swc1 $f4, 0x84($sp) -/* 017E78 80017278 0C002EF6 */ jal func_8000BBD8 -/* 017E7C 8001727C 8F050000 */ lw $a1, ($t8) -/* 017E80 80017280 3C038016 */ lui $v1, %hi(D_80162FA0) # $v1, 0x8016 -/* 017E84 80017284 24632FA0 */ addiu $v1, %lo(D_80162FA0) # addiu $v1, $v1, 0x2fa0 -/* 017E88 80017288 C46A0000 */ lwc1 $f10, ($v1) -/* 017E8C 8001728C C7A6008C */ lwc1 $f6, 0x8c($sp) -/* 017E90 80017290 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 017E94 80017294 44810800 */ mtc1 $at, $f1 -/* 017E98 80017298 44800000 */ mtc1 $zero, $f0 -/* 017E9C 8001729C 46005121 */ cvt.d.s $f4, $f10 -/* 017EA0 800172A0 46003221 */ cvt.d.s $f8, $f6 -/* 017EA4 800172A4 46202182 */ mul.d $f6, $f4, $f0 -/* 017EA8 800172A8 8FAB0058 */ lw $t3, 0x58($sp) -/* 017EAC 800172AC 8FB90040 */ lw $t9, 0x40($sp) -/* 017EB0 800172B0 87A6003E */ lh $a2, 0x3e($sp) -/* 017EB4 800172B4 46264280 */ add.d $f10, $f8, $f6 -/* 017EB8 800172B8 C7A80084 */ lwc1 $f8, 0x84($sp) -/* 017EBC 800172BC 46205120 */ cvt.s.d $f4, $f10 -/* 017EC0 800172C0 C46A0008 */ lwc1 $f10, 8($v1) -/* 017EC4 800172C4 460041A1 */ cvt.d.s $f6, $f8 -/* 017EC8 800172C8 E7A4008C */ swc1 $f4, 0x8c($sp) -/* 017ECC 800172CC 46005121 */ cvt.d.s $f4, $f10 -/* 017ED0 800172D0 46202202 */ mul.d $f8, $f4, $f0 -/* 017ED4 800172D4 46283280 */ add.d $f10, $f6, $f8 -/* 017ED8 800172D8 46205120 */ cvt.s.d $f4, $f10 -/* 017EDC 800172DC E7A40084 */ swc1 $f4, 0x84($sp) -/* 017EE0 800172E0 87270000 */ lh $a3, ($t9) -/* 017EE4 800172E4 24EC0005 */ addiu $t4, $a3, 5 -/* 017EE8 800172E8 018B001A */ div $zero, $t4, $t3 -/* 017EEC 800172EC 24EF0006 */ addiu $t7, $a3, 6 -/* 017EF0 800172F0 00001010 */ mfhi $v0 -/* 017EF4 800172F4 00026C00 */ sll $t5, $v0, 0x10 -/* 017EF8 800172F8 15600002 */ bnez $t3, .L80017304 -/* 017EFC 800172FC 00000000 */ nop -/* 017F00 80017300 0007000D */ break 7 -.L80017304: -/* 017F04 80017304 2401FFFF */ li $at, -1 -/* 017F08 80017308 15610004 */ bne $t3, $at, .L8001731C -/* 017F0C 8001730C 3C018000 */ lui $at, 0x8000 -/* 017F10 80017310 15810002 */ bne $t4, $at, .L8001731C -/* 017F14 80017314 00000000 */ nop -/* 017F18 80017318 0006000D */ break 6 -.L8001731C: -/* 017F1C 8001731C 01EB001A */ div $zero, $t7, $t3 -/* 017F20 80017320 8FAC005C */ lw $t4, 0x5c($sp) -/* 017F24 80017324 000D7403 */ sra $t6, $t5, 0x10 -/* 017F28 80017328 01C01025 */ move $v0, $t6 -/* 017F2C 8001732C 3C0E8016 */ lui $t6, %hi(D_80164550) # $t6, 0x8016 -/* 017F30 80017330 00004810 */ mfhi $t1 -/* 017F34 80017334 25CE4550 */ addiu $t6, %lo(D_80164550) # addiu $t6, $t6, 0x4550 -/* 017F38 80017338 000C6880 */ sll $t5, $t4, 2 -/* 017F3C 8001733C 0009C400 */ sll $t8, $t1, 0x10 -/* 017F40 80017340 01AE5021 */ addu $t2, $t5, $t6 -/* 017F44 80017344 8D480000 */ lw $t0, ($t2) -/* 017F48 80017348 0018CC03 */ sra $t9, $t8, 0x10 -/* 017F4C 8001734C 15600002 */ bnez $t3, .L80017358 -/* 017F50 80017350 00000000 */ nop -/* 017F54 80017354 0007000D */ break 7 -.L80017358: -/* 017F58 80017358 2401FFFF */ li $at, -1 -/* 017F5C 8001735C 15610004 */ bne $t3, $at, .L80017370 -/* 017F60 80017360 3C018000 */ lui $at, 0x8000 -/* 017F64 80017364 15E10002 */ bne $t7, $at, .L80017370 -/* 017F68 80017368 00000000 */ nop -/* 017F6C 8001736C 0006000D */ break 6 -.L80017370: -/* 017F70 80017370 001978C0 */ sll $t7, $t9, 3 -/* 017F74 80017374 03204825 */ move $t1, $t9 -/* 017F78 80017378 010FC021 */ addu $t8, $t0, $t7 -/* 017F7C 8001737C 87190002 */ lh $t9, 2($t8) -/* 017F80 80017380 24F80001 */ addiu $t8, $a3, 1 -/* 017F84 80017384 030B001A */ div $zero, $t8, $t3 -/* 017F88 80017388 000260C0 */ sll $t4, $v0, 3 -/* 017F8C 8001738C 010C6821 */ addu $t5, $t0, $t4 -/* 017F90 80017390 85AE0002 */ lh $t6, 2($t5) -/* 017F94 80017394 00001010 */ mfhi $v0 -/* 017F98 80017398 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 017F9C 8001739C 032E7821 */ addu $t7, $t9, $t6 -/* 017FA0 800173A0 24F90002 */ addiu $t9, $a3, 2 -/* 017FA4 800173A4 032B001A */ div $zero, $t9, $t3 -/* 017FA8 800173A8 448F3000 */ mtc1 $t7, $f6 -/* 017FAC 800173AC 44815000 */ mtc1 $at, $f10 -/* 017FB0 800173B0 00026400 */ sll $t4, $v0, 0x10 -/* 017FB4 800173B4 46803220 */ cvt.s.w $f8, $f6 -/* 017FB8 800173B8 000C6C03 */ sra $t5, $t4, 0x10 -/* 017FBC 800173BC 01A01025 */ move $v0, $t5 -/* 017FC0 800173C0 00007810 */ mfhi $t7 -/* 017FC4 800173C4 3044FFFF */ andi $a0, $v0, 0xffff -/* 017FC8 800173C8 460A4102 */ mul.s $f4, $f8, $f10 -/* 017FCC 800173CC E7A40088 */ swc1 $f4, 0x88($sp) -/* 017FD0 800173D0 15600002 */ bnez $t3, .L800173DC -/* 017FD4 800173D4 00000000 */ nop -/* 017FD8 800173D8 0007000D */ break 7 -.L800173DC: -/* 017FDC 800173DC 2401FFFF */ li $at, -1 -/* 017FE0 800173E0 15610004 */ bne $t3, $at, .L800173F4 -/* 017FE4 800173E4 3C018000 */ lui $at, 0x8000 -/* 017FE8 800173E8 17010002 */ bne $t8, $at, .L800173F4 -/* 017FEC 800173EC 00000000 */ nop -/* 017FF0 800173F0 0006000D */ break 6 -.L800173F4: -/* 017FF4 800173F4 8FB80044 */ lw $t8, 0x44($sp) -/* 017FF8 800173F8 15600002 */ bnez $t3, .L80017404 -/* 017FFC 800173FC 00000000 */ nop -/* 018000 80017400 0007000D */ break 7 -.L80017404: -/* 018004 80017404 2401FFFF */ li $at, -1 -/* 018008 80017408 15610004 */ bne $t3, $at, .L8001741C -/* 01800C 8001740C 3C018000 */ lui $at, 0x8000 -/* 018010 80017410 17210002 */ bne $t9, $at, .L8001741C -/* 018014 80017414 00000000 */ nop -/* 018018 80017418 0006000D */ break 6 -.L8001741C: -/* 01801C 8001741C 8F050000 */ lw $a1, ($t8) -/* 018020 80017420 AFAA002C */ sw $t2, 0x2c($sp) -/* 018024 80017424 A7AF006C */ sh $t7, 0x6c($sp) -/* 018028 80017428 0C002EF6 */ jal func_8000BBD8 -/* 01802C 8001742C A7A2006E */ sh $v0, 0x6e($sp) -/* 018030 80017430 3C038016 */ lui $v1, %hi(D_80162FA0) # $v1, 0x8016 -/* 018034 80017434 24632FA0 */ addiu $v1, %lo(D_80162FA0) # addiu $v1, $v1, 0x2fa0 -/* 018038 80017438 C4660000 */ lwc1 $f6, ($v1) -/* 01803C 8001743C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 018040 80017440 44810800 */ mtc1 $at, $f1 -/* 018044 80017444 44800000 */ mtc1 $zero, $f0 -/* 018048 80017448 C4640008 */ lwc1 $f4, 8($v1) -/* 01804C 8001744C 46003221 */ cvt.d.s $f8, $f6 -/* 018050 80017450 8FAC0044 */ lw $t4, 0x44($sp) -/* 018054 80017454 46204282 */ mul.d $f10, $f8, $f0 -/* 018058 80017458 460021A1 */ cvt.d.s $f6, $f4 -/* 01805C 8001745C 8D850000 */ lw $a1, ($t4) -/* 018060 80017460 97A4006C */ lhu $a0, 0x6c($sp) -/* 018064 80017464 46203202 */ mul.d $f8, $f6, $f0 -/* 018068 80017468 87A6003E */ lh $a2, 0x3e($sp) -/* 01806C 8001746C 462053A0 */ cvt.s.d $f14, $f10 -/* 018070 80017470 46204420 */ cvt.s.d $f16, $f8 -/* 018074 80017474 E7AE0098 */ swc1 $f14, 0x98($sp) -/* 018078 80017478 0C002EF6 */ jal func_8000BBD8 -/* 01807C 8001747C E7B00090 */ swc1 $f16, 0x90($sp) -/* 018080 80017480 3C038016 */ lui $v1, %hi(D_80162FA0) # $v1, 0x8016 -/* 018084 80017484 24632FA0 */ addiu $v1, %lo(D_80162FA0) # addiu $v1, $v1, 0x2fa0 -/* 018088 80017488 C4640000 */ lwc1 $f4, ($v1) -/* 01808C 8001748C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 018090 80017490 44810800 */ mtc1 $at, $f1 -/* 018094 80017494 44800000 */ mtc1 $zero, $f0 -/* 018098 80017498 460021A1 */ cvt.d.s $f6, $f4 -/* 01809C 8001749C C7AE0098 */ lwc1 $f14, 0x98($sp) -/* 0180A0 800174A0 46203202 */ mul.d $f8, $f6, $f0 -/* 0180A4 800174A4 8FAD002C */ lw $t5, 0x2c($sp) -/* 0180A8 800174A8 460072A1 */ cvt.d.s $f10, $f14 -/* 0180AC 800174AC 87A2006E */ lh $v0, 0x6e($sp) -/* 0180B0 800174B0 87B9006C */ lh $t9, 0x6c($sp) -/* 0180B4 800174B4 8DA80000 */ lw $t0, ($t5) -/* 0180B8 800174B8 000260C0 */ sll $t4, $v0, 3 -/* 0180BC 800174BC 001970C0 */ sll $t6, $t9, 3 -/* 0180C0 800174C0 46285100 */ add.d $f4, $f10, $f8 -/* 0180C4 800174C4 C46A0008 */ lwc1 $f10, 8($v1) -/* 0180C8 800174C8 010E7821 */ addu $t7, $t0, $t6 -/* 0180CC 800174CC 010C6821 */ addu $t5, $t0, $t4 -/* 0180D0 800174D0 46005221 */ cvt.d.s $f8, $f10 -/* 0180D4 800174D4 462023A0 */ cvt.s.d $f14, $f4 -/* 0180D8 800174D8 46204102 */ mul.d $f4, $f8, $f0 -/* 0180DC 800174DC 85B90002 */ lh $t9, 2($t5) -/* 0180E0 800174E0 85F80002 */ lh $t8, 2($t7) -/* 0180E4 800174E4 C7B00090 */ lwc1 $f16, 0x90($sp) -/* 0180E8 800174E8 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0180EC 800174EC 03197021 */ addu $t6, $t8, $t9 -/* 0180F0 800174F0 448E4000 */ mtc1 $t6, $f8 -/* 0180F4 800174F4 460081A1 */ cvt.d.s $f6, $f16 -/* 0180F8 800174F8 8FA7004C */ lw $a3, 0x4c($sp) -/* 0180FC 800174FC 46243280 */ add.d $f10, $f6, $f4 -/* 018100 80017500 44812000 */ mtc1 $at, $f4 -/* 018104 80017504 3C0F8016 */ lui $t7, %hi(D_801645F8) # $t7, 0x8016 -/* 018108 80017508 468041A0 */ cvt.s.w $f6, $f8 -/* 01810C 8001750C 25EF45F8 */ addiu $t7, %lo(D_801645F8) # addiu $t7, $t7, 0x45f8 -/* 018110 80017510 3C0C8016 */ lui $t4, %hi(D_80164618) # $t4, 0x8016 -/* 018114 80017514 00EF2021 */ addu $a0, $a3, $t7 -/* 018118 80017518 C4880000 */ lwc1 $f8, ($a0) -/* 01811C 8001751C 46205420 */ cvt.s.d $f16, $f10 -/* 018120 80017520 46043282 */ mul.s $f10, $f6, $f4 -/* 018124 80017524 258C4618 */ addiu $t4, %lo(D_80164618) # addiu $t4, $t4, 0x4618 -/* 018128 80017528 00EC2821 */ addu $a1, $a3, $t4 -/* 01812C 8001752C C4A60000 */ lwc1 $f6, ($a1) -/* 018130 80017530 3C0D8016 */ lui $t5, %hi(D_80164638) # $t5, 0x8016 -/* 018134 80017534 46087481 */ sub.s $f18, $f14, $f8 -/* 018138 80017538 25AD4638 */ addiu $t5, %lo(D_80164638) # addiu $t5, $t5, 0x4638 -/* 01813C 8001753C E7AA0094 */ swc1 $f10, 0x94($sp) -/* 018140 80017540 46065081 */ sub.s $f2, $f10, $f6 -/* 018144 80017544 00ED3021 */ addu $a2, $a3, $t5 -/* 018148 80017548 46129282 */ mul.s $f10, $f18, $f18 -/* 01814C 8001754C C4C40000 */ lwc1 $f4, ($a2) -/* 018150 80017550 AFA6003C */ sw $a2, 0x3c($sp) -/* 018154 80017554 46021182 */ mul.s $f6, $f2, $f2 -/* 018158 80017558 E7A2007C */ swc1 $f2, 0x7c($sp) -/* 01815C 8001755C 46048201 */ sub.s $f8, $f16, $f4 -/* 018160 80017560 E7B20080 */ swc1 $f18, 0x80($sp) -/* 018164 80017564 AFA50040 */ sw $a1, 0x40($sp) -/* 018168 80017568 AFA40044 */ sw $a0, 0x44($sp) -/* 01816C 8001756C E7A80078 */ swc1 $f8, 0x78($sp) -/* 018170 80017570 C7A80078 */ lwc1 $f8, 0x78($sp) -/* 018174 80017574 46065100 */ add.s $f4, $f10, $f6 -/* 018178 80017578 46084282 */ mul.s $f10, $f8, $f8 -/* 01817C 8001757C 0C033850 */ jal sqrtf -/* 018180 80017580 460A2300 */ add.s $f12, $f4, $f10 -/* 018184 80017584 44803800 */ mtc1 $zero, $f7 -/* 018188 80017588 44803000 */ mtc1 $zero, $f6 -/* 01818C 8001758C 46000221 */ cvt.d.s $f8, $f0 -/* 018190 80017590 8FA40044 */ lw $a0, 0x44($sp) -/* 018194 80017594 46283032 */ c.eq.d $f6, $f8 -/* 018198 80017598 8FA50040 */ lw $a1, 0x40($sp) -/* 01819C 8001759C 8FA6003C */ lw $a2, 0x3c($sp) -/* 0181A0 800175A0 C7B20080 */ lwc1 $f18, 0x80($sp) -/* 0181A4 800175A4 45010013 */ bc1t .L800175F4 -/* 0181A8 800175A8 3C01800F */ lui $at, %hi(D_800ED270) -/* 0181AC 800175AC 8FB80048 */ lw $t8, 0x48($sp) -/* 0181B0 800175B0 C7A8007C */ lwc1 $f8, 0x7c($sp) -/* 0181B4 800175B4 C4860000 */ lwc1 $f6, ($a0) -/* 0181B8 800175B8 C7020000 */ lwc1 $f2, ($t8) -/* 0181BC 800175BC 46121102 */ mul.s $f4, $f2, $f18 -/* 0181C0 800175C0 46002283 */ div.s $f10, $f4, $f0 -/* 0181C4 800175C4 46081102 */ mul.s $f4, $f2, $f8 -/* 0181C8 800175C8 46065380 */ add.s $f14, $f10, $f6 -/* 0181CC 800175CC C4A60000 */ lwc1 $f6, ($a1) -/* 0181D0 800175D0 46002283 */ div.s $f10, $f4, $f0 -/* 0181D4 800175D4 C7A40078 */ lwc1 $f4, 0x78($sp) -/* 0181D8 800175D8 46065200 */ add.s $f8, $f10, $f6 -/* 0181DC 800175DC 46041282 */ mul.s $f10, $f2, $f4 -/* 0181E0 800175E0 E7A80094 */ swc1 $f8, 0x94($sp) -/* 0181E4 800175E4 C4C80000 */ lwc1 $f8, ($a2) -/* 0181E8 800175E8 46005183 */ div.s $f6, $f10, $f0 -/* 0181EC 800175EC 10000005 */ b .L80017604 -/* 0181F0 800175F0 46083400 */ add.s $f16, $f6, $f8 -.L800175F4: -/* 0181F4 800175F4 C4A40000 */ lwc1 $f4, ($a1) -/* 0181F8 800175F8 C48E0000 */ lwc1 $f14, ($a0) -/* 0181FC 800175FC C4D00000 */ lwc1 $f16, ($a2) -/* 018200 80017600 E7A40094 */ swc1 $f4, 0x94($sp) -.L80017604: -/* 018204 80017604 D422D270 */ ldc1 $f2, %lo(D_800ED270)($at) -/* 018208 80017608 46007021 */ cvt.d.s $f0, $f14 -/* 01820C 8001760C 44804000 */ mtc1 $zero, $f8 -/* 018210 80017610 4622003C */ c.lt.d $f0, $f2 -/* 018214 80017614 3C01800F */ lui $at, %hi(D_800ED278) -/* 018218 80017618 C7B2008C */ lwc1 $f18, 0x8c($sp) -/* 01821C 8001761C 45010006 */ bc1t .L80017638 -/* 018220 80017620 00000000 */ nop -/* 018224 80017624 D42CD278 */ ldc1 $f12, %lo(D_800ED278)($at) -/* 018228 80017628 4620603C */ c.lt.d $f12, $f0 -/* 01822C 8001762C 00000000 */ nop -/* 018230 80017630 45020002 */ bc1fl .L8001763C -/* 018234 80017634 E60E0000 */ swc1 $f14, ($s0) -.L80017638: -/* 018238 80017638 E60E0000 */ swc1 $f14, ($s0) -.L8001763C: -/* 01823C 8001763C E6100008 */ swc1 $f16, 8($s0) -/* 018240 80017640 C7AA0094 */ lwc1 $f10, 0x94($sp) -/* 018244 80017644 3C014024 */ li $at, 0x40240000 # 2.562500 -/* 018248 80017648 44814800 */ mtc1 $at, $f9 -/* 01824C 8001764C 460051A1 */ cvt.d.s $f6, $f10 -/* 018250 80017650 3C014020 */ li $at, 0x40200000 # 2.500000 -/* 018254 80017654 46283100 */ add.d $f4, $f6, $f8 -/* 018258 80017658 462022A0 */ cvt.s.d $f10, $f4 -/* 01825C 8001765C 44815800 */ mtc1 $at, $f11 -/* 018260 80017660 E60A0004 */ swc1 $f10, 4($s0) -/* 018264 80017664 C7A60094 */ lwc1 $f6, 0x94($sp) -/* 018268 80017668 E48E0000 */ swc1 $f14, ($a0) -/* 01826C 8001766C E4D00000 */ swc1 $f16, ($a2) -/* 018270 80017670 E4A60000 */ swc1 $f6, ($a1) -/* 018274 80017674 C7AE0084 */ lwc1 $f14, 0x84($sp) -/* 018278 80017678 E612000C */ swc1 $f18, 0xc($s0) -/* 01827C 8001767C C7A80088 */ lwc1 $f8, 0x88($sp) -/* 018280 80017680 44805000 */ mtc1 $zero, $f10 -/* 018284 80017684 E60E0014 */ swc1 $f14, 0x14($s0) -/* 018288 80017688 46004121 */ cvt.d.s $f4, $f8 -/* 01828C 8001768C 462A2180 */ add.d $f6, $f4, $f10 -/* 018290 80017690 46203220 */ cvt.s.d $f8, $f6 -/* 018294 80017694 E6080010 */ swc1 $f8, 0x10($s0) -/* 018298 80017698 8FA5005C */ lw $a1, 0x5c($sp) -/* 01829C 8001769C 0C00534C */ jal func_80014D30 -/* 0182A0 800176A0 8FA400C4 */ lw $a0, 0xc4($sp) -/* 0182A4 800176A4 C604000C */ lwc1 $f4, 0xc($s0) -/* 0182A8 800176A8 C60A0000 */ lwc1 $f10, ($s0) -/* 0182AC 800176AC C6060010 */ lwc1 $f6, 0x10($s0) -/* 0182B0 800176B0 C6080004 */ lwc1 $f8, 4($s0) -/* 0182B4 800176B4 460A2301 */ sub.s $f12, $f4, $f10 -/* 0182B8 800176B8 46083101 */ sub.s $f4, $f6, $f8 -/* 0182BC 800176BC E7A400A8 */ swc1 $f4, 0xa8($sp) -/* 0182C0 800176C0 C6060008 */ lwc1 $f6, 8($s0) -/* 0182C4 800176C4 C60A0014 */ lwc1 $f10, 0x14($s0) -/* 0182C8 800176C8 E7AC00AC */ swc1 $f12, 0xac($sp) -/* 0182CC 800176CC 46065381 */ sub.s $f14, $f10, $f6 -/* 0182D0 800176D0 0C0ADE0C */ jal atan2s -/* 0182D4 800176D4 E7AE00A4 */ swc1 $f14, 0xa4($sp) -/* 0182D8 800176D8 C7A000AC */ lwc1 $f0, 0xac($sp) -/* 0182DC 800176DC C7AE00A4 */ lwc1 $f14, 0xa4($sp) -/* 0182E0 800176E0 A6020026 */ sh $v0, 0x26($s0) -/* 0182E4 800176E4 46000202 */ mul.s $f8, $f0, $f0 -/* 0182E8 800176E8 00000000 */ nop -/* 0182EC 800176EC 460E7102 */ mul.s $f4, $f14, $f14 -/* 0182F0 800176F0 0C033850 */ jal sqrtf -/* 0182F4 800176F4 46044300 */ add.s $f12, $f8, $f4 -/* 0182F8 800176F8 46000306 */ mov.s $f12, $f0 -/* 0182FC 800176FC 0C0ADE0C */ jal atan2s -/* 018300 80017700 C7AE00A8 */ lwc1 $f14, 0xa8($sp) -/* 018304 80017704 A6020024 */ sh $v0, 0x24($s0) -/* 018308 80017708 A6000028 */ sh $zero, 0x28($s0) -/* 01830C 8001770C 8FBF0024 */ lw $ra, 0x24($sp) -/* 018310 80017710 8FB00020 */ lw $s0, 0x20($sp) -/* 018314 80017714 27BD00B8 */ addiu $sp, $sp, 0xb8 -/* 018318 80017718 03E00008 */ jr $ra -/* 01831C 8001771C 00000000 */ nop diff --git a/asm/non_matchings/code_80005FD0/func_80019FB4.s b/asm/non_matchings/code_80005FD0/func_80019FB4.s deleted file mode 100644 index 924ed26256..0000000000 --- a/asm/non_matchings/code_80005FD0/func_80019FB4.s +++ /dev/null @@ -1,69 +0,0 @@ -glabel func_80019FB4 -/* 01ABB4 80019FB4 3C0F800E */ lui $t7, %hi(gControllerOne) -/* 01ABB8 80019FB8 8DEFC4BC */ lw $t7, %lo(gControllerOne)($t7) -/* 01ABBC 80019FBC 00047100 */ sll $t6, $a0, 4 -/* 01ABC0 80019FC0 3C088016 */ lui $t0, %hi(D_801645D0) # $t0, 0x8016 -/* 01ABC4 80019FC4 01CF1021 */ addu $v0, $t6, $t7 -/* 01ABC8 80019FC8 94580006 */ lhu $t8, 6($v0) -/* 01ABCC 80019FCC 250845D0 */ addiu $t0, %lo(D_801645D0) # addiu $t0, $t0, 0x45d0 -/* 01ABD0 80019FD0 00041880 */ sll $v1, $a0, 2 -/* 01ABD4 80019FD4 33190002 */ andi $t9, $t8, 2 -/* 01ABD8 80019FD8 13200005 */ beqz $t9, .L80019FF0 -/* 01ABDC 80019FDC 00682821 */ addu $a1, $v1, $t0 -/* 01ABE0 80019FE0 8CA90000 */ lw $t1, ($a1) -/* 01ABE4 80019FE4 252A0001 */ addiu $t2, $t1, 1 -/* 01ABE8 80019FE8 10000005 */ b .L8001A000 -/* 01ABEC 80019FEC ACAA0000 */ sw $t2, ($a1) -.L80019FF0: -/* 01ABF0 80019FF0 00041880 */ sll $v1, $a0, 2 -/* 01ABF4 80019FF4 3C018016 */ lui $at, %hi(D_801645D0) # 0x8016 -/* 01ABF8 80019FF8 00230821 */ addu $at, $at, $v1 -/* 01ABFC 80019FFC AC2045D0 */ sw $zero, %lo(D_801645D0)($at) # 0x45d0($at) -.L8001A000: -/* 01AC00 8001A000 944B0006 */ lhu $t3, 6($v0) -/* 01AC04 8001A004 3C0D8016 */ lui $t5, %hi(D_801645E8) # $t5, 0x8016 -/* 01AC08 8001A008 25AD45E8 */ addiu $t5, %lo(D_801645E8) # addiu $t5, $t5, 0x45e8 -/* 01AC0C 8001A00C 316C0004 */ andi $t4, $t3, 4 -/* 01AC10 8001A010 11800005 */ beqz $t4, .L8001A028 -/* 01AC14 8001A014 006D2021 */ addu $a0, $v1, $t5 -/* 01AC18 8001A018 8C8E0000 */ lw $t6, ($a0) -/* 01AC1C 8001A01C 25CF0001 */ addiu $t7, $t6, 1 -/* 01AC20 8001A020 10000004 */ b .L8001A034 -/* 01AC24 8001A024 AC8F0000 */ sw $t7, ($a0) -.L8001A028: -/* 01AC28 8001A028 3C018016 */ lui $at, %hi(D_801645E8) # 0x8016 -/* 01AC2C 8001A02C 00230821 */ addu $at, $at, $v1 -/* 01AC30 8001A030 AC2045E8 */ sw $zero, %lo(D_801645E8)($at) # 0x45e8($at) -.L8001A034: -/* 01AC34 8001A034 94580006 */ lhu $t8, 6($v0) -/* 01AC38 8001A038 3C088016 */ lui $t0, %hi(D_80164608) # $t0, 0x8016 -/* 01AC3C 8001A03C 25084608 */ addiu $t0, %lo(D_80164608) # addiu $t0, $t0, 0x4608 -/* 01AC40 8001A040 33190008 */ andi $t9, $t8, 8 -/* 01AC44 8001A044 13200005 */ beqz $t9, .L8001A05C -/* 01AC48 8001A048 00682021 */ addu $a0, $v1, $t0 -/* 01AC4C 8001A04C 8C890000 */ lw $t1, ($a0) -/* 01AC50 8001A050 252A0001 */ addiu $t2, $t1, 1 -/* 01AC54 8001A054 10000004 */ b .L8001A068 -/* 01AC58 8001A058 AC8A0000 */ sw $t2, ($a0) -.L8001A05C: -/* 01AC5C 8001A05C 3C018016 */ lui $at, %hi(D_80164608) # 0x8016 -/* 01AC60 8001A060 00230821 */ addu $at, $at, $v1 -/* 01AC64 8001A064 AC204608 */ sw $zero, %lo(D_80164608)($at) # 0x4608($at) -.L8001A068: -/* 01AC68 8001A068 944B0006 */ lhu $t3, 6($v0) -/* 01AC6C 8001A06C 3C0D8016 */ lui $t5, %hi(D_80164628) # $t5, 0x8016 -/* 01AC70 8001A070 25AD4628 */ addiu $t5, %lo(D_80164628) # addiu $t5, $t5, 0x4628 -/* 01AC74 8001A074 316C0001 */ andi $t4, $t3, 1 -/* 01AC78 8001A078 11800005 */ beqz $t4, .L8001A090 -/* 01AC7C 8001A07C 006D1021 */ addu $v0, $v1, $t5 -/* 01AC80 8001A080 8C4E0000 */ lw $t6, ($v0) -/* 01AC84 8001A084 25CF0001 */ addiu $t7, $t6, 1 -/* 01AC88 8001A088 03E00008 */ jr $ra -/* 01AC8C 8001A08C AC4F0000 */ sw $t7, ($v0) - -.L8001A090: -/* 01AC90 8001A090 3C018016 */ lui $at, %hi(D_80164628) # 0x8016 -/* 01AC94 8001A094 00230821 */ addu $at, $at, $v1 -/* 01AC98 8001A098 AC204628 */ sw $zero, %lo(D_80164628)($at) # 0x4628($at) -/* 01AC9C 8001A09C 03E00008 */ jr $ra -/* 01ACA0 8001A0A0 00000000 */ nop diff --git a/asm/non_matchings/code_80005FD0/kart_ai_use_item_strategy.s b/asm/non_matchings/code_80005FD0/kart_ai_use_item_strategy.s deleted file mode 100644 index 7a18f71dbe..0000000000 --- a/asm/non_matchings/code_80005FD0/kart_ai_use_item_strategy.s +++ /dev/null @@ -1,1303 +0,0 @@ -.section .late_rodata - -glabel jpt_800ED404 -.word L8001ACAC, L8001AD64, L8001AF34, L8001AFD8 -.word L8001B4AC, L8001B528, L8001B5B8, L8001B630 -.word L8001B6AC, L8001B738, L8001B7BC, L8001B838 -.word L8001B90C, L8001BA38, L8001BA98, L8001BB30 -.word L8001BE30, L8001BE30, L8001BE30, L8001BE30 -.word L8001BE30, L8001BE30, L8001BC28, L8001BC64 -.word L8001BE30, L8001BC8C, L8001BCBC, L8001BCE0 -.word L8001BD10, L8001BD34, L8001BD60, L8001BD94 -.word L8001BDC8, L8001BDE4, L8001B0EC, L8001B2C4 -.word L8001B3B4 - -glabel D_800ED498 -.double 0.4 - -glabel jpt_800ED4A0 -.word L8001B970, L8001B988, L8001B9A0, L8001B9B8 -.word L8001B9D0 - -.section .text - -glabel kart_ai_use_item_strategy -/* 01B810 8001AC10 000478C0 */ sll $t7, $a0, 3 -/* 01B814 8001AC14 01E47823 */ subu $t7, $t7, $a0 -/* 01B818 8001AC18 000F7900 */ sll $t7, $t7, 4 -/* 01B81C 8001AC1C 01E47823 */ subu $t7, $t7, $a0 -/* 01B820 8001AC20 3C18800E */ lui $t8, %hi(gPlayerOne) -/* 01B824 8001AC24 8F18C4DC */ lw $t8, %lo(gPlayerOne)($t8) -/* 01B828 8001AC28 000F7880 */ sll $t7, $t7, 2 -/* 01B82C 8001AC2C 3C0B800E */ lui $t3, %hi(gModeSelection) -/* 01B830 8001AC30 8D6BC53C */ lw $t3, %lo(gModeSelection)($t3) -/* 01B834 8001AC34 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 01B838 8001AC38 01E47823 */ subu $t7, $t7, $a0 -/* 01B83C 8001AC3C 000F78C0 */ sll $t7, $t7, 3 -/* 01B840 8001AC40 24080001 */ li $t0, 1 -/* 01B844 8001AC44 01F8C821 */ addu $t9, $t7, $t8 -/* 01B848 8001AC48 AFBF0024 */ sw $ra, 0x24($sp) -/* 01B84C 8001AC4C AFB00020 */ sw $s0, 0x20($sp) -/* 01B850 8001AC50 AFA40030 */ sw $a0, 0x30($sp) -/* 01B854 8001AC54 110B0483 */ beq $t0, $t3, .L8001BE64 -/* 01B858 8001AC58 AFB9002C */ sw $t9, 0x2c($sp) -/* 01B85C 8001AC5C 3C0C8016 */ lui $t4, %hi(D_801646CC) # $t4, 0x8016 -/* 01B860 8001AC60 958C46CC */ lhu $t4, %lo(D_801646CC)($t4) -/* 01B864 8001AC64 510C0480 */ beql $t0, $t4, .L8001BE68 -/* 01B868 8001AC68 8FBF0024 */ lw $ra, 0x24($sp) -/* 01B86C 8001AC6C 972E0000 */ lhu $t6, ($t9) -/* 01B870 8001AC70 3C0B8016 */ lui $t3, %hi(D_801642D8) # $t3, 0x8016 -/* 01B874 8001AC74 256B42D8 */ addiu $t3, %lo(D_801642D8) # addiu $t3, $t3, 0x42d8 -/* 01B878 8001AC78 31CF0800 */ andi $t7, $t6, 0x800 -/* 01B87C 8001AC7C 15E00479 */ bnez $t7, .L8001BE64 -/* 01B880 8001AC80 0004C900 */ sll $t9, $a0, 4 -/* 01B884 8001AC84 032B8021 */ addu $s0, $t9, $t3 -/* 01B888 8001AC88 86050000 */ lh $a1, ($s0) -/* 01B88C 8001AC8C 2CA10025 */ sltiu $at, $a1, 0x25 -/* 01B890 8001AC90 10200467 */ beqz $at, .L8001BE30 -/* 01B894 8001AC94 00056080 */ sll $t4, $a1, 2 -/* 01B898 8001AC98 3C01800F */ lui $at, %hi(jpt_800ED404) # 0x800f -/* 01B89C 8001AC9C 002C0821 */ addu $at, $at, $t4 -/* 01B8A0 8001ACA0 8C2CD404 */ lw $t4, %lo(jpt_800ED404)($at) # -0x2bfc($at) -/* 01B8A4 8001ACA4 01800008 */ jr $t4 -/* 01B8A8 8001ACA8 00000000 */ nop -glabel L8001ACAC -/* 01B8AC 8001ACAC 2405FFFF */ li $a1, -1 -/* 01B8B0 8001ACB0 A6050002 */ sh $a1, 2($s0) -/* 01B8B4 8001ACB4 8FAD0030 */ lw $t5, 0x30($sp) -/* 01B8B8 8001ACB8 3C0E8016 */ lui $t6, %hi(D_80164450) # 0x8016 -/* 01B8BC 8001ACBC 8FA40030 */ lw $a0, 0x30($sp) -/* 01B8C0 8001ACC0 000D1080 */ sll $v0, $t5, 2 -/* 01B8C4 8001ACC4 01C27021 */ addu $t6, $t6, $v0 -/* 01B8C8 8001ACC8 000D7880 */ sll $t7, $t5, 2 -/* 01B8CC 8001ACCC 8DCE4450 */ lw $t6, %lo(D_80164450)($t6) # 0x4450($t6) -/* 01B8D0 8001ACD0 01ED7821 */ addu $t7, $t7, $t5 -/* 01B8D4 8001ACD4 000F7880 */ sll $t7, $t7, 2 -/* 01B8D8 8001ACD8 25F80064 */ addiu $t8, $t7, 0x64 -/* 01B8DC 8001ACDC 030E082A */ slt $at, $t8, $t6 -/* 01B8E0 8001ACE0 1020001C */ beqz $at, .L8001AD54 -/* 01B8E4 8001ACE4 00000000 */ nop -/* 01B8E8 8001ACE8 86190004 */ lh $t9, 4($s0) -/* 01B8EC 8001ACEC 2B210259 */ slti $at, $t9, 0x259 -/* 01B8F0 8001ACF0 14200018 */ bnez $at, .L8001AD54 -/* 01B8F4 8001ACF4 00000000 */ nop -/* 01B8F8 8001ACF8 860B0006 */ lh $t3, 6($s0) -/* 01B8FC 8001ACFC 3C038016 */ lui $v1, %hi(gLapCountByPlayerId) # 0x8016 -/* 01B900 8001AD00 00621821 */ addu $v1, $v1, $v0 -/* 01B904 8001AD04 29610003 */ slti $at, $t3, 3 -/* 01B908 8001AD08 10200012 */ beqz $at, .L8001AD54 -/* 01B90C 8001AD0C 00000000 */ nop -/* 01B910 8001AD10 8C634390 */ lw $v1, %lo(gLapCountByPlayerId)($v1) # 0x4390($v1) -/* 01B914 8001AD14 3C068016 */ lui $a2, %hi(gGPCurrentRaceRankByPlayerId) # $a2, 0x8016 -/* 01B918 8001AD18 24C643B8 */ addiu $a2, %lo(gGPCurrentRaceRankByPlayerId) # addiu $a2, $a2, 0x43b8 -/* 01B91C 8001AD1C 28610003 */ slti $at, $v1, 3 -/* 01B920 8001AD20 1020000C */ beqz $at, .L8001AD54 -/* 01B924 8001AD24 00C26821 */ addu $t5, $a2, $v0 -/* 01B928 8001AD28 00032400 */ sll $a0, $v1, 0x10 -/* 01B92C 8001AD2C 00046403 */ sra $t4, $a0, 0x10 -/* 01B930 8001AD30 01802025 */ move $a0, $t4 -/* 01B934 8001AD34 0C01EBDE */ jal kart_ai_gen_random_item -/* 01B938 8001AD38 85A50002 */ lh $a1, 2($t5) -/* 01B93C 8001AD3C 8FA40030 */ lw $a0, 0x30($sp) -/* 01B940 8001AD40 02002825 */ move $a1, $s0 -/* 01B944 8001AD44 0C006ADD */ jal kart_ai_decisions_branch_item -/* 01B948 8001AD48 00403025 */ move $a2, $v0 -/* 01B94C 8001AD4C 10000003 */ b .L8001AD5C -/* 01B950 8001AD50 00000000 */ nop -.L8001AD54: -/* 01B954 8001AD54 0C006AF8 */ jal func_8001ABE0 -/* 01B958 8001AD58 02002825 */ move $a1, $s0 -.L8001AD5C: -/* 01B95C 8001AD5C 10000435 */ b .L8001BE34 -/* 01B960 8001AD60 86020004 */ lh $v0, 4($s0) -glabel L8001AD64 -/* 01B964 8001AD64 8FA20030 */ lw $v0, 0x30($sp) -/* 01B968 8001AD68 3C0E8016 */ lui $t6, %hi(gLapCountByPlayerId) # 0x8016 -/* 01B96C 8001AD6C 3C068016 */ lui $a2, %hi(gGPCurrentRaceRankByPlayerId) # $a2, 0x8016 -/* 01B970 8001AD70 00027880 */ sll $t7, $v0, 2 -/* 01B974 8001AD74 01CF7021 */ addu $t6, $t6, $t7 -/* 01B978 8001AD78 8DCE4390 */ lw $t6, %lo(gLapCountByPlayerId)($t6) # 0x4390($t6) -/* 01B97C 8001AD7C 24C643B8 */ addiu $a2, %lo(gGPCurrentRaceRankByPlayerId) # addiu $a2, $a2, 0x43b8 -/* 01B980 8001AD80 3C038016 */ lui $v1, %hi(D_80163478) # $v1, 0x8016 -/* 01B984 8001AD84 19C0004B */ blez $t6, .L8001AEB4 -/* 01B988 8001AD88 00000000 */ nop -/* 01B98C 8001AD8C 84633478 */ lh $v1, %lo(D_80163478)($v1) -/* 01B990 8001AD90 00CF5821 */ addu $t3, $a2, $t7 -/* 01B994 8001AD94 8D6C0000 */ lw $t4, ($t3) -/* 01B998 8001AD98 0003C080 */ sll $t8, $v1, 2 -/* 01B99C 8001AD9C 00D8C821 */ addu $t9, $a2, $t8 -/* 01B9A0 8001ADA0 8F240000 */ lw $a0, ($t9) -/* 01B9A4 8001ADA4 008C082A */ slt $at, $a0, $t4 -/* 01B9A8 8001ADA8 10200042 */ beqz $at, .L8001AEB4 -/* 01B9AC 8001ADAC 00000000 */ nop -/* 01B9B0 8001ADB0 14800040 */ bnez $a0, .L8001AEB4 -/* 01B9B4 8001ADB4 8FAD002C */ lw $t5, 0x2c($sp) -/* 01B9B8 8001ADB8 95A20254 */ lhu $v0, 0x254($t5) -/* 01B9BC 8001ADBC 24010004 */ li $at, 4 -/* 01B9C0 8001ADC0 3C088016 */ lui $t0, %hi(gNearestWaypointByPlayerId) # $t0, 0x8016 -/* 01B9C4 8001ADC4 10410006 */ beq $v0, $at, .L8001ADE0 -/* 01B9C8 8001ADC8 25084438 */ addiu $t0, %lo(gNearestWaypointByPlayerId) # addiu $t0, $t0, 0x4438 -/* 01B9CC 8001ADCC 24060006 */ li $a2, 6 -/* 01B9D0 8001ADD0 10460014 */ beq $v0, $a2, .L8001AE24 -/* 01B9D4 8001ADD4 3C088016 */ lui $t0, %hi(gNearestWaypointByPlayerId) # 0x8016 -/* 01B9D8 8001ADD8 10000024 */ b .L8001AE6C -/* 01B9DC 8001ADDC 3C088016 */ lui $t0, %hi(gNearestWaypointByPlayerId) # $t0, 0x8016 -.L8001ADE0: -/* 01B9E0 8001ADE0 8FAF0030 */ lw $t7, 0x30($sp) -/* 01B9E4 8001ADE4 0003C840 */ sll $t9, $v1, 1 -/* 01B9E8 8001ADE8 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016 -/* 01B9EC 8001ADEC 000F7040 */ sll $t6, $t7, 1 -/* 01B9F0 8001ADF0 958C4430 */ lhu $t4, %lo(D_80164430)($t4) -/* 01B9F4 8001ADF4 010EC021 */ addu $t8, $t0, $t6 -/* 01B9F8 8001ADF8 01195821 */ addu $t3, $t0, $t9 -/* 01B9FC 8001ADFC 95650000 */ lhu $a1, ($t3) -/* 01BA00 8001AE00 97040000 */ lhu $a0, ($t8) -/* 01BA04 8001AE04 24060028 */ li $a2, 40 -/* 01BA08 8001AE08 24070002 */ li $a3, 2 -/* 01BA0C 8001AE0C 0C001EFE */ jal func_80007BF8 -/* 01BA10 8001AE10 AFAC0010 */ sw $t4, 0x10($sp) -/* 01BA14 8001AE14 18400045 */ blez $v0, .L8001AF2C -/* 01BA18 8001AE18 240D0022 */ li $t5, 34 -/* 01BA1C 8001AE1C 10000043 */ b .L8001AF2C -/* 01BA20 8001AE20 A60D0000 */ sh $t5, ($s0) -.L8001AE24: -/* 01BA24 8001AE24 8FAF0030 */ lw $t7, 0x30($sp) -/* 01BA28 8001AE28 25084438 */ addiu $t0, %lo(gNearestWaypointByPlayerId) # addiu $t0, $t0, 0x4438 -/* 01BA2C 8001AE2C 0003C840 */ sll $t9, $v1, 1 -/* 01BA30 8001AE30 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016 -/* 01BA34 8001AE34 000F7040 */ sll $t6, $t7, 1 -/* 01BA38 8001AE38 958C4430 */ lhu $t4, %lo(D_80164430)($t4) -/* 01BA3C 8001AE3C 010EC021 */ addu $t8, $t0, $t6 -/* 01BA40 8001AE40 01195821 */ addu $t3, $t0, $t9 -/* 01BA44 8001AE44 95650000 */ lhu $a1, ($t3) -/* 01BA48 8001AE48 97040000 */ lhu $a0, ($t8) -/* 01BA4C 8001AE4C 24060004 */ li $a2, 4 -/* 01BA50 8001AE50 24070002 */ li $a3, 2 -/* 01BA54 8001AE54 0C001EFE */ jal func_80007BF8 -/* 01BA58 8001AE58 AFAC0010 */ sw $t4, 0x10($sp) -/* 01BA5C 8001AE5C 18400033 */ blez $v0, .L8001AF2C -/* 01BA60 8001AE60 240D0022 */ li $t5, 34 -/* 01BA64 8001AE64 10000031 */ b .L8001AF2C -/* 01BA68 8001AE68 A60D0000 */ sh $t5, ($s0) -.L8001AE6C: -/* 01BA6C 8001AE6C 8FAF0030 */ lw $t7, 0x30($sp) -/* 01BA70 8001AE70 25084438 */ addiu $t0, $t0, %lo(gNearestWaypointByPlayerId) # 0x4438 -/* 01BA74 8001AE74 0003C840 */ sll $t9, $v1, 1 -/* 01BA78 8001AE78 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016 -/* 01BA7C 8001AE7C 000F7040 */ sll $t6, $t7, 1 -/* 01BA80 8001AE80 958C4430 */ lhu $t4, %lo(D_80164430)($t4) -/* 01BA84 8001AE84 010EC021 */ addu $t8, $t0, $t6 -/* 01BA88 8001AE88 01195821 */ addu $t3, $t0, $t9 -/* 01BA8C 8001AE8C 95650000 */ lhu $a1, ($t3) -/* 01BA90 8001AE90 97040000 */ lhu $a0, ($t8) -/* 01BA94 8001AE94 2406000A */ li $a2, 10 -/* 01BA98 8001AE98 24070002 */ li $a3, 2 -/* 01BA9C 8001AE9C 0C001EFE */ jal func_80007BF8 -/* 01BAA0 8001AEA0 AFAC0010 */ sw $t4, 0x10($sp) -/* 01BAA4 8001AEA4 18400021 */ blez $v0, .L8001AF2C -/* 01BAA8 8001AEA8 240D0022 */ li $t5, 34 -/* 01BAAC 8001AEAC 1000001F */ b .L8001AF2C -/* 01BAB0 8001AEB0 A60D0000 */ sh $t5, ($s0) -.L8001AEB4: -/* 01BAB4 8001AEB4 1505001D */ bne $t0, $a1, .L8001AF2C -/* 01BAB8 8001AEB8 00000000 */ nop -/* 01BABC 8001AEBC 0C0ACB5C */ jal use_banana_item -/* 01BAC0 8001AEC0 8FA4002C */ lw $a0, 0x2c($sp) -/* 01BAC4 8001AEC4 A6020002 */ sh $v0, 2($s0) -/* 01BAC8 8001AEC8 86030002 */ lh $v1, 2($s0) -/* 01BACC 8001AECC 04600015 */ bltz $v1, .L8001AF24 -/* 01BAD0 8001AED0 28610064 */ slti $at, $v1, 0x64 -/* 01BAD4 8001AED4 10200013 */ beqz $at, .L8001AF24 -/* 01BAD8 8001AED8 8FAF002C */ lw $t7, 0x2c($sp) -/* 01BADC 8001AEDC 8DEE000C */ lw $t6, 0xc($t7) -/* 01BAE0 8001AEE0 3C010004 */ lui $at, 4 -/* 01BAE4 8001AEE4 24190002 */ li $t9, 2 -/* 01BAE8 8001AEE8 01C1C025 */ or $t8, $t6, $at -/* 01BAEC 8001AEEC ADF8000C */ sw $t8, 0xc($t7) -/* 01BAF0 8001AEF0 860B0006 */ lh $t3, 6($s0) -/* 01BAF4 8001AEF4 A6190000 */ sh $t9, ($s0) -/* 01BAF8 8001AEF8 A6000004 */ sh $zero, 4($s0) -/* 01BAFC 8001AEFC 256C0001 */ addiu $t4, $t3, 1 -/* 01BB00 8001AF00 A60C0006 */ sh $t4, 6($s0) -/* 01BB04 8001AF04 0C0ADF8D */ jal random_int -/* 01BB08 8001AF08 24040003 */ li $a0, 3 -/* 01BB0C 8001AF0C 00026880 */ sll $t5, $v0, 2 -/* 01BB10 8001AF10 01A26821 */ addu $t5, $t5, $v0 -/* 01BB14 8001AF14 000D6880 */ sll $t5, $t5, 2 -/* 01BB18 8001AF18 25AE000A */ addiu $t6, $t5, 0xa -/* 01BB1C 8001AF1C 10000003 */ b .L8001AF2C -/* 01BB20 8001AF20 A60E000E */ sh $t6, 0xe($s0) -.L8001AF24: -/* 01BB24 8001AF24 A6000000 */ sh $zero, ($s0) -/* 01BB28 8001AF28 A6000004 */ sh $zero, 4($s0) -.L8001AF2C: -/* 01BB2C 8001AF2C 100003C1 */ b .L8001BE34 -/* 01BB30 8001AF30 86020004 */ lh $v0, 4($s0) -glabel L8001AF34 -/* 01BB34 8001AF34 86180002 */ lh $t8, 2($s0) -/* 01BB38 8001AF38 3C198016 */ lui $t9, %hi(gActorList) # $t9, 0x8016 -/* 01BB3C 8001AF3C 2739F9B8 */ addiu $t9, %lo(gActorList) # addiu $t9, $t9, -0x648 -/* 01BB40 8001AF40 001878C0 */ sll $t7, $t8, 3 -/* 01BB44 8001AF44 01F87823 */ subu $t7, $t7, $t8 -/* 01BB48 8001AF48 000F7900 */ sll $t7, $t7, 4 -/* 01BB4C 8001AF4C 01F93821 */ addu $a3, $t7, $t9 -/* 01BB50 8001AF50 84E30002 */ lh $v1, 2($a3) -/* 01BB54 8001AF54 306B8000 */ andi $t3, $v1, 0x8000 -/* 01BB58 8001AF58 5160000D */ beql $t3, $zero, .L8001AF90 -/* 01BB5C 8001AF5C A6000000 */ sh $zero, ($s0) -/* 01BB60 8001AF60 84EC0000 */ lh $t4, ($a3) -/* 01BB64 8001AF64 24060006 */ li $a2, 6 -/* 01BB68 8001AF68 54CC0009 */ bnel $a2, $t4, .L8001AF90 -/* 01BB6C 8001AF6C A6000000 */ sh $zero, ($s0) -/* 01BB70 8001AF70 84ED0006 */ lh $t5, 6($a3) -/* 01BB74 8001AF74 8FAE0030 */ lw $t6, 0x30($sp) -/* 01BB78 8001AF78 55A00005 */ bnel $t5, $zero, .L8001AF90 -/* 01BB7C 8001AF7C A6000000 */ sh $zero, ($s0) -/* 01BB80 8001AF80 84F80010 */ lh $t8, 0x10($a3) -/* 01BB84 8001AF84 51D8000C */ beql $t6, $t8, .L8001AFB8 -/* 01BB88 8001AF88 86020004 */ lh $v0, 4($s0) -/* 01BB8C 8001AF8C A6000000 */ sh $zero, ($s0) -.L8001AF90: -/* 01BB90 8001AF90 A6000004 */ sh $zero, 4($s0) -/* 01BB94 8001AF94 8FAF002C */ lw $t7, 0x2c($sp) -/* 01BB98 8001AF98 3C01FFFB */ lui $at, (0xFFFBFFFF >> 16) # lui $at, 0xfffb -/* 01BB9C 8001AF9C 3421FFFF */ ori $at, (0xFFFBFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 01BBA0 8001AFA0 8DF9000C */ lw $t9, 0xc($t7) -/* 01BBA4 8001AFA4 03215824 */ and $t3, $t9, $at -/* 01BBA8 8001AFA8 ADEB000C */ sw $t3, 0xc($t7) -/* 01BBAC 8001AFAC 100003A1 */ b .L8001BE34 -/* 01BBB0 8001AFB0 86020004 */ lh $v0, 4($s0) -/* 01BBB4 8001AFB4 86020004 */ lh $v0, 4($s0) -.L8001AFB8: -/* 01BBB8 8001AFB8 860C000E */ lh $t4, 0xe($s0) -/* 01BBBC 8001AFBC 240D0003 */ li $t5, 3 -/* 01BBC0 8001AFC0 0182082A */ slt $at, $t4, $v0 -/* 01BBC4 8001AFC4 5020039C */ beql $at, $zero, .L8001BE38 -/* 01BBC8 8001AFC8 28412710 */ slti $at, $v0, 0x2710 -/* 01BBCC 8001AFCC A60D0000 */ sh $t5, ($s0) -/* 01BBD0 8001AFD0 10000398 */ b .L8001BE34 -/* 01BBD4 8001AFD4 86020004 */ lh $v0, 4($s0) -glabel L8001AFD8 -/* 01BBD8 8001AFD8 860E0002 */ lh $t6, 2($s0) -/* 01BBDC 8001AFDC 3C198016 */ lui $t9, %hi(gActorList) # $t9, 0x8016 -/* 01BBE0 8001AFE0 2739F9B8 */ addiu $t9, %lo(gActorList) # addiu $t9, $t9, -0x648 -/* 01BBE4 8001AFE4 000EC0C0 */ sll $t8, $t6, 3 -/* 01BBE8 8001AFE8 030EC023 */ subu $t8, $t8, $t6 -/* 01BBEC 8001AFEC 0018C100 */ sll $t8, $t8, 4 -/* 01BBF0 8001AFF0 03193821 */ addu $a3, $t8, $t9 -/* 01BBF4 8001AFF4 84E30002 */ lh $v1, 2($a3) -/* 01BBF8 8001AFF8 8FB80030 */ lw $t8, 0x30($sp) -/* 01BBFC 8001AFFC 306B8000 */ andi $t3, $v1, 0x8000 -/* 01BC00 8001B000 5160000D */ beql $t3, $zero, .L8001B038 -/* 01BC04 8001B004 84E50010 */ lh $a1, 0x10($a3) -/* 01BC08 8001B008 84EF0000 */ lh $t7, ($a3) -/* 01BC0C 8001B00C 24060006 */ li $a2, 6 -/* 01BC10 8001B010 54CF0009 */ bnel $a2, $t7, .L8001B038 -/* 01BC14 8001B014 84E50010 */ lh $a1, 0x10($a3) -/* 01BC18 8001B018 84EC0006 */ lh $t4, 6($a3) -/* 01BC1C 8001B01C 8FAD0030 */ lw $t5, 0x30($sp) -/* 01BC20 8001B020 55800005 */ bnel $t4, $zero, .L8001B038 -/* 01BC24 8001B024 84E50010 */ lh $a1, 0x10($a3) -/* 01BC28 8001B028 84EE0010 */ lh $t6, 0x10($a3) -/* 01BC2C 8001B02C 51AE0007 */ beql $t5, $t6, .L8001B04C -/* 01BC30 8001B030 44800000 */ mtc1 $zero, $f0 -/* 01BC34 8001B034 84E50010 */ lh $a1, 0x10($a3) -.L8001B038: -/* 01BC38 8001B038 53050023 */ beql $t8, $a1, .L8001B0C8 -/* 01BC3C 8001B03C 8FAD002C */ lw $t5, 0x2c($sp) -/* 01BC40 8001B040 10000021 */ b .L8001B0C8 -/* 01BC44 8001B044 8FAD002C */ lw $t5, 0x2c($sp) -/* 01BC48 8001B048 44800000 */ mtc1 $zero, $f0 -.L8001B04C: -/* 01BC4C 8001B04C A4E80006 */ sh $t0, 6($a3) -/* 01BC50 8001B050 3C0F8016 */ lui $t7, %hi(D_801631E0) # 0x8016 -/* 01BC54 8001B054 E4E00024 */ swc1 $f0, 0x24($a3) -/* 01BC58 8001B058 E4E00028 */ swc1 $f0, 0x28($a3) -/* 01BC5C 8001B05C E4E0002C */ swc1 $f0, 0x2c($a3) -/* 01BC60 8001B060 8FB90030 */ lw $t9, 0x30($sp) -/* 01BC64 8001B064 8FAC002C */ lw $t4, 0x2c($sp) -/* 01BC68 8001B068 3C01403E */ li $at, 0x403E0000 # 2.968750 -/* 01BC6C 8001B06C 00195840 */ sll $t3, $t9, 1 -/* 01BC70 8001B070 01EB7821 */ addu $t7, $t7, $t3 -/* 01BC74 8001B074 95EF31E0 */ lhu $t7, %lo(D_801631E0)($t7) # 0x31e0($t7) -/* 01BC78 8001B078 550F0013 */ bnel $t0, $t7, .L8001B0C8 -/* 01BC7C 8001B07C 8FAD002C */ lw $t5, 0x2c($sp) -/* 01BC80 8001B080 C5840018 */ lwc1 $f4, 0x18($t4) -/* 01BC84 8001B084 44814800 */ mtc1 $at, $f9 -/* 01BC88 8001B088 44804000 */ mtc1 $zero, $f8 -/* 01BC8C 8001B08C 460021A1 */ cvt.d.s $f6, $f4 -/* 01BC90 8001B090 C58C0014 */ lwc1 $f12, 0x14($t4) -/* 01BC94 8001B094 46283280 */ add.d $f10, $f6, $f8 -/* 01BC98 8001B098 8D86001C */ lw $a2, 0x1c($t4) -/* 01BC9C 8001B09C AFA70028 */ sw $a3, 0x28($sp) -/* 01BCA0 8001B0A0 0C0AB870 */ jal spawn_actor_on_surface -/* 01BCA4 8001B0A4 462053A0 */ cvt.s.d $f14, $f10 -/* 01BCA8 8001B0A8 8FA70028 */ lw $a3, 0x28($sp) -/* 01BCAC 8001B0AC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 01BCB0 8001B0B0 44819000 */ mtc1 $at, $f18 -/* 01BCB4 8001B0B4 C4F0000C */ lwc1 $f16, 0xc($a3) -/* 01BCB8 8001B0B8 46128100 */ add.s $f4, $f16, $f18 -/* 01BCBC 8001B0BC 46040180 */ add.s $f6, $f0, $f4 -/* 01BCC0 8001B0C0 E4E6001C */ swc1 $f6, 0x1c($a3) -/* 01BCC4 8001B0C4 8FAD002C */ lw $t5, 0x2c($sp) -.L8001B0C8: -/* 01BCC8 8001B0C8 3C01FFFB */ lui $at, (0xFFFBFFFF >> 16) # lui $at, 0xfffb -/* 01BCCC 8001B0CC 3421FFFF */ ori $at, (0xFFFBFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 01BCD0 8001B0D0 8DAE000C */ lw $t6, 0xc($t5) -/* 01BCD4 8001B0D4 01C1C024 */ and $t8, $t6, $at -/* 01BCD8 8001B0D8 ADB8000C */ sw $t8, 0xc($t5) -/* 01BCDC 8001B0DC A6000004 */ sh $zero, 4($s0) -/* 01BCE0 8001B0E0 A6000000 */ sh $zero, ($s0) -/* 01BCE4 8001B0E4 10000353 */ b .L8001BE34 -/* 01BCE8 8001B0E8 86020004 */ lh $v0, 4($s0) -glabel L8001B0EC -/* 01BCEC 8001B0EC 0C0ACB5C */ jal use_banana_item -/* 01BCF0 8001B0F0 8FA4002C */ lw $a0, 0x2c($sp) -/* 01BCF4 8001B0F4 8FAA0030 */ lw $t2, 0x30($sp) -/* 01BCF8 8001B0F8 A6020002 */ sh $v0, 2($s0) -/* 01BCFC 8001B0FC 86030002 */ lh $v1, 2($s0) -/* 01BD00 8001B100 0460006C */ bltz $v1, .L8001B2B4 -/* 01BD04 8001B104 28610064 */ slti $at, $v1, 0x64 -/* 01BD08 8001B108 1020006A */ beqz $at, .L8001B2B4 -/* 01BD0C 8001B10C 3C088016 */ lui $t0, %hi(gNearestWaypointByPlayerId) # $t0, 0x8016 -/* 01BD10 8001B110 0003C8C0 */ sll $t9, $v1, 3 -/* 01BD14 8001B114 0323C823 */ subu $t9, $t9, $v1 -/* 01BD18 8001B118 3C0B8016 */ lui $t3, %hi(gActorList) # $t3, 0x8016 -/* 01BD1C 8001B11C 256BF9B8 */ addiu $t3, %lo(gActorList) # addiu $t3, $t3, -0x648 -/* 01BD20 8001B120 0019C900 */ sll $t9, $t9, 4 -/* 01BD24 8001B124 032B3821 */ addu $a3, $t9, $t3 -/* 01BD28 8001B128 240F0004 */ li $t7, 4 -/* 01BD2C 8001B12C A4EF0006 */ sh $t7, 6($a3) -/* 01BD30 8001B130 8FAC002C */ lw $t4, 0x2c($sp) -/* 01BD34 8001B134 3C014034 */ li $at, 0x40340000 # 2.812500 -/* 01BD38 8001B138 44810800 */ mtc1 $at, $f1 -/* 01BD3C 8001B13C 8D8E000C */ lw $t6, 0xc($t4) -/* 01BD40 8001B140 3C010004 */ lui $at, 4 -/* 01BD44 8001B144 240D0023 */ li $t5, 35 -/* 01BD48 8001B148 01C1C025 */ or $t8, $t6, $at -/* 01BD4C 8001B14C AD98000C */ sw $t8, 0xc($t4) -/* 01BD50 8001B150 86190006 */ lh $t9, 6($s0) -/* 01BD54 8001B154 A60D0000 */ sh $t5, ($s0) -/* 01BD58 8001B158 A6000004 */ sh $zero, 4($s0) -/* 01BD5C 8001B15C 272B0001 */ addiu $t3, $t9, 1 -/* 01BD60 8001B160 A60B0006 */ sh $t3, 6($s0) -/* 01BD64 8001B164 3C068016 */ lui $a2, %hi(D_80163478) # $a2, 0x8016 -/* 01BD68 8001B168 84C63478 */ lh $a2, %lo(D_80163478)($a2) -/* 01BD6C 8001B16C 25084438 */ addiu $t0, %lo(gNearestWaypointByPlayerId) # addiu $t0, $t0, 0x4438 -/* 01BD70 8001B170 3C098016 */ lui $t1, %hi(gPathIndexByPlayerId) # $t1, 0x8016 -/* 01BD74 8001B174 00067840 */ sll $t7, $a2, 1 -/* 01BD78 8001B178 010F7021 */ addu $t6, $t0, $t7 -/* 01BD7C 8001B17C 95D80000 */ lhu $t8, ($t6) -/* 01BD80 8001B180 252945B0 */ addiu $t1, %lo(gPathIndexByPlayerId) # addiu $t1, $t1, 0x45b0 -/* 01BD84 8001B184 012F6821 */ addu $t5, $t1, $t7 -/* 01BD88 8001B188 95B90000 */ lhu $t9, ($t5) -/* 01BD8C 8001B18C 270C001E */ addiu $t4, $t8, 0x1e -/* 01BD90 8001B190 01E03025 */ move $a2, $t7 -/* 01BD94 8001B194 3C0F8016 */ lui $t7, %hi(gWaypointCountByPathIndex) # 0x8016 -/* 01BD98 8001B198 00195840 */ sll $t3, $t9, 1 -/* 01BD9C 8001B19C 01EB7821 */ addu $t7, $t7, $t3 -/* 01BDA0 8001B1A0 95EF45C8 */ lhu $t7, %lo(gWaypointCountByPathIndex)($t7) # 0x45c8($t7) -/* 01BDA4 8001B1A4 952D0000 */ lhu $t5, ($t1) -/* 01BDA8 8001B1A8 3C0B8016 */ lui $t3, %hi(D_80164550) # 0x8016 -/* 01BDAC 8001B1AC 018F001A */ div $zero, $t4, $t7 -/* 01BDB0 8001B1B0 000DC880 */ sll $t9, $t5, 2 -/* 01BDB4 8001B1B4 01795821 */ addu $t3, $t3, $t9 -/* 01BDB8 8001B1B8 8D6B4550 */ lw $t3, %lo(D_80164550)($t3) # 0x4550($t3) -/* 01BDBC 8001B1BC 00007010 */ mfhi $t6 -/* 01BDC0 8001B1C0 000EC0C0 */ sll $t8, $t6, 3 -/* 01BDC4 8001B1C4 030B1021 */ addu $v0, $t8, $t3 -/* 01BDC8 8001B1C8 44800000 */ mtc1 $zero, $f0 -/* 01BDCC 8001B1CC 15E00002 */ bnez $t7, .L8001B1D8 -/* 01BDD0 8001B1D0 00000000 */ nop -/* 01BDD4 8001B1D4 0007000D */ break 7 -.L8001B1D8: -/* 01BDD8 8001B1D8 2401FFFF */ li $at, -1 -/* 01BDDC 8001B1DC 15E10004 */ bne $t7, $at, .L8001B1F0 -/* 01BDE0 8001B1E0 3C018000 */ lui $at, 0x8000 -/* 01BDE4 8001B1E4 15810002 */ bne $t4, $at, .L8001B1F0 -/* 01BDE8 8001B1E8 00000000 */ nop -/* 01BDEC 8001B1EC 0006000D */ break 6 -.L8001B1F0: -/* 01BDF0 8001B1F0 844C0000 */ lh $t4, ($v0) -/* 01BDF4 8001B1F4 8FAF002C */ lw $t7, 0x2c($sp) -/* 01BDF8 8001B1F8 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 01BDFC 8001B1FC 448C4000 */ mtc1 $t4, $f8 -/* 01BE00 8001B200 C5F00014 */ lwc1 $f16, 0x14($t7) -/* 01BE04 8001B204 3C052900 */ lui $a1, (0x29008009 >> 16) # lui $a1, 0x2900 -/* 01BE08 8001B208 468042A0 */ cvt.s.w $f10, $f8 -/* 01BE0C 8001B20C 44815800 */ mtc1 $at, $f11 -/* 01BE10 8001B210 34A58009 */ ori $a1, (0x29008009 & 0xFFFF) # ori $a1, $a1, 0x8009 -/* 01BE14 8001B214 314400FF */ andi $a0, $t2, 0xff -/* 01BE18 8001B218 46105481 */ sub.s $f18, $f10, $f16 -/* 01BE1C 8001B21C 46009121 */ cvt.d.s $f4, $f18 -/* 01BE20 8001B220 46202183 */ div.d $f6, $f4, $f0 -/* 01BE24 8001B224 46203220 */ cvt.s.d $f8, $f6 -/* 01BE28 8001B228 E4E80024 */ swc1 $f8, 0x24($a3) -/* 01BE2C 8001B22C 844E0002 */ lh $t6, 2($v0) -/* 01BE30 8001B230 8FAD002C */ lw $t5, 0x2c($sp) -/* 01BE34 8001B234 448E5000 */ mtc1 $t6, $f10 -/* 01BE38 8001B238 C5B20018 */ lwc1 $f18, 0x18($t5) -/* 01BE3C 8001B23C 46805420 */ cvt.s.w $f16, $f10 -/* 01BE40 8001B240 44805000 */ mtc1 $zero, $f10 -/* 01BE44 8001B244 46128101 */ sub.s $f4, $f16, $f18 -/* 01BE48 8001B248 460021A1 */ cvt.d.s $f6, $f4 -/* 01BE4C 8001B24C 46203203 */ div.d $f8, $f6, $f0 -/* 01BE50 8001B250 462A4400 */ add.d $f16, $f8, $f10 -/* 01BE54 8001B254 462084A0 */ cvt.s.d $f18, $f16 -/* 01BE58 8001B258 E4F20028 */ swc1 $f18, 0x28($a3) -/* 01BE5C 8001B25C 84590004 */ lh $t9, 4($v0) -/* 01BE60 8001B260 8FB8002C */ lw $t8, 0x2c($sp) -/* 01BE64 8001B264 44992000 */ mtc1 $t9, $f4 -/* 01BE68 8001B268 C708001C */ lwc1 $f8, 0x1c($t8) -/* 01BE6C 8001B26C 468021A0 */ cvt.s.w $f6, $f4 -/* 01BE70 8001B270 46083281 */ sub.s $f10, $f6, $f8 -/* 01BE74 8001B274 46005421 */ cvt.d.s $f16, $f10 -/* 01BE78 8001B278 46208483 */ div.d $f18, $f16, $f0 -/* 01BE7C 8001B27C 46209120 */ cvt.s.d $f4, $f18 -/* 01BE80 8001B280 E4E4002C */ swc1 $f4, 0x2c($a3) -/* 01BE84 8001B284 8FAB002C */ lw $t3, 0x2c($sp) -/* 01BE88 8001B288 C5660018 */ lwc1 $f6, 0x18($t3) -/* 01BE8C 8001B28C 0C0324B3 */ jal func_800C92CC -/* 01BE90 8001B290 E4E6001C */ swc1 $f6, 0x1c($a3) -/* 01BE94 8001B294 8FAC002C */ lw $t4, 0x2c($sp) -/* 01BE98 8001B298 3C061901 */ lui $a2, (0x19018014 >> 16) # lui $a2, 0x1901 -/* 01BE9C 8001B29C 34C68014 */ ori $a2, (0x19018014 & 0xFFFF) # ori $a2, $a2, 0x8014 -/* 01BEA0 8001B2A0 25840014 */ addiu $a0, $t4, 0x14 -/* 01BEA4 8001B2A4 0C03262E */ jal func_800C98B8 -/* 01BEA8 8001B2A8 25850034 */ addiu $a1, $t4, 0x34 -/* 01BEAC 8001B2AC 10000003 */ b .L8001B2BC -/* 01BEB0 8001B2B0 00000000 */ nop -.L8001B2B4: -/* 01BEB4 8001B2B4 A6000004 */ sh $zero, 4($s0) -/* 01BEB8 8001B2B8 A6000000 */ sh $zero, ($s0) -.L8001B2BC: -/* 01BEBC 8001B2BC 100002DD */ b .L8001BE34 -/* 01BEC0 8001B2C0 86020004 */ lh $v0, 4($s0) -glabel L8001B2C4 -/* 01BEC4 8001B2C4 860F0002 */ lh $t7, 2($s0) -/* 01BEC8 8001B2C8 3C0D8016 */ lui $t5, %hi(gActorList) # $t5, 0x8016 -/* 01BECC 8001B2CC 25ADF9B8 */ addiu $t5, %lo(gActorList) # addiu $t5, $t5, -0x648 -/* 01BED0 8001B2D0 000F70C0 */ sll $t6, $t7, 3 -/* 01BED4 8001B2D4 01CF7023 */ subu $t6, $t6, $t7 -/* 01BED8 8001B2D8 000E7100 */ sll $t6, $t6, 4 -/* 01BEDC 8001B2DC 01CD3821 */ addu $a3, $t6, $t5 -/* 01BEE0 8001B2E0 84E30002 */ lh $v1, 2($a3) -/* 01BEE4 8001B2E4 30798000 */ andi $t9, $v1, 0x8000 -/* 01BEE8 8001B2E8 5320000F */ beql $t9, $zero, .L8001B328 -/* 01BEEC 8001B2EC A6000004 */ sh $zero, 4($s0) -/* 01BEF0 8001B2F0 84F80000 */ lh $t8, ($a3) -/* 01BEF4 8001B2F4 24060006 */ li $a2, 6 -/* 01BEF8 8001B2F8 54D8000B */ bnel $a2, $t8, .L8001B328 -/* 01BEFC 8001B2FC A6000004 */ sh $zero, 4($s0) -/* 01BF00 8001B300 84EB0006 */ lh $t3, 6($a3) -/* 01BF04 8001B304 24010004 */ li $at, 4 -/* 01BF08 8001B308 8FAC0030 */ lw $t4, 0x30($sp) -/* 01BF0C 8001B30C 55610006 */ bnel $t3, $at, .L8001B328 -/* 01BF10 8001B310 A6000004 */ sh $zero, 4($s0) -/* 01BF14 8001B314 84EF0010 */ lh $t7, 0x10($a3) -/* 01BF18 8001B318 3C01800F */ lui $at, %hi(D_800ED498) -/* 01BF1C 8001B31C 518F000C */ beql $t4, $t7, .L8001B350 -/* 01BF20 8001B320 C4E80028 */ lwc1 $f8, 0x28($a3) -/* 01BF24 8001B324 A6000004 */ sh $zero, 4($s0) -.L8001B328: -/* 01BF28 8001B328 A6000000 */ sh $zero, ($s0) -/* 01BF2C 8001B32C 8FAE002C */ lw $t6, 0x2c($sp) -/* 01BF30 8001B330 3C01FFFB */ lui $at, (0xFFFBFFFF >> 16) # lui $at, 0xfffb -/* 01BF34 8001B334 3421FFFF */ ori $at, (0xFFFBFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 01BF38 8001B338 8DCD000C */ lw $t5, 0xc($t6) -/* 01BF3C 8001B33C 01A1C824 */ and $t9, $t5, $at -/* 01BF40 8001B340 ADD9000C */ sw $t9, 0xc($t6) -/* 01BF44 8001B344 100002BB */ b .L8001BE34 -/* 01BF48 8001B348 86020004 */ lh $v0, 4($s0) -/* 01BF4C 8001B34C C4E80028 */ lwc1 $f8, 0x28($a3) -.L8001B350: -/* 01BF50 8001B350 D430D498 */ ldc1 $f16, %lo(D_800ED498)($at) -/* 01BF54 8001B354 C4E60018 */ lwc1 $f6, 0x18($a3) -/* 01BF58 8001B358 460042A1 */ cvt.d.s $f10, $f8 -/* 01BF5C 8001B35C C4E80024 */ lwc1 $f8, 0x24($a3) -/* 01BF60 8001B360 46305481 */ sub.d $f18, $f10, $f16 -/* 01BF64 8001B364 C4F0001C */ lwc1 $f16, 0x1c($a3) -/* 01BF68 8001B368 24180024 */ li $t8, 36 -/* 01BF6C 8001B36C 46083280 */ add.s $f10, $f6, $f8 -/* 01BF70 8001B370 C4E8002C */ lwc1 $f8, 0x2c($a3) -/* 01BF74 8001B374 C4E60020 */ lwc1 $f6, 0x20($a3) -/* 01BF78 8001B378 46209120 */ cvt.s.d $f4, $f18 -/* 01BF7C 8001B37C E4EA0018 */ swc1 $f10, 0x18($a3) -/* 01BF80 8001B380 46083280 */ add.s $f10, $f6, $f8 -/* 01BF84 8001B384 E4E40028 */ swc1 $f4, 0x28($a3) -/* 01BF88 8001B388 C4F20028 */ lwc1 $f18, 0x28($a3) -/* 01BF8C 8001B38C E4EA0020 */ swc1 $f10, 0x20($a3) -/* 01BF90 8001B390 46128100 */ add.s $f4, $f16, $f18 -/* 01BF94 8001B394 E4E4001C */ swc1 $f4, 0x1c($a3) -/* 01BF98 8001B398 86020004 */ lh $v0, 4($s0) -/* 01BF9C 8001B39C 28410015 */ slti $at, $v0, 0x15 -/* 01BFA0 8001B3A0 542002A5 */ bnel $at, $zero, .L8001BE38 -/* 01BFA4 8001B3A4 28412710 */ slti $at, $v0, 0x2710 -/* 01BFA8 8001B3A8 A6180000 */ sh $t8, ($s0) -/* 01BFAC 8001B3AC 100002A1 */ b .L8001BE34 -/* 01BFB0 8001B3B0 86020004 */ lh $v0, 4($s0) -glabel L8001B3B4 -/* 01BFB4 8001B3B4 860B0002 */ lh $t3, 2($s0) -/* 01BFB8 8001B3B8 3C0F8016 */ lui $t7, %hi(gActorList) # $t7, 0x8016 -/* 01BFBC 8001B3BC 25EFF9B8 */ addiu $t7, %lo(gActorList) # addiu $t7, $t7, -0x648 -/* 01BFC0 8001B3C0 000B60C0 */ sll $t4, $t3, 3 -/* 01BFC4 8001B3C4 018B6023 */ subu $t4, $t4, $t3 -/* 01BFC8 8001B3C8 000C6100 */ sll $t4, $t4, 4 -/* 01BFCC 8001B3CC 018F3821 */ addu $a3, $t4, $t7 -/* 01BFD0 8001B3D0 84E30002 */ lh $v1, 2($a3) -/* 01BFD4 8001B3D4 8FAC0030 */ lw $t4, 0x30($sp) -/* 01BFD8 8001B3D8 306D8000 */ andi $t5, $v1, 0x8000 -/* 01BFDC 8001B3DC 51A0000F */ beql $t5, $zero, .L8001B41C -/* 01BFE0 8001B3E0 84E50010 */ lh $a1, 0x10($a3) -/* 01BFE4 8001B3E4 84F90000 */ lh $t9, ($a3) -/* 01BFE8 8001B3E8 24060006 */ li $a2, 6 -/* 01BFEC 8001B3EC 54D9000B */ bnel $a2, $t9, .L8001B41C -/* 01BFF0 8001B3F0 84E50010 */ lh $a1, 0x10($a3) -/* 01BFF4 8001B3F4 84EE0006 */ lh $t6, 6($a3) -/* 01BFF8 8001B3F8 24010004 */ li $at, 4 -/* 01BFFC 8001B3FC 8FB80030 */ lw $t8, 0x30($sp) -/* 01C000 8001B400 55C10006 */ bnel $t6, $at, .L8001B41C -/* 01C004 8001B404 84E50010 */ lh $a1, 0x10($a3) -/* 01C008 8001B408 84EB0010 */ lh $t3, 0x10($a3) -/* 01C00C 8001B40C 3C01403E */ li $at, 0x403E0000 # 2.968750 -/* 01C010 8001B410 530B0007 */ beql $t8, $t3, .L8001B430 -/* 01C014 8001B414 C4F0001C */ lwc1 $f16, 0x1c($a3) -/* 01C018 8001B418 84E50010 */ lh $a1, 0x10($a3) -.L8001B41C: -/* 01C01C 8001B41C 5185001A */ beql $t4, $a1, .L8001B488 -/* 01C020 8001B420 8FAF002C */ lw $t7, 0x2c($sp) -/* 01C024 8001B424 10000018 */ b .L8001B488 -/* 01C028 8001B428 8FAF002C */ lw $t7, 0x2c($sp) -/* 01C02C 8001B42C C4F0001C */ lwc1 $f16, 0x1c($a3) -.L8001B430: -/* 01C030 8001B430 44800000 */ mtc1 $zero, $f0 -/* 01C034 8001B434 44812800 */ mtc1 $at, $f5 -/* 01C038 8001B438 44802000 */ mtc1 $zero, $f4 -/* 01C03C 8001B43C 460084A1 */ cvt.d.s $f18, $f16 -/* 01C040 8001B440 A4E80006 */ sh $t0, 6($a3) -/* 01C044 8001B444 46249180 */ add.d $f6, $f18, $f4 -/* 01C048 8001B448 C4EC0018 */ lwc1 $f12, 0x18($a3) -/* 01C04C 8001B44C 8CE60020 */ lw $a2, 0x20($a3) -/* 01C050 8001B450 E4E00024 */ swc1 $f0, 0x24($a3) -/* 01C054 8001B454 E4E00028 */ swc1 $f0, 0x28($a3) -/* 01C058 8001B458 E4E0002C */ swc1 $f0, 0x2c($a3) -/* 01C05C 8001B45C AFA70028 */ sw $a3, 0x28($sp) -/* 01C060 8001B460 0C0AB870 */ jal spawn_actor_on_surface -/* 01C064 8001B464 462033A0 */ cvt.s.d $f14, $f6 -/* 01C068 8001B468 8FA70028 */ lw $a3, 0x28($sp) -/* 01C06C 8001B46C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 01C070 8001B470 44815000 */ mtc1 $at, $f10 -/* 01C074 8001B474 C4E8000C */ lwc1 $f8, 0xc($a3) -/* 01C078 8001B478 460A4400 */ add.s $f16, $f8, $f10 -/* 01C07C 8001B47C 46100480 */ add.s $f18, $f0, $f16 -/* 01C080 8001B480 E4F2001C */ swc1 $f18, 0x1c($a3) -/* 01C084 8001B484 8FAF002C */ lw $t7, 0x2c($sp) -.L8001B488: -/* 01C088 8001B488 3C01FFFB */ lui $at, (0xFFFBFFFF >> 16) # lui $at, 0xfffb -/* 01C08C 8001B48C 3421FFFF */ ori $at, (0xFFFBFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 01C090 8001B490 8DED000C */ lw $t5, 0xc($t7) -/* 01C094 8001B494 01A1C824 */ and $t9, $t5, $at -/* 01C098 8001B498 ADF9000C */ sw $t9, 0xc($t7) -/* 01C09C 8001B49C A6000004 */ sh $zero, 4($s0) -/* 01C0A0 8001B4A0 A6000000 */ sh $zero, ($s0) -/* 01C0A4 8001B4A4 10000263 */ b .L8001BE34 -/* 01C0A8 8001B4A8 86020004 */ lh $v0, 4($s0) -glabel L8001B4AC -/* 01C0AC 8001B4AC 3C0E8015 */ lui $t6, %hi(gNumActors) # $t6, 0x8015 -/* 01C0B0 8001B4B0 95CE0110 */ lhu $t6, %lo(gNumActors)($t6) -/* 01C0B4 8001B4B4 29C10050 */ slti $at, $t6, 0x50 -/* 01C0B8 8001B4B8 50200019 */ beql $at, $zero, .L8001B520 -/* 01C0BC 8001B4BC A6000000 */ sh $zero, ($s0) -/* 01C0C0 8001B4C0 0C0AC727 */ jal use_green_shell_item -/* 01C0C4 8001B4C4 8FA4002C */ lw $a0, 0x2c($sp) -/* 01C0C8 8001B4C8 A6020002 */ sh $v0, 2($s0) -/* 01C0CC 8001B4CC 86030002 */ lh $v1, 2($s0) -/* 01C0D0 8001B4D0 04600010 */ bltz $v1, .L8001B514 -/* 01C0D4 8001B4D4 28610064 */ slti $at, $v1, 0x64 -/* 01C0D8 8001B4D8 1020000E */ beqz $at, .L8001B514 -/* 01C0DC 8001B4DC 24180005 */ li $t8, 5 -/* 01C0E0 8001B4E0 860B0006 */ lh $t3, 6($s0) -/* 01C0E4 8001B4E4 A6180000 */ sh $t8, ($s0) -/* 01C0E8 8001B4E8 A6000004 */ sh $zero, 4($s0) -/* 01C0EC 8001B4EC 256C0001 */ addiu $t4, $t3, 1 -/* 01C0F0 8001B4F0 A60C0006 */ sh $t4, 6($s0) -/* 01C0F4 8001B4F4 0C0ADF8D */ jal random_int -/* 01C0F8 8001B4F8 24040003 */ li $a0, 3 -/* 01C0FC 8001B4FC 00026880 */ sll $t5, $v0, 2 -/* 01C100 8001B500 01A26821 */ addu $t5, $t5, $v0 -/* 01C104 8001B504 000D6880 */ sll $t5, $t5, 2 -/* 01C108 8001B508 25B9000A */ addiu $t9, $t5, 0xa -/* 01C10C 8001B50C 10000004 */ b .L8001B520 -/* 01C110 8001B510 A619000E */ sh $t9, 0xe($s0) -.L8001B514: -/* 01C114 8001B514 10000002 */ b .L8001B520 -/* 01C118 8001B518 A6000000 */ sh $zero, ($s0) -/* 01C11C 8001B51C A6000000 */ sh $zero, ($s0) -.L8001B520: -/* 01C120 8001B520 10000244 */ b .L8001BE34 -/* 01C124 8001B524 86020004 */ lh $v0, 4($s0) -glabel L8001B528 -/* 01C128 8001B528 860F0002 */ lh $t7, 2($s0) -/* 01C12C 8001B52C 3C188016 */ lui $t8, %hi(gActorList) # $t8, 0x8016 -/* 01C130 8001B530 2718F9B8 */ addiu $t8, %lo(gActorList) # addiu $t8, $t8, -0x648 -/* 01C134 8001B534 000F70C0 */ sll $t6, $t7, 3 -/* 01C138 8001B538 01CF7023 */ subu $t6, $t6, $t7 -/* 01C13C 8001B53C 000E7100 */ sll $t6, $t6, 4 -/* 01C140 8001B540 01D83821 */ addu $a3, $t6, $t8 -/* 01C144 8001B544 84E30002 */ lh $v1, 2($a3) -/* 01C148 8001B548 306B8000 */ andi $t3, $v1, 0x8000 -/* 01C14C 8001B54C 5160000D */ beql $t3, $zero, .L8001B584 -/* 01C150 8001B550 A6000004 */ sh $zero, 4($s0) -/* 01C154 8001B554 84EC0000 */ lh $t4, ($a3) -/* 01C158 8001B558 24010007 */ li $at, 7 -/* 01C15C 8001B55C 55810009 */ bnel $t4, $at, .L8001B584 -/* 01C160 8001B560 A6000004 */ sh $zero, 4($s0) -/* 01C164 8001B564 84ED0006 */ lh $t5, 6($a3) -/* 01C168 8001B568 8FB90030 */ lw $t9, 0x30($sp) -/* 01C16C 8001B56C 55A00005 */ bnel $t5, $zero, .L8001B584 -/* 01C170 8001B570 A6000004 */ sh $zero, 4($s0) -/* 01C174 8001B574 84EF0014 */ lh $t7, 0x14($a3) -/* 01C178 8001B578 532F0006 */ beql $t9, $t7, .L8001B594 -/* 01C17C 8001B57C 86020004 */ lh $v0, 4($s0) -/* 01C180 8001B580 A6000004 */ sh $zero, 4($s0) -.L8001B584: -/* 01C184 8001B584 A6000000 */ sh $zero, ($s0) -/* 01C188 8001B588 1000022A */ b .L8001BE34 -/* 01C18C 8001B58C 86020004 */ lh $v0, 4($s0) -/* 01C190 8001B590 86020004 */ lh $v0, 4($s0) -.L8001B594: -/* 01C194 8001B594 860E000E */ lh $t6, 0xe($s0) -/* 01C198 8001B598 24060006 */ li $a2, 6 -/* 01C19C 8001B59C 01C2082A */ slt $at, $t6, $v0 -/* 01C1A0 8001B5A0 50200225 */ beql $at, $zero, .L8001BE38 -/* 01C1A4 8001B5A4 28412710 */ slti $at, $v0, 0x2710 -/* 01C1A8 8001B5A8 A6000004 */ sh $zero, 4($s0) -/* 01C1AC 8001B5AC A6060000 */ sh $a2, ($s0) -/* 01C1B0 8001B5B0 10000220 */ b .L8001BE34 -/* 01C1B4 8001B5B4 86020004 */ lh $v0, 4($s0) -glabel L8001B5B8 -/* 01C1B8 8001B5B8 86180002 */ lh $t8, 2($s0) -/* 01C1BC 8001B5BC 3C0C8016 */ lui $t4, %hi(gActorList) # $t4, 0x8016 -/* 01C1C0 8001B5C0 258CF9B8 */ addiu $t4, %lo(gActorList) # addiu $t4, $t4, -0x648 -/* 01C1C4 8001B5C4 001858C0 */ sll $t3, $t8, 3 -/* 01C1C8 8001B5C8 01785823 */ subu $t3, $t3, $t8 -/* 01C1CC 8001B5CC 000B5900 */ sll $t3, $t3, 4 -/* 01C1D0 8001B5D0 016C3821 */ addu $a3, $t3, $t4 -/* 01C1D4 8001B5D4 84E30002 */ lh $v1, 2($a3) -/* 01C1D8 8001B5D8 306D8000 */ andi $t5, $v1, 0x8000 -/* 01C1DC 8001B5DC 51A0000D */ beql $t5, $zero, .L8001B614 -/* 01C1E0 8001B5E0 A6000000 */ sh $zero, ($s0) -/* 01C1E4 8001B5E4 84F90000 */ lh $t9, ($a3) -/* 01C1E8 8001B5E8 24010007 */ li $at, 7 -/* 01C1EC 8001B5EC 57210009 */ bnel $t9, $at, .L8001B614 -/* 01C1F0 8001B5F0 A6000000 */ sh $zero, ($s0) -/* 01C1F4 8001B5F4 84EF0006 */ lh $t7, 6($a3) -/* 01C1F8 8001B5F8 8FAE0030 */ lw $t6, 0x30($sp) -/* 01C1FC 8001B5FC 55E00005 */ bnel $t7, $zero, .L8001B614 -/* 01C200 8001B600 A6000000 */ sh $zero, ($s0) -/* 01C204 8001B604 84F80014 */ lh $t8, 0x14($a3) -/* 01C208 8001B608 51D80005 */ beql $t6, $t8, .L8001B620 -/* 01C20C 8001B60C A4E80006 */ sh $t0, 6($a3) -/* 01C210 8001B610 A6000000 */ sh $zero, ($s0) -.L8001B614: -/* 01C214 8001B614 10000004 */ b .L8001B628 -/* 01C218 8001B618 A6000004 */ sh $zero, 4($s0) -/* 01C21C 8001B61C A4E80006 */ sh $t0, 6($a3) -.L8001B620: -/* 01C220 8001B620 A6000004 */ sh $zero, 4($s0) -/* 01C224 8001B624 A6000000 */ sh $zero, ($s0) -.L8001B628: -/* 01C228 8001B628 10000202 */ b .L8001BE34 -/* 01C22C 8001B62C 86020004 */ lh $v0, 4($s0) -glabel L8001B630 -/* 01C230 8001B630 3C0B8015 */ lui $t3, %hi(gNumActors) # $t3, 0x8015 -/* 01C234 8001B634 956B0110 */ lhu $t3, %lo(gNumActors)($t3) -/* 01C238 8001B638 29610050 */ slti $at, $t3, 0x50 -/* 01C23C 8001B63C 50200019 */ beql $at, $zero, .L8001B6A4 -/* 01C240 8001B640 A6000000 */ sh $zero, ($s0) -/* 01C244 8001B644 0C0AC792 */ jal use_red_shell_item -/* 01C248 8001B648 8FA4002C */ lw $a0, 0x2c($sp) -/* 01C24C 8001B64C A6020002 */ sh $v0, 2($s0) -/* 01C250 8001B650 86030002 */ lh $v1, 2($s0) -/* 01C254 8001B654 04600010 */ bltz $v1, .L8001B698 -/* 01C258 8001B658 28610064 */ slti $at, $v1, 0x64 -/* 01C25C 8001B65C 1020000E */ beqz $at, .L8001B698 -/* 01C260 8001B660 240C0008 */ li $t4, 8 -/* 01C264 8001B664 860D0006 */ lh $t5, 6($s0) -/* 01C268 8001B668 A60C0000 */ sh $t4, ($s0) -/* 01C26C 8001B66C A6000004 */ sh $zero, 4($s0) -/* 01C270 8001B670 25B90001 */ addiu $t9, $t5, 1 -/* 01C274 8001B674 A6190006 */ sh $t9, 6($s0) -/* 01C278 8001B678 0C0ADF8D */ jal random_int -/* 01C27C 8001B67C 24040003 */ li $a0, 3 -/* 01C280 8001B680 00027880 */ sll $t7, $v0, 2 -/* 01C284 8001B684 01E27821 */ addu $t7, $t7, $v0 -/* 01C288 8001B688 000F7880 */ sll $t7, $t7, 2 -/* 01C28C 8001B68C 25EE000A */ addiu $t6, $t7, 0xa -/* 01C290 8001B690 10000004 */ b .L8001B6A4 -/* 01C294 8001B694 A60E000E */ sh $t6, 0xe($s0) -.L8001B698: -/* 01C298 8001B698 10000002 */ b .L8001B6A4 -/* 01C29C 8001B69C A6000000 */ sh $zero, ($s0) -/* 01C2A0 8001B6A0 A6000000 */ sh $zero, ($s0) -.L8001B6A4: -/* 01C2A4 8001B6A4 100001E3 */ b .L8001BE34 -/* 01C2A8 8001B6A8 86020004 */ lh $v0, 4($s0) -glabel L8001B6AC -/* 01C2AC 8001B6AC 86180002 */ lh $t8, 2($s0) -/* 01C2B0 8001B6B0 3C0C8016 */ lui $t4, %hi(gActorList) # $t4, 0x8016 -/* 01C2B4 8001B6B4 258CF9B8 */ addiu $t4, %lo(gActorList) # addiu $t4, $t4, -0x648 -/* 01C2B8 8001B6B8 001858C0 */ sll $t3, $t8, 3 -/* 01C2BC 8001B6BC 01785823 */ subu $t3, $t3, $t8 -/* 01C2C0 8001B6C0 000B5900 */ sll $t3, $t3, 4 -/* 01C2C4 8001B6C4 016C3821 */ addu $a3, $t3, $t4 -/* 01C2C8 8001B6C8 84E30002 */ lh $v1, 2($a3) -/* 01C2CC 8001B6CC 306D8000 */ andi $t5, $v1, 0x8000 -/* 01C2D0 8001B6D0 51A0000D */ beql $t5, $zero, .L8001B708 -/* 01C2D4 8001B6D4 A6000004 */ sh $zero, 4($s0) -/* 01C2D8 8001B6D8 84F90000 */ lh $t9, ($a3) -/* 01C2DC 8001B6DC 24010008 */ li $at, 8 -/* 01C2E0 8001B6E0 57210009 */ bnel $t9, $at, .L8001B708 -/* 01C2E4 8001B6E4 A6000004 */ sh $zero, 4($s0) -/* 01C2E8 8001B6E8 84EF0006 */ lh $t7, 6($a3) -/* 01C2EC 8001B6EC 8FAE0030 */ lw $t6, 0x30($sp) -/* 01C2F0 8001B6F0 55E00005 */ bnel $t7, $zero, .L8001B708 -/* 01C2F4 8001B6F4 A6000004 */ sh $zero, 4($s0) -/* 01C2F8 8001B6F8 84F80014 */ lh $t8, 0x14($a3) -/* 01C2FC 8001B6FC 51D80006 */ beql $t6, $t8, .L8001B718 -/* 01C300 8001B700 86020004 */ lh $v0, 4($s0) -/* 01C304 8001B704 A6000004 */ sh $zero, 4($s0) -.L8001B708: -/* 01C308 8001B708 A6000000 */ sh $zero, ($s0) -/* 01C30C 8001B70C 100001C9 */ b .L8001BE34 -/* 01C310 8001B710 86020004 */ lh $v0, 4($s0) -/* 01C314 8001B714 86020004 */ lh $v0, 4($s0) -.L8001B718: -/* 01C318 8001B718 860B000E */ lh $t3, 0xe($s0) -/* 01C31C 8001B71C 240C0009 */ li $t4, 9 -/* 01C320 8001B720 0162082A */ slt $at, $t3, $v0 -/* 01C324 8001B724 502001C4 */ beql $at, $zero, .L8001BE38 -/* 01C328 8001B728 28412710 */ slti $at, $v0, 0x2710 -/* 01C32C 8001B72C A60C0000 */ sh $t4, ($s0) -/* 01C330 8001B730 100001C0 */ b .L8001BE34 -/* 01C334 8001B734 86020004 */ lh $v0, 4($s0) -glabel L8001B738 -/* 01C338 8001B738 0C006AFB */ jal func_8001ABEC -/* 01C33C 8001B73C 02002025 */ move $a0, $s0 -/* 01C340 8001B740 860D0002 */ lh $t5, 2($s0) -/* 01C344 8001B744 3C0F8016 */ lui $t7, %hi(gActorList) # $t7, 0x8016 -/* 01C348 8001B748 25EFF9B8 */ addiu $t7, %lo(gActorList) # addiu $t7, $t7, -0x648 -/* 01C34C 8001B74C 000DC8C0 */ sll $t9, $t5, 3 -/* 01C350 8001B750 032DC823 */ subu $t9, $t9, $t5 -/* 01C354 8001B754 0019C900 */ sll $t9, $t9, 4 -/* 01C358 8001B758 032F3821 */ addu $a3, $t9, $t7 -/* 01C35C 8001B75C 84E30002 */ lh $v1, 2($a3) -/* 01C360 8001B760 24080001 */ li $t0, 1 -/* 01C364 8001B764 8FAA0030 */ lw $t2, 0x30($sp) -/* 01C368 8001B768 306E8000 */ andi $t6, $v1, 0x8000 -/* 01C36C 8001B76C 51C0000C */ beql $t6, $zero, .L8001B7A0 -/* 01C370 8001B770 A6000000 */ sh $zero, ($s0) -/* 01C374 8001B774 84F80000 */ lh $t8, ($a3) -/* 01C378 8001B778 24010008 */ li $at, 8 -/* 01C37C 8001B77C 57010008 */ bnel $t8, $at, .L8001B7A0 -/* 01C380 8001B780 A6000000 */ sh $zero, ($s0) -/* 01C384 8001B784 84EB0006 */ lh $t3, 6($a3) -/* 01C388 8001B788 55600005 */ bnel $t3, $zero, .L8001B7A0 -/* 01C38C 8001B78C A6000000 */ sh $zero, ($s0) -/* 01C390 8001B790 84EC0014 */ lh $t4, 0x14($a3) -/* 01C394 8001B794 514C0005 */ beql $t2, $t4, .L8001B7AC -/* 01C398 8001B798 A4E80006 */ sh $t0, 6($a3) -/* 01C39C 8001B79C A6000000 */ sh $zero, ($s0) -.L8001B7A0: -/* 01C3A0 8001B7A0 10000004 */ b .L8001B7B4 -/* 01C3A4 8001B7A4 A6000004 */ sh $zero, 4($s0) -/* 01C3A8 8001B7A8 A4E80006 */ sh $t0, 6($a3) -.L8001B7AC: -/* 01C3AC 8001B7AC A6000004 */ sh $zero, 4($s0) -/* 01C3B0 8001B7B0 A6000000 */ sh $zero, ($s0) -.L8001B7B4: -/* 01C3B4 8001B7B4 1000019F */ b .L8001BE34 -/* 01C3B8 8001B7B8 86020004 */ lh $v0, 4($s0) -glabel L8001B7BC -/* 01C3BC 8001B7BC 3C0D8015 */ lui $t5, %hi(gNumActors) # $t5, 0x8015 -/* 01C3C0 8001B7C0 95AD0110 */ lhu $t5, %lo(gNumActors)($t5) -/* 01C3C4 8001B7C4 29A10050 */ slti $at, $t5, 0x50 -/* 01C3C8 8001B7C8 50200019 */ beql $at, $zero, .L8001B830 -/* 01C3CC 8001B7CC A6000000 */ sh $zero, ($s0) -/* 01C3D0 8001B7D0 0C0AC5FD */ jal use_banana_bunch_item -/* 01C3D4 8001B7D4 8FA4002C */ lw $a0, 0x2c($sp) -/* 01C3D8 8001B7D8 A6020002 */ sh $v0, 2($s0) -/* 01C3DC 8001B7DC 86030002 */ lh $v1, 2($s0) -/* 01C3E0 8001B7E0 04600010 */ bltz $v1, .L8001B824 -/* 01C3E4 8001B7E4 28610064 */ slti $at, $v1, 0x64 -/* 01C3E8 8001B7E8 1020000E */ beqz $at, .L8001B824 -/* 01C3EC 8001B7EC 2419000B */ li $t9, 11 -/* 01C3F0 8001B7F0 860F0006 */ lh $t7, 6($s0) -/* 01C3F4 8001B7F4 A6190000 */ sh $t9, ($s0) -/* 01C3F8 8001B7F8 A6000004 */ sh $zero, 4($s0) -/* 01C3FC 8001B7FC 25EE0001 */ addiu $t6, $t7, 1 -/* 01C400 8001B800 A60E0006 */ sh $t6, 6($s0) -/* 01C404 8001B804 0C0ADF8D */ jal random_int -/* 01C408 8001B808 24040003 */ li $a0, 3 -/* 01C40C 8001B80C 0002C080 */ sll $t8, $v0, 2 -/* 01C410 8001B810 0302C021 */ addu $t8, $t8, $v0 -/* 01C414 8001B814 0018C080 */ sll $t8, $t8, 2 -/* 01C418 8001B818 270B003C */ addiu $t3, $t8, 0x3c -/* 01C41C 8001B81C 10000004 */ b .L8001B830 -/* 01C420 8001B820 A60B000E */ sh $t3, 0xe($s0) -.L8001B824: -/* 01C424 8001B824 10000002 */ b .L8001B830 -/* 01C428 8001B828 A6000000 */ sh $zero, ($s0) -/* 01C42C 8001B82C A6000000 */ sh $zero, ($s0) -.L8001B830: -/* 01C430 8001B830 10000180 */ b .L8001BE34 -/* 01C434 8001B834 86020004 */ lh $v0, 4($s0) -glabel L8001B838 -/* 01C438 8001B838 860C0002 */ lh $t4, 2($s0) -/* 01C43C 8001B83C 3C198016 */ lui $t9, %hi(gActorList) # $t9, 0x8016 -/* 01C440 8001B840 2739F9B8 */ addiu $t9, %lo(gActorList) # addiu $t9, $t9, -0x648 -/* 01C444 8001B844 000C68C0 */ sll $t5, $t4, 3 -/* 01C448 8001B848 01AC6823 */ subu $t5, $t5, $t4 -/* 01C44C 8001B84C 000D6900 */ sll $t5, $t5, 4 -/* 01C450 8001B850 01B93821 */ addu $a3, $t5, $t9 -/* 01C454 8001B854 84E40006 */ lh $a0, 6($a3) -/* 01C458 8001B858 24060006 */ li $a2, 6 -/* 01C45C 8001B85C 14C40029 */ bne $a2, $a0, .L8001B904 -/* 01C460 8001B860 00000000 */ nop -/* 01C464 8001B864 84EF001A */ lh $t7, 0x1a($a3) -/* 01C468 8001B868 2405FFFF */ li $a1, -1 -/* 01C46C 8001B86C 00001825 */ move $v1, $zero -/* 01C470 8001B870 50AF0003 */ beql $a1, $t7, .L8001B880 -/* 01C474 8001B874 84EE0018 */ lh $t6, 0x18($a3) -/* 01C478 8001B878 24030001 */ li $v1, 1 -/* 01C47C 8001B87C 84EE0018 */ lh $t6, 0x18($a3) -.L8001B880: -/* 01C480 8001B880 50AE0003 */ beql $a1, $t6, .L8001B890 -/* 01C484 8001B884 84F80016 */ lh $t8, 0x16($a3) -/* 01C488 8001B888 24030001 */ li $v1, 1 -/* 01C48C 8001B88C 84F80016 */ lh $t8, 0x16($a3) -.L8001B890: -/* 01C490 8001B890 50B80003 */ beql $a1, $t8, .L8001B8A0 -/* 01C494 8001B894 84EB0014 */ lh $t3, 0x14($a3) -/* 01C498 8001B898 24030001 */ li $v1, 1 -/* 01C49C 8001B89C 84EB0014 */ lh $t3, 0x14($a3) -.L8001B8A0: -/* 01C4A0 8001B8A0 50AB0003 */ beql $a1, $t3, .L8001B8B0 -/* 01C4A4 8001B8A4 84EC0012 */ lh $t4, 0x12($a3) -/* 01C4A8 8001B8A8 24030001 */ li $v1, 1 -/* 01C4AC 8001B8AC 84EC0012 */ lh $t4, 0x12($a3) -.L8001B8B0: -/* 01C4B0 8001B8B0 50AC0003 */ beql $a1, $t4, .L8001B8C0 -/* 01C4B4 8001B8B4 84E20000 */ lh $v0, ($a3) -/* 01C4B8 8001B8B8 24030001 */ li $v1, 1 -/* 01C4BC 8001B8BC 84E20000 */ lh $v0, ($a3) -.L8001B8C0: -/* 01C4C0 8001B8C0 2405000E */ li $a1, 14 -/* 01C4C4 8001B8C4 54A20004 */ bnel $a1, $v0, .L8001B8D8 -/* 01C4C8 8001B8C8 A6000000 */ sh $zero, ($s0) -/* 01C4CC 8001B8CC 54600005 */ bnel $v1, $zero, .L8001B8E4 -/* 01C4D0 8001B8D0 860D000E */ lh $t5, 0xe($s0) -/* 01C4D4 8001B8D4 A6000000 */ sh $zero, ($s0) -.L8001B8D8: -/* 01C4D8 8001B8D8 1000000A */ b .L8001B904 -/* 01C4DC 8001B8DC A6000004 */ sh $zero, 4($s0) -/* 01C4E0 8001B8E0 860D000E */ lh $t5, 0xe($s0) -.L8001B8E4: -/* 01C4E4 8001B8E4 86190004 */ lh $t9, 4($s0) -/* 01C4E8 8001B8E8 240F000C */ li $t7, 12 -/* 01C4EC 8001B8EC 01B9082A */ slt $at, $t5, $t9 -/* 01C4F0 8001B8F0 10200004 */ beqz $at, .L8001B904 -/* 01C4F4 8001B8F4 00000000 */ nop -/* 01C4F8 8001B8F8 A60F0000 */ sh $t7, ($s0) -/* 01C4FC 8001B8FC A6000008 */ sh $zero, 8($s0) -/* 01C500 8001B900 A6000004 */ sh $zero, 4($s0) -.L8001B904: -/* 01C504 8001B904 1000014B */ b .L8001BE34 -/* 01C508 8001B908 86020004 */ lh $v0, 4($s0) -glabel L8001B90C -/* 01C50C 8001B90C 86020004 */ lh $v0, 4($s0) -/* 01C510 8001B910 2401000A */ li $at, 10 -/* 01C514 8001B914 3C0C8016 */ lui $t4, %hi(gActorList) # $t4, 0x8016 -/* 01C518 8001B918 0041001A */ div $zero, $v0, $at -/* 01C51C 8001B91C 00007010 */ mfhi $t6 -/* 01C520 8001B920 258CF9B8 */ addiu $t4, %lo(gActorList) # addiu $t4, $t4, -0x648 -/* 01C524 8001B924 55C00144 */ bnel $t6, $zero, .L8001BE38 -/* 01C528 8001B928 28412710 */ slti $at, $v0, 0x2710 -/* 01C52C 8001B92C 86030008 */ lh $v1, 8($s0) -/* 01C530 8001B930 28610005 */ slti $at, $v1, 5 -/* 01C534 8001B934 1020003C */ beqz $at, .L8001BA28 -/* 01C538 8001B938 00036880 */ sll $t5, $v1, 2 -/* 01C53C 8001B93C 86180002 */ lh $t8, 2($s0) -/* 01C540 8001B940 2C610005 */ sltiu $at, $v1, 5 -/* 01C544 8001B944 00001025 */ move $v0, $zero -/* 01C548 8001B948 001858C0 */ sll $t3, $t8, 3 -/* 01C54C 8001B94C 01785823 */ subu $t3, $t3, $t8 -/* 01C550 8001B950 000B5900 */ sll $t3, $t3, 4 -/* 01C554 8001B954 10200023 */ beqz $at, .L8001B9E4 -/* 01C558 8001B958 016C3821 */ addu $a3, $t3, $t4 -/* 01C55C 8001B95C 3C01800F */ lui $at, %hi(jpt_800ED4A0) -/* 01C560 8001B960 002D0821 */ addu $at, $at, $t5 -/* 01C564 8001B964 8C2DD4A0 */ lw $t5, %lo(jpt_800ED4A0)($at) -/* 01C568 8001B968 01A00008 */ jr $t5 -/* 01C56C 8001B96C 00000000 */ nop -glabel L8001B970 -/* 01C570 8001B970 84F9001A */ lh $t9, 0x1a($a3) -/* 01C574 8001B974 2405FFFF */ li $a1, -1 -/* 01C578 8001B978 50B9001B */ beql $a1, $t9, .L8001B9E8 -/* 01C57C 8001B97C 84EC0000 */ lh $t4, ($a3) -/* 01C580 8001B980 10000018 */ b .L8001B9E4 -/* 01C584 8001B984 01001025 */ move $v0, $t0 -glabel L8001B988 -/* 01C588 8001B988 84EF0018 */ lh $t7, 0x18($a3) -/* 01C58C 8001B98C 2405FFFF */ li $a1, -1 -/* 01C590 8001B990 50AF0015 */ beql $a1, $t7, .L8001B9E8 -/* 01C594 8001B994 84EC0000 */ lh $t4, ($a3) -/* 01C598 8001B998 10000012 */ b .L8001B9E4 -/* 01C59C 8001B99C 01001025 */ move $v0, $t0 -glabel L8001B9A0 -/* 01C5A0 8001B9A0 84EE0016 */ lh $t6, 0x16($a3) -/* 01C5A4 8001B9A4 2405FFFF */ li $a1, -1 -/* 01C5A8 8001B9A8 50AE000F */ beql $a1, $t6, .L8001B9E8 -/* 01C5AC 8001B9AC 84EC0000 */ lh $t4, ($a3) -/* 01C5B0 8001B9B0 1000000C */ b .L8001B9E4 -/* 01C5B4 8001B9B4 01001025 */ move $v0, $t0 -glabel L8001B9B8 -/* 01C5B8 8001B9B8 84F80014 */ lh $t8, 0x14($a3) -/* 01C5BC 8001B9BC 2405FFFF */ li $a1, -1 -/* 01C5C0 8001B9C0 50B80009 */ beql $a1, $t8, .L8001B9E8 -/* 01C5C4 8001B9C4 84EC0000 */ lh $t4, ($a3) -/* 01C5C8 8001B9C8 10000006 */ b .L8001B9E4 -/* 01C5CC 8001B9CC 01001025 */ move $v0, $t0 -glabel L8001B9D0 -/* 01C5D0 8001B9D0 84EB0012 */ lh $t3, 0x12($a3) -/* 01C5D4 8001B9D4 2405FFFF */ li $a1, -1 -/* 01C5D8 8001B9D8 50AB0003 */ beql $a1, $t3, .L8001B9E8 -/* 01C5DC 8001B9DC 84EC0000 */ lh $t4, ($a3) -/* 01C5E0 8001B9E0 01001025 */ move $v0, $t0 -.L8001B9E4: -/* 01C5E4 8001B9E4 84EC0000 */ lh $t4, ($a3) -.L8001B9E8: -/* 01C5E8 8001B9E8 2405000E */ li $a1, 14 -/* 01C5EC 8001B9EC 54AC000B */ bnel $a1, $t4, .L8001BA1C -/* 01C5F0 8001B9F0 24790001 */ addiu $t9, $v1, 1 -/* 01C5F4 8001B9F4 84ED0006 */ lh $t5, 6($a3) -/* 01C5F8 8001B9F8 24060006 */ li $a2, 6 -/* 01C5FC 8001B9FC 54CD0007 */ bnel $a2, $t5, .L8001BA1C -/* 01C600 8001BA00 24790001 */ addiu $t9, $v1, 1 -/* 01C604 8001BA04 54480005 */ bnel $v0, $t0, .L8001BA1C -/* 01C608 8001BA08 24790001 */ addiu $t9, $v1, 1 -/* 01C60C 8001BA0C 0C0AC192 */ jal func_802B0648 -/* 01C610 8001BA10 00E02025 */ move $a0, $a3 -/* 01C614 8001BA14 86030008 */ lh $v1, 8($s0) -/* 01C618 8001BA18 24790001 */ addiu $t9, $v1, 1 -.L8001BA1C: -/* 01C61C 8001BA1C A6190008 */ sh $t9, 8($s0) -/* 01C620 8001BA20 10000104 */ b .L8001BE34 -/* 01C624 8001BA24 86020004 */ lh $v0, 4($s0) -.L8001BA28: -/* 01C628 8001BA28 A6000004 */ sh $zero, 4($s0) -/* 01C62C 8001BA2C A6000000 */ sh $zero, ($s0) -/* 01C630 8001BA30 10000100 */ b .L8001BE34 -/* 01C634 8001BA34 86020004 */ lh $v0, 4($s0) -glabel L8001BA38 -/* 01C638 8001BA38 0C0ACB10 */ jal use_fake_itembox_item -/* 01C63C 8001BA3C 8FA4002C */ lw $a0, 0x2c($sp) -/* 01C640 8001BA40 A6020002 */ sh $v0, 2($s0) -/* 01C644 8001BA44 86030002 */ lh $v1, 2($s0) -/* 01C648 8001BA48 04600010 */ bltz $v1, .L8001BA8C -/* 01C64C 8001BA4C 28610064 */ slti $at, $v1, 0x64 -/* 01C650 8001BA50 1020000E */ beqz $at, .L8001BA8C -/* 01C654 8001BA54 2405000E */ li $a1, 14 -/* 01C658 8001BA58 860F0006 */ lh $t7, 6($s0) -/* 01C65C 8001BA5C A6050000 */ sh $a1, ($s0) -/* 01C660 8001BA60 A6000004 */ sh $zero, 4($s0) -/* 01C664 8001BA64 25EE0001 */ addiu $t6, $t7, 1 -/* 01C668 8001BA68 A60E0006 */ sh $t6, 6($s0) -/* 01C66C 8001BA6C 0C0ADF8D */ jal random_int -/* 01C670 8001BA70 24040003 */ li $a0, 3 -/* 01C674 8001BA74 0002C080 */ sll $t8, $v0, 2 -/* 01C678 8001BA78 0302C021 */ addu $t8, $t8, $v0 -/* 01C67C 8001BA7C 0018C080 */ sll $t8, $t8, 2 -/* 01C680 8001BA80 270B000A */ addiu $t3, $t8, 0xa -/* 01C684 8001BA84 10000002 */ b .L8001BA90 -/* 01C688 8001BA88 A60B000E */ sh $t3, 0xe($s0) -.L8001BA8C: -/* 01C68C 8001BA8C A6000000 */ sh $zero, ($s0) -.L8001BA90: -/* 01C690 8001BA90 100000E8 */ b .L8001BE34 -/* 01C694 8001BA94 86020004 */ lh $v0, 4($s0) -glabel L8001BA98 -/* 01C698 8001BA98 860C0002 */ lh $t4, 2($s0) -/* 01C69C 8001BA9C 3C198016 */ lui $t9, %hi(gActorList) # $t9, 0x8016 -/* 01C6A0 8001BAA0 2739F9B8 */ addiu $t9, %lo(gActorList) # addiu $t9, $t9, -0x648 -/* 01C6A4 8001BAA4 000C68C0 */ sll $t5, $t4, 3 -/* 01C6A8 8001BAA8 01AC6823 */ subu $t5, $t5, $t4 -/* 01C6AC 8001BAAC 000D6900 */ sll $t5, $t5, 4 -/* 01C6B0 8001BAB0 01B93821 */ addu $a3, $t5, $t9 -/* 01C6B4 8001BAB4 84E30002 */ lh $v1, 2($a3) -/* 01C6B8 8001BAB8 306F8000 */ andi $t7, $v1, 0x8000 -/* 01C6BC 8001BABC 51E00010 */ beql $t7, $zero, .L8001BB00 -/* 01C6C0 8001BAC0 A6000004 */ sh $zero, 4($s0) -/* 01C6C4 8001BAC4 84EE0000 */ lh $t6, ($a3) -/* 01C6C8 8001BAC8 2401000D */ li $at, 13 -/* 01C6CC 8001BACC 55C1000C */ bnel $t6, $at, .L8001BB00 -/* 01C6D0 8001BAD0 A6000004 */ sh $zero, 4($s0) -/* 01C6D4 8001BAD4 84F80006 */ lh $t8, 6($a3) -/* 01C6D8 8001BAD8 57000009 */ bnel $t8, $zero, .L8001BB00 -/* 01C6DC 8001BADC A6000004 */ sh $zero, 4($s0) -/* 01C6E0 8001BAE0 C4E40024 */ lwc1 $f4, 0x24($a3) -/* 01C6E4 8001BAE4 8FAB0030 */ lw $t3, 0x30($sp) -/* 01C6E8 8001BAE8 4600218D */ trunc.w.s $f6, $f4 -/* 01C6EC 8001BAEC 440D3000 */ mfc1 $t5, $f6 -/* 01C6F0 8001BAF0 00000000 */ nop -/* 01C6F4 8001BAF4 516D0006 */ beql $t3, $t5, .L8001BB10 -/* 01C6F8 8001BAF8 86020004 */ lh $v0, 4($s0) -/* 01C6FC 8001BAFC A6000004 */ sh $zero, 4($s0) -.L8001BB00: -/* 01C700 8001BB00 A6000000 */ sh $zero, ($s0) -/* 01C704 8001BB04 100000CB */ b .L8001BE34 -/* 01C708 8001BB08 86020004 */ lh $v0, 4($s0) -/* 01C70C 8001BB0C 86020004 */ lh $v0, 4($s0) -.L8001BB10: -/* 01C710 8001BB10 8619000E */ lh $t9, 0xe($s0) -/* 01C714 8001BB14 240F000F */ li $t7, 15 -/* 01C718 8001BB18 0322082A */ slt $at, $t9, $v0 -/* 01C71C 8001BB1C 502000C6 */ beql $at, $zero, .L8001BE38 -/* 01C720 8001BB20 28412710 */ slti $at, $v0, 0x2710 -/* 01C724 8001BB24 A60F0000 */ sh $t7, ($s0) -/* 01C728 8001BB28 100000C2 */ b .L8001BE34 -/* 01C72C 8001BB2C 86020004 */ lh $v0, 4($s0) -glabel L8001BB30 -/* 01C730 8001BB30 860E0002 */ lh $t6, 2($s0) -/* 01C734 8001BB34 3C0C8016 */ lui $t4, %hi(gActorList) # $t4, 0x8016 -/* 01C738 8001BB38 258CF9B8 */ addiu $t4, %lo(gActorList) # addiu $t4, $t4, -0x648 -/* 01C73C 8001BB3C 000EC0C0 */ sll $t8, $t6, 3 -/* 01C740 8001BB40 030EC023 */ subu $t8, $t8, $t6 -/* 01C744 8001BB44 0018C100 */ sll $t8, $t8, 4 -/* 01C748 8001BB48 030C3821 */ addu $a3, $t8, $t4 -/* 01C74C 8001BB4C 84E30002 */ lh $v1, 2($a3) -/* 01C750 8001BB50 8FAC0030 */ lw $t4, 0x30($sp) -/* 01C754 8001BB54 306B8000 */ andi $t3, $v1, 0x8000 -/* 01C758 8001BB58 51600011 */ beql $t3, $zero, .L8001BBA0 -/* 01C75C 8001BB5C 84EB0010 */ lh $t3, 0x10($a3) -/* 01C760 8001BB60 84ED0000 */ lh $t5, ($a3) -/* 01C764 8001BB64 2401000D */ li $at, 13 -/* 01C768 8001BB68 55A1000D */ bnel $t5, $at, .L8001BBA0 -/* 01C76C 8001BB6C 84EB0010 */ lh $t3, 0x10($a3) -/* 01C770 8001BB70 84F90006 */ lh $t9, 6($a3) -/* 01C774 8001BB74 5720000A */ bnel $t9, $zero, .L8001BBA0 -/* 01C778 8001BB78 84EB0010 */ lh $t3, 0x10($a3) -/* 01C77C 8001BB7C C4E80024 */ lwc1 $f8, 0x24($a3) -/* 01C780 8001BB80 8FAF0030 */ lw $t7, 0x30($sp) -/* 01C784 8001BB84 00E02025 */ move $a0, $a3 -/* 01C788 8001BB88 4600428D */ trunc.w.s $f10, $f8 -/* 01C78C 8001BB8C 44185000 */ mfc1 $t8, $f10 -/* 01C790 8001BB90 00000000 */ nop -/* 01C794 8001BB94 11F80006 */ beq $t7, $t8, .L8001BBB0 -/* 01C798 8001BB98 00000000 */ nop -/* 01C79C 8001BB9C 84EB0010 */ lh $t3, 0x10($a3) -.L8001BBA0: -/* 01C7A0 8001BBA0 518B001E */ beql $t4, $t3, .L8001BC1C -/* 01C7A4 8001BBA4 A6000004 */ sh $zero, 4($s0) -/* 01C7A8 8001BBA8 1000001C */ b .L8001BC1C -/* 01C7AC 8001BBAC A6000004 */ sh $zero, 4($s0) -.L8001BBB0: -/* 01C7B0 8001BBB0 0C0A8419 */ jal func_802A1064 -/* 01C7B4 8001BBB4 AFA70028 */ sw $a3, 0x28($sp) -/* 01C7B8 8001BBB8 8FAA0030 */ lw $t2, 0x30($sp) -/* 01C7BC 8001BBBC 3C198016 */ lui $t9, %hi(D_801631E0) # 0x8016 -/* 01C7C0 8001BBC0 24080001 */ li $t0, 1 -/* 01C7C4 8001BBC4 000A6840 */ sll $t5, $t2, 1 -/* 01C7C8 8001BBC8 032DC821 */ addu $t9, $t9, $t5 -/* 01C7CC 8001BBCC 973931E0 */ lhu $t9, %lo(D_801631E0)($t9) # 0x31e0($t9) -/* 01C7D0 8001BBD0 8FA70028 */ lw $a3, 0x28($sp) -/* 01C7D4 8001BBD4 3C01403E */ li $at, 0x403E0000 # 2.968750 -/* 01C7D8 8001BBD8 55190010 */ bnel $t0, $t9, .L8001BC1C -/* 01C7DC 8001BBDC A6000004 */ sh $zero, 4($s0) -/* 01C7E0 8001BBE0 C4F0001C */ lwc1 $f16, 0x1c($a3) -/* 01C7E4 8001BBE4 44812800 */ mtc1 $at, $f5 -/* 01C7E8 8001BBE8 44802000 */ mtc1 $zero, $f4 -/* 01C7EC 8001BBEC 460084A1 */ cvt.d.s $f18, $f16 -/* 01C7F0 8001BBF0 C4EC0018 */ lwc1 $f12, 0x18($a3) -/* 01C7F4 8001BBF4 46249180 */ add.d $f6, $f18, $f4 -/* 01C7F8 8001BBF8 8CE60020 */ lw $a2, 0x20($a3) -/* 01C7FC 8001BBFC AFA70028 */ sw $a3, 0x28($sp) -/* 01C800 8001BC00 0C0AB870 */ jal spawn_actor_on_surface -/* 01C804 8001BC04 462033A0 */ cvt.s.d $f14, $f6 -/* 01C808 8001BC08 8FA70028 */ lw $a3, 0x28($sp) -/* 01C80C 8001BC0C C4E8000C */ lwc1 $f8, 0xc($a3) -/* 01C810 8001BC10 46080280 */ add.s $f10, $f0, $f8 -/* 01C814 8001BC14 E4EA001C */ swc1 $f10, 0x1c($a3) -/* 01C818 8001BC18 A6000004 */ sh $zero, 4($s0) -.L8001BC1C: -/* 01C81C 8001BC1C A6000000 */ sh $zero, ($s0) -/* 01C820 8001BC20 10000084 */ b .L8001BE34 -/* 01C824 8001BC24 86020004 */ lh $v0, 4($s0) -glabel L8001BC28 -/* 01C828 8001BC28 0C0ACBAF */ jal use_thunder_item -/* 01C82C 8001BC2C 8FA4002C */ lw $a0, 0x2c($sp) -/* 01C830 8001BC30 8FAA0030 */ lw $t2, 0x30($sp) -/* 01C834 8001BC34 0C032B18 */ jal func_800CAC60 -/* 01C838 8001BC38 314400FF */ andi $a0, $t2, 0xff -/* 01C83C 8001BC3C 0C02796F */ jal func_8009E5BC -/* 01C840 8001BC40 00000000 */ nop -/* 01C844 8001BC44 860F0006 */ lh $t7, 6($s0) -/* 01C848 8001BC48 240E0017 */ li $t6, 23 -/* 01C84C 8001BC4C A6000004 */ sh $zero, 4($s0) -/* 01C850 8001BC50 25F80001 */ addiu $t8, $t7, 1 -/* 01C854 8001BC54 A60E0000 */ sh $t6, ($s0) -/* 01C858 8001BC58 A6180006 */ sh $t8, 6($s0) -/* 01C85C 8001BC5C 10000075 */ b .L8001BE34 -/* 01C860 8001BC60 86020004 */ lh $v0, 4($s0) -glabel L8001BC64 -/* 01C864 8001BC64 86020004 */ lh $v0, 4($s0) -/* 01C868 8001BC68 284100F1 */ slti $at, $v0, 0xf1 -/* 01C86C 8001BC6C 54200072 */ bnel $at, $zero, .L8001BE38 -/* 01C870 8001BC70 28412710 */ slti $at, $v0, 0x2710 -/* 01C874 8001BC74 0C032B50 */ jal func_800CAD40 -/* 01C878 8001BC78 93A40033 */ lbu $a0, 0x33($sp) -/* 01C87C 8001BC7C A6000004 */ sh $zero, 4($s0) -/* 01C880 8001BC80 A6000000 */ sh $zero, ($s0) -/* 01C884 8001BC84 1000006B */ b .L8001BE34 -/* 01C888 8001BC88 86020004 */ lh $v0, 4($s0) -glabel L8001BC8C -/* 01C88C 8001BC8C 8FAC002C */ lw $t4, 0x2c($sp) -/* 01C890 8001BC90 2419001A */ li $t9, 26 -/* 01C894 8001BC94 8D8B000C */ lw $t3, 0xc($t4) -/* 01C898 8001BC98 356D2000 */ ori $t5, $t3, 0x2000 -/* 01C89C 8001BC9C AD8D000C */ sw $t5, 0xc($t4) -/* 01C8A0 8001BCA0 860E0006 */ lh $t6, 6($s0) -/* 01C8A4 8001BCA4 A6000004 */ sh $zero, 4($s0) -/* 01C8A8 8001BCA8 A6190000 */ sh $t9, ($s0) -/* 01C8AC 8001BCAC 25CF0001 */ addiu $t7, $t6, 1 -/* 01C8B0 8001BCB0 A60F0006 */ sh $t7, 6($s0) -/* 01C8B4 8001BCB4 1000005F */ b .L8001BE34 -/* 01C8B8 8001BCB8 86020004 */ lh $v0, 4($s0) -glabel L8001BCBC -/* 01C8BC 8001BCBC 8FB8002C */ lw $t8, 0x2c($sp) -/* 01C8C0 8001BCC0 8F0B00BC */ lw $t3, 0xbc($t8) -/* 01C8C4 8001BCC4 316D0200 */ andi $t5, $t3, 0x200 -/* 01C8C8 8001BCC8 55A00003 */ bnel $t5, $zero, .L8001BCD8 -/* 01C8CC 8001BCCC A6000004 */ sh $zero, 4($s0) -/* 01C8D0 8001BCD0 A6000000 */ sh $zero, ($s0) -/* 01C8D4 8001BCD4 A6000004 */ sh $zero, 4($s0) -.L8001BCD8: -/* 01C8D8 8001BCD8 10000056 */ b .L8001BE34 -/* 01C8DC 8001BCDC 86020004 */ lh $v0, 4($s0) -glabel L8001BCE0 -/* 01C8E0 8001BCE0 8FAC002C */ lw $t4, 0x2c($sp) -/* 01C8E4 8001BCE4 240F001C */ li $t7, 28 -/* 01C8E8 8001BCE8 8D99000C */ lw $t9, 0xc($t4) -/* 01C8EC 8001BCEC 372E0800 */ ori $t6, $t9, 0x800 -/* 01C8F0 8001BCF0 AD8E000C */ sw $t6, 0xc($t4) -/* 01C8F4 8001BCF4 86180006 */ lh $t8, 6($s0) -/* 01C8F8 8001BCF8 A6000004 */ sh $zero, 4($s0) -/* 01C8FC 8001BCFC A60F0000 */ sh $t7, ($s0) -/* 01C900 8001BD00 270B0001 */ addiu $t3, $t8, 1 -/* 01C904 8001BD04 A60B0006 */ sh $t3, 6($s0) -/* 01C908 8001BD08 1000004A */ b .L8001BE34 -/* 01C90C 8001BD0C 86020004 */ lh $v0, 4($s0) -glabel L8001BD10 -/* 01C910 8001BD10 8FAD002C */ lw $t5, 0x2c($sp) -/* 01C914 8001BD14 8DB900BC */ lw $t9, 0xbc($t5) -/* 01C918 8001BD18 00197000 */ sll $t6, $t9, 0 -/* 01C91C 8001BD1C 05C20003 */ bltzl $t6, .L8001BD2C -/* 01C920 8001BD20 A6000004 */ sh $zero, 4($s0) -/* 01C924 8001BD24 A6000000 */ sh $zero, ($s0) -/* 01C928 8001BD28 A6000004 */ sh $zero, 4($s0) -.L8001BD2C: -/* 01C92C 8001BD2C 10000041 */ b .L8001BE34 -/* 01C930 8001BD30 86020004 */ lh $v0, 4($s0) -glabel L8001BD34 -/* 01C934 8001BD34 8FAC002C */ lw $t4, 0x2c($sp) -/* 01C938 8001BD38 8D8F000C */ lw $t7, 0xc($t4) -/* 01C93C 8001BD3C 35F80200 */ ori $t8, $t7, 0x200 -/* 01C940 8001BD40 AD98000C */ sw $t8, 0xc($t4) -/* 01C944 8001BD44 860B0006 */ lh $t3, 6($s0) -/* 01C948 8001BD48 A6000004 */ sh $zero, 4($s0) -/* 01C94C 8001BD4C A6000000 */ sh $zero, ($s0) -/* 01C950 8001BD50 256D0001 */ addiu $t5, $t3, 1 -/* 01C954 8001BD54 A60D0006 */ sh $t5, 6($s0) -/* 01C958 8001BD58 10000036 */ b .L8001BE34 -/* 01C95C 8001BD5C 86020004 */ lh $v0, 4($s0) -glabel L8001BD60 -/* 01C960 8001BD60 86020004 */ lh $v0, 4($s0) -/* 01C964 8001BD64 8FB9002C */ lw $t9, 0x2c($sp) -/* 01C968 8001BD68 2841003D */ slti $at, $v0, 0x3d -/* 01C96C 8001BD6C 54200032 */ bnel $at, $zero, .L8001BE38 -/* 01C970 8001BD70 28412710 */ slti $at, $v0, 0x2710 -/* 01C974 8001BD74 8F2E000C */ lw $t6, 0xc($t9) -/* 01C978 8001BD78 2418001D */ li $t8, 29 -/* 01C97C 8001BD7C 35CF0200 */ ori $t7, $t6, 0x200 -/* 01C980 8001BD80 AF2F000C */ sw $t7, 0xc($t9) -/* 01C984 8001BD84 A6000004 */ sh $zero, 4($s0) -/* 01C988 8001BD88 A6180000 */ sh $t8, ($s0) -/* 01C98C 8001BD8C 10000029 */ b .L8001BE34 -/* 01C990 8001BD90 86020004 */ lh $v0, 4($s0) -glabel L8001BD94 -/* 01C994 8001BD94 86020004 */ lh $v0, 4($s0) -/* 01C998 8001BD98 8FAC002C */ lw $t4, 0x2c($sp) -/* 01C99C 8001BD9C 2841003D */ slti $at, $v0, 0x3d -/* 01C9A0 8001BDA0 54200025 */ bnel $at, $zero, .L8001BE38 -/* 01C9A4 8001BDA4 28412710 */ slti $at, $v0, 0x2710 -/* 01C9A8 8001BDA8 8D8B000C */ lw $t3, 0xc($t4) -/* 01C9AC 8001BDAC 240E001E */ li $t6, 30 -/* 01C9B0 8001BDB0 356D0200 */ ori $t5, $t3, 0x200 -/* 01C9B4 8001BDB4 AD8D000C */ sw $t5, 0xc($t4) -/* 01C9B8 8001BDB8 A6000004 */ sh $zero, 4($s0) -/* 01C9BC 8001BDBC A60E0000 */ sh $t6, ($s0) -/* 01C9C0 8001BDC0 1000001C */ b .L8001BE34 -/* 01C9C4 8001BDC4 86020004 */ lh $v0, 4($s0) -glabel L8001BDC8 -/* 01C9C8 8001BDC8 240F0021 */ li $t7, 33 -/* 01C9CC 8001BDCC A6000004 */ sh $zero, 4($s0) -/* 01C9D0 8001BDD0 24190258 */ li $t9, 600 -/* 01C9D4 8001BDD4 A60F0000 */ sh $t7, ($s0) -/* 01C9D8 8001BDD8 A619000E */ sh $t9, 0xe($s0) -/* 01C9DC 8001BDDC 10000015 */ b .L8001BE34 -/* 01C9E0 8001BDE0 86020004 */ lh $v0, 4($s0) -glabel L8001BDE4 -/* 01C9E4 8001BDE4 86020004 */ lh $v0, 4($s0) -/* 01C9E8 8001BDE8 2401003C */ li $at, 60 -/* 01C9EC 8001BDEC 8FAB002C */ lw $t3, 0x2c($sp) -/* 01C9F0 8001BDF0 0041001A */ div $zero, $v0, $at -/* 01C9F4 8001BDF4 0000C010 */ mfhi $t8 -/* 01C9F8 8001BDF8 5700000F */ bnel $t8, $zero, .L8001BE38 -/* 01C9FC 8001BDFC 28412710 */ slti $at, $v0, 0x2710 -/* 01CA00 8001BE00 8D6D000C */ lw $t5, 0xc($t3) -/* 01CA04 8001BE04 35AC0200 */ ori $t4, $t5, 0x200 -/* 01CA08 8001BE08 AD6C000C */ sw $t4, 0xc($t3) -/* 01CA0C 8001BE0C 860E000E */ lh $t6, 0xe($s0) -/* 01CA10 8001BE10 86020004 */ lh $v0, 4($s0) -/* 01CA14 8001BE14 01C2082A */ slt $at, $t6, $v0 -/* 01CA18 8001BE18 50200007 */ beql $at, $zero, .L8001BE38 -/* 01CA1C 8001BE1C 28412710 */ slti $at, $v0, 0x2710 -/* 01CA20 8001BE20 A6000004 */ sh $zero, 4($s0) -/* 01CA24 8001BE24 86020004 */ lh $v0, 4($s0) -/* 01CA28 8001BE28 10000002 */ b .L8001BE34 -/* 01CA2C 8001BE2C A6000000 */ sh $zero, ($s0) -.L8001BE30: -glabel L8001BE30 -/* 01CA30 8001BE30 86020004 */ lh $v0, 4($s0) -.L8001BE34: -/* 01CA34 8001BE34 28412710 */ slti $at, $v0, 0x2710 -.L8001BE38: -/* 01CA38 8001BE38 10200002 */ beqz $at, .L8001BE44 -/* 01CA3C 8001BE3C 244F0001 */ addiu $t7, $v0, 1 -/* 01CA40 8001BE40 A60F0004 */ sh $t7, 4($s0) -.L8001BE44: -/* 01CA44 8001BE44 8FB9002C */ lw $t9, 0x2c($sp) -/* 01CA48 8001BE48 3C018000 */ lui $at, (0x80002200 >> 16) # lui $at, 0x8000 -/* 01CA4C 8001BE4C 34212200 */ ori $at, (0x80002200 & 0xFFFF) # ori $at, $at, 0x2200 -/* 01CA50 8001BE50 8F3800BC */ lw $t8, 0xbc($t9) -/* 01CA54 8001BE54 03016824 */ and $t5, $t8, $at -/* 01CA58 8001BE58 51A00003 */ beql $t5, $zero, .L8001BE68 -/* 01CA5C 8001BE5C 8FBF0024 */ lw $ra, 0x24($sp) -/* 01CA60 8001BE60 A6000004 */ sh $zero, 4($s0) -.L8001BE64: -/* 01CA64 8001BE64 8FBF0024 */ lw $ra, 0x24($sp) -.L8001BE68: -/* 01CA68 8001BE68 8FB00020 */ lw $s0, 0x20($sp) -/* 01CA6C 8001BE6C 27BD0030 */ addiu $sp, $sp, 0x30 -/* 01CA70 8001BE70 03E00008 */ jr $ra -/* 01CA74 8001BE74 00000000 */ nop diff --git a/asm/non_matchings/code_80057C60/func_8005F90C.s b/asm/non_matchings/code_80057C60/func_8005F90C.s deleted file mode 100644 index 783f990161..0000000000 --- a/asm/non_matchings/code_80057C60/func_8005F90C.s +++ /dev/null @@ -1,822 +0,0 @@ -.section .late_rodata - -glabel jpt_800EE52C -.word L800603C8, L8005F9A0, L8005FF28, L800603C8 -.word L800602A0, L800603C8, L8005FE00, L8005FC60 -.word L800604EC, L80060050, L800602A0, L800604EC -.word L80060178 - -.section .text - -glabel func_8005F90C -/* 06050C 8005F90C 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 060510 8005F910 AFBF0034 */ sw $ra, 0x34($sp) -/* 060514 8005F914 AFB20030 */ sw $s2, 0x30($sp) -/* 060518 8005F918 AFB1002C */ sw $s1, 0x2c($sp) -/* 06051C 8005F91C AFB00028 */ sw $s0, 0x28($sp) -/* 060520 8005F920 AFA5003C */ sw $a1, 0x3c($sp) -/* 060524 8005F924 AFA70044 */ sw $a3, 0x44($sp) -/* 060528 8005F928 8C8E00BC */ lw $t6, 0xbc($a0) -/* 06052C 8005F92C 24010080 */ li $at, 128 -/* 060530 8005F930 00808825 */ move $s1, $a0 -/* 060534 8005F934 31CF0080 */ andi $t7, $t6, 0x80 -/* 060538 8005F938 15E10009 */ bne $t7, $at, .L8005F960 -/* 06053C 8005F93C 00004825 */ move $t1, $zero -/* 060540 8005F940 C4840018 */ lwc1 $f4, 0x18($a0) -/* 060544 8005F944 C4860070 */ lwc1 $f6, 0x70($a0) -/* 060548 8005F948 C4800014 */ lwc1 $f0, 0x14($a0) -/* 06054C 8005F94C C48C001C */ lwc1 $f12, 0x1c($a0) -/* 060550 8005F950 24090001 */ li $t1, 1 -/* 060554 8005F954 908201D4 */ lbu $v0, 0x1d4($a0) -/* 060558 8005F958 10000007 */ b .L8005F978 -/* 06055C 8005F95C 46062081 */ sub.s $f2, $f4, $f6 -.L8005F960: -/* 060560 8005F960 C6280018 */ lwc1 $f8, 0x18($s1) -/* 060564 8005F964 C62A0070 */ lwc1 $f10, 0x70($s1) -/* 060568 8005F968 C6200014 */ lwc1 $f0, 0x14($s1) -/* 06056C 8005F96C C62C001C */ lwc1 $f12, 0x1c($s1) -/* 060570 8005F970 922201EC */ lbu $v0, 0x1ec($s1) -/* 060574 8005F974 460A4081 */ sub.s $f2, $f8, $f10 -.L8005F978: -/* 060578 8005F978 244CFFFF */ addiu $t4, $v0, -1 -/* 06057C 8005F97C 2D81000D */ sltiu $at, $t4, 0xd -/* 060580 8005F980 102002DA */ beqz $at, .L800604EC -/* 060584 8005F984 00401825 */ move $v1, $v0 -/* 060588 8005F988 000C6080 */ sll $t4, $t4, 2 -/* 06058C 8005F98C 3C01800F */ lui $at, %hi(jpt_800EE52C) -/* 060590 8005F990 002C0821 */ addu $at, $at, $t4 -/* 060594 8005F994 8C2CE52C */ lw $t4, %lo(jpt_800EE52C)($at) -/* 060598 8005F998 01800008 */ jr $t4 -/* 06059C 8005F99C 00000000 */ nop -glabel L8005F9A0 -/* 0605A0 8005F9A0 87AD003E */ lh $t5, 0x3e($sp) -/* 0605A4 8005F9A4 24080048 */ li $t0, 72 -/* 0605A8 8005F9A8 55A00059 */ bnel $t5, $zero, .L8005FB10 -/* 0605AC 8005F9AC 24080048 */ li $t0, 72 -/* 0605B0 8005F9B0 00C80019 */ multu $a2, $t0 -/* 0605B4 8005F9B4 87B9003E */ lh $t9, 0x3e($sp) -/* 0605B8 8005F9B8 00007012 */ mflo $t6 -/* 0605BC 8005F9BC 022E1021 */ addu $v0, $s1, $t6 -/* 0605C0 8005F9C0 844F0546 */ lh $t7, 0x546($v0) -/* 0605C4 8005F9C4 1DE00004 */ bgtz $t7, .L8005F9D8 -/* 0605C8 8005F9C8 00000000 */ nop -/* 0605CC 8005F9CC 84580544 */ lh $t8, 0x544($v0) -/* 0605D0 8005F9D0 5700004F */ bnel $t8, $zero, .L8005FB10 -/* 0605D4 8005F9D4 24080048 */ li $t0, 72 -.L8005F9D8: -/* 0605D8 8005F9D8 03280019 */ multu $t9, $t0 -/* 0605DC 8005F9DC 44060000 */ mfc1 $a2, $f0 -/* 0605E0 8005F9E0 44071000 */ mfc1 $a3, $f2 -/* 0605E4 8005F9E4 02202025 */ move $a0, $s1 -/* 0605E8 8005F9E8 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 0605EC 8005F9EC AFA30014 */ sw $v1, 0x14($sp) -/* 0605F0 8005F9F0 AFA90018 */ sw $t1, 0x18($sp) -/* 0605F4 8005F9F4 00005012 */ mflo $t2 -/* 0605F8 8005F9F8 022A9021 */ addu $s2, $s1, $t2 -/* 0605FC 8005F9FC 26500528 */ addiu $s0, $s2, 0x528 -/* 060600 8005FA00 0C0175E5 */ jal func_8005D794 -/* 060604 8005FA04 02002825 */ move $a1, $s0 -/* 060608 8005FA08 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 06060C 8005FA0C 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060610 8005FA10 02002025 */ move $a0, $s0 -/* 060614 8005FA14 0C0175F6 */ jal func_8005D7D8 -/* 060618 8005FA18 24050004 */ li $a1, 4 -/* 06061C 8005FA1C 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 060620 8005FA20 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -/* 060624 8005FA24 24010001 */ li $at, 1 -/* 060628 8005FA28 02002025 */ move $a0, $s0 -/* 06062C 8005FA2C 10610003 */ beq $v1, $at, .L8005FA3C -/* 060630 8005FA30 24050001 */ li $a1, 1 -/* 060634 8005FA34 24010007 */ li $at, 7 -/* 060638 8005FA38 14610005 */ bne $v1, $at, .L8005FA50 -.L8005FA3C: -/* 06063C 8005FA3C 00003025 */ move $a2, $zero -/* 060640 8005FA40 0C0176B6 */ jal func_8005DAD8 -/* 060644 8005FA44 24070080 */ li $a3, 128 -/* 060648 8005FA48 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 06064C 8005FA4C 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FA50: -/* 060650 8005FA50 2401000B */ li $at, 11 -/* 060654 8005FA54 14610007 */ bne $v1, $at, .L8005FA74 -/* 060658 8005FA58 02002025 */ move $a0, $s0 -/* 06065C 8005FA5C 24050007 */ li $a1, 7 -/* 060660 8005FA60 00003025 */ move $a2, $zero -/* 060664 8005FA64 0C0176B6 */ jal func_8005DAD8 -/* 060668 8005FA68 24070080 */ li $a3, 128 -/* 06066C 8005FA6C 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 060670 8005FA70 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FA74: -/* 060674 8005FA74 24010009 */ li $at, 9 -/* 060678 8005FA78 14610007 */ bne $v1, $at, .L8005FA98 -/* 06067C 8005FA7C 02002025 */ move $a0, $s0 -/* 060680 8005FA80 24050008 */ li $a1, 8 -/* 060684 8005FA84 00003025 */ move $a2, $zero -/* 060688 8005FA88 0C0176B6 */ jal func_8005DAD8 -/* 06068C 8005FA8C 24070080 */ li $a3, 128 -/* 060690 8005FA90 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 060694 8005FA94 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FA98: -/* 060698 8005FA98 2401000E */ li $at, 14 -/* 06069C 8005FA9C 14610007 */ bne $v1, $at, .L8005FABC -/* 0606A0 8005FAA0 02002025 */ move $a0, $s0 -/* 0606A4 8005FAA4 24050009 */ li $a1, 9 -/* 0606A8 8005FAA8 00003025 */ move $a2, $zero -/* 0606AC 8005FAAC 0C0176B6 */ jal func_8005DAD8 -/* 0606B0 8005FAB0 24070080 */ li $a3, 128 -/* 0606B4 8005FAB4 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 0606B8 8005FAB8 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FABC: -/* 0606BC 8005FABC 24010004 */ li $at, 4 -/* 0606C0 8005FAC0 14610007 */ bne $v1, $at, .L8005FAE0 -/* 0606C4 8005FAC4 02002025 */ move $a0, $s0 -/* 0606C8 8005FAC8 2405000A */ li $a1, 10 -/* 0606CC 8005FACC 00003025 */ move $a2, $zero -/* 0606D0 8005FAD0 0C0176B6 */ jal func_8005DAD8 -/* 0606D4 8005FAD4 24070080 */ li $a3, 128 -/* 0606D8 8005FAD8 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 0606DC 8005FADC 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FAE0: -/* 0606E0 8005FAE0 24010012 */ li $at, 18 -/* 0606E4 8005FAE4 14610005 */ bne $v1, $at, .L8005FAFC -/* 0606E8 8005FAE8 02002025 */ move $a0, $s0 -/* 0606EC 8005FAEC 2405000B */ li $a1, 11 -/* 0606F0 8005FAF0 00003025 */ move $a2, $zero -/* 0606F4 8005FAF4 0C0176B6 */ jal func_8005DAD8 -/* 0606F8 8005FAF8 24070080 */ li $a3, 128 -.L8005FAFC: -/* 0606FC 8005FAFC 0C0ADF8D */ jal random_int -/* 060700 8005FB00 24040010 */ li $a0, 16 -/* 060704 8005FB04 10000279 */ b .L800604EC -/* 060708 8005FB08 A6420562 */ sh $v0, 0x562($s2) -/* 06070C 8005FB0C 24080048 */ li $t0, 72 -.L8005FB10: -/* 060710 8005FB10 00C80019 */ multu $a2, $t0 -/* 060714 8005FB14 87AE003E */ lh $t6, 0x3e($sp) -/* 060718 8005FB18 00005812 */ mflo $t3 -/* 06071C 8005FB1C 022B6021 */ addu $t4, $s1, $t3 -/* 060720 8005FB20 858D0546 */ lh $t5, 0x546($t4) -/* 060724 8005FB24 59A00272 */ blezl $t5, .L800604F0 -/* 060728 8005FB28 8FBF0034 */ lw $ra, 0x34($sp) -/* 06072C 8005FB2C 01C80019 */ multu $t6, $t0 -/* 060730 8005FB30 44060000 */ mfc1 $a2, $f0 -/* 060734 8005FB34 44071000 */ mfc1 $a3, $f2 -/* 060738 8005FB38 02202025 */ move $a0, $s1 -/* 06073C 8005FB3C E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060740 8005FB40 AFA30014 */ sw $v1, 0x14($sp) -/* 060744 8005FB44 AFA90018 */ sw $t1, 0x18($sp) -/* 060748 8005FB48 00007812 */ mflo $t7 -/* 06074C 8005FB4C 022F9021 */ addu $s2, $s1, $t7 -/* 060750 8005FB50 26500528 */ addiu $s0, $s2, 0x528 -/* 060754 8005FB54 0C0175E5 */ jal func_8005D794 -/* 060758 8005FB58 02002825 */ move $a1, $s0 -/* 06075C 8005FB5C 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060760 8005FB60 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060764 8005FB64 02002025 */ move $a0, $s0 -/* 060768 8005FB68 0C0175F6 */ jal func_8005D7D8 -/* 06076C 8005FB6C 24050004 */ li $a1, 4 -/* 060770 8005FB70 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 060774 8005FB74 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -/* 060778 8005FB78 24010001 */ li $at, 1 -/* 06077C 8005FB7C 02002025 */ move $a0, $s0 -/* 060780 8005FB80 10610003 */ beq $v1, $at, .L8005FB90 -/* 060784 8005FB84 24050001 */ li $a1, 1 -/* 060788 8005FB88 24010007 */ li $at, 7 -/* 06078C 8005FB8C 14610005 */ bne $v1, $at, .L8005FBA4 -.L8005FB90: -/* 060790 8005FB90 00003025 */ move $a2, $zero -/* 060794 8005FB94 0C0176B6 */ jal func_8005DAD8 -/* 060798 8005FB98 24070080 */ li $a3, 128 -/* 06079C 8005FB9C 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 0607A0 8005FBA0 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FBA4: -/* 0607A4 8005FBA4 2401000B */ li $at, 11 -/* 0607A8 8005FBA8 14610007 */ bne $v1, $at, .L8005FBC8 -/* 0607AC 8005FBAC 02002025 */ move $a0, $s0 -/* 0607B0 8005FBB0 24050007 */ li $a1, 7 -/* 0607B4 8005FBB4 00003025 */ move $a2, $zero -/* 0607B8 8005FBB8 0C0176B6 */ jal func_8005DAD8 -/* 0607BC 8005FBBC 24070080 */ li $a3, 128 -/* 0607C0 8005FBC0 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 0607C4 8005FBC4 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FBC8: -/* 0607C8 8005FBC8 24010009 */ li $at, 9 -/* 0607CC 8005FBCC 14610007 */ bne $v1, $at, .L8005FBEC -/* 0607D0 8005FBD0 02002025 */ move $a0, $s0 -/* 0607D4 8005FBD4 24050008 */ li $a1, 8 -/* 0607D8 8005FBD8 00003025 */ move $a2, $zero -/* 0607DC 8005FBDC 0C0176B6 */ jal func_8005DAD8 -/* 0607E0 8005FBE0 24070080 */ li $a3, 128 -/* 0607E4 8005FBE4 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 0607E8 8005FBE8 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FBEC: -/* 0607EC 8005FBEC 2401000E */ li $at, 14 -/* 0607F0 8005FBF0 14610007 */ bne $v1, $at, .L8005FC10 -/* 0607F4 8005FBF4 02002025 */ move $a0, $s0 -/* 0607F8 8005FBF8 24050009 */ li $a1, 9 -/* 0607FC 8005FBFC 00003025 */ move $a2, $zero -/* 060800 8005FC00 0C0176B6 */ jal func_8005DAD8 -/* 060804 8005FC04 24070080 */ li $a3, 128 -/* 060808 8005FC08 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 06080C 8005FC0C 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FC10: -/* 060810 8005FC10 24010004 */ li $at, 4 -/* 060814 8005FC14 14610007 */ bne $v1, $at, .L8005FC34 -/* 060818 8005FC18 02002025 */ move $a0, $s0 -/* 06081C 8005FC1C 2405000A */ li $a1, 10 -/* 060820 8005FC20 00003025 */ move $a2, $zero -/* 060824 8005FC24 0C0176B6 */ jal func_8005DAD8 -/* 060828 8005FC28 24070080 */ li $a3, 128 -/* 06082C 8005FC2C 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 060830 8005FC30 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -.L8005FC34: -/* 060834 8005FC34 24010012 */ li $at, 18 -/* 060838 8005FC38 14610005 */ bne $v1, $at, .L8005FC50 -/* 06083C 8005FC3C 02002025 */ move $a0, $s0 -/* 060840 8005FC40 2405000B */ li $a1, 11 -/* 060844 8005FC44 00003025 */ move $a2, $zero -/* 060848 8005FC48 0C0176B6 */ jal func_8005DAD8 -/* 06084C 8005FC4C 24070080 */ li $a3, 128 -.L8005FC50: -/* 060850 8005FC50 0C0ADF8D */ jal random_int -/* 060854 8005FC54 24040010 */ li $a0, 16 -/* 060858 8005FC58 10000224 */ b .L800604EC -/* 06085C 8005FC5C A6420562 */ sh $v0, 0x562($s2) -glabel L8005FC60 -/* 060860 8005FC60 87B8003E */ lh $t8, 0x3e($sp) -/* 060864 8005FC64 24080048 */ li $t0, 72 -/* 060868 8005FC68 5700002F */ bnel $t8, $zero, .L8005FD28 -/* 06086C 8005FC6C 24080048 */ li $t0, 72 -/* 060870 8005FC70 00C80019 */ multu $a2, $t0 -/* 060874 8005FC74 87AC003E */ lh $t4, 0x3e($sp) -/* 060878 8005FC78 0000C812 */ mflo $t9 -/* 06087C 8005FC7C 02391021 */ addu $v0, $s1, $t9 -/* 060880 8005FC80 844A0546 */ lh $t2, 0x546($v0) -/* 060884 8005FC84 1D400004 */ bgtz $t2, .L8005FC98 -/* 060888 8005FC88 00000000 */ nop -/* 06088C 8005FC8C 844B0544 */ lh $t3, 0x544($v0) -/* 060890 8005FC90 55600025 */ bnel $t3, $zero, .L8005FD28 -/* 060894 8005FC94 24080048 */ li $t0, 72 -.L8005FC98: -/* 060898 8005FC98 01880019 */ multu $t4, $t0 -/* 06089C 8005FC9C 44060000 */ mfc1 $a2, $f0 -/* 0608A0 8005FCA0 44071000 */ mfc1 $a3, $f2 -/* 0608A4 8005FCA4 02202025 */ move $a0, $s1 -/* 0608A8 8005FCA8 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 0608AC 8005FCAC AFA30014 */ sw $v1, 0x14($sp) -/* 0608B0 8005FCB0 AFA90018 */ sw $t1, 0x18($sp) -/* 0608B4 8005FCB4 00006812 */ mflo $t5 -/* 0608B8 8005FCB8 022D9021 */ addu $s2, $s1, $t5 -/* 0608BC 8005FCBC 26500528 */ addiu $s0, $s2, 0x528 -/* 0608C0 8005FCC0 0C0175E5 */ jal func_8005D794 -/* 0608C4 8005FCC4 02002825 */ move $a1, $s0 -/* 0608C8 8005FCC8 3C063DCC */ lui $a2, (0x3DCCCCCD >> 16) # lui $a2, 0x3dcc -/* 0608CC 8005FCCC 34C6CCCD */ ori $a2, (0x3DCCCCCD & 0xFFFF) # ori $a2, $a2, 0xcccd -/* 0608D0 8005FCD0 02002025 */ move $a0, $s0 -/* 0608D4 8005FCD4 0C0175F6 */ jal func_8005D7D8 -/* 0608D8 8005FCD8 24050004 */ li $a1, 4 -/* 0608DC 8005FCDC 3C0500FF */ lui $a1, (0x00FFFFFF >> 16) # lui $a1, 0xff -/* 0608E0 8005FCE0 34A5FFFF */ ori $a1, (0x00FFFFFF & 0xFFFF) # ori $a1, $a1, 0xffff -/* 0608E4 8005FCE4 02002025 */ move $a0, $s0 -/* 0608E8 8005FCE8 0C017600 */ jal func_8005D800 -/* 0608EC 8005FCEC 240600FF */ li $a2, 255 -/* 0608F0 8005FCF0 87A3003E */ lh $v1, 0x3e($sp) -/* 0608F4 8005FCF4 864F0560 */ lh $t7, 0x560($s2) -/* 0608F8 8005FCF8 86590562 */ lh $t9, 0x562($s2) -/* 0608FC 8005FCFC 864B0564 */ lh $t3, 0x564($s2) -/* 060900 8005FD00 000370C0 */ sll $t6, $v1, 3 -/* 060904 8005FD04 01EEC023 */ subu $t8, $t7, $t6 -/* 060908 8005FD08 032E5023 */ subu $t2, $t9, $t6 -/* 06090C 8005FD0C 016E6023 */ subu $t4, $t3, $t6 -/* 060910 8005FD10 24080048 */ li $t0, 72 -/* 060914 8005FD14 A6580560 */ sh $t8, 0x560($s2) -/* 060918 8005FD18 A64A0562 */ sh $t2, 0x562($s2) -/* 06091C 8005FD1C 1000002B */ b .L8005FDCC -/* 060920 8005FD20 A64C0564 */ sh $t4, 0x564($s2) -/* 060924 8005FD24 24080048 */ li $t0, 72 -.L8005FD28: -/* 060928 8005FD28 00C80019 */ multu $a2, $t0 -/* 06092C 8005FD2C 87B8003E */ lh $t8, 0x3e($sp) -/* 060930 8005FD30 00006812 */ mflo $t5 -/* 060934 8005FD34 022D7021 */ addu $t6, $s1, $t5 -/* 060938 8005FD38 85CF0546 */ lh $t7, 0x546($t6) -/* 06093C 8005FD3C 59E00024 */ blezl $t7, .L8005FDD0 -/* 060940 8005FD40 87B9003E */ lh $t9, 0x3e($sp) -/* 060944 8005FD44 03080019 */ multu $t8, $t0 -/* 060948 8005FD48 44060000 */ mfc1 $a2, $f0 -/* 06094C 8005FD4C 44071000 */ mfc1 $a3, $f2 -/* 060950 8005FD50 02202025 */ move $a0, $s1 -/* 060954 8005FD54 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060958 8005FD58 AFA30014 */ sw $v1, 0x14($sp) -/* 06095C 8005FD5C AFA90018 */ sw $t1, 0x18($sp) -/* 060960 8005FD60 0000C812 */ mflo $t9 -/* 060964 8005FD64 02399021 */ addu $s2, $s1, $t9 -/* 060968 8005FD68 26500528 */ addiu $s0, $s2, 0x528 -/* 06096C 8005FD6C 0C0175E5 */ jal func_8005D794 -/* 060970 8005FD70 02002825 */ move $a1, $s0 -/* 060974 8005FD74 3C063DCC */ lui $a2, (0x3DCCCCCD >> 16) # lui $a2, 0x3dcc -/* 060978 8005FD78 34C6CCCD */ ori $a2, (0x3DCCCCCD & 0xFFFF) # ori $a2, $a2, 0xcccd -/* 06097C 8005FD7C 02002025 */ move $a0, $s0 -/* 060980 8005FD80 0C0175F6 */ jal func_8005D7D8 -/* 060984 8005FD84 24050004 */ li $a1, 4 -/* 060988 8005FD88 3C0500FF */ lui $a1, (0x00FFFFFF >> 16) # lui $a1, 0xff -/* 06098C 8005FD8C 34A5FFFF */ ori $a1, (0x00FFFFFF & 0xFFFF) # ori $a1, $a1, 0xffff -/* 060990 8005FD90 02002025 */ move $a0, $s0 -/* 060994 8005FD94 0C017600 */ jal func_8005D800 -/* 060998 8005FD98 240600FF */ li $a2, 255 -/* 06099C 8005FD9C 87A3003E */ lh $v1, 0x3e($sp) -/* 0609A0 8005FDA0 864B0560 */ lh $t3, 0x560($s2) -/* 0609A4 8005FDA4 864D0562 */ lh $t5, 0x562($s2) -/* 0609A8 8005FDA8 864F0564 */ lh $t7, 0x564($s2) -/* 0609AC 8005FDAC 000350C0 */ sll $t2, $v1, 3 -/* 0609B0 8005FDB0 016A6023 */ subu $t4, $t3, $t2 -/* 0609B4 8005FDB4 01AA7023 */ subu $t6, $t5, $t2 -/* 0609B8 8005FDB8 01EAC023 */ subu $t8, $t7, $t2 -/* 0609BC 8005FDBC 24080048 */ li $t0, 72 -/* 0609C0 8005FDC0 A64C0560 */ sh $t4, 0x560($s2) -/* 0609C4 8005FDC4 A64E0562 */ sh $t6, 0x562($s2) -/* 0609C8 8005FDC8 A6580564 */ sh $t8, 0x564($s2) -.L8005FDCC: -/* 0609CC 8005FDCC 87B9003E */ lh $t9, 0x3e($sp) -.L8005FDD0: -/* 0609D0 8005FDD0 3C013FF8 */ li $at, 0x3FF80000 # 1.937500 -/* 0609D4 8005FDD4 44812800 */ mtc1 $at, $f5 -/* 0609D8 8005FDD8 03280019 */ multu $t9, $t0 -/* 0609DC 8005FDDC 44802000 */ mtc1 $zero, $f4 -/* 0609E0 8005FDE0 00005012 */ mflo $t2 -/* 0609E4 8005FDE4 022A9021 */ addu $s2, $s1, $t2 -/* 0609E8 8005FDE8 C650052C */ lwc1 $f16, 0x52c($s2) -/* 0609EC 8005FDEC 460084A1 */ cvt.d.s $f18, $f16 -/* 0609F0 8005FDF0 46249181 */ sub.d $f6, $f18, $f4 -/* 0609F4 8005FDF4 46203220 */ cvt.s.d $f8, $f6 -/* 0609F8 8005FDF8 100001BC */ b .L800604EC -/* 0609FC 8005FDFC E648052C */ swc1 $f8, 0x52c($s2) -glabel L8005FE00 -/* 060A00 8005FE00 87AB003E */ lh $t3, 0x3e($sp) -/* 060A04 8005FE04 24080048 */ li $t0, 72 -/* 060A08 8005FE08 55600026 */ bnel $t3, $zero, .L8005FEA4 -/* 060A0C 8005FE0C 24080048 */ li $t0, 72 -/* 060A10 8005FE10 00C80019 */ multu $a2, $t0 -/* 060A14 8005FE14 87AF003E */ lh $t7, 0x3e($sp) -/* 060A18 8005FE18 00006012 */ mflo $t4 -/* 060A1C 8005FE1C 022C1021 */ addu $v0, $s1, $t4 -/* 060A20 8005FE20 844D0546 */ lh $t5, 0x546($v0) -/* 060A24 8005FE24 1DA00004 */ bgtz $t5, .L8005FE38 -/* 060A28 8005FE28 00000000 */ nop -/* 060A2C 8005FE2C 844E0544 */ lh $t6, 0x544($v0) -/* 060A30 8005FE30 55C0001C */ bnel $t6, $zero, .L8005FEA4 -/* 060A34 8005FE34 24080048 */ li $t0, 72 -.L8005FE38: -/* 060A38 8005FE38 01E80019 */ multu $t7, $t0 -/* 060A3C 8005FE3C 44060000 */ mfc1 $a2, $f0 -/* 060A40 8005FE40 44071000 */ mfc1 $a3, $f2 -/* 060A44 8005FE44 02202025 */ move $a0, $s1 -/* 060A48 8005FE48 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060A4C 8005FE4C AFA30014 */ sw $v1, 0x14($sp) -/* 060A50 8005FE50 AFA90018 */ sw $t1, 0x18($sp) -/* 060A54 8005FE54 0000C012 */ mflo $t8 -/* 060A58 8005FE58 02389021 */ addu $s2, $s1, $t8 -/* 060A5C 8005FE5C 26500528 */ addiu $s0, $s2, 0x528 -/* 060A60 8005FE60 0C0175E5 */ jal func_8005D794 -/* 060A64 8005FE64 02002825 */ move $a1, $s0 -/* 060A68 8005FE68 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060A6C 8005FE6C 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060A70 8005FE70 02002025 */ move $a0, $s0 -/* 060A74 8005FE74 0C0175F6 */ jal func_8005D7D8 -/* 060A78 8005FE78 24050004 */ li $a1, 4 -/* 060A7C 8005FE7C 02002025 */ move $a0, $s0 -/* 060A80 8005FE80 24050002 */ li $a1, 2 -/* 060A84 8005FE84 24060001 */ li $a2, 1 -/* 060A88 8005FE88 0C0176B6 */ jal func_8005DAD8 -/* 060A8C 8005FE8C 240700A8 */ li $a3, 168 -/* 060A90 8005FE90 0C0ADF8D */ jal random_int -/* 060A94 8005FE94 24040010 */ li $a0, 16 -/* 060A98 8005FE98 10000194 */ b .L800604EC -/* 060A9C 8005FE9C A6420562 */ sh $v0, 0x562($s2) -/* 060AA0 8005FEA0 24080048 */ li $t0, 72 -.L8005FEA4: -/* 060AA4 8005FEA4 00C80019 */ multu $a2, $t0 -/* 060AA8 8005FEA8 87AC003E */ lh $t4, 0x3e($sp) -/* 060AAC 8005FEAC 0000C812 */ mflo $t9 -/* 060AB0 8005FEB0 02395021 */ addu $t2, $s1, $t9 -/* 060AB4 8005FEB4 854B0546 */ lh $t3, 0x546($t2) -/* 060AB8 8005FEB8 5960018D */ blezl $t3, .L800604F0 -/* 060ABC 8005FEBC 8FBF0034 */ lw $ra, 0x34($sp) -/* 060AC0 8005FEC0 01880019 */ multu $t4, $t0 -/* 060AC4 8005FEC4 44060000 */ mfc1 $a2, $f0 -/* 060AC8 8005FEC8 44071000 */ mfc1 $a3, $f2 -/* 060ACC 8005FECC 02202025 */ move $a0, $s1 -/* 060AD0 8005FED0 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060AD4 8005FED4 AFA30014 */ sw $v1, 0x14($sp) -/* 060AD8 8005FED8 AFA90018 */ sw $t1, 0x18($sp) -/* 060ADC 8005FEDC 00006812 */ mflo $t5 -/* 060AE0 8005FEE0 022D9021 */ addu $s2, $s1, $t5 -/* 060AE4 8005FEE4 26500528 */ addiu $s0, $s2, 0x528 -/* 060AE8 8005FEE8 0C0175E5 */ jal func_8005D794 -/* 060AEC 8005FEEC 02002825 */ move $a1, $s0 -/* 060AF0 8005FEF0 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060AF4 8005FEF4 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060AF8 8005FEF8 02002025 */ move $a0, $s0 -/* 060AFC 8005FEFC 0C0175F6 */ jal func_8005D7D8 -/* 060B00 8005FF00 24050004 */ li $a1, 4 -/* 060B04 8005FF04 02002025 */ move $a0, $s0 -/* 060B08 8005FF08 24050002 */ li $a1, 2 -/* 060B0C 8005FF0C 24060001 */ li $a2, 1 -/* 060B10 8005FF10 0C0176B6 */ jal func_8005DAD8 -/* 060B14 8005FF14 240700A8 */ li $a3, 168 -/* 060B18 8005FF18 0C0ADF8D */ jal random_int -/* 060B1C 8005FF1C 24040010 */ li $a0, 16 -/* 060B20 8005FF20 10000172 */ b .L800604EC -/* 060B24 8005FF24 A6420562 */ sh $v0, 0x562($s2) -glabel L8005FF28 -/* 060B28 8005FF28 87AE003E */ lh $t6, 0x3e($sp) -/* 060B2C 8005FF2C 24080048 */ li $t0, 72 -/* 060B30 8005FF30 55C00026 */ bnel $t6, $zero, .L8005FFCC -/* 060B34 8005FF34 24080048 */ li $t0, 72 -/* 060B38 8005FF38 00C80019 */ multu $a2, $t0 -/* 060B3C 8005FF3C 87AA003E */ lh $t2, 0x3e($sp) -/* 060B40 8005FF40 00007812 */ mflo $t7 -/* 060B44 8005FF44 022F1021 */ addu $v0, $s1, $t7 -/* 060B48 8005FF48 84580546 */ lh $t8, 0x546($v0) -/* 060B4C 8005FF4C 1F000004 */ bgtz $t8, .L8005FF60 -/* 060B50 8005FF50 00000000 */ nop -/* 060B54 8005FF54 84590544 */ lh $t9, 0x544($v0) -/* 060B58 8005FF58 5720001C */ bnel $t9, $zero, .L8005FFCC -/* 060B5C 8005FF5C 24080048 */ li $t0, 72 -.L8005FF60: -/* 060B60 8005FF60 01480019 */ multu $t2, $t0 -/* 060B64 8005FF64 44060000 */ mfc1 $a2, $f0 -/* 060B68 8005FF68 44071000 */ mfc1 $a3, $f2 -/* 060B6C 8005FF6C 02202025 */ move $a0, $s1 -/* 060B70 8005FF70 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060B74 8005FF74 AFA30014 */ sw $v1, 0x14($sp) -/* 060B78 8005FF78 AFA90018 */ sw $t1, 0x18($sp) -/* 060B7C 8005FF7C 00005812 */ mflo $t3 -/* 060B80 8005FF80 022B9021 */ addu $s2, $s1, $t3 -/* 060B84 8005FF84 26500528 */ addiu $s0, $s2, 0x528 -/* 060B88 8005FF88 0C0175E5 */ jal func_8005D794 -/* 060B8C 8005FF8C 02002825 */ move $a1, $s0 -/* 060B90 8005FF90 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060B94 8005FF94 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060B98 8005FF98 02002025 */ move $a0, $s0 -/* 060B9C 8005FF9C 0C0175F6 */ jal func_8005D7D8 -/* 060BA0 8005FFA0 24050004 */ li $a1, 4 -/* 060BA4 8005FFA4 02002025 */ move $a0, $s0 -/* 060BA8 8005FFA8 24050003 */ li $a1, 3 -/* 060BAC 8005FFAC 24060001 */ li $a2, 1 -/* 060BB0 8005FFB0 0C0176B6 */ jal func_8005DAD8 -/* 060BB4 8005FFB4 240700A8 */ li $a3, 168 -/* 060BB8 8005FFB8 0C0ADF8D */ jal random_int -/* 060BBC 8005FFBC 24040010 */ li $a0, 16 -/* 060BC0 8005FFC0 1000014A */ b .L800604EC -/* 060BC4 8005FFC4 A6420562 */ sh $v0, 0x562($s2) -/* 060BC8 8005FFC8 24080048 */ li $t0, 72 -.L8005FFCC: -/* 060BCC 8005FFCC 00C80019 */ multu $a2, $t0 -/* 060BD0 8005FFD0 87AF003E */ lh $t7, 0x3e($sp) -/* 060BD4 8005FFD4 00006012 */ mflo $t4 -/* 060BD8 8005FFD8 022C6821 */ addu $t5, $s1, $t4 -/* 060BDC 8005FFDC 85AE0546 */ lh $t6, 0x546($t5) -/* 060BE0 8005FFE0 59C00143 */ blezl $t6, .L800604F0 -/* 060BE4 8005FFE4 8FBF0034 */ lw $ra, 0x34($sp) -/* 060BE8 8005FFE8 01E80019 */ multu $t7, $t0 -/* 060BEC 8005FFEC 44060000 */ mfc1 $a2, $f0 -/* 060BF0 8005FFF0 44071000 */ mfc1 $a3, $f2 -/* 060BF4 8005FFF4 02202025 */ move $a0, $s1 -/* 060BF8 8005FFF8 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060BFC 8005FFFC AFA30014 */ sw $v1, 0x14($sp) -/* 060C00 80060000 AFA90018 */ sw $t1, 0x18($sp) -/* 060C04 80060004 0000C012 */ mflo $t8 -/* 060C08 80060008 02389021 */ addu $s2, $s1, $t8 -/* 060C0C 8006000C 26500528 */ addiu $s0, $s2, 0x528 -/* 060C10 80060010 0C0175E5 */ jal func_8005D794 -/* 060C14 80060014 02002825 */ move $a1, $s0 -/* 060C18 80060018 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060C1C 8006001C 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060C20 80060020 02002025 */ move $a0, $s0 -/* 060C24 80060024 0C0175F6 */ jal func_8005D7D8 -/* 060C28 80060028 24050004 */ li $a1, 4 -/* 060C2C 8006002C 02002025 */ move $a0, $s0 -/* 060C30 80060030 24050003 */ li $a1, 3 -/* 060C34 80060034 24060001 */ li $a2, 1 -/* 060C38 80060038 0C0176B6 */ jal func_8005DAD8 -/* 060C3C 8006003C 240700A8 */ li $a3, 168 -/* 060C40 80060040 0C0ADF8D */ jal random_int -/* 060C44 80060044 24040010 */ li $a0, 16 -/* 060C48 80060048 10000128 */ b .L800604EC -/* 060C4C 8006004C A6420562 */ sh $v0, 0x562($s2) -glabel L80060050 -/* 060C50 80060050 87B9003E */ lh $t9, 0x3e($sp) -/* 060C54 80060054 24080048 */ li $t0, 72 -/* 060C58 80060058 57200026 */ bnel $t9, $zero, .L800600F4 -/* 060C5C 8006005C 24080048 */ li $t0, 72 -/* 060C60 80060060 00C80019 */ multu $a2, $t0 -/* 060C64 80060064 87AD003E */ lh $t5, 0x3e($sp) -/* 060C68 80060068 00005012 */ mflo $t2 -/* 060C6C 8006006C 022A1021 */ addu $v0, $s1, $t2 -/* 060C70 80060070 844B0546 */ lh $t3, 0x546($v0) -/* 060C74 80060074 1D600004 */ bgtz $t3, .L80060088 -/* 060C78 80060078 00000000 */ nop -/* 060C7C 8006007C 844C0544 */ lh $t4, 0x544($v0) -/* 060C80 80060080 5580001C */ bnel $t4, $zero, .L800600F4 -/* 060C84 80060084 24080048 */ li $t0, 72 -.L80060088: -/* 060C88 80060088 01A80019 */ multu $t5, $t0 -/* 060C8C 8006008C 44060000 */ mfc1 $a2, $f0 -/* 060C90 80060090 44071000 */ mfc1 $a3, $f2 -/* 060C94 80060094 02202025 */ move $a0, $s1 -/* 060C98 80060098 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060C9C 8006009C AFA30014 */ sw $v1, 0x14($sp) -/* 060CA0 800600A0 AFA90018 */ sw $t1, 0x18($sp) -/* 060CA4 800600A4 00007012 */ mflo $t6 -/* 060CA8 800600A8 022E9021 */ addu $s2, $s1, $t6 -/* 060CAC 800600AC 26500528 */ addiu $s0, $s2, 0x528 -/* 060CB0 800600B0 0C0175E5 */ jal func_8005D794 -/* 060CB4 800600B4 02002825 */ move $a1, $s0 -/* 060CB8 800600B8 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060CBC 800600BC 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060CC0 800600C0 02002025 */ move $a0, $s0 -/* 060CC4 800600C4 0C0175F6 */ jal func_8005D7D8 -/* 060CC8 800600C8 24050004 */ li $a1, 4 -/* 060CCC 800600CC 02002025 */ move $a0, $s0 -/* 060CD0 800600D0 24050004 */ li $a1, 4 -/* 060CD4 800600D4 24060001 */ li $a2, 1 -/* 060CD8 800600D8 0C0176B6 */ jal func_8005DAD8 -/* 060CDC 800600DC 240700A8 */ li $a3, 168 -/* 060CE0 800600E0 0C0ADF8D */ jal random_int -/* 060CE4 800600E4 24040010 */ li $a0, 16 -/* 060CE8 800600E8 10000100 */ b .L800604EC -/* 060CEC 800600EC A6420562 */ sh $v0, 0x562($s2) -/* 060CF0 800600F0 24080048 */ li $t0, 72 -.L800600F4: -/* 060CF4 800600F4 00C80019 */ multu $a2, $t0 -/* 060CF8 800600F8 87AA003E */ lh $t2, 0x3e($sp) -/* 060CFC 800600FC 00007812 */ mflo $t7 -/* 060D00 80060100 022FC021 */ addu $t8, $s1, $t7 -/* 060D04 80060104 87190546 */ lh $t9, 0x546($t8) -/* 060D08 80060108 5B2000F9 */ blezl $t9, .L800604F0 -/* 060D0C 8006010C 8FBF0034 */ lw $ra, 0x34($sp) -/* 060D10 80060110 01480019 */ multu $t2, $t0 -/* 060D14 80060114 44060000 */ mfc1 $a2, $f0 -/* 060D18 80060118 44071000 */ mfc1 $a3, $f2 -/* 060D1C 8006011C 02202025 */ move $a0, $s1 -/* 060D20 80060120 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060D24 80060124 AFA30014 */ sw $v1, 0x14($sp) -/* 060D28 80060128 AFA90018 */ sw $t1, 0x18($sp) -/* 060D2C 8006012C 00005812 */ mflo $t3 -/* 060D30 80060130 022B9021 */ addu $s2, $s1, $t3 -/* 060D34 80060134 26500528 */ addiu $s0, $s2, 0x528 -/* 060D38 80060138 0C0175E5 */ jal func_8005D794 -/* 060D3C 8006013C 02002825 */ move $a1, $s0 -/* 060D40 80060140 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060D44 80060144 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060D48 80060148 02002025 */ move $a0, $s0 -/* 060D4C 8006014C 0C0175F6 */ jal func_8005D7D8 -/* 060D50 80060150 24050004 */ li $a1, 4 -/* 060D54 80060154 02002025 */ move $a0, $s0 -/* 060D58 80060158 24050004 */ li $a1, 4 -/* 060D5C 8006015C 24060001 */ li $a2, 1 -/* 060D60 80060160 0C0176B6 */ jal func_8005DAD8 -/* 060D64 80060164 240700A8 */ li $a3, 168 -/* 060D68 80060168 0C0ADF8D */ jal random_int -/* 060D6C 8006016C 24040010 */ li $a0, 16 -/* 060D70 80060170 100000DE */ b .L800604EC -/* 060D74 80060174 A6420562 */ sh $v0, 0x562($s2) -glabel L80060178 -/* 060D78 80060178 87AC003E */ lh $t4, 0x3e($sp) -/* 060D7C 8006017C 24080048 */ li $t0, 72 -/* 060D80 80060180 55800026 */ bnel $t4, $zero, .L8006021C -/* 060D84 80060184 24080048 */ li $t0, 72 -/* 060D88 80060188 00C80019 */ multu $a2, $t0 -/* 060D8C 8006018C 87B8003E */ lh $t8, 0x3e($sp) -/* 060D90 80060190 00006812 */ mflo $t5 -/* 060D94 80060194 022D1021 */ addu $v0, $s1, $t5 -/* 060D98 80060198 844E0546 */ lh $t6, 0x546($v0) -/* 060D9C 8006019C 1DC00004 */ bgtz $t6, .L800601B0 -/* 060DA0 800601A0 00000000 */ nop -/* 060DA4 800601A4 844F0544 */ lh $t7, 0x544($v0) -/* 060DA8 800601A8 55E0001C */ bnel $t7, $zero, .L8006021C -/* 060DAC 800601AC 24080048 */ li $t0, 72 -.L800601B0: -/* 060DB0 800601B0 03080019 */ multu $t8, $t0 -/* 060DB4 800601B4 44060000 */ mfc1 $a2, $f0 -/* 060DB8 800601B8 44071000 */ mfc1 $a3, $f2 -/* 060DBC 800601BC 02202025 */ move $a0, $s1 -/* 060DC0 800601C0 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060DC4 800601C4 AFA30014 */ sw $v1, 0x14($sp) -/* 060DC8 800601C8 AFA90018 */ sw $t1, 0x18($sp) -/* 060DCC 800601CC 0000C812 */ mflo $t9 -/* 060DD0 800601D0 02399021 */ addu $s2, $s1, $t9 -/* 060DD4 800601D4 26500528 */ addiu $s0, $s2, 0x528 -/* 060DD8 800601D8 0C0175E5 */ jal func_8005D794 -/* 060DDC 800601DC 02002825 */ move $a1, $s0 -/* 060DE0 800601E0 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060DE4 800601E4 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060DE8 800601E8 02002025 */ move $a0, $s0 -/* 060DEC 800601EC 0C0175F6 */ jal func_8005D7D8 -/* 060DF0 800601F0 24050004 */ li $a1, 4 -/* 060DF4 800601F4 02002025 */ move $a0, $s0 -/* 060DF8 800601F8 24050005 */ li $a1, 5 -/* 060DFC 800601FC 24060001 */ li $a2, 1 -/* 060E00 80060200 0C0176B6 */ jal func_8005DAD8 -/* 060E04 80060204 240700A8 */ li $a3, 168 -/* 060E08 80060208 0C0ADF8D */ jal random_int -/* 060E0C 8006020C 24040010 */ li $a0, 16 -/* 060E10 80060210 100000B6 */ b .L800604EC -/* 060E14 80060214 A6420562 */ sh $v0, 0x562($s2) -/* 060E18 80060218 24080048 */ li $t0, 72 -.L8006021C: -/* 060E1C 8006021C 00C80019 */ multu $a2, $t0 -/* 060E20 80060220 87AD003E */ lh $t5, 0x3e($sp) -/* 060E24 80060224 00005012 */ mflo $t2 -/* 060E28 80060228 022A5821 */ addu $t3, $s1, $t2 -/* 060E2C 8006022C 856C0546 */ lh $t4, 0x546($t3) -/* 060E30 80060230 598000AF */ blezl $t4, .L800604F0 -/* 060E34 80060234 8FBF0034 */ lw $ra, 0x34($sp) -/* 060E38 80060238 01A80019 */ multu $t5, $t0 -/* 060E3C 8006023C 44060000 */ mfc1 $a2, $f0 -/* 060E40 80060240 44071000 */ mfc1 $a3, $f2 -/* 060E44 80060244 02202025 */ move $a0, $s1 -/* 060E48 80060248 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060E4C 8006024C AFA30014 */ sw $v1, 0x14($sp) -/* 060E50 80060250 AFA90018 */ sw $t1, 0x18($sp) -/* 060E54 80060254 00007012 */ mflo $t6 -/* 060E58 80060258 022E9021 */ addu $s2, $s1, $t6 -/* 060E5C 8006025C 26500528 */ addiu $s0, $s2, 0x528 -/* 060E60 80060260 0C0175E5 */ jal func_8005D794 -/* 060E64 80060264 02002825 */ move $a1, $s0 -/* 060E68 80060268 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060E6C 8006026C 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060E70 80060270 02002025 */ move $a0, $s0 -/* 060E74 80060274 0C0175F6 */ jal func_8005D7D8 -/* 060E78 80060278 24050004 */ li $a1, 4 -/* 060E7C 8006027C 02002025 */ move $a0, $s0 -/* 060E80 80060280 24050005 */ li $a1, 5 -/* 060E84 80060284 24060001 */ li $a2, 1 -/* 060E88 80060288 0C0176B6 */ jal func_8005DAD8 -/* 060E8C 8006028C 240700A8 */ li $a3, 168 -/* 060E90 80060290 0C0ADF8D */ jal random_int -/* 060E94 80060294 24040010 */ li $a0, 16 -/* 060E98 80060298 10000094 */ b .L800604EC -/* 060E9C 8006029C A6420562 */ sh $v0, 0x562($s2) -glabel L800602A0 -/* 060EA0 800602A0 87AF003E */ lh $t7, 0x3e($sp) -/* 060EA4 800602A4 24080048 */ li $t0, 72 -/* 060EA8 800602A8 55E00026 */ bnel $t7, $zero, .L80060344 -/* 060EAC 800602AC 24080048 */ li $t0, 72 -/* 060EB0 800602B0 00C80019 */ multu $a2, $t0 -/* 060EB4 800602B4 87AB003E */ lh $t3, 0x3e($sp) -/* 060EB8 800602B8 0000C012 */ mflo $t8 -/* 060EBC 800602BC 02381021 */ addu $v0, $s1, $t8 -/* 060EC0 800602C0 84590546 */ lh $t9, 0x546($v0) -/* 060EC4 800602C4 1F200004 */ bgtz $t9, .L800602D8 -/* 060EC8 800602C8 00000000 */ nop -/* 060ECC 800602CC 844A0544 */ lh $t2, 0x544($v0) -/* 060ED0 800602D0 5540001C */ bnel $t2, $zero, .L80060344 -/* 060ED4 800602D4 24080048 */ li $t0, 72 -.L800602D8: -/* 060ED8 800602D8 01680019 */ multu $t3, $t0 -/* 060EDC 800602DC 44060000 */ mfc1 $a2, $f0 -/* 060EE0 800602E0 44071000 */ mfc1 $a3, $f2 -/* 060EE4 800602E4 02202025 */ move $a0, $s1 -/* 060EE8 800602E8 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060EEC 800602EC AFA30014 */ sw $v1, 0x14($sp) -/* 060EF0 800602F0 AFA90018 */ sw $t1, 0x18($sp) -/* 060EF4 800602F4 00006012 */ mflo $t4 -/* 060EF8 800602F8 022C9021 */ addu $s2, $s1, $t4 -/* 060EFC 800602FC 26500528 */ addiu $s0, $s2, 0x528 -/* 060F00 80060300 0C0175E5 */ jal func_8005D794 -/* 060F04 80060304 02002825 */ move $a1, $s0 -/* 060F08 80060308 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060F0C 8006030C 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060F10 80060310 02002025 */ move $a0, $s0 -/* 060F14 80060314 0C0175F6 */ jal func_8005D7D8 -/* 060F18 80060318 24050004 */ li $a1, 4 -/* 060F1C 8006031C 02002025 */ move $a0, $s0 -/* 060F20 80060320 24050006 */ li $a1, 6 -/* 060F24 80060324 24060001 */ li $a2, 1 -/* 060F28 80060328 0C0176B6 */ jal func_8005DAD8 -/* 060F2C 8006032C 240700A8 */ li $a3, 168 -/* 060F30 80060330 0C0ADF8D */ jal random_int -/* 060F34 80060334 24040010 */ li $a0, 16 -/* 060F38 80060338 1000006C */ b .L800604EC -/* 060F3C 8006033C A6420562 */ sh $v0, 0x562($s2) -/* 060F40 80060340 24080048 */ li $t0, 72 -.L80060344: -/* 060F44 80060344 00C80019 */ multu $a2, $t0 -/* 060F48 80060348 87B8003E */ lh $t8, 0x3e($sp) -/* 060F4C 8006034C 00006812 */ mflo $t5 -/* 060F50 80060350 022D7021 */ addu $t6, $s1, $t5 -/* 060F54 80060354 85CF0546 */ lh $t7, 0x546($t6) -/* 060F58 80060358 59E00065 */ blezl $t7, .L800604F0 -/* 060F5C 8006035C 8FBF0034 */ lw $ra, 0x34($sp) -/* 060F60 80060360 03080019 */ multu $t8, $t0 -/* 060F64 80060364 44060000 */ mfc1 $a2, $f0 -/* 060F68 80060368 44071000 */ mfc1 $a3, $f2 -/* 060F6C 8006036C 02202025 */ move $a0, $s1 -/* 060F70 80060370 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 060F74 80060374 AFA30014 */ sw $v1, 0x14($sp) -/* 060F78 80060378 AFA90018 */ sw $t1, 0x18($sp) -/* 060F7C 8006037C 0000C812 */ mflo $t9 -/* 060F80 80060380 02399021 */ addu $s2, $s1, $t9 -/* 060F84 80060384 26500528 */ addiu $s0, $s2, 0x528 -/* 060F88 80060388 0C0175E5 */ jal func_8005D794 -/* 060F8C 8006038C 02002825 */ move $a1, $s0 -/* 060F90 80060390 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 060F94 80060394 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 060F98 80060398 02002025 */ move $a0, $s0 -/* 060F9C 8006039C 0C0175F6 */ jal func_8005D7D8 -/* 060FA0 800603A0 24050004 */ li $a1, 4 -/* 060FA4 800603A4 02002025 */ move $a0, $s0 -/* 060FA8 800603A8 24050006 */ li $a1, 6 -/* 060FAC 800603AC 24060001 */ li $a2, 1 -/* 060FB0 800603B0 0C0176B6 */ jal func_8005DAD8 -/* 060FB4 800603B4 240700A8 */ li $a3, 168 -/* 060FB8 800603B8 0C0ADF8D */ jal random_int -/* 060FBC 800603BC 24040010 */ li $a0, 16 -/* 060FC0 800603C0 1000004A */ b .L800604EC -/* 060FC4 800603C4 A6420562 */ sh $v0, 0x562($s2) -glabel L800603C8 -/* 060FC8 800603C8 87AA003E */ lh $t2, 0x3e($sp) -/* 060FCC 800603CC 24080048 */ li $t0, 72 -/* 060FD0 800603D0 55400026 */ bnel $t2, $zero, .L8006046C -/* 060FD4 800603D4 24080048 */ li $t0, 72 -/* 060FD8 800603D8 00C80019 */ multu $a2, $t0 -/* 060FDC 800603DC 87AE003E */ lh $t6, 0x3e($sp) -/* 060FE0 800603E0 00005812 */ mflo $t3 -/* 060FE4 800603E4 022B1021 */ addu $v0, $s1, $t3 -/* 060FE8 800603E8 844C0546 */ lh $t4, 0x546($v0) -/* 060FEC 800603EC 1D800004 */ bgtz $t4, .L80060400 -/* 060FF0 800603F0 00000000 */ nop -/* 060FF4 800603F4 844D0544 */ lh $t5, 0x544($v0) -/* 060FF8 800603F8 55A0001C */ bnel $t5, $zero, .L8006046C -/* 060FFC 800603FC 24080048 */ li $t0, 72 -.L80060400: -/* 061000 80060400 01C80019 */ multu $t6, $t0 -/* 061004 80060404 44060000 */ mfc1 $a2, $f0 -/* 061008 80060408 44071000 */ mfc1 $a3, $f2 -/* 06100C 8006040C 02202025 */ move $a0, $s1 -/* 061010 80060410 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 061014 80060414 AFA30014 */ sw $v1, 0x14($sp) -/* 061018 80060418 AFA90018 */ sw $t1, 0x18($sp) -/* 06101C 8006041C 00007812 */ mflo $t7 -/* 061020 80060420 022F9021 */ addu $s2, $s1, $t7 -/* 061024 80060424 26500528 */ addiu $s0, $s2, 0x528 -/* 061028 80060428 0C0175E5 */ jal func_8005D794 -/* 06102C 8006042C 02002825 */ move $a1, $s0 -/* 061030 80060430 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 061034 80060434 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 061038 80060438 02002025 */ move $a0, $s0 -/* 06103C 8006043C 0C0175F6 */ jal func_8005D7D8 -/* 061040 80060440 24050004 */ li $a1, 4 -/* 061044 80060444 02002025 */ move $a0, $s0 -/* 061048 80060448 00002825 */ move $a1, $zero -/* 06104C 8006044C 00003025 */ move $a2, $zero -/* 061050 80060450 0C0176B6 */ jal func_8005DAD8 -/* 061054 80060454 24070080 */ li $a3, 128 -/* 061058 80060458 0C0ADF8D */ jal random_int -/* 06105C 8006045C 24040010 */ li $a0, 16 -/* 061060 80060460 10000022 */ b .L800604EC -/* 061064 80060464 A6420562 */ sh $v0, 0x562($s2) -/* 061068 80060468 24080048 */ li $t0, 72 -.L8006046C: -/* 06106C 8006046C 00C80019 */ multu $a2, $t0 -/* 061070 80060470 87AB003E */ lh $t3, 0x3e($sp) -/* 061074 80060474 0000C012 */ mflo $t8 -/* 061078 80060478 0238C821 */ addu $t9, $s1, $t8 -/* 06107C 8006047C 872A0546 */ lh $t2, 0x546($t9) -/* 061080 80060480 5940001B */ blezl $t2, .L800604F0 -/* 061084 80060484 8FBF0034 */ lw $ra, 0x34($sp) -/* 061088 80060488 01680019 */ multu $t3, $t0 -/* 06108C 8006048C 44060000 */ mfc1 $a2, $f0 -/* 061090 80060490 44071000 */ mfc1 $a3, $f2 -/* 061094 80060494 02202025 */ move $a0, $s1 -/* 061098 80060498 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 06109C 8006049C AFA30014 */ sw $v1, 0x14($sp) -/* 0610A0 800604A0 AFA90018 */ sw $t1, 0x18($sp) -/* 0610A4 800604A4 00006012 */ mflo $t4 -/* 0610A8 800604A8 022C9021 */ addu $s2, $s1, $t4 -/* 0610AC 800604AC 26500528 */ addiu $s0, $s2, 0x528 -/* 0610B0 800604B0 0C0175E5 */ jal func_8005D794 -/* 0610B4 800604B4 02002825 */ move $a1, $s0 -/* 0610B8 800604B8 3C063EEB */ lui $a2, (0x3EEB851F >> 16) # lui $a2, 0x3eeb -/* 0610BC 800604BC 34C6851F */ ori $a2, (0x3EEB851F & 0xFFFF) # ori $a2, $a2, 0x851f -/* 0610C0 800604C0 02002025 */ move $a0, $s0 -/* 0610C4 800604C4 0C0175F6 */ jal func_8005D7D8 -/* 0610C8 800604C8 24050004 */ li $a1, 4 -/* 0610CC 800604CC 02002025 */ move $a0, $s0 -/* 0610D0 800604D0 00002825 */ move $a1, $zero -/* 0610D4 800604D4 00003025 */ move $a2, $zero -/* 0610D8 800604D8 0C0176B6 */ jal func_8005DAD8 -/* 0610DC 800604DC 24070080 */ li $a3, 128 -/* 0610E0 800604E0 0C0ADF8D */ jal random_int -/* 0610E4 800604E4 24040010 */ li $a0, 16 -/* 0610E8 800604E8 A6420562 */ sh $v0, 0x562($s2) -.L800604EC: -glabel L800604EC -/* 0610EC 800604EC 8FBF0034 */ lw $ra, 0x34($sp) -.L800604F0: -/* 0610F0 800604F0 8FB00028 */ lw $s0, 0x28($sp) -/* 0610F4 800604F4 8FB1002C */ lw $s1, 0x2c($sp) -/* 0610F8 800604F8 8FB20030 */ lw $s2, 0x30($sp) -/* 0610FC 800604FC 03E00008 */ jr $ra -/* 061100 80060500 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/asm/non_matchings/code_80057C60/func_80065AB0.s b/asm/non_matchings/code_80057C60/func_80065AB0.s deleted file mode 100644 index 56fdf79e1b..0000000000 --- a/asm/non_matchings/code_80057C60/func_80065AB0.s +++ /dev/null @@ -1,291 +0,0 @@ -.section .data - -glabel D_800E48C8 -.word 0x00ffffff, 0x00ffff00, 0x00ff9600 - -.section .text - -glabel func_80065AB0 -/* 0666B0 80065AB0 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 0666B4 80065AB4 AFA600C8 */ sw $a2, 0xc8($sp) -/* 0666B8 80065AB8 00067400 */ sll $t6, $a2, 0x10 -/* 0666BC 80065ABC 000E3403 */ sra $a2, $t6, 0x10 -/* 0666C0 80065AC0 3C0E800E */ lui $t6, %hi(D_800E48C8) # $t6, 0x800e -/* 0666C4 80065AC4 AFBF002C */ sw $ra, 0x2c($sp) -/* 0666C8 80065AC8 AFB00028 */ sw $s0, 0x28($sp) -/* 0666CC 80065ACC AFA400C0 */ sw $a0, 0xc0($sp) -/* 0666D0 80065AD0 AFA500C4 */ sw $a1, 0xc4($sp) -/* 0666D4 80065AD4 AFA700CC */ sw $a3, 0xcc($sp) -/* 0666D8 80065AD8 25CE48C8 */ addiu $t6, %lo(D_800E48C8) # addiu $t6, $t6, 0x48c8 -/* 0666DC 80065ADC 8DC10000 */ lw $at, ($t6) -/* 0666E0 80065AE0 27A5008C */ addiu $a1, $sp, 0x8c -/* 0666E4 80065AE4 0007C600 */ sll $t8, $a3, 0x18 -/* 0666E8 80065AE8 ACA10000 */ sw $at, ($a1) -/* 0666EC 80065AEC 8DD90004 */ lw $t9, 4($t6) -/* 0666F0 80065AF0 00183E03 */ sra $a3, $t8, 0x18 -/* 0666F4 80065AF4 000678C0 */ sll $t7, $a2, 3 -/* 0666F8 80065AF8 ACB90004 */ sw $t9, 4($a1) -/* 0666FC 80065AFC 8DC10008 */ lw $at, 8($t6) -/* 066700 80065B00 01E67821 */ addu $t7, $t7, $a2 -/* 066704 80065B04 000F78C0 */ sll $t7, $t7, 3 -/* 066708 80065B08 ACA10008 */ sw $at, 8($a1) -/* 06670C 80065B0C 8FB800C0 */ lw $t8, 0xc0($sp) -/* 066710 80065B10 24010001 */ li $at, 1 -/* 066714 80065B14 030F1821 */ addu $v1, $t8, $t7 -/* 066718 80065B18 846E0544 */ lh $t6, 0x544($v1) -/* 06671C 80065B1C 55C100F7 */ bnel $t6, $at, .L80065EFC -/* 066720 80065B20 8FBF002C */ lw $ra, 0x2c($sp) -/* 066724 80065B24 87190204 */ lh $t9, 0x204($t8) -/* 066728 80065B28 00008025 */ move $s0, $zero -/* 06672C 80065B2C 2B210032 */ slti $at, $t9, 0x32 -/* 066730 80065B30 14200003 */ bnez $at, .L80065B40 -/* 066734 80065B34 00000000 */ nop -/* 066738 80065B38 10000001 */ b .L80065B40 -/* 06673C 80065B3C 24100001 */ li $s0, 1 -.L80065B40: -/* 066740 80065B40 846F0560 */ lh $t7, 0x560($v1) -/* 066744 80065B44 27A400B4 */ addiu $a0, $sp, 0xb4 -/* 066748 80065B48 A7AF00A6 */ sh $t7, 0xa6($sp) -/* 06674C 80065B4C 846E0562 */ lh $t6, 0x562($v1) -/* 066750 80065B50 A7AE00A4 */ sh $t6, 0xa4($sp) -/* 066754 80065B54 84780564 */ lh $t8, 0x564($v1) -/* 066758 80065B58 A7B800A2 */ sh $t8, 0xa2($sp) -/* 06675C 80065B5C 84790566 */ lh $t9, 0x566($v1) -/* 066760 80065B60 A7B900A0 */ sh $t9, 0xa0($sp) -/* 066764 80065B64 846F0568 */ lh $t7, 0x568($v1) -/* 066768 80065B68 000F7080 */ sll $t6, $t7, 2 -/* 06676C 80065B6C 00AEC021 */ addu $t8, $a1, $t6 -/* 066770 80065B70 8F020000 */ lw $v0, ($t8) -/* 066774 80065B74 27A500AC */ addiu $a1, $sp, 0xac -/* 066778 80065B78 0002CC03 */ sra $t9, $v0, 0x10 -/* 06677C 80065B7C 332F00FF */ andi $t7, $t9, 0xff -/* 066780 80065B80 00027203 */ sra $t6, $v0, 8 -/* 066784 80065B84 31D800FF */ andi $t8, $t6, 0xff -/* 066788 80065B88 305900FF */ andi $t9, $v0, 0xff -/* 06678C 80065B8C A7AF009E */ sh $t7, 0x9e($sp) -/* 066790 80065B90 A7B8009C */ sh $t8, 0x9c($sp) -/* 066794 80065B94 A7B9009A */ sh $t9, 0x9a($sp) -/* 066798 80065B98 C4640528 */ lwc1 $f4, 0x528($v1) -/* 06679C 80065B9C 8FAF00C0 */ lw $t7, 0xc0($sp) -/* 0667A0 80065BA0 00077040 */ sll $t6, $a3, 1 -/* 0667A4 80065BA4 E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 0667A8 80065BA8 C466052C */ lwc1 $f6, 0x52c($v1) -/* 0667AC 80065BAC 01EEC021 */ addu $t8, $t7, $t6 -/* 0667B0 80065BB0 E7A600B8 */ swc1 $f6, 0xb8($sp) -/* 0667B4 80065BB4 C4680530 */ lwc1 $f8, 0x530($v1) -/* 0667B8 80065BB8 A7A000AC */ sh $zero, 0xac($sp) -/* 0667BC 80065BBC E7A800BC */ swc1 $f8, 0xbc($sp) -/* 0667C0 80065BC0 87190048 */ lh $t9, 0x48($t8) -/* 0667C4 80065BC4 A7A000B0 */ sh $zero, 0xb0($sp) -/* 0667C8 80065BC8 A7B900AE */ sh $t9, 0xae($sp) -/* 0667CC 80065BCC C46A0534 */ lwc1 $f10, 0x534($v1) -/* 0667D0 80065BD0 C5F00224 */ lwc1 $f16, 0x224($t7) -/* 0667D4 80065BD4 46105482 */ mul.s $f18, $f10, $f16 -/* 0667D8 80065BD8 44069000 */ mfc1 $a2, $f18 -/* 0667DC 80065BDC 0C0194B5 */ jal func_800652D4 -/* 0667E0 80065BE0 00000000 */ nop -/* 0667E4 80065BE4 16000061 */ bnez $s0, .L80065D6C -/* 0667E8 80065BE8 3C038015 */ lui $v1, %hi(gDisplayListHead) -/* 0667EC 80065BEC 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0667F0 80065BF0 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0667F4 80065BF4 8C620000 */ lw $v0, ($v1) -/* 0667F8 80065BF8 3C190D01 */ lui $t9, %hi(D_0D008DB8) # $t9, 0xd01 -/* 0667FC 80065BFC 27398DB8 */ addiu $t9, %lo(D_0D008DB8) # addiu $t9, $t9, -0x7248 -/* 066800 80065C00 244E0008 */ addiu $t6, $v0, 8 -/* 066804 80065C04 AC6E0000 */ sw $t6, ($v1) -/* 066808 80065C08 3C180600 */ lui $t8, 0x600 -/* 06680C 80065C0C AC580000 */ sw $t8, ($v0) -/* 066810 80065C10 AC590004 */ sw $t9, 4($v0) -/* 066814 80065C14 8C620000 */ lw $v0, ($v1) -/* 066818 80065C18 3C19800E */ lui $t9, %hi(D_800E4770) -/* 06681C 80065C1C 0010C080 */ sll $t8, $s0, 2 -/* 066820 80065C20 244F0008 */ addiu $t7, $v0, 8 -/* 066824 80065C24 AC6F0000 */ sw $t7, ($v1) -/* 066828 80065C28 3C0EFD90 */ lui $t6, 0xfd90 -/* 06682C 80065C2C 0338C821 */ addu $t9, $t9, $t8 -/* 066830 80065C30 AC4E0000 */ sw $t6, ($v0) -/* 066834 80065C34 8F394770 */ lw $t9, %lo(D_800E4770)($t9) -/* 066838 80065C38 3C18F590 */ lui $t8, 0xf590 -/* 06683C 80065C3C 8F2F0000 */ lw $t7, ($t9) -/* 066840 80065C40 3C190700 */ lui $t9, 0x700 -/* 066844 80065C44 AC4F0004 */ sw $t7, 4($v0) -/* 066848 80065C48 8C620000 */ lw $v0, ($v1) -/* 06684C 80065C4C 244E0008 */ addiu $t6, $v0, 8 -/* 066850 80065C50 AC6E0000 */ sw $t6, ($v1) -/* 066854 80065C54 AC580000 */ sw $t8, ($v0) -/* 066858 80065C58 AC590004 */ sw $t9, 4($v0) -/* 06685C 80065C5C 8C620000 */ lw $v0, ($v1) -/* 066860 80065C60 3C0EE600 */ lui $t6, 0xe600 -/* 066864 80065C64 3C19F300 */ lui $t9, 0xf300 -/* 066868 80065C68 244F0008 */ addiu $t7, $v0, 8 -/* 06686C 80065C6C AC6F0000 */ sw $t7, ($v1) -/* 066870 80065C70 AC4E0000 */ sw $t6, ($v0) -/* 066874 80065C74 AC400004 */ sw $zero, 4($v0) -/* 066878 80065C78 8C620000 */ lw $v0, ($v1) -/* 06687C 80065C7C 3C0F0707 */ lui $t7, (0x0707F400 >> 16) # lui $t7, 0x707 -/* 066880 80065C80 35EFF400 */ ori $t7, (0x0707F400 & 0xFFFF) # ori $t7, $t7, 0xf400 -/* 066884 80065C84 24580008 */ addiu $t8, $v0, 8 -/* 066888 80065C88 AC780000 */ sw $t8, ($v1) -/* 06688C 80065C8C AC590000 */ sw $t9, ($v0) -/* 066890 80065C90 AC4F0004 */ sw $t7, 4($v0) -/* 066894 80065C94 8C620000 */ lw $v0, ($v1) -/* 066898 80065C98 3C18E700 */ lui $t8, 0xe700 -/* 06689C 80065C9C 3C0FF588 */ lui $t7, (0xF5880400 >> 16) # lui $t7, 0xf588 -/* 0668A0 80065CA0 244E0008 */ addiu $t6, $v0, 8 -/* 0668A4 80065CA4 AC6E0000 */ sw $t6, ($v1) -/* 0668A8 80065CA8 AC580000 */ sw $t8, ($v0) -/* 0668AC 80065CAC AC400004 */ sw $zero, 4($v0) -/* 0668B0 80065CB0 8C620000 */ lw $v0, ($v1) -/* 0668B4 80065CB4 35EF0400 */ ori $t7, (0xF5880400 & 0xFFFF) # ori $t7, $t7, 0x400 -/* 0668B8 80065CB8 3C18F200 */ lui $t8, 0xf200 -/* 0668BC 80065CBC 24590008 */ addiu $t9, $v0, 8 -/* 0668C0 80065CC0 AC790000 */ sw $t9, ($v1) -/* 0668C4 80065CC4 AC4F0000 */ sw $t7, ($v0) -/* 0668C8 80065CC8 AC400004 */ sw $zero, 4($v0) -/* 0668CC 80065CCC 8C620000 */ lw $v0, ($v1) -/* 0668D0 80065CD0 3C0F0003 */ lui $t7, (0x0003C03C >> 16) # lui $t7, 3 -/* 0668D4 80065CD4 35EFC03C */ ori $t7, (0x0003C03C & 0xFFFF) # ori $t7, $t7, 0xc03c -/* 0668D8 80065CD8 244E0008 */ addiu $t6, $v0, 8 -/* 0668DC 80065CDC AC6E0000 */ sw $t6, ($v1) -/* 0668E0 80065CE0 AFA2006C */ sw $v0, 0x6c($sp) -/* 0668E4 80065CE4 AC580000 */ sw $t8, ($v0) -/* 0668E8 80065CE8 8FAE006C */ lw $t6, 0x6c($sp) -/* 0668EC 80065CEC ADCF0004 */ sw $t7, 4($t6) -/* 0668F0 80065CF0 87AF00A0 */ lh $t7, 0xa0($sp) -/* 0668F4 80065CF4 87B9009A */ lh $t9, 0x9a($sp) -/* 0668F8 80065CF8 87B8009C */ lh $t8, 0x9c($sp) -/* 0668FC 80065CFC 87A7009E */ lh $a3, 0x9e($sp) -/* 066900 80065D00 87A600A2 */ lh $a2, 0xa2($sp) -/* 066904 80065D04 87A500A4 */ lh $a1, 0xa4($sp) -/* 066908 80065D08 87A400A6 */ lh $a0, 0xa6($sp) -/* 06690C 80065D0C AFAF0018 */ sw $t7, 0x18($sp) -/* 066910 80065D10 AFB90014 */ sw $t9, 0x14($sp) -/* 066914 80065D14 0C012DCB */ jal func_8004B72C -/* 066918 80065D18 AFB80010 */ sw $t8, 0x10($sp) -/* 06691C 80065D1C 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 066920 80065D20 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 066924 80065D24 8C620000 */ lw $v0, ($v1) -/* 066928 80065D28 3C18B900 */ lui $t8, (0xB900031D >> 16) # lui $t8, 0xb900 -/* 06692C 80065D2C 3C190050 */ lui $t9, (0x00504A50 >> 16) # lui $t9, 0x50 -/* 066930 80065D30 244E0008 */ addiu $t6, $v0, 8 -/* 066934 80065D34 AC6E0000 */ sw $t6, ($v1) -/* 066938 80065D38 37394A50 */ ori $t9, (0x00504A50 & 0xFFFF) # ori $t9, $t9, 0x4a50 -/* 06693C 80065D3C 3718031D */ ori $t8, (0xB900031D & 0xFFFF) # ori $t8, $t8, 0x31d -/* 066940 80065D40 AC580000 */ sw $t8, ($v0) -/* 066944 80065D44 AC590004 */ sw $t9, 4($v0) -/* 066948 80065D48 8C620000 */ lw $v0, ($v1) -/* 06694C 80065D4C 3C180D01 */ lui $t8, %hi(D_0D008DF8) # $t8, 0xd01 -/* 066950 80065D50 27188DF8 */ addiu $t8, %lo(D_0D008DF8) # addiu $t8, $t8, -0x7208 -/* 066954 80065D54 244F0008 */ addiu $t7, $v0, 8 -/* 066958 80065D58 AC6F0000 */ sw $t7, ($v1) -/* 06695C 80065D5C 3C0E0600 */ lui $t6, 0x600 -/* 066960 80065D60 AC4E0000 */ sw $t6, ($v0) -/* 066964 80065D64 1000005F */ b .L80065EE4 -/* 066968 80065D68 AC580004 */ sw $t8, 4($v0) -.L80065D6C: -/* 06696C 80065D6C 24630298 */ addiu $v1, $v1, %lo(gDisplayListHead) -/* 066970 80065D70 8C620000 */ lw $v0, ($v1) -/* 066974 80065D74 3C0E0D01 */ lui $t6, %hi(D_0D008DB8) # $t6, 0xd01 -/* 066978 80065D78 25CE8DB8 */ addiu $t6, %lo(D_0D008DB8) # addiu $t6, $t6, -0x7248 -/* 06697C 80065D7C 24590008 */ addiu $t9, $v0, 8 -/* 066980 80065D80 AC790000 */ sw $t9, ($v1) -/* 066984 80065D84 3C0F0600 */ lui $t7, 0x600 -/* 066988 80065D88 AC4F0000 */ sw $t7, ($v0) -/* 06698C 80065D8C AC4E0004 */ sw $t6, 4($v0) -/* 066990 80065D90 8C620000 */ lw $v0, ($v1) -/* 066994 80065D94 3C0E800E */ lui $t6, %hi(D_800E4770) -/* 066998 80065D98 00107880 */ sll $t7, $s0, 2 -/* 06699C 80065D9C 24580008 */ addiu $t8, $v0, 8 -/* 0669A0 80065DA0 AC780000 */ sw $t8, ($v1) -/* 0669A4 80065DA4 3C19FD90 */ lui $t9, 0xfd90 -/* 0669A8 80065DA8 01CF7021 */ addu $t6, $t6, $t7 -/* 0669AC 80065DAC AC590000 */ sw $t9, ($v0) -/* 0669B0 80065DB0 8DCE4770 */ lw $t6, %lo(D_800E4770)($t6) -/* 0669B4 80065DB4 3C0FF590 */ lui $t7, 0xf590 -/* 0669B8 80065DB8 8DD80000 */ lw $t8, ($t6) -/* 0669BC 80065DBC 3C0E0700 */ lui $t6, 0x700 -/* 0669C0 80065DC0 AC580004 */ sw $t8, 4($v0) -/* 0669C4 80065DC4 8C620000 */ lw $v0, ($v1) -/* 0669C8 80065DC8 24590008 */ addiu $t9, $v0, 8 -/* 0669CC 80065DCC AC790000 */ sw $t9, ($v1) -/* 0669D0 80065DD0 AC4F0000 */ sw $t7, ($v0) -/* 0669D4 80065DD4 AC4E0004 */ sw $t6, 4($v0) -/* 0669D8 80065DD8 8C620000 */ lw $v0, ($v1) -/* 0669DC 80065DDC 3C19E600 */ lui $t9, 0xe600 -/* 0669E0 80065DE0 3C0EF300 */ lui $t6, 0xf300 -/* 0669E4 80065DE4 24580008 */ addiu $t8, $v0, 8 -/* 0669E8 80065DE8 AC780000 */ sw $t8, ($v1) -/* 0669EC 80065DEC AC590000 */ sw $t9, ($v0) -/* 0669F0 80065DF0 AC400004 */ sw $zero, 4($v0) -/* 0669F4 80065DF4 8C620000 */ lw $v0, ($v1) -/* 0669F8 80065DF8 3C18071F */ lui $t8, (0x071FF200 >> 16) # lui $t8, 0x71f -/* 0669FC 80065DFC 3718F200 */ ori $t8, (0x071FF200 & 0xFFFF) # ori $t8, $t8, 0xf200 -/* 066A00 80065E00 244F0008 */ addiu $t7, $v0, 8 -/* 066A04 80065E04 AC6F0000 */ sw $t7, ($v1) -/* 066A08 80065E08 AC4E0000 */ sw $t6, ($v0) -/* 066A0C 80065E0C AC580004 */ sw $t8, 4($v0) -/* 066A10 80065E10 8C620000 */ lw $v0, ($v1) -/* 066A14 80065E14 3C0FE700 */ lui $t7, 0xe700 -/* 066A18 80065E18 3C18F588 */ lui $t8, (0xF5880800 >> 16) # lui $t8, 0xf588 -/* 066A1C 80065E1C 24590008 */ addiu $t9, $v0, 8 -/* 066A20 80065E20 AC790000 */ sw $t9, ($v1) -/* 066A24 80065E24 AC4F0000 */ sw $t7, ($v0) -/* 066A28 80065E28 AC400004 */ sw $zero, 4($v0) -/* 066A2C 80065E2C 8C620000 */ lw $v0, ($v1) -/* 066A30 80065E30 37180800 */ ori $t8, (0xF5880800 & 0xFFFF) # ori $t8, $t8, 0x800 -/* 066A34 80065E34 3C0FF200 */ lui $t7, 0xf200 -/* 066A38 80065E38 244E0008 */ addiu $t6, $v0, 8 -/* 066A3C 80065E3C AC6E0000 */ sw $t6, ($v1) -/* 066A40 80065E40 AC580000 */ sw $t8, ($v0) -/* 066A44 80065E44 AC400004 */ sw $zero, 4($v0) -/* 066A48 80065E48 8C620000 */ lw $v0, ($v1) -/* 066A4C 80065E4C 3C180007 */ lui $t8, (0x0007C07C >> 16) # lui $t8, 7 -/* 066A50 80065E50 3718C07C */ ori $t8, (0x0007C07C & 0xFFFF) # ori $t8, $t8, 0xc07c -/* 066A54 80065E54 24590008 */ addiu $t9, $v0, 8 -/* 066A58 80065E58 AC790000 */ sw $t9, ($v1) -/* 066A5C 80065E5C AFA20044 */ sw $v0, 0x44($sp) -/* 066A60 80065E60 AC4F0000 */ sw $t7, ($v0) -/* 066A64 80065E64 8FB90044 */ lw $t9, 0x44($sp) -/* 066A68 80065E68 AF380004 */ sw $t8, 4($t9) -/* 066A6C 80065E6C 87B800A0 */ lh $t8, 0xa0($sp) -/* 066A70 80065E70 87AE009A */ lh $t6, 0x9a($sp) -/* 066A74 80065E74 87AF009C */ lh $t7, 0x9c($sp) -/* 066A78 80065E78 87A7009E */ lh $a3, 0x9e($sp) -/* 066A7C 80065E7C 87A600A2 */ lh $a2, 0xa2($sp) -/* 066A80 80065E80 87A500A4 */ lh $a1, 0xa4($sp) -/* 066A84 80065E84 87A400A6 */ lh $a0, 0xa6($sp) -/* 066A88 80065E88 AFB80018 */ sw $t8, 0x18($sp) -/* 066A8C 80065E8C AFAE0014 */ sw $t6, 0x14($sp) -/* 066A90 80065E90 0C012DCB */ jal func_8004B72C -/* 066A94 80065E94 AFAF0010 */ sw $t7, 0x10($sp) -/* 066A98 80065E98 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 066A9C 80065E9C 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 066AA0 80065EA0 8C620000 */ lw $v0, ($v1) -/* 066AA4 80065EA4 3C0FB900 */ lui $t7, (0xB900031D >> 16) # lui $t7, 0xb900 -/* 066AA8 80065EA8 3C0E0050 */ lui $t6, (0x00504A50 >> 16) # lui $t6, 0x50 -/* 066AAC 80065EAC 24590008 */ addiu $t9, $v0, 8 -/* 066AB0 80065EB0 AC790000 */ sw $t9, ($v1) -/* 066AB4 80065EB4 35CE4A50 */ ori $t6, (0x00504A50 & 0xFFFF) # ori $t6, $t6, 0x4a50 -/* 066AB8 80065EB8 35EF031D */ ori $t7, (0xB900031D & 0xFFFF) # ori $t7, $t7, 0x31d -/* 066ABC 80065EBC AC4F0000 */ sw $t7, ($v0) -/* 066AC0 80065EC0 AC4E0004 */ sw $t6, 4($v0) -/* 066AC4 80065EC4 8C620000 */ lw $v0, ($v1) -/* 066AC8 80065EC8 3C0F0D01 */ lui $t7, %hi(D_0D008E48) # $t7, 0xd01 -/* 066ACC 80065ECC 25EF8E48 */ addiu $t7, %lo(D_0D008E48) # addiu $t7, $t7, -0x71b8 -/* 066AD0 80065ED0 24580008 */ addiu $t8, $v0, 8 -/* 066AD4 80065ED4 AC780000 */ sw $t8, ($v1) -/* 066AD8 80065ED8 3C190600 */ lui $t9, 0x600 -/* 066ADC 80065EDC AC590000 */ sw $t9, ($v0) -/* 066AE0 80065EE0 AC4F0004 */ sw $t7, 4($v0) -.L80065EE4: -/* 066AE4 80065EE4 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 -/* 066AE8 80065EE8 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 -/* 066AEC 80065EEC 844E0000 */ lh $t6, ($v0) -/* 066AF0 80065EF0 25D80001 */ addiu $t8, $t6, 1 -/* 066AF4 80065EF4 A4580000 */ sh $t8, ($v0) -/* 066AF8 80065EF8 8FBF002C */ lw $ra, 0x2c($sp) -.L80065EFC: -/* 066AFC 80065EFC 8FB00028 */ lw $s0, 0x28($sp) -/* 066B00 80065F00 27BD00C0 */ addiu $sp, $sp, 0xc0 -/* 066B04 80065F04 03E00008 */ jr $ra -/* 066B08 80065F08 00000000 */ nop diff --git a/asm/non_matchings/code_80057C60/func_80065F0C.s b/asm/non_matchings/code_80057C60/func_80065F0C.s deleted file mode 100644 index 693fcd3ba7..0000000000 --- a/asm/non_matchings/code_80057C60/func_80065F0C.s +++ /dev/null @@ -1,379 +0,0 @@ -glabel func_80065F0C -/* 066B0C 80065F0C 27BDFF18 */ addiu $sp, $sp, -0xe8 -/* 066B10 80065F10 00067400 */ sll $t6, $a2, 0x10 -/* 066B14 80065F14 000E7C03 */ sra $t7, $t6, 0x10 -/* 066B18 80065F18 000F70C0 */ sll $t6, $t7, 3 -/* 066B1C 80065F1C 01CF7021 */ addu $t6, $t6, $t7 -/* 066B20 80065F20 000E70C0 */ sll $t6, $t6, 3 -/* 066B24 80065F24 AFBF0034 */ sw $ra, 0x34($sp) -/* 066B28 80065F28 AFB30030 */ sw $s3, 0x30($sp) -/* 066B2C 80065F2C AFB2002C */ sw $s2, 0x2c($sp) -/* 066B30 80065F30 AFB10028 */ sw $s1, 0x28($sp) -/* 066B34 80065F34 AFB00024 */ sw $s0, 0x24($sp) -/* 066B38 80065F38 AFA500EC */ sw $a1, 0xec($sp) -/* 066B3C 80065F3C AFA600F0 */ sw $a2, 0xf0($sp) -/* 066B40 80065F40 AFA700F4 */ sw $a3, 0xf4($sp) -/* 066B44 80065F44 008E1021 */ addu $v0, $a0, $t6 -/* 066B48 80065F48 844F0544 */ lh $t7, 0x544($v0) -/* 066B4C 80065F4C 0007C600 */ sll $t8, $a3, 0x18 -/* 066B50 80065F50 24010001 */ li $at, 1 -/* 066B54 80065F54 0018CE03 */ sra $t9, $t8, 0x18 -/* 066B58 80065F58 15E1015A */ bne $t7, $at, .L800664C4 -/* 066B5C 80065F5C 00808025 */ move $s0, $a0 -/* 066B60 80065F60 84580546 */ lh $t8, 0x546($v0) -/* 066B64 80065F64 53000158 */ beql $t8, $zero, .L800664C8 -/* 066B68 80065F68 8FBF0034 */ lw $ra, 0x34($sp) -/* 066B6C 80065F6C C4440528 */ lwc1 $f4, 0x528($v0) -/* 066B70 80065F70 0019C840 */ sll $t9, $t9, 1 -/* 066B74 80065F74 00997021 */ addu $t6, $a0, $t9 -/* 066B78 80065F78 E7A400DC */ swc1 $f4, 0xdc($sp) -/* 066B7C 80065F7C C446052C */ lwc1 $f6, 0x52c($v0) -/* 066B80 80065F80 27A400DC */ addiu $a0, $sp, 0xdc -/* 066B84 80065F84 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 066B88 80065F88 E7A600E0 */ swc1 $f6, 0xe0($sp) -/* 066B8C 80065F8C C4480530 */ lwc1 $f8, 0x530($v0) -/* 066B90 80065F90 A7A000D4 */ sh $zero, 0xd4($sp) -/* 066B94 80065F94 E7A800E4 */ swc1 $f8, 0xe4($sp) -/* 066B98 80065F98 85CF0048 */ lh $t7, 0x48($t6) -/* 066B9C 80065F9C A7A000D8 */ sh $zero, 0xd8($sp) -/* 066BA0 80065FA0 A7AF00D6 */ sh $t7, 0xd6($sp) -/* 066BA4 80065FA4 C6100224 */ lwc1 $f16, 0x224($s0) -/* 066BA8 80065FA8 C44A0534 */ lwc1 $f10, 0x534($v0) -/* 066BAC 80065FAC AFA20044 */ sw $v0, 0x44($sp) -/* 066BB0 80065FB0 46105482 */ mul.s $f18, $f10, $f16 -/* 066BB4 80065FB4 44069000 */ mfc1 $a2, $f18 -/* 066BB8 80065FB8 0C0194B5 */ jal func_800652D4 -/* 066BBC 80065FBC 00000000 */ nop -/* 066BC0 80065FC0 8FA20044 */ lw $v0, 0x44($sp) -/* 066BC4 80065FC4 24010008 */ li $at, 8 -/* 066BC8 80065FC8 3C118015 */ lui $s1, %hi(gDisplayListHead) # $s1, 0x8015 -/* 066BCC 80065FCC C444053C */ lwc1 $f4, 0x53c($v0) -/* 066BD0 80065FD0 3C0F0D01 */ lui $t7, %hi(D_0D008C90) # $t7, 0xd01 -/* 066BD4 80065FD4 3C03800E */ lui $v1, %hi(D_800E47DC) -/* 066BD8 80065FD8 4600218D */ trunc.w.s $f6, $f4 -/* 066BDC 80065FDC 26310298 */ addiu $s1, %lo(gDisplayListHead) # addiu $s1, $s1, 0x298 -/* 066BE0 80065FE0 25EF8C90 */ addiu $t7, %lo(D_0D008C90) # addiu $t7, $t7, -0x7370 -/* 066BE4 80065FE4 3C0E0600 */ lui $t6, 0x600 -/* 066BE8 80065FE8 44193000 */ mfc1 $t9, $f6 -/* 066BEC 80065FEC 00000000 */ nop -/* 066BF0 80065FF0 532100D0 */ beql $t9, $at, .L80066334 -/* 066BF4 80065FF4 8E300000 */ lw $s0, ($s1) -/* 066BF8 80065FF8 84450560 */ lh $a1, 0x560($v0) -/* 066BFC 80065FFC 84440562 */ lh $a0, 0x562($v0) -/* 066C00 80066000 3C06800E */ lui $a2, %hi(D_800E480C) -/* 066C04 80066004 00057080 */ sll $t6, $a1, 2 -/* 066C08 80066008 006E1821 */ addu $v1, $v1, $t6 -/* 066C0C 8006600C 8C6347DC */ lw $v1, %lo(D_800E47DC)($v1) -/* 066C10 80066010 01C02825 */ move $a1, $t6 -/* 066C14 80066014 00C53021 */ addu $a2, $a2, $a1 -/* 066C18 80066018 00037C03 */ sra $t7, $v1, 0x10 -/* 066C1C 8006601C 31F800FF */ andi $t8, $t7, 0xff -/* 066C20 80066020 0304F823 */ subu $ra, $t8, $a0 -/* 066C24 80066024 00037A03 */ sra $t7, $v1, 8 -/* 066C28 80066028 31F800FF */ andi $t8, $t7, 0xff -/* 066C2C 8006602C 8CC6480C */ lw $a2, %lo(D_800E480C)($a2) -/* 066C30 80066030 306F00FF */ andi $t7, $v1, 0xff -/* 066C34 80066034 001FCC00 */ sll $t9, $ra, 0x10 -/* 066C38 80066038 03049023 */ subu $s2, $t8, $a0 -/* 066C3C 8006603C 01E49823 */ subu $s3, $t7, $a0 -/* 066C40 80066040 0019FC03 */ sra $ra, $t9, 0x10 -/* 066C44 80066044 0012CC00 */ sll $t9, $s2, 0x10 -/* 066C48 80066048 0013C400 */ sll $t8, $s3, 0x10 -/* 066C4C 8006604C 00067403 */ sra $t6, $a2, 0x10 -/* 066C50 80066050 00199403 */ sra $s2, $t9, 0x10 -/* 066C54 80066054 00189C03 */ sra $s3, $t8, 0x10 -/* 066C58 80066058 31CF00FF */ andi $t7, $t6, 0xff -/* 066C5C 8006605C 01E4C023 */ subu $t8, $t7, $a0 -/* 066C60 80066060 0006CA03 */ sra $t9, $a2, 8 -/* 066C64 80066064 A7B800CA */ sh $t8, 0xca($sp) -/* 066C68 80066068 332E00FF */ andi $t6, $t9, 0xff -/* 066C6C 8006606C 30D800FF */ andi $t8, $a2, 0xff -/* 066C70 80066070 01C47823 */ subu $t7, $t6, $a0 -/* 066C74 80066074 0304C823 */ subu $t9, $t8, $a0 -/* 066C78 80066078 A7AF00C8 */ sh $t7, 0xc8($sp) -/* 066C7C 8006607C A7B900C6 */ sh $t9, 0xc6($sp) -/* 066C80 80066080 844E0566 */ lh $t6, 0x566($v0) -/* 066C84 80066084 3C118015 */ lui $s1, %hi(gDisplayListHead) # $s1, 0x8015 -/* 066C88 80066088 26310298 */ addiu $s1, %lo(gDisplayListHead) # addiu $s1, $s1, 0x298 -/* 066C8C 8006608C A7AE00CC */ sh $t6, 0xcc($sp) -/* 066C90 80066090 844F0568 */ lh $t7, 0x568($v0) -/* 066C94 80066094 3C0E0D01 */ lui $t6, %hi(D_0D008DB8) # $t6, 0xd01 -/* 066C98 80066098 3C190D01 */ lui $t9, 0xd01 -/* 066C9C 8006609C 15E00050 */ bnez $t7, .L800661E0 -/* 066CA0 800660A0 3C180600 */ lui $t8, 0x600 -/* 066CA4 800660A4 3C118015 */ lui $s1, %hi(gDisplayListHead) # $s1, 0x8015 -/* 066CA8 800660A8 26310298 */ addiu $s1, %lo(gDisplayListHead) # addiu $s1, $s1, 0x298 -/* 066CAC 800660AC 8E300000 */ lw $s0, ($s1) -/* 066CB0 800660B0 3C190600 */ lui $t9, 0x600 -/* 066CB4 800660B4 25CE8DB8 */ addiu $t6, %lo(D_0D008DB8) # addiu $t6, $t6, -0x7248 -/* 066CB8 800660B8 26180008 */ addiu $t8, $s0, 8 -/* 066CBC 800660BC AE380000 */ sw $t8, ($s1) -/* 066CC0 800660C0 AE0E0004 */ sw $t6, 4($s0) -/* 066CC4 800660C4 AE190000 */ sw $t9, ($s0) -/* 066CC8 800660C8 8E300000 */ lw $s0, ($s1) -/* 066CCC 800660CC 3C18FD90 */ lui $t8, 0xfd90 -/* 066CD0 800660D0 3C198019 */ lui $t9, %hi(D_8018D494) # $t9, 0x8019 -/* 066CD4 800660D4 260F0008 */ addiu $t7, $s0, 8 -/* 066CD8 800660D8 AE2F0000 */ sw $t7, ($s1) -/* 066CDC 800660DC AE180000 */ sw $t8, ($s0) -/* 066CE0 800660E0 8F39D494 */ lw $t9, %lo(D_8018D494)($t9) -/* 066CE4 800660E4 3C180700 */ lui $t8, 0x700 -/* 066CE8 800660E8 3C0FF590 */ lui $t7, 0xf590 -/* 066CEC 800660EC AE190004 */ sw $t9, 4($s0) -/* 066CF0 800660F0 8E300000 */ lw $s0, ($s1) -/* 066CF4 800660F4 03E02025 */ move $a0, $ra -/* 066CF8 800660F8 02402825 */ move $a1, $s2 -/* 066CFC 800660FC 260E0008 */ addiu $t6, $s0, 8 -/* 066D00 80066100 AE2E0000 */ sw $t6, ($s1) -/* 066D04 80066104 AE180004 */ sw $t8, 4($s0) -/* 066D08 80066108 AE0F0000 */ sw $t7, ($s0) -/* 066D0C 8006610C 8E300000 */ lw $s0, ($s1) -/* 066D10 80066110 3C0EE600 */ lui $t6, 0xe600 -/* 066D14 80066114 3C18F300 */ lui $t8, 0xf300 -/* 066D18 80066118 26190008 */ addiu $t9, $s0, 8 -/* 066D1C 8006611C AE390000 */ sw $t9, ($s1) -/* 066D20 80066120 AE000004 */ sw $zero, 4($s0) -/* 066D24 80066124 AE0E0000 */ sw $t6, ($s0) -/* 066D28 80066128 8E300000 */ lw $s0, ($s1) -/* 066D2C 8006612C 3C19071F */ lui $t9, (0x071FF200 >> 16) # lui $t9, 0x71f -/* 066D30 80066130 3739F200 */ ori $t9, (0x071FF200 & 0xFFFF) # ori $t9, $t9, 0xf200 -/* 066D34 80066134 260F0008 */ addiu $t7, $s0, 8 -/* 066D38 80066138 AE2F0000 */ sw $t7, ($s1) -/* 066D3C 8006613C AE190004 */ sw $t9, 4($s0) -/* 066D40 80066140 AE180000 */ sw $t8, ($s0) -/* 066D44 80066144 8E300000 */ lw $s0, ($s1) -/* 066D48 80066148 3C0FE700 */ lui $t7, 0xe700 -/* 066D4C 8006614C 3C19F588 */ lui $t9, (0xF5880800 >> 16) # lui $t9, 0xf588 -/* 066D50 80066150 260E0008 */ addiu $t6, $s0, 8 -/* 066D54 80066154 AE2E0000 */ sw $t6, ($s1) -/* 066D58 80066158 AE000004 */ sw $zero, 4($s0) -/* 066D5C 8006615C AE0F0000 */ sw $t7, ($s0) -/* 066D60 80066160 8E300000 */ lw $s0, ($s1) -/* 066D64 80066164 37390800 */ ori $t9, (0xF5880800 & 0xFFFF) # ori $t9, $t9, 0x800 -/* 066D68 80066168 3C0FF200 */ lui $t7, 0xf200 -/* 066D6C 8006616C 26180008 */ addiu $t8, $s0, 8 -/* 066D70 80066170 AE380000 */ sw $t8, ($s1) -/* 066D74 80066174 AE000004 */ sw $zero, 4($s0) -/* 066D78 80066178 AE190000 */ sw $t9, ($s0) -/* 066D7C 8006617C 8E300000 */ lw $s0, ($s1) -/* 066D80 80066180 3C180007 */ lui $t8, (0x0007C07C >> 16) # lui $t8, 7 -/* 066D84 80066184 3718C07C */ ori $t8, (0x0007C07C & 0xFFFF) # ori $t8, $t8, 0xc07c -/* 066D88 80066188 260E0008 */ addiu $t6, $s0, 8 -/* 066D8C 8006618C AE2E0000 */ sw $t6, ($s1) -/* 066D90 80066190 AE180004 */ sw $t8, 4($s0) -/* 066D94 80066194 AE0F0000 */ sw $t7, ($s0) -/* 066D98 80066198 87AF00CC */ lh $t7, 0xcc($sp) -/* 066D9C 8006619C 87AE00C6 */ lh $t6, 0xc6($sp) -/* 066DA0 800661A0 87B900C8 */ lh $t9, 0xc8($sp) -/* 066DA4 800661A4 87A700CA */ lh $a3, 0xca($sp) -/* 066DA8 800661A8 02603025 */ move $a2, $s3 -/* 066DAC 800661AC AFAF0018 */ sw $t7, 0x18($sp) -/* 066DB0 800661B0 AFAE0014 */ sw $t6, 0x14($sp) -/* 066DB4 800661B4 0C012DCB */ jal func_8004B72C -/* 066DB8 800661B8 AFB90010 */ sw $t9, 0x10($sp) -/* 066DBC 800661BC 8E300000 */ lw $s0, ($s1) -/* 066DC0 800661C0 3C0E0D01 */ lui $t6, %hi(D_0D008E48) # $t6, 0xd01 -/* 066DC4 800661C4 25CE8E48 */ addiu $t6, %lo(D_0D008E48) # addiu $t6, $t6, -0x71b8 -/* 066DC8 800661C8 26180008 */ addiu $t8, $s0, 8 -/* 066DCC 800661CC AE380000 */ sw $t8, ($s1) -/* 066DD0 800661D0 3C190600 */ lui $t9, %hi(D_05FF8DB8) # $t9, 0x600 -/* 066DD4 800661D4 AE190000 */ sw $t9, ($s0) -/* 066DD8 800661D8 100000B5 */ b .L800664B0 -/* 066DDC 800661DC AE0E0004 */ sw $t6, 4($s0) -.L800661E0: -/* 066DE0 800661E0 8E300000 */ lw $s0, ($s1) -/* 066DE4 800661E4 27398DB8 */ addiu $t9, %lo(D_05FF8DB8) # addiu $t9, $t9, -0x7248 -/* 066DE8 800661E8 03E02025 */ move $a0, $ra -/* 066DEC 800661EC 260F0008 */ addiu $t7, $s0, 8 -/* 066DF0 800661F0 AE2F0000 */ sw $t7, ($s1) -/* 066DF4 800661F4 AE190004 */ sw $t9, 4($s0) -/* 066DF8 800661F8 AE180000 */ sw $t8, ($s0) -/* 066DFC 800661FC 8E300000 */ lw $s0, ($s1) -/* 066E00 80066200 3C0FFD90 */ lui $t7, 0xfd90 -/* 066E04 80066204 3C188019 */ lui $t8, %hi(D_8018D494) # $t8, 0x8019 -/* 066E08 80066208 260E0008 */ addiu $t6, $s0, 8 -/* 066E0C 8006620C AE2E0000 */ sw $t6, ($s1) -/* 066E10 80066210 AE0F0000 */ sw $t7, ($s0) -/* 066E14 80066214 8F18D494 */ lw $t8, %lo(D_8018D494)($t8) -/* 066E18 80066218 3C0F0700 */ lui $t7, 0x700 -/* 066E1C 8006621C 3C0EF590 */ lui $t6, 0xf590 -/* 066E20 80066220 AE180004 */ sw $t8, 4($s0) -/* 066E24 80066224 8E300000 */ lw $s0, ($s1) -/* 066E28 80066228 02402825 */ move $a1, $s2 -/* 066E2C 8006622C 02603025 */ move $a2, $s3 -/* 066E30 80066230 26190008 */ addiu $t9, $s0, 8 -/* 066E34 80066234 AE390000 */ sw $t9, ($s1) -/* 066E38 80066238 AE0F0004 */ sw $t7, 4($s0) -/* 066E3C 8006623C AE0E0000 */ sw $t6, ($s0) -/* 066E40 80066240 8E300000 */ lw $s0, ($s1) -/* 066E44 80066244 3C19E600 */ lui $t9, 0xe600 -/* 066E48 80066248 3C0FF300 */ lui $t7, 0xf300 -/* 066E4C 8006624C 26180008 */ addiu $t8, $s0, 8 -/* 066E50 80066250 AE380000 */ sw $t8, ($s1) -/* 066E54 80066254 AE000004 */ sw $zero, 4($s0) -/* 066E58 80066258 AE190000 */ sw $t9, ($s0) -/* 066E5C 8006625C 8E300000 */ lw $s0, ($s1) -/* 066E60 80066260 3C18071F */ lui $t8, (0x071FF200 >> 16) # lui $t8, 0x71f -/* 066E64 80066264 3718F200 */ ori $t8, (0x071FF200 & 0xFFFF) # ori $t8, $t8, 0xf200 -/* 066E68 80066268 260E0008 */ addiu $t6, $s0, 8 -/* 066E6C 8006626C AE2E0000 */ sw $t6, ($s1) -/* 066E70 80066270 AE180004 */ sw $t8, 4($s0) -/* 066E74 80066274 AE0F0000 */ sw $t7, ($s0) -/* 066E78 80066278 8E300000 */ lw $s0, ($s1) -/* 066E7C 8006627C 3C0EE700 */ lui $t6, 0xe700 -/* 066E80 80066280 3C18F588 */ lui $t8, (0xF5880800 >> 16) # lui $t8, 0xf588 -/* 066E84 80066284 26190008 */ addiu $t9, $s0, 8 -/* 066E88 80066288 AE390000 */ sw $t9, ($s1) -/* 066E8C 8006628C AE000004 */ sw $zero, 4($s0) -/* 066E90 80066290 AE0E0000 */ sw $t6, ($s0) -/* 066E94 80066294 8E300000 */ lw $s0, ($s1) -/* 066E98 80066298 37180800 */ ori $t8, (0xF5880800 & 0xFFFF) # ori $t8, $t8, 0x800 -/* 066E9C 8006629C 3C0EF200 */ lui $t6, 0xf200 -/* 066EA0 800662A0 260F0008 */ addiu $t7, $s0, 8 -/* 066EA4 800662A4 AE2F0000 */ sw $t7, ($s1) -/* 066EA8 800662A8 AE000004 */ sw $zero, 4($s0) -/* 066EAC 800662AC AE180000 */ sw $t8, ($s0) -/* 066EB0 800662B0 8E300000 */ lw $s0, ($s1) -/* 066EB4 800662B4 3C0F0007 */ lui $t7, (0x0007C07C >> 16) # lui $t7, 7 -/* 066EB8 800662B8 35EFC07C */ ori $t7, (0x0007C07C & 0xFFFF) # ori $t7, $t7, 0xc07c -/* 066EBC 800662BC 26190008 */ addiu $t9, $s0, 8 -/* 066EC0 800662C0 AE390000 */ sw $t9, ($s1) -/* 066EC4 800662C4 AE0F0004 */ sw $t7, 4($s0) -/* 066EC8 800662C8 AE0E0000 */ sw $t6, ($s0) -/* 066ECC 800662CC 87AE00CC */ lh $t6, 0xcc($sp) -/* 066ED0 800662D0 87B900C6 */ lh $t9, 0xc6($sp) -/* 066ED4 800662D4 87B800C8 */ lh $t8, 0xc8($sp) -/* 066ED8 800662D8 87A700CA */ lh $a3, 0xca($sp) -/* 066EDC 800662DC AFAE0018 */ sw $t6, 0x18($sp) -/* 066EE0 800662E0 AFB90014 */ sw $t9, 0x14($sp) -/* 066EE4 800662E4 0C012DCB */ jal func_8004B72C -/* 066EE8 800662E8 AFB80010 */ sw $t8, 0x10($sp) -/* 066EEC 800662EC 8E300000 */ lw $s0, ($s1) -/* 066EF0 800662F0 3C18B900 */ lui $t8, (0xB9000002 >> 16) # lui $t8, 0xb900 -/* 066EF4 800662F4 37180002 */ ori $t8, (0xB9000002 & 0xFFFF) # ori $t8, $t8, 2 -/* 066EF8 800662F8 260F0008 */ addiu $t7, $s0, 8 -/* 066EFC 800662FC AE2F0000 */ sw $t7, ($s1) -/* 066F00 80066300 24190003 */ li $t9, 3 -/* 066F04 80066304 AE190004 */ sw $t9, 4($s0) -/* 066F08 80066308 AE180000 */ sw $t8, ($s0) -/* 066F0C 8006630C 8E300000 */ lw $s0, ($s1) -/* 066F10 80066310 3C180D01 */ lui $t8, %hi(D_0D008E48) # $t8, 0xd01 -/* 066F14 80066314 27188E48 */ addiu $t8, %lo(D_0D008E48) # addiu $t8, $t8, -0x71b8 -/* 066F18 80066318 260E0008 */ addiu $t6, $s0, 8 -/* 066F1C 8006631C AE2E0000 */ sw $t6, ($s1) -/* 066F20 80066320 3C0F0600 */ lui $t7, 0x600 -/* 066F24 80066324 AE0F0000 */ sw $t7, ($s0) -/* 066F28 80066328 10000061 */ b .L800664B0 -/* 066F2C 8006632C AE180004 */ sw $t8, 4($s0) -/* 066F30 80066330 8E300000 */ lw $s0, ($s1) -.L80066334: -/* 066F34 80066334 84440560 */ lh $a0, 0x560($v0) -/* 066F38 80066338 84450562 */ lh $a1, 0x562($v0) -/* 066F3C 8006633C 84460564 */ lh $a2, 0x564($v0) -/* 066F40 80066340 26190008 */ addiu $t9, $s0, 8 -/* 066F44 80066344 AE390000 */ sw $t9, ($s1) -/* 066F48 80066348 AE0F0004 */ sw $t7, 4($s0) -/* 066F4C 8006634C AE0E0000 */ sw $t6, ($s0) -/* 066F50 80066350 8E300000 */ lw $s0, ($s1) -/* 066F54 80066354 3C19BA00 */ lui $t9, (0xBA000E02 >> 16) # lui $t9, 0xba00 -/* 066F58 80066358 37390E02 */ ori $t9, (0xBA000E02 & 0xFFFF) # ori $t9, $t9, 0xe02 -/* 066F5C 8006635C 26180008 */ addiu $t8, $s0, 8 -/* 066F60 80066360 AE380000 */ sw $t8, ($s1) -/* 066F64 80066364 AE000004 */ sw $zero, 4($s0) -/* 066F68 80066368 AE190000 */ sw $t9, ($s0) -/* 066F6C 8006636C 8E300000 */ lw $s0, ($s1) -/* 066F70 80066370 3C0FFD10 */ lui $t7, 0xfd10 -/* 066F74 80066374 3C188019 */ lui $t8, %hi(D_8018D498) # $t8, 0x8019 -/* 066F78 80066378 260E0008 */ addiu $t6, $s0, 8 -/* 066F7C 8006637C AE2E0000 */ sw $t6, ($s1) -/* 066F80 80066380 AE0F0000 */ sw $t7, ($s0) -/* 066F84 80066384 8F18D498 */ lw $t8, %lo(D_8018D498)($t8) -/* 066F88 80066388 3C0F0708 */ lui $t7, (0x07080200 >> 16) # lui $t7, 0x708 -/* 066F8C 8006638C 35EF0200 */ ori $t7, (0x07080200 & 0xFFFF) # ori $t7, $t7, 0x200 -/* 066F90 80066390 AE180004 */ sw $t8, 4($s0) -/* 066F94 80066394 8E300000 */ lw $s0, ($s1) -/* 066F98 80066398 3C0EF510 */ lui $t6, 0xf510 -/* 066F9C 8006639C 240700FF */ li $a3, 255 -/* 066FA0 800663A0 26190008 */ addiu $t9, $s0, 8 -/* 066FA4 800663A4 AE390000 */ sw $t9, ($s1) -/* 066FA8 800663A8 AE0F0004 */ sw $t7, 4($s0) -/* 066FAC 800663AC AE0E0000 */ sw $t6, ($s0) -/* 066FB0 800663B0 8E300000 */ lw $s0, ($s1) -/* 066FB4 800663B4 3C19E600 */ lui $t9, 0xe600 -/* 066FB8 800663B8 3C0FF300 */ lui $t7, 0xf300 -/* 066FBC 800663BC 26180008 */ addiu $t8, $s0, 8 -/* 066FC0 800663C0 AE380000 */ sw $t8, ($s1) -/* 066FC4 800663C4 AE000004 */ sw $zero, 4($s0) -/* 066FC8 800663C8 AE190000 */ sw $t9, ($s0) -/* 066FCC 800663CC 8E300000 */ lw $s0, ($s1) -/* 066FD0 800663D0 3C18077F */ lui $t8, (0x077FF100 >> 16) # lui $t8, 0x77f -/* 066FD4 800663D4 3718F100 */ ori $t8, (0x077FF100 & 0xFFFF) # ori $t8, $t8, 0xf100 -/* 066FD8 800663D8 260E0008 */ addiu $t6, $s0, 8 -/* 066FDC 800663DC AE2E0000 */ sw $t6, ($s1) -/* 066FE0 800663E0 AE180004 */ sw $t8, 4($s0) -/* 066FE4 800663E4 AE0F0000 */ sw $t7, ($s0) -/* 066FE8 800663E8 8E300000 */ lw $s0, ($s1) -/* 066FEC 800663EC 3C0EE700 */ lui $t6, 0xe700 -/* 066FF0 800663F0 3C18F510 */ lui $t8, (0xF5101000 >> 16) # lui $t8, 0xf510 -/* 066FF4 800663F4 26190008 */ addiu $t9, $s0, 8 -/* 066FF8 800663F8 AE390000 */ sw $t9, ($s1) -/* 066FFC 800663FC AE000004 */ sw $zero, 4($s0) -/* 067000 80066400 AE0E0000 */ sw $t6, ($s0) -/* 067004 80066404 8E300000 */ lw $s0, ($s1) -/* 067008 80066408 3C190008 */ lui $t9, (0x00080200 >> 16) # lui $t9, 8 -/* 06700C 8006640C 37390200 */ ori $t9, (0x00080200 & 0xFFFF) # ori $t9, $t9, 0x200 -/* 067010 80066410 260F0008 */ addiu $t7, $s0, 8 -/* 067014 80066414 AE2F0000 */ sw $t7, ($s1) -/* 067018 80066418 37181000 */ ori $t8, (0xF5101000 & 0xFFFF) # ori $t8, $t8, 0x1000 -/* 06701C 8006641C AE180000 */ sw $t8, ($s0) -/* 067020 80066420 AE190004 */ sw $t9, 4($s0) -/* 067024 80066424 8E300000 */ lw $s0, ($s1) -/* 067028 80066428 3C180007 */ lui $t8, (0x0007C0FC >> 16) # lui $t8, 7 -/* 06702C 8006642C 3718C0FC */ ori $t8, (0x0007C0FC & 0xFFFF) # ori $t8, $t8, 0xc0fc -/* 067030 80066430 260E0008 */ addiu $t6, $s0, 8 -/* 067034 80066434 AE2E0000 */ sw $t6, ($s1) -/* 067038 80066438 3C0FF200 */ lui $t7, 0xf200 -/* 06703C 8006643C AE0F0000 */ sw $t7, ($s0) -/* 067040 80066440 0C012CD7 */ jal func_8004B35C -/* 067044 80066444 AE180004 */ sw $t8, 4($s0) -/* 067048 80066448 8E300000 */ lw $s0, ($s1) -/* 06704C 8006644C 3C0EB900 */ lui $t6, (0xB900031D >> 16) # lui $t6, 0xb900 -/* 067050 80066450 3C0F0055 */ lui $t7, (0x00553078 >> 16) # lui $t7, 0x55 -/* 067054 80066454 26190008 */ addiu $t9, $s0, 8 -/* 067058 80066458 AE390000 */ sw $t9, ($s1) -/* 06705C 8006645C 35EF3078 */ ori $t7, (0x00553078 & 0xFFFF) # ori $t7, $t7, 0x3078 -/* 067060 80066460 35CE031D */ ori $t6, (0xB900031D & 0xFFFF) # ori $t6, $t6, 0x31d -/* 067064 80066464 AE0E0000 */ sw $t6, ($s0) -/* 067068 80066468 AE0F0004 */ sw $t7, 4($s0) -/* 06706C 8006646C 8E300000 */ lw $s0, ($s1) -/* 067070 80066470 3C0E800F */ lui $t6, %hi(D_800E8C00) # $t6, 0x800f -/* 067074 80066474 3C190400 */ lui $t9, (0x0400103F >> 16) # lui $t9, 0x400 -/* 067078 80066478 26180008 */ addiu $t8, $s0, 8 -/* 06707C 8006647C AE380000 */ sw $t8, ($s1) -/* 067080 80066480 3739103F */ ori $t9, (0x0400103F & 0xFFFF) # ori $t9, $t9, 0x103f -/* 067084 80066484 25CE8C00 */ addiu $t6, %lo(D_800E8C00) # addiu $t6, $t6, -0x7400 -/* 067088 80066488 AE0E0004 */ sw $t6, 4($s0) -/* 06708C 8006648C AE190000 */ sw $t9, ($s0) -/* 067090 80066490 8E300000 */ lw $s0, ($s1) -/* 067094 80066494 3C190D01 */ lui $t9, %hi(D_0D008DA0) # $t9, 0xd01 -/* 067098 80066498 27398DA0 */ addiu $t9, %lo(D_0D008DA0) # addiu $t9, $t9, -0x7260 -/* 06709C 8006649C 260F0008 */ addiu $t7, $s0, 8 -/* 0670A0 800664A0 AE2F0000 */ sw $t7, ($s1) -/* 0670A4 800664A4 3C180600 */ lui $t8, 0x600 -/* 0670A8 800664A8 AE180000 */ sw $t8, ($s0) -/* 0670AC 800664AC AE190004 */ sw $t9, 4($s0) -.L800664B0: -/* 0670B0 800664B0 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 -/* 0670B4 800664B4 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 -/* 0670B8 800664B8 844E0000 */ lh $t6, ($v0) -/* 0670BC 800664BC 25CF0001 */ addiu $t7, $t6, 1 -/* 0670C0 800664C0 A44F0000 */ sh $t7, ($v0) -.L800664C4: -/* 0670C4 800664C4 8FBF0034 */ lw $ra, 0x34($sp) -.L800664C8: -/* 0670C8 800664C8 8FB00024 */ lw $s0, 0x24($sp) -/* 0670CC 800664CC 8FB10028 */ lw $s1, 0x28($sp) -/* 0670D0 800664D0 8FB2002C */ lw $s2, 0x2c($sp) -/* 0670D4 800664D4 8FB30030 */ lw $s3, 0x30($sp) -/* 0670D8 800664D8 03E00008 */ jr $ra -/* 0670DC 800664DC 27BD00E8 */ addiu $sp, $sp, 0xe8 diff --git a/asm/non_matchings/code_8006E9C0/func_8006FA94.s b/asm/non_matchings/code_8006E9C0/func_8006FA94.s deleted file mode 100644 index a4e9acbcf2..0000000000 --- a/asm/non_matchings/code_8006E9C0/func_8006FA94.s +++ /dev/null @@ -1,447 +0,0 @@ -glabel func_8006FA94 -/* 070694 8006FA94 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 070698 8006FA98 AFBF0014 */ sw $ra, 0x14($sp) -/* 07069C 8006FA9C 0C01BE33 */ jal func_8006F8CC -/* 0706A0 8006FAA0 00000000 */ nop -/* 0706A4 8006FAA4 0C01BC02 */ jal func_8006F008 -/* 0706A8 8006FAA8 00000000 */ nop -/* 0706AC 8006FAAC 24040000 */ li $a0, 0 -/* 0706B0 8006FAB0 0C0338C4 */ jal osSetTime -/* 0706B4 8006FAB4 24050000 */ li $a1, 0 -/* 0706B8 8006FAB8 3C018019 */ lui $at, %hi(D_8018D170) # $at, 0x8019 -/* 0706BC 8006FABC AC20D170 */ sw $zero, %lo(D_8018D170)($at) -/* 0706C0 8006FAC0 3C018019 */ lui $at, %hi(D_8018D190) # $at, 0x8019 -/* 0706C4 8006FAC4 AC20D190 */ sw $zero, %lo(D_8018D190)($at) -/* 0706C8 8006FAC8 3C018019 */ lui $at, %hi(gIsHUDVisible) # $at, 0x8019 -/* 0706CC 8006FACC 3C048019 */ lui $a0, %hi(D_8018D178) # $a0, 0x8019 -/* 0706D0 8006FAD0 AC20D188 */ sw $zero, %lo(gIsHUDVisible)($at) -/* 0706D4 8006FAD4 2484D178 */ addiu $a0, %lo(D_8018D178) # addiu $a0, $a0, -0x2e88 -/* 0706D8 8006FAD8 AC800000 */ sw $zero, ($a0) -/* 0706DC 8006FADC 3C018019 */ lui $at, %hi(D_8018D1CC) # $at, 0x8019 -/* 0706E0 8006FAE0 AC20D1CC */ sw $zero, %lo(D_8018D1CC)($at) -/* 0706E4 8006FAE4 3C018016 */ lui $at, %hi(D_801657E2) # $at, 0x8016 -/* 0706E8 8006FAE8 A02057E2 */ sb $zero, %lo(D_801657E2)($at) -/* 0706EC 8006FAEC 3C018016 */ lui $at, %hi(D_80165730) # $at, 0x8016 -/* 0706F0 8006FAF0 A4205730 */ sh $zero, %lo(D_80165730)($at) -/* 0706F4 8006FAF4 3C058016 */ lui $a1, %hi(D_801657E5) # $a1, 0x8016 -/* 0706F8 8006FAF8 3C018016 */ lui $at, %hi(D_801658FE) # $at, 0x8016 -/* 0706FC 8006FAFC 24A557E5 */ addiu $a1, %lo(D_801657E5) # addiu $a1, $a1, 0x57e5 -/* 070700 8006FB00 A02058FE */ sb $zero, %lo(D_801658FE)($at) -/* 070704 8006FB04 A0A00000 */ sb $zero, ($a1) -/* 070708 8006FB08 80AE0000 */ lb $t6, ($a1) -/* 07070C 8006FB0C 3C068016 */ lui $a2, %hi(D_801657E3) # $a2, 0x8016 -/* 070710 8006FB10 24C657E3 */ addiu $a2, %lo(D_801657E3) # addiu $a2, $a2, 0x57e3 -/* 070714 8006FB14 A0CE0000 */ sb $t6, ($a2) -/* 070718 8006FB18 80CF0000 */ lb $t7, ($a2) -/* 07071C 8006FB1C 3C078016 */ lui $a3, %hi(D_801658D6) # $a3, 0x8016 -/* 070720 8006FB20 3C018016 */ lui $at, %hi(D_801657E1) # $at, 0x8016 -/* 070724 8006FB24 24E758D6 */ addiu $a3, %lo(D_801658D6) # addiu $a3, $a3, 0x58d6 -/* 070728 8006FB28 A02F57E1 */ sb $t7, %lo(D_801657E1)($at) -/* 07072C 8006FB2C A0E00000 */ sb $zero, ($a3) -/* 070730 8006FB30 80F80000 */ lb $t8, ($a3) -/* 070734 8006FB34 3C088016 */ lui $t0, %hi(D_801658E4) # $t0, 0x8016 -/* 070738 8006FB38 250858E4 */ addiu $t0, %lo(D_801658E4) # addiu $t0, $t0, 0x58e4 -/* 07073C 8006FB3C A1180000 */ sb $t8, ($t0) -/* 070740 8006FB40 81190000 */ lb $t9, ($t0) -/* 070744 8006FB44 3C098016 */ lui $t1, %hi(D_801658F4) # $t1, 0x8016 -/* 070748 8006FB48 252958F4 */ addiu $t1, %lo(D_801658F4) # addiu $t1, $t1, 0x58f4 -/* 07074C 8006FB4C A1390000 */ sb $t9, ($t1) -/* 070750 8006FB50 812E0000 */ lb $t6, ($t1) -/* 070754 8006FB54 3C0A8016 */ lui $t2, %hi(D_801658EC) # $t2, 0x8016 -/* 070758 8006FB58 254A58EC */ addiu $t2, %lo(D_801658EC) # addiu $t2, $t2, 0x58ec -/* 07075C 8006FB5C A14E0000 */ sb $t6, ($t2) -/* 070760 8006FB60 814F0000 */ lb $t7, ($t2) -/* 070764 8006FB64 3C0B8016 */ lui $t3, %hi(D_801658DC) # $t3, 0x8016 -/* 070768 8006FB68 256B58DC */ addiu $t3, %lo(D_801658DC) # addiu $t3, $t3, 0x58dc -/* 07076C 8006FB6C A16F0000 */ sb $t7, ($t3) -/* 070770 8006FB70 81780000 */ lb $t8, ($t3) -/* 070774 8006FB74 3C0C8016 */ lui $t4, %hi(D_801658CE) # $t4, 0x8016 -/* 070778 8006FB78 258C58CE */ addiu $t4, %lo(D_801658CE) # addiu $t4, $t4, 0x58ce -/* 07077C 8006FB7C A1980000 */ sb $t8, ($t4) -/* 070780 8006FB80 81990000 */ lb $t9, ($t4) -/* 070784 8006FB84 3C038016 */ lui $v1, %hi(D_80165658) # $v1, 0x8016 -/* 070788 8006FB88 3C0D8016 */ lui $t5, %hi(D_801658C6) # $t5, 0x8016 -/* 07078C 8006FB8C 25AD58C6 */ addiu $t5, %lo(D_801658C6) # addiu $t5, $t5, 0x58c6 -/* 070790 8006FB90 24635658 */ addiu $v1, %lo(D_80165658) # addiu $v1, $v1, 0x5658 -/* 070794 8006FB94 A1B90000 */ sb $t9, ($t5) -/* 070798 8006FB98 81AE0000 */ lb $t6, ($t5) -/* 07079C 8006FB9C AC600008 */ sw $zero, 8($v1) -/* 0707A0 8006FBA0 AC600004 */ sw $zero, 4($v1) -/* 0707A4 8006FBA4 AC600000 */ sw $zero, ($v1) -/* 0707A8 8006FBA8 3C1F8019 */ lui $ra, %hi(gPlayerCount) # $ra, 0x8019 -/* 0707AC 8006FBAC 83FFEDF3 */ lb $ra, %lo(gPlayerCount)($ra) -/* 0707B0 8006FBB0 3C018016 */ lui $at, %hi(D_801658BC) # $at, 0x8016 -/* 0707B4 8006FBB4 A02E58BC */ sb $t6, %lo(D_801658BC)($at) -/* 0707B8 8006FBB8 24010001 */ li $at, 1 -/* 0707BC 8006FBBC 13E1000C */ beq $ra, $at, .L8006FBF0 -/* 0707C0 8006FBC0 03E01025 */ move $v0, $ra -/* 0707C4 8006FBC4 24030002 */ li $v1, 2 -/* 0707C8 8006FBC8 1043001E */ beq $v0, $v1, .L8006FC44 -/* 0707CC 8006FBCC 3C0F800E */ lui $t7, %hi(gScreenModeSelection) # 0x800e -/* 0707D0 8006FBD0 24010003 */ li $at, 3 -/* 0707D4 8006FBD4 1041005A */ beq $v0, $at, .L8006FD40 -/* 0707D8 8006FBD8 3C0E800E */ lui $t6, %hi(gModeSelection) # 0x800e -/* 0707DC 8006FBDC 24010004 */ li $at, 4 -/* 0707E0 8006FBE0 10410072 */ beq $v0, $at, .L8006FDAC -/* 0707E4 8006FBE4 3C0E800E */ lui $t6, %hi(gModeSelection) # $t6, 0x800e -/* 0707E8 8006FBE8 10000087 */ b .L8006FE08 -/* 0707EC 8006FBEC 240C0008 */ li $t4, 8 -.L8006FBF0: -/* 0707F0 8006FBF0 3C0F800E */ lui $t7, %hi(gModeSelection) # $t7, 0x800e -/* 0707F4 8006FBF4 8DEFC53C */ lw $t7, %lo(gModeSelection)($t7) -/* 0707F8 8006FBF8 2403000A */ li $v1, 10 -/* 0707FC 8006FBFC 240E0001 */ li $t6, 1 -/* 070800 8006FC00 15E0000A */ bnez $t7, .L8006FC2C -/* 070804 8006FC04 3C018019 */ lui $at, %hi(D_8018D114) # 0x8019 -/* 070808 8006FC08 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 07080C 8006FC0C AC20D114 */ sw $zero, %lo(D_8018D114)($at) -/* 070810 8006FC10 24180096 */ li $t8, 150 -/* 070814 8006FC14 AC980000 */ sw $t8, ($a0) -/* 070818 8006FC18 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 07081C 8006FC1C 241900F0 */ li $t9, 240 -/* 070820 8006FC20 AC39D180 */ sw $t9, %lo(D_8018D180)($at) -/* 070824 8006FC24 10000078 */ b .L8006FE08 -/* 070828 8006FC28 240C0008 */ li $t4, 8 -.L8006FC2C: -/* 07082C 8006FC2C AC2ED114 */ sw $t6, %lo(D_8018D114)($at) -/* 070830 8006FC30 AC830000 */ sw $v1, ($a0) -/* 070834 8006FC34 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 070838 8006FC38 AC20D180 */ sw $zero, %lo(D_8018D180)($at) -/* 07083C 8006FC3C 10000072 */ b .L8006FE08 -/* 070840 8006FC40 240C0008 */ li $t4, 8 -.L8006FC44: -/* 070844 8006FC44 8DEFC530 */ lw $t7, %lo(gScreenModeSelection)($t7) # -0x3ad0($t7) -/* 070848 8006FC48 24010001 */ li $at, 1 -/* 07084C 8006FC4C 3C02800E */ lui $v0, %hi(gModeSelection) # 0x800e -/* 070850 8006FC50 15E10029 */ bne $t7, $at, .L8006FCF8 -/* 070854 8006FC54 00000000 */ nop -/* 070858 8006FC58 3C02800E */ lui $v0, %hi(gModeSelection) # $v0, 0x800e -/* 07085C 8006FC5C 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 070860 8006FC60 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 070864 8006FC64 24180096 */ li $t8, 150 -/* 070868 8006FC68 1440000A */ bnez $v0, .L8006FC94 -/* 07086C 8006FC6C 241900F0 */ li $t9, 240 -/* 070870 8006FC70 AC23D114 */ sw $v1, %lo(D_8018D114)($at) -/* 070874 8006FC74 AC980000 */ sw $t8, ($a0) -/* 070878 8006FC78 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 07087C 8006FC7C AC39D180 */ sw $t9, %lo(D_8018D180)($at) -/* 070880 8006FC80 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 070884 8006FC84 240E003C */ li $t6, 60 -/* 070888 8006FC88 AC2ED2AC */ sw $t6, %lo(D_8018D2AC)($at) -/* 07088C 8006FC8C 1000005E */ b .L8006FE08 -/* 070890 8006FC90 240C0008 */ li $t4, 8 -.L8006FC94: -/* 070894 8006FC94 1462000D */ bne $v1, $v0, .L8006FCCC -/* 070898 8006FC98 24190004 */ li $t9, 4 -/* 07089C 8006FC9C 240F0003 */ li $t7, 3 -/* 0708A0 8006FCA0 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 0708A4 8006FCA4 AC2FD114 */ sw $t7, %lo(D_8018D114)($at) -/* 0708A8 8006FCA8 2402001E */ li $v0, 30 -/* 0708AC 8006FCAC AC820000 */ sw $v0, ($a0) -/* 0708B0 8006FCB0 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 0708B4 8006FCB4 AC22D180 */ sw $v0, %lo(D_8018D180)($at) -/* 0708B8 8006FCB8 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 0708BC 8006FCBC 2418003C */ li $t8, 60 -/* 0708C0 8006FCC0 AC38D2AC */ sw $t8, %lo(D_8018D2AC)($at) -/* 0708C4 8006FCC4 10000050 */ b .L8006FE08 -/* 0708C8 8006FCC8 240C0008 */ li $t4, 8 -.L8006FCCC: -/* 0708CC 8006FCCC 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 0708D0 8006FCD0 AC39D114 */ sw $t9, %lo(D_8018D114)($at) -/* 0708D4 8006FCD4 24020028 */ li $v0, 40 -/* 0708D8 8006FCD8 AC820000 */ sw $v0, ($a0) -/* 0708DC 8006FCDC 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 0708E0 8006FCE0 AC22D180 */ sw $v0, %lo(D_8018D180)($at) -/* 0708E4 8006FCE4 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 0708E8 8006FCE8 240E003C */ li $t6, 60 -/* 0708EC 8006FCEC AC2ED2AC */ sw $t6, %lo(D_8018D2AC)($at) -/* 0708F0 8006FCF0 10000045 */ b .L8006FE08 -/* 0708F4 8006FCF4 240C0008 */ li $t4, 8 -.L8006FCF8: -/* 0708F8 8006FCF8 8C42C53C */ lw $v0, %lo(gModeSelection) ($v0) # -0x3ac4($v0) -/* 0708FC 8006FCFC 240F0005 */ li $t7, 5 -/* 070900 8006FD00 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 070904 8006FD04 14400003 */ bnez $v0, .L8006FD14 -/* 070908 8006FD08 240C0008 */ li $t4, 8 -/* 07090C 8006FD0C 1000003E */ b .L8006FE08 -/* 070910 8006FD10 AC2FD114 */ sw $t7, %lo(D_8018D114)($at) -.L8006FD14: -/* 070914 8006FD14 14620006 */ bne $v1, $v0, .L8006FD30 -/* 070918 8006FD18 24190007 */ li $t9, 7 -/* 07091C 8006FD1C 24180006 */ li $t8, 6 -/* 070920 8006FD20 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 070924 8006FD24 AC38D114 */ sw $t8, %lo(D_8018D114)($at) -/* 070928 8006FD28 10000037 */ b .L8006FE08 -/* 07092C 8006FD2C 240C0008 */ li $t4, 8 -.L8006FD30: -/* 070930 8006FD30 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 070934 8006FD34 AC39D114 */ sw $t9, %lo(D_8018D114)($at) -/* 070938 8006FD38 10000033 */ b .L8006FE08 -/* 07093C 8006FD3C 240C0008 */ li $t4, 8 -.L8006FD40: -/* 070940 8006FD40 8DCEC53C */ lw $t6, %lo(gModeSelection)($t6) -/* 070944 8006FD44 3C018019 */ lui $at, %hi(D_8018D180) # 0x8019 -/* 070948 8006FD48 240F0064 */ li $t7, 100 -/* 07094C 8006FD4C 146E000D */ bne $v1, $t6, .L8006FD84 -/* 070950 8006FD50 24180096 */ li $t8, 150 -/* 070954 8006FD54 240C0008 */ li $t4, 8 -/* 070958 8006FD58 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 07095C 8006FD5C AC2CD114 */ sw $t4, %lo(D_8018D114)($at) -/* 070960 8006FD60 240F0064 */ li $t7, 100 -/* 070964 8006FD64 AC8F0000 */ sw $t7, ($a0) -/* 070968 8006FD68 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 07096C 8006FD6C 24180096 */ li $t8, 150 -/* 070970 8006FD70 AC38D180 */ sw $t8, %lo(D_8018D180)($at) -/* 070974 8006FD74 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 070978 8006FD78 2419003C */ li $t9, 60 -/* 07097C 8006FD7C 10000022 */ b .L8006FE08 -/* 070980 8006FD80 AC39D2AC */ sw $t9, %lo(D_8018D2AC)($at) -.L8006FD84: -/* 070984 8006FD84 240E0009 */ li $t6, 9 -/* 070988 8006FD88 AC2ED114 */ sw $t6, %lo(D_8018D114)($at) -/* 07098C 8006FD8C AC8F0000 */ sw $t7, ($a0) -/* 070990 8006FD90 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 070994 8006FD94 AC38D180 */ sw $t8, %lo(D_8018D180)($at) -/* 070998 8006FD98 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 07099C 8006FD9C 2419003C */ li $t9, 60 -/* 0709A0 8006FDA0 AC39D2AC */ sw $t9, %lo(D_8018D2AC)($at) -/* 0709A4 8006FDA4 10000018 */ b .L8006FE08 -/* 0709A8 8006FDA8 240C0008 */ li $t4, 8 -.L8006FDAC: -/* 0709AC 8006FDAC 8DCEC53C */ lw $t6, %lo(gModeSelection)($t6) # -0x3ac4($t6) -/* 0709B0 8006FDB0 2402001E */ li $v0, 30 -/* 0709B4 8006FDB4 240F000B */ li $t7, 11 -/* 0709B8 8006FDB8 146E000B */ bne $v1, $t6, .L8006FDE8 -/* 0709BC 8006FDBC 240C0008 */ li $t4, 8 -/* 0709C0 8006FDC0 2403000A */ li $v1, 10 -/* 0709C4 8006FDC4 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 0709C8 8006FDC8 AC23D114 */ sw $v1, %lo(D_8018D114)($at) -/* 0709CC 8006FDCC 2402001E */ li $v0, 30 -/* 0709D0 8006FDD0 AC820000 */ sw $v0, ($a0) -/* 0709D4 8006FDD4 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 0709D8 8006FDD8 AC22D180 */ sw $v0, %lo(D_8018D180)($at) -/* 0709DC 8006FDDC 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 0709E0 8006FDE0 10000009 */ b .L8006FE08 -/* 0709E4 8006FDE4 AC23D2AC */ sw $v1, %lo(D_8018D2AC)($at) -.L8006FDE8: -/* 0709E8 8006FDE8 3C018019 */ lui $at, %hi(D_8018D114) # $at, 0x8019 -/* 0709EC 8006FDEC AC2FD114 */ sw $t7, %lo(D_8018D114)($at) -/* 0709F0 8006FDF0 AC820000 */ sw $v0, ($a0) -/* 0709F4 8006FDF4 3C018019 */ lui $at, %hi(D_8018D180) # $at, 0x8019 -/* 0709F8 8006FDF8 AC22D180 */ sw $v0, %lo(D_8018D180)($at) -/* 0709FC 8006FDFC 2403000A */ li $v1, 10 -/* 070A00 8006FE00 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 070A04 8006FE04 AC23D2AC */ sw $v1, %lo(D_8018D2AC)($at) -.L8006FE08: -/* 070A08 8006FE08 3C18800E */ lui $t8, %hi(gEnableDebugMode) # $t8, 0x800e -/* 070A0C 8006FE0C 9718C520 */ lhu $t8, %lo(gEnableDebugMode)($t8) -/* 070A10 8006FE10 3C0B8019 */ lui $t3, %hi(D_8018D2C8) # $t3, 0x8019 -/* 070A14 8006FE14 256BD2C8 */ addiu $t3, %lo(D_8018D2C8) # addiu $t3, $t3, -0x2d38 -/* 070A18 8006FE18 17000005 */ bnez $t8, .L8006FE30 -/* 070A1C 8006FE1C 2409FFFF */ li $t1, -1 -/* 070A20 8006FE20 3C018016 */ lui $at, %hi(D_8016576A) # $at, 0x8016 -/* 070A24 8006FE24 A020576A */ sb $zero, %lo(D_8016576A)($at) -/* 070A28 8006FE28 3C018016 */ lui $at, %hi(D_8016579C) # $at, 0x8016 -/* 070A2C 8006FE2C A020579C */ sb $zero, %lo(D_8016579C)($at) -.L8006FE30: -/* 070A30 8006FE30 1BE00015 */ blez $ra, .L8006FE88 -/* 070A34 8006FE34 00002025 */ move $a0, $zero -/* 070A38 8006FE38 3C198019 */ lui $t9, %hi(D_8018CFB4) # 0x8019 -/* 070A3C 8006FE3C 2724CFB4 */ addiu $a0, $t9, %lo(D_8018CFB4) # -0x304c -/* 070A40 8006FE40 3C038019 */ lui $v1, %hi(D_8018CFBC) # $v1, 0x8019 -/* 070A44 8006FE44 3C058019 */ lui $a1, %hi(D_8018CFAC) # $a1, 0x8019 -/* 070A48 8006FE48 3C068019 */ lui $a2, %hi(D_8018CFC4) # $a2, 0x8019 -/* 070A4C 8006FE4C 24C6CFC4 */ addiu $a2, %lo(D_8018CFC4) # addiu $a2, $a2, -0x303c -/* 070A50 8006FE50 24A5CFAC */ addiu $a1, %lo(D_8018CFAC) # addiu $a1, $a1, -0x3054 -/* 070A54 8006FE54 2463CFBC */ addiu $v1, %lo(D_8018CFBC) # addiu $v1, $v1, -0x3044 -/* 070A58 8006FE58 03E43821 */ addu $a3, $ra, $a0 -.L8006FE5C: -/* 070A5C 8006FE5C 24840001 */ addiu $a0, $a0, 1 -/* 070A60 8006FE60 0087082B */ sltu $at, $a0, $a3 -/* 070A64 8006FE64 24630001 */ addiu $v1, $v1, 1 -/* 070A68 8006FE68 24A50001 */ addiu $a1, $a1, 1 -/* 070A6C 8006FE6C 24C60001 */ addiu $a2, $a2, 1 -/* 070A70 8006FE70 A060FFFF */ sb $zero, -1($v1) -/* 070A74 8006FE74 A0A0FFFF */ sb $zero, -1($a1) -/* 070A78 8006FE78 A0C0FFFF */ sb $zero, -1($a2) -/* 070A7C 8006FE7C 1420FFF7 */ bnez $at, .L8006FE5C -/* 070A80 8006FE80 A080FFFF */ sb $zero, -1($a0) -/* 070A84 8006FE84 00002025 */ move $a0, $zero -.L8006FE88: -/* 070A88 8006FE88 240E0001 */ li $t6, 1 -/* 070A8C 8006FE8C 3C018019 */ lui $at, %hi(D_8018D204) # $at, 0x8019 -/* 070A90 8006FE90 AC2ED204 */ sw $t6, %lo(D_8018D204)($at) -/* 070A94 8006FE94 3C018019 */ lui $at, %hi(D_8018D1FC) # $at, 0x8019 -/* 070A98 8006FE98 AC20D1FC */ sw $zero, %lo(D_8018D1FC)($at) -/* 070A9C 8006FE9C 3C018019 */ lui $at, %hi(D_8018D224) # $at, 0x8019 -/* 070AA0 8006FEA0 3C0D8019 */ lui $t5, %hi(D_8018D1F8) # $t5, 0x8019 -/* 070AA4 8006FEA4 AC20D224 */ sw $zero, %lo(D_8018D224)($at) -/* 070AA8 8006FEA8 25ADD1F8 */ addiu $t5, %lo(D_8018D1F8) # addiu $t5, $t5, -0x2e08 -/* 070AAC 8006FEAC ADA00000 */ sw $zero, ($t5) -/* 070AB0 8006FEB0 3C018019 */ lui $at, %hi(D_8018D1F0) # $at, 0x8019 -/* 070AB4 8006FEB4 AC20D1F0 */ sw $zero, %lo(D_8018D1F0)($at) -/* 070AB8 8006FEB8 3C018019 */ lui $at, %hi(D_8018D228) # $at, 0x8019 -/* 070ABC 8006FEBC 241800FF */ li $t8, 255 -/* 070AC0 8006FEC0 3C1F8016 */ lui $ra, %hi(D_80165628) # $ra, 0x8016 -/* 070AC4 8006FEC4 A038D228 */ sb $t8, %lo(D_8018D228)($at) -/* 070AC8 8006FEC8 27FF5628 */ addiu $ra, %lo(D_80165628) # addiu $ra, $ra, 0x5628 -/* 070ACC 8006FECC AFE00000 */ sw $zero, ($ra) -/* 070AD0 8006FED0 3C018016 */ lui $at, %hi(D_80165618) # $at, 0x8016 -/* 070AD4 8006FED4 AC205618 */ sw $zero, %lo(D_80165618)($at) -/* 070AD8 8006FED8 3C0E8016 */ lui $t6, %hi(D_80165618) # $t6, 0x8016 -/* 070ADC 8006FEDC 8DCE5618 */ lw $t6, %lo(D_80165618)($t6) -/* 070AE0 8006FEE0 3C018016 */ lui $at, %hi(D_80165608) # $at, 0x8016 -/* 070AE4 8006FEE4 3C0F8016 */ lui $t7, %hi(D_801657B2) # $t7, 0x8016 -/* 070AE8 8006FEE8 AC2E5608 */ sw $t6, %lo(D_80165608)($at) -/* 070AEC 8006FEEC 3C018016 */ lui $at, %hi(D_801655F8) # $at, 0x8016 -/* 070AF0 8006FEF0 AC2E55F8 */ sw $t6, %lo(D_801655F8)($at) -/* 070AF4 8006FEF4 3C018016 */ lui $at, %hi(D_801655E8) # $at, 0x8016 -/* 070AF8 8006FEF8 AC2E55E8 */ sw $t6, %lo(D_801655E8)($at) -/* 070AFC 8006FEFC 3C018016 */ lui $at, %hi(D_801655D8) # $at, 0x8016 -/* 070B00 8006FF00 AC2E55D8 */ sw $t6, %lo(D_801655D8)($at) -/* 070B04 8006FF04 3C018019 */ lui $at, %hi(D_8018D160) # $at, 0x8019 -/* 070B08 8006FF08 AC20D160 */ sw $zero, %lo(D_8018D160)($at) -/* 070B0C 8006FF0C 3C018019 */ lui $at, %hi(D_8018D1DC) # $at, 0x8019 -/* 070B10 8006FF10 AC20D1DC */ sw $zero, %lo(D_8018D1DC)($at) -/* 070B14 8006FF14 3C018019 */ lui $at, %hi(D_8018D1C4) # $at, 0x8019 -/* 070B18 8006FF18 AC20D1C4 */ sw $zero, %lo(D_8018D1C4)($at) -/* 070B1C 8006FF1C 3C018019 */ lui $at, %hi(D_8018D1B4) # $at, 0x8019 -/* 070B20 8006FF20 AC20D1B4 */ sw $zero, %lo(D_8018D1B4)($at) -/* 070B24 8006FF24 3C018019 */ lui $at, %hi(D_8018D1A0) # $at, 0x8019 -/* 070B28 8006FF28 AC20D1A0 */ sw $zero, %lo(D_8018D1A0)($at) -/* 070B2C 8006FF2C 3C018019 */ lui $at, %hi(D_8018D168) # $at, 0x8019 -/* 070B30 8006FF30 AC20D168 */ sw $zero, %lo(D_8018D168)($at) -/* 070B34 8006FF34 3C018016 */ lui $at, %hi(D_801656F0) # $at, 0x8016 -/* 070B38 8006FF38 A42056F0 */ sh $zero, %lo(D_801656F0)($at) -/* 070B3C 8006FF3C 3C018016 */ lui $at, %hi(D_801657B2) # $at, 0x8016 -/* 070B40 8006FF40 A02057B2 */ sb $zero, %lo(D_801657B2)($at) -/* 070B44 8006FF44 81EF57B2 */ lb $t7, %lo(D_801657B2)($t7) -/* 070B48 8006FF48 3C018016 */ lui $at, %hi(D_801657D8) # $at, 0x8016 -/* 070B4C 8006FF4C 3C188016 */ lui $t8, %hi(D_801657D8) # $t8, 0x8016 -/* 070B50 8006FF50 A02F57D8 */ sb $t7, %lo(D_801657D8)($at) -/* 070B54 8006FF54 831857D8 */ lb $t8, %lo(D_801657D8)($t8) -/* 070B58 8006FF58 3C018019 */ lui $at, %hi(D_8018D214) # $at, 0x8019 -/* 070B5C 8006FF5C 3C198019 */ lui $t9, %hi(D_8018D214) # $t9, 0x8019 -/* 070B60 8006FF60 AC38D214 */ sw $t8, %lo(D_8018D214)($at) -/* 070B64 8006FF64 8F39D214 */ lw $t9, %lo(D_8018D214)($t9) -/* 070B68 8006FF68 3C018016 */ lui $at, %hi(gHUDDisable) # $at, 0x8016 -/* 070B6C 8006FF6C 3C0E8016 */ lui $t6, %hi(gHUDDisable) # $t6, 0x8016 -/* 070B70 8006FF70 A03957B0 */ sb $t9, %lo(gHUDDisable)($at) -/* 070B74 8006FF74 81CE57B0 */ lb $t6, %lo(gHUDDisable)($t6) -/* 070B78 8006FF78 3C018016 */ lui $at, %hi(D_801657AE) # $at, 0x8016 -/* 070B7C 8006FF7C 3C0F8019 */ lui $t7, %hi(D_8018D2F8) # $t7, 0x8019 -/* 070B80 8006FF80 A02E57AE */ sb $t6, %lo(D_801657AE)($at) -/* 070B84 8006FF84 3C018019 */ lui $at, %hi(D_8018D20C) # $at, 0x8019 -/* 070B88 8006FF88 AC20D20C */ sw $zero, %lo(D_8018D20C)($at) -/* 070B8C 8006FF8C 3C018019 */ lui $at, %hi(D_8018D2F8) # $at, 0x8019 -/* 070B90 8006FF90 A420D2F8 */ sh $zero, %lo(D_8018D2F8)($at) -/* 070B94 8006FF94 85EFD2F8 */ lh $t7, %lo(D_8018D2F8)($t7) -/* 070B98 8006FF98 3C018019 */ lui $at, %hi(D_8018D2F0) # $at, 0x8019 -/* 070B9C 8006FF9C 24180003 */ li $t8, 3 -/* 070BA0 8006FFA0 A42FD2F0 */ sh $t7, %lo(D_8018D2F0)($at) -/* 070BA4 8006FFA4 3C018019 */ lui $at, %hi(D_8018D320) # $at, 0x8019 -/* 070BA8 8006FFA8 AC38D320 */ sw $t8, %lo(D_8018D320)($at) -/* 070BAC 8006FFAC 3C018019 */ lui $at, %hi(D_8018D2AC) # $at, 0x8019 -/* 070BB0 8006FFB0 AC20D2AC */ sw $zero, %lo(D_8018D2AC)($at) -/* 070BB4 8006FFB4 3C018019 */ lui $at, %hi(D_8018D2BC) # $at, 0x8019 -/* 070BB8 8006FFB8 AC20D2BC */ sw $zero, %lo(D_8018D2BC)($at) -/* 070BBC 8006FFBC 3C198019 */ lui $t9, %hi(D_8018D2BC) # $t9, 0x8019 -/* 070BC0 8006FFC0 8F39D2BC */ lw $t9, %lo(D_8018D2BC)($t9) -/* 070BC4 8006FFC4 3C018019 */ lui $at, %hi(D_8018D2B4) # $at, 0x8019 -/* 070BC8 8006FFC8 3C0E8019 */ lui $t6, %hi(D_8018D2B4) # $t6, 0x8019 -/* 070BCC 8006FFCC AC39D2B4 */ sw $t9, %lo(D_8018D2B4)($at) -/* 070BD0 8006FFD0 8DCED2B4 */ lw $t6, %lo(D_8018D2B4)($t6) -/* 070BD4 8006FFD4 3C018019 */ lui $at, %hi(D_8018D2A4) # $at, 0x8019 -/* 070BD8 8006FFD8 3C0F8019 */ lui $t7, %hi(D_8018D18C) # $t7, 0x8019 -/* 070BDC 8006FFDC AC2ED2A4 */ sw $t6, %lo(D_8018D2A4)($at) -/* 070BE0 8006FFE0 AD600000 */ sw $zero, ($t3) -/* 070BE4 8006FFE4 AD600004 */ sw $zero, 4($t3) -/* 070BE8 8006FFE8 AD600008 */ sw $zero, 8($t3) -/* 070BEC 8006FFEC AD60000C */ sw $zero, 0xc($t3) -/* 070BF0 8006FFF0 3C018016 */ lui $at, %hi(D_8016581C) # $at, 0x8016 -/* 070BF4 8006FFF4 AC20581C */ sw $zero, %lo(D_8016581C)($at) -/* 070BF8 8006FFF8 3C018016 */ lui $at, %hi(D_8016580C) # $at, 0x8016 -/* 070BFC 8006FFFC AC20580C */ sw $zero, %lo(D_8016580C)($at) -/* 070C00 80070000 3C018016 */ lui $at, %hi(D_80165814) # $at, 0x8016 -/* 070C04 80070004 AC205814 */ sw $zero, %lo(D_80165814)($at) -/* 070C08 80070008 3C018016 */ lui $at, %hi(D_80165804) # $at, 0x8016 -/* 070C0C 8007000C AC205804 */ sw $zero, %lo(D_80165804)($at) -/* 070C10 80070010 3C018016 */ lui $at, %hi(D_801657FC) # $at, 0x8016 -/* 070C14 80070014 AC2057FC */ sw $zero, %lo(D_801657FC)($at) -/* 070C18 80070018 3C018019 */ lui $at, %hi(D_8018D18C) # $at, 0x8019 -/* 070C1C 8007001C A429D18C */ sh $t1, %lo(D_8018D18C)($at) -/* 070C20 80070020 85EFD18C */ lh $t7, %lo(D_8018D18C)($t7) -/* 070C24 80070024 3C018019 */ lui $at, %hi(D_8018D184) # $at, 0x8019 -/* 070C28 80070028 3C02800E */ lui $v0, %hi(gPlayerOne) # $v0, 0x800e -/* 070C2C 8007002C A42FD184 */ sh $t7, %lo(D_8018D184)($at) -/* 070C30 80070030 3C018019 */ lui $at, %hi(D_8018D16C) # $at, 0x8019 -/* 070C34 80070034 A42FD16C */ sh $t7, %lo(D_8018D16C)($at) -/* 070C38 80070038 3C018019 */ lui $at, %hi(D_8018D17C) # $at, 0x8019 -/* 070C3C 8007003C A42FD17C */ sh $t7, %lo(D_8018D17C)($at) -/* 070C40 80070040 3C018019 */ lui $at, %hi(D_8018D174) # $at, 0x8019 -/* 070C44 80070044 A42FD174 */ sh $t7, %lo(D_8018D174)($at) -/* 070C48 80070048 3C01C200 */ li $at, 0xC2000000 # -32.000000 -/* 070C4C 8007004C 3C058019 */ lui $a1, %hi(D_8018D050) # $a1, 0x8019 -/* 070C50 80070050 3C068019 */ lui $a2, %hi(D_8018D0F0) # $a2, 0x8019 -/* 070C54 80070054 3C038019 */ lui $v1, %hi(D_8018CE10) # $v1, 0x8019 -/* 070C58 80070058 3C078019 */ lui $a3, %hi(D_8018CF50) # $a3, 0x8019 -/* 070C5C 8007005C 3C088019 */ lui $t0, %hi(D_8018CF28) # $t0, 0x8019 -/* 070C60 80070060 44811000 */ mtc1 $at, $f2 -/* 070C64 80070064 44800000 */ mtc1 $zero, $f0 -/* 070C68 80070068 8C42C4DC */ lw $v0, %lo(gPlayerOne)($v0) -/* 070C6C 8007006C 2508CF28 */ addiu $t0, %lo(D_8018CF28) # addiu $t0, $t0, -0x30d8 -/* 070C70 80070070 24E7CF50 */ addiu $a3, %lo(D_8018CF50) # addiu $a3, $a3, -0x30b0 -/* 070C74 80070074 2463CE10 */ addiu $v1, %lo(D_8018CE10) # addiu $v1, $v1, -0x31f0 -/* 070C78 80070078 24C6D0F0 */ addiu $a2, %lo(D_8018D0F0) # addiu $a2, $a2, -0x2f10 -/* 070C7C 8007007C 24A5D050 */ addiu $a1, %lo(D_8018D050) # addiu $a1, $a1, -0x2fb0 -.L80070080: -/* 070C80 80070080 E4A20000 */ swc1 $f2, ($a1) -/* 070C84 80070084 E4C20000 */ swc1 $f2, ($a2) -/* 070C88 80070088 E460000C */ swc1 $f0, 0xc($v1) -/* 070C8C 8007008C E4600008 */ swc1 $f0, 8($v1) -/* 070C90 80070090 E4600004 */ swc1 $f0, 4($v1) -/* 070C94 80070094 A4E40000 */ sh $a0, ($a3) -/* 070C98 80070098 AD020000 */ sw $v0, ($t0) -/* 070C9C 8007009C A4490040 */ sh $t1, 0x40($v0) -/* 070CA0 800700A0 24980001 */ addiu $t8, $a0, 1 -/* 070CA4 800700A4 24420DD8 */ addiu $v0, $v0, 0xdd8 -/* 070CA8 800700A8 AD020004 */ sw $v0, 4($t0) -/* 070CAC 800700AC A4F80002 */ sh $t8, 2($a3) -/* 070CB0 800700B0 E4600024 */ swc1 $f0, 0x24($v1) -/* 070CB4 800700B4 E4600028 */ swc1 $f0, 0x28($v1) -/* 070CB8 800700B8 E460002C */ swc1 $f0, 0x2c($v1) -/* 070CBC 800700BC E4C20004 */ swc1 $f2, 4($a2) -/* 070CC0 800700C0 E4A20004 */ swc1 $f2, 4($a1) -/* 070CC4 800700C4 A4490040 */ sh $t1, 0x40($v0) -/* 070CC8 800700C8 24420DD8 */ addiu $v0, $v0, 0xdd8 -/* 070CCC 800700CC 24990002 */ addiu $t9, $a0, 2 -/* 070CD0 800700D0 A4F90004 */ sh $t9, 4($a3) -/* 070CD4 800700D4 AD020008 */ sw $v0, 8($t0) -/* 070CD8 800700D8 E4600044 */ swc1 $f0, 0x44($v1) -/* 070CDC 800700DC E4600048 */ swc1 $f0, 0x48($v1) -/* 070CE0 800700E0 E460004C */ swc1 $f0, 0x4c($v1) -/* 070CE4 800700E4 E4C20008 */ swc1 $f2, 8($a2) -/* 070CE8 800700E8 E4A20008 */ swc1 $f2, 8($a1) -/* 070CEC 800700EC A4490040 */ sh $t1, 0x40($v0) -/* 070CF0 800700F0 248E0003 */ addiu $t6, $a0, 3 -/* 070CF4 800700F4 24420DD8 */ addiu $v0, $v0, 0xdd8 -/* 070CF8 800700F8 AD02000C */ sw $v0, 0xc($t0) -/* 070CFC 800700FC A4EE0006 */ sh $t6, 6($a3) -/* 070D00 80070100 24840004 */ addiu $a0, $a0, 4 -/* 070D04 80070104 E4600064 */ swc1 $f0, 0x64($v1) -/* 070D08 80070108 E4600068 */ swc1 $f0, 0x68($v1) -/* 070D0C 8007010C E460006C */ swc1 $f0, 0x6c($v1) -/* 070D10 80070110 E4C2000C */ swc1 $f2, 0xc($a2) -/* 070D14 80070114 E4A2000C */ swc1 $f2, 0xc($a1) -/* 070D18 80070118 A4490040 */ sh $t1, 0x40($v0) -/* 070D1C 8007011C 24420DD8 */ addiu $v0, $v0, 0xdd8 -/* 070D20 80070120 24A50010 */ addiu $a1, $a1, 0x10 -/* 070D24 80070124 24C60010 */ addiu $a2, $a2, 0x10 -/* 070D28 80070128 24630080 */ addiu $v1, $v1, 0x80 -/* 070D2C 8007012C 24E70008 */ addiu $a3, $a3, 8 -/* 070D30 80070130 148CFFD3 */ bne $a0, $t4, .L80070080 -/* 070D34 80070134 25080010 */ addiu $t0, $t0, 0x10 -/* 070D38 80070138 8FBF0014 */ lw $ra, 0x14($sp) -/* 070D3C 8007013C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 070D40 80070140 03E00008 */ jr $ra -/* 070D44 80070144 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/add_8018D9E0_entry.s b/asm/non_matchings/code_80091750/add_8018D9E0_entry.s deleted file mode 100644 index f24c3d8b93..0000000000 --- a/asm/non_matchings/code_80091750/add_8018D9E0_entry.s +++ /dev/null @@ -1,1157 +0,0 @@ -.section .late_rodata - -glabel jpt_800F1160 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0 - -glabel jpt_800F125C -.word L8009EF08, L8009EF08, L8009EF08, L8009EF08 -.word L8009EF08, L8009F5D0, L8009EF08, L8009EF08 -.word L8009EF08, L8009EF08, L8009EF08, L8009EF00 -.word L8009EF74, L8009EF34, L8009EF34, L8009EF34 -.word L8009EF34, L8009F5D0, L8009F5D0, L8009EF90 -.word L8009EF90, L8009EFB8, L8009F050, L8009F094 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F0E0, L8009F0E0 -.word L8009F0E0, L8009F0E0, L8009F174, L8009F174 -.word L8009F174, L8009F174, L8009F174, L8009F174 -.word L8009F174, L8009F174, L8009F174, L8009F174 -.word L8009F174, L8009F174, L8009F174, L8009F174 -.word L8009F174, L8009F174, L8009F10C, L8009F158 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009EED0, L8009EED0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F264 -.word L8009F264, L8009F264, L8009F264, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F388, L8009F5D0, L8009F5D0 -.word L8009F530, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009E888, L8009E8E4, L8009E940, L8009E9AC -.word L8009EC38, L8009EC5C, L8009EC98, L8009EC98 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F430, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F500, L8009F510 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009E774, L8009E800 - -glabel jpt_800F1504 -.word L8009ECAC, L8009ECD4, L8009ED08, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009ED9C, L8009EDC8, L8009EDC8 -.word L8009EDC8, L8009EDC8, L8009ED94, L8009ED9C -.word L8009ED9C, L8009ED9C, L8009ED9C, L8009ED9C -.word L8009ED9C, L8009ED9C, L8009ED9C, L8009ED9C -.word L8009ED9C, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009F5D0, L8009ED1C, L8009ED1C -.word L8009ED1C, L8009F5D0, L8009F5D0, L8009F5D0 -.word L8009F5D0, L8009EE10, L8009EE74, L8009EE74 -.word L8009EE74, L8009EE74, L8009EE74, L8009EE74 -.word L8009EE74, L8009EE74, L8009EE28, L8009EE4C -.word L8009EE4C, L8009EE4C, L8009EE4C - -glabel D_800F15E0 -.float 750.0 - -.section .text - -glabel add_8018D9E0_entry -/* 09F250 8009E650 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 09F254 8009E654 AFBF001C */ sw $ra, 0x1c($sp) -/* 09F258 8009E658 AFA7008C */ sw $a3, 0x8c($sp) -/* 09F25C 8009E65C 00077600 */ sll $t6, $a3, 0x18 -/* 09F260 8009E660 3C1F8019 */ lui $ra, %hi(D_8018D9E0) # $ra, 0x8019 -/* 09F264 8009E664 000E3E03 */ sra $a3, $t6, 0x18 -/* 09F268 8009E668 AFA40080 */ sw $a0, 0x80($sp) -/* 09F26C 8009E66C 00001025 */ move $v0, $zero -/* 09F270 8009E670 27FFD9E0 */ addiu $ra, %lo(D_8018D9E0) # addiu $ra, $ra, -0x2620 -.L8009E674: -/* 09F274 8009E674 8FF80000 */ lw $t8, ($ra) -/* 09F278 8009E678 24420001 */ addiu $v0, $v0, 1 -/* 09F27C 8009E67C 28410021 */ slti $at, $v0, 0x21 -/* 09F280 8009E680 53000008 */ beql $t8, $zero, .L8009E6A4 -/* 09F284 8009E684 8FB90080 */ lw $t9, 0x80($sp) -/* 09F288 8009E688 14200003 */ bnez $at, .L8009E698 -/* 09F28C 8009E68C 00000000 */ nop -.L8009E690: -/* 09F290 8009E690 1000FFFF */ b .L8009E690 -/* 09F294 8009E694 00000000 */ nop -.L8009E698: -/* 09F298 8009E698 1000FFF6 */ b .L8009E674 -/* 09F29C 8009E69C 27FF0028 */ addiu $ra, $ra, 0x28 -/* 09F2A0 8009E6A0 8FB90080 */ lw $t9, 0x80($sp) -.L8009E6A4: -/* 09F2A4 8009E6A4 24030001 */ li $v1, 1 -/* 09F2A8 8009E6A8 AFE00004 */ sw $zero, 4($ra) -/* 09F2AC 8009E6AC AFE00008 */ sw $zero, 8($ra) -/* 09F2B0 8009E6B0 AFE5000C */ sw $a1, 0xc($ra) -/* 09F2B4 8009E6B4 AFE60010 */ sw $a2, 0x10($ra) -/* 09F2B8 8009E6B8 A3E70014 */ sb $a3, 0x14($ra) -/* 09F2BC 8009E6BC A3E30015 */ sb $v1, 0x15($ra) -/* 09F2C0 8009E6C0 AFE0001C */ sw $zero, 0x1c($ra) -/* 09F2C4 8009E6C4 AFE00020 */ sw $zero, 0x20($ra) -/* 09F2C8 8009E6C8 AFF90000 */ sw $t9, ($ra) -/* 09F2CC 8009E6CC 8FAE0080 */ lw $t6, 0x80($sp) -/* 09F2D0 8009E6D0 8FB90080 */ lw $t9, 0x80($sp) -/* 09F2D4 8009E6D4 29C100FC */ slti $at, $t6, 0xfc -/* 09F2D8 8009E6D8 14200011 */ bnez $at, .L8009E720 -/* 09F2DC 8009E6DC 29C10131 */ slti $at, $t6, 0x131 -/* 09F2E0 8009E6E0 1420000A */ bnez $at, .L8009E70C -/* 09F2E4 8009E6E4 8FB80080 */ lw $t8, 0x80($sp) -/* 09F2E8 8009E6E8 25CFFE70 */ addiu $t7, $t6, -0x190 -/* 09F2EC 8009E6EC 2DE1003F */ sltiu $at, $t7, 0x3f -/* 09F2F0 8009E6F0 102003B7 */ beqz $at, .L8009F5D0 -/* 09F2F4 8009E6F4 000F7880 */ sll $t7, $t7, 2 -/* 09F2F8 8009E6F8 3C01800F */ lui $at, %hi(jpt_800F1160) -/* 09F2FC 8009E6FC 002F0821 */ addu $at, $at, $t7 -/* 09F300 8009E700 8C2F1160 */ lw $t7, %lo(jpt_800F1160)($at) -/* 09F304 8009E704 01E00008 */ jr $t7 -/* 09F308 8009E708 00000000 */ nop -.L8009E70C: -/* 09F30C 8009E70C 24010130 */ li $at, 304 -/* 09F310 8009E710 1301038A */ beq $t8, $at, .L8009F53C -/* 09F314 8009E714 3C028028 */ lui $v0, %hi(D_802874D8) # 0x8028 -/* 09F318 8009E718 100003AE */ b .L8009F5D4 -/* 09F31C 8009E71C 8FBF001C */ lw $ra, 0x1c($sp) -.L8009E720: -/* 09F320 8009E720 2B210038 */ slti $at, $t9, 0x38 -/* 09F324 8009E724 1420000A */ bnez $at, .L8009E750 -/* 09F328 8009E728 8FAF0080 */ lw $t7, 0x80($sp) -/* 09F32C 8009E72C 272EFFAE */ addiu $t6, $t9, -0x52 -/* 09F330 8009E730 2DC100AA */ sltiu $at, $t6, 0xaa -/* 09F334 8009E734 102003A6 */ beqz $at, .L8009F5D0 -/* 09F338 8009E738 000E7080 */ sll $t6, $t6, 2 -/* 09F33C 8009E73C 3C01800F */ lui $at, %hi(jpt_800F125C) -/* 09F340 8009E740 002E0821 */ addu $at, $at, $t6 -/* 09F344 8009E744 8C2E125C */ lw $t6, %lo(jpt_800F125C)($at) -/* 09F348 8009E748 01C00008 */ jr $t6 -/* 09F34C 8009E74C 00000000 */ nop -.L8009E750: -/* 09F350 8009E750 25F8FFFF */ addiu $t8, $t7, -1 -/* 09F354 8009E754 2F010037 */ sltiu $at, $t8, 0x37 -/* 09F358 8009E758 1020039D */ beqz $at, .L8009F5D0 -/* 09F35C 8009E75C 0018C080 */ sll $t8, $t8, 2 -/* 09F360 8009E760 3C01800F */ lui $at, %hi(jpt_800F1504) -/* 09F364 8009E764 00380821 */ addu $at, $at, $t8 -/* 09F368 8009E768 8C381504 */ lw $t8, %lo(jpt_800F1504)($at) -/* 09F36C 8009E76C 03000008 */ jr $t8 -/* 09F370 8009E770 00000000 */ nop -glabel L8009E774 -/* 09F374 8009E774 44802000 */ mtc1 $zero, $f4 -/* 09F378 8009E778 3C018019 */ lui $at, %hi(s8018ED94) # $at, 0x8019 -/* 09F37C 8009E77C AC20ED94 */ sw $zero, %lo(s8018ED94)($at) -/* 09F380 8009E780 3C01800F */ lui $at, %hi(D_800E8530) # $at, 0x800f -/* 09F384 8009E784 E4248530 */ swc1 $f4, %lo(D_800E8530)($at) -/* 09F388 8009E788 3C014040 */ li $at, 0x40400000 # 3.000000 -/* 09F38C 8009E78C 44813000 */ mtc1 $at, $f6 -/* 09F390 8009E790 3C01800F */ lui $at, %hi(D_800E8534) # $at, 0x800f -/* 09F394 8009E794 44800000 */ mtc1 $zero, $f0 -/* 09F398 8009E798 E4268534 */ swc1 $f6, %lo(D_800E8534)($at) -/* 09F39C 8009E79C 3C018019 */ lui $at, %hi(D_8018EDC0) # $at, 0x8019 -/* 09F3A0 8009E7A0 241909C4 */ li $t9, 2500 -/* 09F3A4 8009E7A4 AC39EDC0 */ sw $t9, %lo(D_8018EDC0)($at) -/* 09F3A8 8009E7A8 3C018019 */ lui $at, %hi(D_8018EDC8) # $at, 0x8019 -/* 09F3AC 8009E7AC E420EDC8 */ swc1 $f0, %lo(D_8018EDC8)($at) -/* 09F3B0 8009E7B0 3C01C387 */ li $at, 0xC3870000 # -270.000000 -/* 09F3B4 8009E7B4 44814000 */ mtc1 $at, $f8 -/* 09F3B8 8009E7B8 3C018019 */ lui $at, %hi(D_8018EDCC) # $at, 0x8019 -/* 09F3BC 8009E7BC 240EFFFF */ li $t6, -1 -/* 09F3C0 8009E7C0 E428EDCC */ swc1 $f8, %lo(D_8018EDCC)($at) -/* 09F3C4 8009E7C4 3C018019 */ lui $at, %hi(D_8018EDD0) # $at, 0x8019 -/* 09F3C8 8009E7C8 E420EDD0 */ swc1 $f0, %lo(D_8018EDD0)($at) -/* 09F3CC 8009E7CC 3C018019 */ lui $at, %hi(D_8018EDD4) # $at, 0x8019 -/* 09F3D0 8009E7D0 E420EDD4 */ swc1 $f0, %lo(D_8018EDD4)($at) -/* 09F3D4 8009E7D4 3C018019 */ lui $at, %hi(D_8018EDD8) # $at, 0x8019 -/* 09F3D8 8009E7D8 E420EDD8 */ swc1 $f0, %lo(D_8018EDD8)($at) -/* 09F3DC 8009E7DC 3C018019 */ lui $at, %hi(D_8018EDDC) # $at, 0x8019 -/* 09F3E0 8009E7E0 E420EDDC */ swc1 $f0, %lo(D_8018EDDC)($at) -/* 09F3E4 8009E7E4 3C014040 */ li $at, 0x40400000 # 3.000000 -/* 09F3E8 8009E7E8 44815000 */ mtc1 $at, $f10 -/* 09F3EC 8009E7EC 3C018019 */ lui $at, %hi(D_8018EDC4) # $at, 0x8019 -/* 09F3F0 8009E7F0 E42AEDC4 */ swc1 $f10, %lo(D_8018EDC4)($at) -/* 09F3F4 8009E7F4 AFEE001C */ sw $t6, 0x1c($ra) -/* 09F3F8 8009E7F8 10000375 */ b .L8009F5D0 -/* 09F3FC 8009E7FC AFE30020 */ sw $v1, 0x20($ra) -glabel L8009E800 -/* 09F400 8009E800 240F0708 */ li $t7, 1800 -/* 09F404 8009E804 3C018019 */ lui $at, %hi(D_8018EDC0) # $at, 0x8019 -/* 09F408 8009E808 AC2FEDC0 */ sw $t7, %lo(D_8018EDC0)($at) -/* 09F40C 8009E80C 3C01C24C */ li $at, 0xC24C0000 # -51.000000 -/* 09F410 8009E810 44818000 */ mtc1 $at, $f16 -/* 09F414 8009E814 3C018019 */ lui $at, %hi(D_8018EDC8) # $at, 0x8019 -/* 09F418 8009E818 44800000 */ mtc1 $zero, $f0 -/* 09F41C 8009E81C E430EDC8 */ swc1 $f16, %lo(D_8018EDC8)($at) -/* 09F420 8009E820 3C01C140 */ li $at, 0xC1400000 # -12.000000 -/* 09F424 8009E824 44819000 */ mtc1 $at, $f18 -/* 09F428 8009E828 3C018019 */ lui $at, %hi(D_8018EDCC) # $at, 0x8019 -/* 09F42C 8009E82C 2418FFFF */ li $t8, -1 -/* 09F430 8009E830 E432EDCC */ swc1 $f18, %lo(D_8018EDCC)($at) -/* 09F434 8009E834 3C01C190 */ li $at, 0xC1900000 # -18.000000 -/* 09F438 8009E838 44812000 */ mtc1 $at, $f4 -/* 09F43C 8009E83C 3C018019 */ lui $at, %hi(D_8018EDD0) # $at, 0x8019 -/* 09F440 8009E840 E424EDD0 */ swc1 $f4, %lo(D_8018EDD0)($at) -/* 09F444 8009E844 3C01C387 */ li $at, 0xC3870000 # -270.000000 -/* 09F448 8009E848 44813000 */ mtc1 $at, $f6 -/* 09F44C 8009E84C 3C018019 */ lui $at, %hi(D_8018EDD4) # $at, 0x8019 -/* 09F450 8009E850 E426EDD4 */ swc1 $f6, %lo(D_8018EDD4)($at) -/* 09F454 8009E854 3C01800F */ lui $at, %hi(D_800F15E0) # $at, 0x800f -/* 09F458 8009E858 C42815E0 */ lwc1 $f8, %lo(D_800F15E0)($at) -/* 09F45C 8009E85C 3C018019 */ lui $at, %hi(D_8018EDD8) # $at, 0x8019 -/* 09F460 8009E860 E428EDD8 */ swc1 $f8, %lo(D_8018EDD8)($at) -/* 09F464 8009E864 3C018019 */ lui $at, %hi(D_8018EDDC) # $at, 0x8019 -/* 09F468 8009E868 E420EDDC */ swc1 $f0, %lo(D_8018EDDC)($at) -/* 09F46C 8009E86C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 09F470 8009E870 44815000 */ mtc1 $at, $f10 -/* 09F474 8009E874 3C018019 */ lui $at, %hi(D_8018EDC4) # $at, 0x8019 -/* 09F478 8009E878 E42AEDC4 */ swc1 $f10, %lo(D_8018EDC4)($at) -/* 09F47C 8009E87C AFF8001C */ sw $t8, 0x1c($ra) -/* 09F480 8009E880 10000353 */ b .L8009F5D0 -/* 09F484 8009E884 AFE30020 */ sw $v1, 0x20($ra) -glabel L8009E888 -/* 09F488 8009E888 3C040200 */ lui $a0, %hi(D_020014C8) # $a0, 0x200 -/* 09F48C 8009E88C AFBF007C */ sw $ra, 0x7c($sp) -/* 09F490 8009E890 248414C8 */ addiu $a0, %lo(D_020014C8) # addiu $a0, $a0, 0x14c8 -/* 09F494 8009E894 0C0265AF */ jal func_800996BC -/* 09F498 8009E898 00002825 */ move $a1, $zero -/* 09F49C 8009E89C 3C040200 */ lui $a0, %hi(D_020014C8) # $a0, 0x200 -/* 09F4A0 8009E8A0 0C026E55 */ jal func_8009B954 -/* 09F4A4 8009E8A4 248414C8 */ addiu $a0, %lo(D_020014C8) # addiu $a0, $a0, 0x14c8 -/* 09F4A8 8009E8A8 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F4AC 8009E8AC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F4B0 8009E8B0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F4B4 8009E8B4 3C050200 */ lui $a1, %hi(D_020014C8) # $a1, 0x200 -/* 09F4B8 8009E8B8 8FE6000C */ lw $a2, 0xc($ra) -/* 09F4BC 8009E8BC 8FE70010 */ lw $a3, 0x10($ra) -/* 09F4C0 8009E8C0 24A514C8 */ addiu $a1, %lo(D_020014C8) # addiu $a1, $a1, 0x14c8 -/* 09F4C4 8009E8C4 0C026E9D */ jal func_8009BA74 -/* 09F4C8 8009E8C8 8D040000 */ lw $a0, ($t0) -/* 09F4CC 8009E8CC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F4D0 8009E8D0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F4D4 8009E8D4 0C026E66 */ jal func_8009B998 -/* 09F4D8 8009E8D8 AD020000 */ sw $v0, ($t0) -/* 09F4DC 8009E8DC 1000033D */ b .L8009F5D4 -/* 09F4E0 8009E8E0 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009E8E4 -/* 09F4E4 8009E8E4 3C040200 */ lui $a0, %hi(D_02001540) # $a0, 0x200 -/* 09F4E8 8009E8E8 AFBF007C */ sw $ra, 0x7c($sp) -/* 09F4EC 8009E8EC 24841540 */ addiu $a0, %lo(D_02001540) # addiu $a0, $a0, 0x1540 -/* 09F4F0 8009E8F0 0C0265AF */ jal func_800996BC -/* 09F4F4 8009E8F4 00002825 */ move $a1, $zero -/* 09F4F8 8009E8F8 3C040200 */ lui $a0, %hi(D_02001540) # $a0, 0x200 -/* 09F4FC 8009E8FC 0C026E55 */ jal func_8009B954 -/* 09F500 8009E900 24841540 */ addiu $a0, %lo(D_02001540) # addiu $a0, $a0, 0x1540 -/* 09F504 8009E904 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F508 8009E908 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F50C 8009E90C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F510 8009E910 3C050200 */ lui $a1, %hi(D_02001540) # $a1, 0x200 -/* 09F514 8009E914 8FE6000C */ lw $a2, 0xc($ra) -/* 09F518 8009E918 8FE70010 */ lw $a3, 0x10($ra) -/* 09F51C 8009E91C 24A51540 */ addiu $a1, %lo(D_02001540) # addiu $a1, $a1, 0x1540 -/* 09F520 8009E920 0C026E9D */ jal func_8009BA74 -/* 09F524 8009E924 8D040000 */ lw $a0, ($t0) -/* 09F528 8009E928 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F52C 8009E92C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F530 8009E930 0C026E66 */ jal func_8009B998 -/* 09F534 8009E934 AD020000 */ sw $v0, ($t0) -/* 09F538 8009E938 10000326 */ b .L8009F5D4 -/* 09F53C 8009E93C 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009E940 -/* 09F540 8009E940 3C040200 */ lui $a0, %hi(D_0200157C) # $a0, 0x200 -/* 09F544 8009E944 AFBF007C */ sw $ra, 0x7c($sp) -/* 09F548 8009E948 2484157C */ addiu $a0, %lo(D_0200157C) # addiu $a0, $a0, 0x157c -/* 09F54C 8009E94C 00002825 */ move $a1, $zero -/* 09F550 8009E950 0C0265AF */ jal func_800996BC -/* 09F554 8009E954 00001025 */ move $v0, $zero -/* 09F558 8009E958 3C040200 */ lui $a0, %hi(D_02001874) # $a0, 0x200 -/* 09F55C 8009E95C 0C026461 */ jal func_80099184 -/* 09F560 8009E960 24841874 */ addiu $a0, %lo(D_02001874) # addiu $a0, $a0, 0x1874 -/* 09F564 8009E964 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F568 8009E968 24190069 */ li $t9, 105 -/* 09F56C 8009E96C 3C03800E */ lui $v1, %hi(D_800E7AF8) # $v1, 0x800e -/* 09F570 8009E970 24637AF8 */ addiu $v1, %lo(D_800E7AF8) # addiu $v1, $v1, 0x7af8 -/* 09F574 8009E974 AFF90010 */ sw $t9, 0x10($ra) -/* 09F578 8009E978 8C640000 */ lw $a0, ($v1) -.L8009E97C: -/* 09F57C 8009E97C 0C026449 */ jal segmented_to_virtual_dupe -/* 09F580 8009E980 AFA30024 */ sw $v1, 0x24($sp) -/* 09F584 8009E984 0C026461 */ jal func_80099184 -/* 09F588 8009E988 00402025 */ move $a0, $v0 -/* 09F58C 8009E98C 8FA30024 */ lw $v1, 0x24($sp) -/* 09F590 8009E990 3C0E800E */ lui $t6, %hi(D_800E7D0C) # $t6, 0x800e -/* 09F594 8009E994 25CE7D0C */ addiu $t6, %lo(D_800E7D0C) # addiu $t6, $t6, 0x7d0c -/* 09F598 8009E998 24630004 */ addiu $v1, $v1, 4 -/* 09F59C 8009E99C 546EFFF7 */ bnel $v1, $t6, .L8009E97C -/* 09F5A0 8009E9A0 8C640000 */ lw $a0, ($v1) -/* 09F5A4 8009E9A4 1000030B */ b .L8009F5D4 -/* 09F5A8 8009E9A8 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009E9AC -/* 09F5AC 8009E9AC 3C040200 */ lui $a0, %hi(D_020015A4) # $a0, 0x200 -/* 09F5B0 8009E9B0 AFBF007C */ sw $ra, 0x7c($sp) -/* 09F5B4 8009E9B4 0C026461 */ jal func_80099184 -/* 09F5B8 8009E9B8 248415A4 */ addiu $a0, %lo(D_020015A4) # addiu $a0, $a0, 0x15a4 -/* 09F5BC 8009E9BC 3C040200 */ lui $a0, %hi(D_020015A4) # $a0, 0x200 -/* 09F5C0 8009E9C0 0C026E55 */ jal func_8009B954 -/* 09F5C4 8009E9C4 248415A4 */ addiu $a0, %lo(D_020015A4) # addiu $a0, $a0, 0x15a4 -/* 09F5C8 8009E9C8 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F5CC 8009E9CC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F5D0 8009E9D0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F5D4 8009E9D4 3C050200 */ lui $a1, %hi(D_020015A4) # $a1, 0x200 -/* 09F5D8 8009E9D8 8FE6000C */ lw $a2, 0xc($ra) -/* 09F5DC 8009E9DC 8FE70010 */ lw $a3, 0x10($ra) -/* 09F5E0 8009E9E0 24A515A4 */ addiu $a1, %lo(D_020015A4) # addiu $a1, $a1, 0x15a4 -/* 09F5E4 8009E9E4 0C026E9D */ jal func_8009BA74 -/* 09F5E8 8009E9E8 8D040000 */ lw $a0, ($t0) -/* 09F5EC 8009E9EC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F5F0 8009E9F0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F5F4 8009E9F4 AD020000 */ sw $v0, ($t0) -/* 09F5F8 8009E9F8 244F0008 */ addiu $t7, $v0, 8 -/* 09F5FC 8009E9FC AD0F0000 */ sw $t7, ($t0) -/* 09F600 8009EA00 3C18FD70 */ lui $t8, 0xfd70 -/* 09F604 8009EA04 AC580000 */ sw $t8, ($v0) -/* 09F608 8009EA08 3C040A0C */ lui $a0, %hi(gTexture7ED50C) # $a0, 0xa0c -/* 09F60C 8009EA0C 24843ADC */ addiu $a0, %lo(gTexture7ED50C) # addiu $a0, $a0, 0x3adc -/* 09F610 8009EA10 0C026E31 */ jal func_8009B8C4 -/* 09F614 8009EA14 AFA2006C */ sw $v0, 0x6c($sp) -/* 09F618 8009EA18 8FB9006C */ lw $t9, 0x6c($sp) -/* 09F61C 8009EA1C 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F620 8009EA20 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F624 8009EA24 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F628 8009EA28 AF220004 */ sw $v0, 4($t9) -/* 09F62C 8009EA2C 8D030000 */ lw $v1, ($t0) -/* 09F630 8009EA30 3C180708 */ lui $t8, (0x07080200 >> 16) # lui $t8, 0x708 -/* 09F634 8009EA34 37180200 */ ori $t8, (0x07080200 & 0xFFFF) # ori $t8, $t8, 0x200 -/* 09F638 8009EA38 246E0008 */ addiu $t6, $v1, 8 -/* 09F63C 8009EA3C AD0E0000 */ sw $t6, ($t0) -/* 09F640 8009EA40 3C0FF570 */ lui $t7, 0xf570 -/* 09F644 8009EA44 AC6F0000 */ sw $t7, ($v1) -/* 09F648 8009EA48 AC780004 */ sw $t8, 4($v1) -/* 09F64C 8009EA4C 8D030000 */ lw $v1, ($t0) -/* 09F650 8009EA50 3C0EE600 */ lui $t6, 0xe600 -/* 09F654 8009EA54 3C18F300 */ lui $t8, 0xf300 -/* 09F658 8009EA58 24790008 */ addiu $t9, $v1, 8 -/* 09F65C 8009EA5C AD190000 */ sw $t9, ($t0) -/* 09F660 8009EA60 AC600004 */ sw $zero, 4($v1) -/* 09F664 8009EA64 AC6E0000 */ sw $t6, ($v1) -/* 09F668 8009EA68 8D030000 */ lw $v1, ($t0) -/* 09F66C 8009EA6C 3C19074F */ lui $t9, (0x074FF020 >> 16) # lui $t9, 0x74f -/* 09F670 8009EA70 3739F020 */ ori $t9, (0x074FF020 & 0xFFFF) # ori $t9, $t9, 0xf020 -/* 09F674 8009EA74 246F0008 */ addiu $t7, $v1, 8 -/* 09F678 8009EA78 AD0F0000 */ sw $t7, ($t0) -/* 09F67C 8009EA7C AC790004 */ sw $t9, 4($v1) -/* 09F680 8009EA80 AC780000 */ sw $t8, ($v1) -/* 09F684 8009EA84 8D030000 */ lw $v1, ($t0) -/* 09F688 8009EA88 3C0FE700 */ lui $t7, 0xe700 -/* 09F68C 8009EA8C 3C19F570 */ lui $t9, (0xF5708000 >> 16) # lui $t9, 0xf570 -/* 09F690 8009EA90 246E0008 */ addiu $t6, $v1, 8 -/* 09F694 8009EA94 AD0E0000 */ sw $t6, ($t0) -/* 09F698 8009EA98 AC600004 */ sw $zero, 4($v1) -/* 09F69C 8009EA9C AC6F0000 */ sw $t7, ($v1) -/* 09F6A0 8009EAA0 8D030000 */ lw $v1, ($t0) -/* 09F6A4 8009EAA4 3C0E0008 */ lui $t6, (0x00080200 >> 16) # lui $t6, 8 -/* 09F6A8 8009EAA8 35CE0200 */ ori $t6, (0x00080200 & 0xFFFF) # ori $t6, $t6, 0x200 -/* 09F6AC 8009EAAC 24780008 */ addiu $t8, $v1, 8 -/* 09F6B0 8009EAB0 AD180000 */ sw $t8, ($t0) -/* 09F6B4 8009EAB4 37398000 */ ori $t9, (0xF5708000 & 0xFFFF) # ori $t9, $t9, 0x8000 -/* 09F6B8 8009EAB8 AC790000 */ sw $t9, ($v1) -/* 09F6BC 8009EABC AC6E0004 */ sw $t6, 4($v1) -/* 09F6C0 8009EAC0 8D030000 */ lw $v1, ($t0) -/* 09F6C4 8009EAC4 3C19003F */ lui $t9, (0x003FC010 >> 16) # lui $t9, 0x3f -/* 09F6C8 8009EAC8 3739C010 */ ori $t9, (0x003FC010 & 0xFFFF) # ori $t9, $t9, 0xc010 -/* 09F6CC 8009EACC 246F0008 */ addiu $t7, $v1, 8 -/* 09F6D0 8009EAD0 AD0F0000 */ sw $t7, ($t0) -/* 09F6D4 8009EAD4 3C18F200 */ lui $t8, 0xf200 -/* 09F6D8 8009EAD8 AC780000 */ sw $t8, ($v1) -/* 09F6DC 8009EADC AC790004 */ sw $t9, 4($v1) -/* 09F6E0 8009EAE0 8D030000 */ lw $v1, ($t0) -/* 09F6E4 8009EAE4 3C180008 */ lui $t8, (0x000802C0 >> 16) # lui $t8, 8 -/* 09F6E8 8009EAE8 3C0FE448 */ lui $t7, (0xE44802D4 >> 16) # lui $t7, 0xe448 -/* 09F6EC 8009EAEC 246E0008 */ addiu $t6, $v1, 8 -/* 09F6F0 8009EAF0 AD0E0000 */ sw $t6, ($t0) -/* 09F6F4 8009EAF4 35EF02D4 */ ori $t7, (0xE44802D4 & 0xFFFF) # ori $t7, $t7, 0x2d4 -/* 09F6F8 8009EAF8 371802C0 */ ori $t8, (0x000802C0 & 0xFFFF) # ori $t8, $t8, 0x2c0 -/* 09F6FC 8009EAFC AC780004 */ sw $t8, 4($v1) -/* 09F700 8009EB00 AC6F0000 */ sw $t7, ($v1) -/* 09F704 8009EB04 8D030000 */ lw $v1, ($t0) -/* 09F708 8009EB08 240F0080 */ li $t7, 128 -/* 09F70C 8009EB0C 3C0EB300 */ lui $t6, 0xb300 -/* 09F710 8009EB10 24790008 */ addiu $t9, $v1, 8 -/* 09F714 8009EB14 AD190000 */ sw $t9, ($t0) -/* 09F718 8009EB18 AC6F0004 */ sw $t7, 4($v1) -/* 09F71C 8009EB1C AC6E0000 */ sw $t6, ($v1) -/* 09F720 8009EB20 8D030000 */ lw $v1, ($t0) -/* 09F724 8009EB24 3C0E0400 */ lui $t6, (0x0400FC00 >> 16) # lui $t6, 0x400 -/* 09F728 8009EB28 35CEFC00 */ ori $t6, (0x0400FC00 & 0xFFFF) # ori $t6, $t6, 0xfc00 -/* 09F72C 8009EB2C 24780008 */ addiu $t8, $v1, 8 -/* 09F730 8009EB30 AD180000 */ sw $t8, ($t0) -/* 09F734 8009EB34 3C19B200 */ lui $t9, 0xb200 -/* 09F738 8009EB38 AC790000 */ sw $t9, ($v1) -/* 09F73C 8009EB3C AC6E0004 */ sw $t6, 4($v1) -/* 09F740 8009EB40 AFBF007C */ sw $ra, 0x7c($sp) -/* 09F744 8009EB44 0C026E66 */ jal func_8009B998 -/* 09F748 8009EB48 00000000 */ nop -/* 09F74C 8009EB4C 3C040200 */ lui $a0, %hi(D_020015CC) # $a0, 0x200 -/* 09F750 8009EB50 0C026461 */ jal func_80099184 -/* 09F754 8009EB54 248415CC */ addiu $a0, %lo(D_020015CC) # addiu $a0, $a0, 0x15cc -/* 09F758 8009EB58 3C040200 */ lui $a0, %hi(D_020015CC) # $a0, 0x200 -/* 09F75C 8009EB5C 0C026E55 */ jal func_8009B954 -/* 09F760 8009EB60 248415CC */ addiu $a0, %lo(D_020015CC) # addiu $a0, $a0, 0x15cc -/* 09F764 8009EB64 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F768 8009EB68 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F76C 8009EB6C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F770 8009EB70 3C050200 */ lui $a1, %hi(D_020015CC) # $a1, 0x200 -/* 09F774 8009EB74 8FE6000C */ lw $a2, 0xc($ra) -/* 09F778 8009EB78 8FE70010 */ lw $a3, 0x10($ra) -/* 09F77C 8009EB7C 24A515CC */ addiu $a1, %lo(D_020015CC) # addiu $a1, $a1, 0x15cc -/* 09F780 8009EB80 0C026E9D */ jal func_8009BA74 -/* 09F784 8009EB84 8D040000 */ lw $a0, ($t0) -/* 09F788 8009EB88 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F78C 8009EB8C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F790 8009EB90 0C026E66 */ jal func_8009B998 -/* 09F794 8009EB94 AD020000 */ sw $v0, ($t0) -/* 09F798 8009EB98 3C040200 */ lui $a0, %hi(D_02001630) # $a0, 0x200 -/* 09F79C 8009EB9C 0C026461 */ jal func_80099184 -/* 09F7A0 8009EBA0 24841630 */ addiu $a0, %lo(D_02001630) # addiu $a0, $a0, 0x1630 -/* 09F7A4 8009EBA4 3C040200 */ lui $a0, %hi(D_02001630) # $a0, 0x200 -/* 09F7A8 8009EBA8 0C026E55 */ jal func_8009B954 -/* 09F7AC 8009EBAC 24841630 */ addiu $a0, %lo(D_02001630) # addiu $a0, $a0, 0x1630 -/* 09F7B0 8009EBB0 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F7B4 8009EBB4 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F7B8 8009EBB8 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F7BC 8009EBBC 3C050200 */ lui $a1, %hi(D_02001630) # $a1, 0x200 -/* 09F7C0 8009EBC0 8FE6000C */ lw $a2, 0xc($ra) -/* 09F7C4 8009EBC4 8FE70010 */ lw $a3, 0x10($ra) -/* 09F7C8 8009EBC8 24A51630 */ addiu $a1, %lo(D_02001630) # addiu $a1, $a1, 0x1630 -/* 09F7CC 8009EBCC 0C026E9D */ jal func_8009BA74 -/* 09F7D0 8009EBD0 8D040000 */ lw $a0, ($t0) -/* 09F7D4 8009EBD4 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F7D8 8009EBD8 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F7DC 8009EBDC 0C026E66 */ jal func_8009B998 -/* 09F7E0 8009EBE0 AD020000 */ sw $v0, ($t0) -/* 09F7E4 8009EBE4 3C040200 */ lui $a0, %hi(D_02001658) # $a0, 0x200 -/* 09F7E8 8009EBE8 0C026461 */ jal func_80099184 -/* 09F7EC 8009EBEC 24841658 */ addiu $a0, %lo(D_02001658) # addiu $a0, $a0, 0x1658 -/* 09F7F0 8009EBF0 3C040200 */ lui $a0, %hi(D_02001658) # $a0, 0x200 -/* 09F7F4 8009EBF4 0C026E55 */ jal func_8009B954 -/* 09F7F8 8009EBF8 24841658 */ addiu $a0, %lo(D_02001658) # addiu $a0, $a0, 0x1658 -/* 09F7FC 8009EBFC 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F800 8009EC00 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F804 8009EC04 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F808 8009EC08 3C050200 */ lui $a1, %hi(D_02001658) # $a1, 0x200 -/* 09F80C 8009EC0C 8FE6000C */ lw $a2, 0xc($ra) -/* 09F810 8009EC10 8FE70010 */ lw $a3, 0x10($ra) -/* 09F814 8009EC14 24A51658 */ addiu $a1, %lo(D_02001658) # addiu $a1, $a1, 0x1658 -/* 09F818 8009EC18 0C026E9D */ jal func_8009BA74 -/* 09F81C 8009EC1C 8D040000 */ lw $a0, ($t0) -/* 09F820 8009EC20 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F824 8009EC24 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 -/* 09F828 8009EC28 0C026E66 */ jal func_8009B998 -/* 09F82C 8009EC2C AD020000 */ sw $v0, ($t0) -/* 09F830 8009EC30 10000268 */ b .L8009F5D4 -/* 09F834 8009EC34 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EC38 -/* 09F838 8009EC38 3C04800E */ lui $a0, %hi(D_800E7D34) # $a0, 0x800e -/* 09F83C 8009EC3C AFBF007C */ sw $ra, 0x7c($sp) -/* 09F840 8009EC40 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 09F844 8009EC44 8C847D34 */ lw $a0, %lo(D_800E7D34)($a0) -/* 09F848 8009EC48 0C0268DD */ jal func_8009A374 -/* 09F84C 8009EC4C 00402025 */ move $a0, $v0 -/* 09F850 8009EC50 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F854 8009EC54 1000025E */ b .L8009F5D0 -/* 09F858 8009EC58 AFE20018 */ sw $v0, 0x18($ra) -glabel L8009EC5C -/* 09F85C 8009EC5C 3C03800E */ lui $v1, %hi(D_800E7D0C) # $v1, 0x800e -/* 09F860 8009EC60 24637D0C */ addiu $v1, %lo(D_800E7D0C) # addiu $v1, $v1, 0x7d0c -/* 09F864 8009EC64 8C640000 */ lw $a0, ($v1) -.L8009EC68: -/* 09F868 8009EC68 0C026449 */ jal segmented_to_virtual_dupe -/* 09F86C 8009EC6C AFA30024 */ sw $v1, 0x24($sp) -/* 09F870 8009EC70 0C026461 */ jal func_80099184 -/* 09F874 8009EC74 00402025 */ move $a0, $v0 -/* 09F878 8009EC78 8FA30024 */ lw $v1, 0x24($sp) -/* 09F87C 8009EC7C 3C0F800E */ lui $t7, %hi(D_800E7D34) # $t7, 0x800e -/* 09F880 8009EC80 25EF7D34 */ addiu $t7, %lo(D_800E7D34) # addiu $t7, $t7, 0x7d34 -/* 09F884 8009EC84 24630004 */ addiu $v1, $v1, 4 -/* 09F888 8009EC88 546FFFF7 */ bnel $v1, $t7, .L8009EC68 -/* 09F88C 8009EC8C 8C640000 */ lw $a0, ($v1) -/* 09F890 8009EC90 10000250 */ b .L8009F5D4 -/* 09F894 8009EC94 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EC98 -/* 09F898 8009EC98 3C040200 */ lui $a0, %hi(D_0200184C) # $a0, 0x200 -/* 09F89C 8009EC9C 0C026461 */ jal func_80099184 -/* 09F8A0 8009ECA0 2484184C */ addiu $a0, %lo(D_0200184C) # addiu $a0, $a0, 0x184c -/* 09F8A4 8009ECA4 1000024B */ b .L8009F5D4 -/* 09F8A8 8009ECA8 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009ECAC -/* 09F8AC 8009ECAC 0C02D557 */ jal func_800B555C -/* 09F8B0 8009ECB0 00000000 */ nop -/* 09F8B4 8009ECB4 0002C080 */ sll $t8, $v0, 2 -/* 09F8B8 8009ECB8 3C04800E */ lui $a0, %hi(D_800E7D4C) -/* 09F8BC 8009ECBC 00982021 */ addu $a0, $a0, $t8 -/* 09F8C0 8009ECC0 8C847D4C */ lw $a0, %lo(D_800E7D4C)($a0) -/* 09F8C4 8009ECC4 0C0265AF */ jal func_800996BC -/* 09F8C8 8009ECC8 00002825 */ move $a1, $zero -/* 09F8CC 8009ECCC 10000241 */ b .L8009F5D4 -/* 09F8D0 8009ECD0 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009ECD4 -/* 09F8D4 8009ECD4 0C01BB91 */ jal func_8006EE44 -/* 09F8D8 8009ECD8 00000000 */ nop -/* 09F8DC 8009ECDC 3C028019 */ lui $v0, %hi(gD_8018E118TotalSize) # $v0, 0x8019 -/* 09F8E0 8009ECE0 2442E110 */ addiu $v0, %lo(gD_8018E118TotalSize) # addiu $v0, $v0, -0x1ef0 -/* 09F8E4 8009ECE4 8C590000 */ lw $t9, ($v0) -/* 09F8E8 8009ECE8 3C010001 */ lui $at, 1 -/* 09F8EC 8009ECEC 3C040200 */ lui $a0, %hi(D_020045E8) # $a0, 0x200 -/* 09F8F0 8009ECF0 03217021 */ addu $t6, $t9, $at -/* 09F8F4 8009ECF4 AC4E0000 */ sw $t6, ($v0) -/* 09F8F8 8009ECF8 0C026461 */ jal func_80099184 -/* 09F8FC 8009ECFC 248445E8 */ addiu $a0, %lo(D_020045E8) # addiu $a0, $a0, 0x45e8 -/* 09F900 8009ED00 10000234 */ b .L8009F5D4 -/* 09F904 8009ED04 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009ED08 -/* 09F908 8009ED08 3C040200 */ lui $a0, %hi(D_02004610) # $a0, 0x200 -/* 09F90C 8009ED0C 0C026461 */ jal func_80099184 -/* 09F910 8009ED10 24844610 */ addiu $a0, %lo(D_02004610) # addiu $a0, $a0, 0x4610 -/* 09F914 8009ED14 1000022F */ b .L8009F5D4 -/* 09F918 8009ED18 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009ED1C -/* 09F91C 8009ED1C 0C02D557 */ jal func_800B555C -/* 09F920 8009ED20 00000000 */ nop -/* 09F924 8009ED24 00027880 */ sll $t7, $v0, 2 -/* 09F928 8009ED28 3C04800E */ lui $a0, %hi(D_800E7D4C) -/* 09F92C 8009ED2C 008F2021 */ addu $a0, $a0, $t7 -/* 09F930 8009ED30 8C847D4C */ lw $a0, %lo(D_800E7D4C)($a0) -/* 09F934 8009ED34 0C0265AF */ jal func_800996BC -/* 09F938 8009ED38 00002825 */ move $a1, $zero -/* 09F93C 8009ED3C 3C040200 */ lui $a0, %hi(D_02004B74) # $a0, 0x200 -/* 09F940 8009ED40 24844B74 */ addiu $a0, %lo(D_02004B74) # addiu $a0, $a0, 0x4b74 -/* 09F944 8009ED44 0C0265AF */ jal func_800996BC -/* 09F948 8009ED48 00002825 */ move $a1, $zero -/* 09F94C 8009ED4C 00002025 */ move $a0, $zero -/* 09F950 8009ED50 0C026C29 */ jal func_8009B0A4 -/* 09F954 8009ED54 24050019 */ li $a1, 25 -/* 09F958 8009ED58 8FB80080 */ lw $t8, 0x80($sp) -/* 09F95C 8009ED5C 3C0E800E */ lui $t6, %hi(D_800E74E8) # $t6, 0x800e -/* 09F960 8009ED60 25CE74E8 */ addiu $t6, %lo(D_800E74E8) # addiu $t6, $t6, 0x74e8 -/* 09F964 8009ED64 0018C8C0 */ sll $t9, $t8, 3 -/* 09F968 8009ED68 032E1021 */ addu $v0, $t9, $t6 -/* 09F96C 8009ED6C 944FFEEC */ lhu $t7, -0x114($v0) -/* 09F970 8009ED70 3C050001 */ lui $a1, (0x00012C00 >> 16) # lui $a1, 1 -/* 09F974 8009ED74 34A52C00 */ ori $a1, (0x00012C00 & 0xFFFF) # ori $a1, $a1, 0x2c00 -/* 09F978 8009ED78 9446FEE8 */ lhu $a2, -0x118($v0) -/* 09F97C 8009ED7C 9447FEEA */ lhu $a3, -0x116($v0) -/* 09F980 8009ED80 00002025 */ move $a0, $zero -/* 09F984 8009ED84 0C026D4E */ jal func_8009B538 -/* 09F988 8009ED88 AFAF0010 */ sw $t7, 0x10($sp) -/* 09F98C 8009ED8C 10000211 */ b .L8009F5D4 -/* 09F990 8009ED90 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009ED94 -/* 09F994 8009ED94 24180020 */ li $t8, 32 -/* 09F998 8009ED98 AFF8001C */ sw $t8, 0x1c($ra) -glabel L8009ED9C -/* 09F99C 8009ED9C 8FB90080 */ lw $t9, 0x80($sp) -/* 09F9A0 8009EDA0 3C04800F */ lui $a0, %hi(D_800E822C) # 0x800f -/* 09F9A4 8009EDA4 00197080 */ sll $t6, $t9, 2 -/* 09F9A8 8009EDA8 008E2021 */ addu $a0, $a0, $t6 -/* 09F9AC 8009EDAC 0C026449 */ jal segmented_to_virtual_dupe -/* 09F9B0 8009EDB0 8C84822C */ lw $a0, %lo(D_800E822C)($a0) # -0x7dd4($a0) -/* 09F9B4 8009EDB4 00402025 */ move $a0, $v0 -/* 09F9B8 8009EDB8 0C0265AF */ jal func_800996BC -/* 09F9BC 8009EDBC 00002825 */ move $a1, $zero -/* 09F9C0 8009EDC0 10000204 */ b .L8009F5D4 -/* 09F9C4 8009EDC4 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EDC8 -/* 09F9C8 8009EDC8 8FB80080 */ lw $t8, 0x80($sp) -/* 09F9CC 8009EDCC 3C0E800F */ lui $t6, %hi(D_800E8234) # $t6, 0x800f -/* 09F9D0 8009EDD0 25CE8234 */ addiu $t6, %lo(D_800E8234) # addiu $t6, $t6, -0x7dcc -/* 09F9D4 8009EDD4 0018C8C0 */ sll $t9, $t8, 3 -/* 09F9D8 8009EDD8 032E1021 */ addu $v0, $t9, $t6 -/* 09F9DC 8009EDDC 8C44FFA8 */ lw $a0, -0x58($v0) -/* 09F9E0 8009EDE0 0C026449 */ jal segmented_to_virtual_dupe -/* 09F9E4 8009EDE4 AFA20024 */ sw $v0, 0x24($sp) -/* 09F9E8 8009EDE8 00402025 */ move $a0, $v0 -/* 09F9EC 8009EDEC 0C0265AF */ jal func_800996BC -/* 09F9F0 8009EDF0 00002825 */ move $a1, $zero -/* 09F9F4 8009EDF4 8FAF0024 */ lw $t7, 0x24($sp) -/* 09F9F8 8009EDF8 0C026449 */ jal segmented_to_virtual_dupe -/* 09F9FC 8009EDFC 8DE4FFAC */ lw $a0, -0x54($t7) -/* 09FA00 8009EE00 0C026461 */ jal func_80099184 -/* 09FA04 8009EE04 00402025 */ move $a0, $v0 -/* 09FA08 8009EE08 100001F2 */ b .L8009F5D4 -/* 09FA0C 8009EE0C 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EE10 -/* 09FA10 8009EE10 3C040200 */ lui $a0, %hi(D_02004B4C) # $a0, 0x200 -/* 09FA14 8009EE14 24844B4C */ addiu $a0, %lo(D_02004B4C) # addiu $a0, $a0, 0x4b4c -/* 09FA18 8009EE18 0C0265AF */ jal func_800996BC -/* 09FA1C 8009EE1C 00002825 */ move $a1, $zero -/* 09FA20 8009EE20 100001EC */ b .L8009F5D4 -/* 09FA24 8009EE24 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EE28 -/* 09FA28 8009EE28 3C040200 */ lui $a0, %hi(D_02004B74) # $a0, 0x200 -/* 09FA2C 8009EE2C AFBF007C */ sw $ra, 0x7c($sp) -/* 09FA30 8009EE30 24844B74 */ addiu $a0, %lo(D_02004B74) # addiu $a0, $a0, 0x4b74 -/* 09FA34 8009EE34 0C0265AF */ jal func_800996BC -/* 09FA38 8009EE38 00002825 */ move $a1, $zero -/* 09FA3C 8009EE3C 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FA40 8009EE40 24180020 */ li $t8, 32 -/* 09FA44 8009EE44 100001E2 */ b .L8009F5D0 -/* 09FA48 8009EE48 AFF8001C */ sw $t8, 0x1c($ra) -glabel L8009EE4C -/* 09FA4C 8009EE4C 8FB90080 */ lw $t9, 0x80($sp) -/* 09FA50 8009EE50 3C04800F */ lui $a0, %hi(D_800E81E4) # 0x800f -/* 09FA54 8009EE54 00197080 */ sll $t6, $t9, 2 -/* 09FA58 8009EE58 008E2021 */ addu $a0, $a0, $t6 -/* 09FA5C 8009EE5C 0C026449 */ jal segmented_to_virtual_dupe -/* 09FA60 8009EE60 8C8481E4 */ lw $a0, %lo(D_800E81E4)($a0) # -0x7e1c($a0) -/* 09FA64 8009EE64 0C026461 */ jal func_80099184 -/* 09FA68 8009EE68 00402025 */ move $a0, $v0 -/* 09FA6C 8009EE6C 100001D9 */ b .L8009F5D4 -/* 09FA70 8009EE70 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EE74 -/* 09FA74 8009EE74 8FA60080 */ lw $a2, 0x80($sp) -/* 09FA78 8009EE78 3C04800F */ lui $a0, %hi(D_800E8274) # 0x800f -/* 09FA7C 8009EE7C AFBF007C */ sw $ra, 0x7c($sp) -/* 09FA80 8009EE80 00067880 */ sll $t7, $a2, 2 -/* 09FA84 8009EE84 008F2021 */ addu $a0, $a0, $t7 -/* 09FA88 8009EE88 8C848274 */ lw $a0, %lo(D_800E8274)($a0) # -0x7d8c($a0) -/* 09FA8C 8009EE8C 01E03025 */ move $a2, $t7 -/* 09FA90 8009EE90 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 09FA94 8009EE94 AFAF0024 */ sw $t7, 0x24($sp) -/* 09FA98 8009EE98 0C0268DD */ jal func_8009A374 -/* 09FA9C 8009EE9C 00402025 */ move $a0, $v0 -/* 09FAA0 8009EEA0 8FA60024 */ lw $a2, 0x24($sp) -/* 09FAA4 8009EEA4 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FAA8 8009EEA8 3C04800E */ lui $a0, %hi(D_800E7D54 - 0xAC) -/* 09FAAC 8009EEAC 00862021 */ addu $a0, $a0, $a2 -/* 09FAB0 8009EEB0 AFE20018 */ sw $v0, 0x18($ra) -/* 09FAB4 8009EEB4 0C026449 */ jal segmented_to_virtual_dupe -/* 09FAB8 8009EEB8 8C847CA8 */ lw $a0, %lo(D_800E7D54 - 0xAC)($a0) -/* 09FABC 8009EEBC 00402025 */ move $a0, $v0 -/* 09FAC0 8009EEC0 0C0265AF */ jal func_800996BC -/* 09FAC4 8009EEC4 00002825 */ move $a1, $zero -/* 09FAC8 8009EEC8 100001C2 */ b .L8009F5D4 -/* 09FACC 8009EECC 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EED0 -/* 09FAD0 8009EED0 8FB80080 */ lw $t8, 0x80($sp) -/* 09FAD4 8009EED4 3C04800F */ lui $a0, %hi(D_800E80A0) # 0x800f -/* 09FAD8 8009EED8 AFBF007C */ sw $ra, 0x7c($sp) -/* 09FADC 8009EEDC 0018C880 */ sll $t9, $t8, 2 -/* 09FAE0 8009EEE0 00992021 */ addu $a0, $a0, $t9 -/* 09FAE4 8009EEE4 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 09FAE8 8009EEE8 8C8480A0 */ lw $a0, %lo(D_800E80A0)($a0) # -0x7f60($a0) -/* 09FAEC 8009EEEC 0C0268DD */ jal func_8009A374 -/* 09FAF0 8009EEF0 00402025 */ move $a0, $v0 -/* 09FAF4 8009EEF4 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FAF8 8009EEF8 100001B5 */ b .L8009F5D0 -/* 09FAFC 8009EEFC AFE20018 */ sw $v0, 0x18($ra) -glabel L8009EF00 -/* 09FB00 8009EF00 240E0020 */ li $t6, 32 -/* 09FB04 8009EF04 AFEE001C */ sw $t6, 0x1c($ra) -glabel L8009EF08 -/* 09FB08 8009EF08 8FAF0080 */ lw $t7, 0x80($sp) -/* 09FB0C 8009EF0C 3C04800F */ lui $a0, %hi(D_800E817C) # 0x800f -/* 09FB10 8009EF10 000FC080 */ sll $t8, $t7, 2 -/* 09FB14 8009EF14 00982021 */ addu $a0, $a0, $t8 -/* 09FB18 8009EF18 0C026449 */ jal segmented_to_virtual_dupe -/* 09FB1C 8009EF1C 8C84817C */ lw $a0, %lo(D_800E817C)($a0) # -0x7e84($a0) -/* 09FB20 8009EF20 00402025 */ move $a0, $v0 -/* 09FB24 8009EF24 0C0265AF */ jal func_800996BC -/* 09FB28 8009EF28 00002825 */ move $a1, $zero -/* 09FB2C 8009EF2C 100001A9 */ b .L8009F5D4 -/* 09FB30 8009EF30 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009EF34 -/* 09FB34 8009EF34 8FF90000 */ lw $t9, ($ra) -/* 09FB38 8009EF38 3C0F800F */ lui $t7, %hi(gCupCourseOrder-0xBE) # 0x800f -/* 09FB3C 8009EF3C 3C04800E */ lui $a0, %hi(D_800E7E34) -/* 09FB40 8009EF40 00197040 */ sll $t6, $t9, 1 -/* 09FB44 8009EF44 01EE7821 */ addu $t7, $t7, $t6 -/* 09FB48 8009EF48 85EF2AF6 */ lh $t7, %lo(gCupCourseOrder-0xBE)($t7) # 0x2af6($t7) -/* 09FB4C 8009EF4C AFBF007C */ sw $ra, 0x7c($sp) -/* 09FB50 8009EF50 000FC080 */ sll $t8, $t7, 2 -/* 09FB54 8009EF54 00982021 */ addu $a0, $a0, $t8 -/* 09FB58 8009EF58 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 09FB5C 8009EF5C 8C847E34 */ lw $a0, %lo(D_800E7E34)($a0) -/* 09FB60 8009EF60 0C0268DD */ jal func_8009A374 -/* 09FB64 8009EF64 00402025 */ move $a0, $v0 -/* 09FB68 8009EF68 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FB6C 8009EF6C 10000198 */ b .L8009F5D0 -/* 09FB70 8009EF70 AFE20018 */ sw $v0, 0x18($ra) -glabel L8009EF74 -/* 09FB74 8009EF74 AFBF007C */ sw $ra, 0x7c($sp) -/* 09FB78 8009EF78 0C0ADF8D */ jal random_int -/* 09FB7C 8009EF7C 24040004 */ li $a0, 4 -/* 09FB80 8009EF80 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FB84 8009EF84 24590002 */ addiu $t9, $v0, 2 -/* 09FB88 8009EF88 10000191 */ b .L8009F5D0 -/* 09FB8C 8009EF8C AFF90020 */ sw $t9, 0x20($ra) -glabel L8009EF90 -/* 09FB90 8009EF90 8FAE0080 */ lw $t6, 0x80($sp) -/* 09FB94 8009EF94 3C18800E */ lui $t8, %hi(D_800E7248) # $t8, 0x800e -/* 09FB98 8009EF98 27187248 */ addiu $t8, %lo(D_800E7248) # addiu $t8, $t8, 0x7248 -/* 09FB9C 8009EF9C 000E78C0 */ sll $t7, $t6, 3 -/* 09FBA0 8009EFA0 01F81021 */ addu $v0, $t7, $t8 -/* 09FBA4 8009EFA4 8459FCD8 */ lh $t9, -0x328($v0) -/* 09FBA8 8009EFA8 AFF9000C */ sw $t9, 0xc($ra) -/* 09FBAC 8009EFAC 844EFCDA */ lh $t6, -0x326($v0) -/* 09FBB0 8009EFB0 10000187 */ b .L8009F5D0 -/* 09FBB4 8009EFB4 AFEE0010 */ sw $t6, 0x10($ra) -glabel L8009EFB8 -/* 09FBB8 8009EFB8 3C028019 */ lui $v0, %hi(gCupSelection) # $v0, 0x8019 -/* 09FBBC 8009EFBC 2442EE09 */ addiu $v0, %lo(gCupSelection) # addiu $v0, $v0, -0x11f7 -/* 09FBC0 8009EFC0 804F0000 */ lb $t7, ($v0) -/* 09FBC4 8009EFC4 3C05800E */ lui $a1, %hi(gCCSelection) # $a1, 0x800e -/* 09FBC8 8009EFC8 AFEF001C */ sw $t7, 0x1c($ra) -/* 09FBCC 8009EFCC AFBF007C */ sw $ra, 0x7c($sp) -/* 09FBD0 8009EFD0 8CA5C548 */ lw $a1, %lo(gCCSelection)($a1) -/* 09FBD4 8009EFD4 0C02D530 */ jal func_800B54C0 -/* 09FBD8 8009EFD8 80440000 */ lb $a0, ($v0) -/* 09FBDC 8009EFDC 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FBE0 8009EFE0 3C18800E */ lui $t8, %hi(gCCSelection) # $t8, 0x800e -/* 09FBE4 8009EFE4 00401825 */ move $v1, $v0 -/* 09FBE8 8009EFE8 AFE20020 */ sw $v0, 0x20($ra) -/* 09FBEC 8009EFEC 8F18C548 */ lw $t8, %lo(gCCSelection)($t8) -/* 09FBF0 8009EFF0 3C04800E */ lui $a0, %hi(D_800E7E20) -/* 09FBF4 8009EFF4 07010003 */ bgez $t8, .L8009F004 -/* 09FBF8 8009EFF8 0018C843 */ sra $t9, $t8, 1 -/* 09FBFC 8009EFFC 27010001 */ addiu $at, $t8, 1 -/* 09FC00 8009F000 0001C843 */ sra $t9, $at, 1 -.L8009F004: -/* 09FC04 8009F004 03207025 */ move $t6, $t9 -/* 09FC08 8009F008 0003C080 */ sll $t8, $v1, 2 -/* 09FC0C 8009F00C 0018C823 */ negu $t9, $t8 -/* 09FC10 8009F010 000E7900 */ sll $t7, $t6, 4 -/* 09FC14 8009F014 01F97021 */ addu $t6, $t7, $t9 -/* 09FC18 8009F018 008E2021 */ addu $a0, $a0, $t6 -/* 09FC1C 8009F01C 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 09FC20 8009F020 8C847E20 */ lw $a0, %lo(D_800E7E20)($a0) -/* 09FC24 8009F024 0C0268DD */ jal func_8009A374 -/* 09FC28 8009F028 00402025 */ move $a0, $v0 -/* 09FC2C 8009F02C 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FC30 8009F030 3C03800E */ lui $v1, %hi(D_800E7268) # $v1, 0x800e -/* 09FC34 8009F034 24637268 */ addiu $v1, %lo(D_800E7268) # addiu $v1, $v1, 0x7268 -/* 09FC38 8009F038 AFE20018 */ sw $v0, 0x18($ra) -/* 09FC3C 8009F03C 84780000 */ lh $t8, ($v1) -/* 09FC40 8009F040 AFF8000C */ sw $t8, 0xc($ra) -/* 09FC44 8009F044 846F0002 */ lh $t7, 2($v1) -/* 09FC48 8009F048 10000161 */ b .L8009F5D0 -/* 09FC4C 8009F04C AFEF0010 */ sw $t7, 0x10($ra) -glabel L8009F050 -/* 09FC50 8009F050 3C19800E */ lui $t9, %hi(gCCSelection) # $t9, 0x800e -/* 09FC54 8009F054 8F39C548 */ lw $t9, %lo(gCCSelection)($t9) -/* 09FC58 8009F058 3C04800F */ lui $a0, %hi(D_800E8294) # 0x800f -/* 09FC5C 8009F05C AFBF007C */ sw $ra, 0x7c($sp) -/* 09FC60 8009F060 00197080 */ sll $t6, $t9, 2 -/* 09FC64 8009F064 008E2021 */ addu $a0, $a0, $t6 -/* 09FC68 8009F068 0C026449 */ jal segmented_to_virtual_dupe -/* 09FC6C 8009F06C 8C848294 */ lw $a0, %lo(D_800E8294)($a0) # -0x7d6c($a0) -/* 09FC70 8009F070 00402025 */ move $a0, $v0 -/* 09FC74 8009F074 0C0265AF */ jal func_800996BC -/* 09FC78 8009F078 00002825 */ move $a1, $zero -/* 09FC7C 8009F07C 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FC80 8009F080 24180037 */ li $t8, 55 -/* 09FC84 8009F084 240F00C3 */ li $t7, 195 -/* 09FC88 8009F088 AFF8000C */ sw $t8, 0xc($ra) -/* 09FC8C 8009F08C 10000150 */ b .L8009F5D0 -/* 09FC90 8009F090 AFEF0010 */ sw $t7, 0x10($ra) -glabel L8009F094 -/* 09FC94 8009F094 3C040200 */ lui $a0, %hi(D_02004A0C) # $a0, 0x200 -/* 09FC98 8009F098 0C026449 */ jal segmented_to_virtual_dupe -/* 09FC9C 8009F09C 24844A0C */ addiu $a0, %lo(D_02004A0C) # addiu $a0, $a0, 0x4a0c -/* 09FCA0 8009F0A0 00402025 */ move $a0, $v0 -/* 09FCA4 8009F0A4 0C0265AF */ jal func_800996BC -/* 09FCA8 8009F0A8 00002825 */ move $a1, $zero -/* 09FCAC 8009F0AC 0C02D6E5 */ jal controller_pak_1_status -/* 09FCB0 8009F0B0 00000000 */ nop -/* 09FCB4 8009F0B4 14400005 */ bnez $v0, .L8009F0CC -/* 09FCB8 8009F0B8 00000000 */ nop -/* 09FCBC 8009F0BC 0C02D9C2 */ jal func_800B6708 -/* 09FCC0 8009F0C0 00000000 */ nop -/* 09FCC4 8009F0C4 10000143 */ b .L8009F5D4 -/* 09FCC8 8009F0C8 8FBF001C */ lw $ra, 0x1c($sp) -.L8009F0CC: -/* 09FCCC 8009F0CC 3C028019 */ lui $v0, %hi(D_8018EE10) # $v0, 0x8019 -/* 09FCD0 8009F0D0 2442EE10 */ addiu $v0, %lo(D_8018EE10) # addiu $v0, $v0, -0x11f0 -/* 09FCD4 8009F0D4 A0400004 */ sb $zero, 4($v0) -/* 09FCD8 8009F0D8 1000013D */ b .L8009F5D0 -/* 09FCDC 8009F0DC A0400084 */ sb $zero, 0x84($v0) -glabel L8009F0E0 -/* 09FCE0 8009F0E0 8FB90080 */ lw $t9, 0x80($sp) -/* 09FCE4 8009F0E4 3C04800F */ lui $a0, %hi(D_800E8114) # 0x800f -/* 09FCE8 8009F0E8 00197080 */ sll $t6, $t9, 2 -/* 09FCEC 8009F0EC 008E2021 */ addu $a0, $a0, $t6 -/* 09FCF0 8009F0F0 0C026449 */ jal segmented_to_virtual_dupe -/* 09FCF4 8009F0F4 8C848114 */ lw $a0, %lo(D_800E8114)($a0) # -0x7eec($a0) -/* 09FCF8 8009F0F8 00402025 */ move $a0, $v0 -/* 09FCFC 8009F0FC 0C0265AF */ jal func_800996BC -/* 09FD00 8009F100 00002825 */ move $a1, $zero -/* 09FD04 8009F104 10000133 */ b .L8009F5D4 -/* 09FD08 8009F108 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009F10C -/* 09FD0C 8009F10C 3C040200 */ lui $a0, %hi(D_02004A34) # $a0, 0x200 -/* 09FD10 8009F110 0C026449 */ jal segmented_to_virtual_dupe -/* 09FD14 8009F114 24844A34 */ addiu $a0, %lo(D_02004A34) # addiu $a0, $a0, 0x4a34 -/* 09FD18 8009F118 00402025 */ move $a0, $v0 -/* 09FD1C 8009F11C 0C0265AF */ jal func_800996BC -/* 09FD20 8009F120 00002825 */ move $a1, $zero -/* 09FD24 8009F124 0C02D6E5 */ jal controller_pak_1_status -/* 09FD28 8009F128 00000000 */ nop -/* 09FD2C 8009F12C 14400005 */ bnez $v0, .L8009F144 -/* 09FD30 8009F130 00000000 */ nop -/* 09FD34 8009F134 0C02D9C2 */ jal func_800B6708 -/* 09FD38 8009F138 00000000 */ nop -/* 09FD3C 8009F13C 10000125 */ b .L8009F5D4 -/* 09FD40 8009F140 8FBF001C */ lw $ra, 0x1c($sp) -.L8009F144: -/* 09FD44 8009F144 3C028019 */ lui $v0, %hi(D_8018EE10) # $v0, 0x8019 -/* 09FD48 8009F148 2442EE10 */ addiu $v0, %lo(D_8018EE10) # addiu $v0, $v0, -0x11f0 -/* 09FD4C 8009F14C A0400004 */ sb $zero, 4($v0) -/* 09FD50 8009F150 1000011F */ b .L8009F5D0 -/* 09FD54 8009F154 A0400084 */ sb $zero, 0x84($v0) -glabel L8009F158 -/* 09FD58 8009F158 3C040200 */ lui $a0, %hi(D_02001FA4) # $a0, 0x200 -/* 09FD5C 8009F15C 0C026449 */ jal segmented_to_virtual_dupe -/* 09FD60 8009F160 24841FA4 */ addiu $a0, %lo(D_02001FA4) # addiu $a0, $a0, 0x1fa4 -/* 09FD64 8009F164 0C026461 */ jal func_80099184 -/* 09FD68 8009F168 00402025 */ move $a0, $v0 -/* 09FD6C 8009F16C 10000119 */ b .L8009F5D4 -/* 09FD70 8009F170 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009F174 -/* 09FD74 8009F174 8FE20000 */ lw $v0, ($ra) -/* 09FD78 8009F178 3C04800E */ lui $a0, %hi(D_800E7D74) -/* 09FD7C 8009F17C AFBF007C */ sw $ra, 0x7c($sp) -/* 09FD80 8009F180 2442FF84 */ addiu $v0, $v0, -0x7c -/* 09FD84 8009F184 04410003 */ bgez $v0, .L8009F194 -/* 09FD88 8009F188 0002C083 */ sra $t8, $v0, 2 -/* 09FD8C 8009F18C 24410003 */ addiu $at, $v0, 3 -/* 09FD90 8009F190 0001C083 */ sra $t8, $at, 2 -.L8009F194: -/* 09FD94 8009F194 001878C0 */ sll $t7, $t8, 3 -/* 09FD98 8009F198 04410004 */ bgez $v0, .L8009F1AC -/* 09FD9C 8009F19C 30590003 */ andi $t9, $v0, 3 -/* 09FDA0 8009F1A0 13200002 */ beqz $t9, .L8009F1AC -/* 09FDA4 8009F1A4 00000000 */ nop -/* 09FDA8 8009F1A8 2739FFFC */ addiu $t9, $t9, -4 -.L8009F1AC: -/* 09FDAC 8009F1AC 00197040 */ sll $t6, $t9, 1 -/* 09FDB0 8009F1B0 01EEC021 */ addu $t8, $t7, $t6 -/* 09FDB4 8009F1B4 3C19800F */ lui $t9, %hi(gCupCourseOrder) -/* 09FDB8 8009F1B8 0338C821 */ addu $t9, $t9, $t8 -/* 09FDBC 8009F1BC 87392BB4 */ lh $t9, %lo(gCupCourseOrder)($t9) -/* 09FDC0 8009F1C0 00197880 */ sll $t7, $t9, 2 -/* 09FDC4 8009F1C4 008F2021 */ addu $a0, $a0, $t7 -/* 09FDC8 8009F1C8 0C026449 */ jal segmented_to_virtual_dupe -/* 09FDCC 8009F1CC 8C847D74 */ lw $a0, %lo(D_800E7D74)($a0) -/* 09FDD0 8009F1D0 00402025 */ move $a0, $v0 -/* 09FDD4 8009F1D4 0C0265AF */ jal func_800996BC -/* 09FDD8 8009F1D8 2405FFFF */ li $a1, -1 -/* 09FDDC 8009F1DC 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FDE0 8009F1E0 3C04800E */ lui $a0, %hi(D_800E7DC4) -/* 09FDE4 8009F1E4 8FE20000 */ lw $v0, ($ra) -/* 09FDE8 8009F1E8 2442FF84 */ addiu $v0, $v0, -0x7c -/* 09FDEC 8009F1EC 04410003 */ bgez $v0, .L8009F1FC -/* 09FDF0 8009F1F0 00027083 */ sra $t6, $v0, 2 -/* 09FDF4 8009F1F4 24410003 */ addiu $at, $v0, 3 -/* 09FDF8 8009F1F8 00017083 */ sra $t6, $at, 2 -.L8009F1FC: -/* 09FDFC 8009F1FC 000EC0C0 */ sll $t8, $t6, 3 -/* 09FE00 8009F200 04410004 */ bgez $v0, .L8009F214 -/* 09FE04 8009F204 30590003 */ andi $t9, $v0, 3 -/* 09FE08 8009F208 13200002 */ beqz $t9, .L8009F214 -/* 09FE0C 8009F20C 00000000 */ nop -/* 09FE10 8009F210 2739FFFC */ addiu $t9, $t9, -4 -.L8009F214: -/* 09FE14 8009F214 00197840 */ sll $t7, $t9, 1 -/* 09FE18 8009F218 030F7021 */ addu $t6, $t8, $t7 -/* 09FE1C 8009F21C 3C19800F */ lui $t9, %hi(gCupCourseOrder) -/* 09FE20 8009F220 032EC821 */ addu $t9, $t9, $t6 -/* 09FE24 8009F224 87392BB4 */ lh $t9, %lo(gCupCourseOrder)($t9) -/* 09FE28 8009F228 0019C080 */ sll $t8, $t9, 2 -/* 09FE2C 8009F22C 00982021 */ addu $a0, $a0, $t8 -/* 09FE30 8009F230 0C026449 */ jal segmented_to_virtual_dupe -/* 09FE34 8009F234 8C847DC4 */ lw $a0, %lo(D_800E7DC4)($a0) -/* 09FE38 8009F238 00402025 */ move $a0, $v0 -/* 09FE3C 8009F23C 0C0265AF */ jal func_800996BC -/* 09FE40 8009F240 00002825 */ move $a1, $zero -/* 09FE44 8009F244 3C040200 */ lui $a0, %hi(D_02004A0C) # $a0, 0x200 -/* 09FE48 8009F248 0C026449 */ jal segmented_to_virtual_dupe -/* 09FE4C 8009F24C 24844A0C */ addiu $a0, %lo(D_02004A0C) # addiu $a0, $a0, 0x4a0c -/* 09FE50 8009F250 00402025 */ move $a0, $v0 -/* 09FE54 8009F254 0C0265AF */ jal func_800996BC -/* 09FE58 8009F258 00002825 */ move $a1, $zero -/* 09FE5C 8009F25C 100000DD */ b .L8009F5D4 -/* 09FE60 8009F260 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009F264 -/* 09FE64 8009F264 8FAF0080 */ lw $t7, 0x80($sp) -/* 09FE68 8009F268 3C0E800F */ lui $t6, %hi(gCharacterSelections - 0xb1) # 0x800f -/* 09FE6C 8009F26C 3C02800E */ lui $v0, %hi(gModeSelection) # $v0, 0x800e -/* 09FE70 8009F270 01CF7021 */ addu $t6, $t6, $t7 -/* 09FE74 8009F274 81CE85F7 */ lb $t6, %lo(gCharacterSelections - 0xb1)($t6) # -0x7a09($t6) -/* 09FE78 8009F278 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 09FE7C 8009F27C 3C05800F */ lui $a1, %hi(D_800EFD64) # 0x800f -/* 09FE80 8009F280 24010002 */ li $at, 2 -/* 09FE84 8009F284 00AE2821 */ addu $a1, $a1, $t6 -/* 09FE88 8009F288 80A5FD64 */ lb $a1, %lo(D_800EFD64)($a1) # -0x29c($a1) -/* 09FE8C 8009F28C 00001825 */ move $v1, $zero -/* 09FE90 8009F290 10410006 */ beq $v0, $at, .L8009F2AC -/* 09FE94 8009F294 25E7FF4F */ addiu $a3, $t7, -0xb1 -/* 09FE98 8009F298 24010003 */ li $at, 3 -/* 09FE9C 8009F29C 1041000D */ beq $v0, $at, .L8009F2D4 -/* 09FEA0 8009F2A0 8FA60080 */ lw $a2, 0x80($sp) -/* 09FEA4 8009F2A4 10000013 */ b .L8009F2F4 -/* 09FEA8 8009F2A8 000F3080 */ sll $a2, $t7, 2 -.L8009F2AC: -/* 09FEAC 8009F2AC 8FA60080 */ lw $a2, 0x80($sp) -/* 09FEB0 8009F2B0 3C188016 */ lui $t8, %hi(gGPCurrentRaceRankByPlayerId - 0x2C4) # 0x8016 -/* 09FEB4 8009F2B4 0006C880 */ sll $t9, $a2, 2 -/* 09FEB8 8009F2B8 0319C021 */ addu $t8, $t8, $t9 -/* 09FEBC 8009F2BC 8F1840F4 */ lw $t8, %lo(gGPCurrentRaceRankByPlayerId - 0x2C4)($t8) # 0x40f4($t8) -/* 09FEC0 8009F2C0 03203025 */ move $a2, $t9 -/* 09FEC4 8009F2C4 1300000B */ beqz $t8, .L8009F2F4 -/* 09FEC8 8009F2C8 00000000 */ nop -/* 09FECC 8009F2CC 10000009 */ b .L8009F2F4 -/* 09FED0 8009F2D0 24030001 */ li $v1, 1 -.L8009F2D4: -/* 09FED4 8009F2D4 3C0F800E */ lui $t7, %hi(gPlayerWinningIndex) # $t7, 0x800e -/* 09FED8 8009F2D8 8DEFC5E8 */ lw $t7, %lo(gPlayerWinningIndex)($t7) -/* 09FEDC 8009F2DC 8FAE0080 */ lw $t6, 0x80($sp) -/* 09FEE0 8009F2E0 0006C080 */ sll $t8, $a2, 2 -/* 09FEE4 8009F2E4 25F900B1 */ addiu $t9, $t7, 0xb1 -/* 09FEE8 8009F2E8 11D90002 */ beq $t6, $t9, .L8009F2F4 -/* 09FEEC 8009F2EC 03003025 */ move $a2, $t8 -/* 09FEF0 8009F2F0 24030001 */ li $v1, 1 -.L8009F2F4: -/* 09FEF4 8009F2F4 10600006 */ beqz $v1, .L8009F310 -/* 09FEF8 8009F2F8 3C04800F */ lui $a0, %hi(D_800E8320) # 0x800f -/* 09FEFC 8009F2FC 00051880 */ sll $v1, $a1, 2 -/* 09FF00 8009F300 3C04800F */ lui $a0, %hi(gCharacterDefeatAnimation) # 0x800f -/* 09FF04 8009F304 00832021 */ addu $a0, $a0, $v1 -/* 09FF08 8009F308 10000004 */ b .L8009F31C -/* 09FF0C 8009F30C 8C848420 */ lw $a0, %lo(gCharacterDefeatAnimation)($a0) # -0x7be0($a0) -.L8009F310: -/* 09FF10 8009F310 00051880 */ sll $v1, $a1, 2 -/* 09FF14 8009F314 00832021 */ addu $a0, $a0, $v1 -/* 09FF18 8009F318 8C848320 */ lw $a0, %lo(D_800E8320)($a0) # -0x7ce0($a0) -.L8009F31C: -/* 09FF1C 8009F31C AFBF007C */ sw $ra, 0x7c($sp) -/* 09FF20 8009F320 AFA30020 */ sw $v1, 0x20($sp) -/* 09FF24 8009F324 AFA60024 */ sw $a2, 0x24($sp) -/* 09FF28 8009F328 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 09FF2C 8009F32C AFA7003C */ sw $a3, 0x3c($sp) -/* 09FF30 8009F330 8FA5003C */ lw $a1, 0x3c($sp) -/* 09FF34 8009F334 0C02691E */ jal func_8009A478 -/* 09FF38 8009F338 00402025 */ move $a0, $v0 -/* 09FF3C 8009F33C 8FA30020 */ lw $v1, 0x20($sp) -/* 09FF40 8009F340 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FF44 8009F344 3C04800E */ lui $a0, %hi(D_800E7D54) -/* 09FF48 8009F348 00832021 */ addu $a0, $a0, $v1 -/* 09FF4C 8009F34C AFE20018 */ sw $v0, 0x18($ra) -/* 09FF50 8009F350 0C026449 */ jal segmented_to_virtual_dupe -/* 09FF54 8009F354 8C847D54 */ lw $a0, %lo(D_800E7D54)($a0) -/* 09FF58 8009F358 00402025 */ move $a0, $v0 -/* 09FF5C 8009F35C 0C0265AF */ jal func_800996BC -/* 09FF60 8009F360 00002825 */ move $a1, $zero -/* 09FF64 8009F364 8FA60024 */ lw $a2, 0x24($sp) -/* 09FF68 8009F368 3C04800E */ lui $a0, %hi(D_800E7FF0) -/* 09FF6C 8009F36C 00862021 */ addu $a0, $a0, $a2 -/* 09FF70 8009F370 0C026449 */ jal segmented_to_virtual_dupe -/* 09FF74 8009F374 8C847FF0 */ lw $a0, %lo(D_800E7FF0)($a0) -/* 09FF78 8009F378 0C026461 */ jal func_80099184 -/* 09FF7C 8009F37C 00402025 */ move $a0, $v0 -/* 09FF80 8009F380 10000094 */ b .L8009F5D4 -/* 09FF84 8009F384 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009F388 -/* 09FF88 8009F388 3C048019 */ lui $a0, %hi(playerHUD+0x8) # $a0, 0x8019 -/* 09FF8C 8009F38C 3C05800F */ lui $a1, %hi(gCharacterSelections) # $a1, 0x800f -/* 09FF90 8009F390 AFBF007C */ sw $ra, 0x7c($sp) -/* 09FF94 8009F394 80A586A8 */ lb $a1, %lo(gCharacterSelections)($a1) -/* 09FF98 8009F398 0C02D408 */ jal func_800B5020 -/* 09FF9C 8009F39C 8C84CA78 */ lw $a0, %lo(playerHUD+0x8)($a0) -/* 09FFA0 8009F3A0 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FFA4 8009F3A4 AFE2001C */ sw $v0, 0x1c($ra) -/* 09FFA8 8009F3A8 0C02D486 */ jal func_800B5218 -/* 09FFAC 8009F3AC 00000000 */ nop -/* 09FFB0 8009F3B0 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FFB4 8009F3B4 3C0F8016 */ lui $t7, %hi(D_80162DD4) # $t7, 0x8016 -/* 09FFB8 8009F3B8 24030001 */ li $v1, 1 -/* 09FFBC 8009F3BC AFE20020 */ sw $v0, 0x20($ra) -/* 09FFC0 8009F3C0 95EF2DD4 */ lhu $t7, %lo(D_80162DD4)($t7) -/* 09FFC4 8009F3C4 506F000B */ beql $v1, $t7, .L8009F3F4 -/* 09FFC8 8009F3C8 8FF9001C */ lw $t9, 0x1c($ra) -/* 09FFCC 8009F3CC AFBF007C */ sw $ra, 0x7c($sp) -/* 09FFD0 8009F3D0 0C001471 */ jal func_800051C4 -/* 09FFD4 8009F3D4 00000000 */ nop -/* 09FFD8 8009F3D8 28413C01 */ slti $at, $v0, 0x3c01 -/* 09FFDC 8009F3DC 14200004 */ bnez $at, .L8009F3F0 -/* 09FFE0 8009F3E0 8FBF007C */ lw $ra, 0x7c($sp) -/* 09FFE4 8009F3E4 240E0001 */ li $t6, 1 -/* 09FFE8 8009F3E8 3C018016 */ lui $at, %hi(D_80162DD4) # $at, 0x8016 -/* 09FFEC 8009F3EC A42E2DD4 */ sh $t6, %lo(D_80162DD4)($at) -.L8009F3F0: -/* 09FFF0 8009F3F0 8FF9001C */ lw $t9, 0x1c($ra) -.L8009F3F4: -/* 09FFF4 8009F3F4 3C028019 */ lui $v0, %hi(gCupSelection) # $v0, 0x8019 -/* 09FFF8 8009F3F8 2442EE09 */ addiu $v0, %lo(gCupSelection) # addiu $v0, $v0, -0x11f7 -/* 09FFFC 8009F3FC 53200005 */ beql $t9, $zero, .L8009F414 -/* 0A0000 8009F400 804F0000 */ lb $t7, ($v0) -/* 0A0004 8009F404 8FF80020 */ lw $t8, 0x20($ra) -/* 0A0008 8009F408 53000072 */ beql $t8, $zero, .L8009F5D4 -/* 0A000C 8009F40C 8FBF001C */ lw $ra, 0x1c($sp) -/* 0A0010 8009F410 804F0000 */ lb $t7, ($v0) -.L8009F414: -/* 0A0014 8009F414 3C198019 */ lui $t9, %hi(gCourseIndexInCup) # $t9, 0x8019 -/* 0A0018 8009F418 8339EE0B */ lb $t9, %lo(gCourseIndexInCup)($t9) -/* 0A001C 8009F41C 000F7080 */ sll $t6, $t7, 2 -/* 0A0020 8009F420 0C02D567 */ jal func_800B559C -/* 0A0024 8009F424 01D92021 */ addu $a0, $t6, $t9 -/* 0A0028 8009F428 1000006A */ b .L8009F5D4 -/* 0A002C 8009F42C 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009F430 -/* 0A0030 8009F430 3C028019 */ lui $v0, %hi(gTimeTrialDataCourseIndex) # $v0, 0x8019 -/* 0A0034 8009F434 8042EDF7 */ lb $v0, %lo(gTimeTrialDataCourseIndex)($v0) -/* 0A0038 8009F438 3C04800E */ lui $a0, %hi(D_800E7E34) -/* 0A003C 8009F43C AFBF007C */ sw $ra, 0x7c($sp) -/* 0A0040 8009F440 04410003 */ bgez $v0, .L8009F450 -/* 0A0044 8009F444 0002C083 */ sra $t8, $v0, 2 -/* 0A0048 8009F448 24410003 */ addiu $at, $v0, 3 -/* 0A004C 8009F44C 0001C083 */ sra $t8, $at, 2 -.L8009F450: -/* 0A0050 8009F450 001878C0 */ sll $t7, $t8, 3 -/* 0A0054 8009F454 04410004 */ bgez $v0, .L8009F468 -/* 0A0058 8009F458 304E0003 */ andi $t6, $v0, 3 -/* 0A005C 8009F45C 11C00002 */ beqz $t6, .L8009F468 -/* 0A0060 8009F460 00000000 */ nop -/* 0A0064 8009F464 25CEFFFC */ addiu $t6, $t6, -4 -.L8009F468: -/* 0A0068 8009F468 000EC840 */ sll $t9, $t6, 1 -/* 0A006C 8009F46C 01F9C021 */ addu $t8, $t7, $t9 -/* 0A0070 8009F470 3C0E800F */ lui $t6, %hi(gCupCourseOrder) -/* 0A0074 8009F474 01D87021 */ addu $t6, $t6, $t8 -/* 0A0078 8009F478 85CE2BB4 */ lh $t6, %lo(gCupCourseOrder)($t6) -/* 0A007C 8009F47C 000E7880 */ sll $t7, $t6, 2 -/* 0A0080 8009F480 008F2021 */ addu $a0, $a0, $t7 -/* 0A0084 8009F484 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 0A0088 8009F488 8C847E34 */ lw $a0, %lo(D_800E7E34)($a0) -/* 0A008C 8009F48C 0C0268DD */ jal func_8009A374 -/* 0A0090 8009F490 00402025 */ move $a0, $v0 -/* 0A0094 8009F494 8FBF007C */ lw $ra, 0x7c($sp) -/* 0A0098 8009F498 3C198019 */ lui $t9, %hi(gTimeTrialDataCourseIndex) # $t9, 0x8019 -/* 0A009C 8009F49C 3C040200 */ lui $a0, %hi(D_02004A0C) # $a0, 0x200 -/* 0A00A0 8009F4A0 AFE20018 */ sw $v0, 0x18($ra) -/* 0A00A4 8009F4A4 8339EDF7 */ lb $t9, %lo(gTimeTrialDataCourseIndex)($t9) -/* 0A00A8 8009F4A8 24844A0C */ addiu $a0, %lo(D_02004A0C) # addiu $a0, $a0, 0x4a0c -/* 0A00AC 8009F4AC AFF9001C */ sw $t9, 0x1c($ra) -/* 0A00B0 8009F4B0 0C026449 */ jal segmented_to_virtual_dupe -/* 0A00B4 8009F4B4 00000000 */ nop -/* 0A00B8 8009F4B8 00402025 */ move $a0, $v0 -/* 0A00BC 8009F4BC 0C0265AF */ jal func_800996BC -/* 0A00C0 8009F4C0 00002825 */ move $a1, $zero -/* 0A00C4 8009F4C4 0C01BBD8 */ jal func_8006EF60 -/* 0A00C8 8009F4C8 00000000 */ nop -/* 0A00CC 8009F4CC 0C02D6E5 */ jal controller_pak_1_status -/* 0A00D0 8009F4D0 00000000 */ nop -/* 0A00D4 8009F4D4 14400005 */ bnez $v0, .L8009F4EC -/* 0A00D8 8009F4D8 00000000 */ nop -/* 0A00DC 8009F4DC 0C02D9C2 */ jal func_800B6708 -/* 0A00E0 8009F4E0 00000000 */ nop -/* 0A00E4 8009F4E4 1000003B */ b .L8009F5D4 -/* 0A00E8 8009F4E8 8FBF001C */ lw $ra, 0x1c($sp) -.L8009F4EC: -/* 0A00EC 8009F4EC 3C028019 */ lui $v0, %hi(D_8018EE10) # $v0, 0x8019 -/* 0A00F0 8009F4F0 2442EE10 */ addiu $v0, %lo(D_8018EE10) # addiu $v0, $v0, -0x11f0 -/* 0A00F4 8009F4F4 A0400004 */ sb $zero, 4($v0) -/* 0A00F8 8009F4F8 10000035 */ b .L8009F5D0 -/* 0A00FC 8009F4FC A0400084 */ sb $zero, 0x84($v0) -glabel L8009F500 -/* 0A0100 8009F500 3C188019 */ lui $t8, %hi(gSoundMode) # $t8, 0x8019 -/* 0A0104 8009F504 9318EDF2 */ lbu $t8, %lo(gSoundMode)($t8) -/* 0A0108 8009F508 10000031 */ b .L8009F5D0 -/* 0A010C 8009F50C AFF80004 */ sw $t8, 4($ra) -glabel L8009F510 -/* 0A0110 8009F510 3C040200 */ lui $a0, %hi(D_02004638) # $a0, 0x200 -/* 0A0114 8009F514 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0118 8009F518 24844638 */ addiu $a0, %lo(D_02004638) # addiu $a0, $a0, 0x4638 -/* 0A011C 8009F51C 00402025 */ move $a0, $v0 -/* 0A0120 8009F520 0C0265AF */ jal func_800996BC -/* 0A0124 8009F524 00002825 */ move $a1, $zero -/* 0A0128 8009F528 1000002A */ b .L8009F5D4 -/* 0A012C 8009F52C 8FBF001C */ lw $ra, 0x1c($sp) -glabel L8009F530 -/* 0A0130 8009F530 3C018019 */ lui $at, %hi(D_8018ED90) # $at, 0x8019 -/* 0A0134 8009F534 10000026 */ b .L8009F5D0 -/* 0A0138 8009F538 A020ED90 */ sb $zero, %lo(D_8018ED90)($at) -.L8009F53C: -/* 0A013C 8009F53C 244274D8 */ addiu $v0, $v0, %lo(D_802874D8) # 0x74d8 -/* 0A0140 8009F540 804E001E */ lb $t6, 0x1e($v0) -/* 0A0144 8009F544 804F001D */ lb $t7, 0x1d($v0) -/* 0A0148 8009F548 3C05800F */ lui $a1, %hi(D_800EFD64) # 0x800f -/* 0A014C 8009F54C 00AE2821 */ addu $a1, $a1, $t6 -/* 0A0150 8009F550 29E10003 */ slti $at, $t7, 3 -/* 0A0154 8009F554 14200003 */ bnez $at, .L8009F564 -/* 0A0158 8009F558 80A5FD64 */ lb $a1, %lo(D_800EFD64)($a1) # -0x29c($a1) -/* 0A015C 8009F55C 10000002 */ b .L8009F568 -/* 0A0160 8009F560 24020001 */ li $v0, 1 -.L8009F564: -/* 0A0164 8009F564 00001025 */ move $v0, $zero -.L8009F568: -/* 0A0168 8009F568 10400006 */ beqz $v0, .L8009F584 -/* 0A016C 8009F56C 00051880 */ sll $v1, $a1, 2 -/* 0A0170 8009F570 00051880 */ sll $v1, $a1, 2 -/* 0A0174 8009F574 3C04800F */ lui $a0, %hi(gCharacterDefeatAnimation) # 0x800f -/* 0A0178 8009F578 00832021 */ addu $a0, $a0, $v1 -/* 0A017C 8009F57C 10000004 */ b .L8009F590 -/* 0A0180 8009F580 8C848420 */ lw $a0, %lo(gCharacterDefeatAnimation)($a0) # -0x7be0($a0) -.L8009F584: -/* 0A0184 8009F584 3C04800F */ lui $a0, %hi(D_800E8320) # 0x800f -/* 0A0188 8009F588 00832021 */ addu $a0, $a0, $v1 -/* 0A018C 8009F58C 8C848320 */ lw $a0, %lo(D_800E8320)($a0) # -0x7ce0($a0) -.L8009F590: -/* 0A0190 8009F590 AFBF007C */ sw $ra, 0x7c($sp) -/* 0A0194 8009F594 0C026455 */ jal segmented_to_virtual_dupe_2 -/* 0A0198 8009F598 AFA30020 */ sw $v1, 0x20($sp) -/* 0A019C 8009F59C 00402025 */ move $a0, $v0 -/* 0A01A0 8009F5A0 0C02691E */ jal func_8009A478 -/* 0A01A4 8009F5A4 00002825 */ move $a1, $zero -/* 0A01A8 8009F5A8 8FA30020 */ lw $v1, 0x20($sp) -/* 0A01AC 8009F5AC 8FBF007C */ lw $ra, 0x7c($sp) -/* 0A01B0 8009F5B0 3C04800E */ lui $a0, %hi(D_800E7D54) -/* 0A01B4 8009F5B4 00832021 */ addu $a0, $a0, $v1 -/* 0A01B8 8009F5B8 AFE20018 */ sw $v0, 0x18($ra) -/* 0A01BC 8009F5BC 0C026449 */ jal segmented_to_virtual_dupe -/* 0A01C0 8009F5C0 8C847D54 */ lw $a0, %lo(D_800E7D54)($a0) -/* 0A01C4 8009F5C4 00402025 */ move $a0, $v0 -/* 0A01C8 8009F5C8 0C0265AF */ jal func_800996BC -/* 0A01CC 8009F5CC 00002825 */ move $a1, $zero -.L8009F5D0: -glabel L8009F5D0 -/* 0A01D0 8009F5D0 8FBF001C */ lw $ra, 0x1c($sp) -.L8009F5D4: -/* 0A01D4 8009F5D4 27BD0080 */ addiu $sp, $sp, 0x80 -/* 0A01D8 8009F5D8 03E00008 */ jr $ra -/* 0A01DC 8009F5DC 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_8009195C.s b/asm/non_matchings/code_80091750/func_8009195C.s deleted file mode 100644 index 2817f400d8..0000000000 --- a/asm/non_matchings/code_80091750/func_8009195C.s +++ /dev/null @@ -1,78 +0,0 @@ -.section .late_rodata - -glabel D_800F0CD0 -.double 0.6931471805599453 - -.section .text - -glabel func_8009195C -/* 09255C 8009195C 44802800 */ mtc1 $zero, $f5 -/* 092560 80091960 44802000 */ mtc1 $zero, $f4 -/* 092564 80091964 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 092568 80091968 AFBF0014 */ sw $ra, 0x14($sp) -/* 09256C 8009196C 462C203E */ c.le.d $f4, $f12 -/* 092570 80091970 46206386 */ mov.d $f14, $f12 -/* 092574 80091974 3C01BFE0 */ li $at, 0xBFE00000 # -1.750000 -/* 092578 80091978 45020007 */ bc1fl .L80091998 -/* 09257C 8009197C 44818800 */ mtc1 $at, $f17 -/* 092580 80091980 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 092584 80091984 44818800 */ mtc1 $at, $f17 -/* 092588 80091988 44808000 */ mtc1 $zero, $f16 -/* 09258C 8009198C 10000004 */ b .L800919A0 -/* 092590 80091990 00000000 */ nop -/* 092594 80091994 44818800 */ mtc1 $at, $f17 -.L80091998: -/* 092598 80091998 44808000 */ mtc1 $zero, $f16 -/* 09259C 8009199C 00000000 */ nop -.L800919A0: -/* 0925A0 800919A0 3C01800F */ lui $at, %hi(D_800F0CD0) -/* 0925A4 800919A4 D4320CD0 */ ldc1 $f18, %lo(D_800F0CD0)($at) -/* 0925A8 800919A8 3C014036 */ li $at, 0x40360000 # 2.843750 -/* 0925AC 800919AC 240F0012 */ li $t7, 18 -/* 0925B0 800919B0 46327183 */ div.d $f6, $f14, $f18 -/* 0925B4 800919B4 2418000E */ li $t8, 14 -/* 0925B8 800919B8 2419000A */ li $t9, 10 -/* 0925BC 800919BC 24080006 */ li $t0, 6 -/* 0925C0 800919C0 46268200 */ add.d $f8, $f16, $f6 -/* 0925C4 800919C4 4620428D */ trunc.w.d $f10, $f8 -/* 0925C8 800919C8 44815800 */ mtc1 $at, $f11 -/* 0925CC 800919CC 3C014000 */ li $at, 0x40000000 # 2.000000 -/* 0925D0 800919D0 44065000 */ mfc1 $a2, $f10 -/* 0925D4 800919D4 44805000 */ mtc1 $zero, $f10 -/* 0925D8 800919D8 44862000 */ mtc1 $a2, $f4 -/* 0925DC 800919DC 00000000 */ nop -/* 0925E0 800919E0 468021A1 */ cvt.d.w $f6, $f4 -/* 0925E4 800919E4 448F2000 */ mtc1 $t7, $f4 -/* 0925E8 800919E8 46323202 */ mul.d $f8, $f6, $f18 -/* 0925EC 800919EC 468021A1 */ cvt.d.w $f6, $f4 -/* 0925F0 800919F0 46287381 */ sub.d $f14, $f14, $f8 -/* 0925F4 800919F4 462E7082 */ mul.d $f2, $f14, $f14 -/* 0925F8 800919F8 462A1303 */ div.d $f12, $f2, $f10 -/* 0925FC 800919FC 44985000 */ mtc1 $t8, $f10 -/* 092600 80091A00 00000000 */ nop -/* 092604 80091A04 46805121 */ cvt.d.w $f4, $f10 -/* 092608 80091A08 462C3200 */ add.d $f8, $f6, $f12 -/* 09260C 80091A0C 46281003 */ div.d $f0, $f2, $f8 -/* 092610 80091A10 44994000 */ mtc1 $t9, $f8 -/* 092614 80091A14 00000000 */ nop -/* 092618 80091A18 468042A1 */ cvt.d.w $f10, $f8 -/* 09261C 80091A1C 46202180 */ add.d $f6, $f4, $f0 -/* 092620 80091A20 46261003 */ div.d $f0, $f2, $f6 -/* 092624 80091A24 44883000 */ mtc1 $t0, $f6 -/* 092628 80091A28 00000000 */ nop -/* 09262C 80091A2C 46803221 */ cvt.d.w $f8, $f6 -/* 092630 80091A30 46205100 */ add.d $f4, $f10, $f0 -/* 092634 80091A34 46241003 */ div.d $f0, $f2, $f4 -/* 092638 80091A38 44802000 */ mtc1 $zero, $f4 -/* 09263C 80091A3C 44812800 */ mtc1 $at, $f5 -/* 092640 80091A40 46204280 */ add.d $f10, $f8, $f0 -/* 092644 80091A44 462A1003 */ div.d $f0, $f2, $f10 -/* 092648 80091A48 46202080 */ add.d $f2, $f4, $f0 -/* 09264C 80091A4C 462E1180 */ add.d $f6, $f2, $f14 -/* 092650 80091A50 462E1201 */ sub.d $f8, $f2, $f14 -/* 092654 80091A54 0C02469B */ jal func_80091A6C -/* 092658 80091A58 46283303 */ div.d $f12, $f6, $f8 -/* 09265C 80091A5C 8FBF0014 */ lw $ra, 0x14($sp) -/* 092660 80091A60 27BD0018 */ addiu $sp, $sp, 0x18 -/* 092664 80091A64 03E00008 */ jr $ra -/* 092668 80091A68 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_80096CD8.s b/asm/non_matchings/code_80091750/func_80096CD8.s deleted file mode 100644 index a9e29a38ab..0000000000 --- a/asm/non_matchings/code_80091750/func_80096CD8.s +++ /dev/null @@ -1,391 +0,0 @@ -glabel func_80096CD8 -/* 0978D8 80096CD8 27BDFF18 */ addiu $sp, $sp, -0xe8 -/* 0978DC 80096CDC AFBF0054 */ sw $ra, 0x54($sp) -/* 0978E0 80096CE0 AFB40040 */ sw $s4, 0x40($sp) -/* 0978E4 80096CE4 AFB20038 */ sw $s2, 0x38($sp) -/* 0978E8 80096CE8 AFB00030 */ sw $s0, 0x30($sp) -/* 0978EC 80096CEC 2CE10002 */ sltiu $at, $a3, 2 -/* 0978F0 80096CF0 00808025 */ move $s0, $a0 -/* 0978F4 80096CF4 00C09025 */ move $s2, $a2 -/* 0978F8 80096CF8 00A0A025 */ move $s4, $a1 -/* 0978FC 80096CFC AFBE0050 */ sw $fp, 0x50($sp) -/* 097900 80096D00 AFB7004C */ sw $s7, 0x4c($sp) -/* 097904 80096D04 AFB60048 */ sw $s6, 0x48($sp) -/* 097908 80096D08 AFB50044 */ sw $s5, 0x44($sp) -/* 09790C 80096D0C AFB3003C */ sw $s3, 0x3c($sp) -/* 097910 80096D10 AFB10034 */ sw $s1, 0x34($sp) -/* 097914 80096D14 AFA700F4 */ sw $a3, 0xf4($sp) -/* 097918 80096D18 241F0001 */ li $ra, 1 -/* 09791C 80096D1C AFA000C8 */ sw $zero, 0xc8($sp) -/* 097920 80096D20 AFA000C4 */ sw $zero, 0xc4($sp) -/* 097924 80096D24 14200007 */ bnez $at, .L80096D44 -/* 097928 80096D28 00E07025 */ move $t6, $a3 -/* 09792C 80096D2C 8FB800F4 */ lw $t8, 0xf4($sp) -.L80096D30: -/* 097930 80096D30 001F7840 */ sll $t7, $ra, 1 -/* 097934 80096D34 01E0F825 */ move $ra, $t7 -/* 097938 80096D38 01F8082B */ sltu $at, $t7, $t8 -/* 09793C 80096D3C 5420FFFC */ bnel $at, $zero, .L80096D30 -/* 097940 80096D40 8FB800F4 */ lw $t8, 0xf4($sp) -.L80096D44: -/* 097944 80096D44 24190400 */ li $t9, 1024 -/* 097948 80096D48 033F001A */ div $zero, $t9, $ra -/* 09794C 80096D4C 00001012 */ mflo $v0 -/* 097950 80096D50 8FA500F8 */ lw $a1, 0xf8($sp) -/* 097954 80096D54 17E00002 */ bnez $ra, .L80096D60 -/* 097958 80096D58 00000000 */ nop -/* 09795C 80096D5C 0007000D */ break 7 -.L80096D60: -/* 097960 80096D60 2401FFFF */ li $at, -1 -/* 097964 80096D64 17E10004 */ bne $ra, $at, .L80096D78 -/* 097968 80096D68 3C018000 */ lui $at, 0x8000 -/* 09796C 80096D6C 17210002 */ bne $t9, $at, .L80096D78 -/* 097970 80096D70 00000000 */ nop -/* 097974 80096D74 0006000D */ break 6 -.L80096D78: -/* 097978 80096D78 AFA200CC */ sw $v0, 0xcc($sp) -/* 09797C 80096D7C 04410003 */ bgez $v0, .L80096D8C -/* 097980 80096D80 00027043 */ sra $t6, $v0, 1 -/* 097984 80096D84 24410001 */ addiu $at, $v0, 1 -/* 097988 80096D88 00017043 */ sra $t6, $at, 1 -.L80096D8C: -/* 09798C 80096D8C 00AE082B */ sltu $at, $a1, $t6 -/* 097990 80096D90 1020000F */ beqz $at, .L80096DD0 -/* 097994 80096D94 8FA200CC */ lw $v0, 0xcc($sp) -/* 097998 80096D98 04410003 */ bgez $v0, .L80096DA8 -/* 09799C 80096D9C 00027843 */ sra $t7, $v0, 1 -/* 0979A0 80096DA0 24410001 */ addiu $at, $v0, 1 -/* 0979A4 80096DA4 00017843 */ sra $t7, $at, 1 -.L80096DA8: -/* 0979A8 80096DA8 01E01025 */ move $v0, $t7 -/* 0979AC 80096DAC 00401825 */ move $v1, $v0 -.L80096DB0: -/* 0979B0 80096DB0 04610003 */ bgez $v1, .L80096DC0 -/* 0979B4 80096DB4 00031043 */ sra $v0, $v1, 1 -/* 0979B8 80096DB8 24610001 */ addiu $at, $v1, 1 -/* 0979BC 80096DBC 00011043 */ sra $v0, $at, 1 -.L80096DC0: -/* 0979C0 80096DC0 00A2082B */ sltu $at, $a1, $v0 -/* 0979C4 80096DC4 5420FFFA */ bnel $at, $zero, .L80096DB0 -/* 0979C8 80096DC8 00401825 */ move $v1, $v0 -/* 0979CC 80096DCC AFA300CC */ sw $v1, 0xcc($sp) -.L80096DD0: -/* 0979D0 80096DD0 2BE10002 */ slti $at, $ra, 2 -/* 0979D4 80096DD4 1420000B */ bnez $at, .L80096E04 -/* 0979D8 80096DD8 03E08825 */ move $s1, $ra -.L80096DDC: -/* 0979DC 80096DDC 8FB900C8 */ lw $t9, 0xc8($sp) -/* 0979E0 80096DE0 06210003 */ bgez $s1, .L80096DF0 -/* 0979E4 80096DE4 0011C043 */ sra $t8, $s1, 1 -/* 0979E8 80096DE8 26210001 */ addiu $at, $s1, 1 -/* 0979EC 80096DEC 0001C043 */ sra $t8, $at, 1 -.L80096DF0: -/* 0979F0 80096DF0 2B010002 */ slti $at, $t8, 2 -/* 0979F4 80096DF4 272E0001 */ addiu $t6, $t9, 1 -/* 0979F8 80096DF8 03008825 */ move $s1, $t8 -/* 0979FC 80096DFC 1020FFF7 */ beqz $at, .L80096DDC -/* 097A00 80096E00 AFAE00C8 */ sw $t6, 0xc8($sp) -.L80096E04: -/* 097A04 80096E04 8FB100CC */ lw $s1, 0xcc($sp) -/* 097A08 80096E08 2A210002 */ slti $at, $s1, 2 -/* 097A0C 80096E0C 1420000B */ bnez $at, .L80096E3C -/* 097A10 80096E10 00000000 */ nop -.L80096E14: -/* 097A14 80096E14 8FB900C4 */ lw $t9, 0xc4($sp) -/* 097A18 80096E18 06210003 */ bgez $s1, .L80096E28 -/* 097A1C 80096E1C 0011C043 */ sra $t8, $s1, 1 -/* 097A20 80096E20 26210001 */ addiu $at, $s1, 1 -/* 097A24 80096E24 0001C043 */ sra $t8, $at, 1 -.L80096E28: -/* 097A28 80096E28 2B010002 */ slti $at, $t8, 2 -/* 097A2C 80096E2C 272E0001 */ addiu $t6, $t9, 1 -/* 097A30 80096E30 03008825 */ move $s1, $t8 -/* 097A34 80096E34 1020FFF7 */ beqz $at, .L80096E14 -/* 097A38 80096E38 AFAE00C4 */ sw $t6, 0xc4($sp) -.L80096E3C: -/* 097A3C 80096E3C 06810006 */ bgez $s4, .L80096E58 -/* 097A40 80096E40 8FB900F4 */ lw $t9, 0xf4($sp) -/* 097A44 80096E44 8FAF00F4 */ lw $t7, 0xf4($sp) -/* 097A48 80096E48 01F4C023 */ subu $t8, $t7, $s4 -/* 097A4C 80096E4C AFB800F4 */ sw $t8, 0xf4($sp) -/* 097A50 80096E50 10000007 */ b .L80096E70 -/* 097A54 80096E54 0000A025 */ move $s4, $zero -.L80096E58: -/* 097A58 80096E58 02997021 */ addu $t6, $s4, $t9 -/* 097A5C 80096E5C 2DC10141 */ sltiu $at, $t6, 0x141 -/* 097A60 80096E60 14200003 */ bnez $at, .L80096E70 -/* 097A64 80096E64 240F0140 */ li $t7, 320 -/* 097A68 80096E68 01F4C023 */ subu $t8, $t7, $s4 -/* 097A6C 80096E6C AFB800F4 */ sw $t8, 0xf4($sp) -.L80096E70: -/* 097A70 80096E70 06410004 */ bgez $s2, .L80096E84 -/* 097A74 80096E74 8FAF00F4 */ lw $t7, 0xf4($sp) -/* 097A78 80096E78 00B22823 */ subu $a1, $a1, $s2 -/* 097A7C 80096E7C 10000006 */ b .L80096E98 -/* 097A80 80096E80 00009025 */ move $s2, $zero -.L80096E84: -/* 097A84 80096E84 0245C821 */ addu $t9, $s2, $a1 -/* 097A88 80096E88 2F2100F1 */ sltiu $at, $t9, 0xf1 -/* 097A8C 80096E8C 14200002 */ bnez $at, .L80096E98 -/* 097A90 80096E90 240E00F0 */ li $t6, 240 -/* 097A94 80096E94 01D22823 */ subu $a1, $t6, $s2 -.L80096E98: -/* 097A98 80096E98 15E00003 */ bnez $t7, .L80096EA8 -/* 097A9C 80096E9C 00000000 */ nop -/* 097AA0 80096EA0 100000E8 */ b .L80097244 -/* 097AA4 80096EA4 02001025 */ move $v0, $s0 -.L80096EA8: -/* 097AA8 80096EA8 14A00003 */ bnez $a1, .L80096EB8 -/* 097AAC 80096EAC 24040064 */ li $a0, 100 -/* 097AB0 80096EB0 100000E4 */ b .L80097244 -/* 097AB4 80096EB4 02001025 */ move $v0, $s0 -.L80096EB8: -/* 097AB8 80096EB8 8FB800F4 */ lw $t8, 0xf4($sp) -/* 097ABC 80096EBC AFBF00D0 */ sw $ra, 0xd0($sp) -/* 097AC0 80096EC0 02459821 */ addu $s3, $s2, $a1 -/* 097AC4 80096EC4 02986021 */ addu $t4, $s4, $t8 -/* 097AC8 80096EC8 0C0ADF8D */ jal random_int -/* 097ACC 80096ECC AFAC0084 */ sw $t4, 0x84($sp) -/* 097AD0 80096ED0 8FA70084 */ lw $a3, 0x84($sp) -/* 097AD4 80096ED4 00408825 */ move $s1, $v0 -/* 097AD8 80096ED8 02002025 */ move $a0, $s0 -/* 097ADC 80096EDC 02802825 */ move $a1, $s4 -/* 097AE0 80096EE0 02403025 */ move $a2, $s2 -/* 097AE4 80096EE4 AFB30010 */ sw $s3, 0x10($sp) -/* 097AE8 80096EE8 AFA00014 */ sw $zero, 0x14($sp) -/* 097AEC 80096EEC AFA00018 */ sw $zero, 0x18($sp) -/* 097AF0 80096EF0 AFA0001C */ sw $zero, 0x1c($sp) -/* 097AF4 80096EF4 0C02637E */ jal draw_box -/* 097AF8 80096EF8 AFA20020 */ sw $v0, 0x20($sp) -/* 097AFC 80096EFC 8FAC0084 */ lw $t4, 0x84($sp) -/* 097B00 80096F00 8FBF00D0 */ lw $ra, 0xd0($sp) -/* 097B04 80096F04 26310096 */ addiu $s1, $s1, 0x96 -/* 097B08 80096F08 3C0EB900 */ lui $t6, (0xB900031D >> 16) # lui $t6, 0xb900 -/* 097B0C 80096F0C 3C19E700 */ lui $t9, 0xe700 -/* 097B10 80096F10 35CE031D */ ori $t6, (0xB900031D & 0xFFFF) # ori $t6, $t6, 0x31d -/* 097B14 80096F14 3C0F0050 */ lui $t7, (0x00504240 >> 16) # lui $t7, 0x50 -/* 097B18 80096F18 322300FF */ andi $v1, $s1, 0xff -/* 097B1C 80096F1C AC590000 */ sw $t9, ($v0) -/* 097B20 80096F20 35EF4240 */ ori $t7, (0x00504240 & 0xFFFF) # ori $t7, $t7, 0x4240 -/* 097B24 80096F24 AC4E0008 */ sw $t6, 8($v0) -/* 097B28 80096F28 3C18FA00 */ lui $t8, 0xfa00 -/* 097B2C 80096F2C AC4F000C */ sw $t7, 0xc($v0) -/* 097B30 80096F30 AC580010 */ sw $t8, 0x10($v0) -/* 097B34 80096F34 00037400 */ sll $t6, $v1, 0x10 -/* 097B38 80096F38 0003CE00 */ sll $t9, $v1, 0x18 -/* 097B3C 80096F3C 032E7825 */ or $t7, $t9, $t6 -/* 097B40 80096F40 0003C200 */ sll $t8, $v1, 8 -/* 097B44 80096F44 01F8C825 */ or $t9, $t7, $t8 -/* 097B48 80096F48 3C18FF2F */ lui $t8, (0xFF2FFFFF >> 16) # lui $t8, 0xff2f -/* 097B4C 80096F4C 3C0FFC11 */ lui $t7, (0xFC119623 >> 16) # lui $t7, 0xfc11 -/* 097B50 80096F50 03237025 */ or $t6, $t9, $v1 -/* 097B54 80096F54 35EF9623 */ ori $t7, (0xFC119623 & 0xFFFF) # ori $t7, $t7, 0x9623 -/* 097B58 80096F58 3718FFFF */ ori $t8, (0xFF2FFFFF & 0xFFFF) # ori $t8, $t8, 0xffff -/* 097B5C 80096F5C 0253082B */ sltu $at, $s2, $s3 -/* 097B60 80096F60 AC400004 */ sw $zero, 4($v0) -/* 097B64 80096F64 AC4E0014 */ sw $t6, 0x14($v0) -/* 097B68 80096F68 AC58001C */ sw $t8, 0x1c($v0) -/* 097B6C 80096F6C AC4F0018 */ sw $t7, 0x18($v0) -/* 097B70 80096F70 24500020 */ addiu $s0, $v0, 0x20 -/* 097B74 80096F74 102000B2 */ beqz $at, .L80097240 -/* 097B78 80096F78 0240F025 */ move $fp, $s2 -/* 097B7C 80096F7C 8FB900CC */ lw $t9, 0xcc($sp) -.L80096F80: -/* 097B80 80096F80 8FAD00CC */ lw $t5, 0xcc($sp) -/* 097B84 80096F84 02808825 */ move $s1, $s4 -/* 097B88 80096F88 033E7021 */ addu $t6, $t9, $fp -/* 097B8C 80096F8C 026E082B */ sltu $at, $s3, $t6 -/* 097B90 80096F90 10200006 */ beqz $at, .L80096FAC -/* 097B94 80096F94 AFAE007C */ sw $t6, 0x7c($sp) -/* 097B98 80096F98 027E6823 */ subu $t5, $s3, $fp -/* 097B9C 80096F9C 51A000A9 */ beql $t5, $zero, .L80097244 -/* 097BA0 80096FA0 02001025 */ move $v0, $s0 -/* 097BA4 80096FA4 10000001 */ b .L80096FAC -/* 097BA8 80096FA8 02808825 */ move $s1, $s4 -.L80096FAC: -/* 097BAC 80096FAC 028C082B */ sltu $at, $s4, $t4 -/* 097BB0 80096FB0 502000A0 */ beql $at, $zero, .L80097234 -/* 097BB4 80096FB4 8FBE007C */ lw $fp, 0x7c($sp) -/* 097BB8 80096FB8 AFB30080 */ sw $s3, 0x80($sp) -/* 097BBC 80096FBC AFB400EC */ sw $s4, 0xec($sp) -.L80096FC0: -/* 097BC0 80096FC0 03F15021 */ addu $t2, $ra, $s1 -/* 097BC4 80096FC4 018A082B */ sltu $at, $t4, $t2 -/* 097BC8 80096FC8 8FAF0080 */ lw $t7, 0x80($sp) -/* 097BCC 80096FCC 1020001E */ beqz $at, .L80097048 -/* 097BD0 80096FD0 8FB800EC */ lw $t8, 0xec($sp) -/* 097BD4 80096FD4 0191A023 */ subu $s4, $t4, $s1 -/* 097BD8 80096FD8 16800004 */ bnez $s4, .L80096FEC -/* 097BDC 80096FDC 8FA500F4 */ lw $a1, 0xf4($sp) -/* 097BE0 80096FE0 0300A025 */ move $s4, $t8 -/* 097BE4 80096FE4 10000092 */ b .L80097230 -/* 097BE8 80096FE8 01E09825 */ move $s3, $t7 -.L80096FEC: -/* 097BEC 80096FEC 8FA200C4 */ lw $v0, 0xc4($sp) -/* 097BF0 80096FF0 24A5FFFF */ addiu $a1, $a1, -1 -/* 097BF4 80096FF4 8FA300C8 */ lw $v1, 0xc8($sp) -/* 097BF8 80096FF8 30B90FFF */ andi $t9, $a1, 0xfff -/* 097BFC 80096FFC 3C01FD70 */ lui $at, 0xfd70 -/* 097C00 80097000 03212825 */ or $a1, $t9, $at -/* 097C04 80097004 3058000F */ andi $t8, $v0, 0xf -/* 097C08 80097008 00181380 */ sll $v0, $t8, 0xe -/* 097C0C 8009700C 3C010700 */ lui $at, 0x700 -/* 097C10 80097010 3079000F */ andi $t9, $v1, 0xf -/* 097C14 80097014 00191900 */ sll $v1, $t9, 4 -/* 097C18 80097018 0041C025 */ or $t8, $v0, $at -/* 097C1C 8009701C 0303B025 */ or $s6, $t8, $v1 -/* 097C20 80097020 001E9080 */ sll $s2, $fp, 2 -/* 097C24 80097024 03CD9821 */ addu $s3, $fp, $t5 -/* 097C28 80097028 0013C880 */ sll $t9, $s3, 2 -/* 097C2C 8009702C 324F0FFF */ andi $t7, $s2, 0xfff -/* 097C30 80097030 001EC140 */ sll $t8, $fp, 5 -/* 097C34 80097034 330BFFFF */ andi $t3, $t8, 0xffff -/* 097C38 80097038 01E09025 */ move $s2, $t7 -/* 097C3C 8009703C 33330FFF */ andi $s3, $t9, 0xfff -/* 097C40 80097040 10000019 */ b .L800970A8 -/* 097C44 80097044 0043B825 */ or $s7, $v0, $v1 -.L80097048: -/* 097C48 80097048 8FA500F4 */ lw $a1, 0xf4($sp) -/* 097C4C 8009704C 8FA200C4 */ lw $v0, 0xc4($sp) -/* 097C50 80097050 8FA300C8 */ lw $v1, 0xc8($sp) -/* 097C54 80097054 24A5FFFF */ addiu $a1, $a1, -1 -/* 097C58 80097058 30B90FFF */ andi $t9, $a1, 0xfff -/* 097C5C 8009705C 3C01FD70 */ lui $at, 0xfd70 -/* 097C60 80097060 03212825 */ or $a1, $t9, $at -/* 097C64 80097064 3058000F */ andi $t8, $v0, 0xf -/* 097C68 80097068 00181380 */ sll $v0, $t8, 0xe -/* 097C6C 8009706C 3C010700 */ lui $at, 0x700 -/* 097C70 80097070 3079000F */ andi $t9, $v1, 0xf -/* 097C74 80097074 00191900 */ sll $v1, $t9, 4 -/* 097C78 80097078 0041C025 */ or $t8, $v0, $at -/* 097C7C 8009707C 0303B025 */ or $s6, $t8, $v1 -/* 097C80 80097080 001E9080 */ sll $s2, $fp, 2 -/* 097C84 80097084 03CD9821 */ addu $s3, $fp, $t5 -/* 097C88 80097088 0013C880 */ sll $t9, $s3, 2 -/* 097C8C 8009708C 324F0FFF */ andi $t7, $s2, 0xfff -/* 097C90 80097090 001EC140 */ sll $t8, $fp, 5 -/* 097C94 80097094 330BFFFF */ andi $t3, $t8, 0xffff -/* 097C98 80097098 01E09025 */ move $s2, $t7 -/* 097C9C 8009709C 33330FFF */ andi $s3, $t9, 0xfff -/* 097CA0 800970A0 0043B825 */ or $s7, $v0, $v1 -/* 097CA4 800970A4 03E0A025 */ move $s4, $ra -.L800970A8: -/* 097CA8 800970A8 0200A825 */ move $s5, $s0 -/* 097CAC 800970AC AEA50000 */ sw $a1, ($s5) -/* 097CB0 800970B0 AFBF00D0 */ sw $ra, 0xd0($sp) -/* 097CB4 800970B4 AFAD00D4 */ sw $t5, 0xd4($sp) -/* 097CB8 800970B8 AFAC0084 */ sw $t4, 0x84($sp) -/* 097CBC 800970BC AFAB0058 */ sw $t3, 0x58($sp) -/* 097CC0 800970C0 AFAA0078 */ sw $t2, 0x78($sp) -/* 097CC4 800970C4 26100008 */ addiu $s0, $s0, 8 -/* 097CC8 800970C8 0C0ADF8D */ jal random_int -/* 097CCC 800970CC 24040080 */ li $a0, 128 -/* 097CD0 800970D0 3C0E0B00 */ lui $t6, %hi(D_0B002A00) # $t6, 0xb00 -/* 097CD4 800970D4 02343021 */ addu $a2, $s1, $s4 -/* 097CD8 800970D8 00D13823 */ subu $a3, $a2, $s1 -/* 097CDC 800970DC 25CE2A00 */ addiu $t6, %lo(D_0B002A00) # addiu $t6, $t6, 0x2a00 -/* 097CE0 800970E0 0002C840 */ sll $t9, $v0, 1 -/* 097CE4 800970E4 032EC021 */ addu $t8, $t9, $t6 -/* 097CE8 800970E8 00077840 */ sll $t7, $a3, 1 -/* 097CEC 800970EC 25E70009 */ addiu $a3, $t7, 9 -/* 097CF0 800970F0 8FAA0078 */ lw $t2, 0x78($sp) -/* 097CF4 800970F4 8FAB0058 */ lw $t3, 0x58($sp) -/* 097CF8 800970F8 8FAC0084 */ lw $t4, 0x84($sp) -/* 097CFC 800970FC 0007C8C2 */ srl $t9, $a3, 3 -/* 097D00 80097100 8FAD00D4 */ lw $t5, 0xd4($sp) -/* 097D04 80097104 8FBF00D0 */ lw $ra, 0xd0($sp) -/* 097D08 80097108 AEB80004 */ sw $t8, 4($s5) -/* 097D0C 8009710C 332E01FF */ andi $t6, $t9, 0x1ff -/* 097D10 80097110 02001825 */ move $v1, $s0 -/* 097D14 80097114 26100008 */ addiu $s0, $s0, 8 -/* 097D18 80097118 000EC240 */ sll $t8, $t6, 9 -/* 097D1C 8009711C 3C01F570 */ lui $at, 0xf570 -/* 097D20 80097120 03013825 */ or $a3, $t8, $at -/* 097D24 80097124 02002025 */ move $a0, $s0 -/* 097D28 80097128 AC670000 */ sw $a3, ($v1) -/* 097D2C 8009712C AC760004 */ sw $s6, 4($v1) -/* 097D30 80097130 00112880 */ sll $a1, $s1, 2 -/* 097D34 80097134 30AE0FFF */ andi $t6, $a1, 0xfff -/* 097D38 80097138 3C19E600 */ lui $t9, 0xe600 -/* 097D3C 8009713C AC990000 */ sw $t9, ($a0) -/* 097D40 80097140 000E2B00 */ sll $a1, $t6, 0xc -/* 097D44 80097144 AC800004 */ sw $zero, 4($a0) -/* 097D48 80097148 3C01F400 */ lui $at, 0xf400 -/* 097D4C 8009714C 00A17825 */ or $t7, $a1, $at -/* 097D50 80097150 00062080 */ sll $a0, $a2, 2 -/* 097D54 80097154 26100008 */ addiu $s0, $s0, 8 -/* 097D58 80097158 02004025 */ move $t0, $s0 -/* 097D5C 8009715C 308E0FFF */ andi $t6, $a0, 0xfff -/* 097D60 80097160 01F2C825 */ or $t9, $t7, $s2 -/* 097D64 80097164 000E2300 */ sll $a0, $t6, 0xc -/* 097D68 80097168 3C010700 */ lui $at, 0x700 -/* 097D6C 8009716C 00817825 */ or $t7, $a0, $at -/* 097D70 80097170 AD190000 */ sw $t9, ($t0) -/* 097D74 80097174 26100008 */ addiu $s0, $s0, 8 -/* 097D78 80097178 02001025 */ move $v0, $s0 -/* 097D7C 8009717C 01F3C825 */ or $t9, $t7, $s3 -/* 097D80 80097180 AD190004 */ sw $t9, 4($t0) -/* 097D84 80097184 26100008 */ addiu $s0, $s0, 8 -/* 097D88 80097188 3C0EE700 */ lui $t6, 0xe700 -/* 097D8C 8009718C AC4E0000 */ sw $t6, ($v0) -/* 097D90 80097190 02001825 */ move $v1, $s0 -/* 097D94 80097194 AC400004 */ sw $zero, 4($v0) -/* 097D98 80097198 26100008 */ addiu $s0, $s0, 8 -/* 097D9C 8009719C 02004825 */ move $t1, $s0 -/* 097DA0 800971A0 3C01F200 */ lui $at, 0xf200 -/* 097DA4 800971A4 00A1C025 */ or $t8, $a1, $at -/* 097DA8 800971A8 AC770004 */ sw $s7, 4($v1) -/* 097DAC 800971AC AC670000 */ sw $a3, ($v1) -/* 097DB0 800971B0 03127825 */ or $t7, $t8, $s2 -/* 097DB4 800971B4 26100008 */ addiu $s0, $s0, 8 -/* 097DB8 800971B8 0093C825 */ or $t9, $a0, $s3 -/* 097DBC 800971BC AD390004 */ sw $t9, 4($t1) -/* 097DC0 800971C0 AD2F0000 */ sw $t7, ($t1) -/* 097DC4 800971C4 02001025 */ move $v0, $s0 -/* 097DC8 800971C8 3C01E400 */ lui $at, 0xe400 -/* 097DCC 800971CC 00817025 */ or $t6, $a0, $at -/* 097DD0 800971D0 01D3C025 */ or $t8, $t6, $s3 -/* 097DD4 800971D4 26100008 */ addiu $s0, $s0, 8 -/* 097DD8 800971D8 00B27825 */ or $t7, $a1, $s2 -/* 097DDC 800971DC AC4F0004 */ sw $t7, 4($v0) -/* 097DE0 800971E0 02001825 */ move $v1, $s0 -/* 097DE4 800971E4 AC580000 */ sw $t8, ($v0) -/* 097DE8 800971E8 3C19B300 */ lui $t9, 0xb300 -/* 097DEC 800971EC AC790000 */ sw $t9, ($v1) -/* 097DF0 800971F0 0011CD40 */ sll $t9, $s1, 0x15 -/* 097DF4 800971F4 26100008 */ addiu $s0, $s0, 8 -/* 097DF8 800971F8 02001025 */ move $v0, $s0 -/* 097DFC 800971FC 3C0F0400 */ lui $t7, (0x04000400 >> 16) # lui $t7, 0x400 -/* 097E00 80097200 032B7025 */ or $t6, $t9, $t3 -/* 097E04 80097204 AC6E0004 */ sw $t6, 4($v1) -/* 097E08 80097208 35EF0400 */ ori $t7, (0x04000400 & 0xFFFF) # ori $t7, $t7, 0x400 -/* 097E0C 8009720C 3C18B200 */ lui $t8, 0xb200 -/* 097E10 80097210 014C082B */ sltu $at, $t2, $t4 -/* 097E14 80097214 AC580000 */ sw $t8, ($v0) -/* 097E18 80097218 AC4F0004 */ sw $t7, 4($v0) -/* 097E1C 8009721C 26100008 */ addiu $s0, $s0, 8 -/* 097E20 80097220 1420FF67 */ bnez $at, .L80096FC0 -/* 097E24 80097224 01408825 */ move $s1, $t2 -/* 097E28 80097228 8FB400EC */ lw $s4, 0xec($sp) -/* 097E2C 8009722C 8FB30080 */ lw $s3, 0x80($sp) -.L80097230: -/* 097E30 80097230 8FBE007C */ lw $fp, 0x7c($sp) -.L80097234: -/* 097E34 80097234 03D3082B */ sltu $at, $fp, $s3 -/* 097E38 80097238 5420FF51 */ bnel $at, $zero, .L80096F80 -/* 097E3C 8009723C 8FB900CC */ lw $t9, 0xcc($sp) -.L80097240: -/* 097E40 80097240 02001025 */ move $v0, $s0 -.L80097244: -/* 097E44 80097244 8FBF0054 */ lw $ra, 0x54($sp) -/* 097E48 80097248 8FB00030 */ lw $s0, 0x30($sp) -/* 097E4C 8009724C 8FB10034 */ lw $s1, 0x34($sp) -/* 097E50 80097250 8FB20038 */ lw $s2, 0x38($sp) -/* 097E54 80097254 8FB3003C */ lw $s3, 0x3c($sp) -/* 097E58 80097258 8FB40040 */ lw $s4, 0x40($sp) -/* 097E5C 8009725C 8FB50044 */ lw $s5, 0x44($sp) -/* 097E60 80097260 8FB60048 */ lw $s6, 0x48($sp) -/* 097E64 80097264 8FB7004C */ lw $s7, 0x4c($sp) -/* 097E68 80097268 8FBE0050 */ lw $fp, 0x50($sp) -/* 097E6C 8009726C 03E00008 */ jr $ra -/* 097E70 80097270 27BD00E8 */ addiu $sp, $sp, 0xe8 diff --git a/asm/non_matchings/code_80091750/func_80097274.s b/asm/non_matchings/code_80091750/func_80097274.s deleted file mode 100644 index 26767175f4..0000000000 --- a/asm/non_matchings/code_80091750/func_80097274.s +++ /dev/null @@ -1,522 +0,0 @@ -glabel func_80097274 -/* 097E74 80097274 27BDFEF0 */ addiu $sp, $sp, -0x110 -/* 097E78 80097278 AFB00018 */ sw $s0, 0x18($sp) -/* 097E7C 8009727C AFBF003C */ sw $ra, 0x3c($sp) -/* 097E80 80097280 AFBE0038 */ sw $fp, 0x38($sp) -/* 097E84 80097284 AFB70034 */ sw $s7, 0x34($sp) -/* 097E88 80097288 AFB60030 */ sw $s6, 0x30($sp) -/* 097E8C 8009728C AFB5002C */ sw $s5, 0x2c($sp) -/* 097E90 80097290 AFB40028 */ sw $s4, 0x28($sp) -/* 097E94 80097294 AFB30024 */ sw $s3, 0x24($sp) -/* 097E98 80097298 AFB20020 */ sw $s2, 0x20($sp) -/* 097E9C 8009729C AFB1001C */ sw $s1, 0x1c($sp) -/* 097EA0 800972A0 AFA50114 */ sw $a1, 0x114($sp) -/* 097EA4 800972A4 AFA60118 */ sw $a2, 0x118($sp) -/* 097EA8 800972A8 AFA7011C */ sw $a3, 0x11c($sp) -/* 097EAC 800972AC 24900008 */ addiu $s0, $a0, 8 -/* 097EB0 800972B0 3C0EE700 */ lui $t6, 0xe700 -/* 097EB4 800972B4 AC8E0000 */ sw $t6, ($a0) -/* 097EB8 800972B8 02001825 */ move $v1, $s0 -/* 097EBC 800972BC 3C0FBA00 */ lui $t7, (0xBA001402 >> 16) # lui $t7, 0xba00 -/* 097EC0 800972C0 AC800004 */ sw $zero, 4($a0) -/* 097EC4 800972C4 35EF1402 */ ori $t7, (0xBA001402 & 0xFFFF) # ori $t7, $t7, 0x1402 -/* 097EC8 800972C8 26100008 */ addiu $s0, $s0, 8 -/* 097ECC 800972CC AC6F0000 */ sw $t7, ($v1) -/* 097ED0 800972D0 3C180010 */ lui $t8, %hi(D_000FFF00) # $t8, 0x10 -/* 097ED4 800972D4 02004825 */ move $t1, $s0 -/* 097ED8 800972D8 AC780004 */ sw $t8, 4($v1) -/* 097EDC 800972DC 3C19BA00 */ lui $t9, (0xBA001001 >> 16) # lui $t9, 0xba00 -/* 097EE0 800972E0 37391001 */ ori $t9, (0xBA001001 & 0xFFFF) # ori $t9, $t9, 0x1001 -/* 097EE4 800972E4 26100008 */ addiu $s0, $s0, 8 -/* 097EE8 800972E8 AD390000 */ sw $t9, ($t1) -/* 097EEC 800972EC AD200004 */ sw $zero, 4($t1) -/* 097EF0 800972F0 02005025 */ move $t2, $s0 -/* 097EF4 800972F4 3C0EFA00 */ lui $t6, 0xfa00 -/* 097EF8 800972F8 AD4E0000 */ sw $t6, ($t2) -/* 097EFC 800972FC 3C0F800E */ lui $t7, %hi(gGlobalTimer) # $t7, 0x800e -/* 097F00 80097300 8DEFC54C */ lw $t7, %lo(gGlobalTimer)($t7) -/* 097F04 80097304 26100008 */ addiu $s0, $s0, 8 -/* 097F08 80097308 02006825 */ move $t5, $s0 -/* 097F0C 8009730C 3C0EFC25 */ lui $t6, (0xFC2527FF >> 16) # lui $t6, 0xfc25 -/* 097F10 80097310 35CE27FF */ ori $t6, (0xFC2527FF & 0xFFFF) # ori $t6, $t6, 0x27ff -/* 097F14 80097314 00801025 */ move $v0, $a0 -/* 097F18 80097318 24080001 */ li $t0, 1 -/* 097F1C 8009731C 00005825 */ move $t3, $zero -/* 097F20 80097320 00006025 */ move $t4, $zero -/* 097F24 80097324 05E10004 */ bgez $t7, .L80097338 -/* 097F28 80097328 31F800FF */ andi $t8, $t7, 0xff -/* 097F2C 8009732C 13000002 */ beqz $t8, .L80097338 -/* 097F30 80097330 00000000 */ nop -/* 097F34 80097334 2718FF00 */ addiu $t8, %lo(D_000FFF00) # addiu $t8, $t8, -0x100 -.L80097338: -/* 097F38 80097338 331900FF */ andi $t9, $t8, 0xff -/* 097F3C 8009733C AD590004 */ sw $t9, 4($t2) -/* 097F40 80097340 3C0F1FFC */ lui $t7, (0x1FFC9238 >> 16) # lui $t7, 0x1ffc -/* 097F44 80097344 35EF9238 */ ori $t7, (0x1FFC9238 & 0xFFFF) # ori $t7, $t7, 0x9238 -/* 097F48 80097348 ADAF0004 */ sw $t7, 4($t5) -/* 097F4C 8009734C ADAE0000 */ sw $t6, ($t5) -/* 097F50 80097350 8FB8013C */ lw $t8, 0x13c($sp) -/* 097F54 80097354 26100008 */ addiu $s0, $s0, 8 -/* 097F58 80097358 8FA40140 */ lw $a0, 0x140($sp) -/* 097F5C 8009735C 2F010002 */ sltiu $at, $t8, 2 -/* 097F60 80097360 14200007 */ bnez $at, .L80097380 -/* 097F64 80097364 240F0400 */ li $t7, 1024 -/* 097F68 80097368 8FAE013C */ lw $t6, 0x13c($sp) -.L8009736C: -/* 097F6C 8009736C 0008C840 */ sll $t9, $t0, 1 -/* 097F70 80097370 03204025 */ move $t0, $t9 -/* 097F74 80097374 032E082B */ sltu $at, $t9, $t6 -/* 097F78 80097378 5420FFFC */ bnel $at, $zero, .L8009736C -/* 097F7C 8009737C 8FAE013C */ lw $t6, 0x13c($sp) -.L80097380: -/* 097F80 80097380 01E8001A */ div $zero, $t7, $t0 -/* 097F84 80097384 15000002 */ bnez $t0, .L80097390 -/* 097F88 80097388 00000000 */ nop -/* 097F8C 8009738C 0007000D */ break 7 -.L80097390: -/* 097F90 80097390 2401FFFF */ li $at, -1 -/* 097F94 80097394 15010004 */ bne $t0, $at, .L800973A8 -/* 097F98 80097398 3C018000 */ lui $at, 0x8000 -/* 097F9C 8009739C 15E10002 */ bne $t7, $at, .L800973A8 -/* 097FA0 800973A0 00000000 */ nop -/* 097FA4 800973A4 0006000D */ break 6 -.L800973A8: -/* 097FA8 800973A8 00001012 */ mflo $v0 -/* 097FAC 800973AC AFA200F4 */ sw $v0, 0xf4($sp) -/* 097FB0 800973B0 04410003 */ bgez $v0, .L800973C0 -/* 097FB4 800973B4 0002C043 */ sra $t8, $v0, 1 -/* 097FB8 800973B8 24410001 */ addiu $at, $v0, 1 -/* 097FBC 800973BC 0001C043 */ sra $t8, $at, 1 -.L800973C0: -/* 097FC0 800973C0 0098082B */ sltu $at, $a0, $t8 -/* 097FC4 800973C4 1020000F */ beqz $at, .L80097404 -/* 097FC8 800973C8 8FA200F4 */ lw $v0, 0xf4($sp) -/* 097FCC 800973CC 04410003 */ bgez $v0, .L800973DC -/* 097FD0 800973D0 0002C843 */ sra $t9, $v0, 1 -/* 097FD4 800973D4 24410001 */ addiu $at, $v0, 1 -/* 097FD8 800973D8 0001C843 */ sra $t9, $at, 1 -.L800973DC: -/* 097FDC 800973DC 03201025 */ move $v0, $t9 -/* 097FE0 800973E0 00401825 */ move $v1, $v0 -.L800973E4: -/* 097FE4 800973E4 04610003 */ bgez $v1, .L800973F4 -/* 097FE8 800973E8 00031043 */ sra $v0, $v1, 1 -/* 097FEC 800973EC 24610001 */ addiu $at, $v1, 1 -/* 097FF0 800973F0 00011043 */ sra $v0, $at, 1 -.L800973F4: -/* 097FF4 800973F4 0082082B */ sltu $at, $a0, $v0 -/* 097FF8 800973F8 5420FFFA */ bnel $at, $zero, .L800973E4 -/* 097FFC 800973FC 00401825 */ move $v1, $v0 -/* 098000 80097400 AFA300F4 */ sw $v1, 0xf4($sp) -.L80097404: -/* 098004 80097404 29010002 */ slti $at, $t0, 2 -/* 098008 80097408 14200009 */ bnez $at, .L80097430 -/* 09800C 8009740C 01001025 */ move $v0, $t0 -.L80097410: -/* 098010 80097410 04410003 */ bgez $v0, .L80097420 -/* 098014 80097414 00027043 */ sra $t6, $v0, 1 -/* 098018 80097418 24410001 */ addiu $at, $v0, 1 -/* 09801C 8009741C 00017043 */ sra $t6, $at, 1 -.L80097420: -/* 098020 80097420 29C10002 */ slti $at, $t6, 2 -/* 098024 80097424 01C01025 */ move $v0, $t6 -/* 098028 80097428 1020FFF9 */ beqz $at, .L80097410 -/* 09802C 8009742C 256B0001 */ addiu $t3, $t3, 1 -.L80097430: -/* 098030 80097430 8FA200F4 */ lw $v0, 0xf4($sp) -/* 098034 80097434 8FA40130 */ lw $a0, 0x130($sp) -/* 098038 80097438 8FB90120 */ lw $t9, 0x120($sp) -/* 09803C 8009743C 28410002 */ slti $at, $v0, 2 -/* 098040 80097440 14200009 */ bnez $at, .L80097468 -/* 098044 80097444 8FAF0128 */ lw $t7, 0x128($sp) -.L80097448: -/* 098048 80097448 04410003 */ bgez $v0, .L80097458 -/* 09804C 8009744C 0002C043 */ sra $t8, $v0, 1 -/* 098050 80097450 24410001 */ addiu $at, $v0, 1 -/* 098054 80097454 0001C043 */ sra $t8, $at, 1 -.L80097458: -/* 098058 80097458 2B010002 */ slti $at, $t8, 2 -/* 09805C 8009745C 03001025 */ move $v0, $t8 -/* 098060 80097460 1020FFF9 */ beqz $at, .L80097448 -/* 098064 80097464 258C0001 */ addiu $t4, $t4, 1 -.L80097468: -/* 098068 80097468 04810005 */ bgez $a0, .L80097480 -/* 09806C 8009746C 8FA20120 */ lw $v0, 0x120($sp) -/* 098070 80097470 03247023 */ subu $t6, $t9, $a0 -/* 098074 80097474 AFAE0120 */ sw $t6, 0x120($sp) -/* 098078 80097478 10000008 */ b .L8009749C -/* 09807C 8009747C 00002025 */ move $a0, $zero -.L80097480: -/* 098080 80097480 01E2C023 */ subu $t8, $t7, $v0 -/* 098084 80097484 0304C821 */ addu $t9, $t8, $a0 -/* 098088 80097488 2B210141 */ slti $at, $t9, 0x141 -/* 09808C 8009748C 14200003 */ bnez $at, .L8009749C -/* 098090 80097490 00441823 */ subu $v1, $v0, $a0 -/* 098094 80097494 24630140 */ addiu $v1, $v1, 0x140 -/* 098098 80097498 AFA30128 */ sw $v1, 0x128($sp) -.L8009749C: -/* 09809C 8009749C 8FAE0134 */ lw $t6, 0x134($sp) -/* 0980A0 800974A0 8FA30128 */ lw $v1, 0x128($sp) -/* 0980A4 800974A4 8FA20124 */ lw $v0, 0x124($sp) -/* 0980A8 800974A8 05C10005 */ bgez $t6, .L800974C0 -/* 0980AC 800974AC 8FAF012C */ lw $t7, 0x12c($sp) -/* 0980B0 800974B0 8FA20124 */ lw $v0, 0x124($sp) -/* 0980B4 800974B4 AFA00134 */ sw $zero, 0x134($sp) -/* 0980B8 800974B8 10000009 */ b .L800974E0 -/* 0980BC 800974BC 004E1023 */ subu $v0, $v0, $t6 -.L800974C0: -/* 0980C0 800974C0 8FB90134 */ lw $t9, 0x134($sp) -/* 0980C4 800974C4 01E2C023 */ subu $t8, $t7, $v0 -/* 0980C8 800974C8 03197021 */ addu $t6, $t8, $t9 -/* 0980CC 800974CC 29C100F1 */ slti $at, $t6, 0xf1 -/* 0980D0 800974D0 14200003 */ bnez $at, .L800974E0 -/* 0980D4 800974D4 00597823 */ subu $t7, $v0, $t9 -/* 0980D8 800974D8 25F800F0 */ addiu $t8, $t7, 0xf0 -/* 0980DC 800974DC AFB8012C */ sw $t8, 0x12c($sp) -.L800974E0: -/* 0980E0 800974E0 8FAE0120 */ lw $t6, 0x120($sp) -/* 0980E4 800974E4 8FB9012C */ lw $t9, 0x12c($sp) -/* 0980E8 800974E8 006E082A */ slt $at, $v1, $t6 -/* 0980EC 800974EC 50200004 */ beql $at, $zero, .L80097500 -/* 0980F0 800974F0 0322082A */ slt $at, $t9, $v0 -/* 0980F4 800974F4 1000013B */ b .L800979E4 -/* 0980F8 800974F8 02001025 */ move $v0, $s0 -/* 0980FC 800974FC 0322082A */ slt $at, $t9, $v0 -.L80097500: -/* 098100 80097500 50200004 */ beql $at, $zero, .L80097514 -/* 098104 80097504 8FAF012C */ lw $t7, 0x12c($sp) -/* 098108 80097508 10000136 */ b .L800979E4 -/* 09810C 8009750C 02001025 */ move $v0, $s0 -/* 098110 80097510 8FAF012C */ lw $t7, 0x12c($sp) -.L80097514: -/* 098114 80097514 AFA40104 */ sw $a0, 0x104($sp) -/* 098118 80097518 00406825 */ move $t5, $v0 -/* 09811C 8009751C 004F082B */ sltu $at, $v0, $t7 -/* 098120 80097520 50200128 */ beql $at, $zero, .L800979C4 -/* 098124 80097524 26040008 */ addiu $a0, $s0, 8 -/* 098128 80097528 AFA40130 */ sw $a0, 0x130($sp) -/* 09812C 8009752C AFA800F8 */ sw $t0, 0xf8($sp) -/* 098130 80097530 AFAB00F0 */ sw $t3, 0xf0($sp) -/* 098134 80097534 AFAC00EC */ sw $t4, 0xec($sp) -.L80097538: -/* 098138 80097538 8FB800F4 */ lw $t8, 0xf4($sp) -/* 09813C 8009753C 8FB9012C */ lw $t9, 0x12c($sp) -/* 098140 80097540 8FAF00F4 */ lw $t7, 0xf4($sp) -/* 098144 80097544 030D7021 */ addu $t6, $t8, $t5 -/* 098148 80097548 032E082B */ sltu $at, $t9, $t6 -/* 09814C 8009754C 10200006 */ beqz $at, .L80097568 -/* 098150 80097550 AFAE0084 */ sw $t6, 0x84($sp) -/* 098154 80097554 032D1023 */ subu $v0, $t9, $t5 -/* 098158 80097558 10400119 */ beqz $v0, .L800979C0 -/* 09815C 8009755C AFA200FC */ sw $v0, 0xfc($sp) -/* 098160 80097560 10000003 */ b .L80097570 -/* 098164 80097564 8FB40120 */ lw $s4, 0x120($sp) -.L80097568: -/* 098168 80097568 AFAF00FC */ sw $t7, 0xfc($sp) -/* 09816C 8009756C 8FB40120 */ lw $s4, 0x120($sp) -.L80097570: -/* 098170 80097570 8FB80120 */ lw $t8, 0x120($sp) -/* 098174 80097574 0303082B */ sltu $at, $t8, $v1 -/* 098178 80097578 50200108 */ beql $at, $zero, .L8009799C -/* 09817C 8009757C 8FB80104 */ lw $t8, 0x104($sp) -/* 098180 80097580 AFA30128 */ sw $v1, 0x128($sp) -.L80097584: -/* 098184 80097584 8FAE00F8 */ lw $t6, 0xf8($sp) -/* 098188 80097588 8FA30128 */ lw $v1, 0x128($sp) -/* 09818C 8009758C 8FA800FC */ lw $t0, 0xfc($sp) -/* 098190 80097590 01D4C821 */ addu $t9, $t6, $s4 -/* 098194 80097594 0079082B */ sltu $at, $v1, $t9 -/* 098198 80097598 1020003A */ beqz $at, .L80097684 -/* 09819C 8009759C AFB90080 */ sw $t9, 0x80($sp) -/* 0981A0 800975A0 00745823 */ subu $t3, $v1, $s4 -/* 0981A4 800975A4 116000FC */ beqz $t3, .L80097998 -/* 0981A8 800975A8 3C01FD00 */ lui $at, 0xfd00 -/* 0981AC 800975AC 83A40117 */ lb $a0, 0x117($sp) -/* 0981B0 800975B0 8FA200EC */ lw $v0, 0xec($sp) -/* 0981B4 800975B4 AFA30128 */ sw $v1, 0x128($sp) -/* 0981B8 800975B8 308F0007 */ andi $t7, $a0, 7 -/* 0981BC 800975BC 000F2540 */ sll $a0, $t7, 0x15 -/* 0981C0 800975C0 8FAF013C */ lw $t7, 0x13c($sp) -/* 0981C4 800975C4 00817025 */ or $t6, $a0, $at -/* 0981C8 800975C8 3C010010 */ lui $at, 0x10 -/* 0981CC 800975CC 01C1C825 */ or $t9, $t6, $at -/* 0981D0 800975D0 3C01F500 */ lui $at, 0xf500 -/* 0981D4 800975D4 25F8FFFF */ addiu $t8, $t7, -1 -/* 0981D8 800975D8 8FA300F0 */ lw $v1, 0xf0($sp) -/* 0981DC 800975DC 330E0FFF */ andi $t6, $t8, 0xfff -/* 0981E0 800975E0 00813825 */ or $a3, $a0, $at -/* 0981E4 800975E4 8FA800FC */ lw $t0, 0xfc($sp) -/* 0981E8 800975E8 3C010010 */ lui $at, 0x10 -/* 0981EC 800975EC 00E17825 */ or $t7, $a3, $at -/* 0981F0 800975F0 032E2825 */ or $a1, $t9, $t6 -/* 0981F4 800975F4 3058000F */ andi $t8, $v0, 0xf -/* 0981F8 800975F8 8FA90134 */ lw $t1, 0x134($sp) -/* 0981FC 800975FC 00181380 */ sll $v0, $t8, 0xe -/* 098200 80097600 3C010700 */ lui $at, 0x700 -/* 098204 80097604 000D3080 */ sll $a2, $t5, 2 -/* 098208 80097608 306E000F */ andi $t6, $v1, 0xf -/* 09820C 8009760C 000E1900 */ sll $v1, $t6, 4 -/* 098210 80097610 30D90FFF */ andi $t9, $a2, 0xfff -/* 098214 80097614 0041C025 */ or $t8, $v0, $at -/* 098218 80097618 01A89821 */ addu $s3, $t5, $t0 -/* 09821C 8009761C 00137080 */ sll $t6, $s3, 2 -/* 098220 80097620 03203025 */ move $a2, $t9 -/* 098224 80097624 31D30FFF */ andi $s3, $t6, 0xfff -/* 098228 80097628 03036025 */ or $t4, $t8, $v1 -/* 09822C 8009762C 3C010100 */ lui $at, 0x100 -/* 098230 80097630 0128C821 */ addu $t9, $t1, $t0 -/* 098234 80097634 00197080 */ sll $t6, $t9, 2 -/* 098238 80097638 0041C025 */ or $t8, $v0, $at -/* 09823C 8009763C 01E03825 */ move $a3, $t7 -/* 098240 80097640 31CF0FFF */ andi $t7, $t6, 0xfff -/* 098244 80097644 0303F825 */ or $ra, $t8, $v1 -/* 098248 80097648 AFAF004C */ sw $t7, 0x4c($sp) -/* 09824C 8009764C 0009C080 */ sll $t8, $t1, 2 -/* 098250 80097650 33190FFF */ andi $t9, $t8, 0xfff -/* 098254 80097654 000D7940 */ sll $t7, $t5, 5 -/* 098258 80097658 31F8FFFF */ andi $t8, $t7, 0xffff -/* 09825C 8009765C AFB80044 */ sw $t8, 0x44($sp) -/* 098260 80097660 8FB8011C */ lw $t8, 0x11c($sp) -/* 098264 80097664 8FAE0118 */ lw $t6, 0x118($sp) -/* 098268 80097668 AFB90048 */ sw $t9, 0x48($sp) -/* 09826C 8009766C 3319FFFF */ andi $t9, $t8, 0xffff -/* 098270 80097670 000E7C00 */ sll $t7, $t6, 0x10 -/* 098274 80097674 01F97025 */ or $t6, $t7, $t9 -/* 098278 80097678 AFAE0040 */ sw $t6, 0x40($sp) -/* 09827C 8009767C 10000036 */ b .L80097758 -/* 098280 80097680 00435025 */ or $t2, $v0, $v1 -.L80097684: -/* 098284 80097684 83A40117 */ lb $a0, 0x117($sp) -/* 098288 80097688 3C01FD00 */ lui $at, 0xfd00 -/* 09828C 8009768C 8FA200EC */ lw $v0, 0xec($sp) -/* 098290 80097690 30980007 */ andi $t8, $a0, 7 -/* 098294 80097694 00182540 */ sll $a0, $t8, 0x15 -/* 098298 80097698 8FB8013C */ lw $t8, 0x13c($sp) -/* 09829C 8009769C 0081C825 */ or $t9, $a0, $at -/* 0982A0 800976A0 3C010010 */ lui $at, 0x10 -/* 0982A4 800976A4 03217025 */ or $t6, $t9, $at -/* 0982A8 800976A8 3C01F500 */ lui $at, 0xf500 -/* 0982AC 800976AC 270FFFFF */ addiu $t7, $t8, -1 -/* 0982B0 800976B0 8FA300F0 */ lw $v1, 0xf0($sp) -/* 0982B4 800976B4 31F90FFF */ andi $t9, $t7, 0xfff -/* 0982B8 800976B8 00813825 */ or $a3, $a0, $at -/* 0982BC 800976BC 3C010010 */ lui $at, 0x10 -/* 0982C0 800976C0 00E1C025 */ or $t8, $a3, $at -/* 0982C4 800976C4 01D92825 */ or $a1, $t6, $t9 -/* 0982C8 800976C8 304F000F */ andi $t7, $v0, 0xf -/* 0982CC 800976CC 8FA90134 */ lw $t1, 0x134($sp) -/* 0982D0 800976D0 000F1380 */ sll $v0, $t7, 0xe -/* 0982D4 800976D4 3C010700 */ lui $at, 0x700 -/* 0982D8 800976D8 000D3080 */ sll $a2, $t5, 2 -/* 0982DC 800976DC 3079000F */ andi $t9, $v1, 0xf -/* 0982E0 800976E0 00191900 */ sll $v1, $t9, 4 -/* 0982E4 800976E4 30CE0FFF */ andi $t6, $a2, 0xfff -/* 0982E8 800976E8 00417825 */ or $t7, $v0, $at -/* 0982EC 800976EC 01A89821 */ addu $s3, $t5, $t0 -/* 0982F0 800976F0 0013C880 */ sll $t9, $s3, 2 -/* 0982F4 800976F4 01C03025 */ move $a2, $t6 -/* 0982F8 800976F8 33330FFF */ andi $s3, $t9, 0xfff -/* 0982FC 800976FC 01E36025 */ or $t4, $t7, $v1 -/* 098300 80097700 3C010100 */ lui $at, 0x100 -/* 098304 80097704 01287021 */ addu $t6, $t1, $t0 -/* 098308 80097708 000EC880 */ sll $t9, $t6, 2 -/* 09830C 8009770C 00417825 */ or $t7, $v0, $at -/* 098310 80097710 03003825 */ move $a3, $t8 -/* 098314 80097714 33380FFF */ andi $t8, $t9, 0xfff -/* 098318 80097718 01E3F825 */ or $ra, $t7, $v1 -/* 09831C 8009771C AFB8004C */ sw $t8, 0x4c($sp) -/* 098320 80097720 00097880 */ sll $t7, $t1, 2 -/* 098324 80097724 31EE0FFF */ andi $t6, $t7, 0xfff -/* 098328 80097728 000DC140 */ sll $t8, $t5, 5 -/* 09832C 8009772C 330FFFFF */ andi $t7, $t8, 0xffff -/* 098330 80097730 AFAF0044 */ sw $t7, 0x44($sp) -/* 098334 80097734 8FAF011C */ lw $t7, 0x11c($sp) -/* 098338 80097738 8FB90118 */ lw $t9, 0x118($sp) -/* 09833C 8009773C AFAE0048 */ sw $t6, 0x48($sp) -/* 098340 80097740 31EEFFFF */ andi $t6, $t7, 0xffff -/* 098344 80097744 0019C400 */ sll $t8, $t9, 0x10 -/* 098348 80097748 030EC825 */ or $t9, $t8, $t6 -/* 09834C 8009774C AFB90040 */ sw $t9, 0x40($sp) -/* 098350 80097750 00435025 */ or $t2, $v0, $v1 -/* 098354 80097754 8FAB00F8 */ lw $t3, 0xf8($sp) -.L80097758: -/* 098358 80097758 02001025 */ move $v0, $s0 -/* 09835C 8009775C AC450000 */ sw $a1, ($v0) -/* 098360 80097760 8FAF0138 */ lw $t7, 0x138($sp) -/* 098364 80097764 028B2021 */ addu $a0, $s4, $t3 -/* 098368 80097768 0094C023 */ subu $t8, $a0, $s4 -/* 09836C 8009776C 00187040 */ sll $t6, $t8, 1 -/* 098370 80097770 25D90009 */ addiu $t9, $t6, 9 -/* 098374 80097774 AC4F0004 */ sw $t7, 4($v0) -/* 098378 80097778 001978C2 */ srl $t7, $t9, 3 -/* 09837C 8009777C 31F801FF */ andi $t8, $t7, 0x1ff -/* 098380 80097780 26100008 */ addiu $s0, $s0, 8 -/* 098384 80097784 02001825 */ move $v1, $s0 -/* 098388 80097788 00187240 */ sll $t6, $t8, 9 -/* 09838C 8009778C 00EE8825 */ or $s1, $a3, $t6 -/* 098390 80097790 00143880 */ sll $a3, $s4, 2 -/* 098394 80097794 26100008 */ addiu $s0, $s0, 8 -/* 098398 80097798 02004025 */ move $t0, $s0 -/* 09839C 8009779C 30EF0FFF */ andi $t7, $a3, 0xfff -/* 0983A0 800977A0 AC710000 */ sw $s1, ($v1) -/* 0983A4 800977A4 AC6C0004 */ sw $t4, 4($v1) -/* 0983A8 800977A8 3C19E600 */ lui $t9, 0xe600 -/* 0983AC 800977AC AD190000 */ sw $t9, ($t0) -/* 0983B0 800977B0 000F3B00 */ sll $a3, $t7, 0xc -/* 0983B4 800977B4 00049080 */ sll $s2, $a0, 2 -/* 0983B8 800977B8 3C01F400 */ lui $at, 0xf400 -/* 0983BC 800977BC 00E17025 */ or $t6, $a3, $at -/* 0983C0 800977C0 32590FFF */ andi $t9, $s2, 0xfff -/* 0983C4 800977C4 26100008 */ addiu $s0, $s0, 8 -/* 0983C8 800977C8 02001025 */ move $v0, $s0 -/* 0983CC 800977CC 00199300 */ sll $s2, $t9, 0xc -/* 0983D0 800977D0 3C010700 */ lui $at, 0x700 -/* 0983D4 800977D4 0241C025 */ or $t8, $s2, $at -/* 0983D8 800977D8 AD000004 */ sw $zero, 4($t0) -/* 0983DC 800977DC 0313B025 */ or $s6, $t8, $s3 -/* 0983E0 800977E0 26100008 */ addiu $s0, $s0, 8 -/* 0983E4 800977E4 01C6A825 */ or $s5, $t6, $a2 -/* 0983E8 800977E8 AC550000 */ sw $s5, ($v0) -/* 0983EC 800977EC 02001825 */ move $v1, $s0 -/* 0983F0 800977F0 AC560004 */ sw $s6, 4($v0) -/* 0983F4 800977F4 26100008 */ addiu $s0, $s0, 8 -/* 0983F8 800977F8 02004825 */ move $t1, $s0 -/* 0983FC 800977FC 3C0EE700 */ lui $t6, 0xe700 -/* 098400 80097800 AC6E0000 */ sw $t6, ($v1) -/* 098404 80097804 26100008 */ addiu $s0, $s0, 8 -/* 098408 80097808 AC600004 */ sw $zero, 4($v1) -/* 09840C 8009780C 02001025 */ move $v0, $s0 -/* 098410 80097810 3C01F200 */ lui $at, 0xf200 -/* 098414 80097814 00E1C825 */ or $t9, $a3, $at -/* 098418 80097818 AD2A0004 */ sw $t2, 4($t1) -/* 09841C 8009781C AD310000 */ sw $s1, ($t1) -/* 098420 80097820 0326B825 */ or $s7, $t9, $a2 -/* 098424 80097824 26100008 */ addiu $s0, $s0, 8 -/* 098428 80097828 02537825 */ or $t7, $s2, $s3 -/* 09842C 8009782C AC4F0004 */ sw $t7, 4($v0) -/* 098430 80097830 AC570000 */ sw $s7, ($v0) -/* 098434 80097834 0200F025 */ move $fp, $s0 -/* 098438 80097838 AFC50000 */ sw $a1, ($fp) -/* 09843C 8009783C AFBF0050 */ sw $ra, 0x50($sp) -/* 098440 80097840 AFAD0108 */ sw $t5, 0x108($sp) -/* 098444 80097844 AFAC0068 */ sw $t4, 0x68($sp) -/* 098448 80097848 AFAB0100 */ sw $t3, 0x100($sp) -/* 09844C 8009784C 26100008 */ addiu $s0, $s0, 8 -/* 098450 80097850 0C0ADF8D */ jal random_int -/* 098454 80097854 24040080 */ li $a0, 128 -/* 098458 80097858 3C0E0B00 */ lui $t6, %hi(D_0B002A00) # $t6, 0xb00 -/* 09845C 8009785C 8FAC0068 */ lw $t4, 0x68($sp) -/* 098460 80097860 25CE2A00 */ addiu $t6, %lo(D_0B002A00) # addiu $t6, $t6, 0x2a00 -/* 098464 80097864 0002C040 */ sll $t8, $v0, 1 -/* 098468 80097868 8FAB0100 */ lw $t3, 0x100($sp) -/* 09846C 8009786C 8FBF0050 */ lw $ra, 0x50($sp) -/* 098470 80097870 030EC821 */ addu $t9, $t8, $t6 -/* 098474 80097874 8FAD0108 */ lw $t5, 0x108($sp) -/* 098478 80097878 02001825 */ move $v1, $s0 -/* 09847C 8009787C AFD90004 */ sw $t9, 4($fp) -/* 098480 80097880 26100008 */ addiu $s0, $s0, 8 -/* 098484 80097884 36250100 */ ori $a1, $s1, 0x100 -/* 098488 80097888 AC650000 */ sw $a1, ($v1) -/* 09848C 8009788C 02002025 */ move $a0, $s0 -/* 098490 80097890 AC6C0004 */ sw $t4, 4($v1) -/* 098494 80097894 26100008 */ addiu $s0, $s0, 8 -/* 098498 80097898 02003025 */ move $a2, $s0 -/* 09849C 8009789C 3C0FE600 */ lui $t7, 0xe600 -/* 0984A0 800978A0 AC8F0000 */ sw $t7, ($a0) -/* 0984A4 800978A4 26100008 */ addiu $s0, $s0, 8 -/* 0984A8 800978A8 AC800004 */ sw $zero, 4($a0) -/* 0984AC 800978AC 02001025 */ move $v0, $s0 -/* 0984B0 800978B0 ACD60004 */ sw $s6, 4($a2) -/* 0984B4 800978B4 ACD50000 */ sw $s5, ($a2) -/* 0984B8 800978B8 26100008 */ addiu $s0, $s0, 8 -/* 0984BC 800978BC 3C18E700 */ lui $t8, 0xe700 -/* 0984C0 800978C0 AC580000 */ sw $t8, ($v0) -/* 0984C4 800978C4 02001825 */ move $v1, $s0 -/* 0984C8 800978C8 AC400004 */ sw $zero, 4($v0) -/* 0984CC 800978CC AC650000 */ sw $a1, ($v1) -/* 0984D0 800978D0 AC7F0004 */ sw $ra, 4($v1) -/* 0984D4 800978D4 8FA50130 */ lw $a1, 0x130($sp) -/* 0984D8 800978D8 3C010100 */ lui $at, 0x100 -/* 0984DC 800978DC 02417025 */ or $t6, $s2, $at -/* 0984E0 800978E0 26100008 */ addiu $s0, $s0, 8 -/* 0984E4 800978E4 02002025 */ move $a0, $s0 -/* 0984E8 800978E8 01D3C825 */ or $t9, $t6, $s3 -/* 0984EC 800978EC 00AB7821 */ addu $t7, $a1, $t3 -/* 0984F0 800978F0 000FC080 */ sll $t8, $t7, 2 -/* 0984F4 800978F4 AC990004 */ sw $t9, 4($a0) -/* 0984F8 800978F8 AC970000 */ sw $s7, ($a0) -/* 0984FC 800978FC 330E0FFF */ andi $t6, $t8, 0xfff -/* 098500 80097900 8FB8004C */ lw $t8, 0x4c($sp) -/* 098504 80097904 000ECB00 */ sll $t9, $t6, 0xc -/* 098508 80097908 3C01E400 */ lui $at, 0xe400 -/* 09850C 8009790C 26100008 */ addiu $s0, $s0, 8 -/* 098510 80097910 03217825 */ or $t7, $t9, $at -/* 098514 80097914 02001025 */ move $v0, $s0 -/* 098518 80097918 01F87025 */ or $t6, $t7, $t8 -/* 09851C 8009791C AC4E0000 */ sw $t6, ($v0) -/* 098520 80097920 8FAE0048 */ lw $t6, 0x48($sp) -/* 098524 80097924 0005C880 */ sll $t9, $a1, 2 -/* 098528 80097928 332F0FFF */ andi $t7, $t9, 0xfff -/* 09852C 8009792C 000FC300 */ sll $t8, $t7, 0xc -/* 098530 80097930 26100008 */ addiu $s0, $s0, 8 -/* 098534 80097934 030EC825 */ or $t9, $t8, $t6 -/* 098538 80097938 AC590004 */ sw $t9, 4($v0) -/* 09853C 8009793C 02001825 */ move $v1, $s0 -/* 098540 80097940 3C0FB300 */ lui $t7, 0xb300 -/* 098544 80097944 AC6F0000 */ sw $t7, ($v1) -/* 098548 80097948 8FB80044 */ lw $t8, 0x44($sp) -/* 09854C 8009794C 00147D40 */ sll $t7, $s4, 0x15 -/* 098550 80097950 26100008 */ addiu $s0, $s0, 8 -/* 098554 80097954 01F87025 */ or $t6, $t7, $t8 -/* 098558 80097958 AC6E0004 */ sw $t6, 4($v1) -/* 09855C 8009795C 02001025 */ move $v0, $s0 -/* 098560 80097960 3C19B200 */ lui $t9, 0xb200 -/* 098564 80097964 AC590000 */ sw $t9, ($v0) -/* 098568 80097968 8FAF0040 */ lw $t7, 0x40($sp) -/* 09856C 8009796C 26100008 */ addiu $s0, $s0, 8 -/* 098570 80097970 AC4F0004 */ sw $t7, 4($v0) -/* 098574 80097974 8FAF0128 */ lw $t7, 0x128($sp) -/* 098578 80097978 8FB40080 */ lw $s4, 0x80($sp) -/* 09857C 8009797C 8FB80130 */ lw $t8, 0x130($sp) -/* 098580 80097980 8FAE00F8 */ lw $t6, 0xf8($sp) -/* 098584 80097984 028F082B */ sltu $at, $s4, $t7 -/* 098588 80097988 030EC821 */ addu $t9, $t8, $t6 -/* 09858C 8009798C 1420FEFD */ bnez $at, .L80097584 -/* 098590 80097990 AFB90130 */ sw $t9, 0x130($sp) -/* 098594 80097994 01E01825 */ move $v1, $t7 -.L80097998: -/* 098598 80097998 8FB80104 */ lw $t8, 0x104($sp) -.L8009799C: -/* 09859C 8009799C 8FAD0084 */ lw $t5, 0x84($sp) -/* 0985A0 800979A0 8FAE0134 */ lw $t6, 0x134($sp) -/* 0985A4 800979A4 AFB80130 */ sw $t8, 0x130($sp) -/* 0985A8 800979A8 8FB8012C */ lw $t8, 0x12c($sp) -/* 0985AC 800979AC 8FB900F4 */ lw $t9, 0xf4($sp) -/* 0985B0 800979B0 01B8082B */ sltu $at, $t5, $t8 -/* 0985B4 800979B4 01D97821 */ addu $t7, $t6, $t9 -/* 0985B8 800979B8 1420FEDF */ bnez $at, .L80097538 -/* 0985BC 800979BC AFAF0134 */ sw $t7, 0x134($sp) -.L800979C0: -/* 0985C0 800979C0 26040008 */ addiu $a0, $s0, 8 -.L800979C4: -/* 0985C4 800979C4 3C0EE700 */ lui $t6, 0xe700 -/* 0985C8 800979C8 AE0E0000 */ sw $t6, ($s0) -/* 0985CC 800979CC AE000004 */ sw $zero, 4($s0) -/* 0985D0 800979D0 3C19BA00 */ lui $t9, (0xBA001402 >> 16) # lui $t9, 0xba00 -/* 0985D4 800979D4 37391402 */ ori $t9, (0xBA001402 & 0xFFFF) # ori $t9, $t9, 0x1402 -/* 0985D8 800979D8 AC990000 */ sw $t9, ($a0) -/* 0985DC 800979DC AC800004 */ sw $zero, 4($a0) -/* 0985E0 800979E0 24820008 */ addiu $v0, $a0, 8 -.L800979E4: -/* 0985E4 800979E4 8FBF003C */ lw $ra, 0x3c($sp) -/* 0985E8 800979E8 8FB00018 */ lw $s0, 0x18($sp) -/* 0985EC 800979EC 8FB1001C */ lw $s1, 0x1c($sp) -/* 0985F0 800979F0 8FB20020 */ lw $s2, 0x20($sp) -/* 0985F4 800979F4 8FB30024 */ lw $s3, 0x24($sp) -/* 0985F8 800979F8 8FB40028 */ lw $s4, 0x28($sp) -/* 0985FC 800979FC 8FB5002C */ lw $s5, 0x2c($sp) -/* 098600 80097A00 8FB60030 */ lw $s6, 0x30($sp) -/* 098604 80097A04 8FB70034 */ lw $s7, 0x34($sp) -/* 098608 80097A08 8FBE0038 */ lw $fp, 0x38($sp) -/* 09860C 80097A0C 03E00008 */ jr $ra -/* 098610 80097A10 27BD0110 */ addiu $sp, $sp, 0x110 diff --git a/asm/non_matchings/code_80091750/func_80099184.s b/asm/non_matchings/code_80091750/func_80099184.s deleted file mode 100644 index 9df413353a..0000000000 --- a/asm/non_matchings/code_80091750/func_80099184.s +++ /dev/null @@ -1,146 +0,0 @@ -glabel func_80099184 -/* 099D84 80099184 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 099D88 80099188 AFBF0034 */ sw $ra, 0x34($sp) -/* 099D8C 8009918C AFB60030 */ sw $s6, 0x30($sp) -/* 099D90 80099190 AFB5002C */ sw $s5, 0x2c($sp) -/* 099D94 80099194 AFB40028 */ sw $s4, 0x28($sp) -/* 099D98 80099198 AFB30024 */ sw $s3, 0x24($sp) -/* 099D9C 8009919C AFB20020 */ sw $s2, 0x20($sp) -/* 099DA0 800991A0 AFB1001C */ sw $s1, 0x1c($sp) -/* 099DA4 800991A4 0C026449 */ jal segmented_to_virtual_dupe -/* 099DA8 800991A8 AFB00018 */ sw $s0, 0x18($sp) -/* 099DAC 800991AC 8C4E0004 */ lw $t6, 4($v0) -/* 099DB0 800991B0 00408825 */ move $s1, $v0 -/* 099DB4 800991B4 24160003 */ li $s6, 3 -/* 099DB8 800991B8 11C0006C */ beqz $t6, .L8009936C -/* 099DBC 800991BC 3C158019 */ lui $s5, %hi(D_8018D9B0) # $s5, 0x8019 -/* 099DC0 800991C0 3C148019 */ lui $s4, %hi(D_8018D9B4) # $s4, 0x8019 -/* 099DC4 800991C4 3C138019 */ lui $s3, %hi(gNumD_8018E118Entries) # $s3, 0x8019 -/* 099DC8 800991C8 3C128019 */ lui $s2, %hi(gD_8018E118TotalSize) # $s2, 0x8019 -/* 099DCC 800991CC 3C108019 */ lui $s0, %hi(D_8018E118) # $s0, 0x8019 -/* 099DD0 800991D0 2610E118 */ addiu $s0, %lo(D_8018E118) # addiu $s0, $s0, -0x1ee8 -/* 099DD4 800991D4 2652E110 */ addiu $s2, %lo(gD_8018E118TotalSize) # addiu $s2, $s2, -0x1ef0 -/* 099DD8 800991D8 2673E758 */ addiu $s3, %lo(gNumD_8018E118Entries) # addiu $s3, $s3, -0x18a8 -/* 099DDC 800991DC 2694D9B4 */ addiu $s4, %lo(D_8018D9B4) # addiu $s4, $s4, -0x264c -/* 099DE0 800991E0 26B5D9B0 */ addiu $s5, %lo(D_8018D9B0) # addiu $s5, $s5, -0x2650 -/* 099DE4 800991E4 8E630000 */ lw $v1, ($s3) -.L800991E8: -/* 099DE8 800991E8 00002825 */ move $a1, $zero -/* 099DEC 800991EC 00001025 */ move $v0, $zero -/* 099DF0 800991F0 1860000D */ blez $v1, .L80099228 -/* 099DF4 800991F4 00000000 */ nop -/* 099DF8 800991F8 8E240004 */ lw $a0, 4($s1) -/* 099DFC 800991FC 000278C0 */ sll $t7, $v0, 3 -.L80099200: -/* 099E00 80099200 020FC021 */ addu $t8, $s0, $t7 -/* 099E04 80099204 8F190000 */ lw $t9, ($t8) -/* 099E08 80099208 24420001 */ addiu $v0, $v0, 1 -/* 099E0C 8009920C 0043082A */ slt $at, $v0, $v1 -/* 099E10 80099210 17240003 */ bne $t9, $a0, .L80099220 -/* 099E14 80099214 00000000 */ nop -/* 099E18 80099218 10000003 */ b .L80099228 -/* 099E1C 8009921C 24050001 */ li $a1, 1 -.L80099220: -/* 099E20 80099220 5420FFF7 */ bnel $at, $zero, .L80099200 -/* 099E24 80099224 000278C0 */ sll $t7, $v0, 3 -.L80099228: -/* 099E28 80099228 54A0004D */ bnel $a1, $zero, .L80099360 -/* 099E2C 8009922C 8E2A0018 */ lw $t2, 0x18($s1) -/* 099E30 80099230 86280000 */ lh $t0, ($s1) -/* 099E34 80099234 8E240004 */ lw $a0, 4($s1) -/* 099E38 80099238 56C80022 */ bnel $s6, $t0, .L800992C4 -/* 099E3C 8009923C 962F000A */ lhu $t7, 0xa($s1) -/* 099E40 80099240 96220010 */ lhu $v0, 0x10($s1) -/* 099E44 80099244 24051000 */ li $a1, 4096 -/* 099E48 80099248 10400003 */ beqz $v0, .L80099258 -/* 099E4C 8009924C 00000000 */ nop -/* 099E50 80099250 10000001 */ b .L80099258 -/* 099E54 80099254 3045FFFF */ andi $a1, $v0, 0xffff -.L80099258: -/* 099E58 80099258 00A01025 */ move $v0, $a1 -/* 099E5C 8009925C 04410004 */ bgez $v0, .L80099270 -/* 099E60 80099260 30490007 */ andi $t1, $v0, 7 -/* 099E64 80099264 11200002 */ beqz $t1, .L80099270 -/* 099E68 80099268 00000000 */ nop -/* 099E6C 8009926C 2529FFF8 */ addiu $t1, $t1, -8 -.L80099270: -/* 099E70 80099270 11200009 */ beqz $t1, .L80099298 -/* 099E74 80099274 00000000 */ nop -/* 099E78 80099278 04410003 */ bgez $v0, .L80099288 -/* 099E7C 8009927C 000228C3 */ sra $a1, $v0, 3 -/* 099E80 80099280 24410007 */ addiu $at, $v0, 7 -/* 099E84 80099284 000128C3 */ sra $a1, $at, 3 -.L80099288: -/* 099E88 80099288 000550C0 */ sll $t2, $a1, 3 -/* 099E8C 8009928C 25450008 */ addiu $a1, $t2, 8 -/* 099E90 80099290 30ABFFFF */ andi $t3, $a1, 0xffff -/* 099E94 80099294 01602825 */ move $a1, $t3 -.L80099298: -/* 099E98 80099298 0C026400 */ jal dma_copy_base_729a30 -/* 099E9C 8009929C 8E860000 */ lw $a2, ($s4) -/* 099EA0 800992A0 8E4C0000 */ lw $t4, ($s2) -/* 099EA4 800992A4 8EAE0000 */ lw $t6, ($s5) -/* 099EA8 800992A8 8E840000 */ lw $a0, ($s4) -/* 099EAC 800992AC 000C6840 */ sll $t5, $t4, 1 -/* 099EB0 800992B0 0C010034 */ jal mio0decode -/* 099EB4 800992B4 01AE2821 */ addu $a1, $t5, $t6 -/* 099EB8 800992B8 1000000D */ b .L800992F0 -/* 099EBC 800992BC 8E6C0000 */ lw $t4, ($s3) -/* 099EC0 800992C0 962F000A */ lhu $t7, 0xa($s1) -.L800992C4: -/* 099EC4 800992C4 96380008 */ lhu $t8, 8($s1) -/* 099EC8 800992C8 8E480000 */ lw $t0, ($s2) -/* 099ECC 800992CC 8EAA0000 */ lw $t2, ($s5) -/* 099ED0 800992D0 01F80019 */ multu $t7, $t8 -/* 099ED4 800992D4 00084840 */ sll $t1, $t0, 1 -/* 099ED8 800992D8 012A3021 */ addu $a2, $t1, $t2 -/* 099EDC 800992DC 00002812 */ mflo $a1 -/* 099EE0 800992E0 0005C840 */ sll $t9, $a1, 1 -/* 099EE4 800992E4 0C026400 */ jal dma_copy_base_729a30 -/* 099EE8 800992E8 03202825 */ move $a1, $t9 -/* 099EEC 800992EC 8E6C0000 */ lw $t4, ($s3) -.L800992F0: -/* 099EF0 800992F0 8E2B0004 */ lw $t3, 4($s1) -/* 099EF4 800992F4 000C68C0 */ sll $t5, $t4, 3 -/* 099EF8 800992F8 020D7021 */ addu $t6, $s0, $t5 -/* 099EFC 800992FC ADCB0000 */ sw $t3, ($t6) -/* 099F00 80099300 8E780000 */ lw $t8, ($s3) -/* 099F04 80099304 8E4F0000 */ lw $t7, ($s2) -/* 099F08 80099308 0018C8C0 */ sll $t9, $t8, 3 -/* 099F0C 8009930C 02194021 */ addu $t0, $s0, $t9 -/* 099F10 80099310 AD0F0004 */ sw $t7, 4($t0) -/* 099F14 80099314 962A0008 */ lhu $t2, 8($s1) -/* 099F18 80099318 9629000A */ lhu $t1, 0xa($s1) -/* 099F1C 8009931C 8E4D0000 */ lw $t5, ($s2) -/* 099F20 80099320 8E680000 */ lw $t0, ($s3) -/* 099F24 80099324 012A0019 */ multu $t1, $t2 -/* 099F28 80099328 25090001 */ addiu $t1, $t0, 1 -/* 099F2C 8009932C AE690000 */ sw $t1, ($s3) -/* 099F30 80099330 00006012 */ mflo $t4 -/* 099F34 80099334 01AC5821 */ addu $t3, $t5, $t4 -/* 099F38 80099338 01607025 */ move $t6, $t3 -/* 099F3C 8009933C AE4B0000 */ sw $t3, ($s2) -/* 099F40 80099340 05C10003 */ bgez $t6, .L80099350 -/* 099F44 80099344 000EC0C3 */ sra $t8, $t6, 3 -/* 099F48 80099348 25C10007 */ addiu $at, $t6, 7 -/* 099F4C 8009934C 0001C0C3 */ sra $t8, $at, 3 -.L80099350: -/* 099F50 80099350 0018C8C0 */ sll $t9, $t8, 3 -/* 099F54 80099354 272F0008 */ addiu $t7, $t9, 8 -/* 099F58 80099358 AE4F0000 */ sw $t7, ($s2) -/* 099F5C 8009935C 8E2A0018 */ lw $t2, 0x18($s1) -.L80099360: -/* 099F60 80099360 26310014 */ addiu $s1, $s1, 0x14 -/* 099F64 80099364 5540FFA0 */ bnel $t2, $zero, .L800991E8 -/* 099F68 80099368 8E630000 */ lw $v1, ($s3) -.L8009936C: -/* 099F6C 8009936C 8FBF0034 */ lw $ra, 0x34($sp) -/* 099F70 80099370 8FB00018 */ lw $s0, 0x18($sp) -/* 099F74 80099374 8FB1001C */ lw $s1, 0x1c($sp) -/* 099F78 80099378 8FB20020 */ lw $s2, 0x20($sp) -/* 099F7C 8009937C 8FB30024 */ lw $s3, 0x24($sp) -/* 099F80 80099380 8FB40028 */ lw $s4, 0x28($sp) -/* 099F84 80099384 8FB5002C */ lw $s5, 0x2c($sp) -/* 099F88 80099388 8FB60030 */ lw $s6, 0x30($sp) -/* 099F8C 8009938C 03E00008 */ jr $ra -/* 099F90 80099390 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/asm/non_matchings/code_80091750/func_80099394.s b/asm/non_matchings/code_80091750/func_80099394.s deleted file mode 100644 index 947f8a6970..0000000000 --- a/asm/non_matchings/code_80091750/func_80099394.s +++ /dev/null @@ -1,112 +0,0 @@ -glabel func_80099394 -/* 099F94 80099394 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 099F98 80099398 AFBF0034 */ sw $ra, 0x34($sp) -/* 099F9C 8009939C AFB60030 */ sw $s6, 0x30($sp) -/* 099FA0 800993A0 AFB5002C */ sw $s5, 0x2c($sp) -/* 099FA4 800993A4 AFB40028 */ sw $s4, 0x28($sp) -/* 099FA8 800993A8 AFB30024 */ sw $s3, 0x24($sp) -/* 099FAC 800993AC AFB20020 */ sw $s2, 0x20($sp) -/* 099FB0 800993B0 AFB1001C */ sw $s1, 0x1c($sp) -/* 099FB4 800993B4 0C026449 */ jal segmented_to_virtual_dupe -/* 099FB8 800993B8 AFB00018 */ sw $s0, 0x18($sp) -/* 099FBC 800993BC 8C4E0004 */ lw $t6, 4($v0) -/* 099FC0 800993C0 3C168019 */ lui $s6, %hi(D_8018D9B0) # $s6, 0x8019 -/* 099FC4 800993C4 00409025 */ move $s2, $v0 -/* 099FC8 800993C8 11C0004E */ beqz $t6, .L80099504 -/* 099FCC 800993CC 26D6D9B0 */ addiu $s6, %lo(D_8018D9B0) # addiu $s6, $s6, -0x2650 -/* 099FD0 800993D0 3C148019 */ lui $s4, %hi(gNumD_8018E118Entries) # $s4, 0x8019 -/* 099FD4 800993D4 3C138019 */ lui $s3, %hi(gD_8018E118TotalSize) # $s3, 0x8019 -/* 099FD8 800993D8 3C118019 */ lui $s1, %hi(D_8018E118) # $s1, 0x8019 -/* 099FDC 800993DC 2631E118 */ addiu $s1, %lo(D_8018E118) # addiu $s1, $s1, -0x1ee8 -/* 099FE0 800993E0 2673E110 */ addiu $s3, %lo(gD_8018E118TotalSize) # addiu $s3, $s3, -0x1ef0 -/* 099FE4 800993E4 2694E758 */ addiu $s4, %lo(gNumD_8018E118Entries) # addiu $s4, $s4, -0x18a8 -/* 099FE8 800993E8 24150005 */ li $s5, 5 -/* 099FEC 800993EC 8E830000 */ lw $v1, ($s4) -.L800993F0: -/* 099FF0 800993F0 00002025 */ move $a0, $zero -/* 099FF4 800993F4 00001025 */ move $v0, $zero -/* 099FF8 800993F8 1860000D */ blez $v1, .L80099430 -/* 099FFC 800993FC 00000000 */ nop -/* 09A000 80099400 8E500004 */ lw $s0, 4($s2) -/* 09A004 80099404 000278C0 */ sll $t7, $v0, 3 -.L80099408: -/* 09A008 80099408 022FC021 */ addu $t8, $s1, $t7 -/* 09A00C 8009940C 8F190000 */ lw $t9, ($t8) -/* 09A010 80099410 24420001 */ addiu $v0, $v0, 1 -/* 09A014 80099414 0043082A */ slt $at, $v0, $v1 -/* 09A018 80099418 17300003 */ bne $t9, $s0, .L80099428 -/* 09A01C 8009941C 00000000 */ nop -/* 09A020 80099420 10000003 */ b .L80099430 -/* 09A024 80099424 24040001 */ li $a0, 1 -.L80099428: -/* 09A028 80099428 5420FFF7 */ bnel $at, $zero, .L80099408 -/* 09A02C 8009942C 000278C0 */ sll $t7, $v0, 3 -.L80099430: -/* 09A030 80099430 54800031 */ bnel $a0, $zero, .L800994F8 -/* 09A034 80099434 8E4C0018 */ lw $t4, 0x18($s2) -/* 09A038 80099438 86480000 */ lh $t0, ($s2) -/* 09A03C 8009943C 8E500004 */ lw $s0, 4($s2) -/* 09A040 80099440 56A80013 */ bnel $s5, $t0, .L80099490 -/* 09A044 80099444 000378C0 */ sll $t7, $v1, 3 -/* 09A048 80099448 9649000A */ lhu $t1, 0xa($s2) -/* 09A04C 8009944C 964A0008 */ lhu $t2, 8($s2) -/* 09A050 80099450 8E6C0000 */ lw $t4, ($s3) -/* 09A054 80099454 8ECE0000 */ lw $t6, ($s6) -/* 09A058 80099458 012A0019 */ multu $t1, $t2 -/* 09A05C 8009945C 000C6840 */ sll $t5, $t4, 1 -/* 09A060 80099460 02002025 */ move $a0, $s0 -/* 09A064 80099464 01AE3021 */ addu $a2, $t5, $t6 -/* 09A068 80099468 00002812 */ mflo $a1 -/* 09A06C 8009946C 04A10003 */ bgez $a1, .L8009947C -/* 09A070 80099470 00055843 */ sra $t3, $a1, 1 -/* 09A074 80099474 24A10001 */ addiu $at, $a1, 1 -/* 09A078 80099478 00015843 */ sra $t3, $at, 1 -.L8009947C: -/* 09A07C 8009947C 0C026400 */ jal dma_copy_base_729a30 -/* 09A080 80099480 01602825 */ move $a1, $t3 -/* 09A084 80099484 8E830000 */ lw $v1, ($s4) -/* 09A088 80099488 8E500004 */ lw $s0, 4($s2) -/* 09A08C 8009948C 000378C0 */ sll $t7, $v1, 3 -.L80099490: -/* 09A090 80099490 022FC021 */ addu $t8, $s1, $t7 -/* 09A094 80099494 AF100000 */ sw $s0, ($t8) -/* 09A098 80099498 8E880000 */ lw $t0, ($s4) -/* 09A09C 8009949C 8E790000 */ lw $t9, ($s3) -/* 09A0A0 800994A0 000848C0 */ sll $t1, $t0, 3 -/* 09A0A4 800994A4 02295021 */ addu $t2, $s1, $t1 -/* 09A0A8 800994A8 AD590004 */ sw $t9, 4($t2) -/* 09A0AC 800994AC 964C0008 */ lhu $t4, 8($s2) -/* 09A0B0 800994B0 964B000A */ lhu $t3, 0xa($s2) -/* 09A0B4 800994B4 8E6E0000 */ lw $t6, ($s3) -/* 09A0B8 800994B8 8E8A0000 */ lw $t2, ($s4) -/* 09A0BC 800994BC 016C0019 */ multu $t3, $t4 -/* 09A0C0 800994C0 254B0001 */ addiu $t3, $t2, 1 -/* 09A0C4 800994C4 AE8B0000 */ sw $t3, ($s4) -/* 09A0C8 800994C8 00006812 */ mflo $t5 -/* 09A0CC 800994CC 01CD7821 */ addu $t7, $t6, $t5 -/* 09A0D0 800994D0 01E0C025 */ move $t8, $t7 -/* 09A0D4 800994D4 AE6F0000 */ sw $t7, ($s3) -/* 09A0D8 800994D8 07010003 */ bgez $t8, .L800994E8 -/* 09A0DC 800994DC 001840C3 */ sra $t0, $t8, 3 -/* 09A0E0 800994E0 27010007 */ addiu $at, $t8, 7 -/* 09A0E4 800994E4 000140C3 */ sra $t0, $at, 3 -.L800994E8: -/* 09A0E8 800994E8 000848C0 */ sll $t1, $t0, 3 -/* 09A0EC 800994EC 25390008 */ addiu $t9, $t1, 8 -/* 09A0F0 800994F0 AE790000 */ sw $t9, ($s3) -/* 09A0F4 800994F4 8E4C0018 */ lw $t4, 0x18($s2) -.L800994F8: -/* 09A0F8 800994F8 26520014 */ addiu $s2, $s2, 0x14 -/* 09A0FC 800994FC 5580FFBC */ bnel $t4, $zero, .L800993F0 -/* 09A100 80099500 8E830000 */ lw $v1, ($s4) -.L80099504: -/* 09A104 80099504 8FBF0034 */ lw $ra, 0x34($sp) -/* 09A108 80099508 8FB00018 */ lw $s0, 0x18($sp) -/* 09A10C 8009950C 8FB1001C */ lw $s1, 0x1c($sp) -/* 09A110 80099510 8FB20020 */ lw $s2, 0x20($sp) -/* 09A114 80099514 8FB30024 */ lw $s3, 0x24($sp) -/* 09A118 80099518 8FB40028 */ lw $s4, 0x28($sp) -/* 09A11C 8009951C 8FB5002C */ lw $s5, 0x2c($sp) -/* 09A120 80099520 8FB60030 */ lw $s6, 0x30($sp) -/* 09A124 80099524 03E00008 */ jr $ra -/* 09A128 80099528 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/asm/non_matchings/code_80091750/func_8009952C.s b/asm/non_matchings/code_80091750/func_8009952C.s deleted file mode 100644 index de792ba297..0000000000 --- a/asm/non_matchings/code_80091750/func_8009952C.s +++ /dev/null @@ -1,100 +0,0 @@ -glabel func_8009952C -/* 09A12C 8009952C 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 09A130 80099530 AFBF002C */ sw $ra, 0x2c($sp) -/* 09A134 80099534 AFB50028 */ sw $s5, 0x28($sp) -/* 09A138 80099538 AFB40024 */ sw $s4, 0x24($sp) -/* 09A13C 8009953C AFB30020 */ sw $s3, 0x20($sp) -/* 09A140 80099540 AFB2001C */ sw $s2, 0x1c($sp) -/* 09A144 80099544 AFB10018 */ sw $s1, 0x18($sp) -/* 09A148 80099548 0C026449 */ jal segmented_to_virtual_dupe -/* 09A14C 8009954C AFB00014 */ sw $s0, 0x14($sp) -/* 09A150 80099550 8C4E0004 */ lw $t6, 4($v0) -/* 09A154 80099554 3C158019 */ lui $s5, %hi(D_8018D9B0) # $s5, 0x8019 -/* 09A158 80099558 00408825 */ move $s1, $v0 -/* 09A15C 8009955C 11C00046 */ beqz $t6, .L80099678 -/* 09A160 80099560 26B5D9B0 */ addiu $s5, %lo(D_8018D9B0) # addiu $s5, $s5, -0x2650 -/* 09A164 80099564 3C148019 */ lui $s4, %hi(D_8018D9B4) # $s4, 0x8019 -/* 09A168 80099568 3C138019 */ lui $s3, %hi(gNumD_8018E118Entries) # $s3, 0x8019 -/* 09A16C 8009956C 3C128019 */ lui $s2, %hi(gD_8018E118TotalSize) # $s2, 0x8019 -/* 09A170 80099570 3C108019 */ lui $s0, %hi(D_8018E118) # $s0, 0x8019 -/* 09A174 80099574 2610E118 */ addiu $s0, %lo(D_8018E118) # addiu $s0, $s0, -0x1ee8 -/* 09A178 80099578 2652E110 */ addiu $s2, %lo(gD_8018E118TotalSize) # addiu $s2, $s2, -0x1ef0 -/* 09A17C 8009957C 2673E758 */ addiu $s3, %lo(gNumD_8018E118Entries) # addiu $s3, $s3, -0x18a8 -/* 09A180 80099580 2694D9B4 */ addiu $s4, %lo(D_8018D9B4) # addiu $s4, $s4, -0x264c -/* 09A184 80099584 8E630000 */ lw $v1, ($s3) -.L80099588: -/* 09A188 80099588 00002825 */ move $a1, $zero -/* 09A18C 8009958C 00001025 */ move $v0, $zero -/* 09A190 80099590 1860000D */ blez $v1, .L800995C8 -/* 09A194 80099594 00000000 */ nop -/* 09A198 80099598 8E240004 */ lw $a0, 4($s1) -/* 09A19C 8009959C 000278C0 */ sll $t7, $v0, 3 -.L800995A0: -/* 09A1A0 800995A0 020FC021 */ addu $t8, $s0, $t7 -/* 09A1A4 800995A4 8F190000 */ lw $t9, ($t8) -/* 09A1A8 800995A8 24420001 */ addiu $v0, $v0, 1 -/* 09A1AC 800995AC 0043082A */ slt $at, $v0, $v1 -/* 09A1B0 800995B0 17240003 */ bne $t9, $a0, .L800995C0 -/* 09A1B4 800995B4 00000000 */ nop -/* 09A1B8 800995B8 10000003 */ b .L800995C8 -/* 09A1BC 800995BC 24050001 */ li $a1, 1 -.L800995C0: -/* 09A1C0 800995C0 5420FFF7 */ bnel $at, $zero, .L800995A0 -/* 09A1C4 800995C4 000278C0 */ sll $t7, $v0, 3 -.L800995C8: -/* 09A1C8 800995C8 54A00028 */ bnel $a1, $zero, .L8009966C -/* 09A1CC 800995CC 8E2A0018 */ lw $t2, 0x18($s1) -/* 09A1D0 800995D0 8E240004 */ lw $a0, 4($s1) -/* 09A1D4 800995D4 34058000 */ li $a1, 32768 -/* 09A1D8 800995D8 0C026400 */ jal dma_copy_base_729a30 -/* 09A1DC 800995DC 8E860000 */ lw $a2, ($s4) -/* 09A1E0 800995E0 8E480000 */ lw $t0, ($s2) -/* 09A1E4 800995E4 8EAA0000 */ lw $t2, ($s5) -/* 09A1E8 800995E8 8E840000 */ lw $a0, ($s4) -/* 09A1EC 800995EC 00084840 */ sll $t1, $t0, 1 -/* 09A1F0 800995F0 0C010034 */ jal mio0decode -/* 09A1F4 800995F4 012A2821 */ addu $a1, $t1, $t2 -/* 09A1F8 800995F8 8E6C0000 */ lw $t4, ($s3) -/* 09A1FC 800995FC 8E2B0004 */ lw $t3, 4($s1) -/* 09A200 80099600 000C68C0 */ sll $t5, $t4, 3 -/* 09A204 80099604 020D7021 */ addu $t6, $s0, $t5 -/* 09A208 80099608 ADCB0000 */ sw $t3, ($t6) -/* 09A20C 8009960C 8E780000 */ lw $t8, ($s3) -/* 09A210 80099610 8E4F0000 */ lw $t7, ($s2) -/* 09A214 80099614 0018C8C0 */ sll $t9, $t8, 3 -/* 09A218 80099618 02194021 */ addu $t0, $s0, $t9 -/* 09A21C 8009961C AD0F0004 */ sw $t7, 4($t0) -/* 09A220 80099620 962A0008 */ lhu $t2, 8($s1) -/* 09A224 80099624 9629000A */ lhu $t1, 0xa($s1) -/* 09A228 80099628 8E4D0000 */ lw $t5, ($s2) -/* 09A22C 8009962C 8E680000 */ lw $t0, ($s3) -/* 09A230 80099630 012A0019 */ multu $t1, $t2 -/* 09A234 80099634 25090001 */ addiu $t1, $t0, 1 -/* 09A238 80099638 AE690000 */ sw $t1, ($s3) -/* 09A23C 8009963C 00006012 */ mflo $t4 -/* 09A240 80099640 01AC5821 */ addu $t3, $t5, $t4 -/* 09A244 80099644 01607025 */ move $t6, $t3 -/* 09A248 80099648 AE4B0000 */ sw $t3, ($s2) -/* 09A24C 8009964C 05C10003 */ bgez $t6, .L8009965C -/* 09A250 80099650 000EC0C3 */ sra $t8, $t6, 3 -/* 09A254 80099654 25C10007 */ addiu $at, $t6, 7 -/* 09A258 80099658 0001C0C3 */ sra $t8, $at, 3 -.L8009965C: -/* 09A25C 8009965C 0018C8C0 */ sll $t9, $t8, 3 -/* 09A260 80099660 272F0008 */ addiu $t7, $t9, 8 -/* 09A264 80099664 AE4F0000 */ sw $t7, ($s2) -/* 09A268 80099668 8E2A0018 */ lw $t2, 0x18($s1) -.L8009966C: -/* 09A26C 8009966C 26310014 */ addiu $s1, $s1, 0x14 -/* 09A270 80099670 5540FFC5 */ bnel $t2, $zero, .L80099588 -/* 09A274 80099674 8E630000 */ lw $v1, ($s3) -.L80099678: -/* 09A278 80099678 8FBF002C */ lw $ra, 0x2c($sp) -/* 09A27C 8009967C 8FB00014 */ lw $s0, 0x14($sp) -/* 09A280 80099680 8FB10018 */ lw $s1, 0x18($sp) -/* 09A284 80099684 8FB2001C */ lw $s2, 0x1c($sp) -/* 09A288 80099688 8FB30020 */ lw $s3, 0x20($sp) -/* 09A28C 8009968C 8FB40024 */ lw $s4, 0x24($sp) -/* 09A290 80099690 8FB50028 */ lw $s5, 0x28($sp) -/* 09A294 80099694 03E00008 */ jr $ra -/* 09A298 80099698 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/non_matchings/code_80091750/func_800996BC.s b/asm/non_matchings/code_80091750/func_800996BC.s deleted file mode 100644 index c38ba4f972..0000000000 --- a/asm/non_matchings/code_80091750/func_800996BC.s +++ /dev/null @@ -1,189 +0,0 @@ -glabel func_800996BC -/* 09A2BC 800996BC 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 09A2C0 800996C0 AFBF003C */ sw $ra, 0x3c($sp) -/* 09A2C4 800996C4 AFB20020 */ sw $s2, 0x20($sp) -/* 09A2C8 800996C8 00A09025 */ move $s2, $a1 -/* 09A2CC 800996CC AFBE0038 */ sw $fp, 0x38($sp) -/* 09A2D0 800996D0 AFB70034 */ sw $s7, 0x34($sp) -/* 09A2D4 800996D4 AFB60030 */ sw $s6, 0x30($sp) -/* 09A2D8 800996D8 AFB5002C */ sw $s5, 0x2c($sp) -/* 09A2DC 800996DC AFB40028 */ sw $s4, 0x28($sp) -/* 09A2E0 800996E0 AFB30024 */ sw $s3, 0x24($sp) -/* 09A2E4 800996E4 AFB1001C */ sw $s1, 0x1c($sp) -/* 09A2E8 800996E8 0C026449 */ jal segmented_to_virtual_dupe -/* 09A2EC 800996EC AFB00018 */ sw $s0, 0x18($sp) -/* 09A2F0 800996F0 8C4E0004 */ lw $t6, 4($v0) -/* 09A2F4 800996F4 00408025 */ move $s0, $v0 -/* 09A2F8 800996F8 241E0002 */ li $fp, 2 -/* 09A2FC 800996FC 11C0008A */ beqz $t6, .L80099928 -/* 09A300 80099700 2417FFFF */ li $s7, -1 -/* 09A304 80099704 3C158019 */ lui $s5, %hi(D_8018D9B4) # $s5, 0x8019 -/* 09A308 80099708 3C148019 */ lui $s4, %hi(gNumD_8018E118Entries) # $s4, 0x8019 -/* 09A30C 8009970C 3C138019 */ lui $s3, %hi(gD_8018E118TotalSize) # $s3, 0x8019 -/* 09A310 80099710 3C118019 */ lui $s1, %hi(D_8018E118) # $s1, 0x8019 -/* 09A314 80099714 2631E118 */ addiu $s1, %lo(D_8018E118) # addiu $s1, $s1, -0x1ee8 -/* 09A318 80099718 2673E110 */ addiu $s3, %lo(gD_8018E118TotalSize) # addiu $s3, $s3, -0x1ef0 -/* 09A31C 8009971C 2694E758 */ addiu $s4, %lo(gNumD_8018E118Entries) # addiu $s4, $s4, -0x18a8 -/* 09A320 80099720 26B5D9B4 */ addiu $s5, %lo(D_8018D9B4) # addiu $s5, $s5, -0x264c -/* 09A324 80099724 24160001 */ li $s6, 1 -/* 09A328 80099728 8E830000 */ lw $v1, ($s4) -.L8009972C: -/* 09A32C 8009972C 00002825 */ move $a1, $zero -/* 09A330 80099730 00001025 */ move $v0, $zero -/* 09A334 80099734 1860000D */ blez $v1, .L8009976C -/* 09A338 80099738 00000000 */ nop -/* 09A33C 8009973C 8E040004 */ lw $a0, 4($s0) -/* 09A340 80099740 000278C0 */ sll $t7, $v0, 3 -.L80099744: -/* 09A344 80099744 022FC021 */ addu $t8, $s1, $t7 -/* 09A348 80099748 8F190000 */ lw $t9, ($t8) -/* 09A34C 8009974C 24420001 */ addiu $v0, $v0, 1 -/* 09A350 80099750 0043082A */ slt $at, $v0, $v1 -/* 09A354 80099754 17240003 */ bne $t9, $a0, .L80099764 -/* 09A358 80099758 00000000 */ nop -/* 09A35C 8009975C 10000003 */ b .L8009976C -/* 09A360 80099760 02C02825 */ move $a1, $s6 -.L80099764: -/* 09A364 80099764 5420FFF7 */ bnel $at, $zero, .L80099744 -/* 09A368 80099768 000278C0 */ sll $t7, $v0, 3 -.L8009976C: -/* 09A36C 8009976C 50A00004 */ beql $a1, $zero, .L80099780 -/* 09A370 80099770 96020010 */ lhu $v0, 0x10($s0) -/* 09A374 80099774 5A400069 */ blezl $s2, .L8009991C -/* 09A378 80099778 8E0F0018 */ lw $t7, 0x18($s0) -/* 09A37C 8009977C 96020010 */ lhu $v0, 0x10($s0) -.L80099780: -/* 09A380 80099780 24051000 */ li $a1, 4096 -/* 09A384 80099784 10400003 */ beqz $v0, .L80099794 -/* 09A388 80099788 00000000 */ nop -/* 09A38C 8009978C 10000001 */ b .L80099794 -/* 09A390 80099790 3045FFFF */ andi $a1, $v0, 0xffff -.L80099794: -/* 09A394 80099794 00A01025 */ move $v0, $a1 -/* 09A398 80099798 04410004 */ bgez $v0, .L800997AC -/* 09A39C 8009979C 30480007 */ andi $t0, $v0, 7 -/* 09A3A0 800997A0 11000002 */ beqz $t0, .L800997AC -/* 09A3A4 800997A4 00000000 */ nop -/* 09A3A8 800997A8 2508FFF8 */ addiu $t0, $t0, -8 -.L800997AC: -/* 09A3AC 800997AC 11000009 */ beqz $t0, .L800997D4 -/* 09A3B0 800997B0 00000000 */ nop -/* 09A3B4 800997B4 04410003 */ bgez $v0, .L800997C4 -/* 09A3B8 800997B8 000228C3 */ sra $a1, $v0, 3 -/* 09A3BC 800997BC 24410007 */ addiu $at, $v0, 7 -/* 09A3C0 800997C0 000128C3 */ sra $a1, $at, 3 -.L800997C4: -/* 09A3C4 800997C4 000548C0 */ sll $t1, $a1, 3 -/* 09A3C8 800997C8 25250008 */ addiu $a1, $t1, 8 -/* 09A3CC 800997CC 30AAFFFF */ andi $t2, $a1, 0xffff -/* 09A3D0 800997D0 01402825 */ move $a1, $t2 -.L800997D4: -/* 09A3D4 800997D4 5257000A */ beql $s2, $s7, .L80099800 -/* 09A3D8 800997D8 8E040004 */ lw $a0, 4($s0) -/* 09A3DC 800997DC 5240000D */ beql $s2, $zero, .L80099814 -/* 09A3E0 800997E0 8E040004 */ lw $a0, 4($s0) -/* 09A3E4 800997E4 52560006 */ beql $s2, $s6, .L80099800 -/* 09A3E8 800997E8 8E040004 */ lw $a0, 4($s0) -/* 09A3EC 800997EC 525E0009 */ beql $s2, $fp, .L80099814 -/* 09A3F0 800997F0 8E040004 */ lw $a0, 4($s0) -/* 09A3F4 800997F4 10000009 */ b .L8009981C -/* 09A3F8 800997F8 00000000 */ nop -/* 09A3FC 800997FC 8E040004 */ lw $a0, 4($s0) -.L80099800: -/* 09A400 80099800 0C026400 */ jal dma_copy_base_729a30 -/* 09A404 80099804 8EA60000 */ lw $a2, ($s5) -/* 09A408 80099808 10000004 */ b .L8009981C -/* 09A40C 8009980C 00000000 */ nop -/* 09A410 80099810 8E040004 */ lw $a0, 4($s0) -.L80099814: -/* 09A414 80099814 0C026422 */ jal dma_copy_base_7fa3c0 -/* 09A418 80099818 8EA60000 */ lw $a2, ($s5) -.L8009981C: -/* 09A41C 8009981C 1257000A */ beq $s2, $s7, .L80099848 -/* 09A420 80099820 3C0D8019 */ lui $t5, %hi(D_8018D9B0) # $t5, 0x8019 -/* 09A424 80099824 12400011 */ beqz $s2, .L8009986C -/* 09A428 80099828 3C058019 */ lui $a1, %hi(D_8018D9B8) # 0x8019 -/* 09A42C 8009982C 52560007 */ beql $s2, $s6, .L8009984C -/* 09A430 80099830 8E6B0000 */ lw $t3, ($s3) -/* 09A434 80099834 525E000E */ beql $s2, $fp, .L80099870 -/* 09A438 80099838 860E0000 */ lh $t6, ($s0) -/* 09A43C 8009983C 8E830000 */ lw $v1, ($s4) -/* 09A440 80099840 1000001B */ b .L800998B0 -/* 09A444 80099844 8E040004 */ lw $a0, 4($s0) -.L80099848: -/* 09A448 80099848 8E6B0000 */ lw $t3, ($s3) -.L8009984C: -/* 09A44C 8009984C 8DADD9B0 */ lw $t5, %lo(D_8018D9B0)($t5) -/* 09A450 80099850 8EA40000 */ lw $a0, ($s5) -/* 09A454 80099854 000B6040 */ sll $t4, $t3, 1 -/* 09A458 80099858 0C010034 */ jal mio0decode -/* 09A45C 8009985C 018D2821 */ addu $a1, $t4, $t5 -/* 09A460 80099860 8E830000 */ lw $v1, ($s4) -/* 09A464 80099864 10000012 */ b .L800998B0 -/* 09A468 80099868 8E040004 */ lw $a0, 4($s0) -.L8009986C: -/* 09A46C 8009986C 860E0000 */ lh $t6, ($s0) -.L80099870: -/* 09A470 80099870 24020001 */ li $v0, 1 -/* 09A474 80099874 3C198019 */ lui $t9, %hi(D_8018D9B0) # $t9, 0x8019 -/* 09A478 80099878 16CE0003 */ bne $s6, $t6, .L80099888 -/* 09A47C 8009987C 00000000 */ nop -/* 09A480 80099880 10000001 */ b .L80099888 -/* 09A484 80099884 240200BE */ li $v0, 190 -.L80099888: -/* 09A488 80099888 8E6F0000 */ lw $t7, ($s3) -/* 09A48C 8009988C 8F39D9B0 */ lw $t9, %lo(D_8018D9B0)($t9) -/* 09A490 80099890 8EA40000 */ lw $a0, ($s5) -/* 09A494 80099894 000FC040 */ sll $t8, $t7, 1 -/* 09A498 80099898 8CA5D9B8 */ lw $a1, %lo(D_8018D9B8)($a1) # -0x2648($a1) -/* 09A49C 8009989C 00403825 */ move $a3, $v0 -/* 09A4A0 800998A0 0C010174 */ jal tkmk00decode -/* 09A4A4 800998A4 03193021 */ addu $a2, $t8, $t9 -/* 09A4A8 800998A8 8E830000 */ lw $v1, ($s4) -/* 09A4AC 800998AC 8E040004 */ lw $a0, 4($s0) -.L800998B0: -/* 09A4B0 800998B0 000340C0 */ sll $t0, $v1, 3 -/* 09A4B4 800998B4 02284821 */ addu $t1, $s1, $t0 -/* 09A4B8 800998B8 AD240000 */ sw $a0, ($t1) -/* 09A4BC 800998BC 8E8B0000 */ lw $t3, ($s4) -/* 09A4C0 800998C0 8E6A0000 */ lw $t2, ($s3) -/* 09A4C4 800998C4 000B60C0 */ sll $t4, $t3, 3 -/* 09A4C8 800998C8 022C6821 */ addu $t5, $s1, $t4 -/* 09A4CC 800998CC ADAA0004 */ sw $t2, 4($t5) -/* 09A4D0 800998D0 960F0008 */ lhu $t7, 8($s0) -/* 09A4D4 800998D4 960E000A */ lhu $t6, 0xa($s0) -/* 09A4D8 800998D8 8E790000 */ lw $t9, ($s3) -/* 09A4DC 800998DC 8E8D0000 */ lw $t5, ($s4) -/* 09A4E0 800998E0 01CF0019 */ multu $t6, $t7 -/* 09A4E4 800998E4 25AE0001 */ addiu $t6, $t5, 1 -/* 09A4E8 800998E8 AE8E0000 */ sw $t6, ($s4) -/* 09A4EC 800998EC 0000C012 */ mflo $t8 -/* 09A4F0 800998F0 03384021 */ addu $t0, $t9, $t8 -/* 09A4F4 800998F4 01004825 */ move $t1, $t0 -/* 09A4F8 800998F8 AE680000 */ sw $t0, ($s3) -/* 09A4FC 800998FC 05210003 */ bgez $t1, .L8009990C -/* 09A500 80099900 000958C3 */ sra $t3, $t1, 3 -/* 09A504 80099904 25210007 */ addiu $at, $t1, 7 -/* 09A508 80099908 000158C3 */ sra $t3, $at, 3 -.L8009990C: -/* 09A50C 8009990C 000B60C0 */ sll $t4, $t3, 3 -/* 09A510 80099910 258A0008 */ addiu $t2, $t4, 8 -/* 09A514 80099914 AE6A0000 */ sw $t2, ($s3) -/* 09A518 80099918 8E0F0018 */ lw $t7, 0x18($s0) -.L8009991C: -/* 09A51C 8009991C 26100014 */ addiu $s0, $s0, 0x14 -/* 09A520 80099920 55E0FF82 */ bnel $t7, $zero, .L8009972C -/* 09A524 80099924 8E830000 */ lw $v1, ($s4) -.L80099928: -/* 09A528 80099928 8FBF003C */ lw $ra, 0x3c($sp) -/* 09A52C 8009992C 8FB00018 */ lw $s0, 0x18($sp) -/* 09A530 80099930 8FB1001C */ lw $s1, 0x1c($sp) -/* 09A534 80099934 8FB20020 */ lw $s2, 0x20($sp) -/* 09A538 80099938 8FB30024 */ lw $s3, 0x24($sp) -/* 09A53C 8009993C 8FB40028 */ lw $s4, 0x28($sp) -/* 09A540 80099940 8FB5002C */ lw $s5, 0x2c($sp) -/* 09A544 80099944 8FB60030 */ lw $s6, 0x30($sp) -/* 09A548 80099948 8FB70034 */ lw $s7, 0x34($sp) -/* 09A54C 8009994C 8FBE0038 */ lw $fp, 0x38($sp) -/* 09A550 80099950 03E00008 */ jr $ra -/* 09A554 80099954 27BD0040 */ addiu $sp, $sp, 0x40 diff --git a/asm/non_matchings/code_80091750/func_80099AEC.s b/asm/non_matchings/code_80091750/func_80099AEC.s deleted file mode 100644 index 6ed12c8e43..0000000000 --- a/asm/non_matchings/code_80091750/func_80099AEC.s +++ /dev/null @@ -1,240 +0,0 @@ -glabel func_80099AEC -/* 09A6EC 80099AEC 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 09A6F0 80099AF0 3C0E800E */ lui $t6, %hi(gGamestate) # $t6, 0x800e -/* 09A6F4 80099AF4 8DCEC50C */ lw $t6, %lo(gGamestate)($t6) -/* 09A6F8 80099AF8 24010004 */ li $at, 4 -/* 09A6FC 80099AFC AFBF004C */ sw $ra, 0x4c($sp) -/* 09A700 80099B00 AFBE0048 */ sw $fp, 0x48($sp) -/* 09A704 80099B04 AFB70044 */ sw $s7, 0x44($sp) -/* 09A708 80099B08 AFB60040 */ sw $s6, 0x40($sp) -/* 09A70C 80099B0C AFB5003C */ sw $s5, 0x3c($sp) -/* 09A710 80099B10 AFB40038 */ sw $s4, 0x38($sp) -/* 09A714 80099B14 AFB30034 */ sw $s3, 0x34($sp) -/* 09A718 80099B18 AFB20030 */ sw $s2, 0x30($sp) -/* 09A71C 80099B1C AFB1002C */ sw $s1, 0x2c($sp) -/* 09A720 80099B20 15C10004 */ bne $t6, $at, .L80099B34 -/* 09A724 80099B24 AFB00028 */ sw $s0, 0x28($sp) -/* 09A728 80099B28 240F0500 */ li $t7, 1280 -/* 09A72C 80099B2C 10000003 */ b .L80099B3C -/* 09A730 80099B30 AFAF0060 */ sw $t7, 0x60($sp) -.L80099B34: -/* 09A734 80099B34 24181000 */ li $t8, 4096 -/* 09A738 80099B38 AFB80060 */ sw $t8, 0x60($sp) -.L80099B3C: -/* 09A73C 80099B3C 3C028019 */ lui $v0, %hi(D_8018E060) # 0x8019 -/* 09A740 80099B40 2451E060 */ addiu $s1, $v0, %lo(D_8018E060) # -0x1fa0 -/* 09A744 80099B44 8E320000 */ lw $s2, ($s1) -/* 09A748 80099B48 3C148019 */ lui $s4, %hi(D_8018D9B4) # $s4, 0x8019 -/* 09A74C 80099B4C 0000A825 */ move $s5, $zero -/* 09A750 80099B50 124000B4 */ beqz $s2, .L80099E24 -/* 09A754 80099B54 2694D9B4 */ addiu $s4, %lo(D_8018D9B4) # addiu $s4, $s4, -0x264c -/* 09A758 80099B58 96430010 */ lhu $v1, 0x10($s2) -/* 09A75C 80099B5C 24101400 */ li $s0, 5120 -/* 09A760 80099B60 10600003 */ beqz $v1, .L80099B70 -/* 09A764 80099B64 00000000 */ nop -/* 09A768 80099B68 10000001 */ b .L80099B70 -/* 09A76C 80099B6C 00608025 */ move $s0, $v1 -.L80099B70: -/* 09A770 80099B70 06010004 */ bgez $s0, .L80099B84 -/* 09A774 80099B74 32190007 */ andi $t9, $s0, 7 -/* 09A778 80099B78 13200002 */ beqz $t9, .L80099B84 -/* 09A77C 80099B7C 00000000 */ nop -/* 09A780 80099B80 2739FFF8 */ addiu $t9, $t9, -8 -.L80099B84: -/* 09A784 80099B84 53200008 */ beql $t9, $zero, .L80099BA8 -/* 09A788 80099B88 8E840000 */ lw $a0, ($s4) -/* 09A78C 80099B8C 06010003 */ bgez $s0, .L80099B9C -/* 09A790 80099B90 001040C3 */ sra $t0, $s0, 3 -/* 09A794 80099B94 26010007 */ addiu $at, $s0, 7 -/* 09A798 80099B98 000140C3 */ sra $t0, $at, 3 -.L80099B9C: -/* 09A79C 80099B9C 000848C0 */ sll $t1, $t0, 3 -/* 09A7A0 80099BA0 25300008 */ addiu $s0, $t1, 8 -/* 09A7A4 80099BA4 8E840000 */ lw $a0, ($s4) -.L80099BA8: -/* 09A7A8 80099BA8 0C0336E0 */ jal osInvalDCache -/* 09A7AC 80099BAC 02002825 */ move $a1, $s0 -/* 09A7B0 80099BB0 8E4A0004 */ lw $t2, 4($s2) -/* 09A7B4 80099BB4 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 09A7B8 80099BB8 8E8C0000 */ lw $t4, ($s4) -/* 09A7BC 80099BBC 3C168015 */ lui $s6, %hi(gDmaMesgQueue) # $s6, 0x8015 -/* 09A7C0 80099BC0 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 09A7C4 80099BC4 3C020073 */ lui $v0, %hi(_textures_0aSegmentRomStart) # $v0, 0x73 -/* 09A7C8 80099BC8 26D6EF58 */ addiu $s6, %lo(gDmaMesgQueue) # addiu $s6, $s6, -0x10a8 -/* 09A7CC 80099BCC 24429A30 */ addiu $v0, %lo(_textures_0aSegmentRomStart) # addiu $v0, $v0, -0x65d0 -/* 09A7D0 80099BD0 01415824 */ and $t3, $t2, $at -/* 09A7D4 80099BD4 004B3821 */ addu $a3, $v0, $t3 -/* 09A7D8 80099BD8 AFA20058 */ sw $v0, 0x58($sp) -/* 09A7DC 80099BDC AFB60018 */ sw $s6, 0x18($sp) -/* 09A7E0 80099BE0 AFB00014 */ sw $s0, 0x14($sp) -/* 09A7E4 80099BE4 27A4006C */ addiu $a0, $sp, 0x6c -/* 09A7E8 80099BE8 00002825 */ move $a1, $zero -/* 09A7EC 80099BEC 00003025 */ move $a2, $zero -/* 09A7F0 80099BF0 0C03370C */ jal osPiStartDma -/* 09A7F4 80099BF4 AFAC0010 */ sw $t4, 0x10($sp) -/* 09A7F8 80099BF8 27B70068 */ addiu $s7, $sp, 0x68 -/* 09A7FC 80099BFC 02E02825 */ move $a1, $s7 -/* 09A800 80099C00 02C02025 */ move $a0, $s6 -/* 09A804 80099C04 0C0335D4 */ jal osRecvMesg -/* 09A808 80099C08 24060001 */ li $a2, 1 -/* 09A80C 80099C0C 3C1E8019 */ lui $fp, %hi(D_8018E118) # $fp, 0x8019 -/* 09A810 80099C10 27DEE118 */ addiu $fp, %lo(D_8018E118) # addiu $fp, $fp, -0x1ee8 -/* 09A814 80099C14 8E220008 */ lw $v0, 8($s1) -.L80099C18: -/* 09A818 80099C18 8FB30060 */ lw $s3, 0x60($sp) -/* 09A81C 80099C1C 54400006 */ bnel $v0, $zero, .L80099C38 -/* 09A820 80099C20 94430010 */ lhu $v1, 0x10($v0) -/* 09A824 80099C24 26B50001 */ addiu $s5, $s5, 1 -/* 09A828 80099C28 00156E00 */ sll $t5, $s5, 0x18 -/* 09A82C 80099C2C 10000029 */ b .L80099CD4 -/* 09A830 80099C30 000DAE03 */ sra $s5, $t5, 0x18 -/* 09A834 80099C34 94430010 */ lhu $v1, 0x10($v0) -.L80099C38: -/* 09A838 80099C38 00137880 */ sll $t7, $s3, 2 -/* 09A83C 80099C3C 00409025 */ move $s2, $v0 -/* 09A840 80099C40 10600003 */ beqz $v1, .L80099C50 -/* 09A844 80099C44 01E09825 */ move $s3, $t7 -/* 09A848 80099C48 10000002 */ b .L80099C54 -/* 09A84C 80099C4C 00608025 */ move $s0, $v1 -.L80099C50: -/* 09A850 80099C50 24101400 */ li $s0, 5120 -.L80099C54: -/* 09A854 80099C54 06010004 */ bgez $s0, .L80099C68 -/* 09A858 80099C58 32180007 */ andi $t8, $s0, 7 -/* 09A85C 80099C5C 13000002 */ beqz $t8, .L80099C68 -/* 09A860 80099C60 00000000 */ nop -/* 09A864 80099C64 2718FFF8 */ addiu $t8, $t8, -8 -.L80099C68: -/* 09A868 80099C68 53000008 */ beql $t8, $zero, .L80099C8C -/* 09A86C 80099C6C 8E890000 */ lw $t1, ($s4) -/* 09A870 80099C70 06010003 */ bgez $s0, .L80099C80 -/* 09A874 80099C74 0010C8C3 */ sra $t9, $s0, 3 -/* 09A878 80099C78 26010007 */ addiu $at, $s0, 7 -/* 09A87C 80099C7C 0001C8C3 */ sra $t9, $at, 3 -.L80099C80: -/* 09A880 80099C80 001940C0 */ sll $t0, $t9, 3 -/* 09A884 80099C84 25100008 */ addiu $s0, $t0, 8 -/* 09A888 80099C88 8E890000 */ lw $t1, ($s4) -.L80099C8C: -/* 09A88C 80099C8C 02002825 */ move $a1, $s0 -/* 09A890 80099C90 0C0336E0 */ jal osInvalDCache -/* 09A894 80099C94 02692021 */ addu $a0, $s3, $t1 -/* 09A898 80099C98 8E4B0004 */ lw $t3, 4($s2) -/* 09A89C 80099C9C 8E8D0000 */ lw $t5, ($s4) -/* 09A8A0 80099CA0 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 09A8A4 80099CA4 8FAA0058 */ lw $t2, 0x58($sp) -/* 09A8A8 80099CA8 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 09A8AC 80099CAC 01616024 */ and $t4, $t3, $at -/* 09A8B0 80099CB0 026D7021 */ addu $t6, $s3, $t5 -/* 09A8B4 80099CB4 AFAE0010 */ sw $t6, 0x10($sp) -/* 09A8B8 80099CB8 AFB60018 */ sw $s6, 0x18($sp) -/* 09A8BC 80099CBC AFB00014 */ sw $s0, 0x14($sp) -/* 09A8C0 80099CC0 27A4006C */ addiu $a0, $sp, 0x6c -/* 09A8C4 80099CC4 00002825 */ move $a1, $zero -/* 09A8C8 80099CC8 00003025 */ move $a2, $zero -/* 09A8CC 80099CCC 0C03370C */ jal osPiStartDma -/* 09A8D0 80099CD0 014C3821 */ addu $a3, $t2, $t4 -.L80099CD4: -/* 09A8D4 80099CD4 8E2F0004 */ lw $t7, 4($s1) -/* 09A8D8 80099CD8 3C098019 */ lui $t1, %hi(D_8018D9B0) # $t1, 0x8019 -/* 09A8DC 80099CDC 8D29D9B0 */ lw $t1, %lo(D_8018D9B0)($t1) -/* 09A8E0 80099CE0 000FC0C0 */ sll $t8, $t7, 3 -/* 09A8E4 80099CE4 031EC821 */ addu $t9, $t8, $fp -/* 09A8E8 80099CE8 8F220004 */ lw $v0, 4($t9) -/* 09A8EC 80099CEC 8E840000 */ lw $a0, ($s4) -/* 09A8F0 80099CF0 00024040 */ sll $t0, $v0, 1 -/* 09A8F4 80099CF4 0C010034 */ jal mio0decode -/* 09A8F8 80099CF8 01092821 */ addu $a1, $t0, $t1 -/* 09A8FC 80099CFC AE200000 */ sw $zero, ($s1) -/* 09A900 80099D00 16A00048 */ bnez $s5, .L80099E24 -/* 09A904 80099D04 26310008 */ addiu $s1, $s1, 8 -/* 09A908 80099D08 8FB30060 */ lw $s3, 0x60($sp) -/* 09A90C 80099D0C 02C02025 */ move $a0, $s6 -/* 09A910 80099D10 02E02825 */ move $a1, $s7 -/* 09A914 80099D14 00135880 */ sll $t3, $s3, 2 -/* 09A918 80099D18 01609825 */ move $s3, $t3 -/* 09A91C 80099D1C 0C0335D4 */ jal osRecvMesg -/* 09A920 80099D20 24060001 */ li $a2, 1 -/* 09A924 80099D24 8E220008 */ lw $v0, 8($s1) -/* 09A928 80099D28 54400006 */ bnel $v0, $zero, .L80099D44 -/* 09A92C 80099D2C 94430010 */ lhu $v1, 0x10($v0) -/* 09A930 80099D30 26B50001 */ addiu $s5, $s5, 1 -/* 09A934 80099D34 00155600 */ sll $t2, $s5, 0x18 -/* 09A938 80099D38 10000026 */ b .L80099DD4 -/* 09A93C 80099D3C 000AAE03 */ sra $s5, $t2, 0x18 -/* 09A940 80099D40 94430010 */ lhu $v1, 0x10($v0) -.L80099D44: -/* 09A944 80099D44 00409025 */ move $s2, $v0 -/* 09A948 80099D48 24101400 */ li $s0, 5120 -/* 09A94C 80099D4C 10600003 */ beqz $v1, .L80099D5C -/* 09A950 80099D50 00000000 */ nop -/* 09A954 80099D54 10000001 */ b .L80099D5C -/* 09A958 80099D58 00608025 */ move $s0, $v1 -.L80099D5C: -/* 09A95C 80099D5C 06010004 */ bgez $s0, .L80099D70 -/* 09A960 80099D60 320D0007 */ andi $t5, $s0, 7 -/* 09A964 80099D64 11A00002 */ beqz $t5, .L80099D70 -/* 09A968 80099D68 00000000 */ nop -/* 09A96C 80099D6C 25ADFFF8 */ addiu $t5, $t5, -8 -.L80099D70: -/* 09A970 80099D70 51A00008 */ beql $t5, $zero, .L80099D94 -/* 09A974 80099D74 8E840000 */ lw $a0, ($s4) -/* 09A978 80099D78 06010003 */ bgez $s0, .L80099D88 -/* 09A97C 80099D7C 001070C3 */ sra $t6, $s0, 3 -/* 09A980 80099D80 26010007 */ addiu $at, $s0, 7 -/* 09A984 80099D84 000170C3 */ sra $t6, $at, 3 -.L80099D88: -/* 09A988 80099D88 000E78C0 */ sll $t7, $t6, 3 -/* 09A98C 80099D8C 25F00008 */ addiu $s0, $t7, 8 -/* 09A990 80099D90 8E840000 */ lw $a0, ($s4) -.L80099D94: -/* 09A994 80099D94 0C0336E0 */ jal osInvalDCache -/* 09A998 80099D98 02002825 */ move $a1, $s0 -/* 09A99C 80099D9C 8E590004 */ lw $t9, 4($s2) -/* 09A9A0 80099DA0 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 09A9A4 80099DA4 8FB80058 */ lw $t8, 0x58($sp) -/* 09A9A8 80099DA8 8E890000 */ lw $t1, ($s4) -/* 09A9AC 80099DAC 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 09A9B0 80099DB0 03214024 */ and $t0, $t9, $at -/* 09A9B4 80099DB4 AFB60018 */ sw $s6, 0x18($sp) -/* 09A9B8 80099DB8 AFB00014 */ sw $s0, 0x14($sp) -/* 09A9BC 80099DBC 27A4006C */ addiu $a0, $sp, 0x6c -/* 09A9C0 80099DC0 00002825 */ move $a1, $zero -/* 09A9C4 80099DC4 00003025 */ move $a2, $zero -/* 09A9C8 80099DC8 03083821 */ addu $a3, $t8, $t0 -/* 09A9CC 80099DCC 0C03370C */ jal osPiStartDma -/* 09A9D0 80099DD0 AFA90010 */ sw $t1, 0x10($sp) -.L80099DD4: -/* 09A9D4 80099DD4 8E2B0004 */ lw $t3, 4($s1) -/* 09A9D8 80099DD8 3C0F8019 */ lui $t7, %hi(D_8018D9B0) # $t7, 0x8019 -/* 09A9DC 80099DDC 8DEFD9B0 */ lw $t7, %lo(D_8018D9B0)($t7) -/* 09A9E0 80099DE0 000B50C0 */ sll $t2, $t3, 3 -/* 09A9E4 80099DE4 015E6021 */ addu $t4, $t2, $fp -/* 09A9E8 80099DE8 8D820004 */ lw $v0, 4($t4) -/* 09A9EC 80099DEC 8E8D0000 */ lw $t5, ($s4) -/* 09A9F0 80099DF0 00027040 */ sll $t6, $v0, 1 -/* 09A9F4 80099DF4 01CF2821 */ addu $a1, $t6, $t7 -/* 09A9F8 80099DF8 0C010034 */ jal mio0decode -/* 09A9FC 80099DFC 026D2021 */ addu $a0, $s3, $t5 -/* 09AA00 80099E00 AE200000 */ sw $zero, ($s1) -/* 09AA04 80099E04 16A00007 */ bnez $s5, .L80099E24 -/* 09AA08 80099E08 26310008 */ addiu $s1, $s1, 8 -/* 09AA0C 80099E0C 02C02025 */ move $a0, $s6 -/* 09AA10 80099E10 02E02825 */ move $a1, $s7 -/* 09AA14 80099E14 0C0335D4 */ jal osRecvMesg -/* 09AA18 80099E18 24060001 */ li $a2, 1 -/* 09AA1C 80099E1C 1000FF7E */ b .L80099C18 -/* 09AA20 80099E20 8E220008 */ lw $v0, 8($s1) -.L80099E24: -/* 09AA24 80099E24 8FBF004C */ lw $ra, 0x4c($sp) -/* 09AA28 80099E28 8FB00028 */ lw $s0, 0x28($sp) -/* 09AA2C 80099E2C 8FB1002C */ lw $s1, 0x2c($sp) -/* 09AA30 80099E30 8FB20030 */ lw $s2, 0x30($sp) -/* 09AA34 80099E34 8FB30034 */ lw $s3, 0x34($sp) -/* 09AA38 80099E38 8FB40038 */ lw $s4, 0x38($sp) -/* 09AA3C 80099E3C 8FB5003C */ lw $s5, 0x3c($sp) -/* 09AA40 80099E40 8FB60040 */ lw $s6, 0x40($sp) -/* 09AA44 80099E44 8FB70044 */ lw $s7, 0x44($sp) -/* 09AA48 80099E48 8FBE0048 */ lw $fp, 0x48($sp) -/* 09AA4C 80099E4C 03E00008 */ jr $ra -/* 09AA50 80099E50 27BD0098 */ addiu $sp, $sp, 0x98 diff --git a/asm/non_matchings/code_80091750/func_80099EC4.s b/asm/non_matchings/code_80091750/func_80099EC4.s deleted file mode 100644 index df60817839..0000000000 --- a/asm/non_matchings/code_80091750/func_80099EC4.s +++ /dev/null @@ -1,244 +0,0 @@ -glabel func_80099EC4 -/* 09AAC4 80099EC4 27BDFF70 */ addiu $sp, $sp, -0x90 -/* 09AAC8 80099EC8 AFB1002C */ sw $s1, 0x2c($sp) -/* 09AACC 80099ECC 3C028019 */ lui $v0, %hi(D_8018E0E8) # 0x8019 -/* 09AAD0 80099ED0 2451E0E8 */ addiu $s1, $v0, %lo(D_8018E0E8) # -0x1f18 -/* 09AAD4 80099ED4 AFBF004C */ sw $ra, 0x4c($sp) -/* 09AAD8 80099ED8 AFBE0048 */ sw $fp, 0x48($sp) -/* 09AADC 80099EDC AFB70044 */ sw $s7, 0x44($sp) -/* 09AAE0 80099EE0 AFB60040 */ sw $s6, 0x40($sp) -/* 09AAE4 80099EE4 AFB5003C */ sw $s5, 0x3c($sp) -/* 09AAE8 80099EE8 AFB40038 */ sw $s4, 0x38($sp) -/* 09AAEC 80099EEC AFB30034 */ sw $s3, 0x34($sp) -/* 09AAF0 80099EF0 AFB20030 */ sw $s2, 0x30($sp) -/* 09AAF4 80099EF4 AFB00028 */ sw $s0, 0x28($sp) -/* 09AAF8 80099EF8 8E320000 */ lw $s2, ($s1) -/* 09AAFC 80099EFC 3C138019 */ lui $s3, %hi(D_8018D9B4) # $s3, 0x8019 -/* 09AB00 80099F00 0000A025 */ move $s4, $zero -/* 09AB04 80099F04 124000C0 */ beqz $s2, .L8009A208 -/* 09AB08 80099F08 2673D9B4 */ addiu $s3, %lo(D_8018D9B4) # addiu $s3, $s3, -0x264c -/* 09AB0C 80099F0C 96430010 */ lhu $v1, 0x10($s2) -/* 09AB10 80099F10 24101400 */ li $s0, 5120 -/* 09AB14 80099F14 10600003 */ beqz $v1, .L80099F24 -/* 09AB18 80099F18 00000000 */ nop -/* 09AB1C 80099F1C 10000001 */ b .L80099F24 -/* 09AB20 80099F20 00608025 */ move $s0, $v1 -.L80099F24: -/* 09AB24 80099F24 06010004 */ bgez $s0, .L80099F38 -/* 09AB28 80099F28 320E0007 */ andi $t6, $s0, 7 -/* 09AB2C 80099F2C 11C00002 */ beqz $t6, .L80099F38 -/* 09AB30 80099F30 00000000 */ nop -/* 09AB34 80099F34 25CEFFF8 */ addiu $t6, $t6, -8 -.L80099F38: -/* 09AB38 80099F38 51C00008 */ beql $t6, $zero, .L80099F5C -/* 09AB3C 80099F3C 8E640000 */ lw $a0, ($s3) -/* 09AB40 80099F40 06010003 */ bgez $s0, .L80099F50 -/* 09AB44 80099F44 001078C3 */ sra $t7, $s0, 3 -/* 09AB48 80099F48 26010007 */ addiu $at, $s0, 7 -/* 09AB4C 80099F4C 000178C3 */ sra $t7, $at, 3 -.L80099F50: -/* 09AB50 80099F50 000FC0C0 */ sll $t8, $t7, 3 -/* 09AB54 80099F54 27100008 */ addiu $s0, $t8, 8 -/* 09AB58 80099F58 8E640000 */ lw $a0, ($s3) -.L80099F5C: -/* 09AB5C 80099F5C 0C0336E0 */ jal osInvalDCache -/* 09AB60 80099F60 02002825 */ move $a1, $s0 -/* 09AB64 80099F64 8E590004 */ lw $t9, 4($s2) -/* 09AB68 80099F68 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 09AB6C 80099F6C 8E690000 */ lw $t1, ($s3) -/* 09AB70 80099F70 3C158015 */ lui $s5, %hi(gDmaMesgQueue) # $s5, 0x8015 -/* 09AB74 80099F74 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 09AB78 80099F78 3C1E0073 */ lui $fp, %hi(_textures_0aSegmentRomStart) # $fp, 0x73 -/* 09AB7C 80099F7C 26B5EF58 */ addiu $s5, %lo(gDmaMesgQueue) # addiu $s5, $s5, -0x10a8 -/* 09AB80 80099F80 27DE9A30 */ addiu $fp, %lo(_textures_0aSegmentRomStart) # addiu $fp, $fp, -0x65d0 -/* 09AB84 80099F84 03214024 */ and $t0, $t9, $at -/* 09AB88 80099F88 03C83821 */ addu $a3, $fp, $t0 -/* 09AB8C 80099F8C AFB50018 */ sw $s5, 0x18($sp) -/* 09AB90 80099F90 AFB00014 */ sw $s0, 0x14($sp) -/* 09AB94 80099F94 27A40068 */ addiu $a0, $sp, 0x68 -/* 09AB98 80099F98 00002825 */ move $a1, $zero -/* 09AB9C 80099F9C 00003025 */ move $a2, $zero -/* 09ABA0 80099FA0 0C03370C */ jal osPiStartDma -/* 09ABA4 80099FA4 AFA90010 */ sw $t1, 0x10($sp) -/* 09ABA8 80099FA8 27B60064 */ addiu $s6, $sp, 0x64 -/* 09ABAC 80099FAC 02C02825 */ move $a1, $s6 -/* 09ABB0 80099FB0 02A02025 */ move $a0, $s5 -/* 09ABB4 80099FB4 0C0335D4 */ jal osRecvMesg -/* 09ABB8 80099FB8 24060001 */ li $a2, 1 -/* 09ABBC 80099FBC 3C17802C */ lui $s7, %hi(D_802BFB80) # $s7, 0x802c -/* 09ABC0 80099FC0 26F7FB80 */ addiu $s7, %lo(D_802BFB80) # addiu $s7, $s7, -0x480 -/* 09ABC4 80099FC4 8E220008 */ lw $v0, 8($s1) -.L80099FC8: -/* 09ABC8 80099FC8 54400006 */ bnel $v0, $zero, .L80099FE4 -/* 09ABCC 80099FCC 94430010 */ lhu $v1, 0x10($v0) -/* 09ABD0 80099FD0 26940001 */ addiu $s4, $s4, 1 -/* 09ABD4 80099FD4 00145600 */ sll $t2, $s4, 0x18 -/* 09ABD8 80099FD8 10000027 */ b .L8009A078 -/* 09ABDC 80099FDC 000AA603 */ sra $s4, $t2, 0x18 -/* 09ABE0 80099FE0 94430010 */ lhu $v1, 0x10($v0) -.L80099FE4: -/* 09ABE4 80099FE4 00409025 */ move $s2, $v0 -/* 09ABE8 80099FE8 24101400 */ li $s0, 5120 -/* 09ABEC 80099FEC 10600003 */ beqz $v1, .L80099FFC -/* 09ABF0 80099FF0 00000000 */ nop -/* 09ABF4 80099FF4 10000001 */ b .L80099FFC -/* 09ABF8 80099FF8 00608025 */ move $s0, $v1 -.L80099FFC: -/* 09ABFC 80099FFC 06010004 */ bgez $s0, .L8009A010 -/* 09AC00 8009A000 320C0007 */ andi $t4, $s0, 7 -/* 09AC04 8009A004 11800002 */ beqz $t4, .L8009A010 -/* 09AC08 8009A008 00000000 */ nop -/* 09AC0C 8009A00C 258CFFF8 */ addiu $t4, $t4, -8 -.L8009A010: -/* 09AC10 8009A010 51800008 */ beql $t4, $zero, .L8009A034 -/* 09AC14 8009A014 8E640000 */ lw $a0, ($s3) -/* 09AC18 8009A018 06010003 */ bgez $s0, .L8009A028 -/* 09AC1C 8009A01C 001068C3 */ sra $t5, $s0, 3 -/* 09AC20 8009A020 26010007 */ addiu $at, $s0, 7 -/* 09AC24 8009A024 000168C3 */ sra $t5, $at, 3 -.L8009A028: -/* 09AC28 8009A028 000D70C0 */ sll $t6, $t5, 3 -/* 09AC2C 8009A02C 25D00008 */ addiu $s0, $t6, 8 -/* 09AC30 8009A030 8E640000 */ lw $a0, ($s3) -.L8009A034: -/* 09AC34 8009A034 02002825 */ move $a1, $s0 -/* 09AC38 8009A038 0C0336E0 */ jal osInvalDCache -/* 09AC3C 8009A03C 24841400 */ addiu $a0, $a0, 0x1400 -/* 09AC40 8009A040 8E4F0004 */ lw $t7, 4($s2) -/* 09AC44 8009A044 8E790000 */ lw $t9, ($s3) -/* 09AC48 8009A048 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 09AC4C 8009A04C 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 09AC50 8009A050 01E1C024 */ and $t8, $t7, $at -/* 09AC54 8009A054 27281400 */ addiu $t0, $t9, 0x1400 -/* 09AC58 8009A058 AFA80010 */ sw $t0, 0x10($sp) -/* 09AC5C 8009A05C 03D83821 */ addu $a3, $fp, $t8 -/* 09AC60 8009A060 AFB50018 */ sw $s5, 0x18($sp) -/* 09AC64 8009A064 AFB00014 */ sw $s0, 0x14($sp) -/* 09AC68 8009A068 27A40068 */ addiu $a0, $sp, 0x68 -/* 09AC6C 8009A06C 00002825 */ move $a1, $zero -/* 09AC70 8009A070 0C03370C */ jal osPiStartDma -/* 09AC74 8009A074 00003025 */ move $a2, $zero -.L8009A078: -/* 09AC78 8009A078 86220004 */ lh $v0, 4($s1) -/* 09AC7C 8009A07C 86290006 */ lh $t1, 6($s1) -/* 09AC80 8009A080 8E640000 */ lw $a0, ($s3) -/* 09AC84 8009A084 00095400 */ sll $t2, $t1, 0x10 -/* 09AC88 8009A088 02EA5821 */ addu $t3, $s7, $t2 -/* 09AC8C 8009A08C 04410003 */ bgez $v0, .L8009A09C -/* 09AC90 8009A090 00026043 */ sra $t4, $v0, 1 -/* 09AC94 8009A094 24410001 */ addiu $at, $v0, 1 -/* 09AC98 8009A098 00016043 */ sra $t4, $at, 1 -.L8009A09C: -/* 09AC9C 8009A09C 000C6BC0 */ sll $t5, $t4, 0xf -/* 09ACA0 8009A0A0 016D7021 */ addu $t6, $t3, $t5 -/* 09ACA4 8009A0A4 04410004 */ bgez $v0, .L8009A0B8 -/* 09ACA8 8009A0A8 304F0001 */ andi $t7, $v0, 1 -/* 09ACAC 8009A0AC 11E00002 */ beqz $t7, .L8009A0B8 -/* 09ACB0 8009A0B0 00000000 */ nop -/* 09ACB4 8009A0B4 25EFFFFE */ addiu $t7, $t7, -2 -.L8009A0B8: -/* 09ACB8 8009A0B8 000FC340 */ sll $t8, $t7, 0xd -/* 09ACBC 8009A0BC 01D82821 */ addu $a1, $t6, $t8 -/* 09ACC0 8009A0C0 0C010034 */ jal mio0decode -/* 09ACC4 8009A0C4 24A54000 */ addiu $a1, $a1, 0x4000 -/* 09ACC8 8009A0C8 AE200000 */ sw $zero, ($s1) -/* 09ACCC 8009A0CC 1680004E */ bnez $s4, .L8009A208 -/* 09ACD0 8009A0D0 26310008 */ addiu $s1, $s1, 8 -/* 09ACD4 8009A0D4 02A02025 */ move $a0, $s5 -/* 09ACD8 8009A0D8 02C02825 */ move $a1, $s6 -/* 09ACDC 8009A0DC 0C0335D4 */ jal osRecvMesg -/* 09ACE0 8009A0E0 24060001 */ li $a2, 1 -/* 09ACE4 8009A0E4 8E220008 */ lw $v0, 8($s1) -/* 09ACE8 8009A0E8 54400006 */ bnel $v0, $zero, .L8009A104 -/* 09ACEC 8009A0EC 94430010 */ lhu $v1, 0x10($v0) -/* 09ACF0 8009A0F0 26940001 */ addiu $s4, $s4, 1 -/* 09ACF4 8009A0F4 0014CE00 */ sll $t9, $s4, 0x18 -/* 09ACF8 8009A0F8 10000025 */ b .L8009A190 -/* 09ACFC 8009A0FC 0019A603 */ sra $s4, $t9, 0x18 -/* 09AD00 8009A100 94430010 */ lhu $v1, 0x10($v0) -.L8009A104: -/* 09AD04 8009A104 00409025 */ move $s2, $v0 -/* 09AD08 8009A108 24101400 */ li $s0, 5120 -/* 09AD0C 8009A10C 10600003 */ beqz $v1, .L8009A11C -/* 09AD10 8009A110 00000000 */ nop -/* 09AD14 8009A114 10000001 */ b .L8009A11C -/* 09AD18 8009A118 00608025 */ move $s0, $v1 -.L8009A11C: -/* 09AD1C 8009A11C 06010004 */ bgez $s0, .L8009A130 -/* 09AD20 8009A120 32090007 */ andi $t1, $s0, 7 -/* 09AD24 8009A124 11200002 */ beqz $t1, .L8009A130 -/* 09AD28 8009A128 00000000 */ nop -/* 09AD2C 8009A12C 2529FFF8 */ addiu $t1, $t1, -8 -.L8009A130: -/* 09AD30 8009A130 51200008 */ beql $t1, $zero, .L8009A154 -/* 09AD34 8009A134 8E640000 */ lw $a0, ($s3) -/* 09AD38 8009A138 06010003 */ bgez $s0, .L8009A148 -/* 09AD3C 8009A13C 001050C3 */ sra $t2, $s0, 3 -/* 09AD40 8009A140 26010007 */ addiu $at, $s0, 7 -/* 09AD44 8009A144 000150C3 */ sra $t2, $at, 3 -.L8009A148: -/* 09AD48 8009A148 000A60C0 */ sll $t4, $t2, 3 -/* 09AD4C 8009A14C 25900008 */ addiu $s0, $t4, 8 -/* 09AD50 8009A150 8E640000 */ lw $a0, ($s3) -.L8009A154: -/* 09AD54 8009A154 0C0336E0 */ jal osInvalDCache -/* 09AD58 8009A158 02002825 */ move $a1, $s0 -/* 09AD5C 8009A15C 8E4B0004 */ lw $t3, 4($s2) -/* 09AD60 8009A160 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 09AD64 8009A164 8E6F0000 */ lw $t7, ($s3) -/* 09AD68 8009A168 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 09AD6C 8009A16C 01616824 */ and $t5, $t3, $at -/* 09AD70 8009A170 03CD3821 */ addu $a3, $fp, $t5 -/* 09AD74 8009A174 AFB50018 */ sw $s5, 0x18($sp) -/* 09AD78 8009A178 AFB00014 */ sw $s0, 0x14($sp) -/* 09AD7C 8009A17C 27A40068 */ addiu $a0, $sp, 0x68 -/* 09AD80 8009A180 00002825 */ move $a1, $zero -/* 09AD84 8009A184 00003025 */ move $a2, $zero -/* 09AD88 8009A188 0C03370C */ jal osPiStartDma -/* 09AD8C 8009A18C AFAF0010 */ sw $t7, 0x10($sp) -.L8009A190: -/* 09AD90 8009A190 86220004 */ lh $v0, 4($s1) -/* 09AD94 8009A194 862E0006 */ lh $t6, 6($s1) -/* 09AD98 8009A198 8E640000 */ lw $a0, ($s3) -/* 09AD9C 8009A19C 000EC400 */ sll $t8, $t6, 0x10 -/* 09ADA0 8009A1A0 02F8C821 */ addu $t9, $s7, $t8 -/* 09ADA4 8009A1A4 24841400 */ addiu $a0, $a0, 0x1400 -/* 09ADA8 8009A1A8 04410003 */ bgez $v0, .L8009A1B8 -/* 09ADAC 8009A1AC 00024043 */ sra $t0, $v0, 1 -/* 09ADB0 8009A1B0 24410001 */ addiu $at, $v0, 1 -/* 09ADB4 8009A1B4 00014043 */ sra $t0, $at, 1 -.L8009A1B8: -/* 09ADB8 8009A1B8 00084BC0 */ sll $t1, $t0, 0xf -/* 09ADBC 8009A1BC 03295021 */ addu $t2, $t9, $t1 -/* 09ADC0 8009A1C0 04410004 */ bgez $v0, .L8009A1D4 -/* 09ADC4 8009A1C4 304C0001 */ andi $t4, $v0, 1 -/* 09ADC8 8009A1C8 11800002 */ beqz $t4, .L8009A1D4 -/* 09ADCC 8009A1CC 00000000 */ nop -/* 09ADD0 8009A1D0 258CFFFE */ addiu $t4, $t4, -2 -.L8009A1D4: -/* 09ADD4 8009A1D4 000C5B40 */ sll $t3, $t4, 0xd -/* 09ADD8 8009A1D8 014B2821 */ addu $a1, $t2, $t3 -/* 09ADDC 8009A1DC 0C010034 */ jal mio0decode -/* 09ADE0 8009A1E0 24A54000 */ addiu $a1, $a1, 0x4000 -/* 09ADE4 8009A1E4 AE200000 */ sw $zero, ($s1) -/* 09ADE8 8009A1E8 16800007 */ bnez $s4, .L8009A208 -/* 09ADEC 8009A1EC 26310008 */ addiu $s1, $s1, 8 -/* 09ADF0 8009A1F0 02A02025 */ move $a0, $s5 -/* 09ADF4 8009A1F4 02C02825 */ move $a1, $s6 -/* 09ADF8 8009A1F8 0C0335D4 */ jal osRecvMesg -/* 09ADFC 8009A1FC 24060001 */ li $a2, 1 -/* 09AE00 8009A200 1000FF71 */ b .L80099FC8 -/* 09AE04 8009A204 8E220008 */ lw $v0, 8($s1) -.L8009A208: -/* 09AE08 8009A208 8FBF004C */ lw $ra, 0x4c($sp) -/* 09AE0C 8009A20C 8FB00028 */ lw $s0, 0x28($sp) -/* 09AE10 8009A210 8FB1002C */ lw $s1, 0x2c($sp) -/* 09AE14 8009A214 8FB20030 */ lw $s2, 0x30($sp) -/* 09AE18 8009A218 8FB30034 */ lw $s3, 0x34($sp) -/* 09AE1C 8009A21C 8FB40038 */ lw $s4, 0x38($sp) -/* 09AE20 8009A220 8FB5003C */ lw $s5, 0x3c($sp) -/* 09AE24 8009A224 8FB60040 */ lw $s6, 0x40($sp) -/* 09AE28 8009A228 8FB70044 */ lw $s7, 0x44($sp) -/* 09AE2C 8009A22C 8FBE0048 */ lw $fp, 0x48($sp) -/* 09AE30 8009A230 03E00008 */ jr $ra -/* 09AE34 8009A234 27BD0090 */ addiu $sp, $sp, 0x90 diff --git a/asm/non_matchings/code_80091750/func_8009F5E0.s b/asm/non_matchings/code_80091750/func_8009F5E0.s deleted file mode 100644 index 3cf6765e0c..0000000000 --- a/asm/non_matchings/code_80091750/func_8009F5E0.s +++ /dev/null @@ -1,1451 +0,0 @@ -.section .rodata - -glabel D_800F0C14 -.asciiz "'" -.balign 4 - -glabel D_800F0C18 -.asciiz "\"" -.balign 4 - -.section .late_rodata - -glabel jpt_800F15E4 -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC, L800A08BC -.word L800A08BC, L800A08BC, L800A08BC - -glabel jpt_800F16E0 -.word L800A07FC, L800A080C, L800A081C, L800A082C -.word L800A083C, L800A084C - -glabel jpt_800F16F8 -.word L800A0240, L800A0280, L800A0280, L800A0280 -.word L800A0280, L800A08C4, L800A01F8, L800A01F8 -.word L800A01F8, L800A01F8, L800A01F8, L800A02A4 -.word L800A0620, L800A0270, L800A0270, L800A0270 -.word L800A0270, L800A08C4, L800A08C4, L800A02DC -.word L800A02DC, L800A036C, L800A037C, L800A03F4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A035C, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A0404, L800A0404 -.word L800A0404, L800A0404, L800A0568, L800A0568 -.word L800A0568, L800A0568, L800A0568, L800A0568 -.word L800A0568, L800A0568, L800A0568, L800A0568 -.word L800A0568, L800A0568, L800A0568, L800A0568 -.word L800A0568, L800A0568, L800A0428, L800A0558 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A0578, L800A05C4, L800A0610, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A01DC, L800A01DC -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A0644, L800A0654, L800A0664, L800A08C4 -.word L800A08C4, L800A0674, L800A0684, L800A0694 -.word L800A0694, L800A0694, L800A0694, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A071C -.word L800A072C, L800A08C4, L800A073C, L800A075C -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A074C, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L8009F6FC, L8009F714, L8009F72C, L8009F74C -.word L8009F804, L8009F820, L8009F830, L8009F830 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A076C, L800A077C, L800A078C, L800A079C -.word L800A07AC, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A07BC, L800A07CC -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L8009F6CC, L8009F6E4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A07EC - -glabel jpt_800F19EC -.word L8009F844, L8009F874, L8009F8B8, L8009FB24 -.word L8009F904, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L8009FD14, L8009FD34, L8009FD34 -.word L8009FD34, L8009FD34, L8009FD58, L8009FD90 -.word L8009FD90, L8009FE9C, L8009FE9C, L8009FE9C -.word L8009FE9C, L8009FE9C, L8009FE9C, L8009FE9C -.word L8009FE9C, L800A08C4, L800A00CC, L800A08C4 -.word L800A08C4, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A08C4, L8009FCD8, L8009FCD8 -.word L8009FCD8, L800A08C4, L800A08C4, L800A08C4 -.word L800A08C4, L800A00DC, L800A01BC, L800A01BC -.word L800A01BC, L800A01BC, L800A01BC, L800A01BC -.word L800A01BC, L800A01BC, L800A0184, L800A00FC -.word L800A00FC, L800A00FC, L800A00FC - -glabel D_800F1AC8 -.float 0.9 - -glabel D_800F1ACC -.float 0.9 - -glabel jpt_800F1AD0 -.word L8009FF0C, L8009FF0C, L8009FF0C, L8009FF0C -.word L8009FF50, L8009FF50, L8009FF90, L8009FF90 - -glabel D_800F1AF0 -.float 0.6 - -glabel D_800F1AF4 -.float 0.8 - -glabel D_800F1AF8 -.float 0.8 - -glabel D_800F1AFC -.float 0.55 - -.section .text - -glabel func_8009F5E0 -/* 0A01E0 8009F5E0 27BDFF50 */ addiu $sp, $sp, -0xb0 -/* 0A01E4 8009F5E4 AFBF0034 */ sw $ra, 0x34($sp) -/* 0A01E8 8009F5E8 AFB10030 */ sw $s1, 0x30($sp) -/* 0A01EC 8009F5EC AFB0002C */ sw $s0, 0x2c($sp) -/* 0A01F0 8009F5F0 808E0015 */ lb $t6, 0x15($a0) -/* 0A01F4 8009F5F4 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 0A01F8 8009F5F8 00808825 */ move $s1, $a0 -/* 0A01FC 8009F5FC 11C004B1 */ beqz $t6, .L800A08C4 -/* 0A0200 8009F600 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 0A0204 8009F604 8E030000 */ lw $v1, ($s0) -/* 0A0208 8009F608 3C18E700 */ lui $t8, 0xe700 -/* 0A020C 8009F60C 246F0008 */ addiu $t7, $v1, 8 -/* 0A0210 8009F610 AE0F0000 */ sw $t7, ($s0) -/* 0A0214 8009F614 AC600004 */ sw $zero, 4($v1) -/* 0A0218 8009F618 AC780000 */ sw $t8, ($v1) -/* 0A021C 8009F61C 8C880000 */ lw $t0, ($a0) -/* 0A0220 8009F620 2901010F */ slti $at, $t0, 0x10f -/* 0A0224 8009F624 14200015 */ bnez $at, .L8009F67C -/* 0A0228 8009F628 01002025 */ move $a0, $t0 -/* 0A022C 8009F62C 28810131 */ slti $at, $a0, 0x131 -/* 0A0230 8009F630 1420000A */ bnez $at, .L8009F65C -/* 0A0234 8009F634 2489FED5 */ addiu $t1, $a0, -0x12b -/* 0A0238 8009F638 2499FE70 */ addiu $t9, $a0, -0x190 -/* 0A023C 8009F63C 2F21003F */ sltiu $at, $t9, 0x3f -/* 0A0240 8009F640 102004A0 */ beqz $at, .L800A08C4 -/* 0A0244 8009F644 0019C880 */ sll $t9, $t9, 2 -/* 0A0248 8009F648 3C01800F */ lui $at, %hi(jpt_800F15E4) -/* 0A024C 8009F64C 00390821 */ addu $at, $at, $t9 -/* 0A0250 8009F650 8C3915E4 */ lw $t9, %lo(jpt_800F15E4)($at) -/* 0A0254 8009F654 03200008 */ jr $t9 -/* 0A0258 8009F658 00000000 */ nop -.L8009F65C: -/* 0A025C 8009F65C 2D210006 */ sltiu $at, $t1, 6 -/* 0A0260 8009F660 10200498 */ beqz $at, .L800A08C4 -/* 0A0264 8009F664 00094880 */ sll $t1, $t1, 2 -/* 0A0268 8009F668 3C01800F */ lui $at, %hi(jpt_800F16E0) -/* 0A026C 8009F66C 00290821 */ addu $at, $at, $t1 -/* 0A0270 8009F670 8C2916E0 */ lw $t1, %lo(jpt_800F16E0)($at) -/* 0A0274 8009F674 01200008 */ jr $t1 -/* 0A0278 8009F678 00000000 */ nop -.L8009F67C: -/* 0A027C 8009F67C 28810038 */ slti $at, $a0, 0x38 -/* 0A0280 8009F680 1420000A */ bnez $at, .L8009F6AC -/* 0A0284 8009F684 248BFFFF */ addiu $t3, $a0, -1 -/* 0A0288 8009F688 248AFFAE */ addiu $t2, $a0, -0x52 -/* 0A028C 8009F68C 2D4100BD */ sltiu $at, $t2, 0xbd -/* 0A0290 8009F690 1020048C */ beqz $at, .L800A08C4 -/* 0A0294 8009F694 000A5080 */ sll $t2, $t2, 2 -/* 0A0298 8009F698 3C01800F */ lui $at, %hi(jpt_800F16F8) -/* 0A029C 8009F69C 002A0821 */ addu $at, $at, $t2 -/* 0A02A0 8009F6A0 8C2A16F8 */ lw $t2, %lo(jpt_800F16F8)($at) -/* 0A02A4 8009F6A4 01400008 */ jr $t2 -/* 0A02A8 8009F6A8 00000000 */ nop -.L8009F6AC: -/* 0A02AC 8009F6AC 2D610037 */ sltiu $at, $t3, 0x37 -/* 0A02B0 8009F6B0 10200484 */ beqz $at, .L800A08C4 -/* 0A02B4 8009F6B4 000B5880 */ sll $t3, $t3, 2 -/* 0A02B8 8009F6B8 3C01800F */ lui $at, %hi(jpt_800F19EC) -/* 0A02BC 8009F6BC 002B0821 */ addu $at, $at, $t3 -/* 0A02C0 8009F6C0 8C2B19EC */ lw $t3, %lo(jpt_800F19EC)($at) -/* 0A02C4 8009F6C4 01600008 */ jr $t3 -/* 0A02C8 8009F6C8 00000000 */ nop -glabel L8009F6CC -/* 0A02CC 8009F6CC 3C048015 */ lui $a0, %hi(gGfxPool) # $a0, 0x8015 -/* 0A02D0 8009F6D0 8C84EF40 */ lw $a0, %lo(gGfxPool)($a0) -/* 0A02D4 8009F6D4 0C025198 */ jal func_80094660 -/* 0A02D8 8009F6D8 8E25001C */ lw $a1, 0x1c($s1) -/* 0A02DC 8009F6DC 1000047A */ b .L800A08C8 -/* 0A02E0 8009F6E0 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009F6E4 -/* 0A02E4 8009F6E4 3C048015 */ lui $a0, %hi(gGfxPool) # $a0, 0x8015 -/* 0A02E8 8009F6E8 8C84EF40 */ lw $a0, %lo(gGfxPool)($a0) -/* 0A02EC 8009F6EC 0C0251ED */ jal func_800947B4 -/* 0A02F0 8009F6F0 8E25001C */ lw $a1, 0x1c($s1) -/* 0A02F4 8009F6F4 10000474 */ b .L800A08C8 -/* 0A02F8 8009F6F8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009F6FC -/* 0A02FC 8009F6FC 3C050200 */ lui $a1, %hi(D_020014C8) # $a1, 0x200 -/* 0A0300 8009F700 24A514C8 */ addiu $a1, %lo(D_020014C8) # addiu $a1, $a1, 0x14c8 -/* 0A0304 8009F704 0C026E74 */ jal func_8009B9D0 -/* 0A0308 8009F708 8E040000 */ lw $a0, ($s0) -/* 0A030C 8009F70C 1000046D */ b .L800A08C4 -/* 0A0310 8009F710 AE020000 */ sw $v0, ($s0) -glabel L8009F714 -/* 0A0314 8009F714 3C050200 */ lui $a1, %hi(D_02001540) # $a1, 0x200 -/* 0A0318 8009F718 24A51540 */ addiu $a1, %lo(D_02001540) # addiu $a1, $a1, 0x1540 -/* 0A031C 8009F71C 0C026E74 */ jal func_8009B9D0 -/* 0A0320 8009F720 8E040000 */ lw $a0, ($s0) -/* 0A0324 8009F724 10000467 */ b .L800A08C4 -/* 0A0328 8009F728 AE020000 */ sw $v0, ($s0) -glabel L8009F72C -/* 0A032C 8009F72C 0C028278 */ jal func_800A09E0 -/* 0A0330 8009F730 02202025 */ move $a0, $s1 -/* 0A0334 8009F734 0C0282B4 */ jal func_800A0AD0 -/* 0A0338 8009F738 02202025 */ move $a0, $s1 -/* 0A033C 8009F73C 0C0282E0 */ jal func_800A0B80 -/* 0A0340 8009F740 02202025 */ move $a0, $s1 -/* 0A0344 8009F744 10000460 */ b .L800A08C8 -/* 0A0348 8009F748 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009F74C -/* 0A034C 8009F74C 8E030000 */ lw $v1, ($s0) -/* 0A0350 8009F750 3C11FA00 */ lui $s1, 0xfa00 -/* 0A0354 8009F754 240D00FF */ li $t5, 255 -/* 0A0358 8009F758 246C0008 */ addiu $t4, $v1, 8 -/* 0A035C 8009F75C AE0C0000 */ sw $t4, ($s0) -/* 0A0360 8009F760 3C050200 */ lui $a1, %hi(D_020015A4) # $a1, 0x200 -/* 0A0364 8009F764 AC6D0004 */ sw $t5, 4($v1) -/* 0A0368 8009F768 AC710000 */ sw $s1, ($v1) -/* 0A036C 8009F76C 8E040000 */ lw $a0, ($s0) -/* 0A0370 8009F770 0C026E74 */ jal func_8009B9D0 -/* 0A0374 8009F774 24A515A4 */ addiu $a1, %lo(D_020015A4) # addiu $a1, $a1, 0x15a4 -/* 0A0378 8009F778 AE020000 */ sw $v0, ($s0) -/* 0A037C 8009F77C 244E0008 */ addiu $t6, $v0, 8 -/* 0A0380 8009F780 AE0E0000 */ sw $t6, ($s0) -/* 0A0384 8009F784 3C0F3200 */ lui $t7, (0x320000FF >> 16) # lui $t7, 0x3200 -/* 0A0388 8009F788 35EF00FF */ ori $t7, (0x320000FF & 0xFFFF) # ori $t7, $t7, 0xff -/* 0A038C 8009F78C AC4F0004 */ sw $t7, 4($v0) -/* 0A0390 8009F790 AC510000 */ sw $s1, ($v0) -/* 0A0394 8009F794 3C050200 */ lui $a1, %hi(D_020015CC) # $a1, 0x200 -/* 0A0398 8009F798 24A515CC */ addiu $a1, %lo(D_020015CC) # addiu $a1, $a1, 0x15cc -/* 0A039C 8009F79C 0C026E74 */ jal func_8009B9D0 -/* 0A03A0 8009F7A0 8E040000 */ lw $a0, ($s0) -/* 0A03A4 8009F7A4 AE020000 */ sw $v0, ($s0) -/* 0A03A8 8009F7A8 24580008 */ addiu $t8, $v0, 8 -/* 0A03AC 8009F7AC AE180000 */ sw $t8, ($s0) -/* 0A03B0 8009F7B0 3C190032 */ lui $t9, (0x003200FF >> 16) -/* 0A03B4 8009F7B4 373900FF */ ori $t9, (0x003200FF & 0xFFFF) # ori $t9, $t9, 0xff -/* 0A03B8 8009F7B8 AC590004 */ sw $t9, 4($v0) -/* 0A03BC 8009F7BC AC510000 */ sw $s1, ($v0) -/* 0A03C0 8009F7C0 3C050200 */ lui $a1, %hi(D_02001630) # $a1, 0x200 -/* 0A03C4 8009F7C4 24A51630 */ addiu $a1, %lo(D_02001630) # addiu $a1, $a1, 0x1630 -/* 0A03C8 8009F7C8 0C026E74 */ jal func_8009B9D0 -/* 0A03CC 8009F7CC 8E040000 */ lw $a0, ($s0) -/* 0A03D0 8009F7D0 AE020000 */ sw $v0, ($s0) -/* 0A03D4 8009F7D4 24490008 */ addiu $t1, $v0, 8 -/* 0A03D8 8009F7D8 AE090000 */ sw $t1, ($s0) -/* 0A03DC 8009F7DC 3C0A3232 */ lui $t2, (0x323200FF >> 16) # lui $t2, 0x3232 -/* 0A03E0 8009F7E0 354A00FF */ ori $t2, (0x323200FF & 0xFFFF) # ori $t2, $t2, 0xff -/* 0A03E4 8009F7E4 AC4A0004 */ sw $t2, 4($v0) -/* 0A03E8 8009F7E8 AC510000 */ sw $s1, ($v0) -/* 0A03EC 8009F7EC 3C050200 */ lui $a1, %hi(D_02001658) # $a1, 0x200 -/* 0A03F0 8009F7F0 24A51658 */ addiu $a1, %lo(D_02001658) # addiu $a1, $a1, 0x1658 -/* 0A03F4 8009F7F4 0C026E74 */ jal func_8009B9D0 -/* 0A03F8 8009F7F8 8E040000 */ lw $a0, ($s0) -/* 0A03FC 8009F7FC 10000431 */ b .L800A08C4 -/* 0A0400 8009F800 AE020000 */ sw $v0, ($s0) -glabel L8009F804 -/* 0A0404 8009F804 8E240018 */ lw $a0, %lo(D_FA000018)($s1) -/* 0A0408 8009F808 8E25000C */ lw $a1, %lo(D_FA00000C)($s1) -/* 0A040C 8009F80C 8E260010 */ lw $a2, %lo(D_FA000010)($s1) -/* 0A0410 8009F810 0C0269DB */ jal func_8009A76C -/* 0A0414 8009F814 2407FFFF */ li $a3, -1 -/* 0A0418 8009F818 1000042B */ b .L800A08C8 -/* 0A041C 8009F81C 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009F820 -/* 0A0420 8009F820 0C02837F */ jal func_800A0DFC -/* 0A0424 8009F824 00000000 */ nop -/* 0A0428 8009F828 10000427 */ b .L800A08C8 -/* 0A042C 8009F82C 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009F830 -/* 0A0430 8009F830 02202025 */ move $a0, $s1 -/* 0A0434 8009F834 0C0283AE */ jal func_800A0EB8 -/* 0A0438 8009F838 2505FF28 */ addiu $a1, $t0, -0xd8 -/* 0A043C 8009F83C 10000422 */ b .L800A08C8 -/* 0A0440 8009F840 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009F844 -/* 0A0444 8009F844 0C02D557 */ jal func_800B555C -/* 0A0448 8009F848 00000000 */ nop -/* 0A044C 8009F84C 00025880 */ sll $t3, $v0, 2 -/* 0A0450 8009F850 3C05800E */ lui $a1, %hi(D_800E7D4C) -/* 0A0454 8009F854 00AB2821 */ addu $a1, $a1, $t3 -/* 0A0458 8009F858 8CA57D4C */ lw $a1, %lo(D_800E7D4C)($a1) -/* 0A045C 8009F85C 8E040000 */ lw $a0, ($s0) -/* 0A0460 8009F860 8E26000C */ lw $a2, %lo(D_FA00000C)($s1) -/* 0A0464 8009F864 0C026E9D */ jal func_8009BA74 -/* 0A0468 8009F868 8E270010 */ lw $a3, %lo(D_FA000010)($s1) -/* 0A046C 8009F86C 10000415 */ b .L800A08C4 -/* 0A0470 8009F870 AE020000 */ sw $v0, ($s0) -glabel L8009F874 -/* 0A0474 8009F874 8E24000C */ lw $a0, %lo(D_FA00000C)($s1) -/* 0A0478 8009F878 8E250010 */ lw $a1, %lo(D_FA000010)($s1) -/* 0A047C 8009F87C 248400A0 */ addiu $a0, $a0, 0xa0 -/* 0A0480 8009F880 24A50047 */ addiu $a1, $a1, 0x47 -/* 0A0484 8009F884 00057400 */ sll $t6, $a1, 0x10 -/* 0A0488 8009F888 00046400 */ sll $t4, $a0, 0x10 -/* 0A048C 8009F88C 000C2403 */ sra $a0, $t4, 0x10 -/* 0A0490 8009F890 0C013235 */ jal func_8004C8D4 -/* 0A0494 8009F894 000E2C03 */ sra $a1, $t6, 0x10 -/* 0A0498 8009F898 3C050200 */ lui $a1, %hi(D_020045E8) # $a1, 0x200 -/* 0A049C 8009F89C 24A545E8 */ addiu $a1, %lo(D_020045E8) # addiu $a1, $a1, 0x45e8 -/* 0A04A0 8009F8A0 8E040000 */ lw $a0, ($s0) -/* 0A04A4 8009F8A4 8E26000C */ lw $a2, %lo(D_FA00000C)($s1) -/* 0A04A8 8009F8A8 0C026E9D */ jal func_8009BA74 -/* 0A04AC 8009F8AC 8E270010 */ lw $a3, %lo(D_FA000010)($s1) -/* 0A04B0 8009F8B0 10000404 */ b .L800A08C4 -/* 0A04B4 8009F8B4 AE020000 */ sw $v0, ($s0) -glabel L8009F8B8 -/* 0A04B8 8009F8B8 3C18800E */ lui $t8, %hi(gGlobalTimer) # $t8, 0x800e -/* 0A04BC 8009F8BC 8F18C54C */ lw $t8, %lo(gGlobalTimer)($t8) -/* 0A04C0 8009F8C0 3C050200 */ lui $a1, %hi(D_02004610) # $a1, 0x200 -/* 0A04C4 8009F8C4 24A54610 */ addiu $a1, %lo(D_02004610) # addiu $a1, $a1, 0x4610 -/* 0A04C8 8009F8C8 07010003 */ bgez $t8, .L8009F8D8 -/* 0A04CC 8009F8CC 0018C8C3 */ sra $t9, $t8, 3 -/* 0A04D0 8009F8D0 27010007 */ addiu $at, $t8, 7 -/* 0A04D4 8009F8D4 0001C8C3 */ sra $t9, $at, 3 -.L8009F8D8: -/* 0A04D8 8009F8D8 24010003 */ li $at, 3 -/* 0A04DC 8009F8DC 0321001A */ div $zero, $t9, $at -/* 0A04E0 8009F8E0 00004810 */ mfhi $t1 -/* 0A04E4 8009F8E4 512003F8 */ beql $t1, $zero, .L800A08C8 -/* 0A04E8 8009F8E8 8FBF0034 */ lw $ra, 0x34($sp) -/* 0A04EC 8009F8EC 8E040000 */ lw $a0, ($s0) -/* 0A04F0 8009F8F0 8E26000C */ lw $a2, %lo(D_FA00000C)($s1) -/* 0A04F4 8009F8F4 0C026E9D */ jal func_8009BA74 -/* 0A04F8 8009F8F8 8E270010 */ lw $a3, %lo(D_FA000010)($s1) -/* 0A04FC 8009F8FC 100003F1 */ b .L800A08C4 -/* 0A0500 8009F900 AE020000 */ sw $v0, ($s0) -glabel L8009F904 -/* 0A0504 8009F904 3C11800E */ lui $s1, %hi(gCourseNamesDup) # $s1, 0x800e -/* 0A0508 8009F908 26317574 */ addiu $s1, %lo(gCourseNamesDup) # addiu $s1, $s1, 0x7574 -/* 0A050C 8009F90C 0C024C0D */ jal get_string_width -/* 0A0510 8009F910 8E240000 */ lw $a0, ($s1) -/* 0A0514 8009F914 244A0005 */ addiu $t2, $v0, 5 -/* 0A0518 8009F918 448A2000 */ mtc1 $t2, $f4 -/* 0A051C 8009F91C 3C01800F */ lui $at, %hi(D_800F1AC8) # $at, 0x800f -/* 0A0520 8009F920 C4281AC8 */ lwc1 $f8, %lo(D_800F1AC8)($at) -/* 0A0524 8009F924 468021A0 */ cvt.s.w $f6, $f4 -/* 0A0528 8009F928 240D00A0 */ li $t5, 160 -/* 0A052C 8009F92C 240E00A4 */ li $t6, 164 -/* 0A0530 8009F930 240F0096 */ li $t7, 150 -/* 0A0534 8009F934 AFAF0020 */ sw $t7, 0x20($sp) -/* 0A0538 8009F938 AFAE0010 */ sw $t6, 0x10($sp) -/* 0A053C 8009F93C 46083282 */ mul.s $f10, $f6, $f8 -/* 0A0540 8009F940 8E040000 */ lw $a0, ($s0) -/* 0A0544 8009F944 2406007B */ li $a2, 123 -/* 0A0548 8009F948 AFA00014 */ sw $zero, 0x14($sp) -/* 0A054C 8009F94C AFA00018 */ sw $zero, 0x18($sp) -/* 0A0550 8009F950 AFA0001C */ sw $zero, 0x1c($sp) -/* 0A0554 8009F954 4600540D */ trunc.w.s $f16, $f10 -/* 0A0558 8009F958 44038000 */ mfc1 $v1, $f16 -/* 0A055C 8009F95C 00000000 */ nop -/* 0A0560 8009F960 04610003 */ bgez $v1, .L8009F970 -/* 0A0564 8009F964 00036043 */ sra $t4, $v1, 1 -/* 0A0568 8009F968 24610001 */ addiu $at, $v1, 1 -/* 0A056C 8009F96C 00016043 */ sra $t4, $at, 1 -.L8009F970: -/* 0A0570 8009F970 01801825 */ move $v1, $t4 -/* 0A0574 8009F974 01AC2823 */ subu $a1, $t5, $t4 -/* 0A0578 8009F978 0C02637E */ jal draw_box -/* 0A057C 8009F97C 258700A0 */ addiu $a3, $t4, 0xa0 -/* 0A0580 8009F980 AE020000 */ sw $v0, ($s0) -/* 0A0584 8009F984 0C024C36 */ jal set_text_color -/* 0A0588 8009F988 24040001 */ li $a0, 1 -/* 0A058C 8009F98C 3C01800F */ lui $at, %hi(D_800F1ACC) # $at, 0x800f -/* 0A0590 8009F990 C4201ACC */ lwc1 $f0, %lo(D_800F1ACC)($at) -/* 0A0594 8009F994 2404009B */ li $a0, 155 -/* 0A0598 8009F998 2405008C */ li $a1, 140 -/* 0A059C 8009F99C 8E260000 */ lw $a2, ($s1) -/* 0A05A0 8009F9A0 00003825 */ move $a3, $zero -/* 0A05A4 8009F9A4 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A05A8 8009F9A8 0C024DBB */ jal draw_text -/* 0A05AC 8009F9AC E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A05B0 8009F9B0 00002025 */ move $a0, $zero -/* 0A05B4 8009F9B4 0C02D3AD */ jal func_800B4EB4 -/* 0A05B8 8009F9B8 24050007 */ li $a1, 7 -/* 0A05BC 8009F9BC 3C01000F */ lui $at, (0x000FFFFF >> 16) -/* 0A05C0 8009F9C0 3421FFFF */ ori $at, (0x000FFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0A05C4 8009F9C4 00411824 */ and $v1, $v0, $at -/* 0A05C8 8009F9C8 28611EAA */ slti $at, $v1, 0x1eaa -/* 0A05CC 8009F9CC 1020000C */ beqz $at, .L8009FA00 -/* 0A05D0 8009F9D0 00608825 */ move $s1, $v1 -/* 0A05D4 8009F9D4 3C04800E */ lui $a0, %hi(gGlobalTimer) # $a0, 0x800e -/* 0A05D8 8009F9D8 8C84C54C */ lw $a0, %lo(gGlobalTimer)($a0) -/* 0A05DC 8009F9DC 04810004 */ bgez $a0, .L8009F9F0 -/* 0A05E0 8009F9E0 30980001 */ andi $t8, $a0, 1 -/* 0A05E4 8009F9E4 13000002 */ beqz $t8, .L8009F9F0 -/* 0A05E8 8009F9E8 00000000 */ nop -/* 0A05EC 8009F9EC 2718FFFE */ addiu $t8, $t8, -2 -.L8009F9F0: -/* 0A05F0 8009F9F0 0C024C36 */ jal set_text_color -/* 0A05F4 8009F9F4 03002025 */ move $a0, $t8 -/* 0A05F8 8009F9F8 1000000F */ b .L8009FA38 -/* 0A05FC 8009F9FC 27B00080 */ addiu $s0, $sp, 0x80 -.L8009FA00: -/* 0A0600 8009FA00 28612329 */ slti $at, $v1, 0x2329 -/* 0A0604 8009FA04 10200009 */ beqz $at, .L8009FA2C -/* 0A0608 8009FA08 3C04800E */ lui $a0, %hi(gGlobalTimer) # $a0, 0x800e -/* 0A060C 8009FA0C 8C84C54C */ lw $a0, %lo(gGlobalTimer)($a0) -/* 0A0610 8009FA10 24010003 */ li $at, 3 -/* 0A0614 8009FA14 0081001A */ div $zero, $a0, $at -/* 0A0618 8009FA18 00002010 */ mfhi $a0 -/* 0A061C 8009FA1C 0C024C36 */ jal set_text_color -/* 0A0620 8009FA20 00000000 */ nop -/* 0A0624 8009FA24 10000004 */ b .L8009FA38 -/* 0A0628 8009FA28 27B00080 */ addiu $s0, $sp, 0x80 -.L8009FA2C: -/* 0A062C 8009FA2C 0C024C36 */ jal set_text_color -/* 0A0630 8009FA30 24040003 */ li $a0, 3 -/* 0A0634 8009FA34 27B00080 */ addiu $s0, $sp, 0x80 -.L8009FA38: -/* 0A0638 8009FA38 02002825 */ move $a1, $s0 -/* 0A063C 8009FA3C 0C029E3D */ jal get_time_record_minutes -/* 0A0640 8009FA40 02202025 */ move $a0, $s1 -/* 0A0644 8009FA44 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A0648 8009FA48 44810000 */ mtc1 $at, $f0 -/* 0A064C 8009FA4C 24040077 */ li $a0, 119 -/* 0A0650 8009FA50 240500A0 */ li $a1, 160 -/* 0A0654 8009FA54 02003025 */ move $a2, $s0 -/* 0A0658 8009FA58 00003825 */ move $a3, $zero -/* 0A065C 8009FA5C E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A0660 8009FA60 0C024E72 */ jal func_800939C8 -/* 0A0664 8009FA64 E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A0668 8009FA68 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A066C 8009FA6C 44810000 */ mtc1 $at, $f0 -/* 0A0670 8009FA70 3C06800F */ lui $a2, %hi(D_800F0C14) # $a2, 0x800f -/* 0A0674 8009FA74 24C60C14 */ addiu $a2, %lo(D_800F0C14) # addiu $a2, $a2, 0xc14 -/* 0A0678 8009FA78 2404008B */ li $a0, 139 -/* 0A067C 8009FA7C 240500A0 */ li $a1, 160 -/* 0A0680 8009FA80 00003825 */ move $a3, $zero -/* 0A0684 8009FA84 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A0688 8009FA88 0C024CC9 */ jal func_80093324 -/* 0A068C 8009FA8C E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A0690 8009FA90 02202025 */ move $a0, $s1 -/* 0A0694 8009FA94 0C029E51 */ jal get_time_record_seconds -/* 0A0698 8009FA98 02002825 */ move $a1, $s0 -/* 0A069C 8009FA9C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A06A0 8009FAA0 44810000 */ mtc1 $at, $f0 -/* 0A06A4 8009FAA4 24040094 */ li $a0, 148 -/* 0A06A8 8009FAA8 240500A0 */ li $a1, 160 -/* 0A06AC 8009FAAC 02003025 */ move $a2, $s0 -/* 0A06B0 8009FAB0 00003825 */ move $a3, $zero -/* 0A06B4 8009FAB4 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A06B8 8009FAB8 0C024E72 */ jal func_800939C8 -/* 0A06BC 8009FABC E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A06C0 8009FAC0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A06C4 8009FAC4 44810000 */ mtc1 $at, $f0 -/* 0A06C8 8009FAC8 3C06800F */ lui $a2, %hi(D_800F0C18) # $a2, 0x800f -/* 0A06CC 8009FACC 24C60C18 */ addiu $a2, %lo(D_800F0C18) # addiu $a2, $a2, 0xc18 -/* 0A06D0 8009FAD0 240400A7 */ li $a0, 167 -/* 0A06D4 8009FAD4 240500A0 */ li $a1, 160 -/* 0A06D8 8009FAD8 00003825 */ move $a3, $zero -/* 0A06DC 8009FADC E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A06E0 8009FAE0 0C024CC9 */ jal func_80093324 -/* 0A06E4 8009FAE4 E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A06E8 8009FAE8 02202025 */ move $a0, $s1 -/* 0A06EC 8009FAEC 0C029E69 */ jal get_time_record_centiseconds -/* 0A06F0 8009FAF0 02002825 */ move $a1, $s0 -/* 0A06F4 8009FAF4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A06F8 8009FAF8 44819000 */ mtc1 $at, $f18 -/* 0A06FC 8009FAFC 44812000 */ mtc1 $at, $f4 -/* 0A0700 8009FB00 240400B4 */ li $a0, 180 -/* 0A0704 8009FB04 240500A0 */ li $a1, 160 -/* 0A0708 8009FB08 02003025 */ move $a2, $s0 -/* 0A070C 8009FB0C 00003825 */ move $a3, $zero -/* 0A0710 8009FB10 E7B20010 */ swc1 $f18, 0x10($sp) -/* 0A0714 8009FB14 0C024E72 */ jal func_800939C8 -/* 0A0718 8009FB18 E7A40014 */ swc1 $f4, 0x14($sp) -/* 0A071C 8009FB1C 1000036A */ b .L800A08C8 -/* 0A0720 8009FB20 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009FB24 -/* 0A0724 8009FB24 3C11800E */ lui $s1, %hi(D_800E77A0) # $s1, 0x800e -/* 0A0728 8009FB28 263177A0 */ addiu $s1, %lo(D_800E77A0) # addiu $s1, $s1, 0x77a0 -/* 0A072C 8009FB2C 0C024C0D */ jal get_string_width -/* 0A0730 8009FB30 8E240000 */ lw $a0, ($s1) -/* 0A0734 8009FB34 8E240004 */ lw $a0, 4($s1) -/* 0A0738 8009FB38 0C024C0D */ jal get_string_width -/* 0A073C 8009FB3C AFA20058 */ sw $v0, 0x58($sp) -/* 0A0740 8009FB40 8FA80058 */ lw $t0, 0x58($sp) -/* 0A0744 8009FB44 0102082A */ slt $at, $t0, $v0 -/* 0A0748 8009FB48 50200003 */ beql $at, $zero, .L8009FB58 -/* 0A074C 8009FB4C 44883000 */ mtc1 $t0, $f6 -/* 0A0750 8009FB50 00404025 */ move $t0, $v0 -/* 0A0754 8009FB54 44883000 */ mtc1 $t0, $f6 -.L8009FB58: -/* 0A0758 8009FB58 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0A075C 8009FB5C 44810000 */ mtc1 $at, $f0 -/* 0A0760 8009FB60 46803220 */ cvt.s.w $f8, $f6 -/* 0A0764 8009FB64 240B00A0 */ li $t3, 160 -/* 0A0768 8009FB68 240E00B6 */ li $t6, 182 -/* 0A076C 8009FB6C 24180096 */ li $t8, 150 -/* 0A0770 8009FB70 AFB80020 */ sw $t8, 0x20($sp) -/* 0A0774 8009FB74 8E040000 */ lw $a0, ($s0) -/* 0A0778 8009FB78 46004282 */ mul.s $f10, $f8, $f0 -/* 0A077C 8009FB7C 44804000 */ mtc1 $zero, $f8 -/* 0A0780 8009FB80 AFA00014 */ sw $zero, 0x14($sp) -/* 0A0784 8009FB84 AFA00018 */ sw $zero, 0x18($sp) -/* 0A0788 8009FB88 AFA0001C */ sw $zero, 0x1c($sp) -/* 0A078C 8009FB8C 4600540D */ trunc.w.s $f16, $f10 -/* 0A0790 8009FB90 44028000 */ mfc1 $v0, $f16 -/* 0A0794 8009FB94 44808000 */ mtc1 $zero, $f16 -/* 0A0798 8009FB98 04410003 */ bgez $v0, .L8009FBA8 -/* 0A079C 8009FB9C 00025043 */ sra $t2, $v0, 1 -/* 0A07A0 8009FBA0 24410001 */ addiu $at, $v0, 1 -/* 0A07A4 8009FBA4 00015043 */ sra $t2, $at, 1 -.L8009FBA8: -/* 0A07A8 8009FBA8 3C014000 */ li $at, 0x40000000 # 2.000000 -/* 0A07AC 8009FBAC 44819000 */ mtc1 $at, $f18 -/* 0A07B0 8009FBB0 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 0A07B4 8009FBB4 44814800 */ mtc1 $at, $f9 -/* 0A07B8 8009FBB8 46120102 */ mul.s $f4, $f0, $f18 -/* 0A07BC 8009FBBC 3C014030 */ li $at, 0x40300000 # 2.750000 -/* 0A07C0 8009FBC0 44818800 */ mtc1 $at, $f17 -/* 0A07C4 8009FBC4 01401025 */ move $v0, $t2 -/* 0A07C8 8009FBC8 244700A0 */ addiu $a3, $v0, 0xa0 -/* 0A07CC 8009FBCC 016A2823 */ subu $a1, $t3, $t2 -/* 0A07D0 8009FBD0 460021A1 */ cvt.d.s $f6, $f4 -/* 0A07D4 8009FBD4 46283280 */ add.d $f10, $f6, $f8 -/* 0A07D8 8009FBD8 46305482 */ mul.d $f18, $f10, $f16 -/* 0A07DC 8009FBDC 4620910D */ trunc.w.d $f4, $f18 -/* 0A07E0 8009FBE0 44032000 */ mfc1 $v1, $f4 -/* 0A07E4 8009FBE4 00000000 */ nop -/* 0A07E8 8009FBE8 04610003 */ bgez $v1, .L8009FBF8 -/* 0A07EC 8009FBEC 00036843 */ sra $t5, $v1, 1 -/* 0A07F0 8009FBF0 24610001 */ addiu $at, $v1, 1 -/* 0A07F4 8009FBF4 00016843 */ sra $t5, $at, 1 -.L8009FBF8: -/* 0A07F8 8009FBF8 25AF00B6 */ addiu $t7, $t5, 0xb6 -/* 0A07FC 8009FBFC AFAF0010 */ sw $t7, 0x10($sp) -/* 0A0800 8009FC00 01A01825 */ move $v1, $t5 -/* 0A0804 8009FC04 0C02637E */ jal draw_box -/* 0A0808 8009FC08 01CD3023 */ subu $a2, $t6, $t5 -/* 0A080C 8009FC0C AE020000 */ sw $v0, ($s0) -/* 0A0810 8009FC10 0C024C36 */ jal set_text_color -/* 0A0814 8009FC14 24040004 */ li $a0, 4 -/* 0A0818 8009FC18 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0A081C 8009FC1C 44810000 */ mtc1 $at, $f0 -/* 0A0820 8009FC20 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A0824 8009FC24 44815000 */ mtc1 $at, $f10 -/* 0A0828 8009FC28 241900A0 */ li $t9, 160 -/* 0A082C 8009FC2C 44993000 */ mtc1 $t9, $f6 -/* 0A0830 8009FC30 46005402 */ mul.s $f16, $f10, $f0 -/* 0A0834 8009FC34 240A00B4 */ li $t2, 180 -/* 0A0838 8009FC38 3C02800E */ lui $v0, %hi(D_800E77A0) # $v0, 0x800e -/* 0A083C 8009FC3C 244277A0 */ addiu $v0, %lo(D_800E77A0) # addiu $v0, $v0, 0x77a0 -/* 0A0840 8009FC40 00001825 */ move $v1, $zero -/* 0A0844 8009FC44 46803220 */ cvt.s.w $f8, $f6 -/* 0A0848 8009FC48 448A3000 */ mtc1 $t2, $f6 -/* 0A084C 8009FC4C 00000000 */ nop -/* 0A0850 8009FC50 468030A0 */ cvt.s.w $f2, $f6 -/* 0A0854 8009FC54 46104481 */ sub.s $f18, $f8, $f16 -/* 0A0858 8009FC58 E7A20038 */ swc1 $f2, 0x38($sp) -/* 0A085C 8009FC5C 4600910D */ trunc.w.s $f4, $f18 -/* 0A0860 8009FC60 44042000 */ mfc1 $a0, $f4 -/* 0A0864 8009FC64 00000000 */ nop -/* 0A0868 8009FC68 AFA4003C */ sw $a0, 0x3c($sp) -.L8009FC6C: -/* 0A086C 8009FC6C 44835000 */ mtc1 $v1, $f10 -/* 0A0870 8009FC70 C7A20038 */ lwc1 $f2, 0x38($sp) -/* 0A0874 8009FC74 8FA4003C */ lw $a0, 0x3c($sp) -/* 0A0878 8009FC78 46805220 */ cvt.s.w $f8, $f10 -/* 0A087C 8009FC7C 8C460000 */ lw $a2, ($v0) -/* 0A0880 8009FC80 00003825 */ move $a3, $zero -/* 0A0884 8009FC84 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A0888 8009FC88 E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A088C 8009FC8C AFA20040 */ sw $v0, 0x40($sp) -/* 0A0890 8009FC90 46004402 */ mul.s $f16, $f8, $f0 -/* 0A0894 8009FC94 AFA30044 */ sw $v1, 0x44($sp) -/* 0A0898 8009FC98 46101480 */ add.s $f18, $f2, $f16 -/* 0A089C 8009FC9C 4600910D */ trunc.w.s $f4, $f18 -/* 0A08A0 8009FCA0 44052000 */ mfc1 $a1, $f4 -/* 0A08A4 8009FCA4 0C024DBB */ jal draw_text -/* 0A08A8 8009FCA8 00000000 */ nop -/* 0A08AC 8009FCAC 8FA20040 */ lw $v0, 0x40($sp) -/* 0A08B0 8009FCB0 8FA30044 */ lw $v1, 0x44($sp) -/* 0A08B4 8009FCB4 3C0C800E */ lui $t4, %hi(D_800E77A8) # $t4, 0x800e -/* 0A08B8 8009FCB8 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0A08BC 8009FCBC 258C77A8 */ addiu $t4, %lo(D_800E77A8) # addiu $t4, $t4, 0x77a8 -/* 0A08C0 8009FCC0 44810000 */ mtc1 $at, $f0 -/* 0A08C4 8009FCC4 24420004 */ addiu $v0, $v0, 4 -/* 0A08C8 8009FCC8 144CFFE8 */ bne $v0, $t4, .L8009FC6C -/* 0A08CC 8009FCCC 24630012 */ addiu $v1, $v1, 0x12 -/* 0A08D0 8009FCD0 100002FD */ b .L800A08C8 -/* 0A08D4 8009FCD4 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009FCD8 -/* 0A08D8 8009FCD8 0C02D557 */ jal func_800B555C -/* 0A08DC 8009FCDC 00000000 */ nop -/* 0A08E0 8009FCE0 00026880 */ sll $t5, $v0, 2 -/* 0A08E4 8009FCE4 3C05800E */ lui $a1, %hi(D_800E7D4C) -/* 0A08E8 8009FCE8 00AD2821 */ addu $a1, $a1, $t5 -/* 0A08EC 8009FCEC 8E26000C */ lw $a2, 0xc($s1) -/* 0A08F0 8009FCF0 8E270010 */ lw $a3, 0x10($s1) -/* 0A08F4 8009FCF4 240E0003 */ li $t6, 3 -/* 0A08F8 8009FCF8 AFAE0010 */ sw $t6, 0x10($sp) -/* 0A08FC 8009FCFC AFA00014 */ sw $zero, 0x14($sp) -/* 0A0900 8009FD00 8CA57D4C */ lw $a1, %lo(D_800E7D4C)($a1) -/* 0A0904 8009FD04 0C026F27 */ jal func_8009BC9C -/* 0A0908 8009FD08 8E040000 */ lw $a0, ($s0) -/* 0A090C 8009FD0C 100002ED */ b .L800A08C4 -/* 0A0910 8009FD10 AE020000 */ sw $v0, ($s0) -glabel L8009FD14 -/* 0A0914 8009FD14 3C050200 */ lui $a1, %hi(D_02004660) # $a1, 0x200 -/* 0A0918 8009FD18 24A54660 */ addiu $a1, %lo(D_02004660) # addiu $a1, $a1, 0x4660 -/* 0A091C 8009FD1C 8E040000 */ lw $a0, ($s0) -/* 0A0920 8009FD20 8E26000C */ lw $a2, 0xc($s1) -/* 0A0924 8009FD24 0C026E9D */ jal func_8009BA74 -/* 0A0928 8009FD28 8E270010 */ lw $a3, 0x10($s1) -/* 0A092C 8009FD2C 100002E5 */ b .L800A08C4 -/* 0A0930 8009FD30 AE020000 */ sw $v0, ($s0) -glabel L8009FD34 -/* 0A0934 8009FD34 2504FFF5 */ addiu $a0, $t0, -0xb -/* 0A0938 8009FD38 AFA400AC */ sw $a0, 0xac($sp) -/* 0A093C 8009FD3C 0C02A09C */ jal func_800A8270 -/* 0A0940 8009FD40 02202825 */ move $a1, $s1 -/* 0A0944 8009FD44 8FA500AC */ lw $a1, 0xac($sp) -/* 0A0948 8009FD48 0C0283E9 */ jal func_800A0FA4 -/* 0A094C 8009FD4C 02202025 */ move $a0, $s1 -/* 0A0950 8009FD50 100002DD */ b .L800A08C8 -/* 0A0954 8009FD54 8FBF0034 */ lw $ra, 0x34($sp) -glabel L8009FD58 -/* 0A0958 8009FD58 0C02A159 */ jal func_800A8564 -/* 0A095C 8009FD5C 02202025 */ move $a0, $s1 -/* 0A0960 8009FD60 8E26000C */ lw $a2, 0xc($s1) -/* 0A0964 8009FD64 8E270010 */ lw $a3, 0x10($s1) -/* 0A0968 8009FD68 240F0002 */ li $t7, 2 -/* 0A096C 8009FD6C AFAF0010 */ sw $t7, 0x10($sp) -/* 0A0970 8009FD70 8E38001C */ lw $t8, 0x1c($s1) -/* 0A0974 8009FD74 3C050200 */ lui $a1, %hi(D_0200487C) # $a1, 0x200 -/* 0A0978 8009FD78 24A5487C */ addiu $a1, %lo(D_0200487C) # addiu $a1, $a1, 0x487c -/* 0A097C 8009FD7C 8E040000 */ lw $a0, ($s0) -/* 0A0980 8009FD80 0C026F27 */ jal func_8009BC9C -/* 0A0984 8009FD84 AFB80014 */ sw $t8, 0x14($sp) -/* 0A0988 8009FD88 100002CE */ b .L800A08C4 -/* 0A098C 8009FD8C AE020000 */ sw $v0, ($s0) -glabel L8009FD90 -/* 0A0990 8009FD90 8E23001C */ lw $v1, 0x1c($s1) -/* 0A0994 8009FD94 2506FFF1 */ addiu $a2, $t0, -0xf -/* 0A0998 8009FD98 3C098019 */ lui $t1, %hi(gMainMenuSelectionDepth) # $t1, 0x8019 -/* 0A099C 8009FD9C 28610020 */ slti $at, $v1, 0x20 -/* 0A09A0 8009FDA0 50200030 */ beql $at, $zero, .L8009FE64 -/* 0A09A4 8009FDA4 2518FFF6 */ addiu $t8, $t0, -0xa -/* 0A09A8 8009FDA8 000340C0 */ sll $t0, $v1, 3 -/* 0A09AC 8009FDAC 01034023 */ subu $t0, $t0, $v1 -/* 0A09B0 8009FDB0 00084080 */ sll $t0, $t0, 2 -/* 0A09B4 8009FDB4 01034021 */ addu $t0, $t0, $v1 -/* 0A09B8 8009FDB8 00084040 */ sll $t0, $t0, 1 -/* 0A09BC 8009FDBC 8129EDED */ lb $t1, %lo(gMainMenuSelectionDepth)($t1) -/* 0A09C0 8009FDC0 05010003 */ bgez $t0, .L8009FDD0 -/* 0A09C4 8009FDC4 0008C983 */ sra $t9, $t0, 6 -/* 0A09C8 8009FDC8 2501003F */ addiu $at, $t0, 0x3f -/* 0A09CC 8009FDCC 0001C983 */ sra $t9, $at, 6 -.L8009FDD0: -/* 0A09D0 8009FDD0 14C9000F */ bne $a2, $t1, .L8009FE10 -/* 0A09D4 8009FDD4 03204025 */ move $t0, $t9 -/* 0A09D8 8009FDD8 8E22000C */ lw $v0, 0xc($s1) -/* 0A09DC 8009FDDC 8E230010 */ lw $v1, 0x10($s1) -/* 0A09E0 8009FDE0 8E040000 */ lw $a0, ($s0) -/* 0A09E4 8009FDE4 00593823 */ subu $a3, $v0, $t9 -/* 0A09E8 8009FDE8 246A0012 */ addiu $t2, $v1, 0x12 -/* 0A09EC 8009FDEC AFAA0010 */ sw $t2, 0x10($sp) -/* 0A09F0 8009FDF0 24E70039 */ addiu $a3, $a3, 0x39 -/* 0A09F4 8009FDF4 00592821 */ addu $a1, $v0, $t9 -/* 0A09F8 8009FDF8 0C025673 */ jal draw_flash_select_case_fast -/* 0A09FC 8009FDFC 00603025 */ move $a2, $v1 -/* 0A0A00 8009FE00 AE020000 */ sw $v0, ($s0) -/* 0A0A04 8009FE04 8E23001C */ lw $v1, 0x1c($s1) -/* 0A0A08 8009FE08 10000015 */ b .L8009FE60 -/* 0A0A0C 8009FE0C 8E280000 */ lw $t0, ($s1) -.L8009FE10: -/* 0A0A10 8009FE10 8E22000C */ lw $v0, 0xc($s1) -/* 0A0A14 8009FE14 8E260010 */ lw $a2, 0x10($s1) -/* 0A0A18 8009FE18 240C0001 */ li $t4, 1 -/* 0A0A1C 8009FE1C 240D0001 */ li $t5, 1 -/* 0A0A20 8009FE20 240E0001 */ li $t6, 1 -/* 0A0A24 8009FE24 240F00FF */ li $t7, 255 -/* 0A0A28 8009FE28 00483823 */ subu $a3, $v0, $t0 -/* 0A0A2C 8009FE2C 24CB0012 */ addiu $t3, $a2, 0x12 -/* 0A0A30 8009FE30 AFAB0010 */ sw $t3, 0x10($sp) -/* 0A0A34 8009FE34 24E70039 */ addiu $a3, $a3, 0x39 -/* 0A0A38 8009FE38 AFAF0020 */ sw $t7, 0x20($sp) -/* 0A0A3C 8009FE3C AFAE001C */ sw $t6, 0x1c($sp) -/* 0A0A40 8009FE40 AFAD0018 */ sw $t5, 0x18($sp) -/* 0A0A44 8009FE44 AFAC0014 */ sw $t4, 0x14($sp) -/* 0A0A48 8009FE48 8E040000 */ lw $a0, ($s0) -/* 0A0A4C 8009FE4C 0C026306 */ jal draw_box_fill -/* 0A0A50 8009FE50 00482821 */ addu $a1, $v0, $t0 -/* 0A0A54 8009FE54 AE020000 */ sw $v0, ($s0) -/* 0A0A58 8009FE58 8E23001C */ lw $v1, 0x1c($s1) -/* 0A0A5C 8009FE5C 8E280000 */ lw $t0, ($s1) -.L8009FE60: -/* 0A0A60 8009FE60 2518FFF6 */ addiu $t8, $t0, -0xa -.L8009FE64: -/* 0A0A64 8009FE64 AFB800A8 */ sw $t8, 0xa8($sp) -/* 0A0A68 8009FE68 00184880 */ sll $t1, $t8, 2 -/* 0A0A6C 8009FE6C 3C05800F */ lui $a1, %hi(D_800E8254) # 0x800f -/* 0A0A70 8009FE70 00A92821 */ addu $a1, $a1, $t1 -/* 0A0A74 8009FE74 8E270010 */ lw $a3, 0x10($s1) -/* 0A0A78 8009FE78 8E26000C */ lw $a2, 0xc($s1) -/* 0A0A7C 8009FE7C 240A0002 */ li $t2, 2 -/* 0A0A80 8009FE80 AFAA0010 */ sw $t2, 0x10($sp) -/* 0A0A84 8009FE84 AFA30014 */ sw $v1, 0x14($sp) -/* 0A0A88 8009FE88 8CA58254 */ lw $a1, %lo(D_800E8254)($a1) # -0x7dac($a1) -/* 0A0A8C 8009FE8C 0C026F27 */ jal func_8009BC9C -/* 0A0A90 8009FE90 8E040000 */ lw $a0, ($s0) -/* 0A0A94 8009FE94 1000028B */ b .L800A08C4 -/* 0A0A98 8009FE98 AE020000 */ sw $v0, ($s0) -glabel L8009FE9C -/* 0A0A9C 8009FE9C 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0A0AA0 8009FEA0 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0A0AA4 8009FEA4 3C03800F */ lui $v1, %hi((D_800E86AC - 1)) # 0x800f -/* 0A0AA8 8009FEA8 3C06800F */ lui $a2, %hi((D_800E86B0 - 3)) # 0x800f -/* 0A0AAC 8009FEAC 00621821 */ addu $v1, $v1, $v0 -/* 0A0AB0 8009FEB0 806386AB */ lb $v1, %lo((D_800E86AC - 1))($v1) # -0x7955($v1) -/* 0A0AB4 8009FEB4 00026880 */ sll $t5, $v0, 2 -/* 0A0AB8 8009FEB8 00025880 */ sll $t3, $v0, 2 -/* 0A0ABC 8009FEBC 01A26823 */ subu $t5, $t5, $v0 -/* 0A0AC0 8009FEC0 000D6880 */ sll $t5, $t5, 2 -/* 0A0AC4 8009FEC4 01625823 */ subu $t3, $t3, $v0 -/* 0A0AC8 8009FEC8 00037080 */ sll $t6, $v1, 2 -/* 0A0ACC 8009FECC 01AE7821 */ addu $t7, $t5, $t6 -/* 0A0AD0 8009FED0 3C05800F */ lui $a1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0A0AD4 8009FED4 2518FFEE */ addiu $t8, $t0, -0x12 -/* 0A0AD8 8009FED8 01636021 */ addu $t4, $t3, $v1 -/* 0A0ADC 8009FEDC 00CC3021 */ addu $a2, $a2, $t4 -/* 0A0AE0 8009FEE0 00AF2821 */ addu $a1, $a1, $t7 -/* 0A0AE4 8009FEE4 2F010008 */ sltiu $at, $t8, 8 -/* 0A0AE8 8009FEE8 80C686AD */ lb $a2, %lo((D_800E86B0 - 3))($a2) # -0x7953($a2) -/* 0A0AEC 8009FEEC 10200037 */ beqz $at, .L8009FFCC -/* 0A0AF0 8009FEF0 8CA52B70 */ lw $a1, %lo((gGameModePlayerSelection - 0xC))($a1) # 0x2b70($a1) -/* 0A0AF4 8009FEF4 0018C080 */ sll $t8, $t8, 2 -/* 0A0AF8 8009FEF8 3C01800F */ lui $at, %hi(jpt_800F1AD0) -/* 0A0AFC 8009FEFC 00380821 */ addu $at, $at, $t8 -/* 0A0B00 8009FF00 8C381AD0 */ lw $t8, %lo(jpt_800F1AD0)($at) -/* 0A0B04 8009FF04 03000008 */ jr $t8 -/* 0A0B08 8009FF08 00000000 */ nop -glabel L8009FF0C -/* 0A0B0C 8009FF0C 10A00005 */ beqz $a1, .L8009FF24 -/* 0A0B10 8009FF10 24190012 */ li $t9, 18 -/* 0A0B14 8009FF14 24010002 */ li $at, 2 -/* 0A0B18 8009FF18 50A10003 */ beql $a1, $at, .L8009FF28 -/* 0A0B1C 8009FF1C 00084880 */ sll $t1, $t0, 2 -/* 0A0B20 8009FF20 2406FFFF */ li $a2, -1 -.L8009FF24: -/* 0A0B24 8009FF24 00084880 */ sll $t1, $t0, 2 -.L8009FF28: -/* 0A0B28 8009FF28 3C04800F */ lui $a0, %hi(D_800E824C) # 0x800f -/* 0A0B2C 8009FF2C 00892021 */ addu $a0, $a0, $t1 -/* 0A0B30 8009FF30 AFB900A8 */ sw $t9, 0xa8($sp) -/* 0A0B34 8009FF34 8C84824C */ lw $a0, %lo(D_800E824C)($a0) # -0x7db4($a0) -/* 0A0B38 8009FF38 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0B3C 8009FF3C AFA600AC */ sw $a2, 0xac($sp) -/* 0A0B40 8009FF40 8FA600AC */ lw $a2, 0xac($sp) -/* 0A0B44 8009FF44 AFA2009C */ sw $v0, 0x9c($sp) -/* 0A0B48 8009FF48 10000020 */ b .L8009FFCC -/* 0A0B4C 8009FF4C 8FA500A8 */ lw $a1, 0xa8($sp) -glabel L8009FF50 -/* 0A0B50 8009FF50 24010002 */ li $at, 2 -/* 0A0B54 8009FF54 10A10003 */ beq $a1, $at, .L8009FF64 -/* 0A0B58 8009FF58 00085080 */ sll $t2, $t0, 2 -/* 0A0B5C 8009FF5C 1000001B */ b .L8009FFCC -/* 0A0B60 8009FF60 2406FFFF */ li $a2, -1 -.L8009FF64: -/* 0A0B64 8009FF64 3C04800F */ lui $a0, %hi(D_800E824C) # 0x800f -/* 0A0B68 8009FF68 24050016 */ li $a1, 22 -/* 0A0B6C 8009FF6C 008A2021 */ addu $a0, $a0, $t2 -/* 0A0B70 8009FF70 8C84824C */ lw $a0, %lo(D_800E824C)($a0) # -0x7db4($a0) -/* 0A0B74 8009FF74 AFA500A8 */ sw $a1, 0xa8($sp) -/* 0A0B78 8009FF78 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0B7C 8009FF7C AFA600AC */ sw $a2, 0xac($sp) -/* 0A0B80 8009FF80 8FA600AC */ lw $a2, 0xac($sp) -/* 0A0B84 8009FF84 AFA2009C */ sw $v0, 0x9c($sp) -/* 0A0B88 8009FF88 10000010 */ b .L8009FFCC -/* 0A0B8C 8009FF8C 8FA500A8 */ lw $a1, 0xa8($sp) -glabel L8009FF90 -/* 0A0B90 8009FF90 24010001 */ li $at, 1 -/* 0A0B94 8009FF94 10A10003 */ beq $a1, $at, .L8009FFA4 -/* 0A0B98 8009FF98 00085880 */ sll $t3, $t0, 2 -/* 0A0B9C 8009FF9C 1000000B */ b .L8009FFCC -/* 0A0BA0 8009FFA0 2406FFFF */ li $a2, -1 -.L8009FFA4: -/* 0A0BA4 8009FFA4 3C04800F */ lui $a0, %hi(D_800E824C) # 0x800f -/* 0A0BA8 8009FFA8 24050018 */ li $a1, 24 -/* 0A0BAC 8009FFAC 008B2021 */ addu $a0, $a0, $t3 -/* 0A0BB0 8009FFB0 8C84824C */ lw $a0, %lo(D_800E824C)($a0) # -0x7db4($a0) -/* 0A0BB4 8009FFB4 AFA500A8 */ sw $a1, 0xa8($sp) -/* 0A0BB8 8009FFB8 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0BBC 8009FFBC AFA600AC */ sw $a2, 0xac($sp) -/* 0A0BC0 8009FFC0 8FA600AC */ lw $a2, 0xac($sp) -/* 0A0BC4 8009FFC4 AFA2009C */ sw $v0, 0x9c($sp) -/* 0A0BC8 8009FFC8 8FA500A8 */ lw $a1, 0xa8($sp) -.L8009FFCC: -/* 0A0BCC 8009FFCC 2401FFFF */ li $at, -1 -/* 0A0BD0 8009FFD0 10C1023C */ beq $a2, $at, .L800A08C4 -/* 0A0BD4 8009FFD4 3C028019 */ lui $v0, %hi(gMainMenuSelectionDepth) # $v0, 0x8019 -/* 0A0BD8 8009FFD8 8042EDED */ lb $v0, %lo(gMainMenuSelectionDepth)($v0) -/* 0A0BDC 8009FFDC 240E0001 */ li $t6, 1 -/* 0A0BE0 8009FFE0 240F00FF */ li $t7, 255 -/* 0A0BE4 8009FFE4 28410005 */ slti $at, $v0, 5 -/* 0A0BE8 8009FFE8 54200024 */ bnel $at, $zero, .L800A007C -/* 0A0BEC 8009FFEC 8E25000C */ lw $a1, 0xc($s1) -/* 0A0BF0 8009FFF0 8E2C0000 */ lw $t4, ($s1) -/* 0A0BF4 8009FFF4 28410006 */ slti $at, $v0, 6 -/* 0A0BF8 8009FFF8 01856823 */ subu $t5, $t4, $a1 -/* 0A0BFC 8009FFFC 54CD001F */ bnel $a2, $t5, .L800A007C -/* 0A0C00 800A0000 8E25000C */ lw $a1, 0xc($s1) -/* 0A0C04 800A0004 14200011 */ bnez $at, .L800A004C -/* 0A0C08 800A0008 240F00FF */ li $t7, 255 -/* 0A0C0C 800A000C 8E25000C */ lw $a1, 0xc($s1) -/* 0A0C10 800A0010 8E260010 */ lw $a2, 0x10($s1) -/* 0A0C14 800A0014 241800F9 */ li $t8, 249 -/* 0A0C18 800A0018 241900DC */ li $t9, 220 -/* 0A0C1C 800A001C 240900FF */ li $t1, 255 -/* 0A0C20 800A0020 24CE0011 */ addiu $t6, $a2, 0x11 -/* 0A0C24 800A0024 AFAE0010 */ sw $t6, 0x10($sp) -/* 0A0C28 800A0028 AFA90020 */ sw $t1, 0x20($sp) -/* 0A0C2C 800A002C AFB9001C */ sw $t9, 0x1c($sp) -/* 0A0C30 800A0030 AFB80018 */ sw $t8, 0x18($sp) -/* 0A0C34 800A0034 AFAF0014 */ sw $t7, 0x14($sp) -/* 0A0C38 800A0038 8E040000 */ lw $a0, ($s0) -/* 0A0C3C 800A003C 0C026306 */ jal draw_box_fill -/* 0A0C40 800A0040 24A7003F */ addiu $a3, $a1, 0x3f -/* 0A0C44 800A0044 1000001A */ b .L800A00B0 -/* 0A0C48 800A0048 AE020000 */ sw $v0, ($s0) -.L800A004C: -/* 0A0C4C 800A004C 8E230010 */ lw $v1, 0x10($s1) -/* 0A0C50 800A0050 8E22000C */ lw $v0, 0xc($s1) -/* 0A0C54 800A0054 8E040000 */ lw $a0, ($s0) -/* 0A0C58 800A0058 246A0011 */ addiu $t2, $v1, 0x11 -/* 0A0C5C 800A005C AFAA0010 */ sw $t2, 0x10($sp) -/* 0A0C60 800A0060 00603025 */ move $a2, $v1 -/* 0A0C64 800A0064 00402825 */ move $a1, $v0 -/* 0A0C68 800A0068 0C025668 */ jal draw_flash_select_case_slow -/* 0A0C6C 800A006C 2447003F */ addiu $a3, $v0, 0x3f -/* 0A0C70 800A0070 1000000F */ b .L800A00B0 -/* 0A0C74 800A0074 AE020000 */ sw $v0, ($s0) -/* 0A0C78 800A0078 8E25000C */ lw $a1, 0xc($s1) -.L800A007C: -/* 0A0C7C 800A007C 8E260010 */ lw $a2, 0x10($s1) -/* 0A0C80 800A0080 240C0001 */ li $t4, 1 -/* 0A0C84 800A0084 240D0001 */ li $t5, 1 -/* 0A0C88 800A0088 24CB0011 */ addiu $t3, $a2, 0x11 -/* 0A0C8C 800A008C AFAB0010 */ sw $t3, 0x10($sp) -/* 0A0C90 800A0090 AFAD0018 */ sw $t5, 0x18($sp) -/* 0A0C94 800A0094 AFAC0014 */ sw $t4, 0x14($sp) -/* 0A0C98 800A0098 AFAF0020 */ sw $t7, 0x20($sp) -/* 0A0C9C 800A009C AFAE001C */ sw $t6, 0x1c($sp) -/* 0A0CA0 800A00A0 8E040000 */ lw $a0, ($s0) -/* 0A0CA4 800A00A4 0C026306 */ jal draw_box_fill -/* 0A0CA8 800A00A8 24A7003F */ addiu $a3, $a1, 0x3f -/* 0A0CAC 800A00AC AE020000 */ sw $v0, ($s0) -.L800A00B0: -/* 0A0CB0 800A00B0 8E040000 */ lw $a0, ($s0) -/* 0A0CB4 800A00B4 8FA5009C */ lw $a1, 0x9c($sp) -/* 0A0CB8 800A00B8 8E26000C */ lw $a2, 0xc($s1) -/* 0A0CBC 800A00BC 0C026E9D */ jal func_8009BA74 -/* 0A0CC0 800A00C0 8E270010 */ lw $a3, 0x10($s1) -/* 0A0CC4 800A00C4 100001FF */ b .L800A08C4 -/* 0A0CC8 800A00C8 AE020000 */ sw $v0, ($s0) -glabel L800A00CC -/* 0A0CCC 800A00CC 0C028433 */ jal func_800A10CC -/* 0A0CD0 800A00D0 02202025 */ move $a0, $s1 -/* 0A0CD4 800A00D4 100001FC */ b .L800A08C8 -/* 0A0CD8 800A00D8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A00DC -/* 0A0CDC 800A00DC 3C050200 */ lui $a1, %hi(D_02004B4C) # $a1, 0x200 -/* 0A0CE0 800A00E0 24A54B4C */ addiu $a1, %lo(D_02004B4C) # addiu $a1, $a1, 0x4b4c -/* 0A0CE4 800A00E4 8E040000 */ lw $a0, ($s0) -/* 0A0CE8 800A00E8 8E26000C */ lw $a2, 0xc($s1) -/* 0A0CEC 800A00EC 0C026E9D */ jal func_8009BA74 -/* 0A0CF0 800A00F0 8E270010 */ lw $a3, 0x10($s1) -/* 0A0CF4 800A00F4 100001F3 */ b .L800A08C4 -/* 0A0CF8 800A00F8 AE020000 */ sw $v0, ($s0) -glabel L800A00FC -/* 0A0CFC 800A00FC 2505FFCC */ addiu $a1, $t0, -0x34 -/* 0A0D00 800A0100 3C188019 */ lui $t8, %hi(gCharacterGridSelections) # 0x8019 -/* 0A0D04 800A0104 0305C021 */ addu $t8, $t8, $a1 -/* 0A0D08 800A0108 8318EDE4 */ lb $t8, %lo(gCharacterGridSelections)($t8) # -0x121c($t8) -/* 0A0D0C 800A010C 3C198019 */ lui $t9, %hi(D_8018EDE8) # 0x8019 -/* 0A0D10 800A0110 0325C821 */ addu $t9, $t9, $a1 -/* 0A0D14 800A0114 530001EC */ beql $t8, $zero, .L800A08C8 -/* 0A0D18 800A0118 8FBF0034 */ lw $ra, 0x34($sp) -/* 0A0D1C 800A011C 8339EDE8 */ lb $t9, %lo(D_8018EDE8)($t9) # -0x1218($t9) -/* 0A0D20 800A0120 3C06800E */ lui $a2, %hi(gGlobalTimer) # $a2, 0x800e -/* 0A0D24 800A0124 17200003 */ bnez $t9, .L800A0134 -/* 0A0D28 800A0128 00000000 */ nop -/* 0A0D2C 800A012C 10000011 */ b .L800A0174 -/* 0A0D30 800A0130 240600FF */ li $a2, 255 -.L800A0134: -/* 0A0D34 800A0134 8CC6C54C */ lw $a2, %lo(gGlobalTimer)($a2) -/* 0A0D38 800A0138 04C10004 */ bgez $a2, .L800A014C -/* 0A0D3C 800A013C 30C9000F */ andi $t1, $a2, 0xf -/* 0A0D40 800A0140 11200002 */ beqz $t1, .L800A014C -/* 0A0D44 800A0144 00000000 */ nop -/* 0A0D48 800A0148 2529FFF0 */ addiu $t1, $t1, -0x10 -.L800A014C: -/* 0A0D4C 800A014C 29210008 */ slti $at, $t1, 8 -/* 0A0D50 800A0150 14200005 */ bnez $at, .L800A0168 -/* 0A0D54 800A0154 01203025 */ move $a2, $t1 -/* 0A0D58 800A0158 00093023 */ negu $a2, $t1 -/* 0A0D5C 800A015C 000650C0 */ sll $t2, $a2, 3 -/* 0A0D60 800A0160 10000003 */ b .L800A0170 -/* 0A0D64 800A0164 25460080 */ addiu $a2, $t2, 0x80 -.L800A0168: -/* 0A0D68 800A0168 000658C0 */ sll $t3, $a2, 3 -/* 0A0D6C 800A016C 01603025 */ move $a2, $t3 -.L800A0170: -/* 0A0D70 800A0170 24C600BF */ addiu $a2, $a2, 0xbf -.L800A0174: -/* 0A0D74 800A0174 0C028474 */ jal func_800A11D0 -/* 0A0D78 800A0178 02202025 */ move $a0, $s1 -/* 0A0D7C 800A017C 100001D2 */ b .L800A08C8 -/* 0A0D80 800A0180 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0184 -/* 0A0D84 800A0184 0C02A159 */ jal func_800A8564 -/* 0A0D88 800A0188 02202025 */ move $a0, $s1 -/* 0A0D8C 800A018C 8E26000C */ lw $a2, 0xc($s1) -/* 0A0D90 800A0190 8E270010 */ lw $a3, 0x10($s1) -/* 0A0D94 800A0194 240C0002 */ li $t4, 2 -/* 0A0D98 800A0198 AFAC0010 */ sw $t4, 0x10($sp) -/* 0A0D9C 800A019C 8E2D001C */ lw $t5, 0x1c($s1) -/* 0A0DA0 800A01A0 3C050200 */ lui $a1, %hi(D_02004B74) # $a1, 0x200 -/* 0A0DA4 800A01A4 24A54B74 */ addiu $a1, %lo(D_02004B74) # addiu $a1, $a1, 0x4b74 -/* 0A0DA8 800A01A8 8E040000 */ lw $a0, ($s0) -/* 0A0DAC 800A01AC 0C026F27 */ jal func_8009BC9C -/* 0A0DB0 800A01B0 AFAD0014 */ sw $t5, 0x14($sp) -/* 0A0DB4 800A01B4 100001C3 */ b .L800A08C4 -/* 0A0DB8 800A01B8 AE020000 */ sw $v0, ($s0) -glabel L800A01BC -/* 0A0DBC 800A01BC 00087080 */ sll $t6, $t0, 2 -/* 0A0DC0 800A01C0 3C04800E */ lui $a0, %hi(D_800E7D54 - 0xAC) -/* 0A0DC4 800A01C4 008E2021 */ addu $a0, $a0, $t6 -/* 0A0DC8 800A01C8 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0DCC 800A01CC 8C847CA8 */ lw $a0, %lo(D_800E7D54 - 0xAC)($a0) -/* 0A0DD0 800A01D0 02202025 */ move $a0, $s1 -/* 0A0DD4 800A01D4 0C0284AF */ jal func_800A12BC -/* 0A0DD8 800A01D8 00402825 */ move $a1, $v0 -glabel L800A01DC -/* 0A0DDC 800A01DC 8E240018 */ lw $a0, 0x18($s1) -/* 0A0DE0 800A01E0 8E25000C */ lw $a1, 0xc($s1) -/* 0A0DE4 800A01E4 8E260010 */ lw $a2, 0x10($s1) -/* 0A0DE8 800A01E8 0C0269DB */ jal func_8009A76C -/* 0A0DEC 800A01EC 8E27001C */ lw $a3, 0x1c($s1) -/* 0A0DF0 800A01F0 100001B5 */ b .L800A08C8 -/* 0A0DF4 800A01F4 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A01F8 -/* 0A0DF8 800A01F8 0C02A2A6 */ jal func_800A8A98 -/* 0A0DFC 800A01FC 02202025 */ move $a0, $s1 -/* 0A0E00 800A0200 8E2F0000 */ lw $t7, ($s1) -/* 0A0E04 800A0204 3C04800F */ lui $a0, %hi(D_800E817C) # 0x800f -/* 0A0E08 800A0208 000FC080 */ sll $t8, $t7, 2 -/* 0A0E0C 800A020C 00982021 */ addu $a0, $a0, $t8 -/* 0A0E10 800A0210 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0E14 800A0214 8C84817C */ lw $a0, %lo(D_800E817C)($a0) # -0x7e84($a0) -/* 0A0E18 800A0218 8E040000 */ lw $a0, ($s0) -/* 0A0E1C 800A021C 00402825 */ move $a1, $v0 -/* 0A0E20 800A0220 8E26000C */ lw $a2, 0xc($s1) -/* 0A0E24 800A0224 0C026E9D */ jal func_8009BA74 -/* 0A0E28 800A0228 8E270010 */ lw $a3, 0x10($s1) -/* 0A0E2C 800A022C AE020000 */ sw $v0, ($s0) -/* 0A0E30 800A0230 0C02A329 */ jal func_800A8CA4 -/* 0A0E34 800A0234 02202025 */ move $a0, $s1 -/* 0A0E38 800A0238 100001A3 */ b .L800A08C8 -/* 0A0E3C 800A023C 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0240 -/* 0A0E40 800A0240 0008C880 */ sll $t9, $t0, 2 -/* 0A0E44 800A0244 3C04800F */ lui $a0, %hi(D_800E817C) # 0x800f -/* 0A0E48 800A0248 00992021 */ addu $a0, $a0, $t9 -/* 0A0E4C 800A024C 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0E50 800A0250 8C84817C */ lw $a0, %lo(D_800E817C)($a0) # -0x7e84($a0) -/* 0A0E54 800A0254 8E040000 */ lw $a0, ($s0) -/* 0A0E58 800A0258 00402825 */ move $a1, $v0 -/* 0A0E5C 800A025C 8E26000C */ lw $a2, 0xc($s1) -/* 0A0E60 800A0260 0C026E9D */ jal func_8009BA74 -/* 0A0E64 800A0264 8E270010 */ lw $a3, 0x10($s1) -/* 0A0E68 800A0268 10000196 */ b .L800A08C4 -/* 0A0E6C 800A026C AE020000 */ sw $v0, ($s0) -glabel L800A0270 -/* 0A0E70 800A0270 0C028540 */ jal func_800A1500 -/* 0A0E74 800A0274 02202025 */ move $a0, $s1 -/* 0A0E78 800A0278 10000193 */ b .L800A08C8 -/* 0A0E7C 800A027C 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0280 -/* 0A0E80 800A0280 2504FFAD */ addiu $a0, $t0, -0x53 -/* 0A0E84 800A0284 AFA400AC */ sw $a0, 0xac($sp) -/* 0A0E88 800A0288 0C02A243 */ jal func_800A890C -/* 0A0E8C 800A028C 02202825 */ move $a1, $s1 -/* 0A0E90 800A0290 8FA500AC */ lw $a1, 0xac($sp) -/* 0A0E94 800A0294 0C02850F */ jal func_800A143C -/* 0A0E98 800A0298 02202025 */ move $a0, $s1 -/* 0A0E9C 800A029C 1000018A */ b .L800A08C8 -/* 0A0EA0 800A02A0 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A02A4 -/* 0A0EA4 800A02A4 0C02A159 */ jal func_800A8564 -/* 0A0EA8 800A02A8 02202025 */ move $a0, $s1 -/* 0A0EAC 800A02AC 8E26000C */ lw $a2, 0xc($s1) -/* 0A0EB0 800A02B0 8E270010 */ lw $a3, 0x10($s1) -/* 0A0EB4 800A02B4 24090002 */ li $t1, 2 -/* 0A0EB8 800A02B8 AFA90010 */ sw $t1, 0x10($sp) -/* 0A0EBC 800A02BC 8E2A001C */ lw $t2, 0x1c($s1) -/* 0A0EC0 800A02C0 3C050200 */ lui $a1, %hi(D_02004E80) # $a1, 0x200 -/* 0A0EC4 800A02C4 24A54E80 */ addiu $a1, %lo(D_02004E80) # addiu $a1, $a1, 0x4e80 -/* 0A0EC8 800A02C8 8E040000 */ lw $a0, ($s0) -/* 0A0ECC 800A02CC 0C026F27 */ jal func_8009BC9C -/* 0A0ED0 800A02D0 AFAA0014 */ sw $t2, 0x14($sp) -/* 0A0ED4 800A02D4 1000017B */ b .L800A08C4 -/* 0A0ED8 800A02D8 AE020000 */ sw $v0, ($s0) -glabel L800A02DC -/* 0A0EDC 800A02DC 24010065 */ li $at, 101 -/* 0A0EE0 800A02E0 15010004 */ bne $t0, $at, .L800A02F4 -/* 0A0EE4 800A02E4 02202025 */ move $a0, $s1 -/* 0A0EE8 800A02E8 3C01800F */ lui $at, %hi(D_800F1AF0) # $at, 0x800f -/* 0A0EEC 800A02EC 10000003 */ b .L800A02FC -/* 0A0EF0 800A02F0 C4201AF0 */ lwc1 $f0, %lo(D_800F1AF0)($at) -.L800A02F4: -/* 0A0EF4 800A02F4 3C01800F */ lui $at, %hi(D_800F1AF4) # $at, 0x800f -/* 0A0EF8 800A02F8 C4201AF4 */ lwc1 $f0, %lo(D_800F1AF4)($at) -.L800A02FC: -/* 0A0EFC 800A02FC 0C02A1BA */ jal func_800A86E8 -/* 0A0F00 800A0300 E7A0004C */ swc1 $f0, 0x4c($sp) -/* 0A0F04 800A0304 0C024C36 */ jal set_text_color -/* 0A0F08 800A0308 24040003 */ li $a0, 3 -/* 0A0F0C 800A030C 8E2B0000 */ lw $t3, ($s1) -/* 0A0F10 800A0310 3C01800F */ lui $at, %hi(D_800F1AF8) # $at, 0x800f -/* 0A0F14 800A0314 C7A0004C */ lwc1 $f0, 0x4c($sp) -/* 0A0F18 800A0318 C4261AF8 */ lwc1 $f6, %lo(D_800F1AF8)($at) -/* 0A0F1C 800A031C 8E24000C */ lw $a0, 0xc($s1) -/* 0A0F20 800A0320 8E250010 */ lw $a1, 0x10($s1) -/* 0A0F24 800A0324 3C06800E */ lui $a2, %hi(D_800E7728 - 0x194) -/* 0A0F28 800A0328 000B6080 */ sll $t4, $t3, 2 -/* 0A0F2C 800A032C 00CC3021 */ addu $a2, $a2, $t4 -/* 0A0F30 800A0330 8CC67594 */ lw $a2, %lo(D_800E7728 - 0x194)($a2) -/* 0A0F34 800A0334 00003825 */ move $a3, $zero -/* 0A0F38 800A0338 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A0F3C 800A033C E7A60014 */ swc1 $f6, 0x14($sp) -/* 0A0F40 800A0340 24840008 */ addiu $a0, $a0, 8 -/* 0A0F44 800A0344 0C024CC9 */ jal func_80093324 -/* 0A0F48 800A0348 24A50010 */ addiu $a1, $a1, 0x10 -/* 0A0F4C 800A034C 0C02A1D3 */ jal func_800A874C -/* 0A0F50 800A0350 02202025 */ move $a0, $s1 -/* 0A0F54 800A0354 1000015C */ b .L800A08C8 -/* 0A0F58 800A0358 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A035C -/* 0A0F5C 800A035C 0C02A385 */ jal func_800A8E14 -/* 0A0F60 800A0360 02202025 */ move $a0, $s1 -/* 0A0F64 800A0364 10000158 */ b .L800A08C8 -/* 0A0F68 800A0368 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A036C -/* 0A0F6C 800A036C 0C02A3B0 */ jal func_800A8EC0 -/* 0A0F70 800A0370 02202025 */ move $a0, $s1 -/* 0A0F74 800A0374 10000154 */ b .L800A08C8 -/* 0A0F78 800A0378 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A037C -/* 0A0F7C 800A037C 8E25000C */ lw $a1, 0xc($s1) -/* 0A0F80 800A0380 8E260010 */ lw $a2, 0x10($s1) -/* 0A0F84 800A0384 240E0001 */ li $t6, 1 -/* 0A0F88 800A0388 240F0001 */ li $t7, 1 -/* 0A0F8C 800A038C 24180001 */ li $t8, 1 -/* 0A0F90 800A0390 241900FF */ li $t9, 255 -/* 0A0F94 800A0394 24CD0011 */ addiu $t5, $a2, 0x11 -/* 0A0F98 800A0398 AFAD0010 */ sw $t5, 0x10($sp) -/* 0A0F9C 800A039C AFB90020 */ sw $t9, 0x20($sp) -/* 0A0FA0 800A03A0 AFB8001C */ sw $t8, 0x1c($sp) -/* 0A0FA4 800A03A4 AFAF0018 */ sw $t7, 0x18($sp) -/* 0A0FA8 800A03A8 AFAE0014 */ sw $t6, 0x14($sp) -/* 0A0FAC 800A03AC 8E040000 */ lw $a0, ($s0) -/* 0A0FB0 800A03B0 0C026306 */ jal draw_box_fill -/* 0A0FB4 800A03B4 24A7003F */ addiu $a3, $a1, 0x3f -/* 0A0FB8 800A03B8 AE020000 */ sw $v0, ($s0) -/* 0A0FBC 800A03BC 3C09800E */ lui $t1, %hi(gCCSelection) # $t1, 0x800e -/* 0A0FC0 800A03C0 8D29C548 */ lw $t1, %lo(gCCSelection)($t1) -/* 0A0FC4 800A03C4 3C04800F */ lui $a0, %hi(D_800E8294) # 0x800f -/* 0A0FC8 800A03C8 00095080 */ sll $t2, $t1, 2 -/* 0A0FCC 800A03CC 008A2021 */ addu $a0, $a0, $t2 -/* 0A0FD0 800A03D0 0C026449 */ jal segmented_to_virtual_dupe -/* 0A0FD4 800A03D4 8C848294 */ lw $a0, %lo(D_800E8294)($a0) # -0x7d6c($a0) -/* 0A0FD8 800A03D8 8E040000 */ lw $a0, ($s0) -/* 0A0FDC 800A03DC 00402825 */ move $a1, $v0 -/* 0A0FE0 800A03E0 8E26000C */ lw $a2, 0xc($s1) -/* 0A0FE4 800A03E4 0C026E9D */ jal func_8009BA74 -/* 0A0FE8 800A03E8 8E270010 */ lw $a3, 0x10($s1) -/* 0A0FEC 800A03EC 10000135 */ b .L800A08C4 -/* 0A0FF0 800A03F0 AE020000 */ sw $v0, ($s0) -glabel L800A03F4 -/* 0A0FF4 800A03F4 0C02A3D2 */ jal func_800A8F48 -/* 0A0FF8 800A03F8 02202025 */ move $a0, $s1 -/* 0A0FFC 800A03FC 10000132 */ b .L800A08C8 -/* 0A1000 800A0400 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0404 -/* 0A1004 800A0404 2504FF88 */ addiu $a0, $t0, -0x78 -/* 0A1008 800A0408 AFA400AC */ sw $a0, 0xac($sp) -/* 0A100C 800A040C 0C02A435 */ jal func_800A90D4 -/* 0A1010 800A0410 02202825 */ move $a1, $s1 -/* 0A1014 800A0414 8FA500AC */ lw $a1, 0xac($sp) -/* 0A1018 800A0418 0C02850F */ jal func_800A143C -/* 0A101C 800A041C 02202025 */ move $a0, $s1 -/* 0A1020 800A0420 10000129 */ b .L800A08C8 -/* 0A1024 800A0424 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0428 -/* 0A1028 800A0428 3C028019 */ lui $v0, %hi(gMainMenuSelectionDepth) # $v0, 0x8019 -/* 0A102C 800A042C 8042EDED */ lb $v0, %lo(gMainMenuSelectionDepth)($v0) -/* 0A1030 800A0430 8FAB00A8 */ lw $t3, 0xa8($sp) -/* 0A1034 800A0434 240D0001 */ li $t5, 1 -/* 0A1038 800A0438 28410005 */ slti $at, $v0, 5 -/* 0A103C 800A043C 14200023 */ bnez $at, .L800A04CC -/* 0A1040 800A0440 240E00FF */ li $t6, 255 -/* 0A1044 800A0444 8FA600AC */ lw $a2, 0xac($sp) -/* 0A1048 800A0448 010B6023 */ subu $t4, $t0, $t3 -/* 0A104C 800A044C 28410006 */ slti $at, $v0, 6 -/* 0A1050 800A0450 54CC001F */ bnel $a2, $t4, .L800A04D0 -/* 0A1054 800A0454 8E25000C */ lw $a1, 0xc($s1) -/* 0A1058 800A0458 14200011 */ bnez $at, .L800A04A0 -/* 0A105C 800A045C 240E00FF */ li $t6, 255 -/* 0A1060 800A0460 8E25000C */ lw $a1, 0xc($s1) -/* 0A1064 800A0464 8E260010 */ lw $a2, 0x10($s1) -/* 0A1068 800A0468 240F00F9 */ li $t7, 249 -/* 0A106C 800A046C 241800DC */ li $t8, 220 -/* 0A1070 800A0470 241900FF */ li $t9, 255 -/* 0A1074 800A0474 24CD0011 */ addiu $t5, $a2, 0x11 -/* 0A1078 800A0478 AFAD0010 */ sw $t5, 0x10($sp) -/* 0A107C 800A047C AFB90020 */ sw $t9, 0x20($sp) -/* 0A1080 800A0480 AFB8001C */ sw $t8, 0x1c($sp) -/* 0A1084 800A0484 AFAF0018 */ sw $t7, 0x18($sp) -/* 0A1088 800A0488 AFAE0014 */ sw $t6, 0x14($sp) -/* 0A108C 800A048C 8E040000 */ lw $a0, ($s0) -/* 0A1090 800A0490 0C026306 */ jal draw_box_fill -/* 0A1094 800A0494 24A7003F */ addiu $a3, $a1, 0x3f -/* 0A1098 800A0498 1000001A */ b .L800A0504 -/* 0A109C 800A049C AE020000 */ sw $v0, ($s0) -.L800A04A0: -/* 0A10A0 800A04A0 8E230010 */ lw $v1, 0x10($s1) -/* 0A10A4 800A04A4 8E22000C */ lw $v0, 0xc($s1) -/* 0A10A8 800A04A8 8E040000 */ lw $a0, ($s0) -/* 0A10AC 800A04AC 24690011 */ addiu $t1, $v1, 0x11 -/* 0A10B0 800A04B0 AFA90010 */ sw $t1, 0x10($sp) -/* 0A10B4 800A04B4 00603025 */ move $a2, $v1 -/* 0A10B8 800A04B8 00402825 */ move $a1, $v0 -/* 0A10BC 800A04BC 0C025668 */ jal draw_flash_select_case_slow -/* 0A10C0 800A04C0 2447003F */ addiu $a3, $v0, 0x3f -/* 0A10C4 800A04C4 1000000F */ b .L800A0504 -/* 0A10C8 800A04C8 AE020000 */ sw $v0, ($s0) -.L800A04CC: -/* 0A10CC 800A04CC 8E25000C */ lw $a1, 0xc($s1) -.L800A04D0: -/* 0A10D0 800A04D0 8E260010 */ lw $a2, 0x10($s1) -/* 0A10D4 800A04D4 240B0001 */ li $t3, 1 -/* 0A10D8 800A04D8 240C0001 */ li $t4, 1 -/* 0A10DC 800A04DC 24CA0011 */ addiu $t2, $a2, 0x11 -/* 0A10E0 800A04E0 AFAA0010 */ sw $t2, 0x10($sp) -/* 0A10E4 800A04E4 AFAC0018 */ sw $t4, 0x18($sp) -/* 0A10E8 800A04E8 AFAB0014 */ sw $t3, 0x14($sp) -/* 0A10EC 800A04EC AFAE0020 */ sw $t6, 0x20($sp) -/* 0A10F0 800A04F0 AFAD001C */ sw $t5, 0x1c($sp) -/* 0A10F4 800A04F4 8E040000 */ lw $a0, ($s0) -/* 0A10F8 800A04F8 0C026306 */ jal draw_box_fill -/* 0A10FC 800A04FC 24A7003F */ addiu $a3, $a1, 0x3f -/* 0A1100 800A0500 AE020000 */ sw $v0, ($s0) -.L800A0504: -/* 0A1104 800A0504 3C050200 */ lui $a1, %hi(D_02004A34) # $a1, 0x200 -/* 0A1108 800A0508 24A54A34 */ addiu $a1, %lo(D_02004A34) # addiu $a1, $a1, 0x4a34 -/* 0A110C 800A050C 8E040000 */ lw $a0, ($s0) -/* 0A1110 800A0510 8E26000C */ lw $a2, 0xc($s1) -/* 0A1114 800A0514 0C026E9D */ jal func_8009BA74 -/* 0A1118 800A0518 8E270010 */ lw $a3, 0x10($s1) -/* 0A111C 800A051C AE020000 */ sw $v0, ($s0) -/* 0A1120 800A0520 0C024C36 */ jal set_text_color -/* 0A1124 800A0524 24040003 */ li $a0, 3 -/* 0A1128 800A0528 3C01800F */ lui $at, %hi(D_800F1AFC) # $at, 0x800f -/* 0A112C 800A052C C4201AFC */ lwc1 $f0, %lo(D_800F1AFC)($at) -/* 0A1130 800A0530 3C06800E */ lui $a2, %hi(D_800E77B4) # $a2, 0x800e -/* 0A1134 800A0534 24C677B4 */ addiu $a2, %lo(D_800E77B4) # addiu $a2, $a2, 0x77b4 -/* 0A1138 800A0538 24040125 */ li $a0, 293 -/* 0A113C 800A053C 2405001C */ li $a1, 28 -/* 0A1140 800A0540 00003825 */ move $a3, $zero -/* 0A1144 800A0544 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0A1148 800A0548 0C024DAE */ jal func_800936B8 -/* 0A114C 800A054C E7A00014 */ swc1 $f0, 0x14($sp) -/* 0A1150 800A0550 100000DD */ b .L800A08C8 -/* 0A1154 800A0554 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0558 -/* 0A1158 800A0558 0C0285E0 */ jal func_800A1780 -/* 0A115C 800A055C 02202025 */ move $a0, $s1 -/* 0A1160 800A0560 100000D9 */ b .L800A08C8 -/* 0A1164 800A0564 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0568 -/* 0A1168 800A0568 0C02857B */ jal func_800A15EC -/* 0A116C 800A056C 02202025 */ move $a0, $s1 -/* 0A1170 800A0570 100000D5 */ b .L800A08C8 -/* 0A1174 800A0574 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0578 -/* 0A1178 800A0578 0C024C36 */ jal set_text_color -/* 0A117C 800A057C 24040004 */ li $a0, 4 -/* 0A1180 800A0580 3C0F800E */ lui $t7, %hi(D_800DC540) # $t7, 0x800e -/* 0A1184 800A0584 8DEFC540 */ lw $t7, %lo(D_800DC540)($t7) -/* 0A1188 800A0588 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A118C 800A058C 44814000 */ mtc1 $at, $f8 -/* 0A1190 800A0590 C62A0024 */ lwc1 $f10, 0x24($s1) -/* 0A1194 800A0594 3C06800E */ lui $a2, %hi(gCupNames) -/* 0A1198 800A0598 000FC080 */ sll $t8, $t7, 2 -/* 0A119C 800A059C 00D83021 */ addu $a2, $a2, $t8 -/* 0A11A0 800A05A0 8E24000C */ lw $a0, 0xc($s1) -/* 0A11A4 800A05A4 8E250010 */ lw $a1, 0x10($s1) -/* 0A11A8 800A05A8 8E27001C */ lw $a3, 0x1c($s1) -/* 0A11AC 800A05AC 8CC67500 */ lw $a2, %lo(gCupNames)($a2) -/* 0A11B0 800A05B0 E7A80014 */ swc1 $f8, 0x14($sp) -/* 0A11B4 800A05B4 0C024DAE */ jal func_800936B8 -/* 0A11B8 800A05B8 E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0A11BC 800A05BC 100000C2 */ b .L800A08C8 -/* 0A11C0 800A05C0 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A05C4 -/* 0A11C4 800A05C4 0C024C36 */ jal set_text_color -/* 0A11C8 800A05C8 24040005 */ li $a0, 5 -/* 0A11CC 800A05CC 3C19800E */ lui $t9, %hi(gCurrentCourseId) # $t9, 0x800e -/* 0A11D0 800A05D0 8739C5A0 */ lh $t9, %lo(gCurrentCourseId)($t9) -/* 0A11D4 800A05D4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A11D8 800A05D8 44819000 */ mtc1 $at, $f18 -/* 0A11DC 800A05DC C6300024 */ lwc1 $f16, 0x24($s1) -/* 0A11E0 800A05E0 3C06800E */ lui $a2, %hi(gCourseNames) -/* 0A11E4 800A05E4 00194880 */ sll $t1, $t9, 2 -/* 0A11E8 800A05E8 00C93021 */ addu $a2, $a2, $t1 -/* 0A11EC 800A05EC 8E24000C */ lw $a0, 0xc($s1) -/* 0A11F0 800A05F0 8E250010 */ lw $a1, 0x10($s1) -/* 0A11F4 800A05F4 8E27001C */ lw $a3, 0x1c($s1) -/* 0A11F8 800A05F8 8CC67524 */ lw $a2, %lo(gCourseNames)($a2) -/* 0A11FC 800A05FC E7B20014 */ swc1 $f18, 0x14($sp) -/* 0A1200 800A0600 0C024CC9 */ jal func_80093324 -/* 0A1204 800A0604 E7B00010 */ swc1 $f16, 0x10($sp) -/* 0A1208 800A0608 100000AF */ b .L800A08C8 -/* 0A120C 800A060C 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0610 -/* 0A1210 800A0610 0C028B47 */ jal func_800A2D1C -/* 0A1214 800A0614 02202025 */ move $a0, $s1 -/* 0A1218 800A0618 100000AB */ b .L800A08C8 -/* 0A121C 800A061C 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0620 -/* 0A1220 800A0620 240A004A */ li $t2, 74 -/* 0A1224 800A0624 AFAA0010 */ sw $t2, 0x10($sp) -/* 0A1228 800A0628 8E040000 */ lw $a0, ($s0) -/* 0A122C 800A062C 24050019 */ li $a1, 25 -/* 0A1230 800A0630 24060072 */ li $a2, 114 -/* 0A1234 800A0634 0C025B36 */ jal func_80096CD8 -/* 0A1238 800A0638 2407007C */ li $a3, 124 -/* 0A123C 800A063C 100000A1 */ b .L800A08C4 -/* 0A1240 800A0640 AE020000 */ sw $v0, ($s0) -glabel L800A0644 -/* 0A1244 800A0644 0C028BAE */ jal func_800A2EB8 -/* 0A1248 800A0648 02202025 */ move $a0, $s1 -/* 0A124C 800A064C 1000009E */ b .L800A08C8 -/* 0A1250 800A0650 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0654 -/* 0A1254 800A0654 0C028D2A */ jal func_800A34A8 -/* 0A1258 800A0658 02202025 */ move $a0, $s1 -/* 0A125C 800A065C 1000009A */ b .L800A08C8 -/* 0A1260 800A0660 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0664 -/* 0A1264 800A0664 0C029855 */ jal func_800A6154 -/* 0A1268 800A0668 02202025 */ move $a0, $s1 -/* 0A126C 800A066C 10000096 */ b .L800A08C8 -/* 0A1270 800A0670 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0674 -/* 0A1274 800A0674 0C02980D */ jal func_800A6034 -/* 0A1278 800A0678 02202025 */ move $a0, $s1 -/* 0A127C 800A067C 10000092 */ b .L800A08C8 -/* 0A1280 800A0680 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0684 -/* 0A1284 800A0684 0C0298E3 */ jal func_800A638C -/* 0A1288 800A0688 02202025 */ move $a0, $s1 -/* 0A128C 800A068C 1000008E */ b .L800A08C8 -/* 0A1290 800A0690 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A0694 -/* 0A1294 800A0694 8E2B0004 */ lw $t3, 4($s1) -/* 0A1298 800A0698 2502FF4F */ addiu $v0, $t0, -0xb1 -/* 0A129C 800A069C 3C0C800F */ lui $t4, %hi(gCharacterSelections) # 0x800f -/* 0A12A0 800A06A0 11600088 */ beqz $t3, .L800A08C4 -/* 0A12A4 800A06A4 01826021 */ addu $t4, $t4, $v0 -/* 0A12A8 800A06A8 818C86A8 */ lb $t4, %lo(gCharacterSelections)($t4) # -0x7958($t4) -/* 0A12AC 800A06AC 3C06800F */ lui $a2, %hi(D_800EFD64) # 0x800f -/* 0A12B0 800A06B0 3C04800E */ lui $a0, %hi(D_800E7D54) -/* 0A12B4 800A06B4 00CC3021 */ addu $a2, $a2, $t4 -/* 0A12B8 800A06B8 80C6FD64 */ lb $a2, %lo(D_800EFD64)($a2) # -0x29c($a2) -/* 0A12BC 800A06BC AFA200A8 */ sw $v0, 0xa8($sp) -/* 0A12C0 800A06C0 00066880 */ sll $t5, $a2, 2 -/* 0A12C4 800A06C4 008D2021 */ addu $a0, $a0, $t5 -/* 0A12C8 800A06C8 0C026449 */ jal segmented_to_virtual_dupe -/* 0A12CC 800A06CC 8C847D54 */ lw $a0, %lo(D_800E7D54)($a0) -/* 0A12D0 800A06D0 8E040000 */ lw $a0, ($s0) -/* 0A12D4 800A06D4 00402825 */ move $a1, $v0 -/* 0A12D8 800A06D8 8E26000C */ lw $a2, 0xc($s1) -/* 0A12DC 800A06DC 0C026E9D */ jal func_8009BA74 -/* 0A12E0 800A06E0 8E270010 */ lw $a3, 0x10($s1) -/* 0A12E4 800A06E4 AE020000 */ sw $v0, ($s0) -/* 0A12E8 800A06E8 8E2E001C */ lw $t6, 0x1c($s1) -/* 0A12EC 800A06EC 8E260010 */ lw $a2, 0x10($s1) -/* 0A12F0 800A06F0 8E25000C */ lw $a1, 0xc($s1) -/* 0A12F4 800A06F4 8E240018 */ lw $a0, 0x18($s1) -/* 0A12F8 800A06F8 8FA700A8 */ lw $a3, 0xa8($sp) -/* 0A12FC 800A06FC 0C0269FB */ jal func_8009A7EC -/* 0A1300 800A0700 AFAE0010 */ sw $t6, 0x10($sp) -/* 0A1304 800A0704 02202025 */ move $a0, $s1 -/* 0A1308 800A0708 8FA500A8 */ lw $a1, 0xa8($sp) -/* 0A130C 800A070C 0C028474 */ jal func_800A11D0 -/* 0A1310 800A0710 240600FF */ li $a2, 255 -/* 0A1314 800A0714 1000006C */ b .L800A08C8 -/* 0A1318 800A0718 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A071C -/* 0A131C 800A071C 0C028F21 */ jal func_800A3C84 -/* 0A1320 800A0720 02202025 */ move $a0, $s1 -/* 0A1324 800A0724 10000068 */ b .L800A08C8 -/* 0A1328 800A0728 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A072C -/* 0A132C 800A072C 0C028F98 */ jal func_800A3E60 -/* 0A1330 800A0730 02202025 */ move $a0, $s1 -/* 0A1334 800A0734 10000064 */ b .L800A08C8 -/* 0A1338 800A0738 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A073C -/* 0A133C 800A073C 0C029289 */ jal func_800A4A24 -/* 0A1340 800A0740 02202025 */ move $a0, $s1 -/* 0A1344 800A0744 10000060 */ b .L800A08C8 -/* 0A1348 800A0748 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A074C -/* 0A134C 800A074C 0C0292CE */ jal render_pause_menu -/* 0A1350 800A0750 02202025 */ move $a0, $s1 -/* 0A1354 800A0754 1000005C */ b .L800A08C8 -/* 0A1358 800A0758 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A075C -/* 0A135C 800A075C 0C0295CE */ jal func_800A5738 -/* 0A1360 800A0760 02202025 */ move $a0, $s1 -/* 0A1364 800A0764 10000058 */ b .L800A08C8 -/* 0A1368 800A0768 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A076C -/* 0A136C 800A076C 0C028649 */ jal func_800A1924 -/* 0A1370 800A0770 02202025 */ move $a0, $s1 -/* 0A1374 800A0774 10000054 */ b .L800A08C8 -/* 0A1378 800A0778 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A077C -/* 0A137C 800A077C 0C028688 */ jal func_800A1A20 -/* 0A1380 800A0780 02202025 */ move $a0, $s1 -/* 0A1384 800A0784 10000050 */ b .L800A08C8 -/* 0A1388 800A0788 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A078C -/* 0A138C 800A078C 0C0286F8 */ jal func_800A1BE0 -/* 0A1390 800A0790 02202025 */ move $a0, $s1 -/* 0A1394 800A0794 1000004C */ b .L800A08C8 -/* 0A1398 800A0798 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A079C -/* 0A139C 800A079C 0C028778 */ jal func_800A1DE0 -/* 0A13A0 800A07A0 02202025 */ move $a0, $s1 -/* 0A13A4 800A07A4 10000048 */ b .L800A08C8 -/* 0A13A8 800A07A8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A07AC -/* 0A13AC 800A07AC 0C0287CC */ jal func_800A1F30 -/* 0A13B0 800A07B0 02202025 */ move $a0, $s1 -/* 0A13B4 800A07B4 10000044 */ b .L800A08C8 -/* 0A13B8 800A07B8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A07BC -/* 0A13BC 800A07BC 0C0287EC */ jal func_800A1FB0 -/* 0A13C0 800A07C0 02202025 */ move $a0, $s1 -/* 0A13C4 800A07C4 10000040 */ b .L800A08C8 -/* 0A13C8 800A07C8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A07CC -/* 0A13CC 800A07CC 3C050200 */ lui $a1, %hi(D_02004638) # $a1, 0x200 -/* 0A13D0 800A07D0 24A54638 */ addiu $a1, %lo(D_02004638) # addiu $a1, $a1, 0x4638 -/* 0A13D4 800A07D4 8E040000 */ lw $a0, ($s0) -/* 0A13D8 800A07D8 8E26000C */ lw $a2, 0xc($s1) -/* 0A13DC 800A07DC 0C026E9D */ jal func_8009BA74 -/* 0A13E0 800A07E0 8E270010 */ lw $a3, 0x10($s1) -/* 0A13E4 800A07E4 10000037 */ b .L800A08C4 -/* 0A13E8 800A07E8 AE020000 */ sw $v0, ($s0) -glabel L800A07EC -/* 0A13EC 800A07EC 0C029C3A */ jal func_800A70E8 -/* 0A13F0 800A07F0 02202025 */ move $a0, $s1 -/* 0A13F4 800A07F4 10000034 */ b .L800A08C8 -/* 0A13F8 800A07F8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A07FC -/* 0A13FC 800A07FC 0C029C96 */ jal func_800A7258 -/* 0A1400 800A0800 02202025 */ move $a0, $s1 -/* 0A1404 800A0804 10000030 */ b .L800A08C8 -/* 0A1408 800A0808 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A080C -/* 0A140C 800A080C 0C029CBF */ jal func_800A72FC -/* 0A1410 800A0810 02202025 */ move $a0, $s1 -/* 0A1414 800A0814 1000002C */ b .L800A08C8 -/* 0A1418 800A0818 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A081C -/* 0A141C 800A081C 0C029D12 */ jal func_800A7448 -/* 0A1420 800A0820 02202025 */ move $a0, $s1 -/* 0A1424 800A0824 10000028 */ b .L800A08C8 -/* 0A1428 800A0828 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A082C -/* 0A142C 800A082C 0C029D68 */ jal func_800A75A0 -/* 0A1430 800A0830 02202025 */ move $a0, $s1 -/* 0A1434 800A0834 10000024 */ b .L800A08C8 -/* 0A1438 800A0838 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A083C -/* 0A143C 800A083C 0C029D87 */ jal func_800A761C -/* 0A1440 800A0840 02202025 */ move $a0, $s1 -/* 0A1444 800A0844 10000020 */ b .L800A08C8 -/* 0A1448 800A0848 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A084C -/* 0A144C 800A084C 8E2F0004 */ lw $t7, 4($s1) -/* 0A1450 800A0850 3C188028 */ lui $t8, %hi(D_802874D8+0x1E) # $t8, 0x8028 -/* 0A1454 800A0854 51E0001C */ beql $t7, $zero, .L800A08C8 -/* 0A1458 800A0858 8FBF0034 */ lw $ra, 0x34($sp) -/* 0A145C 800A085C 831874F6 */ lb $t8, %lo(D_802874D8+0x1E)($t8) -/* 0A1460 800A0860 3C06800F */ lui $a2, %hi(D_800EFD64) # 0x800f -/* 0A1464 800A0864 3C04800E */ lui $a0, %hi(D_800E7D54) -/* 0A1468 800A0868 00D83021 */ addu $a2, $a2, $t8 -/* 0A146C 800A086C 80C6FD64 */ lb $a2, %lo(D_800EFD64)($a2) # -0x29c($a2) -/* 0A1470 800A0870 0006C880 */ sll $t9, $a2, 2 -/* 0A1474 800A0874 00992021 */ addu $a0, $a0, $t9 -/* 0A1478 800A0878 0C026449 */ jal segmented_to_virtual_dupe -/* 0A147C 800A087C 8C847D54 */ lw $a0, %lo(D_800E7D54)($a0) -/* 0A1480 800A0880 8E040000 */ lw $a0, ($s0) -/* 0A1484 800A0884 00402825 */ move $a1, $v0 -/* 0A1488 800A0888 8E26000C */ lw $a2, 0xc($s1) -/* 0A148C 800A088C 0C026E9D */ jal func_8009BA74 -/* 0A1490 800A0890 8E270010 */ lw $a3, 0x10($s1) -/* 0A1494 800A0894 AE020000 */ sw $v0, ($s0) -/* 0A1498 800A0898 8E29001C */ lw $t1, 0x1c($s1) -/* 0A149C 800A089C 8E260010 */ lw $a2, 0x10($s1) -/* 0A14A0 800A08A0 8E25000C */ lw $a1, 0xc($s1) -/* 0A14A4 800A08A4 8E240018 */ lw $a0, 0x18($s1) -/* 0A14A8 800A08A8 00003825 */ move $a3, $zero -/* 0A14AC 800A08AC 0C0269FB */ jal func_8009A7EC -/* 0A14B0 800A08B0 AFA90010 */ sw $t1, 0x10($sp) -/* 0A14B4 800A08B4 10000004 */ b .L800A08C8 -/* 0A14B8 800A08B8 8FBF0034 */ lw $ra, 0x34($sp) -glabel L800A08BC -/* 0A14BC 800A08BC 0C029DE4 */ jal func_800A7790 -/* 0A14C0 800A08C0 02202025 */ move $a0, $s1 -.L800A08C4: -glabel L800A08C4 -/* 0A14C4 800A08C4 8FBF0034 */ lw $ra, 0x34($sp) -.L800A08C8: -/* 0A14C8 800A08C8 8FB0002C */ lw $s0, 0x2c($sp) -/* 0A14CC 800A08CC 8FB10030 */ lw $s1, 0x30($sp) -/* 0A14D0 800A08D0 03E00008 */ jr $ra -/* 0A14D4 800A08D4 27BD00B0 */ addiu $sp, $sp, 0xb0 diff --git a/asm/non_matchings/code_80091750/func_800A09E0.s b/asm/non_matchings/code_80091750/func_800A09E0.s deleted file mode 100644 index 96a4051481..0000000000 --- a/asm/non_matchings/code_80091750/func_800A09E0.s +++ /dev/null @@ -1,64 +0,0 @@ -glabel func_800A09E0 -/* 0A15E0 800A09E0 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0A15E4 800A09E4 AFB10018 */ sw $s1, 0x18($sp) -/* 0A15E8 800A09E8 3C118015 */ lui $s1, %hi(gDisplayListHead) # $s1, 0x8015 -/* 0A15EC 800A09EC 26310298 */ addiu $s1, %lo(gDisplayListHead) # addiu $s1, $s1, 0x298 -/* 0A15F0 800A09F0 8E230000 */ lw $v1, ($s1) -/* 0A15F4 800A09F4 AFB70030 */ sw $s7, 0x30($sp) -/* 0A15F8 800A09F8 AFB6002C */ sw $s6, 0x2c($sp) -/* 0A15FC 800A09FC AFB50028 */ sw $s5, 0x28($sp) -/* 0A1600 800A0A00 AFB40024 */ sw $s4, 0x24($sp) -/* 0A1604 800A0A04 AFB30020 */ sw $s3, 0x20($sp) -/* 0A1608 800A0A08 AFB2001C */ sw $s2, 0x1c($sp) -/* 0A160C 800A0A0C AFB00014 */ sw $s0, 0x14($sp) -/* 0A1610 800A0A10 246E0008 */ addiu $t6, $v1, 8 -/* 0A1614 800A0A14 AFBF0034 */ sw $ra, 0x34($sp) -/* 0A1618 800A0A18 AE2E0000 */ sw $t6, ($s1) -/* 0A161C 800A0A1C 3C18004F */ lui $t8, (0x004FC308 >> 16) # lui $t8, 0x4f -/* 0A1620 800A0A20 3718C308 */ ori $t8, (0x004FC308 & 0xFFFF) # ori $t8, $t8, 0xc308 -/* 0A1624 800A0A24 3C0FED00 */ lui $t7, 0xed00 -/* 0A1628 800A0A28 3C13800F */ lui $s3, %hi(D_800E86D0) # $s3, 0x800f -/* 0A162C 800A0A2C 3C160200 */ lui $s6, %hi(D_0200157C) # $s6, 0x200 -/* 0A1630 800A0A30 00809025 */ move $s2, $a0 -/* 0A1634 800A0A34 26D6157C */ addiu $s6, %lo(D_0200157C) # addiu $s6, $s6, 0x157c -/* 0A1638 800A0A38 267386D0 */ addiu $s3, %lo(D_800E86D0) # addiu $s3, $s3, -0x7930 -/* 0A163C 800A0A3C 00008025 */ move $s0, $zero -/* 0A1640 800A0A40 24140008 */ li $s4, 8 -/* 0A1644 800A0A44 24150009 */ li $s5, 9 -/* 0A1648 800A0A48 2417000A */ li $s7, 10 -/* 0A164C 800A0A4C AC6F0000 */ sw $t7, ($v1) -/* 0A1650 800A0A50 AC780004 */ sw $t8, 4($v1) -/* 0A1654 800A0A54 82790000 */ lb $t9, ($s3) -.L800A0A58: -/* 0A1658 800A0A58 17200005 */ bnez $t9, .L800A0A70 -/* 0A165C 800A0A5C 00000000 */ nop -/* 0A1660 800A0A60 5200000E */ beql $s0, $zero, .L800A0A9C -/* 0A1664 800A0A64 26100001 */ addiu $s0, $s0, 1 -/* 0A1668 800A0A68 5214000C */ beql $s0, $s4, .L800A0A9C -/* 0A166C 800A0A6C 26100001 */ addiu $s0, $s0, 1 -.L800A0A70: -/* 0A1670 800A0A70 02170019 */ multu $s0, $s7 -/* 0A1674 800A0A74 8E490010 */ lw $t1, 0x10($s2) -/* 0A1678 800A0A78 8E240000 */ lw $a0, ($s1) -/* 0A167C 800A0A7C 02C02825 */ move $a1, $s6 -/* 0A1680 800A0A80 24060020 */ li $a2, 32 -/* 0A1684 800A0A84 00004012 */ mflo $t0 -/* 0A1688 800A0A88 01093821 */ addu $a3, $t0, $t1 -/* 0A168C 800A0A8C 0C026E9D */ jal func_8009BA74 -/* 0A1690 800A0A90 00000000 */ nop -/* 0A1694 800A0A94 AE220000 */ sw $v0, ($s1) -/* 0A1698 800A0A98 26100001 */ addiu $s0, $s0, 1 -.L800A0A9C: -/* 0A169C 800A0A9C 5615FFEE */ bnel $s0, $s5, .L800A0A58 -/* 0A16A0 800A0AA0 82790000 */ lb $t9, ($s3) -/* 0A16A4 800A0AA4 8FBF0034 */ lw $ra, 0x34($sp) -/* 0A16A8 800A0AA8 8FB00014 */ lw $s0, 0x14($sp) -/* 0A16AC 800A0AAC 8FB10018 */ lw $s1, 0x18($sp) -/* 0A16B0 800A0AB0 8FB2001C */ lw $s2, 0x1c($sp) -/* 0A16B4 800A0AB4 8FB30020 */ lw $s3, 0x20($sp) -/* 0A16B8 800A0AB8 8FB40024 */ lw $s4, 0x24($sp) -/* 0A16BC 800A0ABC 8FB50028 */ lw $s5, 0x28($sp) -/* 0A16C0 800A0AC0 8FB6002C */ lw $s6, 0x2c($sp) -/* 0A16C4 800A0AC4 8FB70030 */ lw $s7, 0x30($sp) -/* 0A16C8 800A0AC8 03E00008 */ jr $ra -/* 0A16CC 800A0ACC 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/asm/non_matchings/code_80091750/func_800A1FB0.s b/asm/non_matchings/code_80091750/func_800A1FB0.s deleted file mode 100644 index 270a7a7669..0000000000 --- a/asm/non_matchings/code_80091750/func_800A1FB0.s +++ /dev/null @@ -1,989 +0,0 @@ -.section .late_rodata - -glabel jpt_800F1B5C -.word L800A2054, L800A2054, L800A2054, L800A2054 -.word L800A2C7C, L800A2C7C, L800A2C7C, L800A2C7C -.word L800A2C7C, L800A2118, L800A2118, L800A21E4 -.word L800A2C7C, L800A2C7C, L800A2C7C, L800A2C7C -.word L800A2C7C, L800A2C7C, L800A2C7C, L800A23DC -.word L800A23DC, L800A223C, L800A223C, L800A223C -.word L800A223C, L800A2C7C, L800A2C7C, L800A2C7C -.word L800A2C7C, L800A23DC, L800A23DC, L800A22AC -.word L800A22AC, L800A22AC, L800A22AC, L800A26A8 -.word L800A26A8, L800A29D0, L800A29D0, L800A29D0 -.word L800A2C7C, L800A2C7C, L800A2C7C, L800A2C7C -.word L800A2314, L800A2314, L800A2C7C, L800A2C7C -.word L800A2C7C, L800A2384, L800A2384 - -glabel D_800F1C28 -.float 0.9 - -glabel D_800F1C2C -.float 0.9 - -glabel D_800F1C30 -.float 0.8 - -glabel D_800F1C34 -.float 0.9 - -glabel D_800F1C38 -.float 0.6 - -glabel D_800F1C3C -.float 0.8 - -glabel D_800F1C40 -.float 0.6 - -glabel D_800F1C44 -.float 0.6 - -glabel jpt_800F1C48 -.word L800A2CA0, L800A2CA0, L800A2CBC, L800A2CBC -.word L800A2CBC, L800A2CBC, L800A2CBC, L800A2CBC -.word L800A2CBC, L800A2CBC, L800A2CA0, L800A2CA0 -.word L800A2CBC, L800A2CBC, L800A2CBC, L800A2CBC -.word L800A2CA0, L800A2CA0 - -.section .text - -glabel func_800A1FB0 -/* 0A2BB0 800A1FB0 27BDFF18 */ addiu $sp, $sp, -0xe8 -/* 0A2BB4 800A1FB4 AFB00048 */ sw $s0, 0x48($sp) -/* 0A2BB8 800A1FB8 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 0A2BBC 800A1FBC 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 0A2BC0 800A1FC0 AFBF006C */ sw $ra, 0x6c($sp) -/* 0A2BC4 800A1FC4 AFA400E8 */ sw $a0, 0xe8($sp) -/* 0A2BC8 800A1FC8 240E00F0 */ li $t6, 240 -/* 0A2BCC 800A1FCC 240F0064 */ li $t7, 100 -/* 0A2BD0 800A1FD0 AFBE0068 */ sw $fp, 0x68($sp) -/* 0A2BD4 800A1FD4 AFB70064 */ sw $s7, 0x64($sp) -/* 0A2BD8 800A1FD8 AFB60060 */ sw $s6, 0x60($sp) -/* 0A2BDC 800A1FDC AFB5005C */ sw $s5, 0x5c($sp) -/* 0A2BE0 800A1FE0 AFB40058 */ sw $s4, 0x58($sp) -/* 0A2BE4 800A1FE4 AFB30054 */ sw $s3, 0x54($sp) -/* 0A2BE8 800A1FE8 AFB20050 */ sw $s2, 0x50($sp) -/* 0A2BEC 800A1FEC AFB1004C */ sw $s1, 0x4c($sp) -/* 0A2BF0 800A1FF0 F7B80040 */ sdc1 $f24, 0x40($sp) -/* 0A2BF4 800A1FF4 F7B60038 */ sdc1 $f22, 0x38($sp) -/* 0A2BF8 800A1FF8 F7B40030 */ sdc1 $f20, 0x30($sp) -/* 0A2BFC 800A1FFC AFAF0020 */ sw $t7, 0x20($sp) -/* 0A2C00 800A2000 AFAE0010 */ sw $t6, 0x10($sp) -/* 0A2C04 800A2004 8E040000 */ lw $a0, ($s0) -/* 0A2C08 800A2008 AFA00014 */ sw $zero, 0x14($sp) -/* 0A2C0C 800A200C AFA00018 */ sw $zero, 0x18($sp) -/* 0A2C10 800A2010 AFA0001C */ sw $zero, 0x1c($sp) -/* 0A2C14 800A2014 00002825 */ move $a1, $zero -/* 0A2C18 800A2018 00003025 */ move $a2, $zero -/* 0A2C1C 800A201C 0C02637E */ jal draw_box -/* 0A2C20 800A2020 24070140 */ li $a3, 320 -/* 0A2C24 800A2024 AE020000 */ sw $v0, ($s0) -/* 0A2C28 800A2028 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2C2C 800A202C 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -/* 0A2C30 800A2030 2478FFEB */ addiu $t8, $v1, -0x15 -/* 0A2C34 800A2034 2F010033 */ sltiu $at, $t8, 0x33 -/* 0A2C38 800A2038 10200310 */ beqz $at, .L800A2C7C -/* 0A2C3C 800A203C 0018C080 */ sll $t8, $t8, 2 -/* 0A2C40 800A2040 3C01800F */ lui $at, %hi(jpt_800F1B5C) -/* 0A2C44 800A2044 00380821 */ addu $at, $at, $t8 -/* 0A2C48 800A2048 8C381B5C */ lw $t8, %lo(jpt_800F1B5C)($at) -/* 0A2C4C 800A204C 03000008 */ jr $t8 -/* 0A2C50 800A2050 00000000 */ nop -glabel L800A2054 -/* 0A2C54 800A2054 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A2C58 800A2058 4481B000 */ mtc1 $at, $f22 -/* 0A2C5C 800A205C 3C01800F */ lui $at, %hi(D_800F1C28) # $at, 0x800f -/* 0A2C60 800A2060 3C11800E */ lui $s1, %hi(D_800E7868) # $s1, 0x800e -/* 0A2C64 800A2064 26317868 */ addiu $s1, %lo(D_800E7868) # addiu $s1, $s1, 0x7868 -/* 0A2C68 800A2068 C4341C28 */ lwc1 $f20, %lo(D_800F1C28)($at) -/* 0A2C6C 800A206C 00009025 */ move $s2, $zero -/* 0A2C70 800A2070 2464FFEB */ addiu $a0, $v1, -0x15 -/* 0A2C74 800A2074 24100055 */ li $s0, 85 -/* 0A2C78 800A2078 24130004 */ li $s3, 4 -.L800A207C: -/* 0A2C7C 800A207C 02402825 */ move $a1, $s2 -/* 0A2C80 800A2080 0C024889 */ jal set_text_color_rainbow_if_selected -/* 0A2C84 800A2084 24060003 */ li $a2, 3 -/* 0A2C88 800A2088 24040032 */ li $a0, 50 -/* 0A2C8C 800A208C 02002825 */ move $a1, $s0 -/* 0A2C90 800A2090 8E260000 */ lw $a2, ($s1) -/* 0A2C94 800A2094 00003825 */ move $a3, $zero -/* 0A2C98 800A2098 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A2C9C 800A209C 0C024CC9 */ jal func_80093324 -/* 0A2CA0 800A20A0 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A2CA4 800A20A4 3C048019 */ lui $a0, %hi(D_8018EDEC) # $a0, 0x8019 -/* 0A2CA8 800A20A8 8084EDEC */ lb $a0, %lo(D_8018EDEC)($a0) -/* 0A2CAC 800A20AC 26310004 */ addiu $s1, $s1, 4 -/* 0A2CB0 800A20B0 24190032 */ li $t9, 50 -/* 0A2CB4 800A20B4 2484FFEB */ addiu $a0, $a0, -0x15 -/* 0A2CB8 800A20B8 56440004 */ bnel $s2, $a0, .L800A20CC -/* 0A2CBC 800A20BC 26520001 */ addiu $s2, $s2, 1 -/* 0A2CC0 800A20C0 A7B900E0 */ sh $t9, 0xe0($sp) -/* 0A2CC4 800A20C4 A7B000E2 */ sh $s0, 0xe2($sp) -/* 0A2CC8 800A20C8 26520001 */ addiu $s2, $s2, 1 -.L800A20CC: -/* 0A2CCC 800A20CC 1653FFEB */ bne $s2, $s3, .L800A207C -/* 0A2CD0 800A20D0 26100023 */ addiu $s0, $s0, 0x23 -/* 0A2CD4 800A20D4 0C024C36 */ jal set_text_color -/* 0A2CD8 800A20D8 24040001 */ li $a0, 1 -/* 0A2CDC 800A20DC 3C088019 */ lui $t0, %hi(gSoundMode) # $t0, 0x8019 -/* 0A2CE0 800A20E0 9108EDF2 */ lbu $t0, %lo(gSoundMode)($t0) -/* 0A2CE4 800A20E4 3C06800E */ lui $a2, %hi(gSoundModeNames) -/* 0A2CE8 800A20E8 240400E6 */ li $a0, 230 -/* 0A2CEC 800A20EC 00084880 */ sll $t1, $t0, 2 -/* 0A2CF0 800A20F0 00C93021 */ addu $a2, $a2, $t1 -/* 0A2CF4 800A20F4 8CC67710 */ lw $a2, %lo(gSoundModeNames)($a2) -/* 0A2CF8 800A20F8 24050078 */ li $a1, 120 -/* 0A2CFC 800A20FC 00003825 */ move $a3, $zero -/* 0A2D00 800A2100 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A2D04 800A2104 0C024DBB */ jal draw_text -/* 0A2D08 800A2108 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A2D0C 800A210C 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2D10 800A2110 100002DA */ b .L800A2C7C -/* 0A2D14 800A2114 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A2118 -/* 0A2D18 800A2118 0C024C36 */ jal set_text_color -/* 0A2D1C 800A211C 24040003 */ li $a0, 3 -/* 0A2D20 800A2120 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A2D24 800A2124 3C11800E */ lui $s1, %hi(D_800E7878) # $s1, 0x800e -/* 0A2D28 800A2128 3C12800E */ lui $s2, %hi(D_800E7884) # $s2, 0x800e -/* 0A2D2C 800A212C 4481B000 */ mtc1 $at, $f22 -/* 0A2D30 800A2130 26527884 */ addiu $s2, %lo(D_800E7884) # addiu $s2, $s2, 0x7884 -/* 0A2D34 800A2134 26317878 */ addiu $s1, %lo(D_800E7878) # addiu $s1, $s1, 0x7878 -/* 0A2D38 800A2138 24100055 */ li $s0, 85 -.L800A213C: -/* 0A2D3C 800A213C 24040028 */ li $a0, 40 -/* 0A2D40 800A2140 02002825 */ move $a1, $s0 -/* 0A2D44 800A2144 8E260000 */ lw $a2, ($s1) -/* 0A2D48 800A2148 00003825 */ move $a3, $zero -/* 0A2D4C 800A214C E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A2D50 800A2150 0C024CC9 */ jal func_80093324 -/* 0A2D54 800A2154 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A2D58 800A2158 26310004 */ addiu $s1, $s1, 4 -/* 0A2D5C 800A215C 0232082B */ sltu $at, $s1, $s2 -/* 0A2D60 800A2160 1420FFF6 */ bnez $at, .L800A213C -/* 0A2D64 800A2164 26100014 */ addiu $s0, $s0, 0x14 -/* 0A2D68 800A2168 3C048019 */ lui $a0, %hi(D_8018EDEC) # $a0, 0x8019 -/* 0A2D6C 800A216C 8084EDEC */ lb $a0, %lo(D_8018EDEC)($a0) -/* 0A2D70 800A2170 3C11800E */ lui $s1, %hi(D_800E7840) # $s1, 0x800e -/* 0A2D74 800A2174 26317840 */ addiu $s1, %lo(D_800E7840) # addiu $s1, $s1, 0x7840 -/* 0A2D78 800A2178 00009025 */ move $s2, $zero -/* 0A2D7C 800A217C 24100096 */ li $s0, 150 -/* 0A2D80 800A2180 2484FFE2 */ addiu $a0, $a0, -0x1e -.L800A2184: -/* 0A2D84 800A2184 02402825 */ move $a1, $s2 -/* 0A2D88 800A2188 0C024889 */ jal set_text_color_rainbow_if_selected -/* 0A2D8C 800A218C 24060001 */ li $a2, 1 -/* 0A2D90 800A2190 24040084 */ li $a0, 132 -/* 0A2D94 800A2194 02002825 */ move $a1, $s0 -/* 0A2D98 800A2198 8E260000 */ lw $a2, ($s1) -/* 0A2D9C 800A219C 00003825 */ move $a3, $zero -/* 0A2DA0 800A21A0 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A2DA4 800A21A4 0C024CC9 */ jal func_80093324 -/* 0A2DA8 800A21A8 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A2DAC 800A21AC 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2DB0 800A21B0 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -/* 0A2DB4 800A21B4 26310004 */ addiu $s1, $s1, 4 -/* 0A2DB8 800A21B8 24010002 */ li $at, 2 -/* 0A2DBC 800A21BC 2464FFE2 */ addiu $a0, $v1, -0x1e -/* 0A2DC0 800A21C0 16440003 */ bne $s2, $a0, .L800A21D0 -/* 0A2DC4 800A21C4 240A0084 */ li $t2, 132 -/* 0A2DC8 800A21C8 A7AA00E0 */ sh $t2, 0xe0($sp) -/* 0A2DCC 800A21CC A7B000E2 */ sh $s0, 0xe2($sp) -.L800A21D0: -/* 0A2DD0 800A21D0 26520001 */ addiu $s2, $s2, 1 -/* 0A2DD4 800A21D4 1641FFEB */ bne $s2, $at, .L800A2184 -/* 0A2DD8 800A21D8 26100019 */ addiu $s0, $s0, 0x19 -/* 0A2DDC 800A21DC 100002A8 */ b .L800A2C80 -/* 0A2DE0 800A21E0 246FFFD8 */ addiu $t7, $v1, -0x28 -glabel L800A21E4 -/* 0A2DE4 800A21E4 0C024C36 */ jal set_text_color -/* 0A2DE8 800A21E8 24040003 */ li $a0, 3 -/* 0A2DEC 800A21EC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A2DF0 800A21F0 3C11800E */ lui $s1, %hi(D_800E7884) # $s1, 0x800e -/* 0A2DF4 800A21F4 3C12800E */ lui $s2, %hi(D_800E7890) # $s2, 0x800e -/* 0A2DF8 800A21F8 4481B000 */ mtc1 $at, $f22 -/* 0A2DFC 800A21FC 26527890 */ addiu $s2, %lo(D_800E7890) # addiu $s2, $s2, 0x7890 -/* 0A2E00 800A2200 26317884 */ addiu $s1, %lo(D_800E7884) # addiu $s1, $s1, 0x7884 -/* 0A2E04 800A2204 24100055 */ li $s0, 85 -.L800A2208: -/* 0A2E08 800A2208 24040032 */ li $a0, 50 -/* 0A2E0C 800A220C 02002825 */ move $a1, $s0 -/* 0A2E10 800A2210 8E260000 */ lw $a2, ($s1) -/* 0A2E14 800A2214 00003825 */ move $a3, $zero -/* 0A2E18 800A2218 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A2E1C 800A221C 0C024CC9 */ jal func_80093324 -/* 0A2E20 800A2220 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A2E24 800A2224 26310004 */ addiu $s1, $s1, 4 -/* 0A2E28 800A2228 1632FFF7 */ bne $s1, $s2, .L800A2208 -/* 0A2E2C 800A222C 26100014 */ addiu $s0, $s0, 0x14 -/* 0A2E30 800A2230 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2E34 800A2234 10000291 */ b .L800A2C7C -/* 0A2E38 800A2238 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A223C -/* 0A2E3C 800A223C 0C024C36 */ jal set_text_color -/* 0A2E40 800A2240 24040002 */ li $a0, 2 -/* 0A2E44 800A2244 3C028019 */ lui $v0, %hi(D_8018EDEC) # $v0, 0x8019 -/* 0A2E48 800A2248 8042EDEC */ lb $v0, %lo(D_8018EDEC)($v0) -/* 0A2E4C 800A224C 3C0D800E */ lui $t5, %hi(D_800E78D0) # $t5, 0x800e -/* 0A2E50 800A2250 25AD78D0 */ addiu $t5, %lo(D_800E78D0) # addiu $t5, $t5, 0x78d0 -/* 0A2E54 800A2254 2442FFD6 */ addiu $v0, $v0, -0x2a -/* 0A2E58 800A2258 00025880 */ sll $t3, $v0, 2 -/* 0A2E5C 800A225C 01625823 */ subu $t3, $t3, $v0 -/* 0A2E60 800A2260 000B6080 */ sll $t4, $t3, 2 -/* 0A2E64 800A2264 3C01800F */ lui $at, %hi(D_800F1C2C) # $at, 0x800f -/* 0A2E68 800A2268 C4341C2C */ lwc1 $f20, %lo(D_800F1C2C)($at) -/* 0A2E6C 800A226C 018D8821 */ addu $s1, $t4, $t5 -/* 0A2E70 800A2270 24100055 */ li $s0, 85 -/* 0A2E74 800A2274 24120091 */ li $s2, 145 -.L800A2278: -/* 0A2E78 800A2278 24040032 */ li $a0, 50 -/* 0A2E7C 800A227C 02002825 */ move $a1, $s0 -/* 0A2E80 800A2280 8E260000 */ lw $a2, ($s1) -/* 0A2E84 800A2284 00003825 */ move $a3, $zero -/* 0A2E88 800A2288 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A2E8C 800A228C 0C024CC9 */ jal func_80093324 -/* 0A2E90 800A2290 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A2E94 800A2294 26100014 */ addiu $s0, $s0, 0x14 -/* 0A2E98 800A2298 1612FFF7 */ bne $s0, $s2, .L800A2278 -/* 0A2E9C 800A229C 26310004 */ addiu $s1, $s1, 4 -/* 0A2EA0 800A22A0 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2EA4 800A22A4 10000275 */ b .L800A2C7C -/* 0A2EA8 800A22A8 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A22AC -/* 0A2EAC 800A22AC 0C024C36 */ jal set_text_color -/* 0A2EB0 800A22B0 24040002 */ li $a0, 2 -/* 0A2EB4 800A22B4 3C028019 */ lui $v0, %hi(D_8018EDEC) # $v0, 0x8019 -/* 0A2EB8 800A22B8 8042EDEC */ lb $v0, %lo(D_8018EDEC)($v0) -/* 0A2EBC 800A22BC 3C18800E */ lui $t8, %hi(D_800E7890) # $t8, 0x800e -/* 0A2EC0 800A22C0 27187890 */ addiu $t8, %lo(D_800E7890) # addiu $t8, $t8, 0x7890 -/* 0A2EC4 800A22C4 244EFFCC */ addiu $t6, $v0, -0x34 -/* 0A2EC8 800A22C8 000E7900 */ sll $t7, $t6, 4 -/* 0A2ECC 800A22CC 3C01800F */ lui $at, %hi(D_800F1C30) # $at, 0x800f -/* 0A2ED0 800A22D0 C4341C30 */ lwc1 $f20, %lo(D_800F1C30)($at) -/* 0A2ED4 800A22D4 01F88821 */ addu $s1, $t7, $t8 -/* 0A2ED8 800A22D8 24100055 */ li $s0, 85 -/* 0A2EDC 800A22DC 241200A5 */ li $s2, 165 -.L800A22E0: -/* 0A2EE0 800A22E0 24040023 */ li $a0, 35 -/* 0A2EE4 800A22E4 02002825 */ move $a1, $s0 -/* 0A2EE8 800A22E8 8E260000 */ lw $a2, ($s1) -/* 0A2EEC 800A22EC 00003825 */ move $a3, $zero -/* 0A2EF0 800A22F0 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A2EF4 800A22F4 0C024CC9 */ jal func_80093324 -/* 0A2EF8 800A22F8 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A2EFC 800A22FC 26100014 */ addiu $s0, $s0, 0x14 -/* 0A2F00 800A2300 1612FFF7 */ bne $s0, $s2, .L800A22E0 -/* 0A2F04 800A2304 26310004 */ addiu $s1, $s1, 4 -/* 0A2F08 800A2308 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2F0C 800A230C 1000025B */ b .L800A2C7C -/* 0A2F10 800A2310 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A2314 -/* 0A2F14 800A2314 0C024C36 */ jal set_text_color -/* 0A2F18 800A2318 24040002 */ li $a0, 2 -/* 0A2F1C 800A231C 3C028019 */ lui $v0, %hi(D_8018EDEC) # $v0, 0x8019 -/* 0A2F20 800A2320 8042EDEC */ lb $v0, %lo(D_8018EDEC)($v0) -/* 0A2F24 800A2324 3C09800E */ lui $t1, %hi(D_800E7900) # $t1, 0x800e -/* 0A2F28 800A2328 25297900 */ addiu $t1, %lo(D_800E7900) # addiu $t1, $t1, 0x7900 -/* 0A2F2C 800A232C 2442FFBF */ addiu $v0, $v0, -0x41 -/* 0A2F30 800A2330 0002C880 */ sll $t9, $v0, 2 -/* 0A2F34 800A2334 0322C823 */ subu $t9, $t9, $v0 -/* 0A2F38 800A2338 00194080 */ sll $t0, $t9, 2 -/* 0A2F3C 800A233C 3C01800F */ lui $at, %hi(D_800F1C34) # $at, 0x800f -/* 0A2F40 800A2340 C4341C34 */ lwc1 $f20, %lo(D_800F1C34)($at) -/* 0A2F44 800A2344 01098821 */ addu $s1, $t0, $t1 -/* 0A2F48 800A2348 24100055 */ li $s0, 85 -/* 0A2F4C 800A234C 24120091 */ li $s2, 145 -.L800A2350: -/* 0A2F50 800A2350 24040041 */ li $a0, 65 -/* 0A2F54 800A2354 02002825 */ move $a1, $s0 -/* 0A2F58 800A2358 8E260000 */ lw $a2, ($s1) -/* 0A2F5C 800A235C 00003825 */ move $a3, $zero -/* 0A2F60 800A2360 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A2F64 800A2364 0C024CC9 */ jal func_80093324 -/* 0A2F68 800A2368 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A2F6C 800A236C 26100014 */ addiu $s0, $s0, 0x14 -/* 0A2F70 800A2370 1612FFF7 */ bne $s0, $s2, .L800A2350 -/* 0A2F74 800A2374 26310004 */ addiu $s1, $s1, 4 -/* 0A2F78 800A2378 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2F7C 800A237C 1000023F */ b .L800A2C7C -/* 0A2F80 800A2380 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A2384 -/* 0A2F84 800A2384 0C024C36 */ jal set_text_color -/* 0A2F88 800A2388 24040003 */ li $a0, 3 -/* 0A2F8C 800A238C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A2F90 800A2390 3C11800E */ lui $s1, %hi(D_800E7A48) # $s1, 0x800e -/* 0A2F94 800A2394 3C12800E */ lui $s2, %hi(D_800E7A54) # $s2, 0x800e -/* 0A2F98 800A2398 4481B000 */ mtc1 $at, $f22 -/* 0A2F9C 800A239C 26527A54 */ addiu $s2, %lo(D_800E7A54) # addiu $s2, $s2, 0x7a54 -/* 0A2FA0 800A23A0 26317A48 */ addiu $s1, %lo(D_800E7A48) # addiu $s1, $s1, 0x7a48 -/* 0A2FA4 800A23A4 24100055 */ li $s0, 85 -.L800A23A8: -/* 0A2FA8 800A23A8 24040050 */ li $a0, 80 -/* 0A2FAC 800A23AC 02002825 */ move $a1, $s0 -/* 0A2FB0 800A23B0 8E260000 */ lw $a2, ($s1) -/* 0A2FB4 800A23B4 00003825 */ move $a3, $zero -/* 0A2FB8 800A23B8 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A2FBC 800A23BC 0C024CC9 */ jal func_80093324 -/* 0A2FC0 800A23C0 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A2FC4 800A23C4 26310004 */ addiu $s1, $s1, 4 -/* 0A2FC8 800A23C8 1632FFF7 */ bne $s1, $s2, .L800A23A8 -/* 0A2FCC 800A23CC 26100014 */ addiu $s0, $s0, 0x14 -/* 0A2FD0 800A23D0 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A2FD4 800A23D4 10000229 */ b .L800A2C7C -/* 0A2FD8 800A23D8 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A23DC -/* 0A2FDC 800A23DC 24010028 */ li $at, 40 -/* 0A2FE0 800A23E0 1061000B */ beq $v1, $at, .L800A2410 -/* 0A2FE4 800A23E4 24150028 */ li $s5, 40 -/* 0A2FE8 800A23E8 24010029 */ li $at, 41 -/* 0A2FEC 800A23EC 10610008 */ beq $v1, $at, .L800A2410 -/* 0A2FF0 800A23F0 24010032 */ li $at, 50 -/* 0A2FF4 800A23F4 10610008 */ beq $v1, $at, .L800A2418 -/* 0A2FF8 800A23F8 24150032 */ li $s5, 50 -/* 0A2FFC 800A23FC 24010033 */ li $at, 51 -/* 0A3000 800A2400 10610005 */ beq $v1, $at, .L800A2418 -/* 0A3004 800A2404 8FB400C0 */ lw $s4, 0xc0($sp) -/* 0A3008 800A2408 10000004 */ b .L800A241C -/* 0A300C 800A240C 8FB500C4 */ lw $s5, 0xc4($sp) -.L800A2410: -/* 0A3010 800A2410 10000002 */ b .L800A241C -/* 0A3014 800A2414 0000A025 */ move $s4, $zero -.L800A2418: -/* 0A3018 800A2418 24140001 */ li $s4, 1 -.L800A241C: -/* 0A301C 800A241C 0C024C36 */ jal set_text_color -/* 0A3020 800A2420 26840001 */ addiu $a0, $s4, 1 -/* 0A3024 800A2424 3C01800F */ lui $at, %hi(D_800F1C38) # $at, 0x800f -/* 0A3028 800A2428 C4361C38 */ lwc1 $f22, %lo(D_800F1C38)($at) -/* 0A302C 800A242C 00145080 */ sll $t2, $s4, 2 -/* 0A3030 800A2430 3C06800E */ lui $a2, %hi(D_800E7920) -/* 0A3034 800A2434 00CA3021 */ addu $a2, $a2, $t2 -/* 0A3038 800A2438 8CC67920 */ lw $a2, %lo(D_800E7920)($a2) -/* 0A303C 800A243C 240400A0 */ li $a0, 160 -/* 0A3040 800A2440 24050055 */ li $a1, 85 -/* 0A3044 800A2444 00003825 */ move $a3, $zero -/* 0A3048 800A2448 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A304C 800A244C 0C024DBB */ jal draw_text -/* 0A3050 800A2450 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A3054 800A2454 00146900 */ sll $t5, $s4, 4 -/* 0A3058 800A2458 01B46821 */ addu $t5, $t5, $s4 -/* 0A305C 800A245C 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0A3060 800A2460 4481C000 */ mtc1 $at, $f24 -/* 0A3064 800A2464 000D68C0 */ sll $t5, $t5, 3 -/* 0A3068 800A2468 01B46821 */ addu $t5, $t5, $s4 -/* 0A306C 800A246C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0A3070 800A2470 3C0C800E */ lui $t4, %hi(D_800E7918) # $t4, 0x800e -/* 0A3074 800A2474 258C7918 */ addiu $t4, %lo(D_800E7918) # addiu $t4, $t4, 0x7918 -/* 0A3078 800A2478 25AE002A */ addiu $t6, $t5, 0x2a -/* 0A307C 800A247C 240B005C */ li $t3, 92 -/* 0A3080 800A2480 3C17800E */ lui $s7, %hi(gGlobalTimer) # $s7, 0x800e -/* 0A3084 800A2484 4481A000 */ mtc1 $at, $f20 -/* 0A3088 800A2488 26F7C54C */ addiu $s7, %lo(gGlobalTimer) # addiu $s7, $s7, -0x3ab4 -/* 0A308C 800A248C AFAB0088 */ sw $t3, 0x88($sp) -/* 0A3090 800A2490 AFAE0078 */ sw $t6, 0x78($sp) -/* 0A3094 800A2494 AFAC0084 */ sw $t4, 0x84($sp) -/* 0A3098 800A2498 24160020 */ li $s6, 32 -/* 0A309C 800A249C 2413002A */ li $s3, 42 -/* 0A30A0 800A24A0 241E0003 */ li $fp, 3 -.L800A24A4: -/* 0A30A4 800A24A4 0C024C36 */ jal set_text_color -/* 0A30A8 800A24A8 03C02025 */ move $a0, $fp -/* 0A30AC 800A24AC 8FAF0084 */ lw $t7, 0x84($sp) -/* 0A30B0 800A24B0 8FA40088 */ lw $a0, 0x88($sp) -/* 0A30B4 800A24B4 2405007D */ li $a1, 125 -/* 0A30B8 800A24B8 8DE60000 */ lw $a2, ($t7) -/* 0A30BC 800A24BC E7B80014 */ swc1 $f24, 0x14($sp) -/* 0A30C0 800A24C0 E7B80010 */ swc1 $f24, 0x10($sp) -/* 0A30C4 800A24C4 0C024DBB */ jal draw_text -/* 0A30C8 800A24C8 00003825 */ move $a3, $zero -/* 0A30CC 800A24CC 00008025 */ move $s0, $zero -/* 0A30D0 800A24D0 24120096 */ li $s2, 150 -.L800A24D4: -/* 0A30D4 800A24D4 8FB80078 */ lw $t8, 0x78($sp) -/* 0A30D8 800A24D8 1278000F */ beq $s3, $t8, .L800A2518 -/* 0A30DC 800A24DC 00000000 */ nop -/* 0A30E0 800A24E0 3C198019 */ lui $t9, %hi(D_8018EDEC) # $t9, 0x8019 -/* 0A30E4 800A24E4 8339EDEC */ lb $t9, %lo(D_8018EDEC)($t9) -/* 0A30E8 800A24E8 02002825 */ move $a1, $s0 -/* 0A30EC 800A24EC 24060001 */ li $a2, 1 -/* 0A30F0 800A24F0 0C024870 */ jal text_rainbow_effect -/* 0A30F4 800A24F4 03352023 */ subu $a0, $t9, $s5 -/* 0A30F8 800A24F8 3C088019 */ lui $t0, %hi(D_8018EDEC) # $t0, 0x8019 -/* 0A30FC 800A24FC 8108EDEC */ lb $t0, %lo(D_8018EDEC)($t0) -/* 0A3100 800A2500 01154823 */ subu $t1, $t0, $s5 -/* 0A3104 800A2504 5609001C */ bnel $s0, $t1, .L800A2578 -/* 0A3108 800A2508 26110001 */ addiu $s1, $s0, 1 -/* 0A310C 800A250C A7B600E0 */ sh $s6, 0xe0($sp) -/* 0A3110 800A2510 10000018 */ b .L800A2574 -/* 0A3114 800A2514 A7B200E2 */ sh $s2, 0xe2($sp) -.L800A2518: -/* 0A3118 800A2518 12800014 */ beqz $s4, .L800A256C -/* 0A311C 800A251C 8FAA00E8 */ lw $t2, 0xe8($sp) -/* 0A3120 800A2520 8D4B0020 */ lw $t3, 0x20($t2) -/* 0A3124 800A2524 160B0011 */ bne $s0, $t3, .L800A256C -/* 0A3128 800A2528 00000000 */ nop -/* 0A312C 800A252C 8EEC0000 */ lw $t4, ($s7) -/* 0A3130 800A2530 019E001A */ div $zero, $t4, $fp -/* 0A3134 800A2534 00002010 */ mfhi $a0 -/* 0A3138 800A2538 17C00002 */ bnez $fp, .L800A2544 -/* 0A313C 800A253C 00000000 */ nop -/* 0A3140 800A2540 0007000D */ break 7 -.L800A2544: -/* 0A3144 800A2544 2401FFFF */ li $at, -1 -/* 0A3148 800A2548 17C10004 */ bne $fp, $at, .L800A255C -/* 0A314C 800A254C 3C018000 */ lui $at, 0x8000 -/* 0A3150 800A2550 15810002 */ bne $t4, $at, .L800A255C -/* 0A3154 800A2554 00000000 */ nop -/* 0A3158 800A2558 0006000D */ break 6 -.L800A255C: -/* 0A315C 800A255C 0C024C36 */ jal set_text_color -/* 0A3160 800A2560 00000000 */ nop -/* 0A3164 800A2564 10000004 */ b .L800A2578 -/* 0A3168 800A2568 26110001 */ addiu $s1, $s0, 1 -.L800A256C: -/* 0A316C 800A256C 0C024C36 */ jal set_text_color -/* 0A3170 800A2570 24040001 */ li $a0, 1 -.L800A2574: -/* 0A3174 800A2574 26110001 */ addiu $s1, $s0, 1 -.L800A2578: -/* 0A3178 800A2578 02202025 */ move $a0, $s1 -/* 0A317C 800A257C 0C029E25 */ jal convert_number_to_ascii -/* 0A3180 800A2580 27A500B8 */ addiu $a1, $sp, 0xb8 -/* 0A3184 800A2584 02C02025 */ move $a0, $s6 -/* 0A3188 800A2588 02402825 */ move $a1, $s2 -/* 0A318C 800A258C 27A600B9 */ addiu $a2, $sp, 0xb9 -/* 0A3190 800A2590 00003825 */ move $a3, $zero -/* 0A3194 800A2594 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A3198 800A2598 0C024CC9 */ jal func_80093324 -/* 0A319C 800A259C E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A31A0 800A25A0 2401002A */ li $at, 42 -/* 0A31A4 800A25A4 16610006 */ bne $s3, $at, .L800A25C0 -/* 0A31A8 800A25A8 3C0F8019 */ lui $t7, %hi(D_8018D9C0) # $t7, 0x8019 -/* 0A31AC 800A25AC 3C0E8019 */ lui $t6, %hi(D_8018EE10) # $t6, 0x8019 -/* 0A31B0 800A25B0 25CEEE10 */ addiu $t6, %lo(D_8018EE10) # addiu $t6, $t6, -0x11f0 -/* 0A31B4 800A25B4 001069C0 */ sll $t5, $s0, 7 -/* 0A31B8 800A25B8 10000004 */ b .L800A25CC -/* 0A31BC 800A25BC 01AE1821 */ addu $v1, $t5, $t6 -.L800A25C0: -/* 0A31C0 800A25C0 8DEFD9C0 */ lw $t7, %lo(D_8018D9C0)($t7) -/* 0A31C4 800A25C4 0010C1C0 */ sll $t8, $s0, 7 -/* 0A31C8 800A25C8 01F81821 */ addu $v1, $t7, $t8 -.L800A25CC: -/* 0A31CC 800A25CC 90790004 */ lbu $t9, 4($v1) -/* 0A31D0 800A25D0 02602025 */ move $a0, $s3 -/* 0A31D4 800A25D4 02402825 */ move $a1, $s2 -/* 0A31D8 800A25D8 1720000B */ bnez $t9, .L800A2608 -/* 0A31DC 800A25DC 3C0D800F */ lui $t5, %hi(gCupCourseOrder) -/* 0A31E0 800A25E0 3C06800E */ lui $a2, %hi(D_800E7A44) # $a2, 0x800e -/* 0A31E4 800A25E4 8CC67A44 */ lw $a2, %lo(D_800E7A44)($a2) -/* 0A31E8 800A25E8 02602025 */ move $a0, $s3 -/* 0A31EC 800A25EC 02402825 */ move $a1, $s2 -/* 0A31F0 800A25F0 00003825 */ move $a3, $zero -/* 0A31F4 800A25F4 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A31F8 800A25F8 0C024CC9 */ jal func_80093324 -/* 0A31FC 800A25FC E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A3200 800A2600 10000019 */ b .L800A2668 -/* 0A3204 800A2604 24010002 */ li $at, 2 -.L800A2608: -/* 0A3208 800A2608 80620005 */ lb $v0, 5($v1) -/* 0A320C 800A260C 3C06800E */ lui $a2, %hi(gCourseNamesDup2) -/* 0A3210 800A2610 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A3214 800A2614 04410003 */ bgez $v0, .L800A2624 -/* 0A3218 800A2618 00024083 */ sra $t0, $v0, 2 -/* 0A321C 800A261C 24410003 */ addiu $at, $v0, 3 -/* 0A3220 800A2620 00014083 */ sra $t0, $at, 2 -.L800A2624: -/* 0A3224 800A2624 000848C0 */ sll $t1, $t0, 3 -/* 0A3228 800A2628 04410004 */ bgez $v0, .L800A263C -/* 0A322C 800A262C 304A0003 */ andi $t2, $v0, 3 -/* 0A3230 800A2630 11400002 */ beqz $t2, .L800A263C -/* 0A3234 800A2634 00000000 */ nop -/* 0A3238 800A2638 254AFFFC */ addiu $t2, $t2, -4 -.L800A263C: -/* 0A323C 800A263C 000A5840 */ sll $t3, $t2, 1 -/* 0A3240 800A2640 012B6021 */ addu $t4, $t1, $t3 -/* 0A3244 800A2644 01AC6821 */ addu $t5, $t5, $t4 -/* 0A3248 800A2648 85AD2BB4 */ lh $t5, %lo(gCupCourseOrder)($t5) -/* 0A324C 800A264C E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A3250 800A2650 00003825 */ move $a3, $zero -/* 0A3254 800A2654 000D7080 */ sll $t6, $t5, 2 -/* 0A3258 800A2658 00CE3021 */ addu $a2, $a2, $t6 -/* 0A325C 800A265C 0C024CC9 */ jal func_80093324 -/* 0A3260 800A2660 8CC675C4 */ lw $a2, %lo(gCourseNamesDup2)($a2) -/* 0A3264 800A2664 24010002 */ li $at, 2 -.L800A2668: -/* 0A3268 800A2668 02208025 */ move $s0, $s1 -/* 0A326C 800A266C 1621FF99 */ bne $s1, $at, .L800A24D4 -/* 0A3270 800A2670 2652001E */ addiu $s2, $s2, 0x1e -/* 0A3274 800A2674 8FAF0088 */ lw $t7, 0x88($sp) -/* 0A3278 800A2678 8FB90084 */ lw $t9, 0x84($sp) -/* 0A327C 800A267C 26730089 */ addiu $s3, $s3, 0x89 -/* 0A3280 800A2680 2401013C */ li $at, 316 -/* 0A3284 800A2684 25F80082 */ addiu $t8, $t7, 0x82 -/* 0A3288 800A2688 27280004 */ addiu $t0, $t9, 4 -/* 0A328C 800A268C AFA80084 */ sw $t0, 0x84($sp) -/* 0A3290 800A2690 AFB80088 */ sw $t8, 0x88($sp) -/* 0A3294 800A2694 1661FF83 */ bne $s3, $at, .L800A24A4 -/* 0A3298 800A2698 26D60089 */ addiu $s6, $s6, 0x89 -/* 0A329C 800A269C 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A32A0 800A26A0 10000176 */ b .L800A2C7C -/* 0A32A4 800A26A4 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A26A8 -/* 0A32A8 800A26A8 0C024C36 */ jal set_text_color -/* 0A32AC 800A26AC 24040002 */ li $a0, 2 -/* 0A32B0 800A26B0 3C10800E */ lui $s0, %hi(D_800E7928) # $s0, 0x800e -/* 0A32B4 800A26B4 3C01800F */ lui $at, %hi(D_800F1C3C) # $at, 0x800f -/* 0A32B8 800A26B8 3C12800E */ lui $s2, %hi(D_800E7930) # $s2, 0x800e -/* 0A32BC 800A26BC 26527930 */ addiu $s2, %lo(D_800E7930) # addiu $s2, $s2, 0x7930 -/* 0A32C0 800A26C0 C4341C3C */ lwc1 $f20, %lo(D_800F1C3C)($at) -/* 0A32C4 800A26C4 26107928 */ addiu $s0, %lo(D_800E7928) # addiu $s0, $s0, 0x7928 -/* 0A32C8 800A26C8 2411004D */ li $s1, 77 -.L800A26CC: -/* 0A32CC 800A26CC 240400A0 */ li $a0, 160 -/* 0A32D0 800A26D0 02202825 */ move $a1, $s1 -/* 0A32D4 800A26D4 8E060000 */ lw $a2, ($s0) -/* 0A32D8 800A26D8 00003825 */ move $a3, $zero -/* 0A32DC 800A26DC E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A32E0 800A26E0 0C024DBB */ jal draw_text -/* 0A32E4 800A26E4 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A32E8 800A26E8 26100004 */ addiu $s0, $s0, 4 -/* 0A32EC 800A26EC 0212082B */ sltu $at, $s0, $s2 -/* 0A32F0 800A26F0 1420FFF6 */ bnez $at, .L800A26CC -/* 0A32F4 800A26F4 26310014 */ addiu $s1, $s1, 0x14 -/* 0A32F8 800A26F8 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0A32FC 800A26FC 4481C000 */ mtc1 $at, $f24 -/* 0A3300 800A2700 3C01800F */ lui $at, %hi(D_800F1C40) # $at, 0x800f -/* 0A3304 800A2704 C4361C40 */ lwc1 $f22, %lo(D_800F1C40)($at) -/* 0A3308 800A2708 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0A330C 800A270C 3C09800E */ lui $t1, %hi(D_800E7918) # $t1, 0x800e -/* 0A3310 800A2710 25297918 */ addiu $t1, %lo(D_800E7918) # addiu $t1, $t1, 0x7918 -/* 0A3314 800A2714 240A005C */ li $t2, 92 -/* 0A3318 800A2718 3C17800E */ lui $s7, %hi(gGlobalTimer) # $s7, 0x800e -/* 0A331C 800A271C 4481A000 */ mtc1 $at, $f20 -/* 0A3320 800A2720 26F7C54C */ addiu $s7, %lo(gGlobalTimer) # addiu $s7, $s7, -0x3ab4 -/* 0A3324 800A2724 AFAA0088 */ sw $t2, 0x88($sp) -/* 0A3328 800A2728 AFA90084 */ sw $t1, 0x84($sp) -/* 0A332C 800A272C 24160020 */ li $s6, 32 -/* 0A3330 800A2730 2413002A */ li $s3, 42 -/* 0A3334 800A2734 241E0003 */ li $fp, 3 -/* 0A3338 800A2738 27B500A8 */ addiu $s5, $sp, 0xa8 -/* 0A333C 800A273C 2414002A */ li $s4, 42 -.L800A2740: -/* 0A3340 800A2740 0C024C36 */ jal set_text_color -/* 0A3344 800A2744 03C02025 */ move $a0, $fp -/* 0A3348 800A2748 8FAB0084 */ lw $t3, 0x84($sp) -/* 0A334C 800A274C 8FA40088 */ lw $a0, 0x88($sp) -/* 0A3350 800A2750 2405007D */ li $a1, 125 -/* 0A3354 800A2754 8D660000 */ lw $a2, ($t3) -/* 0A3358 800A2758 E7B80014 */ swc1 $f24, 0x14($sp) -/* 0A335C 800A275C E7B80010 */ swc1 $f24, 0x10($sp) -/* 0A3360 800A2760 0C024DBB */ jal draw_text -/* 0A3364 800A2764 00003825 */ move $a3, $zero -/* 0A3368 800A2768 00008025 */ move $s0, $zero -/* 0A336C 800A276C 24120096 */ li $s2, 150 -.L800A2770: -/* 0A3370 800A2770 5674001A */ bnel $s3, $s4, .L800A27DC -/* 0A3374 800A2774 8FAF00E8 */ lw $t7, 0xe8($sp) -/* 0A3378 800A2778 8FAC00E8 */ lw $t4, 0xe8($sp) -/* 0A337C 800A277C 8D8D001C */ lw $t5, 0x1c($t4) -/* 0A3380 800A2780 160D0011 */ bne $s0, $t5, .L800A27C8 -/* 0A3384 800A2784 00000000 */ nop -/* 0A3388 800A2788 8EEE0000 */ lw $t6, ($s7) -/* 0A338C 800A278C 01DE001A */ div $zero, $t6, $fp -/* 0A3390 800A2790 00002010 */ mfhi $a0 -/* 0A3394 800A2794 17C00002 */ bnez $fp, .L800A27A0 -/* 0A3398 800A2798 00000000 */ nop -/* 0A339C 800A279C 0007000D */ break 7 -.L800A27A0: -/* 0A33A0 800A27A0 2401FFFF */ li $at, -1 -/* 0A33A4 800A27A4 17C10004 */ bne $fp, $at, .L800A27B8 -/* 0A33A8 800A27A8 3C018000 */ lui $at, 0x8000 -/* 0A33AC 800A27AC 15C10002 */ bne $t6, $at, .L800A27B8 -/* 0A33B0 800A27B0 00000000 */ nop -/* 0A33B4 800A27B4 0006000D */ break 6 -.L800A27B8: -/* 0A33B8 800A27B8 0C024C36 */ jal set_text_color -/* 0A33BC 800A27BC 00000000 */ nop -/* 0A33C0 800A27C0 1000001C */ b .L800A2834 -/* 0A33C4 800A27C4 26110001 */ addiu $s1, $s0, 1 -.L800A27C8: -/* 0A33C8 800A27C8 0C024C36 */ jal set_text_color -/* 0A33CC 800A27CC 24040001 */ li $a0, 1 -/* 0A33D0 800A27D0 10000018 */ b .L800A2834 -/* 0A33D4 800A27D4 26110001 */ addiu $s1, $s0, 1 -/* 0A33D8 800A27D8 8FAF00E8 */ lw $t7, 0xe8($sp) -.L800A27DC: -/* 0A33DC 800A27DC 8DF80020 */ lw $t8, 0x20($t7) -/* 0A33E0 800A27E0 16180011 */ bne $s0, $t8, .L800A2828 -/* 0A33E4 800A27E4 00000000 */ nop -/* 0A33E8 800A27E8 8EF90000 */ lw $t9, ($s7) -/* 0A33EC 800A27EC 033E001A */ div $zero, $t9, $fp -/* 0A33F0 800A27F0 00002010 */ mfhi $a0 -/* 0A33F4 800A27F4 17C00002 */ bnez $fp, .L800A2800 -/* 0A33F8 800A27F8 00000000 */ nop -/* 0A33FC 800A27FC 0007000D */ break 7 -.L800A2800: -/* 0A3400 800A2800 2401FFFF */ li $at, -1 -/* 0A3404 800A2804 17C10004 */ bne $fp, $at, .L800A2818 -/* 0A3408 800A2808 3C018000 */ lui $at, 0x8000 -/* 0A340C 800A280C 17210002 */ bne $t9, $at, .L800A2818 -/* 0A3410 800A2810 00000000 */ nop -/* 0A3414 800A2814 0006000D */ break 6 -.L800A2818: -/* 0A3418 800A2818 0C024C36 */ jal set_text_color -/* 0A341C 800A281C 00000000 */ nop -/* 0A3420 800A2820 10000004 */ b .L800A2834 -/* 0A3424 800A2824 26110001 */ addiu $s1, $s0, 1 -.L800A2828: -/* 0A3428 800A2828 0C024C36 */ jal set_text_color -/* 0A342C 800A282C 24040001 */ li $a0, 1 -/* 0A3430 800A2830 26110001 */ addiu $s1, $s0, 1 -.L800A2834: -/* 0A3434 800A2834 02202025 */ move $a0, $s1 -/* 0A3438 800A2838 0C029E25 */ jal convert_number_to_ascii -/* 0A343C 800A283C 02A02825 */ move $a1, $s5 -/* 0A3440 800A2840 02C02025 */ move $a0, $s6 -/* 0A3444 800A2844 02402825 */ move $a1, $s2 -/* 0A3448 800A2848 27A600A9 */ addiu $a2, $sp, 0xa9 -/* 0A344C 800A284C 00003825 */ move $a3, $zero -/* 0A3450 800A2850 E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A3454 800A2854 0C024CC9 */ jal func_80093324 -/* 0A3458 800A2858 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A345C 800A285C 2401002A */ li $at, 42 -/* 0A3460 800A2860 16610006 */ bne $s3, $at, .L800A287C -/* 0A3464 800A2864 3C098019 */ lui $t1, %hi(D_8018D9C0) # $t1, 0x8019 -/* 0A3468 800A2868 3C0A8019 */ lui $t2, %hi(D_8018EE10) # $t2, 0x8019 -/* 0A346C 800A286C 254AEE10 */ addiu $t2, %lo(D_8018EE10) # addiu $t2, $t2, -0x11f0 -/* 0A3470 800A2870 001041C0 */ sll $t0, $s0, 7 -/* 0A3474 800A2874 10000004 */ b .L800A2888 -/* 0A3478 800A2878 010A1821 */ addu $v1, $t0, $t2 -.L800A287C: -/* 0A347C 800A287C 8D29D9C0 */ lw $t1, %lo(D_8018D9C0)($t1) -/* 0A3480 800A2880 001059C0 */ sll $t3, $s0, 7 -/* 0A3484 800A2884 012B1821 */ addu $v1, $t1, $t3 -.L800A2888: -/* 0A3488 800A2888 906C0004 */ lbu $t4, 4($v1) -/* 0A348C 800A288C 02602025 */ move $a0, $s3 -/* 0A3490 800A2890 02402825 */ move $a1, $s2 -/* 0A3494 800A2894 1580000B */ bnez $t4, .L800A28C4 -/* 0A3498 800A2898 3C08800F */ lui $t0, %hi(gCupCourseOrder) -/* 0A349C 800A289C 3C06800E */ lui $a2, %hi(D_800E7A44) # $a2, 0x800e -/* 0A34A0 800A28A0 8CC67A44 */ lw $a2, %lo(D_800E7A44)($a2) -/* 0A34A4 800A28A4 02602025 */ move $a0, $s3 -/* 0A34A8 800A28A8 02402825 */ move $a1, $s2 -/* 0A34AC 800A28AC 00003825 */ move $a3, $zero -/* 0A34B0 800A28B0 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A34B4 800A28B4 0C024CC9 */ jal func_80093324 -/* 0A34B8 800A28B8 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A34BC 800A28BC 10000019 */ b .L800A2924 -/* 0A34C0 800A28C0 24010002 */ li $at, 2 -.L800A28C4: -/* 0A34C4 800A28C4 80620005 */ lb $v0, 5($v1) -/* 0A34C8 800A28C8 3C06800E */ lui $a2, %hi(gCourseNamesDup2) -/* 0A34CC 800A28CC E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A34D0 800A28D0 04410003 */ bgez $v0, .L800A28E0 -/* 0A34D4 800A28D4 00026883 */ sra $t5, $v0, 2 -/* 0A34D8 800A28D8 24410003 */ addiu $at, $v0, 3 -/* 0A34DC 800A28DC 00016883 */ sra $t5, $at, 2 -.L800A28E0: -/* 0A34E0 800A28E0 000D70C0 */ sll $t6, $t5, 3 -/* 0A34E4 800A28E4 04410004 */ bgez $v0, .L800A28F8 -/* 0A34E8 800A28E8 304F0003 */ andi $t7, $v0, 3 -/* 0A34EC 800A28EC 11E00002 */ beqz $t7, .L800A28F8 -/* 0A34F0 800A28F0 00000000 */ nop -/* 0A34F4 800A28F4 25EFFFFC */ addiu $t7, $t7, -4 -.L800A28F8: -/* 0A34F8 800A28F8 000FC040 */ sll $t8, $t7, 1 -/* 0A34FC 800A28FC 01D8C821 */ addu $t9, $t6, $t8 -/* 0A3500 800A2900 01194021 */ addu $t0, $t0, $t9 -/* 0A3504 800A2904 85082BB4 */ lh $t0, %lo(gCupCourseOrder)($t0) -/* 0A3508 800A2908 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A350C 800A290C 00003825 */ move $a3, $zero -/* 0A3510 800A2910 00085080 */ sll $t2, $t0, 2 -/* 0A3514 800A2914 00CA3021 */ addu $a2, $a2, $t2 -/* 0A3518 800A2918 0C024CC9 */ jal func_80093324 -/* 0A351C 800A291C 8CC675C4 */ lw $a2, %lo(gCourseNamesDup2)($a2) -/* 0A3520 800A2920 24010002 */ li $at, 2 -.L800A2924: -/* 0A3524 800A2924 02208025 */ move $s0, $s1 -/* 0A3528 800A2928 1621FF91 */ bne $s1, $at, .L800A2770 -/* 0A352C 800A292C 2652001E */ addiu $s2, $s2, 0x1e -/* 0A3530 800A2930 8FA90088 */ lw $t1, 0x88($sp) -/* 0A3534 800A2934 8FAC0084 */ lw $t4, 0x84($sp) -/* 0A3538 800A2938 26730089 */ addiu $s3, $s3, 0x89 -/* 0A353C 800A293C 2A61013C */ slti $at, $s3, 0x13c -/* 0A3540 800A2940 252B0082 */ addiu $t3, $t1, 0x82 -/* 0A3544 800A2944 258D0004 */ addiu $t5, $t4, 4 -/* 0A3548 800A2948 AFAD0084 */ sw $t5, 0x84($sp) -/* 0A354C 800A294C AFAB0088 */ sw $t3, 0x88($sp) -/* 0A3550 800A2950 1420FF7B */ bnez $at, .L800A2740 -/* 0A3554 800A2954 26D60089 */ addiu $s6, $s6, 0x89 -/* 0A3558 800A2958 3C13800E */ lui $s3, %hi(D_800E7930) # $s3, 0x800e -/* 0A355C 800A295C 26737930 */ addiu $s3, %lo(D_800E7930) # addiu $s3, $s3, 0x7930 -/* 0A3560 800A2960 00009025 */ move $s2, $zero -/* 0A3564 800A2964 2411006E */ li $s1, 110 -.L800A2968: -/* 0A3568 800A2968 3C048019 */ lui $a0, %hi(D_8018EDEC) # $a0, 0x8019 -/* 0A356C 800A296C 8084EDEC */ lb $a0, %lo(D_8018EDEC)($a0) -/* 0A3570 800A2970 240F00D2 */ li $t7, 210 -/* 0A3574 800A2974 02002825 */ move $a1, $s0 -/* 0A3578 800A2978 2484FFC8 */ addiu $a0, $a0, -0x38 -/* 0A357C 800A297C 16440003 */ bne $s2, $a0, .L800A298C -/* 0A3580 800A2980 00000000 */ nop -/* 0A3584 800A2984 A7B100E0 */ sh $s1, 0xe0($sp) -/* 0A3588 800A2988 A7AF00E2 */ sh $t7, 0xe2($sp) -.L800A298C: -/* 0A358C 800A298C 0C024870 */ jal text_rainbow_effect -/* 0A3590 800A2990 24060003 */ li $a2, 3 -/* 0A3594 800A2994 02202025 */ move $a0, $s1 -/* 0A3598 800A2998 240500D2 */ li $a1, 210 -/* 0A359C 800A299C 8E660000 */ lw $a2, ($s3) -/* 0A35A0 800A29A0 00003825 */ move $a3, $zero -/* 0A35A4 800A29A4 E7B80010 */ swc1 $f24, 0x10($sp) -/* 0A35A8 800A29A8 0C024CC9 */ jal func_80093324 -/* 0A35AC 800A29AC E7B80014 */ swc1 $f24, 0x14($sp) -/* 0A35B0 800A29B0 26520001 */ addiu $s2, $s2, 1 -/* 0A35B4 800A29B4 24010002 */ li $at, 2 -/* 0A35B8 800A29B8 26310032 */ addiu $s1, $s1, 0x32 -/* 0A35BC 800A29BC 1641FFEA */ bne $s2, $at, .L800A2968 -/* 0A35C0 800A29C0 26730004 */ addiu $s3, $s3, 4 -/* 0A35C4 800A29C4 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A35C8 800A29C8 100000AC */ b .L800A2C7C -/* 0A35CC 800A29CC 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -glabel L800A29D0 -/* 0A35D0 800A29D0 2475FFC6 */ addiu $s5, $v1, -0x3a -/* 0A35D4 800A29D4 06A10003 */ bgez $s5, .L800A29E4 -/* 0A35D8 800A29D8 00157043 */ sra $t6, $s5, 1 -/* 0A35DC 800A29DC 26A10001 */ addiu $at, $s5, 1 -/* 0A35E0 800A29E0 00017043 */ sra $t6, $at, 1 -.L800A29E4: -/* 0A35E4 800A29E4 01C0A825 */ move $s5, $t6 -/* 0A35E8 800A29E8 0C024C36 */ jal set_text_color -/* 0A35EC 800A29EC 24040002 */ li $a0, 2 -/* 0A35F0 800A29F0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A35F4 800A29F4 4481B000 */ mtc1 $at, $f22 -/* 0A35F8 800A29F8 3C19800E */ lui $t9, %hi(D_800E7938) # $t9, 0x800e -/* 0A35FC 800A29FC 27397938 */ addiu $t9, %lo(D_800E7938) # addiu $t9, $t9, 0x7938 -/* 0A3600 800A2A00 0015C080 */ sll $t8, $s5, 2 -/* 0A3604 800A2A04 03191021 */ addu $v0, $t8, $t9 -/* 0A3608 800A2A08 8C460000 */ lw $a2, ($v0) -/* 0A360C 800A2A0C AFA20078 */ sw $v0, 0x78($sp) -/* 0A3610 800A2A10 240400A0 */ li $a0, 160 -/* 0A3614 800A2A14 24050055 */ li $a1, 85 -/* 0A3618 800A2A18 00003825 */ move $a3, $zero -/* 0A361C 800A2A1C E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A3620 800A2A20 0C024DBB */ jal draw_text -/* 0A3624 800A2A24 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A3628 800A2A28 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0A362C 800A2A2C 4481C000 */ mtc1 $at, $f24 -/* 0A3630 800A2A30 3C01800F */ lui $at, %hi(D_800F1C44) # $at, 0x800f -/* 0A3634 800A2A34 C4361C44 */ lwc1 $f22, %lo(D_800F1C44)($at) -/* 0A3638 800A2A38 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0A363C 800A2A3C 3C0A800E */ lui $t2, %hi(D_800E7918) # $t2, 0x800e -/* 0A3640 800A2A40 254A7918 */ addiu $t2, %lo(D_800E7918) # addiu $t2, $t2, 0x7918 -/* 0A3644 800A2A44 2408005C */ li $t0, 92 -/* 0A3648 800A2A48 3C17800E */ lui $s7, %hi(gGlobalTimer) # $s7, 0x800e -/* 0A364C 800A2A4C 3C15800E */ lui $s5, %hi(D_800E7938) # $s5, 0x800e -/* 0A3650 800A2A50 4481A000 */ mtc1 $at, $f20 -/* 0A3654 800A2A54 26B57938 */ addiu $s5, %lo(D_800E7938) # addiu $s5, $s5, 0x7938 -/* 0A3658 800A2A58 26F7C54C */ addiu $s7, %lo(gGlobalTimer) # addiu $s7, $s7, -0x3ab4 -/* 0A365C 800A2A5C AFA80088 */ sw $t0, 0x88($sp) -/* 0A3660 800A2A60 AFAA0084 */ sw $t2, 0x84($sp) -/* 0A3664 800A2A64 24160020 */ li $s6, 32 -/* 0A3668 800A2A68 2413002A */ li $s3, 42 -/* 0A366C 800A2A6C 241E0003 */ li $fp, 3 -/* 0A3670 800A2A70 2414002A */ li $s4, 42 -.L800A2A74: -/* 0A3674 800A2A74 0C024C36 */ jal set_text_color -/* 0A3678 800A2A78 03C02025 */ move $a0, $fp -/* 0A367C 800A2A7C 8FA90084 */ lw $t1, 0x84($sp) -/* 0A3680 800A2A80 8FA40088 */ lw $a0, 0x88($sp) -/* 0A3684 800A2A84 2405007D */ li $a1, 125 -/* 0A3688 800A2A88 8D260000 */ lw $a2, ($t1) -/* 0A368C 800A2A8C E7B80014 */ swc1 $f24, 0x14($sp) -/* 0A3690 800A2A90 E7B80010 */ swc1 $f24, 0x10($sp) -/* 0A3694 800A2A94 0C024DBB */ jal draw_text -/* 0A3698 800A2A98 00003825 */ move $a3, $zero -/* 0A369C 800A2A9C 00008025 */ move $s0, $zero -/* 0A36A0 800A2AA0 24120096 */ li $s2, 150 -.L800A2AA4: -/* 0A36A4 800A2AA4 1674001F */ bne $s3, $s4, .L800A2B24 -/* 0A36A8 800A2AA8 8FAB00E8 */ lw $t3, 0xe8($sp) -/* 0A36AC 800A2AAC 8D6C001C */ lw $t4, 0x1c($t3) -/* 0A36B0 800A2AB0 8FAD0078 */ lw $t5, 0x78($sp) -/* 0A36B4 800A2AB4 160C0017 */ bne $s0, $t4, .L800A2B14 -/* 0A36B8 800A2AB8 00000000 */ nop -/* 0A36BC 800A2ABC 55B50006 */ bnel $t5, $s5, .L800A2AD8 -/* 0A36C0 800A2AC0 8EEF0000 */ lw $t7, ($s7) -/* 0A36C4 800A2AC4 0C024C36 */ jal set_text_color -/* 0A36C8 800A2AC8 24040002 */ li $a0, 2 -/* 0A36CC 800A2ACC 10000020 */ b .L800A2B50 -/* 0A36D0 800A2AD0 26110001 */ addiu $s1, $s0, 1 -/* 0A36D4 800A2AD4 8EEF0000 */ lw $t7, ($s7) -.L800A2AD8: -/* 0A36D8 800A2AD8 01FE001A */ div $zero, $t7, $fp -/* 0A36DC 800A2ADC 00002010 */ mfhi $a0 -/* 0A36E0 800A2AE0 17C00002 */ bnez $fp, .L800A2AEC -/* 0A36E4 800A2AE4 00000000 */ nop -/* 0A36E8 800A2AE8 0007000D */ break 7 -.L800A2AEC: -/* 0A36EC 800A2AEC 2401FFFF */ li $at, -1 -/* 0A36F0 800A2AF0 17C10004 */ bne $fp, $at, .L800A2B04 -/* 0A36F4 800A2AF4 3C018000 */ lui $at, 0x8000 -/* 0A36F8 800A2AF8 15E10002 */ bne $t7, $at, .L800A2B04 -/* 0A36FC 800A2AFC 00000000 */ nop -/* 0A3700 800A2B00 0006000D */ break 6 -.L800A2B04: -/* 0A3704 800A2B04 0C024C36 */ jal set_text_color -/* 0A3708 800A2B08 00000000 */ nop -/* 0A370C 800A2B0C 10000010 */ b .L800A2B50 -/* 0A3710 800A2B10 26110001 */ addiu $s1, $s0, 1 -.L800A2B14: -/* 0A3714 800A2B14 0C024C36 */ jal set_text_color -/* 0A3718 800A2B18 24040001 */ li $a0, 1 -/* 0A371C 800A2B1C 1000000C */ b .L800A2B50 -/* 0A3720 800A2B20 26110001 */ addiu $s1, $s0, 1 -.L800A2B24: -/* 0A3724 800A2B24 8FAE00E8 */ lw $t6, 0xe8($sp) -/* 0A3728 800A2B28 8DD80020 */ lw $t8, 0x20($t6) -/* 0A372C 800A2B2C 16180005 */ bne $s0, $t8, .L800A2B44 -/* 0A3730 800A2B30 00000000 */ nop -/* 0A3734 800A2B34 0C024C36 */ jal set_text_color -/* 0A3738 800A2B38 24040002 */ li $a0, 2 -/* 0A373C 800A2B3C 10000004 */ b .L800A2B50 -/* 0A3740 800A2B40 26110001 */ addiu $s1, $s0, 1 -.L800A2B44: -/* 0A3744 800A2B44 0C024C36 */ jal set_text_color -/* 0A3748 800A2B48 24040001 */ li $a0, 1 -/* 0A374C 800A2B4C 26110001 */ addiu $s1, $s0, 1 -.L800A2B50: -/* 0A3750 800A2B50 02202025 */ move $a0, $s1 -/* 0A3754 800A2B54 0C029E25 */ jal convert_number_to_ascii -/* 0A3758 800A2B58 27A50098 */ addiu $a1, $sp, 0x98 -/* 0A375C 800A2B5C 02C02025 */ move $a0, $s6 -/* 0A3760 800A2B60 02402825 */ move $a1, $s2 -/* 0A3764 800A2B64 27A60099 */ addiu $a2, $sp, 0x99 -/* 0A3768 800A2B68 00003825 */ move $a3, $zero -/* 0A376C 800A2B6C E7B60010 */ swc1 $f22, 0x10($sp) -/* 0A3770 800A2B70 0C024CC9 */ jal func_80093324 -/* 0A3774 800A2B74 E7B60014 */ swc1 $f22, 0x14($sp) -/* 0A3778 800A2B78 2401002A */ li $at, 42 -/* 0A377C 800A2B7C 16610006 */ bne $s3, $at, .L800A2B98 -/* 0A3780 800A2B80 3C0A8019 */ lui $t2, %hi(D_8018D9C0) # $t2, 0x8019 -/* 0A3784 800A2B84 3C088019 */ lui $t0, %hi(D_8018EE10) # $t0, 0x8019 -/* 0A3788 800A2B88 2508EE10 */ addiu $t0, %lo(D_8018EE10) # addiu $t0, $t0, -0x11f0 -/* 0A378C 800A2B8C 0010C9C0 */ sll $t9, $s0, 7 -/* 0A3790 800A2B90 10000004 */ b .L800A2BA4 -/* 0A3794 800A2B94 03281821 */ addu $v1, $t9, $t0 -.L800A2B98: -/* 0A3798 800A2B98 8D4AD9C0 */ lw $t2, %lo(D_8018D9C0)($t2) -/* 0A379C 800A2B9C 001049C0 */ sll $t1, $s0, 7 -/* 0A37A0 800A2BA0 01491821 */ addu $v1, $t2, $t1 -.L800A2BA4: -/* 0A37A4 800A2BA4 906B0004 */ lbu $t3, 4($v1) -/* 0A37A8 800A2BA8 02602025 */ move $a0, $s3 -/* 0A37AC 800A2BAC 02402825 */ move $a1, $s2 -/* 0A37B0 800A2BB0 1560000B */ bnez $t3, .L800A2BE0 -/* 0A37B4 800A2BB4 3C19800F */ lui $t9, %hi(gCupCourseOrder) -/* 0A37B8 800A2BB8 3C06800E */ lui $a2, %hi(D_800E7A44) # $a2, 0x800e -/* 0A37BC 800A2BBC 8CC67A44 */ lw $a2, %lo(D_800E7A44)($a2) -/* 0A37C0 800A2BC0 02602025 */ move $a0, $s3 -/* 0A37C4 800A2BC4 02402825 */ move $a1, $s2 -/* 0A37C8 800A2BC8 00003825 */ move $a3, $zero -/* 0A37CC 800A2BCC E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A37D0 800A2BD0 0C024CC9 */ jal func_80093324 -/* 0A37D4 800A2BD4 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A37D8 800A2BD8 10000019 */ b .L800A2C40 -/* 0A37DC 800A2BDC 24010002 */ li $at, 2 -.L800A2BE0: -/* 0A37E0 800A2BE0 80620005 */ lb $v0, 5($v1) -/* 0A37E4 800A2BE4 3C06800E */ lui $a2, %hi(gCourseNamesDup2) -/* 0A37E8 800A2BE8 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A37EC 800A2BEC 04410003 */ bgez $v0, .L800A2BFC -/* 0A37F0 800A2BF0 00026083 */ sra $t4, $v0, 2 -/* 0A37F4 800A2BF4 24410003 */ addiu $at, $v0, 3 -/* 0A37F8 800A2BF8 00016083 */ sra $t4, $at, 2 -.L800A2BFC: -/* 0A37FC 800A2BFC 000C68C0 */ sll $t5, $t4, 3 -/* 0A3800 800A2C00 04410004 */ bgez $v0, .L800A2C14 -/* 0A3804 800A2C04 304F0003 */ andi $t7, $v0, 3 -/* 0A3808 800A2C08 11E00002 */ beqz $t7, .L800A2C14 -/* 0A380C 800A2C0C 00000000 */ nop -/* 0A3810 800A2C10 25EFFFFC */ addiu $t7, $t7, -4 -.L800A2C14: -/* 0A3814 800A2C14 000F7040 */ sll $t6, $t7, 1 -/* 0A3818 800A2C18 01AEC021 */ addu $t8, $t5, $t6 -/* 0A381C 800A2C1C 0338C821 */ addu $t9, $t9, $t8 -/* 0A3820 800A2C20 87392BB4 */ lh $t9, %lo(gCupCourseOrder)($t9) -/* 0A3824 800A2C24 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A3828 800A2C28 00003825 */ move $a3, $zero -/* 0A382C 800A2C2C 00194080 */ sll $t0, $t9, 2 -/* 0A3830 800A2C30 00C83021 */ addu $a2, $a2, $t0 -/* 0A3834 800A2C34 0C024CC9 */ jal func_80093324 -/* 0A3838 800A2C38 8CC675C4 */ lw $a2, %lo(gCourseNamesDup2)($a2) -/* 0A383C 800A2C3C 24010002 */ li $at, 2 -.L800A2C40: -/* 0A3840 800A2C40 02208025 */ move $s0, $s1 -/* 0A3844 800A2C44 1621FF97 */ bne $s1, $at, .L800A2AA4 -/* 0A3848 800A2C48 2652001E */ addiu $s2, $s2, 0x1e -/* 0A384C 800A2C4C 8FAA0088 */ lw $t2, 0x88($sp) -/* 0A3850 800A2C50 8FAB0084 */ lw $t3, 0x84($sp) -/* 0A3854 800A2C54 26730089 */ addiu $s3, $s3, 0x89 -/* 0A3858 800A2C58 2401013C */ li $at, 316 -/* 0A385C 800A2C5C 25490082 */ addiu $t1, $t2, 0x82 -/* 0A3860 800A2C60 256C0004 */ addiu $t4, $t3, 4 -/* 0A3864 800A2C64 AFAC0084 */ sw $t4, 0x84($sp) -/* 0A3868 800A2C68 AFA90088 */ sw $t1, 0x88($sp) -/* 0A386C 800A2C6C 1661FF81 */ bne $s3, $at, .L800A2A74 -/* 0A3870 800A2C70 26D60089 */ addiu $s6, $s6, 0x89 -/* 0A3874 800A2C74 3C038019 */ lui $v1, %hi(D_8018EDEC) # $v1, 0x8019 -/* 0A3878 800A2C78 8063EDEC */ lb $v1, %lo(D_8018EDEC)($v1) -.L800A2C7C: -glabel L800A2C7C -/* 0A387C 800A2C7C 246FFFD8 */ addiu $t7, $v1, -0x28 -.L800A2C80: -/* 0A3880 800A2C80 2DE10012 */ sltiu $at, $t7, 0x12 -/* 0A3884 800A2C84 1020000D */ beqz $at, .L800A2CBC -/* 0A3888 800A2C88 000F7880 */ sll $t7, $t7, 2 -/* 0A388C 800A2C8C 3C01800F */ lui $at, %hi(jpt_800F1C48) -/* 0A3890 800A2C90 002F0821 */ addu $at, $at, $t7 -/* 0A3894 800A2C94 8C2F1C48 */ lw $t7, %lo(jpt_800F1C48)($at) -/* 0A3898 800A2C98 01E00008 */ jr $t7 -/* 0A389C 800A2C9C 00000000 */ nop -glabel L800A2CA0 -/* 0A38A0 800A2CA0 87AD00E0 */ lh $t5, 0xe0($sp) -/* 0A38A4 800A2CA4 87B800E2 */ lh $t8, 0xe2($sp) -/* 0A38A8 800A2CA8 25AEFFFB */ addiu $t6, $t5, -5 -/* 0A38AC 800A2CAC 2719FFFA */ addiu $t9, $t8, -6 -/* 0A38B0 800A2CB0 A7AE00E0 */ sh $t6, 0xe0($sp) -/* 0A38B4 800A2CB4 10000007 */ b .L800A2CD4 -/* 0A38B8 800A2CB8 A7B900E2 */ sh $t9, 0xe2($sp) -.L800A2CBC: -glabel L800A2CBC -/* 0A38BC 800A2CBC 87A800E0 */ lh $t0, 0xe0($sp) -/* 0A38C0 800A2CC0 87A900E2 */ lh $t1, 0xe2($sp) -/* 0A38C4 800A2CC4 250AFFF6 */ addiu $t2, $t0, -0xa -/* 0A38C8 800A2CC8 252BFFF8 */ addiu $t3, $t1, -8 -/* 0A38CC 800A2CCC A7AA00E0 */ sh $t2, 0xe0($sp) -/* 0A38D0 800A2CD0 A7AB00E2 */ sh $t3, 0xe2($sp) -.L800A2CD4: -/* 0A38D4 800A2CD4 8FA400E8 */ lw $a0, 0xe8($sp) -/* 0A38D8 800A2CD8 0C0299AA */ jal func_800A66A8 -/* 0A38DC 800A2CDC 27A500E0 */ addiu $a1, $sp, 0xe0 -/* 0A38E0 800A2CE0 8FBF006C */ lw $ra, 0x6c($sp) -/* 0A38E4 800A2CE4 D7B40030 */ ldc1 $f20, 0x30($sp) -/* 0A38E8 800A2CE8 D7B60038 */ ldc1 $f22, 0x38($sp) -/* 0A38EC 800A2CEC D7B80040 */ ldc1 $f24, 0x40($sp) -/* 0A38F0 800A2CF0 8FB00048 */ lw $s0, 0x48($sp) -/* 0A38F4 800A2CF4 8FB1004C */ lw $s1, 0x4c($sp) -/* 0A38F8 800A2CF8 8FB20050 */ lw $s2, 0x50($sp) -/* 0A38FC 800A2CFC 8FB30054 */ lw $s3, 0x54($sp) -/* 0A3900 800A2D00 8FB40058 */ lw $s4, 0x58($sp) -/* 0A3904 800A2D04 8FB5005C */ lw $s5, 0x5c($sp) -/* 0A3908 800A2D08 8FB60060 */ lw $s6, 0x60($sp) -/* 0A390C 800A2D0C 8FB70064 */ lw $s7, 0x64($sp) -/* 0A3910 800A2D10 8FBE0068 */ lw $fp, 0x68($sp) -/* 0A3914 800A2D14 03E00008 */ jr $ra -/* 0A3918 800A2D18 27BD00E8 */ addiu $sp, $sp, 0xe8 diff --git a/asm/non_matchings/code_80091750/func_800A474C.s b/asm/non_matchings/code_80091750/func_800A474C.s deleted file mode 100644 index d01240183c..0000000000 --- a/asm/non_matchings/code_80091750/func_800A474C.s +++ /dev/null @@ -1,215 +0,0 @@ -.section .rodata - -glabel D_800F0C54 -.asciiz "'" -.balign 4 - -glabel D_800F0C58 -.asciiz "\"" -.balign 4 - -.section .late_rodata - -glabel D_800F1DC8 -.float 0.65 - -.section .text - -glabel func_800A474C -/* 0A534C 800A474C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 0A5350 800A4750 3C0E800E */ lui $t6, %hi(gGamestate) # $t6, 0x800e -/* 0A5354 800A4754 8DCEC50C */ lw $t6, %lo(gGamestate)($t6) -/* 0A5358 800A4758 24010004 */ li $at, 4 -/* 0A535C 800A475C AFBF0024 */ sw $ra, 0x24($sp) -/* 0A5360 800A4760 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0A5364 800A4764 AFA40050 */ sw $a0, 0x50($sp) -/* 0A5368 800A4768 AFA50054 */ sw $a1, 0x54($sp) -/* 0A536C 800A476C 15C10003 */ bne $t6, $at, .L800A477C -/* 0A5370 800A4770 AFA60058 */ sw $a2, 0x58($sp) -/* 0A5374 800A4774 10000003 */ b .L800A4784 -/* 0A5378 800A4778 AFA00030 */ sw $zero, 0x30($sp) -.L800A477C: -/* 0A537C 800A477C 240F0001 */ li $t7, 1 -/* 0A5380 800A4780 AFAF0030 */ sw $t7, 0x30($sp) -.L800A4784: -/* 0A5384 800A4784 8FB80050 */ lw $t8, 0x50($sp) -/* 0A5388 800A4788 2B010005 */ slti $at, $t8, 5 -/* 0A538C 800A478C 50200012 */ beql $at, $zero, .L800A47D8 -/* 0A5390 800A4790 8FA80030 */ lw $t0, 0x30($sp) -/* 0A5394 800A4794 8FB90030 */ lw $t9, 0x30($sp) -/* 0A5398 800A4798 8FA40050 */ lw $a0, 0x50($sp) -/* 0A539C 800A479C 3C058019 */ lui $a1, %hi(gTimeTrialDataCourseIndex) # $a1, 0x8019 -/* 0A53A0 800A47A0 17200005 */ bnez $t9, .L800A47B8 -/* 0A53A4 800A47A4 00000000 */ nop -/* 0A53A8 800A47A8 0C02D389 */ jal func_800B4E24 -/* 0A53AC 800A47AC 03002025 */ move $a0, $t8 -/* 0A53B0 800A47B0 10000004 */ b .L800A47C4 -/* 0A53B4 800A47B4 AFA20048 */ sw $v0, 0x48($sp) -.L800A47B8: -/* 0A53B8 800A47B8 0C02D3AD */ jal func_800B4EB4 -/* 0A53BC 800A47BC 80A5EDF7 */ lb $a1, %lo(gTimeTrialDataCourseIndex)($a1) -/* 0A53C0 800A47C0 AFA20048 */ sw $v0, 0x48($sp) -.L800A47C4: -/* 0A53C4 800A47C4 0C024C36 */ jal set_text_color -/* 0A53C8 800A47C8 24040001 */ li $a0, 1 -/* 0A53CC 800A47CC 1000000D */ b .L800A4804 -/* 0A53D0 800A47D0 8FA90050 */ lw $t1, 0x50($sp) -/* 0A53D4 800A47D4 8FA80030 */ lw $t0, 0x30($sp) -.L800A47D8: -/* 0A53D8 800A47D8 3C048019 */ lui $a0, %hi(gTimeTrialDataCourseIndex) # $a0, 0x8019 -/* 0A53DC 800A47DC 15000005 */ bnez $t0, .L800A47F4 -/* 0A53E0 800A47E0 00000000 */ nop -/* 0A53E4 800A47E4 0C02D3CB */ jal func_800B4F2C -/* 0A53E8 800A47E8 00000000 */ nop -/* 0A53EC 800A47EC 10000004 */ b .L800A4800 -/* 0A53F0 800A47F0 AFA20048 */ sw $v0, 0x48($sp) -.L800A47F4: -/* 0A53F4 800A47F4 0C02D3EC */ jal func_800B4FB0 -/* 0A53F8 800A47F8 8084EDF7 */ lb $a0, %lo(gTimeTrialDataCourseIndex)($a0) -/* 0A53FC 800A47FC AFA20048 */ sw $v0, 0x48($sp) -.L800A4800: -/* 0A5400 800A4800 8FA90050 */ lw $t1, 0x50($sp) -.L800A4804: -/* 0A5404 800A4804 3C01800F */ lui $at, %hi(D_800F1DC8) # $at, 0x800f -/* 0A5408 800A4808 C4341DC8 */ lwc1 $f20, %lo(D_800F1DC8)($at) -/* 0A540C 800A480C 8FA40054 */ lw $a0, 0x54($sp) -/* 0A5410 800A4810 3C06800E */ lui $a2, %hi(D_800E7744) -/* 0A5414 800A4814 00095080 */ sll $t2, $t1, 2 -/* 0A5418 800A4818 00CA3021 */ addu $a2, $a2, $t2 -/* 0A541C 800A481C 8CC67744 */ lw $a2, %lo(D_800E7744)($a2) -/* 0A5420 800A4820 8FA50058 */ lw $a1, 0x58($sp) -/* 0A5424 800A4824 24070002 */ li $a3, 2 -/* 0A5428 800A4828 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A542C 800A482C E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A5430 800A4830 0C024E72 */ jal func_800939C8 -/* 0A5434 800A4834 24840014 */ addiu $a0, $a0, 0x14 -/* 0A5438 800A4838 8FAB0030 */ lw $t3, 0x30($sp) -/* 0A543C 800A483C 55600024 */ bnel $t3, $zero, .L800A48D0 -/* 0A5440 800A4840 24020003 */ li $v0, 3 -/* 0A5444 800A4844 0C02ABBD */ jal find_8018D9E0_entry_dupe -/* 0A5448 800A4848 240400BB */ li $a0, 187 -/* 0A544C 800A484C 8FAC0050 */ lw $t4, 0x50($sp) -/* 0A5450 800A4850 29810005 */ slti $at, $t4, 5 -/* 0A5454 800A4854 50200010 */ beql $at, $zero, .L800A4898 -/* 0A5458 800A4858 8C590020 */ lw $t9, 0x20($v0) -/* 0A545C 800A485C 8C4D001C */ lw $t5, 0x1c($v0) -/* 0A5460 800A4860 3C0E800E */ lui $t6, %hi(gGlobalTimer) # $t6, 0x800e -/* 0A5464 800A4864 24020003 */ li $v0, 3 -/* 0A5468 800A4868 158D0008 */ bne $t4, $t5, .L800A488C -/* 0A546C 800A486C 00000000 */ nop -/* 0A5470 800A4870 8DCEC54C */ lw $t6, %lo(gGlobalTimer)($t6) -/* 0A5474 800A4874 24010003 */ li $at, 3 -/* 0A5478 800A4878 01C1001A */ div $zero, $t6, $at -/* 0A547C 800A487C 00007810 */ mfhi $t7 -/* 0A5480 800A4880 AFAF0040 */ sw $t7, 0x40($sp) -/* 0A5484 800A4884 10000013 */ b .L800A48D4 -/* 0A5488 800A4888 00000000 */ nop -.L800A488C: -/* 0A548C 800A488C 10000011 */ b .L800A48D4 -/* 0A5490 800A4890 AFA20040 */ sw $v0, 0x40($sp) -/* 0A5494 800A4894 8C590020 */ lw $t9, 0x20($v0) -.L800A4898: -/* 0A5498 800A4898 24020003 */ li $v0, 3 -/* 0A549C 800A489C 13200009 */ beqz $t9, .L800A48C4 -/* 0A54A0 800A48A0 00000000 */ nop -/* 0A54A4 800A48A4 3C02800E */ lui $v0, %hi(gGlobalTimer) # $v0, 0x800e -/* 0A54A8 800A48A8 8C42C54C */ lw $v0, %lo(gGlobalTimer)($v0) -/* 0A54AC 800A48AC 24010003 */ li $at, 3 -/* 0A54B0 800A48B0 0041001A */ div $zero, $v0, $at -/* 0A54B4 800A48B4 0000C010 */ mfhi $t8 -/* 0A54B8 800A48B8 AFB80040 */ sw $t8, 0x40($sp) -/* 0A54BC 800A48BC 10000005 */ b .L800A48D4 -/* 0A54C0 800A48C0 00000000 */ nop -.L800A48C4: -/* 0A54C4 800A48C4 10000003 */ b .L800A48D4 -/* 0A54C8 800A48C8 AFA20040 */ sw $v0, 0x40($sp) -/* 0A54CC 800A48CC 24020003 */ li $v0, 3 -.L800A48D0: -/* 0A54D0 800A48D0 AFA20040 */ sw $v0, 0x40($sp) -.L800A48D4: -/* 0A54D4 800A48D4 0C024C36 */ jal set_text_color -/* 0A54D8 800A48D8 8FA40040 */ lw $a0, 0x40($sp) -/* 0A54DC 800A48DC 8FA40048 */ lw $a0, 0x48($sp) -/* 0A54E0 800A48E0 3C01000F */ lui $at, (0x000FFFFF >> 16) # lui $at, 0xf -/* 0A54E4 800A48E4 3421FFFF */ ori $at, (0x000FFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0A54E8 800A48E8 00814024 */ and $t0, $a0, $at -/* 0A54EC 800A48EC 01002025 */ move $a0, $t0 -/* 0A54F0 800A48F0 AFA8002C */ sw $t0, 0x2c($sp) -/* 0A54F4 800A48F4 0C029E3D */ jal get_time_record_minutes -/* 0A54F8 800A48F8 27A50038 */ addiu $a1, $sp, 0x38 -/* 0A54FC 800A48FC 8FA40054 */ lw $a0, 0x54($sp) -/* 0A5500 800A4900 8FA50058 */ lw $a1, 0x58($sp) -/* 0A5504 800A4904 27A60038 */ addiu $a2, $sp, 0x38 -/* 0A5508 800A4908 00003825 */ move $a3, $zero -/* 0A550C 800A490C E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A5510 800A4910 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A5514 800A4914 0C024E72 */ jal func_800939C8 -/* 0A5518 800A4918 24840027 */ addiu $a0, $a0, 0x27 -/* 0A551C 800A491C 8FA40054 */ lw $a0, 0x54($sp) -/* 0A5520 800A4920 3C06800F */ lui $a2, %hi(D_800F0C54) # $a2, 0x800f -/* 0A5524 800A4924 24C60C54 */ addiu $a2, %lo(D_800F0C54) # addiu $a2, $a2, 0xc54 -/* 0A5528 800A4928 8FA50058 */ lw $a1, 0x58($sp) -/* 0A552C 800A492C 00003825 */ move $a3, $zero -/* 0A5530 800A4930 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A5534 800A4934 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A5538 800A4938 0C024CC9 */ jal func_80093324 -/* 0A553C 800A493C 24840032 */ addiu $a0, $a0, 0x32 -/* 0A5540 800A4940 8FA4002C */ lw $a0, 0x2c($sp) -/* 0A5544 800A4944 0C029E51 */ jal get_time_record_seconds -/* 0A5548 800A4948 27A50038 */ addiu $a1, $sp, 0x38 -/* 0A554C 800A494C 8FA40054 */ lw $a0, 0x54($sp) -/* 0A5550 800A4950 8FA50058 */ lw $a1, 0x58($sp) -/* 0A5554 800A4954 27A60038 */ addiu $a2, $sp, 0x38 -/* 0A5558 800A4958 00003825 */ move $a3, $zero -/* 0A555C 800A495C E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A5560 800A4960 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A5564 800A4964 0C024E72 */ jal func_800939C8 -/* 0A5568 800A4968 2484003B */ addiu $a0, $a0, 0x3b -/* 0A556C 800A496C 8FA40054 */ lw $a0, 0x54($sp) -/* 0A5570 800A4970 3C06800F */ lui $a2, %hi(D_800F0C58) # $a2, 0x800f -/* 0A5574 800A4974 24C60C58 */ addiu $a2, %lo(D_800F0C58) # addiu $a2, $a2, 0xc58 -/* 0A5578 800A4978 8FA50058 */ lw $a1, 0x58($sp) -/* 0A557C 800A497C 00003825 */ move $a3, $zero -/* 0A5580 800A4980 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A5584 800A4984 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A5588 800A4988 0C024CC9 */ jal func_80093324 -/* 0A558C 800A498C 24840046 */ addiu $a0, $a0, 0x46 -/* 0A5590 800A4990 8FA4002C */ lw $a0, 0x2c($sp) -/* 0A5594 800A4994 0C029E69 */ jal get_time_record_centiseconds -/* 0A5598 800A4998 27A50038 */ addiu $a1, $sp, 0x38 -/* 0A559C 800A499C 8FA40054 */ lw $a0, 0x54($sp) -/* 0A55A0 800A49A0 8FA50058 */ lw $a1, 0x58($sp) -/* 0A55A4 800A49A4 27A60038 */ addiu $a2, $sp, 0x38 -/* 0A55A8 800A49A8 00003825 */ move $a3, $zero -/* 0A55AC 800A49AC E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A55B0 800A49B0 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A55B4 800A49B4 0C024E72 */ jal func_800939C8 -/* 0A55B8 800A49B8 24840050 */ addiu $a0, $a0, 0x50 -/* 0A55BC 800A49BC 8FA9002C */ lw $t1, 0x2c($sp) -/* 0A55C0 800A49C0 3C010009 */ lui $at, (0x000927C0 >> 16) # lui $at, 9 -/* 0A55C4 800A49C4 342127C0 */ ori $at, (0x000927C0 & 0xFFFF) # ori $at, $at, 0x27c0 -/* 0A55C8 800A49C8 0121082B */ sltu $at, $t1, $at -/* 0A55CC 800A49CC 10200005 */ beqz $at, .L800A49E4 -/* 0A55D0 800A49D0 8FA40054 */ lw $a0, 0x54($sp) -/* 0A55D4 800A49D4 8FA20048 */ lw $v0, 0x48($sp) -/* 0A55D8 800A49D8 00025502 */ srl $t2, $v0, 0x14 -/* 0A55DC 800A49DC 10000002 */ b .L800A49E8 -/* 0A55E0 800A49E0 01401025 */ move $v0, $t2 -.L800A49E4: -/* 0A55E4 800A49E4 24020008 */ li $v0, 8 -.L800A49E8: -/* 0A55E8 800A49E8 00025880 */ sll $t3, $v0, 2 -/* 0A55EC 800A49EC 3C06800E */ lui $a2, %hi(D_800E76A8) -/* 0A55F0 800A49F0 00CB3021 */ addu $a2, $a2, $t3 -/* 0A55F4 800A49F4 8CC676A8 */ lw $a2, %lo(D_800E76A8)($a2) -/* 0A55F8 800A49F8 24840078 */ addiu $a0, $a0, 0x78 -/* 0A55FC 800A49FC 8FA50058 */ lw $a1, 0x58($sp) -/* 0A5600 800A4A00 00003825 */ move $a3, $zero -/* 0A5604 800A4A04 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A5608 800A4A08 0C024DBB */ jal draw_text -/* 0A560C 800A4A0C E7B40014 */ swc1 $f20, 0x14($sp) -/* 0A5610 800A4A10 8FBF0024 */ lw $ra, 0x24($sp) -/* 0A5614 800A4A14 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0A5618 800A4A18 27BD0050 */ addiu $sp, $sp, 0x50 -/* 0A561C 800A4A1C 03E00008 */ jr $ra -/* 0A5620 800A4A20 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_800A66A8.s b/asm/non_matchings/code_80091750/func_800A66A8.s deleted file mode 100644 index 5b70cb238c..0000000000 --- a/asm/non_matchings/code_80091750/func_800A66A8.s +++ /dev/null @@ -1,213 +0,0 @@ -.section .late_rodata - -glabel D_800F1F18 -.double 0.95 - -glabel D_800F1F20 -.float 1.2 - -.section .text - -glabel func_800A66A8 -/* 0A72A8 800A66A8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0A72AC 800A66AC 3C0F8016 */ lui $t7, %hi(gMatrixEffectCount) # $t7, 0x8016 -/* 0A72B0 800A66B0 85EF4AF0 */ lh $t7, %lo(gMatrixEffectCount)($t7) -/* 0A72B4 800A66B4 3C0E8015 */ lui $t6, %hi(gGfxPool) # $t6, 0x8015 -/* 0A72B8 800A66B8 8DCEEF40 */ lw $t6, %lo(gGfxPool)($t6) -/* 0A72BC 800A66BC AFB10028 */ sw $s1, 0x28($sp) -/* 0A72C0 800A66C0 000FC180 */ sll $t8, $t7, 6 -/* 0A72C4 800A66C4 AFBF002C */ sw $ra, 0x2c($sp) -/* 0A72C8 800A66C8 AFB00024 */ sw $s0, 0x24($sp) -/* 0A72CC 800A66CC F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0A72D0 800A66D0 AFA50034 */ sw $a1, 0x34($sp) -/* 0A72D4 800A66D4 3401FAC0 */ li $at, 64192 -/* 0A72D8 800A66D8 01D88821 */ addu $s1, $t6, $t8 -/* 0A72DC 800A66DC C4840024 */ lwc1 $f4, 0x24($a0) -/* 0A72E0 800A66E0 02218821 */ addu $s1, $s1, $at -/* 0A72E4 800A66E4 3C013FF8 */ li $at, 0x3FF80000 # 1.937500 -/* 0A72E8 800A66E8 44813800 */ mtc1 $at, $f7 -/* 0A72EC 800A66EC 44803000 */ mtc1 $zero, $f6 -/* 0A72F0 800A66F0 46002021 */ cvt.d.s $f0, $f4 -/* 0A72F4 800A66F4 3C013FC0 */ li $at, 0x3FC00000 # 1.500000 -/* 0A72F8 800A66F8 4620303C */ c.lt.d $f6, $f0 -/* 0A72FC 800A66FC 00000000 */ nop -/* 0A7300 800A6700 45020008 */ bc1fl .L800A6724 -/* 0A7304 800A6704 44813000 */ mtc1 $at, $f6 -/* 0A7308 800A6708 3C01800F */ lui $at, %hi(D_800F1F18) -/* 0A730C 800A670C D4281F18 */ ldc1 $f8, %lo(D_800F1F18)($at) -/* 0A7310 800A6710 46280282 */ mul.d $f10, $f0, $f8 -/* 0A7314 800A6714 46205120 */ cvt.s.d $f4, $f10 -/* 0A7318 800A6718 10000004 */ b .L800A672C -/* 0A731C 800A671C E4840024 */ swc1 $f4, 0x24($a0) -/* 0A7320 800A6720 44813000 */ mtc1 $at, $f6 -.L800A6724: -/* 0A7324 800A6724 00000000 */ nop -/* 0A7328 800A6728 E4860024 */ swc1 $f6, 0x24($a0) -.L800A672C: -/* 0A732C 800A672C 3C018019 */ lui $at, %hi(D_8018ED98) # $at, 0x8019 -/* 0A7330 800A6730 C432ED98 */ lwc1 $f18, %lo(D_8018ED98)($at) -/* 0A7334 800A6734 3C018019 */ lui $at, %hi(D_8018ED9C) # $at, 0x8019 -/* 0A7338 800A6738 C434ED9C */ lwc1 $f20, %lo(D_8018ED9C)($at) -/* 0A733C 800A673C 8C990008 */ lw $t9, 8($a0) -/* 0A7340 800A6740 3C014040 */ li $at, 0x40400000 # 3.000000 -/* 0A7344 800A6744 C4800024 */ lwc1 $f0, 0x24($a0) -/* 0A7348 800A6748 44814000 */ mtc1 $at, $f8 -/* 0A734C 800A674C 44992000 */ mtc1 $t9, $f4 -/* 0A7350 800A6750 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0A7354 800A6754 46080282 */ mul.s $f10, $f0, $f8 -/* 0A7358 800A6758 44814000 */ mtc1 $at, $f8 -/* 0A735C 800A675C 3C014000 */ li $at, 0x40000000 # 2.000000 -/* 0A7360 800A6760 02202025 */ move $a0, $s1 -/* 0A7364 800A6764 468021A0 */ cvt.s.w $f6, $f4 -/* 0A7368 800A6768 44812000 */ mtc1 $at, $f4 -/* 0A736C 800A676C 3C018019 */ lui $at, %hi(D_8018EDA0) # $at, 0x8019 -/* 0A7370 800A6770 46065082 */ mul.s $f2, $f10, $f6 -/* 0A7374 800A6774 C42AEDA0 */ lwc1 $f10, %lo(D_8018EDA0)($at) -/* 0A7378 800A6778 46080302 */ mul.s $f12, $f0, $f8 -/* 0A737C 800A677C 00000000 */ nop -/* 0A7380 800A6780 46040382 */ mul.s $f14, $f0, $f4 -/* 0A7384 800A6784 46029480 */ add.s $f18, $f18, $f2 -/* 0A7388 800A6788 460CA500 */ add.s $f20, $f20, $f12 -/* 0A738C 800A678C 460E5180 */ add.s $f6, $f10, $f14 -/* 0A7390 800A6790 E426EDA0 */ swc1 $f6, %lo(D_8018EDA0)($at) -/* 0A7394 800A6794 3C018019 */ lui $at, %hi(D_8018EDA4) # $at, 0x8019 -/* 0A7398 800A6798 E422EDA4 */ swc1 $f2, %lo(D_8018EDA4)($at) -/* 0A739C 800A679C 3C018019 */ lui $at, %hi(D_8018EDA8) # $at, 0x8019 -/* 0A73A0 800A67A0 E42CEDA8 */ swc1 $f12, %lo(D_8018EDA8)($at) -/* 0A73A4 800A67A4 3C018019 */ lui $at, %hi(D_8018EDAC) # $at, 0x8019 -/* 0A73A8 800A67A8 E42EEDAC */ swc1 $f14, %lo(D_8018EDAC)($at) -/* 0A73AC 800A67AC 3C018019 */ lui $at, %hi(D_8018ED98) # $at, 0x8019 -/* 0A73B0 800A67B0 E432ED98 */ swc1 $f18, %lo(D_8018ED98)($at) -/* 0A73B4 800A67B4 3C018019 */ lui $at, %hi(D_8018ED9C) # $at, 0x8019 -/* 0A73B8 800A67B8 E434ED9C */ swc1 $f20, %lo(D_8018ED9C)($at) -/* 0A73BC 800A67BC 3C01800F */ lui $at, %hi(D_800F1F20) # $at, 0x800f -/* 0A73C0 800A67C0 C4201F20 */ lwc1 $f0, %lo(D_800F1F20)($at) -/* 0A73C4 800A67C4 44050000 */ mfc1 $a1, $f0 -/* 0A73C8 800A67C8 44060000 */ mfc1 $a2, $f0 -/* 0A73CC 800A67CC 44070000 */ mfc1 $a3, $f0 -/* 0A73D0 800A67D0 0C033C2D */ jal guScale -/* 0A73D4 800A67D4 00000000 */ nop -/* 0A73D8 800A67D8 4480A000 */ mtc1 $zero, $f20 -/* 0A73DC 800A67DC 26300040 */ addiu $s0, $s1, 0x40 -/* 0A73E0 800A67E0 3C058019 */ lui $a1, %hi(D_8018ED9C) # $a1, 0x8019 -/* 0A73E4 800A67E4 4406A000 */ mfc1 $a2, $f20 -/* 0A73E8 800A67E8 8CA5ED9C */ lw $a1, %lo(D_8018ED9C)($a1) -/* 0A73EC 800A67EC 02002025 */ move $a0, $s0 -/* 0A73F0 800A67F0 3C073F80 */ lui $a3, 0x3f80 -/* 0A73F4 800A67F4 0C033C01 */ jal guRotate -/* 0A73F8 800A67F8 E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A73FC 800A67FC 02202025 */ move $a0, $s1 -/* 0A7400 800A6800 02002825 */ move $a1, $s0 -/* 0A7404 800A6804 0C033E08 */ jal guMtxCatL -/* 0A7408 800A6808 02203025 */ move $a2, $s1 -/* 0A740C 800A680C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A7410 800A6810 44814000 */ mtc1 $at, $f8 -/* 0A7414 800A6814 3C058019 */ lui $a1, %hi(D_8018EDA0) # $a1, 0x8019 -/* 0A7418 800A6818 4406A000 */ mfc1 $a2, $f20 -/* 0A741C 800A681C 4407A000 */ mfc1 $a3, $f20 -/* 0A7420 800A6820 8CA5EDA0 */ lw $a1, %lo(D_8018EDA0)($a1) -/* 0A7424 800A6824 02002025 */ move $a0, $s0 -/* 0A7428 800A6828 0C033C01 */ jal guRotate -/* 0A742C 800A682C E7A80010 */ swc1 $f8, 0x10($sp) -/* 0A7430 800A6830 02202025 */ move $a0, $s1 -/* 0A7434 800A6834 02002825 */ move $a1, $s0 -/* 0A7438 800A6838 0C033E08 */ jal guMtxCatL -/* 0A743C 800A683C 02203025 */ move $a2, $s1 -/* 0A7440 800A6840 3C018019 */ lui $at, %hi(D_8018ED98) # $at, 0x8019 -/* 0A7444 800A6844 C432ED98 */ lwc1 $f18, %lo(D_8018ED98)($at) -/* 0A7448 800A6848 4407A000 */ mfc1 $a3, $f20 -/* 0A744C 800A684C 02002025 */ move $a0, $s0 -/* 0A7450 800A6850 44059000 */ mfc1 $a1, $f18 -/* 0A7454 800A6854 3C063F80 */ lui $a2, 0x3f80 -/* 0A7458 800A6858 0C033C01 */ jal guRotate -/* 0A745C 800A685C E7B40010 */ swc1 $f20, 0x10($sp) -/* 0A7460 800A6860 02202025 */ move $a0, $s1 -/* 0A7464 800A6864 02002825 */ move $a1, $s0 -/* 0A7468 800A6868 0C033E08 */ jal guMtxCatL -/* 0A746C 800A686C 02203025 */ move $a2, $s1 -/* 0A7470 800A6870 8FA20034 */ lw $v0, 0x34($sp) -/* 0A7474 800A6874 4407A000 */ mfc1 $a3, $f20 -/* 0A7478 800A6878 02002025 */ move $a0, $s0 -/* 0A747C 800A687C 844B0000 */ lh $t3, ($v0) -/* 0A7480 800A6880 844C0002 */ lh $t4, 2($v0) -/* 0A7484 800A6884 448B2000 */ mtc1 $t3, $f4 -/* 0A7488 800A6888 448C5000 */ mtc1 $t4, $f10 -/* 0A748C 800A688C 46802120 */ cvt.s.w $f4, $f4 -/* 0A7490 800A6890 468052A0 */ cvt.s.w $f10, $f10 -/* 0A7494 800A6894 44052000 */ mfc1 $a1, $f4 -/* 0A7498 800A6898 44065000 */ mfc1 $a2, $f10 -/* 0A749C 800A689C 0C033DC2 */ jal guTranslate -/* 0A74A0 800A68A0 00000000 */ nop -/* 0A74A4 800A68A4 02202025 */ move $a0, $s1 -/* 0A74A8 800A68A8 02002825 */ move $a1, $s0 -/* 0A74AC 800A68AC 0C033E08 */ jal guMtxCatL -/* 0A74B0 800A68B0 02203025 */ move $a2, $s1 -/* 0A74B4 800A68B4 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0A74B8 800A68B8 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0A74BC 800A68BC 8C620000 */ lw $v0, ($v1) -/* 0A74C0 800A68C0 3C0F0102 */ lui $t7, (0x01020040 >> 16) # lui $t7, 0x102 -/* 0A74C4 800A68C4 3C0A8016 */ lui $t2, %hi(gMatrixEffectCount) # $t2, 0x8016 -/* 0A74C8 800A68C8 244D0008 */ addiu $t5, $v0, 8 -/* 0A74CC 800A68CC AC6D0000 */ sw $t5, ($v1) -/* 0A74D0 800A68D0 35EF0040 */ ori $t7, (0x01020040 & 0xFFFF) # ori $t7, $t7, 0x40 -/* 0A74D4 800A68D4 254A4AF0 */ addiu $t2, %lo(gMatrixEffectCount) # addiu $t2, $t2, 0x4af0 -/* 0A74D8 800A68D8 AC4F0000 */ sw $t7, ($v0) -/* 0A74DC 800A68DC 85580000 */ lh $t8, ($t2) -/* 0A74E0 800A68E0 3C0E8015 */ lui $t6, %hi(gGfxPool) # $t6, 0x8015 -/* 0A74E4 800A68E4 8DCEEF40 */ lw $t6, %lo(gGfxPool)($t6) -/* 0A74E8 800A68E8 0018C980 */ sll $t9, $t8, 6 -/* 0A74EC 800A68EC 3401FAC0 */ li $at, 64192 -/* 0A74F0 800A68F0 01D95821 */ addu $t3, $t6, $t9 -/* 0A74F4 800A68F4 01616021 */ addu $t4, $t3, $at -/* 0A74F8 800A68F8 3C011FFF */ lui $at, (0x1FFFFFFF >> 16) # lui $at, 0x1fff -/* 0A74FC 800A68FC 3421FFFF */ ori $at, (0x1FFFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0A7500 800A6900 01816824 */ and $t5, $t4, $at -/* 0A7504 800A6904 AC4D0004 */ sw $t5, 4($v0) -/* 0A7508 800A6908 854F0000 */ lh $t7, ($t2) -/* 0A750C 800A690C 8C620000 */ lw $v0, ($v1) -/* 0A7510 800A6910 3C0B0002 */ lui $t3, 2 -/* 0A7514 800A6914 25F80001 */ addiu $t8, $t7, 1 -/* 0A7518 800A6918 244E0008 */ addiu $t6, $v0, 8 -/* 0A751C 800A691C A5580000 */ sh $t8, ($t2) -/* 0A7520 800A6920 AC6E0000 */ sw $t6, ($v1) -/* 0A7524 800A6924 3C19B600 */ lui $t9, 0xb600 -/* 0A7528 800A6928 AC590000 */ sw $t9, ($v0) -/* 0A752C 800A692C AC4B0004 */ sw $t3, 4($v0) -/* 0A7530 800A6930 8C620000 */ lw $v0, ($v1) -/* 0A7534 800A6934 3C0FFF33 */ lui $t7, (0xFF33FFFF >> 16) # lui $t7, 0xff33 -/* 0A7538 800A6938 3C0DFC12 */ lui $t5, (0xFC121824 >> 16) # lui $t5, 0xfc12 -/* 0A753C 800A693C 244C0008 */ addiu $t4, $v0, 8 -/* 0A7540 800A6940 AC6C0000 */ sw $t4, ($v1) -/* 0A7544 800A6944 35AD1824 */ ori $t5, (0xFC121824 & 0xFFFF) # ori $t5, $t5, 0x1824 -/* 0A7548 800A6948 35EFFFFF */ ori $t7, (0xFF33FFFF & 0xFFFF) # ori $t7, $t7, 0xffff -/* 0A754C 800A694C AC4F0004 */ sw $t7, 4($v0) -/* 0A7550 800A6950 AC4D0000 */ sw $t5, ($v0) -/* 0A7554 800A6954 8C620000 */ lw $v0, ($v1) -/* 0A7558 800A6958 3C0EC000 */ lui $t6, 0xc000 -/* 0A755C 800A695C 3C0C0050 */ lui $t4, (0x00504340 >> 16) # lui $t4, 0x50 -/* 0A7560 800A6960 24580008 */ addiu $t8, $v0, 8 -/* 0A7564 800A6964 AC780000 */ sw $t8, ($v1) -/* 0A7568 800A6968 AC400004 */ sw $zero, 4($v0) -/* 0A756C 800A696C AC4E0000 */ sw $t6, ($v0) -/* 0A7570 800A6970 8C620000 */ lw $v0, ($v1) -/* 0A7574 800A6974 3C0BB900 */ lui $t3, (0xB900031D >> 16) # lui $t3, 0xb900 -/* 0A7578 800A6978 356B031D */ ori $t3, (0xB900031D & 0xFFFF) # ori $t3, $t3, 0x31d -/* 0A757C 800A697C 24590008 */ addiu $t9, $v0, 8 -/* 0A7580 800A6980 AC790000 */ sw $t9, ($v1) -/* 0A7584 800A6984 358C4340 */ ori $t4, (0x00504340 & 0xFFFF) # ori $t4, $t4, 0x4340 -/* 0A7588 800A6988 AC4C0004 */ sw $t4, 4($v0) -/* 0A758C 800A698C AC4B0000 */ sw $t3, ($v0) -/* 0A7590 800A6990 8C620000 */ lw $v0, ($v1) -/* 0A7594 800A6994 3C180D00 */ lui $t8, %hi(D_0D003090) # $t8, 0xd00 -/* 0A7598 800A6998 27183090 */ addiu $t8, %lo(D_0D003090) # addiu $t8, $t8, 0x3090 -/* 0A759C 800A699C 244D0008 */ addiu $t5, $v0, 8 -/* 0A75A0 800A69A0 AC6D0000 */ sw $t5, ($v1) -/* 0A75A4 800A69A4 3C0F0600 */ lui $t7, 0x600 -/* 0A75A8 800A69A8 AC4F0000 */ sw $t7, ($v0) -/* 0A75AC 800A69AC AC580004 */ sw $t8, 4($v0) -/* 0A75B0 800A69B0 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A75B4 800A69B4 8FB10028 */ lw $s1, 0x28($sp) -/* 0A75B8 800A69B8 8FB00024 */ lw $s0, 0x24($sp) -/* 0A75BC 800A69BC D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0A75C0 800A69C0 03E00008 */ jr $ra -/* 0A75C4 800A69C4 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/non_matchings/code_80091750/func_800AB314.s b/asm/non_matchings/code_80091750/func_800AB314.s deleted file mode 100644 index 664099db71..0000000000 --- a/asm/non_matchings/code_80091750/func_800AB314.s +++ /dev/null @@ -1,433 +0,0 @@ -glabel func_800AB314 -/* 0ABF14 800AB314 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0ABF18 800AB318 AFBF0014 */ sw $ra, 0x14($sp) -/* 0ABF1C 800AB31C 00803025 */ move $a2, $a0 -/* 0ABF20 800AB320 27A30024 */ addiu $v1, $sp, 0x24 -/* 0ABF24 800AB324 00002825 */ move $a1, $zero -.L800AB328: -/* 0ABF28 800AB328 24A4005F */ addiu $a0, $a1, 0x5f -/* 0ABF2C 800AB32C AFA3001C */ sw $v1, 0x1c($sp) -/* 0ABF30 800AB330 AFA5003C */ sw $a1, 0x3c($sp) -/* 0ABF34 800AB334 0C02ABBD */ jal find_8018D9E0_entry_dupe -/* 0ABF38 800AB338 AFA60040 */ sw $a2, 0x40($sp) -/* 0ABF3C 800AB33C 8FA5003C */ lw $a1, 0x3c($sp) -/* 0ABF40 800AB340 8FA3001C */ lw $v1, 0x1c($sp) -/* 0ABF44 800AB344 8FA60040 */ lw $a2, 0x40($sp) -/* 0ABF48 800AB348 24A50001 */ addiu $a1, $a1, 1 -/* 0ABF4C 800AB34C 28A10004 */ slti $at, $a1, 4 -/* 0ABF50 800AB350 24630004 */ addiu $v1, $v1, 4 -/* 0ABF54 800AB354 1420FFF4 */ bnez $at, .L800AB328 -/* 0ABF58 800AB358 AC62FFFC */ sw $v0, -4($v1) -/* 0ABF5C 800AB35C 3C0E800E */ lui $t6, %hi(gModeSelection) # $t6, 0x800e -/* 0ABF60 800AB360 8DCEC53C */ lw $t6, %lo(gModeSelection)($t6) -/* 0ABF64 800AB364 3C0F8019 */ lui $t7, %hi(D_8018EDEC) # $t7, 0x8019 -/* 0ABF68 800AB368 51C00053 */ beql $t6, $zero, .L800AB4B8 -/* 0ABF6C 800AB36C 8CC20004 */ lw $v0, 4($a2) -/* 0ABF70 800AB370 81EFEDEC */ lb $t7, %lo(D_8018EDEC)($t7) -/* 0ABF74 800AB374 24040001 */ li $a0, 1 -/* 0ABF78 800AB378 24030003 */ li $v1, 3 -/* 0ABF7C 800AB37C 108F003A */ beq $a0, $t7, .L800AB468 -/* 0ABF80 800AB380 3C028019 */ lui $v0, %hi(gCourseIndexInCup) # $v0, 0x8019 -/* 0ABF84 800AB384 ACC00004 */ sw $zero, 4($a2) -/* 0ABF88 800AB388 ACC00020 */ sw $zero, 0x20($a2) -/* 0ABF8C 800AB38C 2442EE0B */ addiu $v0, %lo(gCourseIndexInCup) # addiu $v0, $v0, -0x11f5 -/* 0ABF90 800AB390 80580000 */ lb $t8, ($v0) -/* 0ABF94 800AB394 8FB90024 */ lw $t9, 0x24($sp) -/* 0ABF98 800AB398 8FAB0024 */ lw $t3, 0x24($sp) -/* 0ABF9C 800AB39C 57000008 */ bnel $t8, $zero, .L800AB3C0 -/* 0ABFA0 800AB3A0 A1600015 */ sb $zero, 0x15($t3) -/* 0ABFA4 800AB3A4 A3240015 */ sb $a0, 0x15($t9) -/* 0ABFA8 800AB3A8 8CCA001C */ lw $t2, 0x1c($a2) -/* 0ABFAC 800AB3AC 51400005 */ beql $t2, $zero, .L800AB3C4 -/* 0ABFB0 800AB3B0 804C0000 */ lb $t4, ($v0) -/* 0ABFB4 800AB3B4 10000002 */ b .L800AB3C0 -/* 0ABFB8 800AB3B8 ACC0001C */ sw $zero, 0x1c($a2) -/* 0ABFBC 800AB3BC A1600015 */ sb $zero, 0x15($t3) -.L800AB3C0: -/* 0ABFC0 800AB3C0 804C0000 */ lb $t4, ($v0) -.L800AB3C4: -/* 0ABFC4 800AB3C4 24010001 */ li $at, 1 -/* 0ABFC8 800AB3C8 8FAF0028 */ lw $t7, 0x28($sp) -/* 0ABFCC 800AB3CC 15810008 */ bne $t4, $at, .L800AB3F0 -/* 0ABFD0 800AB3D0 8FAD0028 */ lw $t5, 0x28($sp) -/* 0ABFD4 800AB3D4 A1A40015 */ sb $a0, 0x15($t5) -/* 0ABFD8 800AB3D8 8CCE001C */ lw $t6, 0x1c($a2) -/* 0ABFDC 800AB3DC 24010001 */ li $at, 1 -/* 0ABFE0 800AB3E0 51C10005 */ beql $t6, $at, .L800AB3F8 -/* 0ABFE4 800AB3E4 80580000 */ lb $t8, ($v0) -/* 0ABFE8 800AB3E8 10000002 */ b .L800AB3F4 -/* 0ABFEC 800AB3EC ACC4001C */ sw $a0, 0x1c($a2) -.L800AB3F0: -/* 0ABFF0 800AB3F0 A1E00015 */ sb $zero, 0x15($t7) -.L800AB3F4: -/* 0ABFF4 800AB3F4 80580000 */ lb $t8, ($v0) -.L800AB3F8: -/* 0ABFF8 800AB3F8 24010002 */ li $at, 2 -/* 0ABFFC 800AB3FC 8FAC002C */ lw $t4, 0x2c($sp) -/* 0AC000 800AB400 17010009 */ bne $t8, $at, .L800AB428 -/* 0AC004 800AB404 8FB9002C */ lw $t9, 0x2c($sp) -/* 0AC008 800AB408 A3240015 */ sb $a0, 0x15($t9) -/* 0AC00C 800AB40C 8CCA001C */ lw $t2, 0x1c($a2) -/* 0AC010 800AB410 24010002 */ li $at, 2 -/* 0AC014 800AB414 240B0002 */ li $t3, 2 -/* 0AC018 800AB418 51410005 */ beql $t2, $at, .L800AB430 -/* 0AC01C 800AB41C 804D0000 */ lb $t5, ($v0) -/* 0AC020 800AB420 10000002 */ b .L800AB42C -/* 0AC024 800AB424 ACCB001C */ sw $t3, 0x1c($a2) -.L800AB428: -/* 0AC028 800AB428 A1800015 */ sb $zero, 0x15($t4) -.L800AB42C: -/* 0AC02C 800AB42C 804D0000 */ lb $t5, ($v0) -.L800AB430: -/* 0AC030 800AB430 24010003 */ li $at, 3 -/* 0AC034 800AB434 8FB80030 */ lw $t8, 0x30($sp) -/* 0AC038 800AB438 15A10009 */ bne $t5, $at, .L800AB460 -/* 0AC03C 800AB43C 8FAE0030 */ lw $t6, 0x30($sp) -/* 0AC040 800AB440 A1C40015 */ sb $a0, 0x15($t6) -/* 0AC044 800AB444 8CCF001C */ lw $t7, 0x1c($a2) -/* 0AC048 800AB448 24010003 */ li $at, 3 -/* 0AC04C 800AB44C 24030003 */ li $v1, 3 -/* 0AC050 800AB450 51E10129 */ beql $t7, $at, .L800AB8F8 -/* 0AC054 800AB454 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AC058 800AB458 10000126 */ b .L800AB8F4 -/* 0AC05C 800AB45C ACC3001C */ sw $v1, 0x1c($a2) -.L800AB460: -/* 0AC060 800AB460 10000124 */ b .L800AB8F4 -/* 0AC064 800AB464 A3000015 */ sb $zero, 0x15($t8) -.L800AB468: -/* 0AC068 800AB468 ACC30004 */ sw $v1, 4($a2) -/* 0AC06C 800AB46C 8FB90024 */ lw $t9, 0x24($sp) -/* 0AC070 800AB470 24020006 */ li $v0, 6 -/* 0AC074 800AB474 A3240015 */ sb $a0, 0x15($t9) -/* 0AC078 800AB478 8FAA0024 */ lw $t2, 0x24($sp) -/* 0AC07C 800AB47C A1420014 */ sb $v0, 0x14($t2) -/* 0AC080 800AB480 8FAB0028 */ lw $t3, 0x28($sp) -/* 0AC084 800AB484 A1640015 */ sb $a0, 0x15($t3) -/* 0AC088 800AB488 8FAC0028 */ lw $t4, 0x28($sp) -/* 0AC08C 800AB48C A1820014 */ sb $v0, 0x14($t4) -/* 0AC090 800AB490 8FAD002C */ lw $t5, 0x2c($sp) -/* 0AC094 800AB494 A1A40015 */ sb $a0, 0x15($t5) -/* 0AC098 800AB498 8FAE002C */ lw $t6, 0x2c($sp) -/* 0AC09C 800AB49C A1C20014 */ sb $v0, 0x14($t6) -/* 0AC0A0 800AB4A0 8FAF0030 */ lw $t7, 0x30($sp) -/* 0AC0A4 800AB4A4 A1E40015 */ sb $a0, 0x15($t7) -/* 0AC0A8 800AB4A8 8FB80030 */ lw $t8, 0x30($sp) -/* 0AC0AC 800AB4AC 10000111 */ b .L800AB8F4 -/* 0AC0B0 800AB4B0 A3020014 */ sb $v0, 0x14($t8) -/* 0AC0B4 800AB4B4 8CC20004 */ lw $v0, 4($a2) -.L800AB4B8: -/* 0AC0B8 800AB4B8 3C038019 */ lui $v1, %hi(gCupSelection) # 0x8019 -/* 0AC0BC 800AB4BC 24040001 */ li $a0, 1 -/* 0AC0C0 800AB4C0 5040000C */ beql $v0, $zero, .L800AB4F4 -/* 0AC0C4 800AB4C4 8CD9001C */ lw $t9, 0x1c($a2) -/* 0AC0C8 800AB4C8 1044002F */ beq $v0, $a0, .L800AB588 -/* 0AC0CC 800AB4CC 3C038019 */ lui $v1, %hi(gCupSelection) # $v1, 0x8019 -/* 0AC0D0 800AB4D0 24010002 */ li $at, 2 -/* 0AC0D4 800AB4D4 1041005C */ beq $v0, $at, .L800AB648 -/* 0AC0D8 800AB4D8 3C0D8019 */ lui $t5, %hi(D_8018EDEC) # 0x8019 -/* 0AC0DC 800AB4DC 24030003 */ li $v1, 3 -/* 0AC0E0 800AB4E0 1043006A */ beq $v0, $v1, .L800AB68C -/* 0AC0E4 800AB4E4 3C198019 */ lui $t9, %hi(D_8018EDEC) # 0x8019 -/* 0AC0E8 800AB4E8 1000006F */ b .L800AB6A8 -/* 0AC0EC 800AB4EC 00000000 */ nop -/* 0AC0F0 800AB4F0 8CD9001C */ lw $t9, 0x1c($a2) -.L800AB4F4: -/* 0AC0F4 800AB4F4 2463EE09 */ addiu $v1, %lo(gCupSelection) # addiu $v1, $v1, -0x11f7 -/* 0AC0F8 800AB4F8 806B0000 */ lb $t3, ($v1) -/* 0AC0FC 800AB4FC 07210003 */ bgez $t9, .L800AB50C -/* 0AC100 800AB500 00195083 */ sra $t2, $t9, 2 -/* 0AC104 800AB504 27210003 */ addiu $at, $t9, 3 -/* 0AC108 800AB508 00015083 */ sra $t2, $at, 2 -.L800AB50C: -/* 0AC10C 800AB50C 554B0010 */ bnel $t2, $t3, .L800AB550 -/* 0AC110 800AB510 ACC00020 */ sw $zero, 0x20($a2) -/* 0AC114 800AB514 8CCC0020 */ lw $t4, 0x20($a2) -/* 0AC118 800AB518 24040001 */ li $a0, 1 -/* 0AC11C 800AB51C 258D0001 */ addiu $t5, $t4, 1 -/* 0AC120 800AB520 29A10033 */ slti $at, $t5, 0x33 -/* 0AC124 800AB524 14200007 */ bnez $at, .L800AB544 -/* 0AC128 800AB528 ACCD0020 */ sw $t5, 0x20($a2) -/* 0AC12C 800AB52C ACC40004 */ sw $a0, 4($a2) -/* 0AC130 800AB530 ACC00020 */ sw $zero, 0x20($a2) -/* 0AC134 800AB534 806F0000 */ lb $t7, ($v1) -/* 0AC138 800AB538 000FC080 */ sll $t8, $t7, 2 -/* 0AC13C 800AB53C 27190001 */ addiu $t9, $t8, 1 -/* 0AC140 800AB540 ACD9001C */ sw $t9, 0x1c($a2) -.L800AB544: -/* 0AC144 800AB544 10000006 */ b .L800AB560 -/* 0AC148 800AB548 24040001 */ li $a0, 1 -/* 0AC14C 800AB54C ACC00020 */ sw $zero, 0x20($a2) -.L800AB550: -/* 0AC150 800AB550 806A0000 */ lb $t2, ($v1) -/* 0AC154 800AB554 24040001 */ li $a0, 1 -/* 0AC158 800AB558 000A5880 */ sll $t3, $t2, 2 -/* 0AC15C 800AB55C ACCB001C */ sw $t3, 0x1c($a2) -.L800AB560: -/* 0AC160 800AB560 3C0C8019 */ lui $t4, %hi(D_8018EDEC) # $t4, 0x8019 -/* 0AC164 800AB564 818CEDEC */ lb $t4, %lo(D_8018EDEC)($t4) -/* 0AC168 800AB568 24030003 */ li $v1, 3 -/* 0AC16C 800AB56C 240D0002 */ li $t5, 2 -/* 0AC170 800AB570 146C0003 */ bne $v1, $t4, .L800AB580 -/* 0AC174 800AB574 00000000 */ nop -/* 0AC178 800AB578 ACCD0004 */ sw $t5, 4($a2) -/* 0AC17C 800AB57C ACC00020 */ sw $zero, 0x20($a2) -.L800AB580: -/* 0AC180 800AB580 10000049 */ b .L800AB6A8 -/* 0AC184 800AB584 8CC20004 */ lw $v0, 4($a2) -.L800AB588: -/* 0AC188 800AB588 8CCE001C */ lw $t6, 0x1c($a2) -/* 0AC18C 800AB58C 2463EE09 */ addiu $v1, $v1, %lo(gCupSelection) # -0x11f7 -/* 0AC190 800AB590 80780000 */ lb $t8, ($v1) -/* 0AC194 800AB594 05C10003 */ bgez $t6, .L800AB5A4 -/* 0AC198 800AB598 000E7883 */ sra $t7, $t6, 2 -/* 0AC19C 800AB59C 25C10003 */ addiu $at, $t6, 3 -/* 0AC1A0 800AB5A0 00017883 */ sra $t7, $at, 2 -.L800AB5A4: -/* 0AC1A4 800AB5A4 11F80006 */ beq $t7, $t8, .L800AB5C0 -/* 0AC1A8 800AB5A8 00001025 */ move $v0, $zero -/* 0AC1AC 800AB5AC ACC00004 */ sw $zero, 4($a2) -/* 0AC1B0 800AB5B0 ACC00020 */ sw $zero, 0x20($a2) -/* 0AC1B4 800AB5B4 ACC0001C */ sw $zero, 0x1c($a2) -/* 0AC1B8 800AB5B8 1000003B */ b .L800AB6A8 -/* 0AC1BC 800AB5BC 24030003 */ li $v1, 3 -.L800AB5C0: -/* 0AC1C0 800AB5C0 8CD90020 */ lw $t9, 0x20($a2) -/* 0AC1C4 800AB5C4 272A0001 */ addiu $t2, $t9, 1 -/* 0AC1C8 800AB5C8 2941001F */ slti $at, $t2, 0x1f -/* 0AC1CC 800AB5CC 14200015 */ bnez $at, .L800AB624 -/* 0AC1D0 800AB5D0 ACCA0020 */ sw $t2, 0x20($a2) -/* 0AC1D4 800AB5D4 8CCE001C */ lw $t6, 0x1c($a2) -/* 0AC1D8 800AB5D8 ACC00020 */ sw $zero, 0x20($a2) -/* 0AC1DC 800AB5DC 806C0000 */ lb $t4, ($v1) -/* 0AC1E0 800AB5E0 24030003 */ li $v1, 3 -/* 0AC1E4 800AB5E4 8CC20004 */ lw $v0, 4($a2) -/* 0AC1E8 800AB5E8 000C6880 */ sll $t5, $t4, 2 -/* 0AC1EC 800AB5EC 05C10004 */ bgez $t6, .L800AB600 -/* 0AC1F0 800AB5F0 31CF0003 */ andi $t7, $t6, 3 -/* 0AC1F4 800AB5F4 11E00002 */ beqz $t7, .L800AB600 -/* 0AC1F8 800AB5F8 00000000 */ nop -/* 0AC1FC 800AB5FC 25EFFFFC */ addiu $t7, $t7, -4 -.L800AB600: -/* 0AC200 800AB600 25F80001 */ addiu $t8, $t7, 1 -/* 0AC204 800AB604 07010004 */ bgez $t8, .L800AB618 -/* 0AC208 800AB608 33190003 */ andi $t9, $t8, 3 -/* 0AC20C 800AB60C 13200002 */ beqz $t9, .L800AB618 -/* 0AC210 800AB610 00000000 */ nop -/* 0AC214 800AB614 2739FFFC */ addiu $t9, $t9, -4 -.L800AB618: -/* 0AC218 800AB618 01B95021 */ addu $t2, $t5, $t9 -/* 0AC21C 800AB61C 10000022 */ b .L800AB6A8 -/* 0AC220 800AB620 ACCA001C */ sw $t2, 0x1c($a2) -.L800AB624: -/* 0AC224 800AB624 3C0B8019 */ lui $t3, %hi(D_8018EDEC) # $t3, 0x8019 -/* 0AC228 800AB628 816BEDEC */ lb $t3, %lo(D_8018EDEC)($t3) -/* 0AC22C 800AB62C 24030003 */ li $v1, 3 -/* 0AC230 800AB630 146B0003 */ bne $v1, $t3, .L800AB640 -/* 0AC234 800AB634 240C0002 */ li $t4, 2 -/* 0AC238 800AB638 ACCC0004 */ sw $t4, 4($a2) -/* 0AC23C 800AB63C ACC00020 */ sw $zero, 0x20($a2) -.L800AB640: -/* 0AC240 800AB640 10000019 */ b .L800AB6A8 -/* 0AC244 800AB644 8CC20004 */ lw $v0, 4($a2) -.L800AB648: -/* 0AC248 800AB648 8CCE0020 */ lw $t6, 0x20($a2) -/* 0AC24C 800AB64C 24030003 */ li $v1, 3 -/* 0AC250 800AB650 25CF0001 */ addiu $t7, $t6, 1 -/* 0AC254 800AB654 29E1001A */ slti $at, $t7, 0x1a -/* 0AC258 800AB658 14200003 */ bnez $at, .L800AB668 -/* 0AC25C 800AB65C ACCF0020 */ sw $t7, 0x20($a2) -/* 0AC260 800AB660 ACC30004 */ sw $v1, 4($a2) -/* 0AC264 800AB664 ACC00020 */ sw $zero, 0x20($a2) -.L800AB668: -/* 0AC268 800AB668 81ADEDEC */ lb $t5, %lo(D_8018EDEC)($t5) # -0x1214($t5) -/* 0AC26C 800AB66C 24030003 */ li $v1, 3 -/* 0AC270 800AB670 106D0004 */ beq $v1, $t5, .L800AB684 -/* 0AC274 800AB674 00000000 */ nop -/* 0AC278 800AB678 ACC00004 */ sw $zero, 4($a2) -/* 0AC27C 800AB67C ACC00020 */ sw $zero, 0x20($a2) -/* 0AC280 800AB680 ACC0001C */ sw $zero, 0x1c($a2) -.L800AB684: -/* 0AC284 800AB684 10000008 */ b .L800AB6A8 -/* 0AC288 800AB688 8CC20004 */ lw $v0, 4($a2) -.L800AB68C: -/* 0AC28C 800AB68C 8339EDEC */ lb $t9, %lo(D_8018EDEC)($t9) # -0x1214($t9) -/* 0AC290 800AB690 10790005 */ beq $v1, $t9, .L800AB6A8 -/* 0AC294 800AB694 00000000 */ nop -/* 0AC298 800AB698 ACC00004 */ sw $zero, 4($a2) -/* 0AC29C 800AB69C ACC00020 */ sw $zero, 0x20($a2) -/* 0AC2A0 800AB6A0 ACC0001C */ sw $zero, 0x1c($a2) -/* 0AC2A4 800AB6A4 00001025 */ move $v0, $zero -.L800AB6A8: -/* 0AC2A8 800AB6A8 5040000A */ beql $v0, $zero, .L800AB6D4 -/* 0AC2AC 800AB6AC 8CCA001C */ lw $t2, 0x1c($a2) -/* 0AC2B0 800AB6B0 10440007 */ beq $v0, $a0, .L800AB6D0 -/* 0AC2B4 800AB6B4 24010002 */ li $at, 2 -/* 0AC2B8 800AB6B8 10410042 */ beq $v0, $at, .L800AB7C4 -/* 0AC2BC 800AB6BC 00002825 */ move $a1, $zero -/* 0AC2C0 800AB6C0 1043007C */ beq $v0, $v1, .L800AB8B4 -/* 0AC2C4 800AB6C4 8FAD0024 */ lw $t5, 0x24($sp) -/* 0AC2C8 800AB6C8 1000008B */ b .L800AB8F8 -/* 0AC2CC 800AB6CC 8FBF0014 */ lw $ra, 0x14($sp) -.L800AB6D0: -/* 0AC2D0 800AB6D0 8CCA001C */ lw $t2, 0x1c($a2) -.L800AB6D4: -/* 0AC2D4 800AB6D4 8FAC0024 */ lw $t4, 0x24($sp) -/* 0AC2D8 800AB6D8 8FAE0024 */ lw $t6, 0x24($sp) -/* 0AC2DC 800AB6DC 314B0003 */ andi $t3, $t2, 3 -/* 0AC2E0 800AB6E0 55600004 */ bnel $t3, $zero, .L800AB6F4 -/* 0AC2E4 800AB6E4 A1C00015 */ sb $zero, 0x15($t6) -/* 0AC2E8 800AB6E8 10000002 */ b .L800AB6F4 -/* 0AC2EC 800AB6EC A1840015 */ sb $a0, 0x15($t4) -/* 0AC2F0 800AB6F0 A1C00015 */ sb $zero, 0x15($t6) -.L800AB6F4: -/* 0AC2F4 800AB6F4 8FAF0024 */ lw $t7, 0x24($sp) -/* 0AC2F8 800AB6F8 24020006 */ li $v0, 6 -/* 0AC2FC 800AB6FC 24010001 */ li $at, 1 -/* 0AC300 800AB700 A1E20014 */ sb $v0, 0x14($t7) -/* 0AC304 800AB704 8CD8001C */ lw $t8, 0x1c($a2) -/* 0AC308 800AB708 8FAA0028 */ lw $t2, 0x28($sp) -/* 0AC30C 800AB70C 8FB90028 */ lw $t9, 0x28($sp) -/* 0AC310 800AB710 07010004 */ bgez $t8, .L800AB724 -/* 0AC314 800AB714 330D0003 */ andi $t5, $t8, 3 -/* 0AC318 800AB718 11A00002 */ beqz $t5, .L800AB724 -/* 0AC31C 800AB71C 00000000 */ nop -/* 0AC320 800AB720 25ADFFFC */ addiu $t5, $t5, -4 -.L800AB724: -/* 0AC324 800AB724 55A10004 */ bnel $t5, $at, .L800AB738 -/* 0AC328 800AB728 A1400015 */ sb $zero, 0x15($t2) -/* 0AC32C 800AB72C 10000002 */ b .L800AB738 -/* 0AC330 800AB730 A3240015 */ sb $a0, 0x15($t9) -/* 0AC334 800AB734 A1400015 */ sb $zero, 0x15($t2) -.L800AB738: -/* 0AC338 800AB738 8FAB0028 */ lw $t3, 0x28($sp) -/* 0AC33C 800AB73C 24010002 */ li $at, 2 -/* 0AC340 800AB740 A1620014 */ sb $v0, 0x14($t3) -/* 0AC344 800AB744 8CCC001C */ lw $t4, 0x1c($a2) -/* 0AC348 800AB748 8FB8002C */ lw $t8, 0x2c($sp) -/* 0AC34C 800AB74C 8FAF002C */ lw $t7, 0x2c($sp) -/* 0AC350 800AB750 05810004 */ bgez $t4, .L800AB764 -/* 0AC354 800AB754 318E0003 */ andi $t6, $t4, 3 -/* 0AC358 800AB758 11C00002 */ beqz $t6, .L800AB764 -/* 0AC35C 800AB75C 00000000 */ nop -/* 0AC360 800AB760 25CEFFFC */ addiu $t6, $t6, -4 -.L800AB764: -/* 0AC364 800AB764 55C10004 */ bnel $t6, $at, .L800AB778 -/* 0AC368 800AB768 A3000015 */ sb $zero, 0x15($t8) -/* 0AC36C 800AB76C 10000002 */ b .L800AB778 -/* 0AC370 800AB770 A1E40015 */ sb $a0, 0x15($t7) -/* 0AC374 800AB774 A3000015 */ sb $zero, 0x15($t8) -.L800AB778: -/* 0AC378 800AB778 8FAD002C */ lw $t5, 0x2c($sp) -/* 0AC37C 800AB77C 24010003 */ li $at, 3 -/* 0AC380 800AB780 A1A20014 */ sb $v0, 0x14($t5) -/* 0AC384 800AB784 8CD9001C */ lw $t9, 0x1c($a2) -/* 0AC388 800AB788 8FAC0030 */ lw $t4, 0x30($sp) -/* 0AC38C 800AB78C 8FAB0030 */ lw $t3, 0x30($sp) -/* 0AC390 800AB790 07210004 */ bgez $t9, .L800AB7A4 -/* 0AC394 800AB794 332A0003 */ andi $t2, $t9, 3 -/* 0AC398 800AB798 11400002 */ beqz $t2, .L800AB7A4 -/* 0AC39C 800AB79C 00000000 */ nop -/* 0AC3A0 800AB7A0 254AFFFC */ addiu $t2, $t2, -4 -.L800AB7A4: -/* 0AC3A4 800AB7A4 55410004 */ bnel $t2, $at, .L800AB7B8 -/* 0AC3A8 800AB7A8 A1800015 */ sb $zero, 0x15($t4) -/* 0AC3AC 800AB7AC 10000002 */ b .L800AB7B8 -/* 0AC3B0 800AB7B0 A1640015 */ sb $a0, 0x15($t3) -/* 0AC3B4 800AB7B4 A1800015 */ sb $zero, 0x15($t4) -.L800AB7B8: -/* 0AC3B8 800AB7B8 8FAE0030 */ lw $t6, 0x30($sp) -/* 0AC3BC 800AB7BC 1000004D */ b .L800AB8F4 -/* 0AC3C0 800AB7C0 A1C20014 */ sb $v0, 0x14($t6) -.L800AB7C4: -/* 0AC3C4 800AB7C4 27A30024 */ addiu $v1, $sp, 0x24 -/* 0AC3C8 800AB7C8 24090008 */ li $t1, 8 -/* 0AC3CC 800AB7CC 24080005 */ li $t0, 5 -/* 0AC3D0 800AB7D0 24070004 */ li $a3, 4 -/* 0AC3D4 800AB7D4 24020006 */ li $v0, 6 -.L800AB7D8: -/* 0AC3D8 800AB7D8 8CCF001C */ lw $t7, 0x1c($a2) -/* 0AC3DC 800AB7DC 05E10004 */ bgez $t7, .L800AB7F0 -/* 0AC3E0 800AB7E0 31F80003 */ andi $t8, $t7, 3 -/* 0AC3E4 800AB7E4 13000002 */ beqz $t8, .L800AB7F0 -/* 0AC3E8 800AB7E8 00000000 */ nop -/* 0AC3EC 800AB7EC 2718FFFC */ addiu $t8, $t8, -4 -.L800AB7F0: -/* 0AC3F0 800AB7F0 14B80004 */ bne $a1, $t8, .L800AB804 -/* 0AC3F4 800AB7F4 00000000 */ nop -/* 0AC3F8 800AB7F8 8C6D0000 */ lw $t5, ($v1) -/* 0AC3FC 800AB7FC 1000000C */ b .L800AB830 -/* 0AC400 800AB800 A1A20014 */ sb $v0, 0x14($t5) -.L800AB804: -/* 0AC404 800AB804 00A80019 */ multu $a1, $t0 -/* 0AC408 800AB808 8CD90020 */ lw $t9, 0x20($a2) -/* 0AC40C 800AB80C 00005012 */ mflo $t2 -/* 0AC410 800AB810 032A082A */ slt $at, $t9, $t2 -/* 0AC414 800AB814 50200005 */ beql $at, $zero, .L800AB82C -/* 0AC418 800AB818 8C6C0000 */ lw $t4, ($v1) -/* 0AC41C 800AB81C 8C6B0000 */ lw $t3, ($v1) -/* 0AC420 800AB820 10000003 */ b .L800AB830 -/* 0AC424 800AB824 A1670014 */ sb $a3, 0x14($t3) -/* 0AC428 800AB828 8C6C0000 */ lw $t4, ($v1) -.L800AB82C: -/* 0AC42C 800AB82C A1890014 */ sb $t1, 0x14($t4) -.L800AB830: -/* 0AC430 800AB830 8C6E0000 */ lw $t6, ($v1) -/* 0AC434 800AB834 24AF0001 */ addiu $t7, $a1, 1 -/* 0AC438 800AB838 A1C40015 */ sb $a0, 0x15($t6) -/* 0AC43C 800AB83C 8CD8001C */ lw $t8, 0x1c($a2) -/* 0AC440 800AB840 07010004 */ bgez $t8, .L800AB854 -/* 0AC444 800AB844 330D0003 */ andi $t5, $t8, 3 -/* 0AC448 800AB848 11A00002 */ beqz $t5, .L800AB854 -/* 0AC44C 800AB84C 00000000 */ nop -/* 0AC450 800AB850 25ADFFFC */ addiu $t5, $t5, -4 -.L800AB854: -/* 0AC454 800AB854 15ED0004 */ bne $t7, $t5, .L800AB868 -/* 0AC458 800AB858 00000000 */ nop -/* 0AC45C 800AB85C 8C790004 */ lw $t9, 4($v1) -/* 0AC460 800AB860 1000000D */ b .L800AB898 -/* 0AC464 800AB864 A3220014 */ sb $v0, 0x14($t9) -.L800AB868: -/* 0AC468 800AB868 00A80019 */ multu $a1, $t0 -/* 0AC46C 800AB86C 8CCA0020 */ lw $t2, 0x20($a2) -/* 0AC470 800AB870 00005812 */ mflo $t3 -/* 0AC474 800AB874 256C0005 */ addiu $t4, $t3, 5 -/* 0AC478 800AB878 014C082A */ slt $at, $t2, $t4 -/* 0AC47C 800AB87C 50200005 */ beql $at, $zero, .L800AB894 -/* 0AC480 800AB880 8C780004 */ lw $t8, 4($v1) -/* 0AC484 800AB884 8C6E0004 */ lw $t6, 4($v1) -/* 0AC488 800AB888 10000003 */ b .L800AB898 -/* 0AC48C 800AB88C A1C70014 */ sb $a3, 0x14($t6) -/* 0AC490 800AB890 8C780004 */ lw $t8, 4($v1) -.L800AB894: -/* 0AC494 800AB894 A3090014 */ sb $t1, 0x14($t8) -.L800AB898: -/* 0AC498 800AB898 8C6F0004 */ lw $t7, 4($v1) -/* 0AC49C 800AB89C 24A50002 */ addiu $a1, $a1, 2 -/* 0AC4A0 800AB8A0 24630008 */ addiu $v1, $v1, 8 -/* 0AC4A4 800AB8A4 14A7FFCC */ bne $a1, $a3, .L800AB7D8 -/* 0AC4A8 800AB8A8 A1E40015 */ sb $a0, 0x15($t7) -/* 0AC4AC 800AB8AC 10000012 */ b .L800AB8F8 -/* 0AC4B0 800AB8B0 8FBF0014 */ lw $ra, 0x14($sp) -.L800AB8B4: -/* 0AC4B4 800AB8B4 A1A40015 */ sb $a0, 0x15($t5) -/* 0AC4B8 800AB8B8 8FB90024 */ lw $t9, 0x24($sp) -/* 0AC4BC 800AB8BC 24020006 */ li $v0, 6 -/* 0AC4C0 800AB8C0 A3220014 */ sb $v0, 0x14($t9) -/* 0AC4C4 800AB8C4 8FAB0028 */ lw $t3, 0x28($sp) -/* 0AC4C8 800AB8C8 A1640015 */ sb $a0, 0x15($t3) -/* 0AC4CC 800AB8CC 8FAA0028 */ lw $t2, 0x28($sp) -/* 0AC4D0 800AB8D0 A1420014 */ sb $v0, 0x14($t2) -/* 0AC4D4 800AB8D4 8FAC002C */ lw $t4, 0x2c($sp) -/* 0AC4D8 800AB8D8 A1840015 */ sb $a0, 0x15($t4) -/* 0AC4DC 800AB8DC 8FAE002C */ lw $t6, 0x2c($sp) -/* 0AC4E0 800AB8E0 A1C20014 */ sb $v0, 0x14($t6) -/* 0AC4E4 800AB8E4 8FB80030 */ lw $t8, 0x30($sp) -/* 0AC4E8 800AB8E8 A3040015 */ sb $a0, 0x15($t8) -/* 0AC4EC 800AB8EC 8FAF0030 */ lw $t7, 0x30($sp) -/* 0AC4F0 800AB8F0 A1E20014 */ sb $v0, 0x14($t7) -.L800AB8F4: -/* 0AC4F4 800AB8F4 8FBF0014 */ lw $ra, 0x14($sp) -.L800AB8F8: -/* 0AC4F8 800AB8F8 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0AC4FC 800AB8FC 03E00008 */ jr $ra -/* 0AC500 800AB900 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_800AC458.s b/asm/non_matchings/code_80091750/func_800AC458.s deleted file mode 100644 index 9b3a8d883d..0000000000 --- a/asm/non_matchings/code_80091750/func_800AC458.s +++ /dev/null @@ -1,367 +0,0 @@ -.section .late_rodata - -glabel jpt_800F2688 -.word L800AC488, L800AC4EC, L800AC580, L800AC5D0 -.word L800AC5D0, L800AC5D0, L800AC5D0, L800AC738 -.word L800AC78C, L800AC7CC, L800AC878, L800AC8A0 -.word L800AC8E0, L800AC968 - -.section .text - -glabel func_800AC458 -/* 0AD058 800AC458 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0AD05C 800AC45C AFBF0014 */ sw $ra, 0x14($sp) -/* 0AD060 800AC460 8C820004 */ lw $v0, 4($a0) -/* 0AD064 800AC464 00803825 */ move $a3, $a0 -/* 0AD068 800AC468 2C41000E */ sltiu $at, $v0, 0xe -/* 0AD06C 800AC46C 1020013E */ beqz $at, .L800AC968 -/* 0AD070 800AC470 00027080 */ sll $t6, $v0, 2 -/* 0AD074 800AC474 3C01800F */ lui $at, %hi(jpt_800F2688) -/* 0AD078 800AC478 002E0821 */ addu $at, $at, $t6 -/* 0AD07C 800AC47C 8C2E2688 */ lw $t6, %lo(jpt_800F2688)($at) -/* 0AD080 800AC480 01C00008 */ jr $t6 -/* 0AD084 800AC484 00000000 */ nop -glabel L800AC488 -/* 0AD088 800AC488 240FFF60 */ li $t7, -160 -/* 0AD08C 800AC48C 24180001 */ li $t8, 1 -/* 0AD090 800AC490 ACEF000C */ sw $t7, 0xc($a3) -/* 0AD094 800AC494 ACF80004 */ sw $t8, 4($a3) -/* 0AD098 800AC498 3C028019 */ lui $v0, %hi(D_8018D9BC) # $v0, 0x8019 -/* 0AD09C 800AC49C 2442D9BC */ addiu $v0, %lo(D_8018D9BC) # addiu $v0, $v0, -0x2644 -/* 0AD0A0 800AC4A0 3C19800F */ lui $t9, %hi(gGPPointRewards) # $t9, 0x800f -/* 0AD0A4 800AC4A4 83390B18 */ lb $t9, %lo(gGPPointRewards)($t9) -/* 0AD0A8 800AC4A8 8C4A0000 */ lw $t2, ($v0) -/* 0AD0AC 800AC4AC 3C0B800F */ lui $t3, %hi(gGPPointRewards + 1) # $t3, 0x800f -/* 0AD0B0 800AC4B0 3C0D800F */ lui $t5, %hi(gGPPointRewards + 2) # $t5, 0x800f -/* 0AD0B4 800AC4B4 A1590000 */ sb $t9, ($t2) -/* 0AD0B8 800AC4B8 8C4C0000 */ lw $t4, ($v0) -/* 0AD0BC 800AC4BC 816B0B19 */ lb $t3, %lo(gGPPointRewards + 1)($t3) -/* 0AD0C0 800AC4C0 3C0F800F */ lui $t7, %hi(gGPPointRewards + 3) # $t7, 0x800f -/* 0AD0C4 800AC4C4 A18B0001 */ sb $t3, 1($t4) -/* 0AD0C8 800AC4C8 8C4E0000 */ lw $t6, ($v0) -/* 0AD0CC 800AC4CC 81AD0B1A */ lb $t5, %lo(gGPPointRewards + 2)($t5) -/* 0AD0D0 800AC4D0 A1CD0002 */ sb $t5, 2($t6) -/* 0AD0D4 800AC4D4 8C580000 */ lw $t8, ($v0) -/* 0AD0D8 800AC4D8 81EF0B1B */ lb $t7, %lo(gGPPointRewards + 3)($t7) -/* 0AD0DC 800AC4DC A30F0003 */ sb $t7, 3($t8) -/* 0AD0E0 800AC4E0 8CF9000C */ lw $t9, 0xc($a3) -/* 0AD0E4 800AC4E4 10000120 */ b .L800AC968 -/* 0AD0E8 800AC4E8 ACF90020 */ sw $t9, 0x20($a3) -glabel L800AC4EC -/* 0AD0EC 800AC4EC 8CE50020 */ lw $a1, 0x20($a3) -/* 0AD0F0 800AC4F0 3C0A8019 */ lui $t2, %hi(D_8018D9D8) # $t2, 0x8019 -/* 0AD0F4 800AC4F4 24040010 */ li $a0, 16 -/* 0AD0F8 800AC4F8 ACE5000C */ sw $a1, 0xc($a3) -/* 0AD0FC 800AC4FC 814AD9D8 */ lb $t2, %lo(D_8018D9D8)($t2) -/* 0AD100 800AC500 3C02800E */ lui $v0, %hi(D_800DC5EC) # $v0, 0x800e -/* 0AD104 800AC504 240F0002 */ li $t7, 2 -/* 0AD108 800AC508 11400003 */ beqz $t2, .L800AC518 -/* 0AD10C 800AC50C 3C19800E */ lui $t9, %hi(D_800DC5EC) # $t9, 0x800e -/* 0AD110 800AC510 10000001 */ b .L800AC518 -/* 0AD114 800AC514 24040020 */ li $a0, 32 -.L800AC518: -/* 0AD118 800AC518 00A43021 */ addu $a2, $a1, $a0 -/* 0AD11C 800AC51C 04C3000D */ bgezl $a2, .L800AC554 -/* 0AD120 800AC520 ACE00020 */ sw $zero, 0x20($a3) -/* 0AD124 800AC524 ACE60020 */ sw $a2, 0x20($a3) -/* 0AD128 800AC528 8C42C5EC */ lw $v0, %lo(D_800DC5EC)($v0) -/* 0AD12C 800AC52C 3C03800E */ lui $v1, %hi(D_800DC5F0) # $v1, 0x800e -/* 0AD130 800AC530 844B0030 */ lh $t3, 0x30($v0) -/* 0AD134 800AC534 01646021 */ addu $t4, $t3, $a0 -/* 0AD138 800AC538 A44C0030 */ sh $t4, 0x30($v0) -/* 0AD13C 800AC53C 8C63C5F0 */ lw $v1, %lo(D_800DC5F0)($v1) -/* 0AD140 800AC540 846D0030 */ lh $t5, 0x30($v1) -/* 0AD144 800AC544 01A47023 */ subu $t6, $t5, $a0 -/* 0AD148 800AC548 10000107 */ b .L800AC968 -/* 0AD14C 800AC54C A46E0030 */ sh $t6, 0x30($v1) -/* 0AD150 800AC550 ACE00020 */ sw $zero, 0x20($a3) -.L800AC554: -/* 0AD154 800AC554 ACE0000C */ sw $zero, 0xc($a3) -/* 0AD158 800AC558 ACEF0004 */ sw $t7, 4($a3) -/* 0AD15C 800AC55C ACE0001C */ sw $zero, 0x1c($a3) -/* 0AD160 800AC560 8F39C5EC */ lw $t9, %lo(D_800DC5EC)($t9) -/* 0AD164 800AC564 241800F0 */ li $t8, 240 -/* 0AD168 800AC568 3C0B800E */ lui $t3, %hi(D_800DC5F0) # $t3, 0x800e -/* 0AD16C 800AC56C A7380030 */ sh $t8, 0x30($t9) -/* 0AD170 800AC570 8D6BC5F0 */ lw $t3, %lo(D_800DC5F0)($t3) -/* 0AD174 800AC574 240A0050 */ li $t2, 80 -/* 0AD178 800AC578 100000FB */ b .L800AC968 -/* 0AD17C 800AC57C A56A0030 */ sh $t2, 0x30($t3) -glabel L800AC580 -/* 0AD180 800AC580 8CEC001C */ lw $t4, 0x1c($a3) -/* 0AD184 800AC584 ACE0000C */ sw $zero, 0xc($a3) -/* 0AD188 800AC588 3C0E8019 */ lui $t6, %hi(D_8018D9D8) # $t6, 0x8019 -/* 0AD18C 800AC58C 258D0001 */ addiu $t5, $t4, 1 -/* 0AD190 800AC590 ACED001C */ sw $t5, 0x1c($a3) -/* 0AD194 800AC594 81CED9D8 */ lb $t6, %lo(D_8018D9D8)($t6) -/* 0AD198 800AC598 29A1001F */ slti $at, $t5, 0x1f -/* 0AD19C 800AC59C 3C18800E */ lui $t8, %hi(D_800DDB24) # $t8, 0x800e -/* 0AD1A0 800AC5A0 15C00003 */ bnez $t6, .L800AC5B0 -/* 0AD1A4 800AC5A4 00000000 */ nop -/* 0AD1A8 800AC5A8 542000F0 */ bnel $at, $zero, .L800AC96C -/* 0AD1AC 800AC5AC 8FBF0014 */ lw $ra, 0x14($sp) -.L800AC5B0: -/* 0AD1B0 800AC5B0 8F18DB24 */ lw $t8, %lo(D_800DDB24)($t8) -/* 0AD1B4 800AC5B4 24190003 */ li $t9, 3 -/* 0AD1B8 800AC5B8 530000EC */ beql $t8, $zero, .L800AC96C -/* 0AD1BC 800AC5BC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD1C0 800AC5C0 ACF90004 */ sw $t9, 4($a3) -/* 0AD1C4 800AC5C4 ACE0001C */ sw $zero, 0x1c($a3) -/* 0AD1C8 800AC5C8 100000E7 */ b .L800AC968 -/* 0AD1CC 800AC5CC ACE00020 */ sw $zero, 0x20($a3) -glabel L800AC5D0 -/* 0AD1D0 800AC5D0 8CEA001C */ lw $t2, 0x1c($a3) -/* 0AD1D4 800AC5D4 24010003 */ li $at, 3 -/* 0AD1D8 800AC5D8 00004825 */ move $t1, $zero -/* 0AD1DC 800AC5DC 254B0001 */ addiu $t3, $t2, 1 -/* 0AD1E0 800AC5E0 0161001A */ div $zero, $t3, $at -/* 0AD1E4 800AC5E4 00006810 */ mfhi $t5 -/* 0AD1E8 800AC5E8 2445FFFD */ addiu $a1, $v0, -3 -/* 0AD1EC 800AC5EC 11A00004 */ beqz $t5, .L800AC600 -/* 0AD1F0 800AC5F0 ACEB001C */ sw $t3, 0x1c($a3) -/* 0AD1F4 800AC5F4 3C0E8019 */ lui $t6, %hi(D_8018D9D8) # $t6, 0x8019 -/* 0AD1F8 800AC5F8 81CED9D8 */ lb $t6, %lo(D_8018D9D8)($t6) -/* 0AD1FC 800AC5FC 11C00032 */ beqz $t6, .L800AC6C8 -.L800AC600: -/* 0AD200 800AC600 3C028019 */ lui $v0, %hi(D_8018D9BC) # $v0, 0x8019 -/* 0AD204 800AC604 2442D9BC */ addiu $v0, %lo(D_8018D9BC) # addiu $v0, $v0, -0x2644 -/* 0AD208 800AC608 8C4F0000 */ lw $t7, ($v0) -/* 0AD20C 800AC60C 0005C840 */ sll $t9, $a1, 1 -/* 0AD210 800AC610 3C0A8016 */ lui $t2, %hi(gGPCurrentRacePlayerIdByRank) # 0x8016 -/* 0AD214 800AC614 01E53021 */ addu $a2, $t7, $a1 -/* 0AD218 800AC618 90C80000 */ lbu $t0, ($a2) -/* 0AD21C 800AC61C 01595021 */ addu $t2, $t2, $t9 -/* 0AD220 800AC620 3C0C800F */ lui $t4, %hi(gPlayers+0x254) # 0x800f -/* 0AD224 800AC624 19000028 */ blez $t0, .L800AC6C8 -/* 0AD228 800AC628 2518FFFF */ addiu $t8, $t0, -1 -/* 0AD22C 800AC62C A0D80000 */ sb $t8, ($a2) -/* 0AD230 800AC630 854A4360 */ lh $t2, %lo(gGPCurrentRacePlayerIdByRank)($t2) # 0x4360($t2) -/* 0AD234 800AC634 3C0D8019 */ lui $t5, %hi(gGPPointsByCharacterId) # $t5, 0x8019 -/* 0AD238 800AC638 25ADD9C8 */ addiu $t5, %lo(gGPPointsByCharacterId) # addiu $t5, $t5, -0x2638 -/* 0AD23C 800AC63C 000A58C0 */ sll $t3, $t2, 3 -/* 0AD240 800AC640 016A5823 */ subu $t3, $t3, $t2 -/* 0AD244 800AC644 000B5900 */ sll $t3, $t3, 4 -/* 0AD248 800AC648 016A5823 */ subu $t3, $t3, $t2 -/* 0AD24C 800AC64C 000B5880 */ sll $t3, $t3, 2 -/* 0AD250 800AC650 016A5823 */ subu $t3, $t3, $t2 -/* 0AD254 800AC654 000B58C0 */ sll $t3, $t3, 3 -/* 0AD258 800AC658 018B6021 */ addu $t4, $t4, $t3 -/* 0AD25C 800AC65C 958C6BE4 */ lhu $t4, %lo(gPlayers+0x254)($t4) # 0x6be4($t4) -/* 0AD260 800AC660 3C044900 */ lui $a0, (0x49008017 >> 16) # lui $a0, 0x4900 -/* 0AD264 800AC664 34848017 */ ori $a0, (0x49008017 & 0xFFFF) # ori $a0, $a0, 0x8017 -/* 0AD268 800AC668 018D1821 */ addu $v1, $t4, $t5 -/* 0AD26C 800AC66C 806E0000 */ lb $t6, ($v1) -/* 0AD270 800AC670 AFA90018 */ sw $t1, 0x18($sp) -/* 0AD274 800AC674 AFA70020 */ sw $a3, 0x20($sp) -/* 0AD278 800AC678 25CF0001 */ addiu $t7, $t6, 1 -/* 0AD27C 800AC67C A06F0000 */ sb $t7, ($v1) -/* 0AD280 800AC680 0C032384 */ jal play_sound2 -/* 0AD284 800AC684 AFA5001C */ sw $a1, 0x1c($sp) -/* 0AD288 800AC688 3C028019 */ lui $v0, %hi(D_8018D9BC) # $v0, 0x8019 -/* 0AD28C 800AC68C 2442D9BC */ addiu $v0, %lo(D_8018D9BC) # addiu $v0, $v0, -0x2644 -/* 0AD290 800AC690 8FA5001C */ lw $a1, 0x1c($sp) -/* 0AD294 800AC694 8C580000 */ lw $t8, ($v0) -/* 0AD298 800AC698 8FA70020 */ lw $a3, 0x20($sp) -/* 0AD29C 800AC69C 8FA90018 */ lw $t1, 0x18($sp) -/* 0AD2A0 800AC6A0 0305C821 */ addu $t9, $t8, $a1 -/* 0AD2A4 800AC6A4 932A0000 */ lbu $t2, ($t9) -/* 0AD2A8 800AC6A8 55400008 */ bnel $t2, $zero, .L800AC6CC -/* 0AD2AC 800AC6AC 8CED0020 */ lw $t5, 0x20($a3) -/* 0AD2B0 800AC6B0 8CEB0020 */ lw $t3, 0x20($a3) -/* 0AD2B4 800AC6B4 240C0001 */ li $t4, 1 -/* 0AD2B8 800AC6B8 55600004 */ bnel $t3, $zero, .L800AC6CC -/* 0AD2BC 800AC6BC 8CED0020 */ lw $t5, 0x20($a3) -/* 0AD2C0 800AC6C0 ACEC0020 */ sw $t4, 0x20($a3) -/* 0AD2C4 800AC6C4 ACE0001C */ sw $zero, 0x1c($a3) -.L800AC6C8: -/* 0AD2C8 800AC6C8 8CED0020 */ lw $t5, 0x20($a3) -.L800AC6CC: -/* 0AD2CC 800AC6CC 11A0000D */ beqz $t5, .L800AC704 -/* 0AD2D0 800AC6D0 00000000 */ nop -/* 0AD2D4 800AC6D4 8CE2001C */ lw $v0, 0x1c($a3) -/* 0AD2D8 800AC6D8 3C0E8019 */ lui $t6, %hi(D_8018D9D8) # $t6, 0x8019 -/* 0AD2DC 800AC6DC 2841000B */ slti $at, $v0, 0xb -/* 0AD2E0 800AC6E0 50200008 */ beql $at, $zero, .L800AC704 -/* 0AD2E4 800AC6E4 24090001 */ li $t1, 1 -/* 0AD2E8 800AC6E8 81CED9D8 */ lb $t6, %lo(D_8018D9D8)($t6) -/* 0AD2EC 800AC6EC 28410004 */ slti $at, $v0, 4 -/* 0AD2F0 800AC6F0 11C00004 */ beqz $t6, .L800AC704 -/* 0AD2F4 800AC6F4 00000000 */ nop -/* 0AD2F8 800AC6F8 14200002 */ bnez $at, .L800AC704 -/* 0AD2FC 800AC6FC 00000000 */ nop -/* 0AD300 800AC700 24090001 */ li $t1, 1 -.L800AC704: -/* 0AD304 800AC704 51200099 */ beql $t1, $zero, .L800AC96C -/* 0AD308 800AC708 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD30C 800AC70C 8CE20004 */ lw $v0, 4($a3) -/* 0AD310 800AC710 ACE00020 */ sw $zero, 0x20($a3) -/* 0AD314 800AC714 ACE0001C */ sw $zero, 0x1c($a3) -/* 0AD318 800AC718 28410006 */ slti $at, $v0, 6 -/* 0AD31C 800AC71C 10200004 */ beqz $at, .L800AC730 -/* 0AD320 800AC720 24180007 */ li $t8, 7 -/* 0AD324 800AC724 244F0001 */ addiu $t7, $v0, 1 -/* 0AD328 800AC728 1000008F */ b .L800AC968 -/* 0AD32C 800AC72C ACEF0004 */ sw $t7, 4($a3) -.L800AC730: -/* 0AD330 800AC730 1000008D */ b .L800AC968 -/* 0AD334 800AC734 ACF80004 */ sw $t8, 4($a3) -glabel L800AC738 -/* 0AD338 800AC738 8CF9001C */ lw $t9, 0x1c($a3) -/* 0AD33C 800AC73C 3C0B8019 */ lui $t3, %hi(D_8018D9D8) # $t3, 0x8019 -/* 0AD340 800AC740 272A0001 */ addiu $t2, $t9, 1 -/* 0AD344 800AC744 ACEA001C */ sw $t2, 0x1c($a3) -/* 0AD348 800AC748 816BD9D8 */ lb $t3, %lo(D_8018D9D8)($t3) -/* 0AD34C 800AC74C 2941000B */ slti $at, $t2, 0xb -/* 0AD350 800AC750 51600004 */ beql $t3, $zero, .L800AC764 -/* 0AD354 800AC754 8CED001C */ lw $t5, 0x1c($a3) -/* 0AD358 800AC758 10200004 */ beqz $at, .L800AC76C -/* 0AD35C 800AC75C 00000000 */ nop -/* 0AD360 800AC760 8CED001C */ lw $t5, 0x1c($a3) -.L800AC764: -/* 0AD364 800AC764 29A1003D */ slti $at, $t5, 0x3d -/* 0AD368 800AC768 1420007F */ bnez $at, .L800AC968 -.L800AC76C: -/* 0AD36C 800AC76C 3C0E800E */ lui $t6, %hi(D_800DDB24) # $t6, 0x800e -/* 0AD370 800AC770 8DCEDB24 */ lw $t6, %lo(D_800DDB24)($t6) -/* 0AD374 800AC774 24060008 */ li $a2, 8 -/* 0AD378 800AC778 51C0007C */ beql $t6, $zero, .L800AC96C -/* 0AD37C 800AC77C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD380 800AC780 ACE60004 */ sw $a2, 4($a3) -/* 0AD384 800AC784 10000078 */ b .L800AC968 -/* 0AD388 800AC788 ACE0001C */ sw $zero, 0x1c($a3) -glabel L800AC78C -/* 0AD38C 800AC78C 8CEF001C */ lw $t7, 0x1c($a3) -/* 0AD390 800AC790 3C198019 */ lui $t9, %hi(D_8018D9D8) # $t9, 0x8019 -/* 0AD394 800AC794 240D0009 */ li $t5, 9 -/* 0AD398 800AC798 25F80001 */ addiu $t8, $t7, 1 -/* 0AD39C 800AC79C ACF8001C */ sw $t8, 0x1c($a3) -/* 0AD3A0 800AC7A0 8339D9D8 */ lb $t9, %lo(D_8018D9D8)($t9) -/* 0AD3A4 800AC7A4 270B0005 */ addiu $t3, $t8, 5 -/* 0AD3A8 800AC7A8 53200003 */ beql $t9, $zero, .L800AC7B8 -/* 0AD3AC 800AC7AC 8CEC001C */ lw $t4, 0x1c($a3) -/* 0AD3B0 800AC7B0 ACEB001C */ sw $t3, 0x1c($a3) -/* 0AD3B4 800AC7B4 8CEC001C */ lw $t4, 0x1c($a3) -.L800AC7B8: -/* 0AD3B8 800AC7B8 29810029 */ slti $at, $t4, 0x29 -/* 0AD3BC 800AC7BC 5420006B */ bnel $at, $zero, .L800AC96C -/* 0AD3C0 800AC7C0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD3C4 800AC7C4 10000068 */ b .L800AC968 -/* 0AD3C8 800AC7C8 ACED0004 */ sw $t5, 4($a3) -glabel L800AC7CC -/* 0AD3CC 800AC7CC 8CEE001C */ lw $t6, 0x1c($a3) -/* 0AD3D0 800AC7D0 3C188019 */ lui $t8, %hi(D_8018D9D8) # $t8, 0x8019 -/* 0AD3D4 800AC7D4 240C000A */ li $t4, 10 -/* 0AD3D8 800AC7D8 25CFFFFF */ addiu $t7, $t6, -1 -/* 0AD3DC 800AC7DC ACEF001C */ sw $t7, 0x1c($a3) -/* 0AD3E0 800AC7E0 8318D9D8 */ lb $t8, %lo(D_8018D9D8)($t8) -/* 0AD3E4 800AC7E4 25EAFFFB */ addiu $t2, $t7, -5 -/* 0AD3E8 800AC7E8 3C0D8019 */ lui $t5, %hi(gCourseIndexInCup) # $t5, 0x8019 -/* 0AD3EC 800AC7EC 53000003 */ beql $t8, $zero, .L800AC7FC -/* 0AD3F0 800AC7F0 8CEB001C */ lw $t3, 0x1c($a3) -/* 0AD3F4 800AC7F4 ACEA001C */ sw $t2, 0x1c($a3) -/* 0AD3F8 800AC7F8 8CEB001C */ lw $t3, 0x1c($a3) -.L800AC7FC: -/* 0AD3FC 800AC7FC 5D60005B */ bgtzl $t3, .L800AC96C -/* 0AD400 800AC800 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD404 800AC804 ACEC0004 */ sw $t4, 4($a3) -/* 0AD408 800AC808 ACE0001C */ sw $zero, 0x1c($a3) -/* 0AD40C 800AC80C 81ADEE0B */ lb $t5, %lo(gCourseIndexInCup)($t5) -/* 0AD410 800AC810 24010003 */ li $at, 3 -/* 0AD414 800AC814 00002825 */ move $a1, $zero -/* 0AD418 800AC818 15A10053 */ bne $t5, $at, .L800AC968 -/* 0AD41C 800AC81C 3C028019 */ lui $v0, %hi(gCharacterIdByGPOverallRank) # $v0, 0x8019 -/* 0AD420 800AC820 3C038019 */ lui $v1, %hi(gPlayerCount) # $v1, 0x8019 -/* 0AD424 800AC824 3C048016 */ lui $a0, %hi(D_80164478) # $a0, 0x8016 -/* 0AD428 800AC828 24844478 */ addiu $a0, %lo(D_80164478) # addiu $a0, $a0, 0x4478 -/* 0AD42C 800AC82C 8063EDF3 */ lb $v1, %lo(gPlayerCount)($v1) -/* 0AD430 800AC830 2442D9D0 */ addiu $v0, %lo(gCharacterIdByGPOverallRank) # addiu $v0, $v0, -0x2630 -/* 0AD434 800AC834 24060008 */ li $a2, 8 -.L800AC838: -/* 0AD438 800AC838 804E0000 */ lb $t6, ($v0) -/* 0AD43C 800AC83C 000E7840 */ sll $t7, $t6, 1 -/* 0AD440 800AC840 008FC021 */ addu $t8, $a0, $t7 -/* 0AD444 800AC844 87190000 */ lh $t9, ($t8) -/* 0AD448 800AC848 0323082A */ slt $at, $t9, $v1 -/* 0AD44C 800AC84C 50200006 */ beql $at, $zero, .L800AC868 -/* 0AD450 800AC850 24A50001 */ addiu $a1, $a1, 1 -/* 0AD454 800AC854 0C02D4DB */ jal func_800B536C -/* 0AD458 800AC858 00A02025 */ move $a0, $a1 -/* 0AD45C 800AC85C 10000043 */ b .L800AC96C -/* 0AD460 800AC860 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD464 800AC864 24A50001 */ addiu $a1, $a1, 1 -.L800AC868: -/* 0AD468 800AC868 14A6FFF3 */ bne $a1, $a2, .L800AC838 -/* 0AD46C 800AC86C 24420001 */ addiu $v0, $v0, 1 -/* 0AD470 800AC870 1000003E */ b .L800AC96C -/* 0AD474 800AC874 8FBF0014 */ lw $ra, 0x14($sp) -glabel L800AC878 -/* 0AD478 800AC878 8CEA001C */ lw $t2, 0x1c($a3) -/* 0AD47C 800AC87C 240D000B */ li $t5, 11 -/* 0AD480 800AC880 254B0001 */ addiu $t3, $t2, 1 -/* 0AD484 800AC884 19600038 */ blez $t3, .L800AC968 -/* 0AD488 800AC888 ACEB001C */ sw $t3, 0x1c($a3) -/* 0AD48C 800AC88C ACED0004 */ sw $t5, 4($a3) -/* 0AD490 800AC890 0C02486D */ jal func_800921B4 -/* 0AD494 800AC894 ACE0001C */ sw $zero, 0x1c($a3) -/* 0AD498 800AC898 10000034 */ b .L800AC96C -/* 0AD49C 800AC89C 8FBF0014 */ lw $ra, 0x14($sp) -glabel L800AC8A0 -/* 0AD4A0 800AC8A0 3C0E8019 */ lui $t6, %hi(D_8018D9D8) # $t6, 0x8019 -/* 0AD4A4 800AC8A4 81CED9D8 */ lb $t6, %lo(D_8018D9D8)($t6) -/* 0AD4A8 800AC8A8 3C0F800E */ lui $t7, %hi(D_800DDB24) # $t7, 0x800e -/* 0AD4AC 800AC8AC 51C0002F */ beql $t6, $zero, .L800AC96C -/* 0AD4B0 800AC8B0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AD4B4 800AC8B4 8DEFDB24 */ lw $t7, %lo(D_800DDB24)($t7) -/* 0AD4B8 800AC8B8 3C044900 */ lui $a0, (0x49008015 >> 16) # lui $a0, 0x4900 -/* 0AD4BC 800AC8BC 2418000C */ li $t8, 12 -/* 0AD4C0 800AC8C0 11E00029 */ beqz $t7, .L800AC968 -/* 0AD4C4 800AC8C4 34848015 */ ori $a0, (0x49008015 & 0xFFFF) # ori $a0, $a0, 0x8015 -/* 0AD4C8 800AC8C8 8CF90010 */ lw $t9, 0x10($a3) -/* 0AD4CC 800AC8CC ACF80004 */ sw $t8, 4($a3) -/* 0AD4D0 800AC8D0 0C032384 */ jal play_sound2 -/* 0AD4D4 800AC8D4 ACF90020 */ sw $t9, 0x20($a3) -/* 0AD4D8 800AC8D8 10000024 */ b .L800AC96C -/* 0AD4DC 800AC8DC 8FBF0014 */ lw $ra, 0x14($sp) -glabel L800AC8E0 -/* 0AD4E0 800AC8E0 8CE50020 */ lw $a1, 0x20($a3) -/* 0AD4E4 800AC8E4 240F000D */ li $t7, 13 -/* 0AD4E8 800AC8E8 2418012C */ li $t8, 300 -/* 0AD4EC 800AC8EC 28A100F0 */ slti $at, $a1, 0xf0 -/* 0AD4F0 800AC8F0 1020000E */ beqz $at, .L800AC92C -/* 0AD4F4 800AC8F4 ACE50010 */ sw $a1, 0x10($a3) -/* 0AD4F8 800AC8F8 24AA0010 */ addiu $t2, $a1, 0x10 -/* 0AD4FC 800AC8FC ACEA0020 */ sw $t2, 0x20($a3) -/* 0AD500 800AC900 3C02800E */ lui $v0, %hi(D_800DC5EC) # $v0, 0x800e -/* 0AD504 800AC904 8C42C5EC */ lw $v0, %lo(D_800DC5EC)($v0) -/* 0AD508 800AC908 3C03800E */ lui $v1, %hi(D_800DC5F0) # $v1, 0x800e -/* 0AD50C 800AC90C 844B0032 */ lh $t3, 0x32($v0) -/* 0AD510 800AC910 256C0010 */ addiu $t4, $t3, 0x10 -/* 0AD514 800AC914 A44C0032 */ sh $t4, 0x32($v0) -/* 0AD518 800AC918 8C63C5F0 */ lw $v1, %lo(D_800DC5F0)($v1) -/* 0AD51C 800AC91C 846D0032 */ lh $t5, 0x32($v1) -/* 0AD520 800AC920 25AEFFF0 */ addiu $t6, $t5, -0x10 -/* 0AD524 800AC924 10000010 */ b .L800AC968 -/* 0AD528 800AC928 A46E0032 */ sh $t6, 0x32($v1) -.L800AC92C: -/* 0AD52C 800AC92C ACE00020 */ sw $zero, 0x20($a3) -/* 0AD530 800AC930 ACEF0004 */ sw $t7, 4($a3) -/* 0AD534 800AC934 ACE0001C */ sw $zero, 0x1c($a3) -/* 0AD538 800AC938 3C19800E */ lui $t9, %hi(D_800DC5EC) # $t9, 0x800e -/* 0AD53C 800AC93C 8F39C5EC */ lw $t9, %lo(D_800DC5EC)($t9) -/* 0AD540 800AC940 3C0B800E */ lui $t3, %hi(D_800DC5F0) # $t3, 0x800e -/* 0AD544 800AC944 240AFFC4 */ li $t2, -60 -/* 0AD548 800AC948 A7380032 */ sh $t8, 0x32($t9) -/* 0AD54C 800AC94C 8D6BC5F0 */ lw $t3, %lo(D_800DC5F0)($t3) -/* 0AD550 800AC950 240C0004 */ li $t4, 4 -/* 0AD554 800AC954 3C018016 */ lui $at, %hi(D_8015F894) # $at, 0x8016 -/* 0AD558 800AC958 A56A0032 */ sh $t2, 0x32($t3) -/* 0AD55C 800AC95C A42CF894 */ sh $t4, %lo(D_8015F894)($at) -/* 0AD560 800AC960 0C0328CC */ jal func_800CA330 -/* 0AD564 800AC964 24040019 */ li $a0, 25 -.L800AC968: -glabel L800AC968 -/* 0AD568 800AC968 8FBF0014 */ lw $ra, 0x14($sp) -.L800AC96C: -/* 0AD56C 800AC96C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0AD570 800AC970 03E00008 */ jr $ra -/* 0AD574 800AC974 00000000 */ nop diff --git a/asm/non_matchings/code_800AF9B0/func_800AFC54.s b/asm/non_matchings/code_800AF9B0/func_800AFC54.s deleted file mode 100644 index a3598c6db8..0000000000 --- a/asm/non_matchings/code_800AF9B0/func_800AFC54.s +++ /dev/null @@ -1,117 +0,0 @@ -.section .late_rodata -glabel D_800F2B38 -.double 0.001 - -glabel D_800F2B40 -.float 0.001 - -.section .text -glabel func_800AFC54 -/* 0B0854 800AFC54 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 0B0858 800AFC58 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B085C 800AFC5C 00057100 */ sll $t6, $a1, 4 -/* 0B0860 800AFC60 00067900 */ sll $t7, $a2, 4 -/* 0B0864 800AFC64 0007C100 */ sll $t8, $a3, 4 -/* 0B0868 800AFC68 01C41021 */ addu $v0, $t6, $a0 -/* 0B086C 800AFC6C 01E41821 */ addu $v1, $t7, $a0 -/* 0B0870 800AFC70 03044021 */ addu $t0, $t8, $a0 -/* 0B0874 800AFC74 85190000 */ lh $t9, ($t0) -/* 0B0878 800AFC78 844C0000 */ lh $t4, ($v0) -/* 0B087C 800AFC7C 844D0002 */ lh $t5, 2($v0) -/* 0B0880 800AFC80 845F0004 */ lh $ra, 4($v0) -/* 0B0884 800AFC84 84690000 */ lh $t1, ($v1) -/* 0B0888 800AFC88 846A0002 */ lh $t2, 2($v1) -/* 0B088C 800AFC8C 846B0004 */ lh $t3, 4($v1) -/* 0B0890 800AFC90 AFB9003C */ sw $t9, 0x3c($sp) -/* 0B0894 800AFC94 850E0002 */ lh $t6, 2($t0) -/* 0B0898 800AFC98 014D1023 */ subu $v0, $t2, $t5 -/* 0B089C 800AFC9C 017F2023 */ subu $a0, $t3, $ra -/* 0B08A0 800AFCA0 AFAE0038 */ sw $t6, 0x38($sp) -/* 0B08A4 800AFCA4 850F0004 */ lh $t7, 4($t0) -/* 0B08A8 800AFCA8 01CA2823 */ subu $a1, $t6, $t2 -/* 0B08AC 800AFCAC 8FB9003C */ lw $t9, 0x3c($sp) -/* 0B08B0 800AFCB0 01EB1823 */ subu $v1, $t7, $t3 -/* 0B08B4 800AFCB4 00430019 */ multu $v0, $v1 -/* 0B08B8 800AFCB8 AFAF0034 */ sw $t7, 0x34($sp) -/* 0B08BC 800AFCBC 03293023 */ subu $a2, $t9, $t1 -/* 0B08C0 800AFCC0 012C3823 */ subu $a3, $t1, $t4 -/* 0B08C4 800AFCC4 00007012 */ mflo $t6 -/* 0B08C8 800AFCC8 00000000 */ nop -/* 0B08CC 800AFCCC 00000000 */ nop -/* 0B08D0 800AFCD0 00850019 */ multu $a0, $a1 -/* 0B08D4 800AFCD4 00007812 */ mflo $t7 -/* 0B08D8 800AFCD8 01CFC023 */ subu $t8, $t6, $t7 -/* 0B08DC 800AFCDC 44982000 */ mtc1 $t8, $f4 -/* 0B08E0 800AFCE0 00860019 */ multu $a0, $a2 -/* 0B08E4 800AFCE4 468023A0 */ cvt.s.w $f14, $f4 -/* 0B08E8 800AFCE8 460E7282 */ mul.s $f10, $f14, $f14 -/* 0B08EC 800AFCEC E7AE0020 */ swc1 $f14, 0x20($sp) -/* 0B08F0 800AFCF0 00007012 */ mflo $t6 -/* 0B08F4 800AFCF4 00000000 */ nop -/* 0B08F8 800AFCF8 00000000 */ nop -/* 0B08FC 800AFCFC 00E30019 */ multu $a3, $v1 -/* 0B0900 800AFD00 00007812 */ mflo $t7 -/* 0B0904 800AFD04 01CFC023 */ subu $t8, $t6, $t7 -/* 0B0908 800AFD08 44983000 */ mtc1 $t8, $f6 -/* 0B090C 800AFD0C 00E50019 */ multu $a3, $a1 -/* 0B0910 800AFD10 46803420 */ cvt.s.w $f16, $f6 -/* 0B0914 800AFD14 46108102 */ mul.s $f4, $f16, $f16 -/* 0B0918 800AFD18 E7B0001C */ swc1 $f16, 0x1c($sp) -/* 0B091C 800AFD1C 0000C812 */ mflo $t9 -/* 0B0920 800AFD20 00000000 */ nop -/* 0B0924 800AFD24 00000000 */ nop -/* 0B0928 800AFD28 00460019 */ multu $v0, $a2 -/* 0B092C 800AFD2C 46045180 */ add.s $f6, $f10, $f4 -/* 0B0930 800AFD30 00007012 */ mflo $t6 -/* 0B0934 800AFD34 032E7823 */ subu $t7, $t9, $t6 -/* 0B0938 800AFD38 448F4000 */ mtc1 $t7, $f8 -/* 0B093C 800AFD3C 00000000 */ nop -/* 0B0940 800AFD40 468044A0 */ cvt.s.w $f18, $f8 -/* 0B0944 800AFD44 46129202 */ mul.s $f8, $f18, $f18 -/* 0B0948 800AFD48 E7B20018 */ swc1 $f18, 0x18($sp) -/* 0B094C 800AFD4C 0C033850 */ jal sqrtf -/* 0B0950 800AFD50 46083300 */ add.s $f12, $f6, $f8 -/* 0B0954 800AFD54 3C01800F */ lui $at, %hi(D_800F2B38) -/* 0B0958 800AFD58 D4242B38 */ ldc1 $f4, %lo(D_800F2B38)($at) -/* 0B095C 800AFD5C 460002A1 */ cvt.d.s $f10, $f0 -/* 0B0960 800AFD60 44803000 */ mtc1 $zero, $f6 -/* 0B0964 800AFD64 4624503C */ c.lt.d $f10, $f4 -/* 0B0968 800AFD68 C7AE0020 */ lwc1 $f14, 0x20($sp) -/* 0B096C 800AFD6C C7B0001C */ lwc1 $f16, 0x1c($sp) -/* 0B0970 800AFD70 C7B20018 */ lwc1 $f18, 0x18($sp) -/* 0B0974 800AFD74 45000003 */ bc1f .L800AFD84 -/* 0B0978 800AFD78 46000086 */ mov.s $f2, $f0 -/* 0B097C 800AFD7C 3C01800F */ lui $at, %hi(D_800F2B40) # $at, 0x800f -/* 0B0980 800AFD80 C4222B40 */ lwc1 $f2, %lo(D_800F2B40)($at) -.L800AFD84: -/* 0B0984 800AFD84 3C0142F0 */ li $at, 0x42F00000 # 120.000000 -/* 0B0988 800AFD88 44810000 */ mtc1 $at, $f0 -/* 0B098C 800AFD8C 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 0B0990 800AFD90 44813800 */ mtc1 $at, $f7 -/* 0B0994 800AFD94 46001221 */ cvt.d.s $f8, $f2 -/* 0B0998 800AFD98 8FA20068 */ lw $v0, 0x68($sp) -/* 0B099C 800AFD9C 46283283 */ div.d $f10, $f6, $f8 -/* 0B09A0 800AFDA0 462050A0 */ cvt.s.d $f2, $f10 -/* 0B09A4 800AFDA4 46027102 */ mul.s $f4, $f14, $f2 -/* 0B09A8 800AFDA8 00000000 */ nop -/* 0B09AC 800AFDAC 46002182 */ mul.s $f6, $f4, $f0 -/* 0B09B0 800AFDB0 00000000 */ nop -/* 0B09B4 800AFDB4 46028282 */ mul.s $f10, $f16, $f2 -/* 0B09B8 800AFDB8 4600320D */ trunc.w.s $f8, $f6 -/* 0B09BC 800AFDBC 46005102 */ mul.s $f4, $f10, $f0 -/* 0B09C0 800AFDC0 44194000 */ mfc1 $t9, $f8 -/* 0B09C4 800AFDC4 46029202 */ mul.s $f8, $f18, $f2 -/* 0B09C8 800AFDC8 A4590000 */ sh $t9, ($v0) -/* 0B09CC 800AFDCC 4600218D */ trunc.w.s $f6, $f4 -/* 0B09D0 800AFDD0 46004282 */ mul.s $f10, $f8, $f0 -/* 0B09D4 800AFDD4 440F3000 */ mfc1 $t7, $f6 -/* 0B09D8 800AFDD8 00000000 */ nop -/* 0B09DC 800AFDDC A44F0002 */ sh $t7, 2($v0) -/* 0B09E0 800AFDE0 4600510D */ trunc.w.s $f4, $f10 -/* 0B09E4 800AFDE4 44192000 */ mfc1 $t9, $f4 -/* 0B09E8 800AFDE8 00000000 */ nop -/* 0B09EC 800AFDEC A4590004 */ sh $t9, 4($v0) -/* 0B09F0 800AFDF0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B09F4 800AFDF4 27BD0058 */ addiu $sp, $sp, 0x58 -/* 0B09F8 800AFDF8 03E00008 */ jr $ra -/* 0B09FC 800AFDFC 00000000 */ nop diff --git a/asm/non_matchings/code_800AF9B0/func_800B0004.s b/asm/non_matchings/code_800AF9B0/func_800B0004.s deleted file mode 100644 index 0479386a6c..0000000000 --- a/asm/non_matchings/code_800AF9B0/func_800B0004.s +++ /dev/null @@ -1,222 +0,0 @@ -.section .late_rodata -glabel D_800F2B44 -.float 0.18 - -.section .text -glabel func_800B0004 -/* 0B0C04 800B0004 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 0B0C08 800B0008 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0B0C0C 800B000C 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0B0C10 800B0010 8C640000 */ lw $a0, ($v1) -/* 0B0C14 800B0014 AFBF005C */ sw $ra, 0x5c($sp) -/* 0B0C18 800B0018 AFBE0058 */ sw $fp, 0x58($sp) -/* 0B0C1C 800B001C 248E0008 */ addiu $t6, $a0, 8 -/* 0B0C20 800B0020 AFB70054 */ sw $s7, 0x54($sp) -/* 0B0C24 800B0024 AFB60050 */ sw $s6, 0x50($sp) -/* 0B0C28 800B0028 AFB5004C */ sw $s5, 0x4c($sp) -/* 0B0C2C 800B002C AFB40048 */ sw $s4, 0x48($sp) -/* 0B0C30 800B0030 AFB30044 */ sw $s3, 0x44($sp) -/* 0B0C34 800B0034 AFB20040 */ sw $s2, 0x40($sp) -/* 0B0C38 800B0038 AFB1003C */ sw $s1, 0x3c($sp) -/* 0B0C3C 800B003C AFB00038 */ sw $s0, 0x38($sp) -/* 0B0C40 800B0040 F7B60030 */ sdc1 $f22, 0x30($sp) -/* 0B0C44 800B0044 F7B40028 */ sdc1 $f20, 0x28($sp) -/* 0B0C48 800B0048 AC6E0000 */ sw $t6, ($v1) -/* 0B0C4C 800B004C 3C0F0386 */ lui $t7, (0x03860010 >> 16) # lui $t7, 0x386 -/* 0B0C50 800B0050 3C18000F */ lui $t8, %hi(D_800E8688-0x80000000) # $t8, 0xf -/* 0B0C54 800B0054 27188688 */ addiu $t8, %lo(D_800E8688-0x80000000) # addiu $t8, $t8, -0x7978 -/* 0B0C58 800B0058 35EF0010 */ ori $t7, (0x03860010 & 0xFFFF) # ori $t7, $t7, 0x10 -/* 0B0C5C 800B005C AC8F0000 */ sw $t7, ($a0) -/* 0B0C60 800B0060 AC980004 */ sw $t8, 4($a0) -/* 0B0C64 800B0064 8C650000 */ lw $a1, ($v1) -/* 0B0C68 800B0068 3C0C0388 */ lui $t4, (0x03880010 >> 16) # lui $t4, 0x388 -/* 0B0C6C 800B006C 3C0D000F */ lui $t5, %hi(D_800E8680-0x80000000) # $t5, 0xf -/* 0B0C70 800B0070 24B90008 */ addiu $t9, $a1, 8 -/* 0B0C74 800B0074 AC790000 */ sw $t9, ($v1) -/* 0B0C78 800B0078 25AD8680 */ addiu $t5, %lo(D_800E8680-0x80000000) # addiu $t5, $t5, -0x7980 -/* 0B0C7C 800B007C 358C0010 */ ori $t4, (0x03880010 & 0xFFFF) # ori $t4, $t4, 0x10 -/* 0B0C80 800B0080 ACAC0000 */ sw $t4, ($a1) -/* 0B0C84 800B0084 ACAD0004 */ sw $t5, 4($a1) -/* 0B0C88 800B0088 8C660000 */ lw $a2, ($v1) -/* 0B0C8C 800B008C 3C188000 */ lui $t8, (0x80000040 >> 16) # lui $t8, 0x8000 -/* 0B0C90 800B0090 3C0FBC00 */ lui $t7, (0xBC000002 >> 16) # lui $t7, 0xbc00 -/* 0B0C94 800B0094 24CE0008 */ addiu $t6, $a2, 8 -/* 0B0C98 800B0098 AC6E0000 */ sw $t6, ($v1) -/* 0B0C9C 800B009C 35EF0002 */ ori $t7, (0xBC000002 & 0xFFFF) # ori $t7, $t7, 2 -/* 0B0CA0 800B00A0 37180040 */ ori $t8, (0x80000040 & 0xFFFF) # ori $t8, $t8, 0x40 -/* 0B0CA4 800B00A4 ACD80004 */ sw $t8, 4($a2) -/* 0B0CA8 800B00A8 ACCF0000 */ sw $t7, ($a2) -/* 0B0CAC 800B00AC 8C670000 */ lw $a3, ($v1) -/* 0B0CB0 800B00B0 3C0BB700 */ lui $t3, 0xb700 -/* 0B0CB4 800B00B4 240C0204 */ li $t4, 516 -/* 0B0CB8 800B00B8 24F90008 */ addiu $t9, $a3, 8 -/* 0B0CBC 800B00BC AC790000 */ sw $t9, ($v1) -/* 0B0CC0 800B00C0 ACEC0004 */ sw $t4, 4($a3) -/* 0B0CC4 800B00C4 ACEB0000 */ sw $t3, ($a3) -/* 0B0CC8 800B00C8 8C680000 */ lw $t0, ($v1) -/* 0B0CCC 800B00CC 3C0EFC32 */ lui $t6, (0xFC327E64 >> 16) # lui $t6, 0xfc32 -/* 0B0CD0 800B00D0 35CE7E64 */ ori $t6, (0xFC327E64 & 0xFFFF) # ori $t6, $t6, 0x7e64 -/* 0B0CD4 800B00D4 250D0008 */ addiu $t5, $t0, 8 -/* 0B0CD8 800B00D8 AC6D0000 */ sw $t5, ($v1) -/* 0B0CDC 800B00DC 240FF9FC */ li $t7, -1540 -/* 0B0CE0 800B00E0 AD0F0004 */ sw $t7, 4($t0) -/* 0B0CE4 800B00E4 AD0E0000 */ sw $t6, ($t0) -/* 0B0CE8 800B00E8 8C690000 */ lw $t1, ($v1) -/* 0B0CEC 800B00EC 240C2000 */ li $t4, 8192 -/* 0B0CF0 800B00F0 3C19B600 */ lui $t9, 0xb600 -/* 0B0CF4 800B00F4 25380008 */ addiu $t8, $t1, 8 -/* 0B0CF8 800B00F8 AC780000 */ sw $t8, ($v1) -/* 0B0CFC 800B00FC AD2C0004 */ sw $t4, 4($t1) -/* 0B0D00 800B0100 AD390000 */ sw $t9, ($t1) -/* 0B0D04 800B0104 8C620000 */ lw $v0, ($v1) -/* 0B0D08 800B0108 3C0E0002 */ lui $t6, 2 -/* 0B0D0C 800B010C 3C0F8019 */ lui $t7, %hi(D_8018EDB4) # $t7, 0x8019 -/* 0B0D10 800B0110 244D0008 */ addiu $t5, $v0, 8 -/* 0B0D14 800B0114 AC6D0000 */ sw $t5, ($v1) -/* 0B0D18 800B0118 AC4E0004 */ sw $t6, 4($v0) -/* 0B0D1C 800B011C AC4B0000 */ sw $t3, ($v0) -/* 0B0D20 800B0120 85EFEDB4 */ lh $t7, %lo(D_8018EDB4)($t7) -/* 0B0D24 800B0124 3C178019 */ lui $s7, %hi(D_8018EDB2) # $s7, 0x8019 -/* 0B0D28 800B0128 00405025 */ move $t2, $v0 -/* 0B0D2C 800B012C 05E10004 */ bgez $t7, .L800B0140 -/* 0B0D30 800B0130 31F80001 */ andi $t8, $t7, 1 -/* 0B0D34 800B0134 13000002 */ beqz $t8, .L800B0140 -/* 0B0D38 800B0138 00000000 */ nop -/* 0B0D3C 800B013C 2718FFFE */ addiu $t8, $t8, -2 -.L800B0140: -/* 0B0D40 800B0140 13000004 */ beqz $t8, .L800B0154 -/* 0B0D44 800B0144 3C198019 */ lui $t9, %hi(D_8018EDB8) # $t9, 0x8019 -/* 0B0D48 800B0148 8F39EDB8 */ lw $t9, %lo(D_8018EDB8)($t9) -/* 0B0D4C 800B014C 10000004 */ b .L800B0160 -/* 0B0D50 800B0150 AFB900BC */ sw $t9, 0xbc($sp) -.L800B0154: -/* 0B0D54 800B0154 3C0C8019 */ lui $t4, %hi(D_8018EDBC) # $t4, 0x8019 -/* 0B0D58 800B0158 8D8CEDBC */ lw $t4, %lo(D_8018EDBC)($t4) -/* 0B0D5C 800B015C AFAC00BC */ sw $t4, 0xbc($sp) -.L800B0160: -/* 0B0D60 800B0160 26F7EDB2 */ addiu $s7, %lo(D_8018EDB2) # addiu $s7, $s7, -0x124e -/* 0B0D64 800B0164 240D09C0 */ li $t5, 2496 -/* 0B0D68 800B0168 A6ED0000 */ sh $t5, ($s7) -/* 0B0D6C 800B016C 3C01800F */ lui $at, %hi(D_800F2B44) # $at, 0x800f -/* 0B0D70 800B0170 C4362B44 */ lwc1 $f22, %lo(D_800F2B44)($at) -/* 0B0D74 800B0174 3C0142A8 */ li $at, 0x42A80000 # 84.000000 -/* 0B0D78 800B0178 3C168019 */ lui $s6, %hi(D_8018EDB0) # $s6, 0x8019 -/* 0B0D7C 800B017C 4481A000 */ mtc1 $at, $f20 -/* 0B0D80 800B0180 26D6EDB0 */ addiu $s6, %lo(D_8018EDB0) # addiu $s6, $s6, -0x1250 -/* 0B0D84 800B0184 0000F025 */ move $fp, $zero -/* 0B0D88 800B0188 AFA00064 */ sw $zero, 0x64($sp) -.L800B018C: -/* 0B0D8C 800B018C 8FA20064 */ lw $v0, 0x64($sp) -/* 0B0D90 800B0190 00009025 */ move $s2, $zero -/* 0B0D94 800B0194 00008025 */ move $s0, $zero -/* 0B0D98 800B0198 00009825 */ move $s3, $zero -/* 0B0D9C 800B019C 0002A900 */ sll $s5, $v0, 4 -.L800B01A0: -/* 0B0DA0 800B01A0 86EF0000 */ lh $t7, ($s7) -/* 0B0DA4 800B01A4 86CE0000 */ lh $t6, ($s6) -/* 0B0DA8 800B01A8 020F0019 */ multu $s0, $t7 -/* 0B0DAC 800B01AC 0000C012 */ mflo $t8 -/* 0B0DB0 800B01B0 01D82023 */ subu $a0, $t6, $t8 -/* 0B0DB4 800B01B4 3099FFFF */ andi $t9, $a0, 0xffff -/* 0B0DB8 800B01B8 0C0AE006 */ jal sins -/* 0B0DBC 800B01BC 03202025 */ move $a0, $t9 -/* 0B0DC0 800B01C0 44903000 */ mtc1 $s0, $f6 -/* 0B0DC4 800B01C4 46140102 */ mul.s $f4, $f0, $f20 -/* 0B0DC8 800B01C8 86EF0000 */ lh $t7, ($s7) -/* 0B0DCC 800B01CC 26110001 */ addiu $s1, $s0, 1 -/* 0B0DD0 800B01D0 86CD0000 */ lh $t5, ($s6) -/* 0B0DD4 800B01D4 022F0019 */ multu $s1, $t7 -/* 0B0DD8 800B01D8 46803220 */ cvt.s.w $f8, $f6 -/* 0B0DDC 800B01DC 46082282 */ mul.s $f10, $f4, $f8 -/* 0B0DE0 800B01E0 00007012 */ mflo $t6 -/* 0B0DE4 800B01E4 01AE2023 */ subu $a0, $t5, $t6 -/* 0B0DE8 800B01E8 3098FFFF */ andi $t8, $a0, 0xffff -/* 0B0DEC 800B01EC 03002025 */ move $a0, $t8 -/* 0B0DF0 800B01F0 46165402 */ mul.s $f16, $f10, $f22 -/* 0B0DF4 800B01F4 4600848D */ trunc.w.s $f18, $f16 -/* 0B0DF8 800B01F8 44149000 */ mfc1 $s4, $f18 -/* 0B0DFC 800B01FC 0C0AE006 */ jal sins -/* 0B0E00 800B0200 00000000 */ nop -/* 0B0E04 800B0204 44912000 */ mtc1 $s1, $f4 -/* 0B0E08 800B0208 46140182 */ mul.s $f6, $f0, $f20 -/* 0B0E0C 800B020C 8FAC00BC */ lw $t4, 0xbc($sp) -/* 0B0E10 800B0210 0013C900 */ sll $t9, $s3, 4 -/* 0B0E14 800B0214 24180054 */ li $t8, 84 -/* 0B0E18 800B0218 032C7821 */ addu $t7, $t9, $t4 -/* 0B0E1C 800B021C 01F52021 */ addu $a0, $t7, $s5 -/* 0B0E20 800B0220 46802220 */ cvt.s.w $f8, $f4 -/* 0B0E24 800B0224 AFB8001C */ sw $t8, 0x1c($sp) -/* 0B0E28 800B0228 02002825 */ move $a1, $s0 -/* 0B0E2C 800B022C 03C03025 */ move $a2, $fp -/* 0B0E30 800B0230 24070054 */ li $a3, 84 -/* 0B0E34 800B0234 AFB40010 */ sw $s4, 0x10($sp) -/* 0B0E38 800B0238 46083282 */ mul.s $f10, $f6, $f8 -/* 0B0E3C 800B023C AFB20018 */ sw $s2, 0x18($sp) -/* 0B0E40 800B0240 46165402 */ mul.s $f16, $f10, $f22 -/* 0B0E44 800B0244 4600848D */ trunc.w.s $f18, $f16 -/* 0B0E48 800B0248 440E9000 */ mfc1 $t6, $f18 -/* 0B0E4C 800B024C 0C02BE79 */ jal func_800AF9E4 -/* 0B0E50 800B0250 AFAE0014 */ sw $t6, 0x14($sp) -/* 0B0E54 800B0254 2401000C */ li $at, 12 -/* 0B0E58 800B0258 02208025 */ move $s0, $s1 -/* 0B0E5C 800B025C 26730004 */ addiu $s3, $s3, 4 -/* 0B0E60 800B0260 1621FFCF */ bne $s1, $at, .L800B01A0 -/* 0B0E64 800B0264 26520054 */ addiu $s2, $s2, 0x54 -/* 0B0E68 800B0268 8FB90064 */ lw $t9, 0x64($sp) -/* 0B0E6C 800B026C 27DE0001 */ addiu $fp, $fp, 1 -/* 0B0E70 800B0270 2401000A */ li $at, 10 -/* 0B0E74 800B0274 272C0030 */ addiu $t4, $t9, 0x30 -/* 0B0E78 800B0278 17C1FFC4 */ bne $fp, $at, .L800B018C -/* 0B0E7C 800B027C AFAC0064 */ sw $t4, 0x64($sp) -/* 0B0E80 800B0280 0C02BFD6 */ jal func_800AFF58 -/* 0B0E84 800B0284 8FA400BC */ lw $a0, 0xbc($sp) -/* 0B0E88 800B0288 3C068019 */ lui $a2, %hi(D_8018EDB4) # $a2, 0x8019 -/* 0B0E8C 800B028C 24C6EDB4 */ addiu $a2, %lo(D_8018EDB4) # addiu $a2, $a2, -0x124c -/* 0B0E90 800B0290 86CF0000 */ lh $t7, ($s6) -/* 0B0E94 800B0294 86ED0000 */ lh $t5, ($s7) -/* 0B0E98 800B0298 84D80000 */ lh $t8, ($a2) -/* 0B0E9C 800B029C 3C028015 */ lui $v0, %hi(gDisplayListHead) # $v0, 0x8015 -/* 0B0EA0 800B02A0 01ED7021 */ addu $t6, $t7, $t5 -/* 0B0EA4 800B02A4 27190001 */ addiu $t9, $t8, 1 -/* 0B0EA8 800B02A8 A6CE0000 */ sh $t6, ($s6) -/* 0B0EAC 800B02AC A4D90000 */ sh $t9, ($a2) -/* 0B0EB0 800B02B0 8C420298 */ lw $v0, %lo(gDisplayListHead)($v0) -/* 0B0EB4 800B02B4 3C018015 */ lui $at, %hi(gDisplayListHead) # $at, 0x8015 -/* 0B0EB8 800B02B8 240D2000 */ li $t5, 8192 -/* 0B0EBC 800B02BC 244C0008 */ addiu $t4, $v0, 8 -/* 0B0EC0 800B02C0 AC2C0298 */ sw $t4, %lo(gDisplayListHead)($at) -/* 0B0EC4 800B02C4 3C0FB700 */ lui $t7, 0xb700 -/* 0B0EC8 800B02C8 AC4F0000 */ sw $t7, ($v0) -/* 0B0ECC 800B02CC AC4D0004 */ sw $t5, 4($v0) -/* 0B0ED0 800B02D0 3C028015 */ lui $v0, %hi(gDisplayListHead) # $v0, 0x8015 -/* 0B0ED4 800B02D4 8C420298 */ lw $v0, %lo(gDisplayListHead)($v0) -/* 0B0ED8 800B02D8 3C198000 */ lui $t9, (0x80000040 >> 16) # lui $t9, 0x8000 -/* 0B0EDC 800B02DC 3C18BC00 */ lui $t8, (0xBC000002 >> 16) # lui $t8, 0xbc00 -/* 0B0EE0 800B02E0 244E0008 */ addiu $t6, $v0, 8 -/* 0B0EE4 800B02E4 AC2E0298 */ sw $t6, %lo(gDisplayListHead)($at) -/* 0B0EE8 800B02E8 37180002 */ ori $t8, (0xBC000002 & 0xFFFF) # ori $t8, $t8, 2 -/* 0B0EEC 800B02EC 37390040 */ ori $t9, (0x80000040 & 0xFFFF) # ori $t9, $t9, 0x40 -/* 0B0EF0 800B02F0 AC590004 */ sw $t9, 4($v0) -/* 0B0EF4 800B02F4 AC580000 */ sw $t8, ($v0) -/* 0B0EF8 800B02F8 3C028015 */ lui $v0, %hi(gDisplayListHead) # $v0, 0x8015 -/* 0B0EFC 800B02FC 8C420298 */ lw $v0, %lo(gDisplayListHead)($v0) -/* 0B0F00 800B0300 3C0D0002 */ lui $t5, 2 -/* 0B0F04 800B0304 3C0FB600 */ lui $t7, 0xb600 -/* 0B0F08 800B0308 244C0008 */ addiu $t4, $v0, 8 -/* 0B0F0C 800B030C AC2C0298 */ sw $t4, %lo(gDisplayListHead)($at) -/* 0B0F10 800B0310 AC4D0004 */ sw $t5, 4($v0) -/* 0B0F14 800B0314 AC4F0000 */ sw $t7, ($v0) -/* 0B0F18 800B0318 8FBF005C */ lw $ra, 0x5c($sp) -/* 0B0F1C 800B031C 8FBE0058 */ lw $fp, 0x58($sp) -/* 0B0F20 800B0320 8FB70054 */ lw $s7, 0x54($sp) -/* 0B0F24 800B0324 8FB60050 */ lw $s6, 0x50($sp) -/* 0B0F28 800B0328 8FB5004C */ lw $s5, 0x4c($sp) -/* 0B0F2C 800B032C 8FB40048 */ lw $s4, 0x48($sp) -/* 0B0F30 800B0330 8FB30044 */ lw $s3, 0x44($sp) -/* 0B0F34 800B0334 8FB20040 */ lw $s2, 0x40($sp) -/* 0B0F38 800B0338 8FB1003C */ lw $s1, 0x3c($sp) -/* 0B0F3C 800B033C 8FB00038 */ lw $s0, 0x38($sp) -/* 0B0F40 800B0340 D7B60030 */ ldc1 $f22, 0x30($sp) -/* 0B0F44 800B0344 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 0B0F48 800B0348 03E00008 */ jr $ra -/* 0B0F4C 800B034C 27BD00C0 */ addiu $sp, $sp, 0xc0 diff --git a/asm/non_matchings/crash_screen/crash_screen_draw_square.s b/asm/non_matchings/crash_screen/crash_screen_draw_square.s deleted file mode 100644 index 3bb432a8f8..0000000000 --- a/asm/non_matchings/crash_screen/crash_screen_draw_square.s +++ /dev/null @@ -1,100 +0,0 @@ -glabel crash_screen_draw_square -/* 004D44 80004144 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 004D48 80004148 AFB40028 */ sw $s4, 0x28($sp) -/* 004D4C 8000414C AFB30024 */ sw $s3, 0x24($sp) -/* 004D50 80004150 AFB20020 */ sw $s2, 0x20($sp) -/* 004D54 80004154 AFB00018 */ sw $s0, 0x18($sp) -/* 004D58 80004158 00809825 */ move $s3, $a0 -/* 004D5C 8000415C AFBF002C */ sw $ra, 0x2c($sp) -/* 004D60 80004160 AFB1001C */ sw $s1, 0x1c($sp) -/* 004D64 80004164 2410002E */ li $s0, 46 -/* 004D68 80004168 24120028 */ li $s2, 40 -/* 004D6C 8000416C 2414002C */ li $s4, 44 -/* 004D70 80004170 240D0006 */ li $t5, 6 -/* 004D74 80004174 240C0006 */ li $t4, 6 -/* 004D78 80004178 240B0006 */ li $t3, 6 -/* 004D7C 8000417C 240A0006 */ li $t2, 6 -/* 004D80 80004180 24090006 */ li $t1, 6 -/* 004D84 80004184 3407FFFF */ li $a3, 65535 -/* 004D88 80004188 3406F801 */ li $a2, 63489 -.L8000418C: -/* 004D8C 8000418C 0250082A */ slt $at, $s2, $s0 -/* 004D90 80004190 10200032 */ beqz $at, .L8000425C -/* 004D94 80004194 02408825 */ move $s1, $s2 -/* 004D98 80004198 0250082A */ slt $at, $s2, $s0 -.L8000419C: -/* 004D9C 8000419C 1020002C */ beqz $at, .L80004250 -/* 004DA0 800041A0 02401825 */ move $v1, $s2 -/* 004DA4 800041A4 00117080 */ sll $t6, $s1, 2 -/* 004DA8 800041A8 01D17021 */ addu $t6, $t6, $s1 -/* 004DAC 800041AC 02122023 */ subu $a0, $s0, $s2 -/* 004DB0 800041B0 30880003 */ andi $t0, $a0, 3 -/* 004DB4 800041B4 000E79C0 */ sll $t7, $t6, 7 -/* 004DB8 800041B8 1100000C */ beqz $t0, .L800041EC -/* 004DBC 800041BC 026FF821 */ addu $ra, $s3, $t7 -/* 004DC0 800041C0 0003C040 */ sll $t8, $v1, 1 -/* 004DC4 800041C4 03F81021 */ addu $v0, $ra, $t8 -/* 004DC8 800041C8 01122821 */ addu $a1, $t0, $s2 -.L800041CC: -/* 004DCC 800041CC 15240003 */ bne $t1, $a0, .L800041DC -/* 004DD0 800041D0 24630001 */ addiu $v1, $v1, 1 -/* 004DD4 800041D4 10000002 */ b .L800041E0 -/* 004DD8 800041D8 A4460000 */ sh $a2, ($v0) -.L800041DC: -/* 004DDC 800041DC A4470000 */ sh $a3, ($v0) -.L800041E0: -/* 004DE0 800041E0 14A3FFFA */ bne $a1, $v1, .L800041CC -/* 004DE4 800041E4 24420002 */ addiu $v0, $v0, 2 -/* 004DE8 800041E8 10700019 */ beq $v1, $s0, .L80004250 -.L800041EC: -/* 004DEC 800041EC 00032840 */ sll $a1, $v1, 1 -/* 004DF0 800041F0 03E51021 */ addu $v0, $ra, $a1 -/* 004DF4 800041F4 00104040 */ sll $t0, $s0, 1 -.L800041F8: -/* 004DF8 800041F8 15440003 */ bne $t2, $a0, .L80004208 -/* 004DFC 800041FC 24A50008 */ addiu $a1, $a1, 8 -/* 004E00 80004200 10000002 */ b .L8000420C -/* 004E04 80004204 A4460000 */ sh $a2, ($v0) -.L80004208: -/* 004E08 80004208 A4470000 */ sh $a3, ($v0) -.L8000420C: -/* 004E0C 8000420C 55640004 */ bnel $t3, $a0, .L80004220 -/* 004E10 80004210 A4470002 */ sh $a3, 2($v0) -/* 004E14 80004214 10000002 */ b .L80004220 -/* 004E18 80004218 A4460002 */ sh $a2, 2($v0) -/* 004E1C 8000421C A4470002 */ sh $a3, 2($v0) -.L80004220: -/* 004E20 80004220 55840004 */ bnel $t4, $a0, .L80004234 -/* 004E24 80004224 A4470004 */ sh $a3, 4($v0) -/* 004E28 80004228 10000002 */ b .L80004234 -/* 004E2C 8000422C A4460004 */ sh $a2, 4($v0) -/* 004E30 80004230 A4470004 */ sh $a3, 4($v0) -.L80004234: -/* 004E34 80004234 55A40004 */ bnel $t5, $a0, .L80004248 -/* 004E38 80004238 A4470006 */ sh $a3, 6($v0) -/* 004E3C 8000423C 10000002 */ b .L80004248 -/* 004E40 80004240 A4460006 */ sh $a2, 6($v0) -/* 004E44 80004244 A4470006 */ sh $a3, 6($v0) -.L80004248: -/* 004E48 80004248 14A8FFEB */ bne $a1, $t0, .L800041F8 -/* 004E4C 8000424C 24420008 */ addiu $v0, $v0, 8 -.L80004250: -/* 004E50 80004250 26310001 */ addiu $s1, $s1, 1 -/* 004E54 80004254 5630FFD1 */ bnel $s1, $s0, .L8000419C -/* 004E58 80004258 0250082A */ slt $at, $s2, $s0 -.L8000425C: -/* 004E5C 8000425C 2610FFFF */ addiu $s0, $s0, -1 -/* 004E60 80004260 1690FFCA */ bne $s4, $s0, .L8000418C -/* 004E64 80004264 26520001 */ addiu $s2, $s2, 1 -/* 004E68 80004268 0C033624 */ jal osWritebackDCacheAll -/* 004E6C 8000426C 00000000 */ nop -/* 004E70 80004270 0C033684 */ jal osViSwapBuffer -/* 004E74 80004274 02602025 */ move $a0, $s3 -/* 004E78 80004278 8FBF002C */ lw $ra, 0x2c($sp) -/* 004E7C 8000427C 8FB00018 */ lw $s0, 0x18($sp) -/* 004E80 80004280 8FB1001C */ lw $s1, 0x1c($sp) -/* 004E84 80004284 8FB20020 */ lw $s2, 0x20($sp) -/* 004E88 80004288 8FB30024 */ lw $s3, 0x24($sp) -/* 004E8C 8000428C 8FB40028 */ lw $s4, 0x28($sp) -/* 004E90 80004290 03E00008 */ jr $ra -/* 004E94 80004294 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/non_matchings/menus/main_menu_act.s b/asm/non_matchings/menus/main_menu_act.s deleted file mode 100644 index f03d69c88d..0000000000 --- a/asm/non_matchings/menus/main_menu_act.s +++ /dev/null @@ -1,769 +0,0 @@ -.section .late_rodata - -glabel jpt_800F2DFC -.word L800B2A6C, L800B3468, L800B3468, L800B2AA4 -.word L800B2D30, L800B2F70, L800B32B4 -.word L800B32B4, L800B2F70 - -.section .text -glabel main_menu_act -/* 0B35D8 800B29D8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0B35DC 800B29DC AFBF0014 */ sw $ra, 0x14($sp) -/* 0B35E0 800B29E0 AFA50034 */ sw $a1, 0x34($sp) -/* 0B35E4 800B29E4 9498000C */ lhu $t8, 0xc($a0) -/* 0B35E8 800B29E8 948F0006 */ lhu $t7, 6($a0) -/* 0B35EC 800B29EC 3C09800E */ lui $t1, %hi(gEnableDebugMode) # $t1, 0x800e -/* 0B35F0 800B29F0 9529C520 */ lhu $t1, %lo(gEnableDebugMode)($t1) -/* 0B35F4 800B29F4 01F81825 */ or $v1, $t7, $t8 -/* 0B35F8 800B29F8 30AEFFFF */ andi $t6, $a1, 0xffff -/* 0B35FC 800B29FC 3079FFFF */ andi $t9, $v1, 0xffff -/* 0B3600 800B2A00 01C02825 */ move $a1, $t6 -/* 0B3604 800B2A04 15200007 */ bnez $t1, .L800B2A24 -/* 0B3608 800B2A08 03201825 */ move $v1, $t9 -/* 0B360C 800B2A0C 332A1000 */ andi $t2, $t9, 0x1000 -/* 0B3610 800B2A10 51400005 */ beql $t2, $zero, .L800B2A28 -/* 0B3614 800B2A14 A7A3002E */ sh $v1, 0x2e($sp) -/* 0B3618 800B2A18 37238000 */ ori $v1, $t9, 0x8000 -/* 0B361C 800B2A1C 306BFFFF */ andi $t3, $v1, 0xffff -/* 0B3620 800B2A20 01601825 */ move $v1, $t3 -.L800B2A24: -/* 0B3624 800B2A24 A7A3002E */ sh $v1, 0x2e($sp) -.L800B2A28: -/* 0B3628 800B2A28 0C02D148 */ jal func_800B4520 -/* 0B362C 800B2A2C A7A50036 */ sh $a1, 0x36($sp) -/* 0B3630 800B2A30 97A3002E */ lhu $v1, 0x2e($sp) -/* 0B3634 800B2A34 144002A8 */ bnez $v0, .L800B34D8 -/* 0B3638 800B2A38 97A50036 */ lhu $a1, 0x36($sp) -/* 0B363C 800B2A3C 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B3640 800B2A40 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B3644 800B2A44 910C0000 */ lbu $t4, ($t0) -/* 0B3648 800B2A48 3C188019 */ lui $t8, %hi(gPlayerCount) # 0x8019 -/* 0B364C 800B2A4C 2D810009 */ sltiu $at, $t4, 9 -/* 0B3650 800B2A50 10200293 */ beqz $at, .L800B34A0 -/* 0B3654 800B2A54 000C6080 */ sll $t4, $t4, 2 -/* 0B3658 800B2A58 3C01800F */ lui $at, %hi(jpt_800F2DFC) # 0x800f -/* 0B365C 800B2A5C 002C0821 */ addu $at, $at, $t4 -/* 0B3660 800B2A60 8C2C2DFC */ lw $t4, %lo(jpt_800F2DFC)($at) # 0x2dfc($at) -/* 0B3664 800B2A64 01800008 */ jr $t4 -/* 0B3668 800B2A68 00000000 */ nop -glabel L800B2A6C # case 0 -/* 0B366C 800B2A6C 3C0D8019 */ lui $t5, %hi(gPlayerCount) # $t5, 0x8019 -/* 0B3670 800B2A70 81ADEDF3 */ lb $t5, %lo(gPlayerCount)($t5) -/* 0B3674 800B2A74 3C0F800F */ lui $t7, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3678 800B2A78 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B367C 800B2A7C 01ED7821 */ addu $t7, $t7, $t5 -/* 0B3680 800B2A80 81EF86AB */ lb $t7, %lo((D_800E86AC - 1))($t7) # -0x7955($t7) -/* 0B3684 800B2A84 000D7080 */ sll $t6, $t5, 2 -/* 0B3688 800B2A88 01CD7023 */ subu $t6, $t6, $t5 -/* 0B368C 800B2A8C 000E7080 */ sll $t6, $t6, 2 -/* 0B3690 800B2A90 000FC080 */ sll $t8, $t7, 2 -/* 0B3694 800B2A94 01D8C821 */ addu $t9, $t6, $t8 -/* 0B3698 800B2A98 00791821 */ addu $v1, $v1, $t9 -/* 0B369C 800B2A9C 1000028C */ b .L800B34D0 -/* 0B36A0 800B2AA0 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -glabel L800B2AA4 # case 3 -/* 0B36A4 800B2AA4 30690100 */ andi $t1, $v1, 0x100 -/* 0B36A8 800B2AA8 11200010 */ beqz $t1, .L800B2AEC -/* 0B36AC 800B2AAC 00603025 */ move $a2, $v1 -/* 0B36B0 800B2AB0 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B36B4 800B2AB4 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B36B8 800B2AB8 28410004 */ slti $at, $v0, 4 -/* 0B36BC 800B2ABC 1020000B */ beqz $at, .L800B2AEC -/* 0B36C0 800B2AC0 244A0001 */ addiu $t2, $v0, 1 -/* 0B36C4 800B2AC4 3C018019 */ lui $at, %hi(gPlayerCount) # $at, 0x8019 -/* 0B36C8 800B2AC8 A02AEDF3 */ sb $t2, %lo(gPlayerCount)($at) -/* 0B36CC 800B2ACC 0C02D12B */ jal func_800B44AC -/* 0B36D0 800B2AD0 AFA3001C */ sw $v1, 0x1c($sp) -/* 0B36D4 800B2AD4 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B36D8 800B2AD8 0C032384 */ jal play_sound2 -/* 0B36DC 800B2ADC 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B36E0 800B2AE0 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B36E4 800B2AE4 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B36E8 800B2AE8 8FA6001C */ lw $a2, 0x1c($sp) -.L800B2AEC: -/* 0B36EC 800B2AEC 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B36F0 800B2AF0 30CB0200 */ andi $t3, $a2, 0x200 -/* 0B36F4 800B2AF4 11600010 */ beqz $t3, .L800B2B38 -/* 0B36F8 800B2AF8 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B36FC 800B2AFC 28410002 */ slti $at, $v0, 2 -/* 0B3700 800B2B00 1420000D */ bnez $at, .L800B2B38 -/* 0B3704 800B2B04 244CFFFF */ addiu $t4, $v0, -1 -/* 0B3708 800B2B08 3C018019 */ lui $at, %hi(gPlayerCount) # $at, 0x8019 -/* 0B370C 800B2B0C A02CEDF3 */ sb $t4, %lo(gPlayerCount)($at) -/* 0B3710 800B2B10 0C02D12B */ jal func_800B44AC -/* 0B3714 800B2B14 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B3718 800B2B18 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B371C 800B2B1C 0C032384 */ jal play_sound2 -/* 0B3720 800B2B20 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B3724 800B2B24 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3728 800B2B28 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B372C 800B2B2C 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B3730 800B2B30 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3734 800B2B34 8FA6001C */ lw $a2, 0x1c($sp) -.L800B2B38: -/* 0B3738 800B2B38 3C04800E */ lui $a0, %hi(gPlayerCountSelection1) # $a0, 0x800e -/* 0B373C 800B2B3C 2484C538 */ addiu $a0, %lo(gPlayerCountSelection1) # addiu $a0, $a0, -0x3ac8 -/* 0B3740 800B2B40 24070001 */ li $a3, 1 -/* 0B3744 800B2B44 AC820000 */ sw $v0, ($a0) -/* 0B3748 800B2B48 1047000A */ beq $v0, $a3, .L800B2B74 -/* 0B374C 800B2B4C 00401825 */ move $v1, $v0 -/* 0B3750 800B2B50 24010002 */ li $at, 2 -/* 0B3754 800B2B54 1061000A */ beq $v1, $at, .L800B2B80 -/* 0B3758 800B2B58 24040003 */ li $a0, 3 -/* 0B375C 800B2B5C 1064000B */ beq $v1, $a0, .L800B2B8C -/* 0B3760 800B2B60 24010004 */ li $at, 4 -/* 0B3764 800B2B64 10610009 */ beq $v1, $at, .L800B2B8C -/* 0B3768 800B2B68 00000000 */ nop -/* 0B376C 800B2B6C 1000000A */ b .L800B2B98 -/* 0B3770 800B2B70 30CD4000 */ andi $t5, $a2, 0x4000 -.L800B2B74: -/* 0B3774 800B2B74 3C01800E */ lui $at, %hi(gScreenModeSelection) # $at, 0x800e -/* 0B3778 800B2B78 10000006 */ b .L800B2B94 -/* 0B377C 800B2B7C AC20C530 */ sw $zero, %lo(gScreenModeSelection)($at) -.L800B2B80: -/* 0B3780 800B2B80 3C01800E */ lui $at, %hi(gScreenModeSelection) # $at, 0x800e -/* 0B3784 800B2B84 10000003 */ b .L800B2B94 -/* 0B3788 800B2B88 AC27C530 */ sw $a3, %lo(gScreenModeSelection)($at) -.L800B2B8C: -/* 0B378C 800B2B8C 3C01800E */ lui $at, %hi(gScreenModeSelection) # $at, 0x800e -/* 0B3790 800B2B90 AC24C530 */ sw $a0, %lo(gScreenModeSelection)($at) -.L800B2B94: -/* 0B3794 800B2B94 30CD4000 */ andi $t5, $a2, 0x4000 -.L800B2B98: -/* 0B3798 800B2B98 11A00019 */ beqz $t5, .L800B2C00 -/* 0B379C 800B2B9C 30CA8000 */ andi $t2, $a2, 0x8000 -/* 0B37A0 800B2BA0 0C02783C */ jal func_8009E0F0 -/* 0B37A4 800B2BA4 24040014 */ li $a0, 20 -/* 0B37A8 800B2BA8 0C0328CC */ jal func_800CA330 -/* 0B37AC 800B2BAC 24040019 */ li $a0, 25 -/* 0B37B0 800B2BB0 24070001 */ li $a3, 1 -/* 0B37B4 800B2BB4 3C018019 */ lui $at, %hi(D_8018EDE0) # $at, 0x8019 -/* 0B37B8 800B2BB8 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B37BC 800B2BBC AC27EDE0 */ sw $a3, %lo(D_8018EDE0)($at) -/* 0B37C0 800B2BC0 0C032384 */ jal play_sound2 -/* 0B37C4 800B2BC4 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B37C8 800B2BC8 3C0F8019 */ lui $t7, %hi(gPlayerCount) # $t7, 0x8019 -/* 0B37CC 800B2BCC 81EFEDF3 */ lb $t7, %lo(gPlayerCount)($t7) -/* 0B37D0 800B2BD0 3C18800F */ lui $t8, %hi((D_800E86AC - 1)) # 0x800f -/* 0B37D4 800B2BD4 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B37D8 800B2BD8 030FC021 */ addu $t8, $t8, $t7 -/* 0B37DC 800B2BDC 831886AB */ lb $t8, %lo((D_800E86AC - 1))($t8) # -0x7955($t8) -/* 0B37E0 800B2BE0 000F7080 */ sll $t6, $t7, 2 -/* 0B37E4 800B2BE4 01CF7023 */ subu $t6, $t6, $t7 -/* 0B37E8 800B2BE8 000E7080 */ sll $t6, $t6, 2 -/* 0B37EC 800B2BEC 0018C880 */ sll $t9, $t8, 2 -/* 0B37F0 800B2BF0 01D94821 */ addu $t1, $t6, $t9 -/* 0B37F4 800B2BF4 00691821 */ addu $v1, $v1, $t1 -/* 0B37F8 800B2BF8 10000235 */ b .L800B34D0 -/* 0B37FC 800B2BFC 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B2C00: -/* 0B3800 800B2C00 11400015 */ beqz $t2, .L800B2C58 -/* 0B3804 800B2C04 30D90020 */ andi $t9, $a2, 0x20 -/* 0B3808 800B2C08 240B0004 */ li $t3, 4 -/* 0B380C 800B2C0C 0C02D12B */ jal func_800B44AC -/* 0B3810 800B2C10 A10B0000 */ sb $t3, ($t0) -/* 0B3814 800B2C14 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B3818 800B2C18 0C032384 */ jal play_sound2 -/* 0B381C 800B2C1C 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B3820 800B2C20 3C0C8019 */ lui $t4, %hi(gPlayerCount) # $t4, 0x8019 -/* 0B3824 800B2C24 818CEDF3 */ lb $t4, %lo(gPlayerCount)($t4) -/* 0B3828 800B2C28 3C0F800F */ lui $t7, %hi((D_800E86AC - 1)) # 0x800f -/* 0B382C 800B2C2C 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3830 800B2C30 01EC7821 */ addu $t7, $t7, $t4 -/* 0B3834 800B2C34 81EF86AB */ lb $t7, %lo((D_800E86AC - 1))($t7) # -0x7955($t7) -/* 0B3838 800B2C38 000C6880 */ sll $t5, $t4, 2 -/* 0B383C 800B2C3C 01AC6823 */ subu $t5, $t5, $t4 -/* 0B3840 800B2C40 000D6880 */ sll $t5, $t5, 2 -/* 0B3844 800B2C44 000FC080 */ sll $t8, $t7, 2 -/* 0B3848 800B2C48 01B87021 */ addu $t6, $t5, $t8 -/* 0B384C 800B2C4C 006E1821 */ addu $v1, $v1, $t6 -/* 0B3850 800B2C50 1000021F */ b .L800B34D0 -/* 0B3854 800B2C54 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B2C58: -/* 0B3858 800B2C58 13200014 */ beqz $t9, .L800B2CAC -/* 0B385C 800B2C5C 30CD0010 */ andi $t5, $a2, 0x10 -/* 0B3860 800B2C60 0C0278A0 */ jal func_8009E280 -/* 0B3864 800B2C64 A1070000 */ sb $a3, ($t0) -/* 0B3868 800B2C68 3C044900 */ lui $a0, (0x49009010 >> 16) # lui $a0, 0x4900 -/* 0B386C 800B2C6C 0C032384 */ jal play_sound2 -/* 0B3870 800B2C70 34849010 */ ori $a0, (0x49009010 & 0xFFFF) # ori $a0, $a0, 0x9010 -/* 0B3874 800B2C74 3C098019 */ lui $t1, %hi(gPlayerCount) # $t1, 0x8019 -/* 0B3878 800B2C78 8129EDF3 */ lb $t1, %lo(gPlayerCount)($t1) -/* 0B387C 800B2C7C 3C0B800F */ lui $t3, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3880 800B2C80 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3884 800B2C84 01695821 */ addu $t3, $t3, $t1 -/* 0B3888 800B2C88 816B86AB */ lb $t3, %lo((D_800E86AC - 1))($t3) # -0x7955($t3) -/* 0B388C 800B2C8C 00095080 */ sll $t2, $t1, 2 -/* 0B3890 800B2C90 01495023 */ subu $t2, $t2, $t1 -/* 0B3894 800B2C94 000A5080 */ sll $t2, $t2, 2 -/* 0B3898 800B2C98 000B6080 */ sll $t4, $t3, 2 -/* 0B389C 800B2C9C 014C7821 */ addu $t7, $t2, $t4 -/* 0B38A0 800B2CA0 006F1821 */ addu $v1, $v1, $t7 -/* 0B38A4 800B2CA4 1000020A */ b .L800B34D0 -/* 0B38A8 800B2CA8 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B2CAC: -/* 0B38AC 800B2CAC 11A00015 */ beqz $t5, .L800B2D04 -/* 0B38B0 800B2CB0 00026080 */ sll $t4, $v0, 2 -/* 0B38B4 800B2CB4 24180002 */ li $t8, 2 -/* 0B38B8 800B2CB8 0C027896 */ jal func_8009E258 -/* 0B38BC 800B2CBC A1180000 */ sb $t8, ($t0) -/* 0B38C0 800B2CC0 3C044900 */ lui $a0, (0x49009011 >> 16) # lui $a0, 0x4900 -/* 0B38C4 800B2CC4 0C032384 */ jal play_sound2 -/* 0B38C8 800B2CC8 34849011 */ ori $a0, (0x49009011 & 0xFFFF) # ori $a0, $a0, 0x9011 -/* 0B38CC 800B2CCC 3C0E8019 */ lui $t6, %hi(gPlayerCount) # $t6, 0x8019 -/* 0B38D0 800B2CD0 81CEEDF3 */ lb $t6, %lo(gPlayerCount)($t6) -/* 0B38D4 800B2CD4 3C09800F */ lui $t1, %hi((D_800E86AC - 1)) # 0x800f -/* 0B38D8 800B2CD8 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B38DC 800B2CDC 012E4821 */ addu $t1, $t1, $t6 -/* 0B38E0 800B2CE0 812986AB */ lb $t1, %lo((D_800E86AC - 1))($t1) # -0x7955($t1) -/* 0B38E4 800B2CE4 000EC880 */ sll $t9, $t6, 2 -/* 0B38E8 800B2CE8 032EC823 */ subu $t9, $t9, $t6 -/* 0B38EC 800B2CEC 0019C880 */ sll $t9, $t9, 2 -/* 0B38F0 800B2CF0 00095880 */ sll $t3, $t1, 2 -/* 0B38F4 800B2CF4 032B5021 */ addu $t2, $t9, $t3 -/* 0B38F8 800B2CF8 006A1821 */ addu $v1, $v1, $t2 -/* 0B38FC 800B2CFC 100001F4 */ b .L800B34D0 -/* 0B3900 800B2D00 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B2D04: -/* 0B3904 800B2D04 3C0F800F */ lui $t7, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3908 800B2D08 01E27821 */ addu $t7, $t7, $v0 -/* 0B390C 800B2D0C 81EF86AB */ lb $t7, %lo((D_800E86AC - 1))($t7) # -0x7955($t7) -/* 0B3910 800B2D10 01826023 */ subu $t4, $t4, $v0 -/* 0B3914 800B2D14 000C6080 */ sll $t4, $t4, 2 -/* 0B3918 800B2D18 000F6880 */ sll $t5, $t7, 2 -/* 0B391C 800B2D1C 018DC021 */ addu $t8, $t4, $t5 -/* 0B3920 800B2D20 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3924 800B2D24 00781821 */ addu $v1, $v1, $t8 -/* 0B3928 800B2D28 100001E9 */ b .L800B34D0 -/* 0B392C 800B2D2C 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -glabel L800B2D30 # case 4 -/* 0B3930 800B2D30 306E0400 */ andi $t6, $v1, 0x400 -/* 0B3934 800B2D34 11C00017 */ beqz $t6, .L800B2D94 -/* 0B3938 800B2D38 00603025 */ move $a2, $v1 -/* 0B393C 800B2D3C 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3940 800B2D40 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3944 800B2D44 3C09800F */ lui $t1, %hi(D_800E86AC) # $t1, 0x800f -/* 0B3948 800B2D48 252986AC */ addiu $t1, %lo(D_800E86AC) # addiu $t1, $t1, -0x7954 -/* 0B394C 800B2D4C 3C19800F */ lui $t9, %hi((gPlayerModeSelection - 1)) # 0x800f -/* 0B3950 800B2D50 0322C821 */ addu $t9, $t9, $v0 -/* 0B3954 800B2D54 00491821 */ addu $v1, $v0, $t1 -/* 0B3958 800B2D58 8064FFFF */ lb $a0, -1($v1) -/* 0B395C 800B2D5C 83392B5F */ lb $t9, %lo((gPlayerModeSelection - 1))($t9) # 0x2b5f($t9) -/* 0B3960 800B2D60 248B0001 */ addiu $t3, $a0, 1 -/* 0B3964 800B2D64 0099082A */ slt $at, $a0, $t9 -/* 0B3968 800B2D68 5020000B */ beql $at, $zero, .L800B2D98 -/* 0B396C 800B2D6C 30CA0800 */ andi $t2, $a2, 0x800 -/* 0B3970 800B2D70 A06BFFFF */ sb $t3, -1($v1) -/* 0B3974 800B2D74 0C02D12B */ jal func_800B44AC -/* 0B3978 800B2D78 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B397C 800B2D7C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B3980 800B2D80 0C032384 */ jal play_sound2 -/* 0B3984 800B2D84 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B3988 800B2D88 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B398C 800B2D8C 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B3990 800B2D90 8FA6001C */ lw $a2, 0x1c($sp) -.L800B2D94: -/* 0B3994 800B2D94 30CA0800 */ andi $t2, $a2, 0x800 -.L800B2D98: -/* 0B3998 800B2D98 11400011 */ beqz $t2, .L800B2DE0 -/* 0B399C 800B2D9C 3C0F8019 */ lui $t7, %hi(gPlayerCount) # $t7, 0x8019 -/* 0B39A0 800B2DA0 81EFEDF3 */ lb $t7, %lo(gPlayerCount)($t7) -/* 0B39A4 800B2DA4 3C0C800F */ lui $t4, %hi(D_800E86AC) # $t4, 0x800f -/* 0B39A8 800B2DA8 258C86AC */ addiu $t4, %lo(D_800E86AC) # addiu $t4, $t4, -0x7954 -/* 0B39AC 800B2DAC 01EC1821 */ addu $v1, $t7, $t4 -/* 0B39B0 800B2DB0 8064FFFF */ lb $a0, -1($v1) -/* 0B39B4 800B2DB4 1880000A */ blez $a0, .L800B2DE0 -/* 0B39B8 800B2DB8 248DFFFF */ addiu $t5, $a0, -1 -/* 0B39BC 800B2DBC A06DFFFF */ sb $t5, -1($v1) -/* 0B39C0 800B2DC0 0C02D12B */ jal func_800B44AC -/* 0B39C4 800B2DC4 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B39C8 800B2DC8 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B39CC 800B2DCC 0C032384 */ jal play_sound2 -/* 0B39D0 800B2DD0 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B39D4 800B2DD4 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B39D8 800B2DD8 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B39DC 800B2DDC 8FA6001C */ lw $a2, 0x1c($sp) -.L800B2DE0: -/* 0B39E0 800B2DE0 30D84000 */ andi $t8, $a2, 0x4000 -/* 0B39E4 800B2DE4 13000015 */ beqz $t8, .L800B2E3C -/* 0B39E8 800B2DE8 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B39EC 800B2DEC 24040003 */ li $a0, 3 -/* 0B39F0 800B2DF0 0C02D12B */ jal func_800B44AC -/* 0B39F4 800B2DF4 A1040000 */ sb $a0, ($t0) -/* 0B39F8 800B2DF8 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B39FC 800B2DFC 0C032384 */ jal play_sound2 -/* 0B3A00 800B2E00 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B3A04 800B2E04 3C0E8019 */ lui $t6, %hi(gPlayerCount) # $t6, 0x8019 -/* 0B3A08 800B2E08 81CEEDF3 */ lb $t6, %lo(gPlayerCount)($t6) -/* 0B3A0C 800B2E0C 3C19800F */ lui $t9, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3A10 800B2E10 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3A14 800B2E14 032EC821 */ addu $t9, $t9, $t6 -/* 0B3A18 800B2E18 833986AB */ lb $t9, %lo((D_800E86AC - 1))($t9) # -0x7955($t9) -/* 0B3A1C 800B2E1C 000E4880 */ sll $t1, $t6, 2 -/* 0B3A20 800B2E20 012E4823 */ subu $t1, $t1, $t6 -/* 0B3A24 800B2E24 00094880 */ sll $t1, $t1, 2 -/* 0B3A28 800B2E28 00195880 */ sll $t3, $t9, 2 -/* 0B3A2C 800B2E2C 012B5021 */ addu $t2, $t1, $t3 -/* 0B3A30 800B2E30 006A1821 */ addu $v1, $v1, $t2 -/* 0B3A34 800B2E34 100001A6 */ b .L800B34D0 -/* 0B3A38 800B2E38 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B2E3C: -/* 0B3A3C 800B2E3C 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3A40 800B2E40 3C04800F */ lui $a0, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3A44 800B2E44 30CF8000 */ andi $t7, $a2, 0x8000 -/* 0B3A48 800B2E48 00822021 */ addu $a0, $a0, $v0 -/* 0B3A4C 800B2E4C 11E0003F */ beqz $t7, .L800B2F4C -/* 0B3A50 800B2E50 808486AB */ lb $a0, %lo((D_800E86AC - 1))($a0) # -0x7955($a0) -/* 0B3A54 800B2E54 00026080 */ sll $t4, $v0, 2 -/* 0B3A58 800B2E58 01826023 */ subu $t4, $t4, $v0 -/* 0B3A5C 800B2E5C 000C6080 */ sll $t4, $t4, 2 -/* 0B3A60 800B2E60 00046880 */ sll $t5, $a0, 2 -/* 0B3A64 800B2E64 018DC021 */ addu $t8, $t4, $t5 -/* 0B3A68 800B2E68 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3A6C 800B2E6C 00781821 */ addu $v1, $v1, $t8 -/* 0B3A70 800B2E70 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -/* 0B3A74 800B2E74 3C044900 */ lui $a0, (0x4900900A >> 16) # lui $a0, 0x4900 -/* 0B3A78 800B2E78 24190005 */ li $t9, 5 -/* 0B3A7C 800B2E7C 1060000D */ beqz $v1, .L800B2EB4 -/* 0B3A80 800B2E80 3484900A */ ori $a0, (0x4900900A & 0xFFFF) # ori $a0, $a0, 0x900a -/* 0B3A84 800B2E84 24070001 */ li $a3, 1 -/* 0B3A88 800B2E88 10670014 */ beq $v1, $a3, .L800B2EDC -/* 0B3A8C 800B2E8C 240B0005 */ li $t3, 5 -/* 0B3A90 800B2E90 24010002 */ li $at, 2 -/* 0B3A94 800B2E94 1061000B */ beq $v1, $at, .L800B2EC4 -/* 0B3A98 800B2E98 24090005 */ li $t1, 5 -/* 0B3A9C 800B2E9C 24040003 */ li $a0, 3 -/* 0B3AA0 800B2EA0 10640014 */ beq $v1, $a0, .L800B2EF4 -/* 0B3AA4 800B2EA4 240A0006 */ li $t2, 6 -/* 0B3AA8 800B2EA8 240E0006 */ li $t6, 6 -/* 0B3AAC 800B2EAC 10000015 */ b .L800B2F04 -/* 0B3AB0 800B2EB0 A10E0000 */ sb $t6, ($t0) -.L800B2EB4: # case 0 -/* 0B3AB4 800B2EB4 0C032384 */ jal play_sound2 -/* 0B3AB8 800B2EB8 A1190000 */ sb $t9, ($t0) -/* 0B3ABC 800B2EBC 10000011 */ b .L800B2F04 -/* 0B3AC0 800B2EC0 00000000 */ nop -.L800B2EC4: -/* 0B3AC4 800B2EC4 3C044900 */ lui $a0, (0x4900900C >> 16) # lui $a0, 0x4900 -/* 0B3AC8 800B2EC8 A1090000 */ sb $t1, ($t0) -/* 0B3ACC 800B2ECC 0C032384 */ jal play_sound2 -/* 0B3AD0 800B2ED0 3484900C */ ori $a0, (0x4900900C & 0xFFFF) # ori $a0, $a0, 0x900c -/* 0B3AD4 800B2ED4 1000000B */ b .L800B2F04 -/* 0B3AD8 800B2ED8 00000000 */ nop -.L800B2EDC: -/* 0B3ADC 800B2EDC 3C044900 */ lui $a0, (0x4900900B >> 16) # lui $a0, 0x4900 -/* 0B3AE0 800B2EE0 A10B0000 */ sb $t3, ($t0) -/* 0B3AE4 800B2EE4 0C032384 */ jal play_sound2 -/* 0B3AE8 800B2EE8 3484900B */ ori $a0, (0x4900900B & 0xFFFF) # ori $a0, $a0, 0x900b -/* 0B3AEC 800B2EEC 10000005 */ b .L800B2F04 -/* 0B3AF0 800B2EF0 00000000 */ nop -.L800B2EF4: -/* 0B3AF4 800B2EF4 3C044900 */ lui $a0, (0x4900900D >> 16) # lui $a0, 0x4900 -/* 0B3AF8 800B2EF8 A10A0000 */ sb $t2, ($t0) -/* 0B3AFC 800B2EFC 0C032384 */ jal play_sound2 -/* 0B3B00 800B2F00 3484900D */ ori $a0, (0x4900900D & 0xFFFF) # ori $a0, $a0, 0x900d -.L800B2F04: -/* 0B3B04 800B2F04 0C02D12B */ jal func_800B44AC -/* 0B3B08 800B2F08 00000000 */ nop -/* 0B3B0C 800B2F0C 3C0F8019 */ lui $t7, %hi(gPlayerCount) # $t7, 0x8019 -/* 0B3B10 800B2F10 81EFEDF3 */ lb $t7, %lo(gPlayerCount)($t7) -/* 0B3B14 800B2F14 3C0D800F */ lui $t5, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3B18 800B2F18 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3B1C 800B2F1C 01AF6821 */ addu $t5, $t5, $t7 -/* 0B3B20 800B2F20 81AD86AB */ lb $t5, %lo((D_800E86AC - 1))($t5) # -0x7955($t5) -/* 0B3B24 800B2F24 000F6080 */ sll $t4, $t7, 2 -/* 0B3B28 800B2F28 018F6023 */ subu $t4, $t4, $t7 -/* 0B3B2C 800B2F2C 000C6080 */ sll $t4, $t4, 2 -/* 0B3B30 800B2F30 000DC080 */ sll $t8, $t5, 2 -/* 0B3B34 800B2F34 01987021 */ addu $t6, $t4, $t8 -/* 0B3B38 800B2F38 3C018019 */ lui $at, %hi(gMenuTimingCounter) # $at, 0x8019 -/* 0B3B3C 800B2F3C 006E1821 */ addu $v1, $v1, $t6 -/* 0B3B40 800B2F40 AC20EE00 */ sw $zero, %lo(gMenuTimingCounter)($at) -/* 0B3B44 800B2F44 10000162 */ b .L800B34D0 -/* 0B3B48 800B2F48 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B2F4C: -/* 0B3B4C 800B2F4C 0002C880 */ sll $t9, $v0, 2 -/* 0B3B50 800B2F50 0322C823 */ subu $t9, $t9, $v0 -/* 0B3B54 800B2F54 0019C880 */ sll $t9, $t9, 2 -/* 0B3B58 800B2F58 00044880 */ sll $t1, $a0, 2 -/* 0B3B5C 800B2F5C 03295821 */ addu $t3, $t9, $t1 -/* 0B3B60 800B2F60 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3B64 800B2F64 006B1821 */ addu $v1, $v1, $t3 -/* 0B3B68 800B2F68 10000159 */ b .L800B34D0 -/* 0B3B6C 800B2F6C 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -glabel L800B2F70 # case 5, 8 -/* 0B3B70 800B2F70 14A00023 */ bnez $a1, .L800B3000 -/* 0B3B74 800B2F74 00603025 */ move $a2, $v1 -/* 0B3B78 800B2F78 3C0A8019 */ lui $t2, %hi(gMenuTimingCounter) # $t2, 0x8019 -/* 0B3B7C 800B2F7C 8D4AEE00 */ lw $t2, %lo(gMenuTimingCounter)($t2) -/* 0B3B80 800B2F80 3C018019 */ lui $at, %hi(gMenuTimingCounter) # $at, 0x8019 -/* 0B3B84 800B2F84 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3B88 800B2F88 254F0001 */ addiu $t7, $t2, 1 -/* 0B3B8C 800B2F8C AC2FEE00 */ sw $t7, %lo(gMenuTimingCounter)($at) -/* 0B3B90 800B2F90 24010064 */ li $at, 100 -/* 0B3B94 800B2F94 11E10005 */ beq $t7, $at, .L800B2FAC -/* 0B3B98 800B2F98 2401012C */ li $at, 300 -/* 0B3B9C 800B2F9C 01E1001A */ div $zero, $t7, $at -/* 0B3BA0 800B2FA0 00006810 */ mfhi $t5 -/* 0B3BA4 800B2FA4 15A00016 */ bnez $t5, .L800B3000 -/* 0B3BA8 800B2FA8 00000000 */ nop -.L800B2FAC: -/* 0B3BAC 800B2FAC 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3BB0 800B2FB0 3C18800F */ lui $t8, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3BB4 800B2FB4 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3BB8 800B2FB8 0302C021 */ addu $t8, $t8, $v0 -/* 0B3BBC 800B2FBC 831886AB */ lb $t8, %lo((D_800E86AC - 1))($t8) # -0x7955($t8) -/* 0B3BC0 800B2FC0 00026080 */ sll $t4, $v0, 2 -/* 0B3BC4 800B2FC4 01826023 */ subu $t4, $t4, $v0 -/* 0B3BC8 800B2FC8 000C6080 */ sll $t4, $t4, 2 -/* 0B3BCC 800B2FCC 00187080 */ sll $t6, $t8, 2 -/* 0B3BD0 800B2FD0 018EC821 */ addu $t9, $t4, $t6 -/* 0B3BD4 800B2FD4 00791821 */ addu $v1, $v1, $t9 -/* 0B3BD8 800B2FD8 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -/* 0B3BDC 800B2FDC 3C044900 */ lui $a0, (0x4900900E >> 16) # lui $a0, 0x4900 -/* 0B3BE0 800B2FE0 24010002 */ li $at, 2 -/* 0B3BE4 800B2FE4 10600003 */ beqz $v1, .L800B2FF4 -/* 0B3BE8 800B2FE8 3484900E */ ori $a0, (0x4900900E & 0xFFFF) # ori $a0, $a0, 0x900e -/* 0B3BEC 800B2FEC 14610004 */ bne $v1, $at, .L800B3000 -/* 0B3BF0 800B2FF0 00000000 */ nop -.L800B2FF4: -/* 0B3BF4 800B2FF4 0C032384 */ jal play_sound2 -/* 0B3BF8 800B2FF8 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B3BFC 800B2FFC 8FA6001C */ lw $a2, 0x1c($sp) -.L800B3000: -/* 0B3C00 800B3000 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3C04 800B3004 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3C08 800B3008 3C0B800F */ lui $t3, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3C0C 800B300C 3C0F800F */ lui $t7, %hi(D_800E86B0) # $t7, 0x800f -/* 0B3C10 800B3010 01625821 */ addu $t3, $t3, $v0 -/* 0B3C14 800B3014 816B86AB */ lb $t3, %lo((D_800E86AC - 1))($t3) # -0x7955($t3) -/* 0B3C18 800B3018 00024880 */ sll $t1, $v0, 2 -/* 0B3C1C 800B301C 01224823 */ subu $t1, $t1, $v0 -/* 0B3C20 800B3020 25EF86B0 */ addiu $t7, %lo(D_800E86B0) # addiu $t7, $t7, -0x7950 -/* 0B3C24 800B3024 012B5021 */ addu $t2, $t1, $t3 -/* 0B3C28 800B3028 014F1821 */ addu $v1, $t2, $t7 -/* 0B3C2C 800B302C 8064FFFD */ lb $a0, -3($v1) -/* 0B3C30 800B3030 30CD0800 */ andi $t5, $a2, 0x800 -/* 0B3C34 800B3034 11A0000C */ beqz $t5, .L800B3068 -/* 0B3C38 800B3038 00802825 */ move $a1, $a0 -/* 0B3C3C 800B303C 1880000A */ blez $a0, .L800B3068 -/* 0B3C40 800B3040 2498FFFF */ addiu $t8, $a0, -1 -/* 0B3C44 800B3044 A078FFFD */ sb $t8, -3($v1) -/* 0B3C48 800B3048 AFA40028 */ sw $a0, 0x28($sp) -/* 0B3C4C 800B304C 0C02D12B */ jal func_800B44AC -/* 0B3C50 800B3050 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B3C54 800B3054 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B3C58 800B3058 0C032384 */ jal play_sound2 -/* 0B3C5C 800B305C 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B3C60 800B3060 8FA50028 */ lw $a1, 0x28($sp) -/* 0B3C64 800B3064 8FA6001C */ lw $a2, 0x1c($sp) -.L800B3068: -/* 0B3C68 800B3068 30CC0400 */ andi $t4, $a2, 0x400 -/* 0B3C6C 800B306C 11800038 */ beqz $t4, .L800B3150 -/* 0B3C70 800B3070 00000000 */ nop -/* 0B3C74 800B3074 AFA00024 */ sw $zero, 0x24($sp) -/* 0B3C78 800B3078 AFA50028 */ sw $a1, 0x28($sp) -/* 0B3C7C 800B307C 0C02D557 */ jal func_800B555C -/* 0B3C80 800B3080 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B3C84 800B3084 8FA30024 */ lw $v1, 0x24($sp) -/* 0B3C88 800B3088 8FA50028 */ lw $a1, 0x28($sp) -/* 0B3C8C 800B308C 10400011 */ beqz $v0, .L800B30D4 -/* 0B3C90 800B3090 8FA6001C */ lw $a2, 0x1c($sp) -/* 0B3C94 800B3094 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3C98 800B3098 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3C9C 800B309C 3C04800F */ lui $a0, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3CA0 800B30A0 3C09800F */ lui $t1, %hi((gGameModePlayerColumnExtra - 3)) # 0x800f -/* 0B3CA4 800B30A4 00822021 */ addu $a0, $a0, $v0 -/* 0B3CA8 800B30A8 808486AB */ lb $a0, %lo((D_800E86AC - 1))($a0) # -0x7955($a0) -/* 0B3CAC 800B30AC 00027080 */ sll $t6, $v0, 2 -/* 0B3CB0 800B30B0 01C27023 */ subu $t6, $t6, $v0 -/* 0B3CB4 800B30B4 01C4C821 */ addu $t9, $t6, $a0 -/* 0B3CB8 800B30B8 01394821 */ addu $t1, $t1, $t9 -/* 0B3CBC 800B30BC 81292B6D */ lb $t1, %lo((gGameModePlayerColumnExtra - 3))($t1) # 0x2b6d($t1) -/* 0B3CC0 800B30C0 00A9082A */ slt $at, $a1, $t1 -/* 0B3CC4 800B30C4 10200012 */ beqz $at, .L800B3110 -/* 0B3CC8 800B30C8 00000000 */ nop -/* 0B3CCC 800B30CC 10000010 */ b .L800B3110 -/* 0B3CD0 800B30D0 24030001 */ li $v1, 1 -.L800B30D4: -/* 0B3CD4 800B30D4 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3CD8 800B30D8 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3CDC 800B30DC 3C04800F */ lui $a0, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3CE0 800B30E0 3C0F800F */ lui $t7, %hi((gGameModePlayerColumnDefault - 3)) # 0x800f -/* 0B3CE4 800B30E4 00822021 */ addu $a0, $a0, $v0 -/* 0B3CE8 800B30E8 808486AB */ lb $a0, %lo((D_800E86AC - 1))($a0) # -0x7955($a0) -/* 0B3CEC 800B30EC 00025880 */ sll $t3, $v0, 2 -/* 0B3CF0 800B30F0 01625823 */ subu $t3, $t3, $v0 -/* 0B3CF4 800B30F4 01645021 */ addu $t2, $t3, $a0 -/* 0B3CF8 800B30F8 01EA7821 */ addu $t7, $t7, $t2 -/* 0B3CFC 800B30FC 81EF2B61 */ lb $t7, %lo((gGameModePlayerColumnDefault - 3))($t7) # 0x2b61($t7) -/* 0B3D00 800B3100 00AF082A */ slt $at, $a1, $t7 -/* 0B3D04 800B3104 10200002 */ beqz $at, .L800B3110 -/* 0B3D08 800B3108 00000000 */ nop -/* 0B3D0C 800B310C 24030001 */ li $v1, 1 -.L800B3110: -/* 0B3D10 800B3110 1060000F */ beqz $v1, .L800B3150 -/* 0B3D14 800B3114 00026880 */ sll $t5, $v0, 2 -/* 0B3D18 800B3118 01A26823 */ subu $t5, $t5, $v0 -/* 0B3D1C 800B311C 3C0C800F */ lui $t4, %hi(D_800E86B0) # $t4, 0x800f -/* 0B3D20 800B3120 258C86B0 */ addiu $t4, %lo(D_800E86B0) # addiu $t4, $t4, -0x7950 -/* 0B3D24 800B3124 01A4C021 */ addu $t8, $t5, $a0 -/* 0B3D28 800B3128 030C1821 */ addu $v1, $t8, $t4 -/* 0B3D2C 800B312C 806EFFFD */ lb $t6, -3($v1) -/* 0B3D30 800B3130 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B3D34 800B3134 25D90001 */ addiu $t9, $t6, 1 -/* 0B3D38 800B3138 0C02D12B */ jal func_800B44AC -/* 0B3D3C 800B313C A079FFFD */ sb $t9, -3($v1) -/* 0B3D40 800B3140 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B3D44 800B3144 0C032384 */ jal play_sound2 -/* 0B3D48 800B3148 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B3D4C 800B314C 8FA6001C */ lw $a2, 0x1c($sp) -.L800B3150: -/* 0B3D50 800B3150 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3D54 800B3154 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3D58 800B3158 3C04800F */ lui $a0, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3D5C 800B315C 3C05800F */ lui $a1, %hi((D_800E86B0 - 3)) # 0x800f -/* 0B3D60 800B3160 00822021 */ addu $a0, $a0, $v0 -/* 0B3D64 800B3164 808486AB */ lb $a0, %lo((D_800E86AC - 1))($a0) # -0x7955($a0) -/* 0B3D68 800B3168 00024880 */ sll $t1, $v0, 2 -/* 0B3D6C 800B316C 01224823 */ subu $t1, $t1, $v0 -/* 0B3D70 800B3170 01245821 */ addu $t3, $t1, $a0 -/* 0B3D74 800B3174 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B3D78 800B3178 00AB2821 */ addu $a1, $a1, $t3 -/* 0B3D7C 800B317C 30CA4000 */ andi $t2, $a2, 0x4000 -/* 0B3D80 800B3180 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B3D84 800B3184 11400015 */ beqz $t2, .L800B31DC -/* 0B3D88 800B3188 80A586AD */ lb $a1, %lo((D_800E86B0 - 3))($a1) # -0x7953($a1) -/* 0B3D8C 800B318C 240F0004 */ li $t7, 4 -/* 0B3D90 800B3190 0C02D12B */ jal func_800B44AC -/* 0B3D94 800B3194 A10F0000 */ sb $t7, ($t0) -/* 0B3D98 800B3198 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B3D9C 800B319C 0C032384 */ jal play_sound2 -/* 0B3DA0 800B31A0 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B3DA4 800B31A4 3C0D8019 */ lui $t5, %hi(gPlayerCount) # $t5, 0x8019 -/* 0B3DA8 800B31A8 81ADEDF3 */ lb $t5, %lo(gPlayerCount)($t5) -/* 0B3DAC 800B31AC 3C0C800F */ lui $t4, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3DB0 800B31B0 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3DB4 800B31B4 018D6021 */ addu $t4, $t4, $t5 -/* 0B3DB8 800B31B8 818C86AB */ lb $t4, %lo((D_800E86AC - 1))($t4) # -0x7955($t4) -/* 0B3DBC 800B31BC 000DC080 */ sll $t8, $t5, 2 -/* 0B3DC0 800B31C0 030DC023 */ subu $t8, $t8, $t5 -/* 0B3DC4 800B31C4 0018C080 */ sll $t8, $t8, 2 -/* 0B3DC8 800B31C8 000C7080 */ sll $t6, $t4, 2 -/* 0B3DCC 800B31CC 030EC821 */ addu $t9, $t8, $t6 -/* 0B3DD0 800B31D0 00791821 */ addu $v1, $v1, $t9 -/* 0B3DD4 800B31D4 100000BE */ b .L800B34D0 -/* 0B3DD8 800B31D8 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B31DC: -/* 0B3DDC 800B31DC 30C98000 */ andi $t1, $a2, 0x8000 -/* 0B3DE0 800B31E0 1120002C */ beqz $t1, .L800B3294 -/* 0B3DE4 800B31E4 0002C880 */ sll $t9, $v0, 2 -/* 0B3DE8 800B31E8 0C02D12B */ jal func_800B44AC -/* 0B3DEC 800B31EC AFA50028 */ sw $a1, 0x28($sp) -/* 0B3DF0 800B31F0 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3DF4 800B31F4 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3DF8 800B31F8 24070001 */ li $a3, 1 -/* 0B3DFC 800B31FC 8FA50028 */ lw $a1, 0x28($sp) -/* 0B3E00 800B3200 14E2000E */ bne $a3, $v0, .L800B323C -/* 0B3E04 800B3204 3C0B800F */ lui $t3, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3E08 800B3208 01625821 */ addu $t3, $t3, $v0 -/* 0B3E0C 800B320C 816B86AB */ lb $t3, %lo((D_800E86AC - 1))($t3) # -0x7955($t3) -/* 0B3E10 800B3210 54EB000B */ bnel $a3, $t3, .L800B3240 -/* 0B3E14 800B3214 240A0006 */ li $t2, 6 -/* 0B3E18 800B3218 54A70009 */ bnel $a1, $a3, .L800B3240 -/* 0B3E1C 800B321C 240A0006 */ li $t2, 6 -/* 0B3E20 800B3220 0C027896 */ jal func_8009E258 -/* 0B3E24 800B3224 00000000 */ nop -/* 0B3E28 800B3228 3C044900 */ lui $a0, (0x49009011 >> 16) # lui $a0, 0x4900 -/* 0B3E2C 800B322C 0C032384 */ jal play_sound2 -/* 0B3E30 800B3230 34849011 */ ori $a0, (0x49009011 & 0xFFFF) # ori $a0, $a0, 0x9011 -/* 0B3E34 800B3234 10000009 */ b .L800B325C -/* 0B3E38 800B3238 00000000 */ nop -.L800B323C: -/* 0B3E3C 800B323C 240A0006 */ li $t2, 6 -.L800B3240: -/* 0B3E40 800B3240 3C018019 */ lui $at, %hi(gMainMenuSelectionDepth) # $at, 0x8019 -/* 0B3E44 800B3244 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B3E48 800B3248 A02AEDED */ sb $t2, %lo(gMainMenuSelectionDepth)($at) -/* 0B3E4C 800B324C 0C032384 */ jal play_sound2 -/* 0B3E50 800B3250 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B3E54 800B3254 3C018019 */ lui $at, %hi(gMenuTimingCounter) # $at, 0x8019 -/* 0B3E58 800B3258 AC20EE00 */ sw $zero, %lo(gMenuTimingCounter)($at) -.L800B325C: -/* 0B3E5C 800B325C 3C0F8019 */ lui $t7, %hi(gPlayerCount) # $t7, 0x8019 -/* 0B3E60 800B3260 81EFEDF3 */ lb $t7, %lo(gPlayerCount)($t7) -/* 0B3E64 800B3264 3C0C800F */ lui $t4, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3E68 800B3268 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3E6C 800B326C 018F6021 */ addu $t4, $t4, $t7 -/* 0B3E70 800B3270 818C86AB */ lb $t4, %lo((D_800E86AC - 1))($t4) # -0x7955($t4) -/* 0B3E74 800B3274 000F6880 */ sll $t5, $t7, 2 -/* 0B3E78 800B3278 01AF6823 */ subu $t5, $t5, $t7 -/* 0B3E7C 800B327C 000D6880 */ sll $t5, $t5, 2 -/* 0B3E80 800B3280 000CC080 */ sll $t8, $t4, 2 -/* 0B3E84 800B3284 01B87021 */ addu $t6, $t5, $t8 -/* 0B3E88 800B3288 006E1821 */ addu $v1, $v1, $t6 -/* 0B3E8C 800B328C 10000090 */ b .L800B34D0 -/* 0B3E90 800B3290 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B3294: -/* 0B3E94 800B3294 0322C823 */ subu $t9, $t9, $v0 -/* 0B3E98 800B3298 0019C880 */ sll $t9, $t9, 2 -/* 0B3E9C 800B329C 00044880 */ sll $t1, $a0, 2 -/* 0B3EA0 800B32A0 03295821 */ addu $t3, $t9, $t1 -/* 0B3EA4 800B32A4 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3EA8 800B32A8 006B1821 */ addu $v1, $v1, $t3 -/* 0B3EAC 800B32AC 10000088 */ b .L800B34D0 -/* 0B3EB0 800B32B0 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -glabel L800B32B4 # case 6, 7 -/* 0B3EB4 800B32B4 14A00014 */ bnez $a1, .L800B3308 -/* 0B3EB8 800B32B8 00603025 */ move $a2, $v1 -/* 0B3EBC 800B32BC 3C0A8019 */ lui $t2, %hi(gMenuTimingCounter) # $t2, 0x8019 -/* 0B3EC0 800B32C0 8D4AEE00 */ lw $t2, %lo(gMenuTimingCounter)($t2) -/* 0B3EC4 800B32C4 3C018019 */ lui $at, %hi(gMenuTimingCounter) # $at, 0x8019 -/* 0B3EC8 800B32C8 3C044900 */ lui $a0, (0x4900900F >> 16) # lui $a0, 0x4900 -/* 0B3ECC 800B32CC 254F0001 */ addiu $t7, $t2, 1 -/* 0B3ED0 800B32D0 AC2FEE00 */ sw $t7, %lo(gMenuTimingCounter)($at) -/* 0B3ED4 800B32D4 2401003C */ li $at, 60 -/* 0B3ED8 800B32D8 11E10006 */ beq $t7, $at, .L800B32F4 -/* 0B3EDC 800B32DC 3484900F */ ori $a0, (0x4900900F & 0xFFFF) # ori $a0, $a0, 0x900f -/* 0B3EE0 800B32E0 2401012C */ li $at, 300 -/* 0B3EE4 800B32E4 01E1001A */ div $zero, $t7, $at -/* 0B3EE8 800B32E8 00006010 */ mfhi $t4 -/* 0B3EEC 800B32EC 55800007 */ bnel $t4, $zero, .L800B330C -/* 0B3EF0 800B32F0 30CD4000 */ andi $t5, $a2, 0x4000 -.L800B32F4: -/* 0B3EF4 800B32F4 0C032384 */ jal play_sound2 -/* 0B3EF8 800B32F8 AFA6001C */ sw $a2, 0x1c($sp) -/* 0B3EFC 800B32FC 3C088019 */ lui $t0, %hi(gMainMenuSelectionDepth) # $t0, 0x8019 -/* 0B3F00 800B3300 2508EDED */ addiu $t0, %lo(gMainMenuSelectionDepth) # addiu $t0, $t0, -0x1213 -/* 0B3F04 800B3304 8FA6001C */ lw $a2, 0x1c($sp) -.L800B3308: -/* 0B3F08 800B3308 30CD4000 */ andi $t5, $a2, 0x4000 -.L800B330C: -/* 0B3F0C 800B330C 11A00032 */ beqz $t5, .L800B33D8 -/* 0B3F10 800B3310 30D98000 */ andi $t9, $a2, 0x8000 -/* 0B3F14 800B3314 3C028019 */ lui $v0, %hi(gPlayerCount) # $v0, 0x8019 -/* 0B3F18 800B3318 8042EDF3 */ lb $v0, %lo(gPlayerCount)($v0) -/* 0B3F1C 800B331C 3C0E800F */ lui $t6, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3F20 800B3320 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3F24 800B3324 01C27021 */ addu $t6, $t6, $v0 -/* 0B3F28 800B3328 81CE86AB */ lb $t6, %lo((D_800E86AC - 1))($t6) # -0x7955($t6) -/* 0B3F2C 800B332C 0002C080 */ sll $t8, $v0, 2 -/* 0B3F30 800B3330 0302C023 */ subu $t8, $t8, $v0 -/* 0B3F34 800B3334 0018C080 */ sll $t8, $t8, 2 -/* 0B3F38 800B3338 000EC880 */ sll $t9, $t6, 2 -/* 0B3F3C 800B333C 03194821 */ addu $t1, $t8, $t9 -/* 0B3F40 800B3340 00691821 */ addu $v1, $v1, $t1 -/* 0B3F44 800B3344 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -/* 0B3F48 800B3348 24070001 */ li $a3, 1 -/* 0B3F4C 800B334C 240B0005 */ li $t3, 5 -/* 0B3F50 800B3350 10600009 */ beqz $v1, .L800B3378 -/* 0B3F54 800B3354 00000000 */ nop -/* 0B3F58 800B3358 10670007 */ beq $v1, $a3, .L800B3378 -/* 0B3F5C 800B335C 24010002 */ li $at, 2 -/* 0B3F60 800B3360 10610005 */ beq $v1, $at, .L800B3378 -/* 0B3F64 800B3364 24040003 */ li $a0, 3 -/* 0B3F68 800B3368 10640005 */ beq $v1, $a0, .L800B3380 -/* 0B3F6C 800B336C 240A0004 */ li $t2, 4 -/* 0B3F70 800B3370 10000004 */ b .L800B3384 -/* 0B3F74 800B3374 A10A0000 */ sb $t2, ($t0) -.L800B3378: -/* 0B3F78 800B3378 10000002 */ b .L800B3384 -/* 0B3F7C 800B337C A10B0000 */ sb $t3, ($t0) -.L800B3380: -/* 0B3F80 800B3380 A10A0000 */ sb $t2, ($t0) -.L800B3384: -/* 0B3F84 800B3384 0C02D12B */ jal func_800B44AC -/* 0B3F88 800B3388 00000000 */ nop -/* 0B3F8C 800B338C 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B3F90 800B3390 0C032384 */ jal play_sound2 -/* 0B3F94 800B3394 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B3F98 800B3398 3C0F8019 */ lui $t7, %hi(gPlayerCount) # $t7, 0x8019 -/* 0B3F9C 800B339C 81EFEDF3 */ lb $t7, %lo(gPlayerCount)($t7) -/* 0B3FA0 800B33A0 3C0D800F */ lui $t5, %hi((D_800E86AC - 1)) # 0x800f -/* 0B3FA4 800B33A4 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B3FA8 800B33A8 01AF6821 */ addu $t5, $t5, $t7 -/* 0B3FAC 800B33AC 81AD86AB */ lb $t5, %lo((D_800E86AC - 1))($t5) # -0x7955($t5) -/* 0B3FB0 800B33B0 000F6080 */ sll $t4, $t7, 2 -/* 0B3FB4 800B33B4 018F6023 */ subu $t4, $t4, $t7 -/* 0B3FB8 800B33B8 000C6080 */ sll $t4, $t4, 2 -/* 0B3FBC 800B33BC 000D7080 */ sll $t6, $t5, 2 -/* 0B3FC0 800B33C0 018EC021 */ addu $t8, $t4, $t6 -/* 0B3FC4 800B33C4 3C018019 */ lui $at, %hi(gMenuTimingCounter) # $at, 0x8019 -/* 0B3FC8 800B33C8 00781821 */ addu $v1, $v1, $t8 -/* 0B3FCC 800B33CC AC20EE00 */ sw $zero, %lo(gMenuTimingCounter)($at) -/* 0B3FD0 800B33D0 1000003F */ b .L800B34D0 -/* 0B3FD4 800B33D4 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B33D8: -/* 0B3FD8 800B33D8 13200016 */ beqz $t9, .L800B3434 -/* 0B3FDC 800B33DC 3C0C8019 */ lui $t4, %hi(gPlayerCount) # $t4, 0x8019 -/* 0B3FE0 800B33E0 0C027870 */ jal func_8009E1C0 -/* 0B3FE4 800B33E4 00000000 */ nop -/* 0B3FE8 800B33E8 3C044900 */ lui $a0, (0x49008016 >> 16) # lui $a0, 0x4900 -/* 0B3FEC 800B33EC 0C032384 */ jal play_sound2 -/* 0B3FF0 800B33F0 34848016 */ ori $a0, (0x49008016 & 0xFFFF) # ori $a0, $a0, 0x8016 -/* 0B3FF4 800B33F4 0C02CA32 */ jal func_800B28C8 -/* 0B3FF8 800B33F8 00000000 */ nop -/* 0B3FFC 800B33FC 3C098019 */ lui $t1, %hi(gPlayerCount) # $t1, 0x8019 -/* 0B4000 800B3400 8129EDF3 */ lb $t1, %lo(gPlayerCount)($t1) -/* 0B4004 800B3404 3C0A800F */ lui $t2, %hi((D_800E86AC - 1)) # 0x800f -/* 0B4008 800B3408 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B400C 800B340C 01495021 */ addu $t2, $t2, $t1 -/* 0B4010 800B3410 814A86AB */ lb $t2, %lo((D_800E86AC - 1))($t2) # -0x7955($t2) -/* 0B4014 800B3414 00095880 */ sll $t3, $t1, 2 -/* 0B4018 800B3418 01695823 */ subu $t3, $t3, $t1 -/* 0B401C 800B341C 000B5880 */ sll $t3, $t3, 2 -/* 0B4020 800B3420 000A7880 */ sll $t7, $t2, 2 -/* 0B4024 800B3424 016F6821 */ addu $t5, $t3, $t7 -/* 0B4028 800B3428 006D1821 */ addu $v1, $v1, $t5 -/* 0B402C 800B342C 10000028 */ b .L800B34D0 -/* 0B4030 800B3430 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B3434: -/* 0B4034 800B3434 818CEDF3 */ lb $t4, %lo(gPlayerCount)($t4) -/* 0B4038 800B3438 3C18800F */ lui $t8, %hi((D_800E86AC - 1)) # 0x800f -/* 0B403C 800B343C 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B4040 800B3440 030CC021 */ addu $t8, $t8, $t4 -/* 0B4044 800B3444 831886AB */ lb $t8, %lo((D_800E86AC - 1))($t8) # -0x7955($t8) -/* 0B4048 800B3448 000C7080 */ sll $t6, $t4, 2 -/* 0B404C 800B344C 01CC7023 */ subu $t6, $t6, $t4 -/* 0B4050 800B3450 000E7080 */ sll $t6, $t6, 2 -/* 0B4054 800B3454 0018C880 */ sll $t9, $t8, 2 -/* 0B4058 800B3458 01D94821 */ addu $t1, $t6, $t9 -/* 0B405C 800B345C 00691821 */ addu $v1, $v1, $t1 -/* 0B4060 800B3460 1000001B */ b .L800B34D0 -/* 0B4064 800B3464 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -glabel L800B3468 # case 1, 2 -/* 0B4068 800B3468 3C0A8019 */ lui $t2, %hi(gPlayerCount) # $t2, 0x8019 -/* 0B406C 800B346C 814AEDF3 */ lb $t2, %lo(gPlayerCount)($t2) -/* 0B4070 800B3470 3C0F800F */ lui $t7, %hi((D_800E86AC - 1)) # 0x800f -/* 0B4074 800B3474 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B4078 800B3478 01EA7821 */ addu $t7, $t7, $t2 -/* 0B407C 800B347C 81EF86AB */ lb $t7, %lo((D_800E86AC - 1))($t7) # -0x7955($t7) -/* 0B4080 800B3480 000A5880 */ sll $t3, $t2, 2 -/* 0B4084 800B3484 016A5823 */ subu $t3, $t3, $t2 -/* 0B4088 800B3488 000B5880 */ sll $t3, $t3, 2 -/* 0B408C 800B348C 000F6880 */ sll $t5, $t7, 2 -/* 0B4090 800B3490 016D6021 */ addu $t4, $t3, $t5 -/* 0B4094 800B3494 006C1821 */ addu $v1, $v1, $t4 -/* 0B4098 800B3498 1000000D */ b .L800B34D0 -/* 0B409C 800B349C 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B34A0: # default -/* 0B40A0 800B34A0 8318EDF3 */ lb $t8, %lo(gPlayerCount)($t8) # -0x120d($t8) -/* 0B40A4 800B34A4 3C19800F */ lui $t9, %hi((D_800E86AC - 1)) # 0x800f -/* 0B40A8 800B34A8 3C03800F */ lui $v1, %hi((gGameModePlayerSelection - 0xC)) # 0x800f -/* 0B40AC 800B34AC 0338C821 */ addu $t9, $t9, $t8 -/* 0B40B0 800B34B0 833986AB */ lb $t9, %lo((D_800E86AC - 1))($t9) # -0x7955($t9) -/* 0B40B4 800B34B4 00187080 */ sll $t6, $t8, 2 -/* 0B40B8 800B34B8 01D87023 */ subu $t6, $t6, $t8 -/* 0B40BC 800B34BC 000E7080 */ sll $t6, $t6, 2 -/* 0B40C0 800B34C0 00194880 */ sll $t1, $t9, 2 -/* 0B40C4 800B34C4 01C95021 */ addu $t2, $t6, $t1 -/* 0B40C8 800B34C8 006A1821 */ addu $v1, $v1, $t2 -/* 0B40CC 800B34CC 8C632B70 */ lw $v1, %lo((gGameModePlayerSelection - 0xC))($v1) # 0x2b70($v1) -.L800B34D0: -/* 0B40D0 800B34D0 3C01800E */ lui $at, %hi(gModeSelection) # $at, 0x800e -/* 0B40D4 800B34D4 AC23C53C */ sw $v1, %lo(gModeSelection)($at) -.L800B34D8: -/* 0B40D8 800B34D8 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B40DC 800B34DC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0B40E0 800B34E0 03E00008 */ jr $ra -/* 0B40E4 800B34E4 00000000 */ nop diff --git a/asm/non_matchings/menus/player_select_menu_act.s b/asm/non_matchings/menus/player_select_menu_act.s deleted file mode 100644 index 6684b4a0d6..0000000000 --- a/asm/non_matchings/menus/player_select_menu_act.s +++ /dev/null @@ -1,423 +0,0 @@ -glabel player_select_menu_act -/* 0B4154 800B3554 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B4158 800B3558 AFBF001C */ sw $ra, 0x1c($sp) -/* 0B415C 800B355C AFB00018 */ sw $s0, 0x18($sp) -/* 0B4160 800B3560 AFA50044 */ sw $a1, 0x44($sp) -/* 0B4164 800B3564 948F000C */ lhu $t7, 0xc($a0) -/* 0B4168 800B3568 948E0006 */ lhu $t6, 6($a0) -/* 0B416C 800B356C 3C19800E */ lui $t9, %hi(gEnableDebugMode) # $t9, 0x800e -/* 0B4170 800B3570 9739C520 */ lhu $t9, %lo(gEnableDebugMode)($t9) -/* 0B4174 800B3574 01CF1825 */ or $v1, $t6, $t7 -/* 0B4178 800B3578 3078FFFF */ andi $t8, $v1, 0xffff -/* 0B417C 800B357C 17200007 */ bnez $t9, .L800B359C -/* 0B4180 800B3580 03001825 */ move $v1, $t8 -/* 0B4184 800B3584 33081000 */ andi $t0, $t8, 0x1000 -/* 0B4188 800B3588 11000004 */ beqz $t0, .L800B359C -/* 0B418C 800B358C 00000000 */ nop -/* 0B4190 800B3590 37038000 */ ori $v1, $t8, 0x8000 -/* 0B4194 800B3594 3069FFFF */ andi $t1, $v1, 0xffff -/* 0B4198 800B3598 01201825 */ move $v1, $t1 -.L800B359C: -/* 0B419C 800B359C 0C02D148 */ jal func_800B4520 -/* 0B41A0 800B35A0 A7A30036 */ sh $v1, 0x36($sp) -/* 0B41A4 800B35A4 14400167 */ bnez $v0, .L800B3B44 -/* 0B41A8 800B35A8 97A30036 */ lhu $v1, 0x36($sp) -/* 0B41AC 800B35AC 3C028019 */ lui $v0, %hi(D_8018EDEE) # $v0, 0x8019 -/* 0B41B0 800B35B0 8042EDEE */ lb $v0, %lo(D_8018EDEE)($v0) -/* 0B41B4 800B35B4 24010001 */ li $at, 1 -/* 0B41B8 800B35B8 97AB0046 */ lhu $t3, 0x46($sp) -/* 0B41BC 800B35BC 1041000A */ beq $v0, $at, .L800B35E8 -/* 0B41C0 800B35C0 24010002 */ li $at, 2 -/* 0B41C4 800B35C4 10410125 */ beq $v0, $at, .L800B3A5C -/* 0B41C8 800B35C8 97A90046 */ lhu $t1, 0x46($sp) -/* 0B41CC 800B35CC 24010003 */ li $at, 3 -/* 0B41D0 800B35D0 10410122 */ beq $v0, $at, .L800B3A5C -/* 0B41D4 800B35D4 97AA0046 */ lhu $t2, 0x46($sp) -/* 0B41D8 800B35D8 3C038019 */ lui $v1, %hi(gCharacterGridSelections) # 0x8019 -/* 0B41DC 800B35DC 006A1821 */ addu $v1, $v1, $t2 -/* 0B41E0 800B35E0 10000150 */ b .L800B3B24 -/* 0B41E4 800B35E4 8063EDE4 */ lb $v1, %lo(gCharacterGridSelections)($v1) # -0x121c($v1) -.L800B35E8: # case 1 -/* 0B41E8 800B35E8 3C108019 */ lui $s0, %hi(gCharacterGridSelections) # $s0, 0x8019 -/* 0B41EC 800B35EC 2610EDE4 */ addiu $s0, %lo(gCharacterGridSelections) # addiu $s0, $s0, -0x121c -/* 0B41F0 800B35F0 020B6021 */ addu $t4, $s0, $t3 -/* 0B41F4 800B35F4 AFAC0028 */ sw $t4, 0x28($sp) -/* 0B41F8 800B35F8 818E0000 */ lb $t6, ($t4) -/* 0B41FC 800B35FC 00603025 */ move $a2, $v1 -/* 0B4200 800B3600 306F4000 */ andi $t7, $v1, 0x4000 -/* 0B4204 800B3604 15C0000A */ bnez $t6, .L800B3630 -/* 0B4208 800B3608 30D84000 */ andi $t8, $a2, 0x4000 -/* 0B420C 800B360C 51E0014E */ beql $t7, $zero, .L800B3B48 -/* 0B4210 800B3610 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B4214 800B3614 0C027882 */ jal func_8009E208 -/* 0B4218 800B3618 00000000 */ nop -/* 0B421C 800B361C 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B4220 800B3620 0C032384 */ jal play_sound2 -/* 0B4224 800B3624 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B4228 800B3628 10000147 */ b .L800B3B48 -/* 0B422C 800B362C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B3630: -/* 0B4230 800B3630 13000014 */ beqz $t8, .L800B3684 -/* 0B4234 800B3634 97B90046 */ lhu $t9, 0x46($sp) -/* 0B4238 800B3638 3C038019 */ lui $v1, %hi(D_8018EDE8) # $v1, 0x8019 -/* 0B423C 800B363C 2463EDE8 */ addiu $v1, %lo(D_8018EDE8) # addiu $v1, $v1, -0x1218 -/* 0B4240 800B3640 00793821 */ addu $a3, $v1, $t9 -/* 0B4244 800B3644 80E80000 */ lb $t0, ($a3) -/* 0B4248 800B3648 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B424C 800B364C 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B4250 800B3650 11000006 */ beqz $t0, .L800B366C -/* 0B4254 800B3654 00000000 */ nop -/* 0B4258 800B3658 A0E00000 */ sb $zero, ($a3) -/* 0B425C 800B365C 0C032384 */ jal play_sound2 -/* 0B4260 800B3660 AFA6002C */ sw $a2, 0x2c($sp) -/* 0B4264 800B3664 10000007 */ b .L800B3684 -/* 0B4268 800B3668 8FA6002C */ lw $a2, 0x2c($sp) -.L800B366C: -/* 0B426C 800B366C 0C027882 */ jal func_8009E208 -/* 0B4270 800B3670 AFA6002C */ sw $a2, 0x2c($sp) -/* 0B4274 800B3674 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B4278 800B3678 0C032384 */ jal play_sound2 -/* 0B427C 800B367C 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B4280 800B3680 8FA6002C */ lw $a2, 0x2c($sp) -.L800B3684: -/* 0B4284 800B3684 97A90046 */ lhu $t1, 0x46($sp) -/* 0B4288 800B3688 3C038019 */ lui $v1, %hi(D_8018EDE8) # $v1, 0x8019 -/* 0B428C 800B368C 2463EDE8 */ addiu $v1, %lo(D_8018EDE8) # addiu $v1, $v1, -0x1218 -/* 0B4290 800B3690 30CA8000 */ andi $t2, $a2, 0x8000 -/* 0B4294 800B3694 11400017 */ beqz $t2, .L800B36F4 -/* 0B4298 800B3698 00693821 */ addu $a3, $v1, $t1 -/* 0B429C 800B369C 80EB0000 */ lb $t3, ($a3) -/* 0B42A0 800B36A0 240C0001 */ li $t4, 1 -/* 0B42A4 800B36A4 3C05800F */ lui $a1, %hi((D_800F2BAC - 1)) # 0x800f -/* 0B42A8 800B36A8 55600013 */ bnel $t3, $zero, .L800B36F8 -/* 0B42AC 800B36AC 00002025 */ move $a0, $zero -/* 0B42B0 800B36B0 8FAD0028 */ lw $t5, 0x28($sp) -/* 0B42B4 800B36B4 A0EC0000 */ sb $t4, ($a3) -/* 0B42B8 800B36B8 3C012900 */ lui $at, (0x2900800E >> 16) # lui $at, 0x2900 -/* 0B42BC 800B36BC 81AE0000 */ lb $t6, ($t5) -/* 0B42C0 800B36C0 3421800E */ ori $at, (0x2900800E & 0xFFFF) # ori $at, $at, 0x800e -/* 0B42C4 800B36C4 AFA70020 */ sw $a3, 0x20($sp) -/* 0B42C8 800B36C8 00AE2821 */ addu $a1, $a1, $t6 -/* 0B42CC 800B36CC 80A52BAB */ lb $a1, %lo((D_800F2BAC - 1))($a1) # 0x2bab($a1) -/* 0B42D0 800B36D0 AFA6002C */ sw $a2, 0x2c($sp) -/* 0B42D4 800B36D4 93A40047 */ lbu $a0, 0x47($sp) -/* 0B42D8 800B36D8 00057900 */ sll $t7, $a1, 4 -/* 0B42DC 800B36DC 0C03243D */ jal func_800C90F4 -/* 0B42E0 800B36E0 01E12821 */ addu $a1, $t7, $at -/* 0B42E4 800B36E4 3C038019 */ lui $v1, %hi(D_8018EDE8) # $v1, 0x8019 -/* 0B42E8 800B36E8 2463EDE8 */ addiu $v1, %lo(D_8018EDE8) # addiu $v1, $v1, -0x1218 -/* 0B42EC 800B36EC 8FA6002C */ lw $a2, 0x2c($sp) -/* 0B42F0 800B36F0 8FA70020 */ lw $a3, 0x20($sp) -.L800B36F4: -/* 0B42F4 800B36F4 00002025 */ move $a0, $zero -.L800B36F8: -/* 0B42F8 800B36F8 00001025 */ move $v0, $zero -/* 0B42FC 800B36FC 0202C021 */ addu $t8, $s0, $v0 -.L800B3700: -/* 0B4300 800B3700 83190000 */ lb $t9, ($t8) -/* 0B4304 800B3704 00624021 */ addu $t0, $v1, $v0 -/* 0B4308 800B3708 24420001 */ addiu $v0, $v0, 1 -/* 0B430C 800B370C 13200006 */ beqz $t9, .L800B3728 -/* 0B4310 800B3710 00025600 */ sll $t2, $v0, 0x18 -/* 0B4314 800B3714 81090000 */ lb $t1, ($t0) -/* 0B4318 800B3718 55200004 */ bnel $t1, $zero, .L800B372C -/* 0B431C 800B371C 000A1603 */ sra $v0, $t2, 0x18 -/* 0B4320 800B3720 10000005 */ b .L800B3738 -/* 0B4324 800B3724 24040001 */ li $a0, 1 -.L800B3728: -/* 0B4328 800B3728 000A1603 */ sra $v0, $t2, 0x18 -.L800B372C: -/* 0B432C 800B372C 28410004 */ slti $at, $v0, 4 -/* 0B4330 800B3730 5420FFF3 */ bnel $at, $zero, .L800B3700 -/* 0B4334 800B3734 0202C021 */ addu $t8, $s0, $v0 -.L800B3738: -/* 0B4338 800B3738 1480000B */ bnez $a0, .L800B3768 -/* 0B433C 800B373C 240C0002 */ li $t4, 2 -/* 0B4340 800B3740 3C018019 */ lui $at, %hi(D_8018EDEE) # $at, 0x8019 -/* 0B4344 800B3744 A02CEDEE */ sb $t4, %lo(D_8018EDEE)($at) -/* 0B4348 800B3748 AFA6002C */ sw $a2, 0x2c($sp) -/* 0B434C 800B374C 0C02D12B */ jal func_800B44AC -/* 0B4350 800B3750 AFA70020 */ sw $a3, 0x20($sp) -/* 0B4354 800B3754 3C038019 */ lui $v1, %hi(gMenuTimingCounter) # $v1, 0x8019 -/* 0B4358 800B3758 2463EE00 */ addiu $v1, %lo(gMenuTimingCounter) # addiu $v1, $v1, -0x1200 -/* 0B435C 800B375C 8FA6002C */ lw $a2, 0x2c($sp) -/* 0B4360 800B3760 8FA70020 */ lw $a3, 0x20($sp) -/* 0B4364 800B3764 AC600000 */ sw $zero, ($v1) -.L800B3768: -/* 0B4368 800B3768 80EE0000 */ lb $t6, ($a3) -/* 0B436C 800B376C 8FAD0028 */ lw $t5, 0x28($sp) -/* 0B4370 800B3770 30C20100 */ andi $v0, $a2, 0x100 -/* 0B4374 800B3774 15C000EB */ bnez $t6, .L800B3B24 -/* 0B4378 800B3778 81A30000 */ lb $v1, ($t5) -/* 0B437C 800B377C 00038600 */ sll $s0, $v1, 0x18 -/* 0B4380 800B3780 00107E03 */ sra $t7, $s0, 0x18 -/* 0B4384 800B3784 10400017 */ beqz $v0, .L800B37E4 -/* 0B4388 800B3788 01E08025 */ move $s0, $t7 -/* 0B438C 800B378C 30D80400 */ andi $t8, $a2, 0x400 -/* 0B4390 800B3790 13000014 */ beqz $t8, .L800B37E4 -/* 0B4394 800B3794 24010001 */ li $at, 1 -/* 0B4398 800B3798 10610005 */ beq $v1, $at, .L800B37B0 -/* 0B439C 800B379C 00601025 */ move $v0, $v1 -/* 0B43A0 800B37A0 24010002 */ li $at, 2 -/* 0B43A4 800B37A4 10410002 */ beq $v0, $at, .L800B37B0 -/* 0B43A8 800B37A8 24010003 */ li $at, 3 -/* 0B43AC 800B37AC 144100E5 */ bne $v0, $at, .L800B3B44 -.L800B37B0: -/* 0B43B0 800B37B0 24700005 */ addiu $s0, $v1, 5 -/* 0B43B4 800B37B4 0010CE00 */ sll $t9, $s0, 0x18 -/* 0B43B8 800B37B8 00192603 */ sra $a0, $t9, 0x18 -/* 0B43BC 800B37BC 0C02CD3A */ jal is_character_spot_free -/* 0B43C0 800B37C0 00808025 */ move $s0, $a0 -/* 0B43C4 800B37C4 104000DF */ beqz $v0, .L800B3B44 -/* 0B43C8 800B37C8 8FA90028 */ lw $t1, 0x28($sp) -/* 0B43CC 800B37CC 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B43D0 800B37D0 A1300000 */ sb $s0, ($t1) -/* 0B43D4 800B37D4 0C032384 */ jal play_sound2 -/* 0B43D8 800B37D8 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B43DC 800B37DC 100000DA */ b .L800B3B48 -/* 0B43E0 800B37E0 8FBF001C */ lw $ra, 0x1c($sp) -.L800B37E4: -/* 0B43E4 800B37E4 30C40200 */ andi $a0, $a2, 0x200 -/* 0B43E8 800B37E8 10800016 */ beqz $a0, .L800B3844 -/* 0B43EC 800B37EC 30CA0400 */ andi $t2, $a2, 0x400 -/* 0B43F0 800B37F0 11400014 */ beqz $t2, .L800B3844 -/* 0B43F4 800B37F4 24010002 */ li $at, 2 -/* 0B43F8 800B37F8 10610005 */ beq $v1, $at, .L800B3810 -/* 0B43FC 800B37FC 00601025 */ move $v0, $v1 -/* 0B4400 800B3800 24010003 */ li $at, 3 -/* 0B4404 800B3804 10410002 */ beq $v0, $at, .L800B3810 -/* 0B4408 800B3808 24010004 */ li $at, 4 -/* 0B440C 800B380C 144100CD */ bne $v0, $at, .L800B3B44 -.L800B3810: -/* 0B4410 800B3810 24700003 */ addiu $s0, $v1, 3 -/* 0B4414 800B3814 00105E00 */ sll $t3, $s0, 0x18 -/* 0B4418 800B3818 000B2603 */ sra $a0, $t3, 0x18 -/* 0B441C 800B381C 0C02CD3A */ jal is_character_spot_free -/* 0B4420 800B3820 00808025 */ move $s0, $a0 -/* 0B4424 800B3824 104000C7 */ beqz $v0, .L800B3B44 -/* 0B4428 800B3828 8FAD0028 */ lw $t5, 0x28($sp) -/* 0B442C 800B382C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B4430 800B3830 A1B00000 */ sb $s0, ($t5) -/* 0B4434 800B3834 0C032384 */ jal play_sound2 -/* 0B4438 800B3838 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B443C 800B383C 100000C2 */ b .L800B3B48 -/* 0B4440 800B3840 8FBF001C */ lw $ra, 0x1c($sp) -.L800B3844: -/* 0B4444 800B3844 10400016 */ beqz $v0, .L800B38A0 -/* 0B4448 800B3848 30CE0800 */ andi $t6, $a2, 0x800 -/* 0B444C 800B384C 11C00014 */ beqz $t6, .L800B38A0 -/* 0B4450 800B3850 24010005 */ li $at, 5 -/* 0B4454 800B3854 10610005 */ beq $v1, $at, .L800B386C -/* 0B4458 800B3858 00601025 */ move $v0, $v1 -/* 0B445C 800B385C 24010006 */ li $at, 6 -/* 0B4460 800B3860 10410002 */ beq $v0, $at, .L800B386C -/* 0B4464 800B3864 24010007 */ li $at, 7 -/* 0B4468 800B3868 144100B6 */ bne $v0, $at, .L800B3B44 -.L800B386C: -/* 0B446C 800B386C 2470FFFD */ addiu $s0, $v1, -3 -/* 0B4470 800B3870 00107E00 */ sll $t7, $s0, 0x18 -/* 0B4474 800B3874 000F2603 */ sra $a0, $t7, 0x18 -/* 0B4478 800B3878 0C02CD3A */ jal is_character_spot_free -/* 0B447C 800B387C 00808025 */ move $s0, $a0 -/* 0B4480 800B3880 104000B0 */ beqz $v0, .L800B3B44 -/* 0B4484 800B3884 8FB90028 */ lw $t9, 0x28($sp) -/* 0B4488 800B3888 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B448C 800B388C A3300000 */ sb $s0, ($t9) -/* 0B4490 800B3890 0C032384 */ jal play_sound2 -/* 0B4494 800B3894 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B4498 800B3898 100000AB */ b .L800B3B48 -/* 0B449C 800B389C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B38A0: -/* 0B44A0 800B38A0 10800016 */ beqz $a0, .L800B38FC -/* 0B44A4 800B38A4 30C80800 */ andi $t0, $a2, 0x800 -/* 0B44A8 800B38A8 11000014 */ beqz $t0, .L800B38FC -/* 0B44AC 800B38AC 24010006 */ li $at, 6 -/* 0B44B0 800B38B0 10610005 */ beq $v1, $at, .L800B38C8 -/* 0B44B4 800B38B4 00601025 */ move $v0, $v1 -/* 0B44B8 800B38B8 24010007 */ li $at, 7 -/* 0B44BC 800B38BC 10410002 */ beq $v0, $at, .L800B38C8 -/* 0B44C0 800B38C0 24010008 */ li $at, 8 -/* 0B44C4 800B38C4 1441009F */ bne $v0, $at, .L800B3B44 -.L800B38C8: -/* 0B44C8 800B38C8 2470FFFB */ addiu $s0, $v1, -5 -/* 0B44CC 800B38CC 00104E00 */ sll $t1, $s0, 0x18 -/* 0B44D0 800B38D0 00092603 */ sra $a0, $t1, 0x18 -/* 0B44D4 800B38D4 0C02CD3A */ jal is_character_spot_free -/* 0B44D8 800B38D8 00808025 */ move $s0, $a0 -/* 0B44DC 800B38DC 10400099 */ beqz $v0, .L800B3B44 -/* 0B44E0 800B38E0 8FAB0028 */ lw $t3, 0x28($sp) -/* 0B44E4 800B38E4 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B44E8 800B38E8 A1700000 */ sb $s0, ($t3) -/* 0B44EC 800B38EC 0C032384 */ jal play_sound2 -/* 0B44F0 800B38F0 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B44F4 800B38F4 10000094 */ b .L800B3B48 -/* 0B44F8 800B38F8 8FBF001C */ lw $ra, 0x1c($sp) -.L800B38FC: -/* 0B44FC 800B38FC 1040001E */ beqz $v0, .L800B3978 -/* 0B4500 800B3900 24010004 */ li $at, 4 -/* 0B4504 800B3904 1061008F */ beq $v1, $at, .L800B3B44 -/* 0B4508 800B3908 24010008 */ li $at, 8 -/* 0B450C 800B390C 1061008D */ beq $v1, $at, .L800B3B44 -/* 0B4510 800B3910 24700001 */ addiu $s0, $v1, 1 -/* 0B4514 800B3914 00106600 */ sll $t4, $s0, 0x18 -/* 0B4518 800B3918 000C8603 */ sra $s0, $t4, 0x18 -.L800B391C: -/* 0B451C 800B391C 0C02CD3A */ jal is_character_spot_free -/* 0B4520 800B3920 02002025 */ move $a0, $s0 -/* 0B4524 800B3924 10400008 */ beqz $v0, .L800B3948 -/* 0B4528 800B3928 24010005 */ li $at, 5 -/* 0B452C 800B392C 8FAE0028 */ lw $t6, 0x28($sp) -/* 0B4530 800B3930 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B4534 800B3934 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B4538 800B3938 0C032384 */ jal play_sound2 -/* 0B453C 800B393C A1D00000 */ sb $s0, ($t6) -/* 0B4540 800B3940 10000081 */ b .L800B3B48 -/* 0B4544 800B3944 8FBF001C */ lw $ra, 0x1c($sp) -.L800B3948: -/* 0B4548 800B3948 26100001 */ addiu $s0, $s0, 1 -/* 0B454C 800B394C 00107E00 */ sll $t7, $s0, 0x18 -/* 0B4550 800B3950 000FC603 */ sra $t8, $t7, 0x18 -/* 0B4554 800B3954 1301007B */ beq $t8, $at, .L800B3B44 -/* 0B4558 800B3958 03008025 */ move $s0, $t8 -/* 0B455C 800B395C 24010009 */ li $at, 9 -/* 0B4560 800B3960 13010078 */ beq $t8, $at, .L800B3B44 -/* 0B4564 800B3964 2B01000A */ slti $at, $t8, 0xa -/* 0B4568 800B3968 1420FFEC */ bnez $at, .L800B391C -/* 0B456C 800B396C 00000000 */ nop -/* 0B4570 800B3970 10000075 */ b .L800B3B48 -/* 0B4574 800B3974 8FBF001C */ lw $ra, 0x1c($sp) -.L800B3978: -/* 0B4578 800B3978 1080001E */ beqz $a0, .L800B39F4 -/* 0B457C 800B397C 30CC0800 */ andi $t4, $a2, 0x800 -/* 0B4580 800B3980 24010001 */ li $at, 1 -/* 0B4584 800B3984 1061006F */ beq $v1, $at, .L800B3B44 -/* 0B4588 800B3988 24010005 */ li $at, 5 -/* 0B458C 800B398C 1061006D */ beq $v1, $at, .L800B3B44 -/* 0B4590 800B3990 2470FFFF */ addiu $s0, $v1, -1 -/* 0B4594 800B3994 0010CE00 */ sll $t9, $s0, 0x18 -/* 0B4598 800B3998 00198603 */ sra $s0, $t9, 0x18 -.L800B399C: -/* 0B459C 800B399C 0C02CD3A */ jal is_character_spot_free -/* 0B45A0 800B39A0 02002025 */ move $a0, $s0 -/* 0B45A4 800B39A4 10400008 */ beqz $v0, .L800B39C8 -/* 0B45A8 800B39A8 24010004 */ li $at, 4 -/* 0B45AC 800B39AC 8FA90028 */ lw $t1, 0x28($sp) -/* 0B45B0 800B39B0 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B45B4 800B39B4 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B45B8 800B39B8 0C032384 */ jal play_sound2 -/* 0B45BC 800B39BC A1300000 */ sb $s0, ($t1) -/* 0B45C0 800B39C0 10000061 */ b .L800B3B48 -/* 0B45C4 800B39C4 8FBF001C */ lw $ra, 0x1c($sp) -.L800B39C8: -/* 0B45C8 800B39C8 2610FFFF */ addiu $s0, $s0, -1 -/* 0B45CC 800B39CC 00105600 */ sll $t2, $s0, 0x18 -/* 0B45D0 800B39D0 000A5E03 */ sra $t3, $t2, 0x18 -/* 0B45D4 800B39D4 1160005B */ beqz $t3, .L800B3B44 -/* 0B45D8 800B39D8 01608025 */ move $s0, $t3 -/* 0B45DC 800B39DC 5161005A */ beql $t3, $at, .L800B3B48 -/* 0B45E0 800B39E0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B45E4 800B39E4 0561FFED */ bgez $t3, .L800B399C -/* 0B45E8 800B39E8 00000000 */ nop -/* 0B45EC 800B39EC 10000056 */ b .L800B3B48 -/* 0B45F0 800B39F0 8FBF001C */ lw $ra, 0x1c($sp) -.L800B39F4: -/* 0B45F4 800B39F4 11800007 */ beqz $t4, .L800B3A14 -/* 0B45F8 800B39F8 30C20400 */ andi $v0, $a2, 0x400 -/* 0B45FC 800B39FC 28610005 */ slti $at, $v1, 5 -/* 0B4600 800B3A00 14200004 */ bnez $at, .L800B3A14 -/* 0B4604 800B3A04 00000000 */ nop -/* 0B4608 800B3A08 2470FFFC */ addiu $s0, $v1, -4 -/* 0B460C 800B3A0C 00106E00 */ sll $t5, $s0, 0x18 -/* 0B4610 800B3A10 000D8603 */ sra $s0, $t5, 0x18 -.L800B3A14: -/* 0B4614 800B3A14 10400006 */ beqz $v0, .L800B3A30 -/* 0B4618 800B3A18 28610005 */ slti $at, $v1, 5 -/* 0B461C 800B3A1C 10200004 */ beqz $at, .L800B3A30 -/* 0B4620 800B3A20 00000000 */ nop -/* 0B4624 800B3A24 24700004 */ addiu $s0, $v1, 4 -/* 0B4628 800B3A28 00107E00 */ sll $t7, $s0, 0x18 -/* 0B462C 800B3A2C 000F8603 */ sra $s0, $t7, 0x18 -.L800B3A30: -/* 0B4630 800B3A30 0C02CD3A */ jal is_character_spot_free -/* 0B4634 800B3A34 02002025 */ move $a0, $s0 -/* 0B4638 800B3A38 10400005 */ beqz $v0, .L800B3A50 -/* 0B463C 800B3A3C 8FB90028 */ lw $t9, 0x28($sp) -/* 0B4640 800B3A40 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B4644 800B3A44 A3300000 */ sb $s0, ($t9) -/* 0B4648 800B3A48 0C032384 */ jal play_sound2 -/* 0B464C 800B3A4C 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -.L800B3A50: -/* 0B4650 800B3A50 8FA80028 */ lw $t0, 0x28($sp) -/* 0B4654 800B3A54 10000033 */ b .L800B3B24 -/* 0B4658 800B3A58 81030000 */ lb $v1, ($t0) -.L800B3A5C: # case 2, 3 -/* 0B465C 800B3A5C 15200011 */ bnez $t1, .L800B3AA4 -/* 0B4660 800B3A60 00603025 */ move $a2, $v1 -/* 0B4664 800B3A64 3C038019 */ lui $v1, %hi(gMenuTimingCounter) # $v1, 0x8019 -/* 0B4668 800B3A68 2463EE00 */ addiu $v1, %lo(gMenuTimingCounter) # addiu $v1, $v1, -0x1200 -/* 0B466C 800B3A6C 8C6A0000 */ lw $t2, ($v1) -/* 0B4670 800B3A70 2401003C */ li $at, 60 -/* 0B4674 800B3A74 3C044900 */ lui $a0, (0x4900900F >> 16) # lui $a0, 0x4900 -/* 0B4678 800B3A78 254B0001 */ addiu $t3, $t2, 1 -/* 0B467C 800B3A7C 11610005 */ beq $t3, $at, .L800B3A94 -/* 0B4680 800B3A80 AC6B0000 */ sw $t3, ($v1) -/* 0B4684 800B3A84 2401012C */ li $at, 300 -/* 0B4688 800B3A88 0161001A */ div $zero, $t3, $at -/* 0B468C 800B3A8C 00006010 */ mfhi $t4 -/* 0B4690 800B3A90 15800004 */ bnez $t4, .L800B3AA4 -.L800B3A94: -/* 0B4694 800B3A94 3484900F */ ori $a0, (0x4900900F & 0xFFFF) # ori $a0, $a0, 0x900f -/* 0B4698 800B3A98 0C032384 */ jal play_sound2 -/* 0B469C 800B3A9C AFA6002C */ sw $a2, 0x2c($sp) -/* 0B46A0 800B3AA0 8FA6002C */ lw $a2, 0x2c($sp) -.L800B3AA4: -/* 0B46A4 800B3AA4 30CD4000 */ andi $t5, $a2, 0x4000 -/* 0B46A8 800B3AA8 11A00011 */ beqz $t5, .L800B3AF0 -/* 0B46AC 800B3AAC 30C88000 */ andi $t0, $a2, 0x8000 -/* 0B46B0 800B3AB0 97AF0046 */ lhu $t7, 0x46($sp) -/* 0B46B4 800B3AB4 3C038019 */ lui $v1, %hi(D_8018EDE8) # $v1, 0x8019 -/* 0B46B8 800B3AB8 2463EDE8 */ addiu $v1, %lo(D_8018EDE8) # addiu $v1, $v1, -0x1218 -/* 0B46BC 800B3ABC 240E0001 */ li $t6, 1 -/* 0B46C0 800B3AC0 3C018019 */ lui $at, %hi(D_8018EDEE) # $at, 0x8019 -/* 0B46C4 800B3AC4 A02EEDEE */ sb $t6, %lo(D_8018EDEE)($at) -/* 0B46C8 800B3AC8 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B46CC 800B3ACC 006FC021 */ addu $t8, $v1, $t7 -/* 0B46D0 800B3AD0 A3000000 */ sb $zero, ($t8) -/* 0B46D4 800B3AD4 0C032384 */ jal play_sound2 -/* 0B46D8 800B3AD8 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B46DC 800B3ADC 97B90046 */ lhu $t9, 0x46($sp) -/* 0B46E0 800B3AE0 3C038019 */ lui $v1, %hi(gCharacterGridSelections) # 0x8019 -/* 0B46E4 800B3AE4 00791821 */ addu $v1, $v1, $t9 -/* 0B46E8 800B3AE8 1000000E */ b .L800B3B24 -/* 0B46EC 800B3AEC 8063EDE4 */ lb $v1, %lo(gCharacterGridSelections)($v1) # -0x121c($v1) -.L800B3AF0: -/* 0B46F0 800B3AF0 51000009 */ beql $t0, $zero, .L800B3B18 -/* 0B46F4 800B3AF4 97A90046 */ lhu $t1, 0x46($sp) -/* 0B46F8 800B3AF8 0C027870 */ jal func_8009E1C0 -/* 0B46FC 800B3AFC 00000000 */ nop -/* 0B4700 800B3B00 3C044900 */ lui $a0, (0x49008016 >> 16) # lui $a0, 0x4900 -/* 0B4704 800B3B04 0C032384 */ jal play_sound2 -/* 0B4708 800B3B08 34848016 */ ori $a0, (0x49008016 & 0xFFFF) # ori $a0, $a0, 0x8016 -/* 0B470C 800B3B0C 0C003C49 */ jal func_8000F124 -/* 0B4710 800B3B10 00000000 */ nop -/* 0B4714 800B3B14 97A90046 */ lhu $t1, 0x46($sp) -.L800B3B18: -/* 0B4718 800B3B18 3C038019 */ lui $v1, %hi(gCharacterGridSelections) # 0x8019 -/* 0B471C 800B3B1C 00691821 */ addu $v1, $v1, $t1 -/* 0B4720 800B3B20 8063EDE4 */ lb $v1, %lo(gCharacterGridSelections)($v1) # -0x121c($v1) -.L800B3B24: -/* 0B4724 800B3B24 10600007 */ beqz $v1, .L800B3B44 -/* 0B4728 800B3B28 3C0A800F */ lui $t2, %hi((D_800F2BAC - 1)) # 0x800f -/* 0B472C 800B3B2C 97AB0046 */ lhu $t3, 0x46($sp) -/* 0B4730 800B3B30 01435021 */ addu $t2, $t2, $v1 -/* 0B4734 800B3B34 814A2BAB */ lb $t2, %lo((D_800F2BAC - 1))($t2) # 0x2bab($t2) -/* 0B4738 800B3B38 3C01800F */ lui $at, %hi(gCharacterSelections) # 0x800f -/* 0B473C 800B3B3C 002B0821 */ addu $at, $at, $t3 -/* 0B4740 800B3B40 A02A86A8 */ sb $t2, %lo(gCharacterSelections)($at) # -0x7958($at) -.L800B3B44: -/* 0B4744 800B3B44 8FBF001C */ lw $ra, 0x1c($sp) -.L800B3B48: -/* 0B4748 800B3B48 8FB00018 */ lw $s0, 0x18($sp) -/* 0B474C 800B3B4C 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B4750 800B3B50 03E00008 */ jr $ra -/* 0B4754 800B3B54 00000000 */ nop diff --git a/asm/non_matchings/racing/math_util/func_802B8614.s b/asm/non_matchings/racing/math_util/func_802B8614.s deleted file mode 100644 index 6879f1ed1d..0000000000 --- a/asm/non_matchings/racing/math_util/func_802B8614.s +++ /dev/null @@ -1,96 +0,0 @@ -glabel func_802B8614 -/* 121C24 802B8614 27BDFF60 */ addiu $sp, $sp, -0xa0 -/* 121C28 802B8618 F7BE0030 */ sdc1 $f30, 0x30($sp) -/* 121C2C 802B861C F7BC0028 */ sdc1 $f28, 0x28($sp) -/* 121C30 802B8620 F7BA0020 */ sdc1 $f26, 0x20($sp) -/* 121C34 802B8624 F7B80018 */ sdc1 $f24, 0x18($sp) -/* 121C38 802B8628 F7B60010 */ sdc1 $f22, 0x10($sp) -/* 121C3C 802B862C F7B40008 */ sdc1 $f20, 8($sp) -/* 121C40 802B8630 C48401B0 */ lwc1 $f4, 0x1b0($a0) -/* 121C44 802B8634 4480E000 */ mtc1 $zero, $f28 -/* 121C48 802B8638 4480E800 */ mtc1 $zero, $f29 -/* 121C4C 802B863C 460021A1 */ cvt.d.s $f6, $f4 -/* 121C50 802B8640 F7A60078 */ sdc1 $f6, 0x78($sp) -/* 121C54 802B8644 C48801C0 */ lwc1 $f8, 0x1c0($a0) -/* 121C58 802B8648 463CE032 */ c.eq.d $f28, $f28 -/* 121C5C 802B864C 460042A1 */ cvt.d.s $f10, $f8 -/* 121C60 802B8650 F7AA0070 */ sdc1 $f10, 0x70($sp) -/* 121C64 802B8654 C48401B8 */ lwc1 $f4, 0x1b8($a0) -/* 121C68 802B8658 460021A1 */ cvt.d.s $f6, $f4 -/* 121C6C 802B865C F7A60068 */ sdc1 $f6, 0x68($sp) -/* 121C70 802B8660 C48A01A8 */ lwc1 $f10, 0x1a8($a0) -/* 121C74 802B8664 C4880198 */ lwc1 $f8, 0x198($a0) -/* 121C78 802B8668 46005121 */ cvt.d.s $f4, $f10 -/* 121C7C 802B866C 460047A1 */ cvt.d.s $f30, $f8 -/* 121C80 802B8670 F7A40058 */ sdc1 $f4, 0x58($sp) -/* 121C84 802B8674 C48601A0 */ lwc1 $f6, 0x1a0($a0) -/* 121C88 802B8678 46003221 */ cvt.d.s $f8, $f6 -/* 121C8C 802B867C F7A80050 */ sdc1 $f8, 0x50($sp) -/* 121C90 802B8680 C48A01E0 */ lwc1 $f10, 0x1e0($a0) -/* 121C94 802B8684 46005121 */ cvt.d.s $f4, $f10 -/* 121C98 802B8688 F7A40048 */ sdc1 $f4, 0x48($sp) -/* 121C9C 802B868C C48601F0 */ lwc1 $f6, 0x1f0($a0) -/* 121CA0 802B8690 46003221 */ cvt.d.s $f8, $f6 -/* 121CA4 802B8694 D7A60058 */ ldc1 $f6, 0x58($sp) -/* 121CA8 802B8698 F7A80040 */ sdc1 $f8, 0x40($sp) -/* 121CAC 802B869C C48A01E8 */ lwc1 $f10, 0x1e8($a0) -/* 121CB0 802B86A0 D7A80070 */ ldc1 $f8, 0x70($sp) -/* 121CB4 802B86A4 46005121 */ cvt.d.s $f4, $f10 -/* 121CB8 802B86A8 46283081 */ sub.d $f2, $f6, $f8 -/* 121CBC 802B86AC F7A40038 */ sdc1 $f4, 0x38($sp) -/* 121CC0 802B86B0 46202286 */ mov.d $f10, $f4 -/* 121CC4 802B86B4 D7A40050 */ ldc1 $f4, 0x50($sp) -/* 121CC8 802B86B8 D7A80068 */ ldc1 $f8, 0x68($sp) -/* 121CCC 802B86BC 46245301 */ sub.d $f12, $f10, $f4 -/* 121CD0 802B86C0 D7AA0040 */ ldc1 $f10, 0x40($sp) -/* 121CD4 802B86C4 46282381 */ sub.d $f14, $f4, $f8 -/* 121CD8 802B86C8 462C1102 */ mul.d $f4, $f2, $f12 -/* 121CDC 802B86CC 46265401 */ sub.d $f16, $f10, $f6 -/* 121CE0 802B86D0 D7AA0048 */ ldc1 $f10, 0x48($sp) -/* 121CE4 802B86D4 D7A60078 */ ldc1 $f6, 0x78($sp) -/* 121CE8 802B86D8 46307202 */ mul.d $f8, $f14, $f16 -/* 121CEC 802B86DC 463E5481 */ sub.d $f18, $f10, $f30 -/* 121CF0 802B86E0 4626F501 */ sub.d $f20, $f30, $f6 -/* 121CF4 802B86E4 46282581 */ sub.d $f22, $f4, $f8 -/* 121CF8 802B86E8 46327102 */ mul.d $f4, $f14, $f18 -/* 121CFC 802B86EC 00000000 */ nop -/* 121D00 802B86F0 462CA202 */ mul.d $f8, $f20, $f12 -/* 121D04 802B86F4 00000000 */ nop -/* 121D08 802B86F8 4630A282 */ mul.d $f10, $f20, $f16 -/* 121D0C 802B86FC 00000000 */ nop -/* 121D10 802B8700 46321182 */ mul.d $f6, $f2, $f18 -/* 121D14 802B8704 46282601 */ sub.d $f24, $f4, $f8 -/* 121D18 802B8708 45000008 */ bc1f .L802B872C -/* 121D1C 802B870C 46265681 */ sub.d $f26, $f10, $f6 -/* 121D20 802B8710 44800000 */ mtc1 $zero, $f0 -/* 121D24 802B8714 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 121D28 802B8718 44814000 */ mtc1 $at, $f8 -/* 121D2C 802B871C E4800058 */ swc1 $f0, 0x58($a0) -/* 121D30 802B8720 E4800060 */ swc1 $f0, 0x60($a0) -/* 121D34 802B8724 10000010 */ b .L802B8768 -/* 121D38 802B8728 E488005C */ swc1 $f8, 0x5c($a0) -.L802B872C: -/* 121D3C 802B872C 4620B2A0 */ cvt.s.d $f10, $f22 -/* 121D40 802B8730 460051A1 */ cvt.d.s $f6, $f10 -/* 121D44 802B8734 4620C2A0 */ cvt.s.d $f10, $f24 -/* 121D48 802B8738 463C3103 */ div.d $f4, $f6, $f28 -/* 121D4C 802B873C 460051A1 */ cvt.d.s $f6, $f10 -/* 121D50 802B8740 4620D2A0 */ cvt.s.d $f10, $f26 -/* 121D54 802B8744 46202220 */ cvt.s.d $f8, $f4 -/* 121D58 802B8748 463C3103 */ div.d $f4, $f6, $f28 -/* 121D5C 802B874C E4880058 */ swc1 $f8, 0x58($a0) -/* 121D60 802B8750 460051A1 */ cvt.d.s $f6, $f10 -/* 121D64 802B8754 46202220 */ cvt.s.d $f8, $f4 -/* 121D68 802B8758 463C3103 */ div.d $f4, $f6, $f28 -/* 121D6C 802B875C E488005C */ swc1 $f8, 0x5c($a0) -/* 121D70 802B8760 46202220 */ cvt.s.d $f8, $f4 -/* 121D74 802B8764 E4880060 */ swc1 $f8, 0x60($a0) -.L802B8768: -/* 121D78 802B8768 D7B40008 */ ldc1 $f20, 8($sp) -/* 121D7C 802B876C D7B60010 */ ldc1 $f22, 0x10($sp) -/* 121D80 802B8770 D7B80018 */ ldc1 $f24, 0x18($sp) -/* 121D84 802B8774 D7BA0020 */ ldc1 $f26, 0x20($sp) -/* 121D88 802B8778 D7BC0028 */ ldc1 $f28, 0x28($sp) -/* 121D8C 802B877C D7BE0030 */ ldc1 $f30, 0x30($sp) -/* 121D90 802B8780 03E00008 */ jr $ra -/* 121D94 802B8784 27BD00A0 */ addiu $sp, $sp, 0xa0 diff --git a/asm/non_matchings/render_objects/func_8004C6FC.s b/asm/non_matchings/render_objects/func_8004C6FC.s deleted file mode 100644 index e26f8868ef..0000000000 --- a/asm/non_matchings/render_objects/func_8004C6FC.s +++ /dev/null @@ -1,126 +0,0 @@ -glabel func_8004C6FC -/* 04D2FC 8004C6FC 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 04D300 8004C700 AFB10024 */ sw $s1, 0x24($sp) -/* 04D304 8004C704 8FB10058 */ lw $s1, 0x58($sp) -/* 04D308 8004C708 3C0C8015 */ lui $t4, %hi(gDisplayListHead) # $t4, 0x8015 -/* 04D30C 8004C70C 258C0298 */ addiu $t4, %lo(gDisplayListHead) # addiu $t4, $t4, 0x298 -/* 04D310 8004C710 00047400 */ sll $t6, $a0, 0x10 -/* 04D314 8004C714 00F10019 */ multu $a3, $s1 -/* 04D318 8004C718 8D820000 */ lw $v0, ($t4) -/* 04D31C 8004C71C 000E7C03 */ sra $t7, $t6, 0x10 -/* 04D320 8004C720 0005C400 */ sll $t8, $a1, 0x10 -/* 04D324 8004C724 0018CC03 */ sra $t9, $t8, 0x10 -/* 04D328 8004C728 AFBE0040 */ sw $fp, 0x40($sp) -/* 04D32C 8004C72C AFA40048 */ sw $a0, 0x48($sp) -/* 04D330 8004C730 00076842 */ srl $t5, $a3, 1 -/* 04D334 8004C734 01E02025 */ move $a0, $t7 -/* 04D338 8004C738 AFB40030 */ sw $s4, 0x30($sp) -/* 04D33C 8004C73C AFA5004C */ sw $a1, 0x4c($sp) -/* 04D340 8004C740 01EDF023 */ subu $fp, $t7, $t5 -/* 04D344 8004C744 00117042 */ srl $t6, $s1, 1 -/* 04D348 8004C748 03202825 */ move $a1, $t9 -/* 04D34C 8004C74C 032EA023 */ subu $s4, $t9, $t6 -/* 04D350 8004C750 244F0008 */ addiu $t7, $v0, 8 -/* 04D354 8004C754 AFBF0044 */ sw $ra, 0x44($sp) -/* 04D358 8004C758 AFB7003C */ sw $s7, 0x3c($sp) -/* 04D35C 8004C75C AFB60038 */ sw $s6, 0x38($sp) -/* 04D360 8004C760 AFB50034 */ sw $s5, 0x34($sp) -/* 04D364 8004C764 AFB3002C */ sw $s3, 0x2c($sp) -/* 04D368 8004C768 AFB20028 */ sw $s2, 0x28($sp) -/* 04D36C 8004C76C AFB00020 */ sw $s0, 0x20($sp) -/* 04D370 8004C770 AD8F0000 */ sw $t7, ($t4) -/* 04D374 8004C774 3C190D00 */ lui $t9, %hi(D_0D007EF8) # $t9, 0xd00 -/* 04D378 8004C778 27397EF8 */ addiu $t9, %lo(D_0D007EF8) # addiu $t9, $t9, 0x7ef8 -/* 04D37C 8004C77C 3C180600 */ lui $t8, 0x600 -/* 04D380 8004C780 AC580000 */ sw $t8, ($v0) -/* 04D384 8004C784 AC590004 */ sw $t9, 4($v0) -/* 04D388 8004C788 00404025 */ move $t0, $v0 -/* 04D38C 8004C78C 8D820000 */ lw $v0, ($t4) -/* 04D390 8004C790 00001812 */ mflo $v1 -/* 04D394 8004C794 0003C080 */ sll $t8, $v1, 2 -/* 04D398 8004C798 3C0F0050 */ lui $t7, (0x00504240 >> 16) # lui $t7, 0x50 -/* 04D39C 8004C79C 3C0EB900 */ lui $t6, (0xB900031D >> 16) # lui $t6, 0xb900 -/* 04D3A0 8004C7A0 244D0008 */ addiu $t5, $v0, 8 -/* 04D3A4 8004C7A4 AD8D0000 */ sw $t5, ($t4) -/* 04D3A8 8004C7A8 35CE031D */ ori $t6, (0xB900031D & 0xFFFF) # ori $t6, $t6, 0x31d -/* 04D3AC 8004C7AC 35EF4240 */ ori $t7, (0x00504240 & 0xFFFF) # ori $t7, $t7, 0x4240 -/* 04D3B0 8004C7B0 00185B02 */ srl $t3, $t8, 0xc -/* 04D3B4 8004C7B4 33190FFF */ andi $t9, $t8, 0xfff -/* 04D3B8 8004C7B8 00E09025 */ move $s2, $a3 -/* 04D3BC 8004C7BC 00C0A825 */ move $s5, $a2 -/* 04D3C0 8004C7C0 03001825 */ move $v1, $t8 -/* 04D3C4 8004C7C4 0300B025 */ move $s6, $t8 -/* 04D3C8 8004C7C8 01605025 */ move $t2, $t3 -/* 04D3CC 8004C7CC AC4F0004 */ sw $t7, 4($v0) -/* 04D3D0 8004C7D0 AC4E0000 */ sw $t6, ($v0) -/* 04D3D4 8004C7D4 13200002 */ beqz $t9, .L8004C7E0 -/* 04D3D8 8004C7D8 00404825 */ move $t1, $v0 -/* 04D3DC 8004C7DC 256A0001 */ addiu $t2, $t3, 1 -.L8004C7E0: -/* 04D3E0 8004C7E0 022A001B */ divu $zero, $s1, $t2 -/* 04D3E4 8004C7E4 00008012 */ mflo $s0 -/* 04D3E8 8004C7E8 0140B825 */ move $s7, $t2 -/* 04D3EC 8004C7EC 15400002 */ bnez $t2, .L8004C7F8 -/* 04D3F0 8004C7F0 00000000 */ nop -/* 04D3F4 8004C7F4 0007000D */ break 7 -.L8004C7F8: -/* 04D3F8 8004C7F8 00009825 */ move $s3, $zero -/* 04D3FC 8004C7FC 1940001F */ blez $t2, .L8004C87C -/* 04D400 8004C800 00000000 */ nop -.L8004C804: -/* 04D404 8004C804 02500019 */ multu $s2, $s0 -/* 04D408 8004C808 02A02025 */ move $a0, $s5 -/* 04D40C 8004C80C 02402825 */ move $a1, $s2 -/* 04D410 8004C810 02003025 */ move $a2, $s0 -/* 04D414 8004C814 00008812 */ mflo $s1 -/* 04D418 8004C818 00116880 */ sll $t5, $s1, 2 -/* 04D41C 8004C81C 0C010F0A */ jal load_texture_tile_rgba32_nomirror -/* 04D420 8004C820 01A08825 */ move $s1, $t5 -/* 04D424 8004C824 240E0001 */ li $t6, 1 -/* 04D428 8004C828 AFAE0010 */ sw $t6, 0x10($sp) -/* 04D42C 8004C82C 03C02025 */ move $a0, $fp -/* 04D430 8004C830 02802825 */ move $a1, $s4 -/* 04D434 8004C834 02403025 */ move $a2, $s2 -/* 04D438 8004C838 0C012E54 */ jal func_8004B950 -/* 04D43C 8004C83C 02003825 */ move $a3, $s0 -/* 04D440 8004C840 02D11023 */ subu $v0, $s6, $s1 -/* 04D444 8004C844 04410008 */ bgez $v0, .L8004C868 -/* 04D448 8004C848 02B1A821 */ addu $s5, $s5, $s1 -/* 04D44C 8004C84C 02D2001B */ divu $zero, $s6, $s2 -/* 04D450 8004C850 00008012 */ mflo $s0 -/* 04D454 8004C854 16400002 */ bnez $s2, .L8004C860 -/* 04D458 8004C858 00000000 */ nop -/* 04D45C 8004C85C 0007000D */ break 7 -.L8004C860: -/* 04D460 8004C860 10000003 */ b .L8004C870 -/* 04D464 8004C864 26730001 */ addiu $s3, $s3, 1 -.L8004C868: -/* 04D468 8004C868 0040B025 */ move $s6, $v0 -/* 04D46C 8004C86C 26730001 */ addiu $s3, $s3, 1 -.L8004C870: -/* 04D470 8004C870 0277082A */ slt $at, $s3, $s7 -/* 04D474 8004C874 1420FFE3 */ bnez $at, .L8004C804 -/* 04D478 8004C878 0290A021 */ addu $s4, $s4, $s0 -.L8004C87C: -/* 04D47C 8004C87C 3C028015 */ lui $v0, %hi(gDisplayListHead) # $v0, 0x8015 -/* 04D480 8004C880 8C420298 */ lw $v0, %lo(gDisplayListHead)($v0) -/* 04D484 8004C884 3C018015 */ lui $at, %hi(gDisplayListHead) # $at, 0x8015 -/* 04D488 8004C888 3C190D00 */ lui $t9, %hi(D_0D007EB8) # $t9, 0xd00 -/* 04D48C 8004C88C 244F0008 */ addiu $t7, $v0, 8 -/* 04D490 8004C890 AC2F0298 */ sw $t7, %lo(gDisplayListHead)($at) -/* 04D494 8004C894 27397EB8 */ addiu $t9, %lo(D_0D007EB8) # addiu $t9, $t9, 0x7eb8 -/* 04D498 8004C898 3C180600 */ lui $t8, 0x600 -/* 04D49C 8004C89C AC580000 */ sw $t8, ($v0) -/* 04D4A0 8004C8A0 AC590004 */ sw $t9, 4($v0) -/* 04D4A4 8004C8A4 8FBF0044 */ lw $ra, 0x44($sp) -/* 04D4A8 8004C8A8 8FBE0040 */ lw $fp, 0x40($sp) -/* 04D4AC 8004C8AC 8FB7003C */ lw $s7, 0x3c($sp) -/* 04D4B0 8004C8B0 8FB60038 */ lw $s6, 0x38($sp) -/* 04D4B4 8004C8B4 8FB50034 */ lw $s5, 0x34($sp) -/* 04D4B8 8004C8B8 8FB40030 */ lw $s4, 0x30($sp) -/* 04D4BC 8004C8BC 8FB3002C */ lw $s3, 0x2c($sp) -/* 04D4C0 8004C8C0 8FB20028 */ lw $s2, 0x28($sp) -/* 04D4C4 8004C8C4 8FB10024 */ lw $s1, 0x24($sp) -/* 04D4C8 8004C8C8 8FB00020 */ lw $s0, 0x20($sp) -/* 04D4CC 8004C8CC 03E00008 */ jr $ra -/* 04D4D0 8004C8D0 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/asm/non_matchings/render_objects/func_8004F168.s b/asm/non_matchings/render_objects/func_8004F168.s deleted file mode 100644 index 9e763f1375..0000000000 --- a/asm/non_matchings/render_objects/func_8004F168.s +++ /dev/null @@ -1,167 +0,0 @@ -glabel func_8004F168 -/* 04FD68 8004F168 000570C0 */ sll $t6, $a1, 3 -/* 04FD6C 8004F16C 01C57023 */ subu $t6, $t6, $a1 -/* 04FD70 8004F170 000E7100 */ sll $t6, $t6, 4 -/* 04FD74 8004F174 01C57023 */ subu $t6, $t6, $a1 -/* 04FD78 8004F178 3C0F800E */ lui $t7, %hi(gPlayerOne) # $t7, 0x800e -/* 04FD7C 8004F17C 8DEFC4DC */ lw $t7, %lo(gPlayerOne)($t7) -/* 04FD80 8004F180 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 04FD84 8004F184 000E7080 */ sll $t6, $t6, 2 -/* 04FD88 8004F188 01C57023 */ subu $t6, $t6, $a1 -/* 04FD8C 8004F18C 000E70C0 */ sll $t6, $t6, 3 -/* 04FD90 8004F190 AFBF002C */ sw $ra, 0x2c($sp) -/* 04FD94 8004F194 AFA40030 */ sw $a0, 0x30($sp) -/* 04FD98 8004F198 AFA60038 */ sw $a2, 0x38($sp) -/* 04FD9C 8004F19C 01CF1821 */ addu $v1, $t6, $t7 -/* 04FDA0 8004F1A0 94780000 */ lhu $t8, ($v1) -/* 04FDA4 8004F1A4 00A03825 */ move $a3, $a1 -/* 04FDA8 8004F1A8 3C018019 */ lui $at, %hi(D_8018D2A0) # $at, 0x8019 -/* 04FDAC 8004F1AC 33198000 */ andi $t9, $t8, 0x8000 -/* 04FDB0 8004F1B0 13200088 */ beqz $t9, .L8004F3D4 -/* 04FDB4 8004F1B4 00044040 */ sll $t0, $a0, 1 -/* 04FDB8 8004F1B8 C420D2A0 */ lwc1 $f0, %lo(D_8018D2A0)($at) -/* 04FDBC 8004F1BC C4640014 */ lwc1 $f4, 0x14($v1) -/* 04FDC0 8004F1C0 3C098019 */ lui $t1, %hi(D_8018D2C0) # 0x8019 -/* 04FDC4 8004F1C4 C466001C */ lwc1 $f6, 0x1c($v1) -/* 04FDC8 8004F1C8 46002082 */ mul.s $f2, $f4, $f0 -/* 04FDCC 8004F1CC 01284821 */ addu $t1, $t1, $t0 -/* 04FDD0 8004F1D0 3C0A8019 */ lui $t2, %hi(D_8018D2F0) # $t2, 0x8019 -/* 04FDD4 8004F1D4 3C0C8019 */ lui $t4, %hi(D_8018D2B0) # $t4, 0x8019 -/* 04FDD8 8004F1D8 858CD2B0 */ lh $t4, %lo(D_8018D2B0)($t4) -/* 04FDDC 8004F1DC 854AD2F0 */ lh $t2, %lo(D_8018D2F0)($t2) -/* 04FDE0 8004F1E0 8529D2C0 */ lh $t1, %lo(D_8018D2C0)($t1) # -0x2d40($t1) -/* 04FDE4 8004F1E4 4600120D */ trunc.w.s $f8, $f2 -/* 04FDE8 8004F1E8 46003302 */ mul.s $f12, $f6, $f0 -/* 04FDEC 8004F1EC 3C0F8019 */ lui $t7, %hi(D_8018D2E0) # $t7, 0x8019 -/* 04FDF0 8004F1F0 85EFD2E0 */ lh $t7, %lo(D_8018D2E0)($t7) -/* 04FDF4 8004F1F4 01001025 */ move $v0, $t0 -/* 04FDF8 8004F1F8 012A5821 */ addu $t3, $t1, $t2 -/* 04FDFC 8004F1FC 05810003 */ bgez $t4, .L8004F20C -/* 04FE00 8004F200 000C6843 */ sra $t5, $t4, 1 -/* 04FE04 8004F204 25810001 */ addiu $at, $t4, 1 -/* 04FE08 8004F208 00016843 */ sra $t5, $at, 1 -.L8004F20C: -/* 04FE0C 8004F20C 44084000 */ mfc1 $t0, $f8 -/* 04FE10 8004F210 016D7023 */ subu $t6, $t3, $t5 -/* 04FE14 8004F214 3C0D8019 */ lui $t5, %hi(D_8018D2D8) # 0x8019 -/* 04FE18 8004F218 01CFC021 */ addu $t8, $t6, $t7 -/* 04FE1C 8004F21C 3C0E8019 */ lui $t6, %hi(D_8018D2F8) # $t6, 0x8019 -/* 04FE20 8004F220 01A26821 */ addu $t5, $t5, $v0 -/* 04FE24 8004F224 00084C00 */ sll $t1, $t0, 0x10 -/* 04FE28 8004F228 85ADD2D8 */ lh $t5, %lo(D_8018D2D8)($t5) # -0x2d28($t5) -/* 04FE2C 8004F22C 85CED2F8 */ lh $t6, %lo(D_8018D2F8)($t6) -/* 04FE30 8004F230 3C198019 */ lui $t9, %hi(D_8018D2B8) # $t9, 0x8019 -/* 04FE34 8004F234 4600628D */ trunc.w.s $f10, $f12 -/* 04FE38 8004F238 8739D2B8 */ lh $t9, %lo(D_8018D2B8)($t9) -/* 04FE3C 8004F23C 00095403 */ sra $t2, $t1, 0x10 -/* 04FE40 8004F240 030A2021 */ addu $a0, $t8, $t2 -/* 04FE44 8004F244 3C188019 */ lui $t8, %hi(D_8018D2E8) # $t8, 0x8019 -/* 04FE48 8004F248 01AE7821 */ addu $t7, $t5, $t6 -/* 04FE4C 8004F24C 8718D2E8 */ lh $t8, %lo(D_8018D2E8)($t8) -/* 04FE50 8004F250 440E5000 */ mfc1 $t6, $f10 -/* 04FE54 8004F254 00046400 */ sll $t4, $a0, 0x10 -/* 04FE58 8004F258 000C5C03 */ sra $t3, $t4, 0x10 -/* 04FE5C 8004F25C 01602025 */ move $a0, $t3 -/* 04FE60 8004F260 07210003 */ bgez $t9, .L8004F270 -/* 04FE64 8004F264 00194043 */ sra $t0, $t9, 1 -/* 04FE68 8004F268 27210001 */ addiu $at, $t9, 1 -/* 04FE6C 8004F26C 00014043 */ sra $t0, $at, 1 -.L8004F270: -/* 04FE70 8004F270 01E84823 */ subu $t1, $t7, $t0 -/* 04FE74 8004F274 8FA80038 */ lw $t0, 0x38($sp) -/* 04FE78 8004F278 01385021 */ addu $t2, $t1, $t8 -/* 04FE7C 8004F27C 014E2821 */ addu $a1, $t2, $t6 -/* 04FE80 8004F280 0005CC00 */ sll $t9, $a1, 0x10 -/* 04FE84 8004F284 24010008 */ li $at, 8 -/* 04FE88 8004F288 1101003F */ beq $t0, $at, .L8004F388 -/* 04FE8C 8004F28C 00192C03 */ sra $a1, $t9, 0x10 -/* 04FE90 8004F290 00074880 */ sll $t1, $a3, 2 -/* 04FE94 8004F294 3C188016 */ lui $t8, %hi(gGPCurrentRaceRankByPlayerId) -/* 04FE98 8004F298 0309C021 */ addu $t8, $t8, $t1 -/* 04FE9C 8004F29C 8F1843B8 */ lw $t8, %lo(gGPCurrentRaceRankByPlayerId)($t8) -/* 04FEA0 8004F2A0 3C02800E */ lui $v0, %hi(gModeSelection) # $v0, 0x800e -/* 04FEA4 8004F2A4 3C073F80 */ lui $a3, 0x3f80 -/* 04FEA8 8004F2A8 1700001F */ bnez $t8, .L8004F328 -/* 04FEAC 8004F2AC 8FAD0038 */ lw $t5, 0x38($sp) -/* 04FEB0 8004F2B0 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 04FEB4 8004F2B4 24010003 */ li $at, 3 -/* 04FEB8 8004F2B8 1041001B */ beq $v0, $at, .L8004F328 -/* 04FEBC 8004F2BC 24010001 */ li $at, 1 -/* 04FEC0 8004F2C0 10410019 */ beq $v0, $at, .L8004F328 -/* 04FEC4 8004F2C4 3C0A0D03 */ lui $t2, %hi(common_texture_minimap_kart_character) # $t2, 0xd03 -/* 04FEC8 8004F2C8 8466002E */ lh $a2, 0x2e($v1) -/* 04FECC 8004F2CC 34018000 */ li $at, 32768 -/* 04FED0 8004F2D0 000869C0 */ sll $t5, $t0, 7 -/* 04FED4 8004F2D4 00C13021 */ addu $a2, $a2, $at -/* 04FED8 8004F2D8 30CCFFFF */ andi $t4, $a2, 0xffff -/* 04FEDC 8004F2DC 01803025 */ move $a2, $t4 -/* 04FEE0 8004F2E0 254ACCD8 */ addiu $t2, %lo(common_texture_minimap_kart_character) # addiu $t2, $t2, -0x3328 -/* 04FEE4 8004F2E4 3C190D00 */ lui $t9, %hi(common_vtx_player_minimap_icon) # $t9, 0xd00 -/* 04FEE8 8004F2E8 27395470 */ addiu $t9, %lo(common_vtx_player_minimap_icon) # addiu $t9, $t9, 0x5470 -/* 04FEEC 8004F2EC 01AA7021 */ addu $t6, $t5, $t2 -/* 04FEF0 8004F2F0 240C0008 */ li $t4, 8 -/* 04FEF4 8004F2F4 240F0008 */ li $t7, 8 -/* 04FEF8 8004F2F8 24090008 */ li $t1, 8 -/* 04FEFC 8004F2FC 24180008 */ li $t8, 8 -/* 04FF00 8004F300 AFB80020 */ sw $t8, 0x20($sp) -/* 04FF04 8004F304 AFA9001C */ sw $t1, 0x1c($sp) -/* 04FF08 8004F308 AFAF0018 */ sw $t7, 0x18($sp) -/* 04FF0C 8004F30C AFAC0024 */ sw $t4, 0x24($sp) -/* 04FF10 8004F310 AFAE0010 */ sw $t6, 0x10($sp) -/* 04FF14 8004F314 AFB90014 */ sw $t9, 0x14($sp) -/* 04FF18 8004F318 0C011909 */ jal func_80046424 -/* 04FF1C 8004F31C 3C073F80 */ lui $a3, 0x3f80 -/* 04FF20 8004F320 1000002D */ b .L8004F3D8 -/* 04FF24 8004F324 8FBF002C */ lw $ra, 0x2c($sp) -.L8004F328: -/* 04FF28 8004F328 8466002E */ lh $a2, 0x2e($v1) -/* 04FF2C 8004F32C 34018000 */ li $at, 32768 -/* 04FF30 8004F330 3C0E0D03 */ lui $t6, %hi(common_texture_minimap_kart_character) # $t6, 0xd03 -/* 04FF34 8004F334 00C13021 */ addu $a2, $a2, $at -/* 04FF38 8004F338 30C8FFFF */ andi $t0, $a2, 0xffff -/* 04FF3C 8004F33C 01003025 */ move $a2, $t0 -/* 04FF40 8004F340 25CECCD8 */ addiu $t6, %lo(common_texture_minimap_kart_character) # addiu $t6, $t6, -0x3328 -/* 04FF44 8004F344 000D51C0 */ sll $t2, $t5, 7 -/* 04FF48 8004F348 3C0F0D00 */ lui $t7, %hi(common_vtx_player_minimap_icon) # $t7, 0xd00 -/* 04FF4C 8004F34C 25EF5470 */ addiu $t7, %lo(common_vtx_player_minimap_icon) # addiu $t7, $t7, 0x5470 -/* 04FF50 8004F350 014EC821 */ addu $t9, $t2, $t6 -/* 04FF54 8004F354 24080008 */ li $t0, 8 -/* 04FF58 8004F358 24090008 */ li $t1, 8 -/* 04FF5C 8004F35C 24180008 */ li $t8, 8 -/* 04FF60 8004F360 240C0008 */ li $t4, 8 -/* 04FF64 8004F364 AFAC0020 */ sw $t4, 0x20($sp) -/* 04FF68 8004F368 AFB8001C */ sw $t8, 0x1c($sp) -/* 04FF6C 8004F36C AFA90018 */ sw $t1, 0x18($sp) -/* 04FF70 8004F370 AFA80024 */ sw $t0, 0x24($sp) -/* 04FF74 8004F374 AFB90010 */ sw $t9, 0x10($sp) -/* 04FF78 8004F378 0C0118EC */ jal func_800463B0 -/* 04FF7C 8004F37C AFAF0014 */ sw $t7, 0x14($sp) -/* 04FF80 8004F380 10000015 */ b .L8004F3D8 -/* 04FF84 8004F384 8FBF002C */ lw $ra, 0x2c($sp) -.L8004F388: -/* 04FF88 8004F388 00075880 */ sll $t3, $a3, 2 -/* 04FF8C 8004F38C 3C0D8016 */ lui $t5, %hi(gGPCurrentRaceRankByPlayerId) -/* 04FF90 8004F390 01AB6821 */ addu $t5, $t5, $t3 -/* 04FF94 8004F394 8DAD43B8 */ lw $t5, %lo(gGPCurrentRaceRankByPlayerId)($t5) -/* 04FF98 8004F398 24070008 */ li $a3, 8 -/* 04FF9C 8004F39C 24060008 */ li $a2, 8 -/* 04FFA0 8004F3A0 15A00009 */ bnez $t5, .L8004F3C8 -/* 04FFA4 8004F3A4 3C0E0D03 */ lui $t6, %hi(common_texture_minimap_progress_dot) # $t6, 0xd03 -/* 04FFA8 8004F3A8 3C0A0D03 */ lui $t2, %hi(common_texture_minimap_progress_dot) # $t2, 0xd03 -/* 04FFAC 8004F3AC 254AD0D8 */ addiu $t2, %lo(common_texture_minimap_progress_dot) # addiu $t2, $t2, -0x2f28 -/* 04FFB0 8004F3B0 AFAA0010 */ sw $t2, 0x10($sp) -/* 04FFB4 8004F3B4 24060008 */ li $a2, 8 -/* 04FFB8 8004F3B8 0C013114 */ jal func_8004C450 -/* 04FFBC 8004F3BC 24070008 */ li $a3, 8 -/* 04FFC0 8004F3C0 10000005 */ b .L8004F3D8 -/* 04FFC4 8004F3C4 8FBF002C */ lw $ra, 0x2c($sp) -.L8004F3C8: -/* 04FFC8 8004F3C8 25CED0D8 */ addiu $t6, %lo(common_texture_minimap_progress_dot) # addiu $t6, $t6, -0x2f28 -/* 04FFCC 8004F3CC 0C0130D9 */ jal draw_hud_2d_texture -/* 04FFD0 8004F3D0 AFAE0010 */ sw $t6, 0x10($sp) -.L8004F3D4: -/* 04FFD4 8004F3D4 8FBF002C */ lw $ra, 0x2c($sp) -.L8004F3D8: -/* 04FFD8 8004F3D8 27BD0030 */ addiu $sp, $sp, 0x30 -/* 04FFDC 8004F3DC 03E00008 */ jr $ra -/* 04FFE0 8004F3E0 00000000 */ nop diff --git a/asm/non_matchings/render_objects/func_80050E34.s b/asm/non_matchings/render_objects/func_80050E34.s deleted file mode 100644 index 9173976168..0000000000 --- a/asm/non_matchings/render_objects/func_80050E34.s +++ /dev/null @@ -1,433 +0,0 @@ -glabel func_80050E34 -/* 051A34 80050E34 000470C0 */ sll $t6, $a0, 3 -/* 051A38 80050E38 01C47023 */ subu $t6, $t6, $a0 -/* 051A3C 80050E3C 000E7100 */ sll $t6, $t6, 4 -/* 051A40 80050E40 01C47023 */ subu $t6, $t6, $a0 -/* 051A44 80050E44 3C0F800E */ lui $t7, %hi(gPlayerOne) # $t7, 0x800e -/* 051A48 80050E48 8DEFC4DC */ lw $t7, %lo(gPlayerOne)($t7) -/* 051A4C 80050E4C 000E7080 */ sll $t6, $t6, 2 -/* 051A50 80050E50 01C47023 */ subu $t6, $t6, $a0 -/* 051A54 80050E54 27BDFF28 */ addiu $sp, $sp, -0xd8 -/* 051A58 80050E58 000E70C0 */ sll $t6, $t6, 3 -/* 051A5C 80050E5C 01CF1021 */ addu $v0, $t6, $t7 -/* 051A60 80050E60 3C0E800E */ lui $t6, %hi(gPlayerCountSelection1) # $t6, 0x800e -/* 051A64 80050E64 8DCEC538 */ lw $t6, %lo(gPlayerCountSelection1)($t6) -/* 051A68 80050E68 AFB00024 */ sw $s0, 0x24($sp) -/* 051A6C 80050E6C 3C108016 */ lui $s0, %hi(gLapCountByPlayerId) # 0x8016 -/* 051A70 80050E70 0004C080 */ sll $t8, $a0, 2 -/* 051A74 80050E74 0004C940 */ sll $t9, $a0, 5 -/* 051A78 80050E78 3C0D8019 */ lui $t5, %hi(D_8018CE10) # 0x8019 -/* 051A7C 80050E7C AFBF002C */ sw $ra, 0x2c($sp) -/* 051A80 80050E80 AFB10028 */ sw $s1, 0x28($sp) -/* 051A84 80050E84 AFA500DC */ sw $a1, 0xdc($sp) -/* 051A88 80050E88 AFA200AC */ sw $v0, 0xac($sp) -/* 051A8C 80050E8C 02188021 */ addu $s0, $s0, $t8 -/* 051A90 80050E90 01B96821 */ addu $t5, $t5, $t9 -/* 051A94 80050E94 24010001 */ li $at, 1 -/* 051A98 80050E98 00803825 */ move $a3, $a0 -/* 051A9C 80050E9C 8E104390 */ lw $s0, %lo(gLapCountByPlayerId)($s0) # 0x4390($s0) -/* 051AA0 80050EA0 94510254 */ lhu $s1, 0x254($v0) -/* 051AA4 80050EA4 15C10004 */ bne $t6, $at, .L80050EB8 -/* 051AA8 80050EA8 8DADCE24 */ lw $t5, %lo(D_8018CE10 + 0x14)($t5) # -0x31dc($t5) -/* 051AAC 80050EAC 240F0012 */ li $t7, 18 -/* 051AB0 80050EB0 10000003 */ b .L80050EC0 -/* 051AB4 80050EB4 AFAF00C4 */ sw $t7, 0xc4($sp) -.L80050EB8: -/* 051AB8 80050EB8 24180078 */ li $t8, 120 -/* 051ABC 80050EBC AFB800C4 */ sw $t8, 0xc4($sp) -.L80050EC0: -/* 051AC0 80050EC0 30E4FFFF */ andi $a0, $a3, 0xffff -/* 051AC4 80050EC4 27A500D0 */ addiu $a1, $sp, 0xd0 -/* 051AC8 80050EC8 27A600CC */ addiu $a2, $sp, 0xcc -/* 051ACC 80050ECC 0C014191 */ jal func_80050644 -/* 051AD0 80050ED0 AFAD00D4 */ sw $t5, 0xd4($sp) -/* 051AD4 80050ED4 24010002 */ li $at, 2 -/* 051AD8 80050ED8 10410003 */ beq $v0, $at, .L80050EE8 -/* 051ADC 80050EDC 8FAD00D4 */ lw $t5, 0xd4($sp) -/* 051AE0 80050EE0 24010003 */ li $at, 3 -/* 051AE4 80050EE4 14410003 */ bne $v0, $at, .L80050EF4 -.L80050EE8: -/* 051AE8 80050EE8 24190001 */ li $t9, 1 -/* 051AEC 80050EEC 10000002 */ b .L80050EF8 -/* 051AF0 80050EF0 AFB900B8 */ sw $t9, 0xb8($sp) -.L80050EF4: -/* 051AF4 80050EF4 AFA000B8 */ sw $zero, 0xb8($sp) -.L80050EF8: -/* 051AF8 80050EF8 3C0E800E */ lui $t6, %hi(gCurrentCourseId) # $t6, 0x800e -/* 051AFC 80050EFC 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 051B00 80050F00 24010004 */ li $at, 4 -/* 051B04 80050F04 3C18FD10 */ lui $t8, 0xfd10 -/* 051B08 80050F08 15C10062 */ bne $t6, $at, .L80051094 -/* 051B0C 80050F0C 00115080 */ sll $t2, $s1, 2 -/* 051B10 80050F10 2A010003 */ slti $at, $s0, 3 -/* 051B14 80050F14 1020005F */ beqz $at, .L80051094 -/* 051B18 80050F18 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 051B1C 80050F1C 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 051B20 80050F20 8E020000 */ lw $v0, ($s0) -/* 051B24 80050F24 3C190D00 */ lui $t9, %hi(D_0D007DB8) # $t9, 0xd00 -/* 051B28 80050F28 27397DB8 */ addiu $t9, %lo(D_0D007DB8) # addiu $t9, $t9, 0x7db8 -/* 051B2C 80050F2C 244F0008 */ addiu $t7, $v0, 8 -/* 051B30 80050F30 AE0F0000 */ sw $t7, ($s0) -/* 051B34 80050F34 3C180600 */ lui $t8, 0x600 -/* 051B38 80050F38 AC580000 */ sw $t8, ($v0) -/* 051B3C 80050F3C AC590004 */ sw $t9, 4($v0) -/* 051B40 80050F40 8E020000 */ lw $v0, ($s0) -/* 051B44 80050F44 3C180D02 */ lui $t8, %hi(common_tlut_portrait_bomb_kart_and_question_mark) # $t8, 0xd02 -/* 051B48 80050F48 2718B4D8 */ addiu $t8, %lo(common_tlut_portrait_bomb_kart_and_question_mark) # addiu $t8, $t8, -0x4b28 -/* 051B4C 80050F4C 244E0008 */ addiu $t6, $v0, 8 -/* 051B50 80050F50 AE0E0000 */ sw $t6, ($s0) -/* 051B54 80050F54 3C0FFD10 */ lui $t7, 0xfd10 -/* 051B58 80050F58 AC4F0000 */ sw $t7, ($v0) -/* 051B5C 80050F5C AC580004 */ sw $t8, 4($v0) -/* 051B60 80050F60 8E020000 */ lw $v0, ($s0) -/* 051B64 80050F64 3C0EE800 */ lui $t6, 0xe800 -/* 051B68 80050F68 3C18F500 */ lui $t8, (0xF5000100 >> 16) # lui $t8, 0xf500 -/* 051B6C 80050F6C 24590008 */ addiu $t9, $v0, 8 -/* 051B70 80050F70 AE190000 */ sw $t9, ($s0) -/* 051B74 80050F74 AC400004 */ sw $zero, 4($v0) -/* 051B78 80050F78 AC4E0000 */ sw $t6, ($v0) -/* 051B7C 80050F7C 8E020000 */ lw $v0, ($s0) -/* 051B80 80050F80 3C190700 */ lui $t9, 0x700 -/* 051B84 80050F84 37180100 */ ori $t8, (0xF5000100 & 0xFFFF) # ori $t8, $t8, 0x100 -/* 051B88 80050F88 244F0008 */ addiu $t7, $v0, 8 -/* 051B8C 80050F8C AE0F0000 */ sw $t7, ($s0) -/* 051B90 80050F90 AC590004 */ sw $t9, 4($v0) -/* 051B94 80050F94 AC580000 */ sw $t8, ($v0) -/* 051B98 80050F98 8E020000 */ lw $v0, ($s0) -/* 051B9C 80050F9C 3C0FE600 */ lui $t7, 0xe600 -/* 051BA0 80050FA0 3C19F000 */ lui $t9, 0xf000 -/* 051BA4 80050FA4 244E0008 */ addiu $t6, $v0, 8 -/* 051BA8 80050FA8 AE0E0000 */ sw $t6, ($s0) -/* 051BAC 80050FAC AC400004 */ sw $zero, 4($v0) -/* 051BB0 80050FB0 AC4F0000 */ sw $t7, ($v0) -/* 051BB4 80050FB4 8E020000 */ lw $v0, ($s0) -/* 051BB8 80050FB8 3C0E073F */ lui $t6, (0x073FC000 >> 16) # lui $t6, 0x73f -/* 051BBC 80050FBC 35CEC000 */ ori $t6, (0x073FC000 & 0xFFFF) # ori $t6, $t6, 0xc000 -/* 051BC0 80050FC0 24580008 */ addiu $t8, $v0, 8 -/* 051BC4 80050FC4 AE180000 */ sw $t8, ($s0) -/* 051BC8 80050FC8 AC4E0004 */ sw $t6, 4($v0) -/* 051BCC 80050FCC AC590000 */ sw $t9, ($v0) -/* 051BD0 80050FD0 8E020000 */ lw $v0, ($s0) -/* 051BD4 80050FD4 3C18E700 */ lui $t8, 0xe700 -/* 051BD8 80050FD8 3C040D02 */ lui $a0, %hi(common_texture_portrait_question_mark) # $a0, 0xd02 -/* 051BDC 80050FDC 244F0008 */ addiu $t7, $v0, 8 -/* 051BE0 80050FE0 AE0F0000 */ sw $t7, ($s0) -/* 051BE4 80050FE4 AC400004 */ sw $zero, 4($v0) -/* 051BE8 80050FE8 AC580000 */ sw $t8, ($v0) -/* 051BEC 80050FEC AFAD00D4 */ sw $t5, 0xd4($sp) -/* 051BF0 80050FF0 2484DAD8 */ addiu $a0, %lo(common_texture_portrait_question_mark) # addiu $a0, $a0, -0x2528 -/* 051BF4 80050FF4 24050020 */ li $a1, 32 -/* 051BF8 80050FF8 0C0114A9 */ jal rsp_load_texture -/* 051BFC 80050FFC 24060020 */ li $a2, 32 -/* 051C00 80051000 8FAD00D4 */ lw $t5, 0xd4($sp) -/* 051C04 80051004 3C0E8016 */ lui $t6, %hi(gObjectList) # $t6, 0x8016 -/* 051C08 80051008 25CE5C18 */ addiu $t6, %lo(gObjectList) # addiu $t6, $t6, 0x5c18 -/* 051C0C 8005100C 000DC8C0 */ sll $t9, $t5, 3 -/* 051C10 80051010 032DC823 */ subu $t9, $t9, $t5 -/* 051C14 80051014 0019C940 */ sll $t9, $t9, 5 -/* 051C18 80051018 8FAF00D0 */ lw $t7, 0xd0($sp) -/* 051C1C 8005101C 032E8821 */ addu $s1, $t9, $t6 -/* 051C20 80051020 8FAE00CC */ lw $t6, 0xcc($sp) -/* 051C24 80051024 8FB900C4 */ lw $t9, 0xc4($sp) -/* 051C28 80051028 25F80020 */ addiu $t8, $t7, 0x20 -/* 051C2C 8005102C 44983000 */ mtc1 $t8, $f6 -/* 051C30 80051030 032E7821 */ addu $t7, $t9, $t6 -/* 051C34 80051034 448F8000 */ mtc1 $t7, $f16 -/* 051C38 80051038 46803220 */ cvt.s.w $f8, $f6 -/* 051C3C 8005103C C6240028 */ lwc1 $f4, 0x28($s1) -/* 051C40 80051040 C626002C */ lwc1 $f6, 0x2c($s1) -/* 051C44 80051044 26240004 */ addiu $a0, $s1, 4 -/* 051C48 80051048 262500BE */ addiu $a1, $s1, 0xbe -/* 051C4C 8005104C 468084A0 */ cvt.s.w $f18, $f16 -/* 051C50 80051050 8E260000 */ lw $a2, ($s1) -/* 051C54 80051054 46082280 */ add.s $f10, $f4, $f8 -/* 051C58 80051058 C6280030 */ lwc1 $f8, 0x30($s1) -/* 051C5C 8005105C 46123100 */ add.s $f4, $f6, $f18 -/* 051C60 80051060 E62A0004 */ swc1 $f10, 4($s1) -/* 051C64 80051064 E628000C */ swc1 $f8, 0xc($s1) -/* 051C68 80051068 0C010B80 */ jal rsp_set_matrix_transformation -/* 051C6C 8005106C E6240008 */ swc1 $f4, 8($s1) -/* 051C70 80051070 8E020000 */ lw $v0, ($s0) -/* 051C74 80051074 3C0E0D00 */ lui $t6, %hi(D_0D0069E0) # $t6, 0xd00 -/* 051C78 80051078 25CE69E0 */ addiu $t6, %lo(D_0D0069E0) # addiu $t6, $t6, 0x69e0 -/* 051C7C 8005107C 24580008 */ addiu $t8, $v0, 8 -/* 051C80 80051080 AE180000 */ sw $t8, ($s0) -/* 051C84 80051084 3C190600 */ lui $t9, 0x600 -/* 051C88 80051088 AC590000 */ sw $t9, ($v0) -/* 051C8C 8005108C 10000106 */ b .L800514A8 -/* 051C90 80051090 AC4E0004 */ sw $t6, 4($v0) -.L80051094: -/* 051C94 80051094 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 051C98 80051098 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 051C9C 8005109C 8E020000 */ lw $v0, ($s0) -/* 051CA0 800510A0 3C19800E */ lui $t9, %hi(gPortraitTLUTs) -/* 051CA4 800510A4 032AC821 */ addu $t9, $t9, $t2 -/* 051CA8 800510A8 244F0008 */ addiu $t7, $v0, 8 -/* 051CAC 800510AC AE0F0000 */ sw $t7, ($s0) -/* 051CB0 800510B0 AC580000 */ sw $t8, ($v0) -/* 051CB4 800510B4 8F39457C */ lw $t9, %lo(gPortraitTLUTs)($t9) -/* 051CB8 800510B8 3C0FE800 */ lui $t7, 0xe800 -/* 051CBC 800510BC 3C048016 */ lui $a0, %hi(D_801656C0) # $a0, 0x8016 -/* 051CC0 800510C0 AC590004 */ sw $t9, 4($v0) -/* 051CC4 800510C4 8E020000 */ lw $v0, ($s0) -/* 051CC8 800510C8 3C19F500 */ lui $t9, (0xF5000100 >> 16) # lui $t9, 0xf500 -/* 051CCC 800510CC 37390100 */ ori $t9, (0xF5000100 & 0xFFFF) # ori $t9, $t9, 0x100 -/* 051CD0 800510D0 244E0008 */ addiu $t6, $v0, 8 -/* 051CD4 800510D4 AE0E0000 */ sw $t6, ($s0) -/* 051CD8 800510D8 AC400004 */ sw $zero, 4($v0) -/* 051CDC 800510DC AC4F0000 */ sw $t7, ($v0) -/* 051CE0 800510E0 8E020000 */ lw $v0, ($s0) -/* 051CE4 800510E4 3C0E0700 */ lui $t6, 0x700 -/* 051CE8 800510E8 3C058016 */ lui $a1, %hi(D_801656D0) # $a1, 0x8016 -/* 051CEC 800510EC 24580008 */ addiu $t8, $v0, 8 -/* 051CF0 800510F0 AE180000 */ sw $t8, ($s0) -/* 051CF4 800510F4 AC4E0004 */ sw $t6, 4($v0) -/* 051CF8 800510F8 AC590000 */ sw $t9, ($v0) -/* 051CFC 800510FC 8E020000 */ lw $v0, ($s0) -/* 051D00 80051100 3C18E600 */ lui $t8, 0xe600 -/* 051D04 80051104 3C0EF000 */ lui $t6, 0xf000 -/* 051D08 80051108 244F0008 */ addiu $t7, $v0, 8 -/* 051D0C 8005110C AE0F0000 */ sw $t7, ($s0) -/* 051D10 80051110 AC400004 */ sw $zero, 4($v0) -/* 051D14 80051114 AC580000 */ sw $t8, ($v0) -/* 051D18 80051118 8E020000 */ lw $v0, ($s0) -/* 051D1C 8005111C 3C0F073F */ lui $t7, (0x073FC000 >> 16) # lui $t7, 0x73f -/* 051D20 80051120 35EFC000 */ ori $t7, (0x073FC000 & 0xFFFF) # ori $t7, $t7, 0xc000 -/* 051D24 80051124 24590008 */ addiu $t9, $v0, 8 -/* 051D28 80051128 AE190000 */ sw $t9, ($s0) -/* 051D2C 8005112C AC4F0004 */ sw $t7, 4($v0) -/* 051D30 80051130 AC4E0000 */ sw $t6, ($v0) -/* 051D34 80051134 8E020000 */ lw $v0, ($s0) -/* 051D38 80051138 3C19E700 */ lui $t9, 0xe700 -/* 051D3C 8005113C 3C0F0600 */ lui $t7, 0x600 -/* 051D40 80051140 24580008 */ addiu $t8, $v0, 8 -/* 051D44 80051144 AE180000 */ sw $t8, ($s0) -/* 051D48 80051148 AC400004 */ sw $zero, 4($v0) -/* 051D4C 8005114C AC590000 */ sw $t9, ($v0) -/* 051D50 80051150 8E020000 */ lw $v0, ($s0) -/* 051D54 80051154 3C180D00 */ lui $t8, %hi(D_0D007DB8) # $t8, 0xd00 -/* 051D58 80051158 27187DB8 */ addiu $t8, %lo(D_0D007DB8) # addiu $t8, $t8, 0x7db8 -/* 051D5C 8005115C 244E0008 */ addiu $t6, $v0, 8 -/* 051D60 80051160 AE0E0000 */ sw $t6, ($s0) -/* 051D64 80051164 AC580004 */ sw $t8, 4($v0) -/* 051D68 80051168 AC4F0000 */ sw $t7, ($v0) -/* 051D6C 8005116C 8FB900AC */ lw $t9, 0xac($sp) -/* 051D70 80051170 3C068016 */ lui $a2, %hi(D_801656E0) # $a2, 0x8016 -/* 051D74 80051174 24070080 */ li $a3, 128 -/* 051D78 80051178 8F2E00BC */ lw $t6, 0xbc($t9) -/* 051D7C 8005117C 000DC8C0 */ sll $t9, $t5, 3 -/* 051D80 80051180 032DC823 */ subu $t9, $t9, $t5 -/* 051D84 80051184 31CF0200 */ andi $t7, $t6, 0x200 -/* 051D88 80051188 11E00014 */ beqz $t7, .L800511DC -/* 051D8C 8005118C 0019C940 */ sll $t9, $t9, 5 -/* 051D90 80051190 000D70C0 */ sll $t6, $t5, 3 -/* 051D94 80051194 01CD7023 */ subu $t6, $t6, $t5 -/* 051D98 80051198 3C0F8016 */ lui $t7, %hi(gObjectList) # $t7, 0x8016 -/* 051D9C 8005119C 25EF5C18 */ addiu $t7, %lo(gObjectList) # addiu $t7, $t7, 0x5c18 -/* 051DA0 800511A0 000E7140 */ sll $t6, $t6, 5 -/* 051DA4 800511A4 24180080 */ li $t8, 128 -/* 051DA8 800511A8 AFB80010 */ sw $t8, 0x10($sp) -/* 051DAC 800511AC 01CF8821 */ addu $s1, $t6, $t7 -/* 051DB0 800511B0 863800A0 */ lh $t8, 0xa0($s1) -/* 051DB4 800511B4 24190080 */ li $t9, 128 -/* 051DB8 800511B8 AFB90014 */ sw $t9, 0x14($sp) -/* 051DBC 800511BC 948456C0 */ lhu $a0, %lo(D_801656C0)($a0) -/* 051DC0 800511C0 94A556D0 */ lhu $a1, %lo(D_801656D0)($a1) -/* 051DC4 800511C4 94C656E0 */ lhu $a2, %lo(D_801656E0)($a2) -/* 051DC8 800511C8 AFAA003C */ sw $t2, 0x3c($sp) -/* 051DCC 800511CC 0C012D85 */ jal func_8004B614 -/* 051DD0 800511D0 AFB80018 */ sw $t8, 0x18($sp) -/* 051DD4 800511D4 10000008 */ b .L800511F8 -/* 051DD8 800511D8 8FAA003C */ lw $t2, 0x3c($sp) -.L800511DC: -/* 051DDC 800511DC 3C0E8016 */ lui $t6, %hi(gObjectList) # $t6, 0x8016 -/* 051DE0 800511E0 25CE5C18 */ addiu $t6, %lo(gObjectList) # addiu $t6, $t6, 0x5c18 -/* 051DE4 800511E4 032E8821 */ addu $s1, $t9, $t6 -/* 051DE8 800511E8 862400A0 */ lh $a0, 0xa0($s1) -/* 051DEC 800511EC 0C012CAF */ jal set_transparency -/* 051DF0 800511F0 AFAA003C */ sw $t2, 0x3c($sp) -/* 051DF4 800511F4 8FAA003C */ lw $t2, 0x3c($sp) -.L800511F8: -/* 051DF8 800511F8 3C04800E */ lui $a0, %hi(gPortraitTextures) -/* 051DFC 800511FC 008A2021 */ addu $a0, $a0, $t2 -/* 051E00 80051200 8C84459C */ lw $a0, %lo(gPortraitTextures)($a0) -/* 051E04 80051204 24050020 */ li $a1, 32 -/* 051E08 80051208 0C0114A9 */ jal rsp_load_texture -/* 051E0C 8005120C 24060020 */ li $a2, 32 -/* 051E10 80051210 8FAF00D0 */ lw $t7, 0xd0($sp) -/* 051E14 80051214 8FB900C4 */ lw $t9, 0xc4($sp) -/* 051E18 80051218 8FAE00CC */ lw $t6, 0xcc($sp) -/* 051E1C 8005121C 25F80020 */ addiu $t8, $t7, 0x20 -/* 051E20 80051220 44988000 */ mtc1 $t8, $f16 -/* 051E24 80051224 032E7821 */ addu $t7, $t9, $t6 -/* 051E28 80051228 448F2000 */ mtc1 $t7, $f4 -/* 051E2C 8005122C 468081A0 */ cvt.s.w $f6, $f16 -/* 051E30 80051230 C62A0028 */ lwc1 $f10, 0x28($s1) -/* 051E34 80051234 C630002C */ lwc1 $f16, 0x2c($s1) -/* 051E38 80051238 26240004 */ addiu $a0, $s1, 4 -/* 051E3C 8005123C 262500BE */ addiu $a1, $s1, 0xbe -/* 051E40 80051240 46802220 */ cvt.s.w $f8, $f4 -/* 051E44 80051244 AFA50038 */ sw $a1, 0x38($sp) -/* 051E48 80051248 AFA4003C */ sw $a0, 0x3c($sp) -/* 051E4C 8005124C 8E260000 */ lw $a2, ($s1) -/* 051E50 80051250 46065480 */ add.s $f18, $f10, $f6 -/* 051E54 80051254 C6260030 */ lwc1 $f6, 0x30($s1) -/* 051E58 80051258 46088280 */ add.s $f10, $f16, $f8 -/* 051E5C 8005125C E6320004 */ swc1 $f18, 4($s1) -/* 051E60 80051260 E626000C */ swc1 $f6, 0xc($s1) -/* 051E64 80051264 0C010B80 */ jal rsp_set_matrix_transformation -/* 051E68 80051268 E62A0008 */ swc1 $f10, 8($s1) -/* 051E6C 8005126C 8FB800B8 */ lw $t8, 0xb8($sp) -/* 051E70 80051270 3C0E0600 */ lui $t6, 0x600 -/* 051E74 80051274 3C190600 */ lui $t9, 0x600 -/* 051E78 80051278 13000009 */ beqz $t8, .L800512A0 -/* 051E7C 8005127C 24050008 */ li $a1, 8 -/* 051E80 80051280 8E020000 */ lw $v0, ($s0) -/* 051E84 80051284 3C0F0D00 */ lui $t7, %hi(D_0D0069F8) # $t7, 0xd00 -/* 051E88 80051288 25EF69F8 */ addiu $t7, %lo(D_0D0069F8) # addiu $t7, $t7, 0x69f8 -/* 051E8C 8005128C 24590008 */ addiu $t9, $v0, 8 -/* 051E90 80051290 AE190000 */ sw $t9, ($s0) -/* 051E94 80051294 AC4F0004 */ sw $t7, 4($v0) -/* 051E98 80051298 10000008 */ b .L800512BC -/* 051E9C 8005129C AC4E0000 */ sw $t6, ($v0) -.L800512A0: -/* 051EA0 800512A0 8E020000 */ lw $v0, ($s0) -/* 051EA4 800512A4 3C0E0D00 */ lui $t6, %hi(D_0D0069E0) # $t6, 0xd00 -/* 051EA8 800512A8 25CE69E0 */ addiu $t6, %lo(D_0D0069E0) # addiu $t6, $t6, 0x69e0 -/* 051EAC 800512AC 24580008 */ addiu $t8, $v0, 8 -/* 051EB0 800512B0 AE180000 */ sw $t8, ($s0) -/* 051EB4 800512B4 AC4E0004 */ sw $t6, 4($v0) -/* 051EB8 800512B8 AC590000 */ sw $t9, ($v0) -.L800512BC: -/* 051EBC 800512BC 8E020000 */ lw $v0, ($s0) -/* 051EC0 800512C0 3C190D02 */ lui $t9, %hi(common_tlut_hud_type_C_rank_tiny_font) # $t9, 0xd02 -/* 051EC4 800512C4 27399E58 */ addiu $t9, %lo(common_tlut_hud_type_C_rank_tiny_font) # addiu $t9, $t9, -0x61a8 -/* 051EC8 800512C8 244F0008 */ addiu $t7, $v0, 8 -/* 051ECC 800512CC AE0F0000 */ sw $t7, ($s0) -/* 051ED0 800512D0 3C18FD10 */ lui $t8, 0xfd10 -/* 051ED4 800512D4 AC580000 */ sw $t8, ($v0) -/* 051ED8 800512D8 AC590004 */ sw $t9, 4($v0) -/* 051EDC 800512DC 8E020000 */ lw $v0, ($s0) -/* 051EE0 800512E0 3C0FE800 */ lui $t7, 0xe800 -/* 051EE4 800512E4 3C19F500 */ lui $t9, (0xF5000100 >> 16) # lui $t9, 0xf500 -/* 051EE8 800512E8 244E0008 */ addiu $t6, $v0, 8 -/* 051EEC 800512EC AE0E0000 */ sw $t6, ($s0) -/* 051EF0 800512F0 AC400004 */ sw $zero, 4($v0) -/* 051EF4 800512F4 AC4F0000 */ sw $t7, ($v0) -/* 051EF8 800512F8 8E020000 */ lw $v0, ($s0) -/* 051EFC 800512FC 3C0E0700 */ lui $t6, 0x700 -/* 051F00 80051300 37390100 */ ori $t9, (0xF5000100 & 0xFFFF) # ori $t9, $t9, 0x100 -/* 051F04 80051304 24580008 */ addiu $t8, $v0, 8 -/* 051F08 80051308 AE180000 */ sw $t8, ($s0) -/* 051F0C 8005130C AC4E0004 */ sw $t6, 4($v0) -/* 051F10 80051310 AC590000 */ sw $t9, ($v0) -/* 051F14 80051314 8E020000 */ lw $v0, ($s0) -/* 051F18 80051318 3C18E600 */ lui $t8, 0xe600 -/* 051F1C 8005131C 3C0EF000 */ lui $t6, 0xf000 -/* 051F20 80051320 244F0008 */ addiu $t7, $v0, 8 -/* 051F24 80051324 AE0F0000 */ sw $t7, ($s0) -/* 051F28 80051328 AC400004 */ sw $zero, 4($v0) -/* 051F2C 8005132C AC580000 */ sw $t8, ($v0) -/* 051F30 80051330 8E020000 */ lw $v0, ($s0) -/* 051F34 80051334 3C0F073F */ lui $t7, (0x073FC000 >> 16) # lui $t7, 0x73f -/* 051F38 80051338 35EFC000 */ ori $t7, (0x073FC000 & 0xFFFF) # ori $t7, $t7, 0xc000 -/* 051F3C 8005133C 24590008 */ addiu $t9, $v0, 8 -/* 051F40 80051340 AE190000 */ sw $t9, ($s0) -/* 051F44 80051344 AC4F0004 */ sw $t7, 4($v0) -/* 051F48 80051348 AC4E0000 */ sw $t6, ($v0) -/* 051F4C 8005134C 8E020000 */ lw $v0, ($s0) -/* 051F50 80051350 3C19E700 */ lui $t9, 0xe700 -/* 051F54 80051354 24060008 */ li $a2, 8 -/* 051F58 80051358 24580008 */ addiu $t8, $v0, 8 -/* 051F5C 8005135C AE180000 */ sw $t8, ($s0) -/* 051F60 80051360 AC400004 */ sw $zero, 4($v0) -/* 051F64 80051364 AC590000 */ sw $t9, ($v0) -/* 051F68 80051368 8FAE00DC */ lw $t6, 0xdc($sp) -/* 051F6C 8005136C 3C190D02 */ lui $t9, %hi(common_texture_hud_type_C_rank_tiny_font) # $t9, 0xd02 -/* 051F70 80051370 2739A058 */ addiu $t9, %lo(common_texture_hud_type_C_rank_tiny_font) # addiu $t9, $t9, -0x5fa8 -/* 051F74 80051374 000E7980 */ sll $t7, $t6, 6 -/* 051F78 80051378 25F80040 */ addiu $t8, $t7, 0x40 -/* 051F7C 8005137C 0C0114A9 */ jal rsp_load_texture -/* 051F80 80051380 03192021 */ addu $a0, $t8, $t9 -/* 051F84 80051384 8FAE00B8 */ lw $t6, 0xb8($sp) -/* 051F88 80051388 8FA400D0 */ lw $a0, 0xd0($sp) -/* 051F8C 8005138C 8FB900C4 */ lw $t9, 0xc4($sp) -/* 051F90 80051390 11C0000C */ beqz $t6, .L800513C4 -/* 051F94 80051394 2484001B */ addiu $a0, $a0, 0x1b -/* 051F98 80051398 8FAF00C4 */ lw $t7, 0xc4($sp) -/* 051F9C 8005139C 8FB800CC */ lw $t8, 0xcc($sp) -/* 051FA0 800513A0 8FA400D0 */ lw $a0, 0xd0($sp) -/* 051FA4 800513A4 00003025 */ move $a2, $zero -/* 051FA8 800513A8 01F82821 */ addu $a1, $t7, $t8 -/* 051FAC 800513AC 24A50004 */ addiu $a1, $a1, 4 -/* 051FB0 800513B0 3C073F80 */ lui $a3, 0x3f80 -/* 051FB4 800513B4 0C0108CC */ jal func_80042330 -/* 051FB8 800513B8 24840026 */ addiu $a0, $a0, 0x26 -/* 051FBC 800513BC 10000008 */ b .L800513E0 -/* 051FC0 800513C0 8E020000 */ lw $v0, ($s0) -.L800513C4: -/* 051FC4 800513C4 8FAE00CC */ lw $t6, 0xcc($sp) -/* 051FC8 800513C8 00003025 */ move $a2, $zero -/* 051FCC 800513CC 3C073F80 */ lui $a3, 0x3f80 -/* 051FD0 800513D0 032E2821 */ addu $a1, $t9, $t6 -/* 051FD4 800513D4 0C0108CC */ jal func_80042330 -/* 051FD8 800513D8 24A50004 */ addiu $a1, $a1, 4 -/* 051FDC 800513DC 8E020000 */ lw $v0, ($s0) -.L800513E0: -/* 051FE0 800513E0 3C190D00 */ lui $t9, %hi(D_0D006950) # $t9, 0xd00 -/* 051FE4 800513E4 27396950 */ addiu $t9, %lo(D_0D006950) # addiu $t9, $t9, 0x6950 -/* 051FE8 800513E8 244F0008 */ addiu $t7, $v0, 8 -/* 051FEC 800513EC AE0F0000 */ sw $t7, ($s0) -/* 051FF0 800513F0 3C180600 */ lui $t8, 0x600 -/* 051FF4 800513F4 AC580000 */ sw $t8, ($v0) -/* 051FF8 800513F8 AC590004 */ sw $t9, 4($v0) -/* 051FFC 800513FC 3C0F800E */ lui $t7, %hi(gPlayerOne) # $t7, 0x800e -/* 052000 80051400 8DEFC4DC */ lw $t7, %lo(gPlayerOne)($t7) -/* 052004 80051404 8FAE00AC */ lw $t6, 0xac($sp) -/* 052008 80051408 3C18800E */ lui $t8, %hi(gScreenModeSelection) # $t8, 0x800e -/* 05200C 8005140C 55CF0027 */ bnel $t6, $t7, .L800514AC -/* 052010 80051410 8FBF002C */ lw $ra, 0x2c($sp) -/* 052014 80051414 8F18C530 */ lw $t8, %lo(gScreenModeSelection)($t8) -/* 052018 80051418 3C0F0D00 */ lui $t7, %hi(D_0D007A40) # $t7, 0xd00 -/* 05201C 8005141C 25EF7A40 */ addiu $t7, %lo(D_0D007A40) # addiu $t7, $t7, 0x7a40 -/* 052020 80051420 17000021 */ bnez $t8, .L800514A8 -/* 052024 80051424 3C0E0600 */ lui $t6, 0x600 -/* 052028 80051428 8E020000 */ lw $v0, ($s0) -/* 05202C 8005142C 3C180D00 */ lui $t8, %hi(D_0D0069E0) # $t8, 0xd00 -/* 052030 80051430 271869E0 */ addiu $t8, %lo(D_0D0069E0) # addiu $t8, $t8, 0x69e0 -/* 052034 80051434 24590008 */ addiu $t9, $v0, 8 -/* 052038 80051438 AE190000 */ sw $t9, ($s0) -/* 05203C 8005143C AC4F0004 */ sw $t7, 4($v0) -/* 052040 80051440 AC4E0000 */ sw $t6, ($v0) -/* 052044 80051444 3C048019 */ lui $a0, %hi(D_8018D3E4) # $a0, 0x8019 -/* 052048 80051448 3C058019 */ lui $a1, %hi(D_8018D3E8) # $a1, 0x8019 -/* 05204C 8005144C 3C068019 */ lui $a2, %hi(D_8018D3EC) # $a2, 0x8019 -/* 052050 80051450 8CC6D3EC */ lw $a2, %lo(D_8018D3EC)($a2) -/* 052054 80051454 8CA5D3E8 */ lw $a1, %lo(D_8018D3E8)($a1) -/* 052058 80051458 8C84D3E4 */ lw $a0, %lo(D_8018D3E4)($a0) -/* 05205C 8005145C AFB80034 */ sw $t8, 0x34($sp) -/* 052060 80051460 0C012CD7 */ jal func_8004B35C -/* 052064 80051464 240700FF */ li $a3, 255 -/* 052068 80051468 3C040D02 */ lui $a0, %hi(common_texture_character_portrait_border) # $a0, 0xd02 -/* 05206C 8005146C 2484A2D8 */ addiu $a0, %lo(common_texture_character_portrait_border) # addiu $a0, $a0, -0x5d28 -/* 052070 80051470 24050020 */ li $a1, 32 -/* 052074 80051474 0C011249 */ jal func_80044924 -/* 052078 80051478 24060020 */ li $a2, 32 -/* 05207C 8005147C 8FA4003C */ lw $a0, 0x3c($sp) -/* 052080 80051480 8FA50038 */ lw $a1, 0x38($sp) -/* 052084 80051484 0C010B80 */ jal rsp_set_matrix_transformation -/* 052088 80051488 8E260000 */ lw $a2, ($s1) -/* 05208C 8005148C 8E020000 */ lw $v0, ($s0) -/* 052090 80051490 3C0E0600 */ lui $t6, 0x600 -/* 052094 80051494 24590008 */ addiu $t9, $v0, 8 -/* 052098 80051498 AE190000 */ sw $t9, ($s0) -/* 05209C 8005149C AC4E0000 */ sw $t6, ($v0) -/* 0520A0 800514A0 8FAF0034 */ lw $t7, 0x34($sp) -/* 0520A4 800514A4 AC4F0004 */ sw $t7, 4($v0) -.L800514A8: -/* 0520A8 800514A8 8FBF002C */ lw $ra, 0x2c($sp) -.L800514AC: -/* 0520AC 800514AC 8FB00024 */ lw $s0, 0x24($sp) -/* 0520B0 800514B0 8FB10028 */ lw $s1, 0x28($sp) -/* 0520B4 800514B4 03E00008 */ jr $ra -/* 0520B8 800514B8 27BD00D8 */ addiu $sp, $sp, 0xd8 diff --git a/asm/non_matchings/save/func_800B5218.s b/asm/non_matchings/save/func_800B5218.s deleted file mode 100644 index a1ab62bae3..0000000000 --- a/asm/non_matchings/save/func_800B5218.s +++ /dev/null @@ -1,92 +0,0 @@ -glabel func_800B5218 -/* 0B5E18 800B5218 3C0E8019 */ lui $t6, %hi(gCupSelection) # $t6, 0x8019 -/* 0B5E1C 800B521C 81CEEE09 */ lb $t6, %lo(gCupSelection)($t6) -/* 0B5E20 800B5220 3C188019 */ lui $t8, %hi(gCourseIndexInCup) # $t8, 0x8019 -/* 0B5E24 800B5224 8318EE0B */ lb $t8, %lo(gCourseIndexInCup)($t8) -/* 0B5E28 800B5228 3C09800F */ lui $t1, %hi(gCharacterSelections) # $t1, 0x800f -/* 0B5E2C 800B522C 812986A8 */ lb $t1, %lo(gCharacterSelections)($t1) -/* 0B5E30 800B5230 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0B5E34 800B5234 000E7880 */ sll $t7, $t6, 2 -/* 0B5E38 800B5238 3C058019 */ lui $a1, %hi(playerHUD+0x4) # $a1, 0x8019 -/* 0B5E3C 800B523C 3C068019 */ lui $a2, %hi(playerHUD) # $a2, 0x8019 -/* 0B5E40 800B5240 01F8C821 */ addu $t9, $t7, $t8 -/* 0B5E44 800B5244 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B5E48 800B5248 AFB90038 */ sw $t9, 0x38($sp) -/* 0B5E4C 800B524C 24070001 */ li $a3, 1 -/* 0B5E50 800B5250 24C6CA70 */ addiu $a2, %lo(playerHUD) # addiu $a2, $a2, -0x3590 -/* 0B5E54 800B5254 24A5CA74 */ addiu $a1, %lo(playerHUD+0x4) # addiu $a1, $a1, -0x358c -/* 0B5E58 800B5258 24020001 */ li $v0, 1 -/* 0B5E5C 800B525C 24080003 */ li $t0, 3 -/* 0B5E60 800B5260 AFA90028 */ sw $t1, 0x28($sp) -.L800B5264: -/* 0B5E64 800B5264 8CA30020 */ lw $v1, 0x20($a1) -/* 0B5E68 800B5268 8CC40020 */ lw $a0, 0x20($a2) -/* 0B5E6C 800B526C 240A0001 */ li $t2, 1 -/* 0B5E70 800B5270 00025880 */ sll $t3, $v0, 2 -/* 0B5E74 800B5274 0064082A */ slt $at, $v1, $a0 -/* 0B5E78 800B5278 10200005 */ beqz $at, .L800B5290 -/* 0B5E7C 800B527C 3C0C8019 */ lui $t4, %hi(playerHUD) # $t4, 0x8019 -/* 0B5E80 800B5280 258CCA70 */ addiu $t4, %lo(playerHUD) # addiu $t4, $t4, -0x3590 -/* 0B5E84 800B5284 004A3804 */ sllv $a3, $t2, $v0 -/* 0B5E88 800B5288 10000005 */ b .L800B52A0 -/* 0B5E8C 800B528C 016C3021 */ addu $a2, $t3, $t4 -.L800B5290: -/* 0B5E90 800B5290 14830003 */ bne $a0, $v1, .L800B52A0 -/* 0B5E94 800B5294 240D0001 */ li $t5, 1 -/* 0B5E98 800B5298 004D7004 */ sllv $t6, $t5, $v0 -/* 0B5E9C 800B529C 00EE3825 */ or $a3, $a3, $t6 -.L800B52A0: -/* 0B5EA0 800B52A0 24420001 */ addiu $v0, $v0, 1 -/* 0B5EA4 800B52A4 1448FFEF */ bne $v0, $t0, .L800B5264 -/* 0B5EA8 800B52A8 24A50004 */ addiu $a1, $a1, 4 -/* 0B5EAC 800B52AC AFA60018 */ sw $a2, 0x18($sp) -/* 0B5EB0 800B52B0 0C02D3CB */ jal func_800B4F2C -/* 0B5EB4 800B52B4 AFA70024 */ sw $a3, 0x24($sp) -/* 0B5EB8 800B52B8 8FA60018 */ lw $a2, 0x18($sp) -/* 0B5EBC 800B52BC 3C01000F */ lui $at, (0x000FFFFF >> 16) # lui $at, 0xf -/* 0B5EC0 800B52C0 3421FFFF */ ori $at, (0x000FFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0B5EC4 800B52C4 8CC50020 */ lw $a1, 0x20($a2) -/* 0B5EC8 800B52C8 00417824 */ and $t7, $v0, $at -/* 0B5ECC 800B52CC 8FA70024 */ lw $a3, 0x24($sp) -/* 0B5ED0 800B52D0 00AF082B */ sltu $at, $a1, $t7 -/* 0B5ED4 800B52D4 10200021 */ beqz $at, .L800B535C -/* 0B5ED8 800B52D8 00001025 */ move $v0, $zero -/* 0B5EDC 800B52DC 8FA30038 */ lw $v1, 0x38($sp) -/* 0B5EE0 800B52E0 3C0C8019 */ lui $t4, %hi(gSaveData) # $t4, 0x8019 -/* 0B5EE4 800B52E4 258CEB90 */ addiu $t4, %lo(gSaveData) # addiu $t4, $t4, -0x1470 -/* 0B5EE8 800B52E8 04610003 */ bgez $v1, .L800B52F8 -/* 0B5EEC 800B52EC 0003C083 */ sra $t8, $v1, 2 -/* 0B5EF0 800B52F0 24610003 */ addiu $at, $v1, 3 -/* 0B5EF4 800B52F4 0001C083 */ sra $t8, $at, 2 -.L800B52F8: -/* 0B5EF8 800B52F8 0018C880 */ sll $t9, $t8, 2 -/* 0B5EFC 800B52FC 0338C823 */ subu $t9, $t9, $t8 -/* 0B5F00 800B5300 0019C940 */ sll $t9, $t9, 5 -/* 0B5F04 800B5304 04610004 */ bgez $v1, .L800B5318 -/* 0B5F08 800B5308 30690003 */ andi $t1, $v1, 3 -/* 0B5F0C 800B530C 11200002 */ beqz $t1, .L800B5318 -/* 0B5F10 800B5310 00000000 */ nop -/* 0B5F14 800B5314 2529FFFC */ addiu $t1, -4 -.L800B5318: -/* 0B5F18 800B5318 00095080 */ sll $t2, $t1, 2 -/* 0B5F1C 800B531C 01495023 */ subu $t2, $t2, $t1 -/* 0B5F20 800B5320 000A50C0 */ sll $t2, $t2, 3 -/* 0B5F24 800B5324 032A5821 */ addu $t3, $t9, $t2 -/* 0B5F28 800B5328 016C1021 */ addu $v0, $t3, $t4 -/* 0B5F2C 800B532C 2444000F */ addiu $a0, $v0, 0xf -/* 0B5F30 800B5330 AFA20020 */ sw $v0, 0x20($sp) -/* 0B5F34 800B5334 8FA60028 */ lw $a2, 0x28($sp) -/* 0B5F38 800B5338 0C02D373 */ jal populate_time_trial_record -/* 0B5F3C 800B533C AFA70024 */ sw $a3, 0x24($sp) -/* 0B5F40 800B5340 8FA20020 */ lw $v0, 0x20($sp) -/* 0B5F44 800B5344 240D0001 */ li $t5, 1 -/* 0B5F48 800B5348 A04D0012 */ sb $t5, 0x12($v0) -/* 0B5F4C 800B534C 0C02D178 */ jal func_800B45E0 -/* 0B5F50 800B5350 8FA40038 */ lw $a0, 0x38($sp) -/* 0B5F54 800B5354 10000001 */ b .L800B535C -/* 0B5F58 800B5358 8FA20024 */ lw $v0, 0x24($sp) -.L800B535C: -/* 0B5F5C 800B535C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B5F60 800B5360 27BD0048 */ addiu $sp, $sp, 0x48 -/* 0B5F64 800B5364 03E00008 */ jr $ra -/* 0B5F68 800B5368 00000000 */ nop diff --git a/asm/non_matchings/save/func_800B578C.s b/asm/non_matchings/save/func_800B578C.s deleted file mode 100644 index 9e20727942..0000000000 --- a/asm/non_matchings/save/func_800B578C.s +++ /dev/null @@ -1,67 +0,0 @@ -glabel func_800B578C -/* 0B638C 800B578C 000470C0 */ sll $t6, $a0, 3 -/* 0B6390 800B5790 01C47023 */ subu $t6, $t6, $a0 -/* 0B6394 800B5794 000E70C0 */ sll $t6, $t6, 3 -/* 0B6398 800B5798 3C188019 */ lui $t8, %hi(gSaveData) # $t8, 0x8019 -/* 0B639C 800B579C 2718EB90 */ addiu $t8, %lo(gSaveData) # addiu $t8, $t8, -0x1470 -/* 0B63A0 800B57A0 25CF0188 */ addiu $t7, $t6, 0x188 -/* 0B63A4 800B57A4 01F83021 */ addu $a2, $t7, $t8 -/* 0B63A8 800B57A8 00001825 */ move $v1, $zero -/* 0B63AC 800B57AC 00C04025 */ move $t0, $a2 -/* 0B63B0 800B57B0 00001025 */ move $v0, $zero -/* 0B63B4 800B57B4 240A0003 */ li $t2, 3 -/* 0B63B8 800B57B8 24090011 */ li $t1, 17 -.L800B57BC: -/* 0B63BC 800B57BC 91190000 */ lbu $t9, ($t0) -/* 0B63C0 800B57C0 24450001 */ addiu $a1, $v0, 1 -/* 0B63C4 800B57C4 24C70001 */ addiu $a3, $a2, 1 -/* 0B63C8 800B57C8 272B0001 */ addiu $t3, $t9, 1 -/* 0B63CC 800B57CC 01650019 */ multu $t3, $a1 -/* 0B63D0 800B57D0 24C60011 */ addiu $a2, $a2, 0x11 -/* 0B63D4 800B57D4 00A01025 */ move $v0, $a1 -/* 0B63D8 800B57D8 24040001 */ li $a0, 1 -/* 0B63DC 800B57DC 00006012 */ mflo $t4 -/* 0B63E0 800B57E0 006C1821 */ addu $v1, $v1, $t4 -/* 0B63E4 800B57E4 00000000 */ nop -.L800B57E8: -/* 0B63E8 800B57E8 90ED0000 */ lbu $t5, ($a3) -/* 0B63EC 800B57EC 90F90001 */ lbu $t9, 1($a3) -/* 0B63F0 800B57F0 24E70004 */ addiu $a3, $a3, 4 -/* 0B63F4 800B57F4 25AE0001 */ addiu $t6, $t5, 1 -/* 0B63F8 800B57F8 01C50019 */ multu $t6, $a1 -/* 0B63FC 800B57FC 272B0001 */ addiu $t3, $t9, 1 -/* 0B6400 800B5800 90EEFFFE */ lbu $t6, -2($a3) -/* 0B6404 800B5804 00007812 */ mflo $t7 -/* 0B6408 800B5808 006FC021 */ addu $t8, $v1, $t7 -/* 0B640C 800B580C 25CF0001 */ addiu $t7, $t6, 1 -/* 0B6410 800B5810 01650019 */ multu $t3, $a1 -/* 0B6414 800B5814 90EBFFFF */ lbu $t3, -1($a3) -/* 0B6418 800B5818 03041821 */ addu $v1, $t8, $a0 -/* 0B641C 800B581C 00006012 */ mflo $t4 -/* 0B6420 800B5820 006C6821 */ addu $t5, $v1, $t4 -/* 0B6424 800B5824 256C0001 */ addiu $t4, $t3, 1 -/* 0B6428 800B5828 01E50019 */ multu $t7, $a1 -/* 0B642C 800B582C 01A41821 */ addu $v1, $t5, $a0 -/* 0B6430 800B5830 24630001 */ addiu $v1, $v1, 1 -/* 0B6434 800B5834 0000C012 */ mflo $t8 -/* 0B6438 800B5838 0078C821 */ addu $t9, $v1, $t8 -/* 0B643C 800B583C 03241821 */ addu $v1, $t9, $a0 -/* 0B6440 800B5840 01850019 */ multu $t4, $a1 -/* 0B6444 800B5844 24630002 */ addiu $v1, $v1, 2 -/* 0B6448 800B5848 00006812 */ mflo $t5 -/* 0B644C 800B584C 006D7021 */ addu $t6, $v1, $t5 -/* 0B6450 800B5850 01C41821 */ addu $v1, $t6, $a0 -/* 0B6454 800B5854 24840004 */ addiu $a0, $a0, 4 -/* 0B6458 800B5858 1489FFE3 */ bne $a0, $t1, .L800B57E8 -/* 0B645C 800B585C 24630003 */ addiu $v1, $v1, 3 -/* 0B6460 800B5860 14AAFFD6 */ bne $a1, $t2, .L800B57BC -/* 0B6464 800B5864 25080011 */ addiu $t0, $t0, 0x11 -/* 0B6468 800B5868 04610004 */ bgez $v1, .L800B587C -/* 0B646C 800B586C 306200FF */ andi $v0, $v1, 0xff -/* 0B6470 800B5870 10400002 */ beqz $v0, .L800B587C -/* 0B6474 800B5874 00000000 */ nop -/* 0B6478 800B5878 2442FF00 */ addiu $v0, $v0, -0x100 -.L800B587C: -/* 0B647C 800B587C 304F00FF */ andi $t7, $v0, 0xff -/* 0B6480 800B5880 03E00008 */ jr $ra -/* 0B6484 800B5884 01E01025 */ move $v0, $t7 diff --git a/asm/non_matchings/save/func_800B68F4.s b/asm/non_matchings/save/func_800B68F4.s deleted file mode 100644 index f4fb102716..0000000000 --- a/asm/non_matchings/save/func_800B68F4.s +++ /dev/null @@ -1,52 +0,0 @@ -glabel func_800B68F4 -/* 0B74F4 800B68F4 3C028019 */ lui $v0, %hi(D_8018D9C0) # $v0, 0x8019 -/* 0B74F8 800B68F8 8C42D9C0 */ lw $v0, %lo(D_8018D9C0)($v0) -/* 0B74FC 800B68FC 000471C0 */ sll $t6, $a0, 7 -/* 0B7500 800B6900 24870001 */ addiu $a3, $a0, 1 -/* 0B7504 800B6904 01C21821 */ addu $v1, $t6, $v0 -/* 0B7508 800B6908 906F0000 */ lbu $t7, ($v1) -/* 0B750C 800B690C 90780001 */ lbu $t8, 1($v1) -/* 0B7510 800B6910 90690002 */ lbu $t1, 2($v1) -/* 0B7514 800B6914 01E70019 */ multu $t7, $a3 -/* 0B7518 800B6918 24040043 */ li $a0, 67 -/* 0B751C 800B691C 24060003 */ li $a2, 3 -/* 0B7520 800B6920 00002812 */ mflo $a1 -/* 0B7524 800B6924 00000000 */ nop -/* 0B7528 800B6928 00000000 */ nop -/* 0B752C 800B692C 03070019 */ multu $t8, $a3 -/* 0B7530 800B6930 0000C812 */ mflo $t9 -/* 0B7534 800B6934 00B92821 */ addu $a1, $a1, $t9 -/* 0B7538 800B6938 24A50001 */ addiu $a1, $a1, 1 -/* 0B753C 800B693C 01270019 */ multu $t1, $a3 -/* 0B7540 800B6940 00005012 */ mflo $t2 -/* 0B7544 800B6944 00AA2821 */ addu $a1, $a1, $t2 -/* 0B7548 800B6948 24A50002 */ addiu $a1, $a1, 2 -.L800B694C: -/* 0B754C 800B694C 00661021 */ addu $v0, $v1, $a2 -/* 0B7550 800B6950 904B0000 */ lbu $t3, ($v0) -/* 0B7554 800B6954 904E0001 */ lbu $t6, 1($v0) -/* 0B7558 800B6958 90590002 */ lbu $t9, 2($v0) -/* 0B755C 800B695C 01670019 */ multu $t3, $a3 -/* 0B7560 800B6960 904B0003 */ lbu $t3, 3($v0) -/* 0B7564 800B6964 00006012 */ mflo $t4 -/* 0B7568 800B6968 01866821 */ addu $t5, $t4, $a2 -/* 0B756C 800B696C 00AD2821 */ addu $a1, $a1, $t5 -/* 0B7570 800B6970 01C70019 */ multu $t6, $a3 -/* 0B7574 800B6974 00007812 */ mflo $t7 -/* 0B7578 800B6978 01E6C021 */ addu $t8, $t7, $a2 -/* 0B757C 800B697C 00B82821 */ addu $a1, $a1, $t8 -/* 0B7580 800B6980 03270019 */ multu $t9, $a3 -/* 0B7584 800B6984 24A50001 */ addiu $a1, $a1, 1 -/* 0B7588 800B6988 00004812 */ mflo $t1 -/* 0B758C 800B698C 01265021 */ addu $t2, $t1, $a2 -/* 0B7590 800B6990 00AA2821 */ addu $a1, $a1, $t2 -/* 0B7594 800B6994 01670019 */ multu $t3, $a3 -/* 0B7598 800B6998 24A50002 */ addiu $a1, $a1, 2 -/* 0B759C 800B699C 00006012 */ mflo $t4 -/* 0B75A0 800B69A0 01866821 */ addu $t5, $t4, $a2 -/* 0B75A4 800B69A4 00AD2821 */ addu $a1, $a1, $t5 -/* 0B75A8 800B69A8 24C60004 */ addiu $a2, $a2, 4 -/* 0B75AC 800B69AC 14C4FFE7 */ bne $a2, $a0, .L800B694C -/* 0B75B0 800B69B0 24A50003 */ addiu $a1, $a1, 3 -/* 0B75B4 800B69B4 03E00008 */ jr $ra -/* 0B75B8 800B69B8 30A200FF */ andi $v0, $a1, 0xff diff --git a/asm/non_matchings/update_objects/func_80080E8C.s b/asm/non_matchings/update_objects/func_80080E8C.s deleted file mode 100644 index 71e239f337..0000000000 --- a/asm/non_matchings/update_objects/func_80080E8C.s +++ /dev/null @@ -1,99 +0,0 @@ -.section .late_rodata - -glabel D_800EF0B8 -.double 0.6 - -glabel D_800EF0C0 -.double 0.6 - -.section .text - -glabel func_80080E8C -/* 081A8C 80080E8C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 081A90 80080E90 AFBF001C */ sw $ra, 0x1c($sp) -/* 081A94 80080E94 AFA50044 */ sw $a1, 0x44($sp) -/* 081A98 80080E98 AFB10018 */ sw $s1, 0x18($sp) -/* 081A9C 80080E9C AFB00014 */ sw $s0, 0x14($sp) -/* 081AA0 80080EA0 AFA40040 */ sw $a0, 0x40($sp) -/* 081AA4 80080EA4 AFA60048 */ sw $a2, 0x48($sp) -/* 081AA8 80080EA8 0C01C8E9 */ jal init_object -/* 081AAC 80080EAC 00C02825 */ move $a1, $a2 -/* 081AB0 80080EB0 8FAE0040 */ lw $t6, 0x40($sp) -/* 081AB4 80080EB4 240700E0 */ li $a3, 224 -/* 081AB8 80080EB8 8FB90044 */ lw $t9, 0x44($sp) -/* 081ABC 80080EBC 01C70019 */ multu $t6, $a3 -/* 081AC0 80080EC0 8FA40048 */ lw $a0, 0x48($sp) -/* 081AC4 80080EC4 3C058016 */ lui $a1, %hi(gObjectList) # $a1, 0x8016 -/* 081AC8 80080EC8 24A55C18 */ addiu $a1, %lo(gObjectList) # addiu $a1, $a1, 0x5c18 -/* 081ACC 80080ECC 24180002 */ li $t8, 2 -/* 081AD0 80080ED0 3C0B800E */ lui $t3, %hi(D_800E594C) # $t3, 0x800e -/* 081AD4 80080ED4 00044840 */ sll $t1, $a0, 1 -/* 081AD8 80080ED8 00095080 */ sll $t2, $t1, 2 -/* 081ADC 80080EDC 256B594C */ addiu $t3, %lo(D_800E594C) # addiu $t3, $t3, 0x594c -/* 081AE0 80080EE0 014B1821 */ addu $v1, $t2, $t3 -/* 081AE4 80080EE4 00007812 */ mflo $t7 -/* 081AE8 80080EE8 00AF8021 */ addu $s0, $a1, $t7 -/* 081AEC 80080EEC A21800D5 */ sb $t8, 0xd5($s0) -/* 081AF0 80080EF0 03270019 */ multu $t9, $a3 -/* 081AF4 80080EF4 C46C0004 */ lwc1 $f12, 4($v1) -/* 081AF8 80080EF8 C46E0000 */ lwc1 $f14, ($v1) -/* 081AFC 80080EFC AFA30024 */ sw $v1, 0x24($sp) -/* 081B00 80080F00 01202025 */ move $a0, $t1 -/* 081B04 80080F04 AFA90028 */ sw $t1, 0x28($sp) -/* 081B08 80080F08 00004012 */ mflo $t0 -/* 081B0C 80080F0C 00A81021 */ addu $v0, $a1, $t0 -/* 081B10 80080F10 945100C0 */ lhu $s1, 0xc0($v0) -/* 081B14 80080F14 AFA2002C */ sw $v0, 0x2c($sp) -/* 081B18 80080F18 0C0105B6 */ jal func_800416D8 -/* 081B1C 80080F1C 02203025 */ move $a2, $s1 -/* 081B20 80080F20 8FA30024 */ lw $v1, 0x24($sp) -/* 081B24 80080F24 E7A00038 */ swc1 $f0, 0x38($sp) -/* 081B28 80080F28 3226FFFF */ andi $a2, $s1, 0xffff -/* 081B2C 80080F2C C46C0004 */ lwc1 $f12, 4($v1) -/* 081B30 80080F30 0C0105C9 */ jal func_80041724 -/* 081B34 80080F34 C46E0000 */ lwc1 $f14, ($v1) -/* 081B38 80080F38 8FA2002C */ lw $v0, 0x2c($sp) -/* 081B3C 80080F3C 3C014022 */ li $at, 0x40220000 # 2.531250 -/* 081B40 80080F40 44818800 */ mtc1 $at, $f17 -/* 081B44 80080F44 C4440004 */ lwc1 $f4, 4($v0) -/* 081B48 80080F48 44808000 */ mtc1 $zero, $f16 -/* 081B4C 80080F4C 8FAC0028 */ lw $t4, 0x28($sp) -/* 081B50 80080F50 46002180 */ add.s $f6, $f4, $f0 -/* 081B54 80080F54 3C0D800E */ lui $t5, %hi(D_800E597C) # 0x800e -/* 081B58 80080F58 01AC6821 */ addu $t5, $t5, $t4 -/* 081B5C 80080F5C E6060010 */ swc1 $f6, 0x10($s0) -/* 081B60 80080F60 C4480044 */ lwc1 $f8, 0x44($v0) -/* 081B64 80080F64 460042A1 */ cvt.d.s $f10, $f8 -/* 081B68 80080F68 C7A80038 */ lwc1 $f8, 0x38($sp) -/* 081B6C 80080F6C 46305481 */ sub.d $f18, $f10, $f16 -/* 081B70 80080F70 46209120 */ cvt.s.d $f4, $f18 -/* 081B74 80080F74 E6040014 */ swc1 $f4, 0x14($s0) -/* 081B78 80080F78 C446000C */ lwc1 $f6, 0xc($v0) -/* 081B7C 80080F7C 46083280 */ add.s $f10, $f6, $f8 -/* 081B80 80080F80 E60A0018 */ swc1 $f10, 0x18($s0) -/* 081B84 80080F84 85AD597C */ lh $t5, %lo(D_800E597C)($t5) # 0x597c($t5) -/* 081B88 80080F88 944E00C0 */ lhu $t6, 0xc0($v0) -/* 081B8C 80080F8C 01AE8821 */ addu $s1, $t5, $t6 -/* 081B90 80080F90 322FFFFF */ andi $t7, $s1, 0xffff -/* 081B94 80080F94 01E08825 */ move $s1, $t7 -/* 081B98 80080F98 0C0AE006 */ jal sins -/* 081B9C 80080F9C 31E4FFFF */ andi $a0, $t7, 0xffff -/* 081BA0 80080FA0 3C01800F */ lui $at, %hi(D_800EF0B8) -/* 081BA4 80080FA4 D432F0B8 */ ldc1 $f18, %lo(D_800EF0B8)($at) -/* 081BA8 80080FA8 46000421 */ cvt.d.s $f16, $f0 -/* 081BAC 80080FAC 3224FFFF */ andi $a0, $s1, 0xffff -/* 081BB0 80080FB0 46328102 */ mul.d $f4, $f16, $f18 -/* 081BB4 80080FB4 462021A0 */ cvt.s.d $f6, $f4 -/* 081BB8 80080FB8 0C0AE00E */ jal coss -/* 081BBC 80080FBC E6060038 */ swc1 $f6, 0x38($s0) -/* 081BC0 80080FC0 3C01800F */ lui $at, %hi(D_800EF0C0) -/* 081BC4 80080FC4 D42AF0C0 */ ldc1 $f10, %lo(D_800EF0C0)($at) -/* 081BC8 80080FC8 46000221 */ cvt.d.s $f8, $f0 -/* 081BCC 80080FCC 8FBF001C */ lw $ra, 0x1c($sp) -/* 081BD0 80080FD0 462A4402 */ mul.d $f16, $f8, $f10 -/* 081BD4 80080FD4 8FB10018 */ lw $s1, 0x18($sp) -/* 081BD8 80080FD8 462084A0 */ cvt.s.d $f18, $f16 -/* 081BDC 80080FDC E6120040 */ swc1 $f18, 0x40($s0) -/* 081BE0 80080FE0 8FB00014 */ lw $s0, 0x14($sp) -/* 081BE4 80080FE4 03E00008 */ jr $ra -/* 081BE8 80080FE8 27BD0040 */ addiu $sp, $sp, 0x40 diff --git a/asm/non_matchings/update_objects/func_80082F1C.s b/asm/non_matchings/update_objects/func_80082F1C.s deleted file mode 100644 index bc5df84bf6..0000000000 --- a/asm/non_matchings/update_objects/func_80082F1C.s +++ /dev/null @@ -1,71 +0,0 @@ -.section .late_rodata - -glabel D_800EF1BC -.float 0.027 - -.section .text - -glabel func_80082F1C -/* 083B1C 80082F1C 000470C0 */ sll $t6, $a0, 3 -/* 083B20 80082F20 01C47023 */ subu $t6, $t6, $a0 -/* 083B24 80082F24 3C0F8016 */ lui $t7, %hi(gObjectList) # $t7, 0x8016 -/* 083B28 80082F28 25EF5C18 */ addiu $t7, %lo(gObjectList) # addiu $t7, $t7, 0x5c18 -/* 083B2C 80082F2C 000E7140 */ sll $t6, $t6, 5 -/* 083B30 80082F30 01CF1021 */ addu $v0, $t6, $t7 -/* 083B34 80082F34 3C180601 */ lui $t8, %hi(d_course_yoshi_valley_unk5) # $t8, 0x601 -/* 083B38 80082F38 3C190601 */ lui $t9, %hi(d_course_yoshi_valley_unk4) # $t9, 0x601 -/* 083B3C 80082F3C 27184798 */ addiu $t8, %lo(d_course_yoshi_valley_unk5) # addiu $t8, $t8, 0x4798 -/* 083B40 80082F40 27394794 */ addiu $t9, %lo(d_course_yoshi_valley_unk4) # addiu $t9, $t9, 0x4794 -/* 083B44 80082F44 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 083B48 80082F48 AC580070 */ sw $t8, 0x70($v0) -/* 083B4C 80082F4C AC590074 */ sw $t9, 0x74($v0) -/* 083B50 80082F50 3C01800F */ lui $at, %hi(D_800EF1BC) # $at, 0x800f -/* 083B54 80082F54 C424F1BC */ lwc1 $f4, %lo(D_800EF1BC)($at) -/* 083B58 80082F58 AFBF001C */ sw $ra, 0x1c($sp) -/* 083B5C 80082F5C AFB00018 */ sw $s0, 0x18($sp) -/* 083B60 80082F60 00808025 */ move $s0, $a0 -/* 083B64 80082F64 AFA5002C */ sw $a1, 0x2c($sp) -/* 083B68 80082F68 0C01C922 */ jal object_next_state -/* 083B6C 80082F6C E4440000 */ swc1 $f4, ($v0) -/* 083B70 80082F70 8FA9002C */ lw $t1, 0x2c($sp) -/* 083B74 80082F74 3C0B800E */ lui $t3, %hi(D_800E5DF4) # $t3, 0x800e -/* 083B78 80082F78 256B5DF4 */ addiu $t3, %lo(D_800E5DF4) # addiu $t3, $t3, 0x5df4 -/* 083B7C 80082F7C 000950C0 */ sll $t2, $t1, 3 -/* 083B80 80082F80 014B1021 */ addu $v0, $t2, $t3 -/* 083B84 80082F84 844C0000 */ lh $t4, ($v0) -/* 083B88 80082F88 844D0002 */ lh $t5, 2($v0) -/* 083B8C 80082F8C 844E0004 */ lh $t6, 4($v0) -/* 083B90 80082F90 448C3000 */ mtc1 $t4, $f6 -/* 083B94 80082F94 3C018019 */ lui $at, %hi(xOrientation) # $at, 0x8019 -/* 083B98 80082F98 C42AD01C */ lwc1 $f10, %lo(xOrientation)($at) -/* 083B9C 80082F9C 46803220 */ cvt.s.w $f8, $f6 -/* 083BA0 80082FA0 448D9000 */ mtc1 $t5, $f18 -/* 083BA4 80082FA4 448E2000 */ mtc1 $t6, $f4 -/* 083BA8 80082FA8 AFA20024 */ sw $v0, 0x24($sp) -/* 083BAC 80082FAC 02002025 */ move $a0, $s0 -/* 083BB0 80082FB0 468094A0 */ cvt.s.w $f18, $f18 -/* 083BB4 80082FB4 460A4402 */ mul.s $f16, $f8, $f10 -/* 083BB8 80082FB8 44069000 */ mfc1 $a2, $f18 -/* 083BBC 80082FBC 46802120 */ cvt.s.w $f4, $f4 -/* 083BC0 80082FC0 44058000 */ mfc1 $a1, $f16 -/* 083BC4 80082FC4 44072000 */ mfc1 $a3, $f4 -/* 083BC8 80082FC8 0C022DF5 */ jal set_obj_origin_pos -/* 083BCC 80082FCC 00000000 */ nop -/* 083BD0 80082FD0 44800000 */ mtc1 $zero, $f0 -/* 083BD4 80082FD4 02002025 */ move $a0, $s0 -/* 083BD8 80082FD8 44050000 */ mfc1 $a1, $f0 -/* 083BDC 80082FDC 44060000 */ mfc1 $a2, $f0 -/* 083BE0 80082FE0 44070000 */ mfc1 $a3, $f0 -/* 083BE4 80082FE4 0C022E03 */ jal set_obj_origin_offset -/* 083BE8 80082FE8 00000000 */ nop -/* 083BEC 80082FEC 8FA20024 */ lw $v0, 0x24($sp) -/* 083BF0 80082FF0 02002025 */ move $a0, $s0 -/* 083BF4 80082FF4 00002825 */ move $a1, $zero -/* 083BF8 80082FF8 00003825 */ move $a3, $zero -/* 083BFC 80082FFC 0C022E22 */ jal set_obj_direction_angle -/* 083C00 80083000 94460006 */ lhu $a2, 6($v0) -/* 083C04 80083004 8FBF001C */ lw $ra, 0x1c($sp) -/* 083C08 80083008 8FB00018 */ lw $s0, 0x18($sp) -/* 083C0C 8008300C 27BD0028 */ addiu $sp, $sp, 0x28 -/* 083C10 80083010 03E00008 */ jr $ra -/* 083C14 80083014 00000000 */ nop diff --git a/asm/non_matchings/update_objects/func_80086074.s b/asm/non_matchings/update_objects/func_80086074.s deleted file mode 100644 index 9a424518af..0000000000 --- a/asm/non_matchings/update_objects/func_80086074.s +++ /dev/null @@ -1,40 +0,0 @@ -glabel func_80086074 -/* 086C74 80086074 00057880 */ sll $t7, $a1, 2 -/* 086C78 80086078 01E57823 */ subu $t7, $t7, $a1 -/* 086C7C 8008607C 3C19800E */ lui $t9, %hi(D_800E6734) # $t9, 0x800e -/* 086C80 80086080 27396734 */ addiu $t9, %lo(D_800E6734) # addiu $t9, $t9, 0x6734 -/* 086C84 80086084 000FC080 */ sll $t8, $t7, 2 -/* 086C88 80086088 03191021 */ addu $v0, $t8, $t9 -/* 086C8C 8008608C 3C018019 */ lui $at, %hi(xOrientation) # $at, 0x8019 -/* 086C90 80086090 C426D01C */ lwc1 $f6, %lo(xOrientation)($at) -/* 086C94 80086094 C4440000 */ lwc1 $f4, ($v0) -/* 086C98 80086098 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 086C9C 8008609C AFA50024 */ sw $a1, 0x24($sp) -/* 086CA0 800860A0 46062202 */ mul.s $f8, $f4, $f6 -/* 086CA4 800860A4 AFBF001C */ sw $ra, 0x1c($sp) -/* 086CA8 800860A8 AFA40020 */ sw $a0, 0x20($sp) -/* 086CAC 800860AC 8C460004 */ lw $a2, 4($v0) -/* 086CB0 800860B0 8C470008 */ lw $a3, 8($v0) -/* 086CB4 800860B4 44054000 */ mfc1 $a1, $f8 -/* 086CB8 800860B8 0C022DF5 */ jal set_obj_origin_pos -/* 086CBC 800860BC 00000000 */ nop -/* 086CC0 800860C0 8FA80024 */ lw $t0, 0x24($sp) -/* 086CC4 800860C4 3C0A0600 */ lui $t2, %hi(d_course_rainbow_road_static_tluts) # $t2, 0x600 -/* 086CC8 800860C8 3C0C0601 */ lui $t4, %hi(d_course_rainbow_road_static_textures) # $t4, 0x601 -/* 086CCC 800860CC 258CB000 */ addiu $t4, %lo(d_course_rainbow_road_static_textures) # addiu $t4, $t4, -0x5000 -/* 086CD0 800860D0 254A7200 */ addiu $t2, %lo(d_course_rainbow_road_static_tluts) # addiu $t2, $t2, 0x7200 -/* 086CD4 800860D4 240D0040 */ li $t5, 64 -/* 086CD8 800860D8 00084A40 */ sll $t1, $t0, 9 -/* 086CDC 800860DC 00085B00 */ sll $t3, $t0, 0xc -/* 086CE0 800860E0 016C3021 */ addu $a2, $t3, $t4 -/* 086CE4 800860E4 012A2821 */ addu $a1, $t1, $t2 -/* 086CE8 800860E8 AFAD0010 */ sw $t5, 0x10($sp) -/* 086CEC 800860EC 8FA40020 */ lw $a0, 0x20($sp) -/* 086CF0 800860F0 0C01CD11 */ jal init_texture_object -/* 086CF4 800860F4 24070040 */ li $a3, 64 -/* 086CF8 800860F8 0C0216ED */ jal func_80085BB4 -/* 086CFC 800860FC 8FA40020 */ lw $a0, 0x20($sp) -/* 086D00 80086100 8FBF001C */ lw $ra, 0x1c($sp) -/* 086D04 80086104 27BD0020 */ addiu $sp, $sp, 0x20 -/* 086D08 80086108 03E00008 */ jr $ra -/* 086D0C 8008610C 00000000 */ nop diff --git a/asm/rom_header.s b/asm/rom_header.s index 3fa4df3d1f..119f217f32 100644 --- a/asm/rom_header.s +++ b/asm/rom_header.s @@ -27,7 +27,7 @@ .ascii "E" /* NTSC-U (North America) */ .endif -.ifdef VERSION_EU_1_1 +.ifdef VERSION_EU_V11 .byte 0x01 /* Version */ .else .byte 0x00 /* Version */ diff --git a/assets.json b/assets.json index 8cfe7ce9fd..2d02e2ac74 100644 --- a/assets.json +++ b/assets.json @@ -59,8 +59,8 @@ "bin/lib/PR/f3d/F3DEX_data.bin": {"meta":{"size": "0x800"}, "offsets": {"us":["0x0F4900", "0x0"]}}, "bin/lib/PR/f3d/F3DLX_data.bin": {"meta":{"size": "0x800"}, "offsets": {"us":["0x0F5100", "0x0"]}}, "bin/lib/PR/audio/aspMain_data.bin": {"meta":{"size": "0x300"}, "offsets": {"us":["0x0F5900", "0x0"]}}, -"bin/audiobanks.us.bin": {"meta":{"size": "0x13840"}, "offsets":{"us":["0x966260","0x0"],"eu-final":["0x966380","0x0"]}}, -"bin/audiobanks.eu.bin": {"meta":{"size": "0x13840"}, "offsets":{"eu-1.0":["0x966460","0x0"]}}, +"bin/audiobanks.us.bin": {"meta":{"size": "0x13840"}, "offsets":{"us":["0x966260","0x0"],"eu.v11":["0x966380","0x0"]}}, +"bin/audiobanks.eu.bin": {"meta":{"size": "0x13840"}, "offsets":{"eu.v10":["0x966460","0x0"]}}, "bin/audiotables.bin": {"meta":{"size": "0x24C4C0"}, "offsets":{"us":["0x979AA0","0x0"]}}, "music/00_seq_00.m64": {"meta":{"size":"0x2830"}, "offsets": {"us":["0xBC6060", "0x0"]}}, @@ -94,48 +94,48 @@ "music/28_staff_roll.m64": {"meta":{"size":"0x2750"}, "offsets": {"us":["0xBE5D00", "0x0"]}}, "music/29_award_ceremony_4th_8th.m64": {"meta":{"size":"0x0C80"}, "offsets": {"us":["0xBE8450", "0x0"]}}, -"music/eu/00_seq_00.m64": {"meta":{"size":"0x2910"}, "offsets": {"eu-1.0":["0xBC6260", "0x0"],"eu-final":["0xBC6180", "0x0"]}}, -"music/eu/01_title_screen.m64": {"meta":{"size":"0x1B30"}, "offsets": {"eu-1.0":["0xBC8B70", "0x0"],"eu-final":["0xBC8A90", "0x0"]}}, -"music/eu/02_main_menu.m64": {"meta":{"size":"0x0D60"}, "offsets": {"eu-1.0":["0xBCA6A0", "0x0"],"eu-final":["0xBCA5C0", "0x0"]}}, -"music/eu/03_racways_wario_stadium.m64": {"meta":{"size":"0x1A10"}, "offsets": {"eu-1.0":["0xBCB400", "0x0"],"eu-final":["0xBCB320", "0x0"]}}, -"music/eu/04_moo_moo_fame_yoshi_valley.m64": {"meta":{"size":"0x1CA0"}, "offsets": {"eu-1.0":["0xBCCE10", "0x0"],"eu-final":["0xBCCC30", "0x0"]}}, -"music/eu/05_choco_mountain.m64": {"meta":{"size":"0x1F70"}, "offsets": {"eu-1.0":["0xBCEAB0", "0x0"],"eu-final":["0xBCE9D0", "0x0"]}}, -"music/eu/06_koopa_troopa_beach.m64": {"meta":{"size":"0x1EE0"}, "offsets": {"eu-1.0":["0xBD0A20", "0x0"],"eu-final":["0xBD0920", "0x0"]}}, -"music/eu/07_banshee_boardwalk.m64": {"meta":{"size":"0x16D0"}, "offsets": {"eu-1.0":["0xBD2900", "0x0"],"eu-final":["0xBD2800", "0x0"]}}, -"music/eu/08_seq_08.m64": {"meta":{"size":"0x23D0"}, "offsets": {"eu-1.0":["0xBD3FD0", "0x0"],"eu-final":["0xBD3E50", "0x0"]}}, -"music/eu/09_seq_09.m64": {"meta":{"size":"0x1800"}, "offsets": {"eu-1.0":["0xBD63A0", "0x0"],"eu-final":["0xBD6230", "0x0"]}}, -"music/eu/10_kalimari_desert.m64": {"meta":{"size":"0x1AE0"}, "offsets": {"eu-1.0":["0xBD7BA0", "0x0"],"eu-final":["0xBD7A20", "0x0"]}}, -"music/eu/11_start_grid_gp_vs.m64": {"meta":{"size":"0x05F0"}, "offsets": {"eu-1.0":["0xBD9680", "0x0"],"eu-final":["0xBD9500", "0x0"]}}, -"music/eu/12_final_lap_fanfare.m64": {"meta":{"size":"0x03D0"}, "offsets": {"eu-1.0":["0xBD9C70", "0x0"],"eu-final":["0xBD9AF0", "0x0"]}}, -"music/eu/13_finish_1st_place.m64": {"meta":{"size":"0x0360"}, "offsets": {"eu-1.0":["0xBDA040", "0x0"],"eu-final":["0xBD9DC0", "0x0"]}}, -"music/eu/14_finish_2nd_4th_place.m64": {"meta":{"size":"0x02E0"}, "offsets": {"eu-1.0":["0xBDA3A0", "0x0"],"eu-final":["0xBDA140", "0x0"]}}, -"music/eu/15_finish_5th_8th_place.m64": {"meta":{"size":"0x04C0"}, "offsets": {"eu-1.0":["0xBDA680", "0x0"],"eu-final":["0xBDA400", "0x0"]}}, -"music/eu/16_seq_10.m64": {"meta":{"size":"0x1410"}, "offsets": {"eu-1.0":["0xBDAB40", "0x0"],"eu-final":["0xBDAA60", "0x0"]}}, -"music/eu/17_star_jingle.m64": {"meta":{"size":"0x06E0"}, "offsets": {"eu-1.0":["0xBDBF50", "0x0"],"eu-final":["0xBDBE70", "0x0"]}}, -"music/eu/18_rainbow_road.m64": {"meta":{"size":"0x32F0"}, "offsets": {"eu-1.0":["0xBDC630", "0x0"],"eu-final":["0xBDC4D0", "0x0"]}}, -"music/eu/19_maybe_boo_item.m64": {"meta":{"size":"0x06C0"}, "offsets": {"eu-1.0":["0xBDF920", "0x0"],"eu-final":["0xBDF840", "0x0"]}}, -"music/eu/20_game_over.m64": {"meta":{"size":"0x04B0"}, "offsets": {"eu-1.0":["0xBDFFE0", "0x0"],"eu-final":["0xBDFF00", "0x0"]}}, -"music/eu/21_toads_turnpike.m64": {"meta":{"size":"0x1160"}, "offsets": {"eu-1.0":["0xBE0490", "0x0"],"eu-final":["0xBE0380", "0x0"]}}, -"music/eu/22_start_gird_time_attack.m64": {"meta":{"size":"0x0310"}, "offsets": {"eu-1.0":["0xBE15F0", "0x0"],"eu-final":["0xBE1500", "0x0"]}}, -"music/eu/23_vs_battle_results.m64": {"meta":{"size":"0x12B0"}, "offsets": {"eu-1.0":["0xBE1900", "0x0"],"eu-final":["0xBE17D0", "0x0"]}}, -"music/eu/24_losing_results.m64": {"meta":{"size":"0x0600"}, "offsets": {"eu-1.0":["0xBE2BB0", "0x0"],"eu-final":["0xBE2A90", "0x0"]}}, -"music/eu/25_battle_arenas.m64": {"meta":{"size":"0x16E0"}, "offsets": {"eu-1.0":["0xBE31B0", "0x0"],"eu-final":["0xBE30B0", "0x0"]}}, -"music/eu/26_award_ceremony_buildup.m64": {"meta":{"size":"0x0AD0"}, "offsets": {"eu-1.0":["0xBE4890", "0x0"],"eu-final":["0xBE4780", "0x0"]}}, -"music/eu/27_award_ceremony_1st_3rd.m64": {"meta":{"size":"0x0C80"}, "offsets": {"eu-1.0":["0xBE5360", "0x0"],"eu-final":["0xBE5260", "0x0"]}}, -"music/eu/28_staff_roll.m64": {"meta":{"size":"0x2750"}, "offsets": {"eu-1.0":["0xBE5FE0", "0x0"],"eu-final":["0xBE5EA0", "0x0"]}}, -"music/eu/29_award_ceremony_4th_8th.m64": {"meta":{"size":"0x0C80"}, "offsets": {"eu-1.0":["0xBE8730", "0x0"],"eu-final":["0xBE8680", "0x0"]}}, +"music/eu/00_seq_00.m64": {"meta":{"size":"0x2910"}, "offsets": {"eu.v10":["0xBC6260", "0x0"],"eu.v11":["0xBC6180", "0x0"]}}, +"music/eu/01_title_screen.m64": {"meta":{"size":"0x1B30"}, "offsets": {"eu.v10":["0xBC8B70", "0x0"],"eu.v11":["0xBC8A90", "0x0"]}}, +"music/eu/02_main_menu.m64": {"meta":{"size":"0x0D60"}, "offsets": {"eu.v10":["0xBCA6A0", "0x0"],"eu.v11":["0xBCA5C0", "0x0"]}}, +"music/eu/03_racways_wario_stadium.m64": {"meta":{"size":"0x1A10"}, "offsets": {"eu.v10":["0xBCB400", "0x0"],"eu.v11":["0xBCB320", "0x0"]}}, +"music/eu/04_moo_moo_fame_yoshi_valley.m64": {"meta":{"size":"0x1CA0"}, "offsets": {"eu.v10":["0xBCCE10", "0x0"],"eu.v11":["0xBCCD30", "0x0"]}}, +"music/eu/05_choco_mountain.m64": {"meta":{"size":"0x1F70"}, "offsets": {"eu.v10":["0xBCEAB0", "0x0"],"eu.v11":["0xBCE9D0", "0x0"]}}, +"music/eu/06_koopa_troopa_beach.m64": {"meta":{"size":"0x1EE0"}, "offsets": {"eu.v10":["0xBD0A20", "0x0"],"eu.v11":["0xBD0940", "0x0"]}}, +"music/eu/07_banshee_boardwalk.m64": {"meta":{"size":"0x16D0"}, "offsets": {"eu.v10":["0xBD2900", "0x0"],"eu.v11":["0xBD2820", "0x0"]}}, +"music/eu/08_seq_08.m64": {"meta":{"size":"0x23D0"}, "offsets": {"eu.v10":["0xBD3FD0", "0x0"],"eu.v11":["0xBD3EF0", "0x0"]}}, +"music/eu/09_seq_09.m64": {"meta":{"size":"0x1800"}, "offsets": {"eu.v10":["0xBD63A0", "0x0"],"eu.v11":["0xBD62C0", "0x0"]}}, +"music/eu/10_kalimari_desert.m64": {"meta":{"size":"0x1AE0"}, "offsets": {"eu.v10":["0xBD7BA0", "0x0"],"eu.v11":["0xBD7AC0", "0x0"]}}, +"music/eu/11_start_grid_gp_vs.m64": {"meta":{"size":"0x05F0"}, "offsets": {"eu.v10":["0xBD9680", "0x0"],"eu.v11":["0xBD95A0", "0x0"]}}, +"music/eu/12_final_lap_fanfare.m64": {"meta":{"size":"0x03D0"}, "offsets": {"eu.v10":["0xBD9C70", "0x0"],"eu.v11":["0xBD9B90", "0x0"]}}, +"music/eu/13_finish_1st_place.m64": {"meta":{"size":"0x0360"}, "offsets": {"eu.v10":["0xBDA040", "0x0"],"eu.v11":["0xBD9F60", "0x0"]}}, +"music/eu/14_finish_2nd_4th_place.m64": {"meta":{"size":"0x02E0"}, "offsets": {"eu.v10":["0xBDA3A0", "0x0"],"eu.v11":["0xBDA2C0", "0x0"]}}, +"music/eu/15_finish_5th_8th_place.m64": {"meta":{"size":"0x04C0"}, "offsets": {"eu.v10":["0xBDA680", "0x0"],"eu.v11":["0xBDA5A0", "0x0"]}}, +"music/eu/16_seq_10.m64": {"meta":{"size":"0x1410"}, "offsets": {"eu.v10":["0xBDAB40", "0x0"],"eu.v11":["0xBDAA60", "0x0"]}}, +"music/eu/17_star_jingle.m64": {"meta":{"size":"0x06E0"}, "offsets": {"eu.v10":["0xBDBF50", "0x0"],"eu.v11":["0xBDBE70", "0x0"]}}, +"music/eu/18_rainbow_road.m64": {"meta":{"size":"0x32F0"}, "offsets": {"eu.v10":["0xBDC630", "0x0"],"eu.v11":["0xBDC550", "0x0"]}}, +"music/eu/19_maybe_boo_item.m64": {"meta":{"size":"0x06C0"}, "offsets": {"eu.v10":["0xBDF920", "0x0"],"eu.v11":["0xBDF840", "0x0"]}}, +"music/eu/20_game_over.m64": {"meta":{"size":"0x04B0"}, "offsets": {"eu.v10":["0xBDFFE0", "0x0"],"eu.v11":["0xBDFF00", "0x0"]}}, +"music/eu/21_toads_turnpike.m64": {"meta":{"size":"0x1160"}, "offsets": {"eu.v10":["0xBE0490", "0x0"],"eu.v11":["0xBE03B0", "0x0"]}}, +"music/eu/22_start_gird_time_attack.m64": {"meta":{"size":"0x0310"}, "offsets": {"eu.v10":["0xBE15F0", "0x0"],"eu.v11":["0xBE1510", "0x0"]}}, +"music/eu/23_vs_battle_results.m64": {"meta":{"size":"0x12B0"}, "offsets": {"eu.v10":["0xBE1900", "0x0"],"eu.v11":["0xBE1820", "0x0"]}}, +"music/eu/24_losing_results.m64": {"meta":{"size":"0x0600"}, "offsets": {"eu.v10":["0xBE2BB0", "0x0"],"eu.v11":["0xBE2AD0", "0x0"]}}, +"music/eu/25_battle_arenas.m64": {"meta":{"size":"0x16E0"}, "offsets": {"eu.v10":["0xBE31B0", "0x0"],"eu.v11":["0xBE30D0", "0x0"]}}, +"music/eu/26_award_ceremony_buildup.m64": {"meta":{"size":"0x0AD0"}, "offsets": {"eu.v10":["0xBE4890", "0x0"],"eu.v11":["0xBE47B0", "0x0"]}}, +"music/eu/27_award_ceremony_1st_3rd.m64": {"meta":{"size":"0x0C80"}, "offsets": {"eu.v10":["0xBE5360", "0x0"],"eu.v11":["0xBE5280", "0x0"]}}, +"music/eu/28_staff_roll.m64": {"meta":{"size":"0x2750"}, "offsets": {"eu.v10":["0xBE5FE0", "0x0"],"eu.v11":["0xBE5F00", "0x0"]}}, +"music/eu/29_award_ceremony_4th_8th.m64": {"meta":{"size":"0x0C80"}, "offsets": {"eu.v10":["0xBE8730", "0x0"],"eu.v11":["0xBE8650", "0x0"]}}, -"bin/gTexturePlayerSelect.rgba16.tkmk00": {"meta":{"size":"0xC00"}, "offsets": {"us":["0x7FA3C0", "0x0"]}}, -"bin/gTextureOption.rgba16.tkmk00": {"meta":{"size":"0x900"}, "offsets": {"us":["0x7FAFC0", "0x0"]}}, +"bin/texture_player_select.rgba16.tkmk00": {"meta":{"size":"0xC00"}, "offsets": {"us":["0x7FA3C0", "0x0"]}}, +"bin/texture_option.rgba16.tkmk00": {"meta":{"size":"0x900"}, "offsets": {"us":["0x7FAFC0", "0x0"]}}, -"bin/gTextureNameDK.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FB8C0", "0x0"]}}, -"bin/gTextureNameToad.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FBAC0", "0x0"]}}, -"bin/gTextureNameBowser.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FBCC0", "0x0"]}}, -"bin/gTextureNameLuigi.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FBEC0", "0x0"]}}, -"bin/gTextureNameMario.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC0C0", "0x0"]}}, -"bin/gTextureNamePeach.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC2C0", "0x0"]}}, -"bin/gTextureNameWario.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC4C0", "0x0"]}}, -"bin/gTextureNameYoshi.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC6C0", "0x0"]}}, +"bin/texture_name_dk.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FB8C0", "0x0"]}}, +"bin/texture_name_toad.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FBAC0", "0x0"]}}, +"bin/texture_name_bowser.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FBCC0", "0x0"]}}, +"bin/texture_name_luigi.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FBEC0", "0x0"]}}, +"bin/texture_name_mario.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC0C0", "0x0"]}}, +"bin/texture_name_peach.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC2C0", "0x0"]}}, +"bin/texture_name_wario.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC4C0", "0x0"]}}, +"bin/texture_name_yoshi.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x7FC6C0", "0x0"]}}, "bin/gTextureTitleMarioRaceway.rgba16.tkmk00": {"meta":{"size":"0x500"}, "offsets": {"us":["0x7FC8C0", "0x0"]}}, "bin/gTextureTitleChocoMountain.rgba16.tkmk00": {"meta":{"size":"0x500"}, "offsets": {"us":["0x7FCDC0", "0x0"]}}, @@ -165,34 +165,34 @@ "bin/gTextureMenuStarCup.rgba16.tkmk00": {"meta":{"size":"0x400"}, "offsets": {"us":["0x8035C0", "0x0"]}}, "bin/gTextureMenuSpecialCup.rgba16.tkmk00": {"meta":{"size":"0x400"}, "offsets": {"us":["0x8039C0", "0x0"]}}, -"bin/gTextureGameSelect.rgba16.tkmk00": {"meta":{"size":"0xC00"}, "offsets": {"us":["0x803DC0", "0x0"]}}, +"bin/texture_game_select.rgba16.tkmk00": {"meta":{"size":"0xC00"}, "offsets": {"us":["0x803DC0", "0x0"]}}, -"bin/gTextureMenu1PGame.rgba16.tkmk00": {"meta":{"size":"0x500"}, "offsets": {"us":["0x8049C0", "0x0"]}}, -"bin/gTextureMenu2PGame.rgba16.tkmk00": {"meta":{"size":"0x700"}, "offsets": {"us":["0x804EC0", "0x0"]}}, -"bin/gTextureMenu3PGame.rgba16.tkmk00": {"meta":{"size":"0xA00"}, "offsets": {"us":["0x8055C0", "0x0"]}}, -"bin/gTextureMenu4PGame.rgba16.tkmk00": {"meta":{"size":"0xB00"}, "offsets": {"us":["0x805FC0", "0x0"]}}, +"bin/texture_menu_1p_game.rgba16.tkmk00": {"meta":{"size":"0x500"}, "offsets": {"us":["0x8049C0", "0x0"]}}, +"bin/texture_menu_2p_game.rgba16.tkmk00": {"meta":{"size":"0x700"}, "offsets": {"us":["0x804EC0", "0x0"]}}, +"bin/texture_menu_3p_game.rgba16.tkmk00": {"meta":{"size":"0xA00"}, "offsets": {"us":["0x8055C0", "0x0"]}}, +"bin/texture_menu_4p_game.rgba16.tkmk00": {"meta":{"size":"0xB00"}, "offsets": {"us":["0x805FC0", "0x0"]}}, -"bin/gTextureMenuModeBattle.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x806AC0", "0x0"]}}, -"bin/gTextureMenuModeTimeTrials.rgba16.tkmk00": {"meta":{"size":"0x400"}, "offsets": {"us":["0x806DC0", "0x0"]}}, -"bin/gTextureMenuModeMarioGP.rgba16.tkmk00": {"meta":{"size":"0x400"}, "offsets": {"us":["0x8071C0", "0x0"]}}, -"bin/gTextureMenuModeVS.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x8075C0", "0x0"]}}, +"bin/texture_mode_battle.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x806AC0", "0x0"]}}, +"bin/texture_mode_time_trials.rgba16.tkmk00": {"meta":{"size":"0x400"}, "offsets": {"us":["0x806DC0", "0x0"]}}, +"bin/texture_mode_mario_gp.rgba16.tkmk00": {"meta":{"size":"0x400"}, "offsets": {"us":["0x8071C0", "0x0"]}}, +"bin/texture_mode_vs.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x8075C0", "0x0"]}}, -"bin/gTextureMenuLOption.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x8078C0", "0x0"]}}, -"bin/gTextureMenuRData.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x807BC0", "0x0"]}}, +"bin/texture_l_option.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x8078C0", "0x0"]}}, +"bin/texture_r_data.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x807BC0", "0x0"]}}, -"bin/gTextureMenu50cc.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x807EC0", "0x0"]}}, -"bin/gTextureMenu100cc.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8080C0", "0x0"]}}, -"bin/gTextureMenu150cc.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8082C0", "0x0"]}}, -"bin/gTextureMenuExtra.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8084C0", "0x0"]}}, +"bin/texture_50cc.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x807EC0", "0x0"]}}, +"bin/texture_100cc.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8080C0", "0x0"]}}, +"bin/texture_150cc.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8082C0", "0x0"]}}, +"bin/texture_extra.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8084C0", "0x0"]}}, "bin/gTextureMenuWithoutItem.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x8086C0", "0x0"]}}, "bin/gTextureMenuWithItem.rgba16.tkmk00": {"meta":{"size":"0x300"}, "offsets": {"us":["0x8089C0", "0x0"]}}, -"bin/gTextureMenuBegin.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x808CC0", "0x0"]}}, -"bin/gTextureMenuGhost.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x808EC0", "0x0"]}}, -"bin/gTextureMenuData.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8090C0", "0x0"]}}, -"bin/gTextureMenuOK.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8092C0", "0x0"]}}, +"bin/texture_begin.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x808CC0", "0x0"]}}, +"bin/texture_menu_ghost.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x808EC0", "0x0"]}}, +"bin/texture_data.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8090C0", "0x0"]}}, +"bin/texture_ok.rgba16.tkmk00": {"meta":{"size":"0x200"}, "offsets": {"us":["0x8092C0", "0x0"]}}, -"bin/gTextureBackgroundBlueSky.rgba16.tkmk00": {"meta":{"size":"0xCE00"}, "offsets": {"us":["0x8094C0", "0x0"]}}, -"bin/gTextureBackgroundSunset.rgba16.tkmk00": {"meta":{"size":"0x9400"}, "offsets": {"us":["0x8162C0", "0x0"]}}, +"bin/background_blue_sky.rgba16.tkmk00": {"meta":{"size":"0xCE00"}, "offsets": {"us":["0x8094C0", "0x0"]}}, +"bin/background_sunset.rgba16.tkmk00": {"meta":{"size":"0x9400"}, "offsets": {"us":["0x8162C0", "0x0"]}}, "bin/gTextureGreenGoldStripe.rgba16.tkmk00": {"meta":{"size":"0xC00"}, "offsets": {"us":["0x81F6C0", "0x0"]}}, "bin/gTextureGoldStripe.rgba16.tkmk00": {"meta":{"size":"0x700"}, "offsets": {"us":["0x8202C0", "0x0"]}}, @@ -539,7 +539,7 @@ "textures/standalone/kart_shadow.i8.png": {"meta":{"dims":[64,64]}, "offsets": {"us":["0x69A830", "0x00000"]}}, "textures/standalone/texture_69B03C.i8.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x69B03C", "0x00000"]}}, "textures/standalone/texture_69B140.i8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69B140", "0x00000"]}}, -"textures/standalone/texture_69B378.rgba16.png": {"meta":{"dims":[32,64]}, "offsets": {"us":["0x69B378", "0x00000"]}}, +"textures/standalone/gGrassParticle.rgba16.png": {"meta":{"dims":[32,64]}, "offsets": {"us":["0x69B378", "0x00000"]}}, "textures/standalone/texture_69B960.i8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69B960", "0x00000"]}}, "textures/standalone/texture_69BA28.i8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69BA28", "0x00000"]}}, "textures/standalone/boing_exclamation.ia8.png": {"meta":{"dims":[64,32]}, "offsets": {"us":["0x69BB18", "0x00000"]}}, @@ -548,7 +548,7 @@ "textures/standalone/texture_69C090.ia16.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x69C090", "0x00000"]}}, "textures/standalone/texture_69C1E8.ia16.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x69C1E8", "0x00000"]}}, "textures/standalone/texture_69C354.ia8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69C354", "0x00000"]}}, -"textures/standalone/texture_69C4E4.i8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69C4E4", "0x00000"]}}, +"textures/standalone/gGroundDust.i8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69C4E4", "0x00000"]}}, "textures/standalone/texture_69C80C.ia8.png": {"meta":{"dims":[32,32]}, "offsets": {"us":["0x69C80C", "0x00000"]}}, "textures/standalone/texture_69C9C4.ia16.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x69C9C4", "0x00000"]}}, "textures/standalone/texture_69CB84.i4.png": {"meta":{"dims":[64,64]}, "offsets": {"us":["0x69CB84", "0x00000"]}}, @@ -665,7 +665,7 @@ "textures/standalone/tiny_font_plus.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEAC8", "0x00000"]}}, "textures/standalone/texture_7EEB18.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEB18", "0x00000"]}}, "textures/standalone/tiny_font_minus.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEB48", "0x00000"]}}, -"textures/standalone/tiny_font_comma.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEB7C", "0x00000"]}}, +"textures/standalone/tiny_font_dot.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEB7C", "0x00000"]}}, "textures/standalone/tiny_font_forward_slash.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEBAC", "0x00000"]}}, "textures/standalone/tiny_font_colon.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEBFC", "0x00000"]}}, "textures/standalone/texture_7EEC34.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7EEC34", "0x00000"]}}, @@ -754,51 +754,51 @@ "textures/standalone/texture_7F0FD8.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7F0FD8", "0x00000"]}}, "textures/standalone/texture_7F1038.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7F1038", "0x00000"]}}, "textures/standalone/texture_7F109C.ia16.png": {"meta":{"dims":[8,8]}, "offsets": {"us":["0x7F109C", "0x00000"]}}, -"textures/raw/7F1124.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1124", "0x0"]}}, -"textures/raw/7F11F4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F11F4", "0x0"]}}, -"textures/raw/7F12C4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F12C4", "0x0"]}}, -"textures/raw/7F1394.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1394", "0x0"]}}, -"textures/raw/7F1464.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1464", "0x0"]}}, -"textures/raw/7F1534.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1534", "0x0"]}}, -"textures/raw/7F1604.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1604", "0x0"]}}, -"textures/raw/7F16D4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F16D4", "0x0"]}}, -"textures/raw/7F17A4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F17A4", "0x0"]}}, -"textures/raw/7F1874.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1874", "0x0"]}}, -"textures/raw/7F1944.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1944", "0x0"]}}, -"textures/raw/7F1A14.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1A14", "0x0"]}}, -"textures/raw/7F1AE4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1AE4", "0x0"]}}, -"textures/raw/7F1BB4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1BB4", "0x0"]}}, -"textures/raw/7F1C84.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1C84", "0x0"]}}, -"textures/raw/7F1D54.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1D54", "0x0"]}}, -"textures/raw/7F1E24.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1E24", "0x0"]}}, -"textures/raw/7F1EF4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1EF4", "0x0"]}}, -"textures/raw/7F1FC4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1FC4", "0x0"]}}, -"textures/raw/7F2094.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2094", "0x0"]}}, -"textures/raw/7F2164.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2164", "0x0"]}}, -"textures/raw/7F2234.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2234", "0x0"]}}, -"textures/raw/7F2304.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2304", "0x0"]}}, -"textures/raw/7F23D4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F23D4", "0x0"]}}, -"textures/raw/7F24A4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F24A4", "0x0"]}}, -"textures/raw/7F2574.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2574", "0x0"]}}, -"textures/raw/7F2644.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2644", "0x0"]}}, -"textures/raw/7F2714.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2714", "0x0"]}}, -"textures/raw/7F27E4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F27E4", "0x0"]}}, -"textures/raw/7F28B4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F28B4", "0x0"]}}, -"textures/raw/7F2984.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2984", "0x0"]}}, -"textures/raw/7F2A54.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2A54", "0x0"]}}, -"textures/raw/7F2B24.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2B24", "0x0"]}}, -"textures/raw/7F2BF4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2BF4", "0x0"]}}, -"textures/raw/7F2CC4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2CC4", "0x0"]}}, -"textures/raw/7F2D94.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2D94", "0x0"]}}, -"textures/raw/7F2E64.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2E64", "0x0"]}}, -"textures/raw/7F2F34.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2F34", "0x0"]}}, -"textures/raw/7F3004.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3004", "0x0"]}}, -"textures/raw/7F30D4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F30D4", "0x0"]}}, -"textures/raw/7F31A4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F31A4", "0x0"]}}, -"textures/raw/7F3274.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3274", "0x0"]}}, -"textures/raw/7F3344.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3344", "0x0"]}}, -"textures/raw/7F3414.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3414", "0x0"]}}, -"textures/raw/7F34E4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F34E4", "0x0"]}}, +"textures/raw/font_four_dote.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1124", "0x0"]}}, +"textures/raw/font_cc.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F11F4", "0x0"]}}, +"textures/raw/font_double_quote.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F12C4", "0x0"]}}, +"textures/raw/font_exclamation_mark.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1394", "0x0"]}}, +"textures/raw/font_minus.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1464", "0x0"]}}, +"textures/raw/font_dot.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1534", "0x0"]}}, +"textures/raw/font_plus.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1604", "0x0"]}}, +"textures/raw/font_interogation_mark.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F16D4", "0x0"]}}, +"textures/raw/font_simple_quote.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F17A4", "0x0"]}}, +"textures/raw/font_number_zero.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1874", "0x0"]}}, +"textures/raw/font_number_one.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1944", "0x0"]}}, +"textures/raw/font_number_two.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1A14", "0x0"]}}, +"textures/raw/font_number_three.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1AE4", "0x0"]}}, +"textures/raw/font_number_four.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1BB4", "0x0"]}}, +"textures/raw/font_number_five.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1C84", "0x0"]}}, +"textures/raw/font_number_six.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1D54", "0x0"]}}, +"textures/raw/font_number_seven.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1E24", "0x0"]}}, +"textures/raw/font_number_eight.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1EF4", "0x0"]}}, +"textures/raw/font_number_nine.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1FC4", "0x0"]}}, +"textures/raw/font_letter_A.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2094", "0x0"]}}, +"textures/raw/font_letter_B.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2164", "0x0"]}}, +"textures/raw/font_letter_C.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2234", "0x0"]}}, +"textures/raw/font_letter_D.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2304", "0x0"]}}, +"textures/raw/font_letter_E.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F23D4", "0x0"]}}, +"textures/raw/font_letter_F.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F24A4", "0x0"]}}, +"textures/raw/font_letter_G.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2574", "0x0"]}}, +"textures/raw/font_letter_H.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2644", "0x0"]}}, +"textures/raw/font_letter_I.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2714", "0x0"]}}, +"textures/raw/font_letter_J.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F27E4", "0x0"]}}, +"textures/raw/font_letter_K.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F28B4", "0x0"]}}, +"textures/raw/font_letter_L.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2984", "0x0"]}}, +"textures/raw/font_letter_M.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2A54", "0x0"]}}, +"textures/raw/font_letter_N.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2B24", "0x0"]}}, +"textures/raw/font_letter_O.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2BF4", "0x0"]}}, +"textures/raw/font_letter_P.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2CC4", "0x0"]}}, +"textures/raw/font_letter_Q.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2D94", "0x0"]}}, +"textures/raw/font_letter_R.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2E64", "0x0"]}}, +"textures/raw/font_letter_S.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F2F34", "0x0"]}}, +"textures/raw/font_letter_T.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3004", "0x0"]}}, +"textures/raw/font_letter_U.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F30D4", "0x0"]}}, +"textures/raw/font_letter_V.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F31A4", "0x0"]}}, +"textures/raw/font_letter_W.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3274", "0x0"]}}, +"textures/raw/font_letter_X.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3344", "0x0"]}}, +"textures/raw/font_letter_Y.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F3414", "0x0"]}}, +"textures/raw/font_letter_Z.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F34E4", "0x0"]}}, "textures/raw/7F35B4.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7F35B4", "0x0"]}}, "textures/raw/7F3634.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7F3634", "0x0"]}}, "textures/raw/7F36B4.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7F36B4", "0x0"]}}, @@ -984,23 +984,23 @@ "textures/raw/7F9EC4.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7F9EC4", "0x0"]}}, "textures/raw/7F9F44.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7F9F44", "0x0"]}}, "textures/raw/7F9FC4.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7F9FC4", "0x0"]}}, -"textures/raw/7FA044.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7FA044", "0x0"]}}, +"textures/raw/font_apostrophe.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7FA044", "0x0"]}}, "textures/raw/7FA0C4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7FA0C4", "0x0"]}}, "textures/raw/7FA194.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7FA194", "0x0"]}}, "textures/raw/7FA264.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7FA264", "0x0"]}}, -"textures/raw/7FA334.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7FA334", "0x0"]}}, +"textures/raw/font_comma.i4.png": {"meta":{"dims":[16,16]}, "offsets": {"us":["0x7FA334", "0x0"]}}, -"textures/gTexturePlayerSelect.rgba16.png": {"meta":{"dims":[220,32], "alpha":"0x01"}, "offsets": {"us":["0x7FA3C0", "0x0"]}}, -"textures/gTextureOption.rgba16.png": {"meta":{"dims":[130,32], "alpha":"0x01"}, "offsets": {"us":["0x7FAFC0", "0x0"]}}, +"textures/texture_player_select.rgba16.png": {"meta":{"dims":[220,32], "alpha":"0x01"}, "offsets": {"us":["0x7FA3C0", "0x0"]}}, +"textures/texture_option.rgba16.png": {"meta":{"dims":[130,32], "alpha":"0x01"}, "offsets": {"us":["0x7FAFC0", "0x0"]}}, -"textures/gTextureNameDK.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FB8C0", "0x0"]}}, -"textures/gTextureNameToad.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FBAC0", "0x0"]}}, -"textures/gTextureNameBowser.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FBCC0", "0x0"]}}, -"textures/gTextureNameLuigi.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FBEC0", "0x0"]}}, -"textures/gTextureNameMario.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC0C0", "0x0"]}}, -"textures/gTextureNamePeach.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC2C0", "0x0"]}}, -"textures/gTextureNameWario.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC4C0", "0x0"]}}, -"textures/gTextureNameYoshi.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC6C0", "0x0"]}}, +"textures/texture_name_dk.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FB8C0", "0x0"]}}, +"textures/texture_name_toad.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FBAC0", "0x0"]}}, +"textures/texture_name_bowser.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FBCC0", "0x0"]}}, +"textures/texture_name_luigi.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FBEC0", "0x0"]}}, +"textures/texture_name_mario.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC0C0", "0x0"]}}, +"textures/texture_name_peach.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC2C0", "0x0"]}}, +"textures/texture_name_wario.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC4C0", "0x0"]}}, +"textures/texture_name_yoshi.rgba16.png": {"meta":{"dims":[64,12], "alpha":"0x01"}, "offsets": {"us":["0x7FC6C0", "0x0"]}}, "textures/gTextureTitleMarioRaceway.rgba16.png": {"meta":{"dims":[140,18], "alpha":"0xBE"}, "offsets": {"us":["0x7FC8C0", "0x0"]}}, "textures/gTextureTitleChocoMountain.rgba16.png": {"meta":{"dims":[140,18], "alpha":"0xBE"}, "offsets": {"us":["0x7FCDC0", "0x0"]}}, @@ -1030,35 +1030,35 @@ "textures/gTextureMenuStarCup.rgba16.png": {"meta":{"dims":[65,40], "alpha":"0xBE"}, "offsets": {"us":["0x8035C0", "0x0"]}}, "textures/gTextureMenuSpecialCup.rgba16.png": {"meta":{"dims":[65,40], "alpha":"0xBE"}, "offsets": {"us":["0x8039C0", "0x0"]}}, -"textures/gTextureGameSelect.rgba16.png": {"meta":{"dims":[200,32], "alpha":"0x01"}, "offsets": {"us":["0x803DC0", "0x0"]}}, +"textures/texture_game_select.rgba16.png": {"meta":{"dims":[200,32], "alpha":"0x01"}, "offsets": {"us":["0x803DC0", "0x0"]}}, -"textures/gTextureMenu1PGame.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x8049C0", "0x0"]}}, -"textures/gTextureMenu2PGame.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x804EC0", "0x0"]}}, -"textures/gTextureMenu3PGame.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x8055C0", "0x0"]}}, -"textures/gTextureMenu4PGame.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x805FC0", "0x0"]}}, +"textures/texture_menu_1p_game.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x8049C0", "0x0"]}}, +"textures/texture_menu_2p_game.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x804EC0", "0x0"]}}, +"textures/texture_menu_3p_game.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x8055C0", "0x0"]}}, +"textures/texture_menu_4p_game.rgba16.png": {"meta":{"dims":[64,54], "alpha":"0xBE"}, "offsets": {"us":["0x805FC0", "0x0"]}}, -"textures/gTextureMenuModeBattle.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x806AC0", "0x0"]}}, -"textures/gTextureMenuModeTimeTrials.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x806DC0", "0x0"]}}, -"textures/gTextureMenuModeMarioGP.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8071C0", "0x0"]}}, -"textures/gTextureMenuModeVS.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8075C0", "0x0"]}}, +"textures/texture_mode_battle.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x806AC0", "0x0"]}}, +"textures/texture_mode_time_trials.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x806DC0", "0x0"]}}, +"textures/texture_mode_mario_gp.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8071C0", "0x0"]}}, +"textures/texture_mode_vs.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8075C0", "0x0"]}}, -"textures/gTextureMenuLOption.rgba16.png": {"meta":{"dims":[58,19], "alpha":"0xBE"}, "offsets": {"us":["0x8078C0", "0x0"]}}, -"textures/gTextureMenuRData.rgba16.png": {"meta":{"dims":[58,19], "alpha":"0xBE"}, "offsets": {"us":["0x807BC0", "0x0"]}}, +"textures/texture_l_option.rgba16.png": {"meta":{"dims":[58,19], "alpha":"0xBE"}, "offsets": {"us":["0x8078C0", "0x0"]}}, +"textures/texture_r_data.rgba16.png": {"meta":{"dims":[58,19], "alpha":"0xBE"}, "offsets": {"us":["0x807BC0", "0x0"]}}, -"textures/gTextureMenu50cc.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x807EC0", "0x0"]}}, -"textures/gTextureMenu100cc.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8080C0", "0x0"]}}, -"textures/gTextureMenu150cc.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8082C0", "0x0"]}}, -"textures/gTextureMenuExtra.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8084C0", "0x0"]}}, +"textures/texture_50cc.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x807EC0", "0x0"]}}, +"textures/texture_100cc.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8080C0", "0x0"]}}, +"textures/texture_150cc.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8082C0", "0x0"]}}, +"textures/texture_extra.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8084C0", "0x0"]}}, "textures/gTextureMenuWithoutItem.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8086C0", "0x0"]}}, "textures/gTextureMenuWithItem.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8089C0", "0x0"]}}, -"textures/gTextureMenuBegin.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x808CC0", "0x0"]}}, -"textures/gTextureMenuGhost.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x808EC0", "0x0"]}}, -"textures/gTextureMenuData.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8090C0", "0x0"]}}, -"textures/gTextureMenuOK.rgba16.png": {"meta":{"dims":[31,19], "alpha":"0xBE"}, "offsets": {"us":["0x8092C0", "0x0"]}}, +"textures/texture_begin.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x808CC0", "0x0"]}}, +"textures/texture_menu_ghost.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x808EC0", "0x0"]}}, +"textures/texture_data.rgba16.png": {"meta":{"dims":[64,18], "alpha":"0xBE"}, "offsets": {"us":["0x8090C0", "0x0"]}}, +"textures/texture_ok.rgba16.png": {"meta":{"dims":[31,19], "alpha":"0xBE"}, "offsets": {"us":["0x8092C0", "0x0"]}}, -"textures/gTextureBackgroundBlueSky.rgba16.png": {"meta":{"dims":[320,240], "alpha":"0x01"}, "offsets": {"us":["0x8094C0", "0x0"]}}, -"textures/gTextureBackgroundSunset.rgba16.png": {"meta":{"dims":[320,240], "alpha":"0x01"}, "offsets": {"us":["0x8162C0", "0x0"]}}, +"textures/background_blue_sky.rgba16.png": {"meta":{"dims":[320,240], "alpha":"0x01"}, "offsets": {"us":["0x8094C0", "0x0"]}}, +"textures/background_sunset.rgba16.png": {"meta":{"dims":[320,240], "alpha":"0x01"}, "offsets": {"us":["0x8162C0", "0x0"]}}, "textures/gTextureGreenGoldStripe.rgba16.png": {"meta":{"dims":[256,29], "alpha":"0x01"}, "offsets": {"us":["0x81F6C0", "0x0"]}}, "textures/gTextureGoldStripe.rgba16.png": {"meta":{"dims":[256,15], "alpha":"0x01"}, "offsets": {"us":["0x8202C0", "0x0"]}}, diff --git a/assets/blueshell.json b/assets/blueshell.json index c75ccf5efd..6a18323292 100644 --- a/assets/blueshell.json +++ b/assets/blueshell.json @@ -1,11 +1,11 @@ { "common_tlut_blue_shell": {"output_dir": "blueshell", "rom_offset": "0x132B50", "block_offset": "0x05038", "width": 16, "height": 16, "type": "rgba16"}, -"gTextureBlueShell0": {"output_dir": "blueshell", "rom_offset": "0x68FE20", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell1": {"output_dir": "blueshell", "rom_offset": "0x69004C", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell2": {"output_dir": "blueshell", "rom_offset": "0x690284", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell3": {"output_dir": "blueshell", "rom_offset": "0x6904C4", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell4": {"output_dir": "blueshell", "rom_offset": "0x690708", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell5": {"output_dir": "blueshell", "rom_offset": "0x690960", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell6": {"output_dir": "blueshell", "rom_offset": "0x690BBC", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, -"gTextureBlueShell7": {"output_dir": "blueshell", "rom_offset": "0x690DF8", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"} +"texture_blue_shell_0": {"output_dir": "blueshell", "rom_offset": "0x68FE20", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_1": {"output_dir": "blueshell", "rom_offset": "0x69004C", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_2": {"output_dir": "blueshell", "rom_offset": "0x690284", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_3": {"output_dir": "blueshell", "rom_offset": "0x6904C4", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_4": {"output_dir": "blueshell", "rom_offset": "0x690708", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_5": {"output_dir": "blueshell", "rom_offset": "0x690960", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_6": {"output_dir": "blueshell", "rom_offset": "0x690BBC", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"}, +"texture_blue_shell_7": {"output_dir": "blueshell", "rom_offset": "0x690DF8", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_blue_shell"} } \ No newline at end of file diff --git a/assets/course_outlines.json b/assets/course_outlines.json index 48877d202f..7a208a6842 100644 --- a/assets/course_outlines.json +++ b/assets/course_outlines.json @@ -1,22 +1,22 @@ { -"gTextureCourseOutlineMarioRaceway": {"output_dir": "course_outlines", "rom_offset": "0x720C0C", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineChocoMountain": {"output_dir": "course_outlines", "rom_offset": "0x720ED0", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineBowsersCastle": {"output_dir": "course_outlines", "rom_offset": "0x7211D8", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineBansheeBoardwalk": {"output_dir": "course_outlines", "rom_offset": "0x72143C", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineYoshiValley": {"output_dir": "course_outlines", "rom_offset": "0x721634", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineFrappeSnowland": {"output_dir": "course_outlines", "rom_offset": "0x721A58", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineKoopaTroopaBeach": {"output_dir": "course_outlines", "rom_offset": "0x721CD0", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineRoyalRaceway": {"output_dir": "course_outlines", "rom_offset": "0x721F38", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineLuigiRaceway": {"output_dir": "course_outlines", "rom_offset": "0x722210", "width": 64, "height": 96, "type": "i4"}, -"gTextureCourseOutlineMooMooFarm": {"output_dir": "course_outlines", "rom_offset": "0x72248C", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineToadsTurnpike": {"output_dir": "course_outlines", "rom_offset": "0x7226C4", "width": 128, "height": 64, "type": "i4"}, -"gTextureCourseOutlineKalimariDesert": {"output_dir": "course_outlines", "rom_offset": "0x7229C0", "width": 64, "height": 96, "type": "i4"}, -"gTextureCourseOutlineSherbetLand": {"output_dir": "course_outlines", "rom_offset": "0x722D2C", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineRainbowRoad": {"output_dir": "course_outlines", "rom_offset": "0x723034", "width": 64, "height": 96, "type": "i4"}, -"gTextureCourseOutlineWarioStadium": {"output_dir": "course_outlines", "rom_offset": "0x723370", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineBlockFort": {"output_dir": "course_outlines", "rom_offset": "0x723644", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineSkyscraper": {"output_dir": "course_outlines", "rom_offset": "0x7238E4", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineDoubleDeck": {"output_dir": "course_outlines", "rom_offset": "0x723B18", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineDksJungleParkway": {"output_dir": "course_outlines", "rom_offset": "0x723C9C", "width": 64, "height": 64, "type": "i4"}, -"gTextureCourseOutlineBigDonut": {"output_dir": "course_outlines", "rom_offset": "0x723F84", "width": 64, "height": 64, "type": "i4"} +"minimap_mario_raceway": {"output_dir": "course_outlines", "rom_offset": "0x720C0C", "width": 64, "height": 64, "type": "i4"}, +"minimap_choco_mountain": {"output_dir": "course_outlines", "rom_offset": "0x720ED0", "width": 64, "height": 64, "type": "i4"}, +"minimap_bowsers_castle": {"output_dir": "course_outlines", "rom_offset": "0x7211D8", "width": 64, "height": 64, "type": "i4"}, +"minimap_banshee_boardwalk": {"output_dir": "course_outlines", "rom_offset": "0x72143C", "width": 64, "height": 64, "type": "i4"}, +"minimap_yoshi_valley": {"output_dir": "course_outlines", "rom_offset": "0x721634", "width": 64, "height": 64, "type": "i4"}, +"minimap_frappe_snowland": {"output_dir": "course_outlines", "rom_offset": "0x721A58", "width": 64, "height": 64, "type": "i4"}, +"minimap_koopa_troopa_beach": {"output_dir": "course_outlines", "rom_offset": "0x721CD0", "width": 64, "height": 64, "type": "i4"}, +"minimap_royal_raceway": {"output_dir": "course_outlines", "rom_offset": "0x721F38", "width": 64, "height": 64, "type": "i4"}, +"minimap_luigi_raceway": {"output_dir": "course_outlines", "rom_offset": "0x722210", "width": 64, "height": 96, "type": "i4"}, +"minimap_moo_moo_farm": {"output_dir": "course_outlines", "rom_offset": "0x72248C", "width": 64, "height": 64, "type": "i4"}, +"minimap_toads_turnpike": {"output_dir": "course_outlines", "rom_offset": "0x7226C4", "width": 128, "height": 64, "type": "i4"}, +"minimap_kalimari_desert": {"output_dir": "course_outlines", "rom_offset": "0x7229C0", "width": 64, "height": 96, "type": "i4"}, +"minimap_sherbet_land": {"output_dir": "course_outlines", "rom_offset": "0x722D2C", "width": 64, "height": 64, "type": "i4"}, +"minimap_rainbow_road": {"output_dir": "course_outlines", "rom_offset": "0x723034", "width": 64, "height": 96, "type": "i4"}, +"minimap_wario_stadium": {"output_dir": "course_outlines", "rom_offset": "0x723370", "width": 64, "height": 64, "type": "i4"}, +"minimap_block_fort": {"output_dir": "course_outlines", "rom_offset": "0x723644", "width": 64, "height": 64, "type": "i4"}, +"minimap_skyscraper": {"output_dir": "course_outlines", "rom_offset": "0x7238E4", "width": 64, "height": 64, "type": "i4"}, +"minimap_double_deck": {"output_dir": "course_outlines", "rom_offset": "0x723B18", "width": 64, "height": 64, "type": "i4"}, +"minimap_dks_jungle_parkway": {"output_dir": "course_outlines", "rom_offset": "0x723C9C", "width": 64, "height": 64, "type": "i4"}, +"minimap_big_donut": {"output_dir": "course_outlines", "rom_offset": "0x723F84", "width": 64, "height": 64, "type": "i4"} } diff --git a/assets/greenshell.json b/assets/greenshell.json index d6feea7345..cf07a68221 100644 --- a/assets/greenshell.json +++ b/assets/greenshell.json @@ -1,11 +1,11 @@ { "common_tlut_green_shell": {"output_dir": "greenshell", "rom_offset": "0x132B50", "block_offset": "0x04E38", "width": 16, "height": 16, "type": "rgba16"}, -"gTextureGreenShell0": {"output_dir": "greenshell", "rom_offset": "0x68EB50", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell1": {"output_dir": "greenshell", "rom_offset": "0x68EDA0", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell2": {"output_dir": "greenshell", "rom_offset": "0x68EFF0", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell3": {"output_dir": "greenshell", "rom_offset": "0x68F248", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell4": {"output_dir": "greenshell", "rom_offset": "0x68F4A8", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell5": {"output_dir": "greenshell", "rom_offset": "0x68F700", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell6": {"output_dir": "greenshell", "rom_offset": "0x68F96C", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, -"gTextureGreenShell7": {"output_dir": "greenshell", "rom_offset": "0x68FBCC", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"} +"texture_green_shell_0": {"output_dir": "greenshell", "rom_offset": "0x68EB50", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_1": {"output_dir": "greenshell", "rom_offset": "0x68EDA0", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_2": {"output_dir": "greenshell", "rom_offset": "0x68EFF0", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_3": {"output_dir": "greenshell", "rom_offset": "0x68F248", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_4": {"output_dir": "greenshell", "rom_offset": "0x68F4A8", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_5": {"output_dir": "greenshell", "rom_offset": "0x68F700", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_6": {"output_dir": "greenshell", "rom_offset": "0x68F96C", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"}, +"texture_green_shell_7": {"output_dir": "greenshell", "rom_offset": "0x68FBCC", "width": 32, "height": 32, "type": "ci8", "tlut": "common_tlut_green_shell"} } diff --git a/assets/include/blueshell.mk b/assets/include/blueshell.mk index c344726ff4..81efb56c39 100644 --- a/assets/include/blueshell.mk +++ b/assets/include/blueshell.mk @@ -3,14 +3,14 @@ BLUESHELL_DIR := assets/blueshell BLUESHELL_PALETTE := $(BLUESHELL_DIR)/common_tlut_blue_shell.png BLUESHELL_FRAMES := \ -$(BLUESHELL_DIR)/gTextureBlueShell0.png \ -$(BLUESHELL_DIR)/gTextureBlueShell1.png \ -$(BLUESHELL_DIR)/gTextureBlueShell2.png \ -$(BLUESHELL_DIR)/gTextureBlueShell3.png \ -$(BLUESHELL_DIR)/gTextureBlueShell4.png \ -$(BLUESHELL_DIR)/gTextureBlueShell5.png \ -$(BLUESHELL_DIR)/gTextureBlueShell6.png \ -$(BLUESHELL_DIR)/gTextureBlueShell7.png +$(BLUESHELL_DIR)/texture_blue_shell_0.png \ +$(BLUESHELL_DIR)/texture_blue_shell_1.png \ +$(BLUESHELL_DIR)/texture_blue_shell_2.png \ +$(BLUESHELL_DIR)/texture_blue_shell_3.png \ +$(BLUESHELL_DIR)/texture_blue_shell_4.png \ +$(BLUESHELL_DIR)/texture_blue_shell_5.png \ +$(BLUESHELL_DIR)/texture_blue_shell_6.png \ +$(BLUESHELL_DIR)/texture_blue_shell_7.png BLUESHELL_EXPORT_SENTINEL := $(BLUESHELL_DIR)/.export diff --git a/assets/include/course_outlines.mk b/assets/include/course_outlines.mk index 067e7b4e3c..9e799ce085 100644 --- a/assets/include/course_outlines.mk +++ b/assets/include/course_outlines.mk @@ -1,26 +1,26 @@ COURSE_OUTLINE_DIR := assets/course_outlines COURSE_OUTLINE_PNG := \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineMarioRaceway.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineChocoMountain.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineBowsersCastle.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineBansheeBoardwalk.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineYoshiValley.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineFrappeSnowland.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineKoopaTroopaBeach.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineRoyalRaceway.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineLuigiRaceway.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineMooMooFarm.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineToadsTurnpike.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineKalimariDesert.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineSherbetLand.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineRainbowRoad.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineWarioStadium.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineBlockFort.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineSkyscraper.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineDoubleDeck.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineDksJungleParkway.png \ -$(COURSE_OUTLINE_DIR)/gTextureCourseOutlineBigDonut.png +$(COURSE_OUTLINE_DIR)/minimap_mario_raceway.png \ +$(COURSE_OUTLINE_DIR)/minimap_choco_mountain.png \ +$(COURSE_OUTLINE_DIR)/minimap_bowsers_castle.png \ +$(COURSE_OUTLINE_DIR)/minimap_banshee_boardwalk.png \ +$(COURSE_OUTLINE_DIR)/minimap_yoshi_valley.png \ +$(COURSE_OUTLINE_DIR)/minimap_frappe_snowland.png \ +$(COURSE_OUTLINE_DIR)/minimap_koopa_troopa_beach.png \ +$(COURSE_OUTLINE_DIR)/minimap_royal_raceway.png \ +$(COURSE_OUTLINE_DIR)/minimap_luigi_raceway.png \ +$(COURSE_OUTLINE_DIR)/minimap_moo_moo_farm.png \ +$(COURSE_OUTLINE_DIR)/minimap_toads_turnpike.png \ +$(COURSE_OUTLINE_DIR)/minimap_kalimari_desert.png \ +$(COURSE_OUTLINE_DIR)/minimap_sherbet_land.png \ +$(COURSE_OUTLINE_DIR)/minimap_rainbow_road.png \ +$(COURSE_OUTLINE_DIR)/minimap_wario_stadium.png \ +$(COURSE_OUTLINE_DIR)/minimap_block_fort.png \ +$(COURSE_OUTLINE_DIR)/minimap_skyscraper.png \ +$(COURSE_OUTLINE_DIR)/minimap_double_deck.png \ +$(COURSE_OUTLINE_DIR)/minimap_dks_jungle_parkway.png \ +$(COURSE_OUTLINE_DIR)/minimap_big_donut.png COURSE_OUTLINE_EXPORT_SENTINEL := $(COURSE_OUTLINE_DIR)/.export diff --git a/assets/include/greenshell.mk b/assets/include/greenshell.mk index 870962eb59..0dd8a5b0bc 100644 --- a/assets/include/greenshell.mk +++ b/assets/include/greenshell.mk @@ -3,14 +3,14 @@ GREENSHELL_DIR := assets/greenshell GREENSHELL_PALETTE := $(GREENSHELL_DIR)/common_tlut_green_shell.png GREENSHELL_FRAMES := \ -$(GREENSHELL_DIR)/gTextureGreenShell0.png \ -$(GREENSHELL_DIR)/gTextureGreenShell1.png \ -$(GREENSHELL_DIR)/gTextureGreenShell2.png \ -$(GREENSHELL_DIR)/gTextureGreenShell3.png \ -$(GREENSHELL_DIR)/gTextureGreenShell4.png \ -$(GREENSHELL_DIR)/gTextureGreenShell5.png \ -$(GREENSHELL_DIR)/gTextureGreenShell6.png \ -$(GREENSHELL_DIR)/gTextureGreenShell7.png +$(GREENSHELL_DIR)/texture_green_shell_0.png \ +$(GREENSHELL_DIR)/texture_green_shell_1.png \ +$(GREENSHELL_DIR)/texture_green_shell_2.png \ +$(GREENSHELL_DIR)/texture_green_shell_3.png \ +$(GREENSHELL_DIR)/texture_green_shell_4.png \ +$(GREENSHELL_DIR)/texture_green_shell_5.png \ +$(GREENSHELL_DIR)/texture_green_shell_6.png \ +$(GREENSHELL_DIR)/texture_green_shell_7.png GREENSHELL_EXPORT_SENTINEL := $(GREENSHELL_DIR)/.export diff --git a/courses/banshee_boardwalk/course_data.c b/courses/banshee_boardwalk/course_data.c index c45ed9d6ae..072d429cbd 100644 --- a/courses/banshee_boardwalk/course_data.c +++ b/courses/banshee_boardwalk/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -2549,7 +2549,7 @@ Gfx d_course_banshee_boardwalk_dl_4480[] = { }; // 0x4578 Spawn location -TrackWaypoint d_course_banshee_boardwalk_unknown_waypoints[] = { +TrackPathPoint d_course_banshee_boardwalk_unknown_path[] = { { 5, 0, -65, 0 }, { 5, 0, -90, 0 }, { 4, 0, -203, 0 }, { 5, 0, -501, 0 }, { -13, 0, -575, 0 }, { -54, 0, -598, 0 }, { -244, 0, -605, 0 }, { -634, 0, -602, 0 }, { -688, 0, -629, 0 }, { -704, 0, -697, 0 }, { -702, 0, -895, 0 }, { -702, 0, -1095, 0 }, @@ -2572,7 +2572,7 @@ TrackWaypoint d_course_banshee_boardwalk_unknown_waypoints[] = { { 5, 0, 100, 0 }, { 7, 0, -28, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_banshee_boardwalk_track_waypoints[] = { +TrackPathPoint d_course_banshee_boardwalk_track_path[] = { { 5, 12, -77, 1 }, { 4, 12, -97, 1 }, { 4, 12, -117, 1 }, { 4, 12, -137, 1 }, { 4, 12, -157, 1 }, { 4, 12, -177, 1 }, diff --git a/courses/banshee_boardwalk/course_data.h b/courses/banshee_boardwalk/course_data.h index 40b4c42c6f..d92c44a74c 100644 --- a/courses/banshee_boardwalk/course_data.h +++ b/courses/banshee_boardwalk/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_banshee_boardwalk_dl_0[]; @@ -112,8 +112,8 @@ extern Gfx d_course_banshee_boardwalk_dl_42D0[]; extern Gfx d_course_banshee_boardwalk_dl_43A8[]; extern Gfx d_course_banshee_boardwalk_dl_4428[]; extern Gfx d_course_banshee_boardwalk_dl_4480[]; -extern TrackWaypoint d_course_banshee_boardwalk_unknown_waypoints[]; -extern TrackWaypoint d_course_banshee_boardwalk_track_waypoints[]; +extern TrackPathPoint d_course_banshee_boardwalk_unknown_path[]; +extern TrackPathPoint d_course_banshee_boardwalk_track_path[]; extern u8 d_course_banshee_boardwalk_boo_tlut[]; extern Vtx d_course_banshee_boardwalk_cheep_cheep1[]; extern Vtx d_course_banshee_boardwalk_cheep_cheep2[]; diff --git a/courses/bowsers_castle/course_data.c b/courses/bowsers_castle/course_data.c index 23f1db65f7..9dbacf544d 100644 --- a/courses/bowsers_castle/course_data.c +++ b/courses/bowsers_castle/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -2283,7 +2283,7 @@ Gfx d_course_bowsers_castle_dl_4EA8[] = { }; // 0x4F90 -TrackWaypoint d_course_bowsers_castle_unknown_waypoints[] = { +TrackPathPoint d_course_bowsers_castle_unknown_path[] = { { 2, 0, -172, 0 }, { 2, 0, -197, 0 }, { -2, 0, -691, 0 }, { -1, 0, -1087, 0 }, { 4, 0, -1519, 0 }, { 88, 0, -1645, 0 }, { 228, 0, -1743, 0 }, { 571, 0, -1749, 0 }, { 999, 0, -1749, 0 }, { 1201, 0, -1747, 0 }, { 1262, 0, -1759, 0 }, { 1274, 0, -1797, 0 }, { 1277, 0, -2193, 0 }, { 1272, 0, -2487, 0 }, { 1281, 0, -2631, 0 }, @@ -2301,7 +2301,7 @@ TrackWaypoint d_course_bowsers_castle_unknown_waypoints[] = { { 3, 0, -144, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_bowsers_castle_track_waypoints[] = { +TrackPathPoint d_course_bowsers_castle_track_path[] = { { 2, 0, -184, 1 }, { 1, 0, -204, 2 }, { 1, 0, -224, 2 }, diff --git a/courses/bowsers_castle/course_data.h b/courses/bowsers_castle/course_data.h index aadfe865f1..232cc32952 100644 --- a/courses/bowsers_castle/course_data.h +++ b/courses/bowsers_castle/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_bowsers_castle_dl_0[]; @@ -115,8 +115,8 @@ extern Gfx d_course_bowsers_castle_dl_4A98[]; extern Gfx d_course_bowsers_castle_dl_4C00[]; extern Gfx d_course_bowsers_castle_dl_4CE8[]; extern Gfx d_course_bowsers_castle_dl_4EA8[]; -extern TrackWaypoint d_course_bowsers_castle_unknown_waypoints[]; -extern TrackWaypoint d_course_bowsers_castle_track_waypoints[]; +extern TrackPathPoint d_course_bowsers_castle_unknown_path[]; +extern TrackPathPoint d_course_bowsers_castle_track_path[]; extern u8 d_course_bowsers_castle_thwomp_side[]; extern u8 d_course_bowsers_castle_thwomp_tlut[]; extern u8 d_course_bowsers_castle_thwomp_faces[][1024]; diff --git a/courses/choco_mountain/course_data.c b/courses/choco_mountain/course_data.c index 623432ffed..143dcc308b 100644 --- a/courses/choco_mountain/course_data.c +++ b/courses/choco_mountain/course_data.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include @@ -2680,7 +2680,7 @@ Gfx d_course_choco_mountain_dl_43C8[] = { gsSPEndDisplayList(), }; -TrackWaypoint d_course_choco_mountain_unknown_waypoints[] = { +TrackPathPoint d_course_choco_mountain_unknown_path[] = { { -7, 0, -699, 0 }, { -6, 0, -712, 0 }, { 8, 0, -903, 0 }, { 26, 0, -1074, 0 }, { 46, 0, -1140, 0 }, { 80, 0, -1185, 0 }, { 134, 0, -1225, 0 }, { 343, 0, -1316, 0 }, { 408, 0, -1334, 0 }, { 462, 0, -1329, 0 }, { 534, 0, -1295, 0 }, { 566, 0, -1269, 0 }, { 633, 0, -1202, 0 }, { 671, 0, -1170, 0 }, { 726, 0, -1144, 0 }, @@ -2705,7 +2705,7 @@ TrackWaypoint d_course_choco_mountain_unknown_waypoints[] = { { 0, 0, 63, 0 }, { 6, 0, -132, 0 }, { 5, 0, -378, 0 }, { -5, 0, -630, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_choco_mountain_track_waypoints[] = { +TrackPathPoint d_course_choco_mountain_track_path[] = { { -6, 40, -705, 1 }, { -5, 39, -725, 1 }, { -3, 37, -745, 1 }, { -2, 34, -765, 1 }, { 0, 32, -785, 1 }, { 0, 30, -805, 1 }, { 2, 27, -825, 1 }, { 3, 25, -845, 2 }, { 5, 23, -865, 2 }, diff --git a/courses/choco_mountain/course_data.h b/courses/choco_mountain/course_data.h index 7584ada967..40099dd511 100644 --- a/courses/choco_mountain/course_data.h +++ b/courses/choco_mountain/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_choco_mountain_dl_0[]; @@ -103,8 +103,8 @@ extern Gfx d_course_choco_mountain_dl_4138[]; extern Gfx d_course_choco_mountain_dl_41F8[]; extern Gfx d_course_choco_mountain_dl_42C8[]; extern Gfx d_course_choco_mountain_dl_43C8[]; -extern TrackWaypoint d_course_choco_mountain_unknown_waypoints[]; -extern TrackWaypoint d_course_choco_mountain_track_waypoints[]; +extern TrackPathPoint d_course_choco_mountain_unknown_path[]; +extern TrackPathPoint d_course_choco_mountain_track_path[]; extern Lights1 d_course_choco_mountain_light; extern Vtx d_course_choco_mountain_6005AF8[]; extern u8 d_course_choco_mountain_wall_texture[]; diff --git a/courses/dks_jungle_parkway/course_data.c b/courses/dks_jungle_parkway/course_data.c index 0f3af0275a..d61314befc 100644 --- a/courses/dks_jungle_parkway/course_data.c +++ b/courses/dks_jungle_parkway/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -3971,7 +3971,7 @@ Gfx d_course_dks_jungle_parkway_dl_7108[] = { }; // 0x71F0 -TrackWaypoint d_course_dks_jungle_parkway_unknown_waypoints[] = { +TrackPathPoint d_course_dks_jungle_parkway_unknown_path[] = { { 2, 0, 12, 0 }, { 5, 0, -5, 0 }, { 0, 0, -211, 0 }, { 0, 0, -455, 0 }, { 9, 0, -522, 0 }, { 39, 0, -585, 0 }, { 91, 0, -634, 0 }, { 149, 0, -678, 0 }, { 428, 0, -840, 0 }, { 730, 0, -1014, 0 }, { 884, 0, -1081, 0 }, { 1118, 0, -1142, 0 }, @@ -4000,7 +4000,7 @@ TrackWaypoint d_course_dks_jungle_parkway_unknown_waypoints[] = { { 3, 0, 45, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_dks_jungle_parkway_ferry_waypoints[] = { +TrackPathPoint d_course_dks_jungle_parkway_ferry_path[] = { { 1237, 0, -1373, 0 }, { 1206, 0, -1365, 0 }, { 877, 0, -1272, 0 }, { 614, 0, -1152, 0 }, { 254, 0, -959, 0 }, { -44, 0, -852, 0 }, { -217, 0, -814, 0 }, { -350, 0, -801, 0 }, { -431, 0, -842, 0 }, { -442, 0, -942, 0 }, { -395, 0, -1039, 0 }, { -314, 0, -1154, 0 }, { -125, 0, -1307, 0 }, { 95, 0, -1466, 0 }, { 316, 0, -1570, 0 }, @@ -4010,7 +4010,7 @@ TrackWaypoint d_course_dks_jungle_parkway_ferry_waypoints[] = { { 1293, 0, -1375, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_dks_jungle_parkway_track_waypoints[] = { +TrackPathPoint d_course_dks_jungle_parkway_track_path[] = { { 3, 0, 3, 1 }, { 4, 0, -16, 1 }, { 3, 0, -36, 1 }, diff --git a/courses/dks_jungle_parkway/course_data.h b/courses/dks_jungle_parkway/course_data.h index e8d37ddc81..f45b38a9dd 100644 --- a/courses/dks_jungle_parkway/course_data.h +++ b/courses/dks_jungle_parkway/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_dks_jungle_parkway_dl_0[]; @@ -112,9 +112,9 @@ extern Gfx d_course_dks_jungle_parkway_dl_6F10[]; extern Gfx d_course_dks_jungle_parkway_dl_7008[]; extern Gfx d_course_dks_jungle_parkway_dl_7080[]; extern Gfx d_course_dks_jungle_parkway_dl_7108[]; -extern TrackWaypoint d_course_dks_jungle_parkway_unknown_waypoints[]; -extern TrackWaypoint d_course_dks_jungle_parkway_ferry_waypoints[]; -extern TrackWaypoint d_course_dks_jungle_parkway_track_waypoints[]; +extern TrackPathPoint d_course_dks_jungle_parkway_unknown_path[]; +extern TrackPathPoint d_course_dks_jungle_parkway_ferry_path[]; +extern TrackPathPoint d_course_dks_jungle_parkway_track_path[]; extern Vtx d_course_dks_jungle_parkway_paddle_boat_model1[]; extern Vtx d_course_dks_jungle_parkway_paddle_boat_model2[]; extern Vtx d_course_dks_jungle_parkway_paddle_boat_model3[]; diff --git a/courses/frappe_snowland/course_data.c b/courses/frappe_snowland/course_data.c index 9a6042fa48..56777b2bb0 100644 --- a/courses/frappe_snowland/course_data.c +++ b/courses/frappe_snowland/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -1428,7 +1428,7 @@ Gfx d_course_frappe_snowland_dl_33E0[] = { gsSPDisplayList(d_course_frappe_snowland_packed_dl_5B58), gsSPEndDisplayList(), }; -TrackWaypoint d_course_frappe_snowland_unknown_waypoints[] = { +TrackPathPoint d_course_frappe_snowland_unknown_path[] = { { -4, 0, -259, 0 }, { -4, 0, -282, 0 }, { -10, 0, -526, 0 }, { 41, 0, -658, 0 }, { 150, 0, -769, 0 }, { 358, 0, -831, 0 }, { 572, 0, -881, 0 }, { 719, 0, -982, 0 }, { 801, 0, -1109, 0 }, { 838, 0, -1262, 0 }, { 820, 0, -1435, 0 }, { 749, 0, -1568, 0 }, { 674, 0, -1676, 0 }, { 621, 0, -1863, 0 }, { 603, 0, -2054, 0 }, @@ -1446,7 +1446,7 @@ TrackWaypoint d_course_frappe_snowland_unknown_waypoints[] = { { 0, 0, 155, 0 }, { -3, 0, -133, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_frappe_snowland_track_waypoints[] = { +TrackPathPoint d_course_frappe_snowland_track_path[] = { { -4, 0, -270, 1 }, { -4, 0, -290, 1 }, { -4, 0, -310, 2 }, diff --git a/courses/frappe_snowland/course_data.h b/courses/frappe_snowland/course_data.h index a74e5b5e9d..61983a4a64 100644 --- a/courses/frappe_snowland/course_data.h +++ b/courses/frappe_snowland/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_frappe_snowland_dl_0[]; @@ -75,8 +75,8 @@ extern Gfx d_course_frappe_snowland_dl_3198[]; extern Gfx d_course_frappe_snowland_dl_3270[]; extern Gfx d_course_frappe_snowland_dl_3328[]; extern Gfx d_course_frappe_snowland_dl_33E0[]; -extern TrackWaypoint d_course_frappe_snowland_unknown_waypoints[]; -extern TrackWaypoint d_course_frappe_snowland_track_waypoints[]; +extern TrackPathPoint d_course_frappe_snowland_unknown_path[]; +extern TrackPathPoint d_course_frappe_snowland_track_path[]; extern u8 d_course_frappe_snowland_snowman_tlut[]; extern u8 d_course_frappe_snowland_snowman_head[]; extern u8 d_course_frappe_snowland_snowman_body[]; diff --git a/courses/kalimari_desert/course_data.c b/courses/kalimari_desert/course_data.c index da1363c79a..d44e49b5cb 100644 --- a/courses/kalimari_desert/course_data.c +++ b/courses/kalimari_desert/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -2988,7 +2988,7 @@ Gfx d_course_kalimari_desert_dl_6940[] = { }; // 0x6AC8 -TrackWaypoint d_course_kalimari_desert_unknown_waypoints[] = { +TrackPathPoint d_course_kalimari_desert_unknown_path[] = { { 1, 0, 503, 0 }, { 1, 0, 485, 0 }, { 1, 0, 325, 0 }, { 3, 0, -247, 0 }, { -47, 0, -559, 0 }, { -176, 0, -821, 0 }, { -379, 0, -996, 0 }, { -620, 0, -1082, 0 }, { -878, 0, -1095, 0 }, { -1133, 0, -1037, 0 }, { -1342, 0, -907, 0 }, { -1513, 0, -691, 0 }, { -1610, 0, -448, 0 }, { -1642, 0, -133, 0 }, { -1642, 0, 18, 0 }, @@ -3002,7 +3002,7 @@ TrackWaypoint d_course_kalimari_desert_unknown_waypoints[] = { { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_kalimari_desert_train_waypoints[] = { +TrackPathPoint d_course_kalimari_desert_train_path[] = { { -741, 0, 2114, 0 }, { -741, 0, 2130, 0 }, { -741, 0, 2364, 0 }, { -744, 0, 2840, 0 }, { -749, 0, 2906, 0 }, { -758, 0, 2962, 0 }, { -769, 0, 3017, 0 }, { -784, 0, 3085, 0 }, { -801, 0, 3138, 0 }, { -818, 0, 3184, 0 }, { -838, 0, 3229, 0 }, { -864, 0, 3281, 0 }, { -891, 0, 3325, 0 }, { -917, 0, 3364, 0 }, { -951, 0, 3404, 0 }, @@ -3021,7 +3021,7 @@ TrackWaypoint d_course_kalimari_desert_train_waypoints[] = { { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_kalimari_desert_track_waypoints[] = { +TrackPathPoint d_course_kalimari_desert_track_path[] = { { 1, 0, 494, 1 }, { 1, 0, 473, 2 }, { 1, 0, 453, 2 }, { 1, 1, 433, 2 }, { 1, 1, 413, 2 }, { 1, 1, 393, 2 }, { 1, 1, 373, 2 }, { 1, 1, 353, 2 }, { 1, 1, 333, 2 }, { 1, 2, 313, 2 }, { 1, 3, 293, 2 }, { 1, 3, 273, 2 }, diff --git a/courses/kalimari_desert/course_data.h b/courses/kalimari_desert/course_data.h index 9e98b98665..7f45824d50 100644 --- a/courses/kalimari_desert/course_data.h +++ b/courses/kalimari_desert/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_kalimari_desert_dl_0[]; @@ -87,9 +87,9 @@ extern Gfx d_course_kalimari_desert_dl_65B0[]; extern Gfx d_course_kalimari_desert_dl_66F0[]; extern Gfx d_course_kalimari_desert_dl_6838[]; extern Gfx d_course_kalimari_desert_dl_6940[]; -extern TrackWaypoint d_course_kalimari_desert_unknown_waypoints[]; -extern TrackWaypoint d_course_kalimari_desert_train_waypoints[]; -extern TrackWaypoint d_course_kalimari_desert_track_waypoints[]; +extern TrackPathPoint d_course_kalimari_desert_unknown_path[]; +extern TrackPathPoint d_course_kalimari_desert_train_path[]; +extern TrackPathPoint d_course_kalimari_desert_track_path[]; extern u8 d_course_kalimari_desert_tree_tlut[]; extern Vtx d_course_kalimari_desert_cactus_model1[]; extern Vtx d_course_kalimari_desert_cactus_model2[]; diff --git a/courses/koopa_troopa_beach/course_data.c b/courses/koopa_troopa_beach/course_data.c index 6de181a4d1..c89581af93 100644 --- a/courses/koopa_troopa_beach/course_data.c +++ b/courses/koopa_troopa_beach/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -6474,7 +6474,7 @@ Gfx d_course_koopa_troopa_beach_dl_AD40[] = { }; // 0xADE0 path -TrackWaypoint d_course_koopa_troopa_beach_unknown_waypoints[] = { +TrackPathPoint d_course_koopa_troopa_beach_unknown_path[] = { { -34, 0, 103, 0 }, { -34, 0, 60, 0 }, { -38, 0, -184, 0 }, { -30, 0, -304, 0 }, { 36, 0, -422, 0 }, { 137, 0, -566, 0 }, { 147, 0, -645, 0 }, { 103, 0, -761, 0 }, { -12, 0, -837, 0 }, { -139, 0, -1031, 0 }, { -230, 0, -1258, 0 }, { -343, 0, -1414, 0 }, { -465, 0, -1429, 0 }, { -629, 0, -1397, 0 }, { -853, 0, -1326, 0 }, @@ -6490,7 +6490,7 @@ TrackWaypoint d_course_koopa_troopa_beach_unknown_waypoints[] = { { -32, 0, 136, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_koopa_troopa_beach_unknown_waypoints1[] = { +TrackPathPoint d_course_koopa_troopa_beach_unknown_path1[] = { { -27, 0, 101, 7 }, { -31, 0, 76, 7 }, { -27, 0, -187, 7 }, { -24, 0, -305, 7 }, { 26, 0, -415, 7 }, { 119, 0, -564, 7 }, { 133, 0, -646, 7 }, { 94, 0, -742, 7 }, { 8, 0, -853, 7 }, { -150, 0, -934, 7 }, { -310, 0, -919, 7 }, { -471, 0, -887, 7 }, @@ -6508,7 +6508,7 @@ TrackWaypoint d_course_koopa_troopa_beach_unknown_waypoints1[] = { { -24, 0, 409, 7 }, { -28, 0, 128, 7 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_koopa_troopa_beach_track_waypoints[] = { +TrackPathPoint d_course_koopa_troopa_beach_track_path[] = { { -34, 1, 81, 1 }, { -34, 1, 61, 1 }, { -34, 1, 41, 1 }, { -34, 1, 21, 2 }, { -34, 1, 1, 2 }, { -35, 1, -18, 2 }, { -35, 1, -38, 2 }, { -35, 1, -58, 2 }, { -36, 1, -78, 2 }, @@ -6714,7 +6714,7 @@ TrackWaypoint d_course_koopa_troopa_beach_track_waypoints[] = { { -33, 1, 121, 1 }, { -33, 1, 101, 1 }, { -32768, -32768, -32768, 0 }, }; -TrackWaypoint d_course_koopa_troopa_beach_track_waypoints_2[] = { +TrackPathPoint d_course_koopa_troopa_beach_track_path_2[] = { { -29, 1, 88, 1 }, { -29, 1, 68, 1 }, { -29, 1, 48, 1 }, diff --git a/courses/koopa_troopa_beach/course_data.h b/courses/koopa_troopa_beach/course_data.h index fa6c27bf0c..f205ab0440 100644 --- a/courses/koopa_troopa_beach/course_data.h +++ b/courses/koopa_troopa_beach/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "animation.h" @@ -306,10 +306,10 @@ extern Gfx d_course_koopa_troopa_beach_dl_AB88[]; extern Gfx d_course_koopa_troopa_beach_dl_AC10[]; extern Gfx d_course_koopa_troopa_beach_dl_AC68[]; extern Gfx d_course_koopa_troopa_beach_dl_AD40[]; -extern TrackWaypoint d_course_koopa_troopa_beach_unknown_waypoints[]; -extern TrackWaypoint d_course_koopa_troopa_beach_unknown_waypoints1[]; -extern TrackWaypoint d_course_koopa_troopa_beach_track_waypoints[]; -extern TrackWaypoint d_course_koopa_troopa_beach_track_waypoints_2[]; +extern TrackPathPoint d_course_koopa_troopa_beach_unknown_path[]; +extern TrackPathPoint d_course_koopa_troopa_beach_unknown_path1[]; +extern TrackPathPoint d_course_koopa_troopa_beach_track_path[]; +extern TrackPathPoint d_course_koopa_troopa_beach_track_path_2[]; extern u8 d_course_koopa_troopa_beach_crab_tlut[]; extern u8 d_course_koopa_troopa_beach_crab_frames[][4096]; extern u32 d_course_koopa_troopa_beach_unk_data1[]; diff --git a/courses/luigi_raceway/course_data.c b/courses/luigi_raceway/course_data.c index 45fb148526..89c360fb7e 100644 --- a/courses/luigi_raceway/course_data.c +++ b/courses/luigi_raceway/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -4693,7 +4693,7 @@ Gfx d_course_luigi_raceway_dl_A320[] = { }; // 0xA540 -TrackWaypoint d_course_luigi_raceway_unknown_waypoints[] = { +TrackPathPoint d_course_luigi_raceway_unknown_path[] = { { -139, 0, -202, 0 }, { -139, 0, -218, 0 }, { -139, 0, -297, 0 }, { -139, 0, -2247, 0 }, { -138, 0, -2474, 0 }, { -170, 0, -2745, 0 }, { -249, 0, -2930, 0 }, { -373, 0, -3095, 0 }, { -550, 0, -3226, 0 }, { -787, 0, -3310, 0 }, { -1022, 0, -3321, 0 }, { -1236, 0, -3258, 0 }, @@ -4710,7 +4710,7 @@ TrackWaypoint d_course_luigi_raceway_unknown_waypoints[] = { }; // 0xA6D0 -TrackWaypoint d_course_luigi_raceway_track_waypoints[] = { +TrackPathPoint d_course_luigi_raceway_track_path[] = { { -139, -50, -210, 1 }, { -139, -50, -230, 2 }, { -139, -50, -250, 2 }, { -139, -50, -270, 2 }, { -139, -50, -290, 2 }, { -139, -50, -310, 2 }, { -139, -50, -330, 2 }, { -139, -50, -350, 2 }, { -139, -50, -370, 2 }, { -139, -50, -390, 2 }, { -139, -50, -410, 2 }, { -139, -50, -430, 2 }, diff --git a/courses/luigi_raceway/course_data.h b/courses/luigi_raceway/course_data.h index 1b0694238e..47224ce871 100644 --- a/courses/luigi_raceway/course_data.h +++ b/courses/luigi_raceway/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_luigi_raceway_dl_0[]; @@ -127,8 +127,8 @@ extern Gfx d_course_luigi_raceway_dl_9E58[]; extern Gfx d_course_luigi_raceway_dl_A028[]; extern Gfx d_course_luigi_raceway_dl_A178[]; extern Gfx d_course_luigi_raceway_dl_A320[]; -extern TrackWaypoint d_course_luigi_raceway_unknown_waypoints[]; -extern TrackWaypoint d_course_luigi_raceway_track_waypoints[]; +extern TrackPathPoint d_course_luigi_raceway_unknown_path[]; +extern TrackPathPoint d_course_luigi_raceway_track_path[]; extern Vtx d_course_luigi_raceway_basket_model_lod2[]; extern Vtx d_course_luigi_raceway_unknown_model1[]; extern Vtx d_course_luigi_raceway_unknown_model2[]; diff --git a/courses/mario_raceway/course_data.c b/courses/mario_raceway/course_data.c index 096cd54e1a..371f350236 100644 --- a/courses/mario_raceway/course_data.c +++ b/courses/mario_raceway/course_data.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "course_displaylists.inc.h" @@ -3093,7 +3093,7 @@ Gfx d_course_mario_raceway_dl_5228[] = { gsSPEndDisplayList(), }; -TrackWaypoint d_course_mario_raceway_unknown_waypoints[] = { +TrackPathPoint d_course_mario_raceway_unknown_path[] = { { 0, 0, -224, 0 }, { 0, 0, -241, 0 }, { 0, 0, -612, 0 }, { 16, 0, -690, 0 }, { 62, 0, -756, 0 }, { 128, 0, -798, 0 }, { 494, 0, -944, 0 }, { 637, 0, -997, 0 }, { 708, 0, -1007, 0 }, { 776, 0, -992, 0 }, { 836, 0, -949, 0 }, { 883, 0, -890, 0 }, { 902, 0, -796, 0 }, { 878, 0, -706, 0 }, { 812, 0, -584, 0 }, @@ -3111,7 +3111,7 @@ TrackWaypoint d_course_mario_raceway_unknown_waypoints[] = { { 1, 0, 255, 0 }, { 0, 0, -180, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_mario_raceway_track_waypoints[] = { +TrackPathPoint d_course_mario_raceway_track_path[] = { { 0, 0, -232, 1 }, { 0, 0, -252, 1 }, { 0, 0, -272, 1 }, { 0, 0, -292, 1 }, { 0, 0, -312, 1 }, { 0, 0, -332, 1 }, { 0, 0, -352, 1 }, { 0, 0, -372, 1 }, { 0, 0, -392, 1 }, { 0, 0, -412, 1 }, { 0, 0, -432, 1 }, { 0, 0, -452, 1 }, diff --git a/courses/mario_raceway/course_data.h b/courses/mario_raceway/course_data.h index bdc5a137d9..5ef289a71e 100644 --- a/courses/mario_raceway/course_data.h +++ b/courses/mario_raceway/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_mario_raceway_dl_0[]; @@ -76,8 +76,8 @@ extern Gfx d_course_mario_raceway_dl_4ED0[]; extern Gfx d_course_mario_raceway_dl_4FF0[]; extern Gfx d_course_mario_raceway_dl_5150[]; extern Gfx d_course_mario_raceway_dl_5228[]; -extern TrackWaypoint d_course_mario_raceway_unknown_waypoints[]; -extern TrackWaypoint d_course_mario_raceway_track_waypoints[]; +extern TrackPathPoint d_course_mario_raceway_unknown_path[]; +extern TrackPathPoint d_course_mario_raceway_track_path[]; extern u8 d_course_mario_raceway_piranha_plant_tlut[]; extern Vtx d_course_mario_raceway_piranha_plant_model[]; extern Gfx d_course_mario_raceway_dl_piranha_plant[]; diff --git a/courses/moo_moo_farm/course_data.c b/courses/moo_moo_farm/course_data.c index fc11d99ae5..f08ffb028e 100644 --- a/courses/moo_moo_farm/course_data.c +++ b/courses/moo_moo_farm/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -8424,7 +8424,7 @@ Gfx d_course_moo_moo_farm_dl_EA18[] = { }; // 0xEC80 -TrackWaypoint d_course_moo_moo_farm_unknown_waypoints[] = { +TrackPathPoint d_course_moo_moo_farm_unknown_path[] = { { 11, 0, 46, 0 }, { 9, 0, 21, 0 }, { 5, 0, -307, 0 }, { -19, 0, -698, 0 }, { -28, 0, -1122, 0 }, { -11, 0, -1281, 0 }, { -17, 0, -1480, 0 }, { 35, 0, -1705, 0 }, { 221, 0, -1918, 0 }, { 413, 0, -2044, 0 }, { 628, 0, -2130, 0 }, { 851, 0, -2141, 0 }, { 1056, 0, -2065, 0 }, { 1200, 0, -1919, 0 }, { 1336, 0, -1771, 0 }, @@ -8436,7 +8436,7 @@ TrackWaypoint d_course_moo_moo_farm_unknown_waypoints[] = { { 27, 0, 423, 0 }, { 6, 0, 185, 0 }, { 6, 0, 78, 0 }, { 1737, 0, -186, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_moo_moo_farm_track_waypoints[] = { +TrackPathPoint d_course_moo_moo_farm_track_path[] = { { 10, 18, 33, 1 }, { 9, 17, 13, 2 }, { 8, 17, -6, 2 }, { 8, 16, -26, 2 }, { 8, 15, -46, 2 }, { 7, 14, -66, 2 }, { 7, 14, -86, 2 }, { 7, 14, -106, 2 }, { 7, 14, -126, 2 }, diff --git a/courses/moo_moo_farm/course_data.h b/courses/moo_moo_farm/course_data.h index 8ff50ec2d7..dada2dc9a2 100644 --- a/courses/moo_moo_farm/course_data.h +++ b/courses/moo_moo_farm/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_moo_moo_farm_dl_0[]; @@ -104,8 +104,8 @@ extern Gfx d_course_moo_moo_farm_dl_E1D8[]; extern Gfx d_course_moo_moo_farm_dl_E4B0[]; extern Gfx d_course_moo_moo_farm_dl_E708[]; extern Gfx d_course_moo_moo_farm_dl_EA18[]; -extern TrackWaypoint d_course_moo_moo_farm_unknown_waypoints[]; -extern TrackWaypoint d_course_moo_moo_farm_track_waypoints[]; +extern TrackPathPoint d_course_moo_moo_farm_unknown_path[]; +extern TrackPathPoint d_course_moo_moo_farm_track_path[]; extern u8 d_course_moo_moo_farm_mole_tlut[]; extern u8 d_course_moo_moo_farm_mole_frames[][2048]; extern u8 d_course_moo_moo_farm_mole_dirt[]; diff --git a/courses/rainbow_road/course_data.c b/courses/rainbow_road/course_data.c index a1d68895c0..2ee57be941 100644 --- a/courses/rainbow_road/course_data.c +++ b/courses/rainbow_road/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -813,7 +813,7 @@ Gfx d_course_rainbow_road_dl_1948[] = { gsSPEndDisplayList(), }; -TrackWaypoint d_course_rainbow_road_unknown_waypoints[] = { +TrackPathPoint d_course_rainbow_road_unknown_path[] = { { 6, 0, 3, 0 }, { 6, 0, -25, 0 }, { 0, 0, -514, 0 }, { 1, 0, -1537, 0 }, { -3, 0, -2579, 0 }, { -3, 0, -3696, 0 }, { 1, 0, -4448, 0 }, { 30, 0, -4782, 0 }, { 113, 0, -5064, 0 }, { 331, 0, -5290, 0 }, { 610, 0, -5390, 0 }, { 915, 0, -5345, 0 }, @@ -842,7 +842,7 @@ TrackWaypoint d_course_rainbow_road_unknown_waypoints[] = { { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_rainbow_road_track_waypoints[] = { +TrackPathPoint d_course_rainbow_road_track_path[] = { { 6, 1510, -11, 1 }, { 5, 1509, -31, 2 }, { 5, 1509, -51, 2 }, { 5, 1508, -71, 2 }, { 5, 1507, -91, 2 }, { 4, 1506, -111, 2 }, { 4, 1505, -131, 2 }, { 4, 1504, -151, 2 }, { 4, 1504, -171, 2 }, @@ -1487,28 +1487,38 @@ u8 d_course_rainbow_road_neon_boo_tlut_list[][512] = { }, }; -u8 d_course_rainbow_road_static_tluts[][512] = { - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonPeach.inc.c" - }, - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonLuigi.inc.c" - }, - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonDonkeyKong.inc.c" - }, - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonYoshi.inc.c" - }, - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonBowser.inc.c" - }, - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonWario.inc.c" - }, - { -#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonToad.inc.c" - }, +u16 d_course_rainbow_road_static_tluts[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonPeach.rgba16.inc.c" +}; + +/* @warning array oob func_80086074 */ +u16 d_tlut_rainbow_road_neon_luigi[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonLuigi.rgba16.inc.c" +}; + +/* @warning array oob func_80086074 */ +u16 d_tlut_rainbow_road_neon_dk[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonDonkeyKong.rgba16.inc.c" +}; + +/* @warning array oob func_80086074 */ +u16 d_tlut_rainbow_road_neon_yoshi[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonYoshi.rgba16.inc.c" +}; + +/* @warning array oob func_80086074 */ +u16 d_tlut_rainbow_road_neon_bowser[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonBowser.rgba16.inc.c" +}; + +/* @warning array oob func_80086074 */ +u16 d_tlut_rainbow_road_neon_wario[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonWario.rgba16.inc.c" +}; + +/* @warning array oob func_80086074 */ +u16 d_tlut_rainbow_road_neon_toad[] = { +#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonToad.rgba16.inc.c" }; u8 d_course_rainbow_road_neon_mushroom[] = { diff --git a/courses/rainbow_road/course_data.h b/courses/rainbow_road/course_data.h index c7ff57584c..d69e8f5dec 100644 --- a/courses/rainbow_road/course_data.h +++ b/courses/rainbow_road/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "animation.h" @@ -58,12 +58,12 @@ extern Gfx d_course_rainbow_road_dl_17D0[]; extern Gfx d_course_rainbow_road_dl_1878[]; extern Gfx d_course_rainbow_road_dl_18D0[]; extern Gfx d_course_rainbow_road_dl_1948[]; -extern TrackWaypoint d_course_rainbow_road_unknown_waypoints[]; -extern TrackWaypoint d_course_rainbow_road_track_waypoints[]; +extern TrackPathPoint d_course_rainbow_road_unknown_path[]; +extern TrackPathPoint d_course_rainbow_road_track_path[]; extern u8 d_course_rainbow_road_neon_mushroom_tlut_list[][512]; extern u8 d_course_rainbow_road_neon_mario_tlut_list[][512]; extern u8 d_course_rainbow_road_neon_boo_tlut_list[][512]; -extern u8 d_course_rainbow_road_static_tluts[][512]; +extern u16 d_course_rainbow_road_static_tluts[]; extern u8 d_course_rainbow_road_neon_mushroom[]; extern u8 d_course_rainbow_road_neon_mario[]; extern u8 d_course_rainbow_road_neon_boo[]; diff --git a/courses/royal_raceway/course_data.c b/courses/royal_raceway/course_data.c index 6ed835ffd0..53e2c925c2 100644 --- a/courses/royal_raceway/course_data.c +++ b/courses/royal_raceway/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -4902,7 +4902,7 @@ Gfx d_course_royal_raceway_dl_B508[] = { }; // 0xB5B8 -TrackWaypoint d_course_royal_raceway_unknown_waypoints[] = { +TrackPathPoint d_course_royal_raceway_unknown_path[] = { { -63, 0, -321, 0 }, { -61, 0, -341, 0 }, { -60, 0, -591, 0 }, { -64, 0, -1334, 0 }, { -64, 0, -1761, 0 }, { -80, 0, -1851, 0 }, { -155, 0, -1949, 0 }, { -339, 0, -2075, 0 }, { -694, 0, -2315, 0 }, { -874, 0, -2417, 0 }, { -998, 0, -2434, 0 }, { -1134, 0, -2399, 0 }, @@ -4925,7 +4925,7 @@ TrackWaypoint d_course_royal_raceway_unknown_waypoints[] = { { -62, 0, -296, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_royal_raceway_track_waypoints[] = { +TrackPathPoint d_course_royal_raceway_track_path[] = { { -62, 0, -331, 1 }, { -61, 0, -350, 2 }, { -61, 0, -371, 2 }, { -60, 0, -391, 2 }, { -60, 0, -411, 2 }, { -60, 0, -431, 2 }, { -60, 0, -451, 2 }, { -60, 0, -471, 2 }, { -60, 0, -491, 2 }, diff --git a/courses/royal_raceway/course_data.h b/courses/royal_raceway/course_data.h index 3f73254244..68a78be34e 100644 --- a/courses/royal_raceway/course_data.h +++ b/courses/royal_raceway/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_royal_raceway_dl_0[]; @@ -139,8 +139,8 @@ extern Gfx d_course_royal_raceway_dl_B230[]; extern Gfx d_course_royal_raceway_dl_B2E0[]; extern Gfx d_course_royal_raceway_dl_B3E8[]; extern Gfx d_course_royal_raceway_dl_B508[]; -extern TrackWaypoint d_course_royal_raceway_unknown_waypoints[]; -extern TrackWaypoint d_course_royal_raceway_track_waypoints[]; +extern TrackPathPoint d_course_royal_raceway_unknown_path[]; +extern TrackPathPoint d_course_royal_raceway_track_path[]; extern Vtx d_course_royal_raceway_tree_model[]; extern Gfx d_course_royal_raceway_dl_tree[]; extern Vtx d_royal_raceway_peaches_castle_tree_model[]; diff --git a/courses/sherbet_land/course_data.c b/courses/sherbet_land/course_data.c index a72089ac07..bfba0c64c6 100644 --- a/courses/sherbet_land/course_data.c +++ b/courses/sherbet_land/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -2838,7 +2838,7 @@ Gfx d_course_sherbet_land_dl_4B20[] = { }; // unk 0x4BF8 -TrackWaypoint d_course_sherbet_land_unknown_waypoints[] = { +TrackPathPoint d_course_sherbet_land_unknown_path[] = { { -10, 0, 10, 0 }, { -10, 0, -8, 0 }, { -18, 0, -213, 0 }, { 52, 0, -308, 0 }, { 217, 0, -455, 0 }, { 436, 0, -587, 0 }, { 487, 0, -649, 0 }, { 465, 0, -722, 0 }, { 308, 0, -890, 0 }, { 132, 0, -1099, 0 }, { 37, 0, -1319, 0 }, { 31, 0, -1396, 0 }, @@ -2857,7 +2857,7 @@ TrackWaypoint d_course_sherbet_land_unknown_waypoints[] = { { -2058, 0, 1043, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_sherbet_land_track_waypoints[] = { +TrackPathPoint d_course_sherbet_land_track_path[] = { { -10, 0, 1, 1 }, { -10, 0, -19, 1 }, { -11, 0, -38, 1 }, { -12, 0, -58, 1 }, { -12, 0, -78, 1 }, { -13, 0, -98, 1 }, { -14, 0, -118, 1 }, { -14, 0, -139, 1 }, { -13, 0, -159, 1 }, diff --git a/courses/sherbet_land/course_data.h b/courses/sherbet_land/course_data.h index 51c8f0e350..8fefcca1e9 100644 --- a/courses/sherbet_land/course_data.h +++ b/courses/sherbet_land/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "animation.h" @@ -152,8 +152,8 @@ extern Gfx d_course_sherbet_land_dl_4930[]; extern Gfx d_course_sherbet_land_dl_4A20[]; extern Gfx d_course_sherbet_land_dl_4A98[]; extern Gfx d_course_sherbet_land_dl_4B20[]; -extern TrackWaypoint d_course_sherbet_land_unknown_waypoints[]; -extern TrackWaypoint d_course_sherbet_land_track_waypoints[]; +extern TrackPathPoint d_course_sherbet_land_unknown_path[]; +extern TrackPathPoint d_course_sherbet_land_track_path[]; extern Vtx d_course_sherbet_land_model1[]; extern Vtx d_course_sherbet_land_model2[]; extern Vtx d_course_sherbet_land_model3[]; diff --git a/courses/toads_turnpike/course_data.c b/courses/toads_turnpike/course_data.c index ef11cb18f7..e371c4bb24 100644 --- a/courses/toads_turnpike/course_data.c +++ b/courses/toads_turnpike/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -1659,7 +1659,7 @@ Gfx d_course_toads_turnpike_dl_3AD8[] = { }; // 0x3B80 -TrackWaypoint d_course_toads_turnpike_unknown_waypoints[] = { +TrackPathPoint d_course_toads_turnpike_unknown_path[] = { { 100, 0, 26, 0 }, { 100, 0, 7, 0 }, { 102, 0, -299, 0 }, { 88, 0, -601, 0 }, { 76, 0, -897, 0 }, { 78, 0, -1946, 0 }, { 64, 0, -2260, 0 }, { 5, 0, -2490, 0 }, { -116, 0, -2706, 0 }, { -279, 0, -2886, 0 }, { -481, 0, -3017, 0 }, { -706, 0, -3099, 0 }, @@ -1676,7 +1676,7 @@ TrackWaypoint d_course_toads_turnpike_unknown_waypoints[] = { { 98, 0, 50, 0 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_toads_turnpike_track_waypoints[] = { +TrackPathPoint d_course_toads_turnpike_track_path[] = { { 100, 0, 16, 1 }, { 100, 0, -3, 1 }, { 100, 0, -23, 1 }, diff --git a/courses/toads_turnpike/course_data.h b/courses/toads_turnpike/course_data.h index 2fd62526ce..d86b4fd68e 100644 --- a/courses/toads_turnpike/course_data.h +++ b/courses/toads_turnpike/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_toads_turnpike_dl_0[]; @@ -89,8 +89,8 @@ extern Gfx d_course_toads_turnpike_dl_37F0[]; extern Gfx d_course_toads_turnpike_dl_3910[]; extern Gfx d_course_toads_turnpike_dl_39C8[]; extern Gfx d_course_toads_turnpike_dl_3AD8[]; -extern TrackWaypoint d_course_toads_turnpike_unknown_waypoints[]; -extern TrackWaypoint d_course_toads_turnpike_track_waypoints[]; +extern TrackPathPoint d_course_toads_turnpike_unknown_path[]; +extern TrackPathPoint d_course_toads_turnpike_track_path[]; extern u8 d_course_toads_turnpike_unk_windshield1[]; extern u8 d_course_toads_turnpike_unk_windshield2[]; extern u8 d_course_toads_turnpike_truck_box1[]; diff --git a/courses/wario_stadium/course_data.c b/courses/wario_stadium/course_data.c index 33767216a4..b72503024a 100644 --- a/courses/wario_stadium/course_data.c +++ b/courses/wario_stadium/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -2256,7 +2256,7 @@ Gfx d_course_wario_stadium_dl_5588[] = { }; // 0x56A0 -TrackWaypoint d_course_wario_stadium_unknown_waypoints[] = { +TrackPathPoint d_course_wario_stadium_unknown_path[] = { { 16, 0, 7, 0 }, { 11, 0, -25, 0 }, { 8, 0, -227, 0 }, { 6, 0, -674, 0 }, { -3, 0, -1560, 0 }, { -121, 0, -1883, 0 }, { -430, 0, -2100, 0 }, { -790, 0, -2160, 0 }, { -1487, 0, -2155, 0 }, { -2171, 0, -2139, 0 }, { -2522, 0, -2014, 0 }, { -2757, 0, -1691, 0 }, @@ -2279,7 +2279,7 @@ TrackWaypoint d_course_wario_stadium_unknown_waypoints[] = { { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_wario_stadium_track_waypoints[] = { +TrackPathPoint d_course_wario_stadium_track_path[] = { { 13, 0, -9, 1 }, { 11, 0, -28, 1 }, { 11, 0, -48, 1 }, { 10, 0, -68, 1 }, { 10, 0, -88, 1 }, { 9, 0, -108, 1 }, { 9, 0, -128, 1 }, { 9, 0, -148, 1 }, { 8, 0, -168, 1 }, diff --git a/courses/wario_stadium/course_data.h b/courses/wario_stadium/course_data.h index 1fc5d7515f..1ef5a79cf7 100644 --- a/courses/wario_stadium/course_data.h +++ b/courses/wario_stadium/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include extern Gfx d_course_wario_stadium_dl_0[]; @@ -115,8 +115,8 @@ extern Gfx d_course_wario_stadium_dl_5338[]; extern Gfx d_course_wario_stadium_dl_5460[]; extern Gfx d_course_wario_stadium_dl_54E8[]; extern Gfx d_course_wario_stadium_dl_5588[]; -extern TrackWaypoint d_course_wario_stadium_unknown_waypoints[]; -extern TrackWaypoint d_course_wario_stadium_track_waypoints[]; +extern TrackPathPoint d_course_wario_stadium_unknown_path[]; +extern TrackPathPoint d_course_wario_stadium_track_path[]; extern Vtx d_course_wario_stadium_sign_head_model1[]; extern Vtx d_course_wario_stadium_sign_head_model2[]; extern Vtx d_course_wario_stadium_sign_head_model3[]; diff --git a/courses/yoshi_valley/course_data.c b/courses/yoshi_valley/course_data.c index 6526c89956..aa70323fe8 100644 --- a/courses/yoshi_valley/course_data.c +++ b/courses/yoshi_valley/course_data.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -5644,7 +5644,7 @@ Gfx d_course_yoshi_valley_dl_D540[] = { }; // 0xD780 -TrackWaypoint d_course_yoshi_valley_unknown_waypoints[] = { +TrackPathPoint d_course_yoshi_valley_unknown_path[] = { { -3, 0, -4, 0 }, { -3, 0, -20, 0 }, { -3, 0, -261, 0 }, { -18, 0, -642, 0 }, { -62, 0, -955, 0 }, { -155, 0, -1297, 0 }, { -232, 0, -1502, 0 }, { -317, 0, -1596, 0 }, { -432, 0, -1625, 0 }, { -554, 0, -1619, 0 }, { -765, 0, -1542, 0 }, { -1069, 0, -1409, 0 }, @@ -5666,7 +5666,7 @@ TrackWaypoint d_course_yoshi_valley_unknown_waypoints[] = { { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_yoshi_valley_unknown_waypoints_2[] = { +TrackPathPoint d_course_yoshi_valley_unknown_path_2[] = { { -6, 0, -5, 1 }, { -6, 0, -21, 1 }, { -5, 0, -434, 1 }, { -37, 0, -841, 1 }, { -150, 0, -1267, 1 }, { -228, 0, -1498, 1 }, { -328, 0, -1603, 1 }, { -439, 0, -1627, 1 }, { -548, 0, -1621, 1 }, { -759, 0, -1544, 1 }, { -1078, 0, -1402, 1 }, { -1207, 0, -1400, 1 }, @@ -5688,7 +5688,7 @@ TrackWaypoint d_course_yoshi_valley_unknown_waypoints_2[] = { { -2, 0, 33, 1 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_yoshi_valley_unknown_waypoints_3[] = { +TrackPathPoint d_course_yoshi_valley_unknown_path_3[] = { { -3, 0, -3, 4 }, { -3, 0, -19, 4 }, { 0, 0, -268, 4 }, { -21, 0, -638, 4 }, { -66, 0, -952, 4 }, { -162, 0, -1297, 4 }, { -232, 0, -1502, 4 }, { -318, 0, -1594, 4 }, { -434, 0, -1624, 4 }, { -562, 0, -1612, 4 }, { -768, 0, -1547, 4 }, { -1081, 0, -1412, 4 }, @@ -5712,7 +5712,7 @@ TrackWaypoint d_course_yoshi_valley_unknown_waypoints_3[] = { { -6, 0, 21, 4 }, { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_yoshi_valley_unknown_waypoints_4[] = { +TrackPathPoint d_course_yoshi_valley_unknown_path_4[] = { { -2, 0, -1, 7 }, { 0, 0, -18, 7 }, { -2, 0, -268, 7 }, { -21, 0, -653, 7 }, { -70, 0, -965, 7 }, { -162, 0, -1303, 7 }, { -235, 0, -1506, 7 }, { -324, 0, -1596, 7 }, { -438, 0, -1624, 7 }, { -571, 0, -1611, 7 }, { -773, 0, -1533, 7 }, { -1077, 0, -1399, 7 }, @@ -5737,7 +5737,7 @@ TrackWaypoint d_course_yoshi_valley_unknown_waypoints_4[] = { { -32768, 0, 0, 0 }, }; -TrackWaypoint d_course_yoshi_valley_track_waypoints[] = { +TrackPathPoint d_course_yoshi_valley_track_path[] = { { -3, 180, -12, 1 }, { -3, 180, -32, 2 }, { -3, 180, -52, 2 }, { -2, 180, -72, 2 }, { -3, 180, -92, 2 }, { -3, 180, -112, 2 }, { -3, 180, -132, 2 }, { -3, 180, -152, 2 }, { -3, 180, -172, 2 }, @@ -5966,7 +5966,7 @@ TrackWaypoint d_course_yoshi_valley_track_waypoints[] = { { -4, 180, 18, 1 }, { -3, 180, -1, 1 }, { -32768, -32768, -32768, 0 }, }; -TrackWaypoint d_course_yoshi_valley_track_waypoints_2[] = { +TrackPathPoint d_course_yoshi_valley_track_path_2[] = { { -6, 180, -13, 1 }, { -5, 180, -33, 2 }, { -5, 180, -53, 2 }, @@ -6636,7 +6636,7 @@ TrackWaypoint d_course_yoshi_valley_track_waypoints_2[] = { { -32768, -32768, -32768, 0 }, }; -TrackWaypoint d_course_yoshi_valley_track_waypoints_3[] = { +TrackPathPoint d_course_yoshi_valley_track_path_3[] = { { -3, 180, -11, 1 }, { -2, 180, -31, 2 }, { -2, 180, -51, 2 }, @@ -7318,7 +7318,7 @@ TrackWaypoint d_course_yoshi_valley_track_waypoints_3[] = { { -32768, -32768, -32768, 0 }, }; -TrackWaypoint d_course_yoshi_valley_track_waypoints_4[] = { +TrackPathPoint d_course_yoshi_valley_track_path_4[] = { { -1, 180, -9, 1 }, { 0, 180, -29, 2 }, { 0, 180, -49, 2 }, diff --git a/courses/yoshi_valley/course_data.h b/courses/yoshi_valley/course_data.h index 2497ceee67..f37906b3be 100644 --- a/courses/yoshi_valley/course_data.h +++ b/courses/yoshi_valley/course_data.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "animation.h" @@ -133,14 +133,14 @@ extern Gfx d_course_yoshi_valley_dl_D018[]; extern Gfx d_course_yoshi_valley_dl_D1E8[]; extern Gfx d_course_yoshi_valley_dl_D3D0[]; extern Gfx d_course_yoshi_valley_dl_D540[]; -extern TrackWaypoint d_course_yoshi_valley_unknown_waypoints[]; -extern TrackWaypoint d_course_yoshi_valley_unknown_waypoints_2[]; -extern TrackWaypoint d_course_yoshi_valley_unknown_waypoints_3[]; -extern TrackWaypoint d_course_yoshi_valley_unknown_waypoints_4[]; -extern TrackWaypoint d_course_yoshi_valley_track_waypoints[]; -extern TrackWaypoint d_course_yoshi_valley_track_waypoints_2[]; -extern TrackWaypoint d_course_yoshi_valley_track_waypoints_3[]; -extern TrackWaypoint d_course_yoshi_valley_track_waypoints_4[]; +extern TrackPathPoint d_course_yoshi_valley_unknown_path[]; +extern TrackPathPoint d_course_yoshi_valley_unknown_path_2[]; +extern TrackPathPoint d_course_yoshi_valley_unknown_path_3[]; +extern TrackPathPoint d_course_yoshi_valley_unknown_path_4[]; +extern TrackPathPoint d_course_yoshi_valley_track_path[]; +extern TrackPathPoint d_course_yoshi_valley_track_path_2[]; +extern TrackPathPoint d_course_yoshi_valley_track_path_3[]; +extern TrackPathPoint d_course_yoshi_valley_track_path_4[]; extern Lights1 d_course_yoshi_valley_unknown_light1; extern Lights1 d_course_yoshi_valley_unknown_light2; extern Lights1 d_course_yoshi_valley_unknown_light3; diff --git a/ctx_includes.c b/ctx_includes.c deleted file mode 100644 index 22815c0f35..0000000000 --- a/ctx_includes.c +++ /dev/null @@ -1,122 +0,0 @@ -#include "courses/all_course_data.h" -#include "courses/all_course_packed.h" -#include "include/actor_types.h" -#include "include/bomb_kart.h" -#include "include/common_structs.h" -#include "include/config.h" -#include "include/course_offsets.h" -#include "include/decode.h" -#include "include/defines.h" -#include "include/kart_attributes.h" -#include "include/libc/math.h" -#include "include/libc/stdarg.h" -#include "include/libc/stddef.h" -#include "include/libc/stdio.h" -#include "include/libc/stdlib.h" -#include "include/libc/string.h" -#include "include/macros.h" -#include "include/objects.h" -#include "include/PR/abi.h" -#include "include/PR/gbi.h" -#include "include/PR/gs2dex.h" -#include "include/PR/gu.h" -#include "include/PR/libaudio.h" -#include "include/PR/libultra.h" -#include "include/PR/mbi.h" -#include "include/PR/os.h" -#include "include/PR/os_ai.h" -#include "include/PR/os_cache.h" -#include "include/PR/os_cont.h" -#include "include/PR/os_eeprom.h" -#include "include/PR/os_exception.h" -#include "include/PR/os_internal.h" -#include "include/PR/os_libc.h" -#include "include/PR/os_message.h" -#include "include/PR/os_misc.h" -#include "include/PR/os_pi.h" -#include "include/PR/os_rdp.h" -#include "include/PR/os_thread.h" -#include "include/PR/os_time.h" -#include "include/PR/os_tlb.h" -#include "include/PR/os_vi.h" -#include "include/PR/R4300.h" -#include "include/PR/rcp.h" -#include "include/PR/sptask.h" -#include "include/PR/ucode.h" -#include "include/PR/ultratypes.h" -#include "include/save_data.h" -#include "include/segments.h" -#include "include/sounds.h" -#include "include/types.h" -#include "include/ultra64.h" -#include "include/vehicles.h" -#include "include/waypoints.h" -#include "src/audio/data.h" -#include "src/audio/effects.h" -#include "src/audio/external.h" -#include "src/audio/heap.h" -#include "src/audio/internal.h" -#include "src/audio/load.h" -#include "src/audio/playback.h" -#include "src/audio/port_eu.h" -#include "src/audio/seqplayer.h" -#include "src/audio/synthesis.h" -#include "src/buffers.h" -#include "src/camera.h" -#include "src/camera_junk.h" -#include "src/code_800029B0.h" -#include "src/animation.h" -#include "src/code_80005FD0.h" -#include "src/code_8003DC40.h" -#include "src/code_80057C60.h" -#include "src/code_8006E9C0.h" -#include "src/update_objects.h" -#include "src/code_80086E70.h" -#include "src/code_80091440.h" -#include "src/code_80091750.h" -#include "src/code_800AF9B0.h" -#include -#include -#include -#include "src/data/some_data.h" -#include "src/data/path_spawn_metadata.h" -#include "src/buffers/trig_tables.h" -#include "src/data_segment2.h" -#include "src/effects.h" -#include "src/ending/ceremony_and_credits.h" -#include "src/ending/code_80280000.h" -#include "src/ending/code_80281780.h" -#include "src/ending/code_80281C40.h" -#include "src/ending/credits.h" -#include "src/ending/podium_ceremony_actors.h" -#include "src/render_objects.h" -#include "src/kart_dma.h" -#include "src/main.h" -#include "src/math_util_2.h" -#include "src/menus.h" -#include "src/os/bstring.h" -#include "src/os/controller.h" -#include "src/os/hardware.h" -#include "src/os/libaudio_internal.h" -#include "src/os/libultra_internal.h" -#include "src/os/new_func.h" -#include "src/os/osAi.h" -#include "src/os/osContInternal.h" -#include "src/os/osint.h" -#include "src/os/piint.h" -#include "src/os/printf.h" -#include "src/player_controller.h" -#include "src/profiler.h" -#include "src/racing/actors.h" -#include "src/racing/actors_extended.h" -#include "src/racing/collision.h" -#include "src/racing/math_util.h" -#include "src/racing/memory.h" -#include "src/racing/race_logic.h" -#include "src/racing/render_courses.h" -#include "src/racing/skybox_and_splitscreen.h" -#include "src/render_player.h" -#include "src/save.h" -#include "src/spawn_players.h" -#include "src/staff_ghosts.h" -#include "src/textures.h" diff --git a/data/course_player_selection.s b/data/course_player_selection.s index bf868d526e..fb5b72c968 100644 --- a/data/course_player_selection.s +++ b/data/course_player_selection.s @@ -798,11 +798,11 @@ glabel gTextureCupBronze glabel gTextureCupBronze_end .align 2, 0x00 -glabel gTexturePushStartButton +glabel push_start_button .incbin "textures/raw/push_start_button.rgba16" .align 2, 0x00 -glabel gTextureCopyright1996 +glabel copyright_1996 .incbin "textures/raw/copyright_1996.rgba16" .align 2, 0x00 @@ -822,7 +822,7 @@ glabel gTextureP4BorderGreen .incbin "textures/raw/p4_border_green.rgba16" .align 2, 0x00 -glabel gTextureSmallGreenTriangle +glabel texture_small_green_triangle .incbin "textures/raw/small_green_triangle.rgba16" .align 2, 0x00 diff --git a/data/other_textures.h b/data/other_textures.h index 6a258fc898..b23e626a38 100644 --- a/data/other_textures.h +++ b/data/other_textures.h @@ -286,22 +286,22 @@ extern u8 gTexture68D834[]; extern u8 gTexture68D940[]; extern u8 gTexture68DEC0[]; extern u8 gTexture68E2D0[]; -extern u8 gTextureGreenShell0[]; -extern u8 gTextureGreenShell1[]; -extern u8 gTextureGreenShell2[]; -extern u8 gTextureGreenShell3[]; -extern u8 gTextureGreenShell4[]; -extern u8 gTextureGreenShell5[]; -extern u8 gTextureGreenShell6[]; -extern u8 gTextureGreenShell7[]; -extern u8 gTextureBlueShell0[]; -extern u8 gTextureBlueShell1[]; -extern u8 gTextureBlueShell2[]; -extern u8 gTextureBlueShell3[]; -extern u8 gTextureBlueShell4[]; -extern u8 gTextureBlueShell5[]; -extern u8 gTextureBlueShell6[]; -extern u8 gTextureBlueShell7[]; +extern u8 texture_green_shell_0[]; +extern u8 texture_green_shell_1[]; +extern u8 texture_green_shell_2[]; +extern u8 texture_green_shell_3[]; +extern u8 texture_green_shell_4[]; +extern u8 texture_green_shell_5[]; +extern u8 texture_green_shell_6[]; +extern u8 texture_green_shell_7[]; +extern u8 texture_blue_shell_0[]; +extern u8 texture_blue_shell_1[]; +extern u8 texture_blue_shell_2[]; +extern u8 texture_blue_shell_3[]; +extern u8 texture_blue_shell_4[]; +extern u8 texture_blue_shell_5[]; +extern u8 texture_blue_shell_6[]; +extern u8 texture_blue_shell_7[]; extern u8 gTextureQuestionMarkYellow[]; extern u8 gTextureTrees1[]; extern u8 gTextureTrees2[]; @@ -354,16 +354,16 @@ extern u8 gTextureDksJungleParkwayKiwanoFruit3[]; extern u8 gTextureKartShadow[]; extern u8 gTexture69B03C[]; extern u8 gTexture69B140[]; -extern u8 gTexture69B378[]; -extern u8 gTexture69B960[]; -extern u8 gTexture69BA28[]; +extern u8 gGrassParticle[]; +extern u8 gTextureMusicNote[]; +extern u8 gTextureSpeechBubble[]; extern u8 gTextureBoingExclamation[]; extern u8 gTexture69BE6C[]; extern u8 gTexture69BF54[]; extern u8 gTexture69C090[]; extern u8 gTexture69C1E8[]; -extern u8 gTexture69C354[]; -extern u8 gTexture69C4E4[]; +extern u8 gTextureSmokePuff[]; +extern u8 gGroundDust[]; extern u8 gTexture69C80C[]; extern u8 gTexture69C9C4[]; extern u8 gTexture69CB84[]; @@ -514,26 +514,26 @@ extern u8 gTextureExhaust2[]; extern u8 gTextureExhaust3[]; extern u8 gTextureExhaust4[]; extern u8 gTextureExhaust5[]; -extern u8 gTextureLogoMarioKart64[]; -extern u8 gTextureCourseOutlineMarioRaceway[]; -extern u8 gTextureCourseOutlineChocoMountain[]; -extern u8 gTextureCourseOutlineBowsersCastle[]; -extern u8 gTextureCourseOutlineBansheeBoardwalk[]; -extern u8 gTextureCourseOutlineYoshiValley[]; -extern u8 gTextureCourseOutlineFrappeSnowland[]; -extern u8 gTextureCourseOutlineKoopaTroopaBeach[]; -extern u8 gTextureCourseOutlineRoyalRaceway[]; -extern u8 gTextureCourseOutlineLuigiRaceway[]; -extern u8 gTextureCourseOutlineMooMooFarm[]; -extern u8 gTextureCourseOutlineToadsTurnpike[]; -extern u8 gTextureCourseOutlineKalimariDesert[]; -extern u8 gTextureCourseOutlineSherbetLand[]; -extern u8 gTextureCourseOutlineRainbowRoad[]; -extern u8 gTextureCourseOutlineWarioStadium[]; -extern u8 gTextureCourseOutlineBlockFort[]; -extern u8 gTextureCourseOutlineSkyscraper[]; -extern u8 gTextureCourseOutlineDoubleDeck[]; -extern u8 gTextureCourseOutlineDksJungleParkway[]; -extern u8 gTextureCourseOutlineBigDonut[]; +extern u8 logo_mario_kart_64[]; +extern u8 minimap_mario_raceway[]; +extern u8 minimap_choco_mountain[]; +extern u8 minimap_bowsers_castle[]; +extern u8 minimap_banshee_boardwalk[]; +extern u8 minimap_yoshi_valley[]; +extern u8 minimap_frappe_snowland[]; +extern u8 minimap_koopa_troopa_beach[]; +extern u8 minimap_royal_raceway[]; +extern u8 minimap_luigi_raceway[]; +extern u8 minimap_moo_moo_farm[]; +extern u8 minimap_toads_turnpike[]; +extern u8 minimap_kalimari_desert[]; +extern u8 minimap_sherbet_land[]; +extern u8 minimap_rainbow_road[]; +extern u8 minimap_wario_stadium[]; +extern u8 minimap_block_fort[]; +extern u8 minimap_skyscraper[]; +extern u8 minimap_double_deck[]; +extern u8 minimap_dks_jungle_parkway[]; +extern u8 minimap_big_donut[]; #endif diff --git a/data/other_textures.s b/data/other_textures.s index 93f4fa0ee9..31670f1988 100644 --- a/data/other_textures.s +++ b/data/other_textures.s @@ -1148,68 +1148,68 @@ glabel gTexture68E2D0 .incbin "textures/standalone/texture_68E2D0.rgba16.mio0" .balign 4, 0x00 -glabel gTextureGreenShell0 -.incbin "assets/greenshell/gTextureGreenShell0.mio0" +glabel texture_green_shell_0 +.incbin "assets/greenshell/texture_green_shell_0.mio0" .balign 4, 0x00 -glabel gTextureGreenShell1 -.incbin "assets/greenshell/gTextureGreenShell1.mio0" +glabel texture_green_shell_1 +.incbin "assets/greenshell/texture_green_shell_1.mio0" .balign 4, 0x00 -glabel gTextureGreenShell2 -.incbin "assets/greenshell/gTextureGreenShell2.mio0" +glabel texture_green_shell_2 +.incbin "assets/greenshell/texture_green_shell_2.mio0" .balign 4, 0x00 -glabel gTextureGreenShell3 -.incbin "assets/greenshell/gTextureGreenShell3.mio0" +glabel texture_green_shell_3 +.incbin "assets/greenshell/texture_green_shell_3.mio0" .balign 4, 0x00 -glabel gTextureGreenShell4 -.incbin "assets/greenshell/gTextureGreenShell4.mio0" +glabel texture_green_shell_4 +.incbin "assets/greenshell/texture_green_shell_4.mio0" .balign 4, 0x00 -glabel gTextureGreenShell5 -.incbin "assets/greenshell/gTextureGreenShell5.mio0" +glabel texture_green_shell_5 +.incbin "assets/greenshell/texture_green_shell_5.mio0" .balign 4, 0x00 -glabel gTextureGreenShell6 -.incbin "assets/greenshell/gTextureGreenShell6.mio0" +glabel texture_green_shell_6 +.incbin "assets/greenshell/texture_green_shell_6.mio0" .balign 4, 0x00 -glabel gTextureGreenShell7 -.incbin "assets/greenshell/gTextureGreenShell7.mio0" +glabel texture_green_shell_7 +.incbin "assets/greenshell/texture_green_shell_7.mio0" .balign 4, 0x00 -glabel gTextureBlueShell0 -.incbin "assets/blueshell/gTextureBlueShell0.mio0" +glabel texture_blue_shell_0 +.incbin "assets/blueshell/texture_blue_shell_0.mio0" .balign 4, 0x00 -glabel gTextureBlueShell1 -.incbin "assets/blueshell/gTextureBlueShell1.mio0" +glabel texture_blue_shell_1 +.incbin "assets/blueshell/texture_blue_shell_1.mio0" .balign 4, 0x00 -glabel gTextureBlueShell2 -.incbin "assets/blueshell/gTextureBlueShell2.mio0" +glabel texture_blue_shell_2 +.incbin "assets/blueshell/texture_blue_shell_2.mio0" .balign 4, 0x00 -glabel gTextureBlueShell3 -.incbin "assets/blueshell/gTextureBlueShell3.mio0" +glabel texture_blue_shell_3 +.incbin "assets/blueshell/texture_blue_shell_3.mio0" .balign 4, 0x00 -glabel gTextureBlueShell4 -.incbin "assets/blueshell/gTextureBlueShell4.mio0" +glabel texture_blue_shell_4 +.incbin "assets/blueshell/texture_blue_shell_4.mio0" .balign 4, 0x00 -glabel gTextureBlueShell5 -.incbin "assets/blueshell/gTextureBlueShell5.mio0" +glabel texture_blue_shell_5 +.incbin "assets/blueshell/texture_blue_shell_5.mio0" .balign 4, 0x00 -glabel gTextureBlueShell6 -.incbin "assets/blueshell/gTextureBlueShell6.mio0" +glabel texture_blue_shell_6 +.incbin "assets/blueshell/texture_blue_shell_6.mio0" .balign 4, 0x00 -glabel gTextureBlueShell7 -.incbin "assets/blueshell/gTextureBlueShell7.mio0" +glabel texture_blue_shell_7 +.incbin "assets/blueshell/texture_blue_shell_7.mio0" .balign 4, 0x00 glabel gTextureQuestionMarkYellow @@ -1420,15 +1420,15 @@ glabel gTexture69B140 .incbin "textures/standalone/texture_69B140.i8.mio0" .balign 4, 0x00 -glabel gTexture69B378 -.incbin "textures/standalone/texture_69B378.rgba16.mio0" +glabel gGrassParticle +.incbin "textures/standalone/gGrassParticle.rgba16.mio0" .balign 4, 0x00 -glabel gTexture69B960 +glabel gTextureMusicNote .incbin "textures/standalone/texture_69B960.i8.mio0" .balign 4, 0x00 -glabel gTexture69BA28 +glabel gTextureSpeechBubble .incbin "textures/standalone/texture_69BA28.i8.mio0" .balign 4, 0x00 @@ -1452,12 +1452,12 @@ glabel gTexture69C1E8 .incbin "textures/standalone/texture_69C1E8.ia16.mio0" .balign 4, 0x00 -glabel gTexture69C354 +glabel gTextureSmokePuff .incbin "textures/standalone/texture_69C354.ia8.mio0" .balign 4, 0x00 -glabel gTexture69C4E4 -.incbin "textures/standalone/texture_69C4E4.i8.mio0" +glabel gGroundDust +.incbin "textures/standalone/gGroundDust.i8.mio0" .balign 4, 0x00 glabel gTexture69C80C @@ -2060,85 +2060,85 @@ glabel gTextureExhaust5 .incbin "textures/standalone/exhaust_5.ia8.mio0" .balign 4, 0x00 -glabel gTextureLogoMarioKart64 +glabel logo_mario_kart_64 .incbin "textures/standalone/logo_mario_kart_64.rgba32.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineMarioRaceway -.incbin "assets/course_outlines/gTextureCourseOutlineMarioRaceway.mio0" +glabel minimap_mario_raceway +.incbin "assets/course_outlines/minimap_mario_raceway.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineChocoMountain -.incbin "assets/course_outlines/gTextureCourseOutlineChocoMountain.mio0" +glabel minimap_choco_mountain +.incbin "assets/course_outlines/minimap_choco_mountain.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineBowsersCastle -.incbin "assets/course_outlines/gTextureCourseOutlineBowsersCastle.mio0" +glabel minimap_bowsers_castle +.incbin "assets/course_outlines/minimap_bowsers_castle.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineBansheeBoardwalk -.incbin "assets/course_outlines/gTextureCourseOutlineBansheeBoardwalk.mio0" +glabel minimap_banshee_boardwalk +.incbin "assets/course_outlines/minimap_banshee_boardwalk.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineYoshiValley -.incbin "assets/course_outlines/gTextureCourseOutlineYoshiValley.mio0" +glabel minimap_yoshi_valley +.incbin "assets/course_outlines/minimap_yoshi_valley.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineFrappeSnowland -.incbin "assets/course_outlines/gTextureCourseOutlineFrappeSnowland.mio0" +glabel minimap_frappe_snowland +.incbin "assets/course_outlines/minimap_frappe_snowland.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineKoopaTroopaBeach -.incbin "assets/course_outlines/gTextureCourseOutlineKoopaTroopaBeach.mio0" +glabel minimap_koopa_troopa_beach +.incbin "assets/course_outlines/minimap_koopa_troopa_beach.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineRoyalRaceway -.incbin "assets/course_outlines/gTextureCourseOutlineRoyalRaceway.mio0" +glabel minimap_royal_raceway +.incbin "assets/course_outlines/minimap_royal_raceway.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineLuigiRaceway -.incbin "assets/course_outlines/gTextureCourseOutlineLuigiRaceway.mio0" +glabel minimap_luigi_raceway +.incbin "assets/course_outlines/minimap_luigi_raceway.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineMooMooFarm -.incbin "assets/course_outlines/gTextureCourseOutlineMooMooFarm.mio0" +glabel minimap_moo_moo_farm +.incbin "assets/course_outlines/minimap_moo_moo_farm.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineToadsTurnpike -.incbin "assets/course_outlines/gTextureCourseOutlineToadsTurnpike.mio0" +glabel minimap_toads_turnpike +.incbin "assets/course_outlines/minimap_toads_turnpike.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineKalimariDesert -.incbin "assets/course_outlines/gTextureCourseOutlineKalimariDesert.mio0" +glabel minimap_kalimari_desert +.incbin "assets/course_outlines/minimap_kalimari_desert.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineSherbetLand -.incbin "assets/course_outlines/gTextureCourseOutlineSherbetLand.mio0" +glabel minimap_sherbet_land +.incbin "assets/course_outlines/minimap_sherbet_land.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineRainbowRoad -.incbin "assets/course_outlines/gTextureCourseOutlineRainbowRoad.mio0" +glabel minimap_rainbow_road +.incbin "assets/course_outlines/minimap_rainbow_road.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineWarioStadium -.incbin "assets/course_outlines/gTextureCourseOutlineWarioStadium.mio0" +glabel minimap_wario_stadium +.incbin "assets/course_outlines/minimap_wario_stadium.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineBlockFort -.incbin "assets/course_outlines/gTextureCourseOutlineBlockFort.mio0" +glabel minimap_block_fort +.incbin "assets/course_outlines/minimap_block_fort.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineSkyscraper -.incbin "assets/course_outlines/gTextureCourseOutlineSkyscraper.mio0" +glabel minimap_skyscraper +.incbin "assets/course_outlines/minimap_skyscraper.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineDoubleDeck -.incbin "assets/course_outlines/gTextureCourseOutlineDoubleDeck.mio0" +glabel minimap_double_deck +.incbin "assets/course_outlines/minimap_double_deck.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineDksJungleParkway -.incbin "assets/course_outlines/gTextureCourseOutlineDksJungleParkway.mio0" +glabel minimap_dks_jungle_parkway +.incbin "assets/course_outlines/minimap_dks_jungle_parkway.mio0" .balign 4, 0x00 -glabel gTextureCourseOutlineBigDonut -.incbin "assets/course_outlines/gTextureCourseOutlineBigDonut.mio0" +glabel minimap_big_donut +.incbin "assets/course_outlines/minimap_big_donut.mio0" diff --git a/data/sound_data/audiobanks.s b/data/sound_data/audiobanks.s index b396b2412a..5cac710a02 100644 --- a/data/sound_data/audiobanks.s +++ b/data/sound_data/audiobanks.s @@ -7,7 +7,7 @@ # Audiobank data -.ifdef VERSION_EU_1_0 +.ifdef VERSION_EU_V10 .incbin "bin/audiobanks.eu.bin" .else .incbin "bin/audiobanks.us.bin" diff --git a/data/sound_data/sequences.s b/data/sound_data/sequences.s index fd7d4d8de3..824b427dea 100644 --- a/data/sound_data/sequences.s +++ b/data/sound_data/sequences.s @@ -162,5 +162,3 @@ glabel seq_1C_end glabel seq_1D .incbin "music/29_award_ceremony_4th_8th.m64" glabel seq_1D_end -# Unknown region BE90D0-BE90E0 [10] -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/data/sound_data/sequences_eu.s b/data/sound_data/sequences_eu.s index 398f18aac5..3c7de6ed4b 100644 --- a/data/sound_data/sequences_eu.s +++ b/data/sound_data/sequences_eu.s @@ -163,6 +163,5 @@ glabel seq_1C_end glabel seq_1D .incbin "music/eu/29_award_ceremony_4th_8th.m64" glabel seq_1D_end -# Unknown region BE90D0-BE90E0 [10] -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .endif diff --git a/data/texture_data_2.s b/data/texture_data_2.s index 5b61729d77..432cf3f7e3 100644 --- a/data/texture_data_2.s +++ b/data/texture_data_2.s @@ -374,7 +374,7 @@ glabel gTextureTinyFontMinus_end .align 2, 0x00 glabel gTextureTinyFontComma -.incbin "textures/standalone/tiny_font_comma.ia16.mio0" +.incbin "textures/standalone/tiny_font_dot.ia16.mio0" glabel gTextureTinyFontComma_end .align 2, 0x00 @@ -818,184 +818,184 @@ glabel gTexture7F109C glabel gTexture7F109C_end .align 2, 0x00 -glabel gTexture7F1124 -.incbin "textures/raw/7F1124.i4" +glabel font_four_dote +.incbin "textures/raw/font_four_dote.i4" .align 2, 0x00 -glabel gTexture7F11F4 -.incbin "textures/raw/7F11F4.i4" +glabel font_cc +.incbin "textures/raw/font_cc.i4" .align 2, 0x00 -glabel gTexture7F12C4 -.incbin "textures/raw/7F12C4.i4" +glabel font_double_quote +.incbin "textures/raw/font_double_quote.i4" .align 2, 0x00 -glabel gTexture7F1394 -.incbin "textures/raw/7F1394.i4" +glabel font_exclamation_mark +.incbin "textures/raw/font_exclamation_mark.i4" .align 2, 0x00 -glabel gTexture7F1464 -.incbin "textures/raw/7F1464.i4" +glabel font_minus +.incbin "textures/raw/font_minus.i4" .align 2, 0x00 -glabel gTexture7F1534 -.incbin "textures/raw/7F1534.i4" +glabel font_dot +.incbin "textures/raw/font_dot.i4" .align 2, 0x00 -glabel gTexture7F1604 -.incbin "textures/raw/7F1604.i4" +glabel font_plus +.incbin "textures/raw/font_plus.i4" .align 2, 0x00 -glabel gTexture7F16D4 -.incbin "textures/raw/7F16D4.i4" +glabel font_interogation_mark +.incbin "textures/raw/font_interogation_mark.i4" .align 2, 0x00 -glabel gTexture7F17A4 -.incbin "textures/raw/7F17A4.i4" +glabel font_simple_quote +.incbin "textures/raw/font_simple_quote.i4" .align 2, 0x00 -glabel gTexture7F1874 -.incbin "textures/raw/7F1874.i4" +glabel font_number_zero +.incbin "textures/raw/font_number_zero.i4" .align 2, 0x00 -glabel gTexture7F1944 -.incbin "textures/raw/7F1944.i4" +glabel font_number_one +.incbin "textures/raw/font_number_one.i4" .align 2, 0x00 -glabel gTexture7F1A14 -.incbin "textures/raw/7F1A14.i4" +glabel font_number_two +.incbin "textures/raw/font_number_two.i4" .align 2, 0x00 -glabel gTexture7F1AE4 -.incbin "textures/raw/7F1AE4.i4" +glabel font_number_three +.incbin "textures/raw/font_number_three.i4" .align 2, 0x00 -glabel gTexture7F1BB4 -.incbin "textures/raw/7F1BB4.i4" +glabel font_number_four +.incbin "textures/raw/font_number_four.i4" .align 2, 0x00 -glabel gTexture7F1C84 -.incbin "textures/raw/7F1C84.i4" +glabel font_number_five +.incbin "textures/raw/font_number_five.i4" .align 2, 0x00 -glabel gTexture7F1D54 -.incbin "textures/raw/7F1D54.i4" +glabel font_number_six +.incbin "textures/raw/font_number_six.i4" .align 2, 0x00 -glabel gTexture7F1E24 -.incbin "textures/raw/7F1E24.i4" +glabel font_number_seven +.incbin "textures/raw/font_number_seven.i4" .align 2, 0x00 -glabel gTexture7F1EF4 -.incbin "textures/raw/7F1EF4.i4" +glabel font_number_eight +.incbin "textures/raw/font_number_eight.i4" .align 2, 0x00 -glabel gTexture7F1FC4 -.incbin "textures/raw/7F1FC4.i4" +glabel font_number_nine +.incbin "textures/raw/font_number_nine.i4" .align 2, 0x00 -glabel gTexture7F2094 -.incbin "textures/raw/7F2094.i4" +glabel font_letter_A +.incbin "textures/raw/font_letter_A.i4" .align 2, 0x00 -glabel gTexture7F2164 -.incbin "textures/raw/7F2164.i4" +glabel font_letter_B +.incbin "textures/raw/font_letter_B.i4" .align 2, 0x00 -glabel gTexture7F2234 -.incbin "textures/raw/7F2234.i4" +glabel font_letter_C +.incbin "textures/raw/font_letter_C.i4" .align 2, 0x00 -glabel gTexture7F2304 -.incbin "textures/raw/7F2304.i4" +glabel font_letter_D +.incbin "textures/raw/font_letter_D.i4" .align 2, 0x00 -glabel gTexture7F23D4 -.incbin "textures/raw/7F23D4.i4" +glabel font_letter_E +.incbin "textures/raw/font_letter_E.i4" .align 2, 0x00 -glabel gTexture7F24A4 -.incbin "textures/raw/7F24A4.i4" +glabel font_letter_F +.incbin "textures/raw/font_letter_F.i4" .align 2, 0x00 -glabel gTexture7F2574 -.incbin "textures/raw/7F2574.i4" +glabel font_letter_G +.incbin "textures/raw/font_letter_G.i4" .align 2, 0x00 -glabel gTexture7F2644 -.incbin "textures/raw/7F2644.i4" +glabel font_letter_H +.incbin "textures/raw/font_letter_H.i4" .align 2, 0x00 -glabel gTexture7F2714 -.incbin "textures/raw/7F2714.i4" +glabel font_letter_I +.incbin "textures/raw/font_letter_I.i4" .align 2, 0x00 -glabel gTexture7F27E4 -.incbin "textures/raw/7F27E4.i4" +glabel font_letter_J +.incbin "textures/raw/font_letter_J.i4" .align 2, 0x00 -glabel gTexture7F28B4 -.incbin "textures/raw/7F28B4.i4" +glabel font_letter_K +.incbin "textures/raw/font_letter_K.i4" .align 2, 0x00 -glabel gTexture7F2984 -.incbin "textures/raw/7F2984.i4" +glabel font_letter_L +.incbin "textures/raw/font_letter_L.i4" .align 2, 0x00 -glabel gTexture7F2A54 -.incbin "textures/raw/7F2A54.i4" +glabel font_letter_M +.incbin "textures/raw/font_letter_M.i4" .align 2, 0x00 -glabel gTexture7F2B24 -.incbin "textures/raw/7F2B24.i4" +glabel font_letter_N +.incbin "textures/raw/font_letter_N.i4" .align 2, 0x00 -glabel gTexture7F2BF4 -.incbin "textures/raw/7F2BF4.i4" +glabel font_letter_O +.incbin "textures/raw/font_letter_O.i4" .align 2, 0x00 -glabel gTexture7F2CC4 -.incbin "textures/raw/7F2CC4.i4" +glabel font_letter_P +.incbin "textures/raw/font_letter_P.i4" .align 2, 0x00 -glabel gTexture7F2D94 -.incbin "textures/raw/7F2D94.i4" +glabel font_letter_Q +.incbin "textures/raw/font_letter_Q.i4" .align 2, 0x00 -glabel gTexture7F2E64 -.incbin "textures/raw/7F2E64.i4" +glabel font_letter_R +.incbin "textures/raw/font_letter_R.i4" .align 2, 0x00 -glabel gTexture7F2F34 -.incbin "textures/raw/7F2F34.i4" +glabel font_letter_S +.incbin "textures/raw/font_letter_S.i4" .align 2, 0x00 -glabel gTexture7F3004 -.incbin "textures/raw/7F3004.i4" +glabel font_letter_T +.incbin "textures/raw/font_letter_T.i4" .align 2, 0x00 -glabel gTexture7F30D4 -.incbin "textures/raw/7F30D4.i4" +glabel font_letter_U +.incbin "textures/raw/font_letter_U.i4" .align 2, 0x00 -glabel gTexture7F31A4 -.incbin "textures/raw/7F31A4.i4" +glabel font_letter_V +.incbin "textures/raw/font_letter_V.i4" .align 2, 0x00 -glabel gTexture7F3274 -.incbin "textures/raw/7F3274.i4" +glabel font_letter_W +.incbin "textures/raw/font_letter_W.i4" .align 2, 0x00 -glabel gTexture7F3344 -.incbin "textures/raw/7F3344.i4" +glabel font_letter_X +.incbin "textures/raw/font_letter_X.i4" .align 2, 0x00 -glabel gTexture7F3414 -.incbin "textures/raw/7F3414.i4" +glabel font_letter_Y +.incbin "textures/raw/font_letter_Y.i4" .align 2, 0x00 -glabel gTexture7F34E4 -.incbin "textures/raw/7F34E4.i4" +glabel font_letter_Z +.incbin "textures/raw/font_letter_Z.i4" .align 2, 0x00 glabel gTexture7F35B4 @@ -1738,8 +1738,8 @@ glabel gTexture7F9FC4 .incbin "textures/raw/7F9FC4.i4" .align 2, 0x00 -glabel gTexture7FA044 -.incbin "textures/raw/7FA044.i4" +glabel font_apostrophe +.incbin "textures/raw/font_apostrophe.i4" .align 2, 0x00 glabel gTexture7FA0C4 @@ -1754,5 +1754,5 @@ glabel gTexture7FA264 .incbin "textures/raw/7FA264.i4" .align 2, 0x00 -glabel gTexture7FA334 -.incbin "textures/raw/7FA334.i4" +glabel font_comma +.incbin "textures/raw/font_comma.i4" diff --git a/data/texture_tkmk00.s b/data/texture_tkmk00.s index b1ef5a61e6..648dc12523 100644 --- a/data/texture_tkmk00.s +++ b/data/texture_tkmk00.s @@ -5,45 +5,45 @@ .data -glabel gTexturePlayerSelect -.incbin "bin/gTexturePlayerSelect.rgba16.tkmk00" -glabel gTexturePlayerSelect_end +glabel texture_player_select +.incbin "bin/texture_player_select.rgba16.tkmk00" +glabel texture_player_select_end -glabel gTextureOption -.incbin "bin/gTextureOption.rgba16.tkmk00" -glabel gTextureOption_end +glabel texture_option +.incbin "bin/texture_option.rgba16.tkmk00" +glabel texture_option_end -glabel gTextureNameDK -.incbin "bin/gTextureNameDK.rgba16.tkmk00" -glabel gTextureNameDK_end +glabel texture_name_dk +.incbin "bin/texture_name_dk.rgba16.tkmk00" +glabel texture_name_dk_end -glabel gTextureNameToad -.incbin "bin/gTextureNameToad.rgba16.tkmk00" -glabel gTextureNameToad_end +glabel texture_name_toad +.incbin "bin/texture_name_toad.rgba16.tkmk00" +glabel texture_name_toad_end -glabel gTextureNameBowser -.incbin "bin/gTextureNameBowser.rgba16.tkmk00" -glabel gTextureNameBowser_end +glabel texture_name_bowser +.incbin "bin/texture_name_bowser.rgba16.tkmk00" +glabel texture_name_bowser_end -glabel gTextureNameLuigi -.incbin "bin/gTextureNameLuigi.rgba16.tkmk00" -glabel gTextureNameLuigi_end +glabel texture_name_luigi +.incbin "bin/texture_name_luigi.rgba16.tkmk00" +glabel texture_name_luigi_end -glabel gTextureNameMario -.incbin "bin/gTextureNameMario.rgba16.tkmk00" -glabel gTextureNameMario_end +glabel texture_name_mario +.incbin "bin/texture_name_mario.rgba16.tkmk00" +glabel texture_name_mario_end -glabel gTextureNamePeach -.incbin "bin/gTextureNamePeach.rgba16.tkmk00" -glabel gTextureNamePeach_end +glabel texture_name_peach +.incbin "bin/texture_name_peach.rgba16.tkmk00" +glabel texture_name_peach_end -glabel gTextureNameWario -.incbin "bin/gTextureNameWario.rgba16.tkmk00" -glabel gTextureNameWario_end +glabel texture_name_wario +.incbin "bin/texture_name_wario.rgba16.tkmk00" +glabel texture_name_wario_end -glabel gTextureNameYoshi -.incbin "bin/gTextureNameYoshi.rgba16.tkmk00" -glabel gTextureNameYoshi_end +glabel texture_name_yoshi +.incbin "bin/texture_name_yoshi.rgba16.tkmk00" +glabel texture_name_yoshi_end glabel gTextureTitleMarioRaceway .incbin "bin/gTextureTitleMarioRaceway.rgba16.tkmk00" @@ -145,65 +145,65 @@ glabel gTextureMenuSpecialCup .incbin "bin/gTextureMenuSpecialCup.rgba16.tkmk00" glabel gTextureMenuSpecialCup_end -glabel gTextureGameSelect -.incbin "bin/gTextureGameSelect.rgba16.tkmk00" -glabel gTextureGameSelect_end +glabel texture_game_select +.incbin "bin/texture_game_select.rgba16.tkmk00" +glabel texture_game_select_end -glabel gTextureMenu1PGame -.incbin "bin/gTextureMenu1PGame.rgba16.tkmk00" -glabel gTextureMenu1PGame_end +glabel texture_menu_1p_game +.incbin "bin/texture_menu_1p_game.rgba16.tkmk00" +glabel texture_menu_1p_game_end -glabel gTextureMenu2PGame -.incbin "bin/gTextureMenu2PGame.rgba16.tkmk00" -glabel gTextureMenu2PGame_end +glabel texture_menu_2p_game +.incbin "bin/texture_menu_2p_game.rgba16.tkmk00" +glabel texture_menu_2p_game_end -glabel gTextureMenu3PGame -.incbin "bin/gTextureMenu3PGame.rgba16.tkmk00" -glabel gTextureMenu3PGame_end +glabel texture_menu_3p_game +.incbin "bin/texture_menu_3p_game.rgba16.tkmk00" +glabel texture_menu_3p_game_end -glabel gTextureMenu4PGame -.incbin "bin/gTextureMenu4PGame.rgba16.tkmk00" -glabel gTextureMenu4PGame_end +glabel texture_menu_4p_game +.incbin "bin/texture_menu_4p_game.rgba16.tkmk00" +glabel texture_menu_4p_game_end -glabel gTextureMenuModeBattle -.incbin "bin/gTextureMenuModeBattle.rgba16.tkmk00" -glabel gTextureMenuModeBattle_end +glabel texture_mode_battle +.incbin "bin/texture_mode_battle.rgba16.tkmk00" +glabel texture_mode_battle_end -glabel gTextureMenuModeTimeTrials -.incbin "bin/gTextureMenuModeTimeTrials.rgba16.tkmk00" -glabel gTextureMenuModeTimeTrials_end +glabel texture_mode_time_trials +.incbin "bin/texture_mode_time_trials.rgba16.tkmk00" +glabel texture_mode_time_trials_end -glabel gTextureMenuModeMarioGP -.incbin "bin/gTextureMenuModeMarioGP.rgba16.tkmk00" -glabel gTextureMenuModeMarioGP_end +glabel texture_mode_mario_gp +.incbin "bin/texture_mode_mario_gp.rgba16.tkmk00" +glabel texture_mode_mario_gp_end -glabel gTextureMenuModeVS -.incbin "bin/gTextureMenuModeVS.rgba16.tkmk00" -glabel gTextureMenuModeVS_end +glabel texture_mode_vs +.incbin "bin/texture_mode_vs.rgba16.tkmk00" +glabel texture_mode_vs_end -glabel gTextureMenuLOption -.incbin "bin/gTextureMenuLOption.rgba16.tkmk00" -glabel gTextureMenuLOption_end +glabel texture_l_option +.incbin "bin/texture_l_option.rgba16.tkmk00" +glabel texture_l_option_end -glabel gTextureMenuRData -.incbin "bin/gTextureMenuRData.rgba16.tkmk00" -glabel gTextureMenuRData_end +glabel texture_r_data +.incbin "bin/texture_r_data.rgba16.tkmk00" +glabel texture_r_data_end -glabel gTextureMenu50cc -.incbin "bin/gTextureMenu50cc.rgba16.tkmk00" -glabel gTextureMenu50cc_end +glabel texture_50cc +.incbin "bin/texture_50cc.rgba16.tkmk00" +glabel texture_50cc_end -glabel gTextureMenu100cc -.incbin "bin/gTextureMenu100cc.rgba16.tkmk00" -glabel gTextureMenu100cc_end +glabel texture_100cc +.incbin "bin/texture_100cc.rgba16.tkmk00" +glabel texture_100cc_end -glabel gTextureMenu150cc -.incbin "bin/gTextureMenu150cc.rgba16.tkmk00" -glabel gTextureMenu150cc_end +glabel texture_150cc +.incbin "bin/texture_150cc.rgba16.tkmk00" +glabel texture_150cc_end -glabel gTextureMenuExtra -.incbin "bin/gTextureMenuExtra.rgba16.tkmk00" -glabel gTextureMenuExtra_end +glabel texture_extra +.incbin "bin/texture_extra.rgba16.tkmk00" +glabel texture_extra_end glabel gTextureMenuWithoutItem .incbin "bin/gTextureMenuWithoutItem.rgba16.tkmk00" @@ -213,29 +213,29 @@ glabel gTextureMenuWithItem .incbin "bin/gTextureMenuWithItem.rgba16.tkmk00" glabel gTextureMenuWithItem_end -glabel gTextureMenuBegin -.incbin "bin/gTextureMenuBegin.rgba16.tkmk00" -glabel gTextureMenuBegin_end +glabel texture_begin +.incbin "bin/texture_begin.rgba16.tkmk00" +glabel texture_begin_end -glabel gTextureMenuGhost -.incbin "bin/gTextureMenuGhost.rgba16.tkmk00" -glabel gTextureMenuGhost_end +glabel texture_menu_ghost +.incbin "bin/texture_menu_ghost.rgba16.tkmk00" +glabel texture_menu_ghost_end -glabel gTextureMenuData -.incbin "bin/gTextureMenuData.rgba16.tkmk00" -glabel gTextureMenuData_end +glabel texture_data +.incbin "bin/texture_data.rgba16.tkmk00" +glabel texture_data_end -glabel gTextureMenuOK -.incbin "bin/gTextureMenuOK.rgba16.tkmk00" -glabel gTextureMenuOK_end +glabel texture_ok +.incbin "bin/texture_ok.rgba16.tkmk00" +glabel texture_ok_end -glabel gTextureBackgroundBlueSky -.incbin "bin/gTextureBackgroundBlueSky.rgba16.tkmk00" -glabel gTextureBackgroundBlueSky_end +glabel background_blue_sky +.incbin "bin/background_blue_sky.rgba16.tkmk00" +glabel background_blue_sky_end -glabel gTextureBackgroundSunset -.incbin "bin/gTextureBackgroundSunset.rgba16.tkmk00" -glabel gTextureBackgroundSunset_end +glabel background_sunset +.incbin "bin/background_sunset.rgba16.tkmk00" +glabel background_sunset_end glabel gTextureGreenGoldStripe .incbin "bin/gTextureGreenGoldStripe.rgba16.tkmk00" diff --git a/diff_settings.py b/diff_settings.py index 65b10e73fc..98e989596a 100644 --- a/diff_settings.py +++ b/diff_settings.py @@ -4,10 +4,10 @@ def add_custom_arguments(parser): group = parser.add_mutually_exclusive_group(required=False) group.add_argument('-u', dest='lang', action='store_const', const='us', help="Set version to US.") - group.add_argument('-eu10', dest='lang', action='store_const', const='eu-1.0', - help="Set version to EU.") - group.add_argument('-eu11', dest='lang', action='store_const', const='eu-final', - help="Set version to EU.") + group.add_argument('-eu10', dest='lang', action='store_const', const='eu.v10', + help="Set version to EU 1.0.") + group.add_argument('-eu11', dest='lang', action='store_const', const='eu.v11', + help="Set version to EU 1.1.") def apply(config, args): lang = args.lang or 'us' diff --git a/docs/basics/compiling.md b/docs/basics/compiling.md index 1cfd50c943..e978c25474 100644 --- a/docs/basics/compiling.md +++ b/docs/basics/compiling.md @@ -88,20 +88,42 @@ make -j Building EU requires US to be built first. See above. mk64 decomp supports two EU versions -* EU 1.0 `eu-1.0` -* EU 1.1 `eu-final` +* EU 1.0 `eu.v10` +* EU 1.1 `eu.v11` Build using ```bash -make -j VERSION=eu-1.0 +make -j VERSION=eu.v10 ``` or ```bash -make -j VERSION=eu-final +make -j VERSION=eu.v11 ``` First-diff/diff commands for EU ```bash python3 first-diff.py --eu ./diff -eu -``` \ No newline at end of file +``` + +# Handling Changes +Certain changes may result in unexpected behaviour (frequently related to physics) due to the games obnoxious linker setup. This is resolved by compiling with the AVOID_UB flag. + +This will require a rebuild, run +```bash +make clean +``` + +Then compile like so +`` +make -j AVOID_UB=1 +or +make -j DEBUG=1 // Enables debug mode and avoid_ub +`` + +Recompiling `.inc.c` files requires saving the root `.c` file for makefile to recognize that the file requires a rebuild. This is because at compile time a `inc.c` file is essentially copy/pasted into its associated `.c` file. Therefore makefile does not recognize changes to `.inc.c` files, only `.c` files. This may be resolved in the following ways: +1) Search for `#include "my_file.inc.c` to find the root file and then save it with ctrl+s. +2) `make clean` and rebuild +3) `make my_file.c` +4) Find help in the Discord + diff --git a/docs/basics/controlflow.md b/docs/basics/controlflow.md index 01af022b3a..6bf6ddcf0f 100644 --- a/docs/basics/controlflow.md +++ b/docs/basics/controlflow.md @@ -3,54 +3,60 @@ [TOC] # Paradigm + The developers wrote mk64 using a state-driven paradigm. Gamestate, gamemode, course, actors, structs, and more decide which branches code should follow. As an example, a condition can check the current course to load that courses resources or run logic based on that. # Threading + After boot, the game begins by setting up its four threads; [idle](@ref thread1_idle), [video](@ref thread3_video), [audio](@ref thread4_audio), and the [game loop](@ref thread5_game_loop). The [idle thread](@ref thread1_idle) allows the cpu to sleep. Without it, if at any time execution of all threads were paused, the cpu would never be able to continue. The idle thread is active if all the other threads are paused. As such, the [idle thread](@ref thread1_idle) runs the following loop: `while(true);` (it runs in a perpetual loop of nothing; sleep). In mips assembly it looks like this: + ``` .L800005B8: b .L800005B8 -nop +nop ``` + b stands for branch which acts akin to a goto. In this case, branch to the label `.L800005B8`. This creates an infinite loop. Whenever the cpu branches it always runs the next instruction as well which is called a delay slot. This means the cpu will continuously branch then run `nop` or `no operation` with no method of escaping the loop (except for when another thread has a higher priority which means the cpu switches to that thread and stops running the idle thread). N64 threads are ran based on priority running whichever thread holds the most of it. Threads can also pause and wait for events. Note that the N64 is not multi-threaded by modern standards as the other threads contain specific purposes which slightly differs from the concept of splitting a single program into multiple processes for efficiency. # Overall Control Flow + order of initialisation of thread: boot: -* init_threads:
- * [idle](@ref thread1_idle), [video](@ref thread3_video), [audio](@ref thread4_audio), [game loop](@ref thread5_game_loop)
-* [game loop](@ref thread5_game_loop):
- * [audio](@ref thread4_audio)
- * [jumpTo a specific menu or race based on a gameState flag.](@ref update_gamestate)
- * [profiler](@ref profiler_log_thread5_time)
- * [config_gfx_pool](@ref config_gfx_pool)
- * [read_controllers](@ref read_controllers)
- * [game_state_handler](@ref game_state_handler)
- * [endDL/vsync](@ref display_and_vsync)
- * [game_state_handler](@ref game_state_handler):
- * switch([gGamestate](@ref gGamestate))
- * [menus](@ref update_menus) -> switch([menu](@ref gMenuSelection)) { // do menu stuff }
- * [race_logic_loop](@ref race_logic_loop) -> spaghetti
- * [podium_ceremony](@ref podium_ceremony_loop)
- * [credits](@ref credits_loop)
-* [video](@ref thread3_video):
+ +- init_threads:
+ - [idle](@ref thread1_idle), [video](@ref thread3_video), [audio](@ref thread4_audio), [game loop](@ref thread5_game_loop)
+- [game loop](@ref thread5_game_loop):
+ - [audio](@ref thread4_audio)
+ - [jumpTo a specific menu or race based on a gameState flag.](@ref update_gamestate)
+ - [profiler](@ref profiler_log_thread5_time)
+ - [config_gfx_pool](@ref config_gfx_pool)
+ - [read_controllers](@ref read_controllers)
+ - [game_state_handler](@ref game_state_handler)
+ - [endDL/vsync](@ref display_and_vsync)
+ - [game_state_handler](@ref game_state_handler):
+ - switch([gGamestate](@ref gGamestate))
+ - [menus](@ref update_menus) -> switch([menu](@ref gMenuSelection)) { // do menu stuff }
+ - [race_logic_loop](@ref race_logic_loop) -> spaghetti
+ - [podium_ceremony](@ref podium_ceremony_loop)
+ - [credits](@ref credits_loop)
+- [video](@ref thread3_video):
handles interaction between video/audio threads. handles vblanking and some elements pertaining to framebuffer most of all, handles which step of rendering a frame the cpu is in. Checks when new to start new sp tasks - If mk64 is in a menu state it will branch off to the menu code, running relevant bits of code based on more flags such as which particular menu the user is in. This will loop until the state changes to a different one such as race mode. If mk64 is in a race state, then race related code is ran and it spaghetti's off into a wide series of branches. This may include concepts such as `isLinedUp, isRacing, isRaceFinished, gotoNextCourse, isHuman, and isAI`. This relatively primitive design could be defined as a state machine from an abstract point of view. This would differ from an OOP design that uses objects and hierarchy. You will become very familiar with this design principle as you explore the code-base. During any step of the game loop, a switch can be setup to check a flag then run code relevant to the situation. For instance, a flag can check whether a race is in-progress or complete. If in-progress set the player to human controlled. If complete, set player to AI controlled. # Segments + mk64 code is split into three sections for now. |Segment|desc| |---|---| @@ -63,13 +69,15 @@ Racing segment loads after selecting a grand prix. Note that it is always reload # Code Breakdown ## Menus -|file|desc| -|---|---| -|[menus](@ref menus.c)| Menu related code | -|[save](@ref save.c)| Save related | -|[startup_logo](@ref data/startup_logo.c)|Startup logo| + +| file | desc | +| ---------------------------------------- | ----------------- | +| [menus](@ref menus.c) | Menu related code | +| [save](@ref save.c) | Save related | +| [startup_logo](@ref data/startup_logo.c) | Startup logo | ## Players + Player related code resides in |file|desc| |---|---| @@ -77,14 +85,16 @@ Player related code resides in |[camera](@ref camera.c)| Player cameras | ## Actors + Actor related code resides in |file|desc| |---|---| |[actors](@ref actors.c)|Variety of [actors](actorsmenu.html), see link for specifics.| |[actors_extended](@ref actors_extended.c)|Shells and bananas| -|[code_80005FD0](@ref code_80005FD0.c)| Vehicles; trains, cars, trucks, boats | +|[cpu_vehicles_camera_path](@ref cpu_vehicles_camera_path.c)| Vehicles; trains, cars, trucks, boats | ## Objects + Object related code resides in |file|desc| |---|---| @@ -95,6 +105,7 @@ Object related code resides in Documentation of the specifics still in-progress. See [actors](actorsmenu.html) for more information. ## Courses + Course related code resides in |file|desc| |---|---| @@ -103,36 +114,41 @@ Course related code resides in |[common_textures](@ref common_textures.c)|Content accessible to every course such as items and portraits| ### Course Folder + [course folder link][@ref courses] |file|desc| |---|---| |courses/course_name/course_data.c|Course data| -|courses/course_name/course_vertices.inc.c|Course vertices (this + _displaylists.inc.c makes the course geography)| +|courses/course_name/course_vertices.inc.c|Course vertices (this + \_displaylists.inc.c makes the course geography)| |courses/course_name/course_displaylists.inc.c|Course displaylists (these get compressed during compile)| |courses/course_name/course_offsets.c|Textures used in the course| ## UI & Other 2D Screen data -|file|desc| -|---|---| -|[render_objects](@ref render_objects.c)|ItemWindows| + +| file | desc | +| --------------------------------------- | ----------- | +| [render_objects](@ref render_objects.c) | ItemWindows | ## Engine -|file|desc| -|---|---| -|[collision](@ref collision.c)| | -|[code_80005FD0](@ref code_80005FD0.c)| Pathing code | + +| file | desc | +| ----------------------------------------------------------- | ------------ | +| [collision](@ref collision.c) | | +| [cpu_vehicles_camera_path](@ref cpu_vehicles_camera_path.c) | Pathing code | ## Math + Math related code resides in |file|desc| |---|---| |[math_util](@ref math_util.c)| | -|[math_util_2](@ref math_util_2.c)| | +|[math_util_2](@ref math_util_2.c)| | ## Ending -|file|desc| -|---|---| -|[ceremony_and_credits](@ref ceremony_and_credits.c)|Camera rails for podium ceremony and credits| -|[podium_ceremony_actors](@ref podium_ceremony_actors.c)|Fireworks and balloons for podium ceremony| -|[ceremony_data](@ref ceremony_data.c)|Trophies and podium models. Paths.| -|[credits](@ref credits.c)|Credits text and UI positions| + +| file | desc | +| ------------------------------------------------------- | -------------------------------------------- | +| [ceremony_and_credits](@ref ceremony_and_credits.c) | Camera rails for podium ceremony and credits | +| [podium_ceremony_actors](@ref podium_ceremony_actors.c) | Fireworks and balloons for podium ceremony | +| [ceremony_data](@ref ceremony_data.c) | Trophies and podium models. Paths. | +| [credits](@ref credits.c) | Credits text and UI positions | diff --git a/enhancements/flycam.patch b/enhancements/flycam.patch index b1cbd91f87..fd81c47f67 100644 --- a/enhancements/flycam.patch +++ b/enhancements/flycam.patch @@ -27,7 +27,7 @@ index 70f4820..f36f11c 100644 BUILD_DIR/src/debug/crash_screen_enhancement.o(.rodata); BUILD_DIR/src/debug/debug.o(.rodata); @@ -311,6 +314,7 @@ SECTIONS - BUILD_DIR/src/code_80091750.jp.o(.bss); + BUILD_DIR/src/menu_items.jp.o(.bss); BUILD_DIR/src/code_800AF9B0.o(.bss); BUILD_DIR/src/menus.o(.bss); + BUILD_DIR/src/flycam.o(.bss); @@ -158,9 +158,9 @@ index 0000000..5569838 + // Don't use `bool = !bool` here as the game code can swap these on you. + // Which will confuse the code. This forces it to always be correct + if (isFlycam) { -+ player->type |= PLAYER_KART_AI; ++ player->type |= PLAYER_CPU; + } else { -+ player->type &= PLAYER_KART_AI; ++ player->type &= PLAYER_CPU; + } + + gIsHUDVisible = !isFlycam; @@ -435,7 +435,7 @@ index c2a84aa..338e2bd 100644 temp_v1 = ((temp_v1 - 1) * 4) + var_a3; + if (isFlycam) { -+ func_8029569C(); ++ render_course_credits(); + return; + } + diff --git a/extract_assets.py b/extract_assets.py index c5b9644639..f91dbd58ba 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -62,7 +62,7 @@ def main(): clean_assets(local_asset_file) sys.exit(0) - all_langs = ["us", "eu-1.0", "eu-final"] + all_langs = ["us", "eu.v10", "eu.v11"] if not langs or not all(a in all_langs for a in langs): langs_str = " ".join("[" + lang + "]" for lang in all_langs) print("Usage: " + sys.argv[0] + " " + langs_str) diff --git a/first-diff.py b/first-diff.py index 7b6d088cf8..5731a59f67 100755 --- a/first-diff.py +++ b/first-diff.py @@ -23,7 +23,7 @@ "--eu10", help="use European (1.0) version", action="store_const", - const="eu-1.0", + const="eu.v10", dest="version", ) versionGroup.add_argument( @@ -31,7 +31,7 @@ "--eu11", help="use European (1.1) version", action="store_const", - const="eu-final", + const="eu.v11", dest="version", ) parser.add_argument( diff --git a/include/PR/abi.h b/include/PR/abi.h index aea3437ab6..842938b6b5 100644 --- a/include/PR/abi.h +++ b/include/PR/abi.h @@ -819,6 +819,17 @@ typedef short ENVMIX_STATE[40]; _a->words.w1 = _SHIFTL(i, 16, 16) | _SHIFTL(o, 0, 16); \ } +/* + * See aEnvMixer for more info. + */ +#define aEnvSetup1Alt(pkt, initialVolReverb, rampReverbL, rampReverbR, rampLeft, rampRight) \ + { \ + Acmd* _a = (Acmd*) pkt; \ + _a->words.w0 = (_SHIFTL(A_ENVSETUP1, 24, 8) | _SHIFTL(initialVolReverb, 16, 8) | \ + (_SHIFTL(rampReverbL, 8, 8)) | _SHIFTL(rampReverbR, 0, 8)); \ + _a->words.w1 = _SHIFTL(rampLeft, 16, 16) | _SHIFTL(rampRight, 0, 16); \ + } + /* * See aEnvMixer for more info. */ diff --git a/include/bomb_kart.h b/include/bomb_kart.h index 0ae47f3091..cc5fd45b9c 100644 --- a/include/bomb_kart.h +++ b/include/bomb_kart.h @@ -3,6 +3,7 @@ #include #include +#include #define NUM_BOMB_KARTS_MAX 7 #define NUM_BOMB_KARTS_VERSUS 7 @@ -16,7 +17,7 @@ #define BOMB_STATE_UNKNOWN 5 typedef struct { - /* 0x00 */ u16 waypointIndex; + /* 0x00 */ u16 pathPointIndex; /* 0x02 */ u16 startingState; /* 0x04 */ f32 unk_04; // Used to set the value of unk_3C in BombKart /* 0x08 */ f32 startingXPos; @@ -41,8 +42,8 @@ typedef struct { /* 0x24 */ Vec3f wheel3Pos; /* 0x30 */ Vec3f wheel4Pos; /* 0x3C */ f32 unk_3C; - /* 0x40 */ u16 someRot; // seems like an angle of some variety, can't figure out its purpose - /* 0x42 */ u16 waypointIndex; // probably the waypoint that the bomb circles + /* 0x40 */ u16 someRot; // seems like an angle of some variety, can't figure out its purpose + /* 0x42 */ u16 pathPointIndex; // probably the path point that the bomb circles /* 0x44 */ u16 state; /* 0x46 */ u16 bounceTimer; // timer? state? height? /* 0x48 */ u16 circleTimer; // timer? state? Somehow controls how it circles around diff --git a/include/common_structs.h b/include/common_structs.h index a6d9fbc556..1a8d954af7 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -27,10 +27,10 @@ typedef enum { A = 0x80, B = 0x40, Z = 0x20, R = 0x10 } GhostController; /*** types.h ***/ typedef struct { - /* 0x0 */ s16 waypointStart; - /* 0x2 */ s16 waypointEnd; + /* 0x0 */ s16 pathPointStart; + /* 0x2 */ s16 pathPointEnd; /* 0x4 */ s32 type; -} KartAIBehaviour; // size = 0x8 +} CPUBehaviour; // size = 0x8 enum SpTaskState { SPTASK_STATE_NOT_STARTED, @@ -145,15 +145,15 @@ typedef struct { } Collision; typedef struct { - /* 0x00 */ Vec3f unk_000; - /* 0x0C */ f32 unk_00C; + /* 0x00 */ Vec3f pos; + /* 0x0C */ f32 scale; /* 0x10 */ u16 unk_010; - /* 0x12 */ u16 unk_012; - /* 0x14 */ f32 unk_014; + /* 0x12 */ u16 type; + /* 0x14 */ f32 surfaceType; /* 0x18 */ f32 unk_018; - /* 0x1C */ s16 unk_01C; - /* 0x1E */ s16 unk_01E; - /* 0x20 */ s16 unk_020; + /* 0x1C */ s16 isAlive; + /* 0x1E */ s16 timer; + /* 0x20 */ s16 rotation; /* 0x22 */ s16 unk_022; /* 0x24 */ f32 unk_024; /* 0x28 */ f32 unk_028; @@ -163,15 +163,15 @@ typedef struct { /* 0x32 */ s16 unk_032; /* 0x34 */ s16 unk_034; /* 0x36 */ s16 unk_036; - /* 0x38 */ s16 unk_038; - /* 0x3A */ s16 unk_03A; - /* 0x3C */ s16 unk_03C; - /* 0x3E */ s16 unk_03E; + /* 0x38 */ s16 red; + /* 0x3A */ s16 green; + /* 0x3C */ s16 blue; + /* 0x3E */ s16 alpha; /* 0x40 */ s16 unk_040; /* 0x42 */ s16 unk_042; /* 0x44 */ s16 unk_044; /* 0x46 */ s16 unk_046; -} UnkPlayerStruct258; // size = 0x48 +} Particle; // size = 0x48 // This struct is almost identical to the GBI Vtx_t type, // except that its missing the "flag" member. @@ -253,7 +253,7 @@ typedef struct { /* 0x0006 */ u16 unk_006; /* 0x0008 */ s16 lapCount; /* 0x000A */ char unk_00A[0x2]; - /* 0x000C */ s32 soundEffects; // Bitflag. + /* 0x000C */ s32 triggers; // Bitflag. /* 0x0010 */ s16 currentItemCopy; // Has no effect on what item the players has, It is just a synced copy /* 0x0012 */ s16 unk_012; /* 0x0014 */ Vec3f pos; @@ -263,7 +263,7 @@ typedef struct { /* 0x0034 */ Vec3f velocity; /* 0x0040 */ s16 unk_040; /* 0x0042 */ s16 unk_042; - /* 0x0044 */ s16 unk_044; + /* 0x0044 */ s16 kartProps; /* 0x0046 */ u16 unk_046; /* 0x0048 */ Vec4s unk_048; /* 0x0050 */ Vec4s unk_050; @@ -281,7 +281,7 @@ typedef struct { /* 0x0088 */ f32 unk_088; /* 0x008C */ f32 unk_08C; /* 0x0090 */ f32 unk_090; - /* 0x0094 */ f32 unk_094; + /* 0x0094 */ f32 speed; /* 0x0098 */ f32 unk_098; /* 0x009C */ f32 currentSpeed; /* 0x00A0 */ f32 unk_0A0; @@ -293,19 +293,19 @@ typedef struct { /* 0x00B0 */ s16 unk_0B0; /* 0x00B2 */ s16 unk_0B2; /* 0x00B4 */ u16 unk_0B4; - /* 0x00B6 */ u16 unk_0B6; + /* 0x00B6 */ u16 kartGraphics; /* 0x00B8 */ f32 unk_0B8; /* 0x00BC */ u32 effects; /* 0x00C0 */ s16 unk_0C0; /* 0x00C2 */ s16 unk_0C2; /* 0x00C4 */ s16 slopeAccel; - /* 0x00C6 */ s16 unk_0C6; + /* 0x00C6 */ s16 alpha; /* 0x00C8 */ s16 unk_0C8; - /* 0x00CA */ s16 unk_0CA; + /* 0x00CA */ s16 lakituProps; /* 0x00CC */ Vec4s unk_0CC; /* 0x00D4 */ Vec4s unk_0D4; /* 0x00DC */ s16 boostTimer; - /* 0x00DE */ u16 unk_0DE; + /* 0x00DE */ u16 oobProps; /* 0x00E0 */ s16 unk_0E0; /* 0x00E2 */ s16 unk_0E2; /* 0x00E4 */ f32 unk_0E4; @@ -328,7 +328,7 @@ typedef struct { /* 0x01F8 */ f32 unk_1F8; /* 0x01FC */ f32 unk_1FC; /* 0x0200 */ u32 unk_200; // May be s32. but less casting required if u32 - /* 0x0204 */ s16 unk_204; + /* 0x0204 */ s16 driftDuration; /* 0x0206 */ s16 unk_206; /* 0x0208 */ f32 unk_208; /* 0x020C */ f32 unk_20C; @@ -336,24 +336,27 @@ typedef struct { /* 0x0214 */ f32 topSpeed; /* 0x0218 */ f32 unk_218; /* 0x021C */ f32 unk_21C; - /* 0x0220 */ s16 nearestWaypointId; // ?? + /* 0x0220 */ s16 nearestPathPointId; // ?? /* 0x0222 */ s16 unk_222; /* 0x0224 */ f32 size; /* 0x0228 */ s16 unk_228; - /* 0x022A */ s16 unk_22A; - /* 0x022C */ f32 unk_22C; + /* 0x022A */ s16 driftState; + /* 0x022C */ f32 previousSpeed; /* 0x0230 */ f32 unk_230; /* 0x0234 */ s16 unk_234; /* 0x0236 */ s16 unk_236; /* 0x0238 */ s16 unk_238; /* 0x023A */ s16 unk_23A; /* 0x023C */ f32 unk_23C; - /* 0x0240 */ s32 unk_240; + /* 0x0240 */ s32 tyreSpeed; /* 0x0244 */ u16 animFrameSelector[4]; // [0] Active texture group /* 0x024C */ u16 animGroupSelector[4]; /* 0x0254 */ u16 characterId; /* 0x0256 */ u16 unk_256; - /* 0x0258 */ UnkPlayerStruct258 unk_258[40]; + /* 0x0258 */ Particle particlePool0[10]; + /* 0x0258 */ Particle particlePool1[10]; + /* 0x0258 */ Particle particlePool2[10]; + /* 0x0258 */ Particle particlePool3[10]; /* 0x0D98 */ s16 unk_D98; /* 0x0D9A */ s16 unk_D9A; /* 0x0D9C */ f32 unk_D9C; @@ -377,6 +380,19 @@ typedef struct { /* 0x0DD4 */ // s16 unk_DD4; } Player; // size = 0xDD8 +enum POOL_1_PARTICLE_TYPES { + NO_PARTICLE, + DRIFT_PARTICLE, + GROUND_PARTICLE, + GRASS_PARTICLE, + POOL_1_PARTICLE_TYPE_4, + POOL_1_PARTICLE_TYPE_5, + POOL_1_PARTICLE_TYPE_6, + POOL_1_PARTICLE_TYPE_7, + POOL_1_PARTICLE_TYPE_8, + POOL_1_PARTICLE_TYPE_9 +}; + typedef struct { // Something related to time trial ghost data? /* 0x00 */ s32 unk_00; diff --git a/include/config.h b/include/config.h new file mode 100644 index 0000000000..85d1a89eb9 --- /dev/null +++ b/include/config.h @@ -0,0 +1,11 @@ +#ifndef CONFIG_H +#define CONFIG_H + +/** + * @brief Use a custom course engine + * Use a custom course engine instead of the default one who use switch. see course.h and everywhere + * ENABLE_CUSTOM_COURSE_ENGINE are use to define your + * + */ +#define ENABLE_CUSTOM_COURSE_ENGINE 0 +#endif diff --git a/include/course.h b/include/course.h index 2e78a3f3d4..4d5aacc287 100644 --- a/include/course.h +++ b/include/course.h @@ -4,6 +4,7 @@ #include #include #include +#include "path.h" /** * @file Include for course gfx.inc.c. @@ -16,4 +17,122 @@ typedef struct { u16 flags; } TrackSections; +struct _struct_gCoursePathSizes_0x10 { + /* 0x00 */ u16 firstPath; + /* 0x02 */ u16 secondPath; + /* 0x04 */ u16 thirdPath; + /* 0x06 */ u16 fourthPath; + /* 0x08 */ u16 unk8; + /* 0x0A */ char padA[6]; +}; // size 0x10 + +#if !ENABLE_CUSTOM_COURSE_ENGINE +typedef enum { + /* 0x00 */ COURSE_MARIO_RACEWAY = 0, + /* 0x01 */ COURSE_CHOCO_MOUNTAIN, + /* 0x02 */ COURSE_BOWSER_CASTLE, + /* 0x03 */ COURSE_BANSHEE_BOARDWALK, + /* 0x04 */ COURSE_YOSHI_VALLEY, + /* 0x05 */ COURSE_FRAPPE_SNOWLAND, + /* 0x06 */ COURSE_KOOPA_BEACH, + /* 0x07 */ COURSE_ROYAL_RACEWAY, + /* 0x08 */ COURSE_LUIGI_RACEWAY, + /* 0x09 */ COURSE_MOO_MOO_FARM, + /* 0x0A */ COURSE_TOADS_TURNPIKE, + /* 0x0B */ COURSE_KALAMARI_DESERT, + /* 0x0C */ COURSE_SHERBET_LAND, + /* 0x0D */ COURSE_RAINBOW_ROAD, + /* 0x0E */ COURSE_WARIO_STADIUM, + /* 0x0F */ COURSE_BLOCK_FORT, + /* 0x10 */ COURSE_SKYSCRAPER, + /* 0x11 */ COURSE_DOUBLE_DECK, + /* 0x12 */ COURSE_DK_JUNGLE, + /* 0x13 */ COURSE_BIG_DONUT, + /* 0x14 */ COURSE_AWARD_CEREMONY, + /* 0x15 */ NUM_COURSES +} COURSES; + +#else + +#define COURSE_MARIO_RACEWAY +#define COURSE_CHOCO_MOUNTAIN +#define COURSE_BOWSER_CASTLE +#define COURSE_BANSHEE_BOARDWALK +#define COURSE_YOSHI_VALLEY +#define COURSE_FRAPPE_SNOWLAND +#define COURSE_KOOPA_BEACH +#define COURSE_ROYAL_RACEWAY +#define COURSE_LUIGI_RACEWAY +#define COURSE_MOO_MOO_FARM +#define COURSE_TOADS_TURNPIKE +#define COURSE_KALAMARI_DESERT +#define COURSE_SHERBET_LAND +#define COURSE_RAINBOW_ROAD +#define COURSE_WARIO_STADIUM +#define COURSE_BLOCK_FORT +#define COURSE_SKYSCRAPER +#define COURSE_DOUBLE_DECK +#define COURSE_DK_JUNGLE +#define COURSE_BIG_DONUT +#define COURSE_AWARD_CEREMONY +#define NUM_COURSES + +#endif + +#if !ENABLE_CUSTOM_COURSE_ENGINE +extern s16 gCurrentCourseId; +extern s16* D_800DCBB4[]; +#define GET_COURSE_800DCBB4(n) D_800DCBB4[gCurrentCourseId][n] +extern f32 cpu_CourseMaximumSeparation[]; +#define GET_COURSE_AIMaximumSeparation cpu_CourseMaximumSeparation[gCurrentCourseId] +extern struct _struct_gCoursePathSizes_0x10 gCoursePathSizes[]; +#define GET_COURSE_PathSizes gCoursePathSizes[gCurrentCourseId] +extern s16 cpu_SteeringSensitivity[]; +#define GET_COURSE_AISteeringSensitivity cpu_SteeringSensitivity[gCurrentCourseId] +extern f32 cpu_CourseMinimumSeparation[]; +#define GET_COURSE_AIMinimumSeparation cpu_CourseMinimumSeparation[gCurrentCourseId] +extern TrackPathPoint* gCoursePathTable[][4]; +#define GET_COURSE_PathTable(p) segmented_to_virtual_dupe_2(gCoursePathTable[gCurrentCourseId][p]) +extern TrackPathPoint* gCoursePathTable2[][4]; +#define GET_COURSE_PathTable2(p) segmented_to_virtual_dupe_2(gCoursePathTable2[gCurrentCourseId][p]) +extern CPUBehaviour* cpu_BehaviourLUT[]; +#define GET_COURSE_AIBehaviour segmented_to_virtual_dupe_2(cpu_BehaviourLUT[i]) +extern char* gCourseNames[]; +#define GET_COURSE_Name gCourseNames[gCurrentCourseId] +extern char* gCourseNamesDup[]; +#define GET_COURSE_NameDup gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]] +extern char* gDebugCourseNames[]; +#define GET_COURSE_debugName gDebugCourseNames[gCurrentCourseId] +extern f32 gCourseFarPersp; +#define gCourseFarPersp gCourseFarPersp +extern f32 gCourseNearPersp; +#define gCourseNearPersp gCourseNearPersp +#define GET_COURSE_D_0D0096B8(cc) *(f32*) segmented_to_virtual_dupe_2(&D_0D0096B8[gCurrentCourseId][cc]) +#define GET_COURSE_cpu_OffTrackTargetSpeed(cc) \ + *(f32*) segmented_to_virtual_dupe_2(&cpu_OffTrackTargetSpeed[gCurrentCourseId][cc]) +#define GET_COURSE_cpu_CurveTargetSpeed(cc) \ + *(f32*) segmented_to_virtual_dupe_2(&cpu_CurveTargetSpeed[gCurrentCourseId][cc]) +#define GET_COURSE_cpu_NormalTargetSpeed(cc) \ + *(f32*) segmented_to_virtual_dupe_2(&cpu_NormalTargetSpeed[gCurrentCourseId][cc]) +#else +#define gCurrentCourseId +#define GET_COURSE_800DCBB4(n) +#define GET_COURSE_AIMaximumSeparation +#define GET_COURSE_PathSizes +#define GET_COURSE_AISteeringSensitivity +#define GET_COURSE_AIMinimumSeparation +#define GET_COURSE_PathTable(p) +#define GET_COURSE_PathTable2(p) +#define GET_COURSE_AIBehaviour +#define GET_COURSE_Name +#define GET_COURSE_NameDup +#define GET_COURSE_debugName +#define gCourseFarPersp +#define gCourseNearPersp +#define GET_COURSE_D_0D0096B8(cc) +#define GET_COURSE_cpu_OffTrackTargetSpeed(cc) +#define GET_COURSE_cpu_CurveTargetSpeed(cc) +#define GET_COURSE_cpu_NormalTargetSpeed(cc) +#endif + #endif // COURSE_H diff --git a/include/defines.h b/include/defines.h index 729a53df3f..19384c11ca 100644 --- a/include/defines.h +++ b/include/defines.h @@ -38,35 +38,32 @@ * */ #if defined(GCC) || defined(DEBUG) -#define DEBUG_MODE 1 -#define DEBUG_MENU 2 +#define ENABLE_DEBUG_MODE 1 #else -#define DEBUG_MODE 0 -#define DEBUG_MENU 1 +#define ENABLE_DEBUG_MODE 0 #endif #define HOLD_ALL_DPAD_AND_C_BUTTONS \ (U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS) - +#define ALL_BUTTONS \ + (A_BUTTON | B_BUTTON | L_TRIG | R_TRIG | Z_TRIG | START_BUTTON | U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | \ + L_CBUTTONS | R_CBUTTONS | D_CBUTTONS) /** - * @brief Options for gDebugMenuSelection + * Replay controller buttons + * Used for time trial replays (including staff and player ghosts) + * Each entry is converted to a u32 value + * This allows access to the button struct member */ -#define DEBUG_MENU_DISABLED 1 -#define DEBUG_MENU_DEBUG_MODE 2 -#define DEBUG_MENU_COURSE 3 -#define DEBUG_MENU_SCREEN_MODE 4 -#define DEBUG_MENU_PLAYER 5 -#define DEBUG_MENU_SOUND_MODE 6 -#define DEBUG_MENU_GIVE_ALL_GOLD_CUP 7 -#define DEBUG_MENU_EXITED 64 +#define REPLAY_A_BUTTON (1 << 31) // 0x80000000 +#define REPLAY_B_BUTTON (1 << 30) // 0x40000000 +#define REPLAY_Z_TRIG (1 << 29) // 0x20000000 +#define REPLAY_R_TRIG (1 << 28) // 0x10000000 -/** - * @brief Options for gDebugGotoScene - */ -#define DEBUG_GOTO_RACING 0 -#define DEBUG_GOTO_ENDING 1 -#define DEBUG_GOTO_CREDITS_SEQUENCE_CC_50 2 -#define DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA 3 +#define REPLAY_FRAME_COUNTER 0xFF0000 +#define REPLAY_CLEAR_FRAME_COUNTER (0xFFFFFFFF & ~REPLAY_FRAME_COUNTER) +#define REPLAY_STICK_Y 0xFF00 +#define REPLAY_STICK_X 0xFF +#define REPLAY_FRAME_INCREMENT 0x10000 /** * @brief Jump to demo mode from the debug menu using L and A @@ -74,10 +71,15 @@ #define DEMO_MODE_ACTIVE 1 #define DEMO_MODE_INACTIVE 0 +// Float version required for matching #ifdef VERSION_EU -#define COURSE_TIMER_ITER 0.020041665999999999 // 1 / 50 +#define COURSE_TIMER_ITER 0.020041665999999999 // 1 / 50 +#ifdef AVOID_UB #define COURSE_TIMER_ITER_f 0.020041665999999999f // 1 / 50 #else +#define COURSE_TIMER_ITER_f 0.01666666f //! 1 / 60 - Float unchanged in EU +#endif +#else #define COURSE_TIMER_ITER 0.01666666 // 1 / 60 #define COURSE_TIMER_ITER_f 0.01666666f // 1 / 60 #endif @@ -91,18 +93,20 @@ * Used in the Player struct's 'type' member: player->type */ #define PLAYER_INACTIVE 0 // 0x0000 +#define PLAYER_UNKNOWN_0x10 (1 << 4) // 0x0010 // unused? #define PLAYER_UNKNOWN_0x40 (1 << 6) // 0x0040 +#define PLAYER_UNKNOWN_0x80 (1 << 7) // 0x0080 // UNUSED #define PLAYER_INVISIBLE_OR_BOMB (1 << 8) // 0x0100 #define PLAYER_STAGING (1 << 9) // 0x0200 #define PLAYER_UNKNOWN (1 << 10) // 0x0400 // unused ? #define PLAYER_CINEMATIC_MODE (1 << 11) // 0x0800 // Also used to track eliminations in Battle mode. -#define PLAYER_KART_AI (1 << 12) // 0x1000 +#define PLAYER_CPU (1 << 12) // 0x1000 #define PLAYER_START_SEQUENCE (1 << 13) // 0x2000 #define PLAYER_HUMAN (1 << 14) // 0x4000 #define PLAYER_EXISTS (1 << 15) // 0x8000 // Compiles to -0x1000 in diff.py -#define PLAYER_HUMAN_AND_KART_AI PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_KART_AI | PLAYER_START_SEQUENCE +#define PLAYER_HUMAN_AND_CPU PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_CPU | PLAYER_START_SEQUENCE #define ZERO_PLAYERS_SELECTED 0 #define ONE_PLAYERS_SELECTED 1 @@ -199,7 +203,7 @@ enum { COURSE_ONE, COURSE_TWO, COURSE_THREE, COURSE_FOUR }; #define CONTROLLER_PAK_MENU 9 #define START_MENU 10 #define MAIN_MENU 11 -#define PLAYER_SELECT_MENU 12 +#define CHARACTER_SELECT_MENU 12 #define COURSE_SELECT_MENU 13 #define RACING_DUPLICATE 14 @@ -214,34 +218,6 @@ enum { COURSE_ONE, COURSE_TWO, COURSE_THREE, COURSE_FOUR }; #define ENDING 5 #define CREDITS_SEQUENCE 9 -/** - * @brief Options for gMainMenuSelectionDepth - */ -#define BLANK_MAIN_MENU 0 -#define OPTIONS_SELECTION 1 -#define DATA_SELECTION 2 -#define PLAYER_NUM_SELECTION 3 -#define GAME_MODE_SELECTION 4 -#define GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION \ - 5 // Selecting CC for GP and Versus. Selecting "Begin" or "Data" for Time Trials. Unused for Battle -#define CONFIRM_OK_SELECTION 6 -#define CONFIRM_OK_SELECTION_FROM_BACK_OUT 7 -#define TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT 8 - -/** - * @brief Options for gControllerPakMenuSelection - */ -#define CONTROLLER_PAK_MENU_SELECT_RECORD 1 -#define CONTROLLER_PAK_MENU_END 2 -#define CONTROLLER_PAK_MENU_ERASE 3 -#define CONTROLLER_PAK_MENU_QUIT 4 -#define CONTROLLER_PAK_MENU_TABLE_GAME_DATA 5 -#define CONTROLLER_PAK_MENU_GO_TO_ERASING 6 -#define CONTROLLER_PAK_MENU_ERASING 7 -#define CONTROLLER_PAK_MENU_ERASE_ERROR_NOT_ERASED 8 -#define CONTROLLER_PAK_MENU_ERASE_ERROR_NO_PAK 9 -#define CONTROLLER_PAK_MENU_ERASE_ERROR_PAK_CHANGED 10 - /** * @brief Options for gScreenModeSelection and gActiveScreenMode */ @@ -269,12 +245,14 @@ enum { COURSE_ONE, COURSE_TWO, COURSE_THREE, COURSE_FOUR }; * flashing between 2 colors, but also cause individual characters * to be cutoff on their right side */ -#define TEXT_BLUE 0 -#define TEXT_GREEN 1 -#define TEXT_RED 2 -#define TEXT_YELLOW 3 -#define TEXT_BLUE_GREEN_RED_CYCLE_1 4 -#define TEXT_BLUE_GREEN_RED_CYCLE_2 5 +enum COLOR_ID { + TEXT_BLUE, + TEXT_GREEN, + TEXT_RED, + TEXT_YELLOW, + TEXT_BLUE_GREEN_RED_CYCLE_1, + TEXT_BLUE_GREEN_RED_CYCLE_2 +}; /** * @brief Sound mode options @@ -321,13 +299,13 @@ enum ITEMS { /* 0x0F */ ITEM_SUPER_MUSHROOM }; -enum KART_AI_BEHAVIOURS { +enum CPU_BEHAVIOURS { BEHAVIOUR_NONE = 0, BEHAVIOUR_1, BEHAVIOUR_HOP, - BEHAVIOUR_3, - BEHAVIOUR_4, - BEHAVIOUR_5, + BEHAVIOUR_DRIVE_CENTER, + BEHAVIOUR_DRIVE_LEFT, + BEHAVIOUR_DRIVE_OUTER, BEHAVIOUR_NORMAL_SPEED, BEHAVIOUR_FAST_SPEED, BEHAVIOUR_SLOW_SPEED, @@ -336,12 +314,9 @@ enum KART_AI_BEHAVIOURS { BEHAVIOUR_MAX_SPEED }; -enum DIRECTION { - NORTH, - EAST, - SOUTH, - WEST -}; +enum DIRECTION { NORTH, EAST, SOUTH, WEST }; + +enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE }; /** * @brief Balloon status @@ -354,34 +329,168 @@ enum DIRECTION { * @brief Max representable time, 100 minutes measured in centiseconds */ #define MAX_TIME 0x927C0 - -/** - * @brief sound effect of player's - * for soundEffect +#define DEGREES_CONVERSION_FACTOR 182 + +// player->unk_046 + +/* The first time you touch a penguin or bat, and anytime you touch a thwomp during a + race will set a flag which will cause your next spinout to be instant (i.e. no + sliding forward). Probably half-implemented code to prevent sliding through enemies, + but causes this bug */ +#define CRITTER_TOUCH 0x2 // Touched a penguin, bat or thwomp +#define CRITTER_TOUCH_GATE 0x4 +#define INSTANT_SPINOUT 0x40 + +// player->oobProps +/* Deals with the lower out of bounds (OOB) plane on levels. Represented by fluids (water / lava) + or nothing for Rainbow Road and Skyscraper. */ +#define UNDER_OOB_OR_FLUID_LEVEL \ + 0x1 // Set while mostly under the plane. Does not necessarily trigger Lakitu on Koopa Troopa Beach. +#define PASS_OOB_OR_FLUID_LEVEL 0x2 // Set when passing through the lower plane in either direction +// The next two are also activated when passing through the lower plane. +#define UNDER_FLUID_LEVEL 0x4 // Stays active until Lakitu places back on track +#define UNDER_OOB_LEVEL \ + 0x8 // Active while under a non-fluid OOB plane. Is momentarily active when passing through fluids. + +/* UNK_002 has something to do with player animations. Each player has a 32-bit +flag broken into 8 groups of 4 bits. Those 4 bits affect how each of the 8 players +appear to the specified player */ +#define CHANGING_ANIMATION 0x1 // Seems to be set when the kart animation has to change. +#define UNK_002_UNKNOWN_0x2 0x2 +#define UNK_002_UNKNOWN_0x4 \ + 0x4 /* Unclear, but has to do with viewing the side of player. At least tends to change if target \ +player spins. Something with avoding rollover of aniamation frame data? */ +#define SIDE_OF_KART 0x8 // Seems to be whether you are in a rectangle shooting out from both sides of target player + +#define WHISTLE 0x20 // Whistle spinout save graphic +#define CRASH 0x40 // Crash! graphic (vertical tumble) +#define WHIRRR 0x80 // Whirrr! graphic (spinning out) +#define POOMP 0x100 // Poomp! graphic (landing from a height) +#define BOING 0x800 // Boing! graphic (hopping) +#define EXPLOSION 0x1000 // Big shock looking graphic when starting tumble + +// player->lakituProps +#define LAKITU_RETRIEVAL \ + 0x1 // While lakitu is grabbing you, but before the scene transition of being placed on the track +#define HELD_BY_LAKITU 0x2 +#define LAKITU_FIZZLE 0x4 // Disintegration and reintegration effect when transitioning from retrieval to placement +#define LAKITU_SCENE 0x8 // the whole segment from when lakitu is called to when you regain control +#define FRIGID_EFFECT 0x10 // Cold colors on Sherbet Land after in frigid water +#define THAWING_EFFECT 0x20 // Regaining usual colors post frigid effect +#define FROZEN_EFFECT 0x80 // In the ice cube +#define WENT_OVER_OOB 0x100 // Player went over (or is on) an OOB area. Cancelled if touch back in bounds +#define LAKITU_LAVA 0x1000 // smoky effect when retrieved from lava +#define LAKITU_WATER 0x2000 // dripping effect when retreived from water + +// player->kartProps +#define BACK_UP 0x1 +#define RIGHT_TURN 0x2 // non-drifting (more than 5 degrees) +#define LEFT_TURN 0x4 // non-drifting (more than 5 degrees) +#define MOVE_BACKWARDS 0x8 // includes lakitu +#define LOSE_GP_RACE 0x10 // pointless, only unsets itself +#define THROTTLE 0x20 // Closely tied to just pressing A. Possible exception for AB-spins +#define EARLY_SPINOUT_RIGHT 0x40 // Spinning out while facing right (not actually used for anything) +#define EARLY_SPINOUT_LEFT 0x80 // Spinning out while facing left +#define POST_TUMBLE_GAS 0x100 // Causes particles after a vertical tumble, I think +#define BECOME_INVISIBLE 0x200 +#define UNUSED_0x400 0x400 // locked behind 0x800 (func_80091440) +#define UNUSED_0x800 0x800 // locked behind 0x400 (func_8002B830 -> func_800911B4) +#define UNUSED_0x1000 0x1000 // 0x1000 locked behind 0x400 (func_8002B830 -> func_800911B4) +#define UNUSED_0x2000 \ + 0x2000 // 0x2000 locked behind 0x400 and 0x800 (func_8002B830 -> func_800911B4, apply_effect -> func_80091298, + // func_80091440) +#define DRIVING_SPINOUT 0x4000 +#define UNKNOWN_BATTLE_VAR 0x8000 // 0x8000 something battle related, unclear if ever set + +/* + * @brief triggers indicating that an effect should be applied to a kart */ -#define HIT_SOUND_EFFECT 0x100 // hitting an object -#define BOOST_SOUND_EFFECT 0x200 // being boosted by trigger a mushroom -#define BOO_SOUND_EFFECT 0x800 // being a boo -#define STAR_SOUND_EFFECT 0x2000 // being a star -#define HIT_ROTATING_SOUND_EFFECT 0x4000 // hitting a rotating object -#define BOOST_RAMP_WOOD_SOUND_EFFECT 0x8000 // being boosted by a ramp -#define HOLD_BANANA_SOUND_EFFECT 0x40000 // holding a banana -#define REVERSE_SOUND_EFFECT 0x400000 // being in the wrong direction -#define BOOST_RAMP_ASPHALT_SOUND_EFFECT 0x800000 // being boosted by a boost pad -#define HIT_BY_ITEM_SOUND_EFFECT 0x1000000 // being hit by an item +#define HIT_BANANA_TRIGGER 0x1 // hits a banana +#define HIGH_TUMBLE_TRIGGER 0x2 // hit by a red shell, blue shell, or hit a mole +#define LOW_TUMBLE_TRIGGER 0x4 // hit by a green shell +#define DRIVING_SPINOUT_TRIGGER 0x80 // spinning out from erratic driving +#define THWOMP_SQUISH_TRIGGER 0x100 // stomped by thwomp +#define SHROOM_TRIGGER 0x200 // being boosted by trigger a mushroom +#define BOO_TRIGGER 0x800 // being a boo +#define UNUSED_TRIGGER_0x1000 0x1000 // Unused +#define STAR_TRIGGER 0x2000 // Starting a star +#define LIGHTNING_STRIKE_TRIGGER 0x4000 // Struck by lightning +#define BOOST_RAMP_WOOD_TRIGGER 0x8000 // being boosted by a ramp +#define UNUSED_TRIGGER_0x20000 0x20000 // Unused +#define DRAG_ITEM_EFFECT 0x40000 // holding a non-shell item behind you +#define HIT_PADDLE_BOAT_TRIGGER 0x80000 // hit paddle boat +#define UNUSED_TRIGGER_0x10000 0x100000 // Unused +#define SPINOUT_TRIGGER 0x200000 // hit crab or spiny spinout or losing versus race +#define VERTICAL_TUMBLE_TRIGGER 0x400000 // hitting a fake item / bomb / snowman / car / train +#define BOOST_RAMP_ASPHALT_TRIGGER 0x800000 // being boosted by a boost pad +#define HIT_BY_STAR_TRIGGER 0x1000000 // being hit by a star +#define START_BOOST_TRIGGER 0x2000000 // Start boost +#define LOSE_BATTLE_EFFECT 0x4000000 // When losing battle mode +#define BECOME_BOMB_EFFECT 0x8000000 // When becoming a bomb in battle mode +#define START_SPINOUT_TRIGGER 0x10000000 // Spinning out by holding gas at start of race + +#define ALL_TRIGGERS (0xFFFFFFFF) +#define RACING_SPINOUT_TRIGGERS (SPINOUT_TRIGGER | DRIVING_SPINOUT_TRIGGER | HIT_BANANA_TRIGGER) // 0x200081 +#define RAMP_BOOST_TRIGGERS (BOOST_RAMP_ASPHALT_TRIGGER | BOOST_RAMP_WOOD_TRIGGER) // 0x00808000 +#define ANY_BOOST_TRIGGERS (RAMP_BOOST_TRIGGERS | SHROOM_TRIGGER) // 0x00808200 +#define STATE_TRANSITION_TRIGGERS \ + (STAR_TRIGGER | BOO_TRIGGER | UNUSED_TRIGGER_0x1000 | UNUSED_TRIGGER_0x20000) // 0x00023800 +#define HIT_TRIGGERS \ + (HIT_BY_STAR_TRIGGER | VERTICAL_TUMBLE_TRIGGER | LIGHTNING_STRIKE_TRIGGER | LOW_TUMBLE_TRIGGER | \ + HIGH_TUMBLE_TRIGGER | THWOMP_SQUISH_TRIGGER) // 0x01404106 /** * @brief effect of player's * for effects */ -#define BOOST_RAMP_WOOD_EFFECT 0x4 // being boosted by a ramp -#define STAR_EFFECT 0x200 // being a star -#define BOOST_EFFECT 0x2000 // being boosted by trigger a mushroom -#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by a boost pad -#define HIT_BY_ITEM_EFFECT 0x2000000 // being hit by an item -#define HIT_EFFECT 0x4000000 // hitting an object -#define LIGHTNING_EFFECT 0x40000000 // being hit by lightning -#define BOO_EFFECT 0x80000000 // being a boo +// clang-format off +#define BRAKING_EFFECT 0x1 // pressing brake +#define HOP_EFFECT 0x2 // from when you hop to when you land +#define BOOST_RAMP_WOOD_EFFECT 0x4 // being boosted by DKJP ramp +#define MIDAIR_EFFECT 0x8 // in midair +#define DRIFTING_EFFECT 0x10 // drifting +#define AB_SPIN_EFFECT 0x20 // spinning with a+b +#define DRIVING_SPINOUT_EFFECT 0x40 // spinout (from erratic driving) or crab +#define BANANA_SPINOUT_EFFECT 0x80 // spinout (from hitting a banana or another driver) +#define MINI_TURBO_EFFECT 0x100 // mini-turbo +#define STAR_EFFECT 0x200 // using a star +#define HIT_BY_GREEN_SHELL_EFFECT 0x400 // tumbling after hit with a green shell +#define BANANA_NEAR_SPINOUT_EFFECT 0x800 // decreased steering sensitivity after hitting a banana, but before spinning out +#define LOST_RACE_EFFECT 0x1000 // lost race in GP mode +#define MUSHROOM_EFFECT 0x2000 // using a mushroom +#define EARLY_START_SPINOUT_EFFECT 0x4000 // spinning out by pressing a too early at the startline or after lakitu retrieves you +#define ENEMY_BONK_EFFECT 0x8000 // bouncing off an enemy (penguin, thwomp, etc) +#define TERRAIN_TUMBLE_EFFECT 0x10000 // tumbling after hitting steep terrain +#define LIGHTNING_STRIKE_EFFECT 0x20000 // spinning and shrinking during a lightning strike +#define BANANA_SPINOUT_SAVE_EFFECT 0x40000 // avoid spinning out by pressing b +#define UNKNOWN_EFFECT_0x80000 0x80000 // Only set when soundEffect 0x1000 is set. Unclear if it ever is +#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by the Royal Raceway ramp +#define CPU_FAST_EFFECT 0x200000 // CPU Rubberbanding flag +#define REVERSE_EFFECT 0x400000 // facing backwards +#define UNKNOWN_EFFECT_0x800000 0x800000 // Only set when soundEffect 0x20000 is set +#define EXPLOSION_CRASH_EFFECT 0x1000000 // vertical launch (hitting car, snowman, etc.) +#define HIT_BY_STAR_EFFECT 0x2000000 // being hit by a red shell or star +#define SQUISH_EFFECT 0x4000000 // hitting an object +#define POST_SQUISH_EFFECT 0x8000000 // briefly after being squished (boulder, thwomp, etc.) +#define UNKNOWN_EFFECT_0x10000000 0x10000000 // UNUSED (set in unused func_8008FDF4) +#define DRIFT_OUTSIDE_EFFECT 0x20000000 // drifting toward the outside of your turn +#define LIGHTNING_EFFECT 0x40000000 // suffering the effects of lightning +#define BOO_EFFECT 0x80000000 // being a boo +#define ALL_EFFECTS 0xFFFFFFFF +// clang-format on + +/** + * @brief durations of effects + */ +#define STAR_EFFECT_DURATION 0xA +#define BOO_EFFECT_DURATION 0x7 + +/** + * @brief alpha relates values + */ +#define ALPHA_MAX 0xFF +#define ALPHA_MIN 0x0 +#define ALPHA_BOO_EFFECT 0x60 /** * @brief shell state diff --git a/include/macros.h b/include/macros.h index 9eec8230ba..7a522bc53b 100644 --- a/include/macros.h +++ b/include/macros.h @@ -103,4 +103,6 @@ **/ #define GET_PACKED_END(dl) (((u8*) dl) + sizeof(dl) - sizeof(dl[0]) - 0x07000000) +#define SQ(x) ((x) * (x)) + #endif diff --git a/include/mk64.h b/include/mk64.h index ab9bd7cb9a..a034e20559 100644 --- a/include/mk64.h +++ b/include/mk64.h @@ -6,6 +6,8 @@ * Global header for mk64 */ +#include + /*======================= Configuration =======================*/ @@ -23,31 +25,6 @@ // Border Height Define for NTSC Versions #define BORDER_HEIGHT 1 -typedef enum { - /* 0x00 */ COURSE_MARIO_RACEWAY = 0, - /* 0x01 */ COURSE_CHOCO_MOUNTAIN, - /* 0x02 */ COURSE_BOWSER_CASTLE, - /* 0x03 */ COURSE_BANSHEE_BOARDWALK, - /* 0x04 */ COURSE_YOSHI_VALLEY, - /* 0x05 */ COURSE_FRAPPE_SNOWLAND, - /* 0x06 */ COURSE_KOOPA_BEACH, - /* 0x07 */ COURSE_ROYAL_RACEWAY, - /* 0x08 */ COURSE_LUIGI_RACEWAY, - /* 0x09 */ COURSE_MOO_MOO_FARM, - /* 0x0A */ COURSE_TOADS_TURNPIKE, - /* 0x0B */ COURSE_KALAMARI_DESERT, - /* 0x0C */ COURSE_SHERBET_LAND, - /* 0x0D */ COURSE_RAINBOW_ROAD, - /* 0x0E */ COURSE_WARIO_STADIUM, - /* 0x0F */ COURSE_BLOCK_FORT, - /* 0x10 */ COURSE_SKYSCRAPER, - /* 0x11 */ COURSE_DOUBLE_DECK, - /* 0x12 */ COURSE_DK_JUNGLE, - /* 0x13 */ COURSE_BIG_DONUT, - /* 0x14 */ COURSE_AWARD_CEREMONY, - /* 0x15 */ NUM_COURSES -} COURSES; - #define COURSE_NULL 0xFF typedef enum { diff --git a/include/objects.h b/include/objects.h index 7e83202246..a0a0efa697 100644 --- a/include/objects.h +++ b/include/objects.h @@ -182,7 +182,7 @@ extern s16 D_80165750; /** * These seem to be limits on different object types in Moo Moo Farm - * See init_course_object in code_8006E9C0.c + * See init_course_objects in code_8006E9C0.c * Maybe max number of active moles in a given group of moles? */ extern s32 D_8018D1C8; @@ -205,12 +205,8 @@ extern Collision D_8018C0B0[]; #define NUM_YV_FLAG_POLES 4 -typedef struct { - /* 0x0 */ Vec3s pos; - /* 0x6 */ u16 rot; -} YVFlagPoleSpawn; // size = 0x8; - -extern YVFlagPoleSpawn D_800E5DF4[]; +// pos, rot +extern s16 D_800E5DF4[]; #define NUM_CRABS 0xA @@ -227,7 +223,8 @@ extern CrabSpawn gCrabSpawns[]; #define NUM_THWOMPS_100CC_EXTRA 11 #define NUM_THWOMPS_150CC 12 -extern Vec3f D_800E6734[]; +// pos x,y,z +extern float D_800E6734[]; typedef struct { /* 0x0 */ s16 startX; diff --git a/include/path.h b/include/path.h new file mode 100644 index 0000000000..e85613c14a --- /dev/null +++ b/include/path.h @@ -0,0 +1,98 @@ +#ifndef PATH_H +#define PATH_H + +#include + +typedef struct { + /* 0x00 */ s16 posX; + /* 0x02 */ s16 posY; + /* 0x04 */ s16 posZ; + /* 0x06 */ u16 trackSectionId; +} TrackPathPoint; // size = 0x08 + +enum { + RIGHT_LEANING_CURVE = 0, + LEFT_LEANING_CURVE = 1, + RIGHT_CURVE = 2, // strong curve + LEFT_CURVE = 3, // strong curve + STRAIGHT = 4 +}; + +/** + * These are per-path arrays that contain some information relating to path + * The arrays in gTrackPaths contain X/Y/Z and track segment information + * The arrays in gTrackLeftPaths and gTrackRightPaths track some other X/Y/Z, but the track segment is always 0 + * (so, untracked/unused) Its unclear how these arrays relate to each other + **/ +extern TrackPathPoint* gTrackPaths[]; +extern TrackPathPoint* gTrackLeftPaths[]; +extern TrackPathPoint* gTrackRightPaths[]; + +/** + * Don't know what exactly these are, but like gTrackPaths, gTrackLeftPaths, and gTrackRightPaths + * they track something about the path on a per-path basis + **/ +// PathPoint types? +extern s16* gTrackSectionTypes[]; +// Based on analyse_angle_path this may be angles between path point +// gPathExpectedRotation[i] = atan2(path_point_i, path_point_i+1)? +extern s16* gPathExpectedRotation[]; +// No idea. Adjacency list? +extern s16* gTrackConsecutiveCurveCounts[]; + +/** + * Certain parts of the path point logic will copy some path/player specific data to a temporary variable. + * For example: gCurrentTrackPath is always a value from gTrackPaths. Depending on which path + * a given player is on, the specific value may change + **/ +// Shadows values from gNearestPathPointByPlayerId +extern s16 sSomeNearestPathPoint; +// Shadows values from gPathIndexByPlayerId +extern s32 gPlayerPathIndex; +// Shadows values from gTrackLeftPaths +extern TrackPathPoint* gCurrentTrackLeftPath; +// Shadows values from gTrackRightPaths +extern TrackPathPoint* gCurrentTrackRightPath; +// Shadows values from gTrackSectionTypes +extern s16* gCurrentTrackSectionTypesPath; +// Shadows values from gPathExpectedRotation +extern s16* gCurrentPathPointExpectedRotationPath; +// Shadowd values from gPathCountByPathIndex +extern u16 gSelectedPathCount; +// Shadows values from gTrackPaths +extern TrackPathPoint* gCurrentTrackPath; +// Shadows values from gTrackConsecutiveCurveCounts +extern s16* gCurrentTrackConsecutiveCurveCountsPath; + +extern u16 gNearestPathPointByPlayerId[]; // D_80164438 +// Total path point passed by playerId? +extern s32 gNumPathPointsTraversed[]; +extern u16 gPathIndexByPlayerId[]; // D_801645B0 +extern u16 gPathCountByPathIndex[]; // D_801645C8 +// These values are only used when the camera is in "cinematic" mode +extern s16 gNearestPathPointByCameraId[]; // D_80164668 + +/** + * Stuff that may not be directly related to path, but are only referenced in cpu_vehicles_camera_path. + * So they are at least path point adjacent. + **/ + +// Tracks something on a per-player basis, no idea what though +extern f32 gTrackPositionFactor[]; +// Track segment by playerId, although it curiously does NOT track values for human players +// So, in 2 Player Grand Prix, the first 2 entries are always 0 +extern u16 gPlayersTrackSectionId[]; +// Seems to be a per-path overcount of the path point count +extern s32 gSizePath[]; +// Seemingly the Z position of the 1st path point in the 0th path? +extern f32 gPathStartZ; +// These seem to track whether a player has entered or exited the "unknown" zone in yoshi's valley +// See yoshi_valley_cpu_path and update_cpu_path_completion +// Is 1 when a player is in the "unknown" zone in yoshi's valley +extern s16 cpu_enteringPathIntersection[]; +// Is 1 when a player leaves the "unknown" zone in yoshi's valley +extern s16 cpu_exitingPathIntersection[]; +// Tracks whether a given player is in the "unknown" zone of yoshi's valley +extern s16 bInMultiPathSection[]; + +#endif diff --git a/include/seq_ids.h b/include/seq_ids.h new file mode 100644 index 0000000000..81382dc27a --- /dev/null +++ b/include/seq_ids.h @@ -0,0 +1,38 @@ +#ifndef SEQ_IDS_H +#define SEQ_IDS_H + +enum SeqId { + SEQ_SOUND_PLAYER, // 0x00 (00) + SEQ_MENU_TITLE_SCREEN, // 0x01 (01) + SEQ_MENU_MAIN_MENU, // 0x02 (02) + SEQ_TRACK_RACEWAY, // 0x03 (03) + SEQ_TRACK_FARM, // 0x04 (04) + SEQ_TRACK_MOUNTAIN, // 0x05 (05) + SEQ_TRACK_BEACH, // 0x06 (06) + SEQ_TRACK_SCARY, // 0x07 (07) + SEQ_TRACK_SNOW, // 0x08 (08) + SEQ_TRACK_CASTLE, // 0x09 (09) + SEQ_TRACK_DESERT, // 0x0A (10) + SEQ_EVENT_RACE_STARTING, // 0x0B (11) + SEQ_EVENT_RACE_FINAL_LAP, // 0x0C (12) + SEQ_EVENT_RACE_FINISH_FIRST, // 0x0D (13) + SEQ_EVENT_RACE_FINISH_OTHER, // 0x0E (14) + SEQ_EVENT_RACE_FINISH_LOSE, // 0x0F (15) + SEQ_MENU_RESULTS_SCREEN_WIN, // 0x10 (16) + SEQ_EVENT_RACE_POWERUP_STAR, // 0x11 (17) + SEQ_TRACK_RAINBOW, // 0x12 (18) + SEQ_TRACK_JUNGLE, // 0x13 (19) + SEQ_EVENT_CEREMONY_TROPHY_LOSE, // 0x14 (20) + SEQ_TRACK_TURNPIKE, // 0x15 (21) + SEQ_EVENT_RACE_STARTING_VS, // 0x16 (22) + SEQ_MENU_RESULTS_SCREEN_WIN_VS, // 0x17 (23) + SEQ_MENU_RESULTS_SCREEN_LOSE, // 0x18 (24) + SEQ_TRACK_BATTLE, // 0x19 (25) + SEQ_EVENT_CEREMONY_PRESENTATION_PART1, // 0x1A (26) + SEQ_EVENT_CEREMONY_PRESENTATION_PART2_WIN, // 0x1B (27) + SEQ_EVENT_CEREMONY_TROPHY_CREDITS, // 0x1C (28) + SEQ_EVENT_CEREMONY_PRESENTATION_PART2_LOSE, // 0x1D (29) + SEQ_COUNT +}; + +#endif // SEQ_IDS_H diff --git a/include/spline.h b/include/spline.h index 0d06a0ece8..97d64b3863 100644 --- a/include/spline.h +++ b/include/spline.h @@ -18,7 +18,7 @@ This stuff is all about the b-splines used objects like Lakitu and the Boos on B For splines used during the award ceremony and credits, see src/ending/ceremony_and_credits.h */ -typedef struct { +typedef struct SplineControlPoint { /* 0x0 */ Vec3s pos; // Don't really know what to call this member. // It somehow controls the speed of travel along a segment of the spline but I don't really get how it works @@ -28,7 +28,7 @@ typedef struct { // WARNING!!! // You really, really shouldn't use this type for actual spline data. This is intended as a generic SplineData // type. I would use a union, but that would cause significant ugliness elsewhere in the codebase -typedef struct { +typedef struct SplineData { // This name is a little misleading // The control point arrays have more control points in them than this number indicates. Not sure why though. s16 numControlPoints; diff --git a/include/vehicles.h b/include/vehicles.h index b24717fe4d..5590390bcb 100644 --- a/include/vehicles.h +++ b/include/vehicles.h @@ -40,7 +40,7 @@ typedef struct { /* 0x02 */ s16 compilerPadding; /* 0x04 */ Vec3f position; /* 0x10 */ Vec3f velocity; - /* 0x1C */ u16 waypointIndex; + /* 0x1C */ u16 pathPointIndex; /* 0x1E */ s16 actorIndex; /* 0x20 */ s32 unused; // Not read or written. Could be padding? } TrainCarStuff; // size = 0x24; @@ -56,19 +56,19 @@ typedef struct { } TrainStuff; // size = 0x10C typedef struct { - /* 0x00 */ s16 isActive; // The paddle wheel boat only shows up if the number of players is < 3 - /* 0x02 */ // s16 compilerPadding; - /* 0x04 */ Vec3f position; // - /* 0x10 */ Vec3f velocity; // - /* 0x1C */ u16 waypointIndex; // - /* 0x1E */ s16 actorIndex; // - /* 0x20 */ f32 speed; // - /* 0x24 */ s16 rotY; // Only Y rotation is tracked in this struct - /* 0x26 */ // s16 compilerPadding2; - /** - * Bit field that tracks whether a given human player is within a certain distance of the boat - * Probably audio related - **/ + /* 0x00 */ s16 isActive; // The paddle wheel boat only shows up if the number of players is < 3 + /* 0x02 */ // s16 compilerPadding; + /* 0x04 */ Vec3f position; // + /* 0x10 */ Vec3f velocity; // + /* 0x1C */ u16 pathPointIndex; // + /* 0x1E */ s16 actorIndex; // + /* 0x20 */ f32 speed; // + /* 0x24 */ s16 rotY; // Only Y rotation is tracked in this struct + /* 0x26 */ // s16 compilerPadding2; + /** + * Bit field that tracks whether a given human player is within a certain distance of the boat + * Probably audio related + **/ /* 0x28 */ s32 someFlags; } PaddleBoatStuff; // size = 0x2C @@ -77,7 +77,7 @@ typedef struct { /* 0x02 */ // s16 compilerPadding; /* 0x04 */ Vec3f position; /* 0x10 */ Vec3f velocity; - /* 0x1C */ u16 waypointIndex; + /* 0x1C */ u16 pathPointIndex; /* 0x1E */ s16 actorIndex; /* 0x20 */ f32 speed; // /* 0x24 */ f32 someMultiplierTheSequel; // diff --git a/include/waypoints.h b/include/waypoints.h deleted file mode 100644 index 2583e8a110..0000000000 --- a/include/waypoints.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef WAYPOINTS_H -#define WAYPOINTS_H - -#include - -typedef struct { - /* 0x00 */ s16 posX; - /* 0x02 */ s16 posY; - /* 0x04 */ s16 posZ; - /* 0x06 */ u16 trackSectionId; -} TrackWaypoint; // size = 0x08 - -/** - * These are per-path arrays that contain some information relating to waypoints - * The arrays in D_80164550 contain X/Y/Z and track segment information - * The arrays in D_80164560 and D_80164570 track some other X/Y/Z, but the track segment is always 0 (so, - *untracked/unused) Its unclear how these arrays relate to each other - **/ -extern TrackWaypoint* D_80164550[]; -extern TrackWaypoint* D_80164560[]; -extern TrackWaypoint* D_80164570[]; - -/** - * Don't know what exactly these are, but like D_80164550, D_80164560, and D_80164570 - * they track something about the waypoints on a per-path basis - **/ -// Waypoint types? -extern s16* D_80164580[]; -// Based on func_80010DBC this may be angles between waypoints -// D_80164590[i] = atan2(waypoint_i, waypoint_i+1)? -extern s16* D_80164590[]; -// No idea. Adjacency list? -extern s16* D_801645A0[]; - -/** - * Certain parts of the waypoint logic will copy some path/player specific data to a temporary variable. - * For example: D_80164490 is always a value from D_80164550. Depending on which path - * a given player is on, the specific value may change - **/ -// Shadows values from gNearestWaypointByPlayerId -extern s16 sSomeNearestWaypoint; -// Shadows values from gPathIndexByPlayerId -extern s32 D_80163448; -// Shadows values from D_80164560 -extern TrackWaypoint* D_801631D0; -// Shadows values from D_80164570 -extern TrackWaypoint* D_801631D4; -// Shadows values from D_80164580 -extern s16* D_801631D8; -// Shadows values from D_80164590 -extern s16* D_801631DC; -// Shadowd values from gWaypointCountByPathIndex -extern u16 D_80164430; -// Shadows values from D_80164550 -extern TrackWaypoint* D_80164490; -// Shadows values from D_801645A0 -extern s16* D_801645E0; - -extern u16 gNearestWaypointByPlayerId[]; // D_80164438 -// Total waypoints passed by playerId? -extern s32 D_80164450[]; -extern u16 gPathIndexByPlayerId[]; // D_801645B0 -extern u16 gWaypointCountByPathIndex[]; // D_801645C8 -// These values are only used when the camera is in "cinematic" mode -extern s16 gNearestWaypointByCameraId[]; // D_80164668 - -/** - * Stuff that may not be directly related to waypoints, but are only referenced in code_80005FD0. - * So they are at least waypoint adjacent. - **/ - -// Tracks something on a per-player basis, no idea what though -extern f32 D_80163068[]; -// Track segment by playerId, although it curiously does NOT track values for human players -// So, in 2 Player Grand Prix, the first 2 entries are always 0 -extern u16 D_80163318[]; -// Seems to be a per-path overcount of the waypoint count -extern s32 D_80163368[]; -// Seemingly the Z position of the 1st waypoint in the 0th path? -extern f32 D_8016344C; -// These seem to track whether a player has entered or exited the "unknown" zone in yoshi's valley -// See func_80009000 and func_800090F0 -// Is 1 when a player is in the "unknown" zone in yoshi's valley -extern s16 D_80163490[]; -// Is 1 when a player leaves the "unknown" zone in yoshi's valley -extern s16 D_801634A8[]; -// Tracks whether a given player is in the "unknown" zone of yoshi's valley -extern s16 D_801644F8[]; - -#endif diff --git a/m2c_helper.sh b/m2c_helper.sh index 0cbe3ccf53..12941173ad 100644 --- a/m2c_helper.sh +++ b/m2c_helper.sh @@ -5,7 +5,7 @@ # Utility to aid in the generation of m2c output for specific functions # # example usages: -# m2c_helper.sh code_80091750 func_800AAC18 +# m2c_helper.sh menu_item func_800AAC18 # m2c_helper.sh audio/load audio_init # # Be sure to set DISASSEMBLY_FILE to a filename you are comfortable with. diff --git a/mk64.eu-1.0.sha1 b/mk64.eu-1.0.sha1 deleted file mode 100644 index 2bae3811f1..0000000000 --- a/mk64.eu-1.0.sha1 +++ /dev/null @@ -1 +0,0 @@ -a729039453210b84f17019dda3f248d5888f7690 build/eu-1.0/mk64.eu-1.0.z64 diff --git a/mk64.eu-final.sha1 b/mk64.eu-final.sha1 deleted file mode 100644 index ad92f6bcde..0000000000 --- a/mk64.eu-final.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6b5f519dd57ea59e9f013cc64816e9d273b2329 build/eu-final/mk64.eu-final.z64 diff --git a/mk64.eu.v10.sha1 b/mk64.eu.v10.sha1 new file mode 100644 index 0000000000..40ef7d2918 --- /dev/null +++ b/mk64.eu.v10.sha1 @@ -0,0 +1 @@ +a729039453210b84f17019dda3f248d5888f7690 build/eu.v10/mk64.eu.v10.z64 diff --git a/mk64.eu.v11.sha1 b/mk64.eu.v11.sha1 new file mode 100644 index 0000000000..eb395bc0c7 --- /dev/null +++ b/mk64.eu.v11.sha1 @@ -0,0 +1 @@ +f6b5f519dd57ea59e9f013cc64816e9d273b2329 build/eu.v11/mk64.eu.v11.z64 diff --git a/mk64.ld b/mk64.ld index 7e83bfac3c..d3636752c3 100644 --- a/mk64.ld +++ b/mk64.ld @@ -50,9 +50,9 @@ SECTIONS BUILD_DIR/src/profiler.o(.text*); BUILD_DIR/src/crash_screen.o(.text*); BUILD_DIR/src/animation.o(.text*); - BUILD_DIR/src/staff_ghosts.o(.text*); + BUILD_DIR/src/replays.o(.text*); BUILD_DIR/asm/unused_overflow_check.o(.text); - BUILD_DIR/src/code_80005FD0.jp.o(.text*); + BUILD_DIR/src/cpu_vehicles_camera_path.jp.o(.text*); BUILD_DIR/src/camera.o(.text*); BUILD_DIR/src/render_player.o(.text*); BUILD_DIR/src/kart_dma.o(.text*); @@ -71,7 +71,7 @@ SECTIONS BUILD_DIR/src/code_80086E70.o(.text*); BUILD_DIR/src/effects.o(.text*); BUILD_DIR/src/code_80091440.o(.text*); - BUILD_DIR/src/code_80091750.jp.o(.text*); + BUILD_DIR/src/menu_items.jp.o(.text*); BUILD_DIR/src/code_800AF9B0.o(.text*); BUILD_DIR/src/menus.o(.text*); BUILD_DIR/src/save.o(.text*); @@ -218,7 +218,7 @@ SECTIONS BUILD_DIR/src/code_800029B0.o(.data*); BUILD_DIR/src/profiler.o(.data*); BUILD_DIR/src/crash_screen.o(.data*); - BUILD_DIR/src/staff_ghosts.o(.data*); + BUILD_DIR/src/replays.o(.data*); BUILD_DIR/src/data/path_spawn_metadata.o(.data*); BUILD_DIR/src/camera.o(.data*); BUILD_DIR/src/render_player.o(.data*); @@ -232,7 +232,7 @@ SECTIONS BUILD_DIR/src/data/some_data.o(.data*); BUILD_DIR/src/effects.o(.data*); BUILD_DIR/src/code_80091440.o(.data*); - BUILD_DIR/src/code_80091750.jp.o(.data*); + BUILD_DIR/src/menu_items.jp.o(.data*); BUILD_DIR/src/code_800AF9B0.o(.data*); BUILD_DIR/src/menus.o(.data*); BUILD_DIR/src/save.o(.data*); @@ -269,7 +269,7 @@ SECTIONS BUILD_DIR/src/main.o(.rodata*); BUILD_DIR/src/animation.o(.rodata*); BUILD_DIR/src/code_800029B0.o(.rodata*); - BUILD_DIR/src/code_80005FD0.jp.o(.rodata*); + BUILD_DIR/src/cpu_vehicles_camera_path.jp.o(.rodata*); BUILD_DIR/src/camera.o(.rodata*); BUILD_DIR/src/render_player.o(.rodata*); BUILD_DIR/src/player_controller.o(.rodata*); @@ -284,7 +284,7 @@ SECTIONS BUILD_DIR/src/code_80086E70.o(.rodata*); BUILD_DIR/src/effects.o(.rodata*); BUILD_DIR/src/code_80091440.o(.rodata*); - BUILD_DIR/src/code_80091750.jp.o(.rodata*); + BUILD_DIR/src/menu_items.jp.o(.rodata*); BUILD_DIR/src/code_800AF9B0.o(.rodata*); BUILD_DIR/src/menus.o(.rodata*); BUILD_DIR/src/save.o(.rodata*); @@ -327,17 +327,18 @@ SECTIONS BUILD_DIR/src/profiler.o(.bss*); BUILD_DIR/src/crash_screen.o(.bss*); BUILD_DIR/src/animation.o(.bss*); - BUILD_DIR/src/staff_ghosts.o(.bss*); - BUILD_DIR/src/code_80005FD0.jp.o(.bss*); + BUILD_DIR/src/replays.o(.bss*); + BUILD_DIR/src/cpu_vehicles_camera_path.jp.o(.bss*); BUILD_DIR/src/camera.o(.bss*); BUILD_DIR/src/render_player.o(.bss*); BUILD_DIR/src/spawn_players.o(.bss*); BUILD_DIR/src/code_80057C60.o(.bss*); BUILD_DIR/src/code_80057C60_var.o(.bss*); BUILD_DIR/src/effects.o(.bss*); - BUILD_DIR/src/code_80091750.jp.o(.bss*); + BUILD_DIR/src/menu_items.jp.o(.bss*); BUILD_DIR/src/code_800AF9B0.o(.bss*); BUILD_DIR/src/menus.o(.bss*); + BUILD_DIR/src/save.o(.bss*); #if DEBUG BUILD_DIR/src/os/osCartRomInit.o(.bss*); BUILD_DIR/src/debug/crash_screen_enhancement.o(.bss*); @@ -655,13 +656,11 @@ SECTIONS #else BUILD_DIR/data/sound_data/sequences.o(.data); #endif + . = ALIGN(0x40); } END_SEG(sequences) - BEGIN_SEG(instrument_sets, 0x282E80) + BEGIN_SEG(instrument_sets, .) { - #ifdef VERSION_EU - . += 0x20; - #endif BUILD_DIR/data/sound_data/instrument_sets.o(.data); } END_SEG(instrument_sets) diff --git a/models/README.MD b/models/README.MD index 6e36b13129..e35be73e14 100644 --- a/models/README.MD +++ b/models/README.MD @@ -9,4 +9,4 @@ run `make model_extract -j` to extract assets in multithreaded. And waits (for m you can run `make fast64_blender` to run blender with fast64 enable without downloading it. ## Organisation -In Tracks there is all track json and folder (once extracted). In each track folder you can find three folder objects, sections, preview, collision_sections. Objects are all assets who are use for object/actor. Sections are all sections reference in a Gfx list who are use with render_course_segments. And preview are the version of the track who are use in func_8029569C who the complete track or a big part (some are broken). Collision sections are just collision who are use in mk64. \ No newline at end of file +In Tracks there is all track json and folder (once extracted). In each track folder you can find three folder objects, sections, preview, collision_sections. Objects are all assets who are use for object/actor. Sections are all sections reference in a Gfx list who are use with render_course_segments. And preview are the version of the track who are use in render_course_credits who the complete track or a big part (some are broken). Collision sections are just collision who are use in mk64. \ No newline at end of file diff --git a/models/tracks/banshee_boardwalk.zip b/models/tracks/banshee_boardwalk.zip new file mode 100644 index 0000000000..abf3fed424 Binary files /dev/null and b/models/tracks/banshee_boardwalk.zip differ diff --git a/permuter_settings.toml b/permuter_settings.toml index 96202e62e7..c07b361707 100644 --- a/permuter_settings.toml +++ b/permuter_settings.toml @@ -22,6 +22,7 @@ compiler_type = "ido" "_SHIFT[LR]" = "void" "ALIGN.*" = "int" "aClearBuffer" = "void" +"aEnvSetup1Alt" = "void" "aEnvSetup1" = "void" "aEnvSetup2" = "void" "aEnvMixer" = "void" diff --git a/progress.py b/progress.py old mode 100644 new mode 100755 index 0b002aa2a7..96a0733bf1 --- a/progress.py +++ b/progress.py @@ -5,7 +5,6 @@ import csv import os import re -from pybadges import badge # Script arguments. parser = argparse.ArgumentParser(description="Computes current progress throughout the whole project.") @@ -342,16 +341,6 @@ def get_string_from_table(idx, table): else: return "Number out of range" -# Finds the closest divisible of a number to get a result without decimals. -def find_closest_divisible(number, divisor): - closest_smaller = number - (number % divisor) - closest_larger = closest_smaller + divisor - - if abs(number - closest_smaller) < abs(number - closest_larger): - return closest_smaller - else: - return closest_larger - # Centers a text around a specified filled character and how long it should be. def center_text(text, total_width, fill_character=" "): empty_spaces = total_width - len(text) @@ -477,15 +466,17 @@ def list_detailed_progress_and_files(pct, prog, size, objlist, charseg): print(str(TotalNonMatchingFunctions)) # Shows decompilation progress output in a fancy way. elif args.format == 'text': - outputLength = 67 # Horizontal length of the text in the terminal output - # "Magic" number is 48, which is 3 laps * 4 courses * 3 cups - bytesPerTotalLaps = total_code_size // 47 # Total size // (Magic number - 1) - srcDivNear = find_closest_divisible(total, 49) # Correct division by diving closest divisible with (Magic number + 1) - lapTotalCounts = int(srcDivNear / bytesPerTotalLaps) # Game progress count, sets where are we in a simulated game, can be between 0 - 47 - curLapProgress = int(((srcDivNear % bytesPerTotalLaps) * (outputLength - 1)) / (bytesPerTotalLaps)) # Progress of a lap depending of the output length - curLapCount = int((lapTotalCounts % 3) + 1) # Lap count, can be between 1 - 3 (3 laps total) - curCourseCount = int(lapTotalCounts / 3) # Course count, can be between 0 - 15 (16 courses total) - curCupCount = int((lapTotalCounts / 12) % 12) # Cup count, can be between 0 - 3 (4 cups total) + outputLength = 67 # Horizontal length of the text in the terminal output + total_progress_units = 47 # 3 laps × 16 courses - 1 (0-47) + bytes_per_unit = total_code_size / total_progress_units # Use float division for precision + # Current progress in units (0-47) + progress_units = min(int(total / bytes_per_unit + 0.5), total_progress_units) # Round to nearest unit + # Calculate visual progress within current lap (for the progress bar) + lap_progress = int(((total % bytes_per_unit) * (outputLength - 1)) / bytes_per_unit) + # Calculate race position (1-3 laps, 0-15 courses, 0-3 cups) + cur_lap = (progress_units // 16) + 1 # 1-3 (0-15=Lap1, 16-31=Lap2, 32-47=Lap3) + cur_course = progress_units % 16 # 0-15 (all courses) + cur_cup = cur_course // 4 # 0-3 (4 courses per cup) # Print current decompilation progress. print(str(center_text((str(" Non Matching progress mode ") if args.nonmatching else str("")), outputLength, "="))) @@ -499,11 +490,11 @@ def list_detailed_progress_and_files(pct, prog, size, objlist, charseg): # Simlautes an All Cups race, prints how much the player has been progressing. if TotalGlobalAsmFunctions > 0: - print(str(center_text(check_table_cond(0, curCupCount, mkCups) + " - " + check_table_cond(1, curCupCount, mkCups), outputLength))) - print(str(center_text(check_table_cond(2, curCupCount, mkCups) + " - " + check_table_cond(3, curCupCount, mkCups), outputLength))) + print(str(center_text(check_table_cond(0, cur_cup, mkCups) + " - " + check_table_cond(1, cur_cup, mkCups), outputLength))) + print(str(center_text(check_table_cond(2, cur_cup, mkCups) + " - " + check_table_cond(3, cur_cup, mkCups), outputLength))) print(str(center_text(" Lap Progress Bar and Race Status ", outputLength, "-"))) - print(str(move_character_from_bar(curLapProgress, outputLength, "O", "-"))) - print(str(center_text("We are in " + str(get_string_from_table(curCupCount, mkCups)) + " racing at " + str(get_string_from_table(curCourseCount, mkCourses)) + " (Lap " + str(curLapCount) + "/3)", outputLength))) + print(str(move_character_from_bar(lap_progress, outputLength, "O", "-"))) + print(str(center_text("We are in " + str(get_string_from_table(cur_cup, mkCups)) + " racing at " + str(get_string_from_table(cur_course, mkCourses)) + " (Lap " + str(cur_lap) + "/3)", outputLength))) else: print(str(center_text("Mushroom Cup (V) - Flower Cup (V)", outputLength))) print(str(center_text("Star Cup (V) - Special Cup (V)", outputLength))) @@ -526,6 +517,7 @@ def list_detailed_progress_and_files(pct, prog, size, objlist, charseg): print(str(libultra) + "/" + str(libultra_size) + " bytes " + adjective + " in libultra " + str(libultraPct) + "%\n") elif args.format == 'badge': + from pybadges import badge adjective = "decompiled" if args.nonmatching else "matched" badge_size_left = badge(left_text="Size left", right_text=str(remaining_size), right_color="blue") diff --git a/safe_gcc.mk b/safe_gcc.mk index b580c9472f..0f5bb135c2 100644 --- a/safe_gcc.mk +++ b/safe_gcc.mk @@ -7,11 +7,11 @@ SAFE_C_FILES := \ build/us/src/code_80091440.o \ build/us/src/effects.o \ build/us/src/code_80057C60_var.o \ - build/us/src/code_80091750.o \ + build/us/src/menu_items.o \ build/us/src/code_800029B0.o \ build/us/src/animation.o \ build/us/src/player_controller.o \ - build/us/src/code_80005FD0.o \ + build/us/src/cpu_vehicles_camera_path.o \ build/us/src/profiler.o \ build/us/src/render_player.o \ build/us/src/code_80086E70.o \ diff --git a/src/actors/banana/render.inc.c b/src/actors/banana/render.inc.c index f51bc6aa66..abd2fa7b77 100644 --- a/src/actors/banana/render.inc.c +++ b/src/actors/banana/render.inc.c @@ -15,8 +15,8 @@ void render_actor_banana(Camera* camera, UNUSED Mat4 arg1, struct BananaActor* b Vec3s sp7C; Mat4 sp3C; - f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], - 490000.0f); + f32 temp = + distance_if_visible(camera->pos, banana->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f); if (temp < 0.0f) { actor_not_rendered(camera, (struct Actor*) banana); return; @@ -34,12 +34,12 @@ void render_actor_banana(Camera* camera, UNUSED Mat4 arg1, struct BananaActor* b actor_rendered(camera, (struct Actor*) banana); if (banana->state == 5) { - mtxf_pos_rotation_xyz(sp3C, banana->pos, banana->rot); + mtxf_rotate_zxy_translate(sp3C, banana->pos, banana->rot); } else { sp7C[0] = 0; sp7C[1] = 0; sp7C[2] = 0; - mtxf_pos_rotation_xyz(sp3C, banana->pos, sp7C); + mtxf_rotate_zxy_translate(sp3C, banana->pos, sp7C); } maxObjectsReached = render_set_position(sp3C, 0) == 0; diff --git a/src/actors/banana/update.inc.c b/src/actors/banana/update.inc.c index eb808aed1a..c94f141eae 100644 --- a/src/actors/banana/update.inc.c +++ b/src/actors/banana/update.inc.c @@ -58,21 +58,21 @@ void update_actor_banana(struct BananaActor* banana) { } if ((controller->buttonDepressed & Z_TRIG) != 0) { controller->buttonDepressed &= ~Z_TRIG; - banana->state = 1; + banana->state = DROPPED_BANANA; banana->unk_04 = 0x00B4; - player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT; + player->triggers &= ~DRAG_ITEM_EFFECT; func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); pad3 = controller->rawStickY; if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) { pad3 = pad3 - ((f32) 30); pad3 = (pad3 / 20.0f) + 0.5f; - if (player->unk_094 < 2.0f) { + if (player->speed < 2.0f) { temp_f0 = 4.0f; } else { - temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3; + temp_f0 = (player->speed * 0.75f) + 3.5f + pad3; } vec3f_set(someVelocity, 0, pad3, temp_f0); - func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(someVelocity, player->rotation[1] + player->unk_0C0); banana->velocity[0] = someVelocity[0]; banana->velocity[1] = someVelocity[1]; banana->velocity[2] = someVelocity[2]; @@ -121,7 +121,7 @@ void update_actor_banana(struct BananaActor* banana) { someVelocity[0] = 0.0f; someVelocity[1] = 0.0f; someVelocity[2] = -5.0f; - func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(someVelocity, player->rotation[1] + player->unk_0C0); unkX = player->pos[0] + someVelocity[0]; unkY = player->pos[1] + someVelocity[1]; unkZ = player->pos[2] + someVelocity[2]; diff --git a/src/actors/blue_and_red_shells/update.inc.c b/src/actors/blue_and_red_shells/update.inc.c index a6eb2f2698..eca28149c7 100644 --- a/src/actors/blue_and_red_shells/update.inc.c +++ b/src/actors/blue_and_red_shells/update.inc.c @@ -1,13 +1,13 @@ #include -#include +#include #include #include #include #include void func_802B3B44(struct ShellActor* shell) { - u16 currentWaypoint; - u16 nextWaypoint; + u16 currentPathPoint; + u16 nextPathPoint; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -28,14 +28,14 @@ void func_802B3B44(struct ShellActor* shell) { f32 temp_f26; Vec3f origPos; - currentWaypoint = shell->pathIndex; - temp_f2 = D_80164490[currentWaypoint].posX; - temp_f12 = D_80164490[currentWaypoint].posY; - temp_f28 = D_80164490[currentWaypoint].posZ; - nextWaypoint = currentWaypoint + 1; + currentPathPoint = shell->pathIndex; + temp_f2 = gCurrentTrackPath[currentPathPoint].posX; + temp_f12 = gCurrentTrackPath[currentPathPoint].posY; + temp_f28 = gCurrentTrackPath[currentPathPoint].posZ; + nextPathPoint = currentPathPoint + 1; - if (nextWaypoint >= D_80164430) { - nextWaypoint -= D_80164430; + if (nextPathPoint >= gSelectedPathCount) { + nextPathPoint -= gSelectedPathCount; } temp_f20 = temp_f2 - shell->pos[0]; @@ -43,9 +43,9 @@ void func_802B3B44(struct ShellActor* shell) { temp_f24 = temp_f28 - shell->pos[2]; temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24); if (temp_f0 > 400.0f) { - temp_f18_3 = D_80164490[nextWaypoint].posX; - temp_f16_3 = D_80164490[nextWaypoint].posY; - temp_f26 = D_80164490[nextWaypoint].posZ; + temp_f18_3 = gCurrentTrackPath[nextPathPoint].posX; + temp_f16_3 = gCurrentTrackPath[nextPathPoint].posY; + temp_f26 = gCurrentTrackPath[nextPathPoint].posZ; temp_f12_0 = temp_f18_3 - shell->pos[0]; temp_f12_1 = temp_f16_3 - shell->pos[1]; @@ -53,7 +53,7 @@ void func_802B3B44(struct ShellActor* shell) { temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2); if (temp_f0_3 < temp_f0) { - shell->pathIndex = nextWaypoint; + shell->pathIndex = nextPathPoint; } else { temp_f0_2 = sqrtf(temp_f0) * 4.0f; temp_f20 /= temp_f0_2; @@ -94,11 +94,11 @@ void func_802B3B44(struct ShellActor* shell) { shell->pos[0] = temp_f2; shell->pos[1] = shell->boundingBoxSize + temp_f12; shell->pos[2] = temp_f28; - shell->pathIndex = nextWaypoint; + shell->pathIndex = nextPathPoint; } else { - temp_f18_3 = D_80164490[nextWaypoint].posX; - temp_f16_3 = D_80164490[nextWaypoint].posY; - temp_f26 = D_80164490[nextWaypoint].posZ; + temp_f18_3 = gCurrentTrackPath[nextPathPoint].posX; + temp_f16_3 = gCurrentTrackPath[nextPathPoint].posY; + temp_f26 = gCurrentTrackPath[nextPathPoint].posZ; shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f; shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize; @@ -172,9 +172,9 @@ s16 func_802B3FD0(Player* owner, struct ShellActor* shell) { if (gPlayerBalloonCount[playerIndex] < 0) { continue; } - // func_802B51E8 is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the - // positions - playerToShellDistance = func_802B51E8(player->pos, shell->pos); + // dist_squared_bugged is not quite a 3D distance function, it doubles (rather than squares) the Z difference of + // the positions + playerToShellDistance = dist_squared_bugged(player->pos, shell->pos); if (playerToShellDistance < smallestDistance) { smallestDistance = playerToShellDistance; playerId = player - gPlayerOne; @@ -250,7 +250,7 @@ void update_actor_red_blue_shell(struct ShellActor* shell) { somePosVel[0] = 0.0f; somePosVel[1] = player->boundingBoxSize; somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f); - mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix); + mtxf_transform_vec3f_mat3(somePosVel, player->orientationMatrix); shell->pos[0] = player->pos[0] + somePosVel[0]; pad7 = player->pos[1] - somePosVel[1]; shell->pos[2] = player->pos[2] + somePosVel[2]; @@ -317,13 +317,13 @@ void update_actor_red_blue_shell(struct ShellActor* shell) { if (shell->state == MOVING_SHELL) { shell->someTimer = 0x001E; height = 8.0f; - if (player->unk_094 > 8.0f) { - height = player->unk_094 * 1.2f; + if (player->speed > 8.0f) { + height = player->speed * 1.2f; } somePosVel[0] = 0.0f; somePosVel[1] = 0.0f; somePosVel[2] = height; - func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0)); + vec3f_rotate_y(somePosVel, (s16) (player->rotation[1] + player->unk_0C0)); shell->velocity[0] = somePosVel[0]; shell->velocity[1] = somePosVel[1]; shell->velocity[2] = somePosVel[2]; @@ -331,7 +331,7 @@ void update_actor_red_blue_shell(struct ShellActor* shell) { somePosVel[0] = sins(shell->rotAngle) * 8.0f; somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize; somePosVel[2] = coss(shell->rotAngle) * 8.0f; - mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix); + mtxf_transform_vec3f_mat3(somePosVel, player->orientationMatrix); shell->pos[0] = player->pos[0] + somePosVel[0]; shell->pos[1] = player->pos[1] + somePosVel[1]; shell->pos[2] = player->pos[2] + somePosVel[2]; @@ -346,9 +346,9 @@ void update_actor_red_blue_shell(struct ShellActor* shell) { shell->targetPlayer = gPlayerPositionLUT[0]; shell->state = BLUE_SHELL_LOCK_ON; shell->shellId = 1000.0f; - temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8; - if ((s32) D_80164430 < temp_v0) { - temp_v0 -= D_80164430; + temp_v0 = gNearestPathPointByPlayerId[player - gPlayerOne] + 8; + if ((s32) gSelectedPathCount < temp_v0) { + temp_v0 -= gSelectedPathCount; } shell->pathIndex = temp_v0; } else if (gModeSelection == BATTLE) { @@ -367,17 +367,17 @@ void update_actor_red_blue_shell(struct ShellActor* shell) { if (player->currentRank == 0) { shell->state = TRIPLE_GREEN_SHELL; shell->someTimer = 0x0258; - temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8; - if ((s32) D_80164430 < temp_v0) { - temp_v0 -= D_80164430; + temp_v0 = gNearestPathPointByPlayerId[player - gPlayerOne] + 8; + if ((s32) gSelectedPathCount < temp_v0) { + temp_v0 -= gSelectedPathCount; } shell->pathIndex = temp_v0; } else if (player->currentRank >= 5) { shell->state = GREEN_SHELL_HIT_A_RACER; shell->shellId = 1000.0f; - temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8; - if ((s32) D_80164430 < temp_v0) { - temp_v0 -= D_80164430; + temp_v0 = gNearestPathPointByPlayerId[player - gPlayerOne] + 8; + if ((s32) gSelectedPathCount < temp_v0) { + temp_v0 -= gSelectedPathCount; } shell->pathIndex = temp_v0; shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1]; @@ -437,7 +437,7 @@ void update_actor_red_blue_shell(struct ShellActor* shell) { somePosVel[0] = sins(shell->rotAngle) * 8.0f; somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize; somePosVel[2] = coss(shell->rotAngle) * 8.0f; - mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix); + mtxf_transform_vec3f_mat3(somePosVel, player->orientationMatrix); origPos[0] = shell->pos[0]; origPos[1] = shell->pos[1]; origPos[2] = shell->pos[2]; diff --git a/src/actors/box_truck/render.inc.c b/src/actors/box_truck/render.inc.c index 9d03c369bc..f4ab446e71 100644 --- a/src/actors/box_truck/render.inc.c +++ b/src/actors/box_truck/render.inc.c @@ -17,7 +17,7 @@ void render_actor_box_truck(Camera* arg0, struct Actor* arg1) { Mat4 spD8; UNUSED s32 pad2[32]; f32 temp_f0 = - is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f); + distance_if_visible(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f); if (temp_f0 < 0.0f) { return; } @@ -25,7 +25,7 @@ void render_actor_box_truck(Camera* arg0, struct Actor* arg1) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(spD8, arg1->pos, arg1->rot); + mtxf_rotate_zxy_translate(spD8, arg1->pos, arg1->rot); if (render_set_position(spD8, 0) != 0) { switch (arg1->state) { diff --git a/src/actors/car/render.inc.c b/src/actors/car/render.inc.c index 73de7ee3e8..87980f80cb 100644 --- a/src/actors/car/render.inc.c +++ b/src/actors/car/render.inc.c @@ -15,14 +15,14 @@ void render_actor_car(Camera* arg0, struct Actor* arg1) { Mat4 spC8; UNUSED s32 pad2[32]; f32 temp_f0 = - is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f); + distance_if_visible(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f); if (!(temp_f0 < 0.0f)) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot); + mtxf_rotate_zxy_translate(spC8, arg1->pos, arg1->rot); mtxf_scale(spC8, 0.1f); if (render_set_position(spC8, 0) != 0) { diff --git a/src/actors/cow/render.inc.c b/src/actors/cow/render.inc.c index 769801f669..dd257207f6 100644 --- a/src/actors/cow/render.inc.c +++ b/src/actors/cow/render.inc.c @@ -13,8 +13,7 @@ * @param arg2 */ void render_actor_cow(Camera* camera, Mat4 arg1, struct Actor* arg2) { - if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], - 4000000.0f) < 0) { + if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) { return; } diff --git a/src/actors/fake_item_box/render.inc.c b/src/actors/fake_item_box/render.inc.c index a8cfd64e6a..75d7159480 100644 --- a/src/actors/fake_item_box/render.inc.c +++ b/src/actors/fake_item_box/render.inc.c @@ -24,8 +24,8 @@ void render_actor_fake_item_box(Camera* camera, struct FakeItemBox* fakeItemBox) f32 temp_f2_2; f32 someMultiplier; - if (is_within_render_distance(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], - 1000000.0f) < 0) { + if (distance_if_visible(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], + 1000000.0f) < 0) { actor_not_rendered(camera, (struct Actor*) fakeItemBox); return; } @@ -42,7 +42,7 @@ void render_actor_fake_item_box(Camera* camera, struct FakeItemBox* fakeItemBox) someRot[0] = 0; someRot[1] = fakeItemBox->rot[1]; someRot[2] = 0; - mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, someRot); + mtxf_rotate_zxy_translate(someMatrix2, fakeItemBox->pos, someRot); mtxf_scale(someMatrix2, fakeItemBox->sizeScaling); if (fakeItemBox->state != 2) { @@ -51,7 +51,7 @@ void render_actor_fake_item_box(Camera* camera, struct FakeItemBox* fakeItemBox) } gSPDisplayList(gDisplayListHead++, common_model_fake_itembox); - mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot); + mtxf_rotate_zxy_translate(someMatrix2, fakeItemBox->pos, fakeItemBox->rot); mtxf_scale(someMatrix2, fakeItemBox->sizeScaling); if (!render_set_position(someMatrix2, 0)) { @@ -78,7 +78,7 @@ void render_actor_fake_item_box(Camera* camera, struct FakeItemBox* fakeItemBox) gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gDPSetBlendMask(gDisplayListHead++, 0xFF); thing = fakeItemBox->someTimer; - mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot); + mtxf_rotate_zxy_translate(someMatrix2, fakeItemBox->pos, fakeItemBox->rot); if (thing < 10.0f) { someMultiplier = 1.0f; } else { diff --git a/src/actors/fake_item_box/update.inc.c b/src/actors/fake_item_box/update.inc.c index efb834a806..5313f7b7b2 100644 --- a/src/actors/fake_item_box/update.inc.c +++ b/src/actors/fake_item_box/update.inc.c @@ -40,12 +40,12 @@ void update_actor_fake_item_box(struct FakeItemBox* fake_item_box) { fake_item_box->pos[1], fake_item_box->pos[2]); func_802B4E30((struct Actor*) fake_item_box); temp_v1_3 = &gControllers[temp_v1]; - if ((temp_v0_4->type & 0x4000) != 0) { + if ((temp_v0_4->type & PLAYER_HUMAN) != 0) { if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) { temp_v1_3->buttonDepressed &= 0xDFFF; func_802A1064(fake_item_box); - temp_v0_4->soundEffects &= 0xFFFBFFFF; + temp_v0_4->triggers &= ~DRAG_ITEM_EFFECT; func_800C9060((u8) (temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); } } diff --git a/src/actors/falling_rock/render.inc.c b/src/actors/falling_rock/render.inc.c index 2bbca1d043..e5a1372d16 100644 --- a/src/actors/falling_rock/render.inc.c +++ b/src/actors/falling_rock/render.inc.c @@ -20,8 +20,8 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) { return; } - height = is_within_render_distance(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], - 4000000.0f); + height = + distance_if_visible(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], 4000000.0f); if (height < 0.0f) { return; @@ -37,14 +37,14 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) { sp98[1] = 0; sp98[2] = 0; sp8C[1] = height + 2.0f; - mtxf_pos_rotation_xyz(sp4C, sp8C, sp98); + mtxf_rotate_zxy_translate(sp4C, sp8C, sp98); if (render_set_position(sp4C, 0) == 0) { return; } gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_6F88); } } - mtxf_pos_rotation_xyz(sp4C, rock->pos, rock->rot); + mtxf_rotate_zxy_translate(sp4C, rock->pos, rock->rot); if (render_set_position(sp4C, 0) == 0) { return; } diff --git a/src/actors/green_shell/update.inc.c b/src/actors/green_shell/update.inc.c index 1578958446..7231af1832 100644 --- a/src/actors/green_shell/update.inc.c +++ b/src/actors/green_shell/update.inc.c @@ -43,7 +43,7 @@ void update_actor_green_shell(struct ShellActor* shell) { somePosVel[0] = 0.0f; somePosVel[1] = player->boundingBoxSize; somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f); - mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix); + mtxf_transform_vec3f_mat3(somePosVel, player->orientationMatrix); shell->pos[0] = player->pos[0] + somePosVel[0]; pad2 = player->pos[1] - somePosVel[1]; shell->pos[2] = player->pos[2] + somePosVel[2]; @@ -60,13 +60,13 @@ void update_actor_green_shell(struct ShellActor* shell) { controller->buttonDepressed &= ~Z_TRIG; if (controller->rawStickY < -0x2D) { var_f2 = 8.0f; - if (player->unk_094 > 8.0f) { - var_f2 = player->unk_094 * 1.2f; + if (player->speed > 8.0f) { + var_f2 = player->speed * 1.2f; } somePosVel[0] = 0.0f; somePosVel[1] = 0.0f; somePosVel[2] = -var_f2; - func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(somePosVel, player->rotation[1] + player->unk_0C0); shell->velocity[0] = somePosVel[0]; shell->velocity[1] = somePosVel[1]; shell->velocity[2] = somePosVel[2]; @@ -112,13 +112,13 @@ void update_actor_green_shell(struct ShellActor* shell) { } if (shell->state == 2) { var_f2 = 8.0f; - if (player->unk_094 > 8.0f) { - var_f2 = player->unk_094 * 1.2f; + if (player->speed > 8.0f) { + var_f2 = player->speed * 1.2f; } somePosVel[0] = 0.0f; somePosVel[1] = 0.0f; somePosVel[2] = var_f2; - func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(somePosVel, player->rotation[1] + player->unk_0C0); shell->velocity[0] = somePosVel[0]; shell->velocity[1] = somePosVel[1]; shell->velocity[2] = somePosVel[2]; @@ -126,7 +126,7 @@ void update_actor_green_shell(struct ShellActor* shell) { somePosVel[0] = sins(shell->rotAngle) * 6.0f; somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize; somePosVel[2] = coss(shell->rotAngle) * 6.0f; - mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix); + mtxf_transform_vec3f_mat3(somePosVel, player->orientationMatrix); shell->pos[0] = player->pos[0] + somePosVel[0]; shell->pos[1] = player->pos[1] + somePosVel[1]; shell->pos[2] = player->pos[2] + somePosVel[2]; @@ -168,7 +168,7 @@ void update_actor_green_shell(struct ShellActor* shell) { somePosVel[0] = sins(shell->rotAngle) * 8.0f; somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize; somePosVel[2] = coss(shell->rotAngle) * 8.0f; - mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix); + mtxf_transform_vec3f_mat3(somePosVel, player->orientationMatrix); somePos2[0] = shell->pos[0]; somePos2[1] = shell->pos[1]; somePos2[2] = shell->pos[2]; diff --git a/src/actors/item_box/render.inc.c b/src/actors/item_box/render.inc.c index 7024709d78..3355b06b33 100644 --- a/src/actors/item_box/render.inc.c +++ b/src/actors/item_box/render.inc.c @@ -26,8 +26,8 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { f32 temp_f2_2; f32 someMultiplier; - temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], - 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], + 4000000.0f); if (!(temp_f0 < 0.0f) && !(600000.0f < temp_f0)) { if ((item_box->state == 2) && (temp_f0 < 100000.0f)) { someRot[0] = 0; @@ -36,7 +36,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { someVec2[0] = item_box->pos[0]; someVec2[1] = item_box->resetDistance + 2.0f; someVec2[2] = item_box->pos[2]; - mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot); + mtxf_rotate_zxy_translate(someMatrix1, someVec2, someRot); if (!render_set_position(someMatrix1, 0)) { return; @@ -45,7 +45,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { gSPDisplayList(gDisplayListHead++, D_0D002EE8); someRot[1] = item_box->rot[1] * 2; someVec2[1] = item_box->pos[1]; - mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot); + mtxf_rotate_zxy_translate(someMatrix1, someVec2, someRot); if (!render_set_position(someMatrix1, 0)) { return; @@ -54,7 +54,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel); } if (item_box->state == 5) { - mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot); + mtxf_rotate_zxy_translate(someMatrix1, item_box->pos, item_box->rot); if (!render_set_position(someMatrix1, 0)) { return; @@ -63,7 +63,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel); } if (item_box->state != 3) { - mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot); + mtxf_rotate_zxy_translate(someMatrix1, item_box->pos, item_box->rot); if (!render_set_position(someMatrix1, 0)) { return; @@ -90,7 +90,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gDPSetBlendMask(gDisplayListHead++, 0xFF); thing = item_box->someTimer; - mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot); + mtxf_rotate_zxy_translate(someMatrix1, item_box->pos, item_box->rot); if (thing < 10.0f) { someMultiplier = 1.0f; } else { diff --git a/src/actors/kiwano_fruit/update.inc.c b/src/actors/kiwano_fruit/update.inc.c index a4e6b029da..5332d8e5fc 100644 --- a/src/actors/kiwano_fruit/update.inc.c +++ b/src/actors/kiwano_fruit/update.inc.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include /** * @brief Updates the kiwano fruit actor. @@ -15,10 +15,10 @@ void update_actor_kiwano_fruit(struct KiwanoFruit* fruit) { f32 temp_f16; f32 temp_f14; f32 temp_f12; - s32 nearestWaypoint; + s32 nearestPathPoint; player = &gPlayers[fruit->targetPlayer]; - if (((player->type & PLAYER_KART_AI) != 0) || (player->collision.unk34 == 0)) { + if (((player->type & PLAYER_CPU) != 0) || (player->collision.unk34 == 0)) { fruit->state = 0; return; } @@ -30,10 +30,10 @@ void update_actor_kiwano_fruit(struct KiwanoFruit* fruit) { fruit->state = 1; fruit->velocity[0] = 80.0f; case 1: - nearestWaypoint = gNearestWaypointByPlayerId[(u16) (player - gPlayerOne)]; - temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].posX; - temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].posY; - temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].posZ; + nearestPathPoint = gNearestPathPointByPlayerId[(u16) (player - gPlayerOne)]; + temp_f2 = player->pos[0] - gCurrentTrackPath[nearestPathPoint].posX; + temp_f16 = player->pos[1] - gCurrentTrackPath[nearestPathPoint].posY; + temp_f14 = player->pos[2] - gCurrentTrackPath[nearestPathPoint].posZ; temp_f12 = fruit->velocity[0] / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14)); temp_f2 *= temp_f12; temp_f16 *= temp_f12; @@ -51,14 +51,14 @@ void update_actor_kiwano_fruit(struct KiwanoFruit* fruit) { if ((player->effects & STAR_EFFECT) != 0) { func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52)); } else { - player->effects |= 0x8000; + player->effects |= ENEMY_BONK_EFFECT; player->pos[0] -= temp_f2 * 4.0f; player->pos[2] -= temp_f14 * 4.0f; player->velocity[0] -= temp_f2 * 0.7f; player->velocity[2] -= temp_f14 * 0.7f; func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18)); if (gModeSelection != GRAND_PRIX) { - D_80162DF8 = 1; + gPostTimeTrialReplayCannotSave = 1; } } } diff --git a/src/actors/mario_sign/render.inc.c b/src/actors/mario_sign/render.inc.c index 8c31370ee8..f9e7eb59e3 100644 --- a/src/actors/mario_sign/render.inc.c +++ b/src/actors/mario_sign/render.inc.c @@ -19,11 +19,11 @@ void render_actor_mario_sign(Camera* arg0, UNUSED Mat4 arg1, struct Actor* arg2) return; } - unk = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f); + unk = distance_if_visible(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f); if (!(unk < 0.0f)) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(sp40, arg2->pos, arg2->rot); + mtxf_rotate_zxy_translate(sp40, arg2->pos, arg2->rot); if (render_set_position(sp40, 0) != 0) { gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_sign); } diff --git a/src/actors/paddle_boat/render.inc.c b/src/actors/paddle_boat/render.inc.c index 13b423fd4a..d83bd9ea5d 100644 --- a/src/actors/paddle_boat/render.inc.c +++ b/src/actors/paddle_boat/render.inc.c @@ -28,8 +28,7 @@ void render_actor_paddle_boat(Camera* arg0, struct PaddleWheelBoat* boat, UNUSED return; } - temp = is_within_render_distance(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], - 9000000.0f); + temp = distance_if_visible(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], 9000000.0f); if (temp < 0.0f) { return; @@ -38,7 +37,7 @@ void render_actor_paddle_boat(Camera* arg0, struct PaddleWheelBoat* boat, UNUSED gSPSetLights1(gDisplayListHead++, D_800DC610[1]); gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH); - mtxf_pos_rotation_xyz(spE0, boat->pos, boat->boatRot); + mtxf_rotate_zxy_translate(spE0, boat->pos, boat->boatRot); if (render_set_position(spE0, 1) != 0) { // Render the boat diff --git a/src/actors/palm_tree/render.inc.c b/src/actors/palm_tree/render.inc.c index f3f92c4531..69f5b00c5b 100644 --- a/src/actors/palm_tree/render.inc.c +++ b/src/actors/palm_tree/render.inc.c @@ -20,14 +20,13 @@ void render_actor_palm_tree(Camera* arg0, UNUSED Mat4 arg1, struct PalmTree* arg return; } - temp_f0 = - is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f); + temp_f0 = distance_if_visible(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f); if (!(temp_f0 < 0.0f)) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) { func_8029794C(arg2->pos, arg2->rot, 2.0f); } - mtxf_pos_rotation_xyz(sp68, arg2->pos, spA8); + mtxf_rotate_zxy_translate(sp68, arg2->pos, spA8); if (render_set_position(sp68, 0) != 0) { gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); diff --git a/src/actors/piranha_plant/render.inc.c b/src/actors/piranha_plant/render.inc.c index aae1a59a09..6c98bd599a 100644 --- a/src/actors/piranha_plant/render.inc.c +++ b/src/actors/piranha_plant/render.inc.c @@ -25,7 +25,7 @@ void render_actor_piranha_plant(Camera* arg0, Mat4 arg1, struct PiranhaPlant* ar return; } - temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 1000000.0f); + temp_f0 = distance_if_visible(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 1000000.0f); if (temp_f0 < 0.0f) { diff --git a/src/actors/railroad_crossing/render.inc.c b/src/actors/railroad_crossing/render.inc.c index f926809157..3d32741b8a 100644 --- a/src/actors/railroad_crossing/render.inc.c +++ b/src/actors/railroad_crossing/render.inc.c @@ -13,11 +13,11 @@ void render_actor_railroad_crossing(Camera* arg0, struct RailroadCrossing* rr_crossing) { UNUSED Vec3s sp80 = { 0, 0, 0 }; Mat4 sp40; - f32 unk = is_within_render_distance(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], - 4000000.0f); + f32 unk = + distance_if_visible(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f); if (!(unk < 0.0f)) { - mtxf_pos_rotation_xyz(sp40, rr_crossing->pos, rr_crossing->rot); + mtxf_rotate_zxy_translate(sp40, rr_crossing->pos, rr_crossing->rot); if (render_set_position(sp40, 0) != 0) { gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); diff --git a/src/actors/school_bus/render.inc.c b/src/actors/school_bus/render.inc.c index 2be09bee1e..577ce7eab2 100644 --- a/src/actors/school_bus/render.inc.c +++ b/src/actors/school_bus/render.inc.c @@ -17,8 +17,7 @@ void render_actor_school_bus(Camera* arg0, struct Actor* arg1) { UNUSED s32 pad2[32]; f32 temp_f0; - temp_f0 = - is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f); + temp_f0 = distance_if_visible(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f); if (temp_f0 < 0.0f) { return; } @@ -26,7 +25,7 @@ void render_actor_school_bus(Camera* arg0, struct Actor* arg1) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot); + mtxf_rotate_zxy_translate(spC8, arg1->pos, arg1->rot); if (render_set_position(spC8, 0) != 0) { if (gActiveScreenMode == SCREEN_MODE_1P) { diff --git a/src/actors/tanker_truck/render.inc.c b/src/actors/tanker_truck/render.inc.c index 765b19a149..41d08e0d42 100644 --- a/src/actors/tanker_truck/render.inc.c +++ b/src/actors/tanker_truck/render.inc.c @@ -14,15 +14,15 @@ void render_actor_tanker_truck(Camera* camera, struct Actor* arg1) { UNUSED s32 pad[6]; Mat4 spC8; UNUSED s32 pad2[32]; - f32 temp_f0 = is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, - gCameraZoom[camera - camera1], 9000000.0f); + f32 temp_f0 = + distance_if_visible(camera->pos, arg1->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f); if (!(temp_f0 < 0.0f)) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot); + mtxf_rotate_zxy_translate(spC8, arg1->pos, arg1->rot); if (render_set_position(spC8, 0) != 0) { if (gActiveScreenMode == SCREEN_MODE_1P) { diff --git a/src/actors/train/render.inc.c b/src/actors/train/render.inc.c index 440bcca253..8be444f6c0 100644 --- a/src/actors/train/render.inc.c +++ b/src/actors/train/render.inc.c @@ -19,8 +19,8 @@ void render_actor_train_engine(Camera* camera, struct TrainCar* actor) { Mat4 spE0; Mat4 spA0; - f32 distance = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f, - gCameraZoom[camera - camera1], 9000000.0f); + f32 distance = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], + 9000000.0f); if (distance < 0.0f) { return; @@ -28,7 +28,7 @@ void render_actor_train_engine(Camera* camera, struct TrainCar* actor) { gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot); + mtxf_rotate_zxy_translate(sp120, actor->pos, actor->rot); maxObjectsReached = render_set_position(sp120, 0) == 0; if (maxObjectsReached) { return; @@ -166,8 +166,8 @@ void render_actor_train_tender(Camera* camera, struct TrainCar* actor) { Mat4 spE0; Mat4 spA0; - f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 625.0f, - gCameraZoom[camera - camera1], 9000000.0f); + f32 temp_f0 = + distance_if_visible(camera->pos, actor->pos, camera->rot[1], 625.0f, gCameraZoom[camera - camera1], 9000000.0f); if (temp_f0 < 0.0f) { return; @@ -175,7 +175,7 @@ void render_actor_train_tender(Camera* camera, struct TrainCar* actor) { gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot); + mtxf_rotate_zxy_translate(sp120, actor->pos, actor->rot); if (render_set_position(sp120, 0) == 0) { return; } @@ -251,8 +251,8 @@ void render_actor_train_passenger_car(Camera* camera, struct TrainCar* actor) { Mat4 spE0; Mat4 spA0; - f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2025.0f, - gCameraZoom[camera - camera1], 9000000.0f); + f32 temp_f0 = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 2025.0f, gCameraZoom[camera - camera1], + 9000000.0f); if (temp_f0 < 0.0f) { return; @@ -260,7 +260,7 @@ void render_actor_train_passenger_car(Camera* camera, struct TrainCar* actor) { gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot); + mtxf_rotate_zxy_translate(sp120, actor->pos, actor->rot); if (render_set_position(sp120, 0) == 0) { return; diff --git a/src/actors/trees/render.inc.c b/src/actors/trees/render.inc.c index f8d2c60035..76a93f795a 100644 --- a/src/actors/trees/render.inc.c +++ b/src/actors/trees/render.inc.c @@ -19,8 +19,8 @@ void render_actor_tree_mario_raceway(Camera* camera, Mat4 arg1, struct Actor* ar return; } - temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], - 16000000.0f); + temp_f0 = + distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f); if (temp_f0 < 0.0f) { return; @@ -54,8 +54,7 @@ void render_actor_tree_yoshi_valley(Camera* camera, Mat4 arg1, struct Actor* arg return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -89,8 +88,7 @@ void render_actor_tree_royal_raceway(Camera* camera, Mat4 arg1, struct Actor* ar return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -124,8 +122,7 @@ void render_actor_tree_moo_moo_farm(Camera* camera, Mat4 arg1, struct Actor* arg return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f); if (temp_f0 < 0.0f) { return; @@ -153,8 +150,7 @@ void func_80299864(Camera* camera, Mat4 arg1, struct Actor* arg2) { return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -192,8 +188,7 @@ void render_actor_tree_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* ar return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -227,8 +222,7 @@ void render_actor_bush_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* ar return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f); if (temp_f0 < 0.0f) { return; @@ -262,8 +256,7 @@ void render_actor_tree_frappe_snowland(Camera* camera, Mat4 arg1, struct Actor* return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -296,8 +289,7 @@ void render_actor_tree_cactus1_kalimari_desert(Camera* camera, Mat4 arg1, struct return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -330,8 +322,7 @@ void render_actor_tree_cactus2_kalimari_desert(Camera* camera, Mat4 arg1, struct return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; @@ -364,8 +355,7 @@ void render_actor_tree_cactus3_kalimari_desert(Camera* camera, Mat4 arg1, struct return; } - temp_f0 = - is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); + temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 < 0.0f) { return; diff --git a/src/actors/wario_sign/render.inc.c b/src/actors/wario_sign/render.inc.c index 14ee040f03..46058d050d 100644 --- a/src/actors/wario_sign/render.inc.c +++ b/src/actors/wario_sign/render.inc.c @@ -12,14 +12,13 @@ */ void render_actor_wario_sign(Camera* arg0, struct Actor* arg1) { Mat4 sp38; - f32 unk = - is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f); + f32 unk = distance_if_visible(arg0->pos, arg1->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f); if (!(unk < 0.0f)) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - mtxf_pos_rotation_xyz(sp38, arg1->pos, arg1->rot); + mtxf_rotate_zxy_translate(sp38, arg1->pos, arg1->rot); if (render_set_position(sp38, 0) != 0) { gSPDisplayList(gDisplayListHead++, d_course_wario_stadium_dl_sign); diff --git a/src/actors/yoshi_egg/render.inc.c b/src/actors/yoshi_egg/render.inc.c index 8663bc53cc..56d4ae0ad7 100644 --- a/src/actors/yoshi_egg/render.inc.c +++ b/src/actors/yoshi_egg/render.inc.c @@ -20,8 +20,8 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg, f32 temp_f0; if (gGamestate != CREDITS_SEQUENCE) { - temp_f0 = is_within_render_distance(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1], - 16000000.0f); + temp_f0 = + distance_if_visible(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1], 16000000.0f); if (temp_f0 < 0.0f) { return; } @@ -42,7 +42,7 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg, sp5C[0] = 0; sp5C[1] = egg->eggRot; sp5C[2] = 0; - mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C); + mtxf_rotate_zxy_translate(sp60, egg->pos, sp5C); if (render_set_position(sp60, 0) == 0) { return; } diff --git a/src/audio/external.c b/src/audio/external.c index 8dbe5caf00..6f21b24c90 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -1,7 +1,9 @@ #include #include -#include #include +#include +#include + #include "camera.h" #include "math_util_2.h" #include @@ -10,8 +12,9 @@ #include "audio/data.h" #include "audio/port_eu.h" #include "code_800029B0.h" -#include "code_80005FD0.h" -#include "code_80091750.h" +#include "cpu_vehicles_camera_path.h" +#include "menu_items.h" +#include "seq_ids.h" s8 D_8018EF10; UnkStruct8018EF18 D_8018EF18[16]; @@ -109,7 +112,7 @@ u16 D_800EA1C4 = 0; Vec3f D_800EA1C8 = { 0.0f, 0.0f, 0.0f }; f32 D_800EA1D4 = 1.0f; u32 external_unused_u32_0 = 0x00000000; -u8 D_800EA1DC = 0; +s8 D_800EA1DC = 0; u32 external_unused_u32_1 = 0x00000000; u8 D_800EA1E4 = 0; u8 D_800EA1E8 = 0; @@ -225,16 +228,16 @@ s8 func_800C15D0(u8 bank, u8 soundId, u8 channel) { return var_a0; } -// This is likely functionally equivallent. -#ifdef NON_MATCHING -// https://decomp.me/scratch/99CQl s8 func_800C16E8(f32 arg0, f32 arg1, u8 cameraId) { f32 var_f0; f32 var_f14; + f32 new_var; + f32* new_var2; f32 var_f16; f32 var_f18; f32 var_f20; f32 var_f2; + new_var2 = &var_f0; if (D_800EA1C0 == 0) { if (D_800EA0F4 != 0) { @@ -243,9 +246,9 @@ s8 func_800C16E8(f32 arg0, f32 arg1, u8 cameraId) { var_f16 = 10.0f; var_f18 = 2.5f; } else { - var_f2 = 100.0f; + var_f0 = 100.0f; + var_f2 = *new_var2; var_f14 = 200.0f; - if (1) {} var_f16 = 5.0f; var_f18 = 3.3333333f; } @@ -254,16 +257,17 @@ s8 func_800C16E8(f32 arg0, f32 arg1, u8 cameraId) { if (var_f2 < var_f20) { var_f20 = var_f2; } - var_f0 = (arg1 < 0.0f) ? -arg1 : arg1; - if (var_f2 < var_f0) { + new_var = arg0; + var_f0 = (arg1 < 0.0f) ? -arg1 : arg1; + if (var_f2 < (var_f0 = *new_var2)) { var_f0 = var_f2; } - if ((arg0 == 0.0f) && (arg1 == 0.0f)) { + if ((new_var == 0.0f) && (arg1 == 0.0f)) { var_f2 = 0.5f; - } else if ((arg0 >= 0.0f) && (var_f0 <= var_f20)) { + } else if ((new_var >= 0.0f) && (var_f0 <= var_f20)) { var_f2 = 1.0f - ((var_f14 - var_f20) / (var_f16 * (var_f14 - var_f0))); - } else if ((arg0 < 0.0f) && (var_f0 <= var_f20)) { + } else if ((new_var < 0.0f) && (var_f0 <= var_f20)) { var_f2 = (var_f14 - var_f20) / (var_f16 * (var_f14 - var_f0)); } else { var_f2 = (arg0 / (var_f18 * var_f0)) + 0.5f; @@ -278,9 +282,6 @@ s8 func_800C16E8(f32 arg0, f32 arg1, u8 cameraId) { } return (cameraId & 1) * 0x7F; } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C16E8.s") -#endif f32 func_800C1934(u8 bank, u8 soundId) { f32 phi_f2; @@ -339,8 +340,8 @@ void func_800C19D0(u8 arg0, u8 arg1, u8 arg2) { struct Unk_8018EFD8* func_800C1C88(u8 arg0, Vec3f position, f32* velocity, f32* arg3, u8 arg4, u32 soundBits) { struct Unk_8018EFD8* temp_a1; - struct Unk_8018EFD8* temp_v1; - u8 temp_t7; + UNUSED struct Unk_8018EFD8* temp_v1; + UNUSED u8 temp_t7; u8 why1; if (D_8018EFD8[D_8018FB90].next != 0xFF) { @@ -590,7 +591,7 @@ void func_800C2474(void) { gPlayers[var_v0].unk_20C = 0.0f; gPlayers[var_v0].unk_0C0 = 0; gPlayers[var_v0].unk_098 = 0.0f; - gPlayers[var_v0].unk_0DE = 0; + gPlayers[var_v0].oobProps = 0; D_8018FC10[var_v0][0] = 0x00FF; D_8018FC10[var_v0][1] = 0; D_800EA10C[var_v0] = 0; @@ -622,242 +623,273 @@ void func_800C2474(void) { D_8018EFD8[var_v0].next = 0xFF; } -#ifdef NON_MATCHING -// https://decomp.me/scratch/B9kUf -// No idea what's up with this function. `arg1_copy` is a huge improvement but feels very silly -// Presumably there's some macro being used to do all the or'ing (creating soundbits), that might -// matter for match purposes void func_800C284C(u8 arg0, u8 arg1, u8 arg2, u16 arg3) { u8 var_v1; - u8* arg1_copy = &arg1; + UNUSED s32 pad; - if ((D_800EA1EC == 0) || (arg0 == 2)) { - if (1) {} - func_800CBBB8(0x82000000 | (arg0 << 0x10) | (*arg1_copy << 8), arg3); - D_801930D0[arg0].unk_248 = *arg1_copy | (arg2 << 8); - if (D_801930D0[arg0].unk_000 != 1.0f) { - func_800CBB88(0x41000000 | (arg0 << 0x10), D_801930D0[arg0].unk_000); - } - D_801930D0[arg0].unk_028 = 0; - D_801930D0[arg0].unk_018 = 0; - D_801930D0[arg0].unk_014 = 0; - for (var_v1 = 0; var_v1 < 16; var_v1++) { - D_801930D0[arg0].unk_044[var_v1].unk_00 = 1.0f; - D_801930D0[arg0].unk_044[var_v1].unk_0C = 0; - D_801930D0[arg0].unk_044[var_v1].unk_10 = 1.0f; - D_801930D0[arg0].unk_044[var_v1].unk_1C = 0; - } - D_801930D0[arg0].unk_244 = 0; - D_801930D0[arg0].unk_246 = 0; + if ((D_800EA1EC != 0) && (arg0 != 2)) { + return; } + + func_800CBBB8(0x82000000 | (((u32) arg0 & 0xFF) << 0x10) | (((u32) arg1 & 0xFF) << 8), arg3); + D_801930D0[arg0].unk_248 = arg1 | (arg2 << 8); + if (D_801930D0[arg0].unk_000 != 1.0f) { + func_800CBB88(0x41000000 | (((u32) arg0 & 0xFF) << 0x10), D_801930D0[arg0].unk_000); + } + D_801930D0[arg0].unk_028 = 0; + D_801930D0[arg0].unk_018 = 0; + D_801930D0[arg0].unk_014 = 0; + + for (var_v1 = 0; var_v1 < 16; var_v1++) { + D_801930D0[arg0].unk_044[var_v1].unk_00 = 1.0f; + D_801930D0[arg0].unk_044[var_v1].unk_0C = 0; + D_801930D0[arg0].unk_044[var_v1].unk_10 = 1.0f; + D_801930D0[arg0].unk_044[var_v1].unk_1C = 0; + } + + D_801930D0[arg0].unk_244 = 0; + D_801930D0[arg0].unk_246 = 0; } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C284C.s") -#endif void func_800C29B4(u8 arg0, u16 arg1) { func_800CBBB8(((arg0 & 0xFF) << 0x10) | 0x83000000, arg1); D_801930D0[arg0].unk_248 = 0xFFFF; } -#ifdef NON_MATCHING -/** - * https://decomp.me/scratch/TS7EW - * The last big thing is the for loop in `case 10`. For some reason the 0 used for loop initialization is saved to 2 - *variables? I speculate that this is functionally equivalent although its hard to tell with all the register allocation - *differences `arg0` is almost certainly `soundbits`, so all the `why*` variables are probably the results of macros - *pulling out the different parts of the full sound specification. - **/ -void func_800C2A2C(u32 arg0) { - u16 var_a3; - u16 var_a0; - s32 var_a2; - u8 var_a1; - u8 var_t0; - u8 var_v1; - struct_D_801930D0_entry* temp_v0_3; - u8 test; - u8 why; - u16 why2; - u8 why3; - u8 why4; - u8 why5; - u8 temp_a1; - - test = arg0 & 0xFF; - why = (arg0 & 0xFF00) >> 8; - why2 = (arg0 & 0xFF0000) >> 0xD; - why3 = (arg0 & 0xFF0000) >> 0xF; - why4 = (arg0 & 0xFF0000) >> 0x10; - why5 = (arg0 & 0xF00) >> 8; - temp_a1 = (arg0 & 0x0F000000) >> 0x18; - switch ((arg0 >> 0x1C) & 0xFF) { +void func_800C2A2C(u32 cmd) { + f32 freqScaleTarget; + u16 channelMaskDisable; + u16 val; + u16 fadeTimer; + u8 priority; + u8 ioPort; + u8 i; + u8 duration; + u8 channelIndex; + u8 found; + u8 seqId; + u8 subArgs; + u8 op; + u8 seqPlayerIndex; + + op = cmd >> 28; + seqPlayerIndex = (cmd & 0xF000000) >> 24; + + switch (op) { case 0: - func_800C284C(temp_a1, arg0 & 0xFF, why, why2); + seqId = cmd & 0xFF; + subArgs = (cmd & 0xFF00) >> 8; + fadeTimer = (cmd & 0xFF0000) >> 13; + func_800C284C(seqPlayerIndex, seqId, subArgs, fadeTimer); break; + case 1: - func_800C29B4(temp_a1, why2); + fadeTimer = (cmd & 0xFF0000) >> 13; + func_800C29B4(seqPlayerIndex, fadeTimer); break; + case 2: - for (var_v1 = 0; var_v1 < D_80192CC6[temp_a1]; var_v1++) { - if (test == D_80192CA8[temp_a1][var_v1].thing0) { - if (var_v1 == 0) { - func_800C284C(temp_a1, test, why, why2); + seqId = cmd & 0xFF; + subArgs = (cmd & 0xFF00) >> 8; + fadeTimer = (cmd & 0xFF0000) >> 13; + priority = subArgs; + + for (i = 0; i < D_80192CC6[seqPlayerIndex]; i++) { + if (D_80192CA8[seqPlayerIndex][i].thing0 == seqId) { + if (i == 0) { + func_800C284C(seqPlayerIndex, seqId, subArgs, fadeTimer); } return; } } - var_t0 = D_80192CC6[temp_a1]; - for (var_v1 = 0; var_v1 < D_80192CC6[temp_a1]; var_v1++) { - if (why >= D_80192CA8[temp_a1][var_v1].thing1) { - var_t0 = var_v1; - var_v1 = D_80192CC6[temp_a1]; + + found = D_80192CC6[seqPlayerIndex]; + for (i = 0; i < D_80192CC6[seqPlayerIndex]; i++) { + if (priority >= D_80192CA8[seqPlayerIndex][i].thing1) { + found = i; + i = D_80192CC6[seqPlayerIndex]; } } - if ((var_t0 != D_80192CC6[temp_a1]) || (var_t0 == 0)) { - if (D_80192CC6[temp_a1] < 5) { - D_80192CC6[temp_a1]++; + + if ((found != D_80192CC6[seqPlayerIndex]) || (found == 0)) { + if (D_80192CC6[seqPlayerIndex] < 5) { + D_80192CC6[seqPlayerIndex]++; } - for (var_v1 = D_80192CC6[temp_a1] - 1; var_v1 != var_t0; var_v1--) { - D_80192CA8[temp_a1][var_v1].thing1 = D_80192CA8[temp_a1][var_v1 - 1].thing1; - D_80192CA8[temp_a1][var_v1].thing0 = D_80192CA8[temp_a1][var_v1 - 1].thing0; + for (i = D_80192CC6[seqPlayerIndex] - 1; i != found; i--) { + D_80192CA8[seqPlayerIndex][i].thing1 = D_80192CA8[seqPlayerIndex][i - 1].thing1; + D_80192CA8[seqPlayerIndex][i].thing0 = D_80192CA8[seqPlayerIndex][i - 1].thing0; } - D_80192CA8[temp_a1][var_t0].thing1 = why; - D_80192CA8[temp_a1][var_t0].thing0 = test; + + D_80192CA8[seqPlayerIndex][found].thing1 = subArgs; + D_80192CA8[seqPlayerIndex][found].thing0 = seqId; } - if (var_t0 == 0) { - func_800C284C(temp_a1, test, why, why2); + if (found == 0) { + func_800C284C(seqPlayerIndex, seqId, subArgs, fadeTimer); } break; + case 3: - var_t0 = D_80192CC6[temp_a1]; - for (var_v1 = 0; var_v1 < D_80192CC6[temp_a1]; var_v1++) { - if (test == D_80192CA8[temp_a1][var_v1].thing0) { - var_t0 = var_v1; - var_v1 = D_80192CC6[temp_a1]; + fadeTimer = (cmd & 0xFF0000) >> 13; + + found = D_80192CC6[seqPlayerIndex]; + for (i = 0; i < D_80192CC6[seqPlayerIndex]; i++) { + seqId = cmd & 0xFF; + if (D_80192CA8[seqPlayerIndex][i].thing0 == seqId) { + found = i; + i = D_80192CC6[seqPlayerIndex]; } } - if (var_t0 != D_80192CC6[temp_a1]) { - for (var_v1 = var_t0; var_v1 < D_80192CC6[temp_a1] - 1; var_v1++) { - D_80192CA8[temp_a1][var_v1].thing1 = D_80192CA8[temp_a1][var_v1 + 1].thing1; - D_80192CA8[temp_a1][var_v1].thing0 = D_80192CA8[temp_a1][var_v1 + 1].thing0; + + if (found != D_80192CC6[seqPlayerIndex]) { + for (i = found; i < (D_80192CC6[seqPlayerIndex] - 1); i++) { + D_80192CA8[seqPlayerIndex][i].thing1 = D_80192CA8[seqPlayerIndex][i + 1].thing1; + D_80192CA8[seqPlayerIndex][i].thing0 = D_80192CA8[seqPlayerIndex][i + 1].thing0; } - D_80192CC6[temp_a1]--; + + D_80192CC6[seqPlayerIndex]--; } - if (var_t0 == 0) { - func_800C29B4(temp_a1, why2); - if (D_80192CC6[temp_a1] != 0) { - func_800C284C(temp_a1, D_80192CA8[temp_a1][0].thing0, D_80192CA8[temp_a1][0].thing1, why2); + if (found == 0) { + func_800C29B4(seqPlayerIndex, fadeTimer); + if (D_80192CC6[seqPlayerIndex] != 0) { + func_800C284C(seqPlayerIndex, D_80192CA8[seqPlayerIndex][0].thing0, + D_80192CA8[seqPlayerIndex][0].thing1, fadeTimer); } } break; + case 4: - var_a1 = why3; - if (var_a1 == 0) { - var_a1++; + duration = (cmd & 0xFF0000) >> 15; + val = cmd & 0xFF; + + if (duration == 0) { + duration++; } - temp_v0_3 = &D_801930D0[temp_a1 & 0xFF]; - temp_v0_3->unk_004 = (arg0 & 0xFF) / 127.0f; - if (temp_v0_3->unk_000 != temp_v0_3->unk_004) { - temp_v0_3->unk_008 = (temp_v0_3->unk_000 - temp_v0_3->unk_004) / var_a1; - temp_v0_3->unk_00C = var_a1; + D_801930D0[seqPlayerIndex].unk_004 = val / 127.0f; + if (D_801930D0[seqPlayerIndex].unk_000 != D_801930D0[seqPlayerIndex].unk_004) { + D_801930D0[seqPlayerIndex].unk_008 = + (D_801930D0[seqPlayerIndex].unk_000 - D_801930D0[seqPlayerIndex].unk_004) / duration; + D_801930D0[seqPlayerIndex].unk_00C = duration; } break; + case 5: - var_a1 = why3; - if (var_a1 == 0) { - var_a1++; - } + duration = (cmd & 0xFF0000) >> 15; + val = cmd & 0xFFFF; - temp_v0_3 = &D_801930D0[var_a1 & 0xFF]; - for (var_v1 = 0; var_v1 < 0x10; var_v1++) { - temp_v0_3->unk_044[var_v1].unk_14 = ((arg0 & 0xFFFF) / 1000.0f); - temp_v0_3->unk_044[var_v1].unk_18 = - (temp_v0_3->unk_044[var_v1].unk_10 - temp_v0_3->unk_044[var_v1].unk_14) / var_a1; - temp_v0_3->unk_044[var_v1].unk_1C = var_a1; + if (duration == 0) { + duration++; } - D_801930D0[var_a1].unk_244 = 0xFFFF; + freqScaleTarget = (f32) val / 1000.0f; + for (i = 0; i < 0x10; i++) { + D_801930D0[seqPlayerIndex].unk_044[i].unk_14 = freqScaleTarget; + D_801930D0[seqPlayerIndex].unk_044[i].unk_1C = duration; + D_801930D0[seqPlayerIndex].unk_044[i].unk_18 = + (D_801930D0[seqPlayerIndex].unk_044[i].unk_10 - freqScaleTarget) / duration; + } + + D_801930D0[seqPlayerIndex].unk_244 = 0xFFFF; break; + case 6: - var_a1 = why3; - if (var_a1 == 0) { - var_a1++; + duration = (cmd & 0xFF0000) >> 15; + channelIndex = (cmd & 0xF00) >> 8; + val = cmd & 0xFF; + + if (duration == 0) { + duration++; } - var_v1 = ((arg0 & 0xF00) >> 8) & 0xFF; - D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_04 = test / 127.0f; - if (D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_00 != D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_04) { - D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_08 = (D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_00 - - D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_04) / - var_a1; - D_801930D0[var_a1 & 0xFF].unk_044[var_v1].unk_0C = var_a1; - D_801930D0[var_a1 & 0xFF].unk_244 |= 1 << var_v1; + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_04 = val / 127.0f; + if (D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_00 != + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_04) { + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_08 = + (D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_00 - + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_04) / + duration; + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_0C = duration; + D_801930D0[seqPlayerIndex].unk_244 |= 1 << channelIndex; } break; + case 7: - func_800CBBE8(0x46000000 | (temp_a1 & 0xFF) << 0x10 | (why4 & 0xFF) << 8, (u64) arg0); + ioPort = (cmd & 0xFF0000) >> 16; + val = cmd & 0xFF; + func_800CBBE8((0x46000000 | ((seqPlayerIndex & 0xFF) << 0x10)) | ((ioPort & 0xFF) << 8), val); break; + case 8: - if (!(D_801930D0[temp_a1].unk_24A & (1 << why5))) { - func_800CBBE8(0x06000000 | ((temp_a1 & 0xFF) << 0x10) | (why5 & 0xFF) << 8 | (why4 & 0xFF), (u64) arg0); + channelIndex = (cmd & 0xF00) >> 8; + ioPort = (cmd & 0xFF0000) >> 16; + val = cmd & 0xFF; + if (!(D_801930D0[seqPlayerIndex].unk_24A & (1 << channelIndex))) { + func_800CBBE8(((0x06000000 | ((seqPlayerIndex & 0xFF) << 0x10)) | (((u32) channelIndex & 0xFF) << 8)) | + (ioPort & 0xFF), + val); } break; + case 9: - D_801930D0[temp_a1].unk_24A = arg0; + D_801930D0[seqPlayerIndex].unk_24A = cmd & 0xFFFF; break; + case 10: - var_a0 = 1; - var_a3 = arg0 & 0xFFFF; - for (var_v1 = 0; var_v1 < 0x10; var_v1++) { - if (var_a3 & var_a0) { - var_a2 = 1; - } else { - var_a2 = 0; - } - func_800CBBE8(((temp_a1 & 0xFF) << 0x10) | 0x08000000 | ((var_v1 & 0xFF) << 8), var_a2); - var_a0 *= 2; + val = 1; + channelMaskDisable = cmd & 0xFFFF; + for (i = 0; i < 0x10; i++) { + func_800CBBE8(0x08000000 | ((seqPlayerIndex & 0xFF) << 0x10) | (((u32) i & 0xFF) << 8), + (channelMaskDisable & val) ? 1 : 0); + val <<= 1; } + break; + case 11: - D_801930D0[temp_a1].unk_014 = arg0; + D_801930D0[seqPlayerIndex].unk_014 = cmd; break; + case 12: - temp_v0_3 = &D_801930D0[temp_a1 & 0xFF]; - if ((((arg0 & 0xF00000) >> 0x14) & 0xFF) != 0xF) { - var_t0 = temp_v0_3->unk_041++; - if (var_t0 < 5) { - temp_v0_3->unk_02C[var_t0] = arg0; - temp_v0_3->unk_040 = 2; + subArgs = (cmd & 0xF00000) >> 20; + if (subArgs != 0xF) { + found = D_801930D0[seqPlayerIndex].unk_041++; + if (found < 5) { + D_801930D0[seqPlayerIndex].unk_02C[found] = cmd; + D_801930D0[seqPlayerIndex].unk_040 = 2; } } else { - temp_v0_3->unk_041 = 0; + D_801930D0[seqPlayerIndex].unk_041 = 0; } break; + case 14: - switch (why5) { /* switch 1; irregular */ - case 0: /* switch 1 */ - func_800CBBB8(0xF0000000U, D_800EA1F0[arg0 & 0xFF]); + subArgs = (cmd & 0xF00) >> 8; + val = cmd & 0xFF; + switch (subArgs) { + case 0: + func_800CBBB8(0xF0000000, D_800EA1F0[val]); break; - case 1: /* switch 1 */ - D_800EA1EC = arg0 & 1; + + case 1: + D_800EA1EC = val & 1; break; } + break; + case 15: - D_800EA1C0 = (arg0 & 0xFF00) >> 8; - audio_reset_session_eu((void*) test); - D_800EA1F4[0] = test; - func_800CBBE8(0x46020000U, why); + seqId = cmd & 0xFF; + subArgs = (cmd & 0xFF00) >> 8; + D_800EA1C0 = subArgs; + audio_reset_session_eu((void*) seqId); + D_800EA1F4[0] = seqId; + func_800CBBE8(0x46020000, subArgs); func_800C5C40(); break; + default: break; } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C2A2C.s") -#endif void func_800C3448(u32 arg0) { D_80192CD0[D_800EA1E4] = arg0; @@ -931,184 +963,202 @@ void func_800C36C4(u8 arg0, u8 arg1, u8 arg2, u8 arg3) { D_801930D0[arg0].unk_012 = 1; } -#ifdef NON_MATCHING -// generated by m2c commit 1c7b040b356d06b5171add65d8ee527a500b156e on Apr-01-2024 void func_800C3724(void) { - u8 var_s5; - f32 var_f0; - u16 temp_a3_2; - s32 temp_lo; - s32 temp_s1; - s32 temp_t9_2; - u16 var_a2; - u8 var_s2; - u8 var_t0; - u32 temp_t5_3; - u8 temp_a1_3; - s32 var_a1; - struct_D_801930D0_entry* temp_s0; - struct_D_801930D0_entry* temp_s2; - struct_D_801930D0_entry* temp_s4_2; - - for (var_s5 = 0; var_s5 < 3; var_s5++) { - if (D_801930D0[var_s5].unk_012 != 0) { - var_f0 = 1.0f; - for (var_s2 = 0; var_s2 < 3; var_s2++) { - temp_s4_2 = &D_801930D0[var_s5]; - var_f0 *= temp_s4_2->unk_00E[var_s2] / 127.0f; - } - func_800C3448((D_801930D0[var_s5].unk_011 << 0x10) | 0x40000000 | ((var_s5 & 0xFF) << 0x18) | - ((u32) (var_f0 * 127.0f) & 0xFF)); - D_801930D0[var_s5].unk_012 = 0; - } - if (D_801930D0[var_s5].unk_00C != 0) { - D_801930D0[var_s5].unk_00C--; - if (D_801930D0[var_s5].unk_00C) { - D_801930D0[var_s5].unk_000 -= D_801930D0[var_s5].unk_008; + u8 seqPlayerIndex; + f32 volume; + u8 tempoOp; + u16 tempoTarget; + u8 channelIndex; + u8 j; + u32 tempoCmd; + u16 tempoPrev; + u8 tempoTimer; + u8 setupOp; + u8 targetSeqPlayerIndex; + u8 setupVal1; + u8 setupVal2; + u16 seqId; + + for (seqPlayerIndex = 0; seqPlayerIndex < 3; seqPlayerIndex++) { + if (D_801930D0[seqPlayerIndex].unk_012) { + volume = 1.0f; + for (j = 0; j < 3; j++) { + volume *= D_801930D0[seqPlayerIndex].unk_00E[j] / 127.0f; + } + + func_800C3448(0x40000000 | (((u8) seqPlayerIndex) << 0x18) | + (((u8) D_801930D0[seqPlayerIndex].unk_011) << 0x10) | ((u16) (u8) (volume * 127.0f))); + + D_801930D0[seqPlayerIndex].unk_012 = 0; + } + if (D_801930D0[seqPlayerIndex].unk_00C != 0) { + D_801930D0[seqPlayerIndex].unk_00C--; + if (D_801930D0[seqPlayerIndex].unk_00C) { + D_801930D0[seqPlayerIndex].unk_000 -= D_801930D0[seqPlayerIndex].unk_008; } else { - D_801930D0[var_s5].unk_000 = D_801930D0[var_s5].unk_004; - } - func_800CBB88(((var_s5 & 0xFF) << 0x10) | 0x41000000, D_801930D0[var_s5].unk_000); - } - if (D_801930D0[var_s5].unk_014 != 0) { - var_t0 = (u32) (D_801930D0[var_s5].unk_014 & 0xFF0000) >> 0xF; - var_a1 = D_801930D0[var_s5].unk_014 & 0xFFF; - var_a2 = var_a1; - if (var_t0 == 0) { - var_t0++; - } - if (gSequencePlayers[var_s5 & 0xFF].enabled != 0) { - temp_lo = (s32) gSequencePlayers[var_s5 & 0xFF].tempo / TATUMS_PER_BEAT; - temp_a3_2 = temp_lo; - temp_t9_2 = ((D_801930D0[var_s5].unk_014 & 0xF000) >> 0xC) & 0xFF; - switch (temp_t9_2) { /* switch 1; irregular */ + D_801930D0[seqPlayerIndex].unk_000 = D_801930D0[seqPlayerIndex].unk_004; + } + func_800CBB88(0x41000000 | (((u32) seqPlayerIndex & 0xFF) << 0x10), D_801930D0[seqPlayerIndex].unk_000); + } + if (D_801930D0[seqPlayerIndex].unk_014 != 0) { + tempoCmd = D_801930D0[seqPlayerIndex].unk_014; + tempoTimer = (tempoCmd & 0xFF0000) >> 0xF; + tempoTarget = tempoCmd & 0xFFF; + if (tempoTimer == 0) { + tempoTimer++; + } + if (gSequencePlayers[seqPlayerIndex].enabled != 0) { + tempoPrev = gSequencePlayers[seqPlayerIndex].tempo / 48; + tempoOp = (tempoCmd & 0xF000) >> 0xC; + switch (tempoOp) { case 1: - var_a2 += temp_a3_2; + tempoTarget += tempoPrev; break; - case 2: /* switch 1 */ - if (var_a1 < temp_a3_2) { - var_a2 = (temp_a3_2 - var_a1); + + case 2: + if (tempoTarget < tempoPrev) { + tempoTarget = tempoPrev - tempoTarget; } break; - case 3: /* switch 1 */ - var_a2 = (u32) (temp_a3_2 * ((f32) (var_a1 & 0xFFFF) / 100.0f)); + + case 3: + tempoTarget = tempoPrev * (tempoTarget / 100.0f); + break; + + case 4: + tempoTarget = + (D_801930D0[seqPlayerIndex].unk_018 != 0) ? D_801930D0[seqPlayerIndex].unk_018 : tempoPrev; break; - case 4: /* switch 1 */ - if (D_801930D0[var_s5].unk_018 != 0) { - var_a2 = D_801930D0[var_s5].unk_018; - } else { - var_a2 = temp_a3_2; - } + default: break; } - if (var_a2 >= 0x12D) { - var_a2 = 0x12C; + + if (tempoTarget > 300) { + tempoTarget = 300; } - if (D_801930D0[var_s5].unk_018 == 0) { - D_801930D0[var_s5].unk_018 = temp_a3_2; + if (D_801930D0[seqPlayerIndex].unk_018 == 0) { + D_801930D0[seqPlayerIndex].unk_018 = tempoPrev; } - D_801930D0[var_s5].unk_020 = var_a2; - D_801930D0[var_s5].unk_01C = temp_lo; - D_801930D0[var_s5].unk_024 = (D_801930D0[var_s5].unk_01C - D_801930D0[var_s5].unk_020) / var_t0; - D_801930D0[var_s5].unk_028 = (u16) var_t0; - } - D_801930D0[var_s5].unk_014 = 0; - } - if (D_801930D0[var_s5].unk_028 != 0) { - D_801930D0[var_s5].unk_028--; - if (D_801930D0[var_s5].unk_028) { - D_801930D0[var_s5].unk_01C -= D_801930D0[var_s5].unk_024; + D_801930D0[seqPlayerIndex].unk_020 = tempoTarget; + D_801930D0[seqPlayerIndex].unk_01C = gSequencePlayers[seqPlayerIndex].tempo / 48; + D_801930D0[seqPlayerIndex].unk_024 = + (D_801930D0[seqPlayerIndex].unk_01C - D_801930D0[seqPlayerIndex].unk_020) / tempoTimer; + D_801930D0[seqPlayerIndex].unk_028 = tempoTimer; + } + D_801930D0[seqPlayerIndex].unk_014 = 0; + } + if (D_801930D0[seqPlayerIndex].unk_028 != 0) { + D_801930D0[seqPlayerIndex].unk_028--; + if (D_801930D0[seqPlayerIndex].unk_028) { + D_801930D0[seqPlayerIndex].unk_01C -= D_801930D0[seqPlayerIndex].unk_024; } else { - D_801930D0[var_s5].unk_01C = D_801930D0[var_s5].unk_020; + D_801930D0[seqPlayerIndex].unk_01C = D_801930D0[seqPlayerIndex].unk_020; } - func_800CBBB8(((var_s5 & 0xFF) << 0x10) | 0x47000000, (u32) (s32) D_801930D0[var_s5].unk_01C); + func_800CBBB8(0x47000000 | (((u32) seqPlayerIndex & 0xFF) << 0x10), + (s32) D_801930D0[seqPlayerIndex].unk_01C); } - if (D_801930D0[var_s5].unk_246 != 0) { - for (var_s2 = 0; var_s2 < 0x10; var_s2++) { - temp_s4_2 = &D_801930D0[var_s5]; - if (temp_s4_2->unk_044[var_s2].unk_0C != 0) { - temp_s4_2->unk_044[var_s2].unk_0C--; - if (temp_s4_2->unk_044[var_s2].unk_0C) { - temp_s4_2->unk_044[var_s2].unk_00 -= temp_s4_2->unk_044[var_s2].unk_08; + + if (D_801930D0[seqPlayerIndex].unk_246 != 0) { + for (channelIndex = 0; channelIndex < 0x10; channelIndex++) { + if (D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_0C != 0) { + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_0C--; + if (D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_0C) { + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_00 -= + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_08; } else { - temp_s4_2->unk_044[var_s2].unk_00 = temp_s4_2->unk_044[var_s2].unk_04; - temp_s4_2->unk_246 ^= 1 << var_s2; + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_00 = + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_04; + D_801930D0[seqPlayerIndex].unk_246 ^= 1 << channelIndex; } - func_800CBB88(((var_s5 & 0xFF) << 0x10) | 0x01000000 | ((var_s2 & 0xFF) << 8), - temp_s4_2->unk_044[var_s2].unk_00); + func_800CBB88(0x01000000 | ((seqPlayerIndex & 0xFF) << 0x10) | (((u32) channelIndex & 0xFF) << 8), + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_00); } } } - if (D_801930D0[var_s5].unk_244 != 0) { - for (var_s2 = 0; var_s2 < 0x10; var_s2++) { - temp_s4_2 = &D_801930D0[var_s5]; - if (temp_s4_2->unk_044[var_s2].unk_1C != 0) { - temp_s4_2->unk_044[var_s2].unk_1C--; - if (temp_s4_2->unk_044[var_s2].unk_1C) { - temp_s4_2->unk_044[var_s2].unk_10 -= temp_s4_2->unk_044[var_s2].unk_18; + if (D_801930D0[seqPlayerIndex].unk_244 != 0) { + for (channelIndex = 0; channelIndex < 0x10; channelIndex++) { + if (D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_1C != 0) { + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_1C--; + if (D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_1C) { + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_10 -= + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_18; } else { - temp_s4_2->unk_044[var_s2].unk_10 = temp_s4_2->unk_044[var_s2].unk_14; - temp_s4_2->unk_244 ^= 1 << var_s2; + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_10 = + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_14; + D_801930D0[seqPlayerIndex].unk_244 ^= 1 << channelIndex; } - func_800CBB88(((var_s5 & 0xFF) << 0x10) | 0x04000000 | ((var_s2 & 0xFF) << 8), - temp_s4_2->unk_044[var_s2].unk_10); + func_800CBB88(0x04000000 | ((seqPlayerIndex & 0xFF) << 0x10) | (((u32) channelIndex & 0xFF) << 8), + D_801930D0[seqPlayerIndex].unk_044[channelIndex].unk_10); } } } - if (D_801930D0[var_s5].unk_041 != 0) { - if (D_801930D0[var_s5].unk_040 != 0) { - D_801930D0[var_s5].unk_040--; - } else { - if (gSequencePlayers[var_s5].enabled == 0) { - for (var_s2 = 0; var_s2 < D_801930D0[var_s5].unk_041; var_s2++) { - temp_s4_2 = &D_801930D0[var_s5]; - var_a1 = temp_s4_2->unk_02C[var_s2] & 0xFF; - temp_t5_3 = ((u32) (temp_s4_2->unk_02C[var_s2] & 0xF00000) >> 0x14) & 0xFF; - temp_s1 = ((u32) (temp_s4_2->unk_02C[var_s2] & 0xF0000) >> 0x10) & 0xFF; - temp_a1_3 = ((u32) (temp_s4_2->unk_02C[var_s2] & 0xFF00) >> 8) & 0xFF; - switch (temp_t5_3) { - case 0: - D_801930D0[temp_s1].unk_012 = 1; - D_801930D0[temp_s1].unk_00E[1] = 0x7F; - break; - case 1: - func_800C3448(temp_s4_2->unk_248 | 0x30000000 | (var_s5 << 0x18)); - break; - case 2: - func_800C3448(D_801930D0[temp_s1].unk_248 | (temp_s1 << 0x18) | 0x10000); - D_801930D0[temp_s1].unk_012 = 1; - D_801930D0[temp_s1].unk_00E[1] = 0x7F; - break; - case 3: - func_800C3448((temp_s1 << 0x18) | 0xB0003000 | (temp_a1_3 << 0x10) | var_a1); - break; - case 4: - func_800C3448((temp_s1 << 0x18) | 0xB0004000 | (var_a1 << 0x10)); - break; - case 5: - func_800C3448((D_801930D0[temp_s1].unk_042 << 0x10) | (temp_s1 << 0x18) | - (temp_s4_2->unk_02C[var_s2] & 0xFFFF)); - func_800C36C4(temp_s1 & 0xFF, 1U, 0x7FU, 0U); - D_801930D0[temp_s1].unk_042 = 0; - break; - case 6: - temp_s4_2->unk_042 = temp_a1_3; - break; - } - } - D_801930D0[var_s5].unk_041 = 0; + if (D_801930D0[seqPlayerIndex].unk_041) { +#ifdef VERSION_EU + if (func_800C357C_eu(-0x10000000, -0x10000000) == 0) { + D_801930D0[seqPlayerIndex].unk_041 = 0; + return; + } +#endif + if (D_801930D0[seqPlayerIndex].unk_040 != 0) { + D_801930D0[seqPlayerIndex].unk_040--; + continue; + } + + if (gSequencePlayers[seqPlayerIndex].enabled != 0) { + continue; + } + + for (j = 0; j < D_801930D0[seqPlayerIndex].unk_041; j++) { + setupOp = (D_801930D0[seqPlayerIndex].unk_02C[j] & 0xF00000) >> 0x14; + targetSeqPlayerIndex = (D_801930D0[seqPlayerIndex].unk_02C[j] & 0xF0000) >> 0x10; + setupVal2 = (D_801930D0[seqPlayerIndex].unk_02C[j] & 0xFF00) >> 8; + setupVal1 = D_801930D0[seqPlayerIndex].unk_02C[j] & 0xFF; + switch (setupOp) { + case 0: + D_801930D0[targetSeqPlayerIndex].unk_012 = 1; + D_801930D0[targetSeqPlayerIndex].unk_00E[1] = 0x7F; + break; + + case 1: + func_800C3448(0x30000000 | ((u8) seqPlayerIndex) << 0x18 | + (D_801930D0[seqPlayerIndex].unk_248)); + break; + + case 2: + func_800C3448((((u8) targetSeqPlayerIndex) << 0x18) | 0x10000 | + (u16) (D_801930D0[targetSeqPlayerIndex].unk_248)); + D_801930D0[targetSeqPlayerIndex].unk_012 = 1; + D_801930D0[targetSeqPlayerIndex].unk_00E[1] = 0x7F; + break; + + case 3: + func_800C3448(0xB0003000 | (((u8) targetSeqPlayerIndex) << 0x18) | (((u8) setupVal2) << 0x10) | + (u16) setupVal1); + break; + + case 4: + func_800C3448(0xB0004000 | (((u8) targetSeqPlayerIndex) << 0x18) | (((u8) setupVal1) << 0x10)); + break; + + case 5: + seqId = D_801930D0[seqPlayerIndex].unk_02C[j] & 0xFFFF; + func_800C3448((((u8) targetSeqPlayerIndex) << 0x18) | + (((u8) D_801930D0[targetSeqPlayerIndex].unk_042) << 0x10) | ((u16) seqId)); + + func_800C36C4(targetSeqPlayerIndex, 1, 0x7F, 0); + D_801930D0[targetSeqPlayerIndex].unk_042 = 0; + break; + + case 6: + D_801930D0[seqPlayerIndex].unk_042 = setupVal2; + break; } } + + D_801930D0[seqPlayerIndex].unk_041 = 0; } } } -#else -#ifdef VERSION_EU -GLOBAL_ASM("asm/eu_nonmatchings/func_800C3724.s") -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C3724.s") -#endif -#endif void func_800C3F70(void) { u8 var_v0; @@ -1239,21 +1289,19 @@ void func_800C41CC(u8 arg0, struct SoundCharacteristics* arg1) { } } -// Probably a variant of `process_sound_request` from SM64 -#ifdef NON_MATCHING -// https://decomp.me/scratch/fmmyb -// Stack issue concerning `var_t2` and `var_t3`, no idea how to fix it void func_800C4398(void) { u8 bank; u8 soundIndex; u8 var_a3; struct Sound* var_a2; + UNUSED s32 pad; u8 var_t2; u32 var_t3; var_a2 = &sSoundRequests[sNumProcessedSoundRequests]; - if (var_a2->soundBits == 0) + if (var_a2->soundBits == 0) { return; + } bank = ((u32) (var_a2->soundBits & 0xF0000000) >> 0x1C); soundIndex = sSoundBanks[bank][0].next; @@ -1301,14 +1349,14 @@ void func_800C4398(void) { } } if ((sSoundBanks[bank][sSoundBankFreeListFront[bank]].next != 0xFF) && (soundIndex != 0)) { - soundIndex = sSoundBankFreeListFront[bank]; - sSoundBanks[bank][soundIndex].unk00 = &(*var_a2->position)[0]; + var_t2 = soundIndex = sSoundBankFreeListFront[bank]; + sSoundBanks[bank][soundIndex].unk00 = (Vec3f*) &(*var_a2->position)[0]; sSoundBanks[bank][soundIndex].unk04 = &(*var_a2->position)[1]; sSoundBanks[bank][soundIndex].unk08 = &(*var_a2->position)[2]; sSoundBanks[bank][soundIndex].cameraId = var_a2->cameraId; sSoundBanks[bank][soundIndex].unk10 = var_a2->unk0C; sSoundBanks[bank][soundIndex].unk14 = var_a2->unk10; - sSoundBanks[bank][0, soundIndex].unk18 = var_a2->unk14; + sSoundBanks[bank][soundIndex].unk18 = var_a2->unk14; sSoundBanks[bank][soundIndex].soundBits = var_a2->soundBits; sSoundBanks[bank][soundIndex].soundStatus = (u8) ((u32) (var_a2->soundBits & 0x01000000) >> 0x18); sSoundBanks[bank][soundIndex].freshness = 2; @@ -1317,16 +1365,13 @@ void func_800C4398(void) { sSoundBankUsedListBack[bank] = sSoundBankFreeListFront[bank]; sSoundBankFreeListFront[bank] = sSoundBanks[bank][sSoundBankFreeListFront[bank]].next; sSoundBanks[bank][sSoundBankFreeListFront[bank]].prev = 0xFF; - sSoundBanks[bank][soundIndex].next = 0xFF; + sSoundBanks[bank][var_t2].next = 0xFF; } else if (sSoundBanks[bank][sSoundBankFreeListFront[bank]].next == 0xFF) { if (D_800EA1C8 != *var_a2->position) { (*var_a2->position)[1] = 100000.0f; } } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4398.s") -#endif void delete_sound_from_bank(u8 bankId, u8 soundId) { UNUSED s32 stackPadding; @@ -1350,163 +1395,165 @@ void delete_sound_from_bank(u8 bankId, u8 soundId) { temp->soundStatus = 0; } -// Guessing this is `select_current_sounds`? -#ifdef NON_MATCHING -// https://decomp.me/scratch/cqBii -struct why { +struct ActiveSfx { u32 priority; u8 soundIndex; }; +#define AUDIO_MK_CMD(b0, b1, b2, b3) \ + ((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0)) void func_800C4888(u8 bankId) { - u8 i; u8 j; + u8 numChannels; + u8 chosenEntryIndex; + u8 i; u8 k; - u8 latestSoundIndex; - u8 var_s2; - u8 var_v1; + u8 numChosenSfx; + u8 needNewSfx; u8 soundIndex; - u8 var_t1; - u8 someTemp; + u8 requestedPriority; + u8 temp_t8; f32 var_f0; - s32 requestedPriority; - struct why sp7C[8]; - s32 temp_t8; - struct SoundCharacteristics* temp_t2; + struct ActiveSfx* activeSfx; + struct ActiveSfx chosenSfx[8]; + struct SoundCharacteristics* entry; - var_s2 = 0; + numChosenSfx = 0; for (i = 0; i < 8; i++) { - sp7C[i].priority = 0x7FFFFFFF; - sp7C[i].soundIndex = 0xFF; + chosenSfx[i].priority = 0x7FFFFFFF; + chosenSfx[i].soundIndex = 0xFF; } - latestSoundIndex = 0; + soundIndex = sSoundBanks[bankId][0].next; + k = 0; while (soundIndex != 0xFF) { - temp_t2 = &sSoundBanks[bankId][soundIndex]; - if ((temp_t2->soundStatus == 1) && ((temp_t2->soundBits & 0x08000000) == 0x08000000)) { - temp_t2->freshness -= 1; + if ((sSoundBanks[bankId][soundIndex].soundStatus == 1) && + ((sSoundBanks[bankId][soundIndex].soundBits & 0x08000000) == 0x08000000)) { + sSoundBanks[bankId][soundIndex].freshness -= 1; } - if (temp_t2->freshness == 0) { + + if (sSoundBanks[bankId][soundIndex].freshness == 0) { delete_sound_from_bank(bankId, soundIndex); - } else if (temp_t2->soundStatus != 0) { - if (D_800EA1C8 == *temp_t2->unk00) { - temp_t2->distance = 0.0f; + } else if (sSoundBanks[bankId][soundIndex].soundStatus != 0) { + entry = &sSoundBanks[bankId][soundIndex]; + + if (&D_800EA1C8 == entry[0].unk00) { + entry->distance = 0.0f; } else { - temp_t2->distance = ((*temp_t2->unk00)[0] * (*temp_t2->unk00)[0]) + (*temp_t2->unk08 * *temp_t2->unk08); + entry->distance = (*entry->unk00[0] * *entry->unk00[0]) + (*entry->unk08 * *entry->unk08); } - requestedPriority = ((u32) (temp_t2->soundBits & 0xFF00) >> 8) & 0xFF; - if (temp_t2->soundBits & 0x100000) { - temp_t2->priority = - (0xFF - requestedPriority) * (0xFF - requestedPriority) * 0x5A4; // 0x5a4 = 1444 = 38 * 38 + requestedPriority = (((u32) (entry->soundBits & 0xFF00)) >> 8); + if (entry->soundBits & 0x100000) { + entry->priority = ((0xFF - requestedPriority) * (0xFF - requestedPriority)) * (38 * 38); } else { - temp_t2->priority = (u32) temp_t2->distance + ((0xFF - requestedPriority) * (0xFF - requestedPriority) * - 0x5A4); // 0x5a4 = 1444 = 38 * 38 - if (*temp_t2->unk08 > 0.0f) { - temp_t2->priority += (s32) (*temp_t2->unk08 * 6.0f); + entry->priority = + ((u32) entry->distance) + (((0xFF - requestedPriority) * (0xFF - requestedPriority)) * (38 * 38)); + + if ((*entry->unk08) > 0.0f) { + entry->priority += (s32) ((*entry->unk08) * 6.0f); } } - temp_t8 = ((u32) (temp_t2->soundBits & 0x30000) >> 0x10) & 0xFF; - if (temp_t8 != 0) { - var_f0 = 4000000.0f / (f32) (temp_t8 * temp_t8); + temp_t8 = (((u32) (entry->soundBits & 0x30000)) >> 0x10); + if (temp_t8) { + var_f0 = (2000.0f * 2000.0f) / ((f32) (temp_t8 * temp_t8)); } else { - var_f0 = 1e10f; + var_f0 = 1e5f * 1e5f; } - if (var_f0 < temp_t2->distance) { - if (temp_t2->soundStatus == 4) { - func_800CBBE8((temp_t2->unk2C << 8) | 0x06020000, 0); - if (temp_t2->soundBits & 0x08000000) { + if (var_f0 < entry->distance) { + if (entry->soundStatus == 4) { + func_800CBBE8(AUDIO_MK_CMD(0x06, 2, entry->unk2C, 0), 0); + if (entry->soundBits & 0x08000000) { delete_sound_from_bank(bankId, soundIndex); - soundIndex = latestSoundIndex; + soundIndex = k; } } } else { - var_t1 = D_800EA188[D_800EA1C0][bankId]; - for (i = 0; i < var_t1; i++) { - if (sp7C[i].priority >= temp_t2->priority) { - if (var_s2 < var_t1) { - var_s2++; + numChannels = D_800EA188[D_800EA1C0][bankId]; + for (i = 0; i < numChannels; i++) { + if (chosenSfx[i].priority >= entry->priority) { + if (numChosenSfx < D_800EA188[D_800EA1C0][bankId]) { + numChosenSfx++; } - for (j = var_t1 - 1; j > i; j--) { - sp7C[j].priority = sp7C[j - 1].priority; - sp7C[j].soundIndex = sp7C[j - 1].soundIndex; + for (j = numChannels - 1; j > i; j--) { + chosenSfx[j].priority = chosenSfx[j - 1].priority; + chosenSfx[j].soundIndex = chosenSfx[j - 1].soundIndex; } - sp7C[i].priority = temp_t2->priority; - sp7C[i].soundIndex = soundIndex; - i = var_t1; + + chosenSfx[i].priority = entry->priority; + chosenSfx[i].soundIndex = soundIndex; + i = numChannels; } } } - latestSoundIndex = soundIndex; + k = soundIndex; } - soundIndex = sSoundBanks[bankId][latestSoundIndex].next; + soundIndex = sSoundBanks[bankId][k].next; } - var_t1 = D_800EA188[D_800EA1C0][bankId]; - for (i = 0; i < var_s2; i++) { - someTemp = sSoundBanks[bankId][sp7C[i].soundIndex].soundStatus; - if (someTemp == 1) { - sSoundBanks[bankId][sp7C[i].soundIndex].soundStatus = 2; - } else if (someTemp == 4) { - sSoundBanks[bankId][sp7C[i].soundIndex].soundStatus = 3; + + numChannels = D_800EA188[D_800EA1C0][bankId]; + for (i = 0; i < numChosenSfx; i++) { + if (sSoundBanks[bankId][chosenSfx[i].soundIndex].soundStatus == 1) { + sSoundBanks[bankId][chosenSfx[i].soundIndex].soundStatus = 2; + } else if (sSoundBanks[bankId][chosenSfx[i].soundIndex].soundStatus == 4) { + sSoundBanks[bankId][chosenSfx[i].soundIndex].soundStatus = 3; } } - for (i = 0; i < var_t1; i++) { - var_v1 = 0; - soundIndex = D_80192AB8[bankId][i][4]; - if (soundIndex == 0xFF) { - var_v1 = 1; + + for (i = 0; i < numChannels; i++) { + needNewSfx = false; + activeSfx = (struct ActiveSfx*) &D_80192AB8[bankId][i]; + + if (activeSfx->soundIndex == 0xFF) { + needNewSfx = true; } else { - temp_t2 = &sSoundBanks[bankId][soundIndex]; - if (temp_t2->soundStatus == 4) { - if (temp_t2->soundBits & 0x08000000) { - delete_sound_from_bank(bankId, soundIndex); - var_v1 = 1; + entry = &sSoundBanks[bankId][activeSfx->soundIndex]; + if (entry->soundStatus == 4) { + if (entry->soundBits & 0x08000000) { + delete_sound_from_bank(bankId, activeSfx->soundIndex); } else { - temp_t2->soundStatus = 1; - var_v1 = 1; + entry->soundStatus = 1; } - } else if (temp_t2->soundStatus == 0) { - D_80192AB8[bankId][i][4] = 0xFF; - var_v1 = 1; + needNewSfx = true; + } else if (entry->soundStatus == 0) { + activeSfx->soundIndex = 0xFF; + needNewSfx = true; } else { - for (j = 0; j < var_t1; j++) { - if (soundIndex == sp7C[j].soundIndex) { - sp7C[j].soundIndex = 0xFF; - j = var_t1; + for (j = 0; j < numChannels; j++) { + if (activeSfx->soundIndex == chosenSfx[j].soundIndex) { + chosenSfx[j].soundIndex = 0xFF; + j = numChannels; } } + numChosenSfx--; } } - var_s2--; - if (var_v1 == 1) { - for (j = 0; j < var_t1; j++) { - soundIndex = sp7C[j].soundIndex; - if ((soundIndex != 0xFF) && (sSoundBanks[bankId][soundIndex].soundStatus != 3)) { - for (k = 0; k < var_t1; k++) { - if (soundIndex == D_80192AB8[bankId][k][4]) { - var_v1 = 0; - k = var_t1; + + if (needNewSfx == true) { + for (j = 0; j < numChannels; j++) { + chosenEntryIndex = chosenSfx[j].soundIndex; + if ((chosenEntryIndex != 0xFF) && (sSoundBanks[bankId][chosenEntryIndex].soundStatus != 3)) { + for (k = 0; k < numChannels; k++) { + if (chosenEntryIndex == ((struct ActiveSfx*) (D_80192AB8[bankId]))[k].soundIndex) { + needNewSfx = false; + k = numChannels; } } - if (var_v1 == 1) { - D_80192AB8[bankId][i][4] = soundIndex; - sp7C[j].soundIndex = 0xFF; - j = var_t1 + 1; - var_s2--; + + if (needNewSfx == true) { + activeSfx->soundIndex = chosenEntryIndex; + chosenSfx[j].soundIndex = 0xFF; + j = numChannels + 1; + numChosenSfx--; } } } - if (j == var_t1) { - D_80192AB8[bankId][i][4] = 0xFF; + + if (j == numChannels) { + activeSfx->soundIndex = 0xFF; } } } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4888.s") -#endif -#ifdef NON_MATCHING -// https://decomp.me/scratch/Lm9EX -/* ~*~*~* UwU Resgister allocation OwO *~*~*~ */ void func_800C4FE4(u8 bankId) { u8 soundId; u8 var_s4; @@ -1527,8 +1574,8 @@ void func_800C4FE4(u8 bankId) { D_801930D0->unk_00E[2] = 0x28; } func_800C19D0(bankId, soundId, D_80192C38); - func_800CBBE8((D_80192C38 << 8) | 0x06020000, 1); - func_800CBBE8((D_80192C38 << 8) | 0x06020000 | 4, temp_s0->soundBits & 0xFF); + func_800CBBE8(((D_80192C38 & 0xFF) << 8) | 0x06020000, 1); + func_800CBBE8(((D_80192C38 & 0xFF) << 8) | 0x06020000 | 4, (u8) (temp_s0->soundBits & 0xFF)); temp_s0->soundStatus = 4U; } else if (((u8) thing->soundScriptIO[7]) == 0x80) { func_800CBBE8(((D_80192C38 & 0xFF) << 8) | 0x06020000 | 7, 0); @@ -1541,9 +1588,6 @@ void func_800C4FE4(u8 bankId) { D_80192C38 += 1; } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4FE4.s") -#endif // Seems somewhat similar to certain parts of `select_current_sounds` from SM64 void func_800C5278(u8 bankId) { @@ -1781,7 +1825,7 @@ void func_800C5CB8(void) { } void func_800C5D04(u8 playerId) { - if ((gPlayers[playerId].unk_044 & 0x20) == 0x20) { + if ((gPlayers[playerId].kartProps & THROTTLE) == THROTTLE) { D_800E9E34[playerId] = 0; if (D_800E9E24[playerId] < 0x4E20) { if ((u8) D_800EA16C == 0) { @@ -1810,7 +1854,7 @@ void func_800C5D04(u8 playerId) { void func_800C5E38(u8 playerId) { if (D_800EA108 == 0) { - if (((gPlayers[playerId].unk_044 & 0x20) != 0x20) && (gPlayers[playerId].unk_098 > 400.0f)) { + if (((gPlayers[playerId].kartProps & THROTTLE) != THROTTLE) && (gPlayers[playerId].unk_098 > 400.0f)) { D_800E9E14[playerId] = 1; if (D_800EA0EC[playerId] == 0) { D_800E9F7C[playerId].unk_10 = 0.6f - D_800E9F54[playerId]; @@ -1826,11 +1870,11 @@ void func_800C5E38(u8 playerId) { if ((s32) D_800EA1C0 < 2) { play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26), &D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); } else { play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26), &D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); } } break; @@ -1862,11 +1906,11 @@ void func_800C6108(u8 playerId) { player = &gPlayers[playerId]; D_800E9E64[playerId] = (player->unk_098 / D_800E9DC4[playerId]) + D_800E9DD4[playerId]; - if ((player->unk_098 < 1800.0f) && ((player->unk_044 & 0x20) != 0x20)) { + if ((player->unk_098 < 1800.0f) && ((player->kartProps & THROTTLE) != THROTTLE)) { D_800E9E64[playerId] = (player->unk_098 / D_800E9F7C[playerId].unk_34) + D_800E9F7C[playerId].unk_28; if (D_800E9EC4) {} // ? } - if (player->unk_094 > 4.75f) { + if (player->speed > 4.75f) { if (D_800E9EB4[playerId] < (D_800E9F7C[playerId].unk_18 + 0.4f)) { D_800E9DE4[playerId] += 0.005f; } @@ -1878,7 +1922,7 @@ void func_800C6108(u8 playerId) { } else { D_800E9E54[playerId] = (f32) -player->unk_0C0; } - if ((player->effects & 0x10) == 0x10) { + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId]; } else { D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId] - (D_800E9E54[playerId] / 12000.0f); @@ -1902,30 +1946,30 @@ void func_800C6108(u8 playerId) { #ifdef VERSION_EU if ((D_800E9EE4[playerId] > 0.5f) || (D_800E9EE4[playerId] < -0.5f)) #else - if ((D_800E9EE4[playerId] > 0.5f) || (D_800E9EE4[playerId] < 0.5f)) { + if ((D_800E9EE4[playerId] > 0.5f) || (D_800E9EE4[playerId] < 0.5f)) #endif + { D_800E9ED4[playerId] = D_800E9EE4[playerId] * 0.25f; - D_800E9F7C[playerId].unk_0C = D_800E9EC4[playerId] + D_800E9ED4[playerId] + D_800E9F34[playerId]; -} -else { - D_800E9F7C[playerId].unk_0C = D_800E9EB4[playerId] + D_800E9F34[playerId]; -} + D_800E9F7C[playerId].unk_0C = D_800E9EC4[playerId] + D_800E9ED4[playerId] + D_800E9F34[playerId]; + } else { + D_800E9F7C[playerId].unk_0C = D_800E9EB4[playerId] + D_800E9F34[playerId]; + } #ifdef VERSION_EU -if (D_800E9F7C[playerId].unk_0C < 0.0f) { - D_800E9F7C[playerId].unk_0C = 0.0f; -} + if (D_800E9F7C[playerId].unk_0C < 0.0f) { + D_800E9F7C[playerId].unk_0C = 0.0f; + } #endif -if (D_800E9F7C[playerId].unk_0C > 4.0f) { - D_800E9F7C[playerId].unk_0C = 4.0f; -} -D_800E9EC4[playerId] = D_800E9F7C[playerId].unk_0C; -D_800E9F7C[playerId].unk_38 = (D_800E9F7C[playerId].unk_0C / 1.5f) + 0.4f; + if (D_800E9F7C[playerId].unk_0C > 4.0f) { + D_800E9F7C[playerId].unk_0C = 4.0f; + } + D_800E9EC4[playerId] = D_800E9F7C[playerId].unk_0C; + D_800E9F7C[playerId].unk_38 = (D_800E9F7C[playerId].unk_0C / 1.5f) + 0.4f; } void func_800C64A0(u8 playerId) { switch (D_800E9E74[playerId]) { case 3: - D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f; + D_800E9EF4[playerId] = (gPlayers[playerId].speed / 5.0f) + 0.2f; break; case 1: case 13: @@ -1948,7 +1992,7 @@ void func_800C64A0(u8 playerId) { case 29: case 30: case 31: - D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f; + D_800E9EF4[playerId] = (gPlayers[playerId].speed / 5.0f) + 0.2f; break; default: D_800E9EF4[playerId] = 1.0f; @@ -1960,7 +2004,7 @@ void func_800C64A0(u8 playerId) { if (D_800E9EF4[playerId] < 0.0f) { D_800E9EF4[playerId] = 0.0f; } - if ((gPlayers[playerId].unk_044 & 0x20) == 0x20) { + if ((gPlayers[playerId].kartProps & THROTTLE) == THROTTLE) { D_800E9F04[playerId] = 0.56f - (D_800E9E24[playerId] * 0.06f); } else { D_800E9F04[playerId] = (D_800E9E34[playerId] / 50.0f) + 0.25f; @@ -1976,7 +2020,7 @@ void func_800C64A0(u8 playerId) { void func_800C6758(u8 playerId) { switch (D_800E9E74[playerId]) { /* irregular */ case 3: - D_800E9F14[playerId] = (gPlayers[playerId].unk_094 / 9.0f) + 0.6f; + D_800E9F14[playerId] = (gPlayers[playerId].speed / 9.0f) + 0.6f; break; case 2: case 13: @@ -1996,144 +2040,144 @@ void func_800C683C(u8 cameraId) { switch (D_800E9E74[cameraId]) { case 3: play_sound(SOUND_ACTION_TYRE_SQUEAL, &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ACTION_TYRE_SQUEAL; break; case 18: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x1D), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x1D); break; case 19: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x22), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x22); break; case 1: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x09), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x09); break; case 2: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF4, 0x0A), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF4, 0x0A); break; case 17: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1E), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1E); break; case 15: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1F), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1F); break; case 16: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x21), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x21); break; case 20: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x27), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x27); break; case 25: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x20), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x20); break; case 26: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x23), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x23); break; case 27: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x46), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x46); break; case 28: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x25), &D_800E9F7C[cameraId].pos, cameraId, - &D_800E9F14[cameraId], &D_800EA1D4, (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9F14[cameraId], &D_800EA1D4, (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x25); break; case 4: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0B), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0B); break; case 5: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0C), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0C); break; case 6: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0D), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0D); break; case 7: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0E), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0E); break; case 8: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0F), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0F); break; case 9: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x10), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x10); break; case 10: case 14: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x11), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x11); break; case 11: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x12), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x12); break; case 12: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x13), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x13); break; case 29: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x48), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x48); break; case 30: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x49), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x49); break; case 31: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x4A), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x4A); break; case 13: case 22: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x29), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x29); break; case 23: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2A), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2A); break; case 24: play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2B), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, - &D_800E9EF4[cameraId], (u8*) &D_800E9F7C[cameraId].unk_14); + &D_800E9EF4[cameraId], (s8*) &D_800E9F7C[cameraId].unk_14); D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2B); break; default: @@ -2148,7 +2192,7 @@ void func_800C683C(u8 cameraId) { void func_800C70A8(u8 playerId) { if (D_800EA0EC[playerId] == 0) { D_800E9E74[playerId] = 0; - if ((D_800E9E54[playerId] > 3500.0f) || ((gPlayers[playerId].effects & 0x10) == 0x10)) { + if ((D_800E9E54[playerId] > 3500.0f) || ((gPlayers[playerId].effects & DRIFTING_EFFECT) == DRIFTING_EFFECT)) { D_800E9E74[playerId] = 1; switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) { case DIRT: /* switch 1 */ @@ -2180,7 +2224,7 @@ void func_800C70A8(u8 playerId) { break; } } - if ((gPlayers[playerId].effects & 0x10) == 0x10) { + if ((gPlayers[playerId].effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { D_800E9E74[playerId] = 2; switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) { /* switch 2 */ case DIRT: /* switch 2 */ @@ -2332,17 +2376,21 @@ void func_800C70A8(u8 playerId) { D_800E9E74[playerId] = 0x0000001B; break; } - if (((gPlayers[playerId].unk_094 < 0.5f) || ((gPlayers[playerId].effects & 8) == 8)) && + if (((gPlayers[playerId].speed < 0.5f) || ((gPlayers[playerId].effects & MIDAIR_EFFECT) == MIDAIR_EFFECT)) && (D_800E9E74[playerId] != 0x0000001C)) { D_800E9E74[playerId] = 0; } - if ((((gPlayers[playerId].effects & 0x4000) == 0x4000) && ((gPlayers[playerId].type & 0x2000) != 0x2000)) || - ((gPlayers[playerId].effects & 0x800) == 0x800) || ((gPlayers[playerId].effects & 0x80) == 0x80) || - ((gPlayers[playerId].effects & 0x40) == 0x40) || ((gPlayers[playerId].unk_044 & 0x4000) == 0x4000)) { + if ((((gPlayers[playerId].effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) && + ((gPlayers[playerId].type & PLAYER_START_SEQUENCE) != PLAYER_START_SEQUENCE)) || + ((gPlayers[playerId].effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT) || + ((gPlayers[playerId].effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((gPlayers[playerId].effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((gPlayers[playerId].kartProps & DRIVING_SPINOUT) == DRIVING_SPINOUT)) { D_800E9E74[playerId] = 0x00000012; } - if ((((gPlayers[playerId].effects & 0x20) == 0x20) && ((gPlayers[playerId].type & 0x2000) != 0x2000)) || - ((gPlayers[playerId].effects & 0x800) == 0x800)) { + if ((((gPlayers[playerId].effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) && + ((gPlayers[playerId].type & PLAYER_START_SEQUENCE) != PLAYER_START_SEQUENCE)) || + ((gPlayers[playerId].effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT)) { D_800E9E74[playerId] = 0x00000013; } if (gPlayers[playerId].unk_20C != 0.0f) { @@ -2351,6 +2399,14 @@ void func_800C70A8(u8 playerId) { } } +/* + Routine to tell the game which "finish" music to play depending on which mode the player is in (Grand Prix, Time + Trials, etc), whether the game is in multiplayer or not, and which position they ended up finishing in (1st, 2nd, + 3rd, etc) + + Contains a LOT of inlined funcs. + Modify if you dare. +*/ void func_800C76C0(u8 playerId) { if (D_800E9EA4[playerId] != 0) { if (D_800E9EA4[playerId] < 0x2BC) { @@ -2374,15 +2430,15 @@ void func_800C76C0(u8 playerId) { func_800C97C4(playerId); D_800EA0F0 = 2; func_800C9A88(playerId); - func_800CA414(0x000DU, 0x0010U); + play_sequences(SEQ_EVENT_RACE_FINISH_FIRST, SEQ_MENU_RESULTS_SCREEN_WIN); } else if (gPlayers[playerId].currentRank < 4) { func_800C97C4(playerId); D_800EA0F0 = 2; func_800C9A88(playerId); - func_800CA414(0x000EU, 0x0010U); + play_sequences(SEQ_EVENT_RACE_FINISH_OTHER, SEQ_MENU_RESULTS_SCREEN_WIN); } else { func_800C3448(-0x3E9F9C00); - func_800CA414(0x000FU, 0x0018U); + play_sequences(SEQ_EVENT_RACE_FINISH_LOSE, SEQ_MENU_RESULTS_SCREEN_LOSE); } } else { D_800EA0EC[playerId] = 2; @@ -2393,7 +2449,7 @@ void func_800C76C0(u8 playerId) { func_800C97C4(playerId); D_800EA0F0 = 2; func_800C9A88(playerId); - func_800CA414(0x000DU, 0x0010U); + play_sequences(SEQ_EVENT_RACE_FINISH_FIRST, SEQ_MENU_RESULTS_SCREEN_WIN); } else if (gPlayers[playerId].currentRank < 4) { if (D_800EA104 == 0) { func_800C3448(0x100100FF); @@ -2402,12 +2458,12 @@ void func_800C76C0(u8 playerId) { func_800C97C4(playerId); D_800EA0F0 = 2; func_800C9A88(playerId); - func_800CA414(0x000EU, 0x0010U); + play_sequences(SEQ_EVENT_RACE_FINISH_OTHER, SEQ_MENU_RESULTS_SCREEN_WIN); } else if (D_800EA104 == 0) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); func_800C3448(-0x3E9F9C00); - func_800CA414(0x000FU, 0x0018U); + play_sequences(SEQ_EVENT_RACE_FINISH_LOSE, SEQ_MENU_RESULTS_SCREEN_LOSE); } if ((D_800EA104 != 0) || (D_800EA0EC[playerId] != 1)) { func_800C5278(5U); @@ -2423,9 +2479,9 @@ void func_800C76C0(u8 playerId) { D_800EA0EC[playerId] = 2; func_800C9060(playerId, 0x1900F103U); if (D_801657E5 == 1) { - func_800CA414(0x000DU, 0x0010U); + play_sequences(SEQ_EVENT_RACE_FINISH_FIRST, SEQ_MENU_RESULTS_SCREEN_WIN); } else if (D_8018ED90 == 1) { - func_800CA414(0x000EU, 0x0010U); + play_sequences(SEQ_EVENT_RACE_FINISH_OTHER, SEQ_MENU_RESULTS_SCREEN_WIN); } else { func_800C3448(0x01640010); } @@ -2440,25 +2496,26 @@ void func_800C76C0(u8 playerId) { func_800C97C4(playerId); D_800EA0F0 = 2; func_800C9A88(playerId); - func_800CA414(0x000DU, 0x0017U); + play_sequences(SEQ_EVENT_RACE_FINISH_FIRST, SEQ_MENU_RESULTS_SCREEN_WIN_VS); break; case 2: /* switch 1 */ if ((D_800EA104 == 0) && (D_800EA0EC[playerId] == 1)) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); #ifdef VERSION_EU - func_800C8EF8(0x000DU); + play_sequence2(SEQ_EVENT_RACE_FINISH_FIRST); #else - func_800CA414(0x000DU, 0x0017U); + play_sequences(SEQ_EVENT_RACE_FINISH_FIRST, SEQ_MENU_RESULTS_SCREEN_WIN_VS); #endif D_800EA104 = 1; } else if ((D_800EA104 == 1) && (D_800EA0EC[playerId] == 1)) { func_800C5278(5U); #ifndef VERSION_EU - if (func_800C3508(1) != 0x000D) { + if (func_800C3508(1) != 0x000D) #endif + { D_800EA104 = 0; - func_800CA414(0x000EU, 0x0017U); + play_sequences(SEQ_EVENT_RACE_FINISH_OTHER, SEQ_MENU_RESULTS_SCREEN_WIN_VS); } D_800EA104 = 2; } @@ -2467,21 +2524,22 @@ void func_800C76C0(u8 playerId) { if ((D_800EA104 == 0) && (D_800EA0EC[playerId] == 1)) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); - func_800C8EF8(0x000DU); + play_sequence2(SEQ_EVENT_RACE_FINISH_FIRST); D_800EA104 = 1; } else if ((D_800EA104 == 1) && (D_800EA0EC[playerId] == 1)) { if (func_800C3508(1) != 0x000D) { D_800EA104 = 0; - func_800C8EF8(0x000EU); + play_sequence2(SEQ_EVENT_RACE_FINISH_OTHER); } D_800EA104 = 2; } else if ((D_800EA104 == 2) && (D_800EA0EC[playerId] == 1)) { func_800C5278(5U); #ifndef VERSION_EU - if (func_800C3508(1) != 0x000E) { + if (func_800C3508(1) != 0x000E) #endif + { D_800EA104 = 0; - func_800CA414(0x000EU, 0x0017U); + play_sequences(SEQ_EVENT_RACE_FINISH_OTHER, SEQ_MENU_RESULTS_SCREEN_WIN_VS); } D_800EA104 = 3; } @@ -2495,7 +2553,7 @@ void func_800C76C0(u8 playerId) { func_800C3448(0x110100FF); func_800C5278(5U); func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26)); - func_800C8EF8(0x0017U); + play_sequence2(SEQ_MENU_RESULTS_SCREEN_WIN_VS); D_800EA0EC[playerId] = 2; func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); @@ -2504,7 +2562,7 @@ void func_800C76C0(u8 playerId) { if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1)) { func_800C5278(5U); func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26)); - func_800C8EF8(0x0017U); + play_sequence2(SEQ_MENU_RESULTS_SCREEN_WIN_VS); D_800EA0EC[playerId] = 2; func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); @@ -2515,7 +2573,7 @@ void func_800C76C0(u8 playerId) { (D_800EA0EC[3] == 1)) { func_800C5278(5U); func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26)); - func_800C8EF8(0x0017U); + play_sequence2(SEQ_MENU_RESULTS_SCREEN_WIN_VS); D_800EA0EC[playerId] = 2; func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); @@ -2632,7 +2690,7 @@ void func_800C76C0(u8 playerId) { } void func_800C847C(u8 playerId) { - if ((gPlayers[playerId].unk_0DE & 1) == 1) { + if ((gPlayers[playerId].oobProps & UNDER_OOB_OR_FLUID_LEVEL) == UNDER_OOB_OR_FLUID_LEVEL) { if (D_800E9F74[playerId] == 0) { if ((s32) D_800EA1C0 < 2) { func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26)); @@ -2650,7 +2708,7 @@ void func_800C847C(u8 playerId) { (D_800EA0EC[playerId] == 0)) { play_sound((gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05), &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); } } } else { @@ -2662,20 +2720,20 @@ void func_800C847C(u8 playerId) { if ((gCurrentCourseId == COURSE_KOOPA_BEACH) && (D_800EA0EC[playerId] == 0)) { play_sound((gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08), &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); } } } } void func_800C86D8(u8 playerId) { - if (((gPlayers[playerId].effects & 0x40000000) != 0x40000000) && (D_800E9F24[playerId] == 1)) { + if (((gPlayers[playerId].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && (D_800E9F24[playerId] == 1)) { func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); } } void func_800C8770(u8 playerId) { - if ((gPlayers[playerId].effects & 0x40000000) == 0x40000000) { + if ((gPlayers[playerId].effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) { D_800E9F24[playerId] = 1; if (D_800E9F2C[playerId] < 0xFA) { D_800E9F2C[playerId]++; @@ -2708,11 +2766,14 @@ void func_800C8770(u8 playerId) { // Checks the same field for all players before doing something? void func_800C8920(void) { - if (((u8) D_800EA168 != 0) && ((gPlayers[0].effects & 0x40000000) != 0x40000000) && - ((gPlayers[1].effects & 0x40000000) != 0x40000000) && ((gPlayers[2].effects & 0x40000000) != 0x40000000) && - ((gPlayers[3].effects & 0x40000000) != 0x40000000) && ((gPlayers[4].effects & 0x40000000) != 0x40000000) && - ((gPlayers[5].effects & 0x40000000) != 0x40000000) && ((gPlayers[6].effects & 0x40000000) != 0x40000000) && - ((gPlayers[7].effects & 0x40000000) != 0x40000000)) { + if (((u8) D_800EA168 != 0) && ((gPlayers[0].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[1].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[2].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[3].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[4].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[5].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[6].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT) && + ((gPlayers[7].effects & LIGHTNING_EFFECT) != LIGHTNING_EFFECT)) { func_800CAC08(); } } @@ -2829,14 +2890,14 @@ void play_sound2(s32 soundBits) { play_sound(soundBits, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } -void func_800C8EAC(u16 arg0) { - func_800C3448(arg0 | 0x10000); - D_800EA15C = arg0; +void play_sequence(u16 index) { + func_800C3448(index | 0x0010000); + D_800EA15C = index; } -void func_800C8EF8(u16 arg0) { - func_800C3448(arg0 | 0x1010000); - D_800EA160 = arg0; +void play_sequence2(u16 index) { + func_800C3448(index | 0x1010000); + D_800EA160 = index; } void func_800C8F44(u8 arg0) { @@ -2855,8 +2916,8 @@ void func_800C8F80(u8 arg0, u32 soundBits) { } } -void func_800C9018(u8 arg0, u32 soundBits) { - func_800C5578(&D_800E9F7C[arg0].pos, soundBits); +void func_800C9018(u8 playerIndex, u32 soundBits) { + func_800C5578(&D_800E9F7C[playerIndex].pos, soundBits); } void func_800C9060(u8 playerId, u32 soundBits) { @@ -2866,7 +2927,7 @@ void func_800C9060(u8 playerId, u32 soundBits) { D_800EA0EC[playerId] = 1; case 0: play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); break; } } @@ -2883,12 +2944,13 @@ void func_800C90F4(u8 playerId, u32 soundBits) { ((soundBits & ~0xF0) == SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05))) { D_800EA180 = 1; } - if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) { + if (((gPlayers[playerId].effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && + ((s32) D_800E9F2C[playerId] >= 0x1F)) { play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA150, &D_800EA1D4, - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); } else { play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, - (u8*) &D_800E9F7C[playerId].unk_14); + (s8*) &D_800E9F7C[playerId].unk_14); } break; default: @@ -2897,9 +2959,9 @@ void func_800C90F4(u8 playerId, u32 soundBits) { } } -void func_800C9250(u8 arg0) { - func_800C90F4(arg0, - (gPlayers[arg0].characterId * 0x10) + (gAudioRandom & 1) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x01)); +void func_800C9250(u8 playerIndex) { + func_800C90F4(playerIndex, (gPlayers[playerIndex].characterId * 0x10) + (gAudioRandom & 1) + + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x01)); } void func_800C92CC(u8 playerId, u32 soundBits) { @@ -2912,12 +2974,13 @@ void func_800C92CC(u8 playerId, u32 soundBits) { (u8) var_s0, soundBits); if (temp_v0 != NULL) { temp_v0->unk34 = 170.0f; - if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) { + if (((gPlayers[playerId].effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && + ((s32) D_800E9F2C[playerId] >= 0x1F)) { play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, &temp_v0->unk18, var_s0, - &D_800EA150, &D_800EA1D4, &D_800EA06C[playerId].unk0C); + &D_800EA150, &D_800EA1D4, (s8*) &D_800EA06C[playerId].unk0C); } else { play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, &temp_v0->unk18, var_s0, - &temp_v0->unk2C, &D_800EA1D4, &D_800EA06C[playerId].unk0C); + &temp_v0->unk2C, &D_800EA1D4, (s8*) &D_800EA06C[playerId].unk0C); } } } @@ -3008,7 +3071,7 @@ void func_800C94A4(u8 playerId) { break; } play_sound(var_a0, &D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_0C, - &D_800E9F7C[playerId].unk_10, (u8*) &D_800E9F7C[playerId].unk_14); + &D_800E9F7C[playerId].unk_10, (s8*) &D_800E9F7C[playerId].unk_14); break; default: break; @@ -3096,7 +3159,7 @@ void func_800C9A88(u8 playerId) { if (temp_v0_6 != NULL) { temp_v0_6->unk34 = 40.0f; play_sound(soundBits, &temp_v0_6->unk18, var_s0, &temp_v0_6->unk2C, - &D_800EA06C[playerId].unk00[2], &D_800EA06C[playerId].unk0C); + &D_800EA06C[playerId].unk00[2], (s8*) &D_800EA06C[playerId].unk0C); } } } @@ -3218,8 +3281,8 @@ void func_800CA118(u8 arg0) { } } -void func_800CA24C(u8 arg0) { - D_800EA0EC[arg0] = 2; +void func_800CA24C(u8 playerIndex) { + D_800EA0EC[playerIndex] = 2; } void func_800CA270() { @@ -3256,29 +3319,29 @@ void func_800CA388(u8 arg0) { fade_channel_volume_scale(5, 0, arg0); } -void func_800CA414(u16 arg0, u16 arg1) { +void play_sequences(u16 first, u16 second) { if (D_800EA104 == 0) { func_800C3448(func_800C3508(0) | 0x30000000); func_800C35E8(0); - func_800C3448(arg1 | 0xC1510000); - func_800C3448(arg0 | 0x1000000); + func_800C3448(second | 0xC1510000); + func_800C3448(first | 0x01000000); } D_800EA104 = 1; } -void func_800CA49C(u8 arg0) { +void func_800CA49C(u8 playerIndex) { if (D_800EA108 == 0) { if (D_800EA1C0 >= 2) { - func_800C9060(arg0, 0x1900FF3A); + func_800C9060(playerIndex, 0x1900FF3A); } else if (D_800EA164 != 0) { func_800C3448(0x100100FF); // 0x19000000 func_800C3448(0x110100FF); - func_800C8EF8(0xC); + play_sequence2(SEQ_EVENT_RACE_FINAL_LAP); func_800C3448(0xC1510011); } else { func_800C3448(0x100100FF); // 0x19000000 func_800C3448(0x110100FF); - func_800C8EF8(0xC); + play_sequence2(SEQ_EVENT_RACE_FINAL_LAP); func_800C3448(D_800EA15C | 0xC1500000); func_800C3448(0xC130017D); } @@ -3289,7 +3352,7 @@ void func_800CA49C(u8 arg0) { void func_800CA59C(u8 playerId) { if ((D_800EA0EC[playerId] == 0) && (D_800EA108 == 0)) { play_sound((gPlayers[playerId].characterId * 0x10) + 0x29008001, &D_800E9F7C[playerId].pos, playerId, - &D_800EA1D4, &D_800EA1D4, (u8*) &D_800E9F7C[playerId].unk_14); + &D_800EA1D4, &D_800EA1D4, (s8*) &D_800E9F7C[playerId].unk_14); D_800EA164 = 1; if ((s32) D_800EA1C0 >= 2) { func_800C8F80(playerId, 0x0100FF2C); @@ -3302,34 +3365,35 @@ void func_800CA59C(u8 playerId) { func_800C3448(0xC1F00000); func_800C3448(0xC1510011); } else { - func_800C8EF8(0x0011U); + play_sequence2(SEQ_EVENT_RACE_POWERUP_STAR); } } else { if (1) {} // ? - func_800C8EF8(0x0011U); + play_sequence2(SEQ_EVENT_RACE_POWERUP_STAR); } } D_800EA10C[playerId] = 1; } } -void func_800CA730(u8 arg0) { - if (D_800EA0EC[arg0] == 0) { - if ((D_800EA108 == 0) && (D_800EA10C[arg0] != 0)) { - play_sound(gPlayers[arg0].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08), - &D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8*) &D_800E9F7C[arg0].unk_14); - if (D_800EA10C[arg0] != 0) { +void func_800CA730(u8 playerIndex) { + if (D_800EA0EC[playerIndex] == 0) { + if ((D_800EA108 == 0) && (D_800EA10C[playerIndex] != 0)) { + play_sound(gPlayers[playerIndex].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08), + &D_800E9F7C[playerIndex].pos, playerIndex, &D_800EA1D4, &D_800EA1D4, + (s8*) &D_800E9F7C[playerIndex].unk_14); + if (D_800EA10C[playerIndex] != 0) { if ((s32) D_800EA1C0 >= 2) { - func_800C9018(arg0, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); + func_800C9018(playerIndex, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); } else { - D_800EA10C[arg0] = 0; + D_800EA10C[playerIndex] = 0; if (D_800EA104 != 0) { - func_800C9018(arg0, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); + func_800C9018(playerIndex, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); } else if ((D_800EA10C[0] == 0) && (D_800EA10C[1] == 0)) { if (D_8018FC08 != 0) { if (((u32) (gSequencePlayers[1].enabled)) == 0) { func_800C3608(1, 5); - func_800C8EAC(D_800EA15C); + play_sequence(D_800EA15C); func_800C3448(0xB001307DU); } else if ((func_800C3508(1) == 0xC) || (func_800C357C(0x0101000C) == 0)) { func_800C3448(0xC1F00000U); @@ -3337,30 +3401,30 @@ void func_800CA730(u8 arg0) { func_800C3448(0xC130017DU); } else { func_800C3448(0x110100FFU); - func_800C8EAC(D_800EA15C); + play_sequence(D_800EA15C); func_800C3448(0xB001307DU); } } else { func_800C3448(0x110100FFU); - func_800C8EAC(D_800EA15C); + play_sequence(D_800EA15C); } } D_800EA164 = 0; } } - D_800EA10C[arg0] = 0; + D_800EA10C[playerIndex] = 0; } } } -void func_800CA984(u8 arg0) { +void func_800CA984(u8 playerIndex) { u8 i; struct Unk_8018EFD8* temp_v0_2; if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) { for (i = 0; i < D_800EA1C0 + 1; i++) { - temp_v0_2 = - func_800C1C88(arg0, gPlayers[arg0].pos, D_800EA1C8, &gPlayers[arg0].unk_098, (u8) i, SOUND_ITEM_STAR); + temp_v0_2 = func_800C1C88(playerIndex, gPlayers[playerIndex].pos, D_800EA1C8, + &gPlayers[playerIndex].unk_098, (u8) i, SOUND_ITEM_STAR); if (temp_v0_2) { play_sound(SOUND_ITEM_STAR, &temp_v0_2->unk18, i, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } @@ -3374,17 +3438,17 @@ void func_800CAACC(u8 playerId) { } } -void func_800CAB4C(u8 arg0) { +void func_800CAB4C(u8 playerIndex) { UNUSED u8* temp_v1; UNUSED u8 temp_v0; if (D_800EA108 == 0) { - switch (D_800EA0EC[arg0]) { + switch (D_800EA0EC[playerIndex]) { case 2: - D_800EA0EC[arg0] = 1; + D_800EA0EC[playerIndex] = 1; case 0: func_800C36C4(0, 1U, 0x55U, 5); - func_800C9060(arg0, 0x1900F013U); + func_800C9060(playerIndex, 0x1900F013U); play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); break; default: @@ -3402,7 +3466,7 @@ void func_800CAC08() { } } -void func_800CAC60(UNUSED s32 arg0) { +void func_800CAC60(UNUSED u8 arg0) { if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) { play_sound(SOUND_ACTION_EXPLOSION_2, &D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); if ((D_800EA10C[0] != 1) && (D_800EA10C[1] != 1)) { @@ -3423,11 +3487,11 @@ void func_800CAD40(UNUSED s32 arg0) { } } -void func_800CADD0(u8 arg0, f32 arg1) { +void func_800CADD0(u8 playerIndex, f32 arg1) { if (D_800EA108 == 0) { - switch (D_800EA0EC[arg0]) { + switch (D_800EA0EC[playerIndex]) { case 2: - D_800EA0EC[arg0] = 1; + D_800EA0EC[playerIndex] = 1; // Purposeful fallthrough case 0: arg1 = (arg1 * 0.55f) + 0.45f; @@ -3437,9 +3501,9 @@ void func_800CADD0(u8 arg0, f32 arg1) { if (arg1 < 0.0f) { arg1 = 0.0f; } - D_800EA110[arg0] = arg1; - play_sound(0x1900A209U, &D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA110[arg0], - (u8*) &D_800E9F7C[arg0].unk_14); + D_800EA110[playerIndex] = arg1; + play_sound(0x1900A209U, &D_800E9F7C[playerIndex].pos, playerIndex, &D_800EA1D4, + &D_800EA110[playerIndex], (s8*) &D_800E9F7C[playerIndex].unk_14); break; default: break; @@ -3463,7 +3527,7 @@ void func_800CAEC4(u8 playerId, f32 arg1) { } D_800EA120[playerId] = arg1; play_sound(gCurrentCourseId + 0x19007020, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, - &D_800EA120[playerId], (u8*) &D_800E9F7C[playerId].unk_14); + &D_800EA120[playerId], (s8*) &D_800E9F7C[playerId].unk_14); break; default: break; @@ -3471,30 +3535,31 @@ void func_800CAEC4(u8 playerId, f32 arg1) { } } -void func_800CAFC0(u8 arg0) { +void func_800CAFC0(u8 playerIndex) { if (D_800EA108 == 0) { - switch (D_800EA0EC[arg0]) { + switch (D_800EA0EC[playerIndex]) { case 2: - D_800EA0EC[arg0] = 1; + D_800EA0EC[playerIndex] = 1; case 0: func_800C36C4(0, 1, 0x55U, 5); - func_800C9060(arg0, 0x19009E59U); - func_800C8F80(arg0, 0x0100FA4C); - D_800EA170[arg0] = 1; + func_800C9060(playerIndex, 0x19009E59U); + func_800C8F80(playerIndex, 0x0100FA4C); + D_800EA170[playerIndex] = 1; break; } } } -void func_800CB064(u8 arg0) { +void func_800CB064(u8 playerIndex) { if (D_800EA108 == 0) { - if (D_800EA170[arg0] == 1) { + if (D_800EA170[playerIndex] == 1) { if ((u8) D_800EA168 == 0) { func_800C36C4(0, 1U, 0x7FU, 0x19); } - func_800C90F4(arg0, gPlayers[arg0].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); - func_800C9018(arg0, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x4C)); - D_800EA170[arg0] = 0; + func_800C90F4(playerIndex, + gPlayers[playerIndex].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); + func_800C9018(playerIndex, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x4C)); + D_800EA170[playerIndex] = 0; } } } @@ -3503,41 +3568,61 @@ void func_800CB134() { D_800EA174 = 1; } -void func_800CB14C() { +/* + Play the entire "losing" sequence for the podium ceremony. + + Increments a timer value by one per frame in order to tell which part of the sequence to play at which point. +*/ +void begin_losing_ceremony_sequence() { if (D_800EA174 != 0) { D_800EA174++; + if (D_800EA174 == 3) { - func_800C8EAC(0x001AU); + play_sequence(SEQ_EVENT_CEREMONY_PRESENTATION_PART1); // Begin with Part 1 of the ceremony presentation + // music --- "Everything seems normal..." func_800C3448(0x4000007F); } - if (D_800EA174 == 0x012C) { - func_800C8EAC(0x001BU); + + if (D_800EA174 == 300) { + play_sequence(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_WIN); // Follow up with Part 2 of the winning ceremony + // presentation music --- "Looks like I won...?" func_800C3448(0x4000007F); - func_800C8EF8(0x001DU); + play_sequence2(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_LOSE); // Once it ends, begin the LOSING ceremony + // presentation music, which has a few notes + // changed to be off-tune --- "Uh oh..." func_800C3448(0x41000000); } - if (D_800EA174 == 0x0230) { + + if (D_800EA174 == 560) { // (Somewhere in this code it slows down the music, changes the pitch of it and + // completely breaks the music) func_800C3448(0x40640000); func_800C3448(0xB0640073); func_800C3448(0x4150007F); func_800C3448(0xB1640073); } - if (D_800EA174 == 0x02A8) { + + if (D_800EA174 == 680) { func_800C3448(0x100100FF); } - if (D_800EA174 == 0x041A) { + + if (D_800EA174 == 1050) { func_800C3448(0xB1500001); func_800C3448(0x51500001); } - if (D_800EA174 == 0x046A) { + + if (D_800EA174 == 1130) { func_800C3448(0x41320000); } - if (D_800EA174 == 0x04B0) { + + if (D_800EA174 == 1200) { // (Player gets hit by the bomb-omb car; play the "explosion" sound effect and the + // "hurt" voice for the current character) func_800C3448(0x110100FF); } - if (D_800EA174 == 0x04CE) { - func_800C8EAC(0x0014U); - func_800C3448(0x4000007F); + + if (D_800EA174 == 1230) { // Once the music is completely broken by this point, play the "No Trophy For You!" + // sequence --- "Aw man, I lost... :(" + play_sequence(SEQ_EVENT_CEREMONY_TROPHY_LOSE); + func_800C3448(0x4000007F); // (Play the "losing" voice for the current character, twice) } } } diff --git a/src/audio/external.h b/src/audio/external.h index 4eb118eaff..5caf82cc27 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -270,8 +270,8 @@ void func_800C8AE4(void); void func_800C8C7C(u8); void func_800C8CCC(void); void play_sound2(s32); -void func_800C8EAC(u16); -void func_800C8EF8(u16); +void play_sequence(u16); +void play_sequence2(u16); void func_800C8F44(u8); void func_800C8F80(u8, u32); @@ -304,20 +304,20 @@ void func_800CA2E4(u8, s8); void func_800CA30C(u8); void func_800CA330(u8); void func_800CA388(u8); -void func_800CA414(u16, u16); +void play_sequences(u16, u16); void func_800CA49C(u8); void func_800CA59C(u8); void func_800CA984(u8); void func_800CAACC(u8); void func_800CAB4C(u8); void func_800CAC08(void); -void func_800CAC60(s32); +void func_800CAC60(u8); void func_800CAD40(s32); void func_800CAEC4(u8, f32); void func_800CAFC0(u8); void func_800CB134(void); -void func_800CB14C(void); +void begin_losing_ceremony_sequence(void); void func_800CB2C4(void); void func_800CBC24(void); @@ -416,7 +416,7 @@ extern u16 D_800EA1C4; // a sound source, its usage makes it look like a 0'd Vec3f for general usage extern Vec3f D_800EA1C8; // = {0.0f, 0.0f, 0.0f} extern f32 D_800EA1D4; -extern u8 D_800EA1DC; // = 0; +extern s8 D_800EA1DC; // = 0; extern u8 D_800EA1E4; extern u8 D_800EA1E8; extern u8 D_800EA1EC; diff --git a/src/audio/load.c b/src/audio/load.c index 26d7ee6ef9..1df4f998d3 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -755,29 +755,28 @@ void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) { seqPlayer->scriptState.pc = sequenceData; } -#ifdef NON_MATCHING -// https://decomp.me/scratch/5FBUM -// There is some wild bullshit going on in this function -// It is an unholy cross between SM64's EU and Shindou -// verions of this function, with the for loop towards -// the bottom resembling stuff from bank_load_async extern u8 _audio_banksSegmentRomStart; extern u8 _audio_tablesSegmentRomStart; extern u8 _instrument_setsSegmentRomStart; extern u8 _sequencesSegmentRomStart; - +/** + * There is some wild bullshit going on in this function + * It is an unholy cross between SM64's EU and Shindou + * verions of this function, with the for loop towards + * the bottom resembling stuff from bank_load_async + */ void audio_init(void) { s32 i; - UNUSED s32 pad[2]; - s32 j; - UNUSED s32 pad2[6]; - u32 sp60[2]; - UNUSED s32 pad1[2]; - s32 aaa; + UNUSED s32 pad[6]; + s32 j, k; + s32 ctlSeqCount; + u32 buf[2]; + UNUSED s32 lim2, lim3; s32 size; - UNUSED u64* ptr64; + u64* ptr64; + UNUSED s32 pad2; UNUSED s32 one = 1; - u8* test; + void* data; gAudioLoadLock = 0; @@ -788,30 +787,36 @@ void audio_init(void) { #ifdef TARGET_N64 // It seems boot.s doesn't clear the .bss area for audio, so do it here. ptr64 = (u64*) ((u8*) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)); - for (i = ((uintptr_t) &gAudioGlobalsEndMarker - + for (k = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) ((u64*) ((u8*) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)))) / 8; - i >= 0; i--) { + k >= 0; k--) { *ptr64++ = 0; } #endif - switch (osTvType) { /* irregular */ - case 0: +#ifdef VERSION_EU + D_803B7178 = 20.03042f; + gRefreshRate = 50; +#else // US + switch (osTvType) { + case TV_TYPE_PAL: D_803B7178 = 20.03042f; - gRefreshRate = 0x00000032; + gRefreshRate = 50; break; - case 2: + case TV_TYPE_MPAL: D_803B7178 = 16.546f; - gRefreshRate = 0x0000003C; + gRefreshRate = 60; break; - case 1: + case TV_TYPE_NTSC: default: D_803B7178 = 16.713f; - gRefreshRate = 0x0000003C; + gRefreshRate = 60; break; } +#endif port_eu_init(); + if (k) {} // fake for (i = 0; i < NUMAIBUFFERS; i++) { gAiBufferLengths[i] = 0xa0; } @@ -840,48 +845,49 @@ void audio_init(void) { gAudioResetPresetIdToLoad = 0; gAudioResetStatus = one; audio_shut_down_and_reset_step(); - gSeqFileHeader = (ALSeqFile*) sp60; - test = &_sequencesSegmentRomStart; - audio_dma_copy_immediate(test, gSeqFileHeader, 0x00000010U); + + // Load headers for sounds and sequences + gSeqFileHeader = (ALSeqFile*) buf; + data = &_sequencesSegmentRomStart; + audio_dma_copy_immediate(data, gSeqFileHeader, 0x10); gSequenceCount = gSeqFileHeader->seqCount; size = gSequenceCount * sizeof(ALSeqData) + 4; size = ALIGN16(size); gSeqFileHeader = soundAlloc(&gAudioInitPool, size); - audio_dma_copy_immediate(test, gSeqFileHeader, size); - func_800BB43C(gSeqFileHeader, test); - gAlCtlHeader = (ALSeqFile*) sp60; - test = &_audio_banksSegmentRomStart; - audio_dma_copy_immediate(test, gAlCtlHeader, 0x00000010U); - aaa = gAlCtlHeader->seqCount; - size = ALIGN16(aaa * sizeof(ALSeqData) + 4); + audio_dma_copy_immediate(data, gSeqFileHeader, size); + func_800BB43C(gSeqFileHeader, data); + + // Load header for CTL (instrument metadata) + gAlCtlHeader = (ALSeqFile*) buf; + data = &_audio_banksSegmentRomStart; + audio_dma_copy_immediate(data, gAlCtlHeader, 0x10); + ctlSeqCount = gAlCtlHeader->seqCount; + size = ALIGN16(ctlSeqCount * sizeof(ALSeqData) + 4); gAlCtlHeader = soundAlloc(&gAudioInitPool, size); - audio_dma_copy_immediate(test, gAlCtlHeader, size); - func_800BB43C(gAlCtlHeader, test); - gCtlEntries = soundAlloc(&gAudioInitPool, aaa * 0xC); - for (i = 0; i < aaa; i++) { - audio_dma_copy_immediate(gAlCtlHeader->seqArray[i].offset, sp60, 0x00000010U); - - gCtlEntries[i].numInstruments = sp60[0]; - gCtlEntries[i].numDrums = sp60[1]; - } - gAlTbl = (ALSeqFile*) sp60; - test = &_audio_tablesSegmentRomStart; - audio_dma_copy_immediate(test, gAlTbl, 0x00000010U); + audio_dma_copy_immediate(data, gAlCtlHeader, size); + func_800BB43C(gAlCtlHeader, data); + gCtlEntries = soundAlloc(&gAudioInitPool, ctlSeqCount * sizeof(struct CtlEntry)); + for (i = 0; i < ctlSeqCount; i++) { + audio_dma_copy_immediate(gAlCtlHeader->seqArray[i].offset, buf, 0x10); + gCtlEntries[i].numInstruments = buf[0]; + gCtlEntries[i].numDrums = buf[1]; + } + + // Load header for TBL (raw sound data) + gAlTbl = (ALSeqFile*) buf; + data = &_audio_tablesSegmentRomStart; + audio_dma_copy_immediate(data, gAlTbl, 0x10); size = gAlTbl->seqCount * sizeof(ALSeqData) + 4; size = ALIGN16(size); gAlTbl = soundAlloc(&gAudioInitPool, size); - audio_dma_copy_immediate(test, gAlTbl, size); - func_800BB43C(gAlTbl, test); - gAlBankSets = soundAlloc(&gAudioInitPool, 0x00000100U); - audio_dma_copy_immediate((u32) &_instrument_setsSegmentRomStart, gAlBankSets, 0x00000100U); + audio_dma_copy_immediate(data, gAlTbl, size); + func_800BB43C(gAlTbl, data); + + // Load bank sets for each sequence + gAlBankSets = soundAlloc(&gAudioInitPool, 0x100); + audio_dma_copy_immediate((u8*) &_instrument_setsSegmentRomStart, gAlBankSets, 0x100); + sound_alloc_pool_init(&gUnkPool1.pool, soundAlloc(&gAudioInitPool, (u32) D_800EA5D8), (u32) D_800EA5D8); init_sequence_players(); gAudioLoadLock = 0x76557364; } -#else -#ifdef VERSION_EU -GLOBAL_ASM("asm/eu_nonmatchings/audio_init.s") -#else -GLOBAL_ASM("asm/non_matchings/audio/load/audio_init.s") -#endif -#endif diff --git a/src/audio/playback.c b/src/audio/playback.c index fd54f24402..22c2b6d4dd 100644 --- a/src/audio/playback.c +++ b/src/audio/playback.c @@ -231,7 +231,7 @@ void process_notes(void) { } #endif -#ifdef VERSION_EU_1_0 +#ifdef VERSION_EU_V10 // Just threw these in here. They are probably wrong place and variables. stubbed_printf("----------------------Double-Error CH: %x %f\n", ¬e, note->parentLayer->seqChannel); stubbed_printf("----------------------Double-Error NT: %x\n", ¬e); diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 94c315151f..ff203d8485 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -24,7 +24,7 @@ char seqplayer_unused_string02[] = "Audio:Track: Warning :SUBTRACK had been stol char seqplayer_unused_string03[] = "SEQID %d,BANKID %d\n"; char seqplayer_unused_string04[] = "ERR:SUBTRACK %d NOT ALLOCATED\n"; char seqplayer_unused_string05[] = "Error:Same List Add\n"; -#ifdef VERSION_EU_1_0 +#ifdef VERSION_EU_V10 char seqplayer_unused_string_eu_01[] = "Wait Time out!\n"; #endif char seqplayer_unused_string06[] = "Macro Level Over Error!\n"; @@ -363,7 +363,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer* layer) { if (!layer->continuousNotes) { seq_channel_layer_note_decay(layer); } -#ifdef VERSION_EU_1_0 +#ifdef VERSION_EU_V10 else { if ((layer->note != 0) && (layer == layer->note->wantedParentLayer)) { seq_channel_layer_note_decay(layer); diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index d8f5c68b86..5d4fdc73ad 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -327,54 +327,51 @@ Acmd* synthesis_do_one_audio_update(s16* aiBuf, s32 bufLen, Acmd* acmd, s32 upda return acmd; } -#ifdef NON_MATCHING -// generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Nov-01-2023 Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, UNUSED s16* aiBuf, s32 inBuf, Acmd* cmd, s32 updateIndex) { - UNUSED s32 pad[4]; - struct AudioBankSample* audioBookSample; - s16* curLoadedBook; - struct AdpcmLoop* loopInfo; - s32 noteFinished; - s32 restart; - s32 flags; - u16 resamplingRateFixedPoint; + s32 pad[3]; + struct AudioBankSample* audioBookSample; // sp130 + struct AdpcmLoop* loopInfo; // sp12C + s16* curLoadedBook; // sp128 + s32 pad4; s32 nSamplesToLoad; - - s32 spFC; - UNUSED s32 pad2[2]; - + s32 noteFinished; // sp11C + s32 restart; // sp118 + s32 flags; + u16 resamplingRateFixedPoint; // sp112 + s32 pad2[1]; + u16 headsetPanRight; s32 loopInfo_2; - u8* sampleAddr; s32 a1; - - s32 samplesLenAdjusted; + s32 spFC; // spFC + s32 pad3; s32 nAdpcmSamplesProcessed; - s32 endPos; - s32 nSamplesToProcess; - - UNUSED s32 pad3; - + s32 s4; + u8* sampleAddr; // spEC s32 s3; + s32 samplesLenAdjusted; // spE4 s32 leftRight; - s32 s4; + s32 endPos; // spDC + s32 nSamplesToProcess; // spD8 u32 samplesLenFixedPoint; s32 var_s6; s32 nSamplesInThisIteration; u32 var_t2; u8* var_a0_2; - s32 s5Aligned; s32 temp_t6; - s32 nParts; - s32 curPart; s32 aligned; - UNUSED s32 pad4; - s32 resampledTempLen; /* compiler-managed */ + struct AudioBankSample* bankSample; + s32 nParts; // spB0 + s32 curPart; // spAC + s32 pad5; + s16 addr; + s32 resampledTempLen; // spA0 u16 noteSamplesDmemAddrBeforeResampling; - UNUSED s32 pad6[1]; + s32 samplesRemaining; + s32 s1; + u32 nEntries; struct Note* note; - u16 addr; curLoadedBook = NULL; note = &gNotes[noteIndex]; @@ -392,9 +389,9 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct resamplingRateFixedPoint = noteSubEu->resamplingRateFixedPoint; nParts = noteSubEu->hasTwoAdpcmParts + 1; - samplesLenFixedPoint = (resamplingRateFixedPoint * inBuf * 2) + synthesisState->samplePosFrac; - nSamplesToLoad = (samplesLenFixedPoint >> 0x10); - synthesisState->samplePosFrac = samplesLenFixedPoint & 0xFFFF; // m2c didn't have & 0xFFFF + samplesLenFixedPoint = ((resamplingRateFixedPoint * inBuf) * 2) + synthesisState->samplePosFrac; + nSamplesToLoad = samplesLenFixedPoint >> 0x10; + synthesisState->samplePosFrac = samplesLenFixedPoint & 0xFFFF; if (noteSubEu->isSyntheticWave) { cmd = load_wave_samples(cmd, noteSubEu, synthesisState, nSamplesToLoad); @@ -405,36 +402,30 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct audioBookSample = noteSubEu->sound.audioBankSound->sample; loopInfo = audioBookSample->loop; endPos = loopInfo->end; - sampleAddr = audioBookSample->sampleAddr; // book? + sampleAddr = audioBookSample->sampleAddr; resampledTempLen = 0; for (curPart = 0; curPart < nParts; curPart++) { + bankSample = audioBookSample; nAdpcmSamplesProcessed = 0; s4 = 0; if (nParts == 1) { samplesLenAdjusted = nSamplesToLoad; } else if (nSamplesToLoad & 1) { - samplesLenAdjusted = (nSamplesToLoad & ~1) + (curPart * 2); + samplesLenAdjusted = (nSamplesToLoad & (~1)) + (curPart * 2); } else { samplesLenAdjusted = nSamplesToLoad; } - // sm64 also has if (audioBookSample->codec == CODEC_A) { - if (curLoadedBook != (*audioBookSample->book).book) { - u32 nEntries; - curLoadedBook = audioBookSample->book->book; // or just one book? - nEntries = 16 * audioBookSample->book->order * audioBookSample->book->npredictors; + if (curLoadedBook != (*bankSample->book).book) { + curLoadedBook = bankSample->book->book; + nEntries = (16 * bankSample->book->order) * bankSample->book->npredictors; aLoadADPCM(cmd++, nEntries, VIRTUAL_TO_PHYSICAL2(noteSubEu->bookOffset + curLoadedBook)); - // noteSubEu here unsure but seems better? } if (noteSubEu->bookOffset != 0) { curLoadedBook = &gUnknownData_800F6290[0]; } while (nAdpcmSamplesProcessed != samplesLenAdjusted) { - - s32 samplesRemaining; - s32 s1; - noteFinished = false; restart = false; @@ -465,23 +456,20 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct noteFinished = 1; } } - // var_t2 = 0; // unsure + if (loopInfo_2 != 0) { temp_t6 = ((synthesisState->samplePosInt - s3) + 16) / 16; // diff from sm64 sh - if (audioBookSample->loaded == 0x81) { // sm64 has audioBookSample->medium + if (bankSample->loaded == 0x81) { var_a0_2 = (temp_t6 * 9) + sampleAddr; } else { var_a0_2 = dma_sample_data((uintptr_t) (temp_t6 * 9) + sampleAddr, ALIGN(((loopInfo_2 * 9) + 16), 4), flags, &synthesisState->sampleDmaIndex); - // unsure flags? } - var_t2 = ((uintptr_t) var_a0_2 & 0xF); - + var_t2 = ((uintptr_t) var_a0_2) & 0xF; aligned = ALIGN(((loopInfo_2 * 9) + 16), 4); - addr = (0x540 - aligned) & 0xFFFF; // DMEM_ADDR_COMPRESSED_ADPCM_DATA - + addr = (0x540 - aligned); // DMEM_ADDR_COMPRESSED_ADPCM_DATA aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(var_a0_2 - var_t2), addr, aligned); } else { s1 = 0; // ? @@ -489,7 +477,7 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct } if (synthesisState->restart != false) { - aSetLoop(cmd++, VIRTUAL_TO_PHYSICAL2(audioBookSample->loop->state)); + aSetLoop(cmd++, VIRTUAL_TO_PHYSICAL2(bankSample->loop->state)); flags = A_LOOP; synthesisState->restart = false; @@ -499,21 +487,15 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct if (nAdpcmSamplesProcessed == 0) { aligned = ALIGN(((loopInfo_2 * 9) + 16), 4); - addr = (0x540 - aligned) & 0xFFFF; - aSetBuffer(cmd++, 0, addr + var_t2, 0x1A0, - s1 * 2); // unsure - // s1 or s3 here? + addr = (0x540 - aligned); + aSetBuffer(cmd++, 0, addr + var_t2, 0x1A0, s1 * 2); aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); spFC = s3 * 2; - } else { - aligned = ALIGN(((loopInfo_2 * 9) + 16), 4); - addr = (0x540 - aligned) & 0xFFFF; - aSetBuffer(cmd++, 0, addr + var_t2, 0x1A0 + s5Aligned, s1 * 2); // unsure - + addr = (0x540 - aligned); + aSetBuffer(cmd++, 0, addr + var_t2, 0x1A0 + s5Aligned, s1 * 2); aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); - aDMEMMove(cmd++, 0x1A0 + s5Aligned + (s3 * 2), 0x1A0 + s4, nSamplesInThisIteration * 2); } @@ -524,31 +506,32 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct s4 = (s1 * 2) + 0x20; break; case 2: - s4 += nSamplesInThisIteration * 2; + s4 = (nSamplesInThisIteration * 2) + s4; break; default: if (s4 != 0) { - s4 += nSamplesInThisIteration * 2; + s4 = (nSamplesInThisIteration * 2) + s4; } else { s4 = (s3 + nSamplesInThisIteration) * 2; } break; } - flags = 0; + flags = 0; if (noteFinished) { aClearBuffer(cmd++, 0x1A0 + s4, (samplesLenAdjusted - nAdpcmSamplesProcessed) * 2); - noteSubEu->finished = 1; // sm64 says = 1 + noteSubEu->finished = 1; note->noteSubEu.finished = 1; - + note->noteSubEu.enabled = 0; func_800B6FB4(updateIndex, noteIndex); + break; + } + + if (restart) { + synthesisState->restart = true; + synthesisState->samplePosInt = loopInfo->start; } else { - if (restart) { - synthesisState->restart = true; - synthesisState->samplePosInt = loopInfo->start; - } else { - synthesisState->samplePosInt += nSamplesToProcess; - } + synthesisState->samplePosInt += nSamplesToProcess; } } @@ -572,7 +555,6 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct resampledTempLen + DMEM_ADDR_RESAMPLED); break; } - break; } if (noteSubEu->finished != false) { break; @@ -587,25 +569,20 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct cmd = final_resample(cmd, synthesisState, inBuf * 2, resamplingRateFixedPoint, noteSamplesDmemAddrBeforeResampling, flags); - - if ((noteSubEu->headsetPanRight) || (synthesisState->prevHeadsetPanRight)) { - leftRight = 1; // According to m2c this is a new var. Perhaps flags? - } else if ((noteSubEu->headsetPanLeft) || (synthesisState->prevHeadsetPanLeft)) { + headsetPanRight = noteSubEu->headsetPanRight; + if ((headsetPanRight & 0xFFFF) || synthesisState->prevHeadsetPanRight) { + leftRight = 1; + } else if (noteSubEu->headsetPanLeft || synthesisState->prevHeadsetPanLeft) { leftRight = 2; } else { leftRight = 0; } cmd = func_800B86A0(cmd, noteSubEu, synthesisState, inBuf, 0, leftRight, flags); - if (noteSubEu->usesHeadsetPanEffects) { - // synthesisState->restart = 1; cmd = note_apply_headset_pan_effects(cmd, noteSubEu, synthesisState, inBuf * 2, flags, leftRight); } return cmd; } -#else -GLOBAL_ASM("asm/non_matchings/audio/synthesis/synthesis_process_note.s") -#endif Acmd* load_wave_samples(Acmd* acmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, s32 nSamplesToLoad) { @@ -631,43 +608,37 @@ Acmd* final_resample(Acmd* acmd, struct NoteSynthesisState* synthesisState, s32 return acmd; } -#ifdef NON_MATCHING -// I wish I knew what was up with this function -// It doesn't quite match either the EU or Shindou versions -// of process_envelope. -// What's here appears to have the right "shape" based on -// the M2C output, but beyond that I can't really tell what's -// going on Acmd* func_800B86A0(Acmd* cmd, struct NoteSubEu* note, struct NoteSynthesisState* synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { + UNUSED s32 pad[2]; u16 sourceRight; u16 sourceLeft; u16 targetLeft; u16 targetRight; - s32 rampLeft; - s32 rampRight; - UNUSED s32 sourceReverbVol; - UNUSED s16 rampReverb; - UNUSED s32 reverbVolDiff = 0; + s16 rampLeft; + s16 rampRight; sourceLeft = synthesisState->curVolLeft; sourceRight = synthesisState->curVolRight; - targetLeft = note->targetVolLeft; - targetRight = note->targetVolRight; - targetLeft <<= 4; - targetRight <<= 4; - rampLeft = (targetLeft - sourceLeft) / (nSamples >> 3); - rampRight = (targetRight - sourceRight) / (nSamples >> 3); - synthesisState->curVolLeft = sourceLeft + rampLeft * (nSamples >> 3); - synthesisState->curVolRight = sourceRight + rampRight * (nSamples >> 3); + targetLeft = (note->targetVolLeft) << 4; + targetRight = (note->targetVolRight) << 4; + + rampLeft = ((targetLeft - sourceLeft) / (nSamples >> 3)); + rampRight = ((targetRight - sourceRight) / (nSamples >> 3)); + targetLeft = sourceLeft + rampLeft * (nSamples >> 3); + targetRight = sourceRight + rampRight * (nSamples >> 3); + + synthesisState->curVolLeft = targetLeft; + synthesisState->curVolRight = targetRight; if (note->usesHeadsetPanEffects) { aClearBuffer(cmd++, DMEM_ADDR_NOTE_PAN_TEMP, DEFAULT_LEN_1CH); - aEnvSetup1(cmd++, note->reverbVol, (((sourceLeft & 0xFF) << 8) | (sourceRight & 0xFF)), rampRight, rampLeft); + aEnvSetup1Alt(cmd++, note->reverbVol, sourceLeft, sourceRight, (u32) rampLeft, (u32) rampRight); aEnvSetup2(cmd++, sourceLeft, sourceRight); switch (headsetPanSettings) { + ; case 1: aEnvMixer(cmd++, inBuf, nSamples, 0, note->stereoStrongRight, note->stereoStrongLeft, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH); @@ -682,16 +653,13 @@ Acmd* func_800B86A0(Acmd* cmd, struct NoteSubEu* note, struct NoteSynthesisState break; } } else { - aEnvSetup1(cmd++, note->reverbVol, (((sourceLeft & 0xFF) << 8) | (sourceRight & 0xFF)), rampLeft, rampRight); + aEnvSetup1Alt(cmd++, note->reverbVol, sourceLeft, sourceRight, (u32) rampLeft, (u32) rampRight); aEnvSetup2(cmd++, sourceLeft, sourceRight); aEnvMixer(cmd++, inBuf, nSamples, 0, note->stereoStrongRight, note->stereoStrongLeft, DMEM_ADDR_LEFT_CH, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH); } return cmd; } -#else -GLOBAL_ASM("asm/non_matchings/audio/synthesis/func_800B86A0.s") -#endif Acmd* note_apply_headset_pan_effects(Acmd* acmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* note, s32 bufLen, s32 flags, s32 leftRight) { diff --git a/src/buffers.h b/src/buffers.h index 2d39510146..9d1e62ed5b 100644 --- a/src/buffers.h +++ b/src/buffers.h @@ -22,8 +22,8 @@ typedef struct { } struct_D_802BFB80_4; // size = 0x1000 /* - * In render_player, spawn_players, and staff_ghosts D_802BFB80 is the arraySize8 entry - * But in code_80091750 its the arraySize4 entry + * In render_player, spawn_players, and replays D_802BFB80 is the arraySize8 entry + * But in menu_item its the arraySize4 entry * The only way to unify those 2 things is to use a union */ typedef union { diff --git a/src/buffers/random.c b/src/buffers/random.c index f68724e1f8..cffc8f260c 100644 --- a/src/buffers/random.c +++ b/src/buffers/random.c @@ -1,4 +1,9 @@ #include u16 gRandomSeed16; + +#ifdef VERSION_EU +u8 randomSeedPadding[16]; +#else u8 randomSeedPadding[216]; +#endif diff --git a/src/buffers/trig_tables_bss.c b/src/buffers/trig_tables_bss.c index aa2bc38d14..c98bfabbd6 100644 --- a/src/buffers/trig_tables_bss.c +++ b/src/buffers/trig_tables_bss.c @@ -6,8 +6,4 @@ * See trig_tables.c for the real file. */ -#ifdef VERSION_EU -ALIGNED8 u8 trigTablesPadding[0x5750]; -#else ALIGNED8 u8 trigTablesPadding[0x5810]; -#endif diff --git a/src/camera.c b/src/camera.c index 61ba320f58..914689f95e 100644 --- a/src/camera.c +++ b/src/camera.c @@ -9,14 +9,16 @@ #include "code_800029B0.h" #include "math_util.h" #include "racing/memory.h" -#include "waypoints.h" +#include "path.h" #include "render_player.h" #include "collision.h" #include "code_80057C60.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "main.h" #include "spawn_players.h" +#include + f32 D_800DDB30[] = { 0.4f, 0.6f, 0.275f, 0.3f }; Camera cameras[4]; @@ -183,7 +185,7 @@ void camera_init(f32 posX, f32 posY, f32 posZ, UNUSED s16 rot, u32 arg4, s32 cam } break; } - func_802B7F7C(camera->pos, camera->lookAt, camera->rot); + planar_angles(camera->pos, camera->lookAt, camera->rot); } void func_8001CA10(Camera* camera) { @@ -219,9 +221,9 @@ void func_8001CA78(UNUSED Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32 temp_f18; f32 temp_f16; UNUSED s32 pad; - TrackWaypoint* temp_s2; + TrackPathPoint* temp_s2; - temp_s2 = &D_80164550[0][gWaypointCountByPathIndex[0] - 10]; + temp_s2 = &gTrackPaths[0][gPathCountByPathIndex[0] - 10]; sp68[0] = camera->unk_30[0]; sp68[1] = camera->unk_30[1]; sp68[2] = camera->unk_30[2]; @@ -232,7 +234,7 @@ void func_8001CA78(UNUSED Player* player, Camera* camera, Vec3f arg2, f32* arg3, arg2[1] = camera->lookAt[1]; arg2[2] = camera->lookAt[2]; calculate_orientation_matrix(sp74, 0, 1, 0, -0x00008000); - mtxf_translate_vec3f_mat3(sp5C, sp74); + mtxf_transform_vec3f_mat3(sp5C, sp74); if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) { var_f14 = sp5C[0]; } else { @@ -243,7 +245,7 @@ void func_8001CA78(UNUSED Player* player, Camera* camera, Vec3f arg2, f32* arg3, arg2[0] += (var_f14 - camera->lookAt[0]) * 1; arg2[1] += (temp_f18 - camera->lookAt[1]) * 1; arg2[2] += (temp_f16 - camera->lookAt[2]) * 1; - mtxf_translate_vec3f_mat3(sp68, sp74); + mtxf_transform_vec3f_mat3(sp68, sp74); if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) { var_f14 = sp68[0]; } else { @@ -328,7 +330,7 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a D_80164A78[index] = D_800DDB30[gActiveScreenMode]; } } - if ((player->unk_0CA & 0x100) == 0x100) { + if ((player->lakituProps & WENT_OVER_OOB) == WENT_OVER_OOB) { switch (gActiveScreenMode) { case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: @@ -360,11 +362,11 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[0] = camera->lookAt[0]; arg2[1] = camera->lookAt[1]; arg2[2] = camera->lookAt[2]; - if ((player->effects & 0x01000000) == 0x01000000) { + if ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) { sp84[2] /= 3.0f; } calculate_orientation_matrix(sp9C, 0, 1, 0, arg7); - mtxf_translate_vec3f_mat3(sp84, sp9C); + mtxf_transform_vec3f_mat3(sp84, sp9C); x = player->pos[0] + sp84[0]; z = player->pos[2] + sp84[2]; @@ -373,15 +375,15 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[0] += (x - camera->lookAt[0]) * D_80164A78[index]; arg2[2] += ((z - camera->lookAt[2]) * D_80164A78[index]); - if ((((player->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) { + if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & HOP_EFFECT) == HOP_EFFECT)) { arg2[1] += ((y - camera->lookAt[1]) * 0.02); } else { arg2[1] += ((y - camera->lookAt[1]) * 0.5); } - mtxf_translate_vec3f_mat3(sp90, sp9C); + mtxf_transform_vec3f_mat3(sp90, sp9C); x = player->pos[0] + sp90[0]; z = player->pos[2] + sp90[2]; - if ((player->effects & 0x01000000) != 0x01000000) { + if ((player->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT) { var_f0 = player->pos[1] + sp90[1]; // permute y = var_f0; @@ -392,13 +394,13 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a *arg3 = camera->pos[0] + ((x - camera->pos[0]) * D_80164A78[index]); *arg5 = camera->pos[2] + ((z - camera->pos[2]) * D_80164A78[index]); - if ((((player->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) { + if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & HOP_EFFECT) == HOP_EFFECT)) { *arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01)); } else { *arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15)); } - if ((player->unk_0DE & 1) != 0) { + if ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) != 0) { *arg4 = D_801652A0[index]; } } @@ -432,18 +434,18 @@ void func_8001D53C(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[1] = camera->lookAt[1]; arg2[2] = camera->lookAt[2]; calculate_orientation_matrix(sp74, 0.0f, 1.0f, 0.0f, arg6); - mtxf_translate_vec3f_mat3(sp5C, sp74); + mtxf_transform_vec3f_mat3(sp5C, sp74); stackPadding0 = player->pos[0] + sp5C[0]; stackPadding2 = player->pos[2] + sp5C[2]; stackPadding1 = player->pos[1] + sp5C[1]; arg2[0] += (stackPadding0 - camera->lookAt[0]) * 1; arg2[2] += (stackPadding2 - camera->lookAt[2]) * 1; arg2[1] += (stackPadding1 - camera->lookAt[1]) * 1; - mtxf_translate_vec3f_mat3(sp68, sp74); + mtxf_transform_vec3f_mat3(sp68, sp74); stackPadding0 = player->pos[0] + sp68[0]; stackPadding2 = player->pos[2] + sp68[2]; stackPadding1 = sp68[1] + (player->unk_074 + 1.5); - if ((player->unk_0CA & 1) == 1) { + if ((player->lakituProps & LAKITU_RETRIEVAL) == LAKITU_RETRIEVAL) { stackPadding1 = sp68[1] + (thing + 10.0f); } *arg3 = stackPadding0; @@ -475,7 +477,7 @@ void func_8001D794(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[2] = camera->lookAt[2]; calculate_orientation_matrix(sp6C, 0, 1, 0, arg6); - mtxf_translate_vec3f_mat3(sp54, sp6C); + mtxf_transform_vec3f_mat3(sp54, sp6C); test1 = player->pos[0] + sp54[0]; test3 = player->pos[2] + sp54[2]; @@ -484,7 +486,7 @@ void func_8001D794(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[1] += (test2 - camera->lookAt[1]) * 1; arg2[2] += (test3 - camera->lookAt[2]) * 1; - mtxf_translate_vec3f_mat3(sp60, sp6C); + mtxf_transform_vec3f_mat3(sp60, sp6C); test1 = player->pos[0] + sp60[0]; test3 = player->pos[2] + sp60[2]; @@ -562,7 +564,7 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a D_80164A78[index] = D_800DDB30[gActiveScreenMode]; } } - if ((player->unk_0CA & 0x100) == 0x100) { + if ((player->lakituProps & WENT_OVER_OOB) == WENT_OVER_OOB) { move_f32_towards(&D_80164A90[index], 15, 0.02f); move_f32_towards(&D_80164AA0[index], 20, 0.02f); @@ -580,11 +582,11 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[0] = camera->lookAt[0]; arg2[1] = camera->lookAt[1]; arg2[2] = camera->lookAt[2]; - if ((player->effects & 0x01000000) == 0x01000000) { + if ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) { sp84[2] /= 3.0f; } calculate_orientation_matrix(sp9C, 0, 1, 0, arg7); - mtxf_translate_vec3f_mat3(sp84, sp9C); + mtxf_transform_vec3f_mat3(sp84, sp9C); x = player->pos[0] + sp84[0]; z = player->pos[2] + sp84[2]; @@ -593,15 +595,15 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a arg2[0] += (x - camera->lookAt[0]) * D_80164A78[index]; arg2[2] += ((z - camera->lookAt[2]) * D_80164A78[index]); - if ((((player->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) { + if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & HOP_EFFECT) == HOP_EFFECT)) { arg2[1] += ((y - camera->lookAt[1]) * 0.02); } else { arg2[1] += ((y - camera->lookAt[1]) * 0.5); } - mtxf_translate_vec3f_mat3(sp90, sp9C); + mtxf_transform_vec3f_mat3(sp90, sp9C); x = player->pos[0] + sp90[0]; z = player->pos[2] + sp90[2]; - if ((player->effects & 0x01000000) != 0x01000000) { + if ((player->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT) { var_f0 = player->pos[1] + sp90[1]; // permute y = var_f0; @@ -612,13 +614,13 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a *arg3 = camera->pos[0] + ((x - camera->pos[0]) * D_80164A78[index]); *arg5 = camera->pos[2] + ((z - camera->pos[2]) * D_80164A78[index]); - if ((((player->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) { + if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & HOP_EFFECT) == HOP_EFFECT)) { *arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01)); } else { *arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15)); } - if ((player->unk_0DE & 1) != 0) { + if ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) != 0) { *arg4 = D_801652A0[index]; } } @@ -702,21 +704,21 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) { UNUSED s16 pad6; s16 temp; - if ((player->effects & 0x10) == 0x10) { + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { var_a3 = 100; if (player->unk_078 == 0) { camera->unk_B0 = 0; } else { if (player->unk_078 < 0) { var_a3 = 0xA5 - (player->unk_078 / 2); - if ((player->effects & 0x20000000) == 0x20000000) { + if ((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) { move_s16_towards(&camera->unk_B0, -0x0B60, 0.1f); } else { move_s16_towards(&camera->unk_B0, -0x0888, 0.1f); } } else { var_a3 = (player->unk_078 / 2) + 0xA5; - if ((player->effects & 0x20000000) == 0x20000000) { + if ((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) { move_s16_towards(&camera->unk_B0, 0x0B60, 0.1f); } else { move_s16_towards(&camera->unk_B0, 0x0888, 0.1f); @@ -727,7 +729,7 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) { move_s16_towards(&camera->unk_B0, 0, 0.05f); var_a3 = ((s16) camera->unk_2C / 182) - ((s16) player->rotation[1] / 182); if (player->unk_078 == 0) { - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { var_a3 = 0x02D8; } else { var_a3 = 0x01F4; @@ -744,11 +746,14 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) { var_a3 = (player->unk_078 / 2) + 0xA5; } } - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x4000) == 0x4000) || ((player->effects & 0x80000) == 0x80000) || - ((player->effects & 0x800000) == 0x800000) || (((player->effects & 0x20) == 0x20) && (player->unk_078 != 0)) || + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + (((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) && (player->unk_078 != 0)) || (player->collision.surfaceDistance[0] <= 0.0f) || (player->collision.surfaceDistance[1] <= 0.0f) || - ((player->effects & 0x20000) == 0x20000)) { + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT)) { func_8001CCEC(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2); } else { adjust_angle(&camera->unk_2C, (s16) (player->rotation[1] + camera->unk_B0), var_a3); @@ -824,7 +829,7 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) { UNUSED s16 pad6; s16 temp; - if ((player->effects & 0x10) == 0x10) { + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { var_a3 = 100; if (player->unk_078 == 0) { camera->unk_B0 = 0; @@ -832,14 +837,14 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) { if (player->unk_078 < 0) { var_a3 = 0xA5 - (player->unk_078 / 2); - if ((player->effects & 0x20000000) == 0x20000000) { + if ((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) { move_s16_towards(&camera->unk_B0, -0x0B60, 0.1f); } else { move_s16_towards(&camera->unk_B0, -0x0888, 0.1f); } } else { var_a3 = (player->unk_078 / 2) + 0xA5; - if ((player->effects & 0x20000000) == 0x20000000) { + if ((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) { move_s16_towards(&camera->unk_B0, 0x0B60, 0.1f); } else { move_s16_towards(&camera->unk_B0, 0x0888, 0.1f); @@ -850,7 +855,7 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) { move_s16_towards(&camera->unk_B0, 0, 0.05f); var_a3 = ((s16) camera->unk_2C / 182) - ((s16) player->rotation[1] / 182); if (player->unk_078 == 0) { - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { var_a3 = 0x02D8; } else { var_a3 = 0x01F4; @@ -867,11 +872,14 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) { var_a3 = (player->unk_078 / 2) + 0xA5; } } - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x4000) == 0x4000) || ((player->effects & 0x80000) == 0x80000) || - ((player->effects & 0x800000) == 0x800000) || (((player->effects & 0x20) == 0x20) && (player->unk_078 != 0)) || + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + (((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) && (player->unk_078 != 0)) || (player->collision.surfaceDistance[0] <= 0.0f) || (player->collision.surfaceDistance[1] <= 0.0f) || - ((player->effects & 0x20000) == 0x20000)) { + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT)) { func_8001D944(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2); } else { adjust_angle(&camera->unk_2C, (s16) (player->rotation[1] + camera->unk_B0), var_a3); @@ -980,7 +988,8 @@ void func_8001EE98(Player* player, Camera* camera, s8 index) { func_8001A588(&D_80152300[cameraIndex], camera, player, index, cameraIndex); break; case 1: - if (((player->unk_0CA & 1) == 1) || ((player->unk_0CA & 2) == 2)) { + if (((player->lakituProps & LAKITU_RETRIEVAL) == LAKITU_RETRIEVAL) || + ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU)) { func_8001E8E8(camera, player, index); break; } @@ -991,7 +1000,8 @@ void func_8001EE98(Player* player, Camera* camera, s8 index) { func_8001F87C(cameraIndex); break; case 9: - if (((player->unk_0CA & 1) == 1) || ((player->unk_0CA & 2) == 2)) { + if (((player->lakituProps & LAKITU_RETRIEVAL) == LAKITU_RETRIEVAL) || + ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU)) { func_8001E8E8(camera, player, index); break; } @@ -1022,26 +1032,27 @@ void func_8001F394(Player* player, f32* arg1) { } if (D_80164A08[playerIndex] == 0) { - if (player->soundEffects & HOLD_BANANA_SOUND_EFFECT) { + if (player->triggers & DRAG_ITEM_EFFECT) { D_80164A08[playerIndex] = 1; } - if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) { + if ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) { D_80164A08[playerIndex] = 2; } if ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) { D_80164A08[playerIndex] = 3; } - if ((player->soundEffects & 0x100) == 0x100) { + if ((player->triggers & THWOMP_SQUISH_TRIGGER) == THWOMP_SQUISH_TRIGGER) { D_80164A08[playerIndex] = 4; } - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) { + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) { D_80164A08[playerIndex] = 5; } D_80164498[playerIndex] = 0.0f; } switch (D_80164A08[playerIndex]) { case 1: - if (player->soundEffects & HOLD_BANANA_SOUND_EFFECT) { + if (player->triggers & DRAG_ITEM_EFFECT) { move_f32_towards(&D_80164498[playerIndex], 20.0f, 0.2f); } else { if (D_80164498[playerIndex] > 1.0f) { @@ -1053,7 +1064,7 @@ void func_8001F394(Player* player, f32* arg1) { } break; case 2: - if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) { + if ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) { if (player->boostTimer != 0) { move_f32_towards(&D_80164498[playerIndex], 8.0f, 0.2f); } @@ -1068,7 +1079,7 @@ void func_8001F394(Player* player, f32* arg1) { break; case 3: if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) && - ((player->effects & 8) == 8)) { + ((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT)) { move_f32_towards(&D_80164498[playerIndex], 20.0f, 0.1f); } else { if (D_80164498[playerIndex] > 1.0f) { @@ -1080,7 +1091,7 @@ void func_8001F394(Player* player, f32* arg1) { } break; case 4: - if ((player->soundEffects & 0x100) == 0x100) { + if ((player->triggers & THWOMP_SQUISH_TRIGGER) == THWOMP_SQUISH_TRIGGER) { move_f32_towards(&D_80164498[playerIndex], 25.0f, 1.0f); } else { if (D_80164498[playerIndex] > 1.0f) { @@ -1092,7 +1103,8 @@ void func_8001F394(Player* player, f32* arg1) { } break; case 5: - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) { + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) { move_f32_towards(&D_80164498[playerIndex], 18.0f, 0.2f); } else { if (D_80164498[playerIndex] > 1.0f) { @@ -1140,7 +1152,8 @@ void func_8001F87C(s32 cameraId) { if (gActiveScreenMode == SCREEN_MODE_1P) { if (gModeSelection == GRAND_PRIX) { for (playerIndex = 0; playerIndex < NUM_PLAYERS; playerIndex++) { - if ((gPlayerOne[playerIndex].type & 0x200) || (gPlayerOne[playerIndex].type & 0x80)) { + if ((gPlayerOne[playerIndex].type & PLAYER_STAGING) || + (gPlayerOne[playerIndex].type & PLAYER_UNKNOWN_0x80)) { break; } if (playerIndex == 7) { diff --git a/src/code_800029B0.c b/src/code_800029B0.c index 53072f0f1b..a351de8ece 100644 --- a/src/code_800029B0.c +++ b/src/code_800029B0.c @@ -4,7 +4,7 @@ #include "code_800029B0.h" #include "memory.h" -#include "waypoints.h" +#include "path.h" #include "actors.h" #include "actor_types.h" #include "math_util.h" @@ -12,11 +12,11 @@ #include #include "collision.h" #include "memory.h" -#include "code_80091750.h" +#include "menu_items.h" #include "skybox_and_splitscreen.h" #include "code_8006E9C0.h" #include "spawn_players.h" -#include "staff_ghosts.h" +#include "replays.h" #include "render_courses.h" #include "main.h" #include "courses/all_course_data.h" @@ -24,9 +24,11 @@ #include "menus.h" #include "data/other_textures.h" -extern s32 D_802BA038; +extern s32 gDemoTimer; extern s16 D_802BA048; +#if !ENABLE_CUSTOM_COURSE_ENGINE s16 gCurrentCourseId = 0; +#endif s16 gCurrentlyLoadedCourseId = 0xFF; u16 D_800DC5A8 = 0; s32 D_800DC5AC = 0; @@ -193,7 +195,7 @@ void setup_race(void) { gCurrentlyLoadedCourseId = gCurrentCourseId; gNextFreeMemoryAddress = gFreeMemoryResetAnchor; load_course(gCurrentCourseId); - func_80295D88(); + course_generate_collision_mesh(); D_8015F730 = gNextFreeMemoryAddress; } else { gNextFreeMemoryAddress = D_8015F730; @@ -206,23 +208,22 @@ void setup_race(void) { gNumSpawnedShells = 0; D_800DC5B8 = 0; D_80152308 = 0; - D_802BA038 = -1; + gDemoTimer = -1; D_802BA048 = 0; func_802A74BC(); - func_802A4D18(); + set_perspective_and_aspect_ratio(); func_80091FA4(); init_actors_and_load_textures(); if (gModeSelection != BATTLE) { - D_8015F8D0[1] = (f32) (D_80164490->posY - 15); - ; - D_8015F8D0[2] = D_80164490->posZ; + D_8015F8D0[1] = (f32) (gCurrentTrackPath->posY - 15); + D_8015F8D0[2] = gCurrentTrackPath->posZ; if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) { - D_8015F8D0[0] = (gIsMirrorMode != 0) ? D_80164490->posX + 138.0f : D_80164490->posX - 138.0f; + D_8015F8D0[0] = (gIsMirrorMode != 0) ? gCurrentTrackPath->posX + 138.0f : gCurrentTrackPath->posX - 138.0f; } else if (gCurrentCourseId == COURSE_WARIO_STADIUM) { - D_8015F8D0[0] = (gIsMirrorMode != 0) ? D_80164490->posX + 12.0f : D_80164490->posX - 12.0f; + D_8015F8D0[0] = (gIsMirrorMode != 0) ? gCurrentTrackPath->posX + 12.0f : gCurrentTrackPath->posX - 12.0f; } else { - D_8015F8D0[0] = D_80164490->posX; + D_8015F8D0[0] = gCurrentTrackPath->posX; } } if (!gDemoMode) { @@ -241,7 +242,9 @@ void setup_race(void) { } } +// sound related void func_80002DAC(void) { +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: vec3f_set(D_8015F748, -223.0f, 94.0f, -155.0f); @@ -276,6 +279,9 @@ void func_80002DAC(void) { default: break; } +#else + +#endif } /** @@ -300,8 +306,16 @@ void func_80003040(void) { gCourseDirection = 1.0f; gPlayerCountSelection1 = 1; - set_segment_base_addr(0x3, (void*) (gNextFreeMemoryAddress + 0xFFFF7000)); + + //! @warning Grand Prix loads some textures that credits does not + // Therefore, this calculation allows future texture allocations to skip 0x9000 + // this allows hard-coded data addresses to sync with memory data. + // In other words, the first texture in segment 3 for credits should start at 0x9000 + // This is only required for moo moo farm. + // This is also bad memory management practice as this could result in overwriting the wrong memory. + set_segment_base_addr(0x3, (void*) (gNextFreeMemoryAddress - 0x9000)); destroy_all_actors(); +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: dma_textures(gTextureTrees1, 0x35B, 0x800); @@ -313,7 +327,7 @@ void func_80003040(void) { break; case COURSE_BANSHEE_BOARDWALK: // d_course_banshee_boardwalk_packed_dl_878 - find_vtx_and_set_colours(0x07000878, -0x80, 0, 0, 0); + find_vtx_and_set_colours(0x07000878, 128, 0, 0, 0); break; case COURSE_YOSHI_VALLEY: vec3f_set(position, -2300.0f, 0.0f, 634.0f); @@ -337,17 +351,17 @@ void func_80003040(void) { break; case COURSE_SHERBET_LAND: // d_course_sherbet_land_packed_dl_1EB8 - find_vtx_and_set_colours(0x07001EB8, -0x4C, 0xFF, 0xFF, 0xFF); + find_vtx_and_set_colours(0x07001EB8, 180, 0xFF, 0xFF, 0xFF); // d_course_sherbet_land_packed_dl_2308 - find_vtx_and_set_colours(0x07002308, -0x6A, 0xFF, 0xFF, 0xFF); + find_vtx_and_set_colours(0x07002308, 150, 0xFF, 0xFF, 0xFF); break; case COURSE_RAINBOW_ROAD: // d_course_rainbow_road_packed_dl_2068 - find_vtx_and_set_colours(0x07002068, -0x6A, 0xFF, 0xFF, 0xFF); + find_vtx_and_set_colours(0x07002068, 150, 0xFF, 0xFF, 0xFF); // d_course_rainbow_road_packed_dl_1E18 - find_vtx_and_set_colours(0x07001E18, -0x6A, 0xFF, 0xFF, 0xFF); + find_vtx_and_set_colours(0x07001E18, 150, 0xFF, 0xFF, 0xFF); // d_course_rainbow_road_packed_dl_1318 - find_vtx_and_set_colours(0x07001318, -1, 0xFF, 0xFF, 0); + find_vtx_and_set_colours(0x07001318, 255, 0xFF, 0xFF, 0); break; case COURSE_WARIO_STADIUM: vec3f_set(position, -131.0f, 83.0f, 286.0f); @@ -380,5 +394,8 @@ void func_80003040(void) { default: break; } +#else + +#endif gNumPermanentActors = gNumActors; } diff --git a/src/code_800029B0.h b/src/code_800029B0.h index e5614c9f3f..0b7335383a 100644 --- a/src/code_800029B0.h +++ b/src/code_800029B0.h @@ -34,7 +34,6 @@ void func_80002DAC(void); void clear_nmi_buffer(void); void func_80003040(void); -extern s16 gCurrentCourseId; // D_800DC5A0 extern s16 gCurrentlyLoadedCourseId; extern u16 D_800DC5A8; extern s32 D_800DC5AC; diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c deleted file mode 100644 index 4536b944b3..0000000000 --- a/src/code_80005FD0.c +++ /dev/null @@ -1,7747 +0,0 @@ -#include -#include -#include - -#include "code_80005FD0.h" -#include "math_util.h" -#include "code_800029B0.h" -#include "racing/memory.h" -#include "waypoints.h" -#include "camera.h" -#include "actors.h" -#include "actors_extended.h" -#include "render_player.h" -#include "player_controller.h" -#include "update_objects.h" -#include "collision.h" -#include -#include "vehicles.h" -#include "render_objects.h" -#include "code_80057C60.h" -#include "bomb_kart.h" -#include "courses/all_course_data.h" -#include -#include -#include "main.h" -#include "menus.h" -#include "code_80091750.h" -#include "audio/external.h" -#include "ending/podium_ceremony_actors.h" -#include "spawn_players.h" -#include "sounds.h" -#include "data/path_spawn_metadata.h" - -s32 unk_code_80005FD0_pad[24]; -Collision D_80162E70; -s16 D_80162EB0; // Possibly a float. -s16 D_80162EB2; // possibly [3] - -KartAIBehaviour* gCoursesKartAIBehaviour[NUM_COURSES - 1]; - -// more padding? -s32 D_80162F08[2]; - -s16 D_80162F10[30]; -s16 D_80162F50[30]; - -// padding, seemingly? -s32 D_80162F90[4]; - -Vec3f D_80162FA0; -Vec3f D_80162FB0; -Vec3f D_80162FC0; -s16 gTrainSmokeTimer; -s16 sSomeNearestWaypoint; -s16 D_80162FD0; -f32 gCourseCompletionPercentByRank[NUM_PLAYERS]; -/* -The size of many of these arrays is weird. Based on their usage, they would only need -to be 8 entries long (enough for each player). But some are 10 or even 12 long. -Its plausible that this is just some decompilation artifact? -Or maybe at some point in development they had plans for more players? -*/ -s16 D_80162FF8[12]; -s16 D_80163010[12]; -f32 D_80163028[10]; -s16 D_80163050[12]; -f32 D_80163068[10]; -f32 D_80163090[10]; -s32 D_801630B8[10]; -u16 D_801630E0; -s16 D_801630E2; -s16 D_801630E8[10]; -s16 gFerrySmokeTimer; -s32 D_80163100[10]; -s32 D_80163128[10]; -s32 D_80163150[10]; -f32 D_80163178[10]; -f32 D_801631A0[10]; -s16 D_801631C8; -s32 D_801631CC; -TrackWaypoint* D_801631D0; -TrackWaypoint* D_801631D4; -s16* D_801631D8; -s16* D_801631DC; -u16 D_801631E0[12]; -u16 D_801631F8[10]; -f32 D_8016320C; -f32 D_80163210[10]; -s32 D_80163238; -u16 D_80163240[12]; -u16 D_80163258[12]; -u16 D_80163270[12]; -s32 D_80163288[10]; -KartAIBehaviour* sCurrentKartAIBehaviour; -u16 gCurrentKartAIBehaviourId[12]; -u16 gPreviousKartAIBehaviourId[12]; -u16 gKartAIBehaviourState[12]; -s16 D_80163300[12]; -u16 D_80163318[12]; -u16 D_80163330[10]; -u16 D_80163344[2]; -u16 D_80163348[2]; -u16 D_8016334C[2]; -u16 gSpeedKartAIBehaviour[12]; -s32 D_80163368[4]; -s32 D_80163378; -s32 D_8016337C; -s16 D_80163380[12]; -s16 D_80163398[12]; -s16 D_801633B0[12]; -s16 D_801633C8[12]; -s16 D_801633E0[12]; -s16 D_801633F8[12]; -s16 D_80163410[4]; -f32 D_80163418[4]; -f32 D_80163428[4]; -f32 D_80163438[4]; -s32 D_80163448; -f32 D_8016344C; -f32 D_80163450[10]; -s16 D_80163478; -s16 D_8016347A; -s16 D_8016347C; -s16 D_8016347E; -s32 D_80163480; -s32 D_80163484; -s32 D_80163488; -s16 D_8016348C; -s16 D_80163490[12]; -s16 D_801634A8[12]; -s16 D_801634C0[12]; -s16 bStopAICrossing[10]; -s16 D_801634EC; -s32 D_801634F0; -s32 D_801634F4; -Test D_801634F8[10]; -Path2D* gVehicle2DWaypoint; -s32 gVehicle2DWaypointLength; -TrainStuff gTrainList[NUM_TRAINS]; -u16 isCrossingTriggeredByIndex[NUM_CROSSINGS]; -u16 sCrossingActiveTimer[NUM_CROSSINGS]; -PaddleBoatStuff gPaddleBoats[NUM_PADDLE_BOATS]; -VehicleStuff gBoxTruckList[NUM_RACE_BOX_TRUCKS]; -VehicleStuff gSchoolBusList[NUM_RACE_SCHOOL_BUSES]; -VehicleStuff gTankerTruckList[NUM_RACE_TANKER_TRUCKS]; -VehicleStuff gCarList[NUM_RACE_CARS]; -s32 D_80163DD8[4]; -BombKart gBombKarts[NUM_BOMB_KARTS_MAX]; -Collision D_80164038[NUM_BOMB_KARTS_MAX]; -struct unexpiredActors gUnexpiredActorsList[8]; -D_801642D8_entry D_801642D8[8]; -s16 D_80164358; -s16 D_8016435A; -s16 D_8016435C; -s16 gGPCurrentRacePlayerIdByRank[12]; // D_80164360 -s16 D_80164378[12]; -s32 gLapCountByPlayerId[10]; // D_80164390 -s32 gGPCurrentRaceRankByPlayerId[10]; // D_801643B8 -s32 D_801643E0[10]; -s32 D_80164408[10]; -u16 D_80164430; -u16 gNearestWaypointByPlayerId[12]; -s32 D_80164450[10]; -s16 D_80164478[10]; -s32 D_8016448C; -TrackWaypoint* D_80164490; -f32 D_80164498[4]; -f32 gLapCompletionPercentByPlayerId[10]; // D_801644A8 -f32 gCourseCompletionPercentByPlayerId[10]; // D_801644D0 -s16 D_801644F8[12]; -f32 D_80164510[10]; -s16 D_80164538[12]; -TrackWaypoint* D_80164550[4]; -TrackWaypoint* D_80164560[4]; -TrackWaypoint* D_80164570[4]; -s16* D_80164580[4]; -s16* D_80164590[4]; -s16* D_801645A0[4]; -u16 gPathIndexByPlayerId[12]; // D_801645B0 -u16 gWaypointCountByPathIndex[4]; // D_801645C8 -s32 D_801645D0[4]; -s16* D_801645E0; -s32 D_801645E8[4]; -f32 D_801645F8[4]; -s32 D_80164608[4]; -f32 D_80164618[4]; -s32 D_80164628[4]; -f32 D_80164638[4]; -f32 D_80164648[4]; -f32 D_80164658[4]; -s16 gNearestWaypointByCameraId[4]; -s16 D_80164670[4]; -s16 D_80164678[4]; -s16 D_80164680[4]; -f32 D_80164688[4]; -f32 D_80164698; -f32 D_8016469C; -f32 D_801646A0; -// start padding -s32 D_801646A4; -s32 D_801646A8; -s32 D_801646AC; -s32 D_801646B0; -s32 D_801646B4; -s32 D_801646B8; -s32 D_801646BC; -// end padding -s16 D_801646C0[4]; -u32 D_801646C8; -u16 D_801646CC; -UnkStruct_46D0 D_801646D0[4]; - -// Strings, presented by google translate! -// Note that these are EUC-JP encoded, see: -// https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP - -// Force sort immediately after goal -char* D_800EB710 = "ゴール直後の強制ソート\n"; -// Forced sort immediately after one goal in 2PGP -char* D_800EB728 = "2PGPで片方がゴール直後の強制ソート\n"; -// rank calculation error -char* D_800EB74C = "順位計算エラー!! (num %d) (rank %d) (e_rank %d)\n"; -// Bypass switching error!!!(num %d org_bipas %d bipas %d) -char* D_800EB780 = "バイパス切り替え エラー!!!(num %d org_bipas %d bipas %d)\n"; -char* D_800EB7BC = "(%d) rap %3d rate_count_F %10.2f rap_count_F %10.2f area %5d \n"; -// Enter the maze! enemy %d (%d --> %d) -char* D_800EB800 = "迷路に突入! enemy %d (%d --> %d)\n"; -// Out of the maze! enemy %d (%d --> %d) -char* D_800EB824 = "迷路から出た! enemy %d (%d --> %d)\n"; -char* D_800EB84C = "enemy voice set (%d slip_flag %x weapon %x)\n"; -// Spin Voice! ! (%d , name %d) -char* D_800EB87C = "スピンヴォイス!!(%d , name %d)\n"; -// Damage voice! ! (%d, name %d) -char* D_800EB8A0 = "ダメージヴォイス!!(%d, name %d)\n"; -char* D_800EB8C4 = "===== ENEMY DRIVE SUB (%d) =====\n"; -// omission -char* D_800EB8E8 = "ENEMY END(手抜き)\n\n"; -char* D_800EB8FC = "ENEMY END(手抜き)\n\n"; -char* D_800EB910 = "(1)enemy stick angle over!! (%d)\n"; -char* D_800EB934 = "ENEMY END\n\n"; -char* D_800EB940 = "(2)enemy stick angle over!! (%d)\n"; -char* D_800EB964 = "ENEMY END\n\n"; -// AREA ERR!!! (group not registered at current centerline %d) %d -char* D_800EB970 = "AREA ERR!!! (現在のセンターライン %d に未登録のグループです) %d\n"; -// AREA ERR!!! (Unregistered group) %d -char* D_800EB9B4 = "AREA ERR!!! (未登録のグループです) %d\n"; -// get_oga_area_sub_BP() ... Area not found! (b_num = %d) -char* D_800EB9DC = "get_oga_area_sub_BP() ... エリアが見つからないッス! (b_num = %d)\n"; -// Status: (%d, %d, %d) -char* D_800EBA20 = " 状況: (%d, %d, %d) \n"; -char* D_800EBA38 = "<%d> (%d, %d, %d) [%d] lng %f\n"; -// Wario Stadium Jump failed! ! ! (area %d, y %7.2f) -char* D_800EBA58 = "ワリオスタジアム ジャンプ失敗!!! (area %d, y %7.2f)\n"; -// I fell in the water! ! Forced to centerline (num %d: area %d ) (%d,%d,%d) -char* D_800EBA94 = "水に落ちた!! センターラインに強制移動しました (num %d: area %d ) (%d,%d,%d)\n"; -// Course match! ! (Slacking: with bump) Forced move to center line (num %d: area %d ==>%d) (group %d) (%d,%d,%d) -char* D_800EBAE4 = "こーすあうと!!(手抜き中:バンプ有り) センターラインに強制移動しました (num %d: area %d ==>%d) " - "(group %d) (%d,%d,%d)\n"; -// Course match! ! (Sitting corners: no bump) Forced move to center line (num %d: area %d ==>%d) (group %d) (%d,%d,%d) -char* D_800EBB60 = "こーすあうと!!(手抜き中:バンプ無し) センターラインに強制移動しました (num %d: area %d ==>%d) " - "(group %d) (%d,%d,%d)\n"; -// Course match! ! ! Recalculated area (num %d: area %d ==>%d) -char* D_800EBBDC = "こーすあうと!!! エリアを再計算しました (num %d: area %d ==>%d)\n"; -// Direct BOM(%d) (%7.2f, %7.2f, %7.2f) -char* D_800EBC24 = "直接指定のBOM(%d) (%7.2f, %7.2f, %7.2f) \n"; -char* D_800EBC50 = "BOM HIT CHECK\n"; -char* D_800EBC60 = "BOM HIT !!!!! (%d)\n"; -// BOM standby -char* D_800EBC74 = "BOM待機\n"; -char* D_800EBC80 = "RESULT BOM area(%d)\n"; -// BOM dropped. -char* D_800EBC98 = "BOM が 落ちました。\n"; -// Tortoise fire pillar SET failed (TABLE IS FULL) -char* D_800EBCB0 = "カメ用火柱 SET 失敗 (TABLE IS FULL)\n"; -// Red turtle fire pillar set error! (category %d) -char* D_800EBCD8 = "赤ガメ火柱セットエラー! (category %d)\n"; -// Blue turtle fire pillar set error! (category %d) -char* D_800EBD00 = "青ガメ火柱セットエラー! (category %d)\n"; -// Thorn Turtle Fire Pillar Set Error! (category %d) -char* D_800EBD28 = "トゲガメ火柱セットエラー! (category %d)\n"; -// Turtle Fire Pillar Initialization! ! -char* D_800EBD54 = "カメ火柱初期化!!\n"; -// Center line initialization -char* D_800EBD68 = "センターライン初期化\n"; -char* D_800EBD80 = "MAP NUMBER %d\n"; -char* D_800EBD90 = "center_EX ptr = %x %x (%x)\n"; -char* D_800EBDB4 = "\n"; -char* D_800EBDB8 = "center_BP[%d] ptr = %x %x (%x)\n"; -char* D_800EBDE0 = "side_point_L_BP[%d] ptr = %x %x (%x)\n"; -char* D_800EBE08 = "side_point_R_BP[%d] ptr = %x %x (%x)\n"; -char* D_800EBE30 = "curve_BP[%d] ptr = %x %x (%x)\n"; -char* D_800EBE58 = "angle_BP[%d] ptr = %x %x (%x)\n"; -char* D_800EBE80 = "short_cut_data_BP[%d] ptr = %x %x (%x)\n"; -char* D_800EBEA8 = "\n"; -// Ogawa total memory used = %d -char* D_800EBEAC = "小川の使用メモリー合計 = %d\n"; -// Enemy initialization -char* D_800EBECC = "敵初期化\n"; -// End of enemy initialization -char* D_800EBED8 = "敵初期化終了\n"; -// Bypass CENTER LINE Split start -char* D_800EBEE8 = "バイパス CENTER LINE 分割開始\n"; -// Read centerline from ROM (map:%d) -char* D_800EBF08 = "センターラインをROMから読みます (map:%d)\n"; -char* D_800EBF34 = "ROM center (BP%d) line adr. = %x (%x)\n"; -// Calculate centerline (map:%d) -char* D_800EBF5C = "センターラインを計算します (map:%d)\n"; -char* D_800EBF84 = "center (BP%d) line adr. = %x (%x)\n"; -char* D_800EBFA8 = "BP center_point_number : %d\n"; -// Centerline data error! ! -char* D_800EBFC8 = "センターライン データ エラー!!\n"; -// Bypass CENTER LINE split end (%d -> %d number) -char* D_800EBFEC = "バイパス CENTER LINE 分割終了 (%d -> %d 個)\n"; -// No center line. (map: %d) -char* D_800EC01C = "センターラインが ありません。(map:%d)\n"; -// side point calculation (bypass %d) -char* D_800EC044 = "サイドポイント計算 (バイパス %d)\n"; -// Curve data calculation (bypass %d) -char* D_800EC068 = "カーブデータ計算 (バイパス %d)\n"; -// No center line. (map: %d) -char* D_800EC088 = "センターラインが ありません。(map:%d)\n"; -// Angle data calculation (bypass %d) -char* D_800EC0B0 = "アングルデータ計算 (バイパス %d) \n"; -// No center line. (map: %d) -char* D_800EC0D4 = "センターラインが ありません。(map:%d)\n"; -// Shortcut data calculation (bypass %d) -char* D_800EC0FC = "ショートカットデータ計算 (バイパス %d)\n"; -char* D_800EC124 = "extern POINT rom_center_KT%d_BP%d[] = {\n"; -char* D_800EC150 = "\t{%d,%d,%d,%d},\n"; -char* D_800EC164 = "\t0x8000,0x8000,0x8000,0\n};\n\n"; -char* D_800EC184 = "area read from ROM (%d)\n"; -// Normal jump! ! ! (%d) -char* D_800EC1A0 = "ノーマルジャンプ!!!(%d)\n"; -// Turbo on! ! ! (%d) -char* D_800EC1BC = "ターボオン!!!(%d)\n"; -// No cutting corners! ! ! (%d) -char* D_800EC1D4 = "手抜き禁止!!!(%d)\n"; -// Action start data error! (num %d, act %d) -char* D_800EC1EC = "アクション開始データエラー!(num %d, act %d)\n"; -// Action end data error! (num %d, act %d, old_act_num %d) -char* D_800EC21C = "アクション終了データエラー!(num %d, act %d, old_act_num %d)\n"; -char* D_800EC25C = "SL : center_point_number : %d\n"; -// SL: CENTER LINE split start -char* D_800EC27C = "SL: CENTER LINE 分割開始\n"; -// SL: CENTER LINE split ended (%d -> %d indivual) -char* D_800EC298 = "SL: CENTER LINE 分割終了 (%d -> %d 個)\n"; -char* D_800EC2C0 = "SHIP : center_point_number : %d\n"; -// SHIP: CENTER LINE split start -char* D_800EC2E4 = "SHIP: CENTER LINE 分割開始\n"; -// SHIP: CENTER LINE split ended (%d -> %d indivual) -char* D_800EC300 = "SHIP: CENTER LINE 分割終了 (%d -> %d 個)\n"; -// General-purpose OBJ character initialization -char* D_800EC32C = "汎用OBJキャラ初期化\n"; -// SL OBJ settings -char* D_800EC344 = "SL OBJ設定\n"; -// SHIP OBJ settings -char* D_800EC350 = "SHIP OBJ設定\n"; -// Track OBJ settings -char* D_800EC360 = "トラックOBJ設定\n"; -// Bus OBJ setting -char* D_800EC374 = "バスOBJ設定\n"; -// Tank OBJ setting -char* D_800EC384 = "タンクOBJ設定\n"; -// RV OBJ settings -char* D_800EC394 = "RV OBJ設定\n"; -// Generic OBJ character initialization completed -char* D_800EC3A0 = "汎用OBJキャラ初期化終了\n"; -// horn (num %d, permit %d, %d) -char* D_800EC3BC = "クラクション (num %d, permit %d, %d)\n"; -char* D_800EC3E4 = "OGA CAMERA INIT (%d)\n"; -char* D_800EC3FC = "OGA CAMERA INIT END\n"; -// High speed camera ERR !!! (ncx = %f) -char* D_800EC414 = "高速カメラ ERR !!! (ncx = %f)\n"; -// High speed camera ERR !!! (ncz = %f) -char* D_800EC434 = "高速カメラ ERR !!! (ncz = %f)\n"; -// High speed camera ERR !!! (ecx = %f) -char* D_800EC454 = "高速カメラ ERR !!! (ecx = %f)\n"; -// High speed camera ERR !!! (ecz = %f) -char* D_800EC474 = "高速カメラ ERR !!! (ecz = %f)\n"; -char* D_800EC494 = "OGA DRIVERS POINT CAMERA MODE \n"; -char* D_800EC4B4 = "OGA WINNER CAMERA MODE \n"; -char* D_800EC4D0 = "OGA TIMEATTACK QUICK CAMERA INIT \n"; -char* D_800EC4F4 = "OGA BATTLE CAMERA INIT win(%d)\n"; -char* D_800EC514 = "GOAL! <> camera %d rank %d\n"; -char* D_800EC53C = "GOAL! <> camera %d rank %d\n"; -char* D_800EC568 = "GOAL! <> camera %d rank %d\n"; -// Camera and cart collided! ! ! -char* D_800EC594 = "カメラとカートが衝突しました!!! (%d)\n"; -char* D_800EC5C0 = "<<< ITEM OBJ NUMBER ERR !! >>> item %d obj_num %d \n"; -// <<< BANANA SET HOUSE >>> obj_num %d zure %f -char* D_800EC5F8 = "<<< BANANA SET 失敗 >>> obj_num %d zure %f \n"; -// BANANA Caught in owner check. (num %d) -char* D_800EC628 = "BANANA 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800EC65C = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800EC670 = "理由: category \n"; -// Reason: sparam -char* D_800EC684 = "理由: sparam \n"; -// Reason: num -char* D_800EC694 = "理由: num \n"; -char* D_800EC6A0 = "BANANA HOLD (num %d time %d hold_time %d)\n"; -// Installation Caught in BANANA owner check. (num %d) -char* D_800EC6D0 = "設置 BANANA 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800EC708 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800EC71C = "理由: category \n"; -// Reason: sparam -char* D_800EC730 = "理由: sparam \n"; -// Reason: num -char* D_800EC740 = "理由: num \n"; -// I put BANANA. (num %d) -char* D_800EC74C = "BANANA 置きました。 (num %d)\n"; -// <<< BANANA NAGE SET failed >>> obj_num %d -char* D_800EC76C = "<<< BANANA NAGE SET 失敗 >>> obj_num %d \n"; -// BANANA NAGE MOVE Caught in owner check. (num %d) -char* D_800EC798 = "BANANA NAGE MOVE 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800EC7D8 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800EC7EC = "理由: category \n"; -// Reason: sparam -char* D_800EC800 = "理由: sparam \n"; -// Reason: num -char* D_800EC810 = "理由: num \n"; -char* D_800EC81C = "BANANA NAGE END 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800EC858 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800EC86C = "理由: category \n"; -// Reason: sparam -char* D_800EC880 = "理由: sparam \n"; -// Reason: num -char* D_800EC890 = "理由: num \n"; -char* D_800EC89C = "G_SHELL HOLD (num %d time %d hold_time %d)\n"; -// <<< G_SHELL SET failed >>> obj_num %d -char* D_800EC8CC = "<<< G_SHELL SET 失敗 >>> obj_num %d \n"; -// <<< G_SHELL SET failed >>> object_count %d -char* D_800EC8F4 = "<<< G_SHELL SET 失敗 >>> object_count %d \n"; -// G_SHELL Caught in owner check. (num %d) -char* D_800EC920 = "G_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800EC954 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800EC968 = "理由: category \n"; -// Reason: sparam -char* D_800EC97C = "理由: sparam \n"; -// Reason: num -char* D_800EC98C = "理由: num \n"; -// Just before launch G_SHELL Caught in owner check. (num %d) -char* D_800EC998 = "発射直前 G_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800EC9D8 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800EC9EC = "理由: category \n"; -// Reason: sparam -char* D_800ECA00 = "理由: sparam \n"; -// Reason: num -char* D_800ECA10 = "理由: num \n"; -// G_SHELL firing (num %d) -char* D_800ECA1C = "G_SHELL 発射 (num %d)\n"; -char* D_800ECA34 = "R_SHELL HOLD (num %d time %d hold_time %d obj_num %d)\n"; -// <<< R_SHELL SET failed >>> obj_num %d -char* D_800ECA70 = "<<< R_SHELL SET 失敗 >>> obj_num %d \n"; -// <<< R_SHELL SET failed >>> object_count %d -char* D_800ECA98 = "<<< R_SHELL SET 失敗 >>> object_count %d \n"; -// R_SHELL Caught in owner check. (num %d) -char* D_800ECAC4 = "R_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800ECAF8 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800ECB0C = "理由: category \n"; -// Reason: sparam -char* D_800ECB20 = "理由: sparam \n"; -// Reason: num -char* D_800ECB30 = "理由: num \n"; -char* D_800ECB3C = "R_SHELL SHOOT (num %d time %d hold_time %d obj_num %d)\n"; -// Just before launch R_SHELL Caught in owner check. (num %d) -char* D_800ECB78 = "発射直前 R_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800ECBB8 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800ECBCC = "理由: category \n"; -// Reason: sparam -char* D_800ECBE0 = "理由: sparam \n"; -// Reason: num -char* D_800ECBF0 = "理由: num \n"; -// R_SHELL firing (num %d) -char* D_800ECBFC = "R_SHELL 発射 (num %d)\n"; -char* D_800ECC14 = "S_BANANA HOLD (num %d time %d hold_time %d)\n"; -// <<< SUPER_BANANA SET failed >>> obj_num %d -char* D_800ECC44 = "<<< SUPER_BANANA SET 失敗 >>> obj_num %d \n"; -// <<< SUPER_BANANA SET failed >>> object_count %d -char* D_800ECC70 = "<<< SUPER_BANANA SET 失敗 >>> object_count %d \n"; -// S_BANANA Caught in owner check. (num %d) -char* D_800ECCA0 = "S_BANANA 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: category -char* D_800ECCD8 = "理由: category \n"; -// Reason: sparam -char* D_800ECCEC = "理由: sparam \n"; -// Reason: sb_ok -char* D_800ECCFC = "理由: sb_ok \n"; -char* D_800ECD0C = "S_BANANA RELEASE (num %d time %d )\n"; -// <<< FAKE IBOX SET failed >>> obj_num %d -char* D_800ECD34 = "<<< FAKE IBOX SET 失敗 >>> obj_num %d \n"; -// IBOX Caught in owner check. (num %d) -char* D_800ECD5C = "IBOX 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800ECD90 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800ECDA4 = "理由: category \n"; -// Reason: sparam -char* D_800ECDB8 = "理由: sparam \n"; -// Reason: num -char* D_800ECDC8 = "理由: num \n"; -char* D_800ECDD4 = "FBOX HOLD (num %d time %d hold_time %d)\n"; -// Installation IBOX owner check failed. (num %d) -char* D_800ECE00 = "設置 IBOX 所有者チェックに引っ掛かりました。(num %d)\n"; -// Reason: EXISTOBJ -char* D_800ECE38 = "理由: EXISTOBJ \n"; -// Reason: category -char* D_800ECE4C = "理由: category \n"; -// Reason: sparam -char* D_800ECE60 = "理由: sparam \n"; -// Reason: num -char* D_800ECE70 = "理由: num \n"; -// Ray START (%d) -char* D_800ECE7C = "雷START (%d)\n"; -// Ray END (%d) -char* D_800ECE8C = "雷END (%d)\n"; -// ---------- Initialization of commendation table -char* D_800ECE98 = "---------- 表彰台初期化\n"; -// map_number = %d -> 20 Rewriting. -char* D_800ECEB4 = "map_number = %d - > 20 書き換え中。\n"; -// OGA Recognition move begins -char* D_800ECEDC = "OGA 表彰 move 開始\n"; -// I called the display of the 4th place person. -char* D_800ECEF0 = "4位の人の表示をコールしました。\n"; -// Arrive at the podium -char* D_800ECF14 = "表彰台に到着\n"; -// Everyone gather! -char* D_800ECF24 = "全員集合!\n"; -// Arrive on the road -char* D_800ECF30 = "道路に到着\n"; -// 4th place finished -char* D_800ECF3C = "4位の人終了\n"; -// OGA commendation move end -char* D_800ECF4C = "OGA 表彰 move 終了\n"; -char* D_800ECF60 = "OGAWA DEBUG DRAW\n"; - -s16 get_angle_between_waypoints(Vec3f arg0, Vec3f arg1) { - s16 temp_ret; - s16 phi_v1; - - temp_ret = get_angle_between_two_vectors(arg0, arg1); - phi_v1 = temp_ret; - if (gIsMirrorMode != 0) { - phi_v1 = -temp_ret; - } - return phi_v1; -} - -s32 func_80006018(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { - f32 temp_f0; - f32 temp_f18; - - temp_f0 = sqrtf((arg2 * arg2) + (arg3 * arg3)); - if (temp_f0 < 0.01f) { - return 0; - } - temp_f18 = ((arg2 / temp_f0) * (arg6 - arg0)) + ((arg3 / temp_f0) * (arg7 - arg1)); - if ((-arg4 < temp_f18) && (temp_f18 < arg4)) { - temp_f18 = ((arg3 / temp_f0) * (arg6 - arg0)) + (-(arg2 / temp_f0) * (arg7 - arg1)); - if ((-arg5 < temp_f18) && (temp_f18 < arg5)) { - return 1; - } - } - return 0; -} - -void adjust_position_by_angle(Vec3f newPos, Vec3f oldPos, s16 orientationY) { - f32 x_dist; - f32 z_dist; - f32 temp1; - f32 temp2; - f32 sine; - f32 cosine; - - if (gIsMirrorMode != 0) { - orientationY = -orientationY; - } - x_dist = newPos[0] - oldPos[0]; - z_dist = newPos[2] - oldPos[2]; - sine = sins(orientationY); - cosine = coss(orientationY); - temp1 = ((x_dist * cosine) + (z_dist * sine)); - temp2 = ((z_dist * cosine) - (x_dist * sine)); - newPos[0] = oldPos[0] + temp1; - newPos[2] = oldPos[2] + temp2; -} - -s32 set_vehicle_render_distance_flags(Vec3f vehiclePos, f32 renderDistance, s32 flags) { - Camera* camera; - Player* player; - f32 x; - f32 z; - f32 playerX; - f32 playerZ; - s32 i; - s32 flag; - s8 numScreens; - - x = vehiclePos[0]; - z = vehiclePos[2]; - switch (gActiveScreenMode) { - case SCREEN_MODE_1P: - numScreens = 1; - break; - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - numScreens = 2; - break; - case SCREEN_MODE_3P_4P_SPLITSCREEN: - numScreens = gPlayerCount; - break; - default: - numScreens = 1; - break; - } - flag = flags; - if (!gDemoMode) { - player = gPlayerOne; - // Checks distance from each player. - for (i = 0; i < gPlayerCount; i++, player++) { - if (((player->type & PLAYER_HUMAN) != 0) && ((player->type & PLAYER_KART_AI) == 0)) { - playerX = player->pos[0]; - playerZ = player->pos[2]; - - // Is player within render distance - if (((playerX - renderDistance) < x) && ((playerX + renderDistance) > x) && - ((playerZ - renderDistance) < z) && ((playerZ + renderDistance) > z)) { - // Sets the render flag to on for each player. - flag |= (RENDER_VEHICLE << i); - } else { - // Sets the render flag to off for each player. - flag &= ~(RENDER_VEHICLE << i); - } - } - } - } else { // Demo cinematic uses the camera to check render distance - camera = camera1; - for (i = 0; i < numScreens; i++, camera++) { - playerX = camera->pos[0]; - playerZ = camera->pos[2]; - if (((playerX - renderDistance) < x) && (x < (playerX + renderDistance)) && - ((playerZ - renderDistance) < z) && (z < (playerZ + renderDistance))) { - flag |= (RENDER_VEHICLE << i); - } else { - flag &= ~(RENDER_VEHICLE << i); - } - } - } - return flag; -} - -void func_800065D0(s32 playerId, Player* player) { - s16 temp_t2; - s16 var_t1; - s16 temp_t3; - s16 a; - u32 b; - - a = (s16) gPathIndexByPlayerId[playerId]; - b = gNearestWaypointByPlayerId[playerId]; - - temp_t2 = (s16) ((s16) player->rotation[1] / 182); - temp_t3 = (s16) ((s16) D_80164590[a][b] / 182); - - var_t1 = temp_t2 - temp_t3; - - if (var_t1 < 0) { - var_t1 = -var_t1; - } - - if ((D_80164450[playerId] < D_80163288[playerId]) && (var_t1 >= 136) && (var_t1 < 225)) { - D_80163258[playerId]++; - if ((D_80163258[playerId]) >= 5) { - D_80163270[playerId] = 1; - D_80163258[playerId] = 5; - gPlayers[playerId].effects |= 0x400000; - } - } else if ((var_t1 < 45) || (var_t1 >= 316)) { - D_80163270[playerId] = 0; - D_80163258[playerId] = 0; - gPlayers[playerId].effects &= 0xFFBFFFFF; - } - D_80163288[playerId] = D_80164450[playerId]; -} - -void set_places(void) { - s32 temp_s2; - f32 temp_f0; - s32 sp80[8]; - s32 a_really_cool_variable_name; - UNUSED s32 pad; - s32 var_t4; - s32 playerId; - s32 temp_a0; - s32 var_t1_3; - - switch (gModeSelection) { - case BATTLE: - default: - return; // HEY! returns, not breaks - case GRAND_PRIX: - case TIME_TRIALS: - var_t4 = NUM_PLAYERS; - break; - case VERSUS: - var_t4 = gPlayerCount; - break; - } - - if (D_8016348C == 0) { - for (playerId = 0; playerId < var_t4; playerId++) { - temp_a0 = gGPCurrentRacePlayerIdByRank[playerId]; - sp80[playerId] = temp_a0; - gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByPlayerId[temp_a0]; - } - } else { - for (playerId = 0; playerId < var_t4; playerId++) { - temp_a0 = gGPCurrentRacePlayerIdByRank[playerId]; - sp80[playerId] = temp_a0; - gCourseCompletionPercentByRank[playerId] = -gTimePlayerLastTouchedFinishLine[temp_a0]; - } - } - - for (playerId = 0; playerId < var_t4 - 1; playerId++) { - if ((gPlayers[gGPCurrentRacePlayerIdByRank[playerId]].type & 0x800)) { - continue; - } - - for (var_t1_3 = playerId + 1; var_t1_3 < var_t4; var_t1_3++) { - if (gCourseCompletionPercentByRank[playerId] < gCourseCompletionPercentByRank[var_t1_3]) { - if (!(gPlayers[gGPCurrentRacePlayerIdByRank[var_t1_3]].type & 0x800)) { - temp_s2 = sp80[playerId]; - sp80[playerId] = sp80[var_t1_3]; - sp80[var_t1_3] = temp_s2; - temp_f0 = gCourseCompletionPercentByRank[playerId]; - gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByRank[var_t1_3]; - gCourseCompletionPercentByRank[var_t1_3] = temp_f0; - } - } - } - } - - for (playerId = 0; playerId < NUM_PLAYERS; playerId++) { - D_801643E0[playerId] = gGPCurrentRaceRankByPlayerId[playerId]; - } - - for (playerId = 0; playerId < var_t4; playerId++) { - gGPCurrentRacePlayerIdByRank[playerId] = sp80[playerId]; - gGPCurrentRaceRankByPlayerId[sp80[playerId]] = playerId; - } - - for (playerId = 0; playerId < var_t4; playerId++) { - a_really_cool_variable_name = D_80164378[playerId]; - sp80[playerId] = a_really_cool_variable_name; - gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByPlayerId[a_really_cool_variable_name]; - } - - for (playerId = 0; playerId < var_t4 - 1; playerId++) { - for (var_t1_3 = playerId + 1; var_t1_3 < var_t4; var_t1_3++) { - if (gCourseCompletionPercentByRank[playerId] < gCourseCompletionPercentByRank[var_t1_3]) { - temp_s2 = sp80[playerId]; - sp80[playerId] = sp80[var_t1_3]; - sp80[var_t1_3] = temp_s2; - temp_f0 = gCourseCompletionPercentByRank[playerId]; - gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByRank[var_t1_3]; - gCourseCompletionPercentByRank[var_t1_3] = temp_f0; - } - } - } - - for (playerId = 0; playerId < var_t4; playerId++) { - D_80164408[sp80[playerId]] = playerId; - D_80164378[playerId] = sp80[playerId]; - } -} - -void func_800070F4(void) { - f32 temp_f0; - UNUSED s32 pad; - s32 sp50[8]; - s32 temp_a0; - s32 temp_t2_2; - s32 var_a1_2; - s32 var_a3; - s32 var_a2; - - switch (gModeSelection) { - case BATTLE: - default: - return; // HEY! returns, not breaks - case GRAND_PRIX: - case TIME_TRIALS: - var_a2 = 8; - break; - case VERSUS: - var_a2 = gPlayerCount; - break; - } - - for (var_a3 = 0; var_a3 < var_a2; var_a3++) { - temp_a0 = gGPCurrentRacePlayerIdByRank[var_a3]; - sp50[var_a3] = temp_a0; - gCourseCompletionPercentByRank[var_a3] = -gTimePlayerLastTouchedFinishLine[temp_a0]; - } - - for (var_a3 = 0; var_a3 < (var_a2 - 1); var_a3++) { - for (var_a1_2 = var_a3 + 1; var_a1_2 < var_a2; var_a1_2++) { - if (gCourseCompletionPercentByRank[var_a3] < gCourseCompletionPercentByRank[var_a1_2]) { - temp_t2_2 = sp50[var_a3]; - sp50[var_a3] = sp50[var_a1_2]; - sp50[var_a1_2] = temp_t2_2; - temp_f0 = gCourseCompletionPercentByRank[var_a3]; - gCourseCompletionPercentByRank[var_a3] = gCourseCompletionPercentByRank[var_a1_2]; - gCourseCompletionPercentByRank[var_a1_2] = temp_f0; - } - } - } - - for (var_a3 = 0; var_a3 < NUM_PLAYERS; var_a3++) { - D_801643E0[var_a3] = gGPCurrentRaceRankByPlayerId[var_a3]; - } - - for (var_a3 = 0; var_a3 < var_a2; var_a3++) { - gGPCurrentRaceRankByPlayerId[sp50[var_a3]] = var_a3; - gGPCurrentRacePlayerIdByRank[var_a3] = sp50[var_a3]; - } -} - -void func_800074D4(void) { - f32 temp_a0; - s32 temp; - s32 sp68[8]; - UNUSED s32 pad; - s32 temp_t1; - s32 i; - s32 j; - s32 this_loops_upper_bound_is_brough_to_you_by_the_number = 8; - - for (i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number;) { - gCourseCompletionPercentByRank[i++] = 0.0f; - } - - for (j = 0, i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number; i++) { - if (gPlayers[i].type & 0x800) { - sp68[j] = i; - gCourseCompletionPercentByRank[j] = -gTimePlayerLastTouchedFinishLine[i]; - j++; - } - } - - temp_t1 = j; - for (i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number; i++) { - if (!(gPlayers[i].type & 0x800)) { - sp68[j] = i; - gCourseCompletionPercentByRank[j] = gCourseCompletionPercentByPlayerId[i]; - j++; - } - } - - for (i = 0; i < (temp_t1 - 1); i++) { - for (j = i + 1; j < temp_t1; j++) { - if (gCourseCompletionPercentByRank[i] < gCourseCompletionPercentByRank[j]) { - temp = sp68[i]; - sp68[i] = sp68[j]; - sp68[j] = temp; - temp_a0 = gCourseCompletionPercentByRank[i]; - gCourseCompletionPercentByRank[i] = gCourseCompletionPercentByRank[j]; - gCourseCompletionPercentByRank[j] = temp_a0; - } - } - } - - for (i = temp_t1; i < (this_loops_upper_bound_is_brough_to_you_by_the_number - 1); i++) { - for (j = i + 1; j < this_loops_upper_bound_is_brough_to_you_by_the_number; j++) { - if (gCourseCompletionPercentByRank[i] < gCourseCompletionPercentByRank[j]) { - temp = sp68[i]; - sp68[i] = sp68[j]; - sp68[j] = temp; - temp_a0 = gCourseCompletionPercentByRank[i]; - gCourseCompletionPercentByRank[i] = gCourseCompletionPercentByRank[j]; - gCourseCompletionPercentByRank[j] = temp_a0; - } - } - } - - for (i = 0; i < 8; i++) { - D_801643E0[i] = gGPCurrentRaceRankByPlayerId[i]; - } - - for (i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number; i++) { - gGPCurrentRaceRankByPlayerId[sp68[i]] = i; - gGPCurrentRacePlayerIdByRank[i] = sp68[i]; - } -} - -s32 func_80007BF8(u16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4) { - s32 var_v1; - - var_v1 = 0; - if ((arg1 >= arg2) && (arg1 < (arg4 - arg3))) { - if ((arg0 >= (arg1 - arg2)) && ((arg1 + arg3) >= arg0)) { - var_v1 = 1; - } - } else if ((((arg1 + arg3) % arg4) < arg0) && ((((arg1 + arg4) - arg2) % arg4) >= arg0)) { - var_v1 = -1; - } else { - var_v1 = 2; - } - return var_v1; -} - -void func_80007D04(s32 playerId, Player* player) { - s16 temp_t1; - s16 temp_t2; - s32 var_v0; - - temp_t1 = D_80164450[D_80163478]; - temp_t2 = D_80164450[playerId]; - - if (gGPCurrentRaceRankByPlayerId[playerId] < 2) { - s16 val1 = gGPCurrentRaceRankByPlayerId[D_80163478]; - s16 val2 = temp_t2 - temp_t1; - - if (val2 > 400 && val1 >= 6) { - player->effects &= ~0x200000; - player_speed(player); - D_801634C0[playerId] = 4; - return; - } - } else { - player->effects |= 0x200000; - player_speed(player); - D_801634C0[playerId] = 3; - return; - } - - switch (gCCSelection) { // WTF, FAKE ? - case 3: - break; - } - - switch (gCCSelection) { - case 0: - var_v0 = 0; - if (playerId == D_80163344[0]) { - var_v0 = 0x14; - } - break; - - case 1: - var_v0 = 8; - if (playerId == D_80163344[0]) { - var_v0 = 0x18; - } - break; - - case 2: - var_v0 = 0x12; - if (playerId == D_80163344[0]) { - var_v0 = 0x24; - } - break; - - case 3: - var_v0 = 8; - if (playerId == D_80163344[0]) { - var_v0 = 0x18; - } - break; - - default: - var_v0 = 0; - break; - } - - if (temp_t2 < temp_t1) { - player->effects |= 0x200000; - player_speed(player); - D_801634C0[playerId] = 1; - } else if (temp_t2 < (temp_t1 + var_v0 + 0x32)) { - player->effects &= ~0x200000; - player_speed(player); - D_801634C0[playerId] = 3; - } else if (D_801631E0[playerId] == 0) { - player->effects &= ~0x200000; - player_speed(player); - D_801634C0[playerId] = 2; - } else { - player->effects &= ~0x200000; - decelerate_ai_player(player, 1.0f); - D_801634C0[playerId] = -1; - } -} - -void func_80007FA4(s32 arg0, Player* player, f32 arg2) { - f32 temp_f0; - f32 temp_f12; - f32 temp_f2; - s32 test; - - temp_f0 = D_80163418[arg0] - player->pos[0]; - temp_f2 = D_80163438[arg0] - player->pos[2]; - temp_f12 = (temp_f0 * temp_f0) + (temp_f2 * temp_f2); - if (arg0 == 3) { - if ((temp_f12 < 25.0f) && (D_80163410[arg0] < 5)) { - D_80163410[arg0] = 4; - (arg2 < ((2.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_ai_player(player, 1.0f); - } else if ((temp_f12 < 3600.0f) && (D_80163410[arg0] < 4)) { - D_80163410[arg0] = 3; - (arg2 < ((5.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_ai_player(player, 5.0f); - } else { - (arg2 < ((20.0 * 18.0) / 216.0)) ? func_80038BE4(player, 10) : decelerate_ai_player(player, 1.0f); - } - } else { - if ((temp_f12 < 25.0f) && (D_80163410[arg0] < 5)) { - D_80163410[arg0] = 4; - test = 2; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_ai_player(player, 1.0f); - } else if ((temp_f12 < 4900.0f) && (D_80163410[arg0] < 4)) { - D_80163410[arg0] = 3; - test = 5; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_ai_player(player, 15.0f); - } else if ((temp_f12 < 22500.0f) && (D_80163410[arg0] < 3)) { - D_80163410[arg0] = 2; - test = 20; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 5) : decelerate_ai_player(player, 1.0f); - } else if ((temp_f12 < 90000.0f) && (D_80163410[arg0] < 2)) { - D_80163410[arg0] = 1; - test = 30; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 6) : decelerate_ai_player(player, 1.0f); - } else if (D_80163410[arg0] == 0) { - test = 35; - (arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) : decelerate_ai_player(player, 1.0f); - } else { - decelerate_ai_player(player, 1.0f); - } - } -} - -void func_80008424(s32 playerId, f32 arg1, Player* player) { - f32 var_f2; - f32 var_f0; - UNUSED s32 thing; - s32 var_a1; - - var_f2 = player->unk_094; - if (!(player->effects & 0x80) && !(player->effects & 0x40) && !(player->effects & 0x20000) && - !(player->soundEffects & 0x400000) && !(player->soundEffects & 0x01000000) && !(player->soundEffects & 2) && - !(player->soundEffects & 4)) { - if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { - func_80007FA4(playerId, player, var_f2); - } else if ((bStopAICrossing[playerId] == 1) && !(player->effects & (STAR_EFFECT | BOO_EFFECT))) { - decelerate_ai_player(player, 10.0f); - if (player->currentSpeed == 0.0) { - player->velocity[0] = 0.0f; - player->velocity[2] = 0.0f; - } - } else { - var_f0 = 3.3333333f; - switch (gCCSelection) { /* irregular */ - case 1: - case 3: - break; - case 0: - var_f0 = 2.5f; - break; - case 2: - var_f0 = 3.75f; - break; - } - if (var_f2 < var_f0) { - player->effects &= ~0x00200000; - player_speed(player); - } else if (player->type & 0x800) { - if (var_f2 < arg1) { - player->effects &= ~0x00200000; - player_speed(player); - } else { - player->effects &= ~0x00200000; - decelerate_ai_player(player, 1.0f); - } - } else if ((D_801631E0[playerId] == 1) && (D_80163330[playerId] != 1)) { - if (func_800088D8(playerId, gLapCountByPlayerId[playerId], D_80164408[playerId]) == 1) { - player->effects |= 0x200000; - player_speed(player); - } else { - player->effects &= ~0x00200000; - decelerate_ai_player(player, 1.0f); - } - } else { - var_a1 = 1; - switch (gSpeedKartAIBehaviour[playerId]) { /* switch 1; irregular */ - case SPEED_KART_AI_BEHAVIOUR_FAST: /* switch 1 */ - player->effects &= ~0x00200000; - player_speed(player); - break; - case SPEED_KART_AI_BEHAVIOUR_MAX: /* switch 1 */ - player->effects |= 0x200000; - player_speed(player); - break; - case SPEED_KART_AI_BEHAVIOUR_SLOW: /* switch 1 */ - if (((var_f2 / 18.0f) * 216.0f) > 20.0f) { - arg1 = 1.6666666f; - } - var_a1 = 0; - break; - case SPEED_KART_AI_BEHAVIOUR_NORMAL: /* switch 1 */ - default: /* switch 1 */ - var_a1 = 0; - break; - } - if (var_a1 != 1) { - if (var_f2 < arg1) { - if ((gDemoMode == 1) && (gCurrentCourseId != 0x0014)) { - player_speed(player); - } else if (D_80163330[playerId] == 1) { - func_80007D04(playerId, player); - } else if (func_800088D8(playerId, gLapCountByPlayerId[playerId], D_80164408[playerId]) == 1) { - player->effects |= 0x200000; - player_speed(player); - } else { - player->effects &= ~0x00200000; - decelerate_ai_player(player, 1.0f); - } - } else { - player->effects &= ~0x00200000; - if (arg1 > 1.0f) { - decelerate_ai_player(player, 2.0f); - } else { - decelerate_ai_player(player, 5.0f); - } - } - } - } - } - } -} - -#ifdef NON_MATCHING -// generated by m2c commit 05102b12b75400ad2be8bd0872404237b36e1702 on Feb-20-2024 -// static ? D_800DCAF4; /* unable to generate initializer: unknown type */ -// static ? D_800DCB34; /* unable to generate initializer: unknown type */ -// static ? *D_800DCBB4[0x15] = { -// &D_800DCB34, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// &D_800DCAF4, -// }; - -s32 func_800088D8(s32 playerId, s16 arg1, s16 arg2) { - Player* player; - f32 interp; - s16 rank; - s16 var_a0_4; - s16 var_t1; - s16 var_v0; - s16* temp_a3; - s32 temp_a2; - s32 arg1_times_8; - s32 var_a0_2; - s32 progress; - s32 var_a1_4; - s32 i; - - D_80163128[playerId] = -1; - D_80163150[playerId] = -1; - if (gModeSelection == 1) { - return true; - } - if (arg1 < 0) { - return true; - } else if (arg1 >= 4) { - arg1 = 3; - } - if (D_80163330[playerId] == 1) { - return true; - } - player = &gPlayers[playerId]; - if (player->type & 0x4000) { - return true; - } - arg1_times_8 = arg1 * 8; - temp_a3 = &D_800DCBB4[gCurrentCourseId][arg1_times_8]; - if (arg2 == 0) { - if (gDemoMode == 1) { - temp_a2 = D_80164450[playerId] - D_80164450[D_80164378[7]]; - if (temp_a2 < 0) { - temp_a2 = -temp_a2; - } - if (arg1_times_8 < 24) { - interp = gLapCompletionPercentByPlayerId[playerId]; - D_80163150[playerId] = temp_a3[8] * interp + temp_a3[0] * (1.0f - interp); - } else { - D_80163150[playerId] = temp_a3[0]; - } - if (D_80163150[playerId] < temp_a2 && player->unk_094 / 18.0f * 216.0f >= 20.0f) { - return false; - } - return true; - } - progress = D_80164450[playerId] - D_80164450[D_80163478]; - rank = gGPCurrentRaceRankByPlayerId[2 + (D_80163478 * 4)]; - if (gWaypointCountByPathIndex[0] * 2 / 3 < progress && rank >= 6) { - progress = D_80164450[playerId] - D_80164450[gLapCountByPlayerId[-26 + rank * 2]]; - } - if (progress < 0) { - progress = -progress; - } - if (arg1_times_8 < 24) { - interp = gLapCompletionPercentByPlayerId[playerId]; - var_a0_2 = temp_a3[8] * interp + temp_a3[0] * (1.0f - interp); - } else { - var_a0_2 = temp_a3[0]; - } - D_80163150[playerId] = (gCCSelection + 1) * var_a0_2; - if (D_80163150[playerId] < progress && player->unk_094 / 18.0f * 216.0f >= 20.0f) { - return false; - } - return true; - } else { - var_a1_4 = D_80164450[(s16) *D_80163344] - D_80164450[playerId]; - if (var_a1_4 < 0) { - var_a1_4 = -var_a1_4; - } - var_v0 = 0; - for (i = 0; i < 2; i++) { - if (gGPCurrentRaceRankByPlayerId[D_80163344[i]] < arg2) { - var_v0++; - } - } - var_a0_4 = 0; - for (i = 0; i < gPlayerCount; i++) { - if (gGPCurrentRaceRankByPlayerId[i] < arg2) { - var_a0_4++; - } - } - var_t1 = (arg2 - var_v0) - var_a0_4; - if (var_v0 > 0 || var_a0_4 > 0) { - var_t1++; - } - D_80164538[playerId] = var_t1; - if (var_t1 < 0 || var_t1 >= 8) { - return false; - } - if (arg1_times_8 < 24) { - temp_a3 = &temp_a3[var_t1]; - interp = gLapCompletionPercentByPlayerId[playerId]; - D_80163150[playerId] = temp_a3[8] * interp + temp_a3[0] * (1.0f - interp); - } else { - D_80163150[playerId] = temp_a3[var_t1]; - } - D_80163128[playerId] = var_a1_4; - if (D_80163150[playerId] < var_a1_4) { - return true; - } - return false; - } -} -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800088D8.s") -#endif - -void func_80008DC0(s32 pathIndex) { - D_80164490 = D_80164550[pathIndex]; - D_801631D0 = D_80164560[pathIndex]; - D_801631D4 = D_80164570[pathIndex]; - D_801631D8 = D_80164580[pathIndex]; - D_801631DC = D_80164590[pathIndex]; - D_801645E0 = D_801645A0[pathIndex]; - D_80164430 = gWaypointCountByPathIndex[pathIndex]; -} - -s32 func_80008E58(s32 payerId, s32 pathIndex) { - f32 posX; - f32 posY; - f32 posZ; - Player* player; - s32 trackSectionId; - UNUSED s32 stackPadding; - - player = &gPlayers[payerId]; - posX = player->pos[0]; - posY = player->pos[1]; - posZ = player->pos[2]; - stackPadding = pathIndex; - trackSectionId = get_track_section_id(player->collision.meshIndexZX); - D_80163318[payerId] = trackSectionId; - sSomeNearestWaypoint = find_closest_waypoint_track_section(posX, posY, posZ, trackSectionId, &pathIndex); - gNearestWaypointByPlayerId[payerId] = sSomeNearestWaypoint; - if (pathIndex) {}; - gPathIndexByPlayerId[payerId] = pathIndex; - func_80008DC0(pathIndex); - if (stackPadding) {}; - return pathIndex; -} - -void func_80008F38(s32 playerId) { - f32 temp_f0; - - D_80164450[playerId] = (gLapCountByPlayerId[playerId] * gWaypointCountByPathIndex[0]) + sSomeNearestWaypoint; - temp_f0 = - (f32) gNearestWaypointByPlayerId[playerId] / (f32) gWaypointCountByPathIndex[gPathIndexByPlayerId[playerId]]; - gLapCompletionPercentByPlayerId[playerId] = temp_f0; - gCourseCompletionPercentByPlayerId[playerId] = temp_f0; - gCourseCompletionPercentByPlayerId[playerId] += gLapCountByPlayerId[playerId]; -} - -void func_80009000(s32 playerId) { - s16 temp_v0; - - temp_v0 = D_801644F8[playerId]; - if (sSomeNearestWaypoint >= 0x6D) { - D_801644F8[playerId] = 1; - switch (D_80163448) { - case 0: - if (sSomeNearestWaypoint >= 0x20F) { - D_801644F8[playerId] = 0; - } - break; - case 1: - if (sSomeNearestWaypoint >= 0x206) { - D_801644F8[playerId] = 0; - } - break; - case 2: - if (sSomeNearestWaypoint >= 0x211) { - D_801644F8[playerId] = 0; - } - break; - case 3: - if (sSomeNearestWaypoint >= 0x283) { - D_801644F8[playerId] = 0; - } - break; - } - } - if ((temp_v0 == 0) && (D_801644F8[playerId] == 1)) { - D_80163490[playerId] = 1; - } - if ((temp_v0 == 1) && (D_801644F8[playerId] == 0)) { - D_801634A8[playerId] = 1; - } -} - -void func_800090F0(s32 playerId, Player* player) { - f32 posX; - f32 posY; - f32 posZ; - UNUSED f32 pad[2]; - - posX = player->pos[0]; - posY = player->pos[1]; - posZ = player->pos[2]; - if (D_80163490[playerId] == 1) { - D_80163448 = func_80008E58(playerId, random_int(4U)); - sSomeNearestWaypoint = func_8000CD24(posX, posY, posZ, 0, player, playerId, D_80163448); - gNearestWaypointByPlayerId[playerId] = sSomeNearestWaypoint; - func_80008F38(playerId); - D_80163490[playerId] = 0; - } - if (D_801634A8[playerId] == 1) { - D_80163448 = func_80008E58(playerId, 0); - sSomeNearestWaypoint = func_8000CD24(posX, posY, posZ, 0, player, playerId, D_80163448); - gNearestWaypointByPlayerId[playerId] = sSomeNearestWaypoint; - func_80008F38(playerId); - D_801634A8[playerId] = 0; - } -} - -/** - * Helps calculate time since player last touched finishline. - **/ -f32 func_80009258(UNUSED s32 playerId, f32 arg1, f32 arg2) { - f32 temp_f2 = D_8016344C - arg2; - f32 temp_f12 = arg1 - D_8016344C; - return gCourseTimer - ((COURSE_TIMER_ITER_f * temp_f2) / (temp_f2 + temp_f12)); -} - -#ifdef NON_MATCHING -// Weird stack issue, can't figure out how to get rid of it -void func_8000929C(s32 playerId, Player* player) { - f32 tempPos0; - f32 tempPos1; - f32 tempPos2; - s32 var_v0; - s32 var_v1; - f32 someTemp0; - UNUSED s16 stackPadding0; - s16 var_t0; - UNUSED s32 stackPadding1; - - tempPos0 = player->pos[0]; - tempPos1 = player->pos[1]; - tempPos2 = player->pos[2]; - D_801630E2 = 0; - D_80163240[playerId] = 0; - sSomeNearestWaypoint = - func_8000CD24(tempPos0, tempPos1, tempPos2, gNearestWaypointByPlayerId[playerId], player, playerId, D_80163448); - D_801630E0 = sSomeNearestWaypoint; - if (gNearestWaypointByPlayerId[playerId] != sSomeNearestWaypoint) { - gNearestWaypointByPlayerId[playerId] = sSomeNearestWaypoint; - D_801630E2 = 1; - func_80008F38(playerId); - } - if (gCurrentCourseId == 0x0014) { - func_8000B95C(playerId, sSomeNearestWaypoint, D_80163448); - return; - } - if ((sSomeNearestWaypoint < 0x14) || ((gWaypointCountByPathIndex[D_80163448] - 0x14) < sSomeNearestWaypoint) || - (gCurrentCourseId == 0x000B)) { - var_v1 = 0; - var_t0 = 0; - if (gCurrentCourseId == 0x000B) { - D_801634EC = 0; - if (player->effects & 0x200) { - D_801634EC = 1; - } - if (gIsMirrorMode != 0) { - if (tempPos0 < 300.0f) { - var_v1 = 1; - var_t0 = 1; - } else if ((tempPos0 < 1300.0f) && (gLapCountByPlayerId[playerId] < 2) && ((D_801634EC == 1))) { - var_v1 = 1; - var_t0 = 1; - } - } else { - if (tempPos0 > -300.0f) { - var_v1 = 1; - var_t0 = 1; - } else { - if ((tempPos0 > -1300.0f) && (gLapCountByPlayerId[playerId] < 2) && (D_801634EC == 1)) { - var_v1 = 1; - var_t0 = 1; - } - } - } - } else { - var_v1 = 1; - var_t0 = 1; - } - someTemp0 = D_80163450[playerId]; - if ((var_v1 != 0) && (tempPos2 <= D_8016344C)) { - if (D_8016344C < someTemp0) { - gLapCountByPlayerId[playerId]++; - if ((gModeSelection == 0) && (gLapCountByPlayerId[playerId] == 5)) { - if (D_80164408[playerId] == 7) { - for (var_v0 = 0; var_v0 < 8; var_v0++) { - gLapCountByPlayerId[var_v0]--; - } - } - } - D_80163240[playerId] = 1; - func_80008F38(playerId); - reset_kart_ai_behaviour(playerId); - D_801642D8[playerId].unk_06 = 0; - if ((D_8016348C == 0) && !(player->type & 0x800)) { - gTimePlayerLastTouchedFinishLine[playerId] = func_80009258(playerId, someTemp0, tempPos2); - } - } - } - if ((var_t0 != 0) && (someTemp0 <= D_8016344C) && (D_8016344C < tempPos2)) { - gLapCountByPlayerId[playerId]--; - func_80008F38(playerId); - } - } - D_80163450[playerId] = tempPos2; - if ((gCurrentCourseId == COURSE_YOSHI_VALLEY) && (D_801630E2 == 1)) { - func_80009000(playerId); - if (((player->type & 0x4000) == 0) || (player->type & 0x1000)) { - func_800090F0(playerId, player); - } - } - if ((player->type & 0x4000) && !(player->type & 0x1000)) { - func_800065D0(playerId, player); - if ((gModeSelection == 0) && (gPlayerCount == 2) && (playerId == 0)) { - if (D_80164408[0] < D_80164408[1]) { - D_80163478 = 0; - } else { - D_80163478 = 1; - } - } - } else { - //???? - } - func_8000B95C(playerId, sSomeNearestWaypoint, D_80163448); -} -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000929C.s") -#endif - -void update_vehicles(void) { - s32 i; - generate_player_smoke(); - D_8016337C++; - - if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { - for (i = 0; i < 7; i++) { - func_8000DF8C(i); - } - return; - } - - if (D_8016337C & 1) { - if (gModeSelection == VERSUS) { - for (i = 0; i < 7; i++) { - func_8000DF8C(i); - } - } - - switch (gCurrentCourseId) { - case COURSE_KALAMARI_DESERT: - update_vehicle_trains(); - break; - case COURSE_DK_JUNGLE: - update_vehicle_paddle_boats(); - break; - case COURSE_TOADS_TURNPIKE: - update_vehicle_box_trucks(); - update_vehicle_school_bus(); - update_vehicle_tanker_trucks(); - update_vehicle_cars(); - break; - } - } -} - -void func_800098FC(s32 arg0, Player* player) { - if (D_80163398[arg0] >= 0xB) { - if ((player->effects & 0x80) || (player->effects & 0x40) || (player->effects & 0x20000)) { - func_800C92CC(arg0, 0x2900800AU); - D_80163398[arg0] = 0; - } - } - if (D_801633B0[arg0] >= 0xB) { - if ((player->soundEffects & 0x400000) || (player->soundEffects & 0x01000000) || (player->soundEffects & 2) || - (player->soundEffects & 4) || (player->effects & HIT_EFFECT)) { - func_800C92CC(arg0, 0x2900800BU); - D_801633B0[arg0] = 0; - } - } -} - -void func_800099EC(s32 playerId, UNUSED Player* unused) { - s32 var_s0; - - if (D_801633C8[playerId] >= 0x65) { - for (var_s0 = 0; var_s0 < gPlayerCount; var_s0++) { - if ((gGPCurrentRaceRankByPlayerId[playerId] < gGPCurrentRaceRankByPlayerId[var_s0]) && - (gGPCurrentRaceRankByPlayerId[playerId] == D_801643E0[var_s0]) && - (gGPCurrentRaceRankByPlayerId[var_s0] == D_801643E0[playerId])) { - func_800C92CC(playerId, 0x2900800DU); - D_801633C8[playerId] = 0; - } - } - } - if (D_801633C8[playerId] < 0x3E8) { - D_801633C8[playerId]++; - } - if (D_80163398[playerId] < 0xC8) { - D_80163398[playerId]++; - } - if (D_801633B0[playerId] < 0xC8) { - D_801633B0[playerId]++; - } -} - -#ifdef NON_MATCHING -#define FAKEMATCH1 0 -#define FAKEMATCH2 0 -// https://decomp.me/scratch/uJCh3 -// Lots of register allocation differences, but messing around seems to suggest they stem from 2 specific areas -// MISMATCH1: something about the loading of `playerId` is off -// MISMATCH2: something about the handling of the math is off. Not sure exactly what though -// MISMATCH3: there's a small instruction ordering issue concerning `gCourseMaxX`. No idea what to do about it -// FAKEMATCH1 is the best improvement I've seen yet, MISMATCH2/3 become the only issues. - -void func_80009B60(s32 playerId) { - UNUSED s32 stackPadding00; - UNUSED s32 stackPadding01; - UNUSED s32 stackPadding02; - UNUSED s32 stackPadding03; - UNUSED s32 stackPadding04; - UNUSED s32 stackPadding05; - UNUSED s32 stackPadding06; - UNUSED s32 stackPadding07; - UNUSED s32 stackPadding08; - UNUSED s32 stackPadding09; - UNUSED s32 stackPadding0A; - UNUSED s32 stackPadding0B; - UNUSED s32 stackPadding0C; - UNUSED s32 stackPadding0D; - s16 var_a0_2; - s16 var_a1; - UNUSED s32 stackPadding0E; - UNUSED s32 stackPadding0F; - UNUSED s32 stackPadding10; - UNUSED s32 stackPadding11; - UNUSED s32 stackPadding12; - UNUSED s32 stackPadding13; - UNUSED s32 stackPadding14; - UNUSED s32 stackPadding15; - UNUSED s32 stackPadding16; - UNUSED s32 stackPadding17; - UNUSED s32 stackPadding18; - u16 stackPadding19; - u16 stackPadding1A; - f32 temp_f0; - f32 temp_f2; - s16 var_a2; - s16 var_v1; - s32 temp_f6; - Player* player; - TrackWaypoint* waypoint; - f32 athing = 1.5f; - - player = &gPlayers[playerId]; - if ((s32) gKartAICourseMaximumSeparation[gCurrentCourseId] >= 0) { - D_80163100[playerId] += 1; - if (playerId == 0) { - D_80163378++; - if (D_80163378 & 1) { - D_80163488 += 1; - } - } - if (!(player->type & 0x8000)) { - D_80164450[playerId] = -0x00000014; - gCourseCompletionPercentByPlayerId[playerId] = -1000.0f; - gLapCompletionPercentByPlayerId[playerId] = -1000.0f; - return; - } - D_801633E0[playerId] = 0; - if (player->pos[0] < gCourseMinX) { - D_801633E0[playerId] = 1; - } - if (gCourseMaxX < player->pos[0]) { - D_801633E0[playerId] = 2; - } - if (player->pos[2] < gCourseMinZ) { - D_801633E0[playerId] = 3; - } - // MISMATCH3 - if (gCourseMaxZ < player->pos[2]) { - D_801633E0[playerId] = 4; - } - if (!(player->unk_0CA & 2) && !(player->unk_0CA & 8)) { - D_80163448 = gPathIndexByPlayerId[playerId]; - func_80008DC0(D_80163448); - switch (gCurrentCourseId) { /* irregular */ - case COURSE_KALAMARI_DESERT: - func_80012DC0(playerId, player); - if (playerId == 0) { - func_80013054(); - } - break; - case COURSE_DK_JUNGLE: - func_80013854(player); - break; - case COURSE_TOADS_TURNPIKE: - func_800148C4(playerId, player); - func_80014A18(playerId, player); - func_80014B6C(playerId, player); - func_80014CC0(playerId, player); - break; - } - if (player->type & 0x800) { - player->effects &= ~0x00400000; - player->unk_044 &= ~0x0001; - } - func_8000929C(playerId, player); - if ((gCurrentCourseId != COURSE_AWARD_CEREMONY) && ((D_80163240[playerId] == 1) || (playerId == 0))) { - set_places(); - } - if (player->type & 0x1000) { - if ((D_801630E2 == 1) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { - kart_ai_behaviour(playerId); - } - if ((playerId & 1) != (D_80163378 & 1)) { - kart_ai_use_item_strategy(playerId); - } - func_800099EC(playerId, player); - D_80162FD0 = 0; - switch (gModeSelection) { /* switch 1; irregular */ - case 1: /* switch 1 */ - case 2: /* switch 1 */ - case 3: /* switch 1 */ - break; - case 0: /* switch 1 */ - break; - } - D_801631E0[playerId] = 0; - if ((player->effects & 0x1000) && (gCurrentCourseId != 0x0014)) { - D_801631E0[playerId] = 1; - } - if ((D_801646CC == 1) || (player->type & 0x800) || (gCurrentCourseId == 0x0014)) { - if (gCurrentCourseId != 0x000A) { - D_801634F8[playerId].unk4 = 0.0f; - } - D_801634F8[playerId].unkC = 0.0f; - } - if (D_80163448 > 0) { - D_801634F8[playerId].unk4 = 0.0f; - D_801634F8[playerId].unkC = 0.0f; - } - // gNearestWaypointByPlayerId[playerId] might need to be saved to a temp - D_80164510[playerId] = D_80164550[D_80163448][gNearestWaypointByPlayerId[playerId]].posY + 4.3f; - if ((D_801631F8[playerId] == 1) && (D_801631E0[playerId] == 0)) { - func_8002E4C4(player); - } - if (D_801631E0[playerId] == 1) { - player->pos[1] = D_80164510[playerId]; - } - D_801631F8[playerId] = D_801631E0[playerId]; - switch (gCurrentCourseId) { - case 4: - case 0x0014: - D_801634F8[playerId].unk4 = 0.0f; - break; - default: - break; - case 10: - func_8001490C(playerId); - func_80014A60(playerId); - func_80014BB4(playerId); - func_80014D08(playerId); - break; - } - if (D_801631E0[playerId] == 1) { - D_801630E8[playerId] = 0; - player->effects &= ~0x10; - if ((playerId & 1) != (D_80163378 & 1)) { - func_8003680C(player, 0); - func_80008424(playerId, D_80163210[playerId], player); - return; - } - if ((gPlayerCount > 0) && (gPlayerCount < 3) && (D_80163330[playerId] == 1) && - (D_8016334C[playerId] < gGPCurrentRaceRankByPlayerId[playerId])) { - D_80163210[playerId] = 8.333333f; - } else if (D_80162FD0 == (s16) 1U) { - D_80163210[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D0096B8[gCurrentCourseId][gCCSelection]); - D_801634F8[playerId].unk4 = -0.5f; - } else if (D_801645E0[sSomeNearestWaypoint] > 0) { - D_80163210[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D009418[gCurrentCourseId][gCCSelection]); - } else { - D_80163210[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D009568[gCurrentCourseId][gCCSelection]); - } - check_ai_crossing_distance(playerId); - func_8000D3B8(playerId); - func_8000D438(playerId, D_801630E0); - temp_f0 = D_80162FA0[0] - player->pos[0]; - temp_f2 = D_80162FA0[2] - player->pos[2]; - if (!(player->effects & 0x80) && !(player->effects & 0x40) && !(player->effects & 0x800)) { - if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) > 6400.0f) { - if (D_80163448 == 0) { - func_8000B140(playerId); - if (D_80162FF8[playerId] > 0) { - stackPadding1A = D_801630E0 + 5; - stackPadding1A %= D_80164430; - func_8000BBD8(stackPadding1A, D_80163090[playerId], D_80163448); - } - } - player->rotation[1] = -get_angle_between_two_vectors(player->pos, D_80162FA0); - } else { - player->rotation[1] = D_80164590[D_80163448][(D_801630E0 + 4) % D_80164430]; - } - } - func_8003680C(player, 0); - func_80008424(playerId, D_80163210[playerId], player); - return; - } - if ((D_801630E8[playerId] == 1) || (D_801630E8[playerId] == -1)) { - player->effects |= 0x10; - } - if (D_801630E8[playerId] != 0) { - D_80163300[playerId] = -get_angle_between_two_vectors(&player->oldPos[0], player->pos); - var_a0_2 = (D_801631DC[(sSomeNearestWaypoint + 2) % D_80164430] * 0x168) / 65535; - var_a1 = (D_80163300[playerId] * 0x168) / 65535; - if (var_a0_2 < -0xB4) { - var_a0_2 += 0x168; - } - if (var_a0_2 > 0xB4) { - var_a0_2 -= 0x168; - } - if (var_a1 < -0xB4) { - var_a1 += 0x168; - } - if (var_a1 > 0xB4) { - var_a1 -= 0x168; - } - var_v1 = var_a0_2 - var_a1; - if (var_v1 < -0xB4) { - var_v1 += 0x168; - } - if (var_v1 > 0xB4) { - var_v1 -= 0x168; - } - switch (D_801630E8[playerId]) { - case -1: - if (var_v1 > 5) { - D_801630E8[playerId] = 0; - player->effects &= ~0x10; - } - break; - case 1: - if (var_v1 < -5) { - D_801630E8[playerId] = 0; - player->effects &= ~0x10; - } - break; - default: - break; - } - } - // MISMATCH1 -#if FAKEMATCH2 == 1 - stackPadding00 = (playerId & 1) != (D_80163378 & 1); - if (stackPadding00) { -#else - if ((playerId & 1) != (D_80163378 & 1)) { -#endif - func_8003680C(player, D_80163050[playerId]); - func_80008424(playerId, D_80163210[playerId], player); - return; - } - D_801630B8[playerId] = func_8000B7E4(playerId, sSomeNearestWaypoint); - func_8000D438(playerId, sSomeNearestWaypoint); - if (gCurrentCourseId != 0x0014) { - if (D_80164450[playerId] < 0xB) { - stackPadding1A = D_801630E0; - if ((D_80164450[playerId] > 0) && (gCurrentCourseId == 0x000A)) { - stackPadding1A += 0x14; - stackPadding1A %= D_80164430; - func_8000BBD8(stackPadding1A, 0.0f, 0); - D_801634F8[playerId].unk4 = 0.0f; - } else { - stackPadding1A += 8; - stackPadding1A %= D_80164430; - func_8000BBD8(stackPadding1A, D_80163068[playerId], D_80163448); - D_801634F8[playerId].unk0 = D_80163068[playerId]; - } - } - if ((D_80162FD0 == 1) && (D_80162FF8[playerId] == 0)) { - stackPadding1A = D_801630E0 + 7; - stackPadding1A %= D_80164430; - func_8000BBD8(stackPadding1A, -0.7f, D_80163448); - } - if (D_80163448 == 0) { - func_8000B140(playerId); - if (D_80162FF8[playerId] > 0) { - stackPadding1A = D_801630E0 + 5; -#if FAKEMATCH1 == 1 - if (1) {} - if (1) {} - if (1) {} - if (1) {} - if (1) {} - if (1) {} -#endif - stackPadding1A %= D_80164430; - func_8000BBD8(stackPadding1A, D_80163090[playerId], D_80163448); - } - } - } - if (gCurrentCourseId == 0x0014) { - switch (D_80163410[playerId]) { /* switch 3; irregular */ - case 3: /* switch 3 */ - D_80162FA0[0] = D_80163418[playerId]; - D_80162FA0[2] = D_80163438[playerId]; - break; - case 4: /* switch 3 */ - waypoint = &D_80164550[playerId][(gNearestWaypointByPlayerId[playerId] + 0xA) % - gWaypointCountByPathIndex[playerId]]; - D_80162FA0[0] = waypoint->posX; - D_80162FA0[2] = waypoint->posZ; - break; - } - } - D_80162FA0[0] = (D_80163178[playerId] + D_80162FA0[0]) * 0.5f; - D_80162FA0[2] = (D_801631A0[playerId] + D_80162FA0[2]) * 0.5f; - D_80163178[playerId] = D_80162FA0[0]; - D_801631A0[playerId] = D_80162FA0[2]; - temp_f2 = athing * 182.0f; - temp_f6 = -athing * 182.0f; - // MISMATCH2 - // This fixes part of the register allocation problems, makes fixing others - // harder though. Needs more investigation - // var_a2 = (-get_angle_between_two_vectors(player->pos, D_80162FA0)) - (var_a1 = player->rotation[1]); - stackPadding19 = -get_angle_between_two_vectors(player->pos, D_80162FA0) - player->rotation[1]; - var_a1 = stackPadding19; - var_a2 = var_a1; - if ((s16) temp_f2 < var_a1) { - var_a2 = temp_f2; - } - if (var_a2 < (s16) temp_f6) { - var_a2 = temp_f6; - } - var_v1 = gKartAISteeringSensitivity[gCurrentCourseId]; - switch (D_801631D8[playerId]) { /* switch 4; irregular */ - case 2: /* switch 4 */ - if (D_80163068[playerId] > (0.5f * 1.0f)) { - var_v1 = 0x0014; - } - if (D_80163068[playerId] < -0.5f) { - var_v1 = 0x0035; - } - break; - case 3: /* switch 4 */ - if (D_80163068[playerId] > 0.5f) { - var_v1 = 0x0035; - } - if (D_80163068[playerId] < -0.5f) { - var_v1 = 0x0014; - } - break; - } - if ((gKartAIBehaviourState[playerId] == KART_AI_BEHAVIOUR_STATE_RUNNING) && - ((D_80163068[playerId] > 0.9f) || (D_80163068[playerId] < -0.9f))) { - D_801630E8[playerId] = 0; - player->effects &= ~0x10; - } - if (player->effects & 2) { - switch (D_801630E8[playerId]) { - case 1: - var_a1 = 0x0035; - break; - case -1: - var_a1 = -0x0035; - break; - default: - var_a1 = (D_80163050[playerId] + ((var_a2 * var_v1) / temp_f2)) / 2; - break; - } - } else if (player->effects & 0x1000000C) { - var_a1 = 0; - } else { - var_a1 = (D_80163050[playerId] + ((var_a2 * var_v1) / temp_f2)) / 2; - } - func_8003680C(player, var_a1); - D_80163050[playerId] = var_a1; - if ((D_801630B8[playerId] == 1) || (D_801630E8[playerId] == 1) || (D_801630E8[playerId] == -1) || - (player->effects & 0x1000000C)) { - D_80163028[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D009418[gCurrentCourseId][gCCSelection]); - } else { - D_80163028[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D009568[gCurrentCourseId][gCCSelection]); - } - if ((D_80163068[playerId] > 0.9f) || (D_80163068[playerId] < -0.9f)) { - D_80163028[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D009808[gCurrentCourseId][gCCSelection]); - } - if (D_80162FD0 == 1) { - D_80163028[playerId] = - *(f32*) segmented_to_virtual_dupe_2(&D_0D0096B8[gCurrentCourseId][gCCSelection]); - } - if ((D_801630E8[playerId] == 2) || (D_801630E8[playerId] == -2) || (D_801630E8[playerId] == 3)) { - D_80163028[playerId] = 3.3333333f; - } - D_8016320C = D_80163028[playerId]; - player->effects &= ~0x00200000; - D_80163210[playerId] = D_8016320C; - check_ai_crossing_distance(playerId); - func_80008424(playerId, D_8016320C, player); - } - } - } -} -#undef FAKEMATCH1 -#undef FAKEMATCH2 -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80009B60.s") -#endif - -#ifdef NON_MATCHING -// Lots of work left to do, might be funtionally accurate? -void func_8000B140(s32 playerId) { - UNUSED f32 stackPadding0; - UNUSED f32 stackPadding1; - UNUSED f32 stackPadding2; - UNUSED f32 stackPadding3; - UNUSED f32 stackPadding4; - UNUSED f32 stackPadding5; - UNUSED f32 stackPadding6; - UNUSED f32 stackPadding7; - f32 temp_f0_2; - f32 temp_f12; - f32 temp_f14; - f32 temp_f16; - f32 temp_f22; - f32 temp_f2; - f32 var_f18; - f32 var_f20; - s16 spB0[8]; - UNUSED f32 stackPadding8; - s16 sp9C[8]; - UNUSED f32 stackPadding9; - f32 sp74[8]; - s32 temp_a1_2; - s16 temp_v1_2; - s16 var_t1; - s32 var_t2; - s32 someIndex; - Player* player; - - player = &gPlayers[playerId]; - if (!(player->effects & 0x10) && (D_801630E8[playerId] != 1) && (D_801630E8[playerId] != -1) && - !(D_80163068[playerId] < -1.0f) && !(D_80163068[playerId] > 1.0f) && (player->characterId != 5) && - (player->characterId != 7) && (player->characterId != 4) && !(player->effects & STAR_EFFECT)) { - var_t1 = gNearestWaypointByPlayerId[playerId]; - temp_f22 = (player->unk_094 / 18.0f) * 216.0f; - for (someIndex = 0; someIndex < 8; someIndex++) { - sp9C[someIndex] = -1; - spB0[someIndex] = 0x03E8; - } - if (D_80163010[playerId] > 0) { - D_80163010[playerId]--; - if (D_80163010[playerId] <= 0) { - D_80162FF8[playerId] = 0; - } - } - var_t2 = 0; - for (someIndex = 0; (var_t2 < 2) && (someIndex < 8); someIndex++) { - if (someIndex == playerId) - continue; - player = &gPlayers[someIndex]; - if (!(player->type & 0x8000)) - continue; - temp_f2 = (temp_f22) -5.0f; - temp_v1_2 = gNearestWaypointByPlayerId[someIndex]; - temp_f0_2 = (player->unk_094 / 18.0f) * 216.0f; - if (temp_f0_2 < temp_f2) { - if (func_80007BF8(temp_v1_2, var_t1, 0U, 0x0014U, D_80164430) > 0) { - temp_a1_2 = temp_v1_2 - var_t1; - sp9C[var_t2] = someIndex; - if (temp_a1_2 > 0) { - spB0[var_t2] = temp_a1_2; - } else { - spB0[var_t2] = (temp_v1_2 + D_80164430) - var_t1; - } - sp74[var_t2] = temp_f2 - temp_f0_2; - var_t2 += 1; - } - } - } - if (var_t2 != 0) { - var_f18 = 1.0f; - var_f20 = -1.0f; - for (someIndex = 0; someIndex < var_t2; someIndex++) { - temp_f2 = D_80163068[sp9C[someIndex]]; - if ((temp_f2 > -1.0f) && (temp_f2 < 1.0f)) { - temp_f12 = sp74[someIndex] + 10.0f; - temp_f12 *= 0.2f * (20.0f / (spB0[someIndex] + 20.0f)); - temp_f12 /= 20.0f; - if ((var_f18 == 1.0f) && (var_f20 == -1.0f)) { - var_f18 = temp_f2 - temp_f12; - var_f20 = temp_f2 + temp_f12; - } else { - temp_f14 = temp_f2 - temp_f12; - temp_f16 = temp_f2 + temp_f12; - if ((temp_f14 < 1.0f) && (temp_f16 > 1.0f)) { - var_f18 = temp_f14; - } - if ((temp_f16 > -1.0f) && (temp_f14 < -1.0f)) { - var_f20 = temp_f16; - } - } - } - } - if (!(var_f20 < var_f18) && !(D_80163068[playerId] < var_f18) && !(var_f20 < D_80163068[playerId])) { - if (var_f20 > 1.0f) { - var_f20 = 1.0f; - } - if (var_f18 < -1.0f) { - var_f18 = -1.0f; - } - if ((var_f18 + 1.0f) < (1.0f - var_f20)) { - D_80163010[playerId] = 0x003C; - D_80162FF8[playerId] = 1; - D_80163090[playerId] = var_f20; - } else { - D_80163010[playerId] = 0x003C; - D_80162FF8[playerId] = 2; - D_80163090[playerId] = var_f18; - } - } - } - } -} -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B140.s") -#endif - -s32 func_8000B7E4(UNUSED s32 arg0, u16 waypointIndex) { - s16 thing = D_801645E0[waypointIndex]; - if (thing > 0) { - return 1; - } - return 0; -} - -s32 func_8000B820(s32 playerIndex) { - f32 value = D_80163068[playerIndex]; - if ((1.1f <= value) || (value <= -1.1f)) { - return 1; - } - return 0; -} - -f32 func_8000B874(f32 posX, f32 posZ, u16 waypointIndex, s32 pathIndex) { - f32 x1; - f32 z1; - f32 x2; - f32 z2; - f32 squaredDistance; - f32 math; - TrackWaypoint* thing1; - TrackWaypoint* thing2; - - thing1 = &D_80164560[pathIndex][waypointIndex]; - thing2 = &D_80164570[pathIndex][waypointIndex]; - - x1 = thing1->posX; - z1 = thing1->posZ; - x2 = thing2->posX; - z2 = thing2->posZ; - - squaredDistance = ((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1)); - if (squaredDistance < 0.01f) { - return 0.0f; - } - math = ((2.0f * ((x2 - x1) * (posX - x1) + (z2 - z1) * (posZ - z1))) / squaredDistance) - 1.0f; - return math; -} - -void func_8000B95C(s32 playerId, u16 waypointIndex, s32 pathIndex) { - UNUSED Vec3f pad; - D_80163068[playerId] = 0.0f; - if ((s32) gKartAICourseMaximumSeparation[gCurrentCourseId] >= 0) { - if ((gPlayers[playerId].type & 0x8000) != 0) { - D_80163068[playerId] = - func_8000B874(gPlayers[playerId].pos[0], gPlayers[playerId].pos[2], waypointIndex, pathIndex); - } - } -} - -void func_8000BA14(u16 waypointIndex, f32 arg1, f32 arg2, s16 pathIndex) { - UNUSED s32 pad[4]; - f32 waypointOneX; - f32 waypointOneZ; - f32 waypointTwoX; - f32 waypointTwoZ; - UNUSED s32 pad2; - f32 xdiff; - f32 zdiff; - f32 distance; - UNUSED f32 temp_f12; - UNUSED f32 temp_f2_2; - UNUSED TrackWaypoint* path; - TrackWaypoint* waypointTwo; - TrackWaypoint* waypointOne; - - waypointOne = &D_80164550[pathIndex][waypointIndex]; - waypointOneX = waypointOne->posX; - waypointOneZ = waypointOne->posZ; - waypointTwo = &D_80164550[pathIndex][(waypointIndex + 1) % D_80164430]; - waypointTwoX = waypointTwo->posX; - waypointTwoZ = waypointTwo->posZ; - zdiff = waypointTwoZ - waypointOneZ; - xdiff = waypointTwoX - waypointOneX; - if (xdiff && xdiff) {} - distance = sqrtf((xdiff * xdiff) + (zdiff * zdiff)); - if (distance < 0.01f) { - D_80162FA0[0] = waypointTwoX; - D_80162FA0[2] = waypointTwoZ; - } else { - D_80162FA0[0] = ((0.5f - (arg1 * 0.5f)) * (((arg2 * zdiff) / distance) + waypointOneX)) + - ((1.0f - (0.5f - (arg1 * 0.5f))) * (((arg2 * -zdiff) / distance) + waypointOneX)); - D_80162FA0[2] = ((0.5f - (arg1 * 0.5f)) * (((arg2 * -xdiff) / distance) + waypointOneZ)) + - ((1.0f - (0.5f - (arg1 * 0.5f))) * (((arg2 * xdiff) / distance) + waypointOneZ)); - } -} - -void func_8000BBD8(u16 waypointIndex, f32 arg1, s16 pathIndex) { - TrackWaypoint* path1; - TrackWaypoint* path2; - f32 x1; - f32 z1; - f32 x3; - f32 z3; - f32 x2; - f32 z2; - f32 x4; - f32 z4; - f32 temp_f0; - f32 temp_f12; - - path1 = &D_80164560[pathIndex][waypointIndex]; - path2 = &D_80164570[pathIndex][waypointIndex]; - - x1 = (f32) path1->posX; - z1 = (f32) path1->posZ; - - x2 = (f32) path2->posX; - z2 = (f32) path2->posZ; - - waypointIndex += 1; - waypointIndex = waypointIndex % gWaypointCountByPathIndex[pathIndex]; - - path1 = &D_80164560[pathIndex][waypointIndex]; - path2 = &D_80164570[pathIndex][waypointIndex]; - - x3 = (f32) path1->posX; - z3 = (f32) path1->posZ; - - x4 = (f32) path2->posX; - z4 = (f32) path2->posZ; - - temp_f0 = 0.5f - (arg1 / 2.0f); - temp_f12 = 1.0f - temp_f0; - D_80162FA0[0] = ((temp_f0 * (x1 + x3)) / 2.0f) + ((temp_f12 * (x2 + x4)) / 2.0f); - D_80162FA0[2] = ((temp_f0 * (z1 + z3)) / 2.0f) + ((temp_f12 * (z2 + z4)) / 2.0f); -} - -s16 func_8000BD94(f32 posX, f32 posY, f32 posZ, s32 pathIndex) { - f32 x_dist; - f32 y_dist; - f32 z_dist; - f32 considerSquaredDistance; - f32 minimumSquaredDistance; - s32 considerWaypointIndex; - s32 pathWaypointCount; - s16 nearestWaypointIndex; - TrackWaypoint* pathWaypoints; - TrackWaypoint* considerWaypoint; - - pathWaypoints = D_80164550[pathIndex]; - pathWaypointCount = gWaypointCountByPathIndex[pathIndex]; - considerWaypoint = &pathWaypoints[0]; - x_dist = (f32) considerWaypoint->posX - posX; - y_dist = (f32) considerWaypoint->posY - posY; - z_dist = (f32) considerWaypoint->posZ - posZ; - minimumSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - nearestWaypointIndex = 0; - for (considerWaypointIndex = 1; considerWaypointIndex < pathWaypointCount; - considerWaypoint++, considerWaypointIndex++) { - x_dist = (f32) considerWaypoint->posX - posX; - y_dist = (f32) considerWaypoint->posY - posY; - z_dist = (f32) considerWaypoint->posZ - posZ; - considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - if (considerSquaredDistance < minimumSquaredDistance) { - nearestWaypointIndex = considerWaypointIndex; - minimumSquaredDistance = considerSquaredDistance; - } - } - return nearestWaypointIndex; -} - -s16 find_closest_waypoint_track_section(f32 posX, f32 posY, f32 posZ, u16 trackSectionId, s32* pathIndex) { - TrackWaypoint* pathWaypoints; - TrackWaypoint* considerWaypoint; - f32 x_dist; - f32 y_dist; - f32 z_dist; - f32 considerSquaredDistance; - f32 minimumSquaredDistance; - s32 considerWaypointIndex; - s32 pathWaypointCount; - s32 temp_t0; - s32 var_a1; - s32 var_t1; - s32 considerPathIndex; - s32 var_t4; - s16 nearestWaypointIndex; - - minimumSquaredDistance = 1000000.0f; - temp_t0 = *pathIndex; - nearestWaypointIndex = 0; - var_t1 = 0; - var_a1 = 0; - pathWaypoints = D_80164550[temp_t0]; - pathWaypointCount = gWaypointCountByPathIndex[temp_t0]; - considerWaypoint = &pathWaypoints[0]; - for (considerWaypointIndex = 0; considerWaypointIndex < pathWaypointCount; - considerWaypointIndex++, considerWaypoint++) { - if ((considerWaypoint->trackSectionId == trackSectionId) || (gCurrentCourseId == COURSE_AWARD_CEREMONY)) { - var_t1 = 1; - x_dist = (f32) considerWaypoint->posX - posX; - y_dist = (f32) considerWaypoint->posY - posY; - z_dist = (f32) considerWaypoint->posZ - posZ; - considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - if (considerSquaredDistance < minimumSquaredDistance) { - nearestWaypointIndex = considerWaypointIndex; - var_a1 = 1; - minimumSquaredDistance = considerSquaredDistance; - } - } - } - if (var_t1 == 0) { - for (considerPathIndex = 0; considerPathIndex < 4; considerPathIndex++) { - if ((considerPathIndex != temp_t0) && (D_80163368[considerPathIndex] >= 2)) { - pathWaypoints = D_80164550[considerPathIndex]; - considerWaypoint = &pathWaypoints[0]; - pathWaypointCount = gWaypointCountByPathIndex[considerPathIndex]; - for (considerWaypointIndex = 0; considerWaypointIndex < pathWaypointCount; - considerWaypointIndex++, considerWaypoint++) { - if (considerWaypoint->trackSectionId == trackSectionId) { - x_dist = (f32) considerWaypoint->posX - posX; - y_dist = (f32) considerWaypoint->posY - posY; - z_dist = (f32) considerWaypoint->posZ - posZ; - considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - if (considerSquaredDistance < minimumSquaredDistance) { - nearestWaypointIndex = considerWaypointIndex; - var_t4 = considerPathIndex; - var_a1 = 2; - minimumSquaredDistance = considerSquaredDistance; - } - } - } - } - } - } - if (var_a1 == 0) { - pathWaypoints = D_80164550[0]; - pathWaypointCount = gWaypointCountByPathIndex[0]; - considerWaypoint = &pathWaypoints[0]; - x_dist = (f32) considerWaypoint->posX - posX; - y_dist = (f32) considerWaypoint->posY - posY; - z_dist = (f32) considerWaypoint->posZ - posZ; - minimumSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - nearestWaypointIndex = 0; - for (considerWaypointIndex = 1; considerWaypointIndex < pathWaypointCount; - considerWaypoint++, considerWaypointIndex++) { - x_dist = (f32) considerWaypoint->posX - posX; - y_dist = (f32) considerWaypoint->posY - posY; - z_dist = (f32) considerWaypoint->posZ - posZ; - considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - if (considerSquaredDistance < minimumSquaredDistance) { - nearestWaypointIndex = considerWaypointIndex; - var_t4 = 0; - var_a1 = 2; - minimumSquaredDistance = considerSquaredDistance; - } - } - } - if (var_a1 == 2) { - *pathIndex = var_t4; - } - return nearestWaypointIndex; -} - -/** - * Tries to find the waypoint nearest to (posX, posY, posZ) - * Only consider waypoints in the same segment as trackSectionId - * Only considers waypoints within 500 units of(posX, posY, posZ) - * Looks 3 waypoints behind and 6 waypoints ahead of waypointIndex - **/ -s16 func_8000C884(f32 posX, f32 posY, f32 posZ, s16 waypointIndex, s32 pathIndex, u16 trackSectionId) { - s16 nearestWaypointIndex; - s16 searchIndex; - s16 considerIndex; - s32 pathWaypointCount; - f32 x_dist; - f32 y_dist; - f32 z_dist; - f32 minimumDistance; - f32 squaredDistance; - TrackWaypoint* pathWaypoints; - TrackWaypoint* considerWaypoint; - - nearestWaypointIndex = -1; - minimumDistance = 250000.0f; - pathWaypointCount = gWaypointCountByPathIndex[pathIndex]; - pathWaypoints = D_80164550[pathIndex]; - for (searchIndex = waypointIndex - 3; searchIndex < waypointIndex + 7; searchIndex++) { - // Its possible for searchIndex to be less than 0 or greater than the number of waypoints in a given path - // This is done to ensure we access D_80164550 at a valid index - considerIndex = (searchIndex + pathWaypointCount) % pathWaypointCount; - considerWaypoint = &pathWaypoints[considerIndex]; - if (considerWaypoint->trackSectionId == trackSectionId) { - x_dist = considerWaypoint->posX - posX; - y_dist = considerWaypoint->posY - posY; - z_dist = considerWaypoint->posZ - posZ; - squaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - if (squaredDistance < minimumDistance) { - minimumDistance = squaredDistance; - nearestWaypointIndex = considerIndex; - } - } - } - return nearestWaypointIndex; -} - -/** - * Tries to find the waypoint nearest to (posX, posY, posZ) - * Only considers waypoints within 400 units of (posX, posY, posZ) - * Looks 3 waypoints behind and 6 waypoints ahead of waypointIndex - **/ -s16 find_closest_waypoint_with_previous_waypoint(f32 posX, f32 posY, f32 posZ, s16 waypointIndex, s32 pathIndex) { - s16 nearestWaypointIndex; - s16 searchIndex; - s16 considerIndex; - s32 waypointFound; - s32 pathWaypointCount; - f32 x_dist; - f32 y_dist; - f32 z_dist; - f32 minimumDistance; - f32 squaredDistance; - TrackWaypoint* pathWaypoints; - TrackWaypoint* considerWaypoint; - - waypointFound = 0; - nearestWaypointIndex = -1; - minimumDistance = 160000.0f; - pathWaypointCount = gWaypointCountByPathIndex[pathIndex]; - pathWaypoints = D_80164550[pathIndex]; - for (searchIndex = waypointIndex - 3; searchIndex < waypointIndex + 7; searchIndex++) { - // Its possible for searchIndex to be less than 0 or greater than the number of waypoints in a given path - // This is done to ensure we access D_80164550 at a valid index - considerIndex = (searchIndex + pathWaypointCount) % pathWaypointCount; - considerWaypoint = &pathWaypoints[considerIndex]; - x_dist = considerWaypoint->posX - posX; - y_dist = considerWaypoint->posY - posY; - z_dist = considerWaypoint->posZ - posZ; - squaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); - if (squaredDistance < minimumDistance) { - minimumDistance = squaredDistance; - nearestWaypointIndex = considerIndex; - waypointFound = 1; - } - } - if (waypointFound == 0) { - for (searchIndex = waypointIndex - 3; searchIndex < waypointIndex + 7; searchIndex++) { - considerIndex = ((searchIndex + pathWaypointCount) % pathWaypointCount); - considerWaypoint = &pathWaypoints[considerIndex]; - /** - * This fake match is done to stop the compiler from optimzing out considerWaypoint. - * Maybe if no waypoint was found some debugging info was printed out, but come - * production time they removed the debug printing but not the loop? - **/ - if (considerWaypoint && considerWaypoint) {}; - } - } - return nearestWaypointIndex; -} - -void func_8000CBA4(UNUSED f32 posX, f32 posY, UNUSED f32 posZ, s16* waypointIndex, UNUSED s32 arg4) { - s16 var_v0; - - var_v0 = *waypointIndex; - if ((gCurrentCourseId == COURSE_WARIO_STADIUM) && (var_v0 >= 0x475) && (var_v0 < 0x480) && (posY < 0.0f)) { - var_v0 = 0x0398; - } - *waypointIndex = var_v0; -} - -void func_8000CBF8(UNUSED f32 posX, UNUSED f32 posY, f32 posZ, s16* waypointIndex, s32 pathIndex) { - s16 temp; - temp = *waypointIndex; - if (temp == 0) { - if (D_8016344C < posZ) { - temp = gWaypointCountByPathIndex[pathIndex] - 1; - } - } else if (((temp + 1) == gWaypointCountByPathIndex[pathIndex]) && (posZ <= D_8016344C)) { - temp = 0; - } - *waypointIndex = temp; -} - -s16 func_8000CC88(f32 posX, f32 posY, f32 posZ, Player* player, s32 playerId, s32* pathIndex) { - u16 trackSectionId; - s16 ret; - - trackSectionId = get_track_section_id(player->collision.meshIndexZX); - if ((trackSectionId <= 0) || (trackSectionId >= 0x33)) { - trackSectionId = D_80163318[playerId]; - } - D_80163318[playerId] = trackSectionId; - ret = find_closest_waypoint_track_section(posX, posY, posZ, trackSectionId, pathIndex); - gPathIndexByPlayerId[playerId] = *pathIndex; - return ret; -} - -s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 waypointIndex, Player* player, s32 playerId, s32 pathIndex) { - s16 newWaypoint; - UNUSED s16 stackPadding0; - UNUSED s32 stackPadding1; - UNUSED s32 stackPadding2; - TrackWaypoint* temp_v1; - - if ((player->type & 0x4000) && !(player->type & 0x1000)) { - newWaypoint = func_8000C884(posX, posY, posZ, waypointIndex, pathIndex, - (u16) get_track_section_id(player->collision.meshIndexZX)); - if (newWaypoint == -1) { - newWaypoint = func_8000CC88(posX, posY, posZ, player, playerId, &pathIndex); - } - } else { - if (D_801631E0[playerId] == 1) { - if (player->unk_0CA & 1) { - temp_v1 = &D_80164550[pathIndex][waypointIndex]; - player->pos[0] = (f32) temp_v1->posX; - player->pos[1] = (f32) temp_v1->posY; - player->pos[2] = (f32) temp_v1->posZ; - player->unk_0CA &= ~0x0001; - return waypointIndex; - } - if (playerId == ((s32) D_80163488 % 8)) { - check_bounding_collision(&player->collision, 10.0f, posX, posY, posZ); - D_80163318[playerId] = get_track_section_id(player->collision.meshIndexZX); - newWaypoint = func_8000C884(posX, posY, posZ, waypointIndex, pathIndex, D_80163318[playerId]); - if (newWaypoint == -1) { - newWaypoint = - find_closest_waypoint_with_previous_waypoint(posX, posY, posZ, waypointIndex, pathIndex); - } - if (newWaypoint == -1) { - newWaypoint = - find_closest_waypoint_track_section(posX, posY, posZ, D_80163318[playerId], &pathIndex); - temp_v1 = &D_80164550[pathIndex][newWaypoint]; - player->pos[0] = (f32) temp_v1->posX; - player->pos[1] = (f32) temp_v1->posY; - player->pos[2] = (f32) temp_v1->posZ; - } - } else { - newWaypoint = find_closest_waypoint_with_previous_waypoint(posX, posY, posZ, waypointIndex, pathIndex); - if (newWaypoint == -1) { - newWaypoint = func_8000BD94(posX, posY, posZ, pathIndex); - temp_v1 = &D_80164550[pathIndex][newWaypoint]; - posX = (f32) temp_v1->posX; - posY = (f32) temp_v1->posY; - posZ = (f32) temp_v1->posZ; - player->pos[0] = posX; - player->pos[1] = posY; - player->pos[2] = posZ; - check_bounding_collision(&player->collision, 10.0f, posX, posY, posZ); - D_80163318[playerId] = get_track_section_id(player->collision.meshIndexZX); - } - } - } else { - newWaypoint = find_closest_waypoint_with_previous_waypoint(posX, posY, posZ, waypointIndex, pathIndex); - if (newWaypoint == -1) { - newWaypoint = func_8000CC88(posX, posY, posZ, player, playerId, &pathIndex); - } - } - func_8000CBA4(posX, posY, posZ, &newWaypoint, pathIndex); - } - func_8000CBF8(posX, posY, posZ, &newWaypoint, pathIndex); - return newWaypoint; -} - -s16 find_closest_vehicles_waypoint(f32 xPos, UNUSED f32 yPos, f32 zPos, s16 waypointIndex) { - f32 xdiff; - f32 zdiff; - f32 minimumDistance; - f32 considerSquaredDistance; - s16 realIndex; - s16 minimumIndex; - s16 considerIndex; - Path2D* considerWaypoint; - - minimumDistance = 250000.0f; - minimumIndex = -1; - for (realIndex = waypointIndex - 2; realIndex < waypointIndex + 7; realIndex++) { - considerIndex = realIndex; - if (realIndex < 0) { - considerIndex = realIndex + gVehicle2DWaypointLength; - } - considerIndex %= gVehicle2DWaypointLength; - considerWaypoint = &gVehicle2DWaypoint[considerIndex]; - xdiff = considerWaypoint->x - xPos; - zdiff = considerWaypoint->z - zPos; - considerSquaredDistance = (xdiff * xdiff) + (zdiff * zdiff); - if (considerSquaredDistance < minimumDistance) { - minimumDistance = considerSquaredDistance; - minimumIndex = considerIndex; - } - } - if (minimumIndex == -1) { - minimumIndex = waypointIndex; - } - return minimumIndex; -} - -s16 func_8000D24C(f32 posX, f32 posY, f32 posZ, s32* pathIndex) { - UNUSED s32 pad; - Collision sp24; - - check_bounding_collision(&sp24, 10.0f, posX, posY, posZ); - return find_closest_waypoint_track_section(posX, posY, posZ, get_track_section_id(sp24.meshIndexZX), pathIndex); -} - -s16 func_8000D2B4(f32 posX, f32 posY, f32 posZ, s16 waypointIndex, s32 pathIndex) { - s16 waypoint; - - waypoint = find_closest_waypoint_with_previous_waypoint(posX, posY, posZ, waypointIndex, pathIndex); - if (waypoint == -1) { - waypoint = func_8000D24C(posX, posY, posZ, &pathIndex); - } - func_8000CBF8(posX, posY, posZ, &waypoint, pathIndex); - return waypoint; -} - -s16 func_8000D33C(f32 posX, f32 posY, f32 posZ, s16 waypointIndex, s32 pathIndex) { - s16 waypoint; - - waypoint = find_closest_waypoint_with_previous_waypoint(posX, posY, posZ, waypointIndex, pathIndex); - if (waypoint == -1) { - waypoint = func_8000D24C(posX, posY, posZ, &pathIndex); - } - return waypoint; -} - -f32 func_8000D3B8(s32 playerId) { - Test* temp_v0; - f32 temp_f0; - f32 var_f2; - - temp_v0 = &D_801634F8[playerId]; - var_f2 = temp_v0->unk0; - temp_f0 = temp_v0->unk4; - if (var_f2 < temp_f0) { - var_f2 += temp_v0->unk8; - if (temp_f0 < var_f2) { - var_f2 = temp_f0; - } - } else if (temp_f0 < var_f2) { - var_f2 -= temp_v0->unk8; - if (var_f2 < temp_f0) { - var_f2 = temp_f0; - } - } - temp_v0->unk0 = var_f2; - return var_f2; -} - -void func_8000D438(s32 arg0, u16 arg1) { - UNUSED s32 stackPadding0; - f32 sp48; - f32 sp44; - UNUSED s32 stackPadding1; - UNUSED s32 stackPadding2; - UNUSED s32 stackPadding3; - f32 stackPadding4; - f32 stackPadding5; - f32 sp2C; - s32 var_a2; - s16 temp_v1; - u16 thing; - - temp_v1 = D_801645E0[arg1]; - var_a2 = 6; - sp2C = func_8000D3B8(arg0); - thing = arg1; - - switch (gCurrentCourseId) { - case COURSE_AWARD_CEREMONY: - var_a2 = 1; - break; - case COURSE_TOADS_TURNPIKE: - var_a2 = 7; - break; - case COURSE_YOSHI_VALLEY: - break; - default: - if (temp_v1 < 6) { - var_a2 = 8; - } else if (temp_v1 >= 0x15) { - var_a2 = 20; - } - break; - } - - if (var_a2 >= 8) { - if ((D_80163068[arg0] > 0.75f) && (D_801631D8[thing] == 0)) { - var_a2 = 7; - } - if ((D_80163068[arg0] < -0.75f) && (D_801631D8[thing] == 1)) { - var_a2 = 7; - } - } - if (func_8000B820(arg0) == 1) { - var_a2 = 5; - } - if (D_80163380[arg0] < var_a2) { - D_80163380[arg0]++; - } - if (var_a2 < D_80163380[arg0]) { - D_80163380[arg0]--; - } - arg1 = (D_80163380[arg0] + arg1) % D_80164430; - func_8000BBD8(arg1, sp2C, D_80163448); - sp48 = D_80162FA0[0]; - sp44 = D_80162FA0[2]; - func_8000BBD8(((arg1 + 1) % D_80164430) & 0xFFFF, sp2C, D_80163448); - stackPadding5 = D_80162FA0[0]; - D_80162FA0[0] = (sp48 + stackPadding5) * 0.5f; - stackPadding4 = D_80162FA0[2]; - D_80162FA0[2] = (sp44 + stackPadding4) * 0.5f; -} - -s16 func_8000D6D0(Vec3f position, s16* waypointIndex, f32 speed, f32 arg3, s16 pathIndex, s16 arg5) { - f32 temp1; - f32 temp2; - f32 midX; - UNUSED s16 stackPadding1; - s16 waypoint1; - s16 waypoint2; - f32 pad3; - f32 midY; - f32 pad4; - f32 midZ; - f32 distance; - f32 oldPosX; - f32 oldPosY; - f32 oldPosZ; - f32 var_f2; - f32 var_f12; - f32 var_f14; - s16 temp_v0; - s32 temp_v1; - f32 xdiff; - f32 ydiff; - f32 zdiff; - Vec3f oldPos; - TrackWaypoint* path; - - path = D_80164550[pathIndex]; - oldPos[0] = position[0]; - oldPos[1] = position[1]; - oldPos[2] = position[2]; - oldPosX = position[0]; - oldPosY = position[1]; - oldPosZ = position[2]; - temp_v0 = func_8000D2B4(oldPosX, oldPosY, oldPosZ, *waypointIndex, (s32) pathIndex); - *waypointIndex = temp_v0; - temp_v1 = temp_v0 + arg5; - waypoint1 = temp_v1 % gWaypointCountByPathIndex[pathIndex]; - waypoint2 = (temp_v1 + 1) % gWaypointCountByPathIndex[pathIndex]; - func_8000BBD8(waypoint1, arg3, pathIndex); - pad3 = D_80162FA0[0]; - pad4 = D_80162FA0[2]; - func_8000BBD8(waypoint2, arg3, pathIndex); - temp1 = D_80162FA0[0]; - temp2 = D_80162FA0[2]; - midY = (path[waypoint1].posY + path[waypoint2].posY) * 0.5f; - midX = (pad3 + temp1) * 0.5f; - midZ = (pad4 + temp2) * 0.5f; - xdiff = midX - oldPosX; - ydiff = midY - oldPosY; - zdiff = midZ - oldPosZ; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance > 0.01f) { - var_f2 = ((xdiff * speed) / distance) + oldPosX; - var_f12 = ((ydiff * speed) / distance) + oldPosY; - var_f14 = ((zdiff * speed) / distance) + oldPosZ; - } else { - var_f2 = oldPosX; - var_f12 = oldPosY; - var_f14 = oldPosZ; - } - position[0] = var_f2; - position[1] = var_f12; - position[2] = var_f14; - return get_angle_between_waypoints(oldPos, position); -} - -s16 func_8000D940(Vec3f pos, s16* waypointIndex, f32 speed, f32 arg3, s16 pathIndex) { - UNUSED f32 pad; - f32 thing1; - f32 thing2; - UNUSED s16 stackPadding1; - s16 waypoint1; - s16 waypoint2; - UNUSED s16 stackPadding2; - f32 pad2; - f32 midX; - f32 pad3; - f32 midY; - f32 midZ; - f32 distance; - f32 temp_f20; - f32 temp_f22; - f32 temp_f24; - f32 var_f2; - f32 var_f12; - f32 var_f14; - s16 temp_v0; - f32 xdiff; - f32 ydiff; - f32 zdiff; - s32 waypointCount; - Vec3f sp54; - - sp54[0] = pos[0]; - sp54[1] = pos[1]; - sp54[2] = pos[2]; - waypointCount = gWaypointCountByPathIndex[pathIndex]; - temp_f20 = pos[0]; - temp_f22 = pos[1]; - temp_f24 = pos[2]; - temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *waypointIndex, (s32) pathIndex); - *waypointIndex = temp_v0; - waypoint1 = ((temp_v0 + waypointCount) - 3) % waypointCount; - waypoint2 = ((temp_v0 + waypointCount) - 4) % waypointCount; - func_8000BBD8(waypoint1, arg3, pathIndex); - pad2 = D_80162FA0[0]; - pad3 = D_80162FA0[2]; - func_8000BBD8(waypoint2, arg3, pathIndex); - thing1 = D_80162FA0[0]; - thing2 = D_80162FA0[2]; - midY = (D_80164550[pathIndex][waypoint1].posY + D_80164550[pathIndex][waypoint2].posY) * 0.5f; - midX = (pad2 + thing1) * 0.5f; - midZ = (pad3 + thing2) * 0.5f; - xdiff = midX - temp_f20; - ydiff = midY - temp_f22; - zdiff = midZ - temp_f24; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance > 0.01f) { - var_f2 = ((xdiff * speed) / distance) + temp_f20; - var_f12 = ((ydiff * speed) / distance) + temp_f22; - var_f14 = ((zdiff * speed) / distance) + temp_f24; - } else { - var_f2 = temp_f20; - var_f12 = temp_f22; - var_f14 = temp_f24; - } - pos[0] = var_f2; - pos[1] = var_f12; - pos[2] = var_f14; - return get_angle_between_waypoints(sp54, pos); -} - -s16 update_vehicle_following_waypoint(Vec3f pos, s16* waypointIndex, f32 speed) { - f32 origXPos; - f32 origYPos; - f32 origZPos; - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; - UNUSED s32 stackPadding2; - UNUSED s32 stackPadding3; - UNUSED s32 stackPadding4; - UNUSED s32 stackPadding5; - UNUSED s32 stackPadding6; - UNUSED s32 stackPadding7; - UNUSED s32 stackPadding8; - f32 farWaypointAverageX; - f32 farWaypointAverageZ; - f32 x_dist; - f32 y_dist; - f32 distance; - f32 newX; - f32 newZ; - s16 newWaypointIndex; - s16 farWaypoint1; - s16 farWaypoint2; - Path2D* temp_a0; - Path2D* temp_a2; - Vec3f sp38; - - origXPos = pos[0]; - origYPos = pos[1]; - origZPos = pos[2]; - sp38[0] = pos[0]; - sp38[1] = pos[1]; - sp38[2] = pos[2]; - newWaypointIndex = find_closest_vehicles_waypoint(origXPos, origYPos, origZPos, *waypointIndex); - *waypointIndex = newWaypointIndex; - farWaypoint1 = (newWaypointIndex + 3) % gVehicle2DWaypointLength; - farWaypoint2 = (newWaypointIndex + 4) % gVehicle2DWaypointLength; - temp_a0 = &gVehicle2DWaypoint[farWaypoint1]; - temp_a2 = &gVehicle2DWaypoint[farWaypoint2]; - farWaypointAverageX = (temp_a0->x + temp_a2->x) * 0.5f; - farWaypointAverageZ = (temp_a0->z + temp_a2->z) * 0.5f; - x_dist = farWaypointAverageX - origXPos; - y_dist = farWaypointAverageZ - origZPos; - distance = sqrtf((x_dist * x_dist) + (y_dist * y_dist)); - if (distance > 0.01f) { - newX = ((x_dist * speed) / distance) + origXPos; - newZ = ((y_dist * speed) / distance) + origZPos; - } else { - newX = origXPos; - newZ = origZPos; - } - pos[0] = newX; - pos[1] = origYPos; - pos[2] = newZ; - return get_angle_between_waypoints(sp38, pos); -} - -void set_bomb_kart_spawn_positions(void) { - UNUSED Collision* var_s2; - f32 startingXPos; - f32 startingZPos; - f32 startingYPos; - s32 var_s3; - TrackWaypoint* temp_v0; - UNUSED BombKart* var_s0; - BombKartSpawn* bombKartSpawn; - - for (var_s3 = 0; var_s3 < NUM_BOMB_KARTS_VERSUS; var_s3++) { - bombKartSpawn = &gBombKartSpawns[gCurrentCourseId][var_s3]; - switch (gCurrentCourseId) { - case COURSE_YOSHI_VALLEY: - startingXPos = bombKartSpawn->startingXPos; - startingZPos = bombKartSpawn->startingZPos; - startingYPos = spawn_actor_on_surface(startingXPos, 2000.0f, startingZPos); - break; - case COURSE_AWARD_CEREMONY: - temp_v0 = &D_80164550[3][bombKartSpawn->waypointIndex]; - startingXPos = temp_v0->posX; - startingYPos = temp_v0->posY; - startingZPos = temp_v0->posZ; - break; - default: - temp_v0 = &D_80164550[0][bombKartSpawn->waypointIndex]; - startingXPos = temp_v0->posX; - startingYPos = temp_v0->posY; - startingZPos = temp_v0->posZ; - break; - } - gBombKarts[var_s3].bombPos[0] = startingXPos; - gBombKarts[var_s3].bombPos[1] = startingYPos; - gBombKarts[var_s3].bombPos[2] = startingZPos; - gBombKarts[var_s3].wheel1Pos[0] = startingXPos; - gBombKarts[var_s3].wheel1Pos[1] = startingYPos; - gBombKarts[var_s3].wheel1Pos[2] = startingZPos; - gBombKarts[var_s3].wheel2Pos[0] = startingXPos; - gBombKarts[var_s3].wheel2Pos[1] = startingYPos; - gBombKarts[var_s3].wheel2Pos[2] = startingZPos; - gBombKarts[var_s3].wheel3Pos[0] = startingXPos; - gBombKarts[var_s3].wheel3Pos[1] = startingYPos; - gBombKarts[var_s3].wheel3Pos[2] = startingZPos; - gBombKarts[var_s3].wheel4Pos[0] = startingXPos; - gBombKarts[var_s3].wheel4Pos[1] = startingYPos; - gBombKarts[var_s3].wheel4Pos[2] = startingZPos; - gBombKarts[var_s3].waypointIndex = bombKartSpawn->waypointIndex; - gBombKarts[var_s3].unk_3C = bombKartSpawn->unk_04; - gBombKarts[var_s3].bounceTimer = 0; - gBombKarts[var_s3].circleTimer = 0; - gBombKarts[var_s3].state = bombKartSpawn->startingState; - gBombKarts[var_s3].unk_4A = 0; - gBombKarts[var_s3].unk_4C = 1; - gBombKarts[var_s3].yPos = startingYPos; - check_bounding_collision(&D_80164038[var_s3], 2.0f, startingXPos, startingYPos, startingZPos); - } -} - -void func_8000DF8C(s32 bombKartId) { - UNUSED s32 stackPadding0; - f32 sp118; - f32 var_f18; - TrackWaypoint* temp_v0_2; - f32 temp_f0_3; - f32 sp108; - UNUSED s32 stackPadding1; - UNUSED s32 stackPadding2; - UNUSED s32 stackPadding3; - f32 temp_f14; - UNUSED s32 stackPadding4; - f32 temp_f16; - UNUSED s32 stackPadding5; - UNUSED s32 stackPadding6; - UNUSED s32 stackPadding7; - UNUSED s32 stackPadding8; - UNUSED s32 stackPadding9; - UNUSED s32 stackPaddingA; - UNUSED s32 stackPaddingB; - f32 temp_f0; - f32 temp_f0_4; - u16 spCA; - f32 spC4; - u16 spC2; - f32 temp_f12; - f32 temp_f12_3; - f32 temp_f12_4; - f32 temp_f14_2; - f32 spAC; - UNUSED s32 stackPaddingC; - f32 temp_f16_2; - f32 spA0; - f32 temp_f2; - f32 temp_f2_4; - f32 sp94; - UNUSED s32 stackPaddingD; - f32 var_f20; - f32 sp88; - f32 var_f22; - f32 var_f24; - u16 sp7E; - u16 sp7C; - UNUSED u16 sp4C; - u16 temp_t6; - u16 temp_t7; - u16 var_s1; - s32 var_a0; - UNUSED s32 stackPaddingE; - TrackWaypoint* temp_v0_4; - BombKart* bombKart; - BombKart* bombKart2; - Collision* temp_a0_4; - Player* var_v0; - - bombKart = &gBombKarts[bombKartId]; - - sp7E = bombKart->state; - - if (sp7E == 0) { - return; - } - - if (((bombKart->unk_4A != 1) || (gCurrentCourseId == COURSE_AWARD_CEREMONY))) { - var_f22 = bombKart->bombPos[0]; - var_f20 = bombKart->bombPos[1]; - var_f24 = bombKart->bombPos[2]; - spCA = bombKart->waypointIndex; - spC4 = bombKart->unk_3C; - spC2 = bombKart->someRot; - sp7C = bombKart->bounceTimer; - var_s1 = bombKart->circleTimer; - if ((sp7E != 0) && (sp7E != 4)) { - if (1) {} - if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { - if (D_8016347E == 1) { - var_v0 = gPlayerFour; - temp_f0 = var_f22 - var_v0->pos[0]; - temp_f2 = var_f20 - var_v0->pos[1]; - temp_f12 = var_f24 - var_v0->pos[2]; - if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) { - var_s1 = 0; - sp7E = 4; - var_v0->soundEffects |= 0x400000; - var_v0->type &= ~0x2000; - } - } - } else { - - for (var_a0 = 0; var_a0 < gPlayerCount; var_a0++) { - var_v0 = &gPlayers[var_a0]; - if (!(var_v0->effects & 0x80000000)) { - temp_f0 = var_f22 - var_v0->pos[0]; - temp_f2 = var_f20 - var_v0->pos[1]; - temp_f12 = var_f24 - var_v0->pos[2]; - if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) { - sp7E = 4; - var_s1 = 0; - if (gCurrentCourseId == COURSE_FRAPPE_SNOWLAND) { - var_v0->soundEffects |= 0x01000000; - } else { - var_v0->soundEffects |= 0x400000; - } - } - } - } - } - } - switch (sp7E) { - case 1: - var_s1 = (var_s1 + 356) % 360; - temp_t6 = (var_s1 * 0xFFFF) / 360; - sp118 = coss(temp_t6) * 25.0; - temp_f0_3 = sins(temp_t6) * 25.0; - temp_v0_2 = &D_80164550[0][spCA]; - var_f22 = temp_v0_2->posX + sp118; - var_f20 = bombKart->yPos + 3.5f; - var_f24 = temp_v0_2->posZ + temp_f0_3; - D_80162FB0[0] = var_f22; - D_80162FB0[1] = var_f20; - D_80162FB0[2] = var_f24; - temp_t7 = (((var_s1 + 1) % 360) * 0xFFFF) / 360; - sp118 = coss(temp_t7) * 25.0; - temp_f0_3 = sins(temp_t7) * 25.0; - D_80162FC0[0] = temp_v0_2->posX + sp118; - D_80162FC0[1] = temp_v0_2->posY; - D_80162FC0[2] = temp_v0_2->posZ + temp_f0_3; - spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; - break; - case 2: - var_s1 = (var_s1 + 4) % 360; - temp_t6 = (var_s1 * 0xFFFF) / 360; - sp118 = coss(temp_t6) * 25.0; - temp_f0_3 = sins(temp_t6) * 25.0; - temp_v0_2 = &D_80164550[0][spCA]; - var_f22 = temp_v0_2->posX + sp118; - var_f20 = bombKart->yPos + 3.5f; - var_f24 = temp_v0_2->posZ + temp_f0_3; - D_80162FB0[0] = var_f22; - D_80162FB0[1] = var_f20; - D_80162FB0[2] = var_f24; - temp_t7 = (((var_s1 + 1) % 360) * 0xFFFF) / 360; - sp118 = coss(temp_t7) * 25.0; - temp_f0_3 = sins(temp_t7) * 25.0; - D_80162FC0[0] = temp_v0_2->posX + sp118; - D_80162FC0[1] = temp_v0_2->posY; - D_80162FC0[2] = temp_v0_2->posZ + temp_f0_3; - spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; - break; - case 3: - var_f20 = bombKart->yPos + 3.5f; - spC2 = 0; - break; - - case 5: - if ((D_8016347C == 0) || (gNearestWaypointByPlayerId[3] < 5)) { - break; - } else { - spCA = func_8000D2B4(var_f22, var_f20, var_f24, spCA, 3); - if ((spCA < 0) || (gWaypointCountByPathIndex[3] < spCA)) { - spCA = 0; - } - if (((s32) spCA) < 0x1A) { - temp_v0_2 = &D_80164550[3][(spCA + 1) % gWaypointCountByPathIndex[3]]; - D_80162FB0[0] = temp_v0_2->posX; - D_80162FB0[1] = temp_v0_2->posY; - D_80162FB0[2] = temp_v0_2->posZ; - temp_v0_4 = &D_80164550[3][(spCA + 2) % gWaypointCountByPathIndex[3]]; - D_80162FC0[0] = temp_v0_4->posX; - D_80162FC0[1] = temp_v0_4->posY; - D_80162FC0[2] = temp_v0_4->posZ; - spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; - } else { - D_80162FB0[0] = var_f22; - D_80162FB0[1] = var_f20; - D_80162FB0[2] = var_f24; - D_80162FC0[0] = -2409.197f; - D_80162FC0[1] = 0.0f; - D_80162FC0[2] = -355.254f; - spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; - } - temp_f14 = ((D_80162FB0[0] + D_80162FC0[0]) * 0.5f) - var_f22; - temp_f16 = ((D_80162FB0[2] + D_80162FC0[2]) * 0.5f) - var_f24; - temp_f0_4 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16)); - if (temp_f0_4 > 0.01f) { - var_f22 += (bombKart->unk_3C * temp_f14) / temp_f0_4; - var_f24 += (bombKart->unk_3C * temp_f16) / temp_f0_4; - } else { - var_f22 += temp_f14 / 5.0f; - var_f24 += temp_f16 / 5.0f; - } - temp_a0_4 = &D_80164038[bombKartId]; - var_f20 = calculate_surface_height(var_f22, 2000.0f, var_f24, temp_a0_4->meshIndexZX) + 3.5f; - if (var_f20 < (-1000.0)) { - var_f20 = bombKart->bombPos[1]; - } - check_bounding_collision(temp_a0_4, 10.0f, var_f22, var_f20, var_f24); - } - break; - case 4: - temp_v0_2 = &D_80164550[0][spCA]; - D_80162FB0[0] = temp_v0_2->posX; - D_80162FB0[1] = temp_v0_2->posY; - D_80162FB0[2] = temp_v0_2->posZ; - temp_v0_4 = &D_80164550[0][(spCA + 1) % gWaypointCountByPathIndex[0]]; - D_80162FC0[0] = temp_v0_4->posX; - D_80162FC0[1] = temp_v0_4->posY; - D_80162FC0[2] = temp_v0_4->posZ; - var_f20 += 3.0f - (var_s1 * 0.3f); - spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; - break; - default: - break; - } - - if (sp7E == 4) { - sp108 = 2.0f * var_s1; - sp118 = coss(0xFFFF - spC2) * var_s1; - var_f18 = sins(0xFFFF - spC2) * var_s1; - var_s1++; - temp_f2_4 = (var_f20 - 2.3f) + (sp108 / 3.0f); - spAC = temp_f2_4; - spA0 = temp_f2_4; - sp94 = temp_f2_4; - sp88 = temp_f2_4; - if (var_s1 >= 31) { - sp7E = 0; - } - } else { - sp118 = coss(0xFFFF - spC2) * 1.5f; - var_f18 = sins(0xFFFF - spC2) * 1.5f; - temp_f16_2 = var_f20 - 2.3f; - temp_f12_3 = (sp7C % 3) * 0.15f; - temp_f14_2 = temp_f16_2 - temp_f12_3; - temp_f12_4 = temp_f16_2 + temp_f12_3; - spAC = temp_f14_2; - sp94 = temp_f14_2; - spA0 = temp_f12_4; - sp88 = temp_f12_4; - var_f20 += sins((sp7C * 0x13FFEC) / 360); - sp7C = (sp7C + 1) % 18; - } - bombKart2 = bombKart; - bombKart2->wheel1Pos[0] = (sp118 - var_f18) + var_f22; - bombKart2->wheel1Pos[1] = spAC; - bombKart2->wheel1Pos[2] = (var_f18 + sp118) + var_f24; - bombKart2->wheel2Pos[0] = (var_f18 + sp118) + var_f22; - bombKart2->wheel2Pos[1] = spA0; - bombKart2->wheel2Pos[2] = (var_f18 - sp118) + var_f24; - bombKart2->wheel3Pos[0] = ((-sp118) - var_f18) + var_f22; - bombKart2->wheel3Pos[1] = sp94; - bombKart2->wheel3Pos[2] = ((-var_f18) + sp118) + var_f24; - bombKart2->wheel4Pos[0] = ((-sp118) + var_f18) + var_f22; - bombKart2->wheel4Pos[1] = sp88; - bombKart2->wheel4Pos[2] = ((-var_f18) - sp118) + var_f24; - bombKart2->bombPos[0] = var_f22; - bombKart2->bombPos[1] = var_f20; - bombKart2->bombPos[2] = var_f24; - bombKart2->waypointIndex = spCA; - bombKart2->unk_3C = spC4; - bombKart2->someRot = spC2; - bombKart2->state = sp7E; - bombKart2->bounceTimer = sp7C; - bombKart2->circleTimer = var_s1; - } -} - -s32 add_actor_in_unexpired_actor_list(s32 actorIndex, s16 arg1) { - s32 i; - s32 a2 = 0; - - for (i = 0; i < NUM_PLAYERS; i++) { - - if (gUnexpiredActorsList[i].unkC == 0) { - gUnexpiredActorsList[i].unkC = 1; - gUnexpiredActorsList[i].actorIndex = actorIndex; - gUnexpiredActorsList[i].unk10 = arg1; - gUnexpiredActorsList[i].unk14 = 0; - a2 = 1; - break; - } - } - if (a2 == 0) { - return -2; - } - return 0; -} - -s32 add_red_shell_in_unexpired_actor_list(s32 actorIndex) { - struct Actor* actor = &gActorList[actorIndex]; - if (actor->type != ACTOR_RED_SHELL) { - return -1; - } - return add_actor_in_unexpired_actor_list(actorIndex, 0); -} - -s32 add_green_shell_in_unexpired_actor_list(s32 actorIndex) { - struct Actor* actor = &gActorList[actorIndex]; - if (actor->type != ACTOR_GREEN_SHELL) { - return -1; - } - return add_actor_in_unexpired_actor_list(actorIndex, 1); -} - -s32 add_blue_shell_in_unexpired_actor_list(s32 arg0) { - struct Actor* actor = &gActorList[arg0]; - if (actor->type != ACTOR_BLUE_SPINY_SHELL) { - return -1; - } - return add_actor_in_unexpired_actor_list(arg0, 2); -} - -void delete_actor_in_unexpired_actor_list(s32 actorIndex) { - struct unexpiredActors* phi; - s32 i; - - for (i = 0; i < NUM_PLAYERS; i++) { - phi = &gUnexpiredActorsList[i]; - if (actorIndex == phi->actorIndex) { - phi->unkC = 0; - phi->actorIndex = 1000; // out of bounds - } - } -} - -void func_8000EEDC(void) { - struct unexpiredActors* phi; - s32 i; - - for (i = 0; i < NUM_PLAYERS; i++) { - phi = &gUnexpiredActorsList[i]; - phi->unkC = 0; - phi->actorIndex = 1000; // out of bounds - } -} - -void generate_player_smoke(void) { - s32 someIndex; - f32 var_f20; - struct Actor* temp_s1; - struct unexpiredActors* var_s0; - - for (someIndex = 0; someIndex < NUM_PLAYERS; someIndex++) { - var_s0 = &gUnexpiredActorsList[someIndex]; - if (var_s0->unkC == 1) { - temp_s1 = &gActorList[var_s0->actorIndex]; - var_s0->unk14++; - switch (var_s0->unk10) { - case 0: - if (var_s0->unk14 < 0xA) { - var_f20 = 0.3f; - } else { - var_f20 = 0.9f; - } - break; - case 1: - if (var_s0->unk14 < 0xA) { - var_f20 = 0.15f; - } else { - var_f20 = 0.45f; - } - break; - case 2: - if (var_s0->unk14 < 0xA) { - var_f20 = 0.15f; - } else { - var_f20 = 0.45f; - } - break; - default: - var_f20 = 1.0f; - break; - } - if (!(var_s0->unk14 & 1)) { - init_smoke_particle(temp_s1->pos, ((random_int(30) + 20) * var_f20) / 50.0f, var_s0->unk10); - } - } - } -} - -void func_8000F0E0(void) { - s32 i; - for (i = 0; i < 4; i++) { - D_80164670[i] = 0; - D_80164678[i] = 0; - } -} - -void func_8000F124(void) { - s32 var_a1; - s32 i, j; - - for (j = 0; j < 2; j++) { - D_80163348[j] = 0; - } - - if (gDemoMode == 1) { - return; - } - if (gModeSelection != GRAND_PRIX) { - return; - } - - for (i = 0; i < 2; i++) { - - while (1) { - D_80163348[i] = random_int(8); - - if (gPlayerCount > 2) { - break; - } - if (gPlayerCount < 1) { - break; - } - - var_a1 = 0; - - for (j = 0; j < gPlayerCount; j++) { - if (gCharacterSelections[j] == D_80163348[i]) { - var_a1 = 1; - } - } - for (j = 0; j < i; j++) { - if (D_80163348[j] == D_80163348[i]) { - var_a1 = 1; - } - } - if (var_a1 == 0) { - break; - } - } - } -} - -// Delete track waypoints -void func_8000F2BC(TrackWaypoint* arg0, size_t size) { - bzero((void*) arg0, size * sizeof(TrackWaypoint)); -} - -// Appears to allocate memory for each course. -void func_8000F2DC(void) { - - struct _struct_gCoursePathSizes_0x10* ptr = &gCoursePathSizes[gCurrentCourseId]; - s32 temp; - s32 i; - - D_80163368[0] = (s32) ptr->unk0; - D_80163368[1] = (s32) ptr->unk2; - D_80163368[2] = (s32) ptr->unk4; - D_80163368[3] = (s32) ptr->unk6; - - temp = ptr->unk8; - gVehicle2DWaypoint = get_next_available_memory_addr(temp * 4); - - // Podium ceremony appears to allocate 1 * 8 bytes of data. Which would be aligned to 0x10. - for (i = 0; i < 4; i++) { - D_80164550[i] = get_next_available_memory_addr(D_80163368[i] * 8); - D_80164560[i] = get_next_available_memory_addr(D_80163368[i] * 8); - D_80164570[i] = get_next_available_memory_addr(D_80163368[i] * 8); - D_80164580[i] = get_next_available_memory_addr(D_80163368[i] * 2); - D_80164590[i] = get_next_available_memory_addr(D_80163368[i] * 2); - D_801645A0[i] = get_next_available_memory_addr(D_80163368[i] * 2); - } - - D_80164490 = D_80164550[0]; - D_801631D0 = D_80164560[0]; - D_801631D4 = D_80164570[0]; - D_801631D8 = D_80164580[0]; - D_801631DC = D_80164590[0]; - D_801645E0 = D_801645A0[0]; - - // zero allocated memory? - //! @warning does not appear to zero all the above allocated variables. - for (i = 0; i < 4; i++) { - func_8000F2BC(D_80164550[i], D_80163368[i]); - func_8000F2BC(D_80164560[i], D_80163368[i]); - func_8000F2BC(D_80164570[i], D_80163368[i]); - } - - // Skip several cpu cycles. - for (i = 0; i < 4; i++) {} - - for (i = 0; i < 4; i++) { - if (D_80163368[i] >= 2) { - func_800100F0(i); - func_80010218(i); - func_800107C4(i); - func_80010DBC(i); - func_80010E6C(i); - } - } - - D_80164430 = *gWaypointCountByPathIndex; - switch (gCurrentCourseId) { - case COURSE_KALAMARI_DESERT: - generate_train_waypoints(); - init_vehicles_trains(); - break; - case COURSE_DK_JUNGLE: - generate_ferry_waypoints(); - init_vehicles_ferry(); - break; - case COURSE_TOADS_TURNPIKE: - init_vehicles_box_trucks(); - init_vehicles_school_buses(); - init_vehicles_trucks(); - init_vehicles_cars(); - break; - } - set_bomb_kart_spawn_positions(); - func_8000EEDC(); -} - -void func_8000F628(void) { - - UNUSED Camera* camera; - s32 temp_v0_3; - s32 i; - Test* var_s5; - UNUSED s32 temp_v1; - UNUSED s32 pad; - - for (i = 0; i < NUM_PLAYERS; i++) { - Player* player = &gPlayerOne[i]; - - D_80163050[i] = 0; - D_80162FF8[i] = 0; - D_80163010[i] = 0; - if (gCurrentCourseId < (NUM_COURSES - 1)) { - func_8000B95C(i, 0, 0); - } - D_80163028[i] = *(f32*) segmented_to_virtual_dupe_2(&D_0D009418[gCurrentCourseId][gCCSelection]); - D_801630E8[i] = 0; - D_80163100[i] = 0; - D_80163178[i] = 0.0f; - D_801631A0[i] = 0.0f; - D_80163210[i] = 0.0f; - gLapCountByPlayerId[i] = -1; - gCourseCompletionPercentByPlayerId[i] = 0.0f; - gTimePlayerLastTouchedFinishLine[i] = 0.0f; - if (gModeSelection == GRAND_PRIX) { - if (1) {}; - if (1) {}; // Maybe some debug code? - gGPCurrentRaceRankByPlayerId[i] = (s32) D_80165270[i]; - D_801643E0[i] = (s32) D_80165270[i]; - } else { - gGPCurrentRaceRankByPlayerId[i] = i; - D_801643E0[i] = i; - } - temp_v0_3 = gGPCurrentRaceRankByPlayerId[i]; - gGPCurrentRacePlayerIdByRank[temp_v0_3] = (s16) i; - D_80164378[temp_v0_3] = (s16) i; - D_80164408[i] = temp_v0_3; - D_80163258[i] = 0; - D_80163270[i] = 0; - D_801631E0[i] = 0; - D_801631F8[i] = 0; - D_80164450[i] = -20; - D_80163288[i] = -20; - D_80164478[gPlayers[i].characterId] = (s16) i; - D_80163068[i] = 0.0f; - D_80163090[i] = 0.0f; - var_s5 = &D_801634F8[i]; - var_s5->unkC = gKartAICourseMinimumSeparation[gCurrentCourseId] * (f32) (((i + 1) % 3) - 1); - var_s5->unk4 = var_s5->unkC; - var_s5->unk0 = 0.0f; - var_s5->unk8 = 0.015f; - reset_kart_ai_behaviour_none(i); - gSpeedKartAIBehaviour[i] = 0; - D_801644F8[i] = 0; - D_80163398[i] = 0; - D_801633B0[i] = 0; - D_801633C8[i] = 0; - D_801633F8[i] = 0; - D_80163318[i] = 0; - D_80163450[i] = player->pos[2]; - D_80163380[i] = 6; - if (gPlayers[i].type & PLAYER_HUMAN) { - D_80163330[i] = 3; - - } else { - D_80163330[i] = 0; - } - - D_80163490[i] = 0; - D_801634A8[i] = 0; - D_80163128[i] = -1; - D_80163150[i] = -1; - D_80164538[i] = -1; - D_801634C0[i] = 0; - bStopAICrossing[i] = 0; - D_801630B8[i] = 1; - } - -#ifdef AVOID_UB - for (i = 0; i < NUM_CROSSINGS; i++) { - sCrossingActiveTimer[i] = 0; - } -#else - sCrossingActiveTimer[0] = 0; - sCrossingActiveTimer[1] = 0; -#endif - if (gDemoMode == DEMO_MODE_INACTIVE) { - - if (gModeSelection == GRAND_PRIX) { - for (i = 0; i < 2; i++) { - D_80163344[i] = D_80164478[D_80163348[i]]; - D_80163330[D_80163344[i]] = 1; - D_8016334C[D_80163344[i]] = i; - } - } - } - if ((D_8018EE08 == 1) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { - for (i = 0; i < NUM_PLAYERS; i++) { - D_80163330[i] = 0; - } - if (gModeSelection == VERSUS) { - - D_80163344[0] = cameras->playerId; - D_80163330[D_80163344[0]] = 1; - D_8016334C[D_80163344[0]] = 0; - - for (i = 1; i < 2; i++) { - D_80163344[i] = cameras[i].playerId; - D_80163330[D_80163344[i]] = 1; - D_8016334C[D_80163344[i]] = i; - } - } - } - - for (i = 0; i < NUM_PLAYERS; i++) { - if (1) {}; - gPathIndexByPlayerId[i] = 0; - gNearestWaypointByPlayerId[i] = - gWaypointCountByPathIndex[gPathIndexByPlayerId[i]] - gGPCurrentRaceRankByPlayerId[i] - 4; - } - - D_8016347A = 0; - if (gCCSelection == CC_EXTRA) { - D_8016347A = 1; - } - - for (i = 0; i < 30; i++) { - D_80162F10[i] = -1; - D_80162F50[i] = -1; - } - - D_801631CC = 100000; // 100,000 - D_80164698 = 0.0f; - D_8016469C = 100.0f; - D_801646A0 = 0.0f; - D_80164358 = 0; - D_8016435A = 1; - D_8016435C = 1; - D_80163478 = 0; - D_80163378 = 0; - D_8016337C = 0; - D_8016344C = (f32) D_80164550[0][0].posZ; // [i][2] - D_801634F0 = 0; - D_801634F4 = 0; - D_80163488 = 0; - D_8016348C = 0; - D_801634EC = 0; - func_8001AB00(); - if (D_8018EE08 == 1) { - if (gDemoMode == 1) { - - for (i = 0; i < NUM_PLAYERS; i++) { - if (D_80163330[i] == 1) { - gPlayers[i].soundEffects |= 0x02000000; - } - } - } - } - copy_courses_kart_ai_behaviour(); -} - -// @arg index from 0 to 3. - -// Processes course path by index. -// @arg index from 0 to 3. -// Each course can have 1-4 course paths. -void func_800100F0(s32 pathIndex) { - - TrackWaypoint* ptr; - TrackWaypoint* pathDest; - TrackWaypoint* path; - s32 var_v0; - s32 sp24; - UNUSED s32 pad[2]; - s16 bInvalidPath; - s32 i; - - // cast required - if ((s32) gKartAICourseMaximumSeparation[gCurrentCourseId] >= 0) { - pathDest = D_80164550[pathIndex]; - bInvalidPath = 1; - if (gCurrentCourseId != COURSE_AWARD_CEREMONY) { - var_v0 = process_path_data(pathDest, - segmented_to_virtual_dupe_2(gCoursePathTable2[gCurrentCourseId][pathIndex])); - gWaypointCountByPathIndex[pathIndex] = (u16) var_v0; - } else { - // Course path included in course_data which has already been loaded into memory. - // This is how we get the addr to our path data. - path = segmented_to_virtual_dupe_2(gCoursePathTable[gCurrentCourseId][pathIndex]); - ptr = path; - - for (i = 0; i < 3000; i++, ptr++) { - if ((u16) ptr->posX == 0x8000) { - sp24 = i - 1; - bInvalidPath = 0; - break; - } - } - - // If path data higher than 3000 something has gone wrong. - // Skip processing the data. - //! @todo Confirm this comment - if (!bInvalidPath) { - var_v0 = func_80011014(pathDest, path, sp24, pathIndex); - gWaypointCountByPathIndex[pathIndex] = (u16) var_v0; - } - } - } -} - -void func_80010218(s32 pathIndex) { - f32 waypointWidth; - f32 x1; - f32 y1; - f32 z1; - f32 x2; - f32 y2; - f32 z2; - f32 x_dist; - f32 z_dist; - f32 neg_x_dist; - f32 neg_z_dist; - f32 xz_dist; - s32 temp_f16; - s32 waypointIndex; - TrackWaypoint* waypoint; - TrackWaypoint* nextWaypoint; - TrackWaypoint* var_s1; - TrackWaypoint* var_s2; - - if (((s32) gKartAICourseMaximumSeparation[gCurrentCourseId]) >= 0) { - waypointWidth = gKartAICourseMaximumSeparation[gCurrentCourseId]; - waypoint = &D_80164550[pathIndex][0]; - var_s1 = &D_80164560[pathIndex][0]; - var_s2 = &D_80164570[pathIndex][0]; - for (waypointIndex = 0; waypointIndex < gWaypointCountByPathIndex[pathIndex]; - waypointIndex++, var_s1++, var_s2++) { - x1 = waypoint->posX; - y1 = waypoint->posY; - z1 = waypoint->posZ; - waypoint++; - nextWaypoint = &D_80164550[pathIndex][(waypointIndex + 1) % ((s32) gWaypointCountByPathIndex[pathIndex])]; - x2 = nextWaypoint->posX; - y2 = nextWaypoint->posY; - z2 = nextWaypoint->posZ; - x_dist = x2 - x1; - z_dist = z2 - z1; - neg_x_dist = x1 - x2; - neg_z_dist = z1 - z2; - xz_dist = sqrtf((x_dist * x_dist) + (z_dist * z_dist)); - temp_f16 = (f32) ((y1 + y2) * 0.5); - var_s1->posX = ((waypointWidth * z_dist) / xz_dist) + x1; - var_s1->posY = temp_f16; - var_s1->posZ = ((waypointWidth * neg_x_dist) / xz_dist) + z1; - var_s2->posX = ((waypointWidth * neg_z_dist) / xz_dist) + x1; - var_s2->posY = temp_f16; - var_s2->posZ = ((waypointWidth * x_dist) / xz_dist) + z1; - } - } -} - -f32 func_80010480(s32 pathIndex, u16 waypointIndex) { - f32 temp_f10_2; - f32 temp_f8; - UNUSED f32 pad; - TrackWaypoint* pathWaypoints; - f32 x1; - f32 z1; - f32 x2; - f32 z2; - f32 x3; - f32 z3; - f32 temp_f8_2; - f32 temp_f10; - s32 waypointCount; - TrackWaypoint* waypoint3; - TrackWaypoint* waypoint2; - TrackWaypoint* waypoint1; - f32 root2; - f32 root1; - - if ((s32) gKartAICourseMaximumSeparation[gCurrentCourseId] < 0) { - return 0.0f; - } - waypointCount = gWaypointCountByPathIndex[pathIndex]; - pathWaypoints = D_80164550[pathIndex]; - waypoint1 = &pathWaypoints[waypointIndex]; - waypoint2 = &pathWaypoints[(waypointIndex + 1) % waypointCount]; - waypoint3 = &pathWaypoints[(waypointIndex + 2) % waypointCount]; - x1 = waypoint1->posX; - z1 = waypoint1->posZ; - x2 = waypoint2->posX; - z2 = waypoint2->posZ; - x3 = waypoint3->posX; - z3 = waypoint3->posZ; - temp_f8_2 = (((x2 + x3) * 0.5) - x1); - temp_f10 = (((z2 + z3) * 0.5) - z1); - waypoint1 = &pathWaypoints[(waypointIndex + 3) % waypointCount]; - waypoint2 = &pathWaypoints[(waypointIndex + 4) % waypointCount]; - waypoint3 = &pathWaypoints[(waypointIndex + 5) % waypointCount]; - x1 = waypoint1->posX; - z1 = waypoint1->posZ; - x2 = waypoint2->posX; - z2 = waypoint2->posZ; - x3 = waypoint3->posX; - z3 = waypoint3->posZ; - temp_f10_2 = (((x2 + x3) * 0.5) - x1); - temp_f8 = (((z2 + z3) * 0.5) - z1); - root1 = sqrtf((temp_f10 * temp_f10) + (temp_f8_2 * temp_f8_2)); - root2 = sqrtf((temp_f10_2 * temp_f10_2) + (temp_f8 * temp_f8)); - return -((temp_f10 * temp_f10_2) - (temp_f8_2 * temp_f8)) / (root2 * root1); -} - -void func_800107C4(s32 pathIndex) { - f64 temp_f2; - UNUSED s32 pad; - s32 var_a2; - s32 var_s0; - s32 var_t2; - s16* var_t4; - s32 var_a3; - s16* wut; - - if ((s32) gKartAICourseMaximumSeparation[gCurrentCourseId] >= 0) { - var_a3 = gWaypointCountByPathIndex[pathIndex]; - var_t4 = &D_80164580[pathIndex][0]; - for (var_s0 = 0; var_s0 < var_a3; var_s0++, var_t4++) { - temp_f2 = func_80010480(pathIndex, var_s0); - *var_t4 = 4; - if (temp_f2 > 0.1) { - *var_t4 = 2; - } - if (temp_f2 < -0.1) { - *var_t4 = 3; - } - } - var_t4 = &D_80164580[pathIndex][0]; - for (var_s0 = 0; var_s0 < var_a3; var_s0++, var_t4++) { - if (*var_t4 == 4) { - for (var_t2 = 1; var_t2 < var_a3; var_t2++) { - wut = &D_80164580[pathIndex][(var_s0 + var_t2) % var_a3]; - switch (*wut) { - case 0: - case 2: - for (var_a2 = 0; var_a2 < var_t2; var_a2++) { - D_80164580[pathIndex][(var_s0 + var_a2) % var_a3] = 0; - } - var_s0 += var_t2; - var_t4 += var_t2; - var_t2 = var_a3; - break; - case 1: - case 3: - for (var_a2 = 0; var_a2 < var_t2; var_a2++) { - D_80164580[pathIndex][(var_s0 + var_a2) % var_a3] = 1; - } - var_s0 += var_t2; - var_t4 += var_t2; - var_t2 = var_a3; - break; - } - } - } - } - } -} - -// Seemingly calculates the atan2 angle between a waypoint and its forward neighbor -s16 func_80010CB0(s32 pathIndex, s32 waypointIndex) { - s16 ret; - Vec3f sp30; - Vec3f sp24; - TrackWaypoint* temp_v0; - - temp_v0 = &D_80164550[pathIndex][waypointIndex]; - sp30[0] = temp_v0->posX; - sp30[1] = temp_v0->posY; - sp30[2] = temp_v0->posZ; - temp_v0 = &D_80164550[pathIndex][(waypointIndex + 1) % gWaypointCountByPathIndex[pathIndex]]; - sp24[0] = temp_v0->posX; - sp24[1] = temp_v0->posY; - sp24[2] = temp_v0->posZ; - ret = get_angle_between_two_vectors(sp30, sp24); - return -ret; -} - -// Populates D_80164590 -void func_80010DBC(s32 pathIndex) { - s32 waypointIndex; - u16* angle; - - if ((s32) gKartAICourseMaximumSeparation[gCurrentCourseId] >= 0) { - for (angle = (u16*) &D_80164590[pathIndex][0], waypointIndex = 0; - waypointIndex < gWaypointCountByPathIndex[pathIndex]; waypointIndex++, angle++) { - *angle = func_80010CB0(pathIndex, waypointIndex); - } - } -} - -void func_80010E6C(s32 pathIndex) { - s16* var_a2; - s16 var_a0; - s16 temp_t0; - s32 temp_v0; - s16* temp; - s32 i, j; - - temp_v0 = gWaypointCountByPathIndex[pathIndex]; - temp = D_80164580[pathIndex]; - var_a2 = D_801645A0[pathIndex]; - - for (i = 0; i < temp_v0; i++) { - var_a0 = 0; - for (j = 0; j < temp_v0; j++) { - temp_t0 = temp[(i + j) % temp_v0]; - if ((temp_t0 == 1) || (temp_t0 == 0)) { - var_a0 += 1; - } else { - break; - } - if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { - break; - } - } - *var_a2 = var_a0; - var_a2++; - } -} - -f32 func_80010F40(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) { - arg1 = spawn_actor_on_surface(arg0, 2000.0f, arg2); - check_bounding_collision(&D_80162E70, 1.0f, arg0, arg1, arg2); - return arg1; -} - -f32 func_80010FA0(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) { - arg1 = spawn_actor_on_surface(arg0, (f32) ((f64) arg1 + 30.0), arg2); - check_bounding_collision(&D_80162E70, 10.0f, arg0, arg1, arg2); - return arg1; -} - -/** - * @return's the number of items processed. - */ -s32 func_80011014(TrackWaypoint* pathDest, TrackWaypoint* path, s32 numPathPoints, UNUSED s32 pathIndex) { - f32 temp_f24_2; - f32 temp_f2_3; - f32 var_f20_2; - f32 x1; - f32 z1; - f32 x2; - f32 z2; - f32 x3; - f32 z3; - f32 x1_2; - f32 z1_3; - f32 temp_f20; - f32 var_f30; - f32 temp_f22; - f32 temp_f16; - s32 i; - - f32 j; - s32 var_s0; - f32 var_f28; - - TrackWaypoint* point1; - TrackWaypoint* point2; - TrackWaypoint* point3; - f32 temp; - UNUSED TrackWaypoint* dest; - var_f30 = 0.0f; - var_s0 = 0; - temp_f20 = (f32) path[0].posX; - temp_f22 = (f32) path[0].posZ; - var_f28 = func_80010F40(temp_f20, 2000.0f, temp_f22, gCurrentCourseId, 0); - - for (i = 0; i < numPathPoints; i++) { - point1 = &path[i % numPathPoints]; - point2 = &path[(i + 1) % numPathPoints]; - point3 = &path[(s32) (i + 2) % numPathPoints]; - x1 = (f32) point1->posX; - z1 = (f32) point1->posZ; - x2 = (f32) point2->posX; - z2 = (f32) point2->posZ; - x3 = (f32) point3->posX; - z3 = (f32) point3->posZ; - - temp = 0.05 / (sqrtf(((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1))) + - (sqrtf(((x3 - x2) * (x3 - x2)) + ((z3 - z2) * (z3 - z2))))); - - for (j = 0.0f; j <= 1.0; j += temp) { - - temp_f2_3 = (f32) ((1.0 - j) * 0.5 * (1.0 - j)); - z1_3 = (f32) (((1.0 - j) * j) + 0.5); - temp_f16 = (f32) (j * 0.5 * j); - - temp_f24_2 = (temp_f2_3 * x1) + (z1_3 * x2) + (temp_f16 * x3); - x1_2 = (temp_f2_3 * z1) + (z1_3 * z2) + (temp_f16 * z3); - - var_f30 += - sqrtf(((temp_f24_2 - temp_f20) * (temp_f24_2 - temp_f20)) + ((x1_2 - temp_f22) * (x1_2 - temp_f22))); - - temp_f20 = temp_f24_2; - temp_f22 = x1_2; - - if ((var_f30 > 20.0f) || ((i == 0) && (j == 0.0))) { - if (gIsMirrorMode) { - // temp_f12 = -temp_f24_2; - pathDest->posX = (s16) -temp_f24_2; - var_f20_2 = func_80010FA0(-temp_f24_2, var_f28, x1_2, gCurrentCourseId, var_s0); - } else { - pathDest->posX = (s16) temp_f24_2; - var_f20_2 = func_80010FA0(temp_f24_2, var_f28, x1_2, gCurrentCourseId, var_s0); - } - - pathDest->posZ = (s16) temp_f22; - pathDest->trackSectionId = get_track_section_id(D_80162E70.meshIndexZX); - - if (var_f20_2 < -500.0) { - var_f20_2 = var_f28; - } else { - - switch (gCurrentCourseId) { - case 13: - if (var_f20_2 < (var_f28 - 15.0)) { - var_f20_2 = (f32) var_f28 - 15.0; - } - break; - case 14: - if ((var_s0 >= 1140) && (var_s0 <= 1152)) { - var_f20_2 = var_f28; - } else { - if (var_f20_2 < (var_f28 - 10.0)) { - var_f20_2 = (f32) (var_f28 - 4.0); - } - } - break; - case 18: - if ((var_s0 > 204) && (var_s0 < 220)) { - var_f20_2 = var_f28; - } else { - if (var_f20_2 < (var_f28 - 10.0)) { - var_f20_2 = (f32) (var_f28 - 4.0); - } - } - break; - default: - if (var_f20_2 < (var_f28 - 10.0)) { - var_f20_2 = (f32) var_f28 - 10.0; - } - break; - } - } - var_f28 = var_f20_2; - pathDest->posY = (s16) (s32) var_f20_2; - var_f30 = 0.0f; - pathDest++; - var_s0 += 1; - } - } - } - return var_s0; -} - -// Returns number of waypoints processed. -s32 process_path_data(TrackWaypoint* dest, TrackWaypoint* src) { - s16 temp_a0; - s16 temp_a2; - s16 temp_a3; - s32 var_v0; - s32 var_v1; - u16 temp_t0; - - var_v1 = 0; - for (var_v0 = 0; var_v0 < 0x7D0; var_v0++) { - temp_a0 = src->posX; - temp_a2 = src->posY; - temp_a3 = src->posZ; - temp_t0 = src->trackSectionId; - src++; - if (((temp_a0 & 0xFFFF) == 0x8000) && ((temp_a2 & 0xFFFF) == 0x8000) && ((temp_a3 & 0xFFFF) == 0x8000)) { - break; - } - if (gIsMirrorMode != 0) { - dest->posX = -temp_a0; - } else { - dest->posX = temp_a0; - } - var_v1++; - dest->posY = temp_a2; - dest->posZ = temp_a3; - dest->trackSectionId = temp_t0; - dest++; - } - return var_v1; -} - -s32 generate_2d_path(Path2D* pathDest, TrackWaypoint* pathSrc, s32 numWaypoints) { - f32 temp_f14_3; - f32 temp_f16_2; - UNUSED s32 pad; - - f32 x1; - f32 z1; - f32 x2; - f32 z2; - f32 x3; - f32 z3; - - UNUSED s32 pad2; - f32 temp_f24; - - f32 spA8; - f32 temp_f26; - f32 spA0; - - f32 temp_f2_3; - - TrackWaypoint* point1; - f32 j; - TrackWaypoint* point2; - TrackWaypoint* point3; - s32 i; - f32 temp_f6 = 0.0f; - s32 nbElement; - f32 sp7C; - - spA8 = pathSrc[0].posX; - spA0 = pathSrc[0].posZ; - nbElement = 0; - - for (i = 0; i < numWaypoints; i++) { - point1 = &pathSrc[((i % numWaypoints))]; - point2 = &pathSrc[(((i + 1) % numWaypoints))]; - point3 = &pathSrc[(((i + 2) % numWaypoints))]; - x1 = point1->posX; - z1 = point1->posZ; - x2 = point2->posX; - z2 = point2->posZ; - x3 = point3->posX; - z3 = point3->posZ; - - sp7C = 0.05 / (sqrtf(((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1))) + - sqrtf(((x3 - x2) * (x3 - x2)) + ((z3 - z2) * (z3 - z2)))); - - for (j = 0.0f; j <= 1.0; j += sp7C) { - temp_f2_3 = (1.0 - j) * 0.5 * (1.0 - j); - temp_f14_3 = ((1.0 - j) * j) + 0.5; - temp_f16_2 = j * 0.5 * j; - - temp_f24 = (temp_f2_3 * x1) + (temp_f14_3 * x2) + (temp_f16_2 * x3); - temp_f26 = (temp_f2_3 * z1) + (temp_f14_3 * z2) + (temp_f16_2 * z3); - temp_f6 += sqrtf(((temp_f24 - spA8) * (temp_f24 - spA8)) + ((temp_f26 - spA0) * (temp_f26 - spA0))); - spA8 = temp_f24; - spA0 = temp_f26; - if ((temp_f6 > 20.0f) || ((i == 0) && (j == 0.0))) { - if (gIsMirrorMode) { - pathDest->x = (s16) -spA8; - } else { - pathDest->x = (s16) spA8; - } - pathDest->z = spA0; - nbElement += 1; - pathDest++; - temp_f6 = 0.0f; - } - } - } - return nbElement; -} - -void copy_courses_kart_ai_behaviour(void) { - s32 i; - for (i = 0; i < NUM_COURSES - 1; i++) { - gCoursesKartAIBehaviour[i] = segmented_to_virtual_dupe_2(gKartAIBehaviourLUT[i]); - } -} - -void reset_kart_ai_behaviour_none(s32 playerIndex) { - gCurrentKartAIBehaviourId[playerIndex] = 0; - gPreviousKartAIBehaviourId[playerIndex] = 0; - gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_NONE; -} - -void reset_kart_ai_behaviour(s32 playerIndex) { - gCurrentKartAIBehaviourId[playerIndex] = 0; - gPreviousKartAIBehaviourId[playerIndex] = 0; - gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; -} - -void kart_ai_behaviour_start(s32 playerId, Player* player) { - u16 playerWaypoint; - s16 waypointStart; - s16 waypointEnd; - s32 behaviourType; - UNUSED s32 test; - - sCurrentKartAIBehaviour = &gCoursesKartAIBehaviour[gCurrentCourseId][gCurrentKartAIBehaviourId[playerId]]; - - playerWaypoint = gNearestWaypointByPlayerId[playerId]; - - waypointStart = sCurrentKartAIBehaviour->waypointStart; - waypointEnd = sCurrentKartAIBehaviour->waypointEnd; - behaviourType = sCurrentKartAIBehaviour->type; - - if ((waypointStart == -1) && (waypointEnd == -1)) { - sCurrentKartAIBehaviour = &gCoursesKartAIBehaviour[gCurrentCourseId][0]; - reset_kart_ai_behaviour_none(playerId); - return; - } - if ((u32) playerWaypoint == (u32) waypointStart) { - gKartAIBehaviourState[playerId] = KART_AI_BEHAVIOUR_STATE_RUNNING; - gPreviousKartAIBehaviourId[playerId] = gCurrentKartAIBehaviourId[playerId]; - gCurrentKartAIBehaviourId[playerId]++; - switch (behaviourType) { - case BEHAVIOUR_1: - func_80011EC0(playerId, player, player->unk_07C >> 0x10, playerWaypoint); - break; - case BEHAVIOUR_HOP: - kart_hop(player); - player->effects &= ~0x10; - D_801630E8[playerId] = 0; - break; - case BEHAVIOUR_3: - D_801634F8[playerId].unk4 = 0.0f; - break; - case BEHAVIOUR_4: - D_801634F8[playerId].unk4 = -0.6f; - break; - case BEHAVIOUR_5: - D_801634F8[playerId].unk4 = 0.6f; - break; - case BEHAVIOUR_NORMAL_SPEED: - gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_NORMAL; - break; - case BEHAVIOUR_FAST_SPEED: - gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_FAST; - break; - case BEHAVIOUR_SLOW_SPEED: - gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_SLOW; - break; - case BEHAVIOUR_MAX_SPEED: - gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_MAX; - break; - case BEHAVIOUR_9: - D_801633F8[playerId] = 1; - D_801631E0[playerId] = 0; - gPlayers[playerId].effects &= ~0x1000; - break; - case BEHAVIOUR_10: - D_801633F8[playerId] = 0; - break; - } - } -} - -void kart_ai_behaviour_end(s32 playerIndex, Player* player) { - u16 nearestWaypoint; - u32 waypointEnd; - s32 behaviourType; - - sCurrentKartAIBehaviour = &gCoursesKartAIBehaviour[gCurrentCourseId][gPreviousKartAIBehaviourId[playerIndex]]; - nearestWaypoint = gNearestWaypointByPlayerId[playerIndex]; - behaviourType = sCurrentKartAIBehaviour->type; - waypointEnd = sCurrentKartAIBehaviour->waypointEnd; - if (nearestWaypoint >= waypointEnd) { - switch (behaviourType) { - case BEHAVIOUR_1: - player->effects &= ~0x10; - D_801630E8[playerIndex] = 0; - gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; - break; - case BEHAVIOUR_3: - case BEHAVIOUR_4: - case BEHAVIOUR_5: - D_801634F8[playerIndex].unk4 = D_801634F8[playerIndex].unkC; - gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; - break; - case BEHAVIOUR_HOP: - case BEHAVIOUR_NORMAL_SPEED: - case BEHAVIOUR_FAST_SPEED: - case BEHAVIOUR_SLOW_SPEED: - case BEHAVIOUR_9: - case BEHAVIOUR_10: - case BEHAVIOUR_MAX_SPEED: - gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; - break; - default: - break; - } - } -} - -void kart_ai_behaviour(s32 playerIndex) { - Player* player = gPlayerOne + playerIndex; - - switch (gKartAIBehaviourState[playerIndex]) { - case KART_AI_BEHAVIOUR_STATE_NONE: - break; - case KART_AI_BEHAVIOUR_STATE_START: - kart_ai_behaviour_start(playerIndex, player); - break; - case KART_AI_BEHAVIOUR_STATE_RUNNING: - kart_ai_behaviour_end(playerIndex, player); - break; - } -} - -void func_80011EC0(s32 arg0, Player* player, s32 arg2, UNUSED u16 arg3) { - if ((((player->unk_094 / 18.0f) * 216.0f) >= 45.0f) && (D_801630E8[arg0] == 0)) { - switch (D_801631D8[sSomeNearestWaypoint]) { - case 0: - case 2: - if ((arg2 >= -9) && (D_80162FF8[arg0] == 0)) { - if ((D_80163068[arg0] > -0.8) && (D_80163068[arg0] < 0.5)) { - kart_hop(player); - player->effects |= 0x10; - D_801630E8[arg0] = 1; - break; - } - } - D_801630E8[arg0] = 2; - break; - case 1: - case 3: - if ((arg2 < 0xA) && (D_80162FF8[arg0] == 0)) { - if ((D_80163068[arg0] > -0.5) && (D_80163068[arg0] < 0.8)) { - kart_hop(player); - player->effects |= 0x10; - D_801630E8[arg0] = -1; - break; - } - } - D_801630E8[arg0] = -2; - break; - } - } else { - D_801630E8[arg0] = 3; - } -} - -#define GET_PATH_LENGTH(waypoint) \ - for (i = 0;; i++) { \ - if ((u16) waypoint[i].posX == 0x8000) { \ - break; \ - } \ - } - -void generate_train_waypoints(void) { - s32 i; - Path2D* temp; - TrackWaypoint* waypoint = - (TrackWaypoint*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[SEGMENT_NUMBER2(d_course_kalimari_desert_train_waypoints)] + - SEGMENT_OFFSET(d_course_kalimari_desert_train_waypoints)); - - GET_PATH_LENGTH(waypoint) - - temp = gVehicle2DWaypoint; - gVehicle2DWaypointLength = generate_2d_path(temp, waypoint, i - 1); - D_80162EB0 = spawn_actor_on_surface(temp[0].x, 2000.0f, temp[0].z); -} - -void generate_ferry_waypoints(void) { - TrackWaypoint* waypoint; - s32 i; - - waypoint = (TrackWaypoint*) VIRTUAL_TO_PHYSICAL2( - gSegmentTable[SEGMENT_NUMBER2(d_course_dks_jungle_parkway_ferry_waypoints)] + - (SEGMENT_OFFSET(d_course_dks_jungle_parkway_ferry_waypoints))); - - GET_PATH_LENGTH(waypoint) - - gVehicle2DWaypointLength = generate_2d_path(gVehicle2DWaypoint, waypoint, i - 1); - D_80162EB2 = -40; -} - -void spawn_vehicle_on_road(VehicleStuff* vehicle) { - f32 origXPos; - UNUSED f32 pad; - f32 origZPos; - - origXPos = vehicle->position[0]; - origZPos = vehicle->position[2]; - if (D_8016347A == 0) { - func_8000D6D0(vehicle->position, (s16*) &vehicle->waypointIndex, vehicle->speed, - vehicle->someMultiplierTheSequel, 0, 3); - vehicle->rotation[0] = 0; - vehicle->rotation[1] = -0x8000; - vehicle->rotation[2] = 0; - } else { - func_8000D940(vehicle->position, (s16*) &vehicle->waypointIndex, vehicle->speed, - vehicle->someMultiplierTheSequel, 0); - vehicle->rotation[0] = 0; - vehicle->rotation[1] = 0; - vehicle->rotation[2] = 0; - } - vehicle->velocity[0] = vehicle->position[0] - origXPos; - vehicle->velocity[2] = vehicle->position[2] - origZPos; -} - -void spawn_course_vehicles(void) { - s16 trainCarYRot; - UNUSED Vec3f pad; - TrainCarStuff* tempLocomotive; - TrainCarStuff* tempTender; - TrainCarStuff* tempPassengerCar; - Vec3s trainCarRot; - VehicleStuff* tempBoxTruck; - VehicleStuff* tempSchoolBus; - VehicleStuff* tempTankerTruck; - VehicleStuff* tempCar; - PaddleBoatStuff* tempPaddleWheelBoat; - Vec3s paddleWheelBoatRot; - s32 loopIndex; - s32 loopIndex2; - f32 origXPos; - f32 origZPos; - - switch (gCurrentCourseId) { - case COURSE_KALAMARI_DESERT: - for (loopIndex = 0; loopIndex < NUM_TRAINS; loopIndex++) { - tempLocomotive = &gTrainList[loopIndex].locomotive; - origXPos = tempLocomotive->position[0]; - origZPos = tempLocomotive->position[2]; - trainCarYRot = update_vehicle_following_waypoint( - tempLocomotive->position, (s16*) &tempLocomotive->waypointIndex, gTrainList[loopIndex].speed); - tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos; - tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos; - vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempLocomotive->actorIndex = add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, - tempLocomotive->velocity, ACTOR_TRAIN_ENGINE); - - tempTender = &gTrainList[loopIndex].tender; - if (tempTender->isActive == 1) { - origXPos = tempTender->position[0]; - origZPos = tempTender->position[2]; - trainCarYRot = update_vehicle_following_waypoint( - tempTender->position, (s16*) &tempTender->waypointIndex, gTrainList[loopIndex].speed); - tempTender->velocity[0] = tempTender->position[0] - origXPos; - tempTender->velocity[2] = tempTender->position[2] - origZPos; - vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempTender->actorIndex = add_actor_to_empty_slot(tempTender->position, trainCarRot, - tempTender->velocity, ACTOR_TRAIN_TENDER); - } - - for (loopIndex2 = 0; loopIndex2 < NUM_PASSENGER_CAR_ENTRIES; loopIndex2++) { - tempPassengerCar = &gTrainList[loopIndex].passengerCars[loopIndex2]; - if (tempPassengerCar->isActive == 1) { - origXPos = tempPassengerCar->position[0]; - origZPos = tempPassengerCar->position[2]; - trainCarYRot = update_vehicle_following_waypoint(tempPassengerCar->position, - (s16*) &tempPassengerCar->waypointIndex, - gTrainList[loopIndex].speed); - tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos; - tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos; - vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempPassengerCar->actorIndex = - add_actor_to_empty_slot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, - ACTOR_TRAIN_PASSENGER_CAR); - } - } - } - break; - case COURSE_DK_JUNGLE: - for (loopIndex = 0; loopIndex < NUM_ACTIVE_PADDLE_BOATS; loopIndex++) { - tempPaddleWheelBoat = &gPaddleBoats[loopIndex]; - if (tempPaddleWheelBoat->isActive == 1) { - origXPos = tempPaddleWheelBoat->position[0]; - origZPos = tempPaddleWheelBoat->position[2]; - tempPaddleWheelBoat->rotY = update_vehicle_following_waypoint( - tempPaddleWheelBoat->position, (s16*) &tempPaddleWheelBoat->waypointIndex, - tempPaddleWheelBoat->speed); - tempPaddleWheelBoat->velocity[0] = tempPaddleWheelBoat->position[0] - origXPos; - tempPaddleWheelBoat->velocity[2] = tempPaddleWheelBoat->position[2] - origZPos; - vec3s_set(paddleWheelBoatRot, 0, tempPaddleWheelBoat->rotY, 0); - tempPaddleWheelBoat->actorIndex = - add_actor_to_empty_slot(tempPaddleWheelBoat->position, paddleWheelBoatRot, - tempPaddleWheelBoat->velocity, ACTOR_PADDLE_BOAT); - } - } - break; - case COURSE_TOADS_TURNPIKE: - for (loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) { - tempBoxTruck = &gBoxTruckList[loopIndex]; - spawn_vehicle_on_road(tempBoxTruck); - tempBoxTruck->actorIndex = add_actor_to_empty_slot(tempBoxTruck->position, tempBoxTruck->rotation, - tempBoxTruck->velocity, ACTOR_BOX_TRUCK); - } - for (loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) { - tempSchoolBus = &gSchoolBusList[loopIndex]; - spawn_vehicle_on_road(tempSchoolBus); - tempSchoolBus->actorIndex = add_actor_to_empty_slot(tempSchoolBus->position, tempSchoolBus->rotation, - tempSchoolBus->velocity, ACTOR_SCHOOL_BUS); - } - for (loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) { - tempTankerTruck = &gTankerTruckList[loopIndex]; - spawn_vehicle_on_road(tempTankerTruck); - tempTankerTruck->actorIndex = - add_actor_to_empty_slot(tempTankerTruck->position, tempTankerTruck->rotation, - tempTankerTruck->velocity, ACTOR_TANKER_TRUCK); - } - for (loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) { - tempCar = &gCarList[loopIndex]; - spawn_vehicle_on_road(tempCar); - tempCar->actorIndex = - add_actor_to_empty_slot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR); - } - break; - } -} - -void set_vehicle_pos_waypoint(TrainCarStuff* trainCar, Path2D* posXZ, u16 waypoint) { - trainCar->position[0] = (f32) posXZ->x; - trainCar->position[1] = (f32) D_80162EB0; - trainCar->position[2] = (f32) posXZ->z; - trainCar->actorIndex = -1; - trainCar->waypointIndex = waypoint; - trainCar->isActive = 0; - trainCar->velocity[0] = 0.0f; - trainCar->velocity[1] = 0.0f; - trainCar->velocity[2] = 0.0f; -} - -/** - * Set waypoint spawn locations for each rolling stock - * The railroad has 465 waypoints - */ -void init_vehicles_trains(void) { - u16 waypointOffset; - TrainCarStuff* ptr1; - Path2D* pos; - s32 i; - s32 j; - - for (i = 0; i < NUM_TRAINS; i++) { - // outputs 160 or 392 depending on the train. - // Wraps the value around to always output a valid waypoint. - waypointOffset = (((i * gVehicle2DWaypointLength) / NUM_TRAINS) + 160) % gVehicle2DWaypointLength; - - // 120.0f is about the maximum usable value - gTrainList[i].speed = 5.0f; - for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { - waypointOffset += 4; - ptr1 = &gTrainList[i].passengerCars[j]; - pos = &gVehicle2DWaypoint[waypointOffset]; - set_vehicle_pos_waypoint(ptr1, pos, waypointOffset); - } - // Smaller offset for the tender - waypointOffset += 3; - ptr1 = &gTrainList[i].tender; - pos = &gVehicle2DWaypoint[waypointOffset]; - set_vehicle_pos_waypoint(ptr1, pos, waypointOffset); - - waypointOffset += 4; - ptr1 = &gTrainList[i].locomotive; - pos = &gVehicle2DWaypoint[waypointOffset]; - set_vehicle_pos_waypoint(ptr1, pos, waypointOffset); - - // Only use locomotive unless overwritten below. - gTrainList[i].numCars = LOCOMOTIVE_ONLY; - } - - // Spawn all rolling stock in single player mode. - switch (gScreenModeSelection) { - case SCREEN_MODE_1P: // single player - for (i = 0; i < NUM_TRAINS; i++) { - gTrainList[i].tender.isActive = 1; - - // clang-format off - // Same line required for matching... - for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { gTrainList[i].passengerCars[j].isActive = 1; } - // clang-format on - - gTrainList[i].numCars = NUM_TENDERS + NUM_PASSENGER_CAR_ENTRIES; - } - break; - - // Spawn locomotive, tender, and one passenger car in versus 2/3 player mode. - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: // multiplayer fall-through - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - if (gModeSelection != GRAND_PRIX) { - for (i = 0; i < NUM_TRAINS; i++) { - gTrainList[i].tender.isActive = 1; - gTrainList[i].passengerCars[4].isActive = 1; - gTrainList[i].numCars = NUM_TENDERS + NUM_2P_PASSENGER_CARS; - } - } - break; - } - - gTrainSmokeTimer = 0; -} -/** - * @brief sync the train components vehicle with the actor - * - * @param trainCar - * @param orientationY - */ -void sync_train_components(TrainCarStuff* trainCar, s16 orientationY) { - struct TrainCar* trainCarActor; - - trainCarActor = (struct TrainCar*) &gActorList[trainCar->actorIndex]; - trainCarActor->pos[0] = trainCar->position[0]; - trainCarActor->pos[1] = trainCar->position[1]; - trainCarActor->pos[2] = trainCar->position[2]; - if (gIsMirrorMode != 0) { - trainCarActor->rot[1] = -orientationY; - } else { - trainCarActor->rot[1] = orientationY; - } - trainCarActor->velocity[0] = trainCar->velocity[0]; - trainCarActor->velocity[2] = trainCar->velocity[2]; -} - -void update_vehicle_trains(void) { - UNUSED s32 pad[3]; - f32 temp_f20; - TrainCarStuff* car; - u16 oldWaypointIndex; - s16 orientationYUpdate; - f32 temp_f22; - s32 i; - s32 j; - Vec3f smokePos; - - gTrainSmokeTimer += 1; - - for (i = 0; i < NUM_TRAINS; i++) { - oldWaypointIndex = (u16) gTrainList[i].locomotive.waypointIndex; - - temp_f20 = gTrainList[i].locomotive.position[0]; - temp_f22 = gTrainList[i].locomotive.position[2]; - - orientationYUpdate = update_vehicle_following_waypoint( - gTrainList[i].locomotive.position, (s16*) &gTrainList[i].locomotive.waypointIndex, gTrainList[i].speed); - - gTrainList[i].locomotive.velocity[0] = gTrainList[i].locomotive.position[0] - temp_f20; - gTrainList[i].locomotive.velocity[2] = gTrainList[i].locomotive.position[2] - temp_f22; - - sync_train_components(&gTrainList[i].locomotive, orientationYUpdate); - - if ((oldWaypointIndex != gTrainList[i].locomotive.waypointIndex) && - ((gTrainList[i].locomotive.waypointIndex == 0x00BE) || - (gTrainList[i].locomotive.waypointIndex == 0x0140))) { // play crossing bell sound - func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); - } else if (random_int(100) == 0) { // play train whistle sound - func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); - } - - gTrainList[i].someFlags = set_vehicle_render_distance_flags( - gTrainList[i].locomotive.position, TRAIN_SMOKE_RENDER_DISTANCE, gTrainList[i].someFlags); - // Renders locomotive smoke on all screens if any player is within range. - if ((((s16) gTrainSmokeTimer % 5) == 0) && (gTrainList[i].someFlags != 0)) { - smokePos[0] = gTrainList[i].locomotive.position[0]; - smokePos[1] = (f32) ((f64) gTrainList[i].locomotive.position[1] + 65.0); - smokePos[2] = (f32) ((f64) gTrainList[i].locomotive.position[2] + 25.0); - adjust_position_by_angle(smokePos, gTrainList[i].locomotive.position, orientationYUpdate); - spawn_train_smoke(i, smokePos, 1.1f); - } - - car = &gTrainList[i].tender; - - if (car->isActive == 1) { - temp_f20 = car->position[0]; - temp_f22 = car->position[2]; - orientationYUpdate = - update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, gTrainList[i].speed); - car->velocity[0] = car->position[0] - temp_f20; - car->velocity[2] = car->position[2] - temp_f22; - sync_train_components(car, orientationYUpdate); - } - - for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { - car = &gTrainList[i].passengerCars[j]; - if (car->isActive == 1) { - temp_f20 = car->position[0]; - temp_f22 = car->position[2]; - - orientationYUpdate = - update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, gTrainList[i].speed); - car->velocity[0] = car->position[0] - temp_f20; - car->velocity[2] = car->position[2] - temp_f22; - sync_train_components(car, orientationYUpdate); - } - } - } -} - -void func_80012DC0(s32 playerId, Player* player) { - TrainCarStuff* trainCar; - f32 playerPosX; - f32 playerPosZ; - f32 x_dist; - f32 z_dist; - s32 trainIndex; - s32 passengerCarIndex; - - if (D_801631E0[playerId] != 1) { - if (!(player->effects & 0x01000000)) { - playerPosX = player->pos[0]; - playerPosZ = player->pos[2]; - for (trainIndex = 0; trainIndex < NUM_TRAINS; trainIndex++) { - trainCar = &gTrainList[trainIndex].locomotive; - x_dist = playerPosX - trainCar->position[0]; - z_dist = playerPosZ - trainCar->position[2]; - if ((x_dist > -100.0) && (x_dist < 100.0)) { - if ((z_dist > -100.0) && (z_dist < 100.0)) { - if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { - player->soundEffects |= REVERSE_SOUND_EFFECT; - } - trainCar = &gTrainList[trainIndex].tender; - if (trainCar->isActive == 1) { - if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { - player->soundEffects |= REVERSE_SOUND_EFFECT; - } - } - } - } - - for (passengerCarIndex = 0; passengerCarIndex < NUM_PASSENGER_CAR_ENTRIES; passengerCarIndex++) { - trainCar = &gTrainList[trainIndex].passengerCars[passengerCarIndex]; - x_dist = playerPosX - trainCar->position[0]; - z_dist = playerPosZ - trainCar->position[2]; - if (trainCar->isActive == 1) { - if ((x_dist > -100.0) && (x_dist < 100.0)) { - if ((z_dist > -100.0) && (z_dist < 100.0)) { - if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { - player->soundEffects |= REVERSE_SOUND_EFFECT; - } - } - } - } - } - } - } - } -} - -/** - * Appears to check if the train is close to the crossing. - * Implements sCrossingActiveTimer as a counter - */ -void func_80013054(void) { - f32 temp_f16; - f32 temp_f18; - f32 temp_f12; - s32 i; - isCrossingTriggeredByIndex[0] = 0; - isCrossingTriggeredByIndex[1] = 0; - - for (i = 0; i < NUM_TRAINS; i++) { - temp_f16 = gTrainList[i].locomotive.waypointIndex / ((f32) gVehicle2DWaypointLength); - temp_f18 = 0.72017354f; - temp_f12 = 0.42299348f; - - if (((temp_f12 - 0.1) < temp_f16) && - (temp_f16 < ((((f64) gTrainList[i].numCars) * 0.01) + (temp_f12 + 0.01)))) { - - isCrossingTriggeredByIndex[0] = 1; - } - if (((temp_f18 - 0.1) < temp_f16) && - (temp_f16 < ((((f64) gTrainList[i].numCars) * 0.01) + (temp_f18 + 0.01)))) { - - isCrossingTriggeredByIndex[1] = 1; - } - } - - for (i = 0; i < NUM_CROSSINGS; i++) { - if (isCrossingTriggeredByIndex[i] == 1) { - sCrossingActiveTimer[i] += 1; - } else { - sCrossingActiveTimer[i] = 0; - } - } -} - -void check_ai_crossing_distance(s32 playerId) { - bStopAICrossing[playerId] = 0; - if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { - if ((!(D_801631E0[playerId] != 0)) || - (set_vehicle_render_distance_flags(gPlayers[playerId].pos, TRAIN_CROSSING_AI_DISTANCE, 0))) { - - if ((isCrossingTriggeredByIndex[1] == 1) && ((sCrossingActiveTimer[1]) > FRAMES_SINCE_CROSSING_ACTIVATED)) { - - if ((sSomeNearestWaypoint > 176) && (sSomeNearestWaypoint < 182)) { - bStopAICrossing[playerId] = 1; - } - } - if ((isCrossingTriggeredByIndex[0] == 1) && ((sCrossingActiveTimer[0]) > FRAMES_SINCE_CROSSING_ACTIVATED)) { - if ((sSomeNearestWaypoint >= 306) && (sSomeNearestWaypoint < 310)) { - bStopAICrossing[playerId] = 1; - } - } - } - } -} - -void init_vehicles_ferry(void) { - PaddleBoatStuff* paddleBoat; - s32 i; - Path2D* temp_a2; - u16 temp; - for (i = 0; i < NUM_ACTIVE_PADDLE_BOATS; i++) { - temp = i * 0xB4; - paddleBoat = &gPaddleBoats[i]; - temp_a2 = &gVehicle2DWaypoint[temp]; - paddleBoat->position[0] = temp_a2->x; - paddleBoat->position[1] = D_80162EB2; - paddleBoat->position[2] = temp_a2->z; - paddleBoat->waypointIndex = i * 0xB4; - paddleBoat->actorIndex = -1; - - if (gPlayerCount >= 3) { - paddleBoat->isActive = 0; - } else { - paddleBoat->isActive = 1; - } - paddleBoat->velocity[0] = 0.0f; - paddleBoat->velocity[1] = 0.0f; - paddleBoat->velocity[2] = 0.0f; - paddleBoat->speed = 1.6666666f; - paddleBoat->rotY = 0; - } - gFerrySmokeTimer = 0; -} - -void update_vehicle_paddle_boats(void) { - PaddleBoatStuff* paddleBoat; - Path2D* waypoint; - s32 i; - struct Actor* paddleBoatActor; - f32 temp_f26; - f32 temp_f28; - f32 temp_f30; - s16 temp_a1; - s32 temp; - s16 var_v1; - Vec3f sp94; - Vec3f sp88; - UNUSED s32 pad; - Vec3f smokePos; - UNUSED s32 pad2; - gFerrySmokeTimer += 1; - for (i = 0; i < NUM_ACTIVE_PADDLE_BOATS; i++) { - paddleBoat = &gPaddleBoats[i]; - if (paddleBoat->isActive == 1) { - temp_f26 = paddleBoat->position[0]; - temp_f28 = paddleBoat->position[1]; - temp_f30 = paddleBoat->position[2]; - update_vehicle_following_waypoint(paddleBoat->position, (s16*) &paddleBoat->waypointIndex, - paddleBoat->speed); - paddleBoat->someFlags = set_vehicle_render_distance_flags(paddleBoat->position, BOAT_SMOKE_RENDER_DISTANCE, - paddleBoat->someFlags); - if ((((s16) gFerrySmokeTimer % 10) == 0) && (paddleBoat->someFlags != 0)) { - smokePos[0] = (f32) ((f64) paddleBoat->position[0] - 30.0); - smokePos[1] = (f32) ((f64) paddleBoat->position[1] + 180.0); - smokePos[2] = (f32) ((f64) paddleBoat->position[2] + 45.0); - adjust_position_by_angle(smokePos, paddleBoat->position, paddleBoat->rotY); - spawn_ferry_smoke(i, smokePos, 1.1f); - smokePos[0] = (f32) ((f64) paddleBoat->position[0] + 30.0); - smokePos[1] = (f32) ((f64) paddleBoat->position[1] + 180.0); - smokePos[2] = (f32) ((f64) paddleBoat->position[2] + 45.0); - adjust_position_by_angle(smokePos, paddleBoat->position, paddleBoat->rotY); - spawn_ferry_smoke(i, smokePos, 1.1f); - } - if (random_int(100) == 0) { - if (random_int(2) == 0) { - func_800C98B8(paddleBoat->position, paddleBoat->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x47)); - } else { - func_800C98B8(paddleBoat->position, paddleBoat->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x48)); - } - } - sp94[0] = temp_f26; - sp94[1] = temp_f28; - sp94[2] = temp_f30; - waypoint = &gVehicle2DWaypoint[(paddleBoat->waypointIndex + 5) % gVehicle2DWaypointLength]; - sp88[0] = (f32) waypoint->x; - sp88[1] = (f32) D_80162EB0; - sp88[2] = (f32) waypoint->z; - temp_a1 = get_angle_between_waypoints(sp94, sp88); - temp = temp_a1 - paddleBoat->rotY; - var_v1 = temp; - if (var_v1 < 0) { - var_v1 = -var_v1; - } - if (var_v1 >= 0x1771) { - if (paddleBoat->speed > 0.2) { - paddleBoat->speed -= 0.04; - } - if (var_v1 >= 0x3D) { - var_v1 = 0x003C; - } - } else { - if (paddleBoat->speed < 2.0) { - paddleBoat->speed += 0.02; - } - if (var_v1 >= 0x1F) { - var_v1 = 0x001E; - } - } - if (temp >= 0x8000) { - paddleBoat->rotY -= var_v1; - } else if (temp > 0) { - paddleBoat->rotY += var_v1; - } else if (temp < -0x7FFF) { - paddleBoat->rotY += var_v1; - } else if (temp < 0) { - paddleBoat->rotY -= var_v1; - } - paddleBoat->velocity[0] = paddleBoat->position[0] - temp_f26; - paddleBoat->velocity[1] = paddleBoat->position[1] - temp_f28; - paddleBoat->velocity[2] = paddleBoat->position[2] - temp_f30; - paddleBoatActor = &gActorList[paddleBoat->actorIndex]; - paddleBoatActor->pos[0] = paddleBoat->position[0]; - paddleBoatActor->pos[1] = paddleBoat->position[1]; - paddleBoatActor->pos[2] = paddleBoat->position[2]; - if (gIsMirrorMode != 0) { - paddleBoatActor->rot[1] = -paddleBoat->rotY; - } else { - paddleBoatActor->rot[1] = paddleBoat->rotY; - } - paddleBoatActor->velocity[0] = paddleBoat->velocity[0]; - paddleBoatActor->velocity[1] = paddleBoat->velocity[1]; - paddleBoatActor->velocity[2] = paddleBoat->velocity[2]; - } - } -} - -void func_80013854(Player* player) { - s32 someIndex; - PaddleBoatStuff* tempPaddleWheelBoat; - f32 x_diff; - f32 y_diff; - f32 z_diff; - f32 playerX; - f32 playerZ; - f32 playerY; - - if (!((player->effects & 0x01000000)) && (!(player->effects & HIT_BY_ITEM_EFFECT))) { - playerX = player->pos[0]; - playerY = player->pos[1]; - playerZ = player->pos[2]; - for (someIndex = 0; someIndex < NUM_ACTIVE_PADDLE_BOATS; someIndex++) { - tempPaddleWheelBoat = &gPaddleBoats[someIndex]; - if (tempPaddleWheelBoat->isActive == 1) { - x_diff = playerX - tempPaddleWheelBoat->position[0]; - y_diff = playerY - tempPaddleWheelBoat->position[1]; - z_diff = playerZ - tempPaddleWheelBoat->position[2]; - if ((x_diff > -300.0) && (x_diff < 300.0)) { - if ((z_diff > -300.0) && (z_diff < 300.0)) { - if ((func_80006018(tempPaddleWheelBoat->position[0], tempPaddleWheelBoat->position[2], - tempPaddleWheelBoat->velocity[0], tempPaddleWheelBoat->velocity[2], 200.0f, - 60.0f, playerX, playerZ) == 1) && - (y_diff < 60.0)) { - player->soundEffects |= 0x80000; - } - } - } - } - } - } -} - -void initialize_toads_turnpike_vehicle(f32 speedA, f32 speedB, s32 numVehicles, s32 arg3, VehicleStuff* vehicleList, - TrackWaypoint* waypointList) { - VehicleStuff* veh; - TrackWaypoint* temp_v0; - s32 i; - u16 waypointOffset; - s32 numWaypoints = gWaypointCountByPathIndex[0]; - for (i = 0; i < numVehicles; i++) { - waypointOffset = (((i * numWaypoints) / numVehicles) + arg3) % numWaypoints; - veh = &vehicleList[i]; - temp_v0 = &waypointList[waypointOffset]; - veh->position[0] = (f32) temp_v0->posX; - veh->position[1] = (f32) temp_v0->posY; - veh->position[2] = (f32) temp_v0->posZ; - veh->actorIndex = -1; - veh->waypointIndex = waypointOffset; - veh->unused = 0; - veh->velocity[0] = 0.0f; - veh->velocity[1] = 0.0f; - veh->velocity[2] = 0.0f; - veh->someFlags = 0; - veh->someFlagsTheSequel = 0; - if (gModeSelection == TIME_TRIALS) { - veh->someType = (i % 3); - } else { - veh->someType = random_int(3); - } - veh->someMultiplierTheSequel = (f32) ((f64) (f32) (veh->someType - 1) * 0.6); - if (((gCCSelection > CC_50) || (gModeSelection == TIME_TRIALS)) && (veh->someType == 2)) { - veh->speed = speedA; - } else { - veh->speed = speedB; - } - veh->rotation[0] = 0; - veh->rotation[2] = 0; - if (D_8016347A == 0) { - veh->rotation[1] = func_8000D6D0(veh->position, (s16*) &veh->waypointIndex, veh->speed, - veh->someMultiplierTheSequel, 0, 3); - } else { - veh->rotation[1] = - func_8000D940(veh->position, (s16*) &veh->waypointIndex, veh->speed, veh->someMultiplierTheSequel, 0); - } - } - D_801631C8 = 10; -} - -f32 func_80013C74(s16 someType, s16 waypointIndex) { - f32 var_f2; - - var_f2 = 0.0f; - if (waypointIndex < 0x28A) { - switch (someType) { - case 0: - var_f2 = -0.7f; - break; - case 1: - break; - case 2: - var_f2 = 0.7f; - break; - default: - break; - } - } else { - switch (someType) { - case 0: - case 1: - var_f2 = -0.5f; - break; - case 2: - var_f2 = 0.5f; - break; - default: - break; - } - } - return var_f2; -} - -void update_vehicle_follow_waypoint(VehicleStuff* vehicle) { - f32 temp_f0_2; - f32 temp_f0_3; - f32 sp5C; - f32 sp58; - f32 sp54; - f32 temp_f2_2; - s16 var_a1; - s16 thing; - Vec3f sp40; - Vec3f sp34; - struct Actor* vehicleActor; - - sp5C = vehicle->position[0]; - sp58 = vehicle->position[1]; - sp54 = vehicle->position[2]; - sp40[0] = sp58; - sp40[1] = 0.0f; - sp40[2] = 0.0f; - temp_f0_2 = func_80013C74(vehicle->someType, vehicle->waypointIndex); - if (vehicle->someMultiplierTheSequel < temp_f0_2) { - vehicle->someMultiplierTheSequel = vehicle->someMultiplierTheSequel + 0.06; - if (temp_f0_2 < vehicle->someMultiplierTheSequel) { - vehicle->someMultiplierTheSequel = temp_f0_2; - } - } - if (temp_f0_2 < vehicle->someMultiplierTheSequel) { - vehicle->someMultiplierTheSequel = vehicle->someMultiplierTheSequel - 0.06; - if (vehicle->someMultiplierTheSequel < temp_f0_2) { - vehicle->someMultiplierTheSequel = temp_f0_2; - } - } - if (D_8016347A == 0) { - var_a1 = func_8000D6D0(vehicle->position, (s16*) &vehicle->waypointIndex, vehicle->speed, - vehicle->someMultiplierTheSequel, 0, 3); - } else { - var_a1 = func_8000D940(vehicle->position, (s16*) &vehicle->waypointIndex, vehicle->speed, - vehicle->someMultiplierTheSequel, 0); - } - adjust_angle(&vehicle->rotation[1], var_a1, 100); - temp_f0_3 = vehicle->position[0] - sp5C; - temp_f2_2 = vehicle->position[2] - sp54; - sp34[0] = vehicle->position[1]; - sp34[1] = 0.0f; - sp34[2] = sqrtf((temp_f0_3 * temp_f0_3) + (temp_f2_2 * temp_f2_2)); - thing = get_angle_between_two_vectors(sp40, sp34); - adjust_angle(&vehicle->rotation[0], -thing, 100); - vehicle->velocity[0] = vehicle->position[0] - sp5C; - vehicle->velocity[1] = vehicle->position[1] - sp58; - vehicle->velocity[2] = vehicle->position[2] - sp54; - vehicleActor = &gActorList[vehicle->actorIndex]; - vehicleActor->pos[0] = vehicle->position[0]; - vehicleActor->pos[1] = vehicle->position[1]; - vehicleActor->pos[2] = vehicle->position[2]; - vehicleActor->rot[0] = vehicle->rotation[0]; - if (gIsMirrorMode != 0) { - vehicleActor->rot[1] = -vehicle->rotation[1]; - } else { - vehicleActor->rot[1] = vehicle->rotation[1]; - } - vehicleActor->rot[2] = vehicle->rotation[2]; - vehicleActor->velocity[0] = vehicle->velocity[0]; - vehicleActor->velocity[1] = vehicle->velocity[1]; - vehicleActor->velocity[2] = vehicle->velocity[2]; -} - -void func_80013F7C(s32 playerId, Player* player, VehicleStuff* vehicle, f32 arg3, f32 arg4, s32 arg5, u32 soundBits) { - f32 temp_f12; - f32 temp_f14; - f32 temp_f22; - - s32 i; - - f32 spC4; - f32 spC0; - f32 spBC; - - if (((D_801631E0[playerId] != 1) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_KART_AI))) && - !(player->effects & 0x01000000)) { - - spC4 = player->pos[0]; - spC0 = player->pos[1]; - spBC = player->pos[2]; - - for (i = 0; i < arg5; i++) { - temp_f12 = spC4 - vehicle->position[0]; - temp_f22 = spC0 - vehicle->position[1]; - temp_f14 = spBC - vehicle->position[2]; - - if (((temp_f12) > -100.0) && ((temp_f12) < 100.0)) { - if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { - - if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(vehicle->position[0], vehicle->position[2], vehicle->velocity[0], - vehicle->velocity[2], arg3, arg4, spC4, spBC) == (s32) 1) { - player->soundEffects |= REVERSE_SOUND_EFFECT; - } - } - } - } - if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_KART_AI)) { - if (((temp_f12) > -300.0) && ((temp_f12) < 300.0) && ((temp_f22 > -20.0)) && (temp_f22 < 20.0) && - (((temp_f14) > -300.0)) && ((temp_f14) < 300.0)) { - if ((D_801631C8 > 0) && (vehicle->someFlags == 0)) { - D_801631C8 -= 1; - vehicle->someFlags |= (RENDER_VEHICLE << playerId); - func_800C9D80(vehicle->position, vehicle->velocity, soundBits); - } - } else { - if (vehicle->someFlags != 0) { - vehicle->someFlags &= ~(RENDER_VEHICLE << playerId); - if (vehicle->someFlags == 0) { - D_801631C8 += 1; - func_800C9EF4(vehicle->position, soundBits); - } - } - } - - if (((temp_f12) > -200.0) && ((temp_f12) < 200.0) && ((temp_f22 > -20.0)) && (temp_f22 < 20.0) && - (((temp_f14) > -200.0)) && ((temp_f14) < 200.0)) { - if (!(vehicle->someFlagsTheSequel & ((1 << playerId)))) { - - s32 var_s1 = 0; - u16 path = gWaypointCountByPathIndex[0]; - s32 t1; - s32 t2; - - switch (D_8016347A) { - case 0: - t1 = func_80007BF8(vehicle->waypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); - if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < vehicle->speed)) { - var_s1 = 1; - } - if ((D_80163270[playerId] == 1) && (t1 > 0)) { - var_s1 = 1; - } - break; - case 1: - t2 = func_80007BF8(vehicle->waypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); - if (t2 > 0) { - if (random_int(2) == 0) { - // temp_v1_2 = D_80163270[playerId]; - if (D_80163270[playerId] == 0) { - var_s1 = 1; - } - if ((D_80163270[playerId] == 1) && (player->unk_094 < vehicle->speed)) { - var_s1 = 1; - } - } else { - vehicle->someFlagsTheSequel |= ((1 << playerId)); - } - } - break; - } - if (var_s1 == 1) { - - u32 soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3B); - - switch (soundBits) { - case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x05): - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3B); - if (random_int(4) == 0) { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3C); - } - break; - case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x02): - if (random_int(2) != 0) { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3D); - } else { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3E); - } - break; - case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03): - if (random_int(2) != 0) { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3F); - } else { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x40); - } - break; - case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x04): - if (random_int(2) != 0) { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x41); - } else { - soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x42); - } - break; - } - vehicle->someFlagsTheSequel |= ((1 << playerId)); - func_800C98B8(vehicle->position, vehicle->velocity, soundBits2); - } - } - } else { - if (vehicle->someFlagsTheSequel & ((1 << playerId))) { - vehicle->someFlagsTheSequel &= ~((1 << playerId)); - } - } - } - vehicle++; - } - } -} - -f32 func_800145A8(s16 arg0, f32 arg1, s16 arg2) { - if (arg2 < 0x28A) { - switch (arg0) { - case 0: - if (arg1 < 0.0) { - arg1 = 0.0f; - } - break; - case 1: - if (arg1 < 0.0) { - arg1 = -0.8f; - } else { - arg1 = 0.8f; - } - break; - case 2: - if (arg1 >= 0.0) { - arg1 = 0.0f; - } - break; - default: - break; - } - } else { - switch (arg0) { - case 0: - case 1: - arg1 = 0.5f; - break; - case 2: - arg1 = -0.5f; - break; - default: - break; - } - } - return arg1; -} - -void func_800146B8(s32 playerId, s32 arg1, VehicleStuff* vehicle) { - UNUSED s32 var_v1; - s32 var_v0; - s32 var_s2; - s32 waypointCount; - u16 temp_a1; - UNUSED VehicleStuff* tempVehicle; - - waypointCount = gWaypointCountByPathIndex[0]; - if (!(gPlayers[playerId].unk_094 < 1.6666666666666667)) { - for (var_s2 = 0; var_s2 < arg1; var_s2++, vehicle++) { - temp_a1 = vehicle->waypointIndex; - for (var_v0 = 0; var_v0 < 0x18; var_v0 += 3) { - if (((sSomeNearestWaypoint + var_v0) % waypointCount) == temp_a1) { - D_801634F8[playerId].unk4 = func_800145A8(vehicle->someType, D_80163068[playerId], temp_a1); - return; - } - } - } - } -} - -void init_vehicles_box_trucks(void) { - f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; - f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; - s32 numTrucks = NUM_RACE_BOX_TRUCKS; - if (gModeSelection == TIME_TRIALS) { - numTrucks = NUM_TIME_TRIAL_BOX_TRUCKS; - } - initialize_toads_turnpike_vehicle(a, b, numTrucks, 0, gBoxTruckList, &D_80164550[0][0]); -} - -void update_vehicle_box_trucks(void) { - s32 loopIndex; - for (loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) { - update_vehicle_follow_waypoint(&gBoxTruckList[loopIndex]); - } -} - -void func_800148C4(s32 playerId, Player* player) { - func_80013F7C(playerId, player, gBoxTruckList, 55.0f, 12.5f, NUM_RACE_BOX_TRUCKS, - SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03)); -} - -void func_8001490C(s32 playerId) { - func_800146B8(playerId, NUM_RACE_BOX_TRUCKS, gBoxTruckList); -} - -void init_vehicles_school_buses(void) { - s32 numBusses; - f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; - f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; - - numBusses = NUM_RACE_SCHOOL_BUSES; - if (gModeSelection == TIME_TRIALS) { - numBusses = NUM_TIME_TRIAL_SCHOOL_BUSES; - } - initialize_toads_turnpike_vehicle(a, b, numBusses, 75, gSchoolBusList, &D_80164550[0][0]); -} - -void update_vehicle_school_bus(void) { - s32 loopIndex; - for (loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) { - update_vehicle_follow_waypoint(&gSchoolBusList[loopIndex]); - } -} - -void func_80014A18(s32 playerId, Player* player) { - func_80013F7C(playerId, player, gSchoolBusList, 70.0f, 12.5f, NUM_RACE_SCHOOL_BUSES, - SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x02)); -} - -void func_80014A60(s32 playerId) { - func_800146B8(playerId, NUM_RACE_SCHOOL_BUSES, gSchoolBusList); -} - -void init_vehicles_trucks(void) { - s32 numTrucks; - f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; - f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; - - numTrucks = NUM_RACE_TANKER_TRUCKS; - if (gModeSelection == TIME_TRIALS) { - numTrucks = NUM_TIME_TRIAL_TANKER_TRUCKS; - } - initialize_toads_turnpike_vehicle(a, b, numTrucks, 50, gTankerTruckList, &D_80164550[0][0]); -} - -void update_vehicle_tanker_trucks(void) { - s32 loopIndex; - for (loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) { - update_vehicle_follow_waypoint(&gTankerTruckList[loopIndex]); - } -} - -void func_80014B6C(s32 playerId, Player* player) { - func_80013F7C(playerId, player, gTankerTruckList, 55.0f, 12.5f, NUM_RACE_TANKER_TRUCKS, - SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x04)); -} - -void func_80014BB4(s32 playerId) { - func_800146B8(playerId, NUM_RACE_TANKER_TRUCKS, gTankerTruckList); -} - -void init_vehicles_cars(void) { - s32 numCars; - f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; - f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; - - numCars = NUM_RACE_CARS; - if (gModeSelection == TIME_TRIALS) { - numCars = NUM_TIME_TRIAL_CARS; - } - initialize_toads_turnpike_vehicle(a, b, numCars, 25, gCarList, &D_80164550[0][0]); -} - -void update_vehicle_cars(void) { - s32 loopIndex; - for (loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) { - update_vehicle_follow_waypoint(&gCarList[loopIndex]); - } -} - -void func_80014CC0(s32 playerId, Player* player) { - func_80013F7C(playerId, player, gCarList, 11.5f, 8.5f, NUM_RACE_CARS, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x05)); -} - -void func_80014D08(s32 playerId) { - func_800146B8(playerId, NUM_RACE_CARS, gCarList); -} - -void func_80014D30(s32 cameraId, s32 pathIndex) { - s16 cameraWaypoint; - TrackWaypoint* temp_v0; - - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - temp_v0 = &D_80164550[pathIndex][cameraWaypoint]; - check_bounding_collision(&cameras[cameraId].collision, 10.0f, (f32) temp_v0->posX, (f32) temp_v0->posY + 30.0f, - (f32) temp_v0->posZ); -} - -void func_80014DE4(s32 cameraIndex) { - s32 cameraId; - - D_801646CC = 0; - D_80164678[cameraIndex] = D_80164670[cameraIndex]; - if ((gModeSelection != 1) && ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == (u16) 1))) { - D_80164678[cameraIndex] = 0; - } else if ((D_80164678[cameraIndex] != 0) && (D_80164678[cameraIndex] != (s16) 1) && - (D_80164678[cameraIndex] != 2) && (D_80164678[cameraIndex] != 3)) { - D_80164678[cameraIndex] = 0; - } - D_80164680[cameraIndex] = -1; - D_80163238 = 0; - D_801646C0[cameraIndex] = 0; - D_801646C8 = 0; - D_801646D0[cameraIndex].unk0 = 0; - D_801646D0[cameraIndex].unk2 = 0; - D_801646D0[cameraIndex].unk4 = 0; - if ((gModeSelection == 1) && (D_8018EDFC == 0)) { - D_80164678[cameraIndex] = 0; - } - - for (cameraId = 0; cameraId < 4; cameraId++) { - gNearestWaypointByCameraId[cameraId] = 0; - } -} - -f32 func_80014EE4(f32 arg0, s32 arg1) { - f32 temp_f0; - f64 temp_f2; - - temp_f0 = D_80164498[arg1]; - switch (D_80164678[arg1]) { /* irregular */ - default: - arg0 = 40.0f; - break; - case 0: - temp_f2 = 40.0; - temp_f2 += temp_f0; - if (temp_f2 < arg0) { - arg0 -= 1.0; - if (arg0 < temp_f2) { - arg0 = temp_f2; - } - } - if (arg0 < temp_f2) { - arg0 += 1.0; - if (temp_f2 < arg0) { - arg0 = temp_f2; - ; - } - } - break; - case 1: - temp_f2 = 60.0; - temp_f2 += temp_f0; - if (arg0 < temp_f2) { - arg0 += 1.0; - if (temp_f2 < arg0) { - arg0 = temp_f2; - } - } - if (temp_f2 < arg0) { - arg0 -= 1.0; - if (arg0 < temp_f2) { - arg0 = temp_f2; - ; - } - } - break; - case 3: - temp_f2 = 60.0; - temp_f2 += temp_f0; - if (arg0 < temp_f2) { - arg0 += 0.5; - if (temp_f2 < arg0) { - arg0 = temp_f2; - } - } - if (temp_f2 < arg0) { - arg0 -= 0.5; - if (arg0 < temp_f2) { - arg0 = temp_f2; - } - } - break; - case 2: - temp_f2 = 60.0; - temp_f2 += temp_f0; - if (arg0 < temp_f2) { - arg0 += 1.0; - if (temp_f2 < arg0) { - arg0 = temp_f2; - } - } - if (temp_f2 < arg0) { - arg0 -= 1.0; - if (arg0 < temp_f2) { - arg0 = temp_f2; - } - } - break; - } - return arg0; -} - -void calculate_camera_up_vector(Camera* camera, s32 cameraIndex) { - f32 xnorm; - f32 ynorm; - f32 znorm; - f32 xdiff; - f32 ydiff; - f32 zdiff; - f32 distance; - f32 sp28; - u16 thing; - - thing = D_801646C0[cameraIndex]; - if (thing == 0) { - camera->up[0] = 0.0f; - camera->up[2] = 0.0f; - camera->up[1] = 1.0f; - } else { - xdiff = camera->lookAt[0] - camera->pos[0]; - ydiff = camera->lookAt[1] - camera->pos[1]; - zdiff = camera->lookAt[2] - camera->pos[2]; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - xnorm = xdiff / distance; - ynorm = ydiff / distance; - znorm = zdiff / distance; - sp28 = 1.0 - coss(thing); - camera->up[0] = (sp28 * xnorm * ynorm) - (sins(thing) * znorm); - camera->up[1] = coss(thing) + (sp28 * ynorm * ynorm); - camera->up[2] = (sins(thing) * xnorm) + (sp28 * ynorm * znorm); - } -} - -UNUSED void func_8001530C(void) { -} - -void func_80015314(s32 playerId, UNUSED f32 arg1, s32 cameraId) { - Camera* temp_a0; - Player* temp_a1; - - // wtf is up with the pointer accesses here? - // What aren't they just doing thing = &some_pointer[some_index]? - temp_a1 = gPlayerOne; - temp_a0 = camera1; - temp_a1 += playerId; - temp_a0 += cameraId; - temp_a0->unk_2C = temp_a1->rotation[1]; - func_80015390(temp_a0, temp_a1, 0); -} - -void func_80015390(Camera* camera, UNUSED Player* player, UNUSED s32 arg2) { - UNUSED s32 pad[6]; - f32 temp_f12; - f32 sp90; - f32 temp_f14; - Player* temp_s1; - f32 sp84; - f32 sp80; - f32 sp7C; - UNUSED Vec3f pad2; - Vec3f sp64; - UNUSED s32 pad3[9]; - s16 var_a2; - - /* - Doing the more sensible: - temp_s1 = &gPlayerOne[camera->playerId]; - leads to some regalloc differences - */ - temp_s1 = gPlayerOne; - temp_s1 += camera->playerId; - if (temp_s1->unk_078 == 0) { - var_a2 = 0x0064; - } else if (temp_s1->unk_078 < 0) { - var_a2 = 0xA0 - (temp_s1->unk_078 / 16); - } else { - var_a2 = 0xA0 + (temp_s1->unk_078 / 16); - } - if (!((temp_s1->effects & 0x80) || (temp_s1->effects & 0x40))) { - adjust_angle(&camera->unk_2C, temp_s1->rotation[1], var_a2); - } - func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C); - check_bounding_collision(&camera->collision, 10.0f, sp84, sp80, sp7C); - camera->lookAt[0] = sp64[0]; - camera->lookAt[1] = sp64[1]; - camera->lookAt[2] = sp64[2]; - camera->pos[0] = sp84; - camera->pos[1] = sp80; - camera->pos[2] = sp7C; - temp_f12 = camera->lookAt[0] - camera->pos[0]; - sp90 = camera->lookAt[1] - camera->pos[1]; - temp_f14 = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(temp_f12, temp_f14); - camera->rot[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), sp90); - camera->rot[2] = 0; -} - -void func_80015544(s32 playerId, f32 arg1, s32 cameraId, s32 pathIndex) { - Camera* camera; - - f32 temp_f12; - f32 temp_f2; - s32 test = gWaypointCountByPathIndex[pathIndex]; - - D_80164688[cameraId] = arg1; - camera = cameras + cameraId; - gNearestWaypointByCameraId[cameraId] = (gNearestWaypointByPlayerId[playerId] + 10) % test; - - func_8000BBD8(gNearestWaypointByCameraId[cameraId], arg1, pathIndex); - - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164638[cameraId] = D_80162FA0[2]; - - temp_f2 = (f32) D_80164550[pathIndex][gNearestWaypointByCameraId[cameraId]].posY; - - temp_f12 = spawn_actor_on_surface(D_80162FA0[0], (f32) (temp_f2 + 30.0), D_80162FA0[2]); - if ((temp_f12 < (temp_f2 - 20.0)) || (temp_f12 >= 3000.0)) { - D_80164618[cameraId] = (f32) (temp_f2 + 10.0); - } else { - D_80164618[cameraId] = (f32) (temp_f12 + 10.0); - } - D_80164648[cameraId] = 0.0f; - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_8001577C(Camera* camera, UNUSED Player* playerArg, UNUSED s32 arg2, s32 cameraId) { - s16 cameraWaypoint; - s16 playerWaypoint; - UNUSED s32 pad; - f32 xdiff; - f32 ydiff; - f32 zdiff; - UNUSED s32 pad2; - s32 playerId; - UNUSED s32 pad3[9]; - Player* player; - s32 waypointDiff; - s32 pathIndex; - - playerId = camera->playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - player = gPlayerOne; - player += playerId; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - playerWaypoint = gNearestWaypointByPlayerId[playerId]; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 0x0032U, 0x000FU, gWaypointCountByPathIndex[pathIndex]) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } else { - if (D_80163068[playerId] < (-0.7)) { - waypointDiff = playerWaypoint - cameraWaypoint; - if ((D_80164688[cameraId] < (-0.5)) && ((waypointDiff * waypointDiff) < 5)) { - func_8001A348(cameraId, 1.0f, 3); - goto alable; - } - } - // clang-format off - // I hate this, but a fakematch is a fakematch - if (D_80163068[playerId] > 0.7) { waypointDiff = playerWaypoint - cameraWaypoint; if ((D_80164688[cameraId] > 0.5) && ((waypointDiff * waypointDiff) < 5)) { - func_8001A348(cameraId, -1.0f, 2); - // clang-format on - } - } - } -alable: - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; - camera->lookAt[0] = player->pos[0]; - camera->lookAt[1] = player->pos[1] + 6.0; - camera->lookAt[2] = player->pos[2]; - func_80014D30(cameraId, pathIndex); - xdiff = camera->lookAt[0] - camera->pos[0]; - ydiff = camera->lookAt[1] - camera->pos[1]; - zdiff = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(xdiff, zdiff); - camera->rot[0] = atan2s(sqrtf((xdiff * xdiff) + (zdiff * zdiff)), ydiff); - camera->rot[2] = 0; -} - -void func_80015A9C(s32 playerId, f32 arg1, s32 cameraId, s16 pathIndex) { - Camera* camera = cameras + cameraId; - - D_80164688[cameraId] = arg1; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByPlayerId[playerId] + 10; - gNearestWaypointByCameraId[cameraId] = - (gNearestWaypointByCameraId[cameraId]) % gWaypointCountByPathIndex[pathIndex]; - - func_8000BBD8(gNearestWaypointByCameraId[cameraId], arg1, pathIndex); - - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164618[cameraId] = (f32) D_80164550[pathIndex][gNearestWaypointByCameraId[cameraId]].posY; - D_80164638[cameraId] = D_80162FA0[2]; - - D_80164648[cameraId] = gPlayers[playerId].unk_094 / 5.0f; - if ((f64) D_80164648[cameraId] < 0.0) { - D_80164648[cameraId] = 0.0f; - } - - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_80015C94(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { - s16 playerWaypoint; - s16 cameraWaypoint; - UNUSED s32 stackPadding0; - f32 xdiff2; - f32 ydiff2; - f32 zdiff2; - Player* player; - s32 playerId; - f32 midX; - f32 midY; - f32 midZ; - f32 xdiff; - f32 ydiff; - f32 zdiff; - f32 distance; - UNUSED s32 stackPadding1; - s16 waypoint1; - s16 waypoint2; - UNUSED f32 var_f18; - UNUSED f32 var_f20; - f32 temp_f2_2; - s32 pathIndex; - - playerId = camera->playerId; - player = gPlayerOne; - player += playerId; - D_80163238 = playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - playerWaypoint = gNearestWaypointByPlayerId[playerId]; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 0x0032U, 0x000FU, gWaypointCountByPathIndex[pathIndex]) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } else if ((D_80163068[playerId] < -0.5) && (D_80164688[cameraId] < -0.5)) { - func_8001A348(cameraId, 1.0f, 7); - } else if ((D_80163068[playerId] > 0.5) && (D_80164688[cameraId] > 0.5)) { - func_8001A348(cameraId, -1.0f, 6); - } - waypoint1 = (gNearestWaypointByCameraId[cameraId] + 1) % gWaypointCountByPathIndex[pathIndex]; - waypoint2 = (gNearestWaypointByCameraId[cameraId] + 2) % gWaypointCountByPathIndex[pathIndex]; - func_8000BBD8(waypoint1, D_80164688[cameraId], pathIndex); - midX = D_80162FA0[0] * 0.5; - midZ = D_80162FA0[2] * 0.5; - func_8000BBD8(waypoint2, D_80164688[cameraId], pathIndex); - midX += D_80162FA0[0] * 0.5; - midZ += D_80162FA0[2] * 0.5; - midY = (D_80164550[pathIndex][waypoint1].posY + D_80164550[pathIndex][waypoint2].posY) / 2.0; - xdiff = midX - D_801645F8[cameraId]; - ydiff = midY - D_80164618[cameraId]; - zdiff = midZ - D_80164638[cameraId]; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance != 0.0) { - midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); - midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); - midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); - } else { - midX = D_801645F8[cameraId]; - midY = D_80164618[cameraId]; - midZ = D_80164638[cameraId]; - } - camera->pos[0] = midX; - camera->pos[2] = midZ; - temp_f2_2 = spawn_actor_on_surface(midX, (midY + 30.0), midZ); - if ((temp_f2_2 < (midY - 20.0)) || (temp_f2_2 >= 3000.0)) { - camera->pos[1] = midY + 10.0; - } else { - camera->pos[1] = temp_f2_2 + 8.0; - } - D_801645F8[cameraId] = midX; - D_80164618[cameraId] = midY; - D_80164638[cameraId] = midZ; - camera->lookAt[0] = player->pos[0]; - camera->lookAt[1] = player->pos[1] + 6.0; - camera->lookAt[2] = player->pos[2]; - func_80014D30(cameraId, pathIndex); - xdiff2 = camera->lookAt[0] - camera->pos[0]; - ydiff2 = camera->lookAt[1] - camera->pos[1]; - zdiff2 = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(xdiff2, zdiff2); - camera->rot[0] = atan2s(sqrtf((xdiff2 * xdiff2) + (zdiff2 * zdiff2)), ydiff2); - camera->rot[2] = 0; -} - -void func_800162CC(s32 playerId, f32 arg1, s32 cameraId, s16 pathIndex) { - Camera* camera = cameras + cameraId; - - D_80164688[cameraId] = arg1; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByPlayerId[playerId]; - gNearestWaypointByCameraId[cameraId] = - (gNearestWaypointByCameraId[cameraId]) % gWaypointCountByPathIndex[pathIndex]; - - func_8000BBD8(gNearestWaypointByCameraId[cameraId], arg1, pathIndex); - - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164618[cameraId] = (f32) D_80164550[pathIndex][gNearestWaypointByCameraId[cameraId]].posY; - D_80164638[cameraId] = D_80162FA0[2]; - - D_80164658[cameraId] = gPlayers[playerId].unk_094; - D_80164648[cameraId] = gPlayers[playerId].unk_094; - - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_80016494(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { - s16 cameraWaypoint; - s16 playerWaypoint; - UNUSED s32 stackPadding0; - f32 xdiff2; - f32 ydiff2; - f32 zdiff2; - Player* player; - s32 playerId; - f32 midX; - f32 midY; - f32 midZ; - f32 xdiff; - f32 ydiff; - f32 zdiff; - f32 distance; - UNUSED f32 sp98; - s16 waypoint1; - s16 waypoint2; - UNUSED f32 sp94; - UNUSED f32 sp90; - UNUSED s32 stackPadding1; - s32 pathIndex; - f32 temp_f2_5; - - playerId = camera->playerId; - player = gPlayerOne; - D_80164648[cameraId] += ((D_80164658[cameraId] - D_80164648[cameraId]) * 0.5f); - D_80163238 = playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - player += playerId; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - temp_f2_5 = (D_80163068[playerId] - D_80164688[cameraId]); - temp_f2_5 *= temp_f2_5; - playerWaypoint = gNearestWaypointByPlayerId[playerId]; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 0x000FU, 0x000FU, gWaypointCountByPathIndex[pathIndex]) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } else { - if ((D_80163068[playerId] < 0.0) && (D_80164688[cameraId] < 0.0) && (temp_f2_5 < 0.01)) { - func_8001A348(cameraId, 1.0f, 5); - } else { - if ((D_80163068[playerId] > 0.0) && (D_80164688[cameraId] > 0.0) && (temp_f2_5 < 0.01)) { - func_8001A348(cameraId, -1.0f, 4); - } else { - if ((cameraWaypoint < playerWaypoint) && ((playerWaypoint - cameraWaypoint) < 0xA)) { - D_80164658[cameraId] = gPlayers[playerId].unk_094 + 0.4; - } - if ((playerWaypoint < cameraWaypoint) && ((cameraWaypoint - playerWaypoint) < 0xA)) { - D_80164658[cameraId] = gPlayers[playerId].unk_094 - 0.4; - } - if (D_80164658[cameraId] > 10.0) { - D_80164658[cameraId] = 10.0f; - } - if (D_80164658[cameraId] < 0.0) { - D_80164658[cameraId] = 0.0f; - } - } - } - } - waypoint1 = (gNearestWaypointByCameraId[cameraId] + 1) % gWaypointCountByPathIndex[pathIndex]; - waypoint2 = (gNearestWaypointByCameraId[cameraId] + 2) % gWaypointCountByPathIndex[pathIndex]; - func_8000BBD8(waypoint1, D_80164688[cameraId], pathIndex); - midX = D_80162FA0[0] * 0.5; - midZ = D_80162FA0[2] * 0.5; - func_8000BBD8(waypoint2, D_80164688[cameraId], pathIndex); - midX += D_80162FA0[0] * 0.5; - midZ += D_80162FA0[2] * 0.5; - midY = (D_80164550[pathIndex][waypoint1].posY + D_80164550[pathIndex][waypoint2].posY) / 2.0; - xdiff = midX - D_801645F8[cameraId]; - ydiff = midY - D_80164618[cameraId]; - zdiff = midZ - D_80164638[cameraId]; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance != 0.0) { - midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); - midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); - midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); - } else { - midX = D_801645F8[cameraId]; - midY = D_80164618[cameraId]; - midZ = D_80164638[cameraId]; - } - camera->pos[0] = midX; - camera->pos[2] = midZ; - temp_f2_5 = spawn_actor_on_surface(midX, midY + 30.0, midZ); - if ((temp_f2_5 < (midY - 20.0)) || (temp_f2_5 >= 3000.0)) { - camera->pos[1] = midY + 10.0; - } else { - camera->pos[1] = temp_f2_5 + 10.0; - } - D_801645F8[cameraId] = midX; - D_80164618[cameraId] = midY; - D_80164638[cameraId] = midZ; - camera->lookAt[0] = player->pos[0]; - camera->lookAt[1] = player->pos[1] + 6.0; - camera->lookAt[2] = player->pos[2]; - func_80014D30(cameraId, pathIndex); - xdiff2 = camera->lookAt[0] - camera->pos[0]; - ydiff2 = camera->lookAt[1] - camera->pos[1]; - zdiff2 = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(xdiff2, zdiff2); - camera->rot[0] = atan2s(sqrtf((xdiff2 * xdiff2) + (zdiff2 * zdiff2)), ydiff2); - camera->rot[2] = 0; -} - -void func_80016C3C(UNUSED s32 playerId, UNUSED f32 arg1, s32 cameraId) { - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; - f32 temp_f2; - UNUSED s32 stackPadding2; - f32 temp_f12; - TrackWaypoint** path; - f32 sp54; - s32 temp_s0; - s16 sp48; - s16 sp44; - Camera* camera; - - if (random_int(0x0064U) < 0x32) { - D_80164688[cameraId] = 0.1f; - } else { - D_80164688[cameraId] = -0.1f; - } - D_80163DD8[cameraId] = 0; - if (gCurrentCourseId == 4) { - D_80163DD8[cameraId] = random_int(4U); - D_80164688[cameraId] = 0.0f; - } - temp_s0 = gWaypointCountByPathIndex[D_80163DD8[cameraId]]; - gNearestWaypointByCameraId[cameraId] %= temp_s0; - func_8000BBD8(gNearestWaypointByCameraId[cameraId], D_80164688[cameraId], 0); - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164618[cameraId] = D_80164550[0][gNearestWaypointByCameraId[cameraId]].posY; - path = D_80164550; - D_80164638[cameraId] = D_80162FA0[2]; - D_80164658[cameraId] = 16.666666f; - D_80164648[cameraId] = 0.0f; - sp48 = (gNearestWaypointByCameraId[cameraId] + 0xA) % temp_s0; - sp44 = (gNearestWaypointByCameraId[cameraId] + 0xB) % temp_s0; - func_8000BBD8(sp48, D_80164688[cameraId], 0); - temp_f2 = D_80162FA0[0] * 0.5; - temp_f12 = D_80162FA0[2] * 0.5; - func_8000BBD8(sp44, D_80164688[cameraId], 0); - temp_f2 += D_80162FA0[0] * 0.5; - temp_f12 += D_80162FA0[2] * 0.5; - sp48 = (gNearestWaypointByCameraId[cameraId] + 0x5) % temp_s0; - sp44 = (gNearestWaypointByCameraId[cameraId] + 0x6) % temp_s0; - sp54 = (path[0][sp48].posY + path[0][sp44].posY) * 0.5f; - camera = cameras; - camera += cameraId; - camera->lookAt[0] = temp_f2; - camera->lookAt[2] = temp_f12; - camera->lookAt[1] = sp54 + 8.0; - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_80017054(Camera* camera, UNUSED Player* player, UNUSED s32 index, s32 cameraId); -#ifdef NON_MATCHING -// https://decomp.me/scratch/Ck7hV -// Really crazy diff, permuter only able to find fakematches for improvements (and they're big improvements) -// There's something really, really wrong with the empty `if` statement -void func_80017054(Camera* camera, UNUSED Player* player, UNUSED s32 index, s32 cameraId) { - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; - f32 spAC; - f32 spA8; - f32 spA4; - UNUSED s32 stackPadding2; - UNUSED s32 stackPadding3; - f32 sp98; - f32 sp94; - f32 sp90; - f32 sp8C; - f32 sp88; - f32 sp84; - UNUSED f32 stackPadding4; - UNUSED f32 stackPadding5; - UNUSED f32 stackPadding6; - UNUSED s32 stackPadding7; - UNUSED s32 stackPadding8; - s16 sp6E; - s16 sp6C; - UNUSED s32 stackPadding9; - UNUSED s32 stackPaddingA; - UNUSED s32 stackPaddingB; - s32 pathIndex; - UNUSED s32 stackPaddingC; - s32 sp58; - s16 sp56; - s32 playerId; - - playerId = camera->playerId; - pathIndex = D_80163DD8[cameraId]; - D_80164648[cameraId] += (D_80164658[cameraId] - D_80164648[cameraId]) * 0.5f; - sp58 = gWaypointCountByPathIndex[pathIndex]; - D_80163238 = playerId; - sp56 = gNearestWaypointByCameraId[cameraId]; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - if (gCurrentCourseId == 4) { - if ((sp56 != gNearestWaypointByCameraId[cameraId]) && (gNearestWaypointByCameraId[cameraId] == 1)) { - pathIndex = (D_80163DD8[cameraId] = random_int(4U)); - gNearestWaypointByCameraId[cameraId] = func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], - gNearestWaypointByCameraId[cameraId], pathIndex); - } - } - sp6E = (gNearestWaypointByCameraId[cameraId] + 0xA) % sp58; - sp6C = (gNearestWaypointByCameraId[cameraId] + 0xB) % sp58; - func_8000BBD8(sp6E, D_80164688[cameraId], pathIndex); - sp8C = D_80162FA0[0] * 0.5; - sp84 = D_80162FA0[2] * 0.5; - func_8000BBD8(sp6C, D_80164688[cameraId], pathIndex); - sp8C += D_80162FA0[0] * 0.5; - sp84 += D_80162FA0[2] * 0.5; - sp6E = (gNearestWaypointByCameraId[cameraId] + 5) % sp58; - sp6C = (gNearestWaypointByCameraId[cameraId] + 6) % sp58; - sp88 = (D_80164550[pathIndex][sp6E].posY + D_80164550[pathIndex][sp6C].posY) * 0.5f; - sp6E = (gNearestWaypointByCameraId[cameraId] + 1) % sp58; - sp6C = (gNearestWaypointByCameraId[cameraId] + 2) % sp58; - func_8000BBD8(sp6E, D_80164688[cameraId], pathIndex); - sp98 = D_80162FA0[0] * 0.5; - sp90 = D_80162FA0[2] * 0.5; - func_8000BBD8(sp6C, D_80164688[cameraId], pathIndex); - sp98 += D_80162FA0[0] * 0.5; - sp90 += D_80162FA0[2] * 0.5; - sp94 = (D_80164550[pathIndex][sp6E].posY + D_80164550[pathIndex][sp6C].posY) * 0.5f; - stackPadding4 = sp98 - D_801645F8[cameraId]; - stackPadding5 = sp90 - D_80164618[cameraId]; - stackPadding6 = sp94 - D_80164638[cameraId]; - spAC = sqrtf(((sp98 * sp98) + (sp94 * sp94)) + (sp90 * sp90)); - if (spAC != 0.0) { - sp98 = D_801645F8[cameraId] + ((D_80164648[cameraId] * stackPadding4) / spAC); - sp94 = D_80164618[cameraId] + ((D_80164648[cameraId] * stackPadding5) / spAC); - sp90 = D_80164638[cameraId] + ((D_80164648[cameraId] * stackPadding6) / spAC); - } else { - sp98 = D_801645F8[cameraId]; - sp94 = D_80164618[cameraId]; - sp90 = D_80164638[cameraId]; - } - if ((!(sp98 < (-10000.0))) && (sp98 > 10000.0)) { - if (sp98 && sp98) {} - } - camera->pos[0] = sp98; - camera->pos[1] = sp94 + 10.0; - camera->pos[2] = sp90; - if (1) {} - if (1) {} - if (1) {} - if (1) {} - if (1) {} - D_801645F8[cameraId] = sp98; - D_80164638[cameraId] = sp90; - D_80164618[cameraId] = sp94; - camera->lookAt[0] = sp8C; - camera->lookAt[1] = sp88 + 8.0; - camera->lookAt[2] = sp84; - func_80014D30(cameraId, pathIndex); - spAC = camera->lookAt[0] - camera->pos[0]; - spA8 = camera->lookAt[1] - camera->pos[1]; - spA4 = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(spAC, spA4); - camera->rot[0] = atan2s(sqrtf((spAC * spAC) + (spA4 * spA4)), spA8); - camera->rot[2] = 0; -} -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80017054.s") -#endif - -void func_80017720(s32 playerId, UNUSED f32 arg1, s32 cameraId, s16 pathIndex) { - Camera* camera = cameras + cameraId; - UNUSED s32 pad; - - D_80164688[cameraId] = D_80163068[playerId]; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByPlayerId[playerId] + 3; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByCameraId[cameraId] % gWaypointCountByPathIndex[pathIndex]; - - func_8000BBD8(gNearestWaypointByCameraId[cameraId], D_80163068[playerId], pathIndex); - - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164618[cameraId] = (f32) D_80164550[pathIndex][gNearestWaypointByCameraId[cameraId]].posY; - D_80164638[cameraId] = D_80162FA0[2]; - - D_80164658[cameraId] = gPlayers[playerId].unk_094; - D_80164648[cameraId] = gPlayers[playerId].unk_094; - - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_800178F4(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { - s16 cameraWaypoint; - s16 playerWaypoint; - UNUSED f32 stackPadding0; - f32 xdiff2; - f32 ydiff2; - f32 zdiff2; - Player* player; - f32 distance; - f32 midX; - f32 midY; - f32 midZ; - f32 xdiff; - f32 ydiff; - f32 zdiff; - UNUSED f32 var_f2; - UNUSED f32 var_f18; - s16 waypoint1; - s16 waypoint2; - UNUSED f32 stackPadding1; - UNUSED f32 var_f14; - s32 playerId; - s32 pathIndex; - s32 waypointCount; - - playerId = camera->playerId; - player = gPlayerOne; - D_80164688[cameraId] = D_80163068[playerId]; - D_80164648[cameraId] += ((D_80164658[cameraId] - D_80164648[cameraId]) / 2.0f); - D_80163238 = playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - player += playerId; - waypointCount = gWaypointCountByPathIndex[pathIndex]; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - playerWaypoint = (gNearestWaypointByPlayerId[playerId] + 3) % waypointCount; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 0x000DU, 1U, waypointCount) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } else { - if ((cameraWaypoint < playerWaypoint) && ((playerWaypoint - cameraWaypoint) < 3)) { - D_80164658[cameraId] = gPlayers[playerId].unk_094 + 0.1; - } - if ((playerWaypoint < cameraWaypoint) && ((cameraWaypoint - playerWaypoint) < 3)) { - D_80164658[cameraId] = gPlayers[playerId].unk_094 - 0.1; - } - if (D_80164658[cameraId] > 10.0) { - D_80164658[cameraId] = 10.0f; - } - if (D_80164658[cameraId] < 0.0) { - D_80164658[cameraId] = 0.0f; - } - } - waypoint1 = (gNearestWaypointByCameraId[cameraId] + 1) % waypointCount; - waypoint2 = (gNearestWaypointByCameraId[cameraId] + 2) % waypointCount; - func_8000BBD8(waypoint1, D_80164688[cameraId], pathIndex); - midX = D_80162FA0[0] * 0.5; - midZ = D_80162FA0[2] * 0.5; - func_8000BBD8(waypoint2, D_80164688[cameraId], pathIndex); - midX += D_80162FA0[0] * 0.5; - midZ += D_80162FA0[2] * 0.5; - midY = (D_80164550[pathIndex][waypoint1].posY + D_80164550[pathIndex][waypoint2].posY) / 2.0; - xdiff = midX - D_801645F8[cameraId]; - ydiff = midY - D_80164618[cameraId]; - zdiff = midZ - D_80164638[cameraId]; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance != 0.0) { - midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); - midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); - midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); - } else { - midX = D_801645F8[cameraId]; - midY = D_80164618[cameraId]; - midZ = D_80164638[cameraId]; - } - camera->pos[0] = midX; - camera->pos[2] = midZ; - camera->pos[1] = midY + 10.0; - D_801645F8[cameraId] = midX; - D_80164618[cameraId] = midY; - D_80164638[cameraId] = midZ; - camera->lookAt[0] = player->pos[0]; - camera->lookAt[1] = player->pos[1] + 6.0; - camera->lookAt[2] = player->pos[2]; - func_80014D30(cameraId, pathIndex); - xdiff2 = camera->lookAt[0] - camera->pos[0]; - ydiff2 = camera->lookAt[1] - camera->pos[1]; - zdiff2 = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(xdiff2, zdiff2); - camera->rot[0] = atan2s(sqrtf((xdiff2 * xdiff2) + (zdiff2 * zdiff2)), ydiff2); - camera->rot[2] = 0; -} - -void func_80017F10(s32 playerId, UNUSED f32 arg1, s32 cameraId, s16 pathIndex) { - Camera* camera = cameras + cameraId; - s32 test = gWaypointCountByPathIndex[pathIndex]; - - D_80164688[cameraId] = D_80163068[playerId]; - gNearestWaypointByCameraId[cameraId] = (gNearestWaypointByPlayerId[playerId] + test) - 2; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByCameraId[cameraId] % test; - - func_8000BBD8(gNearestWaypointByCameraId[cameraId], D_80163068[playerId], pathIndex); - - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164618[cameraId] = (f32) D_80164550[pathIndex][gNearestWaypointByCameraId[cameraId]].posY; - D_80164638[cameraId] = D_80162FA0[2]; - - D_80164658[cameraId] = gPlayers[playerId].unk_094; - D_80164648[cameraId] = gPlayers[playerId].unk_094; - - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_800180F0(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { - s16 cameraWaypoint; - s16 playerWaypoint; - UNUSED s32 stackPadding3; - f32 sp94; - f32 sp90; - f32 sp8C; - UNUSED s32 stackPadding4; - f32 distance; - f32 midX; - f32 midY; - f32 midZ; - f32 xdiff; - f32 ydiff; - f32 zdiff; - Player* player; - s32 playerId; - s16 waypoint1; - s16 waypoint2; - UNUSED f32 var_f2; - UNUSED f32 var_f18; - UNUSED f32 var_f14; - s32 pathIndex; - s32 waypointCount; - - playerId = camera->playerId; - player = gPlayerOne; - D_80164688[cameraId] = D_80163068[playerId]; - D_80164648[cameraId] += ((D_80164658[cameraId] - D_80164648[cameraId]) * 0.5f); - D_80163238 = playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - waypointCount = gWaypointCountByPathIndex[pathIndex]; - player += playerId; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - playerWaypoint = ((gNearestWaypointByPlayerId[playerId] + waypointCount) - 2) % waypointCount; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 1U, 0x000AU, waypointCount) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } else { - if ((cameraWaypoint < playerWaypoint) && ((playerWaypoint - cameraWaypoint) < 3)) { - D_80164658[cameraId] = gPlayers[playerId].unk_094 + 0.1; - } - if ((playerWaypoint < cameraWaypoint) && ((cameraWaypoint - playerWaypoint) < 3)) { - D_80164658[cameraId] = gPlayers[playerId].unk_094 - 0.1; - } - if (D_80164658[cameraId] > 10.0) { - D_80164658[cameraId] = 10.0f; - } - if (D_80164658[cameraId] < 0.0) { - D_80164658[cameraId] = 0.0f; - } - } - waypoint1 = (gNearestWaypointByCameraId[cameraId] + 1) % waypointCount; - waypoint2 = (gNearestWaypointByCameraId[cameraId] + 2) % waypointCount; - func_8000BBD8(waypoint1, D_80164688[cameraId], pathIndex); - midX = D_80162FA0[0] * 0.5; - midZ = D_80162FA0[2] * 0.5; - func_8000BBD8(waypoint2, D_80164688[cameraId], pathIndex); - midX += D_80162FA0[0] * 0.5; - midZ += D_80162FA0[2] * 0.5; - midY = (D_80164550[pathIndex][waypoint1].posY + D_80164550[pathIndex][waypoint2].posY) / 2.0; - xdiff = midX - D_801645F8[cameraId]; - ydiff = midY - D_80164618[cameraId]; - zdiff = midZ - D_80164638[cameraId]; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance != 0.0) { - midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); - midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); - midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); - } else { - midX = D_801645F8[cameraId]; - midY = D_80164618[cameraId]; - midZ = D_80164638[cameraId]; - } - camera->pos[0] = midX; - camera->pos[2] = midZ; - camera->pos[1] = player->pos[1] + 10.0; - D_801645F8[cameraId] = midX; - D_80164618[cameraId] = midY; - D_80164638[cameraId] = midZ; - camera->lookAt[0] = player->pos[0]; - camera->lookAt[1] = player->pos[1] + 6.0; - camera->lookAt[2] = player->pos[2]; - func_80014D30(cameraId, pathIndex); - sp94 = camera->lookAt[0] - camera->pos[0]; - sp90 = camera->lookAt[1] - camera->pos[1]; - sp8C = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(sp94, sp8C); - camera->rot[0] = atan2s(sqrtf((sp94 * sp94) + (sp8C * sp8C)), sp90); - camera->rot[2] = 0; -} - -void func_80018718(s32 playerId, UNUSED f32 arg1, s32 cameraId, s16 pathIndex) { - Camera* camera = cameras + cameraId; - s32 test = gWaypointCountByPathIndex[pathIndex]; - - D_80164688[cameraId] = D_80163068[playerId]; - gNearestWaypointByCameraId[cameraId] = ((gNearestWaypointByPlayerId[playerId] + test) - 5) % test; - - func_8000BA14(gNearestWaypointByCameraId[cameraId], D_80163068[playerId], 60.0f, pathIndex); - - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164618[cameraId] = (f32) D_80164550[pathIndex][gNearestWaypointByCameraId[cameraId]].posY; - D_80164638[cameraId] = D_80162FA0[2]; - - D_80164658[cameraId] = gPlayers[playerId].unk_094; - D_80164648[cameraId] = gPlayers[playerId].unk_094; - D_8016448C = 1; - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_800188F4(Camera* camera, UNUSED Player* unusePlayer, UNUSED s32 arg2, s32 cameraId) { - s16 cameraWaypoint; - s16 playerWaypoint; - UNUSED s32 stackPadding0; - f32 spAC; - f32 spA8; - f32 spA4; - Player* player; - f32 distance; - f32 midX; - f32 midY; - f32 midZ; - f32 xdiff; - f32 ydiff; - f32 zdiff; - UNUSED f32 sp64; - UNUSED f32 sp60; - s16 waypoint1; - s16 waypoint2; - UNUSED f32 sp5C; - f32 temp_f2_4; - s32 playerId; - s32 pathIndex; - s32 waypointCount; - - player = gPlayerOne; - playerId = camera->playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - waypointCount = gWaypointCountByPathIndex[pathIndex]; - D_80164648[cameraId] = gPlayers[playerId].unk_094; - if (D_8016448C == 0) { - if (gNearestWaypointByCameraId[cameraId] == - (((gNearestWaypointByPlayerId[playerId] + waypointCount) - 6) % waypointCount)) { - D_8016448C = 1; - } - if (D_80164688[cameraId] < (D_80163068[playerId] - 0.2)) { - D_80164648[cameraId] = gPlayers[playerId].unk_094 * 0.7; - } - if ((D_80163068[playerId] - 0.5) < D_80164688[cameraId]) { - D_80164688[cameraId] -= 0.01; - } - if (D_80164688[cameraId] < -0.9) { - D_80164688[cameraId] = -0.9f; - D_80164648[cameraId] = gPlayers[playerId].unk_094 * 0.8; - } - } else { - if (gNearestWaypointByCameraId[cameraId] == ((gNearestWaypointByPlayerId[playerId] + 6) % waypointCount)) { - D_8016448C = 0; - } - if ((D_80163068[playerId] + 0.2) < D_80164688[cameraId]) { - D_80164648[cameraId] = gPlayers[playerId].unk_094 * 1.3; - } - if (D_80164688[cameraId] < (D_80163068[playerId] + 0.5)) { - D_80164688[cameraId] += 0.01; - } - if (D_80164688[cameraId] > 0.9) { - D_80164688[cameraId] = 0.9f; - D_80164648[cameraId] = gPlayers[playerId].unk_094 * 1.2; - } - } - D_80163238 = playerId; - player += playerId; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], pathIndex); - playerWaypoint = gNearestWaypointByPlayerId[playerId]; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 0x000FU, 0x000FU, waypointCount) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } - waypoint1 = (gNearestWaypointByCameraId[cameraId] + 1) % waypointCount; - waypoint2 = (gNearestWaypointByCameraId[cameraId] + 2) % waypointCount; - func_8000BA14(waypoint1, D_80164688[cameraId], 60.0f, pathIndex); - midX = D_80162FA0[0] * 0.5; - midZ = D_80162FA0[2] * 0.5; - func_8000BA14(waypoint2, D_80164688[cameraId], 60.0f, pathIndex); - midX += D_80162FA0[0] * 0.5; - midZ += D_80162FA0[2] * 0.5; - midY = (D_80164550[pathIndex][waypoint1].posY + D_80164550[pathIndex][waypoint2].posY) / 2.0; - xdiff = midX - D_801645F8[cameraId]; - ydiff = midY - D_80164618[cameraId]; - zdiff = midZ - D_80164638[cameraId]; - distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); - if (distance != 0.0) { - midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); - midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); - midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); - } else { - midX = D_801645F8[cameraId]; - midY = D_80164618[cameraId]; - midZ = D_80164638[cameraId]; - } - camera->pos[0] = midX; - camera->pos[2] = midZ; - temp_f2_4 = spawn_actor_on_surface(midX, midY + 30.0, midZ); - if ((temp_f2_4 < (midY - 20.0)) || (temp_f2_4 >= 3000.0)) { - camera->pos[1] = midY + 10.0; - } else { - camera->pos[1] = temp_f2_4 + 8.0; - } - D_801645F8[cameraId] = midX; - D_80164618[cameraId] = midY; - D_80164638[cameraId] = midZ; - camera->lookAt[0] = player->pos[0]; - camera->lookAt[1] = player->pos[1] + 6.0; - camera->lookAt[2] = player->pos[2]; - func_80014D30(cameraId, pathIndex); - spAC = camera->lookAt[0] - camera->pos[0]; - spA8 = camera->lookAt[1] - camera->pos[1]; - spA4 = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(spAC, spA4); - camera->rot[0] = atan2s(sqrtf((spAC * spAC) + (spA4 * spA4)), spA8); - camera->rot[2] = 0; -} - -void func_80019118(s32 playerId, f32 arg1, s32 cameraId, UNUSED s16 pathIndex) { - Camera* camera = cameras + cameraId; - s32 test = gWaypointCountByPathIndex[0]; - f32 temp_f12; - f32 temp_f2; - - D_80164688[cameraId] = arg1; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByPlayerId[playerId] + 12; - gNearestWaypointByCameraId[cameraId] = gNearestWaypointByCameraId[cameraId] % test; - - func_8000BBD8(gNearestWaypointByCameraId[cameraId], arg1, 0); - D_801645F8[cameraId] = D_80162FA0[0]; - D_80164638[cameraId] = D_80162FA0[2]; - temp_f2 = (f32) D_80164550[0][gNearestWaypointByCameraId[cameraId]].posY; - - temp_f12 = spawn_actor_on_surface(D_80162FA0[0], (f32) (temp_f2 + 30.0), D_80162FA0[2]); - - if ((temp_f12 < (temp_f2 - 20.0)) || (temp_f12 >= 3000.0)) { - D_80164618[cameraId] = (f32) (temp_f2 + 10.0); - } else { - D_80164618[cameraId] = (f32) (temp_f12 + 10.0); - } - D_80164648[cameraId] = 0.0f; - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; -} - -void func_8001933C(Camera* camera, UNUSED Player* playerArg, UNUSED s32 arg2, s32 cameraId) { - s16 cameraWaypoint; - s16 playerWaypoint; - UNUSED s32 pad; - f32 xdiff; - f32 ydiff; - f32 zdiff; - UNUSED s32 pad2; - s32 playerId; - UNUSED s32 pad3[10]; - Player* player; - TrackWaypoint* waypoint; - s32 pathIndex; - s32 waypointCount; - - playerId = camera->playerId; - pathIndex = gPathIndexByPlayerId[playerId]; - player = gPlayerOne; - player += playerId; - waypointCount = gWaypointCountByPathIndex[pathIndex]; - gNearestWaypointByCameraId[cameraId] = - func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestWaypointByCameraId[cameraId], 0); - playerWaypoint = gNearestWaypointByPlayerId[playerId]; - cameraWaypoint = gNearestWaypointByCameraId[cameraId]; - if (func_80007BF8(playerWaypoint, cameraWaypoint, 0x0032U, 0x0014U, waypointCount) <= 0) { - func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); - } else { - if ((D_80163068[playerId] < -0.5) && ((f64) D_80164688[cameraId] < -0.5)) { - func_8001A348(cameraId, 1.0f, 0x0000000D); - } else if ((D_80163068[playerId] > 0.5) && ((f64) D_80164688[cameraId] > 0.5)) { - func_8001A348(cameraId, -1.0f, 0x0000000C); - } - } - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; - waypoint = &D_80164550[pathIndex][cameraWaypoint]; - camera->lookAt[0] = (player->pos[0] * 0.8) + (0.2 * waypoint->posX); - camera->lookAt[1] = (player->pos[1] * 0.8) + (0.2 * waypoint->posY); - camera->lookAt[2] = (player->pos[2] * 0.8) + (0.2 * waypoint->posZ); - func_80014D30(cameraId, pathIndex); - xdiff = camera->lookAt[0] - camera->pos[0]; - ydiff = camera->lookAt[1] - camera->pos[1]; - zdiff = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(xdiff, zdiff); - camera->rot[0] = atan2s(sqrtf((xdiff * xdiff) + (zdiff * zdiff)), ydiff); - camera->rot[2] = 0; -} - -void func_8001968C(void) { - D_80164678[0] = 3; -} - -void func_8001969C(UNUSED s32 playerId, UNUSED f32 arg1, s32 cameraId, UNUSED s16 pathIndex) { - TrackWaypoint* waypoint; - - gNearestWaypointByCameraId[cameraId] = gWaypointCountByPathIndex[0] - 18; - - waypoint = &D_80164550[0][gNearestWaypointByCameraId[cameraId]]; - - D_801645F8[cameraId] = waypoint->posX; - //! @bug Adding an (f32) cast changes asm, why? - D_80164618[cameraId] = waypoint->posY + 10.0; - D_80164638[cameraId] = waypoint->posZ; - D_80164648[cameraId] = 0.0f; - D_80164678[cameraId] = 0; -} - -void func_80019760(Camera* camera, UNUSED Player* player, UNUSED s32 arg2, s32 cameraId) { - UNUSED s32 pad[2]; - f32 xdiff; - f32 ydiff; - f32 zdiff; - TrackWaypoint* temp_v1; - - camera->pos[0] = D_801645F8[cameraId]; - camera->pos[1] = D_80164618[cameraId]; - camera->pos[2] = D_80164638[cameraId]; - temp_v1 = &(*D_80164550)[gNearestWaypointByCameraId[cameraId]]; - camera->lookAt[0] = (f32) temp_v1->posX; - camera->lookAt[1] = (f32) temp_v1->posY; - camera->lookAt[2] = (f32) temp_v1->posZ; - func_80014D30(cameraId, 0); - xdiff = camera->lookAt[0] - camera->pos[0]; - ydiff = camera->lookAt[1] - camera->pos[1]; - zdiff = camera->lookAt[2] - camera->pos[2]; - camera->rot[1] = atan2s(xdiff, zdiff); - camera->rot[0] = atan2s(sqrtf((xdiff * xdiff) + (zdiff * zdiff)), ydiff); - camera->rot[2] = 0; -} - -void func_80019890(s32 playerId, s32 cameraId) { - s32 pathIndex; - Camera* camera = camera1; - camera += cameraId; - camera->playerId = playerId; - - D_801646C0[cameraId] = 0; - pathIndex = gPathIndexByPlayerId[playerId]; - - switch (D_80164680[cameraId]) { - case 0: - func_80015314(playerId, 0.0f, cameraId); - break; - case 2: - func_80015544(playerId, -1.0f, cameraId, pathIndex); - break; - case 3: - func_80015544(playerId, 1.0f, cameraId, pathIndex); - break; - case 6: - func_80015A9C(playerId, -0.6f, cameraId, (s16) pathIndex); - break; - case 7: - func_80015A9C(playerId, 0.6f, cameraId, (s16) pathIndex); - break; - case 4: - func_800162CC(playerId, -1.0f, cameraId, (s16) pathIndex); - break; - case 5: - func_800162CC(playerId, 1.0f, cameraId, (s16) pathIndex); - break; - case 9: - func_80016C3C(playerId, 0.0f, cameraId); - break; - case 1: - func_80017720(playerId, 0.0f, cameraId, (s16) pathIndex); - break; - case 14: - func_80017F10(playerId, 0.0f, cameraId, (s16) pathIndex); - break; - case 8: - func_80018718(playerId, 0.0f, cameraId, (s16) pathIndex); - break; - case 12: - func_80019118(playerId, -1.0f, cameraId, (s16) pathIndex); - break; - case 13: - func_80019118(playerId, 1.0f, cameraId, (s16) pathIndex); - break; - case 15: - func_8001969C(playerId, -1.0f, cameraId, (s16) pathIndex); - break; - case 16: - func_8001969C(playerId, 1.0f, cameraId, (s16) pathIndex); - break; - default: - func_80015314(playerId, 0.0f, cameraId); - break; - } - gNearestWaypointByCameraId[cameraId] = - func_8000BD94(camera->pos[0], camera->pos[1], camera->pos[2], (s32) pathIndex); - if ((s16) D_80164680[cameraId] == 9) { - D_80163DD8[cameraId] = (s32) pathIndex; - } -} - -void func_80019B50(s32 cameraIndex, u16 arg1) { - u16 var_v0; - - var_v0 = D_801646C0[cameraIndex]; - if (var_v0 < arg1) { - if ((arg1 - var_v0) < 0x8000) { - var_v0 += 0x5A; - if (arg1 < var_v0) { - var_v0 = arg1; - } - if (var_v0 < 0x5A) { - var_v0 = 0; - } - } else if ((arg1 - var_v0) >= 0x8000) { - var_v0 -= 0x5A; - } - } else if (arg1 < var_v0) { - if ((var_v0 - arg1) < 0x8000) { - var_v0 -= 0x5A; - if (var_v0 < arg1) { - var_v0 = arg1; - } - if (var_v0 >= 0xFFA6) { - var_v0 = 0; - } - } else if ((var_v0 - arg1) >= 0x8000) { - var_v0 += 0x5A; - if (!cameraIndex) {} // wtf? - } - } - D_801646C0[cameraIndex] = (s16) var_v0; -} - -void func_80019C50(s32 arg0) { - switch (D_80164678[arg0]) { - case 0: - if (D_80164608[arg0] == 1) { - D_80164678[arg0] = 1; - func_800C9060(arg0, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x4F)); - D_80164670[arg0] = D_80164678[arg0]; - } - break; - case 1: - if (D_80164608[arg0] == 1) { - D_80164678[arg0] = 0; - func_800C9060(arg0, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x50)); - D_80164670[arg0] = D_80164678[arg0]; - } - break; - } -} - -void func_80019D2C(Camera* camera, Player* player, s32 arg2) { - s32 playerId; - s32 nearestWaypoint; - - playerId = camera->playerId; - if ((D_80163378 != 0) && (gCurrentCourseId == 8)) { - calculate_camera_up_vector(camera, arg2); - nearestWaypoint = gNearestWaypointByPlayerId[playerId]; - if (((nearestWaypoint >= 0x65) && (nearestWaypoint < 0xFA)) || - ((nearestWaypoint >= 0x1AF) && (nearestWaypoint < 0x226))) { - func_80019B50(arg2, (player->unk_206 * 2)); - } else { - func_80019B50(arg2, 0U); - } - } -} - -void func_80019DE4(void) { - D_801646CC = 1; -} - -void func_80019DF4(void) { - s32 i; - s32 playerId = gGPCurrentRacePlayerIdByRank[0]; - // clang-format off - // Has to be on a single line to match. Because IDO hates you :) - for (i = 0; i < 4; i++) { D_80164670[i] = D_80164678[i]; } - // clang-format on - camera1->playerId = playerId; - D_80164678[0] = 1; - D_801646CC = 2; -} - -void func_80019E58(void) { - D_80164680[0] = 1; - func_80019890(0, 0); - D_80164670[0] = D_80164678[0]; - D_80164678[0] = 1; - D_80164680[1] = 9; - func_80019890(0, 1); - D_80164670[1] = D_80164678[1]; - D_80164678[1] = 0; -} - -void func_80019ED0(void) { - s32 i; - - for (i = 0; i < 4; i++) { - D_80164670[i] = D_80164678[i]; - } - - gGPCurrentRacePlayerIdByRank[0] = (s16) gPlayerWinningIndex; - - camera1->playerId = (s16) gPlayerWinningIndex; - - for (i = 0; i < 4; i++) { - D_80164680[i] = 0; - func_80015314(gPlayerWinningIndex, 0, i); - D_80164678[i] = 1; - } -} - -void func_80019FB4(s32 cameraId) { - struct Controller* controller; - - controller = &gControllerOne[cameraId]; - if (controller->buttonPressed & 2) { - D_801645D0[cameraId] += 1; - } else { - D_801645D0[cameraId] = 0; - } - if (controller->buttonPressed & 4) { - D_801645E8[cameraId] += 1; - } else { - D_801645E8[cameraId] = 0; - } - if (controller->buttonPressed & 8) { - D_80164608[cameraId] += 1; - } else { - D_80164608[cameraId] = 0; - } - if (controller->buttonPressed & 1) { - D_80164628[cameraId] += 1; - } else { - D_80164628[cameraId] = 0; - } -} - -void func_8001A0A4(UNUSED u16* arg0, UNUSED Camera* arg1, UNUSED Player* arg2, UNUSED s8 arg3, s32 arg4) { - func_80019FB4(arg4); - func_80019C50(arg4); -} - -void func_8001A0DC(u16* arg0, Camera* arg1, Player* arg2, s8 arg3, s32 arg4) { - func_8001A0A4(arg0, arg1, arg2, arg3, arg4); - func_80019D2C(arg1, arg2, arg4); -} - -void func_8001A124(s32 arg0, s32 arg1) { - switch (gGPCurrentRaceRankByPlayerId[arg0]) { /* irregular */ - case 0: - if (random_int(0x0064U) < 0x32) { - D_80164680[arg1] = 0x000C; - } else { - D_80164680[arg1] = 0x000D; - } - func_800CA270(); - break; - case 1: - case 2: - case 3: - D_80164680[arg1] = 8; - break; - default: - if (random_int(0x0064U) < 0x32) { - D_80164680[arg1] = 0x000F; - } else { - D_80164680[arg1] = 0x0010; - } - break; - } -} - -void func_8001A220(UNUSED s32 arg0, s32 cameraId) { - switch (random_int(6)) { - case 0: - D_80164680[cameraId] = 4; - break; - case 1: - D_80164680[cameraId] = 5; - break; - case 2: - D_80164680[cameraId] = 6; - break; - case 3: - D_80164680[cameraId] = 7; - break; - case 4: - D_80164680[cameraId] = 8; - break; - case 5: - D_80164680[cameraId] = 1; - break; - default: - D_80164680[cameraId] = 8; - break; - } -} - -s32 func_8001A310(s32 waypoint, s32 arg1) { - if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) && (arg1 != 0) && (waypoint >= 0xE7) && (waypoint < 0x1C2)) { - arg1 = 0; - } - return arg1; -} - -void func_8001A348(s32 cameraId, f32 arg1, s32 arg2) { - UNUSED s32 pad; - s32 playerId; - - playerId = cameras[cameraId].playerId; - D_80164688[cameraId] = arg1; - D_80164680[cameraId] = func_8001A310((s32) gNearestWaypointByCameraId[cameraId], arg2); - func_80019890(playerId, cameraId); -} - -void func_8001A3D8(s32 arg0, f32 arg1, s32 arg2) { - s32 playerId; - - playerId = cameras[arg0].playerId; - D_80164688[arg0] = arg1; - if (arg2 != D_80164680[arg0]) { - D_80164680[arg0] = arg2; - func_80019890(playerId, arg0); - } -} - -void func_8001A450(s32 playerId, s32 arg1, s32 arg2) { - s32 temp_v1; - s16 waypoint; - s32 temp_v0; - - if (!(gPlayers[playerId].effects & 0x1000000C)) { - temp_v1 = D_80164680[arg1]; - waypoint = gNearestWaypointByCameraId[arg1]; - temp_v0 = func_8001A310(waypoint, (temp_v1 + 1) % 10); - if ((temp_v0 != temp_v1) || (arg2 != playerId)) { - D_80164680[arg1] = temp_v0; - func_80019890(arg2, arg1); - } - } -} - -void func_8001A518(s32 arg0, s32 arg1, s32 arg2) { - switch (arg1) { /* irregular */ - case 0: - D_80164680[arg2] = 1; - break; - case 1: - case 2: - case 3: - func_8001A450(arg0, arg2, arg0); - break; - default: - D_80164680[arg2] = 0; - break; - } -} - -void func_8001A588(UNUSED u16* localD_80152300, Camera* camera, Player* player, s8 index, s32 cameraIndex) { - s32 var_v1; - UnkStruct_46D0* temp_v0_4; - s32 sp44; - s32 playerId; - playerId = camera->playerId; - - if (gModeSelection == TIME_TRIALS) { - playerId = 0; - } - func_80019FB4(cameraIndex); - - if ((s32) (camera->pos[0] * 10.0) == (s32) ((f64) camera->lookAt[0] * 10.0)) { - - if ((s32) (camera->pos[2] * 10.0) == (s32) ((f64) camera->lookAt[2] * 10.0)) { - camera->pos[0] = (f32) (camera->pos[0] + 100.0); - camera->pos[2] = (f32) (camera->pos[2] + 100.0); - } - } - if ((gModeSelection != BATTLE) && (D_80164680[cameraIndex] == -1) && (player->type & 0x800) && - ((u16) D_801646CC == 0) && (D_801646C8 == 0)) { - if (gModeSelection == VERSUS) { - func_8001A220(playerId, cameraIndex); - } else { - func_8001A124((s32) playerId, cameraIndex); - } - func_80019890((s32) playerId, cameraIndex); - } - - if ((D_80164680[cameraIndex] == 14) || (D_80164680[cameraIndex] == 0)) { - func_80019D2C(camera, player, cameraIndex); - } else { - D_801646C0[cameraIndex] = 0; - calculate_camera_up_vector(camera, cameraIndex); - } - switch ((u16) D_801646CC) { - case 1: - D_801646C8 += 1; - if (D_801646C8 >= 501) { - D_801646C8 = 0; - } - if ((cameraIndex == 0) && (((D_801646C8 == 10)) || (D_801646C8 == 11))) { - func_8001A518((s32) playerId, gGPCurrentRaceRankByPlayerId[playerId], 0); - } - if ((gModeSelection != TIME_TRIALS) && (cameraIndex == 1) && - (((D_801646C8 == 260)) || (D_801646C8 == 261))) { - - var_v1 = 0; - if (gPlayerCount == 2) { - func_8001A518((s32) playerId, gGPCurrentRaceRankByPlayerId[playerId], 1); - } else { - sp44 = (s32) playerId; - while (var_v1 != 8) { - playerId += 1; - var_v1 += 1; - if (playerId >= 8) { - playerId = 1; - } - if ((!(gPlayers[playerId].unk_0CA & 2) && !(gPlayers[playerId].unk_0CA & 8))) { - break; - } - } - func_8001A450(sp44, cameraIndex, (s32) playerId); - } - } - break; - case 2: - D_801646C8 += 1; - if (D_801646C8 > 250) { - D_801646C8 = 0; - } - if ((cameraIndex == 0) && (D_801646C8 == 10)) { - func_8001A450((s32) playerId, cameraIndex, (s32) playerId); - } - break; - default: - temp_v0_4 = &D_801646D0[cameraIndex]; - if (temp_v0_4->unk0 == (s16) 1) { - playerId = temp_v0_4->unk4; - temp_v0_4->unk0 = 0; - cameras[cameraIndex].playerId = playerId; - func_8001A3D8(cameraIndex, 0.0f, (s32) temp_v0_4->unk2); - } - break; - } - func_80019C50(cameraIndex); - switch (D_80164680[cameraIndex]) { - case 0: - func_80015390(camera, player, index); - break; - case 2: - case 3: - func_8001577C(camera, player, index, cameraIndex); - break; - case 6: - case 7: - func_80015C94(camera, player, index, cameraIndex); - break; - case 4: - case 5: - func_80016494(camera, player, index, cameraIndex); - break; - case 9: - func_80017054(camera, player, index, cameraIndex); - break; - case 1: - func_800178F4(camera, player, index, cameraIndex); - break; - case 14: - func_800180F0(camera, player, index, cameraIndex); - break; - case 8: - func_800188F4(camera, player, index, cameraIndex); - break; - case 12: - case 13: - func_8001933C(camera, player, index, cameraIndex); - break; - case 15: - case 16: - func_80019760(camera, player, index, cameraIndex); - break; - default: - func_80015390(camera, player, index); - break; - } -} - -void func_8001AAAC(s16 arg0, s16 arg1, s16 arg2) { - if (D_801646D0[arg0].unk0 == 0) { - D_801646D0[arg0].unk0 = 1; - D_801646D0[arg0].unk2 = arg1; - D_801646D0[arg0].unk4 = arg2; - } -} - -void func_8001AB00(void) { - s32 var_v1; - - for (var_v1 = 0; var_v1 < NUM_PLAYERS; var_v1++) { - D_801642D8[var_v1].unk_00 = 0; - D_801642D8[var_v1].unk_04 = 0; - D_801642D8[var_v1].actorIndex = -1; - D_801642D8[var_v1].unk_06 = 0; - D_801642D8[var_v1].unk_08 = 0; - } -} - -void kart_ai_decisions_branch_item(UNUSED s32 arg0, s16* arg1, s32 arg2) { - s32 value = -1; - switch (arg2) { - case ITEM_FAKE_ITEM_BOX: - value = 0xD; - break; - case ITEM_BOO: - value = 0x1B; - break; - case ITEM_BANANA: - value = 1; - break; - case ITEM_THUNDERBOLT: - value = 0x16; - break; - case ITEM_STAR: - value = 0x19; - break; - case ITEM_MUSHROOM: - value = 0x1D; - break; - case ITEM_DOUBLE_MUSHROOM: - break; - case ITEM_TRIPLE_MUSHROOM: - break; - case ITEM_SUPER_MUSHROOM: - break; - } - if (value >= 0) { - *arg1 = value; - } -} - -void func_8001ABE0(UNUSED s32 arg0, UNUSED D_801642D8_entry* arg1) { -} - -void func_8001ABEC(struct struct_801642D8* arg0) { - if ((arg0->ffff < 0) || (arg0->ffff >= 100)) { - arg0->unk0 = 0; - arg0->timer = 0; - } -} - -#ifdef NON_MATCHING -// By the looks of this function is probably something like `kart_ai_use_item_strategy` -// The use of several different actor types might make getting a match hard(er), -// might have to get creative/ugly with just a single generic `Actor` variable. -// https://decomp.me/scratch/FOlbG -void kart_ai_use_item_strategy(s32 playerId) { - s32 var_v0; - Player* player; - TrackWaypoint* waypoint; - D_801642D8_entry* temp_s0; - struct Actor* actor; - struct ShellActor* shell; - struct BananaActor* banana; - struct FakeItemBox* fakeItemBox; - struct BananaBunchParent* bananaBunchParent; - - player = &gPlayerOne[playerId]; - if (((gModeSelection != ((s32) 1)) && (((u16) D_801646CC) != ((u16) 1))) && - (!(player->type & PLAYER_CINEMATIC_MODE))) { - temp_s0 = &D_801642D8[playerId]; - switch (temp_s0->unk_00) { - case 0: - temp_s0->actorIndex = -1; - if ((((playerId * 0x14) + 0x64) < D_80164450[playerId]) && (temp_s0->unk_04 >= 0x259) && - (temp_s0->unk_06 < 3) && (gLapCountByPlayerId[playerId] < 3)) { - kart_ai_decisions_branch_item(playerId, &temp_s0->unk_00, - kart_ai_gen_random_item((s16) gLapCountByPlayerId[playerId], - gGPCurrentRaceRankByPlayerId[playerId])); - } else { - func_8001ABE0(playerId, temp_s0); - } - break; - - case 1: - if ((gLapCountByPlayerId[playerId] > 0) && - (gGPCurrentRaceRankByPlayerId[D_80163478] > gGPCurrentRaceRankByPlayerId[playerId]) && - (gGPCurrentRaceRankByPlayerId[D_80163478] == 0)) { - switch (player->characterId) { - case 4: - if (func_80007BF8(gNearestWaypointByPlayerId[playerId], - gNearestWaypointByPlayerId[D_80163478], 0x0028U, 2U, - (u16) ((s32) D_80164430)) > 0) { - temp_s0->unk_00 = 0x0022; - } - break; - - case 6: - if (func_80007BF8(gNearestWaypointByPlayerId[playerId], - gNearestWaypointByPlayerId[D_80163478], 4U, 2U, - (u16) ((s32) D_80164430)) > 0) { - temp_s0->unk_00 = 0x0022; - } - break; - - default: - if (func_80007BF8(gNearestWaypointByPlayerId[playerId], - gNearestWaypointByPlayerId[D_80163478], 0x000AU, 2U, - (u16) ((s32) D_80164430)) > 0) { - temp_s0->unk_00 = 0x0022; - } - break; - } - } else if (temp_s0->unk_00 == 1) { - temp_s0->actorIndex = use_banana_item(player); - if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - player->soundEffects |= HOLD_BANANA_SOUND_EFFECT; - temp_s0->unk_00 = 2; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - temp_s0->unk_0E = (random_int(3U) * 0x14) + 0xA; - } else { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } - } - break; - - case 2: - banana = (struct BananaActor*) &gActorList[temp_s0->actorIndex]; - if ((!(banana->flags & 0x8000)) || (banana->type != 6) || (banana->state != 0) || - (playerId != banana->playerId)) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - player->soundEffects &= ~0x00040000; - } else if (temp_s0->unk_0E < temp_s0->unk_04) { - temp_s0->unk_00 = 3; - } - break; - - case 3: - banana = (struct BananaActor*) &gActorList[temp_s0->actorIndex]; - if ((((!(banana->flags & 0x8000)) || (banana->type != 6)) || (banana->state != 0)) || - (playerId != banana->playerId)) { - if (playerId != banana->playerId) {} - } else { - banana->state = 1; - banana->velocity[0] = 0.0f; - banana->velocity[1] = 0.0f; - banana->velocity[2] = 0.0f; - if (D_801631E0[playerId] == ((u16) 1)) { - banana->pos[1] = spawn_actor_on_surface(player->pos[0], (f32) (((f64) player->pos[1]) + 30.0), - player->pos[2]) + - (banana->boundingBoxSize + 1.0f); - } - } - player->soundEffects &= ~0x00040000; - temp_s0->unk_04 = 0; - temp_s0->unk_00 = 0; - break; - - case 34: - temp_s0->actorIndex = use_banana_item(player); - if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - banana = (struct BananaActor*) &gActorList[temp_s0->actorIndex]; - banana->state = 4; - player->soundEffects |= HOLD_BANANA_SOUND_EFFECT; - temp_s0->unk_00 = 0x0023; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - waypoint = &D_80164550[gPathIndexByPlayerId[0]] - [(gNearestWaypointByPlayerId[D_80163478] + 0x1E) % - gWaypointCountByPathIndex[gPathIndexByPlayerId[D_80163478]]]; - banana->velocity[0] = (waypoint->posX - player->pos[0]) / 20.0; - banana->velocity[1] = ((waypoint->posY - player->pos[1]) / 20.0) + 4.0; - banana->velocity[2] = (waypoint->posZ - player->pos[2]) / 20.0; - banana->pos[1] = player->pos[1]; - func_800C92CC(playerId, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x09)); - func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x14)); - } else { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } - break; - - case 35: - banana = (struct BananaActor*) &gActorList[temp_s0->actorIndex]; - if ((((!(banana->flags & 0x8000)) || (banana->type != 6)) || (banana->state != 4)) || - (playerId != banana->playerId)) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - player->soundEffects &= ~0x00040000; - } else { - banana->velocity[1] -= 0.4; - banana->pos[0] += banana->velocity[0]; - banana->pos[1] += banana->velocity[1]; - banana->pos[2] += banana->velocity[2]; - if (temp_s0->unk_04 >= 0x15) { - temp_s0->unk_00 = 0x0024; - } - } - break; - - case 36: - banana = (struct BananaActor*) &gActorList[temp_s0->actorIndex]; - if ((((!(banana->flags & 0x8000)) || (banana->type != 6)) || (banana->state != 4)) || - (playerId != banana->playerId)) { - if (playerId != banana->playerId) {} - } else { - banana->state = 1; - banana->velocity[0] = 0.0f; - banana->velocity[1] = 0.0f; - banana->velocity[2] = 0.0f; - banana->pos[1] = - spawn_actor_on_surface(banana->pos[0], (f32) (((f64) banana->pos[1]) + 30.0), banana->pos[2]) + - (banana->boundingBoxSize + 1.0f); - } - player->soundEffects &= ~0x00040000; - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - break; - - case 4: - if (((s32) gNumActors) < 0x50) { - temp_s0->actorIndex = use_green_shell_item(player); - if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - temp_s0->unk_00 = 5; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - temp_s0->unk_0E = (random_int(3U) * 0x14) + 0xA; - } else { - temp_s0->unk_00 = 0; - } - } else { - temp_s0->unk_00 = 0; - } - break; - - case 5: - actor = &gActorList[temp_s0->actorIndex]; - if ((((!(actor->flags & 0x8000)) || (actor->type != 7)) || (actor->state != 0)) || - (playerId != actor->rot[2])) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } else if (temp_s0->unk_0E < temp_s0->unk_04) { - temp_s0->unk_00 = 6; - temp_s0->unk_04 = 0; - } - break; - - case 6: - actor = &gActorList[temp_s0->actorIndex]; - if ((((!(actor->flags & 0x8000)) || (actor->type != 7)) || (actor->state != 0)) || - (playerId != actor->rot[2])) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } else { - actor->state = 1; - temp_s0->unk_04 = 0; - temp_s0->unk_00 = 0; - } - break; - - case 7: - if (((s32) gNumActors) < 0x50) { - temp_s0->actorIndex = use_red_shell_item(player); - if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - temp_s0->unk_00 = 8; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - temp_s0->unk_0E = (random_int(3U) * 0x14) + 0xA; - } else { - temp_s0->unk_00 = 0; - } - } else { - temp_s0->unk_00 = 0; - } - break; - - case 8: - shell = (struct ShellActor*) &gActorList[temp_s0->actorIndex]; - if ((((!(shell->flags & 0x8000)) || (shell->type != 8)) || (shell->state != 0)) || - (playerId != shell->playerId)) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } else if (temp_s0->unk_0E < temp_s0->unk_04) { - temp_s0->unk_00 = 9; - } - break; - - case 9: - func_8001ABEC((struct struct_801642D8*) temp_s0); - shell = (struct ShellActor*) &gActorList[temp_s0->actorIndex]; - if ((((!(shell->flags & 0x8000)) || (shell->type != 8)) || (shell->state != 0)) || - (playerId != shell->playerId)) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } else { - shell->state = 1; - temp_s0->unk_04 = 0; - temp_s0->unk_00 = 0; - } - break; - - case 10: - if (((s32) gNumActors) < 0x50) { - temp_s0->actorIndex = use_banana_bunch_item(player); - if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - temp_s0->unk_00 = 0x000B; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - temp_s0->unk_0E = (random_int(3U) * 0x14) + 0x3C; - } else { - temp_s0->unk_00 = 0; - } - } else { - temp_s0->unk_00 = 0; - } - break; - - case 11: - bananaBunchParent = (struct BananaBunchParent*) &gActorList[temp_s0->actorIndex]; - if (bananaBunchParent->state == 6) { - var_v0 = 0; - if (bananaBunchParent->bananaIndices[4] != (-1)) { - var_v0 = 1; - } - if (bananaBunchParent->bananaIndices[3] != (-1)) { - var_v0 = 1; - } - if (bananaBunchParent->bananaIndices[2] != (-1)) { - var_v0 = 1; - } - if (bananaBunchParent->bananaIndices[1] != (-1)) { - var_v0 = 1; - } - if (bananaBunchParent->bananaIndices[0] != (-1)) { - var_v0 = 1; - } - if ((bananaBunchParent->type != 0x000E) || (var_v0 == 0)) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } else if (temp_s0->unk_0E < temp_s0->unk_04) { - temp_s0->unk_00 = 0x000C; - temp_s0->unk_08 = 0; - temp_s0->unk_04 = 0; - } - } - break; - - case 12: - if ((((s16) temp_s0->unk_04) % 10) == 0) { - if (temp_s0->unk_08 < 5) { - bananaBunchParent = (struct BananaBunchParent*) &gActorList[temp_s0->actorIndex]; - var_v0 = 0; - switch (temp_s0->unk_08) { - case 0: - if (bananaBunchParent->bananaIndices[4] != (-1)) { - var_v0 = 1; - } - break; - - case 1: - if (bananaBunchParent->bananaIndices[3] != (-1)) { - var_v0 = 1; - } - break; - - case 2: - if (bananaBunchParent->bananaIndices[2] != (-1)) { - var_v0 = 1; - } - break; - - case 3: - if (bananaBunchParent->bananaIndices[1] != (-1)) { - var_v0 = 1; - } - break; - - case 4: - if (bananaBunchParent->bananaIndices[0] != (-1)) { - var_v0 = 1; - } - break; - } - - if (((bananaBunchParent->type == 0x000E) && (bananaBunchParent->state == 6)) && (var_v0 == 1)) { - func_802B0648(bananaBunchParent); - } - temp_s0->unk_08 += 1; - } else { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } - } - break; - - case 13: - temp_s0->actorIndex = use_fake_itembox_item(player); - if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - temp_s0->unk_00 = 0x000E; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - temp_s0->unk_0E = (random_int(3U) * 0x14) + 0xA; - } else { - temp_s0->unk_00 = 0; - } - break; - - case 14: - fakeItemBox = (struct FakeItemBox*) &gActorList[temp_s0->actorIndex]; - if ((((!(fakeItemBox->flags & 0x8000)) || (fakeItemBox->type != 0x000D)) || - (fakeItemBox->state != 0)) || - (playerId != ((s32) fakeItemBox->playerId))) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } else if (temp_s0->unk_0E < temp_s0->unk_04) { - temp_s0->unk_00 = 0x000F; - } - break; - - case 15: - fakeItemBox = (struct FakeItemBox*) &gActorList[temp_s0->actorIndex]; - if ((((!(fakeItemBox->flags & 0x8000)) || (fakeItemBox->type != 0x000D)) || - (fakeItemBox->state != 0)) || - (playerId != ((s32) fakeItemBox->playerId))) { - if (playerId != fakeItemBox->rot[0]) {} - } else { - func_802A1064(fakeItemBox); - if (D_801631E0[playerId] == 1) { - fakeItemBox->pos[1] = spawn_actor_on_surface(fakeItemBox->pos[0], fakeItemBox->pos[1] + 30.0, - fakeItemBox->pos[2]) + - fakeItemBox->boundingBoxSize; - } - } - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - break; - - case 22: - use_thunder_item(player); - func_800CAC60(playerId); - func_8009E5BC(); - temp_s0->unk_00 = 0x0017; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - break; - - case 23: - if (temp_s0->unk_04 >= 0xF1) { - func_800CAD40((s32) ((u8) playerId)); - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } - break; - - case 25: - player->soundEffects |= STAR_SOUND_EFFECT; - temp_s0->unk_00 = 0x001A; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - break; - - case 26: - if (!(player->effects & STAR_EFFECT)) { - temp_s0->unk_00 = 0; - } - temp_s0->unk_04 = 0; - break; - - case 27: - player->soundEffects |= BOO_SOUND_EFFECT; - temp_s0->unk_00 = 0x001C; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - break; - - case 28: - if (!(player->effects & BOO_EFFECT)) { - temp_s0->unk_00 = 0; - } - temp_s0->unk_04 = 0; - break; - - case 29: - player->soundEffects |= BOOST_SOUND_EFFECT; - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - temp_s0->unk_06 += 1; - break; - - case 30: - if (temp_s0->unk_04 >= 0x3D) { - player->soundEffects |= BOOST_SOUND_EFFECT; - temp_s0->unk_00 = 0x001D; - temp_s0->unk_04 = 0; - } - break; - - case 31: - if (temp_s0->unk_04 >= 0x3D) { - player->soundEffects |= BOOST_SOUND_EFFECT; - temp_s0->unk_00 = 0x001E; - temp_s0->unk_04 = 0; - } - break; - - case 32: - temp_s0->unk_00 = 0x0021; - temp_s0->unk_04 = 0; - temp_s0->unk_0E = 0x0258; - break; - - case 33: - if ((((s16) temp_s0->unk_04) % 60) == 0) { - player->soundEffects |= BOOST_SOUND_EFFECT; - if (temp_s0->unk_0E < temp_s0->unk_04) { - temp_s0->unk_00 = 0; - temp_s0->unk_04 = 0; - } - } - break; - - default: - break; - } - - if (temp_s0->unk_04 < 0x2710) { - temp_s0->unk_04 += 1; - } - if (player->effects & (BOO_EFFECT | BOOST_EFFECT | STAR_EFFECT)) { // 0x80002200 - temp_s0->unk_04 = 0; - } - } -} -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/kart_ai_use_item_strategy.s") -#endif - -void func_8001BE78(void) { - Player* temp_s1; - TrackWaypoint* temp_s0; - s32 i; - - func_8000F628(); - for (i = 0; i < 4; i++) { - temp_s1 = &gPlayerOne[i]; - temp_s1->type &= 0xDFFF; - gPathIndexByPlayerId[i] = i; - D_801634F8[i].unkC = 0.0f; - D_801634F8[i].unk4 = 0.0f; - D_801634F8[i].unk0 = 0.0f; - switch (i) { - case 0: - gNearestWaypointByPlayerId[i] = 6; - break; - case 1: - gNearestWaypointByPlayerId[i] = 1; - break; - case 2: - gNearestWaypointByPlayerId[i] = 6; - break; - case 3: - gNearestWaypointByPlayerId[i] = 1; - break; - } - temp_s0 = &D_80164550[i][gNearestWaypointByPlayerId[i]]; - temp_s1->pos[0] = (f32) temp_s0->posX; - temp_s1->pos[1] = - spawn_actor_on_surface((f32) temp_s0->posX, 2000.0f, (f32) temp_s0->posZ) + temp_s1->boundingBoxSize; - temp_s1->pos[2] = (f32) temp_s0->posZ; - temp_s1->rotation[1] = (s16) *D_80164590[i]; - func_8003680C(temp_s1, 0); - temp_s1++; - D_80163410[i] = 0; - } -} - -void func_8001C05C(void) { - init_segment_racing(); - gCurrentCourseId = COURSE_AWARD_CEREMONY; - D_8016347C = 0; - D_8016347E = 0; - D_80163480 = 0; - D_80163484 = 0; - func_8000F2DC(); - func_80014DE4(0); - func_8001BE78(); - D_80163418[0] = -3202.475097656f; - D_80163428[0] = 19.166999817f; - D_80163438[0] = -477.623992920f; - D_80163418[1] = -3205.080078125f; - D_80163428[1] = 19.166999817f; - D_80163438[1] = -462.851989746f; - D_80163418[2] = -3199.870117188f; - D_80163428[2] = 19.166999817f; - D_80163438[2] = -492.395996094f; - D_80163418[3] = -2409.197021484f; - D_80163428[3] = 0.0f; - D_80163438[3] = -355.253997803; -} - -void func_8001C14C(void) { - f32 temp_f0; - f32 temp_f2; - s32 var_s1; - Player* temp_s0; - - if (D_8016347C == 1) { - D_80163480 += 1; - } - if ((D_8016347E == 1) && (gBombKarts[0].state == 0) && (D_802874D8.unk1D >= 3)) { - D_80163484++; - if (D_80163484 >= 0xF) { - D_80163484 = 0; - D_8016347E = 2; - func_8009265C(); - } - } - for (var_s1 = 0; var_s1 < 4; var_s1++) { - if ((var_s1 == 3) && (D_8016347C == 0)) { - break; - } - - temp_s0 = &gPlayerOne[var_s1]; - func_80009B60(var_s1); - if (!(temp_s0->type & 0x2000)) { - temp_f0 = D_80163418[var_s1] - temp_s0->pos[0]; - temp_f2 = D_80163438[var_s1] - temp_s0->pos[2]; - if ((f64) ((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 1.0) { - if (var_s1 != 3) { - if (1) {} - // Why oh why is a ternary required here? Who does that? - (D_8016347C == 0) ? (temp_s0->type |= 0x2000) : (temp_s0->type &= ~0x2000); - if ((gPlayerOne->type & 0x2000) && (gPlayerTwo->type & 0x2000) && (gPlayerThree->type & 0x2000)) { - D_8016347C = 1; - D_80163480 = 0; - } - } else if (D_8016347E == 0) { - if (!(temp_s0->effects & 0x01000000)) { - temp_s0->type |= 0x2000; - } - D_8016347E = 1; - D_80163484 = 0; - } else if (!(temp_s0->effects & 0x01000000)) { - temp_s0->type |= 0x2000; - } - } - } - } -} - -void func_8001C3C4(s32 cameraId) { - if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { - if (gBombKarts[0].waypointIndex >= 16) { - func_80057114(PLAYER_FOUR); - } - } else { - if (gModeSelection == VERSUS) { - func_80057114(cameraId); - } - } -} - -UNUSED void func_8001C42C(void) { - if (D_800DDB20 == 0) { - if ((gControllerThree->buttonPressed & 0x20) != 0) { - D_800DDB20 = 1; - } - } else { - if ((gControllerThree->buttonPressed & 0x20) != 0) { - D_800DDB20 = 0; - } - func_80057C60(); - gSPDisplayList(gDisplayListHead++, D_0D0076F8); - func_80057CE4(); - } -} diff --git a/src/code_8003DC40.c b/src/code_8003DC40.c index a6e12ee58a..b1d11eb099 100644 --- a/src/code_8003DC40.c +++ b/src/code_8003DC40.c @@ -1,6 +1,8 @@ #include #include #include +#include + #include "math_util.h" #include #include "player_controller.h" @@ -33,7 +35,7 @@ UNUSED void func_8003DC50(Player* player, Vec3f arg1) { arg1[2] = thing2; } arg1[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } UNUSED void func_8003DE4C(Player* player, Vec3f arg1) { @@ -57,8 +59,9 @@ UNUSED void func_8003DE4C(Player* player, Vec3f arg1) { arg1[2] = thing2; } arg1[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } + // Stick to ground? void func_8003E048(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { *arg5 += arg1[0] * player->collision.surfaceDistance[2] * 1; @@ -68,14 +71,15 @@ void func_8003E048(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8829f) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_ai_player(player, 4.0f); + player_decelerate_alternative(player, 4.0f); player->unk_DAC = 0.5f; - if ((player->effects & BOOST_EFFECT) != 0) { - remove_boost_effect(player); + if ((player->effects & MUSHROOM_EFFECT) != 0) { + remove_mushroom_effect(player); player->currentSpeed /= 2; player->unk_08C /= 2; } - } else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) { + } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { arg3[0] = ((player->unk_206 / 182) * 0x32); arg3[2] = (-(player->slopeAccel / 182) * 0x3C); } else { @@ -83,7 +87,7 @@ void func_8003E048(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 arg3[2] = (-(player->slopeAccel / 182) * 0x32); } arg3[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg3, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg3, player->orientationMatrix); } void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { @@ -94,16 +98,17 @@ void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if ((player->collision.orientationVector[1] <= 0.7318f) || (player->surfaceType == CLIFF)) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - if (((player->unk_094 / 18.0f) * 216.0f) >= 8.0f) { - decelerate_ai_player(player, 5.0f); + if (((player->speed / 18.0f) * 216.0f) >= 8.0f) { + player_decelerate_alternative(player, 5.0f); } player->unk_DAC = 0.5f; - if ((player->effects & BOOST_EFFECT) != 0) { - remove_boost_effect(player); + if ((player->effects & MUSHROOM_EFFECT) != 0) { + remove_mushroom_effect(player); player->currentSpeed /= 2; player->unk_08C /= 2; } - } else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) { + } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { arg3[0] = ((player->unk_206 / 182) * 0x32); arg3[2] = (-(player->slopeAccel / 182) * 0x32); } else { @@ -111,7 +116,7 @@ void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 arg3[2] = (-(player->slopeAccel / 182) * 0x32); } arg3[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg3, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg3, player->orientationMatrix); } void func_8003E6EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { @@ -122,9 +127,10 @@ void func_8003E6EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8829f) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_ai_player(player, 4.0f); + player_decelerate_alternative(player, 4.0f); func_8003DC40(player); - } else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) { + } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { arg3[0] = ((player->unk_206 / 182) * 0x32); arg3[2] = (-(player->slopeAccel / 182) * 0x3C); } else { @@ -132,7 +138,7 @@ void func_8003E6EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 arg3[2] = (-(player->slopeAccel / 182) * 0x32); } arg3[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg3, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg3, player->orientationMatrix); } void func_8003E9EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { @@ -143,10 +149,11 @@ void func_8003E9EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_ai_player(player, 4.0f); + player_decelerate_alternative(player, 4.0f); func_8003DC40(player); } else { - if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) { + if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { if ((player->tyres[BACK_LEFT].surfaceType == ASPHALT) || (player->tyres[BACK_RIGHT].surfaceType == ASPHALT) || (player->tyres[FRONT_RIGHT].surfaceType == ASPHALT) || @@ -160,13 +167,13 @@ void func_8003E9EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 arg3[0] = 0.0f; arg3[2] = (-(player->slopeAccel / 182) * 0x32); } - if ((player->effects & 0x10000) != 0) { + if ((player->effects & TERRAIN_TUMBLE_EFFECT) != 0) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); } } arg3[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg3, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg3, player->orientationMatrix); } void func_8003EE2C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { @@ -177,9 +184,10 @@ void func_8003EE2C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_ai_player(player, 4.0f); + player_decelerate_alternative(player, 4.0f); func_8003DC40(player); - } else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) { + } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { arg3[0] = ((player->unk_206 / 182) * 0x32); arg3[2] = (-(player->slopeAccel / 182) * 0x3C); } else { @@ -187,7 +195,7 @@ void func_8003EE2C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 arg3[2] = (-(player->slopeAccel / 182) * 0x32); } arg3[1] = 0.0f; - mtxf_translate_vec3f_mat3(arg3, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg3, player->orientationMatrix); } void func_8003F138(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { @@ -196,15 +204,16 @@ void func_8003F138(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 *arg7 += arg1[2] * player->collision.surfaceDistance[2] * 1; func_8002A5F4(arg1, *arg4, arg2, 0.5f, 2); if (player->surfaceType == GRASS) { - player->unk_044 &= ~1; + player->kartProps &= ~BACK_UP; } if (player->collision.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0xC8); arg3[2] = (-(player->slopeAccel / 182) * 0xC8); - decelerate_ai_player(player, 4.0f); + player_decelerate_alternative(player, 4.0f); player->unk_DAC = 0.5f; arg3[0] = 0; - } else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) { + } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0x78); arg3[0] = 0; @@ -214,14 +223,14 @@ void func_8003F138(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 } arg3[1] = 0.0f; arg3[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg3, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg3, player->orientationMatrix); } void func_8003F46C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) { arg1[0] = -player->collision.orientationVector[0]; arg1[1] = -player->collision.orientationVector[1]; arg1[2] = -player->collision.orientationVector[2]; - if ((player->collision.orientationVector[1] < 0.0f) && ((player->unk_0CA & 2) == 0)) { + if ((player->collision.orientationVector[1] < 0.0f) && ((player->lakituProps & HELD_BY_LAKITU) == 0)) { *arg5 += arg1[0] * player->collision.surfaceDistance[2] * 1; *arg6 += arg1[1] * player->collision.surfaceDistance[2] * 1; *arg7 += arg1[2] * player->collision.surfaceDistance[2] * 1; @@ -231,6 +240,7 @@ void func_8003F46C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 player->kartHopVelocity = 0.0f; return; } else { +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: func_8003E048(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7); @@ -255,7 +265,10 @@ void func_8003F46C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 func_8003E048(player, arg1, arg2, arg3, arg4, arg5, arg6, arg7); break; } - if (player->effects & 0x10000) { +#else + +#endif + if (player->effects & TERRAIN_TUMBLE_EFFECT) { player->unk_DAC = 0.5f; } } @@ -273,7 +286,7 @@ void func_8003F734(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4, *arg4 += arg1[0] * player->collision.surfaceDistance[0] * 1; *arg5 += arg1[1] * player->collision.surfaceDistance[0] * 0.1; *arg6 += arg1[2] * player->collision.surfaceDistance[0] * 1; - if ((player->slopeAccel < 0) && (((player->unk_094 / 18.0f) * 216.0f) < 10.0f)) { + if ((player->slopeAccel < 0) && (((player->speed / 18.0f) * 216.0f) < 10.0f)) { func_8002A5F4(arg1, *arg3, arg2, 2.5f, 0); } else { func_8002A5F4(arg1, *arg3, arg2, 0.5f, 0); @@ -283,7 +296,7 @@ void func_8003F734(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4, *arg5 += arg1[1] * player->collision.surfaceDistance[0] * 0.1; *arg6 += arg1[2] * player->collision.surfaceDistance[0] * 1; func_8002A5F4(arg1, *arg3, arg2, 1, 0); - if ((!(player->effects & 0x10000)) && ((player->effects & 8) == 0)) { + if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & MIDAIR_EFFECT) == 0)) { arg2[1] *= -1e-05; } } else { @@ -296,11 +309,11 @@ void func_8003F734(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4, } *arg6 += arg1[2] * player->collision.surfaceDistance[0] * 1; func_8002A5F4(arg1, *arg3, arg2, 1.2f, 0); - if ((!(player->effects & 0x10000)) && ((player->effects & 8) == 0)) { + if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & MIDAIR_EFFECT) == 0)) { arg2[1] *= -1e-05; } } - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; temp_f12 = player->collision.surfaceDistance[0] * arg1[0]; temp_f14 = player->collision.surfaceDistance[0] * arg1[2]; if (((temp_f12 >= 0) && (temp_f14 >= 0)) || ((temp_f12 < 0) && (temp_f14 >= 0))) { @@ -327,7 +340,7 @@ void func_8003FBAC(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4, *arg4 += arg1[0] * player->collision.surfaceDistance[1] * 1; *arg5 += arg1[1] * player->collision.surfaceDistance[1] * 0.1; *arg6 += arg1[2] * player->collision.surfaceDistance[1] * 1; - if ((player->slopeAccel < 0) && (((player->unk_094 / 18.0f) * 216.0f) < 10.0f)) { + if ((player->slopeAccel < 0) && (((player->speed / 18.0f) * 216.0f) < 10.0f)) { func_8002A5F4(arg1, *arg3, arg2, 1.5f, 0); } else { func_8002A5F4(arg1, *arg3, arg2, 0.5f, 0); @@ -337,7 +350,7 @@ void func_8003FBAC(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4, *arg5 += arg1[1] * player->collision.surfaceDistance[1] * 0.1; *arg6 += arg1[2] * player->collision.surfaceDistance[1] * 1; func_8002A5F4(arg1, *arg3, arg2, 1, 0); - if ((!(player->effects & 0x10000)) && ((player->effects & 8) == 0)) { + if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & MIDAIR_EFFECT) == 0)) { arg2[1] *= -1e-05; } } else { @@ -350,11 +363,11 @@ void func_8003FBAC(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4, } *arg6 += arg1[2] * player->collision.surfaceDistance[1] * 1; func_8002A5F4(arg1, *arg3, arg2, 1.2f, 0); - if ((!(player->effects & 0x10000)) && ((player->effects & 8) == 0)) { + if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & MIDAIR_EFFECT) == 0)) { arg2[1] *= -1e-05; } } - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; temp_f12 = player->collision.surfaceDistance[1] * arg1[0]; temp_f14 = player->collision.surfaceDistance[1] * arg1[2]; if (((temp_f12 >= 0) && (temp_f14 >= 0)) || ((temp_f12 >= 0) && (temp_f14 < 0))) { diff --git a/src/code_8003DC40.h b/src/code_8003DC40.h index 1f402bda67..fdfda53023 100644 --- a/src/code_8003DC40.h +++ b/src/code_8003DC40.h @@ -18,6 +18,4 @@ void func_8003F46C(Player*, Vec3f, Vec3f, Vec3f, f32*, f32*, f32*, f32*); void func_8003F734(Player*, Vec3f, Vec3f, f32*, f32*, f32*, f32*); void func_8003FBAC(Player*, Vec3f, Vec3f, f32*, f32*, f32*, f32*); -extern s16 gCurrentCourseId; - #endif diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 0cf836484b..e9cbf5f684 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "camera.h" #include "code_80057C60.h" @@ -17,7 +18,7 @@ #include #include "math_util.h" #include "math_util_2.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "render_player.h" #include "render_objects.h" #include "code_8006E9C0.h" @@ -291,7 +292,7 @@ u8 D_80183FA8[4][0x2000]; */ s32 indexObjectList3[32]; //! Seemingly a pointer to Lakitu texture(s) -u8* D_8018C028; +u8* gLakituTexturePtr; /** * Unused list of object indices */ @@ -348,8 +349,7 @@ s16 D_8018CF18; Player* D_8018CF1C; s16 D_8018CF20; UNUSED s32 D_8018CF24; -Player* D_8018CF28[4]; -UNUSED s32 D_8018CF38[4]; +Player* D_8018CF28[8]; s16 D_8018CF48; s16 D_8018CF50[8]; s16 D_8018CF60; @@ -364,13 +364,13 @@ s16 gGPCurrentRaceCharacterIdByRank[8]; s16 D_8018CF90; s16 D_8018CF98[8]; s16 D_8018CFA8; -s8 D_8018CFAC[4]; +u8 D_8018CFAC[4]; s16 D_8018CFB0; -s8 D_8018CFB4[4]; +u8 D_8018CFB4[4]; s16 D_8018CFB8; -s8 D_8018CFBC[4]; +u8 D_8018CFBC[4]; s16 D_8018CFC0; -s8 D_8018CFC4[4]; +u8 D_8018CFC4[4]; s16 D_8018CFC8; f32 D_8018CFCC; s16 D_8018CFD0; @@ -555,7 +555,7 @@ void render_object_p1(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_ONE); + render_bomb_karts_wrap(PLAYER_ONE); if (gGamestate == ENDING) { func_80055F48(PLAYER_ONE); func_80056160(PLAYER_ONE); @@ -576,7 +576,7 @@ void render_object_p2(void) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_TWO); + render_bomb_karts_wrap(PLAYER_TWO); if (!gDemoMode) { render_lakitu(PLAYER_TWO); } @@ -589,7 +589,7 @@ void render_object_p3(void) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_THREE); + render_bomb_karts_wrap(PLAYER_THREE); if (!gDemoMode) { render_lakitu(PLAYER_THREE); } @@ -603,7 +603,7 @@ void render_object_p4(void) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_FOUR); + render_bomb_karts_wrap(PLAYER_FOUR); if ((!gDemoMode) && (gPlayerCountSelection1 == 4)) { render_lakitu(PLAYER_FOUR); } @@ -692,7 +692,7 @@ void render_player_snow_effect_four(void) { } void render_object_for_player(s32 cameraId) { - +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: break; @@ -777,12 +777,15 @@ void render_object_for_player(s32 cameraId) { } break; } +#else + +#endif render_object_smoke_particles(cameraId); render_object_leaf_particle(cameraId); if (D_80165730 != 0) { - func_80053E6C(cameraId); + render_object_grand_prix_balloons(cameraId); } if (gModeSelection == BATTLE) { render_object_bomb_kart(cameraId); @@ -1039,14 +1042,14 @@ void func_800591B4(void) { if (D_80165800[0] != 0) { func_8004EE54(0); if (gModeSelection != BATTLE) { - func_8004F020(0); + render_mini_map_finish_line(0); } func_8004F3E4(0); } if ((gScreenModeSelection == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL) && (D_80165800[1] != 0)) { func_8004EE54(1); if (gModeSelection != BATTLE) { - func_8004F020(1); + render_mini_map_finish_line(1); } func_8004F3E4(1); } @@ -1316,16 +1319,16 @@ void func_80059D00(void) { if (!gDemoMode) { func_8007AA44(0); } - func_80078C70(0); + course_update_clouds(0); if (playerHUD[PLAYER_ONE].raceCompleteBool == 0) { - func_8005C360((gPlayerOneCopy->unk_094 / 18.0f) * 216.0f); + func_8005C360((gPlayerOneCopy->speed / 18.0f) * 216.0f); } func_8005D0FC(PLAYER_ONE); } else { func_80059820(PLAYER_ONE); - func_80078C70(1); + course_update_clouds(1); func_80059820(PLAYER_TWO); - func_80078C70(2); + course_update_clouds(2); } update_object(); break; @@ -1337,14 +1340,14 @@ void func_80059D00(void) { if (!gDemoMode) { func_8007AA44(0); } - func_80078C70(1); + course_update_clouds(1); func_8005D1F4(0); func_80059820(PLAYER_TWO); func_8005D0FC(PLAYER_TWO); if (!gDemoMode) { func_8007AA44(1); } - func_80078C70(2); + course_update_clouds(2); func_8005D1F4(1); update_object(); break; @@ -1356,14 +1359,14 @@ void func_80059D00(void) { if (!gDemoMode) { func_8007AA44(0); } - func_80078C70(3); + course_update_clouds(3); func_8005D1F4(0); func_80059820(PLAYER_TWO); func_8005D0FC(PLAYER_TWO); if (!gDemoMode) { func_8007AA44(1); } - func_80078C70(4); + course_update_clouds(4); func_8005D1F4(1); update_object(); break; @@ -1419,7 +1422,7 @@ void func_8005A070(void) { func_80077640(); } else if (gGamestate == CREDITS_SEQUENCE) { func_80059820(PLAYER_ONE); - func_80078C70(0); + course_update_clouds(0); update_object(); } else { func_80059D00(); @@ -1439,7 +1442,8 @@ void func_8005A14C(s32 playerId) { objectIndex = D_8018CE10[playerId].objectIndex; lapCount = gLapCountByPlayerId[playerId]; if (player->type & PLAYER_EXISTS) { - if (player->effects & 0x204C0) { + if (player->effects & + (LIGHTNING_STRIKE_EFFECT | HIT_BY_GREEN_SHELL_EFFECT | BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT)) { gObjectList[objectIndex].direction_angle[2] += 0x1000; } else { if (gObjectList[objectIndex].direction_angle[2] != 0) { @@ -1451,12 +1455,12 @@ void func_8005A14C(s32 playerId) { } else { f32_step_towards(&gObjectList[objectIndex].sizeScaling, 0.6f, 0.02f); } - if (player->effects & HIT_EFFECT) { + if (player->effects & SQUISH_EFFECT) { u16_step_up_towards(&gObjectList[objectIndex].direction_angle[0], 0x0C00U, 0x0100U); } else { u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000100); } - if (player->effects & 0x03000000) { + if (player->effects & (HIT_BY_STAR_EFFECT | EXPLOSION_CRASH_EFFECT)) { func_80087D24(objectIndex, 6.0f, 1.5f, 0.0f); } else { f32_step_towards(&gObjectList[objectIndex].offset[1], 0.0f, 1.0f); @@ -1567,6 +1571,7 @@ void func_8005A71C(void) { } void update_object(void) { +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: case COURSE_CHOCO_MOUNTAIN: @@ -1635,6 +1640,10 @@ void update_object(void) { update_ferries_smoke_particle(); break; } +#else + +#endif + if (D_80165730 != 0) { func_80074EE8(); } @@ -2589,7 +2598,8 @@ void func_8005CB60(s32 playerId, s32 lapCount) { case 1: /* switch 1 */ func_80079084(playerId); func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15)); - if ((gCurrentCourseId == 8) && (D_80165898 == 0) && (gModeSelection != (s32) 1)) { + if ((gCurrentCourseId == COURSE_LUIGI_RACEWAY) && (D_80165898 == 0) && + (gModeSelection != (s32) 1)) { D_80165898 = 1; } break; @@ -2610,7 +2620,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) { if (D_8018D114 == 2) { D_80165800[playerId] = 0; } - if (gCurrentCourseId == 4) { + if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { playerHUD[playerId].unk_81 = 1; } playerHUD[playerId].lap1CompletionTimeX = 0x0140; @@ -2709,22 +2719,22 @@ void func_8005D18C(void) { } void func_8005D1F4(s32 arg0) { - s32 playerWaypoint; - s32 bombWaypoint; + s32 playerPathPoint; + s32 bombPathPoint; s32 var_a2; - s32 waypointDiff; + s32 pathPointDiff; if (gModeSelection == 2) { - playerWaypoint = gNearestWaypointByPlayerId[arg0]; + playerPathPoint = gNearestPathPointByPlayerId[arg0]; playerHUD[arg0].unk_74 = 0; for (var_a2 = 0; var_a2 < NUM_BOMB_KARTS_VERSUS; var_a2++) { if ((gBombKarts[var_a2].state == BOMB_STATE_EXPLODED) || (gBombKarts[var_a2].state == BOMB_STATE_INACTIVE)) { continue; } - bombWaypoint = gBombKarts[var_a2].waypointIndex; - waypointDiff = bombWaypoint - playerWaypoint; - if ((waypointDiff < -5) || (waypointDiff > 0x1E)) { + bombPathPoint = gBombKarts[var_a2].pathPointIndex; + pathPointDiff = bombPathPoint - playerPathPoint; + if ((pathPointDiff < -5) || (pathPointDiff > 0x1E)) { continue; } playerHUD[arg0].unk_74 = 1; @@ -2736,26 +2746,26 @@ void func_8005D1F4(s32 arg0) { // Appears to load GP Mode race staging balloons and kart shadows. void func_8005D290(void) { D_8018D488 = dma_textures(gTexture69C80C, 0x400, 0x400); - D_8018D474 = dma_textures(gTextureKartShadow, 0x1000, 0x1000); + gLoadedTextureKartShadow = 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_8018D480 = dma_textures(gTextureSpeechBubble, 0x400, 0x400); + D_8018D484 = dma_textures(gTextureMusicNote, 0x400, 0x400); + D_8018D48C = dma_textures(gTextureSmokePuff, 0x400, 0x400); + gLoadedGroundDust = dma_textures(gGroundDust, 0x400, 0x400); D_8018D490 = D_8018D48C; - D_8018D498 = dma_textures(gTexture69B378, 0x1000, 0x1000); + gLoadedGrassParticle = dma_textures(gGrassParticle, 0x1000, 0x1000); D_8018D4BC = dma_textures(gTextureBalloon1, 0x800, 0x800); D_8018D4C0 = dma_textures(gTextureBalloon2, 0x800, 0x800); D_8018D49C = dma_textures(gTexture69C9C4, 0x200, 0x200); D_8018D4A0 = dma_textures(gTextureBoingExclamation, 0x800, 0x800); - D_8018D4A4 = dma_textures(gTextureOnomatopoeiaPoomp1, 0x800, 0x800); - D_8018D4A8 = dma_textures(gTextureOnomatopoeiaPoomp2, 0x800, 0x800); - D_8018D4AC = dma_textures(gTextureOnomatopoeiaWhrrrr1, 0x800, 0x800); - D_8018D4B0 = dma_textures(gTextureOnomatopoeiaWhrrrr2, 0x800, 0x800); - D_8018D4B4 = dma_textures(gTextureOnomatopoeiaCrash1, 0x800, 0x800); - D_8018D4B8 = dma_textures(gTextureOnomatopoeiaCrash2, 0x800, 0x800); + gTextureLoadedOnomatopoeiaPoomp1 = dma_textures(gTextureOnomatopoeiaPoomp1, 0x800, 0x800); + gTextureLoadedOnomatopoeiaPoomp2 = dma_textures(gTextureOnomatopoeiaPoomp2, 0x800, 0x800); + gTextureLoadedOnomatopoeiaWhrrrr1 = dma_textures(gTextureOnomatopoeiaWhrrrr1, 0x800, 0x800); + gTextureLoadedOnomatopoeiaWhrrrr2 = dma_textures(gTextureOnomatopoeiaWhrrrr2, 0x800, 0x800); + gTextureLoadedOnomatopoeiaCrash1 = dma_textures(gTextureOnomatopoeiaCrash1, 0x800, 0x800); + gTextureLoadedOnomatopoeiaCrash2 = dma_textures(gTextureOnomatopoeiaCrash2, 0x800, 0x800); D_8018D438 = dma_textures(gTexture69CB84, 0x800, 0x800); D_8018D43C = dma_textures(gTexture69CCEC, 0x800, 0x800); D_8018D440 = dma_textures(gTexture69CEB8, 0x800, 0x800); @@ -2771,343 +2781,343 @@ void func_8005D290(void) { 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); + gTextureLoadedLightningBolt0 = dma_textures(gTextureLightningBolt0, 0x800, 0x800); + gTextureLoadedLightningBolt1 = dma_textures(gTextureLightningBolt1, 0x800, 0x800); } -void func_8005D6C0(Player* player) { +void reset_player_particle_pool(Player* player) { s32 temp_v0; for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { - player->unk_258[temp_v0].unk_01C = 0; - player->unk_258[temp_v0].unk_01E = 0; - player->unk_258[temp_v0].unk_012 = 0; + player->particlePool0[temp_v0].isAlive = 0; + player->particlePool0[temp_v0].timer = 0; + player->particlePool0[temp_v0].type = NO_PARTICLE; } for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { - player->unk_258[30 + temp_v0].unk_01C = 0; - player->unk_258[30 + temp_v0].unk_01E = 0; - player->unk_258[30 + temp_v0].unk_012 = 0; + player->particlePool3[temp_v0].isAlive = 0; + player->particlePool3[temp_v0].timer = 0; + player->particlePool3[temp_v0].type = NO_PARTICLE; } for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { - player->unk_258[10 + temp_v0].unk_01C = 0; - player->unk_258[10 + temp_v0].unk_01E = 0; - player->unk_258[10 + temp_v0].unk_012 = 0; + player->particlePool1[temp_v0].isAlive = 0; + player->particlePool1[temp_v0].timer = 0; + player->particlePool1[temp_v0].type = NO_PARTICLE; } for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { - player->unk_258[20 + temp_v0].unk_01C = 0; - player->unk_258[20 + temp_v0].unk_01E = 0; - player->unk_258[20 + temp_v0].unk_012 = 0; + player->particlePool2[temp_v0].isAlive = 0; + player->particlePool2[temp_v0].timer = 0; + player->particlePool2[temp_v0].type = NO_PARTICLE; } } -void func_8005D794(Player* player, UnkPlayerStruct258* arg1, f32 arg2, f32 arg3, f32 arg4, s8 surfaceType, s8 arg6) { - arg1->unk_000[2] = arg4; - arg1->unk_000[0] = arg2; - arg1->unk_000[1] = arg3; - arg1->unk_020 = -player->rotation[1]; - arg1->unk_014 = surfaceType; +void set_particle_position_and_rotation(Player* player, Particle* arg1, f32 x, f32 y, f32 z, s8 surfaceType, s8 arg6) { + arg1->pos[2] = z; + arg1->pos[0] = x; + arg1->pos[1] = y; + arg1->rotation = -player->rotation[1]; + arg1->surfaceType = surfaceType; arg1->unk_010 = arg6; } -s32 func_8005D7D8(UnkPlayerStruct258* arg0, s8 arg1, f32 arg2) { - arg0->unk_01C = 1; - arg0->unk_012 = arg1; - arg0->unk_01E = 0; - arg0->unk_00C = arg2; +s32 init_particle_player(Particle* arg0, s8 type, f32 arg2) { + arg0->isAlive = true; + arg0->type = type; + arg0->timer = 0; + arg0->scale = arg2; } -s32 func_8005D800(UnkPlayerStruct258* arg0, s32 arg1, s16 arg2) { - arg0->unk_038 = (u8) (arg1 >> 16); - arg0->unk_03A = (u8) (arg1 >> 8); - arg0->unk_03C = (u8) arg1; - arg0->unk_03E = arg2; +s32 set_particle_colour(Particle* arg0, s32 color, s16 alpha) { + arg0->red = (u8) (color >> 16); + arg0->green = (u8) (color >> 8); + arg0->blue = (u8) color; + arg0->alpha = alpha; } -s32 func_8005D82C(UnkPlayerStruct258* arg0, s32 arg1, s16 arg2) { +s32 func_8005D82C(Particle* arg0, s32 arg1, s16 alpha) { s32 temp_v0; - temp_v0 = random_int(0x30); + temp_v0 = random_int(48); - arg0->unk_038 = (u8) ((u8) (arg1 >> 0x10) - temp_v0); - arg0->unk_03A = (u8) ((u8) (arg1 >> 8) - temp_v0); - arg0->unk_03C = (u8) ((u8) arg1 - temp_v0); - arg0->unk_03E = arg2; + arg0->red = (u8) ((u8) (arg1 >> 16) - temp_v0); + arg0->green = (u8) ((u8) (arg1 >> 8) - temp_v0); + arg0->blue = (u8) ((u8) arg1 - temp_v0); + arg0->alpha = alpha; } -void func_8005D898(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { +void set_drift_particles(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { s32 temp_lo; if (player->unk_0C0 >= 0) { - func_8005D794(player, &player->unk_258[10 + arg1], player->tyres[BACK_LEFT].pos[0], - player->tyres[BACK_LEFT].baseHeight + 2.0f, player->tyres[BACK_LEFT].pos[2], - player->tyres[BACK_LEFT].surfaceType, 1); + set_particle_position_and_rotation(player, &player->particlePool1[arg1], player->tyres[BACK_LEFT].pos[0], + player->tyres[BACK_LEFT].baseHeight + 2.0f, player->tyres[BACK_LEFT].pos[2], + player->tyres[BACK_LEFT].surfaceType, 1); } else { - func_8005D794(player, &player->unk_258[10 + arg1], player->tyres[BACK_RIGHT].pos[0], - player->tyres[BACK_RIGHT].baseHeight + 2.0f, player->tyres[BACK_RIGHT].pos[2], - player->tyres[BACK_RIGHT].surfaceType, 0); + set_particle_position_and_rotation(player, &player->particlePool1[arg1], player->tyres[BACK_RIGHT].pos[0], + player->tyres[BACK_RIGHT].baseHeight + 2.0f, + player->tyres[BACK_RIGHT].pos[2], player->tyres[BACK_RIGHT].surfaceType, 0); } temp_lo = player->unk_0C0 / 182; if ((temp_lo >= 7) || (temp_lo < -6)) { - func_8005D7D8(&player->unk_258[10 + arg1], 1, 0.35f); - if (player->unk_22A == 0) { - func_8005D800(&player->unk_258[10 + arg1], 0xFFFFFF, 0x70); + init_particle_player(&player->particlePool1[arg1], DRIFT_PARTICLE, 0.35f); + if (player->driftState == 0) { + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x70); } - if (player->unk_22A == 1) { - func_8005D800(&player->unk_258[10 + arg1], 0xFFFF00, 0x70); + if (player->driftState == 1) { + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0x00), 0x70); } - if (player->unk_22A >= 2) { - func_8005D800(&player->unk_258[10 + arg1], 0xFF9600, 0x70); + if (player->driftState >= 2) { + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0x96, 0x00), 0x70); } - if (player->unk_22A >= 2) { + if (player->driftState >= 2) { // Why not put this in previous if statement? - player->unk_258[10 + arg1].unk_040 = 2; + player->particlePool1[arg1].unk_040 = 2; return; } - player->unk_258[10 + arg1].unk_040 = player->unk_22A; + player->particlePool1[arg1].unk_040 = player->driftState; } } -void func_8005DA30(Player* player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - if ((arg1 == 0) && ((player->unk_258[10 + arg2].unk_01E >= 3) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D898(player, arg1, arg2, arg3, arg4); - } else if (player->unk_258[10 + arg2].unk_01E >= 3) { - func_8005D898(player, arg1, arg2, arg3, arg4); +void check_drift_particles_setup_valid(Player* player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { + if ((arg1 == 0) && ((player->particlePool1[arg2].timer >= 3) || (player->particlePool1[arg2].isAlive == 0))) { + set_drift_particles(player, arg1, arg2, arg3, arg4); + } else if (player->particlePool1[arg2].timer >= 3) { + set_drift_particles(player, arg1, arg2, arg3, arg4); } } UNUSED void func_8005DAD0(void) { } -void func_8005DAD8(UnkPlayerStruct258* arg0, s16 arg1, s16 arg2, s16 arg3) { - arg0->unk_038 = arg1; - arg0->unk_03E = arg3; - arg0->unk_040 = arg2; +void func_8005DAD8(Particle* particle, s16 arg1, s16 arg2, s16 arg3) { + particle->red = arg1; + particle->alpha = arg3; + particle->unk_040 = arg2; } -void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { +void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { UNUSED s32 stackPadding; s32 surfaceType; s32 var_t3; - f32 var_f2; - f32 var_f12; - f32 var_f14; - s32 temp_v0; + f32 tyre_x; + f32 tyre_y; + f32 tyre_z; + s32 randval; static s32 test = 8; surfaceType = 0x000000FF; - temp_v0 = random_int(test); - if ((temp_v0 == 0) || (temp_v0 == 4)) { - var_f2 = player->tyres[BACK_LEFT].pos[0]; - var_f12 = player->tyres[BACK_LEFT].baseHeight + 2.0f; - var_f14 = player->tyres[BACK_LEFT].pos[2]; + randval = random_int(test); + if ((randval == 0) || (randval == 4)) { + tyre_x = player->tyres[BACK_LEFT].pos[0]; + tyre_y = player->tyres[BACK_LEFT].baseHeight + 2.0f; + tyre_z = player->tyres[BACK_LEFT].pos[2]; var_t3 = 1; surfaceType = player->tyres[BACK_LEFT].surfaceType; } - if ((temp_v0 == 2) || (temp_v0 == 6)) { - var_f2 = player->tyres[BACK_RIGHT].pos[0]; - var_f12 = player->tyres[BACK_RIGHT].baseHeight + 2.0f; - var_f14 = player->tyres[BACK_RIGHT].pos[2]; + if ((randval == 2) || (randval == 6)) { + tyre_x = player->tyres[BACK_RIGHT].pos[0]; + tyre_y = player->tyres[BACK_RIGHT].baseHeight + 2.0f; + tyre_z = player->tyres[BACK_RIGHT].pos[2]; var_t3 = 0; surfaceType = player->tyres[BACK_RIGHT].surfaceType; } switch (surfaceType) { case DIRT: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { - func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 1, 0, 0x0080); } if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { - func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 7, 0, 0x0080); } if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { - func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 8, 0, 0x0080); } if (gCurrentCourseId == COURSE_WARIO_STADIUM) { - func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 9, 0, 0x0080); } if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { - func_8005DAD8(&player->unk_258[10 + arg1], 10, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 10, 0, 0x0080); } if (gCurrentCourseId == COURSE_DK_JUNGLE) { - func_8005DAD8(&player->unk_258[10 + arg1], 11, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 11, 0, 0x0080); } - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { - func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 1, 0, 0x0080); } if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { - func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 7, 0, 0x0080); } if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { - func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 8, 0, 0x0080); } if (gCurrentCourseId == COURSE_WARIO_STADIUM) { - func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 9, 0, 0x0080); } if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { - func_8005DAD8(&player->unk_258[10 + arg1], 10, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 10, 0, 0x0080); } if (gCurrentCourseId == COURSE_DK_JUNGLE) { - func_8005DAD8(&player->unk_258[10 + arg1], 11, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 11, 0, 0x0080); } - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case GRASS: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 3, 1.0f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[10 + arg1].unk_038 -= arg1 * 8; - player->unk_258[10 + arg1].unk_03A -= arg1 * 8; - player->unk_258[10 + arg1].unk_03C -= arg1 * 8; + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GRASS_PARTICLE, 1.0f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].red -= arg1 * 8; + player->particlePool1[arg1].green -= arg1 * 8; + player->particlePool1[arg1].blue -= arg1 * 8; } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 3, 1.0f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[10 + arg1].unk_038 -= arg1 * 8; - player->unk_258[10 + arg1].unk_03A -= arg1 * 8; - player->unk_258[10 + arg1].unk_03C -= arg1 * 8; + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GRASS_PARTICLE, 1.0f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].red -= arg1 * 8; + player->particlePool1[arg1].green -= arg1 * 8; + player->particlePool1[arg1].blue -= arg1 * 8; } - player->unk_258[10 + arg1].unk_000[1] -= 1.5; + player->particlePool1[arg1].pos[1] -= 1.5; break; case SAND_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 2, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 2, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case SAND: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 3, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 3, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case WET_SAND: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 4, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 4, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case DIRT_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 5, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005D82C(&player->unk_258[10 + arg1], 0x00FFA54F, 0x00AF); - func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005D82C(&player->particlePool1[arg1], 0x00FFA54F, 0x00AF); + func_8005DAD8(&player->particlePool1[arg1], 5, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case SNOW: case SNOW_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 6, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 6, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case ASPHALT: case STONE: case BRIDGE: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) && + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((((player->speed / 18.0f) * 216.0f) >= 30.0f) && ((((player->unk_0C0 / 182) > 0x14) || ((player->unk_0C0 / 182) < (-0x14))))) || - ((player->unk_22C - player->unk_094) >= 0.04)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->previousSpeed - player->speed) >= 0.04)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 0, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && - (((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) && + } else if ((player->particlePool1[arg2].timer > 0) && + (((((player->speed / 18.0f) * 216.0f) >= 30.0f) && (((player->unk_0C0 / 182) >= 0x15) || ((player->unk_0C0 / 182) < -0x14))) || - ((player->unk_22C - player->unk_094) >= 0.04))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->previousSpeed - player->speed) >= 0.04))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], tyre_x, tyre_y, tyre_z, + (s8) surfaceType, (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], GROUND_PARTICLE, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 0, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); } break; default: @@ -3117,45 +3127,45 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 void func_8005EA94(Player* player, s16 arg1, s32 arg2, s8 arg3, UNUSED s8 arg4) { s32 temp_v0; - s32 var_t0; + s32 surfaceType; s32 var_t1; - f32 var_f2; - f32 var_f12; - f32 var_f14; + f32 x; + f32 y; + f32 z; static s32 test = 10; - var_t0 = 0x000000FF; + surfaceType = 0x000000FF; temp_v0 = random_int(test); if ((temp_v0 == 0) || (temp_v0 == 8)) { if ((D_801652A0[arg3] - player->tyres[BACK_LEFT].baseHeight) >= 3.5) { - var_f2 = player->tyres[BACK_LEFT].pos[0]; - var_f12 = player->tyres[BACK_LEFT].baseHeight + 2.0f; - var_f14 = player->tyres[BACK_LEFT].pos[2]; + x = player->tyres[BACK_LEFT].pos[0]; + y = player->tyres[BACK_LEFT].baseHeight + 2.0f; + z = player->tyres[BACK_LEFT].pos[2]; var_t1 = 1; - var_t0 = 0; + surfaceType = 0; } } if ((temp_v0 == 2) || (temp_v0 == 6)) { if ((D_801652A0[arg3] - player->tyres[BACK_RIGHT].baseHeight) >= 3.5) { - var_f2 = player->tyres[BACK_RIGHT].pos[0]; - var_f12 = player->tyres[BACK_RIGHT].baseHeight + 2.0f; - var_f14 = player->tyres[BACK_RIGHT].pos[2]; + x = player->tyres[BACK_RIGHT].pos[0]; + y = player->tyres[BACK_RIGHT].baseHeight + 2.0f; + z = player->tyres[BACK_RIGHT].pos[2]; var_t1 = 0; - var_t0 = 0; + surfaceType = 0; } } if (1) {} - if (var_t0 == 0) { - if ((arg1 == 0) && ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, var_t0, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 9, 0.8f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00AF); + if (surfaceType == 0) { + if ((arg1 == 0) && ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + if (((player->speed / 18.0f) * 216.0f) >= 10.0f) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 9, 0.8f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00AF); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, var_t0, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 9, 0.8f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00AF); + } else if ((player->particlePool1[arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 9, 0.8f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00AF); } } } @@ -3164,194 +3174,195 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 s32 temp_v0; s32 surfaceType; s32 var_t3; - f32 var_f0; - f32 var_f2; - f32 var_f12; + f32 x; + f32 y; + f32 z; static s32 test = 8; surfaceType = 0x000000FF; temp_v0 = random_int(test); if ((temp_v0 == 2) || (temp_v0 == 4)) { - var_f0 = player->tyres[BACK_LEFT].pos[0]; - var_f2 = player->tyres[BACK_LEFT].baseHeight + 2.0f; - var_f12 = player->tyres[BACK_LEFT].pos[2]; + x = player->tyres[BACK_LEFT].pos[0]; + y = player->tyres[BACK_LEFT].baseHeight + 2.0f; + z = player->tyres[BACK_LEFT].pos[2]; var_t3 = 1; surfaceType = player->tyres[BACK_LEFT].surfaceType; } if ((temp_v0 == 0) || (temp_v0 == 6)) { - var_f0 = player->tyres[BACK_RIGHT].pos[0]; - var_f2 = player->tyres[BACK_RIGHT].baseHeight + 2.0f; - var_f12 = player->tyres[BACK_RIGHT].pos[2]; + x = player->tyres[BACK_RIGHT].pos[0]; + y = player->tyres[BACK_RIGHT].baseHeight + 2.0f; + z = player->tyres[BACK_RIGHT].pos[2]; var_t3 = 0; surfaceType = player->tyres[BACK_RIGHT].surfaceType; } + switch (surfaceType) { case DIRT: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { - func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 1, 0, 0x0080); } if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { - func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 7, 0, 0x0080); } if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { - func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 8, 0, 0x0080); } if (gCurrentCourseId == COURSE_WARIO_STADIUM) { - func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 9, 0, 0x0080); } if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { - func_8005DAD8(&player->unk_258[10 + arg1], 10, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 10, 0, 0x0080); } if (gCurrentCourseId == COURSE_DK_JUNGLE) { - func_8005DAD8(&player->unk_258[10 + arg1], 11, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 11, 0, 0x0080); } - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { - func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 1, 0, 0x0080); } if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { - func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 7, 0, 0x0080); } if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { - func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 8, 0, 0x0080); } if (gCurrentCourseId == COURSE_WARIO_STADIUM) { - func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 9, 0, 0x0080); } if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { - func_8005DAD8(&player->unk_258[10 + arg1], 0x000A, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 0x000A, 0, 0x0080); } if (gCurrentCourseId == COURSE_DK_JUNGLE) { - func_8005DAD8(&player->unk_258[10 + arg1], 0x000B, 0, 0x0080); + func_8005DAD8(&player->particlePool1[arg1], 0x000B, 0, 0x0080); } - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case GRASS: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.1f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[10 + arg1].unk_038 -= arg1 * 8; - player->unk_258[10 + arg1].unk_03A -= arg1 * 8; - player->unk_258[10 + arg1].unk_03C -= arg1 * 8; - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.1f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[10 + arg1].unk_038 -= arg1 * 8; - player->unk_258[10 + arg1].unk_03A -= arg1 * 8; - player->unk_258[10 + arg1].unk_03C -= arg1 * 8; - } - player->unk_258[10 + arg1].unk_000[1] -= 1.5; + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.1f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].red -= arg1 * 8; + player->particlePool1[arg1].green -= arg1 * 8; + player->particlePool1[arg1].blue -= arg1 * 8; + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.1f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].red -= arg1 * 8; + player->particlePool1[arg1].green -= arg1 * 8; + player->particlePool1[arg1].blue -= arg1 * 8; + } + player->particlePool1[arg1].pos[1] -= 1.5; break; case SAND_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 2, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 2, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case SAND: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 3, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 3, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case WET_SAND: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 4, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 4, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case DIRT_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 5, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 5, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case SNOW: case SNOW_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 6, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 6, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case ASPHALT: case STONE: case BRIDGE: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType, - (s8) var_t3); - func_8005D7D8(&player->unk_258[10 + arg1], 5, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 0, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, (s8) surfaceType, + (s8) var_t3); + init_particle_player(&player->particlePool1[arg1], 5, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 0, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); } break; default: @@ -3359,260 +3370,252 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 } } -#ifdef NON_MATCHING -// Its close, there's some register allocation issue though -// Permuter hasn't found anything -// https://decomp.me/scratch/WjMqd - void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { s32 var_t1; u8 surfaceType; - f32 var_f0; - f32 var_f2; - f32 var_f12; + f32 x; + f32 y; + f32 z; var_t1 = 0; - if ((player->effects & 0x80) == 0x80) { - var_f0 = player->pos[0]; - var_f2 = player->pos[1] - player->boundingBoxSize; - var_f12 = player->pos[2]; + if ((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) { + x = player->pos[0]; + y = player->pos[1] - player->boundingBoxSize; + z = player->pos[2]; var_t1 = 1; - surfaceType = player->tyres[BACK_LEFT].surfaceType; + surfaceType = player->tyres[BACK_LEFT].surfaceType & 0xFF; } else { - var_f0 = player->pos[0]; - var_f2 = player->pos[1] - player->boundingBoxSize; - var_f12 = player->pos[2]; - surfaceType = player->tyres[BACK_RIGHT].surfaceType; + x = player->pos[0]; + y = player->pos[1] - player->boundingBoxSize; + z = player->pos[2]; + surfaceType = player->tyres[BACK_RIGHT].surfaceType & 0xFF; } switch (surfaceType) { case DIRT: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - if ((gCurrentCourseId == 1) || (gCurrentCourseId == 7)) { - func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { + func_8005DAD8(&player->particlePool1[arg1], 1, 0, 0x0080); } - if (gCurrentCourseId == 0x000B) { - func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); + if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { + func_8005DAD8(&player->particlePool1[arg1], 7, 0, 0x0080); } - if (gCurrentCourseId == 9) { - func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); + if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { + func_8005DAD8(&player->particlePool1[arg1], 8, 0, 0x0080); } - if (gCurrentCourseId == 0x000E) { - func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); + if (gCurrentCourseId == COURSE_WARIO_STADIUM) { + func_8005DAD8(&player->particlePool1[arg1], 9, 0, 0x0080); } - if (gCurrentCourseId == 4) { - func_8005DAD8(&player->unk_258[10 + arg1], 0x000A, 0, 0x0080); + if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { + func_8005DAD8(&player->particlePool1[arg1], 0x000A, 0, 0x0080); } - if (gCurrentCourseId == 0x0012) { - func_8005DAD8(&player->unk_258[10 + arg1], 0x000B, 0, 0x0080); + if (gCurrentCourseId == COURSE_DK_JUNGLE) { + func_8005DAD8(&player->particlePool1[arg1], 0x000B, 0, 0x0080); } - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - if ((gCurrentCourseId == 1) || (gCurrentCourseId == 7)) { - func_8005DAD8(&player->unk_258[10 + arg1], 1, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { + func_8005DAD8(&player->particlePool1[arg1], 1, 0, 0x0080); } - if (gCurrentCourseId == 0x000B) { - func_8005DAD8(&player->unk_258[10 + arg1], 7, 0, 0x0080); + if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { + func_8005DAD8(&player->particlePool1[arg1], 7, 0, 0x0080); } - if (gCurrentCourseId == 9) { - func_8005DAD8(&player->unk_258[10 + arg1], 8, 0, 0x0080); + if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { + func_8005DAD8(&player->particlePool1[arg1], 8, 0, 0x0080); } - if (gCurrentCourseId == 0x000E) { - func_8005DAD8(&player->unk_258[10 + arg1], 9, 0, 0x0080); + if (gCurrentCourseId == COURSE_WARIO_STADIUM) { + func_8005DAD8(&player->particlePool1[arg1], 9, 0, 0x0080); } - if (gCurrentCourseId == 4) { - func_8005DAD8(&player->unk_258[10 + arg1], 0x000A, 0, 0x0080); + if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { + func_8005DAD8(&player->particlePool1[arg1], 0x000A, 0, 0x0080); } - if (gCurrentCourseId == 0x0012) { - func_8005DAD8(&player->unk_258[10 + arg1], 0x000B, 0, 0x0080); + if (gCurrentCourseId == COURSE_DK_JUNGLE) { + func_8005DAD8(&player->particlePool1[arg1], 0x000B, 0, 0x0080); } - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case GRASS: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.1f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[10 + arg1].unk_038 -= arg1 * 8; - player->unk_258[10 + arg1].unk_03A -= arg1 * 8; - player->unk_258[10 + arg1].unk_03C -= arg1 * 8; - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.1f); - func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[10 + arg1].unk_038 -= arg1 * 8; - player->unk_258[10 + arg1].unk_03A -= arg1 * 8; - player->unk_258[10 + arg1].unk_03C -= arg1 * 8; - } - player->unk_258[10 + arg1].unk_000[1] -= 1.5; + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.1f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].red -= arg1 * 8; + player->particlePool1[arg1].green -= arg1 * 8; + player->particlePool1[arg1].blue -= arg1 * 8; + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.1f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].red -= arg1 * 8; + player->particlePool1[arg1].green -= arg1 * 8; + player->particlePool1[arg1].blue -= arg1 * 8; + } + player->particlePool1[arg1].pos[1] -= 1.5; break; case SAND_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 2, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 2, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case SAND: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 3, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 3, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case WET_SAND: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 4, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 4, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case DIRT_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 5, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 5, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case SNOW: case SNOW_OFFROAD: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 6, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 6, 1, 0x00A8); + player->particlePool1[arg1].green = random_int(0x0010U); } break; case ASPHALT: case STONE: case BRIDGE: if ((arg1 == 0) && - ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); - } else if (player->unk_258[10 + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1); - func_8005D7D8(&player->unk_258[10 + arg1], 4, 0.46f); - func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); - player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); + ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 0, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], x, y, z, surfaceType, var_t1); + init_particle_player(&player->particlePool1[arg1], 4, 0.46f); + func_8005DAD8(&player->particlePool1[arg1], 0, 0, 0x0080); + player->particlePool1[arg1].green = random_int(0x0010U); } break; default: break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005F90C.s") -#endif void func_80060504(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { UNUSED s32 thing1; s16 thing2; UNUSED s32 thing3; - f32 sp50; - f32 sp4C; - f32 sp48; + f32 x; + f32 y; + f32 z; f32 var_f0; s32 var_v0; s32 temp_v0; UNUSED s32 test; - if ((player->unk_044 & 0x20) == 0x20) { + if ((player->kartProps & THROTTLE) == THROTTLE) { var_v0 = 5; } else { var_v0 = 0xE; } temp_v0 = random_int(var_v0); if ((temp_v0 == 1) || (temp_v0 == 2) || (temp_v0 == 3)) { - if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg2].unk_01C == 0))) { - sp4C = player->pos[1] - 2.5; - sp48 = player->pos[2]; - sp50 = player->pos[0]; - func_8005D794(player, &player->unk_258[arg1], sp50, sp4C, sp48, 0, 0); - func_8005D7D8(&player->unk_258[arg1], 1, 0.5f); - } else if (player->unk_258[arg2].unk_01E > 0) { - sp4C = player->pos[1] - 2.5; - sp48 = player->pos[2]; - sp50 = player->pos[0]; - func_8005D794(player, &player->unk_258[arg1], sp50, sp4C, sp48, 0, 0); - func_8005D7D8(&player->unk_258[arg1], 1, 0.5f); - } - } - player->unk_258[arg1].unk_024 = 0.0f; - if ((player->unk_044 & 0x20) == 0x20) { - player->unk_258[arg1].unk_040 = 0; - if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) { - func_8005D800(&player->unk_258[arg1], 0x00FFFF00, 0x0080); - player->unk_258[arg1].unk_038 = 1; + if ((arg1 == 0) && ((player->particlePool0[arg2].timer > 0) || (player->particlePool0[arg2].isAlive == 0))) { + y = player->pos[1] - 2.5; + z = player->pos[2]; + x = player->pos[0]; + set_particle_position_and_rotation(player, &player->particlePool0[arg1], x, y, z, 0, 0); + init_particle_player(&player->particlePool0[arg1], 1, 0.5f); + } else if (player->particlePool0[arg2].timer > 0) { + y = player->pos[1] - 2.5; + z = player->pos[2]; + x = player->pos[0]; + set_particle_position_and_rotation(player, &player->particlePool0[arg1], x, y, z, 0, 0); + init_particle_player(&player->particlePool0[arg1], 1, 0.5f); + } + } + player->particlePool0[arg1].unk_024 = 0.0f; + if ((player->kartProps & THROTTLE) == THROTTLE) { + player->particlePool0[arg1].unk_040 = 0; + if ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) { + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0x00), 0x0080); + player->particlePool0[arg1].red = 1; } else { - func_8005D800(&player->unk_258[arg1], 0x00FFFFFF, 0x0070); - player->unk_258[arg1].unk_038 = 0; + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x0070); + player->particlePool0[arg1].red = 0; } } else { - player->unk_258[arg1].unk_040 = 1; - if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) { - func_8005D800(&player->unk_258[arg1], 0x00FFFF00, 0x0080); - player->unk_258[arg1].unk_038 = 1; + player->particlePool0[arg1].unk_040 = 1; + if ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) { + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0x00), 0x0080); + player->particlePool0[arg1].red = 1; } else { - func_8005D800(&player->unk_258[arg1], 0x00FFFFFF, 0x0070); - player->unk_258[arg1].unk_038 = 0; + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x0070); + player->particlePool0[arg1].red = 0; } } - thing2 = (player->unk_258[arg1].unk_020 - (player->unk_0C0 / 2)); - if (player->unk_258[arg1].unk_040 == 0) { + thing2 = (player->particlePool0[arg1].rotation - (player->unk_0C0 / 2)); + if (player->particlePool0[arg1].unk_040 == 0) { var_f0 = -((player->unk_098 / 3000.0f) + 0.1); } else { var_f0 = -((player->unk_098 / 5000.0f) + 0.1); } - func_80062B18(&sp50, &sp4C, &sp48, 0.0f, 4.5f, (player->unk_258[arg1].unk_01E * var_f0) + -5.5, -thing2, + func_80062B18(&x, &y, &z, 0.0f, 4.5f, (player->particlePool0[arg1].timer * var_f0) + -5.5, -thing2, -player->unk_206 * 2); - player->unk_258[arg1].unk_000[0] = player->pos[0] + sp50; - sp4C = sp4C + (player->pos[1] - player->boundingBoxSize); - player->unk_258[arg1].unk_000[2] = player->pos[2] + sp48; - player->unk_258[arg1].unk_000[1] = player->unk_258[arg1].unk_024 + sp4C; - player->unk_258[arg1].unk_010 = 0; + player->particlePool0[arg1].pos[0] = player->pos[0] + x; + y = y + (player->pos[1] - player->boundingBoxSize); + player->particlePool0[arg1].pos[2] = player->pos[2] + z; + player->particlePool0[arg1].pos[1] = player->particlePool0[arg1].unk_024 + y; + player->particlePool0[arg1].unk_010 = 0; } void func_800608E0(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8 arg4) { @@ -3626,30 +3629,30 @@ void func_800608E0(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8 var_f0 = 0.0f; } sp4C = (D_801652A0[arg3] - player->pos[1]) - 3.0f; - if ((player->unk_0DE & 1) && (gCurrentCourseId != COURSE_KOOPA_BEACH)) { + if ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) && (gCurrentCourseId != COURSE_KOOPA_BEACH)) { var_f0 = 2.5f; sp4C = (f32) ((f64) (D_801652A0[arg3] - player->pos[1]) + 0.1); } - func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); - func_8005D7D8(&player->unk_258[arg1], 3, var_f0); + set_particle_position_and_rotation(player, &player->particlePool0[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + init_particle_player(&player->particlePool0[arg1], 3, var_f0); if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) || (gCurrentCourseId == COURSE_BIG_DONUT)) { - func_8005D800(&player->unk_258[arg1], 0, 0x00AF); + set_particle_colour(&player->particlePool0[arg1], RGB32(0x0, 0x0, 0x0), 0x00AF); } else { - func_8005D800(&player->unk_258[arg1], 0x00FFFFFF, 0x00CF); + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00CF); } func_80062B18(&sp50, &sp4C, &sp48, 0.0f, sp4C, - ((-player->unk_258[arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 10.0f) + -4.0f, - -player->unk_258[arg1].unk_020, -player->unk_206 * 2); - player->unk_258[arg1].unk_000[0] = player->pos[0] + sp50; - player->unk_258[arg1].unk_000[2] = player->pos[2] + sp48; - player->unk_258[arg1].unk_000[1] = player->pos[1] + sp4C; + ((-player->particlePool0[arg1].timer * (player->speed / 18.0f) * 216.0f) / 10.0f) + -4.0f, + -player->particlePool0[arg1].rotation, -player->unk_206 * 2); + player->particlePool0[arg1].pos[0] = player->pos[0] + sp50; + player->particlePool0[arg1].pos[2] = player->pos[2] + sp48; + player->particlePool0[arg1].pos[1] = player->pos[1] + sp4C; } void func_80060B14(Player* player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { if ((gCurrentCourseId != COURSE_SKYSCRAPER) && (gCurrentCourseId != COURSE_RAINBOW_ROAD)) { - if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg2].unk_01C == 0))) { + if ((arg1 == 0) && ((player->particlePool0[arg2].timer > 0) || (player->particlePool0[arg2].isAlive == 0))) { func_800608E0(player, arg1, arg2, arg3, arg4); - } else if (player->unk_258[arg2].unk_01E > 0) { + } else if (player->particlePool0[arg2].timer > 0) { func_800608E0(player, arg1, arg2, arg3, arg4); } } @@ -3675,73 +3678,73 @@ void func_80060BCC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 if (player != gPlayerOne) { return; } - if ((arg1 == 0) && ((player->unk_258[arg2 + 10].unk_01E > 0) || (player->unk_258[arg2 + 10].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[arg1 + 10], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); - func_8005D7D8(&player->unk_258[arg1 + 10], 0x0B, 0.4f); - func_8005D800(&player->unk_258[arg1 + 10], 0x00FFFFFF, 0x00FF); - player->unk_258[arg1 + 10].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -1.8); - player->unk_258[arg1 + 10].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -1.8); - player->unk_258[arg1 + 10].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; - player->unk_258[arg1 + 10].unk_018 = sp44 + 1.0f; - player->unk_258[arg1 + 10].unk_00C = (sp48 + 2.0f) / 10.0f; - } else if (player->unk_258[arg2 + 10].unk_01E > 0) { - func_8005D794(player, &player->unk_258[arg1 + 10], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); - func_8005D7D8(&player->unk_258[arg1 + 10], 0x0B, 0.4f); - func_8005D800(&player->unk_258[arg1 + 10], 0x00FFFFFF, 0x00FF); - player->unk_258[arg1 + 10].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -1.8); - player->unk_258[arg1 + 10].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -1.8); - player->unk_258[arg1 + 10].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; - player->unk_258[arg1 + 10].unk_018 = sp44 + 1.0f; - player->unk_258[arg1 + 10].unk_00C = (sp48 + 2.0f) / 10.0f; + if ((arg1 == 0) && ((player->particlePool1[arg2].timer > 0) || (player->particlePool1[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + init_particle_player(&player->particlePool1[arg1], 0x0B, 0.4f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].pos[2] = player->pos[2] + (coss(sp54 * 0xB6) * -1.8); + player->particlePool1[arg1].pos[0] = player->pos[0] + (sins(sp54 * 0xB6) * -1.8); + player->particlePool1[arg1].pos[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->particlePool1[arg1].unk_018 = sp44 + 1.0f; + player->particlePool1[arg1].scale = (sp48 + 2.0f) / 10.0f; + } else if (player->particlePool1[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool1[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + init_particle_player(&player->particlePool1[arg1], 0x0B, 0.4f); + set_particle_colour(&player->particlePool1[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool1[arg1].pos[2] = player->pos[2] + (coss(sp54 * 0xB6) * -1.8); + player->particlePool1[arg1].pos[0] = player->pos[0] + (sins(sp54 * 0xB6) * -1.8); + player->particlePool1[arg1].pos[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->particlePool1[arg1].unk_018 = sp44 + 1.0f; + player->particlePool1[arg1].scale = (sp48 + 2.0f) / 10.0f; } } void func_80060F50(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8 arg4) { - func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(&player->unk_258[arg1], 5, 4.0f); + set_particle_position_and_rotation(player, &player->particlePool0[arg1], 0.0f, 0.0f, 0.0f, 0, 0); + init_particle_player(&player->particlePool0[arg1], 5, 4.0f); if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) || (gCurrentCourseId == COURSE_BIG_DONUT)) { - func_8005D800(&player->unk_258[arg1], 0xFF0000, 0xFF); + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0x00, 0x00), 0xFF); } else { - func_8005D800(&player->unk_258[arg1], 0xFFFFFF, 0xFF); + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0xFF), 0xFF); } - player->unk_258[arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[arg1].unk_020) * -5.8); - player->unk_258[arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[arg1].unk_020) * -5.8); - player->unk_258[arg1].unk_000[1] = D_801652A0[arg3]; - player->unk_0DE &= ~0x0008; + player->particlePool0[arg1].pos[2] = player->pos[2] + (coss(player->particlePool0[arg1].rotation) * -5.8); + player->particlePool0[arg1].pos[0] = player->pos[0] + (sins(player->particlePool0[arg1].rotation) * -5.8); + player->particlePool0[arg1].pos[1] = D_801652A0[arg3]; + player->oobProps &= ~UNDER_OOB_LEVEL; } void func_80061094(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { if (arg1 == 0) { - func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(&player->unk_258[arg1], 6, 3.8f); - func_8005D800(&player->unk_258[arg1], 0xFFFFFF, 0xFF); - player->unk_258[arg1].unk_038 = 0; - player->unk_258[arg1].unk_03A = 0; - player->unk_258[arg1].unk_03C = 0; + set_particle_position_and_rotation(player, &player->particlePool0[arg1], 0.0f, 0.0f, 0.0f, 0, 0); + init_particle_player(&player->particlePool0[arg1], 6, 3.8f); + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0xFF), 0xFF); + player->particlePool0[arg1].red = 0; + player->particlePool0[arg1].green = 0; + player->particlePool0[arg1].blue = 0; } } void func_80061130(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { - func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(&player->unk_258[arg1], 7, 0.6f); - func_8005D800(&player->unk_258[arg1], 0xFFFFFF, 0xD0); + set_particle_position_and_rotation(player, &player->particlePool0[arg1], 0.0f, 0.0f, 0.0f, 0, 0); + init_particle_player(&player->particlePool0[arg1], 7, 0.6f); + set_particle_colour(&player->particlePool0[arg1], RGB32(0xFF, 0xFF, 0xFF), 0xD0); - player->unk_258[arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[arg1].unk_020) * 6.0f); - player->unk_258[arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[arg1].unk_020) * 6.0f); - player->unk_258[arg1].unk_000[1] = player->pos[1] - 5.0f; - player->unk_258[arg1].unk_040 = 0; - player->unk_258[arg1].unk_024 = 0.0f; + player->particlePool0[arg1].pos[2] = player->pos[2] + (coss(player->particlePool0[arg1].rotation) * 6.0f); + player->particlePool0[arg1].pos[0] = player->pos[0] + (sins(player->particlePool0[arg1].rotation) * 6.0f); + player->particlePool0[arg1].pos[1] = player->pos[1] - 5.0f; + player->particlePool0[arg1].unk_040 = 0; + player->particlePool0[arg1].unk_024 = 0.0f; } void func_80061224(Player* player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg1].unk_01C == 0))) { + if ((arg1 == 0) && ((player->particlePool0[arg2].timer > 0) || (player->particlePool0[arg1].isAlive == 0))) { func_80061130(player, arg1, arg2, arg3, arg4); - } else if (player->unk_258[arg2].unk_01E >= 2) { + } else if (player->particlePool0[arg2].timer >= 2) { func_80061130(player, arg1, arg2, arg3, arg4); if (arg1 == 9) { - player->unk_044 &= ~0x0200; + player->kartProps &= ~BECOME_INVISIBLE; } } } @@ -3750,16 +3753,16 @@ void func_800612F8(Player* player, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s8 a s32 var_s2; for (var_s2 = 0; var_s2 < 10; var_s2++) { - player->unk_258[0x1E + var_s2].unk_01C = 1; - player->unk_258[0x1E + var_s2].unk_028 = player->pos[1] + 5.0f; - player->unk_258[0x1E + var_s2].unk_020 = (0x1C70 * var_s2) - player->rotation[1]; - player->unk_258[0x1E + var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.5; - player->unk_258[0x1E + var_s2].unk_03A = 0; - player->unk_258[0x1E + var_s2].unk_012 = 1; - player->unk_258[0x1E + var_s2].unk_01E = 0; - player->unk_258[0x1E + var_s2].unk_03E = 0x00FF; - player->unk_258[0x1E + var_s2].unk_000[2] = player->pos[2]; - player->unk_258[0x1E + var_s2].unk_000[0] = player->pos[0]; + player->particlePool3[var_s2].isAlive = 1; + player->particlePool3[var_s2].unk_028 = player->pos[1] + 5.0f; + player->particlePool3[var_s2].rotation = (0x1C70 * var_s2) - player->rotation[1]; + player->particlePool3[var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.5; + player->particlePool3[var_s2].green = 0; + player->particlePool3[var_s2].type = 1; + player->particlePool3[var_s2].timer = 0; + player->particlePool3[var_s2].alpha = 0x00FF; + player->particlePool3[var_s2].pos[2] = player->pos[2]; + player->particlePool3[var_s2].pos[0] = player->pos[0]; } player->unk_046 &= ~0x0008; } @@ -3768,20 +3771,20 @@ void func_80061430(Player* player, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s8 a s32 var_s2; for (var_s2 = 0; var_s2 < 7; var_s2++) { - player->unk_258[0x1E + var_s2].unk_01C = 1; - player->unk_258[0x1E + var_s2].unk_028 = player->pos[1] - 4.0f; - player->unk_258[0x1E + var_s2].unk_020 = (0x1C70 * var_s2) - player->rotation[1]; + player->particlePool3[var_s2].isAlive = 1; + player->particlePool3[var_s2].unk_028 = player->pos[1] - 4.0f; + player->particlePool3[var_s2].rotation = (0x1C70 * var_s2) - player->rotation[1]; // ??? - player->unk_258[0x1E + var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.9; - player->unk_258[0x1E + var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.5; - player->unk_258[0x1E + var_s2].unk_03A = 0; - player->unk_258[0x1E + var_s2].unk_012 = 9; - player->unk_258[0x1E + var_s2].unk_01E = 0; - player->unk_258[0x1E + var_s2].unk_03E = 0x00FF; - player->unk_258[0x1E + var_s2].unk_000[2] = player->pos[2]; - player->unk_258[0x1E + var_s2].unk_000[0] = player->pos[0]; + player->particlePool3[var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.9; + player->particlePool3[var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.5; + player->particlePool3[var_s2].green = 0; + player->particlePool3[var_s2].type = 9; + player->particlePool3[var_s2].timer = 0; + player->particlePool3[var_s2].alpha = 0x00FF; + player->particlePool3[var_s2].pos[2] = player->pos[2]; + player->particlePool3[var_s2].pos[0] = player->pos[0]; } - player->unk_044 &= ~0x1000; + player->kartProps &= ~UNUSED_0x1000; } void func_800615AC(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { @@ -3792,20 +3795,20 @@ void func_800615AC(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UN f32 sp28[10] = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; if (random_int(3U) == 2.0f) { - player->unk_258[0x1E + arg1].unk_01C = 1; - player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0]; - player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2]; - player->unk_258[0x1E + arg1].unk_020 = -player->rotation[1] + sp28[arg1]; - player->unk_258[0x1E + arg1].unk_018 = random_int(1U) + 2.0f; + player->particlePool3[arg1].isAlive = 1; + player->particlePool3[arg1].pos[0] = player->pos[0]; + player->particlePool3[arg1].pos[2] = player->pos[2]; + player->particlePool3[arg1].rotation = -player->rotation[1] + sp28[arg1]; + player->particlePool3[arg1].unk_018 = random_int(1U) + 2.0f; temp_f0 = random_int(4U); temp_f0 -= test; - player->unk_258[0x1E + arg1].unk_014 = temp_f0; - player->unk_258[0x1E + arg1].unk_000[1] = player->pos[1] + temp_f0; - player->unk_258[0x1E + arg1].unk_00C = 0.15f; - player->unk_258[0x1E + arg1].unk_012 = 5; - player->unk_258[0x1E + arg1].unk_01E = 0; - player->unk_258[0x1E + arg1].unk_03E = 0x00FF; - player->unk_258[0x1E + arg1].unk_038 = 0; + player->particlePool3[arg1].surfaceType = temp_f0; + player->particlePool3[arg1].pos[1] = player->pos[1] + temp_f0; + player->particlePool3[arg1].scale = 0.15f; + player->particlePool3[arg1].type = 5; + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].alpha = 0x00FF; + player->particlePool3[arg1].red = 0; } } @@ -3821,31 +3824,31 @@ void func_80061754(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3, U temp_s1 = random_int(0x0060U); sp44 = random_int(6U); sp48 = random_int(2U); - func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); - func_8005D7D8(&player->unk_258[0x1E + arg1], 6, 1.0f); - if ((player->effects & HIT_BY_ITEM_EFFECT) || ((player->effects) & 0x01000000) || ((player->effects) & 0x400) || - ((player->effects) & BOO_EFFECT)) { - func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00A0); - player->unk_258[0x1E + arg1].unk_038 -= temp_s1; - player->unk_258[0x1E + arg1].unk_03A -= temp_s1; - player->unk_258[0x1E + arg1].unk_03C -= temp_s1; + set_particle_position_and_rotation(player, &player->particlePool3[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + init_particle_player(&player->particlePool3[arg1], 6, 1.0f); + if ((player->effects & HIT_BY_STAR_EFFECT) || ((player->effects) & EXPLOSION_CRASH_EFFECT) || + ((player->effects) & HIT_BY_GREEN_SHELL_EFFECT) || ((player->effects) & BOO_EFFECT)) { + set_particle_colour(&player->particlePool3[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00A0); + player->particlePool3[arg1].red -= temp_s1; + player->particlePool3[arg1].green -= temp_s1; + player->particlePool3[arg1].blue -= temp_s1; } else { - func_8005D800(&player->unk_258[0x1E + arg1], 0, 0x00A0); - player->unk_258[0x1E + arg1].unk_038 += temp_s1; - player->unk_258[0x1E + arg1].unk_03A += temp_s1; - player->unk_258[0x1E + arg1].unk_03C += temp_s1; + set_particle_colour(&player->particlePool3[arg1], RGB32(0x0, 0x0, 0x0), 0x00A0); + player->particlePool3[arg1].red += temp_s1; + player->particlePool3[arg1].green += temp_s1; + player->particlePool3[arg1].blue += temp_s1; } - player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -5.0f); - player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -5.0f); - player->unk_258[0x1E + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; - player->unk_258[0x1E + arg1].unk_018 = sp44 + 1.0f; - player->unk_258[0x1E + arg1].unk_00C = sp48 + 1.0f; + player->particlePool3[arg1].pos[2] = player->pos[2] + (coss(sp54 * 0xB6) * -5.0f); + player->particlePool3[arg1].pos[0] = player->pos[0] + (sins(sp54 * 0xB6) * -5.0f); + player->particlePool3[arg1].pos[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->particlePool3[arg1].unk_018 = sp44 + 1.0f; + player->particlePool3[arg1].scale = sp48 + 1.0f; } void func_8006199C(Player* player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - if ((arg1 == 0) && ((player->unk_258[0x1E + arg2].unk_01E > 0) || (player->unk_258[0x1E + arg2].unk_01C == 0))) { + if ((arg1 == 0) && ((player->particlePool3[arg2].timer > 0) || (player->particlePool3[arg2].isAlive == 0))) { func_80061754(player, arg1, arg2, (s32) arg3, arg4); - } else if (player->unk_258[0x1E + arg2].unk_01E > 0) { + } else if (player->particlePool3[arg2].timer > 0) { func_80061754(player, arg1, arg2, (s32) arg3, arg4); } } @@ -3861,22 +3864,22 @@ void func_80061A34(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 sp4C = random_int(6U); random_int(6U); sp48 = (f32) random_int(3U); - if ((arg1 == 0) && ((player->unk_258[0x1E + arg2].unk_01E > 0) || (player->unk_258[0x1E + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); - func_8005D7D8(&player->unk_258[0x1E + arg1], 7, 1.0f); - func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -2.0); - player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -2.0); - player->unk_258[0x1E + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; - player->unk_258[0x1E + arg1].unk_00C = (sp48 + 2.0f) / 10.0f; - } else if (player->unk_258[0x1E + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); - func_8005D7D8(&player->unk_258[0x1E + arg1], 7, 1.0f); - func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00FF); - player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -2.0); - player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -2.0); - player->unk_258[0x1E + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + (f32) sp4C + 2.0f; - player->unk_258[0x1E + arg1].unk_00C = (sp48 + 2.0f) / 10.0f; + if ((arg1 == 0) && ((player->particlePool3[arg2].timer > 0) || (player->particlePool3[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool3[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + init_particle_player(&player->particlePool3[arg1], 7, 1.0f); + set_particle_colour(&player->particlePool3[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool3[arg1].pos[2] = player->pos[2] + (coss(sp54 * 0xB6) * -2.0); + player->particlePool3[arg1].pos[0] = player->pos[0] + (sins(sp54 * 0xB6) * -2.0); + player->particlePool3[arg1].pos[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->particlePool3[arg1].scale = (sp48 + 2.0f) / 10.0f; + } else if (player->particlePool3[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool3[arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + init_particle_player(&player->particlePool3[arg1], 7, 1.0f); + set_particle_colour(&player->particlePool3[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x00FF); + player->particlePool3[arg1].pos[2] = player->pos[2] + (coss(sp54 * 0xB6) * -2.0); + player->particlePool3[arg1].pos[0] = player->pos[0] + (sins(sp54 * 0xB6) * -2.0); + player->particlePool3[arg1].pos[1] = (player->pos[1] - player->boundingBoxSize) + (f32) sp4C + 2.0f; + player->particlePool3[arg1].scale = (sp48 + 2.0f) / 10.0f; } } @@ -3888,18 +3891,18 @@ void func_80061D4C(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UN f32 sp20[10] = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; if (random_int(3U) == 2.0f) { - player->unk_258[0x1E + arg1].unk_01C = 1; - player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0]; - player->unk_258[0x1E + arg1].unk_000[1] = player->pos[1] + 2.0f; - player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2]; - player->unk_258[0x1E + arg1].unk_020 = -player->rotation[1] + sp20[arg1]; - player->unk_258[0x1E + arg1].unk_018 = random_int(3U) + 2.0f; - player->unk_258[0x1E + arg1].unk_014 = random_int(4U); - player->unk_258[0x1E + arg1].unk_014 -= test; - player->unk_258[0x1E + arg1].unk_00C = 0.4f; - player->unk_258[0x1E + arg1].unk_012 = 2; - player->unk_258[0x1E + arg1].unk_01E = 0; - player->unk_258[0x1E + arg1].unk_03E = 0x00FF; + player->particlePool3[arg1].isAlive = 1; + player->particlePool3[arg1].pos[0] = player->pos[0]; + player->particlePool3[arg1].pos[1] = player->pos[1] + 2.0f; + player->particlePool3[arg1].pos[2] = player->pos[2]; + player->particlePool3[arg1].rotation = -player->rotation[1] + sp20[arg1]; + player->particlePool3[arg1].unk_018 = random_int(3U) + 2.0f; + player->particlePool3[arg1].surfaceType = random_int(4U); + player->particlePool3[arg1].surfaceType -= test; + player->particlePool3[arg1].scale = 0.4f; + player->particlePool3[arg1].type = 2; + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].alpha = 0x00FF; } } @@ -3908,7 +3911,7 @@ void func_80061EF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 s32 var_t0 = 0x000000FF; s32 var_t1; s32 temp_v1; - f32 var_f2; + f32 y; UNUSED s32 stackPadding1; if (1) {}; @@ -3916,47 +3919,48 @@ void func_80061EF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 if (temp_v1 == 1) { var_t1 = 1; var_t0 = 0; - var_f2 = player->pos[1]; + y = player->pos[1]; } if (temp_v1 == 0) { var_t1 = 0; var_t0 = 0; - var_f2 = player->pos[1]; + y = player->pos[1]; } if (var_t0 == 0) { - if ((arg1 == 0) && - ((player->unk_258[0x1E + arg2].unk_01E > 0) || (player->unk_258[0x1E + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0, (s8) var_t1); - func_8005D7D8(&player->unk_258[0x1E + arg1], 3, 0.5f); - func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x0060); - player->unk_258[0x1E + arg1].unk_020 = 0; - if (player->unk_258[0x1E + arg1].unk_010 == 1) { - player->unk_258[0x1E + arg1].unk_020 += 0x888; + if ((arg1 == 0) && ((player->particlePool3[arg2].timer > 0) || (player->particlePool3[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool3[arg1], 0.0f, y, 0.0f, (s8) var_t0, + (s8) var_t1); + init_particle_player(&player->particlePool3[arg1], 3, 0.5f); + set_particle_colour(&player->particlePool3[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x0060); + player->particlePool3[arg1].rotation = 0; + if (player->particlePool3[arg1].unk_010 == 1) { + player->particlePool3[arg1].rotation += 0x888; } else { - player->unk_258[0x1E + arg1].unk_020 -= 0x888; + player->particlePool3[arg1].rotation -= 0x888; } - player->unk_258[0x1E + arg1].unk_000[2] = + player->particlePool3[arg1].pos[2] = player->pos[2] + - (coss(player->unk_258[0x1E + arg1].unk_020 - player->rotation[1] - player->unk_0C0) * 5.0f); - player->unk_258[0x1E + arg1].unk_000[0] = + (coss(player->particlePool3[arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f); + player->particlePool3[arg1].pos[0] = player->pos[0] + - (sins(player->unk_258[0x1E + arg1].unk_020 - player->rotation[1] - player->unk_0C0) * 5.0f); - } else if (player->unk_258[0x1E + arg2].unk_01E > 0) { - func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0, (s8) var_t1); - func_8005D7D8(&player->unk_258[0x1E + arg1], 3, 0.5f); - func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x0060); - player->unk_258[0x1E + arg1].unk_020 = 0; - if (player->unk_258[0x1E + arg1].unk_010 == 1) { - player->unk_258[0x1E + arg1].unk_020 += 0x888; + (sins(player->particlePool3[arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f); + } else if (player->particlePool3[arg2].timer > 0) { + set_particle_position_and_rotation(player, &player->particlePool3[arg1], 0.0f, y, 0.0f, (s8) var_t0, + (s8) var_t1); + init_particle_player(&player->particlePool3[arg1], 3, 0.5f); + set_particle_colour(&player->particlePool3[arg1], RGB32(0xFF, 0xFF, 0xFF), 0x0060); + player->particlePool3[arg1].rotation = 0; + if (player->particlePool3[arg1].unk_010 == 1) { + player->particlePool3[arg1].rotation += 0x888; } else { - player->unk_258[0x1E + arg1].unk_020 -= 0x888; + player->particlePool3[arg1].rotation -= 0x888; } - player->unk_258[0x1E + arg1].unk_000[2] = + player->particlePool3[arg1].pos[2] = player->pos[2] + - (coss(player->unk_258[0x1E + arg1].unk_020 - player->rotation[1] - player->unk_0C0) * 5.0f); - player->unk_258[0x1E + arg1].unk_000[0] = + (coss(player->particlePool3[arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f); + player->particlePool3[arg1].pos[0] = player->pos[0] + - (sins(player->unk_258[0x1E + arg1].unk_020 - player->rotation[1] - player->unk_0C0) * 5.0f); + (sins(player->particlePool3[arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f); } } } @@ -3966,7 +3970,7 @@ void func_800621BC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 s32 phi_t0; s32 phi_t1; Player* new_var; - f32 phi_f2; + f32 y; Player* new_var2; phi_t0 = 0xFF; @@ -3974,7 +3978,7 @@ void func_800621BC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 if (temp_v1 == 1) { phi_t1 = 1; phi_t0 = 0; - phi_f2 = player->pos[1]; + y = player->pos[1]; } if (temp_v1 == 0) { @@ -3982,62 +3986,62 @@ void func_800621BC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 if (1) { phi_t0 = 0; } - phi_f2 = player->pos[1]; + y = player->pos[1]; } if (phi_t0 == 0) { - if ((arg1 == 0) && ((player->unk_258[30 + arg2].unk_01E > 0) || (player->unk_258[30 + arg2].unk_01C == 0))) { - func_8005D794(player, &player->unk_258[30 + arg1], 0.0f, phi_f2, 0.0f, phi_t0, phi_t1); - func_8005D7D8(&player->unk_258[30 + arg1], 8, 1.0f); - func_8005D800(&player->unk_258[30 + arg1], 0xFFFF20, 0xFF); - - player->unk_258[30 + arg1].unk_020 = 0; - if (player->unk_258[30 + arg1].unk_010 == 1) { - player->unk_258[30 + arg1].unk_020 += 2184; + if ((arg1 == 0) && ((player->particlePool3[arg2].timer > 0) || (player->particlePool3[arg2].isAlive == 0))) { + set_particle_position_and_rotation(player, &player->particlePool3[arg1], 0.0f, y, 0.0f, phi_t0, phi_t1); + init_particle_player(&player->particlePool3[arg1], 8, 1.0f); + set_particle_colour(&player->particlePool3[arg1], RGB32(0xFF, 0xFF, 0x20), 0xFF); + + player->particlePool3[arg1].rotation = 0; + if (player->particlePool3[arg1].unk_010 == 1) { + player->particlePool3[arg1].rotation += 2184; } else { - player->unk_258[30 + arg1].unk_020 -= 2184; + player->particlePool3[arg1].rotation -= 2184; } - player->unk_258[30 + arg1].unk_000[2] = + player->particlePool3[arg1].pos[2] = player->pos[2] + - (coss((player->unk_258[30 + arg1].unk_020 - player->rotation[1]) - player->unk_0C0) * 5.0f); - player->unk_258[30 + arg1].unk_000[0] = + (coss((player->particlePool3[arg1].rotation - player->rotation[1]) - player->unk_0C0) * 5.0f); + player->particlePool3[arg1].pos[0] = player->pos[0] + - (sins((player->unk_258[30 + arg1].unk_020 - player->rotation[1]) - player->unk_0C0) * 5.0f); + (sins((player->particlePool3[arg1].rotation - player->rotation[1]) - player->unk_0C0) * 5.0f); return; } new_var2 = player; - if (new_var2->unk_258[30 + arg2].unk_01E > 0) { - func_8005D794(new_var2, &new_var2->unk_258[30 + arg1], 0.0f, phi_f2, 0.0f, phi_t0, phi_t1); - func_8005D7D8(&new_var2->unk_258[30 + arg1], 8, 1.0f); - func_8005D800(&new_var2->unk_258[30 + arg1], 0xFFFF20, 0xFF); - new_var2->unk_258[30 + arg1].unk_020 = 0; - if (new_var2->unk_258[30 + arg1].unk_010 == 1) { - new_var2->unk_258[30 + arg1].unk_020 += 2184; + if (new_var2->particlePool3[arg2].timer > 0) { + set_particle_position_and_rotation(new_var2, &new_var2->particlePool3[arg1], 0.0f, y, 0.0f, phi_t0, phi_t1); + init_particle_player(&new_var2->particlePool3[arg1], 8, 1.0f); + set_particle_colour(&new_var2->particlePool3[arg1], RGB32(0xFF, 0xFF, 0x20), 0xFF); + new_var2->particlePool3[arg1].rotation = 0; + if (new_var2->particlePool3[arg1].unk_010 == 1) { + new_var2->particlePool3[arg1].rotation += 2184; } else { - new_var2->unk_258[30 + arg1].unk_020 -= 2184; + new_var2->particlePool3[arg1].rotation -= 2184; } new_var = new_var2; - new_var->unk_258[30 + arg1].unk_000[2] = + new_var->particlePool3[arg1].pos[2] = new_var->pos[2] + - (coss((new_var->unk_258[30 + arg1].unk_020 - new_var->rotation[1]) - new_var->unk_0C0) * 5.0f); - new_var->unk_258[30 + arg1].unk_000[0] = + (coss((new_var->particlePool3[arg1].rotation - new_var->rotation[1]) - new_var->unk_0C0) * 5.0f); + new_var->particlePool3[arg1].pos[0] = new_var->pos[0] + - (sins((new_var->unk_258[30 + arg1].unk_020 - new_var->rotation[1]) - new_var->unk_0C0) * 5.0f); + (sins((new_var->particlePool3[arg1].rotation - new_var->rotation[1]) - new_var->unk_0C0) * 5.0f); } } } -void func_80062484(Player* player, UnkPlayerStruct258* arg1, s32 arg2) { - arg1->unk_01C = 1; - arg1->unk_000[1] = player->unk_074 + 1.0f; - arg1->unk_000[2] = player->pos[2]; - arg1->unk_000[0] = player->pos[0]; - arg1->unk_020 = (arg2 * 0x1998) - player->rotation[1]; - arg1->unk_012 = 4; - arg1->unk_01E = 0; +void func_80062484(Player* player, Particle* arg1, s32 arg2) { + arg1->isAlive = 1; + arg1->pos[1] = player->unk_074 + 1.0f; + arg1->pos[2] = player->pos[2]; + arg1->pos[0] = player->pos[0]; + arg1->rotation = (arg2 * 0x1998) - player->rotation[1]; + arg1->type = 4; + arg1->timer = 0; } void func_800624D8(Player* player, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { @@ -4047,140 +4051,140 @@ void func_800624D8(Player* player, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s8 a case DIRT: for (var_s1 = 0; var_s1 < 10; var_s1++) { if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 1, 0, 0x00A8); + func_8005DAD8(&player->particlePool3[var_s1], 1, 0, 0x00A8); } if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 7, 0, 0x00A8); + func_8005DAD8(&player->particlePool3[var_s1], 7, 0, 0x00A8); } if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 8, 0, 0x00A8); + func_8005DAD8(&player->particlePool3[var_s1], 8, 0, 0x00A8); } if (gCurrentCourseId == COURSE_WARIO_STADIUM) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 9, 0, 0x00A8); + func_8005DAD8(&player->particlePool3[var_s1], 9, 0, 0x00A8); } if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 0x000A, 0, 0x00A8); + func_8005DAD8(&player->particlePool3[var_s1], 0x000A, 0, 0x00A8); } if (gCurrentCourseId == COURSE_DK_JUNGLE) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 0x000B, 0, 0x00A8); + func_8005DAD8(&player->particlePool3[var_s1], 0x000B, 0, 0x00A8); } - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case GRASS: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 2, 1, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 2, 1, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case SAND_OFFROAD: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 2, 1, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 2, 1, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case SAND: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 3, 1, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 3, 1, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case WET_SAND: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 4, 1, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 4, 1, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case DIRT_OFFROAD: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 5, 1, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 5, 1, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case SNOW: case SNOW_OFFROAD: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 6, 1, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 6, 1, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; case ASPHALT: case STONE: case BRIDGE: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 0, 0, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 0, 0, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; default: for (var_s1 = 0; var_s1 < 10; var_s1++) { - func_8005DAD8(&player->unk_258[0x1E + var_s1], 0, 0, 0x00A8); - func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + func_8005DAD8(&player->particlePool3[var_s1], 0, 0, 0x00A8); + func_80062484(player, &player->particlePool3[var_s1], var_s1); } - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; break; } } -void func_800628C0(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_01C = 1; - player->unk_258[20 + arg3].unk_020 = -player->rotation[1]; - player->unk_258[20 + arg3].unk_012 = 2; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = 0.2f; +void func_800628C0(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].isAlive = 1; + player->particlePool2[index].rotation = -player->rotation[1]; + player->particlePool2[index].type = 2; + player->particlePool2[index].timer = 0; + player->particlePool2[index].scale = 0.2f; } -void func_80062914(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_01C = 1; - player->unk_258[20 + arg3].unk_020 = -player->rotation[1]; - player->unk_258[20 + arg3].unk_012 = 4; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = 1.0f; +void func_80062914(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].isAlive = 1; + player->particlePool2[index].rotation = -player->rotation[1]; + player->particlePool2[index].type = 4; + player->particlePool2[index].timer = 0; + player->particlePool2[index].scale = 1.0f; } -void func_80062968(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_01C = 1; - player->unk_258[20 + arg3].unk_020 = -player->rotation[1]; - player->unk_258[20 + arg3].unk_012 = 5; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = 0.2f; +void func_80062968(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].isAlive = 1; + player->particlePool2[index].rotation = -player->rotation[1]; + player->particlePool2[index].type = 5; + player->particlePool2[index].timer = 0; + player->particlePool2[index].scale = 0.2f; } -void func_800629BC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_01C = 1; - player->unk_258[20 + arg3].unk_020 = -player->rotation[1]; - player->unk_258[20 + arg3].unk_012 = 6; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = 0.2f; - player->unk_258[20 + arg3].unk_000[1] = 0.0f; +void func_800629BC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].isAlive = 1; + player->particlePool2[index].rotation = -player->rotation[1]; + player->particlePool2[index].type = 6; + player->particlePool2[index].timer = 0; + player->particlePool2[index].scale = 0.2f; + player->particlePool2[index].pos[1] = 0.0f; } -void func_80062A18(Player* player, s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_01C = 1; - player->unk_258[20 + arg3].unk_012 = 3; - player->unk_258[20 + arg1 /* arg1 instead of arg3 */].unk_00C = 0.2f; - player->unk_258[20 + arg3].unk_01E = 1; - player->unk_258[20 + arg3].unk_020 = 0; - player->unk_0B6 &= ~0x0080; - player->unk_258[20 + arg3].unk_000[2] = player->pos[2]; - player->unk_258[20 + arg3].unk_000[0] = player->pos[0]; - player->unk_258[20 + arg3].unk_000[1] = (player->pos[1] + 4.0f); +void func_80062A18(Player* player, s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].isAlive = 1; + player->particlePool2[index].type = 3; + player->particlePool2[arg1 /* arg1 instead of index */].scale = 0.2f; + player->particlePool2[index].timer = 1; + player->particlePool2[index].rotation = 0; + player->kartGraphics &= ~WHIRRR; + player->particlePool2[index].pos[2] = player->pos[2]; + player->particlePool2[index].pos[0] = player->pos[0]; + player->particlePool2[index].pos[1] = (player->pos[1] + 4.0f); } -void func_80062AA8(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_01C = 1; - player->unk_258[20 + arg3].unk_012 = 5; - player->unk_258[20 + arg3].unk_00C = 0.1f; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_000[1] = (player->pos[1] + player->boundingBoxSize) - 2.5; +void func_80062AA8(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].isAlive = 1; + player->particlePool2[index].type = 5; + player->particlePool2[index].scale = 0.1f; + player->particlePool2[index].timer = 0; + player->particlePool2[index].pos[1] = (player->pos[1] + player->boundingBoxSize) - 2.5; } void func_80062B18(f32* arg0, f32* arg1, f32* arg2, f32 arg3, f32 arg4, f32 arg5, u16 arg6, u16 arg7) { @@ -4227,178 +4231,178 @@ void func_80062C74(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3) { f32 sp38; s16 thing; - player->unk_258[arg1].unk_01E += 1; - if (player->unk_258[arg1].unk_01E == 0x000C) { - player->unk_258[arg1].unk_01C = 0; - player->unk_258[arg1].unk_01E = 0; - player->unk_258[arg1].unk_012 = 0; + player->particlePool0[arg1].timer++; + if (player->particlePool0[arg1].timer == 0x000C) { + player->particlePool0[arg1].isAlive = 0; + player->particlePool0[arg1].timer = 0; + player->particlePool0[arg1].type = NO_PARTICLE; } - player->unk_258[arg1].unk_018 = 2.0f; - if (player->unk_258[arg1].unk_040 == 0) { - player->unk_258[arg1].unk_00C = player->unk_258[arg1].unk_00C + 0.07; - player->unk_258[arg1].unk_024 = player->unk_258[arg1].unk_024 + 0.3; - if (player->unk_258[arg1].unk_01E >= 3) { - player->unk_258[arg1].unk_03E -= 3; + player->particlePool0[arg1].unk_018 = 2.0f; + if (player->particlePool0[arg1].unk_040 == 0) { + player->particlePool0[arg1].scale = player->particlePool0[arg1].scale + 0.07; + player->particlePool0[arg1].unk_024 = player->particlePool0[arg1].unk_024 + 0.3; + if (player->particlePool0[arg1].timer >= 3) { + player->particlePool0[arg1].alpha -= 3; } - if (player->unk_258[arg1].unk_03E <= 0) { - player->unk_258[arg1].unk_03E = 0; + if (player->particlePool0[arg1].alpha <= 0) { + player->particlePool0[arg1].alpha = 0; } } else { - player->unk_258[arg1].unk_00C = player->unk_258[arg1].unk_00C + 0.1; - player->unk_258[arg1].unk_024 = player->unk_258[arg1].unk_024 + 0.3; - if (player->unk_258[arg1].unk_01E >= 3) { - player->unk_258[arg1].unk_03E -= 2; + player->particlePool0[arg1].scale = player->particlePool0[arg1].scale + 0.1; + player->particlePool0[arg1].unk_024 = player->particlePool0[arg1].unk_024 + 0.3; + if (player->particlePool0[arg1].timer >= 3) { + player->particlePool0[arg1].alpha -= 2; } - if (player->unk_258[arg1].unk_03E <= 0) { - player->unk_258[arg1].unk_03E = 0; + if (player->particlePool0[arg1].alpha <= 0) { + player->particlePool0[arg1].alpha = 0; } } - thing = player->unk_258[arg1].unk_020 - (player->unk_0C0 / 2); - if (player->unk_258[arg1].unk_040 == 0) { + thing = player->particlePool0[arg1].rotation - (player->unk_0C0 / 2); + if (player->particlePool0[arg1].unk_040 == 0) { var_f6 = -((player->unk_098 / 5000.0f) + 0.1); } else { var_f6 = -((player->unk_098 / 6000.0f) + 0.1); } - if (((player->effects & BOOST_EFFECT) == BOOST_EFFECT) && (player->unk_258[arg1].unk_01E >= 6)) { - player->unk_258[arg1].unk_00C = player->unk_258[arg1].unk_00C + 0.06; + if (((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) && (player->particlePool0[arg1].timer >= 6)) { + player->particlePool0[arg1].scale = player->particlePool0[arg1].scale + 0.06; } - player->unk_258[arg1].unk_010++; - if (player->unk_258[arg1].unk_010 >= 3) { - player->unk_258[arg1].unk_010 = 0; + player->particlePool0[arg1].unk_010++; + if (player->particlePool0[arg1].unk_010 >= 3) { + player->particlePool0[arg1].unk_010 = 0; } - func_80062B18(&sp40, &sp38, &sp3C, 0.0f, sp48[player->characterId], (player->unk_258[arg1].unk_01E * var_f6) + -5.5, - -thing, -player->unk_206 * 2); - player->unk_258[arg1].unk_000[0] = player->pos[0] + sp40; + func_80062B18(&sp40, &sp38, &sp3C, 0.0f, sp48[player->characterId], + (player->particlePool0[arg1].timer * var_f6) + -5.5, -thing, -player->unk_206 * 2); + player->particlePool0[arg1].pos[0] = player->pos[0] + sp40; sp38 = (player->pos[1] - player->boundingBoxSize) + sp38; - player->unk_258[arg1].unk_000[2] = player->pos[2] + sp3C; - player->unk_258[arg1].unk_000[1] = player->unk_258[arg1].unk_024 + sp38; + player->particlePool0[arg1].pos[2] = player->pos[2] + sp3C; + player->particlePool0[arg1].pos[1] = player->particlePool0[arg1].unk_024 + sp38; } void func_80062F98(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { f32 temp_f0; - temp_f0 = player->unk_258[10 + arg1].unk_018 / 10.0f; - ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += temp_f0; - if ((player->unk_0CA & 1) == 1) { - player->unk_258[10 + arg1].unk_000[1] += (temp_f0 + 0.3); - if ((player->unk_258[10 + arg1].unk_01E == 0x10) || - ((D_801652A0[arg2] - player->unk_258[10 + arg1].unk_000[1]) < 3.0f)) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + temp_f0 = player->particlePool1[arg1].unk_018 / 10.0f; + ++player->particlePool1[arg1].timer; + player->particlePool1[arg1].pos[1] += temp_f0; + if ((player->lakituProps & LAKITU_RETRIEVAL) == LAKITU_RETRIEVAL) { + player->particlePool1[arg1].pos[1] += (temp_f0 + 0.3); + if ((player->particlePool1[arg1].timer == 0x10) || + ((D_801652A0[arg2] - player->particlePool1[arg1].pos[1]) < 3.0f)) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - } else if ((player->unk_258[10 + arg1].unk_01E == 0xA) || - ((D_801652A0[arg2] - player->unk_258[10 + arg1].unk_000[1]) < 3.0f)) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + } else if ((player->particlePool1[arg1].timer == 0xA) || + ((D_801652A0[arg2] - player->particlePool1[arg1].pos[1]) < 3.0f)) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } } -void func_800630C0(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { - ++player->unk_258[arg1].unk_01E; - player->unk_258[arg1].unk_000[2] = player->pos[2] + coss(player->unk_258[arg1].unk_020) * -5.8; - player->unk_258[arg1].unk_000[0] = player->pos[0] + sins(player->unk_258[arg1].unk_020) * -5.8; - player->unk_258[arg1].unk_000[1] = D_801652A0[arg2]; - if (player->unk_258[arg1].unk_01E == 15) { - player->unk_258[arg1].unk_01C = 0; - player->unk_258[arg1].unk_01E = 0; - player->unk_258[arg1].unk_012 = 0; +void set_oob_splash_particle_position(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { + ++player->particlePool0[arg1].timer; + player->particlePool0[arg1].pos[2] = player->pos[2] + coss(player->particlePool0[arg1].rotation) * -5.8; + player->particlePool0[arg1].pos[0] = player->pos[0] + sins(player->particlePool0[arg1].rotation) * -5.8; + player->particlePool0[arg1].pos[1] = D_801652A0[arg2]; + if (player->particlePool0[arg1].timer == 15) { + player->particlePool0[arg1].isAlive = 0; + player->particlePool0[arg1].timer = 0; + player->particlePool0[arg1].type = NO_PARTICLE; } } void func_800631A8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - ++player->unk_258[arg1].unk_01E; - if ((s32) player->unk_258[arg1].unk_01E < 9) { - if ((player->unk_258[arg1].unk_01E & 1) != 0) { - player->unk_258[arg1].unk_038 = 8; + ++player->particlePool0[arg1].timer; + if ((s32) player->particlePool0[arg1].timer < 9) { + if ((player->particlePool0[arg1].timer & 1) != 0) { + player->particlePool0[arg1].red = 8; } else { - player->unk_258[arg1].unk_038 = 0; + player->particlePool0[arg1].red = 0; } - } else if (((player->unk_258[arg1].unk_01E & 1) != 0) || - ((player->unk_258[arg1].unk_01E >= 9) && (player->unk_258[arg1].unk_01E < 12))) { - player->unk_258[arg1].unk_038 = 0xFF; - } else if ((player->unk_258[arg1].unk_01E & 2) != 0) { - player->unk_258[arg1].unk_038 = 8; + } else if (((player->particlePool0[arg1].timer & 1) != 0) || + ((player->particlePool0[arg1].timer >= 9) && (player->particlePool0[arg1].timer < 12))) { + player->particlePool0[arg1].red = 0xFF; + } else if ((player->particlePool0[arg1].timer & 2) != 0) { + player->particlePool0[arg1].red = 8; } else { - player->unk_258[arg1].unk_038 = 0; + player->particlePool0[arg1].red = 0; } - player->unk_258[arg1].unk_03A = 0; - player->unk_258[arg1].unk_03C = 0; - if ((s32) player->unk_258[arg1].unk_01E >= 0x19) { - player->unk_258[arg1].unk_01C = 0; - player->unk_258[arg1].unk_01E = 0; - player->unk_258[arg1].unk_012 = 0; + player->particlePool0[arg1].green = 0; + player->particlePool0[arg1].blue = 0; + if ((s32) player->particlePool0[arg1].timer >= 0x19) { + player->particlePool0[arg1].isAlive = 0; + player->particlePool0[arg1].timer = 0; + player->particlePool0[arg1].type = NO_PARTICLE; } } void func_80063268(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - if (player->unk_258[arg1].unk_01E >= 0x1E) { - player->unk_258[arg1].unk_040 += 0x1FFE; + if (player->particlePool0[arg1].timer >= 0x1E) { + player->particlePool0[arg1].unk_040 += 0x1FFE; } else { - player->unk_258[arg1].unk_040 += 0x1554; + player->particlePool0[arg1].unk_040 += 0x1554; } - player->unk_258[arg1].unk_024 += 0.25; - player->unk_258[arg1].unk_000[2] = - player->pos[2] + (coss((player->unk_258[arg1].unk_020 + player->unk_258[arg1].unk_040)) * 5.5); - player->unk_258[arg1].unk_000[0] = - player->pos[0] + (sins((player->unk_258[arg1].unk_020 + player->unk_258[arg1].unk_040)) * 5.5); - player->unk_258[arg1].unk_000[1] = ((player->pos[1] - 5.0f) + player->unk_258[arg1].unk_024); - ++player->unk_258[arg1].unk_01E; - player->unk_258[arg1].unk_00C += 0.05; - player->unk_258[arg1].unk_03E -= 5; + player->particlePool0[arg1].unk_024 += 0.25; + player->particlePool0[arg1].pos[2] = + player->pos[2] + (coss((player->particlePool0[arg1].rotation + player->particlePool0[arg1].unk_040)) * 5.5); + player->particlePool0[arg1].pos[0] = + player->pos[0] + (sins((player->particlePool0[arg1].rotation + player->particlePool0[arg1].unk_040)) * 5.5); + player->particlePool0[arg1].pos[1] = ((player->pos[1] - 5.0f) + player->particlePool0[arg1].unk_024); + ++player->particlePool0[arg1].timer; + player->particlePool0[arg1].scale += 0.05; + player->particlePool0[arg1].alpha -= 5; - if ((s32) player->unk_258[arg1].unk_03E <= 0) { - player->unk_258[arg1].unk_03E = 0; + if ((s32) player->particlePool0[arg1].alpha <= 0) { + player->particlePool0[arg1].alpha = 0; } - if ((s32) player->unk_258[arg1].unk_01E >= 0x28) { - player->unk_258[arg1].unk_01C = 0; - player->unk_258[arg1].unk_01E = 0; - player->unk_258[arg1].unk_012 = 0; + if ((s32) player->particlePool0[arg1].timer >= 0x28) { + player->particlePool0[arg1].isAlive = 0; + player->particlePool0[arg1].timer = 0; + player->particlePool0[arg1].type = NO_PARTICLE; } } void func_80063408(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - if (player->unk_258[10 + arg1].unk_010 == 1) { - player->unk_258[10 + arg1].unk_000[2] = + if (player->particlePool1[arg1].unk_010 == 1) { + player->particlePool1[arg1].pos[2] = player->tyres[BACK_LEFT].pos[2] + - (player->unk_258[10 + arg1].unk_01E * -7) * coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + (player->particlePool1[arg1].timer * -7) * coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_LEFT].pos[0] + - (player->unk_258[10 + arg1].unk_01E * -7) * sins(player->unk_258[10 + arg1].unk_020); + (player->particlePool1[arg1].timer * -7) * sins(player->particlePool1[arg1].rotation); } else { - player->unk_258[10 + arg1].unk_000[2] = + player->particlePool1[arg1].pos[2] = player->tyres[BACK_RIGHT].pos[2] + - (player->unk_258[10 + arg1].unk_01E * -7) * coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + (player->particlePool1[arg1].timer * -7) * coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_RIGHT].pos[0] + - (player->unk_258[10 + arg1].unk_01E * -7) * sins(player->unk_258[10 + arg1].unk_020); + (player->particlePool1[arg1].timer * -7) * sins(player->particlePool1[arg1].rotation); } - ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += 1.0f; + ++player->particlePool1[arg1].timer; + player->particlePool1[arg1].pos[1] += 1.0f; - if (((player->effects & 0x80) != 0) || ((player->effects & 0x40) != 0)) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; + if (((player->effects & BANANA_SPINOUT_EFFECT) != 0) || ((player->effects & DRIVING_SPINOUT_EFFECT) != 0)) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; } - if (player->unk_258[10 + arg1].unk_01E == 8) { - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_012 = 0; + if (player->particlePool1[arg1].timer == 8) { + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - player->unk_258[10 + arg1].unk_00C += 0.08; - if (player->unk_258[10 + arg1].unk_01E >= 4) { - player->unk_258[10 + arg1].unk_03E -= 16; + player->particlePool1[arg1].scale += 0.08; + if (player->particlePool1[arg1].timer >= 4) { + player->particlePool1[arg1].alpha -= 16; } - if (player->unk_258[10 + arg1].unk_03E <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + if (player->particlePool1[arg1].alpha <= 0) { + player->particlePool1[arg1].alpha = 0; } } @@ -4407,181 +4411,181 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { f32 sp40; f32 sp3C; - if (player->unk_258[10 + arg1].unk_010 == 1) { + if (player->particlePool1[arg1].unk_010 == 1) { if ((player->effects & LIGHTNING_EFFECT)) { func_80062B18(&sp44, &sp40, &sp3C, -2.0f, 0.0f, - (-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16, - -player->unk_258[10 + arg1].unk_020, 2 * -player->unk_206); - player->unk_258[10 + arg1].unk_000[0] = player->tyres[BACK_LEFT].pos[0] + sp44; - player->unk_258[10 + arg1].unk_000[2] = player->tyres[BACK_LEFT].pos[2] + sp3C; + (-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 16, + -player->particlePool1[arg1].rotation, 2 * -player->unk_206); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_LEFT].pos[0] + sp44; + player->particlePool1[arg1].pos[2] = player->tyres[BACK_LEFT].pos[2] + sp3C; } else { - player->unk_258[10 + arg1].unk_000[2] = + player->particlePool1[arg1].pos[2] = player->tyres[BACK_LEFT].pos[2] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * - coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 16) * + coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_LEFT].pos[0] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * - sins(player->unk_258[10 + arg1].unk_020); + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 16) * + sins(player->particlePool1[arg1].rotation); } } else if ((player->effects & LIGHTNING_EFFECT)) { func_80062B18(&sp44, &sp40, &sp3C, 2.0f, 0.0f, - (-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16, - -player->unk_258[10 + arg1].unk_020, 2 * -player->unk_206); - player->unk_258[10 + arg1].unk_000[0] = player->tyres[BACK_RIGHT].pos[0] + sp44; - player->unk_258[10 + arg1].unk_000[2] = player->tyres[BACK_RIGHT].pos[2] + sp3C; + (-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 16, + -player->particlePool1[arg1].rotation, 2 * -player->unk_206); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_RIGHT].pos[0] + sp44; + player->particlePool1[arg1].pos[2] = player->tyres[BACK_RIGHT].pos[2] + sp3C; } else { - player->unk_258[10 + arg1].unk_000[2] = + player->particlePool1[arg1].pos[2] = player->tyres[BACK_RIGHT].pos[2] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * - coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 16) * + coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_RIGHT].pos[0] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * - sins(player->unk_258[10 + arg1].unk_020); + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 16) * + sins(player->particlePool1[arg1].rotation); } - ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += 0.2; - if (((player->effects & 0x80) != 0) || ((player->effects & 0x40) != 0)) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; + ++player->particlePool1[arg1].timer; + player->particlePool1[arg1].pos[1] += 0.2; + if (((player->effects & BANANA_SPINOUT_EFFECT) != 0) || ((player->effects & DRIVING_SPINOUT_EFFECT) != 0)) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; } - if (player->unk_258[10 + arg1].unk_01E == 8) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + if (player->particlePool1[arg1].timer == 8) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - player->unk_258[10 + arg1].unk_00C += 0.1; - if (player->unk_258[10 + arg1].unk_040 == 0) { - if (player->unk_258[10 + arg1].unk_01E >= 4) { - player->unk_258[10 + arg1].unk_03E -= 12; + player->particlePool1[arg1].scale += 0.1; + if (player->particlePool1[arg1].unk_040 == 0) { + if (player->particlePool1[arg1].timer >= 4) { + player->particlePool1[arg1].alpha -= 12; } - if (player->unk_258[10 + arg1].unk_03E <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + if (player->particlePool1[arg1].alpha <= 0) { + player->particlePool1[arg1].alpha = 0; } } else { - if (player->unk_258[10 + arg1].unk_01E >= 4) { - player->unk_258[10 + arg1].unk_03E -= 16; + if (player->particlePool1[arg1].timer >= 4) { + player->particlePool1[arg1].alpha -= 16; } - if (player->unk_258[10 + arg1].unk_03E <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + if (player->particlePool1[arg1].alpha <= 0) { + player->particlePool1[arg1].alpha = 0; } } } void func_800639DC(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - if (player->unk_258[10 + arg1].unk_010 == 1) { - player->unk_258[10 + arg1].unk_000[2] = + if (player->particlePool1[arg1].unk_010 == 1) { + player->particlePool1[arg1].pos[2] = player->tyres[BACK_LEFT].pos[2] + - (-1.8f * player->unk_258[10 + arg1].unk_01E) * coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + (-1.8f * player->particlePool1[arg1].timer) * coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_LEFT].pos[0] + - (-1.8f * player->unk_258[10 + arg1].unk_01E) * sins(player->unk_258[10 + arg1].unk_020); + (-1.8f * player->particlePool1[arg1].timer) * sins(player->particlePool1[arg1].rotation); } else { - player->unk_258[10 + arg1].unk_000[2] = + player->particlePool1[arg1].pos[2] = player->tyres[BACK_RIGHT].pos[2] + - (-1.8f * player->unk_258[10 + arg1].unk_01E) * coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + (-1.8f * player->particlePool1[arg1].timer) * coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_RIGHT].pos[0] + - (-1.8f * player->unk_258[10 + arg1].unk_01E) * sins(player->unk_258[10 + arg1].unk_020); + (-1.8f * player->particlePool1[arg1].timer) * sins(player->particlePool1[arg1].rotation); } - ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += 0.3; - if (player->unk_258[10 + arg1].unk_01E == 8) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + ++player->particlePool1[arg1].timer; + player->particlePool1[arg1].pos[1] += 0.3; + if (player->particlePool1[arg1].timer == 8) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - player->unk_258[10 + arg1].unk_00C += 0.15; - if (player->unk_258[10 + arg1].unk_040 == 0) { - if ((s32) player->unk_258[10 + arg1].unk_01E >= 4) { - --player->unk_258[10 + arg1].unk_03E; + player->particlePool1[arg1].scale += 0.15; + if (player->particlePool1[arg1].unk_040 == 0) { + if ((s32) player->particlePool1[arg1].timer >= 4) { + --player->particlePool1[arg1].alpha; } - if ((s32) player->unk_258[10 + arg1].unk_03E <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + if ((s32) player->particlePool1[arg1].alpha <= 0) { + player->particlePool1[arg1].alpha = 0; } } else { - if ((s32) player->unk_258[10 + arg1].unk_01E >= 4) { - player->unk_258[10 + arg1].unk_03E -= 16; + if ((s32) player->particlePool1[arg1].timer >= 4) { + player->particlePool1[arg1].alpha -= 16; } - if ((s32) player->unk_258[10 + arg1].unk_03E <= 0) { + if ((s32) player->particlePool1[arg1].alpha <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + player->particlePool1[arg1].alpha = 0; } } } void func_80063BD4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - if (player->unk_258[10 + arg1].unk_010 == 1) { - player->unk_258[10 + arg1].unk_000[2] = + if (player->particlePool1[arg1].unk_010 == 1) { + player->particlePool1[arg1].pos[2] = player->tyres[BACK_LEFT].pos[2] + - (-2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020)); - player->unk_258[10 + arg1].unk_000[0] = + (-2 * player->particlePool1[arg1].timer * coss(player->particlePool1[arg1].rotation)); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_LEFT].pos[0] + - (-2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020)); + (-2 * player->particlePool1[arg1].timer * sins(player->particlePool1[arg1].rotation)); } else { - player->unk_258[10 + arg1].unk_000[2] = + player->particlePool1[arg1].pos[2] = player->tyres[BACK_RIGHT].pos[2] + - (-2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020)); - player->unk_258[10 + arg1].unk_000[0] = + (-2 * player->particlePool1[arg1].timer * coss(player->particlePool1[arg1].rotation)); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_RIGHT].pos[0] + - (-2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020)); + (-2 * player->particlePool1[arg1].timer * sins(player->particlePool1[arg1].rotation)); } - ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += 0.2; - if (player->unk_258[10 + arg1].unk_01E == 8) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + ++player->particlePool1[arg1].timer; + player->particlePool1[arg1].pos[1] += 0.2; + if (player->particlePool1[arg1].timer == 8) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - player->unk_258[10 + arg1].unk_018 = 2.0f; - player->unk_258[10 + arg1].unk_00C -= 0.06; + player->particlePool1[arg1].unk_018 = 2.0f; + player->particlePool1[arg1].scale -= 0.06; } void func_80063D58(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - if (player->unk_258[10 + arg1].unk_010 == 1) { - player->unk_258[10 + arg1].unk_000[2] = + if (player->particlePool1[arg1].unk_010 == 1) { + player->particlePool1[arg1].pos[2] = player->tyres[BACK_LEFT].pos[2] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * - coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 20.0f) * + coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_LEFT].pos[0] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * - sins(player->unk_258[10 + arg1].unk_020); + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 20.0f) * + sins(player->particlePool1[arg1].rotation); } else { - player->unk_258[10 + arg1].unk_000[2] = + player->particlePool1[arg1].pos[2] = player->tyres[BACK_RIGHT].pos[2] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * - coss(player->unk_258[10 + arg1].unk_020); - player->unk_258[10 + arg1].unk_000[0] = + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 20.0f) * + coss(player->particlePool1[arg1].rotation); + player->particlePool1[arg1].pos[0] = player->tyres[BACK_RIGHT].pos[0] + - ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * - sins(player->unk_258[10 + arg1].unk_020); + ((-player->particlePool1[arg1].timer * (player->speed / 18.0f) * 216.0f) / 20.0f) * + sins(player->particlePool1[arg1].rotation); } - ++player->unk_258[10 + arg1].unk_01E; - if (player->unk_258[10 + arg1].unk_01E == 8) { - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_012 = 0; + ++player->particlePool1[arg1].timer; + if (player->particlePool1[arg1].timer == 8) { + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - player->unk_258[10 + arg1].unk_00C += 0.2; - if (player->unk_258[10 + arg1].unk_01E >= 4) { - player->unk_258[10 + arg1].unk_03E -= 18; - player->unk_258[10 + arg1].unk_000[1] -= 0.1; + player->particlePool1[arg1].scale += 0.2; + if (player->particlePool1[arg1].timer >= 4) { + player->particlePool1[arg1].alpha -= 18; + player->particlePool1[arg1].pos[1] -= 0.1; } else { - player->unk_258[10 + arg1].unk_000[1] += 0.4; + player->particlePool1[arg1].pos[1] += 0.4; } - if (player->unk_258[10 + arg1].unk_03E <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + if (player->particlePool1[arg1].alpha <= 0) { + player->particlePool1[arg1].alpha = 0; } } @@ -4590,23 +4594,23 @@ void func_80063FBC(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3) { f32 sp38; f32 sp34; - if (player->unk_258[10 + arg1].unk_010 == 1) { + if (player->particlePool1[arg1].unk_010 == 1) { func_80062B18(&sp3C, &sp34, &sp38, 3.0f, 0.0f, - -5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->unk_094 / 18.0f) * 216.0f) / 15.0f)), - -player->unk_258[10 + arg1].unk_020, 0); + -5.5 - (player->particlePool1[arg1].timer * (((player->speed / 18.0f) * 216.0f) / 15.0f)), + -player->particlePool1[arg1].rotation, 0); } else { func_80062B18(&sp3C, &sp34, &sp38, -3.0f, 0.0f, - -5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->unk_094 / 18.0f) * 216.0f) / 15.0f)), - -player->unk_258[10 + arg1].unk_020, 0); + -5.5 - (player->particlePool1[arg1].timer * (((player->speed / 18.0f) * 216.0f) / 15.0f)), + -player->particlePool1[arg1].rotation, 0); } - player->unk_258[10 + arg1].unk_000[0] = player->pos[0] + sp3C; - player->unk_258[10 + arg1].unk_000[2] = player->pos[2] + sp38; - player->unk_258[10 + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp34; - player->unk_258[10 + arg1].unk_01E++; - if (player->unk_258[10 + arg1].unk_01E == 6) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + player->particlePool1[arg1].pos[0] = player->pos[0] + sp3C; + player->particlePool1[arg1].pos[2] = player->pos[2] + sp38; + player->particlePool1[arg1].pos[1] = (player->pos[1] - player->boundingBoxSize) + sp34; + player->particlePool1[arg1].timer++; + if (player->particlePool1[arg1].timer == 6) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } } @@ -4616,52 +4620,52 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { f32 sp3C; sp40 = D_801652A0[arg2] - player->pos[1] - 3.0f; - if (((player->unk_0DE & 1) != 0) && (gCurrentCourseId != COURSE_KOOPA_BEACH)) { + if (((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) != 0) && (gCurrentCourseId != COURSE_KOOPA_BEACH)) { sp40 = D_801652A0[arg2] - player->pos[1] + 0.1; } func_80062B18(&sp44, &sp40, &sp3C, 0.0f, sp40, - -4.0f + ((-player->unk_258[arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 10.0f), - -player->unk_258[arg1].unk_020, 2 * -player->unk_206); - player->unk_258[arg1].unk_000[0] = player->pos[0] + sp44; - player->unk_258[arg1].unk_000[2] = player->pos[2] + sp3C; - player->unk_258[arg1].unk_000[1] = player->pos[1] + sp40; - ++player->unk_258[arg1].unk_01E; - if ((player->unk_258[arg1].unk_01E == 12) || (D_801652A0[arg2] <= (player->pos[1] - player->boundingBoxSize))) { - player->unk_258[arg1].unk_01C = 0; - player->unk_258[arg1].unk_01E = 0; - player->unk_258[arg1].unk_012 = 0; + -4.0f + ((-player->particlePool0[arg1].timer * (player->speed / 18.0f) * 216.0f) / 10.0f), + -player->particlePool0[arg1].rotation, 2 * -player->unk_206); + player->particlePool0[arg1].pos[0] = player->pos[0] + sp44; + player->particlePool0[arg1].pos[2] = player->pos[2] + sp3C; + player->particlePool0[arg1].pos[1] = player->pos[1] + sp40; + ++player->particlePool0[arg1].timer; + if ((player->particlePool0[arg1].timer == 12) || (D_801652A0[arg2] <= (player->pos[1] - player->boundingBoxSize))) { + player->particlePool0[arg1].isAlive = 0; + player->particlePool0[arg1].timer = 0; + player->particlePool0[arg1].type = NO_PARTICLE; } - player->unk_258[arg1].unk_018 = 2.0f; - player->unk_258[arg1].unk_00C -= 0.35; - if (player->unk_258[arg1].unk_00C < 0.0f) { - player->unk_258[arg1].unk_00C = 0.0f; + player->particlePool0[arg1].unk_018 = 2.0f; + player->particlePool0[arg1].scale -= 0.35; + if (player->particlePool0[arg1].scale < 0.0f) { + player->particlePool0[arg1].scale = 0.0f; } - player->unk_258[arg1].unk_03E -= 22; - if (player->unk_258[arg1].unk_03E <= 0) { - player->unk_258[arg1].unk_03E = 0; + player->particlePool0[arg1].alpha -= 22; + if (player->particlePool0[arg1].alpha <= 0) { + player->particlePool0[arg1].alpha = 0; } } void func_800643A8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - player->unk_258[10 + arg1].unk_000[2] = - player->pos[2] + (-1.2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020)); - player->unk_258[10 + arg1].unk_000[0] = - player->pos[0] + (-1.2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020)); - player->unk_258[10 + arg1].unk_000[1] = player->unk_258[10 + arg1].unk_000[1] + 0.5; + player->particlePool1[arg1].pos[2] = + player->pos[2] + (-1.2 * player->particlePool1[arg1].timer * coss(player->particlePool1[arg1].rotation)); + player->particlePool1[arg1].pos[0] = + player->pos[0] + (-1.2 * player->particlePool1[arg1].timer * sins(player->particlePool1[arg1].rotation)); + player->particlePool1[arg1].pos[1] = player->particlePool1[arg1].pos[1] + 0.5; - ++player->unk_258[10 + arg1].unk_01E; - if (player->unk_258[10 + arg1].unk_01E == 10) { - player->unk_258[10 + arg1].unk_01C = 0; - player->unk_258[10 + arg1].unk_01E = 0; - player->unk_258[10 + arg1].unk_012 = 0; + ++player->particlePool1[arg1].timer; + if (player->particlePool1[arg1].timer == 10) { + player->particlePool1[arg1].isAlive = 0; + player->particlePool1[arg1].timer = 0; + player->particlePool1[arg1].type = NO_PARTICLE; } - player->unk_258[10 + arg1].unk_00C += 0.2; - player->unk_258[10 + arg1].unk_03E -= 8; - if (player->unk_258[10 + arg1].unk_03E <= 0) { - player->unk_258[10 + arg1].unk_03E = 0; + player->particlePool1[arg1].scale += 0.2; + player->particlePool1[arg1].alpha -= 8; + if (player->particlePool1[arg1].alpha <= 0) { + player->particlePool1[arg1].alpha = 0; } } @@ -4671,27 +4675,25 @@ void func_800644E8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { s32 thing; UNUSED s32 stackPadding1; - if (player->unk_258[30 + arg1].unk_01E >= 9) { - player->unk_258[30 + arg1].unk_01E = 9; + if (player->particlePool3[arg1].timer >= 9) { + player->particlePool3[arg1].timer = 9; } - thing2 = player->unk_258[30 + arg1].unk_024; - thing = player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_000[2] = - player->pos[2] + (coss(player->unk_258[30 + arg1].unk_020) * (-0.7 * thing)); - player->unk_258[30 + arg1].unk_000[0] = - player->pos[0] + (sins(player->unk_258[30 + arg1].unk_020) * (-0.7 * thing)); - player->unk_258[30 + arg1].unk_01E++; - player->unk_258[30 + arg1].unk_000[1] = - player->unk_258[30 + arg1].unk_028 + (f32) ((thing * thing2) - (0.2 * (thing * thing))); - if (player->unk_258[30 + arg1].unk_01E == 0x000A) { - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_012 = 0; + thing2 = player->particlePool3[arg1].unk_024; + thing = player->particlePool3[arg1].timer; + player->particlePool3[arg1].pos[2] = player->pos[2] + (coss(player->particlePool3[arg1].rotation) * (-0.7 * thing)); + player->particlePool3[arg1].pos[0] = player->pos[0] + (sins(player->particlePool3[arg1].rotation) * (-0.7 * thing)); + player->particlePool3[arg1].timer++; + player->particlePool3[arg1].pos[1] = + player->particlePool3[arg1].unk_028 + (f32) ((thing * thing2) - (0.2 * (thing * thing))); + if (player->particlePool3[arg1].timer == 0x000A) { + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } - if (player->unk_258[30 + arg1].unk_01E >= 7) { - player->unk_258[30 + arg1].unk_03E -= 0x60; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + if (player->particlePool3[arg1].timer >= 7) { + player->particlePool3[arg1].alpha -= 0x60; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } } } @@ -4702,277 +4704,278 @@ void func_80064664(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { s32 temp_v1; UNUSED s32 stackPadding1; - temp_v1 = player->unk_258[30 + arg1].unk_01E; - temp_f4 = player->unk_258[30 + arg1].unk_024; - player->unk_258[30 + arg1].unk_000[2] = - player->pos[2] + (coss(player->unk_258[30 + arg1].unk_020) * (-0.6 * temp_v1)); - player->unk_258[30 + arg1].unk_000[0] = - player->pos[0] + (sins(player->unk_258[30 + arg1].unk_020) * (-0.6 * temp_v1)); - player->unk_258[30 + arg1].unk_01E++; - player->unk_258[30 + arg1].unk_000[1] = - player->unk_258[30 + arg1].unk_028 + (f32) ((temp_v1 * temp_f4) - (0.1 * (temp_v1 * temp_v1))); - if (player->unk_258[30 + arg1].unk_01E == 0x0019) { - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_012 = 0; + temp_v1 = player->particlePool3[arg1].timer; + temp_f4 = player->particlePool3[arg1].unk_024; + player->particlePool3[arg1].pos[2] = + player->pos[2] + (coss(player->particlePool3[arg1].rotation) * (-0.6 * temp_v1)); + player->particlePool3[arg1].pos[0] = + player->pos[0] + (sins(player->particlePool3[arg1].rotation) * (-0.6 * temp_v1)); + player->particlePool3[arg1].timer++; + player->particlePool3[arg1].pos[1] = + player->particlePool3[arg1].unk_028 + (f32) ((temp_v1 * temp_f4) - (0.1 * (temp_v1 * temp_v1))); + if (player->particlePool3[arg1].timer == 0x0019) { + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } - if (player->unk_258[30 + arg1].unk_01E >= 7) { - player->unk_258[30 + arg1].unk_03E -= 0x6; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + if (player->particlePool3[arg1].timer >= 7) { + player->particlePool3[arg1].alpha -= 0x6; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } } } void func_800647C8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - ++player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_000[2] = - player->pos[2] + ((-0.8 * (player->unk_258[30 + arg1].unk_01E)) * coss(player->unk_258[30 + arg1].unk_020)); - player->unk_258[30 + arg1].unk_000[0] = - player->pos[0] + ((-0.8 * (player->unk_258[30 + arg1].unk_01E)) * sins(player->unk_258[30 + arg1].unk_020)); - player->unk_258[30 + arg1].unk_000[1] = (player->unk_074 + 2.0f); + ++player->particlePool3[arg1].timer; + player->particlePool3[arg1].pos[2] = + player->pos[2] + ((-0.8 * (player->particlePool3[arg1].timer)) * coss(player->particlePool3[arg1].rotation)); + player->particlePool3[arg1].pos[0] = + player->pos[0] + ((-0.8 * (player->particlePool3[arg1].timer)) * sins(player->particlePool3[arg1].rotation)); + player->particlePool3[arg1].pos[1] = (player->unk_074 + 2.0f); - if (player->unk_258[30 + arg1].unk_01E == 14) { - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_012 = 0; + if (player->particlePool3[arg1].timer == 14) { + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } - player->unk_258[30 + arg1].unk_03E -= 12; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + player->particlePool3[arg1].alpha -= 12; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } } void func_800648E4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - ++player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_00C -= 0.06; - player->unk_258[30 + arg1].unk_000[1] += 0.1; - player->unk_258[30 + arg1].unk_03E -= 12; + ++player->particlePool3[arg1].timer; + player->particlePool3[arg1].scale -= 0.06; + player->particlePool3[arg1].pos[1] += 0.1; + player->particlePool3[arg1].alpha -= 12; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } - if (player->unk_258[30 + arg1].unk_01E == 10) { - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_012 = 0; + if (player->particlePool3[arg1].timer == 10) { + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } } void func_80064988(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - ++player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_000[1] -= 0.3; + ++player->particlePool3[arg1].timer; + player->particlePool3[arg1].pos[1] -= 0.3; - if (player->unk_258[30 + arg1].unk_01E == 10) { - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_012 = 0; + if (player->particlePool3[arg1].timer == 10) { + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } } void func_800649F4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { f32 temp; - temp = player->unk_258[30 + arg1].unk_018; + temp = player->particlePool3[arg1].unk_018; - player->unk_258[30 + arg1].unk_000[2] = - player->unk_21C + (((-temp) * player->unk_258[30 + arg1].unk_01E) * coss(player->unk_258[30 + arg1].unk_020)); - player->unk_258[30 + arg1].unk_000[0] = - player->unk_218 + (((-temp) * player->unk_258[30 + arg1].unk_01E) * sins(player->unk_258[30 + arg1].unk_020)); - player->unk_258[30 + arg1].unk_000[1] = player->pos[1] + player->unk_258[30 + arg1].unk_014; - player->unk_258[30 + arg1].unk_00C += 0.04; + player->particlePool3[arg1].pos[2] = + player->unk_21C + (((-temp) * player->particlePool3[arg1].timer) * coss(player->particlePool3[arg1].rotation)); + player->particlePool3[arg1].pos[0] = + player->unk_218 + (((-temp) * player->particlePool3[arg1].timer) * sins(player->particlePool3[arg1].rotation)); + player->particlePool3[arg1].pos[1] = player->pos[1] + player->particlePool3[arg1].surfaceType; + player->particlePool3[arg1].scale += 0.04; - ++player->unk_258[30 + arg1].unk_01E; - if (player->unk_258[30 + arg1].unk_01E == 12) { - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_012 = 0; + ++player->particlePool3[arg1].timer; + if (player->particlePool3[arg1].timer == 12) { + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } - if (player->unk_258[30 + arg1].unk_01E >= 9) { - player->unk_258[30 + arg1].unk_03E -= 0x10; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + if (player->particlePool3[arg1].timer >= 9) { + player->particlePool3[arg1].alpha -= 0x10; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } } } void func_80064B30(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { f32 temp; - temp = player->unk_258[30 + arg1].unk_018 * 1.2; + temp = player->particlePool3[arg1].unk_018 * 1.2; - player->unk_258[30 + arg1].unk_000[2] = - (player->pos[2] + (-temp * player->unk_258[30 + arg1].unk_01E) * (coss(player->unk_258[30 + arg1].unk_020))); - player->unk_258[30 + arg1].unk_000[0] = - (player->pos[0] + (-temp * player->unk_258[30 + arg1].unk_01E) * (sins(player->unk_258[30 + arg1].unk_020))); - player->unk_258[30 + arg1].unk_000[1] += 0.1; + player->particlePool3[arg1].pos[2] = + (player->pos[2] + (-temp * player->particlePool3[arg1].timer) * (coss(player->particlePool3[arg1].rotation))); + player->particlePool3[arg1].pos[0] = + (player->pos[0] + (-temp * player->particlePool3[arg1].timer) * (sins(player->particlePool3[arg1].rotation))); + player->particlePool3[arg1].pos[1] += 0.1; - ++player->unk_258[30 + arg1].unk_01E; - if (player->unk_258[30 + arg1].unk_01E == 10) { - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_012 = 0; + ++player->particlePool3[arg1].timer; + if (player->particlePool3[arg1].timer == 10) { + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } - player->unk_258[30 + arg1].unk_038 += 1820; - if (player->unk_258[30 + arg1].unk_01E >= 6) { - player->unk_258[30 + arg1].unk_03E -= 16; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + player->particlePool3[arg1].red += 1820; + if (player->particlePool3[arg1].timer >= 6) { + player->particlePool3[arg1].alpha -= 16; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } } } void func_80064C74(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - if (player->unk_258[30 + arg1].unk_010 == 1) { - player->unk_258[30 + arg1].unk_020 += 2184; + if (player->particlePool3[arg1].unk_010 == 1) { + player->particlePool3[arg1].rotation += 2184; } else { - player->unk_258[30 + arg1].unk_020 -= 2184; + player->particlePool3[arg1].rotation -= 2184; } - player->unk_258[30 + arg1].unk_000[2] = - player->pos[2] + (coss(player->unk_258[30 + arg1].unk_020 - player->rotation[1] - player->unk_0C0) * 5.0f); - player->unk_258[30 + arg1].unk_000[0] = - player->pos[0] + (sins(player->unk_258[30 + arg1].unk_020 - player->rotation[1] - player->unk_0C0) * 5.0f); - player->unk_258[30 + arg1].unk_000[1] = player->pos[1] - 1.0f; - player->unk_258[30 + arg1].unk_00C += 0.4; - ++player->unk_258[30 + arg1].unk_01E; + player->particlePool3[arg1].pos[2] = + player->pos[2] + (coss(player->particlePool3[arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f); + player->particlePool3[arg1].pos[0] = + player->pos[0] + (sins(player->particlePool3[arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f); + player->particlePool3[arg1].pos[1] = player->pos[1] - 1.0f; + player->particlePool3[arg1].scale += 0.4; + ++player->particlePool3[arg1].timer; - if (player->unk_258[30 + arg1].unk_01E == 10) { - player->unk_258[30 + arg1].unk_01E = 0; - player->unk_258[30 + arg1].unk_01C = 0; - player->unk_258[30 + arg1].unk_012 = 0; + if (player->particlePool3[arg1].timer == 10) { + player->particlePool3[arg1].timer = 0; + player->particlePool3[arg1].isAlive = 0; + player->particlePool3[arg1].type = NO_PARTICLE; } - if (player->unk_258[30 + arg1].unk_01E >= 5) { - player->unk_258[30 + arg1].unk_03E -= 20; - if (player->unk_258[30 + arg1].unk_03E <= 0) { - player->unk_258[30 + arg1].unk_03E = 0; + if (player->particlePool3[arg1].timer >= 5) { + player->particlePool3[arg1].alpha -= 20; + if (player->particlePool3[arg1].alpha <= 0) { + player->particlePool3[arg1].alpha = 0; } } } -void func_80064DEC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { +void func_80064DEC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { - player->unk_258[20 + arg3].unk_000[1] = player->pos[1]; - ++player->unk_258[20 + arg3].unk_01E; + player->particlePool2[index].pos[1] = player->pos[1]; + ++player->particlePool2[index].timer; - if (player->unk_258[20 + arg3].unk_01E == 9) { - player->unk_0B6 &= ~0x0040; - player->unk_258[20 + arg3].unk_01C = 0; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_012 = 0; + if (player->particlePool2[index].timer == 9) { + player->kartGraphics &= ~CRASH; + player->particlePool2[index].isAlive = 0; + player->particlePool2[index].timer = 0; + player->particlePool2[index].type = NO_PARTICLE; } - player->unk_258[20 + arg3].unk_00C += 0.8; - if (player->unk_258[20 + arg3].unk_00C >= (f64) 2.5) { - player->unk_258[20 + arg3].unk_00C = 2.5f; + player->particlePool2[index].scale += 0.8; + if (player->particlePool2[index].scale >= (f64) 2.5) { + player->particlePool2[index].scale = 2.5f; } } -void func_80064EA4(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - ++player->unk_258[20 + arg3].unk_01E; - if (player->unk_258[20 + arg3].unk_01E < 4) { - player->unk_258[20 + arg3].unk_00C += 1.2; - if (player->unk_258[20 + arg3].unk_00C >= 3.5) { - player->unk_258[20 + arg3].unk_00C = 3.5f; +void func_80064EA4(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + ++player->particlePool2[index].timer; + if (player->particlePool2[index].timer < 4) { + player->particlePool2[index].scale += 1.2; + if (player->particlePool2[index].scale >= 3.5) { + player->particlePool2[index].scale = 3.5f; } } else { - player->unk_258[20 + arg3].unk_00C -= 1.8; - if (player->unk_258[20 + arg3].unk_00C <= 0.0f) { - player->unk_0B6 &= ~0x1000; - player->unk_258[20 + arg3].unk_01C = 0; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_012 = 0; + player->particlePool2[index].scale -= 1.8; + if (player->particlePool2[index].scale <= 0.0f) { + player->kartGraphics &= ~EXPLOSION; + player->particlePool2[index].isAlive = 0; + player->particlePool2[index].timer = 0; + player->particlePool2[index].type = NO_PARTICLE; } } } -void func_80064F88(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - ++player->unk_258[20 + arg3].unk_01E; - player->unk_258[20 + arg3].unk_00C += 0.15; +void func_80064F88(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + ++player->particlePool2[index].timer; + player->particlePool2[index].scale += 0.15; - if (1.2 <= player->unk_258[20 + arg3].unk_00C) { - player->unk_258[20 + arg3].unk_00C = 1.2f; + if (1.2 <= player->particlePool2[index].scale) { + player->particlePool2[index].scale = 1.2f; } - if (player->unk_258[20 + arg3].unk_01E >= 12) { - player->unk_0B6 &= ~0x0800; - player->unk_258[20 + arg3].unk_01C = 0; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_012 = 0; + if (player->particlePool2[index].timer >= 12) { + player->kartGraphics &= ~BOING; + player->particlePool2[index].isAlive = 0; + player->particlePool2[index].timer = 0; + player->particlePool2[index].type = NO_PARTICLE; } } -void func_80065030(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - ++player->unk_258[20 + arg3].unk_01E; +void func_80065030(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + ++player->particlePool2[index].timer; - player->unk_258[20 + arg3].unk_000[1] += 0.8; - player->unk_258[20 + arg3].unk_00C += 0.4; - if (player->unk_258[20 + arg3].unk_00C >= (f64) 1.5) { - player->unk_258[20 + arg3].unk_00C = 1.5f; + player->particlePool2[index].pos[1] += 0.8; + player->particlePool2[index].scale += 0.4; + if (player->particlePool2[index].scale >= (f64) 1.5) { + player->particlePool2[index].scale = 1.5f; } - if (player->unk_258[20 + arg3].unk_01E >= 12) { - player->unk_0B6 &= ~0x0100; - player->unk_258[20 + arg3].unk_01C = 0; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_012 = 0; + if (player->particlePool2[index].timer >= 12) { + player->kartGraphics &= ~POOMP; + player->particlePool2[index].isAlive = 0; + player->particlePool2[index].timer = 0; + player->particlePool2[index].type = NO_PARTICLE; } } -void func_800650FC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - player->unk_258[20 + arg3].unk_000[2] = (f32) player->pos[2]; - player->unk_258[20 + arg3].unk_000[0] = (f32) player->pos[0]; - player->unk_258[20 + arg3].unk_000[1] = (f32) (player->pos[1] + 4.0f); - if ((player->effects & 0x80) == 0x80) { - player->unk_258[20 + arg3].unk_020 += 4732; +void func_800650FC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + player->particlePool2[index].pos[2] = (f32) player->pos[2]; + player->particlePool2[index].pos[0] = (f32) player->pos[0]; + player->particlePool2[index].pos[1] = (f32) (player->pos[1] + 4.0f); + if ((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) { + player->particlePool2[index].rotation += 4732; } else { - player->unk_258[20 + arg3].unk_020 -= 4732; + player->particlePool2[index].rotation -= 4732; } - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40)) { - player->unk_258[20 + arg3].unk_01C = 0; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_012 = 0; + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && + ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT)) { + player->particlePool2[index].isAlive = 0; + player->particlePool2[index].timer = 0; + player->particlePool2[index].type = NO_PARTICLE; } - player->unk_258[20 + arg3].unk_00C += 0.08; - if (player->unk_258[20 + arg3].unk_00C >= 1.5) { - player->unk_258[20 + arg3].unk_00C = 1.5f; + player->particlePool2[index].scale += 0.08; + if (player->particlePool2[index].scale >= 1.5) { + player->particlePool2[index].scale = 1.5f; } } -void func_800651F4(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { - ++player->unk_258[20 + arg3].unk_01E; - if (player->unk_258[20 + arg3].unk_01E < 8) { - player->unk_258[20 + arg3].unk_00C += 0.2; - if (1.2 <= player->unk_258[20 + arg3].unk_00C) { - player->unk_258[20 + arg3].unk_00C = 1.2f; +void func_800651F4(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 index) { + ++player->particlePool2[index].timer; + if (player->particlePool2[index].timer < 8) { + player->particlePool2[index].scale += 0.2; + if (1.2 <= player->particlePool2[index].scale) { + player->particlePool2[index].scale = 1.2f; } } else { - player->unk_258[20 + arg3].unk_00C -= 0.4; - if (player->unk_258[20 + arg3].unk_00C <= 0.0f) { - player->unk_0B6 &= ~0x0020; - player->unk_258[20 + arg3].unk_01C = 0; - player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_012 = 0; + player->particlePool2[index].scale -= 0.4; + if (player->particlePool2[index].scale <= 0.0f) { + player->kartGraphics &= ~WHISTLE; + player->particlePool2[index].isAlive = 0; + player->particlePool2[index].timer = 0; + player->particlePool2[index].type = NO_PARTICLE; } } } -void func_800652D4(Vec3f arg0, Vec3s arg1, f32 arg2) { +void func_800652D4(Vec3f arg0, Vec3s arg1, f32 scale) { Mat4 sp20; mtxf_translate_rotate(sp20, arg0, arg1); - mtxf_scale2(sp20, arg2); + mtxf_scale2(sp20, scale); convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], sp20); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } -void func_8006538C(Player* player, s8 arg1, s16 arg2, s8 arg3) { +void func_8006538C(Player* player, s8 playerIndex, s16 arg2, s8 arg3) { Vec3f spB4; Vec3s spAC; s32 primColors[] = { MAKE_RGB(0xFB, 0xFF, 0xFB), MAKE_RGB(0xFF, 0xFB, 0x86) }; @@ -4985,40 +4988,41 @@ void func_8006538C(Player* player, s8 arg1, s16 arg2, s8 arg3) { s16 envGreen; s16 envBlue; - if (player->unk_258[arg2].unk_01C == 1) { - spB4[0] = player->unk_258[arg2].unk_000[0]; - spB4[1] = player->unk_258[arg2].unk_000[1]; - spB4[2] = player->unk_258[arg2].unk_000[2]; + if (player->particlePool0[arg2].isAlive == 1) { + spB4[0] = player->particlePool0[arg2].pos[0]; + spB4[1] = player->particlePool0[arg2].pos[1]; + spB4[2] = player->particlePool0[arg2].pos[2]; spAC[0] = 0; spAC[1] = player->unk_048[arg3]; spAC[2] = 0; - if ((player->effects & STAR_EFFECT) && (((s32) gCourseTimer - D_8018D930[arg1]) < 9)) { + if ((player->effects & STAR_EFFECT) && + (((s32) gCourseTimer - gPlayerStarEffectStartTime[playerIndex]) < STAR_EFFECT_DURATION - 1)) { primRed = (primColors[1] >> 0x10) & 0xFF; primGreen = (primColors[1] >> 0x08) & 0xFF; primBlue = (primColors[1] >> 0x00) & 0xFF; envRed = (envColors[1] >> 0x10) & 0xFF; envGreen = (envColors[1] >> 0x08) & 0xFF; envBlue = (envColors[1] >> 0x00) & 0xFF; - primAlpha = player->unk_258[arg2].unk_03E; - func_800652D4(spB4, spAC, ((player->unk_258[arg2].unk_00C * player->size) * 1.4)); + primAlpha = player->particlePool0[arg2].alpha; + func_800652D4(spB4, spAC, ((player->particlePool0[arg2].scale * player->size) * 1.4)); gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, common_texture_particle_smoke[player->unk_258[arg2].unk_010], + gDPLoadTextureBlock(gDisplayListHead++, common_texture_particle_smoke[player->particlePool0[arg2].unk_010], G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER); gSPDisplayList(gDisplayListHead++, D_0D008E48); } else { - primRed = (primColors[player->unk_258[arg2].unk_038] >> 0x10) & 0xFF; - primGreen = (primColors[player->unk_258[arg2].unk_038] >> 0x08) & 0xFF; - primBlue = (primColors[player->unk_258[arg2].unk_038] >> 0x00) & 0xFF; - envRed = (envColors[player->unk_258[arg2].unk_038] >> 0x10) & 0xFF; - envGreen = (envColors[player->unk_258[arg2].unk_038] >> 0x08) & 0xFF; - envBlue = (envColors[player->unk_258[arg2].unk_038] >> 0x00) & 0xFF; - primAlpha = player->unk_258[arg2].unk_03E; - func_800652D4(spB4, spAC, player->unk_258[arg2].unk_00C * player->size); + primRed = (primColors[player->particlePool0[arg2].red] >> 0x10) & 0xFF; + primGreen = (primColors[player->particlePool0[arg2].red] >> 0x08) & 0xFF; + primBlue = (primColors[player->particlePool0[arg2].red] >> 0x00) & 0xFF; + envRed = (envColors[player->particlePool0[arg2].red] >> 0x10) & 0xFF; + envGreen = (envColors[player->particlePool0[arg2].red] >> 0x08) & 0xFF; + envBlue = (envColors[player->particlePool0[arg2].red] >> 0x00) & 0xFF; + primAlpha = player->particlePool0[arg2].alpha; + func_800652D4(spB4, spAC, player->particlePool0[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, common_texture_particle_smoke[player->unk_258[arg2].unk_010], + gDPLoadTextureBlock(gDisplayListHead++, common_texture_particle_smoke[player->particlePool0[arg2].unk_010], G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); @@ -5028,7 +5032,7 @@ void func_8006538C(Player* player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_800658A0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { +void func_800658A0(Player* player, UNUSED s8 playerIndex, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; s16 red; @@ -5036,18 +5040,18 @@ void func_800658A0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 blue; s16 alpha; - if (player->unk_258[arg2].unk_01C == 1) { - red = player->unk_258[arg2].unk_038; - green = player->unk_258[arg2].unk_03A; - blue = player->unk_258[arg2].unk_03C; - alpha = player->unk_258[arg2].unk_03E; - sp54[0] = player->unk_258[arg2].unk_000[0]; - sp54[1] = player->unk_258[arg2].unk_000[1]; - sp54[2] = player->unk_258[arg2].unk_000[2]; + if (player->particlePool0[arg2].isAlive == 1) { + red = player->particlePool0[arg2].red; + green = player->particlePool0[arg2].green; + blue = player->particlePool0[arg2].blue; + alpha = player->particlePool0[arg2].alpha; + sp54[0] = player->particlePool0[arg2].pos[0]; + sp54[1] = player->particlePool0[arg2].pos[1]; + sp54[2] = player->particlePool0[arg2].pos[2]; sp4C[0] = 0; sp4C[1] = player->unk_048[arg3]; sp4C[2] = 0; - func_800652D4(sp54, sp4C, player->unk_258[arg2].unk_00C * player->size); + func_800652D4(sp54, sp4C, player->particlePool0[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -5058,10 +5062,7 @@ void func_800658A0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { } } -#ifdef NON_MATCHING -// Something about the handling of the prim/env colors is off, -// its causing a huge diff. Can't figure out what's up. -void func_80065AB0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { +void render_player_drift_particles(Player* player, UNUSED s8 playerIndex, s16 arg2, s8 arg3) { Vec3f spB4; Vec3s spAC; s32 var_s0; @@ -5073,29 +5074,29 @@ void func_80065AB0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 envGreen; s16 envBlue; s32 sp8C[] = { 0x00ffffff, 0x00ffff00, 0x00ff9600 }; - if (player->unk_258[10 + arg2].unk_01C == 1) { - if (player->unk_204 >= 0x32) { + if (player->particlePool1[arg2].isAlive == 1) { + if (player->driftDuration >= 0x32) { var_s0 = 1; } else { var_s0 = 0; } - primRed = player->unk_258[10 + arg2].unk_038; - primGreen = player->unk_258[10 + arg2].unk_03A; - primBlue = player->unk_258[10 + arg2].unk_03C; - primAlpha = player->unk_258[10 + arg2].unk_03E; - envRed = (sp8C[player->unk_258[10 + arg2].unk_040] >> 0x10) & 0xFF; - envGreen = (sp8C[player->unk_258[10 + arg2].unk_040] >> 0x08) & 0xFF; - envBlue = (sp8C[player->unk_258[10 + arg2].unk_040] >> 0x00) & 0xFF; - spB4[0] = player->unk_258[10 + arg2].unk_000[0]; - spB4[1] = player->unk_258[10 + arg2].unk_000[1]; - spB4[2] = player->unk_258[10 + arg2].unk_000[2]; + primRed = player->particlePool1[arg2].red; + primGreen = player->particlePool1[arg2].green; + primBlue = player->particlePool1[arg2].blue; + primAlpha = player->particlePool1[arg2].alpha; + envRed = (sp8C[player->particlePool1[arg2].unk_040] >> 0x10) & 0xFF; + envGreen = (sp8C[player->particlePool1[arg2].unk_040] >> 0x08) & 0xFF; + envBlue = (sp8C[player->particlePool1[arg2].unk_040] >> 0x00) & 0xFF; + spB4[0] = player->particlePool1[arg2].pos[0]; + spB4[1] = player->particlePool1[arg2].pos[1]; + spB4[2] = player->particlePool1[arg2].pos[2]; spAC[0] = 0; spAC[1] = player->unk_048[arg3]; spAC[2] = 0; - func_800652D4(spB4, spAC, player->unk_258[10 + arg2].unk_00C * player->size); + func_800652D4(spB4, spAC, player->particlePool1[arg2].scale * player->size); if (var_s0 == 0) { gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, D_800E4770[var_s0][0], G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, + gDPLoadTextureBlock(gDisplayListHead++, *D_800E4770[var_s0], G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); @@ -5103,7 +5104,7 @@ void func_80065AB0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { gSPDisplayList(gDisplayListHead++, D_0D008DF8); } else { gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, D_800E4770[var_s0][0], G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, *D_800E4770[var_s0], G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); @@ -5113,56 +5114,49 @@ void func_80065AB0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { gMatrixEffectCount += 1; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065AB0.s") -#endif -#ifdef NON_MATCHING -// https://decomp.me/scratch/KEz08 -// Something is very wrong with the handling of prim/evn colors, but I can't figuer out what. -void func_80065F0C(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { - Vec3f spDC; +void render_player_ground_particles(Player* player, UNUSED s8 playerIndex, s16 arg2, s8 arg3) { + Vec3f pos; Vec3s spD4; s16 primRed; s16 primGreen; s16 primBlue; s16 primAlpha; - u8 envRed; + s16 envRed; s16 envGreen; s16 envBlue; - if ((player->unk_258[10 + arg2].unk_01C == 1) && (player->unk_258[10 + arg2].unk_01E != 0)) { - spDC[0] = player->unk_258[10 + arg2].unk_000[0]; - spDC[1] = player->unk_258[10 + arg2].unk_000[1]; - spDC[2] = player->unk_258[10 + arg2].unk_000[2]; + if ((player->particlePool1[arg2].isAlive == 1) && (player->particlePool1[arg2].timer != 0)) { + pos[0] = player->particlePool1[arg2].pos[0]; + pos[1] = player->particlePool1[arg2].pos[1]; + pos[2] = player->particlePool1[arg2].pos[2]; spD4[0] = 0; spD4[1] = player->unk_048[arg3]; spD4[2] = 0; - func_800652D4(spDC, spD4, player->unk_258[10 + arg2].unk_00C * player->size); - if ((s32) player->unk_258[10 + arg2].unk_014 != 8) { + func_800652D4(pos, spD4, player->particlePool1[arg2].scale * player->size); + if ((s32) player->particlePool1[arg2].surfaceType != GRASS) { primRed = - ((D_800E47DC[player->unk_258[10 + arg2].unk_038] >> 0x10) & 0xFF) - player->unk_258[10 + arg2].unk_03A; + ((D_800E47DC[player->particlePool1[arg2].red] >> 0x10) & 0xFF) - player->particlePool1[arg2].green; primGreen = - ((D_800E47DC[player->unk_258[10 + arg2].unk_038] >> 0x08) & 0xFF) - player->unk_258[10 + arg2].unk_03A; + ((D_800E47DC[player->particlePool1[arg2].red] >> 0x08) & 0xFF) - player->particlePool1[arg2].green; primBlue = - ((D_800E47DC[player->unk_258[10 + arg2].unk_038] >> 0x00) & 0xFF) - player->unk_258[10 + arg2].unk_03A; - envRed = - ((D_800E480C[player->unk_258[10 + arg2].unk_038] >> 0x10) & 0xFF) - player->unk_258[10 + arg2].unk_03A; + ((D_800E47DC[player->particlePool1[arg2].red] >> 0x00) & 0xFF) - player->particlePool1[arg2].green; + envRed = ((D_800E480C[player->particlePool1[arg2].red] >> 0x10) & 0xFF) - player->particlePool1[arg2].green; envGreen = - ((D_800E480C[player->unk_258[10 + arg2].unk_038] >> 0x08) & 0xFF) - player->unk_258[10 + arg2].unk_03A; + ((D_800E480C[player->particlePool1[arg2].red] >> 0x08) & 0xFF) - player->particlePool1[arg2].green; envBlue = - ((D_800E480C[player->unk_258[10 + arg2].unk_038] >> 0x00) & 0xFF) - player->unk_258[10 + arg2].unk_03A; - primAlpha = player->unk_258[10 + arg2].unk_03E; - if (player->unk_258[10 + arg2].unk_040 == 0) { + ((D_800E480C[player->particlePool1[arg2].red] >> 0x00) & 0xFF) - player->particlePool1[arg2].green; + primAlpha = player->particlePool1[arg2].alpha; + if (player->particlePool1[arg2].unk_040 == 0) { gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gLoadedGroundDust, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); } else { gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gLoadedGroundDust, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); @@ -5170,12 +5164,12 @@ void func_80065F0C(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { gSPDisplayList(gDisplayListHead++, D_0D008E48); } } else { - primRed = player->unk_258[10 + arg2].unk_038; - primGreen = player->unk_258[10 + arg2].unk_03A; - primBlue = player->unk_258[10 + arg2].unk_03C; + primRed = player->particlePool1[arg2].red; + primGreen = player->particlePool1[arg2].green; + primBlue = player->particlePool1[arg2].blue; gSPDisplayList(gDisplayListHead++, D_0D008C90); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D498, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gLoadedGrassParticle, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B35C(primRed, primGreen, primBlue, 0x000000FF); @@ -5186,11 +5180,8 @@ void func_80065F0C(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { gMatrixEffectCount += 1; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065F0C.s") -#endif -void func_800664E0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { +void func_800664E0(Player* player, UNUSED s8 playerIndex, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; s16 red; @@ -5198,18 +5189,18 @@ void func_800664E0(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 blue; s16 alpha; - if (player->unk_258[10 + arg2].unk_01C == 1) { - red = player->unk_258[10 + arg2].unk_038; - green = player->unk_258[10 + arg2].unk_03A; - blue = player->unk_258[10 + arg2].unk_03C; - alpha = player->unk_258[10 + arg2].unk_03E; - sp54[0] = player->unk_258[10 + arg2].unk_000[0]; - sp54[1] = player->unk_258[10 + arg2].unk_000[1]; - sp54[2] = player->unk_258[10 + arg2].unk_000[2]; + if (player->particlePool1[arg2].isAlive == 1) { + red = player->particlePool1[arg2].red; + green = player->particlePool1[arg2].green; + blue = player->particlePool1[arg2].blue; + alpha = player->particlePool1[arg2].alpha; + sp54[0] = player->particlePool1[arg2].pos[0]; + sp54[1] = player->particlePool1[arg2].pos[1]; + sp54[2] = player->particlePool1[arg2].pos[2]; sp4C[0] = 0; sp4C[1] = player->unk_048[arg3]; sp4C[2] = 0; - func_800652D4(sp54, sp4C, player->unk_258[10 + arg2].unk_00C * player->size); + func_800652D4(sp54, sp4C, player->particlePool1[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER); gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, @@ -5229,18 +5220,18 @@ void func_80066714(Player* player, UNUSED s32 arg1, s16 arg2, s8 arg3) { s16 blue; s16 alpha; - if (player->unk_258[10 + arg2].unk_01C == 1) { - red = player->unk_258[10 + arg2].unk_038; - green = player->unk_258[10 + arg2].unk_03A; - blue = player->unk_258[10 + arg2].unk_03C; - alpha = player->unk_258[10 + arg2].unk_03E; - sp5C[0] = player->unk_258[10 + arg2].unk_000[0]; - sp5C[1] = player->unk_258[10 + arg2].unk_000[1]; - sp5C[2] = player->unk_258[10 + arg2].unk_000[2]; + if (player->particlePool1[arg2].isAlive == 1) { + red = player->particlePool1[arg2].red; + green = player->particlePool1[arg2].green; + blue = player->particlePool1[arg2].blue; + alpha = player->particlePool1[arg2].alpha; + sp5C[0] = player->particlePool1[arg2].pos[0]; + sp5C[1] = player->particlePool1[arg2].pos[1]; + sp5C[2] = player->particlePool1[arg2].pos[2]; sp54[0] = 0; sp54[1] = player->unk_048[arg3]; sp54[2] = 0; - func_800652D4(sp5C, sp54, player->unk_258[10 + arg2].unk_00C * player->size); + func_800652D4(sp5C, sp54, player->particlePool1[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008C90); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gDPLoadTextureBlock(gDisplayListHead++, common_texture_particle_fire, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, @@ -5262,18 +5253,18 @@ void func_80066998(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 blue; s16 alpha; - if (player->unk_258[arg2].unk_01C == 1) { - red = player->unk_258[arg2].unk_038; - green = player->unk_258[arg2].unk_03A; - blue = player->unk_258[arg2].unk_03C; - alpha = player->unk_258[arg2].unk_03E; - sp54[0] = player->unk_258[arg2].unk_000[0]; - sp54[1] = player->unk_258[arg2].unk_000[1]; - sp54[2] = player->unk_258[arg2].unk_000[2]; + if (player->particlePool0[arg2].isAlive == 1) { + red = player->particlePool0[arg2].red; + green = player->particlePool0[arg2].green; + blue = player->particlePool0[arg2].blue; + alpha = player->particlePool0[arg2].alpha; + sp54[0] = player->particlePool0[arg2].pos[0]; + sp54[1] = player->particlePool0[arg2].pos[1]; + sp54[2] = player->particlePool0[arg2].pos[2]; sp4C[0] = 0x4000; sp4C[1] = player->unk_048[arg3]; sp4C[2] = 0; - func_800652D4(sp54, sp4C, player->unk_258[arg2].unk_00C * player->size); + func_800652D4(sp54, sp4C, player->particlePool0[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -5289,7 +5280,7 @@ void func_80066BAC(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3s spD4; UNUSED s32 stackPadding; - if ((player->unk_258[arg2].unk_01C == 1) && (player->unk_258[arg2].unk_038 != 0x00FF)) { + if ((player->particlePool0[arg2].isAlive == 1) && (player->particlePool0[arg2].red != 0x00FF)) { if (player->collision.surfaceDistance[2] >= 300.0f) { spDC[1] = player->pos[1] + 5.0f; @@ -5305,34 +5296,34 @@ void func_80066BAC(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { } spD4[1] = player->unk_048[arg3]; spD4[2] = 0; - func_800652D4(spDC, spD4, player->unk_258[arg2].unk_00C * player->size); - if (player->unk_258[arg2].unk_038 == 0) { + func_800652D4(spDC, spD4, player->particlePool0[arg2].scale * player->size); + if (player->particlePool0[arg2].red == 0) { gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C4, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedLightningBolt0, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800E8900[0][player->unk_258[arg2].unk_038], 4, 0); + gSPVertex(gDisplayListHead++, &D_800E8900[0][player->particlePool0[arg2].red], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C8, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedLightningBolt1, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800E8900[1][player->unk_258[arg2].unk_038], 4, 0); + gSPVertex(gDisplayListHead++, &D_800E8900[1][player->particlePool0[arg2].red], 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); } else { gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C8, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedLightningBolt1, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800E8900[0][player->unk_258[arg2].unk_038], 4, 0); + gSPVertex(gDisplayListHead++, &D_800E8900[0][player->particlePool0[arg2].red], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C4, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedLightningBolt0, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800E8900[1][player->unk_258[arg2].unk_038], 4, 0); + gSPVertex(gDisplayListHead++, &D_800E8900[1][player->particlePool0[arg2].red], 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); } gMatrixEffectCount += 1; @@ -5347,19 +5338,19 @@ void func_80067280(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 blue; s16 alpha; - if (player->unk_258[30 + arg2].unk_01C == 1) { - red = player->unk_258[30 + arg2].unk_038; - green = player->unk_258[30 + arg2].unk_03A; - blue = player->unk_258[30 + arg2].unk_03C; - alpha = player->unk_258[30 + arg2].unk_03E; - sp7C[0] = player->unk_258[30 + arg2].unk_000[0]; - sp7C[1] = player->unk_258[30 + arg2].unk_000[1]; - sp7C[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + red = player->particlePool3[arg2].red; + green = player->particlePool3[arg2].green; + blue = player->particlePool3[arg2].blue; + alpha = player->particlePool3[arg2].alpha; + sp7C[0] = player->particlePool3[arg2].pos[0]; + sp7C[1] = player->particlePool3[arg2].pos[1]; + sp7C[2] = player->particlePool3[arg2].pos[2]; sp74[0] = -0x071C; sp74[2] = 0; - if (player->unk_258[30 + arg2].unk_010 == 1) { + if (player->particlePool3[arg2].unk_010 == 1) { sp74[1] = player->unk_048[arg3] - 0x2000; - func_800652D4(sp7C, sp74, player->unk_258[30 + arg2].unk_00C * player->size); + func_800652D4(sp7C, sp74, player->particlePool3[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, @@ -5368,7 +5359,7 @@ void func_80067280(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { gSPDisplayList(gDisplayListHead++, D_0D008E70); } else { sp74[1] = player->unk_048[arg3] + 0x2000; - func_800652D4(sp7C, sp74, player->unk_258[30 + arg2].unk_00C * player->size); + func_800652D4(sp7C, sp74, player->particlePool3[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, @@ -5380,20 +5371,20 @@ void func_80067280(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { } } -void func_80067604(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { +void render_player_boost_spark_particles(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp8C; Vec3s sp84; UNUSED s32 stackPadding[4]; - if (player->unk_258[30 + arg2].unk_01C == 1) { - sp8C[0] = player->unk_258[30 + arg2].unk_000[0]; - sp8C[1] = player->unk_258[30 + arg2].unk_000[1]; - sp8C[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + sp8C[0] = player->particlePool3[arg2].pos[0]; + sp8C[1] = player->particlePool3[arg2].pos[1]; + sp8C[2] = player->particlePool3[arg2].pos[2]; sp84[0] = 0; sp84[1] = player->unk_048[arg3]; sp84[2] = 0; - func_800652D4(sp8C, sp84, player->unk_258[30 + arg2].unk_00C * player->size); - if (player->unk_258[30 + arg2].unk_010 == 1) { + func_800652D4(sp8C, sp84, player->particlePool3[arg2].scale * player->size); + if (player->particlePool3[arg2].unk_010 == 1) { gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, common_texture_particle_spark, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, @@ -5412,29 +5403,29 @@ void func_80067604(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { } } -void func_80067964(Player* player, UNUSED s8 arg1, f32 arg2, UNUSED s8 arg3, s8 arg4) { +void render_player_onomatopoeia_whrrrr(Player* player, UNUSED s8 arg1, f32 arg2, UNUSED s8 arg3, s8 arg4) { Vec3f sp9C; Vec3s sp94; UNUSED s32 stackPadding[2]; - if (player->unk_258[20 + arg4].unk_01C == 1) { - sp9C[0] = player->unk_258[20 + arg4].unk_000[0]; - sp9C[1] = player->unk_258[20 + arg4].unk_000[1]; - sp9C[2] = player->unk_258[20 + arg4].unk_000[2]; + if (player->particlePool2[arg4].isAlive == 1) { + sp9C[0] = player->particlePool2[arg4].pos[0]; + sp9C[1] = player->particlePool2[arg4].pos[1]; + sp9C[2] = player->particlePool2[arg4].pos[2]; sp94[0] = 0; - sp94[1] = player->unk_258[20 + arg4].unk_020; + sp94[1] = player->particlePool2[arg4].rotation; sp94[2] = 0; func_800652D4(sp9C, sp94, player->size * arg2); gSPDisplayList(gDisplayListHead++, D_0D008C90); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH); gDPLoadTLUT_pal256(gDisplayListHead++, D_800E52D0); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4AC, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedOnomatopoeiaWhrrrr1, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8840, 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4B0, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedOnomatopoeiaWhrrrr2, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8800, 4, 0); @@ -5443,7 +5434,7 @@ void func_80067964(Player* player, UNUSED s8 arg1, f32 arg2, UNUSED s8 arg3, s8 } } -void func_80067D3C(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 arg5) { +void render_player_speech_bubble(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 arg5) { Vec3f sp7C; Vec3s sp74; f32 sp54[8] = { 0.0f, -1.2f, 0.1f, 1.2f, -1.7f, -0.8f, -0.2f, -1.9f }; @@ -5453,14 +5444,14 @@ void func_80067D3C(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 s16 blue = ((arg5 >> 0x00) & 0xFF) & 0xFF; // ???????????????????????????????????????? - if (player->unk_258[20 + arg3].unk_01C == 1) { + if (player->particlePool2[arg3].isAlive == 1) { sp74[0] = 0; sp74[1] = player->unk_048[arg1]; sp74[2] = 0; sp7C[0] = player->pos[0] + (sins((0x4000 & 0xFFFFFFFF) - (player->rotation[1] + player->unk_0C0)) * arg4); sp7C[1] = player->pos[1] + player->boundingBoxSize - sp54[player->characterId] - 2.0f; sp7C[2] = player->pos[2] + (coss((0x4000 & 0xFFFFFFFF) - (player->rotation[1] + player->unk_0C0)) * arg4); - func_800652D4(sp7C, sp74, player->unk_258[20 + arg3].unk_00C * player->size); + func_800652D4(sp7C, sp74, player->particlePool2[arg3].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -5471,7 +5462,7 @@ void func_80067D3C(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 } } -void func_8006801C(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 arg5) { +void render_music_note(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 arg5) { Vec3f sp7C; Vec3s sp74; f32 sp54[8] = { -0.7f, -1.9f, -0.6f, 0.4f, -2.5f, -1.6f, -0.95f, -2.7f }; @@ -5481,14 +5472,14 @@ void func_8006801C(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 s16 blue = ((arg5 >> 0x00) & 0xFF) & 0xFF; // ???????????????????????????????????????? - if (player->unk_258[20 + arg3].unk_01C == 1) { + if (player->particlePool2[arg3].isAlive == 1) { sp74[0] = 0; sp74[1] = player->unk_048[arg1]; sp74[2] = 0; sp7C[0] = player->pos[0] + (sins((0x4000 & 0xFFFFFFFF) - (player->rotation[1] + player->unk_0C0)) * arg4); sp7C[1] = player->pos[1] + player->boundingBoxSize - sp54[player->characterId] - 2.0f; sp7C[2] = player->pos[2] + (coss((0x4000 & 0xFFFFFFFF) - (player->rotation[1] + player->unk_0C0)) * arg4); - func_800652D4(sp7C, sp74, player->unk_258[20 + arg3].unk_00C * player->size * 0.8); + func_800652D4(sp7C, sp74, player->particlePool2[arg3].scale * player->size * 0.8); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -5499,28 +5490,28 @@ void func_8006801C(Player* player, s8 arg1, u8* texture, s8 arg3, f32 arg4, s32 } } -void func_80068310(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { +void render_player_onomatopoeia_crash(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { UNUSED s32 stackPadding[16]; // huh? Vec3f sp9C; Vec3s sp94; - if (player->unk_258[20 + arg4].unk_01C == 1) { - sp9C[1] = player->unk_258[20 + arg4].unk_000[1]; + if (player->particlePool2[arg4].isAlive == 1) { + sp9C[1] = player->particlePool2[arg4].pos[1]; sp9C[2] = player->pos[2] + (coss(player->unk_048[arg3]) * -10.0f); sp9C[0] = player->pos[0] + (sins(player->unk_048[arg3]) * -10.0f); sp94[0] = 0; sp94[1] = player->unk_048[arg3]; sp94[2] = 0; - func_800652D4(sp9C, sp94, player->unk_258[20 + arg4].unk_00C * player->size); + func_800652D4(sp9C, sp94, player->particlePool2[arg4].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008C90); gDPLoadTLUT_pal256(gDisplayListHead++, D_800E52D0); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4B4, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedOnomatopoeiaCrash1, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8880, 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4B8, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedOnomatopoeiaCrash2, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E88C0, 4, 0); @@ -5534,23 +5525,23 @@ void func_80068724(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 Vec3f sp84; Vec3s sp7C; - if (player->unk_258[20 + arg4].unk_01C == 1) { + if (player->particlePool2[arg4].isAlive == 1) { sp84[1] = player->pos[1] - 3.0f; sp84[2] = player->pos[2] + (coss(player->unk_048[arg3]) * -10.0f); sp84[0] = player->pos[0] + (sins(player->unk_048[arg3]) * -10.0f); sp7C[0] = 0; sp7C[1] = player->unk_048[arg3]; sp7C[2] = 0; - func_800652D4(sp84, sp7C, player->unk_258[20 + arg4].unk_00C * player->size); + func_800652D4(sp84, sp7C, player->particlePool2[arg4].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C4, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedLightningBolt0, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8A00, 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C8, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedLightningBolt1, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8A40, 4, 0); @@ -5559,18 +5550,18 @@ void func_80068724(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 } } -void func_80068AA4(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { +void render_player_onomatopoeia_boing(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { Vec3f sp64; Vec3s sp5C; - if ((player->unk_258[20 + arg4].unk_01C == 1) && (player->animFrameSelector[arg3] < 0xD)) { + if ((player->particlePool2[arg4].isAlive == 1) && (player->animFrameSelector[arg3] < 0xD)) { sp64[1] = player->pos[1] - 3.0f; - sp64[2] = player->pos[2] + ((-2.5 * player->unk_258[20 + arg4].unk_01E) * coss(player->unk_048[arg3])); - sp64[0] = player->pos[0] + ((-2.5 * player->unk_258[20 + arg4].unk_01E) * sins(player->unk_048[arg3])); + sp64[2] = player->pos[2] + ((-2.5 * player->particlePool2[arg4].timer) * coss(player->unk_048[arg3])); + sp64[0] = player->pos[0] + ((-2.5 * player->particlePool2[arg4].timer) * sins(player->unk_048[arg3])); sp5C[0] = 0; sp5C[1] = player->unk_048[arg3]; sp5C[2] = 0; - func_800652D4(sp64, sp5C, player->unk_258[20 + arg4].unk_00C * player->size); + func_800652D4(sp64, sp5C, player->particlePool2[arg4].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gDPLoadTextureBlock(gDisplayListHead++, D_8018D4A0, G_IM_FMT_IA, G_IM_SIZ_8b, 64, 32, 0, @@ -5584,27 +5575,27 @@ void func_80068AA4(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 } } -void func_80068DA0(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { +void render_player_onomatopoeia_pomp(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { Vec3f sp9C; Vec3s sp94; - if ((player->unk_258[20 + arg4].unk_01C == 1) && ((s32) player->animFrameSelector[arg3] < 0xD)) { - sp9C[1] = (player->pos[1] - 3.0f) + player->unk_258[20 + arg4].unk_000[1]; + if ((player->particlePool2[arg4].isAlive == 1) && ((s32) player->animFrameSelector[arg3] < 0xD)) { + sp9C[1] = (player->pos[1] - 3.0f) + player->particlePool2[arg4].pos[1]; sp9C[2] = player->pos[2] + (coss(player->unk_048[arg3]) * -10.0f); sp9C[0] = player->pos[0] + (sins(player->unk_048[arg3]) * -10.0f); sp94[0] = 0; sp94[1] = player->unk_048[arg3]; sp94[2] = 0; - func_800652D4(sp9C, sp94, player->unk_258[20 + arg4].unk_00C * player->size); + func_800652D4(sp9C, sp94, player->particlePool2[arg4].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008C90); gDPLoadTLUT_pal256(gDisplayListHead++, D_800E52D0); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4A4, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedOnomatopoeiaPoomp1, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8B80, 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D4A8, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gTextureLoadedOnomatopoeiaPoomp2, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8BC0, 4, 0); @@ -5613,20 +5604,20 @@ void func_80068DA0(Player* player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 } } -void func_800691B8(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { +void render_actor_bonk_particles(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp5C; Vec3s sp54; s16 alpha; - if (player->unk_258[30 + arg2].unk_01C == 1) { - alpha = player->unk_258[30 + arg2].unk_03E; - sp5C[0] = player->unk_258[30 + arg2].unk_000[0]; - sp5C[1] = player->unk_258[30 + arg2].unk_000[1]; - sp5C[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + alpha = player->particlePool3[arg2].alpha; + sp5C[0] = player->particlePool3[arg2].pos[0]; + sp5C[1] = player->particlePool3[arg2].pos[1]; + sp5C[2] = player->particlePool3[arg2].pos[2]; sp54[0] = 0; sp54[1] = player->unk_048[arg3]; - player->unk_258[30 + arg2].unk_03A += 0x1C71; - sp54[2] = player->unk_258[30 + arg2].unk_03A; + player->particlePool3[arg2].green += 0x1C71; + sp54[2] = player->particlePool3[arg2].green; func_800652D4(sp5C, sp54, player->size * 0.5); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); @@ -5652,25 +5643,25 @@ void func_80069444(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 envGreen; s16 envBlue; u16 test; - if (player->unk_258[30 + arg2].unk_01C == 1) { - primRed = (D_800E47DC[player->unk_258[30 + arg2].unk_038] >> 0x10) & 0xFF; - primGreen = (D_800E47DC[player->unk_258[30 + arg2].unk_038] >> 8) & 0xFF; - primBlue = D_800E47DC[player->unk_258[30 + arg2].unk_038] & 0xFF; - - envRed = (D_800E480C[player->unk_258[30 + arg2].unk_038] >> 0x10) & 0xFF; - envGreen = (D_800E480C[player->unk_258[30 + arg2].unk_038] >> 8) & 0xFF; - envBlue = D_800E480C[player->unk_258[30 + arg2].unk_038] & 0xFF; - primAlpha = player->unk_258[30 + arg2].unk_03E; - - sp74[0] = player->unk_258[30 + arg2].unk_000[0]; - sp74[1] = player->unk_258[30 + arg2].unk_000[1]; - sp74[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + primRed = (D_800E47DC[player->particlePool3[arg2].red] >> 0x10) & 0xFF; + primGreen = (D_800E47DC[player->particlePool3[arg2].red] >> 8) & 0xFF; + primBlue = D_800E47DC[player->particlePool3[arg2].red] & 0xFF; + + envRed = (D_800E480C[player->particlePool3[arg2].red] >> 0x10) & 0xFF; + envGreen = (D_800E480C[player->particlePool3[arg2].red] >> 8) & 0xFF; + envBlue = D_800E480C[player->particlePool3[arg2].red] & 0xFF; + primAlpha = player->particlePool3[arg2].alpha; + + sp74[0] = player->particlePool3[arg2].pos[0]; + sp74[1] = player->particlePool3[arg2].pos[1]; + sp74[2] = player->particlePool3[arg2].pos[2]; sp6C[0] = 0; sp6C[1] = player->unk_048[arg3]; sp6C[2] = 0; func_800652D4(sp74, sp6C, player->size * 1.5); gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + gDPLoadTextureBlock(gDisplayListHead++, gLoadedGroundDust, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); // `test` MUST be a u16 @@ -5684,16 +5675,16 @@ void func_80069444(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { } } -void func_800696CC(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3, f32 arg4) { +void render_wall_bonk_star_particles(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3, f32 arg4) { Vec3f sp5C; Vec3s sp54; s16 alpha; - if (player->unk_258[30 + arg2].unk_01C == 1) { - alpha = player->unk_258[30 + arg2].unk_03E; - sp5C[0] = player->unk_258[30 + arg2].unk_000[0]; - sp5C[1] = player->unk_258[30 + arg2].unk_000[1]; - sp5C[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + alpha = player->particlePool3[arg2].alpha; + sp5C[0] = player->particlePool3[arg2].pos[0]; + sp5C[1] = player->particlePool3[arg2].pos[1]; + sp5C[2] = player->particlePool3[arg2].pos[2]; sp54[0] = 0; sp54[1] = player->unk_048[arg3]; sp54[2] = 0; @@ -5716,15 +5707,15 @@ void func_80069938(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3s sp54; s16 alpha; - if (player->unk_258[30 + arg2].unk_01C == 1) { - alpha = player->unk_258[30 + arg2].unk_03E; - sp5C[0] = player->unk_258[30 + arg2].unk_000[0]; - sp5C[1] = player->unk_258[30 + arg2].unk_000[1]; - sp5C[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + alpha = player->particlePool3[arg2].alpha; + sp5C[0] = player->particlePool3[arg2].pos[0]; + sp5C[1] = player->particlePool3[arg2].pos[1]; + sp5C[2] = player->particlePool3[arg2].pos[2]; sp54[0] = 0; sp54[1] = player->unk_048[arg3]; - sp54[2] = player->unk_258[30 + arg2].unk_038; - func_800652D4(sp5C, sp54, player->unk_258[30 + arg2].unk_00C * player->size); + sp54[2] = player->particlePool3[arg2].red; + func_800652D4(sp5C, sp54, player->particlePool3[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gDPLoadTextureBlock(gDisplayListHead++, D_8018D488, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, @@ -5746,18 +5737,18 @@ void func_80069BA8(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 blue; s16 alpha; - if (player->unk_258[30 + arg2].unk_01C == 1) { - red = player->unk_258[30 + arg2].unk_038; - green = player->unk_258[30 + arg2].unk_03A; - blue = player->unk_258[30 + arg2].unk_03C; - alpha = player->unk_258[30 + arg2].unk_03E; - sp54[0] = player->unk_258[30 + arg2].unk_000[0]; - sp54[1] = player->unk_258[30 + arg2].unk_000[1]; - sp54[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + red = player->particlePool3[arg2].red; + green = player->particlePool3[arg2].green; + blue = player->particlePool3[arg2].blue; + alpha = player->particlePool3[arg2].alpha; + sp54[0] = player->particlePool3[arg2].pos[0]; + sp54[1] = player->particlePool3[arg2].pos[1]; + sp54[2] = player->particlePool3[arg2].pos[2]; sp4C[0] = 0; sp4C[1] = player->unk_048[arg3]; sp4C[2] = 0; - func_800652D4(sp54, sp4C, player->unk_258[30 + arg2].unk_00C * player->size); + func_800652D4(sp54, sp4C, player->particlePool3[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -5773,14 +5764,14 @@ void func_80069DB8(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3s sp54; UNUSED s32 stackPadding[2]; - if (player->unk_258[30 + arg2].unk_01C == 1) { - sp5C[0] = player->unk_258[30 + arg2].unk_000[0]; - sp5C[1] = player->unk_258[30 + arg2].unk_000[1]; - sp5C[2] = player->unk_258[30 + arg2].unk_000[2]; + if (player->particlePool3[arg2].isAlive == 1) { + sp5C[0] = player->particlePool3[arg2].pos[0]; + sp5C[1] = player->particlePool3[arg2].pos[1]; + sp5C[2] = player->particlePool3[arg2].pos[2]; sp54[0] = 0; sp54[1] = player->unk_048[arg3]; sp54[2] = 0; - func_800652D4(sp5C, sp54, player->unk_258[30 + arg2].unk_00C * player->size); + func_800652D4(sp5C, sp54, player->particlePool3[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gDPLoadTextureBlock(gDisplayListHead++, D_8018D49C, G_IM_FMT_IA, G_IM_SIZ_16b, 16, 16, 0, @@ -5798,14 +5789,14 @@ void func_8006A01C(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; - if (player->unk_258[arg2].unk_01C == 1) { - sp54[0] = player->unk_258[10 + arg2].unk_000[0]; - sp54[1] = player->unk_258[10 + arg2].unk_000[1]; - sp54[2] = player->unk_258[10 + arg2].unk_000[2]; + if (player->particlePool0[arg2].isAlive == 1) { + sp54[0] = player->particlePool1[arg2].pos[0]; + sp54[1] = player->particlePool1[arg2].pos[1]; + sp54[2] = player->particlePool1[arg2].pos[2]; sp4C[0] = 0; sp4C[1] = player->unk_048[arg3]; sp4C[2] = 0; - func_800652D4(sp54, sp4C, player->unk_258[10 + arg2].unk_00C * player->size); + func_800652D4(sp54, sp4C, player->particlePool1[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); @@ -5827,21 +5818,21 @@ void func_8006A280(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { s16 green; s16 blue; - if (player->unk_258[arg2].unk_01C == 1) { - red = player->unk_258[arg2].unk_038; - green = player->unk_258[arg2].unk_03A; - blue = player->unk_258[arg2].unk_03C; - sp5C[0] = player->unk_258[arg2].unk_000[0]; - sp5C[1] = player->unk_258[arg2].unk_000[1]; - sp5C[2] = player->unk_258[arg2].unk_000[2]; + if (player->particlePool0[arg2].isAlive == 1) { + red = player->particlePool0[arg2].red; + green = player->particlePool0[arg2].green; + blue = player->particlePool0[arg2].blue; + sp5C[0] = player->particlePool0[arg2].pos[0]; + sp5C[1] = player->particlePool0[arg2].pos[1]; + sp5C[2] = player->particlePool0[arg2].pos[2]; sp54[0] = 0; sp54[1] = player->unk_048[arg3]; sp54[2] = 0; - func_800652D4(sp5C, sp54, player->unk_258[arg2].unk_00C * player->size); + func_800652D4(sp5C, sp54, player->particlePool0[arg2].scale * player->size); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); - gDPLoadTextureBlock_4b(gDisplayListHead++, *D_800E47A0[player->unk_258[arg2].unk_01E], G_IM_FMT_I, 64, 64, 0, - G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + gDPLoadTextureBlock_4b(gDisplayListHead++, *D_800E47A0[player->particlePool0[arg2].timer], G_IM_FMT_I, 64, 64, + 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B414(red, green, blue, 0x000000FF); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); @@ -5851,31 +5842,31 @@ void func_8006A280(Player* player, UNUSED s8 arg1, s16 arg2, s8 arg3) { } } -void func_8006A50C(Player* player, f32 arg1, f32 arg2, s8 arg3, s8 arg4, s16 arg5) { +void init_balloon(Player* player, f32 arg1, f32 arg2, s8 playerIndex, s8 balloonIndex, s16 rotation) { f32 someX; f32 someY; f32 someZ; - gPlayerBalloonStatus[arg3][arg4] = 0; - D_8018D650[arg3][arg4] = 0.1f; - D_8018D6B0[arg3][arg4] = 0.0f; - D_8018D710[arg3][arg4] = 0.0f; - D_8018D770[arg3][arg4] = 0; - D_8018D7A0[arg3][arg4] = 0; - D_8018D7D0[arg3][arg4] = 0; - D_8018D800[arg3][arg4] = 5; - D_8018D830[arg3][arg4] = 1; - D_8018D620[arg3][arg4] = -player->rotation[1] - player->unk_0C0; + gPlayerBalloonStatus[playerIndex][balloonIndex] = BALLOON_STATUS_GONE; + D_8018D650[playerIndex][balloonIndex] = 0.1f; + D_8018D6B0[playerIndex][balloonIndex] = 0.0f; + D_8018D710[playerIndex][balloonIndex] = 0.0f; + D_8018D770[playerIndex][balloonIndex] = 0; + D_8018D7A0[playerIndex][balloonIndex] = 0; + D_8018D7D0[playerIndex][balloonIndex] = 0; + D_8018D800[playerIndex][balloonIndex] = 5; + D_8018D830[playerIndex][balloonIndex] = 1; + D_8018D620[playerIndex][balloonIndex] = -player->rotation[1] - player->unk_0C0; func_80062B18(&someX, &someY, &someZ, arg1, 4.0f, arg2 + -3.8, -player->rotation[1], 0); - D_8018D4D0[arg3][arg4] = player->pos[0] + someX; - D_8018D590[arg3][arg4] = player->pos[2] + someZ; - D_8018D530[arg3][arg4] = (player->pos[1] - player->boundingBoxSize) + someY; - gPlayerBalloonStatus[arg3][arg4] |= 1; - D_8018D860[arg3][arg4] = arg5; - D_8018D890[arg3][arg4] = 0; + gPlayerBalloonPosX[playerIndex][balloonIndex] = player->pos[0] + someX; + gPlayerBalloonPosZ[playerIndex][balloonIndex] = player->pos[2] + someZ; + gPlayerBalloonPosY[playerIndex][balloonIndex] = (player->pos[1] - player->boundingBoxSize) + someY; + gPlayerBalloonStatus[playerIndex][balloonIndex] |= BALLOON_STATUS_PRESENT; + gPlayerBalloonRotation[playerIndex][balloonIndex] = rotation; // Sprite rotation + D_8018D890[playerIndex][balloonIndex] = 0; } -void func_8006A7C0(Player* player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) { +void update_player_one_balloon_position(Player* player, f32 arg1, f32 arg2, s8 playerId, s8 balloonId) { f32 sp80[] = { 9.0f, 10.0f, 9.0f, 8.0f, 10.0f, 9.5f, 9.5f, 11.0f, }; @@ -5887,81 +5878,81 @@ void func_8006A7C0(Player* player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) { UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; - sp6C = (-(player->unk_094 / 18.0f) * 216.0f) / 10.0f; - if ((gPlayerBalloonStatus[arg3][arg4] & 2) != 2) { - D_8018D650[arg3][arg4] += -0.003 + (-player->unk_094 * 0.0006); - if (D_8018D650[arg3][arg4] >= 0.05) { - D_8018D650[arg3][arg4] = 0.05f; + sp6C = (-(player->speed / 18.0f) * 216.0f) / 10.0f; + if ((gPlayerBalloonStatus[playerId][balloonId] & 2) != 2) { + D_8018D650[playerId][balloonId] += -0.003 + (-player->speed * 0.0006); + if (D_8018D650[playerId][balloonId] >= 0.05) { + D_8018D650[playerId][balloonId] = 0.05f; } - if (D_8018D650[arg3][arg4] <= -0.05) { - D_8018D650[arg3][arg4] = -0.05f; + if (D_8018D650[playerId][balloonId] <= -0.05) { + D_8018D650[playerId][balloonId] = -0.05f; } - D_8018D6B0[arg3][arg4] += D_8018D650[arg3][arg4]; - if (D_8018D6B0[arg3][arg4] >= 0.06) { - D_8018D6B0[arg3][arg4] = 0.06f; + D_8018D6B0[playerId][balloonId] += D_8018D650[playerId][balloonId]; + if (D_8018D6B0[playerId][balloonId] >= 0.06) { + D_8018D6B0[playerId][balloonId] = 0.06f; } - if (D_8018D6B0[arg3][arg4] <= -0.06) { - D_8018D6B0[arg3][arg4] = -0.06f; + if (D_8018D6B0[playerId][balloonId] <= -0.06) { + D_8018D6B0[playerId][balloonId] = -0.06f; } - D_8018D710[arg3][arg4] += D_8018D6B0[arg3][arg4]; - if (D_8018D710[arg3][arg4] < 0.0f) { - D_8018D650[arg3][arg4] = random_int(0x000BU) / 10; - D_8018D6B0[arg3][arg4] = 0.0f; - D_8018D710[arg3][arg4] = 0.0f; + D_8018D710[playerId][balloonId] += D_8018D6B0[playerId][balloonId]; + if (D_8018D710[playerId][balloonId] < 0.0f) { + D_8018D650[playerId][balloonId] = random_int(0x000BU) / 10; + D_8018D6B0[playerId][balloonId] = 0.0f; + D_8018D710[playerId][balloonId] = 0.0f; } - D_8018D620[arg3][arg4] = -player->rotation[1] - player->unk_0C0; - move_s16_towards(&D_8018D890[arg3][arg4], player->unk_094 * 182.0f, 0.1f); + D_8018D620[playerId][balloonId] = -player->rotation[1] - player->unk_0C0; + move_s16_towards(&D_8018D890[playerId][balloonId], player->speed * 182.0f, 0.1f); } - if (D_8018D830[arg3][arg4] == 1) { - D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] - player->unk_094; + if (D_8018D830[playerId][balloonId] == 1) { + D_8018D770[playerId][balloonId] += D_8018D800[playerId][balloonId] - player->speed; } else { - D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] + player->unk_094; + D_8018D770[playerId][balloonId] += D_8018D800[playerId][balloonId] + player->speed; } - if (D_8018D770[arg3][arg4] >= 0xB) { - D_8018D770[arg3][arg4] = 0x000B; + if (D_8018D770[playerId][balloonId] >= 0xB) { + D_8018D770[playerId][balloonId] = 0x000B; } - if (D_8018D770[arg3][arg4] < -0xA) { - D_8018D770[arg3][arg4] = -0x000B; + if (D_8018D770[playerId][balloonId] < -0xA) { + D_8018D770[playerId][balloonId] = -0x000B; } - D_8018D7A0[arg3][arg4] += D_8018D770[arg3][arg4]; - if (D_8018D7A0[arg3][arg4] >= 0x29) { - D_8018D7A0[arg3][arg4] = 0x0029; + D_8018D7A0[playerId][balloonId] += D_8018D770[playerId][balloonId]; + if (D_8018D7A0[playerId][balloonId] >= 0x29) { + D_8018D7A0[playerId][balloonId] = 0x0029; } - if (D_8018D7A0[arg3][arg4] < -0x28) { - D_8018D7A0[arg3][arg4] = -0x0029; + if (D_8018D7A0[playerId][balloonId] < -0x28) { + D_8018D7A0[playerId][balloonId] = -0x0029; } - D_8018D7D0[arg3][arg4] += D_8018D7A0[arg3][arg4]; - if (D_8018D7D0[arg3][arg4] >= 0x38E) { - D_8018D800[arg3][arg4] = -random_int(8U); - if (D_8018D830[arg3][arg4] != 1) { - D_8018D830[arg3][arg4] = 1; + D_8018D7D0[playerId][balloonId] += D_8018D7A0[playerId][balloonId]; + if (D_8018D7D0[playerId][balloonId] >= 0x38E) { + D_8018D800[playerId][balloonId] = -random_int(8U); + if (D_8018D830[playerId][balloonId] != 1) { + D_8018D830[playerId][balloonId] = 1; } } - if (D_8018D7D0[arg3][arg4] < -0x38D) { - D_8018D800[arg3][arg4] = random_int(8U); - if (D_8018D830[arg3][arg4] != -1) { - D_8018D830[arg3][arg4] = -1; + if (D_8018D7D0[playerId][balloonId] < -0x38D) { + D_8018D800[playerId][balloonId] = random_int(8U); + if (D_8018D830[playerId][balloonId] != -1) { + D_8018D830[playerId][balloonId] = -1; } } - func_80062B18(&someX, &someY, &someZ, arg1, sp80[player->characterId] - D_8018D710[arg3][arg4], - arg2 + -3.2 + (sp6C * 1), -D_8018D620[arg3][arg4], -player->unk_206 * 2); - if ((gPlayerBalloonStatus[arg3][arg4] & 2) != 2) { - D_8018D530[arg3][arg4] = (player->pos[1] - player->boundingBoxSize) + someY; - D_8018D4D0[arg3][arg4] = player->pos[0] + someX; - D_8018D590[arg3][arg4] = player->pos[2] + someZ; - D_8018D8D0[arg3][arg4] = 0; + func_80062B18(&someX, &someY, &someZ, arg1, sp80[player->characterId] - D_8018D710[playerId][balloonId], + arg2 + -3.2 + (sp6C * 1), -D_8018D620[playerId][balloonId], -player->unk_206 * 2); + if ((gPlayerBalloonStatus[playerId][balloonId] & 2) != 2) { + gPlayerBalloonPosY[playerId][balloonId] = (player->pos[1] - player->boundingBoxSize) + someY; + gPlayerBalloonPosX[playerId][balloonId] = player->pos[0] + someX; + gPlayerBalloonPosZ[playerId][balloonId] = player->pos[2] + someZ; + gPlayerBalloonDepartingTimer[playerId][balloonId] = 0; } else { - D_8018D530[arg3][arg4] += 0.2; - D_8018D8D0[arg3][arg4] += 1; - move_s16_towards(&D_8018D890[arg3][arg4], 0, 0.1f); - move_s16_towards(&D_8018D860[arg3][arg4], 0, 0.1f); - if (D_8018D8D0[arg3][arg4] >= 0x78) { - func_8006B974((s32) player, arg3, arg4); + gPlayerBalloonPosY[playerId][balloonId] += 0.2; + gPlayerBalloonDepartingTimer[playerId][balloonId] += 1; + move_s16_towards(&D_8018D890[playerId][balloonId], 0, 0.1f); + move_s16_towards(&gPlayerBalloonRotation[playerId][balloonId], 0, 0.1f); + if (gPlayerBalloonDepartingTimer[playerId][balloonId] >= 0x78) { + set_player_balloon_to_gone((s32) player, playerId, balloonId); } } } -void render_battle_balloon(Player* player, s8 arg1, s16 arg2, s8 arg3) { +void render_battle_balloon(Player* player, s8 playerIndex, s16 balloonIndex, s8 screenId) { Mat4 sp140; Vec3f sp134; Vec3s sp12C; @@ -5991,14 +5982,14 @@ void render_battle_balloon(Player* player, s8 arg1, s16 arg2, s8 arg3) { envRed = (envColors[player->characterId] >> 0x10) & 0xFF; envGreen = (envColors[player->characterId] >> 0x08) & 0xFF; envBlue = (envColors[player->characterId] >> 0x00) & 0xFF; - temp_t1 = (((player->unk_048[arg3] + player->rotation[1] + player->unk_0C0) & 0xFFFF) / 128); + temp_t1 = (((player->unk_048[screenId] + player->rotation[1] + player->unk_0C0) & 0xFFFF) / 128); temp_t1 <<= 7; - if (arg3 == arg1) { + if (screenId == playerIndex) { var_f20 = 0.3f; } else { // wut? - xdiff = (var_f20 = player->pos[0] - cameras[arg3].pos[0]); - zdiff = player->pos[2] - cameras[arg3].pos[2]; + xdiff = (var_f20 = player->pos[0] - cameras[screenId].pos[0]); + zdiff = player->pos[2] - cameras[screenId].pos[2]; if (gActiveScreenMode != 3) { var_f20 = sqrtf((xdiff * xdiff) + (zdiff * zdiff)) / 300.0f; } else { @@ -6011,13 +6002,14 @@ void render_battle_balloon(Player* player, s8 arg1, s16 arg2, s8 arg3) { var_f20 = 0.3f; } } - sp134[0] = D_8018D4D0[arg1][arg2]; - sp134[1] = D_8018D530[arg1][arg2]; - sp134[2] = D_8018D590[arg1][arg2]; - sp12C[0] = -((D_8018D890[arg1][arg2] * 4) * coss(temp_t1)); - sp12C[1] = player->unk_048[arg3]; - sp12C[2] = D_8018D7D0[arg1][arg2] - (D_8018D860[arg1][arg2] * coss(temp_t1)) - - ((D_8018D890[arg1][arg2] * 8) * sins(temp_t1)); + sp134[0] = gPlayerBalloonPosX[playerIndex][balloonIndex]; + sp134[1] = gPlayerBalloonPosY[playerIndex][balloonIndex]; + sp134[2] = gPlayerBalloonPosZ[playerIndex][balloonIndex]; + sp12C[0] = -((D_8018D890[playerIndex][balloonIndex] * 4) * coss(temp_t1)); + sp12C[1] = player->unk_048[screenId]; + sp12C[2] = D_8018D7D0[playerIndex][balloonIndex] - + (gPlayerBalloonRotation[playerIndex][balloonIndex] * coss(temp_t1)) - + ((D_8018D890[playerIndex][balloonIndex] * 8) * sins(temp_t1)); mtxf_translate_rotate(sp140, sp134, sp12C); mtxf_scale2(sp140, var_f20); convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], sp140); @@ -6048,23 +6040,23 @@ void render_battle_balloon(Player* player, s8 arg1, s16 arg2, s8 arg3) { gMatrixEffectCount++; } -void func_8006B7E4(Player* player, s8 arg1) { - func_8006A50C(player, 0.0f, 0.0f, arg1, (s8) 0, (s16) 0); - func_8006A50C(player, 1.5f, 2.0f, arg1, (s8) 1, (s16) 0x1C70); - func_8006A50C(player, -1.5f, 2.0f, arg1, (s8) 2, (s16) -0x1C70); - gPlayerBalloonCount[arg1] = 2; +void init_all_player_balloons(Player* player, s8 playerIndex) { + init_balloon(player, 0.0f, 0.0f, playerIndex, (s8) 0, (s16) 0); + init_balloon(player, 1.5f, 2.0f, playerIndex, (s8) 1, (s16) 0x1C70); + init_balloon(player, -1.5f, 2.0f, playerIndex, (s8) 2, (s16) -0x1C70); + gPlayerBalloonCount[playerIndex] = 2; } -void func_8006B87C(UNUSED Player* player, s8 playerIndex) { +void clear_all_player_balloons(UNUSED Player* player, s8 playerIndex) { gPlayerBalloonStatus[playerIndex][0] = BALLOON_STATUS_GONE; gPlayerBalloonStatus[playerIndex][1] = BALLOON_STATUS_GONE; gPlayerBalloonStatus[playerIndex][2] = BALLOON_STATUS_GONE; } -void func_8006B8B4(Player* player, s8 playerIndex) { +void pop_player_balloon(Player* player, s8 playerIndex) { if (gPlayerBalloonCount[playerIndex] >= 0) { - gPlayerBalloonStatus[playerIndex][gPlayerBalloonCount[playerIndex]] &= ~1; - gPlayerBalloonStatus[playerIndex][gPlayerBalloonCount[playerIndex]] |= 2; + gPlayerBalloonStatus[playerIndex][gPlayerBalloonCount[playerIndex]] &= ~BALLOON_STATUS_PRESENT; + gPlayerBalloonStatus[playerIndex][gPlayerBalloonCount[playerIndex]] |= BALLOON_STATUS_DEPARTING; gPlayerBalloonCount[playerIndex]--; func_800C9060(playerIndex, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x51)); if (gPlayerBalloonCount[playerIndex] < 0) { @@ -6073,36 +6065,35 @@ void func_8006B8B4(Player* player, s8 playerIndex) { } } -void func_8006B974(UNUSED s32 arg0, s8 playerIndex, s8 balloonIndex) { +void set_player_balloon_to_gone(UNUSED s32 arg0, s8 playerIndex, s8 balloonIndex) { if (gPlayerBalloonCount[playerIndex] >= 0) { gPlayerBalloonStatus[playerIndex][balloonIndex] = BALLOON_STATUS_GONE; } } -void func_8006B9CC(Player* player, s8 arg1) { - if (gPlayerBalloonStatus[arg1][0] != 0) { - func_8006A7C0(player, 0.0f, 0.0f, arg1, 0); +void update_player_balloons_position(Player* player, s8 playerId) { + if (gPlayerBalloonStatus[playerId][0] != BALLOON_STATUS_GONE) { + update_player_one_balloon_position(player, 0.0f, 0.0f, playerId, 0); } - if (gPlayerBalloonStatus[arg1][1] != 0) { - - func_8006A7C0(player, 1.8f, 2.6f, arg1, 1); + if (gPlayerBalloonStatus[playerId][1] != BALLOON_STATUS_GONE) { + update_player_one_balloon_position(player, 1.8f, 2.6f, playerId, 1); } - if (gPlayerBalloonStatus[arg1][2] != 0) { - func_8006A7C0(player, -1.8f, 2.6f, arg1, 2); + if (gPlayerBalloonStatus[playerId][2] != BALLOON_STATUS_GONE) { + update_player_one_balloon_position(player, -1.8f, 2.6f, playerId, 2); } } -void func_8006BA94(Player* player, s8 playerIndex, s8 arg2) { +void render_remaining_battle_balloons(Player* player, s8 playerIndex, s8 screenId) { if (gPlayerBalloonStatus[playerIndex][0] != BALLOON_STATUS_GONE) { - render_battle_balloon(player, playerIndex, 0, arg2); + render_battle_balloon(player, playerIndex, 0, screenId); } if (gPlayerBalloonStatus[playerIndex][1] != BALLOON_STATUS_GONE) { - render_battle_balloon(player, playerIndex, 1, arg2); + render_battle_balloon(player, playerIndex, 1, screenId); } if (gPlayerBalloonStatus[playerIndex][2] != BALLOON_STATUS_GONE) { - render_battle_balloon(player, playerIndex, 2, arg2); + render_battle_balloon(player, playerIndex, 2, screenId); } } @@ -6249,210 +6240,219 @@ void func_8006C4D4(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha, s16 arg4) { gMatrixEffectCount += 1; } -void func_8006C6AC(Player* player, s16 arg1, s8 arg2, s8 arg3) { - s8 arg2_copy = arg2; +void func_8006C6AC(Player* player, s16 particleIndex, s8 playerId, s8 arg3) { + s8 playerIdCopy = playerId; s32 sp28; - sp28 = arg1 - 1; + sp28 = particleIndex - 1; if (sp28 < 0) { sp28 = 9; } - if (player->unk_258[10 + arg1].unk_01C == 1) { - switch (player->unk_258[10 + arg1].unk_012) { + if (player->particlePool1[particleIndex].isAlive == 1) { + switch (player->particlePool1[particleIndex].type) { case 1: - func_80063408(player, arg1, arg2_copy, arg3); + func_80063408(player, particleIndex, playerIdCopy, arg3); break; case 2: - func_800635D4(player, arg1, arg2_copy, arg3); + func_800635D4(player, particleIndex, playerIdCopy, arg3); break; case 3: - func_80063BD4(player, arg1, arg2_copy, arg3); + func_80063BD4(player, particleIndex, playerIdCopy, arg3); break; case 4: - func_800643A8(player, arg1, arg2_copy, arg3); + func_800643A8(player, particleIndex, playerIdCopy, arg3); break; case 5: - func_800639DC(player, arg1, arg2_copy, arg3); + func_800639DC(player, particleIndex, playerIdCopy, arg3); break; case 9: - func_80063D58(player, arg1, arg2_copy, arg3); + func_80063D58(player, particleIndex, playerIdCopy, arg3); break; case 11: - func_80062F98(player, arg1, arg2_copy, arg3); + func_80062F98(player, particleIndex, playerIdCopy, arg3); break; default: break; } } else { - if (player->unk_0DE & 1) { - func_80060BCC(player, arg1, sp28, arg2_copy, arg3); - } else if (!(player->effects & 8) && !(player->effects & 2)) { - if (((player->effects & 0x10) == 0x10) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { - func_8005DA30(player, arg1, sp28, arg2_copy, arg3); - } else if (((f64) (D_801652A0[arg2_copy] - player->tyres[BACK_RIGHT].baseHeight) >= 3.5) || - ((f64) (D_801652A0[arg2_copy] - player->tyres[BACK_LEFT].baseHeight) >= 3.5)) { - func_8005EA94(player, arg1, sp28, arg2_copy, arg3); - } else if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) { - func_8005F90C(player, arg1, sp28, arg2_copy, arg3); - } else if (((player->effects & 0x4000) && !(player->type & PLAYER_START_SEQUENCE)) || - (player->effects & 0x800) || (player->effects & 0x20) || (player->unk_044 & 0x4000)) { - func_8005ED48(player, arg1, sp28, arg2_copy, arg3); + if (player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) { + func_80060BCC(player, particleIndex, sp28, playerIdCopy, arg3); + } else if (!(player->effects & MIDAIR_EFFECT) && !(player->effects & HOP_EFFECT)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + check_drift_particles_setup_valid(player, particleIndex, sp28, playerIdCopy, arg3); + } else if (((f64) (D_801652A0[playerIdCopy] - player->tyres[BACK_RIGHT].baseHeight) >= 3.5) || + ((f64) (D_801652A0[playerIdCopy] - player->tyres[BACK_LEFT].baseHeight) >= 3.5)) { + func_8005EA94(player, particleIndex, sp28, playerIdCopy, arg3); + } else if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) { + func_8005F90C(player, particleIndex, sp28, playerIdCopy, arg3); + } else if (((player->effects & EARLY_START_SPINOUT_EFFECT) && !(player->type & PLAYER_START_SEQUENCE)) || + (player->effects & BANANA_NEAR_SPINOUT_EFFECT) || (player->effects & AB_SPIN_EFFECT) || + (player->kartProps & DRIVING_SPINOUT)) { + func_8005ED48(player, particleIndex, sp28, playerIdCopy, arg3); } else { - func_8005DAF4(player, arg1, sp28, arg2_copy, arg3); + setup_tyre_particles(player, particleIndex, sp28, playerIdCopy, arg3); } } } } -void func_8006C9B8(Player* player, s16 arg1, s8 arg2, s8 arg3) { +void func_8006C9B8(Player* player, s16 arg1, s8 playerIndex, s8 arg3) { UNUSED s32 stackPadding; s32 sp28; sp28 = arg1 - 1; if (sp28 < 0) { sp28 = 9; } - if (player->unk_258[30 + arg1].unk_01C == 1) { - switch (player->unk_258[30 + arg1].unk_012) { + if (player->particlePool3[arg1].isAlive == 1) { + switch (player->particlePool3[arg1].type) { case 1: - func_800644E8(player, arg1, arg2, arg3); + func_800644E8(player, arg1, playerIndex, arg3); break; case 2: - func_800649F4(player, arg1, arg2, arg3); + func_800649F4(player, arg1, playerIndex, arg3); break; case 3: - func_80064C74(player, arg1, arg2, arg3); + func_80064C74(player, arg1, playerIndex, arg3); break; case 4: - func_800647C8(player, arg1, arg2, arg3); + func_800647C8(player, arg1, playerIndex, arg3); break; case 5: - func_80064B30(player, arg1, arg2, arg3); + func_80064B30(player, arg1, playerIndex, arg3); break; case 6: - func_800648E4(player, arg1, arg2, arg3); + func_800648E4(player, arg1, playerIndex, arg3); break; case 7: - func_80064988(player, arg1, arg2, arg3); + func_80064988(player, arg1, playerIndex, arg3); break; case 8: - func_80064C74(player, arg1, arg2, arg3); + func_80064C74(player, arg1, playerIndex, arg3); break; case 9: - func_80064664(player, arg1, arg2, arg3); + func_80064664(player, arg1, playerIndex, arg3); break; default: break; } } else { - if (player->unk_044 & 0x1000) { - func_80061430(player, arg1, sp28, arg2, arg3); - player->unk_044 &= ~0x0100; + if (player->kartProps & UNUSED_0x1000) { + func_80061430(player, arg1, sp28, playerIndex, arg3); + player->kartProps &= ~POST_TUMBLE_GAS; return; } - if (((((player->unk_0CA & 0x1000) == 0x1000) || ((player->unk_0E0 < 2) && (player->effects & 0x01000000))) || - ((player->unk_0E0 < 2) && (player->effects & HIT_BY_ITEM_EFFECT))) || - (player->effects & 0x400)) { - func_8006199C(player, arg1, sp28, arg2, arg3); + if (((((player->lakituProps & LAKITU_LAVA) == LAKITU_LAVA) || + ((player->unk_0E0 < 2) && (player->effects & EXPLOSION_CRASH_EFFECT))) || + ((player->unk_0E0 < 2) && (player->effects & HIT_BY_STAR_EFFECT))) || + (player->effects & HIT_BY_GREEN_SHELL_EFFECT)) { + func_8006199C(player, arg1, sp28, playerIndex, arg3); player->unk_046 &= ~0x0008; - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; return; } - if ((player->unk_0CA & 0x2000) == 0x2000) { - func_80061A34(player, arg1, sp28, arg2, arg3); + if ((player->lakituProps & LAKITU_WATER) == LAKITU_WATER) { + func_80061A34(player, arg1, sp28, playerIndex, arg3); player->unk_046 &= ~0x0008; - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; return; } - if ((player->effects & STAR_EFFECT) && ((((s32) gCourseTimer) - D_8018D930[arg2]) < 9)) { - func_800615AC(player, arg1, sp28, arg2, arg3); + if ((player->effects & STAR_EFFECT) && + ((((s32) gCourseTimer) - gPlayerStarEffectStartTime[playerIndex]) < STAR_EFFECT_DURATION - 1)) { + func_800615AC(player, arg1, sp28, playerIndex, arg3); player->unk_046 &= ~0x0008; - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; return; } if ((player->unk_046 & 8) == 8) { - func_800612F8(player, arg1, sp28, arg2, arg3); - player->unk_044 &= ~0x0100; + func_800612F8(player, arg1, sp28, playerIndex, arg3); + player->kartProps &= ~POST_TUMBLE_GAS; return; } - if (((player->unk_046 & 0x20) == 0x20) && (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { - func_80061D4C(player, arg1, sp28, arg2, arg3); + if (((player->unk_046 & 0x20) == 0x20) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { + func_80061D4C(player, arg1, sp28, playerIndex, arg3); player->unk_046 &= ~0x0008; - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; return; } - if ((player->effects & BOOST_EFFECT) && (player->type & PLAYER_HUMAN)) { - func_800621BC(player, arg1, sp28, arg2, arg3); + if ((player->effects & MUSHROOM_EFFECT) && (player->type & PLAYER_HUMAN)) { + func_800621BC(player, arg1, sp28, playerIndex, arg3); return; } - if (((player->effects & 0x200000) || (player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && + if (((player->effects & CPU_FAST_EFFECT) || (player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { - func_80061EF4(player, arg1, sp28, arg2, arg3); + func_80061EF4(player, arg1, sp28, playerIndex, arg3); player->unk_046 &= ~0x0008; - player->unk_044 &= ~0x0100; + player->kartProps &= ~POST_TUMBLE_GAS; return; } - if ((player->unk_044 & 0x100) == 0x100) { - func_800624D8(player, arg1, sp28, arg2, arg3); + if ((player->kartProps & POST_TUMBLE_GAS) == POST_TUMBLE_GAS) { + func_800624D8(player, arg1, sp28, playerIndex, arg3); player->unk_046 &= ~0x0008; } } } -void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) { +void func_8006CEC0(Player* arg0, s16 arg1, s8 playerId, s8 arg3) { UNUSED u16 temp_v0_3; s32 sp20 = arg1; if (--sp20 < 0) { sp20 = 9; } - if (arg0->unk_258[arg1].unk_01C == 1) { - switch (arg0->unk_258[arg1].unk_012) { + // Spawn particles when oob + if (arg0->particlePool0[arg1].isAlive == 1) { + switch (arg0->particlePool0[arg1].type) { case 1: - func_80062C74(arg0, arg1, arg2, arg3); + func_80062C74(arg0, arg1, playerId, arg3); break; case 3: - func_80064184(arg0, arg1, arg2, arg3); + func_80064184(arg0, arg1, playerId, arg3); break; case 5: - func_800630C0(arg0, arg1, arg2, arg3); + set_oob_splash_particle_position(arg0, arg1, playerId, arg3); break; case 6: - func_800631A8(arg0, arg1, arg2, arg3); + func_800631A8(arg0, arg1, playerId, arg3); break; case 7: - func_80063268(arg0, arg1, arg2, arg3); + func_80063268(arg0, arg1, playerId, arg3); break; } } else { - if ((arg0->unk_044 & 0x200) && (arg0->type & 0x4000)) { - func_80061224(arg0, arg1, sp20, arg2, arg3); + if ((arg0->kartProps & BECOME_INVISIBLE) && (arg0->type & DRIVING_SPINOUT)) { + func_80061224(arg0, arg1, sp20, playerId, arg3); return; - } else if (((arg0->effects & 0x40000000) == 0x40000000) && (arg0->unk_0B0 < 0x32)) { - func_80061094(arg0, arg1, sp20, arg2, arg3); + } else if (((arg0->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && (arg0->unk_0B0 < 0x32)) { + func_80061094(arg0, arg1, sp20, playerId, arg3); return; - } else if ((arg0->type & 0x4000) == 0x4000) { - if ((arg0->unk_0DE & 8) == 8) { - func_80060F50(arg0, arg1, sp20, arg2, arg3); + } else if ((arg0->type & PLAYER_HUMAN) == PLAYER_HUMAN) { + if ((arg0->oobProps & UNDER_OOB_LEVEL) == UNDER_OOB_LEVEL) { + func_80060F50(arg0, arg1, sp20, playerId, arg3); return; - } else if ((arg0->unk_0DE & 2) || (arg0->unk_0DE & 1)) { - func_80060B14(arg0, arg1, sp20, arg2, arg3); + } else if ((arg0->oobProps & PASS_OOB_OR_FLUID_LEVEL) || (arg0->oobProps & UNDER_OOB_OR_FLUID_LEVEL)) { + func_80060B14(arg0, arg1, sp20, playerId, arg3); return; } } switch (gActiveScreenMode) { case SCREEN_MODE_1P: - if (((arg0->effects & 0x04000000) != 0x04000000) && ((arg0->effects & 0x400) != 0x400) && - ((arg0->effects & 0x01000000) != 0x01000000)) { - if (((arg0->unk_0CA & 2) != 2) && ((arg0->unk_0CA & 0x10) != 0x10) && !(arg0->unk_0CA & 0x100)) { - func_80060504(arg0, arg1, sp20, arg2, arg3); + if (((arg0->effects & SQUISH_EFFECT) != SQUISH_EFFECT) && + ((arg0->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && + ((arg0->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT)) { + if (((arg0->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU) && + ((arg0->lakituProps & FRIGID_EFFECT) != FRIGID_EFFECT) && + !(arg0->lakituProps & WENT_OVER_OOB)) { + func_80060504(arg0, arg1, sp20, playerId, arg3); } } break; @@ -6461,10 +6461,13 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) { case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: case SCREEN_MODE_3P_4P_SPLITSCREEN: - if (((arg0->type & 0x4000) != 0) && ((arg0->effects & 0x04000000) != 0x04000000) && - ((arg0->effects & 0x400) != 0x400) && ((arg0->effects & 0x01000000) != 0x01000000)) { - if (((arg0->unk_0CA & 2) != 2) && ((arg0->unk_0CA & 0x10) != 0x10) && !(arg0->unk_0CA & 0x100)) { - func_80060504(arg0, arg1, sp20, arg2, arg3); + if (((arg0->type & PLAYER_HUMAN) != 0) && ((arg0->effects & SQUISH_EFFECT) != SQUISH_EFFECT) && + ((arg0->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && + ((arg0->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT)) { + if (((arg0->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU) && + ((arg0->lakituProps & FRIGID_EFFECT) != FRIGID_EFFECT) && + !(arg0->lakituProps & WENT_OVER_OOB)) { + func_80060504(arg0, arg1, sp20, playerId, arg3); } } break; @@ -6472,56 +6475,56 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) { } } -void func_8006D194(Player* player, s8 arg1, s8 arg2) { - if (player->unk_258[0x14].unk_01C == 1) { - switch (player->unk_258[0x14].unk_012) { +void func_8006D194(Player* player, s8 playerIndex, s8 arg2) { + if (player->particlePool2[0].isAlive == 1) { + switch (player->particlePool2[0].type) { case 2: - func_80064DEC(player, arg1, arg2, 0); + func_80064DEC(player, playerIndex, arg2, 0); break; case 3: - func_800650FC(player, arg1, arg2, 0); + func_800650FC(player, playerIndex, arg2, 0); break; case 4: - func_80064EA4(player, arg1, arg2, 0); + func_80064EA4(player, playerIndex, arg2, 0); break; case 5: - func_80064F88(player, arg1, arg2, 0); + func_80064F88(player, playerIndex, arg2, 0); break; case 6: - func_80065030(player, arg1, arg2, 0); + func_80065030(player, playerIndex, arg2, 0); break; } } else { - if ((player->unk_0B6 & 0x40) == 0x40) { - func_800628C0(player, arg1, arg2, 0); + if ((player->kartGraphics & CRASH) == CRASH) { + func_800628C0(player, playerIndex, arg2, 0); } - if ((player->unk_0B6 & 0x800) == 0x800) { - func_80062968(player, arg1, arg2, 0); + if ((player->kartGraphics & BOING) == BOING) { + func_80062968(player, playerIndex, arg2, 0); } - if ((player->unk_0B6 & 0x1000) == 0x1000) { - func_80062914(player, arg1, arg2, 0); + if ((player->kartGraphics & EXPLOSION) == EXPLOSION) { + func_80062914(player, playerIndex, arg2, 0); } - if ((player->unk_0B6 & 0x80) == 0x80) { - func_80062A18(player, arg1, arg2, 0); + if ((player->kartGraphics & WHIRRR) == WHIRRR) { + func_80062A18(player, playerIndex, arg2, 0); } - if ((player->unk_0B6 & 0x100) == 0x100) { - func_800629BC(player, arg1, arg2, 0); + if ((player->kartGraphics & POOMP) == POOMP) { + func_800629BC(player, playerIndex, arg2, 0); } } - if (player->unk_258[0x15].unk_01C == 1) { - if (player->unk_258[0x15].unk_012 == 5) { - func_800651F4(player, arg1, arg2, 1); + if (player->particlePool2[1].isAlive == 1) { + if (player->particlePool2[1].type == 5) { + func_800651F4(player, playerIndex, arg2, 1); } - } else if ((player->unk_0B6 & 0x20) == 0x20) { - func_80062AA8(player, arg1, arg2, 1); + } else if ((player->kartGraphics & WHISTLE) == WHISTLE) { + func_80062AA8(player, playerIndex, arg2, 1); } } void func_8006D474(Player* player, s8 playerId, s8 screenId) { s16 var_s2; - if ((player->unk_002 & (8 << (screenId * 4))) == (8 << (screenId * 4))) { + if ((player->unk_002 & (SIDE_OF_KART << (screenId * 4))) == (SIDE_OF_KART << (screenId * 4))) { for (var_s2 = 0; var_s2 < 10; var_s2++) { - switch (player->unk_258[var_s2].unk_012) { + switch (player->particlePool0[var_s2].type) { case 1: if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { if (screenId == playerId) { @@ -6541,20 +6544,22 @@ void func_8006D474(Player* player, s8 playerId, s8 screenId) { } break; } - switch (player->unk_258[var_s2 + 30].unk_012) { + switch (player->particlePool3[var_s2].type) { case 1: case 9: if (gActiveScreenMode == SCREEN_MODE_1P) { - func_800691B8(player, playerId, var_s2, screenId); + render_actor_bonk_particles(player, playerId, var_s2, screenId); } else if (screenId == playerId) { - func_800691B8(player, playerId, var_s2, screenId); + render_actor_bonk_particles(player, playerId, var_s2, screenId); } break; case 2: if (gActiveScreenMode == SCREEN_MODE_1P) { - func_800696CC(player, playerId, var_s2, screenId, player->unk_258[var_s2 + 30].unk_00C); + render_wall_bonk_star_particles(player, playerId, var_s2, screenId, + player->particlePool3[var_s2].scale); } else if (screenId == playerId) { - func_800696CC(player, playerId, var_s2, screenId, player->unk_258[var_s2 + 30].unk_00C); + render_wall_bonk_star_particles(player, playerId, var_s2, screenId, + player->particlePool3[var_s2].scale); } break; case 3: @@ -6594,32 +6599,32 @@ void func_8006D474(Player* player, s8 playerId, s8 screenId) { break; case 8: if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80067604(player, playerId, var_s2, screenId); + render_player_boost_spark_particles(player, playerId, var_s2, screenId); } else if (screenId == playerId) { - func_80067604(player, playerId, var_s2, screenId); + render_player_boost_spark_particles(player, playerId, var_s2, screenId); } break; } - switch (player->unk_258[var_s2 + 10].unk_012) { - case 1: + switch (player->particlePool1[var_s2].type) { + case DRIFT_PARTICLE: if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { if (screenId == playerId) { - func_80065AB0(player, playerId, var_s2, screenId); + render_player_drift_particles(player, playerId, var_s2, screenId); } } else { - func_80065AB0(player, playerId, var_s2, screenId); + render_player_drift_particles(player, playerId, var_s2, screenId); } break; - case 2: - case 3: + case GROUND_PARTICLE: + case GRASS_PARTICLE: case 4: case 5: if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { if (screenId == playerId) { - func_80065F0C(player, playerId, var_s2, screenId); + render_player_ground_particles(player, playerId, var_s2, screenId); } } else { - func_80065F0C(player, playerId, var_s2, screenId); + render_player_ground_particles(player, playerId, var_s2, screenId); } break; case 9: @@ -6643,20 +6648,20 @@ void func_8006D474(Player* player, s8 playerId, s8 screenId) { } } } - if ((gModeSelection == BATTLE) && (player->unk_002 & (2 << (screenId * 4)))) { - func_8006BA94(player, playerId, screenId); + if ((gModeSelection == BATTLE) && (player->unk_002 & (UNK_002_UNKNOWN_0x2 << (screenId * 4)))) { + render_remaining_battle_balloons(player, playerId, screenId); } } -void func_8006DC54(Player* player, s8 arg1, s8 arg2) { +void func_8006DC54(Player* player, s8 playerIndex, s8 screenId) { s16 i; s32 bitwiseMask; - bitwiseMask = 8 << (arg2 * 4); + bitwiseMask = SIDE_OF_KART << (screenId * 4); if (bitwiseMask == (player->unk_002 & bitwiseMask)) { for (i = 0; i < 10; i++) { - if (player->unk_258[i].unk_012 == 7) { - func_800658A0(player, arg1, i, arg2); + if (player->particlePool0[i].type == 7) { + func_800658A0(player, playerIndex, i, screenId); } } } @@ -6666,10 +6671,10 @@ void func_8006DD3C(Player* arg0, s8 arg1, s8 arg2) { s16 temp_s0; s32 temp_v0; - temp_v0 = 8 << (arg2 * 4); + temp_v0 = SIDE_OF_KART << (arg2 * 4); if (temp_v0 == (arg0->unk_002 & temp_v0)) { for (temp_s0 = 0; temp_s0 < 10; ++temp_s0) { - temp_v0 = arg0->unk_258[temp_s0].unk_012; + temp_v0 = arg0->particlePool0[temp_s0].type; if (temp_v0 != 3) { if (temp_v0 == 5) { func_8006A280(arg0, arg1, temp_s0, arg2); @@ -6683,27 +6688,27 @@ void func_8006DD3C(Player* arg0, s8 arg1, s8 arg2) { } } - if (((arg0->type & 0x4000) == 0x4000) && (arg2 == arg1)) { - switch (arg0->unk_258[20].unk_012) { + if (((arg0->type & PLAYER_HUMAN) == PLAYER_HUMAN) && (arg2 == arg1)) { + switch (arg0->particlePool2[0].type) { case 2: - func_80068310(arg0, arg1, arg0->unk_258[20].unk_00C, arg2, 0); + render_player_onomatopoeia_crash(arg0, arg1, arg0->particlePool2[0].scale, arg2, 0); break; case 3: - func_80067964(arg0, arg1, arg0->unk_258[20].unk_00C, arg2, 0); + render_player_onomatopoeia_whrrrr(arg0, arg1, arg0->particlePool2[0].scale, arg2, 0); break; case 4: - func_80068724(arg0, arg1, arg0->unk_258[20].unk_00C, arg2, 0); + func_80068724(arg0, arg1, arg0->particlePool2[0].scale, arg2, 0); break; case 5: - func_80068AA4(arg0, arg1, arg0->unk_258[20].unk_00C, arg2, 0); + render_player_onomatopoeia_boing(arg0, arg1, arg0->particlePool2[0].scale, arg2, 0); break; case 6: - func_80068DA0(arg0, arg1, arg0->unk_258[20].unk_00C, arg2, 0); + render_player_onomatopoeia_pomp(arg0, arg1, arg0->particlePool2[0].scale, arg2, 0); break; } - if (arg0->unk_258[21].unk_012 == 5) { - func_80067D3C(arg0, arg2, D_8018D480, 1, 1.6f, 0xFFFFFF); - func_8006801C(arg0, arg2, D_8018D484, 1, 1.6f, 0xFF); + if (arg0->particlePool2[1].type == 5) { + render_player_speech_bubble(arg0, arg2, D_8018D480, 1, 1.6f, 0xFFFFFF); + render_music_note(arg0, arg2, D_8018D484, 1, 1.6f, 0xFF); } } } @@ -6714,40 +6719,40 @@ void func_8006E058(void) { case SCREEN_MODE_1P: switch (gModeSelection) { case GRAND_PRIX: - func_8006E420(gPlayerOne, 0, 0); - func_8006E420(gPlayerTwo, 1, 0); - func_8006E420(gPlayerThree, 2, 0); - func_8006E420(gPlayerFour, 3, 0); - func_8006E420(gPlayerFive, 4, 0); - func_8006E420(gPlayerSix, 5, 0); - func_8006E420(gPlayerSeven, 6, 0); - func_8006E420(gPlayerEight, 7, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); + func_8006E420(gPlayerThree, PLAYER_THREE, 0); + func_8006E420(gPlayerFour, PLAYER_FOUR, 0); + func_8006E420(gPlayerFive, PLAYER_FIVE, 0); + func_8006E420(gPlayerSix, PLAYER_SIX, 0); + func_8006E420(gPlayerSeven, PLAYER_SEVEN, 0); + func_8006E420(gPlayerEight, PLAYER_EIGHT, 0); break; case TIME_TRIALS: - func_8006E420(gPlayerOne, 0, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); - if ((gPlayerTwo->type & 0x100) == 0x100) { - func_8006E420(gPlayerTwo, 1, 0); + if ((gPlayerTwo->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); } - if ((gPlayerThree->type & 0x100) == 0x100) { - func_8006E420(gPlayerThree, 2, 0); + if ((gPlayerThree->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { + func_8006E420(gPlayerThree, PLAYER_THREE, 0); break; } break; case VERSUS: case BATTLE: - func_8006E420(gPlayerOne, 0, 0); - func_8006E420(gPlayerTwo, 1, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); if (gPlayerCountSelection1 >= 3) { - func_8006E420(gPlayerThree, 2, 0); + func_8006E420(gPlayerThree, PLAYER_THREE, 0); } if (gPlayerCountSelection1 == 4) { - func_8006E420(gPlayerFour, 3, 0); + func_8006E420(gPlayerFour, PLAYER_FOUR, 0); break; } @@ -6759,27 +6764,27 @@ void func_8006E058(void) { case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: switch (gModeSelection) { case GRAND_PRIX: - func_8006E420(gPlayerOne, 0, 0); - func_8006E420(gPlayerTwo, 1, 0); - func_8006E420(gPlayerThree, 2, 0); - func_8006E420(gPlayerFour, 3, 0); - func_8006E420(gPlayerFive, 4, 0); - func_8006E420(gPlayerSix, 5, 0); - func_8006E420(gPlayerSeven, 6, 0); - func_8006E420(gPlayerEight, 7, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); + func_8006E420(gPlayerThree, PLAYER_THREE, 0); + func_8006E420(gPlayerFour, PLAYER_FOUR, 0); + func_8006E420(gPlayerFive, PLAYER_FIVE, 0); + func_8006E420(gPlayerSix, PLAYER_SIX, 0); + func_8006E420(gPlayerSeven, PLAYER_SEVEN, 0); + func_8006E420(gPlayerEight, PLAYER_EIGHT, 0); break; case VERSUS: case BATTLE: - func_8006E420(gPlayerOne, 0, 0); - func_8006E420(gPlayerTwo, 1, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); break; case TIME_TRIALS: - func_8006E420(gPlayerOne, 0, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); - if ((gPlayerTwo->type & 0x8000) == 0x8000) { - func_8006E420(gPlayerTwo, 1, 0); + if ((gPlayerTwo->type & PLAYER_EXISTS) == PLAYER_EXISTS) { + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); break; } @@ -6789,12 +6794,12 @@ void func_8006E058(void) { break; case SCREEN_MODE_3P_4P_SPLITSCREEN: if ((VERSUS == gModeSelection) || (BATTLE == gModeSelection)) { - func_8006E420(gPlayerOne, 0, 0); - func_8006E420(gPlayerTwo, 1, 0); - func_8006E420(gPlayerThree, 2, 0); + func_8006E420(gPlayerOne, PLAYER_ONE, 0); + func_8006E420(gPlayerTwo, PLAYER_TWO, 0); + func_8006E420(gPlayerThree, PLAYER_THREE, 0); if (gPlayerCountSelection1 == 4) { - func_8006E420(gPlayerFour, 3, 0); + func_8006E420(gPlayerFour, PLAYER_FOUR, 0); } } @@ -6802,24 +6807,25 @@ void func_8006E058(void) { } } -void func_8006E420(Player* player, s8 arg1, s8 arg2) { +void func_8006E420(Player* player, s8 playerIndex, s8 arg2) { + // arg2 is always 0 s16 temp_s0; if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - func_8006D194(player, arg1, arg2); + func_8006D194(player, playerIndex, arg2); } for (temp_s0 = 0; temp_s0 < 10; ++temp_s0) { - func_8006CEC0(player, temp_s0, arg1, arg2); + func_8006CEC0(player, temp_s0, playerIndex, arg2); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) || (gGamestate == ENDING)) { - func_8006C9B8(player, temp_s0, arg1, arg2); + func_8006C9B8(player, temp_s0, playerIndex, arg2); } - func_8006C6AC(player, temp_s0, arg1, arg2); + func_8006C6AC(player, temp_s0, playerIndex, arg2); } if (gModeSelection == BATTLE) { - func_8006B9CC(player, arg1); + update_player_balloons_position(player, playerIndex); } } } @@ -6837,42 +6843,42 @@ void render_kart_particle_on_screen_one(Player* player, s8 playerId, s8 screenId } } -void render_kart_particle_on_screen_two(Player* player, s8 arg1, s8 arg2) { +void render_kart_particle_on_screen_two(Player* player, s8 playerIndex, s8 screenId) { if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - if (arg1 == arg2) { - func_8006D474(player, arg1, arg2); + if (playerIndex == screenId) { + func_8006D474(player, playerIndex, screenId); } } else { - func_8006D474(player, arg1, arg2); + func_8006D474(player, playerIndex, screenId); } - func_8006DC54(player, arg1, arg2); + func_8006DC54(player, playerIndex, screenId); } } -void render_kart_particle_on_screen_three(Player* player, s8 arg1, s8 arg2) { +void render_kart_particle_on_screen_three(Player* player, s8 playerIndex, s8 screenId) { if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - if (arg1 == arg2) { - func_8006D474(player, arg1, arg2); + if (playerIndex == screenId) { + func_8006D474(player, playerIndex, screenId); } } else { - func_8006D474(player, arg1, arg2); + func_8006D474(player, playerIndex, screenId); } - func_8006DC54(player, arg1, arg2); + func_8006DC54(player, playerIndex, screenId); } } -void render_kart_particle_on_screen_four(Player* player, s8 arg1, s8 arg2) { +void render_kart_particle_on_screen_four(Player* player, s8 playerIndex, s8 screenId) { if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - if (arg1 == arg2) { - func_8006D474(player, arg1, arg2); + if (playerIndex == screenId) { + func_8006D474(player, playerIndex, screenId); } } else { - func_8006D474(player, arg1, arg2); + func_8006D474(player, playerIndex, screenId); } - func_8006DC54(player, arg1, arg2); + func_8006DC54(player, playerIndex, screenId); } } diff --git a/src/code_80057C60.h b/src/code_80057C60.h index 826c91d025..631b3a72e6 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -17,6 +17,8 @@ #define RENDER_SCREEN_MODE_3P_4P_PLAYER_THREE PLAYER_THREE + SCREEN_MODE_3P_4P_SPLITSCREEN + 5 #define RENDER_SCREEN_MODE_3P_4P_PLAYER_FOUR PLAYER_FOUR + SCREEN_MODE_3P_4P_SPLITSCREEN + 5 +#define RGB32(r, g, b) ((r << 16) | (g << 8) | (b)) + typedef struct { char unk_00[0x4]; Vec3f unk_04; @@ -116,16 +118,16 @@ void func_8005D18C(void); void func_8005D1F4(s32); void func_8005D290(void); -void func_8005D6C0(Player*); -void func_8005D794(Player*, UnkPlayerStruct258*, f32, f32, f32, s8, s8); -s32 func_8005D7D8(UnkPlayerStruct258*, s8, f32); -s32 func_8005D800(UnkPlayerStruct258*, s32, s16); -s32 func_8005D82C(UnkPlayerStruct258*, s32, s16); -void func_8005D898(Player*, s16, s32, s8, s8); -void func_8005DA30(Player*, s16, s32, s8, s8); +void reset_player_particle_pool(Player*); +void set_particle_position_and_rotation(Player*, Particle*, f32, f32, f32, s8, s8); +s32 init_particle_player(Particle*, s8, f32); +s32 set_particle_colour(Particle*, s32, s16); +s32 set_particle_colour_randomly_varried(Particle*, s32, s16); +void set_drift_particles(Player*, s16, s32, s8, s8); +void check_drift_particles_setup_valid(Player*, s16, s32, s8, s8); void func_8005DAD0(void); -void func_8005DAD8(UnkPlayerStruct258*, s16, s16, s16); -void func_8005DAF4(Player*, s16, s32, s8, s8); +void func_8005DAD8(Particle*, s16, s16, s16); +void setup_tyre_particles(Player*, s16, s32, s8, s8); void func_8005EA94(Player*, s16, s32, s8, s8); void func_8005ED48(Player*, s16, s32, s8, s8); @@ -150,7 +152,7 @@ void func_80061D4C(Player*, s16, s32, s8, s8); void func_80061EF4(Player*, s16, s32, s8, s8); void func_800621BC(Player*, s16, s32, s8, s8); -void func_80062484(Player*, UnkPlayerStruct258*, s32); +void func_80062484(Player*, Particle*, s32); void func_800624D8(Player*, s32, s32, s8, s8); void func_800628C0(Player*, s8, s8, s8); void func_80062914(Player*, s8, s8, s8); @@ -162,7 +164,7 @@ void func_80062B18(f32*, f32*, f32*, f32, f32, f32, u16, u16); void func_80062C74(Player*, s16, s32, s32); void func_80062F98(Player*, s16, s8, s8); -void func_800630C0(Player*, s16, s8, s8); +void set_oob_splash_particle_position(Player*, s16, s8, s8); void func_800631A8(Player*, s16, s8, s8); void func_80063268(Player*, s16, s8, s8); void func_80063408(Player*, s16, s8, s8); @@ -192,43 +194,43 @@ void func_800651F4(Player*, s8, s8, s8); void func_800652D4(Vec3f, Vec3s, f32); void func_8006538C(Player*, s8, s16, s8); void func_800658A0(Player*, s8, s16, s8); -void func_80065AB0(Player*, s8, s16, s8); -void func_80065F0C(Player*, s8, s16, s8); +void render_player_drift_particles(Player*, s8, s16, s8); +void render_player_ground_particles(Player*, s8, s16, s8); void func_800664E0(Player*, s8, s16, s8); void func_80066998(Player*, s8, s16, s8); void func_80066BAC(Player*, s8, s16, s8); void func_80067280(Player*, s8, s16, s8); -void func_80067604(Player*, s8, s16, s8); -void func_80067964(Player*, s8, f32, s8, s8); -void func_80067D3C(Player*, s8, u8*, s8, f32, s32); +void render_player_boost_spark_particles(Player*, s8, s16, s8); +void render_player_onomatopoeia_whrrrr(Player*, s8, f32, s8, s8); +void render_player_speech_bubble(Player*, s8, u8*, s8, f32, s32); -void func_8006801C(Player*, s8, u8*, s8, f32, s32); -void func_80068310(Player*, s8, f32, s8, s8); +void render_music_note(Player*, s8, u8*, s8, f32, s32); +void render_player_onomatopoeia_crash(Player*, s8, f32, s8, s8); void func_80068724(Player*, s8, f32, s8, s8); -void func_80068AA4(Player*, s8, f32, s8, s8); -void func_80068DA0(Player*, s8, f32, s8, s8); +void render_player_onomatopoeia_boing(Player*, s8, f32, s8, s8); +void render_player_onomatopoeia_pomp(Player*, s8, f32, s8, s8); -void func_800691B8(Player*, s8, s16, s8); +void render_actor_bonk_particles(Player*, s8, s16, s8); void func_80069444(Player*, s8, s16, s8); -void func_800696CC(Player*, s8, s16, s8, f32); +void render_wall_bonk_star_particles(Player*, s8, s16, s8, f32); void func_80069938(Player*, s8, s16, s8); void func_80069BA8(Player*, s8, s16, s8); void func_80069DB8(Player*, s8, s16, s8); void func_8006A01C(Player*, s8, s16, s8); void func_8006A280(Player*, s8, s16, s8); -void func_8006A50C(Player*, f32, f32, s8, s8, s16); -void func_8006A7C0(Player*, f32, f32, s8, s8); +void init_balloon(Player*, f32, f32, s8, s8, s16); +void update_player_one_balloon_position(Player*, f32, f32, s8, s8); void render_battle_balloon(Player*, s8, s16, s8); -void func_8006B7E4(Player*, s8); -void func_8006B87C(Player*, s8); -void func_8006B8B4(Player*, s8); -void func_8006B974(s32, s8, s8); -void func_8006B9CC(Player*, s8); -void func_8006BA94(Player*, s8, s8); +void init_all_player_balloons(Player*, s8); +void clear_all_player_balloons(Player*, s8); +void pop_player_balloon(Player*, s8); +void set_player_balloon_to_gone(s32, s8, s8); +void update_player_balloons_position(Player*, s8); +void render_remaining_battle_balloons(Player*, s8, s8); void render_balloon(Vec3f, f32, s16, s16); void func_8006C0C8(Vec3f, f32, s32, s16); @@ -413,7 +415,7 @@ extern Vec3su D_80183E98; extern u8 D_80183FA8[4][0x2000]; // extern s32 indexObjectList3[]; -> objects.h -extern u8* D_8018C028; +extern u8* gLakituTexturePtr; // extern s32 indexObjectList4[]; -> objects.h // extern Collision D_8018C0B0[]; -> objects.h // extern s32 gObjectParticle1[]; -> objects.h @@ -454,10 +456,10 @@ extern s16 D_8018CFC0; extern s16 D_8018CFC8; extern s16 D_8018CFD0; extern s16 D_8018CFD8; -extern s8 D_8018CFAC[]; -extern s8 D_8018CFB4[]; -extern s8 D_8018CFBC[]; -extern s8 D_8018CFC4[]; +extern u8 D_8018CFAC[]; +extern u8 D_8018CFB4[]; +extern u8 D_8018CFBC[]; +extern u8 D_8018CFC4[]; extern s16 D_8018CFE0; extern f32 D_8018CFE4; extern s16 D_8018CFE8; @@ -521,7 +523,7 @@ extern s32 D_8018D1D4; // extern s32 D_8018D1D8; -> objects.h extern s32 D_8018D1DC; -extern u8* D_8018D1E0; +extern u8* gGameLogoAddress; extern f32 D_8018D1E8; extern s32 D_8018D1EC; // extern s32 D_8018D1F0; -> objects.h @@ -544,18 +546,18 @@ extern s32 D_8018D22C; extern s32 D_8018D240; extern u8* D_8018D248[]; -extern f32 D_8018D2A0; +extern f32 gMiniMapMarkerScale; extern s32 D_8018D2A4; extern s32 D_8018D2AC; extern s16 D_8018D2B0; extern s32 D_8018D2B4; extern s16 D_8018D2B8; extern s32 D_8018D2BC; -extern s16 D_8018D2C0[]; +extern s16 gMiniMapFinishLineX[]; extern s32 D_8018D2C8[]; -extern s16 D_8018D2D8[]; -extern s16 D_8018D2E0; -extern s16 D_8018D2E8; +extern s16 gMiniMapFinishLineY[]; +extern s16 gMiniMapX; +extern s16 gMiniMapY; extern s16 D_8018D2F0; extern s16 D_8018D2F8; extern u16 D_8018D300; @@ -606,30 +608,30 @@ extern u8* D_8018D464; extern u8* D_8018D468; extern u8* D_8018D46C; extern u8* D_8018D470; -extern u8* D_8018D474; +extern u8* gLoadedTextureKartShadow; extern u8* D_8018D478; extern u8* D_8018D480; extern u8* D_8018D484; extern u8* D_8018D488; extern u8* D_8018D48C; extern u8* D_8018D490; -extern u8* D_8018D494; -extern u8* D_8018D498; +extern u8* gLoadedGroundDust; +extern u8* gLoadedGrassParticle; extern u8* D_8018D49C; extern u8* D_8018D4A0; -extern u8* D_8018D4A4; -extern u8* D_8018D4A8; -extern u8* D_8018D4AC; -extern u8* D_8018D4B0; -extern u8* D_8018D4B4; -extern u8* D_8018D4B8; +extern u8* gTextureLoadedOnomatopoeiaPoomp1; +extern u8* gTextureLoadedOnomatopoeiaPoomp2; +extern u8* gTextureLoadedOnomatopoeiaWhrrrr1; +extern u8* gTextureLoadedOnomatopoeiaWhrrrr2; +extern u8* gTextureLoadedOnomatopoeiaCrash1; +extern u8* gTextureLoadedOnomatopoeiaCrash2; extern u8* D_8018D4BC; extern u8* D_8018D4C0; -extern u8* D_8018D4C4; -extern u8* D_8018D4C8; -extern Vec3f D_8018D4D0[]; -extern Vec3f D_8018D530[]; -extern Vec3f D_8018D590[]; +extern u8* gTextureLoadedLightningBolt0; +extern u8* gTextureLoadedLightningBolt1; +extern Vec3f gPlayerBalloonPosX[]; +extern Vec3f gPlayerBalloonPosY[]; +extern Vec3f gPlayerBalloonPosZ[]; extern u16 gPlayerBalloonStatus[8][3]; extern Vec3s D_8018D620[]; extern Vec3f D_8018D650[]; @@ -642,10 +644,10 @@ extern Vec3s D_8018D7D0[]; extern Vec3s D_8018D800[]; extern Vec3s D_8018D830[]; -extern Vec3s D_8018D860[]; +extern Vec3s gPlayerBalloonRotation[]; // Sprite rotation for each player balloon extern Vec3s D_8018D890[]; extern s16 gPlayerBalloonCount[]; // D_8018D8C0 -extern Vec3s D_8018D8D0[]; +extern Vec3s gPlayerBalloonDepartingTimer[]; /** @endcond */ diff --git a/src/code_80057C60_var.c b/src/code_80057C60_var.c index 494ce899fc..72ace331af 100644 --- a/src/code_80057C60_var.c +++ b/src/code_80057C60_var.c @@ -68,7 +68,7 @@ s8 D_8018D1B8[NUM_GROUP3_MOLES]; s32 D_8018D1C4; /** * These seem to be limits on different object types in Moo Moo Farm - * See init_course_object in code_8006E9C0.c + * See init_course_objects in code_8006E9C0.c * Maybe max number of active moles in a given group of moles? */ s32 D_8018D1C8; @@ -77,7 +77,7 @@ s32 D_8018D1D0; s32 D_8018D1D4; s32 D_8018D1D8; s32 D_8018D1DC; -u8* D_8018D1E0; +u8* gGameLogoAddress; UNUSED s32 D_8018D1E4; f32 D_8018D1E8; s32 D_8018D1EC; @@ -108,7 +108,7 @@ s8 D_8018D230; UNUSED s32 D_8018D238[2]; s32 D_8018D240; u8* D_8018D248[22]; -f32 D_8018D2A0; +f32 gMiniMapMarkerScale; s32 D_8018D2A4; UNUSED s32 D_8018D2A8; s32 D_8018D2AC; @@ -116,12 +116,12 @@ s16 D_8018D2B0; s32 D_8018D2B4; s16 D_8018D2B8; s32 D_8018D2BC; -s16 D_8018D2C0[4]; +s16 gMiniMapFinishLineX[4]; s32 D_8018D2C8[4]; -s16 D_8018D2D8[4]; -s16 D_8018D2E0; +s16 gMiniMapFinishLineY[4]; +s16 gMiniMapX; UNUSED s32 D_8018D2E4; -s16 D_8018D2E8; +s16 gMiniMapY; UNUSED s32 D_8018D2EC; s16 D_8018D2F0; UNUSED s32 D_8018D2F4; @@ -191,7 +191,7 @@ u8* D_8018D464; u8* D_8018D468; u8* D_8018D46C; u8* D_8018D470; -u8* D_8018D474; +u8* gLoadedTextureKartShadow; u8* D_8018D478; UNUSED u8* D_8018D47C; u8* D_8018D480; @@ -199,23 +199,23 @@ u8* D_8018D484; u8* D_8018D488; u8* D_8018D48C; u8* D_8018D490; -u8* D_8018D494; -u8* D_8018D498; +u8* gLoadedGroundDust; +u8* gLoadedGrassParticle; u8* D_8018D49C; u8* D_8018D4A0; -u8* D_8018D4A4; -u8* D_8018D4A8; -u8* D_8018D4AC; -u8* D_8018D4B0; -u8* D_8018D4B4; -u8* D_8018D4B8; +u8* gTextureLoadedOnomatopoeiaPoomp1; +u8* gTextureLoadedOnomatopoeiaPoomp2; +u8* gTextureLoadedOnomatopoeiaWhrrrr1; +u8* gTextureLoadedOnomatopoeiaWhrrrr2; +u8* gTextureLoadedOnomatopoeiaCrash1; +u8* gTextureLoadedOnomatopoeiaCrash2; u8* D_8018D4BC; u8* D_8018D4C0; -u8* D_8018D4C4; -u8* D_8018D4C8; -Vec3f D_8018D4D0[8]; -Vec3f D_8018D530[8]; -Vec3f D_8018D590[8]; +u8* gTextureLoadedLightningBolt0; +u8* gTextureLoadedLightningBolt1; +Vec3f gPlayerBalloonPosX[8]; +Vec3f gPlayerBalloonPosY[8]; +Vec3f gPlayerBalloonPosZ[8]; u16 gPlayerBalloonStatus[8][3]; Vec3s D_8018D620[8]; Vec3f D_8018D650[8]; @@ -227,7 +227,7 @@ Vec3s D_8018D7D0[8]; Vec3s D_8018D800[8]; Vec3s D_8018D830[8]; -Vec3s D_8018D860[8]; +Vec3s gPlayerBalloonRotation[8]; Vec3s D_8018D890[8]; s16 gPlayerBalloonCount[8]; -Vec3s D_8018D8D0[8]; +Vec3s gPlayerBalloonDepartingTimer[8]; diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index c2c8302172..a7b06c6f20 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -5,7 +5,7 @@ #include #include "code_800029B0.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "code_80057C60.h" #include "code_8006E9C0.h" #include "code_80086E70.h" @@ -22,7 +22,7 @@ #include "menus.h" #include "data/other_textures.h" #include "render_objects.h" -#include "code_80091750.h" +#include "menu_items.h" #include "src/data/some_data.h" #include "effects.h" @@ -111,7 +111,10 @@ void clear_object_list() { objectListSize = -1; } -u8* func_8006ED94(u8* devAddr, u8* baseAddress, u32 size, u32 offset) { +/** + * Dma's mario kart 64 logo and course outline textures. + */ +u8* dma_copy_base_misc_textures(u8* devAddr, u8* baseAddress, u32 size, u32 offset) { u8** tempAddress; u8* address; address = baseAddress + offset; @@ -126,8 +129,9 @@ u8* func_8006ED94(u8* devAddr, u8* baseAddress, u32 size, u32 offset) { return baseAddress; } -void func_8006EE44(void) { - D_8018D1E0 = func_8006ED94((u8*) &gTextureLogoMarioKart64, (u8*) D_8018D9B0, 0x79E1, 0x20000); +void load_mario_kart_64_logo(void) { + gGameLogoAddress = + dma_copy_base_misc_textures((u8*) &logo_mario_kart_64, (u8*) gMenuTextureBuffer, 0x79E1, 0x20000); } // Some kind of initalization for the Item Window part of the HUD @@ -161,21 +165,21 @@ void func_8006EF60(void) { s16 huh; u8* wut; - wut = D_8018D9B4 + 0xFFFF0000; + wut = (u8*) &gMenuCompressedBuffer[0x3FFFC000]; // clang-format off // God forgive me for my sins... - huh = 0x14; if (0) {} for (i = 0; i < huh; i++) { D_8018D248[i] = func_8006ED94(gCourseOutlineTextures[i], wut, D_800E5520[i], D_800E5520[i]); wut += D_800E5520[i]; } + huh = 0x14; if (0) {} for (i = 0; i < huh; i++) { D_8018D248[i] = dma_copy_base_misc_textures(gCourseOutlineTextures[i], wut, D_800E5520[i], D_800E5520[i]); wut += D_800E5520[i]; } // clang-format on } -void func_8006F008(void) { +void track_minimap_settings(void) { D_801655C8 = 0; xOrientation = 1.0f; if (gIsMirrorMode != 0) { xOrientation = -1.0f; } - D_8018D2C0[0] = 257; - D_8018D2D8[0] = 170; + gMiniMapFinishLineX[0] = 257; + gMiniMapFinishLineY[0] = 170; D_8018D300 = 255; D_8018D308 = 255; D_8018D310 = 255; @@ -183,172 +187,176 @@ void func_8006F008(void) { if (gCurrentCourseId < NUM_COURSES - 1) { func_8006EEE8((s32) gCurrentCourseId); } +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: D_8018D220 = (void*) dma_textures(gTextureExhaust5, 0x443, 0x1000); - D_8018D2A0 = 0.022f; - D_8018D2E0 = 6; - D_8018D2E8 = 28; - D_8018D2C0[0] = 260; - D_8018D2D8[0] = 170; + gMiniMapMarkerScale = 0.022f; + gMiniMapX = 6; + gMiniMapY = 28; + gMiniMapFinishLineX[0] = 260; + gMiniMapFinishLineY[0] = 170; D_80165718 = 0; D_80165720 = 5; D_80165728 = -240; break; case COURSE_CHOCO_MOUNTAIN: - D_8018D2A0 = 0.022f; - D_8018D2C0[0] = 265; - D_8018D2E0 = 19; - D_8018D2E8 = 37; + gMiniMapMarkerScale = 0.022f; + gMiniMapFinishLineX[0] = 265; + gMiniMapX = 19; + gMiniMapY = 37; break; case COURSE_BOWSER_CASTLE: - D_8018D2C0[0] = 265; - D_8018D2A0 = 0.0174f; - D_8018D2E0 = 12; - D_8018D2E8 = 48; + gMiniMapFinishLineX[0] = 265; + gMiniMapMarkerScale = 0.0174f; + gMiniMapX = 12; + gMiniMapY = 48; break; case COURSE_BANSHEE_BOARDWALK: D_80165880 = (void*) dma_textures(gTextureGhosts, 0x4CC2, 0xD980); - D_8018D2A0 = 0.016f; - D_8018D2C0[0] = 0x0106; - D_8018D2E0 = 55; - D_8018D2E8 = 39; + gMiniMapMarkerScale = 0.016f; + gMiniMapFinishLineX[0] = 0x0106; + gMiniMapX = 55; + gMiniMapY = 39; break; case COURSE_YOSHI_VALLEY: D_8018D220 = (void*) dma_textures(gTextureExhaust0, 0x479, 0xC00); - D_8018D2A0 = 0.018f; - D_8018D2E0 = 61; - D_8018D2E8 = 38; + gMiniMapMarkerScale = 0.018f; + gMiniMapX = 61; + gMiniMapY = 38; break; case COURSE_FRAPPE_SNOWLAND: - D_8018D2C0[0] = 262; - D_8018D2A0 = 0.016f; - D_8018D2E0 = 36; - D_8018D2E8 = 40; + gMiniMapFinishLineX[0] = 262; + gMiniMapMarkerScale = 0.016f; + gMiniMapX = 36; + gMiniMapY = 40; D_8018D300 = 72; D_8018D308 = 100; D_8018D310 = 255; break; case COURSE_KOOPA_BEACH: D_8018D220 = (void*) dma_textures(gTextureExhaust3, 0x3C8U, 0x1000); - D_8018D2A0 = 0.014f; - D_8018D2C0[0] = 268; - D_8018D2E0 = 40; - D_8018D2E8 = 21; + gMiniMapMarkerScale = 0.014f; + gMiniMapFinishLineX[0] = 268; + gMiniMapX = 40; + gMiniMapY = 21; break; case COURSE_ROYAL_RACEWAY: D_8018D220 = (void*) dma_textures(gTextureExhaust4, 0x3F8, 0x1000); - D_8018D2C0[0] = 262; - D_8018D2A0 = 0.014f; - D_8018D2E0 = 37; - D_8018D2E8 = 50; + gMiniMapFinishLineX[0] = 262; + gMiniMapMarkerScale = 0.014f; + gMiniMapX = 37; + gMiniMapY = 50; D_80165718 = -64; D_80165720 = 5; D_80165728 = -330; break; case COURSE_LUIGI_RACEWAY: D_8018D220 = (void*) dma_textures(gTextureExhaust2, 0x4F4U, 0xC00); - D_8018D2A0 = 0.0155f; - D_8018D2C0[0] = 271; - D_8018D2E0 = 45; - D_8018D2E8 = 60; + gMiniMapMarkerScale = 0.0155f; + gMiniMapFinishLineX[0] = 271; + gMiniMapX = 45; + gMiniMapY = 60; D_80165718 = -140; D_80165720 = -44; D_80165728 = -215; break; case COURSE_MOO_MOO_FARM: D_8018D220 = (void*) dma_textures(gTextureExhaust0, 0x479, 0xC00); - D_8018D2A0 = 0.0155f; - D_8018D2C0[0] = 271; - D_8018D2E0 = 18; - D_8018D2E8 = 36; + gMiniMapMarkerScale = 0.0155f; + gMiniMapFinishLineX[0] = 271; + gMiniMapX = 18; + gMiniMapY = 36; break; case COURSE_TOADS_TURNPIKE: - D_8018D2A0 = 0.013f; - D_8018D2C0[0] = 252; - D_8018D2E0 = 57; - D_8018D2E8 = 44; + gMiniMapMarkerScale = 0.013f; + gMiniMapFinishLineX[0] = 252; + gMiniMapX = 57; + gMiniMapY = 44; break; case COURSE_KALAMARI_DESERT: - D_8018D2C0[0] = 263; - D_8018D2D8[0] = 165; + gMiniMapFinishLineX[0] = 263; + gMiniMapFinishLineY[0] = 165; D_8018D220 = (void*) dma_textures(gTextureExhaust5, 0x443, 0x1000); - D_8018D2A0 = 0.015f; - D_8018D2E0 = 55; - D_8018D2E8 = 27; + gMiniMapMarkerScale = 0.015f; + gMiniMapX = 55; + gMiniMapY = 27; break; case COURSE_SHERBET_LAND: D_8018D220 = (void*) dma_textures(gTextureExhaust1, 0x485, 0xC00); - D_8018D2A0 = 0.015f; - D_8018D2C0[0] = 262; - D_8018D2E0 = 52; - D_8018D2E8 = 33; + gMiniMapMarkerScale = 0.015f; + gMiniMapFinishLineX[0] = 262; + gMiniMapX = 52; + gMiniMapY = 33; D_8018D300 = 72; D_8018D308 = 100; D_8018D310 = 255; break; case COURSE_RAINBOW_ROAD: - D_8018D2A0 = 0.0103f; - D_8018D2C0[0] = 261; - D_8018D2D8[0] = 166; - D_8018D2E0 = 39; - D_8018D2E8 = 55; + gMiniMapMarkerScale = 0.0103f; + gMiniMapFinishLineX[0] = 261; + gMiniMapFinishLineY[0] = 166; + gMiniMapX = 39; + gMiniMapY = 55; break; case COURSE_WARIO_STADIUM: - D_8018D2A0 = 0.0155f; - D_8018D2C0[0] = 0x0106; - D_8018D2E0 = 53; - D_8018D2E8 = 35; + gMiniMapMarkerScale = 0.0155f; + gMiniMapFinishLineX[0] = 0x0106; + gMiniMapX = 53; + gMiniMapY = 35; break; case COURSE_BLOCK_FORT: - D_8018D2A0 = 0.0335f; - D_8018D2E0 = 32; - D_8018D2E8 = 32; + gMiniMapMarkerScale = 0.0335f; + gMiniMapX = 32; + gMiniMapY = 32; break; case COURSE_SKYSCRAPER: - D_8018D2A0 = 0.0445f; - D_8018D2E0 = 32; - D_8018D2E8 = 32; + gMiniMapMarkerScale = 0.0445f; + gMiniMapX = 32; + gMiniMapY = 32; break; case COURSE_DOUBLE_DECK: - D_8018D2A0 = 0.0285f; - D_8018D2E0 = 32; - D_8018D2E8 = 32; + gMiniMapMarkerScale = 0.0285f; + gMiniMapX = 32; + gMiniMapY = 32; break; case COURSE_DK_JUNGLE: - D_8018D2A0 = 0.0155f; - D_8018D2C0[0] = 255; - D_8018D2E0 = 29; - D_8018D2E8 = 47; + gMiniMapMarkerScale = 0.0155f; + gMiniMapFinishLineX[0] = 255; + gMiniMapX = 29; + gMiniMapY = 47; break; case COURSE_BIG_DONUT: - D_8018D2A0 = 0.0257f; - D_8018D2E0 = 32; - D_8018D2E8 = 31; + gMiniMapMarkerScale = 0.0257f; + gMiniMapX = 32; + gMiniMapY = 31; } +#else + +#endif if (gIsMirrorMode != 0) { - D_8018D2E0 = D_8018D2B0 - D_8018D2E0; + gMiniMapX = D_8018D2B0 - gMiniMapX; } if (gPlayerCount == 4) { - D_8018D2C0[0] = 160; - D_8018D2D8[0] = 120; + gMiniMapFinishLineX[0] = 160; + gMiniMapFinishLineY[0] = 120; return; } if (gPlayerCount == 3) { - D_8018D2C0[0] = 235; - D_8018D2D8[0] = 175; + gMiniMapFinishLineX[0] = 235; + gMiniMapFinishLineY[0] = 175; return; } if (gPlayerCount == 2) { - if (gCurrentCourseId != 10) { - D_8018D2C0[1] = 265; - D_8018D2C0[0] = D_8018D2C0[1]; + if (gCurrentCourseId != COURSE_TOADS_TURNPIKE) { + gMiniMapFinishLineX[1] = 265; + gMiniMapFinishLineX[0] = gMiniMapFinishLineX[1]; } else { - D_8018D2C0[1] = 255; - D_8018D2C0[0] = D_8018D2C0[1]; + gMiniMapFinishLineX[1] = 255; + gMiniMapFinishLineX[0] = gMiniMapFinishLineX[1]; } - D_8018D2D8[0] = 65; - D_8018D2D8[1] = 180; + gMiniMapFinishLineY[0] = 65; + gMiniMapFinishLineY[1] = 180; } } @@ -366,15 +374,15 @@ void func_8006F824(s32 arg0) { } void func_8006F8CC(void) { - if (D_8018EDFC == 0) { - D_8018EDFC = 1; + if (gCourseMapInit == 0) { + gCourseMapInit = 1; D_801657E4 = 0; D_801657E6 = 0; D_801657F0 = 0; D_801657E8 = 1; D_80165800[0] = D_80165800[1] = 1; if (gPlayerCount == 4) { - if (gModeSelection != 3) { + if (gModeSelection != BATTLE) { D_801657E4 = 1; D_801657F0 = 1; D_801657F8 = 1; @@ -387,13 +395,13 @@ void func_8006F8CC(void) { D_801657E8 = 0; D_801657F8 = 1; } else if (gPlayerCount == 2) { - if (gModeSelection != (s32) 3) { + if (gModeSelection != (s32) BATTLE) { D_801657E4 = 1; D_801657F0 = 1; D_80165800[0] = D_80165800[1] = 0; } - D_8018D2D8[0] = 0x0041; - D_8018D2D8[1] = 0x00B4; + gMiniMapFinishLineY[0] = 0x0041; + gMiniMapFinishLineY[1] = 0x00B4; } func_8006F824(0); } else { @@ -410,16 +418,12 @@ void func_8006F8CC(void) { } } -#ifdef NON_MATCHING -// Major register allocation problems in the first for-loop -// Smaller issues elsewhere, probably some one line, multiple variable assignment shenanigans going on -// https://decomp.me/scratch/ohbAc void func_8006FA94(void) { - s32 var_a0; + s32 i; Player* player; func_8006F8CC(); - func_8006F008(); + track_minimap_settings(); osSetTime(0); D_8018D170 = 0; D_8018D190 = 0; @@ -429,32 +433,15 @@ void func_8006FA94(void) { D_801657E2 = 0; D_80165730 = 0; D_801658FE = 0; - /* - D_801657E5 = 0; - D_801657E3 = D_801657E5; - D_801657E1 = D_801657E3; - */ + D_801657E1 = D_801657E3 = D_801657E5 = 0; - /* - D_80165658->unk8 = 0; - D_80165658->unk4 = 0; - D_80165658->unk0 = 0; - */ + D_80165658[0] = D_80165658[1] = D_80165658[2] = 0; - /* - D_801658D6 = 0; - D_801658E4 = D_801658D6; - D_801658F4 = D_801658E4; - D_801658EC = D_801658F4; - D_801658DC = D_801658EC; - D_801658CE = D_801658DC; - D_801658C6 = D_801658CE; - D_801658BC = D_801658C6; - */ D_801658BC = D_801658C6 = D_801658CE = D_801658DC = D_801658EC = D_801658F4 = D_801658E4 = D_801658D6 = 0; - switch (gPlayerCount) { /* irregular */ + + switch (gPlayerCount) { case 1: - if (gModeSelection == 0) { + if (gModeSelection == GRAND_PRIX) { D_8018D114 = 0; D_8018D178 = 150; D_8018D180 = 240; @@ -465,13 +452,13 @@ void func_8006FA94(void) { } break; case 2: - if (gScreenModeSelection == 1) { - if (gModeSelection == 0) { + if (gScreenModeSelection == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL) { + if (gModeSelection == GRAND_PRIX) { D_8018D114 = 2; D_8018D178 = 150; D_8018D180 = 240; D_8018D2AC = 60; - } else if (gModeSelection == 2) { + } else if (gModeSelection == VERSUS) { D_8018D114 = 3; D_8018D178 = 30; D_8018D180 = 30; @@ -482,38 +469,38 @@ void func_8006FA94(void) { D_8018D180 = 40; D_8018D2AC = 60; } - } else if (gModeSelection == 0) { + } else if (gModeSelection == GRAND_PRIX) { D_8018D114 = 5; - } else if (gModeSelection == 2) { + } else if (gModeSelection == VERSUS) { D_8018D114 = 6; } else { D_8018D114 = 7; } break; case 3: - if (gModeSelection == 2) { + if (gModeSelection == VERSUS) { D_8018D114 = 8; - D_8018D178 = 100; - D_8018D180 = 150; - D_8018D2AC = 60; + D_8018D178 = 0x00000064; + D_8018D180 = 0x00000096; + D_8018D2AC = 0x0000003C; } else { D_8018D114 = 9; - D_8018D178 = 100; - D_8018D180 = 150; - D_8018D2AC = 60; + D_8018D178 = 0x00000064; + D_8018D180 = 0x00000096; + D_8018D2AC = 0x0000003C; } break; case 4: - if (gModeSelection == 2) { - D_8018D114 = 10; - D_8018D178 = 30; - D_8018D180 = 30; - D_8018D2AC = 10; + if (gModeSelection == VERSUS) { + D_8018D114 = 0x0000000A; + D_8018D178 = 0x0000001E; + D_8018D180 = 0x0000001E; + D_8018D2AC = 0x0000000A; } else { - D_8018D114 = 11; - D_8018D178 = 30; - D_8018D180 = 30; - D_8018D2AC = 10; + D_8018D114 = 0x0000000B; + D_8018D178 = 0x0000001E; + D_8018D180 = 0x0000001E; + D_8018D2AC = 0x0000000A; } break; } @@ -521,25 +508,18 @@ void func_8006FA94(void) { D_8016576A = 0; D_8016579C = 0; } - for (var_a0 = 0; var_a0 < gPlayerCount; var_a0++) { - D_8018CFBC[var_a0] = 0; - D_8018CFAC[var_a0] = 0; - D_8018CFC4[var_a0] = 0; - D_8018CFB4[var_a0] = 0; + + for (i = 0; i < gPlayerCount; i++) { + D_8018CFC4[i] = D_8018CFAC[i] = D_8018CFBC[i] = 0; + D_8018CFB4[i] = 0; } + D_8018D204 = 1; D_8018D1FC = 0; D_8018D224 = 0; D_8018D1F0 = D_8018D1F8 = 0; D_8018D228 = 0xFF; - /* - D_80165628 = 0; - D_80165618 = 0; - D_80165608 = D_80165618; - D_801655F8 = D_80165618; - D_801655E8 = D_80165618; - D_801655D8 = D_80165618; - */ + D_801655D8 = D_801655E8 = D_801655F8 = D_80165608 = D_80165618 = D_80165628 = 0; D_8018D160 = 0; D_8018D1DC = 0; @@ -548,46 +528,29 @@ void func_8006FA94(void) { D_8018D1A0 = 0; D_8018D168 = 0; D_801656F0 = 0; - D_801657B2 = 0; - D_801657D8 = D_801657B2; - D_8018D214 = D_801657D8; - gHUDDisable = D_8018D214; - D_801657AE = gHUDDisable; + D_801657AE = gHUDDisable = D_8018D214 = D_801657D8 = D_801657B2 = 0; D_8018D20C = 0; - D_8018D2F8 = 0; - D_8018D2F0 = D_8018D2F8; + D_8018D2F0 = D_8018D2F8 = 0; D_8018D320 = 3; D_8018D2AC = 0; - D_8018D2BC = 0; - D_8018D2B4 = D_8018D2BC; - D_8018D2A4 = D_8018D2B4; - D_8018D2C8[0] = 0; - D_8018D2C8[1] = 0; - D_8018D2C8[2] = 0; - D_8018D2C8[3] = 0; + D_8018D2A4 = D_8018D2B4 = D_8018D2BC = 0; + D_8018D2C8[0] = D_8018D2C8[1] = D_8018D2C8[2] = D_8018D2C8[3] = 0; D_8016581C = 0; D_8016580C = 0; D_80165814 = 0; D_80165804 = 0; D_801657FC = 0; - D_8018D18C = -1; - D_8018D184 = D_8018D18C; - D_8018D16C = D_8018D18C; - D_8018D17C = D_8018D18C; - D_8018D174 = D_8018D18C; + D_8018D174 = D_8018D17C = D_8018D16C = D_8018D184 = D_8018D18C = -1; player = gPlayerOne; - for (var_a0 = 0; var_a0 < NUM_PLAYERS; var_a0++) { - D_8018D0F0[var_a0] = D_8018D050[var_a0] = -32.0f; - D_8018CE10[var_a0].unk_04[0] = D_8018CE10[var_a0].unk_04[1] = D_8018CE10[var_a0].unk_04[2] = 0.0f; - D_8018CF50[var_a0] = var_a0; - D_8018CF28[var_a0] = player; + for (i = 0; i < NUM_PLAYERS; i++) { + D_8018D0F0[i] = D_8018D050[i] = -32.0f; + D_8018CE10[i].unk_04[0] = D_8018CE10[i].unk_04[1] = D_8018CE10[i].unk_04[2] = 0.0f; + D_8018CF50[i] = i; + D_8018CF28[i] = player; player->unk_040 = -1; player++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006FA94.s") -#endif void func_80070148(void) { s32 var_s0; @@ -683,10 +646,11 @@ void init_stars(StarData* starList) { D_8018D230 = 1; } -void func_8007055C(void) { +void course_init_cloud(void) { s32 var_s0; s32 var_s4; +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: // Uses Kalimari Desert's clouds for initialization? @@ -735,6 +699,9 @@ void func_8007055C(void) { init_stars(gWarioStadiumStars); break; } +#else + +#endif func_8008C23C(); } @@ -751,10 +718,11 @@ void func_80070714(void) { D_80165748 = 0xA; } -void init_course_object(void) { +void init_course_objects(void) { s32 objectId; s32 i; +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: if (gGamestate != 9) { @@ -1007,6 +975,9 @@ void init_course_object(void) { default: break; } +#else + +#endif } void init_hud_one_player(void) { @@ -1025,9 +996,9 @@ void init_hud_one_player(void) { find_unused_obj_index(&gItemWindowObjectByPlayerId[0]); find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); init_object_list_index(); - func_8007055C(); - func_8007055C(); - init_course_object(); + course_init_cloud(); + course_init_cloud(); + init_course_objects(); playerHUD[PLAYER_ONE].speedometerX = 0x0156; playerHUD[PLAYER_ONE].speedometerY = 0x0106; D_8018CFEC = playerHUD[PLAYER_ONE].speedometerX + 0x18; @@ -1106,9 +1077,9 @@ void init_hud_two_player_vertical(void) { find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); init_object_list_index(); - func_8007055C(); - func_8007055C(); - init_course_object(); + course_init_cloud(); + course_init_cloud(); + init_course_objects(); playerHUD[PLAYER_ONE].itemBoxX = -0x52; playerHUD[PLAYER_ONE].itemBoxY = 0x32; @@ -1174,9 +1145,9 @@ void init_hud_two_player_horizontal() { find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); init_object_list_index(); - func_8007055C(); - func_8007055C(); - init_course_object(); + course_init_cloud(); + course_init_cloud(); + init_course_objects(); playerHUD[PLAYER_ONE].itemBoxY = 0x22; playerHUD[PLAYER_ONE].itemBoxX = -0x53; @@ -1252,7 +1223,7 @@ void init_hud_three_four_player(void) { find_unused_obj_index(&gItemWindowObjectByPlayerId[3]); init_object_list_index(); - init_course_object(); + init_course_objects(); playerHUD[PLAYER_ONE].itemBoxX = -0x36; playerHUD[PLAYER_ONE].itemBoxY = 0x36; diff --git a/src/code_8006E9C0.h b/src/code_8006E9C0.h index 61f8ab4f91..ad2e1ffa7b 100644 --- a/src/code_8006E9C0.h +++ b/src/code_8006E9C0.h @@ -8,12 +8,12 @@ void init_hud(void); void reset_object_variable(void); void func_8006EB10(void); void clear_object_list(void); -u8* func_8006ED94(u8*, u8*, u32, u32); -void func_8006EE44(void); +u8* dma_copy_base_misc_textures(u8*, u8*, u32, u32); +void load_mario_kart_64_logo(void); void init_item_window(s32); void func_8006EEE8(s32); void func_8006EF60(void); -void func_8006F008(void); +void track_minimap_settings(void); void func_8006F824(s32); void func_8006F8CC(void); void func_8006FA94(void); @@ -23,9 +23,9 @@ void init_cloud_object(s32, s32, CloudData*); void init_clouds(CloudData*); void init_star_object(s32, s32, StarData*); void init_stars(StarData*); -void func_8007055C(void); +void course_init_cloud(void); void func_80070714(void); -void init_course_object(void); +void init_course_objects(void); void init_hud_one_player(void); void init_hud_two_player_vertical(void); void init_hud_three_four_player(void); diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 4d831df644..c3173b2259 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "code_80086E70.h" #include "camera.h" @@ -975,7 +976,7 @@ void func_80089020(s32 playerId, f32* arg1) { } else { var_f2 = -*arg1; } - if (player->effects & 0xC0) { + if (player->effects & (BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT)) { if (gCurrentCourseId == COURSE_SHERBET_LAND) { if (var_f2 <= 0.5) { var_f0 = 0.025f; @@ -1041,8 +1042,8 @@ f32 func_8008933C(Player* player, s32 objectIndex, f32 arg2, f32 arg3) { var_f2 = 0.0f; if (temp_v1->unk_18[6] == 0) { object = &gObjectList[objectIndex]; - player->unk_046 |= 2; - player->effects |= 0x8000; + player->unk_046 |= CRITTER_TOUCH; + player->effects |= ENEMY_BONK_EFFECT; temp_v1->unk_18[6] = 4; something = (player->pos[0] - object->pos[0]) * object->velocity[0]; if (something >= 0.0f) { @@ -1069,8 +1070,7 @@ void func_80089474(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 soundB if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } - if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && - ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { + if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) { func_800C9060(playerId, soundBits); } } @@ -1080,21 +1080,20 @@ void func_80089538(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 soundB Player* player; player = &gPlayerOne[playerId]; - if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && - ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { + if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) { func_800C9060((u8) playerId, soundBits); } } s32 func_800895E4(s32 objectIndex) { Player* player; - s32 var_s1; + s32 playerIndex; s32 var_s6; var_s6 = 0; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { if ((gObjectList[objectIndex].state != 0) && (has_collided_horizontally_with_player(objectIndex, player) != 0)) { if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { @@ -1109,11 +1108,11 @@ s32 func_800895E4(s32 objectIndex) { void func_800896D4(s32 objectIndex, f32 arg1, f32 arg2) { Player* player; - s32 var_s1; + s32 playerIndex; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { if ((gObjectList[objectIndex].state != 0) && !(player->effects & (STAR_EFFECT | BOO_EFFECT)) && (has_collided_horizontally_with_player(objectIndex, player) != 0)) { func_8008933C(player, objectIndex, arg1, arg2 * 1.1); @@ -1127,12 +1126,12 @@ void func_800896D4(s32 objectIndex, f32 arg1, f32 arg2) { void func_80089820(s32 objectIndex, f32 arg1, f32 arg2, u32 arg3) { Player* player; - s32 var_s1; + s32 playerIndex; player = gPlayerOne; set_object_flag_status_false(objectIndex, 0x02000000); if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { if ((gObjectList[objectIndex].state != 0) && !(player->effects & BOO_EFFECT)) { if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) && (has_collided_horizontally_with_player(objectIndex, player) != 0)) { @@ -1143,8 +1142,8 @@ void func_80089820(s32 objectIndex, f32 arg1, f32 arg2, u32 arg3) { func_80072180(); } if ((func_8008933C(player, objectIndex, arg1, arg2 * 1.1) >= 4.0) && - ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { - func_800C9060(var_s1, arg3); + ((player->type & PLAYER_CPU) != PLAYER_CPU)) { + func_800C9060(playerIndex, arg3); } } } @@ -1155,11 +1154,11 @@ void func_80089820(s32 objectIndex, f32 arg1, f32 arg2, u32 arg3) { void func_80089A04(s32 objectIndex, f32 arg1, f32 arg2) { Player* player; - s32 var_s1; + s32 playerIndex; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | STAR_EFFECT)) && (has_collided_with_player(objectIndex, player) != 0)) { func_8008933C(player, objectIndex, arg1, arg2 * 1.1); @@ -1174,19 +1173,19 @@ void func_80089A04(s32 objectIndex, f32 arg1, f32 arg2) { s32 func_80089B50(s32 objectIndex) { Player* player; s32 sp40; - s32 var_s1; + s32 playerIndex; s32 test; test = 0; sp40 = 0; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++, test++) { - if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x81000000) && + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++, test++) { + if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | EXPLOSION_CRASH_EFFECT)) && (player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) && (has_collided_horizontally_with_player(objectIndex, player) != 0)) { if (!(player->effects & STAR_EFFECT)) { - player->soundEffects |= REVERSE_SOUND_EFFECT; + player->triggers |= VERTICAL_TUMBLE_TRIGGER; if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } @@ -1202,18 +1201,18 @@ s32 func_80089B50(s32 objectIndex) { s32 func_80089CBC(s32 objectIndex, f32 arg1) { Player* player; - s32 var_s1; + s32 playerIndex; s32 var_s7; var_s7 = 0; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { - if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x81000000)) { + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { + if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | EXPLOSION_CRASH_EFFECT))) { if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) && (has_collided_with_player_and_within_height(objectIndex, player, arg1) != 0)) { if (!(player->effects & STAR_EFFECT)) { - player->soundEffects |= REVERSE_SOUND_EFFECT; + player->triggers |= VERTICAL_TUMBLE_TRIGGER; if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } @@ -1228,19 +1227,20 @@ s32 func_80089CBC(s32 objectIndex, f32 arg1) { s32 func_80089E18(s32 objectIndex) { Player* player; - s32 var_s1; + s32 playerIndex; s32 var_s6; var_s6 = 0; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { - if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x800000C0) && + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { + if ((gObjectList[objectIndex].state != 0) && + !(player->effects & (BOO_EFFECT | BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT)) && (has_collided_horizontally_with_player(objectIndex, player) != 0)) { if (player->effects & STAR_EFFECT) { var_s6 = 1; } else { - player->soundEffects |= 1; + player->triggers |= HIT_BANANA_TRIGGER; } } } @@ -1250,21 +1250,22 @@ s32 func_80089E18(s32 objectIndex) { s32 func_80089F24(s32 objectIndex) { Player* player; - s32 var_s1; + s32 playerIndex; s32 var_s7; var_s7 = 0; player = gPlayerOne; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { - if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x800002C0)) { + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++) { + if ((gObjectList[objectIndex].state != 0) && + !(player->effects & (BOO_EFFECT | STAR_EFFECT | BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT))) { if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) && (has_collided_horizontally_with_player(objectIndex, player) != 0)) { var_s7 = 1; if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } - player->soundEffects |= 0x200000; + player->triggers |= SPINOUT_TRIGGER; } } } diff --git a/src/code_80086E70.h b/src/code_80086E70.h index 8d9a6ffdcc..b53fbadc75 100644 --- a/src/code_80086E70.h +++ b/src/code_80086E70.h @@ -166,6 +166,4 @@ void func_8008BFFC(s32); void func_8008C1B8(s32); void func_8008C1C0(s32); -extern s16 gCurrentCourseId; - #endif diff --git a/src/code_80091750.h b/src/code_80091750.h deleted file mode 100644 index c35039dbf2..0000000000 --- a/src/code_80091750.h +++ /dev/null @@ -1,619 +0,0 @@ -#ifndef CODE_80091750_H -#define CODE_80091750_H - -#include -#include "textures.h" -#include "main.h" - -extern u32 _course_mario_raceway_dl_mio0SegmentRomStart[]; - -/* File specific types */ - -/* -Known `types` for `struct_8018D9E0_entry` -0x53: "Mushroom Cup" box on the cup selection screen -0x54: "Flower Cup" box on the cup selection screen -0x55: "Star Cup" box on the cup selection screen -0x56: "Special Cup" box on the cup selection screen -0x5E: A box of static over the course images as the cup selection screen loads in. - It is near unnoticeable though as in practice it doesn't last long enough to be seen. - Try locking the word at `8018DC80` to see something like 0x20 just before confirming character selection to make -it last longer See `func_80096CD8` for the actual drawing of the static -*/ - -typedef struct { - /* 0x00 */ s32 type; // id maybe? - /* 0x04 */ s32 cursor; // sound mode, maybe some other stuff - /* 0x08 */ s32 unk8; // This is used but I can't tell what for - /* 0x0C */ s32 column; - /* 0x10 */ s32 row; - /* 0x14 */ u8 priority; // priority/depth/z-level. Higher values are drawn on top of lower values - // If equal, later entries in D_8018D9E0 are on top - /* 0x15 */ u8 visible; // active? If 1 its displayed, if 0 its not - // These seem to be generic space available for use by the struct, no 1 purpose for any given member - /* 0x16 */ s16 unk16; // Potentially unused - /* 0x18 */ s32 D_8018DEE0_index; // Index in D_8018DEE0, an array of some other struct type - /* 0x1C */ s32 unk1C; // Multi use. Sometimes cup selection, sometimes course index. - /* 0x20 */ s32 unk20; // Multi use, hard to tell what for though. Sometimes a random number, sometimes GP points - /* 0x24 */ f32 unk24; // Multi use, x scaling for some things, rotation multiplier for the question box in some - // menus, probably some other things -} struct_8018D9E0_entry; // size = 0x28 - -typedef struct { - /* 0x00 */ MkAnimation* textureSequence; - /* 0x04 */ s32 sequenceIndex; // Index in textureSequence that the animation is currently on - /* 0x08 */ s32 frameCountDown; // Frames left for the given animation part - /* 0x0C */ u32 visible; // visbile if 0x80000000, otherwise invisbile AND paused - /* 0x10 */ s32 D_8018E118_index; // Don't know what D_8018E118 tracks - /* 0x14 */ s32 unk14; // Flip flops between 0 and 1, use unknown -} struct_8018DEE0_entry; // size = 0x18 - -typedef struct { - /* 0x0 */ MkTexture* texture; - /* 0x4 */ s32 unk_4; -} struct_8018E060_entry; // size = 0x8 - -typedef struct { - /* 0x0 */ MkTexture* mk64Texture; - /* 0x4 */ s16 unk4; - /* 0x6 */ s16 unk6; -} struct_8018E0E8_entry; // size = 0x8 - -typedef struct { - /* 0x00 */ u64* textureData; // This should be interpreted as a segmented address - /** - * Its hard to tell what exactly what this is meant to be, - * but it appears to be used as some sort of offset/index from the address stored in D_8018D9B0. - * This value is (roughly) the sum of (width * height) of the - * textures in all the previous entries in D_8018E118 - */ - /* 0x04 */ s32 offset; -} struct_8018E118_entry; // size = 0x08 - -typedef struct { - /* 0x00 */ MkTexture* textures; - /* 0x04 */ Gfx* displayList; -} struct_8018E768_entry; // size = 0x08 - -struct UnkStruct_8018E7E8 { - /* 0x0 */ s16 x; - /* 0x2 */ s16 y; - /* 0x4 */ s16 unk1; - /* 0x6 */ s16 unk2; -}; // size = 0x8 - -typedef struct { - /* 0x00 */ s16 column; - /* 0x02 */ s16 row; - /* 0x04 */ s16 pad0; - /* 0x06 */ s16 pad1; -} Unk_D_800E70A0; // size = 0x08 - -/* Function Prototypes */ - -f64 exponent_by_squaring(f64, s32); -f64 func_800917B0(f64, f64); -f64 func_8009186C(f64); -f64 func_8009195C(f64); -f64 func_80091A6C(f64, s32); -f64 func_80091AC0(f64, s32*); -void swap_values(s32*, s32*); -s32 func_80091D74(void); -void func_80091EE4(void); -void func_80091FA4(void); -void func_80092148(void); -void func_800921B4(void); -void text_rainbow_effect(s32, s32, s32); -void set_text_color_rainbow_if_selected(s32, s32, s32); -void func_80092258(void); -void func_80092290(s32, s32*, s32*); -void func_80092500(void); -void func_80092564(void); -void func_800925A0(void); -void func_800925CC(void); -void func_80092604(void); -void func_80092630(void); -void func_8009265C(void); -void func_80092688(void); -void func_80092C80(void); -s32 char_to_glyph_index(char*); -s32 func_80092DF8(char*); -s32 func_80092E1C(char*); -s32 func_80092EE4(char*); -s32 get_string_width(char*); -void set_text_color(s32); -void func_800930E4(s32, s32, char*); -void print_text0(s32, s32, char*, s32, f32, f32, s32); -void func_80093324(s32, s32, char*, s32, f32, f32); -void func_80093358(s32, s32, char*, s32, f32, f32); -void print_text1(s32, s32, char*, s32, f32, f32, s32); -void func_800936B8(s32, s32, char*, s32, f32, f32); -void draw_text(s32, s32, char*, s32, f32, f32); -void func_80093720(s32, s32, char*, s32, f32, f32); -void func_80093754(s32, s32, char*, s32, f32, f32); -void print_text2(s32, s32, char*, s32, f32, f32, s32); -void func_800939C8(s32, s32, char*, s32, f32, f32); -void text_draw(s32, s32, char*, s32, f32, f32); -void func_80093A30(s32); -void func_80093A5C(u32); -void func_80093B70(u32); -void func_80093C1C(s32); -void func_80093C88(void); -void func_80093C90(void); -void func_80093C98(s32); -void func_80093E20(void); -void func_80093E40(void); -void func_80093E60(void); -void func_80093F10(void); -void func_800940EC(s32); -void func_800942D0(void); -void func_80094660(struct GfxPool*, s32); -void func_800947B4(struct GfxPool*, s32); -void func_80094A64(struct GfxPool*); -void func_80094C60(void); -void func_80095574(void); -Gfx* draw_flash_select_case(Gfx*, s32, s32, s32, s32, s32); -Gfx* draw_flash_select_case_slow(Gfx*, s32, s32, s32, s32); -Gfx* draw_flash_select_case_fast(Gfx*, s32, s32, s32, s32); -Gfx* func_800959F8(Gfx*, Vtx*); -Gfx* func_80095BD0(Gfx*, u8*, f32, f32, u32, u32, f32, f32); -Gfx* func_80095E10(Gfx*, s8, s32, s32, s32, s32, s32, s32, s32, s32, u8*, u32, u32); -Gfx* func_800963F0(Gfx*, s8, s32, s32, f32, f32, s32, s32, s32, s32, s32, s32, u8*, u32, u32); -Gfx* func_80096CD8(Gfx*, s32, s32, u32, u32); -Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, - s32 arg9, u16* argA, u32 argB, u32 argC, s32 argD); -Gfx* func_80097A14(Gfx*, s8, s32, s32, s32, s32, s32, s32, u8*, u32, u32); -Gfx* func_80097AE4(Gfx*, s8, s32, s32, u8*, s32); -Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u32 arg5, s32 arg6, s32 arg7, - u8* someTexture, u32 arg9, u32 argA, s32 width); -Gfx* func_80098558(Gfx*, u32, u32, u32, u32, u32, u32, s32, s32); -Gfx* func_800987D0(Gfx*, u32, u32, u32, u32, s32, s32, u8*, u32, s32); -Gfx* draw_box_fill(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32); -Gfx* draw_box(Gfx*, s32, s32, s32, s32, u32, u32, u32, u32); -Gfx* func_80098FC8(Gfx*, s32, s32, s32, s32); -void dma_copy_base_729a30(u64*, size_t, void*); -void dma_copy_base_7fa3c0(u64*, size_t, void*); -void func_80099110(void); -void func_80099184(MkTexture*); -void* segmented_to_virtual_dupe(const void*); -void* segmented_to_virtual_dupe_2(const void*); -void func_8009969C(MkTexture*); -void func_800996BC(MkTexture*, s32); -void func_80099958(MkTexture*, s32, s32); -void func_80099E54(void); -void func_80099E60(MkTexture*, s32, s32); -void func_80099EC4(void); -void func_80099A70(void); -void func_80099A94(MkTexture*, s32); -void func_80099AEC(void); -void func_8009A238(MkTexture*, s32); -void func_8009A2F0(struct_8018E0E8_entry*); -void func_8009A344(void); -s32 func_8009A374(MkAnimation*); -s32 func_8009A478(MkAnimation*, s32); -void func_8009A594(s32, s32, MkAnimation*); -void func_8009A640(s32, s32, s32, MkAnimation*); -void func_8009A6D4(void); -void func_8009A76C(s32, s32, s32, s32); -void func_8009A7EC(s32, s32, s32, s32, s32); -MkTexture* func_8009A878(struct_8018DEE0_entry*); -MkTexture* func_8009A944(struct_8018DEE0_entry*, s32); -void func_8009A9FC(s32, s32, u32, s32); -void func_8009AB7C(s32); -void func_8009AD78(s32, s32); -void func_8009B0A4(s32, u32); -void func_8009B538(s32, s32, s32, s32, s32); -u16* func_8009B8C4(u64*); -void func_8009B938(void); -void func_8009B954(MkTexture*); -void func_8009B998(void); -Gfx* func_8009B9D0(Gfx*, MkTexture*); -Gfx* func_8009BA74(Gfx*, MkTexture*, s32, s32); -Gfx* func_8009BC9C(Gfx*, MkTexture*, s32, s32, s32, s32); -Gfx* print_letter(Gfx*, MkTexture*, f32, f32, s32, f32, f32); -Gfx* func_8009C204(Gfx*, MkTexture*, s32, s32, s32); -Gfx* func_8009C434(Gfx*, struct_8018DEE0_entry*, s32, s32, s32); -Gfx* func_8009C708(Gfx*, struct_8018DEE0_entry*, s32, s32, s32, s32); -void func_8009C918(void); -void func_8009CA2C(void); -void func_8009CA6C(s32); -void func_8009CBE4(s32, s32, s32); -void func_8009CDDC(s32, s32); -void func_8009CDFC(s32, s32); -void func_8009CE1C(void); -void func_8009CE64(s32); -void func_8009D77C(s32, s32, s32); -void func_8009D958(s32, s32); -void func_8009D978(s32, s32); -void func_8009D998(s32); -void func_8009DAA8(void); -void func_8009DB8C(void); -void func_8009DEF8(u32, u32); -void func_8009DF4C(s32); -void func_8009DF6C(s32); -void func_8009DF8C(u32, u32); -void func_8009DFE0(s32); -void func_8009E000(s32); -void func_8009E020(s32, s32); -void func_8009E088(s32, s32); -void func_8009E0F0(s32); -void func_8009E1C0(void); -void func_8009E1E4(void); -void func_8009E208(void); -void func_8009E230(void); -void func_8009E258(void); -void func_8009E280(void); -void func_8009E2A8(s32); -void func_8009E2F0(s32); -void func_8009E5BC(void); -void func_8009E5FC(s32); -void func_8009E620(void); -void add_8018D9E0_entry(s32, s32, s32, s8); -void func_8009F5E0(struct_8018D9E0_entry*); -void func_800A08D8(u8, s32, s32); -s32 func_800A095C(char*, s32, s32, s32); -void func_800A09E0(struct_8018D9E0_entry*); -void func_800A0AD0(struct_8018D9E0_entry*); -void func_800A0B80(struct_8018D9E0_entry*); -void func_800A0DFC(void); -void func_800A0EB8(struct_8018D9E0_entry*, s32); -void func_800A0FA4(struct_8018D9E0_entry*, s32); -void func_800A10CC(struct_8018D9E0_entry*); -void func_800A11D0(struct_8018D9E0_entry*, s32, s32); -void func_800A12BC(struct_8018D9E0_entry*, MkTexture*); -void func_800A1350(struct_8018D9E0_entry*); -void func_800A143C(struct_8018D9E0_entry*, s32); -void func_800A1500(struct_8018D9E0_entry*); -void func_800A15EC(struct_8018D9E0_entry*); -void func_800A1780(struct_8018D9E0_entry*); -void func_800A1924(struct_8018D9E0_entry*); -void func_800A1A20(struct_8018D9E0_entry*); -void func_800A1BE0(struct_8018D9E0_entry*); -void func_800A1DE0(struct_8018D9E0_entry*); -void func_800A1F30(struct_8018D9E0_entry*); -void func_800A1FB0(struct_8018D9E0_entry*); -void func_800A2D1C(struct_8018D9E0_entry*); -void func_800A2EB8(struct_8018D9E0_entry*); -void func_800A32B4(s32, s32, s32, s32); -void func_800A34A8(struct_8018D9E0_entry*); -void func_800A3A10(s8*); -void func_800A3ADC(struct_8018D9E0_entry*, s32, s32, s32, s32, s8*); -void func_800A3C84(struct_8018D9E0_entry*); -void func_800A3E60(struct_8018D9E0_entry*); -void func_800A4550(s32, s32, s32); -void func_800A474C(s32, s32, s32); -void func_800A4A24(struct_8018D9E0_entry*); -void render_pause_menu(struct_8018D9E0_entry*); -void render_pause_menu_time_trials(struct_8018D9E0_entry*); -void render_pause_menu_versus(struct_8018D9E0_entry*); -void render_pause_grand_prix(struct_8018D9E0_entry*); -void render_pause_battle(struct_8018D9E0_entry*); -void func_800A54EC(void); -void func_800A5738(struct_8018D9E0_entry*); -void func_800A6034(struct_8018D9E0_entry*); -void func_800A6154(struct_8018D9E0_entry*); -void func_800A638C(struct_8018D9E0_entry*); -void func_800A66A8(struct_8018D9E0_entry*, Unk_D_800E70A0*); -void func_800A69C8(struct_8018D9E0_entry*); -void func_800A6BEC(struct_8018D9E0_entry*); -void func_800A6CC0(struct_8018D9E0_entry*); -void func_800A6D94(s32, s32, u8*); -void func_800A6E94(s32, s32, u8*); -void func_800A70E8(struct_8018D9E0_entry*); -void func_800A7258(struct_8018D9E0_entry*); -void func_800A72FC(struct_8018D9E0_entry*); -void func_800A7448(struct_8018D9E0_entry*); -void func_800A75A0(struct_8018D9E0_entry*); -void func_800A761C(struct_8018D9E0_entry*); -void func_800A7790(struct_8018D9E0_entry*); -void convert_number_to_ascii(s32, char*); -void write_dashes(char*); -void get_time_record_minutes(s32, char*); -void get_time_record_seconds(s32, char*); -void get_time_record_centiseconds(s32, char*); -void func_800A79F4(s32, char*); -void func_800A7A4C(s32); -void func_800A8230(void); -void func_800A8250(void); -void func_800A8270(s32, struct_8018D9E0_entry*); -void func_800A8564(struct_8018D9E0_entry*); -void func_800A86E8(struct_8018D9E0_entry*); -void func_800A874C(struct_8018D9E0_entry*); -void func_800A890C(s32, struct_8018D9E0_entry*); -void func_800A8A98(struct_8018D9E0_entry*); -void func_800A8CA4(struct_8018D9E0_entry*); -void func_800A8E14(struct_8018D9E0_entry*); -void func_800A8EC0(struct_8018D9E0_entry*); -void func_800A8F48(struct_8018D9E0_entry*); -void func_800A90D4(s32, struct_8018D9E0_entry*); -void func_800A91D8(struct_8018D9E0_entry*, s32, s32); -void func_800A9208(struct_8018D9E0_entry*, s32); -void func_800A9278(struct_8018D9E0_entry*, s32); -void func_800A92E8(struct_8018D9E0_entry*, s32); -void func_800A939C(struct_8018D9E0_entry*, s32); -void func_800A940C(struct_8018D9E0_entry*, s32); -void func_800A94C8(struct_8018D9E0_entry*, s32, s32); -void func_800A954C(struct_8018D9E0_entry*); -void func_800A9710(struct_8018D9E0_entry*); -void func_800A97BC(struct_8018D9E0_entry*); -void func_800A9A98(struct_8018D9E0_entry*); -void func_800A9B9C(struct_8018D9E0_entry*); -void func_800A9C40(struct_8018D9E0_entry*); -void func_800A9D5C(struct_8018D9E0_entry*); -void func_800A9E58(struct_8018D9E0_entry*); -void func_800AA280(struct_8018D9E0_entry*); -void func_800AA2EC(struct_8018D9E0_entry*); -void func_800AA5C8(struct_8018D9E0_entry*, s8); -void func_800AA69C(struct_8018D9E0_entry*); -void func_800AAA9C(struct_8018D9E0_entry*); -void func_800AAB90(struct_8018D9E0_entry*); -void func_800AAC18(struct_8018D9E0_entry*); -void func_800AADD4(struct_8018D9E0_entry*); -void func_800AAE18(struct_8018D9E0_entry*); -struct_8018D9E0_entry* func_800AAE68(void); -struct_8018D9E0_entry* func_800AAEB4(s32); -struct_8018D9E0_entry* find_8018D9E0_entry_dupe(s32); -struct_8018D9E0_entry* find_8018D9E0_entry(s32); -s32 func_800AAF70(s32); -void func_800AAF94(struct_8018D9E0_entry*, s32); -s32 func_800AAFCC(s32); -void func_800AB020(struct_8018D9E0_entry*); -void func_800AB098(struct_8018D9E0_entry*); -void func_800AB164(struct_8018D9E0_entry*); -void func_800AB260(struct_8018D9E0_entry*); -void func_800AB290(struct_8018D9E0_entry*); -void func_800AB314(struct_8018D9E0_entry*); -void func_800AB904(struct_8018D9E0_entry*); -void func_800AB9B0(struct_8018D9E0_entry*); -void func_800ABAE8(struct_8018D9E0_entry*); -void func_800ABB24(struct_8018D9E0_entry*); -void func_800ABBCC(struct_8018D9E0_entry*); -void func_800ABC38(struct_8018D9E0_entry*); -void func_800ABCF4(struct_8018D9E0_entry*); -void func_800ABEAC(struct_8018D9E0_entry*); -void func_800ABF68(struct_8018D9E0_entry*); -void func_800AC128(struct_8018D9E0_entry*); -void func_800AC300(struct_8018D9E0_entry*); -void func_800AC324(struct_8018D9E0_entry*); -void func_800AC458(struct_8018D9E0_entry*); -void func_800AC978(struct_8018D9E0_entry*); -void func_800ACA14(struct_8018D9E0_entry*); -void func_800ACC50(struct_8018D9E0_entry*); -void func_800ACF40(struct_8018D9E0_entry*); -void func_800AD1A4(struct_8018D9E0_entry*); -void func_800AD2E8(struct_8018D9E0_entry*); -void func_800ADF48(struct_8018D9E0_entry*); -void func_800AE218(struct_8018D9E0_entry*); -void func_800AEC54(struct_8018D9E0_entry*); -void func_800AEDBC(struct_8018D9E0_entry*); -void func_800AEE90(struct_8018D9E0_entry*); -void func_800AEEBC(struct_8018D9E0_entry*); -void func_800AEEE8(struct_8018D9E0_entry*); -void func_800AEF14(struct_8018D9E0_entry*); -void func_800AEF74(struct_8018D9E0_entry*); -void func_800AF004(struct_8018D9E0_entry*); -void func_800AF1AC(struct_8018D9E0_entry*); -void func_800AF270(struct_8018D9E0_entry*); -void func_800AF480(struct_8018D9E0_entry*); -void func_800AF4DC(struct_8018D9E0_entry*); -void func_800AF740(struct_8018D9E0_entry*); - -// This really, really shouldn't be in this header file, but I don't know where else to put it -void rmonPrintf(const char*, ...); -void tkmk00decode(u8*, u8*, u8*, s32); - -/* File specific defines */ - -#define D_8018D9E0_SIZE 0x20 -#define D_8018DEE0_SIZE 0x10 -#define D_8018E060_SIZE 0x10 -#define D_8018E0E8_SIZE 0x05 -#define D_8018E118_SIZE 0xC8 -#define D_8018E768_SIZE 0x08 -#define D_8018E7E8_SIZE 0x05 -#define D_8018E810_SIZE 0x05 - -/* This is where I'd put my static data, if I had any */ - -extern s32 D_800DDB24; -extern s16 D_80164478[]; - -extern u16* D_8018D9B0; -extern u8* D_8018D9B4; -extern u8* D_8018D9B8; -extern u8* D_8018D9BC; -extern void* D_8018D9C0; -extern s8 gGPPointsByCharacterId[8]; -extern s8 gCharacterIdByGPOverallRank[]; -extern s8 D_8018D9D8; -extern s8 D_8018D9D9; -extern struct_8018D9E0_entry D_8018D9E0[D_8018D9E0_SIZE]; -extern struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; -extern struct_8018E060_entry D_8018E060[D_8018E060_SIZE]; -extern struct_8018E0E8_entry D_8018E0E8[D_8018E0E8_SIZE]; -extern s32 gD_8018E118TotalSize; -extern struct_8018E118_entry D_8018E118[D_8018E118_SIZE]; -extern s32 gNumD_8018E118Entries; -extern Gfx* D_8018E75C; -extern s32 gNumD_8018E768Entries; -extern struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; -extern s32 gCycleFlashMenu; -extern s8 D_8018E7AC[]; -extern u32 D_8018E7B8[]; -extern u32 D_8018E7D0[]; -extern s32 D_8018E7E0; -extern struct UnkStruct_8018E7E8 D_8018E7E8[D_8018E7E8_SIZE]; -extern struct UnkStruct_8018E7E8 D_8018E810[D_8018E810_SIZE]; -extern s8 gTextColor; -extern u8 D_8018ED90; -extern u8 D_8018ED91; -extern s8 D_8018E838[]; -extern s32 D_8018E840[]; -extern s32 D_8018E850[]; -extern s32 D_8018E854; -extern s32 D_8018E858[]; -extern s32 D_8018E85C; - -extern u8 _textures_0aSegmentRomStart[]; -extern u8 _textures_0bSegmentRomStart[]; - -extern Unk_D_800E70A0 D_800E70A0[]; -extern Unk_D_800E70A0 D_800E70E8[]; -extern Unk_D_800E70A0 D_800E7108[][4]; -extern Unk_D_800E70A0 D_800E7148[]; -extern Unk_D_800E70A0 D_800E7168[]; -extern Unk_D_800E70A0 D_800E7188[]; -extern Unk_D_800E70A0 D_800E7208[][2]; -extern Unk_D_800E70A0 D_800E7248[]; -extern Unk_D_800E70A0 D_800E7258[]; -extern Unk_D_800E70A0 D_800E7268[]; -extern Unk_D_800E70A0 D_800E7278[]; -extern Unk_D_800E70A0 D_800E72F8; -extern Unk_D_800E70A0 D_800E7300[]; -extern Unk_D_800E70A0 D_800E7360[]; -extern Unk_D_800E70A0 D_800E7380[]; -extern Unk_D_800E70A0 D_800E7390[]; -extern Unk_D_800E70A0 D_800E73C0[]; -extern Unk_D_800E70A0 D_800E73D0[]; -extern Unk_D_800E70A0 D_800E73E0[]; -extern Unk_D_800E70A0 D_800E7410[]; -extern Unk_D_800E70A0 D_800E7420[]; -extern Unk_D_800E70A0 D_800E7430[]; -extern Unk_D_800E70A0 D_800E7458[]; -extern Unk_D_800E70A0 D_800E7480[]; -extern RGBA16 D_800E74A8[]; -extern RGBA16 D_800E74D0[]; -extern RGBA16 D_800E74E8[]; -extern const s16 gGlyphDisplayWidth[]; -extern char* gCupNames[]; -extern char* gCourseNames[]; -extern char* gCourseNamesDup[]; -extern char* gCourseNamesDup2[]; -extern char* gDebugCourseNames[]; -// Maps course IDs (as defined in the COURSES enum) to an index in a given cup's track order -extern const s8 gPerCupIndexByCourseId[]; // D_800EFD50 -extern const s8 D_800EFD64[]; -extern s8 gCupSelectionByCourseId[]; -extern char* D_800E7678[]; -extern char* gDebugCharacterNames[]; -extern char* D_800E76A8[]; -extern char* D_800E76CC[]; -extern char* D_800E76DC[]; -extern char* gDebugScreenModeNames[]; -extern char* gDebugSoundModeNames[]; -extern char* gSoundModeNames[]; // D_800E7710 -extern char* D_800E7720[]; -extern char* D_800E7728[]; -extern char* D_800E7730; -extern char* D_800E7734[]; -extern char* D_800E7744[]; -extern char* gTextPauseButton[]; -extern char* D_800E7778[]; -extern char D_800E7780[]; -extern char* D_800E77A0[]; -extern char* D_800E77A8[]; -extern char D_800E77B4[]; -extern char D_800E77D8[]; -extern char* sCourseLengths[]; -extern char* D_800E7834[]; -extern char* D_800E7840[]; -extern char* D_800E7848[]; -extern char* D_800E7860[]; -extern char* D_800E7868[]; -extern char* D_800E7878[]; -extern char* D_800E7884[]; -extern char* D_800E7890[]; -extern char* D_800E78D0[]; -extern char* D_800E7900[]; -extern char* D_800E7918[]; -extern char* D_800E7920[]; -extern char* D_800E7928[]; -extern char* D_800E7930[]; -extern char* D_800E7938[]; -extern char* D_800E7940[]; -extern char* D_800E7980[]; -extern char* D_800E798C[]; -extern char* D_800E7A34[]; -extern char* D_800E7A3C[]; -extern char* D_800E7A44; -extern char* D_800E7A48[]; -extern char* D_800E7A54[]; -extern char* D_800E7A60[]; -extern char* D_800E7A6C[]; -extern char* D_800E7A74[]; -extern char* D_800E7A80[]; -extern char* D_800E7A88[]; -extern char* D_800E7A98; -extern char* D_800E7A9C[]; -extern char* D_800E7AA4[]; -extern const s8 gGPPointRewards[]; -extern const s8 D_800F0B1C[]; -extern const s8 D_800F0B28[]; -extern const s8 D_800F0B50[]; -extern const s8 D_800F0B54[]; -extern RGBA16 D_800E7AC8[]; -extern RGBA16 D_800E7AE8[]; -extern MkTexture* D_800E7AF8[]; -extern MkTexture* D_800E7D0C[]; -extern MkAnimation* D_800E7D34[]; -extern MkTexture* D_800E7D4C[]; -extern MkTexture* D_800E7D54[]; -extern MkTexture* D_800E7D74[]; -extern MkTexture* D_800E7DC4[]; -extern MkAnimation* D_800E7E14[]; -extern MkAnimation* D_800E7E20[]; -extern MkAnimation* D_800E7E34[]; -extern MkTexture* gGlyphTextureLUT[]; -extern MkTexture* D_800E7FF0[]; -extern MkTexture* D_800E80A0[]; -extern MkTexture* D_800E8114[]; -extern MkTexture* D_800E8174[]; -extern MkTexture* D_800E817C[]; -extern MkTexture* D_800E81E4[]; -extern MkTexture* D_800E822C[]; -extern MkTexture* D_800E8234[]; -extern MkTexture* D_800E824C[]; -extern MkTexture* D_800E8254[]; -extern MkTexture* D_800E8274[]; -extern MkTexture* D_800E8294[]; -extern MkTexture* D_800E82B4[]; -extern MkTexture* D_800E82C4[]; -extern MkTexture* D_800E82F4[]; -extern MkAnimation* D_800E8320[]; -extern MkAnimation* D_800E8340[]; -extern MkAnimation* D_800E8360[]; -extern MkAnimation* gCharacterCelebrateAnimation[]; -extern MkAnimation* D_800E83A0[]; -extern MkAnimation* gCharacterDeselectAnimation[]; -extern MkAnimation* gCharacterSingleBlinkAnimation[]; -extern MkAnimation* gCharacterDoubleBlinkAnimation[]; -extern MkAnimation* gCharacterDefeatAnimation[]; -extern s32 D_800E8440[]; -extern s32 D_800E8460[]; -extern s32 D_800E8480[]; -extern s32 D_800E84A0[]; -extern Vtx* D_800E84C0[]; -extern Gfx* D_800E84CC[]; -extern Gfx* D_800E84EC[]; -extern Gfx* D_800E850C[]; -extern s8 D_800E852C; -extern f32 D_800E8530; -extern f32 D_800E8534; -extern Unk_D_800E70A0 D_800E8538[]; -extern Unk_D_800E70A0 D_800E8540[]; -extern Unk_D_800E70A0 D_800E85C0[]; -extern Unk_D_800E70A0 D_800E8600[]; - -extern s32 gControllerPak1NumPagesFree; -extern s32 gControllerPak1FileNote; -extern s32 gControllerPak2FileNote; - -extern f32 D_8018ED98; -extern f32 D_8018ED9C; -extern f32 D_8018EDA0; - -extern f32 D_8018EDA4; -extern f32 D_8018EDA8; -extern f32 D_8018EDAC; - -#endif diff --git a/src/code_800AF9B0.c b/src/code_800AF9B0.c index 3cb173ef4d..dcb67657e5 100644 --- a/src/code_800AF9B0.c +++ b/src/code_800AF9B0.c @@ -4,7 +4,7 @@ #include "code_800AF9B0.h" -#include "code_80091750.h" +#include "menu_items.h" #include "memory.h" #include "main.h" #include "math_util.h" @@ -33,9 +33,6 @@ s16 D_8018EDB4; Vtx* D_8018EDB8; Vtx* D_8018EDBC; -/*** utils **/ -#define SQ(x) ((x) * (x)) - void func_800AF9B0(void) { D_8018EDB8 = (void*) get_next_available_memory_addr(480 * sizeof(Vtx)); D_8018EDBC = (void*) get_next_available_memory_addr(480 * sizeof(Vtx)); @@ -84,48 +81,47 @@ void func_800AF9E4(Vtx* arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4, s16 arg5, gSP1Triangle(gDisplayListHead++, 3, 2, 1, 0); } -void func_800AFC54(Vtx* arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4[3]); -#ifdef NON_MATCHING -// guess on Vtx type? -void func_800AFC54(Vtx* arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4[3]) { - Vtx *a1, *a2, *a3; - s32 saved1, saved2, saved3; - f32 res; - s32 a, b, c, d, e, f; - f32 f14, f16, f18; - - a1 = &arg0[arg1]; - a2 = &arg0[arg2]; - a3 = &arg0[arg3]; - - saved1 = a2->v.ob[0]; - saved2 = a2->v.ob[1]; - saved3 = a2->v.ob[2]; - - a = saved2 - a1->v.ob[1]; - e = saved3 - a1->v.ob[2]; - d = a3->v.ob[1] - saved2; - b = a3->v.ob[2] - saved3; - f = a3->v.ob[0] - saved1; - c = saved1 - a1->v.ob[0]; - - f14 = ((a) * (b)) - ((e) * (d)); - f16 = ((e) * (f)) - ((c) * (b)); - f18 = ((c) * (d)) - ((a) * (f)); - - res = sqrtf(SQ(f14) + SQ(f16) + SQ(f18)); - - if (res < 0.001) { - res = 0.001; +void func_800AFC54(Vtx* vtx, s32 a, s32 b, s32 c, Vec3s out) { + s32 varA0; + s32 varA2; + s32 varA4; + s32 varB0; + s32 varB2; + s32 varB4; + s32 varC0; + s32 varC2; + s32 varC4; + f32 dx; + f32 dy; + f32 dz; + f32 length; + + varA0 = (vtx + a)->v.ob[0]; + varA2 = (vtx + a)->v.ob[1]; + varA4 = (vtx + a)->v.ob[2]; + + varB0 = (vtx + b)->v.ob[0]; + varB2 = (vtx + b)->v.ob[1]; + varB4 = (vtx + b)->v.ob[2]; + + varC0 = (vtx + c)->v.ob[0]; + varC2 = (vtx + c)->v.ob[1]; + varC4 = (vtx + c)->v.ob[2]; + + dx = ((varB2 - varA2) * (varC4 - varB4)) - ((varB4 - varA4) * (varC2 - varB2)); + dy = ((varB4 - varA4) * (varC0 - varB0)) - ((varB0 - varA0) * (varC4 - varB4)); + dz = ((varB0 - varA0) * (varC2 - varB2)) - ((varB2 - varA2) * (varC0 - varB0)); + + length = sqrtf((dx * dx) + (dy * dy) + (dz * dz)); + + if (length < 0.001) { + length = 0.001; } - - arg4[0] = f14 * (f32) (1.0 / res) * 120.0f; - arg4[1] = f16 * (f32) (1.0 / res) * 120.0f; - arg4[2] = f18 * (f32) (1.0 / res) * 120.0f; + length = 1.0 / length; + out[0] = (dx * length) * 120.0f; + out[1] = (dy * length) * 120.0f; + out[2] = (dz * length) * 120.0f; } -#else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AFC54.s") -#endif void func_800AFE00(Vtx* arg0, Vec3s* arg1, s32 arg2, s32 arg3) { s32 idx1; @@ -166,14 +162,16 @@ void func_800AFF58(Vtx* arg0) { } } -#ifdef NON_MATCHING -// Credit to SpazzyLemon for the updated and better attempt void func_800B0004(void) { Vtx* vtxs; - s32 res1, res2; - UNUSED u32 pad[0x5]; - s32 i, j; - + s32 res1; + s32 res2; + UNUSED u32 pad[0x4]; + s32 i; + s32 j; + s32 k; + s16 idx; + idx = 4; gSPLight(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_800E8688), LIGHT_1); gSPLight(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_800E8680), LIGHT_2); gSPNumLights(gDisplayListHead++, NUMLIGHTS_1); @@ -182,16 +180,16 @@ void func_800B0004(void) { SHADE); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); - - vtxs = D_8018EDB4 % 2 ? D_8018EDB8 : D_8018EDBC; + vtxs = (D_8018EDB4 % 2) ? (D_8018EDB8) : (D_8018EDBC); D_8018EDB2 = 0x9C0; for (i = 0; i < 10; i++) { - for (j = 0; j < 12; j++) { - res1 = sins(D_8018EDB0 - (j * D_8018EDB2)) * 84.0f * j * 0.18f; - res2 = sins(D_8018EDB0 - ((j + 1) * D_8018EDB2)) * 84.0f * (j + 1) * 0.18f; - func_800AF9E4(&(&vtxs[j * 4])[i * 48], j, i, 84, res1, res2, (j * 84), 84); + for (k = 0, j = 0; j < 12; j++, k += 84) { + res1 = ((sins(D_8018EDB0 - (j * D_8018EDB2)) * 84.0f) * j) * 0.18f; + res2 = ((sins(D_8018EDB0 - ((j + 1) * D_8018EDB2)) * 84.0f) * (j + 1)) * 0.18f; + func_800AF9E4(&(&vtxs[j * idx])[i * 48], j, i, 84, res1, res2, k, 84); } } + func_800AFF58(vtxs); D_8018EDB0 += D_8018EDB2; ++D_8018EDB4; @@ -199,6 +197,3 @@ void func_800B0004(void) { gSPNumLights(gDisplayListHead++, NUMLIGHTS_1); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); } -#else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B0004.s") -#endif diff --git a/src/code_800AF9B0.h b/src/code_800AF9B0.h index 94a00493d4..fa3f795df8 100644 --- a/src/code_800AF9B0.h +++ b/src/code_800AF9B0.h @@ -6,5 +6,6 @@ /* Function Prototypes */ void func_800AF9B0(void); void func_800B0004(void); +void func_800AFC54(Vtx* vtx, s32 a, s32 b, s32 c, Vec3s out); #endif /* CODE_800AF9B0_H */ diff --git a/src/cpu_vehicles_camera_path.c b/src/cpu_vehicles_camera_path.c new file mode 100644 index 0000000000..a382f9dcd3 --- /dev/null +++ b/src/cpu_vehicles_camera_path.c @@ -0,0 +1,4606 @@ +#include +#include +#include + +#include "cpu_vehicles_camera_path.h" +#include "math_util.h" +#include "code_800029B0.h" +#include "racing/memory.h" +#include "path.h" +#include "camera.h" +#include "actors.h" +#include "actors_extended.h" +#include "render_player.h" +#include "player_controller.h" +#include "update_objects.h" +#include "collision.h" +#include +#include "vehicles.h" +#include "render_objects.h" +#include "code_80057C60.h" +#include "bomb_kart.h" +#include "courses/all_course_data.h" +#include +#include +#include "main.h" +#include "menus.h" +#include "menu_items.h" +#include "audio/external.h" +#include "ending/podium_ceremony_actors.h" +#include "spawn_players.h" +#include "sounds.h" +#include "data/path_spawn_metadata.h" +#include "math_util_2.h" + +s32 unk_cpu_vehicles_camera_path_pad[24]; +Collision D_80162E70; +s16 D_80162EB0; // Possibly a float. +s16 D_80162EB2; // possibly [3] + +CPUBehaviour* gCoursesCPUBehaviour[NUM_COURSES - 1]; + +// more padding? +s32 D_80162F08[2]; + +s16 D_80162F10[30]; +s16 D_80162F50[30]; + +// padding, seemingly? +s32 D_80162F90[4]; + +Vec3f gOffsetPosition; +Vec3f D_80162FB0; +Vec3f D_80162FC0; +s16 gTrainSmokeTimer; +s16 sSomeNearestPathPoint; +s16 D_80162FD0; +f32 gCourseCompletionPercentByRank[NUM_PLAYERS]; +/* +The size of many of these arrays is weird. Based on their usage, they would only need +to be 8 entries long (enough for each player). But some are 10 or even 12 long. +Its plausible that this is just some decompilation artifact? +Or maybe at some point in development they had plans for more players? +*/ +s16 D_80162FF8[12]; +s16 D_80163010[12]; +f32 cpu_TargetSpeed[10]; +s16 gPreviousAngleSteering[12]; +f32 gTrackPositionFactor[10]; +f32 D_80163090[10]; +bool gIsPlayerInCurve[10]; +u16 gCurrentNearestPathPoint; +s16 gIsPlayerNewPathPoint; +s16 D_801630E8[10]; +s16 gFerrySmokeTimer; +s32 D_80163100[10]; +s32 D_80163128[10]; +s32 D_80163150[10]; +f32 gPreviousPlayerAiOffsetX[10]; +f32 gPreviousPlayerAiOffsetZ[10]; +s16 sVehicleSoundRenderCounter; +s32 D_801631CC; +TrackPathPoint* gCurrentTrackLeftPath; +TrackPathPoint* gCurrentTrackRightPath; +s16* gCurrentTrackSectionTypesPath; +s16* gCurrentPathPointExpectedRotationPath; +u16 D_801631E0[12]; +u16 D_801631F8[10]; +f32 gCurrentCpuTargetSpeed; +f32 gPreviousCpuTargetSpeed[10]; +s32 D_80163238; +u16 D_80163240[12]; +u16 gWrongDirectionCounter[12]; +u16 gIsPlayerWrongDirection[12]; +s32 gPreviousLapProgressScore[10]; +CPUBehaviour* sCurrentCPUBehaviour; +u16 gCurrentCPUBehaviourId[12]; +u16 gPreviousCPUBehaviourId[12]; +u16 cpu_BehaviourState[12]; +s16 sPlayerAngle[12]; +u16 gPlayersTrackSectionId[12]; +u16 D_80163330[10]; +u16 D_80163344[2]; +u16 D_80163348[2]; +u16 D_8016334C[2]; +u16 gSpeedCPUBehaviour[12]; +s32 gSizePath[4]; +s32 gIncrementUpdatePlayer; +s32 D_8016337C; +s16 gCurrentPlayerLookAhead[12]; +s16 D_80163398[12]; +s16 D_801633B0[12]; +s16 gPositionSwapTimer[12]; +s16 D_801633E0[12]; +s16 D_801633F8[12]; +s16 D_80163410[4]; +f32 D_80163418[4]; +f32 D_80163428[4]; +f32 D_80163438[4]; +s32 gPlayerPathIndex; +f32 gPathStartZ; +f32 gPreviousPlayerZ[10]; +s16 gBestRankedHumanPlayer; +s16 gIsInExtra; +s16 D_8016347C; +s16 D_8016347E; +s32 D_80163480; +s32 D_80163484; +s32 D_80163488; +s16 D_8016348C; +s16 cpu_enteringPathIntersection[12]; +s16 cpu_exitingPathIntersection[12]; +s16 D_801634C0[12]; +s16 bStopAICrossing[10]; +s16 D_801634EC; +s32 D_801634F0; +s32 D_801634F4; +TrackPositionFactorInstruction gPlayerTrackPositionFactorInstruction[10]; +Path2D* gVehicle2DPathPoint; +s32 gVehicle2DPathLength; +TrainStuff gTrainList[NUM_TRAINS]; +u16 isCrossingTriggeredByIndex[NUM_CROSSINGS]; +u16 sCrossingActiveTimer[NUM_CROSSINGS]; +PaddleBoatStuff gPaddleBoats[NUM_PADDLE_BOATS]; +VehicleStuff gBoxTruckList[NUM_RACE_BOX_TRUCKS]; +VehicleStuff gSchoolBusList[NUM_RACE_SCHOOL_BUSES]; +VehicleStuff gTankerTruckList[NUM_RACE_TANKER_TRUCKS]; +VehicleStuff gCarList[NUM_RACE_CARS]; +s32 D_80163DD8[4]; +BombKart gBombKarts[NUM_BOMB_KARTS_MAX]; +Collision D_80164038[NUM_BOMB_KARTS_MAX]; +struct unexpiredActors gUnexpiredActorsList[8]; +CpuItemStrategyData cpu_ItemStrategy[NUM_PLAYERS]; +s16 D_80164358; +s16 D_8016435A; +s16 D_8016435C; +s16 gGPCurrentRacePlayerIdByRank[12]; // D_80164360 +s16 D_80164378[12]; +s32 gLapCountByPlayerId[10]; // D_80164390 +s32 gGPCurrentRaceRankByPlayerId[10]; // D_801643B8 +s32 gPreviousGPCurrentRaceRankByPlayerId[10]; +s32 gGPCurrentRaceRankByPlayerIdDup[10]; +u16 gSelectedPathCount; +u16 gNearestPathPointByPlayerId[12]; +s32 gNumPathPointsTraversed[10]; +s16 gGetPlayerByCharacterId[10]; +s32 D_8016448C; +TrackPathPoint* gCurrentTrackPath; +f32 D_80164498[4]; +f32 gLapCompletionPercentByPlayerId[10]; // D_801644A8 +f32 gCourseCompletionPercentByPlayerId[10]; // D_801644D0 +s16 bInMultiPathSection[12]; +f32 gPlayerPathY[10]; +s16 D_80164538[12]; +TrackPathPoint* gTrackPaths[4]; +TrackPathPoint* gTrackLeftPaths[4]; +TrackPathPoint* gTrackRightPaths[4]; +s16* gTrackSectionTypes[4]; +s16* gPathExpectedRotation[4]; +s16* gTrackConsecutiveCurveCounts[4]; +u16 gPathIndexByPlayerId[12]; // D_801645B0 +u16 gPathCountByPathIndex[4]; // D_801645C8 +s32 D_801645D0[4]; +s16* gCurrentTrackConsecutiveCurveCountsPath; +s32 D_801645E8[4]; +f32 D_801645F8[4]; +s32 D_80164608[4]; +f32 D_80164618[4]; +s32 D_80164628[4]; +f32 D_80164638[4]; +f32 D_80164648[4]; +f32 D_80164658[4]; +s16 gNearestPathPointByCameraId[4]; +s16 D_80164670[4]; +s16 D_80164678[4]; +s16 D_80164680[4]; +f32 D_80164688[4]; +f32 D_80164698; +f32 D_8016469C; +f32 D_801646A0; +// start padding +s32 D_801646A4; +s32 D_801646A8; +s32 D_801646AC; +s32 D_801646B0; +s32 D_801646B4; +s32 D_801646B8; +s32 D_801646BC; +// end padding +s16 D_801646C0[4]; +u32 D_801646C8; +u16 D_801646CC; +UnkStruct_46D0 D_801646D0[4]; + +// Strings, presented by google translate! +// Note that these are EUC-JP encoded, see: +// https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP + +// Force sort immediately after goal +char* D_800EB710 = "ゴール直後の強制ソート\n"; +// Forced sort immediately after one goal in 2PGP +char* D_800EB728 = "2PGPで片方がゴール直後の強制ソート\n"; +// rank calculation error +char* D_800EB74C = "順位計算エラー!! (num %d) (rank %d) (e_rank %d)\n"; +// Bypass switching error!!!(num %d org_bipas %d bipas %d) +char* D_800EB780 = "バイパス切り替え エラー!!!(num %d org_bipas %d bipas %d)\n"; +char* D_800EB7BC = "(%d) rap %3d rate_count_F %10.2f rap_count_F %10.2f area %5d \n"; +// Enter the maze! enemy %d (%d --> %d) +char* D_800EB800 = "迷路に突入! enemy %d (%d --> %d)\n"; +// Out of the maze! enemy %d (%d --> %d) +char* D_800EB824 = "迷路から出た! enemy %d (%d --> %d)\n"; +char* D_800EB84C = "enemy voice set (%d slip_flag %x weapon %x)\n"; +// Spin Voice! ! (%d , name %d) +char* D_800EB87C = "スピンヴォイス!!(%d , name %d)\n"; +// Damage voice! ! (%d, name %d) +char* D_800EB8A0 = "ダメージヴォイス!!(%d, name %d)\n"; +char* D_800EB8C4 = "===== ENEMY DRIVE SUB (%d) =====\n"; +// omission +char* D_800EB8E8 = "ENEMY END(手抜き)\n\n"; +char* D_800EB8FC = "ENEMY END(手抜き)\n\n"; +char* D_800EB910 = "(1)enemy stick angle over!! (%d)\n"; +char* D_800EB934 = "ENEMY END\n\n"; +char* D_800EB940 = "(2)enemy stick angle over!! (%d)\n"; +char* D_800EB964 = "ENEMY END\n\n"; +// AREA ERR!!! (group not registered at current centerline %d) %d +char* D_800EB970 = "AREA ERR!!! (現在のセンターライン %d に未登録のグループです) %d\n"; +// AREA ERR!!! (Unregistered group) %d +char* D_800EB9B4 = "AREA ERR!!! (未登録のグループです) %d\n"; +// get_oga_area_sub_BP() ... Area not found! (b_num = %d) +char* D_800EB9DC = "get_oga_area_sub_BP() ... エリアが見つからないッス! (b_num = %d)\n"; +// Status: (%d, %d, %d) +char* D_800EBA20 = " 状況: (%d, %d, %d) \n"; +char* D_800EBA38 = "<%d> (%d, %d, %d) [%d] lng %f\n"; +// Wario Stadium Jump failed! ! ! (area %d, y %7.2f) +char* D_800EBA58 = "ワリオスタジアム ジャンプ失敗!!! (area %d, y %7.2f)\n"; +// I fell in the water! ! Forced to centerline (num %d: area %d ) (%d,%d,%d) +char* D_800EBA94 = "水に落ちた!! センターラインに強制移動しました (num %d: area %d ) (%d,%d,%d)\n"; +// Course match! ! (Slacking: with bump) Forced move to center line (num %d: area %d ==>%d) (group %d) (%d,%d,%d) +char* D_800EBAE4 = "こーすあうと!!(手抜き中:バンプ有り) センターラインに強制移動しました (num %d: area %d ==>%d) " + "(group %d) (%d,%d,%d)\n"; +// Course match! ! (Sitting corners: no bump) Forced move to center line (num %d: area %d ==>%d) (group %d) (%d,%d,%d) +char* D_800EBB60 = "こーすあうと!!(手抜き中:バンプ無し) センターラインに強制移動しました (num %d: area %d ==>%d) " + "(group %d) (%d,%d,%d)\n"; +// Course match! ! ! Recalculated area (num %d: area %d ==>%d) +char* D_800EBBDC = "こーすあうと!!! エリアを再計算しました (num %d: area %d ==>%d)\n"; +// Direct BOM(%d) (%7.2f, %7.2f, %7.2f) +char* D_800EBC24 = "直接指定のBOM(%d) (%7.2f, %7.2f, %7.2f) \n"; +char* D_800EBC50 = "BOM HIT CHECK\n"; +char* D_800EBC60 = "BOM HIT !!!!! (%d)\n"; +// BOM standby +char* D_800EBC74 = "BOM待機\n"; +char* D_800EBC80 = "RESULT BOM area(%d)\n"; +// BOM dropped. +char* D_800EBC98 = "BOM が 落ちました。\n"; +// Tortoise fire pillar SET failed (TABLE IS FULL) +char* D_800EBCB0 = "カメ用火柱 SET 失敗 (TABLE IS FULL)\n"; +// Red turtle fire pillar set error! (category %d) +char* D_800EBCD8 = "赤ガメ火柱セットエラー! (category %d)\n"; +// Blue turtle fire pillar set error! (category %d) +char* D_800EBD00 = "青ガメ火柱セットエラー! (category %d)\n"; +// Thorn Turtle Fire Pillar Set Error! (category %d) +char* D_800EBD28 = "トゲガメ火柱セットエラー! (category %d)\n"; +// Turtle Fire Pillar Initialization! ! +char* D_800EBD54 = "カメ火柱初期化!!\n"; +// Center line initialization +char* D_800EBD68 = "センターライン初期化\n"; +char* D_800EBD80 = "MAP NUMBER %d\n"; +char* D_800EBD90 = "center_EX ptr = %x %x (%x)\n"; +char* D_800EBDB4 = "\n"; +char* D_800EBDB8 = "center_BP[%d] ptr = %x %x (%x)\n"; +char* D_800EBDE0 = "side_point_L_BP[%d] ptr = %x %x (%x)\n"; +char* D_800EBE08 = "side_point_R_BP[%d] ptr = %x %x (%x)\n"; +char* D_800EBE30 = "curve_BP[%d] ptr = %x %x (%x)\n"; +char* D_800EBE58 = "angle_BP[%d] ptr = %x %x (%x)\n"; +char* D_800EBE80 = "short_cut_data_BP[%d] ptr = %x %x (%x)\n"; +char* D_800EBEA8 = "\n"; +// Ogawa total memory used = %d +char* D_800EBEAC = "小川の使用メモリー合計 = %d\n"; +// Enemy initialization +char* D_800EBECC = "敵初期化\n"; +// End of enemy initialization +char* D_800EBED8 = "敵初期化終了\n"; +// Bypass CENTER LINE Split start +char* D_800EBEE8 = "バイパス CENTER LINE 分割開始\n"; +// Read centerline from ROM (map:%d) +char* D_800EBF08 = "センターラインをROMから読みます (map:%d)\n"; +char* D_800EBF34 = "ROM center (BP%d) line adr. = %x (%x)\n"; +// Calculate centerline (map:%d) +char* D_800EBF5C = "センターラインを計算します (map:%d)\n"; +char* D_800EBF84 = "center (BP%d) line adr. = %x (%x)\n"; +char* D_800EBFA8 = "BP center_point_number : %d\n"; +// Centerline data error! ! +char* D_800EBFC8 = "センターライン データ エラー!!\n"; +// Bypass CENTER LINE split end (%d -> %d number) +char* D_800EBFEC = "バイパス CENTER LINE 分割終了 (%d -> %d 個)\n"; +// No center line. (map: %d) +char* D_800EC01C = "センターラインが ありません。(map:%d)\n"; +// side point calculation (bypass %d) +char* D_800EC044 = "サイドポイント計算 (バイパス %d)\n"; +// Curve data calculation (bypass %d) +char* D_800EC068 = "カーブデータ計算 (バイパス %d)\n"; +// No center line. (map: %d) +char* D_800EC088 = "センターラインが ありません。(map:%d)\n"; +// Angle data calculation (bypass %d) +char* D_800EC0B0 = "アングルデータ計算 (バイパス %d) \n"; +// No center line. (map: %d) +char* D_800EC0D4 = "センターラインが ありません。(map:%d)\n"; +// Shortcut data calculation (bypass %d) +char* D_800EC0FC = "ショートカットデータ計算 (バイパス %d)\n"; +char* D_800EC124 = "extern POINT rom_center_KT%d_BP%d[] = {\n"; +char* D_800EC150 = "\t{%d,%d,%d,%d},\n"; +char* D_800EC164 = "\t0x8000,0x8000,0x8000,0\n};\n\n"; +char* D_800EC184 = "area read from ROM (%d)\n"; +// Normal jump! ! ! (%d) +char* D_800EC1A0 = "ノーマルジャンプ!!!(%d)\n"; +// Turbo on! ! ! (%d) +char* D_800EC1BC = "ターボオン!!!(%d)\n"; +// No cutting corners! ! ! (%d) +char* D_800EC1D4 = "手抜き禁止!!!(%d)\n"; +// Action start data error! (num %d, act %d) +char* D_800EC1EC = "アクション開始データエラー!(num %d, act %d)\n"; +// Action end data error! (num %d, act %d, old_act_num %d) +char* D_800EC21C = "アクション終了データエラー!(num %d, act %d, old_act_num %d)\n"; +char* D_800EC25C = "SL : center_point_number : %d\n"; +// SL: CENTER LINE split start +char* D_800EC27C = "SL: CENTER LINE 分割開始\n"; +// SL: CENTER LINE split ended (%d -> %d indivual) +char* D_800EC298 = "SL: CENTER LINE 分割終了 (%d -> %d 個)\n"; +char* D_800EC2C0 = "SHIP : center_point_number : %d\n"; +// SHIP: CENTER LINE split start +char* D_800EC2E4 = "SHIP: CENTER LINE 分割開始\n"; +// SHIP: CENTER LINE split ended (%d -> %d indivual) +char* D_800EC300 = "SHIP: CENTER LINE 分割終了 (%d -> %d 個)\n"; +// General-purpose OBJ character initialization +char* D_800EC32C = "汎用OBJキャラ初期化\n"; +// SL OBJ settings +char* D_800EC344 = "SL OBJ設定\n"; +// SHIP OBJ settings +char* D_800EC350 = "SHIP OBJ設定\n"; +// Track OBJ settings +char* D_800EC360 = "トラックOBJ設定\n"; +// Bus OBJ setting +char* D_800EC374 = "バスOBJ設定\n"; +// Tank OBJ setting +char* D_800EC384 = "タンクOBJ設定\n"; +// RV OBJ settings +char* D_800EC394 = "RV OBJ設定\n"; +// Generic OBJ character initialization completed +char* D_800EC3A0 = "汎用OBJキャラ初期化終了\n"; +// horn (num %d, permit %d, %d) +char* D_800EC3BC = "クラクション (num %d, permit %d, %d)\n"; +char* D_800EC3E4 = "OGA CAMERA INIT (%d)\n"; +char* D_800EC3FC = "OGA CAMERA INIT END\n"; +// High speed camera ERR !!! (ncx = %f) +char* D_800EC414 = "高速カメラ ERR !!! (ncx = %f)\n"; +// High speed camera ERR !!! (ncz = %f) +char* D_800EC434 = "高速カメラ ERR !!! (ncz = %f)\n"; +// High speed camera ERR !!! (ecx = %f) +char* D_800EC454 = "高速カメラ ERR !!! (ecx = %f)\n"; +// High speed camera ERR !!! (ecz = %f) +char* D_800EC474 = "高速カメラ ERR !!! (ecz = %f)\n"; +char* D_800EC494 = "OGA DRIVERS POINT CAMERA MODE \n"; +char* D_800EC4B4 = "OGA WINNER CAMERA MODE \n"; +char* D_800EC4D0 = "OGA TIMEATTACK QUICK CAMERA INIT \n"; +char* D_800EC4F4 = "OGA BATTLE CAMERA INIT win(%d)\n"; +char* D_800EC514 = "GOAL! <> camera %d rank %d\n"; +char* D_800EC53C = "GOAL! <> camera %d rank %d\n"; +char* D_800EC568 = "GOAL! <> camera %d rank %d\n"; +// Camera and cart collided! ! ! +char* D_800EC594 = "カメラとカートが衝突しました!!! (%d)\n"; +char* D_800EC5C0 = "<<< ITEM OBJ NUMBER ERR !! >>> item %d obj_num %d \n"; +// <<< BANANA SET HOUSE >>> obj_num %d zure %f +char* D_800EC5F8 = "<<< BANANA SET 失敗 >>> obj_num %d zure %f \n"; +// BANANA Caught in owner check. (num %d) +char* D_800EC628 = "BANANA 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800EC65C = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800EC670 = "理由: category \n"; +// Reason: sparam +char* D_800EC684 = "理由: sparam \n"; +// Reason: num +char* D_800EC694 = "理由: num \n"; +char* D_800EC6A0 = "BANANA HOLD (num %d time %d hold_time %d)\n"; +// Installation Caught in BANANA owner check. (num %d) +char* D_800EC6D0 = "設置 BANANA 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800EC708 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800EC71C = "理由: category \n"; +// Reason: sparam +char* D_800EC730 = "理由: sparam \n"; +// Reason: num +char* D_800EC740 = "理由: num \n"; +// I put BANANA. (num %d) +char* D_800EC74C = "BANANA 置きました。 (num %d)\n"; +// <<< BANANA NAGE SET failed >>> obj_num %d +char* D_800EC76C = "<<< BANANA NAGE SET 失敗 >>> obj_num %d \n"; +// BANANA NAGE MOVE Caught in owner check. (num %d) +char* D_800EC798 = "BANANA NAGE MOVE 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800EC7D8 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800EC7EC = "理由: category \n"; +// Reason: sparam +char* D_800EC800 = "理由: sparam \n"; +// Reason: num +char* D_800EC810 = "理由: num \n"; +char* D_800EC81C = "BANANA NAGE END 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800EC858 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800EC86C = "理由: category \n"; +// Reason: sparam +char* D_800EC880 = "理由: sparam \n"; +// Reason: num +char* D_800EC890 = "理由: num \n"; +char* D_800EC89C = "G_SHELL HOLD (num %d time %d hold_time %d)\n"; +// <<< G_SHELL SET failed >>> obj_num %d +char* D_800EC8CC = "<<< G_SHELL SET 失敗 >>> obj_num %d \n"; +// <<< G_SHELL SET failed >>> object_count %d +char* D_800EC8F4 = "<<< G_SHELL SET 失敗 >>> object_count %d \n"; +// G_SHELL Caught in owner check. (num %d) +char* D_800EC920 = "G_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800EC954 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800EC968 = "理由: category \n"; +// Reason: sparam +char* D_800EC97C = "理由: sparam \n"; +// Reason: num +char* D_800EC98C = "理由: num \n"; +// Just before launch G_SHELL Caught in owner check. (num %d) +char* D_800EC998 = "発射直前 G_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800EC9D8 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800EC9EC = "理由: category \n"; +// Reason: sparam +char* D_800ECA00 = "理由: sparam \n"; +// Reason: num +char* D_800ECA10 = "理由: num \n"; +// G_SHELL firing (num %d) +char* D_800ECA1C = "G_SHELL 発射 (num %d)\n"; +char* D_800ECA34 = "R_SHELL HOLD (num %d time %d hold_time %d obj_num %d)\n"; +// <<< R_SHELL SET failed >>> obj_num %d +char* D_800ECA70 = "<<< R_SHELL SET 失敗 >>> obj_num %d \n"; +// <<< R_SHELL SET failed >>> object_count %d +char* D_800ECA98 = "<<< R_SHELL SET 失敗 >>> object_count %d \n"; +// R_SHELL Caught in owner check. (num %d) +char* D_800ECAC4 = "R_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800ECAF8 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800ECB0C = "理由: category \n"; +// Reason: sparam +char* D_800ECB20 = "理由: sparam \n"; +// Reason: num +char* D_800ECB30 = "理由: num \n"; +char* D_800ECB3C = "R_SHELL SHOOT (num %d time %d hold_time %d obj_num %d)\n"; +// Just before launch R_SHELL Caught in owner check. (num %d) +char* D_800ECB78 = "発射直前 R_SHELL 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800ECBB8 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800ECBCC = "理由: category \n"; +// Reason: sparam +char* D_800ECBE0 = "理由: sparam \n"; +// Reason: num +char* D_800ECBF0 = "理由: num \n"; +// R_SHELL firing (num %d) +char* D_800ECBFC = "R_SHELL 発射 (num %d)\n"; +char* D_800ECC14 = "S_BANANA HOLD (num %d time %d hold_time %d)\n"; +// <<< SUPER_BANANA SET failed >>> obj_num %d +char* D_800ECC44 = "<<< SUPER_BANANA SET 失敗 >>> obj_num %d \n"; +// <<< SUPER_BANANA SET failed >>> object_count %d +char* D_800ECC70 = "<<< SUPER_BANANA SET 失敗 >>> object_count %d \n"; +// S_BANANA Caught in owner check. (num %d) +char* D_800ECCA0 = "S_BANANA 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: category +char* D_800ECCD8 = "理由: category \n"; +// Reason: sparam +char* D_800ECCEC = "理由: sparam \n"; +// Reason: sb_ok +char* D_800ECCFC = "理由: sb_ok \n"; +char* D_800ECD0C = "S_BANANA RELEASE (num %d time %d )\n"; +// <<< FAKE IBOX SET failed >>> obj_num %d +char* D_800ECD34 = "<<< FAKE IBOX SET 失敗 >>> obj_num %d \n"; +// IBOX Caught in owner check. (num %d) +char* D_800ECD5C = "IBOX 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800ECD90 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800ECDA4 = "理由: category \n"; +// Reason: sparam +char* D_800ECDB8 = "理由: sparam \n"; +// Reason: num +char* D_800ECDC8 = "理由: num \n"; +char* D_800ECDD4 = "FBOX HOLD (num %d time %d hold_time %d)\n"; +// Installation IBOX owner check failed. (num %d) +char* D_800ECE00 = "設置 IBOX 所有者チェックに引っ掛かりました。(num %d)\n"; +// Reason: EXISTOBJ +char* D_800ECE38 = "理由: EXISTOBJ \n"; +// Reason: category +char* D_800ECE4C = "理由: category \n"; +// Reason: sparam +char* D_800ECE60 = "理由: sparam \n"; +// Reason: num +char* D_800ECE70 = "理由: num \n"; +// Ray START (%d) +char* D_800ECE7C = "雷START (%d)\n"; +// Ray END (%d) +char* D_800ECE8C = "雷END (%d)\n"; +// ---------- Initialization of commendation table +char* D_800ECE98 = "---------- 表彰台初期化\n"; +// map_number = %d -> 20 Rewriting. +char* D_800ECEB4 = "map_number = %d - > 20 書き換え中。\n"; +// OGA Recognition move begins +char* D_800ECEDC = "OGA 表彰 move 開始\n"; +// I called the display of the 4th place person. +char* D_800ECEF0 = "4位の人の表示をコールしました。\n"; +// Arrive at the podium +char* D_800ECF14 = "表彰台に到着\n"; +// Everyone gather! +char* D_800ECF24 = "全員集合!\n"; +// Arrive on the road +char* D_800ECF30 = "道路に到着\n"; +// 4th place finished +char* D_800ECF3C = "4位の人終了\n"; +// OGA commendation move end +char* D_800ECF4C = "OGA 表彰 move 終了\n"; +char* D_800ECF60 = "OGAWA DEBUG DRAW\n"; + +// utils function path, cpu, vehicle + +s16 get_angle_between_path(Vec3f arg0, Vec3f arg1) { + s16 temp_ret; + s16 phi_v1; + + temp_ret = get_xz_angle_between_points(arg0, arg1); + phi_v1 = temp_ret; + if (gIsMirrorMode != 0) { + phi_v1 = -temp_ret; + } + return phi_v1; +} + +bool is_collide_with_vehicle(f32 vehicleX, f32 vehicleZ, f32 vehicleVelocityX, f32 vehicleVelocityZ, f32 distanceX, + f32 distanceY, f32 playerX, f32 playerZ) { + f32 velocity; + f32 temp_f18; + + velocity = sqrtf((vehicleVelocityX * vehicleVelocityX) + (vehicleVelocityZ * vehicleVelocityZ)); + if (velocity < 0.01f) { + return false; + } + temp_f18 = + ((vehicleVelocityX / velocity) * (playerX - vehicleX)) + ((vehicleVelocityZ / velocity) * (playerZ - vehicleZ)); + if ((-distanceX < temp_f18) && (temp_f18 < distanceX)) { + temp_f18 = ((vehicleVelocityZ / velocity) * (playerX - vehicleX)) + + (-(vehicleVelocityX / velocity) * (playerZ - vehicleZ)); + if ((-distanceY < temp_f18) && (temp_f18 < distanceY)) { + return true; + } + } + return false; +} + +void adjust_position_by_angle(Vec3f newPos, Vec3f oldPos, s16 orientationY) { + f32 x_dist; + f32 z_dist; + f32 temp1; + f32 temp2; + f32 sine; + f32 cosine; + + if (gIsMirrorMode != 0) { + orientationY = -orientationY; + } + x_dist = newPos[0] - oldPos[0]; + z_dist = newPos[2] - oldPos[2]; + sine = sins(orientationY); + cosine = coss(orientationY); + temp1 = ((x_dist * cosine) + (z_dist * sine)); + temp2 = ((z_dist * cosine) - (x_dist * sine)); + newPos[0] = oldPos[0] + temp1; + newPos[2] = oldPos[2] + temp2; +} + +s32 set_vehicle_render_distance_flags(Vec3f vehiclePos, f32 renderDistance, s32 flags) { + Camera* camera; + Player* player; + f32 x; + f32 z; + f32 playerX; + f32 playerZ; + s32 i; + s32 flag; + s8 numScreens; + + x = vehiclePos[0]; + z = vehiclePos[2]; + switch (gActiveScreenMode) { + case SCREEN_MODE_1P: + numScreens = 1; + break; + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + numScreens = 2; + break; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + numScreens = gPlayerCount; + break; + default: + numScreens = 1; + break; + } + flag = flags; + if (!gDemoMode) { + player = gPlayerOne; + // Checks distance from each player. + for (i = 0; i < gPlayerCount; i++, player++) { + if (((player->type & PLAYER_HUMAN) != 0) && ((player->type & PLAYER_CPU) == 0)) { + playerX = player->pos[0]; + playerZ = player->pos[2]; + + // Is player within render distance + if (((playerX - renderDistance) < x) && ((playerX + renderDistance) > x) && + ((playerZ - renderDistance) < z) && ((playerZ + renderDistance) > z)) { + // Sets the render flag to on for each player. + flag |= (RENDER_VEHICLE << i); + } else { + // Sets the render flag to off for each player. + flag &= ~(RENDER_VEHICLE << i); + } + } + } + } else { // Demo cinematic uses the camera to check render distance + camera = camera1; + for (i = 0; i < numScreens; i++, camera++) { + playerX = camera->pos[0]; + playerZ = camera->pos[2]; + if (((playerX - renderDistance) < x) && (x < (playerX + renderDistance)) && + ((playerZ - renderDistance) < z) && (z < (playerZ + renderDistance))) { + flag |= (RENDER_VEHICLE << i); + } else { + flag &= ~(RENDER_VEHICLE << i); + } + } + } + return flag; +} + +void detect_wrong_player_direction(s32 playerId, Player* player) { + s16 playerAngle; + s16 rotationDifference; + s16 pathPointAngle; + s16 pathIndex; + u32 pathPoint; + + pathIndex = (s16) gPathIndexByPlayerId[playerId]; + pathPoint = gNearestPathPointByPlayerId[playerId]; + + playerAngle = (s16) ((s16) player->rotation[1] / DEGREES_CONVERSION_FACTOR); + pathPointAngle = (s16) ((s16) gPathExpectedRotation[pathIndex][pathPoint] / DEGREES_CONVERSION_FACTOR); + + rotationDifference = playerAngle - pathPointAngle; + + if (rotationDifference < 0) { + rotationDifference = -rotationDifference; + } + + if ((gNumPathPointsTraversed[playerId] < gPreviousLapProgressScore[playerId]) && + (rotationDifference >= SEVERE_WRONG_DIRECTION_MIN) && (rotationDifference < SEVERE_WRONG_DIRECTION_MAX)) { + gWrongDirectionCounter[playerId]++; + if ((gWrongDirectionCounter[playerId]) >= WRONG_DIRECTION_FRAMES_LIMIT) { + gIsPlayerWrongDirection[playerId] = 1; + gWrongDirectionCounter[playerId] = WRONG_DIRECTION_FRAMES_LIMIT; + gPlayers[playerId].effects |= REVERSE_EFFECT; + } + } else if ((rotationDifference < SEVERE_CORRECT_DIRECTION_MIN) || + (rotationDifference >= SEVERE_CORRECT_DIRECTION_MAX)) { + gIsPlayerWrongDirection[playerId] = 0; + gWrongDirectionCounter[playerId] = 0; + gPlayers[playerId].effects &= ~REVERSE_EFFECT; + } + gPreviousLapProgressScore[playerId] = gNumPathPointsTraversed[playerId]; +} + +void set_places(void) { + s32 temp_s2; + f32 temp_f0; + s32 rankPlayer[8]; + s32 a_really_cool_variable_name; + UNUSED s32 pad; + s32 numPlayer; + s32 playerId; + s32 temp_a0; + s32 var_t1_3; + + switch (gModeSelection) { + case BATTLE: + default: + return; // HEY! returns, not breaks + case GRAND_PRIX: + case TIME_TRIALS: + numPlayer = NUM_PLAYERS; + break; + case VERSUS: + numPlayer = gPlayerCount; + break; + } + + if (D_8016348C == 0) { + for (playerId = 0; playerId < numPlayer; playerId++) { + temp_a0 = gGPCurrentRacePlayerIdByRank[playerId]; + rankPlayer[playerId] = temp_a0; + gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByPlayerId[temp_a0]; + } + } else { + for (playerId = 0; playerId < numPlayer; playerId++) { + temp_a0 = gGPCurrentRacePlayerIdByRank[playerId]; + rankPlayer[playerId] = temp_a0; + gCourseCompletionPercentByRank[playerId] = -gTimePlayerLastTouchedFinishLine[temp_a0]; + } + } + + for (playerId = 0; playerId < numPlayer - 1; playerId++) { + if ((gPlayers[gGPCurrentRacePlayerIdByRank[playerId]].type & PLAYER_CINEMATIC_MODE)) { + continue; + } + + for (var_t1_3 = playerId + 1; var_t1_3 < numPlayer; var_t1_3++) { + if (gCourseCompletionPercentByRank[playerId] < gCourseCompletionPercentByRank[var_t1_3]) { + if (!(gPlayers[gGPCurrentRacePlayerIdByRank[var_t1_3]].type & 0x800)) { + temp_s2 = rankPlayer[playerId]; + rankPlayer[playerId] = rankPlayer[var_t1_3]; + rankPlayer[var_t1_3] = temp_s2; + temp_f0 = gCourseCompletionPercentByRank[playerId]; + gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByRank[var_t1_3]; + gCourseCompletionPercentByRank[var_t1_3] = temp_f0; + } + } + } + } + + for (playerId = 0; playerId < NUM_PLAYERS; playerId++) { + gPreviousGPCurrentRaceRankByPlayerId[playerId] = gGPCurrentRaceRankByPlayerId[playerId]; + } + + for (playerId = 0; playerId < numPlayer; playerId++) { + gGPCurrentRacePlayerIdByRank[playerId] = rankPlayer[playerId]; + gGPCurrentRaceRankByPlayerId[rankPlayer[playerId]] = playerId; + } + + for (playerId = 0; playerId < numPlayer; playerId++) { + a_really_cool_variable_name = D_80164378[playerId]; + rankPlayer[playerId] = a_really_cool_variable_name; + gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByPlayerId[a_really_cool_variable_name]; + } + + for (playerId = 0; playerId < numPlayer - 1; playerId++) { + for (var_t1_3 = playerId + 1; var_t1_3 < numPlayer; var_t1_3++) { + if (gCourseCompletionPercentByRank[playerId] < gCourseCompletionPercentByRank[var_t1_3]) { + temp_s2 = rankPlayer[playerId]; + rankPlayer[playerId] = rankPlayer[var_t1_3]; + rankPlayer[var_t1_3] = temp_s2; + temp_f0 = gCourseCompletionPercentByRank[playerId]; + gCourseCompletionPercentByRank[playerId] = gCourseCompletionPercentByRank[var_t1_3]; + gCourseCompletionPercentByRank[var_t1_3] = temp_f0; + } + } + } + + for (playerId = 0; playerId < numPlayer; playerId++) { + gGPCurrentRaceRankByPlayerIdDup[rankPlayer[playerId]] = playerId; + D_80164378[playerId] = rankPlayer[playerId]; + } +} + +void update_player_rankings(void) { + f32 temp_f0; + UNUSED s32 pad; + s32 playerIds[8]; + s32 temp_a0; + s32 temp_t2_2; + s32 compareIndex; + s32 i; + s32 numRacers; + + switch (gModeSelection) { + case BATTLE: + default: + return; // HEY! returns, not breaks + case GRAND_PRIX: + case TIME_TRIALS: + numRacers = 8; + break; + case VERSUS: + numRacers = gPlayerCount; + break; + } + + for (i = 0; i < numRacers; i++) { + temp_a0 = gGPCurrentRacePlayerIdByRank[i]; + playerIds[i] = temp_a0; + gCourseCompletionPercentByRank[i] = -gTimePlayerLastTouchedFinishLine[temp_a0]; + } + + for (i = 0; i < (numRacers - 1); i++) { + for (compareIndex = i + 1; compareIndex < numRacers; compareIndex++) { + if (gCourseCompletionPercentByRank[i] < gCourseCompletionPercentByRank[compareIndex]) { + temp_t2_2 = playerIds[i]; + playerIds[i] = playerIds[compareIndex]; + playerIds[compareIndex] = temp_t2_2; + temp_f0 = gCourseCompletionPercentByRank[i]; + gCourseCompletionPercentByRank[i] = gCourseCompletionPercentByRank[compareIndex]; + gCourseCompletionPercentByRank[compareIndex] = temp_f0; + } + } + } + + for (i = 0; i < NUM_PLAYERS; i++) { + gPreviousGPCurrentRaceRankByPlayerId[i] = gGPCurrentRaceRankByPlayerId[i]; + } + + for (i = 0; i < numRacers; i++) { + gGPCurrentRaceRankByPlayerId[playerIds[i]] = i; + gGPCurrentRacePlayerIdByRank[i] = playerIds[i]; + } +} + +void set_places_end_course_with_time(void) { + f32 temp_a0; + s32 temp; + s32 sp68[8]; + UNUSED s32 pad; + s32 temp_t1; + s32 i; + s32 j; + s32 this_loops_upper_bound_is_brough_to_you_by_the_number = 8; + + for (i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number;) { + gCourseCompletionPercentByRank[i++] = 0.0f; + } + + for (j = 0, i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number; i++) { + if (gPlayers[i].type & PLAYER_CINEMATIC_MODE) { + sp68[j] = i; + gCourseCompletionPercentByRank[j] = -gTimePlayerLastTouchedFinishLine[i]; + j++; + } + } + + temp_t1 = j; + for (i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number; i++) { + if (!(gPlayers[i].type & PLAYER_CINEMATIC_MODE)) { + sp68[j] = i; + gCourseCompletionPercentByRank[j] = gCourseCompletionPercentByPlayerId[i]; + j++; + } + } + + for (i = 0; i < (temp_t1 - 1); i++) { + for (j = i + 1; j < temp_t1; j++) { + if (gCourseCompletionPercentByRank[i] < gCourseCompletionPercentByRank[j]) { + temp = sp68[i]; + sp68[i] = sp68[j]; + sp68[j] = temp; + temp_a0 = gCourseCompletionPercentByRank[i]; + gCourseCompletionPercentByRank[i] = gCourseCompletionPercentByRank[j]; + gCourseCompletionPercentByRank[j] = temp_a0; + } + } + } + + for (i = temp_t1; i < (this_loops_upper_bound_is_brough_to_you_by_the_number - 1); i++) { + for (j = i + 1; j < this_loops_upper_bound_is_brough_to_you_by_the_number; j++) { + if (gCourseCompletionPercentByRank[i] < gCourseCompletionPercentByRank[j]) { + temp = sp68[i]; + sp68[i] = sp68[j]; + sp68[j] = temp; + temp_a0 = gCourseCompletionPercentByRank[i]; + gCourseCompletionPercentByRank[i] = gCourseCompletionPercentByRank[j]; + gCourseCompletionPercentByRank[j] = temp_a0; + } + } + } + + for (i = 0; i < NUM_PLAYERS; i++) { + gPreviousGPCurrentRaceRankByPlayerId[i] = gGPCurrentRaceRankByPlayerId[i]; + } + + for (i = 0; i < this_loops_upper_bound_is_brough_to_you_by_the_number; i++) { + gGPCurrentRaceRankByPlayerId[sp68[i]] = i; + gGPCurrentRacePlayerIdByRank[i] = sp68[i]; + } +} + +/** + * Checks if a path point is within a valid range of another path point, accounting for track wrapping + * + * @param pathPoint The path point to check + * @param currentPathPoint The reference path point + * @param backwardRange Number of path to look behind + * @param forwardRange Number of path to look ahead + * @param totalPathPoints Total number of path in the track + * @return + * 1: path point is within normal range + * -1: path point is within wrapped range + * 2: path point is out of range + * 0: invalid range parameters + */ +s32 is_path_point_in_range(u16 pathPoint, u16 currentPathPoint, u16 backwardRange, u16 forwardRange, + u16 totalPathPoints) { + s32 var_v1; + + var_v1 = 0; + if ((currentPathPoint >= backwardRange) && (currentPathPoint < (totalPathPoints - forwardRange))) { + if ((pathPoint >= (currentPathPoint - backwardRange)) && ((currentPathPoint + forwardRange) >= pathPoint)) { + var_v1 = 1; + } + } else if ((((currentPathPoint + forwardRange) % totalPathPoints) < pathPoint) && + ((((currentPathPoint + totalPathPoints) - backwardRange) % totalPathPoints) >= pathPoint)) { + var_v1 = -1; + } else { + var_v1 = 2; + } + return var_v1; +} + +// cpu util functions +#include "cpu_vehicles_camera_path/cpu_speed_control.inc.c" + +bool func_800088D8(s32 playerId, s16 arg1, s16 arg2) { + Player* player; + s16* temp_a3; + s32 progress; + f32 temp_f0; + s16 var_t1; + u16* var_a0_3; + s16 temp; + s16 temp2; + s32 i; + s32 var_a0; + s16 var_v0; + s16 var_a0_4; + s32* var_v1; + s16 STEMP_V1; + s16 STEMP_V0; + s16 rank; + + D_80163128[playerId] = -1; + D_80163150[playerId] = -1; + if (gModeSelection == TIME_TRIALS) { + return 1; + } + if (arg1 < 0) { + return 1; + } + if (arg1 >= 4) { + arg1 = 3; + } + if (D_80163330[playerId] == 1) { + return 1; + } + player = &gPlayers[playerId]; + if (player->type & PLAYER_HUMAN) { + return 1; + } + + temp_a3 = &GET_COURSE_800DCBB4(arg1 * 8); + if (arg2 == 0) { + if (gDemoMode == 1) { + STEMP_V0 = gNumPathPointsTraversed[playerId]; + STEMP_V1 = gNumPathPointsTraversed[D_80164378[7]]; + progress = STEMP_V0 - STEMP_V1; + if (progress < 0) { + progress = -progress; + } + if (arg1 < 3) { + STEMP_V0 = temp_a3[0]; + STEMP_V1 = temp_a3[8]; + temp_f0 = gLapCompletionPercentByPlayerId[playerId]; + var_a0 = (STEMP_V1 * temp_f0) + (STEMP_V0 * (1.0f - temp_f0)); + } else { + var_a0 = temp_a3[0]; + } + D_80163150[playerId] = var_a0; + if ((D_80163150[playerId] < progress) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { + return 0; + } + return 1; + } + + STEMP_V0 = gNumPathPointsTraversed[playerId]; + STEMP_V1 = gNumPathPointsTraversed[gBestRankedHumanPlayer]; + progress = STEMP_V0 - STEMP_V1; + rank = gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer]; + if (((((gPathCountByPathIndex[0] * 2) / 3)) < progress) && ((rank) >= 6)) { + STEMP_V0 = gNumPathPointsTraversed[playerId]; + STEMP_V1 = temp = gNumPathPointsTraversed[D_80164378[rank - 1]]; + progress = STEMP_V0 - STEMP_V1; + } + if (progress < 0) { + progress = -progress; + } + if (arg1 < 3) { + STEMP_V0 = temp_a3[0]; + STEMP_V1 = temp_a3[8]; + temp_f0 = gLapCompletionPercentByPlayerId[playerId]; + var_a0 = (STEMP_V1 * temp_f0) + (STEMP_V0 * (1.0f - temp_f0)); + } else { + var_a0 = temp_a3[0]; + } + D_80163150[playerId] = var_a0 = (gCCSelection + 1) * var_a0; + if ((var_a0 < progress) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { + return 0; + } + return 1; + } + + temp2 = D_80163344[0]; + STEMP_V0 = gNumPathPointsTraversed[playerId]; + STEMP_V1 = gNumPathPointsTraversed[temp2]; + progress = STEMP_V1 - STEMP_V0; + if (progress < 0) { + progress = -progress; + } + + var_v0 = 0; + for (i = 0; i < 2; i++) { + if (gGPCurrentRaceRankByPlayerId[D_80163344[i] & 0xFFFF] < arg2) { + var_v0++; + } + } + + var_a0_4 = 0; + for (i = 0; i < gPlayerCount; i++) { + if (gGPCurrentRaceRankByPlayerId[i] < arg2) { + var_a0_4++; + } + } + + // FAKE + var_t1 = (arg2 - (var_v0 & 0xFFFF)) - var_a0_4; + arg2 -= var_v0; + + if ((var_v0 > 0) || (var_a0_4 > 0)) { + var_t1++; + } + D_80164538[playerId] = var_t1; + if ((var_t1 < 0) || (var_t1 >= 8)) { + return 0; + } + if (arg1 < 3) { + STEMP_V0 = temp_a3[var_t1 + 0]; + STEMP_V1 = temp_a3[var_t1 + 8]; + temp_f0 = gLapCompletionPercentByPlayerId[playerId]; + var_a0 = (STEMP_V1 * temp_f0) + (STEMP_V0 * (1.0f - temp_f0)); + } else { + var_a0 = temp_a3[var_t1]; + } + D_80163128[playerId] = progress; + D_80163150[playerId] = var_a0; + if (var_a0 < progress) { + return 1; + } + return 0; +} + +void set_current_path(s32 pathIndex) { + gCurrentTrackPath = gTrackPaths[pathIndex]; + gCurrentTrackLeftPath = gTrackLeftPaths[pathIndex]; + gCurrentTrackRightPath = gTrackRightPaths[pathIndex]; + gCurrentTrackSectionTypesPath = gTrackSectionTypes[pathIndex]; + gCurrentPathPointExpectedRotationPath = gPathExpectedRotation[pathIndex]; + gCurrentTrackConsecutiveCurveCountsPath = gTrackConsecutiveCurveCounts[pathIndex]; + gSelectedPathCount = gPathCountByPathIndex[pathIndex]; +} + +s32 update_player_path_selection(s32 payerId, s32 pathIndex) { + f32 posX; + f32 posY; + f32 posZ; + Player* player; + s32 trackSectionId; + UNUSED s32 stackPadding; + + player = &gPlayers[payerId]; + posX = player->pos[0]; + posY = player->pos[1]; + posZ = player->pos[2]; + stackPadding = pathIndex; + trackSectionId = get_track_section_id(player->collision.meshIndexZX); + gPlayersTrackSectionId[payerId] = trackSectionId; + sSomeNearestPathPoint = find_closest_path_point_track_section(posX, posY, posZ, trackSectionId, &pathIndex); + gNearestPathPointByPlayerId[payerId] = sSomeNearestPathPoint; + if (pathIndex) {}; + gPathIndexByPlayerId[payerId] = pathIndex; + set_current_path(pathIndex); + if (stackPadding) {}; + return pathIndex; +} + +void update_player_completion(s32 playerId) { + f32 percent; + + // arbitrary score calculation + gNumPathPointsTraversed[playerId] = + (gLapCountByPlayerId[playerId] * gPathCountByPathIndex[0]) + sSomeNearestPathPoint; + + // calculate completion in percent + percent = (f32) gNearestPathPointByPlayerId[playerId] / (f32) gPathCountByPathIndex[gPathIndexByPlayerId[playerId]]; + gLapCompletionPercentByPlayerId[playerId] = percent; + gCourseCompletionPercentByPlayerId[playerId] = percent; + gCourseCompletionPercentByPlayerId[playerId] += gLapCountByPlayerId[playerId]; +} + +void yoshi_valley_cpu_path(s32 playerId) { + s16 previous; + + previous = bInMultiPathSection[playerId]; + if (sSomeNearestPathPoint >= 0x6D) { + bInMultiPathSection[playerId] = true; + switch (gPlayerPathIndex) { + case 0: + if (sSomeNearestPathPoint >= 0x20F) { + bInMultiPathSection[playerId] = false; + } + break; + case 1: + if (sSomeNearestPathPoint >= 0x206) { + bInMultiPathSection[playerId] = false; + } + break; + case 2: + if (sSomeNearestPathPoint >= 0x211) { + bInMultiPathSection[playerId] = false; + } + break; + case 3: + if (sSomeNearestPathPoint >= 0x283) { + bInMultiPathSection[playerId] = false; + } + break; + } + } + if ((previous == false) && (bInMultiPathSection[playerId] == true)) { + cpu_enteringPathIntersection[playerId] = true; + } + if ((previous == true) && (bInMultiPathSection[playerId] == false)) { + cpu_exitingPathIntersection[playerId] = true; + } +} + +void update_cpu_path_completion(s32 playerId, Player* player) { + f32 posX; + f32 posY; + f32 posZ; + UNUSED f32 pad[2]; + + posX = player->pos[0]; + posY = player->pos[1]; + posZ = player->pos[2]; + if (cpu_enteringPathIntersection[playerId] == 1) { + gPlayerPathIndex = update_player_path_selection(playerId, random_int(4)); + sSomeNearestPathPoint = update_player_path(posX, posY, posZ, 0, player, playerId, gPlayerPathIndex); + gNearestPathPointByPlayerId[playerId] = sSomeNearestPathPoint; + update_player_completion(playerId); + cpu_enteringPathIntersection[playerId] = 0; + } + if (cpu_exitingPathIntersection[playerId] == 1) { + gPlayerPathIndex = update_player_path_selection(playerId, 0); + sSomeNearestPathPoint = update_player_path(posX, posY, posZ, 0, player, playerId, gPlayerPathIndex); + gNearestPathPointByPlayerId[playerId] = sSomeNearestPathPoint; + update_player_completion(playerId); + cpu_exitingPathIntersection[playerId] = 0; + } +} + +/** + * Helps calculate time since player last touched finishline. + **/ +f32 func_80009258(UNUSED s32 playerId, f32 arg1, f32 arg2) { + f32 temp_f2 = gPathStartZ - arg2; + f32 temp_f12 = arg1 - gPathStartZ; + return gCourseTimer - ((COURSE_TIMER_ITER_f * temp_f2) / (temp_f2 + temp_f12)); +} + +void update_player_path_completion(s32 playerId, Player* player) { + f32 playerX; + f32 playerY; + f32 playerZ; + s32 var_v0; + UNUSED s16 pad; + f32 previousPlayerZ; + + playerX = player->pos[0]; + playerY = player->pos[1]; + playerZ = player->pos[2]; + previousPlayerZ = gPreviousPlayerZ[playerId]; + gIsPlayerNewPathPoint = false; + D_80163240[playerId] = 0; + sSomeNearestPathPoint = update_player_path(playerX, playerY, playerZ, gNearestPathPointByPlayerId[playerId], player, + playerId, gPlayerPathIndex); + gCurrentNearestPathPoint = sSomeNearestPathPoint; + if (gNearestPathPointByPlayerId[playerId] != sSomeNearestPathPoint) { + gNearestPathPointByPlayerId[playerId] = sSomeNearestPathPoint; + gIsPlayerNewPathPoint = true; + update_player_completion(playerId); + } + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + update_player_position_factor(playerId, sSomeNearestPathPoint, gPlayerPathIndex); + return; + } + if ((sSomeNearestPathPoint < 0x14) || ((gPathCountByPathIndex[gPlayerPathIndex] - 0x14) < sSomeNearestPathPoint) || + (gCurrentCourseId == COURSE_KALAMARI_DESERT)) { + s16 var_v1 = 0; + s16 var_t0 = 0; + if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { + D_801634EC = 0; + if (player->effects & STAR_EFFECT) { + D_801634EC = 1; + } + if (gIsMirrorMode != 0) { + if (playerX < 300.0f) { + var_v1 = 1; + var_t0 = 1; + } else if ((playerX < 1300.0f) && (gLapCountByPlayerId[playerId] < 2) && ((D_801634EC == 1))) { + var_v1 = 1; + var_t0 = 1; + } + } else { + if (playerX > -300.0f) { + var_v1 = 1; + var_t0 = 1; + } else { + if ((playerX > -1300.0f) && (gLapCountByPlayerId[playerId] < 2) && (D_801634EC == 1)) { + var_v1 = 1; + var_t0 = 1; + } + } + } + } else { + var_v1 = 1; + var_t0 = 1; + } + previousPlayerZ = gPreviousPlayerZ[playerId]; + if ((var_v1 != 0) && (playerZ <= gPathStartZ)) { + if (gPathStartZ < previousPlayerZ) { + gLapCountByPlayerId[playerId]++; + if ((gModeSelection == GRAND_PRIX) && (gLapCountByPlayerId[playerId] == 5)) { + if (gGPCurrentRaceRankByPlayerIdDup[playerId] == 7) { + // clang-format off + for (var_v0 = 0; var_v0 < NUM_PLAYERS; var_v0++) { gLapCountByPlayerId[var_v0]--; } // has to be one line to match + // clang-format on + } + } + D_80163240[playerId] = 1; + update_player_completion(playerId); + reset_cpu_behaviour(playerId); + cpu_ItemStrategy[playerId].numItemUse = 0; + if ((D_8016348C == 0) && !(player->type & PLAYER_CINEMATIC_MODE)) { + gTimePlayerLastTouchedFinishLine[playerId] = func_80009258(playerId, previousPlayerZ, playerZ); + } + } + } + if ((var_t0 != 0) && (previousPlayerZ <= gPathStartZ) && (gPathStartZ < playerZ)) { + gLapCountByPlayerId[playerId]--; + update_player_completion(playerId); + } + } + gPreviousPlayerZ[playerId] = playerZ; + if ((gCurrentCourseId == COURSE_YOSHI_VALLEY) && (gIsPlayerNewPathPoint == true)) { + yoshi_valley_cpu_path(playerId); + if (((player->type & PLAYER_HUMAN) == 0) || (player->type & PLAYER_CPU)) { + update_cpu_path_completion(playerId, player); + } + } + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { + detect_wrong_player_direction(playerId, player); + if ((gModeSelection == GRAND_PRIX) && (gPlayerCount == 2) && (playerId == 0)) { + if (gGPCurrentRaceRankByPlayerIdDup[PLAYER_ONE] < gGPCurrentRaceRankByPlayerIdDup[PLAYER_TWO]) { + gBestRankedHumanPlayer = PLAYER_ONE; + } else { + gBestRankedHumanPlayer = PLAYER_TWO; + } + } + } else { + //???? + } + update_player_position_factor(playerId, sSomeNearestPathPoint, gPlayerPathIndex); +} + +void update_vehicles(void) { + s32 i; + generate_player_smoke(); + D_8016337C++; + + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + for (i = 0; i < 7; i++) { + func_8000DF8C(i); + } + return; + } + + if (D_8016337C & 1) { + if (gModeSelection == VERSUS) { + for (i = 0; i < 7; i++) { + func_8000DF8C(i); + } + } +#if !ENABLE_CUSTOM_COURSE_ENGINE + switch (gCurrentCourseId) { + case COURSE_KALAMARI_DESERT: + update_vehicle_trains(); + break; + case COURSE_DK_JUNGLE: + update_vehicle_paddle_boats(); + break; + case COURSE_TOADS_TURNPIKE: + update_vehicle_box_trucks(); + update_vehicle_school_bus(); + update_vehicle_tanker_trucks(); + update_vehicle_cars(); + break; + } +#else + +#endif + } +} + +void play_cpu_sound_effect(s32 arg0, Player* player) { + if (D_80163398[arg0] >= 0xB) { + if ((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) || + (player->effects & LIGHTNING_STRIKE_EFFECT)) { + func_800C92CC(arg0, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0A)); + D_80163398[arg0] = 0; + } + } + if (D_801633B0[arg0] >= 0xB) { + if ((player->triggers & VERTICAL_TUMBLE_TRIGGER) || (player->triggers & HIT_BY_STAR_TRIGGER) || + (player->triggers & HIGH_TUMBLE_TRIGGER) || (player->triggers & LOW_TUMBLE_TRIGGER) || + (player->effects & SQUISH_EFFECT)) { + func_800C92CC(arg0, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0B)); + D_801633B0[arg0] = 0; + } + } +} + +void update_player_timer_sound(s32 playerId, UNUSED Player* unused) { + s32 otherPlayerId; + + if (gPositionSwapTimer[playerId] >= 0x65) { + for (otherPlayerId = 0; otherPlayerId < gPlayerCount; otherPlayerId++) { + // detect swap of positions + if ((gGPCurrentRaceRankByPlayerId[playerId] < gGPCurrentRaceRankByPlayerId[otherPlayerId]) && + (gGPCurrentRaceRankByPlayerId[playerId] == gPreviousGPCurrentRaceRankByPlayerId[otherPlayerId]) && + (gGPCurrentRaceRankByPlayerId[otherPlayerId] == gPreviousGPCurrentRaceRankByPlayerId[playerId])) { + func_800C92CC(playerId, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); + gPositionSwapTimer[playerId] = 0; + } + } + } + if (gPositionSwapTimer[playerId] < 0x3E8) { + gPositionSwapTimer[playerId]++; + } + if (D_80163398[playerId] < 0xC8) { + D_80163398[playerId]++; + } + if (D_801633B0[playerId] < 0xC8) { + D_801633B0[playerId]++; + } +} + +void update_player(s32 playerId) { + UNUSED s32 pad[14]; + s16 var_a0_2; + s16 newAngle; + u16 pathIndex; + + f32 distX; + f32 minAngle; + + s16 angle; + s16 steeringSensitivity; + + s32 maxAngle; + Player* player; + UNUSED s32 pad3[10]; + TrackPathPoint* pathPoint; + f32 onePointFive = 1.5f; + + player = &gPlayers[playerId]; + if ((s32) GET_COURSE_AIMaximumSeparation >= 0) { + D_80163100[playerId] += 1; + if (playerId == 0) { + gIncrementUpdatePlayer++; + if (gIncrementUpdatePlayer & 1) { + D_80163488 += 1; + } + } + if (!(player->type & PLAYER_EXISTS)) { + gNumPathPointsTraversed[playerId] = -0x00000014; + gCourseCompletionPercentByPlayerId[playerId] = -1000.0f; + gLapCompletionPercentByPlayerId[playerId] = -1000.0f; + return; + } + D_801633E0[playerId] = 0; + // clang-format off + if (player->pos[0] < gCourseMinX) { D_801633E0[playerId] = 1; } + if (gCourseMaxX < player->pos[0]) { D_801633E0[playerId] = 2; } + if (player->pos[2] < gCourseMinZ) { D_801633E0[playerId] = 3; } + if (gCourseMaxZ < player->pos[2]) { D_801633E0[playerId] = 4; } + // clang-format on + + if (!(player->lakituProps & HELD_BY_LAKITU) && !(player->lakituProps & LAKITU_SCENE)) { + gPlayerPathIndex = gPathIndexByPlayerId[playerId]; + set_current_path(gPlayerPathIndex); + switch (gCurrentCourseId) { /* irregular */ + case COURSE_KALAMARI_DESERT: + handle_trains_interactions(playerId, player); + if (playerId == 0) { + func_80013054(); + } + break; + case COURSE_DK_JUNGLE: + handle_paddle_boats_interactions(player); + break; + case COURSE_TOADS_TURNPIKE: + handle_box_trucks_interactions(playerId, player); + handle_school_buses_interactions(playerId, player); + handle_tanker_trucks_interactions(playerId, player); + handle_cars_interactions(playerId, player); + break; + } + if (player->type & PLAYER_CINEMATIC_MODE) { + player->effects &= ~REVERSE_EFFECT; + player->kartProps &= ~BACK_UP; + } + update_player_path_completion(playerId, player); + if ((gCurrentCourseId != COURSE_AWARD_CEREMONY) && ((D_80163240[playerId] == 1) || (playerId == 0))) { + set_places(); + } + if (player->type & PLAYER_CPU) { + if ((gIsPlayerNewPathPoint == true) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { + cpu_behaviour(playerId); + } + // one update it try to use an item, the other it doesn't + if ((playerId & 1) != (gIncrementUpdatePlayer & 1)) { + cpu_use_item_strategy(playerId); + } + update_player_timer_sound(playerId, player); + D_80162FD0 = 0; + switch (gModeSelection) { /* switch 1; irregular */ + case 1: /* switch 1 */ + case 2: /* switch 1 */ + case 3: /* switch 1 */ + break; + case 0: /* switch 1 */ + break; + } + D_801631E0[playerId] = false; + if ((player->effects & LOST_RACE_EFFECT) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { + D_801631E0[playerId] = true; + } + if ((D_801646CC == 1) || (player->type & PLAYER_CINEMATIC_MODE) || + (gCurrentCourseId == COURSE_AWARD_CEREMONY)) { + if (gCurrentCourseId != COURSE_TOADS_TURNPIKE) { + gPlayerTrackPositionFactorInstruction[playerId].target = 0.0f; + } + gPlayerTrackPositionFactorInstruction[playerId].unkC = 0.0f; + } + if (gPlayerPathIndex > 0) { + gPlayerTrackPositionFactorInstruction[playerId].target = 0.0f; + gPlayerTrackPositionFactorInstruction[playerId].unkC = 0.0f; + } + gPlayerPathY[playerId] = + gTrackPaths[gPlayerPathIndex][gNearestPathPointByPlayerId[playerId]].posY + 4.3f; + if ((D_801631F8[playerId] == 1) && (D_801631E0[playerId] == false)) { + func_8002E4C4(player); + } + if (D_801631E0[playerId] == true) { + player->pos[1] = gPlayerPathY[playerId]; + } + D_801631F8[playerId] = D_801631E0[playerId]; + switch (gCurrentCourseId) { + case COURSE_YOSHI_VALLEY: + case COURSE_AWARD_CEREMONY: + gPlayerTrackPositionFactorInstruction[playerId].target = 0.0f; + break; + default: + break; + case COURSE_TOADS_TURNPIKE: + update_player_track_position_factor_from_box_trucks(playerId); + update_player_track_position_factor_from_buses(playerId); + update_player_track_position_factor_from_tanker_truck(playerId); + update_player_track_position_factor_from_cars(playerId); + break; + } + if (D_801631E0[playerId] == true) { + D_801630E8[playerId] = 0; + player->effects &= ~DRIFTING_EFFECT; + if ((playerId & 1) != (gIncrementUpdatePlayer & 1)) { + apply_cpu_turn(player, 0); + regulate_cpu_speed(playerId, gPreviousCpuTargetSpeed[playerId], player); + return; + } + if ((gPlayerCount > 0) && (gPlayerCount < 3) && (D_80163330[playerId] == 1) && + (D_8016334C[playerId] < gGPCurrentRaceRankByPlayerId[playerId])) { + gPreviousCpuTargetSpeed[playerId] = 8.333333f; + } else if (D_80162FD0 == (s16) 1U) { + gPreviousCpuTargetSpeed[playerId] = GET_COURSE_D_0D0096B8(gCCSelection); + gPlayerTrackPositionFactorInstruction[playerId].target = -0.5f; + } else if (gCurrentTrackConsecutiveCurveCountsPath[sSomeNearestPathPoint] > 0) { + gPreviousCpuTargetSpeed[playerId] = GET_COURSE_cpu_CurveTargetSpeed(gCCSelection); + } else { + gPreviousCpuTargetSpeed[playerId] = GET_COURSE_cpu_NormalTargetSpeed(gCCSelection); + } + check_ai_crossing_distance(playerId); + cpu_track_position_factor(playerId); + determine_ideal_cpu_position_offset(playerId, gCurrentNearestPathPoint); + distX = gOffsetPosition[0] - player->pos[0]; + minAngle = gOffsetPosition[2] - player->pos[2]; + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT) && + !(player->effects & BANANA_NEAR_SPINOUT_EFFECT)) { + if (((distX * distX) + (minAngle * minAngle)) > 6400.0f) { + if (gPlayerPathIndex == 0) { + func_8000B140(playerId); + if (D_80162FF8[playerId] > 0) { + pathIndex = gCurrentNearestPathPoint + 5; + pathIndex %= gSelectedPathCount; + set_track_offset_position(pathIndex, D_80163090[playerId], gPlayerPathIndex); + } + } + player->rotation[1] = -get_xz_angle_between_points(player->pos, gOffsetPosition); + } else { + player->rotation[1] = + gPathExpectedRotation[gPlayerPathIndex] + [(gCurrentNearestPathPoint + 4) % gSelectedPathCount]; + } + } + apply_cpu_turn(player, 0); + regulate_cpu_speed(playerId, gPreviousCpuTargetSpeed[playerId], player); + return; + } + if ((D_801630E8[playerId] == 1) || (D_801630E8[playerId] == -1)) { + player->effects |= DRIFTING_EFFECT; + } + if (D_801630E8[playerId] != 0) { + sPlayerAngle[playerId] = -get_xz_angle_between_points(player->oldPos, player->pos); + var_a0_2 = + (gCurrentPathPointExpectedRotationPath[(sSomeNearestPathPoint + 2) % gSelectedPathCount] * + 0x168) / + 65535; + newAngle = (sPlayerAngle[playerId] * 0x168) / 65535; + if (var_a0_2 < -0xB4) { + var_a0_2 += 0x168; + } + if (var_a0_2 > 0xB4) { + var_a0_2 -= 0x168; + } + if (newAngle < -0xB4) { + newAngle += 0x168; + } + if (newAngle > 0xB4) { + newAngle -= 0x168; + } + steeringSensitivity = var_a0_2 - newAngle; + if (steeringSensitivity < -0xB4) { + steeringSensitivity += 0x168; + } + if (steeringSensitivity > 0xB4) { + steeringSensitivity -= 0x168; + } + switch (D_801630E8[playerId]) { + case -1: + if (steeringSensitivity > 5) { + D_801630E8[playerId] = 0; + player->effects &= ~DRIFTING_EFFECT; + } + break; + case 1: + if (steeringSensitivity < -5) { + D_801630E8[playerId] = 0; + player->effects &= ~DRIFTING_EFFECT; + } + break; + default: + break; + } + } + + if ((playerId & 1) != (gIncrementUpdatePlayer & 1)) { + apply_cpu_turn(player, gPreviousAngleSteering[playerId]); + regulate_cpu_speed(playerId, gPreviousCpuTargetSpeed[playerId], player); + return; + } + gIsPlayerInCurve[playerId] = are_in_curve(playerId, sSomeNearestPathPoint); + determine_ideal_cpu_position_offset(playerId, sSomeNearestPathPoint); + if (gCurrentCourseId != COURSE_AWARD_CEREMONY) { + if (gNumPathPointsTraversed[playerId] < 0xB) { + pathIndex = gCurrentNearestPathPoint; + if ((gNumPathPointsTraversed[playerId] > 0) && (gCurrentCourseId == COURSE_TOADS_TURNPIKE)) { + pathIndex += 0x14; + pathIndex %= gSelectedPathCount; + set_track_offset_position(pathIndex, 0.0f, 0); + gPlayerTrackPositionFactorInstruction[playerId].target = 0.0f; + } else { + pathIndex += 8; + pathIndex %= gSelectedPathCount; + set_track_offset_position(pathIndex, gTrackPositionFactor[playerId], gPlayerPathIndex); + gPlayerTrackPositionFactorInstruction[playerId].current = gTrackPositionFactor[playerId]; + } + } + if ((D_80162FD0 == 1) && (D_80162FF8[playerId] == 0)) { + pathIndex = gCurrentNearestPathPoint + 7; + pathIndex %= gSelectedPathCount; + set_track_offset_position(pathIndex, -0.7f, gPlayerPathIndex); + } + if (1) {} + if (1) {} + if (1) {} + if (1) {} + if (1) {} + if (1) {} + if (gPlayerPathIndex == 0) { + func_8000B140(playerId); + if (D_80162FF8[playerId] > 0) { + pathIndex = gCurrentNearestPathPoint + 5; + + pathIndex %= gSelectedPathCount; + set_track_offset_position(pathIndex, D_80163090[playerId], gPlayerPathIndex); + } + } + } + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + switch (D_80163410[playerId]) { /* switch 3; irregular */ + case 3: /* switch 3 */ + gOffsetPosition[0] = D_80163418[playerId]; + gOffsetPosition[2] = D_80163438[playerId]; + break; + case 4: /* switch 3 */ + pathPoint = &gTrackPaths[playerId][(gNearestPathPointByPlayerId[playerId] + 0xA) % + gPathCountByPathIndex[playerId]]; + gOffsetPosition[0] = pathPoint->posX; + gOffsetPosition[2] = pathPoint->posZ; + break; + } + } + gOffsetPosition[0] = (gPreviousPlayerAiOffsetX[playerId] + gOffsetPosition[0]) * 0.5f; // average + gOffsetPosition[2] = (gPreviousPlayerAiOffsetZ[playerId] + gOffsetPosition[2]) * 0.5f; // average + gPreviousPlayerAiOffsetX[playerId] = gOffsetPosition[0]; + gPreviousPlayerAiOffsetZ[playerId] = gOffsetPosition[2]; + minAngle = onePointFive * 182.0f; + maxAngle = -onePointFive * 182.0f; + + angle = -get_xz_angle_between_points(player->pos, gOffsetPosition); + angle -= (newAngle = player->rotation[1]); + if ((s16) minAngle < angle) { + angle = minAngle; + } + if (angle < (s16) maxAngle) { + angle = maxAngle; + } + steeringSensitivity = GET_COURSE_AISteeringSensitivity; + switch (gCurrentTrackSectionTypesPath[playerId]) { /* switch 4; irregular */ + case RIGHT_CURVE: /* switch 4 */ + if (gTrackPositionFactor[playerId] > (0.5f * 1.0f)) { + steeringSensitivity = 0x0014; + } + if (gTrackPositionFactor[playerId] < -0.5f) { + steeringSensitivity = 0x0035; + } + break; + case LEFT_CURVE: /* switch 4 */ + if (gTrackPositionFactor[playerId] > 0.5f) { + steeringSensitivity = 0x0035; + } + if (gTrackPositionFactor[playerId] < -0.5f) { + steeringSensitivity = 0x0014; + } + break; + } + if ((cpu_BehaviourState[playerId] == CPU_BEHAVIOUR_STATE_RUNNING) && + ((gTrackPositionFactor[playerId] > 0.9f) || (gTrackPositionFactor[playerId] < -0.9f))) { + D_801630E8[playerId] = 0; + player->effects &= ~DRIFTING_EFFECT; + } + if (player->effects & HOP_EFFECT) { + switch (D_801630E8[playerId]) { + case 1: + newAngle = 0x0035; + break; + case -1: + newAngle = -0x0035; + break; + default: + newAngle = + (gPreviousAngleSteering[playerId] + ((angle * steeringSensitivity) / minAngle)) / 2; + break; + } + } else if (player->effects & (UNKNOWN_EFFECT_0x10000000 | MIDAIR_EFFECT | BOOST_RAMP_WOOD_EFFECT)) { + newAngle = 0; + } else { + newAngle = (gPreviousAngleSteering[playerId] + ((angle * steeringSensitivity) / minAngle)) / 2; + } + apply_cpu_turn(player, newAngle); + gPreviousAngleSteering[playerId] = newAngle; + if ((gIsPlayerInCurve[playerId] == true) || (D_801630E8[playerId] == 1) || + (D_801630E8[playerId] == -1) || + (player->effects & (UNKNOWN_EFFECT_0x10000000 | MIDAIR_EFFECT | BOOST_RAMP_WOOD_EFFECT))) { + cpu_TargetSpeed[playerId] = GET_COURSE_cpu_CurveTargetSpeed(gCCSelection); + } else { + cpu_TargetSpeed[playerId] = GET_COURSE_cpu_NormalTargetSpeed(gCCSelection); + } + if ((gTrackPositionFactor[playerId] > 0.9f) || (gTrackPositionFactor[playerId] < -0.9f)) { + cpu_TargetSpeed[playerId] = GET_COURSE_cpu_OffTrackTargetSpeed(gCCSelection); + } + if (D_80162FD0 == 1) { + cpu_TargetSpeed[playerId] = GET_COURSE_D_0D0096B8(gCCSelection); + } + if ((D_801630E8[playerId] == 2) || (D_801630E8[playerId] == -2) || (D_801630E8[playerId] == 3)) { + cpu_TargetSpeed[playerId] = 3.3333333f; + } + gCurrentCpuTargetSpeed = cpu_TargetSpeed[playerId]; + player->effects &= ~CPU_FAST_EFFECT; + gPreviousCpuTargetSpeed[playerId] = gCurrentCpuTargetSpeed; + check_ai_crossing_distance(playerId); + regulate_cpu_speed(playerId, gCurrentCpuTargetSpeed, player); + } + } + } +} + +void func_8000B140(s32 playerId) { + s32 i; + f32 temp_f12; + f32 temp_f14; + s32 j; + f32 temp_f16; + f32 temp_ft2; + s16 currPathPoint; + s16 temp_v1_2; + f32 temp_f22; + f32 temp_f0_2; + f32 var_f18; + f32 var_f20; + UNUSED s32 pad[5]; + s16 spB0[8]; + UNUSED f32 pad2; + s16 sp9C[8]; + UNUSED f32 pad3; + f32 temp_f2; + f32 sp74[8]; + s32 temp_a1_2; + Player* player; + player = &gPlayers[playerId]; + + if (player->effects & DRIFTING_EFFECT) { + return; + } + + if (D_801630E8[playerId] == 1) { + return; + } + + if (D_801630E8[playerId] == -1) { + return; + } + + if (gTrackPositionFactor[playerId] < -1.0f) { + return; + } + + if (gTrackPositionFactor[playerId] > 1.0f) { + return; + } + + // Exclude heavyweights + if (player->characterId == WARIO) { + return; + } + + if (player->characterId == BOWSER) { + return; + } + + if (player->characterId == DK) { + return; + } + + // Skip if player has star + if (player->effects & STAR_EFFECT) { + return; + } + + currPathPoint = gNearestPathPointByPlayerId[playerId]; + temp_f22 = (player->speed / 18.0f) * 216.0f; + for (i = 0; i < 8; i++) { + sp9C[i] = -1; + spB0[i] = 0x03E8; + } + + if (D_80163010[playerId] > 0) { + D_80163010[playerId]--; + if (D_80163010[playerId] <= 0) { + D_80162FF8[playerId] = 0; + } + } + j = 0; + i = 0; + while (i < 8) { + if (i != playerId) { + player = &gPlayers[i]; + if ((player->type & PLAYER_EXISTS)) { + temp_v1_2 = gNearestPathPointByPlayerId[i]; + temp_f0_2 = (player->speed / 18.0f) * 216.0f; + temp_f2 = temp_f22 - 5.0f; + if (temp_f0_2 < temp_f2) { + if (is_path_point_in_range(temp_v1_2, currPathPoint, 0, 0x0014U, gSelectedPathCount) > 0) { + temp_a1_2 = temp_v1_2 - currPathPoint; + sp9C[j] = i; + if (temp_a1_2 > 0) { + spB0[j] = temp_a1_2; + } else { + spB0[j] = (temp_v1_2 + gSelectedPathCount) - currPathPoint; + } + sp74[j] = temp_f2 - temp_f0_2; + j++; + } + } + } + } + i++; + if (j >= 2) { + break; + } + } + + if (j == 0) { + return; + } + + var_f18 = 1.0f; + var_f20 = -1.0f; + for (i = 0; i < j; i++) { + temp_f2 = gTrackPositionFactor[sp9C[i]]; + if ((temp_f2 > (-1.0f)) && (temp_f2 < 1.0f)) { + + temp_f12 = temp_ft2 = ((0.2f * (20.0f / (spB0[i] + 20.0f))) * ((sp74[i]) + 10.0f)) / 20.0f; + + if ((var_f18 == 1.0f) && (var_f20 == (-1.0f))) { + var_f18 = temp_f2 - temp_f12; + var_f20 = temp_f2 + temp_f12; + } else { + temp_f14 = temp_f2 - temp_f12; + temp_f16 = temp_f2 + temp_f12; + if ((temp_f14 < var_f18) && (temp_f16 > var_f18)) { + var_f18 = temp_f14; + } + if ((temp_f16 > var_f20) && (temp_f14 < var_f20)) { + var_f20 = temp_f16; + } + } + } + } + + if (var_f20 < var_f18) { + return; + } + + if (gTrackPositionFactor[playerId] < var_f18) { + return; + } + + if (var_f20 < gTrackPositionFactor[playerId]) { + return; + } + + if (var_f20 > 1.0f) { + var_f20 = 1.0f; + } + if (var_f18 < (-1.0f)) { + var_f18 = -1.0f; + } + if ((var_f18 + 1.0f) < (1.0f - var_f20)) { + D_80163010[playerId] = 0x003C; + D_80162FF8[playerId] = 1; + D_80163090[playerId] = var_f20; + } else { + D_80163010[playerId] = 0x003C; + D_80162FF8[playerId] = 2; + D_80163090[playerId] = var_f18; + } +} + +// utils track position + +#include "cpu_vehicles_camera_path/path_utils.inc.c" + +// bomb_kart utils + +#include "cpu_vehicles_camera_path/bomb_kart.inc.c" + +// actor utils + +#include "cpu_vehicles_camera_path/actor_utils.inc.c" + +void func_8000F0E0(void) { + s32 i; + for (i = 0; i < 4; i++) { + D_80164670[i] = 0; + D_80164678[i] = 0; + } +} + +void func_8000F124(void) { + s32 shouldContinue; + s32 i, j; + + for (j = 0; j < 2; j++) { + D_80163348[j] = 0; + } + + if (gDemoMode == 1) { + return; + } + if (gModeSelection != GRAND_PRIX) { + return; + } + + for (i = 0; i < 2; i++) { + + while (1) { + D_80163348[i] = random_int(NUM_PLAYERS); + + if (gPlayerCount > 2) { + break; + } + if (gPlayerCount < 1) { + break; + } + + shouldContinue = false; + + for (j = 0; j < gPlayerCount; j++) { + if (gCharacterSelections[j] == D_80163348[i]) { + shouldContinue = true; + } + } + for (j = 0; j < i; j++) { + if (D_80163348[j] == D_80163348[i]) { + shouldContinue = true; + } + } + if (shouldContinue == false) { + break; + } + } + } +} + +// Delete track path +void clear_path_point(TrackPathPoint* arg0, size_t size) { + bzero((void*) arg0, size * sizeof(TrackPathPoint)); +} + +// Appears to allocate memory for each course. +void init_course_path_point(void) { + + struct _struct_gCoursePathSizes_0x10* ptr = &GET_COURSE_PathSizes; + s32 temp; + s32 i; + + gSizePath[0] = (s32) ptr->firstPath; + gSizePath[1] = (s32) ptr->secondPath; + gSizePath[2] = (s32) ptr->thirdPath; + gSizePath[3] = (s32) ptr->fourthPath; + + temp = ptr->unk8; + gVehicle2DPathPoint = get_next_available_memory_addr(temp * 4); + + // Podium ceremony appears to allocate 1 * 8 bytes of data. Which would be aligned to 0x10. + for (i = 0; i < 4; i++) { + gTrackPaths[i] = get_next_available_memory_addr(gSizePath[i] * sizeof(TrackPathPoint)); + gTrackLeftPaths[i] = get_next_available_memory_addr(gSizePath[i] * sizeof(TrackPathPoint)); + gTrackRightPaths[i] = get_next_available_memory_addr(gSizePath[i] * sizeof(TrackPathPoint)); + gTrackSectionTypes[i] = get_next_available_memory_addr(gSizePath[i] * sizeof(s16)); + gPathExpectedRotation[i] = get_next_available_memory_addr(gSizePath[i] * sizeof(s16)); + gTrackConsecutiveCurveCounts[i] = get_next_available_memory_addr(gSizePath[i] * sizeof(s16)); + } + + gCurrentTrackPath = gTrackPaths[0]; + gCurrentTrackLeftPath = gTrackLeftPaths[0]; + gCurrentTrackRightPath = gTrackRightPaths[0]; + gCurrentTrackSectionTypesPath = gTrackSectionTypes[0]; + gCurrentPathPointExpectedRotationPath = gPathExpectedRotation[0]; + gCurrentTrackConsecutiveCurveCountsPath = gTrackConsecutiveCurveCounts[0]; + + // zero allocated memory? + //! @warning does not appear to zero all the above allocated variables. + for (i = 0; i < 4; i++) { + clear_path_point(gTrackPaths[i], gSizePath[i]); + clear_path_point(gTrackLeftPaths[i], gSizePath[i]); + clear_path_point(gTrackRightPaths[i], gSizePath[i]); + } + + // Skip several cpu cycles. + for (i = 0; i < 4; i++) {} + + for (i = 0; i < 4; i++) { + if (gSizePath[i] >= 2) { + load_track_path(i); + calculate_track_boundaries(i); + analize_track_section(i); + analyse_angle_path(i); + analisze_curved_path(i); + } + } + + gSelectedPathCount = *gPathCountByPathIndex; +#if !ENABLE_CUSTOM_COURSE_ENGINE + switch (gCurrentCourseId) { + case COURSE_KALAMARI_DESERT: + generate_train_path(); + init_vehicles_trains(); + break; + case COURSE_DK_JUNGLE: + generate_ferry_path(); + init_vehicles_ferry(); + break; + case COURSE_TOADS_TURNPIKE: + init_vehicles_box_trucks(); + init_vehicles_school_buses(); + init_vehicles_trucks(); + init_vehicles_cars(); + break; + } +#else + +#endif + set_bomb_kart_spawn_positions(); + func_8000EEDC(); +} + +void init_players(void) { + + UNUSED Camera* camera; + s32 temp_v0_3; + s32 i; + TrackPositionFactorInstruction* var_s5; + UNUSED s32 temp_v1; + UNUSED s32 pad; + + for (i = 0; i < NUM_PLAYERS; i++) { + Player* player = &gPlayerOne[i]; + + gPreviousAngleSteering[i] = 0; + D_80162FF8[i] = 0; + D_80163010[i] = 0; + if (gCurrentCourseId < (NUM_COURSES - 1)) { + update_player_position_factor(i, 0, 0); + } + cpu_TargetSpeed[i] = GET_COURSE_cpu_CurveTargetSpeed(gCCSelection); + D_801630E8[i] = 0; + D_80163100[i] = 0; + gPreviousPlayerAiOffsetX[i] = 0.0f; + gPreviousPlayerAiOffsetZ[i] = 0.0f; + gPreviousCpuTargetSpeed[i] = 0.0f; + gLapCountByPlayerId[i] = -1; + gCourseCompletionPercentByPlayerId[i] = 0.0f; + gTimePlayerLastTouchedFinishLine[i] = 0.0f; + if (gModeSelection == GRAND_PRIX) { + if (1) {}; + if (1) {}; // Maybe some debug code? + gGPCurrentRaceRankByPlayerId[i] = (s32) D_80165270[i]; + gPreviousGPCurrentRaceRankByPlayerId[i] = (s32) D_80165270[i]; + } else { + gGPCurrentRaceRankByPlayerId[i] = i; + gPreviousGPCurrentRaceRankByPlayerId[i] = i; + } + temp_v0_3 = gGPCurrentRaceRankByPlayerId[i]; + gGPCurrentRacePlayerIdByRank[temp_v0_3] = (s16) i; + D_80164378[temp_v0_3] = (s16) i; + gGPCurrentRaceRankByPlayerIdDup[i] = temp_v0_3; + gWrongDirectionCounter[i] = 0; + gIsPlayerWrongDirection[i] = 0; + D_801631E0[i] = false; + D_801631F8[i] = 0; + gNumPathPointsTraversed[i] = -20; + gPreviousLapProgressScore[i] = -20; + gGetPlayerByCharacterId[gPlayers[i].characterId] = (s16) i; + gTrackPositionFactor[i] = 0.0f; + D_80163090[i] = 0.0f; + var_s5 = &gPlayerTrackPositionFactorInstruction[i]; + var_s5->unkC = GET_COURSE_AIMinimumSeparation * (f32) (((i + 1) % 3) - 1); + var_s5->target = var_s5->unkC; + var_s5->current = 0.0f; + var_s5->step = 0.015f; + reset_cpu_behaviour_none(i); + gSpeedCPUBehaviour[i] = 0; + bInMultiPathSection[i] = 0; + D_80163398[i] = 0; + D_801633B0[i] = 0; + gPositionSwapTimer[i] = 0; + D_801633F8[i] = 0; + gPlayersTrackSectionId[i] = 0; + gPreviousPlayerZ[i] = player->pos[2]; + gCurrentPlayerLookAhead[i] = 6; + if (gPlayers[i].type & PLAYER_HUMAN) { + D_80163330[i] = 3; + + } else { + D_80163330[i] = 0; + } + + cpu_enteringPathIntersection[i] = 0; + cpu_exitingPathIntersection[i] = 0; + D_80163128[i] = -1; + D_80163150[i] = -1; + D_80164538[i] = -1; + D_801634C0[i] = 0; + bStopAICrossing[i] = 0; + gIsPlayerInCurve[i] = true; + } + +#ifdef AVOID_UB + for (i = 0; i < NUM_CROSSINGS; i++) { + sCrossingActiveTimer[i] = 0; + } +#else + sCrossingActiveTimer[0] = 0; + sCrossingActiveTimer[1] = 0; +#endif + if (gDemoMode == DEMO_MODE_INACTIVE) { + + if (gModeSelection == GRAND_PRIX) { + for (i = 0; i < 2; i++) { + D_80163344[i] = gGetPlayerByCharacterId[D_80163348[i]]; + D_80163330[D_80163344[i]] = 1; + D_8016334C[D_80163344[i]] = i; + } + } + } + if ((gDemoUseController == 1) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { + for (i = 0; i < NUM_PLAYERS; i++) { + D_80163330[i] = 0; + } + if (gModeSelection == VERSUS) { + + D_80163344[0] = cameras->playerId; + D_80163330[D_80163344[0]] = 1; + D_8016334C[D_80163344[0]] = 0; + + for (i = 1; i < 2; i++) { + D_80163344[i] = cameras[i].playerId; + D_80163330[D_80163344[i]] = 1; + D_8016334C[D_80163344[i]] = i; + } + } + } + + for (i = 0; i < NUM_PLAYERS; i++) { + if (1) {}; + gPathIndexByPlayerId[i] = 0; + gNearestPathPointByPlayerId[i] = + gPathCountByPathIndex[gPathIndexByPlayerId[i]] - gGPCurrentRaceRankByPlayerId[i] - 4; + } + + gIsInExtra = false; + if (gCCSelection == CC_EXTRA) { + gIsInExtra = true; + } + + for (i = 0; i < 30; i++) { + D_80162F10[i] = -1; + D_80162F50[i] = -1; + } + + D_801631CC = 100000; // 100,000 + D_80164698 = 0.0f; + D_8016469C = 100.0f; + D_801646A0 = 0.0f; + D_80164358 = 0; + D_8016435A = 1; + D_8016435C = 1; + gBestRankedHumanPlayer = PLAYER_ONE; + gIncrementUpdatePlayer = 0; + D_8016337C = 0; + gPathStartZ = (f32) gTrackPaths[0][0].posZ; // [i][2] + D_801634F0 = 0; + D_801634F4 = 0; + D_80163488 = 0; + D_8016348C = 0; + D_801634EC = 0; + func_8001AB00(); + if (gDemoUseController == 1) { + if (gDemoMode == 1) { + + for (i = 0; i < NUM_PLAYERS; i++) { + if (D_80163330[i] == 1) { + gPlayers[i].triggers |= START_BOOST_TRIGGER; + } + } + } + } + copy_courses_cpu_behaviour(); +} + +#include "cpu_vehicles_camera_path/path_calc.inc.c" + +#include "cpu_vehicles_camera_path/behaviour_utils.inc.c" + +#include "cpu_vehicles_camera_path/vehicle_utils.inc.c" + +void func_80014D30(s32 cameraId, s32 pathIndex) { + s16 cameraPathPoint; + TrackPathPoint* temp_v0; + + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + temp_v0 = &gTrackPaths[pathIndex][cameraPathPoint]; + check_bounding_collision(&cameras[cameraId].collision, 10.0f, (f32) temp_v0->posX, (f32) temp_v0->posY + 30.0f, + (f32) temp_v0->posZ); +} + +void func_80014DE4(s32 cameraIndex) { + s32 cameraId; + + D_801646CC = 0; + D_80164678[cameraIndex] = D_80164670[cameraIndex]; + if ((gModeSelection != 1) && ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == (u16) 1))) { + D_80164678[cameraIndex] = 0; + } else if ((D_80164678[cameraIndex] != 0) && (D_80164678[cameraIndex] != (s16) 1) && + (D_80164678[cameraIndex] != 2) && (D_80164678[cameraIndex] != 3)) { + D_80164678[cameraIndex] = 0; + } + D_80164680[cameraIndex] = -1; + D_80163238 = 0; + D_801646C0[cameraIndex] = 0; + D_801646C8 = 0; + D_801646D0[cameraIndex].unk0 = 0; + D_801646D0[cameraIndex].unk2 = 0; + D_801646D0[cameraIndex].unk4 = 0; + if ((gModeSelection == 1) && (gCourseMapInit == 0)) { + D_80164678[cameraIndex] = 0; + } + + for (cameraId = 0; cameraId < 4; cameraId++) { + gNearestPathPointByCameraId[cameraId] = 0; + } +} + +f32 func_80014EE4(f32 arg0, s32 arg1) { + f32 temp_f0; + f64 temp_f2; + + temp_f0 = D_80164498[arg1]; + switch (D_80164678[arg1]) { /* irregular */ + default: + arg0 = 40.0f; + break; + case 0: + temp_f2 = 40.0; + temp_f2 += temp_f0; + if (temp_f2 < arg0) { + arg0 -= 1.0; + if (arg0 < temp_f2) { + arg0 = temp_f2; + } + } + if (arg0 < temp_f2) { + arg0 += 1.0; + if (temp_f2 < arg0) { + arg0 = temp_f2; + ; + } + } + break; + case 1: + temp_f2 = 60.0; + temp_f2 += temp_f0; + if (arg0 < temp_f2) { + arg0 += 1.0; + if (temp_f2 < arg0) { + arg0 = temp_f2; + } + } + if (temp_f2 < arg0) { + arg0 -= 1.0; + if (arg0 < temp_f2) { + arg0 = temp_f2; + ; + } + } + break; + case 3: + temp_f2 = 60.0; + temp_f2 += temp_f0; + if (arg0 < temp_f2) { + arg0 += 0.5; + if (temp_f2 < arg0) { + arg0 = temp_f2; + } + } + if (temp_f2 < arg0) { + arg0 -= 0.5; + if (arg0 < temp_f2) { + arg0 = temp_f2; + } + } + break; + case 2: + temp_f2 = 60.0; + temp_f2 += temp_f0; + if (arg0 < temp_f2) { + arg0 += 1.0; + if (temp_f2 < arg0) { + arg0 = temp_f2; + } + } + if (temp_f2 < arg0) { + arg0 -= 1.0; + if (arg0 < temp_f2) { + arg0 = temp_f2; + } + } + break; + } + return arg0; +} + +void calculate_camera_up_vector(Camera* camera, s32 cameraIndex) { + f32 xnorm; + f32 ynorm; + f32 znorm; + f32 xdiff; + f32 ydiff; + f32 zdiff; + f32 distance; + f32 sp28; + u16 thing; + + thing = D_801646C0[cameraIndex]; + if (thing == 0) { + camera->up[0] = 0.0f; + camera->up[2] = 0.0f; + camera->up[1] = 1.0f; + } else { + xdiff = camera->lookAt[0] - camera->pos[0]; + ydiff = camera->lookAt[1] - camera->pos[1]; + zdiff = camera->lookAt[2] - camera->pos[2]; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + xnorm = xdiff / distance; + ynorm = ydiff / distance; + znorm = zdiff / distance; + sp28 = 1.0 - coss(thing); + camera->up[0] = (sp28 * xnorm * ynorm) - (sins(thing) * znorm); + camera->up[1] = coss(thing) + (sp28 * ynorm * ynorm); + camera->up[2] = (sins(thing) * xnorm) + (sp28 * ynorm * znorm); + } +} + +UNUSED void func_8001530C(void) { +} + +void func_80015314(s32 playerId, UNUSED f32 arg1, s32 cameraId) { + Camera* temp_a0; + Player* temp_a1; + + // wtf is up with the pointer accesses here? + // What aren't they just doing thing = &some_pointer[some_index]? + temp_a1 = gPlayerOne; + temp_a0 = camera1; + temp_a1 += playerId; + temp_a0 += cameraId; + temp_a0->unk_2C = temp_a1->rotation[1]; + func_80015390(temp_a0, temp_a1, 0); +} + +void func_80015390(Camera* camera, UNUSED Player* player, UNUSED s32 arg2) { + UNUSED s32 pad[6]; + f32 temp_f12; + f32 sp90; + f32 temp_f14; + Player* temp_s1; + f32 sp84; + f32 sp80; + f32 sp7C; + UNUSED Vec3f pad2; + Vec3f sp64; + UNUSED s32 pad3[9]; + s16 var_a2; + + /* + Doing the more sensible: + temp_s1 = &gPlayerOne[camera->playerId]; + leads to some regalloc differences + */ + temp_s1 = gPlayerOne; + temp_s1 += camera->playerId; + if (temp_s1->unk_078 == 0) { + var_a2 = 0x0064; + } else if (temp_s1->unk_078 < 0) { + var_a2 = 0xA0 - (temp_s1->unk_078 / 16); + } else { + var_a2 = 0xA0 + (temp_s1->unk_078 / 16); + } + if (!((temp_s1->effects & BANANA_SPINOUT_EFFECT) || (temp_s1->effects & DRIVING_SPINOUT_EFFECT))) { + adjust_angle(&camera->unk_2C, temp_s1->rotation[1], var_a2); + } + func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C); + check_bounding_collision(&camera->collision, 10.0f, sp84, sp80, sp7C); + camera->lookAt[0] = sp64[0]; + camera->lookAt[1] = sp64[1]; + camera->lookAt[2] = sp64[2]; + camera->pos[0] = sp84; + camera->pos[1] = sp80; + camera->pos[2] = sp7C; + temp_f12 = camera->lookAt[0] - camera->pos[0]; + sp90 = camera->lookAt[1] - camera->pos[1]; + temp_f14 = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(temp_f12, temp_f14); + camera->rot[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), sp90); + camera->rot[2] = 0; +} + +void func_80015544(s32 playerId, f32 arg1, s32 cameraId, s32 pathIndex) { + Camera* camera; + + f32 temp_f12; + f32 temp_f2; + s32 test = gPathCountByPathIndex[pathIndex]; + + D_80164688[cameraId] = arg1; + camera = cameras + cameraId; + gNearestPathPointByCameraId[cameraId] = (gNearestPathPointByPlayerId[playerId] + 10) % test; + + set_track_offset_position(gNearestPathPointByCameraId[cameraId], arg1, pathIndex); + + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164638[cameraId] = gOffsetPosition[2]; + + temp_f2 = (f32) gTrackPaths[pathIndex][gNearestPathPointByCameraId[cameraId]].posY; + + temp_f12 = get_surface_height(gOffsetPosition[0], (f32) (temp_f2 + 30.0), gOffsetPosition[2]); + if ((temp_f12 < (temp_f2 - 20.0)) || (temp_f12 >= 3000.0)) { + D_80164618[cameraId] = (f32) (temp_f2 + 10.0); + } else { + D_80164618[cameraId] = (f32) (temp_f12 + 10.0); + } + D_80164648[cameraId] = 0.0f; + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_8001577C(Camera* camera, UNUSED Player* playerArg, UNUSED s32 arg2, s32 cameraId) { + s16 cameraPathPoint; + s16 playerPathPoint; + UNUSED s32 pad; + f32 xdiff; + f32 ydiff; + f32 zdiff; + UNUSED s32 pad2; + s32 playerId; + UNUSED s32 pad3[9]; + Player* player; + s32 pathPointDiff; + s32 pathIndex; + + playerId = camera->playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + player = gPlayerOne; + player += playerId; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + playerPathPoint = gNearestPathPointByPlayerId[playerId]; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 0x0032U, 0x000FU, gPathCountByPathIndex[pathIndex]) <= + 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } else { + if (gTrackPositionFactor[playerId] < (-0.7)) { + pathPointDiff = playerPathPoint - cameraPathPoint; + if ((D_80164688[cameraId] < (-0.5)) && ((pathPointDiff * pathPointDiff) < 5)) { + func_8001A348(cameraId, 1.0f, 3); + goto alable; + } + } + // clang-format off + // I hate this, but a fakematch is a fakematch + if (gTrackPositionFactor[playerId] > 0.7) { pathPointDiff = playerPathPoint - cameraPathPoint; if ((D_80164688[cameraId] > 0.5) && ((pathPointDiff * pathPointDiff) < 5)) { + func_8001A348(cameraId, -1.0f, 2); + // clang-format on + } + } + } +alable: + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; + camera->lookAt[0] = player->pos[0]; + camera->lookAt[1] = player->pos[1] + 6.0; + camera->lookAt[2] = player->pos[2]; + func_80014D30(cameraId, pathIndex); + xdiff = camera->lookAt[0] - camera->pos[0]; + ydiff = camera->lookAt[1] - camera->pos[1]; + zdiff = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(xdiff, zdiff); + camera->rot[0] = atan2s(sqrtf((xdiff * xdiff) + (zdiff * zdiff)), ydiff); + camera->rot[2] = 0; +} + +void func_80015A9C(s32 playerId, f32 arg1, s32 cameraId, s16 pathIndex) { + Camera* camera = cameras + cameraId; + + D_80164688[cameraId] = arg1; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByPlayerId[playerId] + 10; + gNearestPathPointByCameraId[cameraId] = (gNearestPathPointByCameraId[cameraId]) % gPathCountByPathIndex[pathIndex]; + + set_track_offset_position(gNearestPathPointByCameraId[cameraId], arg1, pathIndex); + + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164618[cameraId] = (f32) gTrackPaths[pathIndex][gNearestPathPointByCameraId[cameraId]].posY; + D_80164638[cameraId] = gOffsetPosition[2]; + + D_80164648[cameraId] = gPlayers[playerId].speed / 5.0f; + if ((f64) D_80164648[cameraId] < 0.0) { + D_80164648[cameraId] = 0.0f; + } + + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_80015C94(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { + s16 playerPathPoint; + s16 cameraPathPoint; + UNUSED s32 stackPadding0; + f32 xdiff2; + f32 ydiff2; + f32 zdiff2; + Player* player; + s32 playerId; + f32 midX; + f32 midY; + f32 midZ; + f32 xdiff; + f32 ydiff; + f32 zdiff; + f32 distance; + UNUSED s32 stackPadding1; + s16 pathPoint1; + s16 pathPoint2; + UNUSED f32 var_f18; + UNUSED f32 var_f20; + f32 temp_f2_2; + s32 pathIndex; + + playerId = camera->playerId; + player = gPlayerOne; + player += playerId; + D_80163238 = playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + playerPathPoint = gNearestPathPointByPlayerId[playerId]; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 0x0032U, 0x000FU, gPathCountByPathIndex[pathIndex]) <= + 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } else if ((gTrackPositionFactor[playerId] < -0.5) && (D_80164688[cameraId] < -0.5)) { + func_8001A348(cameraId, 1.0f, 7); + } else if ((gTrackPositionFactor[playerId] > 0.5) && (D_80164688[cameraId] > 0.5)) { + func_8001A348(cameraId, -1.0f, 6); + } + pathPoint1 = (gNearestPathPointByCameraId[cameraId] + 1) % gPathCountByPathIndex[pathIndex]; + pathPoint2 = (gNearestPathPointByCameraId[cameraId] + 2) % gPathCountByPathIndex[pathIndex]; + set_track_offset_position(pathPoint1, D_80164688[cameraId], pathIndex); + midX = gOffsetPosition[0] * 0.5; + midZ = gOffsetPosition[2] * 0.5; + set_track_offset_position(pathPoint2, D_80164688[cameraId], pathIndex); + midX += gOffsetPosition[0] * 0.5; + midZ += gOffsetPosition[2] * 0.5; + midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) / 2.0; + xdiff = midX - D_801645F8[cameraId]; + ydiff = midY - D_80164618[cameraId]; + zdiff = midZ - D_80164638[cameraId]; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance != 0.0) { + midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); + midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); + midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); + } else { + midX = D_801645F8[cameraId]; + midY = D_80164618[cameraId]; + midZ = D_80164638[cameraId]; + } + camera->pos[0] = midX; + camera->pos[2] = midZ; + temp_f2_2 = get_surface_height(midX, midY + 30.0, midZ); + if ((temp_f2_2 < (midY - 20.0)) || (temp_f2_2 >= 3000.0)) { + camera->pos[1] = midY + 10.0; + } else { + camera->pos[1] = temp_f2_2 + 8.0; + } + D_801645F8[cameraId] = midX; + D_80164618[cameraId] = midY; + D_80164638[cameraId] = midZ; + camera->lookAt[0] = player->pos[0]; + camera->lookAt[1] = player->pos[1] + 6.0; + camera->lookAt[2] = player->pos[2]; + func_80014D30(cameraId, pathIndex); + xdiff2 = camera->lookAt[0] - camera->pos[0]; + ydiff2 = camera->lookAt[1] - camera->pos[1]; + zdiff2 = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(xdiff2, zdiff2); + camera->rot[0] = atan2s(sqrtf((xdiff2 * xdiff2) + (zdiff2 * zdiff2)), ydiff2); + camera->rot[2] = 0; +} + +void func_800162CC(s32 playerId, f32 arg1, s32 cameraId, s16 pathIndex) { + Camera* camera = cameras + cameraId; + + D_80164688[cameraId] = arg1; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByPlayerId[playerId]; + gNearestPathPointByCameraId[cameraId] = (gNearestPathPointByCameraId[cameraId]) % gPathCountByPathIndex[pathIndex]; + + set_track_offset_position(gNearestPathPointByCameraId[cameraId], arg1, pathIndex); + + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164618[cameraId] = (f32) gTrackPaths[pathIndex][gNearestPathPointByCameraId[cameraId]].posY; + D_80164638[cameraId] = gOffsetPosition[2]; + + D_80164658[cameraId] = gPlayers[playerId].speed; + D_80164648[cameraId] = gPlayers[playerId].speed; + + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_80016494(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { + s16 cameraPathPoint; + s16 playerPathPoint; + UNUSED s32 stackPadding0; + f32 xdiff2; + f32 ydiff2; + f32 zdiff2; + Player* player; + s32 playerId; + f32 midX; + f32 midY; + f32 midZ; + f32 xdiff; + f32 ydiff; + f32 zdiff; + f32 distance; + UNUSED f32 sp98; + s16 pathPoint1; + s16 pathPoint2; + UNUSED f32 sp94; + UNUSED f32 sp90; + UNUSED s32 stackPadding1; + s32 pathIndex; + f32 temp_f2_5; + + playerId = camera->playerId; + player = gPlayerOne; + D_80164648[cameraId] += ((D_80164658[cameraId] - D_80164648[cameraId]) * 0.5f); + D_80163238 = playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + player += playerId; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + temp_f2_5 = (gTrackPositionFactor[playerId] - D_80164688[cameraId]); + temp_f2_5 *= temp_f2_5; + playerPathPoint = gNearestPathPointByPlayerId[playerId]; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 0x000FU, 0x000FU, gPathCountByPathIndex[pathIndex]) <= + 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } else { + if ((gTrackPositionFactor[playerId] < 0.0) && (D_80164688[cameraId] < 0.0) && (temp_f2_5 < 0.01)) { + func_8001A348(cameraId, 1.0f, 5); + } else { + if ((gTrackPositionFactor[playerId] > 0.0) && (D_80164688[cameraId] > 0.0) && (temp_f2_5 < 0.01)) { + func_8001A348(cameraId, -1.0f, 4); + } else { + if ((cameraPathPoint < playerPathPoint) && ((playerPathPoint - cameraPathPoint) < 0xA)) { + D_80164658[cameraId] = gPlayers[playerId].speed + 0.4; + } + if ((playerPathPoint < cameraPathPoint) && ((cameraPathPoint - playerPathPoint) < 0xA)) { + D_80164658[cameraId] = gPlayers[playerId].speed - 0.4; + } + if (D_80164658[cameraId] > 10.0) { + D_80164658[cameraId] = 10.0f; + } + if (D_80164658[cameraId] < 0.0) { + D_80164658[cameraId] = 0.0f; + } + } + } + } + pathPoint1 = (gNearestPathPointByCameraId[cameraId] + 1) % gPathCountByPathIndex[pathIndex]; + pathPoint2 = (gNearestPathPointByCameraId[cameraId] + 2) % gPathCountByPathIndex[pathIndex]; + set_track_offset_position(pathPoint1, D_80164688[cameraId], pathIndex); + midX = gOffsetPosition[0] * 0.5; + midZ = gOffsetPosition[2] * 0.5; + set_track_offset_position(pathPoint2, D_80164688[cameraId], pathIndex); + midX += gOffsetPosition[0] * 0.5; + midZ += gOffsetPosition[2] * 0.5; + midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) / 2.0; + xdiff = midX - D_801645F8[cameraId]; + ydiff = midY - D_80164618[cameraId]; + zdiff = midZ - D_80164638[cameraId]; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance != 0.0) { + midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); + midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); + midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); + } else { + midX = D_801645F8[cameraId]; + midY = D_80164618[cameraId]; + midZ = D_80164638[cameraId]; + } + camera->pos[0] = midX; + camera->pos[2] = midZ; + temp_f2_5 = get_surface_height(midX, midY + 30.0, midZ); + if ((temp_f2_5 < (midY - 20.0)) || (temp_f2_5 >= 3000.0)) { + camera->pos[1] = midY + 10.0; + } else { + camera->pos[1] = temp_f2_5 + 10.0; + } + D_801645F8[cameraId] = midX; + D_80164618[cameraId] = midY; + D_80164638[cameraId] = midZ; + camera->lookAt[0] = player->pos[0]; + camera->lookAt[1] = player->pos[1] + 6.0; + camera->lookAt[2] = player->pos[2]; + func_80014D30(cameraId, pathIndex); + xdiff2 = camera->lookAt[0] - camera->pos[0]; + ydiff2 = camera->lookAt[1] - camera->pos[1]; + zdiff2 = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(xdiff2, zdiff2); + camera->rot[0] = atan2s(sqrtf((xdiff2 * xdiff2) + (zdiff2 * zdiff2)), ydiff2); + camera->rot[2] = 0; +} + +void func_80016C3C(UNUSED s32 playerId, UNUSED f32 arg1, s32 cameraId) { + UNUSED s32 stackPadding0; + UNUSED s32 stackPadding1; + f32 temp_f2; + UNUSED s32 stackPadding2; + f32 temp_f12; + TrackPathPoint** path; + f32 sp54; + s32 temp_s0; + s16 sp48; + s16 sp44; + Camera* camera; + + if (random_int(0x0064U) < 0x32) { + D_80164688[cameraId] = 0.1f; + } else { + D_80164688[cameraId] = -0.1f; + } + D_80163DD8[cameraId] = 0; + if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { + D_80163DD8[cameraId] = random_int(4U); + D_80164688[cameraId] = 0.0f; + } + temp_s0 = gPathCountByPathIndex[D_80163DD8[cameraId]]; + gNearestPathPointByCameraId[cameraId] %= temp_s0; + set_track_offset_position(gNearestPathPointByCameraId[cameraId], D_80164688[cameraId], 0); + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164618[cameraId] = gTrackPaths[0][gNearestPathPointByCameraId[cameraId]].posY; + path = gTrackPaths; + D_80164638[cameraId] = gOffsetPosition[2]; + D_80164658[cameraId] = 16.666666f; + D_80164648[cameraId] = 0.0f; + sp48 = (gNearestPathPointByCameraId[cameraId] + 0xA) % temp_s0; + sp44 = (gNearestPathPointByCameraId[cameraId] + 0xB) % temp_s0; + set_track_offset_position(sp48, D_80164688[cameraId], 0); + temp_f2 = gOffsetPosition[0] * 0.5; + temp_f12 = gOffsetPosition[2] * 0.5; + set_track_offset_position(sp44, D_80164688[cameraId], 0); + temp_f2 += gOffsetPosition[0] * 0.5; + temp_f12 += gOffsetPosition[2] * 0.5; + sp48 = (gNearestPathPointByCameraId[cameraId] + 0x5) % temp_s0; + sp44 = (gNearestPathPointByCameraId[cameraId] + 0x6) % temp_s0; + sp54 = (path[0][sp48].posY + path[0][sp44].posY) * 0.5f; + camera = cameras; + camera += cameraId; + camera->lookAt[0] = temp_f2; + camera->lookAt[2] = temp_f12; + camera->lookAt[1] = sp54 + 8.0; + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_80017054(Camera* camera, UNUSED Player* player, UNUSED s32 index, s32 cameraId); +void func_80017054(Camera* camera, UNUSED Player* player, UNUSED s32 index, s32 cameraId) { + s32 stackPadding0; + s32 stackPadding1; + f32 spAC; + f32 spA8; + f32 spA4; + s32 stackPadding2; + s32 stackPadding3; + f32 sp98; + f32 sp94; + f32 sp90; + f32 sp8C; + f32 sp88; + f32 sp84; + f32 sp80; + f32 sp7C; + f32 sp78; + s32 stackPadding7; + s32 stackPadding8; + s16 sp6E; + s16 sp6C; + f32 stackPadding9; + s32 playerId; + f32 temp_f0; + s32 pathIndex; + s32 sp58; + s16 sp56; + + playerId = camera->playerId; + D_80164648[cameraId] += (D_80164658[cameraId] - D_80164648[cameraId]) * 0.5f; + pathIndex = D_80163DD8[cameraId]; + sp58 = gPathCountByPathIndex[pathIndex]; + D_80163238 = playerId; + sp56 = gNearestPathPointByCameraId[cameraId]; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + if (gCurrentCourseId == 4) { + if ((sp56 != gNearestPathPointByCameraId[cameraId]) && (gNearestPathPointByCameraId[cameraId] == 1)) { + D_80163DD8[cameraId] = random_int(4); + pathIndex = D_80163DD8[cameraId]; + gNearestPathPointByCameraId[cameraId] = func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], + gNearestPathPointByCameraId[cameraId], pathIndex); + } + } + sp6E = (gNearestPathPointByCameraId[cameraId] + 0xA) % sp58; + sp6C = (gNearestPathPointByCameraId[cameraId] + 0xB) % sp58; + set_track_offset_position(sp6E, D_80164688[cameraId], pathIndex); + sp8C = gOffsetPosition[0] * 0.5; + sp84 = gOffsetPosition[2] * 0.5; + set_track_offset_position(sp6C, D_80164688[cameraId], pathIndex); + sp8C += gOffsetPosition[0] * 0.5; + sp84 += gOffsetPosition[2] * 0.5; + + sp6E = (gNearestPathPointByCameraId[cameraId] + 5) % sp58; + sp6C = (gNearestPathPointByCameraId[cameraId] + 6) % sp58; + sp88 = (gTrackPaths[pathIndex][sp6E].posY + gTrackPaths[pathIndex][sp6C].posY) * 0.5f; + sp6E = (gNearestPathPointByCameraId[cameraId] + 1) % sp58; + sp6C = (gNearestPathPointByCameraId[cameraId] + 2) % sp58; + set_track_offset_position(sp6E, D_80164688[cameraId], pathIndex); + sp98 = gOffsetPosition[0] * 0.5; + sp90 = gOffsetPosition[2] * 0.5; + set_track_offset_position(sp6C, D_80164688[cameraId], pathIndex); + sp98 += gOffsetPosition[0] * 0.5; + sp90 += gOffsetPosition[2] * 0.5; + sp94 = (gTrackPaths[pathIndex][sp6E].posY + gTrackPaths[pathIndex][sp6C].posY) * 0.5f; + + sp80 = sp98 - D_801645F8[cameraId]; + sp7C = sp94 - D_80164618[cameraId]; + sp78 = sp90 - D_80164638[cameraId]; + temp_f0 = sqrtf(((sp80 * sp80) + (sp7C * sp7C)) + (sp78 * sp78)); + + if (temp_f0 != 0.0) { + sp98 = D_801645F8[cameraId] + (((stackPadding9 = D_80164648[cameraId]) * sp80) / temp_f0); + sp94 = D_80164618[cameraId] + ((D_80164648[cameraId] * sp7C) / temp_f0); + sp90 = D_80164638[cameraId] + ((D_80164648[cameraId] * sp78) / temp_f0); + } else { + sp98 = D_801645F8[cameraId]; + sp94 = D_80164618[cameraId]; + sp90 = D_80164638[cameraId]; + } + + if (sp98 < -10000.0 || sp98 > 10000.0) { + if (sp8C < -10000.0 || sp8C > 10000.0) {} + } + camera->pos[0] = sp98; + camera->pos[2] = sp90; + camera->pos[1] = sp94 + 10.0; + + D_801645F8[cameraId] = sp98; + D_80164618[cameraId] = sp94; + D_80164638[cameraId] = sp90; + + if (sp8C < -10000.0 || sp8C > 10000.0) {} + if (sp84 < -10000.0 || sp84 > 10000.0) {} + camera->lookAt[0] = sp8C; + camera->lookAt[1] = sp88 + 8.0; + camera->lookAt[2] = sp84; + func_80014D30(cameraId, pathIndex); + spAC = camera->lookAt[0] - camera->pos[0]; + spA8 = camera->lookAt[1] - camera->pos[1]; + spA4 = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(spAC, spA4); + camera->rot[0] = atan2s(sqrtf((spAC * spAC) + (spA4 * spA4)), spA8); + camera->rot[2] = 0; +} + +void func_80017720(s32 playerId, UNUSED f32 arg1, s32 cameraId, s16 pathIndex) { + Camera* camera = cameras + cameraId; + UNUSED s32 pad; + + D_80164688[cameraId] = gTrackPositionFactor[playerId]; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByPlayerId[playerId] + 3; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByCameraId[cameraId] % gPathCountByPathIndex[pathIndex]; + + set_track_offset_position(gNearestPathPointByCameraId[cameraId], gTrackPositionFactor[playerId], pathIndex); + + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164618[cameraId] = (f32) gTrackPaths[pathIndex][gNearestPathPointByCameraId[cameraId]].posY; + D_80164638[cameraId] = gOffsetPosition[2]; + + D_80164658[cameraId] = gPlayers[playerId].speed; + D_80164648[cameraId] = gPlayers[playerId].speed; + + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_800178F4(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { + s16 cameraPathPoint; + s16 playerPathPoint; + UNUSED f32 stackPadding0; + f32 xdiff2; + f32 ydiff2; + f32 zdiff2; + Player* player; + f32 distance; + f32 midX; + f32 midY; + f32 midZ; + f32 xdiff; + f32 ydiff; + f32 zdiff; + UNUSED f32 var_f2; + UNUSED f32 var_f18; + s16 pathPoint1; + s16 pathPoint2; + UNUSED f32 stackPadding1; + UNUSED f32 var_f14; + s32 playerId; + s32 pathIndex; + s32 pathPointCount; + + playerId = camera->playerId; + player = gPlayerOne; + D_80164688[cameraId] = gTrackPositionFactor[playerId]; + D_80164648[cameraId] += ((D_80164658[cameraId] - D_80164648[cameraId]) / 2.0f); + D_80163238 = playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + player += playerId; + pathPointCount = gPathCountByPathIndex[pathIndex]; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + playerPathPoint = (gNearestPathPointByPlayerId[playerId] + 3) % pathPointCount; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 0x000DU, 1U, pathPointCount) <= 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } else { + if ((cameraPathPoint < playerPathPoint) && ((playerPathPoint - cameraPathPoint) < 3)) { + D_80164658[cameraId] = gPlayers[playerId].speed + 0.1; + } + if ((playerPathPoint < cameraPathPoint) && ((cameraPathPoint - playerPathPoint) < 3)) { + D_80164658[cameraId] = gPlayers[playerId].speed - 0.1; + } + if (D_80164658[cameraId] > 10.0) { + D_80164658[cameraId] = 10.0f; + } + if (D_80164658[cameraId] < 0.0) { + D_80164658[cameraId] = 0.0f; + } + } + pathPoint1 = (gNearestPathPointByCameraId[cameraId] + 1) % pathPointCount; + pathPoint2 = (gNearestPathPointByCameraId[cameraId] + 2) % pathPointCount; + set_track_offset_position(pathPoint1, D_80164688[cameraId], pathIndex); + midX = gOffsetPosition[0] * 0.5; + midZ = gOffsetPosition[2] * 0.5; + set_track_offset_position(pathPoint2, D_80164688[cameraId], pathIndex); + midX += gOffsetPosition[0] * 0.5; + midZ += gOffsetPosition[2] * 0.5; + midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) / 2.0; + xdiff = midX - D_801645F8[cameraId]; + ydiff = midY - D_80164618[cameraId]; + zdiff = midZ - D_80164638[cameraId]; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance != 0.0) { + midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); + midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); + midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); + } else { + midX = D_801645F8[cameraId]; + midY = D_80164618[cameraId]; + midZ = D_80164638[cameraId]; + } + camera->pos[0] = midX; + camera->pos[2] = midZ; + camera->pos[1] = midY + 10.0; + D_801645F8[cameraId] = midX; + D_80164618[cameraId] = midY; + D_80164638[cameraId] = midZ; + camera->lookAt[0] = player->pos[0]; + camera->lookAt[1] = player->pos[1] + 6.0; + camera->lookAt[2] = player->pos[2]; + func_80014D30(cameraId, pathIndex); + xdiff2 = camera->lookAt[0] - camera->pos[0]; + ydiff2 = camera->lookAt[1] - camera->pos[1]; + zdiff2 = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(xdiff2, zdiff2); + camera->rot[0] = atan2s(sqrtf((xdiff2 * xdiff2) + (zdiff2 * zdiff2)), ydiff2); + camera->rot[2] = 0; +} + +void func_80017F10(s32 playerId, UNUSED f32 arg1, s32 cameraId, s16 pathIndex) { + Camera* camera = cameras + cameraId; + s32 test = gPathCountByPathIndex[pathIndex]; + + D_80164688[cameraId] = gTrackPositionFactor[playerId]; + gNearestPathPointByCameraId[cameraId] = (gNearestPathPointByPlayerId[playerId] + test) - 2; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByCameraId[cameraId] % test; + + set_track_offset_position(gNearestPathPointByCameraId[cameraId], gTrackPositionFactor[playerId], pathIndex); + + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164618[cameraId] = (f32) gTrackPaths[pathIndex][gNearestPathPointByCameraId[cameraId]].posY; + D_80164638[cameraId] = gOffsetPosition[2]; + + D_80164658[cameraId] = gPlayers[playerId].speed; + D_80164648[cameraId] = gPlayers[playerId].speed; + + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_800180F0(Camera* camera, UNUSED Player* unusedPlayer, UNUSED s32 arg2, s32 cameraId) { + s16 cameraPathPoint; + s16 playerPathPoint; + UNUSED s32 stackPadding3; + f32 sp94; + f32 sp90; + f32 sp8C; + UNUSED s32 stackPadding4; + f32 distance; + f32 midX; + f32 midY; + f32 midZ; + f32 xdiff; + f32 ydiff; + f32 zdiff; + Player* player; + s32 playerId; + s16 pathPoint1; + s16 pathPoint2; + UNUSED f32 var_f2; + UNUSED f32 var_f18; + UNUSED f32 var_f14; + s32 pathIndex; + s32 pathPointCount; + + playerId = camera->playerId; + player = gPlayerOne; + D_80164688[cameraId] = gTrackPositionFactor[playerId]; + D_80164648[cameraId] += ((D_80164658[cameraId] - D_80164648[cameraId]) * 0.5f); + D_80163238 = playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + pathPointCount = gPathCountByPathIndex[pathIndex]; + player += playerId; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + playerPathPoint = ((gNearestPathPointByPlayerId[playerId] + pathPointCount) - 2) % pathPointCount; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 1U, 0x000AU, pathPointCount) <= 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } else { + if ((cameraPathPoint < playerPathPoint) && ((playerPathPoint - cameraPathPoint) < 3)) { + D_80164658[cameraId] = gPlayers[playerId].speed + 0.1; + } + if ((playerPathPoint < cameraPathPoint) && ((cameraPathPoint - playerPathPoint) < 3)) { + D_80164658[cameraId] = gPlayers[playerId].speed - 0.1; + } + if (D_80164658[cameraId] > 10.0) { + D_80164658[cameraId] = 10.0f; + } + if (D_80164658[cameraId] < 0.0) { + D_80164658[cameraId] = 0.0f; + } + } + pathPoint1 = (gNearestPathPointByCameraId[cameraId] + 1) % pathPointCount; + pathPoint2 = (gNearestPathPointByCameraId[cameraId] + 2) % pathPointCount; + set_track_offset_position(pathPoint1, D_80164688[cameraId], pathIndex); + midX = gOffsetPosition[0] * 0.5; + midZ = gOffsetPosition[2] * 0.5; + set_track_offset_position(pathPoint2, D_80164688[cameraId], pathIndex); + midX += gOffsetPosition[0] * 0.5; + midZ += gOffsetPosition[2] * 0.5; + midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) / 2.0; + xdiff = midX - D_801645F8[cameraId]; + ydiff = midY - D_80164618[cameraId]; + zdiff = midZ - D_80164638[cameraId]; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance != 0.0) { + midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); + midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); + midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); + } else { + midX = D_801645F8[cameraId]; + midY = D_80164618[cameraId]; + midZ = D_80164638[cameraId]; + } + camera->pos[0] = midX; + camera->pos[2] = midZ; + camera->pos[1] = player->pos[1] + 10.0; + D_801645F8[cameraId] = midX; + D_80164618[cameraId] = midY; + D_80164638[cameraId] = midZ; + camera->lookAt[0] = player->pos[0]; + camera->lookAt[1] = player->pos[1] + 6.0; + camera->lookAt[2] = player->pos[2]; + func_80014D30(cameraId, pathIndex); + sp94 = camera->lookAt[0] - camera->pos[0]; + sp90 = camera->lookAt[1] - camera->pos[1]; + sp8C = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(sp94, sp8C); + camera->rot[0] = atan2s(sqrtf((sp94 * sp94) + (sp8C * sp8C)), sp90); + camera->rot[2] = 0; +} + +void func_80018718(s32 playerId, UNUSED f32 arg1, s32 cameraId, s16 pathIndex) { + Camera* camera = cameras + cameraId; + s32 test = gPathCountByPathIndex[pathIndex]; + + D_80164688[cameraId] = gTrackPositionFactor[playerId]; + gNearestPathPointByCameraId[cameraId] = ((gNearestPathPointByPlayerId[playerId] + test) - 5) % test; + + calculate_track_offset_position(gNearestPathPointByCameraId[cameraId], gTrackPositionFactor[playerId], 60.0f, + pathIndex); + + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164618[cameraId] = (f32) gTrackPaths[pathIndex][gNearestPathPointByCameraId[cameraId]].posY; + D_80164638[cameraId] = gOffsetPosition[2]; + + D_80164658[cameraId] = gPlayers[playerId].speed; + D_80164648[cameraId] = gPlayers[playerId].speed; + D_8016448C = 1; + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_800188F4(Camera* camera, UNUSED Player* unusePlayer, UNUSED s32 arg2, s32 cameraId) { + s16 cameraPathPoint; + s16 playerPathPoint; + UNUSED s32 stackPadding0; + f32 spAC; + f32 spA8; + f32 spA4; + Player* player; + f32 distance; + f32 midX; + f32 midY; + f32 midZ; + f32 xdiff; + f32 ydiff; + f32 zdiff; + UNUSED f32 sp64; + UNUSED f32 sp60; + s16 pathPoint1; + s16 pathPoint2; + UNUSED f32 sp5C; + f32 temp_f2_4; + s32 playerId; + s32 pathIndex; + s32 pathPointCount; + + player = gPlayerOne; + playerId = camera->playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + pathPointCount = gPathCountByPathIndex[pathIndex]; + D_80164648[cameraId] = gPlayers[playerId].speed; + if (D_8016448C == 0) { + if (gNearestPathPointByCameraId[cameraId] == + (((gNearestPathPointByPlayerId[playerId] + pathPointCount) - 6) % pathPointCount)) { + D_8016448C = 1; + } + if (D_80164688[cameraId] < (gTrackPositionFactor[playerId] - 0.2)) { + D_80164648[cameraId] = gPlayers[playerId].speed * 0.7; + } + if ((gTrackPositionFactor[playerId] - 0.5) < D_80164688[cameraId]) { + D_80164688[cameraId] -= 0.01; + } + if (D_80164688[cameraId] < -0.9) { + D_80164688[cameraId] = -0.9f; + D_80164648[cameraId] = gPlayers[playerId].speed * 0.8; + } + } else { + if (gNearestPathPointByCameraId[cameraId] == ((gNearestPathPointByPlayerId[playerId] + 6) % pathPointCount)) { + D_8016448C = 0; + } + if ((gTrackPositionFactor[playerId] + 0.2) < D_80164688[cameraId]) { + D_80164648[cameraId] = gPlayers[playerId].speed * 1.3; + } + if (D_80164688[cameraId] < (gTrackPositionFactor[playerId] + 0.5)) { + D_80164688[cameraId] += 0.01; + } + if (D_80164688[cameraId] > 0.9) { + D_80164688[cameraId] = 0.9f; + D_80164648[cameraId] = gPlayers[playerId].speed * 1.2; + } + } + D_80163238 = playerId; + player += playerId; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex); + playerPathPoint = gNearestPathPointByPlayerId[playerId]; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 0x000FU, 0x000FU, pathPointCount) <= 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } + pathPoint1 = (gNearestPathPointByCameraId[cameraId] + 1) % pathPointCount; + pathPoint2 = (gNearestPathPointByCameraId[cameraId] + 2) % pathPointCount; + calculate_track_offset_position(pathPoint1, D_80164688[cameraId], 60.0f, pathIndex); + midX = gOffsetPosition[0] * 0.5; + midZ = gOffsetPosition[2] * 0.5; + calculate_track_offset_position(pathPoint2, D_80164688[cameraId], 60.0f, pathIndex); + midX += gOffsetPosition[0] * 0.5; + midZ += gOffsetPosition[2] * 0.5; + midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) / 2.0; + xdiff = midX - D_801645F8[cameraId]; + ydiff = midY - D_80164618[cameraId]; + zdiff = midZ - D_80164638[cameraId]; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance != 0.0) { + midX = D_801645F8[cameraId] + ((D_80164648[cameraId] * xdiff) / distance); + midY = D_80164618[cameraId] + ((D_80164648[cameraId] * ydiff) / distance); + midZ = D_80164638[cameraId] + ((D_80164648[cameraId] * zdiff) / distance); + } else { + midX = D_801645F8[cameraId]; + midY = D_80164618[cameraId]; + midZ = D_80164638[cameraId]; + } + camera->pos[0] = midX; + camera->pos[2] = midZ; + temp_f2_4 = get_surface_height(midX, midY + 30.0, midZ); + if ((temp_f2_4 < (midY - 20.0)) || (temp_f2_4 >= 3000.0)) { + camera->pos[1] = midY + 10.0; + } else { + camera->pos[1] = temp_f2_4 + 8.0; + } + D_801645F8[cameraId] = midX; + D_80164618[cameraId] = midY; + D_80164638[cameraId] = midZ; + camera->lookAt[0] = player->pos[0]; + camera->lookAt[1] = player->pos[1] + 6.0; + camera->lookAt[2] = player->pos[2]; + func_80014D30(cameraId, pathIndex); + spAC = camera->lookAt[0] - camera->pos[0]; + spA8 = camera->lookAt[1] - camera->pos[1]; + spA4 = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(spAC, spA4); + camera->rot[0] = atan2s(sqrtf((spAC * spAC) + (spA4 * spA4)), spA8); + camera->rot[2] = 0; +} + +void func_80019118(s32 playerId, f32 arg1, s32 cameraId, UNUSED s16 pathIndex) { + Camera* camera = cameras + cameraId; + s32 test = gPathCountByPathIndex[0]; + f32 temp_f12; + f32 temp_f2; + + D_80164688[cameraId] = arg1; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByPlayerId[playerId] + 12; + gNearestPathPointByCameraId[cameraId] = gNearestPathPointByCameraId[cameraId] % test; + + set_track_offset_position(gNearestPathPointByCameraId[cameraId], arg1, 0); + D_801645F8[cameraId] = gOffsetPosition[0]; + D_80164638[cameraId] = gOffsetPosition[2]; + temp_f2 = (f32) gTrackPaths[0][gNearestPathPointByCameraId[cameraId]].posY; + + temp_f12 = get_surface_height(gOffsetPosition[0], (temp_f2 + 30.0), gOffsetPosition[2]); + + if ((temp_f12 < (temp_f2 - 20.0)) || (temp_f12 >= 3000.0)) { + D_80164618[cameraId] = (f32) (temp_f2 + 10.0); + } else { + D_80164618[cameraId] = (f32) (temp_f12 + 10.0); + } + D_80164648[cameraId] = 0.0f; + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; +} + +void func_8001933C(Camera* camera, UNUSED Player* playerArg, UNUSED s32 arg2, s32 cameraId) { + s16 cameraPathPoint; + s16 playerPathPoint; + UNUSED s32 pad; + f32 xdiff; + f32 ydiff; + f32 zdiff; + UNUSED s32 pad2; + s32 playerId; + UNUSED s32 pad3[10]; + Player* player; + TrackPathPoint* pathPoint; + s32 pathIndex; + s32 pathPointCount; + + playerId = camera->playerId; + pathIndex = gPathIndexByPlayerId[playerId]; + player = gPlayerOne; + player += playerId; + pathPointCount = gPathCountByPathIndex[pathIndex]; + gNearestPathPointByCameraId[cameraId] = + func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], 0); + playerPathPoint = gNearestPathPointByPlayerId[playerId]; + cameraPathPoint = gNearestPathPointByCameraId[cameraId]; + if (is_path_point_in_range(playerPathPoint, cameraPathPoint, 0x0032U, 0x0014U, pathPointCount) <= 0) { + func_8001A348(cameraId, D_80164688[cameraId], D_80164680[cameraId]); + } else { + if ((gTrackPositionFactor[playerId] < -0.5) && ((f64) D_80164688[cameraId] < -0.5)) { + func_8001A348(cameraId, 1.0f, 0x0000000D); + } else if ((gTrackPositionFactor[playerId] > 0.5) && ((f64) D_80164688[cameraId] > 0.5)) { + func_8001A348(cameraId, -1.0f, 0x0000000C); + } + } + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; + pathPoint = &gTrackPaths[pathIndex][cameraPathPoint]; + camera->lookAt[0] = (player->pos[0] * 0.8) + (0.2 * pathPoint->posX); + camera->lookAt[1] = (player->pos[1] * 0.8) + (0.2 * pathPoint->posY); + camera->lookAt[2] = (player->pos[2] * 0.8) + (0.2 * pathPoint->posZ); + func_80014D30(cameraId, pathIndex); + xdiff = camera->lookAt[0] - camera->pos[0]; + ydiff = camera->lookAt[1] - camera->pos[1]; + zdiff = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(xdiff, zdiff); + camera->rot[0] = atan2s(sqrtf((xdiff * xdiff) + (zdiff * zdiff)), ydiff); + camera->rot[2] = 0; +} + +void func_8001968C(void) { + D_80164678[0] = 3; +} + +void func_8001969C(UNUSED s32 playerId, UNUSED f32 arg1, s32 cameraId, UNUSED s16 pathIndex) { + TrackPathPoint* pathPoint; + + gNearestPathPointByCameraId[cameraId] = gPathCountByPathIndex[0] - 18; + + pathPoint = &gTrackPaths[0][gNearestPathPointByCameraId[cameraId]]; + + D_801645F8[cameraId] = pathPoint->posX; + //! @bug Adding an (f32) cast changes asm, why? + D_80164618[cameraId] = pathPoint->posY + 10.0; + D_80164638[cameraId] = pathPoint->posZ; + D_80164648[cameraId] = 0.0f; + D_80164678[cameraId] = 0; +} + +void func_80019760(Camera* camera, UNUSED Player* player, UNUSED s32 arg2, s32 cameraId) { + UNUSED s32 pad[2]; + f32 xdiff; + f32 ydiff; + f32 zdiff; + TrackPathPoint* temp_v1; + + camera->pos[0] = D_801645F8[cameraId]; + camera->pos[1] = D_80164618[cameraId]; + camera->pos[2] = D_80164638[cameraId]; + temp_v1 = &(*gTrackPaths)[gNearestPathPointByCameraId[cameraId]]; + camera->lookAt[0] = (f32) temp_v1->posX; + camera->lookAt[1] = (f32) temp_v1->posY; + camera->lookAt[2] = (f32) temp_v1->posZ; + func_80014D30(cameraId, 0); + xdiff = camera->lookAt[0] - camera->pos[0]; + ydiff = camera->lookAt[1] - camera->pos[1]; + zdiff = camera->lookAt[2] - camera->pos[2]; + camera->rot[1] = atan2s(xdiff, zdiff); + camera->rot[0] = atan2s(sqrtf((xdiff * xdiff) + (zdiff * zdiff)), ydiff); + camera->rot[2] = 0; +} + +void func_80019890(s32 playerId, s32 cameraId) { + s32 pathIndex; + Camera* camera = camera1; + camera += cameraId; + camera->playerId = playerId; + + D_801646C0[cameraId] = 0; + pathIndex = gPathIndexByPlayerId[playerId]; + + switch (D_80164680[cameraId]) { + case 0: + func_80015314(playerId, 0.0f, cameraId); + break; + case 2: + func_80015544(playerId, -1.0f, cameraId, pathIndex); + break; + case 3: + func_80015544(playerId, 1.0f, cameraId, pathIndex); + break; + case 6: + func_80015A9C(playerId, -0.6f, cameraId, (s16) pathIndex); + break; + case 7: + func_80015A9C(playerId, 0.6f, cameraId, (s16) pathIndex); + break; + case 4: + func_800162CC(playerId, -1.0f, cameraId, (s16) pathIndex); + break; + case 5: + func_800162CC(playerId, 1.0f, cameraId, (s16) pathIndex); + break; + case 9: + func_80016C3C(playerId, 0.0f, cameraId); + break; + case 1: + func_80017720(playerId, 0.0f, cameraId, (s16) pathIndex); + break; + case 14: + func_80017F10(playerId, 0.0f, cameraId, (s16) pathIndex); + break; + case 8: + func_80018718(playerId, 0.0f, cameraId, (s16) pathIndex); + break; + case 12: + func_80019118(playerId, -1.0f, cameraId, (s16) pathIndex); + break; + case 13: + func_80019118(playerId, 1.0f, cameraId, (s16) pathIndex); + break; + case 15: + func_8001969C(playerId, -1.0f, cameraId, (s16) pathIndex); + break; + case 16: + func_8001969C(playerId, 1.0f, cameraId, (s16) pathIndex); + break; + default: + func_80015314(playerId, 0.0f, cameraId); + break; + } + gNearestPathPointByCameraId[cameraId] = + func_8000BD94(camera->pos[0], camera->pos[1], camera->pos[2], (s32) pathIndex); + if ((s16) D_80164680[cameraId] == 9) { + D_80163DD8[cameraId] = (s32) pathIndex; + } +} + +void func_80019B50(s32 cameraIndex, u16 arg1) { + u16 var_v0; + + var_v0 = D_801646C0[cameraIndex]; + if (var_v0 < arg1) { + if ((arg1 - var_v0) < 0x8000) { + var_v0 += 0x5A; + if (arg1 < var_v0) { + var_v0 = arg1; + } + if (var_v0 < 0x5A) { + var_v0 = 0; + } + } else if ((arg1 - var_v0) >= 0x8000) { + var_v0 -= 0x5A; + } + } else if (arg1 < var_v0) { + if ((var_v0 - arg1) < 0x8000) { + var_v0 -= 0x5A; + if (var_v0 < arg1) { + var_v0 = arg1; + } + if (var_v0 >= 0xFFA6) { + var_v0 = 0; + } + } else if ((var_v0 - arg1) >= 0x8000) { + var_v0 += 0x5A; + if (!cameraIndex) {} // wtf? + } + } + D_801646C0[cameraIndex] = (s16) var_v0; +} + +void func_80019C50(s32 playerIndex) { + switch (D_80164678[playerIndex]) { + case 0: + if (D_80164608[playerIndex] == 1) { + D_80164678[playerIndex] = 1; + func_800C9060(playerIndex, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x4F)); + D_80164670[playerIndex] = D_80164678[playerIndex]; + } + break; + case 1: + if (D_80164608[playerIndex] == 1) { + D_80164678[playerIndex] = 0; + func_800C9060(playerIndex, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x50)); + D_80164670[playerIndex] = D_80164678[playerIndex]; + } + break; + } +} + +void func_80019D2C(Camera* camera, Player* player, s32 arg2) { + s32 playerId; + s32 nearestPathPoint; + + playerId = camera->playerId; + if ((gIncrementUpdatePlayer != 0) && (gCurrentCourseId == COURSE_LUIGI_RACEWAY)) { + calculate_camera_up_vector(camera, arg2); + nearestPathPoint = gNearestPathPointByPlayerId[playerId]; + if (((nearestPathPoint >= 0x65) && (nearestPathPoint < 0xFA)) || + ((nearestPathPoint >= 0x1AF) && (nearestPathPoint < 0x226))) { + func_80019B50(arg2, (player->unk_206 * 2)); + } else { + func_80019B50(arg2, 0U); + } + } +} + +void func_80019DE4(void) { + D_801646CC = 1; +} + +void func_80019DF4(void) { + s32 i; + s32 playerId = gGPCurrentRacePlayerIdByRank[0]; + // clang-format off + // Has to be on a single line to match. Because IDO hates you :) + for (i = 0; i < 4; i++) { D_80164670[i] = D_80164678[i]; } + // clang-format on + camera1->playerId = playerId; + D_80164678[0] = 1; + D_801646CC = 2; +} + +void func_80019E58(void) { + D_80164680[0] = 1; + func_80019890(0, 0); + D_80164670[0] = D_80164678[0]; + D_80164678[0] = 1; + D_80164680[1] = 9; + func_80019890(0, 1); + D_80164670[1] = D_80164678[1]; + D_80164678[1] = 0; +} + +void func_80019ED0(void) { + s32 i; + + for (i = 0; i < 4; i++) { + D_80164670[i] = D_80164678[i]; + } + + gGPCurrentRacePlayerIdByRank[0] = (s16) gPlayerWinningIndex; + + camera1->playerId = (s16) gPlayerWinningIndex; + + for (i = 0; i < 4; i++) { + D_80164680[i] = 0; + func_80015314(gPlayerWinningIndex, 0, i); + D_80164678[i] = 1; + } +} + +void func_80019FB4(s32 cameraId) { + struct Controller* controller; + + controller = &gControllerOne[cameraId]; + if (controller->buttonPressed & L_CBUTTONS) { + D_801645D0[cameraId] += 1; + } else { + D_801645D0[cameraId] = 0; + } + if (controller->buttonPressed & D_CBUTTONS) { + D_801645E8[cameraId] += 1; + } else { + D_801645E8[cameraId] = 0; + } + if (controller->buttonPressed & U_CBUTTONS) { + D_80164608[cameraId] += 1; + } else { + D_80164608[cameraId] = 0; + } + if (controller->buttonPressed & R_CBUTTONS) { + D_80164628[cameraId] += 1; + } else { + D_80164628[cameraId] = 0; + } +} + +void func_8001A0A4(UNUSED u16* arg0, UNUSED Camera* arg1, UNUSED Player* arg2, UNUSED s8 arg3, s32 arg4) { + func_80019FB4(arg4); + func_80019C50(arg4); +} + +void func_8001A0DC(u16* arg0, Camera* arg1, Player* arg2, s8 arg3, s32 arg4) { + func_8001A0A4(arg0, arg1, arg2, arg3, arg4); + func_80019D2C(arg1, arg2, arg4); +} + +void func_8001A124(s32 arg0, s32 arg1) { + switch (gGPCurrentRaceRankByPlayerId[arg0]) { /* irregular */ + case 0: + if (random_int(0x0064U) < 0x32) { + D_80164680[arg1] = 0x000C; + } else { + D_80164680[arg1] = 0x000D; + } + func_800CA270(); + break; + case 1: + case 2: + case 3: + D_80164680[arg1] = 8; + break; + default: + if (random_int(0x0064U) < 0x32) { + D_80164680[arg1] = 0x000F; + } else { + D_80164680[arg1] = 0x0010; + } + break; + } +} + +void func_8001A220(UNUSED s32 arg0, s32 cameraId) { + switch (random_int(6)) { + case 0: + D_80164680[cameraId] = 4; + break; + case 1: + D_80164680[cameraId] = 5; + break; + case 2: + D_80164680[cameraId] = 6; + break; + case 3: + D_80164680[cameraId] = 7; + break; + case 4: + D_80164680[cameraId] = 8; + break; + case 5: + D_80164680[cameraId] = 1; + break; + default: + D_80164680[cameraId] = 8; + break; + } +} + +s32 func_8001A310(s32 pathPoint, s32 arg1) { + if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) && (arg1 != 0) && (pathPoint >= 0xE7) && (pathPoint < 0x1C2)) { + arg1 = 0; + } + return arg1; +} + +void func_8001A348(s32 cameraId, f32 arg1, s32 arg2) { + UNUSED s32 pad; + s32 playerId; + + playerId = cameras[cameraId].playerId; + D_80164688[cameraId] = arg1; + D_80164680[cameraId] = func_8001A310((s32) gNearestPathPointByCameraId[cameraId], arg2); + func_80019890(playerId, cameraId); +} + +void func_8001A3D8(s32 arg0, f32 arg1, s32 arg2) { + s32 playerId; + + playerId = cameras[arg0].playerId; + D_80164688[arg0] = arg1; + if (arg2 != D_80164680[arg0]) { + D_80164680[arg0] = arg2; + func_80019890(playerId, arg0); + } +} + +void func_8001A450(s32 playerId, s32 arg1, s32 arg2) { + s32 temp_v1; + s16 pathPoint; + s32 temp_v0; + + if (!(gPlayers[playerId].effects & (UNKNOWN_EFFECT_0x10000000 | MIDAIR_EFFECT | BOOST_RAMP_WOOD_EFFECT))) { + temp_v1 = D_80164680[arg1]; + pathPoint = gNearestPathPointByCameraId[arg1]; + temp_v0 = func_8001A310(pathPoint, (temp_v1 + 1) % 10); + if ((temp_v0 != temp_v1) || (arg2 != playerId)) { + D_80164680[arg1] = temp_v0; + func_80019890(arg2, arg1); + } + } +} + +void func_8001A518(s32 arg0, s32 arg1, s32 arg2) { + switch (arg1) { /* irregular */ + case 0: + D_80164680[arg2] = 1; + break; + case 1: + case 2: + case 3: + func_8001A450(arg0, arg2, arg0); + break; + default: + D_80164680[arg2] = 0; + break; + } +} + +void func_8001A588(UNUSED u16* localD_80152300, Camera* camera, Player* player, s8 index, s32 cameraIndex) { + s32 var_v1; + UnkStruct_46D0* temp_v0_4; + s32 sp44; + s32 playerId; + playerId = camera->playerId; + + if (gModeSelection == TIME_TRIALS) { + playerId = 0; + } + func_80019FB4(cameraIndex); + + if ((s32) (camera->pos[0] * 10.0) == (s32) ((f64) camera->lookAt[0] * 10.0)) { + + if ((s32) (camera->pos[2] * 10.0) == (s32) ((f64) camera->lookAt[2] * 10.0)) { + camera->pos[0] = (f32) (camera->pos[0] + 100.0); + camera->pos[2] = (f32) (camera->pos[2] + 100.0); + } + } + if ((gModeSelection != BATTLE) && (D_80164680[cameraIndex] == -1) && (player->type & PLAYER_CINEMATIC_MODE) && + ((u16) D_801646CC == 0) && (D_801646C8 == 0)) { + if (gModeSelection == VERSUS) { + func_8001A220(playerId, cameraIndex); + } else { + func_8001A124((s32) playerId, cameraIndex); + } + func_80019890((s32) playerId, cameraIndex); + } + + if ((D_80164680[cameraIndex] == 14) || (D_80164680[cameraIndex] == 0)) { + func_80019D2C(camera, player, cameraIndex); + } else { + D_801646C0[cameraIndex] = 0; + calculate_camera_up_vector(camera, cameraIndex); + } + switch ((u16) D_801646CC) { + case 1: + D_801646C8 += 1; + if (D_801646C8 >= 501) { + D_801646C8 = 0; + } + if ((cameraIndex == 0) && (((D_801646C8 == 10)) || (D_801646C8 == 11))) { + func_8001A518((s32) playerId, gGPCurrentRaceRankByPlayerId[playerId], 0); + } + if ((gModeSelection != TIME_TRIALS) && (cameraIndex == 1) && + (((D_801646C8 == 260)) || (D_801646C8 == 261))) { + + var_v1 = 0; + if (gPlayerCount == 2) { + func_8001A518((s32) playerId, gGPCurrentRaceRankByPlayerId[playerId], 1); + } else { + sp44 = (s32) playerId; + while (var_v1 != 8) { + playerId += 1; + var_v1 += 1; + if (playerId >= 8) { + playerId = 1; + } + if ((!(gPlayers[playerId].lakituProps & HELD_BY_LAKITU) && + !(gPlayers[playerId].lakituProps & LAKITU_SCENE))) { + break; + } + } + func_8001A450(sp44, cameraIndex, (s32) playerId); + } + } + break; + case 2: + D_801646C8 += 1; + if (D_801646C8 > 250) { + D_801646C8 = 0; + } + if ((cameraIndex == 0) && (D_801646C8 == 10)) { + func_8001A450((s32) playerId, cameraIndex, (s32) playerId); + } + break; + default: + temp_v0_4 = &D_801646D0[cameraIndex]; + if (temp_v0_4->unk0 == (s16) 1) { + playerId = temp_v0_4->unk4; + temp_v0_4->unk0 = 0; + cameras[cameraIndex].playerId = playerId; + func_8001A3D8(cameraIndex, 0.0f, (s32) temp_v0_4->unk2); + } + break; + } + func_80019C50(cameraIndex); + switch (D_80164680[cameraIndex]) { + case 0: + func_80015390(camera, player, index); + break; + case 2: + case 3: + func_8001577C(camera, player, index, cameraIndex); + break; + case 6: + case 7: + func_80015C94(camera, player, index, cameraIndex); + break; + case 4: + case 5: + func_80016494(camera, player, index, cameraIndex); + break; + case 9: + func_80017054(camera, player, index, cameraIndex); + break; + case 1: + func_800178F4(camera, player, index, cameraIndex); + break; + case 14: + func_800180F0(camera, player, index, cameraIndex); + break; + case 8: + func_800188F4(camera, player, index, cameraIndex); + break; + case 12: + case 13: + func_8001933C(camera, player, index, cameraIndex); + break; + case 15: + case 16: + func_80019760(camera, player, index, cameraIndex); + break; + default: + func_80015390(camera, player, index); + break; + } +} + +void func_8001AAAC(s16 arg0, s16 arg1, s16 arg2) { + if (D_801646D0[arg0].unk0 == 0) { + D_801646D0[arg0].unk0 = 1; + D_801646D0[arg0].unk2 = arg1; + D_801646D0[arg0].unk4 = arg2; + } +} + +#include "cpu_vehicles_camera_path/cpu_item_strategy.inc.c" + +void cpu_use_item_strategy(s32 playerId) { + Player* player = &gPlayerOne[playerId]; + struct Actor* actor; + CpuItemStrategyData* cpuStrategy = &cpu_ItemStrategy[playerId]; + TrackPathPoint* pathPoint; + bool isValidBanana1; + bool isValidBanana2; + +// Only used in this function +#define BANANA_ACTOR(actor) ((struct BananaActor*) (actor)) +#define SHELL_ACTOR(actor) ((struct ShellActor*) (actor)) +#define FAKE_ITEMBOX_ACTOR(actor) ((struct FakeItemBox*) (actor)) +#define BANANA_BUNCH_ACTOR(actor) ((struct BananaBunchParent*) (actor)) + + if (gModeSelection == TIME_TRIALS) { + return; + } + + if ((u16) D_801646CC == 1) { + return; + } + + if (player->type & PLAYER_CINEMATIC_MODE) { + return; + } + + switch (cpuStrategy->branch) { + case CPU_STRATEGY_WAIT_NEXT_ITEM: + cpuStrategy->actorIndex = -1; + if ((((playerId * 20) + 100) < gNumPathPointsTraversed[playerId]) && (cpuStrategy->timer >= 0x259) && + (cpuStrategy->numItemUse < 3) && (gLapCountByPlayerId[playerId] < 3)) { + cpu_decisions_branch_item( + playerId, &cpuStrategy->branch, + cpu_gen_random_item((s16) gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerId[playerId])); + } else { + func_8001ABE0(playerId, cpuStrategy); + } + break; + + case CPU_STRATEGY_ITEM_BANANA: + // never true + if ((gLapCountByPlayerId[playerId] > 0) && + (gGPCurrentRaceRankByPlayerId[playerId] > gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer]) && + (gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer] == FIRST_PLACE)) { + switch (player->characterId) { + case DK: + if (is_path_point_in_range(gNearestPathPointByPlayerId[playerId], + gNearestPathPointByPlayerId[gBestRankedHumanPlayer], 40, 2, + gSelectedPathCount) > 0) { + cpuStrategy->branch = CPU_STRATEGY_THROW_BANANA; + } + break; + + case PEACH: + if (is_path_point_in_range(gNearestPathPointByPlayerId[playerId], + gNearestPathPointByPlayerId[gBestRankedHumanPlayer], 4, 2, + gSelectedPathCount) > 0) { + cpuStrategy->branch = CPU_STRATEGY_THROW_BANANA; + } + break; + + default: + if (is_path_point_in_range(gNearestPathPointByPlayerId[playerId], + gNearestPathPointByPlayerId[gBestRankedHumanPlayer], 10, 2, + gSelectedPathCount) > 0) { + cpuStrategy->branch = CPU_STRATEGY_THROW_BANANA; + } + break; + } + } else if (cpuStrategy->branch == CPU_STRATEGY_ITEM_BANANA) { + cpuStrategy->actorIndex = use_banana_item(player); + if ((cpuStrategy->actorIndex >= 0) && (cpuStrategy->actorIndex < 100)) { + player->triggers |= DRAG_ITEM_EFFECT; + cpuStrategy->branch = CPU_STRATEGY_HOLD_BANANA; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + cpuStrategy->timeBeforeThrow = (random_int(3) * 20) + 10; + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } + } + break; + + case CPU_STRATEGY_HOLD_BANANA: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((!(BANANA_ACTOR(actor)->flags & 0x8000)) || (BANANA_ACTOR(actor)->type != ACTOR_BANANA) || + (BANANA_ACTOR(actor)->state != HELD_BANANA) || (playerId != BANANA_ACTOR(actor)->playerId)) { + + // FAKE + if (!(BANANA_ACTOR(actor)->flags & 0x8000)) {} + if (BANANA_ACTOR(actor)->type != 6) {} + if (BANANA_ACTOR(actor)->state != 0) {} + if (BANANA_ACTOR(actor)->rot[0] != playerId) {} + + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + player->triggers &= ~DRAG_ITEM_EFFECT; + } else if (cpuStrategy->timeBeforeThrow < cpuStrategy->timer) { + cpuStrategy->branch = CPU_STRATEGY_DROP_BANANA; + } + break; + + case CPU_STRATEGY_DROP_BANANA: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(BANANA_ACTOR(actor)->flags & 0x8000)) || (BANANA_ACTOR(actor)->type != ACTOR_BANANA)) || + (BANANA_ACTOR(actor)->state != HELD_BANANA)) || + (playerId != BANANA_ACTOR(actor)->playerId)) { + + // FAKE + if (!(BANANA_ACTOR(actor)->flags & 0x8000)) {} + if (BANANA_ACTOR(actor)->type != 6) {} + if (BANANA_ACTOR(actor)->state != 0) {} + if (BANANA_ACTOR(actor)->rot[0] != playerId) {} + + } else { + BANANA_ACTOR(actor)->state = DROPPED_BANANA; + BANANA_ACTOR(actor)->velocity[0] = 0.0f; + BANANA_ACTOR(actor)->velocity[1] = 0.0f; + BANANA_ACTOR(actor)->velocity[2] = 0.0f; + if (D_801631E0[playerId] == true) { + BANANA_ACTOR(actor)->pos[1] = + get_surface_height(player->pos[0], player->pos[1] + 30.0, player->pos[2]) + + (BANANA_ACTOR(actor)->boundingBoxSize + 1.0f); + } + } + player->triggers &= ~DRAG_ITEM_EFFECT; + cpuStrategy->timer = 0; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + break; + + case CPU_STRATEGY_THROW_BANANA: + cpuStrategy->actorIndex = use_banana_item(player); + if ((cpuStrategy->actorIndex >= 0) && (cpuStrategy->actorIndex < 100)) { + actor = &gActorList[cpuStrategy->actorIndex]; + BANANA_ACTOR(actor)->state = BANANA_ON_GROUND; + player->triggers |= DRAG_ITEM_EFFECT; + cpuStrategy->branch = CPU_STRATEGY_HOLD_THROW_BANANA; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + pathPoint = &gTrackPaths[gPathIndexByPlayerId[0]] + [(gNearestPathPointByPlayerId[gBestRankedHumanPlayer] + 30) % + gPathCountByPathIndex[gPathIndexByPlayerId[gBestRankedHumanPlayer]]]; + BANANA_ACTOR(actor)->velocity[0] = (pathPoint->posX - player->pos[0]) / 20.0; + BANANA_ACTOR(actor)->velocity[1] = ((pathPoint->posY - player->pos[1]) / 20.0) + 4.0; + BANANA_ACTOR(actor)->velocity[2] = (pathPoint->posZ - player->pos[2]) / 20.0; + BANANA_ACTOR(actor)->pos[1] = player->pos[1]; + func_800C92CC(playerId, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x09)); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x14)); + } else { + cpuStrategy->timer = 0; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_HOLD_THROW_BANANA: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(BANANA_ACTOR(actor)->flags & 0x8000)) || (BANANA_ACTOR(actor)->type != ACTOR_BANANA)) || + (BANANA_ACTOR(actor)->state != BANANA_ON_GROUND)) || + (playerId != BANANA_ACTOR(actor)->playerId)) { + + // FAKE + if (!(BANANA_ACTOR(actor)->flags & 0x8000)) {} + if (BANANA_ACTOR(actor)->type != 6) {} + if (BANANA_ACTOR(actor)->state != 0) {} + if (BANANA_ACTOR(actor)->rot[0] != playerId) {} + + cpuStrategy->timer = 0; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + player->triggers &= ~DRAG_ITEM_EFFECT; + } else { + BANANA_ACTOR(actor)->velocity[1] -= 0.4; + BANANA_ACTOR(actor)->pos[0] += BANANA_ACTOR(actor)->velocity[0]; + BANANA_ACTOR(actor)->pos[1] += BANANA_ACTOR(actor)->velocity[1]; + BANANA_ACTOR(actor)->pos[2] += BANANA_ACTOR(actor)->velocity[2]; + if (cpuStrategy->timer > 20) { + cpuStrategy->branch = CPU_STRATEGY_END_THROW_BANANA; + } + } + break; + + case CPU_STRATEGY_END_THROW_BANANA: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(BANANA_ACTOR(actor)->flags & 0x8000)) || (BANANA_ACTOR(actor)->type != ACTOR_BANANA)) || + (BANANA_ACTOR(actor)->state != BANANA_ON_GROUND)) || + (playerId != BANANA_ACTOR(actor)->playerId)) { + + // FAKE + if (!(BANANA_ACTOR(actor)->flags & 0x8000)) {} + if (BANANA_ACTOR(actor)->type != 6) {} + if (BANANA_ACTOR(actor)->state != 0) {} + if (BANANA_ACTOR(actor)->rot[0] != playerId) {} + + } else { + BANANA_ACTOR(actor)->state = DROPPED_BANANA; + BANANA_ACTOR(actor)->velocity[0] = 0.0f; + BANANA_ACTOR(actor)->velocity[1] = 0.0f; + BANANA_ACTOR(actor)->velocity[2] = 0.0f; + BANANA_ACTOR(actor)->pos[1] = + get_surface_height(BANANA_ACTOR(actor)->pos[0], BANANA_ACTOR(actor)->pos[1] + 30.0, + BANANA_ACTOR(actor)->pos[2]) + + (BANANA_ACTOR(actor)->boundingBoxSize + 1.0f); + } + player->triggers &= ~DRAG_ITEM_EFFECT; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + break; + + case CPU_STRATEGY_ITEM_GREEN_SHELL: + if (gNumActors < 80) { + cpuStrategy->actorIndex = use_green_shell_item(player); + if ((cpuStrategy->actorIndex >= 0) && (cpuStrategy->actorIndex < 100)) { + cpuStrategy->branch = CPU_STRATEGY_HOLD_GREEN_SHELL; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + cpuStrategy->timeBeforeThrow = (random_int(3) * 20) + 10; + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_HOLD_GREEN_SHELL: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(actor->flags & 0x8000)) || (actor->type != ACTOR_GREEN_SHELL)) || (actor->state != HELD_SHELL)) || + (playerId != actor->rot[2])) { + + // FAKE + if (!(actor->flags & 0x8000)) {} + if (actor->type != 7) {} + if (actor->state != 0) {} + if (actor->rot[0] != playerId) {} + + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } else if (cpuStrategy->timeBeforeThrow < cpuStrategy->timer) { + cpuStrategy->branch = CPU_STRATEGY_THROW_GREEN_SHELL; + cpuStrategy->timer = 0; + } + break; + + case CPU_STRATEGY_THROW_GREEN_SHELL: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(actor->flags & 0x8000)) || (actor->type != ACTOR_GREEN_SHELL)) || (actor->state != HELD_SHELL)) || + (playerId != actor->rot[2])) { + + // FAKE + if (!(actor->flags & 0x8000)) {} + if (actor->type != 7) {} + if (actor->state != 0) {} + if (actor->rot[0] != playerId) {} + + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } else { + actor->state = RELEASED_SHELL; + cpuStrategy->timer = 0; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_ITEM_RED_SHELL: + if (gNumActors < 80) { + cpuStrategy->actorIndex = use_red_shell_item(player); + if ((cpuStrategy->actorIndex >= 0) && (cpuStrategy->actorIndex < 100)) { + cpuStrategy->branch = CPU_STRATEGY_HOLD_RED_SHELL; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + cpuStrategy->timeBeforeThrow = (random_int(3) * 20) + 10; + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_HOLD_RED_SHELL: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(SHELL_ACTOR(actor)->flags & 0x8000)) || (SHELL_ACTOR(actor)->type != ACTOR_RED_SHELL)) || + (SHELL_ACTOR(actor)->state != HELD_SHELL)) || + (playerId != SHELL_ACTOR(actor)->playerId)) { + + // FAKE + if (!(actor->flags & 0x8000)) {} + if (actor->type != 8) {} + if (actor->state != 0) {} + if (actor->rot[0] != playerId) {} + + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } else if (cpuStrategy->timeBeforeThrow < cpuStrategy->timer) { + cpuStrategy->branch = CPU_STRATEGY_THROW_RED_SHELL; + } + break; + + case CPU_STRATEGY_THROW_RED_SHELL: + clear_expired_strategies(cpuStrategy); + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(SHELL_ACTOR(actor)->flags & 0x8000)) || (SHELL_ACTOR(actor)->type != ACTOR_RED_SHELL)) || + (SHELL_ACTOR(actor)->state != HELD_SHELL)) || + (playerId != SHELL_ACTOR(actor)->playerId)) { + + // FAKE + if (!(actor->flags & 0x8000)) {} + if (actor->type != 8) {} + if (actor->state != 0) {} + if (actor->rot[0] != playerId) {} + + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } else { + SHELL_ACTOR(actor)->state = RELEASED_SHELL; + cpuStrategy->timer = 0; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_ITEM_BANANA_BUNCH: + if (gNumActors < 80) { + cpuStrategy->actorIndex = use_banana_bunch_item(player); + if ((cpuStrategy->actorIndex >= 0) && (cpuStrategy->actorIndex < 100)) { + cpuStrategy->branch = CPU_STRATEGY_WAIT_INIT_BANANA_BUNCH; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + cpuStrategy->timeBeforeThrow = (random_int(3) * 20) + 60; + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_WAIT_INIT_BANANA_BUNCH: + actor = &gActorList[cpuStrategy->actorIndex]; + if (BANANA_BUNCH_ACTOR(actor)->state == 6) { + + // FAKE + if (BANANA_BUNCH_ACTOR(actor)->state != -1) {} + if (BANANA_BUNCH_ACTOR(actor)->state == 6) {} + + isValidBanana2 = false; + + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[4] != (-1)) { + isValidBanana2 = true; + } + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[3] != (-1)) { + isValidBanana2 = true; + } + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[2] != (-1)) { + isValidBanana2 = true; + } + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[1] != (-1)) { + isValidBanana2 = true; + } + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[0] != (-1)) { + isValidBanana2 = true; + } + if ((BANANA_BUNCH_ACTOR(actor)->type != ACTOR_BANANA_BUNCH) || (isValidBanana2 == false)) { + if (BANANA_BUNCH_ACTOR(actor)->type != 14) {} + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } else if (cpuStrategy->timeBeforeThrow < cpuStrategy->timer) { + cpuStrategy->branch = CPU_STRATEGY_DROP_BANANA_BUNCH; + cpuStrategy->numDroppedBananaBunch = 0; + cpuStrategy->timer = 0; + } + } + break; + + case CPU_STRATEGY_DROP_BANANA_BUNCH: + if (((cpuStrategy->timer) % 10) == 0) { + if (cpuStrategy->numDroppedBananaBunch < 5) { + isValidBanana1 = 0; + actor = &gActorList[cpuStrategy->actorIndex]; + switch (cpuStrategy->numDroppedBananaBunch) { + case 0: + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[4] != (-1)) { + isValidBanana1 = true; + } + break; + + case 1: + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[3] != (-1)) { + isValidBanana1 = true; + } + break; + + case 2: + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[2] != (-1)) { + isValidBanana1 = true; + } + break; + + case 3: + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[1] != (-1)) { + isValidBanana1 = true; + } + break; + + case 4: + if (BANANA_BUNCH_ACTOR(actor)->bananaIndices[0] != (-1)) { + isValidBanana1 = true; + } + break; + } + + if (((BANANA_BUNCH_ACTOR(actor)->type == ACTOR_BANANA_BUNCH) && + (BANANA_BUNCH_ACTOR(actor)->state == 6)) && + (isValidBanana1 == true)) { + drop_banana_in_banana_bunch((struct BananaBunchParent*) actor); + } + cpuStrategy->numDroppedBananaBunch += 1; + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } + } + break; + + case CPU_STRATEGY_ITEM_FAKE_ITEM_BOX: + cpuStrategy->actorIndex = use_fake_itembox_item(player); + if ((cpuStrategy->actorIndex >= 0) && (cpuStrategy->actorIndex < 100)) { + cpuStrategy->branch = CPU_STRATEGY_HOLD_FAKE_ITEM_BOX; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + cpuStrategy->timeBeforeThrow = (random_int(3) * 20) + 10; + } else { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + break; + + case CPU_STRATEGY_HOLD_FAKE_ITEM_BOX: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) || + (FAKE_ITEMBOX_ACTOR(actor)->type != ACTOR_FAKE_ITEM_BOX)) || + (FAKE_ITEMBOX_ACTOR(actor)->state != 0)) || + (playerId != ((s32) FAKE_ITEMBOX_ACTOR(actor)->playerId))) { + + // FAKE + if (!(actor->flags & 0x8000)) {} + if (actor->type != 13) {} + if (actor->state != 0) {} + if (actor->rot[0] != playerId) {} + + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } else if (cpuStrategy->timeBeforeThrow < cpuStrategy->timer) { + cpuStrategy->branch = CPU_STRATEGY_THROW_FAKE_ITEM_BOX; + } + break; + + case CPU_STRATEGY_THROW_FAKE_ITEM_BOX: + actor = &gActorList[cpuStrategy->actorIndex]; + if ((((!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) || + (FAKE_ITEMBOX_ACTOR(actor)->type != ACTOR_FAKE_ITEM_BOX)) || + (FAKE_ITEMBOX_ACTOR(actor)->state != 0)) || + (playerId != ((s32) FAKE_ITEMBOX_ACTOR(actor)->playerId))) { + + // FAKE + if (!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) {} + if (FAKE_ITEMBOX_ACTOR(actor)->type != 13) {} + if (FAKE_ITEMBOX_ACTOR(actor)->state != 0) {} + if (FAKE_ITEMBOX_ACTOR(actor)->rot[0] != playerId) {} + + } else { + func_802A1064((struct FakeItemBox*) actor); + if (D_801631E0[playerId] == true) { + FAKE_ITEMBOX_ACTOR(actor)->pos[1] = + get_surface_height(FAKE_ITEMBOX_ACTOR(actor)->pos[0], FAKE_ITEMBOX_ACTOR(actor)->pos[1] + 30.0, + FAKE_ITEMBOX_ACTOR(actor)->pos[2]) + + FAKE_ITEMBOX_ACTOR(actor)->boundingBoxSize; + } + } + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + break; + + case CPU_STRATEGY_ITEM_THUNDERBOLT: + use_thunder_item(player); + func_800CAC60(playerId); + func_8009E5BC(); + cpuStrategy->branch = CPU_STRATEGY_END_THUNDERBOLT; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + break; + + case CPU_STRATEGY_END_THUNDERBOLT: + if (cpuStrategy->timer >= 0xF1) { + func_800CAD40((s32) ((u8) playerId)); + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + } + break; + + case CPU_STRATEGY_ITEM_STAR: + player->triggers |= STAR_TRIGGER; + cpuStrategy->branch = CPU_STRATEGY_END_ITEM_STAR; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + break; + + case CPU_STRATEGY_END_ITEM_STAR: + if (!(player->effects & STAR_EFFECT)) { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + cpuStrategy->timer = 0; + break; + + case CPU_STRATEGY_ITEM_BOO: + player->triggers |= BOO_TRIGGER; + cpuStrategy->branch = CPU_STRATEGY_WAIT_END_BOO; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + break; + + case CPU_STRATEGY_WAIT_END_BOO: + if (!(player->effects & BOO_EFFECT)) { + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + cpuStrategy->timer = 0; + break; + + case CPU_STRATEGY_ITEM_MUSHROOM: + player->triggers |= SHROOM_TRIGGER; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + cpuStrategy->timer = 0; + cpuStrategy->numItemUse += 1; + break; + + case CPU_STRATEGY_ITEM_DOUBLE_MUSHROOM: + if (cpuStrategy->timer >= 0x3D) { + player->triggers |= SHROOM_TRIGGER; + cpuStrategy->branch = CPU_STRATEGY_ITEM_MUSHROOM; + cpuStrategy->timer = 0; + } + break; + + case CPU_STRATEGY_ITEM_TRIPLE_MUSHROOM: + if (cpuStrategy->timer >= 0x3D) { + player->triggers |= SHROOM_TRIGGER; + cpuStrategy->branch = CPU_STRATEGY_ITEM_DOUBLE_MUSHROOM; + cpuStrategy->timer = 0; + } + break; + + case CPU_STRATEGY_ITEM_SUPER_MUSHROOM: + cpuStrategy->branch = CPU_STRATEGY_USE_SUPER_MUSHROOM; + cpuStrategy->timer = 0; + cpuStrategy->timeBeforeThrow = 0x0258; + break; + + case CPU_STRATEGY_USE_SUPER_MUSHROOM: + if ((((s16) cpuStrategy->timer) % 60) == 0) { + player->triggers |= SHROOM_TRIGGER; + if (cpuStrategy->timeBeforeThrow < cpuStrategy->timer) { + cpuStrategy->timer = 0; + cpuStrategy->branch = CPU_STRATEGY_WAIT_NEXT_ITEM; + } + } + break; + + default: + break; + } + + if (cpuStrategy->timer < 10000) { + cpuStrategy->timer += 1; + } + if (player->effects & (BOO_EFFECT | MUSHROOM_EFFECT | STAR_EFFECT)) { + cpuStrategy->timer = 0; + } +} + +#undef BANANA_ACTOR +#undef SHELL_ACTOR +#undef FAKE_ITEMBOX_ACTOR +#undef BANANA_BUNCH + +void func_8001BE78(void) { + Player* temp_s1; + TrackPathPoint* temp_s0; + s32 i; + + init_players(); + for (i = 0; i < 4; i++) { + temp_s1 = &gPlayerOne[i]; + temp_s1->type &= 0xDFFF; + gPathIndexByPlayerId[i] = i; + gPlayerTrackPositionFactorInstruction[i].unkC = 0.0f; + gPlayerTrackPositionFactorInstruction[i].target = 0.0f; + gPlayerTrackPositionFactorInstruction[i].current = 0.0f; + switch (i) { + case 0: + gNearestPathPointByPlayerId[i] = 6; + break; + case 1: + gNearestPathPointByPlayerId[i] = 1; + break; + case 2: + gNearestPathPointByPlayerId[i] = 6; + break; + case 3: + gNearestPathPointByPlayerId[i] = 1; + break; + } + temp_s0 = &gTrackPaths[i][gNearestPathPointByPlayerId[i]]; + temp_s1->pos[0] = (f32) temp_s0->posX; + temp_s1->pos[1] = + get_surface_height((f32) temp_s0->posX, 2000.0f, (f32) temp_s0->posZ) + temp_s1->boundingBoxSize; + temp_s1->pos[2] = (f32) temp_s0->posZ; + temp_s1->rotation[1] = (s16) *gPathExpectedRotation[i]; + apply_cpu_turn(temp_s1, 0); + temp_s1++; + D_80163410[i] = 0; + } +} + +void func_8001C05C(void) { + init_segment_racing(); + gCurrentCourseId = COURSE_AWARD_CEREMONY; + D_8016347C = 0; + D_8016347E = 0; + D_80163480 = 0; + D_80163484 = 0; + init_course_path_point(); + func_80014DE4(0); + func_8001BE78(); + D_80163418[0] = -3202.475097656f; + D_80163428[0] = 19.166999817f; + D_80163438[0] = -477.623992920f; + D_80163418[1] = -3205.080078125f; + D_80163428[1] = 19.166999817f; + D_80163438[1] = -462.851989746f; + D_80163418[2] = -3199.870117188f; + D_80163428[2] = 19.166999817f; + D_80163438[2] = -492.395996094f; + D_80163418[3] = -2409.197021484f; + D_80163428[3] = 0.0f; + D_80163438[3] = -355.253997803; +} + +void func_8001C14C(void) { + f32 temp_f0; + f32 temp_f2; + s32 playerId; + Player* temp_s0; + + if (D_8016347C == 1) { + D_80163480 += 1; + } + if ((D_8016347E == 1) && (gBombKarts[0].state == 0) && (D_802874D8.unk1D >= 3)) { + D_80163484++; + if (D_80163484 >= 0xF) { + D_80163484 = 0; + D_8016347E = 2; + func_8009265C(); + } + } + for (playerId = 0; playerId < 4; playerId++) { + if ((playerId == 3) && (D_8016347C == 0)) { + break; + } + + temp_s0 = &gPlayerOne[playerId]; + update_player(playerId); + if (!(temp_s0->type & PLAYER_START_SEQUENCE)) { + temp_f0 = D_80163418[playerId] - temp_s0->pos[0]; + temp_f2 = D_80163438[playerId] - temp_s0->pos[2]; + if ((f64) ((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 1.0) { + if (playerId != 3) { + if (1) {} + // Why oh why is a ternary required here? Who does that? + (D_8016347C == 0) ? (temp_s0->type |= PLAYER_START_SEQUENCE) + : (temp_s0->type &= ~PLAYER_START_SEQUENCE); + if ((gPlayerOne->type & PLAYER_START_SEQUENCE) && (gPlayerTwo->type & PLAYER_START_SEQUENCE) && + (gPlayerThree->type & PLAYER_START_SEQUENCE)) { + D_8016347C = 1; + D_80163480 = 0; + } + } else if (D_8016347E == 0) { + if (!(temp_s0->effects & EXPLOSION_CRASH_EFFECT)) { + temp_s0->type |= PLAYER_START_SEQUENCE; + } + D_8016347E = 1; + D_80163484 = 0; + } else if (!(temp_s0->effects & EXPLOSION_CRASH_EFFECT)) { + temp_s0->type |= PLAYER_START_SEQUENCE; + } + } + } + } +} + +void render_bomb_karts_wrap(s32 cameraId) { + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + if (gBombKarts[0].pathPointIndex >= 16) { + func_80057114(PLAYER_FOUR); + } + } else { + if (gModeSelection == VERSUS) { + func_80057114(cameraId); + } + } +} + +UNUSED void func_8001C42C(void) { + if (D_800DDB20 == 0) { + if ((gControllerThree->buttonPressed & 0x20) != 0) { + D_800DDB20 = 1; + } + } else { + if ((gControllerThree->buttonPressed & 0x20) != 0) { + D_800DDB20 = 0; + } + func_80057C60(); + gSPDisplayList(gDisplayListHead++, D_0D0076F8); + func_80057CE4(); + } +} diff --git a/src/code_80005FD0.h b/src/cpu_vehicles_camera_path.h similarity index 51% rename from src/code_80005FD0.h rename to src/cpu_vehicles_camera_path.h index 61dff34355..ae46283e80 100644 --- a/src/code_80005FD0.h +++ b/src/cpu_vehicles_camera_path.h @@ -1,20 +1,11 @@ -#ifndef CODE_80005FD0_H -#define CODE_80005FD0_H +#ifndef cpu_vehicles_camera_path_H +#define cpu_vehicles_camera_path_H #include "vehicles.h" #include "camera.h" -#include "waypoints.h" +#include "path.h" #include -struct struct_801642D8 { - /* 0x0 */ u16 unk0; - /* 0x2 */ s16 ffff; - /* 0x4 */ s16 timer; // confirm? - /* 0x6 */ s16 laps; // confirm? - /* 0x8 */ s32 blank; - /* 0xC */ s32 unkC; -}; - struct unexpiredActors { /* 0x00 */ s32 unk0; /* 0x04 */ s32 unk4; @@ -28,23 +19,23 @@ struct unexpiredActors { }; // size = 0x1C typedef struct { - /* 0x00 */ f32 unk0; - /* 0x04 */ f32 unk4; - /* 0x08 */ f32 unk8; + /* 0x00 */ f32 current; + /* 0x04 */ f32 target; + /* 0x08 */ f32 step; /* 0x0C */ f32 unkC; -} Test; // size = 0x10 +} TrackPositionFactorInstruction; // size = 0x10 // Something related to CPU item usage typedef struct { - /* 0x00 */ s16 unk_00; + /* 0x00 */ s16 branch; /* 0x02 */ s16 actorIndex; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; + /* 0x04 */ s16 timer; // confirm? + /* 0x06 */ s16 numItemUse; // confirm? + /* 0x08 */ s16 numDroppedBananaBunch; /* 0x0A */ s16 unk_0A; /* 0x0C */ s16 unk_0C; - /* 0x0E */ s16 unk_0E; -} D_801642D8_entry; // size = 0x10 + /* 0x0E */ s16 timeBeforeThrow; +} CpuItemStrategyData; // size = 0x10 typedef struct { s16 unk0; @@ -58,62 +49,105 @@ typedef struct { s16 z; } Path2D; +enum CpuItemStrategyEnum { + CPU_STRATEGY_WAIT_NEXT_ITEM = 0, + + CPU_STRATEGY_ITEM_BANANA, + CPU_STRATEGY_HOLD_BANANA, + CPU_STRATEGY_DROP_BANANA, + + CPU_STRATEGY_ITEM_GREEN_SHELL, + CPU_STRATEGY_HOLD_GREEN_SHELL, + CPU_STRATEGY_THROW_GREEN_SHELL, + + CPU_STRATEGY_ITEM_RED_SHELL, + CPU_STRATEGY_HOLD_RED_SHELL, + CPU_STRATEGY_THROW_RED_SHELL, + + CPU_STRATEGY_ITEM_BANANA_BUNCH, + CPU_STRATEGY_WAIT_INIT_BANANA_BUNCH, + CPU_STRATEGY_DROP_BANANA_BUNCH, + + CPU_STRATEGY_ITEM_FAKE_ITEM_BOX, + CPU_STRATEGY_HOLD_FAKE_ITEM_BOX, + CPU_STRATEGY_THROW_FAKE_ITEM_BOX, + + CPU_STRATEGY_ITEM_THUNDERBOLT = 0x16, + CPU_STRATEGY_END_THUNDERBOLT, + + CPU_STRATEGY_ITEM_STAR = 0x19, + CPU_STRATEGY_END_ITEM_STAR, + + CPU_STRATEGY_ITEM_BOO, + CPU_STRATEGY_WAIT_END_BOO, + + CPU_STRATEGY_ITEM_MUSHROOM, + CPU_STRATEGY_ITEM_DOUBLE_MUSHROOM, + CPU_STRATEGY_ITEM_TRIPLE_MUSHROOM, + CPU_STRATEGY_ITEM_SUPER_MUSHROOM, + CPU_STRATEGY_USE_SUPER_MUSHROOM, + + CPU_STRATEGY_THROW_BANANA, + CPU_STRATEGY_HOLD_THROW_BANANA, + CPU_STRATEGY_END_THROW_BANANA +}; + /* Function Prototypes */ -s16 get_angle_between_waypoints(Vec3f, Vec3f); +s16 get_angle_between_path(Vec3f, Vec3f); -s32 func_80006018(f32, f32, f32, f32, f32, f32, f32, f32); +s32 is_collide_with_vehicle(f32, f32, f32, f32, f32, f32, f32, f32); void adjust_position_by_angle(Vec3f, Vec3f, s16); s32 set_vehicle_render_distance_flags(Vec3f, f32, s32); -void func_800065D0(s32, Player*); +void detect_wrong_player_direction(s32, Player*); void set_places(void); -void func_800070F4(void); -void func_800074D4(void); -s32 func_80007BF8(u16, u16, u16, u16, u16); +void update_player_rankings(void); +void set_places_end_course_with_time(void); +s32 is_path_point_in_range(u16, u16, u16, u16, u16); void func_80007D04(s32, Player*); void func_80007FA4(s32, Player*, f32); -void func_80008424(s32, f32, Player*); -s32 func_800088D8(s32, s16, s16); -void func_80008DC0(s32); -s32 func_80008E58(s32, s32); -void func_80008F38(s32); +void regulate_cpu_speed(s32, f32, Player*); +bool func_800088D8(s32, s16, s16); +void set_current_path(s32); +s32 update_player_path_selection(s32, s32); +void update_player_completion(s32); -void func_80009000(s32); -void func_800090F0(s32, Player*); +void yoshi_valley_cpu_path(s32); +void update_cpu_path_completion(s32, Player*); f32 func_80009258(s32, f32, f32); -void func_8000929C(s32, Player*); +void update_player_path_completion(s32, Player*); void update_vehicles(void); -void func_800098FC(s32, Player*); -void func_800099EC(s32, Player*); -void func_80009B60(s32); +void play_cpu_sound_effect(s32, Player*); +void update_player_timer_sound(s32, Player*); +void update_player(s32); void func_8000B140(s32); -s32 func_8000B7E4(s32, u16); -s32 func_8000B820(s32); -f32 func_8000B874(f32, f32, u16, s32); -void func_8000B95C(s32, u16, s32); -void func_8000BA14(u16, f32, f32, s16); -void func_8000BBD8(u16, f32, s16); +s32 are_in_curve(s32, u16); +bool is_far_from_path(s32); +f32 calculate_track_position_factor(f32, f32, u16, s32); +void update_player_position_factor(s32, u16, s32); +void calculate_track_offset_position(u16, f32, f32, s16); +void set_track_offset_position(u16, f32, s16); s16 func_8000BD94(f32, f32, f32, s32); -s16 find_closest_waypoint_track_section(f32, f32, f32, u16, s32*); -s16 func_8000C884(f32, f32, f32, s16, s32, u16); -s16 find_closest_waypoint_with_previous_waypoint(f32, f32, f32, s16, s32); -void func_8000CBA4(f32, f32, f32, s16*, s32); -void func_8000CBF8(f32, f32, f32, s16*, s32); -s16 func_8000CC88(f32, f32, f32, Player*, s32, s32*); -s16 func_8000CD24(f32, f32, f32, s16, Player*, s32, s32); +s16 find_closest_path_point_track_section(f32, f32, f32, u16, s32*); +s16 update_path_index_with_track(f32, f32, f32, s16, s32, u16); +s16 update_path_index(f32, f32, f32, s16, s32); +void tweak_path_index_wario_stadium(f32, f32, f32, s16*, s32); +void adjust_path_at_start_line(f32, f32, f32, s16*, s32); +s16 update_path_index_track_section(f32, f32, f32, Player*, s32, s32*); +s16 update_player_path(f32, f32, f32, s16, Player*, s32, s32); -s16 find_closest_vehicles_waypoint(f32, f32, f32, s16); +s16 find_closest_vehicles_path_point(f32, f32, f32, s16); s16 func_8000D24C(f32, f32, f32, s32*); s16 func_8000D2B4(f32, f32, f32, s16, s32); s16 func_8000D33C(f32, f32, f32, s16, s32); -f32 func_8000D3B8(s32); -void func_8000D438(s32, u16); +f32 cpu_track_position_factor(s32); +void determine_ideal_cpu_position_offset(s32, u16); s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16); s16 func_8000D940(Vec3f, s16*, f32, f32, s16); -s16 update_vehicle_following_waypoint(Vec3f, s16*, f32); +s16 update_vehicle_following_path(Vec3f, s16*, f32); void set_bomb_kart_spawn_positions(void); void func_8000DF8C(s32); @@ -127,69 +161,69 @@ void generate_player_smoke(void); void func_8000F0E0(void); void func_8000F124(void); -void func_8000F2BC(TrackWaypoint*, size_t); -void func_8000F2DC(void); -void func_8000F628(void); - -void func_800100F0(s32); -void func_80010218(s32); -f32 func_80010480(s32, u16); -void func_800107C4(s32); -s16 func_80010CB0(s32, s32); -void func_80010DBC(s32); -void func_80010E6C(s32); +void clear_path_point(TrackPathPoint*, size_t); +void init_course_path_point(void); +void init_players(void); + +void load_track_path(s32); +void calculate_track_boundaries(s32); +f32 calculate_track_curvature(s32, u16); +void analize_track_section(s32); +s16 calculate_angle_path(s32, s32); +void analyse_angle_path(s32); +void analisze_curved_path(s32); f32 func_80010F40(f32, f32, f32, s32, s32); f32 func_80010FA0(f32, f32, f32, s32, s32); -s32 func_80011014(TrackWaypoint*, TrackWaypoint*, s32, s32); -s32 process_path_data(TrackWaypoint*, TrackWaypoint*); -s32 generate_2d_path(Path2D*, TrackWaypoint*, s32); -void copy_courses_kart_ai_behaviour(void); -void reset_kart_ai_behaviour_none(s32); -void reset_kart_ai_behaviour(s32); -void kart_ai_behaviour_start(s32, Player*); -void kart_ai_behaviour_end(s32, Player*); -void kart_ai_behaviour(s32); +s32 func_80011014(TrackPathPoint*, TrackPathPoint*, s32, s32); +s32 process_path_data(TrackPathPoint*, TrackPathPoint*); +s32 generate_2d_path(Path2D*, TrackPathPoint*, s32); +void copy_courses_cpu_behaviour(void); +void reset_cpu_behaviour_none(s32); +void reset_cpu_behaviour(s32); +void cpu_behaviour_start(s32, Player*); +void cpu_behaviour_end(s32, Player*); +void cpu_behaviour(s32); void func_80011EC0(s32, Player*, s32, u16); -void generate_train_waypoints(void); -void generate_ferry_waypoints(void); +void generate_train_path(void); +void generate_ferry_path(void); void spawn_vehicle_on_road(VehicleStuff*); void spawn_course_vehicles(void); -void set_vehicle_pos_waypoint(TrainCarStuff*, Path2D*, u16); +void set_vehicle_pos_path_point(TrainCarStuff*, Path2D*, u16); void init_vehicles_trains(void); void sync_train_components(TrainCarStuff*, s16); void update_vehicle_trains(void); -void func_80012DC0(s32, Player*); +void handle_trains_interactions(s32, Player*); void func_80013054(void); void check_ai_crossing_distance(s32); void init_vehicles_ferry(void); void update_vehicle_paddle_boats(void); -void func_80013854(Player*); -void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackWaypoint*); +void handle_paddle_boats_interactions(Player*); +void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackPathPoint*); f32 func_80013C74(s16, s16); -void update_vehicle_follow_waypoint(VehicleStuff*); -void func_80013F7C(s32, Player*, VehicleStuff*, f32, f32, s32, u32); +void update_vehicle_follow_path_point(VehicleStuff*); +void handle_vehicle_interactions(s32, Player*, VehicleStuff*, f32, f32, s32, u32); -f32 func_800145A8(s16, f32, s16); -void func_800146B8(s32, s32, VehicleStuff*); +f32 player_track_position_factor_vehicle(s16, f32, s16); +void update_player_track_position_factor_from_vehicle(s32, s32, VehicleStuff*); void init_vehicles_box_trucks(void); void update_vehicle_box_trucks(void); -void func_800148C4(s32, Player*); -void func_8001490C(s32); +void handle_box_trucks_interactions(s32, Player*); +void update_player_track_position_factor_from_box_trucks(s32); void init_vehicles_school_buses(void); void update_vehicle_school_bus(void); -void func_80014A18(s32, Player*); -void func_80014A60(s32); +void handle_school_buses_interactions(s32, Player*); +void update_player_track_position_factor_from_buses(s32); void init_vehicles_trucks(void); void update_vehicle_tanker_trucks(void); -void func_80014B6C(s32, Player*); -void func_80014BB4(s32); +void handle_tanker_trucks_interactions(s32, Player*); +void update_player_track_position_factor_from_tanker_truck(s32); void init_vehicles_cars(void); void update_vehicle_cars(void); -void func_80014CC0(s32, Player*); -void func_80014D08(s32); +void handle_cars_interactions(s32, Player*); +void update_player_track_position_factor_from_cars(s32); void func_80014D30(s32, s32); void func_80014DE4(s32); f32 func_80014EE4(f32, s32); @@ -241,16 +275,16 @@ void func_8001A518(s32, s32, s32); void func_8001A588(u16*, Camera*, Player*, s8, s32); void func_8001AAAC(s16, s16, s16); void func_8001AB00(void); -void kart_ai_decisions_branch_item(s32, s16*, s32); -void func_8001ABE0(s32, D_801642D8_entry*); -void func_8001ABEC(struct struct_801642D8*); -void kart_ai_use_item_strategy(s32); +void cpu_decisions_branch_item(s32, s16*, s32); +void func_8001ABE0(s32, CpuItemStrategyData*); +void clear_expired_strategies(CpuItemStrategyData*); +void cpu_use_item_strategy(s32); void func_8001BE78(void); void func_8001C05C(void); void func_8001C14C(void); -void func_8001C3C4(s32); +void render_bomb_karts_wrap(s32); void func_8001C42C(void); /* This is where I'd put my static data, if I had any */ @@ -258,10 +292,10 @@ void func_8001C42C(void); extern Collision D_80162E70; extern s16 D_80162EB0; // Possibly a float. extern s16 D_80162EB2; // possibly [3] -extern KartAIBehaviour* gCoursesKartAIBehaviour[]; +extern CPUBehaviour* gCoursesCPUBehaviour[]; extern s16 D_80162F10[]; extern s16 D_80162F50[]; -extern Vec3f D_80162FA0; +extern Vec3f gOffsetPosition; extern Vec3f D_80162FB0; extern Vec3f D_80162FC0; extern s16 gTrainSmokeTimer; @@ -269,61 +303,50 @@ extern s16 D_80162FD0; extern f32 gCourseCompletionPercentByRank[]; // D_80162FD8 extern s16 D_80162FF8[]; extern s16 D_80163010[]; -extern f32 D_80163028[]; -extern s16 D_80163050[]; -extern f32 D_80163068[]; +extern f32 cpu_TargetSpeed[]; +extern s16 gPreviousAngleSteering[]; extern f32 D_80163090[]; -extern s32 D_801630B8[]; -extern u16 D_801630E0; -extern s16 D_801630E2; +extern bool gIsPlayerInCurve[]; +extern u16 gCurrentNearestPathPoint; +extern s16 gIsPlayerNewPathPoint; extern s16 D_801630E8[]; extern s16 gFerrySmokeTimer; extern s32 D_80163100[]; extern s32 D_80163128[]; extern s32 D_80163150[]; -extern f32 D_80163178[]; -extern f32 D_801631A0[]; -extern s16 D_801631C8; +extern f32 gPreviousPlayerAiOffsetX[]; +extern f32 gPreviousPlayerAiOffsetZ[]; +extern s16 sVehicleSoundRenderCounter; extern s32 D_801631CC; -extern TrackWaypoint* D_801631D0; -extern TrackWaypoint* D_801631D4; -extern s16* D_801631D8; extern u16 D_801631E0[]; extern u16 D_801631F8[]; -extern f32 D_8016320C; -extern f32 D_80163210[]; +extern f32 gCurrentCpuTargetSpeed; +extern f32 gPreviousCpuTargetSpeed[]; extern s32 D_80163238; extern u16 D_80163240[]; -extern u16 D_80163258[]; -extern u16 D_80163270[]; -extern s32 D_80163288[]; +extern u16 gWrongDirectionCounter[]; +extern u16 gIsPlayerWrongDirection[]; +extern s32 gPreviousLapProgressScore[]; // Exact pointer type unknown -extern KartAIBehaviour* sCurrentKartAIBehaviour; -extern u16 gCurrentKartAIBehaviourId[]; -extern u16 gPreviousKartAIBehaviourId[]; -extern u16 gKartAIBehaviourState[]; +extern CPUBehaviour* sCurrentCPUBehaviour; +extern u16 gCurrentCPUBehaviourId[]; +extern u16 gPreviousCPUBehaviourId[]; +extern u16 cpu_BehaviourState[]; -enum { KART_AI_BEHAVIOUR_STATE_NONE, KART_AI_BEHAVIOUR_STATE_START, KART_AI_BEHAVIOUR_STATE_RUNNING }; +enum { CPU_BEHAVIOUR_STATE_NONE, CPU_BEHAVIOUR_STATE_START, CPU_BEHAVIOUR_STATE_RUNNING }; -extern s16 D_80163300[]; -extern u16 D_80163318[]; +extern s16 sPlayerAngle[]; extern u16 D_80163330[]; extern u16 D_80163344[]; extern u16 D_80163348[]; extern u16 D_8016334C[]; -extern u16 gSpeedKartAIBehaviour[]; +extern u16 gSpeedCPUBehaviour[]; -enum { - SPEED_KART_AI_BEHAVIOUR_NORMAL, - SPEED_KART_AI_BEHAVIOUR_FAST, - SPEED_KART_AI_BEHAVIOUR_SLOW, - SPEED_KART_AI_BEHAVIOUR_MAX -}; +enum { SPEED_CPU_BEHAVIOUR_NORMAL, SPEED_CPU_BEHAVIOUR_FAST, SPEED_CPU_BEHAVIOUR_SLOW, SPEED_CPU_BEHAVIOUR_MAX }; -extern s32 D_80163368[]; -extern s32 D_80163378; +extern s32 gIncrementUpdatePlayer; extern s32 D_8016337C; -extern s16 D_80163380[]; +extern s16 gCurrentPlayerLookAhead[]; extern s16 D_80163398[]; extern s16 D_801633B0[]; extern s16 D_801633C8[]; @@ -333,33 +356,29 @@ extern s16 D_80163410[]; extern f32 D_80163418[]; extern f32 D_80163428[]; extern f32 D_80163438[]; -extern s32 D_80163448; -extern f32 D_8016344C; -extern f32 D_80163450[]; -extern s16 D_80163478; +extern f32 gPreviousPlayerZ[]; +extern s16 gBestRankedHumanPlayer; // 0 or 1, only 1 when when in extra (mirror) mode -extern s16 D_8016347A; +extern s16 gIsInExtra; extern s16 D_8016347C; extern s16 D_8016347E; extern s32 D_80163480; extern s32 D_80163484; extern s32 D_80163488; extern s16 D_8016348C; -extern s16 D_80163490[]; -extern s16 D_801634A8[]; extern s16 D_801634C0[]; extern s16 bStopAICrossing[]; extern s16 D_801634EC; extern s32 D_801634F0; extern s32 D_801634F4; -extern Test D_801634F8[]; -extern Path2D* gVehicle2DWaypoint; -extern s32 gVehicle2DWaypointLength; +extern TrackPositionFactorInstruction gPlayerTrackPositionFactorInstruction[]; +extern Path2D* gVehicle2DPathPoint; +extern s32 gVehicle2DPathLength; extern u16 isCrossingTriggeredByIndex[]; extern u16 sCrossingActiveTimer[]; extern s32 D_80163DD8[]; extern struct unexpiredActors gUnexpiredActorsList[]; -extern D_801642D8_entry D_801642D8[]; +extern CpuItemStrategyData cpu_ItemStrategy[]; extern s16 D_80164358; extern s16 D_8016435A; extern s16 D_8016435C; @@ -367,18 +386,14 @@ extern s16 gGPCurrentRacePlayerIdByRank[]; // D_80164360 extern s16 D_80164378[]; extern s32 gLapCountByPlayerId[]; // D_80164390 extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8 -extern s32 D_801643E0[]; -extern s32 D_80164408[]; -extern u16 D_80164430; -extern u16 gNearestWaypointByPlayerId[]; -extern s32 D_80164450[]; -extern s16 D_80164478[]; +extern s32 gPreviousGPCurrentRaceRankByPlayerId[]; +extern s32 gGPCurrentRaceRankByPlayerIdDup[]; +extern s16 gGetPlayerByCharacterId[]; extern s32 D_8016448C; extern f32 D_80164498[]; extern f32 gLapCompletionPercentByPlayerId[]; // D_801644A8 extern f32 gCourseCompletionPercentByPlayerId[]; // D_801644D0 -extern s16 D_801644F8[]; -extern f32 D_80164510[]; +extern f32 gPlayerPathY[]; extern s16 D_80164538[]; extern s32 D_801645D0[]; extern s32 D_801645E8[]; @@ -403,11 +418,16 @@ extern UnkStruct_46D0 D_801646D0[]; // See bss_80005FD0.s extern f32 gCourseCompletionPercentByRank[NUM_PLAYERS]; -extern s32 D_801643E0[]; extern s32 D_8016448C; extern u16 D_801637BE; extern u16 D_80163E2A; +#define SEVERE_WRONG_DIRECTION_MIN 136 +#define SEVERE_WRONG_DIRECTION_MAX 225 +#define SEVERE_CORRECT_DIRECTION_MIN 45 +#define SEVERE_CORRECT_DIRECTION_MAX 316 +#define WRONG_DIRECTION_FRAMES_LIMIT 5 + // extern Gfx D_0D0076F8[]; #endif diff --git a/src/cpu_vehicles_camera_path/actor_utils.inc.c b/src/cpu_vehicles_camera_path/actor_utils.inc.c new file mode 100644 index 0000000000..0827885ac2 --- /dev/null +++ b/src/cpu_vehicles_camera_path/actor_utils.inc.c @@ -0,0 +1,112 @@ +s32 add_actor_in_unexpired_actor_list(s32 actorIndex, s16 arg1) { + s32 i; + s32 a2 = 0; + + for (i = 0; i < NUM_PLAYERS; i++) { + + if (gUnexpiredActorsList[i].unkC == 0) { + gUnexpiredActorsList[i].unkC = 1; + gUnexpiredActorsList[i].actorIndex = actorIndex; + gUnexpiredActorsList[i].unk10 = arg1; + gUnexpiredActorsList[i].unk14 = 0; + a2 = 1; + break; + } + } + if (a2 == 0) { + return -2; + } + return 0; +} + +s32 add_red_shell_in_unexpired_actor_list(s32 actorIndex) { + struct Actor* actor = &gActorList[actorIndex]; + if (actor->type != ACTOR_RED_SHELL) { + return -1; + } + return add_actor_in_unexpired_actor_list(actorIndex, 0); +} + +s32 add_green_shell_in_unexpired_actor_list(s32 actorIndex) { + struct Actor* actor = &gActorList[actorIndex]; + if (actor->type != ACTOR_GREEN_SHELL) { + return -1; + } + return add_actor_in_unexpired_actor_list(actorIndex, 1); +} + +s32 add_blue_shell_in_unexpired_actor_list(s32 arg0) { + struct Actor* actor = &gActorList[arg0]; + if (actor->type != ACTOR_BLUE_SPINY_SHELL) { + return -1; + } + return add_actor_in_unexpired_actor_list(arg0, 2); +} + +void delete_actor_in_unexpired_actor_list(s32 actorIndex) { + struct unexpiredActors* phi; + s32 i; + + for (i = 0; i < NUM_PLAYERS; i++) { + phi = &gUnexpiredActorsList[i]; + if (actorIndex == phi->actorIndex) { + phi->unkC = 0; + phi->actorIndex = 1000; // out of bounds + } + } +} + +void func_8000EEDC(void) { + struct unexpiredActors* phi; + s32 i; + + for (i = 0; i < NUM_PLAYERS; i++) { + phi = &gUnexpiredActorsList[i]; + phi->unkC = 0; + phi->actorIndex = 1000; // out of bounds + } +} + +void generate_player_smoke(void) { + s32 someIndex; + f32 var_f20; + struct Actor* temp_s1; + struct unexpiredActors* var_s0; + + for (someIndex = 0; someIndex < NUM_PLAYERS; someIndex++) { + var_s0 = &gUnexpiredActorsList[someIndex]; + if (var_s0->unkC == 1) { + temp_s1 = &gActorList[var_s0->actorIndex]; + var_s0->unk14++; + switch (var_s0->unk10) { + case 0: + if (var_s0->unk14 < 0xA) { + var_f20 = 0.3f; + } else { + var_f20 = 0.9f; + } + break; + case 1: + if (var_s0->unk14 < 0xA) { + var_f20 = 0.15f; + } else { + var_f20 = 0.45f; + } + break; + case 2: + if (var_s0->unk14 < 0xA) { + var_f20 = 0.15f; + } else { + var_f20 = 0.45f; + } + break; + default: + var_f20 = 1.0f; + break; + } + if (!(var_s0->unk14 & 1)) { + init_smoke_particle(temp_s1->pos, ((random_int(30) + 20) * var_f20) / 50.0f, var_s0->unk10); + } + } + } +} diff --git a/src/cpu_vehicles_camera_path/behaviour_utils.inc.c b/src/cpu_vehicles_camera_path/behaviour_utils.inc.c new file mode 100644 index 0000000000..728d0c8936 --- /dev/null +++ b/src/cpu_vehicles_camera_path/behaviour_utils.inc.c @@ -0,0 +1,170 @@ +void copy_courses_cpu_behaviour(void) { + s32 i; + for (i = 0; i < NUM_COURSES - 1; i++) { + gCoursesCPUBehaviour[i] = GET_COURSE_AIBehaviour; + } +} + +void reset_cpu_behaviour_none(s32 playerIndex) { + gCurrentCPUBehaviourId[playerIndex] = 0; + gPreviousCPUBehaviourId[playerIndex] = 0; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_NONE; +} + +void reset_cpu_behaviour(s32 playerIndex) { + gCurrentCPUBehaviourId[playerIndex] = 0; + gPreviousCPUBehaviourId[playerIndex] = 0; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; +} + +void cpu_behaviour_start(s32 playerId, Player* player) { + u16 playerPathPoint; + s16 pathPointStart; + s16 pathPointEnd; + s32 behaviourType; + UNUSED s32 test; + + sCurrentCPUBehaviour = &gCoursesCPUBehaviour[gCurrentCourseId][gCurrentCPUBehaviourId[playerId]]; + + playerPathPoint = gNearestPathPointByPlayerId[playerId]; + + pathPointStart = sCurrentCPUBehaviour->pathPointStart; + pathPointEnd = sCurrentCPUBehaviour->pathPointEnd; + behaviourType = sCurrentCPUBehaviour->type; + + if ((pathPointStart == -1) && (pathPointEnd == -1)) { + sCurrentCPUBehaviour = &gCoursesCPUBehaviour[gCurrentCourseId][0]; + reset_cpu_behaviour_none(playerId); + return; + } + if ((u32) playerPathPoint == (u32) pathPointStart) { + cpu_BehaviourState[playerId] = CPU_BEHAVIOUR_STATE_RUNNING; + gPreviousCPUBehaviourId[playerId] = gCurrentCPUBehaviourId[playerId]; + gCurrentCPUBehaviourId[playerId]++; + switch (behaviourType) { + case BEHAVIOUR_1: + func_80011EC0(playerId, player, player->unk_07C >> 0x10, playerPathPoint); + break; + case BEHAVIOUR_HOP: + kart_hop(player); + player->effects &= ~DRIFTING_EFFECT; + D_801630E8[playerId] = 0; + break; + case BEHAVIOUR_DRIVE_CENTER: + gPlayerTrackPositionFactorInstruction[playerId].target = 0.0f; + break; + case BEHAVIOUR_DRIVE_LEFT: + gPlayerTrackPositionFactorInstruction[playerId].target = -0.6f; + break; + case BEHAVIOUR_DRIVE_OUTER: + gPlayerTrackPositionFactorInstruction[playerId].target = 0.6f; + break; + case BEHAVIOUR_NORMAL_SPEED: + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_NORMAL; + break; + case BEHAVIOUR_FAST_SPEED: + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_FAST; + break; + case BEHAVIOUR_SLOW_SPEED: + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_SLOW; + break; + case BEHAVIOUR_MAX_SPEED: + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_MAX; + break; + case BEHAVIOUR_9: + D_801633F8[playerId] = 1; + D_801631E0[playerId] = false; + gPlayers[playerId].effects &= ~LOST_RACE_EFFECT; + break; + case BEHAVIOUR_10: + D_801633F8[playerId] = 0; + break; + } + } +} + +void cpu_behaviour_end(s32 playerIndex, Player* player) { + u16 nearestPathPoint; + u32 pathPointEnd; + s32 behaviourType; + + sCurrentCPUBehaviour = &gCoursesCPUBehaviour[gCurrentCourseId][gPreviousCPUBehaviourId[playerIndex]]; + nearestPathPoint = gNearestPathPointByPlayerId[playerIndex]; + behaviourType = sCurrentCPUBehaviour->type; + pathPointEnd = sCurrentCPUBehaviour->pathPointEnd; + if (nearestPathPoint >= pathPointEnd) { + switch (behaviourType) { + case BEHAVIOUR_1: + player->effects &= ~DRIFTING_EFFECT; + D_801630E8[playerIndex] = 0; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; + break; + case BEHAVIOUR_DRIVE_CENTER: + case BEHAVIOUR_DRIVE_LEFT: + case BEHAVIOUR_DRIVE_OUTER: + gPlayerTrackPositionFactorInstruction[playerIndex].target = + gPlayerTrackPositionFactorInstruction[playerIndex].unkC; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; + break; + case BEHAVIOUR_HOP: + case BEHAVIOUR_NORMAL_SPEED: + case BEHAVIOUR_FAST_SPEED: + case BEHAVIOUR_SLOW_SPEED: + case BEHAVIOUR_9: + case BEHAVIOUR_10: + case BEHAVIOUR_MAX_SPEED: + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; + break; + default: + break; + } + } +} + +void cpu_behaviour(s32 playerIndex) { + Player* player = gPlayerOne + playerIndex; + + switch (cpu_BehaviourState[playerIndex]) { + case CPU_BEHAVIOUR_STATE_NONE: + break; + case CPU_BEHAVIOUR_STATE_START: + cpu_behaviour_start(playerIndex, player); + break; + case CPU_BEHAVIOUR_STATE_RUNNING: + cpu_behaviour_end(playerIndex, player); + break; + } +} + +void func_80011EC0(s32 playerIndex, Player* player, s32 arg2, UNUSED u16 arg3) { + if ((((player->speed / 18.0f) * 216.0f) >= 45.0f) && (D_801630E8[playerIndex] == 0)) { + switch (gCurrentTrackSectionTypesPath[sSomeNearestPathPoint]) { + case RIGHT_LEANING_CURVE: + case RIGHT_CURVE: + if ((arg2 >= -9) && (D_80162FF8[playerIndex] == 0)) { + if ((gTrackPositionFactor[playerIndex] > -0.8) && (gTrackPositionFactor[playerIndex] < 0.5)) { + kart_hop(player); + player->effects |= DRIFTING_EFFECT; + D_801630E8[playerIndex] = 1; + break; + } + } + D_801630E8[playerIndex] = 2; + break; + case LEFT_LEANING_CURVE: + case LEFT_CURVE: + if ((arg2 < 0xA) && (D_80162FF8[playerIndex] == 0)) { + if ((gTrackPositionFactor[playerIndex] > -0.5) && (gTrackPositionFactor[playerIndex] < 0.8)) { + kart_hop(player); + player->effects |= DRIFTING_EFFECT; + D_801630E8[playerIndex] = -1; + break; + } + } + D_801630E8[playerIndex] = -2; + break; + } + } else { + D_801630E8[playerIndex] = 3; + } +} diff --git a/src/cpu_vehicles_camera_path/bomb_kart.inc.c b/src/cpu_vehicles_camera_path/bomb_kart.inc.c new file mode 100644 index 0000000000..74d150d462 --- /dev/null +++ b/src/cpu_vehicles_camera_path/bomb_kart.inc.c @@ -0,0 +1,324 @@ +void set_bomb_kart_spawn_positions(void) { + UNUSED Collision* var_s2; + f32 startingXPos; + f32 startingZPos; + f32 startingYPos; + s32 var_s3; + TrackPathPoint* temp_v0; + UNUSED BombKart* var_s0; + BombKartSpawn* bombKartSpawn; + + for (var_s3 = 0; var_s3 < NUM_BOMB_KARTS_VERSUS; var_s3++) { + bombKartSpawn = &gBombKartSpawns[gCurrentCourseId][var_s3]; + switch (gCurrentCourseId) { + case COURSE_YOSHI_VALLEY: + startingXPos = bombKartSpawn->startingXPos; + startingZPos = bombKartSpawn->startingZPos; + startingYPos = get_surface_height(startingXPos, 2000.0f, startingZPos); + break; + case COURSE_AWARD_CEREMONY: + temp_v0 = &gTrackPaths[3][bombKartSpawn->pathPointIndex]; + startingXPos = temp_v0->posX; + startingYPos = temp_v0->posY; + startingZPos = temp_v0->posZ; + break; + default: + temp_v0 = &gTrackPaths[0][bombKartSpawn->pathPointIndex]; + startingXPos = temp_v0->posX; + startingYPos = temp_v0->posY; + startingZPos = temp_v0->posZ; + break; + } + gBombKarts[var_s3].bombPos[0] = startingXPos; + gBombKarts[var_s3].bombPos[1] = startingYPos; + gBombKarts[var_s3].bombPos[2] = startingZPos; + gBombKarts[var_s3].wheel1Pos[0] = startingXPos; + gBombKarts[var_s3].wheel1Pos[1] = startingYPos; + gBombKarts[var_s3].wheel1Pos[2] = startingZPos; + gBombKarts[var_s3].wheel2Pos[0] = startingXPos; + gBombKarts[var_s3].wheel2Pos[1] = startingYPos; + gBombKarts[var_s3].wheel2Pos[2] = startingZPos; + gBombKarts[var_s3].wheel3Pos[0] = startingXPos; + gBombKarts[var_s3].wheel3Pos[1] = startingYPos; + gBombKarts[var_s3].wheel3Pos[2] = startingZPos; + gBombKarts[var_s3].wheel4Pos[0] = startingXPos; + gBombKarts[var_s3].wheel4Pos[1] = startingYPos; + gBombKarts[var_s3].wheel4Pos[2] = startingZPos; + gBombKarts[var_s3].pathPointIndex = bombKartSpawn->pathPointIndex; + gBombKarts[var_s3].unk_3C = bombKartSpawn->unk_04; + gBombKarts[var_s3].bounceTimer = 0; + gBombKarts[var_s3].circleTimer = 0; + gBombKarts[var_s3].state = bombKartSpawn->startingState; + gBombKarts[var_s3].unk_4A = 0; + gBombKarts[var_s3].unk_4C = 1; + gBombKarts[var_s3].yPos = startingYPos; + check_bounding_collision(&D_80164038[var_s3], 2.0f, startingXPos, startingYPos, startingZPos); + } +} + +void func_8000DF8C(s32 bombKartId) { + UNUSED s32 stackPadding0; + f32 sp118; + f32 var_f18; + TrackPathPoint* temp_v0_2; + f32 temp_f0_3; + f32 sp108; + UNUSED s32 stackPadding1; + UNUSED s32 stackPadding2; + UNUSED s32 stackPadding3; + f32 temp_f14; + UNUSED s32 stackPadding4; + f32 temp_f16; + UNUSED s32 stackPadding5; + UNUSED s32 stackPadding6; + UNUSED s32 stackPadding7; + UNUSED s32 stackPadding8; + UNUSED s32 stackPadding9; + UNUSED s32 stackPaddingA; + UNUSED s32 stackPaddingB; + f32 temp_f0; + f32 temp_f0_4; + u16 spCA; + f32 spC4; + u16 spC2; + f32 temp_f12; + f32 temp_f12_3; + f32 temp_f12_4; + f32 temp_f14_2; + f32 spAC; + UNUSED s32 stackPaddingC; + f32 temp_f16_2; + f32 spA0; + f32 temp_f2; + f32 temp_f2_4; + f32 sp94; + UNUSED s32 stackPaddingD; + f32 var_f20; + f32 sp88; + f32 var_f22; + f32 var_f24; + u16 sp7E; + u16 sp7C; + UNUSED u16 sp4C; + u16 temp_t6; + u16 temp_t7; + u16 var_s1; + s32 var_a0; + UNUSED s32 stackPaddingE; + TrackPathPoint* temp_v0_4; + BombKart* bombKart; + BombKart* bombKart2; + Collision* temp_a0_4; + Player* var_v0; + + bombKart = &gBombKarts[bombKartId]; + + sp7E = bombKart->state; + + if (sp7E == 0) { + return; + } + + if (((bombKart->unk_4A != 1) || (gCurrentCourseId == COURSE_AWARD_CEREMONY))) { + var_f22 = bombKart->bombPos[0]; + var_f20 = bombKart->bombPos[1]; + var_f24 = bombKart->bombPos[2]; + spCA = bombKart->pathPointIndex; + spC4 = bombKart->unk_3C; + spC2 = bombKart->someRot; + sp7C = bombKart->bounceTimer; + var_s1 = bombKart->circleTimer; + if ((sp7E != 0) && (sp7E != 4)) { + if (1) {} + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + if (D_8016347E == 1) { + var_v0 = gPlayerFour; + temp_f0 = var_f22 - var_v0->pos[0]; + temp_f2 = var_f20 - var_v0->pos[1]; + temp_f12 = var_f24 - var_v0->pos[2]; + if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) { + var_s1 = 0; + sp7E = 4; + var_v0->triggers |= VERTICAL_TUMBLE_TRIGGER; + var_v0->type &= ~PLAYER_START_SEQUENCE; + } + } + } else { + + for (var_a0 = 0; var_a0 < gPlayerCount; var_a0++) { + var_v0 = &gPlayers[var_a0]; + if (!(var_v0->effects & BOO_EFFECT)) { + temp_f0 = var_f22 - var_v0->pos[0]; + temp_f2 = var_f20 - var_v0->pos[1]; + temp_f12 = var_f24 - var_v0->pos[2]; + if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) { + sp7E = 4; + var_s1 = 0; + if (gCurrentCourseId == COURSE_FRAPPE_SNOWLAND) { + var_v0->triggers |= HIT_BY_STAR_TRIGGER; + } else { + var_v0->triggers |= VERTICAL_TUMBLE_TRIGGER; + } + } + } + } + } + } + switch (sp7E) { + case 1: + var_s1 = (var_s1 + 356) % 360; + temp_t6 = (var_s1 * 0xFFFF) / 360; + sp118 = coss(temp_t6) * 25.0; + temp_f0_3 = sins(temp_t6) * 25.0; + temp_v0_2 = &gTrackPaths[0][spCA]; + var_f22 = temp_v0_2->posX + sp118; + var_f20 = bombKart->yPos + 3.5f; + var_f24 = temp_v0_2->posZ + temp_f0_3; + D_80162FB0[0] = var_f22; + D_80162FB0[1] = var_f20; + D_80162FB0[2] = var_f24; + temp_t7 = (((var_s1 + 1) % 360) * 0xFFFF) / 360; + sp118 = coss(temp_t7) * 25.0; + temp_f0_3 = sins(temp_t7) * 25.0; + D_80162FC0[0] = temp_v0_2->posX + sp118; + D_80162FC0[1] = temp_v0_2->posY; + D_80162FC0[2] = temp_v0_2->posZ + temp_f0_3; + spC2 = (get_xz_angle_between_points(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; + break; + case 2: + var_s1 = (var_s1 + 4) % 360; + temp_t6 = (var_s1 * 0xFFFF) / 360; + sp118 = coss(temp_t6) * 25.0; + temp_f0_3 = sins(temp_t6) * 25.0; + temp_v0_2 = &gTrackPaths[0][spCA]; + var_f22 = temp_v0_2->posX + sp118; + var_f20 = bombKart->yPos + 3.5f; + var_f24 = temp_v0_2->posZ + temp_f0_3; + D_80162FB0[0] = var_f22; + D_80162FB0[1] = var_f20; + D_80162FB0[2] = var_f24; + temp_t7 = (((var_s1 + 1) % 360) * 0xFFFF) / 360; + sp118 = coss(temp_t7) * 25.0; + temp_f0_3 = sins(temp_t7) * 25.0; + D_80162FC0[0] = temp_v0_2->posX + sp118; + D_80162FC0[1] = temp_v0_2->posY; + D_80162FC0[2] = temp_v0_2->posZ + temp_f0_3; + spC2 = (get_xz_angle_between_points(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; + break; + case 3: + var_f20 = bombKart->yPos + 3.5f; + spC2 = 0; + break; + + case 5: + if ((D_8016347C == 0) || (gNearestPathPointByPlayerId[3] < 5)) { + break; + } else { + spCA = func_8000D2B4(var_f22, var_f20, var_f24, spCA, 3); + if ((spCA < 0) || (gPathCountByPathIndex[3] < spCA)) { + spCA = 0; + } + if (((s32) spCA) < 0x1A) { + temp_v0_2 = &gTrackPaths[3][(spCA + 1) % gPathCountByPathIndex[3]]; + D_80162FB0[0] = temp_v0_2->posX; + D_80162FB0[1] = temp_v0_2->posY; + D_80162FB0[2] = temp_v0_2->posZ; + temp_v0_4 = &gTrackPaths[3][(spCA + 2) % gPathCountByPathIndex[3]]; + D_80162FC0[0] = temp_v0_4->posX; + D_80162FC0[1] = temp_v0_4->posY; + D_80162FC0[2] = temp_v0_4->posZ; + spC2 = (get_xz_angle_between_points(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; + } else { + D_80162FB0[0] = var_f22; + D_80162FB0[1] = var_f20; + D_80162FB0[2] = var_f24; + D_80162FC0[0] = -2409.197f; + D_80162FC0[1] = 0.0f; + D_80162FC0[2] = -355.254f; + spC2 = (get_xz_angle_between_points(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; + } + temp_f14 = ((D_80162FB0[0] + D_80162FC0[0]) * 0.5f) - var_f22; + temp_f16 = ((D_80162FB0[2] + D_80162FC0[2]) * 0.5f) - var_f24; + temp_f0_4 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16)); + if (temp_f0_4 > 0.01f) { + var_f22 += (bombKart->unk_3C * temp_f14) / temp_f0_4; + var_f24 += (bombKart->unk_3C * temp_f16) / temp_f0_4; + } else { + var_f22 += temp_f14 / 5.0f; + var_f24 += temp_f16 / 5.0f; + } + temp_a0_4 = &D_80164038[bombKartId]; + var_f20 = calculate_surface_height(var_f22, 2000.0f, var_f24, temp_a0_4->meshIndexZX) + 3.5f; + if (var_f20 < (-1000.0)) { + var_f20 = bombKart->bombPos[1]; + } + check_bounding_collision(temp_a0_4, 10.0f, var_f22, var_f20, var_f24); + } + break; + case 4: + temp_v0_2 = &gTrackPaths[0][spCA]; + D_80162FB0[0] = temp_v0_2->posX; + D_80162FB0[1] = temp_v0_2->posY; + D_80162FB0[2] = temp_v0_2->posZ; + temp_v0_4 = &gTrackPaths[0][(spCA + 1) % gPathCountByPathIndex[0]]; + D_80162FC0[0] = temp_v0_4->posX; + D_80162FC0[1] = temp_v0_4->posY; + D_80162FC0[2] = temp_v0_4->posZ; + var_f20 += 3.0f - (var_s1 * 0.3f); + spC2 = (get_xz_angle_between_points(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520; + break; + default: + break; + } + + if (sp7E == 4) { + sp108 = 2.0f * var_s1; + sp118 = coss(0xFFFF - spC2) * var_s1; + var_f18 = sins(0xFFFF - spC2) * var_s1; + var_s1++; + temp_f2_4 = (var_f20 - 2.3f) + (sp108 / 3.0f); + spAC = temp_f2_4; + spA0 = temp_f2_4; + sp94 = temp_f2_4; + sp88 = temp_f2_4; + if (var_s1 >= 31) { + sp7E = 0; + } + } else { + sp118 = coss(0xFFFF - spC2) * 1.5f; + var_f18 = sins(0xFFFF - spC2) * 1.5f; + temp_f16_2 = var_f20 - 2.3f; + temp_f12_3 = (sp7C % 3) * 0.15f; + temp_f14_2 = temp_f16_2 - temp_f12_3; + temp_f12_4 = temp_f16_2 + temp_f12_3; + spAC = temp_f14_2; + sp94 = temp_f14_2; + spA0 = temp_f12_4; + sp88 = temp_f12_4; + var_f20 += sins((sp7C * 0x13FFEC) / 360); + sp7C = (sp7C + 1) % 18; + } + bombKart2 = bombKart; + bombKart2->wheel1Pos[0] = (sp118 - var_f18) + var_f22; + bombKart2->wheel1Pos[1] = spAC; + bombKart2->wheel1Pos[2] = (var_f18 + sp118) + var_f24; + bombKart2->wheel2Pos[0] = (var_f18 + sp118) + var_f22; + bombKart2->wheel2Pos[1] = spA0; + bombKart2->wheel2Pos[2] = (var_f18 - sp118) + var_f24; + bombKart2->wheel3Pos[0] = ((-sp118) - var_f18) + var_f22; + bombKart2->wheel3Pos[1] = sp94; + bombKart2->wheel3Pos[2] = ((-var_f18) + sp118) + var_f24; + bombKart2->wheel4Pos[0] = ((-sp118) + var_f18) + var_f22; + bombKart2->wheel4Pos[1] = sp88; + bombKart2->wheel4Pos[2] = ((-var_f18) - sp118) + var_f24; + bombKart2->bombPos[0] = var_f22; + bombKart2->bombPos[1] = var_f20; + bombKart2->bombPos[2] = var_f24; + bombKart2->pathPointIndex = spCA; + bombKart2->unk_3C = spC4; + bombKart2->someRot = spC2; + bombKart2->state = sp7E; + bombKart2->bounceTimer = sp7C; + bombKart2->circleTimer = var_s1; + } +} diff --git a/src/cpu_vehicles_camera_path/cpu_item_strategy.inc.c b/src/cpu_vehicles_camera_path/cpu_item_strategy.inc.c new file mode 100644 index 0000000000..1da40aa367 --- /dev/null +++ b/src/cpu_vehicles_camera_path/cpu_item_strategy.inc.c @@ -0,0 +1,59 @@ +#include +#include "cpu_vehicles_camera_path.h" +#include +#include + +void func_8001AB00(void) { + s32 var_v1; + + for (var_v1 = 0; var_v1 < NUM_PLAYERS; var_v1++) { + cpu_ItemStrategy[var_v1].branch = 0; + cpu_ItemStrategy[var_v1].timer = 0; + cpu_ItemStrategy[var_v1].actorIndex = -1; + cpu_ItemStrategy[var_v1].numItemUse = 0; + cpu_ItemStrategy[var_v1].numDroppedBananaBunch = 0; + } +} + +void cpu_decisions_branch_item(UNUSED s32 playerId, s16* branch, s32 itemId) { + s32 value = -1; + switch (itemId) { + case ITEM_FAKE_ITEM_BOX: + value = CPU_STRATEGY_ITEM_FAKE_ITEM_BOX; + break; + case ITEM_BOO: + value = CPU_STRATEGY_ITEM_BOO; + break; + case ITEM_BANANA: + value = CPU_STRATEGY_ITEM_BANANA; + break; + case ITEM_THUNDERBOLT: + value = CPU_STRATEGY_ITEM_THUNDERBOLT; + break; + case ITEM_STAR: + value = CPU_STRATEGY_ITEM_STAR; + break; + case ITEM_MUSHROOM: + value = CPU_STRATEGY_ITEM_MUSHROOM; + break; + case ITEM_DOUBLE_MUSHROOM: + break; + case ITEM_TRIPLE_MUSHROOM: + break; + case ITEM_SUPER_MUSHROOM: + break; + } + if (value >= 0) { + *branch = value; + } +} + +void func_8001ABE0(UNUSED s32 playerId, UNUSED CpuItemStrategyData* arg1) { +} + +void clear_expired_strategies(CpuItemStrategyData* arg0) { + if ((arg0->actorIndex < 0) || (arg0->actorIndex >= 0x64)) { + arg0->branch = 0; + arg0->timer = 0; + } +} diff --git a/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c b/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c new file mode 100644 index 0000000000..22a24c7b0f --- /dev/null +++ b/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c @@ -0,0 +1,230 @@ +void func_80007D04(s32 playerId, Player* player) { + s16 temp_t1; + s16 temp_t2; + s32 var_v0; + + temp_t1 = gNumPathPointsTraversed[gBestRankedHumanPlayer]; + temp_t2 = gNumPathPointsTraversed[playerId]; + + if (gGPCurrentRaceRankByPlayerId[playerId] < 2) { + s16 val1 = gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer]; + s16 val2 = temp_t2 - temp_t1; + + if (val2 > 400 && val1 >= 6) { + player->effects &= ~CPU_FAST_EFFECT; + player_accelerate_alternative(player); + D_801634C0[playerId] = 4; + return; + } + } else { + player->effects |= CPU_FAST_EFFECT; + player_accelerate_alternative(player); + D_801634C0[playerId] = 3; + return; + } + + switch (gCCSelection) { // WTF, FAKE ? + case CC_EXTRA: + break; + } + + switch (gCCSelection) { + case CC_50: + var_v0 = 0; + if (playerId == D_80163344[0]) { + var_v0 = 0x14; + } + break; + + case CC_100: + var_v0 = 8; + if (playerId == D_80163344[0]) { + var_v0 = 0x18; + } + break; + + case CC_150: + var_v0 = 0x12; + if (playerId == D_80163344[0]) { + var_v0 = 0x24; + } + break; + + case CC_EXTRA: + var_v0 = 8; + if (playerId == D_80163344[0]) { + var_v0 = 0x18; + } + break; + + default: + var_v0 = 0; + break; + } + + if (temp_t2 < temp_t1) { + player->effects |= CPU_FAST_EFFECT; + player_accelerate_alternative(player); + D_801634C0[playerId] = 1; + } else if (temp_t2 < (temp_t1 + var_v0 + 0x32)) { + player->effects &= ~CPU_FAST_EFFECT; + player_accelerate_alternative(player); + D_801634C0[playerId] = 3; + } else if (D_801631E0[playerId] == false) { + player->effects &= ~CPU_FAST_EFFECT; + player_accelerate_alternative(player); + D_801634C0[playerId] = 2; + } else { + player->effects &= ~CPU_FAST_EFFECT; + player_decelerate_alternative(player, 1.0f); + D_801634C0[playerId] = -1; + } +} + +void func_80007FA4(s32 playerId, Player* player, f32 arg2) { + f32 temp_f0; + f32 dist; + f32 temp_f2; + s32 test; + + temp_f0 = D_80163418[playerId] - player->pos[0]; + temp_f2 = D_80163438[playerId] - player->pos[2]; + dist = (temp_f0 * temp_f0) + (temp_f2 * temp_f2); + if (playerId == 3) { + if ((dist < 25.0f) && (D_80163410[playerId] < 5)) { + D_80163410[playerId] = 4; + (arg2 < ((2.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate_alternative(player, 1.0f); + } else if ((dist < 3600.0f) && (D_80163410[playerId] < 4)) { + D_80163410[playerId] = 3; + (arg2 < ((5.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate_alternative(player, 5.0f); + } else { + (arg2 < ((20.0 * 18.0) / 216.0)) ? func_80038BE4(player, 10) : player_decelerate_alternative(player, 1.0f); + } + } else { + if ((dist < 25.0f) && (D_80163410[playerId] < 5)) { + D_80163410[playerId] = 4; + test = 2; + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate_alternative(player, 1.0f); + } else if ((dist < 4900.0f) && (D_80163410[playerId] < 4)) { + D_80163410[playerId] = 3; + test = 5; + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate_alternative(player, 15.0f); + } else if ((dist < 22500.0f) && (D_80163410[playerId] < 3)) { + D_80163410[playerId] = 2; + test = 20; + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 5) : player_decelerate_alternative(player, 1.0f); + } else if ((dist < 90000.0f) && (D_80163410[playerId] < 2)) { + D_80163410[playerId] = 1; + test = 30; + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 6) : player_decelerate_alternative(player, 1.0f); + } else if (D_80163410[playerId] == 0) { + test = 35; + (arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) + : player_decelerate_alternative(player, 1.0f); + } else { + player_decelerate_alternative(player, 1.0f); + } + } +} + +void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) { + f32 speed; + f32 var_f0; + UNUSED s32 thing; + s32 var_a1; + + speed = player->speed; + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT) && + !(player->effects & LIGHTNING_STRIKE_EFFECT) && !(player->triggers & VERTICAL_TUMBLE_TRIGGER) && + !(player->triggers & HIT_BY_STAR_TRIGGER) && !(player->triggers & HIGH_TUMBLE_TRIGGER) && + !(player->triggers & LOW_TUMBLE_TRIGGER)) { + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + func_80007FA4(playerId, player, speed); + } else if ((bStopAICrossing[playerId] == true) && !(player->effects & (STAR_EFFECT | BOO_EFFECT))) { + player_decelerate_alternative(player, 10.0f); + if (player->currentSpeed == 0.0) { + player->velocity[0] = 0.0f; + player->velocity[2] = 0.0f; + } + } else { + var_f0 = 3.3333333f; + switch (gCCSelection) { /* irregular */ + case CC_100: + case CC_EXTRA: + break; + case CC_50: + var_f0 = 2.5f; + break; + case CC_150: + var_f0 = 3.75f; + break; + } + if (speed < var_f0) { + player->effects &= ~CPU_FAST_EFFECT; + player_accelerate_alternative(player); + } else if (player->type & PLAYER_CINEMATIC_MODE) { + if (speed < targetSpeed) { + player->effects &= ~CPU_FAST_EFFECT; + player_accelerate_alternative(player); + } else { + player->effects &= ~CPU_FAST_EFFECT; + player_decelerate_alternative(player, 1.0f); + } + } else if ((D_801631E0[playerId] == true) && (D_80163330[playerId] != 1)) { + if (func_800088D8(playerId, gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerIdDup[playerId]) == + 1) { + player->effects |= CPU_FAST_EFFECT; + player_accelerate_alternative(player); + } else { + player->effects &= ~CPU_FAST_EFFECT; + player_decelerate_alternative(player, 1.0f); + } + } else { + var_a1 = 1; + switch (gSpeedCPUBehaviour[playerId]) { /* switch 1; irregular */ + case SPEED_CPU_BEHAVIOUR_FAST: /* switch 1 */ + player->effects &= ~CPU_FAST_EFFECT; + player_accelerate_alternative(player); + break; + case SPEED_CPU_BEHAVIOUR_MAX: /* switch 1 */ + player->effects |= CPU_FAST_EFFECT; + player_accelerate_alternative(player); + break; + case SPEED_CPU_BEHAVIOUR_SLOW: /* switch 1 */ + if (((speed / 18.0f) * 216.0f) > 20.0f) { + targetSpeed = 1.6666666f; + } + var_a1 = 0; + break; + case SPEED_CPU_BEHAVIOUR_NORMAL: /* switch 1 */ + default: /* switch 1 */ + var_a1 = 0; + break; + } + if (var_a1 != 1) { + if (speed < targetSpeed) { + if ((gDemoMode == 1) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { + player_accelerate_alternative(player); + } else if (D_80163330[playerId] == 1) { + func_80007D04(playerId, player); + } else if (func_800088D8(playerId, gLapCountByPlayerId[playerId], + gGPCurrentRaceRankByPlayerIdDup[playerId]) == true) { + player->effects |= CPU_FAST_EFFECT; + player_accelerate_alternative(player); + } else { + player->effects &= ~CPU_FAST_EFFECT; + player_decelerate_alternative(player, 1.0f); + } + } else { + player->effects &= ~CPU_FAST_EFFECT; + if (targetSpeed > 1.0f) { + player_decelerate_alternative(player, 2.0f); + } else { + player_decelerate_alternative(player, 5.0f); + } + } + } + } + } + } +} diff --git a/src/cpu_vehicles_camera_path/path_calc.inc.c b/src/cpu_vehicles_camera_path/path_calc.inc.c new file mode 100644 index 0000000000..fab0c3a6e2 --- /dev/null +++ b/src/cpu_vehicles_camera_path/path_calc.inc.c @@ -0,0 +1,534 @@ +// @arg index from 0 to 3. + +// Processes course path by index. +// @arg index from 0 to 3. +// Each course can have 1-4 course paths. +void load_track_path(s32 pathIndex) { + + TrackPathPoint* ptr; + TrackPathPoint* pathDest; + TrackPathPoint* path; + s32 var_v0; + s32 sp24; + UNUSED s32 pad[2]; + s16 bInvalidPath; + s32 i; + + // cast required + if ((s32) GET_COURSE_AIMaximumSeparation >= 0) { + pathDest = gTrackPaths[pathIndex]; + bInvalidPath = 1; + if (gCurrentCourseId != COURSE_AWARD_CEREMONY) { + var_v0 = process_path_data(pathDest, GET_COURSE_PathTable2(pathIndex)); + gPathCountByPathIndex[pathIndex] = (u16) var_v0; + } else { + // Course path included in course_data which has already been loaded into memory. + // This is how we get the addr to our path data. + path = GET_COURSE_PathTable(pathIndex); + ptr = path; + + for (i = 0; i < 3000; i++, ptr++) { + if ((u16) ptr->posX == 0x8000) { + sp24 = i - 1; + bInvalidPath = 0; + break; + } + } + + // If path data higher than 3000 something has gone wrong. + // Skip processing the data. + //! @todo Confirm this comment + if (!bInvalidPath) { + var_v0 = func_80011014(pathDest, path, sp24, pathIndex); + gPathCountByPathIndex[pathIndex] = (u16) var_v0; + } + } + } +} + +void calculate_track_boundaries(s32 pathIndex) { + f32 pathPointWidth; + f32 x1; + f32 y1; + f32 z1; + f32 x2; + f32 y2; + f32 z2; + f32 x_dist; + f32 z_dist; + f32 neg_x_dist; + f32 neg_z_dist; + f32 xz_dist; + s32 temp_f16; + s32 pathPointIndex; + TrackPathPoint* pathPoint; + TrackPathPoint* nextPathPoint; + TrackPathPoint* var_s1; + TrackPathPoint* var_s2; + + if (((s32) GET_COURSE_AIMaximumSeparation) >= 0) { + pathPointWidth = GET_COURSE_AIMaximumSeparation; + pathPoint = &gTrackPaths[pathIndex][0]; + var_s1 = &gTrackLeftPaths[pathIndex][0]; + var_s2 = &gTrackRightPaths[pathIndex][0]; + for (pathPointIndex = 0; pathPointIndex < gPathCountByPathIndex[pathIndex]; + pathPointIndex++, var_s1++, var_s2++) { + x1 = pathPoint->posX; + y1 = pathPoint->posY; + z1 = pathPoint->posZ; + pathPoint++; + nextPathPoint = &gTrackPaths[pathIndex][(pathPointIndex + 1) % ((s32) gPathCountByPathIndex[pathIndex])]; + x2 = nextPathPoint->posX; + y2 = nextPathPoint->posY; + z2 = nextPathPoint->posZ; + x_dist = x2 - x1; + z_dist = z2 - z1; + neg_x_dist = x1 - x2; + neg_z_dist = z1 - z2; + xz_dist = sqrtf((x_dist * x_dist) + (z_dist * z_dist)); + temp_f16 = (f32) ((y1 + y2) * 0.5); + + // Calculate left boundary position + // Uses perpendicular vector (Z, -X) normalized by segment length + var_s1->posX = ((pathPointWidth * z_dist) / xz_dist) + x1; + var_s1->posY = temp_f16; + var_s1->posZ = ((pathPointWidth * neg_x_dist) / xz_dist) + z1; + + // Calculate right boundary position + // Uses opposite perpendicular vector (-Z, X) + var_s2->posX = ((pathPointWidth * neg_z_dist) / xz_dist) + x1; + var_s2->posY = temp_f16; + var_s2->posZ = ((pathPointWidth * x_dist) / xz_dist) + z1; + } + } +} + +/** + * Calculates the track curvature using two sets of three path. + * Returns a normalized value indicating curve direction and severity: + * - Positive: Right turn + * - Negative: Left turn + * - Near zero: Straight section + * + * @param pathIndex Track path index + * @param pathPointIndex Starting pathPoint for calculation + * @return Normalized curvature value (-1 to 1) + */ +f32 calculate_track_curvature(s32 pathIndex, u16 pathPointIndex) { + f32 secondVectorX; + f32 secondVectorZ; + UNUSED f32 pad; + TrackPathPoint* pathPathPoints; + f32 x1; + f32 z1; + f32 x2; + f32 z2; + f32 x3; + f32 z3; + f32 firstVectorX; + f32 firstVectorZ; + s32 pathPointCount; + TrackPathPoint* pathPoint3; + TrackPathPoint* pathPoint2; + TrackPathPoint* pathPoint1; + f32 secondLength; + f32 firstLength; + + if ((s32) GET_COURSE_AIMaximumSeparation < 0) { + return 0.0f; + } + pathPointCount = gPathCountByPathIndex[pathIndex]; + pathPathPoints = gTrackPaths[pathIndex]; + + pathPoint1 = &pathPathPoints[pathPointIndex]; + pathPoint2 = &pathPathPoints[(pathPointIndex + 1) % pathPointCount]; + pathPoint3 = &pathPathPoints[(pathPointIndex + 2) % pathPointCount]; + + x1 = pathPoint1->posX; + z1 = pathPoint1->posZ; + x2 = pathPoint2->posX; + z2 = pathPoint2->posZ; + x3 = pathPoint3->posX; + z3 = pathPoint3->posZ; + + firstVectorX = (((x2 + x3) * 0.5) - x1); + firstVectorZ = (((z2 + z3) * 0.5) - z1); + + pathPoint1 = &pathPathPoints[(pathPointIndex + 3) % pathPointCount]; + pathPoint2 = &pathPathPoints[(pathPointIndex + 4) % pathPointCount]; + pathPoint3 = &pathPathPoints[(pathPointIndex + 5) % pathPointCount]; + + x1 = pathPoint1->posX; + z1 = pathPoint1->posZ; + x2 = pathPoint2->posX; + z2 = pathPoint2->posZ; + x3 = pathPoint3->posX; + z3 = pathPoint3->posZ; + + secondVectorX = (((x2 + x3) * 0.5) - x1); + secondVectorZ = (((z2 + z3) * 0.5) - z1); + + firstLength = sqrtf((firstVectorZ * firstVectorZ) + (firstVectorX * firstVectorX)); + secondLength = sqrtf((secondVectorX * secondVectorX) + (secondVectorZ * secondVectorZ)); + return -((firstVectorZ * secondVectorX) - (firstVectorX * secondVectorZ)) / (secondLength * firstLength); +} + +void analize_track_section(s32 pathIndex) { + f64 sectionCurvature; + UNUSED s32 pad; + s32 k; + s32 i; + s32 j; + s16* currentSection; + s32 pathPointCount; + s16* nextSection; + + if ((s32) GET_COURSE_AIMaximumSeparation >= 0) { + pathPointCount = gPathCountByPathIndex[pathIndex]; + currentSection = gTrackSectionTypes[pathIndex]; + for (i = 0; i < pathPointCount; i++, currentSection++) { + sectionCurvature = calculate_track_curvature(pathIndex, i); + *currentSection = STRAIGHT; + if (sectionCurvature > 0.1) { + *currentSection = RIGHT_CURVE; + } + if (sectionCurvature < -0.1) { + *currentSection = LEFT_CURVE; + } + } + currentSection = gTrackSectionTypes[pathIndex]; + for (i = 0; i < pathPointCount; i++, currentSection++) { + if (*currentSection == STRAIGHT) { + // Look ahead for next curved section + for (j = 1; j < pathPointCount; j++) { + nextSection = &gTrackSectionTypes[pathIndex][(i + j) % pathPointCount]; + switch (*nextSection) { + case RIGHT_LEANING_CURVE: + case RIGHT_CURVE: + for (k = 0; k < j; k++) { + gTrackSectionTypes[pathIndex][(i + k) % pathPointCount] = RIGHT_LEANING_CURVE; + } + i += j; + currentSection += j; + j = pathPointCount; + break; + case LEFT_LEANING_CURVE: + case LEFT_CURVE: + for (k = 0; k < j; k++) { + gTrackSectionTypes[pathIndex][(i + k) % pathPointCount] = LEFT_LEANING_CURVE; + } + i += j; + currentSection += j; + j = pathPointCount; + break; + } + } + } + } + } +} + +// Seemingly calculates the atan2 angle between a pathPoint and its forward neighbor +s16 calculate_angle_path(s32 pathIndex, s32 pathPointIndex) { + s16 ret; + Vec3f sp30; + Vec3f sp24; + TrackPathPoint* temp_v0; + + temp_v0 = &gTrackPaths[pathIndex][pathPointIndex]; + sp30[0] = temp_v0->posX; + sp30[1] = temp_v0->posY; + sp30[2] = temp_v0->posZ; + temp_v0 = &gTrackPaths[pathIndex][(pathPointIndex + 1) % gPathCountByPathIndex[pathIndex]]; + sp24[0] = temp_v0->posX; + sp24[1] = temp_v0->posY; + sp24[2] = temp_v0->posZ; + ret = get_xz_angle_between_points(sp30, sp24); + return -ret; +} + +// Populates gPathExpectedRotation +void analyse_angle_path(s32 pathIndex) { + s32 pathPointIndex; + u16* angle; + + if ((s32) GET_COURSE_AIMaximumSeparation >= 0) { + for (angle = (u16*) &gPathExpectedRotation[pathIndex][0], pathPointIndex = 0; + pathPointIndex < gPathCountByPathIndex[pathIndex]; pathPointIndex++, angle++) { + *angle = calculate_angle_path(pathIndex, pathPointIndex); + } + } +} + +void analisze_curved_path(s32 pathIndex) { + s16* trackCurveCount; + s16 curveCount; + s16 temp_t0; + s32 pathPointCount; + s16* trackSectionType; + s32 i, j; + + pathPointCount = gPathCountByPathIndex[pathIndex]; + trackSectionType = gTrackSectionTypes[pathIndex]; + trackCurveCount = gTrackConsecutiveCurveCounts[pathIndex]; + + for (i = 0; i < pathPointCount; i++) { + curveCount = 0; + for (j = 0; j < pathPointCount; j++) { + temp_t0 = trackSectionType[(i + j) % pathPointCount]; + if ((temp_t0 == LEFT_LEANING_CURVE) || (temp_t0 == RIGHT_LEANING_CURVE)) { + curveCount += 1; + } else { + break; + } + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + break; + } + } + *trackCurveCount = curveCount; + trackCurveCount++; + } +} + +f32 func_80010F40(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) { + arg1 = get_surface_height(arg0, 2000.0f, arg2); + check_bounding_collision(&D_80162E70, 1.0f, arg0, arg1, arg2); + return arg1; +} + +f32 func_80010FA0(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) { + arg1 = get_surface_height(arg0, (f32) ((f64) arg1 + 30.0), arg2); + check_bounding_collision(&D_80162E70, 10.0f, arg0, arg1, arg2); + return arg1; +} + +/** + * @return's the number of items processed. + */ +s32 func_80011014(TrackPathPoint* pathDest, TrackPathPoint* path, s32 numPathPoints, UNUSED s32 pathIndex) { + f32 temp_f24_2; + f32 temp_f2_3; + f32 var_f20_2; + f32 x1; + f32 z1; + f32 x2; + f32 z2; + f32 x3; + f32 z3; + f32 x1_2; + f32 z1_3; + f32 temp_f20; + f32 var_f30; + f32 temp_f22; + f32 temp_f16; + s32 i; + + f32 j; + s32 var_s0; + f32 var_f28; + + TrackPathPoint* point1; + TrackPathPoint* point2; + TrackPathPoint* point3; + f32 temp; + UNUSED TrackPathPoint* dest; + var_f30 = 0.0f; + var_s0 = 0; + temp_f20 = (f32) path[0].posX; + temp_f22 = (f32) path[0].posZ; + var_f28 = func_80010F40(temp_f20, 2000.0f, temp_f22, gCurrentCourseId, 0); + + for (i = 0; i < numPathPoints; i++) { + point1 = &path[i % numPathPoints]; + point2 = &path[(i + 1) % numPathPoints]; + point3 = &path[(s32) (i + 2) % numPathPoints]; + x1 = (f32) point1->posX; + z1 = (f32) point1->posZ; + x2 = (f32) point2->posX; + z2 = (f32) point2->posZ; + x3 = (f32) point3->posX; + z3 = (f32) point3->posZ; + + temp = 0.05 / (sqrtf(((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1))) + + (sqrtf(((x3 - x2) * (x3 - x2)) + ((z3 - z2) * (z3 - z2))))); + + for (j = 0.0f; j <= 1.0; j += temp) { + + temp_f2_3 = (f32) ((1.0 - j) * 0.5 * (1.0 - j)); + z1_3 = (f32) (((1.0 - j) * j) + 0.5); + temp_f16 = (f32) (j * 0.5 * j); + + temp_f24_2 = (temp_f2_3 * x1) + (z1_3 * x2) + (temp_f16 * x3); + x1_2 = (temp_f2_3 * z1) + (z1_3 * z2) + (temp_f16 * z3); + + var_f30 += + sqrtf(((temp_f24_2 - temp_f20) * (temp_f24_2 - temp_f20)) + ((x1_2 - temp_f22) * (x1_2 - temp_f22))); + + temp_f20 = temp_f24_2; + temp_f22 = x1_2; + + if ((var_f30 > 20.0f) || ((i == 0) && (j == 0.0))) { + if (gIsMirrorMode) { + // temp_f12 = -temp_f24_2; + pathDest->posX = (s16) -temp_f24_2; + var_f20_2 = func_80010FA0(-temp_f24_2, var_f28, x1_2, gCurrentCourseId, var_s0); + } else { + pathDest->posX = (s16) temp_f24_2; + var_f20_2 = func_80010FA0(temp_f24_2, var_f28, x1_2, gCurrentCourseId, var_s0); + } + + pathDest->posZ = (s16) temp_f22; + pathDest->trackSectionId = get_track_section_id(D_80162E70.meshIndexZX); + + if (var_f20_2 < -500.0) { + var_f20_2 = var_f28; + } else { + + switch (gCurrentCourseId) { + case COURSE_RAINBOW_ROAD: + if (var_f20_2 < (var_f28 - 15.0)) { + var_f20_2 = (f32) var_f28 - 15.0; + } + break; + case COURSE_WARIO_STADIUM: + if ((var_s0 >= 1140) && (var_s0 <= 1152)) { + var_f20_2 = var_f28; + } else { + if (var_f20_2 < (var_f28 - 10.0)) { + var_f20_2 = (f32) (var_f28 - 4.0); + } + } + break; + case COURSE_DK_JUNGLE: + if ((var_s0 > 204) && (var_s0 < 220)) { + var_f20_2 = var_f28; + } else { + if (var_f20_2 < (var_f28 - 10.0)) { + var_f20_2 = (f32) (var_f28 - 4.0); + } + } + break; + default: + if (var_f20_2 < (var_f28 - 10.0)) { + var_f20_2 = (f32) var_f28 - 10.0; + } + break; + } + } + var_f28 = var_f20_2; + pathDest->posY = (s16) (s32) var_f20_2; + var_f30 = 0.0f; + pathDest++; + var_s0 += 1; + } + } + } + return var_s0; +} + +// Returns number of path processed. +s32 process_path_data(TrackPathPoint* dest, TrackPathPoint* src) { + s16 temp_a0; + s16 temp_a2; + s16 temp_a3; + s32 var_v0; + s32 var_v1; + u16 temp_t0; + + var_v1 = 0; + for (var_v0 = 0; var_v0 < 0x7D0; var_v0++) { + temp_a0 = src->posX; + temp_a2 = src->posY; + temp_a3 = src->posZ; + temp_t0 = src->trackSectionId; + src++; + if (((temp_a0 & 0xFFFF) == 0x8000) && ((temp_a2 & 0xFFFF) == 0x8000) && ((temp_a3 & 0xFFFF) == 0x8000)) { + break; + } + if (gIsMirrorMode != 0) { + dest->posX = -temp_a0; + } else { + dest->posX = temp_a0; + } + var_v1++; + dest->posY = temp_a2; + dest->posZ = temp_a3; + dest->trackSectionId = temp_t0; + dest++; + } + return var_v1; +} + +s32 generate_2d_path(Path2D* pathDest, TrackPathPoint* pathSrc, s32 numPathPoints) { + f32 temp_f14_3; + f32 temp_f16_2; + UNUSED s32 pad; + + f32 x1; + f32 z1; + f32 x2; + f32 z2; + f32 x3; + f32 z3; + + UNUSED s32 pad2; + f32 temp_f24; + + f32 spA8; + f32 temp_f26; + f32 spA0; + + f32 temp_f2_3; + + TrackPathPoint* point1; + f32 j; + TrackPathPoint* point2; + TrackPathPoint* point3; + s32 i; + f32 temp_f6 = 0.0f; + s32 nbElement; + f32 sp7C; + + spA8 = pathSrc[0].posX; + spA0 = pathSrc[0].posZ; + nbElement = 0; + + for (i = 0; i < numPathPoints; i++) { + point1 = &pathSrc[((i % numPathPoints))]; + point2 = &pathSrc[(((i + 1) % numPathPoints))]; + point3 = &pathSrc[(((i + 2) % numPathPoints))]; + x1 = point1->posX; + z1 = point1->posZ; + x2 = point2->posX; + z2 = point2->posZ; + x3 = point3->posX; + z3 = point3->posZ; + + sp7C = 0.05 / (sqrtf(((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1))) + + sqrtf(((x3 - x2) * (x3 - x2)) + ((z3 - z2) * (z3 - z2)))); + + for (j = 0.0f; j <= 1.0; j += sp7C) { + temp_f2_3 = (1.0 - j) * 0.5 * (1.0 - j); + temp_f14_3 = ((1.0 - j) * j) + 0.5; + temp_f16_2 = j * 0.5 * j; + + temp_f24 = (temp_f2_3 * x1) + (temp_f14_3 * x2) + (temp_f16_2 * x3); + temp_f26 = (temp_f2_3 * z1) + (temp_f14_3 * z2) + (temp_f16_2 * z3); + temp_f6 += sqrtf(((temp_f24 - spA8) * (temp_f24 - spA8)) + ((temp_f26 - spA0) * (temp_f26 - spA0))); + spA8 = temp_f24; + spA0 = temp_f26; + if ((temp_f6 > 20.0f) || ((i == 0) && (j == 0.0))) { + if (gIsMirrorMode) { + pathDest->x = (s16) -spA8; + } else { + pathDest->x = (s16) spA8; + } + pathDest->z = spA0; + nbElement += 1; + pathDest++; + temp_f6 = 0.0f; + } + } + } + return nbElement; +} diff --git a/src/cpu_vehicles_camera_path/path_utils.inc.c b/src/cpu_vehicles_camera_path/path_utils.inc.c new file mode 100644 index 0000000000..8ca802bc1a --- /dev/null +++ b/src/cpu_vehicles_camera_path/path_utils.inc.c @@ -0,0 +1,849 @@ +#include +#include +#include +#include +#include +#include "main.h" +#include "cpu_vehicles_camera_path.h" + +bool are_in_curve(UNUSED s32 arg0, u16 pathPointIndex) { + s16 thing = gCurrentTrackConsecutiveCurveCountsPath[pathPointIndex]; + if (thing > 0) { + return true; + } + return false; +} + +bool is_far_from_path(s32 playerIndex) { + f32 value = gTrackPositionFactor[playerIndex]; + if ((1.1f <= value) || (value <= -1.1f)) { + return true; + } + return false; +} + +/** + * Calculates a factor representing where the player is positioned between left and right track boundaries + * Returns a value between -1.0 and 1.0: + * -1.0 = On the left boundary + * 0.0 = In the middle of the track + * 1.0 = On the right boundary + * + * @param posX Player's X position + * @param posZ Player's Z position + * @param pathPointIndex Current pathPoint index + * @param pathIndex Current path/track index + * @return Position factor between track boundaries + */ +f32 calculate_track_position_factor(f32 posX, f32 posZ, u16 pathPointIndex, s32 pathIndex) { + f32 leftX; + f32 leftZ; + f32 rightX; + f32 rightZ; + f32 boundarySquaredDistance; + f32 positionFactor; + TrackPathPoint* leftPathPoint; + TrackPathPoint* rightPathPoint; + + leftPathPoint = &gTrackLeftPaths[pathIndex][pathPointIndex]; + rightPathPoint = &gTrackRightPaths[pathIndex][pathPointIndex]; + + leftX = leftPathPoint->posX; + leftZ = leftPathPoint->posZ; + rightX = rightPathPoint->posX; + rightZ = rightPathPoint->posZ; + + boundarySquaredDistance = ((rightX - leftX) * (rightX - leftX)) + ((rightZ - leftZ) * (rightZ - leftZ)); + + // Avoid division by zero for very close or identical boundary points + if (boundarySquaredDistance < 0.01f) { + return 0.0f; + } + // Calculate normalized position factor using vector projection + // Formula: 2 * (dot product of vectors) / (squared magnitude) - 1 + // This maps the position to a -1 to 1 range + positionFactor = + ((2.0f * ((rightX - leftX) * (posX - leftX) + (rightZ - leftZ) * (posZ - leftZ))) / boundarySquaredDistance) - + 1.0f; + return positionFactor; +} + +void update_player_position_factor(s32 playerId, u16 pathPointIndex, s32 pathIndex) { + UNUSED Vec3f pad; + gTrackPositionFactor[playerId] = 0.0f; + if ((s32) GET_COURSE_AIMaximumSeparation >= 0) { + if ((gPlayers[playerId].type & PLAYER_EXISTS) != 0) { + gTrackPositionFactor[playerId] = calculate_track_position_factor( + gPlayers[playerId].pos[0], gPlayers[playerId].pos[2], pathPointIndex, pathIndex); + } + } +} + +void calculate_track_offset_position(u16 pathPointIndex, f32 lerpFactor, f32 offsetDistance, s16 pathIndex) { + UNUSED s32 pad[4]; + f32 pathPointOneX; + f32 pathPointOneZ; + f32 pathPointTwoX; + f32 pathPointTwoZ; + UNUSED s32 pad2; + f32 xdiff; + f32 zdiff; + f32 segmentLength; + UNUSED f32 temp_f12; + UNUSED f32 temp_f2_2; + UNUSED TrackPathPoint* path; + TrackPathPoint* pathPointTwo; + TrackPathPoint* pathPointOne; + + pathPointOne = &gTrackPaths[pathIndex][pathPointIndex]; + pathPointOneX = pathPointOne->posX; + pathPointOneZ = pathPointOne->posZ; + pathPointTwo = &gTrackPaths[pathIndex][(pathPointIndex + 1) % gSelectedPathCount]; + pathPointTwoX = pathPointTwo->posX; + pathPointTwoZ = pathPointTwo->posZ; + + // Calculate vector between path point + zdiff = pathPointTwoZ - pathPointOneZ; + xdiff = pathPointTwoX - pathPointOneX; + if (xdiff && xdiff) {} + + segmentLength = sqrtf((xdiff * xdiff) + (zdiff * zdiff)); + if (segmentLength < 0.01f) { + gOffsetPosition[0] = pathPointTwoX; + gOffsetPosition[2] = pathPointTwoZ; + } else { + gOffsetPosition[0] = + ((0.5f - (lerpFactor * 0.5f)) * (((offsetDistance * zdiff) / segmentLength) + pathPointOneX)) + + ((1.0f - (0.5f - (lerpFactor * 0.5f))) * (((offsetDistance * -zdiff) / segmentLength) + pathPointOneX)); + gOffsetPosition[2] = + ((0.5f - (lerpFactor * 0.5f)) * (((offsetDistance * -xdiff) / segmentLength) + pathPointOneZ)) + + ((1.0f - (0.5f - (lerpFactor * 0.5f))) * (((offsetDistance * xdiff) / segmentLength) + pathPointOneZ)); + } +} + +/** + * Calculates an interpolated position between left and right track paths. + * + * @param currentPathPoint Index of the current pathPoint + * @param trackOffset Value between 0.0 and 1.0 determining position between left (0.0) and right (1.0) path + * @param pathIndex Index of the track/path segment + */ +void set_track_offset_position(u16 pathPointIndex, f32 trackOffset, s16 pathIndex) { + TrackPathPoint* path1; + TrackPathPoint* path2; + f32 x1; + f32 z1; + f32 x3; + f32 z3; + f32 x2; + f32 z2; + f32 x4; + f32 z4; + f32 temp_f0; + f32 temp_f12; + + path1 = &gTrackLeftPaths[pathIndex][pathPointIndex]; + path2 = &gTrackRightPaths[pathIndex][pathPointIndex]; + + x1 = (f32) path1->posX; + z1 = (f32) path1->posZ; + + x2 = (f32) path2->posX; + z2 = (f32) path2->posZ; + + pathPointIndex += 1; + pathPointIndex = pathPointIndex % gPathCountByPathIndex[pathIndex]; + + path1 = &gTrackLeftPaths[pathIndex][pathPointIndex]; + path2 = &gTrackRightPaths[pathIndex][pathPointIndex]; + + x3 = (f32) path1->posX; + z3 = (f32) path1->posZ; + + x4 = (f32) path2->posX; + z4 = (f32) path2->posZ; + + temp_f0 = 0.5f - (trackOffset / 2.0f); + temp_f12 = 1.0f - temp_f0; + gOffsetPosition[0] = ((temp_f0 * (x1 + x3)) / 2.0f) + ((temp_f12 * (x2 + x4)) / 2.0f); + gOffsetPosition[2] = ((temp_f0 * (z1 + z3)) / 2.0f) + ((temp_f12 * (z2 + z4)) / 2.0f); +} + +s16 func_8000BD94(f32 posX, f32 posY, f32 posZ, s32 pathIndex) { + f32 x_dist; + f32 y_dist; + f32 z_dist; + f32 considerSquaredDistance; + f32 minimumSquaredDistance; + s32 considerPathPointIndex; + s32 pathPathPointCount; + s16 nearestPathPointIndex; + TrackPathPoint* pathPathPoints; + TrackPathPoint* considerPathPoint; + + pathPathPoints = gTrackPaths[pathIndex]; + pathPathPointCount = gPathCountByPathIndex[pathIndex]; + considerPathPoint = &pathPathPoints[0]; + x_dist = (f32) considerPathPoint->posX - posX; + y_dist = (f32) considerPathPoint->posY - posY; + z_dist = (f32) considerPathPoint->posZ - posZ; + minimumSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + nearestPathPointIndex = 0; + for (considerPathPointIndex = 1; considerPathPointIndex < pathPathPointCount; + considerPathPoint++, considerPathPointIndex++) { + x_dist = (f32) considerPathPoint->posX - posX; + y_dist = (f32) considerPathPoint->posY - posY; + z_dist = (f32) considerPathPoint->posZ - posZ; + considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + if (considerSquaredDistance < minimumSquaredDistance) { + nearestPathPointIndex = considerPathPointIndex; + minimumSquaredDistance = considerSquaredDistance; + } + } + return nearestPathPointIndex; +} + +s16 find_closest_path_point_track_section(f32 posX, f32 posY, f32 posZ, u16 trackSectionId, s32* pathIndex) { + TrackPathPoint* pathPathPoints; + TrackPathPoint* considerPathPoint; + f32 x_dist; + f32 y_dist; + f32 z_dist; + f32 considerSquaredDistance; + f32 minimumSquaredDistance; + s32 considerPathPointIndex; + s32 pathPathPointCount; + s32 temp_t0; + s32 var_a1; + s32 var_t1; + s32 considerPathIndex; + s32 var_t4; + s16 nearestPathPointIndex; + + minimumSquaredDistance = 1000000.0f; + temp_t0 = *pathIndex; + nearestPathPointIndex = 0; + var_t1 = 0; + var_a1 = 0; + pathPathPoints = gTrackPaths[temp_t0]; + pathPathPointCount = gPathCountByPathIndex[temp_t0]; + considerPathPoint = &pathPathPoints[0]; + for (considerPathPointIndex = 0; considerPathPointIndex < pathPathPointCount; + considerPathPointIndex++, considerPathPoint++) { + if ((considerPathPoint->trackSectionId == trackSectionId) || (gCurrentCourseId == COURSE_AWARD_CEREMONY)) { + var_t1 = 1; + x_dist = (f32) considerPathPoint->posX - posX; + y_dist = (f32) considerPathPoint->posY - posY; + z_dist = (f32) considerPathPoint->posZ - posZ; + considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + if (considerSquaredDistance < minimumSquaredDistance) { + nearestPathPointIndex = considerPathPointIndex; + var_a1 = 1; + minimumSquaredDistance = considerSquaredDistance; + } + } + } + if (var_t1 == 0) { + for (considerPathIndex = 0; considerPathIndex < 4; considerPathIndex++) { + if ((considerPathIndex != temp_t0) && (gSizePath[considerPathIndex] >= 2)) { + pathPathPoints = gTrackPaths[considerPathIndex]; + considerPathPoint = &pathPathPoints[0]; + pathPathPointCount = gPathCountByPathIndex[considerPathIndex]; + for (considerPathPointIndex = 0; considerPathPointIndex < pathPathPointCount; + considerPathPointIndex++, considerPathPoint++) { + if (considerPathPoint->trackSectionId == trackSectionId) { + x_dist = (f32) considerPathPoint->posX - posX; + y_dist = (f32) considerPathPoint->posY - posY; + z_dist = (f32) considerPathPoint->posZ - posZ; + considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + if (considerSquaredDistance < minimumSquaredDistance) { + nearestPathPointIndex = considerPathPointIndex; + var_t4 = considerPathIndex; + var_a1 = 2; + minimumSquaredDistance = considerSquaredDistance; + } + } + } + } + } + } + if (var_a1 == 0) { + pathPathPoints = gTrackPaths[0]; + pathPathPointCount = gPathCountByPathIndex[0]; + considerPathPoint = &pathPathPoints[0]; + x_dist = (f32) considerPathPoint->posX - posX; + y_dist = (f32) considerPathPoint->posY - posY; + z_dist = (f32) considerPathPoint->posZ - posZ; + minimumSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + nearestPathPointIndex = 0; + for (considerPathPointIndex = 1; considerPathPointIndex < pathPathPointCount; + considerPathPoint++, considerPathPointIndex++) { + x_dist = (f32) considerPathPoint->posX - posX; + y_dist = (f32) considerPathPoint->posY - posY; + z_dist = (f32) considerPathPoint->posZ - posZ; + considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + if (considerSquaredDistance < minimumSquaredDistance) { + nearestPathPointIndex = considerPathPointIndex; + var_t4 = 0; + var_a1 = 2; + minimumSquaredDistance = considerSquaredDistance; + } + } + } + if (var_a1 == 2) { + *pathIndex = var_t4; + } + return nearestPathPointIndex; +} + +/** + * Tries to find the path point nearest to (posX, posY, posZ) + * Only consider path in the same segment as trackSectionId + * Only considers path within 500 units of(posX, posY, posZ) + * Looks 3 path behind and 6 path ahead of pathPointIndex + **/ +s16 update_path_index_with_track(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex, u16 trackSectionId) { + s16 nearestPathPointIndex; + s16 searchIndex; + s16 considerIndex; + s32 pathPathPointCount; + f32 x_dist; + f32 y_dist; + f32 z_dist; + f32 minimumDistance; + f32 squaredDistance; + TrackPathPoint* pathPathPoints; + TrackPathPoint* considerPathPoint; + + nearestPathPointIndex = -1; + minimumDistance = 500.0f * 500.0f; + pathPathPointCount = gPathCountByPathIndex[pathIndex]; + pathPathPoints = gTrackPaths[pathIndex]; + for (searchIndex = pathPointIndex - 3; searchIndex < pathPointIndex + 7; searchIndex++) { + // Its possible for searchIndex to be less than 0 or greater than the number of path in a given path + // This is done to ensure we access gTrackPaths at a valid index + considerIndex = (searchIndex + pathPathPointCount) % pathPathPointCount; + considerPathPoint = &pathPathPoints[considerIndex]; + if (considerPathPoint->trackSectionId == trackSectionId) { + x_dist = considerPathPoint->posX - posX; + y_dist = considerPathPoint->posY - posY; + z_dist = considerPathPoint->posZ - posZ; + squaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + if (squaredDistance < minimumDistance) { + minimumDistance = squaredDistance; + nearestPathPointIndex = considerIndex; + } + } + } + return nearestPathPointIndex; +} + +/** + * Tries to find the path point nearest to (posX, posY, posZ) + * Only considers path within 400 units of (posX, posY, posZ) + * Looks 3 path behind and 6 path ahead of pathPointIndex + **/ +s16 update_path_index(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) { + s16 nearestPathPointIndex; + s16 searchIndex; + s16 considerIndex; + bool pathPointFound; + s32 pathPathPointCount; + f32 x_dist; + f32 y_dist; + f32 z_dist; + f32 minimumDistance; + f32 squaredDistance; + TrackPathPoint* pathPathPoints; + TrackPathPoint* considerPathPoint; + + pathPointFound = false; + nearestPathPointIndex = -1; + minimumDistance = 400.0f * 400.0f; + pathPathPointCount = gPathCountByPathIndex[pathIndex]; + pathPathPoints = gTrackPaths[pathIndex]; + for (searchIndex = pathPointIndex - 3; searchIndex < pathPointIndex + 7; searchIndex++) { + // Its possible for searchIndex to be less than 0 or greater than the number of path in a given path + // This is done to ensure we access gTrackPaths at a valid index + considerIndex = (searchIndex + pathPathPointCount) % pathPathPointCount; + considerPathPoint = &pathPathPoints[considerIndex]; + x_dist = considerPathPoint->posX - posX; + y_dist = considerPathPoint->posY - posY; + z_dist = considerPathPoint->posZ - posZ; + squaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist); + if (squaredDistance < minimumDistance) { + minimumDistance = squaredDistance; + nearestPathPointIndex = considerIndex; + pathPointFound = true; + } + } + if (pathPointFound == false) { + for (searchIndex = pathPointIndex - 3; searchIndex < pathPointIndex + 7; searchIndex++) { + considerIndex = ((searchIndex + pathPathPointCount) % pathPathPointCount); + considerPathPoint = &pathPathPoints[considerIndex]; + /** + * This fake match is done to stop the compiler from optimzing out considerPathPoint. + * Maybe if no pathPoint was found some debugging info was printed out, but come + * production time they removed the debug printing but not the loop? + **/ + if (considerPathPoint && considerPathPoint) {}; + } + } + return nearestPathPointIndex; +} + +void tweak_path_index_wario_stadium(UNUSED f32 posX, f32 posY, UNUSED f32 posZ, s16* pathPointIndex, UNUSED s32 arg4) { + s16 var_v0; + + var_v0 = *pathPointIndex; + if ((gCurrentCourseId == COURSE_WARIO_STADIUM) && (var_v0 >= 0x475) && (var_v0 < 0x480) && (posY < 0.0f)) { + var_v0 = 0x0398; + } + *pathPointIndex = var_v0; +} + +void adjust_path_at_start_line(UNUSED f32 posX, UNUSED f32 posY, f32 posZ, s16* pathPointIndex, s32 pathIndex) { + s16 pathPoint; + pathPoint = *pathPointIndex; + if (pathPoint == 0) { + if (gPathStartZ < posZ) { + pathPoint = gPathCountByPathIndex[pathIndex] - 1; + } + } else if (((pathPoint + 1) == gPathCountByPathIndex[pathIndex]) && (posZ <= gPathStartZ)) { + pathPoint = 0; + } + *pathPointIndex = pathPoint; +} + +s16 update_path_index_track_section(f32 posX, f32 posY, f32 posZ, Player* player, s32 playerId, s32* pathIndex) { + u16 trackSectionId; + s16 ret; + + trackSectionId = get_track_section_id(player->collision.meshIndexZX); + if ((trackSectionId <= 0) || (trackSectionId >= 0x33)) { + trackSectionId = gPlayersTrackSectionId[playerId]; + } + gPlayersTrackSectionId[playerId] = trackSectionId; + ret = find_closest_path_point_track_section(posX, posY, posZ, trackSectionId, pathIndex); + gPathIndexByPlayerId[playerId] = *pathIndex; + return ret; +} + +/** + * Updates and validates a player's pathPoint position on the track + * Handles different logic for human players vs AI, and includes recovery mechanisms + * + * @param posX Current X position + * @param posY Current Y position + * @param posZ Current Z position + * @param pathPointIndex Current pathPoint index + * @param player Pointer to player structure + * @param playerId Player's ID + * @param pathIndex Current track path index + * @return New pathPoint index or -1 if invalid + */ +s16 update_player_path(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, Player* player, s32 playerId, s32 pathIndex) { + s16 newPathPoint; + UNUSED s16 stackPadding0; + UNUSED s32 stackPadding1; + UNUSED s32 stackPadding2; + TrackPathPoint* temp_v1; + + // Human player handling (non-AI controlled) + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { + newPathPoint = update_path_index_with_track(posX, posY, posZ, pathPointIndex, pathIndex, + (u16) get_track_section_id(player->collision.meshIndexZX)); + if (newPathPoint == -1) { + newPathPoint = update_path_index_track_section(posX, posY, posZ, player, playerId, &pathIndex); + } + } else { // AI or special case player handling + if (D_801631E0[playerId] == true) { + if (player->lakituProps & LAKITU_RETRIEVAL) { + temp_v1 = &gTrackPaths[pathIndex][pathPointIndex]; + player->pos[0] = (f32) temp_v1->posX; + player->pos[1] = (f32) temp_v1->posY; + player->pos[2] = (f32) temp_v1->posZ; + player->lakituProps &= ~LAKITU_RETRIEVAL; + return pathPointIndex; + } + if (playerId == ((s32) D_80163488 % 8)) { + check_bounding_collision(&player->collision, 10.0f, posX, posY, posZ); + gPlayersTrackSectionId[playerId] = get_track_section_id(player->collision.meshIndexZX); + newPathPoint = update_path_index_with_track(posX, posY, posZ, pathPointIndex, pathIndex, + gPlayersTrackSectionId[playerId]); + if (newPathPoint == -1) { + newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex); + } + if (newPathPoint == -1) { + newPathPoint = find_closest_path_point_track_section(posX, posY, posZ, + gPlayersTrackSectionId[playerId], &pathIndex); + temp_v1 = &gTrackPaths[pathIndex][newPathPoint]; + player->pos[0] = (f32) temp_v1->posX; + player->pos[1] = (f32) temp_v1->posY; + player->pos[2] = (f32) temp_v1->posZ; + } + } else { + newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex); + if (newPathPoint == -1) { + newPathPoint = func_8000BD94(posX, posY, posZ, pathIndex); + temp_v1 = &gTrackPaths[pathIndex][newPathPoint]; + posX = (f32) temp_v1->posX; + posY = (f32) temp_v1->posY; + posZ = (f32) temp_v1->posZ; + player->pos[0] = posX; + player->pos[1] = posY; + player->pos[2] = posZ; + check_bounding_collision(&player->collision, 10.0f, posX, posY, posZ); + gPlayersTrackSectionId[playerId] = get_track_section_id(player->collision.meshIndexZX); + } + } + } else { + newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex); + if (newPathPoint == -1) { + newPathPoint = update_path_index_track_section(posX, posY, posZ, player, playerId, &pathIndex); + } + } + tweak_path_index_wario_stadium(posX, posY, posZ, &newPathPoint, pathIndex); + } + adjust_path_at_start_line(posX, posY, posZ, &newPathPoint, pathIndex); + return newPathPoint; +} + +s16 find_closest_vehicles_path_point(f32 xPos, UNUSED f32 yPos, f32 zPos, s16 pathPointIndex) { + f32 xdiff; + f32 zdiff; + f32 minimumDistance; + f32 considerSquaredDistance; + s16 realIndex; + s16 minimumIndex; + s16 considerIndex; + Path2D* considerPathPoint; + + minimumDistance = 250000.0f; + minimumIndex = -1; + for (realIndex = pathPointIndex - 2; realIndex < pathPointIndex + 7; realIndex++) { + considerIndex = realIndex; + if (realIndex < 0) { + considerIndex = realIndex + gVehicle2DPathLength; + } + considerIndex %= gVehicle2DPathLength; + considerPathPoint = &gVehicle2DPathPoint[considerIndex]; + xdiff = considerPathPoint->x - xPos; + zdiff = considerPathPoint->z - zPos; + considerSquaredDistance = (xdiff * xdiff) + (zdiff * zdiff); + if (considerSquaredDistance < minimumDistance) { + minimumDistance = considerSquaredDistance; + minimumIndex = considerIndex; + } + } + if (minimumIndex == -1) { + minimumIndex = pathPointIndex; + } + return minimumIndex; +} + +s16 func_8000D24C(f32 posX, f32 posY, f32 posZ, s32* pathIndex) { + UNUSED s32 pad; + Collision sp24; + + check_bounding_collision(&sp24, 10.0f, posX, posY, posZ); + return find_closest_path_point_track_section(posX, posY, posZ, get_track_section_id(sp24.meshIndexZX), pathIndex); +} + +s16 func_8000D2B4(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) { + s16 pathPoint; + + pathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex); + if (pathPoint == -1) { + pathPoint = func_8000D24C(posX, posY, posZ, &pathIndex); + } + adjust_path_at_start_line(posX, posY, posZ, &pathPoint, pathIndex); + return pathPoint; +} + +s16 func_8000D33C(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) { + s16 pathPoint; + + pathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex); + if (pathPoint == -1) { + pathPoint = func_8000D24C(posX, posY, posZ, &pathIndex); + } + return pathPoint; +} + +f32 cpu_track_position_factor(s32 playerId) { + TrackPositionFactorInstruction* temp_v0; + f32 target; + f32 current; + + temp_v0 = &gPlayerTrackPositionFactorInstruction[playerId]; + current = temp_v0->current; + target = temp_v0->target; + if (current < target) { + current += temp_v0->step; + if (target < current) { + current = target; + } + } else if (target < current) { + current -= temp_v0->step; + if (current < target) { + current = target; + } + } + temp_v0->current = current; + return current; +} + +void determine_ideal_cpu_position_offset(s32 playerId, u16 pathPoint) { + UNUSED s32 stackPadding0; + f32 sp48; + f32 sp44; + UNUSED s32 stackPadding1; + UNUSED s32 stackPadding2; + UNUSED s32 stackPadding3; + f32 stackPadding4; + f32 stackPadding5; + f32 sp2C; + s32 lookAheadDistance; + s16 curveCount; + u16 thing; + + curveCount = gCurrentTrackConsecutiveCurveCountsPath[pathPoint]; + lookAheadDistance = 6; + sp2C = cpu_track_position_factor(playerId); + thing = pathPoint; + + switch (gCurrentCourseId) { + case COURSE_AWARD_CEREMONY: + lookAheadDistance = 1; + break; + case COURSE_TOADS_TURNPIKE: + lookAheadDistance = 7; + break; + case COURSE_YOSHI_VALLEY: + break; + default: + if (curveCount < 6) { + lookAheadDistance = 8; + } else if (curveCount >= 0x15) { + lookAheadDistance = 20; + } + break; + } + + if (lookAheadDistance >= 8) { + if ((gTrackPositionFactor[playerId] > 0.75f) && (gCurrentTrackSectionTypesPath[thing] == RIGHT_LEANING_CURVE)) { + lookAheadDistance = 7; + } + if ((gTrackPositionFactor[playerId] < -0.75f) && (gCurrentTrackSectionTypesPath[thing] == LEFT_LEANING_CURVE)) { + lookAheadDistance = 7; + } + } + if (is_far_from_path(playerId) == true) { + lookAheadDistance = 5; + } + if (gCurrentPlayerLookAhead[playerId] < lookAheadDistance) { + gCurrentPlayerLookAhead[playerId]++; + } + if (lookAheadDistance < gCurrentPlayerLookAhead[playerId]) { + gCurrentPlayerLookAhead[playerId]--; + } + pathPoint = (gCurrentPlayerLookAhead[playerId] + pathPoint) % gSelectedPathCount; + set_track_offset_position(pathPoint, sp2C, gPlayerPathIndex); + sp48 = gOffsetPosition[0]; + sp44 = gOffsetPosition[2]; + set_track_offset_position(((pathPoint + 1) % gSelectedPathCount) & 0xFFFF, sp2C, gPlayerPathIndex); + stackPadding5 = gOffsetPosition[0]; + gOffsetPosition[0] = (sp48 + stackPadding5) * 0.5f; + stackPadding4 = gOffsetPosition[2]; + gOffsetPosition[2] = (sp44 + stackPadding4) * 0.5f; +} + +s16 func_8000D6D0(Vec3f position, s16* pathPointIndex, f32 speed, f32 arg3, s16 pathIndex, s16 arg5) { + f32 temp1; + f32 temp2; + f32 midX; + UNUSED s16 stackPadding1; + s16 pathPoint1; + s16 pathPoint2; + f32 pad3; + f32 midY; + f32 pad4; + f32 midZ; + f32 distance; + f32 oldPosX; + f32 oldPosY; + f32 oldPosZ; + f32 var_f2; + f32 var_f12; + f32 var_f14; + s16 temp_v0; + s32 temp_v1; + f32 xdiff; + f32 ydiff; + f32 zdiff; + Vec3f oldPos; + TrackPathPoint* path; + + path = gTrackPaths[pathIndex]; + oldPos[0] = position[0]; + oldPos[1] = position[1]; + oldPos[2] = position[2]; + oldPosX = position[0]; + oldPosY = position[1]; + oldPosZ = position[2]; + temp_v0 = func_8000D2B4(oldPosX, oldPosY, oldPosZ, *pathPointIndex, (s32) pathIndex); + *pathPointIndex = temp_v0; + temp_v1 = temp_v0 + arg5; + pathPoint1 = temp_v1 % gPathCountByPathIndex[pathIndex]; + pathPoint2 = (temp_v1 + 1) % gPathCountByPathIndex[pathIndex]; + set_track_offset_position(pathPoint1, arg3, pathIndex); + pad3 = gOffsetPosition[0]; + pad4 = gOffsetPosition[2]; + set_track_offset_position(pathPoint2, arg3, pathIndex); + temp1 = gOffsetPosition[0]; + temp2 = gOffsetPosition[2]; + midY = (path[pathPoint1].posY + path[pathPoint2].posY) * 0.5f; + midX = (pad3 + temp1) * 0.5f; + midZ = (pad4 + temp2) * 0.5f; + xdiff = midX - oldPosX; + ydiff = midY - oldPosY; + zdiff = midZ - oldPosZ; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance > 0.01f) { + var_f2 = ((xdiff * speed) / distance) + oldPosX; + var_f12 = ((ydiff * speed) / distance) + oldPosY; + var_f14 = ((zdiff * speed) / distance) + oldPosZ; + } else { + var_f2 = oldPosX; + var_f12 = oldPosY; + var_f14 = oldPosZ; + } + position[0] = var_f2; + position[1] = var_f12; + position[2] = var_f14; + return get_angle_between_path(oldPos, position); +} + +s16 func_8000D940(Vec3f pos, s16* pathPointIndex, f32 speed, f32 arg3, s16 pathIndex) { + UNUSED f32 pad; + f32 thing1; + f32 thing2; + UNUSED s16 stackPadding1; + s16 pathPoint1; + s16 pathPoint2; + UNUSED s16 stackPadding2; + f32 pad2; + f32 midX; + f32 pad3; + f32 midY; + f32 midZ; + f32 distance; + f32 temp_f20; + f32 temp_f22; + f32 temp_f24; + f32 var_f2; + f32 var_f12; + f32 var_f14; + s16 temp_v0; + f32 xdiff; + f32 ydiff; + f32 zdiff; + s32 pathPointCount; + Vec3f sp54; + + sp54[0] = pos[0]; + sp54[1] = pos[1]; + sp54[2] = pos[2]; + pathPointCount = gPathCountByPathIndex[pathIndex]; + temp_f20 = pos[0]; + temp_f22 = pos[1]; + temp_f24 = pos[2]; + temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *pathPointIndex, (s32) pathIndex); + *pathPointIndex = temp_v0; + pathPoint1 = ((temp_v0 + pathPointCount) - 3) % pathPointCount; + pathPoint2 = ((temp_v0 + pathPointCount) - 4) % pathPointCount; + set_track_offset_position(pathPoint1, arg3, pathIndex); + pad2 = gOffsetPosition[0]; + pad3 = gOffsetPosition[2]; + set_track_offset_position(pathPoint2, arg3, pathIndex); + thing1 = gOffsetPosition[0]; + thing2 = gOffsetPosition[2]; + midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) * 0.5f; + midX = (pad2 + thing1) * 0.5f; + midZ = (pad3 + thing2) * 0.5f; + xdiff = midX - temp_f20; + ydiff = midY - temp_f22; + zdiff = midZ - temp_f24; + distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff)); + if (distance > 0.01f) { + var_f2 = ((xdiff * speed) / distance) + temp_f20; + var_f12 = ((ydiff * speed) / distance) + temp_f22; + var_f14 = ((zdiff * speed) / distance) + temp_f24; + } else { + var_f2 = temp_f20; + var_f12 = temp_f22; + var_f14 = temp_f24; + } + pos[0] = var_f2; + pos[1] = var_f12; + pos[2] = var_f14; + return get_angle_between_path(sp54, pos); +} + +s16 update_vehicle_following_path(Vec3f pos, s16* pathPointIndex, f32 speed) { + f32 origXPos; + f32 origYPos; + f32 origZPos; + UNUSED s32 stackPadding0; + UNUSED s32 stackPadding1; + UNUSED s32 stackPadding2; + UNUSED s32 stackPadding3; + UNUSED s32 stackPadding4; + UNUSED s32 stackPadding5; + UNUSED s32 stackPadding6; + UNUSED s32 stackPadding7; + UNUSED s32 stackPadding8; + f32 farPathPointAverageX; + f32 farPathPointAverageZ; + f32 x_dist; + f32 y_dist; + f32 distance; + f32 newX; + f32 newZ; + s16 newPathPointIndex; + s16 farPathPoint1; + s16 farPathPoint2; + Path2D* temp_a0; + Path2D* temp_a2; + Vec3f sp38; + + origXPos = pos[0]; + origYPos = pos[1]; + origZPos = pos[2]; + sp38[0] = pos[0]; + sp38[1] = pos[1]; + sp38[2] = pos[2]; + newPathPointIndex = find_closest_vehicles_path_point(origXPos, origYPos, origZPos, *pathPointIndex); + *pathPointIndex = newPathPointIndex; + farPathPoint1 = (newPathPointIndex + 3) % gVehicle2DPathLength; + farPathPoint2 = (newPathPointIndex + 4) % gVehicle2DPathLength; + temp_a0 = &gVehicle2DPathPoint[farPathPoint1]; + temp_a2 = &gVehicle2DPathPoint[farPathPoint2]; + farPathPointAverageX = (temp_a0->x + temp_a2->x) * 0.5f; + farPathPointAverageZ = (temp_a0->z + temp_a2->z) * 0.5f; + x_dist = farPathPointAverageX - origXPos; + y_dist = farPathPointAverageZ - origZPos; + distance = sqrtf((x_dist * x_dist) + (y_dist * y_dist)); + if (distance > 0.01f) { + newX = ((x_dist * speed) / distance) + origXPos; + newZ = ((y_dist * speed) / distance) + origZPos; + } else { + newX = origXPos; + newZ = origZPos; + } + pos[0] = newX; + pos[1] = origYPos; + pos[2] = newZ; + return get_angle_between_path(sp38, pos); +} diff --git a/src/cpu_vehicles_camera_path/vehicle_utils.inc.c b/src/cpu_vehicles_camera_path/vehicle_utils.inc.c new file mode 100644 index 0000000000..d359e10708 --- /dev/null +++ b/src/cpu_vehicles_camera_path/vehicle_utils.inc.c @@ -0,0 +1,1091 @@ +#define GET_PATH_LENGTH(pathPoint) \ + for (i = 0;; i++) { \ + if ((u16) pathPoint[i].posX == 0x8000) { \ + break; \ + } \ + } + +void generate_train_path(void) { + s32 i; + Path2D* temp; + TrackPathPoint* pathPoint = + (TrackPathPoint*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[SEGMENT_NUMBER2(d_course_kalimari_desert_train_path)] + + SEGMENT_OFFSET(d_course_kalimari_desert_train_path)); + + GET_PATH_LENGTH(pathPoint) + + temp = gVehicle2DPathPoint; + gVehicle2DPathLength = generate_2d_path(temp, pathPoint, i - 1); + D_80162EB0 = get_surface_height(temp[0].x, 2000.0f, temp[0].z); +} + +void generate_ferry_path(void) { + TrackPathPoint* pathPoint; + s32 i; + + pathPoint = + (TrackPathPoint*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[SEGMENT_NUMBER2(d_course_dks_jungle_parkway_ferry_path)] + + (SEGMENT_OFFSET(d_course_dks_jungle_parkway_ferry_path))); + + GET_PATH_LENGTH(pathPoint) + + gVehicle2DPathLength = generate_2d_path(gVehicle2DPathPoint, pathPoint, i - 1); + D_80162EB2 = -40; +} + +void spawn_vehicle_on_road(VehicleStuff* vehicle) { + f32 origXPos; + UNUSED f32 pad; + f32 origZPos; + + origXPos = vehicle->position[0]; + origZPos = vehicle->position[2]; + if (gIsInExtra == false) { + func_8000D6D0(vehicle->position, (s16*) &vehicle->pathPointIndex, vehicle->speed, + vehicle->someMultiplierTheSequel, 0, 3); + vehicle->rotation[0] = 0; + vehicle->rotation[1] = -0x8000; + vehicle->rotation[2] = 0; + } else { + func_8000D940(vehicle->position, (s16*) &vehicle->pathPointIndex, vehicle->speed, + vehicle->someMultiplierTheSequel, 0); + vehicle->rotation[0] = 0; + vehicle->rotation[1] = 0; + vehicle->rotation[2] = 0; + } + vehicle->velocity[0] = vehicle->position[0] - origXPos; + vehicle->velocity[2] = vehicle->position[2] - origZPos; +} + +void spawn_course_vehicles(void) { + s16 trainCarYRot; + UNUSED Vec3f pad; + TrainCarStuff* tempLocomotive; + TrainCarStuff* tempTender; + TrainCarStuff* tempPassengerCar; + Vec3s trainCarRot; + VehicleStuff* tempBoxTruck; + VehicleStuff* tempSchoolBus; + VehicleStuff* tempTankerTruck; + VehicleStuff* tempCar; + PaddleBoatStuff* tempPaddleWheelBoat; + Vec3s paddleWheelBoatRot; + s32 loopIndex; + s32 loopIndex2; + f32 origXPos; + f32 origZPos; + +#if !ENABLE_CUSTOM_COURSE_ENGINE + switch (gCurrentCourseId) { + case COURSE_KALAMARI_DESERT: + for (loopIndex = 0; loopIndex < NUM_TRAINS; loopIndex++) { + tempLocomotive = &gTrainList[loopIndex].locomotive; + origXPos = tempLocomotive->position[0]; + origZPos = tempLocomotive->position[2]; + trainCarYRot = update_vehicle_following_path( + tempLocomotive->position, (s16*) &tempLocomotive->pathPointIndex, gTrainList[loopIndex].speed); + tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos; + tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos; + vec3s_set(trainCarRot, 0, trainCarYRot, 0); + tempLocomotive->actorIndex = add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, + tempLocomotive->velocity, ACTOR_TRAIN_ENGINE); + + tempTender = &gTrainList[loopIndex].tender; + if (tempTender->isActive == 1) { + origXPos = tempTender->position[0]; + origZPos = tempTender->position[2]; + trainCarYRot = update_vehicle_following_path( + tempTender->position, (s16*) &tempTender->pathPointIndex, gTrainList[loopIndex].speed); + tempTender->velocity[0] = tempTender->position[0] - origXPos; + tempTender->velocity[2] = tempTender->position[2] - origZPos; + vec3s_set(trainCarRot, 0, trainCarYRot, 0); + tempTender->actorIndex = add_actor_to_empty_slot(tempTender->position, trainCarRot, + tempTender->velocity, ACTOR_TRAIN_TENDER); + } + + for (loopIndex2 = 0; loopIndex2 < NUM_PASSENGER_CAR_ENTRIES; loopIndex2++) { + tempPassengerCar = &gTrainList[loopIndex].passengerCars[loopIndex2]; + if (tempPassengerCar->isActive == 1) { + origXPos = tempPassengerCar->position[0]; + origZPos = tempPassengerCar->position[2]; + trainCarYRot = update_vehicle_following_path(tempPassengerCar->position, + (s16*) &tempPassengerCar->pathPointIndex, + gTrainList[loopIndex].speed); + tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos; + tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos; + vec3s_set(trainCarRot, 0, trainCarYRot, 0); + tempPassengerCar->actorIndex = + add_actor_to_empty_slot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, + ACTOR_TRAIN_PASSENGER_CAR); + } + } + } + break; + case COURSE_DK_JUNGLE: + for (loopIndex = 0; loopIndex < NUM_ACTIVE_PADDLE_BOATS; loopIndex++) { + tempPaddleWheelBoat = &gPaddleBoats[loopIndex]; + if (tempPaddleWheelBoat->isActive == 1) { + origXPos = tempPaddleWheelBoat->position[0]; + origZPos = tempPaddleWheelBoat->position[2]; + tempPaddleWheelBoat->rotY = update_vehicle_following_path( + tempPaddleWheelBoat->position, (s16*) &tempPaddleWheelBoat->pathPointIndex, + tempPaddleWheelBoat->speed); + tempPaddleWheelBoat->velocity[0] = tempPaddleWheelBoat->position[0] - origXPos; + tempPaddleWheelBoat->velocity[2] = tempPaddleWheelBoat->position[2] - origZPos; + vec3s_set(paddleWheelBoatRot, 0, tempPaddleWheelBoat->rotY, 0); + tempPaddleWheelBoat->actorIndex = + add_actor_to_empty_slot(tempPaddleWheelBoat->position, paddleWheelBoatRot, + tempPaddleWheelBoat->velocity, ACTOR_PADDLE_BOAT); + } + } + break; + case COURSE_TOADS_TURNPIKE: + for (loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) { + tempBoxTruck = &gBoxTruckList[loopIndex]; + spawn_vehicle_on_road(tempBoxTruck); + tempBoxTruck->actorIndex = add_actor_to_empty_slot(tempBoxTruck->position, tempBoxTruck->rotation, + tempBoxTruck->velocity, ACTOR_BOX_TRUCK); + } + for (loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) { + tempSchoolBus = &gSchoolBusList[loopIndex]; + spawn_vehicle_on_road(tempSchoolBus); + tempSchoolBus->actorIndex = add_actor_to_empty_slot(tempSchoolBus->position, tempSchoolBus->rotation, + tempSchoolBus->velocity, ACTOR_SCHOOL_BUS); + } + for (loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) { + tempTankerTruck = &gTankerTruckList[loopIndex]; + spawn_vehicle_on_road(tempTankerTruck); + tempTankerTruck->actorIndex = + add_actor_to_empty_slot(tempTankerTruck->position, tempTankerTruck->rotation, + tempTankerTruck->velocity, ACTOR_TANKER_TRUCK); + } + for (loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) { + tempCar = &gCarList[loopIndex]; + spawn_vehicle_on_road(tempCar); + tempCar->actorIndex = + add_actor_to_empty_slot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR); + } + break; + } +#else + +#endif +} + +void set_vehicle_pos_path_point(TrainCarStuff* trainCar, Path2D* posXZ, u16 pathPoint) { + trainCar->position[0] = (f32) posXZ->x; + trainCar->position[1] = (f32) D_80162EB0; + trainCar->position[2] = (f32) posXZ->z; + trainCar->actorIndex = -1; + trainCar->pathPointIndex = pathPoint; + trainCar->isActive = 0; + trainCar->velocity[0] = 0.0f; + trainCar->velocity[1] = 0.0f; + trainCar->velocity[2] = 0.0f; +} + +/** + * Set pathPoint spawn locations for each rolling stock + * The railroad has 465 path + */ +void init_vehicles_trains(void) { + u16 pathPointOffset; + TrainCarStuff* ptr1; + Path2D* pos; + s32 i; + s32 j; + + for (i = 0; i < NUM_TRAINS; i++) { + // outputs 160 or 392 depending on the train. + // Wraps the value around to always output a valid pathPoint. + pathPointOffset = (((i * gVehicle2DPathLength) / NUM_TRAINS) + 160) % gVehicle2DPathLength; + + // 120.0f is about the maximum usable value + gTrainList[i].speed = 5.0f; + for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { + pathPointOffset += 4; + ptr1 = &gTrainList[i].passengerCars[j]; + pos = &gVehicle2DPathPoint[pathPointOffset]; + set_vehicle_pos_path_point(ptr1, pos, pathPointOffset); + } + // Smaller offset for the tender + pathPointOffset += 3; + ptr1 = &gTrainList[i].tender; + pos = &gVehicle2DPathPoint[pathPointOffset]; + set_vehicle_pos_path_point(ptr1, pos, pathPointOffset); + + pathPointOffset += 4; + ptr1 = &gTrainList[i].locomotive; + pos = &gVehicle2DPathPoint[pathPointOffset]; + set_vehicle_pos_path_point(ptr1, pos, pathPointOffset); + + // Only use locomotive unless overwritten below. + gTrainList[i].numCars = LOCOMOTIVE_ONLY; + } + + // Spawn all rolling stock in single player mode. + switch (gScreenModeSelection) { + case SCREEN_MODE_1P: // single player + for (i = 0; i < NUM_TRAINS; i++) { + gTrainList[i].tender.isActive = 1; + + // clang-format off + // Same line required for matching... + for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { gTrainList[i].passengerCars[j].isActive = 1; } + // clang-format on + + gTrainList[i].numCars = NUM_TENDERS + NUM_PASSENGER_CAR_ENTRIES; + } + break; + + // Spawn locomotive, tender, and one passenger car in versus 2/3 player mode. + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: // multiplayer fall-through + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + if (gModeSelection != GRAND_PRIX) { + for (i = 0; i < NUM_TRAINS; i++) { + gTrainList[i].tender.isActive = 1; + gTrainList[i].passengerCars[4].isActive = 1; + gTrainList[i].numCars = NUM_TENDERS + NUM_2P_PASSENGER_CARS; + } + } + break; + } + + gTrainSmokeTimer = 0; +} +/** + * @brief sync the train components vehicle with the actor + * + * @param trainCar + * @param orientationY + */ +void sync_train_components(TrainCarStuff* trainCar, s16 orientationY) { + struct TrainCar* trainCarActor; + + trainCarActor = (struct TrainCar*) &gActorList[trainCar->actorIndex]; + trainCarActor->pos[0] = trainCar->position[0]; + trainCarActor->pos[1] = trainCar->position[1]; + trainCarActor->pos[2] = trainCar->position[2]; + if (gIsMirrorMode != 0) { + trainCarActor->rot[1] = -orientationY; + } else { + trainCarActor->rot[1] = orientationY; + } + trainCarActor->velocity[0] = trainCar->velocity[0]; + trainCarActor->velocity[2] = trainCar->velocity[2]; +} + +void update_vehicle_trains(void) { + UNUSED s32 pad[3]; + f32 temp_f20; + TrainCarStuff* car; + u16 oldPathPointIndex; + s16 orientationYUpdate; + f32 temp_f22; + s32 i; + s32 j; + Vec3f smokePos; + + gTrainSmokeTimer += 1; + + for (i = 0; i < NUM_TRAINS; i++) { + oldPathPointIndex = (u16) gTrainList[i].locomotive.pathPointIndex; + + temp_f20 = gTrainList[i].locomotive.position[0]; + temp_f22 = gTrainList[i].locomotive.position[2]; + + orientationYUpdate = update_vehicle_following_path( + gTrainList[i].locomotive.position, (s16*) &gTrainList[i].locomotive.pathPointIndex, gTrainList[i].speed); + + gTrainList[i].locomotive.velocity[0] = gTrainList[i].locomotive.position[0] - temp_f20; + gTrainList[i].locomotive.velocity[2] = gTrainList[i].locomotive.position[2] - temp_f22; + + sync_train_components(&gTrainList[i].locomotive, orientationYUpdate); + + if ((oldPathPointIndex != gTrainList[i].locomotive.pathPointIndex) && + ((gTrainList[i].locomotive.pathPointIndex == 0x00BE) || + (gTrainList[i].locomotive.pathPointIndex == 0x0140))) { // play crossing bell sound + func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, + SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); + } else if (random_int(100) == 0) { // play train whistle sound + func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, + SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); + } + + gTrainList[i].someFlags = set_vehicle_render_distance_flags( + gTrainList[i].locomotive.position, TRAIN_SMOKE_RENDER_DISTANCE, gTrainList[i].someFlags); + // Renders locomotive smoke on all screens if any player is within range. + if ((((s16) gTrainSmokeTimer % 5) == 0) && (gTrainList[i].someFlags != 0)) { + smokePos[0] = gTrainList[i].locomotive.position[0]; + smokePos[1] = (f32) ((f64) gTrainList[i].locomotive.position[1] + 65.0); + smokePos[2] = (f32) ((f64) gTrainList[i].locomotive.position[2] + 25.0); + adjust_position_by_angle(smokePos, gTrainList[i].locomotive.position, orientationYUpdate); + spawn_train_smoke(i, smokePos, 1.1f); + } + + car = &gTrainList[i].tender; + + if (car->isActive == 1) { + temp_f20 = car->position[0]; + temp_f22 = car->position[2]; + orientationYUpdate = + update_vehicle_following_path(car->position, (s16*) &car->pathPointIndex, gTrainList[i].speed); + car->velocity[0] = car->position[0] - temp_f20; + car->velocity[2] = car->position[2] - temp_f22; + sync_train_components(car, orientationYUpdate); + } + + for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { + car = &gTrainList[i].passengerCars[j]; + if (car->isActive == 1) { + temp_f20 = car->position[0]; + temp_f22 = car->position[2]; + + orientationYUpdate = + update_vehicle_following_path(car->position, (s16*) &car->pathPointIndex, gTrainList[i].speed); + car->velocity[0] = car->position[0] - temp_f20; + car->velocity[2] = car->position[2] - temp_f22; + sync_train_components(car, orientationYUpdate); + } + } + } +} + +void handle_trains_interactions(s32 playerId, Player* player) { + TrainCarStuff* trainCar; + f32 playerPosX; + f32 playerPosZ; + f32 x_dist; + f32 z_dist; + s32 trainIndex; + s32 passengerCarIndex; + + if (D_801631E0[playerId] != true) { + if (!(player->effects & EXPLOSION_CRASH_EFFECT)) { + playerPosX = player->pos[0]; + playerPosZ = player->pos[2]; + for (trainIndex = 0; trainIndex < NUM_TRAINS; trainIndex++) { + trainCar = &gTrainList[trainIndex].locomotive; + x_dist = playerPosX - trainCar->position[0]; + z_dist = playerPosZ - trainCar->position[2]; + if ((x_dist > -100.0) && (x_dist < 100.0)) { + if ((z_dist > -100.0) && (z_dist < 100.0)) { + if (is_collide_with_vehicle(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], + trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { + player->triggers |= VERTICAL_TUMBLE_TRIGGER; + } + trainCar = &gTrainList[trainIndex].tender; + if (trainCar->isActive == 1) { + if (is_collide_with_vehicle(trainCar->position[0], trainCar->position[2], + trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, + playerPosX, playerPosZ) == 1) { + player->triggers |= VERTICAL_TUMBLE_TRIGGER; + } + } + } + } + + for (passengerCarIndex = 0; passengerCarIndex < NUM_PASSENGER_CAR_ENTRIES; passengerCarIndex++) { + trainCar = &gTrainList[trainIndex].passengerCars[passengerCarIndex]; + x_dist = playerPosX - trainCar->position[0]; + z_dist = playerPosZ - trainCar->position[2]; + if (trainCar->isActive == 1) { + if ((x_dist > -100.0) && (x_dist < 100.0)) { + if ((z_dist > -100.0) && (z_dist < 100.0)) { + if (is_collide_with_vehicle(trainCar->position[0], trainCar->position[2], + trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, + playerPosX, playerPosZ) == 1) { + player->triggers |= VERTICAL_TUMBLE_TRIGGER; + } + } + } + } + } + } + } + } +} + +/** + * Appears to check if the train is close to the crossing. + * Implements sCrossingActiveTimer as a counter + */ +void func_80013054(void) { + f32 temp_f16; + f32 temp_f18; + f32 temp_f12; + s32 i; + isCrossingTriggeredByIndex[0] = 0; + isCrossingTriggeredByIndex[1] = 0; + + for (i = 0; i < NUM_TRAINS; i++) { + temp_f16 = gTrainList[i].locomotive.pathPointIndex / ((f32) gVehicle2DPathLength); + temp_f18 = 0.72017354f; + temp_f12 = 0.42299348f; + + if (((temp_f12 - 0.1) < temp_f16) && + (temp_f16 < ((((f64) gTrainList[i].numCars) * 0.01) + (temp_f12 + 0.01)))) { + + isCrossingTriggeredByIndex[0] = 1; + } + if (((temp_f18 - 0.1) < temp_f16) && + (temp_f16 < ((((f64) gTrainList[i].numCars) * 0.01) + (temp_f18 + 0.01)))) { + + isCrossingTriggeredByIndex[1] = 1; + } + } + + for (i = 0; i < NUM_CROSSINGS; i++) { + if (isCrossingTriggeredByIndex[i] == 1) { + sCrossingActiveTimer[i] += 1; + } else { + sCrossingActiveTimer[i] = 0; + } + } +} + +void check_ai_crossing_distance(s32 playerId) { + bStopAICrossing[playerId] = 0; + if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { + if ((!(D_801631E0[playerId] != false)) || + (set_vehicle_render_distance_flags(gPlayers[playerId].pos, TRAIN_CROSSING_AI_DISTANCE, 0))) { + + if ((isCrossingTriggeredByIndex[1] == 1) && ((sCrossingActiveTimer[1]) > FRAMES_SINCE_CROSSING_ACTIVATED)) { + + if ((sSomeNearestPathPoint > 176) && (sSomeNearestPathPoint < 182)) { + bStopAICrossing[playerId] = 1; + } + } + if ((isCrossingTriggeredByIndex[0] == 1) && ((sCrossingActiveTimer[0]) > FRAMES_SINCE_CROSSING_ACTIVATED)) { + if ((sSomeNearestPathPoint >= 306) && (sSomeNearestPathPoint < 310)) { + bStopAICrossing[playerId] = 1; + } + } + } + } +} + +void init_vehicles_ferry(void) { + PaddleBoatStuff* paddleBoat; + s32 i; + Path2D* temp_a2; + u16 temp; + for (i = 0; i < NUM_ACTIVE_PADDLE_BOATS; i++) { + temp = i * 0xB4; + paddleBoat = &gPaddleBoats[i]; + temp_a2 = &gVehicle2DPathPoint[temp]; + paddleBoat->position[0] = temp_a2->x; + paddleBoat->position[1] = D_80162EB2; + paddleBoat->position[2] = temp_a2->z; + paddleBoat->pathPointIndex = i * 0xB4; + paddleBoat->actorIndex = -1; + + if (gPlayerCount >= 3) { + paddleBoat->isActive = 0; + } else { + paddleBoat->isActive = 1; + } + paddleBoat->velocity[0] = 0.0f; + paddleBoat->velocity[1] = 0.0f; + paddleBoat->velocity[2] = 0.0f; + paddleBoat->speed = 1.6666666f; + paddleBoat->rotY = 0; + } + gFerrySmokeTimer = 0; +} + +void update_vehicle_paddle_boats(void) { + PaddleBoatStuff* paddleBoat; + Path2D* pathPoint; + s32 i; + struct Actor* paddleBoatActor; + f32 temp_f26; + f32 temp_f28; + f32 temp_f30; + s16 temp_a1; + s32 temp; + s16 var_v1; + Vec3f sp94; + Vec3f sp88; + UNUSED s32 pad; + Vec3f smokePos; + UNUSED s32 pad2; + gFerrySmokeTimer += 1; + for (i = 0; i < NUM_ACTIVE_PADDLE_BOATS; i++) { + paddleBoat = &gPaddleBoats[i]; + if (paddleBoat->isActive == 1) { + temp_f26 = paddleBoat->position[0]; + temp_f28 = paddleBoat->position[1]; + temp_f30 = paddleBoat->position[2]; + update_vehicle_following_path(paddleBoat->position, (s16*) &paddleBoat->pathPointIndex, paddleBoat->speed); + paddleBoat->someFlags = set_vehicle_render_distance_flags(paddleBoat->position, BOAT_SMOKE_RENDER_DISTANCE, + paddleBoat->someFlags); + if ((((s16) gFerrySmokeTimer % 10) == 0) && (paddleBoat->someFlags != 0)) { + smokePos[0] = (f32) ((f64) paddleBoat->position[0] - 30.0); + smokePos[1] = (f32) ((f64) paddleBoat->position[1] + 180.0); + smokePos[2] = (f32) ((f64) paddleBoat->position[2] + 45.0); + adjust_position_by_angle(smokePos, paddleBoat->position, paddleBoat->rotY); + spawn_ferry_smoke(i, smokePos, 1.1f); + smokePos[0] = (f32) ((f64) paddleBoat->position[0] + 30.0); + smokePos[1] = (f32) ((f64) paddleBoat->position[1] + 180.0); + smokePos[2] = (f32) ((f64) paddleBoat->position[2] + 45.0); + adjust_position_by_angle(smokePos, paddleBoat->position, paddleBoat->rotY); + spawn_ferry_smoke(i, smokePos, 1.1f); + } + if (random_int(100) == 0) { + if (random_int(2) == 0) { + func_800C98B8(paddleBoat->position, paddleBoat->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x47)); + } else { + func_800C98B8(paddleBoat->position, paddleBoat->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x48)); + } + } + sp94[0] = temp_f26; + sp94[1] = temp_f28; + sp94[2] = temp_f30; + pathPoint = &gVehicle2DPathPoint[(paddleBoat->pathPointIndex + 5) % gVehicle2DPathLength]; + sp88[0] = (f32) pathPoint->x; + sp88[1] = (f32) D_80162EB0; + sp88[2] = (f32) pathPoint->z; + temp_a1 = get_angle_between_path(sp94, sp88); + temp = temp_a1 - paddleBoat->rotY; + var_v1 = temp; + if (var_v1 < 0) { + var_v1 = -var_v1; + } + if (var_v1 >= 0x1771) { + if (paddleBoat->speed > 0.2) { + paddleBoat->speed -= 0.04; + } + if (var_v1 >= 0x3D) { + var_v1 = 0x003C; + } + } else { + if (paddleBoat->speed < 2.0) { + paddleBoat->speed += 0.02; + } + if (var_v1 >= 0x1F) { + var_v1 = 0x001E; + } + } + if (temp >= 0x8000) { + paddleBoat->rotY -= var_v1; + } else if (temp > 0) { + paddleBoat->rotY += var_v1; + } else if (temp < -0x7FFF) { + paddleBoat->rotY += var_v1; + } else if (temp < 0) { + paddleBoat->rotY -= var_v1; + } + paddleBoat->velocity[0] = paddleBoat->position[0] - temp_f26; + paddleBoat->velocity[1] = paddleBoat->position[1] - temp_f28; + paddleBoat->velocity[2] = paddleBoat->position[2] - temp_f30; + paddleBoatActor = &gActorList[paddleBoat->actorIndex]; + paddleBoatActor->pos[0] = paddleBoat->position[0]; + paddleBoatActor->pos[1] = paddleBoat->position[1]; + paddleBoatActor->pos[2] = paddleBoat->position[2]; + if (gIsMirrorMode != 0) { + paddleBoatActor->rot[1] = -paddleBoat->rotY; + } else { + paddleBoatActor->rot[1] = paddleBoat->rotY; + } + paddleBoatActor->velocity[0] = paddleBoat->velocity[0]; + paddleBoatActor->velocity[1] = paddleBoat->velocity[1]; + paddleBoatActor->velocity[2] = paddleBoat->velocity[2]; + } + } +} + +void handle_paddle_boats_interactions(Player* player) { + s32 someIndex; + PaddleBoatStuff* tempPaddleWheelBoat; + f32 x_diff; + f32 y_diff; + f32 z_diff; + f32 playerX; + f32 playerZ; + f32 playerY; + + if (!((player->effects & EXPLOSION_CRASH_EFFECT)) && (!(player->effects & HIT_BY_STAR_EFFECT))) { + playerX = player->pos[0]; + playerY = player->pos[1]; + playerZ = player->pos[2]; + for (someIndex = 0; someIndex < NUM_ACTIVE_PADDLE_BOATS; someIndex++) { + tempPaddleWheelBoat = &gPaddleBoats[someIndex]; + if (tempPaddleWheelBoat->isActive == 1) { + x_diff = playerX - tempPaddleWheelBoat->position[0]; + y_diff = playerY - tempPaddleWheelBoat->position[1]; + z_diff = playerZ - tempPaddleWheelBoat->position[2]; + if ((x_diff > -300.0) && (x_diff < 300.0)) { + if ((z_diff > -300.0) && (z_diff < 300.0)) { + if ((is_collide_with_vehicle(tempPaddleWheelBoat->position[0], tempPaddleWheelBoat->position[2], + tempPaddleWheelBoat->velocity[0], tempPaddleWheelBoat->velocity[2], + 200.0f, 60.0f, playerX, playerZ) == 1) && + (y_diff < 60.0)) { + player->triggers |= HIT_PADDLE_BOAT_TRIGGER; + } + } + } + } + } + } +} + +void initialize_toads_turnpike_vehicle(f32 speedA, f32 speedB, s32 numVehicles, s32 arg3, VehicleStuff* vehicleList, + TrackPathPoint* pathPointList) { + VehicleStuff* veh; + TrackPathPoint* temp_v0; + s32 i; + u16 pathPointOffset; + s32 numPathPoints = gPathCountByPathIndex[0]; + for (i = 0; i < numVehicles; i++) { + pathPointOffset = (((i * numPathPoints) / numVehicles) + arg3) % numPathPoints; + veh = &vehicleList[i]; + temp_v0 = &pathPointList[pathPointOffset]; + veh->position[0] = (f32) temp_v0->posX; + veh->position[1] = (f32) temp_v0->posY; + veh->position[2] = (f32) temp_v0->posZ; + veh->actorIndex = -1; + veh->pathPointIndex = pathPointOffset; + veh->unused = 0; + veh->velocity[0] = 0.0f; + veh->velocity[1] = 0.0f; + veh->velocity[2] = 0.0f; + veh->someFlags = 0; + veh->someFlagsTheSequel = 0; + if (gModeSelection == TIME_TRIALS) { + veh->someType = (i % 3); + } else { + veh->someType = random_int(3); + } + veh->someMultiplierTheSequel = (f32) ((f64) (f32) (veh->someType - 1) * 0.6); + if (((gCCSelection > CC_50) || (gModeSelection == TIME_TRIALS)) && (veh->someType == 2)) { + veh->speed = speedA; + } else { + veh->speed = speedB; + } + veh->rotation[0] = 0; + veh->rotation[2] = 0; + if (gIsInExtra == false) { + veh->rotation[1] = func_8000D6D0(veh->position, (s16*) &veh->pathPointIndex, veh->speed, + veh->someMultiplierTheSequel, 0, 3); + } else { + veh->rotation[1] = + func_8000D940(veh->position, (s16*) &veh->pathPointIndex, veh->speed, veh->someMultiplierTheSequel, 0); + } + } + sVehicleSoundRenderCounter = 10; +} + +f32 func_80013C74(s16 someType, s16 pathPointIndex) { + f32 var_f2; + + var_f2 = 0.0f; + if (pathPointIndex < 0x28A) { + switch (someType) { + case 0: + var_f2 = -0.7f; + break; + case 1: + break; + case 2: + var_f2 = 0.7f; + break; + default: + break; + } + } else { + switch (someType) { + case 0: + case 1: + var_f2 = -0.5f; + break; + case 2: + var_f2 = 0.5f; + break; + default: + break; + } + } + return var_f2; +} + +void update_vehicle_follow_path_point(VehicleStuff* vehicle) { + f32 temp_f0_2; + f32 temp_f0_3; + f32 sp5C; + f32 sp58; + f32 sp54; + f32 temp_f2_2; + s16 var_a1; + s16 thing; + Vec3f sp40; + Vec3f sp34; + struct Actor* vehicleActor; + + sp5C = vehicle->position[0]; + sp58 = vehicle->position[1]; + sp54 = vehicle->position[2]; + sp40[0] = sp58; + sp40[1] = 0.0f; + sp40[2] = 0.0f; + temp_f0_2 = func_80013C74(vehicle->someType, vehicle->pathPointIndex); + if (vehicle->someMultiplierTheSequel < temp_f0_2) { + vehicle->someMultiplierTheSequel = vehicle->someMultiplierTheSequel + 0.06; + if (temp_f0_2 < vehicle->someMultiplierTheSequel) { + vehicle->someMultiplierTheSequel = temp_f0_2; + } + } + if (temp_f0_2 < vehicle->someMultiplierTheSequel) { + vehicle->someMultiplierTheSequel = vehicle->someMultiplierTheSequel - 0.06; + if (vehicle->someMultiplierTheSequel < temp_f0_2) { + vehicle->someMultiplierTheSequel = temp_f0_2; + } + } + if (gIsInExtra == false) { + var_a1 = func_8000D6D0(vehicle->position, (s16*) &vehicle->pathPointIndex, vehicle->speed, + vehicle->someMultiplierTheSequel, 0, 3); + } else { + var_a1 = func_8000D940(vehicle->position, (s16*) &vehicle->pathPointIndex, vehicle->speed, + vehicle->someMultiplierTheSequel, 0); + } + adjust_angle(&vehicle->rotation[1], var_a1, 100); + temp_f0_3 = vehicle->position[0] - sp5C; + temp_f2_2 = vehicle->position[2] - sp54; + sp34[0] = vehicle->position[1]; + sp34[1] = 0.0f; + sp34[2] = sqrtf((temp_f0_3 * temp_f0_3) + (temp_f2_2 * temp_f2_2)); + thing = get_xz_angle_between_points(sp40, sp34); + adjust_angle(&vehicle->rotation[0], -thing, 100); + vehicle->velocity[0] = vehicle->position[0] - sp5C; + vehicle->velocity[1] = vehicle->position[1] - sp58; + vehicle->velocity[2] = vehicle->position[2] - sp54; + vehicleActor = &gActorList[vehicle->actorIndex]; + vehicleActor->pos[0] = vehicle->position[0]; + vehicleActor->pos[1] = vehicle->position[1]; + vehicleActor->pos[2] = vehicle->position[2]; + vehicleActor->rot[0] = vehicle->rotation[0]; + if (gIsMirrorMode != 0) { + vehicleActor->rot[1] = -vehicle->rotation[1]; + } else { + vehicleActor->rot[1] = vehicle->rotation[1]; + } + vehicleActor->rot[2] = vehicle->rotation[2]; + vehicleActor->velocity[0] = vehicle->velocity[0]; + vehicleActor->velocity[1] = vehicle->velocity[1]; + vehicleActor->velocity[2] = vehicle->velocity[2]; +} + +void handle_vehicle_interactions(s32 playerId, Player* player, VehicleStuff* vehicle, f32 distanceX, f32 distanceY, + s32 vehicleCount, u32 soundBits) { + f32 deltaX; + f32 deltaZ; + f32 deltaY; + + s32 i; + + f32 playerX; + f32 playerY; + f32 playerZ; + + if (((D_801631E0[playerId] != true) || ((((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_CPU))) && + !(player->effects & EXPLOSION_CRASH_EFFECT)) { + + playerX = player->pos[0]; + playerY = player->pos[1]; + playerZ = player->pos[2]; + + for (i = 0; i < vehicleCount; i++) { + deltaX = playerX - vehicle->position[0]; + deltaY = playerY - vehicle->position[1]; + deltaZ = playerZ - vehicle->position[2]; + + if (((deltaX) > -100.0) && ((deltaX) < 100.0)) { + if ((deltaY > -20.0) && (deltaY < 20.0)) { + if (((deltaZ) > -100.0) && ((deltaZ) < 100.0)) { + if (is_collide_with_vehicle(vehicle->position[0], vehicle->position[2], vehicle->velocity[0], + vehicle->velocity[2], distanceX, distanceY, playerX, + playerZ) == (s32) 1) { + player->triggers |= VERTICAL_TUMBLE_TRIGGER; + } + } + } + } + + // Human player specific interactions + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { + if (((deltaX) > -300.0) && ((deltaX) < 300.0) && ((deltaY > -20.0)) && (deltaY < 20.0) && + (((deltaZ) > -300.0)) && ((deltaZ) < 300.0)) { + if ((sVehicleSoundRenderCounter > 0) && (vehicle->someFlags == 0)) { + sVehicleSoundRenderCounter--; + vehicle->someFlags |= (RENDER_VEHICLE << playerId); + func_800C9D80(vehicle->position, vehicle->velocity, soundBits); + } + } else { + if (vehicle->someFlags != 0) { + vehicle->someFlags &= ~(RENDER_VEHICLE << playerId); + if (vehicle->someFlags == 0) { + sVehicleSoundRenderCounter++; + func_800C9EF4(vehicle->position, soundBits); + } + } + } + + if (((deltaX) > -200.0) && ((deltaX) < 200.0) && ((deltaY > -20.0)) && (deltaY < 20.0) && + (((deltaZ) > -200.0)) && ((deltaZ) < 200.0)) { + if (!(vehicle->someFlagsTheSequel & ((1 << playerId)))) { + + bool shouldInteract = false; + u16 path = gPathCountByPathIndex[0]; + s32 t1; + s32 t2; + + switch (gIsInExtra) { + case false: + t1 = is_path_point_in_range(vehicle->pathPointIndex, + gNearestPathPointByPlayerId[playerId], 10, 0, path); + if ((gIsPlayerWrongDirection[playerId] == 0) && (t1 > 0) && + (player->speed < vehicle->speed)) { + shouldInteract = true; + } + if ((gIsPlayerWrongDirection[playerId] == 1) && (t1 > 0)) { + shouldInteract = true; + } + break; + case true: + t2 = is_path_point_in_range(vehicle->pathPointIndex, + gNearestPathPointByPlayerId[playerId], 0, 10, path); + if (t2 > 0) { + if (random_int(2) == 0) { + // temp_v1_2 = gIsPlayerWrongDirection[playerId]; + if (gIsPlayerWrongDirection[playerId] == 0) { + shouldInteract = true; + } + if ((gIsPlayerWrongDirection[playerId] == 1) && + (player->speed < vehicle->speed)) { + shouldInteract = true; + } + } else { + vehicle->someFlagsTheSequel |= ((1 << playerId)); + } + } + break; + } + if (shouldInteract == true) { + + u32 soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3B); + + switch (soundBits) { + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x05): + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3B); + if (random_int(4) == 0) { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3C); + } + break; + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x02): + if (random_int(2) != 0) { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3D); + } else { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3E); + } + break; + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03): + if (random_int(2) != 0) { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3F); + } else { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x40); + } + break; + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x04): + if (random_int(2) != 0) { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x41); + } else { + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x42); + } + break; + } + vehicle->someFlagsTheSequel |= ((1 << playerId)); + func_800C98B8(vehicle->position, vehicle->velocity, soundBits2); + } + } + } else { + if (vehicle->someFlagsTheSequel & ((1 << playerId))) { + vehicle->someFlagsTheSequel &= ~((1 << playerId)); + } + } + } + vehicle++; + } + } +} + +f32 player_track_position_factor_vehicle(s16 someType, f32 arg1, s16 pathIndex) { + if (pathIndex < 0x28A) { + switch (someType) { + case 0: + if (arg1 < 0.0) { + arg1 = 0.0f; + } + break; + case 1: + if (arg1 < 0.0) { + arg1 = -0.8f; + } else { + arg1 = 0.8f; + } + break; + case 2: + if (arg1 >= 0.0) { + arg1 = 0.0f; + } + break; + default: + break; + } + } else { + switch (someType) { + case 0: + case 1: + arg1 = 0.5f; + break; + case 2: + arg1 = -0.5f; + break; + default: + break; + } + } + return arg1; +} + +void update_player_track_position_factor_from_vehicle(s32 playerId, s32 vehicleCount, VehicleStuff* vehicle) { + UNUSED s32 var_v1; + s32 pathPointOffset; + s32 var_s2; + s32 pathPointCount; + u16 vehiclePathPoint; + UNUSED VehicleStuff* tempVehicle; + + pathPointCount = gPathCountByPathIndex[0]; + if (!(gPlayers[playerId].speed < 1.6666666666666667)) { + for (var_s2 = 0; var_s2 < vehicleCount; var_s2++, vehicle++) { + vehiclePathPoint = vehicle->pathPointIndex; + for (pathPointOffset = 0; pathPointOffset < 0x18; pathPointOffset += 3) { + if (((sSomeNearestPathPoint + pathPointOffset) % pathPointCount) == vehiclePathPoint) { + gPlayerTrackPositionFactorInstruction[playerId].target = player_track_position_factor_vehicle( + vehicle->someType, gTrackPositionFactor[playerId], vehiclePathPoint); + return; + } + } + } + } +} + +void init_vehicles_box_trucks(void) { + f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; + f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; + s32 numTrucks = NUM_RACE_BOX_TRUCKS; + if (gModeSelection == TIME_TRIALS) { + numTrucks = NUM_TIME_TRIAL_BOX_TRUCKS; + } + initialize_toads_turnpike_vehicle(a, b, numTrucks, 0, gBoxTruckList, &gTrackPaths[0][0]); +} + +void update_vehicle_box_trucks(void) { + s32 loopIndex; + for (loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) { + update_vehicle_follow_path_point(&gBoxTruckList[loopIndex]); + } +} + +void handle_box_trucks_interactions(s32 playerId, Player* player) { + handle_vehicle_interactions(playerId, player, gBoxTruckList, 55.0f, 12.5f, NUM_RACE_BOX_TRUCKS, + SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03)); +} + +void update_player_track_position_factor_from_box_trucks(s32 playerId) { + update_player_track_position_factor_from_vehicle(playerId, NUM_RACE_BOX_TRUCKS, gBoxTruckList); +} + +void init_vehicles_school_buses(void) { + s32 numBusses; + f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; + f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; + + numBusses = NUM_RACE_SCHOOL_BUSES; + if (gModeSelection == TIME_TRIALS) { + numBusses = NUM_TIME_TRIAL_SCHOOL_BUSES; + } + initialize_toads_turnpike_vehicle(a, b, numBusses, 75, gSchoolBusList, &gTrackPaths[0][0]); +} + +void update_vehicle_school_bus(void) { + s32 loopIndex; + for (loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) { + update_vehicle_follow_path_point(&gSchoolBusList[loopIndex]); + } +} + +void handle_school_buses_interactions(s32 playerId, Player* player) { + handle_vehicle_interactions(playerId, player, gSchoolBusList, 70.0f, 12.5f, NUM_RACE_SCHOOL_BUSES, + SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x02)); +} + +void update_player_track_position_factor_from_buses(s32 playerId) { + update_player_track_position_factor_from_vehicle(playerId, NUM_RACE_SCHOOL_BUSES, gSchoolBusList); +} + +void init_vehicles_trucks(void) { + s32 numTrucks; + f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; + f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; + + numTrucks = NUM_RACE_TANKER_TRUCKS; + if (gModeSelection == TIME_TRIALS) { + numTrucks = NUM_TIME_TRIAL_TANKER_TRUCKS; + } + initialize_toads_turnpike_vehicle(a, b, numTrucks, 50, gTankerTruckList, &gTrackPaths[0][0]); +} + +void update_vehicle_tanker_trucks(void) { + s32 loopIndex; + for (loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) { + update_vehicle_follow_path_point(&gTankerTruckList[loopIndex]); + } +} + +void handle_tanker_trucks_interactions(s32 playerId, Player* player) { + handle_vehicle_interactions(playerId, player, gTankerTruckList, 55.0f, 12.5f, NUM_RACE_TANKER_TRUCKS, + SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x04)); +} + +void update_player_track_position_factor_from_tanker_truck(s32 playerId) { + update_player_track_position_factor_from_vehicle(playerId, NUM_RACE_TANKER_TRUCKS, gTankerTruckList); +} + +void init_vehicles_cars(void) { + s32 numCars; + f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333; + f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665; + + numCars = NUM_RACE_CARS; + if (gModeSelection == TIME_TRIALS) { + numCars = NUM_TIME_TRIAL_CARS; + } + initialize_toads_turnpike_vehicle(a, b, numCars, 25, gCarList, &gTrackPaths[0][0]); +} + +void update_vehicle_cars(void) { + s32 loopIndex; + for (loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) { + update_vehicle_follow_path_point(&gCarList[loopIndex]); + } +} + +void handle_cars_interactions(s32 playerId, Player* player) { + handle_vehicle_interactions(playerId, player, gCarList, 11.5f, 8.5f, NUM_RACE_CARS, + SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x05)); +} + +void update_player_track_position_factor_from_cars(s32 playerId) { + update_player_track_position_factor_from_vehicle(playerId, NUM_RACE_CARS, gCarList); +} diff --git a/src/crash_screen.c b/src/crash_screen.c index 933c6915fa..18a4cab311 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -55,32 +55,33 @@ void crash_screen_draw_glyph(u16* framebuffer, s32 x, s32 y, s32 glyph) { } void crash_screen_draw_square(u16* framebuffer); -// Functionally Equivallent. -#ifdef NON_MATCHING -// 0xRGBA (I think A maybe not). #define WHITE_COLOUR 0xFFFF #define RED_COLOUR 0xF801 -/** - * The big mismatch is the handling of the '6' used in the if statement - * In the target assembly that 6 is saved to 5 different temp registers, - * while in this non-matching decomp its only saved to one temp register. - * This seems to be related to how the innermost for loop is unrolled, but - * its not clear why the target assembley would save the same immediate to - * 5 different registers instead of just re-using one - * There's some stack related differences too, maybe that's related? - **/ +// (x,y) of top left pixel of square +#define SQUARE_X 40 +#define SQUARE_Y 40 + +#define SQUARE_SIZE_X 6 +#define SQUARE_SIZE_Y 6 + +// width of the square's border being drawn. +#define BORDER_WIDTH 1 + +#define SQUARE_X2 SQUARE_X + SQUARE_SIZE_Y +#define SQUARE_Y2 SQUARE_Y + SQUARE_SIZE_X + +// Here's to you, Yoshimoto, for writing this stupid function. 3 years. 3 years to match. void crash_screen_draw_square(u16* framebuffer) { - s32 s0_end; - s32 s2_start; - s32 row; - s32 column; - - for (s2_start = 0x28, s0_end = s2_start + 6; s0_end != 0x2C; s0_end--, s2_start++) { - for (row = s2_start; row < s0_end; row++) { - for (column = s2_start; column < s0_end; column++) { - framebuffer[row * 320 + column] = s0_end - s2_start == 6 ? 0xF801 : 0xFFFF; + s32 h; + s32 i; + s32 j; + + for (h = 0; h < 2; h++) { + for (i = (h * BORDER_WIDTH) + SQUARE_Y; i < (SQUARE_Y2 - (h * BORDER_WIDTH)); i++) { + for (j = (h * BORDER_WIDTH) + SQUARE_X; j < (SQUARE_X2 - (h * BORDER_WIDTH)); j++) { + framebuffer[(i * 320) + j] = (h == 0) ? (RED_COLOUR) : (WHITE_COLOUR); } } } @@ -88,9 +89,6 @@ void crash_screen_draw_square(u16* framebuffer) { osWritebackDCacheAll(); osViSwapBuffer(framebuffer); } -#else -GLOBAL_ASM("asm/non_matchings/crash_screen/crash_screen_draw_square.s") -#endif /** * Draws three black boxes then prints crash info in the following format: diff --git a/src/data/data_segment2.c b/src/data/data_segment2.c index 1591dfd25c..bbec5aa746 100644 --- a/src/data/data_segment2.c +++ b/src/data/data_segment2.c @@ -101,6 +101,7 @@ Gfx D_02007818[] = { gsSPEndDisplayList(), }; +#ifndef AVOID_UB Gfx D_02007838[] = { gsSPVertex(D_02007BB8, 2, 0), gsSPVertex(&D_02007BB8[2], 2, 2), @@ -158,321 +159,194 @@ Gfx D_02007918[] = { }; Gfx D_02007938[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[20], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[2], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007958[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[22], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[4], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007978[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[24], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[6], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007998[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[26], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[8], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_020079B8[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[28], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[10], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_020079D8[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[30], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[12], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_020079F8[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[32], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[14], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007A18[] = { - gsSPVertex(&D_02007BB8[18], 2, 0), - gsSPVertex(&D_02007BB8[34], 2, 2), + gsSPVertex(D_02007CD8, 2, 0), + gsSPVertex(&D_02007CD8[16], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007A38[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[38], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[2], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007A58[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[40], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[4], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007A78[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[42], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[6], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007A98[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[44], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[8], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007AB8[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[46], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[10], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007AD8[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[48], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[12], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007AF8[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[50], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[14], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; Gfx D_02007B18[] = { - gsSPVertex(&D_02007BB8[36], 2, 0), - gsSPVertex(&D_02007BB8[52], 2, 2), + gsSPVertex(D_02007DF8, 2, 0), + gsSPVertex(&D_02007DF8[16], 2, 2), gsSPDisplayList(common_rectangle_display), gsSPEndDisplayList(), }; +#endif UNUSED Vtx D_02007B38[] = { { { { 0, 0, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 16, 0, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 16, 16, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 0, 16, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, +}; + +UNUSED Vtx D_02007B78[] = { { { { 0, -8, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 8, -8, 0 }, 0, { 448, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 8, 0, 0 }, 0, { 448, 448 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 448 }, { 0xff, 0x00, 0x00, 0xff } } }, }; -#ifdef AVOID_UB -Vtx D_02007BB8[] = { - { { { 0, 65520, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 26, 65520, 0 }, 0, { 1600, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 65520, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 16, 65520, 0 }, 0, { 960, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 65504, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 30, 65504, 0 }, 0, { 1856, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0x00, 0x00, 0xff, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0x00, 0x00, 0xff, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0x00, 0xff, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0x00, 0xff, 0x00, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0xff, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0xff, 0x00, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, - { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; -#else Vtx D_02007BB8[] = { - { { { 0, 65520, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 26, 65520, 0 }, 0, { 1600, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, -}; - -Vtx D_02007BD8[] = { + { { { 0, -16, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, + { { { 26, -16, 0 }, 0, { 1600, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, -}; - -Vtx D_02007BF8[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, -}; - -Vtx D_02007C18[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007C38[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, -}; - -Vtx D_02007C58[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007C78[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007C98[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007CB8[] = { { { { 26, 0, 0 }, 0, { 1600, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, }; Vtx D_02007CD8[] = { - { { { 0, 65520, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 16, 65520, 0 }, 0, { 960, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, -}; - -Vtx D_02007CF8[] = { + { { { 0, -16, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, + { { { 16, -16, 0 }, 0, { 960, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 16, 0, 0 }, 0, { 960, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0x00, 0xff, 0xff } } }, -}; - -Vtx D_02007D18[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0x00, 0xff, 0x00, 0xff } } }, -}; - -Vtx D_02007D38[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007D58[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0xff, 0x00, 0xff } } }, -}; - -Vtx D_02007D78[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007D98[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007DB8[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007DD8[] = { { { { 16, 0, 0 }, 0, { 960, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 960 }, { 0xff, 0x00, 0x00, 0xff } } }, }; Vtx D_02007DF8[] = { - { { { 0, 65504, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, - { { { 30, 65504, 0 }, 0, { 1856, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, -}; - -Vtx D_02007E18[] = { + { { { 0, -32, 0 }, 0, { 0, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, + { { { 30, -32, 0 }, 0, { 1856, 0 }, { 0xff, 0xff, 0xff, 0xff } } }, { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0x00, 0x00, 0xff, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0x00, 0x00, 0xff, 0xff } } }, -}; - -Vtx D_02007E38[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0x00, 0xff, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0x00, 0xff, 0x00, 0xff } } }, -}; - -Vtx D_02007E58[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007E78[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0xff, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0xff, 0x00, 0xff } } }, -}; - -Vtx D_02007E98[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007EB8[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007ED8[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, -}; - -Vtx D_02007EF8[] = { { { { 30, 0, 0 }, 0, { 1856, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, { { { 0, 0, 0 }, 0, { 0, 1984 }, { 0xff, 0x00, 0x00, 0xff } } }, }; -#endif Gfx D_02007F18[] = { gsDPPipeSync(), diff --git a/src/data/path_spawn_metadata.c b/src/data/path_spawn_metadata.c index bc397d0dc0..375a283bb5 100644 --- a/src/data/path_spawn_metadata.c +++ b/src/data/path_spawn_metadata.c @@ -2,36 +2,44 @@ #include "courses/all_course_data.h" #include +#if !ENABLE_CUSTOM_COURSE_ENGINE // @warning Array contains an extra zero element at the end. -KartAIBehaviour* gKartAIBehaviourLUT[] = { -#include "assets/course_metadata/gKartAIBehaviourLUT.inc.c" +CPUBehaviour* cpu_BehaviourLUT[] = { +#include "assets/course_metadata/cpu_BehaviourLUT.inc.c" }; +#else -TrackWaypoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 }; +#endif -TrackWaypoint* gCoursePathTable[][4] = { +TrackPathPoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 }; + +#if !ENABLE_CUSTOM_COURSE_ENGINE +TrackPathPoint* gCoursePathTable[][4] = { #include "assets/course_metadata/gCoursePathTableUnknown.inc.c" }; -TrackWaypoint* gCoursePathTable2[][4] = { +TrackPathPoint* gCoursePathTable2[][4] = { #include "assets/course_metadata/gCoursePathTable.inc.c" }; -// @warning Array contains an extra zero element at the end. -s16 gKartAISteeringSensitivity[] = { -#include "assets/course_metadata/gCPUSteeringSensitivity.inc.c" +/// @warning Array contains an extra zero element at the end. +s16 cpu_SteeringSensitivity[] = { +#include "assets/course_metadata/cpu_SteeringSensitivity.inc.c" }; // Possibly maximum cpu separation -f32 gKartAICourseMaximumSeparation[] = { -#include "assets/course_metadata/gKartAICourseMaximumSeparation.inc.c" +f32 cpu_CourseMaximumSeparation[] = { +#include "assets/course_metadata/cpu_CourseMaximumSeparation.inc.c" }; // Possibly minimum cpu separation -f32 gKartAICourseMinimumSeparation[] = { -#include "assets/course_metadata/gKartAICourseMinimumSeparation.inc.c" +f32 cpu_CourseMinimumSeparation[] = { +#include "assets/course_metadata/cpu_CourseMinimumSeparation.inc.c" }; +#else + +#endif // I think the types for D_800DCAF4, D_800DCB34, and D_800DCBB4 are all // wrong in some way based on their usage in func_800088D8 @@ -60,9 +68,13 @@ BombKartSpawn gBombKartSpawns[][NUM_BOMB_KARTS_MAX] = { #include "assets/course_metadata/gBombKartSpawns.inc.c" }; +#if !ENABLE_CUSTOM_COURSE_ENGINE struct _struct_gCoursePathSizes_0x10 gCoursePathSizes[] = { #include "assets/course_metadata/gCoursePathSizes.inc.c" }; +#else + +#endif s32 D_800DDB20 = 0x00000000; diff --git a/src/data/path_spawn_metadata.h b/src/data/path_spawn_metadata.h index cbddae31f6..e8fa2c2bb6 100644 --- a/src/data/path_spawn_metadata.h +++ b/src/data/path_spawn_metadata.h @@ -1,32 +1,15 @@ #ifndef PATH_SPAWN_METADATA_H #define PATH_SPAWN_METADATA_H -#include "waypoints.h" +#include "path.h" #include #include #include "include/bomb_kart.h" -struct _struct_gCoursePathSizes_0x10 { - /* 0x00 */ u16 unk0; - /* 0x02 */ u16 unk2; - /* 0x04 */ u16 unk4; - /* 0x06 */ u16 unk6; - /* 0x08 */ u16 unk8; - /* 0x0A */ char padA[6]; -}; // size 0x10 - -extern KartAIBehaviour* gKartAIBehaviourLUT[]; -extern TrackWaypoint nullPath; -extern TrackWaypoint* gCoursePathTable[][4]; -extern TrackWaypoint* gCoursePathTable2[][4]; -extern s16 gKartAISteeringSensitivity[]; -extern f32 gKartAICourseMaximumSeparation[]; -extern f32 gKartAICourseMinimumSeparation[]; +extern TrackPathPoint nullPath; extern s16 D_800DCAF4[]; extern s16 D_800DCB34[]; -extern s16* D_800DCBB4[]; extern BombKartSpawn gBombKartSpawns[][NUM_BOMB_KARTS_MAX]; -extern struct _struct_gCoursePathSizes_0x10 gCoursePathSizes[]; extern s32 D_800DDB20; extern s32 D_800DDB24; diff --git a/src/data/some_data.c b/src/data/some_data.c index 883c88dc88..261bc2cd34 100644 --- a/src/data/some_data.c +++ b/src/data/some_data.c @@ -1,6 +1,6 @@ #include "some_data.h" -Vtx D_800E49C0[] = { +Vtx gPlayerOneVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -19,7 +19,7 @@ Vtx D_800E49C0[] = { { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -Vtx D_800E4AC0[] = { +Vtx gPlayerTwoVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -38,7 +38,7 @@ Vtx D_800E4AC0[] = { { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -Vtx D_800E4BC0[] = { +Vtx gPlayerThreeVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -57,7 +57,7 @@ Vtx D_800E4BC0[] = { { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -Vtx D_800E4CC0[] = { +Vtx gPlayerFourVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -76,7 +76,7 @@ Vtx D_800E4CC0[] = { { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -Vtx D_800E4DC0[] = { +Vtx gPlayerFiveVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -95,7 +95,7 @@ Vtx D_800E4DC0[] = { { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -Vtx D_800E4EC0[] = { +Vtx gPlayerSixVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -112,10 +112,10 @@ Vtx D_800E4EC0[] = { { { { 9, 0, -6 }, 0, { 0, 1792 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 0, -6 }, 0, { 4032, 1792 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, - { { { -9, 9, -6 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0x60 } } }, + { { { -9, 9, -6 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0x60 } } }, // useless }; -Vtx D_800E4FD0[] = { +Vtx gPlayerSevenVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -134,7 +134,7 @@ Vtx D_800E4FD0[] = { { { { -9, 9, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -Vtx D_800E50D0[] = { +Vtx gPlayerEightVtx[] = { { { { 9, 18, -6 }, 0, { 4032, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { 9, 9, -6 }, 0, { 4032, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, { { { -9, 9, -6 }, 0, { 0, 1984 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, @@ -186,13 +186,11 @@ u8 D_800E52D0[] = { }; u8* gCourseOutlineTextures[] = { - gTextureCourseOutlineMarioRaceway, gTextureCourseOutlineChocoMountain, gTextureCourseOutlineBowsersCastle, - gTextureCourseOutlineBansheeBoardwalk, gTextureCourseOutlineYoshiValley, gTextureCourseOutlineFrappeSnowland, - gTextureCourseOutlineKoopaTroopaBeach, gTextureCourseOutlineRoyalRaceway, gTextureCourseOutlineLuigiRaceway, - gTextureCourseOutlineMooMooFarm, gTextureCourseOutlineToadsTurnpike, gTextureCourseOutlineKalimariDesert, - gTextureCourseOutlineSherbetLand, gTextureCourseOutlineRainbowRoad, gTextureCourseOutlineWarioStadium, - gTextureCourseOutlineBlockFort, gTextureCourseOutlineSkyscraper, gTextureCourseOutlineDoubleDeck, - gTextureCourseOutlineDksJungleParkway, gTextureCourseOutlineBigDonut, + minimap_mario_raceway, minimap_choco_mountain, minimap_bowsers_castle, minimap_banshee_boardwalk, + minimap_yoshi_valley, minimap_frappe_snowland, minimap_koopa_troopa_beach, minimap_royal_raceway, + minimap_luigi_raceway, minimap_moo_moo_farm, minimap_toads_turnpike, minimap_kalimari_desert, + minimap_sherbet_land, minimap_rainbow_road, minimap_wario_stadium, minimap_block_fort, + minimap_skyscraper, minimap_double_deck, minimap_dks_jungle_parkway, minimap_big_donut, }; s16 D_800E5520[] = { @@ -301,14 +299,20 @@ ThwompSpawn gThomwpSpawns150CC[] = { { 0x0596, 0xf92f, 0x0006, 0x0000 }, { 0x082a, 0xf9f2, 0x0005, 0x0000 }, { 0x073a, 0xf9f2, 0x0005, 0x0001 }, }; -f32 D_800E594C[][2] = { - { -8.0, 8.0 }, - { 8.0, 8.0 }, - { 0.0, 0.0 }, - { 8.0, -8.0 }, - { -8.0, -8.0 }, +f32 D_800E594C[] = { + -8.0, + 8.0, + 8.0, + 8.0, + 0.0, + 0.0, + 8.0, + -8.0, + -8.0, + -8.0, // This feels super fake, but it matches - { -0.0, 0.0 }, + -0.0, + 0.0, }; s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 }; @@ -445,11 +449,9 @@ s8 D_800E5DB4[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -YVFlagPoleSpawn D_800E5DF4[] = { - { { 0xfc7a, 0x0046, 0xfa82 }, 0x3800 }, - { { 0xfc4c, 0x0046, 0xfa03 }, 0x3800 }, - { { 0xf786, 0x0000, 0x02d3 }, 0x0400 }, - { { 0xf76f, 0x0000, 0x02f9 }, 0x0400 }, +s16 D_800E5DF4[] = { + 0xfc7a, 0x0046, 0xfa82, 0x3800, 0xfc4c, 0x0046, 0xfa03, 0x3800, + 0xf786, 0x0000, 0x02d3, 0x0400, 0xf76f, 0x0000, 0x02f9, 0x0400, }; HegdehogSpawn gHedgehogSpawns[] = { @@ -665,10 +667,10 @@ SplineData* D_800E6724[] = { &D_800E641C, &D_800E64D8 }; SplineData* D_800E672C[] = { &D_800E659C, &D_800E6668 }; -// I believe they're the positions of the static neon signs in rainbow road -Vec3f D_800E6734[] = { - { 1443.0, 1044.0, -5478.0 }, { 1678.0, 1012.0, -4840.0 }, { -3924.0, 921.0, 2566.0 }, { -3311.0, 790.0, 3524.0 }, - { -1284.0, 1341.0, 4527.0 }, { 2268.0, 1041.0, 4456.0 }, { 2820.0, 1109.0, 1985.0 }, +// Positions of the neon signs in rainbow road +float D_800E6734[] = { + 1443.0, 1044.0, -5478.0, 1678.0, 1012.0, -4840.0, -3924.0, 921.0, 2566.0, -3311.0, 790.0, + 3524.0, -1284.0, 1341.0, 4527.0, 2268.0, 1041.0, 4456.0, 2820.0, 1109.0, 1985.0, }; // This should really be `extern Vec3s gTorchSpawns[];` diff --git a/src/data/some_data.h b/src/data/some_data.h index 9e5e294161..d1ec8262bd 100644 --- a/src/data/some_data.h +++ b/src/data/some_data.h @@ -6,14 +6,14 @@ #include "data/other_textures.h" #include "objects.h" -extern Vtx D_800E49C0[]; -extern Vtx D_800E4AC0[]; -extern Vtx D_800E4BC0[]; -extern Vtx D_800E4CC0[]; -extern Vtx D_800E4DC0[]; -extern Vtx D_800E4EC0[]; -extern Vtx D_800E4FD0[]; -extern Vtx D_800E50D0[]; +extern Vtx gPlayerOneVtx[]; +extern Vtx gPlayerTwoVtx[]; +extern Vtx gPlayerThreeVtx[]; +extern Vtx gPlayerFourVtx[]; +extern Vtx gPlayerFiveVtx[]; +extern Vtx gPlayerSixVtx[]; +extern Vtx gPlayerSevenVtx[]; +extern Vtx gPlayerEightVtx[]; extern Vtx D_800E51D0[]; extern Vtx D_800E5210[]; extern Vtx gBalloonVertexPlane1[]; @@ -35,7 +35,7 @@ extern s16 D_800E57F8[]; extern ThwompSpawn gThomwpSpawns50CC[]; extern ThwompSpawn gThwompSpawns100CCExtra[]; extern ThwompSpawn gThomwpSpawns150CC[]; -extern f32 D_800E594C[][2]; +extern f32 D_800E594C[]; extern u64 D_800E5974; extern s16 D_800E597C[]; extern SplineData D_800E5988; @@ -48,7 +48,7 @@ extern SplineData D_800E5D78; extern SplineData* D_800E5D9C[]; extern SplineData* D_800E5DB0; extern s8 D_800E5DB4[]; -extern YVFlagPoleSpawn D_800E5DF4[]; +extern s16 D_800E5DF4[]; extern HegdehogSpawn gHedgehogSpawns[]; extern Vec3s gHedgehogPatrolPoints[]; extern SnowmanSpawn gSnowmanSpawns[]; @@ -67,7 +67,7 @@ extern SplineData D_800E659C; extern SplineData D_800E6668; extern SplineData* D_800E6724[]; extern SplineData* D_800E672C[]; -extern Vec3f D_800E6734[]; +extern float D_800E6734[]; // This should really be `extern Vec3s gTorchSpawns[];` extern s16 gTorchSpawns[]; extern SplineData D_800E67B8; diff --git a/src/data/textures.c b/src/data/textures.c index bf39798ddd..647988d164 100644 --- a/src/data/textures.c +++ b/src/data/textures.c @@ -2,1434 +2,1434 @@ * @file textures.c * @brief Texture data. * start in ram 0x801978D0 - * look like link to code_80091750 + * look like link to menu_item */ #include "textures.h" /** - * @brief MkTexture of a tiny font texture of number 0 + * @brief MenuTexture of a tiny font texture of number 0 * */ -MkTexture D_02000000[2] = { - { 3, 0, gTextureTinyFont0, 8, 8, 0, 0, 0x75, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000000[2] = { + { 3, gTextureTinyFont0, 8, 8, 0, 0, 0x75, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 1 + * @brief MenuTexture of a tiny font texture of number 1 * */ -MkTexture D_02000028[2] = { - { 3, 0, gTextureTinyFont1, 8, 8, 0, 0, 0x49, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000028[2] = { + { 3, gTextureTinyFont1, 8, 8, 0, 0, 0x49, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 2 + * @brief MenuTexture of a tiny font texture of number 2 * */ -MkTexture D_02000050[2] = { - { 3, 0, gTextureTinyFont2, 8, 8, 0, 0, 0x73, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000050[2] = { + { 3, gTextureTinyFont2, 8, 8, 0, 0, 0x73, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 3 + * @brief MenuTexture of a tiny font texture of number 3 * */ -MkTexture D_02000078[2] = { - { 3, 0, gTextureTinyFont3, 8, 8, 0, 0, 0x70, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000078[2] = { + { 3, gTextureTinyFont3, 8, 8, 0, 0, 0x70, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 4 + * @brief MenuTexture of a tiny font texture of number 4 * */ -MkTexture D_020000A0[2] = { - { 3, 0, gTextureTinyFont4, 8, 8, 0, 0, 0x5a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020000A0[2] = { + { 3, gTextureTinyFont4, 8, 8, 0, 0, 0x5a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 5 + * @brief MenuTexture of a tiny font texture of number 5 * */ -MkTexture D_020000C8[2] = { - { 3, 0, gTextureTinyFont5, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020000C8[2] = { + { 3, gTextureTinyFont5, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 6 + * @brief MenuTexture of a tiny font texture of number 6 * */ -MkTexture D_020000F0[2] = { - { 3, 0, gTextureTinyFont6, 8, 8, 0, 0, 0x74, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020000F0[2] = { + { 3, gTextureTinyFont6, 8, 8, 0, 0, 0x74, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 7 + * @brief MenuTexture of a tiny font texture of number 7 * */ -MkTexture D_02000118[2] = { - { 3, 0, gTextureTinyFont7, 8, 8, 0, 0, 0x5e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000118[2] = { + { 3, gTextureTinyFont7, 8, 8, 0, 0, 0x5e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 8 + * @brief MenuTexture of a tiny font texture of number 8 * */ -MkTexture D_02000140[2] = { - { 3, 0, gTextureTinyFont8, 8, 8, 0, 0, 0x77, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000140[2] = { + { 3, gTextureTinyFont8, 8, 8, 0, 0, 0x77, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of number 9 + * @brief MenuTexture of a tiny font texture of number 9 * */ -MkTexture D_02000168[2] = { - { 3, 0, gTextureTinyFont9, 8, 8, 0, 0, 0x74, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000168[2] = { + { 3, gTextureTinyFont9, 8, 8, 0, 0, 0x74, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter A + * @brief MenuTexture of a tiny font texture of letter A * */ -MkTexture D_02000190[2] = { - { 3, 0, gTextureTinyFontA, 8, 8, 0, 0, 0x6b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000190[2] = { + { 3, gTextureTinyFontA, 8, 8, 0, 0, 0x6b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter B + * @brief MenuTexture of a tiny font texture of letter B * */ -MkTexture D_020001B8[2] = { - { 3, 0, gTextureTinyFontB, 8, 8, 0, 0, 0x7d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020001B8[2] = { + { 3, gTextureTinyFontB, 8, 8, 0, 0, 0x7d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter C + * @brief MenuTexture of a tiny font texture of letter C * */ -MkTexture D_020001E0[2] = { - { 3, 0, gTextureTinyFontC, 8, 8, 0, 0, 0x75, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020001E0[2] = { + { 3, gTextureTinyFontC, 8, 8, 0, 0, 0x75, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter D + * @brief MenuTexture of a tiny font texture of letter D * */ -MkTexture D_02000208[2] = { - { 3, 0, gTextureTinyFontD, 8, 8, 0, 0, 0x71, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000208[2] = { + { 3, gTextureTinyFontD, 8, 8, 0, 0, 0x71, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter E + * @brief MenuTexture of a tiny font texture of letter E * */ -MkTexture D_02000230[2] = { - { 3, 0, gTextureTinyFontE, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000230[2] = { + { 3, gTextureTinyFontE, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter F + * @brief MenuTexture of a tiny font texture of letter F * */ -MkTexture D_02000258[2] = { - { 3, 0, gTextureTinyFontF, 8, 8, 0, 0, 0x63, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000258[2] = { + { 3, gTextureTinyFontF, 8, 8, 0, 0, 0x63, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter G + * @brief MenuTexture of a tiny font texture of letter G * */ -MkTexture D_02000280[2] = { - { 3, 0, gTextureTinyFontG, 8, 8, 0, 0, 0x73, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000280[2] = { + { 3, gTextureTinyFontG, 8, 8, 0, 0, 0x73, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter H + * @brief MenuTexture of a tiny font texture of letter H * */ -MkTexture D_020002A8[2] = { - { 3, 0, gTextureTinyFontH, 8, 8, 0, 0, 0x78, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020002A8[2] = { + { 3, gTextureTinyFontH, 8, 8, 0, 0, 0x78, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter I + * @brief MenuTexture of a tiny font texture of letter I * */ -MkTexture D_020002D0[2] = { - { 3, 0, gTextureTinyFontI, 8, 8, 0, 0, 0x48, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020002D0[2] = { + { 3, gTextureTinyFontI, 8, 8, 0, 0, 0x48, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter J + * @brief MenuTexture of a tiny font texture of letter J * */ -MkTexture D_020002F8[2] = { - { 3, 0, gTextureTinyFontJ, 8, 8, 0, 0, 0x52, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020002F8[2] = { + { 3, gTextureTinyFontJ, 8, 8, 0, 0, 0x52, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter K + * @brief MenuTexture of a tiny font texture of letter K * */ -MkTexture D_02000320[2] = { - { 3, 0, gTextureTinyFontK, 8, 8, 0, 0, 0x6f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000320[2] = { + { 3, gTextureTinyFontK, 8, 8, 0, 0, 0x6f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter L + * @brief MenuTexture of a tiny font texture of letter L * */ -MkTexture D_02000348[2] = { - { 3, 0, gTextureTinyFontL, 8, 8, 0, 0, 0x4b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000348[2] = { + { 3, gTextureTinyFontL, 8, 8, 0, 0, 0x4b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter M + * @brief MenuTexture of a tiny font texture of letter M * */ -MkTexture D_02000370[2] = { - { 3, 0, gTextureTinyFontM, 8, 8, 0, 0, 0x7c, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000370[2] = { + { 3, gTextureTinyFontM, 8, 8, 0, 0, 0x7c, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter N + * @brief MenuTexture of a tiny font texture of letter N * */ -MkTexture D_02000398[2] = { - { 3, 0, gTextureTinyFontN, 8, 8, 0, 0, 0x7b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000398[2] = { + { 3, gTextureTinyFontN, 8, 8, 0, 0, 0x7b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter O + * @brief MenuTexture of a tiny font texture of letter O * */ -MkTexture D_020003C0[2] = { - { 3, 0, gTextureTinyFontO, 8, 8, 0, 0, 0x76, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020003C0[2] = { + { 3, gTextureTinyFontO, 8, 8, 0, 0, 0x76, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter P + * @brief MenuTexture of a tiny font texture of letter P * */ -MkTexture D_020003E8[2] = { - { 3, 0, gTextureTinyFontP, 8, 8, 0, 0, 0x6a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020003E8[2] = { + { 3, gTextureTinyFontP, 8, 8, 0, 0, 0x6a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter Q + * @brief MenuTexture of a tiny font texture of letter Q * */ -MkTexture D_02000410[2] = { - { 3, 0, gTextureTinyFontQ, 8, 8, 0, 0, 0x77, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000410[2] = { + { 3, gTextureTinyFontQ, 8, 8, 0, 0, 0x77, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter R + * @brief MenuTexture of a tiny font texture of letter R * */ -MkTexture D_02000438[2] = { - { 3, 0, gTextureTinyFontR, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000438[2] = { + { 3, gTextureTinyFontR, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter S + * @brief MenuTexture of a tiny font texture of letter S * */ -MkTexture D_02000460[2] = { - { 3, 0, gTextureTinyFontS, 8, 8, 0, 0, 0x70, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000460[2] = { + { 3, gTextureTinyFontS, 8, 8, 0, 0, 0x70, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter T + * @brief MenuTexture of a tiny font texture of letter T * */ -MkTexture D_02000488[2] = { - { 3, 0, gTextureTinyFontT, 8, 8, 0, 0, 0x54, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000488[2] = { + { 3, gTextureTinyFontT, 8, 8, 0, 0, 0x54, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter U + * @brief MenuTexture of a tiny font texture of letter U * */ -MkTexture D_020004B0[2] = { - { 3, 0, gTextureTinyFontU, 8, 8, 0, 0, 0x62, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020004B0[2] = { + { 3, gTextureTinyFontU, 8, 8, 0, 0, 0x62, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter V + * @brief MenuTexture of a tiny font texture of letter V * */ -MkTexture D_020004D8[2] = { - { 3, 0, gTextureTinyFontV, 8, 8, 0, 0, 0x5e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020004D8[2] = { + { 3, gTextureTinyFontV, 8, 8, 0, 0, 0x5e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter W + * @brief MenuTexture of a tiny font texture of letter W * */ -MkTexture D_02000500[2] = { - { 3, 0, gTextureTinyFontW, 8, 8, 0, 0, 0x7c, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000500[2] = { + { 3, gTextureTinyFontW, 8, 8, 0, 0, 0x7c, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter X + * @brief MenuTexture of a tiny font texture of letter X * */ -MkTexture D_02000528[2] = { - { 3, 0, gTextureTinyFontX, 8, 8, 0, 0, 0x6b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000528[2] = { + { 3, gTextureTinyFontX, 8, 8, 0, 0, 0x6b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter Y + * @brief MenuTexture of a tiny font texture of letter Y * */ -MkTexture D_02000550[2] = { - { 3, 0, gTextureTinyFontY, 8, 8, 0, 0, 0x51, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000550[2] = { + { 3, gTextureTinyFontY, 8, 8, 0, 0, 0x51, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of letter Z + * @brief MenuTexture of a tiny font texture of letter Z * */ -MkTexture D_02000578[2] = { - { 3, 0, gTextureTinyFontZ, 8, 8, 0, 0, 0x68, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000578[2] = { + { 3, gTextureTinyFontZ, 8, 8, 0, 0, 0x68, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '!' + * @brief MenuTexture of a tiny font texture of '!' * */ -MkTexture D_020005A0[2] = { - { 3, 0, gTextureTinyFontExclamationMark, 8, 8, 0, 0, 0x46, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020005A0[2] = { + { 3, gTextureTinyFontExclamationMark, 8, 8, 0, 0, 0x46, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '"' + * @brief MenuTexture of a tiny font texture of '"' * */ -MkTexture D_020005C8[2] = { - { 3, 0, gTextureTinyFontDoubleQuote, 8, 8, 0, 0, 0x37, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020005C8[2] = { + { 3, gTextureTinyFontDoubleQuote, 8, 8, 0, 0, 0x37, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '#' + * @brief MenuTexture of a tiny font texture of '#' * */ -MkTexture D_020005F0[2] = { - { 3, 0, gTextureTinyFontHash, 8, 8, 0, 0, 0x70, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020005F0[2] = { + { 3, gTextureTinyFontHash, 8, 8, 0, 0, 0x70, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of "'" + * @brief MenuTexture of a tiny font texture of "'" * */ -MkTexture D_02000618[2] = { - { 3, 0, gTextureTinyFontSingleQuote, 8, 8, 0, 0, 0x2f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000618[2] = { + { 3, gTextureTinyFontSingleQuote, 8, 8, 0, 0, 0x2f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '*' + * @brief MenuTexture of a tiny font texture of '*' * */ -MkTexture D_02000640[2] = { - { 3, 0, gTextureTinyFontAsterisk, 8, 8, 0, 0, 0x6a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000640[2] = { + { 3, gTextureTinyFontAsterisk, 8, 8, 0, 0, 0x6a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '+' + * @brief MenuTexture of a tiny font texture of '+' * */ -MkTexture D_02000668[2] = { - { 3, 0, gTextureTinyFontPlus, 8, 8, 0, 0, 0x51, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000668[2] = { + { 3, gTextureTinyFontPlus, 8, 8, 0, 0, 0x51, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000690[2] = { - { 3, 0, gTexture7EEB18, 8, 8, 0, 0, 0x30, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000690[2] = { + { 3, gTexture7EEB18, 8, 8, 0, 0, 0x30, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '-' + * @brief MenuTexture of a tiny font texture of '-' * */ -MkTexture D_020006B8[2] = { - { 3, 0, gTextureTinyFontMinus, 8, 8, 0, 0, 0x35, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020006B8[2] = { + { 3, gTextureTinyFontMinus, 8, 8, 0, 0, 0x35, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of ',' + * @brief MenuTexture of a tiny font texture of ',' * */ -MkTexture D_020006E0[2] = { - { 3, 0, gTextureTinyFontComma, 8, 8, 0, 0, 0x31, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020006E0[2] = { + { 3, gTextureTinyFontComma, 8, 8, 0, 0, 0x31, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '/' + * @brief MenuTexture of a tiny font texture of '/' * */ -MkTexture D_02000708[2] = { - { 3, 0, gTextureTinyFontForwardSlash, 8, 8, 0, 0, 0x4f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000708[2] = { + { 3, gTextureTinyFontForwardSlash, 8, 8, 0, 0, 0x4f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of ';' + * @brief MenuTexture of a tiny font texture of ';' * */ -MkTexture D_02000730[2] = { - { 3, 0, gTextureTinyFontColon, 8, 8, 0, 0, 0x38, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000730[2] = { + { 3, gTextureTinyFontColon, 8, 8, 0, 0, 0x38, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000758[2] = { - { 3, 0, gTexture7EEC34, 8, 8, 0, 0, 0x51, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000758[2] = { + { 3, gTexture7EEC34, 8, 8, 0, 0, 0x51, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a tiny font texture of '?' + * @brief MenuTexture of a tiny font texture of '?' * */ -MkTexture D_02000780[2] = { - { 3, 0, gTextureTinyFontQuestion, 8, 8, 0, 0, 0x60, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000780[2] = { + { 3, gTextureTinyFontQuestion, 8, 8, 0, 0, 0x60, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020007A8[2] = { - { 3, 0, gTexture7EECE4, 8, 8, 0, 0, 0x8f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020007A8[2] = { + { 3, gTexture7EECE4, 8, 8, 0, 0, 0x8f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020007D0[2] = { - { 3, 0, gTexture7EED74, 8, 8, 0, 0, 0x3d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020007D0[2] = { + { 3, gTexture7EED74, 8, 8, 0, 0, 0x3d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020007F8[2] = { - { 3, 0, gTexture7EEDB0, 8, 8, 0, 0, 0x37, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020007F8[2] = { + { 3, gTexture7EEDB0, 8, 8, 0, 0, 0x37, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000820[2] = { - { 3, 0, gTexture7EEDE8, 8, 8, 0, 0, 0x39, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000820[2] = { + { 3, gTexture7EEDE8, 8, 8, 0, 0, 0x39, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000848[2] = { - { 3, 0, gTexture7EEE20, 8, 8, 0, 0, 0x5b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000848[2] = { + { 3, gTexture7EEE20, 8, 8, 0, 0, 0x5b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000870[2] = { - { 3, 0, gTexture7EEE7C, 8, 8, 0, 0, 0x55, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000870[2] = { + { 3, gTexture7EEE7C, 8, 8, 0, 0, 0x55, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000898[2] = { - { 3, 0, gTexture7EEED0, 8, 8, 0, 0, 0x6a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000898[2] = { + { 3, gTexture7EEED0, 8, 8, 0, 0, 0x6a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020008C0[2] = { - { 3, 0, gTexture7EEF3C, 8, 8, 0, 0, 0x55, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020008C0[2] = { + { 3, gTexture7EEF3C, 8, 8, 0, 0, 0x55, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020008E8[2] = { - { 3, 0, gTexture7EEF90, 8, 8, 0, 0, 0x62, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020008E8[2] = { + { 3, gTexture7EEF90, 8, 8, 0, 0, 0x62, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000910[2] = { - { 3, 0, gTexture7EEFF4, 8, 8, 0, 0, 0x64, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000910[2] = { + { 3, gTexture7EEFF4, 8, 8, 0, 0, 0x64, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000938[2] = { - { 3, 0, gTexture7EF058, 8, 8, 0, 0, 0x5b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000938[2] = { + { 3, gTexture7EF058, 8, 8, 0, 0, 0x5b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000960[2] = { - { 3, 0, gTexture7EF0B4, 8, 8, 0, 0, 0x5d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000960[2] = { + { 3, gTexture7EF0B4, 8, 8, 0, 0, 0x5d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000988[2] = { - { 3, 0, gTexture7EF110, 8, 8, 0, 0, 0x6d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000988[2] = { + { 3, gTexture7EF110, 8, 8, 0, 0, 0x6d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020009B0[2] = { - { 3, 0, gTexture7EF17C, 8, 8, 0, 0, 0x73, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020009B0[2] = { + { 3, gTexture7EF17C, 8, 8, 0, 0, 0x73, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020009D8[2] = { - { 3, 0, gTexture7EF1F0, 8, 8, 0, 0, 0x5e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020009D8[2] = { + { 3, gTexture7EF1F0, 8, 8, 0, 0, 0x5e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000A00[2] = { - { 3, 0, gTexture7EF250, 8, 8, 0, 0, 0x69, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000A00[2] = { + { 3, gTexture7EF250, 8, 8, 0, 0, 0x69, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000A28[2] = { - { 3, 0, gTexture7EF2B8, 8, 8, 0, 0, 0x5b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000A28[2] = { + { 3, gTexture7EF2B8, 8, 8, 0, 0, 0x5b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000A50[2] = { - { 3, 0, gTexture7EF314, 8, 8, 0, 0, 0x73, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000A50[2] = { + { 3, gTexture7EF314, 8, 8, 0, 0, 0x73, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000A78[2] = { - { 3, 0, gTexture7EF388, 8, 8, 0, 0, 0x6f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000A78[2] = { + { 3, gTexture7EF388, 8, 8, 0, 0, 0x6f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000AA0[2] = { - { 3, 0, gTexture7EF3F8, 8, 8, 0, 0, 0x79, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000AA0[2] = { + { 3, gTexture7EF3F8, 8, 8, 0, 0, 0x79, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000AC8[2] = { - { 3, 0, gTexture7EF470, 8, 8, 0, 0, 0x74, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000AC8[2] = { + { 3, gTexture7EF470, 8, 8, 0, 0, 0x74, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000AF0[2] = { - { 3, 0, gTexture7EF4E4, 8, 8, 0, 0, 0x70, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000AF0[2] = { + { 3, gTexture7EF4E4, 8, 8, 0, 0, 0x70, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000B18[2] = { - { 3, 0, gTexture7EF554, 8, 8, 0, 0, 0x6c, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000B18[2] = { + { 3, gTexture7EF554, 8, 8, 0, 0, 0x6c, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000B40[2] = { - { 3, 0, gTexture7EF5C0, 8, 8, 0, 0, 0x61, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000B40[2] = { + { 3, gTexture7EF5C0, 8, 8, 0, 0, 0x61, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000B68[2] = { - { 3, 0, gTexture7EF620, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000B68[2] = { + { 3, gTexture7EF620, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000B90[2] = { - { 3, 0, gTexture7EF694, 8, 8, 0, 0, 0x74, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000B90[2] = { + { 3, gTexture7EF694, 8, 8, 0, 0, 0x74, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000BB8[2] = { - { 3, 0, gTexture7EF708, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000BB8[2] = { + { 3, gTexture7EF708, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000BE0[2] = { - { 3, 0, gTexture7EF77C, 8, 8, 0, 0, 0x6b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000BE0[2] = { + { 3, gTexture7EF77C, 8, 8, 0, 0, 0x6b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000C08[2] = { - { 3, 0, gTexture7EF7E8, 8, 8, 0, 0, 0x75, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000C08[2] = { + { 3, gTexture7EF7E8, 8, 8, 0, 0, 0x75, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000C30[2] = { - { 3, 0, gTexture7EF85C, 8, 8, 0, 0, 0x6b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000C30[2] = { + { 3, gTexture7EF85C, 8, 8, 0, 0, 0x6b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000C58[2] = { - { 3, 0, gTexture7EF8C8, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000C58[2] = { + { 3, gTexture7EF8C8, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000C80[2] = { - { 3, 0, gTexture7EF93C, 8, 8, 0, 0, 0x76, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000C80[2] = { + { 3, gTexture7EF93C, 8, 8, 0, 0, 0x76, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000CA8[2] = { - { 3, 0, gTexture7EF9B4, 8, 8, 0, 0, 0x78, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000CA8[2] = { + { 3, gTexture7EF9B4, 8, 8, 0, 0, 0x78, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000CD0[2] = { - { 3, 0, gTexture7EFA2C, 8, 8, 0, 0, 0x7b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000CD0[2] = { + { 3, gTexture7EFA2C, 8, 8, 0, 0, 0x7b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000CF8[2] = { - { 3, 0, gTexture7EFAA8, 8, 8, 0, 0, 0x57, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000CF8[2] = { + { 3, gTexture7EFAA8, 8, 8, 0, 0, 0x57, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000D20[2] = { - { 3, 0, gTexture7EFB00, 8, 8, 0, 0, 0x63, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000D20[2] = { + { 3, gTexture7EFB00, 8, 8, 0, 0, 0x63, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000D48[2] = { - { 3, 0, gTexture7EFB64, 8, 8, 0, 0, 0x57, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000D48[2] = { + { 3, gTexture7EFB64, 8, 8, 0, 0, 0x57, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000D70[2] = { - { 3, 0, gTexture7EFBBC, 8, 8, 0, 0, 0x75, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000D70[2] = { + { 3, gTexture7EFBBC, 8, 8, 0, 0, 0x75, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000D98[2] = { - { 3, 0, gTexture7EFC30, 8, 8, 0, 0, 0x7b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000D98[2] = { + { 3, gTexture7EFC30, 8, 8, 0, 0, 0x7b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000DC0[2] = { - { 3, 0, gTexture7EFCAC, 8, 8, 0, 0, 0x53, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000DC0[2] = { + { 3, gTexture7EFCAC, 8, 8, 0, 0, 0x53, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000DE8[2] = { - { 3, 0, gTexture7EFD00, 8, 8, 0, 0, 0x60, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000DE8[2] = { + { 3, gTexture7EFD00, 8, 8, 0, 0, 0x60, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000E10[2] = { - { 3, 0, gTexture7EFD60, 8, 8, 0, 0, 0x75, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000E10[2] = { + { 3, gTexture7EFD60, 8, 8, 0, 0, 0x75, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000E38[2] = { - { 3, 0, gTexture7EFDD4, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000E38[2] = { + { 3, gTexture7EFDD4, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000E60[2] = { - { 3, 0, gTexture7EFE48, 8, 8, 0, 0, 0x57, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000E60[2] = { + { 3, gTexture7EFE48, 8, 8, 0, 0, 0x57, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000E88[2] = { - { 3, 0, gTexture7EFEA0, 8, 8, 0, 0, 0x8d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000E88[2] = { + { 3, gTexture7EFEA0, 8, 8, 0, 0, 0x8d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000EB0[2] = { - { 3, 0, gTexture7EFF2C, 8, 8, 0, 0, 0x63, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000EB0[2] = { + { 3, gTexture7EFF2C, 8, 8, 0, 0, 0x63, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000ED8[2] = { - { 3, 0, gTexture7EFF90, 8, 8, 0, 0, 0x70, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000ED8[2] = { + { 3, gTexture7EFF90, 8, 8, 0, 0, 0x70, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000F00[2] = { - { 3, 0, gTexture7F0000, 8, 8, 0, 0, 0x6d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000F00[2] = { + { 3, gTexture7F0000, 8, 8, 0, 0, 0x6d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000F28[2] = { - { 3, 0, gTexture7F006C, 8, 8, 0, 0, 0x6a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000F28[2] = { + { 3, gTexture7F006C, 8, 8, 0, 0, 0x6a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000F50[2] = { - { 3, 0, gTexture7F00D8, 8, 8, 0, 0, 0x80, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000F50[2] = { + { 3, gTexture7F00D8, 8, 8, 0, 0, 0x80, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000F78[2] = { - { 3, 0, gTexture7F0158, 8, 8, 0, 0, 0x78, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000F78[2] = { + { 3, gTexture7F0158, 8, 8, 0, 0, 0x78, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000FA0[2] = { - { 3, 0, gTexture7F01D0, 8, 8, 0, 0, 0x6a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000FA0[2] = { + { 3, gTexture7F01D0, 8, 8, 0, 0, 0x6a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000FC8[2] = { - { 3, 0, gTexture7F023C, 8, 8, 0, 0, 0x78, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000FC8[2] = { + { 3, gTexture7F023C, 8, 8, 0, 0, 0x78, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02000FF0[2] = { - { 3, 0, gTexture7F02B4, 8, 8, 0, 0, 0x79, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02000FF0[2] = { + { 3, gTexture7F02B4, 8, 8, 0, 0, 0x79, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001018[2] = { - { 3, 0, gTexture7F032C, 8, 8, 0, 0, 0x63, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001018[2] = { + { 3, gTexture7F032C, 8, 8, 0, 0, 0x63, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001040[2] = { - { 3, 0, gTexture7F0390, 8, 8, 0, 0, 0x72, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001040[2] = { + { 3, gTexture7F0390, 8, 8, 0, 0, 0x72, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001068[2] = { - { 3, 0, gTexture7F0404, 8, 8, 0, 0, 0x6d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001068[2] = { + { 3, gTexture7F0404, 8, 8, 0, 0, 0x6d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001090[2] = { - { 3, 0, gTexture7F0470, 8, 8, 0, 0, 0x7d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001090[2] = { + { 3, gTexture7F0470, 8, 8, 0, 0, 0x7d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020010B8[2] = { - { 3, 0, gTexture7F04EC, 8, 8, 0, 0, 0x6e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020010B8[2] = { + { 3, gTexture7F04EC, 8, 8, 0, 0, 0x6e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020010E0[2] = { - { 3, 0, gTexture7F055C, 8, 8, 0, 0, 0x93, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020010E0[2] = { + { 3, gTexture7F055C, 8, 8, 0, 0, 0x93, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001108[2] = { - { 3, 0, gTexture7F05F0, 8, 8, 0, 0, 0x7f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001108[2] = { + { 3, gTexture7F05F0, 8, 8, 0, 0, 0x7f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001130[2] = { - { 3, 0, gTexture7F0670, 8, 8, 0, 0, 0x7b, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001130[2] = { + { 3, gTexture7F0670, 8, 8, 0, 0, 0x7b, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001158[2] = { - { 3, 0, gTexture7F06EC, 8, 8, 0, 0, 0x7a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001158[2] = { + { 3, gTexture7F06EC, 8, 8, 0, 0, 0x7a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001180[2] = { - { 3, 0, gTexture7F0768, 8, 8, 0, 0, 0x78, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001180[2] = { + { 3, gTexture7F0768, 8, 8, 0, 0, 0x78, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020011A8[2] = { - { 3, 0, gTexture7F07E0, 8, 8, 0, 0, 0x77, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020011A8[2] = { + { 3, gTexture7F07E0, 8, 8, 0, 0, 0x77, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020011D0[2] = { - { 3, 0, gTexture7F0858, 8, 8, 0, 0, 0x7f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020011D0[2] = { + { 3, gTexture7F0858, 8, 8, 0, 0, 0x7f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020011F8[2] = { - { 3, 0, gTexture7F08D8, 8, 8, 0, 0, 0x71, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020011F8[2] = { + { 3, gTexture7F08D8, 8, 8, 0, 0, 0x71, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001220[2] = { - { 3, 0, gTexture7F0948, 8, 8, 0, 0, 0x87, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001220[2] = { + { 3, gTexture7F0948, 8, 8, 0, 0, 0x87, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001248[2] = { - { 3, 0, gTexture7F09D0, 8, 8, 0, 0, 0x6d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001248[2] = { + { 3, gTexture7F09D0, 8, 8, 0, 0, 0x6d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001270[2] = { - { 3, 0, gTexture7F0A3C, 8, 8, 0, 0, 0x7e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001270[2] = { + { 3, gTexture7F0A3C, 8, 8, 0, 0, 0x7e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001298[2] = { - { 3, 0, gTexture7F0ABC, 8, 8, 0, 0, 0x77, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001298[2] = { + { 3, gTexture7F0ABC, 8, 8, 0, 0, 0x77, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020012C0[2] = { - { 3, 0, gTexture7F0B34, 8, 8, 0, 0, 0x7d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020012C0[2] = { + { 3, gTexture7F0B34, 8, 8, 0, 0, 0x7d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020012E8[2] = { - { 3, 0, gTexture7F0BB0, 8, 8, 0, 0, 0x75, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020012E8[2] = { + { 3, gTexture7F0BB0, 8, 8, 0, 0, 0x75, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001310[2] = { - { 3, 0, gTexture7F0C24, 8, 8, 0, 0, 0x71, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001310[2] = { + { 3, gTexture7F0C24, 8, 8, 0, 0, 0x71, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001338[2] = { - { 3, 0, gTexture7F0C94, 8, 8, 0, 0, 0x77, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001338[2] = { + { 3, gTexture7F0C94, 8, 8, 0, 0, 0x77, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001360[2] = { - { 3, 0, gTexture7F0D0C, 8, 8, 0, 0, 0x7f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001360[2] = { + { 3, gTexture7F0D0C, 8, 8, 0, 0, 0x7f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001388[2] = { - { 3, 0, gTexture7F0D8C, 8, 8, 0, 0, 0x61, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001388[2] = { + { 3, gTexture7F0D8C, 8, 8, 0, 0, 0x61, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020013B0[2] = { - { 3, 0, gTexture7F0DEC, 8, 8, 0, 0, 0x6e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020013B0[2] = { + { 3, gTexture7F0DEC, 8, 8, 0, 0, 0x6e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020013D8[2] = { - { 3, 0, gTexture7F0E5C, 8, 8, 0, 0, 0x87, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020013D8[2] = { + { 3, gTexture7F0E5C, 8, 8, 0, 0, 0x87, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001400[2] = { - { 3, 0, gTexture7F0EE4, 8, 8, 0, 0, 0x78, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001400[2] = { + { 3, gTexture7F0EE4, 8, 8, 0, 0, 0x78, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001428[2] = { - { 3, 0, gTexture7F0F5C, 8, 8, 0, 0, 0x7d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001428[2] = { + { 3, gTexture7F0F5C, 8, 8, 0, 0, 0x7d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001450[2] = { - { 3, 0, gTexture7F0FD8, 8, 8, 0, 0, 0x60, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001450[2] = { + { 3, gTexture7F0FD8, 8, 8, 0, 0, 0x60, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001478[2] = { - { 3, 0, gTexture7F1038, 8, 8, 0, 0, 0x65, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001478[2] = { + { 3, gTexture7F1038, 8, 8, 0, 0, 0x65, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020014A0[2] = { - { 3, 0, gTexture7F109C, 8, 8, 0, 0, 0x87, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020014A0[2] = { + { 3, gTexture7F109C, 8, 8, 0, 0, 0x87, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of bar ? + * @brief MenuTexture of bar ? * */ -MkTexture D_020014C8[6] = { - { 0, 0, gTextureGoldBar, 256, 40, 32, 25, 0xd4c, 0 }, { 0, 0, gTexturePinkBar, 90, 16, 65, 70, 0x468, 0 }, - { 0, 0, gTexturePinkBar, 90, 16, 164, 70, 0x468, 0 }, { 0, 0, gTexturePinkBar, 90, 16, 65, 200, 0x468, 0 }, - { 0, 0, gTexturePinkBar, 90, 16, 164, 200, 0x468, 0 }, { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020014C8[6] = { + { 0, gTextureGoldBar, 256, 40, 32, 25, 0xd4c, 0 }, { 0, gTexturePinkBar, 90, 16, 65, 70, 0x468, 0 }, + { 0, gTexturePinkBar, 90, 16, 164, 70, 0x468, 0 }, { 0, gTexturePinkBar, 90, 16, 65, 200, 0x468, 0 }, + { 0, gTexturePinkBar, 90, 16, 164, 200, 0x468, 0 }, { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of gold ? + * @brief MenuTexture of gold ? * */ -MkTexture D_02001540[3] = { - { 0, 0, gTextureGreenGoldStripe, 256, 29, 32, 91, 0xbec, 0 }, - { 0, 0, gTextureGoldStripe, 256, 15, 32, 180, 0x6f8, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001540[3] = { + { 0, gTextureGreenGoldStripe, 256, 29, 32, 91, 0xbec, 0 }, + { 0, gTextureGoldStripe, 256, 15, 32, 180, 0x6f8, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; -MkTexture D_0200157C[2] = { - { 0, 0, gTextureWhiteStripe, 256, 10, 0, 0, 0xe4, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200157C[2] = { + { 0, gTextureWhiteStripe, 256, 10, 0, 0, 0xe4, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020015A4[2] = { - { 3, 0, gTexture7ED50C, 256, 5, 32, 120, 0x196, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020015A4[2] = { + { 3, gTexture7ED50C, 256, 5, 32, 120, 0x196, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of select record ? + * @brief MenuTexture of select record ? * */ -MkTexture D_020015CC[5] = { - { 3, 0, gTextureSelectRecord, 68, 10, 75, 74, 0x378, 0 }, - { 3, 0, gTextureTextEnd, 20, 10, 200, 74, 0x12f, 0 }, - { 3, 0, gTextureTextErase, 28, 10, 96, 204, 0x19e, 0 }, - { 3, 0, gTextureTextQuit, 24, 10, 198, 204, 0x149, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020015CC[5] = { + { 3, gTextureSelectRecord, 68, 10, 75, 74, 0x378, 0 }, + { 3, gTextureTextEnd, 20, 10, 200, 74, 0x12f, 0 }, + { 3, gTextureTextErase, 28, 10, 96, 204, 0x19e, 0 }, + { 3, gTextureTextQuit, 24, 10, 198, 204, 0x149, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of select record ? + * @brief MenuTexture of select record ? * */ -MkTexture D_02001630[2] = { - { 3, 0, gTextureTableOfContents, 88, 10, 116, 94, 0x42d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001630[2] = { + { 3, gTextureTableOfContents, 88, 10, 116, 94, 0x42d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of select record ? + * @brief MenuTexture of select record ? * */ -MkTexture D_02001658[5] = { - { 3, 0, gTextureTextHash, 8, 10, 48, 108, 0x07e, 0 }, - { 3, 0, gTextureTextGameData, 56, 10, 132, 108, 0x2c4, 0 }, - { 3, 0, gTextureTextPages, 32, 10, 252, 108, 0x1c1, 0 }, - { 3, 0, gTextureTextPagesFree, 56, 10, 132, 184, 0x2c2, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001658[5] = { + { 3, gTextureTextHash, 8, 10, 48, 108, 0x07e, 0 }, + { 3, gTextureTextGameData, 56, 10, 132, 108, 0x2c4, 0 }, + { 3, gTextureTextPages, 32, 10, 252, 108, 0x1c1, 0 }, + { 3, gTextureTextPagesFree, 56, 10, 132, 184, 0x2c2, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 0 + * @brief MenuTexture of a small font texture of number 0 * */ -MkTexture D_020016BC[2] = { - { 3, 0, gTextureSmallFont0, 8, 9, 0, 0, 0x8e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020016BC[2] = { + { 3, gTextureSmallFont0, 8, 9, 0, 0, 0x8e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 1 + * @brief MenuTexture of a small font texture of number 1 * */ -MkTexture D_020016E4[2] = { - { 3, 0, gTextureSmallFont1, 8, 9, 0, 0, 0x59, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020016E4[2] = { + { 3, gTextureSmallFont1, 8, 9, 0, 0, 0x59, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 2 + * @brief MenuTexture of a small font texture of number 2 * */ -MkTexture D_0200170C[2] = { - { 3, 0, gTextureSmallFont2, 8, 9, 0, 0, 0x97, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200170C[2] = { + { 3, gTextureSmallFont2, 8, 9, 0, 0, 0x97, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 3 + * @brief MenuTexture of a small font texture of number 3 * */ -MkTexture D_02001734[2] = { - { 3, 0, gTextureSmallFont3, 8, 9, 0, 0, 0x95, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001734[2] = { + { 3, gTextureSmallFont3, 8, 9, 0, 0, 0x95, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 4 + * @brief MenuTexture of a small font texture of number 4 * */ -MkTexture D_0200175C[2] = { - { 3, 0, gTextureSmallFont4, 8, 9, 0, 0, 0x87, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200175C[2] = { + { 3, gTextureSmallFont4, 8, 9, 0, 0, 0x87, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 5 + * @brief MenuTexture of a small font texture of number 5 * */ -MkTexture D_02001784[2] = { - { 3, 0, gTextureSmallFont5, 8, 9, 0, 0, 0x99, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001784[2] = { + { 3, gTextureSmallFont5, 8, 9, 0, 0, 0x99, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 6 + * @brief MenuTexture of a small font texture of number 6 * */ -MkTexture D_020017AC[2] = { - { 3, 0, gTextureSmallFont6, 8, 9, 0, 0, 0x9a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020017AC[2] = { + { 3, gTextureSmallFont6, 8, 9, 0, 0, 0x9a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 7 + * @brief MenuTexture of a small font texture of number 7 * */ -MkTexture D_020017D4[2] = { - { 3, 0, gTextureSmallFont7, 8, 9, 0, 0, 0x70, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020017D4[2] = { + { 3, gTextureSmallFont7, 8, 9, 0, 0, 0x70, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 8 + * @brief MenuTexture of a small font texture of number 8 * */ -MkTexture D_020017FC[2] = { - { 3, 0, gTextureSmallFont8, 8, 9, 0, 0, 0x90, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020017FC[2] = { + { 3, gTextureSmallFont8, 8, 9, 0, 0, 0x90, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a small font texture of number 9 + * @brief MenuTexture of a small font texture of number 9 * */ -MkTexture D_02001824[2] = { - { 3, 0, gTextureSmallFont9, 8, 9, 0, 0, 0x9f, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001824[2] = { + { 3, gTextureSmallFont9, 8, 9, 0, 0, 0x9f, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200184C[2] = { - { 3, 0, gTexture7ED058, 96, 22, 0, 0, 0x238, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200184C[2] = { + { 3, gTexture7ED058, 96, 22, 0, 0, 0x238, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001874[2] = { - { 3, 0, gTexture7ED290, 248, 10, 0, 0, 0x27d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001874[2] = { + { 3, gTexture7ED290, 248, 10, 0, 0, 0x27d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of a n64 controller pak Data Select + * @brief MenuTexture of a n64 controller pak Data Select * */ -MkTexture D_0200189C[2] = { - { 3, 0, gTextureN64ControllerPakDataSelect, 180, 32, 70, 29, 0x1128, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200189C[2] = { + { 3, gTextureN64ControllerPakDataSelect, 180, 32, 70, 29, 0x1128, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of text Erase Data Record Confirmation + * @brief MenuTexture of text Erase Data Record Confirmation * */ -MkTexture D_020018C4[2] = { - { 3, 0, gTextureEraseDataRecordConfirmation, 180, 32, 70, 29, 0xff4, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020018C4[2] = { + { 3, gTextureEraseDataRecordConfirmation, 180, 32, 70, 29, 0xff4, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of text Record Not Erased + * @brief MenuTexture of text Record Not Erased * */ -MkTexture D_020018EC[2] = { - { 3, 0, gTextureRecordNotErased, 180, 32, 70, 29, 0x8d1, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020018EC[2] = { + { 3, gTextureRecordNotErased, 180, 32, 70, 29, 0x8d1, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of text Please Insert N64 Controller Pak + * @brief MenuTexture of text Please Insert N64 Controller Pak * */ -MkTexture D_02001914[2] = { - { 3, 0, gTexturePlaceN64ControllerPakIntoController1, 180, 32, 70, 29, 0xc4a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001914[2] = { + { 3, gTexturePlaceN64ControllerPakIntoController1, 180, 32, 70, 29, 0xc4a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of text Please Reinsert Original N64 Controller Pak + * @brief MenuTexture of text Please Reinsert Original N64 Controller Pak * */ -MkTexture D_0200193C[2] = { - { 3, 0, gTexturePleaseReinsertOriginalN64ControllerPak, 180, 32, 70, 29, 0xcd6, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200193C[2] = { + { 3, gTexturePleaseReinsertOriginalN64ControllerPak, 180, 32, 70, 29, 0xcd6, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of text Erasing Selected Record + * @brief MenuTexture of text Erasing Selected Record * */ -MkTexture D_02001964[2] = { - { 3, 0, gTextureErasingSelectedRecord, 180, 32, 70, 29, 0xc02, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001964[2] = { + { 3, gTextureErasingSelectedRecord, 180, 32, 70, 29, 0xc02, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** @@ -1487,255 +1487,255 @@ MkAnimation D_020019DC[2] = { }; /** - * @brief MkTexture of Name DK + * @brief MenuTexture of Name DK * */ -MkTexture D_020019EC[2] = { - { 0, 0, gTextureNameDK, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020019EC[2] = { + { 0, texture_name_dk, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Toad + * @brief MenuTexture of Name Toad * */ -MkTexture D_02001A14[2] = { - { 0, 0, gTextureNameToad, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001A14[2] = { + { 0, texture_name_toad, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Bowser + * @brief MenuTexture of Name Bowser * */ -MkTexture D_02001A3C[2] = { - { 0, 0, gTextureNameBowser, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001A3C[2] = { + { 0, texture_name_bowser, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Luigi + * @brief MenuTexture of Name Luigi * */ -MkTexture D_02001A64[2] = { - { 0, 0, gTextureNameLuigi, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001A64[2] = { + { 0, texture_name_luigi, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Mario + * @brief MenuTexture of Name Mario * */ -MkTexture D_02001A8C[2] = { - { 0, 0, gTextureNameMario, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001A8C[2] = { + { 0, texture_name_mario, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Peach + * @brief MenuTexture of Name Peach * */ -MkTexture D_02001AB4[2] = { - { 0, 0, gTextureNamePeach, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001AB4[2] = { + { 0, texture_name_peach, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Wario + * @brief MenuTexture of Name Wario * */ -MkTexture D_02001ADC[2] = { - { 0, 0, gTextureNameWario, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001ADC[2] = { + { 0, texture_name_wario, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Name Yoshi + * @brief MenuTexture of Name Yoshi * */ -MkTexture D_02001B04[2] = { - { 0, 0, gTextureNameYoshi, 64, 12, 0, 64, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001B04[2] = { + { 0, texture_name_yoshi, 64, 12, 0, 64, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Mario Raceway + * @brief MenuTexture of Course Preview Mario Raceway * */ -MkTexture D_02001B2C[2] = { - { 0, 0, gTextureCoursePreviewMarioRaceway, 128, 78, 0, 0, 0x3157, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_mario_raceway_preview_texture[2] = { + { 0, gTextureCoursePreviewMarioRaceway, 128, 78, 0, 0, 0x3157, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Choco Mountain + * @brief MenuTexture of Course Preview Choco Mountain * */ -MkTexture D_02001B54[2] = { - { 0, 0, gTextureCoursePreviewChocoMountain, 128, 78, 0, 0, 0x2a24, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001B54[2] = { + { 0, gTextureCoursePreviewChocoMountain, 128, 78, 0, 0, 0x2a24, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Bowser Castle + * @brief MenuTexture of Course Preview Bowser Castle * */ -MkTexture D_02001B7C[2] = { - { 0, 0, gTextureCoursePreviewBowsersCastle, 128, 78, 0, 0, 0x30de, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001B7C[2] = { + { 0, gTextureCoursePreviewBowsersCastle, 128, 78, 0, 0, 0x30de, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Banshee Boardwalk + * @brief MenuTexture of Course Preview Banshee Boardwalk * */ -MkTexture D_02001BA4[2] = { - { 0, 0, gTextureCoursePreviewBansheeBoardwalk, 128, 78, 0, 0, 0x26ad, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001BA4[2] = { + { 0, gTextureCoursePreviewBansheeBoardwalk, 128, 78, 0, 0, 0x26ad, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Yoshi Valley + * @brief MenuTexture of Course Preview Yoshi Valley * */ -MkTexture D_02001BCC[2] = { - { 0, 0, gTextureCoursePreviewYoshiValley, 128, 78, 0, 0, 0x3a41, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001BCC[2] = { + { 0, gTextureCoursePreviewYoshiValley, 128, 78, 0, 0, 0x3a41, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Frappe Snowland + * @brief MenuTexture of Course Preview Frappe Snowland * */ -MkTexture D_02001BF4[2] = { - { 0, 0, gTextureCoursePreviewFrappeSnowland, 128, 78, 0, 0, 0x2409, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001BF4[2] = { + { 0, gTextureCoursePreviewFrappeSnowland, 128, 78, 0, 0, 0x2409, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Koopa Troopa Beach + * @brief MenuTexture of Course Preview Koopa Troopa Beach * */ -MkTexture D_02001C1C[2] = { - { 0, 0, gTextureCoursePreviewKoopaTroopaBeach, 128, 78, 0, 0, 0x2323, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001C1C[2] = { + { 0, gTextureCoursePreviewKoopaTroopaBeach, 128, 78, 0, 0, 0x2323, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Royal Raceway + * @brief MenuTexture of Course Preview Royal Raceway * */ -MkTexture D_02001C44[2] = { - { 0, 0, gTextureCoursePreviewRoyalRaceway, 128, 78, 0, 0, 0x2821, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001C44[2] = { + { 0, gTextureCoursePreviewRoyalRaceway, 128, 78, 0, 0, 0x2821, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Luigi Raceway + * @brief MenuTexture of Course Preview Luigi Raceway * */ -MkTexture D_02001C6C[2] = { - { 0, 0, gTextureCoursePreviewLuigiRaceway, 128, 78, 0, 0, 0x2d74, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001C6C[2] = { + { 0, gTextureCoursePreviewLuigiRaceway, 128, 78, 0, 0, 0x2d74, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Moo Moo Farm + * @brief MenuTexture of Course Preview Moo Moo Farm * */ -MkTexture D_02001C94[2] = { - { 0, 0, gTextureCoursePreviewMooMooFarm, 128, 78, 0, 0, 0x25c7, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001C94[2] = { + { 0, gTextureCoursePreviewMooMooFarm, 128, 78, 0, 0, 0x25c7, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Toads Turnpike + * @brief MenuTexture of Course Preview Toads Turnpike * */ -MkTexture D_02001CBC[2] = { - { 0, 0, gTextureCoursePreviewToadsTurnpike, 128, 78, 0, 0, 0x299a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001CBC[2] = { + { 0, gTextureCoursePreviewToadsTurnpike, 128, 78, 0, 0, 0x299a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Kalimari Desert + * @brief MenuTexture of Course Preview Kalimari Desert * */ -MkTexture D_02001CE4[2] = { - { 0, 0, gTextureCoursePreviewKalimariDesert, 128, 78, 0, 0, 0x280a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001CE4[2] = { + { 0, gTextureCoursePreviewKalimariDesert, 128, 78, 0, 0, 0x280a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Sherbet Land + * @brief MenuTexture of Course Preview Sherbet Land * */ -MkTexture D_02001D0C[2] = { - { 0, 0, gTextureCoursePreviewSherbetLand, 128, 78, 0, 0, 0x300e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001D0C[2] = { + { 0, gTextureCoursePreviewSherbetLand, 128, 78, 0, 0, 0x300e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Rainbow Road + * @brief MenuTexture of Course Preview Rainbow Road * */ -MkTexture D_02001D34[2] = { - { 0, 0, gTextureCoursePreviewRainbowRoad, 128, 78, 0, 0, 0x2824, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001D34[2] = { + { 0, gTextureCoursePreviewRainbowRoad, 128, 78, 0, 0, 0x2824, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Wario Stadium + * @brief MenuTexture of Course Preview Wario Stadium * */ -MkTexture D_02001D5C[2] = { - { 0, 0, gTextureCoursePreviewWarioStadium, 128, 78, 0, 0, 0x32d3, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001D5C[2] = { + { 0, gTextureCoursePreviewWarioStadium, 128, 78, 0, 0, 0x32d3, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Block Fort + * @brief MenuTexture of Course Preview Block Fort * */ -MkTexture D_02001D84[2] = { - { 0, 0, gTextureCoursePreviewBlockFort, 128, 78, 0, 0, 0x2528, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001D84[2] = { + { 0, gTextureCoursePreviewBlockFort, 128, 78, 0, 0, 0x2528, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Skyscraper + * @brief MenuTexture of Course Preview Skyscraper * */ -MkTexture D_02001DAC[2] = { - { 0, 0, gTextureCoursePreviewSkyscraper, 128, 78, 0, 0, 0x26f0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001DAC[2] = { + { 0, gTextureCoursePreviewSkyscraper, 128, 78, 0, 0, 0x26f0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Double Deck + * @brief MenuTexture of Course Preview Double Deck * */ -MkTexture D_02001DD4[2] = { - { 0, 0, gTextureCoursePreviewDoubleDeck, 128, 78, 0, 0, 0x28f7, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001DD4[2] = { + { 0, gTextureCoursePreviewDoubleDeck, 128, 78, 0, 0, 0x28f7, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview DKs Jungle Parkway + * @brief MenuTexture of Course Preview DKs Jungle Parkway * */ -MkTexture D_02001DFC[2] = { - { 0, 0, gTextureCoursePreviewDksJungleParkway, 128, 78, 0, 0, 0x3ee4, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001DFC[2] = { + { 0, gTextureCoursePreviewDksJungleParkway, 128, 78, 0, 0, 0x3ee4, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of Course Preview Big Donut + * @brief MenuTexture of Course Preview Big Donut * */ -MkTexture D_02001E24[2] = { - { 0, 0, gTextureCoursePreviewBigDonut, 128, 78, 0, 0, 0x2f5c, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001E24[2] = { + { 0, gTextureCoursePreviewBigDonut, 128, 78, 0, 0, 0x2f5c, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** @@ -1743,8 +1743,8 @@ MkTexture D_02001E24[2] = { * */ MkAnimation D_02001E4C[3] = { - { D_02001B2C, 0x0000003c }, - { D_02001B2C, 0x0000003c }, + { seg2_mario_raceway_preview_texture, 0x0000003c }, + { seg2_mario_raceway_preview_texture, 0x0000003c }, { NULL, 0x00000000 }, }; @@ -1753,7 +1753,7 @@ MkAnimation D_02001E4C[3] = { * */ MkAnimation D_02001E64[2] = { - { D_02001B2C, 0x0000003c }, + { seg2_mario_raceway_preview_texture, 0x0000003c }, { NULL, 0x00000000 }, }; @@ -1925,66 +1925,66 @@ MkAnimation D_02001F94[2] = { }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02001FA4[2] = { - { 3, 0, gTexture7ED6A4, 68, 51, 0, 0, 0x38e, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001FA4[2] = { + { 3, gTexture7ED6A4, 68, 51, 0, 0, 0x38e, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of trophy gold + * @brief MenuTexture of trophy gold * */ -MkTexture D_02001FCC[2] = { - { 1, 0, gTextureTrophyGold, 45, 45, 0, 0, 0x633, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001FCC[2] = { + { 1, gTextureTrophyGold, 45, 45, 0, 0, 0x633, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of trophy silver + * @brief MenuTexture of trophy silver * */ -MkTexture D_02001FF4[2] = { - { 1, 0, gTextureTrophySilver, 45, 45, 0, 0, 0x629, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02001FF4[2] = { + { 1, gTextureTrophySilver, 45, 45, 0, 0, 0x629, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of trophy bronze + * @brief MenuTexture of trophy bronze * */ -MkTexture D_0200201C[2] = { - { 1, 0, gTextureTrophyBronze, 45, 45, 0, 0, 0x5ec, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200201C[2] = { + { 1, gTextureTrophyBronze, 45, 45, 0, 0, 0x5ec, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of cup gold + * @brief MenuTexture of cup gold * */ -MkTexture D_02002044[2] = { - { 1, 0, gTextureCupGold, 45, 45, 0, 0, 0x98a, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002044[2] = { + { 1, gTextureCupGold, 45, 45, 0, 0, 0x98a, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of cup silver + * @brief MenuTexture of cup silver * */ -MkTexture D_0200206C[2] = { - { 1, 0, gTextureCupSilver, 45, 45, 0, 0, 0x985, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200206C[2] = { + { 1, gTextureCupSilver, 45, 45, 0, 0, 0x985, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture of cup bronze + * @brief MenuTexture of cup bronze * */ -MkTexture D_02002094[2] = { - { 1, 0, gTextureCupBronze, 45, 45, 0, 0, 0x8a2, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002094[2] = { + { 1, gTextureCupBronze, 45, 45, 0, 0, 0x8a2, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** @@ -2042,3937 +2042,3937 @@ MkAnimation D_0200210C[2] = { }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200211C[2] = { - { 5, 0, gTexture7F2094, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterA[2] = { + { 5, font_letter_A, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002144[2] = { - { 5, 0, gTexture7F2164, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterB[2] = { + { 5, font_letter_B, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200216C[2] = { - { 5, 0, gTexture7F2234, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterC[2] = { + { 5, font_letter_C, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002194[2] = { - { 5, 0, gTexture7F2304, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterD[2] = { + { 5, font_letter_D, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020021BC[2] = { - { 5, 0, gTexture7F23D4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterE[2] = { + { 5, font_letter_E, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020021E4[2] = { - { 5, 0, gTexture7F24A4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterF[2] = { + { 5, font_letter_F, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200220C[2] = { - { 5, 0, gTexture7F2574, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterG[2] = { + { 5, font_letter_G, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002234[2] = { - { 5, 0, gTexture7F2644, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterH[2] = { + { 5, font_letter_H, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200225C[2] = { - { 5, 0, gTexture7F2714, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterI[2] = { + { 5, font_letter_I, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002284[2] = { - { 5, 0, gTexture7F27E4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterJ[2] = { + { 5, font_letter_J, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020022AC[2] = { - { 5, 0, gTexture7F28B4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterK[2] = { + { 5, font_letter_K, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020022D4[2] = { - { 5, 0, gTexture7F2984, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterL[2] = { + { 5, font_letter_L, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020022FC[2] = { - { 5, 0, gTexture7F2A54, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterM[2] = { + { 5, font_letter_M, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002324[2] = { - { 5, 0, gTexture7F2B24, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterN[2] = { + { 5, font_letter_N, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200234C[2] = { - { 5, 0, gTexture7F2BF4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterO[2] = { + { 5, font_letter_O, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002374[2] = { - { 5, 0, gTexture7F2CC4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterP[2] = { + { 5, font_letter_P, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200239C[2] = { - { 5, 0, gTexture7F2D94, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterQ[2] = { + { 5, font_letter_Q, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020023C4[2] = { - { 5, 0, gTexture7F2E64, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterR[2] = { + { 5, font_letter_R, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020023EC[2] = { - { 5, 0, gTexture7F2F34, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterS[2] = { + { 5, font_letter_S, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002414[2] = { - { 5, 0, gTexture7F3004, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterT[2] = { + { 5, font_letter_T, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200243C[2] = { - { 5, 0, gTexture7F30D4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterU[2] = { + { 5, font_letter_U, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002464[2] = { - { 5, 0, gTexture7F31A4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterV[2] = { + { 5, font_letter_V, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200248C[2] = { - { 5, 0, gTexture7F3274, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterW[2] = { + { 5, font_letter_W, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020024B4[2] = { - { 5, 0, gTexture7F3344, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterX[2] = { + { 5, font_letter_X, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020024DC[2] = { - { 5, 0, gTexture7F3414, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterY[2] = { + { 5, font_letter_Y, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002504[2] = { - { 5, 0, gTexture7F34E4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontLetterZ[2] = { + { 5, font_letter_Z, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200252C[2] = { - { 5, 0, gTexture7F1394, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontExclamationMark[2] = { + { 5, font_exclamation_mark, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002554[2] = { - { 5, 0, gTexture7F1464, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontMinus[2] = { + { 5, font_minus, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200257C[2] = { - { 5, 0, gTexture7F16D4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontInterogationMark[2] = { + { 5, font_interogation_mark, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020025A4[2] = { - { 5, 0, gTexture7F17A4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontSimpleQuote[2] = { + { 5, font_simple_quote, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020025CC[2] = { - { 5, 0, gTexture7F12C4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontDoubleQuote[2] = { + { 5, font_double_quote, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020025F4[2] = { - { 5, 0, gTexture7F1604, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontPlus[2] = { + { 5, font_plus, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200261C[2] = { - { 5, 0, gTexture7F1534, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontDot[2] = { + { 5, font_dot, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002644[2] = { - { 5, 0, gTexture7F1124, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontFourDote[2] = { + { 5, font_four_dote, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200266C[2] = { - { 5, 0, gTexture7F11F4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontCC[2] = { + { 5, font_cc, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002694[2] = { - { 5, 0, gTexture7F1874, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberZero[2] = { + { 5, font_number_zero, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020026BC[2] = { - { 5, 0, gTexture7F1944, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberOne[2] = { + { 5, font_number_one, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020026E4[2] = { - { 5, 0, gTexture7F1A14, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberTwo[2] = { + { 5, font_number_two, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200270C[2] = { - { 5, 0, gTexture7F1AE4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberThree[2] = { + { 5, font_number_three, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002734[2] = { - { 5, 0, gTexture7F1BB4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberFour[2] = { + { 5, font_number_four, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200275C[2] = { - { 5, 0, gTexture7F1C84, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberFive[2] = { + { 5, font_number_five, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002784[2] = { - { 5, 0, gTexture7F1D54, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberSix[2] = { + { 5, font_number_six, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020027AC[2] = { - { 5, 0, gTexture7F1E24, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberSeven[2] = { + { 5, font_number_seven, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020027D4[2] = { - { 5, 0, gTexture7F1EF4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberEight[2] = { + { 5, font_number_eight, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020027FC[2] = { - { 5, 0, gTexture7F1FC4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontNumberNine[2] = { + { 5, font_number_nine, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002824[2] = { - { 5, 0, gTexture7F35B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002824[2] = { + { 5, gTexture7F35B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200284C[2] = { - { 5, 0, gTexture7F3634, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200284C[2] = { + { 5, gTexture7F3634, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002874[2] = { - { 5, 0, gTexture7F36B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002874[2] = { + { 5, gTexture7F36B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200289C[2] = { - { 5, 0, gTexture7F3734, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200289C[2] = { + { 5, gTexture7F3734, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020028C4[2] = { - { 5, 0, gTexture7F37B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020028C4[2] = { + { 5, gTexture7F37B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020028EC[2] = { - { 5, 0, gTexture7F3AB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020028EC[2] = { + { 5, gTexture7F3AB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002914[2] = { - { 5, 0, gTexture7F3B34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002914[2] = { + { 5, gTexture7F3B34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200293C[2] = { - { 5, 0, gTexture7F3BB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200293C[2] = { + { 5, gTexture7F3BB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002964[2] = { - { 5, 0, gTexture7F3C34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002964[2] = { + { 5, gTexture7F3C34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200298C[2] = { - { 5, 0, gTexture7F3CB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200298C[2] = { + { 5, gTexture7F3CB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020029B4[2] = { - { 5, 0, gTexture7F3D34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020029B4[2] = { + { 5, gTexture7F3D34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020029DC[2] = { - { 5, 0, gTexture7F3DB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020029DC[2] = { + { 5, gTexture7F3DB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002A04[2] = { - { 5, 0, gTexture7F3E34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002A04[2] = { + { 5, gTexture7F3E34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002A2C[2] = { - { 5, 0, gTexture7F3EB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002A2C[2] = { + { 5, gTexture7F3EB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002A54[2] = { - { 5, 0, gTexture7F3F34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002A54[2] = { + { 5, gTexture7F3F34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002A7C[2] = { - { 5, 0, gTexture7F3FB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002A7C[2] = { + { 5, gTexture7F3FB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002AA4[2] = { - { 5, 0, gTexture7F4034, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002AA4[2] = { + { 5, gTexture7F4034, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002ACC[2] = { - { 5, 0, gTexture7F40B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002ACC[2] = { + { 5, gTexture7F40B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002AF4[2] = { - { 5, 0, gTexture7F41B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002AF4[2] = { + { 5, gTexture7F41B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002B1C[2] = { - { 5, 0, gTexture7F4234, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002B1C[2] = { + { 5, gTexture7F4234, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002B44[2] = { - { 5, 0, gTexture7F42B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002B44[2] = { + { 5, gTexture7F42B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002B6C[2] = { - { 5, 0, gTexture7F4334, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002B6C[2] = { + { 5, gTexture7F4334, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002B94[2] = { - { 5, 0, gTexture7F43B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002B94[2] = { + { 5, gTexture7F43B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002BBC[2] = { - { 5, 0, gTexture7F4434, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002BBC[2] = { + { 5, gTexture7F4434, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002BE4[2] = { - { 5, 0, gTexture7F44B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002BE4[2] = { + { 5, gTexture7F44B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002C0C[2] = { - { 5, 0, gTexture7F4534, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002C0C[2] = { + { 5, gTexture7F4534, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002C34[2] = { - { 5, 0, gTexture7F45B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002C34[2] = { + { 5, gTexture7F45B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002C5C[2] = { - { 5, 0, gTexture7F4634, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002C5C[2] = { + { 5, gTexture7F4634, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002C84[2] = { - { 5, 0, gTexture7F46B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002C84[2] = { + { 5, gTexture7F46B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002CAC[2] = { - { 5, 0, gTexture7F4734, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002CAC[2] = { + { 5, gTexture7F4734, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002CD4[2] = { - { 5, 0, gTexture7F47B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002CD4[2] = { + { 5, gTexture7F47B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002CFC[2] = { - { 5, 0, gTexture7F4834, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002CFC[2] = { + { 5, gTexture7F4834, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002D24[2] = { - { 5, 0, gTexture7F48B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002D24[2] = { + { 5, gTexture7F48B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002D4C[2] = { - { 5, 0, gTexture7F4934, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002D4C[2] = { + { 5, gTexture7F4934, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002D74[2] = { - { 5, 0, gTexture7F49B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002D74[2] = { + { 5, gTexture7F49B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002D9C[2] = { - { 5, 0, gTexture7F4A34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002D9C[2] = { + { 5, gTexture7F4A34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002DC4[2] = { - { 5, 0, gTexture7F4AB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002DC4[2] = { + { 5, gTexture7F4AB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002DEC[2] = { - { 5, 0, gTexture7F4B34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002DEC[2] = { + { 5, gTexture7F4B34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002E14[2] = { - { 5, 0, gTexture7F4D34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002E14[2] = { + { 5, gTexture7F4D34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002E3C[2] = { - { 5, 0, gTexture7F4DB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002E3C[2] = { + { 5, gTexture7F4DB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002E64[2] = { - { 5, 0, gTexture7F4E34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002E64[2] = { + { 5, gTexture7F4E34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002E8C[2] = { - { 5, 0, gTexture7F4EB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002E8C[2] = { + { 5, gTexture7F4EB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002EB4[2] = { - { 5, 0, gTexture7F4F34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002EB4[2] = { + { 5, gTexture7F4F34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002EDC[2] = { - { 5, 0, gTexture7F4FB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002EDC[2] = { + { 5, gTexture7F4FB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002F04[2] = { - { 5, 0, gTexture7F5034, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002F04[2] = { + { 5, gTexture7F5034, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002F2C[2] = { - { 5, 0, gTexture7F50B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002F2C[2] = { + { 5, gTexture7F50B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002F54[2] = { - { 5, 0, gTexture7F5134, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002F54[2] = { + { 5, gTexture7F5134, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002F7C[2] = { - { 5, 0, gTexture7F51B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002F7C[2] = { + { 5, gTexture7F51B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002FA4[2] = { - { 5, 0, gTexture7F5234, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002FA4[2] = { + { 5, gTexture7F5234, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002FCC[2] = { - { 5, 0, gTexture7F52B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002FCC[2] = { + { 5, gTexture7F52B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02002FF4[2] = { - { 5, 0, gTexture7F5334, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02002FF4[2] = { + { 5, gTexture7F5334, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200301C[2] = { - { 5, 0, gTexture7F53B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200301C[2] = { + { 5, gTexture7F53B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003044[2] = { - { 5, 0, gTexture7F5434, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003044[2] = { + { 5, gTexture7F5434, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200306C[2] = { - { 5, 0, gTexture7F54B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200306C[2] = { + { 5, gTexture7F54B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003094[2] = { - { 5, 0, gTexture7F5534, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003094[2] = { + { 5, gTexture7F5534, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020030BC[2] = { - { 5, 0, gTexture7F55B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020030BC[2] = { + { 5, gTexture7F55B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020030E4[2] = { - { 5, 0, gTexture7F5634, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020030E4[2] = { + { 5, gTexture7F5634, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200310C[2] = { - { 5, 0, gTexture7F56B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200310C[2] = { + { 5, gTexture7F56B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003134[2] = { - { 5, 0, gTexture7F5734, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003134[2] = { + { 5, gTexture7F5734, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200315C[2] = { - { 5, 0, gTexture7F57B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200315C[2] = { + { 5, gTexture7F57B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003184[2] = { - { 5, 0, gTexture7F5834, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003184[2] = { + { 5, gTexture7F5834, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020031AC[2] = { - { 5, 0, gTexture7F58B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020031AC[2] = { + { 5, gTexture7F58B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020031D4[2] = { - { 5, 0, gTexture7F5934, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020031D4[2] = { + { 5, gTexture7F5934, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020031FC[2] = { - { 5, 0, gTexture7F59B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020031FC[2] = { + { 5, gTexture7F59B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003224[2] = { - { 5, 0, gTexture7F5A34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003224[2] = { + { 5, gTexture7F5A34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200324C[2] = { - { 5, 0, gTexture7F5AB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200324C[2] = { + { 5, gTexture7F5AB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003274[2] = { - { 5, 0, gTexture7F5B34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003274[2] = { + { 5, gTexture7F5B34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200329C[2] = { - { 5, 0, gTexture7F5BB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200329C[2] = { + { 5, gTexture7F5BB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020032C4[2] = { - { 5, 0, gTexture7F5C34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020032C4[2] = { + { 5, gTexture7F5C34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020032EC[2] = { - { 5, 0, gTexture7F5CB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020032EC[2] = { + { 5, gTexture7F5CB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003314[2] = { - { 5, 0, gTexture7F5D34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003314[2] = { + { 5, gTexture7F5D34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200333C[2] = { - { 5, 0, gTexture7F4BB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200333C[2] = { + { 5, gTexture7F4BB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003364[2] = { - { 5, 0, gTexture7F4C34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003364[2] = { + { 5, gTexture7F4C34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200338C[2] = { - { 5, 0, gTexture7F4CB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200338C[2] = { + { 5, gTexture7F4CB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020033B4[2] = { - { 5, 0, gTexture7F4134, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020033B4[2] = { + { 5, gTexture7F4134, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020033DC[2] = { - { 5, 0, gTexture7F3834, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020033DC[2] = { + { 5, gTexture7F3834, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003404[2] = { - { 5, 0, gTexture7F38B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003404[2] = { + { 5, gTexture7F38B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200342C[2] = { - { 5, 0, gTexture7F3934, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200342C[2] = { + { 5, gTexture7F3934, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003454[2] = { - { 5, 0, gTexture7F39B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003454[2] = { + { 5, gTexture7F39B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200347C[2] = { - { 5, 0, gTexture7F3A34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200347C[2] = { + { 5, gTexture7F3A34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020034A4[2] = { - { 5, 0, gTexture7F5DB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020034A4[2] = { + { 5, gTexture7F5DB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020034CC[2] = { - { 5, 0, gTexture7F5E34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020034CC[2] = { + { 5, gTexture7F5E34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020034F4[2] = { - { 5, 0, gTexture7F5EB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020034F4[2] = { + { 5, gTexture7F5EB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200351C[2] = { - { 5, 0, gTexture7F5F34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200351C[2] = { + { 5, gTexture7F5F34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003544[2] = { - { 5, 0, gTexture7F5FB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003544[2] = { + { 5, gTexture7F5FB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200356C[2] = { - { 5, 0, gTexture7F62B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200356C[2] = { + { 5, gTexture7F62B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003594[2] = { - { 5, 0, gTexture7F6334, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003594[2] = { + { 5, gTexture7F6334, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020035BC[2] = { - { 5, 0, gTexture7F63B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020035BC[2] = { + { 5, gTexture7F63B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020035E4[2] = { - { 5, 0, gTexture7F6434, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020035E4[2] = { + { 5, gTexture7F6434, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200360C[2] = { - { 5, 0, gTexture7F64B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200360C[2] = { + { 5, gTexture7F64B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003634[2] = { - { 5, 0, gTexture7F6534, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003634[2] = { + { 5, gTexture7F6534, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200365C[2] = { - { 5, 0, gTexture7F65B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200365C[2] = { + { 5, gTexture7F65B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003684[2] = { - { 5, 0, gTexture7F6634, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003684[2] = { + { 5, gTexture7F6634, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020036AC[2] = { - { 5, 0, gTexture7F66B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020036AC[2] = { + { 5, gTexture7F66B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020036D4[2] = { - { 5, 0, gTexture7F6734, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020036D4[2] = { + { 5, gTexture7F6734, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020036FC[2] = { - { 5, 0, gTexture7F67B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020036FC[2] = { + { 5, gTexture7F67B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003724[2] = { - { 5, 0, gTexture7F6834, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003724[2] = { + { 5, gTexture7F6834, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200374C[2] = { - { 5, 0, gTexture7F68B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200374C[2] = { + { 5, gTexture7F68B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003774[2] = { - { 5, 0, gTexture7F69B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003774[2] = { + { 5, gTexture7F69B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200379C[2] = { - { 5, 0, gTexture7F6A34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200379C[2] = { + { 5, gTexture7F6A34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020037C4[2] = { - { 5, 0, gTexture7F6AB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020037C4[2] = { + { 5, gTexture7F6AB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020037EC[2] = { - { 5, 0, gTexture7F6B34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020037EC[2] = { + { 5, gTexture7F6B34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003814[2] = { - { 5, 0, gTexture7F6BB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003814[2] = { + { 5, gTexture7F6BB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200383C[2] = { - { 5, 0, gTexture7F6C34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200383C[2] = { + { 5, gTexture7F6C34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003864[2] = { - { 5, 0, gTexture7F6CB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003864[2] = { + { 5, gTexture7F6CB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200388C[2] = { - { 5, 0, gTexture7F6D34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200388C[2] = { + { 5, gTexture7F6D34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020038B4[2] = { - { 5, 0, gTexture7F6DB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020038B4[2] = { + { 5, gTexture7F6DB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020038DC[2] = { - { 5, 0, gTexture7F6E34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020038DC[2] = { + { 5, gTexture7F6E34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003904[2] = { - { 5, 0, gTexture7F6EB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003904[2] = { + { 5, gTexture7F6EB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200392C[2] = { - { 5, 0, gTexture7F6F34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200392C[2] = { + { 5, gTexture7F6F34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003954[2] = { - { 5, 0, gTexture7F6FB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003954[2] = { + { 5, gTexture7F6FB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200397C[2] = { - { 5, 0, gTexture7F7034, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200397C[2] = { + { 5, gTexture7F7034, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020039A4[2] = { - { 5, 0, gTexture7F70B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020039A4[2] = { + { 5, gTexture7F70B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020039CC[2] = { - { 5, 0, gTexture7F7134, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020039CC[2] = { + { 5, gTexture7F7134, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020039F4[2] = { - { 5, 0, gTexture7F71B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020039F4[2] = { + { 5, gTexture7F71B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003A1C[2] = { - { 5, 0, gTexture7F7234, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003A1C[2] = { + { 5, gTexture7F7234, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003A44[2] = { - { 5, 0, gTexture7F72B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003A44[2] = { + { 5, gTexture7F72B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003A6C[2] = { - { 5, 0, gTexture7F7334, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003A6C[2] = { + { 5, gTexture7F7334, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003A94[2] = { - { 5, 0, gTexture7F7534, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003A94[2] = { + { 5, gTexture7F7534, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003ABC[2] = { - { 5, 0, gTexture7F75B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003ABC[2] = { + { 5, gTexture7F75B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003AE4[2] = { - { 5, 0, gTexture7F7634, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003AE4[2] = { + { 5, gTexture7F7634, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003B0C[2] = { - { 5, 0, gTexture7F76B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003B0C[2] = { + { 5, gTexture7F76B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003B34[2] = { - { 5, 0, gTexture7F7734, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003B34[2] = { + { 5, gTexture7F7734, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003B5C[2] = { - { 5, 0, gTexture7F77B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003B5C[2] = { + { 5, gTexture7F77B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003B84[2] = { - { 5, 0, gTexture7F7834, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003B84[2] = { + { 5, gTexture7F7834, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003BAC[2] = { - { 5, 0, gTexture7F78B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003BAC[2] = { + { 5, gTexture7F78B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003BD4[2] = { - { 5, 0, gTexture7F7934, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003BD4[2] = { + { 5, gTexture7F7934, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003BFC[2] = { - { 5, 0, gTexture7F79B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003BFC[2] = { + { 5, gTexture7F79B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003C24[2] = { - { 5, 0, gTexture7F7A34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003C24[2] = { + { 5, gTexture7F7A34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003C4C[2] = { - { 5, 0, gTexture7F7AB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003C4C[2] = { + { 5, gTexture7F7AB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003C74[2] = { - { 5, 0, gTexture7F7B34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003C74[2] = { + { 5, gTexture7F7B34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003C9C[2] = { - { 5, 0, gTexture7F7BB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003C9C[2] = { + { 5, gTexture7F7BB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003CC4[2] = { - { 5, 0, gTexture7F7C34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003CC4[2] = { + { 5, gTexture7F7C34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003CEC[2] = { - { 5, 0, gTexture7F7CB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003CEC[2] = { + { 5, gTexture7F7CB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003D14[2] = { - { 5, 0, gTexture7F7D34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003D14[2] = { + { 5, gTexture7F7D34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003D3C[2] = { - { 5, 0, gTexture7F7DB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003D3C[2] = { + { 5, gTexture7F7DB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003D64[2] = { - { 5, 0, gTexture7F7E34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003D64[2] = { + { 5, gTexture7F7E34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003D8C[2] = { - { 5, 0, gTexture7F7EB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003D8C[2] = { + { 5, gTexture7F7EB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003DB4[2] = { - { 5, 0, gTexture7F7F34, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003DB4[2] = { + { 5, gTexture7F7F34, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003DDC[2] = { - { 5, 0, gTexture7F7FB4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003DDC[2] = { + { 5, gTexture7F7FB4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003E04[2] = { - { 5, 0, gTexture7F8034, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003E04[2] = { + { 5, gTexture7F8034, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003E2C[2] = { - { 5, 0, gTexture7F80B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003E2C[2] = { + { 5, gTexture7F80B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003E54[2] = { - { 5, 0, gTexture7F8134, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003E54[2] = { + { 5, gTexture7F8134, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003E7C[2] = { - { 5, 0, gTexture7F81B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003E7C[2] = { + { 5, gTexture7F81B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003EA4[2] = { - { 5, 0, gTexture7F8234, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003EA4[2] = { + { 5, gTexture7F8234, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003ECC[2] = { - { 5, 0, gTexture7F82B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003ECC[2] = { + { 5, gTexture7F82B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003EF4[2] = { - { 5, 0, gTexture7F8334, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003EF4[2] = { + { 5, gTexture7F8334, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003F1C[2] = { - { 5, 0, gTexture7F83B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003F1C[2] = { + { 5, gTexture7F83B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003F44[2] = { - { 5, 0, gTexture7F8434, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003F44[2] = { + { 5, gTexture7F8434, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003F6C[2] = { - { 5, 0, gTexture7F84B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003F6C[2] = { + { 5, gTexture7F84B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003F94[2] = { - { 5, 0, gTexture7F8534, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003F94[2] = { + { 5, gTexture7F8534, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003FBC[2] = { - { 5, 0, gTexture7F73B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003FBC[2] = { + { 5, gTexture7F73B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02003FE4[2] = { - { 5, 0, gTexture7F7434, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02003FE4[2] = { + { 5, gTexture7F7434, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200400C[2] = { - { 5, 0, gTexture7F74B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200400C[2] = { + { 5, gTexture7F74B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004034[2] = { - { 5, 0, gTexture7F6934, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004034[2] = { + { 5, gTexture7F6934, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200405C[2] = { - { 5, 0, gTexture7F6034, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200405C[2] = { + { 5, gTexture7F6034, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004084[2] = { - { 5, 0, gTexture7F60B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004084[2] = { + { 5, gTexture7F60B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020040AC[2] = { - { 5, 0, gTexture7F6134, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020040AC[2] = { + { 5, gTexture7F6134, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020040D4[2] = { - { 5, 0, gTexture7F61B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020040D4[2] = { + { 5, gTexture7F61B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020040FC[2] = { - { 5, 0, gTexture7F6234, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020040FC[2] = { + { 5, gTexture7F6234, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004124[2] = { - { 5, 0, gTexture7F9BF4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004124[2] = { + { 5, gTexture7F9BF4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200414C[2] = { - { 5, 0, gTexture7F8734, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200414C[2] = { + { 5, gTexture7F8734, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004174[2] = { - { 5, 0, gTexture7F8914, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004174[2] = { + { 5, gTexture7F8914, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200419C[2] = { - { 5, 0, gTexture7F8AF4, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200419C[2] = { + { 5, gTexture7F8AF4, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020041C4[2] = { - { 5, 0, gTexture7F8CD4, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020041C4[2] = { + { 5, gTexture7F8CD4, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020041EC[2] = { - { 5, 0, gTexture7F8EB4, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020041EC[2] = { + { 5, gTexture7F8EB4, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004214[2] = { - { 5, 0, gTexture7F9094, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004214[2] = { + { 5, gTexture7F9094, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200423C[2] = { - { 5, 0, gTexture7F9274, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200423C[2] = { + { 5, gTexture7F9274, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004264[2] = { - { 5, 0, gTexture7F9454, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004264[2] = { + { 5, gTexture7F9454, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200428C[2] = { - { 5, 0, gTexture7F9634, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200428C[2] = { + { 5, gTexture7F9634, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020042B4[2] = { - { 5, 0, gTexture7F9814, 30, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020042B4[2] = { + { 5, gTexture7F9814, 30, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020042DC[2] = { - { 5, 0, gTexture7F85B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020042DC[2] = { + { 5, gTexture7F85B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004304[2] = { - { 5, 0, gTexture7F8634, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004304[2] = { + { 5, gTexture7F8634, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200432C[2] = { - { 5, 0, gTexture7F86B4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200432C[2] = { + { 5, gTexture7F86B4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004354[2] = { - { 5, 0, gTexture7F99F4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004354[2] = { + { 5, gTexture7F99F4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200437C[2] = { - { 5, 0, gTexture7F9A74, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200437C[2] = { + { 5, gTexture7F9A74, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020043A4[2] = { - { 5, 0, gTexture7F9CF4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020043A4[2] = { + { 5, gTexture7F9CF4, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020043CC[2] = { - { 5, 0, gTexture7F9DC4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020043CC[2] = { + { 5, gTexture7F9DC4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020043F4[2] = { - { 5, 0, gTexture7F9E44, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020043F4[2] = { + { 5, gTexture7F9E44, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200441C[2] = { - { 5, 0, gTexture7F9EC4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200441C[2] = { + { 5, gTexture7F9EC4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004444[2] = { - { 5, 0, gTexture7FA044, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004444[2] = { + { 5, font_apostrophe, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200446C[2] = { - { 5, 0, gTexture7FA0C4, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200446C[2] = { + { 5, gTexture7FA0C4, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004494[2] = { - { 5, 0, gTexture7FA194, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004494[2] = { + { 5, gTexture7FA194, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020044BC[2] = { - { 5, 0, gTexture7FA264, 26, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020044BC[2] = { + { 5, gTexture7FA264, 26, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020044E4[2] = { - { 5, 0, gTexture7F9AF4, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020044E4[2] = { + { 5, gTexture7F9AF4, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200450C[2] = { - { 5, 0, gTexture7F9B74, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200450C[2] = { + { 5, gTexture7F9B74, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004534[2] = { - { 5, 0, gTexture7FA334, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontComma[2] = { + { 5, font_comma, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200455C[2] = { - { 5, 0, gTexture7F9C74, 16, 16, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200455C[2] = { + { 5, gTexture7F9C74, 16, 16, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown empty MkTexture + * @brief unknown empty MenuTexture * */ -MkTexture D_02004584[1] = { - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureFontEmpty[1] = { + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the blue sky background + * @brief MenuTexture for the blue sky background * */ -MkTexture D_02004598[2] = { - { 0, 0, gTextureBackgroundBlueSky, 320, 240, 0, 0, 0xcd60, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_blue_sky_background_texture[2] = { + { 0, background_blue_sky, 320, 240, 0, 0, 0xcd60, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the sunset background + * @brief MenuTexture for the sunset background * */ -MkTexture D_020045C0[2] = { - { 0, 0, gTextureBackgroundSunset, 320, 240, 0, 0, 0x93c4, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_sunset_background_texture[2] = { + { 0, background_sunset, 320, 240, 0, 0, 0x93c4, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for copyright + * @brief MenuTexture for copyright * */ -MkTexture D_020045E8[2] = { - { 1, 0, gTextureCopyright1996, 124, 17, 98, 199, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_copyright_1996_texture[2] = { + { 1, copyright_1996, 124, 17, 98, 199, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for press start + * @brief MenuTexture for press start * */ -MkTexture D_02004610[2] = { - { 1, 0, gTexturePushStartButton, 159, 16, 81, 179, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_push_start_button_texture[2] = { + { 1, push_start_button, 159, 16, 81, 179, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the options menu + * @brief MenuTexture for the options menu * */ -MkTexture D_02004638[2] = { - { 0, 0, gTextureOption, 130, 32, 95, 16, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004638[2] = { + { 0, texture_option, 130, 32, 95, 16, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the game select menu + * @brief MenuTexture for the game select menu * */ -MkTexture D_02004660[2] = { - { 0, 0, gTextureGameSelect, 200, 32, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_game_select_texture[2] = { + { 0, texture_game_select, 200, 32, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the first colone one player + * @brief MenuTexture for the first colone one player * */ -MkTexture D_02004688[4] = { - { 1, 0, gTextureMenu1PGame, 64, 54, 0, 0, 0x0, 0 }, - { 1, 0, gTextureMenuModeMarioGP, 64, 18, 0, 65, 0x0, 0 }, - { 1, 0, gTextureMenuModeTimeTrials, 64, 18, 0, 83, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_menu_1p_column[4] = { + { 1, texture_menu_1p_game, 64, 54, 0, 0, 0x0, 0 }, + { 1, texture_mode_mario_gp, 64, 18, 0, 65, 0x0, 0 }, + { 1, texture_mode_time_trials, 64, 18, 0, 83, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the first colone two player + * @brief MenuTexture for the first colone two player * */ -MkTexture D_020046D8[5] = { - { 1, 0, gTextureMenu2PGame, 64, 54, 0, 0, 0x0, 0 }, - { 1, 0, gTextureMenuModeMarioGP, 64, 18, 0, 65, 0x0, 0 }, - { 1, 0, gTextureMenuModeVS, 64, 18, 0, 83, 0x0, 0 }, - { 1, 0, gTextureMenuModeBattle, 64, 18, 0, 101, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_menu_2p_column[5] = { + { 1, texture_menu_2p_game, 64, 54, 0, 0, 0x0, 0 }, + { 1, texture_mode_mario_gp, 64, 18, 0, 65, 0x0, 0 }, + { 1, texture_mode_vs, 64, 18, 0, 83, 0x0, 0 }, + { 1, texture_mode_battle, 64, 18, 0, 101, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the first colone three player + * @brief MenuTexture for the first colone three player * */ -MkTexture D_0200473C[4] = { - { 1, 0, gTextureMenu3PGame, 64, 54, 0, 0, 0x0, 0 }, - { 1, 0, gTextureMenuModeVS, 64, 18, 0, 65, 0x0, 0 }, - { 1, 0, gTextureMenuModeBattle, 64, 18, 0, 83, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_menu_3p_column[4] = { + { 1, texture_menu_3p_game, 64, 54, 0, 0, 0x0, 0 }, + { 1, texture_mode_vs, 64, 18, 0, 65, 0x0, 0 }, + { 1, texture_mode_battle, 64, 18, 0, 83, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for the first colone four player + * @brief MenuTexture for the first colone four player * */ -MkTexture D_0200478C[4] = { - { 1, 0, gTextureMenu4PGame, 64, 54, 0, 0, 0x0, 0 }, - { 1, 0, gTextureMenuModeVS, 64, 18, 0, 65, 0x0, 0 }, - { 1, 0, gTextureMenuModeBattle, 64, 18, 0, 83, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_menu_4p_column[4] = { + { 1, texture_menu_4p_game, 64, 54, 0, 0, 0x0, 0 }, + { 1, texture_mode_vs, 64, 18, 0, 65, 0x0, 0 }, + { 1, texture_mode_battle, 64, 18, 0, 83, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_020047DC[2] = { - { 1, 0, gTextureSmallGreenTriangle, 12, 7, 27, 56, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020047DC[2] = { + { 1, texture_small_green_triangle, 12, 7, 27, 56, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004804[2] = { - { 1, 0, gTextureSmallGreenTriangle, 12, 7, 27, 56, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004804[2] = { + { 1, texture_small_green_triangle, 12, 7, 27, 56, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200482C[2] = { - { 1, 0, gTextureSmallGreenTriangle, 12, 7, 27, 56, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200482C[2] = { + { 1, texture_small_green_triangle, 12, 7, 27, 56, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_02004854[2] = { - { 1, 0, gTextureSmallGreenTriangle, 12, 7, 27, 56, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004854[2] = { + { 1, texture_small_green_triangle, 12, 7, 27, 56, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief unknown MkTexture + * @brief unknown MenuTexture * */ -MkTexture D_0200487C[2] = { - { 1, 0, gTextureMenuOK, 31, 19, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_0200487C[2] = { + { 1, texture_ok, 31, 19, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for Menu L Option + * @brief MenuTexture for Menu L Option * */ -MkTexture D_020048A4[2] = { - { 1, 0, gTextureMenuLOption, 58, 19, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture gTextureMenuLOption[2] = { + { 1, texture_l_option, 58, 19, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for Menu R Option + * @brief MenuTexture for Menu R Option * */ -MkTexture D_020048CC[2] = { - { 1, 0, gTextureMenuRData, 58, 19, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_textureMenuRData[2] = { + { 1, texture_r_data, 58, 19, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for Menu 50cc + * @brief MenuTexture for Menu 50cc * */ -MkTexture D_020048F4[2] = { - { 1, 0, gTextureMenu50cc, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_50_CC_texture[2] = { + { 1, texture_50cc, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for Menu 100cc + * @brief MenuTexture for Menu 100cc * */ -MkTexture D_0200491C[2] = { - { 1, 0, gTextureMenu100cc, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_100_CC_texture[2] = { + { 1, texture_100cc, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for Menu 150cc + * @brief MenuTexture for Menu 150cc * */ -MkTexture D_02004944[2] = { - { 1, 0, gTextureMenu150cc, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_150_CC_texture[2] = { + { 1, texture_150cc, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture for Menu Extra + * @brief MenuTexture for Menu Extra * */ -MkTexture D_0200496C[2] = { - { 1, 0, gTextureMenuExtra, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_extra_CC_texture[2] = { + { 1, texture_extra, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Without Item + * @brief MenuTextures for Menu Without Item * */ -MkTexture D_02004994[2] = { - { 1, 0, gTextureMenuWithoutItem, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_menu_no_item_texture[2] = { + { 1, gTextureMenuWithoutItem, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu With Item + * @brief MenuTextures for Menu With Item * */ -MkTexture D_020049BC[2] = { - { 1, 0, gTextureMenuWithItem, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020049BC[2] = { + { 1, gTextureMenuWithItem, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Begin + * @brief MenuTextures for Menu Begin * */ -MkTexture D_020049E4[2] = { - { 1, 0, gTextureMenuBegin, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020049E4[2] = { + { 1, texture_begin, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Ghost + * @brief MenuTextures for Menu Ghost * */ -MkTexture D_02004A0C[2] = { - { 1, 0, gTextureMenuGhost, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004A0C[2] = { + { 1, texture_menu_ghost, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Data + * @brief MenuTextures for Menu Data * */ -MkTexture D_02004A34[2] = { - { 1, 0, gTextureMenuData, 64, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_data_texture[2] = { + { 1, texture_data, 64, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures P1 Border ? + * @brief MenuTextures P1 Border ? * */ -MkTexture D_02004A5C[3] = { - { 3, 0, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, - { 4, 0, gTextureP1BorderBlue, 64, 64, 0, 0, 0x0000, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_P1_border_texture[3] = { + { 3, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, + { 4, gTextureP1BorderBlue, 64, 64, 0, 0, 0x0000, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures P2 Border ? + * @brief MenuTextures P2 Border ? * */ -MkTexture D_02004A98[3] = { - { 3, 0, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, - { 4, 0, gTextureP2BorderRed, 64, 64, 0, 0, 0x0000, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_P2_border_texture[3] = { + { 3, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, + { 4, gTextureP2BorderRed, 64, 64, 0, 0, 0x0000, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures P3 Border ? + * @brief MenuTextures P3 Border ? * */ -MkTexture D_02004AD4[3] = { - { 3, 0, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, - { 4, 0, gTextureP3BorderOrange, 64, 64, 0, 0, 0x0000, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_P3_border_texture[3] = { + { 3, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, + { 4, gTextureP3BorderOrange, 64, 64, 0, 0, 0x0000, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures P4 Border ? + * @brief MenuTextures P4 Border ? * */ -MkTexture D_02004B10[3] = { - { 3, 0, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, - { 4, 0, gTextureP4BorderGreen, 64, 64, 0, 0, 0x0000, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_P4_border_texture[3] = { + { 3, gTexture7E56E4, 64, 64, 0, 0, 0x116c, 0 }, + { 4, gTextureP4BorderGreen, 64, 64, 0, 0, 0x0000, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Player Select + * @brief MenuTextures for Menu Player Select * */ -MkTexture D_02004B4C[2] = { - { 0, 0, gTexturePlayerSelect, 220, 32, 51, 16, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004B4C[2] = { + { 0, texture_player_select, 220, 32, 51, 16, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu OK + * @brief MenuTextures for Menu OK * */ -MkTexture D_02004B74[2] = { - { 1, 0, gTextureMenuOK, 31, 19, 264, 202, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004B74[2] = { + { 1, texture_ok, 31, 19, 264, 202, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Select + * @brief MenuTextures for Menu Select * */ -MkTexture D_02004B9C[2] = { - { 0, 0, gTextureMapSelect, 190, 32, 65, 18, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_menu_select_texture[2] = { + { 0, gTextureMapSelect, 190, 32, 65, 18, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Mushroom Cup + * @brief MenuTextures for Menu Mushroom Cup * */ -MkTexture D_02004BC4[2] = { - { 1, 0, gTextureMenuMushroomCup, 65, 40, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_mushroom_cup_texture[2] = { + { 1, gTextureMenuMushroomCup, 65, 40, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Flower Cup + * @brief MenuTextures for Menu Flower Cup * */ -MkTexture D_02004BEC[2] = { - { 1, 0, gTextureMenuFlowerCup, 65, 40, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_flower_cup_texture[2] = { + { 1, gTextureMenuFlowerCup, 65, 40, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Star Cup + * @brief MenuTextures for Menu Star Cup * */ -MkTexture D_02004C14[2] = { - { 1, 0, gTextureMenuStarCup, 65, 40, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_star_cup_texture[2] = { + { 1, gTextureMenuStarCup, 65, 40, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Menu Special Cup + * @brief MenuTextures for Menu Special Cup * */ -MkTexture D_02004C3C[2] = { - { 1, 0, gTextureMenuSpecialCup, 65, 40, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_special_cup_texture[2] = { + { 1, gTextureMenuSpecialCup, 65, 40, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for the course preview mario raceway + * @brief MenuTextures for the course preview mario raceway * */ -MkTexture D_02004C64[2] = { - { 0, 0, gTextureCoursePreviewMarioRaceway, 128, 78, 23, 112, 0x1e3d, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_mario_raceway_preview_small_texture[2] = { + { 0, gTextureCoursePreviewMarioRaceway, 128, 78, 23, 112, 0x1e3d, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture title for mushroom cup + * @brief MenuTexture title for mushroom cup * */ -MkTexture D_02004C8C[5] = { - { 1, 0, gTextureTitleLuigiRaceway, 140, 18, 157, 112, 0x0, 0 }, - { 1, 0, gTextureTitleMooMooFarm, 140, 18, 157, 136, 0x0, 0 }, - { 1, 0, gTextureTitleKoopaTroopaBeach, 140, 18, 157, 160, 0x0, 0 }, - { 1, 0, gTextureTitleKalimariDesert, 140, 18, 157, 184, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_mushroom_cup_title_texture[5] = { + { 1, gTextureTitleLuigiRaceway, 140, 18, 157, 112, 0x0, 0 }, + { 1, gTextureTitleMooMooFarm, 140, 18, 157, 136, 0x0, 0 }, + { 1, gTextureTitleKoopaTroopaBeach, 140, 18, 157, 160, 0x0, 0 }, + { 1, gTextureTitleKalimariDesert, 140, 18, 157, 184, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture title for flower cup + * @brief MenuTexture title for flower cup * */ -MkTexture D_02004CF0[5] = { - { 1, 0, gTextureTitleToadsTurnpike, 140, 18, 157, 112, 0x0, 0 }, - { 1, 0, gTextureTitleFrappeSnowland, 140, 18, 157, 136, 0x0, 0 }, - { 1, 0, gTextureTitleChocoMountain, 140, 18, 157, 160, 0x0, 0 }, - { 1, 0, gTextureTitleMarioRaceway, 140, 18, 157, 184, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_flower_cup_title_texture[5] = { + { 1, gTextureTitleToadsTurnpike, 140, 18, 157, 112, 0x0, 0 }, + { 1, gTextureTitleFrappeSnowland, 140, 18, 157, 136, 0x0, 0 }, + { 1, gTextureTitleChocoMountain, 140, 18, 157, 160, 0x0, 0 }, + { 1, gTextureTitleMarioRaceway, 140, 18, 157, 184, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture title for star cup + * @brief MenuTexture title for star cup * */ -MkTexture D_02004D54[5] = { - { 1, 0, gTextureTitleWarioStadium, 140, 18, 157, 112, 0x0, 0 }, - { 1, 0, gTextureTitleSherbetLand, 140, 18, 157, 136, 0x0, 0 }, - { 1, 0, gTextureTitleRoyalRaceway, 140, 18, 157, 160, 0x0, 0 }, - { 1, 0, gTextureTitleBowsersCastle, 140, 18, 157, 184, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_star_cup_title_texture[5] = { + { 1, gTextureTitleWarioStadium, 140, 18, 157, 112, 0x0, 0 }, + { 1, gTextureTitleSherbetLand, 140, 18, 157, 136, 0x0, 0 }, + { 1, gTextureTitleRoyalRaceway, 140, 18, 157, 160, 0x0, 0 }, + { 1, gTextureTitleBowsersCastle, 140, 18, 157, 184, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTexture title for special cup + * @brief MenuTexture title for special cup * */ -MkTexture D_02004DB8[5] = { - { 1, 0, gTextureTitleDKsJungleParkway, 140, 18, 157, 112, 0x0, 0 }, - { 1, 0, gTextureTitleYoshiValley, 140, 18, 157, 136, 0x0, 0 }, - { 1, 0, gTextureTitleBansheeBoardwalk, 140, 18, 157, 160, 0x0, 0 }, - { 1, 0, gTextureTitleRainbowRoad, 140, 18, 157, 184, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_special_cup_title_texture[5] = { + { 1, gTextureTitleDKsJungleParkway, 140, 18, 157, 112, 0x0, 0 }, + { 1, gTextureTitleYoshiValley, 140, 18, 157, 136, 0x0, 0 }, + { 1, gTextureTitleBansheeBoardwalk, 140, 18, 157, 160, 0x0, 0 }, + { 1, gTextureTitleRainbowRoad, 140, 18, 157, 184, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title for battle mode + * @brief MenuTextures title for battle mode * */ -MkTexture D_02004E1C[5] = { - { 1, 0, gTextureTitleBigDonut, 140, 18, 157, 112, 0x0, 0 }, - { 1, 0, gTextureTitleBlockFort, 140, 18, 157, 136, 0x0, 0 }, - { 1, 0, gTextureTitleDoubleDeck, 140, 18, 157, 160, 0x0, 0 }, - { 1, 0, gTextureTitleSkyscraper, 140, 18, 157, 184, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_battle_title_texture[5] = { + { 1, gTextureTitleBigDonut, 140, 18, 157, 112, 0x0, 0 }, + { 1, gTextureTitleBlockFort, 140, 18, 157, 136, 0x0, 0 }, + { 1, gTextureTitleDoubleDeck, 140, 18, 157, 160, 0x0, 0 }, + { 1, gTextureTitleSkyscraper, 140, 18, 157, 184, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures Menu OK + * @brief MenuTextures Menu OK * */ -MkTexture D_02004E80[2] = { - { 1, 0, gTextureMenuOK, 31, 19, 265, 208, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004E80[2] = { + { 1, texture_ok, 31, 19, 265, 208, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Mario Raceway + * @brief MenuTextures title Mario Raceway * */ -MkTexture D_02004EA8[2] = { - { 1, 0, gTextureTitleMarioRaceway, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_mario_raceway_title_texture[2] = { + { 1, gTextureTitleMarioRaceway, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Choco Mountain + * @brief MenuTextures title Choco Mountain * */ -MkTexture D_02004ED0[2] = { - { 1, 0, gTextureTitleChocoMountain, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture seg2_choco_mountain_title_texture[2] = { + { 1, gTextureTitleChocoMountain, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Bowser's Castle + * @brief MenuTextures title Bowser's Castle * */ -MkTexture D_02004EF8[2] = { - { 1, 0, gTextureTitleBowsersCastle, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004EF8[2] = { + { 1, gTextureTitleBowsersCastle, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Banshee Boardwalk + * @brief MenuTextures title Banshee Boardwalk * */ -MkTexture D_02004F20[2] = { - { 1, 0, gTextureTitleBansheeBoardwalk, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004F20[2] = { + { 1, gTextureTitleBansheeBoardwalk, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Yoshi Valley + * @brief MenuTextures title Yoshi Valley * */ -MkTexture D_02004F48[2] = { - { 1, 0, gTextureTitleYoshiValley, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004F48[2] = { + { 1, gTextureTitleYoshiValley, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Frappe Snowland + * @brief MenuTextures title Frappe Snowland * */ -MkTexture D_02004F70[2] = { - { 1, 0, gTextureTitleFrappeSnowland, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004F70[2] = { + { 1, gTextureTitleFrappeSnowland, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Koopa Troopa Beach + * @brief MenuTextures title Koopa Troopa Beach * */ -MkTexture D_02004F98[2] = { - { 1, 0, gTextureTitleKoopaTroopaBeach, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004F98[2] = { + { 1, gTextureTitleKoopaTroopaBeach, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Royal Raceway + * @brief MenuTextures title Royal Raceway * */ -MkTexture D_02004FC0[2] = { - { 1, 0, gTextureTitleRoyalRaceway, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004FC0[2] = { + { 1, gTextureTitleRoyalRaceway, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Luigi Raceway + * @brief MenuTextures title Luigi Raceway * */ -MkTexture D_02004FE8[2] = { - { 1, 0, gTextureTitleLuigiRaceway, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02004FE8[2] = { + { 1, gTextureTitleLuigiRaceway, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Moo Moo Farm + * @brief MenuTextures title Moo Moo Farm * */ -MkTexture D_02005010[2] = { - { 1, 0, gTextureTitleMooMooFarm, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005010[2] = { + { 1, gTextureTitleMooMooFarm, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Toad's Turnpike + * @brief MenuTextures title Toad's Turnpike * */ -MkTexture D_02005038[2] = { - { 1, 0, gTextureTitleToadsTurnpike, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005038[2] = { + { 1, gTextureTitleToadsTurnpike, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Kalimari Desert + * @brief MenuTextures title Kalimari Desert * */ -MkTexture D_02005060[2] = { - { 1, 0, gTextureTitleKalimariDesert, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005060[2] = { + { 1, gTextureTitleKalimariDesert, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Sherbet Land + * @brief MenuTextures title Sherbet Land * */ -MkTexture D_02005088[2] = { - { 1, 0, gTextureTitleSherbetLand, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005088[2] = { + { 1, gTextureTitleSherbetLand, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Rainbow Road + * @brief MenuTextures title Rainbow Road * */ -MkTexture D_020050B0[2] = { - { 1, 0, gTextureTitleRainbowRoad, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020050B0[2] = { + { 1, gTextureTitleRainbowRoad, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Wario Stadium + * @brief MenuTextures title Wario Stadium * */ -MkTexture D_020050D8[2] = { - { 1, 0, gTextureTitleWarioStadium, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020050D8[2] = { + { 1, gTextureTitleWarioStadium, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Block Fort + * @brief MenuTextures title Block Fort * */ -MkTexture D_02005100[2] = { - { 1, 0, gTextureTitleBlockFort, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005100[2] = { + { 1, gTextureTitleBlockFort, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Skyscraper + * @brief MenuTextures title Skyscraper * */ -MkTexture D_02005128[2] = { - { 1, 0, gTextureTitleSkyscraper, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005128[2] = { + { 1, gTextureTitleSkyscraper, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Double Deck + * @brief MenuTextures title Double Deck * */ -MkTexture D_02005150[2] = { - { 1, 0, gTextureTitleDoubleDeck, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005150[2] = { + { 1, gTextureTitleDoubleDeck, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title DK's Jungle Parkway + * @brief MenuTextures title DK's Jungle Parkway * */ -MkTexture D_02005178[2] = { - { 1, 0, gTextureTitleDKsJungleParkway, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005178[2] = { + { 1, gTextureTitleDKsJungleParkway, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures title Big Donut + * @brief MenuTextures title Big Donut * */ -MkTexture D_020051A0[2] = { - { 1, 0, gTextureTitleBigDonut, 140, 18, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020051A0[2] = { + { 1, gTextureTitleBigDonut, 140, 18, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 00 + * @brief MenuTextures for Mario Face 00 * */ -MkTexture D_020051C8[2] = { - { 0, 0, gTextureMarioFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020051C8[2] = { + { 0, gTextureMarioFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 01 + * @brief MenuTextures for Mario Face 01 * */ -MkTexture D_020051F0[2] = { - { 0, 0, gTextureMarioFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020051F0[2] = { + { 0, gTextureMarioFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 02 + * @brief MenuTextures for Mario Face 02 * */ -MkTexture D_02005218[2] = { - { 0, 0, gTextureMarioFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005218[2] = { + { 0, gTextureMarioFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 03 + * @brief MenuTextures for Mario Face 03 * */ -MkTexture D_02005240[2] = { - { 0, 0, gTextureMarioFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005240[2] = { + { 0, gTextureMarioFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 04 + * @brief MenuTextures for Mario Face 04 * */ -MkTexture D_02005268[2] = { - { 0, 0, gTextureMarioFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005268[2] = { + { 0, gTextureMarioFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 05 + * @brief MenuTextures for Mario Face 05 * */ -MkTexture D_02005290[2] = { - { 0, 0, gTextureMarioFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005290[2] = { + { 0, gTextureMarioFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 06 + * @brief MenuTextures for Mario Face 06 * */ -MkTexture D_020052B8[2] = { - { 0, 0, gTextureMarioFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020052B8[2] = { + { 0, gTextureMarioFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 07 + * @brief MenuTextures for Mario Face 07 * */ -MkTexture D_020052E0[2] = { - { 0, 0, gTextureMarioFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020052E0[2] = { + { 0, gTextureMarioFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 08 + * @brief MenuTextures for Mario Face 08 * */ -MkTexture D_02005308[2] = { - { 0, 0, gTextureMarioFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005308[2] = { + { 0, gTextureMarioFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 09 + * @brief MenuTextures for Mario Face 09 * */ -MkTexture D_02005330[2] = { - { 0, 0, gTextureMarioFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005330[2] = { + { 0, gTextureMarioFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 10 + * @brief MenuTextures for Mario Face 10 * */ -MkTexture D_02005358[2] = { - { 0, 0, gTextureMarioFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005358[2] = { + { 0, gTextureMarioFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 11 + * @brief MenuTextures for Mario Face 11 * */ -MkTexture D_02005380[2] = { - { 0, 0, gTextureMarioFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005380[2] = { + { 0, gTextureMarioFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 12 + * @brief MenuTextures for Mario Face 12 * */ -MkTexture D_020053A8[2] = { - { 0, 0, gTextureMarioFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020053A8[2] = { + { 0, gTextureMarioFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 13 + * @brief MenuTextures for Mario Face 13 * */ -MkTexture D_020053D0[2] = { - { 0, 0, gTextureMarioFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020053D0[2] = { + { 0, gTextureMarioFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 14 + * @brief MenuTextures for Mario Face 14 * */ -MkTexture D_020053F8[2] = { - { 0, 0, gTextureMarioFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020053F8[2] = { + { 0, gTextureMarioFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 15 + * @brief MenuTextures for Mario Face 15 * */ -MkTexture D_02005420[2] = { - { 0, 0, gTextureMarioFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005420[2] = { + { 0, gTextureMarioFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Mario Face 16 + * @brief MenuTextures for Mario Face 16 * */ -MkTexture D_02005448[2] = { - { 0, 0, gTextureMarioFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005448[2] = { + { 0, gTextureMarioFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 00 + * @brief MenuTextures for Luigi Face 00 * */ -MkTexture D_02005470[2] = { - { 0, 0, gTextureLuigiFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005470[2] = { + { 0, gTextureLuigiFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 01 + * @brief MenuTextures for Luigi Face 01 * */ -MkTexture D_02005498[2] = { - { 0, 0, gTextureLuigiFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005498[2] = { + { 0, gTextureLuigiFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 02 + * @brief MenuTextures for Luigi Face 02 * */ -MkTexture D_020054C0[2] = { - { 0, 0, gTextureLuigiFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020054C0[2] = { + { 0, gTextureLuigiFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 03 + * @brief MenuTextures for Luigi Face 03 * */ -MkTexture D_020054E8[2] = { - { 0, 0, gTextureLuigiFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020054E8[2] = { + { 0, gTextureLuigiFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 04 + * @brief MenuTextures for Luigi Face 04 * */ -MkTexture D_02005510[2] = { - { 0, 0, gTextureLuigiFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005510[2] = { + { 0, gTextureLuigiFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 05 + * @brief MenuTextures for Luigi Face 05 * */ -MkTexture D_02005538[2] = { - { 0, 0, gTextureLuigiFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005538[2] = { + { 0, gTextureLuigiFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 06 + * @brief MenuTextures for Luigi Face 06 * */ -MkTexture D_02005560[2] = { - { 0, 0, gTextureLuigiFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005560[2] = { + { 0, gTextureLuigiFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 07 + * @brief MenuTextures for Luigi Face 07 * */ -MkTexture D_02005588[2] = { - { 0, 0, gTextureLuigiFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005588[2] = { + { 0, gTextureLuigiFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 08 + * @brief MenuTextures for Luigi Face 08 * */ -MkTexture D_020055B0[2] = { - { 0, 0, gTextureLuigiFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020055B0[2] = { + { 0, gTextureLuigiFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 09 + * @brief MenuTextures for Luigi Face 09 * */ -MkTexture D_020055D8[2] = { - { 0, 0, gTextureLuigiFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020055D8[2] = { + { 0, gTextureLuigiFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 10 + * @brief MenuTextures for Luigi Face 10 * */ -MkTexture D_02005600[2] = { - { 0, 0, gTextureLuigiFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005600[2] = { + { 0, gTextureLuigiFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 11 + * @brief MenuTextures for Luigi Face 11 * */ -MkTexture D_02005628[2] = { - { 0, 0, gTextureLuigiFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005628[2] = { + { 0, gTextureLuigiFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 12 + * @brief MenuTextures for Luigi Face 12 * */ -MkTexture D_02005650[2] = { - { 0, 0, gTextureLuigiFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005650[2] = { + { 0, gTextureLuigiFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 13 + * @brief MenuTextures for Luigi Face 13 * */ -MkTexture D_02005678[2] = { - { 0, 0, gTextureLuigiFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005678[2] = { + { 0, gTextureLuigiFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 14 + * @brief MenuTextures for Luigi Face 14 * */ -MkTexture D_020056A0[2] = { - { 0, 0, gTextureLuigiFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020056A0[2] = { + { 0, gTextureLuigiFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 15 + * @brief MenuTextures for Luigi Face 15 * */ -MkTexture D_020056C8[2] = { - { 0, 0, gTextureLuigiFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020056C8[2] = { + { 0, gTextureLuigiFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Luigi Face 16 + * @brief MenuTextures for Luigi Face 16 * */ -MkTexture D_020056F0[2] = { - { 0, 0, gTextureLuigiFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020056F0[2] = { + { 0, gTextureLuigiFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 00 + * @brief MenuTextures for Toad Face 00 * */ -MkTexture D_02005718[2] = { - { 0, 0, gTextureToadFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005718[2] = { + { 0, gTextureToadFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 01 + * @brief MenuTextures for Toad Face 01 * */ -MkTexture D_02005740[2] = { - { 0, 0, gTextureToadFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005740[2] = { + { 0, gTextureToadFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 02 + * @brief MenuTextures for Toad Face 02 * */ -MkTexture D_02005768[2] = { - { 0, 0, gTextureToadFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005768[2] = { + { 0, gTextureToadFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 03 + * @brief MenuTextures for Toad Face 03 * */ -MkTexture D_02005790[2] = { - { 0, 0, gTextureToadFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005790[2] = { + { 0, gTextureToadFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 04 + * @brief MenuTextures for Toad Face 04 * */ -MkTexture D_020057B8[2] = { - { 0, 0, gTextureToadFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020057B8[2] = { + { 0, gTextureToadFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 05 + * @brief MenuTextures for Toad Face 05 * */ -MkTexture D_020057E0[2] = { - { 0, 0, gTextureToadFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020057E0[2] = { + { 0, gTextureToadFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 06 + * @brief MenuTextures for Toad Face 06 * */ -MkTexture D_02005808[2] = { - { 0, 0, gTextureToadFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005808[2] = { + { 0, gTextureToadFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 07 + * @brief MenuTextures for Toad Face 07 * */ -MkTexture D_02005830[2] = { - { 0, 0, gTextureToadFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005830[2] = { + { 0, gTextureToadFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 08 + * @brief MenuTextures for Toad Face 08 * */ -MkTexture D_02005858[2] = { - { 0, 0, gTextureToadFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005858[2] = { + { 0, gTextureToadFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 09 + * @brief MenuTextures for Toad Face 09 * */ -MkTexture D_02005880[2] = { - { 0, 0, gTextureToadFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005880[2] = { + { 0, gTextureToadFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 10 + * @brief MenuTextures for Toad Face 10 * */ -MkTexture D_020058A8[2] = { - { 0, 0, gTextureToadFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020058A8[2] = { + { 0, gTextureToadFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 11 + * @brief MenuTextures for Toad Face 11 * */ -MkTexture D_020058D0[2] = { - { 0, 0, gTextureToadFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020058D0[2] = { + { 0, gTextureToadFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 12 + * @brief MenuTextures for Toad Face 12 * */ -MkTexture D_020058F8[2] = { - { 0, 0, gTextureToadFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020058F8[2] = { + { 0, gTextureToadFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 13 + * @brief MenuTextures for Toad Face 13 * */ -MkTexture D_02005920[2] = { - { 0, 0, gTextureToadFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005920[2] = { + { 0, gTextureToadFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 14 + * @brief MenuTextures for Toad Face 14 * */ -MkTexture D_02005948[2] = { - { 0, 0, gTextureToadFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005948[2] = { + { 0, gTextureToadFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 15 + * @brief MenuTextures for Toad Face 15 * */ -MkTexture D_02005970[2] = { - { 0, 0, gTextureToadFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005970[2] = { + { 0, gTextureToadFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Toad Face 16 + * @brief MenuTextures for Toad Face 16 * */ -MkTexture D_02005998[2] = { - { 0, 0, gTextureToadFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005998[2] = { + { 0, gTextureToadFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 00 + * @brief MenuTextures for Peach Face 00 * */ -MkTexture D_020059C0[2] = { - { 0, 0, gTexturePeachFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020059C0[2] = { + { 0, gTexturePeachFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 01 + * @brief MenuTextures for Peach Face 01 * */ -MkTexture D_020059E8[2] = { - { 0, 0, gTexturePeachFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020059E8[2] = { + { 0, gTexturePeachFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 02 + * @brief MenuTextures for Peach Face 02 * */ -MkTexture D_02005A10[2] = { - { 0, 0, gTexturePeachFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005A10[2] = { + { 0, gTexturePeachFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 03 + * @brief MenuTextures for Peach Face 03 * */ -MkTexture D_02005A38[2] = { - { 0, 0, gTexturePeachFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005A38[2] = { + { 0, gTexturePeachFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 04 + * @brief MenuTextures for Peach Face 04 * */ -MkTexture D_02005A60[2] = { - { 0, 0, gTexturePeachFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005A60[2] = { + { 0, gTexturePeachFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 05 + * @brief MenuTextures for Peach Face 05 * */ -MkTexture D_02005A88[2] = { - { 0, 0, gTexturePeachFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005A88[2] = { + { 0, gTexturePeachFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 06 + * @brief MenuTextures for Peach Face 06 * */ -MkTexture D_02005AB0[2] = { - { 0, 0, gTexturePeachFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005AB0[2] = { + { 0, gTexturePeachFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 07 + * @brief MenuTextures for Peach Face 07 * */ -MkTexture D_02005AD8[2] = { - { 0, 0, gTexturePeachFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005AD8[2] = { + { 0, gTexturePeachFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 08 + * @brief MenuTextures for Peach Face 08 * */ -MkTexture D_02005B00[2] = { - { 0, 0, gTexturePeachFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005B00[2] = { + { 0, gTexturePeachFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 09 + * @brief MenuTextures for Peach Face 09 * */ -MkTexture D_02005B28[2] = { - { 0, 0, gTexturePeachFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005B28[2] = { + { 0, gTexturePeachFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 10 + * @brief MenuTextures for Peach Face 10 * */ -MkTexture D_02005B50[2] = { - { 0, 0, gTexturePeachFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005B50[2] = { + { 0, gTexturePeachFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 11 + * @brief MenuTextures for Peach Face 11 * */ -MkTexture D_02005B78[2] = { - { 0, 0, gTexturePeachFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005B78[2] = { + { 0, gTexturePeachFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 12 + * @brief MenuTextures for Peach Face 12 * */ -MkTexture D_02005BA0[2] = { - { 0, 0, gTexturePeachFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005BA0[2] = { + { 0, gTexturePeachFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 13 + * @brief MenuTextures for Peach Face 13 * */ -MkTexture D_02005BC8[2] = { - { 0, 0, gTexturePeachFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005BC8[2] = { + { 0, gTexturePeachFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 14 + * @brief MenuTextures for Peach Face 14 * */ -MkTexture D_02005BF0[2] = { - { 0, 0, gTexturePeachFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005BF0[2] = { + { 0, gTexturePeachFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 15 + * @brief MenuTextures for Peach Face 15 * */ -MkTexture D_02005C18[2] = { - { 0, 0, gTexturePeachFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005C18[2] = { + { 0, gTexturePeachFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Peach Face 16 + * @brief MenuTextures for Peach Face 16 * */ -MkTexture D_02005C40[2] = { - { 0, 0, gTexturePeachFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005C40[2] = { + { 0, gTexturePeachFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 00 + * @brief MenuTextures for Yoshi Face 00 * */ -MkTexture D_02005C68[2] = { - { 0, 0, gTextureYoshiFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005C68[2] = { + { 0, gTextureYoshiFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 01 + * @brief MenuTextures for Yoshi Face 01 * */ -MkTexture D_02005C90[2] = { - { 0, 0, gTextureYoshiFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005C90[2] = { + { 0, gTextureYoshiFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 02 + * @brief MenuTextures for Yoshi Face 02 * */ -MkTexture D_02005CB8[2] = { - { 0, 0, gTextureYoshiFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005CB8[2] = { + { 0, gTextureYoshiFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 03 + * @brief MenuTextures for Yoshi Face 03 * */ -MkTexture D_02005CE0[2] = { - { 0, 0, gTextureYoshiFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005CE0[2] = { + { 0, gTextureYoshiFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 04 + * @brief MenuTextures for Yoshi Face 04 * */ -MkTexture D_02005D08[2] = { - { 0, 0, gTextureYoshiFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005D08[2] = { + { 0, gTextureYoshiFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 05 + * @brief MenuTextures for Yoshi Face 05 * */ -MkTexture D_02005D30[2] = { - { 0, 0, gTextureYoshiFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005D30[2] = { + { 0, gTextureYoshiFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 06 + * @brief MenuTextures for Yoshi Face 06 * */ -MkTexture D_02005D58[2] = { - { 0, 0, gTextureYoshiFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005D58[2] = { + { 0, gTextureYoshiFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 07 + * @brief MenuTextures for Yoshi Face 07 * */ -MkTexture D_02005D80[2] = { - { 0, 0, gTextureYoshiFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005D80[2] = { + { 0, gTextureYoshiFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 08 + * @brief MenuTextures for Yoshi Face 08 * */ -MkTexture D_02005DA8[2] = { - { 0, 0, gTextureYoshiFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005DA8[2] = { + { 0, gTextureYoshiFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 09 + * @brief MenuTextures for Yoshi Face 09 * */ -MkTexture D_02005DD0[2] = { - { 0, 0, gTextureYoshiFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005DD0[2] = { + { 0, gTextureYoshiFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 10 + * @brief MenuTextures for Yoshi Face 10 * */ -MkTexture D_02005DF8[2] = { - { 0, 0, gTextureYoshiFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005DF8[2] = { + { 0, gTextureYoshiFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 11 + * @brief MenuTextures for Yoshi Face 11 * */ -MkTexture D_02005E20[2] = { - { 0, 0, gTextureYoshiFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005E20[2] = { + { 0, gTextureYoshiFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 12 + * @brief MenuTextures for Yoshi Face 12 * */ -MkTexture D_02005E48[2] = { - { 0, 0, gTextureYoshiFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005E48[2] = { + { 0, gTextureYoshiFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 13 + * @brief MenuTextures for Yoshi Face 13 * */ -MkTexture D_02005E70[2] = { - { 0, 0, gTextureYoshiFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005E70[2] = { + { 0, gTextureYoshiFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 14 + * @brief MenuTextures for Yoshi Face 14 * */ -MkTexture D_02005E98[2] = { - { 0, 0, gTextureYoshiFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005E98[2] = { + { 0, gTextureYoshiFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 15 + * @brief MenuTextures for Yoshi Face 15 * */ -MkTexture D_02005EC0[2] = { - { 0, 0, gTextureYoshiFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005EC0[2] = { + { 0, gTextureYoshiFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Yoshi Face 16 + * @brief MenuTextures for Yoshi Face 16 * */ -MkTexture D_02005EE8[2] = { - { 0, 0, gTextureYoshiFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005EE8[2] = { + { 0, gTextureYoshiFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 00 + * @brief MenuTextures for DK Face 00 * */ -MkTexture D_02005F10[2] = { - { 0, 0, gTextureDkFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005F10[2] = { + { 0, gTextureDkFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 01 + * @brief MenuTextures for DK Face 01 * */ -MkTexture D_02005F38[2] = { - { 0, 0, gTextureDkFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005F38[2] = { + { 0, gTextureDkFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 02 + * @brief MenuTextures for DK Face 02 * */ -MkTexture D_02005F60[2] = { - { 0, 0, gTextureDkFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005F60[2] = { + { 0, gTextureDkFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 03 + * @brief MenuTextures for DK Face 03 * */ -MkTexture D_02005F88[2] = { - { 0, 0, gTextureDkFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005F88[2] = { + { 0, gTextureDkFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 04 + * @brief MenuTextures for DK Face 04 * */ -MkTexture D_02005FB0[2] = { - { 0, 0, gTextureDkFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005FB0[2] = { + { 0, gTextureDkFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 05 + * @brief MenuTextures for DK Face 05 * */ -MkTexture D_02005FD8[2] = { - { 0, 0, gTextureDkFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02005FD8[2] = { + { 0, gTextureDkFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 06 + * @brief MenuTextures for DK Face 06 * */ -MkTexture D_02006000[2] = { - { 0, 0, gTextureDkFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006000[2] = { + { 0, gTextureDkFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 07 + * @brief MenuTextures for DK Face 07 * */ -MkTexture D_02006028[2] = { - { 0, 0, gTextureDkFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006028[2] = { + { 0, gTextureDkFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 08 + * @brief MenuTextures for DK Face 08 * */ -MkTexture D_02006050[2] = { - { 0, 0, gTextureDkFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006050[2] = { + { 0, gTextureDkFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 09 + * @brief MenuTextures for DK Face 09 * */ -MkTexture D_02006078[2] = { - { 0, 0, gTextureDkFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006078[2] = { + { 0, gTextureDkFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 10 + * @brief MenuTextures for DK Face 10 * */ -MkTexture D_020060A0[2] = { - { 0, 0, gTextureDkFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020060A0[2] = { + { 0, gTextureDkFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 11 + * @brief MenuTextures for DK Face 11 * */ -MkTexture D_020060C8[2] = { - { 0, 0, gTextureDkFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020060C8[2] = { + { 0, gTextureDkFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 12 + * @brief MenuTextures for DK Face 12 * */ -MkTexture D_020060F0[2] = { - { 0, 0, gTextureDkFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020060F0[2] = { + { 0, gTextureDkFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 13 + * @brief MenuTextures for DK Face 13 * */ -MkTexture D_02006118[2] = { - { 0, 0, gTextureDkFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006118[2] = { + { 0, gTextureDkFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 14 + * @brief MenuTextures for DK Face 14 * */ -MkTexture D_02006140[2] = { - { 0, 0, gTextureDkFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006140[2] = { + { 0, gTextureDkFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 15 + * @brief MenuTextures for DK Face 15 * */ -MkTexture D_02006168[2] = { - { 0, 0, gTextureDkFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006168[2] = { + { 0, gTextureDkFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for DK Face 16 + * @brief MenuTextures for DK Face 16 * */ -MkTexture D_02006190[2] = { - { 0, 0, gTextureDkFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006190[2] = { + { 0, gTextureDkFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 00 + * @brief MenuTextures for Wario Face 00 * */ -MkTexture D_020061B8[2] = { - { 0, 0, gTextureWarioFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020061B8[2] = { + { 0, gTextureWarioFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 01 + * @brief MenuTextures for Wario Face 01 * */ -MkTexture D_020061E0[2] = { - { 0, 0, gTextureWarioFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020061E0[2] = { + { 0, gTextureWarioFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 02 + * @brief MenuTextures for Wario Face 02 * */ -MkTexture D_02006208[2] = { - { 0, 0, gTextureWarioFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006208[2] = { + { 0, gTextureWarioFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 03 + * @brief MenuTextures for Wario Face 03 * */ -MkTexture D_02006230[2] = { - { 0, 0, gTextureWarioFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006230[2] = { + { 0, gTextureWarioFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 04 + * @brief MenuTextures for Wario Face 04 * */ -MkTexture D_02006258[2] = { - { 0, 0, gTextureWarioFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006258[2] = { + { 0, gTextureWarioFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 05 + * @brief MenuTextures for Wario Face 05 * */ -MkTexture D_02006280[2] = { - { 0, 0, gTextureWarioFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006280[2] = { + { 0, gTextureWarioFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 06 + * @brief MenuTextures for Wario Face 06 * */ -MkTexture D_020062A8[2] = { - { 0, 0, gTextureWarioFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020062A8[2] = { + { 0, gTextureWarioFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 07 + * @brief MenuTextures for Wario Face 07 * */ -MkTexture D_020062D0[2] = { - { 0, 0, gTextureWarioFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020062D0[2] = { + { 0, gTextureWarioFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 08 + * @brief MenuTextures for Wario Face 08 * */ -MkTexture D_020062F8[2] = { - { 0, 0, gTextureWarioFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020062F8[2] = { + { 0, gTextureWarioFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 09 + * @brief MenuTextures for Wario Face 09 * */ -MkTexture D_02006320[2] = { - { 0, 0, gTextureWarioFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006320[2] = { + { 0, gTextureWarioFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 10 + * @brief MenuTextures for Wario Face 10 * */ -MkTexture D_02006348[2] = { - { 0, 0, gTextureWarioFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006348[2] = { + { 0, gTextureWarioFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 11 + * @brief MenuTextures for Wario Face 11 * */ -MkTexture D_02006370[2] = { - { 0, 0, gTextureWarioFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006370[2] = { + { 0, gTextureWarioFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 12 + * @brief MenuTextures for Wario Face 12 * */ -MkTexture D_02006398[2] = { - { 0, 0, gTextureWarioFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006398[2] = { + { 0, gTextureWarioFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 13 + * @brief MenuTextures for Wario Face 13 * */ -MkTexture D_020063C0[2] = { - { 0, 0, gTextureWarioFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020063C0[2] = { + { 0, gTextureWarioFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 14 + * @brief MenuTextures for Wario Face 14 * */ -MkTexture D_020063E8[2] = { - { 0, 0, gTextureWarioFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020063E8[2] = { + { 0, gTextureWarioFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 15 + * @brief MenuTextures for Wario Face 15 * */ -MkTexture D_02006410[2] = { - { 0, 0, gTextureWarioFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006410[2] = { + { 0, gTextureWarioFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Wario Face 16 + * @brief MenuTextures for Wario Face 16 * */ -MkTexture D_02006438[2] = { - { 0, 0, gTextureWarioFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006438[2] = { + { 0, gTextureWarioFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 00 + * @brief MenuTextures for Bowser Face 00 * */ -MkTexture D_02006460[2] = { - { 0, 0, gTextureBowserFace00, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006460[2] = { + { 0, gTextureBowserFace00, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 01 + * @brief MenuTextures for Bowser Face 01 * */ -MkTexture D_02006488[2] = { - { 0, 0, gTextureBowserFace01, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006488[2] = { + { 0, gTextureBowserFace01, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 02 + * @brief MenuTextures for Bowser Face 02 * */ -MkTexture D_020064B0[2] = { - { 0, 0, gTextureBowserFace02, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020064B0[2] = { + { 0, gTextureBowserFace02, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 03 + * @brief MenuTextures for Bowser Face 03 * */ -MkTexture D_020064D8[2] = { - { 0, 0, gTextureBowserFace03, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020064D8[2] = { + { 0, gTextureBowserFace03, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 04 + * @brief MenuTextures for Bowser Face 04 * */ -MkTexture D_02006500[2] = { - { 0, 0, gTextureBowserFace04, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006500[2] = { + { 0, gTextureBowserFace04, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 05 + * @brief MenuTextures for Bowser Face 05 * */ -MkTexture D_02006528[2] = { - { 0, 0, gTextureBowserFace05, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006528[2] = { + { 0, gTextureBowserFace05, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 06 + * @brief MenuTextures for Bowser Face 06 * */ -MkTexture D_02006550[2] = { - { 0, 0, gTextureBowserFace06, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006550[2] = { + { 0, gTextureBowserFace06, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 07 + * @brief MenuTextures for Bowser Face 07 * */ -MkTexture D_02006578[2] = { - { 0, 0, gTextureBowserFace07, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006578[2] = { + { 0, gTextureBowserFace07, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 08 + * @brief MenuTextures for Bowser Face 08 * */ -MkTexture D_020065A0[2] = { - { 0, 0, gTextureBowserFace08, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020065A0[2] = { + { 0, gTextureBowserFace08, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 09 + * @brief MenuTextures for Bowser Face 09 * */ -MkTexture D_020065C8[2] = { - { 0, 0, gTextureBowserFace09, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020065C8[2] = { + { 0, gTextureBowserFace09, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 10 + * @brief MenuTextures for Bowser Face 10 * */ -MkTexture D_020065F0[2] = { - { 0, 0, gTextureBowserFace10, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020065F0[2] = { + { 0, gTextureBowserFace10, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 11 + * @brief MenuTextures for Bowser Face 11 * */ -MkTexture D_02006618[2] = { - { 0, 0, gTextureBowserFace11, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006618[2] = { + { 0, gTextureBowserFace11, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 12 + * @brief MenuTextures for Bowser Face 12 * */ -MkTexture D_02006640[2] = { - { 0, 0, gTextureBowserFace12, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006640[2] = { + { 0, gTextureBowserFace12, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 13 + * @brief MenuTextures for Bowser Face 13 * */ -MkTexture D_02006668[2] = { - { 0, 0, gTextureBowserFace13, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006668[2] = { + { 0, gTextureBowserFace13, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 14 + * @brief MenuTextures for Bowser Face 14 * */ -MkTexture D_02006690[2] = { - { 0, 0, gTextureBowserFace14, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_02006690[2] = { + { 0, gTextureBowserFace14, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 15 + * @brief MenuTextures for Bowser Face 15 * */ -MkTexture D_020066B8[2] = { - { 0, 0, gTextureBowserFace15, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020066B8[2] = { + { 0, gTextureBowserFace15, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** - * @brief MkTextures for Bowser Face 16 + * @brief MenuTextures for Bowser Face 16 * */ -MkTexture D_020066E0[2] = { - { 0, 0, gTextureBowserFace16, 64, 64, 0, 0, 0x0, 0 }, - { 0, 0, NULL, 0, 0, 0, 0, 0, 0 }, +MenuTexture D_020066E0[2] = { + { 0, gTextureBowserFace16, 64, 64, 0, 0, 0x0, 0 }, + { 0, NULL, 0, 0, 0, 0, 0, 0 }, }; /** diff --git a/src/data_segment2.h b/src/data_segment2.h index 22b5fa2a7e..01cec042c0 100644 --- a/src/data_segment2.h +++ b/src/data_segment2.h @@ -17,6 +17,7 @@ extern Gfx D_020077A8[]; extern Gfx D_020077D8[]; extern Gfx D_020077F8[]; extern Gfx D_02007818[]; +#ifndef AVOID_UB extern Gfx D_02007838[]; extern Gfx D_02007858[]; extern Gfx D_02007878[]; @@ -41,6 +42,7 @@ extern Gfx D_02007AB8[]; extern Gfx D_02007AD8[]; extern Gfx D_02007AF8[]; extern Gfx D_02007B18[]; +#endif extern Gfx D_02007F18[]; extern Gfx D_02007F48[]; extern Gfx D_02007F60[]; @@ -51,33 +53,7 @@ extern Gfx D_02008058[]; extern Gfx common_rectangle_display[]; extern Vtx D_02007BB8[]; -#ifndef AVOID_UB -extern Vtx D_02007BD8[]; -extern Vtx D_02007BF8[]; -extern Vtx D_02007C18[]; -extern Vtx D_02007C38[]; -extern Vtx D_02007C58[]; -extern Vtx D_02007C78[]; -extern Vtx D_02007C98[]; -extern Vtx D_02007CB8[]; extern Vtx D_02007CD8[]; -extern Vtx D_02007CF8[]; -extern Vtx D_02007D18[]; -extern Vtx D_02007D38[]; -extern Vtx D_02007D58[]; -extern Vtx D_02007D78[]; -extern Vtx D_02007D98[]; -extern Vtx D_02007DB8[]; -extern Vtx D_02007DD8[]; extern Vtx D_02007DF8[]; -extern Vtx D_02007E18[]; -extern Vtx D_02007E38[]; -extern Vtx D_02007E58[]; -extern Vtx D_02007E78[]; -extern Vtx D_02007E98[]; -extern Vtx D_02007EB8[]; -extern Vtx D_02007ED8[]; -extern Vtx D_02007EF8[]; -#endif #endif diff --git a/src/debug/all_variables.h b/src/debug/all_variables.h index 2ffe895773..0d897af63b 100644 --- a/src/debug/all_variables.h +++ b/src/debug/all_variables.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include @@ -65,7 +65,7 @@ #include "buffers/trig_tables.h" #include #include -#include +#include #include #include diff --git a/src/effects.c b/src/effects.c index 1294a7cbab..38b8088157 100644 --- a/src/effects.c +++ b/src/effects.c @@ -7,8 +7,8 @@ #include "code_800029B0.h" #include "math_util.h" #include "kart_attributes.h" -#include "waypoints.h" -#include "code_80005FD0.h" +#include "path.h" +#include "cpu_vehicles_camera_path.h" #include "render_player.h" #include "player_controller.h" #include "render_objects.h" @@ -16,13 +16,14 @@ #include "effects.h" #include "audio/external.h" #include "spawn_players.h" -#include "code_80091750.h" +#include "menu_items.h" +#include s32 D_8018D900[8]; s16 D_8018D920[8]; -s32 D_8018D930[8]; -s32 D_8018D950[8]; -s32 D_8018D970[8]; +s32 gPlayerStarEffectStartTime[8]; +s32 gPlayerBooEffectStartTime[8]; +s32 gPlayerOtherScreensAlpha[8]; // Used for the alpha of the other screens in split-screen mode s32 D_8018D990[8]; UNUSED void func_unnamed(void) { @@ -133,44 +134,46 @@ UNUSED void func_unnamed33(void) { } void func_8008C310(Player* player) { - if ((player->soundEffects & 2) || (player->soundEffects & 4) || ((player->soundEffects << 9) < 0) || - (player->soundEffects & HIT_BY_ITEM_SOUND_EFFECT)) { - player->unk_0B6 = ((u16) player->unk_0B6 | 0x1000); + // The << 9 is a hacky way to check for VERTICAL_TUMBLE_TRIGGER + if ((player->triggers & HIGH_TUMBLE_TRIGGER) || (player->triggers & LOW_TUMBLE_TRIGGER) || + ((player->triggers << 9) < 0) || (player->triggers & HIT_BY_STAR_TRIGGER)) { + player->kartGraphics = ((u16) player->kartGraphics | EXPLOSION); } } UNUSED void func_unnamed34(void) { } -void clean_effect(Player* player, s8 arg1) { +void clean_effect(Player* player, s8 playerIndex) { - if ((player->effects & 0x400) == 0x400) { - func_8008C6D0(player, arg1); + if ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) { + func_8008C6D0(player, playerIndex); } - if (((player->effects & 0x80) == 0x80) || (player->effects & 0x40) == 0x40) { - func_8008C8C4(player, arg1); + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + (player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) { + func_8008C8C4(player, playerIndex); } - if ((player->effects & 0x800) == 0x800) { - func_8008D0E4(player, arg1); + if ((player->effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT) { + func_8008D0E4(player, playerIndex); } - if ((player->unk_044 & 0x4000) != 0) { - func_8008D3B0(player, arg1); + if ((player->kartProps & DRIVING_SPINOUT) != 0) { + func_8008D3B0(player, playerIndex); } - if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) { - remove_boost_effect(player); + if ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) { + remove_mushroom_effect(player); } - if ((player->effects & 0x80000) == 0x80000) { + if ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) { func_8008D760(player); } - if ((player->effects & 0x800000) == 0x800000) { + if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) { func_8008D97C(player); } - if ((player->effects & 0x1000000) == 0x1000000) { - func_8008E884(player, arg1); + if ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) { + func_8008E884(player, playerIndex); } - if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) { - remove_hit_by_item_effect(player, arg1); + if ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) { + remove_hit_by_star_effect(player, playerIndex); } if ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) { remove_boost_ramp_asphalt_effect(player); @@ -178,23 +181,23 @@ void clean_effect(Player* player, s8 arg1) { if ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT) { remove_boost_ramp_wood_effect(player); } - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) { func_8008F3E0(player); } - if ((player->effects & 0x10000) == 0x10000) { - func_8008F5A4(player, arg1); + if ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) { + func_8008F5A4(player, playerIndex); } - if ((player->effects & 0x10000000) == 0x10000000) { - func_8008FEDC(player, arg1); + if ((player->effects & UNKNOWN_EFFECT_0x10000000) == UNKNOWN_EFFECT_0x10000000) { + func_8008FEDC(player, playerIndex); } - player->unk_044 = (s16) (player->unk_044 & 0xFFFE); - player->effects = (s32) (player->effects & ~0x20); + player->kartProps = (s16) (player->kartProps & ~BACK_UP); + player->effects = (s32) (player->effects & ~AB_SPIN_EFFECT); } -void func_8008C528(Player* player, s8 arg1) { +void func_8008C528(Player* player, s8 playerIndex) { UNUSED s32 sp24; s32 temp_v1; - clean_effect(player, arg1); + clean_effect(player, playerIndex); func_8008C310(player); temp_v1 = player->characterId; player->unk_0C2 = 0; @@ -203,24 +206,24 @@ void func_8008C528(Player* player, s8 arg1) { player->kartHopVelocity = D_800E3790[temp_v1]; player->unk_0A8 = 0; - player->effects = player->effects | 0x400; - player->effects = player->effects & ~0x10; + player->effects = player->effects | HIT_BY_GREEN_SHELL_EFFECT; + player->effects = player->effects & ~DRIFTING_EFFECT; player->unk_0C0 = 0; player->unk_236 = 2; player->unk_042 = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (temp_v1 * 0x10) + 0x29008005); - func_800C9060(arg1, SOUND_ACTION_EXPLOSION); + func_800C90F4(playerIndex, (temp_v1 * 0x10) + 0x29008005); + func_800C9060(playerIndex, SOUND_ACTION_EXPLOSION); } else { - func_800098FC(arg1, player); + play_cpu_sound_effect(playerIndex, player); } - player->soundEffects = (s32) (player->soundEffects & ~4); + player->triggers = (s32) (player->triggers & ~LOW_TUMBLE_TRIGGER); } -void func_8008C62C(Player* player, s8 arg1) { +void func_8008C62C(Player* player, s8 playerIndex) { - decelerate_ai_player(player, 5.0f); + player_decelerate_alternative(player, 5.0f); player->unk_0A8 += (s16) 0xA0; player->unk_042 += (s16) 0x71C; if (player->unk_0A8 >= 0x2000) { @@ -228,165 +231,166 @@ void func_8008C62C(Player* player, s8 arg1) { player->unk_236 = (s16) (player->unk_236 - 1); if (player->unk_236 == 0) { player->unk_0A8 = 0x2000; - func_8008C6D0(player, arg1); + func_8008C6D0(player, playerIndex); if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } } } } -void func_8008C6D0(Player* player, s8 arg1) { +void func_8008C6D0(Player* player, s8 playerIndex) { player->unk_206 = 0; player->slopeAccel = 0; - player->effects = (s32) (player->effects & ~0x400); + player->effects = (s32) (player->effects & ~HIT_BY_GREEN_SHELL_EFFECT); player->unk_0A8 = 0; player->unk_0C0 = 0; player->unk_07C = 0; player->unk_236 = 0; player->unk_078 = 0; player->currentSpeed = 0.0f; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; } -void func_8008C73C(Player* player, s8 arg1) { - clean_effect(player, arg1); - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40)) { - player->effects &= ~0x10; +void func_8008C73C(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && + ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT)) { + player->effects &= ~DRIFTING_EFFECT; if ((player->unk_0C0 / 182) >= 0) { - player->effects |= 0x40; + player->effects |= DRIVING_SPINOUT_EFFECT; } else { - player->effects |= 0x80; + player->effects |= BANANA_SPINOUT_EFFECT; } - player->unk_0B6 |= 0x80; + player->kartGraphics |= WHIRRR; // clang-format off player->unk_0C0 = 0; player->unk_07C = 0; player->unk_078 = 0; player->unk_0AE = player->rotation[1]; player->unk_0B2 = 2; // clang-format on - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; - D_80165280[arg1] = player->currentSpeed; - gTimerBoostTripleACombo[arg1] = 0; - gIsPlayerTripleAButtonCombo[arg1] = false; - gCountASwitch[arg1] = 0; - gFrameSinceLastACombo[arg1] = 0; - D_8018D920[arg1] = 0; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; + gPlayerCurrentSpeed[playerIndex] = player->currentSpeed; + gTimerBoostTripleACombo[playerIndex] = 0; + gIsPlayerTripleAButtonCombo[playerIndex] = false; + gCountASwitch[playerIndex] = 0; + gFrameSinceLastACombo[playerIndex] = 0; + D_8018D920[playerIndex] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008003); } else { - func_800098FC(arg1, player); + play_cpu_sound_effect(playerIndex, player); } } } void func_8008C8C4(Player* player, s8 playerId) { - player->effects &= ~0x80; - player->effects &= ~0x40; + player->effects &= ~BANANA_SPINOUT_EFFECT; + player->effects &= ~DRIVING_SPINOUT_EFFECT; player->unk_0A8 = 0; player->rotation[1] = player->unk_0AE; player->unk_07C = 0; player->unk_0C0 = 0; - player->effects &= ~0x800; + player->effects &= ~BANANA_NEAR_SPINOUT_EFFECT; D_80165190[0][playerId] = 1; D_80165190[1][playerId] = 1; D_80165190[2][playerId] = 1; D_80165190[3][playerId] = 1; - player->unk_046 &= 0xFFBF; + player->unk_046 &= ~INSTANT_SPINOUT; if ((gIsPlayerTripleAButtonCombo[playerId] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed = (f32) (player->currentSpeed + 100.0f); } - if ((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) == PLAYER_KART_AI) && (!gDemoMode) && - ((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) { - player->soundEffects = (s32) (player->soundEffects | REVERSE_SOUND_EFFECT); + if ((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) == PLAYER_CPU) && (!gDemoMode) && + ((player->lakituProps & HELD_BY_LAKITU) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) { + player->triggers = (s32) (player->triggers | VERTICAL_TUMBLE_TRIGGER); } } -void func_8008C9EC(Player* player, s8 arg1) { +void func_8008C9EC(Player* player, s8 playerIndex) { s16 stackPadding1; s16 stackPadding2; s16 sp30[5] = { 1092, 1092, 2184, 1638, 1820 }; player->unk_206 = 0; player->slopeAccel = 0; - if ((player->unk_046 & 0x40) == 0x40) { - decelerate_ai_player(player, 100.0f); + if ((player->unk_046 & INSTANT_SPINOUT) == INSTANT_SPINOUT) { + player_decelerate_alternative(player, 100.0f); } else { if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - decelerate_ai_player(player, 1.0f); + player_decelerate_alternative(player, 1.0f); } else { - decelerate_ai_player(player, 4.0f); + player_decelerate_alternative(player, 4.0f); } if (!(player->type & PLAYER_HUMAN)) { - decelerate_ai_player(player, 30.0f); + player_decelerate_alternative(player, 30.0f); } } - if ((player->effects & 0x80) == 0x80) { + if ((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) { player->rotation[1] -= sp30[player->unk_0B2]; - D_8018D920[arg1] -= sp30[player->unk_0B2]; - stackPadding1 = (u16) D_8018D920[arg1] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182))); + D_8018D920[playerIndex] -= sp30[player->unk_0B2]; + stackPadding1 = (u16) D_8018D920[playerIndex] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182))); if (stackPadding1 == 0) { player->unk_0B2--; if (player->unk_0B2 <= 0) { if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } - func_8008C8C4(player, arg1); + func_8008C8C4(player, playerIndex); } } } else { player->rotation[1] += sp30[player->unk_0B2]; - D_8018D920[arg1] -= sp30[player->unk_0B2]; - stackPadding2 = (u16) D_8018D920[arg1] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182))); + D_8018D920[playerIndex] -= sp30[player->unk_0B2]; + stackPadding2 = (u16) D_8018D920[playerIndex] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182))); if (stackPadding2 == 0) { player->unk_0B2--; if (player->unk_0B2 <= 0) { - func_8008C8C4(player, arg1); + func_8008C8C4(player, playerIndex); if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } } } } - if ((gIsPlayerTripleAButtonCombo[arg1] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { - gTimerBoostTripleACombo[arg1] = 0x00000078; + if ((gIsPlayerTripleAButtonCombo[playerIndex] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + gTimerBoostTripleACombo[playerIndex] = 0x00000078; if (player->currentSpeed <= 90.0f) { player->currentSpeed = 90.0f; } } } -void func_8008CDC0(Player* player, s8 arg1) { - clean_effect(player, arg1); +void func_8008CDC0(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); - player->soundEffects &= ~1; + player->triggers &= ~HIT_BANANA_TRIGGER; player->unk_0B4 = 0; player->unk_0B8 = 3.0f; player->unk_0AC = 1; - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; if (((player->unk_07C >> 0x10) >= 0x14) || ((player->unk_07C >> 0x10) < -0x13) || - (((player->unk_094 / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) || - (((player->type & PLAYER_HUMAN) == 0) && ((player->effects & 0x1000) == 0))) { - func_8008C73C(player, arg1); + (((player->speed / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & MIDAIR_EFFECT) != 0) || + (((player->type & PLAYER_HUMAN) == 0) && ((player->effects & LOST_RACE_EFFECT) == 0))) { + func_8008C73C(player, playerIndex); } else { - player->effects |= 0x800; + player->effects |= BANANA_NEAR_SPINOUT_EFFECT; } } -void func_8008CEB0(Player* player, s8 arg1) { +void func_8008CEB0(Player* player, s8 playerIndex) { f32 var_f0; s16 var_v1; s16 var_a3; @@ -401,19 +405,19 @@ void func_8008CEB0(Player* player, s8 arg1) { var_v1 = 0; var_a3 = -var_a3; var_f0 *= 0.8; - if ((player->effects & 1) == 1) { - player->effects |= 0x40000; + if ((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT) { + player->effects |= BANANA_SPINOUT_SAVE_EFFECT; } if (var_f0 <= 1.0f) { - player->effects &= ~0x800; - if ((player->effects & 0x40000) != 0x40000) { - func_8008C73C(player, arg1); + player->effects &= ~BANANA_NEAR_SPINOUT_EFFECT; + if ((player->effects & BANANA_SPINOUT_SAVE_EFFECT) != BANANA_SPINOUT_SAVE_EFFECT) { + func_8008C73C(player, playerIndex); var_v1 = 0; } else { - player->unk_0B6 |= 0x20; - player->effects &= ~0x40000; + player->kartGraphics |= WHISTLE; + player->effects &= ~BANANA_SPINOUT_SAVE_EFFECT; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008008); var_v1 = 0; } } @@ -430,28 +434,28 @@ void func_8008CEB0(Player* player, s8 arg1) { player->unk_0B8 = var_f0; player->unk_0B4 = var_v1; player->unk_0AC = var_a3; - if (player->effects & 8) { - func_8008C73C(player, arg1); - player->effects &= ~0x800; + if (player->effects & MIDAIR_EFFECT) { + func_8008C73C(player, playerIndex); + player->effects &= ~BANANA_NEAR_SPINOUT_EFFECT; } } -void func_8008D0E4(Player* player, UNUSED s8 arg1) { - player->effects &= ~0x800; +void func_8008D0E4(Player* player, UNUSED s8 playerIndex) { + player->effects &= ~BANANA_NEAR_SPINOUT_EFFECT; } -void func_8008D0FC(Player* player, s8 arg1) { - clean_effect(player, arg1); +void func_8008D0FC(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); - player->soundEffects &= ~0x80; + player->triggers &= ~DRIVING_SPINOUT_TRIGGER; player->unk_0B4 = 0; player->unk_0B8 = 2.0f; player->unk_0AC = 1; - player->effects &= ~0x10; - player->unk_044 |= 0x4000; + player->effects &= ~DRIFTING_EFFECT; + player->kartProps |= DRIVING_SPINOUT; } -void func_8008D170(Player* player, s8 arg1) { +void func_8008D170(Player* player, s8 playerIndex) { f32 var_f0; s16 var_v1; s16 var_a3; @@ -466,19 +470,19 @@ void func_8008D170(Player* player, s8 arg1) { var_v1 = 0; var_a3 = -var_a3; var_f0 *= 0.9; - if (((player->effects & 1) == 1) || !(player->unk_044 & 0x20)) { - player->effects |= 0x40000; + if (((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT) || !(player->kartProps & THROTTLE)) { + player->effects |= BANANA_SPINOUT_SAVE_EFFECT; } if (var_f0 <= 1.3) { - player->unk_044 &= ~0x4000; - if ((player->effects & 0x40000) != 0x40000) { - func_8008C73C(player, arg1); + player->kartProps &= ~DRIVING_SPINOUT; + if ((player->effects & BANANA_SPINOUT_SAVE_EFFECT) != BANANA_SPINOUT_SAVE_EFFECT) { + func_8008C73C(player, playerIndex); var_v1 = 0; } else { - player->unk_0B6 |= 0x20; - player->effects &= ~0x40000; + player->kartGraphics |= WHISTLE; + player->effects &= ~BANANA_SPINOUT_SAVE_EFFECT; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008008); var_v1 = 0; } } @@ -495,42 +499,42 @@ void func_8008D170(Player* player, s8 arg1) { player->unk_0B8 = var_f0; player->unk_0B4 = var_v1; player->unk_0AC = var_a3; - if (player->effects & 8) { - func_8008C73C(player, arg1); - player->unk_044 &= ~0x4000; + if (player->effects & MIDAIR_EFFECT) { + func_8008C73C(player, playerIndex); + player->kartProps &= ~DRIVING_SPINOUT; } } -void func_8008D3B0(Player* player, UNUSED s8 arg1) { - player->unk_044 &= 0xBFFF; +void func_8008D3B0(Player* player, UNUSED s8 playerIndex) { + player->kartProps &= ~DRIVING_SPINOUT; } -void apply_boost_sound_effect(Player* player, s8 arg1) { +void trigger_shroom(Player* player, s8 playerIndex) { - clean_effect(player, arg1); + clean_effect(player, playerIndex); - player->effects |= BOOST_EFFECT; - player->soundEffects &= ~BOOST_SOUND_EFFECT; + player->effects |= MUSHROOM_EFFECT; + player->triggers &= ~SHROOM_TRIGGER; player->unk_DB4.unk0 = 0; player->unk_DB4.unk8 = 8.0f; if (D_8015F890 != 1) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C9250(arg1); - func_800C9060(arg1, 0x1900A40B); + func_800C9250(playerIndex); + func_800C9060(playerIndex, 0x1900A40B); } } else { if (player == gPlayerOne) { - func_800C9250(arg1); - func_800C9060(arg1, 0x1900A40B); + func_800C9250(playerIndex); + func_800C9060(playerIndex, 0x1900A40B); } } player->boostTimer = 0x50; } -void apply_boost_effect(Player* player) { +void apply_mushroom_effect(Player* player) { player->currentSpeed = (f32) player->topSpeed; if (player->boostTimer > 0) { --player->boostTimer; @@ -543,22 +547,22 @@ void apply_boost_effect(Player* player) { } if (player->boostPower <= 1.0f) { - player->effects &= ~BOOST_EFFECT; + player->effects &= ~MUSHROOM_EFFECT; } } -void remove_boost_effect(Player* player) { - player->effects &= ~BOOST_EFFECT; +void remove_mushroom_effect(Player* player) { + player->effects &= ~MUSHROOM_EFFECT; player->boostPower = 0.0f; } -void func_8008D570(Player* player, s8 arg1) { - clean_effect(player, arg1); +void func_8008D570(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); player->unk_0AE = player->rotation[1]; - player->effects |= 0x80000; - player->effects &= ~0x10; - player->soundEffects &= ~0x1000; + player->effects |= UNKNOWN_EFFECT_0x80000; + player->effects &= ~DRIFTING_EFFECT; + player->triggers &= ~UNUSED_TRIGGER_0x1000; player->kartHopJerk = D_800E3730[player->characterId]; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = (f32) D_800E3710[player->characterId]; @@ -566,20 +570,20 @@ void func_8008D570(Player* player, s8 arg1) { player->unk_0C0 = 0; player->unk_07C = 0; player->unk_078 = 0; - D_8018D920[arg1] = 0; + D_8018D920[playerIndex] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C9060(arg1, 0x19008002); + func_800C9060(playerIndex, 0x19008002); } if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x2900800C); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x2900800C); } } -void func_8008D698(Player* player, s8 arg1) { +void func_8008D698(Player* player, s8 playerIndex) { s16 temp; if (player->unk_0B2 == 0) { @@ -587,15 +591,15 @@ void func_8008D698(Player* player, s8 arg1) { temp = 0; } else { player->rotation[1] -= 1820; - D_8018D920[arg1] -= 1820; - temp = ((u16) D_8018D920[arg1] / 1820); + D_8018D920[playerIndex] -= 1820; + temp = ((u16) D_8018D920[playerIndex] / 1820); } if (temp == 0) { --player->unk_0B2; if (player->unk_0B2 <= 0) { player->unk_0B2 = 0; } - if ((player->unk_0B2 == 0) && ((player->effects & 8) != 8)) { + if ((player->unk_0B2 == 0) && ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { func_8008D760(player); } } @@ -606,22 +610,22 @@ void func_8008D760(Player* player) { player->unk_07C = 0; player->unk_0C0 = 0; player->rotation[1] = player->unk_0AE; - player->effects &= 0xFFF7FFFF; + player->effects &= ~UNKNOWN_EFFECT_0x80000; player->kartGravity = gKartGravityTable[player->characterId]; - player->type &= 0xFF7F; + player->type &= ~PLAYER_UNKNOWN_0x80; } -void func_8008D7B0(Player* player, s8 arg1) { - clean_effect(player, arg1); +void func_8008D7B0(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); player->unk_0AE = player->rotation[1]; - player->effects |= 0x800000; - player->effects &= ~0x10; - player->soundEffects &= ~0x20000; + player->effects |= UNKNOWN_EFFECT_0x800000; + player->effects &= ~DRIFTING_EFFECT; + player->triggers &= ~UNUSED_TRIGGER_0x20000; player->kartHopJerk = D_800E3770[player->characterId]; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = D_800E3750[player->characterId]; - D_8018D920[arg1] = 0; + D_8018D920[playerIndex] = 0; player->unk_0B2 = 4; player->unk_0C0 = 0; player->unk_07C = 0; @@ -629,11 +633,11 @@ void func_8008D7B0(Player* player, s8 arg1) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008003); } } -void func_8008D8B4(Player* player, s8 arg1) { +void func_8008D8B4(Player* player, s8 playerIndex) { s16 temp; if (player->unk_0B2 == 0) { @@ -641,15 +645,15 @@ void func_8008D8B4(Player* player, s8 arg1) { temp = 0; } else { player->rotation[1] -= 1820; - D_8018D920[arg1] -= 1820; - temp = ((u16) (D_8018D920[arg1]) / 1820); + D_8018D920[playerIndex] -= 1820; + temp = ((u16) (D_8018D920[playerIndex]) / 1820); } if (temp == 0) { --player->unk_0B2; if (player->unk_0B2 <= 0) { player->unk_0B2 = 0; } - if ((player->unk_0B2 == 0) && ((player->effects & 8) != 8)) { + if ((player->unk_0B2 == 0) && ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { func_8008D97C(player); } } @@ -660,7 +664,7 @@ void func_8008D97C(Player* player) { player->unk_07C = 0; player->unk_0C0 = 0; player->rotation[1] = player->unk_0AE; - player->effects &= 0xFF7FFFFF; + player->effects &= ~UNKNOWN_EFFECT_0x800000; player->kartGravity = gKartGravityTable[player->characterId]; } @@ -686,39 +690,39 @@ void func_8008D9C0(Player* player) { } } -void apply_hit_sound_effect(Player* player, s8 arg1) { - clean_effect(player, arg1); +void trigger_squish(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); - if ((player->effects & HIT_EFFECT) == 0) { + if ((player->effects & SQUISH_EFFECT) == 0) { player->unk_DB4.unk2 = 0; player->unk_238 = 0; player->unk_DB4.unk10 = 4.5f; - D_8018D990[arg1] = 0; - player->effects &= ~0x08000010; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_8018D990[playerIndex] = 0; + player->effects &= ~(POST_SQUISH_EFFECT | DRIFTING_EFFECT); + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_D98 = 1; player->unk_D9C = 0.0f; player->unk_DA0 = 65.0f; - if ((player->soundEffects & 0x100) != 0) { + if ((player->triggers & THWOMP_SQUISH_TRIGGER) != 0) { player->unk_046 |= 0x80; } - if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & HIT_EFFECT) == 0)) { - func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05)); + if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & SQUISH_EFFECT) == 0)) { + func_800C90F4(playerIndex, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05)); } - player->effects |= HIT_EFFECT; - if (((player->type) & 0x1000) != 0) { - func_800098FC(arg1, player); + player->effects |= SQUISH_EFFECT; + if (((player->type) & PLAYER_CPU) != 0) { + play_cpu_sound_effect(playerIndex, player); } } } -void apply_hit_effect(Player* player, s8 arg1) { +void apply_hit_effect(Player* player, s8 playerIndex) { player->unk_0C2 = 0; player->unk_0A8 = 0; player->unk_07C = 0; @@ -726,10 +730,10 @@ void apply_hit_effect(Player* player, s8 arg1) { player->unk_08C = 0.0f; player->currentSpeed = 0.0f; // clang-format off - if ((player->collision.surfaceDistance[2] >= 600.0f) || ((player->effects & 0x1000) != 0)) { D_8018D990[arg1] = 3; } // placed block on same line to match + if ((player->collision.surfaceDistance[2] >= 600.0f) || ((player->effects & LOST_RACE_EFFECT) != 0)) { D_8018D990[playerIndex] = 3; } // placed block on same line to match // clang-format on - switch (D_8018D990[arg1]) { + switch (D_8018D990[playerIndex]) { case 0: player->unk_DB4.unk10 = 4.5f; if (player->unk_238 < 0x3D) { @@ -737,21 +741,21 @@ void apply_hit_effect(Player* player, s8 arg1) { } if ((player->unk_046 & 0x80) != 0) { - if ((player->soundEffects & 0x100) == 0) { - D_8018D990[arg1] = 1; + if ((player->triggers & THWOMP_SQUISH_TRIGGER) == 0) { + D_8018D990[playerIndex] = 1; player->unk_238 = 0; if ((player->type & PLAYER_HUMAN) != 0) { - func_800C9060(arg1, 0x1901904B); + func_800C9060(playerIndex, 0x1901904B); break; } } } else { ++player->unk_238; if (player->unk_238 >= 0x1E) { - D_8018D990[arg1] = 1; + D_8018D990[playerIndex] = 1; player->unk_238 = 0; if ((player->type & PLAYER_HUMAN) != 0) { - func_800C9060(arg1, 0x1901904B); + func_800C9060(playerIndex, 0x1901904B); break; } } @@ -766,12 +770,12 @@ void apply_hit_effect(Player* player, s8 arg1) { if ((player->unk_046 & 0x80) != 0) { if (player->unk_238 >= 0x32) { - D_8018D990[arg1] = 2; + D_8018D990[playerIndex] = 2; player->unk_238 = 0; player->unk_046 &= 0xFF7F; } } else if (player->unk_238 >= 0x50) { - D_8018D990[arg1] = 2; + D_8018D990[playerIndex] = 2; player->unk_238 = 0; } @@ -789,19 +793,19 @@ void apply_hit_effect(Player* player, s8 arg1) { case 2: ++player->unk_238; if (player->unk_238 >= 0x259) { - D_8018D990[arg1] = 3; + D_8018D990[playerIndex] = 3; player->unk_238 = 0; } if (player->collision.surfaceDistance[2] >= 600.0f) { - D_8018D990[arg1] = 3; + D_8018D990[playerIndex] = 3; } player->unk_DB4.unk10 = 4.5f; player->pos[1] -= 0.085; - if ((player->effects & 8) != 8) { - D_8018D990[arg1] = 3; + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { + D_8018D990[playerIndex] = 3; player->unk_238 = 0; } @@ -809,110 +813,111 @@ void apply_hit_effect(Player* player, s8 arg1) { break; case 3: player->unk_DB4.unk10 = 3.0f; - player->effects &= ~HIT_EFFECT; + player->effects &= ~SQUISH_EFFECT; player->unk_DB4.unk2 = 0; - player->effects |= 0x08000000; + player->effects |= POST_SQUISH_EFFECT; player->size = 1.0f; player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId]; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; if ((player->type & PLAYER_HUMAN) != 0) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008008); } break; } } -void apply_hit_rotating_sound_effect(Player* player, s8 arg1) { - clean_effect(player, arg1); +void trigger_lightning_strike(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); - player->soundEffects &= ~HIT_ROTATING_SOUND_EFFECT; - player->effects |= 0x40020000; - player->effects &= ~0x10; + player->triggers &= ~LIGHTNING_STRIKE_TRIGGER; + player->effects |= (LIGHTNING_EFFECT | LIGHTNING_STRIKE_EFFECT); + player->effects &= ~DRIFTING_EFFECT; player->unk_08C *= 0.6; player->unk_0B0 = 0; player->size = 1.0f; - D_8018D930[arg1] = gCourseTimer; + gPlayerStarEffectStartTime[playerIndex] = gCourseTimer; player->unk_0AE = player->rotation[1]; player->unk_0B2 = 2; player->unk_0C0 = 0; player->unk_07C = 0; player->unk_078 = 0; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; - D_8018D920[arg1] = 0; + D_8018D920[playerIndex] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008003); } else { - func_800098FC(arg1, player); + play_cpu_sound_effect(playerIndex, player); } if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } } -void apply_lightning_effect(Player* player, s8 arg1) { +void apply_lightning_effect(Player* player, s8 playerIndex) { s16 test; - if (((player->effects & 0x8000) == 0x8000) && ((player->effects & HIT_EFFECT) != HIT_EFFECT)) { - player->effects &= ~0x20000; + if (((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT) && + ((player->effects & SQUISH_EFFECT) != SQUISH_EFFECT)) { + player->effects &= ~LIGHTNING_STRIKE_EFFECT; player->unk_0A8 = 0; player->unk_07C = 0; player->unk_0C0 = 0; player->rotation[1] = player->unk_0AE; - remove_lightning_effect(player, arg1); - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; - apply_hit_sound_effect(player, arg1); - } else if ((player->effects & 0x20000) == 0x20000) { + remove_lightning_effect(player, playerIndex); + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; + trigger_squish(player, playerIndex); + } else if ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) { player->rotation[1] -= 0x5B0; - D_8018D920[arg1] -= 0x5B0; - test = (u16) D_8018D920[arg1] / 1456; + D_8018D920[playerIndex] -= 0x5B0; + test = (u16) D_8018D920[playerIndex] / 1456; if (test == 0) { player->unk_0B2--; if (player->unk_0B2 <= 0) { player->unk_0A8 = 0; - player->effects &= ~0x20000; + player->effects &= ~LIGHTNING_STRIKE_EFFECT; player->unk_07C = 0; player->unk_0C0 = 0; player->rotation[1] = player->unk_0AE; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; } } - decelerate_ai_player(player, 1.0f); + player_decelerate_alternative(player, 1.0f); } else { player->unk_0B0 += 1; player->unk_08C = (f32) ((f64) player->unk_08C * 0.6); if ((player->unk_0B0 == 1) && (player->type & PLAYER_HUMAN)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008005); } if ((player->unk_0B0 >= 0) && (player->unk_0B0 < 0x1CC)) { move_f32_towards(&player->size, 0.7f, 0.1f); move_f32_towards(&player->boundingBoxSize, (f32) ((f64) gKartBoundingBoxSizeTable[player->characterId] * 0.9), 0.1f); } else { - remove_lightning_effect(player, arg1); + remove_lightning_effect(player, playerIndex); if (player->type & PLAYER_HUMAN) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008008); } } } } -void remove_lightning_effect(Player* player, UNUSED s8 arg1) { +void remove_lightning_effect(Player* player, UNUSED s8 playerIndex) { move_f32_towards(&player->size, 1.0f, 0.1f); move_f32_towards(&player->boundingBoxSize, gKartBoundingBoxSizeTable[player->characterId], 0.1f); @@ -921,16 +926,16 @@ void remove_lightning_effect(Player* player, UNUSED s8 arg1) { player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId]; player->unk_DB4.unk10 = 3.0f; player->unk_DB4.unk2 = 0; - player->effects |= 0x08000000; + player->effects |= POST_SQUISH_EFFECT; - if ((player->effects & 0x20000) == 0x20000) { + if ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) { player->rotation[1] = player->unk_0AE; } - player->effects &= ~0x20000; + player->effects &= ~LIGHTNING_STRIKE_EFFECT; } -void func_8008E4A4(Player* player, s8 arg1) { +void func_8008E4A4(Player* player, s8 playerIndex) { player->unk_206 = 0; player->slopeAccel = 0; player->unk_0C0 = 0; @@ -941,28 +946,28 @@ void func_8008E4A4(Player* player, s8 arg1) { player->currentSpeed = 0.0f; player->velocity[0] = 0.0f; player->velocity[2] = 0.0f; - player->effects &= ~0xC0; + player->effects &= ~(BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT); - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { ++player->unk_0E0; } if (player->unk_0E0 == 3) { - player->effects &= ~0x01000000; + player->effects &= ~EXPLOSION_CRASH_EFFECT; player->unk_0A8 = 0; player->unk_236 = 0; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; - player->type &= ~0x80; + player->type &= ~PLAYER_UNKNOWN_0x80; - if ((gIsPlayerTripleAButtonCombo[arg1] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + if ((gIsPlayerTripleAButtonCombo[playerIndex] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } } else { player->unk_0A8 += 0x80; @@ -970,34 +975,35 @@ void func_8008E4A4(Player* player, s8 arg1) { player->unk_0A8 = 0; --player->unk_236; if (player->unk_236 == 0) { - player->effects &= ~0x01000000; + player->effects &= ~EXPLOSION_CRASH_EFFECT; player->unk_236 = 0; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } - if ((gIsPlayerTripleAButtonCombo[arg1] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + if ((gIsPlayerTripleAButtonCombo[playerIndex] == true) && + ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } - player->type &= ~0x80; + player->type &= ~PLAYER_UNKNOWN_0x80; } } } } -void apply_reverse_sound_effect(Player* player, s8 arg1) { - clean_effect(player, arg1); +void trigger_vertical_tumble(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); func_8008C310(player); player->unk_0A8 = 0; - player->effects |= 0x01000000; - player->effects &= ~0x10; + player->effects |= EXPLOSION_CRASH_EFFECT; + player->effects &= ~DRIFTING_EFFECT; player->kartHopJerk = 0.0f; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = 0.0f; @@ -1009,41 +1015,41 @@ void apply_reverse_sound_effect(Player* player, s8 arg1) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) { - func_800CA24C(arg1); + if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) { + func_800CA24C(playerIndex); } if (1) {} - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); - if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) { - func_800CA24C(arg1); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008005); + if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) { + func_800CA24C(playerIndex); } - func_800C9060(arg1, SOUND_ACTION_EXPLOSION); + func_800C9060(playerIndex, SOUND_ACTION_EXPLOSION); } else { - func_800098FC(arg1, player); + play_cpu_sound_effect(playerIndex, player); } - player->soundEffects &= ~(REVERSE_SOUND_EFFECT | 0x80000); - player->unk_0B6 |= 0x40; - gTimerBoostTripleACombo[arg1] = 0; - gIsPlayerTripleAButtonCombo[arg1] = false; - gCountASwitch[arg1] = 0; - gFrameSinceLastACombo[arg1] = 0; + player->triggers &= ~(VERTICAL_TUMBLE_TRIGGER | HIT_PADDLE_BOAT_TRIGGER); + player->kartGraphics |= CRASH; + gTimerBoostTripleACombo[playerIndex] = 0; + gIsPlayerTripleAButtonCombo[playerIndex] = false; + gCountASwitch[playerIndex] = 0; + gFrameSinceLastACombo[playerIndex] = 0; } -void func_8008E884(Player* player, s8 arg1) { - player->effects &= ~0x01000000; +void func_8008E884(Player* player, s8 playerIndex) { + player->effects &= ~EXPLOSION_CRASH_EFFECT; player->unk_0A8 = 0; player->unk_236 = 0; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; } -void apply_hit_by_item_effect(Player* player, s8 arg1) { +void apply_hit_by_star_effect(Player* player, s8 playerIndex) { player->unk_206 = 0; player->slopeAccel = 0; player->unk_0C0 = 0; @@ -1052,28 +1058,28 @@ void apply_hit_by_item_effect(Player* player, s8 arg1) { player->unk_042 += 0xAAA; player->unk_08C /= 2; player->currentSpeed = 0.0f; - player->effects &= ~0xC0; + player->effects &= ~(BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT); - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { ++player->unk_0E0; } if (player->unk_0E0 == 4) { - player->effects &= ~HIT_BY_ITEM_EFFECT; + player->effects &= ~HIT_BY_STAR_EFFECT; player->unk_0A8 = 0; player->unk_236 = 0; - D_80165190[3][arg1] = 1; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; + D_80165190[3][playerIndex] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; player->unk_042 = 0; - if ((gIsPlayerTripleAButtonCombo[arg1] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + if ((gIsPlayerTripleAButtonCombo[playerIndex] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } } else { player->unk_0A8 = (s16) (player->unk_0A8 + 0x90); @@ -1081,31 +1087,32 @@ void apply_hit_by_item_effect(Player* player, s8 arg1) { player->unk_0A8 = 0; --player->unk_236; if (player->unk_236 == 0) { - player->effects &= ~HIT_BY_ITEM_EFFECT; + player->effects &= ~HIT_BY_STAR_EFFECT; player->unk_236 = 0; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; - if ((gIsPlayerTripleAButtonCombo[arg1] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + if ((gIsPlayerTripleAButtonCombo[playerIndex] == true) && + ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + pop_player_balloon(player, playerIndex); } } } } } -void apply_hit_by_item_sound_effect(Player* player, s8 arg1) { - clean_effect(player, arg1); +void trigger_high_tumble(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); func_8008C310(player); player->unk_0A8 = 0; - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; player->kartHopJerk = 0.0f; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = 0.0f; @@ -1117,38 +1124,38 @@ void apply_hit_by_item_sound_effect(Player* player, s8 arg1) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); - func_800C9060(arg1, SOUND_ACTION_EXPLOSION); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008005); + func_800C9060(playerIndex, SOUND_ACTION_EXPLOSION); } else { - func_800098FC(arg1, player); + play_cpu_sound_effect(playerIndex, player); } - player->effects |= HIT_BY_ITEM_EFFECT; - player->unk_0B6 |= 0x40; - player->soundEffects &= ~0x01000002; + player->effects |= HIT_BY_STAR_EFFECT; + player->kartGraphics |= CRASH; + player->triggers &= ~(HIT_BY_STAR_TRIGGER | HIGH_TUMBLE_TRIGGER); - gTimerBoostTripleACombo[arg1] = 0; - gIsPlayerTripleAButtonCombo[arg1] = false; - gCountASwitch[arg1] = 0; - gFrameSinceLastACombo[arg1] = 0; + gTimerBoostTripleACombo[playerIndex] = 0; + gIsPlayerTripleAButtonCombo[playerIndex] = false; + gCountASwitch[playerIndex] = 0; + gFrameSinceLastACombo[playerIndex] = 0; } -void remove_hit_by_item_effect(Player* player, s8 arg1) { - player->effects &= ~HIT_BY_ITEM_EFFECT; +void remove_hit_by_star_effect(Player* player, s8 playerIndex) { + player->effects &= ~HIT_BY_STAR_EFFECT; player->unk_0A8 = 0; player->unk_236 = 0; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; } -void apply_boost_ramp_asphalt_sound_effect(Player* player, s8 playerId) { +void trigger_asphalt_ramp_boost(Player* player, s8 playerId) { clean_effect(player, playerId); player->effects |= BOOST_RAMP_ASPHALT_EFFECT; - player->soundEffects &= ~BOOST_RAMP_ASPHALT_SOUND_EFFECT; + player->triggers &= ~BOOST_RAMP_ASPHALT_TRIGGER; player->unk_DB4.unk0 = 0; player->unk_DB4.unk8 = 8.0f; if (D_8015F890 != 1) { @@ -1160,8 +1167,8 @@ void apply_boost_ramp_asphalt_sound_effect(Player* player, s8 playerId) { func_800C90F4(playerId, (player->characterId * 0x10) + 0x29008001); func_800C9060(playerId, 0x1900A40B); } - player->unk_044 &= ~0x1; - player->effects &= ~0x20; + player->kartProps &= ~BACK_UP; + player->effects &= ~AB_SPIN_EFFECT; } void apply_boost_ramp_asphalt_effect(Player* player) { @@ -1171,7 +1178,7 @@ void apply_boost_ramp_asphalt_effect(Player* player) { if ((u16) player->unk_256 > 0) { player->currentSpeed = 0.0f; } - if ((player->surfaceType != BOOST_RAMP_ASPHALT) && ((player->effects & 8) != 8)) { + if ((player->surfaceType != BOOST_RAMP_ASPHALT) && ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { move_f32_towards(&player->boostPower, 0, 1.0f); } else { move_f32_towards(&player->boostPower, 400.0f, 0.01f); @@ -1192,11 +1199,11 @@ void remove_boost_ramp_asphalt_effect(Player* player) { player->boostPower = 0.0f; } -void apply_boost_ramp_wood_sound_effect(Player* player, s8 playerId) { +void trigger_wood_ramp_boost(Player* player, s8 playerId) { clean_effect(player, playerId); player->effects |= BOOST_RAMP_WOOD_EFFECT; - player->soundEffects &= ~BOOST_RAMP_WOOD_SOUND_EFFECT; + player->triggers &= ~BOOST_RAMP_WOOD_TRIGGER; if (D_8015F890 != 1) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0)) { @@ -1208,14 +1215,14 @@ void apply_boost_ramp_wood_sound_effect(Player* player, s8 playerId) { func_800C9060(playerId, 0x1900A40B); } - player->unk_044 &= ~0x1; - player->effects &= ~0x20; + player->kartProps &= ~BACK_UP; + player->effects &= ~AB_SPIN_EFFECT; } void apply_boost_ramp_wood_effect(Player* player) { player->currentSpeed = gTopSpeedTable[0][player->characterId]; - if ((player->surfaceType != BOOST_RAMP_WOOD) && ((player->effects & 8) != 8)) { + if ((player->surfaceType != BOOST_RAMP_WOOD) && ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { move_f32_towards(&player->boostPower, 0, 1.0f); } else { move_f32_towards(&player->boostPower, 300.0f, 0.1f); @@ -1234,20 +1241,20 @@ void remove_boost_ramp_wood_effect(Player* player) { player->boostPower = 0.0f; } -void func_8008F104(Player* player, s8 arg1) { - clean_effect(player, arg1); +void func_8008F104(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); player->unk_0AE = player->rotation[1]; player->unk_0B2 = 2; player->unk_0C0 = 0; player->unk_07C = 0; - player->effects |= 0x4000; + player->effects |= EARLY_START_SPINOUT_EFFECT; player->unk_078 = 0; - D_8018D920[arg1] = -0x8000; + D_8018D920[playerIndex] = -0x8000; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008003); } } @@ -1256,14 +1263,14 @@ void func_8008F1B8(Player* player, s8 arg1) { player->unk_08C = (player->unk_210 * 0.05); if (player->unk_0B2 < 0) { - if ((player->unk_044 & 0x80) == 0x80) { + if ((player->kartProps & EARLY_SPINOUT_LEFT) == EARLY_SPINOUT_LEFT) { player->rotation[1] += 182; D_8018D920[arg1] += 182; temp = ((u16) D_8018D920[arg1] / 182); if (temp == 180) { - player->effects &= ~0x4000; - player->type &= ~0x80; + player->effects &= ~EARLY_START_SPINOUT_EFFECT; + player->type &= ~PLAYER_UNKNOWN_0x80; player->currentSpeed /= 3.0f; } } else { @@ -1272,8 +1279,8 @@ void func_8008F1B8(Player* player, s8 arg1) { D_8018D920[arg1] -= 182; temp = ((u16) D_8018D920[arg1] / 182); if (temp == 180) { - player->effects &= ~0x4000; - player->type &= ~0x80; + player->effects &= ~EARLY_START_SPINOUT_EFFECT; + player->type &= ~PLAYER_UNKNOWN_0x80; player->currentSpeed /= 3.0f; } } @@ -1285,8 +1292,8 @@ void func_8008F1B8(Player* player, s8 arg1) { if (temp < 71) { --player->unk_0B2; } - player->unk_044 |= 0x80; - player->unk_044 &= ~0x40; + player->kartProps |= EARLY_SPINOUT_LEFT; + player->kartProps &= ~EARLY_SPINOUT_RIGHT; return; } player->rotation[1] += 364; @@ -1295,13 +1302,13 @@ void func_8008F1B8(Player* player, s8 arg1) { if (temp >= 110) { --player->unk_0B2; } - player->unk_044 |= 0x40; - player->unk_044 &= ~0x80; + player->kartProps |= EARLY_SPINOUT_RIGHT; + player->kartProps &= ~EARLY_SPINOUT_LEFT; } } void func_8008F3E0(Player* player) { - player->effects &= ~0x4000; + player->effects &= ~EARLY_START_SPINOUT_EFFECT; } void func_8008F3F4(Player* player, UNUSED s8 arg1) { @@ -1314,45 +1321,47 @@ void func_8008F3F4(Player* player, UNUSED s8 arg1) { player->unk_0A8 = 0; --player->unk_236; if (player->unk_236 == 0) { - player->effects &= ~0x00010000; + player->effects &= ~TERRAIN_TUMBLE_EFFECT; func_80090778(player); func_80090868(player); } } } -void func_8008F494(Player* player, s8 arg1) { - if ((((player->effects & 0x80) != 0) || ((player->effects & 0x40) != 0) || ((player->effects & 0x01000000)) || - ((player->effects & HIT_BY_ITEM_EFFECT)) || ((player->effects & 0x400) != 0)) && +void func_8008F494(Player* player, s8 playerIndex) { + if ((((player->effects & BANANA_SPINOUT_EFFECT) != 0) || ((player->effects & DRIVING_SPINOUT_EFFECT) != 0) || + ((player->effects & EXPLOSION_CRASH_EFFECT)) || ((player->effects & HIT_BY_STAR_EFFECT)) || + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != 0)) && (gModeSelection == BATTLE)) { - player->unk_044 |= 0x8000; + player->kartProps |= UNKNOWN_BATTLE_VAR; } - clean_effect(player, arg1); - func_8008F86C(player, arg1); + clean_effect(player, playerIndex); + func_8008F86C(player, playerIndex); player->unk_0A8 = 0; - player->effects |= 0x10000; - player->effects &= ~0x10; + player->effects |= TERRAIN_TUMBLE_EFFECT; + player->effects &= ~DRIFTING_EFFECT; player->unk_236 = 0x1E; player->unk_042 = 0; if (((player->type & PLAYER_HUMAN) != 0) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) && - ((player->unk_0CA & 2) == 0) && ((player->unk_0DE & 1) == 0) && ((player->unk_0DE & 2) == 0)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008004); + ((player->lakituProps & HELD_BY_LAKITU) == 0) && ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) == 0) && + ((player->oobProps & PASS_OOB_OR_FLUID_LEVEL) == 0)) { + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008004); } } -void func_8008F5A4(Player* player, s8 arg1) { +void func_8008F5A4(Player* player, s8 playerIndex) { - if ((player->unk_044 & 0x8000) != 0) { - func_8006B8B4(player, arg1); - player->unk_044 &= ~0x8000; + if ((player->kartProps & UNKNOWN_BATTLE_VAR) != 0) { + pop_player_balloon(player, playerIndex); + player->kartProps &= ~UNKNOWN_BATTLE_VAR; } player->unk_206 = 0; player->slopeAccel = 0; - player->effects &= ~0x10000; + player->effects &= ~TERRAIN_TUMBLE_EFFECT; player->unk_0A8 = 0; player->unk_0C0 = 0; player->unk_07C = 0; @@ -1360,146 +1369,148 @@ void func_8008F5A4(Player* player, s8 arg1) { player->unk_078 = 0; player->currentSpeed = 0.0f; - D_80165190[0][arg1] = 1; - D_80165190[1][arg1] = 1; - D_80165190[2][arg1] = 1; - D_80165190[3][arg1] = 1; + D_80165190[0][playerIndex] = 1; + D_80165190[1][playerIndex] = 1; + D_80165190[2][playerIndex] = 1; + D_80165190[3][playerIndex] = 1; player->unk_042 = 0; } -void apply_star_effect(Player* player, s8 arg1) { - if (((s32) gCourseTimer - D_8018D930[arg1]) >= 9) { - D_8018D900[arg1] = 1; +void apply_star_effect(Player* player, s8 playerIndex) { + if (((s32) gCourseTimer - gPlayerStarEffectStartTime[playerIndex]) >= STAR_EFFECT_DURATION - 1) { + D_8018D900[playerIndex] = 1; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - if (D_8018D900[arg1] == 1) { - func_800CA730(arg1); - D_8018D900[arg1] = 0; + if (D_8018D900[playerIndex] == 1) { + func_800CA730(playerIndex); + D_8018D900[playerIndex] = 0; } - } else if (D_8018D900[arg1] == 1) { - func_800CAACC((u8) arg1); - D_8018D900[arg1] = 0; + } else if (D_8018D900[playerIndex] == 1) { + func_800CAACC((u8) playerIndex); + D_8018D900[playerIndex] = 0; } } - if (((s32) gCourseTimer - D_8018D930[arg1]) >= 0xA) { + if (((s32) gCourseTimer - gPlayerStarEffectStartTime[playerIndex]) >= STAR_EFFECT_DURATION) { player->effects &= ~STAR_EFFECT; } } // Star item -void apply_star_sound_effect(Player* player, s8 arg1) { - clean_effect(player, arg1); +void trigger_star(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); player->effects |= STAR_EFFECT; - player->soundEffects &= ~STAR_SOUND_EFFECT; - D_8018D930[arg1] = gCourseTimer; - D_8018D900[arg1] = 1; + player->triggers &= ~STAR_TRIGGER; + gPlayerStarEffectStartTime[playerIndex] = gCourseTimer; + D_8018D900[playerIndex] = 1; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - if (D_8018D900[arg1] == 1) { - func_800CA59C(arg1); - D_8018D900[arg1] = 2; + if (D_8018D900[playerIndex] == 1) { + func_800CA59C(playerIndex); + D_8018D900[playerIndex] = 2; } // This may be in charge of ending the star sound. Still unknown though. - } else if (D_8018D900[arg1] == 1) { - func_800CA984(arg1); - D_8018D900[arg1] = 2; + } else if (D_8018D900[playerIndex] == 1) { + func_800CA984(playerIndex); + D_8018D900[playerIndex] = 2; } } -void func_8008F86C(Player* player, s8 arg1) { +void func_8008F86C(Player* player, s8 playerIndex) { player->effects &= ~STAR_EFFECT; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800CA730(arg1); + func_800CA730(playerIndex); return; } - func_800CAACC(arg1); + func_800CAACC(playerIndex); } -void apply_boo_effect(Player* arg0, s8 arg1) { - s32 tmp; - tmp = ((s32) gCourseTimer) - D_8018D950[arg1]; - if (tmp < 7) { - arg0->unk_0C6 -= 2; +void apply_boo_effect(Player* player, s8 playerIndex) { + s32 time_elapsed; + time_elapsed = ((s32) gCourseTimer) - gPlayerBooEffectStartTime[playerIndex]; + if (time_elapsed < BOO_EFFECT_DURATION) { + player->alpha -= 2; - if (arg0->unk_0C6 < 0x61) { - arg0->unk_0C6 = 0x60; + if (player->alpha <= ALPHA_BOO_EFFECT) { + player->alpha = ALPHA_BOO_EFFECT; } - D_8018D970[arg1] -= 2; - if (D_8018D970[arg1] <= 0) { - D_8018D970[arg1] = 0; + // Player becomes invisible to other players + gPlayerOtherScreensAlpha[playerIndex] -= 2; + if (gPlayerOtherScreensAlpha[playerIndex] <= 0) { + gPlayerOtherScreensAlpha[playerIndex] = 0; } } else { - arg0->unk_0C6 += 4; - if (arg0->unk_0C6 >= 0xF0) { - arg0->unk_0C6 = 0xFF; - D_8018D970[arg1] = 0xFF; - arg0->effects &= ~0x80000000; - if ((arg0->type & 0x4000) != 0) { - func_800CB064(arg1); + // Player returns to normal visibility + player->alpha += 4; + if (player->alpha >= 0xF0) { + player->alpha = ALPHA_MAX; + gPlayerOtherScreensAlpha[playerIndex] = ALPHA_MAX; + player->effects &= ~BOO_EFFECT; + if ((player->type & PLAYER_HUMAN) != 0) { + func_800CB064(playerIndex); } } - D_8018D970[arg1] += 8; - if (D_8018D970[arg1] >= 0xF0) { - D_8018D970[arg1] = 0xFF; - arg0->unk_0C6 = 0xFF; - arg0->effects &= ~0x80000000; - if ((arg0->type & 0x4000) != 0) { - func_800CB064(arg1); + gPlayerOtherScreensAlpha[playerIndex] += 8; + if (gPlayerOtherScreensAlpha[playerIndex] >= 0xF0) { + gPlayerOtherScreensAlpha[playerIndex] = ALPHA_MAX; + player->alpha = ALPHA_MAX; + player->effects &= ~BOO_EFFECT; + if ((player->type & PLAYER_HUMAN) != 0) { + func_800CB064(playerIndex); } } } } -void apply_boo_sound_effect(Player* player, s8 arg1) { +void trigger_boo(Player* player, s8 playerIndex) { s16 temp_v1; - + // become boo if ((player->type & PLAYER_HUMAN) != 0) { - player->unk_044 |= 0x200; + player->kartProps |= BECOME_INVISIBLE; for (temp_v1 = 0; temp_v1 < 10; ++temp_v1) { - player->unk_258[temp_v1].unk_01C = 0; - player->unk_258[temp_v1].unk_01E = 0; - player->unk_258[temp_v1].unk_012 = 0; + player->particlePool0[temp_v1].isAlive = 0; + player->particlePool0[temp_v1].timer = 0; + player->particlePool0[temp_v1].type = 0; } } - clean_effect(player, arg1); + clean_effect(player, playerIndex); player->effects |= BOO_EFFECT; - player->soundEffects &= ~BOO_SOUND_EFFECT; - D_8018D950[arg1] = gCourseTimer; - D_8018D970[arg1] = 0xFF; + player->triggers &= ~BOO_TRIGGER; + gPlayerBooEffectStartTime[playerIndex] = gCourseTimer; + gPlayerOtherScreensAlpha[playerIndex] = ALPHA_MAX; if ((player->type & PLAYER_HUMAN) != 0) { - func_800CAFC0(arg1); + func_800CAFC0(playerIndex); } } -void func_8008FB30(Player* arg0, s8 arg1) { - arg0->unk_0C6 += 8; - if (arg0->unk_0C6 >= 0xF0) { - arg0->unk_0C6 = 0xFF; - D_8018D970[arg1] = 0xFF; +void func_8008FB30(Player* player, s8 playerIndex) { + player->alpha += 8; + if (player->alpha >= 0xF0) { + player->alpha = ALPHA_MAX; + gPlayerOtherScreensAlpha[playerIndex] = ALPHA_MAX; - arg0->effects &= ~0x80000000; - if ((arg0->type & 0x4000) != 0) { - func_800CB064(arg1); + player->effects &= ~BOO_EFFECT; + if ((player->type & PLAYER_HUMAN) != 0) { + func_800CB064(playerIndex); } } - D_8018D970[arg1] += 0x10; - if (D_8018D970[arg1] >= 0xE0) { - D_8018D970[arg1] = 0xFF; - arg0->unk_0C6 = 0xFF; - arg0->effects &= ~0x80000000; - if ((arg0->type & 0x4000) != 0) { - func_800CB064(arg1); + gPlayerOtherScreensAlpha[playerIndex] += 0x10; + if (gPlayerOtherScreensAlpha[playerIndex] >= 0xE0) { + gPlayerOtherScreensAlpha[playerIndex] = ALPHA_MAX; + player->alpha = ALPHA_MAX; + player->effects &= ~BOO_EFFECT; + if ((player->type & PLAYER_HUMAN) != 0) { + func_800CB064(playerIndex); } } } @@ -1509,17 +1520,17 @@ void func_8008FC1C(Player* player) { if ((player->type & PLAYER_UNKNOWN_0x40) != 0) { playerIndex = get_player_index_for_player(player); - player->type = 0x7000; + player->type = (PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_CPU); func_80056A94(playerIndex); } } void func_8008FC64(Player* player, s8 arg1) { - player->unk_0C6 -= 4; - if (player->unk_0C6 < 5) { - player->unk_0C6 = 0; - player->soundEffects &= 0xFBFFFFFF; - player->soundEffects |= 0x08000000; + player->alpha -= 4; + if (player->alpha < 5) { + player->alpha = ALPHA_MIN; + player->triggers &= ~LOSE_BATTLE_EFFECT; + player->triggers |= BECOME_BOMB_EFFECT; player->type |= PLAYER_UNKNOWN_0x40; func_8008FDA8(player, arg1); @@ -1527,133 +1538,135 @@ void func_8008FC64(Player* player, s8 arg1) { } } -void func_8008FCDC(Player* player, s8 arg1) { - player->unk_0C6 += 2; - if (player->unk_0C6 >= 0xF0) { - player->unk_0C6 = 0xFF; - player->soundEffects &= ~0x08000000; +void func_8008FCDC(Player* player, s8 playerIndex) { + player->alpha += 2; + if (player->alpha >= 0xF0) { + player->alpha = ALPHA_MAX; + player->triggers &= ~BECOME_BOMB_EFFECT; } - func_80056A40(arg1, (u32) player->unk_0C6); + func_80056A40(playerIndex, (u32) player->alpha); } void func_8008FD4C(Player* player, UNUSED s8 arg1) { s16 temp_v0; - player->soundEffects |= 0x04000000; - player->unk_044 |= 0x200; + player->triggers |= LOSE_BATTLE_EFFECT; + player->kartProps |= BECOME_INVISIBLE; for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { - player->unk_258[temp_v0].unk_01C = 0; - player->unk_258[temp_v0].unk_01E = 0; - player->unk_258[temp_v0].unk_012 = 0; + player->particlePool0[temp_v0].isAlive = 0; + player->particlePool0[temp_v0].timer = 0; + player->particlePool0[temp_v0].type = 0; } } - +// become bomb void func_8008FDA8(Player* player, UNUSED s8 arg1) { s16 temp_v0; - player->unk_044 |= 0x200; + player->kartProps |= BECOME_INVISIBLE; for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { - player->unk_258[temp_v0].unk_01C = 0; - player->unk_258[temp_v0].unk_01E = 0; - player->unk_258[temp_v0].unk_012 = 0; + player->particlePool0[temp_v0].isAlive = 0; + player->particlePool0[temp_v0].timer = 0; + player->particlePool0[temp_v0].type = 0; } } -void func_8008FDF4(Player* player, UNUSED s8 arg1) { - clean_effect(player, arg1); +void func_8008FDF4(Player* player, s8 playerIndex) { + clean_effect(player, playerIndex); - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; player->kartHopJerk = D_800E37F0[player->characterId]; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = D_800E37D0[player->characterId]; - player->soundEffects &= ~0x00100000; - player->effects |= 0x10000000; + player->triggers &= ~UNUSED_TRIGGER_0x10000; + player->effects |= UNKNOWN_EFFECT_0x10000000; } -void func_8008FE84(Player* player, UNUSED s8 arg1) { - player->effects &= ~0x10; - if ((player->effects & 8) != 8) { - player->effects &= ~0x10000000; +void func_8008FE84(Player* player, UNUSED s8 playerIndex) { + player->effects &= ~DRIFTING_EFFECT; + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { + player->effects &= ~UNKNOWN_EFFECT_0x10000000; player->currentSpeed /= 2; player->unk_08C /= 2; } } -void func_8008FEDC(Player* player, UNUSED s8 arg1) { - player->effects &= ~0x10000000; +void func_8008FEDC(Player* player, UNUSED s8 playerIndex) { + player->effects &= ~UNKNOWN_EFFECT_0x10000000; player->kartHopJerk = 0.0f; player->kartHopVelocity = 0.0f; player->kartHopAcceleration = 0.0f; } -void func_8008FF08(Player* player, s8 playerId) { - s16 waypoint; +void course_update_path_point(Player* player, s8 playerId) { + s16 pathPoint; + +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_BOWSER_CASTLE: - waypoint = gNearestWaypointByPlayerId[playerId]; - if ((waypoint >= 0x235) && (waypoint < 0x247)) { - player->nearestWaypointId = 0x214; - } else if ((waypoint >= 0x267) && (waypoint < 0x277)) { - player->nearestWaypointId = 0x25B; + pathPoint = gNearestPathPointByPlayerId[playerId]; + if ((pathPoint >= 0x235) && (pathPoint < 0x247)) { + player->nearestPathPointId = 0x214; + } else if ((pathPoint >= 0x267) && (pathPoint < 0x277)) { + player->nearestPathPointId = 0x25B; } else { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } break; case COURSE_BANSHEE_BOARDWALK: - waypoint = gNearestWaypointByPlayerId[playerId]; - if ((waypoint >= 0x12C) && (waypoint < 0x13C)) { - player->nearestWaypointId = 0x12CU; + pathPoint = gNearestPathPointByPlayerId[playerId]; + if ((pathPoint >= 0x12C) && (pathPoint < 0x13C)) { + player->nearestPathPointId = 0x12CU; } else { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } break; case COURSE_YOSHI_VALLEY: case COURSE_RAINBOW_ROAD: - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; + player->nearestPathPointId = gCopyNearestPathPointByPlayerId[playerId]; break; case COURSE_FRAPPE_SNOWLAND: - waypoint = gNearestWaypointByPlayerId[playerId]; + pathPoint = gNearestPathPointByPlayerId[playerId]; #ifdef VERSION_EU - if (((waypoint >= 0xF0) && (waypoint < 0x11E)) || ((gCopyNearestWaypointByPlayerId[playerId] >= 0xF0) && - (gCopyNearestWaypointByPlayerId[playerId] < 0x11E))) + if (((pathPoint >= 0xF0) && (pathPoint < 0x11E)) || ((gCopyNearestPathPointByPlayerId[playerId] >= 0xF0) && + (gCopyNearestPathPointByPlayerId[playerId] < 0x11E))) #else - if ((waypoint >= 0xF0) && (waypoint < 0x105)) + if ((pathPoint >= 0xF0) && (pathPoint < 0x105)) #endif { - player->nearestWaypointId = 0xF0U; + player->nearestPathPointId = 0xF0U; } else { - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gCopyNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } break; case COURSE_ROYAL_RACEWAY: - waypoint = gNearestWaypointByPlayerId[playerId]; - if ((waypoint >= 0x258) && (waypoint < 0x2A4)) { - player->nearestWaypointId = 0x258U; + pathPoint = gNearestPathPointByPlayerId[playerId]; + if ((pathPoint >= 0x258) && (pathPoint < 0x2A4)) { + player->nearestPathPointId = 0x258U; } else { - player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gCopyNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } break; case COURSE_DK_JUNGLE: - waypoint = gNearestWaypointByPlayerId[playerId]; - if ((waypoint >= 0xB9) && (waypoint < 0x119)) { - player->nearestWaypointId = 0xB9U; + pathPoint = gNearestPathPointByPlayerId[playerId]; + if ((pathPoint >= 0xB9) && (pathPoint < 0x119)) { + player->nearestPathPointId = 0xB9U; } else { - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } } break; @@ -1661,20 +1674,23 @@ void func_8008FF08(Player* player, s8 playerId) { case COURSE_SKYSCRAPER: case COURSE_DOUBLE_DECK: case COURSE_BIG_DONUT: - player->nearestWaypointId = 0U; + player->nearestPathPointId = 0U; break; default: - player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; - if (player->nearestWaypointId < 0) { - player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId; + player->nearestPathPointId = gNearestPathPointByPlayerId[playerId]; + if (player->nearestPathPointId < 0) { + player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId; } break; } +#else + +#endif } void func_80090178(Player* player, s8 playerId, Vec3f arg2, Vec3f arg3) { u16 test; - TrackWaypoint* temp_v1; + TrackPathPoint* temp_v1; f32 spF8[4] = { 0.0f, 0.0f, -700.0f, 700.0f }; f32 spE8[4] = { 700.0f, -700.0f, 0.0f, 0.0f }; f32 spD8[4] = { 0.0f, 0.0f, -650.0f, 650.0f }; @@ -1694,14 +1710,14 @@ void func_80090178(Player* player, s8 playerId, Vec3f arg2, Vec3f arg3) { switch (gCurrentCourseId) { case COURSE_YOSHI_VALLEY: - test = player->nearestWaypointId; - temp_v1 = &D_80164550[gCopyPathIndexByPlayerId[playerId]][test]; + test = player->nearestPathPointId; + temp_v1 = &gTrackPaths[gCopyPathIndexByPlayerId[playerId]][test]; arg2[0] = temp_v1->posX; arg2[1] = temp_v1->posY; arg2[2] = temp_v1->posZ; - temp_v1 = &D_80164550[gCopyPathIndexByPlayerId[playerId]] - [(player->nearestWaypointId + 5) % - (gWaypointCountByPathIndex[gCopyPathIndexByPlayerId[playerId]] + 1)]; + temp_v1 = &gTrackPaths[gCopyPathIndexByPlayerId[playerId]] + [(player->nearestPathPointId + 5) % + (gPathCountByPathIndex[gCopyPathIndexByPlayerId[playerId]] + 1)]; arg3[0] = temp_v1->posX; arg3[1] = temp_v1->posY; arg3[2] = temp_v1->posZ; @@ -1739,12 +1755,12 @@ void func_80090178(Player* player, s8 playerId, Vec3f arg2, Vec3f arg3) { arg3[2] = sp08[playerId]; break; default: - test = player->nearestWaypointId; - temp_v1 = &D_80164550[0][test]; + test = player->nearestPathPointId; + temp_v1 = &gTrackPaths[0][test]; arg2[0] = temp_v1->posX; arg2[1] = temp_v1->posY; arg2[2] = temp_v1->posZ; - temp_v1 = &D_80164550[0][(player->nearestWaypointId + 5) % (gWaypointCountByPathIndex[0] + 1)]; + temp_v1 = &gTrackPaths[0][(player->nearestPathPointId + 5) % (gPathCountByPathIndex[0] + 1)]; arg3[0] = temp_v1->posX; arg3[1] = temp_v1->posY; arg3[2] = temp_v1->posZ; @@ -1758,8 +1774,8 @@ void func_80090778(Player* player) { player->unk_078 = 0; player->unk_07C = 0; player->unk_0C0 = 0; - player->unk_0CA |= 8; - player->effects &= ~0x10; + player->lakituProps |= LAKITU_SCENE; + player->effects &= ~DRIFTING_EFFECT; player->unk_222 = 0; player->unk_08C = 0.0f; @@ -1770,8 +1786,8 @@ void func_80090778(Player* player) { player->unk_0C2 = 0; player->unk_DB4.unk8 = 0.0f; if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) { - if ((player->effects & 0x20000) == 0x20000) { - player->effects &= ~0x20000; + if ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) { + player->effects &= ~LIGHTNING_STRIKE_EFFECT; player->unk_0A8 = 0; player->unk_07C = 0; player->unk_0C0 = 0; @@ -1779,7 +1795,7 @@ void func_80090778(Player* player) { } remove_lightning_effect(player, playerIndex); } - player->effects &= ~0x20; + player->effects &= ~AB_SPIN_EFFECT; } void func_80090868(Player* player) { @@ -1791,24 +1807,25 @@ void func_80090868(Player* player) { player->unk_08C = 0.0f; playerIndex = get_player_index_for_player(player); - if ((player->unk_0CA & 2) != 2) { + if ((player->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU) { player->unk_D98 = 1; player->unk_D9C = 0.0f; player->unk_DA0 = 0.5f; - func_8008FF08(player, playerIndex); + course_update_path_point(player, playerIndex); player->unk_222 = 0; - player->unk_0CA |= 2; + player->lakituProps |= HELD_BY_LAKITU; player->unk_0C8 = 0; - if ((player->unk_0DE & 1) == 1) { + if ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) == UNDER_OOB_OR_FLUID_LEVEL) { if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) || (gCurrentCourseId == COURSE_BIG_DONUT)) { - player->unk_0CA |= 0x1000; + player->lakituProps |= LAKITU_LAVA; } else { - player->unk_0CA |= 0x2000; + player->lakituProps |= LAKITU_WATER; } - + // removing the water effect for Sherbet Land makes sense. Perhaps rainbow road and skyscraper + // had lava instead of an abyss initially? if ((gCurrentCourseId == COURSE_SHERBET_LAND) || (gCurrentCourseId == COURSE_SKYSCRAPER) || (gCurrentCourseId == COURSE_RAINBOW_ROAD)) { - player->unk_0CA &= ~0x3000; + player->lakituProps &= ~(LAKITU_LAVA | LAKITU_WATER); } } } @@ -1819,7 +1836,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { UNUSED s32 stackPadding1; Vec3f sp44; Vec3f sp38; - TrackWaypoint* waypoint; + TrackPathPoint* pathPoint; UNUSED s32 stackPadding2; UNUSED s32 stackPadding3; @@ -1831,8 +1848,8 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { clean_effect(player, playerId); switch (player->unk_222) { case 0: - if ((player->unk_0CA & 1) == 1) { - if ((player->unk_0C8 < 0x3C) || ((player->unk_0CA & 2) != 2)) { + if ((player->lakituProps & LAKITU_RETRIEVAL) == LAKITU_RETRIEVAL) { + if ((player->unk_0C8 < 0x3C) || ((player->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU)) { player->unk_0C8++; if (player->unk_0C8 >= 0x3C) { player->unk_0C8 = 0x003C; @@ -1842,17 +1859,17 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { move_s16_towards(&player->unk_0CC[arg2], 0, 0.2f); if ((D_801652A0[playerId] + 40.0f) <= player->pos[1]) { player->unk_222 = 1; - player->unk_0CA |= 4; - player->unk_0C6 = 0x00FF; + player->lakituProps |= LAKITU_FIZZLE; + player->alpha = 0x00FF; } } - } else if ((player->unk_0CA & 2) == 2) { + } else if ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) { move_f32_towards(&player->pos[1], player->unk_074 + 100.0f, 0.025f); move_s16_towards(&player->unk_0CC[arg2], 0, 0.2f); if ((player->unk_074 + 40.0f) <= player->pos[1]) { player->unk_222 = 1; - player->unk_0CA |= 4; - player->unk_0C6 = 0x00FF; + player->lakituProps |= LAKITU_FIZZLE; + player->alpha = 0x00FF; } } if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { @@ -1860,31 +1877,31 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { } break; case 1: - if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_KART_AI) == 0)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_CPU) == 0)) { func_8009E088(playerId, 0xA); } - if ((player->unk_0CA & 1) == 1) { + if ((player->lakituProps & LAKITU_RETRIEVAL) == LAKITU_RETRIEVAL) { move_f32_towards(&player->pos[1], D_801652A0[playerId] + 40.0f, 0.02f); - player->unk_0C6 -= 8; - if (player->unk_0C6 < 9) { - player->unk_0C6 = 0; + player->alpha -= 8; + if (player->alpha < 9) { + player->alpha = 0; player->unk_222 = 2; - player->unk_0CA &= ~0x0001; + player->lakituProps &= ~LAKITU_RETRIEVAL; } } else { move_f32_towards(&player->pos[1], player->oldPos[1] + 40.0f, 0.02f); - player->unk_0C6 -= 8; - if (player->unk_0C6 < 9) { - player->unk_0C6 = 0; + player->alpha -= 8; + if (player->alpha < 9) { + player->alpha = 0; player->unk_222 = 2; } } - player->unk_0CA &= ~0x2000; + player->lakituProps &= ~LAKITU_WATER; break; case 2: func_80090178(player, playerId, sp44, sp38); // Fakematch found by Verti, who knows what's going on here - player->rotation[1] = (u16) -get_angle_between_two_vectors(sp44, sp38) & 0xFFFF; + player->rotation[1] = (u16) -get_xz_angle_between_points(sp44, sp38) & 0xFFFF; player->pos[0] = sp44[0]; player->pos[1] = sp44[1] + 40.0f; player->pos[2] = sp44[2]; @@ -1892,7 +1909,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { break; case 3: D_80165330[playerId] = 0; - if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_KART_AI) == 0)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_CPU) == 0)) { func_8009E020(playerId, 0x14); } func_80090178(player, playerId, sp44, sp38); @@ -1901,11 +1918,11 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { player->pos[2] = sp44[2]; player->pos[2] = player->pos[2] + coss((playerId * 0x1C70) - player->rotation[1]) * -5.0f; player->pos[0] = player->pos[0] + sins((playerId * 0x1C70) - player->rotation[1]) * -5.0f; - player->unk_0C6 += 8; - if (player->unk_0C6 >= 0xF0) { - player->unk_0C6 = 0x00FF; + player->alpha += 8; + if (player->alpha >= 0xF0) { + player->alpha = 0x00FF; player->unk_222 = 4; - player->unk_0CA &= ~0x0004; + player->lakituProps &= ~LAKITU_FIZZLE; player->unk_0C8 = 0; } break; @@ -1915,26 +1932,26 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { player->pos[0] = player->pos[0] + sins(-player->rotation[1]) * -10.0f; } if (player->unk_0C8 == 0x00FC) { - waypoint = D_80164550[0]; - player->pos[0] = waypoint->posX; - player->pos[1] = waypoint->posY; - player->pos[2] = waypoint->posZ; + pathPoint = gTrackPaths[0]; + player->pos[0] = pathPoint->posX; + player->pos[1] = pathPoint->posY; + player->pos[2] = pathPoint->posZ; } move_f32_towards(&player->pos[1], (player->unk_074 + player->boundingBoxSize) - 2.0f, 0.04f); player->unk_0C8++; - if (((player->effects & 8) != 8) || (player->effects & 0x8000)) { - player->unk_0CA &= ~0x1000; + if (((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) || (player->effects & ENEMY_BONK_EFFECT)) { + player->lakituProps &= ~LAKITU_LAVA; if (player->unk_0C8 >= 0x5B) { if (player->type & PLAYER_HUMAN) { func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); } if (gModeSelection == BATTLE) { - func_8006B8B4(player, playerId); + pop_player_balloon(player, playerId); } - player->unk_0CA &= ~0x0002; - player->unk_0DE &= ~0x0004; - if ((player->unk_0CA & 0x80) != 0x80) { - player->unk_0CA &= ~0x0008; + player->lakituProps &= ~HELD_BY_LAKITU; + player->oobProps &= ~UNDER_FLUID_LEVEL; + if ((player->lakituProps & FROZEN_EFFECT) != FROZEN_EFFECT) { + player->lakituProps &= ~LAKITU_SCENE; if ((player->topSpeed * 0.9) <= player->currentSpeed) { func_8008F104(player, playerId); } @@ -1963,14 +1980,16 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) { } } -#define EFFECT_BLACKLIST_USE_ITEM \ - LIGHTNING_EFFECT | 0x10000000 | 0x8000000 | HIT_EFFECT | HIT_BY_ITEM_EFFECT | 0x1000000 | 0x800000 | \ - BOOST_RAMP_ASPHALT_EFFECT | 0x20000 | 0x10000 | 0x4000 | 0x800 | 0x400 | STAR_EFFECT | 0x80 | 0x40 | \ - BOOST_RAMP_WOOD_EFFECT +#define BLOCK_ITEM_USE_EFFECTS \ + LIGHTNING_EFFECT | UNKNOWN_EFFECT_0x10000000 | POST_SQUISH_EFFECT | SQUISH_EFFECT | HIT_BY_STAR_EFFECT | \ + EXPLOSION_CRASH_EFFECT | UNKNOWN_EFFECT_0x800000 | BOOST_RAMP_ASPHALT_EFFECT | LIGHTNING_STRIKE_EFFECT | \ + TERRAIN_TUMBLE_EFFECT | EARLY_START_SPINOUT_EFFECT | BANANA_NEAR_SPINOUT_EFFECT | HIT_BY_GREEN_SHELL_EFFECT | \ + STAR_EFFECT | BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT | BOOST_RAMP_WOOD_EFFECT bool prevent_item_use(Player* player) { s32 phi_v0 = 0; - if ((((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || + if ((((((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->lakituProps & LAKITU_SCENE) == LAKITU_SCENE)) || ((player->type & PLAYER_UNKNOWN_0x40) != 0)) || ((player->type & PLAYER_CINEMATIC_MODE) != 0)) || ((player->type & PLAYER_EXISTS) == 0)) { @@ -1982,15 +2001,15 @@ bool prevent_item_use(Player* player) { case ITEM_DOUBLE_MUSHROOM: case ITEM_TRIPLE_MUSHROOM: case ITEM_SUPER_MUSHROOM: - if ((player->effects & 8) != 0) { + if ((player->effects & MIDAIR_EFFECT) != 0) { return true; } - phi_v0 = EFFECT_BLACKLIST_USE_ITEM; + phi_v0 = BLOCK_ITEM_USE_EFFECTS; goto prevent_item_use_label; case ITEM_STAR: - phi_v0 = BOO_EFFECT | EFFECT_BLACKLIST_USE_ITEM; + phi_v0 = BOO_EFFECT | BLOCK_ITEM_USE_EFFECTS; case ITEM_BOO: - phi_v0 = phi_v0 | (BOO_EFFECT | EFFECT_BLACKLIST_USE_ITEM); + phi_v0 = phi_v0 | (BOO_EFFECT | BLOCK_ITEM_USE_EFFECTS); prevent_item_use_label: default: if ((player->effects & phi_v0) != 0) { @@ -2000,13 +2019,14 @@ bool prevent_item_use(Player* player) { } } +// UNUSED void func_800911B4(Player* player, s8 arg1) { s32 temp_v0; player->unk_0AE = player->rotation[1]; - player->unk_044 |= 0x1800; - player->unk_044 &= ~0x0400; - player->unk_044 |= 0x2000; + player->kartProps |= (UNUSED_0x1000 | UNUSED_0x800); + player->kartProps &= ~UNUSED_0x400; + player->kartProps |= UNUSED_0x2000; player->kartHopJerk = 0.002f; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = 2.6f; @@ -2016,39 +2036,40 @@ void func_800911B4(Player* player, s8 arg1) { player->unk_078 = 0; D_8018D920[arg1] = 0; - player->unk_258[31].unk_012 = 0; - player->unk_258[31].unk_01E = 0; - player->unk_258[31].unk_01C = 0; - player->unk_258[30].unk_012 = 0; - player->unk_258[30].unk_01E = 0; - player->unk_258[30].unk_01C = 0; + player->particlePool3[1].type = 0; + player->particlePool3[1].timer = 0; + player->particlePool3[1].isAlive = 0; + player->particlePool3[0].type = 0; + player->particlePool3[0].timer = 0; + player->particlePool3[0].isAlive = 0; // clang-format off temp_v0 = 2; do { // clang-format on - player->unk_258[31 + temp_v0].unk_01C = 0; - player->unk_258[31 + temp_v0].unk_01E = 0; - player->unk_258[31 + temp_v0].unk_012 = 0; - player->unk_258[32 + temp_v0].unk_01C = 0; - player->unk_258[32 + temp_v0].unk_01E = 0; - player->unk_258[32 + temp_v0].unk_012 = 0; - player->unk_258[33 + temp_v0].unk_01C = 0; - player->unk_258[33 + temp_v0].unk_01E = 0; - player->unk_258[33 + temp_v0].unk_012 = 0; + player->particlePool3[1 + temp_v0].isAlive = 0; + player->particlePool3[1 + temp_v0].timer = 0; + player->particlePool3[1 + temp_v0].type = 0; + player->particlePool3[2 + temp_v0].isAlive = 0; + player->particlePool3[2 + temp_v0].timer = 0; + player->particlePool3[2 + temp_v0].type = 0; + player->particlePool3[3 + temp_v0].isAlive = 0; + player->particlePool3[3 + temp_v0].timer = 0; + player->particlePool3[3 + temp_v0].type = 0; temp_v0 += 4; - player->unk_258[26 + temp_v0].unk_01C = 0; - player->unk_258[26 + temp_v0].unk_01E = 0; - player->unk_258[26 + temp_v0].unk_012 = 0; + player->particlePool2[6 + temp_v0].isAlive = 0; + player->particlePool2[6 + temp_v0].timer = 0; + player->particlePool2[6 + temp_v0].type = 0; } while (temp_v0 < 10); } +// unused void func_80091298(Player* player, s8 arg1) { s16 var_v1; UNUSED s32 stackPadding1; Vec3f spC = { 27.167f, 25.167f, 23.167f }; - player->unk_044 |= 0x2000; + player->kartProps |= UNUSED_0x2000; if (player->unk_0B2 == 0) { var_v1 = 0; } else { @@ -2070,11 +2091,11 @@ void func_80091298(Player* player, s8 arg1) { player->unk_07C = 0; player->unk_0C0 = 0; player->unk_DB4.unkC = 3.0f; - player->unk_044 &= ~0x800; + player->kartProps &= ~UNUSED_0x800; player->kartGravity = gKartGravityTable[player->characterId]; player->unk_0D4[0] = 0; player->type |= PLAYER_START_SEQUENCE; - player->unk_094 = 0.0f; + player->speed = 0.0f; player->unk_08C = 0.0f; player->currentSpeed = 0.0f; if (arg1 == 0) { @@ -2086,8 +2107,8 @@ void func_80091298(Player* player, s8 arg1) { } void func_80091440(s8 arg0) { - if ((gPlayers[arg0].unk_044 & 0x800) == 0) { - gPlayers[arg0].unk_044 |= 0x2400; - gPlayers[arg0].type &= ~0x2000; + if ((gPlayers[arg0].kartProps & UNUSED_0x800) == 0) { + gPlayers[arg0].kartProps |= (UNUSED_0x2000 | UNUSED_0x400); + gPlayers[arg0].type &= ~PLAYER_START_SEQUENCE; } } diff --git a/src/effects.h b/src/effects.h index cecf863f22..5649359d5d 100644 --- a/src/effects.h +++ b/src/effects.h @@ -59,9 +59,9 @@ void func_8008D0E4(Player*, s8); void func_8008D0FC(Player*, s8); void func_8008D170(Player*, s8); void func_8008D3B0(Player*, s8); -void apply_boost_sound_effect(Player*, s8); -void apply_boost_effect(Player*); -void remove_boost_effect(Player*); +void trigger_shroom(Player*, s8); +void apply_mushroom_effect(Player*); +void remove_mushroom_effect(Player*); void func_8008D570(Player*, s8); void func_8008D698(Player*, s8); void func_8008D760(Player*); @@ -69,21 +69,21 @@ void func_8008D7B0(Player*, s8); void func_8008D8B4(Player*, s8); void func_8008D97C(Player*); void func_8008D9C0(Player*); -void apply_hit_sound_effect(Player*, s8); +void trigger_squish(Player*, s8); void apply_hit_effect(Player*, s8); -void apply_hit_rotating_sound_effect(Player*, s8); +void trigger_lightning_strike(Player*, s8); void apply_lightning_effect(Player*, s8); void remove_lightning_effect(Player*, s8); void func_8008E4A4(Player*, s8); -void apply_reverse_sound_effect(Player*, s8); +void trigger_vertical_tumble(Player*, s8); void func_8008E884(Player*, s8); -void apply_hit_by_item_effect(Player*, s8); -void apply_hit_by_item_sound_effect(Player*, s8); -void remove_hit_by_item_effect(Player*, s8); -void apply_boost_ramp_asphalt_sound_effect(Player*, s8); +void apply_hit_by_star_effect(Player*, s8); +void trigger_high_tumble(Player*, s8); +void remove_hit_by_star_effect(Player*, s8); +void trigger_asphalt_ramp_boost(Player*, s8); void apply_boost_ramp_asphalt_effect(Player*); void remove_boost_ramp_asphalt_effect(Player*); -void apply_boost_ramp_wood_sound_effect(Player*, s8); +void trigger_wood_ramp_boost(Player*, s8); void apply_boost_ramp_wood_effect(Player*); void remove_boost_ramp_wood_effect(Player*); void func_8008F104(Player*, s8); @@ -93,10 +93,10 @@ void func_8008F3F4(Player*, s8); void func_8008F494(Player*, s8); void func_8008F5A4(Player*, s8); void apply_star_effect(Player*, s8); -void apply_star_sound_effect(Player*, s8); +void trigger_star(Player*, s8); void func_8008F86C(Player*, s8); void apply_boo_effect(Player*, s8); -void apply_boo_sound_effect(Player*, s8); +void trigger_boo(Player*, s8); void func_8008FB30(Player*, s8); void func_8008FC1C(Player*); void func_8008FC64(Player*, s8); @@ -106,7 +106,7 @@ void func_8008FDA8(Player*, s8); void func_8008FDF4(Player*, s8); void func_8008FE84(Player*, s8); void func_8008FEDC(Player*, s8); -void func_8008FF08(Player*, s8); +void course_update_path_point(Player*, s8); void func_80090178(Player*, s8, Vec3f, Vec3f); void func_80090778(Player*); void func_80090868(Player*); @@ -125,9 +125,9 @@ void func_800CB064(u8); extern s32 D_8018D900[]; extern s16 D_8018D920[]; -extern s32 D_8018D930[]; -extern s32 D_8018D950[]; -extern s32 D_8018D970[]; +extern s32 gPlayerStarEffectStartTime[]; +extern s32 gPlayerBooEffectStartTime[]; +extern s32 gPlayerOtherScreensAlpha[]; extern s32 D_8018D990[]; /* This is where I'd put my static data, if I had any */ @@ -141,7 +141,7 @@ extern f32 D_800E3790[]; extern f32 D_800E37D0[]; extern f32 D_800E37F0[]; extern s16 D_80165190[4][8]; -extern f32 D_80165280[]; +extern f32 gPlayerCurrentSpeed[]; extern s32 gFrameSinceLastACombo[]; #endif diff --git a/src/ending/camera_junk.c b/src/ending/camera_junk.c index 2d1baa920b..5f360ea41b 100644 --- a/src/ending/camera_junk.c +++ b/src/ending/camera_junk.c @@ -1,5 +1,6 @@ #include #include +#include #include #include "camera_junk.h" @@ -38,7 +39,7 @@ void init_camera_podium_ceremony(void) { cameras[0].up[2] = 0.0f; gCameraZoom[0] = 40.0f; gScreenAspect = 1.33333333f; - D_80150150 = 3.0f; - D_8015014C = 6800.0f; + gCourseNearPersp = 3.0f; + gCourseFarPersp = 6800.0f; init_cinematic_camera(); } diff --git a/src/ending/ceremony_and_credits.c b/src/ending/ceremony_and_credits.c index 764443af04..36e3d25aa7 100644 --- a/src/ending/ceremony_and_credits.c +++ b/src/ending/ceremony_and_credits.c @@ -18,9 +18,10 @@ #include "audio/external.h" #include #include "podium_ceremony_actors.h" -#include "code_80091750.h" +#include "menu_items.h" #include "code_80057C60.h" #include "defines.h" +#include "seq_ids.h" f32 D_802856B0 = 98.0f; f32 D_802856B4 = 12.0f; @@ -720,26 +721,25 @@ void func_80283BA4(UNUSED CinematicCamera* camera) { func_800CA0A0(); } -void func_80283BF0(UNUSED CinematicCamera* camera) { - func_800C8EF8(0x1A); +void play_winning_ceremony_sequence_part1(UNUSED CinematicCamera* camera) { + play_sequence2(SEQ_EVENT_CEREMONY_PRESENTATION_PART1); } -// -void func_80283C14(UNUSED CinematicCamera* camera) { - func_800C8EF8(0x1B); +void play_winning_ceremony_sequence_part2(UNUSED CinematicCamera* camera) { + play_sequence2(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_WIN); } void wrap_func_800CB134(UNUSED CinematicCamera* camera) { func_800CB134(); } -void wrap_func_800CB14C(UNUSED CinematicCamera* camera) { - func_800CB14C(); +void play_losing_ceremony_sequence(UNUSED CinematicCamera* camera) { + begin_losing_ceremony_sequence(); } -void func_80283C78(UNUSED CinematicCamera* arg0) { +void play_winning_ceremony_credits_sequence(UNUSED CinematicCamera* arg0) { if (D_800DC5E4 == 0) { - func_800C8EF8(0x1C); + play_sequence2(SEQ_EVENT_CEREMONY_TROPHY_CREDITS); } } @@ -920,7 +920,7 @@ void func_80283D2C(CinematicCamera* camera) { gOrderedSizeSlidingBorders = 120.0f; cutscene_event(func_80283CA8, camera, 0, 0); cutscene_event(wrap_func_800CA0CC, camera, 1, 1); - cutscene_event(func_80283BF0, camera, 0, 0); + cutscene_event(play_winning_ceremony_sequence_part1, camera, 0, 0); cutscene_event(play_sound_balloon_pop, camera, 45, 45); cutscene_event(play_sound_balloon_pop, camera, 65, 65); cutscene_event(play_sound_balloon_pop, camera, 70, 70); @@ -972,7 +972,7 @@ void func_80284068(CinematicCamera* camera) { } void func_802840C8(CinematicCamera* camera) { - cutscene_event(func_80283C14, camera, 5, 5); + cutscene_event(play_winning_ceremony_sequence_part2, camera, 5, 5); switch (D_802876D8) { case 2: @@ -1448,9 +1448,9 @@ void func_802847CC(CinematicCamera* camera) { cutscene_event(func_80283CD0, camera, 0, 0); cutscene_event(play_sound_welcome, camera, 8, 8); #ifdef VERSION_EU - cutscene_event(func_80283C78, camera, 134, 134); + cutscene_event(play_winning_ceremony_credits_sequence, camera, 134, 134); #else - cutscene_event(func_80283C78, camera, 149, 149); + cutscene_event(play_winning_ceremony_credits_sequence, camera, 149, 149); #endif cutscene_event(reset_spline_wrap, camera, 0, 0); switch (D_80286A04[D_800DC5E4].unk0) { @@ -1520,7 +1520,7 @@ void play_cutscene(CinematicCamera* camera) { CUTSCENE(4, gCutScene) break; CUTSCENE(5, D_80285D58) - wrap_func_800CB14C(camera); + play_losing_ceremony_sequence(camera); break; CUTSCENE(6, D_80286B5C) break; diff --git a/src/ending/ceremony_and_credits.h b/src/ending/ceremony_and_credits.h index 86c6a5b078..0a157216d3 100644 --- a/src/ending/ceremony_and_credits.h +++ b/src/ending/ceremony_and_credits.h @@ -164,11 +164,11 @@ void func_80283A54(CinematicCamera*); void func_80283A7C(CinematicCamera*); void func_80283B6C(CinematicCamera*); void func_80283BA4(CinematicCamera*); -void func_80283BF0(CinematicCamera*); -void func_80283C14(CinematicCamera*); +void play_winning_ceremony_sequence_part1(CinematicCamera*); +void play_winning_ceremony_sequence_part2(CinematicCamera*); void wrap_func_800CB134(CinematicCamera*); -void wrap_func_800CB14C(CinematicCamera*); -void func_80283C78(CinematicCamera*); +void play_losing_ceremony_sequence(CinematicCamera*); +void play_winning_ceremony_credits_sequence(CinematicCamera*); void func_80283CA8(CinematicCamera*); void func_80283CD0(CinematicCamera*); void play_sound_farewell(CinematicCamera*); diff --git a/src/ending/code_80280000.c b/src/ending/code_80280000.c index 0a414e9a61..4460aa2e2b 100644 --- a/src/ending/code_80280000.c +++ b/src/ending/code_80280000.c @@ -4,17 +4,18 @@ #include #include #include +#include -#include +#include "main.h" #include -#include +#include "code_800029B0.h" #include "camera.h" #include "memory.h" #include "math_util.h" #include "code_80280000.h" #include "code_80281780.h" #include "skybox_and_splitscreen.h" -#include "code_80091750.h" +#include "menu_items.h" #include "code_8006E9C0.h" #include "code_800029B0.h" #include "ceremony_and_credits.h" @@ -30,7 +31,7 @@ s32 D_802874A0; // s32 D_802874A4[5]; void func_80280000(void) { - func_802966A0(); + course_update_water(); func_80059AC8(); func_80059AC8(); func_8005A070(); @@ -51,7 +52,8 @@ void func_80280038(void) { func_80057FC4(0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -128,7 +130,7 @@ void load_credits(void) { gCurrentCourseId = gCreditsCourseId; D_800DC5B4 = 1; creditsRenderMode = 1; - func_802A4D18(); + set_perspective_and_aspect_ratio(); func_802A74BC(); camera->unk_B4 = 60.0f; gCameraZoom[0] = 60.0f; diff --git a/src/ending/code_80281780.c b/src/ending/code_80281780.c index a7df4cde74..0f303fa474 100644 --- a/src/ending/code_80281780.c +++ b/src/ending/code_80281780.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "code_80281780.h" #include "memory.h" @@ -12,11 +13,11 @@ #include "skybox_and_splitscreen.h" #include "code_8006E9C0.h" #include "podium_ceremony_actors.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "collision.h" #include "code_80281C40.h" #include "code_800029B0.h" -#include "code_80091750.h" +#include "menu_items.h" #include "main.h" #include "menus.h" #include "render_courses.h" @@ -92,7 +93,7 @@ void load_ceremony_cutscene(void) { gIsMirrorMode = 0; gGotoMenu = 0xFFFF; D_80287554 = 0; - func_802A4D18(); + set_perspective_and_aspect_ratio(); func_802A74BC(); camera->unk_B4 = 60.0f; gCameraZoom[0] = 60.0f; diff --git a/src/ending/code_80281C40.c b/src/ending/code_80281C40.c index 43a568dc13..986b14f3cb 100644 --- a/src/ending/code_80281C40.c +++ b/src/ending/code_80281C40.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "code_80281C40.h" #include "main.h" @@ -8,7 +9,7 @@ #include "skybox_and_splitscreen.h" #include "render_objects.h" #include "code_80057C60.h" -#include "code_80091750.h" +#include "menu_items.h" #include "podium_ceremony_actors.h" #include "ceremony_and_credits.h" #include "podium_ceremony_actors.h" @@ -49,7 +50,7 @@ void func_80281CB4(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { extern Gfx D_80284F70[]; extern Gfx D_80284EE0[]; -void func_80281D00(void) { +void render_podium_ceremony(void) { Camera* camera = &cameras[0]; UNUSED s32 pad[3]; u16 perspNorm; @@ -69,8 +70,8 @@ void func_80281D00(void) { } func_8028150C(); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective((Mtx*) &gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, - 1.0f); + guPerspective((Mtx*) &gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, gCourseNearPersp, + gCourseFarPersp, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); diff --git a/src/ending/code_80281C40.h b/src/ending/code_80281C40.h index 23f356284f..cb2f2885fc 100644 --- a/src/ending/code_80281C40.h +++ b/src/ending/code_80281C40.h @@ -5,7 +5,7 @@ void func_80281C40(void); void func_80281CB4(s32, s32, s32, s32); -void func_80281D00(void); +void render_podium_ceremony(void); extern s32 gGotoMenu; extern u16 gIsInQuitToMenuTransition; diff --git a/src/ending/credits.c b/src/ending/credits.c index 892583a02c..70ce14b443 100644 --- a/src/ending/credits.c +++ b/src/ending/credits.c @@ -1,7 +1,7 @@ #include "credits.h" #include "defines.h" -struct_802850C0_entry D_802850C0[] = { +CreditsRenderInfo gCreditsTextRenderInfo[] = { { 0.80f, -200, 38, 160, 30, SLIDE_RIGHT, TEXT_BLUE_GREEN_RED_CYCLE_1, 0 }, { 0.90f, 520, 200, 160, 200, SLIDE_LEFT, TEXT_BLUE, 0 }, { 0.80f, -200, 38, 160, 30, SLIDE_RIGHT, TEXT_BLUE_GREEN_RED_CYCLE_1, 0 }, @@ -67,7 +67,7 @@ struct_802850C0_entry D_802850C0[] = { { 0.90f, 520, 130, 160, 130, SLIDE_LEFT, TEXT_YELLOW, 0 }, }; -char* D_802854B0[] = { +char* gCreditsText[] = { // English Credits "executive producer", "hiroshi yamauchi", "producer", "shigeru miyamoto", "director", "hideki konno", "assistant director", "yasuyuki oyagi", "programmer", "masato kimura", "kenji yamamoto", "yasuhiro kawaguchi", diff --git a/src/ending/credits.h b/src/ending/credits.h index df059da3b6..28bc69f79f 100644 --- a/src/ending/credits.h +++ b/src/ending/credits.h @@ -19,9 +19,9 @@ typedef struct { /* 0x0C */ s8 slideDirection; // 0 for slide right, 1 for slide left. May have other uses/effects /* 0x0D */ s8 textColor; /* 0x0E */ s16 padding; // Always seems to be 0, never read (that I can see) -} struct_802850C0_entry; // size = 0x10 +} CreditsRenderInfo; // size = 0x10 -extern struct_802850C0_entry D_802850C0[]; // D_802850C0 -extern char* D_802854B0[]; +extern CreditsRenderInfo gCreditsTextRenderInfo[]; // gCreditsTextRenderInfo +extern char* gCreditsText[]; #endif diff --git a/src/ending/podium_ceremony_actors.c b/src/ending/podium_ceremony_actors.c index 46cfc9f38b..0667cf1e5b 100644 --- a/src/ending/podium_ceremony_actors.c +++ b/src/ending/podium_ceremony_actors.c @@ -13,7 +13,7 @@ #include "camera_junk.h" #include "player_controller.h" #include "code_80057C60.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "code_80281C40.h" #include "math_util.h" @@ -458,7 +458,7 @@ void podium_ceremony_loop(void) { func_8001C14C(); update_vehicles(); } - func_80281D00(); + render_podium_ceremony(); func_80281540(); #if DVDL display_dvdl(); diff --git a/src/kart_dma.c b/src/kart_dma.c index b39f7188a7..512aaa77fa 100644 --- a/src/kart_dma.c +++ b/src/kart_dma.c @@ -12,1084 +12,142 @@ u16 D_800DDEB0[] = { 0x06c0, 0x06e0, 0x06e0, 0x0680, 0x07c0, 0x0700, 0x0680, 0x0910, }; -u8* gKartMarioGroup0[] = { - gKartMario000, gKartMario001, gKartMario002, gKartMario003, gKartMario004, gKartMario005, gKartMario006, - gKartMario007, gKartMario008, gKartMario009, gKartMario010, gKartMario011, gKartMario012, gKartMario013, - gKartMario014, gKartMario015, gKartMario016, gKartMario017, gKartMario018, gKartMario019, gKartMario020, - gKartMario195, gKartMario196, gKartMario197, gKartMario198, gKartMario199, gKartMario200, gKartMario201, - gKartMario202, gKartMario203, gKartMario204, gKartMario205, gKartMario206, gKartMario207, gKartMario208, -}; - -u8* gKartMarioGroup1[] = { - gKartMario021, gKartMario022, gKartMario023, gKartMario024, gKartMario025, gKartMario026, gKartMario027, - gKartMario028, gKartMario029, gKartMario030, gKartMario031, gKartMario032, gKartMario033, gKartMario034, - gKartMario035, gKartMario036, gKartMario037, gKartMario038, gKartMario039, gKartMario040, gKartMario041, - gKartMario195, gKartMario196, gKartMario197, gKartMario198, gKartMario199, gKartMario200, gKartMario201, - gKartMario202, gKartMario203, gKartMario204, gKartMario205, gKartMario206, gKartMario207, gKartMario208, -}; - -u8* gKartMarioGroup2[] = { - gKartMario042, gKartMario043, gKartMario044, gKartMario045, gKartMario046, gKartMario047, gKartMario048, - gKartMario049, gKartMario050, gKartMario051, gKartMario052, gKartMario053, gKartMario054, gKartMario055, - gKartMario056, gKartMario057, gKartMario058, gKartMario059, gKartMario060, gKartMario061, gKartMario062, - gKartMario215, gKartMario216, gKartMario217, gKartMario218, gKartMario219, gKartMario220, gKartMario221, - gKartMario222, gKartMario223, gKartMario224, gKartMario225, gKartMario226, gKartMario227, gKartMario228, -}; - -u8* gKartMarioGroup3[] = { - gKartMario063, gKartMario064, gKartMario065, gKartMario066, gKartMario067, gKartMario068, gKartMario069, - gKartMario070, gKartMario071, gKartMario072, gKartMario073, gKartMario074, gKartMario075, gKartMario076, - gKartMario077, gKartMario078, gKartMario079, gKartMario080, gKartMario081, gKartMario082, gKartMario083, - gKartMario235, gKartMario236, gKartMario237, gKartMario238, gKartMario239, gKartMario240, gKartMario241, - gKartMario242, gKartMario243, gKartMario244, gKartMario245, gKartMario246, gKartMario247, gKartMario248, -}; - -u8* gKartMarioGroup4[] = { - gKartMario084, gKartMario085, gKartMario086, gKartMario087, gKartMario088, gKartMario089, gKartMario090, - gKartMario091, gKartMario092, gKartMario093, gKartMario094, gKartMario095, gKartMario096, gKartMario097, - gKartMario098, gKartMario099, gKartMario100, gKartMario101, gKartMario102, gKartMario103, gKartMario104, - gKartMario235, gKartMario236, gKartMario237, gKartMario238, gKartMario239, gKartMario240, gKartMario241, - gKartMario242, gKartMario243, gKartMario244, gKartMario245, gKartMario246, gKartMario247, gKartMario248, -}; - -u8* gKartMarioGroup5[] = { - gKartMario105, gKartMario106, gKartMario107, gKartMario108, gKartMario109, gKartMario110, gKartMario111, - gKartMario112, gKartMario113, gKartMario114, gKartMario115, gKartMario116, gKartMario117, gKartMario118, - gKartMario119, gKartMario120, gKartMario121, gKartMario122, gKartMario123, gKartMario124, gKartMario125, - gKartMario235, gKartMario236, gKartMario237, gKartMario238, gKartMario239, gKartMario240, gKartMario241, - gKartMario242, gKartMario243, gKartMario244, gKartMario245, gKartMario246, gKartMario247, gKartMario248, -}; - -u8* gKartMarioGroup6[] = { - gKartMario126, gKartMario127, gKartMario128, gKartMario129, gKartMario130, gKartMario131, gKartMario132, - gKartMario133, gKartMario134, gKartMario135, gKartMario136, gKartMario137, gKartMario138, gKartMario139, - gKartMario140, gKartMario141, gKartMario142, gKartMario143, gKartMario144, gKartMario145, gKartMario146, - gKartMario255, gKartMario256, gKartMario257, gKartMario258, gKartMario259, gKartMario260, gKartMario261, - gKartMario262, gKartMario263, gKartMario264, gKartMario265, gKartMario266, gKartMario267, gKartMario268, -}; - -u8* gKartMarioGroup7[] = { - gKartMario147, gKartMario148, gKartMario149, gKartMario150, gKartMario151, gKartMario152, gKartMario153, - gKartMario154, gKartMario155, gKartMario156, gKartMario157, gKartMario158, gKartMario159, gKartMario160, - gKartMario161, gKartMario162, gKartMario163, gKartMario164, gKartMario165, gKartMario166, gKartMario167, - gKartMario275, gKartMario276, gKartMario277, gKartMario278, gKartMario279, gKartMario280, gKartMario281, - gKartMario282, gKartMario283, gKartMario284, gKartMario285, gKartMario286, gKartMario287, gKartMario288, -}; - -u8* gKartMarioGroup8[] = { - gKartMario168, gKartMario169, gKartMario170, gKartMario171, gKartMario172, gKartMario173, gKartMario174, - gKartMario175, gKartMario176, gKartMario177, gKartMario178, gKartMario179, gKartMario180, gKartMario181, - gKartMario182, gKartMario183, gKartMario184, gKartMario185, gKartMario186, gKartMario187, gKartMario188, - gKartMario275, gKartMario276, gKartMario277, gKartMario278, gKartMario279, gKartMario280, gKartMario281, - gKartMario282, gKartMario283, gKartMario284, gKartMario285, gKartMario286, gKartMario287, gKartMario288, -}; - -u8* gKartMarioGroup9[] = { - gKartMario189, gKartMario190, gKartMario191, gKartMario192, gKartMario193, gKartMario194, gKartMario195, - gKartMario196, gKartMario197, gKartMario198, gKartMario199, gKartMario200, gKartMario201, gKartMario202, - gKartMario203, gKartMario204, gKartMario205, gKartMario206, gKartMario207, gKartMario208, -}; - -u8* gKartMarioGroup10[] = { - gKartMario189, gKartMario190, gKartMario191, gKartMario192, gKartMario193, gKartMario194, gKartMario195, - gKartMario196, gKartMario197, gKartMario198, gKartMario199, gKartMario200, gKartMario201, gKartMario202, - gKartMario203, gKartMario204, gKartMario205, gKartMario206, gKartMario207, gKartMario208, -}; - -u8* gKartMarioGroup11[] = { - gKartMario209, gKartMario210, gKartMario211, gKartMario212, gKartMario213, gKartMario214, gKartMario215, - gKartMario216, gKartMario217, gKartMario218, gKartMario219, gKartMario220, gKartMario221, gKartMario222, - gKartMario223, gKartMario224, gKartMario225, gKartMario226, gKartMario227, gKartMario228, -}; - -u8* gKartMarioGroup12[] = { - gKartMario229, gKartMario230, gKartMario231, gKartMario232, gKartMario233, gKartMario234, gKartMario235, - gKartMario236, gKartMario237, gKartMario238, gKartMario239, gKartMario240, gKartMario241, gKartMario242, - gKartMario243, gKartMario244, gKartMario245, gKartMario246, gKartMario247, gKartMario248, -}; - -u8* gKartMarioGroup13[] = { - gKartMario229, gKartMario230, gKartMario231, gKartMario232, gKartMario233, gKartMario234, gKartMario235, - gKartMario236, gKartMario237, gKartMario238, gKartMario239, gKartMario240, gKartMario241, gKartMario242, - gKartMario243, gKartMario244, gKartMario245, gKartMario246, gKartMario247, gKartMario248, -}; - -u8* gKartMarioGroup14[] = { - gKartMario229, gKartMario230, gKartMario231, gKartMario232, gKartMario233, gKartMario234, gKartMario235, - gKartMario236, gKartMario237, gKartMario238, gKartMario239, gKartMario240, gKartMario241, gKartMario242, - gKartMario243, gKartMario244, gKartMario245, gKartMario246, gKartMario247, gKartMario248, -}; - -u8* gKartMarioGroup15[] = { - gKartMario249, gKartMario250, gKartMario251, gKartMario252, gKartMario253, gKartMario254, gKartMario255, - gKartMario256, gKartMario257, gKartMario258, gKartMario259, gKartMario260, gKartMario261, gKartMario262, - gKartMario263, gKartMario264, gKartMario265, gKartMario266, gKartMario267, gKartMario268, -}; - -u8* gKartMarioGroup16[] = { - gKartMario269, gKartMario270, gKartMario271, gKartMario272, gKartMario273, gKartMario274, gKartMario275, - gKartMario276, gKartMario277, gKartMario278, gKartMario279, gKartMario280, gKartMario281, gKartMario282, - gKartMario283, gKartMario284, gKartMario285, gKartMario286, gKartMario287, gKartMario288, -}; - -u8* gKartMarioGroup17[] = { - gKartMario269, gKartMario270, gKartMario271, gKartMario272, gKartMario273, gKartMario274, gKartMario275, - gKartMario276, gKartMario277, gKartMario278, gKartMario279, gKartMario280, gKartMario281, gKartMario282, - gKartMario283, gKartMario284, gKartMario285, gKartMario286, gKartMario287, gKartMario288, -}; - -u8* gKartToadGroup0[] = { - gKartToad000, gKartToad001, gKartToad002, gKartToad003, gKartToad004, gKartToad005, gKartToad006, - gKartToad007, gKartToad008, gKartToad009, gKartToad010, gKartToad011, gKartToad012, gKartToad013, - gKartToad014, gKartToad015, gKartToad016, gKartToad017, gKartToad018, gKartToad019, gKartToad020, - gKartToad195, gKartToad196, gKartToad197, gKartToad198, gKartToad199, gKartToad200, gKartToad201, - gKartToad202, gKartToad203, gKartToad204, gKartToad205, gKartToad206, gKartToad207, gKartToad208, -}; - -u8* gKartToadGroup1[] = { - gKartToad021, gKartToad022, gKartToad023, gKartToad024, gKartToad025, gKartToad026, gKartToad027, - gKartToad028, gKartToad029, gKartToad030, gKartToad031, gKartToad032, gKartToad033, gKartToad034, - gKartToad035, gKartToad036, gKartToad037, gKartToad038, gKartToad039, gKartToad040, gKartToad041, - gKartToad195, gKartToad196, gKartToad197, gKartToad198, gKartToad199, gKartToad200, gKartToad201, - gKartToad202, gKartToad203, gKartToad204, gKartToad205, gKartToad206, gKartToad207, gKartToad208, -}; - -u8* gKartToadGroup2[] = { - gKartToad042, gKartToad043, gKartToad044, gKartToad045, gKartToad046, gKartToad047, gKartToad048, - gKartToad049, gKartToad050, gKartToad051, gKartToad052, gKartToad053, gKartToad054, gKartToad055, - gKartToad056, gKartToad057, gKartToad058, gKartToad059, gKartToad060, gKartToad061, gKartToad062, - gKartToad215, gKartToad216, gKartToad217, gKartToad218, gKartToad219, gKartToad220, gKartToad221, - gKartToad222, gKartToad223, gKartToad224, gKartToad225, gKartToad226, gKartToad227, gKartToad228, -}; - -u8* gKartToadGroup3[] = { - gKartToad063, gKartToad064, gKartToad065, gKartToad066, gKartToad067, gKartToad068, gKartToad069, - gKartToad070, gKartToad071, gKartToad072, gKartToad073, gKartToad074, gKartToad075, gKartToad076, - gKartToad077, gKartToad078, gKartToad079, gKartToad080, gKartToad081, gKartToad082, gKartToad083, - gKartToad235, gKartToad236, gKartToad237, gKartToad238, gKartToad239, gKartToad240, gKartToad241, - gKartToad242, gKartToad243, gKartToad244, gKartToad245, gKartToad246, gKartToad247, gKartToad248, -}; - -u8* gKartToadGroup4[] = { - gKartToad084, gKartToad085, gKartToad086, gKartToad087, gKartToad088, gKartToad089, gKartToad090, - gKartToad091, gKartToad092, gKartToad093, gKartToad094, gKartToad095, gKartToad096, gKartToad097, - gKartToad098, gKartToad099, gKartToad100, gKartToad101, gKartToad102, gKartToad103, gKartToad104, - gKartToad235, gKartToad236, gKartToad237, gKartToad238, gKartToad239, gKartToad240, gKartToad241, - gKartToad242, gKartToad243, gKartToad244, gKartToad245, gKartToad246, gKartToad247, gKartToad248, -}; - -u8* gKartToadGroup5[] = { - gKartToad105, gKartToad106, gKartToad107, gKartToad108, gKartToad109, gKartToad110, gKartToad111, - gKartToad112, gKartToad113, gKartToad114, gKartToad115, gKartToad116, gKartToad117, gKartToad118, - gKartToad119, gKartToad120, gKartToad121, gKartToad122, gKartToad123, gKartToad124, gKartToad125, - gKartToad235, gKartToad236, gKartToad237, gKartToad238, gKartToad239, gKartToad240, gKartToad241, - gKartToad242, gKartToad243, gKartToad244, gKartToad245, gKartToad246, gKartToad247, gKartToad248, -}; - -u8* gKartToadGroup6[] = { - gKartToad126, gKartToad127, gKartToad128, gKartToad129, gKartToad130, gKartToad131, gKartToad132, - gKartToad133, gKartToad134, gKartToad135, gKartToad136, gKartToad137, gKartToad138, gKartToad139, - gKartToad140, gKartToad141, gKartToad142, gKartToad143, gKartToad144, gKartToad145, gKartToad146, - gKartToad255, gKartToad256, gKartToad257, gKartToad258, gKartToad259, gKartToad260, gKartToad261, - gKartToad262, gKartToad263, gKartToad264, gKartToad265, gKartToad266, gKartToad267, gKartToad268, -}; - -u8* gKartToadGroup7[] = { - gKartToad147, gKartToad148, gKartToad149, gKartToad150, gKartToad151, gKartToad152, gKartToad153, - gKartToad154, gKartToad155, gKartToad156, gKartToad157, gKartToad158, gKartToad159, gKartToad160, - gKartToad161, gKartToad162, gKartToad163, gKartToad164, gKartToad165, gKartToad166, gKartToad167, - gKartToad275, gKartToad276, gKartToad277, gKartToad278, gKartToad279, gKartToad280, gKartToad281, - gKartToad282, gKartToad283, gKartToad284, gKartToad285, gKartToad286, gKartToad287, gKartToad288, -}; - -u8* gKartToadGroup8[] = { - gKartToad168, gKartToad169, gKartToad170, gKartToad171, gKartToad172, gKartToad173, gKartToad174, - gKartToad175, gKartToad176, gKartToad177, gKartToad178, gKartToad179, gKartToad180, gKartToad181, - gKartToad182, gKartToad183, gKartToad184, gKartToad185, gKartToad186, gKartToad187, gKartToad188, - gKartToad275, gKartToad276, gKartToad277, gKartToad278, gKartToad279, gKartToad280, gKartToad281, - gKartToad282, gKartToad283, gKartToad284, gKartToad285, gKartToad286, gKartToad287, gKartToad288, -}; - -u8* gKartToadGroup9[] = { - gKartToad189, gKartToad190, gKartToad191, gKartToad192, gKartToad193, gKartToad194, gKartToad195, - gKartToad196, gKartToad197, gKartToad198, gKartToad199, gKartToad200, gKartToad201, gKartToad202, - gKartToad203, gKartToad204, gKartToad205, gKartToad206, gKartToad207, gKartToad208, -}; - -u8* gKartToadGroup10[] = { - gKartToad189, gKartToad190, gKartToad191, gKartToad192, gKartToad193, gKartToad194, gKartToad195, - gKartToad196, gKartToad197, gKartToad198, gKartToad199, gKartToad200, gKartToad201, gKartToad202, - gKartToad203, gKartToad204, gKartToad205, gKartToad206, gKartToad207, gKartToad208, -}; - -u8* gKartToadGroup11[] = { - gKartToad209, gKartToad210, gKartToad211, gKartToad212, gKartToad213, gKartToad214, gKartToad215, - gKartToad216, gKartToad217, gKartToad218, gKartToad219, gKartToad220, gKartToad221, gKartToad222, - gKartToad223, gKartToad224, gKartToad225, gKartToad226, gKartToad227, gKartToad228, -}; - -u8* gKartToadGroup12[] = { - gKartToad229, gKartToad230, gKartToad231, gKartToad232, gKartToad233, gKartToad234, gKartToad235, - gKartToad236, gKartToad237, gKartToad238, gKartToad239, gKartToad240, gKartToad241, gKartToad242, - gKartToad243, gKartToad244, gKartToad245, gKartToad246, gKartToad247, gKartToad248, -}; - -u8* gKartToadGroup13[] = { - gKartToad229, gKartToad230, gKartToad231, gKartToad232, gKartToad233, gKartToad234, gKartToad235, - gKartToad236, gKartToad237, gKartToad238, gKartToad239, gKartToad240, gKartToad241, gKartToad242, - gKartToad243, gKartToad244, gKartToad245, gKartToad246, gKartToad247, gKartToad248, -}; - -u8* gKartToadGroup14[] = { - gKartToad229, gKartToad230, gKartToad231, gKartToad232, gKartToad233, gKartToad234, gKartToad235, - gKartToad236, gKartToad237, gKartToad238, gKartToad239, gKartToad240, gKartToad241, gKartToad242, - gKartToad243, gKartToad244, gKartToad245, gKartToad246, gKartToad247, gKartToad248, -}; - -u8* gKartToadGroup15[] = { - gKartToad249, gKartToad250, gKartToad251, gKartToad252, gKartToad253, gKartToad254, gKartToad255, - gKartToad256, gKartToad257, gKartToad258, gKartToad259, gKartToad260, gKartToad261, gKartToad262, - gKartToad263, gKartToad264, gKartToad265, gKartToad266, gKartToad267, gKartToad268, -}; - -u8* gKartToadGroup16[] = { - gKartToad269, gKartToad270, gKartToad271, gKartToad272, gKartToad273, gKartToad274, gKartToad275, - gKartToad276, gKartToad277, gKartToad278, gKartToad279, gKartToad280, gKartToad281, gKartToad282, - gKartToad283, gKartToad284, gKartToad285, gKartToad286, gKartToad287, gKartToad288, -}; - -u8* gKartToadGroup17[] = { - gKartToad269, gKartToad270, gKartToad271, gKartToad272, gKartToad273, gKartToad274, gKartToad275, - gKartToad276, gKartToad277, gKartToad278, gKartToad279, gKartToad280, gKartToad281, gKartToad282, - gKartToad283, gKartToad284, gKartToad285, gKartToad286, gKartToad287, gKartToad288, -}; - -u8* gKartLuigiGroup0[] = { - gKartLuigi000, gKartLuigi001, gKartLuigi002, gKartLuigi003, gKartLuigi004, gKartLuigi005, gKartLuigi006, - gKartLuigi007, gKartLuigi008, gKartLuigi009, gKartLuigi010, gKartLuigi011, gKartLuigi012, gKartLuigi013, - gKartLuigi014, gKartLuigi015, gKartLuigi016, gKartLuigi017, gKartLuigi018, gKartLuigi019, gKartLuigi020, - gKartLuigi195, gKartLuigi196, gKartLuigi197, gKartLuigi198, gKartLuigi199, gKartLuigi200, gKartLuigi201, - gKartLuigi202, gKartLuigi203, gKartLuigi204, gKartLuigi205, gKartLuigi206, gKartLuigi207, gKartLuigi208, -}; - -u8* gKartLuigiGroup1[] = { - gKartLuigi021, gKartLuigi022, gKartLuigi023, gKartLuigi024, gKartLuigi025, gKartLuigi026, gKartLuigi027, - gKartLuigi028, gKartLuigi029, gKartLuigi030, gKartLuigi031, gKartLuigi032, gKartLuigi033, gKartLuigi034, - gKartLuigi035, gKartLuigi036, gKartLuigi037, gKartLuigi038, gKartLuigi039, gKartLuigi040, gKartLuigi041, - gKartLuigi195, gKartLuigi196, gKartLuigi197, gKartLuigi198, gKartLuigi199, gKartLuigi200, gKartLuigi201, - gKartLuigi202, gKartLuigi203, gKartLuigi204, gKartLuigi205, gKartLuigi206, gKartLuigi207, gKartLuigi208, -}; - -u8* gKartLuigiGroup2[] = { - gKartLuigi042, gKartLuigi043, gKartLuigi044, gKartLuigi045, gKartLuigi046, gKartLuigi047, gKartLuigi048, - gKartLuigi049, gKartLuigi050, gKartLuigi051, gKartLuigi052, gKartLuigi053, gKartLuigi054, gKartLuigi055, - gKartLuigi056, gKartLuigi057, gKartLuigi058, gKartLuigi059, gKartLuigi060, gKartLuigi061, gKartLuigi062, - gKartLuigi215, gKartLuigi216, gKartLuigi217, gKartLuigi218, gKartLuigi219, gKartLuigi220, gKartLuigi221, - gKartLuigi222, gKartLuigi223, gKartLuigi224, gKartLuigi225, gKartLuigi226, gKartLuigi227, gKartLuigi228, -}; - -u8* gKartLuigiGroup3[] = { - gKartLuigi063, gKartLuigi064, gKartLuigi065, gKartLuigi066, gKartLuigi067, gKartLuigi068, gKartLuigi069, - gKartLuigi070, gKartLuigi071, gKartLuigi072, gKartLuigi073, gKartLuigi074, gKartLuigi075, gKartLuigi076, - gKartLuigi077, gKartLuigi078, gKartLuigi079, gKartLuigi080, gKartLuigi081, gKartLuigi082, gKartLuigi083, - gKartLuigi235, gKartLuigi236, gKartLuigi237, gKartLuigi238, gKartLuigi239, gKartLuigi240, gKartLuigi241, - gKartLuigi242, gKartLuigi243, gKartLuigi244, gKartLuigi245, gKartLuigi246, gKartLuigi247, gKartLuigi248, -}; - -u8* gKartLuigiGroup4[] = { - gKartLuigi084, gKartLuigi085, gKartLuigi086, gKartLuigi087, gKartLuigi088, gKartLuigi089, gKartLuigi090, - gKartLuigi091, gKartLuigi092, gKartLuigi093, gKartLuigi094, gKartLuigi095, gKartLuigi096, gKartLuigi097, - gKartLuigi098, gKartLuigi099, gKartLuigi100, gKartLuigi101, gKartLuigi102, gKartLuigi103, gKartLuigi104, - gKartLuigi235, gKartLuigi236, gKartLuigi237, gKartLuigi238, gKartLuigi239, gKartLuigi240, gKartLuigi241, - gKartLuigi242, gKartLuigi243, gKartLuigi244, gKartLuigi245, gKartLuigi246, gKartLuigi247, gKartLuigi248, -}; - -u8* gKartLuigiGroup5[] = { - gKartLuigi105, gKartLuigi106, gKartLuigi107, gKartLuigi108, gKartLuigi109, gKartLuigi110, gKartLuigi111, - gKartLuigi112, gKartLuigi113, gKartLuigi114, gKartLuigi115, gKartLuigi116, gKartLuigi117, gKartLuigi118, - gKartLuigi119, gKartLuigi120, gKartLuigi121, gKartLuigi122, gKartLuigi123, gKartLuigi124, gKartLuigi125, - gKartLuigi235, gKartLuigi236, gKartLuigi237, gKartLuigi238, gKartLuigi239, gKartLuigi240, gKartLuigi241, - gKartLuigi242, gKartLuigi243, gKartLuigi244, gKartLuigi245, gKartLuigi246, gKartLuigi247, gKartLuigi248, -}; - -u8* gKartLuigiGroup6[] = { - gKartLuigi126, gKartLuigi127, gKartLuigi128, gKartLuigi129, gKartLuigi130, gKartLuigi131, gKartLuigi132, - gKartLuigi133, gKartLuigi134, gKartLuigi135, gKartLuigi136, gKartLuigi137, gKartLuigi138, gKartLuigi139, - gKartLuigi140, gKartLuigi141, gKartLuigi142, gKartLuigi143, gKartLuigi144, gKartLuigi145, gKartLuigi146, - gKartLuigi255, gKartLuigi256, gKartLuigi257, gKartLuigi258, gKartLuigi259, gKartLuigi260, gKartLuigi261, - gKartLuigi262, gKartLuigi263, gKartLuigi264, gKartLuigi265, gKartLuigi266, gKartLuigi267, gKartLuigi268, -}; - -u8* gKartLuigiGroup7[] = { - gKartLuigi147, gKartLuigi148, gKartLuigi149, gKartLuigi150, gKartLuigi151, gKartLuigi152, gKartLuigi153, - gKartLuigi154, gKartLuigi155, gKartLuigi156, gKartLuigi157, gKartLuigi158, gKartLuigi159, gKartLuigi160, - gKartLuigi161, gKartLuigi162, gKartLuigi163, gKartLuigi164, gKartLuigi165, gKartLuigi166, gKartLuigi167, - gKartLuigi275, gKartLuigi276, gKartLuigi277, gKartLuigi278, gKartLuigi279, gKartLuigi280, gKartLuigi281, - gKartLuigi282, gKartLuigi283, gKartLuigi284, gKartLuigi285, gKartLuigi286, gKartLuigi287, gKartLuigi288, -}; - -u8* gKartLuigiGroup8[] = { - gKartLuigi168, gKartLuigi169, gKartLuigi170, gKartLuigi171, gKartLuigi172, gKartLuigi173, gKartLuigi174, - gKartLuigi175, gKartLuigi176, gKartLuigi177, gKartLuigi178, gKartLuigi179, gKartLuigi180, gKartLuigi181, - gKartLuigi182, gKartLuigi183, gKartLuigi184, gKartLuigi185, gKartLuigi186, gKartLuigi187, gKartLuigi188, - gKartLuigi275, gKartLuigi276, gKartLuigi277, gKartLuigi278, gKartLuigi279, gKartLuigi280, gKartLuigi281, - gKartLuigi282, gKartLuigi283, gKartLuigi284, gKartLuigi285, gKartLuigi286, gKartLuigi287, gKartLuigi288, -}; - -u8* gKartLuigiGroup9[] = { - gKartLuigi189, gKartLuigi190, gKartLuigi191, gKartLuigi192, gKartLuigi193, gKartLuigi194, gKartLuigi195, - gKartLuigi196, gKartLuigi197, gKartLuigi198, gKartLuigi199, gKartLuigi200, gKartLuigi201, gKartLuigi202, - gKartLuigi203, gKartLuigi204, gKartLuigi205, gKartLuigi206, gKartLuigi207, gKartLuigi208, -}; - -u8* gKartLuigiGroup10[] = { - gKartLuigi189, gKartLuigi190, gKartLuigi191, gKartLuigi192, gKartLuigi193, gKartLuigi194, gKartLuigi195, - gKartLuigi196, gKartLuigi197, gKartLuigi198, gKartLuigi199, gKartLuigi200, gKartLuigi201, gKartLuigi202, - gKartLuigi203, gKartLuigi204, gKartLuigi205, gKartLuigi206, gKartLuigi207, gKartLuigi208, -}; - -u8* gKartLuigiGroup11[] = { - gKartLuigi209, gKartLuigi210, gKartLuigi211, gKartLuigi212, gKartLuigi213, gKartLuigi214, gKartLuigi215, - gKartLuigi216, gKartLuigi217, gKartLuigi218, gKartLuigi219, gKartLuigi220, gKartLuigi221, gKartLuigi222, - gKartLuigi223, gKartLuigi224, gKartLuigi225, gKartLuigi226, gKartLuigi227, gKartLuigi228, -}; - -u8* gKartLuigiGroup12[] = { - gKartLuigi229, gKartLuigi230, gKartLuigi231, gKartLuigi232, gKartLuigi233, gKartLuigi234, gKartLuigi235, - gKartLuigi236, gKartLuigi237, gKartLuigi238, gKartLuigi239, gKartLuigi240, gKartLuigi241, gKartLuigi242, - gKartLuigi243, gKartLuigi244, gKartLuigi245, gKartLuigi246, gKartLuigi247, gKartLuigi248, -}; - -u8* gKartLuigiGroup13[] = { - gKartLuigi229, gKartLuigi230, gKartLuigi231, gKartLuigi232, gKartLuigi233, gKartLuigi234, gKartLuigi235, - gKartLuigi236, gKartLuigi237, gKartLuigi238, gKartLuigi239, gKartLuigi240, gKartLuigi241, gKartLuigi242, - gKartLuigi243, gKartLuigi244, gKartLuigi245, gKartLuigi246, gKartLuigi247, gKartLuigi248, -}; - -u8* gKartLuigiGroup14[] = { - gKartLuigi229, gKartLuigi230, gKartLuigi231, gKartLuigi232, gKartLuigi233, gKartLuigi234, gKartLuigi235, - gKartLuigi236, gKartLuigi237, gKartLuigi238, gKartLuigi239, gKartLuigi240, gKartLuigi241, gKartLuigi242, - gKartLuigi243, gKartLuigi244, gKartLuigi245, gKartLuigi246, gKartLuigi247, gKartLuigi248, -}; - -u8* gKartLuigiGroup15[] = { - gKartLuigi249, gKartLuigi250, gKartLuigi251, gKartLuigi252, gKartLuigi253, gKartLuigi254, gKartLuigi255, - gKartLuigi256, gKartLuigi257, gKartLuigi258, gKartLuigi259, gKartLuigi260, gKartLuigi261, gKartLuigi262, - gKartLuigi263, gKartLuigi264, gKartLuigi265, gKartLuigi266, gKartLuigi267, gKartLuigi268, -}; - -u8* gKartLuigiGroup16[] = { - gKartLuigi269, gKartLuigi270, gKartLuigi271, gKartLuigi272, gKartLuigi273, gKartLuigi274, gKartLuigi275, - gKartLuigi276, gKartLuigi277, gKartLuigi278, gKartLuigi279, gKartLuigi280, gKartLuigi281, gKartLuigi282, - gKartLuigi283, gKartLuigi284, gKartLuigi285, gKartLuigi286, gKartLuigi287, gKartLuigi288, -}; - -u8* gKartLuigiGroup17[] = { - gKartLuigi269, gKartLuigi270, gKartLuigi271, gKartLuigi272, gKartLuigi273, gKartLuigi274, gKartLuigi275, - gKartLuigi276, gKartLuigi277, gKartLuigi278, gKartLuigi279, gKartLuigi280, gKartLuigi281, gKartLuigi282, - gKartLuigi283, gKartLuigi284, gKartLuigi285, gKartLuigi286, gKartLuigi287, gKartLuigi288, -}; - -u8* gKartYoshiGroup0[] = { - gKartYoshi000, gKartYoshi001, gKartYoshi002, gKartYoshi003, gKartYoshi004, gKartYoshi005, gKartYoshi006, - gKartYoshi007, gKartYoshi008, gKartYoshi009, gKartYoshi010, gKartYoshi011, gKartYoshi012, gKartYoshi013, - gKartYoshi014, gKartYoshi015, gKartYoshi016, gKartYoshi017, gKartYoshi018, gKartYoshi019, gKartYoshi020, - gKartYoshi195, gKartYoshi196, gKartYoshi197, gKartYoshi198, gKartYoshi199, gKartYoshi200, gKartYoshi201, - gKartYoshi202, gKartYoshi203, gKartYoshi204, gKartYoshi205, gKartYoshi206, gKartYoshi207, gKartYoshi208, -}; - -u8* gKartYoshiGroup1[] = { - gKartYoshi021, gKartYoshi022, gKartYoshi023, gKartYoshi024, gKartYoshi025, gKartYoshi026, gKartYoshi027, - gKartYoshi028, gKartYoshi029, gKartYoshi030, gKartYoshi031, gKartYoshi032, gKartYoshi033, gKartYoshi034, - gKartYoshi035, gKartYoshi036, gKartYoshi037, gKartYoshi038, gKartYoshi039, gKartYoshi040, gKartYoshi041, - gKartYoshi195, gKartYoshi196, gKartYoshi197, gKartYoshi198, gKartYoshi199, gKartYoshi200, gKartYoshi201, - gKartYoshi202, gKartYoshi203, gKartYoshi204, gKartYoshi205, gKartYoshi206, gKartYoshi207, gKartYoshi208, -}; - -u8* gKartYoshiGroup2[] = { - gKartYoshi042, gKartYoshi043, gKartYoshi044, gKartYoshi045, gKartYoshi046, gKartYoshi047, gKartYoshi048, - gKartYoshi049, gKartYoshi050, gKartYoshi051, gKartYoshi052, gKartYoshi053, gKartYoshi054, gKartYoshi055, - gKartYoshi056, gKartYoshi057, gKartYoshi058, gKartYoshi059, gKartYoshi060, gKartYoshi061, gKartYoshi062, - gKartYoshi215, gKartYoshi216, gKartYoshi217, gKartYoshi218, gKartYoshi219, gKartYoshi220, gKartYoshi221, - gKartYoshi222, gKartYoshi223, gKartYoshi224, gKartYoshi225, gKartYoshi226, gKartYoshi227, gKartYoshi228, -}; - -u8* gKartYoshiGroup3[] = { - gKartYoshi063, gKartYoshi064, gKartYoshi065, gKartYoshi066, gKartYoshi067, gKartYoshi068, gKartYoshi069, - gKartYoshi070, gKartYoshi071, gKartYoshi072, gKartYoshi073, gKartYoshi074, gKartYoshi075, gKartYoshi076, - gKartYoshi077, gKartYoshi078, gKartYoshi079, gKartYoshi080, gKartYoshi081, gKartYoshi082, gKartYoshi083, - gKartYoshi235, gKartYoshi236, gKartYoshi237, gKartYoshi238, gKartYoshi239, gKartYoshi240, gKartYoshi241, - gKartYoshi242, gKartYoshi243, gKartYoshi244, gKartYoshi245, gKartYoshi246, gKartYoshi247, gKartYoshi248, -}; - -u8* gKartYoshiGroup4[] = { - gKartYoshi084, gKartYoshi085, gKartYoshi086, gKartYoshi087, gKartYoshi088, gKartYoshi089, gKartYoshi090, - gKartYoshi091, gKartYoshi092, gKartYoshi093, gKartYoshi094, gKartYoshi095, gKartYoshi096, gKartYoshi097, - gKartYoshi098, gKartYoshi099, gKartYoshi100, gKartYoshi101, gKartYoshi102, gKartYoshi103, gKartYoshi104, - gKartYoshi235, gKartYoshi236, gKartYoshi237, gKartYoshi238, gKartYoshi239, gKartYoshi240, gKartYoshi241, - gKartYoshi242, gKartYoshi243, gKartYoshi244, gKartYoshi245, gKartYoshi246, gKartYoshi247, gKartYoshi248, -}; - -u8* gKartYoshiGroup5[] = { - gKartYoshi105, gKartYoshi106, gKartYoshi107, gKartYoshi108, gKartYoshi109, gKartYoshi110, gKartYoshi111, - gKartYoshi112, gKartYoshi113, gKartYoshi114, gKartYoshi115, gKartYoshi116, gKartYoshi117, gKartYoshi118, - gKartYoshi119, gKartYoshi120, gKartYoshi121, gKartYoshi122, gKartYoshi123, gKartYoshi124, gKartYoshi125, - gKartYoshi235, gKartYoshi236, gKartYoshi237, gKartYoshi238, gKartYoshi239, gKartYoshi240, gKartYoshi241, - gKartYoshi242, gKartYoshi243, gKartYoshi244, gKartYoshi245, gKartYoshi246, gKartYoshi247, gKartYoshi248, -}; - -u8* gKartYoshiGroup6[] = { - gKartYoshi126, gKartYoshi127, gKartYoshi128, gKartYoshi129, gKartYoshi130, gKartYoshi131, gKartYoshi132, - gKartYoshi133, gKartYoshi134, gKartYoshi135, gKartYoshi136, gKartYoshi137, gKartYoshi138, gKartYoshi139, - gKartYoshi140, gKartYoshi141, gKartYoshi142, gKartYoshi143, gKartYoshi144, gKartYoshi145, gKartYoshi146, - gKartYoshi255, gKartYoshi256, gKartYoshi257, gKartYoshi258, gKartYoshi259, gKartYoshi260, gKartYoshi261, - gKartYoshi262, gKartYoshi263, gKartYoshi264, gKartYoshi265, gKartYoshi266, gKartYoshi267, gKartYoshi268, -}; - -u8* gKartYoshiGroup7[] = { - gKartYoshi147, gKartYoshi148, gKartYoshi149, gKartYoshi150, gKartYoshi151, gKartYoshi152, gKartYoshi153, - gKartYoshi154, gKartYoshi155, gKartYoshi156, gKartYoshi157, gKartYoshi158, gKartYoshi159, gKartYoshi160, - gKartYoshi161, gKartYoshi162, gKartYoshi163, gKartYoshi164, gKartYoshi165, gKartYoshi166, gKartYoshi167, - gKartYoshi275, gKartYoshi276, gKartYoshi277, gKartYoshi278, gKartYoshi279, gKartYoshi280, gKartYoshi281, - gKartYoshi282, gKartYoshi283, gKartYoshi284, gKartYoshi285, gKartYoshi286, gKartYoshi287, gKartYoshi288, -}; - -u8* gKartYoshiGroup8[] = { - gKartYoshi168, gKartYoshi169, gKartYoshi170, gKartYoshi171, gKartYoshi172, gKartYoshi173, gKartYoshi174, - gKartYoshi175, gKartYoshi176, gKartYoshi177, gKartYoshi178, gKartYoshi179, gKartYoshi180, gKartYoshi181, - gKartYoshi182, gKartYoshi183, gKartYoshi184, gKartYoshi185, gKartYoshi186, gKartYoshi187, gKartYoshi188, - gKartYoshi275, gKartYoshi276, gKartYoshi277, gKartYoshi278, gKartYoshi279, gKartYoshi280, gKartYoshi281, - gKartYoshi282, gKartYoshi283, gKartYoshi284, gKartYoshi285, gKartYoshi286, gKartYoshi287, gKartYoshi288, -}; - -u8* gKartYoshiGroup9[] = { - gKartYoshi189, gKartYoshi190, gKartYoshi191, gKartYoshi192, gKartYoshi193, gKartYoshi194, gKartYoshi195, - gKartYoshi196, gKartYoshi197, gKartYoshi198, gKartYoshi199, gKartYoshi200, gKartYoshi201, gKartYoshi202, - gKartYoshi203, gKartYoshi204, gKartYoshi205, gKartYoshi206, gKartYoshi207, gKartYoshi208, -}; - -u8* gKartYoshiGroup10[] = { - gKartYoshi189, gKartYoshi190, gKartYoshi191, gKartYoshi192, gKartYoshi193, gKartYoshi194, gKartYoshi195, - gKartYoshi196, gKartYoshi197, gKartYoshi198, gKartYoshi199, gKartYoshi200, gKartYoshi201, gKartYoshi202, - gKartYoshi203, gKartYoshi204, gKartYoshi205, gKartYoshi206, gKartYoshi207, gKartYoshi208, -}; - -u8* gKartYoshiGroup11[] = { - gKartYoshi209, gKartYoshi210, gKartYoshi211, gKartYoshi212, gKartYoshi213, gKartYoshi214, gKartYoshi215, - gKartYoshi216, gKartYoshi217, gKartYoshi218, gKartYoshi219, gKartYoshi220, gKartYoshi221, gKartYoshi222, - gKartYoshi223, gKartYoshi224, gKartYoshi225, gKartYoshi226, gKartYoshi227, gKartYoshi228, -}; - -u8* gKartYoshiGroup12[] = { - gKartYoshi229, gKartYoshi230, gKartYoshi231, gKartYoshi232, gKartYoshi233, gKartYoshi234, gKartYoshi235, - gKartYoshi236, gKartYoshi237, gKartYoshi238, gKartYoshi239, gKartYoshi240, gKartYoshi241, gKartYoshi242, - gKartYoshi243, gKartYoshi244, gKartYoshi245, gKartYoshi246, gKartYoshi247, gKartYoshi248, -}; - -u8* gKartYoshiGroup13[] = { - gKartYoshi229, gKartYoshi230, gKartYoshi231, gKartYoshi232, gKartYoshi233, gKartYoshi234, gKartYoshi235, - gKartYoshi236, gKartYoshi237, gKartYoshi238, gKartYoshi239, gKartYoshi240, gKartYoshi241, gKartYoshi242, - gKartYoshi243, gKartYoshi244, gKartYoshi245, gKartYoshi246, gKartYoshi247, gKartYoshi248, -}; - -u8* gKartYoshiGroup14[] = { - gKartYoshi229, gKartYoshi230, gKartYoshi231, gKartYoshi232, gKartYoshi233, gKartYoshi234, gKartYoshi235, - gKartYoshi236, gKartYoshi237, gKartYoshi238, gKartYoshi239, gKartYoshi240, gKartYoshi241, gKartYoshi242, - gKartYoshi243, gKartYoshi244, gKartYoshi245, gKartYoshi246, gKartYoshi247, gKartYoshi248, -}; - -u8* gKartYoshiGroup15[] = { - gKartYoshi249, gKartYoshi250, gKartYoshi251, gKartYoshi252, gKartYoshi253, gKartYoshi254, gKartYoshi255, - gKartYoshi256, gKartYoshi257, gKartYoshi258, gKartYoshi259, gKartYoshi260, gKartYoshi261, gKartYoshi262, - gKartYoshi263, gKartYoshi264, gKartYoshi265, gKartYoshi266, gKartYoshi267, gKartYoshi268, -}; - -u8* gKartYoshiGroup16[] = { - gKartYoshi269, gKartYoshi270, gKartYoshi271, gKartYoshi272, gKartYoshi273, gKartYoshi274, gKartYoshi275, - gKartYoshi276, gKartYoshi277, gKartYoshi278, gKartYoshi279, gKartYoshi280, gKartYoshi281, gKartYoshi282, - gKartYoshi283, gKartYoshi284, gKartYoshi285, gKartYoshi286, gKartYoshi287, gKartYoshi288, -}; - -u8* gKartYoshiGroup17[] = { - gKartYoshi269, gKartYoshi270, gKartYoshi271, gKartYoshi272, gKartYoshi273, gKartYoshi274, gKartYoshi275, - gKartYoshi276, gKartYoshi277, gKartYoshi278, gKartYoshi279, gKartYoshi280, gKartYoshi281, gKartYoshi282, - gKartYoshi283, gKartYoshi284, gKartYoshi285, gKartYoshi286, gKartYoshi287, gKartYoshi288, -}; - -u8* gKartDKGroup0[] = { - gKartDK000, gKartDK001, gKartDK002, gKartDK003, gKartDK004, gKartDK005, gKartDK006, gKartDK007, gKartDK008, - gKartDK009, gKartDK010, gKartDK011, gKartDK012, gKartDK013, gKartDK014, gKartDK015, gKartDK016, gKartDK017, - gKartDK018, gKartDK019, gKartDK020, gKartDK195, gKartDK196, gKartDK197, gKartDK198, gKartDK199, gKartDK200, - gKartDK201, gKartDK202, gKartDK203, gKartDK204, gKartDK205, gKartDK206, gKartDK207, gKartDK208, -}; - -u8* gKartDKGroup1[] = { - gKartDK021, gKartDK022, gKartDK023, gKartDK024, gKartDK025, gKartDK026, gKartDK027, gKartDK028, gKartDK029, - gKartDK030, gKartDK031, gKartDK032, gKartDK033, gKartDK034, gKartDK035, gKartDK036, gKartDK037, gKartDK038, - gKartDK039, gKartDK040, gKartDK041, gKartDK195, gKartDK196, gKartDK197, gKartDK198, gKartDK199, gKartDK200, - gKartDK201, gKartDK202, gKartDK203, gKartDK204, gKartDK205, gKartDK206, gKartDK207, gKartDK208, -}; - -u8* gKartDKGroup2[] = { - gKartDK042, gKartDK043, gKartDK044, gKartDK045, gKartDK046, gKartDK047, gKartDK048, gKartDK049, gKartDK050, - gKartDK051, gKartDK052, gKartDK053, gKartDK054, gKartDK055, gKartDK056, gKartDK057, gKartDK058, gKartDK059, - gKartDK060, gKartDK061, gKartDK062, gKartDK215, gKartDK216, gKartDK217, gKartDK218, gKartDK219, gKartDK220, - gKartDK221, gKartDK222, gKartDK223, gKartDK224, gKartDK225, gKartDK226, gKartDK227, gKartDK228, -}; - -u8* gKartDKGroup3[] = { - gKartDK063, gKartDK064, gKartDK065, gKartDK066, gKartDK067, gKartDK068, gKartDK069, gKartDK070, gKartDK071, - gKartDK072, gKartDK073, gKartDK074, gKartDK075, gKartDK076, gKartDK077, gKartDK078, gKartDK079, gKartDK080, - gKartDK081, gKartDK082, gKartDK083, gKartDK235, gKartDK236, gKartDK237, gKartDK238, gKartDK239, gKartDK240, - gKartDK241, gKartDK242, gKartDK243, gKartDK244, gKartDK245, gKartDK246, gKartDK247, gKartDK248, -}; - -u8* gKartDKGroup4[] = { - gKartDK084, gKartDK085, gKartDK086, gKartDK087, gKartDK088, gKartDK089, gKartDK090, gKartDK091, gKartDK092, - gKartDK093, gKartDK094, gKartDK095, gKartDK096, gKartDK097, gKartDK098, gKartDK099, gKartDK100, gKartDK101, - gKartDK102, gKartDK103, gKartDK104, gKartDK235, gKartDK236, gKartDK237, gKartDK238, gKartDK239, gKartDK240, - gKartDK241, gKartDK242, gKartDK243, gKartDK244, gKartDK245, gKartDK246, gKartDK247, gKartDK248, -}; - -u8* gKartDKGroup5[] = { - gKartDK105, gKartDK106, gKartDK107, gKartDK108, gKartDK109, gKartDK110, gKartDK111, gKartDK112, gKartDK113, - gKartDK114, gKartDK115, gKartDK116, gKartDK117, gKartDK118, gKartDK119, gKartDK120, gKartDK121, gKartDK122, - gKartDK123, gKartDK124, gKartDK125, gKartDK235, gKartDK236, gKartDK237, gKartDK238, gKartDK239, gKartDK240, - gKartDK241, gKartDK242, gKartDK243, gKartDK244, gKartDK245, gKartDK246, gKartDK247, gKartDK248, -}; - -u8* gKartDKGroup6[] = { - gKartDK126, gKartDK127, gKartDK128, gKartDK129, gKartDK130, gKartDK131, gKartDK132, gKartDK133, gKartDK134, - gKartDK135, gKartDK136, gKartDK137, gKartDK138, gKartDK139, gKartDK140, gKartDK141, gKartDK142, gKartDK143, - gKartDK144, gKartDK145, gKartDK146, gKartDK255, gKartDK256, gKartDK257, gKartDK258, gKartDK259, gKartDK260, - gKartDK261, gKartDK262, gKartDK263, gKartDK264, gKartDK265, gKartDK266, gKartDK267, gKartDK268, -}; - -u8* gKartDKGroup7[] = { - gKartDK147, gKartDK148, gKartDK149, gKartDK150, gKartDK151, gKartDK152, gKartDK153, gKartDK154, gKartDK155, - gKartDK156, gKartDK157, gKartDK158, gKartDK159, gKartDK160, gKartDK161, gKartDK162, gKartDK163, gKartDK164, - gKartDK165, gKartDK166, gKartDK167, gKartDK275, gKartDK276, gKartDK277, gKartDK278, gKartDK279, gKartDK280, - gKartDK281, gKartDK282, gKartDK283, gKartDK284, gKartDK285, gKartDK286, gKartDK287, gKartDK288, -}; - -u8* gKartDKGroup8[] = { - gKartDK168, gKartDK169, gKartDK170, gKartDK171, gKartDK172, gKartDK173, gKartDK174, gKartDK175, gKartDK176, - gKartDK177, gKartDK178, gKartDK179, gKartDK180, gKartDK181, gKartDK182, gKartDK183, gKartDK184, gKartDK185, - gKartDK186, gKartDK187, gKartDK188, gKartDK275, gKartDK276, gKartDK277, gKartDK278, gKartDK279, gKartDK280, - gKartDK281, gKartDK282, gKartDK283, gKartDK284, gKartDK285, gKartDK286, gKartDK287, gKartDK288, -}; - -u8* gKartDKGroup9[] = { - gKartDK189, gKartDK190, gKartDK191, gKartDK192, gKartDK193, gKartDK194, gKartDK195, - gKartDK196, gKartDK197, gKartDK198, gKartDK199, gKartDK200, gKartDK201, gKartDK202, - gKartDK203, gKartDK204, gKartDK205, gKartDK206, gKartDK207, gKartDK208, -}; - -u8* gKartDKGroup10[] = { - gKartDK189, gKartDK190, gKartDK191, gKartDK192, gKartDK193, gKartDK194, gKartDK195, - gKartDK196, gKartDK197, gKartDK198, gKartDK199, gKartDK200, gKartDK201, gKartDK202, - gKartDK203, gKartDK204, gKartDK205, gKartDK206, gKartDK207, gKartDK208, -}; - -u8* gKartDKGroup11[] = { - gKartDK209, gKartDK210, gKartDK211, gKartDK212, gKartDK213, gKartDK214, gKartDK215, - gKartDK216, gKartDK217, gKartDK218, gKartDK219, gKartDK220, gKartDK221, gKartDK222, - gKartDK223, gKartDK224, gKartDK225, gKartDK226, gKartDK227, gKartDK228, -}; - -u8* gKartDKGroup12[] = { - gKartDK229, gKartDK230, gKartDK231, gKartDK232, gKartDK233, gKartDK234, gKartDK235, - gKartDK236, gKartDK237, gKartDK238, gKartDK239, gKartDK240, gKartDK241, gKartDK242, - gKartDK243, gKartDK244, gKartDK245, gKartDK246, gKartDK247, gKartDK248, -}; - -u8* gKartDKGroup13[] = { - gKartDK229, gKartDK230, gKartDK231, gKartDK232, gKartDK233, gKartDK234, gKartDK235, - gKartDK236, gKartDK237, gKartDK238, gKartDK239, gKartDK240, gKartDK241, gKartDK242, - gKartDK243, gKartDK244, gKartDK245, gKartDK246, gKartDK247, gKartDK248, -}; - -u8* gKartDKGroup14[] = { - gKartDK229, gKartDK230, gKartDK231, gKartDK232, gKartDK233, gKartDK234, gKartDK235, - gKartDK236, gKartDK237, gKartDK238, gKartDK239, gKartDK240, gKartDK241, gKartDK242, - gKartDK243, gKartDK244, gKartDK245, gKartDK246, gKartDK247, gKartDK248, -}; - -u8* gKartDKGroup15[] = { - gKartDK249, gKartDK250, gKartDK251, gKartDK252, gKartDK253, gKartDK254, gKartDK255, - gKartDK256, gKartDK257, gKartDK258, gKartDK259, gKartDK260, gKartDK261, gKartDK262, - gKartDK263, gKartDK264, gKartDK265, gKartDK266, gKartDK267, gKartDK268, -}; - -u8* gKartDKGroup16[] = { - gKartDK269, gKartDK270, gKartDK271, gKartDK272, gKartDK273, gKartDK274, gKartDK275, - gKartDK276, gKartDK277, gKartDK278, gKartDK279, gKartDK280, gKartDK281, gKartDK282, - gKartDK283, gKartDK284, gKartDK285, gKartDK286, gKartDK287, gKartDK288, -}; - -u8* gKartDKGroup17[] = { - gKartDK269, gKartDK270, gKartDK271, gKartDK272, gKartDK273, gKartDK274, gKartDK275, - gKartDK276, gKartDK277, gKartDK278, gKartDK279, gKartDK280, gKartDK281, gKartDK282, - gKartDK283, gKartDK284, gKartDK285, gKartDK286, gKartDK287, gKartDK288, -}; - -u8* gKartBowserGroup0[] = { - gKartBowser000, gKartBowser001, gKartBowser002, gKartBowser003, gKartBowser004, gKartBowser005, gKartBowser006, - gKartBowser007, gKartBowser008, gKartBowser009, gKartBowser010, gKartBowser011, gKartBowser012, gKartBowser013, - gKartBowser014, gKartBowser015, gKartBowser016, gKartBowser017, gKartBowser018, gKartBowser019, gKartBowser020, - gKartBowser195, gKartBowser196, gKartBowser197, gKartBowser198, gKartBowser199, gKartBowser200, gKartBowser201, - gKartBowser202, gKartBowser203, gKartBowser204, gKartBowser205, gKartBowser206, gKartBowser207, gKartBowser208, -}; - -u8* gKartBowserGroup1[] = { - gKartBowser021, gKartBowser022, gKartBowser023, gKartBowser024, gKartBowser025, gKartBowser026, gKartBowser027, - gKartBowser028, gKartBowser029, gKartBowser030, gKartBowser031, gKartBowser032, gKartBowser033, gKartBowser034, - gKartBowser035, gKartBowser036, gKartBowser037, gKartBowser038, gKartBowser039, gKartBowser040, gKartBowser041, - gKartBowser195, gKartBowser196, gKartBowser197, gKartBowser198, gKartBowser199, gKartBowser200, gKartBowser201, - gKartBowser202, gKartBowser203, gKartBowser204, gKartBowser205, gKartBowser206, gKartBowser207, gKartBowser208, -}; - -u8* gKartBowserGroup2[] = { - gKartBowser042, gKartBowser043, gKartBowser044, gKartBowser045, gKartBowser046, gKartBowser047, gKartBowser048, - gKartBowser049, gKartBowser050, gKartBowser051, gKartBowser052, gKartBowser053, gKartBowser054, gKartBowser055, - gKartBowser056, gKartBowser057, gKartBowser058, gKartBowser059, gKartBowser060, gKartBowser061, gKartBowser062, - gKartBowser215, gKartBowser216, gKartBowser217, gKartBowser218, gKartBowser219, gKartBowser220, gKartBowser221, - gKartBowser222, gKartBowser223, gKartBowser224, gKartBowser225, gKartBowser226, gKartBowser227, gKartBowser228, -}; - -u8* gKartBowserGroup3[] = { - gKartBowser063, gKartBowser064, gKartBowser065, gKartBowser066, gKartBowser067, gKartBowser068, gKartBowser069, - gKartBowser070, gKartBowser071, gKartBowser072, gKartBowser073, gKartBowser074, gKartBowser075, gKartBowser076, - gKartBowser077, gKartBowser078, gKartBowser079, gKartBowser080, gKartBowser081, gKartBowser082, gKartBowser083, - gKartBowser235, gKartBowser236, gKartBowser237, gKartBowser238, gKartBowser239, gKartBowser240, gKartBowser241, - gKartBowser242, gKartBowser243, gKartBowser244, gKartBowser245, gKartBowser246, gKartBowser247, gKartBowser248, -}; - -u8* gKartBowserGroup4[] = { - gKartBowser084, gKartBowser085, gKartBowser086, gKartBowser087, gKartBowser088, gKartBowser089, gKartBowser090, - gKartBowser091, gKartBowser092, gKartBowser093, gKartBowser094, gKartBowser095, gKartBowser096, gKartBowser097, - gKartBowser098, gKartBowser099, gKartBowser100, gKartBowser101, gKartBowser102, gKartBowser103, gKartBowser104, - gKartBowser235, gKartBowser236, gKartBowser237, gKartBowser238, gKartBowser239, gKartBowser240, gKartBowser241, - gKartBowser242, gKartBowser243, gKartBowser244, gKartBowser245, gKartBowser246, gKartBowser247, gKartBowser248, -}; - -u8* gKartBowserGroup5[] = { - gKartBowser105, gKartBowser106, gKartBowser107, gKartBowser108, gKartBowser109, gKartBowser110, gKartBowser111, - gKartBowser112, gKartBowser113, gKartBowser114, gKartBowser115, gKartBowser116, gKartBowser117, gKartBowser118, - gKartBowser119, gKartBowser120, gKartBowser121, gKartBowser122, gKartBowser123, gKartBowser124, gKartBowser125, - gKartBowser235, gKartBowser236, gKartBowser237, gKartBowser238, gKartBowser239, gKartBowser240, gKartBowser241, - gKartBowser242, gKartBowser243, gKartBowser244, gKartBowser245, gKartBowser246, gKartBowser247, gKartBowser248, -}; - -u8* gKartBowserGroup6[] = { - gKartBowser126, gKartBowser127, gKartBowser128, gKartBowser129, gKartBowser130, gKartBowser131, gKartBowser132, - gKartBowser133, gKartBowser134, gKartBowser135, gKartBowser136, gKartBowser137, gKartBowser138, gKartBowser139, - gKartBowser140, gKartBowser141, gKartBowser142, gKartBowser143, gKartBowser144, gKartBowser145, gKartBowser146, - gKartBowser255, gKartBowser256, gKartBowser257, gKartBowser258, gKartBowser259, gKartBowser260, gKartBowser261, - gKartBowser262, gKartBowser263, gKartBowser264, gKartBowser265, gKartBowser266, gKartBowser267, gKartBowser268, -}; - -u8* gKartBowserGroup7[] = { - gKartBowser147, gKartBowser148, gKartBowser149, gKartBowser150, gKartBowser151, gKartBowser152, gKartBowser153, - gKartBowser154, gKartBowser155, gKartBowser156, gKartBowser157, gKartBowser158, gKartBowser159, gKartBowser160, - gKartBowser161, gKartBowser162, gKartBowser163, gKartBowser164, gKartBowser165, gKartBowser166, gKartBowser167, - gKartBowser275, gKartBowser276, gKartBowser277, gKartBowser278, gKartBowser279, gKartBowser280, gKartBowser281, - gKartBowser282, gKartBowser283, gKartBowser284, gKartBowser285, gKartBowser286, gKartBowser287, gKartBowser288, -}; - -u8* gKartBowserGroup8[] = { - gKartBowser168, gKartBowser169, gKartBowser170, gKartBowser171, gKartBowser172, gKartBowser173, gKartBowser174, - gKartBowser175, gKartBowser176, gKartBowser177, gKartBowser178, gKartBowser179, gKartBowser180, gKartBowser181, - gKartBowser182, gKartBowser183, gKartBowser184, gKartBowser185, gKartBowser186, gKartBowser187, gKartBowser188, - gKartBowser275, gKartBowser276, gKartBowser277, gKartBowser278, gKartBowser279, gKartBowser280, gKartBowser281, - gKartBowser282, gKartBowser283, gKartBowser284, gKartBowser285, gKartBowser286, gKartBowser287, gKartBowser288, -}; - -u8* gKartBowserGroup9[] = { - gKartBowser189, gKartBowser190, gKartBowser191, gKartBowser192, gKartBowser193, gKartBowser194, gKartBowser195, - gKartBowser196, gKartBowser197, gKartBowser198, gKartBowser199, gKartBowser200, gKartBowser201, gKartBowser202, - gKartBowser203, gKartBowser204, gKartBowser205, gKartBowser206, gKartBowser207, gKartBowser208, -}; - -u8* gKartBowserGroup10[] = { - gKartBowser189, gKartBowser190, gKartBowser191, gKartBowser192, gKartBowser193, gKartBowser194, gKartBowser195, - gKartBowser196, gKartBowser197, gKartBowser198, gKartBowser199, gKartBowser200, gKartBowser201, gKartBowser202, - gKartBowser203, gKartBowser204, gKartBowser205, gKartBowser206, gKartBowser207, gKartBowser208, -}; - -u8* gKartBowserGroup11[] = { - gKartBowser209, gKartBowser210, gKartBowser211, gKartBowser212, gKartBowser213, gKartBowser214, gKartBowser215, - gKartBowser216, gKartBowser217, gKartBowser218, gKartBowser219, gKartBowser220, gKartBowser221, gKartBowser222, - gKartBowser223, gKartBowser224, gKartBowser225, gKartBowser226, gKartBowser227, gKartBowser228, -}; - -u8* gKartBowserGroup12[] = { - gKartBowser229, gKartBowser230, gKartBowser231, gKartBowser232, gKartBowser233, gKartBowser234, gKartBowser235, - gKartBowser236, gKartBowser237, gKartBowser238, gKartBowser239, gKartBowser240, gKartBowser241, gKartBowser242, - gKartBowser243, gKartBowser244, gKartBowser245, gKartBowser246, gKartBowser247, gKartBowser248, -}; - -u8* gKartBowserGroup13[] = { - gKartBowser229, gKartBowser230, gKartBowser231, gKartBowser232, gKartBowser233, gKartBowser234, gKartBowser235, - gKartBowser236, gKartBowser237, gKartBowser238, gKartBowser239, gKartBowser240, gKartBowser241, gKartBowser242, - gKartBowser243, gKartBowser244, gKartBowser245, gKartBowser246, gKartBowser247, gKartBowser248, -}; - -u8* gKartBowserGroup14[] = { - gKartBowser229, gKartBowser230, gKartBowser231, gKartBowser232, gKartBowser233, gKartBowser234, gKartBowser235, - gKartBowser236, gKartBowser237, gKartBowser238, gKartBowser239, gKartBowser240, gKartBowser241, gKartBowser242, - gKartBowser243, gKartBowser244, gKartBowser245, gKartBowser246, gKartBowser247, gKartBowser248, -}; - -u8* gKartBowserGroup15[] = { - gKartBowser249, gKartBowser250, gKartBowser251, gKartBowser252, gKartBowser253, gKartBowser254, gKartBowser255, - gKartBowser256, gKartBowser257, gKartBowser258, gKartBowser259, gKartBowser260, gKartBowser261, gKartBowser262, - gKartBowser263, gKartBowser264, gKartBowser265, gKartBowser266, gKartBowser267, gKartBowser268, -}; - -u8* gKartBowserGroup16[] = { - gKartBowser269, gKartBowser270, gKartBowser271, gKartBowser272, gKartBowser273, gKartBowser274, gKartBowser275, - gKartBowser276, gKartBowser277, gKartBowser278, gKartBowser279, gKartBowser280, gKartBowser281, gKartBowser282, - gKartBowser283, gKartBowser284, gKartBowser285, gKartBowser286, gKartBowser287, gKartBowser288, -}; - -u8* gKartBowserGroup17[] = { - gKartBowser269, gKartBowser270, gKartBowser271, gKartBowser272, gKartBowser273, gKartBowser274, gKartBowser275, - gKartBowser276, gKartBowser277, gKartBowser278, gKartBowser279, gKartBowser280, gKartBowser281, gKartBowser282, - gKartBowser283, gKartBowser284, gKartBowser285, gKartBowser286, gKartBowser287, gKartBowser288, -}; - -u8* gKartPeachGroup0[] = { - gKartPeach000, gKartPeach001, gKartPeach002, gKartPeach003, gKartPeach004, gKartPeach005, gKartPeach006, - gKartPeach007, gKartPeach008, gKartPeach009, gKartPeach010, gKartPeach011, gKartPeach012, gKartPeach013, - gKartPeach014, gKartPeach015, gKartPeach016, gKartPeach017, gKartPeach018, gKartPeach019, gKartPeach020, - gKartPeach195, gKartPeach196, gKartPeach197, gKartPeach198, gKartPeach199, gKartPeach200, gKartPeach201, - gKartPeach202, gKartPeach203, gKartPeach204, gKartPeach205, gKartPeach206, gKartPeach207, gKartPeach208, -}; - -u8* gKartPeachGroup1[] = { - gKartPeach021, gKartPeach022, gKartPeach023, gKartPeach024, gKartPeach025, gKartPeach026, gKartPeach027, - gKartPeach028, gKartPeach029, gKartPeach030, gKartPeach031, gKartPeach032, gKartPeach033, gKartPeach034, - gKartPeach035, gKartPeach036, gKartPeach037, gKartPeach038, gKartPeach039, gKartPeach040, gKartPeach041, - gKartPeach195, gKartPeach196, gKartPeach197, gKartPeach198, gKartPeach199, gKartPeach200, gKartPeach201, - gKartPeach202, gKartPeach203, gKartPeach204, gKartPeach205, gKartPeach206, gKartPeach207, gKartPeach208, -}; - -u8* gKartPeachGroup2[] = { - gKartPeach042, gKartPeach043, gKartPeach044, gKartPeach045, gKartPeach046, gKartPeach047, gKartPeach048, - gKartPeach049, gKartPeach050, gKartPeach051, gKartPeach052, gKartPeach053, gKartPeach054, gKartPeach055, - gKartPeach056, gKartPeach057, gKartPeach058, gKartPeach059, gKartPeach060, gKartPeach061, gKartPeach062, - gKartPeach215, gKartPeach216, gKartPeach217, gKartPeach218, gKartPeach219, gKartPeach220, gKartPeach221, - gKartPeach222, gKartPeach223, gKartPeach224, gKartPeach225, gKartPeach226, gKartPeach227, gKartPeach228, -}; - -u8* gKartPeachGroup3[] = { - gKartPeach063, gKartPeach064, gKartPeach065, gKartPeach066, gKartPeach067, gKartPeach068, gKartPeach069, - gKartPeach070, gKartPeach071, gKartPeach072, gKartPeach073, gKartPeach074, gKartPeach075, gKartPeach076, - gKartPeach077, gKartPeach078, gKartPeach079, gKartPeach080, gKartPeach081, gKartPeach082, gKartPeach083, - gKartPeach235, gKartPeach236, gKartPeach237, gKartPeach238, gKartPeach239, gKartPeach240, gKartPeach241, - gKartPeach242, gKartPeach243, gKartPeach244, gKartPeach245, gKartPeach246, gKartPeach247, gKartPeach248, -}; - -u8* gKartPeachGroup4[] = { - gKartPeach084, gKartPeach085, gKartPeach086, gKartPeach087, gKartPeach088, gKartPeach089, gKartPeach090, - gKartPeach091, gKartPeach092, gKartPeach093, gKartPeach094, gKartPeach095, gKartPeach096, gKartPeach097, - gKartPeach098, gKartPeach099, gKartPeach100, gKartPeach101, gKartPeach102, gKartPeach103, gKartPeach104, - gKartPeach235, gKartPeach236, gKartPeach237, gKartPeach238, gKartPeach239, gKartPeach240, gKartPeach241, - gKartPeach242, gKartPeach243, gKartPeach244, gKartPeach245, gKartPeach246, gKartPeach247, gKartPeach248, -}; - -u8* gKartPeachGroup5[] = { - gKartPeach105, gKartPeach106, gKartPeach107, gKartPeach108, gKartPeach109, gKartPeach110, gKartPeach111, - gKartPeach112, gKartPeach113, gKartPeach114, gKartPeach115, gKartPeach116, gKartPeach117, gKartPeach118, - gKartPeach119, gKartPeach120, gKartPeach121, gKartPeach122, gKartPeach123, gKartPeach124, gKartPeach125, - gKartPeach235, gKartPeach236, gKartPeach237, gKartPeach238, gKartPeach239, gKartPeach240, gKartPeach241, - gKartPeach242, gKartPeach243, gKartPeach244, gKartPeach245, gKartPeach246, gKartPeach247, gKartPeach248, -}; - -u8* gKartPeachGroup6[] = { - gKartPeach126, gKartPeach127, gKartPeach128, gKartPeach129, gKartPeach130, gKartPeach131, gKartPeach132, - gKartPeach133, gKartPeach134, gKartPeach135, gKartPeach136, gKartPeach137, gKartPeach138, gKartPeach139, - gKartPeach140, gKartPeach141, gKartPeach142, gKartPeach143, gKartPeach144, gKartPeach145, gKartPeach146, - gKartPeach255, gKartPeach256, gKartPeach257, gKartPeach258, gKartPeach259, gKartPeach260, gKartPeach261, - gKartPeach262, gKartPeach263, gKartPeach264, gKartPeach265, gKartPeach266, gKartPeach267, gKartPeach268, -}; - -u8* gKartPeachGroup7[] = { - gKartPeach147, gKartPeach148, gKartPeach149, gKartPeach150, gKartPeach151, gKartPeach152, gKartPeach153, - gKartPeach154, gKartPeach155, gKartPeach156, gKartPeach157, gKartPeach158, gKartPeach159, gKartPeach160, - gKartPeach161, gKartPeach162, gKartPeach163, gKartPeach164, gKartPeach165, gKartPeach166, gKartPeach167, - gKartPeach275, gKartPeach276, gKartPeach277, gKartPeach278, gKartPeach279, gKartPeach280, gKartPeach281, - gKartPeach282, gKartPeach283, gKartPeach284, gKartPeach285, gKartPeach286, gKartPeach287, gKartPeach288, -}; - -u8* gKartPeachGroup8[] = { - gKartPeach168, gKartPeach169, gKartPeach170, gKartPeach171, gKartPeach172, gKartPeach173, gKartPeach174, - gKartPeach175, gKartPeach176, gKartPeach177, gKartPeach178, gKartPeach179, gKartPeach180, gKartPeach181, - gKartPeach182, gKartPeach183, gKartPeach184, gKartPeach185, gKartPeach186, gKartPeach187, gKartPeach188, - gKartPeach275, gKartPeach276, gKartPeach277, gKartPeach278, gKartPeach279, gKartPeach280, gKartPeach281, - gKartPeach282, gKartPeach283, gKartPeach284, gKartPeach285, gKartPeach286, gKartPeach287, gKartPeach288, -}; - -u8* gKartPeachGroup9[] = { - gKartPeach189, gKartPeach190, gKartPeach191, gKartPeach192, gKartPeach193, gKartPeach194, gKartPeach195, - gKartPeach196, gKartPeach197, gKartPeach198, gKartPeach199, gKartPeach200, gKartPeach201, gKartPeach202, - gKartPeach203, gKartPeach204, gKartPeach205, gKartPeach206, gKartPeach207, gKartPeach208, -}; - -u8* gKartPeachGroup10[] = { - gKartPeach189, gKartPeach190, gKartPeach191, gKartPeach192, gKartPeach193, gKartPeach194, gKartPeach195, - gKartPeach196, gKartPeach197, gKartPeach198, gKartPeach199, gKartPeach200, gKartPeach201, gKartPeach202, - gKartPeach203, gKartPeach204, gKartPeach205, gKartPeach206, gKartPeach207, gKartPeach208, -}; - -u8* gKartPeachGroup11[] = { - gKartPeach209, gKartPeach210, gKartPeach211, gKartPeach212, gKartPeach213, gKartPeach214, gKartPeach215, - gKartPeach216, gKartPeach217, gKartPeach218, gKartPeach219, gKartPeach220, gKartPeach221, gKartPeach222, - gKartPeach223, gKartPeach224, gKartPeach225, gKartPeach226, gKartPeach227, gKartPeach228, -}; - -u8* gKartPeachGroup12[] = { - gKartPeach229, gKartPeach230, gKartPeach231, gKartPeach232, gKartPeach233, gKartPeach234, gKartPeach235, - gKartPeach236, gKartPeach237, gKartPeach238, gKartPeach239, gKartPeach240, gKartPeach241, gKartPeach242, - gKartPeach243, gKartPeach244, gKartPeach245, gKartPeach246, gKartPeach247, gKartPeach248, -}; - -u8* gKartPeachGroup13[] = { - gKartPeach229, gKartPeach230, gKartPeach231, gKartPeach232, gKartPeach233, gKartPeach234, gKartPeach235, - gKartPeach236, gKartPeach237, gKartPeach238, gKartPeach239, gKartPeach240, gKartPeach241, gKartPeach242, - gKartPeach243, gKartPeach244, gKartPeach245, gKartPeach246, gKartPeach247, gKartPeach248, -}; - -u8* gKartPeachGroup14[] = { - gKartPeach229, gKartPeach230, gKartPeach231, gKartPeach232, gKartPeach233, gKartPeach234, gKartPeach235, - gKartPeach236, gKartPeach237, gKartPeach238, gKartPeach239, gKartPeach240, gKartPeach241, gKartPeach242, - gKartPeach243, gKartPeach244, gKartPeach245, gKartPeach246, gKartPeach247, gKartPeach248, -}; - -u8* gKartPeachGroup15[] = { - gKartPeach249, gKartPeach250, gKartPeach251, gKartPeach252, gKartPeach253, gKartPeach254, gKartPeach255, - gKartPeach256, gKartPeach257, gKartPeach258, gKartPeach259, gKartPeach260, gKartPeach261, gKartPeach262, - gKartPeach263, gKartPeach264, gKartPeach265, gKartPeach266, gKartPeach267, gKartPeach268, -}; - -u8* gKartPeachGroup16[] = { - gKartPeach269, gKartPeach270, gKartPeach271, gKartPeach272, gKartPeach273, gKartPeach274, gKartPeach275, - gKartPeach276, gKartPeach277, gKartPeach278, gKartPeach279, gKartPeach280, gKartPeach281, gKartPeach282, - gKartPeach283, gKartPeach284, gKartPeach285, gKartPeach286, gKartPeach287, gKartPeach288, -}; - -u8* gKartPeachGroup17[] = { - gKartPeach269, gKartPeach270, gKartPeach271, gKartPeach272, gKartPeach273, gKartPeach274, gKartPeach275, - gKartPeach276, gKartPeach277, gKartPeach278, gKartPeach279, gKartPeach280, gKartPeach281, gKartPeach282, - gKartPeach283, gKartPeach284, gKartPeach285, gKartPeach286, gKartPeach287, gKartPeach288, -}; - -u8* gKartWarioGroup0[] = { - gKartWario000, gKartWario001, gKartWario002, gKartWario003, gKartWario004, gKartWario005, gKartWario006, - gKartWario007, gKartWario008, gKartWario009, gKartWario010, gKartWario011, gKartWario012, gKartWario013, - gKartWario014, gKartWario015, gKartWario016, gKartWario017, gKartWario018, gKartWario019, gKartWario020, - gKartWario195, gKartWario196, gKartWario197, gKartWario198, gKartWario199, gKartWario200, gKartWario201, - gKartWario202, gKartWario203, gKartWario204, gKartWario205, gKartWario206, gKartWario207, gKartWario208, -}; - -u8* gKartWarioGroup1[] = { - gKartWario021, gKartWario022, gKartWario023, gKartWario024, gKartWario025, gKartWario026, gKartWario027, - gKartWario028, gKartWario029, gKartWario030, gKartWario031, gKartWario032, gKartWario033, gKartWario034, - gKartWario035, gKartWario036, gKartWario037, gKartWario038, gKartWario039, gKartWario040, gKartWario041, - gKartWario195, gKartWario196, gKartWario197, gKartWario198, gKartWario199, gKartWario200, gKartWario201, - gKartWario202, gKartWario203, gKartWario204, gKartWario205, gKartWario206, gKartWario207, gKartWario208, -}; - -u8* gKartWarioGroup2[] = { - gKartWario042, gKartWario043, gKartWario044, gKartWario045, gKartWario046, gKartWario047, gKartWario048, - gKartWario049, gKartWario050, gKartWario051, gKartWario052, gKartWario053, gKartWario054, gKartWario055, - gKartWario056, gKartWario057, gKartWario058, gKartWario059, gKartWario060, gKartWario061, gKartWario062, - gKartWario215, gKartWario216, gKartWario217, gKartWario218, gKartWario219, gKartWario220, gKartWario221, - gKartWario222, gKartWario223, gKartWario224, gKartWario225, gKartWario226, gKartWario227, gKartWario228, -}; - -u8* gKartWarioGroup3[] = { - gKartWario063, gKartWario064, gKartWario065, gKartWario066, gKartWario067, gKartWario068, gKartWario069, - gKartWario070, gKartWario071, gKartWario072, gKartWario073, gKartWario074, gKartWario075, gKartWario076, - gKartWario077, gKartWario078, gKartWario079, gKartWario080, gKartWario081, gKartWario082, gKartWario083, - gKartWario235, gKartWario236, gKartWario237, gKartWario238, gKartWario239, gKartWario240, gKartWario241, - gKartWario242, gKartWario243, gKartWario244, gKartWario245, gKartWario246, gKartWario247, gKartWario248, -}; - -u8* gKartWarioGroup4[] = { - gKartWario084, gKartWario085, gKartWario086, gKartWario087, gKartWario088, gKartWario089, gKartWario090, - gKartWario091, gKartWario092, gKartWario093, gKartWario094, gKartWario095, gKartWario096, gKartWario097, - gKartWario098, gKartWario099, gKartWario100, gKartWario101, gKartWario102, gKartWario103, gKartWario104, - gKartWario235, gKartWario236, gKartWario237, gKartWario238, gKartWario239, gKartWario240, gKartWario241, - gKartWario242, gKartWario243, gKartWario244, gKartWario245, gKartWario246, gKartWario247, gKartWario248, -}; - -u8* gKartWarioGroup5[] = { - gKartWario105, gKartWario106, gKartWario107, gKartWario108, gKartWario109, gKartWario110, gKartWario111, - gKartWario112, gKartWario113, gKartWario114, gKartWario115, gKartWario116, gKartWario117, gKartWario118, - gKartWario119, gKartWario120, gKartWario121, gKartWario122, gKartWario123, gKartWario124, gKartWario125, - gKartWario235, gKartWario236, gKartWario237, gKartWario238, gKartWario239, gKartWario240, gKartWario241, - gKartWario242, gKartWario243, gKartWario244, gKartWario245, gKartWario246, gKartWario247, gKartWario248, -}; - -u8* gKartWarioGroup6[] = { - gKartWario126, gKartWario127, gKartWario128, gKartWario129, gKartWario130, gKartWario131, gKartWario132, - gKartWario133, gKartWario134, gKartWario135, gKartWario136, gKartWario137, gKartWario138, gKartWario139, - gKartWario140, gKartWario141, gKartWario142, gKartWario143, gKartWario144, gKartWario145, gKartWario146, - gKartWario255, gKartWario256, gKartWario257, gKartWario258, gKartWario259, gKartWario260, gKartWario261, - gKartWario262, gKartWario263, gKartWario264, gKartWario265, gKartWario266, gKartWario267, gKartWario268, -}; - -u8* gKartWarioGroup7[] = { - gKartWario147, gKartWario148, gKartWario149, gKartWario150, gKartWario151, gKartWario152, gKartWario153, - gKartWario154, gKartWario155, gKartWario156, gKartWario157, gKartWario158, gKartWario159, gKartWario160, - gKartWario161, gKartWario162, gKartWario163, gKartWario164, gKartWario165, gKartWario166, gKartWario167, - gKartWario275, gKartWario276, gKartWario277, gKartWario278, gKartWario279, gKartWario280, gKartWario281, - gKartWario282, gKartWario283, gKartWario284, gKartWario285, gKartWario286, gKartWario287, gKartWario288, -}; - -u8* gKartWarioGroup8[] = { - gKartWario168, gKartWario169, gKartWario170, gKartWario171, gKartWario172, gKartWario173, gKartWario174, - gKartWario175, gKartWario176, gKartWario177, gKartWario178, gKartWario179, gKartWario180, gKartWario181, - gKartWario182, gKartWario183, gKartWario184, gKartWario185, gKartWario186, gKartWario187, gKartWario188, - gKartWario275, gKartWario276, gKartWario277, gKartWario278, gKartWario279, gKartWario280, gKartWario281, - gKartWario282, gKartWario283, gKartWario284, gKartWario285, gKartWario286, gKartWario287, gKartWario288, -}; - -u8* gKartWarioGroup9[] = { - gKartWario189, gKartWario190, gKartWario191, gKartWario192, gKartWario193, gKartWario194, gKartWario195, - gKartWario196, gKartWario197, gKartWario198, gKartWario199, gKartWario200, gKartWario201, gKartWario202, - gKartWario203, gKartWario204, gKartWario205, gKartWario206, gKartWario207, gKartWario208, -}; - -u8* gKartWarioGroup10[] = { - gKartWario189, gKartWario190, gKartWario191, gKartWario192, gKartWario193, gKartWario194, gKartWario195, - gKartWario196, gKartWario197, gKartWario198, gKartWario199, gKartWario200, gKartWario201, gKartWario202, - gKartWario203, gKartWario204, gKartWario205, gKartWario206, gKartWario207, gKartWario208, -}; - -u8* gKartWarioGroup11[] = { - gKartWario209, gKartWario210, gKartWario211, gKartWario212, gKartWario213, gKartWario214, gKartWario215, - gKartWario216, gKartWario217, gKartWario218, gKartWario219, gKartWario220, gKartWario221, gKartWario222, - gKartWario223, gKartWario224, gKartWario225, gKartWario226, gKartWario227, gKartWario228, -}; - -u8* gKartWarioGroup12[] = { - gKartWario229, gKartWario230, gKartWario231, gKartWario232, gKartWario233, gKartWario234, gKartWario235, - gKartWario236, gKartWario237, gKartWario238, gKartWario239, gKartWario240, gKartWario241, gKartWario242, - gKartWario243, gKartWario244, gKartWario245, gKartWario246, gKartWario247, gKartWario248, -}; - -u8* gKartWarioGroup13[] = { - gKartWario229, gKartWario230, gKartWario231, gKartWario232, gKartWario233, gKartWario234, gKartWario235, - gKartWario236, gKartWario237, gKartWario238, gKartWario239, gKartWario240, gKartWario241, gKartWario242, - gKartWario243, gKartWario244, gKartWario245, gKartWario246, gKartWario247, gKartWario248, -}; - -u8* gKartWarioGroup14[] = { - gKartWario229, gKartWario230, gKartWario231, gKartWario232, gKartWario233, gKartWario234, gKartWario235, - gKartWario236, gKartWario237, gKartWario238, gKartWario239, gKartWario240, gKartWario241, gKartWario242, - gKartWario243, gKartWario244, gKartWario245, gKartWario246, gKartWario247, gKartWario248, -}; - -u8* gKartWarioGroup15[] = { - gKartWario249, gKartWario250, gKartWario251, gKartWario252, gKartWario253, gKartWario254, gKartWario255, - gKartWario256, gKartWario257, gKartWario258, gKartWario259, gKartWario260, gKartWario261, gKartWario262, - gKartWario263, gKartWario264, gKartWario265, gKartWario266, gKartWario267, gKartWario268, -}; - -u8* gKartWarioGroup16[] = { - gKartWario269, gKartWario270, gKartWario271, gKartWario272, gKartWario273, gKartWario274, gKartWario275, - gKartWario276, gKartWario277, gKartWario278, gKartWario279, gKartWario280, gKartWario281, gKartWario282, - gKartWario283, gKartWario284, gKartWario285, gKartWario286, gKartWario287, gKartWario288, -}; - -u8* gKartWarioGroup17[] = { - gKartWario269, gKartWario270, gKartWario271, gKartWario272, gKartWario273, gKartWario274, gKartWario275, - gKartWario276, gKartWario277, gKartWario278, gKartWario279, gKartWario280, gKartWario281, gKartWario282, - gKartWario283, gKartWario284, gKartWario285, gKartWario286, gKartWario287, gKartWario288, -}; - -u8** gKartMarioTable0[] = { - gKartMarioGroup8, gKartMarioGroup7, gKartMarioGroup6, gKartMarioGroup5, gKartMarioGroup4, - gKartMarioGroup3, gKartMarioGroup2, gKartMarioGroup1, gKartMarioGroup0, -}; - -u8** gKartLuigiTable0[] = { - gKartLuigiGroup8, gKartLuigiGroup7, gKartLuigiGroup6, gKartLuigiGroup5, gKartLuigiGroup4, - gKartLuigiGroup3, gKartLuigiGroup2, gKartLuigiGroup1, gKartLuigiGroup0, -}; - -u8** gKartYoshiTable0[] = { - gKartYoshiGroup8, gKartYoshiGroup7, gKartYoshiGroup6, gKartYoshiGroup5, gKartYoshiGroup4, - gKartYoshiGroup3, gKartYoshiGroup2, gKartYoshiGroup1, gKartYoshiGroup0, -}; - -u8** gKartToadTable0[] = { - gKartToadGroup8, gKartToadGroup7, gKartToadGroup6, gKartToadGroup5, gKartToadGroup4, - gKartToadGroup3, gKartToadGroup2, gKartToadGroup1, gKartToadGroup0, -}; - -u8** gKartDKTable0[] = { - gKartDKGroup8, gKartDKGroup7, gKartDKGroup6, gKartDKGroup5, gKartDKGroup4, - gKartDKGroup3, gKartDKGroup2, gKartDKGroup1, gKartDKGroup0, -}; - -u8** gKartWarioTable0[] = { - gKartWarioGroup8, gKartWarioGroup7, gKartWarioGroup6, gKartWarioGroup5, gKartWarioGroup4, - gKartWarioGroup3, gKartWarioGroup2, gKartWarioGroup1, gKartWarioGroup0, -}; - -u8** gKartPeachTable0[] = { - gKartPeachGroup8, gKartPeachGroup7, gKartPeachGroup6, gKartPeachGroup5, gKartPeachGroup4, - gKartPeachGroup3, gKartPeachGroup2, gKartPeachGroup1, gKartPeachGroup0, -}; - -u8** gKartBowserTable0[] = { - gKartBowserGroup8, gKartBowserGroup7, gKartBowserGroup6, gKartBowserGroup5, gKartBowserGroup4, - gKartBowserGroup3, gKartBowserGroup2, gKartBowserGroup1, gKartBowserGroup0, -}; - -u8** gKartMarioTable1[] = { - gKartMarioGroup17, gKartMarioGroup16, gKartMarioGroup15, gKartMarioGroup14, gKartMarioGroup13, - gKartMarioGroup12, gKartMarioGroup11, gKartMarioGroup10, gKartMarioGroup9, -}; - -u8** gKartLuigiTable1[] = { - gKartLuigiGroup17, gKartLuigiGroup16, gKartLuigiGroup15, gKartLuigiGroup14, gKartLuigiGroup13, - gKartLuigiGroup12, gKartLuigiGroup11, gKartLuigiGroup10, gKartLuigiGroup9, -}; - -u8** gKartYoshiTable1[] = { - gKartYoshiGroup17, gKartYoshiGroup16, gKartYoshiGroup15, gKartYoshiGroup14, gKartYoshiGroup13, - gKartYoshiGroup12, gKartYoshiGroup11, gKartYoshiGroup10, gKartYoshiGroup9, -}; - -u8** gKartToadTable1[] = { - gKartToadGroup17, gKartToadGroup16, gKartToadGroup15, gKartToadGroup14, gKartToadGroup13, - gKartToadGroup12, gKartToadGroup11, gKartToadGroup10, gKartToadGroup9, -}; - -u8** gKartDKTable1[] = { - gKartDKGroup17, gKartDKGroup16, gKartDKGroup15, gKartDKGroup14, gKartDKGroup13, - gKartDKGroup12, gKartDKGroup11, gKartDKGroup10, gKartDKGroup9, -}; - -u8** gKartWarioTable1[] = { - gKartWarioGroup17, gKartWarioGroup16, gKartWarioGroup15, gKartWarioGroup14, gKartWarioGroup13, - gKartWarioGroup12, gKartWarioGroup11, gKartWarioGroup10, gKartWarioGroup9, -}; - -u8** gKartPeachTable1[] = { - gKartPeachGroup17, gKartPeachGroup16, gKartPeachGroup15, gKartPeachGroup14, gKartPeachGroup13, - gKartPeachGroup12, gKartPeachGroup11, gKartPeachGroup10, gKartPeachGroup9, -}; - -u8** gKartBowserTable1[] = { - gKartBowserGroup17, gKartBowserGroup16, gKartBowserGroup15, gKartBowserGroup14, gKartBowserGroup13, - gKartBowserGroup12, gKartBowserGroup11, gKartBowserGroup10, gKartBowserGroup9, -}; +#define DECLARE_KART_GROUP(var) \ + u8* var##Group0[] = { \ + var##000, var##001, var##002, var##003, var##004, var##005, var##006, var##007, var##008, \ + var##009, var##010, var##011, var##012, var##013, var##014, var##015, var##016, var##017, \ + var##018, var##019, var##020, var##195, var##196, var##197, var##198, var##199, var##200, \ + var##201, var##202, var##203, var##204, var##205, var##206, var##207, var##208, \ + }; \ + u8* var##Group1[] = { \ + var##021, var##022, var##023, var##024, var##025, var##026, var##027, var##028, var##029, \ + var##030, var##031, var##032, var##033, var##034, var##035, var##036, var##037, var##038, \ + var##039, var##040, var##041, var##195, var##196, var##197, var##198, var##199, var##200, \ + var##201, var##202, var##203, var##204, var##205, var##206, var##207, var##208, \ + }; \ + u8* var##Group2[] = { \ + var##042, var##043, var##044, var##045, var##046, var##047, var##048, var##049, var##050, \ + var##051, var##052, var##053, var##054, var##055, var##056, var##057, var##058, var##059, \ + var##060, var##061, var##062, var##215, var##216, var##217, var##218, var##219, var##220, \ + var##221, var##222, var##223, var##224, var##225, var##226, var##227, var##228, \ + }; \ + u8* var##Group3[] = { \ + var##063, var##064, var##065, var##066, var##067, var##068, var##069, var##070, var##071, \ + var##072, var##073, var##074, var##075, var##076, var##077, var##078, var##079, var##080, \ + var##081, var##082, var##083, var##235, var##236, var##237, var##238, var##239, var##240, \ + var##241, var##242, var##243, var##244, var##245, var##246, var##247, var##248, \ + }; \ + u8* var##Group4[] = { \ + var##084, var##085, var##086, var##087, var##088, var##089, var##090, var##091, var##092, \ + var##093, var##094, var##095, var##096, var##097, var##098, var##099, var##100, var##101, \ + var##102, var##103, var##104, var##235, var##236, var##237, var##238, var##239, var##240, \ + var##241, var##242, var##243, var##244, var##245, var##246, var##247, var##248, \ + }; \ + u8* var##Group5[] = { \ + var##105, var##106, var##107, var##108, var##109, var##110, var##111, var##112, var##113, \ + var##114, var##115, var##116, var##117, var##118, var##119, var##120, var##121, var##122, \ + var##123, var##124, var##125, var##235, var##236, var##237, var##238, var##239, var##240, \ + var##241, var##242, var##243, var##244, var##245, var##246, var##247, var##248, \ + }; \ + u8* var##Group6[] = { \ + var##126, var##127, var##128, var##129, var##130, var##131, var##132, var##133, var##134, \ + var##135, var##136, var##137, var##138, var##139, var##140, var##141, var##142, var##143, \ + var##144, var##145, var##146, var##255, var##256, var##257, var##258, var##259, var##260, \ + var##261, var##262, var##263, var##264, var##265, var##266, var##267, var##268, \ + }; \ + u8* var##Group7[] = { \ + var##147, var##148, var##149, var##150, var##151, var##152, var##153, var##154, var##155, \ + var##156, var##157, var##158, var##159, var##160, var##161, var##162, var##163, var##164, \ + var##165, var##166, var##167, var##275, var##276, var##277, var##278, var##279, var##280, \ + var##281, var##282, var##283, var##284, var##285, var##286, var##287, var##288, \ + }; \ + u8* var##Group8[] = { \ + var##168, var##169, var##170, var##171, var##172, var##173, var##174, var##175, var##176, \ + var##177, var##178, var##179, var##180, var##181, var##182, var##183, var##184, var##185, \ + var##186, var##187, var##188, var##275, var##276, var##277, var##278, var##279, var##280, \ + var##281, var##282, var##283, var##284, var##285, var##286, var##287, var##288, \ + }; \ + u8* var##Group9[] = { \ + var##189, var##190, var##191, var##192, var##193, var##194, var##195, var##196, var##197, var##198, \ + var##199, var##200, var##201, var##202, var##203, var##204, var##205, var##206, var##207, var##208, \ + }; \ + u8* var##Group10[] = { \ + var##189, var##190, var##191, var##192, var##193, var##194, var##195, var##196, var##197, var##198, \ + var##199, var##200, var##201, var##202, var##203, var##204, var##205, var##206, var##207, var##208, \ + }; \ + u8* var##Group11[] = { \ + var##209, var##210, var##211, var##212, var##213, var##214, var##215, var##216, var##217, var##218, \ + var##219, var##220, var##221, var##222, var##223, var##224, var##225, var##226, var##227, var##228, \ + }; \ + u8* var##Group12[] = { \ + var##229, var##230, var##231, var##232, var##233, var##234, var##235, var##236, var##237, var##238, \ + var##239, var##240, var##241, var##242, var##243, var##244, var##245, var##246, var##247, var##248, \ + }; \ + u8* var##Group13[] = { \ + var##229, var##230, var##231, var##232, var##233, var##234, var##235, var##236, var##237, var##238, \ + var##239, var##240, var##241, var##242, var##243, var##244, var##245, var##246, var##247, var##248, \ + }; \ + u8* var##Group14[] = { \ + var##229, var##230, var##231, var##232, var##233, var##234, var##235, var##236, var##237, var##238, \ + var##239, var##240, var##241, var##242, var##243, var##244, var##245, var##246, var##247, var##248, \ + }; \ + u8* var##Group15[] = { \ + var##249, var##250, var##251, var##252, var##253, var##254, var##255, var##256, var##257, var##258, \ + var##259, var##260, var##261, var##262, var##263, var##264, var##265, var##266, var##267, var##268, \ + }; \ + u8* var##Group16[] = { \ + var##269, var##270, var##271, var##272, var##273, var##274, var##275, var##276, var##277, var##278, \ + var##279, var##280, var##281, var##282, var##283, var##284, var##285, var##286, var##287, var##288, \ + }; \ + u8* var##Group17[] = { \ + var##269, var##270, var##271, var##272, var##273, var##274, var##275, var##276, var##277, var##278, \ + var##279, var##280, var##281, var##282, var##283, var##284, var##285, var##286, var##287, var##288, \ + }; + +#define DECLARE_KART_TABLE0(var) \ + u8** var##Table0[] = { \ + var##Group8, var##Group7, var##Group6, var##Group5, var##Group4, \ + var##Group3, var##Group2, var##Group1, var##Group0, \ + }; + +#define DECLARE_KART_TABLE1(var) \ + u8** var##Table1[] = { \ + var##Group17, var##Group16, var##Group15, var##Group14, var##Group13, \ + var##Group12, var##Group11, var##Group10, var##Group9, \ + }; + +#define DECLARE_KART_TUMBLE_TABLE(var) \ + u8* var##Tumble[] = { var##289, var##290, var##291, var##292, var##293, var##294, var##295, var##296, \ + var##297, var##298, var##299, var##300, var##301, var##302, var##303, var##304, \ + var##305, var##306, var##307, var##308, var##309, var##310, var##311, var##312, \ + var##313, var##314, var##315, var##316, var##317, var##318, var##319, var##320 }; + +DECLARE_KART_GROUP(gKartMario) +DECLARE_KART_GROUP(gKartToad) +DECLARE_KART_GROUP(gKartLuigi) +DECLARE_KART_GROUP(gKartYoshi) +DECLARE_KART_GROUP(gKartDK) +DECLARE_KART_GROUP(gKartBowser) +DECLARE_KART_GROUP(gKartPeach) +DECLARE_KART_GROUP(gKartWario) + +DECLARE_KART_TABLE0(gKartMario) +DECLARE_KART_TABLE0(gKartLuigi) +DECLARE_KART_TABLE0(gKartYoshi) +DECLARE_KART_TABLE0(gKartToad) +DECLARE_KART_TABLE0(gKartDK) +DECLARE_KART_TABLE0(gKartWario) +DECLARE_KART_TABLE0(gKartPeach) +DECLARE_KART_TABLE0(gKartBowser) + +DECLARE_KART_TABLE1(gKartMario) +DECLARE_KART_TABLE1(gKartLuigi) +DECLARE_KART_TABLE1(gKartYoshi) +DECLARE_KART_TABLE1(gKartToad) +DECLARE_KART_TABLE1(gKartDK) +DECLARE_KART_TABLE1(gKartWario) +DECLARE_KART_TABLE1(gKartPeach) +DECLARE_KART_TABLE1(gKartBowser) u8*** gKartTextureTable0[] = { gKartMarioTable0, gKartLuigiTable0, gKartYoshiTable0, gKartToadTable0, @@ -1101,67 +159,14 @@ u8*** gKartTextureTable1[] = { gKartDKTable1, gKartWarioTable1, gKartPeachTable1, gKartBowserTable1, }; -u8* gKartMarioTumble[] = { - gKartMario289, gKartMario290, gKartMario291, gKartMario292, gKartMario293, gKartMario294, gKartMario295, - gKartMario296, gKartMario297, gKartMario298, gKartMario299, gKartMario300, gKartMario301, gKartMario302, - gKartMario303, gKartMario304, gKartMario305, gKartMario306, gKartMario307, gKartMario308, gKartMario309, - gKartMario310, gKartMario311, gKartMario312, gKartMario313, gKartMario314, gKartMario315, gKartMario316, - gKartMario317, gKartMario318, gKartMario319, gKartMario320, -}; - -u8* gKartLuigiTumble[] = { - gKartLuigi289, gKartLuigi290, gKartLuigi291, gKartLuigi292, gKartLuigi293, gKartLuigi294, gKartLuigi295, - gKartLuigi296, gKartLuigi297, gKartLuigi298, gKartLuigi299, gKartLuigi300, gKartLuigi301, gKartLuigi302, - gKartLuigi303, gKartLuigi304, gKartLuigi305, gKartLuigi306, gKartLuigi307, gKartLuigi308, gKartLuigi309, - gKartLuigi310, gKartLuigi311, gKartLuigi312, gKartLuigi313, gKartLuigi314, gKartLuigi315, gKartLuigi316, - gKartLuigi317, gKartLuigi318, gKartLuigi319, gKartLuigi320, -}; - -u8* gKartBowserTumble[] = { - gKartBowser289, gKartBowser290, gKartBowser291, gKartBowser292, gKartBowser293, gKartBowser294, gKartBowser295, - gKartBowser296, gKartBowser297, gKartBowser298, gKartBowser299, gKartBowser300, gKartBowser301, gKartBowser302, - gKartBowser303, gKartBowser304, gKartBowser305, gKartBowser306, gKartBowser307, gKartBowser308, gKartBowser309, - gKartBowser310, gKartBowser311, gKartBowser312, gKartBowser313, gKartBowser314, gKartBowser315, gKartBowser316, - gKartBowser317, gKartBowser318, gKartBowser319, gKartBowser320, -}; - -u8* gKartToadTumble[] = { - gKartToad289, gKartToad290, gKartToad291, gKartToad292, gKartToad293, gKartToad294, gKartToad295, gKartToad296, - gKartToad297, gKartToad298, gKartToad299, gKartToad300, gKartToad301, gKartToad302, gKartToad303, gKartToad304, - gKartToad305, gKartToad306, gKartToad307, gKartToad308, gKartToad309, gKartToad310, gKartToad311, gKartToad312, - gKartToad313, gKartToad314, gKartToad315, gKartToad316, gKartToad317, gKartToad318, gKartToad319, gKartToad320, -}; - -u8* gKartYoshiTumble[] = { - gKartYoshi289, gKartYoshi290, gKartYoshi291, gKartYoshi292, gKartYoshi293, gKartYoshi294, gKartYoshi295, - gKartYoshi296, gKartYoshi297, gKartYoshi298, gKartYoshi299, gKartYoshi300, gKartYoshi301, gKartYoshi302, - gKartYoshi303, gKartYoshi304, gKartYoshi305, gKartYoshi306, gKartYoshi307, gKartYoshi308, gKartYoshi309, - gKartYoshi310, gKartYoshi311, gKartYoshi312, gKartYoshi313, gKartYoshi314, gKartYoshi315, gKartYoshi316, - gKartYoshi317, gKartYoshi318, gKartYoshi319, gKartYoshi320, -}; - -u8* gKartDKTumble[] = { - gKartDK289, gKartDK290, gKartDK291, gKartDK292, gKartDK293, gKartDK294, gKartDK295, gKartDK296, - gKartDK297, gKartDK298, gKartDK299, gKartDK300, gKartDK301, gKartDK302, gKartDK303, gKartDK304, - gKartDK305, gKartDK306, gKartDK307, gKartDK308, gKartDK309, gKartDK310, gKartDK311, gKartDK312, - gKartDK313, gKartDK314, gKartDK315, gKartDK316, gKartDK317, gKartDK318, gKartDK319, gKartDK320, -}; - -u8* gKartPeachTumble[] = { - gKartPeach289, gKartPeach290, gKartPeach291, gKartPeach292, gKartPeach293, gKartPeach294, gKartPeach295, - gKartPeach296, gKartPeach297, gKartPeach298, gKartPeach299, gKartPeach300, gKartPeach301, gKartPeach302, - gKartPeach303, gKartPeach304, gKartPeach305, gKartPeach306, gKartPeach307, gKartPeach308, gKartPeach309, - gKartPeach310, gKartPeach311, gKartPeach312, gKartPeach313, gKartPeach314, gKartPeach315, gKartPeach316, - gKartPeach317, gKartPeach318, gKartPeach319, gKartPeach320, -}; - -u8* gKartWarioTumble[] = { - gKartWario289, gKartWario290, gKartWario291, gKartWario292, gKartWario293, gKartWario294, gKartWario295, - gKartWario296, gKartWario297, gKartWario298, gKartWario299, gKartWario300, gKartWario301, gKartWario302, - gKartWario303, gKartWario304, gKartWario305, gKartWario306, gKartWario307, gKartWario308, gKartWario309, - gKartWario310, gKartWario311, gKartWario312, gKartWario313, gKartWario314, gKartWario315, gKartWario316, - gKartWario317, gKartWario318, gKartWario319, gKartWario320, -}; +DECLARE_KART_TUMBLE_TABLE(gKartMario) +DECLARE_KART_TUMBLE_TABLE(gKartLuigi) +DECLARE_KART_TUMBLE_TABLE(gKartBowser) +DECLARE_KART_TUMBLE_TABLE(gKartToad) +DECLARE_KART_TUMBLE_TABLE(gKartYoshi) +DECLARE_KART_TUMBLE_TABLE(gKartDK) +DECLARE_KART_TUMBLE_TABLE(gKartPeach) +DECLARE_KART_TUMBLE_TABLE(gKartWario) u8** gKartTextureTumbles[] = { gKartMarioTumble, gKartLuigiTumble, gKartYoshiTumble, gKartToadTumble, @@ -1187,8 +192,11 @@ u8* gKartPalettes[] = { **/ void load_kart_texture(Player* player, s8 playerId, s8 screenId, s8 screenId2, s8 index) { s32 temp = player->effects; - if (((temp & 0x80) == 0x80) || ((temp & 0x40) == 0x40) || ((temp & 0x80000) == 0x80000) || - ((temp & 0x800000) == 0x800000) || ((temp & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { + if (((temp & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((temp & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((temp & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((temp & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((temp & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || ((player->kartProps & UNUSED_0x800) != 0)) { if (player->animFrameSelector[screenId] != 0) { osInvalDCache(&gEncodedKartTexture[index][screenId2][playerId], D_800DDEB0[player->characterId]); @@ -1212,8 +220,10 @@ void load_kart_texture(Player* player, s8 playerId, s8 screenId, s8 screenId2, s osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); } - } else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) || - ((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) { + } else if (((temp & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((temp & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((temp & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || + ((temp & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { osInvalDCache(&gEncodedKartTexture[index][screenId2][playerId], 0x780U); // player->unk_0A8 >> 8 converts an 8.8 fixed-point animation frame to a whole number. osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, @@ -1238,8 +248,11 @@ void load_kart_texture(Player* player, s8 playerId, s8 screenId, s8 screenId2, s void load_kart_texture_non_blocking(Player* player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) { s32 temp = player->effects; - if (((temp & 0x80) == 0x80) || ((temp & 0x40) == 0x40) || ((temp & 0x80000) == 0x80000) || - ((temp & 0x800000) == 0x800000) || ((temp & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { + if (((temp & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((temp & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((temp & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((temp & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((temp & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || ((player->kartProps & UNUSED_0x800) != 0)) { if (player->animFrameSelector[arg2] != 0) { osInvalDCache(&gEncodedKartTexture[arg4][arg3][arg1], D_800DDEB0[player->characterId]); @@ -1257,8 +270,10 @@ void load_kart_texture_non_blocking(Player* player, s8 arg1, s8 arg2, s8 arg3, s [player->animFrameSelector[arg2]])], &gEncodedKartTexture[arg4][arg3][arg1], D_800DDEB0[player->characterId], &gDmaMesgQueue); } - } else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) || - ((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) { + } else if (((temp & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((temp & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((temp & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || + ((temp & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT)) { osInvalDCache(&gEncodedKartTexture[arg4][arg3][arg1], 0x780); // player->unk_0A8 >> 8 converts an 8.8 fixed-point animation frame to a whole number. osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, diff --git a/src/main.c b/src/main.c index eba4715098..044cc235f0 100644 --- a/src/main.c +++ b/src/main.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "profiler.h" #include "main.h" @@ -27,26 +28,22 @@ #include "code_800029B0.h" #include "code_80280000.h" #include "podium_ceremony_actors.h" -#include "code_80091750.h" +#include "menu_items.h" #include "code_80057C60.h" #include "profiler.h" #include "player_controller.h" #include "render_player.h" #include "render_courses.h" #include "actors.h" -#include "staff_ghosts.h" +#include "replays.h" #include #include "crash_screen.h" #include "buffers/gfx_output_buffer.h" -// Declarations (not in this file) void func_80091B78(void); - -void audio_init(); - +void audio_init(void); void create_debug_thread(void); void start_debug_thread(void); - struct SPTask* create_next_audio_frame_task(void); struct VblankHandler* gVblankHandler1 = NULL; @@ -123,8 +120,8 @@ f32 gCameraZoom[4]; // look like to be the fov of each character UNUSED s32 D_80150140; UNUSED s32 D_80150144; f32 gScreenAspect; -f32 D_8015014C; -f32 D_80150150; +f32 gCourseFarPersp; +f32 gCourseNearPersp; UNUSED f32 D_80150154; struct D_80150158 gD_80150158[16]; @@ -170,7 +167,7 @@ u16 D_800DC510 = 0; u16 D_800DC514 = 0; u16 creditsRenderMode = 0; // Renders the whole track. Displays red if used in normal race mode. u16 gDemoMode = DEMO_MODE_INACTIVE; -u16 gEnableDebugMode = DEBUG_MODE; +u16 gEnableDebugMode = ENABLE_DEBUG_MODE; s32 gGamestateNext = 7; // = COURSE_DATA_MENU?; UNUSED s32 D_800DC528 = 1; s32 gActiveScreenMode = SCREEN_MODE_1P; @@ -598,7 +595,7 @@ void race_logic_loop(void) { switch (gActiveScreenMode) { case SCREEN_MODE_1P: gTickSpeed = 2; - staff_ghosts_loop(); + replays_loop(); if (gIsGamePaused == 0) { for (i = 0; i < gTickSpeed; i++) { if (D_8015011E) { @@ -606,13 +603,13 @@ void race_logic_loop(void) { } func_802909F0(); evaluate_collision_for_players_and_actors(); - func_800382DC(); + handle_a_press_for_all_players_during_race(); func_8001EE98(gPlayerOneCopy, camera1, 0); func_80028F70(); func_8028F474(); func_80059AC8(); update_course_actors(); - func_802966A0(); + course_update_water(); func_8028FCBC(); } func_80022744(); @@ -668,7 +665,7 @@ void race_logic_loop(void) { } func_802909F0(); evaluate_collision_for_players_and_actors(); - func_800382DC(); + handle_a_press_for_all_players_during_race(); func_8001EE98(gPlayerOneCopy, camera1, 0); func_80029060(); func_8001EE98(gPlayerTwoCopy, camera2, 1); @@ -676,7 +673,7 @@ void race_logic_loop(void) { func_8028F474(); func_80059AC8(); update_course_actors(); - func_802966A0(); + course_update_water(); func_8028FCBC(); } func_80022744(); @@ -714,7 +711,7 @@ void race_logic_loop(void) { } func_802909F0(); evaluate_collision_for_players_and_actors(); - func_800382DC(); + handle_a_press_for_all_players_during_race(); func_8001EE98(gPlayerOneCopy, camera1, 0); func_80029060(); func_8001EE98(gPlayerTwoCopy, camera2, 1); @@ -722,7 +719,7 @@ void race_logic_loop(void) { func_8028F474(); func_80059AC8(); update_course_actors(); - func_802966A0(); + course_update_water(); func_8028FCBC(); } func_80022744(); @@ -782,7 +779,7 @@ void race_logic_loop(void) { } func_802909F0(); evaluate_collision_for_players_and_actors(); - func_800382DC(); + handle_a_press_for_all_players_during_race(); func_8001EE98(gPlayerOneCopy, camera1, 0); func_80029158(); func_8001EE98(gPlayerTwo, camera2, 1); @@ -794,7 +791,7 @@ void race_logic_loop(void) { func_8028F474(); func_80059AC8(); update_course_actors(); - func_802966A0(); + course_update_water(); func_8028FCBC(); } func_80022744(); @@ -1105,25 +1102,25 @@ void thread3_video(UNUSED void* arg0) { void func_800025D4(void) { func_80091B78(); gActiveScreenMode = SCREEN_MODE_1P; - func_802A4D18(); + set_perspective_and_aspect_ratio(); } void func_80002600(void) { func_80091B78(); gActiveScreenMode = SCREEN_MODE_1P; - func_802A4D18(); + set_perspective_and_aspect_ratio(); } void func_8000262C(void) { func_80091B78(); gActiveScreenMode = SCREEN_MODE_1P; - func_802A4D18(); + set_perspective_and_aspect_ratio(); } void func_80002658(void) { func_80091B78(); gActiveScreenMode = SCREEN_MODE_1P; - func_802A4D18(); + set_perspective_and_aspect_ratio(); } /** diff --git a/src/main.h b/src/main.h index e57e334594..6d7ac7aac2 100644 --- a/src/main.h +++ b/src/main.h @@ -167,8 +167,6 @@ extern s32 gGotoMode; extern f32 gCameraZoom[]; extern f32 gScreenAspect; -extern f32 D_8015014C; -extern f32 D_80150150; extern struct D_80150158 gD_80150158[]; extern uintptr_t gSegmentTable[]; diff --git a/src/code_80091750.c b/src/menu_items.c similarity index 56% rename from src/code_80091750.c rename to src/menu_items.c index 7b5176eff3..2207d85f22 100644 --- a/src/code_80091750.c +++ b/src/menu_items.c @@ -1,13 +1,15 @@ #include +#include #include -#include #include #include -#include #include +#include +#include + #include "code_800029B0.h" -#include "code_80091750.h" -#include "code_80005FD0.h" +#include "menu_items.h" +#include "cpu_vehicles_camera_path.h" #include "code_8006E9C0.h" #include "menus.h" #include "save.h" @@ -19,7 +21,7 @@ #include "memory.h" #include "audio/external.h" #include "render_objects.h" -#include "staff_ghosts.h" +#include "replays.h" #include #include "textures.h" #include "math_util.h" @@ -37,11 +39,13 @@ // Unfortunately that's not a small effort due to weird import structure in this project #include "main.h" -u16* D_8018D9B0; -u8* D_8018D9B4; -u8* D_8018D9B8; -u8* D_8018D9BC; -void* D_8018D9C0; +void guMtxCatL(Mtx* m, Mtx* n, Mtx* res); + +u16* gMenuTextureBuffer; +u32* gMenuCompressedBuffer; +u8* sTKMK00_LowResBuffer; +u8* sGPPointsCopy; +void* gSomeDLBuffer; /** * List of bytes indexed by character ID * Indicates number of Grand Prix points that character @@ -51,21 +55,21 @@ s8 gGPPointsByCharacterId[8]; s8 gCharacterIdByGPOverallRank[8]; s8 D_8018D9D8; s8 D_8018D9D9; -struct_8018D9E0_entry D_8018D9E0[D_8018D9E0_SIZE]; +MenuItem gMenuItems[MENU_ITEMS_MAX]; struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; struct_8018E060_entry D_8018E060[D_8018E060_SIZE]; -UNUSED u8 code_80091750_bss_padding0[8]; +UNUSED u8 menu_item_bss_padding0[8]; struct_8018E0E8_entry D_8018E0E8[D_8018E0E8_SIZE]; -s32 gD_8018E118TotalSize; -struct_8018E118_entry D_8018E118[D_8018E118_SIZE]; -s32 gNumD_8018E118Entries; -Gfx* D_8018E75C; +s32 sMenuTextureBufferIndex; +TextureMap sMenuTextureMap[TEXTURE_MAP_MAX]; +s32 sMenuTextureEntries; +Gfx* sGfxPtr; s32 gNumD_8018E768Entries; struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; s32 gCycleFlashMenu; -s8 D_8018E7AC[5]; -u32 D_8018E7B8[5]; -u32 D_8018E7D0[4]; +s8 gTransitionType[5]; +u32 gTransitionDuration[5]; +u32 gCurrentTransitionTime[4]; s32 D_8018E7E0; struct UnkStruct_8018E7E8 D_8018E7E8[D_8018E7E8_SIZE]; struct UnkStruct_8018E7E8 D_8018E810[D_8018E810_SIZE]; @@ -87,20 +91,12 @@ s32 gControllerPak1MaxWriteableFiles; s32 gControllerPak1NumPagesFree; s32 gControllerPak1FileNote; s32 gControllerPak2FileNote; -s32 code_80091750_bss_pad2; +s32 menu_item_bss_pad2; ALIGNED8 SaveData gSaveData; u8 D_8018ED90; u8 D_8018ED91; -s32 s8018ED94; - -f32 D_8018ED98; // Rotation -f32 D_8018ED9C; // Rotation -f32 D_8018EDA0; // Rotation - -f32 D_8018EDA4; -f32 D_8018EDA8; -f32 D_8018EDAC; +s32 sIntroModelTimer; Unk_D_800E70A0 D_800E70A0[] = { { 0x3d, 0x11, 0x00, 0x00 }, { 0x15, 0x3e, 0x00, 0x00 }, { 0x5c, 0x3e, 0x00, 0x00 }, @@ -282,7 +278,7 @@ RGBA16 D_800E74D0[] = { { 0xff, 0xff, 0x00, 0xff }, }; -RGBA16 D_800E74E8[] = { +RGBA16 gBackgroundColor[] = { { 0xff, 0xaf, 0xaf, 0xff }, { 0xaf, 0xff, 0xaf, 0xff }, { 0xaf, 0xaf, 0xff, 0xff }, @@ -321,6 +317,7 @@ char* gCupNames[] = { "special cup", }; +#if !ENABLE_CUSTOM_COURSE_ENGINE // Displays at beginning of course char* gCourseNames[] = { #include "assets/course_metadata/gCourseNames.inc.c" @@ -329,15 +326,22 @@ char* gCourseNames[] = { char* gCourseNamesDup[] = { #include "assets/course_metadata/gCourseNames.inc.c" }; +#else + +#endif char* gCourseNamesDup2[] = { #include "assets/course_metadata/gCourseNames.inc.c" }; +#if !ENABLE_CUSTOM_COURSE_ENGINE // Used in debug menu at splash screen char* gDebugCourseNames[] = { #include "assets/course_metadata/gCourseDebugNames.inc.c" }; +#else + +#endif const s8 gPerCupIndexByCourseId[] = { #include "assets/course_metadata/gPerCupIndexByCourseId.inc.c" @@ -351,7 +355,7 @@ s8 gCupSelectionByCourseId[] = { #include "assets/course_metadata/gCupSelectionByCourseId.inc.c" }; -char* D_800E7678[] = { +char* gCupText[] = { "none", "bronze", "silver", @@ -394,20 +398,20 @@ char* gDebugSoundModeNames[] = { char* gSoundModeNames[NUM_SOUND_MODES] = { "STEREO", "HEADPHONE", "", "MONO" }; -char* D_800E7720[] = { +char* gWinLoseText[] = { "WINNER!", "LOSER!", }; -char* D_800E7728[] = { +char* gBestTimeText[] = { "BEST RECORDS", "BEST LAP", }; // Might need a const? -char* D_800E7730 = "LAP TIME"; +char* gLapTimeText = "LAP TIME"; -char* D_800E7734[] = { +char* gPrefixTimeText[] = { "LAP 1", "LAP 2", "LAP 3", @@ -430,27 +434,27 @@ char* D_800E7778[] = { }; // This is plain data, it should not end up in rodata -char D_800E7780[] = "NOW-MEET THE COURSE GHOST!!!"; +char gTextMenuAnnounceGhost[] = "NOW-MEET THE COURSE GHOST!!!"; -char* D_800E77A0[] = { "CONNECT A CONTROLLER TO SOCKET 1,", "THEN POWER ON AGAIN" }; +char* gTextNoController[] = { "CONNECT A CONTROLLER TO SOCKET 1,", "THEN POWER ON AGAIN" }; -char* D_800E77A8[] = { +char* gTextBattleIntroduction[] = { "BATTLE GAME", "POP OPPOSING PLAYER'S BALLOONS", "WHEN ALL 3 ARE GONE,THEY ARE OUT!", }; // This is plain data, it should not end up in rodata -char D_800E77B4[] = "a BUTTON*SEE DATA B BUTTON*EXIT"; +char gTextMenuData[] = "a BUTTON*SEE DATA B BUTTON*EXIT"; // This is plain data, it should not end up in rodata -char D_800E77D8[] = "distance"; +char gTextDistance[] = "distance"; char* sCourseLengths[] = { #include "assets/course_metadata/sCourseLengths.inc.c" }; -char* D_800E7834[] = { +char* gTextMenuOption[] = { "return to menu", "erase records for this course", "erase ghost from this course", @@ -461,8 +465,8 @@ char* D_800E7840[] = { "erase", }; -// Why oh why is this array flat? It should be D_800E7848[][3] -char* D_800E7848[] = { +// Why oh why is this array flat? It should be gEraseBestGhostText[][3] +char* gEraseBestGhostText[] = { "THE BEST RECORDS AND BEST", "LAP FOR THIS COURSE WILL BE", "ERASED. IS THIS OK?", "GHOST DATA FOR THIS", "COURSE WILL BE ERASED.", "IS THIS OK?", @@ -473,7 +477,7 @@ char* D_800E7860[] = { "GHOST DATA", }; -char* D_800E7868[] = { +char* gTextOptionMenu[] = { "RETURN TO GAME SELECT", "SOUND MODE", "COPY N64 CONTROLLER PAK", @@ -701,7 +705,7 @@ char* D_800E7A9C[] = { "WHAT A PITY!", }; -char* D_800E7AA4[] = { +char* gPlaceText[] = { "YOU PLACED", " st", " nd", " rd", " th", " th", " th", " th", " th", }; @@ -729,7 +733,7 @@ RGBA16 D_800E7AE8[] = { { 0xff, 0xff, 0xff, 0xff }, }; -MkTexture* D_800E7AF8[] = { +MenuTexture* D_800E7AF8[] = { D_02000000, D_02000028, D_02000050, D_02000078, D_020000A0, D_020000C8, D_020000F0, D_02000118, D_02000140, D_02000168, D_02000190, D_020001B8, D_020001E0, D_02000208, D_02000230, D_02000258, D_02000280, D_020002A8, D_020002D0, D_020002F8, D_02000320, D_02000348, D_02000370, D_02000398, D_020003C0, D_020003E8, D_02000410, @@ -747,7 +751,7 @@ MkTexture* D_800E7AF8[] = { D_020013B0, D_020013D8, D_02001400, D_02001428, D_02001450, D_02001478, D_020014A0, }; -MkTexture* D_800E7D0C[] = { +MenuTexture* D_800E7D0C[] = { D_020016BC, D_020016E4, D_0200170C, D_02001734, D_0200175C, D_02001784, D_020017AC, D_020017D4, D_020017FC, D_02001824, }; @@ -756,25 +760,59 @@ MkAnimation* D_800E7D34[] = { D_0200198C, D_0200199C, D_020019AC, D_020019BC, D_020019CC, D_020019DC, }; -MkTexture* D_800E7D4C[] = { - D_02004598, - D_020045C0, +MenuTexture* gMenuTexturesBackground[] = { + seg2_blue_sky_background_texture, + seg2_sunset_background_texture, }; -MkTexture* D_800E7D54[] = { +MenuTexture* D_800E7D54[] = { D_02001A8C, D_02001A64, D_02001AB4, D_02001A14, D_02001B04, D_020019EC, D_02001ADC, D_02001A3C, }; -MkTexture* D_800E7D74[] = { - D_02001B2C, D_02001B54, D_02001B7C, D_02001BA4, D_02001BCC, D_02001BF4, D_02001C1C, - D_02001C44, D_02001C6C, D_02001C94, D_02001CBC, D_02001CE4, D_02001D0C, D_02001D34, - D_02001D5C, D_02001D84, D_02001DAC, D_02001DD4, D_02001DFC, D_02001E24, -}; - -MkTexture* D_800E7DC4[] = { - D_02004EA8, D_02004ED0, D_02004EF8, D_02004F20, D_02004F48, D_02004F70, D_02004F98, - D_02004FC0, D_02004FE8, D_02005010, D_02005038, D_02005060, D_02005088, D_020050B0, - D_020050D8, D_02005100, D_02005128, D_02005150, D_02005178, D_020051A0, +MenuTexture* D_800E7D74[] = { + seg2_mario_raceway_preview_texture, + D_02001B54, + D_02001B7C, + D_02001BA4, + D_02001BCC, + D_02001BF4, + D_02001C1C, + D_02001C44, + D_02001C6C, + D_02001C94, + D_02001CBC, + D_02001CE4, + D_02001D0C, + D_02001D34, + D_02001D5C, + D_02001D84, + D_02001DAC, + D_02001DD4, + D_02001DFC, + D_02001E24, +}; + +MenuTexture* D_800E7DC4[] = { + seg2_mario_raceway_title_texture, + seg2_choco_mountain_title_texture, + D_02004EF8, + D_02004F20, + D_02004F48, + D_02004F70, + D_02004F98, + D_02004FC0, + D_02004FE8, + D_02005010, + D_02005038, + D_02005060, + D_02005088, + D_020050B0, + D_020050D8, + D_02005100, + D_02005128, + D_02005150, + D_02005178, + D_020051A0, }; // Unused? @@ -794,21 +832,101 @@ MkAnimation* D_800E7E34[] = { D_02001F44, D_02001F54, D_02001F64, D_02001F74, D_02001F84, D_02001F94, }; -MkTexture* gGlyphTextureLUT[] = { - D_0200211C, D_02002144, D_0200216C, D_02002194, D_020021BC, D_020021E4, D_0200220C, D_02002234, D_0200225C, - D_02002284, D_020022AC, D_020022D4, D_020022FC, D_02002324, D_0200234C, D_02002374, D_0200239C, D_020023C4, - D_020023EC, D_02002414, D_0200243C, D_02002464, D_0200248C, D_020024B4, D_020024DC, D_02002504, D_0200252C, - D_02002554, D_0200257C, D_020025A4, D_02004584, D_0200261C, D_02002694, D_020026BC, D_020026E4, D_0200270C, - D_02002734, D_0200275C, D_02002784, D_020027AC, D_020027D4, D_020027FC, D_020025CC, D_02002644, D_020025F4, - D_0200266C, D_02004534, D_02004584, D_02002824, D_0200284C, D_02002874, D_0200289C, D_020028C4, D_020028EC, - D_02002F54, D_02002914, D_02002F7C, D_0200293C, D_02002FA4, D_02002964, D_02002FCC, D_0200298C, D_02002FF4, - D_020029B4, D_0200301C, D_020029DC, D_02003044, D_02002A04, D_0200306C, D_02002A2C, D_02003094, D_02002A54, - D_020030BC, D_02002A7C, D_020030E4, D_02002AA4, D_0200310C, D_020033B4, D_02002ACC, D_02003134, D_02002AF4, - D_0200315C, D_02002B1C, D_02003184, D_02002B44, D_02002B6C, D_02002B94, D_02002BBC, D_02002BE4, D_02002C0C, +MenuTexture* gGlyphTextureLUT[] = { + seg2_textureFontLetterA, + seg2_textureFontLetterB, + seg2_textureFontLetterC, + seg2_textureFontLetterD, + seg2_textureFontLetterE, + seg2_textureFontLetterF, + seg2_textureFontLetterG, + seg2_textureFontLetterH, + seg2_textureFontLetterI, + seg2_textureFontLetterJ, + seg2_textureFontLetterK, + seg2_textureFontLetterL, + seg2_textureFontLetterM, + seg2_textureFontLetterN, + seg2_textureFontLetterO, + seg2_textureFontLetterP, + seg2_textureFontLetterQ, + seg2_textureFontLetterR, + seg2_textureFontLetterS, + seg2_textureFontLetterT, + seg2_textureFontLetterU, + seg2_textureFontLetterV, + seg2_textureFontLetterW, + seg2_textureFontLetterX, + seg2_textureFontLetterY, + seg2_textureFontLetterZ, + seg2_textureFontExclamationMark, + seg2_textureFontMinus, + seg2_textureFontInterogationMark, + seg2_textureFontSimpleQuote, + seg2_textureFontEmpty, + seg2_textureFontDot, + seg2_textureFontNumberZero, + seg2_textureFontNumberOne, + seg2_textureFontNumberTwo, + seg2_textureFontNumberThree, + seg2_textureFontNumberFour, + seg2_textureFontNumberFive, + seg2_textureFontNumberSix, + seg2_textureFontNumberSeven, + seg2_textureFontNumberEight, + seg2_textureFontNumberNine, + seg2_textureFontDoubleQuote, + seg2_textureFontFourDote, + seg2_textureFontPlus, + seg2_textureFontCC, + seg2_textureFontComma, + seg2_textureFontEmpty, + D_02002824, + D_0200284C, + D_02002874, + D_0200289C, + D_020028C4, + D_020028EC, + D_02002F54, + D_02002914, + D_02002F7C, + D_0200293C, + D_02002FA4, + D_02002964, + D_02002FCC, + D_0200298C, + D_02002FF4, + D_020029B4, + D_0200301C, + D_020029DC, + D_02003044, + D_02002A04, + D_0200306C, + D_02002A2C, + D_02003094, + D_02002A54, + D_020030BC, + D_02002A7C, + D_020030E4, + D_02002AA4, + D_0200310C, + D_020033B4, + D_02002ACC, + D_02003134, + D_02002AF4, + D_0200315C, + D_02002B1C, + D_02003184, + D_02002B44, + D_02002B6C, + D_02002B94, + D_02002BBC, + D_02002BE4, + D_02002C0C, D_020031AC, }; -MkTexture* D_800E7FF0[] = { +MenuTexture* D_800E7FF0[] = { D_02003274, D_02002C34, D_020031D4, D_0200329C, D_02002C5C, D_020031FC, D_020032C4, D_02002C84, D_02003224, D_020032EC, D_02002CAC, D_0200324C, D_02003314, D_02002CD4, D_02002CFC, D_02002D24, D_02002D4C, D_02002D74, D_0200333C, D_02002D9C, D_02003364, D_02002DC4, D_0200338C, D_02002DEC, D_02002E14, D_02002E3C, D_02002E64, @@ -816,77 +934,112 @@ MkTexture* D_800E7FF0[] = { D_0200347C, D_020034A4, D_020034CC, D_020034F4, D_0200351C, D_02003544, D_0200356C, D_02003BD4, }; -MkTexture* D_800E80A0[] = { +MenuTexture* D_800E80A0[] = { D_02003594, D_02003BFC, D_020035BC, D_02003C24, D_020035E4, D_02003C4C, D_0200360C, D_02003C74, D_02003634, D_02003C9C, D_0200365C, D_02003CC4, D_02003684, D_02003CEC, D_020036AC, D_02003D14, D_020036D4, D_02003D3C, D_020036FC, D_02003D64, D_02003724, D_02003D8C, D_02004034, D_0200374C, D_02003DB4, D_02003774, D_02003DDC, D_0200379C, D_02003E04, }; -MkTexture* D_800E8114[] = { +MenuTexture* D_800E8114[] = { D_020037C4, D_020037EC, D_02003814, D_0200383C, D_02003864, D_0200388C, D_02003E2C, D_02003EF4, D_020038B4, D_02003E54, D_02003F1C, D_020038DC, D_02003E7C, D_02003F44, D_02003904, D_02003EA4, D_02003F6C, D_0200392C, D_02003ECC, D_02003F94, D_02003954, D_0200397C, D_020039A4, D_020039CC, }; -MkTexture* D_800E8174[] = { +MenuTexture* D_800E8174[] = { D_020039F4, D_02003FBC, }; -MkTexture* D_800E817C[] = { +MenuTexture* D_800E817C[] = { D_02003A1C, D_02003FE4, D_02003A44, D_0200400C, D_02003A6C, D_02003A94, D_02003ABC, D_02003AE4, D_02003B0C, D_02003B34, D_02003B5C, D_02003B84, D_02003BAC, D_0200405C, D_02004084, D_020040AC, D_020040D4, D_020040FC, D_020043CC, D_02004444, D_0200437C, D_020043F4, D_02004124, D_0200414C, D_02004174, D_0200419C, }; -MkTexture* D_800E81E4[] = { +MenuTexture* D_800E81E4[] = { D_020041C4, D_020041EC, D_02004214, D_0200423C, D_02004264, D_0200428C, D_020042B4, D_020042DC, D_02004354, D_020043A4, D_0200441C, D_0200446C, D_02004494, D_020044BC, D_02004304, D_0200432C, D_020044E4, D_0200450C, }; -MkTexture* D_800E822C[] = { - D_02004534, +MenuTexture* D_800E822C[] = { + seg2_textureFontComma, D_0200455C, }; -// In a perfect world this would be `MkTexture *D_800E8234[][2]` -MkTexture* D_800E8234[] = { - D_02004688, D_020047DC, D_020046D8, D_02004804, D_0200473C, D_0200482C, +// In a perfect world this would be `MenuTexture *D_800E8234[][2]` +MenuTexture* D_800E8234[] = { + seg2_menu_1p_column, D_020047DC, seg2_menu_2p_column, D_02004804, + seg2_menu_3p_column, D_0200482C, seg2_menu_4p_column, D_02004854, }; -MkTexture* D_800E824C[] = { - D_0200478C, - D_02004854, +MenuTexture* D_800E8254[] = { + seg2_game_select_texture, seg2_menu_1p_column, seg2_menu_2p_column, seg2_menu_3p_column, + seg2_menu_4p_column, D_0200487C, gTextureMenuLOption, seg2_textureMenuRData, }; -MkTexture* D_800E8254[] = { - D_02004660, D_02004688, D_020046D8, D_0200473C, D_0200478C, D_0200487C, D_020048A4, D_020048CC, +// CC textures +MenuTexture* D_800E8274[] = { + seg2_50_CC_texture, + seg2_100_CC_texture, + seg2_150_CC_texture, + seg2_extra_CC_texture, }; -MkTexture* D_800E8274[] = { - D_020048F4, D_0200491C, D_02004944, D_0200496C, D_020049BC, D_02004994, D_020049E4, D_02004A34, +// Versus and battle textures +MenuTexture* D_800E8284[] = { D_020049BC, seg2_menu_no_item_texture }; + +// Time trials begin and data textures +MenuTexture* D_800E828C[] = { + D_020049E4, + seg2_data_texture, +}; + +// Duplicates of the above 3 arrays +// CC textures +MenuTexture* D_800E8294[] = { + seg2_50_CC_texture, + seg2_100_CC_texture, + seg2_150_CC_texture, + seg2_extra_CC_texture, }; -MkTexture* D_800E8294[] = { - D_020048F4, D_0200491C, D_02004944, D_0200496C, D_020049BC, D_02004994, D_020049E4, D_02004A34, +// Versus and battle textures +MenuTexture* D_800E82A4[] = { D_020049BC, seg2_menu_no_item_texture }; + +// Time trials begin and data textures +MenuTexture* D_800E82AC[] = { + D_020049E4, + seg2_data_texture, }; -MkTexture* D_800E82B4[] = { - D_02004A5C, - D_02004A98, - D_02004AD4, - D_02004B10, +MenuTexture* gMenuTexturesBorderPlayer[] = { + seg2_P1_border_texture, + seg2_P2_border_texture, + seg2_P3_border_texture, + seg2_P4_border_texture, }; -MkTexture* D_800E82C4[] = { - D_02004B9C, D_02004BC4, D_02004BEC, D_02004C14, D_02004C3C, D_02004C64, - D_02004C8C, D_02004CF0, D_02004D54, D_02004DB8, D_02004E1C, D_02004E80, +MenuTexture* gMenuTexturesTrackSelection[] = { + seg2_menu_select_texture, seg2_mushroom_cup_texture, seg2_flower_cup_texture, + seg2_star_cup_texture, seg2_special_cup_texture, seg2_mario_raceway_preview_small_texture, + seg2_mushroom_cup_title_texture, seg2_flower_cup_title_texture, seg2_star_cup_title_texture, + seg2_special_cup_title_texture, seg2_battle_title_texture, D_02004E80, }; -MkTexture* D_800E82F4[] = { - D_02004BC4, D_02004BEC, D_02004C14, D_02004C3C, D_02004C64, D_02004C8C, - D_02004CF0, D_02004D54, D_02004DB8, D_02004E1C, D_02004E80, +MenuTexture* D_800E82F4[] = { + seg2_mushroom_cup_texture, + seg2_flower_cup_texture, + seg2_star_cup_texture, + seg2_special_cup_texture, + seg2_mario_raceway_preview_small_texture, + seg2_mushroom_cup_title_texture, + seg2_flower_cup_title_texture, + seg2_star_cup_title_texture, + seg2_special_cup_title_texture, + seg2_battle_title_texture, + D_02004E80, }; MkAnimation* D_800E8320[] = { @@ -942,11 +1095,12 @@ s32 D_800E84A0[] = { }; Vtx* D_800E84C0[] = { - &D_02007BB8[0], - &D_02007BB8[18], - &D_02007BB8[36], + D_02007BB8, + D_02007CD8, + D_02007DF8, }; +#ifndef AVOID_UB Gfx* D_800E84CC[] = { D_02007838, D_02007858, D_02007878, D_02007898, D_020078B8, D_020078D8, D_020078F8, D_02007918, }; @@ -958,12 +1112,15 @@ Gfx* D_800E84EC[] = { Gfx* D_800E850C[] = { D_02007A38, D_02007A58, D_02007A78, D_02007A98, D_02007AB8, D_02007AD8, D_02007AF8, D_02007B18, }; +#endif s8 D_800E852C = 1; -f32 D_800E8530 = 0.0f; +// Speed of the "motion" effect intro logo model +f32 sIntroModelMotionSpeed = 0.0f; -f32 D_800E8534 = 3.0f; +// Speed of the intro logo model +f32 sIntroModelSpeed = 3.0f; Unk_D_800E70A0 D_800E8538[] = { { 0x69, 0x9b, 0x00, 0x00 } }; @@ -1022,19 +1179,19 @@ f64 exponent_by_squaring(f64 base, s32 exponent) { return 1.0 / result; } -f64 func_800917B0(f64 arg0, f64 arg1) { +f64 menu_pow(f64 arg0, f64 arg1) { if ((arg1 <= 2147483647.0) && (-2147483647.0 <= arg1)) { if (arg1 == (s32) arg1) { return exponent_by_squaring(arg0, arg1); } } if (arg0 > 0.0) { - return func_8009195C(func_8009186C(arg0) * arg1); + return menu_exponential(menu_ln(arg0) * arg1); } return 0.0; } -f64 func_8009186C(f64 arg0) { +f64 menu_ln(f64 arg0) { s32 var_v0; s32 sp38; f64 var_f2; @@ -1044,8 +1201,8 @@ f64 func_8009186C(f64 arg0) { if (arg0 <= 0.0) { return 0.0; } - func_80091AC0(arg0 / 1.414213562373095, &sp38); - arg0 /= func_80091A6C(1.0, sp38); + normalize_to_unit_interval(arg0 / 1.414213562373095, &sp38); + arg0 /= menu_pow2(1.0, sp38); var_v0 = 1; arg0 = (arg0 - 1.0) / (arg0 + 1.0); temp_f12 = arg0 * arg0; @@ -1059,43 +1216,31 @@ f64 func_8009186C(f64 arg0) { return ((f64) sp38 * 0.6931471805599453) + (2 * var_f2); } -#ifdef NON_MATCHING -// https://decomp.me/scratch/dXpT5 -// Some math reordering issues on the continued fraction line -f64 func_8009195C(f64 arg0) { +f64 menu_exponential(f64 arg0) { s32 temp_f10; - s32 six = 6; - s32 ten = 10; - s32 fourteen = 14; - s32 eighteen = 18; f64 temp_f2; + f64 temp_f0; + s32 i; - if (arg0 >= 0.0) { - temp_f2 = 0.5; - } else { - temp_f2 = -0.5; - } - temp_f10 = temp_f2 + (arg0 / 0.6931471805599453); + temp_f10 = ((arg0 >= 0.0) ? 0.5 : -0.5) + (arg0 / 0.6931471805599453); arg0 -= (temp_f10 * 0.6931471805599453); - temp_f2 = arg0 * arg0; - /** - * This is the denominator part a tanh(x/2) continued fraction, where arg0 is x - * The best reference to this I can find is: - *https://math.stackexchange.com/questions/3241906/continued-fraction-02-6-10-14-22n-1-frace-1e1 - **/ - temp_f2 = - 2 + (temp_f2 / (six + (temp_f2 / (ten + (temp_f2 / (fourteen + (temp_f2 / (eighteen + (temp_f2 / 22))))))))); - return func_80091A6C((temp_f2 + arg0) / (temp_f2 - arg0), temp_f10); + temp_f2 = SQ(arg0); + + temp_f0 = temp_f2 / 22; + for (i = 0; i < 4; i++) { + temp_f0 = temp_f2 / ((18 - 4 * i) + temp_f0); + } + + temp_f2 = 2 + temp_f0; + + return menu_pow2((temp_f2 + arg0) / (temp_f2 - arg0), temp_f10); } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009195C.s") -#endif /** * This function appears to multiply some `value` * by 2 ^ `exponent`, even if that exponent is negative **/ -f64 func_80091A6C(f64 value, s32 exponent) { +f64 menu_pow2(f64 value, s32 exponent) { f64 base; if (exponent >= 0) { @@ -1124,7 +1269,7 @@ f64 func_80091A6C(f64 value, s32 exponent) { * arg2 appears to track the exponent in the power-of-2 * that would undo the changes to arg0 **/ -f64 func_80091AC0(f64 arg0, s32* arg2) { +f64 normalize_to_unit_interval(f64 arg0, s32* arg2) { const f64 const1 = 2.0; s32 exponent = 0; @@ -1157,9 +1302,9 @@ void func_80091B78(void) { if (D_800E852C) { D_800E852C = why; - D_8018EDF4 = 10; - D_8018EDF5 = 5; - D_8018EDF6 = 10; + gVersusResultCursorSelection = 10; + gTimeTrialsResultCursorSelection = 5; + gBattleResultCursorSelection = 10; if (osEepromProbe(&gSIEventMesgQueue) != 0) { load_save_data(); } @@ -1173,15 +1318,15 @@ void func_80091B78(void) { } gNextFreeMemoryAddress = gFreeMemoryResetAnchor; // Hypothetically, this should be a ptr... But only hypothetically. - D_8018D9B0 = get_next_available_memory_addr(0x000900B0); - D_8018D9B4 = (u8*) get_next_available_memory_addr(0x0000CE00); - D_8018D9B8 = (u8*) get_next_available_memory_addr(0x00012C00); - D_8018D9C0 = (struct_8018EE10_entry*) get_next_available_memory_addr(0x00001000); + gMenuTextureBuffer = get_next_available_memory_addr(0x000900B0); + gMenuCompressedBuffer = get_next_available_memory_addr(0x0000CE00); + sTKMK00_LowResBuffer = (u8*) get_next_available_memory_addr(SCREEN_WIDTH * SCREEN_HEIGHT); + gSomeDLBuffer = (struct_8018EE10_entry*) get_next_available_memory_addr(0x00001000); func_800AF9B0(); - D_8018EE0C = 0; + unref_8018EE0C = 0; for (i = 0; i < 5; i++) { - D_8018E7AC[i] = 0; + gTransitionType[i] = 0; } for (i = 0; i < 4; i++) { @@ -1192,8 +1337,8 @@ void func_80091B78(void) { D_800DC5EC->screenStartY = 120; D_800DC5EC->screenWidth = SCREEN_WIDTH; D_800DC5EC->screenHeight = SCREEN_HEIGHT; - D_800E86A4 = 1; - func_80094C60(); + gFadeModeSelection = FADE_MODE_MAIN; + setup_menus(); for (i = 0; i < 4; i++) { func_800C97C4((u8) i); @@ -1203,7 +1348,7 @@ void func_80091B78(void) { func_800C9D0C((u8) i); } - func_800B44BC(); + set_sound_mode(); osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON); } @@ -1253,7 +1398,7 @@ void func_80091EE4(void) { gControllerPak1State = BAD; tmp = func_800B5F30(); - if ((D_8018EDFB != 0) && (tmp == 0)) { + if ((gGhostPlayerInit != 0) && (tmp == 0)) { temp_s2 = (gCupSelection * 4) + gCourseIndexInCup; func_800B6708(); @@ -1261,7 +1406,7 @@ void func_80091EE4(void) { if ((D_8018EE10[temp_s0].ghostDataSaved != 0) && (temp_s2 == D_8018EE10[temp_s0].courseIndex)) { func_800B64EC(temp_s0); temp_s0 = 2; - D_8018EDFB = 0; + gGhostPlayerInit = 0; } } } @@ -1271,36 +1416,36 @@ void func_80091FA4(void) { s32 i; //! @todo These sizes need to be sizeof() for shiftability if possible - D_8018D9B4 = (u8*) get_next_available_memory_addr(0x00002800); - D_8018D9B0 = (u16*) get_next_available_memory_addr(0x000124F8); - D_8018D9B8 = (u8*) get_next_available_memory_addr(0x00001000); - D_8018D9BC = get_next_available_memory_addr(4); + gMenuCompressedBuffer = get_next_available_memory_addr(0x00002800); + gMenuTextureBuffer = (u16*) get_next_available_memory_addr(0x000124F8); + sTKMK00_LowResBuffer = (u8*) get_next_available_memory_addr(0x00001000); + sGPPointsCopy = get_next_available_memory_addr(4); for (i = 0; i < 5; i++) { - D_8018E7AC[i] = 0; + gTransitionType[i] = 0; } for (i = 0; i < 4; i++) { D_8018E838[i] = 0; } - func_80099110(); + clear_menu_textures(); func_8009A344(); - func_8009E620(); + clear_menus(); func_80092258(); - add_8018D9E0_entry(0x00000096, 0x00000064, 0x00000024, 1); - add_8018D9E0_entry(0x00000097, 0x00000064, 0x000000DD, 1); - add_8018D9E0_entry(0x00000098, 0, 0, 0); - add_8018D9E0_entry(0x000000C7, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_096, 0x00000064, 0x00000024, MENU_ITEM_PRIORITY_1); + add_menu_item(MENU_ITEM_TYPE_097, 0x00000064, 0x000000DD, MENU_ITEM_PRIORITY_1); + add_menu_item(MENU_ITEM_TYPE_098, 0, 0, MENU_ITEM_PRIORITY_0); + add_menu_item(MENU_ITEM_PAUSE, 0, 0, MENU_ITEM_PRIORITY_0); if (gModeSelection == TIME_TRIALS) { - add_8018D9E0_entry(0x000000BE, 0, 0, 0); - add_8018D9E0_entry(0x0000010E, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0BE, 0, 0, MENU_ITEM_PRIORITY_0); + add_menu_item(MENU_ITEM_TYPE_10E, 0, 0, MENU_ITEM_PRIORITY_0); } if ((D_8015F890 != 0) && (gModeSelection == TIME_TRIALS)) { - add_8018D9E0_entry(0x000000BD, 0, 0, 0); + add_menu_item(MENU_ITEM_END_COURSE_OPTION, 0, 0, MENU_ITEM_PRIORITY_0); } - if (!(gControllerBits & 1) && (D_8018EE08 != 0)) { - add_8018D9E0_entry(4, 0, 0, 2); + if (!(gControllerBits & 1) && (gDemoUseController != 0)) { + add_menu_item(MENU_ITEM_UI_NO_CONTROLLER, 0, 0, MENU_ITEM_PRIORITY_2); } func_800B5F30(); } @@ -1328,7 +1473,7 @@ void func_800921B4(void) { // if selected and detect kind menu void text_rainbow_effect(s32 test, s32 target, s32 alternative_color) { if (test == target) { - if (func_800B4520() != 0) { + if (is_screen_being_faded() != 0) { set_text_color(gGlobalTimer % 3); } else { set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); @@ -1363,7 +1508,7 @@ void func_80092290(s32 arg0, s32* arg1, s32* arg2) { s32 temp_t7; s32 temp_t8_2; s32 temp_t9; - s32 temp_t0; + UNUSED s32 temp_t0; s32 a, b, c, d; Vtx* vtx; @@ -1411,148 +1556,148 @@ void func_80092500(void) { switch (gModeSelection) { case GRAND_PRIX: - add_8018D9E0_entry(0xAA, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0AA, 0, 0, MENU_ITEM_PRIORITY_0); break; case TIME_TRIALS: - add_8018D9E0_entry(0xB9, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0B9, 0, 0, MENU_ITEM_PRIORITY_0); break; } } void func_80092564(void) { - add_8018D9E0_entry(0xAC, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0AC, 0, 0, MENU_ITEM_PRIORITY_0); func_8005D18C(); func_8001968C(); } void func_800925A0(void) { - add_8018D9E0_entry(0xAF, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0AF, 0, 0, MENU_ITEM_PRIORITY_0); } void func_800925CC(void) { - struct_8018D9E0_entry* temp = find_8018D9E0_entry_dupe(0xAF); - if (temp->cursor == 2) { - temp->cursor = 3; + MenuItem* temp = find_menu_items_dupe(MENU_ITEM_TYPE_0AF); + if (temp->state == 2) { + temp->state = 3; } } void func_80092604(void) { - add_8018D9E0_entry(0xB0, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0B0, 0, 0, MENU_ITEM_PRIORITY_0); } void func_80092630(void) { - add_8018D9E0_entry(0xBC, 0, 0, 0); + add_menu_item(MENU_ITEM_ANNOUNCE_GHOST, 0, 0, MENU_ITEM_PRIORITY_0); } void func_8009265C(void) { - add_8018D9E0_entry(0x12B, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_12B, 0, 0, MENU_ITEM_PRIORITY_2); } void func_80092688(void) { switch (D_800DC5E4) { case 0: - add_8018D9E0_entry(0x1CE, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1CE, 0, 0, MENU_ITEM_PRIORITY_2); return; default: - add_8018D9E0_entry(0x190, 0, 0, 2); - add_8018D9E0_entry(0x191, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_190, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_191, 0, 0, MENU_ITEM_PRIORITY_2); return; case 2: - add_8018D9E0_entry(0x192, 0, 0, 2); - add_8018D9E0_entry(0x193, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_192, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_193, 0, 0, MENU_ITEM_PRIORITY_2); return; case 3: - add_8018D9E0_entry(0x194, 0, 0, 2); - add_8018D9E0_entry(0x195, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_194, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_195, 0, 0, MENU_ITEM_PRIORITY_2); return; case 4: - add_8018D9E0_entry(0x196, 0, 0, 2); - add_8018D9E0_entry(0x197, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_196, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_197, 0, 0, MENU_ITEM_PRIORITY_2); return; case 5: - add_8018D9E0_entry(0x198, 0, 0, 2); - add_8018D9E0_entry(0x199, 0, 0, 2); - add_8018D9E0_entry(0x19A, 0, 0, 2); - add_8018D9E0_entry(0x19B, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_198, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_199, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_19A, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_19B, 0, 0, MENU_ITEM_PRIORITY_2); return; case 6: - add_8018D9E0_entry(0x198, 0, 0, 2); - add_8018D9E0_entry(0x19C, 0, 0, 2); - add_8018D9E0_entry(0x19D, 0, 0, 2); - add_8018D9E0_entry(0x19E, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_198, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_19C, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_19D, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_19E, 0, 0, MENU_ITEM_PRIORITY_2); return; case 7: - add_8018D9E0_entry(0x19F, 0, 0, 2); - add_8018D9E0_entry(0x1A0, 0, 0, 2); - add_8018D9E0_entry(0x1A1, 0, 0, 2); - add_8018D9E0_entry(0x1A2, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_19F, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A0, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A1, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A2, 0, 0, MENU_ITEM_PRIORITY_2); return; case 8: - add_8018D9E0_entry(0x1A3, 0, 0, 2); - add_8018D9E0_entry(0x1A4, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1A3, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A4, 0, 0, MENU_ITEM_PRIORITY_2); return; case 9: - add_8018D9E0_entry(0x1A5, 0, 0, 2); - add_8018D9E0_entry(0x1A6, 0, 0, 2); - add_8018D9E0_entry(0x1A7, 0, 0, 2); - add_8018D9E0_entry(0x1A8, 0, 0, 2); - add_8018D9E0_entry(0x1A9, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1A5, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A6, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A7, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A8, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A9, 0, 0, MENU_ITEM_PRIORITY_2); return; case 10: - add_8018D9E0_entry(0x1A5, 0, 0, 2); - add_8018D9E0_entry(0x1A6, 0, 0, 2); - add_8018D9E0_entry(0x1AA, 0, 0, 2); - add_8018D9E0_entry(0x1AB, 0, 0, 2); - add_8018D9E0_entry(0x1AC, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1A5, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1A6, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1AA, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1AB, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1AC, 0, 0, MENU_ITEM_PRIORITY_2); return; case 11: - add_8018D9E0_entry(0x1AD, 0, 0, 2); - add_8018D9E0_entry(0x1AE, 0, 0, 2); - add_8018D9E0_entry(0x1AF, 0, 0, 2); - add_8018D9E0_entry(0x1B0, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1AD, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1AE, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1AF, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B0, 0, 0, MENU_ITEM_PRIORITY_2); return; case 12: - add_8018D9E0_entry(0x1B1, 0, 0, 2); - add_8018D9E0_entry(0x1B2, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1B1, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B2, 0, 0, MENU_ITEM_PRIORITY_2); return; case 13: - add_8018D9E0_entry(0x1B3, 0, 0, 2); - add_8018D9E0_entry(0x1B4, 0, 0, 2); - add_8018D9E0_entry(0x1B5, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1B3, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B4, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B5, 0, 0, MENU_ITEM_PRIORITY_2); return; case 14: - add_8018D9E0_entry(0x1B6, 0, 0, 2); - add_8018D9E0_entry(0x1B7, 0, 0, 2); - add_8018D9E0_entry(0x1B8, 0, 0, 2); - add_8018D9E0_entry(0x1B9, 0, 0, 2); - add_8018D9E0_entry(0x1BA, 0, 0, 2); - add_8018D9E0_entry(0x1BB, 0, 0, 2); - add_8018D9E0_entry(0x1BC, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1B6, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B7, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B8, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1B9, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1BA, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1BB, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1BC, 0, 0, MENU_ITEM_PRIORITY_2); return; case 15: - add_8018D9E0_entry(0x1BD, 0, 0, 2); - add_8018D9E0_entry(0x1BE, 0, 0, 2); - add_8018D9E0_entry(0x1BF, 0, 0, 2); - add_8018D9E0_entry(0x1C0, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1BD, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1BE, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1BF, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C0, 0, 0, MENU_ITEM_PRIORITY_2); return; case 16: - add_8018D9E0_entry(0x1C1, 0, 0, 2); - add_8018D9E0_entry(0x1C2, 0, 0, 2); - add_8018D9E0_entry(0x1C3, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1C1, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C2, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C3, 0, 0, MENU_ITEM_PRIORITY_2); return; case 17: - add_8018D9E0_entry(0x1C4, 0, 0, 2); - add_8018D9E0_entry(0x1C5, 0, 0, 2); - add_8018D9E0_entry(0x1C6, 0, 0, 2); - add_8018D9E0_entry(0x1C7, 0, 0, 2); - add_8018D9E0_entry(0x1C8, 0, 0, 2); - add_8018D9E0_entry(0x1C9, 0, 0, 2); - add_8018D9E0_entry(0x1CA, 0, 0, 2); - add_8018D9E0_entry(0x1CB, 0, 0, 2); - add_8018D9E0_entry(0x1CC, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1C4, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C5, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C6, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C7, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C8, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1C9, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1CA, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1CB, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_1CC, 0, 0, MENU_ITEM_PRIORITY_2); return; case 18: - add_8018D9E0_entry(0x1CD, 0, 0, 2); + add_menu_item(MENU_ITEM_TYPE_1CD, 0, 0, MENU_ITEM_PRIORITY_2); return; } } @@ -1565,76 +1710,76 @@ void func_80092C80(void) { // Some kind of lookup function, seems to return an index to be used // to get a character's width in pixels s32 char_to_glyph_index(char* character) { - s32 var_v1; + s32 index; s8 temp_v0; temp_v0 = *character; - var_v1 = 1; + index = 1; if ((temp_v0 >= 'a') && (temp_v0 <= 'z')) { - var_v1 = temp_v0 - 0x61; + index = temp_v0 - 0x61; } else if ((temp_v0 >= 'A') && (temp_v0 <= 'Z')) { - var_v1 = temp_v0 - 0x41; + index = temp_v0 - 0x41; } else if ((temp_v0 >= '0') && (temp_v0 <= '9')) { - var_v1 = temp_v0 - 0x10; + index = temp_v0 - 0x10; } else if (temp_v0 == ' ') { - var_v1 = -1; + index = -1; } else if (temp_v0 < 0) { // Handling EUC-JUP characters switch (temp_v0) { /* irregular */ case -92: // 0xA4 - var_v1 = func_80092E1C(character + 1); + index = func_80092E1C(character + 1); break; case -91: // 0xA5 - var_v1 = func_80092DF8(character + 1); + index = func_80092DF8(character + 1); break; case -95: // 0xA1 case -93: // 0xA3 case -85: // 0xAB - var_v1 = func_80092EE4(character); + index = func_80092EE4(character); break; } } else { switch (temp_v0) { case '!': - var_v1 = 0x0000001A; + index = 0x0000001A; break; case '-': - var_v1 = 0x0000001B; + index = 0x0000001B; break; case '?': - var_v1 = 0x0000001C; + index = 0x0000001C; break; case '\'': - var_v1 = 0x0000001D; + index = 0x0000001D; break; case '$': - var_v1 = 0x0000001E; + index = 0x0000001E; break; case '.': - var_v1 = 0x0000001F; + index = 0x0000001F; break; case '\"': - var_v1 = 0x0000002A; + index = 0x0000002A; break; case '*': - var_v1 = 0x0000002B; + index = 0x0000002B; break; case '+': - var_v1 = 0x0000002C; + index = 0x0000002C; break; // Displayed as "cc" case '(': - var_v1 = 0x0000002D; + index = 0x0000002D; break; case ',': - var_v1 = 0x0000002E; + index = 0x0000002E; break; default: - var_v1 = -2; + index = -2; break; } } - return var_v1; + return index; } s32 func_80092DF8(char* arg) { @@ -1682,40 +1827,40 @@ s32 func_80092EE4(char* character) { temp_t6 = (character[1] + 0x80); var_v1 = 2; - switch (character[0]) { /* switch 3; irregular */ - case -95: /* switch 3 */ - switch (temp_t6) { /* switch 1 */ - case 0x22: /* switch 1 */ - case 0x24: /* switch 1 */ + switch (character[0]) { + case -95: + switch (temp_t6) { + case 0x22: + case 0x24: var_v1 = 0x000000EA; break; - case 0x23: /* switch 1 */ + case 0x23: var_v1 = 0x000000E9; break; - case 0x25: /* switch 1 */ + case 0x25: var_v1 = 0x000000D0; break; - case 0x2A: /* switch 1 */ + case 0x2A: var_v1 = 0x000000E8; break; - case 0x30: /* switch 1 */ + case 0x30: var_v1 = 0x000000EB; break; - case 0x47: /* switch 1 */ + case 0x47: var_v1 = 0x000000D1; break; - case 0x49: /* switch 1 */ + case 0x49: var_v1 = 0x000000D2; break; - case 0x5C: /* switch 1 */ + case 0x5C: var_v1 = 0x000000D3; break; - case 0x3C: /* switch 1 */ - case 0x3D: /* switch 1 */ - case 0x5D: /* switch 1 */ + case 0x3C: + case 0x3D: + case 0x5D: var_v1 = 0x000000D4; break; - default: /* switch 1 */ + default: break; } break; @@ -1802,7 +1947,7 @@ void set_text_color(s32 arg0) { UNUSED void func_800930E4(s32 arg0, s32 arg1, char* arg2) { set_text_color(TEXT_BLUE); - func_80093324(arg0, arg1, arg2, 0, 1.0, 1.0); + print_text_mode_1(arg0, arg1, arg2, 0, 1.0, 1.0); } // "tracking" is a uniform spacing between all characters in a given word @@ -1815,10 +1960,10 @@ void print_text0(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 do { glyphIndex = char_to_glyph_index(text); if (glyphIndex >= 0) { - func_80099184((MkTexture*) segmented_to_virtual_dupe((const void*) gGlyphTextureLUT[glyphIndex])); + load_menu_img((MenuTexture*) segmented_to_virtual_dupe((const void*) gGlyphTextureLUT[glyphIndex])); gDisplayListHead = print_letter(gDisplayListHead, - (MkTexture*) segmented_to_virtual_dupe((const void*) gGlyphTextureLUT[glyphIndex]), + (MenuTexture*) segmented_to_virtual_dupe((const void*) gGlyphTextureLUT[glyphIndex]), column + (stringWidth * scaleX), row, mode, scaleX, scaleY); stringWidth += gGlyphDisplayWidth[glyphIndex] + tracking; } else if ((glyphIndex != -2) && (glyphIndex == -1)) { @@ -1837,11 +1982,11 @@ void print_text0(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 gSPDisplayList(gDisplayListHead++, D_020077D8); } -void func_80093324(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { +void print_text_mode_1(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { print_text0(column, row, text, tracking, scaleX, scaleY, 1); } -void func_80093358(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { +void print_text_mode_2(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { print_text0(column, row, text, tracking, scaleX, scaleY, 2); } @@ -1869,15 +2014,15 @@ void print_text1(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 } switch (arg6) { - case 1: + case LEFT_TEXT: // ??? do { } while (0); - case 3: + case RIGHT_TEXT: column -= stringWidth; break; - case 2: - case 4: + case CENTER_TEXT_MODE_1: + case CENTER_TEXT_MODE_2: column -= stringWidth / 2; break; default: @@ -1894,7 +2039,7 @@ void print_text1(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 while (*text != 0) { glyphIndex = char_to_glyph_index(text); if (glyphIndex >= 0) { - func_80099184(segmented_to_virtual_dupe(gGlyphTextureLUT[glyphIndex])); + load_menu_img(segmented_to_virtual_dupe(gGlyphTextureLUT[glyphIndex])); gDisplayListHead = print_letter(gDisplayListHead, segmented_to_virtual_dupe(gGlyphTextureLUT[glyphIndex]), column, row, sp60, scaleX, scaleY); column = column + (s32) ((gGlyphDisplayWidth[glyphIndex] + tracking) * scaleX); @@ -1913,24 +2058,24 @@ void print_text1(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 gSPDisplayList(gDisplayListHead++, D_020077D8); } -void func_800936B8(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { - print_text1(column, row, text, tracking, scaleX, scaleY, 1); +void print_text1_left(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { + print_text1(column, row, text, tracking, scaleX, scaleY, LEFT_TEXT); } -void draw_text(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { - print_text1(column, row, text, tracking, scaleX, scaleY, 2); +void print_text1_center_mode_1(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { + print_text1(column, row, text, tracking, scaleX, scaleY, CENTER_TEXT_MODE_1); } -void func_80093720(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { - print_text1(column, row, text, tracking, scaleX, scaleY, 3); +void print_text1_right(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { + print_text1(column, row, text, tracking, scaleX, scaleY, RIGHT_TEXT); } -void func_80093754(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { - print_text1(column, row, text, tracking, scaleX, scaleY, 4); +void print_text1_center_mode_2(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY) { + print_text1(column, row, text, tracking, scaleX, scaleY, CENTER_TEXT_MODE_2); } void print_text2(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 scaleY, s32 arg6) { - MkTexture* glyphTexture; + MenuTexture* glyphTexture; s32 characterWidth; s32 glyphIndex; @@ -1939,8 +2084,8 @@ void print_text2(s32 column, s32 row, char* text, s32 tracking, f32 scaleX, f32 do { glyphIndex = char_to_glyph_index(text); if (glyphIndex >= 0) { - glyphTexture = (MkTexture*) segmented_to_virtual_dupe((const void*) gGlyphTextureLUT[glyphIndex]); - func_80099184(glyphTexture); + glyphTexture = (MenuTexture*) segmented_to_virtual_dupe((const void*) gGlyphTextureLUT[glyphIndex]); + load_menu_img(glyphTexture); gDisplayListHead = print_letter(gDisplayListHead, glyphTexture, column - (gGlyphDisplayWidth[glyphIndex] / 2), row, arg6, scaleX, scaleY); @@ -2061,7 +2206,7 @@ void func_80093C98(s32 arg0) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPDisplayList(gDisplayListHead++, D_02007F18); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - func_800A8250(); + handle_menus_special(); if (arg0 == 0) { func_800A54EC(); func_8009CA6C(4); @@ -2081,22 +2226,22 @@ void func_80093E40(void) { void func_80093E60(void) { s32 i; - D_8018D9B4 = get_next_available_memory_addr(0x00002800); - D_8018D9B0 = (u16*) get_next_available_memory_addr(0x000124F8); - D_8018D9B8 = get_next_available_memory_addr(0x00001000); - D_8018D9BC = get_next_available_memory_addr(4U); + gMenuCompressedBuffer = get_next_available_memory_addr(0x00002800); + gMenuTextureBuffer = (u16*) get_next_available_memory_addr(0x000124F8); + sTKMK00_LowResBuffer = get_next_available_memory_addr(0x00001000); + sGPPointsCopy = get_next_available_memory_addr(4U); for (i = 0; i < 5; i++) { - D_8018E7AC[i] = 0; + gTransitionType[i] = 0; } for (i = 0; i < 4; i++) { D_8018E838[i] = 0; } - func_80099110(); + clear_menu_textures(); func_8009A344(); - func_8009E620(); + clear_menus(); func_80092258(); D_8018ED91 = 0; } @@ -2113,7 +2258,7 @@ void func_80093F10(void) { func_8009C918(); func_80099A70(); func_80099E54(); - func_800A8230(); + handle_menus_default(); func_80099AEC(); func_80099EC4(); func_8009CA2C(); @@ -2133,7 +2278,7 @@ void func_800940EC(s32 arg0) { func_80092148(); func_80099A70(); func_80099E54(); - func_800A8230(); + handle_menus_default(); func_80099AEC(); func_80099EC4(); func_8009CA6C(arg0); @@ -2149,9 +2294,9 @@ void func_800942D0(void) { test = &gGfxPool->mtxObject[0]; gSPMatrix(gDisplayListHead++, &gGfxPool->mtxScreen, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, &gGfxPool->mtxLookAt[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - guRotate(test, D_8018EDC8, 1.0f, 0.0f, 0.0f); - guRotate(test + 1, D_8018EDCC, 0.0f, 1.0f, 0.0f); - guScale(test + 2, 1.0f, 1.0f, D_8018EDC4); + guRotate(test, gIntroModelRotX, 1.0f, 0.0f, 0.0f); + guRotate(test + 1, gIntroModelRotY, 0.0f, 1.0f, 0.0f); + guScale(test + 2, 1.0f, 1.0f, gIntroModelScale); gSPMatrix(gDisplayListHead++, test++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gDisplayListHead++, test++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gDisplayListHead++, test++, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); @@ -2159,14 +2304,14 @@ void func_800942D0(void) { gDPSetEnvColor(gDisplayListHead++, 0x00, 0x00, 0x00, 0x00); gSPDisplayList(gDisplayListHead++, D_02007F60); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); - if (D_800E8530 > 0) { - var_f26 = D_800E8534; + if (sIntroModelMotionSpeed > 0) { + var_f26 = sIntroModelSpeed; if (var_f26 > 10.0f) { var_f26 = 10.0f; } for (var_s2 = 0, thing = 0xC0; var_s2 < 0xC; var_s2++, thing -= 0x10) { guRotate(test, 0.0f, 1.0f, 0.0f, 0.0f); - guRotate(test + 1, (var_s2 + 1) * D_800E8530 * var_f26, 0.0f, 1.0f, 0.0f); + guRotate(test + 1, (var_s2 + 1) * sIntroModelMotionSpeed * var_f26, 0.0f, 1.0f, 0.0f); guScale(test + 2, 1.0f, 1.0f, 2.0f); gSPMatrix(gDisplayListHead++, test++, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gDisplayListHead++, test++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); @@ -2185,24 +2330,24 @@ void func_80094660(struct GfxPool* arg0, UNUSED s32 arg1) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); guPerspective(&arg0->mtxScreen, &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - guLookAt(&arg0->mtxLookAt[0], 0.0f, 0.0f, (f32) D_8018EDC0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + guLookAt(&arg0->mtxLookAt[0], 0.0f, 0.0f, (f32) gIntroModelZEye, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); func_800942D0(); gDPPipeSync(gDisplayListHead++); gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE); gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); } -void func_800947B4(struct GfxPool* arg0, UNUSED s32 arg1) { +void render_checkered_flag(struct GfxPool* arg0, UNUSED s32 arg1) { u16 perspNorm; move_segment_table_to_dmem(); guPerspective(&arg0->mtxPersp[0], &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - guLookAt(&arg0->mtxLookAt[1], 0.0f, 0.0f, (f32) D_8018EDC0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); - guRotate(&arg0->mtxObject[0], D_8018EDC8, 1.0f, 0, 0); - guRotate(&arg0->mtxObject[1], D_8018EDCC, 0, 1.0f, 0); - guRotate(&arg0->mtxObject[2], D_8018EDD0, 0, 0, 1.0f); - guScale(&arg0->mtxObject[3], D_8018EDC4, D_8018EDC4, D_8018EDC4); - guTranslate(&arg0->mtxObject[4], D_8018EDD4, D_8018EDD8, D_8018EDDC); + guLookAt(&arg0->mtxLookAt[1], 0.0f, 0.0f, (f32) gIntroModelZEye, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + guRotate(&arg0->mtxObject[0], gIntroModelRotX, 1.0f, 0, 0); + guRotate(&arg0->mtxObject[1], gIntroModelRotY, 0, 1.0f, 0); + guRotate(&arg0->mtxObject[2], gIntroModelRotZ, 0, 0, 1.0f); + guScale(&arg0->mtxObject[3], gIntroModelScale, gIntroModelScale, gIntroModelScale); + guTranslate(&arg0->mtxObject[4], gIntroModelPosX, gIntroModelPosY, gIntroModelPosZ); gSPMatrix(gDisplayListHead++, &arg0->mtxPersp[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, &arg0->mtxLookAt[1], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gDisplayListHead++, &arg0->mtxObject[0], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); @@ -2223,7 +2368,7 @@ void func_80094A64(struct GfxPool* pool) { guOrtho(&pool->mtxScreen, 0.0f, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0.0f, -100.0f, 100.0f, 1.0f); gSPMatrix(gDisplayListHead++, &pool->mtxScreen, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPDisplayList(gDisplayListHead++, D_02007650); - func_80094C60(); + setup_menus(); func_80092290(4, D_8018E850, D_8018E858); func_80092290(5, &D_8018E850[1], &D_8018E858[1]); func_80099A70(); @@ -2239,9 +2384,9 @@ void func_80094A64(struct GfxPool* pool) { case LOGO_INTRO_MENU: case CONTROLLER_PAK_MENU: case MAIN_MENU: - case PLAYER_SELECT_MENU: + case CHARACTER_SELECT_MENU: case COURSE_SELECT_MENU: - func_800A8230(); + handle_menus_default(); func_80099AEC(); break; } @@ -2251,145 +2396,145 @@ void func_80094A64(struct GfxPool* pool) { gSPDisplayList(gDisplayListHead++, D_020076B0); } -void func_80094C60(void) { - if (D_800E86A4 != 0) { - func_80099110(); +void setup_menus(void) { + if (gFadeModeSelection != FADE_MODE_NONE) { + clear_menu_textures(); func_8009A344(); - func_8009E620(); + clear_menus(); func_8009B938(); func_80092258(); func_800B5F30(); func_800B6014(); - func_800B3F74(gMenuSelection); + load_menu_states(gMenuSelection); switch (gMenuSelection) { case OPTIONS_MENU: - add_8018D9E0_entry(0x00000023, 0, 0, 2); - add_8018D9E0_entry(0x000000F1, 0, 0, 4); - add_8018D9E0_entry(0x000000F0, 0, 0, 2); + add_menu_item(MAIN_MENU_BACKGROUND, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_0F1, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(MENU_ITEM_TYPE_0F0, 0, 0, MENU_ITEM_PRIORITY_2); break; case DATA_MENU: - add_8018D9E0_entry(0x00000023, 0, 0, 2); - add_8018D9E0_entry(0x0000008C, 0, 0, 6); - add_8018D9E0_entry(0x0000007C, 0, 0, 6); - add_8018D9E0_entry(0x0000007D, 0, 0, 6); - add_8018D9E0_entry(0x0000007E, 0, 0, 6); - add_8018D9E0_entry(0x0000007F, 0, 0, 6); - add_8018D9E0_entry(0x00000080, 0, 0, 6); - add_8018D9E0_entry(0x00000081, 0, 0, 6); - add_8018D9E0_entry(0x00000082, 0, 0, 6); - add_8018D9E0_entry(0x00000083, 0, 0, 6); - add_8018D9E0_entry(0x00000084, 0, 0, 6); - add_8018D9E0_entry(0x00000085, 0, 0, 6); - add_8018D9E0_entry(0x00000086, 0, 0, 6); - add_8018D9E0_entry(0x00000087, 0, 0, 6); - add_8018D9E0_entry(0x00000088, 0, 0, 6); - add_8018D9E0_entry(0x00000089, 0, 0, 6); - add_8018D9E0_entry(0x0000008A, 0, 0, 6); - add_8018D9E0_entry(0x0000008B, 0, 0, 6); - add_8018D9E0_entry(0x0000008D, 0, 0, 8); + add_menu_item(MAIN_MENU_BACKGROUND, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_TYPE_08C, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_07C, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_07D, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_07E, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_07F, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_080, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_081, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_082, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_083, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_084, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_085, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_086, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_087, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_088, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_089, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_08A, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_08B, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_08D, 0, 0, MENU_ITEM_PRIORITY_8); break; case COURSE_DATA_MENU: - add_8018D9E0_entry(0x000000E6, 0, 0, 8); - add_8018D9E0_entry(0x000000E7, 0, 0, 8); - add_8018D9E0_entry(0x000000E8, 0, 0, 8); - add_8018D9E0_entry(0x000000E9, 0, 0, 8); - add_8018D9E0_entry(0x000000EA, 0, 0, 8); + add_menu_item(MENU_ITEM_DATA_COURSE_IMAGE, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_DATA_COURSE_INFO, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_DATA_COURSE_SELECTABLE, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_TYPE_0E9, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_TYPE_0EA, 0, 0, MENU_ITEM_PRIORITY_8); break; case LOGO_INTRO_MENU: - add_8018D9E0_entry(0x000000FA, 0, 0, 0); + add_menu_item(MENU_ITEM_UI_LOGO_INTRO, 0, 0, MENU_ITEM_PRIORITY_0); break; case CONTROLLER_PAK_MENU: - add_8018D9E0_entry(0x000000DA, 0, 0, 0); - add_8018D9E0_entry(0x000000D2, 0, 0, 4); - add_8018D9E0_entry(0x000000D4, 0, 0, 6); - add_8018D9E0_entry(0x000000D3, 0, 0, 8); - add_8018D9E0_entry(0x000000D5, 0, 0, 0x0A); - add_8018D9E0_entry(0x000000D6, 0, 0, 0x0A); - add_8018D9E0_entry(0x000000D7, 0, 0, 0x0A); - add_8018D9E0_entry(0x000000D8, 0, 0, 0x0A); - add_8018D9E0_entry(0x000000D9, 0, 0, 0x0A); + add_menu_item(MENU_ITEM_TYPE_0DA, 0, 0, MENU_ITEM_PRIORITY_0); + add_menu_item(MENU_ITEM_TYPE_0D2, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(MENU_ITEM_TYPE_0D4, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_0D3, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_TYPE_0D5, 0, 0, MENU_ITEM_PRIORITY_A); + add_menu_item(MENU_ITEM_TYPE_0D6, 0, 0, MENU_ITEM_PRIORITY_A); + add_menu_item(MENU_ITEM_TYPE_0D7, 0, 0, MENU_ITEM_PRIORITY_A); + add_menu_item(MENU_ITEM_TYPE_0D8, 0, 0, MENU_ITEM_PRIORITY_A); + add_menu_item(MENU_ITEM_TYPE_0D9, 0, 0, MENU_ITEM_PRIORITY_A); break; case START_MENU: - add_8018D9E0_entry(2, 0, 0, 4); - add_8018D9E0_entry(1, 0, 0, 0); - add_8018D9E0_entry(0x000000FB, 0, 0, 0); + add_menu_item(MENU_ITEM_UI_LOGO_AND_COPYRIGHT, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(MENU_ITEM_UI_START_BACKGROUND, 0, 0, MENU_ITEM_PRIORITY_0); + add_menu_item(START_MENU_FLAG, 0, 0, MENU_ITEM_PRIORITY_0); if (gControllerBits & 1) { - add_8018D9E0_entry(3, 0, 0, 2); + add_menu_item(MENU_ITEM_UI_PUSH_START_BUTTON, 0, 0, MENU_ITEM_PRIORITY_2); } else { - add_8018D9E0_entry(4, 0, 0, 2); + add_menu_item(MENU_ITEM_UI_NO_CONTROLLER, 0, 0, MENU_ITEM_PRIORITY_2); } - add_8018D9E0_entry(5, 0, 0, 6); + add_menu_item(MENU_ITEM_UI_START_RECORD_TIME, 0, 0, MENU_ITEM_PRIORITY_6); gDemoMode = 0; - D_8018EE08 = 0; + gDemoUseController = 0; break; case MAIN_MENU: - add_8018D9E0_entry(0x00000023, 0, 0, 2); - add_8018D9E0_entry(0x0000000A, 0x0000015E, 0x00000011, 6); - add_8018D9E0_entry(0x0000000E, 0x0000015E, 0x0000003E, 6); - add_8018D9E0_entry(0x0000000D, 0x0000015E, 0x0000003E, 6); - add_8018D9E0_entry(0x0000000C, 0x0000015E, 0x0000003E, 6); - add_8018D9E0_entry(0x0000000B, 0x0000015E, 0x0000003E, 6); - add_8018D9E0_entry(0x0000000F, 0x0000015E, 0x000000C8, 6); - add_8018D9E0_entry(0x00000011, 0x0000015E, 0x000000C8, 6); - add_8018D9E0_entry(0x00000010, 0x0000015E, 0x000000C8, 6); - if (func_800B555C() != 0) { - add_8018D9E0_entry(0x00000015, 0, 0, 6); - } - add_8018D9E0_entry(0x00000014, 0, 0, 6); - add_8018D9E0_entry(0x00000013, 0, 0, 6); - add_8018D9E0_entry(0x00000012, 0, 0, 6); - add_8018D9E0_entry(0x00000019, 0, 0, 6); - add_8018D9E0_entry(0x00000018, 0, 0, 6); - add_8018D9E0_entry(0x0000001B, 0, 0, 0x0C); - break; - case PLAYER_SELECT_MENU: - add_8018D9E0_entry(0x00000024, 0, 0, 2); - add_8018D9E0_entry(0x0000002A, 0, 0, 6); - add_8018D9E0_entry(0x00000033, 0, 0, 6); - add_8018D9E0_entry(0x0000002B, 0, 0, 8); - add_8018D9E0_entry(0x0000002C, 0, 0, 8); - add_8018D9E0_entry(0x0000002D, 0, 0, 6); - add_8018D9E0_entry(0x0000002E, 0, 0, 6); - add_8018D9E0_entry(0x0000002F, 0, 0, 6); - add_8018D9E0_entry(0x00000030, 0, 0, 6); - add_8018D9E0_entry(0x00000031, 0, 0, 6); - add_8018D9E0_entry(0x00000032, 0, 0, 8); - add_8018D9E0_entry(0x00000034, 0, 0, 0x0C); - add_8018D9E0_entry(0x00000035, 0, 0, 0x0C); - add_8018D9E0_entry(0x00000036, 0, 0, 0x0C); - add_8018D9E0_entry(0x00000037, 0, 0, 0x0C); + add_menu_item(MAIN_MENU_BACKGROUND, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(MENU_ITEM_UI_GAME_SELECT, 0x0000015E, 0x00000011, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_UI_4P_GAME, 0x0000015E, 0x0000003E, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_UI_3P_GAME, 0x0000015E, 0x0000003E, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_UI_2P_GAME, 0x0000015E, 0x0000003E, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_UI_1P_GAME, 0x0000015E, 0x0000003E, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_UI_OK, 0x0000015E, 0x000000C8, MENU_ITEM_PRIORITY_6); + add_menu_item(MAIN_MENU_DATA_GFX, 0x0000015E, 0x000000C8, MENU_ITEM_PRIORITY_6); + add_menu_item(MAIN_MENU_OPTION_GFX, 0x0000015E, 0x000000C8, MENU_ITEM_PRIORITY_6); + if (has_unlocked_extra_mode() != 0) { + add_menu_item(MAIN_MENU_EXTRA_CC, 0, 0, MENU_ITEM_PRIORITY_6); + } + add_menu_item(MAIN_MENU_150CC, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MAIN_MENU_100CC, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MAIN_MENU_50CC, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MAIN_MENU_TIME_TRIALS_DATA, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MAIN_MENU_TIME_TRIALS_BEGIN, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_01B, 0, 0, MENU_ITEM_PRIORITY_C); + break; + case CHARACTER_SELECT_MENU: + add_menu_item(CHARACTER_SELECT_BACKGROUND, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(CHARACTER_SELECT_MENU_PLAYER_SELECT_BANNER, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_OK, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_MARIO, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(CHARACTER_SELECT_MENU_LUIGI, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(CHARACTER_SELECT_MENU_TOAD, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_PEACH, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_YOSHI, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_DK, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_WARIO, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(CHARACTER_SELECT_MENU_BOWSER, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(CHARACTER_SELECT_MENU_1P_CURSOR, 0, 0, MENU_ITEM_PRIORITY_C); + add_menu_item(CHARACTER_SELECT_MENU_2P_CURSOR, 0, 0, MENU_ITEM_PRIORITY_C); + add_menu_item(CHARACTER_SELECT_MENU_3P_CURSOR, 0, 0, MENU_ITEM_PRIORITY_C); + add_menu_item(CHARACTER_SELECT_MENU_4P_CURSOR, 0, 0, MENU_ITEM_PRIORITY_C); break; case COURSE_SELECT_MENU: - add_8018D9E0_entry(0x00000025, 0, 0, 2); - add_8018D9E0_entry(0x00000052, 0, 0, 6); + add_menu_item(COURSE_SELECT_BACKGROUND, 0, 0, MENU_ITEM_PRIORITY_2); + add_menu_item(COURSE_SELECT_MAP_SELECT, 0, 0, MENU_ITEM_PRIORITY_6); if (gModeSelection != BATTLE) { - add_8018D9E0_entry(0x00000053, 0, 0, 4); - add_8018D9E0_entry(0x00000054, 0, 0, 4); - add_8018D9E0_entry(0x00000055, 0, 0, 4); - add_8018D9E0_entry(0x00000056, 0, 0, 4); - add_8018D9E0_entry(0x00000058, 0, 0, 6); - add_8018D9E0_entry(0x00000059, 0, 0, 6); - add_8018D9E0_entry(0x0000005A, 0, 0, 6); - add_8018D9E0_entry(0x0000005B, 0, 0, 6); + add_menu_item(COURSE_SELECT_MUSHROOM_CUP, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(COURSE_SELECT_FLOWER_CUP, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(COURSE_SELECT_STAR_CUP, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(COURSE_SELECT_SPECIAL_CUP, 0, 0, MENU_ITEM_PRIORITY_4); + add_menu_item(MENU_ITEM_TYPE_058, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(COURSE_SELECT_COURSE_NAMES, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_05A, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_05B, 0, 0, MENU_ITEM_PRIORITY_6); } else { - add_8018D9E0_entry(0x0000005C, 0, 0, 6); - add_8018D9E0_entry(0x0000006E, 0, 0, 6); - } - add_8018D9E0_entry(0x00000064, 0, 0, 6); - add_8018D9E0_entry(0x0000005F, 0, 0, 6); - add_8018D9E0_entry(0x00000060, 0, 0, 6); - add_8018D9E0_entry(0x00000061, 0, 0, 6); - add_8018D9E0_entry(0x00000062, 0, 0, 6); - add_8018D9E0_entry(0x0000005D, 0, 0, 6); - add_8018D9E0_entry(0x0000005E, 0, 0, 8); + add_menu_item(COURSE_SELECT_BATTLE_NAMES, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_06E, 0, 0, MENU_ITEM_PRIORITY_6); + } + add_menu_item(MENU_ITEM_TYPE_064, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_05F, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_060, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_061, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_062, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(COURSE_SELECT_OK, 0, 0, MENU_ITEM_PRIORITY_6); + add_menu_item(MENU_ITEM_TYPE_05E, 0, 0, MENU_ITEM_PRIORITY_8); if (gModeSelection == TIME_TRIALS) { - add_8018D9E0_entry(0x00000065, 0, 0, 8); - add_8018D9E0_entry(0x00000066, 0, 0, 8); - add_8018D9E0_entry(0x00000069, 0, 0, 8); + add_menu_item(MENU_ITEM_TYPE_065, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_TYPE_066, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_TYPE_069, 0, 0, MENU_ITEM_PRIORITY_8); } if (gModeSelection == GRAND_PRIX) { - add_8018D9E0_entry(0x00000068, 0, 0, 8); - add_8018D9E0_entry(0x00000067, 0, 0, 5); + add_menu_item(MENU_ITEM_TYPE_068, 0, 0, MENU_ITEM_PRIORITY_8); + add_menu_item(MENU_ITEM_TYPE_067, 0, 0, MENU_ITEM_PRIORITY_5); } break; case 0: @@ -2400,22 +2545,22 @@ void func_80094C60(void) { default: break; } - if (D_800E86A4 != 2) { + if (gFadeModeSelection != FADE_MODE_LOGO) { func_8009DF4C(0x00000014); } else { func_8009DF6C(0x00000014); } - D_800E86A4 = 0; + gFadeModeSelection = FADE_MODE_NONE; } } void func_80095574(void) { s32 var_v0; - if ((D_8018EE0C < 3) || (D_8018E7AC[4] != 0)) { - func_800A8230(); + if ((unref_8018EE0C < 3) || (gTransitionType[4] != 0)) { + handle_menus_default(); } - if (gDebugMenuSelection >= 2) { + if (gDebugMenuSelection > DEBUG_MENU_DISABLED) { // If not disabled load_debug_font(); debug_print_str2(0x00000050, 0x00000064, "debug_mode"); switch (gDebugMenuSelection) { @@ -2452,9 +2597,9 @@ void func_80095574(void) { } else { var_v0 = 8; } - debug_print_str2(var_v0 + 0xB9, 0x0000006E, gDebugCourseNames[gCurrentCourseId]); + debug_print_str2(var_v0 + 0xB9, 0x0000006E, GET_COURSE_debugName); debug_print_str2(0x00000050, 0x00000078, "screen_mode"); - debug_print_str2(0x000000AA, 0x00000078, gDebugScreenModeNames[D_8018EDF1]); + debug_print_str2(0x000000AA, 0x00000078, gDebugScreenModeNames[gScreenModeListIndex]); debug_print_str2(0x00000050, 0x00000082, "player"); debug_print_str2(0x000000AA, 0x00000082, gDebugCharacterNames[gCharacterSelections[0]]); debug_print_str2(0x00000050, 0x0000008C, "sound mode"); @@ -2469,10 +2614,10 @@ void func_80095574(void) { } else { gMenuTimingCounter = 3; } - if (gMenuTimingCounter == DEBUG_MENU_DEBUG_MODE) { + if (gMenuTimingCounter == 2) { play_sound2(SOUND_INTRO_WELCOME); } - if (gMenuTimingCounter >= 0x12D) { + if (gMenuTimingCounter > 300) { func_8009E230(); func_800CA0A0(); } @@ -2521,13 +2666,9 @@ Gfx* func_800959F8(Gfx* displayListHead, Vtx* arg1) { index = ((gTextColor * 2) + ((s32) gGlobalTimer % 2)) - 4; } #ifdef AVOID_UB - if (arg1 == D_02007BB8) { - gSPDisplayList(displayListHead++, D_800E84CC[index]); - } else if (arg1 == &D_02007BB8[18]) { - gSPDisplayList(displayListHead++, D_800E84EC[index]); - } else if (arg1 == &D_02007BB8[36]) { - gSPDisplayList(displayListHead++, D_800E850C[index]); - } + gSPVertex(displayListHead++, arg1, 2, 0); + gSPVertex(displayListHead++, &arg1[(index + 1) * 2], 2, 2); + gSPDisplayList(displayListHead++, common_rectangle_display); #else if (arg1 == D_02007BB8) { gSPDisplayList(displayListHead++, D_800E84CC[index]); @@ -2633,7 +2774,7 @@ Gfx* func_80095BD0(Gfx* displayListHead, u8* arg1, f32 arg2, f32 arg3, u32 arg4, rmonPrintf("MAX effectcount(760) over!!!!(kawano)\n"); return displayListHead; func_80095BD0_label2: - func_80095AE0(sp28, arg2, arg3, arg6, arg7); + func_80095AE0((void*) sp28, arg2, arg3, arg6, arg7); gSPMatrix(displayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gMatrixEffectCount += 1; @@ -2641,16 +2782,16 @@ Gfx* func_80095BD0(Gfx* displayListHead, u8* arg1, f32 arg2, f32 arg3, u32 arg4, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); switch (arg4) { default: - var_a1 = &D_02007BB8[18]; + var_a1 = D_02007CD8; break; case 16: - var_a1 = &D_02007BB8[18]; + var_a1 = D_02007CD8; break; case 26: var_a1 = D_02007BB8; break; case 30: - var_a1 = &D_02007BB8[36]; + var_a1 = D_02007DF8; break; } @@ -2670,13 +2811,13 @@ Gfx* func_80095E10(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 sp64 = 0; s32 var_v0_2; - while (var_t0 < argB) { + while ((u32) var_t0 < argB) { var_t0 *= 2; } temp_lo = 0x400 / var_t0; - while ((temp_lo / 2) > argC) { + while ((u32) (temp_lo / 2) > argC) { temp_lo /= 2; } @@ -2713,9 +2854,9 @@ Gfx* func_80095E10(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, return displayListHead; } sp7C = arg8; - for (var_s3 = arg5; var_s3 < arg7; var_s3 += temp_lo) { + for (var_s3 = arg5; var_s3 < (u32) arg7; var_s3 += temp_lo) { - if (arg7 < temp_lo + var_s3) { + if ((u32) arg7 < temp_lo + var_s3) { var_s4 = arg7 - var_s3; if (!var_s4) { break; @@ -2724,9 +2865,9 @@ Gfx* func_80095E10(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, var_s4 = temp_lo; } - for (var_a1_2 = arg4; var_a1_2 < arg6; var_a1_2 += var_t0) { + for (var_a1_2 = arg4; var_a1_2 < (u32) arg6; var_a1_2 += var_t0) { - if (arg6 < var_t0 + var_a1_2) { + if ((u32) arg6 < var_t0 + var_a1_2) { var_s2 = arg6 - var_a1_2; if (!var_s2) { break; @@ -2764,13 +2905,13 @@ Gfx* func_800963F0(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, f32 arg4, s32 sp64 = 0; s32 var_v0_2; - while (var_t0 < argD) { + while ((u32) var_t0 < argD) { var_t0 *= 2; } temp_lo = 0x400 / var_t0; - while ((temp_lo / 2) > argE) { + while ((u32) (temp_lo / 2) > argE) { temp_lo /= 2; } @@ -2810,9 +2951,9 @@ Gfx* func_800963F0(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, f32 arg4, arg3 /= arg5; sp7C = argA; - for (var_s3 = arg7; var_s3 < arg9; var_s3 += temp_lo) { + for (var_s3 = arg7; var_s3 < (u32) arg9; var_s3 += temp_lo) { - if (arg9 < temp_lo + var_s3) { + if ((u32) arg9 < temp_lo + var_s3) { var_s4 = arg9 - var_s3; if (!var_s4) { break; @@ -2821,9 +2962,9 @@ Gfx* func_800963F0(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, f32 arg4, var_s4 = temp_lo; } b = var_s4 * arg5; - for (var_a1_2 = arg6; var_a1_2 < arg8; var_a1_2 += var_t0) { + for (var_a1_2 = arg6; var_a1_2 < (u32) arg8; var_a1_2 += var_t0) { - if (arg8 < var_t0 + var_a1_2) { + if ((u32) arg8 < (var_t0 + var_a1_2)) { var_s2 = arg8 - var_a1_2; if (!var_s2) { break; @@ -2849,114 +2990,107 @@ Gfx* func_800963F0(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, f32 arg4, } extern u8 D_0B002A00[]; -#ifdef NON_MATCHING -// https://decomp.me/scratch/xV83r -// Possibly a missed variable rename or just weird diffs. - -// I don't know what this actually meant to be. Its plausible that its meant to be a reference to -// `gTextureTitleChocoMountain` That would be weird though because this function doesn't draw that picture at all. So -// its plausible that its instead using it as some form semi-random data for the static pattern? - -// This function is responsible for drawing a near unnoticeable static pattern -// over the course images when loading the cup selection screen -// Try locking the word at `8018DC80` to see something like 0x20 just before confirming character selection to make it -// last longer - -Gfx* func_80096CD8(Gfx* displayListHead, s32 arg1, s32 arg2, u32 width, u32 arg4) { - u32 var_s1_3; - u32 var_fp; - u32 var_v0; - u32 var_a1; - s32 var_ra = 1; - s32 spCC; +/** + * + * This function is responsible for drawing a near unnoticeable static pattern + * over the course images when loading the cup selection screen. + * It may or may not use gTextureTitleChocoMountain to create that pattern. + * Try locking the word at `8018DC80` to see something like 0x20 just before confirming character selection to make it + * last longer + */ +Gfx* func_80096CD8(Gfx* displayListHead, s32 xPos, s32 yPos, u32 width, u32 height) { + u32 x; + u32 y; + UNUSED s32 pad; + u32 rectXoffset; + u32 rectYoffset; + s32 tileWidth = 1; + s32 tileHeight; s32 masks = 0; s32 maskt = 0; - s32 rand; + s32 rnd; - while (var_ra < width) { - var_ra *= 2; + while ((u32) tileWidth < width) { + tileWidth *= 2; } - spCC = 0x400 / var_ra; - - while ((spCC / 2) > arg4) { - spCC /= 2; + tileHeight = 1024 / tileWidth; + while ((u32) (tileHeight / 2) > height) { + tileHeight /= 2; } - rand = var_ra; - while (rand > 1) { - rand /= 2; + rnd = tileWidth; + while (rnd > 1) { + rnd /= 2; masks += 1; } - rand = spCC; - while (rand > 1) { - rand /= 2; + rnd = tileHeight; + while (rnd > 1) { + rnd /= 2; maskt += 1; } - if (arg1 < 0) { - width -= arg1; - arg1 = 0; - } else if ((arg1 + width) > SCREEN_WIDTH) { - width = SCREEN_WIDTH - arg1; + if (xPos < 0) { + width -= xPos; + xPos = 0; + } else if ((xPos + width) > SCREEN_WIDTH) { + width = SCREEN_WIDTH - xPos; } - if (arg2 < 0) { - arg4 -= arg2; - arg2 = 0; - } else if ((arg2 + arg4) > SCREEN_HEIGHT) { - arg4 = SCREEN_HEIGHT - arg2; + if (yPos < 0) { + height -= yPos; + yPos = 0; + } else if ((yPos + height) > SCREEN_HEIGHT) { + height = SCREEN_HEIGHT - yPos; } if (width == 0) { return displayListHead; } - if (arg4 == 0) { + if (height == 0) { return displayListHead; } - rand = random_int(100); - displayListHead = draw_box(displayListHead, arg1, arg2, arg1 + width, arg2 + arg4, 0, 0, 0, rand); - rand += 150; + rnd = random_int(100); + displayListHead = draw_box(displayListHead, xPos, yPos, xPos + width, yPos + height, 0, 0, 0, rnd); + rnd += 150; + gDPPipeSync(displayListHead++); gDPSetRenderMode(displayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); - gDPSetPrimColor(displayListHead++, 0, 0, rand, rand, rand, rand); + gDPSetPrimColor(displayListHead++, 0, 0, rnd, rnd, rnd, rnd); gDPSetCombineMode(displayListHead++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - for (var_fp = arg2; var_fp < (arg2 + arg4); var_fp += spCC) { - if ((var_fp + spCC) > (arg2 + arg4)) { - var_v0 = (arg2 + arg4) - var_fp; - if (var_v0 == 0) { + + for (y = yPos; y < (yPos + height); y += tileHeight) { + if ((y + tileHeight) > (yPos + height)) { + rectYoffset = yPos + height - y; + if (rectYoffset == 0) { break; } } else { - var_v0 = spCC; + rectYoffset = tileHeight; } - for (var_s1_3 = arg1; var_s1_3 < (arg1 + width); var_s1_3 += var_ra) { - if ((var_s1_3 + var_ra) > (arg1 + width)) { - var_a1 = (arg1 + width) - var_s1_3; - if (var_a1 == 0) { + for (x = xPos; x < xPos + width; x += tileWidth) { + if (x + tileWidth > xPos + width) { + rectXoffset = xPos + width - x; + if (rectXoffset == 0) { break; } } else { - var_a1 = var_ra; + rectXoffset = tileWidth; } - gDPLoadTextureTile(displayListHead++, D_0B002A00 + (random_int(128) * 2), G_IM_FMT_IA, G_IM_SIZ_16b, width, - arg4, var_s1_3, var_fp, var_s1_3 + var_a1, var_fp + var_v0, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(displayListHead++, var_s1_3 * 4, var_fp * 4, (var_s1_3 + var_a1) * 4, - (var_fp + var_v0) * 4, 0, (var_s1_3 * 32) & 0xFFFF, (var_fp * 32) & 0xFFFF, 1024, 1024); + gDPLoadTextureTile(displayListHead++, (D_0B002A00 + random_int(128) * 2), G_IM_FMT_IA, G_IM_SIZ_16b, width, + height, x, y, x + rectXoffset, y + rectYoffset, 0, G_TX_WRAP, G_TX_WRAP, masks, maskt, + G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(displayListHead++, x << 2, y << 2, (x + rectXoffset) << 2, (y + rectYoffset) << 2, + G_TX_RENDERTILE, (x * 32) & 0xFFFF, (y * 32) & 0xFFFF, 1024, 1024); } } return displayListHead; } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_80096CD8.s") -#endif -#ifdef NON_MATCHING Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, - s32 arg9, u16* argA, u32 argB, u32 argC, s32 argD) { + s32 arg9, UNUSED u16* argA, u32 argB, u32 argC, UNUSED s32 argD) { u32 var_a1_2 = arg4; u32 var_s3 = arg5; s32 sp7C; @@ -2967,50 +3101,41 @@ Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 sp68 = 0; s32 sp64 = 0; s32 var_v0_2; - gDPPipeSync(displayListHead++); gDPSetCycleType(displayListHead++, G_CYC_2CYCLE); gDPSetTextureLOD(displayListHead++, G_TL_TILE); gDPSetPrimColor(displayListHead++, 0, 0, 0, 0, 0, gGlobalTimer % 256); gDPSetCombineLERP(displayListHead++, TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); - - while (var_t0 < argB) { + while ((u32) var_t0 < argB) { var_t0 *= 2; } - temp_lo = 0x400 / var_t0; - - while ((temp_lo / 2) > argC) { + while ((u32) (temp_lo / 2) > argC) { temp_lo /= 2; } - var_v0_2 = var_t0; while (var_v0_2 > 1) { var_v0_2 /= 2; sp68 += 1; } var_v0_2 = temp_lo; - while (var_v0_2 > 1) { var_v0_2 /= 2; sp64 += 1; } - if (arg8 < 0) { arg4 -= arg8; arg8 = 0; - } else if (((arg6 - arg4) + arg8) > SCREEN_WIDTH) { - arg6 = (arg4 - arg8) + SCREEN_WIDTH; + } else if (((arg6 - arg4) + arg8) > 320) { + arg6 = (arg4 - arg8) + 320; } - if (arg9 < 0) { arg5 -= arg9; arg9 = 0; - } else if (((arg7 - arg5) + arg9) > SCREEN_HEIGHT) { - arg7 = (arg5 - arg9) + SCREEN_HEIGHT; + } else if (((arg7 - arg5) + arg9) > 240) { + arg7 = (arg5 - arg9) + 240; } - if (arg6 < arg4) { return displayListHead; } @@ -3018,9 +3143,8 @@ Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, return displayListHead; } sp7C = arg8; - for (var_s3 = arg5; var_s3 < arg7; var_s3 += temp_lo) { - - if (arg7 < temp_lo + var_s3) { + for (var_s3 = arg5; var_s3 < (u32) arg7; var_s3 += temp_lo) { + if ((u32) arg7 < temp_lo + var_s3) { var_s4 = arg7 - var_s3; if (!var_s4) { break; @@ -3028,10 +3152,8 @@ Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, } else { var_s4 = temp_lo; } - - for (var_a1_2 = arg4; var_a1_2 < arg6; var_a1_2 += var_t0) { - - if (arg6 < var_t0 + var_a1_2) { + for (var_a1_2 = arg4; var_a1_2 < (u32) arg6; var_a1_2 += var_t0) { + if ((u32) arg6 < var_t0 + var_a1_2) { var_s2 = arg6 - var_a1_2; if (!var_s2) { break; @@ -3039,21 +3161,16 @@ Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, } else { var_s2 = var_t0; } - - gDPLoadMultiTile(displayListHead++, arg1, 0, G_TX_RENDERTILE, arg2, G_IM_SIZ_16b, argB, argC, var_a1_2, + gDPLoadMultiTile(displayListHead++, argA, 0, G_TX_RENDERTILE, arg1, G_IM_SIZ_16b, argB, argC, var_a1_2, var_s3, var_a1_2 + var_s2, var_s3 + var_s4, 0, G_TX_WRAP, G_TX_WRAP, sp68, sp64, G_TX_NOLOD, G_TX_NOLOD); - - gDPLoadMultiTile(displayListHead++, D_0B002A00 + random_int(128) * 2, 256, G_TX_RENDERTILE + 1, arg2, + gDPLoadMultiTile(displayListHead++, D_0B002A00 + random_int(128) * 2, 256, G_TX_RENDERTILE + 1, arg1, G_IM_SIZ_16b, argB, argC, var_a1_2, var_s3, var_a1_2 + var_s2, var_s3 + var_s4, 0, G_TX_WRAP, G_TX_WRAP, sp68, sp64, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(displayListHead++, arg8 * 4, arg9 * 4, (arg8 + var_s2) * 4, (arg9 + var_s4) * 4, 0, (var_a1_2 * 32) & 0xFFFF, (var_s3 * 32) & 0xFFFF, arg2, arg3); - arg8 += var_t0; } - arg8 = sp7C; arg9 += temp_lo; } @@ -3061,9 +3178,6 @@ Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, gDPSetCycleType(displayListHead++, G_CYC_1CYCLE); return displayListHead; } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_80097274.s") -#endif Gfx* func_80097A14(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, u8* arg8, u32 arg9, u32 argA) { @@ -3109,8 +3223,8 @@ Gfx* func_80097AE4(Gfx* displayListHead, s8 fmt, s32 arg2, s32 arg3, u8* arg4, s return displayListHead; } -Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u32 arg5, s32 arg6, s32 arg7, - u8* someTexture, u32 arg9, u32 argA, s32 width) { +Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, UNUSED u32 arg2, u32 arg3, UNUSED u32 arg4, u32 arg5, s32 arg6, + s32 arg7, u8* someTexture, u32 arg9, UNUSED u32 argA, s32 width) { u32 ult; u32 temp; s32 arg6Copy; @@ -3167,9 +3281,9 @@ Gfx* func_80098558(Gfx* displayListHead, u32 arg1, u32 arg2, u32 arg3, u32 arg4, arg5Copy = arg5; for (var_v0 = arg2; var_v0 < arg4; var_v0 += 0x20) { for (var_a3 = arg1; var_a3 < arg3; var_a3 += 0x20) { - gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, var_v0, - var_a3 + 0x20, var_v0 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, - 5, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureTile(displayListHead++, gMenuTextureBuffer, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, + var_v0, var_a3 + 0x20, var_v0 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(displayListHead++, arg5 << 2, arg6 << 2, (arg5 + 0x20) << 2, (arg6 + 0x20) << 2, 0, 0, 0, 1024, 1024); arg5 += 0x20; @@ -3192,17 +3306,17 @@ Gfx* func_800987D0(Gfx* displayListHead, u32 arg1, u32 arg2, u32 width, u32 heig f32 temp_f18; f32 temp_f24; - if (D_8018E7B8[0] == 0) { - D_8018E7B8[0] = 1; + if (gTransitionDuration[0] == 0) { + gTransitionDuration[0] = 1; } - temp_f24 = sins(((D_8018E7D0[0] * 0x4E20) / D_8018E7B8[0]) % 20000U); - temp_f0 = coss(((D_8018E7D0[0] * 0x4E20) / D_8018E7B8[0]) % 20000U); - temp_f18 = (((f32) D_8018E7D0[0] * 0.5) / D_8018E7B8[0]) + 1.0; + temp_f24 = sins(((gCurrentTransitionTime[0] * 0x4E20) / gTransitionDuration[0]) % 20000U); + temp_f0 = coss(((gCurrentTransitionTime[0] * 0x4E20) / gTransitionDuration[0]) % 20000U); + temp_f18 = (((f32) gCurrentTransitionTime[0] * 0.5) / gTransitionDuration[0]) + 1.0; columnCopy = column; for (var_v0_2 = arg2; (u32) var_v0_2 < height; var_v0_2 += 0x20) { for (var_a2 = arg1; (u32) var_a2 < width; var_a2 += 0x20) { - gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, var_a2, - var_v0_2, var_a2 + 0x20, var_v0_2 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, + gDPLoadTextureTile(displayListHead++, gMenuTextureBuffer, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, + var_a2, var_v0_2, var_a2 + 0x20, var_v0_2 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); temp_f6 = (temp_f18 * ((temp_f0 * (column - 0xA0)) + (temp_f24 * (row - 0x78)))) + 160.0f; temp_f4_2 = (temp_f18 * ((-temp_f24 * (column - 0xA0)) + (temp_f0 * (row - 0x78)))) + 120.0f; @@ -3295,29 +3409,29 @@ Gfx* func_80098FC8(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry) { return draw_box_fill(displayListHead, ulx, uly, lrx, lry, 0, 0, 0, 0xFF); } -void dma_copy_base_729a30(u64* arg0, size_t nbytes, void* vaddr) { - OSIoMesg sp30; - OSMesg sp2C; +void dma_copy_mio0_segment(u64* data, size_t nbytes, void* vaddr) { + OSIoMesg mb; + OSMesg msg; osInvalDCache(vaddr, nbytes); - osPiStartDma(&sp30, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(arg0)], + osPiStartDma(&mb, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(data)], vaddr, nbytes, &gDmaMesgQueue); - osRecvMesg(&gDmaMesgQueue, &sp2C, OS_MESG_BLOCK); + osRecvMesg(&gDmaMesgQueue, &msg, OS_MESG_BLOCK); } -void dma_copy_base_7fa3c0(u64* arg0, size_t nbytes, void* vaddr) { - OSIoMesg sp30; - OSMesg sp2C; +void dma_tkmk00_textures(u64* data, size_t nbytes, void* vaddr) { + OSIoMesg mb; + OSMesg msg; osInvalDCache(vaddr, nbytes); - osPiStartDma(&sp30, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_textures_0bSegmentRomStart[SEGMENT_OFFSET(arg0)], + osPiStartDma(&mb, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_textures_0bSegmentRomStart[SEGMENT_OFFSET(data)], vaddr, nbytes, &gDmaMesgQueue); - osRecvMesg(&gDmaMesgQueue, &sp2C, OS_MESG_BLOCK); + osRecvMesg(&gDmaMesgQueue, &msg, OS_MESG_BLOCK); } -void func_80099110(void) { - gD_8018E118TotalSize = 0; - gNumD_8018E118Entries = 0; +void clear_menu_textures(void) { + sMenuTextureBufferIndex = 0; + sMenuTextureEntries = 0; } /** @@ -3340,238 +3454,198 @@ void* segmented_to_virtual_dupe_2(const void* addr) { return (void*) ((gSegmentTable[segment] + offset) + 0x80000000); } -#ifdef NON_MATCHING -// https://decomp.me/scratch/NAZ12 -// Register allocation nonsense -void func_80099184(MkTexture* arg0) { - u16 var_a1_2; - s32 var_v0; - s32 var_a1; - UNUSED s32 temp_s3; - MkTexture* var_s1; - UNUSED struct_8018E118_entry* thing; +void load_menu_img(MenuTexture* addr) { + u16 size; + s32 i; + s32 imgLoaded; + MenuTexture* texAddr; + TextureMap* texMap = &sMenuTextureMap[0]; - var_s1 = segmented_to_virtual_dupe(arg0); - while (var_s1->textureData != NULL) { - var_a1 = 0; - for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { - // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { - var_a1 = 1; + texAddr = segmented_to_virtual_dupe(addr); + while (texAddr->textureData != NULL) { + imgLoaded = false; + for (i = 0; i < sMenuTextureEntries; i++) { + if (texAddr->textureData == (texMap + i)->textureData) { + imgLoaded = true; break; } } - if (var_a1 == 0) { - if (var_s1->type == 3) { - if (var_s1->size != 0) { - var_a1_2 = var_s1->size; + + if (imgLoaded == false) { + if (texAddr->type == 3) { + if (texAddr->size != 0) { + size = texAddr->size; } else { - var_a1_2 = 0x1000; + size = 0x1000; } - if (var_a1_2 % 8) { - var_a1_2 = ((var_a1_2 / 8) * 8) + 8; + if (size % 8) { + size = ((size / 8) * 8) + 8; } - dma_copy_base_729a30(var_s1->textureData, var_a1_2, D_8018D9B4); - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gD_8018E118TotalSize]); + dma_copy_mio0_segment(texAddr->textureData, size, gMenuCompressedBuffer); + mio0decode((u8*) gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[sMenuTextureBufferIndex]); } else { - dma_copy_base_729a30(var_s1->textureData, var_s1->height * var_s1->width * 2, - &D_8018D9B0[gD_8018E118TotalSize]); + dma_copy_mio0_segment(texAddr->textureData, (texAddr->height * texAddr->width) * 2, + &gMenuTextureBuffer[sMenuTextureBufferIndex]); } - - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->offset = gD_8018E118TotalSize; - - gD_8018E118TotalSize += (var_s1->height * var_s1->width); - gNumD_8018E118Entries += 1; - gD_8018E118TotalSize = ((gD_8018E118TotalSize / 8) * 8) + 8; + texMap[sMenuTextureEntries].textureData = texAddr->textureData; + texMap[sMenuTextureEntries].offset = sMenuTextureBufferIndex; + sMenuTextureBufferIndex += texAddr->height * texAddr->width; + sMenuTextureBufferIndex = ((sMenuTextureBufferIndex / 8) * 8) + 8; + sMenuTextureEntries += 1; } - var_s1++; + texAddr++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_80099184.s") -#endif -#ifdef NON_MATCHING -// https://decomp.me/scratch/O2tkD -// Register allocation nonsense -void func_80099394(MkTexture* arg0) { - UNUSED u16 var_a1_2; - s32 var_v0; - s32 var_a1; - UNUSED s32 temp_s3; - MkTexture* var_s1; - struct_8018E118_entry* thing; +void func_80099394(MenuTexture* addr) { + s32 i; + s32 imgLoaded; + MenuTexture* texAddr; + TextureMap* texMap = &sMenuTextureMap[0]; - var_s1 = segmented_to_virtual_dupe(arg0); - while (var_s1->textureData != NULL) { - var_a1 = 0; - for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { - // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { - var_a1 = 1; + texAddr = segmented_to_virtual_dupe(addr); + while (texAddr->textureData != NULL) { + imgLoaded = false; + for (i = 0; i < sMenuTextureEntries; i++) { + if (texAddr->textureData == (texMap + i)->textureData) { + imgLoaded = true; break; } } - if (var_a1 == 0) { - if (var_s1->type == 5) { - dma_copy_base_729a30(var_s1->textureData, (u32) ((s32) (var_s1->height * var_s1->width) / 2), - &D_8018D9B0[gD_8018E118TotalSize]); - } - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->offset = gD_8018E118TotalSize; - - gD_8018E118TotalSize += (var_s1->height * var_s1->width); - gD_8018E118TotalSize = ((gD_8018E118TotalSize / 8) * 8) + 8; - gNumD_8018E118Entries += 1; + if (imgLoaded == false) { + if (texAddr->type == 5) { + dma_copy_mio0_segment(texAddr->textureData, (u32) (((s32) (texAddr->height * texAddr->width)) / 2), + &gMenuTextureBuffer[sMenuTextureBufferIndex]); + } + texMap[sMenuTextureEntries].textureData = texAddr->textureData; + texMap[sMenuTextureEntries].offset = sMenuTextureBufferIndex; + sMenuTextureBufferIndex += texAddr->height * texAddr->width; + sMenuTextureBufferIndex = ((sMenuTextureBufferIndex / 8) * 8) + 8; + sMenuTextureEntries += 1; } - var_s1++; + texAddr++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_80099394.s") -#endif -#ifdef NON_MATCHING -// Register allocation nonsense -// https://decomp.me/scratch/Wv2MX -void func_8009952C(MkTexture* arg0) { - UNUSED u16 var_a1_2; - s32 var_v0; - s32 var_a1; - UNUSED s32 temp_s3; - MkTexture* var_s1; - struct_8018E118_entry* thing; +void func_8009952C(MenuTexture* addr) { + s32 i; + s32 imgLoaded; + MenuTexture* texAddr; + TextureMap* texMap = &sMenuTextureMap[0]; - var_s1 = segmented_to_virtual_dupe(arg0); - while (var_s1->textureData != NULL) { - var_a1 = 0; - for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { - // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { - var_a1 = 1; + texAddr = segmented_to_virtual_dupe(addr); + while (texAddr->textureData != NULL) { + imgLoaded = false; + for (i = 0; i < sMenuTextureEntries; i++) { + if (texAddr->textureData == (texMap + i)->textureData) { + imgLoaded = true; break; } } - if (var_a1 == 0) { - dma_copy_base_729a30(var_s1->textureData, 0x00008000U, D_8018D9B4); - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gD_8018E118TotalSize]); - - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->offset = gD_8018E118TotalSize; - gD_8018E118TotalSize += (var_s1->height * var_s1->width); - gD_8018E118TotalSize = ((gD_8018E118TotalSize / 8) * 8) + 8; - gNumD_8018E118Entries += 1; + if (imgLoaded == false) { + dma_copy_mio0_segment(texAddr->textureData, 0x00008000U, gMenuCompressedBuffer); + mio0decode((u8*) gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[sMenuTextureBufferIndex]); + texMap[sMenuTextureEntries].textureData = texAddr->textureData; + texMap[sMenuTextureEntries].offset = sMenuTextureBufferIndex; + sMenuTextureBufferIndex += texAddr->height * texAddr->width; + sMenuTextureBufferIndex = ((sMenuTextureBufferIndex / 8) * 8) + 8; + sMenuTextureEntries += 1; } - var_s1++; + texAddr++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009952C.s") -#endif -void func_8009969C(MkTexture* arg0) { - func_800996BC(arg0, 1); +void load_menu_img_mio0_forced(MenuTexture* addr) { + load_menu_img_comp_type(addr, LOAD_MENU_IMG_MIO0_FORCE); } -#ifdef NON_MATCHING -// Register allocation nonsense -// https://decomp.me/scratch/hwAAp -void func_800996BC(MkTexture* arg0, s32 arg1) { - u16 var_a1_2; - s32 var_v0; - s32 var_a1; - u8 var_v0_2; - MkTexture* var_s1; - struct_8018E118_entry* thing; +void load_menu_img_comp_type(MenuTexture* addr, s32 compType) { + u16 size; + s32 i; + s32 imgLoaded; + u8 clearBit; + MenuTexture* texAddr; + TextureMap* texMap = &sMenuTextureMap[0]; - var_s1 = segmented_to_virtual_dupe(arg0); - while (var_s1->textureData != NULL) { - var_a1 = 0; - for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { - // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { - var_a1 = 1; + texAddr = segmented_to_virtual_dupe(addr); + while (texAddr->textureData != NULL) { + imgLoaded = false; + for (i = 0; i < sMenuTextureEntries; i++) { + if (texAddr->textureData == (texMap + i)->textureData) { + imgLoaded = true; break; } } - if ((var_a1 == 0) || (arg1 > 0)) { - if (var_s1->size != 0) { - var_a1_2 = var_s1->size; + + if ((imgLoaded == false) || (compType > LOAD_MENU_IMG_FORCE)) { + if (texAddr->size != 0) { + size = texAddr->size; } else { - var_a1_2 = 0x1000; + size = 0x1000; } - if ((var_a1_2 % 8)) { - var_a1_2 = (((var_a1_2 / 8) * 8) + 8); + if (size % 8) { + size = ((size / 8) * 8) + 8; } - switch (arg1) { /* irregular */ - case -1: - case 1: - dma_copy_base_729a30(var_s1->textureData, var_a1_2, D_8018D9B4); + switch (compType) { + case LOAD_MENU_IMG_MIO0_ONCE: + case LOAD_MENU_IMG_MIO0_FORCE: + dma_copy_mio0_segment(texAddr->textureData, size, gMenuCompressedBuffer); break; - case 0: - case 2: - dma_copy_base_7fa3c0(var_s1->textureData, var_a1_2, D_8018D9B4); + case LOAD_MENU_IMG_TKMK00_ONCE: + case LOAD_MENU_IMG_TKMK00_FORCE: + dma_tkmk00_textures(texAddr->textureData, size, gMenuCompressedBuffer); break; } - switch (arg1) { /* switch 1; irregular */ - case -1: /* switch 1 */ - case 1: /* switch 1 */ - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gD_8018E118TotalSize]); + + switch (compType) { + case LOAD_MENU_IMG_MIO0_ONCE: + case LOAD_MENU_IMG_MIO0_FORCE: + mio0decode((u8*) gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[sMenuTextureBufferIndex]); break; - case 0: /* switch 1 */ - case 2: /* switch 1 */ - if (var_s1->type == 1) { - var_v0_2 = 0x000000BE; + case LOAD_MENU_IMG_TKMK00_ONCE: + case LOAD_MENU_IMG_TKMK00_FORCE: + if (texAddr->type == 1) { + clearBit = 0xBE; } else { - var_v0_2 = 1; + clearBit = 1; } if (1) {} - tkmk00decode(D_8018D9B4, D_8018D9B8, (u8*) &D_8018D9B0[gD_8018E118TotalSize], var_v0_2); + tkmk00decode(gMenuCompressedBuffer, sTKMK00_LowResBuffer, + &gMenuTextureBuffer[sMenuTextureBufferIndex], clearBit); break; } - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; - thing->offset = gD_8018E118TotalSize; - gD_8018E118TotalSize += var_s1->height * var_s1->width; - gD_8018E118TotalSize = ((gD_8018E118TotalSize / 8) * 8) + 8; - gNumD_8018E118Entries += 1; + + texMap[sMenuTextureEntries].textureData = texAddr->textureData; + texMap[sMenuTextureEntries].offset = sMenuTextureBufferIndex; + sMenuTextureBufferIndex += texAddr->height * texAddr->width; + sMenuTextureBufferIndex = ((sMenuTextureBufferIndex / 8) * 8) + 8; + sMenuTextureEntries += 1; } - var_s1++; + texAddr++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800996BC.s") -#endif -void func_80099958(MkTexture* arg0, s32 arg1, s32 arg2) { - u16 var_a1; - UNUSED u8* thing; - MkTexture* temp_v0; +void func_80099958(MenuTexture* addr, s32 arg1, s32 arg2) { + u16 size; + MenuTexture* texAddr; - temp_v0 = segmented_to_virtual_dupe(arg0); - while (temp_v0->textureData != NULL) { - if (temp_v0->size != 0) { - var_a1 = temp_v0->size; + texAddr = segmented_to_virtual_dupe(addr); + while (texAddr->textureData != NULL) { + if (texAddr->size != 0) { + size = texAddr->size; } else { - var_a1 = 0x1400; + size = 0x1400; } - if (var_a1 % 8) { + if (size % 8) { // Round up to the next multiple of eight - var_a1 = ((var_a1 / 8) * 8) + 8; + size = ((size / 8) * 8) + 8; } - dma_copy_base_729a30(temp_v0->textureData, var_a1, D_8018D9B4); - mio0decode(D_8018D9B4, D_802BFB80.arraySize4[arg2][arg1 / 2][(arg1 % 2) + 2].pixel_index_array); - temp_v0++; + dma_copy_mio0_segment(texAddr->textureData, size, gMenuCompressedBuffer); + mio0decode((u8*) gMenuCompressedBuffer, + (u8*) D_802BFB80.arraySize4[arg2][arg1 / 2][(arg1 % 2) + 2].pixel_index_array); + texAddr++; } } @@ -3582,7 +3656,7 @@ void func_80099A70(void) { for (i = 0; i < D_8018E060_SIZE; i++) {} } -void func_80099A94(MkTexture* arg0, s32 arg1) { +void func_80099A94(MenuTexture* arg0, s32 arg1) { struct_8018E060_entry* var_v1; var_v1 = &D_8018E060[0]; @@ -3590,109 +3664,112 @@ void func_80099A94(MkTexture* arg0, s32 arg1) { var_v1++; } var_v1->texture = segmented_to_virtual_dupe(arg0); - var_v1->unk_4 = arg1; + var_v1->texNum = arg1; } -#ifdef NON_MATCHING -// https://decomp.me/scratch/rxEoi -// Something's up with the handling of `_textures_0aSegmentRomStart`, I don't know how to fix it void func_80099AEC(void) { - s8 var_s4; - s32 var_s0; - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; - s32 huh; - OSIoMesg sp68; - OSMesg sp64; - UNUSED u8* test; - s32 sp60; - MkTexture* temp_s2; + s32 some_var; + s8 texEnd; struct_8018E060_entry* var_s1; + TextureMap* entry; + MenuTexture* texPtr; + OSIoMesg mb; + OSMesg sp64; + s32 cacheSize; + s32 bufSize; - if (gGamestate == 4) { - sp60 = 0x00000500; + if (gGamestate == RACING) { + bufSize = 0x500; } else { - sp60 = 0x00001000; + bufSize = 0x1000; } - var_s4 = 0; - var_s1 = D_8018E060; - temp_s2 = var_s1->texture; + texEnd = 0; + entry = &sMenuTextureMap[0]; + var_s1 = &D_8018E060[0]; + texPtr = var_s1->texture; - if (temp_s2 == NULL) + if (texPtr == NULL) { return; + } - huh = temp_s2->size; - if (huh != 0) { - var_s0 = huh; + if (texPtr->size) { + cacheSize = texPtr->size; } else { - var_s0 = 0x1400; + cacheSize = 0x1400; } - if (var_s0 % 8) { - var_s0 = ((var_s0 / 8) * 8) + 8; + if (cacheSize % 8) { + cacheSize = ((cacheSize / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); - osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4, var_s0, &gDmaMesgQueue); + + osInvalDCache(gMenuCompressedBuffer, cacheSize); + osPiStartDma(&mb, 0, 0, (uintptr_t) _textures_0aSegmentRomStart + SEGMENT_OFFSET(texPtr->textureData), + gMenuCompressedBuffer, cacheSize, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &sp64, 1); + while (1) { if ((var_s1 + 1)->texture == NULL) { - var_s4 += 1; + texEnd += 1; } else { - temp_s2 = (var_s1 + 1)->texture; - huh = (var_s1 + 1)->texture->size; - if (huh != 0) { - var_s0 = huh; + texPtr = (var_s1 + 1)->texture; + if (texPtr->size) { + cacheSize = texPtr->size; } else { - var_s0 = 0x1400; + cacheSize = 0x1400; } - if (var_s0 % 8) { - var_s0 = ((var_s0 / 8) * 8) + 8; + if (cacheSize % 8) { + cacheSize = ((cacheSize / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4 + sp60 * 4, var_s0); - osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4 + sp60 * 4, var_s0, &gDmaMesgQueue); + osInvalDCache(&gMenuCompressedBuffer[bufSize], cacheSize); + osPiStartDma(&mb, 0, 0, (uintptr_t) _textures_0aSegmentRomStart + SEGMENT_OFFSET(texPtr->textureData), + &gMenuCompressedBuffer[bufSize], cacheSize, &gDmaMesgQueue); } - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[D_8018E118[var_s1->unk_4].offset]); + + some_var = (entry + var_s1->texNum)->offset; + + mio0decode((u8*) gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[some_var]); + var_s1->texture = NULL; var_s1++; - if (var_s4 != 0) + if (texEnd) { break; + } + osRecvMesg(&gDmaMesgQueue, &sp64, 1); + if ((var_s1 + 1)->texture == NULL) { - var_s4 += 1; + texEnd += 1; } else { - temp_s2 = (var_s1 + 1)->texture; - huh = (var_s1 + 1)->texture->size; - if (huh != 0) { - var_s0 = huh; + texPtr = (var_s1 + 1)->texture; + if (texPtr->size) { + cacheSize = texPtr->size; } else { - var_s0 = 0x1400; + cacheSize = 0x1400; } - if (var_s0 % 8) { - var_s0 = ((var_s0 / 8) * 8) + 8; + if (cacheSize % 8) { + cacheSize = ((cacheSize / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); - osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4, var_s0, &gDmaMesgQueue); + osInvalDCache(gMenuCompressedBuffer, cacheSize); + osPiStartDma(&mb, 0, 0, (uintptr_t) _textures_0aSegmentRomStart + SEGMENT_OFFSET(texPtr->textureData), + gMenuCompressedBuffer, cacheSize, &gDmaMesgQueue); } - mio0decode(D_8018D9B4 + sp60 * 4, (u8*) &D_8018D9B0[D_8018E118[var_s1->unk_4].offset]); + + some_var = (entry + var_s1->texNum)->offset; + mio0decode((u8*) &gMenuCompressedBuffer[bufSize], (u8*) &gMenuTextureBuffer[some_var]); var_s1->texture = NULL; var_s1++; - if (var_s4 != 0) + if (texEnd) { break; + } osRecvMesg(&gDmaMesgQueue, &sp64, 1); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_80099AEC.s") -#endif void func_80099E54(void) { D_8018E0E8[0].mk64Texture = NULL; } -void func_80099E60(MkTexture* arg0, s32 arg1, s32 arg2) { +void func_80099E60(MenuTexture* arg0, s32 arg1, s32 arg2) { struct_8018E0E8_entry* var_v1; var_v1 = D_8018E0E8; @@ -3704,28 +3781,23 @@ void func_80099E60(MkTexture* arg0, s32 arg1, s32 arg2) { var_v1->unk6 = arg2; } -#ifdef NON_MATCHING -// https://decomp.me/scratch/rUXbD -// Some fakematch nonsense, may or may not be necessary -// Issue is with instruction ordering near the first `osPiStartDma` call void func_80099EC4(void) { s8 var_s4; s32 var_s0; - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; + UNUSED s32 pad[2]; OSIoMesg sp68; OSMesg sp64; s32 huh; - u8* test; - MkTexture* temp_s2; + MenuTexture* temp_s2; struct_8018E0E8_entry* var_s1; var_s4 = 0; var_s1 = D_8018E0E8; temp_s2 = var_s1->mk64Texture; - if (temp_s2 == NULL) + if (temp_s2 == NULL) { return; + } huh = temp_s2->size; if (huh != 0) { @@ -3736,12 +3808,10 @@ void func_80099EC4(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); - test = &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)]; - osPiStartDma(&sp68, 0, 0, (uintptr_t) test, D_8018D9B4, var_s0, &gDmaMesgQueue); + osInvalDCache((void*) gMenuCompressedBuffer, var_s0); + osPiStartDma(&sp68, 0, 0, (u32) _textures_0aSegmentRomStart + SEGMENT_OFFSET(temp_s2->textureData), + gMenuCompressedBuffer, var_s0, &gDmaMesgQueue); if ((var_s0 && var_s0) && var_s0) {} - // osPiStartDma(&sp68, 0, 0, &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], D_8018D9B4, var_s0, - // &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &sp64, 1); while (1) { if ((var_s1 + 1)->mk64Texture == NULL) { @@ -3757,16 +3827,17 @@ void func_80099EC4(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4 + 0x1400, var_s0); - osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4 + 0x1400, var_s0, &gDmaMesgQueue); + osInvalDCache(gMenuCompressedBuffer + 0x500, var_s0); + osPiStartDma(&sp68, 0, 0, (u32) _textures_0aSegmentRomStart + SEGMENT_OFFSET(temp_s2->textureData), + gMenuCompressedBuffer + 0x500, var_s0, &gDmaMesgQueue); } - mio0decode(D_8018D9B4, + mio0decode((u8*) gMenuCompressedBuffer, D_802BFB80.arraySize4[var_s1->unk6][var_s1->unk4 / 2][(var_s1->unk4 % 2) + 2].pixel_index_array); var_s1->mk64Texture = NULL; var_s1++; - if (var_s4 != 0) + if (var_s4 != 0) { break; + } osRecvMesg(&gDmaMesgQueue, &sp64, 1); if ((var_s1 + 1)->mk64Texture == NULL) { var_s4 += 1; @@ -3781,42 +3852,40 @@ void func_80099EC4(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); - osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4, var_s0, &gDmaMesgQueue); + osInvalDCache(gMenuCompressedBuffer, var_s0); + osPiStartDma(&sp68, 0, 0, (u32) _textures_0aSegmentRomStart + SEGMENT_OFFSET(temp_s2->textureData), + gMenuCompressedBuffer, var_s0, &gDmaMesgQueue); } - mio0decode(D_8018D9B4 + 0x1400, + mio0decode((u8*) (gMenuCompressedBuffer + 0x500), D_802BFB80.arraySize4[var_s1->unk6][var_s1->unk4 / 2][(var_s1->unk4 % 2) + 2].pixel_index_array); var_s1->mk64Texture = NULL; var_s1++; - if (var_s4 != 0) + if (var_s4 != 0) { break; + } osRecvMesg(&gDmaMesgQueue, &sp64, 1); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_80099EC4.s") -#endif -void func_8009A238(MkTexture* arg0, s32 arg1) { +void func_8009A238(MenuTexture* arg0, s32 arg1) { s32 var_a3; s32 temp_v1; u64* sp24; - UNUSED struct_8018E118_entry* temp_v0; + UNUSED TextureMap* temp_v0; - temp_v1 = D_8018E118[arg1].offset; + temp_v1 = sMenuTextureMap[arg1].offset; sp24 = arg0->textureData; var_a3 = arg0->size; if (var_a3 % 8) { var_a3 = ((var_a3 / 8) * 8) + 8; } - dma_copy_base_7fa3c0(sp24, var_a3, D_8018D9B4); - tkmk00decode(D_8018D9B4, D_8018D9B8, (u8*) &D_8018D9B0[temp_v1], 1); - D_8018E118[arg1].textureData = sp24; + dma_tkmk00_textures(sp24, var_a3, gMenuCompressedBuffer); + tkmk00decode(gMenuCompressedBuffer, sTKMK00_LowResBuffer, &gMenuTextureBuffer[temp_v1], 1); + sMenuTextureMap[arg1].textureData = sp24; } void func_8009A2F0(struct_8018E0E8_entry* arg0) { - MkTexture* var_a0; + MenuTexture* var_a0; struct_8018E0E8_entry* temp_v0; temp_v0 = segmented_to_virtual_dupe_2(arg0); @@ -3825,7 +3894,7 @@ void func_8009A2F0(struct_8018E0E8_entry* arg0) { if (var_a0 == NULL) { break; } - func_800996BC(var_a0, 0); + load_menu_img_comp_type(var_a0, LOAD_MENU_IMG_TKMK00_ONCE); if (1) {} temp_v0++; var_a0 = temp_v0->mk64Texture; @@ -3839,7 +3908,7 @@ void func_8009A344(void) { } } -s32 func_8009A374(MkAnimation* anim) { +s32 animate_character_select_menu(MkAnimation* anim) { s32 i; struct_8018DEE0_entry* entry; @@ -3860,15 +3929,15 @@ s32 func_8009A374(MkAnimation* anim) { entry->sequenceIndex = -1; entry->frameCountDown = 0; entry->visible = 0x80000000; - entry->D_8018E118_index = gNumD_8018E118Entries; + entry->menuTextureIndex = sMenuTextureEntries; if (anim[0].mk64Texture) { - func_8009969C(anim[0].mk64Texture); + load_menu_img_mio0_forced(anim[0].mk64Texture); } if (anim[1].mk64Texture) { - func_8009969C(anim[1].mk64Texture); + load_menu_img_mio0_forced(anim[1].mk64Texture); } else { - func_8009969C(anim[0].mk64Texture); + load_menu_img_mio0_forced(anim[0].mk64Texture); } entry->unk14 = 0; @@ -3896,7 +3965,7 @@ s32 func_8009A478(MkAnimation* anim, s32 arg1) { entry->sequenceIndex = -1; entry->frameCountDown = 0; entry->visible = 0x80000000; - entry->D_8018E118_index = gNumD_8018E118Entries; + entry->menuTextureIndex = sMenuTextureEntries; if (anim[0].mk64Texture) { func_80099958(anim[0].mk64Texture, arg1, 0); } @@ -3911,7 +3980,7 @@ s32 func_8009A478(MkAnimation* anim, s32 arg1) { void func_8009A594(s32 arg0, s32 arg1, MkAnimation* arg2) { MkAnimation* temp_v0; - MkTexture* temp_a0; + MenuTexture* temp_a0; temp_v0 = segmented_to_virtual_dupe_2(arg2); D_8018DEE0[arg0].textureSequence = temp_v0; @@ -3921,17 +3990,17 @@ void func_8009A594(s32 arg0, s32 arg1, MkAnimation* arg2) { D_8018DEE0[arg0].frameCountDown = (temp_v0 + arg1)->frame_length; temp_a0 = segmented_to_virtual_dupe(temp_v0[arg1].mk64Texture); if (D_8018DEE0[arg0].unk14 != 0) { - func_80099A94(temp_a0, D_8018DEE0[arg0].D_8018E118_index); + func_80099A94(temp_a0, D_8018DEE0[arg0].menuTextureIndex); D_8018DEE0[arg0].unk14 = 0; } else { - func_80099A94(temp_a0, D_8018DEE0[arg0].D_8018E118_index + 1); + func_80099A94(temp_a0, D_8018DEE0[arg0].menuTextureIndex + 1); D_8018DEE0[arg0].unk14 = 1; } } void func_8009A640(s32 arg0, s32 arg1, s32 arg2, MkAnimation* arg3) { MkAnimation* temp_v0; - MkTexture* temp_a0; + MenuTexture* temp_a0; temp_v0 = segmented_to_virtual_dupe_2(arg3); D_8018DEE0[arg0].textureSequence = temp_v0; @@ -3969,11 +4038,11 @@ void func_8009A7EC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { } } -MkTexture* func_8009A878(struct_8018DEE0_entry* arg0) { +MenuTexture* func_8009A878(struct_8018DEE0_entry* arg0) { MkAnimation* temp_v1; MkAnimation* var_v0; MkAnimation* test; - MkTexture* temp_a0; + MenuTexture* temp_a0; temp_v1 = arg0->textureSequence; if (arg0->sequenceIndex < 0) { @@ -3992,21 +4061,21 @@ MkTexture* func_8009A878(struct_8018DEE0_entry* arg0) { arg0->frameCountDown = var_v0->frame_length; temp_a0 = segmented_to_virtual_dupe(var_v0->mk64Texture); if (arg0->unk14 != 0) { - func_80099A94(temp_a0, arg0->D_8018E118_index); + func_80099A94(temp_a0, arg0->menuTextureIndex); arg0->unk14 = 0; } else { - func_80099A94(temp_a0, arg0->D_8018E118_index + 1); + func_80099A94(temp_a0, arg0->menuTextureIndex + 1); arg0->unk14 = 1; } } return arg0->textureSequence[arg0->sequenceIndex].mk64Texture; } -MkTexture* func_8009A944(struct_8018DEE0_entry* arg0, s32 arg1) { +MenuTexture* func_8009A944(struct_8018DEE0_entry* arg0, s32 arg1) { MkAnimation* temp_v1; MkAnimation* var_v0; MkAnimation* test; - MkTexture* temp_a0; + MenuTexture* temp_a0; temp_v1 = arg0->textureSequence; if (arg0->sequenceIndex < 0) { @@ -4043,8 +4112,8 @@ void func_8009A9FC(s32 arg0, s32 arg1, u32 arg2, s32 arg3) { u16* color0; u16* color1; - color0 = &D_8018D9B0[D_8018E118[arg0].offset]; - color1 = &D_8018D9B0[D_8018E118[arg1].offset]; + color0 = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; + color1 = &gMenuTextureBuffer[sMenuTextureMap[arg1].offset]; for (var_t1 = 0; (u32) var_t1 < arg2; var_t1++) { temp_a0 = *color0++; red = (temp_a0 & 0xF800) >> 0xB; @@ -4072,7 +4141,7 @@ void func_8009AB7C(s32 arg0) { s32 var_v1; u16* color; - color = &D_8018D9B0[D_8018E118[arg0].offset]; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; for (var_v1 = 0; var_v1 < 0x4B000; var_v1++) { red = ((*color & 0xF800) >> 0xB) * 0x4D; green = ((*color & 0x7C0) >> 6) * 0x96; @@ -4101,8 +4170,8 @@ void func_8009AD78(s32 arg0, s32 arg1) { UNUSED u16 temp_a0; u16* color; - color = &D_8018D9B0[D_8018E118[arg0].offset]; - size = D_8018E118[arg0 + 1].offset - D_8018E118[arg0].offset; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; + size = sMenuTextureMap[arg0 + 1].offset - sMenuTextureMap[arg0].offset; for (var_v1 = 0; var_v1 != size; var_v1++) { red = ((*color & 0xF800) >> 0xB) * 0x4D; green = ((*color & 0x7C0) >> 6) * 0x96; @@ -4115,8 +4184,8 @@ void func_8009AD78(s32 arg0, s32 arg1) { } } -void func_8009B0A4(s32 arg0, u32 arg1) { - u32 var_s0; +void convert_img_to_greyscale(s32 arg0, u32 arg1) { + u32 i; s32 red; s32 green; s32 blue; @@ -4124,29 +4193,29 @@ void func_8009B0A4(s32 arg0, u32 arg1) { u32 temp_t9; s32 size; u16* color; - f32 sp48[0x20]; + f32 sp48[32]; - for (var_s0 = 0; var_s0 < 0x20; var_s0++) { - sp48[var_s0] = func_800917B0(var_s0 * 0.03125, (arg1 * 1.5 * 0.00390625) + 0.25); + for (i = 0; i < 32; i++) { + sp48[i] = menu_pow(i / 32.0, (arg1 * 1.5 / 256.0) + 0.25); } - color = &D_8018D9B0[D_8018E118[arg0].offset]; - size = D_8018E118[arg0 + 1].offset - D_8018E118[arg0].offset; - for (var_s0 = 0; var_s0 < (u32) size; var_s0++) { + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; + size = sMenuTextureMap[arg0 + 1].offset - sMenuTextureMap[arg0].offset; + for (i = 0; i < (u32) size; i++) { red = ((*color & 0xF800) >> 0xB) * 0x55; green = ((*color & 0x7C0) >> 6) * 0x4B; blue = ((*color & 0x3E) >> 1) * 0x5F; alpha = *color & 0x1; temp_t9 = red + green + blue; - temp_t9 >>= 8; + temp_t9 /= 256; temp_t9 = sp48[temp_t9] * 32.0f; - if (temp_t9 >= 0x20) { - temp_t9 = 0x1F; + if (temp_t9 >= 32) { + temp_t9 = 31; } *color++ = (temp_t9 << 1) + (temp_t9 << 6) + (temp_t9 << 0xB) + alpha; } } -void func_8009B538(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +void adjust_img_colour(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { s32 red; s32 green; s32 blue; @@ -4158,17 +4227,17 @@ void func_8009B538(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { s32 var_v1; u16* color; - color = &D_8018D9B0[D_8018E118[arg0].offset]; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; for (var_v1 = 0; var_v1 != arg1; var_v1++) { red = ((*color & 0xF800) >> 0xB) * 0x4D; green = ((*color & 0x7C0) >> 6) * 0x96; blue = ((*color & 0x3E) >> 1) * 0x1D; alpha = *color & 0x1; temp_t9 = red + green + blue; - temp_t9 = temp_t9 >> 8; - newred = ((temp_t9 * arg2) >> 8) << 0xB; - newgreen = ((temp_t9 * arg3) >> 8) << 6; - newblue = ((temp_t9 * arg4) >> 8) << 1; + temp_t9 = temp_t9 / 256; + newred = ((temp_t9 * arg2) / 256) << 0xB; + newgreen = ((temp_t9 * arg3) / 256) << 6; + newblue = ((temp_t9 * arg4) / 256) << 1; *color++ = newred + newgreen + newblue + alpha; } } @@ -4180,35 +4249,35 @@ u16* func_8009B8C4(u64* arg0) { s32 someIndex; found = 0; - for (someIndex = 0; someIndex < gNumD_8018E118Entries; someIndex++) { - if (arg0 == D_8018E118[someIndex].textureData) { + for (someIndex = 0; someIndex < sMenuTextureEntries; someIndex++) { + if (arg0 == sMenuTextureMap[someIndex].textureData) { found = 1; - offset = D_8018E118[someIndex].offset; + offset = sMenuTextureMap[someIndex].offset; break; } } if (found != 0) { - return &D_8018D9B0[offset]; + return &gMenuTextureBuffer[offset]; } return NULL; } -// D_8018D9C0 is a little weird. In code_800AF9B0 its treated as a +// gSomeDLBuffer is a little weird. In code_800AF9B0 its treated as a // struct_8018EE10_entry pointer. But here its being treated as a // Gfx pointer. It seems to be multi use. void func_8009B938(void) { - D_8018E75C = (Gfx*) D_8018D9C0; + sGfxPtr = (Gfx*) gSomeDLBuffer; gNumD_8018E768Entries = 0; } -void func_8009B954(MkTexture* arg0) { +void func_8009B954(MenuTexture* arg0) { D_8018E768[gNumD_8018E768Entries].textures = segmented_to_virtual_dupe(arg0); - D_8018E768[gNumD_8018E768Entries].displayList = D_8018E75C; + D_8018E768[gNumD_8018E768Entries].displayList = sGfxPtr; } void func_8009B998(void) { - gSPEndDisplayList(D_8018E75C++); + gSPEndDisplayList(sGfxPtr++); gNumD_8018E768Entries += 1; } @@ -4217,7 +4286,7 @@ void func_8009B998(void) { // Based on the target assembly, in the event that it never finds // the desired entry, it'll treat the return value of segmented_to_virtual_dupe // as the return of this function. Which seems like a bug to me -Gfx* func_8009B9D0(Gfx* displayListHead, MkTexture* textures) { +Gfx* func_8009B9D0(Gfx* displayListHead, MenuTexture* textures) { Gfx* displayList; UNUSED s32 pad; bool found; @@ -4237,8 +4306,8 @@ Gfx* func_8009B9D0(Gfx* displayListHead, MkTexture* textures) { } } -Gfx* func_8009BA74(Gfx* arg0, MkTexture* arg1, s32 column, s32 row) { - MkTexture* temp_v0; +Gfx* render_menu_textures(Gfx* arg0, MenuTexture* arg1, s32 column, s32 row) { + MenuTexture* temp_v0; u8* temp_v0_3; s8 var_s4; @@ -4268,7 +4337,7 @@ Gfx* func_8009BA74(Gfx* arg0, MkTexture* arg1, s32 column, s32 row) { } temp_v0_3 = (u8*) func_8009B8C4(temp_v0->textureData); if (temp_v0_3 != 0) { - if (D_8018E7AC[4] != 4) { + if (gTransitionType[4] != 4) { arg0 = func_80095E10(arg0, var_s4, 0x00000400, 0x00000400, 0, 0, temp_v0->width, temp_v0->height, temp_v0->dX + column, temp_v0->dY + row, temp_v0_3, temp_v0->width, temp_v0->height); @@ -4282,8 +4351,8 @@ Gfx* func_8009BA74(Gfx* arg0, MkTexture* arg1, s32 column, s32 row) { return arg0; } -Gfx* func_8009BC9C(Gfx* arg0, MkTexture* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { - MkTexture* var_s0; +Gfx* func_8009BC9C(Gfx* arg0, MenuTexture* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { + MenuTexture* var_s0; u8* temp_v0_3; var_s0 = segmented_to_virtual_dupe(arg1); @@ -4298,22 +4367,22 @@ Gfx* func_8009BC9C(Gfx* arg0, MkTexture* arg1, s32 arg2, s32 arg3, s32 arg4, s32 } temp_v0_3 = (u8*) func_8009B8C4(var_s0->textureData); if (temp_v0_3 != 0) { - switch (arg4) { /* switch 1; irregular */ - case 1: /* switch 1 */ + switch (arg4) { + case 1: arg0 = func_80097AE4(arg0, 0, var_s0->dX + arg2, var_s0->dY + arg3, temp_v0_3, arg5); break; - case 2: /* switch 1 */ + case 2: arg0 = func_80097E58(arg0, 0, 0, 0U, var_s0->width, var_s0->height, var_s0->dX + arg2, var_s0->dY + arg3, temp_v0_3, var_s0->width, var_s0->height, arg5); break; - case 3: /* switch 1 */ + case 3: arg0 = func_80097A14(arg0, 0, 0, 0, var_s0->width, var_s0->height, var_s0->dX + arg2, var_s0->dY + arg3, temp_v0_3, var_s0->width, var_s0->height); break; - case 4: /* switch 1 */ + case 4: arg0 = func_80097274(arg0, 0, 0x00000400, 0x00000400, 0, 0, var_s0->width, var_s0->height, - var_s0->dX + arg2, var_s0->dY + arg3, temp_v0_3, var_s0->width, var_s0->height, - arg5); + var_s0->dX + arg2, var_s0->dY + arg3, (u16*) temp_v0_3, var_s0->width, + var_s0->height, arg5); break; } } @@ -4322,12 +4391,12 @@ Gfx* func_8009BC9C(Gfx* arg0, MkTexture* arg1, s32 arg2, s32 arg3, s32 arg4, s32 return arg0; } -Gfx* print_letter(Gfx* arg0, MkTexture* glyphTexture, f32 arg2, f32 arg3, s32 mode, f32 scaleX, f32 scaleY) { +Gfx* print_letter(Gfx* arg0, MenuTexture* glyphTexture, f32 arg2, f32 arg3, s32 mode, f32 scaleX, f32 scaleY) { s32 var_v0; u8* temp_v0_2; f32 thing0; f32 thing1; - MkTexture* var_s0; + MenuTexture* var_s0; var_s0 = segmented_to_virtual_dupe(glyphTexture); while (var_s0->textureData != NULL) { @@ -4374,15 +4443,15 @@ Gfx* print_letter(Gfx* arg0, MkTexture* glyphTexture, f32 arg2, f32 arg3, s32 mo return arg0; } -Gfx* func_8009C204(Gfx* arg0, MkTexture* arg1, s32 arg2, s32 arg3, s32 arg4) { +Gfx* func_8009C204(Gfx* arg0, MenuTexture* arg1, s32 arg2, s32 arg3, s32 arg4) { s32 var_s2; u8* temp_t0; - MkTexture* var_s1; + MenuTexture* var_s1; var_s1 = segmented_to_virtual_dupe(arg1); while (var_s1->textureData != NULL) { var_s2 = 0; - switch (var_s1->type) { /* irregular */ + switch (var_s1->type) { case 0: gSPDisplayList(arg0++, D_02007708); break; @@ -4398,13 +4467,13 @@ Gfx* func_8009C204(Gfx* arg0, MkTexture* arg1, s32 arg2, s32 arg3, s32 arg4) { break; } temp_t0 = (u8*) func_8009B8C4(var_s1->textureData); - switch (arg4) { /* switch 1; irregular */ - case 2: /* switch 1 */ + switch (arg4) { + case 2: arg0 = func_800963F0(arg0, var_s2, 0x00000400, 0x00000400, 0.5f, 0.5f, 0, 0, var_s1->width, var_s1->height, var_s1->dX + arg2, var_s1->dY + arg3, temp_t0, var_s1->width, var_s1->height); break; - case 3: /* switch 1 */ + case 3: arg0 = func_800963F0(arg0, var_s2, 0x00000400, 0x00000400, 0.457f, 0.5f, 0, 0, var_s1->width, var_s1->height, var_s1->dX + arg2, var_s1->dY + arg3, temp_t0, var_s1->width, var_s1->height); @@ -4419,7 +4488,7 @@ Gfx* func_8009C434(Gfx* arg0, struct_8018DEE0_entry* arg1, s32 arg2, s32 arg3, s s32 var_t0; s32 var_t1; Gfx* temp; - MkTexture* var_s0; + MenuTexture* var_s0; var_s0 = segmented_to_virtual_dupe(arg1->textureSequence[arg1->sequenceIndex].mk64Texture); temp = D_02007728; @@ -4441,9 +4510,9 @@ Gfx* func_8009C434(Gfx* arg0, struct_8018DEE0_entry* arg1, s32 arg2, s32 arg3, s break; } if (arg1->unk14 != 0) { - var_t0 = D_8018E118[arg1->D_8018E118_index + 1].offset; + var_t0 = sMenuTextureMap[arg1->menuTextureIndex + 1].offset; } else { - var_t0 = D_8018E118[arg1->D_8018E118_index].offset; + var_t0 = sMenuTextureMap[arg1->menuTextureIndex].offset; if (1) {} if (1) {} if (1) {} @@ -4451,18 +4520,18 @@ Gfx* func_8009C434(Gfx* arg0, struct_8018DEE0_entry* arg1, s32 arg2, s32 arg3, s if (arg4 >= 0) { arg0 = func_80097E58(arg0, var_t1, 0, 0U, var_s0->width, var_s0->height, var_s0->dX + arg2, var_s0->dY + arg3, - (u8*) &D_8018D9B0[var_t0], var_s0->width, var_s0->height, (u32) arg4); + (u8*) &gMenuTextureBuffer[var_t0], var_s0->width, var_s0->height, (u32) arg4); } else { switch (arg4) { case -1: arg0 = func_80095E10(arg0, var_t1, 0x00000400, 0x00000400, 0, 0, var_s0->width, var_s0->height, - var_s0->dX + arg2, var_s0->dY + arg3, (u8*) &D_8018D9B0[var_t0], var_s0->width, - var_s0->height); + var_s0->dX + arg2, var_s0->dY + arg3, (u8*) &gMenuTextureBuffer[var_t0], + var_s0->width, var_s0->height); break; case -2: arg0 = func_800963F0(arg0, var_t1, 0x00000400, 0x00000400, 0.5f, 0.5f, 0, 0, var_s0->width, var_s0->height, var_s0->dX + arg2, var_s0->dY + arg3, - (u8*) &D_8018D9B0[var_t0], var_s0->width, var_s0->height); + (u8*) &gMenuTextureBuffer[var_t0], var_s0->width, var_s0->height); break; } } @@ -4475,7 +4544,7 @@ Gfx* func_8009C708(Gfx* arg0, struct_8018DEE0_entry* arg1, s32 arg2, s32 arg3, s s32 var_t0; UNUSED s32 thing; Gfx* temp; - MkTexture* var_s1; + MenuTexture* var_s1; var_s1 = segmented_to_virtual_dupe(arg1->textureSequence[arg1->sequenceIndex].mk64Texture); temp = D_02007728; @@ -4537,17 +4606,17 @@ void func_8009CA2C(void) { void func_8009CA6C(s32 arg0) { s32 var_a1; - if ((arg0 == 4) || ((find_8018D9E0_entry(0x000000AA) == NULL) && (find_8018D9E0_entry(0x000000AB) == NULL) && - (find_8018D9E0_entry(0x000000B9) == NULL) && (find_8018D9E0_entry(0x000000BA) == NULL) && - (find_8018D9E0_entry(0x000000AC) == NULL) && (find_8018D9E0_entry(0x000000B0) == NULL))) { + if ((arg0 == 4) || ((find_menu_items(0x000000AA) == NULL) && (find_menu_items(0x000000AB) == NULL) && + (find_menu_items(0x000000B9) == NULL) && (find_menu_items(0x000000BA) == NULL) && + (find_menu_items(0x000000AC) == NULL) && (find_menu_items(0x000000B0) == NULL))) { var_a1 = 0; gSPDisplayList(gDisplayListHead++, D_0D0076F8); if ((arg0 != 4) && (gIsGamePaused != 0)) { var_a1 = 1; } - switch (D_8018E7AC[arg0]) { + switch (gTransitionType[arg0]) { case 1: - func_8009CDDC(arg0, var_a1); + draw_black_fade_in(arg0, var_a1); return; case 2: func_8009D958(arg0, var_a1); @@ -4565,7 +4634,7 @@ void func_8009CA6C(s32 arg0) { func_8009D978(arg0, var_a1); return; case 8: - func_8009CDFC(arg0, var_a1); + draw_white_fade_in(arg0, var_a1); break; case 0: default: @@ -4574,7 +4643,7 @@ void func_8009CA6C(s32 arg0) { } } -void func_8009CBE4(s32 arg0, s32 arg1, s32 arg2) { +void draw_fade_in(s32 arg0, s32 arg1, s32 arg2) { RGBA16* color; s16 x, y, w, h; UNUSED s32 pad[3]; @@ -4603,25 +4672,27 @@ void func_8009CBE4(s32 arg0, s32 arg1, s32 arg2) { h = unk->screenHeight; } color = &D_800E7AE8[arg2]; - gDisplayListHead = draw_box(gDisplayListHead, x - (w / 2), y - (h / 2), (w / 2) + x, (h / 2) + y, color->red, - color->green, color->blue, 0xFF - (D_8018E7D0[arg0] * 0xFF / D_8018E7B8[arg0])); + gDisplayListHead = + draw_box(gDisplayListHead, x - (w / 2), y - (h / 2), (w / 2) + x, (h / 2) + y, color->red, color->green, + color->blue, 0xFF - (gCurrentTransitionTime[arg0] * 0xFF / gTransitionDuration[arg0])); - if ((arg1 == 0) && (D_8018E7D0[arg0] += 1, (D_8018E7D0[arg0] >= D_8018E7B8[arg0]))) { - if (gGamestate == 4) { - D_8018E7AC[arg0] = 6; + if ((arg1 == 0) && + (gCurrentTransitionTime[arg0] += 1, (gCurrentTransitionTime[arg0] >= gTransitionDuration[arg0]))) { + if (gGamestate == RACING) { + gTransitionType[arg0] = 6; return; } - D_8018E7AC[arg0] = 0; - D_8018EE0C = 0; + gTransitionType[arg0] = 0; + unref_8018EE0C = 0; } } -void func_8009CDDC(s32 arg0, s32 arg1) { - func_8009CBE4(arg0, arg1, 0); +void draw_black_fade_in(s32 arg0, s32 arg1) { + draw_fade_in(arg0, arg1, 0); } -void func_8009CDFC(s32 arg0, s32 arg1) { - func_8009CBE4(arg0, arg1, 1); +void draw_white_fade_in(s32 arg0, s32 arg1) { + draw_fade_in(arg0, arg1, 1); } void func_8009CE1C(void) { @@ -4634,7 +4705,7 @@ void func_8009CE64(s32 arg0) { s32 thing; s32 var_a1; UNUSED s32 stackPadding0; - struct_8018D9E0_entry* temp_v0; + MenuItem* temp_v0; var_a1 = 0; if (gGamestate == 5) { @@ -4657,16 +4728,16 @@ void func_8009CE64(s32 arg0) { gGotoMenu = 1; gMenuSelection = 0x0000000B; } - } else if (gGamestate == 4) { - if (D_8018E7AC[arg0] == 2) { + } else if (gGamestate == RACING) { + if (gTransitionType[arg0] == 2) { if (arg0 != 4) { - D_8018E7AC[arg0] = 5; + gTransitionType[arg0] = 5; } else { var_a1 = 0; - temp_v0 = find_8018D9E0_entry(0x000000B0); + temp_v0 = find_menu_items(0x000000B0); if (temp_v0 != NULL) { - switch (temp_v0->cursor) { /* switch 8; irregular */ - case 10: /* switch 8 */ + switch (temp_v0->state) { /* switch 8; irregular */ + case 10: /* switch 8 */ func_802903B0(); break; case 11: /* switch 8 */ @@ -4682,10 +4753,10 @@ void func_8009CE64(s32 arg0) { } } else { var_a1 = 0; - temp_v0 = find_8018D9E0_entry(0x000000AC); + temp_v0 = find_menu_items(0x000000AC); if (temp_v0 != NULL) { - switch (temp_v0->cursor) { /* switch 7; irregular */ - case 11: /* switch 7 */ + switch (temp_v0->state) { /* switch 7; irregular */ + case 11: /* switch 7 */ func_802903B0(); D_8016556E = 1; break; @@ -4696,44 +4767,44 @@ void func_8009CE64(s32 arg0) { } } else { var_a1 = 0; - temp_v0 = find_8018D9E0_entry(0x000000C7); + temp_v0 = find_menu_items(0x000000C7); if (temp_v0 != NULL) { - switch (temp_v0->cursor) { /* switch 1 */ - case 12: /* switch 1 */ + switch (temp_v0->state) { + case 12: func_802903B0(); var_a1 = 1; break; - case 13: /* switch 1 */ - case 22: /* switch 1 */ - case 42: /* switch 1 */ + case 13: + case 22: + case 42: func_80290388(); var_a1 = 1; break; - case 14: /* switch 1 */ - case 23: /* switch 1 */ - case 43: /* switch 1 */ + case 14: + case 23: + case 43: func_80290360(); var_a1 = 1; break; - case 15: /* switch 1 */ - case 24: /* switch 1 */ - case 32: /* switch 1 */ - case 44: /* switch 1 */ + case 15: + case 24: + case 32: + case 44: func_80290338(); var_a1 = 1; break; - default: /* switch 1 */ - D_8018E7AC[arg0] = 5; + default: + gTransitionType[arg0] = 5; break; } if (var_a1 != 0) { gIsGamePaused = 0; } } - temp_v0 = find_8018D9E0_entry(0x000000BD); + temp_v0 = find_menu_items(0x000000BD); if (temp_v0 != NULL) { - switch (temp_v0->cursor) { /* switch 2 */ - case 11: /* switch 2 */ + switch (temp_v0->state) { /* switch 2 */ + case 11: /* switch 2 */ D_8015F892 = 1; D_8015F890 = 0; func_802903B0(); @@ -4762,35 +4833,35 @@ void func_8009CE64(s32 arg0) { break; } } else { - D_8018E7AC[arg0] = 5; + gTransitionType[arg0] = 5; } } } } } } else { - D_8018E7AC[arg0] = 0; - if (gDebugMenuSelection != 0x40) { - switch (D_8018EDE0) { /* switch 3 */ - case 0: /* switch 3 */ - if (gMenuSelection == 8) { - gMenuSelection = 0x0000000A; - D_800E86A4 = 2; + gTransitionType[arg0] = 0; + if (gDebugMenuSelection != DEBUG_MENU_OPTION_SELECTED) { + switch (gMenuFadeType) { /* switch 3 */ + case MENU_FADE_TYPE_MAIN: /* switch 3 */ + if (gMenuSelection == LOGO_INTRO_MENU) { + gMenuSelection = START_MENU; + gFadeModeSelection = FADE_MODE_LOGO; } else { gMenuSelection++; } break; - case 1: /* switch 3 */ + case MENU_FADE_TYPE_BACK: /* switch 3 */ gMenuSelection -= 1; break; - case 2: /* switch 3 */ + case MENU_FADE_TYPE_DEMO: /* switch 3 */ gDemoMode = 1; - D_8018EE08 = 1; + gDemoUseController = 1; gGamestateNext = 4; gCCSelection = (s32) 1; switch (gNextDemoId) { /* switch 4 */ case 0: /* switch 4 */ - gCurrentCourseId = 0; + gCurrentCourseId = COURSE_MARIO_RACEWAY; gScreenModeSelection = 0; gPlayerCountSelection1 = 1; gPlayerCount = 1; @@ -4798,7 +4869,7 @@ void func_8009CE64(s32 arg0) { gModeSelection = 0; break; case 1: /* switch 4 */ - gCurrentCourseId = (s16) 1; + gCurrentCourseId = COURSE_CHOCO_MOUNTAIN; gScreenModeSelection = (s32) 1; gPlayerCountSelection1 = 2; gPlayerCount = (s8) 2; @@ -4807,7 +4878,7 @@ void func_8009CE64(s32 arg0) { gModeSelection = 2; break; case 2: /* switch 4 */ - gCurrentCourseId = 0x000B; + gCurrentCourseId = COURSE_KALAMARI_DESERT; gScreenModeSelection = 0; gPlayerCountSelection1 = (s32) 1; gPlayerCount = 1; @@ -4815,7 +4886,7 @@ void func_8009CE64(s32 arg0) { gModeSelection = 0; break; case 3: /* switch 4 */ - gCurrentCourseId = 0x000E; + gCurrentCourseId = COURSE_WARIO_STADIUM; gScreenModeSelection = 3; gPlayerCountSelection1 = 3; gPlayerCount = (s8) 3; @@ -4825,7 +4896,7 @@ void func_8009CE64(s32 arg0) { gModeSelection = (s32) 2; break; case 4: /* switch 4 */ - gCurrentCourseId = 2; + gCurrentCourseId = COURSE_BOWSER_CASTLE; gScreenModeSelection = 0; gPlayerCountSelection1 = (s32) 1; gPlayerCount = 1; @@ -4833,7 +4904,7 @@ void func_8009CE64(s32 arg0) { gModeSelection = 0; break; case 5: /* switch 4 */ - gCurrentCourseId = 0x000C; + gCurrentCourseId = COURSE_SHERBET_LAND; gScreenModeSelection = 3; gPlayerCountSelection1 = 4; gPlayerCount = 4; @@ -4854,7 +4925,7 @@ void func_8009CE64(s32 arg0) { D_800DC540 = (s32) gCupSelection; gCourseIndexInCup = (s8) gPerCupIndexByCourseId[gCurrentCourseId]; break; - case 3: /* switch 3 */ + case MENU_FADE_TYPE_DATA: /* switch 3 */ switch (gMenuSelection) { case 11: gMenuSelection = 6; @@ -4864,7 +4935,7 @@ void func_8009CE64(s32 arg0) { break; } break; - case 4: /* switch 3 */ + case MENU_FADE_TYPE_OPTION: /* switch 3 */ switch (gMenuSelection) { case 11: gMenuSelection = 5; @@ -4875,31 +4946,31 @@ void func_8009CE64(s32 arg0) { } break; } - if (D_800E86A4 == 0) { - D_800E86A4 = 1; + if (gFadeModeSelection == FADE_MODE_NONE) { + gFadeModeSelection = FADE_MODE_MAIN; } if (gMenuSelection >= 0xE) { gGamestateNext = 4; if (gModeSelection == 1) { - D_8018EDFB = (s8) 1; + gGhostPlayerInit = (s8) 1; } func_8009CE1C(); } - D_8018EE0C = 0; + unref_8018EE0C = 0; } else { - switch (gDebugGotoScene) { /* switch 5; irregular */ - case 1: /* switch 5 */ + switch (gDebugGotoScene) { /* switch 5; irregular */ + case DEBUG_GOTO_ENDING: /* switch 5 */ gGamestateNext = (s32) 5; break; - case 2: /* switch 5 */ - case 3: /* switch 5 */ + case DEBUG_GOTO_CREDITS_SEQUENCE_DEFAULT: /* switch 5 */ + case DEBUG_GOTO_CREDITS_SEQUENCE_EXTRA: /* switch 5 */ gGamestateNext = 9; gCreditsCourseId = 8; break; default: /* switch 5 */ gGamestateNext = 4; if (gModeSelection == (s32) 1) { - D_8018EDFB = 1; + gGhostPlayerInit = 1; } break; } @@ -4935,13 +5006,13 @@ void func_8009CE64(s32 arg0) { gCupSelection = gCupSelectionByCourseId[gCurrentCourseId]; D_800DC540 = gCupSelection; gCourseIndexInCup = gPerCupIndexByCourseId[gCurrentCourseId]; - switch (gDebugGotoScene) { /* switch 6; irregular */ - case 1: /* switch 6 */ + switch (gDebugGotoScene) { /* switch 6; irregular */ + case DEBUG_GOTO_ENDING: /* switch 6 */ break; - case 2: /* switch 6 */ + case DEBUG_GOTO_CREDITS_SEQUENCE_DEFAULT: /* switch 6 */ gCCSelection = 0; break; - case 3: /* switch 6 */ + case DEBUG_GOTO_CREDITS_SEQUENCE_EXTRA: /* switch 6 */ gCCSelection = 3; break; default: /* switch 6 */ @@ -4985,7 +5056,7 @@ void func_8009D77C(s32 arg0, s32 arg1, s32 arg2) { var_ra = D_8015F480[arg0].screenWidth; sp44 = D_8015F480[arg0].screenHeight; } - var_t2 = (D_8018E7D0[arg0] * 0xFF) / D_8018E7B8[arg0]; + var_t2 = (gCurrentTransitionTime[arg0] * 0xFF) / gTransitionDuration[arg0]; if (var_t2 >= 0x100) { var_t2 = 0x000000FF; } @@ -5000,8 +5071,8 @@ void func_8009D77C(s32 arg0, s32 arg1, s32 arg2) { gDisplayListHead = draw_box(gDisplayListHead, var_t3 - temp_v1, var_t4 - temp_t8, someMath0, someMath1, temp_v0_2->red, temp_v0_2->green, temp_v0_2->blue, var_t2); if (arg1 == 0) { - D_8018E7D0[arg0]++; - if ((D_8018E7B8[arg0] + 1) < D_8018E7D0[arg0]) { + gCurrentTransitionTime[arg0]++; + if ((gTransitionDuration[arg0] + 1) < gCurrentTransitionTime[arg0]) { func_8009CE64(arg0); } } @@ -5055,12 +5126,12 @@ void func_8009D998(s32 arg0) { void func_8009DAA8(void) { u32 var_t0; - D_8018E7D0[4]++; - if (D_8018E7D0[4] >= (D_8018E7B8[4] + 1)) { + gCurrentTransitionTime[4]++; + if (gCurrentTransitionTime[4] >= (gTransitionDuration[4] + 1)) { func_8009CE64(4); } gDPPipeSync(gDisplayListHead++); - var_t0 = (D_8018E7D0[4] * 255) / D_8018E7B8[4]; + var_t0 = (gCurrentTransitionTime[4] * 255) / gTransitionDuration[4]; if ((s32) var_t0 >= 0x100) { var_t0 = 0x000000FF; } @@ -5074,13 +5145,13 @@ void func_8009DB8C(void) { u32 var_s3; s32 var_v1; - D_8018E7D0[4]++; + gCurrentTransitionTime[4]++; // why? - var_v1 = D_8018E7D0[4]; - if ((u32) var_v1 >= D_8018E7B8[4]) { - if ((u32) var_v1 == D_8018E7B8[4]) { + var_v1 = gCurrentTransitionTime[4]; + if ((u32) var_v1 >= gTransitionDuration[4]) { + if ((u32) var_v1 == gTransitionDuration[4]) { for (var_s0 = 0; var_s0 < 0x4B0; var_s0++) { - D_8018D9B8[var_s0] = 1; + sTKMK00_LowResBuffer[var_s0] = 1; } } else { func_8009CE64(4); @@ -5088,10 +5159,11 @@ void func_8009DB8C(void) { } else { var_s0 = 0; var_s3 = 0; - while (var_s3 < (0x4B0U / D_8018E7B8[4])) { - if ((D_8018D9B8[var_s0] == 0) && (random_int((0x4B0U - D_8018E7D0[4]) / D_8018E7B8[4]) == 0)) { + while (var_s3 < (0x4B0U / gTransitionDuration[4])) { + if ((sTKMK00_LowResBuffer[var_s0] == 0) && + (random_int((0x4B0U - gCurrentTransitionTime[4]) / gTransitionDuration[4]) == 0)) { var_s3 += 1; - D_8018D9B8[var_s0] = 1; + sTKMK00_LowResBuffer[var_s0] = 1; } var_s0 += 1; if (var_s0 >= 0x4B0) { @@ -5104,14 +5176,14 @@ void func_8009DB8C(void) { gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, 0xFF); gDPSetCombineMode(gDisplayListHead++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); for (var_s0 = 0; var_s0 < 0x4B0; var_s0++) { - if (D_8018D9B8[var_s0] != 0) { + if (sTKMK00_LowResBuffer[var_s0] != 0) { temp_t4 = (var_s0 % 40) * 8; temp_t5 = (var_s0 / 40) * 8; gDPFillRectangle(gDisplayListHead++, temp_t4, temp_t5, temp_t4 + 8, temp_t5 + 8); } } gDPPipeSync(gDisplayListHead++); - var_v1 = (D_8018E7D0[4] * 255) / D_8018E7B8[4]; + var_v1 = (gCurrentTransitionTime[4] * 255) / gTransitionDuration[4]; if (var_v1 >= 0x100) { var_v1 = 0x000000FF; } @@ -5122,11 +5194,11 @@ void func_8009DEF8(u32 arg0, u32 arg1) { if (arg0 == 0) { arg0 = 1; } - if ((D_8018E7AC[4] != 1) && (D_8018E7AC[4] != 6)) { - D_8018E7AC[4] = arg1; - D_8018E7B8[4] = arg0; - if (D_8018E7B8[4] >= 0x100U) { - D_8018E7B8[4] = 0xFFU; + if ((gTransitionType[4] != 1) && (gTransitionType[4] != 6)) { + gTransitionType[4] = arg1; + gTransitionDuration[4] = arg0; + if (gTransitionDuration[4] >= 0x100U) { + gTransitionDuration[4] = 0xFFU; } D_8018E7E0 = 0; } @@ -5144,11 +5216,11 @@ void func_8009DF8C(u32 arg0, u32 arg1) { if (arg0 == 0) { arg0 = 1; } - if ((D_8018E7AC[4] != 2) && (D_8018E7AC[4] != 5)) { - D_8018E7AC[4] = arg1; - D_8018E7B8[4] = arg0; - if (D_8018E7B8[4] >= 0x100U) { - D_8018E7B8[4] = 0xFFU; + if ((gTransitionType[4] != 2) && (gTransitionType[4] != 5)) { + gTransitionType[4] = arg1; + gTransitionDuration[4] = arg0; + if (gTransitionDuration[4] >= 0x100U) { + gTransitionDuration[4] = 0xFFU; } D_8018E7E0 = 0; } @@ -5169,14 +5241,14 @@ void func_8009E020(s32 arg0, s32 arg1) { arg1 = 1; } - temp = D_8018E7AC[arg0]; + temp = gTransitionType[arg0]; if ((temp != 1) && (temp != 6)) { - D_8018E7AC[arg0] = 1; - D_8018E7B8[arg0] = arg1; + gTransitionType[arg0] = 1; + gTransitionDuration[arg0] = arg1; if ((u32) arg1 >= 0x100U) { - D_8018E7B8[arg0] = 0xFF; + gTransitionDuration[arg0] = 0xFF; } - D_8018E7D0[arg0] = 0; + gCurrentTransitionTime[arg0] = 0; } } @@ -5187,39 +5259,39 @@ void func_8009E088(s32 arg0, s32 arg1) { arg1 = 1; } - temp = D_8018E7AC[arg0]; + temp = gTransitionType[arg0]; if ((temp != 2) && (temp != 5)) { - D_8018E7AC[arg0] = 2; - D_8018E7B8[arg0] = arg1; + gTransitionType[arg0] = 2; + gTransitionDuration[arg0] = arg1; if ((u32) arg1 >= 0x100U) { - D_8018E7B8[arg0] = 0xFF; + gTransitionDuration[arg0] = 0xFF; } - D_8018E7D0[arg0] = 0; + gCurrentTransitionTime[arg0] = 0; } } void func_8009E0F0(s32 arg0) { s32 var_v0; - if (D_8018E7AC[4] != 3) { - D_8018E7AC[4] = 3; - D_8018E7B8[4] = arg0; - if (D_8018E7B8[4] >= 0x100U) { - D_8018E7B8[4] = 0x000000FF; + if (gTransitionType[4] != 3) { + gTransitionType[4] = 3; + gTransitionDuration[4] = arg0; + if (gTransitionDuration[4] >= 0x100U) { + gTransitionDuration[4] = 0x000000FF; } D_8018E7E0 = 0; for (var_v0 = 0; var_v0 < 0x4B0; var_v0++) { - D_8018D9B8[var_v0] = 0; + sTKMK00_LowResBuffer[var_v0] = 0; } } } void func_8009E17C(u32 arg0) { - if (D_8018E7AC[4] != 4) { - D_8018E7AC[4] = 4; - D_8018E7B8[4] = arg0; - if (D_8018E7B8[4] >= 0x100U) { - D_8018E7B8[4] = 0x000000FFU; + if (gTransitionType[4] != 4) { + gTransitionType[4] = 4; + gTransitionDuration[4] = arg0; + if (gTransitionDuration[4] >= 0x100U) { + gTransitionDuration[4] = 0x000000FFU; } D_8018E7E0 = 0; } @@ -5227,32 +5299,32 @@ void func_8009E17C(u32 arg0) { void func_8009E1C0(void) { func_8009DFE0(10); - D_8018EDE0 = 0; + gMenuFadeType = MENU_FADE_TYPE_MAIN; } void func_8009E1E4(void) { func_8009E000(10); - D_8018EDE0 = 0; + gMenuFadeType = MENU_FADE_TYPE_MAIN; } void func_8009E208(void) { func_8009DFE0(10); - D_8018EDE0 = 1; + gMenuFadeType = MENU_FADE_TYPE_BACK; } void func_8009E230(void) { func_8009DFE0(10); - D_8018EDE0 = 2; + gMenuFadeType = MENU_FADE_TYPE_DEMO; } void func_8009E258(void) { func_8009DFE0(10); - D_8018EDE0 = 3; + gMenuFadeType = MENU_FADE_TYPE_DATA; } void func_8009E280(void) { func_8009DFE0(10); - D_8018EDE0 = 4; + gMenuFadeType = MENU_FADE_TYPE_OPTION; } void func_8009E2A8(s32 arg0) { @@ -5314,251 +5386,243 @@ void func_8009E5FC(s32 arg0) { D_8018E840[arg0] = 0; } -void func_8009E620(void) { +void clear_menus(void) { s32 index; - for (index = 0; index < D_8018D9E0_SIZE; index++) { - D_8018D9E0[index].type = 0; + for (index = 0; index < ARRAY_COUNT(gMenuItems); index++) { + gMenuItems[index].type = 0; } } -#ifdef NON_MATCHING -// https://decomp.me/scratch/1BHpa -// Stack differences, can't figure out how to fix them -void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { - struct_8018D9E0_entry* var_ra; - s32 stackPadding0; - UNUSED s32 stackPadding1; - UNUSED s32 stackPadding2; - s32 temp_v0_6; - s32 var_v0; - s32 var_v1_3; - s32 temp_a1; - UNUSED MkTexture* mk64Texture; +void add_menu_item(s32 type, s32 column, s32 row, s8 priority) { + MenuItem* menuItem; + s8 temp_a1; + s32 i; MkAnimation* var_a0; - s32 one = 1; - var_v0 = 0; - var_ra = D_8018D9E0; - // ???????? - // Credit to Vetri for the idea to mess around with this loop - // to fix the issue near the 0xD4 case - while (1 & 0xFFFFFFFFFFFFFFFF) { - var_v0++; - if (var_ra->type == 0) - break; - - if (var_v0 > 0x20) { - while (1) {} - } - var_ra++; - } - var_ra->type = type; - var_ra->cursor = 0; - var_ra->unk8 = 0; - var_ra->column = column; - var_ra->row = row; - var_ra->priority = (u8) priority; - var_ra->visible = one; - var_ra->unk1C = 0; - var_ra->unk20 = 0; + i = 0; + menuItem = gMenuItems; + while (true) { + if (menuItem->type == 0) { + break; + } + i++; + if (i > ARRAY_COUNT(gMenuItems)) { + while (true) {} + } + menuItem++; + } + menuItem->type = type; + menuItem->state = 0; + menuItem->subState = 0; + menuItem->column = column; + menuItem->row = row; + menuItem->priority = priority; + menuItem->visible = 1; + menuItem->param1 = 0; + menuItem->param2 = 0; switch (type) { - case 0xFA: - s8018ED94 = 0; - D_800E8530 = 0.0f; - D_800E8534 = 3.0f; - D_8018EDC0 = 0x000009C4; - D_8018EDC8 = 0; - D_8018EDCC = -270.0f; - D_8018EDD0 = 0; - D_8018EDD4 = 0; - D_8018EDD8 = 0; - D_8018EDDC = 0; - D_8018EDC4 = 3; - var_ra->unk1C = -1; - var_ra->unk20 = one; - break; - case 0xFB: - D_8018EDC0 = 0x00000708; - D_8018EDC8 = -51.0f; - D_8018EDCC = -12.0f; - D_8018EDD0 = -18.0f; - D_8018EDD4 = -270.0f; - D_8018EDD8 = 750.0f; - D_8018EDDC = 0; - D_8018EDC4 = 1.0f; - var_ra->unk1C = -1; - var_ra->unk20 = one; - break; - case 0xD2: - func_800996BC(D_020014C8, 0); + case MENU_ITEM_UI_LOGO_INTRO: + sIntroModelTimer = 0; + sIntroModelMotionSpeed = 0; + sIntroModelSpeed = 3.0f; + gIntroModelZEye = 2500; + gIntroModelRotX = 0.0f; + gIntroModelRotY = -270.0f; + gIntroModelRotZ = 0.0f; + gIntroModelPosX = 0.0f; + gIntroModelPosY = 0.0f; + gIntroModelPosZ = 0.0f; + gIntroModelScale = 3; + menuItem->param1 = -1; + menuItem->param2 = 1; + break; + case START_MENU_FLAG: + gIntroModelZEye = 1800; + gIntroModelRotX = -51.0f; + gIntroModelRotY = -12.0f; + gIntroModelRotZ = -18.0f; + gIntroModelPosX = -270.0f; + gIntroModelPosY = 750.0f; + gIntroModelPosZ = 0.0f; + gIntroModelScale = 1.0f; + menuItem->param1 = -1; + menuItem->param2 = 1; + break; + case MENU_ITEM_TYPE_0D2: + load_menu_img_comp_type(D_020014C8, LOAD_MENU_IMG_TKMK00_ONCE); func_8009B954(D_020014C8); - D_8018E75C = func_8009BA74(D_8018E75C, D_020014C8, var_ra->column, var_ra->row); + sGfxPtr = render_menu_textures(sGfxPtr, D_020014C8, menuItem->column, menuItem->row); func_8009B998(); break; - case 0xD3: - func_800996BC(D_02001540, 0); + case MENU_ITEM_TYPE_0D3: + load_menu_img_comp_type(D_02001540, LOAD_MENU_IMG_TKMK00_ONCE); func_8009B954(D_02001540); - D_8018E75C = func_8009BA74(D_8018E75C, D_02001540, var_ra->column, var_ra->row); + sGfxPtr = render_menu_textures(sGfxPtr, D_02001540, menuItem->column, menuItem->row); func_8009B998(); break; - case 0xD4: - func_800996BC(D_0200157C, 0); - func_80099184(D_02001874); - var_ra->row = 0x00000069; - for (var_v0 = 0; var_v0 < 133; var_v0++) { - func_80099184(segmented_to_virtual_dupe(D_800E7AF8[var_v0])); + case MENU_ITEM_TYPE_0D4: + load_menu_img_comp_type(D_0200157C, LOAD_MENU_IMG_TKMK00_ONCE); + load_menu_img(D_02001874); + menuItem->row = 0x69; + for (i = 0; i < 133; i++) { + load_menu_img(segmented_to_virtual_dupe(D_800E7AF8[i])); } break; - case 0xD5: - func_80099184(D_020015A4); + case MENU_ITEM_TYPE_0D5: + load_menu_img(D_020015A4); func_8009B954(D_020015A4); - D_8018E75C = func_8009BA74(D_8018E75C, D_020015A4, var_ra->column, var_ra->row); - gDPLoadTextureBlock(D_8018E75C++, func_8009B8C4(gTexture7ED50C), G_IM_FMT_IA, G_IM_SIZ_16b, 256, 5, 0, + sGfxPtr = render_menu_textures(sGfxPtr, D_020015A4, menuItem->column, menuItem->row); + gDPLoadTextureBlock(sGfxPtr++, func_8009B8C4(gTexture7ED50C), G_IM_FMT_IA, G_IM_SIZ_16b, 256, 5, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(D_8018E75C++, 0x80, 0x2C0, 0x480, 0x2D4, G_TX_RENDERTILE, 0, 0x80, 0x0400, 0xFC00); + gSPTextureRectangle(sGfxPtr++, 0x80, 0x2C0, 0x480, 0x2D4, G_TX_RENDERTILE, 0, 0x80, 0x0400, 0xFC00); func_8009B998(); - func_80099184(D_020015CC); + load_menu_img(D_020015CC); func_8009B954(D_020015CC); - D_8018E75C = func_8009BA74(D_8018E75C, D_020015CC, var_ra->column, var_ra->row); + sGfxPtr = render_menu_textures(sGfxPtr, D_020015CC, menuItem->column, menuItem->row); func_8009B998(); - func_80099184(D_02001630); + load_menu_img(D_02001630); func_8009B954(D_02001630); - D_8018E75C = func_8009BA74(D_8018E75C, D_02001630, var_ra->column, var_ra->row); + sGfxPtr = render_menu_textures(sGfxPtr, D_02001630, menuItem->column, menuItem->row); func_8009B998(); - func_80099184(D_02001658); + load_menu_img(D_02001658); func_8009B954(D_02001658); - D_8018E75C = func_8009BA74(D_8018E75C, D_02001658, var_ra->column, var_ra->row); + sGfxPtr = render_menu_textures(sGfxPtr, D_02001658, menuItem->column, menuItem->row); func_8009B998(); break; - case 0xD6: - var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E7D34[0])); + case MENU_ITEM_TYPE_0D6: + menuItem->D_8018DEE0_index = animate_character_select_menu(segmented_to_virtual_dupe_2(D_800E7D34[0])); break; - case 0xD7: - for (var_v0 = 0; var_v0 < 10; var_v0++) { - func_80099184(segmented_to_virtual_dupe(D_800E7D0C[var_v0])); + case MENU_ITEM_TYPE_0D7: + for (i = 0; i < 10; i++) { + load_menu_img(segmented_to_virtual_dupe(D_800E7D0C[i])); } break; - case 0xD8: - case 0xD9: - func_80099184(D_0200184C); + case MENU_ITEM_TYPE_0D8: + case MENU_ITEM_TYPE_0D9: + load_menu_img(D_0200184C); break; - case 0x1: - func_800996BC(D_800E7D4C[func_800B555C()], 0); + case MENU_ITEM_UI_START_BACKGROUND: + load_menu_img_comp_type(gMenuTexturesBackground[has_unlocked_extra_mode()], LOAD_MENU_IMG_TKMK00_ONCE); break; - case 0x2: - func_8006EE44(); - gD_8018E118TotalSize += 0x10000; - func_80099184(D_020045E8); + case MENU_ITEM_UI_LOGO_AND_COPYRIGHT: + load_mario_kart_64_logo(); + sMenuTextureBufferIndex += 0x10000; + load_menu_img(seg2_copyright_1996_texture); break; - case 0x3: - func_80099184(D_02004610); + case MENU_ITEM_UI_PUSH_START_BUTTON: + load_menu_img(seg2_push_start_button_texture); break; - case 0x23: - case 0x24: - case 0x25: - func_800996BC(D_800E7D4C[func_800B555C()], 0); - func_800996BC(D_02004B74, 0); - func_8009B0A4(0, 0x00000019); - func_8009B538(0, SCREEN_WIDTH * SCREEN_HEIGHT, D_800E74E8[type - 0x23].red, D_800E74E8[type - 0x23].green, - D_800E74E8[type - 0x23].blue); + case MAIN_MENU_BACKGROUND: + case CHARACTER_SELECT_BACKGROUND: + case COURSE_SELECT_BACKGROUND: + load_menu_img_comp_type(gMenuTexturesBackground[has_unlocked_extra_mode()], LOAD_MENU_IMG_TKMK00_ONCE); + load_menu_img_comp_type(D_02004B74, LOAD_MENU_IMG_TKMK00_ONCE); + convert_img_to_greyscale(0, 0x00000019); + adjust_img_colour(0, SCREEN_WIDTH * SCREEN_HEIGHT, gBackgroundColor[type - MAIN_MENU_BACKGROUND].red, + gBackgroundColor[type - MAIN_MENU_BACKGROUND].green, + gBackgroundColor[type - MAIN_MENU_BACKGROUND].blue); break; - case 0xF: - var_ra->unk1C = 0x00000020; + case MENU_ITEM_UI_OK: + menuItem->param1 = 0x20; /* fallthrough */ - case 0x0A: - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: + case MENU_ITEM_UI_GAME_SELECT: + case MAIN_MENU_DATA_GFX: + case MAIN_MENU_OPTION_GFX: + case MAIN_MENU_50CC: + case MAIN_MENU_100CC: + case MAIN_MENU_150CC: case 0x15: case 0x16: case 0x17: - case 0x18: - case 0x19: - func_800996BC(segmented_to_virtual_dupe(D_800E8274[type - 0x12]), 0); - break; - case 0xB: - case 0xC: - case 0xD: - case 0xE: - func_800996BC(segmented_to_virtual_dupe(D_800E8234[((type - 0xB) * 2) + 0]), 0); - func_80099184(segmented_to_virtual_dupe(D_800E8234[((type - 0xB) * 2) + 1])); - break; - case 0x2A: - func_800996BC(D_02004B4C, 0); - break; - case 0x33: - func_800996BC(D_02004B74, 0); - var_ra->unk1C = 0x00000020; - break; - case 0x34: - case 0x35: - case 0x36: - case 0x37: - func_80099184(segmented_to_virtual_dupe(D_800E82B4[type - 0x34])); - break; - case 0x2B: - case 0x2C: - case 0x2D: - case 0x2E: - case 0x2F: - case 0x30: - case 0x31: - case 0x32: - var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E8320[type - 0x2B])); - func_800996BC(segmented_to_virtual_dupe(D_800E7D54[type - 0x2B]), 0); - break; - case 0xA0: - case 0xA1: - var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E8320[type - 0xA0])); - break; - case 0x5D: - var_ra->unk1C = 0x00000020; + case MAIN_MENU_TIME_TRIALS_BEGIN: + case MAIN_MENU_TIME_TRIALS_DATA: + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E8274[type - 0x12]), LOAD_MENU_IMG_TKMK00_ONCE); + break; + case MENU_ITEM_UI_1P_GAME: + case MENU_ITEM_UI_2P_GAME: + case MENU_ITEM_UI_3P_GAME: + case MENU_ITEM_UI_4P_GAME: + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E8234[((type - 0xB) * 2) + 0]), + LOAD_MENU_IMG_TKMK00_ONCE); + load_menu_img(segmented_to_virtual_dupe(D_800E8234[((type - 0xB) * 2) + 1])); + break; + case CHARACTER_SELECT_MENU_PLAYER_SELECT_BANNER: + load_menu_img_comp_type(D_02004B4C, LOAD_MENU_IMG_TKMK00_ONCE); + break; + case CHARACTER_SELECT_MENU_OK: + load_menu_img_comp_type(D_02004B74, LOAD_MENU_IMG_TKMK00_ONCE); + menuItem->param1 = 0x00000020; + break; + case CHARACTER_SELECT_MENU_1P_CURSOR: + case CHARACTER_SELECT_MENU_2P_CURSOR: + case CHARACTER_SELECT_MENU_3P_CURSOR: + case CHARACTER_SELECT_MENU_4P_CURSOR: + load_menu_img(segmented_to_virtual_dupe(gMenuTexturesBorderPlayer[type - CHARACTER_SELECT_MENU_1P_CURSOR])); + break; + case CHARACTER_SELECT_MENU_MARIO: + case CHARACTER_SELECT_MENU_LUIGI: + case CHARACTER_SELECT_MENU_TOAD: + case CHARACTER_SELECT_MENU_PEACH: + case CHARACTER_SELECT_MENU_YOSHI: + case CHARACTER_SELECT_MENU_DK: + case CHARACTER_SELECT_MENU_WARIO: + case CHARACTER_SELECT_MENU_BOWSER: + menuItem->D_8018DEE0_index = + animate_character_select_menu(segmented_to_virtual_dupe_2(D_800E8320[type - 0x2B])); + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E7D54[type - 0x2B]), LOAD_MENU_IMG_TKMK00_ONCE); + break; + case MENU_ITEM_TYPE_0A0: + case MENU_ITEM_TYPE_0A1: + menuItem->D_8018DEE0_index = + animate_character_select_menu(segmented_to_virtual_dupe_2(D_800E8320[type - 0xA0])); + break; + case COURSE_SELECT_OK: + menuItem->param1 = 0x00000020; /* fallthrough */ - case 0x52: - case 0x53: - case 0x54: - case 0x55: - case 0x56: - case 0x58: - case 0x59: - case 0x5A: - case 0x5B: - case 0x5C: - func_800996BC(segmented_to_virtual_dupe(D_800E82C4[type - 0x52]), 0); - break; - case 0x5F: - case 0x60: - case 0x61: - case 0x62: - var_ra->D_8018DEE0_index = - func_8009A374(segmented_to_virtual_dupe_2(D_800E7E34[gCupCourseOrder[0][var_ra->type - 0x5F]])); - break; - case 0x5E: - var_ra->unk20 = random_int(4U) + 2; - break; - case 0x65: - case 0x66: - var_ra->column = D_800E7248[type - 0x65].column; - var_ra->row = D_800E7248[type - 0x65].row; - break; - case 0x67: - var_ra->unk1C = (s32) gCupSelection; - var_ra->unk20 = func_800B54C0(gCupSelection, gCCSelection); - var_ra->D_8018DEE0_index = - func_8009A374(segmented_to_virtual_dupe_2(D_800E7E20[((gCCSelection / 2) * 4) - var_ra->unk20])); - var_ra->column = D_800E7268[0].column; - var_ra->row = D_800E7268[0].row; - break; - case 0x68: - func_800996BC(segmented_to_virtual_dupe(D_800E8294[gCCSelection]), 0); - var_ra->column = 0x00000037; - var_ra->row = 0x000000C3; - break; - case 0x69: - func_800996BC(segmented_to_virtual_dupe(D_02004A0C), 0); + case COURSE_SELECT_MAP_SELECT: + case COURSE_SELECT_MUSHROOM_CUP: + case COURSE_SELECT_FLOWER_CUP: + case COURSE_SELECT_STAR_CUP: + case COURSE_SELECT_SPECIAL_CUP: + case MENU_ITEM_TYPE_058: + case COURSE_SELECT_COURSE_NAMES: + case MENU_ITEM_TYPE_05A: + case MENU_ITEM_TYPE_05B: + case COURSE_SELECT_BATTLE_NAMES: + load_menu_img_comp_type(segmented_to_virtual_dupe(gMenuTexturesTrackSelection[type - 0x52]), + LOAD_MENU_IMG_TKMK00_ONCE); + break; + case MENU_ITEM_TYPE_05F: + case MENU_ITEM_TYPE_060: + case MENU_ITEM_TYPE_061: + case MENU_ITEM_TYPE_062: + menuItem->D_8018DEE0_index = animate_character_select_menu( + segmented_to_virtual_dupe_2(D_800E7E34[gCupCourseOrder[0][menuItem->type - 0x5F]])); + break; + case MENU_ITEM_TYPE_05E: + menuItem->param2 = random_int(4) + 2; + break; + case MENU_ITEM_TYPE_065: + case MENU_ITEM_TYPE_066: + menuItem->column = D_800E7248[type - 0x65].column; + menuItem->row = D_800E7248[type - 0x65].row; + break; + case MENU_ITEM_TYPE_067: + menuItem->param1 = (s32) gCupSelection; + menuItem->param2 = func_800B54C0(gCupSelection, gCCSelection); + menuItem->D_8018DEE0_index = animate_character_select_menu( + segmented_to_virtual_dupe_2(D_800E7E20[((gCCSelection / 2) * 4) - menuItem->param2])); + menuItem->column = D_800E7268[0].column; + menuItem->row = D_800E7268[0].row; + break; + case MENU_ITEM_TYPE_068: + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E8294[gCCSelection]), LOAD_MENU_IMG_TKMK00_ONCE); + menuItem->column = 0x37; + menuItem->row = 0xC3; + break; + case MENU_ITEM_TYPE_069: + load_menu_img_comp_type(segmented_to_virtual_dupe(D_02004A0C), LOAD_MENU_IMG_TKMK00_ONCE); if (controller_pak_1_status() == 0) { func_800B6708(); } else { @@ -5566,14 +5630,14 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { D_8018EE10[1].ghostDataSaved = 0; } break; - case 0x78: - case 0x79: - case 0x7A: - case 0x7B: - func_800996BC(segmented_to_virtual_dupe(D_800E82F4[type - 0x78]), 0); + case MENU_ITEM_TYPE_078: + case MENU_ITEM_TYPE_079: + case MENU_ITEM_TYPE_07A: + case MENU_ITEM_TYPE_07B: + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E82F4[type - 0x78]), LOAD_MENU_IMG_TKMK00_ONCE); break; - case 0x8C: - func_800996BC(segmented_to_virtual_dupe(D_02004A34), 0); + case MENU_ITEM_TYPE_08C: + load_menu_img_comp_type(segmented_to_virtual_dupe(seg2_data_texture), LOAD_MENU_IMG_TKMK00_ONCE); if (controller_pak_1_status() == 0) { func_800B6708(); } else { @@ -5581,78 +5645,86 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { D_8018EE10[1].ghostDataSaved = 0; } break; - case 0x8D: - func_80099184(segmented_to_virtual_dupe(D_02001FA4)); - break; - case 0x7C: - case 0x7D: - case 0x7E: - case 0x7F: - case 0x80: - case 0x81: - case 0x82: - case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - case 0x88: - case 0x89: - case 0x8A: - case 0x8B: - temp_v0_6 = var_ra->type - 0x7C; - func_800996BC(segmented_to_virtual_dupe(D_800E7D74[gCupCourseOrder[temp_v0_6 / 4][temp_v0_6 % 4]]), -1); - temp_v0_6 = var_ra->type - 0x7C; - func_800996BC(segmented_to_virtual_dupe(D_800E7DC4[gCupCourseOrder[temp_v0_6 / 4][temp_v0_6 % 4]]), 0); - func_800996BC(segmented_to_virtual_dupe(D_02004A0C), 0); - break; - case 0xB1: - case 0xB2: - case 0xB3: - case 0xB4: - temp_a1 = D_800EFD64[gCharacterSelections[type - 0xB1]]; - var_v1_3 = 0; - stackPadding0 = type - 0xB1; + case MENU_ITEM_TYPE_08D: + load_menu_img(segmented_to_virtual_dupe(D_02001FA4)); + break; + case MENU_ITEM_TYPE_07C: + case MENU_ITEM_TYPE_07D: + case MENU_ITEM_TYPE_07E: + case MENU_ITEM_TYPE_07F: + case MENU_ITEM_TYPE_080: + case MENU_ITEM_TYPE_081: + case MENU_ITEM_TYPE_082: + case MENU_ITEM_TYPE_083: + case MENU_ITEM_TYPE_084: + case MENU_ITEM_TYPE_085: + case MENU_ITEM_TYPE_086: + case MENU_ITEM_TYPE_087: + case MENU_ITEM_TYPE_088: + case MENU_ITEM_TYPE_089: + case MENU_ITEM_TYPE_08A: + case MENU_ITEM_TYPE_08B: + load_menu_img_comp_type( + segmented_to_virtual_dupe(D_800E7D74[gCupCourseOrder[(menuItem->type - MENU_ITEM_TYPE_07C) / 4] + [(menuItem->type - MENU_ITEM_TYPE_07C) % 4]]), + LOAD_MENU_IMG_MIO0_ONCE); + load_menu_img_comp_type( + segmented_to_virtual_dupe(D_800E7DC4[gCupCourseOrder[(menuItem->type - MENU_ITEM_TYPE_07C) / 4] + [(menuItem->type - MENU_ITEM_TYPE_07C) % 4]]), + LOAD_MENU_IMG_TKMK00_ONCE); + load_menu_img_comp_type(segmented_to_virtual_dupe(D_02004A0C), LOAD_MENU_IMG_TKMK00_ONCE); + break; + case MENU_ITEM_TYPE_0B1: + case MENU_ITEM_TYPE_0B2: + case MENU_ITEM_TYPE_0B3: + case MENU_ITEM_TYPE_0B4: { + bool var_v1_3; + UNUSED s32 pad2; + s32 temp_a3 = type - MENU_ITEM_TYPE_0B1; + UNUSED s32 pad[0x3]; + temp_a1 = D_800EFD64[gCharacterSelections[type - MENU_ITEM_TYPE_0B1]]; + var_v1_3 = false; switch (gModeSelection) { - case 2: - if (gGPCurrentRaceRankByPlayerId[type - 0xB1] != 0) { - var_v1_3 = 1; + case VERSUS: + if (gGPCurrentRaceRankByPlayerId[type - MENU_ITEM_TYPE_0B1] != 0) { + var_v1_3 = true; } break; - case 3: - if ((type - 0xB1) != gPlayerWinningIndex) { - var_v1_3 = 1; + case BATTLE: + if ((type - MENU_ITEM_TYPE_0B1) != gPlayerWinningIndex) { + var_v1_3 = true; } break; default: break; } - if (var_v1_3 != 0) { + if (var_v1_3) { var_a0 = gCharacterDefeatAnimation[temp_a1]; } else { var_a0 = D_800E8320[temp_a1]; } - var_ra->D_8018DEE0_index = func_8009A478(segmented_to_virtual_dupe_2(var_a0), stackPadding0); - func_800996BC(segmented_to_virtual_dupe(D_800E7D54[temp_a1]), 0); - func_80099184(segmented_to_virtual_dupe(D_800E82B4[type - 0xB1])); + menuItem->D_8018DEE0_index = func_8009A478(segmented_to_virtual_dupe_2(var_a0), temp_a3); + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E7D54[temp_a1]), LOAD_MENU_IMG_TKMK00_ONCE); + load_menu_img(segmented_to_virtual_dupe(gMenuTexturesBorderPlayer[type - MENU_ITEM_TYPE_0B1])); break; - case 0xBB: - var_ra->unk1C = func_800B5020(playerHUD[0].someTimer, gCharacterSelections[0]); - var_ra->unk20 = func_800B5218(); - if (D_80162DD4 != 1) { - if (func_800051C4() >= 0x3C01) { - D_80162DD4 = 1; + } + case MENU_ITEM_TYPE_0BB: + menuItem->param1 = func_800B5020(playerHUD[0].someTimer, gCharacterSelections[0]); + menuItem->param2 = func_800B5218(); + if (bPlayerGhostDisabled != 1) { + if (func_800051C4() > 0x3C00) { + bPlayerGhostDisabled = 1; } } - if ((var_ra->unk1C == 0) || (var_ra->unk20 != 0)) { + if ((menuItem->param1 == 0) || (menuItem->param2 != 0)) { func_800B559C((gCupSelection * 4) + gCourseIndexInCup); } break; - case 0xE6: - var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2( + case MENU_ITEM_DATA_COURSE_IMAGE: + menuItem->D_8018DEE0_index = animate_character_select_menu(segmented_to_virtual_dupe_2( D_800E7E34[gCupCourseOrder[gTimeTrialDataCourseIndex / 4][gTimeTrialDataCourseIndex % 4]])); - var_ra->unk1C = gTimeTrialDataCourseIndex; - func_800996BC(segmented_to_virtual_dupe(D_02004A0C), 0); + menuItem->param1 = gTimeTrialDataCourseIndex; + load_menu_img_comp_type(segmented_to_virtual_dupe(D_02004A0C), LOAD_MENU_IMG_TKMK00_ONCE); func_8006EF60(); if (controller_pak_1_status() == 0) { func_800B6708(); @@ -5661,151 +5733,140 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { D_8018EE10[1].ghostDataSaved = 0; } break; - case 0xF0: - var_ra->cursor = (s32) gSoundMode; + case MENU_ITEM_TYPE_0F0: + menuItem->state = (s32) gSoundMode; break; - case 0xF1: - func_800996BC(segmented_to_virtual_dupe(D_02004638), 0); + case MENU_ITEM_TYPE_0F1: + load_menu_img_comp_type(segmented_to_virtual_dupe(D_02004638), LOAD_MENU_IMG_TKMK00_ONCE); break; - case 0xBE: + case MENU_ITEM_TYPE_0BE: D_8018ED90 = 0; break; - case 0x130: + case MENU_ITEM_TYPE_130: { + bool var_v0_2; temp_a1 = D_800EFD64[D_802874D8.unk1E]; if (D_802874D8.unk1D >= 3) { - var_v0 = 1; + var_v0_2 = true; } else { - var_v0 = 0; + var_v0_2 = false; } - if (var_v0 != 0) { + if (var_v0_2) { var_a0 = gCharacterDefeatAnimation[temp_a1]; } else { var_a0 = D_800E8320[temp_a1]; } - var_ra->D_8018DEE0_index = func_8009A478(segmented_to_virtual_dupe_2(var_a0), 0); - func_800996BC(segmented_to_virtual_dupe(D_800E7D54[temp_a1]), 0); - break; - case 0x190: - case 0x191: - case 0x192: - case 0x193: - case 0x194: - case 0x195: - case 0x196: - case 0x197: - case 0x198: - case 0x199: - case 0x19A: - case 0x19B: - case 0x19C: - case 0x19D: - case 0x19E: - case 0x19F: - case 0x1A0: - case 0x1A1: - case 0x1A2: - case 0x1A3: - case 0x1A4: - case 0x1A5: - case 0x1A6: - case 0x1A7: - case 0x1A8: - case 0x1A9: - case 0x1AA: - case 0x1AB: - case 0x1AC: - case 0x1AD: - case 0x1AE: - case 0x1AF: - case 0x1B0: - case 0x1B1: - case 0x1B2: - case 0x1B3: - case 0x1B4: - case 0x1B5: - case 0x1B6: - case 0x1B7: - case 0x1B8: - case 0x1B9: - case 0x1BA: - case 0x1BB: - case 0x1BC: - case 0x1BD: - case 0x1BE: - case 0x1BF: - case 0x1C0: - case 0x1C1: - case 0x1C2: - case 0x1C3: - case 0x1C4: - case 0x1C5: - case 0x1C6: - case 0x1C7: - case 0x1C8: - case 0x1C9: - case 0x1CA: - case 0x1CB: - case 0x1CC: - case 0x1CD: - case 0x1CE: + menuItem->D_8018DEE0_index = func_8009A478(segmented_to_virtual_dupe_2(var_a0), 0); + load_menu_img_comp_type(segmented_to_virtual_dupe(D_800E7D54[temp_a1]), LOAD_MENU_IMG_TKMK00_ONCE); + break; + } + case MENU_ITEM_TYPE_190: + case MENU_ITEM_TYPE_191: + case MENU_ITEM_TYPE_192: + case MENU_ITEM_TYPE_193: + case MENU_ITEM_TYPE_194: + case MENU_ITEM_TYPE_195: + case MENU_ITEM_TYPE_196: + case MENU_ITEM_TYPE_197: + case MENU_ITEM_TYPE_198: + case MENU_ITEM_TYPE_199: + case MENU_ITEM_TYPE_19A: + case MENU_ITEM_TYPE_19B: + case MENU_ITEM_TYPE_19C: + case MENU_ITEM_TYPE_19D: + case MENU_ITEM_TYPE_19E: + case MENU_ITEM_TYPE_19F: + case MENU_ITEM_TYPE_1A0: + case MENU_ITEM_TYPE_1A1: + case MENU_ITEM_TYPE_1A2: + case MENU_ITEM_TYPE_1A3: + case MENU_ITEM_TYPE_1A4: + case MENU_ITEM_TYPE_1A5: + case MENU_ITEM_TYPE_1A6: + case MENU_ITEM_TYPE_1A7: + case MENU_ITEM_TYPE_1A8: + case MENU_ITEM_TYPE_1A9: + case MENU_ITEM_TYPE_1AA: + case MENU_ITEM_TYPE_1AB: + case MENU_ITEM_TYPE_1AC: + case MENU_ITEM_TYPE_1AD: + case MENU_ITEM_TYPE_1AE: + case MENU_ITEM_TYPE_1AF: + case MENU_ITEM_TYPE_1B0: + case MENU_ITEM_TYPE_1B1: + case MENU_ITEM_TYPE_1B2: + case MENU_ITEM_TYPE_1B3: + case MENU_ITEM_TYPE_1B4: + case MENU_ITEM_TYPE_1B5: + case MENU_ITEM_TYPE_1B6: + case MENU_ITEM_TYPE_1B7: + case MENU_ITEM_TYPE_1B8: + case MENU_ITEM_TYPE_1B9: + case MENU_ITEM_TYPE_1BA: + case MENU_ITEM_TYPE_1BB: + case MENU_ITEM_TYPE_1BC: + case MENU_ITEM_TYPE_1BD: + case MENU_ITEM_TYPE_1BE: + case MENU_ITEM_TYPE_1BF: + case MENU_ITEM_TYPE_1C0: + case MENU_ITEM_TYPE_1C1: + case MENU_ITEM_TYPE_1C2: + case MENU_ITEM_TYPE_1C3: + case MENU_ITEM_TYPE_1C4: + case MENU_ITEM_TYPE_1C5: + case MENU_ITEM_TYPE_1C6: + case MENU_ITEM_TYPE_1C7: + case MENU_ITEM_TYPE_1C8: + case MENU_ITEM_TYPE_1C9: + case MENU_ITEM_TYPE_1CA: + case MENU_ITEM_TYPE_1CB: + case MENU_ITEM_TYPE_1CC: + case MENU_ITEM_TYPE_1CD: + case MENU_ITEM_TYPE_1CE: default: break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/add_8018D9E0_entry.s") -#endif -#ifdef NON_MATCHING -// https://decomp.me/scratch/MatRp -// Biggest diff left is in the case 0x12 though 0x19 handling. Not really sure what's going on there -// There's also a diff in the handling of D_800E77A0 in case 0x4. Not sure what's going on there either -void func_8009F5E0(struct_8018D9E0_entry* arg0) { +void render_menus(MenuItem* arg0) { s32 var_a1; s32 var_v1; - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; - MkTexture* sp9C; - UNUSED s32 stackPadding2; + UNUSED s32 pad[2]; + MenuTexture* texture; s32 temp_a0; s32 temp_t2; s32 temp_t5; s32 temp_t9; s32 temp_v1; + UNUSED s32 pad2; char sp80[3]; - s32 var_t0; - UNUSED s32 var_a2; f32 why = 0.75f; s32 one = 1; - f32 floatone = 1; - UNUSED s32 stackPadding3; - UNUSED s32 stackPadding4; - f32 var_f0; + UNUSED s32 pad3; - if ((s8) arg0->visible != 0) { + if (arg0->visible) { gDPPipeSync(gDisplayListHead++); - switch (arg0->type) { /* switch 6; irregular */ - case 0xFA: /* switch 6 */ - func_80094660(gGfxPool, arg0->unk1C); + switch (arg0->type) { /* switch 6; irregular */ + case MENU_ITEM_UI_LOGO_INTRO: /* switch 6 */ + func_80094660(gGfxPool, arg0->param1); break; - case 0xFB: /* switch 6 */ - func_800947B4(gGfxPool, arg0->unk1C); + case START_MENU_FLAG: /* switch 6 */ + render_checkered_flag(gGfxPool, arg0->param1); break; - case 0xD2: /* switch 6 */ + case MENU_ITEM_TYPE_0D2: /* switch 6 */ gDisplayListHead = func_8009B9D0(gDisplayListHead, D_020014C8); break; - case 0xD3: /* switch 6 */ + case MENU_ITEM_TYPE_0D3: /* switch 6 */ gDisplayListHead = func_8009B9D0(gDisplayListHead, D_02001540); break; - case 0xD4: /* switch 6 */ + case MENU_ITEM_TYPE_0D4: /* switch 6 */ func_800A09E0(arg0); func_800A0AD0(arg0); func_800A0B80(arg0); break; - case 0xD5: /* switch 6 */ - // Sets the text color of the text on the Controller Pak menu - // Also sets the color of the shading at the top and bottom of the menu - // Does not set color of the text in the table itself + case MENU_ITEM_TYPE_0D5: /* switch 6 */ + // Sets the text color of the text on the Controller Pak menu + // Also sets the color of the shading at the top and bottom of the menu + // Does not set color of the text in the table itself gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, 0xFF); gDisplayListHead = func_8009B9D0(gDisplayListHead, D_020015A4); gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x32, 0x00, 0x00, 0xFF); @@ -5815,97 +5876,107 @@ void func_8009F5E0(struct_8018D9E0_entry* arg0) { gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x32, 0x32, 0x00, 0xFF); gDisplayListHead = func_8009B9D0(gDisplayListHead, D_02001658); break; - case 0xD6: /* switch 6 */ + case MENU_ITEM_TYPE_0D6: /* switch 6 */ func_8009A76C(arg0->D_8018DEE0_index, arg0->column, arg0->row, -1); break; - case 0xD7: /* switch 6 */ + case MENU_ITEM_TYPE_0D7: /* switch 6 */ func_800A0DFC(); break; - case 0xD8: /* switch 6 */ - case 0xD9: /* switch 6 */ + case MENU_ITEM_TYPE_0D8: /* switch 6 */ + case MENU_ITEM_TYPE_0D9: /* switch 6 */ func_800A0EB8(arg0, arg0->type - 0xD8); break; - case 0x1: /* switch 6 */ - gDisplayListHead = - func_8009BA74(gDisplayListHead, D_800E7D4C[func_800B555C()], arg0->column, arg0->row); + case MENU_ITEM_UI_START_BACKGROUND: /* switch 6 */ + gDisplayListHead = render_menu_textures( + gDisplayListHead, gMenuTexturesBackground[has_unlocked_extra_mode()], arg0->column, arg0->row); break; - case 0x2: /* switch 6 */ - func_8004C8D4((arg0->column + 0xA0), (arg0->row + 0x47)); - gDisplayListHead = func_8009BA74(gDisplayListHead, D_020045E8, arg0->column, arg0->row); + case MENU_ITEM_UI_LOGO_AND_COPYRIGHT: /* switch 6 */ + render_game_logo((arg0->column + 0xA0), (arg0->row + 0x47)); + gDisplayListHead = + render_menu_textures(gDisplayListHead, seg2_copyright_1996_texture, arg0->column, arg0->row); break; - case 0x3: /* switch 6 */ + case MENU_ITEM_UI_PUSH_START_BUTTON: /* switch 6 */ if (((gGlobalTimer / 8) % 3) != 0) { - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004610, arg0->column, arg0->row); + gDisplayListHead = + render_menu_textures(gDisplayListHead, seg2_push_start_button_texture, arg0->column, arg0->row); } break; - case 0x5: /* switch 6 */ - var_t0 = (s32) ((f32) (get_string_width(gCourseNamesDup[0]) + 5) * 0.9f) / 2; - gDisplayListHead = draw_box(gDisplayListHead, 0xA0 - var_t0, 0x0000007B, var_t0 + 0xA0, 0x000000A4, 0, - 0, 0, 0x00000096); - set_text_color(1); - draw_text(0x0000009B, 0x0000008C, gCourseNamesDup[0], 0, 0.9f, 0.9f); + case MENU_ITEM_UI_START_RECORD_TIME: { + s32 strWidth; + strWidth = (s32) ((f32) (get_string_width(gCourseNamesDup[0]) + 5) * 0.9f) / 2; + gDisplayListHead = draw_box(gDisplayListHead, 0xA0 - strWidth, 0x0000007B, strWidth + 0xA0, 0x000000A4, + 0, 0, 0, 0x00000096); + set_text_color(TEXT_GREEN); + print_text1_center_mode_1(0x0000009B, 0x0000008C, gCourseNamesDup[0], 0, 0.9f, 0.9f); temp_v1 = func_800B4EB4(0, 7) & 0xFFFFF; if (temp_v1 < 0x1EAA) { set_text_color((s32) gGlobalTimer % 2); } else if (temp_v1 < 0x2329) { set_text_color((s32) gGlobalTimer % 3); } else { - set_text_color(3); + set_text_color(TEXT_YELLOW); } get_time_record_minutes(temp_v1, sp80); func_800939C8(0x00000077, 0x000000A0, sp80, 0, 1.0f, 1.0f); - func_80093324(0x0000008B, 0x000000A0, "'", 0, 1.0f, 1.0f); + print_text_mode_1(0x0000008B, 0x000000A0, "'", 0, 1.0f, 1.0f); get_time_record_seconds(temp_v1, sp80); func_800939C8(0x00000094, 0x000000A0, sp80, 0, 1.0f, 1.0f); - func_80093324(0x000000A7, 0x000000A0, "\"", 0, 1.0f, 1.0f); + print_text_mode_1(0x000000A7, 0x000000A0, "\"", 0, 1.0f, 1.0f); get_time_record_centiseconds(temp_v1, sp80); func_800939C8(0x000000B4, 0x000000A0, sp80, 0, 1.0f, 1.0f); break; - case 0x4: /* switch 6 */ - var_t0 = get_string_width(D_800E77A0[0]); - temp_v1 = get_string_width(D_800E77A0[1]); - if (var_t0 < temp_v1) { - var_t0 = temp_v1; + } + case MENU_ITEM_UI_NO_CONTROLLER: { + s32 strWidth; + UNUSED s32 padCont[2]; + strWidth = get_string_width(gTextNoController[0]); + temp_v1 = get_string_width(gTextNoController[1]); + if (strWidth < temp_v1) { + strWidth = temp_v1; } - temp_t2 = (s32) (var_t0 * why) / 2; + temp_t2 = (s32) (strWidth * why) / 2; temp_t5 = (s32) (((why * 2) + 0.5) * 16.0) / 2; gDisplayListHead = draw_box(gDisplayListHead, 0xA0 - temp_t2, 0xB6 - temp_t5, temp_t2 + 0xA0, temp_t5 + 0xB6, 0, 0, 0, 0x00000096); - set_text_color(4); - for (temp_t9 = 0; temp_t9 < 2; temp_t9++) { - draw_text(0xA0 * one - floatone * why, (s32) (0xB4 * one + ((f32) (temp_t9 * 0x12) * why)), - D_800E77A0[temp_t9], 0, why, why); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); + for (strWidth = 0; strWidth < 2; strWidth++) { + print_text1_center_mode_1(0xA0 * one - 1 * why, + (s32) (0xB4 * one + ((f32) (strWidth * 0x12) * why)), + gTextNoController[strWidth], 0, why, why); } break; - case 0x23: /* switch 6 */ - case 0x24: /* switch 6 */ - case 0x25: /* switch 6 */ - gDisplayListHead = - func_8009BC9C(gDisplayListHead, D_800E7D4C[func_800B555C()], arg0->column, arg0->row, 3, 0); + } + case MAIN_MENU_BACKGROUND: + case CHARACTER_SELECT_BACKGROUND: + case COURSE_SELECT_BACKGROUND: + gDisplayListHead = func_8009BC9C(gDisplayListHead, gMenuTexturesBackground[has_unlocked_extra_mode()], + arg0->column, arg0->row, 3, 0); break; - case 0xA: /* switch 6 */ - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004660, arg0->column, arg0->row); + case MENU_ITEM_UI_GAME_SELECT: + gDisplayListHead = + render_menu_textures(gDisplayListHead, seg2_game_select_texture, arg0->column, arg0->row); break; - case 0xB: /* switch 6 */ - case 0xC: /* switch 6 */ - case 0xD: /* switch 6 */ - case 0xE: /* switch 6 */ - var_a1 = arg0->type - 0xB; + case MENU_ITEM_UI_1P_GAME: + case MENU_ITEM_UI_2P_GAME: + case MENU_ITEM_UI_3P_GAME: + case MENU_ITEM_UI_4P_GAME: + var_a1 = arg0->type - MENU_ITEM_UI_1P_GAME; func_800A8270(var_a1, arg0); func_800A0FA4(arg0, var_a1); break; - case 0xF: /* switch 6 */ + case MENU_ITEM_UI_OK: func_800A8564(arg0); - gDisplayListHead = func_8009BC9C(gDisplayListHead, D_0200487C, arg0->column, arg0->row, 2, arg0->unk1C); + gDisplayListHead = + func_8009BC9C(gDisplayListHead, D_0200487C, arg0->column, arg0->row, 2, arg0->param1); break; - case 0x10: /* switch 6 */ - case 0x11: /* switch 6 */ + case MAIN_MENU_OPTION_GFX: + case MAIN_MENU_DATA_GFX: var_a1 = arg0->type - 0xF; - if (arg0->unk1C < 0x20) { - temp_t9 = (arg0->unk1C * 0x3A) / 64; - if (var_a1 == gMainMenuSelectionDepth) { + if (arg0->param1 < 0x20) { + temp_t9 = (arg0->param1 * 0x3A) / 64; + if (var_a1 == gMainMenuSelection) { gDisplayListHead = - draw_flash_select_case_fast(gDisplayListHead, arg0->column + temp_t9, arg0->row, + draw_flash_select_case_fast(gDisplayListHead, arg0->column + temp_t9, (u32) arg0->row, (arg0->column - temp_t9) + 0x39, arg0->row + 0x12); } else { gDisplayListHead = @@ -5915,80 +5986,90 @@ void func_8009F5E0(struct_8018D9E0_entry* arg0) { } var_v1 = arg0->type - 0xA; gDisplayListHead = - func_8009BC9C(gDisplayListHead, D_800E8254[var_v1], arg0->column, arg0->row, 2, arg0->unk1C); - break; - case 0x12: /* switch 6 */ - case 0x13: /* switch 6 */ - case 0x14: /* switch 6 */ - case 0x15: /* switch 6 */ - case 0x16: /* switch 6 */ - case 0x17: /* switch 6 */ - case 0x18: /* switch 6 */ - case 0x19: /* switch 6 */ - var_v1 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - var_a1 = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - switch (arg0->type) { /* switch 5 */ - case 0x12: /* switch 5 */ - case 0x13: /* switch 5 */ - case 0x14: /* switch 5 */ - case 0x15: /* switch 5 */ - if ((var_a1 != 0) && (var_a1 != 2)) { - var_v1 = -1; + func_8009BC9C(gDisplayListHead, D_800E8254[var_v1], arg0->column, arg0->row, 2, arg0->param1); + break; + case MAIN_MENU_50CC: /* switch 6 */ + case MAIN_MENU_100CC: /* switch 6 */ + case MAIN_MENU_150CC: /* switch 6 */ + case MAIN_MENU_EXTRA_CC: /* switch 6 */ + case MENU_ITEM_TYPE_016: /* switch 6 */ + case MENU_ITEM_TYPE_017: /* switch 6 */ + case MAIN_MENU_TIME_TRIALS_BEGIN: /* switch 6 */ + case MAIN_MENU_TIME_TRIALS_DATA: /* switch 6 */ + var_a1 = gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; + var_v1 = gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; + switch (arg0->type) { /* switch 5 */ + case MAIN_MENU_50CC: /* switch 5 */ + case MAIN_MENU_100CC: /* switch 5 */ + case MAIN_MENU_150CC: /* switch 5 */ + case MAIN_MENU_EXTRA_CC: /* switch 5 */ + switch (var_v1) { + case 0: + case 2: + break; + default: + var_a1 = -1; + break; } - var_a1 = 18; - sp9C = segmented_to_virtual_dupe(D_800E824C[arg0->type]); + + var_v1 = MAIN_MENU_50CC; + texture = segmented_to_virtual_dupe(D_800E8294[arg0->type - MAIN_MENU_50CC]); break; - case 0x16: /* switch 5 */ - case 0x17: /* switch 5 */ - if (var_a1 != 2) { - var_v1 = -1; + case MENU_ITEM_TYPE_016: /* switch 5 */ + case MENU_ITEM_TYPE_017: /* switch 5 */ + if (var_v1 != 2) { + var_a1 = -1; + break; } else { - var_a1 = 22; - sp9C = segmented_to_virtual_dupe(D_800E824C[arg0->type]); + var_v1 = MENU_ITEM_TYPE_016; + texture = segmented_to_virtual_dupe(D_800E82A4[arg0->type - MENU_ITEM_TYPE_016]); } break; - case 0x18: /* switch 5 */ - case 0x19: /* switch 5 */ - if (var_a1 != 1) { - var_v1 = -1; + case MAIN_MENU_TIME_TRIALS_BEGIN: /* switch 5 */ + case MAIN_MENU_TIME_TRIALS_DATA: /* switch 5 */ + if (var_v1 != 1) { + var_a1 = -1; + break; } else { - var_a1 = 24; - sp9C = segmented_to_virtual_dupe(D_800E824C[arg0->type]); + var_v1 = MAIN_MENU_TIME_TRIALS_BEGIN; + texture = segmented_to_virtual_dupe(D_800E82AC[arg0->type - MAIN_MENU_TIME_TRIALS_BEGIN]); } break; + default: + break; } - if (var_v1 != -1) { - if ((gMainMenuSelectionDepth >= 5) && (var_v1 == (arg0->type - var_a1))) { - if (gMainMenuSelectionDepth >= 6) { - gDisplayListHead = - draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, - arg0->row + 0x11, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); - } else { - gDisplayListHead = - draw_flash_select_case_slow(gDisplayListHead, arg0->column ^ 0, arg0->row ^ 0, - arg0->column + 0x3F, arg0->row + 0x11); - } + if (var_a1 == -1) { + break; + } + if ((gMainMenuSelection >= MAIN_MENU_MODE_SUB_SELECT) && (var_a1 == (arg0->type - var_v1))) { + if (gMainMenuSelection > MAIN_MENU_MODE_SUB_SELECT) { + gDisplayListHead = + draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, + arg0->row + 0x11, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); } else { - gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, - arg0->row + 0x11, 1, 1, 1, 0x000000FF); + gDisplayListHead = draw_flash_select_case_slow( + gDisplayListHead, arg0->column ^ 0, arg0->row ^ 0, arg0->column + 0x3F, arg0->row + 0x11); } - gDisplayListHead = func_8009BA74(gDisplayListHead, sp9C, arg0->column, arg0->row); + } else { + gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, + arg0->row + 0x11, 1, 1, 1, 0x000000FF); } + gDisplayListHead = render_menu_textures(gDisplayListHead, texture, arg0->column, arg0->row); break; - case 0x1B: /* switch 6 */ + case MENU_ITEM_TYPE_01B: /* switch 6 */ func_800A10CC(arg0); break; - case 0x2A: /* switch 6 */ - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004B4C, arg0->column, arg0->row); + case CHARACTER_SELECT_MENU_PLAYER_SELECT_BANNER: /* switch 6 */ + gDisplayListHead = render_menu_textures(gDisplayListHead, D_02004B4C, arg0->column, arg0->row); break; - case 0x34: /* switch 6 */ - case 0x35: /* switch 6 */ - case 0x36: /* switch 6 */ - case 0x37: /* switch 6 */ - temp_a0 = arg0->type - 0x34; + case CHARACTER_SELECT_MENU_1P_CURSOR: /* switch 6 */ + case CHARACTER_SELECT_MENU_2P_CURSOR: /* switch 6 */ + case CHARACTER_SELECT_MENU_3P_CURSOR: /* switch 6 */ + case CHARACTER_SELECT_MENU_4P_CURSOR: /* switch 6 */ + temp_a0 = arg0->type - CHARACTER_SELECT_MENU_1P_CURSOR; if (gCharacterGridSelections[temp_a0]) { - if (D_8018EDE8[temp_a0] == 0) { - temp_t2 = 0x000000FF; + if (gCharacterGridIsSelected[temp_a0] == 0) { + temp_t2 = 255; } else { temp_t2 = gGlobalTimer % 16; if (temp_t2 >= 8) { @@ -5996,313 +6077,318 @@ void func_8009F5E0(struct_8018D9E0_entry* arg0) { } else { temp_t2 *= 8; } - temp_t2 += 0xBF; + temp_t2 += 191; } - func_800A11D0(arg0, temp_a0, temp_t2); + render_cursor_player(arg0, temp_a0, temp_t2); } break; - case 0x33: /* switch 6 */ + case CHARACTER_SELECT_MENU_OK: /* switch 6 */ func_800A8564(arg0); - gDisplayListHead = func_8009BC9C(gDisplayListHead, D_02004B74, arg0->column, arg0->row, 2, arg0->unk1C); - break; - case 0x2B: /* switch 6 */ - case 0x2C: /* switch 6 */ - case 0x2D: /* switch 6 */ - case 0x2E: /* switch 6 */ - case 0x2F: /* switch 6 */ - case 0x30: /* switch 6 */ - case 0x31: /* switch 6 */ - case 0x32: /* switch 6 */ + gDisplayListHead = + func_8009BC9C(gDisplayListHead, D_02004B74, arg0->column, arg0->row, 2, arg0->param1); + break; + case CHARACTER_SELECT_MENU_MARIO: /* switch 6 */ + case CHARACTER_SELECT_MENU_LUIGI: /* switch 6 */ + case CHARACTER_SELECT_MENU_TOAD: /* switch 6 */ + case CHARACTER_SELECT_MENU_PEACH: /* switch 6 */ + case CHARACTER_SELECT_MENU_YOSHI: /* switch 6 */ + case CHARACTER_SELECT_MENU_DK: /* switch 6 */ + case CHARACTER_SELECT_MENU_WARIO: /* switch 6 */ + case CHARACTER_SELECT_MENU_BOWSER: /* switch 6 */ func_800A12BC(arg0, segmented_to_virtual_dupe(D_800E7D54[arg0->type - 0x2B])); /* fallthrough */ - case 0xA0: /* switch 6 */ - case 0xA1: /* switch 6 */ - func_8009A76C(arg0->D_8018DEE0_index, arg0->column, arg0->row, arg0->unk1C); - break; - case 0x58: /* switch 6 */ - case 0x59: /* switch 6 */ - case 0x5A: /* switch 6 */ - case 0x5B: /* switch 6 */ - case 0x5C: /* switch 6 */ + case MENU_ITEM_TYPE_0A0: /* switch 6 */ + case MENU_ITEM_TYPE_0A1: /* switch 6 */ + func_8009A76C(arg0->D_8018DEE0_index, arg0->column, arg0->row, arg0->param1); + break; + case MENU_ITEM_TYPE_058: /* switch 6 */ + case COURSE_SELECT_COURSE_NAMES: /* switch 6 */ + case MENU_ITEM_TYPE_05A: /* switch 6 */ + case MENU_ITEM_TYPE_05B: /* switch 6 */ + case COURSE_SELECT_BATTLE_NAMES: /* switch 6 */ func_800A8A98(arg0); - gDisplayListHead = - func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg0->type - 0x52]), - arg0->column, arg0->row); + gDisplayListHead = render_menu_textures( + gDisplayListHead, + segmented_to_virtual_dupe(gMenuTexturesTrackSelection[arg0->type - COURSE_SELECT_MAP_SELECT]), + arg0->column, arg0->row); func_800A8CA4(arg0); break; - case 0x52: /* switch 6 */ - gDisplayListHead = - func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg0->type - 0x52]), - arg0->column, arg0->row); + case COURSE_SELECT_MAP_SELECT: /* switch 6 */ + gDisplayListHead = render_menu_textures( + gDisplayListHead, + segmented_to_virtual_dupe(gMenuTexturesTrackSelection[arg0->type - COURSE_SELECT_MAP_SELECT]), + arg0->column, arg0->row); break; - case 0x5F: /* switch 6 */ - case 0x60: /* switch 6 */ - case 0x61: /* switch 6 */ - case 0x62: /* switch 6 */ + case MENU_ITEM_TYPE_05F: /* switch 6 */ + case MENU_ITEM_TYPE_060: /* switch 6 */ + case MENU_ITEM_TYPE_061: /* switch 6 */ + case MENU_ITEM_TYPE_062: /* switch 6 */ func_800A1500(arg0); break; - case 0x53: /* switch 6 */ - case 0x54: /* switch 6 */ - case 0x55: /* switch 6 */ - case 0x56: /* switch 6 */ - var_a1 = arg0->type - 0x53; + case COURSE_SELECT_MUSHROOM_CUP: /* switch 6 */ + case COURSE_SELECT_FLOWER_CUP: /* switch 6 */ + case COURSE_SELECT_STAR_CUP: /* switch 6 */ + case COURSE_SELECT_SPECIAL_CUP: /* switch 6 */ + var_a1 = arg0->type - COURSE_SELECT_MUSHROOM_CUP; func_800A890C(var_a1, arg0); func_800A143C(arg0, var_a1); break; - case 0x5D: /* switch 6 */ + case COURSE_SELECT_OK: /* switch 6 */ func_800A8564(arg0); - gDisplayListHead = func_8009BC9C(gDisplayListHead, D_02004E80, arg0->column, arg0->row, 2, arg0->unk1C); + gDisplayListHead = + func_8009BC9C(gDisplayListHead, D_02004E80, arg0->column, arg0->row, 2, arg0->param1); break; - case 0x65: /* switch 6 */ - case 0x66: /* switch 6 */ - if (arg0->type == 0x00000065) { - var_f0 = 0.6f; + case MENU_ITEM_TYPE_065: /* switch 6 */ + case MENU_ITEM_TYPE_066: { + f32 scaleX; + if (arg0->type == MENU_ITEM_TYPE_065) { + scaleX = 0.6f; } else { - var_f0 = 0.8f; + scaleX = 0.8f; } func_800A86E8(arg0); - set_text_color(3); - func_80093324(arg0->column + 8, arg0->row + 0x10, D_800E7728[arg0->type - 0x65], 0, var_f0, 0.8f); + set_text_color(TEXT_YELLOW); + print_text_mode_1(arg0->column + 8, arg0->row + 0x10, gBestTimeText[arg0->type - 0x65], 0, scaleX, + 0.8f); func_800A874C(arg0); break; - case 0x6E: /* switch 6 */ - func_800A8E14(arg0); + } + case MENU_ITEM_TYPE_06E: /* switch 6 */ + render_battle_introduction(arg0); break; - case 0x67: /* switch 6 */ + case MENU_ITEM_TYPE_067: /* switch 6 */ func_800A8EC0(arg0); break; - case 0x68: /* switch 6 */ + case MENU_ITEM_TYPE_068: /* switch 6 */ gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 1, 1, 1, 0x000000FF); - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E8294[gCCSelection]), - arg0->column, arg0->row); + gDisplayListHead = render_menu_textures( + gDisplayListHead, segmented_to_virtual_dupe(D_800E8294[gCCSelection]), arg0->column, arg0->row); break; - case 0x69: /* switch 6 */ + case MENU_ITEM_TYPE_069: /* switch 6 */ func_800A8F48(arg0); break; - case 0x78: /* switch 6 */ - case 0x79: /* switch 6 */ - case 0x7A: /* switch 6 */ - case 0x7B: /* switch 6 */ - var_a1 = arg0->type - 0x78; + case MENU_ITEM_TYPE_078: /* switch 6 */ + case MENU_ITEM_TYPE_079: /* switch 6 */ + case MENU_ITEM_TYPE_07A: /* switch 6 */ + case MENU_ITEM_TYPE_07B: /* switch 6 */ + var_a1 = arg0->type - MENU_ITEM_TYPE_078; func_800A90D4(var_a1, arg0); func_800A143C(arg0, var_a1); break; - case 0x8C: /* switch 6 */ - if ((gMainMenuSelectionDepth >= 5) && (var_a1 == (arg0->type - var_v1))) { - if (gMainMenuSelectionDepth >= 6) { + case MENU_ITEM_TYPE_08C: /* switch 6 */ + if ((gMainMenuSelection >= MAIN_MENU_MODE_SUB_SELECT) && (var_a1 == (arg0->type - var_v1))) { + if (gMainMenuSelection > MAIN_MENU_MODE_SUB_SELECT) { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); } else { - gDisplayListHead = draw_flash_select_case_slow( - gDisplayListHead, arg0->column ^ 0, arg0->row ^ 0, arg0->column + 0x3F, arg0->row + 0x11); + gDisplayListHead = + draw_flash_select_case_slow(gDisplayListHead, arg0->column ^ 0, one = arg0->row ^ 0, + arg0->column + 0x3F, arg0->row + 0x11); } } else { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 1, 1, 1, 0x000000FF); } - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004A34, arg0->column, arg0->row); - set_text_color(3); - func_800936B8(0x00000125, 0x0000001C, D_800E77B4, 0, 0.55f, 0.55f); + gDisplayListHead = render_menu_textures(gDisplayListHead, seg2_data_texture, arg0->column, arg0->row); + set_text_color(TEXT_YELLOW); + print_text1_left(0x00000125, 0x0000001C, gTextMenuData, 0, 0.55f, 0.55f); break; - case 0x8D: /* switch 6 */ + case MENU_ITEM_TYPE_08D: /* switch 6 */ func_800A1780(arg0); break; - case 0x7C: /* switch 6 */ - case 0x7D: /* switch 6 */ - case 0x7E: /* switch 6 */ - case 0x7F: /* switch 6 */ - case 0x80: /* switch 6 */ - case 0x81: /* switch 6 */ - case 0x82: /* switch 6 */ - case 0x83: /* switch 6 */ - case 0x84: /* switch 6 */ - case 0x85: /* switch 6 */ - case 0x86: /* switch 6 */ - case 0x87: /* switch 6 */ - case 0x88: /* switch 6 */ - case 0x89: /* switch 6 */ - case 0x8A: /* switch 6 */ - case 0x8B: /* switch 6 */ + case MENU_ITEM_TYPE_07C: /* switch 6 */ + case MENU_ITEM_TYPE_07D: /* switch 6 */ + case MENU_ITEM_TYPE_07E: /* switch 6 */ + case MENU_ITEM_TYPE_07F: /* switch 6 */ + case MENU_ITEM_TYPE_080: /* switch 6 */ + case MENU_ITEM_TYPE_081: /* switch 6 */ + case MENU_ITEM_TYPE_082: /* switch 6 */ + case MENU_ITEM_TYPE_083: /* switch 6 */ + case MENU_ITEM_TYPE_084: /* switch 6 */ + case MENU_ITEM_TYPE_085: /* switch 6 */ + case MENU_ITEM_TYPE_086: /* switch 6 */ + case MENU_ITEM_TYPE_087: /* switch 6 */ + case MENU_ITEM_TYPE_088: /* switch 6 */ + case MENU_ITEM_TYPE_089: /* switch 6 */ + case MENU_ITEM_TYPE_08A: /* switch 6 */ + case MENU_ITEM_TYPE_08B: /* switch 6 */ func_800A15EC(arg0); break; - case 0x96: /* switch 6 */ - set_text_color(4); - func_800936B8(arg0->column, arg0->row, gCupNames[D_800DC540], arg0->unk1C, arg0->unk24, 1.0f); + case MENU_ITEM_TYPE_096: /* switch 6 */ + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); + print_text1_left(arg0->column, arg0->row, gCupNames[D_800DC540], arg0->param1, arg0->paramf, 1.0f); break; - case 0x97: /* switch 6 */ - set_text_color(5); - func_80093324(arg0->column, arg0->row, gCourseNames[gCurrentCourseId], arg0->unk1C, arg0->unk24, 1.0f); + case MENU_ITEM_TYPE_097: /* switch 6 */ + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); + print_text_mode_1(arg0->column, arg0->row, gCourseNames[gCurrentCourseId], arg0->param1, arg0->paramf, + 1.0f); break; - case 0x98: /* switch 6 */ + case MENU_ITEM_TYPE_098: /* switch 6 */ func_800A2D1C(arg0); break; - case 0x5E: /* switch 6 */ + case MENU_ITEM_TYPE_05E: /* switch 6 */ gDisplayListHead = func_80096CD8(gDisplayListHead, 0x00000019, 0x00000072, 0x0000007CU, 0x0000004AU); break; - case 0xAA: /* switch 6 */ + case MENU_ITEM_TYPE_0AA: /* switch 6 */ func_800A2EB8(arg0); break; - case 0xAB: /* switch 6 */ + case MENU_ITEM_TYPE_0AB: /* switch 6 */ func_800A34A8(arg0); break; - case 0xAC: /* switch 6 */ + case MENU_ITEM_TYPE_0AC: /* switch 6 */ func_800A6154(arg0); break; - case 0xAF: /* switch 6 */ + case MENU_ITEM_TYPE_0AF: /* switch 6 */ func_800A6034(arg0); break; - case 0xB0: /* switch 6 */ + case MENU_ITEM_TYPE_0B0: /* switch 6 */ func_800A638C(arg0); break; - case 0xB1: /* switch 6 */ - case 0xB2: /* switch 6 */ - case 0xB3: /* switch 6 */ - case 0xB4: /* switch 6 */ - if (arg0->cursor != 0) { - var_v1 = arg0->type - 0xB1; - gDisplayListHead = - func_8009BA74(gDisplayListHead, - segmented_to_virtual_dupe(D_800E7D54[D_800EFD64[gCharacterSelections[var_v1]]]), - arg0->column, arg0->row); - func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, var_v1, arg0->unk1C); - func_800A11D0(arg0, var_v1, 0x000000FF); + case MENU_ITEM_TYPE_0B1: /* switch 6 */ + case MENU_ITEM_TYPE_0B2: /* switch 6 */ + case MENU_ITEM_TYPE_0B3: /* switch 6 */ + case MENU_ITEM_TYPE_0B4: /* switch 6 */ + if (arg0->state != 0) { + var_v1 = arg0->type - MENU_ITEM_TYPE_0B1; + one = D_800EFD64[gCharacterSelections[var_v1]]; + gDisplayListHead = render_menu_textures( + gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[one]), arg0->column, arg0->row); + func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, var_v1, arg0->param1); + render_cursor_player(arg0, var_v1, 0x000000FF); } break; - case 0xB9: /* switch 6 */ - func_800A3C84(arg0); + case MENU_ITEM_TYPE_0B9: /* switch 6 */ + time_trials_finish_text_render(arg0); break; - case 0xBA: /* switch 6 */ + case MENU_ITEM_TYPE_0BA: /* switch 6 */ func_800A3E60(arg0); break; - case 0xBC: /* switch 6 */ - func_800A4A24(arg0); + case MENU_ITEM_ANNOUNCE_GHOST: /* switch 6 */ + render_menu_item_announce_ghost(arg0); break; - case 0xC7: /* switch 6 */ + case MENU_ITEM_PAUSE: /* switch 6 */ render_pause_menu(arg0); break; - case 0xBD: /* switch 6 */ - func_800A5738(arg0); + case MENU_ITEM_END_COURSE_OPTION: /* switch 6 */ + render_menu_item_end_course_option(arg0); break; - case 0xE6: /* switch 6 */ - func_800A1924(arg0); + case MENU_ITEM_DATA_COURSE_IMAGE: /* switch 6 */ + render_menu_item_data_course_image(arg0); break; - case 0xE7: /* switch 6 */ - func_800A1A20(arg0); + case MENU_ITEM_DATA_COURSE_INFO: /* switch 6 */ + render_menu_item_data_course_info(arg0); break; - case 0xE8: /* switch 6 */ - func_800A1BE0(arg0); + case MENU_ITEM_DATA_COURSE_SELECTABLE: /* switch 6 */ + menu_item_data_course_selectable(arg0); break; - case 0xE9: /* switch 6 */ + case MENU_ITEM_TYPE_0E9: /* switch 6 */ func_800A1DE0(arg0); break; - case 0xEA: /* switch 6 */ + case MENU_ITEM_TYPE_0EA: /* switch 6 */ func_800A1F30(arg0); break; - case 0xF0: /* switch 6 */ + case MENU_ITEM_TYPE_0F0: /* switch 6 */ func_800A1FB0(arg0); break; - case 0xF1: /* switch 6 */ - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004638, arg0->column, arg0->row); + case MENU_ITEM_TYPE_0F1: /* switch 6 */ + gDisplayListHead = render_menu_textures(gDisplayListHead, D_02004638, arg0->column, arg0->row); break; - case 0x10E: /* switch 6 */ + case MENU_ITEM_TYPE_10E: /* switch 6 */ func_800A70E8(arg0); break; - case 0x12B: /* switch 6 */ + case MENU_ITEM_TYPE_12B: /* switch 6 */ func_800A7258(arg0); break; - case 0x12C: /* switch 6 */ + case MENU_ITEM_TYPE_12C: /* switch 6 */ func_800A72FC(arg0); break; - case 0x12D: /* switch 6 */ + case MENU_ITEM_TYPE_12D: /* switch 6 */ func_800A7448(arg0); break; - case 0x12E: /* switch 6 */ + case MENU_ITEM_TYPE_12E: /* switch 6 */ func_800A75A0(arg0); break; - case 0x12F: /* switch 6 */ + case MENU_ITEM_TYPE_12F: /* switch 6 */ func_800A761C(arg0); break; - case 0x130: /* switch 6 */ - if (arg0->cursor != 0) { - gDisplayListHead = func_8009BA74( - gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[D_800EFD64[D_802874D8.unk1E]]), - arg0->column, arg0->row); - func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, 0, arg0->unk1C); - } - break; - case 0x190: /* switch 6 */ - case 0x191: /* switch 6 */ - case 0x192: /* switch 6 */ - case 0x193: /* switch 6 */ - case 0x194: /* switch 6 */ - case 0x195: /* switch 6 */ - case 0x196: /* switch 6 */ - case 0x197: /* switch 6 */ - case 0x198: /* switch 6 */ - case 0x199: /* switch 6 */ - case 0x19A: /* switch 6 */ - case 0x19B: /* switch 6 */ - case 0x19C: /* switch 6 */ - case 0x19D: /* switch 6 */ - case 0x19E: /* switch 6 */ - case 0x19F: /* switch 6 */ - case 0x1A0: /* switch 6 */ - case 0x1A1: /* switch 6 */ - case 0x1A2: /* switch 6 */ - case 0x1A3: /* switch 6 */ - case 0x1A4: /* switch 6 */ - case 0x1A5: /* switch 6 */ - case 0x1A6: /* switch 6 */ - case 0x1A7: /* switch 6 */ - case 0x1A8: /* switch 6 */ - case 0x1A9: /* switch 6 */ - case 0x1AA: /* switch 6 */ - case 0x1AB: /* switch 6 */ - case 0x1AC: /* switch 6 */ - case 0x1AD: /* switch 6 */ - case 0x1AE: /* switch 6 */ - case 0x1AF: /* switch 6 */ - case 0x1B0: /* switch 6 */ - case 0x1B1: /* switch 6 */ - case 0x1B2: /* switch 6 */ - case 0x1B3: /* switch 6 */ - case 0x1B4: /* switch 6 */ - case 0x1B5: /* switch 6 */ - case 0x1B6: /* switch 6 */ - case 0x1B7: /* switch 6 */ - case 0x1B8: /* switch 6 */ - case 0x1B9: /* switch 6 */ - case 0x1BA: /* switch 6 */ - case 0x1BB: /* switch 6 */ - case 0x1BC: /* switch 6 */ - case 0x1BD: /* switch 6 */ - case 0x1BE: /* switch 6 */ - case 0x1BF: /* switch 6 */ - case 0x1C0: /* switch 6 */ - case 0x1C1: /* switch 6 */ - case 0x1C2: /* switch 6 */ - case 0x1C3: /* switch 6 */ - case 0x1C4: /* switch 6 */ - case 0x1C5: /* switch 6 */ - case 0x1C6: /* switch 6 */ - case 0x1C7: /* switch 6 */ - case 0x1C8: /* switch 6 */ - case 0x1C9: /* switch 6 */ - case 0x1CA: /* switch 6 */ - case 0x1CB: /* switch 6 */ - case 0x1CC: /* switch 6 */ - case 0x1CD: /* switch 6 */ - case 0x1CE: /* switch 6 */ - func_800A7790(arg0); + case MENU_ITEM_TYPE_130: /* switch 6 */ + if (arg0->state != 0) { + var_a1 = D_800EFD64[D_802874D8.unk1E]; + gDisplayListHead = render_menu_textures( + gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[var_a1]), arg0->column, arg0->row); + func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, 0, arg0->param1); + } + break; + case MENU_ITEM_TYPE_190: /* switch 6 */ + case MENU_ITEM_TYPE_191: /* switch 6 */ + case MENU_ITEM_TYPE_192: /* switch 6 */ + case MENU_ITEM_TYPE_193: /* switch 6 */ + case MENU_ITEM_TYPE_194: /* switch 6 */ + case MENU_ITEM_TYPE_195: /* switch 6 */ + case MENU_ITEM_TYPE_196: /* switch 6 */ + case MENU_ITEM_TYPE_197: /* switch 6 */ + case MENU_ITEM_TYPE_198: /* switch 6 */ + case MENU_ITEM_TYPE_199: /* switch 6 */ + case MENU_ITEM_TYPE_19A: /* switch 6 */ + case MENU_ITEM_TYPE_19B: /* switch 6 */ + case MENU_ITEM_TYPE_19C: /* switch 6 */ + case MENU_ITEM_TYPE_19D: /* switch 6 */ + case MENU_ITEM_TYPE_19E: /* switch 6 */ + case MENU_ITEM_TYPE_19F: /* switch 6 */ + case MENU_ITEM_TYPE_1A0: /* switch 6 */ + case MENU_ITEM_TYPE_1A1: /* switch 6 */ + case MENU_ITEM_TYPE_1A2: /* switch 6 */ + case MENU_ITEM_TYPE_1A3: /* switch 6 */ + case MENU_ITEM_TYPE_1A4: /* switch 6 */ + case MENU_ITEM_TYPE_1A5: /* switch 6 */ + case MENU_ITEM_TYPE_1A6: /* switch 6 */ + case MENU_ITEM_TYPE_1A7: /* switch 6 */ + case MENU_ITEM_TYPE_1A8: /* switch 6 */ + case MENU_ITEM_TYPE_1A9: /* switch 6 */ + case MENU_ITEM_TYPE_1AA: /* switch 6 */ + case MENU_ITEM_TYPE_1AB: /* switch 6 */ + case MENU_ITEM_TYPE_1AC: /* switch 6 */ + case MENU_ITEM_TYPE_1AD: /* switch 6 */ + case MENU_ITEM_TYPE_1AE: /* switch 6 */ + case MENU_ITEM_TYPE_1AF: /* switch 6 */ + case MENU_ITEM_TYPE_1B0: /* switch 6 */ + case MENU_ITEM_TYPE_1B1: /* switch 6 */ + case MENU_ITEM_TYPE_1B2: /* switch 6 */ + case MENU_ITEM_TYPE_1B3: /* switch 6 */ + case MENU_ITEM_TYPE_1B4: /* switch 6 */ + case MENU_ITEM_TYPE_1B5: /* switch 6 */ + case MENU_ITEM_TYPE_1B6: /* switch 6 */ + case MENU_ITEM_TYPE_1B7: /* switch 6 */ + case MENU_ITEM_TYPE_1B8: /* switch 6 */ + case MENU_ITEM_TYPE_1B9: /* switch 6 */ + case MENU_ITEM_TYPE_1BA: /* switch 6 */ + case MENU_ITEM_TYPE_1BB: /* switch 6 */ + case MENU_ITEM_TYPE_1BC: /* switch 6 */ + case MENU_ITEM_TYPE_1BD: /* switch 6 */ + case MENU_ITEM_TYPE_1BE: /* switch 6 */ + case MENU_ITEM_TYPE_1BF: /* switch 6 */ + case MENU_ITEM_TYPE_1C0: /* switch 6 */ + case MENU_ITEM_TYPE_1C1: /* switch 6 */ + case MENU_ITEM_TYPE_1C2: /* switch 6 */ + case MENU_ITEM_TYPE_1C3: /* switch 6 */ + case MENU_ITEM_TYPE_1C4: /* switch 6 */ + case MENU_ITEM_TYPE_1C5: /* switch 6 */ + case MENU_ITEM_TYPE_1C6: /* switch 6 */ + case MENU_ITEM_TYPE_1C7: /* switch 6 */ + case MENU_ITEM_TYPE_1C8: /* switch 6 */ + case MENU_ITEM_TYPE_1C9: /* switch 6 */ + case MENU_ITEM_TYPE_1CA: /* switch 6 */ + case MENU_ITEM_TYPE_1CB: /* switch 6 */ + case MENU_ITEM_TYPE_1CC: /* switch 6 */ + case MENU_ITEM_TYPE_1CD: /* switch 6 */ + case MENU_ITEM_TYPE_1CE: /* switch 6 */ + menu_item_credits_render(arg0); break; } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009F5E0.s") -#endif void func_800A08D8(u8 arg0, s32 column, s32 row) { if (arg0 >= 0x10) { @@ -6312,7 +6398,7 @@ void func_800A08D8(u8 arg0, s32 column, s32 row) { arg0 = 0x2B; } gDisplayListHead = - func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7AF8[arg0]), column, row); + render_menu_textures(gDisplayListHead, segmented_to_virtual_dupe(D_800E7AF8[arg0]), column, row); } } } @@ -6334,36 +6420,31 @@ s32 func_800A095C(char* someString, s32 len, s32 column, s32 row) { return nonTerminatorCount; } -#ifdef NON_MATCHING -// Non-matching due to the constants 9 and 0xA being saved to the wrong registers -// Same functionality, but doesn't match byte for byte :/ -void func_800A09E0(struct_8018D9E0_entry* arg0) { - s32 table_row, x = 0x20, y; +void func_800A09E0(MenuItem* arg0) { + s32 table_row; + gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH - 1, 194); for (table_row = 0; table_row < 9; table_row++) { - if ((D_800E86D0[0] != 0) || ((table_row != 0) && (table_row != 8))) { - y = (table_row * 0xA) + arg0->row; - gDisplayListHead = func_8009BA74(gDisplayListHead, D_0200157C, x, y); + if (gControllerPakScrollDirection == CONTROLLER_PAK_SCROLL_DIR_NONE && (table_row == 0 || table_row == 8)) { + continue; } + gDisplayListHead = render_menu_textures(gDisplayListHead, D_0200157C, 0x20, (table_row * 0xA) + arg0->row); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A09E0.s") -#endif -void func_800A0AD0(UNUSED struct_8018D9E0_entry* arg0) { - struct_8018D9E0_entry* temp_t1; - // Find struct_8018D9E0_entry with a type/id of 0xDA - temp_t1 = find_8018D9E0_entry_dupe(0xDA); +void func_800A0AD0(UNUSED MenuItem* arg0) { + MenuItem* temp_t1; + // Find MenuItem with a type/id of 0xDA + temp_t1 = find_menu_items_dupe(MENU_ITEM_TYPE_0DA); if ((gControllerPakMenuSelection != CONTROLLER_PAK_MENU_SELECT_RECORD) && (gControllerPakMenuSelection != CONTROLLER_PAK_MENU_END)) { - gDPSetPrimColor(gDisplayListHead++, 0, 0, 0xFF, temp_t1->unk20, 0x00, 0xFF); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 0xFF, temp_t1->param2, 0x00, 0xFF); gDisplayListHead = - func_8009BA74(gDisplayListHead, D_02001874, 0x24, (gControllerPakSelectedTableRow * 0xA) + 0x7C); + render_menu_textures(gDisplayListHead, D_02001874, 0x24, (gControllerPakSelectedTableRow * 0xA) + 0x7C); } } -void func_800A0B80(struct_8018D9E0_entry* arg0) { +void func_800A0B80(MenuItem* arg0) { UNUSED s32 temp_a2; s32 temp_s1; s32 temp_s2; @@ -6374,12 +6455,12 @@ void func_800A0B80(struct_8018D9E0_entry* arg0) { gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x32, 0xFF); for (var_s5 = 0; var_s5 < 9; var_s5++) { - if (D_800E86C4[var_s5] == 0) { + if (gControllerPakVisibleTableRows[var_s5] == 0) { continue; } temp_s1 = var_s5 * 0xA; - var_s0 = D_800E86C4[var_s5]; + var_s0 = gControllerPakVisibleTableRows[var_s5]; if (var_s0 < 0xA) { func_800A08D8(var_s0 + 0x10, 0x00000032, arg0->row + temp_s1 + 1); } else { @@ -6388,8 +6469,8 @@ void func_800A0B80(struct_8018D9E0_entry* arg0) { func_800A08D8(0x11U, 0x0000002F, arg0->row + temp_s1 + 1); } temp_s2 = arg0->row + temp_s1 + 1; - if (pfsError[D_800E86C4[var_s5] - 1] == 0) { - temp_s4 = &pfsState[D_800E86C4[var_s5] - 1]; + if (pfsError[gControllerPakVisibleTableRows[var_s5] - 1] == 0) { + temp_s4 = &pfsState[gControllerPakVisibleTableRows[var_s5] - 1]; var_s0 = func_800A095C(temp_s4->game_name, 0x00000010, 0x0000004F, temp_s2); if (temp_s4->ext_name[0] != 0) { func_800A08D8(0x3CU, (var_s0 * 8) + 0x4F, temp_s2); @@ -6419,18 +6500,18 @@ void func_800A0DFC(void) { temp_t6 = var_s0 % 10; var_s0 /= 10; gDisplayListHead = - func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D0C[temp_t6]), var_s1, 0x000000B8); + render_menu_textures(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D0C[temp_t6]), var_s1, 0x000000B8); var_s1 -= 9; } while (var_s0 != 0); } -void func_800A0EB8(UNUSED struct_8018D9E0_entry* arg0, s32 arg1) { +void func_800A0EB8(UNUSED MenuItem* arg0, s32 arg1) { s32 var_t1; s32 thing; Unk_D_800E70A0* temp_v0; - struct_8018D9E0_entry* temp_t3; + MenuItem* temp_t3; - temp_t3 = find_8018D9E0_entry_dupe(0x000000DA); + temp_t3 = find_menu_items_dupe(MENU_ITEM_TYPE_0DA); if (arg1 == 0) { if (gControllerPakMenuSelection == CONTROLLER_PAK_MENU_END) { var_t1 = 1; @@ -6440,52 +6521,52 @@ void func_800A0EB8(UNUSED struct_8018D9E0_entry* arg0, s32 arg1) { } else { thing = gControllerPakMenuSelection; // ? if ((thing == CONTROLLER_PAK_MENU_ERASE) || (thing == CONTROLLER_PAK_MENU_QUIT)) { - var_t1 = ((arg1 * 2) + gControllerPakMenuSelection) - 3; + var_t1 = ((arg1 * 2) + gControllerPakMenuSelection) - CONTROLLER_PAK_MENU_ERASE; } else { return; } } temp_v0 = &D_800E7278[var_t1]; - gDPSetPrimColor(gDisplayListHead++, 0, 0, 0xFF, temp_t3->unk20, 0x00, 0xFF); - gDisplayListHead = func_8009BA74(gDisplayListHead, D_0200184C, (s32) temp_v0->column, (s32) temp_v0->row); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 0xFF, temp_t3->param2, 0x00, 0xFF); + gDisplayListHead = render_menu_textures(gDisplayListHead, D_0200184C, (s32) temp_v0->column, (s32) temp_v0->row); } -void func_800A0FA4(struct_8018D9E0_entry* arg0, s32 arg1) { - switch (arg0->cursor) { +void func_800A0FA4(MenuItem* arg0, s32 arg1) { + switch (arg0->state) { case 0: case 2: case 3: - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E8234[(arg1 * 2) + 0]), - arg0->column, arg0->row); - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E8234[(arg1 * 2) + 1]), - arg0->column, arg0->row); + gDisplayListHead = render_menu_textures( + gDisplayListHead, segmented_to_virtual_dupe(D_800E8234[(arg1 * 2) + 0]), arg0->column, arg0->row); + gDisplayListHead = render_menu_textures( + gDisplayListHead, segmented_to_virtual_dupe(D_800E8234[(arg1 * 2) + 1]), arg0->column, arg0->row); break; case 1: case 4: gDisplayListHead = func_8009BC9C(gDisplayListHead, segmented_to_virtual_dupe(D_800E8234[(arg1 * 2) + 0]), - arg0->column, arg0->row, 2, arg0->unk1C); + arg0->column, arg0->row, 2, arg0->param1); gDisplayListHead = func_8009BC9C(gDisplayListHead, segmented_to_virtual_dupe(D_800E8234[(arg1 * 2) + 1]), - arg0->column, arg0->row, 2, arg0->unk1C); + arg0->column, arg0->row, 2, arg0->param1); break; } } -void func_800A10CC(struct_8018D9E0_entry* arg0) { +void func_800A10CC(MenuItem* arg0) { s32 var_s1; s32 index; - switch (arg0->cursor) { + switch (arg0->state) { case 2: case 3: case 4: case 5: gDisplayListHead = draw_box_fill(gDisplayListHead, 0x0000001E, 0x00000032, 0x00000122, 0x0000006E, 0, 0, 0, 0x000000FF); - index = arg0->cursor - 2; - set_text_color(3); + index = arg0->state - 2; + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 4; var_s1++) { // In a perfect world this would be `D_800E7940[index][var_s1]` - func_80093324(0x00000023, 0x41 + (0xD * var_s1), D_800E7940[(index * 4) + var_s1], 0, 0.65f, 0.65f); + print_text_mode_1(0x00000023, 0x41 + (0xD * var_s1), D_800E7940[(index * 4) + var_s1], 0, 0.65f, 0.65f); } break; default: @@ -6493,34 +6574,34 @@ void func_800A10CC(struct_8018D9E0_entry* arg0) { } } -void func_800A11D0(struct_8018D9E0_entry* arg0, s32 arg1, s32 arg2) { +void render_cursor_player(MenuItem* arg0, s32 arg1, s32 arg2) { RGBA16* temp_v1; temp_v1 = &D_800E74A8[arg1]; gDPSetPrimColor(gDisplayListHead++, 0, 0, temp_v1->red, temp_v1->green, temp_v1->blue, temp_v1->alpha); gDPSetEnvColor(gDisplayListHead++, arg2, arg2, arg2, 0x00); - gDisplayListHead = - func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82B4[arg1]), arg0->column, arg0->row); + gDisplayListHead = render_menu_textures( + gDisplayListHead, segmented_to_virtual_dupe(gMenuTexturesBorderPlayer[arg1]), arg0->column, arg0->row); } -void func_800A12BC(struct_8018D9E0_entry* arg0, MkTexture* arg1) { - switch (arg0->cursor) { +void func_800A12BC(MenuItem* arg0, MenuTexture* arg1) { + switch (arg0->state) { case 0: case 2: case 4: - gDisplayListHead = func_8009BA74(gDisplayListHead, arg1, arg0->column, arg0->row); + gDisplayListHead = render_menu_textures(gDisplayListHead, arg1, arg0->column, arg0->row); break; case 1: case 3: - gDisplayListHead = func_8009BC9C(gDisplayListHead, arg1, arg0->column, arg0->row, 2, arg0->unk1C); + gDisplayListHead = func_8009BC9C(gDisplayListHead, arg1, arg0->column, arg0->row, 2, arg0->param1); break; } } -void func_800A1350(struct_8018D9E0_entry* arg0) { +void func_800A1350(MenuItem* arg0) { s32 thing; if (func_800AAFCC(arg0->type - 0x2B) < 0) { - switch (arg0->cursor) { + switch (arg0->state) { case 0: case 2: case 4: @@ -6529,7 +6610,7 @@ void func_800A1350(struct_8018D9E0_entry* arg0) { break; case 1: case 3: - thing = arg0->unk1C; + thing = arg0->param1; gDisplayListHead = draw_box(gDisplayListHead, arg0->column + thing, arg0->row, (arg0->column - thing) + 0x40, arg0->row + 0x4C, 0, 0, 0, 0x00000064); break; @@ -6537,35 +6618,37 @@ void func_800A1350(struct_8018D9E0_entry* arg0) { } } -void func_800A143C(struct_8018D9E0_entry* arg0, s32 arg1) { - switch (arg0->cursor) { +void func_800A143C(MenuItem* arg0, s32 arg1) { + switch (arg0->state) { case 0: case 2: case 3: - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg1 + 1]), - arg0->column, arg0->row); + gDisplayListHead = + render_menu_textures(gDisplayListHead, segmented_to_virtual_dupe(gMenuTexturesTrackSelection[arg1 + 1]), + arg0->column, arg0->row); break; case 1: case 4: - gDisplayListHead = func_8009BC9C(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg1 + 1]), - arg0->column, arg0->row, 2, arg0->unk1C); + gDisplayListHead = + func_8009BC9C(gDisplayListHead, segmented_to_virtual_dupe(gMenuTexturesTrackSelection[arg1 + 1]), + arg0->column, arg0->row, 2, arg0->param1); break; } } -void func_800A1500(struct_8018D9E0_entry* arg0) { - struct_8018D9E0_entry* temp_v0; +void func_800A1500(MenuItem* arg0) { + MenuItem* temp_v0; Unk_D_800E70A0* temp_v0_2; s32 var_a1; var_a1 = 0; - temp_v0 = find_8018D9E0_entry_dupe(0x00000064); - switch (temp_v0->cursor) { /* irregular */ + temp_v0 = find_menu_items_dupe(MENU_ITEM_TYPE_064); + switch (temp_v0->state) { /* irregular */ case 0: case 1: break; case 2: - if (((temp_v0->unk1C % 4) + 0x5F) != arg0->type) { + if (((temp_v0->param1 % 4) + 0x5F) != arg0->type) { var_a1 = 1; } break; @@ -6573,18 +6656,18 @@ void func_800A1500(struct_8018D9E0_entry* arg0) { var_a1 = 1; break; } - switch (var_a1) { /* switch 1; irregular */ - case 0: /* switch 1 */ + switch (var_a1) { + case 0: func_8009A76C(arg0->D_8018DEE0_index, 0x00000017, 0x00000070, -1); break; - case 1: /* switch 1 */ + case 1: temp_v0_2 = &D_800E7168[arg0->type - 0x5F]; func_8009A76C(arg0->D_8018DEE0_index, temp_v0_2->column, temp_v0_2->row, -2); break; } } -void func_800A15EC(struct_8018D9E0_entry* arg0) { +void func_800A15EC(MenuItem* arg0) { s16 courseId = gCupCourseOrder[(arg0->type - 0x7C) / 4][(arg0->type - 0x7C) % 4]; gDisplayListHead = func_8009C204(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D74[courseId]), arg0->column, arg0->row, 2); @@ -6601,7 +6684,7 @@ void func_800A15EC(struct_8018D9E0_entry* arg0) { } } -void func_800A1780(struct_8018D9E0_entry* arg0) { +void func_800A1780(MenuItem* arg0) { RGBA16* temp_a1; RGBA16* temp_v1; s32 temp_a2; @@ -6610,61 +6693,69 @@ void func_800A1780(struct_8018D9E0_entry* arg0) { u32 blue; u32 alpha; - temp_v1 = &D_800E74D0[arg0->unk20]; - temp_a1 = &D_800E74D0[(arg0->unk20 + 1) % 3]; - temp_a2 = 256 - arg0->unk1C; - red = ((temp_v1->red * temp_a2) + (temp_a1->red * arg0->unk1C)) / 256; - green = ((temp_v1->green * temp_a2) + (temp_a1->green * arg0->unk1C)) / 256; - blue = ((temp_v1->blue * temp_a2) + (temp_a1->blue * arg0->unk1C)) / 256; - alpha = ((temp_v1->alpha * temp_a2) + (temp_a1->alpha * arg0->unk1C)) / 256; + temp_v1 = &D_800E74D0[arg0->param2]; + temp_a1 = &D_800E74D0[(arg0->param2 + 1) % 3]; + temp_a2 = 256 - arg0->param1; + red = ((temp_v1->red * temp_a2) + (temp_a1->red * arg0->param1)) / 256; + green = ((temp_v1->green * temp_a2) + (temp_a1->green * arg0->param1)) / 256; + blue = ((temp_v1->blue * temp_a2) + (temp_a1->blue * arg0->param1)) / 256; + alpha = ((temp_v1->alpha * temp_a2) + (temp_a1->alpha * arg0->param1)) / 256; gDPSetPrimColor(gDisplayListHead++, 0, 0, red, green, blue, alpha); - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_02001FA4), arg0->column, arg0->row); + gDisplayListHead = + render_menu_textures(gDisplayListHead, segmented_to_virtual_dupe(D_02001FA4), arg0->column, arg0->row); } -void func_800A1924(struct_8018D9E0_entry* arg0) { +void render_menu_item_data_course_image(MenuItem* arg0) { + // render course preview func_8009A76C(arg0->D_8018DEE0_index, 0x17, 0x84, -1); if (func_800B639C(gTimeTrialDataCourseIndex) >= TIME_TRIAL_DATA_LUIGI_RACEWAY) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, 0x57, 0x84, 0x96, 0x95); - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004A0C, 0x57, 0x84); + gDisplayListHead = render_menu_textures(gDisplayListHead, D_02004A0C, 0x57, 0x84); } + // course minimap func_8004EF9C(gCupCourseOrder[gTimeTrialDataCourseIndex / 4][gTimeTrialDataCourseIndex % 4]); do { gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); } while (0); } -void func_800A1A20(struct_8018D9E0_entry* arg0) { +void render_menu_item_data_course_info(MenuItem* arg0) { s16 courseId; s32 recordType; s32 rowOffset; courseId = gCupCourseOrder[gTimeTrialDataCourseIndex / 4][gTimeTrialDataCourseIndex % 4]; arg0->column = 0x14; + // name of the course set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); - draw_text(0x69, arg0->row + 0x19, gCourseNamesDup[courseId], 0, 0.75f, 0.75f); + print_text1_center_mode_1(0x69, arg0->row + 0x19, gCourseNamesDup[courseId], 0, 0.75f, 0.75f); + + // distance set_text_color(TEXT_RED); - func_80093324(0x2D, arg0->row + 0x28, (char*) &D_800E77D8, 0, 0.75f, 0.75f); - func_800936B8(0xA5, arg0->row + 0x28, sCourseLengths[courseId], 1, 0.75f, 0.75f); + print_text_mode_1(0x2D, arg0->row + 0x28, (char*) &gTextDistance, 0, 0.75f, 0.75f); + print_text1_left(0xA5, arg0->row + 0x28, sCourseLengths[courseId], 1, 0.75f, 0.75f); + + // best lap record set_text_color(TEXT_YELLOW); - func_80093324(0xA0, arg0->row + 0x86, D_800E7728[0], 0, 0.75f, 0.75f); + print_text_mode_1(0xA0, arg0->row + 0x86, gBestTimeText[0], 0, 0.75f, 0.75f); // Print the 3 Lap Time Trial records for (recordType = TIME_TRIAL_3LAP_RECORD_1, rowOffset = 0; recordType < TIME_TRIAL_1LAP_RECORD; recordType++, rowOffset += 0xD) { set_text_color(TEXT_RED); - func_800A474C(recordType, 0x96, arg0->row + rowOffset + 0x92); + render_lap_times(recordType, 0x96, arg0->row + rowOffset + 0x92); } set_text_color(TEXT_YELLOW); - func_80093324(0xA0, arg0->row + 0xD5, D_800E7728[1], 0, 0.75f, 0.75f); - func_800A474C(TIME_TRIAL_1LAP_RECORD, 0x96, arg0->row + 0xE1); + print_text_mode_1(0xA0, arg0->row + 0xD5, gBestTimeText[1], 0, 0.75f, 0.75f); + render_lap_times(TIME_TRIAL_1LAP_RECORD, 0x96, arg0->row + 0xE1); } -void func_800A1BE0(struct_8018D9E0_entry* arg0) { +void menu_item_data_course_selectable(MenuItem* arg0) { UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; UNUSED char* wut; Unk_D_800E70A0 sp78; - s32 var_s0; + s32 i; s32 var_s1; s32 var_s2; UNUSED s32 thing; @@ -6672,20 +6763,20 @@ void func_800A1BE0(struct_8018D9E0_entry* arg0) { temp_s6 = &gSaveData.allCourseTimeTrialRecords.cupRecords[gTimeTrialDataCourseIndex / 4] .courseRecords[gTimeTrialDataCourseIndex % 4]; - for (var_s0 = 0; var_s0 < 3; var_s0++) { - wut = D_800E7834[var_s0]; + for (i = 0; i < ARRAY_COUNT(gTextMenuOption); i++) { + wut = gTextMenuOption[i]; var_s1 = 0; - if (var_s0 == gCourseRecordsMenuSelection) { - var_s2 = 5; + if (i == gCourseRecordsMenuSelection) { + var_s2 = TEXT_BLUE_GREEN_RED_CYCLE_2; } else { - var_s2 = 1; - switch (var_s0) { /* irregular */ - case 1: + var_s2 = TEXT_GREEN; + switch (i) { /* irregular */ + case COURSE_RECORDS_MENU_ERASE_RECORDS: if (temp_s6->unknownBytes[0] == 0) { var_s1 = 1; } break; - case 2: + case COURSE_RECORDS_MENU_ERASE_GHOST: if (func_800B639C((s32) gTimeTrialDataCourseIndex) < 0) { var_s1 = 1; } @@ -6693,12 +6784,12 @@ void func_800A1BE0(struct_8018D9E0_entry* arg0) { } } if (var_s1 != 0) { - set_text_color(0); + set_text_color(TEXT_BLUE); gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, 0x96); - func_80093358(0x00000025, 0x3F + (0xD * var_s0), D_800E7834[var_s0], 0, 0.6f, 0.6f); + print_text_mode_2(0x00000025, 0x3F + (0xD * i), gTextMenuOption[i], 0, 0.6f, 0.6f); } else { set_text_color(var_s2); - func_80093324(0x00000025, 0x3F + (0xD * var_s0), D_800E7834[var_s0], 0, 0.6f, 0.6f); + print_text_mode_1(0x00000025, 0x3F + (0xD * i), gTextMenuOption[i], 0, 0.6f, 0.6f); } } sp78.column = 0x001F; @@ -6706,7 +6797,7 @@ void func_800A1BE0(struct_8018D9E0_entry* arg0) { func_800A66A8(arg0, (Unk_D_800E70A0*) &sp78); } -void func_800A1DE0(struct_8018D9E0_entry* arg0) { +void func_800A1DE0(MenuItem* arg0) { UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; @@ -6717,280 +6808,272 @@ void func_800A1DE0(struct_8018D9E0_entry* arg0) { s32 var_s1; UNUSED char* wut; - set_text_color(1); + set_text_color(TEXT_GREEN); for (var_s1 = 0; var_s1 < 3; var_s1++) { // Removing `wut` introduces counter intuitive changes to how this loop is handled - // Also, in a perfect world this would be `D_800E7848[gCourseRecordsMenuSelection - 1][var_s1]` - wut = D_800E7848[(gCourseRecordsMenuSelection - 1) * 3 + var_s1]; - func_80093324(0x0000001B, 0x3C + (0xD * var_s1), D_800E7848[(gCourseRecordsMenuSelection - 1) * 3 + var_s1], 0, - 0.65f, 0.65f); + // Also, in a perfect world this would be `gEraseBestGhostText[gCourseRecordsMenuSelection - 1][var_s1]` + wut = gEraseBestGhostText[(gCourseRecordsMenuSelection - 1) * 3 + var_s1]; + print_text_mode_1(0x0000001B, 0x3C + (0xD * var_s1), + gEraseBestGhostText[(gCourseRecordsMenuSelection - 1) * 3 + var_s1], 0, 0.65f, 0.65f); } - for (var_s1 = 0; var_s1 < 2; var_s1++) { + for (var_s1 = 0; var_s1 < ARRAY_COUNT(D_800E7840); var_s1++) { wut = D_800E7840[var_s1]; - if (var_s1 == D_8018EDF9) { + if (var_s1 == gCourseRecordsSubMenuSelection) { var_a0 = 5; } else { var_a0 = 1; } set_text_color(var_a0); - func_80093324(0x00000043, 0x6E + (0xD * var_s1), D_800E7840[var_s1], 0, 0.65f, 0.65f); + print_text_mode_1(0x00000043, 0x6E + (0xD * var_s1), D_800E7840[var_s1], 0, 0.65f, 0.65f); } sp58.column = 0x003B; - sp58.row = (D_8018EDF9 * 0xD) + 0x66; + sp58.row = (gCourseRecordsSubMenuSelection * 0xD) + 0x66; func_800A66A8(arg0, &sp58); } -void func_800A1F30(UNUSED struct_8018D9E0_entry* unused) { +void func_800A1F30(UNUSED MenuItem* unused) { s32 row; s32 text; set_text_color(TEXT_RED); for (row = 0x49, text = 0; row < 0x69; row += 0x10, text++) { - func_80093324(0x2A, row, D_800E7860[text], 0, 0.75f, 0.75f); + print_text_mode_1(0x2A, row, D_800E7860[text], 0, 0.75f, 0.75f); } } -#ifdef NON_MATCHING -// Register allocation stuff, minor stack diffs -void func_800A1FB0(struct_8018D9E0_entry* arg0) { +void func_800A1FB0(MenuItem* arg0) { Unk_D_800E70A0 spE0; - UNUSED s32 stackPadding0; - UNUSED s32 stackPadding1; - UNUSED s32 stackPadding2; - UNUSED s32 stackPadding3; - UNUSED s32 stackPadding4; - UNUSED s32 stackPadding5; + s32 var_s1; + UNUSED s32 pad[2]; + UNUSED s32 temp; + UNUSED s32 pad2[2]; s32 var_s5; s32 var_s4; - UNUSED s32 stackPadding6; + s32 j; char spB8[3]; - UNUSED s32 stackPadding7; - UNUSED s32 stackPadding8; - s32 var_s1; + UNUSED s32 pad3[2]; + s32 i; char spA8[3]; - s32 var_s2; - UNUSED s32 temp_v0; - UNUSED s32 stackPadding9; + UNUSED s32 pad4[3]; char sp98[3]; struct_8018EE10_entry* var_v1; gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, 0x00000064); - switch (D_8018EDEC) { /* switch 1 */ - case 0x15: /* switch 1 */ - case 0x16: /* switch 1 */ - case 0x17: /* switch 1 */ - case 0x18: /* switch 1 */ - for (stackPadding0 = 0; stackPadding0 < 4; stackPadding0++) { - set_text_color_rainbow_if_selected(D_8018EDEC - 0x15, stackPadding0, 3); - func_80093324(0x00000032, 0x55 + (0x23 * stackPadding0), D_800E7868[stackPadding0], 0, 0.9f, 1.0f); - if (stackPadding0 == (D_8018EDEC - 0x15)) { + switch (gSubMenuSelection) { + case SUB_MENU_OPTION_RETURN_GAME_SELECT: + case SUB_MENU_OPTION_SOUND_MODE: + case SUB_MENU_OPTION_COPY_CONTROLLER_PAK: + case SUB_MENU_OPTION_ERASE_ALL_DATA: + for (i = 0; i < ARRAY_COUNT(gTextOptionMenu); i++) { + set_text_color_rainbow_if_selected(gSubMenuSelection - SUB_MENU_OPTION_MIN, i, 3); + print_text_mode_1(0x00000032, 0x55 + (0x23 * i), gTextOptionMenu[i], 0, 0.9f, 1.0f); + if (i == (gSubMenuSelection - SUB_MENU_OPTION_MIN)) { spE0.column = 0x0032; - spE0.row = 0x55 + (0x23 * stackPadding0); + spE0.row = 0x55 + (0x23 * i); } } - set_text_color(1); - draw_text(0x000000E6, 0x00000078, gSoundModeNames[gSoundMode], 0, 1.0f, 1.0f); + set_text_color(TEXT_GREEN); + print_text1_center_mode_1(0x000000E6, 0x55 + 0x23, gSoundModeNames[gSoundMode], 0, 1.0f, 1.0f); break; - case 0x1E: /* switch 1 */ - case 0x1F: /* switch 1 */ - set_text_color(3); - for (stackPadding0 = 0; stackPadding0 < 3; stackPadding0++) { - func_80093324(0x00000028, 0x55 + (0x14 * stackPadding0), D_800E7878[stackPadding0], 0, 1.0f, 1.0f); + case SUB_MENU_ERASE_QUIT: + case SUB_MENU_ERASE_ERASE: + set_text_color(TEXT_YELLOW); + for (i = 0; i < ARRAY_COUNT(D_800E7878); i++) { + print_text_mode_1(0x00000028, 0x55 + (0x14 * i), D_800E7878[i], 0, 1.0f, 1.0f); } - for (stackPadding0 = 0; stackPadding0 < 2; stackPadding0++) { - set_text_color_rainbow_if_selected(D_8018EDEC - 0x1E, stackPadding0, 1); - func_80093324(0x00000084, 0x96 + (0x19 * stackPadding0), D_800E7840[stackPadding0], 0, 1.0f, 1.0f); - if (stackPadding0 == (D_8018EDEC - 0x1E)) { + for (i = 0; i < ARRAY_COUNT(D_800E7840); i++) { + set_text_color_rainbow_if_selected(gSubMenuSelection - SUB_MENU_ERASE_MIN, i, 1); + print_text_mode_1(0x00000084, 0x96 + (0x19 * i), D_800E7840[i], 0, 1.0f, 1.0f); + if (i == (gSubMenuSelection - SUB_MENU_ERASE_MIN)) { spE0.column = 0x0084; - spE0.row = 0x96 + (0x19 * stackPadding0); - } - } - break; - case 0x20: /* switch 1 */ - set_text_color(3); - for (stackPadding0 = 0; stackPadding0 < 3; stackPadding0++) { - func_80093324(0x00000032, 0x55 + (0x14 * stackPadding0), D_800E7884[stackPadding0], 0, 1.0f, 1.0f); - } - break; - case 0x2A: /* switch 1 */ - case 0x2B: /* switch 1 */ - case 0x2C: /* switch 1 */ - case 0x2D: /* switch 1 */ - set_text_color(2); - var_s1 = D_8018EDEC - 0x2A; - for (stackPadding0 = 0; stackPadding0 < 3; stackPadding0++) { - func_80093324(0x00000032, 0x55 + (0x14 * stackPadding0), D_800E78D0[(var_s1 * 3) + stackPadding0], 0, - 0.9f, 0.9f); - } - break; - case 0x34: /* switch 1 */ - case 0x35: /* switch 1 */ - case 0x36: /* switch 1 */ - case 0x37: /* switch 1 */ - set_text_color(2); - var_s1 = D_8018EDEC - 0x34; - for (stackPadding0 = 0; stackPadding0 < 4; stackPadding0++) { - func_80093324(0x00000023, 0x55 + (0x14 * stackPadding0), D_800E7890[(var_s1 * 4) + stackPadding0], 0, - 0.8f, 0.8f); - } - break; - case 0x41: /* switch 1 */ - case 0x42: /* switch 1 */ - set_text_color(2); - var_s1 = D_8018EDEC - 0x41; - for (stackPadding0 = 0; stackPadding0 < 3; stackPadding0++) { - func_80093324(0x00000041, 0x55 + (0x14 * stackPadding0), D_800E7900[(var_s1 * 3) + stackPadding0], 0, - 0.9f, 0.9f); - } - break; - case 0x46: /* switch 1 */ - case 0x47: /* switch 1 */ - set_text_color(3); - for (stackPadding0 = 0; stackPadding0 < 3; stackPadding0++) { - func_80093324(0x00000050, 0x55 + (0x14 * stackPadding0), D_800E7A48[stackPadding0], 0, 1.0f, 1.0f); - } - break; - case 0x28: /* switch 1 */ - case 0x29: /* switch 1 */ - case 0x32: /* switch 1 */ - case 0x33: /* switch 1 */ - switch (D_8018EDEC) { - case 0x28: - case 0x29: - var_s5 = 0x28; + spE0.row = 0x96 + (0x19 * i); + } + } + break; + case SUB_MENU_SAVE_DATA_ERASED: + set_text_color(TEXT_YELLOW); + for (i = 0; i < ARRAY_COUNT(D_800E7884); i++) { + print_text_mode_1(0x00000032, 0x55 + (0x14 * i), D_800E7884[i], 0, 1.0f, 1.0f); + } + break; + case SUB_MENU_COPY_PAK_ERROR_NO_GHOST_DATA: + case SUB_MENU_COPY_PAK_ERROR_NO_GAME_DATA: + case SUB_MENU_COPY_PAK_ERROR_NO_PAK_2P: + case SUB_MENU_COPY_PAK_ERROR_BAD_READ_2P: + set_text_color(TEXT_RED); + var_s1 = gSubMenuSelection - SUB_MENU_COPY_PAK_ERROR_2P_MIN; + for (i = 0; i < ARRAY_COUNT(D_800E78D0) / 4; i++) { // 12 / 4 = 3 + print_text_mode_1(0x00000032, 0x55 + (0x14 * i), D_800E78D0[(var_s1 * 3) + i], 0, 0.9f, 0.9f); + } + break; + case SUB_MENU_COPY_PAK_ERROR_NO_PAK_1P: + case SUB_MENU_COPY_PAK_ERROR_BAD_READ_1P: + case SUB_MENU_COPY_PAK_ERROR_CANT_CREATE_1P: + case SUB_MENU_COPY_PAK_ERROR_NO_PAGES_1P: + j++; + j--; // FAKE + set_text_color(TEXT_RED); + var_s1 = gSubMenuSelection - SUB_MENU_COPY_PAK_ERROR_1P_MIN; + for (i = 0; i < ARRAY_COUNT(D_800E7890) / 4; i++) { // 16 / 4 = 4 + print_text_mode_1(0x00000023, 0x55 + (0x14 * i), D_800E7890[(var_s1 * 4) + i], 0, 0.8f, 0.8f); + } + break; + case SUB_MENU_COPY_PAK_UNABLE_COPY_FROM_1P: + case SUB_MENU_COPY_PAK_UNABLE_READ_FROM_2P: + set_text_color(TEXT_RED); + var_s1 = gSubMenuSelection - SUB_MENU_COPY_PAK_UNABLE_ERROR_MIN; + for (i = 0; i < ARRAY_COUNT(D_800E7900) / 2; i++) { // 6 / 2 = 3 + print_text_mode_1(0x00000041, 0x55 + (0x14 * i), D_800E7900[(var_s1 * 3) + i], 0, 0.9f, 0.9f); + } + break; + case SUB_MENU_COPY_PAK_CREATE_GAME_DATA_INIT: + case SUB_MENU_COPY_PAK_CREATE_GAME_DATA_DONE: + set_text_color(TEXT_YELLOW); + for (i = 0; i < ARRAY_COUNT(D_800E7A48); i++) { + print_text_mode_1(0x00000050, 0x55 + (0x14 * i), D_800E7A48[i], 0, 1.0f, 1.0f); + } + break; + case SUB_MENU_COPY_PAK_FROM_GHOST1_1P: + case SUB_MENU_COPY_PAK_FROM_GHOST2_1P: + case SUB_MENU_COPY_PAK_TO_GHOST1_2P: + case SUB_MENU_COPY_PAK_TO_GHOST2_2P: + switch (gSubMenuSelection) { + case SUB_MENU_COPY_PAK_FROM_GHOST1_1P: + case SUB_MENU_COPY_PAK_FROM_GHOST2_1P: + var_s5 = SUB_MENU_COPY_PAK_FROM_GHOST_MIN; var_s4 = 0; break; - case 0x32: - case 0x33: - var_s5 = 0x32; + case SUB_MENU_COPY_PAK_TO_GHOST1_2P: + case SUB_MENU_COPY_PAK_TO_GHOST2_2P: + var_s5 = SUB_MENU_COPY_PAK_TO_GHOST_MIN; var_s4 = 1; default: - // var_s5 = spC4; - // var_s4 = spC0; break; } - set_text_color(var_s4 + 1); - draw_text(0x000000A0, 0x00000055, D_800E7920[var_s4], 0, 0.6f, 0.6f); - for (var_s1 = 0; var_s1 < 2; var_s1++) { - set_text_color(3); - draw_text(0x5C + (0x82 * var_s1), 0x0000007D, D_800E7918[var_s1], 0, 0.75f, 0.75f); - for (var_s2 = 0; var_s2 < 2; var_s2++) { - if (var_s1 != var_s4) { - text_rainbow_effect(D_8018EDEC - var_s5, var_s2, TEXT_GREEN); - if (var_s2 == (D_8018EDEC - var_s5)) { - spE0.column = 0x20 + (0x89 * var_s1); - spE0.row = 0x96 + (0x1E * var_s2); + temp = var_s4; // only semi-fake + set_text_color(temp + 1); + print_text1_center_mode_1(0x000000A0, 0x00000055, D_800E7920[temp], 0, 0.6f, 0.6f); + for (i = 0; i < ARRAY_COUNT(D_800E7918); i++) { + set_text_color(TEXT_YELLOW); + print_text1_center_mode_1(0x5C + (0x82 * i), 0x0000007D, D_800E7918[i], 0, 0.75f, 0.75f); + for (j = 0; j < 2; j++) { + if (i != temp) { + text_rainbow_effect(gSubMenuSelection - var_s5, j, TEXT_GREEN); + if (j == (gSubMenuSelection - var_s5)) { + spE0.column = 0x20 + (0x89 * i); + spE0.row = 0x96 + (0x1E * j); } - } else if ((var_s4 != 0) && (var_s2 == arg0->unk20)) { + } else if ((temp != 0) && (j == arg0->param2)) { set_text_color((s32) gGlobalTimer % 3); } else { - set_text_color(1); + set_text_color(TEXT_GREEN); } - convert_number_to_ascii(var_s2 + 1, &spB8[0]); - func_80093324(0x20 + (0x89 * var_s1), 0x96 + (0x1E * var_s2), &spB8[1], 0, 0.6f, 0.6f); - if (var_s1 == 0) { - var_v1 = &D_8018EE10[var_s2]; + convert_number_to_ascii(j + 1, &spB8[0]); + print_text_mode_1(0x20 + (0x89 * i), 0x96 + (0x1E * j), &spB8[1], 0, 0.6f, 0.6f); + if (i == 0) { + var_v1 = &D_8018EE10[j]; } else { - var_v1 = &((struct_8018EE10_entry*) D_8018D9C0)[var_s2]; + var_v1 = &((struct_8018EE10_entry*) gSomeDLBuffer)[j]; } if (var_v1->ghostDataSaved == 0) { - func_80093324(0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), D_800E7A44, 0, 0.5f, 0.5f); + print_text_mode_1(0x2A + (i * 0x89), 0x96 + (0x1E * j), D_800E7A44, 0, 0.5f, 0.5f); } else { - func_80093324( - 0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), + print_text_mode_1( + 0x2A + (i * 0x89), 0x96 + (0x1E * j), gCourseNamesDup2[gCupCourseOrder[var_v1->courseIndex / 4][var_v1->courseIndex % 4]], 0, 0.5f, 0.5f); } } } break; - case 0x38: /* switch 1 */ - case 0x39: /* switch 1 */ - set_text_color(2); - for (var_s1 = 0; var_s1 < 2; var_s1++) { - draw_text(0x000000A0, 0x4D + (0x14 * var_s1), D_800E7928[var_s1], 0, 0.8f, 0.8f); + case SUB_MENU_COPY_PAK_PROMPT_QUIT: + case SUB_MENU_COPY_PAK_PROMPT_COPY: + set_text_color(TEXT_RED); + for (i = 0; i < ARRAY_COUNT(D_800E7928); i++) { + print_text1_center_mode_1(0x000000A0, 0x4D + (0x14 * i), D_800E7928[i], 0, 0.8f, 0.8f); } - for (var_s1 = 0; var_s1 < 2; var_s1++) { - set_text_color(3); - draw_text(0x5C + (0x82 * var_s1), 0x0000007D, D_800E7918[var_s1], 0, 0.75f, 0.75f); - for (var_s2 = 0; var_s2 != 2; var_s2++) { - if (var_s1 == 0) { - if (var_s2 == arg0->unk1C) { + for (i = 0; i < ARRAY_COUNT(D_800E7918); i++) { + set_text_color(TEXT_YELLOW); + print_text1_center_mode_1(0x5C + (0x82 * i), 0x0000007D, D_800E7918[i], 0, 0.75f, 0.75f); + for (j = 0; j != 2; j++) { + if (i == 0) { + if (j == arg0->param1) { set_text_color((s32) gGlobalTimer % 3); } else { - set_text_color(1); + set_text_color(TEXT_GREEN); } - } else if (var_s2 == arg0->unk20) { + } else if (j == arg0->param2) { set_text_color((s32) gGlobalTimer % 3); } else { - set_text_color(1); + set_text_color(TEXT_GREEN); } - convert_number_to_ascii(var_s2 + 1, &spA8[0]); - func_80093324(0x20 + (0x89 * var_s1), 0x96 + (0x1E * var_s2), &spA8[1], 0, 0.6f, 0.6f); - if (var_s1 == 0) { - var_v1 = &D_8018EE10[var_s2]; + convert_number_to_ascii(j + 1, &spA8[0]); + print_text_mode_1(0x20 + (0x89 * i), 0x96 + (0x1E * j), &spA8[1], 0, 0.6f, 0.6f); + if (i == 0) { + do { + } while (0); // FAKE + var_v1 = &D_8018EE10[j]; } else { - var_v1 = &((struct_8018EE10_entry*) D_8018D9C0)[var_s2]; + var_v1 = &((struct_8018EE10_entry*) gSomeDLBuffer)[j]; } if (var_v1->ghostDataSaved == 0) { - func_80093324(0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), D_800E7A44, 0, 0.5f, 0.5f); + print_text_mode_1(0x2A + (i * 0x89), 0x96 + (0x1E * j), D_800E7A44, 0, 0.5f, 0.5f); } else { - func_80093324( - 0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), + print_text_mode_1( + 0x2A + (i * 0x89), 0x96 + (0x1E * j), gCourseNamesDup2[gCupCourseOrder[var_v1->courseIndex / 4][var_v1->courseIndex % 4]], 0, 0.5f, 0.5f); } } } - // Register allocation diffs here - for (var_s2 = 0; var_s2 < 2; var_s2++) { - if (var_s2 == (D_8018EDEC - 0x38)) { - spE0.column = 0x6E + (0x32 * var_s2); + for (i = 0; i < ARRAY_COUNT(D_800E7930); i++) { + if (i == (gSubMenuSelection - SUB_MENU_COPY_PAK_PROMPT_MIN)) { + spE0.column = 0x6E + (0x32 * i); spE0.row = 0x00D2; } - text_rainbow_effect((D_8018EDEC - 0x38), var_s2, TEXT_YELLOW); - func_80093324(0x6E + (0x32 * var_s2), 0x000000D2, D_800E7930[var_s2], 0, 0.75f, 0.75f); - } - break; - case 0x3A: /* switch 1 */ - case 0x3B: /* switch 1 */ - case 0x3C: /* switch 1 */ - var_s5 = (D_8018EDEC - 0x3A) / 2; - set_text_color(2); - draw_text(0x000000A0, 0x00000055, D_800E7938[var_s5], 0, 1.0f, 1.0f); - for (var_s1 = 0; var_s1 < 2; var_s1++) { - set_text_color(3); - draw_text(0x5C + (0x82 * var_s1), 0x0000007D, D_800E7918[var_s1], 0, 0.75f, 0.75f); - for (var_s2 = 0; var_s2 < 2; var_s2++) { - if (var_s1 == 0) { - if (var_s2 == arg0->unk1C) { + text_rainbow_effect((gSubMenuSelection - SUB_MENU_COPY_PAK_PROMPT_MIN), j, TEXT_YELLOW); + print_text_mode_1(0x6E + (0x32 * i), 0x000000D2, D_800E7930[i], 0, 0.75f, 0.75f); + } + break; + case SUB_MENU_COPY_PAK_START: + case SUB_MENU_COPY_PAK_COPYING: + case SUB_MENU_COPY_PAK_COMPLETED: + var_s5 = (gSubMenuSelection - SUB_MENU_COPY_PAK_ACTION_MIN) / 2; + set_text_color(TEXT_RED); + print_text1_center_mode_1(0x000000A0, 0x00000055, D_800E7938[var_s5], 0, 1.0f, 1.0f); + for (i = 0; i < ARRAY_COUNT(D_800E7918); i++) { + set_text_color(TEXT_YELLOW); + print_text1_center_mode_1(0x5C + (0x82 * i), 0x0000007D, D_800E7918[i], 0, 0.75f, 0.75f); + for (j = 0; j < 2; j++) { + if (i == 0) { + if (j == arg0->param1) { if (var_s5 == 0) { - set_text_color(2); + set_text_color(TEXT_RED); } else { set_text_color(gGlobalTimer % 3); } } else { - set_text_color(1); + set_text_color(TEXT_GREEN); } - } else if (var_s2 == arg0->unk20) { - set_text_color(2); + } else if (j == arg0->param2) { + set_text_color(TEXT_RED); } else { - set_text_color(1); + set_text_color(TEXT_GREEN); } - convert_number_to_ascii(var_s2 + 1, &sp98[0]); - func_80093324(0x20 + (0x89 * var_s1), 0x96 + (0x1E * var_s2), &sp98[1], 0, 0.6f, 0.6f); - if (var_s1 == 0) { - var_v1 = &D_8018EE10[var_s2]; + convert_number_to_ascii(j + 1, &sp98[0]); + print_text_mode_1(0x20 + (0x89 * i), 0x96 + (0x1E * j), &sp98[1], 0, 0.6f, 0.6f); + if (i == 0) { + var_v1 = &D_8018EE10[j]; } else { - var_v1 = &((struct_8018EE10_entry*) D_8018D9C0)[var_s2]; + var_v1 = &((struct_8018EE10_entry*) gSomeDLBuffer)[j]; } if (var_v1->ghostDataSaved == 0) { - func_80093324(0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), D_800E7A44, 0, 0.5f, 0.5f); + print_text_mode_1(0x2A + (i * 0x89), 0x96 + (0x1E * j), D_800E7A44, 0, 0.5f, 0.5f); } else { - func_80093324( - 0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), + print_text_mode_1( + 0x2A + (i * 0x89), 0x96 + (0x1E * j), gCourseNamesDup2[gCupCourseOrder[var_v1->courseIndex / 4][var_v1->courseIndex % 4]], 0, 0.5f, 0.5f); } @@ -6998,13 +7081,13 @@ void func_800A1FB0(struct_8018D9E0_entry* arg0) { } break; } - switch (D_8018EDEC) { /* switch 2 */ - case 0x28: /* switch 2 */ - case 0x29: /* switch 2 */ - case 0x32: /* switch 2 */ - case 0x33: /* switch 2 */ - case 0x38: /* switch 2 */ - case 0x39: /* switch 2 */ + switch (gSubMenuSelection) { /* switch 2 */ + case SUB_MENU_COPY_PAK_FROM_GHOST1_1P: /* switch 2 */ + case SUB_MENU_COPY_PAK_FROM_GHOST2_1P: /* switch 2 */ + case SUB_MENU_COPY_PAK_TO_GHOST1_2P: /* switch 2 */ + case SUB_MENU_COPY_PAK_TO_GHOST2_2P: /* switch 2 */ + case SUB_MENU_COPY_PAK_PROMPT_QUIT: /* switch 2 */ + case SUB_MENU_COPY_PAK_PROMPT_COPY: /* switch 2 */ spE0.column -= 5; spE0.row -= 6; break; @@ -7015,34 +7098,31 @@ void func_800A1FB0(struct_8018D9E0_entry* arg0) { } func_800A66A8(arg0, (Unk_D_800E70A0*) &spE0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A1FB0.s") -#endif -void func_800A2D1C(struct_8018D9E0_entry* arg0) { +void func_800A2D1C(MenuItem* arg0) { switch (D_80164A28) { case 1: gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, 0x28); gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xC7, 0x13F, 0xEF); - arg0->unk1C = 0x28; + arg0->param1 = 0x28; break; case 2: - arg0->unk1C -= 2; - if (arg0->unk1C > 0) { - gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C); - gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF); + arg0->param1 -= 2; + if (arg0->param1 > 0) { + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->param1); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->param1, 0x13F, 0xEF); } else { arg0->type = 0; } break; default: - if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != 1) || (D_8018EE08 != 0)) { + if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != 1) || (gDemoUseController != 0)) { arg0->type = 0; } else { - arg0->unk1C -= 2; - if (arg0->unk1C > 0) { - gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C); - gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF); + arg0->param1 -= 2; + if (arg0->param1 > 0) { + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->param1); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->param1, 0x13F, 0xEF); } else { arg0->type = 0; } @@ -7051,7 +7131,7 @@ void func_800A2D1C(struct_8018D9E0_entry* arg0) { } } -void func_800A2EB8(struct_8018D9E0_entry* arg0) { +void func_800A2EB8(MenuItem* arg0) { s8 sp70[8]; UNUSED s32 stackPadding0; char sp68[3]; @@ -7063,11 +7143,11 @@ void func_800A2EB8(struct_8018D9E0_entry* arg0) { sp70[var_s2] = gPlayers[gGPCurrentRacePlayerIdByRank[var_s2]].characterId; } set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); - func_80093324(arg0->column + 0x1E, arg0->row + 0x19, "results", 0, 1.0f, 1.0f); + print_text_mode_1(arg0->column + 0x1E, arg0->row + 0x19, "results", 0, 1.0f, 1.0f); set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); - func_80093324(arg0->column + 0x2C, arg0->row + 0x28, "round", 0, 0.7f, 0.7f); + print_text_mode_1(arg0->column + 0x2C, arg0->row + 0x28, "round", 0, 0.7f, 0.7f); convert_number_to_ascii(gCourseIndexInCup + 1, sp68); - func_80093324(arg0->column + 0x57, arg0->row + 0x28, &sp68[1], 0, 0.7f, 0.7f); + print_text_mode_1(arg0->column + 0x57, arg0->row + 0x28, &sp68[1], 0, 0.7f, 0.7f); for (var_s2 = 0; var_s2 < 4; var_s2++) { if (gGPCurrentRacePlayerIdByRank[var_s2] < gPlayerCount) { var_a0 = (s32) gGlobalTimer % 3; @@ -7088,10 +7168,12 @@ void func_800A2EB8(struct_8018D9E0_entry* arg0) { } set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); temp_s0 = (s32) (((f32) (get_string_width(gCupNames[gCupSelection]) + 8) * 0.6f) / 2); - draw_text((-(s32) (((f32) (get_string_width(D_800E76CC[gCCSelection]) + 8) * 0.6f) / 2) - arg0->column) + 0xF5, - arg0->row + 0xE1, gCupNames[D_800DC540], 0, 0.6f, 0.6f); - draw_text((temp_s0 - arg0->column) + 0xF5, arg0->row + 0xE1, - D_800E76CC[D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]], 0, 0.6f, 0.6f); + print_text1_center_mode_1( + (-(s32) (((f32) (get_string_width(D_800E76CC[gCCSelection]) + 8) * 0.6f) / 2) - arg0->column) + 0xF5, + arg0->row + 0xE1, gCupNames[D_800DC540], 0, 0.6f, 0.6f); + print_text1_center_mode_1( + (temp_s0 - arg0->column) + 0xF5, arg0->row + 0xE1, + D_800E76CC[gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]], 0, 0.6f, 0.6f); } void func_800A32B4(s32 arg0, s32 arg1, s32 characterId, s32 rank) { @@ -7108,18 +7190,18 @@ void func_800A32B4(s32 arg0, s32 arg1, s32 characterId, s32 rank) { sp3C[2] = '.'; sp3C[3] = '\0'; func_800939C8(arg0 - 1, arg1, &sp3C[1], -4, 0.7f, 0.7f); - func_80093324(arg0 + 0xA, arg1, D_800E76A8[characterId], 0, 0.65f, 0.7f); + print_text_mode_1(arg0 + 0xA, arg1, D_800E76A8[characterId], 0, 0.65f, 0.7f); convert_number_to_ascii((s32) (sp50 / 60.0f), sp3C); func_800939C8(arg0 + 0x42, arg1, sp3C, 0, 0.7f, 0.7f); convert_number_to_ascii((s32) sp50 % 60, sp3C); - func_80093324(arg0 + 0x4E, arg1, "'", 0, 0.7f, 0.7f); + print_text_mode_1(arg0 + 0x4E, arg1, "'", 0, 0.7f, 0.7f); func_800939C8(arg0 + 0x56, arg1, sp3C, 0, 0.7f, 0.7f); convert_number_to_ascii((s32) ((f64) sp50 * 100.0) % 100, sp3C); - func_80093324(arg0 + 0x62, arg1, "\"", 0, 0.7f, 0.7f); + print_text_mode_1(arg0 + 0x62, arg1, "\"", 0, 0.7f, 0.7f); func_800939C8(arg0 + 0x6A, arg1, sp3C, 0, 0.7f, 0.7f); } -void func_800A34A8(struct_8018D9E0_entry* arg0) { +void func_800A34A8(MenuItem* arg0) { s8 sp80[8]; UNUSED s32 stackPadding0; char sp78[3]; @@ -7132,39 +7214,39 @@ void func_800A34A8(struct_8018D9E0_entry* arg0) { s32 rank; s32 test; - if (arg0->cursor != 0) { - if (arg0->cursor < 9) { - for (rank = 0; rank < 8; rank++) { + if (arg0->state != 0) { + if (arg0->state < 9) { + for (rank = 0; rank < NUM_PLAYERS; rank++) { sp80[rank] = gPlayers[gGPCurrentRacePlayerIdByRank[rank]].characterId; } } else { func_800A3A10(sp80); func_800A3A10(gCharacterIdByGPOverallRank); } - set_text_color(4); - func_80093324(arg0->column + 0x19, 0x19 - arg0->row, "driver's points", 0, 0.8f, 0.8f); - set_text_color(5); - func_80093324(arg0->column + 0x36, 0x28 - arg0->row, "round", 0, 0.7f, 0.7f); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); + print_text_mode_1(arg0->column + 0x19, 0x19 - arg0->row, "driver's points", 0, 0.8f, 0.8f); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); + print_text_mode_1(arg0->column + 0x36, 0x28 - arg0->row, "round", 0, 0.7f, 0.7f); convert_number_to_ascii(gCourseIndexInCup + 1, sp78); - func_80093324(arg0->column + 0x61, (0x28 & 0xFFFFFFFF) - arg0->row, &sp78[1], 0, 0.7f, 0.7f); + print_text_mode_1(arg0->column + 0x61, (0x28 & 0xFFFFFFFF) - arg0->row, &sp78[1], 0, 0.7f, 0.7f); for (rank = 0; rank < 4; rank++) { - test = arg0->cursor; + test = arg0->state; if ((test != 8) && (test != 9)) { var_v0 = 0; } else { - if ((rank * 5) < arg0->unk1C) { + if ((rank * 5) < arg0->param1) { var_v0 = 1; } else { var_v0 = 0; } } if (var_v0 == 0) { - if (arg0->cursor < 9) { + if (arg0->state < 9) { var_v0 = gGPCurrentRacePlayerIdByRank[rank]; var_v1 = 0; } else { var_v1 = 0x0000000D; - var_v0 = D_80164478[sp80[rank]]; + var_v0 = gGetPlayerByCharacterId[sp80[rank]]; } if (var_v0 < gPlayerCount) { var_a0 = (s32) gGlobalTimer % 3; @@ -7177,21 +7259,21 @@ void func_800A34A8(struct_8018D9E0_entry* arg0) { } } for (rank = 4; rank < NUM_PLAYERS; rank++) { - test = arg0->cursor; + test = arg0->state; if ((test != 8) && (test != 9)) { var_v0 = 0; } else { - if ((rank * 5) < arg0->unk1C) { + if ((rank * 5) < arg0->param1) { var_v0 = 1; } else { var_v0 = 0; } } if (var_v0 == 0) { - if (arg0->cursor < 9) { + if (arg0->state < 9) { var_v0 = gGPCurrentRacePlayerIdByRank[rank]; } else { - var_v0 = D_80164478[sp80[rank]]; + var_v0 = gGetPlayerByCharacterId[sp80[rank]]; } if (var_v0 < gPlayerCount) { var_a0 = (s32) gGlobalTimer % 3; @@ -7202,12 +7284,14 @@ void func_800A34A8(struct_8018D9E0_entry* arg0) { func_800A3ADC(arg0, 0xBE - arg0->column, arg0->row + (rank * 0x10) + 0x5A, sp80[rank], rank, sp80); } } - set_text_color(5); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); temp_s0_3 = ((get_string_width(gCupNames[gCupSelection]) + 8) * 0.6f) / 2; - draw_text((-(s32) (((get_string_width(D_800E76CC[gCCSelection]) + 8) * 0.6f) / 2) - arg0->column) + 0xE6, - arg0->row + 0xE1, gCupNames[D_800DC540], 0, 0.6f, 0.6f); - draw_text((temp_s0_3 - arg0->column) + 0xE6, arg0->row + 0xE1, - D_800E76CC[D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]], 0, 0.6f, 0.6f); + print_text1_center_mode_1( + (-(s32) (((get_string_width(D_800E76CC[gCCSelection]) + 8) * 0.6f) / 2) - arg0->column) + 0xE6, + arg0->row + 0xE1, gCupNames[D_800DC540], 0, 0.6f, 0.6f); + print_text1_center_mode_1( + (temp_s0_3 - arg0->column) + 0xE6, arg0->row + 0xE1, + D_800E76CC[gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]], 0, 0.6f, 0.6f); } } @@ -7230,7 +7314,8 @@ void func_800A3A10(s8* arg0) { arg0[var_a1] = temp_a3; arg0[var_a1 - 1] = temp_t1; } else if (gGPPointsByCharacterId[temp_t1] == gGPPointsByCharacterId[temp_a3]) { - if ((D_80164478[temp_t1] < gPlayerCount) && (D_80164478[temp_t1] < D_80164478[temp_a3])) { + if ((gGetPlayerByCharacterId[temp_t1] < gPlayerCount) && + (gGetPlayerByCharacterId[temp_t1] < gGetPlayerByCharacterId[temp_a3])) { arg0[var_a1] = temp_a3; arg0[var_a1 - 1] = temp_t1; } else { @@ -7243,13 +7328,13 @@ void func_800A3A10(s8* arg0) { } } -void func_800A3ADC(struct_8018D9E0_entry* arg0, s32 arg1, s32 arg2, s32 characterId, s32 arg4, s8* arg5) { +void func_800A3ADC(MenuItem* arg0, s32 arg1, s32 arg2, s32 characterId, s32 arg4, s8* arg5) { UNUSED s32 stackPadding0; s32 wut; char sp34[4]; s32 phi_v1; - if (arg0->cursor < 9) { + if (arg0->state < 9) { convert_number_to_ascii(arg4 + 1, sp34); } else { for (phi_v1 = arg4; phi_v1 > 0; phi_v1--) { @@ -7263,40 +7348,49 @@ void func_800A3ADC(struct_8018D9E0_entry* arg0, s32 arg1, s32 arg2, s32 characte sp34[2] = '.'; sp34[3] = '\0'; func_800939C8(arg1, arg2, &sp34[1], -4, 0.7f, 0.7f); - func_80093324(arg1 + 0xA, arg2, D_800E76A8[characterId], 0, 0.7f, 0.7f); + print_text_mode_1(arg1 + 0xA, arg2, D_800E76A8[characterId], 0, 0.7f, 0.7f); convert_number_to_ascii(gGPPointsByCharacterId[characterId], sp34); func_800939C8(arg1 + 0x47, arg2, sp34, 0, 0.7f, 0.7f); - if ((arg4 < 4) && (arg0->cursor < 9)) { - convert_number_to_ascii(D_8018D9BC[arg4], sp34); + if ((arg4 < ARRAY_COUNT(gGPPointRewards)) && (arg0->state < 9)) { + convert_number_to_ascii(sGPPointsCopy[arg4], sp34); sp34[0] = '+'; - func_80093324(arg1 + 0x5A, arg2, sp34, 0, 0.7f, 0.7f); + print_text_mode_1(arg1 + 0x5A, arg2, sp34, 0, 0.7f, 0.7f); } } -void func_800A3C84(struct_8018D9E0_entry* arg0) { +void time_trials_finish_text_render(MenuItem* arg0) { s32 recordType; s32 rowOffset; + // name of the course set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); - draw_text(arg0->column + 0x43, arg0->row + 0x19, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], - 0, 0.6f, 0.6f); + print_text1_center_mode_1(arg0->column + 0x43, arg0->row + 0x19, + gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 0.6f, 0.6f); + + // lap time text set_text_color(TEXT_YELLOW); - draw_text(arg0->column + 0x46, arg0->row + 0x28, D_800E7730, 0, 0.75f, 0.75f); + print_text1_center_mode_1(arg0->column + 0x46, arg0->row + 0x28, gLapTimeText, 0, 0.75f, 0.75f); + + // lap time for (recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_3LAP_RECORD_5; recordType += 1, rowOffset += 0xF) { - func_800A4550(recordType, arg0->column + 0x17, arg0->row + rowOffset + 0x37); + render_lap_time(recordType, arg0->column + 0x17, arg0->row + rowOffset + 0x37); } + + // best record text set_text_color(TEXT_YELLOW); - func_80093324(0xB4 - arg0->column, arg0->row + 0x86, D_800E7728[0], 0, 0.75f, 0.75f); + print_text_mode_1(0xB4 - arg0->column, arg0->row + 0x86, gBestTimeText[0], 0, 0.75f, 0.75f); + + // best record for (recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_1LAP_RECORD; recordType += 1, rowOffset += 0xD) { set_text_color(TEXT_RED); - func_800A474C(recordType, 0xAA - arg0->column, arg0->row + rowOffset + 0x92); + render_lap_times(recordType, 0xAA - arg0->column, arg0->row + rowOffset + 0x92); } set_text_color(TEXT_YELLOW); - func_80093324(0xB4 - arg0->column, arg0->row + 0xD5, D_800E7728[1], 0, 0.75f, 0.75f); - func_800A474C(TIME_TRIAL_1LAP_RECORD, 0xAA - arg0->column, arg0->row + 0xE1); + print_text_mode_1(0xB4 - arg0->column, arg0->row + 0xD5, gBestTimeText[1], 0, 0.75f, 0.75f); + render_lap_times(TIME_TRIAL_1LAP_RECORD, 0xAA - arg0->column, arg0->row + 0xE1); } -void func_800A3E60(struct_8018D9E0_entry* arg0) { +void func_800A3E60(MenuItem* arg0) { UNUSED s32 stackPadding0; Unk_D_800E70A0 sp84; UNUSED s32 stackPadding1; @@ -7309,7 +7403,7 @@ void func_800A3E60(struct_8018D9E0_entry* arg0) { Unk_D_800E70A0* var_v0_5; char sp60[3]; - var_v0 = arg0->cursor; + var_v0 = arg0->state; if (var_v0 == 0) { return; } @@ -7317,131 +7411,131 @@ void func_800A3E60(struct_8018D9E0_entry* arg0) { return; } - set_text_color(4); - draw_text(arg0->column + 0x55, 0x19 - arg0->row, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], - 0, 0.6f, 0.6f); - set_text_color(3); - draw_text(arg0->column + 0x55, 0x28 - arg0->row, D_800E7730, 0, 0.75f, 0.75f); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); + print_text1_center_mode_1(arg0->column + 0x55, 0x19 - arg0->row, + gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 0.6f, 0.6f); + set_text_color(TEXT_YELLOW); + print_text1_center_mode_1(arg0->column + 0x55, 0x28 - arg0->row, gLapTimeText, 0, 0.75f, 0.75f); for (var_s1 = 0; var_s1 < 4; var_s1++) { - func_800A4550(var_s1, arg0->column + 0x26, ((0xF * var_s1) - arg0->row) + 0x37); - } - switch (arg0->cursor) { /* switch 1 */ - case 1: /* switch 1 */ - case 5: /* switch 1 */ - case 6: /* switch 1 */ - case 7: /* switch 1 */ - case 8: /* switch 1 */ - case 9: /* switch 1 */ - case 10: /* switch 1 */ - case 30: /* switch 1 */ + render_lap_time(var_s1, arg0->column + 0x26, ((0xF * var_s1) - arg0->row) + 0x37); + } + switch (arg0->state) { + case 1: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 30: for (var_s1 = 0; var_s1 < 6; var_s1++) { var_v1 = 0; - text_rainbow_effect(arg0->cursor - 5, var_s1, 1); + text_rainbow_effect(arg0->state - 5, var_s1, 1); switch (var_s1) { /* switch 3; irregular */ case 4: /* switch 3 */ - if (D_80162DF8 == 1) { + if (gPostTimeTrialReplayCannotSave == 1) { var_v1 = 1; } break; case 5: /* switch 3 */ - if (D_80162DD4 != 0) { + if (bPlayerGhostDisabled != 0) { var_v1 = 2; } break; } if (var_v1 != 0) { - set_text_color(0); + set_text_color(TEXT_BLUE); gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, 0x96); - func_80093358(0xB2 - arg0->column, arg0->row + (0xD * var_s1) + 0x93, gTextPauseButton[var_s1 + 1], - 0, 0.75f, 0.75f); + print_text_mode_2(0xB2 - arg0->column, arg0->row + (0xD * var_s1) + 0x93, + gTextPauseButton[var_s1 + 1], 0, 0.75f, 0.75f); } else { - func_80093324(0xB2 - arg0->column, arg0->row + (0xD * var_s1) + 0x93, gTextPauseButton[var_s1 + 1], - 0, 0.75f, 0.75f); + print_text_mode_1(0xB2 - arg0->column, arg0->row + (0xD * var_s1) + 0x93, + gTextPauseButton[var_s1 + 1], 0, 0.75f, 0.75f); } } break; - case 11: /* switch 1 */ - case 12: /* switch 1 */ - case 13: /* switch 1 */ - case 14: /* switch 1 */ - case 15: /* switch 1 */ - case 16: /* switch 1 */ - set_text_color(3); - var_v1 = arg0->cursor - 11; + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + set_text_color(TEXT_YELLOW); + var_v1 = arg0->state - 11; for (var_s1 = 0; var_s1 < 7; var_s1++) { - func_80093324(0x000000A2, 0x8C + (0xD * var_s1), D_800E798C[(var_v1 * 7) + var_s1], 0, 0.6f, 0.6f); + print_text_mode_1(0x000000A2, 0x8C + (0xD * var_s1), D_800E798C[(var_v1 * 7) + var_s1], 0, 0.6f, 0.6f); } break; - case 17: /* switch 1 */ - case 18: /* switch 1 */ - set_text_color(1); + case 17: + case 18: + set_text_color(TEXT_GREEN); for (var_s1 = 0; var_s1 < 2; var_s1++) { - func_80093324(0x000000A5, arg0->row + (0xD * var_s1) + 0x8C, D_800E7A3C[var_s1], 0, 0.7f, 0.7f); + print_text_mode_1(0x000000A5, arg0->row + (0xD * var_s1) + 0x8C, D_800E7A3C[var_s1], 0, 0.7f, 0.7f); } for (var_s1 = 0; var_s1 < 2; var_s1++) { - text_rainbow_effect(arg0->cursor - 0x11, var_s1, 1); + text_rainbow_effect(arg0->state - 0x11, var_s1, 1); convert_number_to_ascii(var_s1 + 1, sp60); - func_80093324(0xB1 - arg0->column, 0xAA + (0x1E * var_s1), &sp60[1], 0, 0.6f, 0.6f); + print_text_mode_1(0xB1 - arg0->column, 0xAA + (0x1E * var_s1), &sp60[1], 0, 0.6f, 0.6f); if (D_8018EE10[var_s1].ghostDataSaved == 0) { - func_80093324(0xBB - arg0->column, 0xAA + (0x1E * var_s1), D_800E7A44, 0, 0.45f, 0.45f); + print_text_mode_1(0xBB - arg0->column, 0xAA + (0x1E * var_s1), D_800E7A44, 0, 0.45f, 0.45f); } else { - func_80093324(0xBB - arg0->column, 0xAA + (0x1E * var_s1), - gCourseNamesDup2[gCupCourseOrder[D_8018EE10[var_s1].courseIndex / 4] - [D_8018EE10[var_s1].courseIndex % 4]], - 0, 0.45f, 0.45f); + print_text_mode_1(0xBB - arg0->column, 0xAA + (0x1E * var_s1), + gCourseNamesDup2[gCupCourseOrder[D_8018EE10[var_s1].courseIndex / 4] + [D_8018EE10[var_s1].courseIndex % 4]], + 0, 0.45f, 0.45f); } } break; - case 19: /* switch 1 */ - set_text_color(3); + case 19: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 3; var_s1++) { - func_80093324(0x000000AA, (0xD * var_s1) + 0x93, D_800E7A48[var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x000000AA, (0xD * var_s1) + 0x93, D_800E7A48[var_s1], 0, 0.8f, 0.8f); } break; - case 20: /* switch 1 */ - case 21: /* switch 1 */ + case 20: + case 21: if (var_s1 && var_s1) {} - set_text_color(3); + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 3; var_s1++) { - func_80093324(0x000000A3, arg0->row + (0xD * var_s1) + 0x8C, D_800E7A60[var_s1], 0, 0.67f, 0.67f); + print_text_mode_1(0x000000A3, arg0->row + (0xD * var_s1) + 0x8C, D_800E7A60[var_s1], 0, 0.67f, 0.67f); } for (var_s1 = 0; var_s1 < 2; var_s1++) { - text_rainbow_effect(arg0->cursor - 0x14, var_s1, 1); - func_80093324(0xC8 - arg0->column, 0xB9 + (0xF * var_s1), D_800E7A6C[var_s1], 0, 0.75f, 0.75f); + text_rainbow_effect(arg0->state - 0x14, var_s1, 1); + print_text_mode_1(0xC8 - arg0->column, 0xB9 + (0xF * var_s1), D_800E7A6C[var_s1], 0, 0.75f, 0.75f); } break; - case 25: /* switch 1 */ - set_text_color(3); + case 25: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 3; var_s1++) { - func_80093324(0x000000A3, (0xD * var_s1) + 0x93, D_800E7A74[var_s1], 0, 0.67f, 0.67f); + print_text_mode_1(0x000000A3, (0xD * var_s1) + 0x93, D_800E7A74[var_s1], 0, 0.67f, 0.67f); } break; - case 26: /* switch 1 */ - set_text_color(3); + case 26: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 2; var_s1++) { - func_80093324(0x000000AA, (0xD * var_s1) + 0x93, D_800E7A80[var_s1], 0, 0.75f, 0.75f); + print_text_mode_1(0x000000AA, (0xD * var_s1) + 0x93, D_800E7A80[var_s1], 0, 0.75f, 0.75f); } break; } - switch (arg0->cursor) { /* switch 2 */ - case 5: /* switch 2 */ - case 6: /* switch 2 */ - case 7: /* switch 2 */ - case 8: /* switch 2 */ - case 9: /* switch 2 */ - case 10: /* switch 2 */ - var_v0_5 = &D_800E7390[arg0->cursor - 5]; + switch (arg0->state) { /* switch 2 */ + case 5: /* switch 2 */ + case 6: /* switch 2 */ + case 7: /* switch 2 */ + case 8: /* switch 2 */ + case 9: /* switch 2 */ + case 10: /* switch 2 */ + var_v0_5 = &D_800E7390[arg0->state - 5]; break; case 17: /* switch 2 */ case 18: /* switch 2 */ - var_v0_5 = &D_800E73C0[arg0->cursor - 17]; + var_v0_5 = &D_800E73C0[arg0->state - 17]; break; case 20: /* switch 2 */ case 21: /* switch 2 */ - var_v0_5 = &D_800E73D0[arg0->cursor - 20]; + var_v0_5 = &D_800E73D0[arg0->state - 20]; break; case 30: /* switch 2 */ - var_v0_5 = &D_800E7390[arg0->unk1C - 5]; + var_v0_5 = &D_800E7390[arg0->param1 - 5]; break; default: return; @@ -7451,63 +7545,58 @@ void func_800A3E60(struct_8018D9E0_entry* arg0) { func_800A66A8(arg0, &sp84); } -void func_800A4550(s32 lapNumber, s32 column, s32 row) { +void render_lap_time(s32 lapNumber, s32 column, s32 row) { UNUSED s32 stackPadding0; - s32 sp40; + s32 time; UNUSED s32 stackPadding1; s32 textColor; char sp34[3]; - struct_8018D9E0_entry* temp_v0_2; + MenuItem* temp_v0_2; if (lapNumber < 3) { - sp40 = playerHUD[PLAYER_ONE].lapDurations[lapNumber]; - set_text_color(2); + time = playerHUD[PLAYER_ONE].lapDurations[lapNumber]; + set_text_color(TEXT_RED); } else { - sp40 = playerHUD[PLAYER_ONE].someTimer; - set_text_color(1); + time = playerHUD[PLAYER_ONE].someTimer; + set_text_color(TEXT_GREEN); } - func_800936B8(column + 0x21, row, D_800E7734[lapNumber], 0, 0.7f, 0.7f); - temp_v0_2 = find_8018D9E0_entry_dupe(0x000000BB); + print_text1_left(column + 0x21, row, gPrefixTimeText[lapNumber], 0, 0.7f, 0.7f); + temp_v0_2 = find_menu_items_dupe(MENU_ITEM_TYPE_0BB); if (lapNumber < 3) { - if (temp_v0_2->unk20 & (1 << lapNumber)) { + if (temp_v0_2->param2 & (1 << lapNumber)) { // best lap textColor = (s32) gGlobalTimer % 3; } else { textColor = TEXT_YELLOW; } } else { - if (temp_v0_2->unk1C >= 0) { + if (temp_v0_2->param1 >= 0) { textColor = (s32) gGlobalTimer % 3; } else { textColor = TEXT_YELLOW; } } set_text_color(textColor); - get_time_record_minutes(sp40, sp34); + get_time_record_minutes(time, sp34); func_800939C8(column + 0x2C, row, sp34, 0, 0.7f, 0.7f); - func_80093324(column + 0x37, row, "'", 0, 0.7f, 0.7f); - get_time_record_seconds(sp40, sp34); + print_text_mode_1(column + 0x37, row, "'", 0, 0.7f, 0.7f); + get_time_record_seconds(time, sp34); func_800939C8(column + 0x40, row, sp34, 0, 0.7f, 0.7f); - func_80093324(column + 0x4B, row, "\"", 0, 0.7f, 0.7f); - get_time_record_centiseconds(sp40, sp34); + print_text_mode_1(column + 0x4B, row, "\"", 0, 0.7f, 0.7f); + get_time_record_centiseconds(time, sp34); func_800939C8(column + 0x55, row, sp34, 0, 0.7f, 0.7f); } -#ifdef NON_MATCHING -// https://decomp.me/scratch/mWCHC -// The majority of th diff is from the handling of `textColor`. There is something super fucky there. -// The permuter found a decent improvement with making `textColor` a `volatile` variable but that -// seems wrong for several reasons - -void func_800A474C(s32 recordType, s32 column, s32 row) { - UNUSED s32 stackPadding0; +void render_lap_times(s32 recordType, s32 column, s32 row) { + UNUSED s32 pad; u32 timeRecord; + UNUSED s32 pad2; s32 textColor; s32 temp_t0; - s32 characterId; char sp38[3]; - struct_8018D9E0_entry* temp_v0; + MenuItem* item; s32 sp30; - if (gGamestate == 4) { + + if (gGamestate == RACING) { sp30 = 0; } else { sp30 = 1; @@ -7528,21 +7617,17 @@ void func_800A474C(s32 recordType, s32 column, s32 row) { } func_800939C8(column + 0x14, row, D_800E7744[recordType], 2, 0.65f, 0.65f); if (sp30 == 0) { - temp_v0 = find_8018D9E0_entry_dupe(0x000000BB); + item = find_menu_items_dupe(0x000000BB); if (recordType < 5) { - if (recordType == temp_v0->unk1C) { + if (recordType == item->param1) { textColor = gGlobalTimer % 3; } else { textColor = TEXT_YELLOW; } + } else if (item->param2 != 0) { + textColor = gGlobalTimer % 3; } else { - // huh? textColor = TEXT_YELLOW; - if (temp_v0->unk20 != 0) { - textColor = gGlobalTimer; - textColor %= 3; - } else { - } } } else { textColor = TEXT_YELLOW; @@ -7551,25 +7636,21 @@ void func_800A474C(s32 recordType, s32 column, s32 row) { temp_t0 = timeRecord & 0xFFFFF; get_time_record_minutes(temp_t0, sp38); func_800939C8(column + 0x27, row, sp38, 0, 0.65f, 0.65f); - func_80093324(column + 0x32, row, "'", 0, 0.65f, 0.65f); - if (!textColor) {} + print_text_mode_1(column + 0x32, row, "'", 0, 0.65f, 0.65f); get_time_record_seconds(temp_t0, sp38); func_800939C8(column + 0x3B, row, sp38, 0, 0.65f, 0.65f); - func_80093324(column + 0x46, row, "\"", 0, 0.65f, 0.65f); + print_text_mode_1(column + 0x46, row, "\"", 0, 0.65f, 0.65f); get_time_record_centiseconds(temp_t0, sp38); func_800939C8(column + 0x50, row, sp38, 0, 0.65f, 0.65f); - if (temp_t0 < 0x927C0) { - characterId = timeRecord >> 0x14; + if ((u32) temp_t0 < 600000U) { + textColor = timeRecord >> 0x14; } else { - characterId = 8; + textColor = 8; } - draw_text(column + 0x78, row, D_800E76A8[characterId], 0, 0.65f, 0.65f); + print_text1_center_mode_1(column + 0x78, row, D_800E76A8[textColor], 0, 0.65f, 0.65f); } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A474C.s") -#endif -void func_800A4A24(struct_8018D9E0_entry* arg0) { +void render_menu_item_announce_ghost(MenuItem* arg0) { UNUSED s32 stackPadding0; s32 temp_t0; s32 temp_t1; @@ -7579,14 +7660,14 @@ void func_800A4A24(struct_8018D9E0_entry* arg0) { temp_t0 = 0x140 - arg0->column; temp_t1 = arg0->row; - temp_t2 = (s32) ((get_string_width(D_800E7780) + 8) * someMultiplier) / 2; + temp_t2 = (s32) ((get_string_width(gTextMenuAnnounceGhost) + 8) * someMultiplier) / 2; gDisplayListHead = draw_box(gDisplayListHead, temp_t0 - temp_t2, (temp_t1 - thing) + 4, temp_t2 + temp_t0, temp_t1 + 4, 0, 0, 0, 0x00000064); set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); - draw_text(arg0->column - 3, arg0->row, D_800E7780, 0, 0.85f, 0.85f); + print_text1_center_mode_1(arg0->column - 3, arg0->row, gTextMenuAnnounceGhost, 0, 0.85f, 0.85f); } -void render_pause_menu(struct_8018D9E0_entry* arg0) { +void render_pause_menu(MenuItem* arg0) { if (gIsGamePaused != 0) { switch (gModeSelection) { case TIME_TRIALS: @@ -7605,7 +7686,7 @@ void render_pause_menu(struct_8018D9E0_entry* arg0) { } } -void render_pause_menu_time_trials(struct_8018D9E0_entry* arg0) { +void render_pause_menu_time_trials(MenuItem* arg0) { UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; @@ -7616,39 +7697,39 @@ void render_pause_menu_time_trials(struct_8018D9E0_entry* arg0) { gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x0000008C); set_text_color(TEXT_YELLOW); - draw_text(0x000000A0, 0x00000050, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f, - 1.0f); + print_text1_center_mode_1(0x000000A0, 0x00000050, + gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f, 1.0f); set_text_color(TEXT_RED); - draw_text(0x0000009D, 0x00000060, D_800E7728[0], 0, 0.8f, 0.8f); + print_text1_center_mode_1(0x0000009D, 0x00000060, gBestTimeText[0], 0, 0.8f, 0.8f); temp_a0 = func_800B4E24(TIME_TRIAL_3LAP_RECORD_1); temp_a0 &= 0xFFFFF; get_time_record_minutes(temp_a0, sp68); func_800939C8(0x0000007F, 0x0000006D, sp68, 0, 0.8f, 0.8f); - func_80093324(0x0000008E, 0x0000006D, "'", 0, 0.8f, 0.8f); + print_text_mode_1(0x0000008E, 0x0000006D, "'", 0, 0.8f, 0.8f); get_time_record_seconds(temp_a0, sp68); func_800939C8(0x00000098, 0x0000006D, sp68, 0, 0.8f, 0.8f); - func_80093324(0x000000A7, 0x0000006D, "\"", 0, 0.8f, 0.8f); + print_text_mode_1(0x000000A7, 0x0000006D, "\"", 0, 0.8f, 0.8f); get_time_record_centiseconds(temp_a0, sp68); func_800939C8(0x000000B3, 0x0000006D, sp68, 0, 0.8f, 0.8f); - draw_text(0x0000009D, 0x0000007C, D_800E7728[1], 0, 0.8f, 0.8f); + print_text1_center_mode_1(0x0000009D, 0x0000007C, gBestTimeText[1], 0, 0.8f, 0.8f); temp_a0 = func_800B4F2C(); temp_a0 &= 0xFFFFF; get_time_record_minutes(temp_a0, sp68); func_800939C8(0x0000007F, 0x00000089, sp68, 0, 0.8f, 0.8f); - func_80093324(0x0000008E, 0x00000089, "'", 0, 0.8f, 0.8f); + print_text_mode_1(0x0000008E, 0x00000089, "'", 0, 0.8f, 0.8f); get_time_record_seconds(temp_a0, sp68); func_800939C8(0x00000098, 0x00000089, sp68, 0, 0.8f, 0.8f); - func_80093324(0x000000A7, 0x00000089, "\"", 0, 0.8f, 0.8f); + print_text_mode_1(0x000000A7, 0x00000089, "\"", 0, 0.8f, 0.8f); get_time_record_centiseconds(temp_a0, sp68); func_800939C8(0x000000B3, 0x00000089, sp68, 0, 0.8f, 0.8f); for (var_s0 = 0; var_s0 < 5; var_s0++) { - text_rainbow_effect(arg0->cursor - 11, var_s0, TEXT_GREEN); - func_80093324(D_800E8538[zero].column, D_800E8538[zero].row + (13 * var_s0), gTextPauseButton[var_s0], 0, 0.75f, - 0.75f); + text_rainbow_effect(arg0->state - 11, var_s0, TEXT_GREEN); + print_text_mode_1(D_800E8538[zero].column, D_800E8538[zero].row + (13 * var_s0), gTextPauseButton[var_s0], 0, + 0.75f, 0.75f); } } -void render_pause_menu_versus(struct_8018D9E0_entry* arg0) { +void render_pause_menu_versus(MenuItem* arg0) { s16 temp_t0; s16 temp_v1; s32 temp_t3; @@ -7672,12 +7753,12 @@ void render_pause_menu_versus(struct_8018D9E0_entry* arg0) { } else { var_s1 = var_s0; } - text_rainbow_effect(arg0->cursor - 0x15, var_s0, TEXT_YELLOW); - func_80093324(temp_s3->column - 2, temp_s3->row + (13 * var_s0), gTextPauseButton[var_s1], 0, 0.75f, 0.75f); + text_rainbow_effect(arg0->state - 0x15, var_s0, TEXT_YELLOW); + print_text_mode_1(temp_s3->column - 2, temp_s3->row + (13 * var_s0), gTextPauseButton[var_s1], 0, 0.75f, 0.75f); } } -void render_pause_grand_prix(struct_8018D9E0_entry* arg0) { +void render_pause_grand_prix(MenuItem* arg0) { s32 temp_t0; s32 temp_v1; s32 temp_s0; @@ -7700,19 +7781,19 @@ void render_pause_grand_prix(struct_8018D9E0_entry* arg0) { temp_s0 = ((get_string_width(gCupNames[gCupSelection]) * one) + 10.0f) / 2; temp_s1 = ((get_string_width(D_800E76CC[gCCSelection]) * one) + 10.0f) / 2; set_text_color(TEXT_YELLOW); - draw_text(160 - temp_s1, temp_s3->row - 50, gCupNames[gCupSelection], 0, 1.0f, 1.0f); + print_text1_center_mode_1(160 - temp_s1, temp_s3->row - 50, gCupNames[gCupSelection], 0, 1.0f, 1.0f); set_text_color(TEXT_YELLOW); - draw_text(160 + temp_s0, temp_s3->row - 50, D_800E76CC[gCCSelection], 0, 1.0f, 1.0f); + print_text1_center_mode_1(160 + temp_s0, temp_s3->row - 50, D_800E76CC[gCCSelection], 0, 1.0f, 1.0f); set_text_color(TEXT_YELLOW); - draw_text(160, temp_s3->row - 30, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f, - 1.0f); + print_text1_center_mode_1(160, temp_s3->row - 30, + gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f, 1.0f); for (var_s0 = 0; var_s0 < 2; var_s0++) { - text_rainbow_effect(arg0->cursor - 31, var_s0, TEXT_YELLOW); - func_80093324(temp_s3->column, temp_s3->row + (var_s0 * 13), gTextPauseButton[var_s0 * 4], 0, 0.75f, 0.75f); + text_rainbow_effect(arg0->state - 31, var_s0, TEXT_YELLOW); + print_text_mode_1(temp_s3->column, temp_s3->row + (var_s0 * 13), gTextPauseButton[var_s0 * 4], 0, 0.75f, 0.75f); } } -void render_pause_battle(struct_8018D9E0_entry* arg0) { +void render_pause_battle(MenuItem* arg0) { struct UnkStruct_800DC5EC* temp_v0; s16 temp_t0; s16 temp_v1; @@ -7736,15 +7817,15 @@ void render_pause_battle(struct_8018D9E0_entry* arg0) { } else { var_s1 = var_a1; } - text_rainbow_effect(arg0->cursor - 0x29, var_a1, TEXT_YELLOW); - func_80093324(temp_s3->column - 2, temp_s3->row + 13 * var_a1, gTextPauseButton[var_s1], 0, 0.75f, 0.75f); + text_rainbow_effect(arg0->state - 0x29, var_a1, TEXT_YELLOW); + print_text_mode_1(temp_s3->column - 2, temp_s3->row + 13 * var_a1, gTextPauseButton[var_s1], 0, 0.75f, 0.75f); } } void func_800A54EC(void) { Unk_D_800E70A0 sp50; Unk_D_800E70A0* var_v1; - struct_8018D9E0_entry* sp48; + MenuItem* sp48; s32 whyTheSequel; s32 why; UNUSED Unk_D_800E70A0* huh; @@ -7754,7 +7835,7 @@ void func_800A54EC(void) { } why = gModeSelection; - sp48 = find_8018D9E0_entry(0x000000C7); + sp48 = find_menu_items(MENU_ITEM_PAUSE); if (why) {} // ????? gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(D_802B8880)); guOrtho(&gGfxPool->mtxEffect[gMatrixEffectCount], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); @@ -7778,11 +7859,11 @@ void func_800A54EC(void) { } whyTheSequel = D_800F0B50[why]; sp50.column = var_v1->column - 8; - sp50.row = (var_v1->row + ((sp48->cursor - whyTheSequel) * 0xD)) - 8; + sp50.row = (var_v1->row + ((sp48->state - whyTheSequel) * 0xD)) - 8; func_800A66A8(sp48, &sp50); } -void func_800A5738(struct_8018D9E0_entry* arg0) { +void render_menu_item_end_course_option(MenuItem* arg0) { Unk_D_800E70A0 sp98; UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; @@ -7800,143 +7881,144 @@ void func_800A5738(struct_8018D9E0_entry* arg0) { Unk_D_800E70A0* var_v0_9; char sp5C[3]; - if (arg0->cursor == 0) { - if ((arg0->unk1C >= 0x1E) && ((gGlobalTimer / 16) % 2)) { - why = get_string_width(gTextPauseButton[5]) * 0.8f; + if (arg0->state == 0) { + if ((arg0->param1 >= 0x1E) && ((gGlobalTimer / 16) % 2)) { + why = get_string_width(gTextPauseButton[REPLAY]) * 0.8f; gDisplayListHead = draw_box(gDisplayListHead, 0x000000C0, 0x00000021, (s32) (why) + 0xC6, 0x00000032, 0, 0, 0, 0x00000096); - set_text_color(1); - func_80093324(0x000000BF, 0x00000030, gTextPauseButton[5], 0, 0.8f, 0.8f); + set_text_color(TEXT_GREEN); + print_text_mode_1(0x000000BF, 0x00000030, gTextPauseButton[REPLAY], 0, 0.8f, 0.8f); } } else { - if (arg0->cursor == 1) { - var_s1 = arg0->unk1C; - var_s2 = (s32) (arg0->unk1C * 0xFF) / 140; + if (arg0->state == 1) { + var_s1 = arg0->param1; + var_s2 = (s32) (arg0->param1 * 0xFF) / 140; } else { var_s1 = 0x0000008C; var_s2 = 0x000000FF; } gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, var_s1); gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, var_s2); - set_text_color(3); - func_80093754(0x000000A0, 0x00000050, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, - 1.0f, 1.0f); - switch (arg0->cursor) { /* switch 1 */ - case 1: /* switch 1 */ - case 11: /* switch 1 */ - case 12: /* switch 1 */ - case 13: /* switch 1 */ - case 14: /* switch 1 */ - case 15: /* switch 1 */ - case 16: /* switch 1 */ - set_text_color(2); - func_80093754(0x0000009D, 0x00000060, D_800E7728[0], 0, 0.8f, 0.8f); + set_text_color(TEXT_YELLOW); + print_text1_center_mode_2(0x000000A0, 0x00000050, + gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f, 1.0f); + switch (arg0->state) { + case 1: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + set_text_color(TEXT_RED); + print_text1_center_mode_2(0x0000009D, 0x00000060, gBestTimeText[0], 0, 0.8f, 0.8f); temp_a0 = func_800B4E24(0); temp_a0 &= 0xFFFFF; get_time_record_minutes(temp_a0, sp84); text_draw(0x0000007F, 0x0000006D, sp84, 0, 0.8f, 0.8f); - func_80093358(0x0000008E, 0x0000006D, "'", 0, 0.8f, 0.8f); + print_text_mode_2(0x0000008E, 0x0000006D, "'", 0, 0.8f, 0.8f); get_time_record_seconds(temp_a0, sp84); text_draw(0x00000098, 0x0000006D, sp84, 0, 0.8f, 0.8f); - func_80093358(0x000000A7, 0x0000006D, "\"", 0, 0.8f, 0.8f); + print_text_mode_2(0x000000A7, 0x0000006D, "\"", 0, 0.8f, 0.8f); get_time_record_centiseconds(temp_a0, sp84); text_draw(0x000000B3, 0x0000006D, sp84, 0, 0.8f, 0.8f); - func_80093754(0x0000009D, 0x0000007C, D_800E7728[1], 0, 0.8f, 0.8f); + print_text1_center_mode_2(0x0000009D, 0x0000007C, gBestTimeText[1], 0, 0.8f, 0.8f); temp_a0 = func_800B4F2C(); temp_a0 &= 0xFFFFF; get_time_record_minutes(temp_a0, sp84); text_draw(0x0000007F, 0x00000089, sp84, 0, 0.8f, 0.8f); - func_80093358(0x0000008E, 0x00000089, "'", 0, 0.8f, 0.8f); + print_text_mode_2(0x0000008E, 0x00000089, "'", 0, 0.8f, 0.8f); get_time_record_seconds(temp_a0, sp84); text_draw(0x00000098, 0x00000089, sp84, 0, 0.8f, 0.8f); - func_80093358(0x000000A7, 0x00000089, "\"", 0, 0.8f, 0.8f); + print_text_mode_2(0x000000A7, 0x00000089, "\"", 0, 0.8f, 0.8f); get_time_record_centiseconds(temp_a0, sp84); text_draw(0x000000B3, 0x00000089, sp84, 0, 0.8f, 0.8f); for (var_s1 = 0; var_s1 < 6; var_s1++) { - text_rainbow_effect(arg0->cursor - 0xB, var_s1, TEXT_GREEN); - func_80093358(D_800E8538[zero].column, D_800E8538[zero].row + (0xD * var_s1), - gTextPauseButton[var_s1 + 1], 0, 0.75f, 0.75f); - } - break; - case 21: /* switch 1 */ - case 22: /* switch 1 */ - case 23: /* switch 1 */ - case 24: /* switch 1 */ - case 25: /* switch 1 */ - case 26: /* switch 1 */ - set_text_color(3); - temp_v0 = arg0->cursor - 0x15; + text_rainbow_effect(arg0->state - 0xB, var_s1, TEXT_GREEN); + print_text_mode_2(D_800E8538[zero].column, D_800E8538[zero].row + (0xD * var_s1), + gTextPauseButton[var_s1 + 1], 0, 0.75f, 0.75f); + } + break; + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + set_text_color(TEXT_YELLOW); + temp_v0 = arg0->state - 0x15; for (var_s1 = 0; var_s1 < 7; var_s1++) { - func_80093324(0x0000004D, 0x6E + (0xD * var_s1), D_800E798C[(temp_v0 * 7) + var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x0000004D, 0x6E + (0xD * var_s1), D_800E798C[(temp_v0 * 7) + var_s1], 0, 0.8f, + 0.8f); } break; - case 30: /* switch 1 */ - case 31: /* switch 1 */ - set_text_color(1); + case 30: + case 31: + set_text_color(TEXT_GREEN); for (var_s1 = 0; var_s1 < 2; var_s1++) { - func_80093324(0x0000005A, arg0->row + (0xD * var_s1) + 0x6E, D_800E7A3C[var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x0000005A, arg0->row + (0xD * var_s1) + 0x6E, D_800E7A3C[var_s1], 0, 0.8f, 0.8f); } for (var_s1 = 0; var_s1 < 2; var_s1++) { - text_rainbow_effect(arg0->cursor - 0x1E, var_s1, TEXT_GREEN); + text_rainbow_effect(arg0->state - 0x1E, var_s1, TEXT_GREEN); convert_number_to_ascii(var_s1 + 1, sp5C); - func_80093324(0x5A - arg0->column, (0x96 + (0x14 * var_s1)), &sp5C[1], 0, 0.75f, 0.75f); + print_text_mode_1(0x5A - arg0->column, (0x96 + (0x14 * var_s1)), &sp5C[1], 0, 0.75f, 0.75f); if (D_8018EE10[var_s1].ghostDataSaved == 0) { - func_80093324(0x69 - arg0->column, (0x96 + (0x14 * var_s1)), D_800E7A44, 0, 0.75f, 0.75f); + print_text_mode_1(0x69 - arg0->column, (0x96 + (0x14 * var_s1)), D_800E7A44, 0, 0.75f, 0.75f); } else { - func_80093324(0x69 - arg0->column, (0x96 + (0x14 * var_s1)), - gCourseNamesDup2[gCupCourseOrder[D_8018EE10[var_s1].courseIndex / 4] - [D_8018EE10[var_s1].courseIndex % 4]], - 0, 0.75f, 0.75f); + print_text_mode_1(0x69 - arg0->column, (0x96 + (0x14 * var_s1)), + gCourseNamesDup2[gCupCourseOrder[D_8018EE10[var_s1].courseIndex / 4] + [D_8018EE10[var_s1].courseIndex % 4]], + 0, 0.75f, 0.75f); } } break; - case 32: /* switch 1 */ - set_text_color(3); + case 32: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 3; var_s1++) { - func_80093324(0x00000064, (0xD * var_s1) + 0x6E, D_800E7A48[var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x00000064, (0xD * var_s1) + 0x6E, D_800E7A48[var_s1], 0, 0.8f, 0.8f); } break; - case 35: /* switch 1 */ - case 36: /* switch 1 */ - set_text_color(3); + case 35: + case 36: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 3; var_s1++) { - func_80093324(0x00000055, arg0->row + (0xD * var_s1) + 0x6E, D_800E7A60[var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x00000055, arg0->row + (0xD * var_s1) + 0x6E, D_800E7A60[var_s1], 0, 0.8f, 0.8f); } for (var_s1 = 0; var_s1 < 2; var_s1++) { - text_rainbow_effect(arg0->cursor - 0x23, var_s1, TEXT_GREEN); - func_80093324(0x7D - arg0->column, 0x9B + (0xF * var_s1), D_800E7A6C[var_s1], 0, 0.8f, 0.8f); + text_rainbow_effect(arg0->state - 0x23, var_s1, TEXT_GREEN); + print_text_mode_1(0x7D - arg0->column, 0x9B + (0xF * var_s1), D_800E7A6C[var_s1], 0, 0.8f, 0.8f); } break; - case 40: /* switch 1 */ - set_text_color(3); + case 40: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 3; var_s1++) { - func_80093324(0x00000055, (0xD * var_s1) + 0x6E, D_800E7A74[var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x00000055, (0xD * var_s1) + 0x6E, D_800E7A74[var_s1], 0, 0.8f, 0.8f); } break; - case 41: /* switch 1 */ - set_text_color(3); + case 41: + set_text_color(TEXT_YELLOW); for (var_s1 = 0; var_s1 < 2; var_s1++) { - func_80093324(0x0000005D, (0xD * var_s1) + 0x6E, D_800E7A80[var_s1], 0, 0.8f, 0.8f); + print_text_mode_1(0x0000005D, (0xD * var_s1) + 0x6E, D_800E7A80[var_s1], 0, 0.8f, 0.8f); } break; } - switch (arg0->cursor) { /* switch 2 */ - case 11: /* switch 2 */ - case 12: /* switch 2 */ - case 13: /* switch 2 */ - case 14: /* switch 2 */ - case 15: /* switch 2 */ - case 16: /* switch 2 */ - var_v0_9 = &D_800E73E0[arg0->cursor - 11]; + switch (arg0->state) { /* switch 2 */ + case 11: /* switch 2 */ + case 12: /* switch 2 */ + case 13: /* switch 2 */ + case 14: /* switch 2 */ + case 15: /* switch 2 */ + case 16: /* switch 2 */ + var_v0_9 = &D_800E73E0[arg0->state - 11]; break; case 30: /* switch 2 */ case 31: /* switch 2 */ - var_v0_9 = &D_800E7410[arg0->cursor - 30]; + var_v0_9 = &D_800E7410[arg0->state - 30]; break; case 35: /* switch 2 */ case 36: /* switch 2 */ if (0) {} // wtf? - var_v0_9 = &D_800E7420[arg0->cursor - 35]; + var_v0_9 = &D_800E7420[arg0->state - 35]; break; default: return; @@ -7947,21 +8029,21 @@ void func_800A5738(struct_8018D9E0_entry* arg0) { } } -void func_800A6034(struct_8018D9E0_entry* arg0) { +void func_800A6034(MenuItem* arg0) { char* text; if (D_801657E8 != true) { - gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, arg0->unk1C); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, arg0->param1); text = gCupNames[D_800DC540]; set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); - func_80093754(arg0->column + 0x41, arg0->row + 0xA0, text, 0, 0.85f, 1.0f); + print_text1_center_mode_2(arg0->column + 0x41, arg0->row + 0xA0, text, 0, 0.85f, 1.0f); text = gCourseNames[gCurrentCourseId]; set_text_color((s32) gCurrentCourseId % 4); - func_80093754(arg0->column + 0x41, arg0->row + 0xC3, text, 0, 0.65f, 0.85f); + print_text1_center_mode_2(arg0->column + 0x41, arg0->row + 0xC3, text, 0, 0.65f, 0.85f); } } -void func_800A6154(struct_8018D9E0_entry* arg0) { +void func_800A6154(MenuItem* arg0) { UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; @@ -7970,49 +8052,49 @@ void func_800A6154(struct_8018D9E0_entry* arg0) { s32 var_s0; s32 var_s1; - if (arg0->cursor == 0) { - gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->unk1C); - set_text_color(3); - gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, (arg0->unk1C * 0xFF) / 100); + if (arg0->state == 0) { + gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->param1); + set_text_color(TEXT_YELLOW); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, (arg0->param1 * 0xFF) / 100); for (var_s1 = 0, var_s0 = 0x96; var_s0 < 0xBE; var_s1++, var_s0 += 0x14) { - func_80093358(0x0000008C, var_s0, gTextPauseButton[(var_s1 * 3) + 1], 0, 1.0f, 1.0f); + print_text_mode_2(0x0000008C, var_s0, gTextPauseButton[(var_s1 * 3) + 1], 0, 1.0f, 1.0f); } } else { gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x00000064); for (var_s1 = 0, var_s0 = 0x96; var_s1 < 2; var_s1++, var_s0 += 0x14) { - text_rainbow_effect(arg0->cursor - 0xB, var_s1, TEXT_YELLOW); - func_80093324(0x0000008C, var_s0, gTextPauseButton[(var_s1 * 3) + 1], 0, 1.0f, 1.0f); + text_rainbow_effect(arg0->state - 0xB, var_s1, TEXT_YELLOW); + print_text_mode_1(0x0000008C, var_s0, gTextPauseButton[(var_s1 * 3) + 1], 0, 1.0f, 1.0f); } } - if (arg0->cursor >= 0xB) { + if (arg0->state >= 0xB) { sp6C.column = 0x0084; - sp6C.row = (arg0->cursor * 0x14) - 0x4E; + sp6C.row = (arg0->state * 0x14) - 0x4E; func_800A66A8(arg0, &sp6C); } - if (arg0->unk20 > 0) { - gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x0000013F, arg0->unk20); - gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk20, 0x0000013F, 0x000000EF); + if (arg0->param2 > 0) { + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x0000013F, arg0->param2); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->param2, 0x0000013F, 0x000000EF); } } -void func_800A638C(struct_8018D9E0_entry* arg0) { +void func_800A638C(MenuItem* arg0) { UNUSED s32 temp_a0; s32 var_a1; UNUSED s32 var_s0; s32 var_s1; UNUSED s8** var_s2; - if (arg0->cursor == 0) { - gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->unk1C); - set_text_color(5); - gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, (arg0->unk1C * 0xFF) / 100); - func_80093754(0x000000A0, arg0->row + 0x1E, D_800E7778[gModeSelection / 3], 0, 1.0f, 1.0f); + if (arg0->state == 0) { + gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->param1); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, (arg0->param1 * 0xFF) / 100); + print_text1_center_mode_2(0x000000A0, arg0->row + 0x1E, D_800E7778[gModeSelection / 3], 0, 1.0f, 1.0f); } else { gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x00000064); - set_text_color(5); - draw_text(0x000000A0, arg0->row + 0x1E, D_800E7778[gModeSelection / 3], 0, 1.0f, 1.0f); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); + print_text1_center_mode_1(0x000000A0, arg0->row + 0x1E, D_800E7778[gModeSelection / 3], 0, 1.0f, 1.0f); } - switch (arg0->cursor) { /* irregular */ + switch (arg0->state) { /* irregular */ default: var_a1 = 0x000000FF; break; @@ -8021,7 +8103,7 @@ void func_800A638C(struct_8018D9E0_entry* arg0) { var_a1 = 0; break; case 2: - var_a1 = arg0->unk1C; + var_a1 = arg0->param1; break; } gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, var_a1); @@ -8038,64 +8120,59 @@ void func_800A638C(struct_8018D9E0_entry* arg0) { default: break; } - if (arg0->cursor >= 10) { + if (arg0->state >= 10) { for (var_s1 = 0; var_s1 < 4; var_s1++) { - text_rainbow_effect(arg0->cursor - 0xA, var_s1, TEXT_GREEN); - func_80093324(0x00000069, 0xAE + (0xF * var_s1), gTextPauseButton[var_s1 + 1], 0, 0.8f, 0.8f); + text_rainbow_effect(arg0->state - 0xA, var_s1, TEXT_GREEN); + print_text_mode_1(0x00000069, 0xAE + (0xF * var_s1), gTextPauseButton[var_s1 + 1], 0, 0.8f, 0.8f); } - func_800A66A8(arg0, &D_800E7360[arg0->cursor - 10]); + func_800A66A8(arg0, &D_800E7360[arg0->state - 10]); } } -#ifdef NON_MATCHING -void guMtxCatL(Mtx*, Mtx*, Mtx*); -// https://decomp.me/scratch/GUqCE -// All the math stuff at the top is messed up -void func_800A66A8(struct_8018D9E0_entry* arg0, Unk_D_800E70A0* arg1) { - Mtx* temp_s0; - Mtx* temp_s1; - f32 temp_f2; - f32 temp_f12; - f32 temp_f14; +void func_800A66A8(MenuItem* arg0, Unk_D_800E70A0* arg1) { + Mtx* mtx; + f32 tmp; + static float x2, y2, z2; + static float x1, y1, z1; - temp_s1 = &gGfxPool->mtxEffect[gMatrixEffectCount]; - if (arg0->unk24 > 1.5) { - arg0->unk24 *= 0.95; + mtx = &gGfxPool->mtxEffect[gMatrixEffectCount]; + if (arg0->paramf > 1.5) { + arg0->paramf *= 0.95; } else { - arg0->unk24 = 1.5f; - } - temp_f2 = arg0->unk24 * 3.0f * arg0->unk8; - temp_f12 = arg0->unk24 * 4.0f; - temp_f14 = arg0->unk24 * 2.0f; - D_8018EDA4 = temp_f2; - D_8018EDA8 = temp_f12; - D_8018EDAC = temp_f14; - D_8018ED98 += D_8018EDA4; - D_8018ED9C += D_8018EDA8; - D_8018EDA0 += D_8018EDAC; - guScale(temp_s1, 1.2f, 1.2f, 1.2f); - temp_s0 = temp_s1 + 1; - guRotate(temp_s0, D_8018ED9C, 0.0f, 1.0f, 0.0f); - guMtxCatL(temp_s1, temp_s0, temp_s1); - guRotate(temp_s0, D_8018EDA0, 0.0f, 0.0f, 1.0f); - guMtxCatL(temp_s1, temp_s0, temp_s1); - guRotate(temp_s0, D_8018ED98, 1.0f, 0.0f, 0.0f); - guMtxCatL(temp_s1, temp_s0, temp_s1); - guTranslate(temp_s0, arg1->column, arg1->row, 0.0f); - guMtxCatL(temp_s1, temp_s0, temp_s1); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + arg0->paramf = 1.5; + } + + tmp = arg0->paramf; + x1 = (tmp * 3) * arg0->subState; + y1 = tmp * 4; + z1 = tmp * 2; + x2 += x1; + y2 += y1; + z2 += z1; + + // clang-format off + if (x2) {}; if (y2) {}; if (z2) {}; + // clang-format on + + guScale(mtx, 1.2f, 1.2f, 1.2f); + guRotate(mtx + 1, y2, 0.0f, 1.0f, 0.0f); + guMtxCatL(mtx, mtx + 1, mtx); + guRotate(mtx + 1, z2, 0.0f, 0.0f, 1.0f); + guMtxCatL(mtx, mtx + 1, mtx); + guRotate(mtx + 1, x2, 1.0f, 0.0f, 0.0f); + guMtxCatL(mtx, mtx + 1, mtx); + guTranslate(mtx + 1, arg1->column, arg1->row, 0.0f); + guMtxCatL(mtx, mtx + 1, mtx); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount++]), + (G_MTX_NOPUSH | G_MTX_LOAD) | G_MTX_MODELVIEW); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPNoOp(gDisplayListHead++); gDPSetRenderMode(gDisplayListHead++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gSPDisplayList(gDisplayListHead++, D_0D003090); } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A66A8.s") -#endif -void func_800A69C8(UNUSED struct_8018D9E0_entry* arg0) { +void func_800A69C8(UNUSED MenuItem* arg0) { Unk_D_800E70A0* thing; UNUSED s32 stackPadding1; s32 var_s0; @@ -8121,7 +8198,7 @@ void func_800A69C8(UNUSED struct_8018D9E0_entry* arg0) { var_s4 = &gNmiUnknown4[var_s0]; break; } - temp_s3 = D_800E7720[var_v1]; + temp_s3 = gWinLoseText[var_v1]; if (var_v1 != 0) { set_text_color(TEXT_BLUE); } else { @@ -8129,14 +8206,14 @@ void func_800A69C8(UNUSED struct_8018D9E0_entry* arg0) { } func_800A79F4(var_s4[0], sp74); text_draw(thing->column + 0x10, thing->row + 0x75, sp74, 0, 1.0f, 1.0f); - func_80093754(D_800E7380[var_s0].column, D_800E7380[var_s0].row, temp_s3, 0, 0.65f, 1.0f); + print_text1_center_mode_2(D_800E7380[var_s0].column, D_800E7380[var_s0].row, temp_s3, 0, 0.65f, 1.0f); } set_text_color(TEXT_BLUE); // Not a hyphen, that is an EUC-JP character text_draw(0x0000009E, D_800E7300[0].row + 0x6D, "ー", 0, 1.0f, 1.0f); } -void func_800A6BEC(UNUSED struct_8018D9E0_entry* arg0) { +void func_800A6BEC(UNUSED MenuItem* arg0) { s32 var_s0; for (var_s0 = 0; var_s0 < gPlayerCount; var_s0++) { @@ -8151,7 +8228,7 @@ void func_800A6BEC(UNUSED struct_8018D9E0_entry* arg0) { } } -void func_800A6CC0(UNUSED struct_8018D9E0_entry* arg0) { +void func_800A6CC0(UNUSED MenuItem* arg0) { s32 var_s0; for (var_s0 = 0; var_s0 < gPlayerCount; var_s0++) { @@ -8180,7 +8257,7 @@ void func_800A6D94(s32 arg0, s32 arg1, u8* arg2) { } thing = arg2[arg1]; if (var_v0 != 0) { - set_text_color(0); + set_text_color(TEXT_BLUE); } else { set_text_color(gGlobalTimer % 3); } @@ -8230,14 +8307,14 @@ void func_800A6E94(s32 arg0, s32 arg1, u8* arg2) { text_draw(temp_s0->column + 0x2D, temp_s0->row + 0x78, sp40, 0, 0.8f, 0.8f); } -void func_800A70E8(struct_8018D9E0_entry* arg0) { +void func_800A70E8(MenuItem* arg0) { s32 var_s0; s32 temp_f6; s32 alpha; s32 loopIndex; s32 stringIndex; - if (arg0->cursor == 1) { + if (arg0->state == 1) { var_s0 = get_string_width(D_800E7A34[0]) * 0.45f; temp_f6 = get_string_width(D_800E7A34[1]) * 0.45f; if (var_s0 < temp_f6) { @@ -8245,23 +8322,23 @@ void func_800A70E8(struct_8018D9E0_entry* arg0) { } gDisplayListHead = draw_box(gDisplayListHead, 0x000000C0, 0x00000022, var_s0 + 0xC6, 0x00000039, 0, 0, 0, 0x00000096); - alpha = 0x180 - ((arg0->unk1C % 32) * 8); + alpha = 0x180 - ((arg0->param1 % 32) * 8); if (alpha >= 0x100) { alpha = 0xFF; } gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, alpha); set_text_color(TEXT_RED); for (loopIndex = 0x2C, stringIndex = 0; loopIndex < 0x40; loopIndex += 0xA, stringIndex++) { - func_80093358(0x000000C0, loopIndex, D_800E7A34[stringIndex], 0, 0.45f, 0.45f); + print_text_mode_2(0x000000C0, loopIndex, D_800E7A34[stringIndex], 0, 0.45f, 0.45f); } } } // Shading layer of the grand prix podium result screen -void func_800A7258(struct_8018D9E0_entry* arg0) { - if (arg0->cursor == 0) { +void func_800A7258(MenuItem* arg0) { + if (arg0->state == 0) { // If shading layer is fading in - gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, arg0->unk1C); + gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, arg0->param1); } else { // All other stages of the podium scene gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, 0x64); @@ -8269,36 +8346,36 @@ void func_800A7258(struct_8018D9E0_entry* arg0) { } // Podium scene, top line -void func_800A72FC(struct_8018D9E0_entry* arg0) { +void func_800A72FC(MenuItem* arg0) { UNUSED s32 pad; s32 cupNameLength = (((f32) get_string_width(gCupNames[gCupSelection]) * 1) + 10) / 2; s32 ccNameLength = (((f32) get_string_width(D_800E76CC[gCCSelection]) * 1) + 10) / 2; set_text_color(TEXT_YELLOW); - draw_text(arg0->column - ccNameLength, arg0->row, gCupNames[gCupSelection], 0, 1, 1); + print_text1_center_mode_1(arg0->column - ccNameLength, arg0->row, gCupNames[gCupSelection], 0, 1, 1); set_text_color(TEXT_YELLOW); - draw_text(arg0->column + cupNameLength, arg0->row, D_800E76DC[gCCSelection], 0, 1, 1); + print_text1_center_mode_1(arg0->column + cupNameLength, arg0->row, D_800E76DC[gCCSelection], 0, 1, 1); } -void func_800A7448(struct_8018D9E0_entry* arg0) { +void func_800A7448(MenuItem* arg0) { UNUSED s32 pad; s32 sp40; s32 sp3C; s32 thing = D_802874D8.unk1D; if (thing >= 3) { set_text_color(TEXT_YELLOW); - draw_text(arg0->column, arg0->row, D_800E7A98, 0, 0.75f, 0.75f); + print_text1_center_mode_1(arg0->column, arg0->row, D_800E7A98, 0, 0.75f, 0.75f); } else { sp40 = (s32) (((f32) (get_string_width(D_800E7A88[0]) + 5) * 0.75f) / 2); sp3C = (s32) (((f32) (get_string_width(D_800E7A88[thing + 1]) + 5) * 0.75f) / 2); set_text_color(TEXT_YELLOW); - draw_text(arg0->column - sp3C, arg0->row, D_800E7A88[0], 0, 0.75f, 0.75f); + print_text1_center_mode_1(arg0->column - sp3C, arg0->row, D_800E7A88[0], 0, 0.75f, 0.75f); set_text_color(TEXT_YELLOW); - draw_text(arg0->column + sp40, arg0->row, D_800E7A88[thing + 1], 0, 0.75f, 0.75f); + print_text1_center_mode_1(arg0->column + sp40, arg0->row, D_800E7A88[thing + 1], 0, 0.75f, 0.75f); } } -void func_800A75A0(struct_8018D9E0_entry* arg0) { +void func_800A75A0(MenuItem* arg0) { UNUSED s32 pad; s32 topThree; @@ -8309,10 +8386,10 @@ void func_800A75A0(struct_8018D9E0_entry* arg0) { } set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); - draw_text(arg0->column, arg0->row, D_800E7A9C[topThree], 0, 1.3f, 1.3f); + print_text1_center_mode_1(arg0->column, arg0->row, D_800E7A9C[topThree], 0, 1.3f, 1.3f); } -void func_800A761C(struct_8018D9E0_entry* arg0) { +void func_800A761C(MenuItem* arg0) { UNUSED s32 stackPadding0; s32 sp48; s32 sp44; @@ -8322,32 +8399,32 @@ void func_800A761C(struct_8018D9E0_entry* arg0) { temp_a0 = D_802874D8.unk1D + 1; func_800A79F4(temp_a0, sp3C); - sp48 = ((get_string_width(D_800E7AA4[0]) + 5) * 1.2f) / 2; - sp44 = ((get_string_width(D_800E7AA4[temp_a0]) + 5) * 1.2f) / 2; - set_text_color(5); - draw_text(arg0->column - sp44, arg0->row, D_800E7AA4[0], 0, 1.2f, 1.2f); + sp48 = ((get_string_width(gPlaceText[0]) + 5) * 1.2f) / 2; + sp44 = ((get_string_width(gPlaceText[temp_a0]) + 5) * 1.2f) / 2; + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2); + print_text1_center_mode_1(arg0->column - sp44, arg0->row, gPlaceText[0], 0, 1.2f, 1.2f); set_text_color((s32) gGlobalTimer % 3); - draw_text(arg0->column + sp48, arg0->row, D_800E7AA4[temp_a0], 0, 1.2f, 1.2f); + print_text1_center_mode_1(arg0->column + sp48, arg0->row, gPlaceText[temp_a0], 0, 1.2f, 1.2f); convert_number_to_ascii(temp_a0, sp3C); func_800939C8((arg0->column + sp48) - 0x18, arg0->row, &sp3C[1], 0, 2.0f, 2.0f); } -void func_800A7790(struct_8018D9E0_entry* arg0) { +void menu_item_credits_render(MenuItem* arg0) { f32 someScaling; s32 creditIndex; s8 slideDirection; UNUSED s32 pad; creditIndex = arg0->type - 0x190; - set_text_color(D_802850C0[creditIndex].textColor); - slideDirection = D_802850C0[creditIndex].slideDirection; + set_text_color(gCreditsTextRenderInfo[creditIndex].textColor); + slideDirection = gCreditsTextRenderInfo[creditIndex].slideDirection; if ((slideDirection == SLIDE_RIGHT) || (slideDirection != SLIDE_LEFT)) { - someScaling = D_802850C0[creditIndex].textScaling; - func_800936B8(arg0->column, arg0->row, D_802854B0[creditIndex], arg0->unk1C * someScaling, - arg0->unk24 * someScaling, someScaling); + someScaling = gCreditsTextRenderInfo[creditIndex].textScaling; + print_text1_left(arg0->column, arg0->row, gCreditsText[creditIndex], arg0->param1 * someScaling, + arg0->paramf * someScaling, someScaling); } else { - someScaling = D_802850C0[creditIndex].textScaling; - func_80093324(arg0->column, arg0->row, D_802854B0[creditIndex], arg0->unk1C * someScaling, - arg0->unk24 * someScaling, someScaling); + someScaling = gCreditsTextRenderInfo[creditIndex].textScaling; + print_text_mode_1(arg0->column, arg0->row, gCreditsText[creditIndex], arg0->param1 * someScaling, + arg0->paramf * someScaling, someScaling); } } @@ -8415,427 +8492,428 @@ void func_800A79F4(s32 arg0, char* arg1) { arg1[4] = '\0'; } -void func_800A7A4C(s32 arg0) { - s32 var_s0; - s32 var_v1; - s32 var_v1_2; +void handle_menus_with_pri_arg(s32 priSpecial) { + s32 j; + s32 isRendered; + s32 i; s32 type; - struct_8018D9E0_entry* var_s1; - s32 one = 1; + MenuItem* entry; - for (var_v1_2 = 0; var_v1_2 < D_8018D9E0_SIZE; var_v1_2++) { - var_v1 = 0; - var_s1 = &D_8018D9E0[var_v1_2]; - type = var_s1->type; - if ((type == 4) || (type == 5) || (type == 0x000000C7)) { - if (arg0 != 0) { - var_v1 = 1; + for (i = 0; i < ARRAY_COUNT(gMenuItems); i++) { + isRendered = false; + entry = &gMenuItems[i]; + type = entry->type; + if ((type == MENU_ITEM_UI_NO_CONTROLLER) || (type == MENU_ITEM_UI_START_RECORD_TIME) || + (type == MENU_ITEM_PAUSE)) { + if (priSpecial != 0) { + isRendered = true; } - } else if (arg0 == 0) { - var_v1 = 1; + } else if (priSpecial == 0) { + isRendered = true; } - if (var_v1 == 0) { + if (isRendered == false) { continue; } - switch (type) { /* switch 8; irregular */ - case 0xFA: /* switch 8 */ - if (s8018ED94 < 0x50) { - D_800E8534 = 3.0f; - } else if (s8018ED94 < 0x5A) { - if (D_800E8530 < 1.0) { - D_800E8530 += 0.1; + switch (type) { /* switch 8; irregular */ + case MENU_ITEM_UI_LOGO_INTRO: /* switch 8 */ + if (sIntroModelTimer < 0x50) { + sIntroModelSpeed = 3.0f; + } else if (sIntroModelTimer < 0x5A) { + if (sIntroModelMotionSpeed < 1.0) { + sIntroModelMotionSpeed += 0.1; } - D_800E8534 += 0.1; - } else if (s8018ED94 < 0xA0) { - D_800E8534 += 0.1; - } else if (s8018ED94 < 0x190) { - D_800E8534 += 0.3; - } - D_8018EDCC -= D_800E8534; - s8018ED94 += 1; - if (D_8018EDCC < -360.0f) { - D_8018EDCC += 360.0f; - } - var_s1->unk1C++; - if (var_s1->unk1C == 0x000000B4) { + sIntroModelSpeed += 0.1; + } else if (sIntroModelTimer < 0xA0) { + sIntroModelSpeed += 0.1; + } else if (sIntroModelTimer < 0x190) { + sIntroModelSpeed += 0.3; + } + gIntroModelRotY -= sIntroModelSpeed; + sIntroModelTimer += 1; + if (gIntroModelRotY < -360.0f) { + gIntroModelRotY += 360.0f; + } + entry->param1++; + if (entry->param1 == 0x000000B4) { func_8009E000(0x00000028); func_800CA388(0x64U); - D_8018EDE0 = 0; + gMenuFadeType = MENU_FADE_TYPE_MAIN; } - if ((var_s1->unk20 != 0) && (var_s1->unk1C >= 3)) { - var_s1->unk20 = 0; + if ((entry->param2 != 0) && (entry->param1 >= 3)) { + entry->param2 = 0; play_sound2(SOUND_INTRO_LOGO); } break; - case 0xDA: /* switch 8 */ - func_800A954C(var_s1); + case MENU_ITEM_TYPE_0DA: /* switch 8 */ + func_800A954C(entry); break; - case 0xD6: /* switch 8 */ - func_800A9710(var_s1); + case MENU_ITEM_TYPE_0D6: /* switch 8 */ + func_800A9710(entry); break; - case 0xD4: /* switch 8 */ - func_800A97BC(var_s1); + case MENU_ITEM_TYPE_0D4: /* switch 8 */ + func_800A97BC(entry); break; - case 0x5: /* switch 8 */ - switch (var_s1->cursor) { /* switch 9; irregular */ - case 0: /* switch 9 */ + case MENU_ITEM_UI_START_RECORD_TIME: /* switch 8 */ + switch (entry->state) { /* switch 9; irregular */ + case 0: /* switch 9 */ if (gControllerFive->button & R_TRIG) { - var_s1->cursor = (s32) 1U; + entry->state = (s32) 1U; play_sound2(SOUND_ACTION_PING); } else { - var_s1->visible = 0; + entry->visible = 0; } break; case 1: /* switch 9 */ default: /* switch 9 */ - var_s1->visible = one; + entry->visible = 1; break; } break; - case 0xA: /* switch 8 */ - func_800AA280(var_s1); + case MENU_ITEM_UI_GAME_SELECT: /* switch 8 */ + func_800AA280(entry); break; - case 0x10: /* switch 8 */ - case 0x11: /* switch 8 */ - switch (gMainMenuSelectionDepth) { /* switch 5 */ - case OPTIONS_SELECTION: /* switch 5 */ - case DATA_SELECTION: /* switch 5 */ - case PLAYER_NUM_SELECTION: /* switch 5 */ - func_800A9B9C(var_s1); + case MAIN_MENU_OPTION_GFX: /* switch 8 */ + case MAIN_MENU_DATA_GFX: /* switch 8 */ + switch (gMainMenuSelection) { /* switch 5 */ + case MAIN_MENU_OPTION: /* switch 5 */ + case MAIN_MENU_DATA: /* switch 5 */ + case MAIN_MENU_PLAYER_SELECT: /* switch 5 */ + func_800A9B9C(entry); break; - case GAME_MODE_SELECTION: /* switch 5 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 5 */ - case CONFIRM_OK_SELECTION: /* switch 5 */ - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 5 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */ - func_800A9C40(var_s1); + case MAIN_MENU_MODE_SELECT: /* switch 5 */ + case MAIN_MENU_MODE_SUB_SELECT: /* switch 5 */ + case MAIN_MENU_OK_SELECT: /* switch 5 */ + case MAIN_MENU_OK_SELECT_GO_BACK: /* switch 5 */ + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: /* switch 5 */ + func_800A9C40(entry); break; } break; - case 0xF: /* switch 8 */ - func_800AA280(var_s1); - func_800A9A98(var_s1); + case MENU_ITEM_UI_OK: /* switch 8 */ + func_800AA280(entry); + update_ok_menu_item(entry); break; - case 0xB: /* switch 8 */ - case 0xC: /* switch 8 */ - case 0xD: /* switch 8 */ - case 0xE: /* switch 8 */ - switch (gMainMenuSelectionDepth) { /* switch 6 */ - case OPTIONS_SELECTION: /* switch 6 */ - case DATA_SELECTION: /* switch 6 */ - case PLAYER_NUM_SELECTION: /* switch 6 */ - func_800A9B9C(var_s1); + case MENU_ITEM_UI_1P_GAME: /* switch 8 */ + case MENU_ITEM_UI_2P_GAME: /* switch 8 */ + case MENU_ITEM_UI_3P_GAME: /* switch 8 */ + case MENU_ITEM_UI_4P_GAME: /* switch 8 */ + switch (gMainMenuSelection) { /* switch 6 */ + case MAIN_MENU_OPTION: /* switch 6 */ + case MAIN_MENU_DATA: /* switch 6 */ + case MAIN_MENU_PLAYER_SELECT: /* switch 6 */ + func_800A9B9C(entry); break; - case GAME_MODE_SELECTION: /* switch 6 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 6 */ - case CONFIRM_OK_SELECTION: /* switch 6 */ - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 6 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */ - func_800A9C40(var_s1); + case MAIN_MENU_MODE_SELECT: /* switch 6 */ + case MAIN_MENU_MODE_SUB_SELECT: /* switch 6 */ + case MAIN_MENU_OK_SELECT: /* switch 6 */ + case MAIN_MENU_OK_SELECT_GO_BACK: /* switch 6 */ + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: /* switch 6 */ + func_800A9C40(entry); break; } - func_800A9D5C(var_s1); - break; - case 0x12: /* switch 8 */ - case 0x13: /* switch 8 */ - case 0x14: /* switch 8 */ - case 0x15: /* switch 8 */ - case 0x16: /* switch 8 */ - case 0x17: /* switch 8 */ - case 0x18: /* switch 8 */ - case 0x19: /* switch 8 */ - func_800A9E58(var_s1); - break; - case 0x1B: /* switch 8 */ - func_800AA2EC(var_s1); - break; - case 0x34: /* switch 8 */ - case 0x35: /* switch 8 */ - case 0x36: /* switch 8 */ - case 0x37: /* switch 8 */ - func_800AADD4(var_s1); - break; - case 0x2B: /* switch 8 */ - case 0x2C: /* switch 8 */ - case 0x2D: /* switch 8 */ - case 0x2E: /* switch 8 */ - case 0x2F: /* switch 8 */ - case 0x30: /* switch 8 */ - case 0x31: /* switch 8 */ - case 0x32: /* switch 8 */ - func_800AAC18(var_s1); - switch (var_s1->type) { /* switch 7 */ - case 43: /* switch 7 */ - case 44: /* switch 7 */ - case 45: /* switch 7 */ - case 46: /* switch 7 */ - case 47: /* switch 7 */ - case 48: /* switch 7 */ - case 49: /* switch 7 */ - case 50: /* switch 7 */ - func_800AA69C(var_s1); + func_800A9D5C(entry); + break; + case MAIN_MENU_50CC: /* switch 8 */ + case MAIN_MENU_100CC: /* switch 8 */ + case MAIN_MENU_150CC: /* switch 8 */ + case MAIN_MENU_EXTRA_CC: /* switch 8 */ + case MENU_ITEM_TYPE_016: /* switch 8 */ + case MENU_ITEM_TYPE_017: /* switch 8 */ + case MAIN_MENU_TIME_TRIALS_BEGIN: /* switch 8 */ + case MAIN_MENU_TIME_TRIALS_DATA: /* switch 8 */ + func_800A9E58(entry); + break; + case MENU_ITEM_TYPE_01B: /* switch 8 */ + func_800AA2EC(entry); + break; + case CHARACTER_SELECT_MENU_1P_CURSOR: /* switch 8 */ + case CHARACTER_SELECT_MENU_2P_CURSOR: /* switch 8 */ + case CHARACTER_SELECT_MENU_3P_CURSOR: /* switch 8 */ + case CHARACTER_SELECT_MENU_4P_CURSOR: /* switch 8 */ + update_cursor(entry); + break; + case CHARACTER_SELECT_MENU_MARIO: /* switch 8 */ + case CHARACTER_SELECT_MENU_LUIGI: /* switch 8 */ + case CHARACTER_SELECT_MENU_TOAD: /* switch 8 */ + case CHARACTER_SELECT_MENU_PEACH: /* switch 8 */ + case CHARACTER_SELECT_MENU_YOSHI: /* switch 8 */ + case CHARACTER_SELECT_MENU_DK: /* switch 8 */ + case CHARACTER_SELECT_MENU_WARIO: /* switch 8 */ + case CHARACTER_SELECT_MENU_BOWSER: /* switch 8 */ + func_800AAC18(entry); + switch (entry->type) { /* switch 7 */ + case CHARACTER_SELECT_MENU_MARIO: /* switch 7 */ + case CHARACTER_SELECT_MENU_LUIGI: /* switch 7 */ + case CHARACTER_SELECT_MENU_TOAD: /* switch 7 */ + case CHARACTER_SELECT_MENU_PEACH: /* switch 7 */ + case CHARACTER_SELECT_MENU_YOSHI: /* switch 7 */ + case CHARACTER_SELECT_MENU_DK: /* switch 7 */ + case CHARACTER_SELECT_MENU_WARIO: /* switch 7 */ + case CHARACTER_SELECT_MENU_BOWSER: /* switch 7 */ + func_800AA69C(entry); break; } - switch (D_8018EDEE) { /* switch 10; irregular */ - case 1: /* switch 10 */ - func_800AAB90(var_s1); + switch (gPlayerSelectMenuSelection) { /* switch 10; irregular */ + case PLAYER_SELECT_MENU_MAIN: /* switch 10 */ + func_800AAB90(entry); break; - case 2: /* switch 10 */ - case 3: /* switch 10 */ - func_800AAA9C(var_s1); + case PLAYER_SELECT_MENU_OK: /* switch 10 */ + case PLAYER_SELECT_MENU_OK_GO_BACK: /* switch 10 */ + func_800AAA9C(entry); break; } - func_800AAE18(var_s1); + func_800AAE18(entry); break; - case 0x33: /* switch 8 */ - case 0x5D: /* switch 8 */ - func_800A9A98(var_s1); + case CHARACTER_SELECT_MENU_OK: /* switch 8 */ + case COURSE_SELECT_OK: /* switch 8 */ + update_ok_menu_item(entry); break; - case 0x53: /* switch 8 */ - case 0x54: /* switch 8 */ - case 0x55: /* switch 8 */ - case 0x56: /* switch 8 */ - func_800AB164(var_s1); - switch (D_8018EDEC) { /* switch 11; irregular */ - case 1: /* switch 11 */ - func_800AB020(var_s1); + case COURSE_SELECT_MUSHROOM_CUP: /* switch 8 */ + case COURSE_SELECT_FLOWER_CUP: /* switch 8 */ + case COURSE_SELECT_STAR_CUP: /* switch 8 */ + case COURSE_SELECT_SPECIAL_CUP: /* switch 8 */ + func_800AB164(entry); + switch (gSubMenuSelection) { /* switch 11; irregular */ + case SUB_MENU_MAP_SELECT_CUP: /* switch 11 */ + func_800AB020(entry); break; - case 2: /* switch 11 */ - case 3: /* switch 11 */ - func_800AB098(var_s1); + case SUB_MENU_MAP_SELECT_COURSE: /* switch 11 */ + case SUB_MENU_MAP_SELECT_OK: /* switch 11 */ + func_800AB098(entry); break; } break; - case 0x58: /* switch 8 */ - case 0x59: /* switch 8 */ - case 0x5A: /* switch 8 */ - case 0x5B: /* switch 8 */ - func_800AB260(var_s1); - break; - case 0x64: /* switch 8 */ - func_800AB314(var_s1); + case MENU_ITEM_TYPE_058: /* switch 8 */ + case COURSE_SELECT_COURSE_NAMES: /* switch 8 */ + case MENU_ITEM_TYPE_05A: /* switch 8 */ + case MENU_ITEM_TYPE_05B: /* switch 8 */ + func_800AB260(entry); break; - case 0x5F: /* switch 8 */ - case 0x60: /* switch 8 */ - case 0x61: /* switch 8 */ - case 0x62: /* switch 8 */ - func_800AB290(var_s1); + case MENU_ITEM_TYPE_064: /* switch 8 */ + func_800AB314(entry); break; - case 0x65: /* switch 8 */ - case 0x66: /* switch 8 */ - func_800AB904(var_s1); + case MENU_ITEM_TYPE_05F: /* switch 8 */ + case MENU_ITEM_TYPE_060: /* switch 8 */ + case MENU_ITEM_TYPE_061: /* switch 8 */ + case MENU_ITEM_TYPE_062: /* switch 8 */ + func_800AB290(entry); break; - case 0x67: /* switch 8 */ - func_800AB9B0(var_s1); + case MENU_ITEM_TYPE_065: /* switch 8 */ + case MENU_ITEM_TYPE_066: /* switch 8 */ + func_800AB904(entry); break; - case 0x78: /* switch 8 */ - case 0x79: /* switch 8 */ - case 0x7A: /* switch 8 */ - case 0x7B: /* switch 8 */ - case 0x8C: /* switch 8 */ - func_800ABAE8(var_s1); + case MENU_ITEM_TYPE_067: /* switch 8 */ + func_800AB9B0(entry); break; - case 0x8D: /* switch 8 */ - func_800ABB24(var_s1); + case MENU_ITEM_TYPE_078: /* switch 8 */ + case MENU_ITEM_TYPE_079: /* switch 8 */ + case MENU_ITEM_TYPE_07A: /* switch 8 */ + case MENU_ITEM_TYPE_07B: /* switch 8 */ + case MENU_ITEM_TYPE_08C: /* switch 8 */ + func_800ABAE8(entry); break; - case 0x7C: /* switch 8 */ - case 0x7D: /* switch 8 */ - case 0x7E: /* switch 8 */ - case 0x7F: /* switch 8 */ - case 0x80: /* switch 8 */ - case 0x81: /* switch 8 */ - case 0x82: /* switch 8 */ - case 0x83: /* switch 8 */ - case 0x84: /* switch 8 */ - case 0x85: /* switch 8 */ - case 0x86: /* switch 8 */ - case 0x87: /* switch 8 */ - case 0x88: /* switch 8 */ - case 0x89: /* switch 8 */ - case 0x8A: /* switch 8 */ - case 0x8B: /* switch 8 */ - func_800ABBCC(var_s1); - break; - case 0x96: /* switch 8 */ - func_800ABC38(var_s1); - break; - case 0x97: /* switch 8 */ - func_800ABEAC(var_s1); - break; - case 0x5E: /* switch 8 */ - func_800AC300(var_s1); - break; - case 0xAA: /* switch 8 */ - func_800AC324(var_s1); - break; - case 0xAB: /* switch 8 */ - func_800AC458(var_s1); - break; - case 0xAC: /* switch 8 */ - func_800ACA14(var_s1); - break; - case 0xAF: /* switch 8 */ - func_800AC978(var_s1); - break; - case 0xB0: /* switch 8 */ - func_800ACC50(var_s1); - break; - case 0xB1: /* switch 8 */ - case 0xB2: /* switch 8 */ - case 0xB3: /* switch 8 */ - case 0xB4: /* switch 8 */ - func_800ACF40(var_s1); - break; - case 0xB9: /* switch 8 */ - func_800AD1A4(var_s1); - break; - case 0xBA: /* switch 8 */ - func_800AD2E8(var_s1); - break; - case 0xBC: /* switch 8 */ - func_800AEC54(var_s1); - break; - case 0xC7: /* switch 8 */ - func_800ADF48(var_s1); - break; - case 0xBD: /* switch 8 */ - func_800AE218(var_s1); - break; - case 0xE6: /* switch 8 */ - func_800AEDBC(var_s1); - break; - case 0xE8: /* switch 8 */ - func_800AEE90(var_s1); - break; - case 0xE9: /* switch 8 */ - func_800AEEBC(var_s1); - break; - case 0xEA: /* switch 8 */ - func_800AEEE8(var_s1); - break; - case 0xBE: /* switch 8 */ - func_800AEF14(var_s1); - break; - case 0x10E: /* switch 8 */ - func_800AEF74(var_s1); - break; - case 0x12B: /* switch 8 */ - func_800AF004(var_s1); - break; - case 0x12C: /* switch 8 */ - case 0x12D: /* switch 8 */ - case 0x12E: /* switch 8 */ - case 0x12F: /* switch 8 */ - func_800AF1AC(var_s1); - break; - case 0x130: /* switch 8 */ - func_800AF270(var_s1); - break; - case 0x190: /* switch 8 */ - case 0x191: /* switch 8 */ - case 0x192: /* switch 8 */ - case 0x193: /* switch 8 */ - case 0x194: /* switch 8 */ - case 0x195: /* switch 8 */ - case 0x196: /* switch 8 */ - case 0x197: /* switch 8 */ - case 0x198: /* switch 8 */ - case 0x199: /* switch 8 */ - case 0x19A: /* switch 8 */ - case 0x19B: /* switch 8 */ - case 0x19C: /* switch 8 */ - case 0x19D: /* switch 8 */ - case 0x19E: /* switch 8 */ - case 0x19F: /* switch 8 */ - case 0x1A0: /* switch 8 */ - case 0x1A1: /* switch 8 */ - case 0x1A2: /* switch 8 */ - case 0x1A3: /* switch 8 */ - case 0x1A4: /* switch 8 */ - case 0x1A5: /* switch 8 */ - case 0x1A6: /* switch 8 */ - case 0x1A7: /* switch 8 */ - case 0x1A8: /* switch 8 */ - case 0x1A9: /* switch 8 */ - case 0x1AA: /* switch 8 */ - case 0x1AB: /* switch 8 */ - case 0x1AC: /* switch 8 */ - case 0x1AD: /* switch 8 */ - case 0x1AE: /* switch 8 */ - case 0x1AF: /* switch 8 */ - case 0x1B0: /* switch 8 */ - case 0x1B1: /* switch 8 */ - case 0x1B2: /* switch 8 */ - case 0x1B3: /* switch 8 */ - case 0x1B4: /* switch 8 */ - case 0x1B5: /* switch 8 */ - case 0x1B6: /* switch 8 */ - case 0x1B7: /* switch 8 */ - case 0x1B8: /* switch 8 */ - case 0x1B9: /* switch 8 */ - case 0x1BA: /* switch 8 */ - case 0x1BB: /* switch 8 */ - case 0x1BC: /* switch 8 */ - case 0x1BD: /* switch 8 */ - case 0x1BE: /* switch 8 */ - case 0x1BF: /* switch 8 */ - case 0x1C0: /* switch 8 */ - case 0x1C1: /* switch 8 */ - case 0x1C2: /* switch 8 */ - case 0x1C3: /* switch 8 */ - case 0x1C4: /* switch 8 */ - case 0x1C5: /* switch 8 */ - case 0x1C6: /* switch 8 */ - case 0x1C7: /* switch 8 */ - case 0x1C8: /* switch 8 */ - case 0x1C9: /* switch 8 */ - case 0x1CA: /* switch 8 */ - case 0x1CB: /* switch 8 */ - case 0x1CC: /* switch 8 */ - case 0x1CD: /* switch 8 */ - case 0x1CE: /* switch 8 */ - func_800AF480(var_s1); + case MENU_ITEM_TYPE_08D: /* switch 8 */ + func_800ABB24(entry); break; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - } - - for (var_s0 = 0; var_s0 < 0x10; var_s0++) { - for (var_v1_2 = 0; var_v1_2 < D_8018D9E0_SIZE; var_v1_2++) { - var_v1 = 0; - var_s1 = &D_8018D9E0[var_v1_2]; - if (var_s1 && var_s1) {} // ? - type = var_s1->type; - if ((type == 4) || (type == 5) || (type == 0x000000C7)) { - if (arg0 != 0) { - var_v1 = 1; - } - } else if (arg0 == 0) { - var_v1 = 1; - } - if ((var_v1 != 0) && (var_s0 == (s8) var_s1->priority)) { - func_8009F5E0(var_s1); - } - } - } -} - -void func_800A8230(void) { - func_800A7A4C(0); -} - -void func_800A8250(void) { - func_800A7A4C(1); -} - -void func_800A8270(s32 arg0, struct_8018D9E0_entry* arg1) { + case MENU_ITEM_TYPE_07C: /* switch 8 */ + case MENU_ITEM_TYPE_07D: /* switch 8 */ + case MENU_ITEM_TYPE_07E: /* switch 8 */ + case MENU_ITEM_TYPE_07F: /* switch 8 */ + case MENU_ITEM_TYPE_080: /* switch 8 */ + case MENU_ITEM_TYPE_081: /* switch 8 */ + case MENU_ITEM_TYPE_082: /* switch 8 */ + case MENU_ITEM_TYPE_083: /* switch 8 */ + case MENU_ITEM_TYPE_084: /* switch 8 */ + case MENU_ITEM_TYPE_085: /* switch 8 */ + case MENU_ITEM_TYPE_086: /* switch 8 */ + case MENU_ITEM_TYPE_087: /* switch 8 */ + case MENU_ITEM_TYPE_088: /* switch 8 */ + case MENU_ITEM_TYPE_089: /* switch 8 */ + case MENU_ITEM_TYPE_08A: /* switch 8 */ + case MENU_ITEM_TYPE_08B: /* switch 8 */ + func_800ABBCC(entry); + break; + case MENU_ITEM_TYPE_096: /* switch 8 */ + func_800ABC38(entry); + break; + case MENU_ITEM_TYPE_097: /* switch 8 */ + func_800ABEAC(entry); + break; + case MENU_ITEM_TYPE_05E: /* switch 8 */ + func_800AC300(entry); + break; + case MENU_ITEM_TYPE_0AA: /* switch 8 */ + func_800AC324(entry); + break; + case MENU_ITEM_TYPE_0AB: /* switch 8 */ + func_800AC458(entry); + break; + case MENU_ITEM_TYPE_0AC: /* switch 8 */ + func_800ACA14(entry); + break; + case MENU_ITEM_TYPE_0AF: /* switch 8 */ + func_800AC978(entry); + break; + case MENU_ITEM_TYPE_0B0: /* switch 8 */ + func_800ACC50(entry); + break; + case MENU_ITEM_TYPE_0B1: /* switch 8 */ + case MENU_ITEM_TYPE_0B2: /* switch 8 */ + case MENU_ITEM_TYPE_0B3: /* switch 8 */ + case MENU_ITEM_TYPE_0B4: /* switch 8 */ + func_800ACF40(entry); + break; + case MENU_ITEM_TYPE_0B9: /* switch 8 */ + func_800AD1A4(entry); + break; + case MENU_ITEM_TYPE_0BA: /* switch 8 */ + func_800AD2E8(entry); + break; + case MENU_ITEM_ANNOUNCE_GHOST: /* switch 8 */ + func_800AEC54(entry); + break; + case MENU_ITEM_PAUSE: /* switch 8 */ + func_800ADF48(entry); + break; + case MENU_ITEM_END_COURSE_OPTION: /* switch 8 */ + func_800AE218(entry); + break; + case MENU_ITEM_DATA_COURSE_IMAGE: /* switch 8 */ + func_800AEDBC(entry); + break; + case MENU_ITEM_DATA_COURSE_SELECTABLE: /* switch 8 */ + func_800AEE90(entry); + break; + case MENU_ITEM_TYPE_0E9: /* switch 8 */ + func_800AEEBC(entry); + break; + case MENU_ITEM_TYPE_0EA: /* switch 8 */ + func_800AEEE8(entry); + break; + case MENU_ITEM_TYPE_0BE: /* switch 8 */ + func_800AEF14(entry); + break; + case MENU_ITEM_TYPE_10E: /* switch 8 */ + func_800AEF74(entry); + break; + case MENU_ITEM_TYPE_12B: /* switch 8 */ + func_800AF004(entry); + break; + case MENU_ITEM_TYPE_12C: /* switch 8 */ + case MENU_ITEM_TYPE_12D: /* switch 8 */ + case MENU_ITEM_TYPE_12E: /* switch 8 */ + case MENU_ITEM_TYPE_12F: /* switch 8 */ + func_800AF1AC(entry); + break; + case MENU_ITEM_TYPE_130: /* switch 8 */ + func_800AF270(entry); + break; + case MENU_ITEM_TYPE_190: /* switch 8 */ + case MENU_ITEM_TYPE_191: /* switch 8 */ + case MENU_ITEM_TYPE_192: /* switch 8 */ + case MENU_ITEM_TYPE_193: /* switch 8 */ + case MENU_ITEM_TYPE_194: /* switch 8 */ + case MENU_ITEM_TYPE_195: /* switch 8 */ + case MENU_ITEM_TYPE_196: /* switch 8 */ + case MENU_ITEM_TYPE_197: /* switch 8 */ + case MENU_ITEM_TYPE_198: /* switch 8 */ + case MENU_ITEM_TYPE_199: /* switch 8 */ + case MENU_ITEM_TYPE_19A: /* switch 8 */ + case MENU_ITEM_TYPE_19B: /* switch 8 */ + case MENU_ITEM_TYPE_19C: /* switch 8 */ + case MENU_ITEM_TYPE_19D: /* switch 8 */ + case MENU_ITEM_TYPE_19E: /* switch 8 */ + case MENU_ITEM_TYPE_19F: /* switch 8 */ + case MENU_ITEM_TYPE_1A0: /* switch 8 */ + case MENU_ITEM_TYPE_1A1: /* switch 8 */ + case MENU_ITEM_TYPE_1A2: /* switch 8 */ + case MENU_ITEM_TYPE_1A3: /* switch 8 */ + case MENU_ITEM_TYPE_1A4: /* switch 8 */ + case MENU_ITEM_TYPE_1A5: /* switch 8 */ + case MENU_ITEM_TYPE_1A6: /* switch 8 */ + case MENU_ITEM_TYPE_1A7: /* switch 8 */ + case MENU_ITEM_TYPE_1A8: /* switch 8 */ + case MENU_ITEM_TYPE_1A9: /* switch 8 */ + case MENU_ITEM_TYPE_1AA: /* switch 8 */ + case MENU_ITEM_TYPE_1AB: /* switch 8 */ + case MENU_ITEM_TYPE_1AC: /* switch 8 */ + case MENU_ITEM_TYPE_1AD: /* switch 8 */ + case MENU_ITEM_TYPE_1AE: /* switch 8 */ + case MENU_ITEM_TYPE_1AF: /* switch 8 */ + case MENU_ITEM_TYPE_1B0: /* switch 8 */ + case MENU_ITEM_TYPE_1B1: /* switch 8 */ + case MENU_ITEM_TYPE_1B2: /* switch 8 */ + case MENU_ITEM_TYPE_1B3: /* switch 8 */ + case MENU_ITEM_TYPE_1B4: /* switch 8 */ + case MENU_ITEM_TYPE_1B5: /* switch 8 */ + case MENU_ITEM_TYPE_1B6: /* switch 8 */ + case MENU_ITEM_TYPE_1B7: /* switch 8 */ + case MENU_ITEM_TYPE_1B8: /* switch 8 */ + case MENU_ITEM_TYPE_1B9: /* switch 8 */ + case MENU_ITEM_TYPE_1BA: /* switch 8 */ + case MENU_ITEM_TYPE_1BB: /* switch 8 */ + case MENU_ITEM_TYPE_1BC: /* switch 8 */ + case MENU_ITEM_TYPE_1BD: /* switch 8 */ + case MENU_ITEM_TYPE_1BE: /* switch 8 */ + case MENU_ITEM_TYPE_1BF: /* switch 8 */ + case MENU_ITEM_TYPE_1C0: /* switch 8 */ + case MENU_ITEM_TYPE_1C1: /* switch 8 */ + case MENU_ITEM_TYPE_1C2: /* switch 8 */ + case MENU_ITEM_TYPE_1C3: /* switch 8 */ + case MENU_ITEM_TYPE_1C4: /* switch 8 */ + case MENU_ITEM_TYPE_1C5: /* switch 8 */ + case MENU_ITEM_TYPE_1C6: /* switch 8 */ + case MENU_ITEM_TYPE_1C7: /* switch 8 */ + case MENU_ITEM_TYPE_1C8: /* switch 8 */ + case MENU_ITEM_TYPE_1C9: /* switch 8 */ + case MENU_ITEM_TYPE_1CA: /* switch 8 */ + case MENU_ITEM_TYPE_1CB: /* switch 8 */ + case MENU_ITEM_TYPE_1CC: /* switch 8 */ + case MENU_ITEM_TYPE_1CD: /* switch 8 */ + case MENU_ITEM_TYPE_1CE: /* switch 8 */ + func_800AF480(entry); + break; + case MENU_ITEM_UI_NONE: + case MENU_ITEM_UI_START_BACKGROUND: + case MENU_ITEM_UI_LOGO_AND_COPYRIGHT: + case MENU_ITEM_UI_PUSH_START_BUTTON: + case MENU_ITEM_UI_NO_CONTROLLER: + break; + } + } + + for (j = 0; j < MENU_ITEM_PRIORITY_MAX; j++) { + for (i = 0; i < ARRAY_COUNT(gMenuItems); i++) { + isRendered = false; + entry = &gMenuItems[i]; + if (entry && entry) {} // ? + type = entry->type; + if ((type == MENU_ITEM_UI_NO_CONTROLLER) || (type == MENU_ITEM_UI_START_RECORD_TIME) || + (type == MENU_ITEM_PAUSE)) { + if (priSpecial != 0) { + isRendered = true; + } + } else if (priSpecial == 0) { + isRendered = true; + } + if ((isRendered != 0) && (j == (s8) entry->priority)) { + render_menus(entry); + } + } + } +} + +void handle_menus_default(void) { + handle_menus_with_pri_arg(0); +} + +void handle_menus_special(void) { + handle_menus_with_pri_arg(1); +} + +void func_800A8270(s32 arg0, MenuItem* arg1) { s32 temp_t1; s32 temp_t6; s32 var_s0; @@ -8843,8 +8921,8 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry* arg1) { s32 var_s3; s32 var_s4; - if (arg1->unk1C < 0x20) { - temp_t6 = (arg1->unk1C << 6) / 64; + if (arg1->param1 < 0x20) { + temp_t6 = (arg1->param1 << 6) / 64; temp_t1 = arg1->column; var_s0 = arg1->row; var_s3 = temp_t1 + temp_t6; @@ -8853,8 +8931,8 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry* arg1) { gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); if ((arg0 + 1) == gPlayerCount) { - if ((gMainMenuSelectionDepth == OPTIONS_SELECTION) || (gMainMenuSelectionDepth == DATA_SELECTION) || - (gMainMenuSelectionDepth == PLAYER_NUM_SELECTION)) { + if ((gMainMenuSelection == MAIN_MENU_OPTION) || (gMainMenuSelection == MAIN_MENU_DATA) || + (gMainMenuSelection == MAIN_MENU_PLAYER_SELECT)) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x35); } else { gDisplayListHead = draw_box_fill(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x35, 0x000000FF, @@ -8864,8 +8942,9 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry* arg1) { gDisplayListHead = func_80098FC8(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x35); } for (var_s0 += 0x41, var_s2 = 0; var_s2 <= gPlayerModeSelection[arg0]; var_s2++, var_s0 += 0x12) { - if ((var_s2 == D_800E86AC[arg0]) && ((arg0 + 1) == gPlayerCount) && (gMainMenuSelectionDepth >= 4)) { - if (gMainMenuSelectionDepth == GAME_MODE_SELECTION) { + if ((var_s2 == gGameModeMenuColumn[arg0]) && ((arg0 + 1) == gPlayerCount) && + (gMainMenuSelection > MAIN_MENU_PLAYER_SELECT)) { + if (gMainMenuSelection == MAIN_MENU_MODE_SELECT) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x11); } else { @@ -8880,10 +8959,10 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry* arg1) { } } -void func_800A8564(struct_8018D9E0_entry* arg0) { +void func_800A8564(MenuItem* arg0) { s32 sp34; s32 var_a1; - MkTexture* var_a0; + MenuTexture* var_a0; s32 temp_a2; s32 temp_t0; @@ -8891,28 +8970,28 @@ void func_800A8564(struct_8018D9E0_entry* arg0) { switch (arg0->type) { /* irregular */ case 0xF: var_a0 = D_0200487C; - if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION) || - (gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT)) { + if ((gMainMenuSelection == MAIN_MENU_OK_SELECT) || (gMainMenuSelection == MAIN_MENU_OK_SELECT_GO_BACK)) { var_a1 = 1; } break; case 0x33: var_a0 = D_02004B74; - if ((D_8018EDEE == 2) || (D_8018EDEE == 3)) { + if ((gPlayerSelectMenuSelection == PLAYER_SELECT_MENU_OK) || + (gPlayerSelectMenuSelection == PLAYER_SELECT_MENU_OK_GO_BACK)) { var_a1 = 1; } break; case 0x5D: var_a0 = D_02004E80; - if (D_8018EDEC == 3) { + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_OK) { var_a1 = 1; } break; default: return; } - if (arg0->unk1C < 0x20) { - sp34 = (arg0->unk1C << 5) / 64; + if (arg0->param1 < 0x20) { + sp34 = (arg0->param1 << 5) / 64; var_a0 = segmented_to_virtual_dupe(var_a0); temp_t0 = arg0->column + var_a0->dX; temp_a2 = arg0->row + var_a0->dY; @@ -8926,50 +9005,50 @@ void func_800A8564(struct_8018D9E0_entry* arg0) { } } -void func_800A86E8(struct_8018D9E0_entry* arg0) { +void func_800A86E8(MenuItem* arg0) { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x64, arg0->row + 0x27, 1, 1, 1, 0xFF); } // Credit for the use of ternary operators goes to LLONSIT -void func_800A874C(struct_8018D9E0_entry* arg0) { +void func_800A874C(MenuItem* arg0) { UNUSED s32 stackPadding0; - char sp58[3]; + char buffer[3]; UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; s32 temp_s1; UNUSED u32 var_v0; u32 var_s2; - set_text_color(1); - var_s2 = arg0->type == 0x00000065 ? func_800B4E24(0) : func_800B4F2C(); + set_text_color(TEXT_GREEN); + var_s2 = arg0->type == MENU_ITEM_TYPE_065 ? func_800B4E24(0) : func_800B4F2C(); temp_s1 = var_s2 & 0xFFFFF; - get_time_record_minutes((temp_s1 ^ 0), sp58); - text_draw(arg0->column + 5, arg0->row + 0x21, sp58, 0, 0.6f, 0.65f); - func_80093324(arg0->column + 0xE, arg0->row + 0x21, "'", 0, 0.6f, 0.65f); - get_time_record_seconds(temp_s1, sp58); - text_draw(arg0->column + 0x16, arg0->row + 0x21, sp58, 0, 0.6f, 0.65f); - func_80093324(arg0->column + 0x20, arg0->row + 0x21, "\"", 0, 0.6f, 0.65f); - get_time_record_centiseconds(temp_s1, sp58); - text_draw(arg0->column + 0x29, arg0->row + 0x21, sp58, 0, 0.6f, 0.65f); + get_time_record_minutes((temp_s1 ^ 0), buffer); + text_draw(arg0->column + 5, arg0->row + 0x21, buffer, 0, 0.6f, 0.65f); + print_text_mode_1(arg0->column + 0xE, arg0->row + 0x21, "'", 0, 0.6f, 0.65f); + get_time_record_seconds(temp_s1, buffer); + text_draw(arg0->column + 0x16, arg0->row + 0x21, buffer, 0, 0.6f, 0.65f); + print_text_mode_1(arg0->column + 0x20, arg0->row + 0x21, "\"", 0, 0.6f, 0.65f); + get_time_record_centiseconds(temp_s1, buffer); + text_draw(arg0->column + 0x29, arg0->row + 0x21, buffer, 0, 0.6f, 0.65f); var_s2 = (u32) temp_s1 < 0x927C0U ? var_s2 >> 0x14 : 8; - func_800936B8(arg0->column + 0x60, arg0->row + 0x21, D_800E76A8[var_s2], 0, 0.6f, 0.65f); + print_text1_left(arg0->column + 0x60, arg0->row + 0x21, D_800E76A8[var_s2], 0, 0.6f, 0.65f); } -void func_800A890C(s32 arg0, struct_8018D9E0_entry* arg1) { +void func_800A890C(s32 arg0, MenuItem* arg1) { s32 temp_a2; s32 temp_t1; s32 temp_t7; - if (arg1->unk1C < 32) { + if (arg1->param1 < 32) { if (1) {} - temp_t7 = (arg1->unk1C * 65) / 64; + temp_t7 = (arg1->param1 * 65) / 64; temp_t1 = arg1->column; temp_a2 = arg1->row; gDPPipeSync(gDisplayListHead++); gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); if (arg0 == gCupSelection) { - if (D_8018EDEC == 1) { + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_CUP) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, temp_t1 + temp_t7, temp_a2, (temp_t1 - temp_t7) + 64, temp_a2 + 39); } else { @@ -8983,7 +9062,7 @@ void func_800A890C(s32 arg0, struct_8018D9E0_entry* arg1) { } } -void func_800A8A98(struct_8018D9E0_entry* arg0) { +void func_800A8A98(MenuItem* arg0) { s32 temp_s2; s32 temp_s3; s32 someIndex; @@ -8994,8 +9073,10 @@ void func_800A8A98(struct_8018D9E0_entry* arg0) { gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); for (someIndex = 0; someIndex < NUM_COURSES_PER_CUP; someIndex++) { - if ((someIndex == gCourseIndexInCup) && (D_8018EDEC >= 2) && (gModeSelection != GRAND_PRIX)) { - if ((D_8018EDEC == 2) || (D_8018EDEC == 4)) { + if ((someIndex == gCourseIndexInCup) && (gSubMenuSelection > SUB_MENU_MAP_SELECT_CUP) && + (gModeSelection != GRAND_PRIX)) { + if ((gSubMenuSelection == SUB_MENU_MAP_SELECT_COURSE) || + (gSubMenuSelection == SUB_MENU_MAP_SELECT_BATTLE_COURSE)) { gDisplayListHead = draw_flash_select_case_slow( gDisplayListHead, D_800E7208[someIndex][0].column + temp_s2, D_800E7208[someIndex][0].row + temp_s3, D_800E7208[someIndex][1].column + temp_s2, D_800E7208[someIndex][1].row + temp_s3); @@ -9013,23 +9094,23 @@ void func_800A8A98(struct_8018D9E0_entry* arg0) { } } -void func_800A8CA4(struct_8018D9E0_entry* arg0) { +void func_800A8CA4(MenuItem* arg0) { s32 temp_s2; s32 temp_s3; s32 var_s0; - struct_8018D9E0_entry* temp_v0; + MenuItem* temp_v0; - temp_v0 = find_8018D9E0_entry_dupe(0x00000064); + temp_v0 = find_menu_items_dupe(MENU_ITEM_TYPE_064); temp_s2 = arg0->column; temp_s3 = arg0->row; gDPPipeSync(gDisplayListHead++); gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); if (gModeSelection == GRAND_PRIX) { - if (D_8018EDEC != 3) { + if (gSubMenuSelection != SUB_MENU_MAP_SELECT_OK) { for (var_s0 = 0; var_s0 < 4; var_s0++) { // Wut? - if ((var_s0 != (temp_v0->unk1C % 4)) != 0) { + if ((var_s0 != (temp_v0->param1 % 4)) != 0) { gDisplayListHead = draw_box(gDisplayListHead, D_800E7208[var_s0][0].column + temp_s2, D_800E7208[var_s0][0].row + temp_s3, D_800E7208[var_s0][1].column + temp_s2, @@ -9040,22 +9121,22 @@ void func_800A8CA4(struct_8018D9E0_entry* arg0) { } } -void func_800A8E14(UNUSED struct_8018D9E0_entry* arg0) { +void render_battle_introduction(UNUSED MenuItem* arg0) { set_text_color(TEXT_YELLOW); - draw_text(0x98, 0x44, D_800E77A8[0], 0, 1.0f, 1.0f); - func_80093324(0x17, 0x58, D_800E77A8[1], 0, 0.7f, 0.8f); - func_80093324(0x17, 0x6A, D_800E77A8[2], 0, 0.7f, 0.8f); + print_text1_center_mode_1(0x98, 0x44, gTextBattleIntroduction[0], 0, 1.0f, 1.0f); + print_text_mode_1(0x17, 0x58, gTextBattleIntroduction[1], 0, 0.7f, 0.8f); + print_text_mode_1(0x17, 0x6A, gTextBattleIntroduction[2], 0, 0.7f, 0.8f); } -void func_800A8EC0(struct_8018D9E0_entry* arg0) { - if (arg0->unk20 != 0) { +void func_800A8EC0(MenuItem* arg0) { + if (arg0->param2 != 0) { func_8009A76C(arg0->D_8018DEE0_index, arg0->column, arg0->row, -1); set_text_color(TEXT_YELLOW); - func_80093324(arg0->column + 0x20, arg0->row + 0x28, D_800E7678[arg0->unk20], 0, 0.7f, 0.7f); + print_text_mode_1(arg0->column + 0x20, arg0->row + 0x28, gCupText[arg0->param2], 0, 0.7f, 0.7f); } } -void func_800A8F48(UNUSED struct_8018D9E0_entry* arg0) { +void func_800A8F48(UNUSED MenuItem* arg0) { UNUSED Gfx* temp_v0_2; Unk_D_800E70A0* temp_v0; s16 temp_s0; @@ -9063,8 +9144,8 @@ void func_800A8F48(UNUSED struct_8018D9E0_entry* arg0) { s32 temp_s2; s32 var_s1; - switch (D_8018EDEC) { /* irregular */ - case 1: + switch (gSubMenuSelection) { /* irregular */ + case SUB_MENU_MAP_SELECT_CUP: for (var_s1 = 0; var_s1 < 4; var_s1++) { if (func_800B639C((gCupSelection * 4) + var_s1) >= 0) { temp_v0 = &D_800E7168[var_s1]; @@ -9078,24 +9159,24 @@ void func_800A8F48(UNUSED struct_8018D9E0_entry* arg0) { } } break; - case 2: + case SUB_MENU_MAP_SELECT_COURSE: default: if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) >= 0) { gDisplayListHead = func_80098FC8(gDisplayListHead, 0x00000057, 0x00000070, 0x00000096, 0x00000081); - gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004A0C, 0x00000057, 0x00000070); + gDisplayListHead = render_menu_textures(gDisplayListHead, D_02004A0C, 0x00000057, 0x00000070); } break; } } -void func_800A90D4(UNUSED s32 arg0, struct_8018D9E0_entry* arg1) { +void func_800A90D4(UNUSED s32 arg0, MenuItem* arg1) { s32 temp_a2; s32 temp_t1; s32 temp_t7; - if (arg1->unk1C < 0x20) { + if (arg1->param1 < 0x20) { if (1) {} - temp_t7 = (arg1->unk1C * 0x41) / 0x40; + temp_t7 = (arg1->param1 * 0x41) / 0x40; temp_t1 = arg1->column; temp_a2 = arg1->row; gDPPipeSync(gDisplayListHead++); @@ -9106,12 +9187,12 @@ void func_800A90D4(UNUSED s32 arg0, struct_8018D9E0_entry* arg1) { } } -void func_800A91D8(struct_8018D9E0_entry* arg0, s32 columnTarget, s32 rowTarget) { +void func_800A91D8(MenuItem* arg0, s32 columnTarget, s32 rowTarget) { func_800A9208(arg0, columnTarget); func_800A9278(arg0, rowTarget); } -void func_800A9208(struct_8018D9E0_entry* arg0, s32 columnTarget) { +void func_800A9208(MenuItem* arg0, s32 columnTarget) { s32 step = columnTarget - arg0->column; if (step != 0) { @@ -9130,7 +9211,7 @@ void func_800A9208(struct_8018D9E0_entry* arg0, s32 columnTarget) { arg0->column += step; } -void func_800A9278(struct_8018D9E0_entry* arg0, s32 rowTarget) { +void func_800A9278(MenuItem* arg0, s32 rowTarget) { s32 step = rowTarget - arg0->row; if (step != 0) { @@ -9149,7 +9230,7 @@ void func_800A9278(struct_8018D9E0_entry* arg0, s32 rowTarget) { arg0->row += step; } -void func_800A92E8(struct_8018D9E0_entry* arg0, s32 columnTarget) { +void func_800A92E8(MenuItem* arg0, s32 columnTarget) { s32 step = columnTarget - arg0->column; if (step != 0) { @@ -9182,7 +9263,7 @@ void func_800A92E8(struct_8018D9E0_entry* arg0, s32 columnTarget) { } // Appears to be a copy of func_800A9278 -UNUSED void func_800A939C(struct_8018D9E0_entry* arg0, s32 rowTarget) { +UNUSED void func_800A939C(MenuItem* arg0, s32 rowTarget) { s32 step = rowTarget - arg0->row; if (step != 0) { @@ -9201,7 +9282,7 @@ UNUSED void func_800A939C(struct_8018D9E0_entry* arg0, s32 rowTarget) { arg0->row += step; } -void func_800A940C(struct_8018D9E0_entry* arg0, s32 columnTarget) { +void func_800A940C(MenuItem* arg0, s32 columnTarget) { s32 step = columnTarget - arg0->column; if (step != 0) { @@ -9232,7 +9313,7 @@ void func_800A940C(struct_8018D9E0_entry* arg0, s32 columnTarget) { } } -void func_800A94C8(struct_8018D9E0_entry* arg0, s32 columnTarget, s32 arg2) { +void func_800A94C8(MenuItem* arg0, s32 columnTarget, s32 arg2) { s32 step; if (columnTarget == arg0->column) { @@ -9256,24 +9337,24 @@ void func_800A94C8(struct_8018D9E0_entry* arg0, s32 columnTarget, s32 arg2) { } } -void func_800A954C(struct_8018D9E0_entry* arg0) { +void func_800A954C(MenuItem* arg0) { // Cycle lasts 26 (0x1A) frames - if (arg0->cursor == 0) { + if (arg0->state == 0) { // Move highlight from yellow to red - arg0->unk20 = (s32) (u32) ((((f32) (0xC - arg0->unk1C) * 127.0f) / 12.0f) + 128.0f); + arg0->param2 = (s32) (u32) ((((f32) (0xC - arg0->param1) * 127.0f) / 12.0f) + 128.0f); } else { // Move highlight from red to yellow - arg0->unk20 = (s32) (u32) ((((f64) (f32) arg0->unk1C * 127.0) / 12.0) + 128.0); + arg0->param2 = (s32) (u32) ((((f64) (f32) arg0->param1 * 127.0) / 12.0) + 128.0); } - arg0->unk1C++; - if (arg0->unk1C >= 0xC) { + arg0->param1++; + if (arg0->param1 >= 0xC) { // Every 13 (0xC) frames reverse direction - arg0->unk1C = 0; - arg0->cursor ^= 1; + arg0->param1 = 0; + arg0->state ^= 1; } } -void func_800A9710(struct_8018D9E0_entry* arg0) { +void func_800A9710(MenuItem* arg0) { s32 phi_v0; switch (gControllerPakMenuSelection) { @@ -9298,134 +9379,138 @@ void func_800A9710(struct_8018D9E0_entry* arg0) { phi_v0 = 0; break; } - if (phi_v0 != arg0->cursor) { - arg0->cursor = phi_v0; + if (phi_v0 != arg0->state) { + arg0->state = phi_v0; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E7D34[phi_v0])); } } -void func_800A97BC(struct_8018D9E0_entry* arg0) { +void func_800A97BC(MenuItem* arg0) { s32 i; - switch (*D_800E86D0) { - case 1: + switch (gControllerPakScrollDirection) { + case CONTROLLER_PAK_SCROLL_DIR_DOWN: arg0->row -= 2; if (arg0->row < 0x60) { arg0->row = 0x69; - *D_800E86D0 = 0; + gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_NONE; for (i = 0; i < 8; i++) { if (i < 7) { - D_800E86C4[i] = D_800E86C4[i + 1]; + gControllerPakVisibleTableRows[i] = gControllerPakVisibleTableRows[i + 1]; } else { - if ((D_800E86C4[i - 1] == 0x10) || (D_800E86C4[i - 1] == 0)) { - D_800E86C4[i] = 0; + if ((gControllerPakVisibleTableRows[i - 1] == 0x10) || + (gControllerPakVisibleTableRows[i - 1] == 0)) { + gControllerPakVisibleTableRows[i] = 0; } else { - D_800E86C4[i] = D_800E86C4[i - 1] + 1; + gControllerPakVisibleTableRows[i] = gControllerPakVisibleTableRows[i - 1] + 1; } } } - D_800E86C4[0] = D_800E86C4[8] = 0; + gControllerPakVisibleTableRows[0] = gControllerPakVisibleTableRows[8] = 0; } break; - case 2: + case CONTROLLER_PAK_SCROLL_DIR_UP: arg0->row += 2; if (arg0->row >= 0x73) { arg0->row = 0x69; - *D_800E86D0 = 0; + gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_NONE; for (i = 8; i > 0; i--) { if (i > 1) { - D_800E86C4[i] = D_800E86C4[i - 1]; + gControllerPakVisibleTableRows[i] = gControllerPakVisibleTableRows[i - 1]; } else { - if ((D_800E86C4[i + 1] == 1) || (D_800E86C4[i + 1] == 0)) { - D_800E86C4[i] = 0; + if ((gControllerPakVisibleTableRows[i + 1] == 1) || + (gControllerPakVisibleTableRows[i + 1] == 0)) { + gControllerPakVisibleTableRows[i] = 0; } else { - D_800E86C4[i] = D_800E86C4[i + 1] - 1; + gControllerPakVisibleTableRows[i] = gControllerPakVisibleTableRows[i + 1] - 1; } } } - D_800E86C4[0] = D_800E86C4[8] = 0; + gControllerPakVisibleTableRows[0] = gControllerPakVisibleTableRows[8] = 0; break; default: - *D_800E86D0 = 0; + gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_NONE; break; } } } // todo: <-- fix these brackets -// Don't know if this belongs here or inside func_800A9A98 +// Don't know if this belongs here or inside update_ok_menu_item // as a `static const`. But this matches so we'll leave // it here for now. -const s8 D_800F0CA0[] = { - 0x03, 0x03, 0x03, 0x02, 0x00, 0x02, 0x02, 0x01, 0x03, 0x02, 0x00, 0x00, 0x03, 0x03, 0x02, 0x00 -}; +const s8 D_800F0CA0[] = { 0x03, 0x03, 0x03, 0x02, 0x00, 0x02, 0x02, 0x01 }; + +const s8 D_800F0CA8[] = { 0x03, 0x02, 0x00 }; -void func_800A9A98(struct_8018D9E0_entry* arg0) { +const s8 D_800F0CAC[] = { 0x03, 0x03, 0x02 }; + +void update_ok_menu_item(MenuItem* arg0) { s32 sp4; s32 var_v0; - switch (arg0->type) { /* irregular */ + switch (arg0->type) { default: var_v0 = sp4; // wut? break; - case 0xF: - var_v0 = D_800F0CA0[gMainMenuSelectionDepth - 1]; + case MENU_ITEM_UI_OK: + var_v0 = D_800F0CA0[gMainMenuSelection - 1]; break; - case 0x5D: - var_v0 = D_800F0CA0[D_8018EDEC + 11]; + case COURSE_SELECT_OK: + var_v0 = D_800F0CAC[gSubMenuSelection - 1]; break; - case 0x33: - var_v0 = D_800F0CA0[D_8018EDEE + 7]; + case CHARACTER_SELECT_MENU_OK: + var_v0 = D_800F0CA8[gPlayerSelectMenuSelection - 1]; break; } - switch (var_v0) { /* switch 1; irregular */ - case 0: /* switch 1 */ - arg0->unk1C = 0; + switch (var_v0) { + case 0: + arg0->param1 = 0; break; - case 1: /* switch 1 */ - arg0->unk1C = 0x00000020; + case 1: + arg0->param1 = 0x00000020; break; - case 2: /* switch 1 */ - if (arg0->unk1C > 0) { - arg0->unk1C = (arg0->unk1C - (arg0->unk1C / 12)) - 2; - if (arg0->unk1C < 0) { - arg0->unk1C = 0; + case 2: + if (arg0->param1 > 0) { + arg0->param1 = (arg0->param1 - (arg0->param1 / 12)) - 2; + if (arg0->param1 < 0) { + arg0->param1 = 0; } } break; - case 3: /* switch 1 */ - if (arg0->unk1C < 0x20) { - arg0->unk1C += 2; - if (arg0->unk1C >= 0x20) { - arg0->unk1C = 0x00000020; + case 3: + if (arg0->param1 < 0x20) { + arg0->param1 += 2; + if (arg0->param1 >= 0x20) { + arg0->param1 = 0x00000020; } } break; } } -void func_800A9B9C(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800A9B9C(MenuItem* arg0) { + switch (arg0->state) { case 0: func_800AA280(arg0); break; case 1: func_800AA280(arg0); - arg0->cursor = 4; + arg0->state = 4; /* fallthrough */ case 4: - if (arg0->unk1C > 0) { - arg0->unk1C = (arg0->unk1C - (arg0->unk1C / 12)) - 2; - if (arg0->unk1C < 0) { - arg0->unk1C = 0; + if (arg0->param1 > 0) { + arg0->param1 = (arg0->param1 - (arg0->param1 / 12)) - 2; + if (arg0->param1 < 0) { + arg0->param1 = 0; } } else { - arg0->unk1C = 0; - arg0->cursor = 0; + arg0->param1 = 0; + arg0->state = 0; } break; case 2: - arg0->cursor = 3; + arg0->state = 3; break; case 3: default: @@ -9433,40 +9518,40 @@ void func_800A9B9C(struct_8018D9E0_entry* arg0) { } } -void func_800A9C40(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800A9C40(MenuItem* arg0) { + switch (arg0->state) { case 0: func_800AA280(arg0); if ((gPlayerCount + 0xA) == arg0->type) { - arg0->cursor = 2; + arg0->state = 2; } else { - arg0->cursor = 1; + arg0->state = 1; } break; case 4: if ((gPlayerCount + 0xA) == arg0->type) { - arg0->cursor = 2; - arg0->unk1C = 0; + arg0->state = 2; + arg0->param1 = 0; break; } - arg0->cursor = 1; + arg0->state = 1; case 1: func_800AA280(arg0); - if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || - (gMainMenuSelectionDepth == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { - arg0->unk1C = 0x00000020; + if ((gMainMenuSelection == MAIN_MENU_OK_SELECT_GO_BACK) || + (gMainMenuSelection == MAIN_MENU_MODE_SUB_SELECT_GO_BACK)) { + arg0->param1 = 0x00000020; } else { - if (arg0->unk1C < 0x20) { - arg0->unk1C += 2; - if (arg0->unk1C >= 0x20) { - arg0->unk1C = 0x00000020; + if (arg0->param1 < 0x20) { + arg0->param1 += 2; + if (arg0->param1 >= 0x20) { + arg0->param1 = 0x00000020; } } } break; case 3: if ((gPlayerCount + 0xA) == arg0->type) { - arg0->cursor = 2; + arg0->state = 2; } break; case 2: @@ -9475,7 +9560,7 @@ void func_800A9C40(struct_8018D9E0_entry* arg0) { } } -void func_800A9D5C(struct_8018D9E0_entry* arg0) { +void func_800A9D5C(MenuItem* arg0) { Unk_D_800E70A0* temp_v0; if ((gPlayerCount + 0xA) == arg0->type) { @@ -9484,10 +9569,10 @@ void func_800A9D5C(struct_8018D9E0_entry* arg0) { arg0->priority = 6; } - switch (arg0->cursor) { + switch (arg0->state) { case 2: - if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || - (gMainMenuSelectionDepth == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { + if ((gMainMenuSelection == MAIN_MENU_OK_SELECT_GO_BACK) || + (gMainMenuSelection == MAIN_MENU_MODE_SUB_SELECT_GO_BACK)) { arg0->column = 0x00000080; arg0->row = 0x0000003E; } else { @@ -9498,7 +9583,7 @@ void func_800A9D5C(struct_8018D9E0_entry* arg0) { temp_v0 = &D_800E70A0[arg0->type - 0xA]; func_800A91D8(arg0, temp_v0->column, temp_v0->row); if ((arg0->column == temp_v0->column) && (arg0->row == temp_v0->row)) { - arg0->cursor = 0; + arg0->state = 0; } /* fallthrough */ case 0: @@ -9509,64 +9594,64 @@ void func_800A9D5C(struct_8018D9E0_entry* arg0) { } } -void func_800A9E58(struct_8018D9E0_entry* arg0) { - struct_8018D9E0_entry* temp_v0; +void func_800A9E58(MenuItem* arg0) { + MenuItem* temp_v0; Unk_D_800E70A0* temp_v1_2; s32 sp24; s32 sp20; s32 sp1C; s32 temp_a1; - switch (arg0->type) { /* switch 1 */ - case 18: /* switch 1 */ - case 19: /* switch 1 */ - case 20: /* switch 1 */ - case 21: /* switch 1 */ + switch (arg0->type) { + case 18: + case 19: + case 20: + case 21: sp24 = 18; sp1C = 2; sp20 = 0; break; - case 22: /* switch 1 */ - case 23: /* switch 1 */ + case 22: + case 23: sp24 = 22; sp20 = 2; sp1C = 2; break; - case 24: /* switch 1 */ - case 25: /* switch 1 */ + case 24: + case 25: sp24 = 24; sp20 = 1; sp1C = 1; break; } - temp_a1 = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - switch (arg0->cursor) { /* switch 5; irregular */ - case 0: /* switch 5 */ + temp_a1 = gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; + switch (arg0->state) { /* switch 5; irregular */ + case 0: /* switch 5 */ if ((temp_a1 != sp20) && (temp_a1 != sp1C)) { arg0->visible = 0; } else { - arg0->unk20 = D_800E86AC[gPlayerCount - 1]; - switch (gMainMenuSelectionDepth) { /* switch 2 */ - case GAME_MODE_SELECTION: /* switch 2 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 2 */ - case CONFIRM_OK_SELECTION: /* switch 2 */ + arg0->param2 = gGameModeMenuColumn[gPlayerCount - 1]; + switch (gMainMenuSelection) { /* switch 2 */ + case MAIN_MENU_MODE_SELECT: /* switch 2 */ + case MAIN_MENU_MODE_SUB_SELECT: /* switch 2 */ + case MAIN_MENU_OK_SELECT: /* switch 2 */ arg0->visible = 1; - temp_v0 = func_800AAE68(); + temp_v0 = get_menu_item_player_count(); arg0->column = temp_v0->column; - arg0->row = (D_800E86AC[gPlayerCount - 1] * 0x12) + temp_v0->row + 0x41; - arg0->unk1C = 0; - arg0->cursor = 1; + arg0->row = (gGameModeMenuColumn[gPlayerCount - 1] * 0x12) + temp_v0->row + 0x41; + arg0->param1 = 0; + arg0->state = 1; break; - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 2 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 2 */ - temp_v0 = func_800AAE68(); + case MAIN_MENU_OK_SELECT_GO_BACK: /* switch 2 */ + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: /* switch 2 */ + temp_v0 = get_menu_item_player_count(); temp_v1_2 = &D_800E70E8[arg0->type - sp24]; arg0->column = temp_v0->column + temp_v1_2->column; - arg0->row = (D_800E86AC[gPlayerCount - 1] * 0x12) + temp_v0->row + temp_v1_2->row; - arg0->unk1C = arg0->row - temp_v0->row; + arg0->row = (gGameModeMenuColumn[gPlayerCount - 1] * 0x12) + temp_v0->row + temp_v1_2->row; + arg0->param1 = arg0->row - temp_v0->row; arg0->visible = 1; - arg0->cursor = 2; + arg0->state = 2; break; default: /* switch 2 */ arg0->visible = 0; @@ -9574,75 +9659,75 @@ void func_800A9E58(struct_8018D9E0_entry* arg0) { } } break; - case 1: /* switch 5 */ - switch (gMainMenuSelectionDepth) { /* switch 3 */ - case GAME_MODE_SELECTION: /* switch 3 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 3 */ - case CONFIRM_OK_SELECTION: /* switch 3 */ - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 3 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 3 */ + case 1: /* switch 5 */ + switch (gMainMenuSelection) { /* switch 3 */ + case MAIN_MENU_MODE_SELECT: /* switch 3 */ + case MAIN_MENU_MODE_SUB_SELECT: /* switch 3 */ + case MAIN_MENU_OK_SELECT: /* switch 3 */ + case MAIN_MENU_OK_SELECT_GO_BACK: /* switch 3 */ + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: /* switch 3 */ if ((temp_a1 != sp20) && (temp_a1 != sp1C)) { arg0->visible = 0; - arg0->cursor = 0; + arg0->state = 0; } else { - if (arg0->unk20 != D_800E86AC[gPlayerCount - 1]) { - arg0->cursor = 0; + if (arg0->param2 != gGameModeMenuColumn[gPlayerCount - 1]) { + arg0->state = 0; } - temp_v0 = func_800AAE68(); - arg0->column = temp_v0->column + arg0->unk1C; + temp_v0 = get_menu_item_player_count(); + arg0->column = temp_v0->column + arg0->param1; temp_v1_2 = &D_800E70E8[arg0->type - sp24]; func_800A92E8(arg0, temp_v0->column + temp_v1_2->column); - arg0->unk1C = arg0->column - temp_v0->column; - if (arg0->unk1C == temp_v1_2->column) { - arg0->cursor = 2; - arg0->unk1C = arg0->row - temp_v0->row; + arg0->param1 = arg0->column - temp_v0->column; + if (arg0->param1 == temp_v1_2->column) { + arg0->state = 2; + arg0->param1 = arg0->row - temp_v0->row; } } break; default: /* switch 3 */ arg0->visible = 0; - arg0->cursor = 0; + arg0->state = 0; break; } break; - case 2: /* switch 5 */ - switch (gMainMenuSelectionDepth) { /* switch 4 */ - case GAME_MODE_SELECTION: /* switch 4 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 4 */ - case CONFIRM_OK_SELECTION: /* switch 4 */ - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 4 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 4 */ + case 2: /* switch 5 */ + switch (gMainMenuSelection) { /* switch 4 */ + case MAIN_MENU_MODE_SELECT: /* switch 4 */ + case MAIN_MENU_MODE_SUB_SELECT: /* switch 4 */ + case MAIN_MENU_OK_SELECT: /* switch 4 */ + case MAIN_MENU_OK_SELECT_GO_BACK: /* switch 4 */ + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: /* switch 4 */ if ((temp_a1 != sp20) && (temp_a1 != sp1C)) { arg0->visible = 0; - arg0->cursor = 0; + arg0->state = 0; } else { - if (arg0->unk20 != D_800E86AC[gPlayerCount - 1]) { - arg0->cursor = 0; + if (arg0->param2 != gGameModeMenuColumn[gPlayerCount - 1]) { + arg0->state = 0; } - temp_v0 = func_800AAE68(); + temp_v0 = get_menu_item_player_count(); temp_v1_2 = &D_800E70E8[arg0->type - sp24]; arg0->column = temp_v0->column + temp_v1_2->column; - arg0->row = temp_v0->row + arg0->unk1C; + arg0->row = temp_v0->row + arg0->param1; func_800A91D8(arg0, arg0->column, - (D_800E86AC[gPlayerCount - 1] * 0x12) + temp_v0->row + temp_v1_2->row); - arg0->unk1C = arg0->row - temp_v0->row; + (gGameModeMenuColumn[gPlayerCount - 1] * 0x12) + temp_v0->row + temp_v1_2->row); + arg0->param1 = arg0->row - temp_v0->row; } break; default: /* switch 4 */ arg0->visible = 0; - arg0->cursor = 0; + arg0->state = 0; break; } break; } } -void func_800AA280(struct_8018D9E0_entry* arg0) { +void func_800AA280(MenuItem* arg0) { Unk_D_800E70A0* temp_v0; temp_v0 = &D_800E70A0[arg0->type - 0xA]; - if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || - (gMainMenuSelectionDepth == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { + if ((gMainMenuSelection == MAIN_MENU_OK_SELECT_GO_BACK) || + (gMainMenuSelection == MAIN_MENU_MODE_SUB_SELECT_GO_BACK)) { arg0->column = temp_v0->column; arg0->row = temp_v0->row; } else { @@ -9650,46 +9735,46 @@ void func_800AA280(struct_8018D9E0_entry* arg0) { } } -void func_800AA2EC(struct_8018D9E0_entry* arg0) { +void func_800AA2EC(MenuItem* arg0) { s32 temp_v0; s32 var_t1; var_t1 = 0; - switch (gMainMenuSelectionDepth) { - case OPTIONS_SELECTION: - case DATA_SELECTION: - case PLAYER_NUM_SELECTION: - case GAME_MODE_SELECTION: - arg0->cursor = 0; + switch (gMainMenuSelection) { + case MAIN_MENU_OPTION: + case MAIN_MENU_DATA: + case MAIN_MENU_PLAYER_SELECT: + case MAIN_MENU_MODE_SELECT: + arg0->state = 0; break; - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: - case CONFIRM_OK_SELECTION: - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: - if (arg0->cursor != 0) { + case MAIN_MENU_MODE_SUB_SELECT: + case MAIN_MENU_OK_SELECT: + case MAIN_MENU_OK_SELECT_GO_BACK: + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: + if (arg0->state != 0) { break; } if (gPlayerCount != 1) { break; } - if (D_800E86AC[gPlayerCount - 1] != 1) { + if (gGameModeMenuColumn[gPlayerCount - 1] != 1) { break; } if (gControllerPak1State != 0) { var_t1 = 0; switch (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, - (u8*) gExtCode, &gControllerPak1FileNote)) { /* switch 1; irregular */ - case 5: /* switch 1 */ + (u8*) gExtCode, &gControllerPak1FileNote)) { + case 5: break; - case 0: /* switch 1 */ - arg0->cursor = 1; + case 0: + arg0->state = 1; var_t1 = 1; break; - case 2: /* switch 1 */ + case 2: gControllerPak1State = 0; break; - default: /* switch 1 */ + default: gControllerPak1State = 0; break; } @@ -9697,7 +9782,7 @@ void func_800AA2EC(struct_8018D9E0_entry* arg0) { if (var_t1 == 0) { if (gControllerPak1State == 0) { if (check_for_controller_pak(0) == 0) { - arg0->cursor = 2; + arg0->state = 2; break; } temp_v0 = osPfsInit(&gSIEventMesgQueue, &gControllerPak1FileHandle, 0); @@ -9705,14 +9790,14 @@ void func_800AA2EC(struct_8018D9E0_entry* arg0) { switch (temp_v0) { case PFS_ERR_NOPACK: case PFS_ERR_DEVICE: - arg0->cursor = 2; + arg0->state = 2; break; case PFS_ERR_ID_FATAL: - arg0->cursor = 3; + arg0->state = 3; break; case PFS_ERR_CONTRFAIL: default: - arg0->cursor = 3; + arg0->state = 3; break; } return; @@ -9721,29 +9806,29 @@ void func_800AA2EC(struct_8018D9E0_entry* arg0) { } if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, (u8*) gExtCode, &gControllerPak1FileNote) == 0) { - arg0->cursor = 1; + arg0->state = 1; break; } if (osPfsNumFiles(&gControllerPak1FileHandle, &gControllerPak1NumFilesUsed, &gControllerPak1MaxWriteableFiles) != 0) { - arg0->cursor = 3; + arg0->state = 3; break; } if (osPfsFreeBlocks(&gControllerPak1FileHandle, &gControllerPak1NumPagesFree) != 0) { - arg0->cursor = 3; + arg0->state = 3; break; } gControllerPak1NumPagesFree = (s32) gControllerPak1NumPagesFree >> 8; } if (gControllerPak1MaxWriteableFiles >= gControllerPak1NumFilesUsed) { - arg0->cursor = 5; + arg0->state = 5; break; } if (gControllerPak1NumPagesFree >= 0x79) { - arg0->cursor = 1; + arg0->state = 1; break; } - arg0->cursor = 5; + arg0->state = 5; } break; default: @@ -9751,27 +9836,27 @@ void func_800AA2EC(struct_8018D9E0_entry* arg0) { } } -void func_800AA5C8(struct_8018D9E0_entry* arg0, s8 arg1) { +void func_800AA5C8(MenuItem* arg0, s8 arg1) { s32 temp_v1; temp_v1 = arg0->type - 0x2B; - switch (arg0->unk8) { /* irregular */ + switch (arg0->subState) { /* irregular */ case 0: if (func_800AAFCC((s32) arg1) >= 0) { - arg0->unk8 = 2; + arg0->subState = 2; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8340[temp_v1])); } break; case 2: if (func_800AAFCC((s32) arg1) < 0) { - arg0->unk8 = 0; + arg0->subState = 0; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8320[temp_v1])); } break; } } -void func_800AA69C(struct_8018D9E0_entry* arg0) { +void func_800AA69C(MenuItem* arg0) { s32 temp_v0; s32 var_a0; s32 var_v0; @@ -9785,20 +9870,20 @@ void func_800AA69C(struct_8018D9E0_entry* arg0) { } else { var_a0 = 0; } - switch (arg0->unk8) { + switch (arg0->subState) { case 0: - if ((D_8018EDE8[temp_v0] != 0) && (var_a0 != 0)) { - arg0->unk8 = 1; + if ((gCharacterGridIsSelected[temp_v0] != 0) && (var_a0 != 0)) { + arg0->subState = 1; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a0])); } else { temp_v0 = random_int(0x00C8U); if (temp_v0 >= 0xC6) { - arg0->unk8 = 4; + arg0->subState = 4; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterSingleBlinkAnimation[temp_a0])); } else if (temp_v0 >= 0xC5) { - arg0->unk8 = 5; + arg0->subState = 5; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterDoubleBlinkAnimation[temp_a0])); } @@ -9806,28 +9891,28 @@ void func_800AA69C(struct_8018D9E0_entry* arg0) { break; case 1: if (D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex >= D_800E8440[temp_a0]) { - arg0->unk8 = 2; + arg0->subState = 2; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E83A0[temp_a0])); - } else if ((D_8018EDE8[temp_v0] == 0) && (var_a0 != 0)) { - arg0->unk8 = 3; + } else if ((gCharacterGridIsSelected[temp_v0] == 0) && (var_a0 != 0)) { + arg0->subState = 3; func_8009A594(arg0->D_8018DEE0_index, D_800E8460[temp_a0] - D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex, segmented_to_virtual_dupe_2(gCharacterDeselectAnimation[temp_a0])); } break; case 2: - if ((D_8018EDE8[temp_v0] == 0) && (var_a0 != 0)) { - arg0->unk8 = 3; + if ((gCharacterGridIsSelected[temp_v0] == 0) && (var_a0 != 0)) { + arg0->subState = 3; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterDeselectAnimation[temp_a0])); } break; case 3: if (D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex >= D_800E8460[temp_a0]) { - arg0->unk8 = 0; + arg0->subState = 0; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8360[temp_a0])); - } else if ((D_8018EDE8[temp_v0] != 0) && (var_a0 != 0)) { - arg0->unk8 = 1; + } else if ((gCharacterGridIsSelected[temp_v0] != 0) && (var_a0 != 0)) { + arg0->subState = 1; func_8009A594(arg0->D_8018DEE0_index, D_800E8460[temp_a0] - D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a0])); @@ -9835,18 +9920,18 @@ void func_800AA69C(struct_8018D9E0_entry* arg0) { break; case 4: case 5: - if ((D_8018EDE8[temp_v0] != 0) && (var_a0 != 0)) { - arg0->unk8 = 1; + if ((gCharacterGridIsSelected[temp_v0] != 0) && (var_a0 != 0)) { + arg0->subState = 1; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a0])); } else { - if (arg0->unk8 == 4) { + if (arg0->subState == 4) { var_v0 = D_800E8480[temp_a0]; } else { var_v0 = D_800E84A0[temp_a0]; } if (D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex >= var_v0) { - arg0->unk8 = 0; + arg0->subState = 0; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8360[temp_a0])); } } @@ -9856,35 +9941,35 @@ void func_800AA69C(struct_8018D9E0_entry* arg0) { } } -void func_800AAA9C(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AAA9C(MenuItem* arg0) { + switch (arg0->state) { case 3: - arg0->cursor = 1; + arg0->state = 1; /* fallthrough */ case 1: - if (D_8018EDEE == 3) { - arg0->unk1C = 0x00000020; + if (gPlayerSelectMenuSelection == PLAYER_SELECT_MENU_OK_GO_BACK) { + arg0->param1 = 0x00000020; } else { - if (arg0->unk1C < 0x20) { - arg0->unk1C += (arg0->unk1C / 12) + 2; - if (arg0->unk1C >= 0x20) { - arg0->unk1C = 0x00000020; + if (arg0->param1 < 0x20) { + arg0->param1 += (arg0->param1 / 12) + 2; + if (arg0->param1 >= 0x20) { + arg0->param1 = 0x00000020; } } } /* fallthrough */ case 0: if (func_800AAFCC(arg0->type - 0x2B) >= 0) { - arg0->cursor = 2; - arg0->unk1C = 0; + arg0->state = 2; + arg0->param1 = 0; } else { - arg0->cursor = 1; + arg0->state = 1; } break; case 4: if (func_800AAFCC(arg0->type - 0x2B) >= 0) { - arg0->cursor = 2; - arg0->unk1C = 0; + arg0->state = 2; + arg0->param1 = 0; } break; case 2: @@ -9893,25 +9978,25 @@ void func_800AAA9C(struct_8018D9E0_entry* arg0) { } } -void func_800AAB90(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AAB90(MenuItem* arg0) { + switch (arg0->state) { case 1: - if (arg0->unk1C > 0) { - arg0->cursor = 3; + if (arg0->param1 > 0) { + arg0->state = 3; } break; case 2: - arg0->cursor = 4; + arg0->state = 4; break; case 3: - if (arg0->unk1C > 0) { - arg0->unk1C = (arg0->unk1C - (arg0->unk1C / 12)) - 2; - if (arg0->unk1C < 0) { - arg0->unk1C = 0; + if (arg0->param1 > 0) { + arg0->param1 = (arg0->param1 - (arg0->param1 / 12)) - 2; + if (arg0->param1 < 0) { + arg0->param1 = 0; } } else { - arg0->unk1C = 0; - arg0->cursor = 0; + arg0->param1 = 0; + arg0->state = 0; } break; case 0: @@ -9921,7 +10006,7 @@ void func_800AAB90(struct_8018D9E0_entry* arg0) { } } -void func_800AAC18(struct_8018D9E0_entry* arg0) { +void func_800AAC18(MenuItem* arg0) { UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; s32 temp_a1; @@ -9930,16 +10015,16 @@ void func_800AAC18(struct_8018D9E0_entry* arg0) { Unk_D_800E70A0* var_t0; temp_a1 = arg0->type - 0x2B; - switch (arg0->cursor) { + switch (arg0->state) { case 0: - if (D_8018EDEE == 3) { + if (gPlayerSelectMenuSelection == PLAYER_SELECT_MENU_OK_GO_BACK) { temp_v0 = func_800AAFCC(temp_a1); if (temp_v0 >= 0) { var_t0 = &D_800E7188[(gScreenModeSelection * 4) + temp_v0]; arg0->column = (s32) var_t0->column; arg0->row = (s32) var_t0->row; - arg0->cursor = 2; - arg0->unk8 = 2; + arg0->state = 2; + arg0->subState = 2; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8340[temp_a1])); } break; @@ -9952,7 +10037,7 @@ void func_800AAC18(struct_8018D9E0_entry* arg0) { break; case 2: case 4: - if (arg0->cursor == 2) { + if (arg0->state == 2) { temp_v0 = func_800AAFCC(temp_a1); if (temp_v0 >= 0) { var_t0 = &D_800E7188[(gScreenModeSelection * 4) + temp_v0]; @@ -9960,11 +10045,11 @@ void func_800AAC18(struct_8018D9E0_entry* arg0) { } else { var_t0 = &D_800E7108[0][temp_a1]; if ((var_t0->column == arg0->column) && (var_t0->row == arg0->row)) { - arg0->cursor = 0; + arg0->state = 0; return; } } - if ((arg0->cursor != 2) || (arg0->unk8 != 1)) { + if ((arg0->state != 2) || (arg0->subState != 1)) { func_800A91D8(arg0, (s32) var_t0->column, (s32) var_t0->row); } break; @@ -9973,20 +10058,20 @@ void func_800AAC18(struct_8018D9E0_entry* arg0) { } } -void func_800AADD4(struct_8018D9E0_entry* arg0) { +void update_cursor(MenuItem* arg0) { s32 playerId; s8 characterSelectionIndex; - playerId = arg0->type - 0x34; + playerId = arg0->type - CHARACTER_SELECT_MENU_1P_CURSOR; characterSelectionIndex = gCharacterGridSelections[playerId]; arg0->priority = 0xE - (playerId * 2); - func_800AAF94(arg0, characterSelectionIndex - 1); + hover_cursor_over_character_portrait(arg0, characterSelectionIndex - 1); } -void func_800AAE18(struct_8018D9E0_entry* arg0) { +void func_800AAE18(MenuItem* arg0) { s32 temp_v0; - temp_v0 = func_800AAFCC(arg0->type - 0x2B); + temp_v0 = func_800AAFCC(arg0->type - CHARACTER_SELECT_MENU_MARIO); if (temp_v0 >= 0) { arg0->priority = 0xE - (temp_v0 * 2); } else { @@ -9995,16 +10080,16 @@ void func_800AAE18(struct_8018D9E0_entry* arg0) { } /** - * Similar to find_8018D9E0_entry_dupe, there is potential for a - * hard lock in the function if no appropriate D_8018D9E0 entry + * Similar to find_menu_items_dupe, there is potential for a + * hard lock in the function if no appropriate gMenuItems entry * is found. **/ -struct_8018D9E0_entry* func_800AAE68(void) { - struct_8018D9E0_entry* entry = D_8018D9E0; - s32 thing = gPlayerCount - 1; +MenuItem* get_menu_item_player_count(void) { + MenuItem* entry = gMenuItems; + s32 nbPlayer = gPlayerCount - 1; - for (; !(entry > &D_8018D9E0[D_8018D9E0_SIZE]); entry++) { - if ((thing + 0xB) == entry->type) { + for (; !(entry > &gMenuItems[MENU_ITEMS_MAX]); entry++) { + if ((nbPlayer + MENU_ITEM_UI_1P_GAME) == entry->type) { goto escape; } } @@ -10018,15 +10103,15 @@ struct_8018D9E0_entry* func_800AAE68(void) { } /** - * Similar to find_8018D9E0_entry_dupe, there is potential for a - * hard lock in the function if no appropriate D_8018D9E0 entry + * Similar to find_menu_items_dupe, there is potential for a + * hard lock in the function if no appropriate gMenuItems entry * is found. **/ -struct_8018D9E0_entry* func_800AAEB4(s32 arg0) { - struct_8018D9E0_entry* entry = D_8018D9E0; +MenuItem* get_menu_item_character(s32 characterId) { + MenuItem* entry = gMenuItems; - for (; !(entry > &D_8018D9E0[D_8018D9E0_SIZE]); entry++) { - if ((arg0 + 0x2B) == entry->type) { + for (; !(entry > &gMenuItems[MENU_ITEMS_MAX]); entry++) { + if ((characterId + CHARACTER_SELECT_MENU_MARIO) == entry->type) { goto escape; } } @@ -10049,10 +10134,10 @@ struct_8018D9E0_entry* func_800AAEB4(s32 arg0) { * probably as much a matter of luck as it is good * reasoning on the original author(s) part. **/ -struct_8018D9E0_entry* find_8018D9E0_entry_dupe(s32 arg0) { - struct_8018D9E0_entry* entry = D_8018D9E0; - for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) { - if (entry->type == arg0) { +MenuItem* find_menu_items_dupe(s32 type) { + MenuItem* entry = gMenuItems; + for (; !(entry > (&gMenuItems[MENU_ITEMS_MAX])); entry++) { + if (entry->type == type) { goto escape; } } @@ -10065,10 +10150,10 @@ struct_8018D9E0_entry* find_8018D9E0_entry_dupe(s32 arg0) { return entry; } -struct_8018D9E0_entry* find_8018D9E0_entry(s32 arg0) { - struct_8018D9E0_entry* entry = D_8018D9E0; - for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) { - if (entry->type == arg0) { +MenuItem* find_menu_items(s32 type) { + MenuItem* entry = gMenuItems; + for (; !(entry > (&gMenuItems[MENU_ITEMS_MAX])); entry++) { + if (entry->type == type) { goto escape; } } @@ -10078,56 +10163,56 @@ struct_8018D9E0_entry* find_8018D9E0_entry(s32 arg0) { return entry; } -s32 func_800AAF70(s32 arg0) { - struct_8018D9E0_entry* temp; - temp = func_800AAEB4(arg0); - return temp->cursor; +UNUSED s32 get_character_menu_state(s32 characterId) { + MenuItem* temp; + temp = get_menu_item_character(characterId); + return temp->state; } -void func_800AAF94(struct_8018D9E0_entry* arg0, s32 arg1) { - struct_8018D9E0_entry* temp_v0; +void hover_cursor_over_character_portrait(MenuItem* arg0, s32 characterId) { + MenuItem* temp_v0; - temp_v0 = func_800AAEB4(arg1); + temp_v0 = get_menu_item_character(characterId); arg0->column = temp_v0->column; arg0->row = temp_v0->row; } -s32 func_800AAFCC(s32 arg0) { +s32 func_800AAFCC(s32 characterId) { s32 someIndex = 0; - s32 ret = 0; + bool ret = false; - for (; someIndex < 4; someIndex++) { - if ((arg0 + 1) == gCharacterGridSelections[someIndex]) { - ret = 1; + for (; someIndex < ARRAY_COUNT(gCharacterGridSelections); someIndex++) { + if ((characterId + 1) == gCharacterGridSelections[someIndex]) { + ret = true; break; } } - if (ret != 0) { + if (ret != false) { return someIndex; } return -1; } -void func_800AB020(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AB020(MenuItem* arg0) { + switch (arg0->state) { case 1: - arg0->cursor = 4; + arg0->state = 4; /* fallthrough */ case 4: - if (arg0->unk1C > 0) { - arg0->unk1C = (arg0->unk1C - (arg0->unk1C / 12)) - 2; - if (arg0->unk1C < 0) { - arg0->unk1C = 0; + if (arg0->param1 > 0) { + arg0->param1 = (arg0->param1 - (arg0->param1 / 12)) - 2; + if (arg0->param1 < 0) { + arg0->param1 = 0; } } else { - arg0->unk1C = 0; - arg0->cursor = 0; + arg0->param1 = 0; + arg0->state = 0; } break; case 2: - arg0->cursor = 3; + arg0->state = 3; break; case 0: case 3: @@ -10136,35 +10221,35 @@ void func_800AB020(struct_8018D9E0_entry* arg0) { } } -void func_800AB098(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AB098(MenuItem* arg0) { + switch (arg0->state) { case 0: if ((gCupSelection + 0x53) == arg0->type) { - arg0->cursor = 2; + arg0->state = 2; } else { - arg0->cursor = 1; + arg0->state = 1; } break; case 4: if ((gCupSelection + 0x53) == arg0->type) { - arg0->cursor = 2; - arg0->unk1C = 0; + arg0->state = 2; + arg0->param1 = 0; break; } else { - arg0->cursor = 1; + arg0->state = 1; } // Purposeful fallthrough case 1: - if (arg0->unk1C < 32) { - arg0->unk1C += 2; - if (arg0->unk1C >= 32) { - arg0->unk1C = 32; + if (arg0->param1 < 32) { + arg0->param1 += 2; + if (arg0->param1 >= 32) { + arg0->param1 = 32; } } break; case 3: if ((gCupSelection + 0x53) == arg0->type) { - arg0->cursor = 2; + arg0->state = 2; } break; case 2: @@ -10173,7 +10258,7 @@ void func_800AB098(struct_8018D9E0_entry* arg0) { } } -void func_800AB164(struct_8018D9E0_entry* arg0) { +void func_800AB164(MenuItem* arg0) { Unk_D_800E70A0* thing = &D_800E7148[arg0->type - 0x53]; if ((gCupSelection + 0x53) == arg0->type) { @@ -10182,7 +10267,7 @@ void func_800AB164(struct_8018D9E0_entry* arg0) { arg0->priority = 4; } - switch (arg0->cursor) { + switch (arg0->state) { case 0: thing = &D_800E7148[arg0->type - 0x53]; arg0->column = thing->column; @@ -10195,7 +10280,7 @@ void func_800AB164(struct_8018D9E0_entry* arg0) { thing = &D_800E7148[arg0->type - 0x53]; func_800A91D8(arg0, thing->column, thing->row); if ((arg0->column == thing->column) && (arg0->row == thing->row)) { - arg0->cursor = 0; + arg0->state = 0; } break; case 1: @@ -10205,7 +10290,7 @@ void func_800AB164(struct_8018D9E0_entry* arg0) { } } -void func_800AB260(struct_8018D9E0_entry* arg0) { +void func_800AB260(MenuItem* arg0) { s32 temp = (arg0->type - 0x58); if (temp == gCupSelection) { arg0->visible = 1; @@ -10214,160 +10299,146 @@ void func_800AB260(struct_8018D9E0_entry* arg0) { } } -void func_800AB290(struct_8018D9E0_entry* arg0) { - if (arg0->unk1C != gCupSelection) { - arg0->unk1C = gCupSelection; +void func_800AB290(MenuItem* arg0) { + if (arg0->param1 != gCupSelection) { + arg0->param1 = gCupSelection; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E7E34[gCupCourseOrder[gCupSelection][arg0->type - 0x5F]])); } } -#ifdef NON_MATCHING -// Decent work has been done, but not quite right -// https://decomp.me/scratch/YLbkC -void func_800AB314(struct_8018D9E0_entry* arg0) { - s32 var_a1; - s32 one = 1; - s32 four = 4; - struct_8018D9E0_entry* sp24[4]; - s32 var_v0; +void func_800AB314(MenuItem* item) { + s32 i; + UNUSED s32 pad[2]; + MenuItem* _items[4]; // Added _ to help distinguish between the function argument and this - for (var_a1 = 0; var_a1 < 4; var_a1++) { - sp24[var_a1] = find_8018D9E0_entry_dupe(var_a1 + 0x5F); - } - switch (gModeSelection) { - default: - if (D_8018EDEC != one) { - arg0->cursor = 0; - arg0->unk20 = 0; - for (var_a1 = 0; var_a1 < 4; var_a1++) { - if (gCourseIndexInCup == var_a1) { - sp24[var_a1]->visible = one; - if (arg0->unk1C != var_a1) { - arg0->unk1C = var_a1; - } - } else { - sp24[var_a1]->visible = 0; + for (i = 0; i < 4; i++) { + _items[i] = find_menu_items_dupe(i + 0x5F); + } + if (gModeSelection != 0) { + if (gSubMenuSelection != SUB_MENU_MAP_SELECT_CUP) { + item->state = 0; + item->param2 = 0; + + for (i = 0; i < 4; i++) { + if (gCourseIndexInCup == i) { + _items[i]->visible = 1; + if (item->param1 != i) { + item->param1 = i; } - } - } else { - arg0->cursor = 3; - for (var_a1 = 0; var_a1 < 4; var_a1++) { - sp24[var_a1]->visible = one; - sp24[var_a1]->priority = 6; + } else { + _items[i]->visible = 0; } } - break; - case 0: - switch (arg0->cursor) { /* irregular */ - case 0: - if ((arg0->unk1C / 4) == gCupSelection) { - arg0->unk20++; - if (arg0->unk20 >= 0x33) { - arg0->cursor = one; - arg0->unk20 = 0; - var_v0 = gCupSelection * 4; - arg0->unk1C = var_v0 + 1; - } - } else { - arg0->unk20 = 0; - arg0->unk1C = gCupSelection * 4; - } - if (D_8018EDEC == 3) { - arg0->cursor = 2; - arg0->unk20 = 0; - } - break; - case 1: - if ((arg0->unk1C / 4) != gCupSelection) { - arg0->cursor = 0; - arg0->unk20 = 0; - arg0->unk1C = 0; - } else { - arg0->unk20++; - if (arg0->unk20 >= 0x1F) { - arg0->unk20 = 0; - arg0->unk1C = (gCupSelection * 4) + (((arg0->unk1C % 4) + one) % 4); - } else { - if (D_8018EDEC == 3) { - arg0->cursor = 2; - arg0->unk20 = 0; - } - } - } - break; - case 2: - arg0->unk20++; - if (arg0->unk20 >= 0x1A) { - arg0->cursor = 3; - arg0->unk20 = 0; - } - if (D_8018EDEC != 3) { - arg0->cursor = 0; - arg0->unk20 = 0; - arg0->unk1C = 0; - } - break; - case 3: - if (D_8018EDEC != 3) { - arg0->cursor = 0; - arg0->unk20 = 0; - arg0->unk1C = 0; - } - break; + } else { + item->state = 3; + for (i = 0; i < 4; i++) { + _items[i]->visible = 1; + _items[i]->priority = 6; } - switch (arg0->cursor) { - case 0: - case 1: - for (var_a1 = 0; var_a1 < 4; var_a1++) { - if ((arg0->unk1C % 4) == var_a1) { - sp24[var_a1]->visible = one; - } else { - sp24[var_a1]->visible = 0; - } - sp24[var_a1]->priority = 6; + } + } else { + switch (item->state) { + case 0: + if (gCupSelection == (item->param1 / 4)) { + if (++item->param2 > 50) { + item->state = 1; + item->param2 = 0; + item->param1 = (gCupSelection * 4) + 1; } + } else { + item->param2 = 0; + item->param1 = gCupSelection * 4; + } + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_OK) { + item->state = 2; + item->param2 = 0; + } + break; + case 1: + if (gCupSelection != (item->param1 / 4)) { + item->state = 0; + item->param2 = 0; + item->param1 = 0; break; - case 2: - for (var_a1 = 0; var_a1 < 4; var_a1++) { - if (var_a1 == (arg0->unk1C % 4)) { - sp24[var_a1]->priority = 6; - } else if (arg0->unk20 < (var_a1 * 5)) { - sp24[var_a1]->priority = four; - } else { - sp24[var_a1]->priority = 8; - } - sp24[var_a1]->visible = one; - } + } + + if (++item->param2 > 30) { + item->param2 = 0; + item->param1 = (gCupSelection * 4) + (((item->param1 % 4) + 1) % 4); break; - case 3: - for (var_a1 = 0; var_a1 < 4; var_a1++) { - sp24[var_a1]->visible = one; - sp24[var_a1]->priority = 6; + } + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_OK) { + item->state = 2; + item->param2 = 0; + } + break; + case 2: + if (++item->param2 > 25) { + item->state = 3; + item->param2 = 0; + } + if (gSubMenuSelection != SUB_MENU_MAP_SELECT_OK) { + item->state = 0; + item->param2 = 0; + item->param1 = 0; + } + break; + case 3: + if (gSubMenuSelection != SUB_MENU_MAP_SELECT_OK) { + item->state = 0; + item->param2 = 0; + item->param1 = 0; + } + break; + } + + switch (item->state) { + case 0: + case 1: + for (i = 0; i < 4; i++) { + if ((item->param1 % 4) == i) { + _items[i]->visible = 1; + } else { + _items[i]->visible = 0; } - break; - default: - break; - } - break; + _items[i]->priority = 6; + } + break; + case 2: + for (i = 0; i < 4; i++) { + if ((item->param1 % 4) == i) { + _items[i]->priority = 6; + } else if (item->param2 < (i * 5)) { + _items[i]->priority = 4; + } else { + _items[i]->priority = 8; + } + _items[i]->visible = 1; + } + break; + case 3: + for (i = 0; i < 4; i++) { + _items[i]->visible = 1; + _items[i]->priority = 6; + } + break; + } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AB314.s") -#endif -void func_800AB904(struct_8018D9E0_entry* arg0) { +void func_800AB904(MenuItem* arg0) { Unk_D_800E70A0* temp_a1; - switch (D_8018EDEC) { /* irregular */ - case 1: + switch (gSubMenuSelection) { /* irregular */ + case SUB_MENU_MAP_SELECT_CUP: temp_a1 = &D_800E7248[arg0->type - 0x65]; if (arg0->column != temp_a1->column) { func_800A9208(arg0, temp_a1->column); } break; - case 2: - case 3: + case SUB_MENU_MAP_SELECT_COURSE: + case SUB_MENU_MAP_SELECT_OK: temp_a1 = &D_800E7258[arg0->type - 0x65]; if (arg0->column != temp_a1->column) { func_800A9208(arg0, temp_a1->column); @@ -10376,35 +10447,35 @@ void func_800AB904(struct_8018D9E0_entry* arg0) { } } -void func_800AB9B0(struct_8018D9E0_entry* arg0) { +void func_800AB9B0(MenuItem* arg0) { Unk_D_800E70A0* temp_v1; - if (arg0->unk1C != gCupSelection) { - arg0->unk1C = gCupSelection; - arg0->unk20 = func_800B54C0((s32) gCupSelection, gCCSelection); + if (arg0->param1 != gCupSelection) { + arg0->param1 = gCupSelection; + arg0->param2 = func_800B54C0((s32) gCupSelection, gCCSelection); func_8009A594(arg0->D_8018DEE0_index, 0, - segmented_to_virtual_dupe_2(D_800E7E20[((gCCSelection / 2) * 4) - arg0->unk20])); + segmented_to_virtual_dupe_2(D_800E7E20[((gCCSelection / 2) * 4) - arg0->param2])); arg0->column = (s32) D_800E7268->column; arg0->row = D_800E7268->row; } - temp_v1 = &D_800E7268[arg0->cursor]; - switch (arg0->cursor) { /* irregular */ + temp_v1 = &D_800E7268[arg0->state]; + switch (arg0->state) { /* irregular */ case 0: func_800A91D8(arg0, (s32) temp_v1->column, (s32) temp_v1->row); - if (D_8018EDEC == 3) { - arg0->cursor = 1; + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_OK) { + arg0->state = 1; } break; case 1: func_800A91D8(arg0, (s32) temp_v1->column, (s32) temp_v1->row); - if (D_8018EDEC == 1) { - arg0->cursor = 0; + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_CUP) { + arg0->state = 0; } break; } } -void func_800ABAE8(struct_8018D9E0_entry* arg0) { +void func_800ABAE8(MenuItem* arg0) { s32 index; if (arg0->type == 0x8C) { @@ -10416,21 +10487,21 @@ void func_800ABAE8(struct_8018D9E0_entry* arg0) { arg0->row = D_800E7430[index].row; } -void func_800ABB24(struct_8018D9E0_entry* arg0) { +void func_800ABB24(MenuItem* arg0) { Unk_D_800E70A0* temp_v1; s32 thing = gTimeTrialDataCourseIndex; temp_v1 = &D_800E7430[thing / 4]; arg0->column = temp_v1->column - 2; arg0->row = temp_v1->row + ((thing % 4) * 0x32) + 0x13; - arg0->unk1C += 0x10; - if (arg0->unk1C >= 0x100) { - arg0->unk1C -= 0x100; - arg0->unk20 = (s32) (arg0->unk20 + 1) % 3; + arg0->param1 += 0x10; + if (arg0->param1 >= 0x100) { + arg0->param1 -= 0x100; + arg0->param2 = (s32) (arg0->param2 + 1) % 3; } } -void func_800ABBCC(struct_8018D9E0_entry* arg0) { +void func_800ABBCC(MenuItem* arg0) { s32 temp_v0; Unk_D_800E70A0* temp_v1; @@ -10440,7 +10511,7 @@ void func_800ABBCC(struct_8018D9E0_entry* arg0) { arg0->row = temp_v1->row + ((temp_v0 % 4) * 0x32) + 0x14; } -void func_800ABC38(struct_8018D9E0_entry* arg0) { +void func_800ABC38(MenuItem* arg0) { // Huh? s32 one = 1; func_800ABCF4(arg0); @@ -10456,7 +10527,7 @@ void func_800ABC38(struct_8018D9E0_entry* arg0) { } break; default: - if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != (s32) 1U) || (D_8018EE08 != 0)) { + if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != (s32) 1U) || (gDemoUseController != 0)) { arg0->type = 0; } else { if (arg0->row >= -0x13) { @@ -10469,41 +10540,41 @@ void func_800ABC38(struct_8018D9E0_entry* arg0) { } } -void func_800ABCF4(struct_8018D9E0_entry* arg0) { +void func_800ABCF4(MenuItem* arg0) { f64 temp_f0; - switch (arg0->cursor) { /* irregular */ + switch (arg0->state) { /* irregular */ case 0: arg0->column = 0; - arg0->cursor = 1; - arg0->unk20 = (get_string_width(gCupNames[D_800DC540]) / 2) + 0xA0; + arg0->state = 1; + arg0->param2 = (get_string_width(gCupNames[D_800DC540]) / 2) + 0xA0; /* fallthrough */ case 1: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (s32) (arg0->unk20 - arg0->column) / 4; - if (arg0->unk1C >= 9) { - arg0->unk1C = 8; - } - arg0->unk24 = (f32) (((f64) arg0->unk1C * 0.05) + 1.0); - if (arg0->column >= (arg0->unk20 - 0x14)) { - arg0->cursor = 2; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (s32) (arg0->param2 - arg0->column) / 4; + if (arg0->param1 >= 9) { + arg0->param1 = 8; + } + arg0->paramf = (f32) (((f64) arg0->param1 * 0.05) + 1.0); + if (arg0->column >= (arg0->param2 - 0x14)) { + arg0->state = 2; arg0->D_8018DEE0_index = 0; } break; case 2: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (s32) (arg0->unk20 - arg0->column) / 4; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (s32) (arg0->param2 - arg0->column) / 4; arg0->D_8018DEE0_index++; temp_f0 = (f64) (arg0->D_8018DEE0_index - 0xA); - arg0->unk24 = (f32) ((temp_f0 * 0.0085 * temp_f0) + 0.4); - if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->unk24 > 1.0)) { - arg0->unk24 = 1.0f; + arg0->paramf = (f32) ((temp_f0 * 0.0085 * temp_f0) + 0.4); + if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->paramf > 1.0)) { + arg0->paramf = 1.0f; } break; } } -void func_800ABEAC(struct_8018D9E0_entry* arg0) { +void func_800ABEAC(MenuItem* arg0) { s32 why = 1; func_800ABF68(arg0); switch (D_80164A28) { @@ -10518,7 +10589,7 @@ void func_800ABEAC(struct_8018D9E0_entry* arg0) { } break; default: - if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != why) || (D_8018EE08 != 0)) { + if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != why) || (gDemoUseController != 0)) { arg0->type = 0; } else { if (arg0->row < 0x104) { @@ -10531,110 +10602,110 @@ void func_800ABEAC(struct_8018D9E0_entry* arg0) { } } -void func_800ABF68(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800ABF68(MenuItem* arg0) { + switch (arg0->state) { case 0: arg0->column = 0x140; - arg0->cursor = 1; - arg0->unk20 = 0xA0 - (get_string_width(gCourseNames[gCurrentCourseId]) / 2); + arg0->state = 1; + arg0->param2 = 0xA0 - (get_string_width(gCourseNames[gCurrentCourseId]) / 2); /* fallthrough */ case 1: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (arg0->column - arg0->unk20) / 4; - if (arg0->unk1C >= 9) { - arg0->unk1C = 8; - } - arg0->unk24 = (arg0->unk1C * 0.05) + 1.0; - if ((arg0->unk20 + 0x14) >= arg0->column) { - arg0->cursor = 2; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (arg0->column - arg0->param2) / 4; + if (arg0->param1 >= 9) { + arg0->param1 = 8; + } + arg0->paramf = (arg0->param1 * 0.05) + 1.0; + if ((arg0->param2 + 0x14) >= arg0->column) { + arg0->state = 2; arg0->D_8018DEE0_index = 0; } break; case 2: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (arg0->column - arg0->unk20) / 4; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (arg0->column - arg0->param2) / 4; arg0->D_8018DEE0_index++; - arg0->unk24 = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; - if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->unk24 > 1.0)) { - arg0->unk24 = 1.0f; + arg0->paramf = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; + if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->paramf > 1.0)) { + arg0->paramf = 1.0f; } break; } } -void func_800AC128(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AC128(MenuItem* arg0) { + switch (arg0->state) { case 0: arg0->column = 0x00000140; - arg0->cursor = 1; + arg0->state = 1; /* fallthrough */ case 1: func_800A940C(arg0, 0x00000064); - arg0->unk1C = (s32) (arg0->column - 0x64) / 6; - if (arg0->unk1C >= 9) { - arg0->unk1C = 8; + arg0->param1 = (s32) (arg0->column - 0x64) / 6; + if (arg0->param1 >= 9) { + arg0->param1 = 8; } - arg0->unk24 = (f32) (((f64) arg0->unk1C * 0.07) + 0.6); + arg0->paramf = (f32) (((f64) arg0->param1 * 0.07) + 0.6); if (arg0->column == 0x00000064) { - arg0->cursor = 2; + arg0->state = 2; arg0->D_8018DEE0_index = 0; } break; case 2: arg0->D_8018DEE0_index++; - arg0->unk1C = 0; - arg0->unk24 = (f32) (1.5 - ((arg0->D_8018DEE0_index - 0xF) * 0.004 * (arg0->D_8018DEE0_index - 0xF))); - if ((arg0->D_8018DEE0_index >= 0x10) && ((f64) arg0->unk24 < 0.8)) { - arg0->cursor = 3; + arg0->param1 = 0; + arg0->paramf = (f32) (1.5 - ((arg0->D_8018DEE0_index - 0xF) * 0.004 * (arg0->D_8018DEE0_index - 0xF))); + if ((arg0->D_8018DEE0_index >= 0x10) && ((f64) arg0->paramf < 0.8)) { + arg0->state = 3; arg0->D_8018DEE0_index = 0; } break; case 3: arg0->D_8018DEE0_index++; - arg0->unk1C = 0; - arg0->unk24 = (f32) (1.25 - ((arg0->D_8018DEE0_index - 0xF) * 0.002 * (arg0->D_8018DEE0_index - 0xF))); - if ((arg0->D_8018DEE0_index >= 0xD) && ((f64) arg0->unk24 < 1.0)) { - arg0->unk24 = 1.0f; + arg0->param1 = 0; + arg0->paramf = (f32) (1.25 - ((arg0->D_8018DEE0_index - 0xF) * 0.002 * (arg0->D_8018DEE0_index - 0xF))); + if ((arg0->D_8018DEE0_index >= 0xD) && ((f64) arg0->paramf < 1.0)) { + arg0->paramf = 1.0f; } break; } } -void func_800AC300(struct_8018D9E0_entry* arg0) { - if (arg0->unk20 < ++arg0->unk1C) { +void func_800AC300(MenuItem* arg0) { + if (arg0->param2 < ++arg0->param1) { arg0->type = 0; } } -void func_800AC324(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AC324(MenuItem* arg0) { + switch (arg0->state) { case 0: arg0->column = 0x14A; - arg0->cursor = 1; + arg0->state = 1; func_800921B4(); break; case 1: func_800A9208(arg0, 0xA0); if (arg0->column == 0xA0) { - arg0->cursor = 2; - arg0->unk20 = 0; + arg0->state = 2; + arg0->param2 = 0; } break; case 2: - arg0->unk20++; - if (((D_8018D9D8 != 0) || (arg0->unk20 >= 0x5B)) && (D_800DDB24 != 0)) { - arg0->cursor = 3; - arg0->unk1C = arg0->column; - add_8018D9E0_entry(0xAB, 0, 0, 0); + arg0->param2++; + if (((D_8018D9D8 != 0) || (arg0->param2 >= 0x5B)) && (D_800DDB24 != 0)) { + arg0->state = 3; + arg0->param1 = arg0->column; + add_menu_item(MENU_ITEM_TYPE_0AB, 0, 0, MENU_ITEM_PRIORITY_0); } break; case 3: - arg0->column = arg0->unk1C; - if (arg0->unk1C < 0x14A) { + arg0->column = arg0->param1; + if (arg0->param1 < 0x14A) { if (D_8018D9D8 != 0) { - arg0->unk1C += 0x20; + arg0->param1 += 0x20; } else { - arg0->unk1C += 0x10; + arg0->param1 += 0x10; } } else { arg0->type = 0; @@ -10643,49 +10714,45 @@ void func_800AC324(struct_8018D9E0_entry* arg0) { } } -#ifdef NON_MATCHING -// https://decomp.me/scratch/NzdUC -// A really stupid register allocation issue -void func_800AC458(struct_8018D9E0_entry* arg0) { +void func_800AC458(MenuItem* arg0) { s32 var_a1; s32 var_t1; + s32 temp; - switch (arg0->cursor) { + switch (arg0->state) { case 0: arg0->column = -0x000000A0; - arg0->cursor = 1; - for (var_a1 = 0; var_a1 < 4; var_a1++) { - D_8018D9BC[var_a1] = gGPPointRewards[var_a1]; + arg0->state = 1; + for (var_a1 = 0; var_a1 < ARRAY_COUNT(gGPPointRewards); var_a1++) { + sGPPointsCopy[var_a1] = gGPPointRewards[var_a1]; } - arg0->unk20 = arg0->column; + arg0->param2 = arg0->column; break; case 1: - arg0->column = arg0->unk20; - if (D_8018D9D8 != 0) { - var_a1 = 0x20; - } else { - var_a1 = 0x10; - } - if ((arg0->unk20 + var_a1) < 0) { - arg0->unk20 += var_a1; - D_800DC5EC->screenStartX += var_a1; - D_800DC5F0->screenStartX -= var_a1; + arg0->column = arg0->param2; + + temp = (D_8018D9D8 != 0) ? 0x20 : 0x10; + + if ((arg0->param2 + temp) < 0) { + arg0->param2 += temp; + D_800DC5EC->screenStartX += temp; + D_800DC5F0->screenStartX -= temp; } else { - arg0->unk20 = 0; + arg0->param2 = 0; arg0->column = 0; - arg0->cursor = 2; - arg0->unk1C = 0; + arg0->state = 2; + arg0->param1 = 0; D_800DC5EC->screenStartX = 0x00F0; D_800DC5F0->screenStartX = 0x0050; } break; case 2: arg0->column = 0; - arg0->unk1C++; - if (((D_8018D9D8 != 0) || (arg0->unk1C >= 0x1F)) && (D_800DDB24 != 0)) { - arg0->cursor = 3; - arg0->unk1C = 0; - arg0->unk20 = 0; + arg0->param1++; + if (((D_8018D9D8 != 0) || (arg0->param1 >= 0x1F)) && (D_800DDB24 != 0)) { + arg0->state = 3; + arg0->param1 = 0; + arg0->param2 = 0; } break; case 3: @@ -10693,60 +10760,60 @@ void func_800AC458(struct_8018D9E0_entry* arg0) { case 5: case 6: var_t1 = 0; - var_a1 = arg0->cursor - 3; - arg0->unk1C++; - if (((arg0->unk1C % 3) == 0) || (D_8018D9D8 != 0)) { - if (D_8018D9BC[var_a1] > 0) { - D_8018D9BC[var_a1]--; + var_a1 = arg0->state - 3; + arg0->param1++; + if (((arg0->param1 % 3) == 0) || (D_8018D9D8 != 0)) { + if (sGPPointsCopy[var_a1] > 0) { + sGPPointsCopy[var_a1]--; gGPPointsByCharacterId[gPlayers[gGPCurrentRacePlayerIdByRank[var_a1]].characterId] += 1; play_sound2(SOUND_ACTION_COUNT_SCORE); var_t1 = 0; - if ((D_8018D9BC[var_a1] == 0) && (arg0->unk20 == 0)) { - arg0->unk20 = 1; - arg0->unk1C = 0; + if ((sGPPointsCopy[var_a1] == 0) && (arg0->param2 == 0)) { + arg0->param2 = 1; + arg0->param1 = 0; } } } - if ((arg0->unk20 != 0) && ((arg0->unk1C > 0xA) || ((D_8018D9D8 != 0) && (arg0->unk1C >= 4)))) { + if ((arg0->param2 != 0) && ((arg0->param1 > 0xA) || ((D_8018D9D8 != 0) && (arg0->param1 >= 4)))) { var_t1 = 1; } if (var_t1 != 0) { - arg0->unk20 = 0; - arg0->unk1C = 0; - if (arg0->cursor < 6) { - arg0->cursor++; + arg0->param2 = 0; + arg0->param1 = 0; + if (arg0->state < 6) { + arg0->state++; } else { - arg0->cursor = 7; + arg0->state = 7; } } break; case 7: - arg0->unk1C++; - if ((((D_8018D9D8 != 0) && (arg0->unk1C >= 0xB)) || (arg0->unk1C >= 0x3D)) && (D_800DDB24 != 0)) { - arg0->cursor = 8; - arg0->unk1C = 0; + arg0->param1++; + if ((((D_8018D9D8 != 0) && (arg0->param1 >= 0xB)) || (arg0->param1 >= 0x3D)) && (D_800DDB24 != 0)) { + arg0->state = 8; + arg0->param1 = 0; } break; case 8: - arg0->unk1C++; + arg0->param1++; if (D_8018D9D8 != 0) { - arg0->unk1C += 5; + arg0->param1 += 5; } - if (arg0->unk1C >= 0x29) { - arg0->cursor = 9; + if (arg0->param1 >= 0x29) { + arg0->state = 9; } break; case 9: - arg0->unk1C--; + arg0->param1--; if (D_8018D9D8 != 0) { - arg0->unk1C -= 5; + arg0->param1 -= 5; } - if (arg0->unk1C <= 0) { - arg0->cursor = 0x0000000A; - arg0->unk1C = 0; + if (arg0->param1 <= 0) { + arg0->state = 0x0000000A; + arg0->param1 = 0; if (gCourseIndexInCup == 3) { for (var_a1 = 0; var_a1 < 8; var_a1++) { - if (D_80164478[gCharacterIdByGPOverallRank[var_a1]] < gPlayerCount) { + if (gGetPlayerByCharacterId[gCharacterIdByGPOverallRank[var_a1]] < gPlayerCount) { func_800B536C(var_a1); break; } @@ -10755,30 +10822,30 @@ void func_800AC458(struct_8018D9E0_entry* arg0) { } break; case 10: - arg0->unk1C++; - if (arg0->unk1C > 0) { - arg0->cursor = 0x0000000B; - arg0->unk1C = 0; + arg0->param1++; + if (arg0->param1 > 0) { + arg0->state = 0x0000000B; + arg0->param1 = 0; func_800921B4(); } break; case 11: if ((D_8018D9D8 != 0) && (D_800DDB24 != 0)) { - arg0->cursor = 0x0000000C; - arg0->unk20 = arg0->row; + arg0->state = 0x0000000C; + arg0->param2 = arg0->row; play_sound2(SOUND_ACTION_NEXT_COURSE); } break; case 12: - arg0->row = arg0->unk20; - if (arg0->unk20 < 0xF0) { - arg0->unk20 += 0x10; + arg0->row = arg0->param2; + if (arg0->param2 < 0xF0) { + arg0->param2 += 0x10; D_800DC5EC->screenStartY += 0x10; D_800DC5F0->screenStartY -= 0x10; } else { - arg0->unk20 = 0; - arg0->cursor = 0x0000000D; - arg0->unk1C = 0; + arg0->param2 = 0; + arg0->state = 0x0000000D; + arg0->param1 = 0; D_800DC5EC->screenStartY = 0x012C; D_800DC5F0->screenStartY = -0x003C; D_8015F894 = 4; @@ -10790,152 +10857,149 @@ void func_800AC458(struct_8018D9E0_entry* arg0) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AC458.s") -#endif -void func_800AC978(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { /* irregular */ +void func_800AC978(MenuItem* arg0) { + switch (arg0->state) { /* irregular */ case 0: arg0->column = 0x14A; - arg0->cursor = 1; - arg0->unk1C = 0xFF; + arg0->state = 1; + arg0->param1 = 0xFF; break; case 1: func_800A9208(arg0, 0xA0); if (arg0->column == 0xA0) { - arg0->cursor = 2; + arg0->state = 2; } break; case 2: break; case 3: - if (arg0->unk1C != 0) { - arg0->unk1C -= 0x33; + if (arg0->param1 != 0) { + arg0->param1 -= 0x33; } break; } } -void func_800ACA14(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { /* irregular */ +void func_800ACA14(MenuItem* arg0) { + switch (arg0->state) { /* irregular */ case 0: - if (arg0->unk20 >= 0xB) { - arg0->unk1C += 3; + if (arg0->param2 >= 0xB) { + arg0->param1 += 3; } - if (arg0->unk1C >= 0x65) { - arg0->cursor = 0x0000000B; - arg0->unk1C = 0; + if (arg0->param1 >= 0x65) { + arg0->state = 0x0000000B; + arg0->param1 = 0; } break; case 11: case 12: - if (func_800B4520()) { + if (is_screen_being_faded()) { break; } if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x800) { - if (arg0->cursor >= 0xC) { - arg0->cursor--; + if (arg0->state >= 0xC) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x400) { - if (arg0->cursor < 0xC) { - arg0->cursor++; + if (arg0->state < 0xC) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } if (gControllerFive->buttonPressed & 0x9000) { func_8009DFE0(0x0000001E); func_800CA330(0x19U); play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } break; default: break; } - if (arg0->unk20 < 0x28) { - arg0->unk20++; + if (arg0->param2 < 0x28) { + arg0->param2++; } } -void func_800ACC50(struct_8018D9E0_entry* arg0) { - s32 var_s0; +void func_800ACC50(MenuItem* arg0) { + s32 i; - switch (arg0->cursor) { + switch (arg0->state) { case 0: - arg0->unk1C += 3; - if (arg0->unk1C >= 0x65) { - arg0->cursor = 1; - arg0->unk1C = 0; - for (var_s0 = 0; var_s0 < gPlayerCount; var_s0++) { - add_8018D9E0_entry(var_s0 + 0xB1, 0, 0, (s8) (5 - var_s0)); + arg0->param1 += 3; + if (arg0->param1 >= 0x65) { + arg0->state = 1; + arg0->param1 = 0; + for (i = 0; i < gPlayerCount; i++) { + add_menu_item(i + MENU_ITEM_TYPE_0B1, 0, 0, (s8) (MENU_ITEM_PRIORITY_5 - i)); } } break; case 1: - if (find_8018D9E0_entry_dupe(0x000000B1)->cursor >= 2) { - arg0->cursor = 2; + if (find_menu_items_dupe(0x000000B1)->state >= 2) { + arg0->state = 2; } break; case 2: - arg0->unk1C += 0x20; - if (arg0->unk1C >= 0x100) { + arg0->param1 += 0x20; + if (arg0->param1 >= 0x100) { if (gModeSelection == VERSUS) { - arg0->cursor = (s32) D_8018EDF4; + arg0->state = (s32) gVersusResultCursorSelection; } else { - arg0->cursor = (s32) D_8018EDF6; + arg0->state = (s32) gBattleResultCursorSelection; } - arg0->unk1C = 0; + arg0->param1 = 0; } break; case 10: case 11: case 12: case 13: - if (func_800B4520() == 0) { + if (is_screen_being_faded() == 0) { if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x800) { - if (arg0->cursor >= 0xB) { - arg0->cursor--; + if (arg0->state >= 0xB) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x400) { - if (arg0->cursor < 0xD) { - arg0->cursor++; + if (arg0->state < 0xD) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } if (gControllerFive->buttonPressed & 0x9000) { func_8009DFE0(0x0000001E); play_sound2(SOUND_MENU_OK_CLICKED); if (gModeSelection == VERSUS) { - D_8018EDF4 = (s8) arg0->cursor; + gVersusResultCursorSelection = (s8) arg0->state; } else { - D_8018EDF6 = (s8) arg0->cursor; + gBattleResultCursorSelection = (s8) arg0->state; } - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } } @@ -10945,61 +11009,62 @@ void func_800ACC50(struct_8018D9E0_entry* arg0) { } } -void func_800ACF40(struct_8018D9E0_entry* arg0) { +void func_800ACF40(MenuItem* arg0) { Unk_D_800E70A0* temp_v0_2; - s32 temp_a2; + s32 somePlayerIndex; s32 temp_a1; s32 var_v1; UNUSED s32 stackPadding0; - temp_a2 = arg0->type - 0xB1; + somePlayerIndex = arg0->type - 0xB1; temp_a1 = D_800EFD64[gCharacterSelections[arg0->type - 0xB1]]; - switch (arg0->cursor) { + switch (arg0->state) { case 0: arg0->column = D_800E72F8.column; arg0->row = D_800E72F8.row; - arg0->cursor = 1; + arg0->state = 1; break; case 1: - temp_v0_2 = &D_800E7300[((gPlayerCount - 2) * 4) + temp_a2]; + temp_v0_2 = &D_800E7300[((gPlayerCount - 2) * 4) + somePlayerIndex]; func_800A9208(arg0, temp_v0_2->column); func_800A9278(arg0, temp_v0_2->row); if (arg0->column == temp_v0_2->column) { - arg0->cursor = 2; - arg0->unk20 = 0; + arg0->state = 2; + arg0->param2 = 0; } break; case 2: var_v1 = 0; - switch (gModeSelection) { /* switch 1; irregular */ - case 2: /* switch 1 */ - if (gGPCurrentRaceRankByPlayerId[temp_a2] != 0) { + switch (gModeSelection) { + case 2: + if (gGPCurrentRaceRankByPlayerId[somePlayerIndex] != 0) { var_v1 = 1; } break; - case 3: /* switch 1 */ - if (temp_a2 != gPlayerWinningIndex) { + case 3: + if (somePlayerIndex != gPlayerWinningIndex) { var_v1 = 1; } break; } if (var_v1 == 0) { - arg0->unk20++; - if (arg0->unk20 >= 0x1F) { - if (find_8018D9E0_entry_dupe(0x000000B0)->cursor >= 2) { - func_8009A640(arg0->D_8018DEE0_index, 0, temp_a2, + arg0->param2++; + if (arg0->param2 >= 0x1F) { + if (find_menu_items_dupe(0x000000B0)->state >= 2) { + func_8009A640(arg0->D_8018DEE0_index, 0, somePlayerIndex, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a1])); - arg0->cursor = 3; - func_800CA24C(temp_a2); - func_800C90F4(temp_a2, (gCharacterSelections[temp_a2] * 0x10) + 0x29008007); + arg0->state = 3; + func_800CA24C(somePlayerIndex); + func_800C90F4(somePlayerIndex, (gCharacterSelections[somePlayerIndex] * 0x10) + 0x29008007); } } } break; case 3: if (D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex >= D_800E8440[temp_a1]) { - func_8009A640(arg0->D_8018DEE0_index, 0, temp_a2, segmented_to_virtual_dupe_2(D_800E83A0[temp_a1])); - arg0->cursor = 4; + func_8009A640(arg0->D_8018DEE0_index, 0, somePlayerIndex, + segmented_to_virtual_dupe_2(D_800E83A0[temp_a1])); + arg0->state = 4; } break; case 4: @@ -11008,42 +11073,42 @@ void func_800ACF40(struct_8018D9E0_entry* arg0) { } } -void func_800AD1A4(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AD1A4(MenuItem* arg0) { + switch (arg0->state) { case 0: arg0->column = 0x0000014A; - arg0->cursor = 1; + arg0->state = 1; func_800921B4(); - add_8018D9E0_entry(0x000000BB, 0, 0, 0); + add_menu_item(MENU_ITEM_TYPE_0BB, 0, 0, MENU_ITEM_PRIORITY_0); break; case 1: func_800A9208(arg0, 0x000000A0); if (arg0->column == 0x000000A0) { - arg0->cursor = 2; - arg0->unk20 = 0; + arg0->state = 2; + arg0->param2 = 0; } break; case 2: - arg0->unk20++; - if (arg0->unk20 >= 0x15) { - arg0->cursor = 3; + arg0->param2++; + if (arg0->param2 >= 0x15) { + arg0->state = 3; } break; case 3: if (D_8018D9D8 != 0) { func_800921B4(); - arg0->cursor = 4; - arg0->unk1C = arg0->column; - add_8018D9E0_entry(0x000000BA, 0, 0, 0); + arg0->state = 4; + arg0->param1 = arg0->column; + add_menu_item(MENU_ITEM_TYPE_0BA, 0, 0, MENU_ITEM_PRIORITY_0); } break; case 4: - arg0->column = arg0->unk1C; - if (arg0->unk1C < 0x14A) { + arg0->column = arg0->param1; + if (arg0->param1 < 0x14A) { if (D_8018D9D8 != 0) { - arg0->unk1C += 0x20; + arg0->param1 += 0x20; } else { - arg0->unk1C += 0x10; + arg0->param1 += 0x10; } } else { arg0->type = 0; @@ -11054,39 +11119,39 @@ void func_800AD1A4(struct_8018D9E0_entry* arg0) { } } -void func_800AD2E8(struct_8018D9E0_entry* arg0) { +void func_800AD2E8(MenuItem* arg0) { struct_8018EE10_entry* thing; s32 var_v1; s32 var_a1; s32 index; - switch (arg0->cursor) { /* switch 3; irregular */ - case 0: /* switch 3 */ + switch (arg0->state) { /* switch 3; irregular */ + case 0: /* switch 3 */ arg0->column = -0x000000A0; - arg0->cursor = 1; - for (index = 0; index < 4; index++) { - D_8018D9BC[index] = gGPPointRewards[index]; + arg0->state = 1; + for (index = 0; index < ARRAY_COUNT(gGPPointRewards); index++) { + sGPPointsCopy[index] = gGPPointRewards[index]; } - arg0->unk20 = arg0->column; + arg0->param2 = arg0->column; break; ; case 1: /* switch 3 */ - arg0->column = arg0->unk20; + arg0->column = arg0->param2; if (D_8018D9D8 != 0) { var_a1 = 0x20; } else { var_a1 = 0x10; } - if ((arg0->unk20 + var_a1) < 0) { - arg0->unk20 += var_a1; + if ((arg0->param2 + var_a1) < 0) { + arg0->param2 += var_a1; D_800DC5EC->screenStartX += var_a1; D_800DC5F0->screenStartX -= var_a1; } else { - arg0->unk20 = 0; + arg0->param2 = 0; arg0->column = 0; - arg0->cursor = D_8018EDF5; - if ((arg0->cursor == 9) && (D_80162DF8 == 1)) { - arg0->cursor--; + arg0->state = gTimeTrialsResultCursorSelection; + if ((arg0->state == 9) && (gPostTimeTrialReplayCannotSave == 1)) { + arg0->state--; } D_800DC5EC->screenStartX = 0x00F0; D_800DC5F0->screenStartX = 0x0050; @@ -11098,42 +11163,42 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) { case 8: /* switch 3 */ case 9: /* switch 3 */ case 10: /* switch 3 */ - if (func_800B4520() == 0) { + if (is_screen_being_faded() == 0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { - if (arg0->cursor >= 6) { - arg0->cursor--; - if ((D_80162DF8 == 1) && (arg0->cursor == 9)) { - arg0->cursor--; + if (arg0->state >= 6) { + arg0->state--; + if ((gPostTimeTrialReplayCannotSave == 1) && (arg0->state == 9)) { + arg0->state--; } play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { - if (arg0->cursor < 0xA) { - arg0->cursor++; - if ((D_80162DF8 == 1) && (arg0->cursor == 9)) { - arg0->cursor++; + if (arg0->state < 0xA) { + arg0->state++; + if ((gPostTimeTrialReplayCannotSave == 1) && (arg0->state == 9)) { + arg0->state++; } - if ((arg0->cursor == 0x0000000A) && (D_80162DD4 != 0)) { - arg0->cursor -= 2; + if ((arg0->state == 0x0000000A) && (bPlayerGhostDisabled != 0)) { + arg0->state -= 2; } else { play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } } if (gControllerOne->buttonPressed & 0x9000) { - if (arg0->cursor == 0x0000000A) { + if (arg0->state == 0x0000000A) { var_v1 = 0; - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } if (gControllerPak1State != 0) { var_v1 = 0; @@ -11143,7 +11208,7 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) { break; case 0: /* switch 4 */ func_800B6708(); - arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x11; + arg0->state = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x11; var_v1 = 1; play_sound2(SOUND_MENU_SELECT); break; @@ -11159,26 +11224,26 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) { if (gControllerPak1State == 0) { switch (func_800B5F30()) { /* switch 2 */ case -1: /* switch 2 */ - arg0->cursor = 0x0000000B; + arg0->state = 0x0000000B; var_v1 = 1; break; case -3: /* switch 2 */ case -2: /* switch 2 */ - arg0->cursor = 0x0000000C; + arg0->state = 0x0000000C; var_v1 = 1; break; case 1: /* switch 2 */ case 11: /* switch 2 */ - arg0->cursor = 0x0000000B; + arg0->state = 0x0000000B; var_v1 = 1; break; case 10: /* switch 2 */ - arg0->cursor = 0x0000000C; + arg0->state = 0x0000000C; var_v1 = 1; break; default: /* switch 2 */ var_v1 = 1; - arg0->cursor = 0x0000000C; + arg0->state = 0x0000000C; break; case 0: break; @@ -11190,180 +11255,180 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) { if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, (u8*) gExtCode, &gControllerPak1FileNote) == 0) { func_800B6708(); - arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x11; + arg0->state = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x11; play_sound2(SOUND_MENU_SELECT); return; } } if (gControllerPak1MaxWriteableFiles >= gControllerPak1NumFilesUsed) { - arg0->cursor = 0x0000000E; + arg0->state = 0x0000000E; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (gControllerPak1NumPagesFree >= 0x79) { - arg0->cursor = 0x00000013; - arg0->unk1C = 0; + arg0->state = 0x00000013; + arg0->param1 = 0; play_sound2(SOUND_MENU_SELECT); return; } - arg0->cursor = 0x0000000E; + arg0->state = 0x0000000E; play_sound2(SOUND_MENU_FILE_NOT_FOUND); } } else { - arg0->unk1C = arg0->cursor; - D_8018EDF5 = arg0->cursor; - arg0->cursor = 0x0000001E; - arg0->unk20 = arg0->row; + arg0->param1 = arg0->state; + gTimeTrialsResultCursorSelection = arg0->state; + arg0->state = 0x0000001E; + arg0->param2 = arg0->row; play_sound2(SOUND_ACTION_NEXT_COURSE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } } } break; - case 11: /* switch 1 */ - case 12: /* switch 1 */ - case 13: /* switch 1 */ - case 14: /* switch 1 */ - case 15: /* switch 1 */ - case 16: /* switch 1 */ - case 26: /* switch 1 */ + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 26: if (gControllerOne->buttonPressed & 0xD000) { - arg0->cursor = 0x0000000A; + arg0->state = 0x0000000A; play_sound2(SOUND_MENU_GO_BACK); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } break; - case 17: /* switch 1 */ - case 18: /* switch 1 */ - arg0->unk20 = arg0->cursor - 0x11; - if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->unk20) { + case 17: + case 18: + arg0->param2 = arg0->state - 0x11; + if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->param2) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { - if (arg0->cursor >= 0x12) { - arg0->cursor--; + if (arg0->state >= 0x12) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { - if (arg0->cursor < 0x12) { - arg0->cursor++; + if (arg0->state < 0x12) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } } if (gControllerOne->buttonPressed & 0x4000) { - arg0->cursor = 0x0000000A; + arg0->state = 0x0000000A; play_sound2(SOUND_MENU_GO_BACK); return; } if (gControllerOne->buttonPressed & 0x9000) { - thing = &D_8018EE10[arg0->unk20]; + thing = &D_8018EE10[arg0->param2]; if (thing->ghostDataSaved == 0) { - arg0->cursor = 0x00000019; - arg0->unk1C = 0; - } else if (func_800B63F0(arg0->unk20) == 0) { - arg0->cursor = 0x00000010; + arg0->state = 0x00000019; + arg0->param1 = 0; + } else if (func_800B63F0(arg0->param2) == 0) { + arg0->state = 0x00000010; } else { - arg0->cursor = 0x00000014; + arg0->state = 0x00000014; } play_sound2(SOUND_MENU_SELECT); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } break; - case 19: /* switch 1 */ - if ((arg0->unk1C == 1) && (func_800B6A68() != 0)) { - arg0->cursor = 0x0000000F; + case 19: + if ((arg0->param1 == 1) && (func_800B6A68() != 0)) { + arg0->state = 0x0000000F; return; } else { - arg0->unk1C++; - if (arg0->unk1C >= 2) { - arg0->cursor = 0x00000011; + arg0->param1++; + if (arg0->param1 >= 2) { + arg0->state = 0x00000011; } } break; - case 20: /* switch 1 */ - case 21: /* switch 1 */ - if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) && (arg0->cursor >= 0x15)) { - arg0->cursor--; + case 20: + case 21: + if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) && (arg0->state >= 0x15)) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { - if (arg0->cursor < 0x15) { - arg0->cursor++; + if (arg0->state < 0x15) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } if (gControllerOne->buttonPressed & 0x4000) { - arg0->cursor = arg0->unk20 + 0x11; + arg0->state = arg0->param2 + 0x11; play_sound2(SOUND_MENU_GO_BACK); return; } if (gControllerOne->buttonPressed & 0x9000) { - if (arg0->cursor == 0x00000015) { - arg0->cursor = 0x00000019; - arg0->unk1C = 0; + if (arg0->state == 0x00000015) { + arg0->state = 0x00000019; + arg0->param1 = 0; play_sound2(SOUND_MENU_SELECT); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } else { - arg0->cursor = arg0->unk20 + 0x11; + arg0->state = arg0->param2 + 0x11; play_sound2(SOUND_MENU_GO_BACK); return; } } break; - case 25: /* switch 1 */ - if (arg0->unk1C == 1) { + case 25: + if (arg0->param1 == 1) { if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, (u8*) gExtCode, &gControllerPak1FileNote) != 0) { - arg0->cursor = 0x0000001A; + arg0->state = 0x0000001A; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - if (func_800B6178(arg0->unk20) != 0) { - arg0->cursor = 0x0000001A; + if (func_800B6178(arg0->param2) != 0) { + arg0->state = 0x0000001A; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } } - arg0->unk1C++; - if (arg0->unk1C >= 2) { - arg0->cursor = 0x0000000A; + arg0->param1++; + if (arg0->param1 >= 2) { + arg0->state = 0x0000000A; return; } break; - case 30: /* switch 1 */ - arg0->row = arg0->unk20; - if (arg0->unk20 < 0xF0) { - arg0->unk20 += 0x10; + case 30: + arg0->row = arg0->param2; + if (arg0->param2 < 0xF0) { + arg0->param2 += 0x10; D_800DC5EC->screenStartY += 0x10; D_800DC5F0->screenStartY -= 0x10; return; } - switch (arg0->unk1C) { /* switch 3 */ - case 5: /* switch 3 */ + switch (arg0->param1) { /* switch 3 */ + case 5: /* switch 3 */ D_8015F890 = 0; D_8015F892 = 1; func_802903B0(); @@ -11383,14 +11448,14 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) { func_802903B0(); break; } - arg0->unk20 = 0; - arg0->cursor = 0x0000001F; + arg0->param2 = 0; + arg0->state = 0x0000001F; D_800DC5EC->screenStartY = 0x012C; D_800DC5F0->screenStartY = -0x003C; D_8015F894 = 4; func_800CA330(0x19U); break; - case 31: /* switch 1 */ + case 31: arg0->type = 0; break; } @@ -11400,14 +11465,14 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) { #else #define FUNC_800ADF48DEF 60 #endif -void func_800ADF48(struct_8018D9E0_entry* arg0) { +void func_800ADF48(MenuItem* arg0) { UNUSED s32 stackPadding; struct Controller* controller; if (gIsGamePaused != 0) { - switch (arg0->cursor) { + switch (arg0->state) { case 0: - arg0->cursor = D_800F0B50[gModeSelection]; + arg0->state = D_800F0B50[gModeSelection]; break; case 11: case 12: @@ -11424,38 +11489,38 @@ void func_800ADF48(struct_8018D9E0_entry* arg0) { case 42: case 43: case 44: - if (func_800B4520() == 0) { + if (is_screen_being_faded() == 0) { controller = &gControllers[gIsGamePaused - 1]; if ((controller->buttonPressed | controller->stickPressed) & 0x800) { - if (D_800F0B50[gModeSelection] < arg0->cursor) { - arg0->cursor--; + if (D_800F0B50[gModeSelection] < arg0->state) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((controller->buttonPressed | controller->stickPressed) & 0x400) { - if (arg0->cursor < D_800F0B54[gModeSelection]) { - arg0->cursor++; + if (arg0->state < D_800F0B54[gModeSelection]) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } if (controller->buttonPressed & B_BUTTON) { - if (arg0->cursor != D_800F0B50[gModeSelection]) { - arg0->cursor = D_800F0B50[gModeSelection]; + if (arg0->state != D_800F0B50[gModeSelection]) { + arg0->state = D_800F0B50[gModeSelection]; play_sound2(SOUND_MENU_GO_BACK); return; } } if (controller->buttonPressed & (START_BUTTON | A_BUTTON)) { - if (arg0->cursor == D_800F0B50[gModeSelection]) { - arg0->cursor = 0; + if (arg0->state == D_800F0B50[gModeSelection]) { + arg0->state = 0; gIsGamePaused = 0; func_8028DF38(); func_800C9F90(0U); @@ -11463,8 +11528,8 @@ void func_800ADF48(struct_8018D9E0_entry* arg0) { func_8009DFE0(30); play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); func_800CA330(FUNC_800ADF48DEF); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } } @@ -11474,70 +11539,70 @@ void func_800ADF48(struct_8018D9E0_entry* arg0) { break; } } else { - arg0->cursor = 0; + arg0->state = 0; } } -void func_800AE218(struct_8018D9E0_entry* arg0) { +void func_800AE218(MenuItem* arg0) { struct_8018EE10_entry* thing; s32 var_v1; - if (arg0->cursor != 0) { + if (arg0->state != 0) { D_800DC5B8 = 0; } - switch (arg0->cursor) { /* switch 1 */ - case 0: /* switch 1 */ - if (arg0->unk1C < 0x1E) { - arg0->unk1C++; + switch (arg0->state) { + case 0: + if (arg0->param1 < 0x1E) { + arg0->param1++; } if (gControllerOne->buttonPressed & 0x1000) { - arg0->cursor = 0x0000000F; + arg0->state = 0x0000000F; play_sound2(SOUND_ACTION_GO_BACK_2); } else if (playerHUD[PLAYER_ONE].raceCompleteBool != 0) { - arg0->cursor = 1; - arg0->unk1C = 0; + arg0->state = 1; + arg0->param1 = 0; } break; - default: /* switch 1 */ + default: break; - case 1: /* switch 1 */ - arg0->unk1C += 3; - if (arg0->unk1C >= 0x8D) { - arg0->cursor = 0x0000000F; + case 1: + arg0->param1 += 3; + if (arg0->param1 >= 0x8D) { + arg0->state = 0x0000000F; } break; - case 11: /* switch 1 */ - case 12: /* switch 1 */ - case 13: /* switch 1 */ - case 14: /* switch 1 */ - case 15: /* switch 1 */ - case 16: /* switch 1 */ - if (func_800B4520() == 0) { + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + if (is_screen_being_faded() == 0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { - if (arg0->cursor >= 0xC) { - arg0->cursor--; + if (arg0->state >= 0xC) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { - if (arg0->cursor < 0x10) { - arg0->cursor++; + if (arg0->state < 0x10) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } if (gControllerOne->buttonPressed & 0x9000) { - if (arg0->cursor == 0x00000010) { + if (arg0->state == 0x00000010) { var_v1 = 0; - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } if (gControllerPak1State != 0) { var_v1 = 0; @@ -11547,7 +11612,7 @@ void func_800AE218(struct_8018D9E0_entry* arg0) { break; case PFS_NO_ERROR: /* switch 3 */ func_800B6708(); - arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x1E; + arg0->state = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x1E; var_v1 = 1; break; case PFS_ERR_NEW_PACK: /* switch 3 */ @@ -11565,26 +11630,26 @@ void func_800AE218(struct_8018D9E0_entry* arg0) { if (gControllerPak1State == 0) { switch (func_800B5F30()) { /* switch 2 */ case PFS_INVALID_DATA: /* switch 2 */ - arg0->cursor = 0x00000015; + arg0->state = 0x00000015; var_v1 = 1; break; case PFS_FREE_BLOCKS_ERROR: /* switch 2 */ case PFS_NUM_FILES_ERROR: /* switch 2 */ - arg0->cursor = 0x00000016; + arg0->state = 0x00000016; var_v1 = 1; break; case PFS_ERR_NOPACK: /* switch 2 */ case PFS_ERR_DEVICE: /* switch 2 */ - arg0->cursor = 0x00000015; + arg0->state = 0x00000015; var_v1 = 1; break; case PFS_ERR_ID_FATAL: /* switch 2 */ - arg0->cursor = 0x00000016; + arg0->state = 0x00000016; var_v1 = 1; break; default: /* switch 2 */ var_v1 = 1; - arg0->cursor = 0x00000016; + arg0->state = 0x00000016; break; case 0: break; @@ -11596,20 +11661,20 @@ void func_800AE218(struct_8018D9E0_entry* arg0) { if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, (u8*) gExtCode, &gControllerPak1FileNote) == 0) { func_800B6708(); - arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x1E; + arg0->state = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x1E; play_sound2(SOUND_MENU_SELECT); return; } } if (gControllerPak1MaxWriteableFiles >= gControllerPak1NumFilesUsed) { - arg0->cursor = 0x00000018; + arg0->state = 0x00000018; play_sound2(SOUND_MENU_FILE_NOT_FOUND); } else if (gControllerPak1NumPagesFree >= 0x79) { - arg0->cursor = 0x00000020; - arg0->unk1C = 0; + arg0->state = 0x00000020; + arg0->param1 = 0; play_sound2(SOUND_MENU_SELECT); } else { - arg0->cursor = 0x00000018; + arg0->state = 0x00000018; play_sound2(SOUND_MENU_FILE_NOT_FOUND); } } else { @@ -11617,175 +11682,175 @@ void func_800AE218(struct_8018D9E0_entry* arg0) { play_sound2(SOUND_MENU_OK_CLICKED); func_800CA330(0x19U); func_800CA388(0x19U); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } } } break; - case 21: /* switch 1 */ - case 22: /* switch 1 */ - case 23: /* switch 1 */ - case 24: /* switch 1 */ - case 25: /* switch 1 */ - case 26: /* switch 1 */ - case 41: /* switch 1 */ + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 41: if (gControllerOne->buttonPressed & 0xD000) { - arg0->cursor = 0x00000010; + arg0->state = 0x00000010; play_sound2(SOUND_MENU_GO_BACK); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } break; - case 30: /* switch 1 */ - case 31: /* switch 1 */ - arg0->unk20 = (u32) arg0->cursor - 0x1E; - if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->unk20) { + case 30: + case 31: + arg0->param2 = (u32) arg0->state - 0x1E; + if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->param2) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { - if (arg0->cursor >= 0x1F) { - arg0->cursor--; + if (arg0->state >= 0x1F) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } } if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { - if (arg0->cursor < 0x1F) { - arg0->cursor++; + if (arg0->state < 0x1F) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } } if (gControllerOne->buttonPressed & 0x4000) { - arg0->cursor = 0x00000010; + arg0->state = 0x00000010; play_sound2(SOUND_MENU_GO_BACK); } else if (gControllerOne->buttonPressed & 0x9000) { - thing = &D_8018EE10[arg0->unk20]; + thing = &D_8018EE10[arg0->param2]; if (thing->ghostDataSaved == 0) { - arg0->cursor = 0x00000028; - arg0->unk1C = 0; - } else if (func_800B63F0(arg0->unk20) == 0) { - arg0->cursor = 0x0000001A; + arg0->state = 0x00000028; + arg0->param1 = 0; + } else if (func_800B63F0(arg0->param2) == 0) { + arg0->state = 0x0000001A; } else { - arg0->cursor = 0x00000023; + arg0->state = 0x00000023; } play_sound2(SOUND_MENU_SELECT); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } break; - case 32: /* switch 1 */ - if ((arg0->unk1C == 1) && (func_800B6A68() != 0)) { - arg0->cursor = 0x00000019; + case 32: + if ((arg0->param1 == 1) && (func_800B6A68() != 0)) { + arg0->state = 0x00000019; } else { - arg0->unk1C++; - if (arg0->unk1C >= 2) { - arg0->cursor = 0x0000001E; + arg0->param1++; + if (arg0->param1 >= 2) { + arg0->state = 0x0000001E; } } break; - case 35: /* switch 1 */ - case 36: /* switch 1 */ + case 35: + case 36: if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) && - ((s32) (u32) arg0->cursor >= 0x24)) { - arg0->cursor--; + ((s32) (u32) arg0->state >= 0x24)) { + arg0->state--; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = -1; + arg0->subState = -1; } if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { - if (arg0->cursor < 0x24) { - arg0->cursor++; + if (arg0->state < 0x24) { + arg0->state++; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } - arg0->unk8 = 1; + arg0->subState = 1; } } if (gControllerOne->buttonPressed & 0x4000) { - arg0->cursor = arg0->unk20 + 0x1E; + arg0->state = arg0->param2 + 0x1E; play_sound2(SOUND_MENU_GO_BACK); } else if (gControllerOne->buttonPressed & 0x9000) { - if (arg0->cursor == 0x00000024) { - arg0->cursor = 0x00000028; - arg0->unk1C = 0; + if (arg0->state == 0x00000024) { + arg0->state = 0x00000028; + arg0->param1 = 0; play_sound2(SOUND_MENU_SELECT); - if (arg0->unk24 < 4.2) { - arg0->unk24 += 4.0; + if (arg0->paramf < 4.2) { + arg0->paramf += 4.0; } } else { - arg0->cursor = arg0->unk20 + 0x1E; + arg0->state = arg0->param2 + 0x1E; play_sound2(SOUND_MENU_GO_BACK); } } break; - case 40: /* switch 1 */ - if (arg0->unk1C == 1) { + case 40: + if (arg0->param1 == 1) { if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, (u8*) gExtCode, &gControllerPak1FileNote) != 0) { - arg0->cursor = 0x00000029; + arg0->state = 0x00000029; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - if (func_800B6178(arg0->unk20) != 0) { - arg0->cursor = 0x00000029; + if (func_800B6178(arg0->param2) != 0) { + arg0->state = 0x00000029; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } } - arg0->unk1C++; - if (arg0->unk1C >= 2) { - arg0->cursor = 0x00000010; + arg0->param1++; + if (arg0->param1 >= 2) { + arg0->state = 0x00000010; } break; } } -void func_800AEC54(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { +void func_800AEC54(MenuItem* arg0) { + switch (arg0->state) { case 0: - arg0->column = (get_string_width(D_800E7780) / 2) + 0x140; + arg0->column = (get_string_width(gTextMenuAnnounceGhost) / 2) + 0x140; arg0->row = 0x000000DA; - arg0->cursor = 1; + arg0->state = 1; func_800C90F4(0U, (D_80162DE4 * 0x10) + 0x29008001); break; case 1: func_800A9208(arg0, 0x000000A0); if (arg0->column == 0x000000A0) { - arg0->cursor = 2; - arg0->unk1C = 0; + arg0->state = 2; + arg0->param1 = 0; } break; case 2: - arg0->unk1C++; - if (arg0->unk1C >= 0x3D) { - arg0->cursor = 3; - arg0->unk1C = 0; + arg0->param1++; + if (arg0->param1 >= 0x3D) { + arg0->state = 3; + arg0->param1 = 0; } break; case 4: - arg0->unk1C++; - if (arg0->unk1C >= 6) { + arg0->param1++; + if (arg0->param1 >= 6) { arg0->type = 0; break; } // Purposeful fallthrough case 3: func_800A94C8(arg0, 0x000000A0, -1); - if (((arg0->column + 0x14) == -(get_string_width(D_800E7780) / 2)) && (arg0->cursor == 3)) { - arg0->cursor = 4; + if (((arg0->column + 0x14) == -(get_string_width(gTextMenuAnnounceGhost) / 2)) && (arg0->state == 3)) { + arg0->state = 4; } break; default: @@ -11793,9 +11858,9 @@ void func_800AEC54(struct_8018D9E0_entry* arg0) { } } -void func_800AEDBC(struct_8018D9E0_entry* arg0) { - if (arg0->unk1C != gTimeTrialDataCourseIndex) { - arg0->unk1C = (s32) gTimeTrialDataCourseIndex; +void func_800AEDBC(MenuItem* arg0) { + if (arg0->param1 != gTimeTrialDataCourseIndex) { + arg0->param1 = (s32) gTimeTrialDataCourseIndex; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2( D_800E7E34[gCupCourseOrder[gTimeTrialDataCourseIndex / 4][gTimeTrialDataCourseIndex % 4]])); @@ -11808,31 +11873,31 @@ void func_800AEDBC(struct_8018D9E0_entry* arg0) { } } -void func_800AEE90(struct_8018D9E0_entry* arg0) { - if (D_8018EDEC != 0xB) { +void func_800AEE90(MenuItem* arg0) { + if (gSubMenuSelection != SUB_MENU_DATA_OPTIONS) { arg0->visible = 0; } else { arg0->visible = 1; } } -void func_800AEEBC(struct_8018D9E0_entry* arg0) { - if (D_8018EDEC != 0xC) { +void func_800AEEBC(MenuItem* arg0) { + if (gSubMenuSelection != SUB_MENU_DATA_ERASE_CONFIRM) { arg0->visible = 0; } else { arg0->visible = 1; } } -void func_800AEEE8(struct_8018D9E0_entry* arg0) { - if (D_8018EDEC != 0xD) { +void func_800AEEE8(MenuItem* arg0) { + if (gSubMenuSelection != SUB_MENU_DATA_CANT_ERASE) { arg0->visible = 0; } else { arg0->visible = 1; } } -void func_800AEF14(struct_8018D9E0_entry* arg0) { +void func_800AEF14(MenuItem* arg0) { if (playerHUD[PLAYER_ONE].raceCompleteBool != 0) { if ((u32) playerHUD[PLAYER_ONE].someTimer < (u32) (func_800B4E24(4) & 0xFFFFF)) { D_8018ED90 = 1; @@ -11841,58 +11906,58 @@ void func_800AEF14(struct_8018D9E0_entry* arg0) { } } -void func_800AEF74(struct_8018D9E0_entry* arg0) { - switch (arg0->cursor) { /* irregular */ +void func_800AEF74(MenuItem* arg0) { + switch (arg0->state) { /* irregular */ case 0: - if (D_80162DF8 == 1) { - arg0->cursor = 1; - arg0->unk1C = 0; + if (gPostTimeTrialReplayCannotSave == 1) { + arg0->state = 1; + arg0->param1 = 0; } else if (playerHUD[PLAYER_ONE].raceCompleteBool == (s8) 1) { - arg0->cursor = 2; + arg0->state = 2; } break; case 2: break; case 1: - arg0->unk1C += 1; + arg0->param1 += 1; if (playerHUD[PLAYER_ONE].raceCompleteBool == 1) { - arg0->cursor = 2; + arg0->state = 2; } break; } } -void func_800AF004(struct_8018D9E0_entry* arg0) { +void func_800AF004(MenuItem* arg0) { UNUSED s32 temp_t1; - switch (arg0->cursor) { + switch (arg0->state) { case 0: - arg0->unk1C += 3; - if (arg0->unk1C >= 0x65) { - arg0->unk1C = 0; - arg0->cursor = 1; + arg0->param1 += 3; + if (arg0->param1 >= 0x65) { + arg0->param1 = 0; + arg0->state = 1; gCupSelection %= 4; gCCSelection %= 4; - add_8018D9E0_entry(0x0000012C, 0, 0, 4); + add_menu_item(MENU_ITEM_TYPE_12C, 0, 0, MENU_ITEM_PRIORITY_4); } break; case 1: case 2: case 3: case 4: - arg0->unk1C += 1; - if (arg0->unk1C >= 9) { - arg0->unk1C = 0; - arg0->cursor++; - add_8018D9E0_entry(arg0->cursor + 0x12B, 0, 0, 4); + arg0->param1 += 1; + if (arg0->param1 >= 9) { + arg0->param1 = 0; + arg0->state++; + add_menu_item(arg0->state + MENU_ITEM_TYPE_12B, 0, 0, MENU_ITEM_PRIORITY_4); } break; case 5: - arg0->unk1C += 1; - if ((arg0->unk1C >= 0x65) && + arg0->param1 += 1; + if ((arg0->param1 >= 0x65) && ((gControllerFive->buttonPressed != 0) || (gControllerFive->stickPressed != 0))) { - arg0->cursor = 6; - arg0->unk1C = 0; + arg0->state = 6; + arg0->param1 = 0; if (D_802874D8.unk1D < 3) { play_sound2(SOUND_MENU_OK_CLICKED); } else { @@ -11904,7 +11969,7 @@ void func_800AF004(struct_8018D9E0_entry* arg0) { func_8009DFE0(0x0000001E); func_800CA330(0x19U); func_800CA388(0x19U); - arg0->cursor = 7; + arg0->state = 7; break; case 7: default: @@ -11912,22 +11977,22 @@ void func_800AF004(struct_8018D9E0_entry* arg0) { } } -void func_800AF1AC(struct_8018D9E0_entry* arg0) { +void func_800AF1AC(MenuItem* arg0) { Unk_D_800E70A0* temp_v0_2; s32 idx = arg0->type - 0x12C; - switch (arg0->cursor) { /* irregular */ + switch (arg0->state) { /* irregular */ case 0: temp_v0_2 = &D_800E7458[idx]; arg0->column = temp_v0_2->column; arg0->row = temp_v0_2->row; - arg0->cursor = 1; + arg0->state = 1; break; case 1: temp_v0_2 = &D_800E7480[idx]; func_800A91D8(arg0, temp_v0_2->column, temp_v0_2->row); if ((arg0->column == temp_v0_2->column) && (arg0->row == temp_v0_2->row)) { - arg0->cursor = 2; + arg0->state = 2; } break; case 2: @@ -11935,7 +12000,7 @@ void func_800AF1AC(struct_8018D9E0_entry* arg0) { } } -void func_800AF270(struct_8018D9E0_entry* arg0) { +void func_800AF270(MenuItem* arg0) { s32 temp_v1; s32 sp30; s32 temp_v0; @@ -11944,31 +12009,31 @@ void func_800AF270(struct_8018D9E0_entry* arg0) { temp_v1 = arg0->type - 0x12C; sp30 = D_802874D8.unk1E; temp_v0 = D_800EFD64[sp30]; - switch (arg0->cursor) { + switch (arg0->state) { case 0: thing = &D_800E7458[temp_v1]; arg0->column = thing->column; arg0->row = thing->row; - arg0->cursor = 1; + arg0->state = 1; break; case 1: thing = &D_800E7480[temp_v1]; func_800A91D8(arg0, thing->column, thing->row); if ((arg0->column == thing->column) && (arg0->row == thing->row)) { - arg0->cursor = 2; - arg0->unk20 = 0; + arg0->state = 2; + arg0->param2 = 0; } break; case 2: - arg0->unk20++; - if (arg0->unk20 >= 0x1F) { + arg0->param2++; + if (arg0->param2 >= 0x1F) { if (D_802874D8.unk1D >= 3) { - arg0->cursor = 4; + arg0->state = 4; func_800CA0B8(); func_800C90F4(0U, (sp30 * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03)); func_800CA0A0(); } else { - arg0->cursor = 3; + arg0->state = 3; func_8009A640(arg0->D_8018DEE0_index, 0, sp30, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_v0])); func_800CA0B8(); @@ -11980,7 +12045,7 @@ void func_800AF270(struct_8018D9E0_entry* arg0) { case 3: if (D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex >= D_800E8440[temp_v0]) { func_8009A640(arg0->D_8018DEE0_index, 0, sp30, segmented_to_virtual_dupe_2(D_800E83A0[temp_v0])); - arg0->cursor = 4; + arg0->state = 4; } break; case 4: @@ -11988,59 +12053,59 @@ void func_800AF270(struct_8018D9E0_entry* arg0) { } } -void func_800AF480(struct_8018D9E0_entry* arg0) { +void func_800AF480(MenuItem* arg0) { s32 idx = arg0->type - 0x190; - if ((D_802850C0[idx].slideDirection == 0) || (D_802850C0[idx].slideDirection != 1)) { + if ((gCreditsTextRenderInfo[idx].slideDirection == 0) || (gCreditsTextRenderInfo[idx].slideDirection != 1)) { func_800AF4DC(arg0); } else { func_800AF740(arg0); } } -void func_800AF4DC(struct_8018D9E0_entry* arg0) { +void func_800AF4DC(MenuItem* arg0) { UNUSED s32 pad; s32 temp_v0; - struct_802850C0_entry* temp_v1; + CreditsRenderInfo* temp_v1; temp_v0 = arg0->type - 0x190; - temp_v1 = &D_802850C0[temp_v0]; + temp_v1 = &gCreditsTextRenderInfo[temp_v0]; arg0->row = temp_v1->row; - switch (arg0->cursor) { + switch (arg0->state) { case 0: arg0->column = temp_v1->startingColumn; - arg0->cursor = 1; - arg0->unk20 = temp_v1->columnExtra + (get_string_width(D_802854B0[temp_v0]) * temp_v1->textScaling / 2); + arg0->state = 1; + arg0->param2 = temp_v1->columnExtra + (get_string_width(gCreditsText[temp_v0]) * temp_v1->textScaling / 2); /* fallthrough */ case 1: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (s32) (arg0->unk20 - arg0->column) / 4; - if (arg0->unk1C >= 9) { - arg0->unk1C = 8; - } - arg0->unk24 = (arg0->unk1C * 0.05) + 1.0; - if (arg0->column >= (arg0->unk20 - 0x14)) { - arg0->cursor = 2; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (s32) (arg0->param2 - arg0->column) / 4; + if (arg0->param1 >= 9) { + arg0->param1 = 8; + } + arg0->paramf = (arg0->param1 * 0.05) + 1.0; + if (arg0->column >= (arg0->param2 - 0x14)) { + arg0->state = 2; arg0->D_8018DEE0_index = 0; } break; case 2: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (arg0->unk20 - arg0->column) / 4; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (arg0->param2 - arg0->column) / 4; arg0->D_8018DEE0_index += 1; - arg0->unk24 = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; - if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->unk24 > 1)) { - arg0->unk24 = 1.0f; - arg0->cursor = 3; + arg0->paramf = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; + if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->paramf > 1)) { + arg0->paramf = 1.0f; + arg0->state = 3; } break; case 3: if ((u8) D_8018ED91 != 0) { - arg0->cursor = 4; + arg0->state = 4; } break; case 4: - func_800A94C8(arg0, arg0->unk20, 1); + func_800A94C8(arg0, arg0->param2, 1); if (arg0->row > 480.0) { arg0->type = 0; } @@ -12050,49 +12115,49 @@ void func_800AF4DC(struct_8018D9E0_entry* arg0) { } } -void func_800AF740(struct_8018D9E0_entry* arg0) { +void func_800AF740(MenuItem* arg0) { UNUSED s32 pad; s32 temp_v0; - struct_802850C0_entry* temp_v1; + CreditsRenderInfo* temp_v1; temp_v0 = arg0->type - 0x190; - temp_v1 = &D_802850C0[temp_v0]; + temp_v1 = &gCreditsTextRenderInfo[temp_v0]; arg0->row = temp_v1->row; - switch (arg0->cursor) { + switch (arg0->state) { case 0: arg0->column = temp_v1->startingColumn; - arg0->cursor = 1; - arg0->unk20 = temp_v1->columnExtra - (get_string_width(D_802854B0[temp_v0]) * temp_v1->textScaling / 2); + arg0->state = 1; + arg0->param2 = temp_v1->columnExtra - (get_string_width(gCreditsText[temp_v0]) * temp_v1->textScaling / 2); /* fallthrough */ case 1: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (s32) (arg0->column - arg0->unk20) / 4; - if (arg0->unk1C >= 9) { - arg0->unk1C = 8; - } - arg0->unk24 = (arg0->unk1C * 0.05) + 1.0; - if ((arg0->unk20 + 0x14) >= arg0->column) { - arg0->cursor = 2; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (s32) (arg0->column - arg0->param2) / 4; + if (arg0->param1 >= 9) { + arg0->param1 = 8; + } + arg0->paramf = (arg0->param1 * 0.05) + 1.0; + if ((arg0->param2 + 0x14) >= arg0->column) { + arg0->state = 2; arg0->D_8018DEE0_index = 0; } break; case 2: - func_800A9208(arg0, arg0->unk20); - arg0->unk1C = (arg0->column - arg0->unk20) / 4; + func_800A9208(arg0, arg0->param2); + arg0->param1 = (arg0->column - arg0->param2) / 4; arg0->D_8018DEE0_index += 1; - arg0->unk24 = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; - if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->unk24 > 1)) { - arg0->unk24 = 1.0f; - arg0->cursor = 3; + arg0->paramf = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; + if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->paramf > 1)) { + arg0->paramf = 1.0f; + arg0->state = 3; } break; case 3: if ((u8) D_8018ED91 != 0) { - arg0->cursor = 4; + arg0->state = 4; } break; case 4: - func_800A94C8(arg0, arg0->unk20, -1); + func_800A94C8(arg0, arg0->param2, -1); if (arg0->row > 480.0) { arg0->type = 0; } diff --git a/src/menu_items.h b/src/menu_items.h new file mode 100644 index 0000000000..ae79816695 --- /dev/null +++ b/src/menu_items.h @@ -0,0 +1,853 @@ +#ifndef CODE_80091750_H +#define CODE_80091750_H + +#include +#include "textures.h" +#include "main.h" + +extern u32 _course_mario_raceway_dl_mio0SegmentRomStart[]; + +/* File specific types */ + +/* +Known `types` for `MenuItem` +0x53: "Mushroom Cup" box on the cup selection screen +0x54: "Flower Cup" box on the cup selection screen +0x55: "Star Cup" box on the cup selection screen +0x56: "Special Cup" box on the cup selection screen +0x5E: A box of static over the course images as the cup selection screen loads in. + It is near unnoticeable though as in practice it doesn't last long enough to be seen. + Try locking the word at `8018DC80` to see something like 0x20 just before confirming character selection to make +it last longer See `func_80096CD8` for the actual drawing of the static +*/ + +typedef struct { + /* 0x00 */ s32 type; // id maybe? + /* 0x04 */ s32 state; // sound mode, maybe some other stuff + /* 0x08 */ s32 subState; // This is used but I can't tell what for + /* 0x0C */ s32 column; + /* 0x10 */ s32 row; + /* 0x14 */ s8 priority; // priority/depth/z-level. Higher values are drawn on top of lower values + // If equal, later entries in gMenuItems are on top + /* 0x15 */ bool8 visible; // active? If 1 its displayed, if 0 its not + // These seem to be generic space available for use by the struct, no 1 purpose for any given member + /* 0x16 */ s16 unused; // Unused + /* 0x18 */ s32 D_8018DEE0_index; // Index in D_8018DEE0, an array of some other struct type + /* 0x1C */ s32 param1; // Multi use. Sometimes cup selection, sometimes course index. + /* 0x20 */ s32 param2; // Multi use, hard to tell what for though. Sometimes a random number, sometimes GP points + /* 0x24 */ f32 paramf; // Multi use, x scaling for some things, rotation multiplier for the question box in some + // menus, probably some other things +} MenuItem; // size = 0x28 + +typedef struct { + /* 0x00 */ MkAnimation* textureSequence; + /* 0x04 */ s32 sequenceIndex; // Index in textureSequence that the animation is currently on + /* 0x08 */ s32 frameCountDown; // Frames left for the given animation part + /* 0x0C */ u32 visible; // visbile if 0x80000000, otherwise invisbile AND paused + /* 0x10 */ s32 menuTextureIndex; // Don't know what sMenuTextureMap tracks + /* 0x14 */ s32 unk14; // Flip flops between 0 and 1, use unknown +} struct_8018DEE0_entry; // size = 0x18 + +typedef struct { + /* 0x0 */ MenuTexture* texture; + /* 0x4 */ s32 texNum; +} struct_8018E060_entry; // size = 0x8 + +typedef struct { + /* 0x0 */ MenuTexture* mk64Texture; + /* 0x4 */ s16 unk4; + /* 0x6 */ s16 unk6; +} struct_8018E0E8_entry; // size = 0x8 + +typedef struct { + /* 0x00 */ u64* textureData; // This should be interpreted as a segmented address + /** + * Its hard to tell what exactly what this is meant to be, + * but it appears to be used as some sort of offset/index from the address stored in gMenuTextureBuffer. + * This value is (roughly) the sum of (width * height) of the + * textures in all the previous entries in sMenuTextureMap + */ + /* 0x04 */ s32 offset; +} TextureMap; // size = 0x08 + +typedef struct { + /* 0x00 */ MenuTexture* textures; + /* 0x04 */ Gfx* displayList; +} struct_8018E768_entry; // size = 0x08 + +struct UnkStruct_8018E7E8 { + /* 0x0 */ s16 x; + /* 0x2 */ s16 y; + /* 0x4 */ s16 unk1; + /* 0x6 */ s16 unk2; +}; // size = 0x8 + +typedef struct { + /* 0x00 */ s16 column; + /* 0x02 */ s16 row; + /* 0x04 */ s16 pad0; + /* 0x06 */ s16 pad1; +} Unk_D_800E70A0; // size = 0x08 + +enum MENU_ITEM_PRIORITY { + MENU_ITEM_PRIORITY_0, + MENU_ITEM_PRIORITY_1, + MENU_ITEM_PRIORITY_2, + MENU_ITEM_PRIORITY_3, + MENU_ITEM_PRIORITY_4, + MENU_ITEM_PRIORITY_5, + MENU_ITEM_PRIORITY_6, + MENU_ITEM_PRIORITY_7, + MENU_ITEM_PRIORITY_8, + MENU_ITEM_PRIORITY_9, + MENU_ITEM_PRIORITY_A, + MENU_ITEM_PRIORITY_B, + MENU_ITEM_PRIORITY_C, + MENU_ITEM_PRIORITY_D, + MENU_ITEM_PRIORITY_E, + MENU_ITEM_PRIORITY_F, + MENU_ITEM_PRIORITY_MAX // 0x10 +}; + +enum CenterText { LEFT_TEXT = 1, CENTER_TEXT_MODE_1, RIGHT_TEXT, CENTER_TEXT_MODE_2 }; + +enum MENU_ITEM_TYPE { + MENU_ITEM_UI_NONE, + MENU_ITEM_UI_START_BACKGROUND, + MENU_ITEM_UI_LOGO_AND_COPYRIGHT, + MENU_ITEM_UI_PUSH_START_BUTTON, + MENU_ITEM_UI_NO_CONTROLLER, + MENU_ITEM_UI_START_RECORD_TIME, + MENU_ITEM_UI_GAME_SELECT = 0xA, + MENU_ITEM_UI_1P_GAME, + MENU_ITEM_UI_2P_GAME, + MENU_ITEM_UI_3P_GAME, + MENU_ITEM_UI_4P_GAME, + MENU_ITEM_UI_OK, + MAIN_MENU_OPTION_GFX, + MAIN_MENU_DATA_GFX, + MAIN_MENU_50CC, + MAIN_MENU_100CC, + MAIN_MENU_150CC, + MAIN_MENU_EXTRA_CC, + MENU_ITEM_TYPE_016, + MENU_ITEM_TYPE_017, + MAIN_MENU_TIME_TRIALS_BEGIN, + MAIN_MENU_TIME_TRIALS_DATA, + MENU_ITEM_TYPE_01B = 0x1B, + MAIN_MENU_BACKGROUND = 0x23, + CHARACTER_SELECT_BACKGROUND, + COURSE_SELECT_BACKGROUND, + CHARACTER_SELECT_MENU_PLAYER_SELECT_BANNER = 0x2A, + CHARACTER_SELECT_MENU_MARIO, + CHARACTER_SELECT_MENU_LUIGI, + CHARACTER_SELECT_MENU_TOAD, + CHARACTER_SELECT_MENU_PEACH, + CHARACTER_SELECT_MENU_YOSHI, + CHARACTER_SELECT_MENU_DK, + CHARACTER_SELECT_MENU_WARIO, + CHARACTER_SELECT_MENU_BOWSER, + CHARACTER_SELECT_MENU_OK, + CHARACTER_SELECT_MENU_1P_CURSOR, + CHARACTER_SELECT_MENU_2P_CURSOR, + CHARACTER_SELECT_MENU_3P_CURSOR, + CHARACTER_SELECT_MENU_4P_CURSOR, + MENU_ITEM_TYPE_043 = 0x43, + MENU_ITEM_TYPE_044, + MENU_ITEM_TYPE_045, + MENU_ITEM_TYPE_046, + MENU_ITEM_TYPE_047, + MENU_ITEM_TYPE_048, + MENU_ITEM_TYPE_049, + MENU_ITEM_TYPE_050 = 0x50, + COURSE_SELECT_MAP_SELECT = 0x52, + COURSE_SELECT_MUSHROOM_CUP, + COURSE_SELECT_FLOWER_CUP, + COURSE_SELECT_STAR_CUP, + COURSE_SELECT_SPECIAL_CUP, + MENU_ITEM_TYPE_058 = 0x58, + COURSE_SELECT_COURSE_NAMES, + MENU_ITEM_TYPE_05A, + MENU_ITEM_TYPE_05B, + COURSE_SELECT_BATTLE_NAMES, + COURSE_SELECT_OK, + MENU_ITEM_TYPE_05E, + MENU_ITEM_TYPE_05F, + MENU_ITEM_TYPE_060, + MENU_ITEM_TYPE_061, + MENU_ITEM_TYPE_062, + MENU_ITEM_TYPE_064 = 0x64, + MENU_ITEM_TYPE_065, + MENU_ITEM_TYPE_066, + MENU_ITEM_TYPE_067, + MENU_ITEM_TYPE_068, + MENU_ITEM_TYPE_069, + MENU_ITEM_TYPE_06E = 0x6E, + MENU_ITEM_TYPE_078 = 0x78, + MENU_ITEM_TYPE_079, + MENU_ITEM_TYPE_07A, + MENU_ITEM_TYPE_07B, + MENU_ITEM_TYPE_07C, + MENU_ITEM_TYPE_07D, + MENU_ITEM_TYPE_07E, + MENU_ITEM_TYPE_07F, + MENU_ITEM_TYPE_080, + MENU_ITEM_TYPE_081, + MENU_ITEM_TYPE_082, + MENU_ITEM_TYPE_083, + MENU_ITEM_TYPE_084, + MENU_ITEM_TYPE_085, + MENU_ITEM_TYPE_086, + MENU_ITEM_TYPE_087, + MENU_ITEM_TYPE_088, + MENU_ITEM_TYPE_089, + MENU_ITEM_TYPE_08A, + MENU_ITEM_TYPE_08B, + MENU_ITEM_TYPE_08C, + MENU_ITEM_TYPE_08D, + MENU_ITEM_TYPE_096 = 0x96, + MENU_ITEM_TYPE_097, + MENU_ITEM_TYPE_098, + MENU_ITEM_TYPE_0A0 = 0xA0, + MENU_ITEM_TYPE_0A1, + MENU_ITEM_TYPE_0AA = 0xAA, + MENU_ITEM_TYPE_0AB, + MENU_ITEM_TYPE_0AC, + MENU_ITEM_TYPE_0AF = 0XAF, + MENU_ITEM_TYPE_0B0, + MENU_ITEM_TYPE_0B1, + MENU_ITEM_TYPE_0B2, + MENU_ITEM_TYPE_0B3, + MENU_ITEM_TYPE_0B4, + MENU_ITEM_TYPE_0B9 = 0xB9, + MENU_ITEM_TYPE_0BA, + MENU_ITEM_TYPE_0BB, + MENU_ITEM_ANNOUNCE_GHOST, + MENU_ITEM_END_COURSE_OPTION, + MENU_ITEM_TYPE_0BE, + MENU_ITEM_PAUSE = 0xC7, + MENU_ITEM_TYPE_0D2 = 0xD2, + MENU_ITEM_TYPE_0D3, + MENU_ITEM_TYPE_0D4, + MENU_ITEM_TYPE_0D5, + MENU_ITEM_TYPE_0D6, + MENU_ITEM_TYPE_0D7, + MENU_ITEM_TYPE_0D8, + MENU_ITEM_TYPE_0D9, + MENU_ITEM_TYPE_0DA, + MENU_ITEM_DATA_COURSE_IMAGE = 0xE6, + MENU_ITEM_DATA_COURSE_INFO, + MENU_ITEM_DATA_COURSE_SELECTABLE, + MENU_ITEM_TYPE_0E9, + MENU_ITEM_TYPE_0EA, + MENU_ITEM_TYPE_0F0 = 0xF0, + MENU_ITEM_TYPE_0F1, + MENU_ITEM_UI_LOGO_INTRO = 0xFA, + START_MENU_FLAG, + MENU_ITEM_TYPE_10E = 0x10E, + MENU_ITEM_TYPE_12B = 0X12B, + MENU_ITEM_TYPE_12C, + MENU_ITEM_TYPE_12D, + MENU_ITEM_TYPE_12E, + MENU_ITEM_TYPE_12F, + MENU_ITEM_TYPE_130, + MENU_ITEM_TYPE_190 = 0x190, + MENU_ITEM_TYPE_191, + MENU_ITEM_TYPE_192, + MENU_ITEM_TYPE_193, + MENU_ITEM_TYPE_194, + MENU_ITEM_TYPE_195, + MENU_ITEM_TYPE_196, + MENU_ITEM_TYPE_197, + MENU_ITEM_TYPE_198, + MENU_ITEM_TYPE_199, + MENU_ITEM_TYPE_19A, + MENU_ITEM_TYPE_19B, + MENU_ITEM_TYPE_19C, + MENU_ITEM_TYPE_19D, + MENU_ITEM_TYPE_19E, + MENU_ITEM_TYPE_19F, + MENU_ITEM_TYPE_1A0, + MENU_ITEM_TYPE_1A1, + MENU_ITEM_TYPE_1A2, + MENU_ITEM_TYPE_1A3, + MENU_ITEM_TYPE_1A4, + MENU_ITEM_TYPE_1A5, + MENU_ITEM_TYPE_1A6, + MENU_ITEM_TYPE_1A7, + MENU_ITEM_TYPE_1A8, + MENU_ITEM_TYPE_1A9, + MENU_ITEM_TYPE_1AA, + MENU_ITEM_TYPE_1AB, + MENU_ITEM_TYPE_1AC, + MENU_ITEM_TYPE_1AD, + MENU_ITEM_TYPE_1AE, + MENU_ITEM_TYPE_1AF, + MENU_ITEM_TYPE_1B0, + MENU_ITEM_TYPE_1B1, + MENU_ITEM_TYPE_1B2, + MENU_ITEM_TYPE_1B3, + MENU_ITEM_TYPE_1B4, + MENU_ITEM_TYPE_1B5, + MENU_ITEM_TYPE_1B6, + MENU_ITEM_TYPE_1B7, + MENU_ITEM_TYPE_1B8, + MENU_ITEM_TYPE_1B9, + MENU_ITEM_TYPE_1BA, + MENU_ITEM_TYPE_1BB, + MENU_ITEM_TYPE_1BC, + MENU_ITEM_TYPE_1BD, + MENU_ITEM_TYPE_1BE, + MENU_ITEM_TYPE_1BF, + MENU_ITEM_TYPE_1C0, + MENU_ITEM_TYPE_1C1, + MENU_ITEM_TYPE_1C2, + MENU_ITEM_TYPE_1C3, + MENU_ITEM_TYPE_1C4, + MENU_ITEM_TYPE_1C5, + MENU_ITEM_TYPE_1C6, + MENU_ITEM_TYPE_1C7, + MENU_ITEM_TYPE_1C8, + MENU_ITEM_TYPE_1C9, + MENU_ITEM_TYPE_1CA, + MENU_ITEM_TYPE_1CB, + MENU_ITEM_TYPE_1CC, + MENU_ITEM_TYPE_1CD, + MENU_ITEM_TYPE_1CE +}; + +enum LoadImgCompType { + LOAD_MENU_IMG_MIO0_ONCE = -1, + LOAD_MENU_IMG_TKMK00_ONCE, + // Force load image even if the data is loaded before + LOAD_MENU_IMG_FORCE = LOAD_MENU_IMG_TKMK00_ONCE, // 0 + LOAD_MENU_IMG_MIO0_FORCE, + LOAD_MENU_IMG_TKMK00_FORCE +}; + +enum TEXT_MENU_ID { CONTINUE_GAME, RETRY, COURSE_CHANGE, DRIVER_CHANGE, QUIT_TEXT_MENU, REPLAY, SAVE_GHOST }; + +/* Function Prototypes */ + +f64 exponent_by_squaring(f64, s32); +f64 menu_pow(f64, f64); +f64 menu_ln(f64); +f64 menu_exponential(f64); +f64 menu_pow2(f64, s32); +f64 normalize_to_unit_interval(f64, s32*); +void swap_values(s32*, s32*); +s32 func_80091D74(void); +void func_80091EE4(void); +void func_80091FA4(void); +void func_80092148(void); +void func_800921B4(void); +void text_rainbow_effect(s32, s32, s32); +void set_text_color_rainbow_if_selected(s32, s32, s32); +void func_80092258(void); +void func_80092290(s32, s32*, s32*); +void func_80092500(void); +void func_80092564(void); +void func_800925A0(void); +void func_800925CC(void); +void func_80092604(void); +void func_80092630(void); +void func_8009265C(void); +void func_80092688(void); +void func_80092C80(void); +s32 char_to_glyph_index(char*); +s32 func_80092DF8(char*); +s32 func_80092E1C(char*); +s32 func_80092EE4(char*); +s32 get_string_width(char*); +void set_text_color(s32); +void func_800930E4(s32, s32, char*); +void print_text0(s32, s32, char*, s32, f32, f32, s32); +void print_text_mode_1(s32, s32, char*, s32, f32, f32); +void print_text_mode_2(s32, s32, char*, s32, f32, f32); +void print_text1(s32, s32, char*, s32, f32, f32, s32); +void print_text1_left(s32, s32, char*, s32, f32, f32); +void print_text1_center_mode_1(s32, s32, char*, s32, f32, f32); +void print_text1_right(s32, s32, char*, s32, f32, f32); +void print_text1_center_mode_2(s32, s32, char*, s32, f32, f32); +void print_text2(s32, s32, char*, s32, f32, f32, s32); +void func_800939C8(s32, s32, char*, s32, f32, f32); +void text_draw(s32, s32, char*, s32, f32, f32); +void func_80093A30(s32); +void func_80093A5C(u32); +void func_80093B70(u32); +void func_80093C1C(s32); +void func_80093C88(void); +void func_80093C90(void); +void func_80093C98(s32); +void func_80093E20(void); +void func_80093E40(void); +void func_80093E60(void); +void func_80093F10(void); +void func_800940EC(s32); +void func_800942D0(void); +void func_80094660(struct GfxPool*, s32); +void render_checkered_flag(struct GfxPool*, s32); +void func_80094A64(struct GfxPool*); +void setup_menus(void); +void func_80095574(void); +Gfx* draw_flash_select_case(Gfx*, s32, s32, s32, s32, s32); +Gfx* draw_flash_select_case_slow(Gfx*, s32, s32, s32, s32); +Gfx* draw_flash_select_case_fast(Gfx*, s32, s32, s32, s32); +Gfx* func_800959F8(Gfx*, Vtx*); +Gfx* func_80095BD0(Gfx*, u8*, f32, f32, u32, u32, f32, f32); +Gfx* func_80095E10(Gfx*, s8, s32, s32, s32, s32, s32, s32, s32, s32, u8*, u32, u32); +Gfx* func_800963F0(Gfx*, s8, s32, s32, f32, f32, s32, s32, s32, s32, s32, s32, u8*, u32, u32); +Gfx* func_80096CD8(Gfx* displayListHead, s32 xPos, s32 yPos, u32 width, u32 height); +Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, + s32 arg9, u16* argA, u32 argB, u32 argC, s32 argD); +Gfx* func_80097A14(Gfx*, s8, s32, s32, s32, s32, s32, s32, u8*, u32, u32); +Gfx* func_80097AE4(Gfx*, s8, s32, s32, u8*, s32); +Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u32 arg5, s32 arg6, s32 arg7, + u8* someTexture, u32 arg9, u32 argA, s32 width); +Gfx* func_80098558(Gfx*, u32, u32, u32, u32, u32, u32, s32, s32); +Gfx* func_800987D0(Gfx*, u32, u32, u32, u32, s32, s32, u8*, u32, s32); +Gfx* draw_box_fill(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32); +Gfx* draw_box(Gfx*, s32, s32, s32, s32, u32, u32, u32, u32); +Gfx* func_80098FC8(Gfx*, s32, s32, s32, s32); +void dma_copy_base_729a30(u64*, size_t, void*); +void dma_copy_base_7fa3c0(u64*, size_t, void*); +void clear_menu_textures(void); +void load_menu_img(MenuTexture*); +void* segmented_to_virtual_dupe(const void*); +void* segmented_to_virtual_dupe_2(const void*); +void load_menu_img_mio0_forced(MenuTexture*); +void load_menu_img_comp_type(MenuTexture*, s32); +void func_80099958(MenuTexture*, s32, s32); +void func_80099E54(void); +void func_80099E60(MenuTexture*, s32, s32); +void func_80099EC4(void); +void func_80099A70(void); +void func_80099A94(MenuTexture*, s32); +void func_80099AEC(void); +void func_8009A238(MenuTexture*, s32); +void func_8009A2F0(struct_8018E0E8_entry*); +void func_8009A344(void); +s32 animate_character_select_menu(MkAnimation*); +s32 func_8009A478(MkAnimation*, s32); +void func_8009A594(s32, s32, MkAnimation*); +void func_8009A640(s32, s32, s32, MkAnimation*); +void func_8009A6D4(void); +void func_8009A76C(s32, s32, s32, s32); +void func_8009A7EC(s32, s32, s32, s32, s32); +MenuTexture* func_8009A878(struct_8018DEE0_entry*); +MenuTexture* func_8009A944(struct_8018DEE0_entry*, s32); +void func_8009A9FC(s32, s32, u32, s32); +void func_8009AB7C(s32); +void func_8009AD78(s32, s32); +void convert_img_to_greyscale(s32, u32); +void adjust_img_colour(s32, s32, s32, s32, s32); +u16* func_8009B8C4(u64*); +void func_8009B938(void); +void func_8009B954(MenuTexture*); +void func_8009B998(void); +Gfx* func_8009B9D0(Gfx*, MenuTexture*); +Gfx* render_menu_textures(Gfx*, MenuTexture*, s32, s32); +Gfx* func_8009BC9C(Gfx*, MenuTexture*, s32, s32, s32, s32); +Gfx* print_letter(Gfx*, MenuTexture*, f32, f32, s32, f32, f32); +Gfx* func_8009C204(Gfx*, MenuTexture*, s32, s32, s32); +Gfx* func_8009C434(Gfx*, struct_8018DEE0_entry*, s32, s32, s32); +Gfx* func_8009C708(Gfx*, struct_8018DEE0_entry*, s32, s32, s32, s32); +void func_8009C918(void); +void func_8009CA2C(void); +void func_8009CA6C(s32); +void draw_fade_in(s32, s32, s32); +void draw_black_fade_in(s32, s32); +void draw_white_fade_in(s32, s32); +void func_8009CE1C(void); +void func_8009CE64(s32); +void func_8009D77C(s32, s32, s32); +void func_8009D958(s32, s32); +void func_8009D978(s32, s32); +void func_8009D998(s32); +void func_8009DAA8(void); +void func_8009DB8C(void); +void func_8009DEF8(u32, u32); +void func_8009DF4C(s32); +void func_8009DF6C(s32); +void func_8009DF8C(u32, u32); +void func_8009DFE0(s32); +void func_8009E000(s32); +void func_8009E020(s32, s32); +void func_8009E088(s32, s32); +void func_8009E0F0(s32); +void func_8009E1C0(void); +void func_8009E1E4(void); +void func_8009E208(void); +void func_8009E230(void); +void func_8009E258(void); +void func_8009E280(void); +void func_8009E2A8(s32); +void func_8009E2F0(s32); +void func_8009E5BC(void); +void func_8009E5FC(s32); +void clear_menus(void); +void add_menu_item(s32, s32, s32, s8); +void render_menus(MenuItem*); +void func_800A08D8(u8, s32, s32); +s32 func_800A095C(char*, s32, s32, s32); +void func_800A09E0(MenuItem*); +void func_800A0AD0(MenuItem*); +void func_800A0B80(MenuItem*); +void func_800A0DFC(void); +void func_800A0EB8(MenuItem*, s32); +void func_800A0FA4(MenuItem*, s32); +void func_800A10CC(MenuItem*); +void render_cursor_player(MenuItem*, s32, s32); +void func_800A12BC(MenuItem*, MenuTexture*); +void func_800A1350(MenuItem*); +void func_800A143C(MenuItem*, s32); +void func_800A1500(MenuItem*); +void func_800A15EC(MenuItem*); +void func_800A1780(MenuItem*); +void render_menu_item_data_course_image(MenuItem*); +void render_menu_item_data_course_info(MenuItem*); +void menu_item_data_course_selectable(MenuItem*); +void func_800A1DE0(MenuItem*); +void func_800A1F30(MenuItem*); +void func_800A1FB0(MenuItem*); +void func_800A2D1C(MenuItem*); +void func_800A2EB8(MenuItem*); +void func_800A32B4(s32, s32, s32, s32); +void func_800A34A8(MenuItem*); +void func_800A3A10(s8*); +void func_800A3ADC(MenuItem*, s32, s32, s32, s32, s8*); +void time_trials_finish_text_render(MenuItem*); +void func_800A3E60(MenuItem*); +void render_lap_time(s32, s32, s32); +void render_lap_times(s32, s32, s32); +void render_menu_item_announce_ghost(MenuItem*); +void render_pause_menu(MenuItem*); +void render_pause_menu_time_trials(MenuItem*); +void render_pause_menu_versus(MenuItem*); +void render_pause_grand_prix(MenuItem*); +void render_pause_battle(MenuItem*); +void func_800A54EC(void); +void render_menu_item_end_course_option(MenuItem*); +void func_800A6034(MenuItem*); +void func_800A6154(MenuItem*); +void func_800A638C(MenuItem*); +void func_800A66A8(MenuItem*, Unk_D_800E70A0*); +void func_800A69C8(MenuItem*); +void func_800A6BEC(MenuItem*); +void func_800A6CC0(MenuItem*); +void func_800A6D94(s32, s32, u8*); +void func_800A6E94(s32, s32, u8*); +void func_800A70E8(MenuItem*); +void func_800A7258(MenuItem*); +void func_800A72FC(MenuItem*); +void func_800A7448(MenuItem*); +void func_800A75A0(MenuItem*); +void func_800A761C(MenuItem*); +void menu_item_credits_render(MenuItem*); +void convert_number_to_ascii(s32, char*); +void write_dashes(char*); +void get_time_record_minutes(s32, char*); +void get_time_record_seconds(s32, char*); +void get_time_record_centiseconds(s32, char*); +void func_800A79F4(s32, char*); +void handle_menus_with_pri_arg(s32); +void handle_menus_default(void); +void handle_menus_special(void); +void func_800A8270(s32, MenuItem*); +void func_800A8564(MenuItem*); +void func_800A86E8(MenuItem*); +void func_800A874C(MenuItem*); +void func_800A890C(s32, MenuItem*); +void func_800A8A98(MenuItem*); +void func_800A8CA4(MenuItem*); +void render_battle_introduction(MenuItem*); +void func_800A8EC0(MenuItem*); +void func_800A8F48(MenuItem*); +void func_800A90D4(s32, MenuItem*); +void func_800A91D8(MenuItem*, s32, s32); +void func_800A9208(MenuItem*, s32); +void func_800A9278(MenuItem*, s32); +void func_800A92E8(MenuItem*, s32); +void func_800A939C(MenuItem*, s32); +void func_800A940C(MenuItem*, s32); +void func_800A94C8(MenuItem*, s32, s32); +void func_800A954C(MenuItem*); +void func_800A9710(MenuItem*); +void func_800A97BC(MenuItem*); +void update_ok_menu_item(MenuItem*); +void func_800A9B9C(MenuItem*); +void func_800A9C40(MenuItem*); +void func_800A9D5C(MenuItem*); +void func_800A9E58(MenuItem*); +void func_800AA280(MenuItem*); +void func_800AA2EC(MenuItem*); +void func_800AA5C8(MenuItem*, s8); +void func_800AA69C(MenuItem*); +void func_800AAA9C(MenuItem*); +void func_800AAB90(MenuItem*); +void func_800AAC18(MenuItem*); +void update_cursor(MenuItem*); +void func_800AAE18(MenuItem*); +MenuItem* get_menu_item_player_count(void); +MenuItem* get_menu_item_character(s32); +MenuItem* find_menu_items_dupe(s32); +MenuItem* find_menu_items(s32); +s32 get_character_menu_state(s32); +void hover_cursor_over_character_portrait(MenuItem*, s32); +s32 func_800AAFCC(s32); +void func_800AB020(MenuItem*); +void func_800AB098(MenuItem*); +void func_800AB164(MenuItem*); +void func_800AB260(MenuItem*); +void func_800AB290(MenuItem*); +void func_800AB314(MenuItem*); +void func_800AB904(MenuItem*); +void func_800AB9B0(MenuItem*); +void func_800ABAE8(MenuItem*); +void func_800ABB24(MenuItem*); +void func_800ABBCC(MenuItem*); +void func_800ABC38(MenuItem*); +void func_800ABCF4(MenuItem*); +void func_800ABEAC(MenuItem*); +void func_800ABF68(MenuItem*); +void func_800AC128(MenuItem*); +void func_800AC300(MenuItem*); +void func_800AC324(MenuItem*); +void func_800AC458(MenuItem*); +void func_800AC978(MenuItem*); +void func_800ACA14(MenuItem*); +void func_800ACC50(MenuItem*); +void func_800ACF40(MenuItem*); +void func_800AD1A4(MenuItem*); +void func_800AD2E8(MenuItem*); +void func_800ADF48(MenuItem*); +void func_800AE218(MenuItem*); +void func_800AEC54(MenuItem*); +void func_800AEDBC(MenuItem*); +void func_800AEE90(MenuItem*); +void func_800AEEBC(MenuItem*); +void func_800AEEE8(MenuItem*); +void func_800AEF14(MenuItem*); +void func_800AEF74(MenuItem*); +void func_800AF004(MenuItem*); +void func_800AF1AC(MenuItem*); +void func_800AF270(MenuItem*); +void func_800AF480(MenuItem*); +void func_800AF4DC(MenuItem*); +void func_800AF740(MenuItem*); + +// This really, really shouldn't be in this header file, but I don't know where else to put it +void rmonPrintf(const char*, ...); +void tkmk00decode(u32*, u8*, u16*, s32); + +/* File specific defines */ + +#define MENU_ITEMS_MAX 0x20 +#define D_8018DEE0_SIZE 0x10 +#define D_8018E060_SIZE 0x10 +#define D_8018E0E8_SIZE 0x05 +#define TEXTURE_MAP_MAX 0xC8 +#define D_8018E768_SIZE 0x08 +#define D_8018E7E8_SIZE 0x05 +#define D_8018E810_SIZE 0x05 + +/* This is where I'd put my static data, if I had any */ + +extern s32 D_800DDB24; +extern s16 gGetPlayerByCharacterId[]; + +extern u16* gMenuTextureBuffer; +extern u32* gMenuCompressedBuffer; +extern u8* sTKMK00_LowResBuffer; +extern u8* sGPPointsCopy; +extern void* gSomeDLBuffer; +extern s8 gGPPointsByCharacterId[8]; +extern s8 gCharacterIdByGPOverallRank[]; +extern s8 D_8018D9D8; +extern s8 D_8018D9D9; +extern MenuItem gMenuItems[MENU_ITEMS_MAX]; +extern struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; +extern struct_8018E060_entry D_8018E060[D_8018E060_SIZE]; +extern struct_8018E0E8_entry D_8018E0E8[D_8018E0E8_SIZE]; +extern s32 sMenuTextureBufferIndex; +extern TextureMap sMenuTextureMap[TEXTURE_MAP_MAX]; +extern s32 sMenuTextureEntries; +extern Gfx* sGfxPtr; +extern s32 gNumD_8018E768Entries; +extern struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; +extern s32 gCycleFlashMenu; +extern s8 gTransitionType[]; +extern u32 gTransitionDuration[]; +extern u32 gCurrentTransitionTime[]; +extern s32 D_8018E7E0; +extern struct UnkStruct_8018E7E8 D_8018E7E8[D_8018E7E8_SIZE]; +extern struct UnkStruct_8018E7E8 D_8018E810[D_8018E810_SIZE]; +extern s8 gTextColor; +extern u8 D_8018ED90; +extern u8 D_8018ED91; +extern s8 D_8018E838[]; +extern s32 D_8018E840[]; +extern s32 D_8018E850[]; +extern s32 D_8018E854; +extern s32 D_8018E858[]; +extern s32 D_8018E85C; + +extern u8 _textures_0aSegmentRomStart[]; +extern u8 _textures_0bSegmentRomStart[]; + +extern Unk_D_800E70A0 D_800E70A0[]; +extern Unk_D_800E70A0 D_800E70E8[]; +extern Unk_D_800E70A0 D_800E7108[][4]; +extern Unk_D_800E70A0 D_800E7148[]; +extern Unk_D_800E70A0 D_800E7168[]; +extern Unk_D_800E70A0 D_800E7188[]; +extern Unk_D_800E70A0 D_800E7208[][2]; +extern Unk_D_800E70A0 D_800E7248[]; +extern Unk_D_800E70A0 D_800E7258[]; +extern Unk_D_800E70A0 D_800E7268[]; +extern Unk_D_800E70A0 D_800E7278[]; +extern Unk_D_800E70A0 D_800E72F8; +extern Unk_D_800E70A0 D_800E7300[]; +extern Unk_D_800E70A0 D_800E7360[]; +extern Unk_D_800E70A0 D_800E7380[]; +extern Unk_D_800E70A0 D_800E7390[]; +extern Unk_D_800E70A0 D_800E73C0[]; +extern Unk_D_800E70A0 D_800E73D0[]; +extern Unk_D_800E70A0 D_800E73E0[]; +extern Unk_D_800E70A0 D_800E7410[]; +extern Unk_D_800E70A0 D_800E7420[]; +extern Unk_D_800E70A0 D_800E7430[]; +extern Unk_D_800E70A0 D_800E7458[]; +extern Unk_D_800E70A0 D_800E7480[]; +extern RGBA16 D_800E74A8[]; +extern RGBA16 D_800E74D0[]; +extern RGBA16 gBackgroundColor[]; +extern const s16 gGlyphDisplayWidth[]; +extern char* gCupNames[]; +extern char* gCourseNamesDup2[]; +// Maps course IDs (as defined in the COURSES enum) to an index in a given cup's track order +extern const s8 gPerCupIndexByCourseId[]; // D_800EFD50 +extern const s8 D_800EFD64[]; +extern s8 gCupSelectionByCourseId[]; +extern char* gCupText[]; +extern char* gDebugCharacterNames[]; +extern char* D_800E76A8[]; +extern char* D_800E76CC[]; +extern char* D_800E76DC[]; +extern char* gDebugScreenModeNames[]; +extern char* gDebugSoundModeNames[]; +extern char* gSoundModeNames[]; // D_800E7710 +extern char* gWinLoseText[]; +extern char* gBestTimeText[]; +extern char* gLapTimeText; +extern char* gPrefixTimeText[]; +extern char* D_800E7744[]; +extern char* gTextPauseButton[]; +extern char* D_800E7778[]; +extern char gTextMenuAnnounceGhost[]; +extern char* D_800E77A0[]; +extern char* gTextBattleIntroduction[]; +extern char gTextMenuData[]; +extern char D_800E77D8[]; +extern char* sCourseLengths[]; +extern char* gTextMenuOption[]; +extern char* D_800E7840[]; +extern char* gEraseBestGhostText[]; +extern char* D_800E7860[]; +extern char* gTextOptionMenu[]; +extern char* D_800E7878[]; +extern char* D_800E7884[]; +extern char* D_800E7890[]; +extern char* D_800E78D0[]; +extern char* D_800E7900[]; +extern char* D_800E7918[]; +extern char* D_800E7920[]; +extern char* D_800E7928[]; +extern char* D_800E7930[]; +extern char* D_800E7938[]; +extern char* D_800E7940[]; +extern char* D_800E7980[]; +extern char* D_800E798C[]; +extern char* D_800E7A34[]; +extern char* D_800E7A3C[]; +extern char* D_800E7A44; +extern char* D_800E7A48[]; +extern char* D_800E7A54[]; +extern char* D_800E7A60[]; +extern char* D_800E7A6C[]; +extern char* D_800E7A74[]; +extern char* D_800E7A80[]; +extern char* D_800E7A88[]; +extern char* D_800E7A98; +extern char* D_800E7A9C[]; +extern char* gPlaceText[]; +extern const s8 gGPPointRewards[]; +extern const s8 D_800F0B1C[]; +extern const s8 D_800F0B28[]; +extern const s8 D_800F0B50[]; +extern const s8 D_800F0B54[]; +extern RGBA16 D_800E7AC8[]; +extern RGBA16 D_800E7AE8[]; +extern MenuTexture* D_800E7AF8[]; +extern MenuTexture* D_800E7D0C[]; +extern MkAnimation* D_800E7D34[]; +extern MenuTexture* gMenuTexturesBackground[]; +extern MenuTexture* D_800E7D54[]; +extern MenuTexture* D_800E7D74[]; +extern MenuTexture* D_800E7DC4[]; +extern MkAnimation* D_800E7E14[]; +extern MkAnimation* D_800E7E20[]; +extern MkAnimation* D_800E7E34[]; +extern MenuTexture* gGlyphTextureLUT[]; +extern MenuTexture* D_800E7FF0[]; +extern MenuTexture* D_800E80A0[]; +extern MenuTexture* D_800E8114[]; +extern MenuTexture* D_800E8174[]; +extern MenuTexture* D_800E817C[]; +extern MenuTexture* D_800E81E4[]; +extern MenuTexture* D_800E822C[]; +extern MenuTexture* D_800E8234[]; +extern MenuTexture* D_800E8254[]; +extern MenuTexture* D_800E8274[]; +extern MenuTexture* D_800E8294[]; +extern MenuTexture* gMenuTexturesBorderPlayer[]; +extern MenuTexture* gMenuTexturesTrackSelection[]; +extern MenuTexture* D_800E82F4[]; +extern MkAnimation* D_800E8320[]; +extern MkAnimation* D_800E8340[]; +extern MkAnimation* D_800E8360[]; +extern MkAnimation* gCharacterCelebrateAnimation[]; +extern MkAnimation* D_800E83A0[]; +extern MkAnimation* gCharacterDeselectAnimation[]; +extern MkAnimation* gCharacterSingleBlinkAnimation[]; +extern MkAnimation* gCharacterDoubleBlinkAnimation[]; +extern MkAnimation* gCharacterDefeatAnimation[]; +extern s32 D_800E8440[]; +extern s32 D_800E8460[]; +extern s32 D_800E8480[]; +extern s32 D_800E84A0[]; +extern Vtx* D_800E84C0[]; +extern Gfx* D_800E84CC[]; +extern Gfx* D_800E84EC[]; +extern Gfx* D_800E850C[]; +extern s8 D_800E852C; +extern f32 sIntroModelMotionSpeed; +extern f32 sIntroModelSpeed; +extern Unk_D_800E70A0 D_800E8538[]; +extern Unk_D_800E70A0 D_800E8540[]; +extern Unk_D_800E70A0 D_800E85C0[]; +extern Unk_D_800E70A0 D_800E8600[]; + +extern s32 gControllerPak1NumPagesFree; +extern s32 gControllerPak1FileNote; +extern s32 gControllerPak2FileNote; + +extern f32 D_8018ED98; +extern f32 D_8018ED9C; +extern f32 D_8018EDA0; + +extern f32 D_8018EDA4; +extern f32 D_8018EDA8; +extern f32 D_8018EDAC; + +#endif diff --git a/src/menus.c b/src/menus.c index 1dcb6e5c2b..20435500a6 100644 --- a/src/menus.c +++ b/src/menus.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "menus.h" #include "main.h" @@ -10,87 +11,109 @@ #include "actors.h" #include "audio/external.h" #include "code_800029B0.h" -#include "code_80005FD0.h" -#include "code_80091750.h" +#include "cpu_vehicles_camera_path.h" +#include "menu_items.h" #include "code_800AF9B0.h" #include "save.h" -#include "staff_ghosts.h" +#include "replays.h" #include "save_data.h" #include #include "spawn_players.h" +#include "seq_ids.h" + +#if ENABLE_DEBUG_MODE +#define DEBUG_MODE_TOGGLE true +#define DEBUG_MENU_SELECTION DEBUG_MENU_DEBUG_MODE +#else +#define DEBUG_MODE_TOGGLE false +#define DEBUG_MENU_SELECTION DEBUG_MENU_DISABLED +#endif /** BSS **/ -s32 D_8018EDC0; -f32 D_8018EDC4; -f32 D_8018EDC8; -f32 D_8018EDCC; -f32 D_8018EDD0; -f32 D_8018EDD4; -f32 D_8018EDD8; -f32 D_8018EDDC; -s32 D_8018EDE0; -s8 gCharacterGridSelections[4]; // map from player id to current grid position -bool8 D_8018EDE8[4]; // map player id to isCharSelected on CSS -s8 D_8018EDEC; -s8 gMainMenuSelectionDepth; -s8 D_8018EDEE; // grid screen state? +// Variables used to maniplate the model for Intro Logo +// and checkerboard on the start screen +s32 gIntroModelZEye; +f32 gIntroModelScale; // XYZ scale on checkerboard flag, Z scale on intro logo +f32 gIntroModelRotX; +f32 gIntroModelRotY; +f32 gIntroModelRotZ; +f32 gIntroModelPosX; +f32 gIntroModelPosY; +f32 gIntroModelPosZ; + +s32 gMenuFadeType; +s8 gCharacterGridSelections[4]; // Map from each player to current grid position (1-4 top, 5-8 bottom) +bool8 gCharacterGridIsSelected[4]; // Sets true if a character is selected for each player +s8 gSubMenuSelection; // Map Select states, Options and Ghost Data text selection +s8 gMainMenuSelection; +s8 gPlayerSelectMenuSelection; s8 gDebugMenuSelection; s8 gControllerPakMenuSelection; -s8 D_8018EDF1; +s8 gScreenModeListIndex; // 0-4 index, selects a screen mode in sScreenModePlayerTable u8 gSoundMode; -s8 gPlayerCount; // main menu row id? but it is also the number of players define -s8 D_8018EDF4; -s8 D_8018EDF5; -s8 D_8018EDF6; +s8 gPlayerCount; +s8 gVersusResultCursorSelection; // 4 options indexed (10-13), gets set when selecting an option +s8 gTimeTrialsResultCursorSelection; // 5 options indexed (5-9), gets set when selecting an option (excluding Save + // Ghost) +s8 gBattleResultCursorSelection; // 4 options indexed (10-13), gets set when selecting an option s8 gTimeTrialDataCourseIndex; -s8 gCourseRecordsMenuSelection; -s8 D_8018EDF9; +s8 gCourseRecordsMenuSelection; // Used for selecting an option in course record data +s8 gCourseRecordsSubMenuSelection; // Used for erase records and ghosts (Quit - Erase) s8 gDebugGotoScene; -s8 D_8018EDFB; -s8 D_8018EDFC; +bool8 gGhostPlayerInit; +bool8 gCourseMapInit; s32 gMenuTimingCounter; s32 gMenuDelayTimer; -s8 D_8018EE08; +s8 gDemoUseController; // Sets true alongside gDemoMode, controller related s8 gCupSelection; -s8 D_8018EE0A; +s8 sTempCupSelection; // Same as gCupSelection but it's only set in map select, not referenced s8 gCourseIndexInCup; -s8 D_8018EE0C; -struct_8018EE10_entry D_8018EE10[2]; +s8 unref_8018EE0C; // Set to 0 but never referenced /** Data **/ s32 gMenuSelection = LOGO_INTRO_MENU; -s32 D_800E86A4 = 0; +s32 gFadeModeSelection = FADE_MODE_NONE; + +// Default selected character for each player s8 gCharacterSelections[4] = { MARIO, LUIGI, YOSHI, TOAD }; -// gGameModeRowSelectionForNumPlayers is (D_800E86AC - 1) -// gGameModeSubMenuRowSelectionForNumPlayers (D_800E86AC + 1) +// The current row selected in the mode column for each player indexed +// 0-1 1p / 0-2 2p´/ 0-1 3p / 0-1 4p +s8 gGameModeMenuColumn[4] = { 0, 0, 0, 0 }; -// the current row selected in column i on main menu -s8 D_800E86AC[4] = { 0, 0, 0, 0 }; // For Grand Prix and Versus, this will be the CC mode selected. For Time Trials, it will // be whether 'Begin' or 'Data' is selected. Not used for Battle. // indexed as [column][row] -s8 D_800E86B0[4][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; +s8 gGameModeSubMenuColumn[4][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; s8 gNextDemoId = 0; -s8 gControllerPakSelectedTableRow = 0; -s8 D_800E86C4[12] = { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 }; -s8 D_800E86D0[16] = { 0 }; // this doesn't make a lot of sense... -s8 unref_800E86E0[4] = { 0, 0, 0, 1 }; +s8 gControllerPakSelectedTableRow = 0; // 0-4 index, value of the current visible row select + +// Numbers starting from the second 0 to number 6 get altered +// as you move up or down the page table of content (min value is 0, max value is 16 +s8 gControllerPakVisibleTableRows[12] = { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 }; + +s8 gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_NONE; // 1 is down, 2 is up +s8 unref_D_800E86D4[12] = { 0 }; +s8 unref_D_800E86E0[4] = { 0, 0, 0, 1 }; -u32 sVIGammaOffDitherOn = OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON; +u32 sVIGammaOffDitherOn = (OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON); -// Used to set gScreenModeSelection; might be smaller; could be function static data -const s8 D_800F2B50[] = { 0, 1, 2, 3, 3 }; +/** RoData **/ -// Set to gPlayerCount, then that sets gPlayerCountSelection1 -const s8 D_800F2B58[] = { 1, 2, 2, 3, 4 }; +// Sets the actual screen mode based on values set in sScreenModePlayerCount +const s8 sScreenModePlayerTable[] = { SCREEN_MODE_1P, SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL, + SCREEN_MODE_2P_SPLITSCREEN_VERTICAL, SCREEN_MODE_3P_4P_SPLITSCREEN, + SCREEN_MODE_3P_4P_SPLITSCREEN }; + +// Sets how many players can load on each screen mode set in sScreenModePlayerTable +const s8 sScreenModePlayerCount[] = { 1, 2, 2, 3, 4 }; // Set indexed slots numbers for one-two-three-four mode selection const s8 gPlayerModeSelection[] = { 1, 2, 1, 1 }; // Limit for each index column in one-two-three-four mode selection -const s8 gGameModePlayerColumnDefault[][3] = { +const s8 sGameModePlayerColumnDefault[][3] = { { 2, 1, 0 }, // 1p (GP options, TT options, ...) { 2, 2, 0 }, // 2p (GP options, VS options, Battle) { 2, 0, 0 }, // 3p (VS options, Battle, ...) @@ -99,7 +122,7 @@ const s8 gGameModePlayerColumnDefault[][3] = { // Limit for each index column in one-two-three-four mode selection // for extra mode (mirror mode), hence the extra value (3 instead of 2) -const s8 gGameModePlayerColumnExtra[][3] = { +const s8 sGameModePlayerColumnExtra[][3] = { { 3, 1, 0 }, // 1p (GP options, TT options, ...) { 3, 3, 0 }, // 2p (GP options, VS options, Battle) { 3, 0, 0 }, // 3p (VS options, Battle, ...) @@ -114,8 +137,9 @@ const s32 gGameModePlayerSelection[][3] = { { VERSUS, BATTLE, 0x00000000 }, // 4p game modes }; -// map from character grid position id to character id -const s8 D_800F2BAC[] = { +// Map from character grid position id to character id +// Note: changing order doesn't affect graphics, only the selection +const s8 sCharacterGridOrder[] = { MARIO, LUIGI, PEACH, TOAD, YOSHI, DK, WARIO, BOWSER, }; @@ -132,24 +156,27 @@ const s16 gCupCourseOrder[5][4] = { { COURSE_BIG_DONUT, COURSE_BLOCK_FORT, COURSE_DOUBLE_DECK, COURSE_SKYSCRAPER }, }; -const s8 D_800F2BDC[4] = { 1, 0, 0, 0 }; -const s8 D_800F2BE0[4] = { 0, 1, 3, 4 }; +const s8 unref_800F2BDC[4] = { 1, 0, 0, 0 }; + +// Uses player count to set gScreenModeListIndex, the latter variable then selects a mode +// from sScreenModePlayerTable, note the 2 is not set since that's for vertical 2p screen +const s8 sScreenModeIdxFromPlayerMode[4] = { 0, 1, 3, 4 }; -const union GameModePack gSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_UNUSED, SOUND_MONO } }; +const union GameModePack sSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_UNUSED, SOUND_MONO } }; /**************************/ /** + * General menu main handler * Includes opening logo and splash screens */ void update_menus(void) { u16 controllerIdx; - if (D_800E86A4 == 0) { + if (gFadeModeSelection == FADE_MODE_NONE) { for (controllerIdx = 0; controllerIdx < 4; controllerIdx++) { - // Debug, quick jump through menus using the start button. - if ((func_800B4520() == 0) && (gEnableDebugMode) && + if ((is_screen_being_faded() == 0) && (gEnableDebugMode) && ((gControllers[controllerIdx].buttonPressed & START_BUTTON) != 0)) { // this is certainly a way to write these... switch (gMenuSelection) { @@ -157,7 +184,7 @@ void update_menus(void) { func_800CA330(0x19); // deliberate (?) fallthru case MAIN_MENU: - case PLAYER_SELECT_MENU: + case CHARACTER_SELECT_MENU: play_sound2(SOUND_MENU_OK_CLICKED); break; } @@ -198,7 +225,7 @@ void update_menus(void) { main_menu_act(&gControllers[controllerIdx], controllerIdx); break; case PLAYER_SELECT_MENU_FROM_QUIT: - case PLAYER_SELECT_MENU: + case CHARACTER_SELECT_MENU: player_select_menu_act(&gControllers[controllerIdx], controllerIdx); break; case COURSE_SELECT_MENU_FROM_QUIT: @@ -210,13 +237,15 @@ void update_menus(void) { } } -// navigation of the options menu -void options_menu_act(struct Controller* controller, u16 arg1) { +/** + * Navigation of the options menu + */ +void options_menu_act(struct Controller* controller, u16 controllerIdx) { u16 btnAndStick; // sp3E - struct_8018D9E0_entry* sp38; + MenuItem* sp38; s32 res; struct_8018EE10_entry* sp30; - bool sp2C; // cursorWasMoved or communicateStoredAction + bool tempVar; // cursorWasMoved or communicateStoredAction UNUSED u32 pad; btnAndStick = (controller->buttonPressed | controller->stickPressed); @@ -225,53 +254,53 @@ void options_menu_act(struct Controller* controller, u16 arg1) { btnAndStick |= A_BUTTON; } - if (!func_800B4520()) { - sp38 = find_8018D9E0_entry_dupe(0xF0); - sp30 = (struct_8018EE10_entry*) D_8018D9C0; - switch (D_8018EDEC) { - case 0x15: - case 0x16: - case 0x17: - case 0x18: { - sp2C = false; - if ((btnAndStick & D_JPAD) && (D_8018EDEC < 0x18)) { - D_8018EDEC += 1; + if (!is_screen_being_faded()) { + sp38 = find_menu_items_dupe(0xF0); + sp30 = (struct_8018EE10_entry*) gSomeDLBuffer; + switch (gSubMenuSelection) { + case SUB_MENU_OPTION_RETURN_GAME_SELECT: + case SUB_MENU_OPTION_SOUND_MODE: + case SUB_MENU_OPTION_COPY_CONTROLLER_PAK: + case SUB_MENU_OPTION_ERASE_ALL_DATA: { + tempVar = false; + if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_OPTION_MAX)) { + gSubMenuSelection += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = 1; - sp2C = true; + sp38->subState = 1; + tempVar = true; } - if ((btnAndStick & U_JPAD) && (D_8018EDEC >= 0x16)) { - D_8018EDEC -= 1; + if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_OPTION_MIN)) { + gSubMenuSelection -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp2C = true; - sp38->unk8 = -1; + tempVar = true; + sp38->subState = -1; } - if (sp2C && gSoundMode != sp38->cursor) { + if (tempVar && gSoundMode != sp38->state) { gSaveData.main.saveInfo.soundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); update_save_data_backup(); - sp38->cursor = gSoundMode; + sp38->state = gSoundMode; } if (btnAndStick & B_BUTTON) { func_8009E280(); play_sound2(SOUND_MENU_GO_BACK); - if (gSoundMode != sp38->cursor) { + if (gSoundMode != sp38->state) { gSaveData.main.saveInfo.soundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); update_save_data_backup(); - sp38->cursor = gSoundMode; + sp38->state = gSoundMode; } return; } if (btnAndStick & A_BUTTON) { - switch (D_8018EDEC) { - case 0x16: + switch (gSubMenuSelection) { + case SUB_MENU_OPTION_SOUND_MODE: if (gSoundMode < 3) { gSoundMode += 1; } else { @@ -280,7 +309,7 @@ void options_menu_act(struct Controller* controller, u16 arg1) { if (gSoundMode == SOUND_UNUSED) { gSoundMode = SOUND_MONO; } - func_800B44BC(); + set_sound_mode(); switch (gSoundMode) { case SOUND_STEREO: play_sound2(SOUND_MENU_STEREO); @@ -293,75 +322,75 @@ void options_menu_act(struct Controller* controller, u16 arg1) { return; } break; - case 0x17: + case SUB_MENU_OPTION_COPY_CONTROLLER_PAK: switch (controller_pak_2_status()) { case PFS_INVALID_DATA: - D_8018EDEC = 0x2B; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_NO_GAME_DATA; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; case PFS_NO_ERROR: func_800B6798(); - sp2C = controller_pak_1_status(); - switch (sp2C) { + tempVar = controller_pak_1_status(); + switch (tempVar) { case PFS_INVALID_DATA: - D_8018EDEC = 0x46; - sp38->cursor = 0; + gSubMenuSelection = SUB_MENU_COPY_PAK_CREATE_GAME_DATA_INIT; + sp38->state = 0; play_sound2(SOUND_MENU_SELECT); break; case PFS_NO_ERROR: func_800B6708(); break; case PFS_NO_PAK_INSERTED: - D_8018EDEC = 0x34; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_NO_PAK_1P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; case PFS_FILE_OVERFLOW: - D_8018EDEC = 0x37; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_NO_PAGES_1P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; case PFS_PAK_BAD_READ: - case 3: + case PFS_PAK_CORRUPTED: // unreachable, bad reads always returns previous case default: - D_8018EDEC = 0x35; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_BAD_READ_1P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; } - if (sp2C == PFS_INVALID_DATA && !sp30[0].ghostDataSaved && - !sp30[1].ghostDataSaved) { - D_8018EDEC = 0x2A; + if (tempVar == PFS_INVALID_DATA && !sp30[PLAYER_ONE].ghostDataSaved && + !sp30[PLAYER_TWO].ghostDataSaved) { + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_NO_GHOST_DATA; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - if (sp2C == PFS_NO_ERROR) { - if (sp30[0].ghostDataSaved) { - D_8018EDEC = 0x28; + if (tempVar == PFS_NO_ERROR) { + if (sp30[PLAYER_ONE].ghostDataSaved) { + gSubMenuSelection = SUB_MENU_COPY_PAK_FROM_GHOST1_1P; play_sound2(SOUND_MENU_SELECT); - } else if (sp30[1].ghostDataSaved) { - D_8018EDEC = 0x29; + } else if (sp30[PLAYER_TWO].ghostDataSaved) { + gSubMenuSelection = SUB_MENU_COPY_PAK_FROM_GHOST2_1P; play_sound2(SOUND_MENU_SELECT); } else { - D_8018EDEC = 0x2A; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_NO_GHOST_DATA; play_sound2(SOUND_MENU_FILE_NOT_FOUND); } } // else return? return; case PFS_NO_PAK_INSERTED: - D_8018EDEC = 0x2C; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_NO_PAK_2P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; case PFS_PAK_BAD_READ: default: - D_8018EDEC = 0x2D; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_BAD_READ_2P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - case 0x18: { - D_8018EDEC = 0x1E; + case SUB_MENU_OPTION_ERASE_ALL_DATA: { + gSubMenuSelection = SUB_MENU_ERASE_QUIT; play_sound2(SOUND_MENU_SELECT); return; } - case 0x15: { + case SUB_MENU_OPTION_RETURN_GAME_SELECT: { func_8009E280(); play_sound2(SOUND_MENU_GO_BACK); return; @@ -371,37 +400,37 @@ void options_menu_act(struct Controller* controller, u16 arg1) { // maybe else return?; break; } - case 0x1E: - case 0x1F: { - if ((btnAndStick & D_JPAD) && (D_8018EDEC < 0x1F)) { - D_8018EDEC += 1; + case SUB_MENU_ERASE_QUIT: + case SUB_MENU_ERASE_ERASE: { + if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_ERASE_MAX)) { + gSubMenuSelection += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = 1; + sp38->subState = 1; } - if ((btnAndStick & U_JPAD) && (D_8018EDEC >= 0x1F)) { - D_8018EDEC -= 1; + if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_ERASE_MIN)) { + gSubMenuSelection -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = -1; + sp38->subState = -1; } if (btnAndStick & B_BUTTON) { - D_8018EDEC = 0x18; + gSubMenuSelection = SUB_MENU_OPTION_ERASE_ALL_DATA; play_sound2(SOUND_MENU_GO_BACK); return; } if (btnAndStick & A_BUTTON) { - switch (D_8018EDEC) { - case 0x1E: - D_8018EDEC = 0x18; + switch (gSubMenuSelection) { + case SUB_MENU_ERASE_QUIT: + gSubMenuSelection = SUB_MENU_OPTION_ERASE_ALL_DATA; play_sound2(SOUND_MENU_GO_BACK); break; - case 0x1F: - D_8018EDEC = 0x20; + case SUB_MENU_ERASE_ERASE: + gSubMenuSelection = SUB_MENU_SAVE_DATA_ERASED; func_800B46D0(); D_800DC5AC = 0; play_sound2(SOUND_MENU_EXPLOSION); @@ -410,187 +439,191 @@ void options_menu_act(struct Controller* controller, u16 arg1) { } break; // or return? } - case 0x20: { + case SUB_MENU_SAVE_DATA_ERASED: { if (btnAndStick & (A_BUTTON | B_BUTTON | START_BUTTON)) { - D_8018EDEC = 0x18; + gSubMenuSelection = SUB_MENU_OPTION_ERASE_ALL_DATA; play_sound2(SOUND_MENU_GO_BACK); } break; } - case 0x28: - case 0x29: { - if ((btnAndStick & D_JPAD) && (D_8018EDEC < 0x29) && (sp30[1].ghostDataSaved)) { - D_8018EDEC += 1; + case SUB_MENU_COPY_PAK_FROM_GHOST1_1P: + case SUB_MENU_COPY_PAK_FROM_GHOST2_1P: { + if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_COPY_PAK_FROM_GHOST_MAX) && + (sp30[PLAYER_TWO].ghostDataSaved)) { + gSubMenuSelection += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = 1; + sp38->subState = 1; } - if ((btnAndStick & U_JPAD) && (D_8018EDEC >= 0x29) && sp30[0].ghostDataSaved) { - D_8018EDEC -= 1; + if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_COPY_PAK_FROM_GHOST_MIN) && + sp30[PLAYER_ONE].ghostDataSaved) { + gSubMenuSelection -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = -1; + sp38->subState = -1; } if (btnAndStick & B_BUTTON) { - D_8018EDEC = 0x17; + gSubMenuSelection = SUB_MENU_OPTION_COPY_CONTROLLER_PAK; play_sound2(SOUND_MENU_GO_BACK); return; } if (btnAndStick & A_BUTTON) { - sp38->unk20 = D_8018EDEC - 0x28; - if (sp30[sp38->unk20].courseIndex == D_8018EE10[1].courseIndex && D_8018EE10[1].ghostDataSaved) { - D_8018EDEC = 0x33; + sp38->param2 = gSubMenuSelection - SUB_MENU_COPY_PAK_FROM_GHOST_MIN; + if (sp30[sp38->param2].courseIndex == D_8018EE10[PLAYER_TWO].courseIndex && + D_8018EE10[PLAYER_TWO].ghostDataSaved) { + gSubMenuSelection = SUB_MENU_COPY_PAK_TO_GHOST2_2P; } else { - D_8018EDEC = 0x32; + gSubMenuSelection = SUB_MENU_COPY_PAK_TO_GHOST1_2P; } play_sound2(SOUND_MENU_SELECT); } break; } - case 0x32: - case 0x33: { + case SUB_MENU_COPY_PAK_TO_GHOST1_2P: + case SUB_MENU_COPY_PAK_TO_GHOST2_2P: { // bit of a fake match, but if it works it works? - if ((sp30[sp38->unk20].courseIndex != ((0, (D_8018EE10 + (D_8018EDEC - 0x32))->courseIndex))) || - ((D_8018EE10 + (D_8018EDEC - 0x32))->ghostDataSaved == 0)) { - if ((btnAndStick & D_JPAD) && (D_8018EDEC < 0x33)) { - D_8018EDEC += 1; + if ((sp30[sp38->param2].courseIndex != + ((0, (D_8018EE10 + (gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN))->courseIndex))) || + ((D_8018EE10 + (gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN))->ghostDataSaved == 0)) { + if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_COPY_PAK_TO_GHOST_MAX)) { + gSubMenuSelection += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = 1; + sp38->subState = 1; } - if ((btnAndStick & U_JPAD) && (D_8018EDEC >= 0x33)) { - D_8018EDEC -= 1; + if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_COPY_PAK_TO_GHOST_MIN)) { + gSubMenuSelection -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = -1; + sp38->subState = -1; } } if (btnAndStick & B_BUTTON) { - D_8018EDEC = sp38->unk20 + 0x28; + gSubMenuSelection = sp38->param2 + SUB_MENU_COPY_PAK_FROM_GHOST_MIN; play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & A_BUTTON) { - sp38->unk1C = D_8018EDEC - 0x32; - if (D_8018EE10[(sp38->unk1C)].ghostDataSaved) { - D_8018EDEC = 0x38; + sp38->param1 = gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN; + if (D_8018EE10[(sp38->param1)].ghostDataSaved) { + gSubMenuSelection = SUB_MENU_COPY_PAK_PROMPT_QUIT; } else { - D_8018EDEC = 0x3A; - sp38->cursor = 0; + gSubMenuSelection = SUB_MENU_COPY_PAK_START; + sp38->state = 0; } play_sound2(SOUND_MENU_SELECT); } break; } - case 0x2A: - case 0x2B: - case 0x2C: - case 0x2D: - case 0x34: - case 0x35: - case 0x37: - case 0x3C: - case 0x41: - case 0x42: { + case SUB_MENU_COPY_PAK_ERROR_NO_GHOST_DATA: + case SUB_MENU_COPY_PAK_ERROR_NO_GAME_DATA: + case SUB_MENU_COPY_PAK_ERROR_NO_PAK_2P: + case SUB_MENU_COPY_PAK_ERROR_BAD_READ_2P: + case SUB_MENU_COPY_PAK_ERROR_NO_PAK_1P: + case SUB_MENU_COPY_PAK_ERROR_BAD_READ_1P: + case SUB_MENU_COPY_PAK_ERROR_NO_PAGES_1P: + case SUB_MENU_COPY_PAK_COMPLETED: + case SUB_MENU_COPY_PAK_UNABLE_COPY_FROM_1P: + case SUB_MENU_COPY_PAK_UNABLE_READ_FROM_2P: { if (btnAndStick & (A_BUTTON | B_BUTTON | START_BUTTON)) { - D_8018EDEC = 0x17; + gSubMenuSelection = SUB_MENU_OPTION_COPY_CONTROLLER_PAK; play_sound2(SOUND_MENU_GO_BACK); } break; } - case 0x38: - case 0x39: { - if ((btnAndStick & R_JPAD) && D_8018EDEC < 0x39) { - D_8018EDEC += 1; + case SUB_MENU_COPY_PAK_PROMPT_QUIT: + case SUB_MENU_COPY_PAK_PROMPT_COPY: { + if ((btnAndStick & R_JPAD) && gSubMenuSelection < SUB_MENU_COPY_PAK_PROMPT_MAX) { + gSubMenuSelection += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = 1; + sp38->subState = 1; } - if ((btnAndStick & L_JPAD) && D_8018EDEC >= 0x39) { - D_8018EDEC -= 1; + if ((btnAndStick & L_JPAD) && gSubMenuSelection > SUB_MENU_COPY_PAK_PROMPT_MIN) { + gSubMenuSelection -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp38->unk24 < 4.2) { - sp38->unk24 += 4.0; + if (sp38->paramf < 4.2) { + sp38->paramf += 4.0; } - sp38->unk8 = -1; + sp38->subState = -1; } if (btnAndStick & B_BUTTON) { - D_8018EDEC = sp38->unk1C + 0x32; + gSubMenuSelection = sp38->param1 + SUB_MENU_COPY_PAK_TO_GHOST_MIN; play_sound2(SOUND_MENU_GO_BACK); return; } if (btnAndStick & A_BUTTON) { - if (D_8018EDEC == 0x38) { - D_8018EDEC = 0x17; + if (gSubMenuSelection == SUB_MENU_COPY_PAK_PROMPT_QUIT) { + gSubMenuSelection = SUB_MENU_OPTION_COPY_CONTROLLER_PAK; play_sound2(SOUND_MENU_GO_BACK); } else { - D_8018EDEC = 0x3A; + gSubMenuSelection = SUB_MENU_COPY_PAK_START; play_sound2(SOUND_MENU_SELECT); - sp38->cursor = 0; + sp38->state = 0; } } // return? break; } - case 0x3A: { - if (arg1 == 0) { - sp38->cursor += 1; + case SUB_MENU_COPY_PAK_START: { + if (controllerIdx == PLAYER_ONE) { + sp38->state += 1; } - if (sp38->cursor >= 3) { - D_8018EDEC = 0x3B; + if (sp38->state >= 3) { + gSubMenuSelection = SUB_MENU_COPY_PAK_COPYING; } break; } - case 0x3B: { + case SUB_MENU_COPY_PAK_COPYING: { res = controller_pak_2_status(); if (res == PFS_NO_ERROR) { - res = func_800B65F4(sp38->unk20, sp38->unk1C); + res = func_800B65F4(sp38->param2, sp38->param1); } if (res != 0) { - D_8018EDEC = 0x42; + gSubMenuSelection = SUB_MENU_COPY_PAK_UNABLE_READ_FROM_2P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } res = osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName, (u8*) gExtCode, &gControllerPak1FileNote); if (res == PFS_NO_ERROR) { - res = func_800B6178(sp38->unk1C); + res = func_800B6178(sp38->param1); } if (res != 0) { - D_8018EDEC = 0x41; + gSubMenuSelection = SUB_MENU_COPY_PAK_UNABLE_COPY_FROM_1P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - D_8018EDEC = 0x3C; - D_8018EE10[sp38->unk1C].courseIndex = (sp30 + sp38->unk20)->courseIndex; - func_800B6088(sp38->unk1C); + gSubMenuSelection = SUB_MENU_COPY_PAK_COMPLETED; + D_8018EE10[sp38->param1].courseIndex = (sp30 + sp38->param2)->courseIndex; + func_800B6088(sp38->param1); break; } - case 0x46: { - if (arg1 == 0) { - sp38->cursor += 1; + case SUB_MENU_COPY_PAK_CREATE_GAME_DATA_INIT: { + if (controllerIdx == PLAYER_ONE) { + sp38->state += 1; } - if (sp38->cursor >= 3) { - D_8018EDEC = 0x47; + if (sp38->state >= 3) { + gSubMenuSelection = SUB_MENU_COPY_PAK_CREATE_GAME_DATA_DONE; } break; } - case 0x47: { + case SUB_MENU_COPY_PAK_CREATE_GAME_DATA_DONE: { if (func_800B6A68()) { - D_8018EDEC = 0x36; + gSubMenuSelection = SUB_MENU_COPY_PAK_ERROR_CANT_CREATE_1P; play_sound2(SOUND_MENU_FILE_NOT_FOUND); } else if (sp30[0].ghostDataSaved) { - D_8018EDEC = 0x28; + gSubMenuSelection = SUB_MENU_COPY_PAK_FROM_GHOST1_1P; } else { - D_8018EDEC = 0x29; + gSubMenuSelection = SUB_MENU_COPY_PAK_FROM_GHOST2_1P; } break; } @@ -600,70 +633,75 @@ void options_menu_act(struct Controller* controller, u16 arg1) { } } -// Handle navigating the data menu interface -void data_menu_act(struct Controller* controller, UNUSED u16 arg1) { - u16 buttonAndStickPress = (controller->buttonPressed | controller->stickPressed); +/** + * Navigation of the data menu + */ +void data_menu_act(struct Controller* controller, UNUSED u16 controllerIdx) { + u16 btnAndStick = (controller->buttonPressed | controller->stickPressed); // Make pressing Start have the same effect as pressing A - if ((gEnableDebugMode == 0) && ((buttonAndStickPress & 0x1000) != 0)) { - buttonAndStickPress |= 0x8000; + if (!gEnableDebugMode && ((btnAndStick & START_BUTTON) != 0)) { + btnAndStick |= A_BUTTON; } - if (func_800B4520() == 0) { - if (D_8018EDEC == 1) { + if (is_screen_being_faded() == 0) { + if (gSubMenuSelection == SUB_MENU_DATA) { // If DPad/Stick down pressed, move selection down if not already in bottom row - if ((buttonAndStickPress & 0x400) != 0) { + if ((btnAndStick & D_JPAD) != 0) { if ((gTimeTrialDataCourseIndex % 4) != 3) { ++gTimeTrialDataCourseIndex; play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If DPad/Stick up pressed, move selection up if not already in top row - if ((buttonAndStickPress & 0x800) != 0) { - if ((gTimeTrialDataCourseIndex & 3) != 0) { + if ((btnAndStick & U_JPAD) != 0) { + if ((gTimeTrialDataCourseIndex % 4) != 0) { --gTimeTrialDataCourseIndex; play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If DPad/Stick right pressed, move selection right if not already in right-most column - if ((buttonAndStickPress & 0x100) != 0) { + if ((btnAndStick & R_JPAD) != 0) { if ((gTimeTrialDataCourseIndex / 4) != 3) { gTimeTrialDataCourseIndex += 4; play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If DPad/Stick left pressed, move selection left if not already in left-most column - if ((buttonAndStickPress & 0x200) != 0) { + if ((btnAndStick & L_JPAD) != 0) { if ((gTimeTrialDataCourseIndex / 4) != 0) { gTimeTrialDataCourseIndex -= 4; play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If B pressed, go to main menu - if ((buttonAndStickPress & 0x4000) != 0) { + if ((btnAndStick & B_BUTTON) != 0) { func_8009E258(); play_sound2(SOUND_MENU_GO_BACK); return; } // If A pressed, go to selected course's records - if ((buttonAndStickPress & 0x8000) != 0) { - gCourseRecordsMenuSelection = 0; + if ((btnAndStick & A_BUTTON) != 0) { + gCourseRecordsMenuSelection = COURSE_RECORDS_MENU_RETURN_MENU; func_8009E1C0(); play_sound2(SOUND_MENU_OK_CLICKED); } } - // If D_8018EDEC != 1 and A pressed, go to main menu - // (Will D_8018EDEC ever not equal 1 when entering the data menu?) - else if ((buttonAndStickPress & 0x8000) != 0) { + // If gSubMenuSelection is not SUB_MENU_DATA and A pressed, go to main menu + // This condition is not reachable but this failsafe was added nonetheless + else if ((btnAndStick & A_BUTTON) != 0) { func_8009E258(); play_sound2(SOUND_MENU_OK_CLICKED); } } } -void course_data_menu_act(struct Controller* controller, UNUSED u16 arg1) { +/** + * Navigation of the course records data menu + */ +void course_data_menu_act(struct Controller* controller, UNUSED u16 controllerIdx) { u16 btnAndStick; // sp2E - struct_8018D9E0_entry* sp28; + MenuItem* sp28; CourseTimeTrialRecords* sp24; s32 res; @@ -673,9 +711,9 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 arg1) { btnAndStick |= A_BUTTON; } - if (!func_800B4520()) { - switch (D_8018EDEC) { - case 0x0B: { + if (!is_screen_being_faded()) { + switch (gSubMenuSelection) { + case SUB_MENU_DATA_OPTIONS: { if ((btnAndStick & L_JPAD) && (gTimeTrialDataCourseIndex > 0)) { gTimeTrialDataCourseIndex -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); @@ -686,47 +724,50 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 arg1) { play_sound2(SOUND_MENU_CURSOR_MOVE); } - sp28 = find_8018D9E0_entry_dupe(0xE8); + sp28 = find_menu_items_dupe(0xE8); sp24 = &gSaveData.allCourseTimeTrialRecords.cupRecords[gTimeTrialDataCourseIndex / 4] .courseRecords[gTimeTrialDataCourseIndex % 4]; - if (gCourseRecordsMenuSelection == 2 && func_800B639C(gTimeTrialDataCourseIndex) < 0) { + if (gCourseRecordsMenuSelection == COURSE_RECORDS_MENU_ERASE_GHOST && + func_800B639C(gTimeTrialDataCourseIndex) < 0) { gCourseRecordsMenuSelection -= 1; } - if (gCourseRecordsMenuSelection == 1 && sp24->unknownBytes[0] == 0) { + if (gCourseRecordsMenuSelection == COURSE_RECORDS_MENU_ERASE_RECORDS && sp24->unknownBytes[0] == 0) { gCourseRecordsMenuSelection -= 1; } - if ((btnAndStick & U_JPAD) && (gCourseRecordsMenuSelection > 0)) { + if ((btnAndStick & U_JPAD) && (gCourseRecordsMenuSelection > COURSE_RECORDS_MENU_MIN)) { gCourseRecordsMenuSelection -= 1; if (gCourseRecordsMenuSelection == 1 && sp24->unknownBytes[0] == 0) { gCourseRecordsMenuSelection -= 1; } play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp28->unk24 < 4.2) { - sp28->unk24 += 4.0; + if (sp28->paramf < 4.2) { + sp28->paramf += 4.0; } - sp28->unk8 = -1; + sp28->subState = -1; } - if ((btnAndStick & D_JPAD) && (gCourseRecordsMenuSelection < 2)) { + if ((btnAndStick & D_JPAD) && (gCourseRecordsMenuSelection < COURSE_RECORDS_MENU_MAX)) { gCourseRecordsMenuSelection += 1; - if (gCourseRecordsMenuSelection == 1 && sp24->unknownBytes[0] == 0) { + if (gCourseRecordsMenuSelection == COURSE_RECORDS_MENU_ERASE_RECORDS && + sp24->unknownBytes[0] == 0) { gCourseRecordsMenuSelection += 1; } - if (gCourseRecordsMenuSelection == 2 && func_800B639C(gTimeTrialDataCourseIndex) < 0) { + if (gCourseRecordsMenuSelection == COURSE_RECORDS_MENU_ERASE_GHOST && + func_800B639C(gTimeTrialDataCourseIndex) < 0) { if (sp24->unknownBytes[0] == 0) { - gCourseRecordsMenuSelection = 0; + gCourseRecordsMenuSelection = COURSE_RECORDS_MENU_RETURN_MENU; } else { - gCourseRecordsMenuSelection = 1; + gCourseRecordsMenuSelection = COURSE_RECORDS_MENU_ERASE_RECORDS; } } else { play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp28->unk24 < 4.2) { - sp28->unk24 += 4.0; + if (sp28->paramf < 4.2) { + sp28->paramf += 4.0; } - sp28->unk8 = 1; + sp28->subState = 1; } } @@ -734,63 +775,63 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 arg1) { func_8009E208(); play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & A_BUTTON) { - if (sp28->unk24 < 4.2) { - sp28->unk24 += 4.0; + if (sp28->paramf < 4.2) { + sp28->paramf += 4.0; } - if (gCourseRecordsMenuSelection == 0) { + if (gCourseRecordsMenuSelection == COURSE_RECORDS_MENU_RETURN_MENU) { func_8009E208(); play_sound2(SOUND_MENU_GO_BACK); } else { - D_8018EDEC = 0x0C; - D_8018EDF9 = 0; + gSubMenuSelection = SUB_MENU_DATA_ERASE_CONFIRM; + gCourseRecordsSubMenuSelection = COURSE_RECORDS_SUB_MENU_QUIT; play_sound2(SOUND_MENU_SELECT); } } break; } - case 0x0C: { - sp28 = find_8018D9E0_entry_dupe(0xE9); - if ((btnAndStick & U_JPAD) && (D_8018EDF9 > 0)) { - D_8018EDF9 -= 1; + case SUB_MENU_DATA_ERASE_CONFIRM: { + sp28 = find_menu_items_dupe(0xE9); + if ((btnAndStick & U_JPAD) && (gCourseRecordsSubMenuSelection > COURSE_RECORDS_SUB_MENU_MIN)) { + gCourseRecordsSubMenuSelection -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp28->unk24 < 4.2) { - sp28->unk24 += 4.0; + if (sp28->paramf < 4.2) { + sp28->paramf += 4.0; } - sp28->unk8 = -1; + sp28->subState = -1; } - if ((btnAndStick & D_JPAD) && (D_8018EDF9 <= 0)) { - D_8018EDF9 += 1; + if ((btnAndStick & D_JPAD) && (gCourseRecordsSubMenuSelection < COURSE_RECORDS_SUB_MENU_MAX)) { + gCourseRecordsSubMenuSelection += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - if (sp28->unk24 < 4.2) { - sp28->unk24 += 4.0; + if (sp28->paramf < 4.2) { + sp28->paramf += 4.0; } - sp28->unk8 = 1; + sp28->subState = 1; } if (btnAndStick & B_BUTTON) { - D_8018EDEC = 0xB; + gSubMenuSelection = SUB_MENU_DATA_OPTIONS; play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & A_BUTTON) { - if (D_8018EDF9 != 0) { + if (gCourseRecordsSubMenuSelection != COURSE_RECORDS_SUB_MENU_QUIT) { res = 0; switch (gCourseRecordsMenuSelection) { - case 1: { + case COURSE_RECORDS_MENU_ERASE_RECORDS: { func_800B4728(gTimeTrialDataCourseIndex); func_800B559C(gTimeTrialDataCourseIndex); play_sound2(SOUND_MENU_EXPLOSION); res = -1; break; } - case 2: { + case COURSE_RECORDS_MENU_ERASE_GHOST: { res = func_800B639C(gTimeTrialDataCourseIndex); if (res >= 0) { if (func_800B69BC(res) != 0) { - D_8018EDEC = 0x0D; + gSubMenuSelection = SUB_MENU_DATA_CANT_ERASE; play_sound2(SOUND_MENU_FILE_NOT_FOUND); } else { play_sound2(SOUND_MENU_EXPLOSION); - D_8018EDEC = 0x0B; + gSubMenuSelection = SUB_MENU_DATA_OPTIONS; } } break; @@ -798,18 +839,18 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 arg1) { } if (!(res + 1)) { - D_8018EDEC = 0xB; + gSubMenuSelection = SUB_MENU_DATA_OPTIONS; } } else { play_sound2(SOUND_MENU_GO_BACK); - D_8018EDEC = 0xB; + gSubMenuSelection = SUB_MENU_DATA_OPTIONS; } } break; } - case 0x0D: { + case SUB_MENU_DATA_CANT_ERASE: { if (btnAndStick & (A_BUTTON | B_BUTTON | START_BUTTON)) { - D_8018EDEC = 0xB; + gSubMenuSelection = SUB_MENU_DATA_OPTIONS; } break; } @@ -820,87 +861,76 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 arg1) { /** * On input skip logo screen **/ -void logo_intro_menu_act(struct Controller* arg0, UNUSED u16 arg1) { - u16 anyInput = arg0->buttonPressed | arg0->stickPressed; - -// Note: Choosing a course in the middle of a cup -// will contain no definition for player staging/lineup. -// #define SKIP_TO_RACE -#ifdef SKIP_TO_RACE - gGamestateNext = 4; // Enter race state - gCCSelection = CC_100; - gCupSelection = 1; - gCourseIndexInCup = 0; - gCurrentCourseId = 0; - gScreenModeSelection = SCREEN_MODE_1P; - gCharacterSelections[0] = 0; - gModeSelection = GRAND_PRIX; - gPlayerCount = 1; -#endif +void logo_intro_menu_act(struct Controller* controller, UNUSED u16 controllerIdx) { + u16 btnAndStick = (controller->buttonPressed | controller->stickPressed); - if ((func_800B4520() == 0) && (anyInput)) { - // Audio related + // If any button is pressed then fade audio out + if ((is_screen_being_faded() == 0) && (btnAndStick)) { + // TODO: Label audio functions func_800CA388(0x3C); func_8009E1E4(); } } -void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { - u16 buttonAndStickPress; +/** + * Navigation of the controller pak table data + */ +void controller_pak_menu_act(struct Controller* controller, UNUSED u16 controllerIdx) { + u16 btnAndStick; OSPfsState* osPfsState; s32 selectedTableRow; UNUSED s8 pad; - buttonAndStickPress = controller->buttonPressed | controller->stickPressed; - if (func_800B4520() == 0) { + btnAndStick = controller->buttonPressed | controller->stickPressed; + if (is_screen_being_faded() == 0) { switch (gControllerPakMenuSelection) { case CONTROLLER_PAK_MENU_SELECT_RECORD: - if ((buttonAndStickPress & 0x9000) != 0) { + if ((btnAndStick & (A_BUTTON | START_BUTTON)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; play_sound2(SOUND_MENU_SELECT); return; } - if ((buttonAndStickPress & 0x300) != 0) { + if ((btnAndStick & (L_JPAD | R_JPAD)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_END; play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; case CONTROLLER_PAK_MENU_END: - if ((buttonAndStickPress & 0x9000) != 0) { + if ((btnAndStick & (A_BUTTON | START_BUTTON)) != 0) { play_sound2(SOUND_MENU_SELECT); func_8009E1C0(); gControllerPak1State = BAD; return; } - if ((buttonAndStickPress & 0x300) != 0) { + if ((btnAndStick & (L_JPAD | R_JPAD)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_SELECT_RECORD; play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; case CONTROLLER_PAK_MENU_TABLE_GAME_DATA: - if ((buttonAndStickPress & 0x9000) != 0) { - selectedTableRow = D_800E86C4[gControllerPakSelectedTableRow + 2] - 1; + if ((btnAndStick & (A_BUTTON | START_BUTTON)) != 0) { + selectedTableRow = gControllerPakVisibleTableRows[gControllerPakSelectedTableRow + 2] - 1; if (pfsError[selectedTableRow] == 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_QUIT; play_sound2(SOUND_MENU_SELECT); return; } - } else if ((buttonAndStickPress & 0x4000) != 0) { - if (D_800E86D0[0] == 0) { + } else if ((btnAndStick & B_BUTTON) != 0) { + if (gControllerPakScrollDirection == CONTROLLER_PAK_SCROLL_DIR_NONE) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_SELECT_RECORD; play_sound2(SOUND_MENU_GO_BACK); return; } - } else if ((buttonAndStickPress & 0x800) != 0) { - if (D_800E86D0[0] == 0) { + } else if ((btnAndStick & U_JPAD) != 0) { + if (gControllerPakScrollDirection == CONTROLLER_PAK_SCROLL_DIR_NONE) { --gControllerPakSelectedTableRow; if (gControllerPakSelectedTableRow < 0) { gControllerPakSelectedTableRow = 0; - if (D_800E86C4[gControllerPakSelectedTableRow + 2] != 1) { - D_800E86D0[0] = 2; + if (gControllerPakVisibleTableRows[gControllerPakSelectedTableRow + 2] != 1) { + gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_UP; play_sound2(SOUND_MENU_CURSOR_MOVE); return; } @@ -909,12 +939,13 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { return; } } - } else if (((buttonAndStickPress & 0x400) != 0) && (D_800E86D0[0] == 0)) { + } else if (((btnAndStick & D_JPAD) != 0) && + (gControllerPakScrollDirection == CONTROLLER_PAK_SCROLL_DIR_NONE)) { ++gControllerPakSelectedTableRow; if (gControllerPakSelectedTableRow >= CONTROLLER_PAK_MENU_TABLE_GAME_DATA) { gControllerPakSelectedTableRow = CONTROLLER_PAK_MENU_QUIT; - if (D_800E86C4[gControllerPakSelectedTableRow + 2] != 0x10) { - D_800E86D0[0] = 1; + if (gControllerPakVisibleTableRows[gControllerPakSelectedTableRow + 2] != 16) { + gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_DOWN; play_sound2(SOUND_MENU_CURSOR_MOVE); return; } @@ -925,29 +956,29 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { } break; case CONTROLLER_PAK_MENU_QUIT: - if ((buttonAndStickPress & 0xD000) != 0) { + if ((btnAndStick & (A_BUTTON | B_BUTTON | START_BUTTON)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; play_sound2(SOUND_MENU_GO_BACK); return; } - if ((buttonAndStickPress & 0x300) != 0) { + if ((btnAndStick & (L_JPAD | R_JPAD)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_ERASE; play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; case CONTROLLER_PAK_MENU_ERASE: - if ((buttonAndStickPress & 0x9000) != 0) { + if ((btnAndStick & (A_BUTTON | START_BUTTON)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_GO_TO_ERASING; play_sound2(SOUND_MENU_SELECT); return; } - if ((buttonAndStickPress & 0x4000) != 0) { + if ((btnAndStick & B_BUTTON) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; play_sound2(SOUND_MENU_GO_BACK); return; } - if ((buttonAndStickPress & 0x300) != 0) { + if ((btnAndStick & (L_JPAD | R_JPAD)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_QUIT; play_sound2(SOUND_MENU_CURSOR_MOVE); return; @@ -957,7 +988,7 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_ERASING; return; case CONTROLLER_PAK_MENU_ERASING: - selectedTableRow = D_800E86C4[gControllerPakSelectedTableRow + 2] - 1; + selectedTableRow = gControllerPakVisibleTableRows[gControllerPakSelectedTableRow + 2] - 1; osPfsState = &pfsState[selectedTableRow]; switch (osPfsDeleteFile(&gControllerPak1FileHandle, osPfsState->company_code, osPfsState->game_code, @@ -981,7 +1012,7 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { case CONTROLLER_PAK_MENU_ERASE_ERROR_NOT_ERASED: case CONTROLLER_PAK_MENU_ERASE_ERROR_NO_PAK: case CONTROLLER_PAK_MENU_ERASE_ERROR_PAK_CHANGED: - if ((buttonAndStickPress & 0x9000) != 0) { + if ((btnAndStick & (A_BUTTON | START_BUTTON)) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; } break; @@ -989,22 +1020,26 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { } } -void splash_menu_act(struct Controller* controller, u16 arg1) { +/** + * Navigation of the main splash start screen menu + * Also handles debug menu options + */ +void splash_menu_act(struct Controller* controller, u16 controllerIdx) { u16 btnAndStick; u16 i; - s32 sp28; + s32 isDebug; - sp28 = true; + isDebug = true; btnAndStick = controller->buttonPressed | controller->stickPressed; - if (func_800B4520() == 0) { - if (arg1 == 0) { + if (is_screen_being_faded() == 0) { + if (controllerIdx == PLAYER_ONE) { gMenuDelayTimer += 1; } switch (gDebugMenuSelection) { case DEBUG_MENU_DISABLED: { - sp28 = false; - if ((gMenuDelayTimer >= 0x2E) && (btnAndStick & (A_BUTTON | START_BUTTON))) { + isDebug = false; + if ((gMenuDelayTimer >= 46) && (btnAndStick & (A_BUTTON | START_BUTTON))) { func_8009E1C0(); func_800CA330(0x19); play_sound2(SOUND_INTRO_ENTER_MENU); @@ -1017,7 +1052,7 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { if (btnAndStick & (R_JPAD | L_JPAD)) { play_sound2(SOUND_MENU_CURSOR_MOVE); if (gEnableDebugMode) { - gEnableDebugMode = DEBUG_MODE; + gEnableDebugMode = DEBUG_MODE_TOGGLE; } else { gEnableDebugMode = true; } @@ -1056,15 +1091,15 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { break; } case DEBUG_MENU_SCREEN_MODE: { - if ((btnAndStick & R_JPAD) && (D_8018EDF1 < 4)) { - D_8018EDF1 += 1; + if ((btnAndStick & R_JPAD) && (gScreenModeListIndex < 4)) { + gScreenModeListIndex += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - gScreenModeSelection = D_800F2B50[D_8018EDF1]; + gScreenModeSelection = sScreenModePlayerTable[gScreenModeListIndex]; } - if ((btnAndStick & L_JPAD) && (D_8018EDF1 > 0)) { - D_8018EDF1 -= 1; + if ((btnAndStick & L_JPAD) && (gScreenModeListIndex > 0)) { + gScreenModeListIndex -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); - gScreenModeSelection = D_800F2B50[D_8018EDF1]; + gScreenModeSelection = sScreenModePlayerTable[gScreenModeListIndex]; } if (btnAndStick & U_JPAD) { gDebugMenuSelection = DEBUG_MENU_COURSE; @@ -1077,7 +1112,7 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { break; } case DEBUG_MENU_PLAYER: { - if ((btnAndStick & R_JPAD) && (*gCharacterSelections < 7)) { + if ((btnAndStick & R_JPAD) && (gCharacterSelections[0] < 7)) { gCharacterSelections[0] += 1; play_sound2(SOUND_MENU_CURSOR_MOVE); } @@ -1102,7 +1137,7 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { gSoundMode = SOUND_MONO; } play_sound2(SOUND_MENU_CURSOR_MOVE); - func_800B44BC(); + set_sound_mode(); gSaveData.main.saveInfo.soundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); update_save_data_backup(); @@ -1113,7 +1148,7 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { gSoundMode = SOUND_HEADPHONES; } play_sound2(SOUND_MENU_CURSOR_MOVE); - func_800B44BC(); + set_sound_mode(); gSaveData.main.saveInfo.soundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); } @@ -1138,7 +1173,7 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { } play_sound2(SOUND_MENU_SELECT); break; - } else if (btnAndStick & CONT_L) { + } else if (btnAndStick & L_TRIG) { reset_save_data_grand_prix_points_and_sound_mode(); for (i = 0; i < 16; i++) { func_800B5404(i / 4, i); @@ -1164,15 +1199,15 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { break; } - gPlayerCountSelection1 = gPlayerCount = D_800F2B58[D_8018EDF1]; + gPlayerCountSelection1 = gPlayerCount = sScreenModePlayerCount[gScreenModeListIndex]; - if (sp28) { + if (isDebug) { if (btnAndStick & (A_BUTTON | START_BUTTON)) { func_8009E1C0(); func_800CA330(0x19); - gDebugMenuSelection = DEBUG_MENU_EXITED; + gDebugMenuSelection = DEBUG_MENU_OPTION_SELECTED; - if (controller->button & CONT_L) { + if (controller->button & L_TRIG) { gDemoMode = DEMO_MODE_ACTIVE; } else { gDemoMode = DEMO_MODE_INACTIVE; @@ -1182,17 +1217,17 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { if (btnAndStick & A_BUTTON) { gDebugGotoScene = DEBUG_GOTO_ENDING; } else { - gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA; + gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_EXTRA; } } play_sound2(SOUND_MENU_OK_CLICKED); } else if ((btnAndStick & B_BUTTON) && (controller->button & Z_TRIG)) { func_8009E1C0(); func_800CA330(0x19); - gDebugMenuSelection = DEBUG_MENU_EXITED; - gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_CC_50; + gDebugMenuSelection = DEBUG_MENU_OPTION_SELECTED; + gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_DEFAULT; play_sound2(SOUND_MENU_OK_CLICKED); - } else if (btnAndStick & CONT_R) { + } else if (btnAndStick & R_TRIG) { gDebugMenuSelection = DEBUG_MENU_DISABLED; play_sound2(SOUND_MENU_SELECT); } @@ -1200,21 +1235,21 @@ void splash_menu_act(struct Controller* controller, u16 arg1) { } } -void func_800B28C8(void) { +void setup_selected_game_mode(void) { // For Grand Prix and Versus, this will be the CC mode selected. For Time Trials, it will // be whether 'Begin' or 'Data' is selected. Not used for Battle. - s8 temp_v0 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + s8 subMenuMode = gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; // Determine which game mode was selected based on the number of players and the row selected on the main menu - switch (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]) { + switch (gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) { case GRAND_PRIX: - gCCSelection = temp_v0; + gCCSelection = subMenuMode; gPlaceItemBoxes = 1; - gIsMirrorMode = (temp_v0 == CC_EXTRA) ? 1 : 0; + gIsMirrorMode = (subMenuMode == CC_EXTRA) ? 1 : 0; break; case VERSUS: - gCCSelection = temp_v0; + gCCSelection = subMenuMode; gPlaceItemBoxes = 1; - gIsMirrorMode = (temp_v0 == CC_EXTRA) ? 1 : 0; + gIsMirrorMode = (subMenuMode == CC_EXTRA) ? 1 : 0; break; case BATTLE: gPlaceItemBoxes = 1; @@ -1225,43 +1260,40 @@ void func_800B28C8(void) { gIsMirrorMode = 0; gPlaceItemBoxes = 0; - if ((temp_v0 && temp_v0) && temp_v0) {} + if ((subMenuMode && subMenuMode) && subMenuMode) {} break; } } -#ifdef NON_MATCHING -// nonmatching: regalloc; arg1 is not AND-ed back into $a1, reg chaos follows -void main_menu_act(struct Controller* controller, u16 arg1) { - u16 btnAndStick; // sp2E - s32 sp28; - bool sp24; - s32 newMode; // temp_v1_2? +/** + * Navigation of the main game mode select screen + */ +void main_menu_act(struct Controller* controller, u16 controllerIdx) { + u16 btnAndStick; + s32 subMode; // subMode + bool cursorMoved; // cursorMoved btnAndStick = controller->buttonPressed | controller->stickPressed; - if (!gEnableDebugMode && (btnAndStick & START_BUTTON)) { + if ((gEnableDebugMode == 0) && (btnAndStick & START_BUTTON)) { btnAndStick |= A_BUTTON; } - if (!func_800B4520()) { - switch (gMainMenuSelectionDepth) { - case BLANK_MAIN_MENU: { - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + if (is_screen_being_faded() == 0) { + switch (gMainMenuSelection) { + case MAIN_MENU_NONE: break; - } - case PLAYER_NUM_SELECTION: { - if ((btnAndStick & R_JPAD) && gPlayerCount < 4) { + case MAIN_MENU_PLAYER_SELECT: + if ((btnAndStick & R_JPAD) && (gPlayerCount < 4)) { gPlayerCount += 1; - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } - if ((btnAndStick & L_JPAD) && gPlayerCount >= 2) { + if ((btnAndStick & L_JPAD) && (gPlayerCount >= 2)) { gPlayerCount -= 1; - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } - // L800B2B38 gPlayerCountSelection1 = gPlayerCount; switch (gPlayerCountSelection1) { case 1: @@ -1275,205 +1307,189 @@ void main_menu_act(struct Controller* controller, u16 arg1) { gScreenModeSelection = SCREEN_MODE_3P_4P_SPLITSCREEN; break; } - // L800B2B94 if (btnAndStick & B_BUTTON) { func_8009E0F0(0x14); func_800CA330(0x19); - D_8018EDE0 = 1; + gMenuFadeType = MENU_FADE_TYPE_BACK; play_sound2(SOUND_MENU_GO_BACK); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else if (btnAndStick & A_BUTTON) { - // L800B2C00 - gMainMenuSelectionDepth = GAME_MODE_SELECTION; - func_800B44AC(); + break; + } + if (btnAndStick & A_BUTTON) { + gMainMenuSelection = MAIN_MENU_MODE_SELECT; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_SELECT); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else if (btnAndStick & CONT_L) { - // L800B2C58 - gMainMenuSelectionDepth = OPTIONS_SELECTION; + break; + } + if (btnAndStick & L_TRIG) { + gMainMenuSelection = MAIN_MENU_OPTION; func_8009E280(); play_sound2(SOUND_MENU_OPTION); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else if (btnAndStick & CONT_R) { - gMainMenuSelectionDepth = DATA_SELECTION; + break; + } + if (btnAndStick & R_TRIG) { + gMainMenuSelection = MAIN_MENU_DATA; func_8009E258(); play_sound2(SOUND_MENU_DATA); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else { - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + break; } break; - } - case GAME_MODE_SELECTION: { + case MAIN_MENU_MODE_SELECT: if (btnAndStick & D_JPAD) { - if (D_800E86AC[gPlayerCount - 1] < gPlayerModeSelection[gPlayerCount - 1]) { - D_800E86AC[gPlayerCount - 1] += 1; - func_800B44AC(); + if (gGameModeMenuColumn[gPlayerCount - 1] < gPlayerModeSelection[gPlayerCount - 1]) { + gGameModeMenuColumn[gPlayerCount - 1] += 1; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } } - // L800B2D94 if (btnAndStick & U_JPAD) { - if (D_800E86AC[gPlayerCount - 1] > 0) { - D_800E86AC[gPlayerCount - 1] -= 1; - func_800B44AC(); + if (gGameModeMenuColumn[gPlayerCount - 1] > 0) { + gGameModeMenuColumn[gPlayerCount - 1] -= 1; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } } - // L800B2DE0 if (btnAndStick & B_BUTTON) { - gMainMenuSelectionDepth = PLAYER_NUM_SELECTION; - func_800B44AC(); + gMainMenuSelection = MAIN_MENU_PLAYER_SELECT; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_GO_BACK); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else if (btnAndStick & A_BUTTON) { - // L800B2E3C - switch (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]) { + break; + } + + if (btnAndStick & A_BUTTON) { + switch (gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) { + default: + gMainMenuSelection = MAIN_MENU_OK_SELECT; + break; case 0: - gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; + gMainMenuSelection = MAIN_MENU_MODE_SUB_SELECT; play_sound2(SOUND_MENU_GP); break; case 2: - gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; + gMainMenuSelection = MAIN_MENU_MODE_SUB_SELECT; play_sound2(SOUND_MENU_VERSUS); break; case 1: - gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; + gMainMenuSelection = MAIN_MENU_MODE_SUB_SELECT; play_sound2(SOUND_MENU_TIME_TRIALS); break; case 3: - gMainMenuSelectionDepth = CONFIRM_OK_SELECTION; + gMainMenuSelection = MAIN_MENU_OK_SELECT; play_sound2(SOUND_MENU_BATTLE); break; - default: - gMainMenuSelectionDepth = CONFIRM_OK_SELECTION; - break; } - // L800B2F04 - func_800B44AC(); + reset_cycle_flash_menu(); gMenuTimingCounter = 0; - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else { - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + break; } break; - } - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: { - if (arg1 == 0) { + case MAIN_MENU_MODE_SUB_SELECT: + case MAIN_MENU_MODE_SUB_SELECT_GO_BACK: + if (controllerIdx == PLAYER_ONE) { gMenuTimingCounter++; - if ((gMenuTimingCounter == 100 || gMenuTimingCounter % 300 == 0)) { - // L800B2FAC - if (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]] == 0 || - gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]] == 2) { - play_sound2(SOUND_MENU_SELECT_LEVEL); + if ((gMenuTimingCounter == 100) || !(gMenuTimingCounter % 300)) { + switch (gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) { + case 0: + case 2: + play_sound2(SOUND_MENU_SELECT_LEVEL); + break; + default: + break; } } } - // L800B3000 - sp28 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - if ((btnAndStick & U_JPAD) && (sp28 > 0)) { - D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]] -= 1; - func_800B44AC(); + + subMode = gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; + if ((btnAndStick & U_JPAD) && (subMode > 0)) { + gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]] -= 1; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } - // L800B3068 if (btnAndStick & D_JPAD) { - sp24 = false; - if (func_800B555C()) { - if (sp28 < gGameModePlayerColumnExtra[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1] + 1]) { - sp24 = true; + cursorMoved = false; + if (has_unlocked_extra_mode()) { + if (subMode < + sGameModePlayerColumnExtra[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) { + cursorMoved = true; } } else { - // L800B30D4 - if (sp28 < gGameModePlayerColumnDefault[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1] + 1]) { - sp24 = true; + if (subMode < + sGameModePlayerColumnDefault[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) { + cursorMoved = true; } } - // L800B3110 - if (sp24) { - D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]++; - func_800B44AC(); + if (cursorMoved) { + gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]++; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } } - // L800B3150 - sp28 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + subMode = gGameModeSubMenuColumn[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; + if (btnAndStick & B_BUTTON) { - gMainMenuSelectionDepth = GAME_MODE_SELECTION; - func_800B44AC(); + gMainMenuSelection = MAIN_MENU_MODE_SELECT; + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_GO_BACK); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else if (btnAndStick & A_BUTTON) { - // L800B31DC - func_800B44AC(); - if (gPlayerCount == 1 && D_800E86AC[gPlayerCount - 1] == 1 && sp28 == 1) { + break; + } + if (btnAndStick & A_BUTTON) { + reset_cycle_flash_menu(); + if ((gPlayerCount == 1) && ((gGameModeMenuColumn - 1)[gPlayerCount] == 1) && (subMode == 1)) { func_8009E258(); play_sound2(SOUND_MENU_DATA); } else { - gMainMenuSelectionDepth = CONFIRM_OK_SELECTION; + gMainMenuSelection = MAIN_MENU_OK_SELECT; play_sound2(SOUND_MENU_SELECT); gMenuTimingCounter = 0; } - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else { - // L800B3294 - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + break; } break; - } - case CONFIRM_OK_SELECTION: - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: { - if ((arg1 == 0) && (++gMenuTimingCounter == 60 || gMenuTimingCounter % 300 == 0)) { - play_sound2(SOUND_MENU_OK); + case MAIN_MENU_OK_SELECT: + case MAIN_MENU_OK_SELECT_GO_BACK: + if (controllerIdx == PLAYER_ONE) { + gMenuTimingCounter++; + if ((gMenuTimingCounter == 60) || !(gMenuTimingCounter % 300)) { + play_sound2(SOUND_MENU_OK); + } } - // L800B330C if (btnAndStick & B_BUTTON) { - switch (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]) { + switch (gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) { case 0: case 1: case 2: - gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; + gMainMenuSelection = MAIN_MENU_MODE_SUB_SELECT; break; - case 3: default: - gMainMenuSelectionDepth = GAME_MODE_SELECTION; + case 3: + gMainMenuSelection = MAIN_MENU_MODE_SELECT; break; } - // L800B3384 - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_GO_BACK); gMenuTimingCounter = 0; - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else if (btnAndStick & A_BUTTON) { - // L800B33D8 + break; + } + if (btnAndStick & A_BUTTON) { func_8009E1C0(); play_sound2(SOUND_MENU_OK_CLICKED); - func_800B28C8(); - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; - } else { - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + setup_selected_game_mode(); + break; } break; - } - case OPTIONS_SELECTION: - case DATA_SELECTION: { - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + case MAIN_MENU_OPTION: + case MAIN_MENU_DATA: break; - } - default: { - newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + default: break; - } } - gModeSelection = newMode; + gModeSelection = gGameModePlayerSelection[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]; } } -#else -GLOBAL_ASM("asm/non_matchings/menus/main_menu_act.s") -#endif -// check if there is no currently selected and/or hovered character at grid position `gridId` +/** + * Check if there is no currently selected and/or + * hovered character at grid position `gridId` + */ bool is_character_spot_free(s32 gridId) { s32 i; for (i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) { @@ -1484,295 +1500,297 @@ bool is_character_spot_free(s32 gridId) { return true; } -#ifdef NON_MATCHING -// grid positions are from right to left, then top to bottom -// nonmatching: the gCharacterGridSelections pointer is not promoted to $s0 -void player_select_menu_act(struct Controller* controller, u16 arg1) { - s8* bar; - s8 selected; +/** + * Navigation of the player select screen + * Grid positions are from right to left, then top to bottom + */ +void player_select_menu_act(struct Controller* controller, u16 controllerIdx) { s8 i; - s8 saved_selection; + s8 j; + s32 selected; u16 btnAndStick; - btnAndStick = (controller->buttonPressed) | (controller->stickPressed); - if (!gEnableDebugMode && btnAndStick & CONT_START) { + btnAndStick = (controller->buttonPressed | controller->stickPressed); + if (!gEnableDebugMode && (btnAndStick & START_BUTTON)) { btnAndStick |= A_BUTTON; } - if (!func_800B4520()) { - switch (D_8018EDEE) { - case 1: { - saved_selection = gCharacterGridSelections[arg1]; - if (saved_selection == 0) { + if (!is_screen_being_faded()) { + switch (gPlayerSelectMenuSelection) { + case PLAYER_SELECT_MENU_MAIN: + if (gCharacterGridSelections[controllerIdx] == 0) { if (btnAndStick & B_BUTTON) { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } return; } - // L800B3630 + if (btnAndStick & B_BUTTON) { - if (D_8018EDE8[arg1]) { - D_8018EDE8[arg1] = false; + if (gCharacterGridIsSelected[controllerIdx] != false) { + gCharacterGridIsSelected[controllerIdx] = false; play_sound2(SOUND_MENU_GO_BACK); } else { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } } - // L800B3684 - if ((btnAndStick & A_BUTTON) && (D_8018EDE8[arg1] == 0)) { - D_8018EDE8[arg1] = true; - i = D_800F2BAC[gCharacterGridSelections[arg1] - 1]; - func_800C90F4(arg1, 0x2900800e + (i << 4)); + + if ((btnAndStick & A_BUTTON) && (gCharacterGridIsSelected[controllerIdx] == 0)) { + gCharacterGridIsSelected[controllerIdx] = true; + func_800C90F4(controllerIdx, + ((sCharacterGridOrder - 1)[gCharacterGridSelections[controllerIdx]] * 0x10) + + 0x2900800E); } - // L800B36F4 + selected = false; - for (i = 0; i < 4; i++) { // for (i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) { - if ((gCharacterGridSelections[i] != 0) && - (D_8018EDE8[i] == 0)) { //(gCharacterGridSelections[i] && D_8018EDE8[i]) { + for (i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) { + if ((gCharacterGridSelections[i] != 0) && (gCharacterGridIsSelected[i] == false)) { selected = true; break; } } - // L800B3738 if (!selected) { - D_8018EDEE = 2; - func_800B44AC(); + gPlayerSelectMenuSelection = PLAYER_SELECT_MENU_OK; + reset_cycle_flash_menu(); gMenuTimingCounter = 0; } - // L800B3768 - if (D_8018EDE8[arg1] == 0) { - if ((btnAndStick & CONT_RIGHT) && (btnAndStick & CONT_DOWN)) { - if (saved_selection == 1 || saved_selection == 2 || saved_selection == 3) { - // L800B37B0 - saved_selection += 5; - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); - } + if (gCharacterGridIsSelected[controllerIdx] != false) { + break; + } + j = gCharacterGridSelections[controllerIdx]; + if ((btnAndStick & R_JPAD) && (btnAndStick & D_JPAD)) { + if ((gCharacterGridSelections[controllerIdx] == 1U) || + (gCharacterGridSelections[controllerIdx] == 2U) || + (gCharacterGridSelections[controllerIdx] == 3U)) { + j = gCharacterGridSelections[controllerIdx] + 5; + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); } - return; } - // L800B37E4 - if ((btnAndStick & CONT_LEFT) && (btnAndStick & CONT_DOWN)) { - if (saved_selection == 2 || saved_selection == 3 || saved_selection == 4) { - saved_selection += 3; - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); - } + return; + } + if ((btnAndStick & L_JPAD) && (btnAndStick & D_JPAD)) { + if ((gCharacterGridSelections[controllerIdx] == 2U) || + (gCharacterGridSelections[controllerIdx] == 3U) || + (gCharacterGridSelections[controllerIdx] == 4U)) { + j = gCharacterGridSelections[controllerIdx] + 3; + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); } - return; } - // L800B3844 - if ((btnAndStick & CONT_RIGHT) && (btnAndStick & CONT_UP)) { - if (saved_selection == 5 || saved_selection == 6 || saved_selection == 7) { - saved_selection -= 3; - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); - } + return; + } + if ((btnAndStick & R_JPAD) && (btnAndStick & U_JPAD)) { + if ((gCharacterGridSelections[controllerIdx] == 5U) || + (gCharacterGridSelections[controllerIdx] == 6U) || + (gCharacterGridSelections[controllerIdx] == 7U)) { + j = gCharacterGridSelections[controllerIdx] - 3; + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); } - return; } - // L800B38A0 - if ((btnAndStick & CONT_LEFT) && (btnAndStick & CONT_UP)) { - if (saved_selection == 6 || saved_selection == 7 || saved_selection == 8) { - saved_selection -= 5; - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); - } + return; + } + + if ((btnAndStick & L_JPAD) && (btnAndStick & U_JPAD)) { + if ((gCharacterGridSelections[controllerIdx] == 6U) || + (gCharacterGridSelections[controllerIdx] == 7U) || + (gCharacterGridSelections[controllerIdx] == 8U)) { + j = gCharacterGridSelections[controllerIdx] - 5; + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); } - return; } - // L800B38FC - if (btnAndStick & CONT_RIGHT) { - if (saved_selection == 4 || saved_selection == 8) - return; - saved_selection += 1; + return; + } + if (btnAndStick & R_JPAD) { + if ((gCharacterGridSelections[controllerIdx] != 4U) && + (gCharacterGridSelections[controllerIdx] != 8U)) { + j = gCharacterGridSelections[controllerIdx] + 1; do { - // L800B391C - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); // play_sound2(0x49008000); + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); + return; + } + + j++; + if (j == 5 || j == 9) { break; } - saved_selection += 1; - if ((saved_selection == 5) || (saved_selection == 9)) - return; - } while (saved_selection < 10); - return; + } while (j < 10); } - // L800B3978 - if (btnAndStick & CONT_LEFT) { - if (saved_selection == 1 || saved_selection == 5) - return; - saved_selection -= 1; + return; + } + if (btnAndStick & L_JPAD) { + if ((gCharacterGridSelections[controllerIdx] != 1U) && + (gCharacterGridSelections[controllerIdx] != 5U)) { + j = gCharacterGridSelections[controllerIdx] - 1; do { - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); + return; + } + + j--; + if (j == 0 || j == 4) { break; } - saved_selection -= 1; - if ((saved_selection == 0) || (saved_selection == 4)) - return; - } while (saved_selection >= 0); - return; - } - // L800B39F4 - if ((btnAndStick & CONT_UP) && (saved_selection >= 5)) { - saved_selection = saved_selection - 4; - } - if ((btnAndStick & CONT_DOWN) && (saved_selection < 5)) { - saved_selection = saved_selection + 4; - } - // L800B3A30 - if (is_character_spot_free(saved_selection)) { - gCharacterGridSelections[arg1] = saved_selection; - play_sound2(0x49008000); + } while (j >= 0); } + return; + } + + if ((btnAndStick & U_JPAD) && (gCharacterGridSelections[controllerIdx] >= 5)) { + j = gCharacterGridSelections[controllerIdx] - 4; + } + if ((btnAndStick & D_JPAD) && (gCharacterGridSelections[controllerIdx] < 5)) { + j = gCharacterGridSelections[controllerIdx] + 4; + } + if (is_character_spot_free(j)) { + gCharacterGridSelections[controllerIdx] = j; + play_sound2(SOUND_MENU_CURSOR_MOVE); } break; - } - case 2: - case 3: - if (arg1 == 0) { + case PLAYER_SELECT_MENU_OK: + case PLAYER_SELECT_MENU_OK_GO_BACK: + if (controllerIdx == 0) { gMenuTimingCounter++; - if ((gMenuTimingCounter == 60) || ((gMenuTimingCounter % 300) == 0)) { - // L800B3A94 - play_sound2(0x4900900F); + if (gMenuTimingCounter == 0x3C || !(gMenuTimingCounter % 300)) { + play_sound2(SOUND_MENU_OK); } } - // L800B3AA4 if (btnAndStick & B_BUTTON) { - D_8018EDEE = 1; - D_8018EDE8[arg1] = false; + gPlayerSelectMenuSelection = PLAYER_SELECT_MENU_MAIN; + gCharacterGridIsSelected[controllerIdx] = false; play_sound2(SOUND_MENU_GO_BACK); break; } if (btnAndStick & A_BUTTON) { func_8009E1C0(); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); func_8000F124(); } break; default: break; } - // L800B3B24 - if (gCharacterGridSelections[arg1] != 0) { - gCharacterSelections[arg1] = D_800F2BAC[gCharacterGridSelections[arg1] - 1]; + + if (gCharacterGridSelections[controllerIdx] != 0) { + gCharacterSelections[controllerIdx] = (sCharacterGridOrder - 1)[gCharacterGridSelections[controllerIdx]]; } } - // L800B3B44 } -#else -GLOBAL_ASM("asm/non_matchings/menus/player_select_menu_act.s") -#endif -// Handle navigating the course menu interface -void course_select_menu_act(struct Controller* arg0, u16 arg1) { - u16 buttonAndStickPress = (arg0->buttonPressed | arg0->stickPressed); +/** + * Navigation of the map select course menu screen + */ +void course_select_menu_act(struct Controller* arg0, u16 controllerIdx) { + u16 btnAndStick = (arg0->buttonPressed | arg0->stickPressed); - if ((!gEnableDebugMode) && ((buttonAndStickPress & START_BUTTON) != 0)) { - buttonAndStickPress |= A_BUTTON; + if ((!gEnableDebugMode) && ((btnAndStick & START_BUTTON) != 0)) { + btnAndStick |= A_BUTTON; } - if (func_800B4520() == 0) { - switch (D_8018EDEC) { - case 1: - if ((buttonAndStickPress & R_JPAD) != 0) { + if (!is_screen_being_faded()) { + switch (gSubMenuSelection) { + case SUB_MENU_MAP_SELECT_CUP: + if ((btnAndStick & R_JPAD) != 0) { if (gCupSelection < SPECIAL_CUP) { - D_8018EE0A = gCupSelection; + sTempCupSelection = gCupSelection; ++gCupSelection; - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } } - if (((buttonAndStickPress & L_JPAD) != 0) && (gCupSelection > MUSHROOM_CUP)) { - D_8018EE0A = gCupSelection; + if (((btnAndStick & L_JPAD) != 0) && (gCupSelection > MUSHROOM_CUP)) { + sTempCupSelection = gCupSelection; --gCupSelection; - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } D_800DC540 = gCupSelection; gCurrentCourseId = gCupCourseOrder[gCupSelection][gCourseIndexInCup]; - if ((buttonAndStickPress & B_BUTTON) != 0) { + if ((btnAndStick & B_BUTTON) != 0) { func_8009E208(); play_sound2(SOUND_MENU_GO_BACK); - } else if ((buttonAndStickPress & A_BUTTON) != 0) { + } else if ((btnAndStick & A_BUTTON) != 0) { if (gModeSelection != GRAND_PRIX) { - D_8018EDEC = 2; + gSubMenuSelection = SUB_MENU_MAP_SELECT_COURSE; play_sound2(SOUND_MENU_SELECT); } else { - D_8018EDEC = 3; + gSubMenuSelection = SUB_MENU_MAP_SELECT_OK; play_sound2(SOUND_MENU_SELECT); gCurrentCourseId = gCupCourseOrder[gCupSelection][COURSE_ONE]; gMenuTimingCounter = 0; } - func_800B44AC(); + reset_cycle_flash_menu(); } break; - case 2: - case 4: - if (((buttonAndStickPress & D_JPAD) != 0) && (gCourseIndexInCup < COURSE_FOUR)) { + case SUB_MENU_MAP_SELECT_COURSE: + case SUB_MENU_MAP_SELECT_BATTLE_COURSE: + if (((btnAndStick & D_JPAD) != 0) && (gCourseIndexInCup < COURSE_FOUR)) { ++gCourseIndexInCup; - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } - if (((buttonAndStickPress & U_JPAD) != 0) && (gCourseIndexInCup > COURSE_ONE)) { + if (((btnAndStick & U_JPAD) != 0) && (gCourseIndexInCup > COURSE_ONE)) { --gCourseIndexInCup; - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_CURSOR_MOVE); } gCurrentCourseId = gCupCourseOrder[gCupSelection][gCourseIndexInCup]; - if ((buttonAndStickPress & B_BUTTON) != 0) { - if (D_8018EDEC == 2) { - D_8018EDEC = 1; + if ((btnAndStick & B_BUTTON) != 0) { + if (gSubMenuSelection == SUB_MENU_MAP_SELECT_COURSE) { + gSubMenuSelection = SUB_MENU_MAP_SELECT_CUP; } else { func_8009E208(); } - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_GO_BACK); return; } - if ((buttonAndStickPress & A_BUTTON) != 0) { - D_8018EDEC = 3; + if ((btnAndStick & A_BUTTON) != 0) { + gSubMenuSelection = SUB_MENU_MAP_SELECT_OK; play_sound2(SOUND_MENU_SELECT); - func_800B44AC(); + reset_cycle_flash_menu(); gMenuTimingCounter = 0; } break; - case 3: - if ((arg1 == 0) && ((++gMenuTimingCounter == 0x3C) || ((gMenuTimingCounter % 300) == 0))) { + case SUB_MENU_MAP_SELECT_OK: + if ((controllerIdx == PLAYER_ONE) && + ((++gMenuTimingCounter == 0x3C) || ((gMenuTimingCounter % 300) == 0))) { play_sound2(SOUND_MENU_OK); } - if ((buttonAndStickPress & B_BUTTON) != 0) { + if ((btnAndStick & B_BUTTON) != 0) { switch (gModeSelection) { case GRAND_PRIX: - D_8018EDEC = 1; + gSubMenuSelection = SUB_MENU_MAP_SELECT_CUP; break; case BATTLE: - D_8018EDEC = 4; + gSubMenuSelection = SUB_MENU_MAP_SELECT_BATTLE_COURSE; break; default: - D_8018EDEC = 2; + gSubMenuSelection = SUB_MENU_MAP_SELECT_COURSE; break; } - func_800B44AC(); + reset_cycle_flash_menu(); play_sound2(SOUND_MENU_GO_BACK); return; } - if ((buttonAndStickPress & A_BUTTON) != 0) { + if ((btnAndStick & A_BUTTON) != 0) { func_8009E1C0(); func_800CA330(0x19); play_sound2(SOUND_MENU_OK_CLICKED); @@ -1782,46 +1800,49 @@ void course_select_menu_act(struct Controller* arg0, u16 arg1) { } } -void func_800B3F74(s32 menuSelection) { +/** + * Loads menu states so they are preserved between menu changes + */ +void load_menu_states(s32 menuSelection) { s32 i; - gDebugMenuSelection = DEBUG_MENU; + gDebugMenuSelection = DEBUG_MENU_SELECTION; gMenuTimingCounter = 0; gMenuDelayTimer = 0; - D_8018EE08 = 0; + gDemoUseController = 0; D_8015F890 = 0; D_8015F892 = 0; gDebugGotoScene = DEBUG_GOTO_RACING; - D_8018EDFB = 0; + gGhostPlayerInit = 0; D_8016556E = 0; - D_80162DD4 = 1; + bPlayerGhostDisabled = 1; D_80162DD8 = 1; D_80162E00 = 0; D_80162DC8 = 1; D_80162DCC = 0; switch (menuSelection) { - case 5: - D_8018EDEC = 21; + case OPTIONS_MENU: + gSubMenuSelection = SUB_MENU_OPTION_RETURN_GAME_SELECT; break; - case 6: - D_8018EDEC = 1; + case DATA_MENU: + gSubMenuSelection = SUB_MENU_DATA; break; - case 7: - D_8018EDEC = 11; + case COURSE_DATA_MENU: + gSubMenuSelection = SUB_MENU_DATA_OPTIONS; break; - case 8: + case LOGO_INTRO_MENU: func_800CA008(0, 0); break; - case 9: { + case CONTROLLER_PAK_MENU: { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_SELECT_RECORD; func_800CA008(0, 0); break; } case 0: - case 10: { + case START_MENU: { gIsMirrorMode = 0; - gEnableDebugMode = DEBUG_MODE; + gEnableDebugMode = DEBUG_MODE_TOGGLE; gCupSelection = MUSHROOM_CUP; gCourseIndexInCup = 0; gTimeTrialDataCourseIndex = 0; @@ -1831,17 +1852,17 @@ void func_800B3F74(s32 menuSelection) { if (gPlayerCount >= 5) { gPlayerCount = 4; } - D_8018EDF1 = D_800F2BE0[gPlayerCount - 1]; + gScreenModeListIndex = sScreenModeIdxFromPlayerMode[gPlayerCount - 1]; func_800CA008(0, 0); - func_800C8EAC(1); - D_8018EDFC = 0; + play_sequence(SEQ_MENU_TITLE_SCREEN); + gCourseMapInit = 0; break; } case 1: - case 11: { - gEnableDebugMode = DEBUG_MODE; + case MAIN_MENU: { + gEnableDebugMode = DEBUG_MODE_TOGGLE; gIsMirrorMode = 0; - D_8018EDFC = 0; + gCourseMapInit = 0; func_800B5F30(); func_8000F0E0(); @@ -1850,48 +1871,48 @@ void func_800B3F74(s32 menuSelection) { func_800CB2C4(); gGamestate = 0; gGamestateNext = 0; - func_800C8EAC(2); + play_sequence(SEQ_MENU_MAIN_MENU); } - switch (D_8018EDE0) { - case 0: { - gMainMenuSelectionDepth = PLAYER_NUM_SELECTION; - func_800C8EAC(2); + switch (gMenuFadeType) { + case MENU_FADE_TYPE_MAIN: { + gMainMenuSelection = MAIN_MENU_PLAYER_SELECT; + play_sequence(SEQ_MENU_MAIN_MENU); gPlayerCount = 1; if (gScreenModeSelection >= NUM_SCREEN_MODES || gScreenModeSelection < 0) { gScreenModeSelection = SCREEN_MODE_1P; } break; } - case 1: { - gMainMenuSelectionDepth = CONFIRM_OK_SELECTION_FROM_BACK_OUT; + case MENU_FADE_TYPE_BACK: { + gMainMenuSelection = MAIN_MENU_OK_SELECT_GO_BACK; break; } - case 3: { + case MENU_FADE_TYPE_DATA: { // why... - switch (gMainMenuSelectionDepth) { + switch (gMainMenuSelection) { default: - gMainMenuSelectionDepth = TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT; + gMainMenuSelection = MAIN_MENU_MODE_SUB_SELECT_GO_BACK; break; - case OPTIONS_SELECTION: - case DATA_SELECTION: - gMainMenuSelectionDepth = PLAYER_NUM_SELECTION; + case MAIN_MENU_OPTION: + case MAIN_MENU_DATA: + gMainMenuSelection = MAIN_MENU_PLAYER_SELECT; break; } break; } - case 4: { - gMainMenuSelectionDepth = PLAYER_NUM_SELECTION; + case MENU_FADE_TYPE_OPTION: { + gMainMenuSelection = MAIN_MENU_PLAYER_SELECT; break; } } break; } case 2: - case 12: { - switch (D_8018EDE0) { - case 0: { - D_8018EDEE = 1; + case CHARACTER_SELECT_MENU: { + switch (gMenuFadeType) { + case MENU_FADE_TYPE_MAIN: { + gPlayerSelectMenuSelection = PLAYER_SELECT_MENU_MAIN; if (gGamestate == 0) { for (i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) { if (i < gPlayerCount) { @@ -1899,7 +1920,7 @@ void func_800B3F74(s32 menuSelection) { } else { gCharacterGridSelections[i] = 0; } - D_8018EDE8[i] = false; + gCharacterGridIsSelected[i] = false; gCharacterSelections[i] = i; } play_sound2(SOUND_MENU_SELECT_PLAYER); @@ -1908,20 +1929,20 @@ void func_800B3F74(s32 menuSelection) { func_800CB2C4(); gGamestate = 0; gGamestateNext = 0; - func_800C8EAC(2); - for (i = 0; i < ARRAY_COUNT(D_8018EDE8); i++) { - D_8018EDE8[i] = false; + play_sequence(SEQ_MENU_MAIN_MENU); + for (i = 0; i < ARRAY_COUNT(gCharacterGridIsSelected); i++) { + gCharacterGridIsSelected[i] = false; } } break; } - case 1: { - D_8018EDEE = 3; - for (i = 0; i < ARRAY_COUNT(D_8018EDE8); i++) { + case MENU_FADE_TYPE_BACK: { + gPlayerSelectMenuSelection = PLAYER_SELECT_MENU_OK_GO_BACK; + for (i = 0; i < ARRAY_COUNT(gCharacterGridIsSelected); i++) { if (gPlayerCount > i) { - D_8018EDE8[i] = true; + gCharacterGridIsSelected[i] = true; } else { - D_8018EDE8[i] = false; + gCharacterGridIsSelected[i] = false; } } break; @@ -1930,26 +1951,26 @@ void func_800B3F74(s32 menuSelection) { break; } case 3: - case 13: { + case COURSE_SELECT_MENU: { if (gModeSelection == BATTLE) { gCupSelection = BATTLE_CUP; D_800DC540 = 4; - D_8018EDEC = 4; + gSubMenuSelection = SUB_MENU_MAP_SELECT_BATTLE_COURSE; } else { if (gCupSelection == BATTLE_CUP) { gCupSelection = MUSHROOM_CUP; } - D_8018EDEC = 1; + gSubMenuSelection = SUB_MENU_MAP_SELECT_CUP; } if (gGamestate != 0) { func_800CA008(0, 0); func_800CB2C4(); gGamestate = 0; gGamestateNext = 0; - func_800C8EAC(2); + play_sequence(SEQ_MENU_MAIN_MENU); } play_sound2(SOUND_MENU_SELECT_MAP); - D_8018EE0A = 0; + sTempCupSelection = 0; if (gModeSelection == GRAND_PRIX) { gCourseIndexInCup = 0; } @@ -1960,35 +1981,47 @@ void func_800B3F74(s32 menuSelection) { break; } } - func_800B44AC(); + reset_cycle_flash_menu(); } -void func_800B44AC(void) { +/** + * Self explanatory, gets reset when moving cursor option or after a fade + */ +void reset_cycle_flash_menu(void) { gCycleFlashMenu = 0x20; } -void func_800B44BC(void) { +/** + * Self explanatory, changes sound mode pack + */ +void set_sound_mode(void) { UNUSED u32 pad; union GameModePack pack; - pack = gSoundMenuPack; + pack = sSoundMenuPack; if ((gSoundMode == SOUND_STEREO) || (gSoundMode == SOUND_HEADPHONES) || (gSoundMode == SOUND_MONO)) { func_800C3448(pack.modes[gSoundMode] | 0xE0000000); } } -// Likely checks that the user is actually in the menus and not racing. -bool func_800B4520(void) { - - if ((D_8018E7AC[4] == 2) || (D_8018E7AC[4] == 3) || (D_8018E7AC[4] == 4) || (D_8018E7AC[4] == 7)) { +/** + * Checks is a fade render mode is active so menus can't be + * interacted while a fade transition is active + */ +bool is_screen_being_faded(void) { + if ((gTransitionType[4] == 2) || (gTransitionType[4] == 3) || (gTransitionType[4] == 4) || + (gTransitionType[4] == 7)) { return true; } return false; } -UNUSED void func_800B4560(s32 arg0, s32 arg1) { +/** + * Unused debug function, prints the character id for the player and both controller pak ghosts + */ +UNUSED void debug_print_ghost_kart_character_id(s32 arg0, s32 arg1) { struct_8018EE10_entry* pak1 = D_8018EE10; - struct_8018EE10_entry* pak2 = (struct_8018EE10_entry*) D_8018D9C0; + struct_8018EE10_entry* pak2 = (struct_8018EE10_entry*) gSomeDLBuffer; rmonPrintf("ghost_kart=%d,", D_80162DE0); rmonPrintf("pak1_ghost_kart=%d,", (pak1 + arg0)->characterId); diff --git a/src/menus.h b/src/menus.h index f3007cc008..64b97a147f 100644 --- a/src/menus.h +++ b/src/menus.h @@ -5,9 +5,6 @@ #include #include -// D_8018EDEC is position on options screen? -enum MenuOptionsCursorPositions { MENU_OPTIONS_CSRPOS_SOUNDMODE = 0x16 }; - // needs to be a union (or array...?) to go into rodata as a const // terrible for endianness... Best guess as to what this is for.. union GameModePack { @@ -15,8 +12,180 @@ union GameModePack { s32 word; }; -// This really, really shouldn't be in this header file, but I don't know where else to put it -void rmonPrintf(const char*, ...); +/** + * @brief Options for gMenuFadeType + */ +enum MenuFadeTypes { + MENU_FADE_TYPE_MAIN, + MENU_FADE_TYPE_BACK, + MENU_FADE_TYPE_DEMO, + MENU_FADE_TYPE_DATA, + MENU_FADE_TYPE_OPTION, + MENU_FADE_TYPE_MAX +}; + +/** + * @brief Options for gSubMenuSelection + */ +enum SubMenuSelectionType { + SUB_MENU_NONE, + SUB_MENU_DATA, // 0x01, value repurposed in map select + SUB_MENU_MAP_SELECT_CUP = 0x01, + SUB_MENU_MAP_SELECT_COURSE, + SUB_MENU_MAP_SELECT_OK, + SUB_MENU_MAP_SELECT_BATTLE_COURSE, + SUB_MENU_DATA_OPTIONS = 0x0B, + SUB_MENU_DATA_ERASE_CONFIRM, + SUB_MENU_DATA_CANT_ERASE, + SUB_MENU_OPTION_MIN = 0x15, + SUB_MENU_OPTION_RETURN_GAME_SELECT = SUB_MENU_OPTION_MIN, + SUB_MENU_OPTION_SOUND_MODE, + SUB_MENU_OPTION_COPY_CONTROLLER_PAK, + SUB_MENU_OPTION_ERASE_ALL_DATA, + SUB_MENU_OPTION_MAX = SUB_MENU_OPTION_ERASE_ALL_DATA, // 0x18 + SUB_MENU_ERASE_MIN = 0x1E, + SUB_MENU_ERASE_QUIT = SUB_MENU_ERASE_MIN, + SUB_MENU_ERASE_ERASE, + SUB_MENU_ERASE_MAX = SUB_MENU_ERASE_ERASE, // 0x1F + SUB_MENU_SAVE_DATA_ERASED, // 0x20 + SUB_MENU_COPY_PAK_FROM_GHOST_MIN = 0x28, + SUB_MENU_COPY_PAK_FROM_GHOST1_1P = SUB_MENU_COPY_PAK_FROM_GHOST_MIN, + SUB_MENU_COPY_PAK_FROM_GHOST2_1P, + SUB_MENU_COPY_PAK_FROM_GHOST_MAX = SUB_MENU_COPY_PAK_FROM_GHOST2_1P, // 0x29 + SUB_MENU_COPY_PAK_ERROR_2P_MIN, // 0x2A + SUB_MENU_COPY_PAK_ERROR_NO_GHOST_DATA = SUB_MENU_COPY_PAK_ERROR_2P_MIN, + SUB_MENU_COPY_PAK_ERROR_NO_GAME_DATA, + SUB_MENU_COPY_PAK_ERROR_NO_PAK_2P, + SUB_MENU_COPY_PAK_ERROR_BAD_READ_2P, + SUB_MENU_COPY_PAK_ERROR_2P_MAX = SUB_MENU_COPY_PAK_ERROR_BAD_READ_2P, // 0x2D + SUB_MENU_COPY_PAK_TO_GHOST_MIN = 0x32, + SUB_MENU_COPY_PAK_TO_GHOST1_2P = SUB_MENU_COPY_PAK_TO_GHOST_MIN, + SUB_MENU_COPY_PAK_TO_GHOST2_2P, + SUB_MENU_COPY_PAK_TO_GHOST_MAX = SUB_MENU_COPY_PAK_TO_GHOST2_2P, // 0x33 + SUB_MENU_COPY_PAK_ERROR_1P_MIN, + SUB_MENU_COPY_PAK_ERROR_NO_PAK_1P = SUB_MENU_COPY_PAK_ERROR_1P_MIN, // 0x34 + SUB_MENU_COPY_PAK_ERROR_BAD_READ_1P, + SUB_MENU_COPY_PAK_ERROR_CANT_CREATE_1P, + SUB_MENU_COPY_PAK_ERROR_NO_PAGES_1P, + SUB_MENU_COPY_PAK_ERROR_1P_MAX, + SUB_MENU_COPY_PAK_PROMPT_MIN = SUB_MENU_COPY_PAK_ERROR_1P_MAX, // 0x38 + SUB_MENU_COPY_PAK_PROMPT_QUIT = SUB_MENU_COPY_PAK_PROMPT_MIN, + SUB_MENU_COPY_PAK_PROMPT_COPY, + SUB_MENU_COPY_PAK_PROMPT_MAX = SUB_MENU_COPY_PAK_PROMPT_COPY, // 0x39 + SUB_MENU_COPY_PAK_ACTION_MIN, + SUB_MENU_COPY_PAK_START = SUB_MENU_COPY_PAK_ACTION_MIN, // 0x3A + SUB_MENU_COPY_PAK_COPYING, + SUB_MENU_COPY_PAK_COMPLETED, + SUB_MENU_COPY_PAK_ACTION_MAX = SUB_MENU_COPY_PAK_COMPLETED, // 0x3C + SUB_MENU_COPY_PAK_UNABLE_ERROR_MIN = 0x41, + SUB_MENU_COPY_PAK_UNABLE_COPY_FROM_1P = SUB_MENU_COPY_PAK_UNABLE_ERROR_MIN, + SUB_MENU_COPY_PAK_UNABLE_READ_FROM_2P, + SUB_MENU_COPY_PAK_UNABLE_ERROR_MAX = SUB_MENU_COPY_PAK_UNABLE_READ_FROM_2P, + SUB_MENU_COPY_PAK_CREATE_GAME_DATA_INIT = 0x46, + SUB_MENU_COPY_PAK_CREATE_GAME_DATA_DONE +}; + +/** + * @brief Options for gMainMenuSelection + */ +enum MainMenuSelectionType { + MAIN_MENU_NONE, + MAIN_MENU_OPTION, + MAIN_MENU_DATA, + MAIN_MENU_PLAYER_SELECT, + MAIN_MENU_MODE_SELECT, // Mario GP - T. Trials - VS - Battle + MAIN_MENU_MODE_SUB_SELECT, // CC Selection and T.Trials options (Begin, Data) + MAIN_MENU_OK_SELECT, // OK option after selecting a submode + MAIN_MENU_OK_SELECT_GO_BACK, // OK option after going back from player select + MAIN_MENU_MODE_SUB_SELECT_GO_BACK // Used in T.Trials after going back to Data option from course data +}; + +/** + * @brief Options for gPlayerSelectMenuSelection + */ +enum PlayerSelectMenuSelectionTypes { + PLAYER_SELECT_MENU_NONE, + PLAYER_SELECT_MENU_MAIN, + PLAYER_SELECT_MENU_OK, // OK option after selecting characters + PLAYER_SELECT_MENU_OK_GO_BACK // OK option after going back from map select +}; + +/** + * @brief Options for gDebugMenuSelection + */ +enum DebugMenuSelectionTypes { + DEBUG_MENU_NONE, + DEBUG_MENU_DISABLED, + DEBUG_MENU_DEBUG_MODE, + DEBUG_MENU_COURSE, + DEBUG_MENU_SCREEN_MODE, + DEBUG_MENU_PLAYER, + DEBUG_MENU_SOUND_MODE, + DEBUG_MENU_GIVE_ALL_GOLD_CUP, + DEBUG_MENU_OPTION_SELECTED = 0x40 +}; + +/** + * @brief Options for gControllerPakMenuSelection + */ +enum ControllerPakMenuSelectionTypes { + CONTROLLER_PAK_MENU_NONE, + CONTROLLER_PAK_MENU_SELECT_RECORD, + CONTROLLER_PAK_MENU_END, + CONTROLLER_PAK_MENU_ERASE, + CONTROLLER_PAK_MENU_QUIT, + CONTROLLER_PAK_MENU_TABLE_GAME_DATA, + CONTROLLER_PAK_MENU_GO_TO_ERASING, + CONTROLLER_PAK_MENU_ERASING, + CONTROLLER_PAK_MENU_ERASE_ERROR_NOT_ERASED, + CONTROLLER_PAK_MENU_ERASE_ERROR_NO_PAK, + CONTROLLER_PAK_MENU_ERASE_ERROR_PAK_CHANGED +}; + +/** + * @brief Options for gCourseRecordsMenuSelection + */ +enum CourseRecordsMenuSelectionTypes { + COURSE_RECORDS_MENU_MIN, + COURSE_RECORDS_MENU_RETURN_MENU = COURSE_RECORDS_MENU_MIN, + COURSE_RECORDS_MENU_ERASE_RECORDS, + COURSE_RECORDS_MENU_ERASE_GHOST, + COURSE_RECORDS_MENU_MAX = COURSE_RECORDS_MENU_ERASE_GHOST +}; + +/** + * @brief Options for gCourseRecordsSubMenuSelection + */ +enum CourseRecordsSubMenuSelectionTypes { + COURSE_RECORDS_SUB_MENU_MIN, + COURSE_RECORDS_SUB_MENU_QUIT = COURSE_RECORDS_SUB_MENU_MIN, + COURSE_RECORDS_SUB_MENU_ERASE, + COURSE_RECORDS_SUB_MENU_MAX = COURSE_RECORDS_SUB_MENU_ERASE +}; + +/** + * @brief Options for gDebugGotoScene + */ +enum DebugGotoSceneTypes { + DEBUG_GOTO_RACING, + DEBUG_GOTO_ENDING, + DEBUG_GOTO_CREDITS_SEQUENCE_DEFAULT, + DEBUG_GOTO_CREDITS_SEQUENCE_EXTRA +}; + +/** + * @brief Options for gFadeModeSelection + */ +enum FadeModeSelectionTypes { FADE_MODE_NONE, FADE_MODE_MAIN, FADE_MODE_LOGO }; + +/** + * @brief Options for gControllerPakScrollDirection + */ +enum ControllerPakScrollDirectionTypes { + CONTROLLER_PAK_SCROLL_DIR_NONE, + CONTROLLER_PAK_SCROLL_DIR_DOWN, + CONTROLLER_PAK_SCROLL_DIR_UP +}; /* functions */ void update_menus(void); @@ -26,79 +195,69 @@ void course_data_menu_act(struct Controller*, u16); void logo_intro_menu_act(struct Controller*, u16); void controller_pak_menu_act(struct Controller*, u16); void splash_menu_act(struct Controller*, u16); -void func_800B28C8(void); +void setup_selected_game_mode(void); void main_menu_act(struct Controller*, u16); bool is_character_spot_free(s32); void player_select_menu_act(struct Controller*, u16); void course_select_menu_act(struct Controller*, u16); -void func_800B3F74(s32); -void func_800B44AC(void); -void func_800B44BC(void); -bool func_800B4520(void); +void load_menu_states(s32); +void reset_cycle_flash_menu(void); +void set_sound_mode(void); +bool is_screen_being_faded(void); /* data */ -extern s32 D_8018EDC0; -extern f32 D_8018EDC4; -extern f32 D_8018EDC8; -extern f32 D_8018EDCC; -extern f32 D_8018EDD0; -extern f32 D_8018EDD4; -extern f32 D_8018EDD8; -extern f32 D_8018EDDC; -extern s32 D_8018EDE0; - -extern s8 gCharacterGridSelections[]; -extern s8 D_8018EDE8[]; -extern s8 D_8018EDEC; -extern s8 gMainMenuSelectionDepth; -extern s8 D_8018EDEE; +extern s32 gIntroModelZEye; +extern f32 gIntroModelScale; +extern f32 gIntroModelRotX; +extern f32 gIntroModelRotY; +extern f32 gIntroModelRotZ; +extern f32 gIntroModelPosX; +extern f32 gIntroModelPosY; +extern f32 gIntroModelPosZ; + +extern s32 gMenuFadeType; + +extern s8 gCharacterGridSelections[4]; +extern s8 gCharacterGridIsSelected[4]; +extern s8 gSubMenuSelection; +extern s8 gMainMenuSelection; +extern s8 gPlayerSelectMenuSelection; extern s8 gDebugMenuSelection; extern s8 gControllerPakMenuSelection; -extern s8 D_8018EDF1; +extern s8 gScreenModeListIndex; extern u8 gSoundMode; extern s8 gPlayerCount; -extern s8 D_8018EDF4; -extern s8 D_8018EDF5; -extern s8 D_8018EDF6; +extern s8 gVersusResultCursorSelection; +extern s8 gTimeTrialsResultCursorSelection; +extern s8 gBattleResultCursorSelection; extern s8 gTimeTrialDataCourseIndex; extern s8 gCourseRecordsMenuSelection; -extern s8 D_8018EDF9; +extern s8 gCourseRecordsSubMenuSelection; extern s8 gDebugGotoScene; -extern s8 D_8018EDFB; -extern s8 D_8018EDFC; +extern s8 gGhostPlayerInit; +extern s8 gCourseMapInit; extern s32 gMenuTimingCounter; extern s32 gMenuDelayTimer; -extern s8 D_8018EE08; +extern s8 gDemoUseController; extern s8 gCupSelection; -extern s8 D_8018EE0A; extern s8 gCourseIndexInCup; -extern s8 D_8018EE0C; -extern struct_8018EE10_entry D_8018EE10[]; +extern s8 unref_8018EE0C; extern s32 gMenuSelection; // D_800E86A0 -extern s32 D_800E86A4; +extern s32 gFadeModeSelection; extern s8 gCharacterSelections[]; -extern s8 D_800E86AC[]; -extern s8 D_800E86B0[4][3]; +extern s8 gGameModeMenuColumn[]; +extern s8 gGameModeSubMenuColumn[4][3]; extern s8 gNextDemoId; extern s8 gControllerPakSelectedTableRow; -extern s8 D_800E86C4[]; -extern s8 D_800E86D0[]; -extern s8 unref_800E86E0[]; -extern u32 sVIGammaOffDitherOn; +extern s8 gControllerPakVisibleTableRows[]; +extern s8 gControllerPakScrollDirection; -extern const s8 D_800F2B50[5]; -extern const s8 D_800F2B58[5]; extern const s8 gPlayerModeSelection[]; -extern const s8 gGameModePlayerColumnDefault[][3]; -extern const s8 gGameModePlayerColumnExtra[][3]; extern const s32 gGameModePlayerSelection[][3]; -extern const s8 D_800F2BAC[8]; extern const s16 gCupCourseOrder[NUM_CUPS][NUM_COURSES_PER_CUP]; -extern const union GameModePack gSoundMenuPack; - // end of menus.c variables #endif /* MENUS_H */ diff --git a/src/player_controller.c b/src/player_controller.c index b9108087e7..da750b9bd2 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "player_controller.h" #include "code_800029B0.h" @@ -11,182 +12,177 @@ #include "render_player.h" #include "effects.h" #include "collision.h" -#include "waypoints.h" +#include "path.h" #include "audio/external.h" #include "code_8003DC40.h" #include "main.h" #include "camera.h" #include "spawn_players.h" #include "code_80057C60.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "sounds.h" extern s32 D_8018D168; -s16 gKartAIforMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; +s16 cpu_forMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gKartAIforLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; +s16 cpu_forLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gKartAIforYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; +s16 cpu_forYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gKartAIforToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER, 0 }; +s16 cpu_forToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gKartAIforDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER, 0 }; +s16 cpu_forDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER, 0 }; -s16 gKartAIforWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER, 0 }; +s16 cpu_forWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER, 0 }; -s16 gKartAIforPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER, 0 }; +s16 cpu_forPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER, 0 }; -s16 gKartAIforBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO, PEACH, 0 }; +s16 cpu_forBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO, PEACH, 0 }; -s16* gKartAIforPlayer[] = { gKartAIforMario, gKartAIforLuigi, gKartAIforYoshi, gKartAIforToad, - gKartAIforDk, gKartAIforWario, gKartAIforPeach, gKartAIforBowser }; +s16* cpu_forPlayer[] = { cpu_forMario, cpu_forLuigi, cpu_forYoshi, cpu_forToad, + cpu_forDk, cpu_forWario, cpu_forPeach, cpu_forBowser }; -s16 gKartAIforMarioAndLuigi[] = { YOSHI, TOAD, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forMarioAndLuigi[] = { YOSHI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforMarioAndYoshi[] = { LUIGI, TOAD, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forMarioAndYoshi[] = { LUIGI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforMarioAndToad[] = { LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forMarioAndToad[] = { LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforMarioAndDk[] = { LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER }; +s16 cpu_forMarioAndDk[] = { LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gKartAIforMarioAndWario[] = { LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER }; +s16 cpu_forMarioAndWario[] = { LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gKartAIforMarioAndPeach[] = { LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER }; +s16 cpu_forMarioAndPeach[] = { LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gKartAIforMarioAndBowser[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH }; +s16 cpu_forMarioAndBowser[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gKartAIforLuigiAndMario[] = { YOSHI, TOAD, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forLuigiAndMario[] = { YOSHI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforLuigiAndYoshi[] = { MARIO, TOAD, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forLuigiAndYoshi[] = { MARIO, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforLuigiAndToad[] = { MARIO, YOSHI, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forLuigiAndToad[] = { MARIO, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforLuigiAndDk[] = { MARIO, YOSHI, TOAD, WARIO, PEACH, BOWSER }; +s16 cpu_forLuigiAndDk[] = { MARIO, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gKartAIforLuigiAndWario[] = { MARIO, YOSHI, TOAD, DK, PEACH, BOWSER }; +s16 cpu_forLuigiAndWario[] = { MARIO, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gKartAIforLuigiAndPeach[] = { MARIO, YOSHI, TOAD, DK, WARIO, BOWSER }; +s16 cpu_forLuigiAndPeach[] = { MARIO, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gKartAIforLuigiAndBowser[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH }; +s16 cpu_forLuigiAndBowser[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gKartAIforYoshiAndMario[] = { LUIGI, TOAD, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forYoshiAndMario[] = { LUIGI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforYoshiAndLuigi[] = { MARIO, TOAD, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forYoshiAndLuigi[] = { MARIO, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforYoshiAndToad[] = { MARIO, LUIGI, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forYoshiAndToad[] = { MARIO, LUIGI, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforYoshiAndDk[] = { MARIO, LUIGI, TOAD, WARIO, PEACH, BOWSER }; +s16 cpu_forYoshiAndDk[] = { MARIO, LUIGI, TOAD, WARIO, PEACH, BOWSER }; -s16 gKartAIforYoshiAndWario[] = { MARIO, LUIGI, TOAD, DK, PEACH, BOWSER }; +s16 cpu_forYoshiAndWario[] = { MARIO, LUIGI, TOAD, DK, PEACH, BOWSER }; -s16 gKartAIforYoshiAndPeach[] = { MARIO, LUIGI, TOAD, DK, WARIO, BOWSER }; +s16 cpu_forYoshiAndPeach[] = { MARIO, LUIGI, TOAD, DK, WARIO, BOWSER }; -s16 gKartAIforYoshiAndBowser[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH }; +s16 cpu_forYoshiAndBowser[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH }; -s16 gKartAIforToadAndMario[] = { LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forToadAndMario[] = { LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforToadAndLuigi[] = { MARIO, YOSHI, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forToadAndLuigi[] = { MARIO, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforToadAndYoshi[] = { MARIO, LUIGI, DK, WARIO, PEACH, BOWSER }; +s16 cpu_forToadAndYoshi[] = { MARIO, LUIGI, DK, WARIO, PEACH, BOWSER }; -s16 gKartAIforToadAndDk[] = { MARIO, LUIGI, YOSHI, WARIO, PEACH, BOWSER }; +s16 cpu_forToadAndDk[] = { MARIO, LUIGI, YOSHI, WARIO, PEACH, BOWSER }; -s16 gKartAIforToadAndWario[] = { MARIO, LUIGI, YOSHI, DK, PEACH, BOWSER }; +s16 cpu_forToadAndWario[] = { MARIO, LUIGI, YOSHI, DK, PEACH, BOWSER }; -s16 gKartAIforToadAndPeach[] = { MARIO, LUIGI, YOSHI, DK, WARIO, BOWSER }; +s16 cpu_forToadAndPeach[] = { MARIO, LUIGI, YOSHI, DK, WARIO, BOWSER }; -s16 gKartAIforToadAndBowser[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH }; +s16 cpu_forToadAndBowser[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH }; -s16 gKartAIforDkAndMario[] = { LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER }; +s16 cpu_forDkAndMario[] = { LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gKartAIforDkAndLuigi[] = { MARIO, YOSHI, TOAD, WARIO, PEACH, BOWSER }; +s16 cpu_forDkAndLuigi[] = { MARIO, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gKartAIforDkAndToad[] = { MARIO, LUIGI, TOAD, WARIO, PEACH, BOWSER }; +s16 cpu_forDkAndToad[] = { MARIO, LUIGI, TOAD, WARIO, PEACH, BOWSER }; -s16 gKartAIforDkAndYoshi[] = { MARIO, LUIGI, YOSHI, WARIO, PEACH, BOWSER }; +s16 cpu_forDkAndYoshi[] = { MARIO, LUIGI, YOSHI, WARIO, PEACH, BOWSER }; -s16 gKartAIforDkAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, PEACH, BOWSER }; +s16 cpu_forDkAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, PEACH, BOWSER }; -s16 gKartAIforDkAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, BOWSER }; +s16 cpu_forDkAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, BOWSER }; -s16 gKartAIforDkAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH }; +s16 cpu_forDkAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH }; -s16 gKartAIforWarioAndMario[] = { LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER }; +s16 cpu_forWarioAndMario[] = { LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gKartAIforWarioAndLuigi[] = { MARIO, YOSHI, TOAD, DK, PEACH, BOWSER }; +s16 cpu_forWarioAndLuigi[] = { MARIO, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gKartAIforWarioAndYoshi[] = { MARIO, LUIGI, TOAD, DK, PEACH, BOWSER }; +s16 cpu_forWarioAndYoshi[] = { MARIO, LUIGI, TOAD, DK, PEACH, BOWSER }; -s16 gKartAIforWarioAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, PEACH, BOWSER }; +s16 cpu_forWarioAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, PEACH, BOWSER }; -s16 gKartAIforWarioAndToad[] = { MARIO, LUIGI, YOSHI, DK, PEACH, BOWSER }; +s16 cpu_forWarioAndToad[] = { MARIO, LUIGI, YOSHI, DK, PEACH, BOWSER }; -s16 gKartAIforWarioAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, BOWSER }; +s16 cpu_forWarioAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, BOWSER }; -s16 gKartAIforWarioAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH }; +s16 cpu_forWarioAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH }; -s16 gKartAIforPeachAndMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER }; +s16 cpu_forPeachAndMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gKartAIforPeachAndLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, BOWSER }; +s16 cpu_forPeachAndLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gKartAIforPeachAndYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, BOWSER }; +s16 cpu_forPeachAndYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, BOWSER }; -s16 gKartAIforPeachAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, BOWSER }; +s16 cpu_forPeachAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, BOWSER }; -s16 gKartAIforPeachAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, BOWSER }; +s16 cpu_forPeachAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, BOWSER }; -s16 gKartAIforPeachAndToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, BOWSER }; +s16 cpu_forPeachAndToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, BOWSER }; -s16 gKartAIforPeachAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO }; +s16 cpu_forPeachAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO }; -s16 gKartAIforBowserAndMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH }; +s16 cpu_forBowserAndMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gKartAIforBowserAndLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH }; +s16 cpu_forBowserAndLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gKartAIforBowserAndYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH }; +s16 cpu_forBowserAndYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH }; -s16 gKartAIforBowserAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH }; +s16 cpu_forBowserAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH }; -s16 gKartAIforBowserAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH }; +s16 cpu_forBowserAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH }; -s16 gKartAIforBowserAndToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH }; +s16 cpu_forBowserAndToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH }; -s16 gKartAIforBowserAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO }; +s16 cpu_forBowserAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO }; -s16* gListKartAIforMario[] = { gKartAIforMarioAndLuigi, gKartAIforMarioAndLuigi, gKartAIforMarioAndYoshi, - gKartAIforMarioAndToad, gKartAIforMarioAndDk, gKartAIforMarioAndWario, - gKartAIforMarioAndPeach, gKartAIforMarioAndBowser }; +s16* gListCPUforMario[] = { cpu_forMarioAndLuigi, cpu_forMarioAndLuigi, cpu_forMarioAndYoshi, cpu_forMarioAndToad, + cpu_forMarioAndDk, cpu_forMarioAndWario, cpu_forMarioAndPeach, cpu_forMarioAndBowser }; -s16* gListKartAIforLuigi[] = { gKartAIforLuigiAndMario, gKartAIforLuigiAndMario, gKartAIforLuigiAndYoshi, - gKartAIforLuigiAndToad, gKartAIforLuigiAndDk, gKartAIforLuigiAndWario, - gKartAIforLuigiAndPeach, gKartAIforLuigiAndBowser }; +s16* gListCPUforLuigi[] = { cpu_forLuigiAndMario, cpu_forLuigiAndMario, cpu_forLuigiAndYoshi, cpu_forLuigiAndToad, + cpu_forLuigiAndDk, cpu_forLuigiAndWario, cpu_forLuigiAndPeach, cpu_forLuigiAndBowser }; -s16* gListKartAIforYoshi[] = { gKartAIforYoshiAndMario, gKartAIforYoshiAndLuigi, gKartAIforYoshiAndLuigi, - gKartAIforYoshiAndToad, gKartAIforYoshiAndDk, gKartAIforYoshiAndWario, - gKartAIforYoshiAndPeach, gKartAIforYoshiAndBowser }; +s16* gListCPUforYoshi[] = { cpu_forYoshiAndMario, cpu_forYoshiAndLuigi, cpu_forYoshiAndLuigi, cpu_forYoshiAndToad, + cpu_forYoshiAndDk, cpu_forYoshiAndWario, cpu_forYoshiAndPeach, cpu_forYoshiAndBowser }; -s16* gListKartAIforToad[] = { gKartAIforToadAndMario, gKartAIforToadAndLuigi, gKartAIforToadAndYoshi, - gKartAIforToadAndYoshi, gKartAIforToadAndDk, gKartAIforToadAndWario, - gKartAIforToadAndPeach, gKartAIforToadAndBowser }; +s16* gListCPUforToad[] = { cpu_forToadAndMario, cpu_forToadAndLuigi, cpu_forToadAndYoshi, cpu_forToadAndYoshi, + cpu_forToadAndDk, cpu_forToadAndWario, cpu_forToadAndPeach, cpu_forToadAndBowser }; -s16* gListKartAIforDk[] = { gKartAIforDkAndMario, gKartAIforDkAndLuigi, gKartAIforDkAndToad, gKartAIforDkAndYoshi, - gKartAIforDkAndYoshi, gKartAIforDkAndWario, gKartAIforDkAndPeach, gKartAIforDkAndBowser }; +s16* gListCPUforDk[] = { cpu_forDkAndMario, cpu_forDkAndLuigi, cpu_forDkAndToad, cpu_forDkAndYoshi, + cpu_forDkAndYoshi, cpu_forDkAndWario, cpu_forDkAndPeach, cpu_forDkAndBowser }; -s16* gListKartAIforWario[] = { gKartAIforWarioAndMario, gKartAIforWarioAndLuigi, gKartAIforWarioAndYoshi, - gKartAIforWarioAndToad, gKartAIforWarioAndDk, gKartAIforWarioAndDk, - gKartAIforWarioAndPeach, gKartAIforWarioAndBowser }; +s16* gListCPUforWario[] = { cpu_forWarioAndMario, cpu_forWarioAndLuigi, cpu_forWarioAndYoshi, cpu_forWarioAndToad, + cpu_forWarioAndDk, cpu_forWarioAndDk, cpu_forWarioAndPeach, cpu_forWarioAndBowser }; -s16* gListKartAIforPeach[] = { gKartAIforPeachAndMario, gKartAIforPeachAndLuigi, gKartAIforPeachAndYoshi, - gKartAIforPeachAndToad, gKartAIforPeachAndDk, gKartAIforPeachAndWario, - gKartAIforPeachAndDk, gKartAIforPeachAndBowser }; +s16* gListCPUforPeach[] = { cpu_forPeachAndMario, cpu_forPeachAndLuigi, cpu_forPeachAndYoshi, cpu_forPeachAndToad, + cpu_forPeachAndDk, cpu_forPeachAndWario, cpu_forPeachAndDk, cpu_forPeachAndBowser }; -s16* gListKartAIforBowser[] = { gKartAIforBowserAndMario, gKartAIforBowserAndLuigi, gKartAIforBowserAndYoshi, - gKartAIforBowserAndToad, gKartAIforBowserAndDk, gKartAIforBowserAndWario, - gKartAIforBowserAndPeach, gKartAIforBowserAndPeach }; +s16* gListCPUforBowser[] = { + cpu_forBowserAndMario, cpu_forBowserAndLuigi, cpu_forBowserAndYoshi, cpu_forBowserAndToad, + cpu_forBowserAndDk, cpu_forBowserAndWario, cpu_forBowserAndPeach, cpu_forBowserAndPeach +}; -s16** gKartAIforTwoPlayer[] = { gListKartAIforMario, gListKartAIforLuigi, gListKartAIforYoshi, gListKartAIforToad, - gListKartAIforDk, gListKartAIforWario, gListKartAIforPeach, gListKartAIforBowser }; +s16** cpu_forTwoPlayer[] = { gListCPUforMario, gListCPUforLuigi, gListCPUforYoshi, gListCPUforToad, + gListCPUforDk, gListCPUforWario, gListCPUforPeach, gListCPUforBowser }; // func_80027D00 s32 get_player_index_for_player(Player* player) { @@ -221,22 +217,23 @@ s32 get_player_index_for_player(Player* player) { void func_80027DA8(Player* player, s8 playerId) { if (D_8015F890 != 1) { - if ((player->type & 0x10) != 0x10) { - if (((D_8018D168 == 1) && ((player->type & 0x4000) == 0x4000)) && ((player->type & 0x100) != 0x100)) { + if ((player->type & PLAYER_UNKNOWN_0x10) != PLAYER_UNKNOWN_0x10) { + if (((D_8018D168 == 1) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) && + ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C94A4(playerId); - player->type |= 0x10; - } else if ((player->type & 0x2000) == 0) { + player->type |= PLAYER_UNKNOWN_0x10; + } else if ((player->type & PLAYER_START_SEQUENCE) == 0) { func_800C9A88(playerId); - player->type |= 0x10; + player->type |= PLAYER_UNKNOWN_0x10; } } - } else if ((player->type & 0x10) != 0x10) { + } else if ((player->type & PLAYER_UNKNOWN_0x10) != PLAYER_UNKNOWN_0x10) { if ((D_8018D168 == 1) && (player == gPlayerOne)) { func_800C94A4(playerId); - player->type |= 0x10; - } else if ((player->type & 0x2000) == 0) { + player->type |= PLAYER_UNKNOWN_0x10; + } else if ((player->type & PLAYER_START_SEQUENCE) == 0) { func_800C9A88(playerId); - player->type |= 0x10; + player->type |= PLAYER_UNKNOWN_0x10; } } } @@ -245,10 +242,12 @@ void func_80027EDC(Player* player, s8 playerId) { UNUSED s32 pad; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -261,8 +260,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_CHOCO_MOUNTAIN: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0xA0) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0xB4)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0xA0) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0xB4)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -275,8 +274,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_BOWSER_CASTLE: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x29) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1D2)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x29) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1D2)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x41); } @@ -289,8 +288,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_BANSHEE_BOARDWALK: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x41); } @@ -303,8 +302,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_LUIGI_RACEWAY: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x145) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x18B)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -330,8 +329,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_SHERBET_LAND: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x11C) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x209)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x11C) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x209)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -344,17 +343,17 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_DK_JUNGLE: - if ((((s16) gNearestWaypointByPlayerId[playerId] >= 0) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x65)) || - (((s16) gNearestWaypointByPlayerId[playerId] >= 0x14A) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x21F))) { + if ((((s16) gNearestPathPointByPlayerId[playerId] >= 0) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x65)) || + (((s16) gNearestPathPointByPlayerId[playerId] >= 0x14A) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x21F))) { if (D_80165300[playerId] != 2) { func_800C8F80(playerId, 0x0170802D); } D_80165300[playerId] = 2; } else { - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x288) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x305)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x288) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x305)) { if (D_80165300[playerId] != 1) { func_800CA288(playerId, 0x55); } @@ -375,11 +374,15 @@ void func_80027EDC(Player* player, s8 playerId) { default: break; } +#else + +#endif } else { +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x19B) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1B9)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x19B) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1B9)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } @@ -392,8 +395,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_CHOCO_MOUNTAIN: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0xA0) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0xB4)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0xA0) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0xB4)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } @@ -406,8 +409,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_BOWSER_CASTLE: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x29) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1D2)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x29) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1D2)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x41); } @@ -420,8 +423,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_BANSHEE_BOARDWALK: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x180) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x1E1)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x180) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x1E1)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x41); } @@ -434,8 +437,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_LUIGI_RACEWAY: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x145) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x18B)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x145) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x18B)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } @@ -461,8 +464,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_SHERBET_LAND: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x11C) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x209)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x11C) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x209)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } @@ -475,8 +478,8 @@ void func_80027EDC(Player* player, s8 playerId) { } break; case COURSE_DK_JUNGLE: - if (((s16) gNearestWaypointByPlayerId[playerId] >= 0x288) && - ((s16) gNearestWaypointByPlayerId[playerId] < 0x305)) { + if (((s16) gNearestPathPointByPlayerId[playerId] >= 0x288) && + ((s16) gNearestPathPointByPlayerId[playerId] < 0x305)) { if (D_80165300[playerId] != 1) { func_800CA2E4(playerId, 0x55); } @@ -491,107 +494,124 @@ void func_80027EDC(Player* player, s8 playerId) { default: break; } +#else + +#endif } } void func_80028864(Player* player, Camera* camera, s8 playerId, s8 screenId) { - u16 sp1E; + u16 isVisible; if (!(player->type & PLAYER_START_SEQUENCE)) { switch (gActiveScreenMode) { case SCREEN_MODE_1P: - sp1E = check_player_camera_collision(player, camera1, (f32) D_8016557C, 0.0f); + isVisible = check_player_camera_collision(player, camera1, (f32) D_8016557C, 0.0f); break; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - sp1E = check_player_camera_collision(player, camera1, (f32) D_8016557C, 0.0f); - if (sp1E == 1) { + isVisible = check_player_camera_collision(player, camera1, (f32) D_8016557C, 0.0f); + if (isVisible == true) { break; } - sp1E = check_player_camera_collision(player, camera2, (f32) D_8016557C, 0.0f); + isVisible = check_player_camera_collision(player, camera2, (f32) D_8016557C, 0.0f); break; case SCREEN_MODE_3P_4P_SPLITSCREEN: - sp1E = check_player_camera_collision(player, camera1, (f32) D_8016557C, 0.0f); - if (sp1E == 1) { + isVisible = check_player_camera_collision(player, camera1, (f32) D_8016557C, 0.0f); + if (isVisible == true) { break; } - sp1E = check_player_camera_collision(player, camera2, (f32) D_8016557C, 0.0f); - if (sp1E == 1) { + isVisible = check_player_camera_collision(player, camera2, (f32) D_8016557C, 0.0f); + if (isVisible == true) { break; } - sp1E = check_player_camera_collision(player, camera3, (f32) D_8016557C, 0.0f); - if (sp1E == 1) { + isVisible = check_player_camera_collision(player, camera3, (f32) D_8016557C, 0.0f); + if (isVisible == true) { break; } - sp1E = check_player_camera_collision(player, camera4, (f32) D_8016557C, 0.0f); + isVisible = check_player_camera_collision(player, camera4, (f32) D_8016557C, 0.0f); break; } - if ((sp1E == 1) || ((player->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) || - (gModeSelection == BATTLE) || ((player->unk_0CA & 2) != 0) || (player->unk_0CA & 8) || + if ((isVisible == 1) || ((player->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) || + (gModeSelection == BATTLE) || ((player->lakituProps & HELD_BY_LAKITU) != 0) || + (player->lakituProps & LAKITU_SCENE) || //! @todo make a proper match ((*(D_801633F8 + (playerId))) == ((s16) 1U))) { - player->effects &= ~0x1000; - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x400) == 0x400) || ((player->effects & 0x4000) == 0x4000) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - ((player->effects & 0x01000000) == 0x01000000) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || - ((player->effects & 0x20000) == 0x20000) || (player->unk_044 & 0x800)) { + player->effects &= ~LOST_RACE_EFFECT; + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || + (player->kartProps & UNUSED_0x800)) { func_8002E594(player, camera, screenId, playerId); } else { func_8002D268(player, camera, screenId, playerId); } } else { - control_kart_ai_movement(player, camera, screenId, playerId); + control_cpu_movement(player, camera, screenId, playerId); } } else if ((player->type & PLAYER_STAGING) == PLAYER_STAGING) { func_8002D028(player, playerId); func_8002F730(player, camera, screenId, playerId); - } else if (player->type & 0x80) { + } else if (player->type & PLAYER_UNKNOWN_0x80) { func_8002D268(player, camera, screenId, playerId); } else { if ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN) { player->currentSpeed = 50.0f; } - player->effects &= ~8; + player->effects &= ~MIDAIR_EFFECT; } } void func_80028C44(Player* player, Camera* camera, s8 playerId, s8 screenId) { if ((player->type & PLAYER_START_SEQUENCE) == 0) { - player->effects &= ~0x1000; - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x400) == 0x400) || ((player->effects & 0x4000) == 0x4000) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - ((player->effects & 0x1000000) == 0x1000000) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || - ((player->effects & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { + player->effects &= ~LOST_RACE_EFFECT; + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || + ((player->kartProps & UNUSED_0x800) != 0)) { func_8002E594(player, camera, screenId, playerId); } else { func_8002D268(player, camera, screenId, playerId); } } else { - player->effects &= -9; + player->effects &= ~MIDAIR_EFFECT; } } void func_80028D3C(Player* player, Camera* camera, s8 playerId, s8 screenId) { - if ((((player->type & PLAYER_START_SEQUENCE) == 0) && (D_800DC510 != 5)) || (player->unk_0CA & 2) != 0 || - (player->unk_0CA & 8) != 0 || (player->effects & 0x4F010CC0) != 0) { - player->effects &= ~0x1000; - - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x400) == 0x400) || ((player->effects & 0x4000) == 0x4000) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - ((player->effects & 0x1000000) == 0x1000000) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || - ((player->effects & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { + if ((((player->type & PLAYER_START_SEQUENCE) == 0) && (D_800DC510 != 5)) || (player->lakituProps & 2) != 0 || + (player->lakituProps & LAKITU_SCENE) != 0 || + (player->effects & (LIGHTNING_EFFECT | EXPLOSION_CRASH_EFFECT | HIT_BY_STAR_EFFECT | SQUISH_EFFECT | + POST_SQUISH_EFFECT | TERRAIN_TUMBLE_EFFECT | 0xC00 | 0xC0)) != 0) { + player->effects &= ~LOST_RACE_EFFECT; + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || + ((player->kartProps & UNUSED_0x800) != 0)) { func_8002E594(player, camera, screenId, playerId); } else { func_8002D268(player, camera, screenId, playerId); } } else { - player->effects = player->effects & ~8; + player->effects = player->effects & ~MIDAIR_EFFECT; } } @@ -602,7 +622,7 @@ void func_80028E70(Player* player, Camera* camera, s8 playerId, s8 screenId) { if (!(player->type & PLAYER_START_SEQUENCE)) { func_80038C6C(player, camera, screenId, playerId); } else { - player->effects &= ~8; + player->effects &= ~MIDAIR_EFFECT; } break; default: @@ -719,28 +739,28 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { temp_f2 = (gCharacterSize[player->characterId] * 18.0f) * player->size; temp_f0 = player->unk_230 - player->unk_23C; - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) { - player->unk_0CC[screenId] = (s16) ((s32) (((f64) func_802B7C40(temp_f0 / temp_f2)) * 1.6)); + player->unk_0CC[screenId] = (s16) ((s32) (((f64) atan1s(temp_f0 / temp_f2)) * 1.6)); } else { - player->unk_0CC[screenId] = func_802B7C40(temp_f0 / temp_f2) * 2; + player->unk_0CC[screenId] = atan1s(temp_f0 / temp_f2) * 2; } } - if ((player->effects & HIT_EFFECT) == HIT_EFFECT) { + if ((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) { player->unk_0CC[screenId] = (s16) ((s32) player->unk_D9C); } - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { temp_f0 = player->unk_1F8 - player->unk_1FC; - player->unk_0D4[screenId] = (((func_802B7C40(temp_f0 / temp_f2)) * 0.9)); + player->unk_0D4[screenId] = (((atan1s(temp_f0 / temp_f2)) * 0.9)); } else { if (((player->animFrameSelector[screenId]) >= 0) && ((player->animFrameSelector[screenId]) < 0x101)) { var_f0 = player->oldPos[1] - player->pos[1]; } else { var_f0 = player->pos[1] - player->oldPos[1]; } - player->unk_0D4[screenId] = (s16) ((s32) (((f64) func_802B7C40(var_f0 / temp_f2)) * 0.5)); + player->unk_0D4[screenId] = (s16) ((s32) (((f64) atan1s(var_f0 / temp_f2)) * 0.5)); } - if ((player->effects & HIT_EFFECT) == HIT_EFFECT) { + if ((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) { player->unk_0D4[screenId] = (s16) ((s32) player->unk_D9C); } func_80029200(player, screenId); @@ -748,14 +768,17 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { temp_a0 = (s16) player->unk_0D4[screenId] * sins((u16) temp_a0) + player->unk_0CC[screenId] * coss((u16) temp_a0); move_s16_towards(&player->unk_050[screenId], temp_a0, 0.5f); var_a0 = player->animFrameSelector[screenId]; - player->unk_002 = player->unk_002 & (~(4 << (screenId * 4))); + player->unk_002 = player->unk_002 & (~(UNK_002_UNKNOWN_0x4 << (screenId * 4))); if (var_a0 >= 0x101) { var_a0 = 0x201 - var_a0; - player->unk_002 |= (4 << (screenId * 4)); - } - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) && - ((player->effects & 0x80000) != 0x80000) && ((player->effects & 0x800000) != 0x800000) && - ((player->effects & 0x20000) != 0x20000) && (!(player->unk_044 & 0x800))) { + player->unk_002 |= (UNK_002_UNKNOWN_0x4 << (screenId * 4)); + } + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && + ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) && + ((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) && + ((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) && + ((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) && + (!(player->kartProps & UNUSED_0x800))) { if (var_a0 < 0x51) { var_a1 = 0x208; var_t0 = 0; @@ -767,17 +790,22 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { var_a1 = 0x666; var_t0 = 0; } - if (((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - (player->unk_044 & 0x800)) { + if (((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + (player->kartProps & UNUSED_0x800)) { player->unk_050[screenId] = 0; } - if (((player->effects & 8) == 8) && ((player->unk_0CA & 2) == 2)) { + if (((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT) && + ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU)) { player->unk_050[screenId] = 0; } var_a0 = (player->unk_048[screenId] + player->rotation[1] + player->unk_0C0); - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - ((player->effects & 0x20000) == 0x20000) || (player->unk_044 & 0x800)) { + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) || + (player->kartProps & UNUSED_0x800)) { if (var_a0 >= 0x7FF9) { var_a0 = -var_a0; var_a0 /= var_a1; @@ -797,8 +825,9 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { if ((player->animFrameSelector[screenId]) >= 0x23) { player->animFrameSelector[screenId] = 0x22; } - if ((player->effects & 0x80) || (player->effects & 0x40) || (player->effects & 0x80000) || - (player->effects & 0x800000) || (player->effects & 0x20000) || (player->unk_044 & 0x800)) { + if ((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) || + (player->effects & UNKNOWN_EFFECT_0x80000) || (player->effects & UNKNOWN_EFFECT_0x800000) || + (player->effects & LIGHTNING_STRIKE_EFFECT) || (player->kartProps & UNUSED_0x800)) { if ((player->animFrameSelector[screenId]) >= 0x14) { player->animFrameSelector[screenId] = 0; @@ -807,38 +836,40 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { if ((player->animGroupSelector[screenId]) >= 9) { player->animGroupSelector[screenId] = 4; } - if (((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - (player->unk_044 & 0x800)) { + if (((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + (player->kartProps & UNUSED_0x800)) { player->animGroupSelector[screenId] = 4; } - if (((player->effects & 0x400) == 0x400) || ((player->effects & 0x01000000) == 0x01000000) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || (player->effects & 0x10000) || - (player->effects & 0x80) || (player->effects & 0x40)) { + if (((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || (player->effects & TERRAIN_TUMBLE_EFFECT) || + (player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT)) { - player->unk_002 |= 1 << (screenId * 4); + player->unk_002 |= CHANGING_ANIMATION << (screenId * 4); D_80165190[screenId][playerId] = 1; - if ((player->effects & 0x80) || (player->effects & 0x40)) { + if ((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT)) { if ((player->animFrameSelector[screenId] == gLastAnimFrameSelector[screenId][playerId]) && (player->animGroupSelector[screenId] == gLastAnimGroupSelector[screenId][playerId])) { - player->unk_002 &= ~(1 << (screenId * 4)); + player->unk_002 &= ~(CHANGING_ANIMATION << (screenId * 4)); D_80165190[screenId][playerId] = 1; } } else if (((player->unk_0A8) >> 8) == D_80165150[screenId][playerId] >> 8) { - player->unk_002 &= ~(1 << (screenId * 4)); + player->unk_002 &= ~(CHANGING_ANIMATION << (screenId * 4)); } } else { - player->unk_002 |= 1 << (screenId * 4); + player->unk_002 |= CHANGING_ANIMATION << (screenId * 4); if (((player->animFrameSelector[screenId] == gLastAnimFrameSelector[screenId][playerId]) && (player->animGroupSelector[screenId] == gLastAnimGroupSelector[screenId][playerId])) && ((D_80165190[screenId][playerId]) == 0)) { - player->unk_002 &= ~(1 << (screenId * 4)); + player->unk_002 &= ~(CHANGING_ANIMATION << (screenId * 4)); } } temp_a0_2 = gLastAnimFrameSelector[screenId][playerId] - player->animFrameSelector[screenId]; if ((temp_a0_2 >= 0x14) || (temp_a0_2 < (-0x13))) { - player->unk_002 |= 1 << (screenId * 4); + player->unk_002 |= CHANGING_ANIMATION << (screenId * 4); } } @@ -866,7 +897,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { sp8C[0] = var_f12 - 3.6; sp8C[1] = -player->boundingBoxSize; sp8C[2] = var_f12 - 2.0f; - mtxf_translate_vec3f_mat3(sp8C, sp5C); + mtxf_transform_vec3f_mat3(sp8C, sp5C); sp80[0] = player->tyres[FRONT_LEFT].pos[0]; sp80[1] = player->tyres[FRONT_LEFT].pos[1]; sp80[2] = player->tyres[FRONT_LEFT].pos[2]; @@ -877,7 +908,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { sp8C[0] = (-var_f12) + 3.6; sp8C[1] = -player->boundingBoxSize; sp8C[2] = var_f12 - 2.0f; - mtxf_translate_vec3f_mat3(sp8C, sp5C); + mtxf_transform_vec3f_mat3(sp8C, sp5C); sp80[0] = player->tyres[FRONT_RIGHT].pos[0]; sp80[1] = player->tyres[FRONT_RIGHT].pos[1]; sp80[2] = player->tyres[FRONT_RIGHT].pos[2]; @@ -888,7 +919,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { sp8C[0] = var_f12 - 2.6; sp8C[1] = -player->boundingBoxSize; sp8C[2] = (-var_f12) + 4.0f; - mtxf_translate_vec3f_mat3(sp8C, sp5C); + mtxf_transform_vec3f_mat3(sp8C, sp5C); sp80[0] = player->tyres[BACK_LEFT].pos[0]; sp80[1] = player->tyres[BACK_LEFT].pos[1]; sp80[2] = player->tyres[BACK_LEFT].pos[2]; @@ -899,7 +930,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { sp8C[0] = (-var_f12) + 2.6; sp8C[1] = -player->boundingBoxSize; sp8C[2] = (-var_f12) + 4.0f; - mtxf_translate_vec3f_mat3(sp8C, sp5C); + mtxf_transform_vec3f_mat3(sp8C, sp5C); sp80[0] = player->tyres[BACK_RIGHT].pos[0]; sp80[1] = player->tyres[BACK_RIGHT].pos[1]; sp80[2] = player->tyres[BACK_RIGHT].pos[2]; @@ -907,7 +938,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { player->tyres[BACK_RIGHT].pos[1] = player->pos[1] + sp8C[1]; player->tyres[BACK_RIGHT].pos[2] = player->pos[2] + sp8C[2]; player_terrain_collision(player, &player->tyres[BACK_RIGHT], sp80[0], sp80[1], sp80[2]); - if (!(player->effects & 8)) { + if (!(player->effects & MIDAIR_EFFECT)) { a = (player->tyres[BACK_LEFT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2; move_f32_towards(&player->unk_230, a, 0.5f); @@ -922,16 +953,16 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { } temp_f2_3 = ((gCharacterSize[player->characterId] * 18.0f) + 1.0f) * player->size; temp_f0_2 = player->unk_23C - player->unk_230; - player->unk_206 = -func_802B7C40(temp_f0_2 / temp_f2_3); - if (((player->unk_0CA & 2) == 2) || (player->effects & 8)) { + player->unk_206 = -atan1s(temp_f0_2 / temp_f2_3); + if (((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || (player->effects & MIDAIR_EFFECT)) { player->unk_206 = 0; } - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { temp_f0_2 = player->unk_1F8 - player->unk_1FC; - move_s16_towards(&player->slopeAccel, func_802B7C40(temp_f0_2 / temp_f2_3), 0.5f); + move_s16_towards(&player->slopeAccel, atan1s(temp_f0_2 / temp_f2_3), 0.5f); } else { temp_f0_2 = player->oldPos[1] - arg2; - temp_v0 = func_802B7C40(temp_f0_2 / temp_f2_3); + temp_v0 = atan1s(temp_f0_2 / temp_f2_3); if (temp_f0_2 >= 0.0f) { temp_v0 /= 4; } else { @@ -939,24 +970,26 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { } move_s16_towards(&player->slopeAccel, temp_v0, 0.5f); } - if (((player->effects & 8) == 8) && ((player->unk_0CA & 2) == 2)) { + if (((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT) && + ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU)) { player->slopeAccel = (s16) ((s32) player->unk_D9C); } player->surfaceType = get_surface_type(player->collision.meshIndexZX) & 0xFF; if (player->surfaceType == BOOST_RAMP_ASPHALT) { if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) != BOOST_RAMP_ASPHALT_EFFECT) && - ((player->effects & 8) != 8)) { - player->soundEffects |= BOOST_RAMP_ASPHALT_SOUND_EFFECT; + ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { + player->triggers |= BOOST_RAMP_ASPHALT_TRIGGER; } } if (player->surfaceType == BOOST_RAMP_WOOD) { - if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && ((player->effects & 8) != 8)) { - player->soundEffects |= BOOST_RAMP_WOOD_SOUND_EFFECT; + if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && + ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { + player->triggers |= BOOST_RAMP_WOOD_TRIGGER; } } } -void func_8002A194(Player* player, f32 arg1, f32 arg2, f32 arg3) { +void func_8002A194(Player* player, f32 x, f32 y, f32 z) { UNUSED s32 pad[2]; f32 temp_f12; f32 var_f20; @@ -973,30 +1006,30 @@ void func_8002A194(Player* player, f32 arg1, f32 arg2, f32 arg3) { var_f20 = (((gCharacterSize[player->characterId] * 18) / 2) * player->size) - 1; } - player->tyres[FRONT_LEFT].pos[2] = (coss(temp_v1 + 0x2000) * var_f20) + arg3; - temp_f12 = (sins(temp_v1 + 0x2000) * var_f20) + arg1; + player->tyres[FRONT_LEFT].pos[2] = (coss(temp_v1 + 0x2000) * var_f20) + z; + temp_f12 = (sins(temp_v1 + 0x2000) * var_f20) + x; player->tyres[FRONT_LEFT].pos[0] = temp_f12; player->tyres[FRONT_LEFT].baseHeight = - calculate_surface_height(temp_f12, arg2, player->tyres[FRONT_LEFT].pos[2], player->collision.meshIndexZX); + calculate_surface_height(temp_f12, y, player->tyres[FRONT_LEFT].pos[2], player->collision.meshIndexZX); - player->tyres[FRONT_RIGHT].pos[2] = (coss(temp_v1 - 0x2000) * var_f20) + arg3; - temp_f12 = (sins(temp_v1 - 0x2000) * var_f20) + arg1; + player->tyres[FRONT_RIGHT].pos[2] = (coss(temp_v1 - 0x2000) * var_f20) + z; + temp_f12 = (sins(temp_v1 - 0x2000) * var_f20) + x; player->tyres[FRONT_RIGHT].pos[0] = temp_f12; player->tyres[FRONT_RIGHT].baseHeight = - calculate_surface_height(temp_f12, arg2, player->tyres[FRONT_RIGHT].pos[2], player->collision.meshIndexZX); + calculate_surface_height(temp_f12, y, player->tyres[FRONT_RIGHT].pos[2], player->collision.meshIndexZX); - player->tyres[BACK_LEFT].pos[2] = (coss(temp_v1 + 0x6000) * var_f20) + arg3; - temp_f12 = (sins(temp_v1 + 0x6000) * var_f20) + arg1; + player->tyres[BACK_LEFT].pos[2] = (coss(temp_v1 + 0x6000) * var_f20) + z; + temp_f12 = (sins(temp_v1 + 0x6000) * var_f20) + x; player->tyres[BACK_LEFT].pos[0] = temp_f12; player->tyres[BACK_LEFT].baseHeight = - calculate_surface_height(temp_f12, arg2, player->tyres[BACK_LEFT].pos[2], player->collision.meshIndexZX); + calculate_surface_height(temp_f12, y, player->tyres[BACK_LEFT].pos[2], player->collision.meshIndexZX); - player->tyres[BACK_RIGHT].pos[2] = (coss(temp_v1 - 0x6000) * var_f20) + arg3; - player->tyres[BACK_RIGHT].pos[0] = (sins(temp_v1 - 0x6000) * var_f20) + arg1; + player->tyres[BACK_RIGHT].pos[2] = (coss(temp_v1 - 0x6000) * var_f20) + z; + player->tyres[BACK_RIGHT].pos[0] = (sins(temp_v1 - 0x6000) * var_f20) + x; player->tyres[BACK_RIGHT].baseHeight = calculate_surface_height( - player->tyres[BACK_LEFT].pos[0], arg2, player->tyres[BACK_LEFT].pos[2], player->collision.meshIndexZX); + player->tyres[BACK_LEFT].pos[0], y, player->tyres[BACK_LEFT].pos[2], player->collision.meshIndexZX); - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { player->unk_230 = (player->tyres[BACK_LEFT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2; player->unk_23C = (player->tyres[BACK_RIGHT].baseHeight + player->tyres[FRONT_RIGHT].baseHeight) / 2; player->unk_1FC = (player->tyres[FRONT_RIGHT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2; @@ -1009,13 +1042,13 @@ void func_8002A194(Player* player, f32 arg1, f32 arg2, f32 arg3) { player->tyres[FRONT_LEFT].surfaceType = player->surfaceType; var_f20 = (gCharacterSize[player->characterId] * 18) + 1; temp_f0 = (player->unk_23C - player->unk_230); - player->unk_206 = -func_802B7C40(temp_f0 / var_f20); - if ((player->effects & 8) != 8) { + player->unk_206 = -atan1s(temp_f0 / var_f20); + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { temp_f0 = (player->unk_1F8 - player->unk_1FC); - move_s16_towards(&player->slopeAccel, func_802B7C40(temp_f0 / var_f20), 0.5f); + move_s16_towards(&player->slopeAccel, atan1s(temp_f0 / var_f20), 0.5f); } else { - temp_f0 = player->oldPos[1] - arg2; - temp_v0 = func_802B7C40(temp_f0 / var_f20); + temp_f0 = player->oldPos[1] - y; + temp_v0 = atan1s(temp_f0 / var_f20); if (temp_f0 >= 0.0f) { var_a1 = temp_v0 * 2; } else { @@ -1030,13 +1063,14 @@ void func_8002A194(Player* player, f32 arg1, f32 arg2, f32 arg3) { } if (player->surfaceType == BOOST_RAMP_ASPHALT) { if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) != BOOST_RAMP_ASPHALT_EFFECT) && - ((player->effects & 8) != 8)) { - player->soundEffects |= BOOST_RAMP_ASPHALT_SOUND_EFFECT; + ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { + player->triggers |= BOOST_RAMP_ASPHALT_TRIGGER; } } if (player->surfaceType == BOOST_RAMP_WOOD) { - if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && ((player->effects & 8) != 8)) { - player->soundEffects |= BOOST_RAMP_WOOD_SOUND_EFFECT; + if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && + ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT)) { + player->triggers |= BOOST_RAMP_WOOD_TRIGGER; } } } @@ -1075,61 +1109,62 @@ void func_8002A5F4(Vec3f arg0, f32 arg1, Vec3f arg2, f32 arg3, f32 arg4) { } } -void func_8002A704(Player* player, s8 arg1) { - player->effects |= BOOST_EFFECT; - player->soundEffects &= ~0x02000000; +void func_8002A704(Player* player, s8 playerIndex) { + player->effects |= MUSHROOM_EFFECT; + player->triggers &= ~START_BOOST_TRIGGER; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(0U, (player->characterId * 0x10) + 0x29008001); - func_800C9060(arg1, 0x1900A40BU); + func_800C9060(playerIndex, 0x1900A40BU); } player->boostTimer = 0x0050; } -void func_8002A79C(Player* player, s8 arg1) { - if (((player->effects & 0x100) != 0x100) && ((player->effects & 0x10) != 0x10) && (player->unk_22A >= 2)) { - player->effects |= 0x100; +void func_8002A79C(Player* player, s8 playerIndex) { + if (((player->effects & MINI_TURBO_EFFECT) != MINI_TURBO_EFFECT) && + ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && (player->driftState >= 2)) { + player->effects |= MINI_TURBO_EFFECT; player->unk_23A = 0; - player->unk_22A = 0; + player->driftState = 0; player->unk_228 = 0; if (D_8015F890 != 1) { if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) { - func_800C9250(arg1); + func_800C9250(playerIndex); } } else if (player == gPlayerOne) { - func_800C9250(arg1); + func_800C9250(playerIndex); } - } else if ((player->effects & 0x100) == 0x100) { + } else if ((player->effects & MINI_TURBO_EFFECT) == MINI_TURBO_EFFECT) { player->unk_23A += 1; if (player->unk_23A >= 0x1F) { player->unk_23A = 0; - player->effects &= ~0x100; - player->unk_22A = 0; + player->effects &= ~MINI_TURBO_EFFECT; + player->driftState = 0; player->unk_228 = 0; } } } -void func_8002A8A4(Player* player, s8 arg1) { +void func_8002A8A4(Player* player, s8 playerIndex) { if (((s16) player->unk_0C0 / 182) > 0) { if (((s32) player->unk_07C >> 0x10) < -9) { if (player->unk_228 < 0x65) { player->unk_228++; } if ((player->unk_228 == 0x0064) && (player->type & PLAYER_HUMAN)) { - func_800C9060(arg1, 0x1900851EU); + func_800C9060(playerIndex, 0x1900851EU); } } else { if ((player->unk_228 >= 0x12) && (player->unk_228 < 0x64)) { - if (player->unk_22A < 3) { - player->unk_22A++; + if (player->driftState < 3) { + player->driftState++; } } if ((player->unk_228 >= 0xA) && (player->unk_228 < 0x64)) { player->unk_228 = 0x000A; } else { player->unk_228 = 0; - player->unk_22A = 0; + player->driftState = 0; } } } else if (((s32) player->unk_07C >> 0x10) >= 0xA) { @@ -1137,19 +1172,19 @@ void func_8002A8A4(Player* player, s8 arg1) { player->unk_228++; } if ((player->unk_228 == 0x0064) && (player->type & PLAYER_HUMAN)) { - func_800C9060(arg1, 0x1900851EU); + func_800C9060(playerIndex, 0x1900851EU); } } else { if ((player->unk_228 >= 0x12) && (player->unk_228 < 0x64)) { - if (player->unk_22A < 3) { - player->unk_22A++; + if (player->driftState < 3) { + player->driftState++; } } if ((player->unk_228 >= 0xA) && (player->unk_228 < 0x64)) { player->unk_228 = 0x000A; } else { player->unk_228 = 0; - player->unk_22A = 0; + player->driftState = 0; } } } @@ -1158,7 +1193,7 @@ void kart_hop(Player* player) { player->kartHopJerk = gKartHopJerkTable[player->characterId]; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = gKartHopInitialVelocityTable[player->characterId]; - player->effects |= 2; + player->effects |= HOP_EFFECT; player->unk_DAC = 3.0f; player->kartGravity = 500.0f; func_80036C5C(player); @@ -1205,9 +1240,9 @@ void func_8002AAC0(Player* player) { void func_8002AB70(Player* player) { UNUSED s32 pad[2]; - if (((player->effects & 8) != 8) && (player->unk_08C > 0.0f)) { + if (((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) && (player->unk_08C > 0.0f)) { if (((player->slopeAccel / 182) < -1) && ((player->slopeAccel / 182) >= -0x14) && - (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { + (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { move_f32_towards(&player->kartGravity, 500.0f, 1.0f); move_f32_towards(&player->unk_DAC, 3.0f, 0.05f); } else { @@ -1219,7 +1254,7 @@ void func_8002AB70(Player* player) { player->unk_DAC = 2.0f; } move_f32_towards(&player->kartGravity, gKartGravityTable[player->characterId], 0.02f); - if ((player->effects & 2) == 2) { + if ((player->effects & HOP_EFFECT) == HOP_EFFECT) { move_f32_towards(&player->unk_DAC, 1.0f, 0.07f); } else { move_f32_towards(&player->unk_DAC, 1.0f, 0.07f); @@ -1233,22 +1268,22 @@ void func_8002AB70(Player* player) { move_f32_towards(&player->unk_DAC, 25.0f, 1.0f); player->kartGravity = 1800.0f; } - if ((player->effects & 0x400) == 0x400) { + if ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) { player->kartGravity = 1100.0f; } - if (player->effects & 0x80000) { + if (player->effects & UNKNOWN_EFFECT_0x80000) { player->kartGravity = 1500.0f; } - if ((player->unk_044 & 0x800) != 0) { + if ((player->kartProps & UNUSED_0x800) != 0) { player->kartGravity = 1900.0f; } - if ((player->effects & 0x800000) == 0x800000) { + if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) { player->kartGravity = 300.0f; } - if ((player->effects & 0x01000000) == 0x01000000) { + if ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) { player->kartGravity = 550.0f; } - if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) { + if ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) { player->kartGravity = 800.0f; } } @@ -1270,12 +1305,13 @@ void func_8002AE38(Player* player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar s16 temp_a0; s32 var_v1; - sp28 = (sins(-player->rotation[1]) * player->unk_094) + arg2; - temp_f16 = (coss(-player->rotation[1]) * player->unk_094) + arg3; - if (((player->effects & 0x800) != 0x800) && ((player->effects & 0x10) != 0x10) && !(player->unk_044 & 0x4000) && - ((((player->unk_094 / 18.0f) * 216.0f) <= 8.0f) || + sp28 = (sins(-player->rotation[1]) * player->speed) + arg2; + temp_f16 = (coss(-player->rotation[1]) * player->speed) + arg3; + if (((player->effects & BANANA_NEAR_SPINOUT_EFFECT) != BANANA_NEAR_SPINOUT_EFFECT) && + ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && !(player->kartProps & DRIVING_SPINOUT) && + ((((player->speed / 18.0f) * 216.0f) <= 8.0f) || (((player->unk_07C >> 0x10) < 5) && ((player->unk_07C >> 0x10) > -5)))) { - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { player->unk_0C0 = (f32) (player->unk_0C0 - (player->unk_0C0 / 10)); } else { temp_v0_3 = player->unk_0C0; @@ -1296,8 +1332,9 @@ void func_8002AE38(Player* player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar } else { player->unk_0C0 = (atan2s(arg2 - arg4, arg3 - arg5) - atan2s(arg2 - sp28, arg3 - temp_f16)) * 2; } - if (((player->effects & 0x10) != 0x10) && ((((player->unk_07C >> 0x10) > 0) && (player->unk_0C0 < 0)) || - (((player->unk_07C >> 0x10) < 0) && (player->unk_0C0 > 0)))) { + if (((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && + ((((player->unk_07C >> 0x10) > 0) && (player->unk_0C0 < 0)) || + (((player->unk_07C >> 0x10) < 0) && (player->unk_0C0 > 0)))) { if (player->unk_0C0 > 0) { player->unk_0C0 = player->unk_078 * 0x14; } @@ -1326,138 +1363,168 @@ void func_8002B218(Player* player) { for (someIndex = 0; someIndex < 10; someIndex++) { if (player->unk_006 == sp38[someIndex]) { - player->effects |= 0x10; + player->effects |= DRIFTING_EFFECT; kart_hop(player); - player->unk_204 = 0; + player->driftDuration = 0; break; } if (player->unk_006 == sp24[someIndex]) { - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; break; } } } -void apply_sound_effect(Player* player, s8 playerId, UNUSED s8 screenId) { - if ((player->soundEffects & 2) == 2) { - apply_hit_by_item_sound_effect(player, playerId); +void apply_triggers(Player* player, s8 playerId, UNUSED s8 screenId) { + if ((player->triggers & HIGH_TUMBLE_TRIGGER) == HIGH_TUMBLE_TRIGGER) { + trigger_high_tumble(player, playerId); } - if ((player->soundEffects & 4) == 4) { + if ((player->triggers & LOW_TUMBLE_TRIGGER) == LOW_TUMBLE_TRIGGER) { func_8008C528(player, playerId); } - if ((player->soundEffects & 1) == 1) { + if ((player->triggers & HIT_BANANA_TRIGGER) == HIT_BANANA_TRIGGER) { func_8008CDC0(player, playerId); } - if ((player->soundEffects & BOOST_SOUND_EFFECT) == BOOST_SOUND_EFFECT) { - apply_boost_sound_effect(player, playerId); + if ((player->triggers & SHROOM_TRIGGER) == SHROOM_TRIGGER) { + trigger_shroom(player, playerId); } - if ((player->soundEffects & 0x02000000) == 0x02000000) { + if ((player->triggers & START_BOOST_TRIGGER) == START_BOOST_TRIGGER) { func_8002A704(player, playerId); } - if ((player->soundEffects & 0x1000) == 0x1000) { + if ((player->triggers & UNUSED_TRIGGER_0x1000) == UNUSED_TRIGGER_0x1000) { func_8008D570(player, playerId); } - if ((player->soundEffects & 0x20000) == 0x20000) { + if ((player->triggers & UNUSED_TRIGGER_0x20000) == UNUSED_TRIGGER_0x20000) { func_8008D7B0(player, playerId); } - if ((player->soundEffects & HIT_SOUND_EFFECT) == HIT_SOUND_EFFECT) { - apply_hit_sound_effect(player, playerId); + if ((player->triggers & THWOMP_SQUISH_TRIGGER) == THWOMP_SQUISH_TRIGGER) { + trigger_squish(player, playerId); } - if ((player->soundEffects & HIT_ROTATING_SOUND_EFFECT) == HIT_ROTATING_SOUND_EFFECT) { - apply_hit_rotating_sound_effect(player, playerId); + if ((player->triggers & LIGHTNING_STRIKE_TRIGGER) == LIGHTNING_STRIKE_TRIGGER) { + trigger_lightning_strike(player, playerId); } - if ((player->soundEffects & 0x200000) == 0x200000) { + if ((player->triggers & SPINOUT_TRIGGER) == SPINOUT_TRIGGER) { func_8008C73C(player, playerId); } - if ((player->soundEffects & REVERSE_SOUND_EFFECT) == REVERSE_SOUND_EFFECT) { - apply_reverse_sound_effect(player, playerId); + if ((player->triggers & VERTICAL_TUMBLE_TRIGGER) == VERTICAL_TUMBLE_TRIGGER) { + trigger_vertical_tumble(player, playerId); } - if ((player->soundEffects & HIT_BY_ITEM_SOUND_EFFECT) == HIT_BY_ITEM_SOUND_EFFECT) { - apply_hit_by_item_sound_effect(player, playerId); + if ((player->triggers & HIT_BY_STAR_TRIGGER) == HIT_BY_STAR_TRIGGER) { + trigger_high_tumble(player, playerId); } - if ((player->soundEffects & BOOST_RAMP_ASPHALT_SOUND_EFFECT) == BOOST_RAMP_ASPHALT_SOUND_EFFECT) { - apply_boost_ramp_asphalt_sound_effect(player, playerId); + if ((player->triggers & BOOST_RAMP_ASPHALT_TRIGGER) == BOOST_RAMP_ASPHALT_TRIGGER) { + trigger_asphalt_ramp_boost(player, playerId); } - if ((player->soundEffects & BOOST_RAMP_WOOD_SOUND_EFFECT) == BOOST_RAMP_WOOD_SOUND_EFFECT) { - apply_boost_ramp_wood_sound_effect(player, playerId); + if ((player->triggers & BOOST_RAMP_WOOD_TRIGGER) == BOOST_RAMP_WOOD_TRIGGER) { + trigger_wood_ramp_boost(player, playerId); } - if ((player->soundEffects & STAR_SOUND_EFFECT) == STAR_SOUND_EFFECT) { - apply_star_sound_effect(player, playerId); + if ((player->triggers & STAR_TRIGGER) == STAR_TRIGGER) { + trigger_star(player, playerId); } - if ((player->soundEffects & BOO_SOUND_EFFECT) == BOO_SOUND_EFFECT) { - apply_boo_sound_effect(player, playerId); + if ((player->triggers & BOO_TRIGGER) == BOO_TRIGGER) { + trigger_boo(player, playerId); } - if (player->soundEffects & 0x80) { + if (player->triggers & DRIVING_SPINOUT_TRIGGER) { func_8008D0FC(player, playerId); } - if (player->soundEffects & 0x80000) { - apply_reverse_sound_effect(player, playerId); + if (player->triggers & HIT_PADDLE_BOAT_TRIGGER) { + trigger_vertical_tumble(player, playerId); } } void func_8002B5C0(Player* player, UNUSED s8 playerId, UNUSED s8 screenId) { - if (((player->unk_0CA & 8) != 0) || ((player->unk_0CA & 2) != 0)) { - player->soundEffects &= 0xFE1D0478; - } - if ((player->effects & 0x400) == 0x400) { - player->soundEffects &= 0xFF5D457E; - } - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) { - player->soundEffects &= 0xFF5F457E; - } - if ((player->effects & 0x800) == 0x800) { - player->soundEffects &= 0xFF5D457E; - } - if ((player->unk_044 & 0x4000) != 0) { - player->soundEffects &= 0xFF5D457E; - } - if ((player->effects & 0x80000) == 0x80000) { - player->soundEffects &= 0xFE1D4478; - } - if ((player->effects & 0x800000) == 0x800000) { - player->soundEffects &= 0xFE1D0478; - } - if ((player->effects & HIT_EFFECT) == HIT_EFFECT) { - player->soundEffects &= 0xFE1D0578; - } - if ((player->effects & 0x01000000) == 0x01000000) { - player->soundEffects &= 0xFE1D4478; - } - if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) { - player->soundEffects &= 0xFE1D4478; - } + if (((player->lakituProps & LAKITU_SCENE) != 0) || ((player->lakituProps & HELD_BY_LAKITU) != 0)) { + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // Green shell + if ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) { + player->triggers &= ALL_TRIGGERS & ~(ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // Spinout (banana or driving) + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) { + player->triggers &= + (ALL_TRIGGERS & ~(ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS)) | + UNUSED_TRIGGER_0x20000; + } + // Near spinout (banana) + if ((player->effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT) { + player->triggers &= ALL_TRIGGERS & ~(ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + if ((player->kartProps & DRIVING_SPINOUT) != 0) { + player->triggers &= ALL_TRIGGERS & ~(ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // unclear + if ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) { + player->triggers &= ALL_TRIGGERS & ~((HIT_TRIGGERS ^ LIGHTNING_STRIKE_TRIGGER) | ANY_BOOST_TRIGGERS | + RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // unclear + if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) { + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // squished + if ((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) { + player->triggers &= (ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | + STATE_TRANSITION_TRIGGERS)) | + THWOMP_SQUISH_TRIGGER; + } + // explosion crash + if ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) { + player->triggers &= ALL_TRIGGERS & ~((HIT_TRIGGERS ^ LIGHTNING_STRIKE_TRIGGER) | ANY_BOOST_TRIGGERS | + RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // hit by star or red shell + if ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) { + player->triggers &= ALL_TRIGGERS & ~((HIT_TRIGGERS ^ LIGHTNING_STRIKE_TRIGGER) | ANY_BOOST_TRIGGERS | + RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); + } + // boost asphalt if ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) { - player->soundEffects &= 0xFE1D0478; + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); } + // boost ramp if ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT) { - player->soundEffects &= 0xFE1D0478; + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); } - if ((player->effects & 0x10000) == 0x10000) { - player->soundEffects &= 0xFE1D0478; + // Terrain tumble + if ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) { + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); } + // star if ((player->effects & STAR_EFFECT) == STAR_EFFECT) { - player->soundEffects &= 0xFE9D8478; + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | SHROOM_TRIGGER | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); } + // boo if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - player->soundEffects &= 0xFE9D8678; + player->triggers &= ALL_TRIGGERS & ~(HIT_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); } - if ((player->effects & 0x4000) == 0x4000) { - player->soundEffects &= 0xFF5D45FF; + // early start spinout + if ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) { + player->triggers &= ALL_TRIGGERS & ~(ANY_BOOST_TRIGGERS | SPINOUT_TRIGGER | STATE_TRANSITION_TRIGGERS); } - if ((player->effects & 0x20000) == 0x20000) { - player->soundEffects &= 0xFE1D0478; + // CPU_FAST_EFFECTS + if ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT) { + player->triggers &= + ALL_TRIGGERS & ~(HIT_TRIGGERS | ANY_BOOST_TRIGGERS | RACING_SPINOUT_TRIGGERS | STATE_TRANSITION_TRIGGERS); } } void func_8002B830(Player* player, s8 playerId, s8 screenId) { - if (player->soundEffects != 0) { + if (player->triggers != 0) { func_8002B5C0(player, playerId, screenId); } - if (player->soundEffects != 0) { - apply_sound_effect(player, playerId, screenId); + if (player->triggers != 0) { + apply_triggers(player, playerId, screenId); } - if ((player->unk_044 & 0x400) != 0) { + if ((player->kartProps & UNUSED_0x400) != 0) { // can never be true func_800911B4(player, playerId); } } @@ -1508,36 +1575,36 @@ UNUSED void func_8002B8A4(Player* player_one, Player* player_two) { // clang-format on } -void func_8002B9CC(Player* player, s8 arg1, UNUSED s32 arg2) { +void func_8002B9CC(Player* player, s8 playerIndex, UNUSED s32 arg2) { f32 temp_f0; f32 temp_f2; f32 temp_f14; s16 temp; s16 temp2; - if ((player->unk_046 & 2) == 2) { - temp_f0 = D_8018CE10[arg1].unk_04[0]; + if ((player->unk_046 & CRITTER_TOUCH) == CRITTER_TOUCH) { + temp_f0 = D_8018CE10[playerIndex].unk_04[0]; temp_f2 = 0; - temp_f14 = D_8018CE10[arg1].unk_04[2]; + temp_f14 = D_8018CE10[playerIndex].unk_04[2]; if (sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f14 * temp_f14)) >= 6.5) { player->unk_08C /= 4; player->currentSpeed /= 4; - if (!(player->effects & 0x80) && !(player->effects & 0x40)) { - func_8008C73C(player, arg1); + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT)) { + func_8008C73C(player, playerIndex); } } } else { - temp_f0 = D_80165070[arg1][0] - player->velocity[0]; - temp_f2 = D_80165070[arg1][1] - player->velocity[1]; - temp_f14 = D_80165070[arg1][2] - player->velocity[2]; + temp_f0 = gPlayerLastVelocity[playerIndex][0] - player->velocity[0]; + temp_f2 = gPlayerLastVelocity[playerIndex][1] - player->velocity[1]; + temp_f14 = gPlayerLastVelocity[playerIndex][2] - player->velocity[2]; if (sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f14 * temp_f14)) >= 4.2) { player->unk_08C /= 4; player->currentSpeed /= 4; - if (!(player->effects & 0x80) && !(player->effects & 0x40)) { - func_8008C73C(player, arg1); + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT)) { + func_8008C73C(player, playerIndex); } } - temp = (-(s16) get_angle_between_two_vectors(player->pos, &player->oldPos[0])); + temp = (-(s16) get_xz_angle_between_points(player->pos, &player->oldPos[0])); temp2 = (player->rotation[1] - player->unk_0C0); temp = temp - temp2; player->unk_234 = temp / 182; @@ -1571,15 +1638,15 @@ void func_8002BB9C(Player* player, f32* arg1, f32* arg2, UNUSED s8 arg3, UNUSED sp58[1] = 0; sp58[2] = *arg2; - mtxf_translate_vec3f_mat3(sp58, sp64); + mtxf_transform_vec3f_mat3(sp58, sp64); sp4C[0] = player->oldPos[0]; sp4C[1] = 0; sp4C[2] = player->oldPos[2]; - mtxf_translate_vec3f_mat3(sp4C, sp64); + mtxf_transform_vec3f_mat3(sp4C, sp64); - var_v0 = -(s16) get_angle_between_two_vectors(sp58, sp4C); + var_v0 = -(s16) get_xz_angle_between_points(sp58, sp4C); t0 = player->rotation[1]; var_v0 = 0x10000 + (t0 - var_v0); var_v0 /= 182; @@ -1636,7 +1703,7 @@ void func_8002BD58(Player* player) { } } -void func_8002BF4C(Player* player, s8 arg1) { +void func_8002BF4C(Player* player, s8 playerIndex) { UNUSED s32 pad[3]; UNUSED s32 uselessAssignment; s32 i; @@ -1646,32 +1713,33 @@ void func_8002BF4C(Player* player, s8 arg1) { var_a2 = 0; - if (((player->unk_094 / 18.0f) * 216.0f) < 50.0f) { + if (((player->speed / 18.0f) * 216.0f) < 50.0f) { player->unk_0E2 = 0; - player->effects &= 0xFFDFFFFF; + player->effects &= ~CPU_FAST_EFFECT; return; } - if ((player->effects & 0x200000) == 0x200000) { + if ((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { player->unk_0E2 -= 1; if (player->unk_0E2 <= 0) { - player->effects &= 0xFFDFFFFF; + player->effects &= ~CPU_FAST_EFFECT; } } else { for (i = 0; i < NUM_PLAYERS; i++) { playerBorrow = &players[i]; - if (((player != playerBorrow) && ((playerBorrow->type & 0x100) == 0) && (playerBorrow->type & 0x8000)) && + if (((player != playerBorrow) && ((playerBorrow->type & PLAYER_INVISIBLE_OR_BOMB) == 0) && + (playerBorrow->type & PLAYER_EXISTS)) && ((var_a2 = func_8001FD78(player, playerBorrow->pos[0], playerBorrow->pos[1], playerBorrow->pos[2]), var_a2 == 1))) { player->unk_0E2 += 1; if (player->unk_0E2 >= 0x3D) { - player->effects |= 0x200000; + player->effects |= CPU_FAST_EFFECT; if ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB) { uselessAssignment = player->type & PLAYER_INVISIBLE_OR_BOMB; - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008001); + func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008001); } if ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB) { uselessAssignment = var_a2; - func_800C9060(arg1, 0x19008011); + func_800C9060(playerIndex, 0x19008011); } } break; @@ -1684,16 +1752,16 @@ void func_8002BF4C(Player* player, s8 arg1) { } } -void func_8002C11C(Player* player) { - if ((player->effects & 0x10) == 0x10) { - player->unk_204 += 1; - if (player->unk_204 >= 0x65) { - player->unk_204 = 0x64; +void update_player_drift_duration(Player* player) { + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { + player->driftDuration += 1; + if (player->driftDuration >= 101) { + player->driftDuration = 100; } } else { - player->unk_204 -= 1; - if (player->unk_204 < 0) { - player->unk_204 = 0; + player->driftDuration -= 1; + if (player->driftDuration < 0) { + player->driftDuration = 0; } } } @@ -1703,12 +1771,12 @@ void func_8002C17C(Player* player, s8 playerId) { case COURSE_YOSHI_VALLEY: if ((player->collision.surfaceDistance[2] >= 600.0f) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } else if (D_80165330[playerId] == 0) { - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; - } else if (!(player->effects & 8)) { + } else if (!(player->effects & MIDAIR_EFFECT)) { if (func_802ABDF4(player->collision.meshIndexZX) == 0) { D_80165330[playerId] = 0; } @@ -1717,34 +1785,34 @@ void func_8002C17C(Player* player, s8 playerId) { case COURSE_FRAPPE_SNOWLAND: if ((player->surfaceType == SNOW_OFFROAD) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } else if (player->surfaceType != SNOW_OFFROAD) { D_80165330[playerId] = 0; - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } break; case COURSE_ROYAL_RACEWAY: if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) != 0) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; - } else if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == 0) && !(player->effects & 8)) { + } else if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == 0) && !(player->effects & MIDAIR_EFFECT)) { D_80165330[playerId] = 0; - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } break; case COURSE_RAINBOW_ROAD: if ((player->collision.surfaceDistance[2] >= 600.0f) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } else if (D_80165330[playerId] == 0) { - gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; + gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; - } else if (!((player->effects & 8) || (player->unk_0CA & 1))) { + } else if (!((player->effects & MIDAIR_EFFECT) || (player->lakituProps & LAKITU_RETRIEVAL))) { D_80165330[playerId] = 0; } break; @@ -1755,91 +1823,92 @@ void func_8002C17C(Player* player, s8 playerId) { } } -void func_8002C4F8(Player* player, s8 arg1) { - D_801652A0[arg1] = func_802AAB4C(player); - if (player->pos[1] <= D_801652A0[arg1]) { - player->unk_0DE |= 0x0002; +void func_8002C4F8(Player* player, s8 playerIndex) { + D_801652A0[playerIndex] = func_802AAB4C(player); + if (player->pos[1] <= D_801652A0[playerIndex]) { + player->oobProps |= PASS_OOB_OR_FLUID_LEVEL; } else { - player->unk_0DE &= ~0x0002; + player->oobProps &= ~PASS_OOB_OR_FLUID_LEVEL; } - if (player->boundingBoxSize < (D_801652A0[arg1] - player->pos[1])) { - player->unk_0DE |= 1; - player->unk_0DE &= ~0x0002; + if (player->boundingBoxSize < (D_801652A0[playerIndex] - player->pos[1])) { + player->oobProps |= UNDER_OOB_OR_FLUID_LEVEL; + player->oobProps &= ~PASS_OOB_OR_FLUID_LEVEL; } else { - player->unk_0DE &= ~0x0001; + player->oobProps &= ~UNDER_OOB_OR_FLUID_LEVEL; } - if (player->boundingBoxSize < (D_801652A0[arg1] - player->pos[1])) { - if ((player->unk_0DE & 4) != 4) { - player->unk_0DE |= 8; - player->unk_0DE |= 4; + if (player->boundingBoxSize < (D_801652A0[playerIndex] - player->pos[1])) { + if ((player->oobProps & UNDER_FLUID_LEVEL) != UNDER_FLUID_LEVEL) { + player->oobProps |= UNDER_OOB_LEVEL; + player->oobProps |= UNDER_FLUID_LEVEL; if ((gCurrentCourseId != COURSE_KOOPA_BEACH) && (gCurrentCourseId != COURSE_SKYSCRAPER) && (gCurrentCourseId != COURSE_RAINBOW_ROAD) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) || (gCurrentCourseId == COURSE_BIG_DONUT)) { - func_800C9060((u8) arg1, 0x1900801CU); + func_800C9060((u8) playerIndex, 0x1900801CU); } else { - func_800C9060((u8) arg1, 0x19008008U); + func_800C9060((u8) playerIndex, 0x19008008U); } } } } if ((gCurrentCourseId == COURSE_KOOPA_BEACH) || (gCurrentCourseId == COURSE_SKYSCRAPER) || (gCurrentCourseId == COURSE_RAINBOW_ROAD)) { - player->unk_0DE &= ~0x000C; + player->oobProps &= ~(UNDER_OOB_LEVEL | UNDER_FLUID_LEVEL); } - if ((player->boundingBoxSize < (D_801652A0[arg1] - player->pos[1])) && + if ((player->boundingBoxSize < (D_801652A0[playerIndex] - player->pos[1])) && (player->collision.surfaceDistance[2] >= 600.0f)) { - player->unk_0CA |= 1; + player->lakituProps |= LAKITU_RETRIEVAL; } if (player->collision.surfaceDistance[2] >= 600.0f) { - player->unk_0CA |= 0x0100; - } else if ((player->effects & 8) != 8) { - player->unk_0CA &= ~0x0100; - } - if ((player->type & PLAYER_KART_AI) && - ((func_802ABDF4(player->collision.meshIndexZX) != 0) || (player->unk_0CA & 1))) { - if (!(player->unk_0CA & 2) && !(player->unk_0CA & 8) && !(player->effects & 0x1000)) { + player->lakituProps |= WENT_OVER_OOB; + } else if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { + player->lakituProps &= ~WENT_OVER_OOB; + } + if ((player->type & PLAYER_CPU) && + ((func_802ABDF4(player->collision.meshIndexZX) != 0) || (player->lakituProps & LAKITU_RETRIEVAL))) { + if (!(player->lakituProps & HELD_BY_LAKITU) && !(player->lakituProps & LAKITU_SCENE) && + !(player->effects & LOST_RACE_EFFECT)) { func_80090778(player); func_80090868(player); } } - if ((player->type & PLAYER_KART_AI) && (player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)) { + if ((player->type & PLAYER_CPU) && (player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & MIDAIR_EFFECT)) { func_80090778(player); func_80090868(player); } - func_8002C17C(player, arg1); + func_8002C17C(player, playerIndex); } -void func_8002C7E4(Player* player, s8 arg1, s8 arg2) { +void func_8002C7E4(Player* player, s8 playerIndex, s8 arg2) { if ((player->unk_046 & 1) != 1) { - if ((player->effects & 0x8000) == 0x8000) { - if ((player->effects & BOOST_EFFECT) != BOOST_EFFECT) { - func_8002B9CC(player, arg1, arg2); + if ((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT) { + if ((player->effects & MUSHROOM_EFFECT) != MUSHROOM_EFFECT) { + func_8002B9CC(player, playerIndex, arg2); } - player->unk_044 &= ~0x0001; + player->kartProps &= ~BACK_UP; player->unk_046 |= 1; player->unk_046 |= 8; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { func_8001CA24(player, 2.8f); } - if ((player->unk_046 & 2) == 2) { - if ((player->unk_046 & 4) != 4) { - player->unk_046 |= 4; - player->unk_046 |= 0x40; - if (player->effects & BOOST_EFFECT) { - remove_boost_effect(player); + if ((player->unk_046 & CRITTER_TOUCH) == CRITTER_TOUCH) { + if ((player->unk_046 & CRITTER_TOUCH_GATE) != CRITTER_TOUCH_GATE) { + player->unk_046 |= CRITTER_TOUCH_GATE; + player->unk_046 |= INSTANT_SPINOUT; + if (player->effects & MUSHROOM_EFFECT) { + remove_mushroom_effect(player); } } } } } - if ((player->effects & 0x8000) == 0x8000) { - player->effects &= ~0x8000; + if ((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT) { + player->effects &= ~ENEMY_BONK_EFFECT; player->unk_10C = 1; - player->unk_044 &= ~0x0001; + player->kartProps &= ~BACK_UP; return; } player->unk_046 &= ~0x0001; - player->effects &= ~0x8000; + player->effects &= ~ENEMY_BONK_EFFECT; if (player->unk_10C > 0) { player->unk_10C += 1; } @@ -1848,7 +1917,7 @@ void func_8002C7E4(Player* player, s8 arg1, s8 arg2) { } } -void func_8002C954(Player* player, s8 playerId, Vec3f arg2) { +void func_8002C954(Player* player, s8 playerId, Vec3f velocity) { f32 temp_f0; f32 var_f14; f32 xdist; @@ -1857,12 +1926,12 @@ void func_8002C954(Player* player, s8 playerId, Vec3f arg2) { temp_f0 = player->pos[1] - player->unk_074; - if (((((player->effects & 0x10000) != 0x10000) && + if (((((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT) && ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT)) || - ((((temp_f0 >= 20.0f) || (temp_f0 < (-1.0f))) && ((player->effects & 0x10000) == 0)) && - (player->effects & 8)) || - ((player->collision.unk34 == 0) && ((player->effects & 0x10000) == 0))) && - (((player->unk_0CA & 2) == 0) || (!(player->unk_0CA & 8)))) { + ((((temp_f0 >= 20.0f) || (temp_f0 < (-1.0f))) && ((player->effects & TERRAIN_TUMBLE_EFFECT) == 0)) && + (player->effects & MIDAIR_EFFECT)) || + ((player->collision.unk34 == 0) && ((player->effects & TERRAIN_TUMBLE_EFFECT) == 0))) && + (((player->lakituProps & HELD_BY_LAKITU) == 0) || (!(player->lakituProps & LAKITU_SCENE)))) { func_8008F494(player, playerId); } if ((player->unk_046 & 0x20) != 0x20) { @@ -1871,7 +1940,7 @@ void func_8002C954(Player* player, s8 playerId, Vec3f arg2) { } player->unk_046 |= 0x20; } - if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && (((player->unk_094 / 18.0f) * 216.0f) > 30.0f)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && (((player->speed / 18.0f) * 216.0f) > 30.0f)) { func_8001CA24(player, 3.0f); } player->unk_046 |= 0x10; @@ -1879,48 +1948,49 @@ void func_8002C954(Player* player, s8 playerId, Vec3f arg2) { if (player->unk_256 >= 0xA) { player->unk_256 = 0; } - if ((player->slopeAccel >= 0) && (((player->unk_094 / 18.0f) * 216.0f) > 5.0f)) { - decelerate_ai_player(player, 18.0f); + if ((player->slopeAccel >= 0) && (((player->speed / 18.0f) * 216.0f) > 5.0f)) { + player_decelerate_alternative(player, 18.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - xdist = D_80165070[playerId][0] - arg2[0]; - var_f14 = D_80165070[playerId][1] - arg2[1]; + xdist = gPlayerLastVelocity[playerId][0] - velocity[0]; + var_f14 = gPlayerLastVelocity[playerId][1] - velocity[1]; ydist = var_f14; // okay - zdist = D_80165070[playerId][2] - arg2[2]; + zdist = gPlayerLastVelocity[playerId][2] - velocity[2]; var_f14 = sqrtf((xdist * xdist) + (ydist * ydist) + (zdist * zdist)) / 3; if (var_f14 >= 1.0) { var_f14 = 1.0f; } - if ((var_f14 <= 0.6) && (((player->unk_094 / 18.0f) * 216.0f) >= 40.0f) && + if ((var_f14 <= 0.6) && (((player->speed / 18.0f) * 216.0f) >= 40.0f) && (!(player->type & PLAYER_INVISIBLE_OR_BOMB))) { func_800CAEC4(playerId, 0.6F); } else if (!(player->type & PLAYER_INVISIBLE_OR_BOMB)) { - if ((var_f14 <= 0.6) && (((player->unk_094 / 18.0f) * 216.0f) < 40.0f) && - (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + if ((var_f14 <= 0.6) && (((player->speed / 18.0f) * 216.0f) < 40.0f) && + (((player->speed / 18.0f) * 216.0f) >= 10.0f)) { func_800CAEC4(playerId, 0.3F); } else { func_800CAEC4(playerId, var_f14); } } } - if (player->effects & BOOST_EFFECT) { - remove_boost_effect(player); + if (player->effects & MUSHROOM_EFFECT) { + remove_mushroom_effect(player); player->unk_08C /= 2; } } -void apply_effect(Player* player, s8 arg1, s8 arg2) { - if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) { - func_80090970(player, arg1, arg2); +void apply_effect(Player* player, s8 playerIndex, s8 arg2) { + if (((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->lakituProps & LAKITU_SCENE) == LAKITU_SCENE)) { + func_80090970(player, playerIndex, arg2); } - if ((player->effects & 0x800) == 0x800) { - func_8008CEB0(player, arg1); + if ((player->effects & BANANA_NEAR_SPINOUT_EFFECT) == BANANA_NEAR_SPINOUT_EFFECT) { + func_8008CEB0(player, playerIndex); } - if (player->unk_044 & 0x4000) { - func_8008D170(player, arg1); + if (player->kartProps & DRIVING_SPINOUT) { + func_8008D170(player, playerIndex); } - if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) { - apply_boost_effect(player); + if ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) { + apply_mushroom_effect(player); } if ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) { apply_boost_ramp_asphalt_effect(player); @@ -1928,60 +1998,61 @@ void apply_effect(Player* player, s8 arg1, s8 arg2) { if ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT) { apply_boost_ramp_wood_effect(player); } - if ((s32) (player->effects & HIT_EFFECT) == HIT_EFFECT) { - apply_hit_effect(player, arg1); + if ((s32) (player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) { + apply_hit_effect(player, playerIndex); } if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) { - apply_lightning_effect(player, arg1); + apply_lightning_effect(player, playerIndex); } - if ((player->effects & 0x10000) == 0x10000) { - func_8008F3F4(player, arg1); + if ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) { + func_8008F3F4(player, playerIndex); } if ((player->effects & STAR_EFFECT) == STAR_EFFECT) { - apply_star_effect(player, arg1); + apply_star_effect(player, playerIndex); } if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - apply_boo_effect(player, arg1); + apply_boo_effect(player, playerIndex); } - if (((player->effects & 0x20000000) == 0x20000000) && (player->unk_228 >= 0x64)) { - decelerate_ai_player(player, 4.0f); + if (((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) && (player->unk_228 >= 0x64)) { + player_decelerate_alternative(player, 4.0f); } - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) { - func_8008C9EC(player, arg1); + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) { + func_8008C9EC(player, playerIndex); } - if ((player->effects & 0x400) == 0x400) { - func_8008C62C(player, arg1); + if ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) { + func_8008C62C(player, playerIndex); } - if ((player->effects & 0x01000000) == 0x01000000) { - func_8008E4A4(player, arg1); + if ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) { + func_8008E4A4(player, playerIndex); } - if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) { - apply_hit_by_item_effect(player, arg1); + if ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) { + apply_hit_by_star_effect(player, playerIndex); } - if ((player->effects & 0x4000) == 0x4000) { - func_8008F1B8(player, arg1); + if ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) { + func_8008F1B8(player, playerIndex); } - if ((player->effects & 0x80000) == 0x80000) { - func_8008D698(player, arg1); + if ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) { + func_8008D698(player, playerIndex); } - if ((player->effects & 0x800000) == 0x800000) { - func_8008D8B4(player, arg1); - decelerate_ai_player(player, 10.0f); + if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) { + func_8008D8B4(player, playerIndex); + player_decelerate_alternative(player, 10.0f); } if (D_800DC510 != 5) { - if (player->soundEffects & 0x04000000) { - func_8008FC64(player, arg1); + if (player->triggers & LOSE_BATTLE_EFFECT) { + func_8008FC64(player, playerIndex); } - if (player->soundEffects & 0x08000000) { - func_8008FCDC(player, arg1); + if (player->triggers & BECOME_BOMB_EFFECT) { + func_8008FCDC(player, playerIndex); } } - if (player->unk_044 & 0x800) { - func_80091298(player, arg1); + if (player->kartProps & UNUSED_0x800) { // never true + func_80091298(player, playerIndex); } } -void func_8002D028(Player* player, s8 arg1) { +void func_8002D028(Player* player, s8 playerIndex) { Vec3f sp4C; f32 temp_f18; s16 temp_t1; @@ -1990,11 +2061,11 @@ void func_8002D028(Player* player, s8 arg1) { f32 thing0; UNUSED s32 pad; - sp4C[0] = D_80165210[D_80165270[arg1]]; + sp4C[0] = D_80165210[D_80165270[playerIndex]]; sp4C[1] = 0; - sp4C[2] = D_80165230[D_80165270[arg1]]; + sp4C[2] = D_80165230[D_80165270[playerIndex]]; - temp = -(s16) get_angle_between_two_vectors(player->pos, sp4C); + temp = -(s16) get_xz_angle_between_points(player->pos, sp4C); temp2 = player->rotation[1]; temp = (temp - temp2); @@ -2007,21 +2078,21 @@ void func_8002D028(Player* player, s8 arg1) { temp = (-thing0 * 182); } - temp_t1 = (D_80165020[arg1] + ((s16) ((temp * 0x35) / (thing0 * 182)))) / 2; - func_8003680C(player, (s16) temp_t1); - D_80165020[arg1] = (s16) temp_t1; + temp_t1 = (D_80165020[playerIndex] + ((s16) ((temp * 0x35) / (thing0 * 182)))) / 2; + apply_cpu_turn(player, (s16) temp_t1); + D_80165020[playerIndex] = (s16) temp_t1; temp_f18 = sqrtf((sp4C[0] - player->pos[0]) * (sp4C[0] - player->pos[0]) + (sp4C[2] - player->pos[2]) * (sp4C[2] - player->pos[2])); if (temp_f18 <= 8.0f) { adjust_angle(&player->rotation[1], -0x8000, 0x016C); if ((player->rotation[1] < (-0x7F41)) || (player->rotation[1] > 0x7F41)) { - player->type &= ~0x0200; + player->type &= ~PLAYER_STAGING; } player->unk_08C = 0; - player->unk_094 = 0; + player->speed = 0; player->unk_104 = 0; - player->unk_240 = 0; + player->tyreSpeed = 0; player->unk_07C = 0; player->velocity[0] = 0; player->velocity[1] = 0; @@ -2052,19 +2123,19 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player s32 temp3; f32 temp_f2_2; UNUSED s32 pad[8]; - f32 spB4; - f32 spB0; - f32 spAC; - f32 temp_var; + f32 gravityX; + f32 gravityY; + f32 gravityZ; + f32 surfaceDistance; UNUSED s32 pad2; - Vec3f sp98; + Vec3f newVelocity; Vec3f sp8C; UNUSED s32 pad3[3]; s32 sp7C = 0; UNUSED s32 pad4[6]; func_80027EDC(player, playerId); - func_8002C11C(player); + update_player_drift_duration(player); if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { func_8002A79C(player, playerId); } @@ -2074,105 +2145,115 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player func_8002BF4C(player, playerId); } apply_effect(player, playerId, screenId); - if (((player->effects & 0x20000000) == 0x20000000) && (player->unk_228 >= 0x64)) { + if (((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) && (player->unk_228 >= 0x64)) { sp7C = 2; } func_80037BB4(player, sp160); func_8002AB70(player); func_8002FCA8(player, playerId); - if (player->unk_044 & 1) { + if (player->kartProps & BACK_UP) { player->unk_064[0] *= -1.0f; player->unk_064[2] *= -1.0f; } if ((player->tyres[BACK_LEFT].surfaceType == ASPHALT) && (player->tyres[BACK_RIGHT].surfaceType == ASPHALT)) { - spB4 = (-1 * (player->unk_064[0] + sp16C[0])) + - ((-player->collision.orientationVector[0] * player->kartGravity) * 0.925); - spB0 = (-player->collision.orientationVector[1] * player->kartGravity); - spAC = (-1 * (player->unk_064[2] + sp16C[2])) + - ((-player->collision.orientationVector[2] * player->kartGravity) * 0.925); + gravityX = (-1 * (player->unk_064[0] + sp16C[0])) + + ((-player->collision.orientationVector[0] * player->kartGravity) * 0.925); + gravityY = (-player->collision.orientationVector[1] * player->kartGravity); + gravityZ = (-1 * (player->unk_064[2] + sp16C[2])) + + ((-player->collision.orientationVector[2] * player->kartGravity) * 0.925); } else { - temp3 = (((player->unk_094 / 18.0f) * 216.0f) / 10.0f); + temp3 = (((player->speed / 18.0f) * 216.0f) / 10.0f); if (temp3 >= 10) { temp3 = 10; } - spB4 = -1 * (player->unk_064[0] + sp16C[0]) + - ((-player->collision.orientationVector[0] * player->kartGravity) * sp104[temp3]); - spB0 = (-player->collision.orientationVector[1] * player->kartGravity); - spAC = -1 * (player->unk_064[2] + sp16C[2]) + - ((-player->collision.orientationVector[2] * player->kartGravity) * sp104[temp3]); + gravityX = -1 * (player->unk_064[0] + sp16C[0]) + + ((-player->collision.orientationVector[0] * player->kartGravity) * sp104[temp3]); + gravityY = (-player->collision.orientationVector[1] * player->kartGravity); + gravityZ = -1 * (player->unk_064[2] + sp16C[2]) + + ((-player->collision.orientationVector[2] * player->kartGravity) * sp104[temp3]); } - if (((player->effects & 8) != 8) && ((player->effects & 0x20) == 0x20)) { - spB4 = 0 * (player->unk_064[0] + sp16C[0]); - spB0 = -1 * player->kartGravity / 4; - spAC = 0 * (player->unk_064[2] + sp16C[2]); + if (((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) && + ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT)) { + gravityX = 0 * (player->unk_064[0] + sp16C[0]); + gravityY = -1 * player->kartGravity / 4; + gravityZ = 0 * (player->unk_064[2] + sp16C[2]); } - if ((player->effects & 8) == 8) { - spB4 = 0 * (player->unk_064[0] + sp16C[0]); - spB0 = -1 * player->kartGravity; - spAC = 0 * (player->unk_064[2] + sp16C[2]); + if ((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT) { + gravityX = 0 * (player->unk_064[0] + sp16C[0]); + gravityY = -1 * player->kartGravity; + gravityZ = 0 * (player->unk_064[2] + sp16C[2]); } temp_f2_2 = ((player->oldPos[2] - player->pos[2]) * coss(player->rotation[1] + player->unk_0C0)) + (-(player->oldPos[0] - player->pos[0]) * sins(player->rotation[1] + player->unk_0C0)); if (temp_f2_2 > 0.1) { - player->unk_044 |= 8; + player->kartProps |= MOVE_BACKWARDS; } else { - player->unk_044 &= 0xFFF7; + player->kartProps &= ~MOVE_BACKWARDS; } - if (((player->unk_08C <= 0.0f) && ((temp_v0_3 = player->effects, (temp_v0_3 & 1) == 1))) && - ((temp_v0_3 & 0x20) != 0x20)) { + if (((player->unk_08C <= 0.0f) && + ((temp_v0_3 = player->effects, (temp_v0_3 & BRAKING_EFFECT) == BRAKING_EFFECT))) && + ((temp_v0_3 & AB_SPIN_EFFECT) != AB_SPIN_EFFECT)) { sp178[2] = temp_f2_2 * 4500.0f; } else { sp178[2] = 0.0f; } sp178[1] = 0.0f; - mtxf_translate_vec3f_mat3(sp178, player->orientationMatrix); - spB4 += sp178[0]; - spAC += sp178[2]; + mtxf_transform_vec3f_mat3(sp178, player->orientationMatrix); + gravityX += sp178[0]; + gravityZ += sp178[2]; func_8002C7E4(player, playerId, screenId); sp184[2] = func_80030150(player, playerId); - mtxf_translate_vec3f_mat3(sp184, player->orientationMatrix); - sp98[0] = player->velocity[0]; - sp98[1] = player->velocity[1]; - sp98[2] = player->velocity[2]; + mtxf_transform_vec3f_mat3(sp184, player->orientationMatrix); + newVelocity[0] = player->velocity[0]; + newVelocity[1] = player->velocity[1]; + newVelocity[2] = player->velocity[2]; if (((player->unk_10C < 3) && (((s32) player->unk_256) < 3)) || - ((player->effects & BOOST_EFFECT) == BOOST_EFFECT)) { + ((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT)) { if (((player->unk_07C >> 16) >= 0x28) || ((player->unk_07C >> 16) < (-0x27))) { - sp98[0] += (((((f64) ((sp184[0] + spB4) + sp160[0])) - (sp98[0] * (0.12 * ((f64) player->kartFriction)))) / - 6000.0) / - (((((f64) player->unk_20C) * 0.6) + 1.0) + sp7C)); - sp98[2] += (((((f64) ((sp184[2] + spAC) + sp160[2])) - (sp98[2] * (0.12 * ((f64) player->kartFriction)))) / - 6000.0) / - (((((f64) player->unk_20C) * 0.6) + 1.0) + sp7C)); + newVelocity[0] += (((((f64) ((sp184[0] + gravityX) + sp160[0])) - + (newVelocity[0] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / + (((((f64) player->unk_20C) * 0.6) + 1.0) + sp7C)); + newVelocity[2] += (((((f64) ((sp184[2] + gravityZ) + sp160[2])) - + (newVelocity[2] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / + (((((f64) player->unk_20C) * 0.6) + 1.0) + sp7C)); } else { - sp98[0] += (((((f64) ((sp184[0] + spB4) + sp160[0])) - (sp98[0] * (0.12 * ((f64) player->kartFriction)))) / - 6000.0) / - (sp7C + 1)); - sp98[2] += (((((f64) ((sp184[2] + spAC) + sp160[2])) - (sp98[2] * (0.12 * ((f64) player->kartFriction)))) / - 6000.0) / - (sp7C + 1)); + newVelocity[0] += (((((f64) ((sp184[0] + gravityX) + sp160[0])) - + (newVelocity[0] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / + (sp7C + 1)); + newVelocity[2] += (((((f64) ((sp184[2] + gravityZ) + sp160[2])) - + (newVelocity[2] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / + (sp7C + 1)); } } else { - sp98[0] += - (((((f64) ((sp184[0] + spB4) + sp160[0])) - (sp98[0] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / + newVelocity[0] += + (((((f64) ((sp184[0] + gravityX) + sp160[0])) - (newVelocity[0] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / 30.0); - sp98[2] += - (((((f64) ((sp184[2] + spAC) + sp160[2])) - (sp98[2] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / + newVelocity[2] += + (((((f64) ((sp184[2] + gravityZ) + sp160[2])) - (newVelocity[2] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / 30.0); } - sp98[1] += - (((((f64) ((sp184[1] + spB0) + sp160[1])) - (sp98[1] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / + newVelocity[1] += + (((((f64) ((sp184[1] + gravityY) + sp160[1])) - (newVelocity[1] * (0.12 * ((f64) player->kartFriction)))) / + 6000.0) / ((f64) player->unk_DAC)); - if (((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || - ((player->effects & HIT_EFFECT) == HIT_EFFECT)) || - (player->unk_0CA & 1)) { - sp98[0] = 0.0f; - sp98[1] = 0.0f; - sp98[2] = 0.0f; + if (((((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->lakituProps & LAKITU_SCENE) == LAKITU_SCENE)) || + ((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT)) || + (player->lakituProps & LAKITU_RETRIEVAL)) { + newVelocity[0] = 0.0f; + newVelocity[1] = 0.0f; + newVelocity[2] = 0.0f; } - if ((player->unk_044 & 0x10) == 0x10) { - player->unk_044 &= 0xFFEF; + if ((player->kartProps & LOSE_GP_RACE) == LOSE_GP_RACE) { + player->kartProps &= ~LOSE_GP_RACE; } posX = player->pos[0]; @@ -2186,9 +2267,10 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player nextY = posY + player->velocity[1]; nextZ = posZ + player->velocity[2] + D_8018CE10[playerId].unk_04[2]; - if (((((player->unk_0CA & 2) != 2) && ((player->unk_0CA & 8) != 8)) && - ((player->effects & HIT_EFFECT) != HIT_EFFECT)) && - (!(player->unk_0CA & 1))) { + if (((((player->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU) && + ((player->lakituProps & LAKITU_SCENE) != LAKITU_SCENE)) && + ((player->effects & SQUISH_EFFECT) != SQUISH_EFFECT)) && + (!(player->lakituProps & LAKITU_RETRIEVAL))) { func_8002AAC0(player); nextY += player->kartHopVelocity; nextY -= 0.02; @@ -2198,26 +2280,26 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->unk_058 = 0.0f; player->unk_060 = 0.0f; player->unk_05C = 1.0f; - if ((player->unk_044 & 1) != 1) { + if ((player->kartProps & BACK_UP) != BACK_UP) { calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060, player->rotation[1]); } else { calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060, player->rotation[1] + 0x8000); } - player->effects |= 8; + player->effects |= MIDAIR_EFFECT; player->unk_0C2 += 1; - temp_var = player->collision.surfaceDistance[2]; - if (temp_var <= 0.0f) { - player->effects = player->effects & (~2); - player->effects = player->effects & (~8); + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0.0f) { + player->effects = player->effects & (~HOP_EFFECT); + player->effects = player->effects & (~MIDAIR_EFFECT); if (player->unk_0C2 >= 35) { if (player->unk_0C2 >= 0x32) { player->unk_0C2 = 0x32; } player->unk_DB4.unkC = 3.0f; player->unk_DB4.unk18 = 0; - player->unk_0B6 |= 0x100; + player->kartGraphics |= POOMP; if ((((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT)) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { @@ -2228,11 +2310,10 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player func_800CADD0((u8) playerId, ((f32) player->unk_0C2) / 35.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - player->unk_044 |= 0x100; + player->kartProps |= POST_TUMBLE_GAS; } } - if (((player->unk_0C2 < 0x23) && (player->unk_0C2 >= 0x1C)) && - (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { + if (((player->unk_0C2 < 0x23) && (player->unk_0C2 >= 0x1C)) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { player->unk_DB4.unkC = 2.8f; player->unk_DB4.unk18 = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && @@ -2240,10 +2321,10 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player func_800CADD0((u8) playerId, ((f32) player->unk_0C2) / 35.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - player->unk_044 |= 0x100; + player->kartProps |= POST_TUMBLE_GAS; } } - if (((player->unk_0C2 < 0x1C) && (player->unk_0C2 >= 4)) && (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { + if (((player->unk_0C2 < 0x1C) && (player->unk_0C2 >= 4)) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { player->unk_DB4.unk18 = 0; player->unk_DB4.unkC = 1.5f; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && @@ -2258,24 +2339,24 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->unk_0C2 = 0; player->kartHopVelocity = player->unk_0C2; } - temp_var = player->collision.surfaceDistance[2]; - if (temp_var <= 0.0f) { - func_8003F46C(player, sp8C, sp98, sp178, &temp_var, &nextX, &nextY, &nextZ); + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0.0f) { + func_8003F46C(player, sp8C, newVelocity, sp178, &surfaceDistance, &nextX, &nextY, &nextZ); } - temp_var = player->collision.surfaceDistance[0]; - if (temp_var < 0.0f) { - func_8003F734(player, sp8C, sp98, &temp_var, &nextX, &nextY, &nextZ); - func_8002C954(player, playerId, sp98); + surfaceDistance = player->collision.surfaceDistance[0]; + if (surfaceDistance < 0.0f) { + func_8003F734(player, sp8C, newVelocity, &surfaceDistance, &nextX, &nextY, &nextZ); + func_8002C954(player, playerId, newVelocity); } - temp_var = player->collision.surfaceDistance[1]; - if (temp_var < 0.0f) { - func_8003FBAC(player, sp8C, sp98, &temp_var, &nextX, &nextY, &nextZ); - func_8002C954(player, playerId, sp98); + surfaceDistance = player->collision.surfaceDistance[1]; + if (surfaceDistance < 0.0f) { + func_8003FBAC(player, sp8C, newVelocity, &surfaceDistance, &nextX, &nextY, &nextZ); + func_8002C954(player, playerId, newVelocity); } - temp_var = player->collision.surfaceDistance[0]; - if (temp_var >= 0.0f) { - temp_var = player->collision.surfaceDistance[1]; - if (temp_var >= 0.0f) { + surfaceDistance = player->collision.surfaceDistance[0]; + if (surfaceDistance >= 0.0f) { + surfaceDistance = player->collision.surfaceDistance[1]; + if (surfaceDistance >= 0.0f) { player->unk_046 &= 0xFFDF; if (player->unk_256 != 0) { player->unk_256++; @@ -2285,13 +2366,13 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player } } } - if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) != 0)) && - ((player->effects & 0x10000) != 0x10000)) { - if ((!(player->unk_0CA & 2)) || (!(player->unk_0CA & 8))) { + if (((!(player->effects & MIDAIR_EFFECT)) && (func_802ABDB8(player->collision.meshIndexZX) != 0)) && + ((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT)) { + if ((!(player->lakituProps & HELD_BY_LAKITU)) || (!(player->lakituProps & LAKITU_SCENE))) { func_8008F494(player, playerId); } - } else if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && - (player->effects & 0x10000)) { + } else if (((!(player->effects & MIDAIR_EFFECT)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && + (player->effects & TERRAIN_TUMBLE_EFFECT)) { func_8008F5A4(player, playerId); } player->unk_074 = calculate_surface_height(nextX, nextY, nextZ, player->collision.meshIndexZX); @@ -2304,46 +2385,46 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player } func_8002AE38(player, playerId, posX, posZ, nextX, nextZ); - temp2 = (sp98[0] * sp98[0]) + (sp98[2] * sp98[2]); - player->unk_22C = player->unk_094; - player->unk_094 = sqrtf(temp2); + temp2 = (newVelocity[0] * newVelocity[0]) + (newVelocity[2] * newVelocity[2]); + player->previousSpeed = player->speed; + player->speed = sqrtf(temp2); - if ((player->unk_08C <= 0.0f) && (player->unk_094 <= 0.08) && (D_8018CE10[playerId].unk_04[0] == 0.0f) && + if ((player->unk_08C <= 0.0f) && (player->speed <= 0.08) && (D_8018CE10[playerId].unk_04[0] == 0.0f) && (D_8018CE10[playerId].unk_04[2] == 0.0f)) { - sp98[0] = sp98[0] + (-1 * sp98[0]); - sp98[2] = sp98[2] + (-1 * sp98[2]); + newVelocity[0] = newVelocity[0] + (-1 * newVelocity[0]); + newVelocity[2] = newVelocity[2] + (-1 * newVelocity[2]); } else { player->pos[0] = nextX; player->pos[2] = nextZ; } player->pos[1] = nextY; - if ((player->type & PLAYER_HUMAN) && (!(player->type & PLAYER_KART_AI))) { - func_8002BB9C(player, &nextX, &nextZ, screenId, playerId, sp98); + if ((player->type & PLAYER_HUMAN) && (!(player->type & PLAYER_CPU))) { + func_8002BB9C(player, &nextX, &nextZ, screenId, playerId, newVelocity); } player->unk_064[0] = sp178[0]; player->unk_064[2] = sp178[2]; - player->velocity[0] = sp98[0]; - player->velocity[1] = sp98[1]; - player->velocity[2] = sp98[2]; - D_80165070[playerId][0] = sp98[0]; - D_80165070[playerId][1] = sp98[1]; - D_80165070[playerId][2] = sp98[2]; + player->velocity[0] = newVelocity[0]; + player->velocity[1] = newVelocity[1]; + player->velocity[2] = newVelocity[2]; + gPlayerLastVelocity[playerId][0] = newVelocity[0]; + gPlayerLastVelocity[playerId][1] = newVelocity[1]; + gPlayerLastVelocity[playerId][2] = newVelocity[2]; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - if (gKartTopSpeedTable[player->characterId] < player->unk_094) { - temp = gKartTopSpeedTable[player->characterId] / player->unk_094; + if (gKartTopSpeedTable[player->characterId] < player->speed) { + temp = gKartTopSpeedTable[player->characterId] / player->speed; player->velocity[0] *= temp; player->velocity[1] *= temp; player->velocity[2] *= temp; - player->unk_094 = gKartTopSpeedTable[player->characterId]; + player->speed = gKartTopSpeedTable[player->characterId]; } } - if ((player->unk_044 & 1) == 1) { - if (player->unk_094 > 1) { - temp = 1 / player->unk_094; + if ((player->kartProps & BACK_UP) == BACK_UP) { + if (player->speed > 1) { + temp = 1 / player->speed; player->velocity[0] *= temp; player->velocity[1] *= temp; player->velocity[2] *= temp; - player->unk_094 = 1; + player->speed = 1; } } if (player->collision.surfaceDistance[2] >= 500.0f) { @@ -2359,10 +2440,10 @@ void func_8002E4C4(Player* player) { player->kartHopJerk = 0.0f; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = 0.0f; - player->pos[1] = spawn_actor_on_surface(player->pos[0], D_80164510[player_index] + 10.0f, player->pos[2]) + + player->pos[1] = get_surface_height(player->pos[0], gPlayerPathY[player_index] + 10.0f, player->pos[2]) + player->boundingBoxSize; - if (((player->pos[1] - D_80164510[player_index]) > 1200.0f) || - ((player->pos[1] - D_80164510[player_index]) < -1200.0f)) { + if (((player->pos[1] - gPlayerPathY[player_index]) > 1200.0f) || + ((player->pos[1] - gPlayerPathY[player_index]) < -1200.0f)) { player->pos[1] = player->oldPos[1]; } player->velocity[1] = 0.0f; @@ -2372,31 +2453,32 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player Vec3f spEC = { 0.0f, 0.0f, 1.0f }; Vec3f spE0 = { 0.0f, 0.0f, 0.0f }; Vec3f spD4 = { 0.0f, 0.0f, 0.0f }; - f32 spD0; - f32 spCC; - f32 spC8; - f32 temp_f0_6; + f32 nextX; + f32 nextY; + f32 nextZ; + f32 topSpeedMultiplier; UNUSED s32 pad; f32 posX; f32 posY; f32 posZ; UNUSED s32 pad2[12]; - f32 sp80; - f32 sp7C; - f32 sp78; - f32 sp74; + f32 gravityX; + f32 gravityY; + f32 gravityZ; + f32 surfaceDistance; UNUSED s32 pad3[4]; f32 temp; - Vec3f sp54; + Vec3f newVelocity; Vec3f sp48; s16 sp46; func_8002B830(player, playerId, screenId); - if ((((((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || - ((player->effects & 0x4000) == 0x4000)) || - ((player->effects & 0x80000) == 0x80000)) || - ((player->effects & 0x800000) == 0x800000)) || - ((player->effects & 0x20000) == 0x20000)) || - (player->unk_044 & 0x800)) { + if ((((((((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) || + ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT)) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000)) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000)) || + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT)) || + (player->kartProps & UNUSED_0x800)) { sp46 = 1; } else { sp46 = 0; @@ -2404,15 +2486,18 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player apply_effect(player, playerId, screenId); func_8002AB70(player); func_8002FCA8(player, playerId); - if ((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || - ((player->effects & 0x20000) == 0x20000)) { - sp80 = -1 * (player->unk_064[0]) + (((-player->collision.orientationVector[0]) * player->kartGravity) * 0.1); - sp7C = (-player->collision.orientationVector[1]) * player->kartGravity; - sp78 = -1 * (player->unk_064[2]) + (((-player->collision.orientationVector[2]) * player->kartGravity) * 0.1); + if ((((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) || + ((player->effects & LIGHTNING_STRIKE_EFFECT) == LIGHTNING_STRIKE_EFFECT)) { + gravityX = + -1 * (player->unk_064[0]) + (((-player->collision.orientationVector[0]) * player->kartGravity) * 0.1); + gravityY = (-player->collision.orientationVector[1]) * player->kartGravity; + gravityZ = + -1 * (player->unk_064[2]) + (((-player->collision.orientationVector[2]) * player->kartGravity) * 0.1); } else { - sp80 = -1 * player->unk_064[0]; - sp7C = -1 * player->kartGravity; - sp78 = -1 * player->unk_064[2]; + gravityX = -1 * player->unk_064[0]; + gravityY = -1 * player->kartGravity; + gravityZ = -1 * player->unk_064[2]; } func_8002C7E4(player, playerId, screenId); if (sp46 == 1) { @@ -2426,32 +2511,39 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player } spEC[2] = func_80030150(player, playerId); if (sp46 == 1) { - mtxf_translate_vec3f_mat3(spEC, player->unk_150); + mtxf_transform_vec3f_mat3(spEC, player->unk_150); } else { - mtxf_translate_vec3f_mat3(spEC, player->orientationMatrix); - } - sp54[0] = player->velocity[0]; - sp54[1] = player->velocity[1]; - sp54[2] = player->velocity[2]; - if ((player->unk_10C < 3) && ((player->unk_256) < 3) && ((player->effects & 0x400) != 0x400) && - ((player->effects & 0x01000000) != 0x01000000) && - ((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT)) { - sp54[0] += (((((spEC[0] + sp80) + spD4[0])) - (sp54[0] * (0.12 * player->kartFriction))) / 6000) / - ((player->unk_20C * 5.0f) + 1.0f); - sp54[2] += (((((spEC[2] + sp78) + spD4[2])) - (sp54[2] * (0.12 * player->kartFriction))) / 6000) / - ((player->unk_20C * 5.0f) + 1.0f); + mtxf_transform_vec3f_mat3(spEC, player->orientationMatrix); + } + newVelocity[0] = player->velocity[0]; + newVelocity[1] = player->velocity[1]; + newVelocity[2] = player->velocity[2]; + if ((player->unk_10C < 3) && ((player->unk_256) < 3) && + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && + ((player->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT) && + ((player->effects & HIT_BY_STAR_EFFECT) != HIT_BY_STAR_EFFECT)) { + newVelocity[0] += + (((((spEC[0] + gravityX) + spD4[0])) - (newVelocity[0] * (0.12 * player->kartFriction))) / 6000) / + ((player->unk_20C * 5.0f) + 1.0f); + newVelocity[2] += + (((((spEC[2] + gravityZ) + spD4[2])) - (newVelocity[2] * (0.12 * player->kartFriction))) / 6000) / + ((player->unk_20C * 5.0f) + 1.0f); } else { - sp54[0] += - ((((f64) (spEC[0] + sp80 + spD4[0]) - (sp54[0] * (0.2 * (f64) player->kartFriction))) / 6000) * 0.08); - sp54[2] += - ((((f64) (spEC[2] + sp78 + spD4[2]) - (sp54[2] * (0.2 * (f64) player->kartFriction))) / 6000) * 0.08); - } - sp54[1] += (((((spEC[1] + sp7C) + spD4[1])) - (sp54[1] * (0.12 * player->kartFriction))) / 6000) / player->unk_DAC; - - if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) { - sp54[0] = 0.0f; - sp54[1] = 0.0f; - sp54[2] = 0.0f; + newVelocity[0] += + ((((f64) (spEC[0] + gravityX + spD4[0]) - (newVelocity[0] * (0.2 * (f64) player->kartFriction))) / 6000) * + 0.08); + newVelocity[2] += + ((((f64) (spEC[2] + gravityZ + spD4[2]) - (newVelocity[2] * (0.2 * (f64) player->kartFriction))) / 6000) * + 0.08); + } + newVelocity[1] += (((((spEC[1] + gravityY) + spD4[1])) - (newVelocity[1] * (0.12 * player->kartFriction))) / 6000) / + player->unk_DAC; + + if (((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->lakituProps & LAKITU_SCENE) == LAKITU_SCENE)) { + newVelocity[0] = 0.0f; + newVelocity[1] = 0.0f; + newVelocity[2] = 0.0f; } posX = player->pos[0]; posY = player->pos[1]; @@ -2461,41 +2553,42 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->oldPos[1] = player->pos[1]; player->oldPos[2] = player->pos[2]; - spD0 = posX + player->velocity[0] + D_8018CE10[playerId].unk_04[0]; - spCC = posY + player->velocity[1]; - spC8 = posZ + player->velocity[2] + D_8018CE10[playerId].unk_04[2]; + nextX = posX + player->velocity[0] + D_8018CE10[playerId].unk_04[0]; + nextY = posY + player->velocity[1]; + nextZ = posZ + player->velocity[2] + D_8018CE10[playerId].unk_04[2]; func_8002AAC0(player); - spCC += player->kartHopVelocity; - actor_terrain_collision(&player->collision, player->boundingBoxSize, spD0, spCC, spC8, player->oldPos[0], + nextY += player->kartHopVelocity; + actor_terrain_collision(&player->collision, player->boundingBoxSize, nextX, nextY, nextZ, player->oldPos[0], player->oldPos[1], player->oldPos[2]); - player->effects |= 8; + player->effects |= MIDAIR_EFFECT; player->unk_0C2 += 1; player->unk_058 = 0.0f; player->unk_060 = 0.0f; player->unk_05C = 1.0f; - sp74 = player->collision.surfaceDistance[2]; - if (sp74 <= 0.0f) { - player->effects &= ~2; - player->effects &= ~8; - if ((((player->effects & 0x400) != 0x400) && ((player->effects & 0x01000000) != 0x01000000)) && - ((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT)) { + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0.0f) { + player->effects &= ~HOP_EFFECT; + player->effects &= ~MIDAIR_EFFECT; + if ((((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && + ((player->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT)) && + ((player->effects & HIT_BY_STAR_EFFECT) != HIT_BY_STAR_EFFECT)) { if (player->unk_0C2 >= 0x1C) { if (player->unk_0C2 >= 0x32) { player->unk_0C2 = 0x0032; } player->unk_DB4.unk18 = 0; - player->unk_0B6 |= 0x100; + player->kartGraphics |= POOMP; player->unk_DB4.unkC = 3.0f; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800CADD0((u8) playerId, ((f32) player->unk_0C2) / 50.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - player->unk_044 |= 0x100; + player->kartProps |= POST_TUMBLE_GAS; } } if (((player->unk_0C2 < 0x1C) && (player->unk_0C2 >= 0xA)) && - (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { + (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { player->unk_DB4.unkC = 2.0f; player->unk_DB4.unk18 = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && @@ -2503,7 +2596,7 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player func_800CADD0((u8) playerId, ((f32) player->unk_0C2) / 50.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - player->unk_044 |= 0x100; + player->kartProps |= POST_TUMBLE_GAS; } } player->unk_0C2 = 0; @@ -2519,7 +2612,7 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player if (player->unk_0C2 >= 0x28) { player->unk_0C2 = 0x0014; } - if ((player->effects & 0x400) == 0x400) { + if ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) { player->unk_0C2 /= 6.5; player->kartHopJerk = 0.06f; player->kartHopAcceleration = 0.0f; @@ -2528,7 +2621,7 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->kartHopJerk = 0.06f; player->kartHopAcceleration = 0.0f; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - player->unk_044 |= 0x100; + player->kartProps |= POST_TUMBLE_GAS; } } } else { @@ -2537,26 +2630,26 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player } player->kartHopVelocity = (f32) player->unk_0C2; } - sp74 = player->collision.surfaceDistance[2]; - if (sp74 <= 0.0f) { - func_8003F46C(player, sp48, sp54, spE0, &sp74, &spD0, &spCC, &spC8); - } - sp74 = player->collision.surfaceDistance[0]; - if (sp74 < 0.0f) { - func_8003F734(player, sp48, sp54, &sp74, &spD0, &spCC, &spC8); - func_8002C954(player, playerId, sp54); - decelerate_ai_player(player, 6.0f); - } - sp74 = player->collision.surfaceDistance[1]; - if (sp74 < 0.0f) { - func_8003FBAC(player, sp48, sp54, &sp74, &spD0, &spCC, &spC8); - func_8002C954(player, playerId, sp54); - decelerate_ai_player(player, 6.0f); - } - sp74 = player->collision.surfaceDistance[0]; - if (sp74 >= 0.0f) { - sp74 = player->collision.surfaceDistance[1]; - if (sp74 >= 0.0f) { + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0.0f) { + func_8003F46C(player, sp48, newVelocity, spE0, &surfaceDistance, &nextX, &nextY, &nextZ); + } + surfaceDistance = player->collision.surfaceDistance[0]; + if (surfaceDistance < 0.0f) { + func_8003F734(player, sp48, newVelocity, &surfaceDistance, &nextX, &nextY, &nextZ); + func_8002C954(player, playerId, newVelocity); + player_decelerate_alternative(player, 6.0f); + } + surfaceDistance = player->collision.surfaceDistance[1]; + if (surfaceDistance < 0.0f) { + func_8003FBAC(player, sp48, newVelocity, &surfaceDistance, &nextX, &nextY, &nextZ); + func_8002C954(player, playerId, newVelocity); + player_decelerate_alternative(player, 6.0f); + } + surfaceDistance = player->collision.surfaceDistance[0]; + if (surfaceDistance >= 0.0f) { + surfaceDistance = player->collision.surfaceDistance[1]; + if (surfaceDistance >= 0.0f) { player->unk_046 &= 0xFFDF; if (player->unk_256 != 0) { player->unk_256++; @@ -2566,96 +2659,98 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player } } } - if (((func_802ABDB8(player->collision.meshIndexZX) != 0) && ((player->effects & 0x10000) != 0x10000)) && - (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { - if ((!(player->unk_0CA & 2)) || (!(player->unk_0CA & 8))) { + if (((func_802ABDB8(player->collision.meshIndexZX) != 0) && + ((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT)) && + (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { + if ((!(player->lakituProps & HELD_BY_LAKITU)) || (!(player->lakituProps & LAKITU_SCENE))) { func_8008F494(player, playerId); } - } else if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && - (player->effects & 0x10000)) { + } else if (((!(player->effects & MIDAIR_EFFECT)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && + (player->effects & TERRAIN_TUMBLE_EFFECT)) { func_8008F5A4(player, playerId); } - player->unk_074 = calculate_surface_height(spD0, spCC, spC8, player->collision.meshIndexZX); + player->unk_074 = calculate_surface_height(nextX, nextY, nextZ, player->collision.meshIndexZX); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && (((gActiveScreenMode == SCREEN_MODE_1P) || (gActiveScreenMode == SCREEN_MODE_2P_SPLITSCREEN_VERTICAL)) || (gActiveScreenMode == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL))) { - func_80029B4C(player, spD0, spCC, spC8); + func_80029B4C(player, nextX, nextY, nextZ); } else { - func_8002A194(player, spD0, spCC, spC8); - } - func_8002AE38(player, playerId, posX, posZ, spD0, spC8); - temp = (sp54[0] * sp54[0]) + (sp54[2] * sp54[2]); - player->unk_22C = player->unk_094; - player->unk_094 = sqrtf(temp); - if ((((player->effects & 0x400) != 0x400) && (player->unk_08C <= 0) && (player->unk_094 < 0.13)) || - (((player->effects & 0x400) != 0x400) && (player->unk_08C <= 0) && (player->unk_094 < 0.20) && - ((player->effects & 1) == 1))) { - sp54[0] = sp54[0] + (-1 * sp54[0]); - sp54[2] = sp54[2] + (-1 * sp54[2]); + func_8002A194(player, nextX, nextY, nextZ); + } + func_8002AE38(player, playerId, posX, posZ, nextX, nextZ); + temp = (newVelocity[0] * newVelocity[0]) + (newVelocity[2] * newVelocity[2]); + player->previousSpeed = player->speed; + player->speed = sqrtf(temp); + if ((((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && (player->unk_08C <= 0) && + (player->speed < 0.13)) || + (((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && (player->unk_08C <= 0) && + (player->speed < 0.20) && ((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT))) { + newVelocity[0] = newVelocity[0] + (-1 * newVelocity[0]); + newVelocity[2] = newVelocity[2] + (-1 * newVelocity[2]); } else { - player->pos[0] = spD0; - player->pos[2] = spC8; + player->pos[0] = nextX; + player->pos[2] = nextZ; } - player->pos[1] = spCC; + player->pos[1] = nextY; player->unk_064[0] = spE0[0]; player->unk_064[2] = spE0[2]; - player->velocity[0] = sp54[0]; - player->velocity[1] = sp54[1]; - player->velocity[2] = sp54[2]; + player->velocity[0] = newVelocity[0]; + player->velocity[1] = newVelocity[1]; + player->velocity[2] = newVelocity[2]; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - if (gKartTopSpeedTable[player->characterId] < player->unk_094) { - temp_f0_6 = gKartTopSpeedTable[player->characterId] / player->unk_094; - player->velocity[0] *= temp_f0_6; - player->velocity[1] *= temp_f0_6; - player->velocity[2] *= temp_f0_6; - player->unk_094 = gKartTopSpeedTable[player->characterId]; + if (gKartTopSpeedTable[player->characterId] < player->speed) { + topSpeedMultiplier = gKartTopSpeedTable[player->characterId] / player->speed; + player->velocity[0] *= topSpeedMultiplier; + player->velocity[1] *= topSpeedMultiplier; + player->velocity[2] *= topSpeedMultiplier; + player->speed = gKartTopSpeedTable[player->characterId]; } } func_8002C4F8(player, playerId); } -void control_kart_ai_movement(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId) { +void control_cpu_movement(Player* player, UNUSED Camera* camera, s8 screenId, s8 playerId) { Vec3f spF4 = { 0.0f, 0.0f, 1.0f }; UNUSED Vec3f spE8 = { 0.0f, 0.0f, 0.0f }; Vec3f spDC = { 0.0f, 0.0f, 0.0f }; Vec3f spD0 = { 0.0f, 0.0f, 0.0f }; - f32 spCC; + f32 nextX; UNUSED s32 pad; - f32 spC4; + f32 nextZ; UNUSED s32 pad2[15]; f32 sp84; UNUSED s32 pad3; f32 sp7C; UNUSED s32 pad4[2]; - Vec3f sp68; + Vec3f newVelocity; UNUSED f32 pad5[7]; f32 toSqrt; - f32 temp_f0_2; - f32 test; - player->effects |= 0x1000; - player->unk_044 |= 0x10; - test = D_80164510[playerId]; - player->unk_204 = 0; - player->effects &= ~0x10; - func_8002B830(player, playerId, arg2); - apply_effect(player, playerId, arg2); + f32 topSpeedMultiplier; + f32 nextY; + player->effects |= LOST_RACE_EFFECT; + player->kartProps |= LOSE_GP_RACE; + nextY = gPlayerPathY[playerId]; + player->driftDuration = 0; + player->effects &= ~DRIFTING_EFFECT; + func_8002B830(player, playerId, screenId); + apply_effect(player, playerId, screenId); sp84 = 0 * player->unk_064[0] + spDC[0]; sp7C = 0 * player->unk_064[2] + spDC[2]; player->unk_10C = 0; player->unk_256 = 0; - player->effects &= ~0x8000; + player->effects &= ~ENEMY_BONK_EFFECT; spF4[2] = func_80030150(player, playerId); - mtxf_translate_vec3f_mat3(spF4, player->orientationMatrix); - sp68[0] = player->velocity[0]; - sp68[1] = 0; - sp68[2] = player->velocity[2]; - sp68[0] += (((spF4[0] + sp84) + spD0[0]) - (sp68[0] * (0.12 * player->kartFriction))) / 6000.0; - sp68[2] += (((spF4[2] + sp7C) + spD0[2]) - (sp68[2] * (0.12 * player->kartFriction))) / 6000.0; + mtxf_transform_vec3f_mat3(spF4, player->orientationMatrix); + newVelocity[0] = player->velocity[0]; + newVelocity[1] = 0; + newVelocity[2] = player->velocity[2]; + newVelocity[0] += (((spF4[0] + sp84) + spD0[0]) - (newVelocity[0] * (0.12 * player->kartFriction))) / 6000.0; + newVelocity[2] += (((spF4[2] + sp7C) + spD0[2]) - (newVelocity[2] * (0.12 * player->kartFriction))) / 6000.0; player->oldPos[0] = player->pos[0]; - player->oldPos[1] = test; + player->oldPos[1] = nextY; player->oldPos[2] = player->pos[2]; - spCC = player->pos[0] + player->velocity[0]; - spC4 = player->pos[2] + player->velocity[2]; + nextX = player->pos[0] + player->velocity[0]; + nextZ = player->pos[2] + player->velocity[2]; player->unk_0C0 = 0; player->kartHopJerk = 0; player->kartHopAcceleration = 0; @@ -2663,30 +2758,30 @@ void control_kart_ai_movement(Player* player, UNUSED Camera* camera, s8 arg2, s8 calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060, player->rotation[1]); player->unk_0C2 = 0; - player->effects &= ~2; - player->effects &= ~8; + player->effects &= ~HOP_EFFECT; + player->effects &= ~MIDAIR_EFFECT; player->slopeAccel = 0; player->unk_206 = 0; - toSqrt = (sp68[0] * sp68[0]) + (sp68[2] * sp68[2]); - player->unk_22C = player->unk_094; - player->unk_094 = sqrtf(toSqrt); - player->pos[0] = spCC; - player->pos[2] = spC4; - player->pos[1] = test; + toSqrt = (newVelocity[0] * newVelocity[0]) + (newVelocity[2] * newVelocity[2]); + player->previousSpeed = player->speed; + player->speed = sqrtf(toSqrt); + player->pos[0] = nextX; + player->pos[2] = nextZ; + player->pos[1] = nextY; player->unk_064[0] = 0; player->unk_064[2] = 0; - player->velocity[0] = sp68[0]; - player->velocity[1] = sp68[1]; - player->velocity[2] = sp68[2]; - D_80165070[playerId][0] = sp68[0]; - D_80165070[playerId][1] = sp68[1]; - D_80165070[playerId][2] = sp68[2]; - if (gKartTopSpeedTable[player->characterId] < player->unk_094) { - temp_f0_2 = gKartTopSpeedTable[player->characterId] / player->unk_094; - player->velocity[0] *= temp_f0_2; - player->velocity[1] *= temp_f0_2; - player->velocity[2] *= temp_f0_2; - player->unk_094 = gKartTopSpeedTable[player->characterId]; + player->velocity[0] = newVelocity[0]; + player->velocity[1] = newVelocity[1]; + player->velocity[2] = newVelocity[2]; + gPlayerLastVelocity[playerId][0] = newVelocity[0]; + gPlayerLastVelocity[playerId][1] = newVelocity[1]; + gPlayerLastVelocity[playerId][2] = newVelocity[2]; + if (gKartTopSpeedTable[player->characterId] < player->speed) { + topSpeedMultiplier = gKartTopSpeedTable[player->characterId] / player->speed; + player->velocity[0] *= topSpeedMultiplier; + player->velocity[1] *= topSpeedMultiplier; + player->velocity[2] *= topSpeedMultiplier; + player->speed = gKartTopSpeedTable[player->characterId]; } } @@ -2695,21 +2790,22 @@ void func_8002F730(Player* player, UNUSED Camera* camera, UNUSED s8 screenId, s8 Vec3f spE8 = { 0.0f, 0.0f, 0.0f }; UNUSED Vec3f spDC = { 0.0f, 0.0f, 0.0f }; Vec3f spD0 = { 0.0f, 0.0f, 0.0f }; - f32 spCC; - f32 spC8; - f32 spC4; + // Next position is current position + current velocity + f32 nextX; + f32 nextY; + f32 nextZ; - f32 spC0; - f32 sp44; - f32 spB8; - f32 temp_f0_2; + f32 posX; + f32 posY; + f32 posZ; + f32 topSpeedMultiplier; UNUSED s32 pad[11]; f32 sp84; UNUSED s32 pad2; f32 sp7C; - f32 sp78; + f32 surfaceDistance; f32 sqrt; - Vec3f sp68; + Vec3f newVelocity; Vec3f sp5C; UNUSED s32 pad3[3]; @@ -2718,88 +2814,89 @@ void func_8002F730(Player* player, UNUSED Camera* camera, UNUSED s8 screenId, s8 sp7C = player->unk_064[2] * 0; spF4[2] = func_80030150(player, playerId); - mtxf_translate_vec3f_mat3(spF4, player->orientationMatrix); + mtxf_transform_vec3f_mat3(spF4, player->orientationMatrix); - sp68[0] = player->velocity[0]; - sp68[1] = player->velocity[1]; - sp68[2] = player->velocity[2]; + newVelocity[0] = player->velocity[0]; + newVelocity[1] = player->velocity[1]; + newVelocity[2] = player->velocity[2]; - sp68[0] += (((f64) (spF4[0] + sp84) - (sp68[0] * 780.0)) / 6500.0); - sp68[2] += (((f64) (spF4[2] + sp7C) - (sp68[2] * 780.0)) / 6500.0); - sp68[1] += (((f64) (spF4[1] + -1100.0f) - (sp68[1] * 780.0)) / 6500.0); + newVelocity[0] += (((f64) (spF4[0] + sp84) - (newVelocity[0] * 780.0)) / 6500.0); + newVelocity[2] += (((f64) (spF4[2] + sp7C) - (newVelocity[2] * 780.0)) / 6500.0); + newVelocity[1] += (((f64) (spF4[1] + -1100.0f) - (newVelocity[1] * 780.0)) / 6500.0); - spC0 = player->pos[0]; - sp44 = player->pos[1]; - spB8 = player->pos[2]; + posX = player->pos[0]; + posY = player->pos[1]; + posZ = player->pos[2]; player->oldPos[0] = player->pos[0]; player->oldPos[1] = player->pos[1]; player->oldPos[2] = player->pos[2]; - spCC = player->velocity[0] + spC0; - spC8 = player->velocity[1] + sp44; - spC4 = player->velocity[2] + spB8; + nextX = player->velocity[0] + posX; + nextY = player->velocity[1] + posY; + nextZ = player->velocity[2] + posZ; func_8002AAC0(player); - spC8 += player->kartHopVelocity; - actor_terrain_collision(&player->collision, player->boundingBoxSize, spCC, spC8, spC4, player->oldPos[0], + nextY += player->kartHopVelocity; + actor_terrain_collision(&player->collision, player->boundingBoxSize, nextX, nextY, nextZ, player->oldPos[0], player->oldPos[1], player->oldPos[2]); player->unk_058 = 0.0f; player->unk_05C = 1.0f; player->unk_060 = 0.0f; calculate_orientation_matrix(player->orientationMatrix, 0.0f, 1.0f, 0.0f, (s16) (s32) player->rotation[1]); - player->effects &= ~8; - sp78 = player->collision.surfaceDistance[2]; - if (sp78 <= 0.0f) { + player->effects &= ~MIDAIR_EFFECT; + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0.0f) { if (1) {}; - func_8003F46C(player, sp5C, sp68, spE8, &sp78, &spCC, &spC8, &spC4); + func_8003F46C(player, sp5C, newVelocity, spE8, &surfaceDistance, &nextX, &nextY, &nextZ); } - player->unk_074 = calculate_surface_height(spCC, spC8, spC4, player->collision.meshIndexZX); + player->unk_074 = calculate_surface_height(nextX, nextY, nextZ, player->collision.meshIndexZX); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((gActiveScreenMode == SCREEN_MODE_1P) || (gActiveScreenMode == SCREEN_MODE_2P_SPLITSCREEN_VERTICAL) || (gActiveScreenMode == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL))) { - func_80029B4C(player, spCC, spC8, spC4); + func_80029B4C(player, nextX, nextY, nextZ); } else { - func_8002A194(player, spCC, spC8, spC4); - } - func_8002AE38(player, playerId, spC0, spB8, spCC, spC4); - sqrt = (sp68[0] * sp68[0]) + (sp68[1] * sp68[1]) + (sp68[2] * sp68[2]); - player->unk_22C = player->unk_094; - player->unk_094 = sqrtf(sqrt); - if (((player->unk_08C <= 0.0f) && ((f64) player->unk_094 < 0.13)) || - ((player->unk_08C <= 0.0f) && ((f64) player->unk_094 < 0.2) && ((player->effects & 1) == 1))) { - sp68[0] = sp68[0] + (sp68[0] * -1.0f); - sp68[2] = sp68[2] + (sp68[2] * -1.0f); + func_8002A194(player, nextX, nextY, nextZ); + } + func_8002AE38(player, playerId, posX, posZ, nextX, nextZ); + sqrt = (newVelocity[0] * newVelocity[0]) + (newVelocity[1] * newVelocity[1]) + (newVelocity[2] * newVelocity[2]); + player->previousSpeed = player->speed; + player->speed = sqrtf(sqrt); + if (((player->unk_08C <= 0.0f) && ((f64) player->speed < 0.13)) || + ((player->unk_08C <= 0.0f) && ((f64) player->speed < 0.2) && + ((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT))) { + newVelocity[0] = newVelocity[0] + (newVelocity[0] * -1.0f); + newVelocity[2] = newVelocity[2] + (newVelocity[2] * -1.0f); } else { - player->pos[0] = spCC; - player->pos[2] = spC4; + player->pos[0] = nextX; + player->pos[2] = nextZ; } - player->pos[1] = spC8 - 0.018; + player->pos[1] = nextY - 0.018; player->unk_064[0] = spE8[0]; player->unk_064[2] = spE8[2]; - player->velocity[0] = sp68[0]; - player->velocity[1] = sp68[1]; - player->velocity[2] = sp68[2]; + player->velocity[0] = newVelocity[0]; + player->velocity[1] = newVelocity[1]; + player->velocity[2] = newVelocity[2]; - D_80165070[playerId][0] = sp68[0]; - D_80165070[playerId][1] = sp68[1]; - D_80165070[playerId][2] = sp68[2]; + gPlayerLastVelocity[playerId][0] = newVelocity[0]; + gPlayerLastVelocity[playerId][1] = newVelocity[1]; + gPlayerLastVelocity[playerId][2] = newVelocity[2]; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - if (gKartTopSpeedTable[player->characterId] < player->unk_094) { - temp_f0_2 = gKartTopSpeedTable[player->characterId] / player->unk_094; - player->velocity[0] *= temp_f0_2; - player->velocity[1] *= temp_f0_2; - player->velocity[2] *= temp_f0_2; - player->unk_094 = gKartTopSpeedTable[player->characterId]; + if (gKartTopSpeedTable[player->characterId] < player->speed) { + topSpeedMultiplier = gKartTopSpeedTable[player->characterId] / player->speed; + player->velocity[0] *= topSpeedMultiplier; + player->velocity[1] *= topSpeedMultiplier; + player->velocity[2] *= topSpeedMultiplier; + player->speed = gKartTopSpeedTable[player->characterId]; } } } -void func_8002FCA8(Player* player, s8 arg1) { +void func_8002FCA8(Player* player, s8 playerIndex) { f32 var_f0; f32 var_f12; s32 temp_lo; @@ -2820,7 +2917,7 @@ void func_8002FCA8(Player* player, s8 arg1) { var_f0 += D_800E2AB0[player->characterId][player->tyres[FRONT_LEFT].surfaceType]; } } - if (D_801652C0[arg1] & 4) { + if (D_801652C0[playerIndex] & 4) { var_v1 = 2; } else { var_v1 = 0; @@ -2831,7 +2928,7 @@ void func_8002FCA8(Player* player, s8 arg1) { var_f0 += 1.0; } } - if (((player->effects & 0x200000) == 0x200000) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { + if (((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { var_f0 = -3.0f; } @@ -2849,13 +2946,13 @@ void func_8002FE84(Player* player, f32 arg1) { s16 temp_lo; s32 test; - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) { player->unk_098 = ((player->currentSpeed * player->currentSpeed) / 25.0f) * 1.1; return; } // Huh? - if (((player->effects & 0xFFFFFFFF) & 8) == 8) { + if (((player->effects & ALL_EFFECTS) & MIDAIR_EFFECT) == MIDAIR_EFFECT) { player->unk_098 = ((player->currentSpeed * player->currentSpeed) / 25.0f) * 1.1; return; } @@ -2884,20 +2981,20 @@ void func_8002FE84(Player* player, f32 arg1) { var_f0 += test * 0.004; } player->unk_098 = arg1 * (1.0 + (var_f0 * 0.7)); - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { temp_f0_3 = player->currentSpeed + 180.0f; player->unk_098 = (temp_f0_3 * temp_f0_3) / 25.0f; } } -f32 func_80030150(Player* player, s8 arg1) { +f32 func_80030150(Player* player, s8 playerIndex) { f32 var_f0; s16 temp_lo; f32 var_f2; s32 var_v0; var_f0 = 0.0f; - var_f2 = (player->unk_094 / 18.0f) * 216.0f; + var_f2 = (player->speed / 18.0f) * 216.0f; if (var_f2 >= 8.0f) { if ((player->effects & STAR_EFFECT) != STAR_EFFECT) { if ((s32) player->tyres[BACK_RIGHT].surfaceType >= 0xF) { @@ -2919,7 +3016,8 @@ f32 func_80030150(Player* player, s8 arg1) { var_f0 += D_800E2E90[player->characterId][player->tyres[FRONT_LEFT].surfaceType]; } } - if (((player->effects & 8) != 8) && ((player->unk_0CA & 2) != 2)) { + if (((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) && + ((player->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU)) { temp_lo = player->slopeAccel / 182; if (var_f2 >= 20.0f) { if ((temp_lo > 0x11) || (temp_lo < -0x11)) { @@ -2933,7 +3031,7 @@ f32 func_80030150(Player* player, s8 arg1) { var_f0 += -0.55; } } - if (((player->effects & 0x10) == 0x10) || (player->unk_204 > 0)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) || (player->driftDuration > 0)) { var_v0 = (s16) player->unk_0C0 / 182; if (var_v0 < 0) { var_f0 += -var_v0 * 0.004; @@ -2948,7 +3046,7 @@ f32 func_80030150(Player* player, s8 arg1) { var_f0 += var_v0 * (0.01 + gKartTurnSpeedReductionTable0[player->characterId]); } } - if (((player->effects & 0x20000000) == 0x20000000) && (player->unk_228 < 0xA)) { + if (((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) && (player->unk_228 < 0xA)) { if (var_v0 < 0) { var_f0 += -var_v0 * 0.008; } else { @@ -2959,18 +3057,18 @@ f32 func_80030150(Player* player, s8 arg1) { var_f0 += -0.25; } } - if ((player->unk_0DE & 1) == 1) { + if ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) == UNDER_OOB_OR_FLUID_LEVEL) { var_f0 += 0.3; } else { - if ((player->unk_0DE & 2) == 2) { + if ((player->oobProps & PASS_OOB_OR_FLUID_LEVEL) == PASS_OOB_OR_FLUID_LEVEL) { var_f0 += 0.15; } - if (((D_801652A0[arg1] - player->tyres[BACK_LEFT].baseHeight) >= 3.5) || - ((D_801652A0[arg1] - player->tyres[BACK_RIGHT].baseHeight) >= 3.5)) { + if (((D_801652A0[playerIndex] - player->tyres[BACK_LEFT].baseHeight) >= 3.5) || + ((D_801652A0[playerIndex] - player->tyres[BACK_RIGHT].baseHeight) >= 3.5)) { var_f0 += 0.05; } } - if ((player->effects & 8) != 0) { + if ((player->effects & MIDAIR_EFFECT) != 0) { move_f32_towards(&player->unk_0A0, player->unk_08C * 0.04, 0.15f); } else { move_f32_towards(&player->unk_0A0, 0.0f, 0.1f); @@ -2986,19 +3084,20 @@ f32 func_80030150(Player* player, s8 arg1) { } } if ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN) { - if ((player->effects & 0x200000) == 0x200000) { + if ((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { move_f32_towards(&player->unk_0E8, 380.0f, 0.5f); } else { move_f32_towards(&player->unk_0E8, 0.0f, 0.1f); } } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - if (((player->effects & 0x100) == 0x100) && ((player->effects & 0x10) != 0x10)) { + if (((player->effects & MINI_TURBO_EFFECT) == MINI_TURBO_EFFECT) && + ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { move_f32_towards(&player->unk_0E8, 580.0f, 0.2f); } else { move_f32_towards(&player->unk_0E8, 0.0f, 0.01f); } - if ((player->effects & 0x200000) == 0x200000) { + if ((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { move_f32_towards(&player->unk_0E4, 580.0f, 0.01f); } else { move_f32_towards(&player->unk_0E4, 0.0f, 0.01f); @@ -3009,17 +3108,18 @@ f32 func_80030150(Player* player, s8 arg1) { if (var_f2 < 0.0f) { var_f2 = 0.0f; } - if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8) || + if (((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->lakituProps & LAKITU_SCENE) == LAKITU_SCENE) || ((player->type & PLAYER_START_SEQUENCE) == PLAYER_START_SEQUENCE)) { return (1.0f - player->unk_104) * var_f2; } - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x01000000) == 0x01000000) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT)) { + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT)) { return (1.0f - player->unk_104) * var_f2; } - // Have to `and` the 0x2000 here to force the compiler to reload the immediate - if (((player->effects & BOOST_EFFECT) == (BOOST_EFFECT & 0xFFFFFFFF)) || + if (((player->effects & MUSHROOM_EFFECT) == MUSHROOM_EFFECT) || ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) || ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT)) { func_8002FE84(player, player->boostPower + player->unk_08C); @@ -3033,8 +3133,9 @@ void func_80030A34(Player* player) { f32 var_f0; f32 var_f2; - if (((player->unk_0CA & 2) != 2) && ((player->unk_0CA & 8) != 8)) { - if ((((player->unk_094 / 18.0f) * 216.0f) >= 8.0f) && (player->unk_DB4.unkC < 1.0f)) { + if (((player->lakituProps & HELD_BY_LAKITU) != HELD_BY_LAKITU) && + ((player->lakituProps & LAKITU_SCENE) != LAKITU_SCENE)) { + if ((((player->speed / 18.0f) * 216.0f) >= 8.0f) && (player->unk_DB4.unkC < 1.0f)) { switch (player->surfaceType) { /* irregular */ case ASPHALT: if (random_int(0x000AU) != 8) { @@ -3198,7 +3299,7 @@ void detect_triple_a_combo_a_pressed(Player* player) { } } -void player_speed(Player* player) { +void player_accelerate_alternative(Player* player) { s32 player_index; player_index = get_player_index_for_player(player); @@ -3301,17 +3402,18 @@ void player_speed(Player* player) { if (player->topSpeed <= player->currentSpeed) { player->currentSpeed = player->topSpeed; } - if (!((player->effects & 8)) || ((player->effects & LIGHTNING_EFFECT))) { + if (!((player->effects & MIDAIR_EFFECT)) || ((player->effects & LIGHTNING_EFFECT))) { player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f; } - player->unk_044 |= 0x20; - if ((player->soundEffects * 8) < 0) { + player->kartProps |= THROTTLE; + // Hacky way to check for START_SPINOUT_TRIGGER + if ((player->triggers * 8) < 0) { func_8008F104(player, player_index); - player->soundEffects &= 0xEFFFFFFF; + player->triggers &= ~START_SPINOUT_TRIGGER; } } -void decelerate_ai_player(Player* player, f32 speed) { +void player_decelerate_alternative(Player* player, f32 speed) { s32 player_index; player_index = get_player_index_for_player(player); @@ -3319,19 +3421,20 @@ void decelerate_ai_player(Player* player, f32 speed) { if (player->currentSpeed <= 0.0f) { player->currentSpeed = 0.0f; } - if (player->unk_094 < 0.2) { + if (player->speed < 0.2) { player->unk_08C = 0.0f; } if (player->topSpeed <= player->currentSpeed) { player->currentSpeed = player->topSpeed; } - if ((player->effects & 8) != 8) { + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f; } - player->unk_044 &= 0xFFDF; - if ((player->soundEffects * 8) < 0) { + player->kartProps &= ~THROTTLE; + // Hacky way to check for START_SPINOUT_TRIGGER + if ((player->triggers * 8) < 0) { func_8008F104(player, player_index); - player->soundEffects &= 0xEFFFFFFF; + player->triggers &= ~START_SPINOUT_TRIGGER; } } @@ -3458,39 +3561,39 @@ void detect_triple_b_combo_b_pressed(Player* player) { } void func_800323E4(Player* player) { - s32 var_v1; + s32 playerIndex; f32 test; f32 var_f2; var_f2 = 0.0f; if (player == gPlayerOne) { - var_v1 = 0; + playerIndex = 0; } if (player == gPlayerTwo) { - var_v1 = 1; + playerIndex = 1; } if (player == gPlayerThree) { - var_v1 = 2; + playerIndex = 2; } if (player == gPlayerFour) { - var_v1 = 3; + playerIndex = 3; } if (player == gPlayerFive) { - var_v1 = 4; + playerIndex = 4; } if (player == gPlayerSix) { - var_v1 = 5; + playerIndex = 5; } if (player == gPlayerSeven) { - var_v1 = 6; + playerIndex = 6; } if (player == gPlayerEight) { - var_v1 = 7; + playerIndex = 7; } - player->effects |= 1; + player->effects |= BRAKING_EFFECT; // This check will never be true, why is it here? - if ((player->effects & 0x20) == 0x20) { - decelerate_ai_player(player, 1.0f); + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { + player_decelerate_alternative(player, 1.0f); player->unk_20C = var_f2; } else { if ((s32) player->tyres[BACK_RIGHT].surfaceType < 0xF) { @@ -3499,7 +3602,7 @@ void func_800323E4(Player* player) { if ((s32) player->tyres[BACK_LEFT].surfaceType < 0xF) { var_f2 += D_800E3210[player->characterId][player->tyres[BACK_LEFT].surfaceType]; } - test = player->unk_22C - player->unk_094; + test = player->previousSpeed - player->speed; if (test <= 0.0f) { player->unk_20C = 0.0f; } else { @@ -3508,31 +3611,31 @@ void func_800323E4(Player* player) { player->unk_20C = 2.0f; } } - if (gIsPlayerTripleBButtonCombo[var_v1] == true) { + if (gIsPlayerTripleBButtonCombo[playerIndex] == true) { if (player->unk_20C >= 2.0f) { - decelerate_ai_player(player, (1.0f - var_f2) * 5.0f); + player_decelerate_alternative(player, (1.0f - var_f2) * 5.0f); } else { - decelerate_ai_player(player, (1.0f - var_f2) * 3.0f); + player_decelerate_alternative(player, (1.0f - var_f2) * 3.0f); } } else { - if (((player->unk_094 / 18.0f) * 216.0f) <= 20.0f) { - decelerate_ai_player(player, (1.0f - var_f2) * 4.0f); + if (((player->speed / 18.0f) * 216.0f) <= 20.0f) { + player_decelerate_alternative(player, (1.0f - var_f2) * 4.0f); } if (player->unk_20C >= 2.0f) { - decelerate_ai_player(player, (1.0f - var_f2) * 2.5); + player_decelerate_alternative(player, (1.0f - var_f2) * 2.5); } else { - decelerate_ai_player(player, (1.0f - var_f2) * 1.2); + player_decelerate_alternative(player, (1.0f - var_f2) * 1.2); } } } } -void func_80032700(Player* player) { - s32 temp_v0; +void player_accelerate_during_start_sequence(Player* player) { + s32 playerIndex; s32 var_v0; - s32 test; + s32 time_delta; - temp_v0 = get_player_index_for_player(player); + playerIndex = get_player_index_for_player(player); if ((player->currentSpeed >= 0.0) && (player->currentSpeed < (player->topSpeed * 0.1))) { player->currentSpeed += gKartAccelerationTables[player->characterId][0] * 3.0; } @@ -3564,45 +3667,45 @@ void func_80032700(Player* player) { player->currentSpeed += gKartAccelerationTables[player->characterId][9] * 2.5; } if (D_801656F0 == 1) { - test = gRaceFrameCounter - D_801652E0[temp_v0]; + time_delta = gRaceFrameCounter - D_801652E0[playerIndex]; if (gModeSelection == TIME_TRIALS) { var_v0 = 0x14; } else { var_v0 = 8; } - if ((test < var_v0) && ((player->unk_044 & 0x20) != 0x20)) { - player->soundEffects |= 0x02000000; + if ((time_delta < var_v0) && ((player->kartProps & THROTTLE) != THROTTLE)) { + player->triggers |= START_BOOST_TRIGGER; } else if ((player->topSpeed * 0.9f) <= player->currentSpeed) { - if ((player->soundEffects & 0x02000000) != 0x02000000) { - player->soundEffects |= 0x10000000; - player->soundEffects &= ~0x02000000; + if ((player->triggers & START_BOOST_TRIGGER) != START_BOOST_TRIGGER) { + player->triggers |= START_SPINOUT_TRIGGER; + player->triggers &= ~START_BOOST_TRIGGER; } } } - player->unk_044 |= 0x20; + player->kartProps |= THROTTLE; player->unk_098 = (player->currentSpeed * player->currentSpeed) / 25.0f; } -void func_80032CB0(Player* player, f32 arg1) { - player->currentSpeed -= arg1; +void player_decelerate_during_start_sequence(Player* player, f32 speedReduction) { + player->currentSpeed -= speedReduction; if (player->currentSpeed <= 0.0f) { player->currentSpeed = 0.0f; } - if (player->unk_094 < 0.2) { + if (player->speed < 0.2) { player->unk_08C = 0.0f; } if (player->topSpeed <= player->currentSpeed) { player->currentSpeed = player->topSpeed; } if ((f64) player->currentSpeed <= (player->topSpeed * 0.7)) { - player->soundEffects &= ~0x10000000; + player->triggers &= ~START_SPINOUT_TRIGGER; } - player->soundEffects &= ~0x02000000; - player->unk_044 &= ~0x0020; + player->triggers &= ~START_BOOST_TRIGGER; + player->kartProps &= ~THROTTLE; player->unk_098 = (player->currentSpeed * player->currentSpeed) / 25.0f; } -void func_80032D94(Player* player) { +void player_accelerate(Player* player) { UNUSED s32 player_index; player_index = get_player_index_for_player(player); @@ -3642,8 +3745,8 @@ void func_80032D94(Player* player) { player->unk_098 = (player->currentSpeed * player->currentSpeed) / 25.0f; } -void func_80033280(Player* player, f32 arg1) { - player->currentSpeed -= arg1; +void player_decelerate(Player* player, f32 speedReduction) { + player->currentSpeed -= speedReduction; if (player->currentSpeed <= 0.0f) { player->currentSpeed = 0.0f; } @@ -3653,54 +3756,64 @@ void func_80033280(Player* player, f32 arg1) { player->unk_098 = (player->currentSpeed * player->currentSpeed) / 25.0f; } -void func_800332E8(Player* player, s32 arg1) { - if ((D_80165280[arg1] >= 0.0) && (D_80165280[arg1] < ((f64) player->topSpeed * 0.1))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][0] * 3.2; +void player_accelerate_global(Player* player, s32 playerIndex) { + if ((gPlayerCurrentSpeed[playerIndex] >= 0.0) && + (gPlayerCurrentSpeed[playerIndex] < ((f64) player->topSpeed * 0.1))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][0] * 3.2; } - if (((player->topSpeed * 0.1) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.2))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][1] * 3.2; + if (((player->topSpeed * 0.1) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.2))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][1] * 3.2; } - if (((player->topSpeed * 0.2) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.3))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][2] * 3.2; + if (((player->topSpeed * 0.2) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.3))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][2] * 3.2; } - if (((player->topSpeed * 0.3) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.4))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][3] * 3.2; + if (((player->topSpeed * 0.3) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.4))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][3] * 3.2; } - if (((player->topSpeed * 0.4) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.5))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][4] * 3.2; + if (((player->topSpeed * 0.4) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.5))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][4] * 3.2; } - if (((player->topSpeed * 0.5) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.6))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][5] * 3.2; + if (((player->topSpeed * 0.5) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.6))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][5] * 3.2; } - if (((player->topSpeed * 0.6) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.7))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][6] * 3.2; + if (((player->topSpeed * 0.6) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.7))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][6] * 3.2; } - if (((player->topSpeed * 0.7) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.8))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][7] * 2.8; + if (((player->topSpeed * 0.7) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.8))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][7] * 2.8; } - if (((player->topSpeed * 0.8) <= D_80165280[arg1]) && (D_80165280[arg1] < (player->topSpeed * 0.9))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][8] * 2.8; + if (((player->topSpeed * 0.8) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.9))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][8] * 2.8; } - if (((player->topSpeed * 0.9) <= D_80165280[arg1]) && (D_80165280[arg1] <= (player->topSpeed * 1.0))) { - D_80165280[arg1] += gKartAccelerationTables[player->characterId][9] * 2.8; + if (((player->topSpeed * 0.9) <= gPlayerCurrentSpeed[playerIndex]) && + (gPlayerCurrentSpeed[playerIndex] <= (player->topSpeed * 1.0))) { + gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][9] * 2.8; } - player->unk_044 |= 0x20; - if (D_80165280[arg1] < 0.0f) { - D_80165280[arg1] = 0.0f; + player->kartProps |= THROTTLE; + if (gPlayerCurrentSpeed[playerIndex] < 0.0f) { + gPlayerCurrentSpeed[playerIndex] = 0.0f; } - player->unk_098 = (D_80165280[arg1] * D_80165280[arg1]) / 25.0f; + player->unk_098 = (gPlayerCurrentSpeed[playerIndex] * gPlayerCurrentSpeed[playerIndex]) / 25.0f; } -void func_800337CC(Player* player, f32 arg1, s32 arg2) { - player->unk_044 &= ~0x20; - D_80165280[arg2] -= arg1; - if (D_80165280[arg2] <= 0.0f) { - D_80165280[arg2] = 0.0f; +void player_decelerate_global(Player* player, f32 speedReduction, s32 playerIndex) { + player->kartProps &= ~THROTTLE; + gPlayerCurrentSpeed[playerIndex] -= speedReduction; + if (gPlayerCurrentSpeed[playerIndex] <= 0.0f) { + gPlayerCurrentSpeed[playerIndex] = 0.0f; } - if (player->topSpeed <= D_80165280[arg2]) { - D_80165280[arg2] = player->topSpeed; + if (player->topSpeed <= gPlayerCurrentSpeed[playerIndex]) { + gPlayerCurrentSpeed[playerIndex] = player->topSpeed; } - player->unk_098 = (D_80165280[arg2] * D_80165280[arg2]) / 25.0f; + player->unk_098 = (gPlayerCurrentSpeed[playerIndex] * gPlayerCurrentSpeed[playerIndex]) / 25.0f; } void func_80033850(Player* arg0, f32 arg1) { @@ -3810,42 +3923,43 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 }; - if (((((player->effects & 2) != 2) && ((((player->unk_0C0 / 182) <= 6) && ((player->unk_0C0 / 182) >= (-6))) || - ((controller->button & R_TRIG) != R_TRIG))) || - (((player->unk_094 / 18.0f) * 216.0f) <= 20.0f)) || - ((player->effects & 0x8000) == 0x8000)) { + if (((((player->effects & HOP_EFFECT) != HOP_EFFECT) && + ((((player->unk_0C0 / 182) <= 6) && ((player->unk_0C0 / 182) >= (-6))) || + ((controller->button & R_TRIG) != R_TRIG))) || + (((player->speed / 18.0f) * 216.0f) <= 20.0f)) || + ((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT)) { func_80036CB4(player); } - if ((player->unk_0C0 / 182) < (-5)) { - player->unk_044 |= 4; - player->unk_044 &= 0xFFFD; + if ((player->unk_0C0 / DEGREES_CONVERSION_FACTOR) < (-5)) { + player->kartProps |= LEFT_TURN; + player->kartProps &= ~RIGHT_TURN; D_801652C0[arg2]++; - } else if ((player->unk_0C0 / 182) >= 6) { - player->unk_044 |= 2; - player->unk_044 &= 0xFFFB; + } else if ((player->unk_0C0 / DEGREES_CONVERSION_FACTOR) > 5) { + player->kartProps |= RIGHT_TURN; + player->kartProps &= ~LEFT_TURN; D_801652C0[arg2]++; } else { - player->unk_044 &= 0xFFF9; + player->kartProps &= ~(LEFT_TURN | RIGHT_TURN); D_801652C0[arg2] = 0; } - if (((player->effects & 2) == 2) || ((player->effects & 0x10) == 0x10)) { - player->unk_044 &= 0xFFF9; + if (((player->effects & HOP_EFFECT) == HOP_EFFECT) || ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT)) { + player->kartProps &= ~(LEFT_TURN | RIGHT_TURN); } sp2E4 = player->unk_07C; - temp_v0_3 = func_80038534(controller); - if (((player->unk_044 & 1) == 1) || ((player->unk_044 & 8) == 8)) { + temp_v0_3 = get_clamped_stickX_with_deadzone(controller); + if (((player->kartProps & BACK_UP) == BACK_UP) || ((player->kartProps & MOVE_BACKWARDS) == MOVE_BACKWARDS)) { temp_v0_3 = -temp_v0_3; } player->unk_07C = (temp_v0_3 << 16) & 0xFFFF0000; sp2D0 = sp2E4 - player->unk_07C; sp2D0 = sp2D0 >> 16; player->unk_0FA = (s16) sp2D0; - if (((sp2D0 >= 0x5A) || (sp2D0 < (-0x59))) && (!(player->unk_044 & 0x4000))) { - if ((((((!(player->effects & 0x10)) && (gCCSelection == CC_150)) && (gModeSelection != BATTLE)) && - (!(player->effects & 8))) && - (((player->unk_094 / 18.0f) * 216.0f) >= 40.0f)) && - (player->unk_204 == 0)) { - player->soundEffects |= 0x80; + if (((sp2D0 >= 0x5A) || (sp2D0 < (-0x59))) && (!(player->kartProps & DRIVING_SPINOUT))) { + if ((((((!(player->effects & DRIFTING_EFFECT)) && (gCCSelection == CC_150)) && (gModeSelection != BATTLE)) && + (!(player->effects & MIDAIR_EFFECT))) && + (((player->speed / 18.0f) * 216.0f) >= 40.0f)) && + (player->driftDuration == 0)) { + player->triggers |= DRIVING_SPINOUT_TRIGGER; } } if (((s32) player->tyres[BACK_RIGHT].surfaceType) < 0xF) { @@ -3854,17 +3968,18 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (((s32) player->tyres[BACK_LEFT].surfaceType) < 0xF) { var_f2 += D_800E3610[player->characterId][player->tyres[BACK_LEFT].surfaceType]; } - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { sp2C8 = 10; sp2CC = 10; } else { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { var_a0 = 3; } else { var_a0 = 0; } - if (((player->unk_094 / 18.0f) * 216.0f) >= 15.0f) { - if ((player->unk_044 & 2) == 2) { + if (((player->speed / 18.0f) * 216.0f) >= 15.0f) { + if ((player->kartProps & RIGHT_TURN) == RIGHT_TURN) { if ((sp2D0 < 36) && (sp2D0 >= 0)) { sp2C8 = (gKartTable800E3650[player->characterId] + 1.0f) * (((f32) (var_a0 + 0xF)) * (1.0f + var_f2)); @@ -3874,7 +3989,7 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { sp2C8 = (s32) (((f32) (var_a0 + 5)) * (1.0f + var_f2)); sp2CC = (s32) (((f32) (var_a0 + 9)) * (1.0f + var_f2)); } - } else if ((player->unk_044 & 4) == 4) { + } else if ((player->kartProps & LEFT_TURN) == LEFT_TURN) { if ((sp2D0 >= (-0x23)) && (sp2D0 <= 0)) { sp2C8 = (gKartTable800E3650[player->characterId] + 1.0f) * (((f32) (var_a0 + 0xF)) * (1.0f + var_f2)); @@ -3893,11 +4008,11 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { sp2CC = 8; } } - if ((player->unk_0DE & 1) == 1) { + if ((player->oobProps & UNDER_OOB_OR_FLUID_LEVEL) == UNDER_OOB_OR_FLUID_LEVEL) { sp2C8 *= 1.5; sp2CC *= 1.5; } else { - if ((player->unk_0DE & 2) == 2) { + if ((player->oobProps & PASS_OOB_OR_FLUID_LEVEL) == PASS_OOB_OR_FLUID_LEVEL) { sp2C8 *= 1.2; sp2CC *= 1.2; } @@ -3997,9 +4112,9 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { func_80033A40(player, &sp2D0, &sp2E4, player->unk_07C, 2, 0x6000 / sp2CC, 1.9f); func_80033A40(player, &sp2D0, &sp2E4, player->unk_07C, 1, 0x5000 / sp2CC, 1.9f); func_80033A40(player, &sp2D0, &sp2E4, player->unk_07C, 0, 0 / sp2CC, 1.9f); - if ((player->effects & 0x10) == 0x10) { + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { var_f2_2 = (f32) (((s32) (sp2E4 >> 16)) / 8); - } else if (((player->unk_094 / 18.0f) * 216.0f) <= 25.0f) { + } else if (((player->speed / 18.0f) * 216.0f) <= 25.0f) { var_f2_2 = (f32) ((sp2E4 >> 16) / 12); } else { var_f2_2 = ((f32) (sp2E4 >> 0x10)) / (8.0f + (player->currentSpeed / 50.0f)); @@ -4007,18 +4122,18 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (var_f2_2 < 0.0f) { var_f2_2 = -var_f2_2; } - if ((player->effects & 0x20) == 0x20) { - var_f2_2 = var_f2_2 * (sp44[((s16) ((player->unk_094 / 18.0f) * 216.0f)) + 10] * 1.5f); - } else if ((player->effects & 0x10) == 0x10) { - var_f2_2 = var_f2_2 * sp44[(s16) ((player->unk_094 / 18.0f) * 216.0f)]; + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { + var_f2_2 = var_f2_2 * (sp44[((s16) ((player->speed / 18.0f) * 216.0f)) + 10] * 1.5f); + } else if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { + var_f2_2 = var_f2_2 * sp44[(s16) ((player->speed / 18.0f) * 216.0f)]; } else { - var_f2_2 = var_f2_2 * (sp44[(s16) ((player->unk_094 / 18.0f) * 216.0f)] * 1.5f); + var_f2_2 = var_f2_2 * (sp44[(s16) ((player->speed / 18.0f) * 216.0f)] * 1.5f); } player->unk_07C = sp2E4; if (player->unk_10C != 0) { func_8002BD58(player); } - player->effects &= 0xDFFFFFFF; + player->effects &= ~DRIFT_OUTSIDE_EFFECT; if (((s32) player->tyres[BACK_RIGHT].surfaceType) > 0xE) { var_f12 = var_f12; } else { @@ -4027,11 +4142,11 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (((s32) player->tyres[BACK_LEFT].surfaceType) < 0xF) { var_f12 += D_800E3410[player->characterId][player->tyres[BACK_LEFT].surfaceType]; } - if (((player->effects & 2) != 2) && ((player->effects & 0x10) != 0x10)) { - if ((player->effects & 0x20) == 0x20) { + if (((player->effects & HOP_EFFECT) != HOP_EFFECT) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { player->unk_078 = (s16) ((s32) (((f32) ((((s32) player->unk_07C) >> 0x10) * 5)) * var_f2_2)); } else { - if ((player->effects & 0x1) != 0x1) { + if ((player->effects & BRAKING_EFFECT) != BRAKING_EFFECT) { if (((player->unk_07C >> 16) >= 45) || ((player->unk_07C >> 16) <= (-45))) { player->unk_078 = ((player->unk_07C >> 16) * (var_f2_2 + (var_f2_2 * var_f12))) * (0.15 + gKartHandlingTable[player->characterId]); @@ -4040,51 +4155,51 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { gKartHandlingTable[player->characterId]; } } else { - if ((((player->unk_094 / 18.0f) * 216.0f) >= 0.0f) && (((player->unk_094 / 18.0f) * 216.0f) < 8.0f)) { + if ((((player->speed / 18.0f) * 216.0f) >= 0.0f) && (((player->speed / 18.0f) * 216.0f) < 8.0f)) { player->unk_078 = (player->unk_07C >> 16) * (var_f2_2 + (var_f2_2 * var_f12)); } - if ((((player->unk_094 / 18.0f) * 216.0f) >= 8.0f) && (((player->unk_094 / 18.0f) * 216.0f) < 65.0f)) { + if ((((player->speed / 18.0f) * 216.0f) >= 8.0f) && (((player->speed / 18.0f) * 216.0f) < 65.0f)) { player->unk_078 = (player->unk_07C >> 16) * ((var_f2_2 + 1.5) + (var_f2_2 * var_f12)); } - if (((player->unk_094 / 18.0f) * 216.0f) >= 65.0f) { + if (((player->speed / 18.0f) * 216.0f) >= 65.0f) { player->unk_078 = (player->unk_07C >> 16) * ((var_f2_2 + 1.6) + (var_f2_2 * var_f12)); } } player->unk_228 = 0; - if (player->unk_22A < 2) { - player->unk_22A = 0; + if (player->driftState < 2) { + player->driftState = 0; } } - } else if (((player->effects & 8) != 8) && ((player->effects & 2) != 2)) { + } else if (((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) && ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { if ((((s16) player->unk_0C0) / 182) > 0) { var_s1_2 = (((s32) (((player->unk_07C >> 0x10) * 0xD) + 0x2B1)) / 106) + 0x28; if ((player->unk_07C >> 0x10) < (-0x27)) { - player->effects = player->effects | 0x20000000; + player->effects = player->effects | DRIFT_OUTSIDE_EFFECT; if ((player->unk_07C >> 0x10) < (-0x31)) { - player->effects |= 0x20000000; + player->effects |= DRIFT_OUTSIDE_EFFECT; } } func_8002A8A4(player, arg2); } else { var_s1_2 = (((s32) (((player->unk_07C >> 0x10) * 0xD) + 0x2B1)) / 106) - 0x35; if ((player->unk_07C >> 0x10) >= 0x28) { - player->effects = player->effects | 0x20000000; + player->effects = player->effects | DRIFT_OUTSIDE_EFFECT; if ((player->unk_07C >> 0x10) < (-0x31)) { - player->effects |= 0x20000000; + player->effects |= DRIFT_OUTSIDE_EFFECT; } } func_8002A8A4(player, arg2); } - if ((((player->unk_094 / 18.0f) * 216.0f) >= 0.0f) && (((player->unk_094 / 18.0f) * 216.0f) < 8.0f)) { + if ((((player->speed / 18.0f) * 216.0f) >= 0.0f) && (((player->speed / 18.0f) * 216.0f) < 8.0f)) { player->unk_078 = (s16) ((s32) (var_s1_2 * ((var_f2_2 + 2.0f) + (var_f2_2 * var_f12)))); } - if ((((player->unk_094 / 18.0f) * 216.0f) >= 8.0f) && (((player->unk_094 / 18.0f) * 216.0f) < 65.0f)) { + if ((((player->speed / 18.0f) * 216.0f) >= 8.0f) && (((player->speed / 18.0f) * 216.0f) < 65.0f)) { player->unk_078 = var_s1_2 * ((var_f2_2 + 3) + (var_f2_2 * var_f12)); } - if (((player->unk_094 / 18.0f) * 216.0f) >= 65.0f) { + if (((player->speed / 18.0f) * 216.0f) >= 65.0f) { player->unk_078 = var_s1_2 * ((((f64) var_f2_2) + 3.5) + (var_f2_2 * var_f12)); } - if ((player->effects & 0x20000000) == 0x20000000) { + if ((player->effects & DRIFT_OUTSIDE_EFFECT) == DRIFT_OUTSIDE_EFFECT) { player->unk_078 *= 0.9; } else { player->unk_078 *= 0.65; @@ -4094,7 +4209,7 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (temp_v0_3 == 0) { var_s1_2 = 0; } - if (((player->unk_094 / 18.0f) * 216.0f) <= 5.0f) { + if (((player->speed / 18.0f) * 216.0f) <= 5.0f) { player->unk_078 = (s16) ((s32) (((f32) var_s1_2) * (var_f2_2 + 6.0f))); } else { player->unk_078 = ((s16) var_s1_2) * (var_f2_2 + 1.5f); @@ -4105,12 +4220,12 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { } } -void func_8003680C(Player* player, s16 arg1) { +void apply_cpu_turn(Player* player, s16 targetAngle) { s32 sp304 = 0; UNUSED f32 pad[6]; f32 var_f0; s16 var_v0; - f32 sp44[168] = { + f32 speedTurn[168] = { 0.0f, 0.1f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.7f, 0.7f, 0.7f, 0.7f, 0.7f, 0.7f, 0.7f, 0.6f, 0.5f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.5f, 0.5f, 0.5f, 0.5f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.7f, @@ -4122,21 +4237,22 @@ void func_8003680C(Player* player, s16 arg1) { 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, }; - f32 sp24[8] = { + f32 characterTurn[8] = { 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, }; - if (!((player->effects & 0x80) || (player->effects & 0x40) || (player->effects & 0x400) || - (player->effects & 0x10000) || (player->effects & 0x20000) || (player->effects & 0x01000000) || - (player->effects & HIT_BY_ITEM_EFFECT) || (player->effects & HIT_EFFECT))) { - if (!(((player->unk_094 / 18.0f) * 216.0f) >= 110.0f)) { - player->effects &= ~0x20000000; + if (!((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) || + (player->effects & HIT_BY_GREEN_SHELL_EFFECT) || (player->effects & TERRAIN_TUMBLE_EFFECT) || + (player->effects & LIGHTNING_STRIKE_EFFECT) || (player->effects & EXPLOSION_CRASH_EFFECT) || + (player->effects & HIT_BY_STAR_EFFECT) || (player->effects & SQUISH_EFFECT))) { + if (!(((player->speed / 18.0f) * 216.0f) >= 110.0f)) { + player->effects &= ~DRIFT_OUTSIDE_EFFECT; player->unk_228 = 0; - if (!(player->effects & 0x80) && !(player->effects & 0x40)) { + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT)) { sp304 = (s32) player->unk_07C >> 0x10; - move_s32_towards(&sp304, (s32) arg1, 0.35f); + move_s32_towards(&sp304, (s32) targetAngle, 0.35f); sp304 <<= 0x10; - if ((player->effects & 0x10) == 0x10) { + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { var_f0 = (sp304 >> 0x10) / 5; } else { var_f0 = (f32) (sp304 >> 0x10) / (8.0f + (player->currentSpeed / 50.0f)); @@ -4144,19 +4260,23 @@ void func_8003680C(Player* player, s16 arg1) { if (var_f0 < 0.0f) { var_f0 = -var_f0; } - if ((player->effects & 0x10) == 0x10) { - var_f0 = sp44[(s16) ((player->unk_094 / 18.0f) * 216.0f)] * var_f0; + + // Apply speed and character multipliers + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { + var_f0 = speedTurn[(s16) ((player->speed / 18.0f) * 216.0f)] * var_f0; } else { - var_f0 = sp44[(s16) ((player->unk_094 / 18.0f) * 216.0f)] * sp24[player->characterId] * var_f0; + var_f0 = speedTurn[(s16) ((player->speed / 18.0f) * 216.0f)] * characterTurn[player->characterId] * + var_f0; } player->unk_07C = sp304; - if (((player->effects & 2) != 2) && ((player->effects & 0x10) != 0x10)) { - if ((player->effects & 1) != 1) { + if (((player->effects & HOP_EFFECT) != HOP_EFFECT) && + ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { + if ((player->effects & BRAKING_EFFECT) != BRAKING_EFFECT) { player->unk_078 = (player->unk_07C >> 0x10) * var_f0; } else { player->unk_078 = (player->unk_07C >> 0x10) * (var_f0 + 1.5); } - } else if ((player->effects & 8) != 8) { + } else if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { if (((s16) player->unk_0C0 / 182) > 0) { var_v0 = player->unk_07C >> 0x10; } else { @@ -4166,13 +4286,15 @@ void func_8003680C(Player* player, s16 arg1) { player->unk_078 *= 0.8; } else { var_v0 = (s16) ((s32) player->unk_07C >> 0x10); - if (arg1 == 0) { + if (targetAngle == 0) { var_v0 = 0; } player->unk_078 = var_v0 * var_f0; } - if ((((player->effects & 2) != 2) && (player->unk_0C0 < 0x3D) && (player->unk_0C0 > -0x3D)) || - (((player->unk_094 / 18.0f) * 216.0f) <= 20.0f) || ((player->effects & 0x8000) == 0x8000)) { + if ((((player->effects & HOP_EFFECT) != HOP_EFFECT) && (player->unk_0C0 < 0x3D) && + (player->unk_0C0 > -0x3D)) || + (((player->speed / 18.0f) * 216.0f) <= 20.0f) || + ((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT)) { func_80036CB4(player); } } @@ -4180,18 +4302,18 @@ void func_8003680C(Player* player, s16 arg1) { } } -void func_80036C5C(Player* arg0) { - if (((arg0->unk_094 / 18.0f) * 216.0f) > 20.0f) { - arg0->unk_204 = 0; - arg0->effects |= 0x10; - arg0->unk_0B6 |= 0x800; +void func_80036C5C(Player* player) { + if (((player->speed / 18.0f) * 216.0f) > 20.0f) { + player->driftDuration = 0; + player->effects |= DRIFTING_EFFECT; + player->kartGraphics |= BOING; } } void func_80036CB4(Player* player) { s32 test; - if (((player->effects & 0x10) == 0x10) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { if ((player->unk_0C0 / 182) > 0) { test = ((((player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) + 0x28; player->unk_07C = test << 0x10; @@ -4200,10 +4322,10 @@ void func_80036CB4(Player* player) { test = ((((player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) - 0x35; player->unk_07C = test << 0x10; } - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; } - if (((player->effects & 0x10) == 0x10) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { - player->effects &= ~0x10; + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { + player->effects &= ~DRIFTING_EFFECT; } } @@ -4214,16 +4336,18 @@ void func_80036DB4(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f18; s32 temp_t6; - if (((player->effects & 0x1000) == 0x1000) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || + ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); sp20 = player->unk_084 * 3.0f; - } else if (!(player->effects & 0x800) && !(player->unk_044 & 0x4000)) { + } else if (!(player->effects & BANANA_NEAR_SPINOUT_EFFECT) && !(player->kartProps & DRIVING_SPINOUT)) { thing = player->unk_0FA; if (thing > 0) { thing *= -1; @@ -4231,35 +4355,36 @@ void func_80036DB4(Player* player, Vec3f arg1, Vec3f arg2) { temp_t6 = player->unk_07C >> 0x10; if ((temp_t6 < 0x15) && (temp_t6 >= -0x14)) { if (thing < 0x14) { - var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + + var_f18 = (player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f)) + (-player->currentSpeed * 0.02) + (-player->unk_20C * 50.0f); } else { - var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + + var_f18 = (player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f)) + ((temp_t6 * 0.01) + (-player->currentSpeed * 0.05)) + (-player->unk_20C * 50.0f); } } else { - var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + + var_f18 = (player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f)) + ((temp_t6 * 0.1) + (-player->currentSpeed * 0.15)) + (-player->unk_20C * 50.0f); } sp20 = player->unk_084; } else { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 1.5) + + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 1.5) + (((player->unk_07C >> 0x10) * 0.1) + (-player->currentSpeed * 0.05)) + (-player->unk_20C * 50.0f); sp20 = player->unk_084; } if ((player->effects & STAR_EFFECT) == STAR_EFFECT) { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); sp20 = player->unk_084 * 3.0f; } else { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f); + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f); sp20 = player->unk_084; } } - arg1[0] = (player->unk_090 + var_f18) * player->unk_094; + arg1[0] = (player->unk_090 + var_f18) * player->speed; arg1[1] = 0.0f; - arg1[2] = player->unk_094 * sp20; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + arg1[2] = player->speed * sp20; + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } arg2[0] = arg1[0]; arg2[1] = arg1[1]; @@ -4272,16 +4397,18 @@ void func_800371F4(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f18; s32 temp_t6; - if (((player->effects & 0x1000) == 0x1000) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || + ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); sp20 = player->unk_084 * 3.0f; - } else if (!(player->effects & 0x800) && !(player->unk_044 & 0x4000)) { + } else if (!(player->effects & BANANA_NEAR_SPINOUT_EFFECT) && !(player->kartProps & DRIVING_SPINOUT)) { var_v0 = player->unk_0FA; if (var_v0 > 0) { var_v0 *= -1; @@ -4289,38 +4416,39 @@ void func_800371F4(Player* player, Vec3f arg1, Vec3f arg2) { temp_t6 = (s32) player->unk_07C >> 0x10; if ((temp_t6 < 0x15) && (temp_t6 >= -0x14)) { if (var_v0 < 0x14) { - var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + + var_f18 = (player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f)) + (-player->currentSpeed * 0.02) + (-player->unk_20C * 50.0f); } else { - var_f18 = ((player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) - + var_f18 = ((player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f)) - ((temp_t6 * 0.01) + (player->currentSpeed * 0.05))) + (-player->unk_20C * 50.0f); } } else { - var_f18 = ((player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) - + var_f18 = ((player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f)) - ((temp_t6 * 0.1) + (player->currentSpeed * 0.15))) + (-player->unk_20C * 50.0f); } sp20 = player->unk_084; } else { - var_f18 = ((player->unk_208 + ((f64) (-(player->unk_094 / 18.0f) * 216.0f) * 1.5)) - + var_f18 = ((player->unk_208 + ((f64) (-(player->speed / 18.0f) * 216.0f) * 1.5)) - (((player->unk_07C >> 0x10) * 0.1) + (player->currentSpeed * 0.05))) + (-player->unk_20C * 50.0f); sp20 = player->unk_084; } if ((player->effects & STAR_EFFECT) == STAR_EFFECT) { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); sp20 = player->unk_084 * 3.0f; } else { - var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f); + var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 3.0f); sp20 = player->unk_084; } } - arg1[0] = -(player->unk_090 + var_f18) * player->unk_094; + arg1[0] = -(player->unk_090 + var_f18) * player->speed; arg1[1] = 0.0f; - arg1[2] = player->unk_094 * sp20; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + arg1[2] = player->speed * sp20; + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } arg2[0] = arg1[0]; arg2[1] = arg1[1]; @@ -4331,23 +4459,25 @@ void func_80037614(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if (((player->effects & 0x1000) == 0x1000) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || + ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { - var_f2 = ((-(player->unk_094 / 18.0f) * 216.0f) * 2) + -80.0f; + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { + var_f2 = ((-(player->speed / 18.0f) * 216.0f) * 2) + -80.0f; var_f12 = -80.0f; } else { - var_f2 = ((-(player->unk_094 / 18.0f) * 216.0f) / 2) + -20.0f; + var_f2 = ((-(player->speed / 18.0f) * 216.0f) / 2) + -20.0f; var_f12 = -40.0f; } - arg1[0] = (var_f2 + 28.0f) * player->unk_094; + arg1[0] = (var_f2 + 28.0f) * player->speed; arg1[1] = 0.0f; - arg1[2] = var_f12 * player->unk_094; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + arg1[2] = var_f12 * player->speed; + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } arg2[0] = arg1[0]; arg2[1] = arg1[1]; @@ -4358,23 +4488,25 @@ void func_8003777C(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if (((player->effects & 0x1000) == 0x1000) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || + ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & 0x10) == 0x10) && ((player->effects & 2) != 2)) { - var_f2 = ((-(player->unk_094 / 18.0f) * 216.0f) * 2) + -80.0f; + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && + ((player->effects & HOP_EFFECT) != HOP_EFFECT)) { + var_f2 = ((-(player->speed / 18.0f) * 216.0f) * 2) + -80.0f; var_f12 = -80.0f; } else { - var_f2 = ((-(player->unk_094 / 18.0f) * 216.0f) / 2) + -20.0f; + var_f2 = ((-(player->speed / 18.0f) * 216.0f) / 2) + -20.0f; var_f12 = -40.0f; } - arg1[0] = -(var_f2 + 28.0f) * player->unk_094; + arg1[0] = -(var_f2 + 28.0f) * player->speed; arg1[1] = 0.0f; - arg1[2] = var_f12 * player->unk_094; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + arg1[2] = var_f12 * player->speed; + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } arg2[0] = arg1[0]; arg2[1] = arg1[1]; @@ -4385,23 +4517,23 @@ void func_800378E8(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if ((player->effects & 0x10) == 0x10) { - var_f2 = player->unk_208 + (-(player->unk_094 / 18.0f) * 216.0f * 5.0f) + (-player->unk_20C * 10.0f); + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { + var_f2 = player->unk_208 + (-(player->speed / 18.0f) * 216.0f * 5.0f) + (-player->unk_20C * 10.0f); var_f12 = -100.0f; } else { - var_f2 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 40.0f) + (-player->unk_20C * 50.0f); + var_f2 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 40.0f) + (-player->unk_20C * 50.0f); var_f12 = player->unk_084; } - arg1[0] = (player->unk_090 + var_f2) * player->unk_094; + arg1[0] = (player->unk_090 + var_f2) * player->speed; arg1[1] = 0.0f; - arg1[2] = player->unk_094 * var_f12; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + arg1[2] = player->speed * var_f12; + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } arg2[0] = arg1[0]; arg2[1] = arg1[1]; @@ -4412,23 +4544,23 @@ void func_80037A4C(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if ((player->effects & 0x10) == 0x10) { - var_f2 = player->unk_208 + (-(player->unk_094 / 18.0f) * 216.0f * 5.0f) + (-player->unk_20C * 50.0f); + if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { + var_f2 = player->unk_208 + (-(player->speed / 18.0f) * 216.0f * 5.0f) + (-player->unk_20C * 50.0f); var_f12 = -100.0f; } else { - var_f2 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 40.0f) + (-player->unk_20C * 50.0f); + var_f2 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) / 40.0f) + (-player->unk_20C * 50.0f); var_f12 = player->unk_084; } - arg1[0] = -(player->unk_090 + var_f2) * player->unk_094; + arg1[0] = -(player->unk_090 + var_f2) * player->speed; arg1[1] = 0.0f; - arg1[2] = player->unk_094 * var_f12; - mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix); + arg1[2] = player->speed * var_f12; + mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } arg2[0] = arg1[0]; arg2[1] = arg1[1]; @@ -4445,10 +4577,10 @@ void func_80037BB4(Player* player, Vec3f arg1) { arg1[2] = 0.0f; } else { if (player->unk_078 < 0) { - if (((player->effects & 0x20000000) != 0x20000000) || (player->unk_228 >= 0x64)) { + if (((player->effects & DRIFT_OUTSIDE_EFFECT) != DRIFT_OUTSIDE_EFFECT) || (player->unk_228 >= 0x64)) { player->rotation[1] += player->unk_078; } - if (!(player->type & PLAYER_KART_AI)) { + if (!(player->type & PLAYER_CPU)) { if (gModeSelection == BATTLE) { func_800378E8(player, sp20, arg1); } else { @@ -4458,10 +4590,10 @@ void func_80037BB4(Player* player, Vec3f arg1) { func_80037614(player, sp20, arg1); } } else { - if (((player->effects & 0x20000000) != 0x20000000) || (player->unk_228 >= 0x64)) { + if (((player->effects & DRIFT_OUTSIDE_EFFECT) != DRIFT_OUTSIDE_EFFECT) || (player->unk_228 >= 0x64)) { player->rotation[1] += player->unk_078; } - if (!(player->type & PLAYER_KART_AI)) { + if (!(player->type & PLAYER_CPU)) { if (gModeSelection == BATTLE) { func_80037A4C(player, sp20, arg1); } else { @@ -4474,52 +4606,55 @@ void func_80037BB4(Player* player, Vec3f arg1) { } } -void func_80037CFC(Player* player, struct Controller* controller, s8 arg2) { - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) && - ((player->effects & 0x400) != 0x400) && ((player->effects & 0x4000) != 0x4000) && - ((player->effects & 0x01000000) != 0x01000000) && - ((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT) && ((player->effects & 0x10000) != 0x10000) && - ((player->effects & 0x20000) != 0x20000)) { - if (((player->effects & HIT_EFFECT) != HIT_EFFECT) && ((player->effects & 8) != 8) && - ((player->effects & 2) != 2) && ((player->effects & 0x10) != 0x10) && - (controller->buttonPressed & R_TRIG)) { +void func_80037CFC(Player* player, struct Controller* controller, s8 playerIndex) { + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && + ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) && + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) && + ((player->effects & EARLY_START_SPINOUT_EFFECT) != EARLY_START_SPINOUT_EFFECT) && + ((player->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT) && + ((player->effects & HIT_BY_STAR_EFFECT) != HIT_BY_STAR_EFFECT) && + ((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT) && + ((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT)) { + if (((player->effects & SQUISH_EFFECT) != SQUISH_EFFECT) && + ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) && ((player->effects & HOP_EFFECT) != HOP_EFFECT) && + ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && (controller->buttonPressed & R_TRIG)) { kart_hop(player); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C9060(arg2, 0x19008000); + func_800C9060(playerIndex, 0x19008000); } } - if ((player->effects & 8) != 8) { - func_80033AE0(player, controller, arg2); - } else if (((player->effects & 2) == 2) && (player->collision.surfaceDistance[2] <= 5.0f)) { - func_80033AE0(player, controller, arg2); + if ((player->effects & MIDAIR_EFFECT) != MIDAIR_EFFECT) { + func_80033AE0(player, controller, playerIndex); + } else if (((player->effects & HOP_EFFECT) == HOP_EFFECT) && (player->collision.surfaceDistance[2] <= 5.0f)) { + func_80033AE0(player, controller, playerIndex); } - player->effects &= ~1; + player->effects &= ~BRAKING_EFFECT; if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & BOOST_RAMP_WOOD_EFFECT))) { - if (((player->unk_094 / 18.0f) * 216.0f) <= 12.0f) { + if (((player->speed / 18.0f) * 216.0f) <= 12.0f) { if (controller->button & A_BUTTON) { if (controller->button & B_BUTTON) { - player->effects |= 0x20; - if ((player->effects & 0x20) != 0x20) { + player->effects |= AB_SPIN_EFFECT; + if ((player->effects & AB_SPIN_EFFECT) != AB_SPIN_EFFECT) { player->currentSpeed += 100.0f; } } } } - if (((player->effects & 0x20) == 0x20) && + if (((player->effects & AB_SPIN_EFFECT) == AB_SPIN_EFFECT) && (((controller->button & B_BUTTON) == 0) || (!(controller->button & A_BUTTON)))) { - player->effects &= ~0x20; + player->effects &= ~AB_SPIN_EFFECT; } } - if ((player->unk_044 & 1) != 1) { + if ((player->kartProps & BACK_UP) != BACK_UP) { if (controller->button & A_BUTTON) { - player_speed(player); + player_accelerate_alternative(player); detect_triple_a_combo_a_pressed(player); } else { if (gModeSelection == BATTLE) { - decelerate_ai_player(player, 2.0f); + player_decelerate_alternative(player, 2.0f); } else { - decelerate_ai_player(player, 1.0f); + player_decelerate_alternative(player, 1.0f); } detect_triple_a_combo_a_released(player); } @@ -4531,73 +4666,78 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 arg2) { detect_triple_b_combo_b_released(player); } } - if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & 4))) { - if (((func_800388B0(controller) < (-0x31)) && (((player->unk_094 / 18.0f) * 216.0f) <= 5.0f)) && + if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & BOOST_RAMP_WOOD_EFFECT))) { + if (((get_clamped_stickY_with_deadzone(controller) < (-0x31)) && + (((player->speed / 18.0f) * 216.0f) <= 5.0f)) && (controller->button & B_BUTTON)) { player->currentSpeed = 140.0f; - player->unk_044 |= 1; + player->kartProps |= BACK_UP; player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f; player->unk_20C = 0.0f; } - if ((func_800388B0(controller) >= -0x1D) || (!(controller->button & B_BUTTON))) { - if ((player->unk_044 & 1) == 1) { - player->unk_044 &= 0xFFFE; + if ((get_clamped_stickY_with_deadzone(controller) >= -0x1D) || (!(controller->button & B_BUTTON))) { + if ((player->kartProps & BACK_UP) == BACK_UP) { + player->kartProps &= ~(BACK_UP); player->currentSpeed = 0.0f; } } } } else { - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) { if (controller->button & A_BUTTON) { - player_speed(player); + player_accelerate_alternative(player); } else { - decelerate_ai_player(player, 5.0f); + player_decelerate_alternative(player, 5.0f); } } - if (((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || - ((player->effects & 0x01000000) == 0x01000000)) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT)) { + if (((((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || + ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) || + ((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT)) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT)) { if (controller->button & A_BUTTON) { detect_triple_a_combo_a_pressed(player); - func_800332E8(player, arg2); + player_accelerate_global(player, playerIndex); return; } detect_triple_a_combo_a_released(player); - func_800337CC(player, 5.0f, arg2); + player_decelerate_global(player, 5.0f, playerIndex); } } } -void func_800381AC(Player* player, struct Controller* controller, s8 arg2) { +void handle_a_press_for_player_during_race(Player* player, struct Controller* controller, s8 playerIndex) { if (((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && - ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { + ((player->type & PLAYER_CPU) != PLAYER_CPU)) { + // If not start sequence if ((player->type & PLAYER_START_SEQUENCE) != PLAYER_START_SEQUENCE) { - if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) { + if (((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->lakituProps & LAKITU_SCENE) == LAKITU_SCENE)) { if (controller->button & A_BUTTON) { - func_80032D94(player); + player_accelerate(player); } else { - func_80033280(player, 5.0f); + player_decelerate(player, 5.0f); } } else { - func_80037CFC(player, controller, arg2); + func_80037CFC(player, controller, playerIndex); } D_80164A89 = 1; + // If start sequence and unknown condition } else if (D_8018D168 == 1) { if (D_801656F0 == 1) { - if (D_801652E0[arg2] == 0) { - D_801652E0[arg2] = gRaceFrameCounter; + if (D_801652E0[playerIndex] == 0) { + D_801652E0[playerIndex] = gRaceFrameCounter; } } if (controller->button & A_BUTTON) { - func_80032700(player); + player_accelerate_during_start_sequence(player); } else { - func_80032CB0(player, 5.0f); + player_decelerate_during_start_sequence(player, 5.0f); } } } } -void func_800382DC(void) { +void handle_a_press_for_all_players_during_race(void) { u16 temp_v0_3; u16 temp_v0_4; u16 temp_v0_5; @@ -4607,31 +4747,35 @@ void func_800382DC(void) { case SCREEN_MODE_1P: switch (gModeSelection) { case GRAND_PRIX: - func_800381AC(gPlayerOne, gControllerOne, 0); + handle_a_press_for_player_during_race(gPlayerOne, gControllerOne, 0); return; case TIME_TRIALS: if (D_8015F890 != 1) { - func_800381AC(gPlayerOne, gControllerOne, 0); + handle_a_press_for_player_during_race(gPlayerOne, gControllerOne, 0); temp_v0_3 = gPlayerTwo->type; - if (((temp_v0_3 & 0x100) == 0x100) && ((temp_v0_3 & 0x800) != 0x800)) { - func_800381AC(gPlayerTwo, gControllerSix, 1); + if (((temp_v0_3 & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) && + ((temp_v0_3 & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE)) { + handle_a_press_for_player_during_race(gPlayerTwo, gControllerSix, 1); } temp_v0_4 = gPlayerThree->type; - if (((temp_v0_4 & 0x100) == 0x100) && ((temp_v0_4 & 0x800) != 0x800)) { - func_800381AC(gPlayerThree, gControllerSeven, 2); + if (((temp_v0_4 & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) && + ((temp_v0_4 & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE)) { + handle_a_press_for_player_during_race(gPlayerThree, gControllerSeven, 2); return; } } else { - if ((gPlayerOne->type & 0x800) != 0x800) { - func_800381AC(gPlayerOne, gControllerEight, 0); + if ((gPlayerOne->type & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE) { + handle_a_press_for_player_during_race(gPlayerOne, gControllerEight, 0); } temp_v0_5 = gPlayerTwo->type; - if (((temp_v0_5 & 0x100) == 0x100) && ((temp_v0_5 & 0x800) != 0x800)) { - func_800381AC(gPlayerTwo, gControllerSix, 1); + if (((temp_v0_5 & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) && + ((temp_v0_5 & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE)) { + handle_a_press_for_player_during_race(gPlayerTwo, gControllerSix, 1); } temp_v0_6 = gPlayerThree->type; - if (((temp_v0_6 & 0x100) == 0x100) && ((temp_v0_6 & 0x800) != 0x800)) { - func_800381AC(gPlayerThree, gControllerSeven, 2); + if (((temp_v0_6 & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) && + ((temp_v0_6 & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE)) { + handle_a_press_for_player_during_race(gPlayerThree, gControllerSeven, 2); return; } return; @@ -4642,125 +4786,125 @@ void func_800382DC(void) { break; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - func_800381AC(gPlayerOne, gControllerOne, 0); - func_800381AC(gPlayerTwo, gControllerTwo, 1); + handle_a_press_for_player_during_race(gPlayerOne, gControllerOne, 0); + handle_a_press_for_player_during_race(gPlayerTwo, gControllerTwo, 1); return; case SCREEN_MODE_3P_4P_SPLITSCREEN: - func_800381AC(gPlayerOne, gControllerOne, 0); - func_800381AC(gPlayerTwo, gControllerTwo, 1); - func_800381AC(gPlayerThree, gControllerThree, 2); + handle_a_press_for_player_during_race(gPlayerOne, gControllerOne, 0); + handle_a_press_for_player_during_race(gPlayerTwo, gControllerTwo, 1); + handle_a_press_for_player_during_race(gPlayerThree, gControllerThree, 2); if (gPlayerCountSelection1 == 4) { - func_800381AC(gPlayerFour, gControllerFour, 3); + handle_a_press_for_player_during_race(gPlayerFour, gControllerFour, 3); } break; } } -s16 func_80038534(struct Controller* controller) { - s16 temp_a2; - s16 var_a3; - s16 var_t0; - s16 temp_v0; +s16 get_clamped_stickX_with_deadzone(struct Controller* controller) { + s16 temp_stickY; + s16 temp_stickX2; + s16 temp_stickY2; + s16 temp_stickX; - temp_v0 = controller->rawStickX; - temp_a2 = controller->rawStickY; - var_a3 = temp_v0; - var_t0 = temp_a2; + temp_stickX = controller->rawStickX; + temp_stickY = controller->rawStickY; + temp_stickX2 = temp_stickX; + temp_stickY2 = temp_stickY; - if (temp_v0 > 0xC) { - var_t0 = (temp_a2 * 0x000C) / temp_v0; - var_a3 = 0x000C; + if (temp_stickX > 0xC) { + temp_stickY2 = (temp_stickY * 0x000C) / temp_stickX; + temp_stickX2 = 0x000C; } - if (var_a3 < -0xC) { - var_t0 = (var_t0 * 0x000C) / -var_a3; - var_a3 = -0x000C; + if (temp_stickX2 < -0xC) { + temp_stickY2 = (temp_stickY2 * 0x000C) / -temp_stickX2; + temp_stickX2 = -0x000C; } - if (var_t0 > 0xC) { - var_a3 = (var_a3 * 0x000C) / var_t0; - var_t0 = 0x000C; + if (temp_stickY2 > 0xC) { + temp_stickX2 = (temp_stickX2 * 0x000C) / temp_stickY2; + temp_stickY2 = 0x000C; } - if (var_t0 < -0xC) { - var_a3 = (var_a3 * 0x000C) / -var_t0; - var_t0 = -0x000C; + if (temp_stickY2 < -0xC) { + temp_stickX2 = (temp_stickX2 * 0x000C) / -temp_stickY2; + temp_stickY2 = -0x000C; } if ((((controller->rawStickX > -0xD) && (controller->rawStickX < 0xD)) && (controller->rawStickY > -0xD)) && (controller->rawStickY < 0xD)) { - temp_v0 = 0; - temp_a2 = 0; + temp_stickX = 0; + temp_stickY = 0; } else { - temp_v0 -= var_a3; - temp_a2 -= var_t0; + temp_stickX -= temp_stickX2; + temp_stickY -= temp_stickY2; } - if (temp_v0 > 0x35) { - temp_a2 = (temp_a2 * 0x0035) / temp_v0; - temp_v0 = 0x0035; + if (temp_stickX > 0x35) { + temp_stickY = (temp_stickY * 0x0035) / temp_stickX; + temp_stickX = 0x0035; } - if (temp_v0 < -0x35) { - temp_a2 = (temp_a2 * 0x0035) / -temp_v0; - temp_v0 = -0x0035; + if (temp_stickX < -0x35) { + temp_stickY = (temp_stickY * 0x0035) / -temp_stickX; + temp_stickX = -0x0035; } - if (temp_a2 > 0x35) { - temp_v0 = (temp_v0 * 0x0035) / temp_a2; - temp_a2 = 0x0035; + if (temp_stickY > 0x35) { + temp_stickX = (temp_stickX * 0x0035) / temp_stickY; + temp_stickY = 0x0035; } - if (temp_a2 < -0x35) { - temp_v0 = (temp_v0 * 0x0035) / -temp_a2; + if (temp_stickY < -0x35) { + temp_stickX = (temp_stickX * 0x0035) / -temp_stickY; } - return temp_v0; + return temp_stickX; } -s16 func_800388B0(struct Controller* controller) { - s16 temp_a2; - s16 var_a3; - s16 var_t0; - s16 temp_v0; +s16 get_clamped_stickY_with_deadzone(struct Controller* controller) { + s16 temp_StickY; + s16 temp_StickX2; + s16 temp_StickY2; + s16 temp_StickX; - temp_v0 = controller->rawStickX; - temp_a2 = controller->rawStickY; - var_a3 = temp_v0; - var_t0 = temp_a2; + temp_StickX = controller->rawStickX; + temp_StickY = controller->rawStickY; + temp_StickX2 = temp_StickX; + temp_StickY2 = temp_StickY; - if (temp_v0 > 0xC) { - var_t0 = (temp_a2 * 0x000C) / temp_v0; - var_a3 = 0x000C; + if (temp_StickX > 0xC) { + temp_StickY2 = (temp_StickY * 0x000C) / temp_StickX; + temp_StickX2 = 0x000C; } - if (var_a3 < -0xC) { - var_t0 = (var_t0 * 0x000C) / -var_a3; - var_a3 = -0x000C; + if (temp_StickX2 < -0xC) { + temp_StickY2 = (temp_StickY2 * 0x000C) / -temp_StickX2; + temp_StickX2 = -0x000C; } - if (var_t0 > 0xC) { - var_a3 = (var_a3 * 0x000C) / var_t0; - var_t0 = 0x000C; + if (temp_StickY2 > 0xC) { + temp_StickX2 = (temp_StickX2 * 0x000C) / temp_StickY2; + temp_StickY2 = 0x000C; } - if (var_t0 < -0xC) { - var_a3 = (var_a3 * 0x000C) / -var_t0; - var_t0 = -0x000C; + if (temp_StickY2 < -0xC) { + temp_StickX2 = (temp_StickX2 * 0x000C) / -temp_StickY2; + temp_StickY2 = -0x000C; } if ((((controller->rawStickX > -0xD) && (controller->rawStickX < 0xD)) && (controller->rawStickY > -0xD)) && (controller->rawStickY < 0xD)) { - temp_v0 = 0; - temp_a2 = 0; + temp_StickX = 0; + temp_StickY = 0; } else { - temp_v0 -= var_a3; - temp_a2 -= var_t0; + temp_StickX -= temp_StickX2; + temp_StickY -= temp_StickY2; } - if (temp_v0 > 0x35) { - temp_a2 = (temp_a2 * 0x0035) / temp_v0; - temp_v0 = 0x0035; + if (temp_StickX > 0x35) { + temp_StickY = (temp_StickY * 0x0035) / temp_StickX; + temp_StickX = 0x0035; } - if (temp_v0 < -0x35) { - temp_a2 = (temp_a2 * 0x0035) / -temp_v0; - temp_v0 = -0x0035; + if (temp_StickX < -0x35) { + temp_StickY = (temp_StickY * 0x0035) / -temp_StickX; + temp_StickX = -0x0035; } - if (temp_a2 > 0x35) { - temp_v0 = (temp_v0 * 0x0035) / temp_a2; - temp_a2 = 0x0035; + if (temp_StickY > 0x35) { + temp_StickX = (temp_StickX * 0x0035) / temp_StickY; + temp_StickY = 0x0035; } - if (temp_a2 < -0x35) { - temp_v0 = (temp_v0 * 0x0035) / -temp_a2; - temp_a2 = -0x0035; + if (temp_StickY < -0x35) { + temp_StickX = (temp_StickX * 0x0035) / -temp_StickY; + temp_StickY = -0x0035; } - return temp_a2; + return temp_StickY; } void func_80038BE4(Player* player, s16 arg1) { @@ -4771,18 +4915,18 @@ void func_80038BE4(Player* player, s16 arg1) { if (player->currentSpeed >= 250.0f) { player->currentSpeed = 250.0f; } - player->unk_044 |= 0x20; + player->kartProps |= THROTTLE; player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f; } -void func_80038C6C(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId) { +void func_80038C6C(Player* player, UNUSED Camera* camera, s8 screenId, s8 playerId) { Vec3f sp114 = { 0.0, 0.0, 1.0 }; Vec3f sp108 = { 0.0, 0.0, 0.0 }; Vec3f spFC = { 0.0, 0.0, 0.0 }; Vec3f spF0 = { 0.0, 0.0, 0.0 }; - f32 spEC; - f32 spE8; - f32 spE4; + f32 nextX; + f32 nextY; + f32 nextZ; f32 posX; f32 posY; f32 posZ; @@ -4793,17 +4937,17 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId) f32 spA4; f32 spA0; f32 sp9C; - f32 sp98; + f32 surfaceDistance; UNUSED s32 pad3; - Vec3f sp88; + Vec3f newVelocity; Vec3f sp7C; UNUSED s32 pad[10]; player->unk_084 = -10.0f; player->unk_088 = 28.0f; player->topSpeed = 250.0f; - func_8002B830(player, playerId, arg2); - apply_effect(player, playerId, arg2); + func_8002B830(player, playerId, screenId); + apply_effect(player, playerId, screenId); player->rotation[1] += player->unk_078; spF0[0] = 0; spF0[1] = 0; @@ -4815,21 +4959,24 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId) sp108[2] = 0; sp108[1] = 0; sp108[0] = 0; - mtxf_translate_vec3f_mat3(sp108, player->orientationMatrix); + mtxf_transform_vec3f_mat3(sp108, player->orientationMatrix); spA4 += sp108[0]; sp9C += sp108[2]; sp114[2] = player->unk_08C; - mtxf_translate_vec3f_mat3(sp114, player->orientationMatrix); + mtxf_transform_vec3f_mat3(sp114, player->orientationMatrix); - sp88[0] = player->velocity[0]; - sp88[1] = player->velocity[1]; - sp88[2] = player->velocity[2]; + newVelocity[0] = player->velocity[0]; + newVelocity[1] = player->velocity[1]; + newVelocity[2] = player->velocity[2]; - sp88[0] += ((((((sp114[0] + spA4) + spF0[0])) - (sp88[0] * (0.12 * (player->kartFriction)))) / 6000.0) / 1); - sp88[2] += ((((((sp114[2] + sp9C) + spF0[2])) - (sp88[2] * (0.12 * (player->kartFriction)))) / 6000.0) / 1); - sp88[1] += ((((((sp114[1] + spA0) + spF0[1])) - (sp88[1] * (0.12 * (player->kartFriction)))) / 6000.0) / 1); - if ((player->unk_044 & 0x10) == 0x10) { - player->unk_044 &= 0xFFEF; + newVelocity[0] += + ((((((sp114[0] + spA4) + spF0[0])) - (newVelocity[0] * (0.12 * (player->kartFriction)))) / 6000.0) / 1); + newVelocity[2] += + ((((((sp114[2] + sp9C) + spF0[2])) - (newVelocity[2] * (0.12 * (player->kartFriction)))) / 6000.0) / 1); + newVelocity[1] += + ((((((sp114[1] + spA0) + spF0[1])) - (newVelocity[1] * (0.12 * (player->kartFriction)))) / 6000.0) / 1); + if ((player->kartProps & LOSE_GP_RACE) == LOSE_GP_RACE) { + player->kartProps &= ~LOSE_GP_RACE; } posX = player->pos[0]; @@ -4840,85 +4987,85 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId) player->oldPos[1] = player->pos[1]; player->oldPos[2] = player->pos[2]; - spEC = posX + player->velocity[0]; - spE8 = posY + player->velocity[1]; - spE4 = posZ + player->velocity[2]; + nextX = posX + player->velocity[0]; + nextY = posY + player->velocity[1]; + nextZ = posZ + player->velocity[2]; func_8002AAC0(player); - spE8 += player->kartHopVelocity; - spE8 -= 0.02; - actor_terrain_collision(&player->collision, player->boundingBoxSize, spEC, spE8, spE4, player->oldPos[0], + nextY += player->kartHopVelocity; + nextY -= 0.02; + actor_terrain_collision(&player->collision, player->boundingBoxSize, nextX, nextY, nextZ, player->oldPos[0], player->oldPos[1], player->oldPos[2]); player->unk_058 = 0; player->unk_060 = 0; player->unk_05C = 1.0f; calculate_orientation_matrix(player->orientationMatrix, 0, 1.0f, 0, player->rotation[1]); - player->effects |= 8; + player->effects |= MIDAIR_EFFECT; player->unk_0C2 += 1; - sp98 = player->collision.surfaceDistance[2]; - if (sp98 <= 0) { + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0) { player->unk_0C2 = 0; - player->effects &= ~2; - player->effects &= ~8; + player->effects &= ~HOP_EFFECT; + player->effects &= ~MIDAIR_EFFECT; player->kartHopVelocity = player->unk_0C2; } - sp98 = player->collision.surfaceDistance[2]; - if (sp98 <= 0) { - func_8003F46C(player, sp7C, sp88, sp108, &sp98, &spEC, &spE8, &spE4); + surfaceDistance = player->collision.surfaceDistance[2]; + if (surfaceDistance <= 0) { + func_8003F46C(player, sp7C, newVelocity, sp108, &surfaceDistance, &nextX, &nextY, &nextZ); } - sp98 = player->collision.surfaceDistance[0]; - if (sp98 < 0) { - func_8003F734(player, sp7C, sp88, &sp98, &spEC, &spE8, &spE4); - func_8002C954(player, playerId, sp88); + surfaceDistance = player->collision.surfaceDistance[0]; + if (surfaceDistance < 0) { + func_8003F734(player, sp7C, newVelocity, &surfaceDistance, &nextX, &nextY, &nextZ); + func_8002C954(player, playerId, newVelocity); } - sp98 = player->collision.surfaceDistance[1]; - if (sp98 < 0) { - func_8003FBAC(player, sp7C, sp88, &sp98, &spEC, &spE8, &spE4); - func_8002C954(player, playerId, sp88); + surfaceDistance = player->collision.surfaceDistance[1]; + if (surfaceDistance < 0) { + func_8003FBAC(player, sp7C, newVelocity, &surfaceDistance, &nextX, &nextY, &nextZ); + func_8002C954(player, playerId, newVelocity); } - sp98 = player->collision.surfaceDistance[0]; - if (sp98 >= 0) { - sp98 = player->collision.surfaceDistance[1]; - if (sp98 >= 0) { + surfaceDistance = player->collision.surfaceDistance[0]; + if (surfaceDistance >= 0) { + surfaceDistance = player->collision.surfaceDistance[1]; + if (surfaceDistance >= 0) { player->unk_046 &= 0xFFDF; } } - player->unk_074 = calculate_surface_height(spEC, spE8, spE4, player->collision.meshIndexZX); - func_80029B4C(player, spEC, spE8, spE4); - func_8002AE38(player, playerId, posX, posZ, spEC, spE4); - sqrt = (sp88[0] * sp88[0]) + (sp88[2] * sp88[2]); - player->unk_22C = player->unk_094; - player->unk_094 = sqrtf(sqrt); + player->unk_074 = calculate_surface_height(nextX, nextY, nextZ, player->collision.meshIndexZX); + func_80029B4C(player, nextX, nextY, nextZ); + func_8002AE38(player, playerId, posX, posZ, nextX, nextZ); + sqrt = (newVelocity[0] * newVelocity[0]) + (newVelocity[2] * newVelocity[2]); + player->previousSpeed = player->speed; + player->speed = sqrtf(sqrt); - player->pos[0] = spEC; - player->pos[2] = spE4; - player->pos[1] = spE8; + player->pos[0] = nextX; + player->pos[2] = nextZ; + player->pos[1] = nextY; player->unk_064[0] = sp108[0]; player->unk_064[2] = sp108[2]; - player->velocity[0] = sp88[0]; - player->velocity[1] = sp88[1]; - player->velocity[2] = sp88[2]; + player->velocity[0] = newVelocity[0]; + player->velocity[1] = newVelocity[1]; + player->velocity[2] = newVelocity[2]; - D_80165070[playerId][0] = sp88[0]; - D_80165070[playerId][1] = sp88[1]; - D_80165070[playerId][2] = sp88[2]; + gPlayerLastVelocity[playerId][0] = newVelocity[0]; + gPlayerLastVelocity[playerId][1] = newVelocity[1]; + gPlayerLastVelocity[playerId][2] = newVelocity[2]; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - if (gKartTopSpeedTable[player->characterId] < player->unk_094) { - divOptimize = gKartTopSpeedTable[player->characterId] / player->unk_094; + if (gKartTopSpeedTable[player->characterId] < player->speed) { + divOptimize = gKartTopSpeedTable[player->characterId] / player->speed; player->velocity[0] *= divOptimize; player->velocity[1] *= divOptimize; player->velocity[2] *= divOptimize; - player->unk_094 = gKartTopSpeedTable[player->characterId]; + player->speed = gKartTopSpeedTable[player->characterId]; } } - if ((player->unk_044 & 1) == 1) { - if (player->unk_094 > 1.0f) { - player->velocity[0] *= 1.0f / player->unk_094; - player->velocity[1] *= 1.0f / player->unk_094; - player->velocity[2] *= 1.0f / player->unk_094; - player->unk_094 = 1.0f; + if ((player->kartProps & BACK_UP) == BACK_UP) { + if (player->speed > 1.0f) { + player->velocity[0] *= 1.0f / player->speed; + player->velocity[1] *= 1.0f / player->speed; + player->velocity[2] *= 1.0f / player->speed; + player->speed = 1.0f; } } if (player->collision.surfaceDistance[2] >= 500.0f) { diff --git a/src/player_controller.h b/src/player_controller.h index d5436d696d..e9bf10979f 100644 --- a/src/player_controller.h +++ b/src/player_controller.h @@ -45,7 +45,7 @@ void func_8002AE30(void); void func_8002AE38(Player*, s8, f32, f32, f32, f32); void func_8002B218(Player*); -void apply_sound_effect(Player*, s8, s8); +void apply_triggers(Player*, s8, s8); void func_8002B5C0(Player*, s8, s8); void func_8002B830(Player*, s8, s8); void func_8002B8A4(Player*, Player*); @@ -53,7 +53,7 @@ void func_8002B9CC(Player*, s8, s32); void func_8002BD58(Player*); void func_8002BF4C(Player*, s8); -void func_8002C11C(Player*); +void update_player_drift_duration(Player*); void func_8002C17C(Player*, s8); void func_8002C4F8(Player*, s8); void func_8002C7E4(Player*, s8, s8); @@ -64,7 +64,7 @@ void func_8002D028(Player*, s8); void func_8002D268(Player*, Camera*, s8, s8); void func_8002E4C4(Player*); -void control_kart_ai_movement(Player*, Camera*, s8, s8); +void control_cpu_movement(Player*, Camera*, s8, s8); void func_8002FCA8(Player*, s8); void func_8002FE84(Player*, f32); @@ -73,17 +73,17 @@ f32 func_80030150(Player*, s8); void func_80030A34(Player*); void detect_triple_a_combo_a_released(Player*); void detect_triple_a_combo_a_pressed(Player*); -void player_speed(Player*); -void decelerate_ai_player(Player*, f32); +void player_accelerate_alternative(Player*); +void player_decelerate_alternative(Player*, f32); void detect_triple_b_combo_b_released(Player*); void detect_triple_b_combo_b_pressed(Player*); void func_800323E4(Player*); -void func_80032700(Player*); -void func_80032CB0(Player*, f32); -void func_80032D94(Player*); -void func_80033280(Player*, f32); -void func_800332E8(Player*, s32); -void func_800337CC(Player*, f32, s32); +void player_accelerate_during_start_sequence(Player*); +void player_decelerate_during_start_sequence(Player*, f32); +void player_accelerate(Player*); +void player_decelerate(Player*, f32); +void player_accelerate_global(Player*, s32); +void player_decelerate_global(Player*, f32, s32); void func_80033850(Player*, f32); void func_80033884(Player*, s32*, s32*, s32, s32, s32, s32); void func_80033940(Player*, s32*, s32, s32, f32); @@ -91,7 +91,7 @@ void func_800339C4(Player*, s32*, s32, s32, f32); void func_80033A40(Player*, s32*, s32*, s32, s32, s32, f32); void func_80033AE0(Player*, struct Controller*, s8); -void func_8003680C(Player*, s16); +void apply_cpu_turn(Player*, s16); void func_80036C5C(Player*); void func_80036CB4(Player*); void func_80036DB4(Player*, Vec3f, Vec3f); @@ -104,90 +104,90 @@ void func_80037A4C(Player*, Vec3f, Vec3f); void func_80037BB4(Player* player, Vec3f); void func_80037CFC(Player*, struct Controller*, s8); -void func_800381AC(Player*, struct Controller*, s8); -void func_800382DC(void); -s16 func_80038534(struct Controller*); -s16 func_800388B0(struct Controller*); +void handle_a_press_for_player_during_race(Player*, struct Controller*, s8); +void handle_a_press_for_all_players_during_race(void); +s16 get_clamped_stickX_with_deadzone(struct Controller*); +s16 get_clamped_stickY_with_deadzone(struct Controller*); void func_80038BE4(Player*, s16); void func_80038C6C(Player*, Camera*, s8, s8); /* This is where I'd put my static data, if I had any */ -extern s16 gKartAIforMario[]; -extern s16 gKartAIforLuigi[]; -extern s16 gKartAIforYoshi[]; -extern s16 gKartAIforToad[]; -extern s16 gKartAIforDk[]; -extern s16 gKartAIforWario[]; -extern s16 gKartAIforPeach[]; -extern s16 gKartAIforBowser[]; -extern s16* gKartAIforPlayer[]; - -extern s16 gKartAIforMarioAndLuigi[]; -extern s16 gKartAIforMarioAndYoshi[]; -extern s16 gKartAIforMarioAndToad[]; -extern s16 gKartAIforMarioAndDk[]; -extern s16 gKartAIforMarioAndWario[]; -extern s16 gKartAIforMarioAndPeach[]; -extern s16 gKartAIforMarioAndBowser[]; -extern s16 gKartAIforLuigiAndMario[]; -extern s16 gKartAIforLuigiAndYoshi[]; -extern s16 gKartAIforLuigiAndToad[]; -extern s16 gKartAIforLuigiAndDk[]; -extern s16 gKartAIforLuigiAndWario[]; -extern s16 gKartAIforLuigiAndPeach[]; -extern s16 gKartAIforLuigiAndBowser[]; -extern s16 gKartAIforYoshiAndMario[]; -extern s16 gKartAIforYoshiAndLuigi[]; -extern s16 gKartAIforYoshiAndToad[]; -extern s16 gKartAIforYoshiAndDk[]; -extern s16 gKartAIforYoshiAndWario[]; -extern s16 gKartAIforYoshiAndPeach[]; -extern s16 gKartAIforYoshiAndBowser[]; -extern s16 gKartAIforToadAndMario[]; -extern s16 gKartAIforToadAndLuigi[]; -extern s16 gKartAIforToadAndYoshi[]; -extern s16 gKartAIforToadAndDk[]; -extern s16 gKartAIforToadAndWario[]; -extern s16 gKartAIforToadAndPeach[]; -extern s16 gKartAIforToadAndBowser[]; -extern s16 gKartAIforDkAndMario[]; -extern s16 gKartAIforDkAndLuigi[]; -extern s16 gKartAIforDkAndToad[]; -extern s16 gKartAIforDkAndYoshi[]; -extern s16 gKartAIforDkAndWario[]; -extern s16 gKartAIforDkAndPeach[]; -extern s16 gKartAIforDkAndBowser[]; -extern s16 gKartAIforWarioAndMario[]; -extern s16 gKartAIforWarioAndLuigi[]; -extern s16 gKartAIforWarioAndYoshi[]; -extern s16 gKartAIforWarioAndDk[]; -extern s16 gKartAIforWarioAndToad[]; -extern s16 gKartAIforWarioAndPeach[]; -extern s16 gKartAIforWarioAndBowser[]; -extern s16 gKartAIforPeachAndMario[]; -extern s16 gKartAIforPeachAndLuigi[]; -extern s16 gKartAIforPeachAndYoshi[]; -extern s16 gKartAIforPeachAndDk[]; -extern s16 gKartAIforPeachAndWario[]; -extern s16 gKartAIforPeachAndToad[]; -extern s16 gKartAIforPeachAndBowser[]; -extern s16 gKartAIforBowserAndMario[]; -extern s16 gKartAIforBowserAndLuigi[]; -extern s16 gKartAIforBowserAndYoshi[]; -extern s16 gKartAIforBowserAndDk[]; -extern s16 gKartAIforBowserAndWario[]; -extern s16 gKartAIforBowserAndToad[]; -extern s16 gKartAIforBowserAndPeach[]; -extern s16* gListKartAIforMario[]; -extern s16* gListKartAIforLuigi[]; -extern s16* gListKartAIforYoshi[]; -extern s16* gListKartAIforToad[]; -extern s16* gListKartAIforDk[]; -extern s16* gListKartAIforWario[]; -extern s16* gListKartAIforPeach[]; -extern s16* gListKartAIforBowser[]; -extern s16** gKartAIforTwoPlayer[]; +extern s16 cpu_forMario[]; +extern s16 cpu_forLuigi[]; +extern s16 cpu_forYoshi[]; +extern s16 cpu_forToad[]; +extern s16 cpu_forDk[]; +extern s16 cpu_forWario[]; +extern s16 cpu_forPeach[]; +extern s16 cpu_forBowser[]; +extern s16* cpu_forPlayer[]; + +extern s16 cpu_forMarioAndLuigi[]; +extern s16 cpu_forMarioAndYoshi[]; +extern s16 cpu_forMarioAndToad[]; +extern s16 cpu_forMarioAndDk[]; +extern s16 cpu_forMarioAndWario[]; +extern s16 cpu_forMarioAndPeach[]; +extern s16 cpu_forMarioAndBowser[]; +extern s16 cpu_forLuigiAndMario[]; +extern s16 cpu_forLuigiAndYoshi[]; +extern s16 cpu_forLuigiAndToad[]; +extern s16 cpu_forLuigiAndDk[]; +extern s16 cpu_forLuigiAndWario[]; +extern s16 cpu_forLuigiAndPeach[]; +extern s16 cpu_forLuigiAndBowser[]; +extern s16 cpu_forYoshiAndMario[]; +extern s16 cpu_forYoshiAndLuigi[]; +extern s16 cpu_forYoshiAndToad[]; +extern s16 cpu_forYoshiAndDk[]; +extern s16 cpu_forYoshiAndWario[]; +extern s16 cpu_forYoshiAndPeach[]; +extern s16 cpu_forYoshiAndBowser[]; +extern s16 cpu_forToadAndMario[]; +extern s16 cpu_forToadAndLuigi[]; +extern s16 cpu_forToadAndYoshi[]; +extern s16 cpu_forToadAndDk[]; +extern s16 cpu_forToadAndWario[]; +extern s16 cpu_forToadAndPeach[]; +extern s16 cpu_forToadAndBowser[]; +extern s16 cpu_forDkAndMario[]; +extern s16 cpu_forDkAndLuigi[]; +extern s16 cpu_forDkAndToad[]; +extern s16 cpu_forDkAndYoshi[]; +extern s16 cpu_forDkAndWario[]; +extern s16 cpu_forDkAndPeach[]; +extern s16 cpu_forDkAndBowser[]; +extern s16 cpu_forWarioAndMario[]; +extern s16 cpu_forWarioAndLuigi[]; +extern s16 cpu_forWarioAndYoshi[]; +extern s16 cpu_forWarioAndDk[]; +extern s16 cpu_forWarioAndToad[]; +extern s16 cpu_forWarioAndPeach[]; +extern s16 cpu_forWarioAndBowser[]; +extern s16 cpu_forPeachAndMario[]; +extern s16 cpu_forPeachAndLuigi[]; +extern s16 cpu_forPeachAndYoshi[]; +extern s16 cpu_forPeachAndDk[]; +extern s16 cpu_forPeachAndWario[]; +extern s16 cpu_forPeachAndToad[]; +extern s16 cpu_forPeachAndBowser[]; +extern s16 cpu_forBowserAndMario[]; +extern s16 cpu_forBowserAndLuigi[]; +extern s16 cpu_forBowserAndYoshi[]; +extern s16 cpu_forBowserAndDk[]; +extern s16 cpu_forBowserAndWario[]; +extern s16 cpu_forBowserAndToad[]; +extern s16 cpu_forBowserAndPeach[]; +extern s16* gListCPUforMario[]; +extern s16* gListCPUforLuigi[]; +extern s16* gListCPUforYoshi[]; +extern s16* gListCPUforToad[]; +extern s16* gListCPUforDk[]; +extern s16* gListCPUforWario[]; +extern s16* gListCPUforPeach[]; +extern s16* gListCPUforBowser[]; +extern s16** cpu_forTwoPlayer[]; extern s16 D_801656F0; diff --git a/src/racing/actors.c b/src/racing/actors.c index 1e7ee087ad..4bf45c7974 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -14,9 +14,9 @@ #include "memory.h" #include "actors_extended.h" #include "actors.h" -#include "waypoints.h" +#include "path.h" #include "macros.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "update_objects.h" #include "effects.h" #include "collision.h" @@ -424,7 +424,7 @@ void func_8029794C(Vec3f pos, Vec3s rot, f32 scale) { Mat4 sp20; pos[1] += 2.0f; - mtxf_pos_rotation_xyz(sp20, pos, rot); + mtxf_rotate_zxy_translate(sp20, pos, rot); mtxf_scale(sp20, scale); if (render_set_position(sp20, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_0D007B20); @@ -489,8 +489,8 @@ void render_cows(Camera* camera, Mat4 arg1, UNUSED struct Actor* actor) { sp88[0] = var_s1->pos[0] * gCourseDirection; sp88[1] = var_s1->pos[1]; sp88[2] = var_s1->pos[2]; - temp_f0 = is_within_render_distance(camera->pos, sp88, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], - 4000000.0f); + temp_f0 = + distance_if_visible(camera->pos, sp88, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], 4000000.0f); if (temp_f0 > 0.0f) { if (temp_f0 < D_8015F704) { D_8015F704 = temp_f0; @@ -631,7 +631,7 @@ void render_palm_trees(Camera* camera, Mat4 arg1, UNUSED struct Actor* actor) { spD4[1] = var_s1->pos[1]; spD4[2] = var_s1->pos[2]; - if (is_within_render_distance(camera->pos, spD4, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], var_f22) < + if (distance_if_visible(camera->pos, spD4, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], var_f22) < 0.0f) { var_s1++; continue; @@ -640,7 +640,7 @@ void render_palm_trees(Camera* camera, Mat4 arg1, UNUSED struct Actor* actor) { test &= 0xF; test = (s16) test; if (test == 6) { - mtxf_pos_rotation_xyz(sp90, spD4, sp88); + mtxf_rotate_zxy_translate(sp90, spD4, sp88); if (!(gMatrixObjectCount < MTX_OBJECT_POOL_SIZE)) { break; } @@ -692,7 +692,7 @@ void render_actor_shell(Camera* camera, Mat4 matrix, struct ShellActor* shell) { uintptr_t phi_t3; f32 temp_f0 = - is_within_render_distance(camera->pos, shell->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f); + distance_if_visible(camera->pos, shell->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f); s32 maxObjectsReached; if (temp_f0 < 0.0f) { actor_not_rendered(camera, (struct Actor*) shell); @@ -755,8 +755,7 @@ UNUSED void func_8029ABD4(f32* pos, s16 state) { } void func_8029AC18(Camera* camera, Mat4 arg1, struct Actor* arg2) { - if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], - 4000000.0f) < 0) { + if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) { return; } @@ -981,7 +980,7 @@ void spawn_all_item_boxes(struct ActorSpawnData* spawnData) { startingRot[1] = random_u16(); startingRot[2] = random_u16(); temp_s1 = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_ITEM_BOX); - temp_f0 = spawn_actor_on_surface(startingPos[0], startingPos[1] + 10.0f, startingPos[2]); + temp_f0 = get_surface_height(startingPos[0], startingPos[1] + 10.0f, startingPos[2]); // Should be struct ItemBox but not enough space in the stack. // It's either the ItemBox or the SEGMENT/OFFSET variables. @@ -1013,10 +1012,10 @@ void init_kiwano_fruit(void) { for (i = 0; i < 4; i++) { phi_s1 = &gPlayers[i]; // temp_v0 = *phi_s1; - if ((phi_s1->type & 0x4000) == 0) { + if ((phi_s1->type & PLAYER_HUMAN) == 0) { continue; } - if ((phi_s1->type & 0x100) != 0) { + if ((phi_s1->type & PLAYER_INVISIBLE_OR_BOMB) != 0) { continue; } @@ -1053,6 +1052,7 @@ void spawn_course_actors(void) { struct RailroadCrossing* rrxing; gNumPermanentActors = 0; +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: spawn_foliage(d_course_mario_raceway_tree_spawns); @@ -1172,6 +1172,9 @@ void spawn_course_actors(void) { spawn_all_item_boxes(d_course_big_donut_item_box_spawns); break; } +#else + +#endif gNumPermanentActors = gNumActors; } @@ -1182,22 +1185,22 @@ void spawn_course_actors(void) { */ void init_actors_and_load_textures(void) { set_segment_base_addr(3, (void*) gNextFreeMemoryAddress); - D_802BA050 = dma_textures(gTextureGreenShell0, 0x00000257U, 0x00000400U); - dma_textures(gTextureGreenShell1, 0x00000242U, 0x00000400U); - dma_textures(gTextureGreenShell2, 0x00000259U, 0x00000400U); - dma_textures(gTextureGreenShell3, 0x00000256U, 0x00000400U); - dma_textures(gTextureGreenShell4, 0x00000246U, 0x00000400U); - dma_textures(gTextureGreenShell5, 0x0000025EU, 0x00000400U); - dma_textures(gTextureGreenShell6, 0x0000025CU, 0x00000400U); - dma_textures(gTextureGreenShell7, 0x00000254U, 0x00000400U); - D_802BA054 = dma_textures(gTextureBlueShell0, 0x0000022AU, 0x00000400U); - dma_textures(gTextureBlueShell1, 0x00000237U, 0x00000400U); - dma_textures(gTextureBlueShell2, 0x0000023EU, 0x00000400U); - dma_textures(gTextureBlueShell3, 0x00000243U, 0x00000400U); - dma_textures(gTextureBlueShell4, 0x00000255U, 0x00000400U); - dma_textures(gTextureBlueShell5, 0x00000259U, 0x00000400U); - dma_textures(gTextureBlueShell6, 0x00000239U, 0x00000400U); - dma_textures(gTextureBlueShell7, 0x00000236U, 0x00000400U); + D_802BA050 = dma_textures(texture_green_shell_0, 0x00000257U, 0x00000400U); + dma_textures(texture_green_shell_1, 0x00000242U, 0x00000400U); + dma_textures(texture_green_shell_2, 0x00000259U, 0x00000400U); + dma_textures(texture_green_shell_3, 0x00000256U, 0x00000400U); + dma_textures(texture_green_shell_4, 0x00000246U, 0x00000400U); + dma_textures(texture_green_shell_5, 0x0000025EU, 0x00000400U); + dma_textures(texture_green_shell_6, 0x0000025CU, 0x00000400U); + dma_textures(texture_green_shell_7, 0x00000254U, 0x00000400U); + D_802BA054 = dma_textures(texture_blue_shell_0, 0x0000022AU, 0x00000400U); + dma_textures(texture_blue_shell_1, 0x00000237U, 0x00000400U); + dma_textures(texture_blue_shell_2, 0x0000023EU, 0x00000400U); + dma_textures(texture_blue_shell_3, 0x00000243U, 0x00000400U); + dma_textures(texture_blue_shell_4, 0x00000255U, 0x00000400U); + dma_textures(texture_blue_shell_5, 0x00000259U, 0x00000400U); + dma_textures(texture_blue_shell_6, 0x00000239U, 0x00000400U); + dma_textures(texture_blue_shell_7, 0x00000236U, 0x00000400U); dma_textures(gTextureFinishLineBanner1, 0x0000028EU, 0x00000800U); dma_textures(gTextureFinishLineBanner2, 0x000002FBU, 0x00000800U); dma_textures(gTextureFinishLineBanner3, 0x00000302U, 0x00000800U); @@ -1208,6 +1211,7 @@ void init_actors_and_load_textures(void) { dma_textures(gTextureFinishLineBanner8, 0x0000025BU, 0x00000800U); dma_textures(gTexture671A88, 0x00000400U, 0x00000800U); dma_textures(gTexture6774D8, 0x00000400U, 0x00000800U); +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: dma_textures(gTextureTrees1, 0x0000035BU, 0x00000800U); @@ -1275,6 +1279,9 @@ void init_actors_and_load_textures(void) { dma_textures(gTextureDksJungleParkwayKiwanoFruit3, 0x00000364U, 0x00000400U); break; } +#else + +#endif init_red_shell_texture(); destroy_all_actors(); spawn_course_actors(); @@ -1544,7 +1551,7 @@ bool query_and_resolve_collision_player_actor(Player* player, Vec3f pos, f32 min player->pos[0] += (xVelocity / temp_f0_4) * minDist; player->pos[2] += (zVelocity / temp_f0_4) * minDist; } else { - player->effects |= 0x8000; + player->effects |= ENEMY_BONK_EFFECT; xDist /= sqrtDist; zDist /= sqrtDist; temp_f0_5 = sqrtf((xVelocity * xVelocity) + (zVelocity * zVelocity)); @@ -1650,13 +1657,13 @@ bool collision_yoshi_egg(Player* player, struct YoshiValleyEgg* egg) { func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } else { - apply_hit_sound_effect(player, player - gPlayerOne); - if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_KART_AI) == 0)) { - D_80162DF8 = 1; + trigger_squish(player, player - gPlayerOne); + if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_CPU) == 0)) { + gPostTimeTrialReplayCannotSave = 1; } } } else { - apply_hit_sound_effect(player, player - gPlayerOne); + trigger_squish(player, player - gPlayerOne); } return true; @@ -1721,14 +1728,14 @@ bool collision_tree(Player* player, struct Actor* actor) { } } if (!(player->effects & STAR_EFFECT)) { - player->effects |= 0x8000; + player->effects |= ENEMY_BONK_EFFECT; } actorPos[0] = actor->pos[0]; actorPos[1] = actor->pos[1]; actorPos[2] = actor->pos[2]; if (((gCurrentCourseId == COURSE_MARIO_RACEWAY) || (gCurrentCourseId == COURSE_YOSHI_VALLEY) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY) || (gCurrentCourseId == COURSE_LUIGI_RACEWAY)) && - (player->unk_094 > 1.0f)) { + (player->speed > 1.0f)) { spawn_leaf(actorPos, 0); } if (xz_dist < 0.1f) { @@ -1854,7 +1861,7 @@ void destroy_destructable_actor(struct Actor* actor) { break; case HELD_BANANA: player = &gPlayers[banana->playerId]; - player->soundEffects &= ~0x00040000; + player->triggers &= ~DRAG_ITEM_EFFECT; /* fallthrough */ case BANANA_ON_GROUND: banana->flags = -0x8000; @@ -1949,7 +1956,7 @@ void destroy_destructable_actor(struct Actor* actor) { fakeItemBox = (struct FakeItemBox*) actor; player = &gPlayers[(s16) fakeItemBox->playerId]; if (fakeItemBox->state == HELD_FAKE_ITEM_BOX) { - player->soundEffects &= ~0x00040000; + player->triggers &= ~DRAG_ITEM_EFFECT; } fakeItemBox->state = DESTROYED_FAKE_ITEM_BOX; fakeItemBox->flags = -0x8000; @@ -2069,10 +2076,11 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor } break; case ACTOR_BANANA: - if (player->effects & (BOO_EFFECT | 0x8C0)) { + if (player->effects & + (BOO_EFFECT | BANANA_NEAR_SPINOUT_EFFECT | BANANA_SPINOUT_EFFECT | DRIVING_SPINOUT_EFFECT)) { break; } - if (player->soundEffects & 1) { + if (player->triggers & HIT_BANANA_TRIGGER) { break; } temp_v1 = actor->rot[0]; @@ -2080,9 +2088,9 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; } - player->soundEffects |= 1; + player->triggers |= HIT_BANANA_TRIGGER; owner = &gPlayers[temp_v1]; - if (owner->type & 0x4000) { + if (owner->type & PLAYER_HUMAN) { if (actor->flags & 0xF) { if (temp_lo != temp_v1) { func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); @@ -2098,10 +2106,10 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor destroy_destructable_actor(actor); break; case ACTOR_GREEN_SHELL: - if (player->effects & 0x80000400) { + if (player->effects & (BOO_EFFECT | HIT_BY_GREEN_SHELL_EFFECT)) { break; } - if (player->soundEffects & 4) { + if (player->triggers & LOW_TUMBLE_TRIGGER) { break; } temp_v1 = actor->rot[2]; @@ -2109,16 +2117,16 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; } - player->soundEffects |= 4; + player->triggers |= LOW_TUMBLE_TRIGGER; func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); owner = &gPlayers[temp_v1]; - if ((owner->type & 0x4000) && (temp_lo != temp_v1)) { + if ((owner->type & PLAYER_HUMAN) && (temp_lo != temp_v1)) { func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } destroy_destructable_actor(actor); break; case ACTOR_BLUE_SPINY_SHELL: - if (player->soundEffects & 2) { + if (player->triggers & HIGH_TUMBLE_TRIGGER) { break; } temp_v1 = actor->rot[2]; @@ -2127,11 +2135,11 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor break; } if (!(player->effects & BOO_EFFECT)) { - player->soundEffects |= 2; + player->triggers |= HIGH_TUMBLE_TRIGGER; func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); } owner = &gPlayers[temp_v1]; - if ((owner->type & 0x4000) && (temp_lo != temp_v1)) { + if ((owner->type & PLAYER_HUMAN) && (temp_lo != temp_v1)) { func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } if (temp_lo == actor->unk_04) { @@ -2140,10 +2148,10 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor break; case ACTOR_RED_SHELL: temp_v1 = actor->rot[2]; - if (player->effects & 0x01000000) { + if (player->effects & EXPLOSION_CRASH_EFFECT) { break; } - if (player->soundEffects & 2) { + if (player->triggers & HIGH_TUMBLE_TRIGGER) { break; } temp_v1 = actor->rot[2]; @@ -2152,11 +2160,11 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor break; } if (!(player->effects & BOO_EFFECT)) { - player->soundEffects |= 2; + player->triggers |= HIGH_TUMBLE_TRIGGER; func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); } owner = &gPlayers[temp_v1]; - if ((owner->type & 0x4000) && (temp_lo != temp_v1)) { + if ((owner->type & PLAYER_HUMAN) && (temp_lo != temp_v1)) { func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } destroy_destructable_actor(actor); @@ -2191,13 +2199,13 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor if (!(player->effects & BOO_EFFECT) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) { if (query_collision_player_vs_actor_item(player, actor) == COLLISION) { func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION); - if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_KART_AI)) { - D_80162DF8 = 1; + if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_CPU)) { + gPostTimeTrialReplayCannotSave = 1; } if (player->effects & STAR_EFFECT) { actor->velocity[1] = 10.0f; } else { - apply_hit_sound_effect(player, player - gPlayerOne); + trigger_squish(player, player - gPlayerOne); } } } @@ -2212,9 +2220,9 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; } - player->soundEffects |= REVERSE_SOUND_EFFECT; + player->triggers |= VERTICAL_TUMBLE_TRIGGER; owner = &gPlayers[temp_v1]; - if (owner->type & 0x4000) { + if (owner->type & PLAYER_HUMAN) { if (actor->flags & 0xF) { if (temp_lo != temp_v1) { func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); @@ -2227,7 +2235,7 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor } } if (actor->state == 0) { - owner->soundEffects &= ~0x00040000; + owner->triggers &= ~DRAG_ITEM_EFFECT; } } actor->state = 2; @@ -2273,12 +2281,12 @@ void evaluate_collision_for_players_and_actors(void) { for (i = 0; i < NUM_PLAYERS; i++) { phi_s1 = &gPlayers[i]; - if (((phi_s1->type & 0x8000) != 0) && ((phi_s1->effects & 0x4000000) == 0)) { + if (((phi_s1->type & PLAYER_EXISTS) != 0) && ((phi_s1->effects & SQUISH_EFFECT) == 0)) { func_802977E4(phi_s1); for (j = 0; j < ACTOR_LIST_SIZE; j++) { temp_a1 = &gActorList[j]; - if ((phi_s1->effects & 0x4000000) == 0) { + if ((phi_s1->effects & SQUISH_EFFECT) == 0) { // temp_v0 = temp_a1->unk2; if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) { evaluate_collision_between_player_actor(phi_s1, temp_a1); @@ -2368,7 +2376,7 @@ void evaluate_collision_for_destructible_actors(void) { void func_802A1064(struct FakeItemBox* fake_item_box) { if ((u32) (fake_item_box - (struct FakeItemBox*) gActorList) <= (u32) ACTOR_LIST_SIZE) { if (((fake_item_box->flags & 0x8000) != 0) && (fake_item_box->type == ACTOR_FAKE_ITEM_BOX)) { - fake_item_box->state = 1; + fake_item_box->state = FAKE_ITEM_BOX_ON_GROUND; fake_item_box->targetY = func_802ABEAC(&fake_item_box->unk30, fake_item_box->pos) + 8.66f; fake_item_box->someTimer = 100; } diff --git a/src/racing/actors.h b/src/racing/actors.h index 7b51048ac0..095bf33c7e 100644 --- a/src/racing/actors.h +++ b/src/racing/actors.h @@ -125,7 +125,6 @@ extern u16 D_802BA260; // Box Truck sub-type? // end of definition of actor.c variables -extern s16 gCurrentCourseId; extern u16 isCrossingTriggeredByIndex[]; extern Lights1 D_800DC610[]; @@ -146,7 +145,7 @@ extern Gfx toads_turnpike_dl_9[]; extern Gfx toads_turnpike_dl_10[]; extern Gfx toads_turnpike_dl_11[]; -extern s32 D_80162DF8; +extern s32 gPostTimeTrialReplayCannotSave; extern Gfx D_0D001750[]; extern Gfx D_0D001780[]; diff --git a/src/racing/actors_extended.c b/src/racing/actors_extended.c index 814028456d..859cba6ac4 100644 --- a/src/racing/actors_extended.c +++ b/src/racing/actors_extended.c @@ -5,9 +5,9 @@ #include "code_800029B0.h" #include "math_util.h" #include "memory.h" -#include "waypoints.h" -#include "code_80005FD0.h" -#include "code_80091750.h" +#include "path.h" +#include "cpu_vehicles_camera_path.h" +#include "menu_items.h" #include "collision.h" #include "actors.h" #include "actors_extended.h" @@ -100,7 +100,7 @@ void destroy_banana_in_banana_bunch(struct BananaActor* banana) { func_802B0464(banana->youngerIndex); func_802B04E8(banana, banana->elderIndex); - if ((gPlayers[banana->playerId].type & 0x4000) != 0) { + if ((gPlayers[banana->playerId].type & PLAYER_HUMAN) != 0) { func_800C9060(banana->playerId, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); } banana->flags = -0x8000; @@ -116,7 +116,7 @@ void destroy_banana_in_banana_bunch(struct BananaActor* banana) { } // Drop a banana from a banana bunch? -void func_802B0648(struct BananaBunchParent* banana_bunch) { +void drop_banana_in_banana_bunch(struct BananaBunchParent* banana_bunch) { s16 elderIndex; struct BananaActor* banana; @@ -185,15 +185,15 @@ void func_802B0788(s16 rawStickY, struct BananaBunchParent* banana_bunch, Player elderBanana = (struct BananaActor*) &gActorList[banana->elderIndex]; elderBanana->youngerIndex = -1; } - if (player->unk_094 < 2.0f) { + if (player->speed < 2.0f) { var_f0 = ((rawStickY - 30.0f) / 20.0f) + 1.5f; var_f12 = 4.0f; } else { var_f0 = ((rawStickY - 30.0f) / 20.0f) + 1.5f; - var_f12 = (player->unk_094 * 0.75f) + 4.5f + var_f0; + var_f12 = (player->speed * 0.75f) + 4.5f + var_f0; } vec3f_set(velocity, 0.0f, var_f0, var_f12); - func_802B64C4(velocity, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(velocity, player->rotation[1] + player->unk_0C0); banana->velocity[0] = velocity[0]; banana->velocity[1] = velocity[1]; banana->velocity[2] = velocity[2]; @@ -293,8 +293,8 @@ void update_actor_banana_bunch(struct BananaBunchParent* banana_bunch) { } if (someCount == 0) { destroy_actor((struct Actor*) banana_bunch); - owner->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT; - } else if ((owner->type & 0x4000) != 0) { + owner->triggers &= ~DRAG_ITEM_EFFECT; + } else if ((owner->type & PLAYER_HUMAN) != 0) { controller = &gControllers[banana_bunch->playerId]; if ((controller->buttonPressed & Z_TRIG) != 0) { controller->buttonPressed &= ~Z_TRIG; @@ -303,7 +303,7 @@ void update_actor_banana_bunch(struct BananaBunchParent* banana_bunch) { ((controller->rawStickX < 0x28) && (controller->rawStickX >= -0x27))) { func_802B0788(controller->rawStickY, banana_bunch, owner); } else { - func_802B0648(banana_bunch); + drop_banana_in_banana_bunch(banana_bunch); } } } @@ -431,7 +431,7 @@ void update_actor_triple_shell(TripleShellParent* parent, s16 shellType) { someVelocity[0] = 0; someVelocity[1] = 0; someVelocity[2] = 8; - func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(someVelocity, player->rotation[1] + player->unk_0C0); shell->velocity[0] = someVelocity[0]; shell->velocity[1] = someVelocity[1]; shell->velocity[2] = someVelocity[2]; @@ -457,7 +457,7 @@ void update_actor_triple_shell(TripleShellParent* parent, s16 shellType) { someVelocity[0] = 0; someVelocity[1] = 0; someVelocity[2] = 8; - func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(someVelocity, player->rotation[1] + player->unk_0C0); shell->velocity[0] = someVelocity[0]; shell->velocity[1] = someVelocity[1]; shell->velocity[2] = someVelocity[2]; @@ -483,7 +483,7 @@ void update_actor_triple_shell(TripleShellParent* parent, s16 shellType) { someVelocity[0] = 0; someVelocity[1] = 0; someVelocity[2] = 8; - func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0); + vec3f_rotate_y(someVelocity, player->rotation[1] + player->unk_0C0); shell->velocity[0] = someVelocity[0]; shell->velocity[1] = someVelocity[1]; shell->velocity[2] = someVelocity[2]; @@ -525,7 +525,7 @@ s32 use_banana_bunch_item(Player* player) { bananaBunch = (struct BananaBunchParent*) &gActorList[actorIndex]; bananaBunch->state = 0; bananaBunch->playerId = player - gPlayerOne; - player->soundEffects |= HOLD_BANANA_SOUND_EFFECT; + player->triggers |= DRAG_ITEM_EFFECT; return actorIndex; } @@ -561,7 +561,7 @@ s32 init_triple_shell(TripleShellParent* parent, Player* player, s16 shellType, startingPos[0] = 0.0f; startingPos[1] = -player->boundingBoxSize; startingPos[2] = player->boundingBoxSize - 4.0f; - mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix); + mtxf_transform_vec3f_mat3(startingPos, player->orientationMatrix); startingPos[0] += player->pos[0]; startingPos[1] += player->pos[1]; startingPos[2] += player->pos[2]; @@ -610,7 +610,7 @@ s32 use_green_shell_item(Player* player) { startingPos[2] = player->boundingBoxSize - 4.0f; // rotate to match player orientation - mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix); + mtxf_transform_vec3f_mat3(startingPos, player->orientationMatrix); // move to player position startingPos[0] += player->pos[0]; @@ -650,7 +650,7 @@ s32 use_red_shell_item(Player* player) { startingPos[2] = player->boundingBoxSize - 4.0f; // rotate to match player orientation - mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix); + mtxf_transform_vec3f_mat3(startingPos, player->orientationMatrix); // move to player position startingPos[0] += player->pos[0]; @@ -699,7 +699,7 @@ void func_802B2914(struct BananaBunchParent* banana_bunch, Player* player, s16 b startingPos[0] = 0.0f; startingPos[1] = -player->boundingBoxSize; startingPos[2] = -(player->boundingBoxSize + 4.0f); - mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix); + mtxf_transform_vec3f_mat3(startingPos, player->orientationMatrix); startingPos[0] += player->pos[0]; startingPos[1] += player->pos[1]; startingPos[2] += player->pos[2]; @@ -779,7 +779,7 @@ s32 use_fake_itembox_item(Player* player) { startingPos[2] = -(player->boundingBoxSize + 4.0f); // rotate to match player orientation - mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix); + mtxf_transform_vec3f_mat3(startingPos, player->orientationMatrix); // move to player position startingPos[0] += player->pos[0]; @@ -803,7 +803,7 @@ s32 use_fake_itembox_item(Player* player) { itemBox = (struct FakeItemBox*) &gActorList[actorIndex]; itemBox->playerId = (player - gPlayerOne); itemBox->state = HELD_FAKE_ITEM_BOX; - player->soundEffects |= HOLD_BANANA_SOUND_EFFECT; + player->triggers |= DRAG_ITEM_EFFECT; return actorIndex; } @@ -827,7 +827,7 @@ s32 use_banana_item(Player* player) { startingPos[2] = -(player->boundingBoxSize + 4.0f); // apply the player's orientation to the banana - mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix); + mtxf_transform_vec3f_mat3(startingPos, player->orientationMatrix); // add the player's position to the banana's position startingPos[0] += player->pos[0]; @@ -850,7 +850,7 @@ s32 use_banana_item(Player* player) { banana->playerId = playerId; banana->state = HELD_BANANA; banana->unk_04 = 0x0014; - player->soundEffects |= HOLD_BANANA_SOUND_EFFECT; + player->triggers |= DRAG_ITEM_EFFECT; return actorIndex; } @@ -872,7 +872,7 @@ void use_thunder_item(Player* player) { for (index = 0; index < NUM_PLAYERS; index++) { otherPlayer = &gPlayers[index]; if (player != otherPlayer) { - otherPlayer->soundEffects |= HIT_ROTATING_SOUND_EFFECT; + otherPlayer->triggers |= LIGHTNING_STRIKE_TRIGGER; } } } @@ -898,22 +898,22 @@ void player_use_item(Player* player) { use_banana_bunch_item(player); break; case ITEM_MUSHROOM: - player->soundEffects |= BOOST_SOUND_EFFECT; + player->triggers |= SHROOM_TRIGGER; break; case ITEM_DOUBLE_MUSHROOM: - player->soundEffects |= BOOST_SOUND_EFFECT; + player->triggers |= SHROOM_TRIGGER; break; case ITEM_TRIPLE_MUSHROOM: - player->soundEffects |= BOOST_SOUND_EFFECT; + player->triggers |= SHROOM_TRIGGER; break; case ITEM_SUPER_MUSHROOM: - player->soundEffects |= BOOST_SOUND_EFFECT; + player->triggers |= SHROOM_TRIGGER; break; case ITEM_BOO: - player->soundEffects |= BOO_SOUND_EFFECT; + player->triggers |= BOO_TRIGGER; break; case ITEM_STAR: - player->soundEffects |= STAR_SOUND_EFFECT; + player->triggers |= STAR_TRIGGER; break; case ITEM_THUNDERBOLT: use_thunder_item(player); diff --git a/src/racing/actors_extended.h b/src/racing/actors_extended.h index 457106de63..e054ce12a9 100644 --- a/src/racing/actors_extended.h +++ b/src/racing/actors_extended.h @@ -12,7 +12,7 @@ void func_802B039C(struct BananaActor*); void func_802B0464(s16); void func_802B04E8(struct BananaActor*, s16); void destroy_banana_in_banana_bunch(struct BananaActor*); -void func_802B0648(struct BananaBunchParent*); +void drop_banana_in_banana_bunch(struct BananaBunchParent*); void func_802B0788(s16, struct BananaBunchParent*, Player*); s32 func_802B09C0(s16); void update_actor_banana_bunch(struct BananaBunchParent*); diff --git a/src/racing/collision.c b/src/racing/collision.c index 889ff7e951..5aa7133ad6 100644 --- a/src/racing/collision.c +++ b/src/racing/collision.c @@ -1,9 +1,11 @@ #include #include #include -#include #include +#include #include +#include + #include "main.h" #include "memory.h" #include "collision.h" @@ -871,8 +873,8 @@ s32 is_colliding_with_drivable_surface(Collision* collision, f32 boundingBoxSize /** * Wall collision */ -s32 is_colliding_with_wall2(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, - f32 posY, f32 posZ) { +s32 is_colliding_with_wall_z(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, + f32 posY, f32 posZ) { CollisionTriangle* triangle = &gCollisionMesh[surfaceIndex]; UNUSED s32 pad[6]; f32 x4; @@ -1053,8 +1055,8 @@ s32 is_colliding_with_wall2(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, /** * This is actually more like colliding with face X/Y/Z */ -s32 is_colliding_with_wall1(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, - f32 posY, f32 posZ) { +s32 is_colliding_with_wall_x(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, + f32 posY, f32 posZ) { CollisionTriangle* triangle = &gCollisionMesh[surfaceIndex]; s32 b = 1; UNUSED s32 pad[7]; @@ -1267,15 +1269,15 @@ u16 actor_terrain_collision(Collision* collision, f32 boundingBoxSize, f32 newX, } if ((s32) collision->meshIndexYX < (s32) gCollisionMeshCount) { - if (is_colliding_with_wall2(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexYX, oldX, oldY, - oldZ) == COLLISION) { + if (is_colliding_with_wall_z(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexYX, oldX, oldY, + oldZ) == COLLISION) { flags |= FACING_Z_AXIS; } } if ((s32) collision->meshIndexZY < (s32) gCollisionMeshCount) { - if (is_colliding_with_wall1(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexZY, oldX, oldY, - oldZ) == COLLISION) { + if (is_colliding_with_wall_x(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexZY, oldX, oldY, + oldZ) == COLLISION) { flags |= FACING_X_AXIS; } } @@ -1334,16 +1336,16 @@ u16 actor_terrain_collision(Collision* collision, f32 boundingBoxSize, f32 newX, } else if ((gCollisionMesh[collisionIndex].flags & FACING_X_AXIS) != 0) { if ((flags & FACING_X_AXIS) == 0) { if (collisionIndex != collision->meshIndexZY) { - if (is_colliding_with_wall1(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, - oldY, oldZ) == COLLISION) { + if (is_colliding_with_wall_x(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, + oldY, oldZ) == COLLISION) { flags |= FACING_X_AXIS; } } } } else if ((flags & FACING_Z_AXIS) == 0) { if (collisionIndex != collision->meshIndexYX) { - if (is_colliding_with_wall2(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, - oldZ) == COLLISION) { + if (is_colliding_with_wall_z(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, + oldZ) == COLLISION) { flags |= FACING_Z_AXIS; } } @@ -1461,10 +1463,11 @@ u16 check_bounding_collision(Collision* collision, f32 boundingBoxSize, f32 posX extern u8 D_8014F1110; /** + * @brief Returns the height of the surface below the provided position. Used to set actors onto the course mesh. * If unable to spawn actor on the surface set to -3000.0f or * if outside the collision grid, spawn in the air (3000.0f). */ -f32 spawn_actor_on_surface(f32 posX, f32 posY, f32 posZ) { +f32 get_surface_height(f32 posX, f32 posY, f32 posZ) { f32 height; s16 sectionIndexX; s16 sectionIndexZ; @@ -2178,8 +2181,8 @@ u16 player_terrain_collision(Player* player, KartTyre* tyre, f32 tyre2X, f32 tyr tyreZ = tyre->pos[2]; switch (tyre->surfaceFlags) { case 0x80: - if (is_colliding_with_wall1(collision, boundingBoxSize, tyreX, tyreY, tyreZ, tyre->collisionMeshIndex, - tyre2X, tyre2Y, tyre2Z) == 1) { + if (is_colliding_with_wall_x(collision, boundingBoxSize, tyreX, tyreY, tyreZ, tyre->collisionMeshIndex, + tyre2X, tyre2Y, tyre2Z) == 1) { height = calculate_surface_height(tyreX, tyreY, tyreZ, tyre->collisionMeshIndex); if ((!(height > player->pos[1])) && !((player->pos[1] - height) > (2 * boundingBoxSize))) { tyre->baseHeight = height; @@ -2200,8 +2203,8 @@ u16 player_terrain_collision(Player* player, KartTyre* tyre, f32 tyre2X, f32 tyr } break; case 0x20: - if (is_colliding_with_wall2(collision, boundingBoxSize, tyreX, tyreY, tyreZ, tyre->collisionMeshIndex, - tyre2X, tyre2Y, tyre2Z) == 1) { + if (is_colliding_with_wall_z(collision, boundingBoxSize, tyreX, tyreY, tyreZ, tyre->collisionMeshIndex, + tyre2X, tyre2Y, tyre2Z) == 1) { height = calculate_surface_height(tyreX, tyreY, tyreZ, tyre->collisionMeshIndex); if (!(player->pos[1] < height) && !((2 * boundingBoxSize) < (player->pos[1] - height))) { tyre->baseHeight = height; @@ -2273,8 +2276,8 @@ u16 player_terrain_collision(Player* player, KartTyre* tyre, f32 tyre2X, f32 tyr } else if (gCollisionMesh[meshIndex].flags & FACING_X_AXIS) { if (gCollisionMesh[meshIndex].normalY != 0.0f) { if (meshIndex != tyre->collisionMeshIndex) { - if (is_colliding_with_wall1(collision, boundingBoxSize, tyreX, tyreY, tyreZ, meshIndex, tyre2X, - tyre2Y, tyre2Z) == 1) { + if (is_colliding_with_wall_x(collision, boundingBoxSize, tyreX, tyreY, tyreZ, meshIndex, tyre2X, + tyre2Y, tyre2Z) == 1) { height = calculate_surface_height(tyreX, tyreY, tyreZ, meshIndex); if (!(player->pos[1] < height) && !((2 * boundingBoxSize) < (player->pos[1] - height))) { tyre->baseHeight = height; @@ -2291,8 +2294,8 @@ u16 player_terrain_collision(Player* player, KartTyre* tyre, f32 tyre2X, f32 tyr } else { if (gCollisionMesh[meshIndex].normalY != 0.0f) { if (meshIndex != tyre->collisionMeshIndex) { - if (is_colliding_with_wall2(collision, boundingBoxSize, tyreX, tyreY, tyreZ, meshIndex, tyre2X, - tyre2Y, tyre2Z) == 1) { + if (is_colliding_with_wall_z(collision, boundingBoxSize, tyreX, tyreY, tyreZ, meshIndex, tyre2X, + tyre2Y, tyre2Z) == 1) { height = calculate_surface_height(tyreX, tyreY, tyreZ, meshIndex); if (!(player->pos[1] < height) && !((2 * boundingBoxSize) < (player->pos[1] - height))) { tyre->baseHeight = height; diff --git a/src/racing/collision.h b/src/racing/collision.h index dd1b6dfda7..8fbd4c037c 100644 --- a/src/racing/collision.h +++ b/src/racing/collision.h @@ -26,7 +26,7 @@ void adjust_pos_orthogonally(Vec3f, f32, Vec3f, f32); s32 detect_tyre_collision(KartTyre*); u16 actor_terrain_collision(Collision*, f32, f32, f32, f32, f32, f32, f32); u16 check_bounding_collision(Collision*, f32, f32, f32, f32); -f32 spawn_actor_on_surface(f32, f32, f32); +f32 get_surface_height(f32, f32, f32); void set_vtx_buffer(uintptr_t, u32, u32); s32 is_line_intersecting_rectangle(s16, s16, s16, s16, s16, s16, s16, s16); s32 is_triangle_intersecting_bounding_box(s16, s16, s16, s16, u16); diff --git a/src/racing/math_util.c b/src/racing/math_util.c index 2f7bd510ef..7224be25b1 100644 --- a/src/racing/math_util.c +++ b/src/racing/math_util.c @@ -11,10 +11,10 @@ #pragma intrinsic(sqrtf, fabs) -s32 D_802B91C0[2] = { 13, 13 }; +UNUSED s32 D_802B91C0[2] = { 13, 13 }; Vec3f D_802B91C8 = { 0.0f, 0.0f, 0.0f }; -// This functions looks similar to a segment of code from func_802A4A0C in skybox_and_splitscreen.c +// This functions looks similar to a segment of code from render_skybox in skybox_and_splitscreen.c UNUSED s32 func_802B4F60(UNUSED s32 arg0, Vec3f arg1, UNUSED s32 arg2, UNUSED f32 arg3, UNUSED f32 arg4) { Mat4 sp30; f32 sp2C; @@ -28,7 +28,7 @@ UNUSED s32 func_802B4F60(UNUSED s32 arg0, Vec3f arg1, UNUSED s32 arg2, UNUSED f3 sp2C = ((sp30[0][3] * sp28) + (sp30[1][3] * sp2C) + (sp30[2][3] * sp1C[2])) + sp30[3][3]; // double wut? if (sp28 && sp28) {}; - mtxf_translate_vec3f_mat4(sp1C, sp30); + mtxf_transform_vec3f_mat4(sp1C, sp30); if (0.0f >= sp2C) { return 0; } else { @@ -44,12 +44,12 @@ UNUSED void func_802B4FF0() { * object already render Note that gMatrixObjectCount gets reset at the beginning of the game loop. So no cleanup needs * to be performed. */ -s32 render_set_position(Mat4 arg0, s32 arg1) { +s32 render_set_position(Mat4 mtx, s32 mode) { if (gMatrixObjectCount >= MTX_OBJECT_POOL_SIZE) { return 0; } - mtxf_to_mtx(&gGfxPool->mtxObject[gMatrixObjectCount], arg0); - switch (arg1) { /* irregular */ + mtxf_to_mtx(&gGfxPool->mtxObject[gMatrixObjectCount], mtx); + switch (mode) { /* irregular */ case 0: gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxObject[gMatrixObjectCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -70,28 +70,41 @@ s32 render_set_position(Mat4 arg0, s32 arg1) { return 1; } -f32 func_802B51E8(Vec3f arg0, Vec3f arg1) { - f32 sub_y; - f32 sub_z; - f32 sub_x; - - sub_x = arg1[0] - arg0[0]; - sub_y = arg1[1] - arg0[1]; - sub_z = arg1[2] - arg0[2]; - return (sub_x * sub_x) + (sub_y * sub_y) + sub_z + sub_z; +/* + * @brief Finds the squared distance between two points, but contains a bug when handling the z-axis + * @param from A point in 3D space + * @param to A point in 3D space + * @return Roughly the squared distance between from and to. (x**2 + y**2 + 2*z) instead of (x**2 + y**2 + z**2) + */ +f32 dist_squared_bugged(Vec3f from, Vec3f to) { + f32 deltaY; + f32 deltaZ; + f32 deltaX; + + deltaX = to[0] - from[0]; + deltaY = to[1] - from[1]; + deltaZ = to[2] - from[2]; + // If the last plus was a multiplication symbol, we'd have a correct dist_squared formula + return (deltaX * deltaX) + (deltaY * deltaY) + deltaZ + deltaZ; } -s32 get_angle_between_two_vectors(Vec3f arg0, Vec3f arg1) { - f32 temp_v1; - f32 temp_v2; - temp_v1 = arg1[0] - arg0[0]; - temp_v2 = arg1[2] - arg0[2]; +/* + * @brief Finds the angle within the XZ-plane between two points (while ignoring any difference in Y) + * @param pointFrom A point in 3D space + * @param pointTo A point in 3D space + * @return Angle (N64-units) in XZ-plane between pointFrom and pointTo + */ +s32 get_xz_angle_between_points(Vec3f pointFrom, Vec3f pointTo) { + f32 deltaX; + f32 deltaZ; + deltaX = pointTo[0] - pointFrom[0]; + deltaZ = pointTo[2] - pointFrom[2]; - return atan2s(temp_v1, temp_v2); + return atan2s(deltaX, deltaZ); } -// get_angle_between_two_vectors -u32 func_802B5258(Vec3f arg0, Vec3s arg1) { +// copy of get_xz_angle_between_points +UNUSED u32 func_802B5258(Vec3f arg0, Vec3s arg1) { f32 temp_v1; f32 temp_v2; temp_v1 = arg1[0] - arg0[0]; @@ -100,16 +113,30 @@ u32 func_802B5258(Vec3f arg0, Vec3s arg1) { return atan2s(temp_v1, temp_v2); } -void vec3f_set(Vec3f arg0, f32 arg1, f32 arg2, f32 arg3) { - arg0[0] = arg1; - arg0[1] = arg2; - arg0[2] = arg3; +/* + * @brief sets a vector to the given coordinates + * @param dest The vector to be overriden + * @param coordX The X coordinate of the desired vector + * @param coordY The Y coordinate of the desired vector + * @param coordZ The Z coordinate of the desired vector + */ +void vec3f_set(Vec3f dest, f32 coordX, f32 coordY, f32 coordZ) { + dest[0] = coordX; + dest[1] = coordY; + dest[2] = coordZ; } -void vec3s_set(Vec3s arg0, s16 arg1, s16 arg2, s16 arg3) { - arg0[0] = arg1; - arg0[1] = arg2; - arg0[2] = arg3; +/* + * @brief sets a vector to the given coordinates + * @param dest The vector to be overriden + * @param coordX The X coordinate of the desired vector + * @param coordY The Y coordinate of the desired vector + * @param coordZ The Z coordinate of the desired vector + */ +void vec3s_set(Vec3s dest, s16 coordX, s16 coordY, s16 coordZ) { + dest[0] = coordX; + dest[1] = coordY; + dest[2] = coordZ; } // These functions have bogus return values. @@ -124,6 +151,12 @@ void vec3s_set(Vec3s arg0, s16 arg1, s16 arg2, s16 arg3) { #endif #endif +/* + * @brief Copies the coordinates of a vector to another vector + * @param dest The vector to be overriden + * @param src The vector to be copied + * @return local address of destination vector + */ void* vec3f_copy_return(Vec3f dest, Vec3f src) { dest[0] = src[0]; dest[1] = src[1]; @@ -132,6 +165,11 @@ void* vec3f_copy_return(Vec3f dest, Vec3f src) { return &dest; } +/* + * @brief copies the coordinates of a vector to another vector + * @param dest The vector to be overriden + * @param src The vector to be copied + */ void vec3s_copy(Vec3s dest, Vec3s src) { dest[0] = src[0]; dest[1] = src[1]; @@ -145,62 +183,78 @@ UNUSED void* vec3f_set_return(Vec3f dest, f32 x, f32 y, f32 z) { return &dest; } -// Copy mat1 to mat2 -void mtxf_copy(Mat4 mat1, Mat4 mat2) { +/* + * @brief copies the values of a matrix to another matrix + * @param src The matrix to be copied + * @param dest The matrix to be overriden + */ +void mtxf_copy(Mat4 src, Mat4 dest) { s32 row; s32 column; for (row = 0; row < 4; row++) { for (column = 0; column < 4; column++) { - mat2[row][column] = mat1[row][column]; + dest[row][column] = src[row][column]; } } } -// mtxf_copy +/* + * @brief copies the first n values of a matrix to another matrix + * @param dest The matrix to be overriden + * @param src The matrix to be copied + * @param n The number of values to be copied + */ void mtxf_copy_n_element(s32* dest, s32* src, s32 n) { while (n-- > 0) { *dest++ = *src++; } } -// Transform a matrix to a matrix identity +/* + * @brief Transform a matrix to an identity matrix + * @param Matrix The matrix to be changed to an identity matrix + */ void mtxf_identity(Mat4 mtx) { - register s32 i; - register s32 k; + register s32 row; + register s32 col; - for (i = 0; i < 4; i++) { - for (k = 0; k < 4; k++) { - mtx[i][k] = (i == k) ? 1.0f : 0.0f; + for (row = 0; row < 4; row++) { + for (col = 0; col < 4; col++) { + mtx[row][col] = (row == col) ? 1.0f : 0.0f; } } } -// Add a translation vector to a matrix, mat is the matrix to add, dest is the destination matrix, pos is the -// translation vector -void add_translate_mat4_vec3f(Mat4 mat, Mat4 dest, Vec3f pos) { - dest[3][0] = mat[3][0] + pos[0]; - dest[3][1] = mat[3][1] + pos[1]; - dest[3][2] = mat[3][2] + pos[2]; - dest[3][3] = mat[3][3]; - dest[0][0] = mat[0][0]; - dest[0][1] = mat[0][1]; - dest[0][2] = mat[0][2]; - dest[0][3] = mat[0][3]; - dest[1][0] = mat[1][0]; - dest[1][1] = mat[1][1]; - dest[1][2] = mat[1][2]; - dest[1][3] = mat[1][3]; - dest[2][0] = mat[2][0]; - dest[2][1] = mat[2][1]; - dest[2][2] = mat[2][2]; - dest[2][3] = mat[2][3]; +/* + * @brief Add a translation vector to a matrix + * @param scr The matrix to be copied + * @param dest The matrix to be overriden with the result + * @param translate The translation vector to be added + */ +void add_translate_mat4_vec3f(Mat4 src, Mat4 dest, Vec3f translate) { + dest[3][0] = src[3][0] + translate[0]; + dest[3][1] = src[3][1] + translate[1]; + dest[3][2] = src[3][2] + translate[2]; + dest[3][3] = src[3][3]; + dest[0][0] = src[0][0]; + dest[0][1] = src[0][1]; + dest[0][2] = src[0][2]; + dest[0][3] = src[0][3]; + dest[1][0] = src[1][0]; + dest[1][1] = src[1][1]; + dest[1][2] = src[1][2]; + dest[1][3] = src[1][3]; + dest[2][0] = src[2][0]; + dest[2][1] = src[2][1]; + dest[2][2] = src[2][2]; + dest[2][3] = src[2][3]; /* - * mat(0,0) mat(0,1) mat(0,2) mat(0,3) - * mat(1,0) mat(1,1) mat(1,2) mat(1,3) - * mat(2,0) mat(2,1) mat(2,2) mat(2,3) - * mat(3,0)+pos(0) mat(3,1)+pos(1) mat(3,2)+pos(2) mat(3,3) + * src(0,0) src(0,1) src(0,2) src(0,3) + * src(1,0) src(1,1) src(1,2) src(1,3) + * src(2,0) src(2,1) src(2,2) src(2,3) + * src(3,0)+translate(0) src(3,1)+translate(1) src(3,2)+translate(2) src(3,3) */ } @@ -211,39 +265,59 @@ UNUSED void add_translate_mat4_vec3f_lite(Mat4 mat, Mat4 dest, Vec3f pos) { dest[3][2] = mat[3][2] + pos[2]; } -// create a translation matrix -void mtxf_translate(Mat4 dest, Vec3f b) { +/* + * @brief Creates a translation matrix + * @param dest The matrix to be overriden with the translation matrix + * @param translate The translation vector to be added + */ +void mtxf_translate(Mat4 dest, Vec3f translate) { mtxf_identity(dest); - dest[3][0] = b[0]; - dest[3][1] = b[1]; - dest[3][2] = b[2]; + dest[3][0] = translate[0]; + dest[3][1] = translate[1]; + dest[3][2] = translate[2]; + /* 1 0 0 0 + * 0 1 0 0 + * 0 0 1 0 + * translate[0] translate[1] translate[2] 1 + */ } - -// Note the use of `2` which generates diff asm than just using floats (2.0f). -void func_802B5564(Mat4 arg0, u16* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { - f32 temp; - s32 i, j; - mtxf_identity(arg0); - arg2 *= 0.017453292222222222; - temp = cosf(arg2 / 2) / sinf(arg2 / 2); - arg0[0][0] = temp / arg3; - arg0[1][1] = temp; - arg0[2][2] = (arg4 + arg5) / (arg4 - arg5); - arg0[2][3] = -1.0f; - arg0[3][2] = (2 * arg4 * arg5) / (arg4 - arg5); - arg0[3][3] = 0.0f; - - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - arg0[i][j] *= arg6; +/* + * @brief Creates a projection matrix based on specified frustrum (i.e. where the camera can see) + * @param projMtx A dummy variable that will be overwritten with the projection matrix + * @param arg1 Unknown dummy variable (will be overwritten) + * @param vertFov vertical field of view (in degrees) + * @param aspectRatio Width / Height of player screen + * @param near near clipping distance + * @param far far clipping distance + * @param homogeneousScale Scaling factor for homogeneous coordinates. Always 1.0 in game + * Note the use of `2` which generates diff asm than just using floats (2.0f). + */ +void mtxf_projection(Mat4 projMtx, u16* arg1, f32 vertFov, f32 aspectRatio, f32 near, f32 far, f32 homogeneousScale) { + f32 halfCot; + s32 rowIdx, colIdx; + mtxf_identity(projMtx); + vertFov *= 0.017453292222222222; // convert from degrees to radians + halfCot = cosf(vertFov / 2) / sinf(vertFov / 2); + projMtx[0][0] = halfCot / aspectRatio; + projMtx[1][1] = halfCot; + // Literature usually prefers the clearer equivalent -(near + far) / (far - near) + projMtx[2][2] = (near + far) / (near - far); + projMtx[2][3] = -1.0f; + projMtx[3][2] = (2 * near * far) / (near - far); + projMtx[3][3] = 0.0f; + + for (rowIdx = 0; rowIdx < 4; rowIdx++) { + for (colIdx = 0; colIdx < 4; colIdx++) { + projMtx[rowIdx][colIdx] *= homogeneousScale; } } + // sets arg1 to 2**16 / (midpoint of near and far), then clamped to [1, 2**16 - 1] if (arg1 != 0) { - if ((arg4 + arg5) <= 2.0) { + if ((near + far) <= 2.0) { *arg1 = 0xFFFF; } else { - *arg1 = 131072.0 / (arg4 + arg5); + *arg1 = 131072.0 / (near + far); if (*arg1 <= 0) { *arg1 = 1; } @@ -252,65 +326,78 @@ void func_802B5564(Mat4 arg0, u16* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, } // Appears to only be for the skybox. mtxf_lookat from sm64 with some modifications. -void func_802B5794(Mat4 mtx, Vec3f from, Vec3f to) { +/** + * @brief Create a lookat matrix (convert to coordinates relative to camera) + * @param mtx Dummy matrix overwritten with lookat matrix + * @param from Where the camera is looking from + * @param to Where the camera is looking to + */ +void mtxf_lookat(Mat4 mtx, Vec3f from, Vec3f to) { // register from sm64 but not required for matching. register f32 invLength; - f32 xColY; - f32 yColY; - f32 zColY; - f32 xColZ; - f32 yColZ; - f32 zColZ; - f32 xColX; - f32 yColX; - f32 zColX; - - xColY = 0.0f; - yColY = 1.0f; - zColY = 0.0f; - - xColZ = to[0] - from[0]; - yColZ = to[1] - from[1]; - zColZ = to[2] - from[2]; - - invLength = -1.0 / sqrtf(xColZ * xColZ + yColZ * yColZ + zColZ * zColZ); - xColZ *= invLength; - yColZ *= invLength; - zColZ *= invLength; - - xColX = yColY * zColZ - zColY * yColZ; - yColX = zColY * xColZ - xColY * zColZ; - zColX = xColY * yColZ - yColY * xColZ; - - invLength = 1.0 / sqrtf(xColX * xColX + yColX * yColX + zColX * zColX); - - xColX *= invLength; - yColX *= invLength; - zColX *= invLength; - - xColY = yColZ * zColX - zColZ * yColX; - yColY = zColZ * xColX - xColZ * zColX; - zColY = xColZ * yColX - yColZ * xColX; - - invLength = 1.0 / sqrtf(xColY * xColY + yColY * yColY + zColY * zColY); - xColY *= invLength; - yColY *= invLength; - zColY *= invLength; - - mtx[0][0] = xColX; - mtx[1][0] = yColX; - mtx[2][0] = zColX; - mtx[3][0] = -(from[0] * xColX + from[1] * yColX + from[2] * zColX); - - mtx[0][1] = xColY; - mtx[1][1] = yColY; - mtx[2][1] = zColY; - mtx[3][1] = -(from[0] * xColY + from[1] * yColY + from[2] * zColY); - - mtx[0][2] = xColZ; - mtx[1][2] = yColZ; - mtx[2][2] = zColZ; - mtx[3][2] = -(from[0] * xColZ + from[1] * yColZ + from[2] * zColZ); + + // forward: direction camera lens is facing + // up: direction toward top of frame + // right: direction toward right of frame + f32 upX; + f32 upY; + f32 upZ; + f32 forwardX; + f32 forwardY; + f32 forwardZ; + f32 rightX; + f32 rightY; + f32 rightZ; + + upX = 0.0f; + upY = 1.0f; + upZ = 0.0f; + + forwardX = to[0] - from[0]; + forwardY = to[1] - from[1]; + forwardZ = to[2] - from[2]; + + // normalize forward vector + invLength = -1.0 / sqrtf(forwardX * forwardX + forwardY * forwardY + forwardZ * forwardZ); + forwardX *= invLength; + forwardY *= invLength; + forwardZ *= invLength; + + // Cross product (creates vector perpendicular to forward and up) + rightX = upY * forwardZ - upZ * forwardY; + rightY = upZ * forwardX - upX * forwardZ; + rightZ = upX * forwardY - upY * forwardX; + + invLength = 1.0 / sqrtf(rightX * rightX + rightY * rightY + rightZ * rightZ); + + rightX *= invLength; + rightY *= invLength; + rightZ *= invLength; + + // Cross product + upX = forwardY * rightZ - forwardZ * rightY; + upY = forwardZ * rightX - forwardX * rightZ; + upZ = forwardX * rightY - forwardY * rightX; + + invLength = 1.0 / sqrtf(upX * upX + upY * upY + upZ * upZ); + upX *= invLength; + upY *= invLength; + upZ *= invLength; + + mtx[0][0] = rightX; + mtx[1][0] = rightY; + mtx[2][0] = rightZ; + mtx[3][0] = -(from[0] * rightX + from[1] * rightY + from[2] * rightZ); + + mtx[0][1] = upX; + mtx[1][1] = upY; + mtx[2][1] = upZ; + mtx[3][1] = -(from[0] * upX + from[1] * upY + from[2] * upZ); + + mtx[0][2] = forwardX; + mtx[1][2] = forwardY; + mtx[2][2] = forwardZ; + mtx[3][2] = -(from[0] * forwardX + from[1] * forwardY + from[2] * forwardZ); mtx[0][3] = 0.0f; mtx[1][3] = 0.0f; @@ -318,64 +405,76 @@ void func_802B5794(Mat4 mtx, Vec3f from, Vec3f to) { mtx[3][3] = 1.0f; } -// create a rotation matrix around the x axis -void mtxf_rotate_x(Mat4 mat, s16 angle) { - f32 sin_theta = sins(angle); - f32 cos_theta = coss(angle); +/* + * @brief Create a rotation matrix for rotating about the X axis + * @param mtx Dummy matrix overwritten with x-axis rotation matrix + * @param angle Angle to rotate by (in N64 units) + */ +void mtxf_rotate_x(Mat4 mtx, s16 angle) { + f32 sinAngle = sins(angle); + f32 cosAngle = coss(angle); - mtxf_identity(mat); - mat[1][1] = cos_theta; - mat[1][2] = sin_theta; - mat[2][1] = -sin_theta; - mat[2][2] = cos_theta; + mtxf_identity(mtx); + mtx[1][1] = cosAngle; + mtx[1][2] = sinAngle; + mtx[2][1] = -sinAngle; + mtx[2][2] = cosAngle; /* - * 1, 0, 0, 0, - * 0, cos_theta, sin_theta, 0, - * 0, -sin_theta, cos_theta, 0, - * 0, 0, 0, 1 + * 1, 0, 0, 0, + * 0, cosAngle, sinAngle, 0, + * 0, -sinAngle, cosAngle, 0, + * 0, 0, 0, 1 */ } -// create a rotation matrix around the y axis -void mtxf_rotate_y(Mat4 mat, s16 angle) { - f32 sin_theta = sins(angle); - f32 cos_theta = coss(angle); +/* + * @brief Create a rotation matrix for rotating about the Y axis + * @param mtx Dummy matrix overwritten with Y axis rotation matrix + * @param angle Angle to rotate by (in N64 units) + */ +void mtxf_rotate_y(Mat4 mtx, s16 angle) { + f32 sinAngle = sins(angle); + f32 cosAngle = coss(angle); - mtxf_identity(mat); - mat[0][0] = cos_theta; - mat[0][2] = -sin_theta; - mat[2][0] = sin_theta; - mat[2][2] = cos_theta; + mtxf_identity(mtx); + mtx[0][0] = cosAngle; + mtx[0][2] = -sinAngle; + mtx[2][0] = sinAngle; + mtx[2][2] = cosAngle; /* - * cos_theta, 0, -sin_theta, 0, - * 0, 1, 0, 0, - * sin_theta, 0, cos_theta, 0, - * 0, 0, 0, 1 + * cosAngle, 0, -sinAngle, 0, + * 0, 1, 0, 0, + * sinAngle, 0, cosAngle, 0, + * 0, 0, 0, 1 */ } -// create a rotation matrix around the z axis -void mtxf_s16_rotate_z(Mat4 mat, s16 angle) { - f32 sin_theta = sins(angle); - f32 cos_theta = coss(angle); +/* + * @brief Create a rotation matrix for rotating about the Z axis + * @param mtx Dummy matrix overwritten with Z axis rotation matrix + * @param angle Angle to rotate by (in N64 units) + */ +void mtxf_s16_rotate_z(Mat4 mtx, s16 angle) { + f32 sinAngle = sins(angle); + f32 cosAngle = coss(angle); - mtxf_identity(mat); - mat[0][0] = cos_theta; - mat[0][1] = sin_theta; - mat[1][0] = -sin_theta; - mat[1][1] = cos_theta; + mtxf_identity(mtx); + mtx[0][0] = cosAngle; + mtx[0][1] = sinAngle; + mtx[1][0] = -sinAngle; + mtx[1][1] = cosAngle; /* - * cos_theta, sin_theta, 0, 0, - * -sin_theta, cos_theta, 0, 0, - * 0, 0, 1, 0, - * 0, 0, 0, 1 + * cosAngle, sinAngle, 0, 0, + * -sinAngle, cosAngle, 0, 0, + * 0, 0, 1, 0, + * 0, 0, 0, 1 */ } -void func_802B5B14(Vec3f b, Vec3s rotate) { +UNUSED void func_802B5B14(Vec3f b, Vec3s rotate) { Mat4 mtx; Vec3f copy; @@ -408,95 +507,124 @@ void func_802B5B14(Vec3f b, Vec3s rotate) { b[2] = copy[0] * mtx[2][0] + copy[1] * mtx[2][1] + copy[1] * mtx[2][2]; } -void func_802B5CAC(s16 arg0, s16 arg1, Vec3f arg2) { - f32 sp2C = sins(arg1); - f32 sp28 = coss(arg1); - f32 sp24 = sins(arg0); - f32 temp_f10 = coss(arg0); - - arg2[0] = sp28 * sp24; - arg2[1] = sp2C; - arg2[2] = -(sp28 * temp_f10); +// rotates (0, 0, -1) about the x and y axis, in that order +void vec_unit_z_rotX_rotY(s16 rotY, s16 rotX, Vec3f arg2) { + f32 sinX = sins(rotX); + f32 cosX = coss(rotX); + f32 sinY = sins(rotY); + f32 cosY = coss(rotY); + + arg2[0] = cosX * sinY; + arg2[1] = sinX; + arg2[2] = -(cosX * cosY); + // (0, 0, -1) -> (0, sinX, -cosX) -> (cosX * sinY, sinX, -(cosX * cosY)) } -void func_802B5D30(s16 arg0, s16 arg1, s32 arg2) { - func_802B5D64((Lights1*) 0x9000000, arg0, arg1, arg2); +UNUSED void func_802B5D30(s16 arg0, s16 arg1, s32 arg2) { + set_course_lighting((Lights1*) 0x9000000, arg0, arg1, arg2); } -void func_802B5D64(Lights1* addr, s16 arg1, s16 arg2, s32 arg3) { - u32 segment = SEGMENT_NUMBER2(addr); - u32 offset = SEGMENT_OFFSET(addr); +/* + * @brief Set the course lighting object + * Uses a directional light, rotates by Y, then X + * + * @param lightAddr + * @param rotateAngleY + * @param rotateAngleX + * @param lightCount Always 1 in practice + */ +void set_course_lighting(Lights1* lightAddr, s16 rotateAngleY, s16 rotateAngleX, s32 lightCount) { + u32 segment = SEGMENT_NUMBER2(lightAddr); + u32 offset = SEGMENT_OFFSET(lightAddr); UNUSED s32 pad; - f32 sp48; - f32 sp44; - f32 sp40; + f32 sinAngleX; + f32 cosAngleX; + f32 sinAngleY; UNUSED s32 pad2[2]; - f32 temp_f10; - s32 var_v0; - s8 sp2C[3]; - Lights1* var_s0; - - var_s0 = (Lights1*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); - sp48 = sins(arg2); - sp44 = coss(arg2); - sp40 = sins(arg1); - temp_f10 = coss(arg1); - sp2C[0] = sp44 * sp40 * 120.0f; - sp2C[1] = 120.0f * sp48; - sp2C[2] = sp44 * temp_f10 * -120.0f; - for (var_v0 = 0; var_v0 < arg3; var_v0++, var_s0++) { - var_s0->l[0].l.dir[0] = sp2C[0]; - var_s0->l[0].l.dir[1] = sp2C[1]; - var_s0->l[0].l.dir[2] = sp2C[2]; + f32 cosAngleY; + s32 lightIdx; + s8 lightAngle[3]; + Lights1* lights; + + lights = (Lights1*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + sinAngleX = sins(rotateAngleX); + cosAngleX = coss(rotateAngleX); + sinAngleY = sins(rotateAngleY); + cosAngleY = coss(rotateAngleY); + // take (0, 0, 1), rotate by Y, then X + lightAngle[0] = cosAngleX * sinAngleY * 120.0f; + lightAngle[1] = 120.0f * sinAngleX; + lightAngle[2] = cosAngleX * cosAngleY * -120.0f; + for (lightIdx = 0; lightIdx < lightCount; lightIdx++, lights++) { + lights->l[0].l.dir[0] = lightAngle[0]; + lights->l[0].l.dir[1] = lightAngle[1]; + lights->l[0].l.dir[2] = lightAngle[2]; } } -// multiply a matrix with a number -void mtxf_scale(Mat4 mat, f32 coef) { - mat[0][0] *= coef; - mat[1][0] *= coef; - mat[2][0] *= coef; - mat[0][1] *= coef; - mat[1][1] *= coef; - mat[2][1] *= coef; - mat[0][2] *= coef; - mat[1][2] *= coef; - mat[2][2] *= coef; +/* + * @brief Scale a matrix by a given coefficient + * @param mtx Matrix to scale + * @param coef Coefficient to use when scaling + */ +void mtxf_scale(Mat4 mtx, f32 coef) { + mtx[0][0] *= coef; + mtx[1][0] *= coef; + mtx[2][0] *= coef; + mtx[0][1] *= coef; + mtx[1][1] *= coef; + mtx[2][1] *= coef; + mtx[0][2] *= coef; + mtx[1][2] *= coef; + mtx[2][2] *= coef; } -// look like create a translation and rotation matrix with arg1 position and arg2 rotation -void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation) { - f32 sine1; - f32 cosine1; - f32 sine2; - f32 cosine2; - f32 sine3; - f32 cosine3; - - sine1 = sins(orientation[0]); - cosine1 = coss(orientation[0]); - sine2 = sins(orientation[1]); - cosine2 = coss(orientation[1]); - sine3 = sins(orientation[2]); - cosine3 = coss(orientation[2]); - out[0][0] = (cosine2 * cosine3) + ((sine1 * sine2) * sine3); - out[1][0] = (-cosine2 * sine3) + ((sine1 * sine2) * cosine3); - out[2][0] = cosine1 * sine2; - out[3][0] = pos[0]; - out[0][1] = cosine1 * sine3; - out[1][1] = cosine1 * cosine3; - out[2][1] = -sine1; - out[3][1] = pos[1]; - out[0][2] = (-sine2 * cosine3) + ((sine1 * cosine2) * sine3); - out[1][2] = (sine2 * sine3) + ((sine1 * cosine2) * cosine3); - out[2][2] = cosine1 * cosine2; - out[3][2] = pos[2]; - out[0][3] = 0.0f; - out[1][3] = 0.0f; - out[2][3] = 0.0f; - out[3][3] = 1.0f; +/* + * @brief Matrix for rotating about Z, X, Y axes (in order) then translating + * @param dest Matrix to output + * @param translate Vector to use for translation + * @param orientation Vector of 3 rotation angles (Rz, Rx, Ry) + */ +void mtxf_rotate_zxy_translate(Mat4 dest, Vec3f translate, Vec3s orientation) { + f32 sinX; + f32 cosX; + f32 sinY; + f32 cosY; + f32 sinZ; + f32 cosZ; + + sinX = sins(orientation[0]); + cosX = coss(orientation[0]); + sinY = sins(orientation[1]); + cosY = coss(orientation[1]); + sinZ = sins(orientation[2]); + cosZ = coss(orientation[2]); + dest[0][0] = (cosY * cosZ) + ((sinX * sinY) * sinZ); + dest[1][0] = (-cosY * sinZ) + ((sinX * sinY) * cosZ); + dest[2][0] = cosX * sinY; + dest[3][0] = translate[0]; + dest[0][1] = cosX * sinZ; + dest[1][1] = cosX * cosZ; + dest[2][1] = -sinX; + dest[3][1] = translate[1]; + dest[0][2] = (-sinY * cosZ) + ((sinX * cosY) * sinZ); + dest[1][2] = (sinY * sinZ) + ((sinX * cosY) * cosZ); + dest[2][2] = cosX * cosY; + dest[3][2] = translate[2]; + dest[0][3] = 0.0f; + dest[1][3] = 0.0f; + dest[2][3] = 0.0f; + dest[3][3] = 1.0f; } - +// Product of Z, X and Y rotation matrices and a translation matrix +/* | Cz Sz 0 0|| 1 0 0 0|| Cy 0 -Sy 0|| 1 0 0 0| + |-Sz Cz 0 0|| 0 Cx Sx 0|| 0 1 0 0|| 0 1 0 0| + | 0 0 1 0|| 0 -Sx Cx 0|| Sy 0 Cy 0|| 0 0 1 0| + | 0 0 0 1|| 0 0 0 1|| 0 0 0 1|| V0 V1 V2 1|*/ +/* | CyCz + SxSySz CxSz -SyCz + SxCySz 0| + =|-CySz + SxSyCz CxCz SySz + SxCyCz 0| + | CxSy -Sx CxCy 0| + | V0 V1 V2 1|*/ UNUSED void func_802B60B4(Mat4 arg0, Vec3s arg1, Vec3s arg2) { f32 sine1; f32 cosine1; @@ -570,114 +698,147 @@ UNUSED void func_802B6374(Vec3f arg0) { arg0[2] /= temp_f0; } -// translate the vector with a matrix -void mtxf_translate_vec3f_mat3(Vec3f pos, Mat3 mat) { - f32 new_x; - f32 new_y; - f32 new_z; - - new_x = (mat[0][0] * pos[0]) + (mat[0][1] * pos[1]) + (mat[0][2] * pos[2]); - new_y = (mat[1][0] * pos[0]) + (mat[1][1] * pos[1]) + (mat[1][2] * pos[2]); - new_z = (mat[2][0] * pos[0]) + (mat[2][1] * pos[1]) + (mat[2][2] * pos[2]); - - pos[0] = new_x; - pos[1] = new_y; - pos[2] = new_z; +/* + * @brief Given matrix M and vector v, calculates Mv + * @param vec Vector to transform + * @param mtx Matrix to use in transformation + */ +void mtxf_transform_vec3f_mat3(Vec3f vec, Mat3 mtx) { + f32 newX; + f32 newY; + f32 newZ; + + newX = (mtx[0][0] * vec[0]) + (mtx[0][1] * vec[1]) + (mtx[0][2] * vec[2]); + newY = (mtx[1][0] * vec[0]) + (mtx[1][1] * vec[1]) + (mtx[1][2] * vec[2]); + newZ = (mtx[2][0] * vec[0]) + (mtx[2][1] * vec[1]) + (mtx[2][2] * vec[2]); + + vec[0] = newX; + vec[1] = newY; + vec[2] = newZ; } -// translate the vector with a matrix (with a matrix 4x4) -void mtxf_translate_vec3f_mat4(Vec3f pos, Mat4 mat) { - f32 new_x; - f32 new_y; - f32 new_z; - - new_x = (mat[0][0] * pos[0]) + (mat[0][1] * pos[1]) + (mat[0][2] * pos[2]); - new_y = (mat[1][0] * pos[0]) + (mat[1][1] * pos[1]) + (mat[1][2] * pos[2]); - new_z = (mat[2][0] * pos[0]) + (mat[2][1] * pos[1]) + (mat[2][2] * pos[2]); - - pos[0] = new_x; - pos[1] = new_y; - pos[2] = new_z; +/* + * @brief Given matrix M and vector v, calculates Mv + * @param vec Vector to transform + * @param mtx Matrix to use in transformation + */ +void mtxf_transform_vec3f_mat4(Vec3f vec, Mat4 mat) { + f32 newX; + f32 newY; + f32 newZ; + + newX = (mat[0][0] * vec[0]) + (mat[0][1] * vec[1]) + (mat[0][2] * vec[2]); + newY = (mat[1][0] * vec[0]) + (mat[1][1] * vec[1]) + (mat[1][2] * vec[2]); + newZ = (mat[2][0] * vec[0]) + (mat[2][1] * vec[1]) + (mat[2][2] * vec[2]); + + vec[0] = newX; + vec[1] = newY; + vec[2] = newZ; } UNUSED void func_802B64B0(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3) { } -void func_802B64C4(Vec3f arg0, s16 arg1) { - f32 sp2C = sins(arg1); - f32 temp_f0 = coss(arg1); +/* + * @brief rotates a given vector about the Y axis by amount specified + * @param vec Vector to rotate + * @param angle + */ +void vec3f_rotate_y(Vec3f vec, s16 rotAngleY) { + f32 sinAngleY = sins(rotAngleY); + f32 cosAngleY = coss(rotAngleY); - f32 temp1 = arg0[0]; - f32 temp2 = arg0[1]; - f32 temp3 = arg0[2]; + f32 vecX = vec[0]; + f32 vecY = vec[1]; + f32 vecZ = vec[2]; - arg0[0] = temp_f0 * temp1 - (sp2C * temp3); - arg0[1] = temp2; - arg0[2] = sp2C * temp1 + (temp_f0 * temp3); + vec[0] = cosAngleY * vecX - (sinAngleY * vecZ); + vec[1] = vecY; + vec[2] = sinAngleY * vecX + (cosAngleY * vecZ); } +// Standard Y-axis rotation matrix multiplication +/* |Cy 0 -Sy||Vx| + * | 0 1 0||Vy| = |CyVx - SyVz, Vy, SyVx + CyVz| + * |Sy 0 Cy||Vz| + */ -void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 rotationAngle) { - Mat3 mtx_rot_y; - Mat3 matrix; - s32 i, j; +/* If cosAxisY is 1, this is just rotating around the Y axis, like in mtxf_rotate_y. Otherwise, + it intends to rotate about any axis by composing with a rotation matrix for an XZ axis rotation. + However, if Y is not 1 or -1, angle calculations break. It looks like cosAxisY might always + be 1, but that is not completely confirmed. + */ +void calculate_orientation_matrix(Mat3 dest, f32 axisZ, f32 cosAxisY, f32 axisX, s16 rotationAngle) { + Mat3 mtxRotY; + Mat3 mtxRotXZ; + s32 row, col; f32 a; - f32 b; - f32 c; - f32 d; + f32 axisNormedX; + UNUSED f32 c; + f32 axisNormedZ; UNUSED s32 pad[3]; f32 sinValue; - f32 cossValue; + f32 cosValue; sinValue = sins(rotationAngle); - cossValue = coss(rotationAngle); - mtx_rot_y[0][0] = cossValue; - mtx_rot_y[2][1] = 0; - mtx_rot_y[1][2] = 0; - - mtx_rot_y[1][1] = 1; - mtx_rot_y[2][0] = sinValue; - mtx_rot_y[0][2] = -sinValue; - - mtx_rot_y[2][2] = cossValue; - mtx_rot_y[1][0] = 0; - mtx_rot_y[0][1] = 0; - - if (arg2 == 1) { // set matrix to identity - - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - matrix[i][j] = (i == j) ? 1.0f : 0.0f; + cosValue = coss(rotationAngle); + mtxRotY[0][0] = cosValue; + mtxRotY[2][1] = 0; + mtxRotY[1][2] = 0; + + mtxRotY[1][1] = 1; + mtxRotY[2][0] = sinValue; + mtxRotY[0][2] = -sinValue; + + mtxRotY[2][2] = cosValue; + mtxRotY[1][0] = 0; + mtxRotY[0][1] = 0; + + /* Standard rotation matrix + [cos, 0, -sin] + [ 0, 1, 0] + [sin, 0, cos] + */ + + if (cosAxisY == 1) { // set matrix to identity + + for (row = 0; row < 3; row++) { + for (col = 0; col < 3; col++) { + mtxRotXZ[row][col] = (row == col) ? 1.0f : 0.0f; } } - } else if (arg2 == -1) { // set matrix to identity with the second column negative + } else if (cosAxisY == -1) { // set matrix to identity with the second column negative - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - matrix[i][j] = (i == j) ? 1.0f : 0.0f; + for (row = 0; row < 3; row++) { + for (col = 0; col < 3; col++) { + mtxRotXZ[row][col] = (row == col) ? 1.0f : 0.0f; } } - matrix[1][1] = -1; + mtxRotXZ[1][1] = -1; } else { - a = (f32) - (360.0 - ((f64) (calculate_vector_angle_xy(arg2) * 180.0f) / M_PI)); - b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3)); - c = 0; - d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3)); - calculate_rotation_matrix(matrix, a, b, c, d); + /* This looks like it is meant to convert from radians to degrees, but acos1f returns N64-units, not radians + suggesting this is never used because it would give wildly incorrect values. Not sure this ever actually gets + called because cosAxisY is usually 1*/ + a = (f32) - (360.0 - ((f64) (acos1f(cosAxisY) * 180.0f) / M_PI)); + axisNormedX = -axisX / sqrtf((axisZ * axisZ) + (axisX * axisX)); + axisNormedZ = axisZ / sqrtf((axisZ * axisZ) + (axisX * axisX)); + calculate_rotation_matrix(mtxRotXZ, a, axisNormedX, 0, + axisNormedZ); // rotates around something in the x-z plane } - dest[0][0] = (mtx_rot_y[0][0] * matrix[0][0]) + (mtx_rot_y[0][1] * matrix[1][0]) + (mtx_rot_y[0][2] * matrix[2][0]); - dest[1][0] = (mtx_rot_y[1][0] * matrix[0][0]) + (mtx_rot_y[1][1] * matrix[1][0]) + (mtx_rot_y[1][2] * matrix[2][0]); - dest[2][0] = (mtx_rot_y[2][0] * matrix[0][0]) + (mtx_rot_y[2][1] * matrix[1][0]) + (mtx_rot_y[2][2] * matrix[2][0]); - - dest[0][1] = (mtx_rot_y[0][0] * matrix[0][1]) + (mtx_rot_y[0][1] * matrix[1][1]) + (mtx_rot_y[0][2] * matrix[2][1]); - dest[1][1] = (mtx_rot_y[1][0] * matrix[0][1]) + (mtx_rot_y[1][1] * matrix[1][1]) + (mtx_rot_y[1][2] * matrix[2][1]); - dest[2][1] = (mtx_rot_y[2][0] * matrix[0][1]) + (mtx_rot_y[2][1] * matrix[1][1]) + (mtx_rot_y[2][2] * matrix[2][1]); - - dest[0][2] = (mtx_rot_y[0][0] * matrix[0][2]) + (mtx_rot_y[0][1] * matrix[1][2]) + (mtx_rot_y[0][2] * matrix[2][2]); - dest[1][2] = (mtx_rot_y[1][0] * matrix[0][2]) + (mtx_rot_y[1][1] * matrix[1][2]) + (mtx_rot_y[1][2] * matrix[2][2]); - dest[2][2] = (mtx_rot_y[2][0] * matrix[0][2]) + (mtx_rot_y[2][1] * matrix[1][2]) + (mtx_rot_y[2][2] * matrix[2][2]); + // mtxRotY * matrixRotXZ + dest[0][0] = (mtxRotY[0][0] * mtxRotXZ[0][0]) + (mtxRotY[0][1] * mtxRotXZ[1][0]) + (mtxRotY[0][2] * mtxRotXZ[2][0]); + dest[1][0] = (mtxRotY[1][0] * mtxRotXZ[0][0]) + (mtxRotY[1][1] * mtxRotXZ[1][0]) + (mtxRotY[1][2] * mtxRotXZ[2][0]); + dest[2][0] = (mtxRotY[2][0] * mtxRotXZ[0][0]) + (mtxRotY[2][1] * mtxRotXZ[1][0]) + (mtxRotY[2][2] * mtxRotXZ[2][0]); + + dest[0][1] = (mtxRotY[0][0] * mtxRotXZ[0][1]) + (mtxRotY[0][1] * mtxRotXZ[1][1]) + (mtxRotY[0][2] * mtxRotXZ[2][1]); + dest[1][1] = (mtxRotY[1][0] * mtxRotXZ[0][1]) + (mtxRotY[1][1] * mtxRotXZ[1][1]) + (mtxRotY[1][2] * mtxRotXZ[2][1]); + dest[2][1] = (mtxRotY[2][0] * mtxRotXZ[0][1]) + (mtxRotY[2][1] * mtxRotXZ[1][1]) + (mtxRotY[2][2] * mtxRotXZ[2][1]); + + dest[0][2] = (mtxRotY[0][0] * mtxRotXZ[0][2]) + (mtxRotY[0][1] * mtxRotXZ[1][2]) + (mtxRotY[0][2] * mtxRotXZ[2][2]); + dest[1][2] = (mtxRotY[1][0] * mtxRotXZ[0][2]) + (mtxRotY[1][1] * mtxRotXZ[1][2]) + (mtxRotY[1][2] * mtxRotXZ[2][2]); + dest[2][2] = (mtxRotY[2][0] * mtxRotXZ[0][2]) + (mtxRotY[2][1] * mtxRotXZ[1][2]) + (mtxRotY[2][2] * mtxRotXZ[2][2]); } // include in calculate_orientation_matrix @@ -703,7 +864,7 @@ UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) { } matrix[1][1] = -1.0f; } else { - a = (f32) - (360.0 - ((f64) (calculate_vector_angle_xy(arg2) * 180.0f) / M_PI)); + a = (f32) - (360.0 - ((f64) (acos1f(arg2) * 180.0f) / M_PI)); b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3)); c = 0; d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3)); @@ -711,41 +872,50 @@ UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) { } } -void calculate_rotation_matrix(Mat3 destMatrix, s16 rotationAngle, f32 rotationX, f32 rotationY, f32 rotationZ) { +/* + * @brief Rotates a given vector about a given axis by amount specified + * @param destMatrix Overriden with the resulting matrix + * @param rotationAngle Angle to rotate (in N64 units) + * @param axisX The X component of the axis to rotate around + * @param axisY The Y component of the axis to rotate around + * @param axisZ The Z component of the axis to rotate around + */ +// Standard algorithm, but unintuitive. "Rotation matrix from axis and angle" brings up info online +void calculate_rotation_matrix(Mat3 destMatrix, s16 rotationAngle, f32 axisX, f32 axisY, f32 axisZ) { f32 sinValue; - f32 cossValue; - f32 temp_f12; - f32 temp_f10; - f32 temp_f2; + f32 cosValue; f32 temp; + f32 valueZX; + f32 valueYZ; + f32 valueXY; UNUSED s32 pad[2]; sinValue = sins((u16) rotationAngle); - cossValue = coss((u16) rotationAngle); + cosValue = coss((u16) rotationAngle); - temp_f12 = 1.0f - cossValue; + temp = 1.0f - cosValue; - temp_f10 = (rotationZ * rotationX) * temp_f12; - temp_f2 = (rotationY * rotationZ) * temp_f12; - temp = ((rotationX * rotationY) * temp_f12); + valueZX = (axisZ * axisX) * temp; + valueYZ = (axisY * axisZ) * temp; + valueXY = (axisX * axisY) * temp; - temp_f12 = rotationX * rotationX; - destMatrix[0][0] = ((1.0f - temp_f12) * cossValue) + temp_f12; - destMatrix[2][1] = temp_f2 - (rotationX * sinValue); - destMatrix[1][2] = temp_f2 + (rotationX * sinValue); + temp = axisX * axisX; + destMatrix[0][0] = ((1.0f - temp) * cosValue) + temp; + destMatrix[2][1] = valueYZ - (axisX * sinValue); + destMatrix[1][2] = valueYZ + (axisX * sinValue); - temp_f12 = rotationY * rotationY; - destMatrix[1][1] = (((1.0f - temp_f12) * cossValue) + temp_f12); - destMatrix[2][0] = temp_f10 + (rotationY * sinValue); - destMatrix[0][2] = temp_f10 - (rotationY * sinValue); + temp = axisY * axisY; + destMatrix[1][1] = (((1.0f - temp) * cosValue) + temp); + destMatrix[2][0] = valueZX + (axisY * sinValue); + destMatrix[0][2] = valueZX - (axisY * sinValue); - temp_f12 = rotationZ * rotationZ; - destMatrix[2][2] = (((1.0f - temp_f12) * cossValue) + temp_f12); - destMatrix[1][0] = temp - (rotationZ * sinValue); - destMatrix[0][1] = temp + (rotationZ * sinValue); + temp = axisZ * axisZ; + destMatrix[2][2] = (((1.0f - temp) * cosValue) + temp); + destMatrix[1][0] = valueXY - (axisZ * sinValue); + destMatrix[0][1] = valueXY + (axisZ * sinValue); } -void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) { +UNUSED void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) { f32 sine; f32 cosine; f32 temp_f0; @@ -783,7 +953,7 @@ void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) { } // look like create a translation and rotation matrix with arg1 position and arg2 rotation -void func_802B6D58(Mat4 arg0, Vec3f arg1, Vec3f arg2) { +UNUSED void func_802B6D58(Mat4 arg0, Vec3f arg1, Vec3f arg2) { f32 sine1; f32 cosine1; f32 sine2; @@ -815,40 +985,46 @@ void func_802B6D58(Mat4 arg0, Vec3f arg1, Vec3f arg2) { arg0[3][3] = 1.0f; } -void mtxf_multiplication(Mat4 dest, Mat4 mat1, Mat4 mat2) { +/** + * @brief Multiply two 4x4 matrices + * @param dest Result of multiplication is saved here + * @param mtxLeft Left matrix in product + * @param mtxRight Right matrix to product + */ +void mtxf_multiplication(Mat4 dest, Mat4 mtxLeft, Mat4 mtxRight) { Mat4 product; - product[0][0] = - (mat1[0][0] * mat2[0][0]) + (mat1[0][1] * mat2[1][0]) + (mat1[0][2] * mat2[2][0]) + (mat1[0][3] * mat2[3][0]); - product[0][1] = - (mat1[0][0] * mat2[0][1]) + (mat1[0][1] * mat2[1][1]) + (mat1[0][2] * mat2[2][1]) + (mat1[0][3] * mat2[3][1]); - product[0][2] = - (mat1[0][0] * mat2[0][2]) + (mat1[0][1] * mat2[1][2]) + (mat1[0][2] * mat2[2][2]) + (mat1[0][3] * mat2[3][2]); - product[0][3] = - (mat1[0][0] * mat2[0][3]) + (mat1[0][1] * mat2[1][3]) + (mat1[0][2] * mat2[2][3]) + (mat1[0][3] * mat2[3][3]); - product[1][0] = - (mat1[1][0] * mat2[0][0]) + (mat1[1][1] * mat2[1][0]) + (mat1[1][2] * mat2[2][0]) + (mat1[1][3] * mat2[3][0]); - product[1][1] = - (mat1[1][0] * mat2[0][1]) + (mat1[1][1] * mat2[1][1]) + (mat1[1][2] * mat2[2][1]) + (mat1[1][3] * mat2[3][1]); - product[1][2] = - (mat1[1][0] * mat2[0][2]) + (mat1[1][1] * mat2[1][2]) + (mat1[1][2] * mat2[2][2]) + (mat1[1][3] * mat2[3][2]); - product[1][3] = - (mat1[1][0] * mat2[0][3]) + (mat1[1][1] * mat2[1][3]) + (mat1[1][2] * mat2[2][3]) + (mat1[1][3] * mat2[3][3]); - product[2][0] = - (mat1[2][0] * mat2[0][0]) + (mat1[2][1] * mat2[1][0]) + (mat1[2][2] * mat2[2][0]) + (mat1[2][3] * mat2[3][0]); - product[2][1] = - (mat1[2][0] * mat2[0][1]) + (mat1[2][1] * mat2[1][1]) + (mat1[2][2] * mat2[2][1]) + (mat1[2][3] * mat2[3][1]); - product[2][2] = - (mat1[2][0] * mat2[0][2]) + (mat1[2][1] * mat2[1][2]) + (mat1[2][2] * mat2[2][2]) + (mat1[2][3] * mat2[3][2]); - product[2][3] = - (mat1[2][0] * mat2[0][3]) + (mat1[2][1] * mat2[1][3]) + (mat1[2][2] * mat2[2][3]) + (mat1[2][3] * mat2[3][3]); - product[3][0] = - (mat1[3][0] * mat2[0][0]) + (mat1[3][1] * mat2[1][0]) + (mat1[3][2] * mat2[2][0]) + (mat1[3][3] * mat2[3][0]); - product[3][1] = - (mat1[3][0] * mat2[0][1]) + (mat1[3][1] * mat2[1][1]) + (mat1[3][2] * mat2[2][1]) + (mat1[3][3] * mat2[3][1]); - product[3][2] = - (mat1[3][0] * mat2[0][2]) + (mat1[3][1] * mat2[1][2]) + (mat1[3][2] * mat2[2][2]) + (mat1[3][3] * mat2[3][2]); - product[3][3] = - (mat1[3][0] * mat2[0][3]) + (mat1[3][1] * mat2[1][3]) + (mat1[3][2] * mat2[2][3]) + (mat1[3][3] * mat2[3][3]); + product[0][0] = (mtxLeft[0][0] * mtxRight[0][0]) + (mtxLeft[0][1] * mtxRight[1][0]) + + (mtxLeft[0][2] * mtxRight[2][0]) + (mtxLeft[0][3] * mtxRight[3][0]); + product[0][1] = (mtxLeft[0][0] * mtxRight[0][1]) + (mtxLeft[0][1] * mtxRight[1][1]) + + (mtxLeft[0][2] * mtxRight[2][1]) + (mtxLeft[0][3] * mtxRight[3][1]); + product[0][2] = (mtxLeft[0][0] * mtxRight[0][2]) + (mtxLeft[0][1] * mtxRight[1][2]) + + (mtxLeft[0][2] * mtxRight[2][2]) + (mtxLeft[0][3] * mtxRight[3][2]); + product[0][3] = (mtxLeft[0][0] * mtxRight[0][3]) + (mtxLeft[0][1] * mtxRight[1][3]) + + (mtxLeft[0][2] * mtxRight[2][3]) + (mtxLeft[0][3] * mtxRight[3][3]); + product[1][0] = (mtxLeft[1][0] * mtxRight[0][0]) + (mtxLeft[1][1] * mtxRight[1][0]) + + (mtxLeft[1][2] * mtxRight[2][0]) + (mtxLeft[1][3] * mtxRight[3][0]); + product[1][1] = (mtxLeft[1][0] * mtxRight[0][1]) + (mtxLeft[1][1] * mtxRight[1][1]) + + (mtxLeft[1][2] * mtxRight[2][1]) + (mtxLeft[1][3] * mtxRight[3][1]); + product[1][2] = (mtxLeft[1][0] * mtxRight[0][2]) + (mtxLeft[1][1] * mtxRight[1][2]) + + (mtxLeft[1][2] * mtxRight[2][2]) + (mtxLeft[1][3] * mtxRight[3][2]); + product[1][3] = (mtxLeft[1][0] * mtxRight[0][3]) + (mtxLeft[1][1] * mtxRight[1][3]) + + (mtxLeft[1][2] * mtxRight[2][3]) + (mtxLeft[1][3] * mtxRight[3][3]); + product[2][0] = (mtxLeft[2][0] * mtxRight[0][0]) + (mtxLeft[2][1] * mtxRight[1][0]) + + (mtxLeft[2][2] * mtxRight[2][0]) + (mtxLeft[2][3] * mtxRight[3][0]); + product[2][1] = (mtxLeft[2][0] * mtxRight[0][1]) + (mtxLeft[2][1] * mtxRight[1][1]) + + (mtxLeft[2][2] * mtxRight[2][1]) + (mtxLeft[2][3] * mtxRight[3][1]); + product[2][2] = (mtxLeft[2][0] * mtxRight[0][2]) + (mtxLeft[2][1] * mtxRight[1][2]) + + (mtxLeft[2][2] * mtxRight[2][2]) + (mtxLeft[2][3] * mtxRight[3][2]); + product[2][3] = (mtxLeft[2][0] * mtxRight[0][3]) + (mtxLeft[2][1] * mtxRight[1][3]) + + (mtxLeft[2][2] * mtxRight[2][3]) + (mtxLeft[2][3] * mtxRight[3][3]); + product[3][0] = (mtxLeft[3][0] * mtxRight[0][0]) + (mtxLeft[3][1] * mtxRight[1][0]) + + (mtxLeft[3][2] * mtxRight[2][0]) + (mtxLeft[3][3] * mtxRight[3][0]); + product[3][1] = (mtxLeft[3][0] * mtxRight[0][1]) + (mtxLeft[3][1] * mtxRight[1][1]) + + (mtxLeft[3][2] * mtxRight[2][1]) + (mtxLeft[3][3] * mtxRight[3][1]); + product[3][2] = (mtxLeft[3][0] * mtxRight[0][2]) + (mtxLeft[3][1] * mtxRight[1][2]) + + (mtxLeft[3][2] * mtxRight[2][2]) + (mtxLeft[3][3] * mtxRight[3][2]); + product[3][3] = (mtxLeft[3][0] * mtxRight[0][3]) + (mtxLeft[3][1] * mtxRight[1][3]) + + (mtxLeft[3][2] * mtxRight[2][3]) + (mtxLeft[3][3] * mtxRight[3][3]); mtxf_copy_n_element((s32*) dest, (s32*) product, 16); } @@ -881,17 +1057,23 @@ void mtxf_to_mtx(Mtx* dest, Mat4 src) { #endif } -/** - * Comment from sm64 unverified. mk64 verison is modified - * +/* * Helper function for atan2s. Does a look up of the arctangent of y/x assuming * the resulting angle is in range [0, 0x2000] (1/8 of a circle). + * Note that this is only called by atan2s, guaranteeing that y <= x + * If y > x, it will cause out of bounds issues + * + * @brief Finds the arctan angle (in N64 units) given x, y coordinates + * @param y y coordinate + * @param x x coordinate + * @return arctan(y/x) (in N64 units) */ - u16 atan2_lookup(f32 y, f32 x) { u16 ret; if (x == 0) { + /* In a vacuum this would be incorrect. But, it works with how atan2s + is implemented, which is the only place this function is called*/ ret = gArctanTable[0]; } else { if (1000000.0f < y / x) { @@ -907,50 +1089,56 @@ u16 atan2_lookup(f32 y, f32 x) { return ret; } -/** +/* * Compute the angle from (0, 0) to (x, y) as a u16. Given that terrain is in * the xz-plane, this is commonly called with (z, x) to get a yaw angle. * sm64 but x, y swapped and returns u16. + + * @brief Finds the arctan angle (in N64 units) given x, y coordinates + * @param y y coordinate + * @param x x coordinate + * @return arctan(y/x) (in N64 units) */ -u16 atan2s(f32 x, f32 y) { +u16 atan2s(f32 y, f32 x) { u16 ret; - if (x >= 0) { - if (y >= 0) { - if (y >= x) { - ret = atan2_lookup(x, y); + if (y >= 0) { + if (x >= 0) { + if (x >= y) { + ret = atan2_lookup(y, x); } else { - ret = 0x4000 - atan2_lookup(y, x); + ret = 0x4000 - atan2_lookup(x, y); } } else { - y = -y; - if (y < x) { - ret = 0x4000 + atan2_lookup(y, x); + x = -x; + if (x < y) { + ret = 0x4000 + atan2_lookup(x, y); } else { - ret = 0x8000 - atan2_lookup(x, y); + ret = 0x8000 - atan2_lookup(y, x); } } } else { - x = -x; - if (y < 0) { - y = -y; - if (y >= x) { - ret = 0x8000 + atan2_lookup(x, y); + y = -y; + if (x < 0) { + x = -x; + if (x >= y) { + ret = 0x8000 + atan2_lookup(y, x); } else { - ret = 0xC000 - atan2_lookup(y, x); + ret = 0xC000 - atan2_lookup(x, y); } } else { - if (y < x) { - ret = 0xC000 + atan2_lookup(y, x); + if (x < y) { + ret = 0xC000 + atan2_lookup(x, y); } else { - ret = -atan2_lookup(x, y); + ret = -atan2_lookup(y, x); } } } return ret; } -f32 atan2f(f32 arg0, f32 arg1) { - return atan2s(arg0, arg1); +// @brief see atan2s +f32 atan2f(f32 y, f32 x) { + return atan2s(y, x); } #ifndef NON_MATCHING // The decomp does not support fabs @@ -1003,21 +1191,47 @@ UNUSED u16 func_802B7B50(f32 arg0, f32 arg1) { UNUSED void func_802B7C18(f32 arg0) { atan2f(arg0, 1.0f); } - -s16 func_802B7C40(f32 arg0) { - return atan2s(arg0, 1.0f); +/* + * @brief Finds the arctan angle (in N64 units) given the tangent + * @param tan Tangent of an angle + * @return arctan(tan) (in N64 units) + */ +s16 atan1s(f32 tan) { + return atan2s(tan, 1.0f); } UNUSED void func_802B7C6C(f32 arg0) { atan2f(arg0, sqrtf(1.0 - (arg0 * arg0))); } -s16 func_802B7CA8(f32 arg0) { - return atan2s(arg0, sqrtf(1.0 - (arg0 * arg0))); +/* + * @brief Finds the arcsin (in N64 units) of a value (assuming positive cosine) + * @param value Value to find the arcsin of + * @return arcsin(value) + */ +s16 asin1s(f32 value) { + return atan2s(value, sqrtf(1.0 - (value * value))); + /* if value = sin(Angle), we have + = asin(sin(Angle) / sqrt(1 - sin**2(Angle))) + = atan(sin(Angle) / sqrt(cos**2(Angle))) + = atan(sin(Angle) / cos(Angle)) + = atan(tan(Angle)) + = Angle */ } -f32 calculate_vector_angle_xy(f32 vectorX) { - return atan2f(sqrtf(1.0 - (vectorX * vectorX)), vectorX); +/* + * @brief Finds the arccos angle (in N64 units) of a value (assuming positive sine) + * @param value Value to find the arccos of + * @return arccos(value) + */ +f32 acos1f(f32 value) { + return atan2f(sqrtf(1.0 - (value * value)), value); + /* if value = cos(Angle), we have + = atan(sqrt(1 - cos**2(Angle)) / cos(Angle)) + = atan(sqrt(sin**2(Angle)) / cos(Angle)) + = atan(sin(Angle) / cos(Angle)) + = atan(tan(Angle)) + = Angle */ } UNUSED s16 func_802B7D28(f32 arg0) { @@ -1056,126 +1270,162 @@ u16 random_int(u16 arg0) { return arg0 * (((f32) random_u16()) / 65535.0); } -s16 func_802B7F34(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { - return atan2s(arg2 - arg0, arg3 - arg1); +/* + * @brief Find the angle (in N64 units) between two points given their coords + * @param fromY The y coordinate of the point the angle is measured from + * @param fromX The x coordinate of the point the angle is measured from + * @param toY The y coordinate of the point the angle is measured to + * @param toX The x coordinate of the point the angle is measured to + * @return The angle (in N64 units) of the line from the from-point, to the to-point + */ +s16 get_angle_between_coords(f32 fromY, f32 fromX, f32 toY, f32 toX) { + return atan2s(toY - fromY, toX - fromX); } -void func_802B7F7C(Vec3f arg0, Vec3f arg1, Vec3s dest) { - f32 x1 = arg0[0]; - f32 y1 = arg0[1]; - f32 z1 = arg0[2]; - - f32 x2 = arg1[0]; - f32 y2 = arg1[1]; - f32 z2 = arg1[2]; - - dest[1] = func_802B7F34(z1, x1, z2, x2); - dest[0] = func_802B7F34(y1, z1, y2, z2); - dest[2] = func_802B7F34(x1, y1, x2, y2); +/* + * @brief Find the planar angles (in N64 units) between two points given their positions + * @param from The coordinates of the point the angle is measured from + * @param to The coordinate of the point the angle is measured to + * @param rotAngles Overwritten with the angles between the two points in the coordinate planes (yz, xz, xy) + */ +void planar_angles(Vec3f from, Vec3f to, Vec3s rotAngles) { + f32 fromX = from[0]; + f32 fromY = from[1]; + f32 fromZ = from[2]; + + f32 toX = to[0]; + f32 toY = to[1]; + f32 toZ = to[2]; + + rotAngles[1] = get_angle_between_coords(fromZ, fromX, toZ, toX); + rotAngles[0] = get_angle_between_coords(fromY, fromZ, toY, toZ); + rotAngles[2] = get_angle_between_coords(fromX, fromY, toX, toY); } -f32 sins(u16 arg0) { - return gSineTable[arg0 >> 4]; +/* + * @brief Get the sine of an angle + * @param angle Angle (in N64 units) + * @return sin(angle) + */ +f32 sins(u16 angle) { + return gSineTable[angle >> 4]; } -f32 coss(u16 arg0) { - return gCosineTable[arg0 >> 4]; +/* + * @brief Get the cosine of an angle + * @param angle angle (in N64 units) + * @return sin(angle) + */ +f32 coss(u16 angle) { + return gCosineTable[angle >> 4]; } -s32 is_visible_between_angle(u16 arg0, u16 arg1, u16 arg2) { - if (arg1 < arg0) { - if (arg1 >= arg2) { +/* + * @brief Checks if angle is between 2 specified angles + * @param angleCCW The counter-clockwise angle + * @param angleCW The clockwise angle + * @param angleToCheck The angle to check is between the other angles + * @return 1 if angleToCheck is between the other angles, 0 otherwise + */ +s32 is_between_angle(u16 angleCCW, u16 angleCW, u16 angleToCheck) { + if (angleCW < angleCCW) { + if (angleCW >= angleToCheck) { return 0; } - if (arg2 >= arg0) { + if (angleToCheck >= angleCCW) { return 0; } } else { - if ((arg1 >= arg2) && (arg2 >= arg0)) { + // angle straddles 0 angle + if ((angleCW >= angleToCheck) && (angleToCheck >= angleCCW)) { return 0; } } return 1; } -/** - * Determines whether an object is within the render distance of a camera. +/* + * @brief Finds the xz-distance squared between a point and the camera, if the point is visible (or near visible) to + * the camera * - * @param cameraPos The position of the camera in 3D space. - * @param objectPos The position of the object in 3D space. - * @param orientationY The orientation angle of the object around the Y-axis. - * @param minDistance The minimum distance at which the object is considered within render distance. - * @param fov The field of view (FOV) of the camera. - * @param maxDistance The maximum render distance. - * @return The distance between the camera and the object if it's within render distance, - * or -1.0f if it exceeds the render distance. + * @param cameraPos The position of the camera in 3D space. + * @param objectPos The position of the object in 3D space. + * @param orientationY The orientation angle of the object around the Y-axis. + * @param preloadDistanceSquared Consider an object within this distance of viweable area as renderable + * @param fovDegrees The field of view (FOV) of the camera (degrees). + * @param maxDistanceSquared The maximum render distance. + * @return The xz-distance squared between the camera and the object if it's within render + distance of the camera's vision, or -1.0f if it exceeds the render distance. */ -f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, - f32 maxDistance) { +f32 distance_if_visible(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 preloadDistanceSquared, f32 fovDegrees, + f32 maxDistanceSquared) { u16 angleObject; UNUSED u16 pad; - u16 temp_v0; - f32 distanceX; - f32 distance; - f32 distanceY; - s32 plus_fov_angle; - s32 minus_fov_angle; - u16 temp; + u16 preloadAngle; + f32 distanceXSquared; + f32 distanceSquared; + f32 distanceZSquared; + s32 plusFovAngle; + s32 minusFovAngle; + u16 adjustedAngle; UNUSED s32 pad2[3]; - u16 extended_fov = ((u16) fov * 0xB6); + u16 fovUnits = ((u16) fovDegrees * 182); // degrees to angle units (182 * 360 ~= 2**16) - distanceX = objectPos[0] - cameraPos[0]; - distanceX = distanceX * distanceX; - if (maxDistance < distanceX) { + distanceXSquared = objectPos[0] - cameraPos[0]; + distanceXSquared = distanceXSquared * distanceXSquared; + if (maxDistanceSquared < distanceXSquared) { return -1.0f; } - distanceY = objectPos[2] - cameraPos[2]; - distanceY = distanceY * distanceY; - if (maxDistance < distanceY) { + distanceZSquared = objectPos[2] - cameraPos[2]; + distanceZSquared = distanceZSquared * distanceZSquared; + if (maxDistanceSquared < distanceZSquared) { return -1.0f; } - distance = distanceX + distanceY; - if (distance < minDistance) { - return distance; + distanceSquared = distanceXSquared + distanceZSquared; + if (distanceSquared < preloadDistanceSquared) { + return distanceSquared; } - if (distance > maxDistance) { + if (distanceSquared > maxDistanceSquared) { return -1.0f; } - angleObject = get_angle_between_two_vectors(cameraPos, objectPos); - minus_fov_angle = (orientationY - extended_fov); - plus_fov_angle = (orientationY + extended_fov); + angleObject = get_xz_angle_between_points(cameraPos, objectPos); + minusFovAngle = (orientationY - fovUnits); + plusFovAngle = (orientationY + fovUnits); - if (minDistance == 0.0f) { - if (is_visible_between_angle((orientationY + extended_fov), (orientationY - extended_fov), angleObject) == 1) { - return distance; + if (preloadDistanceSquared == 0.0f) { + if (is_between_angle((orientationY + fovUnits), (orientationY - fovUnits), angleObject) == 1) { + return distanceSquared; } return -1.0f; } - if (is_visible_between_angle((u16) plus_fov_angle, (u16) minus_fov_angle, angleObject) == 1) { - return distance; + if (is_between_angle((u16) plusFovAngle, (u16) minusFovAngle, angleObject) == 1) { + return distanceSquared; } - temp_v0 = func_802B7CA8(minDistance / distance); - temp = angleObject + temp_v0; - if (is_visible_between_angle(plus_fov_angle, minus_fov_angle, temp) == 1) { - return distance; + /* This is bugged. This gives asin((sin(theta)**2) instead of asin(sin(theta)) = theta. + Probably unnoticed because it only deals with objects not on screen*/ + preloadAngle = asin1s(preloadDistanceSquared / distanceSquared); + adjustedAngle = angleObject + preloadAngle; + + if (is_between_angle(plusFovAngle, minusFovAngle, adjustedAngle) == 1) { + return distanceSquared; } - temp = angleObject - temp_v0; - if (is_visible_between_angle(plus_fov_angle, minus_fov_angle, temp) == 1) { - return distance; + adjustedAngle = angleObject - preloadAngle; + if (is_between_angle(plusFovAngle, minusFovAngle, adjustedAngle) == 1) { + return distanceSquared; } return -1.0f; } // No idea if arg1 is actually a Mat4 or not, but since this function is unused -// its impossible to know with certainty either way, very close of func_802B5D64 +// its impossible to know with certainty either way, very close of set_course_lighting UNUSED void func_802B8414(uintptr_t addr, Mat4 arg1, s16 arg2, s16 arg3, s32 arg4) { u32 segment = SEGMENT_NUMBER2(addr); u32 offset = SEGMENT_OFFSET(addr); @@ -1204,54 +1454,38 @@ UNUSED void func_802B8414(uintptr_t addr, Mat4 arg1, s16 arg2, s16 arg3, s32 arg } } -#ifdef MIPS_TO_C -// generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-29-2023 -void func_802B8614(Player* arg0) { - f64 sp78; - f64 sp70; - f64 sp68; - f64 sp58; - f64 sp50; - f64 sp48; - f64 sp40; - f64 sp38; - f64 temp_f12; - f64 temp_f14; - f64 temp_f16; - f64 temp_f18; - f64 temp_f20; - f64 temp_f2; - f64 temp_f30; - f64 temp_f4; - f64 temp_f6; - - temp_f6 = (f64) arg0->tyres[FRONT_RIGHT].pos[0]; - sp78 = temp_f6; - sp70 = (f64) arg0->tyres[FRONT_RIGHT].baseHeight; - sp68 = (f64) arg0->tyres[FRONT_RIGHT].pos[2]; - temp_f30 = (f64) arg0->tyres[FRONT_LEFT].pos[0]; - sp58 = (f64) arg0->tyres[FRONT_LEFT].baseHeight; - sp50 = (f64) arg0->tyres[FRONT_LEFT].pos[2]; - sp48 = (f64) arg0->tyres[BACK_RIGHT].pos[0]; - sp40 = (f64) arg0->tyres[BACK_RIGHT].baseHeight; - temp_f4 = (f64) arg0->tyres[BACK_RIGHT].pos[2]; - temp_f2 = sp58 - sp70; - sp38 = temp_f4; - temp_f12 = temp_f4 - sp50; - temp_f14 = sp50 - sp68; - temp_f16 = sp40 - sp58; - temp_f18 = sp48 - temp_f30; - temp_f20 = temp_f30 - temp_f6; - if (0.0 == 0.0) { +UNUSED void func_802B8614(Player* arg0) { + UNUSED f64 pad[4]; + f64 corner1PosX = arg0->tyres[FRONT_RIGHT].pos[0]; + f64 corner1PosY = arg0->tyres[FRONT_RIGHT].baseHeight; + f64 corner1PosZ = arg0->tyres[FRONT_RIGHT].pos[2]; + + f64 corner0PosX = arg0->tyres[FRONT_LEFT].pos[0]; + f64 corner0PosY = arg0->tyres[FRONT_LEFT].baseHeight; + f64 corner0PosZ = arg0->tyres[FRONT_LEFT].pos[2]; + + f64 corner3PosX = arg0->tyres[BACK_RIGHT].pos[0]; + f64 corner3PosY = arg0->tyres[BACK_RIGHT].baseHeight; + f64 corner3PosZ = arg0->tyres[BACK_RIGHT].pos[2]; + + f64 xValue = (corner0PosY - corner1PosY) * (corner3PosZ - corner0PosZ) - + (corner0PosZ - corner1PosZ) * (corner3PosY - corner0PosY); + f64 yValue = (corner0PosZ - corner1PosZ) * (corner3PosX - corner0PosX) - + (corner0PosX - corner1PosX) * (corner3PosZ - corner0PosZ); + f64 zValue = (corner0PosX - corner1PosX) * (corner3PosY - corner0PosY) - + (corner0PosY - corner1PosY) * (corner3PosX - corner0PosX); + + f64 length = sqrtf((xValue * xValue) + (yValue * yValue) + (zValue * zValue)); + + length = 0.0; + + if (length == 0.0) { arg0->unk_058 = 0.0f; - arg0->unk_060 = 0.0f; arg0->unk_05C = 1.0f; - return; + arg0->unk_060 = 0.0f; + } else { + arg0->unk_058 = ((f32) xValue) / length; + arg0->unk_05C = ((f32) yValue) / length; + arg0->unk_060 = ((f32) zValue) / length; } - arg0->unk_058 = (f32) ((f64) (f32) ((temp_f2 * temp_f12) - (temp_f14 * temp_f16)) / 0.0); - arg0->unk_05C = (f32) ((f64) (f32) ((temp_f14 * temp_f18) - (temp_f20 * temp_f12)) / 0.0); - arg0->unk_060 = (f32) ((f64) (f32) ((temp_f20 * temp_f16) - (temp_f2 * temp_f18)) / 0.0); } -#else -GLOBAL_ASM("asm/non_matchings/racing/math_util/func_802B8614.s") -#endif diff --git a/src/racing/math_util.h b/src/racing/math_util.h index ddf73471b8..6ba4d0aa30 100644 --- a/src/racing/math_util.h +++ b/src/racing/math_util.h @@ -14,13 +14,12 @@ // Here to appease the pragma gods double fabs(double x); -void func_802B5794(Mat4, Vec3f, Vec3f); -s32 func_802B4F60(s32, Vec3f, s32, f32, f32); +void func_802B5794(Mat4, Vec3f, Vec3f); // Unused +s32 func_802B4F60(s32, Vec3f, s32, f32, f32); // Unused s32 render_set_position(Mat4, s32); -f32 func_802B51E8(Vec3f, Vec3f); -s32 get_angle_between_two_vectors(Vec3f, Vec3f); -u32 func_802B5258(Vec3f, Vec3s); -void func_802B5794(Mat4, Vec3f, Vec3f); +f32 dist_squared_bugged(Vec3f, Vec3f); +s32 get_xz_angle_between_points(Vec3f, Vec3f); +u32 func_802B5258(Vec3f, Vec3s); // Unused void vec3f_set(Vec3f, f32, f32, f32); void vec3s_set(Vec3s, s16, s16, s16); void* vec3f_copy_return(Vec3f, Vec3f); @@ -32,42 +31,42 @@ void mtxf_identity(Mat4); void add_translate_mat4_vec3f(Mat4, Mat4, Vec3f); void add_translate_mat4_vec3f_lite(Mat4, Mat4, Vec3f); void mtxf_translate(Mat4, Vec3f); -void func_802B5564(Mat4, u16*, f32, f32, f32, f32, f32); -void func_802B5794(Mat4, Vec3f, Vec3f); +void mtxf_projection(Mat4, u16*, f32, f32, f32, f32, f32); +void mtxf_lookat(Mat4, Vec3f, Vec3f); void mtxf_rotate_x(Mat4, s16); void mtxf_rotate_y(Mat4, s16); void mtxf_s16_rotate_z(Mat4, s16); -void func_802B5B14(Vec3f b, Vec3s rotate); // unused -void func_802B5CAC(s16, s16, Vec3f); -void func_802B5D30(s16, s16, s32); -void func_802B5D64(Lights1*, s16, s16, s32); +void func_802B5B14(Vec3f b, Vec3s rotate); // Unused +void func_802B5CAC(s16, s16, Vec3f); // Unused +void func_802B5D30(s16, s16, s32); // Unused +void set_course_lighting(Lights1*, s16, s16, s32); void mtxf_scale(Mat4, f32); -void mtxf_pos_rotation_xyz(Mat4, Vec3f, Vec3s); -void mtxf_translate_vec3f_mat3(Vec3f, Mat3); -void mtxf_translate_vec3f_mat4(Vec3f, Mat4); -void func_802B64C4(Vec3f, s16); +void mtxf_rotate_zxy_translate(Mat4, Vec3f, Vec3s); +void mtxf_transform_vec3f_mat3(Vec3f, Mat3); +void mtxf_transform_vec3f_mat4(Vec3f, Mat4); +void vec3f_rotate_y(Vec3f, s16); void calculate_orientation_matrix(Mat3, f32, f32, f32, s16); void calculate_rotation_matrix(Mat3, s16, f32, f32, f32); -void func_802B6BC0(Mat4, s16, f32, f32, f32); -void func_802B6D58(Mat4, Vec3f, Vec3f); +void func_802B6BC0(Mat4, s16, f32, f32, f32); // Unused +void func_802B6D58(Mat4, Vec3f, Vec3f); // Unused void mtxf_multiplication(Mat4, Mat4, Mat4); void mtxf_to_mtx(Mtx*, Mat4); u16 atan2_lookup(f32, f32); u16 atan2s(f32, f32); f32 atan2f(f32, f32); -s16 func_802B7C40(f32); -s16 func_802B7CA8(f32); -f32 calculate_vector_angle_xy(f32); +s16 atan1s(f32); +s16 asin1s(f32); +f32 acos1f(f32); u16 random_u16(void); u16 random_int(u16); -s16 func_802B7F34(f32, f32, f32, f32); -void func_802B7F7C(Vec3f, Vec3f, Vec3s); +s16 angle_from_coords(f32, f32, f32, f32); +void planar_angles(Vec3f, Vec3f, Vec3s); f32 sins(u16); f32 coss(u16); -s32 is_visible_between_angle(u16, u16, u16); -f32 is_within_render_distance(Vec3f, Vec3f, u16, f32, f32, f32); +s32 is_between_angle(u16, u16, u16); +f32 distance_if_visible(Vec3f, Vec3f, u16, f32, f32, f32); -extern s32 D_802B91C0[]; +extern s32 D_802B91C0[]; // Unused extern Vec3f D_802B91C8; #endif // MATH_UTIL_H diff --git a/src/racing/memory.c b/src/racing/memory.c index bdccfd84f1..e80fa5f8e0 100644 --- a/src/racing/memory.c +++ b/src/racing/memory.c @@ -25,6 +25,47 @@ struct UnkStruct_802B8CD4 D_802B8CD4[] = { 0 }; s32 D_802B8CE4 = 0; // pad s32 memoryPadding[2]; +enum PackedOp { + PG_LIGHTS_0 = 0x00, /* 0..0x14 mappés sur unpack_lights */ + /* Presets de combine renommés pour refléter les macros G_CC_* */ + PG_SETCOMBINE_CC_MODULATERGBA = 0x15, + PG_SETCOMBINE_CC_MODULATERGBDECALA = 0x16, + PG_SETCOMBINE_CC_SHADE = 0x17, + PG_RMODE_OPA = 0x18, + PG_RMODE_TEXEDGE = 0x19, + PG_TILECFG_A = 0x1A, + PG_TILECFG_B = 0x1B, + PG_TILECFG_C = 0x1C, + PG_TILECFG_D = 0x1D, + PG_TILECFG_E = 0x1E, + PG_TILECFG_F = 0x1F, + PG_TIMG_LOADBLOCK_0 = 0x20, + PG_TIMG_LOADBLOCK_1 = 0x21, + PG_TIMG_LOADBLOCK_2 = 0x22, + PG_TIMG_LOADBLOCK_3 = 0x23, + PG_TIMG_LOADBLOCK_4 = 0x24, + PG_TIMG_LOADBLOCK_5 = 0x25, + PG_TEXTURE_ON = 0x26, + PG_TEXTURE_OFF = 0x27, + PG_VTX1 = 0x28, + PG_TRI1 = 0x29, + PG_ENDDL = 0x2A, + PG_DL = 0x2B, + PG_TILECFG_G = 0x2C, + PG_CULLDL = 0x2D, + PG_SETCOMBINE_ALT = 0x2E, + PG_RMODE_XLU = 0x2F, + PG_SPLINE3D = 0x30, + PG_VTX_BASE = 0x32, /* 0x33..0x52 → variant vtx2 */ + PG_SETCOMBINE_CC_DECALRGBA = 0x53, + PG_RMODE_OPA_DECAL = 0x54, + PG_RMODE_XLU_DECAL = 0x55, + PG_SETGEOMETRYMODE = 0x56, + PG_CLEARGEOMETRYMODE = 0x57, + PG_TRI2 = 0x58, + PG_EOF = 0xFF, +}; + /** * @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. @@ -625,38 +666,38 @@ void unpack_tile_sync(Gfx* gfx, u8* args, s8 opcode) { tmem = 0; switch (opcode) { - case 26: + case PG_TILECFG_A: width = 32; height = 32; fmt = 0; break; - case 44: + case PG_TILECFG_G: width = 32; height = 32; fmt = 0; tmem = 256; break; - case 27: + case PG_TILECFG_B: width = 64; height = 32; fmt = 0; break; - case 28: + case PG_TILECFG_C: width = 32; height = 64; fmt = 0; break; - case 29: + case PG_TILECFG_D: width = 32; height = 32; fmt = 3; break; - case 30: + case PG_TILECFG_E: width = 64; height = 32; fmt = 3; break; - case 31: + case PG_TILECFG_F: width = 32; height = 64; fmt = 3; @@ -717,32 +758,32 @@ void unpack_tile_load_sync(Gfx* gfx, u8* args, s8 opcode) { uintptr_t tile; switch (opcode) { - case 32: + case PG_TIMG_LOADBLOCK_0: width = 32; height = 32; fmt = 0; break; - case 33: + case PG_TIMG_LOADBLOCK_1: width = 64; height = 32; fmt = 0; break; - case 34: + case PG_TIMG_LOADBLOCK_2: width = 32; height = 64; fmt = 0; break; - case 35: + case PG_TIMG_LOADBLOCK_3: width = 32; height = 32; fmt = 3; break; - case 36: + case PG_TIMG_LOADBLOCK_4: width = 64; height = 32; fmt = 3; break; - case 37: + case PG_TIMG_LOADBLOCK_5: width = 32; height = 64; fmt = 3; @@ -833,7 +874,7 @@ void unpack_vtx2(Gfx* gfx, u8* args, s8 arg2) { temp_v1 = args[sPackedSeekPosition++]; temp_v2 = ((args[sPackedSeekPosition++] << 8) | temp_v1) * 0x10; - temp_t9 = arg2 - 50; + temp_t9 = arg2 - PG_VTX_BASE; gfx[sGfxSeekPosition].words.w0 = ((uintptr_t) (uint8_t) G_VTX << 24) | ((temp_t9 << 10) + (((temp_t9) * 0x10) - 1)); gfx[sGfxSeekPosition].words.w1 = 0x4000000 + temp_v2; @@ -988,265 +1029,265 @@ void displaylist_unpack(uintptr_t* data, uintptr_t finalDisplaylistOffset, u32 a } switch (opcode) { - case 0x0: + case PG_LIGHTS_0 + 0x0: unpack_lights(gfx, packed_dl, opcode); break; - case 0x1: + case PG_LIGHTS_0 + 0x1: unpack_lights(gfx, packed_dl, opcode); break; - case 0x2: + case PG_LIGHTS_0 + 0x2: unpack_lights(gfx, packed_dl, opcode); break; - case 0x3: + case PG_LIGHTS_0 + 0x3: unpack_lights(gfx, packed_dl, opcode); break; - case 0x4: + case PG_LIGHTS_0 + 0x4: unpack_lights(gfx, packed_dl, opcode); break; - case 0x5: + case PG_LIGHTS_0 + 0x5: unpack_lights(gfx, packed_dl, opcode); break; - case 0x6: + case PG_LIGHTS_0 + 0x6: unpack_lights(gfx, packed_dl, opcode); break; - case 0x7: + case PG_LIGHTS_0 + 0x7: unpack_lights(gfx, packed_dl, opcode); break; - case 0x8: + case PG_LIGHTS_0 + 0x8: unpack_lights(gfx, packed_dl, opcode); break; - case 0x9: + case PG_LIGHTS_0 + 0x9: unpack_lights(gfx, packed_dl, opcode); break; - case 0xA: + case PG_LIGHTS_0 + 0xA: unpack_lights(gfx, packed_dl, opcode); break; - case 0xB: + case PG_LIGHTS_0 + 0xB: unpack_lights(gfx, packed_dl, opcode); break; - case 0xC: + case PG_LIGHTS_0 + 0xC: unpack_lights(gfx, packed_dl, opcode); break; - case 0xD: + case PG_LIGHTS_0 + 0xD: unpack_lights(gfx, packed_dl, opcode); break; - case 0xE: + case PG_LIGHTS_0 + 0xE: unpack_lights(gfx, packed_dl, opcode); break; - case 0xF: + case PG_LIGHTS_0 + 0xF: unpack_lights(gfx, packed_dl, opcode); break; - case 0x10: + case PG_LIGHTS_0 + 0x10: unpack_lights(gfx, packed_dl, opcode); break; - case 0x11: + case PG_LIGHTS_0 + 0x11: unpack_lights(gfx, packed_dl, opcode); break; - case 0x12: + case PG_LIGHTS_0 + 0x12: unpack_lights(gfx, packed_dl, opcode); break; - case 0x13: + case PG_LIGHTS_0 + 0x13: unpack_lights(gfx, packed_dl, opcode); break; - case 0x14: + case PG_LIGHTS_0 + 0x14: unpack_lights(gfx, packed_dl, opcode); break; - case 0x15: + case PG_SETCOMBINE_CC_MODULATERGBA: unpack_combine_mode1(gfx, packed_dl, arg2); break; - case 0x16: + case PG_SETCOMBINE_CC_MODULATERGBDECALA: unpack_combine_mode2(gfx, packed_dl, arg2); break; - case 0x17: + case PG_SETCOMBINE_CC_SHADE: unpack_combine_mode_shade(gfx, packed_dl, arg2); break; case 0x2E: unpack_combine_mode4(gfx, packed_dl, arg2); break; - case 0x53: + case PG_SETCOMBINE_CC_DECALRGBA: unpack_combine_mode5(gfx, packed_dl, arg2); break; - case 0x18: + case PG_RMODE_OPA: unpack_render_mode_opaque(gfx, packed_dl, arg2); break; - case 0x19: + case PG_RMODE_TEXEDGE: unpack_render_mode_tex_edge(gfx, packed_dl, arg2); break; - case 0x2F: + case PG_RMODE_XLU: unpack_render_mode_translucent(gfx, packed_dl, arg2); break; - case 0x54: + case PG_RMODE_OPA_DECAL: unpack_render_mode_opaque_decal(gfx, packed_dl, arg2); break; - case 0x55: + case PG_RMODE_XLU_DECAL: unpack_render_mode_translucent_decal(gfx, packed_dl, arg2); break; - case 0x1A: + case PG_TILECFG_A: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x2C: + case PG_TILECFG_G: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x1B: + case PG_TILECFG_B: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x1C: + case PG_TILECFG_C: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x1D: + case PG_TILECFG_D: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x1E: + case PG_TILECFG_E: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x1F: + case PG_TILECFG_F: unpack_tile_sync(gfx, packed_dl, opcode); break; - case 0x20: + case PG_TIMG_LOADBLOCK_0: unpack_tile_load_sync(gfx, packed_dl, opcode); break; - case 0x21: + case PG_TIMG_LOADBLOCK_1: unpack_tile_load_sync(gfx, packed_dl, opcode); break; - case 0x22: + case PG_TIMG_LOADBLOCK_2: unpack_tile_load_sync(gfx, packed_dl, opcode); break; - case 0x23: + case PG_TIMG_LOADBLOCK_3: unpack_tile_load_sync(gfx, packed_dl, opcode); break; - case 0x24: + case PG_TIMG_LOADBLOCK_4: unpack_tile_load_sync(gfx, packed_dl, opcode); break; - case 0x25: + case PG_TIMG_LOADBLOCK_5: unpack_tile_load_sync(gfx, packed_dl, opcode); break; - case 0x26: + case PG_TEXTURE_ON: unpack_texture_on(gfx, packed_dl, opcode); break; - case 0x27: + case PG_TEXTURE_OFF: unpack_texture_off(gfx, packed_dl, opcode); break; - case 0x28: + case PG_VTX1: unpack_vtx1(gfx, packed_dl, opcode); break; - case 0x33: + case PG_VTX_BASE + 0x01: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x34: + case PG_VTX_BASE + 0x02: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x35: + case PG_VTX_BASE + 0x03: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x36: + case PG_VTX_BASE + 0x04: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x37: + case PG_VTX_BASE + 0x05: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x38: + case PG_VTX_BASE + 0x06: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x39: + case PG_VTX_BASE + 0x07: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x3A: + case PG_VTX_BASE + 0x08: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x3B: + case PG_VTX_BASE + 0x09: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x3C: + case PG_VTX_BASE + 0x0A: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x3D: + case PG_VTX_BASE + 0x0B: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x3E: + case PG_VTX_BASE + 0x0C: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x3F: + case PG_VTX_BASE + 0x0D: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x40: + case PG_VTX_BASE + 0x0E: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x41: + case PG_VTX_BASE + 0x0F: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x42: + case PG_VTX_BASE + 0x10: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x43: + case PG_VTX_BASE + 0x11: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x44: + case PG_VTX_BASE + 0x12: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x45: + case PG_VTX_BASE + 0x13: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x46: + case PG_VTX_BASE + 0x14: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x47: + case PG_VTX_BASE + 0x15: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x48: + case PG_VTX_BASE + 0x16: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x49: + case PG_VTX_BASE + 0x17: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x4A: + case PG_VTX_BASE + 0x18: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x4B: + case PG_VTX_BASE + 0x19: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x4C: + case PG_VTX_BASE + 0x1A: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x4D: + case PG_VTX_BASE + 0x1B: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x4E: + case PG_VTX_BASE + 0x1C: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x4F: + case PG_VTX_BASE + 0x1D: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x50: + case PG_VTX_BASE + 0x1E: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x51: + case PG_VTX_BASE + 0x1F: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x52: + case PG_VTX_BASE + 0x20: unpack_vtx2(gfx, packed_dl, opcode); break; - case 0x29: + case PG_TRI1: unpack_triangle(gfx, packed_dl, opcode); break; - case 0x58: + case PG_TRI2: unpack_quadrangle(gfx, packed_dl, opcode); break; - case 0x30: + case PG_SPLINE3D: unpack_spline_3D(gfx, packed_dl, opcode); break; - case 0x2D: + case PG_CULLDL: unpack_cull_displaylist(gfx, packed_dl, opcode); break; - case 0x2A: + case PG_ENDDL: unpack_end_displaylist(gfx, packed_dl, opcode); break; - case 0x56: + case PG_SETGEOMETRYMODE: unpack_set_geometry_mode(gfx, packed_dl, opcode); break; - case 0x57: + case PG_CLEARGEOMETRYMODE: unpack_clear_geometry_mode(gfx, packed_dl, opcode); break; - case 0x2B: + case PG_DL: unpack_displaylist(gfx, packed_dl, opcode); break; default: diff --git a/src/racing/race_logic.c b/src/racing/race_logic.c index c18fef7618..04b9059ce2 100644 --- a/src/racing/race_logic.c +++ b/src/racing/race_logic.c @@ -1,18 +1,20 @@ #include #include -#include #include #include #include +#include +#include + #include "camera.h" -#include "waypoints.h" -#include "staff_ghosts.h" +#include "path.h" +#include "replays.h" #include "main.h" #include "code_800029B0.h" #include "code_80057C60.h" #include "update_objects.h" -#include "code_80091750.h" -#include "code_80005FD0.h" +#include "menu_items.h" +#include "cpu_vehicles_camera_path.h" #include "spawn_players.h" #include "audio/external.h" #include "race_logic.h" @@ -21,6 +23,7 @@ #include "effects.h" #include "math.h" #include "menus.h" +#include "seq_ids.h" #pragma intrinsic(sqrtf) @@ -38,7 +41,7 @@ u16 D_802BA032; float D_802BA034; -s32 D_802BA038; +s32 gDemoTimer; UNUSED s32 D_802BA03C; s16 D_802BA040[4]; @@ -79,7 +82,7 @@ void func_8028E028(void) { } func_800CA118((u8) gPlayerWinningIndex); D_800DC510 = 5; - D_802BA038 = 10; + gDemoTimer = 10; } void update_player_battle_status(void) { @@ -130,14 +133,14 @@ void func_8028E298(void) { } temp_a2 = gPathIndexByPlayerId[i]; - temp_v0 = ((2 - gPlayers[i].lapCount) * gWaypointCountByPathIndex[temp_a2]); - temp_v0 += gWaypointCountByPathIndex[temp_a2] * (1.0f - gLapCompletionPercentByPlayerId[i]); + temp_v0 = ((2 - gPlayers[i].lapCount) * gPathCountByPathIndex[temp_a2]); + temp_v0 += gPathCountByPathIndex[temp_a2] * (1.0f - gLapCompletionPercentByPlayerId[i]); temp_v0 /= 15.0f; gTimePlayerLastTouchedFinishLine[i] = gCourseTimer + temp_v0; } D_8016348C = 1; - func_800070F4(); + update_player_rankings(); } void func_8028E3A0(void) { @@ -402,7 +405,7 @@ void func_8028E678(void) { } } -void func_8028EC38(s32 arg0) { +UNUSED void func_8028EC38(s32 arg0) { gGotoMode = arg0; D_800DC510 = 6; func_800CA330(25); @@ -410,62 +413,79 @@ void func_8028EC38(s32 arg0) { D_800DC5B4 = 1; D_800DC5B0 = 1; D_800DC5B8 = 0; - D_802BA038 = 5; + gDemoTimer = 5; } -void func_8028EC98(s32 arg0) { +void play_music_for_current_track(s32 track) { if (gScreenModeSelection == SCREEN_MODE_3P_4P_SPLITSCREEN) { - return; + return; // If 3P/4P splitscreen mode is currently on, don't play the music for the current track. } func_800029B0(); - switch (arg0) { - case 0: - case 7: - case 8: - case 14: - func_800C8EAC(3); + switch (track) { + case COURSE_MARIO_RACEWAY: // Raceways, Wario Stadium + case COURSE_ROYAL_RACEWAY: + case COURSE_LUIGI_RACEWAY: + case COURSE_WARIO_STADIUM: + play_sequence(SEQ_TRACK_RACEWAY); break; - case 10: - func_800C8EAC(21); + + case COURSE_TOADS_TURNPIKE: // Toad's Turnpike + play_sequence(SEQ_TRACK_TURNPIKE); break; - case 4: - case 9: - func_800C8EAC(4); + + case COURSE_YOSHI_VALLEY: // Yoshi Valley, Moo Moo Farm + case COURSE_MOO_MOO_FARM: + play_sequence(SEQ_TRACK_FARM); break; - case 1: - case 15: - case 17: - func_800C8EAC(5); + + case COURSE_CHOCO_MOUNTAIN: // Choco Mountain, Various Battle Stages + case COURSE_BLOCK_FORT: + case COURSE_DOUBLE_DECK: + play_sequence(SEQ_TRACK_MOUNTAIN); break; - case 11: - func_800C8EAC(10); + + case COURSE_KALAMARI_DESERT: // Kalimari Desert + play_sequence(SEQ_TRACK_DESERT); break; - case 6: - func_800C8EAC(6); + + case COURSE_KOOPA_BEACH: // Koopa Troopa Beach + play_sequence(SEQ_TRACK_BEACH); break; - case 2: - func_800C8EAC(9); + + case COURSE_BOWSER_CASTLE: // Bowser Castle + play_sequence(SEQ_TRACK_CASTLE); break; - case 3: - func_800C8EAC(7); + + case COURSE_BANSHEE_BOARDWALK: // Banshee Boardwalk + play_sequence(SEQ_TRACK_SCARY); break; - case 5: - case 12: - func_800C8EAC(8); + + case COURSE_FRAPPE_SNOWLAND: // Frappe Snowland, Sherbet Land + case COURSE_SHERBET_LAND: + play_sequence(SEQ_TRACK_SNOW); break; - case 13: - func_800C8EAC(18); + + case COURSE_RAINBOW_ROAD: // Rainbow Road + play_sequence(SEQ_TRACK_RAINBOW); + break; + + case COURSE_DK_JUNGLE: // DK's Jungle Parkway + play_sequence(SEQ_TRACK_JUNGLE); break; - case 18: - func_800C8EAC(19); + + case COURSE_SKYSCRAPER: // Other Battle Stages + case COURSE_BIG_DONUT: + play_sequence(SEQ_TRACK_BATTLE); break; - case 16: - case 19: - func_800C8EAC(25); + +#ifdef AVOID_UB + default: //! @BUG: No default case. Enable AVOID_UB for custom tracks. + play_sequence(SEQ_TRACK_RACEWAY); break; +#endif } } @@ -473,8 +493,8 @@ void start_race(void) { s32 i; D_8015011E = -1; - if (!gDemoMode) { - func_8028EC98(gCurrentCourseId); + if (!gDemoMode) { // If we're not in the title screen demo, play the music for the current track. + play_music_for_current_track(gCurrentCourseId); } if (D_800DC510 == 2) { @@ -527,7 +547,7 @@ void func_8028EF28(void) { func_8028EEF0(i); currentPosition = gPlayers[i].currentRank; - gPlayers[i].type |= PLAYER_KART_AI; + gPlayers[i].type |= PLAYER_CPU; if (currentPosition < 4) { D_80150120 = 1; @@ -549,7 +569,7 @@ void func_8028EF28(void) { } if (gModeSelection == VERSUS) { - D_802BA038 = 180; + gDemoTimer = 180; if (currentPosition == 0) { gPlayerWinningIndex = i; } @@ -563,8 +583,8 @@ void func_8028EF28(void) { } D_800DC510 = 5; i = gPlayerPositionLUT[1]; - gPlayers[i].soundEffects |= 0x200000; - gPlayers[i].type |= PLAYER_KART_AI; + gPlayers[i].triggers |= SPINOUT_TRIGGER; + gPlayers[i].type |= PLAYER_CPU; func_800CA118((u8) i); break; case 3: @@ -581,8 +601,8 @@ void func_8028EF28(void) { if (*(gNmiUnknown2 + i * 3 + 2) > 99) { *(gNmiUnknown2 + i * 3 + 2) = 99; } - gPlayers[i].soundEffects |= 0x200000; - gPlayers[i].type |= PLAYER_KART_AI; + gPlayers[i].triggers |= SPINOUT_TRIGGER; + gPlayers[i].type |= PLAYER_CPU; func_800CA118((u8) i); } break; @@ -596,8 +616,8 @@ void func_8028EF28(void) { if (currentPosition == 2) { D_800DC510 = 5; i = gPlayerPositionLUT[3]; - gPlayers[i].soundEffects |= 0x200000; - gPlayers[i].type |= PLAYER_KART_AI; + gPlayers[i].triggers |= SPINOUT_TRIGGER; + gPlayers[i].type |= PLAYER_CPU; func_800CA118((u8) i); } break; @@ -623,7 +643,7 @@ void func_8028EF28(void) { } if ((D_802BA048 != 0) && (D_802BA048 != 100)) { D_802BA048 = 100; - func_800074D4(); + set_places_end_course_with_time(); } } @@ -654,7 +674,7 @@ void func_8028F474(void) { case 5: case 7: for (i = 0; i < NUM_PLAYERS; i++) { - func_80009B60(i); + update_player(i); } case 1: case 2: @@ -675,7 +695,7 @@ void func_8028F4E8(void) { D_800DC5B4 = 1; D_800DC5B0 = 1; D_800DC5B8 = 0; - D_802BA038 = 5; + gDemoTimer = 5; } } } @@ -789,7 +809,7 @@ void func_8028F970(void) { if (!(player->type & PLAYER_HUMAN)) { continue; } - if (player->type & PLAYER_KART_AI) { + if (player->type & PLAYER_CPU) { continue; } @@ -811,7 +831,7 @@ void func_8028F970(void) { gIsGamePaused = (controller - gControllerOne) + 1; controller->buttonPressed = 0; func_800C9F90(1); - D_80162DF0 = 1; + gPauseTriggered = 1; if (gModeSelection == TIME_TRIALS) { if (gPlayerOne->type & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) { func_80005AE8(gPlayerOne); @@ -860,27 +880,27 @@ void func_8028FBD4(void) { D_800DC5B4 = 1; D_800DC5B0 = 1; D_800DC5B8 = 0; - D_802BA038 = 5; + gDemoTimer = 5; } #ifdef VERSION_EU -#define D_802BA038_SIZE 1600 +#define gDemoTimer_SIZE 1600 #else -#define D_802BA038_SIZE 1920 +#define gDemoTimer_SIZE 1920 #endif -void func_8028FC34(void) { - if (D_802BA038 < 0) { - D_802BA038 = D_802BA038_SIZE; +void end_demo_update(void) { + if (gDemoTimer < 0) { + gDemoTimer = gDemoTimer_SIZE; return; } - D_802BA038--; + gDemoTimer--; if (gControllerFive->buttonPressed != 0) { func_8028FBD4(); gMenuSelection = START_MENU; return; } - if (D_802BA038 == 0) { + if (gDemoTimer == 0) { func_8028FBD4(); gMenuSelection = LOGO_INTRO_MENU; } @@ -891,18 +911,19 @@ void func_8028FCBC(void) { s32 i; u32 phi_v0_4; - if (D_8018EE08) { - func_8028FC34(); + if (gDemoUseController) { + end_demo_update(); } switch (D_800DC510) { case 0: - if (!gDemoMode) { + if (!gDemoMode) { // If we're not in the demo mode, play the starting fanfare for the current mode (Grand + // Prix / Time Trials / VS / Battle) if (gModeSelection == GRAND_PRIX) { - func_800C8EF8(11); + play_sequence2(SEQ_EVENT_RACE_STARTING); play_sound2(SOUND_ACTION_REV_ENGINE); play_sound2(SOUND_ACTION_REV_ENGINE_2); } else { - func_800C8EF8(22); + play_sequence2(SEQ_EVENT_RACE_STARTING_VS); } } func_80002DAC(); @@ -943,7 +964,7 @@ void func_8028FCBC(void) { D_800DC5B0 = 0; D_800DC5B8 = 1; func_80078F64(); - if ((gModeSelection == TIME_TRIALS) && (D_80162DD6 == 0)) { + if ((gModeSelection == TIME_TRIALS) && (bCourseGhostDisabled == 0)) { phi_v0_4 = 0x1; for (i = 0; i < gCurrentCourseId; i++) { phi_v0_4 <<= 1; @@ -989,7 +1010,7 @@ void func_8028FCBC(void) { switch (gScreenModeSelection) { case SCREEN_MODE_1P: - D_802BA038 = 690; + gDemoTimer = 690; D_800DC510 = 5; func_8028E298(); break; @@ -1005,7 +1026,7 @@ void func_8028FCBC(void) { } func_8028E298(); - D_802BA038 = 600; + gDemoTimer = 600; D_800DC510 = 5; } break; @@ -1018,7 +1039,7 @@ void func_8028FCBC(void) { func_8028F970(); break; case TIME_TRIALS: - D_802BA038 = 360; + gDemoTimer = 360; if (D_8015F890 != 0) { D_800DC510 = 7; } else { @@ -1028,8 +1049,8 @@ void func_8028FCBC(void) { } break; case 5: - if (D_802BA038 != 0) { - D_802BA038--; + if (gDemoTimer != 0) { + gDemoTimer--; } else { switch (gModeSelection) { case GRAND_PRIX: @@ -1136,25 +1157,25 @@ void func_802903D8(Player* playerOne, Player* playerTwo) { func_800C9060((playerTwo - gPlayerOne), 0x19008001U); return; } else { - playerTwo->soundEffects |= REVERSE_SOUND_EFFECT; + playerTwo->triggers |= VERTICAL_TUMBLE_TRIGGER; func_8008FC1C(playerOne); func_800C9060((playerTwo - gPlayerOne), 0x19008001U); } } else if (playerTwo->type & PLAYER_UNKNOWN_0x40) { - playerOne->soundEffects |= REVERSE_SOUND_EFFECT; + playerOne->triggers |= VERTICAL_TUMBLE_TRIGGER; func_8008FC1C(playerTwo); func_800C9060(playerOne - gPlayerOne, 0x19008001U); return; } - if (playerOne->effects & 0x200) { - if (!(playerTwo->effects & 0x200)) { - playerTwo->soundEffects |= HIT_BY_ITEM_SOUND_EFFECT; + if (playerOne->effects & STAR_EFFECT) { + if (!(playerTwo->effects & STAR_EFFECT)) { + playerTwo->triggers |= HIT_BY_STAR_TRIGGER; } - } else if (playerTwo->effects & 0x200) { - playerOne->soundEffects |= HIT_BY_ITEM_SOUND_EFFECT; + } else if (playerTwo->effects & STAR_EFFECT) { + playerOne->triggers |= HIT_BY_STAR_TRIGGER; } else { - playerOne->effects |= 0x8000; - playerTwo->effects |= 0x8000; + playerOne->effects |= ENEMY_BONK_EFFECT; + playerTwo->effects |= ENEMY_BONK_EFFECT; } temp_f0_2 = sqrtf((sp54[0] * sp54[0]) + (sp54[1] * sp54[1]) + (sp54[2] * sp54[2])); sp60[0] /= temp_f0; @@ -1173,7 +1194,7 @@ void func_802903D8(Player* playerOne, Player* playerTwo) { temp_f16 = ((sp60[0] * sp54[0]) + (sp60[1] * sp54[1]) + (sp60[2] * sp54[2])) / temp_f0_2; } temp_f0_2 = temp_f0_2 * temp_f16 * 0.85; - if ((playerOne->effects & 0x200) != 0x200) { + if ((playerOne->effects & STAR_EFFECT) != STAR_EFFECT) { temp_f2 = (temp_f0_2 * sp20) / sp24; playerOne->velocity[0] += sp60[0] * temp_f2; playerOne->velocity[1] += sp60[1] * temp_f2; @@ -1182,7 +1203,7 @@ void func_802903D8(Player* playerOne, Player* playerTwo) { playerOne->pos[1] -= sp60[1] * sp74 * 0.5f; playerOne->pos[2] -= sp60[2] * sp74 * 0.5f; } - if ((playerTwo->effects & 0x200) != 0x200) { + if ((playerTwo->effects & STAR_EFFECT) != STAR_EFFECT) { temp_f2 = (temp_f0_2 * sp24) / sp20; playerTwo->velocity[0] -= sp60[0] * temp_f2; playerTwo->velocity[1] -= sp60[1] * temp_f2; @@ -1209,14 +1230,14 @@ void func_802909F0(void) { for (i = 0; i < 7; i++) { ply = &gPlayers[i]; - if ((ply->type & PLAYER_EXISTS) && (!(ply->effects & 0x80000000)) && - (!(ply->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply->effects & 0x4000000))) { + if ((ply->type & PLAYER_EXISTS) && (!(ply->effects & BOO_EFFECT)) && + (!(ply->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply->effects & SQUISH_EFFECT))) { for (k = i + 1; k < NUM_PLAYERS; k++) { ply2 = &gPlayers[k]; - if ((ply2->type & PLAYER_EXISTS) && (!(ply2->effects & 0x80000000)) && - (!(ply2->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply2->effects & 0x4000000))) { + if ((ply2->type & PLAYER_EXISTS) && (!(ply2->effects & BOO_EFFECT)) && + (!(ply2->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply2->effects & SQUISH_EFFECT))) { func_802903D8(ply, ply2); } diff --git a/src/racing/race_logic.h b/src/racing/race_logic.h index 16b363e13a..3ab60a14ec 100644 --- a/src/racing/race_logic.h +++ b/src/racing/race_logic.h @@ -13,7 +13,7 @@ void func_8028E3A0(void); void func_8028E438(void); void func_8028E678(void); void func_8028EC38(s32); -void func_8028EC98(s32); +void play_music_for_current_track(s32); void start_race(void); f32 func_8028EE8C(s32); void func_8028EEF0(s32); @@ -27,7 +27,7 @@ void func_8028F8BC(void); void func_8028F914(void); void func_8028F970(void); void func_8028FBD4(void); -void func_8028FC34(void); +void end_demo_update(void); void func_8028FCBC(void); void func_80290314(void); void func_80290338(void); @@ -39,6 +39,5 @@ void func_80290B14(void); extern f32 gLapCompletionPercentByPlayerId[]; extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8 (position for each player) -extern u16 D_80162DD6; #endif diff --git a/src/racing/render_courses.c b/src/racing/render_courses.c index 2a3e789aa5..c9f171699b 100644 --- a/src/racing/render_courses.c +++ b/src/racing/render_courses.c @@ -947,7 +947,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) { s16 temp_s0 = arg0->pathCounter; s16 playerDirection = arg0->playerDirection; - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(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); @@ -1012,7 +1012,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) { void render_toads_turnpike(struct UnkStruct_800DC5EC* arg0) { UNUSED s32 pad[13]; - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(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); @@ -1039,7 +1039,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); + set_course_lighting(D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -1168,7 +1168,7 @@ void render_wario_stadium(struct UnkStruct_800DC5EC* arg0) { void render_block_fort(UNUSED struct UnkStruct_800DC5EC* arg0) { - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(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); @@ -1177,7 +1177,7 @@ void render_block_fort(UNUSED struct UnkStruct_800DC5EC* arg0) { } void render_skyscraper(UNUSED struct UnkStruct_800DC5EC* arg0) { - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(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); @@ -1201,7 +1201,7 @@ void render_skyscraper(UNUSED struct UnkStruct_800DC5EC* arg0) { void render_double_deck(UNUSED struct UnkStruct_800DC5EC* arg0) { - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(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); @@ -1213,8 +1213,8 @@ void render_double_deck(UNUSED 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); + set_course_lighting(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(&D_800DC610[1], D_802B87D4, D_802B87D0, 1); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK | G_LIGHTING); @@ -1239,7 +1239,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); + set_course_lighting(D_800DC610, D_802B87D4, 0, 1); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); @@ -1259,7 +1259,13 @@ void render_big_donut(struct UnkStruct_800DC5EC* arg0) { gSPDisplayList(gDisplayListHead++, ((uintptr_t) 0x07000230)); } -void func_8029569C(void) { +/** + * @brief The game has two versions of each course. One for normal gameplay and another for credits. + * The credits version is not split into segments so that the game camera can fly around the whole course. + * + */ +void render_course_credits(void) { +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_9348); @@ -1322,16 +1328,20 @@ void func_8029569C(void) { gSPDisplayList(gDisplayListHead++, d_course_sherbet_land_dl_0); break; } +#else + +#endif } void render_course(struct UnkStruct_800DC5EC* arg0) { - func_802B5D64(D_800DC610, D_802B87D4, 0, 1); + set_course_lighting(D_800DC610, D_802B87D4, 0, 1); if (creditsRenderMode) { - func_8029569C(); + render_course_credits(); return; } +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: render_mario_raceway(arg0); @@ -1394,6 +1404,9 @@ void render_course(struct UnkStruct_800DC5EC* arg0) { render_big_donut(arg0); break; } +#else + +#endif } void func_80295BF8(s32 playerIndex) { @@ -1431,7 +1444,11 @@ void func_80295D6C(void) { D_8015F6F6 = -3000; } -void func_80295D88(void) { +/** + * @brief Also sets vertex colours for the course vtx data + * + */ +void course_generate_collision_mesh(void) { gNumActors = 0; gCourseMinX = 0; @@ -1450,6 +1467,7 @@ void func_80295D88(void) { gCollisionMesh = (CollisionTriangle*) gNextFreeMemoryAddress; D_800DC5BC = 0; D_800DC5C8 = 0; +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: // d_course_mario_raceway_packed_dl_1140 @@ -1491,7 +1509,8 @@ void func_80295D88(void) { nullify_displaylist((uintptr_t) 0x070003C8); } parse_course_displaylists((uintptr_t) &d_course_choco_mountain_addr); - func_802B5CAC(0x238E, 0x31C7, D_8015F590); + // D_8015F590 is only used here, so this seems meaningless + vec_unit_z_rotX_rotY(0x238E, 0x31C7, D_8015F590); func_80295C6C(); D_8015F8E4 = -80.0f; break; @@ -1514,7 +1533,7 @@ void func_80295D88(void) { D_8015F8E4 = -80.0f; break; case COURSE_YOSHI_VALLEY: - func_802B5D64(&d_course_yoshi_valley_lights4, -0x38F0, 0x1C70, 1); + set_course_lighting(&d_course_yoshi_valley_lights4, -0x38F0, 0x1C70, 1); parse_course_displaylists((uintptr_t) d_course_yoshi_valley_addr); func_80295C6C(); D_8015F8E4 = gCourseMinY - 10.0f; @@ -1528,13 +1547,13 @@ void func_80295D88(void) { parse_course_displaylists((uintptr_t) d_course_koopa_troopa_beach_addr); func_80295C6C(); // d_course_koopa_troopa_beach_packed_dl_ADE0 - find_vtx_and_set_colours((uintptr_t) 0x0700ADE0, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x0700ADE0, 150, 255, 255, 255); // d_course_koopa_troopa_beach_packed_dl_A540 - find_vtx_and_set_colours((uintptr_t) 0x0700A540, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x0700A540, 150, 255, 255, 255); // d_course_koopa_troopa_beach_packed_dl_9E70 - find_vtx_and_set_colours((uintptr_t) 0x07009E70, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07009E70, 150, 255, 255, 255); // d_course_koopa_troopa_beach_packed_dl_358 - find_vtx_and_set_colours((uintptr_t) 0x07000358, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07000358, 150, 255, 255, 255); break; case COURSE_ROYAL_RACEWAY: parse_course_displaylists((uintptr_t) d_course_royal_raceway_addr); @@ -1571,9 +1590,9 @@ void func_80295D88(void) { func_80295C6C(); D_8015F8E4 = -18.0f; // d_course_sherbet_land_packed_dl_1EB8 - find_vtx_and_set_colours((uintptr_t) 0x07001EB8, -0x4C, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07001EB8, 180, 255, 255, 255); // d_course_sherbet_land_packed_dl_2308 - find_vtx_and_set_colours((uintptr_t) 0x07002308, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07002308, 150, 255, 255, 255); break; case COURSE_RAINBOW_ROAD: D_800DC5C8 = 1; @@ -1581,14 +1600,14 @@ void func_80295D88(void) { func_80295C6C(); D_8015F8E4 = 0.0f; // d_course_rainbow_road_packed_dl_2068 - find_vtx_and_set_colours((uintptr_t) 0x07002068, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07002068, 150, 255, 255, 255); // d_course_rainbow_road_packed_dl_1E18 - find_vtx_and_set_colours((uintptr_t) 0x07001E18, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07001E18, 150, 255, 255, 255); // d_course_rainbow_road_packed_dl_1318 find_vtx_and_set_colours((uintptr_t) 0x07001318, 255, 255, 255, 0); if (gGamestate != CREDITS_SEQUENCE) { // d_course_rainbow_road_packed_dl_1FB8 - find_vtx_and_set_colours((uintptr_t) 0x07001FB8, -0x6A, 255, 255, 255); + find_vtx_and_set_colours((uintptr_t) 0x07001FB8, 150, 255, 255, 255); } break; case COURSE_WARIO_STADIUM: @@ -1655,10 +1674,13 @@ void func_80295D88(void) { D_8015F8E4 = 100.0f; break; } -} +#else -void func_802966A0(void) { +#endif +} +void course_update_water(void) { +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { case COURSE_KOOPA_BEACH: // clang-format off @@ -1735,6 +1757,9 @@ void func_802966A0(void) { evaluate_collision_players_palm_trees(); break; } +#else + +#endif } void func_802969F8(void) { diff --git a/src/racing/render_courses.h b/src/racing/render_courses.h index 3d9b1df475..3932663648 100644 --- a/src/racing/render_courses.h +++ b/src/racing/render_courses.h @@ -28,14 +28,14 @@ void render_skyscraper(struct UnkStruct_800DC5EC*); void render_double_deck(struct UnkStruct_800DC5EC*); void render_dks_jungle_parkway(struct UnkStruct_800DC5EC*); void render_big_donut(struct UnkStruct_800DC5EC*); -void func_8029569C(void); +void render_course_credits(void); void render_course(struct UnkStruct_800DC5EC*); void func_80295BF8(s32); void func_80295C6C(void); void func_80295D50(s16, s16); void func_80295D6C(void); -void func_80295D88(void); -void func_802966A0(void); +void course_generate_collision_mesh(void); +void course_update_water(void); void func_802969F8(void); extern s32 D_8015F59C; diff --git a/src/racing/skybox_and_splitscreen.c b/src/racing/skybox_and_splitscreen.c index 14b12bf8ba..78f95fe7ce 100644 --- a/src/racing/skybox_and_splitscreen.c +++ b/src/racing/skybox_and_splitscreen.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "skybox_and_splitscreen.h" #include "code_800029B0.h" @@ -11,7 +12,7 @@ #include #include "render_player.h" #include "code_80057C60.h" -#include "code_80091750.h" +#include "menu_items.h" #include "actors.h" #include "render_courses.h" #include "math_util.h" @@ -22,7 +23,7 @@ Vp D_802B8880[] = { { { { 640, 480, 511, 0 }, { 640, 480, 511, 0 } } }, }; -Vtx D_802B8890[] = { +static Vtx sSkyboxP1[] = { { { { 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 } } }, @@ -33,7 +34,7 @@ Vtx D_802B8890[] = { { { { 0, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF } } }, }; -Vtx D_802B8910[] = { +static Vtx sSkyboxP2[] = { { { { 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 } } }, @@ -44,7 +45,7 @@ Vtx D_802B8910[] = { { { { 0, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF } } }, }; -Vtx D_802B8990[] = { +static Vtx sSkyboxP3[] = { { { { 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 } } }, @@ -55,7 +56,7 @@ Vtx D_802B8990[] = { { { { 0, 120, -1 }, 0, { 0, 0 }, { 0x00, 0xDC, 0x00, 0xFF } } }, }; -Vtx D_802B8A10[] = { +static Vtx sSkyboxP4[] = { { { { 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 } } }, @@ -127,7 +128,7 @@ void func_802A38B4(void) { gGamestate = 255; gIsInQuitToMenuTransition = 0; gQuitToMenuTransitionCounter = 0; - D_800E86A4 = 1; + gFadeModeSelection = FADE_MODE_MAIN; switch (gGotoMode) { case START_MENU_FROM_QUIT: @@ -139,7 +140,7 @@ void func_802A38B4(void) { gMenuSelection = MAIN_MENU; break; case PLAYER_SELECT_MENU_FROM_QUIT: - gMenuSelection = PLAYER_SELECT_MENU; + gMenuSelection = CHARACTER_SELECT_MENU; break; case COURSE_SELECT_MENU_FROM_QUIT: gMenuSelection = COURSE_SELECT_MENU; @@ -309,14 +310,18 @@ void func_802A4300(void) { gDPPipeSync(gDisplayListHead++); gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE); } - +/** + * @note that the second half of the s16 value is truncated (unused). So if you want red, put 255. But the original + * programmers might have put something like `42,239`, in bytes: b1010010011111111 The extra bits are skipped and the + * game only reads `11111111` (255) + */ struct Skybox { - s16 unk0; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; + s16 topRed; + s16 topGreen; + s16 topBlue; + s16 bottomRed; + s16 bottomGreen; + s16 bottomBlue; }; UNUSED Gfx D_802B8A90[] = { @@ -330,12 +335,12 @@ UNUSED Gfx D_802B8A90[] = { gsSPEndDisplayList(), }; -struct Skybox sSkyColors[] = { +struct Skybox sTopSkyBoxColors[] = { #include "assets/course_metadata/sSkyColors.inc.c" }; -// struct Skybox sSkyColors[] = { +// struct Skybox sTopSkyBoxColors[] = { // {128, 4280, 6136, 216, 7144, 32248}, // {255, 255, 255, 255, 255, 255}, // {48, 1544, 49528, 0, 0, 0}, @@ -359,11 +364,11 @@ struct Skybox sSkyColors[] = { // {238, 144, 255, 255, 224, 240}, // }; -struct Skybox sSkyColors2[] = { +struct Skybox sBottomSkyBoxColors[] = { #include "assets/course_metadata/sSkyColors2.inc.c" }; -void func_802A450C(Vtx* skybox) { +void course_set_skybox_colours(Vtx* skybox) { s32 i; if (D_800DC5BC != 0) { @@ -400,32 +405,45 @@ void func_802A450C(Vtx* skybox) { } return; } - skybox[0].v.cn[0] = sSkyColors[gCurrentCourseId].unk0; - skybox[0].v.cn[1] = sSkyColors[gCurrentCourseId].unk2; - skybox[0].v.cn[2] = sSkyColors[gCurrentCourseId].unk4; - skybox[1].v.cn[0] = sSkyColors[gCurrentCourseId].unk6; - skybox[1].v.cn[1] = sSkyColors[gCurrentCourseId].unk8; - skybox[1].v.cn[2] = sSkyColors[gCurrentCourseId].unkA; - skybox[2].v.cn[0] = sSkyColors[gCurrentCourseId].unk6; - skybox[2].v.cn[1] = sSkyColors[gCurrentCourseId].unk8; - skybox[2].v.cn[2] = sSkyColors[gCurrentCourseId].unkA; - skybox[3].v.cn[0] = sSkyColors[gCurrentCourseId].unk0; - skybox[3].v.cn[1] = sSkyColors[gCurrentCourseId].unk2; - skybox[3].v.cn[2] = sSkyColors[gCurrentCourseId].unk4; - skybox[4].v.cn[0] = sSkyColors2[gCurrentCourseId].unk0; - skybox[4].v.cn[1] = sSkyColors2[gCurrentCourseId].unk2; - skybox[4].v.cn[2] = sSkyColors2[gCurrentCourseId].unk4; - skybox[5].v.cn[0] = sSkyColors2[gCurrentCourseId].unk6; - skybox[5].v.cn[1] = sSkyColors2[gCurrentCourseId].unk8; - skybox[5].v.cn[2] = sSkyColors2[gCurrentCourseId].unkA; - skybox[6].v.cn[0] = sSkyColors2[gCurrentCourseId].unk6; - skybox[6].v.cn[1] = sSkyColors2[gCurrentCourseId].unk8; - skybox[6].v.cn[2] = sSkyColors2[gCurrentCourseId].unkA; - skybox[7].v.cn[0] = sSkyColors2[gCurrentCourseId].unk0; - skybox[7].v.cn[1] = sSkyColors2[gCurrentCourseId].unk2; - skybox[7].v.cn[2] = sSkyColors2[gCurrentCourseId].unk4; + +#if !ENABLE_CUSTOM_COURSE_ENGINE + skybox[0].v.cn[0] = sTopSkyBoxColors[gCurrentCourseId].topRed; + skybox[0].v.cn[1] = sTopSkyBoxColors[gCurrentCourseId].topGreen; + skybox[0].v.cn[2] = sTopSkyBoxColors[gCurrentCourseId].topBlue; + + skybox[1].v.cn[0] = sTopSkyBoxColors[gCurrentCourseId].bottomRed; + skybox[1].v.cn[1] = sTopSkyBoxColors[gCurrentCourseId].bottomGreen; + skybox[1].v.cn[2] = sTopSkyBoxColors[gCurrentCourseId].bottomBlue; + + skybox[2].v.cn[0] = sTopSkyBoxColors[gCurrentCourseId].bottomRed; + skybox[2].v.cn[1] = sTopSkyBoxColors[gCurrentCourseId].bottomGreen; + skybox[2].v.cn[2] = sTopSkyBoxColors[gCurrentCourseId].bottomBlue; + + skybox[3].v.cn[0] = sTopSkyBoxColors[gCurrentCourseId].topRed; + skybox[3].v.cn[1] = sTopSkyBoxColors[gCurrentCourseId].topGreen; + skybox[3].v.cn[2] = sTopSkyBoxColors[gCurrentCourseId].topBlue; + + skybox[4].v.cn[0] = sBottomSkyBoxColors[gCurrentCourseId].topRed; + skybox[4].v.cn[1] = sBottomSkyBoxColors[gCurrentCourseId].topGreen; + skybox[4].v.cn[2] = sBottomSkyBoxColors[gCurrentCourseId].topBlue; + + skybox[5].v.cn[0] = sBottomSkyBoxColors[gCurrentCourseId].bottomRed; + skybox[5].v.cn[1] = sBottomSkyBoxColors[gCurrentCourseId].bottomGreen; + skybox[5].v.cn[2] = sBottomSkyBoxColors[gCurrentCourseId].bottomBlue; + + skybox[6].v.cn[0] = sBottomSkyBoxColors[gCurrentCourseId].bottomRed; + skybox[6].v.cn[1] = sBottomSkyBoxColors[gCurrentCourseId].bottomGreen; + skybox[6].v.cn[2] = sBottomSkyBoxColors[gCurrentCourseId].bottomBlue; + + skybox[7].v.cn[0] = sBottomSkyBoxColors[gCurrentCourseId].topRed; + skybox[7].v.cn[1] = sBottomSkyBoxColors[gCurrentCourseId].topGreen; + skybox[7].v.cn[2] = sBottomSkyBoxColors[gCurrentCourseId].topBlue; +#else + +#endif } +// Almost identical to end of render_skybox void func_802A487C(Vtx* arg0, UNUSED struct UnkStruct_800DC5EC* arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED f32* arg4) { @@ -444,46 +462,62 @@ void func_802A487C(Vtx* arg0, UNUSED struct UnkStruct_800DC5EC* arg1, UNUSED s32 } } -void func_802A4A0C(Vtx* vtx, struct UnkStruct_800DC5EC* arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED f32* arg4) { +/** + * @brief Sets skybox horizon. Some coordinate transformations which can affect game physics and display of player + * sprite + * @param skybox player skybox + * @param arg1 something camera related + * @param arg2 unused + * @param arg3 unused + * @parma arg4 unused + */ +void render_skybox(Vtx* skybox, struct UnkStruct_800DC5EC* arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED f32* arg4) { Camera* camera = arg1->camera; - s16 temp_t5; - f32 temp_f0; + s16 horizonRow; + f32 homogFactor; UNUSED s32 pad[2]; UNUSED u16 pad2; u16 sp128; - Mat4 matrix1; - Mat4 matrix2; - Mat4 matrix3; - Vec3f sp5C; - f32 sp58; - - func_802A450C(vtx); - sp5C[0] = 0.0f; - sp5C[1] = 0.0f; - sp5C[2] = 30000.0f; - func_802B5564(matrix1, &sp128, camera->unk_B4, gScreenAspect, D_80150150, D_8015014C, 1.0f); - func_802B5794(matrix2, camera->pos, camera->lookAt); - mtxf_multiplication(matrix3, matrix1, matrix2); - - sp58 = ((matrix3[0][3] * sp5C[0]) + (matrix3[1][3] * sp5C[1]) + (matrix3[2][3] * sp5C[2])) + matrix3[3][3]; - - mtxf_translate_vec3f_mat4(sp5C, matrix3); - - temp_f0 = (1.0 / sp58); - - sp5C[0] *= temp_f0; - sp5C[1] *= temp_f0; - - sp5C[0] *= 160.0f; - sp5C[1] *= 120.0f; - - temp_t5 = 120 - (s16) sp5C[1]; - arg1->cameraHeight = temp_t5; - vtx[1].v.ob[1] = temp_t5; - vtx[2].v.ob[1] = temp_t5; - vtx[4].v.ob[1] = temp_t5; - vtx[7].v.ob[1] = temp_t5; - + Mat4 projMtx; + Mat4 lookAtMtx; + Mat4 lookAndProjMtx; + Vec3f horizonPoint; + f32 homogScale; + + course_set_skybox_colours(skybox); + + // horizonPoint is an apparently arbitrary point on the horizon (technically, where y = 0). Used for skybox horizon + horizonPoint[0] = 0.0f; + horizonPoint[1] = 0.0f; + horizonPoint[2] = 30000.0f; + mtxf_projection(projMtx, &sp128, camera->unk_B4, gScreenAspect, gCourseNearPersp, gCourseFarPersp, 1.0f); + mtxf_lookat(lookAtMtx, camera->pos, camera->lookAt); + mtxf_multiplication(lookAndProjMtx, projMtx, lookAtMtx); + + /* math would have been simpler if horizonPoint had an additional homogenous coordinate set to 1. Recreated here in + extra steps */ + homogScale = ((lookAndProjMtx[0][3] * horizonPoint[0]) + (lookAndProjMtx[1][3] * horizonPoint[1]) + + (lookAndProjMtx[2][3] * horizonPoint[2])) + + lookAndProjMtx[3][3]; + mtxf_transform_vec3f_mat4(horizonPoint, lookAndProjMtx); + + homogFactor = (1.0 / homogScale); + + horizonPoint[0] *= homogFactor; + horizonPoint[1] *= homogFactor; + + horizonPoint[0] *= 160.0f; // SCREEN_WIDTH / 2 + horizonPoint[1] *= 120.0f; // SCREEN_HEIGHT / 2 + + horizonRow = 120 - (s16) horizonPoint[1]; + arg1->cameraHeight = horizonRow; + + skybox[1].v.ob[1] = horizonRow; + skybox[2].v.ob[1] = horizonRow; + skybox[4].v.ob[1] = horizonRow; + skybox[7].v.ob[1] = horizonRow; + + // this section reders the skybox. Unclear if it does anything else init_rdp(); gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_LIGHTING); @@ -492,18 +526,18 @@ void func_802A4A0C(Vtx* vtx, struct UnkStruct_800DC5EC* arg1, UNUSED s32 arg2, U gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxScreen), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_0D008E98), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPVertex(gDisplayListHead++, &vtx[0], 4, 0); + gSPVertex(gDisplayListHead++, &skybox[0], 4, 0); gSP2Triangles(gDisplayListHead++, 0, 3, 1, 0, 1, 3, 2, 0); if (gCurrentCourseId == COURSE_RAINBOW_ROAD) { - gSPVertex(gDisplayListHead++, &vtx[4], 4, 0); + gSPVertex(gDisplayListHead++, &skybox[4], 4, 0); gSP2Triangles(gDisplayListHead++, 0, 3, 1, 0, 1, 3, 2, 0); } } -void func_802A4D18(void) { +void set_perspective_and_aspect_ratio(void) { if (gGamestate != 4) { - D_8015014C = 6800.0f; - D_80150150 = 3.0f; + gCourseFarPersp = 6800.0f; + gCourseNearPersp = 3.0f; } else { switch (gCurrentCourseId) { case COURSE_BOWSER_CASTLE: @@ -511,21 +545,21 @@ void func_802A4D18(void) { case COURSE_RAINBOW_ROAD: case COURSE_BLOCK_FORT: case COURSE_SKYSCRAPER: - D_8015014C = 2700.0f; - D_80150150 = 2.0f; + gCourseFarPersp = 2700.0f; + gCourseNearPersp = 2.0f; break; case COURSE_CHOCO_MOUNTAIN: case COURSE_DOUBLE_DECK: - D_8015014C = 1500.0f; - D_80150150 = 2.0f; + gCourseFarPersp = 1500.0f; + gCourseNearPersp = 2.0f; break; case COURSE_KOOPA_BEACH: - D_8015014C = 5000.0f; - D_80150150 = 1.0f; + gCourseFarPersp = 5000.0f; + gCourseNearPersp = 1.0f; break; case COURSE_WARIO_STADIUM: - D_8015014C = 4800.0f; - D_80150150 = 10.0f; + gCourseFarPersp = 4800.0f; + gCourseNearPersp = 10.0f; break; case COURSE_MARIO_RACEWAY: case COURSE_YOSHI_VALLEY: @@ -536,16 +570,16 @@ void func_802A4D18(void) { case COURSE_TOADS_TURNPIKE: case COURSE_SHERBET_LAND: case COURSE_DK_JUNGLE: - D_8015014C = 4500.0f; - D_80150150 = 9.0f; + gCourseFarPersp = 4500.0f; + gCourseNearPersp = 9.0f; break; case COURSE_KALAMARI_DESERT: - D_8015014C = 7000.0f; - D_80150150 = 10.0f; + gCourseFarPersp = 7000.0f; + gCourseNearPersp = 10.0f; break; default: - D_8015014C = 6800.0f; - D_80150150 = 3.0f; + gCourseFarPersp = 6800.0f; + gCourseNearPersp = 3.0f; break; } } @@ -587,7 +621,7 @@ void func_802A4EF4(void) { break; } } - +// player 2 vertical void func_802A5004(void) { init_rdp(); @@ -599,13 +633,13 @@ void func_802A5004(void) { func_802A39E0(D_800DC5F0); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); + render_skybox((Vtx*) sSkyboxP2, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); func_80057FC4(2); - func_802A487C((Vtx*) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); + func_802A487C((Vtx*) sSkyboxP2, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); func_80093A30(2); } } - +// player 1 vertical void func_802A50EC(void) { init_rdp(); @@ -616,13 +650,13 @@ void func_802A50EC(void) { func_802A39E0(D_800DC5EC); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); + render_skybox((Vtx*) sSkyboxP1, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); func_80057FC4(1); - func_802A487C((Vtx*) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); + func_802A487C((Vtx*) sSkyboxP1, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); func_80093A30(1); } } - +// player 1 horizontal void func_802A51D4(void) { init_rdp(); @@ -633,13 +667,13 @@ void func_802A51D4(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); + render_skybox((Vtx*) sSkyboxP1, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); func_80057FC4(3); - func_802A487C((Vtx*) D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); + func_802A487C((Vtx*) sSkyboxP1, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[0]); func_80093A30(3); } } - +// player 2 horizontal void func_802A52BC(void) { init_rdp(); @@ -650,13 +684,13 @@ void func_802A52BC(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); + render_skybox((Vtx*) sSkyboxP2, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); func_80057FC4(4); - func_802A487C((Vtx*) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); + func_802A487C((Vtx*) sSkyboxP2, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); func_80093A30(4); } } - +// player 1 solo void func_802A53A4(void) { move_segment_table_to_dmem(); @@ -669,15 +703,15 @@ void func_802A53A4(void) { init_z_buffer(); select_framebuffer(); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8890, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); + render_skybox((Vtx*) sSkyboxP1, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); if (gGamestate != CREDITS_SEQUENCE) { func_80057FC4(0); } - func_802A487C((Vtx*) D_802B8890, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); + func_802A487C((Vtx*) sSkyboxP1, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); func_80093A30(0); } } - +// player 1 3p 4p void func_802A54A8(void) { init_rdp(); @@ -688,13 +722,13 @@ void func_802A54A8(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8890, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); + render_skybox((Vtx*) sSkyboxP1, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); func_80057FC4(8); - func_802A487C((Vtx*) D_802B8890, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); + func_802A487C((Vtx*) sSkyboxP1, D_800DC5EC, 0x140, 0xF0, &gCameraZoom[0]); func_80093A30(8); } } - +// player 2 3p 4p void func_802A5590(void) { init_rdp(); @@ -705,13 +739,13 @@ void func_802A5590(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); + render_skybox((Vtx*) sSkyboxP2, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); func_80057FC4(9); - func_802A487C((Vtx*) D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); + func_802A487C((Vtx*) sSkyboxP2, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[1]); func_80093A30(9); } } - +// player 3 3p4p void func_802A5678(void) { init_rdp(); @@ -722,13 +756,14 @@ void func_802A5678(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C((Vtx*) D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[2]); + render_skybox((Vtx*) sSkyboxP3, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[2]); func_80057FC4(10); - func_802A487C((Vtx*) D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[2]); + func_802A487C((Vtx*) sSkyboxP3, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[2]); func_80093A30(10); } } +// player 4 3p 4p void func_802A5760(void) { init_rdp(); @@ -757,9 +792,9 @@ void func_802A5760(void) { func_802A39E0(D_800DC5F8); if (D_800DC5B4 != 0) { - func_802A4A0C(D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[3]); + render_skybox(sSkyboxP4, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[3]); func_80057FC4(11); - func_802A487C(D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[3]); + func_802A487C(sSkyboxP4, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &gCameraZoom[3]); func_80093A30(11); } } @@ -785,9 +820,10 @@ void render_player_one_1p_screen(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); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), @@ -847,9 +883,10 @@ void render_player_one_2p_screen_vertical(void) { func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), @@ -913,9 +950,10 @@ void render_player_two_2p_screen_vertical(void) { #endif gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), @@ -975,9 +1013,10 @@ void render_player_one_2p_screen_horizontal(void) { #endif gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), @@ -1038,9 +1077,10 @@ void render_player_two_2p_screen_horizontal(void) { #endif gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), @@ -1097,9 +1137,10 @@ void render_player_one_3p_4p_screen(void) { func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), @@ -1156,9 +1197,10 @@ void render_player_two_3p_4p_screen(void) { func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), @@ -1216,9 +1258,10 @@ void render_player_three_3p_4p_screen(void) { gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[2]), @@ -1285,9 +1328,10 @@ void render_player_four_3p_4p_screen(void) { gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU - guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], sp9C, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], sp9C, gCourseNearPersp, gCourseFarPersp, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], gScreenAspect, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], gScreenAspect, gCourseNearPersp, gCourseFarPersp, + 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[3]), diff --git a/src/racing/skybox_and_splitscreen.h b/src/racing/skybox_and_splitscreen.h index f3067074e6..bc9f196396 100644 --- a/src/racing/skybox_and_splitscreen.h +++ b/src/racing/skybox_and_splitscreen.h @@ -8,7 +8,7 @@ /* Function Prototypes */ -void func_802A4A0C(Vtx*, struct UnkStruct_800DC5EC*, s32, s32, f32*); +void render_skybox(Vtx*, struct UnkStruct_800DC5EC*, s32, s32, f32*); void func_802A3730(struct UnkStruct_800DC5EC*); void func_802A38AC(void); @@ -28,9 +28,9 @@ s32 set_viewport2(void); void set_viewport(void); void select_framebuffer(void); void func_802A4300(void); -void func_802A450C(Vtx*); +void course_set_skybox_colours(Vtx*); void func_802A487C(Vtx*, struct UnkStruct_800DC5EC*, s32, s32, f32*); -void func_802A4D18(void); +void set_perspective_and_aspect_ratio(void); void func_802A4EF4(void); void func_802A5004(void); void func_802A50EC(void); diff --git a/src/render_objects.c b/src/render_objects.c index 4a8769fa17..da90ace2ac 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -15,17 +15,17 @@ #include "math_util.h" #include "math_util_2.h" #include "objects.h" -#include "waypoints.h" +#include "path.h" #include "bomb_kart.h" #include #include "render_player.h" #include "animation.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "code_80057C60.h" #include "code_8006E9C0.h" #include "render_objects.h" #include "update_objects.h" -#include "code_80091750.h" +#include "menu_items.h" #include "collision.h" #include "main.h" #include "menus.h" @@ -1467,7 +1467,7 @@ void func_8004B310(s32 alpha) { gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, alpha); } -void func_8004B35C(s32 red, s32 green, s32 blue, s32 alpha) { +void func_8004B35C(u32 red, u32 green, u32 blue, u32 alpha) { gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(gDisplayListHead++, 0, 0, red, green, blue, alpha); } @@ -1518,14 +1518,14 @@ void func_8004B6C4(s32 red, s32 green, s32 blue) { gDPSetPrimColor(gDisplayListHead++, 0, 0, red, green, blue, 0xFF); } -void func_8004B72C(s32 primRed, s32 primGreen, s32 primBlue, s32 envRed, s32 envGreen, s32 envBlue, s32 primAlpha) { +void func_8004B72C(u32 primRed, u32 primGreen, u32 primBlue, u32 envRed, u32 envGreen, u32 envBlue, u32 primAlpha) { gDPSetPrimColor(gDisplayListHead++, 0, 0, primRed, primGreen, primBlue, primAlpha); gDPSetEnvColor(gDisplayListHead++, envRed, envGreen, envBlue, 0xFF); gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); } -void func_8004B7DC(s32 x, s32 y, s32 width, s32 height, s32 arg4, s32 arg5, s32 arg6) { +void render_texture_rectangle(s32 x, s32 y, s32 width, s32 height, s32 s, s32 w, s32 mode) { s32 xh = (((x + width) - 1) << 2); s32 yh = (((y + height) - 1) << 2); @@ -1535,18 +1535,18 @@ void func_8004B7DC(s32 x, s32 y, s32 width, s32 height, s32 arg4, s32 arg5, s32 s32 xh2 = (((x + width)) << 2); s32 yh2 = ((y + height) << 2); - if (arg6 == 0) { - //! @todo Update to F3DEX. Uses OLD definition for gspTextureRectangle. - gSPTextureRectangle(gDisplayListHead++, xl, yl, xh, yh, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 4 << 10, - 1 << 10); + // If no cycle mode is set, render texture rectangle in copy mode + if (mode == 0) { + gSPTextureRectangle(gDisplayListHead++, xl, yl, xh, yh, G_TX_RENDERTILE, s << 5, (w << 5), 4 << 10, 1 << 10); return; } - gSPTextureRectangle(gDisplayListHead++, xl, yl, xh2, yh2, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 1 << 10, - 1 << 10); + // Render texture rectangle in default cycle mode (1 cycle or 2 cycle) + gSPTextureRectangle(gDisplayListHead++, xl, yl, xh2, yh2, G_TX_RENDERTILE, s << 5, (w << 5), 1 << 10, 1 << 10); } -void func_8004B950(s32 x, s32 y, s32 width, s32 height, s32 arg4) { - func_8004B7DC(x, y, width, height, 0, 0, arg4); +void render_texture_rectangle_wrap(s32 x, s32 y, s32 width, s32 height, s32 mode) { + // (0, 0) means texture coordinates will be rendered from the top left corner + render_texture_rectangle(x, y, width, height, 0, 0, mode); } void func_8004B97C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { @@ -1569,7 +1569,7 @@ void func_8004B97C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { var_v0 = -arg1; var_a1 = 0; } - func_8004B7DC(sp2C, var_a1, arg2 - var_v1, arg3 - var_v0, var_v1, var_v0, arg4); + render_texture_rectangle(sp2C, var_a1, arg2 - var_v1, arg3 - var_v0, var_v1, var_v0, arg4); } } @@ -1593,7 +1593,7 @@ void func_8004BA08(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { phi_v0 = -arg1; phi_a1 = 0; } - func_8004B7DC(sp2C, phi_a1, arg2 - phi_v1, arg3 - phi_v0, phi_v1 + arg2, phi_v0, arg4); + render_texture_rectangle(sp2C, phi_a1, arg2 - phi_v1, arg3 - phi_v0, phi_v1 + arg2, phi_v0, arg4); } } @@ -1623,7 +1623,7 @@ void func_8004BA98(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s sp30 = 0; phi_a3 = arg3 + arg1; } - func_8004B7DC(sp34, sp30, sp2C, phi_a3, phi_v0, phi_v1, arg6); + render_texture_rectangle(sp34, sp30, sp2C, phi_a3, phi_v0, phi_v1, arg6); } } @@ -1678,7 +1678,7 @@ UNUSED void func_8004BD14(s32 x, s32 y, u32 width, u32 height, s32 alpha, u8* te gDPLoadMultiTile(gDisplayListHead++, texture2, 256, G_TX_RENDERTILE + 1, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, height, 0, 0, width - 1, height - 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - func_8004B950(x, y, width, height, 2); + render_texture_rectangle_wrap(x, y, width, height, 2); gSPDisplayList(gDisplayListHead++, D_0D008120); } @@ -1736,12 +1736,12 @@ void draw_hud_2d_texture(s32 x, s32 y, u32 width, u32 height, u8* texture) { gSPDisplayList(gDisplayListHead++, D_0D007EB8); } -void func_8004C450(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) { +void func_8004C450(s32 x, s32 y, u32 width, u32 height, u8* texture) { gSPDisplayList(gDisplayListHead++, D_0D007F38); func_8004B614(D_801656C0, D_801656D0, D_801656E0, 0x80, 0x80, 0x80, 0xFF); - load_texture_block_rgba16_mirror(texture, arg2, arg3); - func_8004B97C(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 1); + load_texture_block_rgba16_mirror(texture, width, height); + func_8004B97C(x - (width >> 1), y - (height >> 1), width, height, 1); gSPDisplayList(gDisplayListHead++, D_0D007EB8); } @@ -1764,56 +1764,51 @@ void func_8004C628(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) { gSPDisplayList(gDisplayListHead++, D_0D007EB8); } -#ifdef NON_MATCHING -// https://decomp.me/scratch/TqXqn -// There's a weird fakematch concerning `athing`, don't know that to make of. Can't quite get it over the finish line -// though -void func_8004C6FC(s16 arg0, s16 arg1, u8* texture, u32 width, u32 arg4) { - s32 temp_v0_3; - s32 var_s3; - s32 var_s4; - s32 athing; - s32 temp_t3; - u32 temp_t8; - s32 heigth; - s32 var_s6; +void render_texture_tile_rgba32_block(s16 x, s16 y, u8* texture, u32 width, u32 height) { + s32 texSizeLess; + s32 i; + s32 centerY; + s32 centerX; + s32 numTextureBlocks; + u32 texSize; + s32 heightDiv; + s32 size; u8* textureCopy; - athing = arg0 - (width / 2); - var_s4 = arg1 - (arg4 / 2); + centerX = x - (width / 2); + centerY = y - (height / 2); textureCopy = texture; gSPDisplayList(gDisplayListHead++, D_0D007EF8); gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); - temp_t8 = width * arg4 * 4; - temp_t3 = temp_t8 / 4096; - if (temp_t8 % 4096) { - temp_t3++; - } - heigth = arg4 / temp_t3; - var_s6 = temp_t3; - for (var_s3 = 0; var_s3 < var_s6; var_s3++) { - load_texture_tile_rgba32_nomirror(textureCopy, width, heigth); - func_8004B950(athing, var_s4, width, heigth, 1); - temp_v0_3 = temp_t8 - (width * heigth * 4); - textureCopy += (width * heigth * 4); - if (temp_v0_3 < 0) { - heigth = temp_t8 / width; + texSize = width * height * 4; + numTextureBlocks = texSize / 4096; + if (texSize % 4096) { + numTextureBlocks++; + } + heightDiv = height / numTextureBlocks; + size = numTextureBlocks; + for (i = 0; i < size; i++) { + load_texture_tile_rgba32_nomirror(textureCopy, width, heightDiv); + render_texture_rectangle_wrap(centerX, centerY, width, heightDiv, 1); + textureCopy += (width * heightDiv * 4); + texSizeLess = texSize - (width * heightDiv * 4); + if (texSizeLess < 0) { + heightDiv = texSize / width; } else { - temp_t8 = temp_v0_3; + texSize -= (width * heightDiv * 4); } - // Weird fakematch that is a HUGE improvement - athing += var_s4 * 0; - var_s4 += heigth; + + centerY += heightDiv; } gSPDisplayList(gDisplayListHead++, D_0D007EB8); + // FAKE + centerX++; + centerX--; } -#else -GLOBAL_ASM("asm/non_matchings/render_objects/func_8004C6FC.s") -#endif -void func_8004C8D4(s16 arg0, s16 arg1) { - func_8004C6FC(arg0, arg1, D_8018D1E0, 0x100, 0x80); +void render_game_logo(s16 x, s16 y) { + render_texture_tile_rgba32_block(x, y, gGameLogoAddress, 256, 128); } UNUSED void func_8004C91C(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4, s32 arg5) { @@ -2425,13 +2420,13 @@ void func_8004ED40(s32 arg0) { void func_8004EE54(s32 arg0) { if (gIsMirrorMode != 0) { - func_8004D4E8(D_8018D2C0[arg0] + D_8018D2F0, D_8018D2D8[arg0] + D_8018D2F8, (u8*) D_8018D240, (s32) D_8018D300, - (s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) D_8018D2B0, (s32) D_8018D2B8, - (s32) D_8018D2B0, (s32) D_8018D2B8); + func_8004D4E8(gMiniMapFinishLineX[arg0] + D_8018D2F0, gMiniMapFinishLineY[arg0] + D_8018D2F8, (u8*) D_8018D240, + (s32) D_8018D300, (s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) D_8018D2B0, + (s32) D_8018D2B8, (s32) D_8018D2B0, (s32) D_8018D2B8); } else { - func_8004D37C(D_8018D2C0[arg0] + D_8018D2F0, D_8018D2D8[arg0] + D_8018D2F8, (u8*) D_8018D240, (s32) D_8018D300, - (s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) D_8018D2B0, (s32) D_8018D2B8, - (s32) D_8018D2B0, (s32) D_8018D2B8); + func_8004D37C(gMiniMapFinishLineX[arg0] + D_8018D2F0, gMiniMapFinishLineY[arg0] + D_8018D2F8, (u8*) D_8018D240, + (s32) D_8018D300, (s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) D_8018D2B0, + (s32) D_8018D2B8, (s32) D_8018D2B0, (s32) D_8018D2B8); } } @@ -2445,12 +2440,13 @@ void func_8004EF9C(s32 arg0) { temp_t0, temp_v0, temp_t0); } -void func_8004F020(s32 arg0) { +void render_mini_map_finish_line(s32 arg0) { f32 var_f0; f32 var_f2; - var_f2 = ((D_8018D2C0[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + D_8018D2E0; - var_f0 = ((D_8018D2D8[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + D_8018D2E8; + var_f2 = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX; + var_f0 = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY; +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { /* irregular */ case COURSE_MARIO_RACEWAY: var_f0 = var_f0 - 2.0; @@ -2463,61 +2459,43 @@ void func_8004F020(s32 arg0) { break; } draw_hud_2d_texture_8x8(var_f2, var_f0, (u8*) common_texture_minimap_finish_line); +#else + +#endif } -#ifdef NON_MATCHING -// https://decomp.me/scratch/FxA1w -/** - * characterId of 8 appears to be a type of null check or control flow alteration. - */ -#define EXPLICIT_AND 1 -void func_8004F168(s32 arg0, s32 playerId, s32 characterId) { +void draw_minimap_character(s32 arg0, s32 playerId, s32 characterId) { f32 thing0; f32 thing1; - s16 temp_a0; - s16 temp_a1; + s16 x; + s16 y; Player* player = &gPlayerOne[playerId]; if (player->type & (1 << 15)) { - thing0 = player->pos[0] * D_8018D2A0; - thing1 = player->pos[2] * D_8018D2A0; - temp_a0 = ((D_8018D2C0[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + D_8018D2E0 + (s16) (thing0); - temp_a1 = ((D_8018D2D8[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + D_8018D2E8 + (s16) (thing1); + thing0 = player->pos[0] * gMiniMapMarkerScale; + thing1 = player->pos[2] * gMiniMapMarkerScale; + x = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX + (s16) (thing0); + y = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY + (s16) (thing1); + // huh? if (characterId != 8) { if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) { -#if EXPLICIT_AND == 1 - func_80046424(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f, - (u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, - 8, 8, 8, 8); -#else - func_80046424(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f, - (u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, - 8, 8, 8, 8); -#endif + func_80046424(x, y, player->rotation[1] + 0x8000, 1.0f, + (u8*) &common_texture_minimap_kart_mario[characterId * 64], + common_vtx_player_minimap_icon, 8, 8, 8, 8); } else { -#if EXPLICIT_AND == 1 - func_800463B0(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f, - (u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, - 8, 8, 8, 8); -#else - func_800463B0(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f, - (u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, - 8, 8, 8, 8); -#endif + func_800463B0(x, y, player->rotation[1] + 0x8000, 1.0f, + (u8*) &common_texture_minimap_kart_mario[characterId * 64], + common_vtx_player_minimap_icon, 8, 8, 8, 8); } } else { if (gGPCurrentRaceRankByPlayerId[playerId] == 0) { - func_8004C450(temp_a0, temp_a1, 8, 8, (u8*) common_texture_minimap_progress_dot); + func_8004C450(x, y, 8, 8, (u8*) common_texture_minimap_progress_dot); } else { - draw_hud_2d_texture(temp_a0, temp_a1, 8, 8, (u8*) common_texture_minimap_progress_dot); + draw_hud_2d_texture(x, y, 8, 8, (u8*) common_texture_minimap_progress_dot); } } } } -#undef EXPLICIT_AND -#else -GLOBAL_ASM("asm/non_matchings/render_objects/func_8004F168.s") -#endif // WTF is up with the gPlayerOne access in this function? void func_8004F3E4(s32 arg0) { @@ -2529,35 +2507,35 @@ void func_8004F3E4(s32 arg0) { case GRAND_PRIX: for (idx = D_8018D158 - 1; idx >= 0; idx--) { playerId = gGPCurrentRacePlayerIdByRank[idx]; - if ((gPlayerOne + playerId)->type & PLAYER_KART_AI) { - func_8004F168(arg0, playerId, 8); + if ((gPlayerOne + playerId)->type & PLAYER_CPU) { + draw_minimap_character(arg0, playerId, 8); } } for (idx = D_8018D158 - 1; idx >= 0; idx--) { playerId = gGPCurrentRacePlayerIdByRank[idx]; - if (((gPlayerOne + playerId)->type & PLAYER_KART_AI) != PLAYER_KART_AI) { - func_8004F168(arg0, playerId, (gPlayerOne + playerId)->characterId); + if (((gPlayerOne + playerId)->type & PLAYER_CPU) != PLAYER_CPU) { + draw_minimap_character(arg0, playerId, (gPlayerOne + playerId)->characterId); } } break; case TIME_TRIALS: for (idx = 0; idx < 8; idx++) { if (((gPlayerOne + idx)->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { - func_8004F168(arg0, idx, 8); + draw_minimap_character(arg0, idx, 8); } } - func_8004F168(arg0, 0, gPlayerOne->characterId); + draw_minimap_character(arg0, 0, gPlayerOne->characterId); break; case VERSUS: for (idx = gPlayerCountSelection1 - 1; idx >= 0; idx--) { playerId = gGPCurrentRacePlayerIdByRank[idx]; - func_8004F168(arg0, playerId, (gPlayerOne + playerId)->characterId); + draw_minimap_character(arg0, playerId, (gPlayerOne + playerId)->characterId); } break; case BATTLE: for (idx = 0; idx < gPlayerCountSelection1; idx++) { if (!((gPlayerOne + idx)->type & PLAYER_UNKNOWN_0x40)) { - func_8004F168(arg0, idx, (gPlayerOne + idx)->characterId); + draw_minimap_character(arg0, idx, (gPlayerOne + idx)->characterId); } } break; @@ -2839,11 +2817,11 @@ s32 func_80050644(u16 arg0, s32* arg1, s32* arg2) { } void func_800507D8(u16 bombIndex, s32* arg1, s32* arg2) { - s32 temp_v0 = gBombKarts[bombIndex].waypointIndex; + s32 temp_v0 = gBombKarts[bombIndex].pathPointIndex; s32 var_v1 = 0; if (temp_v0 != 0) { - var_v1 = (s32) (temp_v0 * 0x3A0) / (s32) D_80164430; + var_v1 = (s32) (temp_v0 * 0x3A0) / (s32) gSelectedPathCount; } if (var_v1 < 0x104) { *arg1 = var_v1; @@ -2965,25 +2943,19 @@ void func_80050C68(void) { } } -#ifdef NON_MATCHING - -// Something about the handling of the `player` variable is weird. -// All commands are present and correct, 2 of them are out of position -// https://decomp.me/scratch/PvJ5D void func_80050E34(s32 playerId, s32 arg1) { s32 objectIndex; s32 spD0; s32 spCC; - UNUSED s32 stackPadding; + Player* dummy = &gPlayerOne[playerId]; s32 spC4; s32 lapCount; s32 characterId; s32 spB8; s32 temp_v0_2; Object* object; - Player* player; + Player* player = &gPlayerOne[playerId]; - player = &gPlayerOne[playerId]; lapCount = gLapCountByPlayerId[playerId]; characterId = player->characterId; objectIndex = D_8018CE10[playerId].objectIndex; @@ -3048,9 +3020,6 @@ void func_80050E34(s32 playerId, s32 arg1) { } } } -#else -GLOBAL_ASM("asm/non_matchings/render_objects/func_80050E34.s") -#endif void func_800514BC(void) { s32 temp_a0; @@ -3069,12 +3038,12 @@ void func_800514BC(void) { for (var_s0 = var_s3 - 1, var_s1 = 0; var_s1 < var_s3; var_s1++, var_s0--) { temp_a0 = gGPCurrentRacePlayerIdByRank[var_s0]; player = &gPlayerOne[temp_a0]; - if ((player->type & 0x8000) && ((temp_a0 != 0) || (gPlayerCountSelection1 != 1))) { + if ((player->type & PLAYER_EXISTS) && ((temp_a0 != 0) || (gPlayerCountSelection1 != 1))) { func_80050E34(temp_a0, var_s0); } } if (gModeSelection == 1) { - func_80050E34(0, D_80164408[0]); + func_80050E34(0, gGPCurrentRaceRankByPlayerIdDup[0]); } else if (gPlayerCountSelection1 == 1) { func_80050E34(0, gGPCurrentRaceRankByPlayerId[0]); } @@ -3179,16 +3148,16 @@ void func_80051C60(s16 arg0, s32 arg1) { Object* object; if (D_801658FE == 0) { - if (gCurrentCourseId == 6) { + if (gCurrentCourseId == COURSE_KOOPA_BEACH) { var_s5 = arg0; - } else if (gCurrentCourseId == 9) { + } else if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { var_s5 = arg0 - 0x10; - } else if (gCurrentCourseId == 4) { + } else if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { var_s5 = arg0 - 0x10; } else { var_s5 = arg0 + 0x10; } - } else if (gCurrentCourseId == 6) { + } else if (gCurrentCourseId == COURSE_KOOPA_BEACH) { var_s5 = arg0 * 2; } else { var_s5 = arg0 + 0x20; @@ -3741,7 +3710,7 @@ void func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 vertexIndex) { } } -void func_80053E6C(s32 arg0) { +void render_object_grand_prix_balloons(s32 arg0) { s32 var_s1; s32 objectIndex; @@ -3757,7 +3726,7 @@ void func_80053E6C(s32 arg0) { func_80053D74(objectIndex, arg0, 0); } } - rsp_load_texture(D_8018D4C0, 0x40, 0x20); + rsp_load_texture(D_8018D4C0, 64, 32); for (var_s1 = 0; var_s1 < D_80165738; var_s1++) { objectIndex = gObjectParticle3[var_s1]; if ((objectIndex != NULL_OBJECT_ID) && (gObjectList[objectIndex].state >= 2)) { @@ -4512,12 +4481,12 @@ void func_800569F4(s32 playerIndex) { gObjectList[objectIndex].primAlpha = 0; } -void func_80056A40(s32 playerIndex, s32 arg1) { +void func_80056A40(s32 playerIndex, s32 primAlpha) { s32 objectIndex; objectIndex = gIndexObjectBombKart[playerIndex]; init_object(objectIndex, 0); - gObjectList[objectIndex].primAlpha = (s16) arg1; + gObjectList[objectIndex].primAlpha = (s16) primAlpha; } void func_80056A94(s32 playerIndex) { @@ -4687,7 +4656,8 @@ UNUSED void func_800573DC(void) { } void func_800573E4(s32 x, s32 y, s8 str) { - func_8004B7DC(x, y, 8, 8, (((str % 16) * 8) << 16) >> 16, (((unsigned short) (str / 16)) << 19) >> 16, 0); + render_texture_rectangle(x, y, 8, 8, (((str % 16) * 8) << 16) >> 16, (((unsigned short) (str / 16)) << 19) >> 16, + 0); } void debug_wrap_text(s32* x, s32* y) { diff --git a/src/render_objects.h b/src/render_objects.h index ed0419a952..05b65f2a5f 100644 --- a/src/render_objects.h +++ b/src/render_objects.h @@ -193,7 +193,7 @@ void set_color_render(s32, s32, s32, s32, s32, s32, s32); void func_8004B254(s32, s32, s32); void set_transparency(s32); void func_8004B310(s32); -void func_8004B35C(s32, s32, s32, s32); +void func_8004B35C(u32, u32, u32, u32); void func_8004B3C8(s32); void func_8004B414(s32, s32, s32, s32); void func_8004B480(s32, s32, s32); @@ -202,13 +202,13 @@ void func_8004B554(s32); void func_8004B5A8(s32, s32, s32, s32); void func_8004B614(s32, s32, s32, s32, s32, s32, s32); void func_8004B6C4(s32, s32, s32); -void func_8004B72C(s32, s32, s32, s32, s32, s32, s32); -void func_8004B950(s32, s32, s32, s32, s32); +void func_8004B72C(u32, u32, u32, u32, u32, u32, u32); +void render_texture_rectangle_wrap(s32, s32, s32, s32, s32); void func_8004BB34(void); void func_8004BB3C(s32, s32, s32, s32, f32); void func_8004BD14(s32, s32, u32, u32, s32, u8*, u8*); -void func_8004C6FC(s16, s16, u8*, u32, u32); +void render_texture_tile_rgba32_block(s16 x, s16 y, u8* texture, u32 width, u32 height); void func_8004C024(s16, s16, s16, u16, u16, u16, u16); void func_8004C148(s16, s16, s16, u16, u16, u16, u16); @@ -218,7 +218,7 @@ void draw_hud_2d_texture(s32, s32, u32, u32, u8*); void func_8004C450(s32, s32, u32, u32, u8*); void func_8004C53C(s32, s32, u32, u32, u8*); void func_8004C628(s32, s32, u32, u32, u8*); -void func_8004C8D4(s16, s16); +void render_game_logo(s16, s16); void func_8004C91C(s32, s32, u8*, s32, s32, s32); void func_8004C9D8(s32, s32, s32, u8*, s32, s32, s32, s32); void func_8004CA58(s32, s32, f32, u8*, s32, s32); @@ -294,8 +294,8 @@ void func_8004ED40(s32); void func_8004EE54(s32); void func_8004EF9C(s32); -void func_8004F020(s32); -void func_8004F168(s32, s32, s32); +void render_mini_map_finish_line(s32); +void draw_minimap_character(s32, s32, s32); void func_8004F3E4(s32); s32 func_8004F674(s32*, s32); void print_timer(s32, s32, s32); @@ -346,7 +346,7 @@ void func_800534E8(s32); void render_object_thwomps_model(s32); void render_object_thwomps(s32); void func_80053D74(s32, s32, s32); -void func_80053E6C(s32); +void render_object_grand_prix_balloons(s32); void render_object_train_smoke_particle(s32, s32); void render_object_trains_smoke_particles(s32); @@ -441,8 +441,8 @@ extern Vec3su D_80183E80; extern f32 D_8018CFEC; extern f32 D_8018CFF4; -extern s16 D_8018D2E0; -extern s16 D_8018D2E8; +extern s16 gMiniMapX; +extern s16 gMiniMapY; extern u8* D_8018D4BC; extern u8* D_8018D4C0; diff --git a/src/render_player.c b/src/render_player.c index a4a7809ee9..56243a654b 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -1,8 +1,10 @@ #include #include -#include #include #include +#include +#include + #include "code_800029B0.h" #include "camera.h" #include "math_util.h" @@ -15,7 +17,7 @@ #include "code_80057C60.h" #include "effects.h" #include "buffers.h" -#include "waypoints.h" +#include "path.h" #include "player_controller.h" #include "render_objects.h" #include @@ -47,7 +49,8 @@ u16 gPlayerYellowEffect[8]; UNUSED u16 gPlayerWhiteEffect[8]; s32 D_80164B80[296]; s16 D_80165020[40]; -Vec3f D_80165070[8]; +// Used to calculate difference between previous and current player velocity. +Vec3f gPlayerLastVelocity[8]; s16 gLastAnimFrameSelector[4][8]; s16 gLastAnimGroupSelector[4][8]; s16 D_80165150[4][8]; @@ -76,14 +79,14 @@ void func_8001F9E4(Player* player, Camera* camera, s8 screenId) { get_player_index_for_player(player); func_8001F980(&sp30, &sp2C); - player->unk_002 &= ~(2 << (screenId * 4)); - player->unk_002 &= ~(8 << (screenId * 4)); + player->unk_002 &= ~(UNK_002_UNKNOWN_0x2 << (screenId * 4)); + player->unk_002 &= ~(SIDE_OF_KART << (screenId * 4)); if (check_player_camera_collision(player, camera, (f32) (D_80165578 + sp30), (f32) (D_8016557A + sp2C)) == 1) { - player->unk_002 |= 2 << (screenId * 4); + player->unk_002 |= UNK_002_UNKNOWN_0x2 << (screenId * 4); } if (check_player_camera_collision(player, camera, (f32) D_80165580, (f32) D_80165582) == 1) { - player->unk_002 |= 8 << (screenId * 4); + player->unk_002 |= SIDE_OF_KART << (screenId * 4); } } @@ -178,7 +181,7 @@ void init_render_player(Player* player, Camera* camera, s8 playerId, s8 screenId if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { func_8001F9E4(player, camera, screenId); - temp_v0 = 2 << (screenId << 2); + temp_v0 = UNK_002_UNKNOWN_0x2 << (screenId << 2); if (temp_v0 == (player->unk_002 & temp_v0)) { if (!(player->type & PLAYER_START_SEQUENCE)) { func_8002934C(player, camera, screenId, playerId); @@ -190,7 +193,7 @@ void init_render_player(Player* player, Camera* camera, s8 playerId, s8 screenId } } func_8001F980(&sp4C, &sp48); - temp_v0_2 = 1 << (screenId << 2); + temp_v0_2 = CHANGING_ANIMATION << (screenId << 2); if ((temp_v0 == (player->unk_002 & temp_v0)) && (temp_v0_2 == (player->unk_002 & temp_v0_2))) { if ((check_player_camera_collision(player, camera, D_80165570 + sp4C, D_80165572 + sp48) == 1) & 0xFFFF) { gPlayersToRenderPlayerId[gPlayersToRenderCount] = (s16) playerId; @@ -421,7 +424,7 @@ void load_kart_texture_and_render_kart_particle_on_screen_four(void) { void try_rendering_player(Player* player, s8 playerId, s8 arg2) { if (((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) && ((player->type & PLAYER_UNKNOWN_0x40) == 0)) { - if ((player->unk_002 & 2 << (arg2 * 4)) == 2 << (arg2 * 4)) { + if ((player->unk_002 & UNK_002_UNKNOWN_0x2 << (arg2 * 4)) == UNK_002_UNKNOWN_0x2 << (arg2 * 4)) { render_player(player, playerId, arg2); } } @@ -480,7 +483,8 @@ void render_players_on_screen_one(void) { s32 junk[] = { 0, 0, 0 }; -Vtx* D_800DDBB4[] = { D_800E49C0, D_800E4AC0, D_800E4BC0, D_800E4CC0, D_800E4DC0, D_800E4EC0, D_800E4FD0, D_800E50D0 }; +Vtx* gPlayerVtx[] = { gPlayerOneVtx, gPlayerTwoVtx, gPlayerThreeVtx, gPlayerFourVtx, + gPlayerFiveVtx, gPlayerSixVtx, gPlayerSevenVtx, gPlayerEightVtx }; f32 gCharacterSize[] = { MARIO_SIZE, LUIGI_SIZE, YOSHI_SIZE, TOAD_SIZE, DK_SIZE, WARIO_SIZE, PEACH_SIZE, BOWSER_SIZE }; @@ -651,16 +655,16 @@ void func_80021B0C(void) { func_8006E7CC(gPlayerEight, 7, 0); } if (gGamestate == ENDING) { - if (gPlayerOne->unk_044 & 0x2000) { + if (gPlayerOne->kartProps & UNUSED_0x2000) { render_player_shadow_credits(gPlayerOne, 0, 0); } - if (gPlayerTwo->unk_044 & 0x2000) { + if (gPlayerTwo->kartProps & UNUSED_0x2000) { render_player_shadow_credits(gPlayerTwo, 1, 0); } - if (gPlayerThree->unk_044 & 0x2000) { + if (gPlayerThree->kartProps & UNUSED_0x2000) { render_player_shadow_credits(gPlayerThree, 2, 0); } - if (gPlayerFour->unk_044 & 0x2000) { + if (gPlayerFour->kartProps & UNUSED_0x2000) { render_player_shadow_credits(gPlayerFour, 3, 0); } } @@ -893,10 +897,10 @@ void func_8002276C(void) { break; case TIME_TRIALS: /* switch 1 */ func_80022A98(gPlayerOne, 0); - if ((gPlayerTwo->type & 0x100) == 0x100) { + if ((gPlayerTwo->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { func_80022A98(gPlayerTwo, 1); } - if ((gPlayerThree->type & 0x100) == 0x100) { + if ((gPlayerThree->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { func_80022A98(gPlayerThree, 2); } break; @@ -949,25 +953,26 @@ void func_8002276C(void) { } } -void func_80022A98(Player* player, s8 arg1) { +void func_80022A98(Player* player, s8 playerIndex) { if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { - func_80026A48(player, arg1); - func_800235AC(player, arg1); - if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x08000000) == 0x08000000)) { - if ((player->effects & HIT_EFFECT) == HIT_EFFECT) { - func_80022B50(player, arg1); + func_80026A48(player, playerIndex); + func_800235AC(player, playerIndex); + if (((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) || + ((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT)) { + if ((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) { + func_80022B50(player, playerIndex); } - if ((player->effects & 0x08000000) == 0x08000000) { - func_80022BC4(player, arg1); + if ((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT) { + func_80022BC4(player, playerIndex); } } else { - func_80022DB4(player, arg1); + func_80022DB4(player, playerIndex); } func_80030A34(player); } } -void func_80022B50(Player* player, UNUSED s8 arg1) { +void func_80022B50(Player* player, UNUSED s8 playerIndex) { f32 temp_f0; s16 var_v0; @@ -982,7 +987,7 @@ void func_80022B50(Player* player, UNUSED s8 arg1) { player->unk_DB4.unk2 = var_v0; } -void func_80022BC4(Player* player, UNUSED s8 arg1) { +void func_80022BC4(Player* player, UNUSED s8 playerIndex) { f32 temp_f0 = player->unk_DB4.unk10; s16 temp_v0 = player->unk_DB4.unk2; s16 temp_f16; @@ -995,7 +1000,7 @@ void func_80022BC4(Player* player, UNUSED s8 arg1) { temp_f0 *= 0.8; temp_v0 = 0; if (temp_f0 <= 0.1) { - player->effects &= 0xF7FFFFFF; + player->effects &= ~POST_SQUISH_EFFECT; temp_f0 = 0.0f; } } @@ -1007,27 +1012,28 @@ void func_80022BC4(Player* player, UNUSED s8 arg1) { player->unk_DB4.unk2 = temp_v0; } -void func_80022CA8(Player* player, s8 playerId, UNUSED s8 screenId, s8 arg3) { +// look like related to flatten animation +void func_80022CA8(Player* player, s8 playerId, UNUSED s8 screenId, s8 flipOffset) { s16 temp_v0 = player->unk_DA4; - D_800DDBB4[playerId][arg3 + 0x0].v.ob[1] = 18 - (temp_v0 * 2.3); - D_800DDBB4[playerId][arg3 + 0x1].v.ob[1] = 9 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x2].v.ob[1] = 9 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x3].v.ob[1] = 18 - (temp_v0 * 2.3); - D_800DDBB4[playerId][arg3 + 0x4].v.ob[1] = 9 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x7].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x0].v.ob[1] = 18 - (temp_v0 * 2.3); + gPlayerVtx[playerId][flipOffset + 0x1].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x2].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x3].v.ob[1] = 18 - (temp_v0 * 2.3); + gPlayerVtx[playerId][flipOffset + 0x4].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x7].v.ob[1] = 9 - temp_v0; } /** * Seems to stretch/warp a specific players texture for a * short period of time. Perhaps does not do anything **/ -void func_80022D60(UNUSED Player* player, s8 playerId, UNUSED s8 screenId, s8 arg3) { - D_800DDBB4[playerId][arg3].v.ob[1] = 21; - D_800DDBB4[playerId][arg3 + 0x3].v.ob[1] = 21; +void func_80022D60(UNUSED Player* player, s8 playerId, UNUSED s8 screenId, s8 flipOffset) { + gPlayerVtx[playerId][flipOffset].v.ob[1] = 21; + gPlayerVtx[playerId][flipOffset + 0x3].v.ob[1] = 21; } -void func_80022DB4(Player* player, UNUSED s8 arg1) { +void func_80022DB4(Player* player, UNUSED s8 playerIndex) { f32 temp_f0 = player->unk_DB4.unkC; s16 temp_v0 = player->unk_DB4.unk18; s16 temp_f16; @@ -1051,53 +1057,57 @@ void func_80022DB4(Player* player, UNUSED s8 arg1) { player->unk_DB4.unk18 = temp_v0; } -void func_80022E84(Player* player, s8 playerId, UNUSED s8 screenId, s8 arg3) { +void func_80022E84(Player* player, s8 playerId, UNUSED s8 screenId, s8 flipOffset) { s16 temp_v0 = player->unk_DB4.unk1E; - D_800DDBB4[playerId][arg3 + 0x0].v.ob[1] = 18 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x1].v.ob[1] = 9 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x2].v.ob[1] = 9 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x3].v.ob[1] = 18 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x4].v.ob[1] = 9 - temp_v0; - D_800DDBB4[playerId][arg3 + 0x7].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x0].v.ob[1] = 18 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x1].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x2].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x3].v.ob[1] = 18 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x4].v.ob[1] = 9 - temp_v0; + gPlayerVtx[playerId][flipOffset + 0x7].v.ob[1] = 9 - temp_v0; } /** * Sets player shading/colour. */ -void change_player_color_effect_rgb(UNUSED Player* player, s8 arg1, s32 arg2, f32 alpha) { - gPlayerRedEffect[arg1] = - (s16) ((f32) gPlayerRedEffect[arg1] - ((gPlayerRedEffect[arg1] - ((arg2 >> 16) & 0xFF)) * alpha)); +void change_player_color_effect_rgb(UNUSED Player* player, s8 playerIndex, s32 arg2, f32 alpha) { + gPlayerRedEffect[playerIndex] = + (s16) ((f32) gPlayerRedEffect[playerIndex] - ((gPlayerRedEffect[playerIndex] - ((arg2 >> 16) & 0xFF)) * alpha)); - gPlayerGreenEffect[arg1] = - (s16) ((f32) gPlayerGreenEffect[arg1] - ((gPlayerGreenEffect[arg1] - ((arg2 >> 8) & 0xFF)) * alpha)); + gPlayerGreenEffect[playerIndex] = (s16) ((f32) gPlayerGreenEffect[playerIndex] - + ((gPlayerGreenEffect[playerIndex] - ((arg2 >> 8) & 0xFF)) * alpha)); - gPlayerBlueEffect[arg1] = - (s16) ((f32) gPlayerBlueEffect[arg1] - ((gPlayerBlueEffect[arg1] - (arg2 & 0xFF)) * alpha)); + gPlayerBlueEffect[playerIndex] = + (s16) ((f32) gPlayerBlueEffect[playerIndex] - ((gPlayerBlueEffect[playerIndex] - (arg2 & 0xFF)) * alpha)); } -void change_player_color_effect_cmy(UNUSED Player* player, s8 arg1, s32 arg2, f32 arg3) { - move_u16_towards(&gPlayerCyanEffect[arg1], (arg2 >> 16) & 0xFF, arg3); - move_u16_towards(&gPlayerMagentaEffect[arg1], (arg2 >> 8) & 0xFF, arg3); - move_u16_towards(&gPlayerYellowEffect[arg1], arg2 & 0xFF, arg3); +void change_player_color_effect_cmy(UNUSED Player* player, s8 playerIndex, s32 arg2, f32 arg3) { + move_u16_towards(&gPlayerCyanEffect[playerIndex], (arg2 >> 16) & 0xFF, arg3); + move_u16_towards(&gPlayerMagentaEffect[playerIndex], (arg2 >> 8) & 0xFF, arg3); + move_u16_towards(&gPlayerYellowEffect[playerIndex], arg2 & 0xFF, arg3); } /** * Activates in the tunnel to shade the player a bit darker * Sort of an atmospheric effect. */ -bool is_player_under_light_luigi_raceway(Player* player, s8 arg1) { +bool is_player_under_light_luigi_raceway(Player* player, s8 playerIndex) { switch (gCurrentCourseId) { case COURSE_LUIGI_RACEWAY: - if (((gNearestWaypointByPlayerId[arg1] >= 0x14F) && (gNearestWaypointByPlayerId[arg1] < 0x158)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x15E) && (gNearestWaypointByPlayerId[arg1] < 0x164)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x169) && (gNearestWaypointByPlayerId[arg1] < 0x170)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x174) && (gNearestWaypointByPlayerId[arg1] < 0x17A)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x17E) && - (gNearestWaypointByPlayerId[arg1] < 0x184))) { // under a light in the tunnel - change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f); - change_player_color_effect_cmy(player, arg1, 0xE0, 0.3f); - D_80164B80[arg1] = 0; + if (((gNearestPathPointByPlayerId[playerIndex] >= 0x14F) && + (gNearestPathPointByPlayerId[playerIndex] < 0x158)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x15E) && + (gNearestPathPointByPlayerId[playerIndex] < 0x164)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x169) && + (gNearestPathPointByPlayerId[playerIndex] < 0x170)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x174) && + (gNearestPathPointByPlayerId[playerIndex] < 0x17A)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x17E) && + (gNearestPathPointByPlayerId[playerIndex] < 0x184))) { // under a light in the tunnel + change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0xE0, 0.3f); + D_80164B80[playerIndex] = 0; return true; } return false; @@ -1107,172 +1117,199 @@ bool is_player_under_light_luigi_raceway(Player* player, s8 arg1) { } } -void render_light_environment_on_player(Player* player, s8 arg1) { +void render_light_environment_on_player(Player* player, s8 playerIndex) { switch (gCurrentCourseId) { case COURSE_BOWSER_CASTLE: - if (((gNearestWaypointByPlayerId[arg1] >= 0x15) && (gNearestWaypointByPlayerId[arg1] < 0x2A)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x14D) && (gNearestWaypointByPlayerId[arg1] < 0x15C)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x1D1) && (gNearestWaypointByPlayerId[arg1] < 0x1E4)) || + if (((gNearestPathPointByPlayerId[playerIndex] >= 0x15) && + (gNearestPathPointByPlayerId[playerIndex] < 0x2A)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x14D) && + (gNearestPathPointByPlayerId[playerIndex] < 0x15C)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x1D1) && + (gNearestPathPointByPlayerId[playerIndex] < 0x1E4)) || (player->collision.surfaceDistance[2] >= 500.0f)) { // over lava - change_player_color_effect_rgb(player, arg1, COLOR_LAVA, 0.3f); - change_player_color_effect_cmy(player, arg1, 0x004040, 0.3f); - D_80164B80[arg1] = 0; - } else if (((gNearestWaypointByPlayerId[arg1] >= 0xF1) && (gNearestWaypointByPlayerId[arg1] < 0xF5)) || - ((gNearestWaypointByPlayerId[arg1] >= 0xFB) && (gNearestWaypointByPlayerId[arg1] < 0xFF)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x105) && (gNearestWaypointByPlayerId[arg1] < 0x109)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x10F) && (gNearestWaypointByPlayerId[arg1] < 0x113)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x145) && (gNearestWaypointByPlayerId[arg1] < 0x14A)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x15E) && - (gNearestWaypointByPlayerId[arg1] < 0x163))) { // under a lamp - change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f); - change_player_color_effect_cmy(player, arg1, 0xE0, 0.3f); - D_80164B80[arg1] = 0; + change_player_color_effect_rgb(player, playerIndex, COLOR_LAVA, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0x004040, 0.3f); + D_80164B80[playerIndex] = 0; + } else if (((gNearestPathPointByPlayerId[playerIndex] >= 0xF1) && + (gNearestPathPointByPlayerId[playerIndex] < 0xF5)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0xFB) && + (gNearestPathPointByPlayerId[playerIndex] < 0xFF)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x105) && + (gNearestPathPointByPlayerId[playerIndex] < 0x109)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x10F) && + (gNearestPathPointByPlayerId[playerIndex] < 0x113)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x145) && + (gNearestPathPointByPlayerId[playerIndex] < 0x14A)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x15E) && + (gNearestPathPointByPlayerId[playerIndex] < 0x163))) { // under a lamp + change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0xE0, 0.3f); + D_80164B80[playerIndex] = 0; } else { // normal color - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 0.3f); - change_player_color_effect_cmy(player, arg1, 0, 0.3f); - D_80164B80[arg1] = 0; + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.3f); + D_80164B80[playerIndex] = 0; } break; case COURSE_BANSHEE_BOARDWALK: - if (((gNearestWaypointByPlayerId[arg1] >= 0xD) && (gNearestWaypointByPlayerId[arg1] < 0x15)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x29) && (gNearestWaypointByPlayerId[arg1] < 0x39)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x46) && (gNearestWaypointByPlayerId[arg1] < 0x4E)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x5F) && (gNearestWaypointByPlayerId[arg1] < 0x67)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x7B) && (gNearestWaypointByPlayerId[arg1] < 0x86)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x9D) && (gNearestWaypointByPlayerId[arg1] < 0xA6)) || - ((gNearestWaypointByPlayerId[arg1] >= 0xB9) && (gNearestWaypointByPlayerId[arg1] < 0xC3)) || - ((gNearestWaypointByPlayerId[arg1] >= 0xB9) && (gNearestWaypointByPlayerId[arg1] < 0xC3)) || - ((gNearestWaypointByPlayerId[arg1] >= 0xD7) && (gNearestWaypointByPlayerId[arg1] < 0xE1)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x10E) && (gNearestWaypointByPlayerId[arg1] < 0x119)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x154) && (gNearestWaypointByPlayerId[arg1] < 0x15F)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x1EF) && (gNearestWaypointByPlayerId[arg1] < 0x1F7)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x202) && (gNearestWaypointByPlayerId[arg1] < 0x209)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x216) && (gNearestWaypointByPlayerId[arg1] < 0x21D)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x230) && (gNearestWaypointByPlayerId[arg1] < 0x23A)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x24C) && (gNearestWaypointByPlayerId[arg1] < 0x256)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x288) && (gNearestWaypointByPlayerId[arg1] < 0x269)) || - ((gNearestWaypointByPlayerId[arg1] >= 0x274) && - (gNearestWaypointByPlayerId[arg1] < 0x27E))) { // under a lamp - change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f); - change_player_color_effect_cmy(player, arg1, 0x0000E0, 0.3f); - D_80164B80[arg1] = 0; + if (((gNearestPathPointByPlayerId[playerIndex] >= 0xD) && + (gNearestPathPointByPlayerId[playerIndex] < 0x15)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x29) && + (gNearestPathPointByPlayerId[playerIndex] < 0x39)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x46) && + (gNearestPathPointByPlayerId[playerIndex] < 0x4E)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x5F) && + (gNearestPathPointByPlayerId[playerIndex] < 0x67)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x7B) && + (gNearestPathPointByPlayerId[playerIndex] < 0x86)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x9D) && + (gNearestPathPointByPlayerId[playerIndex] < 0xA6)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0xB9) && + (gNearestPathPointByPlayerId[playerIndex] < 0xC3)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0xB9) && + (gNearestPathPointByPlayerId[playerIndex] < 0xC3)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0xD7) && + (gNearestPathPointByPlayerId[playerIndex] < 0xE1)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x10E) && + (gNearestPathPointByPlayerId[playerIndex] < 0x119)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x154) && + (gNearestPathPointByPlayerId[playerIndex] < 0x15F)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x1EF) && + (gNearestPathPointByPlayerId[playerIndex] < 0x1F7)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x202) && + (gNearestPathPointByPlayerId[playerIndex] < 0x209)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x216) && + (gNearestPathPointByPlayerId[playerIndex] < 0x21D)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x230) && + (gNearestPathPointByPlayerId[playerIndex] < 0x23A)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x24C) && + (gNearestPathPointByPlayerId[playerIndex] < 0x256)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x288) && + (gNearestPathPointByPlayerId[playerIndex] < 0x269)) || + ((gNearestPathPointByPlayerId[playerIndex] >= 0x274) && + (gNearestPathPointByPlayerId[playerIndex] < 0x27E))) { // under a lamp + change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0x0000E0, 0.3f); + D_80164B80[playerIndex] = 0; } else { - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 0.3f); - change_player_color_effect_cmy(player, arg1, 0, 0.3f); - D_80164B80[arg1] = 0; + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.3f); + D_80164B80[playerIndex] = 0; } break; default: - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 0.3f); - change_player_color_effect_cmy(player, arg1, 0, 0.3f); - D_80164B80[arg1] = 0; + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.3f); + D_80164B80[playerIndex] = 0; break; } } -void func_800235AC(Player* player, s8 arg1) { - s32 temp; +void func_800235AC(Player* player, s8 playerIndex) { + s32 time_elapsed; if (((player->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) && (player == gPlayerThree)) { - change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f); - change_player_color_effect_cmy(player, arg1, 0xE0, 0.3f); - D_80164B80[arg1] = 0; + change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0xE0, 0.3f); + D_80164B80[playerIndex] = 0; return; } - if (((player->unk_0CA & 0x10) == 0x10) && ((player->unk_0CA & 4) == 4)) { - change_player_color_effect_rgb(player, arg1, 0x646464, 0.5f); - change_player_color_effect_cmy(player, arg1, 0xFF0000, 0.1f); + if (((player->lakituProps & FRIGID_EFFECT) == FRIGID_EFFECT) && + ((player->lakituProps & LAKITU_FIZZLE) == LAKITU_FIZZLE)) { + change_player_color_effect_rgb(player, playerIndex, 0x646464, 0.5f); + change_player_color_effect_cmy(player, playerIndex, 0xFF0000, 0.1f); return; } - if ((player->unk_0CA & 4) == 4) { - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 1.0f); - change_player_color_effect_cmy(player, arg1, 0, 1.0f); + if ((player->lakituProps & LAKITU_FIZZLE) == LAKITU_FIZZLE) { + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 1.0f); + change_player_color_effect_cmy(player, playerIndex, 0, 1.0f); return; } - if ((player->unk_0CA & 0x10) == 0x10) { - change_player_color_effect_rgb(player, arg1, 0x646464, 0.5f); - change_player_color_effect_cmy(player, arg1, 0xFF0000, 0.1f); + if ((player->lakituProps & FRIGID_EFFECT) == FRIGID_EFFECT) { + change_player_color_effect_rgb(player, playerIndex, 0x646464, 0.5f); + change_player_color_effect_cmy(player, playerIndex, 0xFF0000, 0.1f); return; } - if ((player->unk_0CA & 0x20) == 0x20) { - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 0.1f); - change_player_color_effect_cmy(player, arg1, 0, 0.1f); + if ((player->lakituProps & THAWING_EFFECT) == THAWING_EFFECT) { + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 0.1f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.1f); return; } if (((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && ((s32) player->unk_0B0 < 0x78)) { - D_80164B80[arg1] += 5; - if (D_80164B80[arg1] >= 0x1E) { - D_80164B80[arg1] = 0; + D_80164B80[playerIndex] += 5; + if (D_80164B80[playerIndex] >= 0x1E) { + D_80164B80[playerIndex] = 0; } - if ((D_80164B80[arg1] >= 0) && (D_80164B80[arg1] < 0xB)) { - change_player_color_effect_rgb(player, arg1, 0x808080, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if ((D_80164B80[playerIndex] >= 0) && (D_80164B80[playerIndex] < 0xB)) { + change_player_color_effect_rgb(player, playerIndex, 0x808080, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } - if ((D_80164B80[arg1] >= 0xB) && (D_80164B80[arg1] < 0x15)) { - change_player_color_effect_rgb(player, arg1, 0x70, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if ((D_80164B80[playerIndex] >= 0xB) && (D_80164B80[playerIndex] < 0x15)) { + change_player_color_effect_rgb(player, playerIndex, 0x70, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } - if ((D_80164B80[arg1] >= 0x15) && (D_80164B80[arg1] < 0x1F)) { - change_player_color_effect_rgb(player, arg1, 0x8F8F00, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if ((D_80164B80[playerIndex] >= 0x15) && (D_80164B80[playerIndex] < 0x1F)) { + change_player_color_effect_rgb(player, playerIndex, 0x8F8F00, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } return; } if ((player->effects & STAR_EFFECT) != 0) { - temp = (s32) gCourseTimer - D_8018D930[arg1]; - if (temp <= 8) { + time_elapsed = (s32) gCourseTimer - gPlayerStarEffectStartTime[playerIndex]; + if (time_elapsed <= 8) { - if (temp >= 7) { - D_80164B80[arg1] += 10; + if (time_elapsed >= 7) { + D_80164B80[playerIndex] += 10; } else { - D_80164B80[arg1] += 5; + D_80164B80[playerIndex] += 5; } - if (D_80164B80[arg1] >= 40) { - D_80164B80[arg1] = 0; + if (D_80164B80[playerIndex] >= 40) { + D_80164B80[playerIndex] = 0; } - if ((D_80164B80[arg1] >= 0) && (D_80164B80[arg1] <= 10)) { - change_player_color_effect_rgb(player, arg1, 0x70, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if ((D_80164B80[playerIndex] >= 0) && (D_80164B80[playerIndex] <= 10)) { + change_player_color_effect_rgb(player, playerIndex, 0x70, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } - if ((D_80164B80[arg1] >= 0xB) && (D_80164B80[arg1] <= 20)) { - change_player_color_effect_rgb(player, arg1, 0x707000, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if ((D_80164B80[playerIndex] >= 0xB) && (D_80164B80[playerIndex] <= 20)) { + change_player_color_effect_rgb(player, playerIndex, 0x707000, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } - if ((D_80164B80[arg1] >= 0x15) && (D_80164B80[arg1] <= 30)) { - change_player_color_effect_rgb(player, arg1, 0x700000, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if ((D_80164B80[playerIndex] >= 0x15) && (D_80164B80[playerIndex] <= 30)) { + change_player_color_effect_rgb(player, playerIndex, 0x700000, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } - if (D_80164B80[arg1] >= 0x1F) { - change_player_color_effect_rgb(player, arg1, 0x7000, 0.8f); - change_player_color_effect_cmy(player, arg1, 0, 0.8f); + if (D_80164B80[playerIndex] >= 0x1F) { + change_player_color_effect_rgb(player, playerIndex, 0x7000, 0.8f); + change_player_color_effect_cmy(player, playerIndex, 0, 0.8f); } return; } } - if (is_player_under_light_luigi_raceway(player, arg1) != true) { + if (is_player_under_light_luigi_raceway(player, playerIndex) != true) { if (((player->tyres[BACK_RIGHT].unk_14 & 1) == 1) || ((player->tyres[BACK_RIGHT].unk_14 & 2) == 2) || ((player->tyres[FRONT_LEFT].unk_14 & 3) == 3)) { - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 0.3f); - change_player_color_effect_cmy(player, arg1, 0x6F6F6F, 0.3f); + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0x6F6F6F, 0.3f); return; } - render_light_environment_on_player(player, arg1); - if ((player->unk_0CA & 0x1000) == 0x1000) { - change_player_color_effect_rgb(player, arg1, COLOR_BLACK, 0.3f); - change_player_color_effect_cmy(player, arg1, 0xF0F0F0, 0.3f); + render_light_environment_on_player(player, playerIndex); + if ((player->lakituProps & LAKITU_LAVA) == LAKITU_LAVA) { + change_player_color_effect_rgb(player, playerIndex, COLOR_BLACK, 0.3f); + change_player_color_effect_cmy(player, playerIndex, 0xF0F0F0, 0.3f); } } } void func_80023BF0(Player* player, s8 playerId, s8 screenId, s8 arg3) { - if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x8000000) == 0x8000000)) { + if (((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) || + ((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT)) { func_80022CA8(player, playerId, screenId, arg3); } else { func_80022E84(player, playerId, screenId, arg3); } - if ((player->unk_0CA & 2) == 2) { + if ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) { func_80022D60(player, playerId, screenId, arg3); } } @@ -1296,11 +1333,15 @@ void render_player_shadow(Player* player, s8 playerId, s8 screenId) { spB0 = -coss(temp_t9 << 7) * 2; spAC = -sins(temp_t9 << 7) * 2; - if (((player->effects & 0x01000000) == 0x01000000) || ((player->effects & 0x400) == 0x400) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) || - ((player->effects & 0x400) == 0x400) || ((player->unk_0CA & 2) == 2) || - ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || ((player->effects & 0x10000) == 0x10000) || - ((player->effects & 8) == 8)) { + if (((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) || + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || + ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || + ((player->lakituProps & HELD_BY_LAKITU) == HELD_BY_LAKITU) || + ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) || + ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) || + ((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT)) { var_f2 = (f32) (1.0 - ((f64) player->collision.surfaceDistance[2] * 0.02)); if (var_f2 < 0.0f) { @@ -1336,16 +1377,17 @@ void render_player_shadow(Player* player, s8 playerId, s8 screenId) { gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D474, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, - G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gDisplayListHead++, gLoadedTextureKartShadow, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); func_8004B414(0, 0, 0, 0xFF); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, &D_800E51D0[0], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, (D_8018D474 + SOME_TEXTURE_POINTER_MATH), G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, - 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); + gDPLoadTextureBlock(gDisplayListHead++, (gLoadedTextureKartShadow + SOME_TEXTURE_POINTER_MATH), G_IM_FMT_I, + G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B414(0, 0, 0, 0xFF); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, &D_800E5210[0], 4, 0); @@ -1390,16 +1432,17 @@ void render_player_shadow_credits(Player* player, s8 playerId, s8 arg2) { gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); - gDPLoadTextureBlock(gDisplayListHead++, D_8018D474, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, - G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(gDisplayListHead++, gLoadedTextureKartShadow, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); func_8004B414(0, 0, 0, 0x000000D0); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, &D_800E51D0[0], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); - gDPLoadTextureBlock(gDisplayListHead++, (D_8018D474 + SOME_TEXTURE_POINTER_MATH), G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, - 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); + gDPLoadTextureBlock(gDisplayListHead++, (gLoadedTextureKartShadow + SOME_TEXTURE_POINTER_MATH), G_IM_FMT_I, + G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B414(0, 0, 0, 0x000000D0); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, &D_800E5210[0], 4, 0); @@ -1408,7 +1451,7 @@ void render_player_shadow_credits(Player* player, s8 playerId, s8 arg2) { gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); } -void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { +void render_kart(Player* player, s8 playerId, s8 arg2, s8 flipOffset) { UNUSED s32 pad; Mat4 sp1A4; UNUSED s32 pad2[17]; @@ -1420,7 +1463,7 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { s16 temp_v1; s16 thing; - if (player->unk_044 & 0x2000) { + if (player->kartProps & UNUSED_0x2000) { sp14C[0] = 0; sp14C[1] = player->unk_048[arg2]; sp14C[2] = 0; @@ -1431,14 +1474,14 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { } else { thing = (u16) (player->unk_048[arg2] + player->rotation[1] + player->unk_0C0); temp_v1 = player->unk_0CC[arg2] * sins(thing); - if ((player->effects & 8) == 8) { + if ((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT) { sp14C[0] = cameras[arg2].rot[0] - 0x4000; } else { sp14C[0] = -temp_v1 * 0.8; } sp14C[1] = player->unk_048[arg2]; sp14C[2] = player->unk_050[arg2]; - if (((s32) player->effects & HIT_EFFECT) == HIT_EFFECT) { + if (((s32) player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) { func_80062B18(&sp148, &sp144, &sp140, 0.0f, 8.0f, 0.0f, -player->unk_048[arg2], player->unk_050[arg2]); sp154[1] = (player->pos[1] - player->boundingBoxSize) + player->unk_108; sp154[0] = player->pos[0] + sp148; @@ -1477,7 +1520,7 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614(gPlayerRedEffect[playerId], gPlayerGreenEffect[playerId], gPlayerBlueEffect[playerId], gPlayerCyanEffect[playerId], gPlayerMagentaEffect[playerId], gPlayerYellowEffect[playerId], - (s32) player->unk_0C6); + (s32) player->alpha); gDPSetRenderMode(gDisplayListHead++, AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), @@ -1491,15 +1534,15 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614(gPlayerRedEffect[playerId], gPlayerGreenEffect[playerId], gPlayerBlueEffect[playerId], gPlayerCyanEffect[playerId], gPlayerMagentaEffect[playerId], gPlayerYellowEffect[playerId], - D_8018D970[playerId]); + gPlayerOtherScreensAlpha[playerId]); gDPSetRenderMode(gDisplayListHead++, AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); } - } else if (((player->unk_0CA & 4) == 4) || (player->soundEffects & 0x08000000) || - (player->soundEffects & 0x04000000)) { + } else if (((player->lakituProps & LAKITU_FIZZLE) == LAKITU_FIZZLE) || (player->triggers & BECOME_BOMB_EFFECT) || + (player->triggers & LOSE_BATTLE_EFFECT)) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[playerId + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, common_setting_render_character); @@ -1507,7 +1550,7 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614(gPlayerRedEffect[playerId], gPlayerGreenEffect[playerId], gPlayerBlueEffect[playerId], gPlayerCyanEffect[playerId], gPlayerMagentaEffect[playerId], gPlayerYellowEffect[playerId], - (s32) player->unk_0C6); + (s32) player->alpha); gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); } else { @@ -1518,26 +1561,26 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 arg3) { gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614(gPlayerRedEffect[playerId], gPlayerGreenEffect[playerId], gPlayerBlueEffect[playerId], gPlayerCyanEffect[playerId], gPlayerMagentaEffect[playerId], gPlayerYellowEffect[playerId], - (s32) player->unk_0C6); + (s32) player->alpha); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); } gDPLoadTextureBlock(gDisplayListHead++, sKartUpperTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gDPLoadTextureBlock(gDisplayListHead++, sKartLowerTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3 + 4], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset + 4], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE); } -void render_ghost(Player* player, s8 playerId, s8 screenId, s8 arg3) { +void render_ghost(Player* player, s8 playerId, s8 screenId, s8 flipOffset) { UNUSED s32 pad; Mat4 sp12C; UNUSED s32 pad2[17]; @@ -1602,19 +1645,19 @@ void render_ghost(Player* player, s8 playerId, s8 screenId, s8 arg3) { gDPLoadTextureBlock(gDisplayListHead++, sKartUpperTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gDPLoadTextureBlock(gDisplayListHead++, sKartLowerTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3 + 4], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset + 4], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE); } -void func_80025DE8(Player* player, s8 playerId, s8 screenId, s8 arg3) { +void func_80025DE8(Player* player, s8 playerId, s8 screenId, s8 flipOffset) { Mat4 spA8; Vec3f sp9C; Vec3s sp94; @@ -1646,19 +1689,19 @@ void func_80025DE8(Player* player, s8 playerId, s8 screenId, s8 arg3) { gDPLoadTextureBlock(gDisplayListHead++, sKartUpperTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gDPLoadTextureBlock(gDisplayListHead++, sKartLowerTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3 + 4], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset + 4], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); gMatrixEffectCount += 1; } -void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 arg3) { +void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 flipOffset) { Mat4 spA8; Vec3f sp9C; Vec3s sp94; @@ -1669,10 +1712,10 @@ void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 a sp9C[0] = player->pos[0]; sp9C[1] = player->unk_074 + (4.0f * player->size); sp9C[2] = player->pos[2]; - if (!(player->unk_002 & (4 << (screenId * 4)))) { - arg3 = 8; + if (!(player->unk_002 & (UNK_002_UNKNOWN_0x4 << (screenId * 4)))) { + flipOffset = 8; } else { - arg3 = 0; + flipOffset = 0; } mtxf_translate_rotate(spA8, sp9C, sp94); @@ -1685,17 +1728,17 @@ void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 a gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614(gPlayerRedEffect[playerId], gPlayerGreenEffect[playerId], gPlayerBlueEffect[playerId], gPlayerCyanEffect[playerId], gPlayerMagentaEffect[playerId], gPlayerYellowEffect[playerId], - (s16) player->unk_0C6 / 2); + (s16) player->alpha / 2); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); gDPLoadTextureBlock(gDisplayListHead++, sKartUpperTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gDPLoadTextureBlock(gDisplayListHead++, sKartLowerTexture, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPVertex(gDisplayListHead++, &D_800DDBB4[playerId][arg3 + 4], 4, 0); + gSPVertex(gDisplayListHead++, &gPlayerVtx[playerId][flipOffset + 4], 4, 0); gSPDisplayList(gDisplayListHead++, common_square_plain_render); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); gMatrixEffectCount += 1; @@ -1704,17 +1747,17 @@ void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 a void render_player(Player* player, s8 playerId, s8 screenId) { UNUSED s32 pad[2]; s32 temp_t1; - s32 var_v1; + s32 flipOffset; OSMesg* sp34; update_wheel_palette(player, playerId, screenId, D_801651D0[screenId][playerId]); - if (!(player->unk_002 & (4 << (screenId * 4)))) { - var_v1 = 0; + if (!(player->unk_002 & (UNK_002_UNKNOWN_0x4 << (screenId * 4)))) { + flipOffset = 0; } else { - var_v1 = 8; + flipOffset = 8; } - func_80023BF0(player, playerId, screenId, var_v1); - temp_t1 = 8 << (screenId * 4); + func_80023BF0(player, playerId, screenId, flipOffset); + temp_t1 = SIDE_OF_KART << (screenId * 4); if ((temp_t1 == (player->unk_002 & temp_t1)) && (player->collision.surfaceDistance[2] <= 50.0f) && (player->surfaceType != ICE)) { if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { @@ -1726,39 +1769,41 @@ void render_player(Player* player, s8 playerId, s8 screenId) { } } if ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB) { - render_kart(player, playerId, screenId, var_v1); + render_kart(player, playerId, screenId, flipOffset); } else { - render_ghost(player, playerId, screenId, var_v1); + render_ghost(player, playerId, screenId, flipOffset); } osRecvMesg(&gDmaMesgQueue, (OSMesg*) &sp34, OS_MESG_BLOCK); - if ((temp_t1 == (player->unk_002 & temp_t1)) && (player->surfaceType == ICE) && ((player->unk_0CA & 1) != 1) && + if ((temp_t1 == (player->unk_002 & temp_t1)) && (player->surfaceType == ICE) && + ((player->lakituProps & LAKITU_RETRIEVAL) != LAKITU_RETRIEVAL) && (player->collision.surfaceDistance[2] <= 30.0f)) { - render_player_ice_reflection(player, playerId, screenId, var_v1); + render_player_ice_reflection(player, playerId, screenId, flipOffset); } if (player->boostPower >= 2.0f) { - func_80025DE8(player, playerId, screenId, var_v1); + func_80025DE8(player, playerId, screenId, flipOffset); } } -void func_80026A48(Player* player, s8 arg1) { +void func_80026A48(Player* player, s8 playerIndex) { f32 temp_f0; - if (((player->effects & 0x4000) == 0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) { - player->unk_240 += D_800DDE74[8]; - if (player->unk_240 >= 0x400) { - player->unk_240 = 0; + if (((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) && + ((player->type & PLAYER_START_SEQUENCE) == 0)) { + player->tyreSpeed += D_800DDE74[8]; + if (player->tyreSpeed >= 0x400) { + player->tyreSpeed = 0; } return; } - temp_f0 = ((player->unk_094 * (1.0f + player->unk_104)) / 18.0f) * 216.0f; - if ((temp_f0 <= 1.0f) || (gIsPlayerTripleBButtonCombo[arg1] == true)) { - player->unk_240 = 0; + temp_f0 = ((player->speed * (1.0f + player->unk_104)) / 18.0f) * 216.0f; + if ((temp_f0 <= 1.0f) || (gIsPlayerTripleBButtonCombo[playerIndex] == true)) { + player->tyreSpeed = 0; } else { - player->unk_240 += D_800DDE74[(s32) (temp_f0 / 12.0f)]; + player->tyreSpeed += D_800DDE74[(s32) (temp_f0 / 12.0f)]; } - if (player->unk_240 >= 0x400) { - player->unk_240 = 0; + if (player->tyreSpeed >= 0x400) { + player->tyreSpeed = 0; } } @@ -1772,13 +1817,17 @@ void func_80026A48(Player* player, s8 arg1) { void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) { s16 frameId = gLastAnimFrameSelector[screenId][playerId]; s16 groupId = gLastAnimGroupSelector[screenId][playerId]; - s16 temp_t2 = player->unk_240; + s16 temp_t2 = player->tyreSpeed; s16 temp_num = 0x40; // setting this as a variable gets rid of regalloc - if (((player->effects & 0x4000) == 0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) { - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) && - ((player->effects & 0x20000) != 0x20000) && ((player->effects & 0x80000) != 0x80000) && - ((player->effects & 0x800000) != 0x800000) && ((player->unk_044 & 0x800) == 0)) { + if (((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) && + ((player->type & PLAYER_START_SEQUENCE) == 0)) { + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && + ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) && + ((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) && + ((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) && + ((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) && + ((player->kartProps & UNUSED_0x800) == 0)) { if (frameId <= 20) { load_player_data_non_blocking(player, @@ -1805,9 +1854,12 @@ void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) { } } } else { - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) && - ((player->effects & 0x80000) != 0x80000) && ((player->effects & 0x800000) != 0x800000) && - ((player->effects & 0x20000) != 0x20000) && ((player->unk_044 & 0x800) == 0)) { + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && + ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) && + ((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) && + ((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) && + ((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) && + ((player->kartProps & UNUSED_0x800) == 0)) { if (frameId <= 20) { load_player_data_non_blocking(player, diff --git a/src/render_player.h b/src/render_player.h index f4e2067f2a..6a635af05a 100644 --- a/src/render_player.h +++ b/src/render_player.h @@ -85,14 +85,14 @@ extern u16 gPlayerMagentaEffect[]; extern u16 gPlayerYellowEffect[]; extern s32 D_80164B80[]; -extern s32 D_8018D930[]; +extern s32 gPlayerStarEffectStartTime[]; extern Gfx common_square_plain_render[]; extern Gfx D_0D008D58[]; extern s32 gPlayersToRenderCount; extern void* D_800DDB5C[]; -extern Vtx* D_800DDBB4[]; +extern Vtx* gPlayerVtx[]; extern f32 gCharacterSize[]; extern s32 D_800DDE74[]; extern Vtx D_800E51D0[]; @@ -102,14 +102,14 @@ extern f64 D_800ED688; extern f32 D_800ED6A8; // There are actually found in data_0DD0A0_2_0.s -extern Vtx D_800E49C0[]; -extern Vtx D_800E4AC0[]; -extern Vtx D_800E4BC0[]; -extern Vtx D_800E4CC0[]; -extern Vtx D_800E4DC0[]; -extern Vtx D_800E4EC0[]; -extern Vtx D_800E4FD0[]; -extern Vtx D_800E50D0[]; +extern Vtx gPlayerOneVtx[]; +extern Vtx gPlayerTwoVtx[]; +extern Vtx gPlayerThreeVtx[]; +extern Vtx gPlayerFourVtx[]; +extern Vtx gPlayerFiveVtx[]; +extern Vtx gPlayerSixVtx[]; +extern Vtx gPlayerSevenVtx[]; +extern Vtx gPlayerEightVtx[]; extern u8** gKartMarioWheels0[]; extern u8** gKartMarioWheels1[]; @@ -278,7 +278,7 @@ extern u8* gKartWario189Wheel0[]; extern u8* gKartWario189Wheel0[]; extern s16 D_80165020[40]; -extern Vec3f D_80165070[8]; +extern Vec3f gPlayerLastVelocity[8]; extern s16 gLastAnimFrameSelector[4][8]; extern s16 gLastAnimGroupSelector[4][8]; extern s16 D_80165150[4][8]; diff --git a/src/replays.c b/src/replays.c new file mode 100644 index 0000000000..d8749c649c --- /dev/null +++ b/src/replays.c @@ -0,0 +1,613 @@ +/* + * @file Replays + * Handles 3 types of time trial replays: + * 1. Post time trial replays, which a player can watch after a time trial + * 2. Player ghosts, which were driven by a player and can be raced against + * 3. Staff ghosts, which can be unlocked on the raceway tracks with a fast enough time + * All 3 use the same system for storing / replaying the inputs to reproduce a time trial + * See process_post_time_trial_replay for additional technical details + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "main.h" +#include "code_800029B0.h" +#include "buffers.h" +#include "save.h" +#include "replays.h" +#include "code_8006E9C0.h" +#include "menu_items.h" +#include "code_80057C60.h" +#include "kart_dma.h" + +extern s32 mio0encode(s32 input, s32, s32); +extern s32 func_80040174(void*, s32, s32); + +u8* sReplayGhostBuffer; +s16 sReplayGhostBufferSize; +s16 D_80162D86; + +static u16 sPlayerGhostButtonsPrev; +static u32 sPlayerGhostFramesRemaining; +static s16 sPlayerGhostReplayIdx; +static u32* sPlayerGhostReplay; + +static u16 sButtonsPrevCourseGhost; +static u32 sCourseGhostFramesRemaining; +static s16 sCourseGhostReplayIdx; +static u32* sCourseGhostReplay; + +static u16 sPostTTButtonsPrev; +static s32 sPostTTFramesRemaining; +static s16 sPostTTReplayIdx; +static u32* sPostTTReplay; + +static s16 sPlayerInputIdx; +static u32* sPlayerInputs; + +static u16 sPrevCourseId; +u32 D_80162DC4; +s32 D_80162DC8; +s32 D_80162DCC; +s32 D_80162DD0; +u16 bPlayerGhostDisabled; +u16 bCourseGhostDisabled; +u16 D_80162DD8; +s32 D_80162DDC; +s32 D_80162DE0; // ghost kart id? +s32 D_80162DE4; +s32 D_80162DE8; +UNUSED static s32 sUnusedReplayCounter; +s32 gPauseTriggered; +UNUSED static s32 bUnusedCourseGhostDisabled; +s32 gPostTimeTrialReplayCannotSave; +s32 D_80162DFC; + +s32 D_80162E00; + +u32* sReplayGhostEncoded = (u32*) &D_802BFB80.arraySize8[0][2][3]; +u32* gReplayGhostCompressed = (u32*) &D_802BFB80.arraySize8[1][1][3]; + +extern s32 gLapCountByPlayerId[]; + +extern StaffGhost* d_mario_raceway_staff_ghost; +extern StaffGhost* d_royal_raceway_staff_ghost; +extern StaffGhost* d_luigi_raceway_staff_ghost; + +void load_course_ghost(void) { + sCourseGhostReplay = (u32*) &D_802BFB80.arraySize8[0][2][3]; + osInvalDCache(&sCourseGhostReplay[0], 0x4000); + osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(D_80162DC4)], + sCourseGhostReplay, 0x4000, &gDmaMesgQueue); + osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); + sCourseGhostFramesRemaining = (*sCourseGhostReplay & REPLAY_FRAME_COUNTER); + sCourseGhostReplayIdx = 0; +} + +void load_post_time_trial_replay(void) { + sPostTTReplay = (u32*) &D_802BFB80.arraySize8[0][D_80162DD0][3]; + sPostTTFramesRemaining = *sPostTTReplay & REPLAY_FRAME_COUNTER; + sPostTTReplayIdx = 0; +} + +void load_player_ghost(void) { + sPlayerGhostReplay = (u32*) &D_802BFB80.arraySize8[0][D_80162DC8][3]; + sPlayerGhostFramesRemaining = (s32) *sPlayerGhostReplay & REPLAY_FRAME_COUNTER; + sPlayerGhostReplayIdx = 0; +} +/** + * Activates staff ghost if time trial lap time is low enough + * + */ +#ifdef VERSION_EU +#define GHOST_UNLOCK_MARIO 10700 +#define GHOST_UNLOCK_ROYAL 19300 +#define GHOST_UNLOCK_LUIGI 13300 +#else +#define GHOST_UNLOCK_MARIO 9000 +#define GHOST_UNLOCK_ROYAL 16000 +#define GHOST_UNLOCK_LUIGI 11200 + +#endif + +void set_staff_ghost(void) { + u32 bestTime; // Appears to be best player 3lap time. +#if !ENABLE_CUSTOM_COURSE_ENGINE + switch (gCurrentCourseId) { + case COURSE_MARIO_RACEWAY: + bestTime = func_800B4E24(0) & 0xfffff; + if (bestTime <= GHOST_UNLOCK_MARIO) { + bCourseGhostDisabled = 0; + bUnusedCourseGhostDisabled = 0; + } else { + bCourseGhostDisabled = 1; + bUnusedCourseGhostDisabled = 1; + } + D_80162DC4 = (u32) &d_mario_raceway_staff_ghost; + D_80162DE4 = 0; + break; + case COURSE_ROYAL_RACEWAY: + bestTime = func_800B4E24(0) & 0xfffff; + if (bestTime <= GHOST_UNLOCK_ROYAL) { + bCourseGhostDisabled = 0; + bUnusedCourseGhostDisabled = 0; + } else { + bCourseGhostDisabled = 1; + bUnusedCourseGhostDisabled = 1; + } + D_80162DC4 = (u32) &d_royal_raceway_staff_ghost; + D_80162DE4 = 6; + break; + case COURSE_LUIGI_RACEWAY: + bestTime = func_800B4E24(0) & 0xfffff; + if (bestTime <= GHOST_UNLOCK_LUIGI) { + bCourseGhostDisabled = 0; + bUnusedCourseGhostDisabled = 0; + } else { + bCourseGhostDisabled = 1; + bUnusedCourseGhostDisabled = 1; + } + D_80162DC4 = (u32) &d_luigi_raceway_staff_ghost; + D_80162DE4 = 1; + break; + default: + bCourseGhostDisabled = 1; + bUnusedCourseGhostDisabled = 1; + } +#else + +#endif +} + +s32 func_800051C4(void) { + s32 phi_v0; + + if (sReplayGhostBufferSize != 0) { + // func_80040174 in mio0_decode.s + func_80040174((void*) sReplayGhostBuffer, (sReplayGhostBufferSize * 4) + 0x20, (s32) sReplayGhostEncoded); + phi_v0 = + mio0encode((s32) sReplayGhostEncoded, (sReplayGhostBufferSize * 4) + 0x20, (s32) gReplayGhostCompressed); + return phi_v0 + 0x1e; + } +} + +void func_8000522C(void) { + sPlayerGhostReplay = (u32*) &D_802BFB80.arraySize8[0][D_80162DC8][3]; + mio0decode((u8*) gReplayGhostCompressed, (u8*) sPlayerGhostReplay); + sPlayerGhostFramesRemaining = (s32) (*sPlayerGhostReplay & REPLAY_FRAME_COUNTER); + sPlayerGhostReplayIdx = 0; + D_80162E00 = 1; +} + +void func_800052A4(void) { + s16 temp_v0; + + if (D_80162DC8 == 1) { + D_80162DC8 = 0; + D_80162DCC = 1; + } else { + D_80162DC8 = 1; + D_80162DCC = 0; + } + temp_v0 = sPlayerInputIdx; + sReplayGhostBuffer = (void*) &D_802BFB80.arraySize8[0][D_80162DC8][3]; + sReplayGhostBufferSize = temp_v0; + D_80162D86 = temp_v0; +} + +void func_80005310(void) { + + if (gModeSelection == TIME_TRIALS) { + + set_staff_ghost(); + + if (sPrevCourseId != gCurrentCourseId) { + bPlayerGhostDisabled = 1; + } + + sPrevCourseId = (u16) gCurrentCourseId; + gPauseTriggered = 0; + sUnusedReplayCounter = 0; + gPostTimeTrialReplayCannotSave = 0; + + if (gModeSelection == TIME_TRIALS && gActiveScreenMode == SCREEN_MODE_1P) { + + if (D_8015F890 == 1) { + load_post_time_trial_replay(); + if (D_80162DD8 == 0) { + load_player_ghost(); + } + if (bCourseGhostDisabled == 0) { + load_course_ghost(); + } + } else { + + D_80162DD8 = 1U; + sPlayerInputs = (u32*) &D_802BFB80.arraySize8[0][D_80162DCC][3]; + sPlayerInputs[0] = -1; + sPlayerInputIdx = 0; + D_80162DDC = 0; + func_80091EE4(); + if (bPlayerGhostDisabled == 0) { + load_player_ghost(); + } + if (bCourseGhostDisabled == 0) { + load_course_ghost(); + } + } + } + } +} + +/* Special handling for buttons saved in replays. The listing of L_TRIG here is odd + * because it is not saved in the replay data structure. Possibly, L was initially deleted + * here to make way for the frame counter, but then the format changed when the stick + * coordinates were added */ +#define REPLAY_MASK (ALL_BUTTONS ^ (A_BUTTON | B_BUTTON | Z_TRIG | R_TRIG | L_TRIG)) + +/* Inputs for replays (including player and course ghosts) are saved in a s32[] where + each entry is a combination of the inputs and how long those inputs were held for. + In essence it's "These buttons were pressed and the joystick was in this position. + This was the case for X frames". + + bits 1-8: Stick X + bits 9-16: Stick Y + bits 17-24: Frame counter + bits 25-28: Unused + bit 29: R + bit 30: Z + bit 31: B + bit 32: A +*/ +void process_post_time_trial_replay(void) { + u32 inputs; + u32 stickBytes; + UNUSED u16 unk; + u16 buttons_temp; + s16 stickVal; + s16 buttons = 0; + + if (sPostTTReplayIdx >= 0x1000) { + gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU; + return; + } + + inputs = sPostTTReplay[sPostTTReplayIdx]; + stickBytes = inputs & REPLAY_STICK_X; + + // twos complement trick, converting singned 8-bit value to signed 16 bit + if (stickBytes < 0x80U) { + stickVal = (s16) (stickBytes & 0xFF); + } else { + stickVal = (s16) (stickBytes | (~0xFF)); + } + + stickBytes = (u32) (inputs & REPLAY_STICK_Y) >> 8; + gControllerEight->rawStickX = stickVal; + + if (stickBytes < 0x80U) { + stickVal = (s16) (stickBytes & 0xFF); + } else { + stickVal = (s16) (stickBytes | (~0xFF)); + } + gControllerEight->rawStickY = stickVal; + if (inputs & REPLAY_A_BUTTON) { + buttons |= A_BUTTON; + } + if (inputs & REPLAY_B_BUTTON) { + buttons |= B_BUTTON; + } + if (inputs & REPLAY_Z_TRIG) { + buttons |= Z_TRIG; + } + if (inputs & REPLAY_R_TRIG) { + buttons |= R_TRIG; + } + buttons_temp = gControllerEight->buttonPressed & REPLAY_MASK; + gControllerEight->buttonPressed = (buttons & (buttons ^ sPostTTButtonsPrev)) | buttons_temp; + buttons_temp = gControllerEight->buttonDepressed & REPLAY_MASK; + gControllerEight->buttonDepressed = (sPostTTButtonsPrev & (buttons ^ sPostTTButtonsPrev)) | buttons_temp; + sPostTTButtonsPrev = buttons; + gControllerEight->button = buttons; + + if (sPostTTFramesRemaining == 0) { + sPostTTReplayIdx++; + sPostTTFramesRemaining = (s32) (sPostTTReplay[sPostTTReplayIdx] & REPLAY_FRAME_COUNTER); + } else { + sPostTTFramesRemaining -= REPLAY_FRAME_INCREMENT; + } +} + +// See process_post_time_trial_replay comment +void process_course_ghost_replay(void) { + u32 inputs; + u32 stickBytes; + UNUSED u16 unk; + u16 buttonsTemp; + s16 stickVal; + s16 buttons = 0; + if (sCourseGhostReplayIdx >= 0x1000) { + func_80005AE8(gPlayerThree); + return; + } + + inputs = sCourseGhostReplay[sCourseGhostReplayIdx]; + stickBytes = inputs & REPLAY_STICK_X; + // converting signed 8-bit values to signed 16-bit values + if (stickBytes < 0x80U) { + stickVal = (s16) (stickBytes & 0xFF); + } else { + stickVal = (s16) (stickBytes | (~0xFF)); + } + stickBytes = (u32) (inputs & REPLAY_STICK_Y) >> 8; + gControllerSeven->rawStickX = stickVal; + + if (stickBytes < 0x80U) { + stickVal = (s16) (stickBytes & 0xFF); + } else { + stickVal = (s16) (stickBytes | (~0xFF)); + } + gControllerSeven->rawStickY = stickVal; + + if (inputs & REPLAY_A_BUTTON) { + buttons = A_BUTTON; + } + if (inputs & REPLAY_B_BUTTON) { + buttons |= B_BUTTON; + } + if (inputs & REPLAY_Z_TRIG) { + buttons |= Z_TRIG; + } + if (inputs & REPLAY_R_TRIG) { + buttons |= R_TRIG; + } + // Blanks the A, B, Z, R and L buttons + buttonsTemp = gControllerSeven->buttonPressed & REPLAY_MASK; + gControllerSeven->buttonPressed = (buttons & (buttons ^ sButtonsPrevCourseGhost)) | buttonsTemp; + buttonsTemp = gControllerSeven->buttonDepressed & REPLAY_MASK; + gControllerSeven->buttonDepressed = (sButtonsPrevCourseGhost & (buttons ^ sButtonsPrevCourseGhost)) | buttonsTemp; + sButtonsPrevCourseGhost = buttons; + gControllerSeven->button = buttons; + if (sCourseGhostFramesRemaining == 0) { + sCourseGhostReplayIdx++; + sCourseGhostFramesRemaining = (s32) (sCourseGhostReplay[sCourseGhostReplayIdx] & REPLAY_FRAME_COUNTER); + } else { + sCourseGhostFramesRemaining -= (s32) REPLAY_FRAME_INCREMENT; + } +} + +// See process_post_time_trial_replay comment +void process_player_ghost_replay(void) { + u32 inputs; + u32 stickBytes; + UNUSED u16 unk; + u16 buttons_temp; + s16 stickVal; + s16 buttons = 0; + + if (sPlayerGhostReplayIdx >= 0x1000) { + func_80005AE8(gPlayerTwo); + return; + } + inputs = sPlayerGhostReplay[sPlayerGhostReplayIdx]; + stickBytes = inputs & REPLAY_STICK_X; + if (stickBytes < 0x80U) { + stickVal = (s16) (stickBytes & 0xFF); + } else { + stickVal = (s16) (stickBytes | ~0xFF); + } + + stickBytes = (u32) (inputs & REPLAY_STICK_Y) >> 8; + + gControllerSix->rawStickX = stickVal; + + if (stickBytes < 0x80U) { + stickVal = (s16) (stickBytes & 0xFF); + } else { + stickVal = (s16) (stickBytes | (~0xFF)); + } + + gControllerSix->rawStickY = stickVal; + + if (inputs & REPLAY_A_BUTTON) { + buttons = A_BUTTON; + } + if (inputs & REPLAY_B_BUTTON) { + buttons |= B_BUTTON; + } + if (inputs & REPLAY_Z_TRIG) { + buttons |= Z_TRIG; + } + if (inputs & REPLAY_R_TRIG) { + buttons |= R_TRIG; + } + buttons_temp = gControllerSix->buttonPressed & REPLAY_MASK; + gControllerSix->buttonPressed = (buttons & (buttons ^ sPlayerGhostButtonsPrev)) | buttons_temp; + + buttons_temp = gControllerSix->buttonDepressed & REPLAY_MASK; + gControllerSix->buttonDepressed = (sPlayerGhostButtonsPrev & (buttons ^ sPlayerGhostButtonsPrev)) | buttons_temp; + sPlayerGhostButtonsPrev = buttons; + gControllerSix->button = buttons; + + if (sPlayerGhostFramesRemaining == 0) { + sPlayerGhostReplayIdx++; + sPlayerGhostFramesRemaining = (s32) (sPlayerGhostReplay[sPlayerGhostReplayIdx] & REPLAY_FRAME_COUNTER); + } else { + sPlayerGhostFramesRemaining -= (s32) REPLAY_FRAME_INCREMENT; + } +} + +// See process_post_time_trial_replay comment +void save_player_replay(void) { + s16 buttons; + u32 inputs; + u32 stickX; + u32 stickY; + u32 inputCounter; + u32 prevInputsWCounter; + u32 prevInputs; + /* Input file is too long or picked up by lakitu or Out of bounds + Not sure if there is any way to be considered out of bounds without lakitu getting called */ + if (((sPlayerInputIdx >= 0x1000) || ((gPlayerOne->lakituProps & HELD_BY_LAKITU) != 0)) || + ((gPlayerOne->lakituProps & LAKITU_SCENE) != 0)) { + gPostTimeTrialReplayCannotSave = 1; + return; + } + + stickX = gControllerOne->rawStickX; + stickX &= 0xFF; + stickY = gControllerOne->rawStickY; + stickY = (stickY & 0xFF) << 8; + buttons = gControllerOne->button; + inputs = 0; + if (buttons & A_BUTTON) { + inputs |= REPLAY_A_BUTTON; + } + if (buttons & B_BUTTON) { + inputs |= REPLAY_B_BUTTON; + } + if (buttons & Z_TRIG) { + inputs |= REPLAY_Z_TRIG; + } + if (buttons & R_TRIG) { + inputs |= REPLAY_R_TRIG; + } + inputs |= stickX; + inputs |= stickY; + prevInputsWCounter = sPlayerInputs[sPlayerInputIdx]; + /* The 5th and 6th bytes from the right are counters. Instead of saving the same inputs over and over, + it says "these inputs were played for __ frames" */ + prevInputs = prevInputsWCounter & REPLAY_CLEAR_FRAME_COUNTER; + // first frame of inputs + if ((*sPlayerInputs) == -1) { + + sPlayerInputs[sPlayerInputIdx] = inputs; + + } else if (prevInputs == inputs) { + + inputCounter = prevInputsWCounter & REPLAY_FRAME_COUNTER; + + if (inputCounter == REPLAY_FRAME_COUNTER) { + + sPlayerInputIdx++; + sPlayerInputs[sPlayerInputIdx] = inputs; + + } else { + // increment counter by 1 + prevInputsWCounter += REPLAY_FRAME_INCREMENT; + sPlayerInputs[sPlayerInputIdx] = prevInputsWCounter; + } + } else { + sPlayerInputIdx++; + sPlayerInputs[sPlayerInputIdx] = inputs; + } +} + +// sets player to AI? (unconfirmed) +void func_80005AE8(Player* ply) { + if (((ply->type & PLAYER_INVISIBLE_OR_BOMB) != 0) && (ply != gPlayerOne)) { + ply->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU; + } +} + +void func_80005B18(void) { + if (gModeSelection == TIME_TRIALS) { + if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (gPostTimeTrialReplayCannotSave != 1)) { + if (bPlayerGhostDisabled == 1) { + D_80162DD0 = D_80162DCC; + func_800052A4(); + bPlayerGhostDisabled = 0; + D_80162DDC = 1; + D_80162DE0 = gPlayerOne->characterId; + D_80162DE8 = gPlayerOne->characterId; + D_80162E00 = 0; + D_80162DFC = playerHUD[PLAYER_ONE].someTimer; + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + } else if (gLapCountByPlayerId[1] != 3) { + D_80162DD0 = D_80162DCC; + func_800052A4(); + D_80162DDC = 1; + D_80162DE0 = gPlayerOne->characterId; + D_80162DFC = playerHUD[PLAYER_ONE].someTimer; + D_80162E00 = 0; + D_80162DE8 = gPlayerOne->characterId; + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + } else { + sReplayGhostBuffer = D_802BFB80.arraySize8[0][D_80162DC8][3].pixel_index_array; + sReplayGhostBufferSize = D_80162D86; + D_80162DD0 = D_80162DCC; + D_80162DE8 = gPlayerOne->characterId; + D_80162DD8 = 0; + bPlayerGhostDisabled = 0; + D_80162DDC = 1; + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + } + } else { + if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (gPostTimeTrialReplayCannotSave == 1)) { + sReplayGhostBuffer = D_802BFB80.arraySize8[0][D_80162DC8][3].pixel_index_array; + sReplayGhostBufferSize = D_80162D86; + D_80162DDC = 1; + } + if ((gPlayerOne->type & PLAYER_CINEMATIC_MODE) == PLAYER_CINEMATIC_MODE) { + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + } else { + sUnusedReplayCounter += 1; + if (sUnusedReplayCounter > 100) { + sUnusedReplayCounter = 100; + } + if ((gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) { + if ((bPlayerGhostDisabled == 0) && (gLapCountByPlayerId[1] != 3)) { + process_player_ghost_replay(); + } + if ((bCourseGhostDisabled == 0) && (gLapCountByPlayerId[2] != 3)) { + process_course_ghost_replay(); + } + if (!(gPlayerOne->type & PLAYER_CINEMATIC_MODE)) { + save_player_replay(); + } + } + } + } + } +} + +void func_80005E6C(void) { + if ((gModeSelection == TIME_TRIALS) && (gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) { + if ((D_80162DD8 == 0) && (gLapCountByPlayerId[1] != 3)) { + process_player_ghost_replay(); // 3 + } + if ((bCourseGhostDisabled == 0) && (gLapCountByPlayerId[2] != 3)) { + process_course_ghost_replay(); // 2 + } + if ((gPlayerOne->type & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE) { + process_post_time_trial_replay(); // 1 + return; + } + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + } +} + +void replays_loop(void) { + if (D_8015F890 == 1) { + func_80005E6C(); + return; + } + if (!gPauseTriggered) { + func_80005B18(); + return; + } + /* This only gets triggered when the previous if-statements are not met + Seems like just for pausing */ + gPostTimeTrialReplayCannotSave = 1; +} diff --git a/src/staff_ghosts.h b/src/replays.h similarity index 61% rename from src/staff_ghosts.h rename to src/replays.h index b5e2b0591f..32c9f4c4eb 100644 --- a/src/staff_ghosts.h +++ b/src/replays.h @@ -5,21 +5,21 @@ #include void func_80005B18(void); -void func_80004EF0(void); -void func_80004FB0(void); -void func_80004FF8(void); +void load_course_ghost(void); +void load_post_time_trial_replay(void); +void load_player_ghost(void); void set_staff_ghost(void); s32 func_800051C4(void); void func_8000522C(void); void func_800052A4(void); void func_80005310(void); -void func_8000546C(void); -void func_8000561C(void); -void func_800057DC(void); +void process_post_time_trial_replay(void); +void process_course_ghost_replay(void); +void process_player_ghost_replay(void); void func_8000599C(void); void func_80005AE8(Player*); void func_80005E6C(void); -void staff_ghosts_loop(void); +void replays_loop(void); // mi0decode @@ -28,14 +28,14 @@ extern s32 func_80040174(void*, s32, s32); extern s32 D_80162DC8; extern s32 D_80162DCC; -extern u16 D_80162DD4; -extern u16 D_80162DD6; +extern u16 bPlayerGhostDisabled; +extern u16 bCourseGhostDisabled; extern u16 D_80162DD8; extern s32 D_80162E00; extern s32 D_80162DE0; extern s32 D_80162DE4; extern s32 D_80162DE8; -extern s32 D_80162DF0; -extern s32 D_80162DF8; +extern s32 gPauseTriggered; +extern s32 gPostTimeTrialReplayCannotSave; #endif /* STAFF_GHOSTS_H */ diff --git a/src/save.c b/src/save.c index b182aede16..08a372aae0 100644 --- a/src/save.c +++ b/src/save.c @@ -1,13 +1,14 @@ #include #include #include +#include "stddef.h" #include "save.h" -#include "code_80091750.h" +#include "menu_items.h" #include "menus.h" #include "save_data.h" -#include "staff_ghosts.h" +#include "replays.h" #include "code_80057C60.h" /*** macros ***/ @@ -17,6 +18,10 @@ // very fragile! #define EEPROM_ADDR(ptr) (((uintptr_t) (ptr) - (uintptr_t) (&gSaveData)) / 8) +/** BSS **/ +// stores ghost data +struct_8018EE10_entry D_8018EE10[2]; + /*** data ***/ u16 gCompanyCode = PFS_COMPANY_CODE('0', '1'); u32 gGameCode = PFS_GAME_CODE('N', 'K', 'T', 'J'); @@ -91,7 +96,7 @@ void reset_save_data_grand_prix_points_and_sound_mode(void) { } main->saveInfo.soundMode = SOUND_STEREO; gSoundMode = SOUND_STEREO; - func_800B44BC(); + set_sound_mode(); write_save_data_grand_prix_points_and_sound_mode(); } @@ -114,7 +119,7 @@ u8 checksum_time_trial_records(s32 courseIdx) { u8 compute_save_data_checksum_1(void) { u8* grandPrixPoints = (u8*) &gSaveData.main.saveInfo.grandPrixPoints; - s32 i; + u32 i; s32 crc = 0; for (i = 0; i < sizeof(SaveInfo); i++) { @@ -309,19 +314,12 @@ s32 func_800B5020(u32 time, s32 charId) { return i; } -#ifdef NON_MATCHING -/** - * This one is some stack weirdness. If you remove the padding a ton of - * stack locations are wrong. Adding more padding doesn't help matters - * and no amount of reordering of the function variables fixes it either. - **/ s32 func_800B5218(void) { u8* recordPointer; - s32 prevLapTime; + UNUSED s32 pad; s32 fastestLapIndex; s32 recordIndex; - UNUSED s32 padding; - s32 thisLapTime; + UNUSED s32 pad2[2]; s32 checkLapIndex; s32 character; s32 lapBitmask; @@ -332,12 +330,10 @@ s32 func_800B5218(void) { fastestLapIndex = 0; character = *gCharacterSelections; for (checkLapIndex = 1; checkLapIndex != 3; checkLapIndex++) { - prevLapTime = playerHUD->lapDurations[checkLapIndex]; - thisLapTime = playerHUD->lapDurations[fastestLapIndex]; - if (prevLapTime < thisLapTime) { + if ((s32) playerHUD->lapDurations[checkLapIndex] < (s32) playerHUD->lapDurations[fastestLapIndex]) { lapBitmask = 1 << checkLapIndex; fastestLapIndex = checkLapIndex; - } else if (thisLapTime == prevLapTime) { + } else if ((s32) playerHUD->lapDurations[fastestLapIndex] == (s32) playerHUD->lapDurations[checkLapIndex]) { lapBitmask |= 1 << checkLapIndex; } } @@ -351,9 +347,6 @@ s32 func_800B5218(void) { return 0; } } -#else -GLOBAL_ASM("asm/non_matchings/save/func_800B5218.s") -#endif void func_800B536C(s32 arg0) { u8* points; @@ -423,21 +416,21 @@ u8 func_800B5508(s32 cup, s32 ccGrandPrixPoints, s32 points_scored) { // Check if all 4 cups have gold cups scored // for a given CC mode -s32 func_800B5530(s32 cc_mode) { +bool is_cc_mode_complete(s32 cc_mode) { if (gSaveData.main.saveInfo.grandPrixPoints[cc_mode] == 0xFF) { - return 1; + return true; } - return 0; + return false; } // Check if the 150CC mode has all 4 gold cups -s32 func_800B555C(void) { - return func_800B5530(CC_150); +s32 has_unlocked_extra_mode(void) { + return is_cc_mode_complete(CC_150); } // Check if the Extra mode has all 4 gold cups -s32 func_800B557C(void) { - return func_800B5530(CC_EXTRA); +s32 has_completed_extra_mode(void) { + return is_cc_mode_complete(CC_EXTRA); } void func_800B559C(s32 arg0) { @@ -468,7 +461,6 @@ void func_800B559C(s32 arg0) { bestRecord->bestThreelaps[0], 0x38); } -#ifdef NON_MATCHING /** * This one is weird. Its some type of checksum calculator, seemingly for the * best time trial records. But the number of bytes it operates over is @@ -478,26 +470,19 @@ void func_800B559C(s32 arg0) { * * But only unknown bytes 7 and 8 ever get set, so why the extra 3, and why in chunks of 17? **/ -s32 func_800B578C(s32 arg0) { - u8* var_a2; - s32 var_a0; - s32 var_v0; - s32 var_v1; - var_a2 = &gSaveData.onlyBestTimeTrialRecords[arg0].bestThreelaps[0][0]; - var_v1 = 0; - for (var_v0 = 0; var_v0 < 3;) { - ++var_v0; - for (var_a0 = 0; var_a0 != 0x11; var_a0++) { - if (var_a0) {} - var_v1 += (((*var_a2++) + 1) * var_v0) + var_a0; +u8 func_800B578C(s32 arg0) { + u8* times = (u8*) &gSaveData.onlyBestTimeTrialRecords[arg0]; + s32 checksum = 0; + s32 i; + s32 j; + + for (i = 0; i < 3; i++) { + for (j = 0; j < 0x11; j++) { + checksum += (times[i * 0x11 + j] + 1) * (i + 1) + j; } - var_a2 += 0x11; } - return (var_v1 % 256) & 0xFF; + return (checksum % 256); } -#else -GLOBAL_ASM("asm/non_matchings/save/func_800B578C.s") -#endif s32 func_800B5888(s32 arg0) { s32 tmp = gSaveData.onlyBestTimeTrialRecords[arg0].unknownBytes[6] + 90; @@ -534,7 +519,7 @@ void update_save_data_backup(void) { u8 compute_save_data_checksum_backup_1(void) { u8* backupGrandPrixPoints = gSaveData.backup.saveInfo.grandPrixPoints; - s32 i; + u32 i; s32 crc = 0; for (i = 0; i < sizeof(SaveInfo); i++) { @@ -749,7 +734,7 @@ u8 func_800B60E8(s32 page) { u32 checksum = 0; u8* addr; - for (i = 0, addr = (u8*) &((u8*) D_800DC714)[page * 256]; i < 256; i++) { + for (i = 0, addr = (u8*) &((u8*) gReplayGhostCompressed)[page * 256]; i < 256; i++) { checksum += (*addr++ * (page + 1) + i); } return checksum; @@ -767,7 +752,7 @@ s32 func_800B6178(s32 arg0) { default: return -1; } - if (gGamestate == 4) { + if (gGamestate == RACING) { func_800051C4(); } temp_s3 = &D_8018EE10[arg0]; @@ -780,10 +765,10 @@ s32 func_800B6178(s32 arg0) { } } else { var_v0 = osPfsReadWriteFile(&gControllerPak1FileHandle, gControllerPak1FileNote, 1U, (arg0 * 0x3C00) + 0x100, - 0x00003C00, (u8*) D_800DC714); + 0x00003C00, (u8*) gReplayGhostCompressed); if (var_v0 == 0) { temp_s3->ghostDataSaved = 1; - if (gGamestate == 4) { + if (gGamestate == RACING) { temp_s3->courseIndex = (gCupSelection * 4) + gCourseIndexInCup; } temp_s3->unk_00 = D_80162DFC; @@ -829,7 +814,7 @@ s32 func_800B63F0(s32 arg0) { s32 phi_s3; func_800051C4(); - D_80162DD6 = 1; + bCourseGhostDisabled = 1; func_80005AE8(gPlayerThree); phi_s3 = 0; @@ -869,7 +854,7 @@ s32 func_800B64EC(s32 arg0) { } temp_v0 = osPfsReadWriteFile(&gControllerPak1FileHandle, gControllerPak1FileNote, PFS_READ, (arg0 * 0x3C00) + 0x100, - 0x3C00, (u8*) D_800DC714); + 0x3C00, (u8*) gReplayGhostCompressed); if (temp_v0 == 0) { // clang-format off phi_s1 = (u8 *) &D_8018EE10[arg0]; temp_s0 = 0; while (1) { @@ -883,7 +868,7 @@ s32 func_800B64EC(s32 arg0) { ++phi_s1; if ((++temp_s0) == 0x3C) { func_8000522C(); - D_80162DD4 = 0; + bPlayerGhostDisabled = 0; D_80162DE0 = (s32) D_8018EE10[arg0].characterId; D_80162DFC = D_8018EE10[arg0].unk_00; break; @@ -907,9 +892,9 @@ s32 func_800B65F4(s32 arg0, s32 arg1) { return -1; } writeStatus = osPfsReadWriteFile(&gControllerPak2FileHandle, gControllerPak2FileNote, 0U, (arg0 * 0x3C00) + 0x100, - 0x00003C00, (u8*) D_800DC714); + 0x00003C00, (u8*) gReplayGhostCompressed); if (writeStatus == 0) { - temp_s3 = &((struct_8018EE10_entry*) D_8018D9C0)[arg0]; + temp_s3 = &((struct_8018EE10_entry*) gSomeDLBuffer)[arg0]; for (i = 0; i < 0x3C; i++) { if (temp_s3->unk_07[i] != func_800B60E8(i)) { temp_s3->ghostDataSaved = 0; @@ -940,14 +925,14 @@ void func_800B6798(void) { s32 temp_s0; u8* tmp; - tmp = (u8*) D_8018D9C0; + tmp = (u8*) gSomeDLBuffer; osPfsReadWriteFile(&gControllerPak2FileHandle, gControllerPak2FileNote, PFS_READ, 0, 0x100 /* 2*sizeof(struct_8018EE10_entry) ? */, tmp); for (temp_s0 = 0; temp_s0 < 2; ++temp_s0) { - // if (D_8018D9C0[temp_s0]->checksum != func_800B68F4(temp_s0)) { - // D_8018D9C0[temp_s0]->ghostDataSaved = 0; + // if (gSomeDLBuffer[temp_s0]->checksum != func_800B68F4(temp_s0)) { + // gSomeDLBuffer[temp_s0]->ghostDataSaved = 0; // } if (((struct_8018EE10_entry*) (tmp + (temp_s0 << 7)))->checksum != func_800B68F4(temp_s0)) { ((struct_8018EE10_entry*) (tmp + (temp_s0 << 7)))->ghostDataSaved = 0; @@ -965,24 +950,21 @@ u8 func_800B6828(s32 arg0) { return checksum; } -#ifdef NON_MATCHING u8 func_800B68F4(s32 arg0) { - s32 multiplier = arg0 + 1; - u32 checksum; - s32 i; - checksum = 0; - for (i = 0; i < 0x43; i++) { - u8* addr = &((u8*) D_8018D9C0)[arg0]; - checksum += addr[i] * multiplier + i; + struct_8018EE10_entry* var_v0 = gSomeDLBuffer; + u8* addr = (u8*) (var_v0 + arg0); + s32 i = 0; + u32 checksum = 0; + + for (i = 0; i < (s32) offsetof(struct_8018EE10_entry, pad_43); i++) { + checksum += (addr[i] * (arg0 + 1)) + i; } + return checksum; } -#else -GLOBAL_ASM("asm/non_matchings/save/func_800B68F4.s") -#endif s32 func_800B69BC(s32 arg0) { - s32 i; + u32 i; struct_8018EE10_entry* plz = &D_8018EE10[arg0]; plz->ghostDataSaved = false; diff --git a/src/save.h b/src/save.h index 201bbe0846..328ed2897d 100644 --- a/src/save.h +++ b/src/save.h @@ -14,8 +14,9 @@ #define PFS_NO_ERROR 0 // controller pak no error return #define PFS_NO_PAK_INSERTED 1 // no pak pressent or wrong device inserted into the controller #define PFS_PAK_BAD_READ 2 // controller pak error while data transfer +#define PFS_PAK_CORRUPTED 3 // controller pak has courrupted or has weird data #define PFS_FILE_OVERFLOW 4 // too many files written to in the controller pak -#define PFS_INVALID_DATA -1 // bad arguments, game note does not exist, osPfsInit was not called. +#define PFS_INVALID_DATA -1 // bad arguments, game note does not exist, osPfsInit was not called // controller pak test functions #define PFS_NUM_FILES_ERROR -2 #define PFS_FREE_BLOCKS_ERROR -3 @@ -54,11 +55,11 @@ void func_800B5404(s32, s32); u8 func_800B54C0(s32, s32); u8 func_800B54EC(s32, s32); u8 func_800B5508(s32, s32, s32); -s32 func_800B5530(s32); -s32 func_800B555C(void); -s32 func_800B557C(void); +s32 is_cc_mode_complete(s32); +s32 has_unlocked_extra_mode(void); +s32 has_completed_extra_mode(void); void func_800B559C(s32); -s32 func_800B578C(s32); +u8 func_800B578C(s32); s32 func_800B5888(s32); s32 func_800B58C4(s32); void update_save_data_backup(void); @@ -86,7 +87,8 @@ s32 func_800B6A68(void); /* data */ // these might not be in this file, but for now... -extern u32* D_800DC714; +extern u32* gReplayGhostCompressed; +extern struct_8018EE10_entry D_8018EE10[]; extern u16 gCompanyCode; extern u32 gGameCode; // osPfs gamecode diff --git a/src/spawn_players.c b/src/spawn_players.c index dc8e8b8e8e..98aebecac2 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -1,11 +1,12 @@ #include #include +#include #include "spawn_players.h" #include "code_800029B0.h" #include "kart_attributes.h" #include "memory.h" -#include "waypoints.h" +#include "path.h" #include "buffers.h" #include "kart_dma.h" #include "camera.h" @@ -14,14 +15,14 @@ #include "code_80057C60.h" #include "collision.h" #include "render_courses.h" -#include "staff_ghosts.h" -#include "code_80005FD0.h" +#include "replays.h" +#include "cpu_vehicles_camera_path.h" #include "render_player.h" #include "podium_ceremony_actors.h" #include "main.h" #include "menus.h" #include "render_player.h" -#include "code_80091750.h" +#include "menu_items.h" #include "effects.h" #include "decode.h" @@ -29,15 +30,15 @@ f32 D_80165210[8]; f32 D_80165230[8]; UNUSED f32 D_80165250[8]; s16 D_80165270[8]; -f32 D_80165280[8]; +f32 gPlayerCurrentSpeed[8]; f32 D_801652A0[8]; s32 D_801652C0[8]; s32 D_801652E0[8]; s16 D_80165300[8]; // Shadows values from gPathIndexByPlayerId, but is an array u16 gCopyPathIndexByPlayerId[8]; -// Shadows values from gNearestWaypointByPlayerId, but is an array -s16 gCopyNearestWaypointByPlayerId[8]; +// Shadows values from gNearestPathPointByPlayerId, but is an array +s16 gCopyNearestPathPointByPlayerId[8]; s16 D_80165330[8]; s16 D_80165340; UNUSED s32 D_80165348[29]; @@ -57,7 +58,7 @@ s32 gCountBChangement[8]; bool gIsPlayerTripleBButtonCombo[8]; s32 gTimerBoostTripleBCombo[8]; -s16 chooseKartAIPlayers[7]; +s16 cpu_chooseCharacters[7]; s16 D_8016556E; s16 D_80165570; @@ -80,7 +81,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->type = PLAYER_INACTIVE; player->unk_08C = 0; player->characterId = characterId; - player->unk_0B6 = 0; + player->kartGraphics = 0; player->kartFriction = gKartFrictionTable[player->characterId]; player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId]; player->kartGravity = gKartGravityTable[player->characterId]; @@ -111,13 +112,13 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC } player->pos[0] = startingRow; - ret = spawn_actor_on_surface(startingRow, arg4 + 50.0f, startingColumn) + player->boundingBoxSize; + ret = get_surface_height(startingRow, arg4 + 50.0f, startingColumn) + player->boundingBoxSize; player->pos[2] = startingColumn; player->pos[1] = ret; player->oldPos[0] = startingRow; player->oldPos[1] = ret; - D_80164510[playerIndex] = ret; + gPlayerPathY[playerIndex] = ret; player->rotation[0] = 0; player->oldPos[2] = startingColumn; @@ -140,11 +141,11 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->lapCount = -1; player->unk_08C = 0.0f; player->unk_090 = 0.0f; - player->unk_094 = 0.0f; + player->speed = 0.0f; player->unk_074 = 0.0f; player->type = playerType; - player->unk_0CA = 0; - player->unk_0DE = 0; + player->lakituProps = 0; + player->oobProps = 0; player->unk_10C = 0; player->unk_0E2 = 0; player->unk_0E8 = 0.0f; @@ -153,10 +154,10 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->currentSpeed = 0.0f; player->unk_20C = 0.0f; player->unk_DAC = 0.0f; - player->unk_044 = 0; + player->kartProps = 0; player->unk_046 = 0; - player->soundEffects = 0; - player->unk_0C6 = 0xFF; + player->triggers = 0; + player->alpha = ALPHA_MAX; player->unk_206 = 0; player->slopeAccel = 0; @@ -184,22 +185,22 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->unk_0C0 = 0; player->unk_0C2 = 0; player->unk_0C8 = 0; - player->unk_0CA = 0; + player->lakituProps = 0; player->boostTimer = 0; - player->unk_0DE = 0; + player->oobProps = 0; player->unk_0E0 = 0; player->unk_0E2 = 0; player->unk_10C = 0; player->unk_200 = 0; - player->unk_204 = 0; - player->nearestWaypointId = 0; + player->driftDuration = 0; + player->nearestPathPointId = 0; player->unk_228 = 0; - player->unk_22A = 0; + player->driftState = 0; player->unk_234 = 0; player->unk_236 = 0; player->unk_238 = 0; player->unk_23A = 0; - player->unk_240 = 0; + player->tyreSpeed = 0; player->unk_256 = 0; player->size = 1.0f; @@ -222,7 +223,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->unk_088 = 0.0f; player->unk_08C = 0.0f; player->unk_090 = 0.0f; - player->unk_094 = 0.0f; + player->speed = 0.0f; player->unk_098 = 0.0f; player->currentSpeed = 0.0f; player->unk_0A0 = 0.0f; @@ -242,7 +243,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->unk_210 = 0.0f; player->unk_218 = 0.0f; player->unk_21C = 0.0f; - player->unk_22C = 0.0f; + player->previousSpeed = 0.0f; player->unk_230 = 0.0f; player->unk_23C = 0.0f; @@ -278,10 +279,10 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC D_801652E0[playerIndex] = 0; D_801652C0[playerIndex] = 0; D_80165020[playerIndex] = 0; - D_80165070[playerIndex][0] = 0.0f; - D_80165070[playerIndex][1] = 0.0f; - D_80165070[playerIndex][2] = 0.0f; - D_80165280[playerIndex] = 0.0f; + gPlayerLastVelocity[playerIndex][0] = 0.0f; + gPlayerLastVelocity[playerIndex][1] = 0.0f; + gPlayerLastVelocity[playerIndex][2] = 0.0f; + gPlayerCurrentSpeed[playerIndex] = 0.0f; D_801652A0[playerIndex] = 0.0f; gPlayerIsThrottleActive[playerIndex] = 0; D_80165400[playerIndex] = 0; @@ -354,10 +355,10 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC D_8018CE10[playerIndex].unk_04[0] = 0.0f; D_8018CE10[playerIndex].unk_04[2] = 0.0f; func_80295BF8(playerIndex); - func_8005D6C0(player); - func_8006B87C(player, playerIndex); + reset_player_particle_pool(player); + clear_all_player_balloons(player, playerIndex); if (gModeSelection == BATTLE) { - func_8006B7E4(player, playerIndex); + init_all_player_balloons(player, playerIndex); } calculate_orientation_matrix(player->unk_150, player->unk_058, player->unk_05C, player->unk_060, player->rotation[1]); @@ -466,7 +467,7 @@ void func_80039DA4(void) { }; if (((gCourseIndexInCup == COURSE_ONE) && (D_8016556E == 0)) || (gDemoMode == 1) || - (gDebugMenuSelection == DEBUG_MENU_EXITED)) { + (gDebugMenuSelection == DEBUG_MENU_OPTION_SELECTED)) { for (i = 0; i < NUM_PLAYERS; i++) { D_80165270[i] = sp2C[i]; } @@ -484,7 +485,7 @@ UNUSED s16 D_800E43A8 = 0; void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) { func_80039DA4(); if (((gCourseIndexInCup == COURSE_ONE) && (D_8016556E == 0)) || (gDemoMode == 1) || - (gDebugMenuSelection == DEBUG_MENU_EXITED)) { + (gDebugMenuSelection == DEBUG_MENU_OPTION_SELECTED)) { s16 rand; s16 i; @@ -493,16 +494,16 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) { } while (rand == gCharacterSelections[0]); // Randomize gPlayerTwo - chooseKartAIPlayers[0] = rand; + cpu_chooseCharacters[0] = rand; // Chooses arr[0] as a fallback to prevent duplicating characters. // If it doesn't find the if, it will grab the final index as a fallback. for (i = 1; i < 7; i++) { - u16* arr = (u16*) gKartAIforPlayer[gCharacterSelections[0]]; + u16* arr = (u16*) cpu_forPlayer[gCharacterSelections[0]]; if (rand == arr[i]) { - chooseKartAIPlayers[i] = arr[0]; + cpu_chooseCharacters[i] = arr[0]; } else { - chooseKartAIPlayers[i] = arr[i]; + cpu_chooseCharacters[i] = arr[i]; } } } @@ -510,39 +511,39 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) { D_8016556E = 0; if (gDemoMode == 1) { spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f, - gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI); - spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, chooseKartAIPlayers[0], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, chooseKartAIPlayers[1], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, chooseKartAIPlayers[2], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, chooseKartAIPlayers[3], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, chooseKartAIPlayers[4], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, chooseKartAIPlayers[5], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, chooseKartAIPlayers[6], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, cpu_chooseCharacters[0], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, cpu_chooseCharacters[1], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, cpu_chooseCharacters[2], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, cpu_chooseCharacters[3], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, cpu_chooseCharacters[4], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, cpu_chooseCharacters[5], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, cpu_chooseCharacters[6], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); D_80164A28 = 0; } else { spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]] + 250.0f, arg2, 32768.0f, gCharacterSelections[0], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_HUMAN); spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[0], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[0], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerThree, 2, arg0[D_80165270[3]], arg1[D_80165270[2]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[1], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[1], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerFour, 3, arg0[D_80165270[2]], arg1[D_80165270[3]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[2], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[2], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerFive, 4, arg0[D_80165270[5]], arg1[D_80165270[4]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[3], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[3], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerSix, 5, arg0[D_80165270[4]], arg1[D_80165270[5]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[4], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[4], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerSeven, 6, arg0[D_80165270[7]], arg1[D_80165270[6]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[5], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[5], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerEight, 7, arg0[D_80165270[6]], arg1[D_80165270[7]] + 250.0f, arg2, 32768.0f, - chooseKartAIPlayers[6], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI); + cpu_chooseCharacters[6], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); D_80164A28 = 1; } func_80039AE4(); @@ -550,38 +551,38 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) { void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) { spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); if (gDemoMode == 1) { spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_HUMAN_AND_KART_AI); + PLAYER_HUMAN_AND_CPU); spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); } else if (D_8015F890 != 1) { spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); - if (D_80162DD4 == 0) { + if (bPlayerGhostDisabled == 0) { spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE0, PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB); } else { spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); } - if (D_80162DD6 == 0) { + if (bCourseGhostDisabled == 0) { spawn_player(gPlayerThree, 2, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE4, PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB); } else { spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); } } else { spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE8, @@ -591,14 +592,14 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) { PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB); } else { spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); } - if (D_80162DD6 == 0) { + if (bCourseGhostDisabled == 0) { spawn_player(gPlayerThree, 2, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE4, PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB); } else { spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); } } D_80164A28 = 0; @@ -607,7 +608,7 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) { void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) { func_80039DA4(); - if ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == 1) || (gDebugMenuSelection == DEBUG_MENU_EXITED)) { + if ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == 1) || (gDebugMenuSelection == DEBUG_MENU_OPTION_SELECTED)) { s16 rand; s16 i; @@ -621,41 +622,41 @@ void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) { goto getRand; } - chooseKartAIPlayers[0] = rand; + cpu_chooseCharacters[0] = rand; for (i = 1; i < 6; i++) { - u16* arr = (u16*) gKartAIforTwoPlayer[gCharacterSelections[0]][gCharacterSelections[1]]; + u16* arr = (u16*) cpu_forTwoPlayer[gCharacterSelections[0]][gCharacterSelections[1]]; if (rand == arr[i]) { - chooseKartAIPlayers[i] = arr[0]; + cpu_chooseCharacters[i] = arr[0]; } else { - chooseKartAIPlayers[i] = arr[i]; + cpu_chooseCharacters[i] = arr[i]; } } } - spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, chooseKartAIPlayers[0], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, chooseKartAIPlayers[1], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, chooseKartAIPlayers[2], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, chooseKartAIPlayers[3], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, chooseKartAIPlayers[4], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); - spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, chooseKartAIPlayers[5], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, cpu_chooseCharacters[0], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, cpu_chooseCharacters[1], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, cpu_chooseCharacters[2], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, cpu_chooseCharacters[3], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, cpu_chooseCharacters[4], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, cpu_chooseCharacters[5], + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); if (gDemoMode == 1) { spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f, - gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI); + gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); } else { spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f, gCharacterSelections[0], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); } if (gDemoMode == 1) { spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, gCharacterSelections[1], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); } else { spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, gCharacterSelections[1], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); @@ -667,27 +668,26 @@ void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) { void spawn_players_versus_two_player(f32* arg0, f32* arg1, f32 arg2) { spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_START_SEQUENCE | PLAYER_KART_AI); + PLAYER_START_SEQUENCE | PLAYER_CPU); if (gDemoMode == 1) { spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_HUMAN_AND_KART_AI); + PLAYER_HUMAN_AND_CPU); } else { spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); } if (gDemoMode == 1) { - spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], - PLAYER_HUMAN_AND_KART_AI); + spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_CPU); } else { spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); @@ -712,10 +712,10 @@ void spawn_players_2p_battle(f32* arg0, f32* arg1, f32 arg2) { PLAYER_START_SEQUENCE | PLAYER_HUMAN); spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3], PLAYER_START_SEQUENCE | PLAYER_HUMAN); - spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU); D_80164A28 = 0; func_80039AE4(); } @@ -728,19 +728,16 @@ void func_8003B318(f32* arg0, f32* arg1, f32 arg2) { spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); if (gDemoMode == 1) { - spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_HUMAN_AND_KART_AI); - spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], - PLAYER_HUMAN_AND_KART_AI); - spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], - PLAYER_HUMAN_AND_KART_AI); + spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], PLAYER_HUMAN_AND_CPU); } - spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU); D_80164A28 = 0; func_80039AE4(); } @@ -761,11 +758,11 @@ void spawn_players_3p_battle(f32* arg0, f32* arg1, f32 arg2) { spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, -16384.0f, gCharacterSelections[2], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); } - spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU); D_80164A28 = 0; func_80039AE4(); } @@ -780,19 +777,15 @@ void func_8003B870(f32* arg0, f32* arg1, f32 arg2) { spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); if (gDemoMode == 1) { - spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], - PLAYER_HUMAN_AND_KART_AI); - spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], - PLAYER_HUMAN_AND_KART_AI); - spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], - PLAYER_HUMAN_AND_KART_AI); - spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3], - PLAYER_HUMAN_AND_KART_AI); + spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3], PLAYER_HUMAN_AND_CPU); } - spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU); D_80164A28 = 0; func_80039AE4(); } @@ -817,27 +810,27 @@ void spawn_players_4p_battle(f32* arg0, f32* arg1, f32 arg2) { spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 16384.0f, gCharacterSelections[3], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); } - spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI); - spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU); D_80164A28 = 0; func_80039AE4(); } void func_8003BE30(void) { spawn_player(gPlayerOne, 0, -2770.774f, -345.187f, -34.6f, 0.0f, gCharacterIdByGPOverallRank[0], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerTwo, 1, -3691.506f, -6.822f, -6.95f, 36400.0f, gCharacterIdByGPOverallRank[1], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerThree, 2, -3475.028f, -998.485f, -8.059f, 45500.0f, gCharacterIdByGPOverallRank[2], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); if (D_802874D8.unk1D >= 3) { spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, D_802874D8.unk1E, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); } else { spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, gCharacterIdByGPOverallRank[3], - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); } spawn_player(gPlayerFive, 4, -2770.774f, -345.187f, -34.6f, 0.0f, 0, 0x7000); spawn_player(gPlayerSix, 5, -3691.506f, -6.822f, -6.95f, 36400.0f, 0, 0x7000); @@ -870,10 +863,10 @@ void func_8003C0F0(void) { case COURSE_RAINBOW_ROAD: case COURSE_WARIO_STADIUM: case COURSE_DK_JUNGLE: - func_8000F2DC(); - sp5E = (f32) D_80164550[0][0].posX; - sp5C = (f32) D_80164550[0][0].posZ; - sp5A = (f32) D_80164550[0][0].posY; + init_course_path_point(); + sp5E = (f32) gTrackPaths[0][0].posX; + sp5C = (f32) gTrackPaths[0][0].posZ; + sp5A = (f32) gTrackPaths[0][0].posY; if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) { sp5E = 0; } @@ -1142,25 +1135,25 @@ void func_8003C0F0(void) { spawn_player(gPlayerOneCopy, 0, D_80165210[0], D_80165230[0], sp5A, 32768.0f, gCharacterSelections[0], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); spawn_player(gPlayerTwo, 1, D_80165210[1], D_80165230[1], sp5A, 32768.0f, 1, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerThree, 2, D_80165210[2], D_80165230[2], sp5A, 32768.0f, 2, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerFour, 3, D_80165210[3], D_80165230[3], sp5A, 32768.0f, 3, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerFive, 4, D_80165210[4], D_80165230[4], sp5A, 32768.0f, 4, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerSix, 5, D_80165210[5], D_80165230[5], sp5A, 32768.0f, 5, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerSeven, 6, D_80165210[6], D_80165230[6], sp5A, 32768.0f, 6, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); spawn_player(gPlayerEight, 7, D_80165210[7], D_80165230[7], sp5A, 32768.0f, 7, - PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); + PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); D_80164A28 = 0; break; } if (gModeSelection != BATTLE) { - func_8000F628(); + init_players(); } } diff --git a/src/spawn_players.h b/src/spawn_players.h index f921096907..23c9c14a26 100644 --- a/src/spawn_players.h +++ b/src/spawn_players.h @@ -28,13 +28,13 @@ void func_8003DB5C(void); extern f32 D_80165210[]; extern f32 D_80165230[]; extern s16 D_80165270[]; -extern f32 D_80165280[]; +extern f32 gPlayerCurrentSpeed[]; extern f32 D_801652A0[]; extern s32 D_801652C0[]; extern s32 D_801652E0[]; extern s16 D_80165300[]; extern u16 gCopyPathIndexByPlayerId[]; -extern s16 gCopyNearestWaypointByPlayerId[]; +extern s16 gCopyNearestPathPointByPlayerId[]; extern s16 D_80165330[]; extern s16 D_80165340; extern Player* D_801653C0[]; @@ -50,7 +50,7 @@ extern s32 gFrameSinceLastBCombo[]; extern s32 gCountBChangement[]; extern bool gIsPlayerTripleBButtonCombo[]; extern s32 gTimerBoostTripleBCombo[]; -extern s16 chooseKartAIPlayers[]; +extern s16 cpu_chooseCharacters[]; extern s16 D_8016556E; extern s16 D_80165570; extern s16 D_80165572; diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c deleted file mode 100644 index 8a4b91bf37..0000000000 --- a/src/staff_ghosts.c +++ /dev/null @@ -1,567 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "main.h" -#include "code_800029B0.h" -#include "buffers.h" -#include "save.h" -#include "staff_ghosts.h" -#include "code_8006E9C0.h" -#include "code_80091750.h" -#include "code_80057C60.h" -#include "kart_dma.h" - -extern s32 mio0encode(s32 input, s32, s32); -extern s32 func_80040174(void*, s32, s32); - -u8* D_80162D80; -s16 D_80162D84; -s16 D_80162D86; -u16 D_80162D88; - -u32 D_80162D8C; -s16 D_80162D90; -u32* D_80162D94; - -u16 D_80162D98; -u32 D_80162D9C; -s16 D_80162DA0; -u32* D_80162DA4; - -u16 D_80162DA8; -s32 D_80162DAC; -s16 D_80162DB0; -u32* D_80162DB4; - -s16 D_80162DB8; -u32* D_80162DBC; - -u16 D_80162DC0; -u32 D_80162DC4; -s32 D_80162DC8; -s32 D_80162DCC; -s32 D_80162DD0; -u16 D_80162DD4; -u16 D_80162DD6; -u16 D_80162DD8; -s32 D_80162DDC; -s32 D_80162DE0; // ghost kart id? -s32 D_80162DE4; -s32 D_80162DE8; -s32 D_80162DEC; -s32 D_80162DF0; -s32 D_80162DF4; -s32 D_80162DF8; -s32 D_80162DFC; - -s32 D_80162E00; - -u32* D_800DC710 = (u32*) &D_802BFB80.arraySize8[0][2][3]; -u32* D_800DC714 = (u32*) &D_802BFB80.arraySize8[1][1][3]; - -extern s32 gLapCountByPlayerId[]; - -extern StaffGhost* d_mario_raceway_staff_ghost; -extern StaffGhost* d_royal_raceway_staff_ghost; -extern StaffGhost* d_luigi_raceway_staff_ghost; - -void func_80004EF0(void) { - D_80162DA4 = (u32*) &D_802BFB80.arraySize8[0][2][3]; - osInvalDCache(&D_80162DA4[0], 0x4000); - osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(D_80162DC4)], D_80162DA4, - 0x4000, &gDmaMesgQueue); - osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK); - D_80162D9C = (*D_80162DA4 & 0xFF0000); - D_80162DA0 = 0; -} - -void func_80004FB0(void) { - D_80162DB4 = (u32*) &D_802BFB80.arraySize8[0][D_80162DD0][3]; - D_80162DAC = *D_80162DB4 & 0xFF0000; - D_80162DB0 = 0; -} - -void func_80004FF8(void) { - D_80162D94 = (u32*) &D_802BFB80.arraySize8[0][D_80162DC8][3]; - D_80162D8C = (s32) *D_80162D94 & 0xFF0000; - D_80162D90 = 0; -} -/** - * Activates staff ghost if time trial lap time is lower enough - * - */ -#ifdef VERSION_EU -#define BLAH 10700 -#define BLAH2 19300 -#define BLAH3 13300 -#else -#define BLAH 9000 -#define BLAH2 16000 -#define BLAH3 11200 - -#endif - -void set_staff_ghost(void) { - u32 temp_v0; // Appears to be player total lap time. - - switch (gCurrentCourseId) { - case COURSE_MARIO_RACEWAY: - temp_v0 = func_800B4E24(0) & 0xfffff; - if (temp_v0 <= BLAH) { - D_80162DD6 = 0; - D_80162DF4 = 0; - } else { - D_80162DD6 = 1; - D_80162DF4 = 1; - } - D_80162DC4 = (u32) &d_mario_raceway_staff_ghost; - D_80162DE4 = 0; - break; - case COURSE_ROYAL_RACEWAY: - temp_v0 = func_800B4E24(0) & 0xfffff; - if (temp_v0 <= BLAH2) { - D_80162DD6 = 0; - D_80162DF4 = 0; - } else { - D_80162DD6 = 1; - D_80162DF4 = 1; - } - D_80162DC4 = (u32) &d_royal_raceway_staff_ghost; - D_80162DE4 = 6; - break; - case COURSE_LUIGI_RACEWAY: - temp_v0 = func_800B4E24(0) & 0xfffff; - if (temp_v0 <= BLAH3) { - D_80162DD6 = 0; - D_80162DF4 = 0; - } else { - D_80162DD6 = 1; - D_80162DF4 = 1; - } - D_80162DC4 = (u32) &d_luigi_raceway_staff_ghost; - D_80162DE4 = 1; - break; - default: - D_80162DD6 = 1; - D_80162DF4 = 1; - } -} - -s32 func_800051C4(void) { - s32 phi_v0; - - if (D_80162D84 != 0) { - // func_80040174 in mio0_decode.s - 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 = (u32*) &D_802BFB80.arraySize8[0][D_80162DC8][3]; - mio0decode((u8*) D_800DC714, (u8*) D_80162D94); - D_80162D8C = (s32) (*D_80162D94 & 0xFF0000); - D_80162D90 = 0; - D_80162E00 = 1; -} - -void func_800052A4(void) { - s16 temp_v0; - - if (D_80162DC8 == 1) { - D_80162DC8 = 0; - D_80162DCC = 1; - } else { - D_80162DC8 = 1; - D_80162DCC = 0; - } - temp_v0 = D_80162DB8; - D_80162D80 = (void*) &D_802BFB80.arraySize8[0][D_80162DC8][3]; - D_80162D84 = temp_v0; - D_80162D86 = temp_v0; -} - -void func_80005310(void) { - - if (gModeSelection == TIME_TRIALS) { - - set_staff_ghost(); - - if (D_80162DC0 != gCurrentCourseId) { - D_80162DD4 = 1; - } - - D_80162DC0 = (u16) gCurrentCourseId; - D_80162DF0 = 0; - D_80162DEC = 0; - D_80162DF8 = 0; - - if (gModeSelection == TIME_TRIALS && gActiveScreenMode == SCREEN_MODE_1P) { - - if (D_8015F890 == 1) { - func_80004FB0(); - if (D_80162DD8 == 0) { - func_80004FF8(); - } - if (D_80162DD6 == 0) { - func_80004EF0(); - } - } else { - - D_80162DD8 = 1U; - D_80162DBC = (u32*) &D_802BFB80.arraySize8[0][D_80162DCC][3]; - D_80162DBC[0] = -1; - D_80162DB8 = 0; - D_80162DDC = 0; - func_80091EE4(); - if (D_80162DD4 == 0) { - func_80004FF8(); - } - if (D_80162DD6 == 0) { - func_80004EF0(); - } - } - } - } -} - -void func_8000546C(void) { - u32 temp_a0; - u32 temp_a1; - UNUSED u16 unk; - u16 temp_v1; - s16 phi_v1; - s16 phi_v0 = 0; - - if (D_80162DB0 >= 0x1000) { - gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI; - return; - } - - temp_a0 = D_80162DB4[D_80162DB0]; - temp_a1 = temp_a0 & 0xFF; - - if (temp_a1 < 0x80U) { - phi_v1 = (s16) (temp_a1 & 0xFF); - } else { - phi_v1 = (s16) (temp_a1 | (~0xFF)); - } - - temp_a1 = (u32) (temp_a0 & 0xFF00) >> 8; - gControllerEight->rawStickX = phi_v1; - - if (temp_a1 < 0x80U) { - phi_v1 = (s16) (temp_a1 & 0xFF); - } else { - phi_v1 = (s16) (temp_a1 | (~0xFF)); - } - gControllerEight->rawStickY = phi_v1; - if (temp_a0 & 0x80000000) { - phi_v0 |= A_BUTTON; - } - if (temp_a0 & 0x40000000) { - phi_v0 |= B_BUTTON; - } - if (temp_a0 & 0x20000000) { - phi_v0 |= Z_TRIG; - } - if (temp_a0 & 0x10000000) { - phi_v0 |= R_TRIG; - } - temp_v1 = gControllerEight->buttonPressed & 0x1F0F; - gControllerEight->buttonPressed = (phi_v0 & (phi_v0 ^ D_80162DA8)) | temp_v1; - temp_v1 = gControllerEight->buttonDepressed & 0x1F0F; - gControllerEight->buttonDepressed = (D_80162DA8 & (phi_v0 ^ D_80162DA8)) | temp_v1; - D_80162DA8 = phi_v0; - gControllerEight->button = phi_v0; - - if (D_80162DAC == 0) { - D_80162DB0++; - D_80162DAC = (s32) (D_80162DB4[D_80162DB0] & 0xFF0000); - } else { - D_80162DAC += 0xFFFF0000; - } -} - -void func_8000561C(void) { - u32 temp_a0; - u32 temp_v0; - UNUSED u16 unk; - u16 temp_v1; - s16 phi_v1; - s16 phi_a2 = 0; - - if (D_80162DA0 >= 0x1000) { - func_80005AE8(gPlayerThree); - return; - } - temp_a0 = D_80162DA4[D_80162DA0]; - temp_v0 = temp_a0 & 0xFF; - if (temp_v0 < 0x80U) { - phi_v1 = (s16) (temp_v0 & 0xFF); - } else { - phi_v1 = (s16) (temp_v0 | (~0xFF)); - } - - temp_v0 = (u32) (temp_a0 & 0xFF00) >> 8; - gControllerSeven->rawStickX = phi_v1; - - if (temp_v0 < 0x80U) { - phi_v1 = (s16) (temp_v0 & 0xFF); - } else { - phi_v1 = (s16) (temp_v0 | (~0xFF)); - } - gControllerSeven->rawStickY = phi_v1; - - if (temp_a0 & 0x80000000) { - phi_a2 = A_BUTTON; - } - if (temp_a0 & 0x40000000) { - phi_a2 |= B_BUTTON; - } - if (temp_a0 & 0x20000000) { - phi_a2 |= Z_TRIG; - } - if (temp_a0 & 0x10000000) { - phi_a2 |= R_TRIG; - } - - temp_v1 = gControllerSeven->buttonPressed & 0x1F0F; - gControllerSeven->buttonPressed = (phi_a2 & (phi_a2 ^ D_80162D98)) | temp_v1; - temp_v1 = gControllerSeven->buttonDepressed & 0x1F0F; - gControllerSeven->buttonDepressed = (D_80162D98 & (phi_a2 ^ D_80162D98)) | temp_v1; - D_80162D98 = phi_a2; - gControllerSeven->button = phi_a2; - if (D_80162D9C == 0) { - D_80162DA0++; - D_80162D9C = (s32) (D_80162DA4[D_80162DA0] & 0xFF0000); - } else { - D_80162D9C += (s32) 0xFFFF0000; - } -} - -void func_800057DC(void) { - u32 temp_a0; - u32 temp_v0; - UNUSED u16 unk; - u16 temp_v1; - s16 phi_v1; - s16 phi_a2 = 0; - - if (D_80162D90 >= 0x1000) { - func_80005AE8(gPlayerTwo); - return; - } - temp_a0 = D_80162D94[D_80162D90]; - temp_v0 = temp_a0 & 0xFF; - if (temp_v0 < 0x80U) { - phi_v1 = (s16) (temp_v0 & 0xFF); - } else { - phi_v1 = (s16) (temp_v0 | ~0xFF); - } - - temp_v0 = (u32) (temp_a0 & 0xFF00) >> 8; - - gControllerSix->rawStickX = phi_v1; - - if (temp_v0 < 0x80U) { - phi_v1 = (s16) (temp_v0 & 0xFF); - } else { - phi_v1 = (s16) (temp_v0 | (~0xFF)); - } - - gControllerSix->rawStickY = phi_v1; - - if (temp_a0 & 0x80000000) { - phi_a2 |= A_BUTTON; - } - if (temp_a0 & 0x40000000) { - phi_a2 |= B_BUTTON; - } - if (temp_a0 & 0x20000000) { - phi_a2 |= Z_TRIG; - } - if (temp_a0 & 0x10000000) { - phi_a2 |= R_TRIG; - } - temp_v1 = gControllerSix->buttonPressed & 0x1F0F; - gControllerSix->buttonPressed = (phi_a2 & (phi_a2 ^ D_80162D88)) | temp_v1; - - temp_v1 = gControllerSix->buttonDepressed & 0x1F0F; - gControllerSix->buttonDepressed = (D_80162D88 & (phi_a2 ^ D_80162D88)) | temp_v1; - D_80162D88 = phi_a2; - gControllerSix->button = phi_a2; - - if (D_80162D8C == 0) { - D_80162D90++; - D_80162D8C = (s32) (D_80162D94[D_80162D90] & 0xFF0000); - } else { - D_80162D8C += (s32) 0xFFFF0000; - } -} - -void func_8000599C(void) { - s16 temp_a2; - u32 phi_a3; - u32 temp_v1; - u32 temp_v2; - u32 temp_v0; - u32 temp_t0; - u32 temp_a0_2; - - if (((D_80162DB8 >= 0x1000) || ((gPlayerOne->unk_0CA & 2) != 0)) || ((gPlayerOne->unk_0CA & 8) != 0)) { - D_80162DF8 = 1; - return; - } - - temp_v1 = gControllerOne->rawStickX; - temp_v1 &= 0xFF; - temp_v2 = gControllerOne->rawStickY; - temp_v2 = (temp_v2 & 0xFF) << 8; - temp_a2 = gControllerOne->button; - phi_a3 = 0; - if (temp_a2 & 0x8000) { - phi_a3 |= 0x80000000; - } - if (temp_a2 & 0x4000) { - phi_a3 |= 0x40000000; - } - if (temp_a2 & 0x2000) { - phi_a3 |= 0x20000000; - } - if (temp_a2 & 0x0010) { - phi_a3 |= 0x10000000; - } - phi_a3 |= temp_v1; - phi_a3 |= temp_v2; - temp_t0 = D_80162DBC[D_80162DB8]; - temp_a0_2 = temp_t0 & 0xFF00FFFF; - - if ((*D_80162DBC) == 0xFFFFFFFF) { - - D_80162DBC[D_80162DB8] = phi_a3; - - } else if (temp_a0_2 == phi_a3) { - - temp_v0 = temp_t0 & 0xFF0000; - - if (temp_v0 == 0xFF0000) { - - D_80162DB8++; - D_80162DBC[D_80162DB8] = phi_a3; - - } else { - - temp_t0 += 0x10000; - D_80162DBC[D_80162DB8] = temp_t0; - } - } else { - D_80162DB8++; - D_80162DBC[D_80162DB8] = phi_a3; - } -} - -// sets player to AI? (unconfirmed) -void func_80005AE8(Player* ply) { - if (((ply->type & PLAYER_INVISIBLE_OR_BOMB) != 0) && (ply != gPlayerOne)) { - ply->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI; - } -} - -void func_80005B18(void) { - if (gModeSelection == TIME_TRIALS) { - if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 != 1)) { - if (D_80162DD4 == 1) { - D_80162DD0 = D_80162DCC; - func_800052A4(); - D_80162DD4 = 0; - D_80162DDC = 1; - D_80162DE0 = gPlayerOne->characterId; - D_80162DE8 = gPlayerOne->characterId; - D_80162E00 = 0; - D_80162DFC = playerHUD[PLAYER_ONE].someTimer; - func_80005AE8(gPlayerTwo); - func_80005AE8(gPlayerThree); - } else if (gLapCountByPlayerId[1] != 3) { - D_80162DD0 = D_80162DCC; - func_800052A4(); - D_80162DDC = 1; - D_80162DE0 = gPlayerOne->characterId; - D_80162DFC = playerHUD[PLAYER_ONE].someTimer; - D_80162E00 = 0; - D_80162DE8 = gPlayerOne->characterId; - func_80005AE8(gPlayerTwo); - func_80005AE8(gPlayerThree); - } else { - D_80162D80 = D_802BFB80.arraySize8[0][D_80162DC8][3].pixel_index_array; - D_80162D84 = D_80162D86; - D_80162DD0 = D_80162DCC; - D_80162DE8 = gPlayerOne->characterId; - D_80162DD8 = 0; - D_80162DD4 = 0; - D_80162DDC = 1; - func_80005AE8(gPlayerTwo); - func_80005AE8(gPlayerThree); - } - } else { - if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 == 1)) { - D_80162D80 = D_802BFB80.arraySize8[0][D_80162DC8][3].pixel_index_array; - D_80162D84 = D_80162D86; - D_80162DDC = 1; - } - if ((gPlayerOne->type & 0x800) == 0x800) { - func_80005AE8(gPlayerTwo); - func_80005AE8(gPlayerThree); - } else { - D_80162DEC += 1; - if (D_80162DEC >= 0x65) { - D_80162DEC = 0x00000064; - } - if ((gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) { - if ((D_80162DD4 == 0) && (gLapCountByPlayerId[1] != 3)) { - func_800057DC(); - } - if ((D_80162DD6 == 0) && (gLapCountByPlayerId[2] != 3)) { - func_8000561C(); - } - if (!(gPlayerOne->type & 0x800)) { - func_8000599C(); - } - } - } - } - } -} - -void func_80005E6C(void) { - if ((gModeSelection == TIME_TRIALS) && (gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) { - if ((D_80162DD8 == 0) && (gLapCountByPlayerId[1] != 3)) { - func_800057DC(); // 3 - } - if ((D_80162DD6 == 0) && (gLapCountByPlayerId[2] != 3)) { - func_8000561C(); // 2 - } - if ((gPlayerOne->type & PLAYER_CINEMATIC_MODE) != PLAYER_CINEMATIC_MODE) { - func_8000546C(); // 1 - return; - } - func_80005AE8(gPlayerTwo); - func_80005AE8(gPlayerThree); - } -} - -void staff_ghosts_loop(void) { - if (D_8015F890 == 1) { - func_80005E6C(); - return; - } - if (!D_80162DF0) { - func_80005B18(); - return; - } - D_80162DF8 = 1; -} diff --git a/src/textures.h b/src/textures.h index bc908ad5a6..5683cbe439 100644 --- a/src/textures.h +++ b/src/textures.h @@ -9,7 +9,6 @@ */ typedef struct { /* 0x00 */ s16 type; - /* 0x02 */ s16 unused1; /* 0x04 */ u64* textureData; // This should be interpreted as a segmented address /* 0x08 */ u16 width; /* 0x0A */ u16 height; @@ -17,209 +16,209 @@ typedef struct { /* 0x0E */ u16 dY; /* 0x10 */ u16 size; // This size is NOT equal to width*height. Its likely the size of the compressed texture /* 0x12 */ s16 unused2; -} MkTexture; // size = 0x14 +} MenuTexture; // size = 0x14 /** * @brief struct for an animation * */ typedef struct { - /* 0x00 */ MkTexture* mk64Texture; // This should be interpreted as a segmented address + /* 0x00 */ MenuTexture* mk64Texture; // This should be interpreted as a segmented address /* 0x04 */ s32 frame_length; } MkAnimation; // size = 0x8 -extern MkTexture D_02000000[2]; -extern MkTexture D_02000028[2]; -extern MkTexture D_02000050[2]; -extern MkTexture D_02000078[2]; -extern MkTexture D_020000A0[2]; -extern MkTexture D_020000C8[2]; -extern MkTexture D_020000F0[2]; -extern MkTexture D_02000118[2]; -extern MkTexture D_02000140[2]; -extern MkTexture D_02000168[2]; -extern MkTexture D_02000190[2]; -extern MkTexture D_020001B8[2]; -extern MkTexture D_020001E0[2]; -extern MkTexture D_02000208[2]; -extern MkTexture D_02000230[2]; -extern MkTexture D_02000258[2]; -extern MkTexture D_02000280[2]; -extern MkTexture D_020002A8[2]; -extern MkTexture D_020002D0[2]; -extern MkTexture D_020002F8[2]; -extern MkTexture D_02000320[2]; -extern MkTexture D_02000348[2]; -extern MkTexture D_02000370[2]; -extern MkTexture D_02000398[2]; -extern MkTexture D_020003C0[2]; -extern MkTexture D_020003E8[2]; -extern MkTexture D_02000410[2]; -extern MkTexture D_02000438[2]; -extern MkTexture D_02000460[2]; -extern MkTexture D_02000488[2]; -extern MkTexture D_020004B0[2]; -extern MkTexture D_020004D8[2]; -extern MkTexture D_02000500[2]; -extern MkTexture D_02000528[2]; -extern MkTexture D_02000550[2]; -extern MkTexture D_02000578[2]; -extern MkTexture D_020005A0[2]; -extern MkTexture D_020005C8[2]; -extern MkTexture D_020005F0[2]; -extern MkTexture D_02000618[2]; -extern MkTexture D_02000640[2]; -extern MkTexture D_02000668[2]; -extern MkTexture D_02000690[2]; -extern MkTexture D_020006B8[2]; -extern MkTexture D_020006E0[2]; -extern MkTexture D_02000708[2]; -extern MkTexture D_02000730[2]; -extern MkTexture D_02000758[2]; -extern MkTexture D_02000780[2]; -extern MkTexture D_020007A8[2]; -extern MkTexture D_020007D0[2]; -extern MkTexture D_020007F8[2]; -extern MkTexture D_02000820[2]; -extern MkTexture D_02000848[2]; -extern MkTexture D_02000870[2]; -extern MkTexture D_02000898[2]; -extern MkTexture D_020008C0[2]; -extern MkTexture D_020008E8[2]; -extern MkTexture D_02000910[2]; -extern MkTexture D_02000938[2]; -extern MkTexture D_02000960[2]; -extern MkTexture D_02000988[2]; -extern MkTexture D_020009B0[2]; -extern MkTexture D_020009D8[2]; -extern MkTexture D_02000A00[2]; -extern MkTexture D_02000A28[2]; -extern MkTexture D_02000A50[2]; -extern MkTexture D_02000A78[2]; -extern MkTexture D_02000AA0[2]; -extern MkTexture D_02000AC8[2]; -extern MkTexture D_02000AF0[2]; -extern MkTexture D_02000B18[2]; -extern MkTexture D_02000B40[2]; -extern MkTexture D_02000B68[2]; -extern MkTexture D_02000B90[2]; -extern MkTexture D_02000BB8[2]; -extern MkTexture D_02000BE0[2]; -extern MkTexture D_02000C08[2]; -extern MkTexture D_02000C30[2]; -extern MkTexture D_02000C58[2]; -extern MkTexture D_02000C80[2]; -extern MkTexture D_02000CA8[2]; -extern MkTexture D_02000CD0[2]; -extern MkTexture D_02000CF8[2]; -extern MkTexture D_02000D20[2]; -extern MkTexture D_02000D48[2]; -extern MkTexture D_02000D70[2]; -extern MkTexture D_02000D98[2]; -extern MkTexture D_02000DC0[2]; -extern MkTexture D_02000DE8[2]; -extern MkTexture D_02000E10[2]; -extern MkTexture D_02000E38[2]; -extern MkTexture D_02000E60[2]; -extern MkTexture D_02000E88[2]; -extern MkTexture D_02000EB0[2]; -extern MkTexture D_02000ED8[2]; -extern MkTexture D_02000F00[2]; -extern MkTexture D_02000F28[2]; -extern MkTexture D_02000F50[2]; -extern MkTexture D_02000F78[2]; -extern MkTexture D_02000FA0[2]; -extern MkTexture D_02000FC8[2]; -extern MkTexture D_02000FF0[2]; -extern MkTexture D_02001018[2]; -extern MkTexture D_02001040[2]; -extern MkTexture D_02001068[2]; -extern MkTexture D_02001090[2]; -extern MkTexture D_020010B8[2]; -extern MkTexture D_020010E0[2]; -extern MkTexture D_02001108[2]; -extern MkTexture D_02001130[2]; -extern MkTexture D_02001158[2]; -extern MkTexture D_02001180[2]; -extern MkTexture D_020011A8[2]; -extern MkTexture D_020011D0[2]; -extern MkTexture D_020011F8[2]; -extern MkTexture D_02001220[2]; -extern MkTexture D_02001248[2]; -extern MkTexture D_02001270[2]; -extern MkTexture D_02001298[2]; -extern MkTexture D_020012C0[2]; -extern MkTexture D_020012E8[2]; -extern MkTexture D_02001310[2]; -extern MkTexture D_02001338[2]; -extern MkTexture D_02001360[2]; -extern MkTexture D_02001388[2]; -extern MkTexture D_020013B0[2]; -extern MkTexture D_020013D8[2]; -extern MkTexture D_02001400[2]; -extern MkTexture D_02001428[2]; -extern MkTexture D_02001450[2]; -extern MkTexture D_02001478[2]; -extern MkTexture D_020014A0[2]; -extern MkTexture D_020014C8[6]; -extern MkTexture D_02001540[3]; -extern MkTexture D_0200157C[2]; -extern MkTexture D_020015A4[2]; -extern MkTexture D_020015CC[5]; -extern MkTexture D_02001630[2]; -extern MkTexture D_02001658[5]; -extern MkTexture D_020016BC[2]; -extern MkTexture D_020016E4[2]; -extern MkTexture D_0200170C[2]; -extern MkTexture D_02001734[2]; -extern MkTexture D_0200175C[2]; -extern MkTexture D_02001784[2]; -extern MkTexture D_020017AC[2]; -extern MkTexture D_020017D4[2]; -extern MkTexture D_020017FC[2]; -extern MkTexture D_02001824[2]; -extern MkTexture D_0200184C[2]; -extern MkTexture D_02001874[2]; -extern MkTexture D_0200189C[2]; -extern MkTexture D_020018C4[2]; -extern MkTexture D_020018EC[2]; -extern MkTexture D_02001914[2]; -extern MkTexture D_0200193C[2]; -extern MkTexture D_02001964[2]; +extern MenuTexture D_02000000[2]; +extern MenuTexture D_02000028[2]; +extern MenuTexture D_02000050[2]; +extern MenuTexture D_02000078[2]; +extern MenuTexture D_020000A0[2]; +extern MenuTexture D_020000C8[2]; +extern MenuTexture D_020000F0[2]; +extern MenuTexture D_02000118[2]; +extern MenuTexture D_02000140[2]; +extern MenuTexture D_02000168[2]; +extern MenuTexture D_02000190[2]; +extern MenuTexture D_020001B8[2]; +extern MenuTexture D_020001E0[2]; +extern MenuTexture D_02000208[2]; +extern MenuTexture D_02000230[2]; +extern MenuTexture D_02000258[2]; +extern MenuTexture D_02000280[2]; +extern MenuTexture D_020002A8[2]; +extern MenuTexture D_020002D0[2]; +extern MenuTexture D_020002F8[2]; +extern MenuTexture D_02000320[2]; +extern MenuTexture D_02000348[2]; +extern MenuTexture D_02000370[2]; +extern MenuTexture D_02000398[2]; +extern MenuTexture D_020003C0[2]; +extern MenuTexture D_020003E8[2]; +extern MenuTexture D_02000410[2]; +extern MenuTexture D_02000438[2]; +extern MenuTexture D_02000460[2]; +extern MenuTexture D_02000488[2]; +extern MenuTexture D_020004B0[2]; +extern MenuTexture D_020004D8[2]; +extern MenuTexture D_02000500[2]; +extern MenuTexture D_02000528[2]; +extern MenuTexture D_02000550[2]; +extern MenuTexture D_02000578[2]; +extern MenuTexture D_020005A0[2]; +extern MenuTexture D_020005C8[2]; +extern MenuTexture D_020005F0[2]; +extern MenuTexture D_02000618[2]; +extern MenuTexture D_02000640[2]; +extern MenuTexture D_02000668[2]; +extern MenuTexture D_02000690[2]; +extern MenuTexture D_020006B8[2]; +extern MenuTexture D_020006E0[2]; +extern MenuTexture D_02000708[2]; +extern MenuTexture D_02000730[2]; +extern MenuTexture D_02000758[2]; +extern MenuTexture D_02000780[2]; +extern MenuTexture D_020007A8[2]; +extern MenuTexture D_020007D0[2]; +extern MenuTexture D_020007F8[2]; +extern MenuTexture D_02000820[2]; +extern MenuTexture D_02000848[2]; +extern MenuTexture D_02000870[2]; +extern MenuTexture D_02000898[2]; +extern MenuTexture D_020008C0[2]; +extern MenuTexture D_020008E8[2]; +extern MenuTexture D_02000910[2]; +extern MenuTexture D_02000938[2]; +extern MenuTexture D_02000960[2]; +extern MenuTexture D_02000988[2]; +extern MenuTexture D_020009B0[2]; +extern MenuTexture D_020009D8[2]; +extern MenuTexture D_02000A00[2]; +extern MenuTexture D_02000A28[2]; +extern MenuTexture D_02000A50[2]; +extern MenuTexture D_02000A78[2]; +extern MenuTexture D_02000AA0[2]; +extern MenuTexture D_02000AC8[2]; +extern MenuTexture D_02000AF0[2]; +extern MenuTexture D_02000B18[2]; +extern MenuTexture D_02000B40[2]; +extern MenuTexture D_02000B68[2]; +extern MenuTexture D_02000B90[2]; +extern MenuTexture D_02000BB8[2]; +extern MenuTexture D_02000BE0[2]; +extern MenuTexture D_02000C08[2]; +extern MenuTexture D_02000C30[2]; +extern MenuTexture D_02000C58[2]; +extern MenuTexture D_02000C80[2]; +extern MenuTexture D_02000CA8[2]; +extern MenuTexture D_02000CD0[2]; +extern MenuTexture D_02000CF8[2]; +extern MenuTexture D_02000D20[2]; +extern MenuTexture D_02000D48[2]; +extern MenuTexture D_02000D70[2]; +extern MenuTexture D_02000D98[2]; +extern MenuTexture D_02000DC0[2]; +extern MenuTexture D_02000DE8[2]; +extern MenuTexture D_02000E10[2]; +extern MenuTexture D_02000E38[2]; +extern MenuTexture D_02000E60[2]; +extern MenuTexture D_02000E88[2]; +extern MenuTexture D_02000EB0[2]; +extern MenuTexture D_02000ED8[2]; +extern MenuTexture D_02000F00[2]; +extern MenuTexture D_02000F28[2]; +extern MenuTexture D_02000F50[2]; +extern MenuTexture D_02000F78[2]; +extern MenuTexture D_02000FA0[2]; +extern MenuTexture D_02000FC8[2]; +extern MenuTexture D_02000FF0[2]; +extern MenuTexture D_02001018[2]; +extern MenuTexture D_02001040[2]; +extern MenuTexture D_02001068[2]; +extern MenuTexture D_02001090[2]; +extern MenuTexture D_020010B8[2]; +extern MenuTexture D_020010E0[2]; +extern MenuTexture D_02001108[2]; +extern MenuTexture D_02001130[2]; +extern MenuTexture D_02001158[2]; +extern MenuTexture D_02001180[2]; +extern MenuTexture D_020011A8[2]; +extern MenuTexture D_020011D0[2]; +extern MenuTexture D_020011F8[2]; +extern MenuTexture D_02001220[2]; +extern MenuTexture D_02001248[2]; +extern MenuTexture D_02001270[2]; +extern MenuTexture D_02001298[2]; +extern MenuTexture D_020012C0[2]; +extern MenuTexture D_020012E8[2]; +extern MenuTexture D_02001310[2]; +extern MenuTexture D_02001338[2]; +extern MenuTexture D_02001360[2]; +extern MenuTexture D_02001388[2]; +extern MenuTexture D_020013B0[2]; +extern MenuTexture D_020013D8[2]; +extern MenuTexture D_02001400[2]; +extern MenuTexture D_02001428[2]; +extern MenuTexture D_02001450[2]; +extern MenuTexture D_02001478[2]; +extern MenuTexture D_020014A0[2]; +extern MenuTexture D_020014C8[6]; +extern MenuTexture D_02001540[3]; +extern MenuTexture D_0200157C[2]; +extern MenuTexture D_020015A4[2]; +extern MenuTexture D_020015CC[5]; +extern MenuTexture D_02001630[2]; +extern MenuTexture D_02001658[5]; +extern MenuTexture D_020016BC[2]; +extern MenuTexture D_020016E4[2]; +extern MenuTexture D_0200170C[2]; +extern MenuTexture D_02001734[2]; +extern MenuTexture D_0200175C[2]; +extern MenuTexture D_02001784[2]; +extern MenuTexture D_020017AC[2]; +extern MenuTexture D_020017D4[2]; +extern MenuTexture D_020017FC[2]; +extern MenuTexture D_02001824[2]; +extern MenuTexture D_0200184C[2]; +extern MenuTexture D_02001874[2]; +extern MenuTexture D_0200189C[2]; +extern MenuTexture D_020018C4[2]; +extern MenuTexture D_020018EC[2]; +extern MenuTexture D_02001914[2]; +extern MenuTexture D_0200193C[2]; +extern MenuTexture D_02001964[2]; extern MkAnimation D_0200198C[2]; extern MkAnimation D_0200199C[2]; extern MkAnimation D_020019AC[2]; extern MkAnimation D_020019BC[2]; extern MkAnimation D_020019CC[2]; extern MkAnimation D_020019DC[2]; -extern MkTexture D_020019EC[2]; -extern MkTexture D_02001A14[2]; -extern MkTexture D_02001A3C[2]; -extern MkTexture D_02001A64[2]; -extern MkTexture D_02001A8C[2]; -extern MkTexture D_02001AB4[2]; -extern MkTexture D_02001ADC[2]; -extern MkTexture D_02001B04[2]; -extern MkTexture D_02001B2C[2]; -extern MkTexture D_02001B54[2]; -extern MkTexture D_02001B7C[2]; -extern MkTexture D_02001BA4[2]; -extern MkTexture D_02001BCC[2]; -extern MkTexture D_02001BF4[2]; -extern MkTexture D_02001C1C[2]; -extern MkTexture D_02001C44[2]; -extern MkTexture D_02001C6C[2]; -extern MkTexture D_02001C94[2]; -extern MkTexture D_02001CBC[2]; -extern MkTexture D_02001CE4[2]; -extern MkTexture D_02001D0C[2]; -extern MkTexture D_02001D34[2]; -extern MkTexture D_02001D5C[2]; -extern MkTexture D_02001D84[2]; -extern MkTexture D_02001DAC[2]; -extern MkTexture D_02001DD4[2]; -extern MkTexture D_02001DFC[2]; -extern MkTexture D_02001E24[2]; +extern MenuTexture D_020019EC[2]; +extern MenuTexture D_02001A14[2]; +extern MenuTexture D_02001A3C[2]; +extern MenuTexture D_02001A64[2]; +extern MenuTexture D_02001A8C[2]; +extern MenuTexture D_02001AB4[2]; +extern MenuTexture D_02001ADC[2]; +extern MenuTexture D_02001B04[2]; +extern MenuTexture seg2_mario_raceway_preview_texture[2]; +extern MenuTexture D_02001B54[2]; +extern MenuTexture D_02001B7C[2]; +extern MenuTexture D_02001BA4[2]; +extern MenuTexture D_02001BCC[2]; +extern MenuTexture D_02001BF4[2]; +extern MenuTexture D_02001C1C[2]; +extern MenuTexture D_02001C44[2]; +extern MenuTexture D_02001C6C[2]; +extern MenuTexture D_02001C94[2]; +extern MenuTexture D_02001CBC[2]; +extern MenuTexture D_02001CE4[2]; +extern MenuTexture D_02001D0C[2]; +extern MenuTexture D_02001D34[2]; +extern MenuTexture D_02001D5C[2]; +extern MenuTexture D_02001D84[2]; +extern MenuTexture D_02001DAC[2]; +extern MenuTexture D_02001DD4[2]; +extern MenuTexture D_02001DFC[2]; +extern MenuTexture D_02001E24[2]; extern MkAnimation D_02001E4C[3]; extern MkAnimation D_02001E64[2]; extern MkAnimation D_02001E74[2]; @@ -241,453 +240,453 @@ extern MkAnimation D_02001F64[2]; extern MkAnimation D_02001F74[2]; extern MkAnimation D_02001F84[2]; extern MkAnimation D_02001F94[2]; -extern MkTexture D_02001FA4[2]; -extern MkTexture D_02001FCC[2]; -extern MkTexture D_02001FF4[2]; -extern MkTexture D_0200201C[2]; -extern MkTexture D_02002044[2]; -extern MkTexture D_0200206C[2]; -extern MkTexture D_02002094[2]; +extern MenuTexture D_02001FA4[2]; +extern MenuTexture D_02001FCC[2]; +extern MenuTexture D_02001FF4[2]; +extern MenuTexture D_0200201C[2]; +extern MenuTexture D_02002044[2]; +extern MenuTexture D_0200206C[2]; +extern MenuTexture D_02002094[2]; extern MkAnimation D_020020BC[2]; extern MkAnimation D_020020CC[2]; extern MkAnimation D_020020DC[2]; extern MkAnimation D_020020EC[2]; extern MkAnimation D_020020FC[2]; extern MkAnimation D_0200210C[2]; -extern MkTexture D_0200211C[2]; -extern MkTexture D_02002144[2]; -extern MkTexture D_0200216C[2]; -extern MkTexture D_02002194[2]; -extern MkTexture D_020021BC[2]; -extern MkTexture D_020021E4[2]; -extern MkTexture D_0200220C[2]; -extern MkTexture D_02002234[2]; -extern MkTexture D_0200225C[2]; -extern MkTexture D_02002284[2]; -extern MkTexture D_020022AC[2]; -extern MkTexture D_020022D4[2]; -extern MkTexture D_020022FC[2]; -extern MkTexture D_02002324[2]; -extern MkTexture D_0200234C[2]; -extern MkTexture D_02002374[2]; -extern MkTexture D_0200239C[2]; -extern MkTexture D_020023C4[2]; -extern MkTexture D_020023EC[2]; -extern MkTexture D_02002414[2]; -extern MkTexture D_0200243C[2]; -extern MkTexture D_02002464[2]; -extern MkTexture D_0200248C[2]; -extern MkTexture D_020024B4[2]; -extern MkTexture D_020024DC[2]; -extern MkTexture D_02002504[2]; -extern MkTexture D_0200252C[2]; -extern MkTexture D_02002554[2]; -extern MkTexture D_0200257C[2]; -extern MkTexture D_020025A4[2]; -extern MkTexture D_020025CC[2]; -extern MkTexture D_020025F4[2]; -extern MkTexture D_0200261C[2]; -extern MkTexture D_02002644[2]; -extern MkTexture D_0200266C[2]; -extern MkTexture D_02002694[2]; -extern MkTexture D_020026BC[2]; -extern MkTexture D_020026E4[2]; -extern MkTexture D_0200270C[2]; -extern MkTexture D_02002734[2]; -extern MkTexture D_0200275C[2]; -extern MkTexture D_02002784[2]; -extern MkTexture D_020027AC[2]; -extern MkTexture D_020027D4[2]; -extern MkTexture D_020027FC[2]; -extern MkTexture D_02002824[2]; -extern MkTexture D_0200284C[2]; -extern MkTexture D_02002874[2]; -extern MkTexture D_0200289C[2]; -extern MkTexture D_020028C4[2]; -extern MkTexture D_020028EC[2]; -extern MkTexture D_02002914[2]; -extern MkTexture D_0200293C[2]; -extern MkTexture D_02002964[2]; -extern MkTexture D_0200298C[2]; -extern MkTexture D_020029B4[2]; -extern MkTexture D_020029DC[2]; -extern MkTexture D_02002A04[2]; -extern MkTexture D_02002A2C[2]; -extern MkTexture D_02002A54[2]; -extern MkTexture D_02002A7C[2]; -extern MkTexture D_02002AA4[2]; -extern MkTexture D_02002ACC[2]; -extern MkTexture D_02002AF4[2]; -extern MkTexture D_02002B1C[2]; -extern MkTexture D_02002B44[2]; -extern MkTexture D_02002B6C[2]; -extern MkTexture D_02002B94[2]; -extern MkTexture D_02002BBC[2]; -extern MkTexture D_02002BE4[2]; -extern MkTexture D_02002C0C[2]; -extern MkTexture D_02002C34[2]; -extern MkTexture D_02002C5C[2]; -extern MkTexture D_02002C84[2]; -extern MkTexture D_02002CAC[2]; -extern MkTexture D_02002CD4[2]; -extern MkTexture D_02002CFC[2]; -extern MkTexture D_02002D24[2]; -extern MkTexture D_02002D4C[2]; -extern MkTexture D_02002D74[2]; -extern MkTexture D_02002D9C[2]; -extern MkTexture D_02002DC4[2]; -extern MkTexture D_02002DEC[2]; -extern MkTexture D_02002E14[2]; -extern MkTexture D_02002E3C[2]; -extern MkTexture D_02002E64[2]; -extern MkTexture D_02002E8C[2]; -extern MkTexture D_02002EB4[2]; -extern MkTexture D_02002EDC[2]; -extern MkTexture D_02002F04[2]; -extern MkTexture D_02002F2C[2]; -extern MkTexture D_02002F54[2]; -extern MkTexture D_02002F7C[2]; -extern MkTexture D_02002FA4[2]; -extern MkTexture D_02002FCC[2]; -extern MkTexture D_02002FF4[2]; -extern MkTexture D_0200301C[2]; -extern MkTexture D_02003044[2]; -extern MkTexture D_0200306C[2]; -extern MkTexture D_02003094[2]; -extern MkTexture D_020030BC[2]; -extern MkTexture D_020030E4[2]; -extern MkTexture D_0200310C[2]; -extern MkTexture D_02003134[2]; -extern MkTexture D_0200315C[2]; -extern MkTexture D_02003184[2]; -extern MkTexture D_020031AC[2]; -extern MkTexture D_020031D4[2]; -extern MkTexture D_020031FC[2]; -extern MkTexture D_02003224[2]; -extern MkTexture D_0200324C[2]; -extern MkTexture D_02003274[2]; -extern MkTexture D_0200329C[2]; -extern MkTexture D_020032C4[2]; -extern MkTexture D_020032EC[2]; -extern MkTexture D_02003314[2]; -extern MkTexture D_0200333C[2]; -extern MkTexture D_02003364[2]; -extern MkTexture D_0200338C[2]; -extern MkTexture D_020033B4[2]; -extern MkTexture D_020033DC[2]; -extern MkTexture D_02003404[2]; -extern MkTexture D_0200342C[2]; -extern MkTexture D_02003454[2]; -extern MkTexture D_0200347C[2]; -extern MkTexture D_020034A4[2]; -extern MkTexture D_020034CC[2]; -extern MkTexture D_020034F4[2]; -extern MkTexture D_0200351C[2]; -extern MkTexture D_02003544[2]; -extern MkTexture D_0200356C[2]; -extern MkTexture D_02003594[2]; -extern MkTexture D_020035BC[2]; -extern MkTexture D_020035E4[2]; -extern MkTexture D_0200360C[2]; -extern MkTexture D_02003634[2]; -extern MkTexture D_0200365C[2]; -extern MkTexture D_02003684[2]; -extern MkTexture D_020036AC[2]; -extern MkTexture D_020036D4[2]; -extern MkTexture D_020036FC[2]; -extern MkTexture D_02003724[2]; -extern MkTexture D_0200374C[2]; -extern MkTexture D_02003774[2]; -extern MkTexture D_0200379C[2]; -extern MkTexture D_020037C4[2]; -extern MkTexture D_020037EC[2]; -extern MkTexture D_02003814[2]; -extern MkTexture D_0200383C[2]; -extern MkTexture D_02003864[2]; -extern MkTexture D_0200388C[2]; -extern MkTexture D_020038B4[2]; -extern MkTexture D_020038DC[2]; -extern MkTexture D_02003904[2]; -extern MkTexture D_0200392C[2]; -extern MkTexture D_02003954[2]; -extern MkTexture D_0200397C[2]; -extern MkTexture D_020039A4[2]; -extern MkTexture D_020039CC[2]; -extern MkTexture D_020039F4[2]; -extern MkTexture D_02003A1C[2]; -extern MkTexture D_02003A44[2]; -extern MkTexture D_02003A6C[2]; -extern MkTexture D_02003A94[2]; -extern MkTexture D_02003ABC[2]; -extern MkTexture D_02003AE4[2]; -extern MkTexture D_02003B0C[2]; -extern MkTexture D_02003B34[2]; -extern MkTexture D_02003B5C[2]; -extern MkTexture D_02003B84[2]; -extern MkTexture D_02003BAC[2]; -extern MkTexture D_02003BD4[2]; -extern MkTexture D_02003BFC[2]; -extern MkTexture D_02003C24[2]; -extern MkTexture D_02003C4C[2]; -extern MkTexture D_02003C74[2]; -extern MkTexture D_02003C9C[2]; -extern MkTexture D_02003CC4[2]; -extern MkTexture D_02003CEC[2]; -extern MkTexture D_02003D14[2]; -extern MkTexture D_02003D3C[2]; -extern MkTexture D_02003D64[2]; -extern MkTexture D_02003D8C[2]; -extern MkTexture D_02003DB4[2]; -extern MkTexture D_02003DDC[2]; -extern MkTexture D_02003E04[2]; -extern MkTexture D_02003E2C[2]; -extern MkTexture D_02003E54[2]; -extern MkTexture D_02003E7C[2]; -extern MkTexture D_02003EA4[2]; -extern MkTexture D_02003ECC[2]; -extern MkTexture D_02003EF4[2]; -extern MkTexture D_02003F1C[2]; -extern MkTexture D_02003F44[2]; -extern MkTexture D_02003F6C[2]; -extern MkTexture D_02003F94[2]; -extern MkTexture D_02003FBC[2]; -extern MkTexture D_02003FE4[2]; -extern MkTexture D_0200400C[2]; -extern MkTexture D_02004034[2]; -extern MkTexture D_0200405C[2]; -extern MkTexture D_02004084[2]; -extern MkTexture D_020040AC[2]; -extern MkTexture D_020040D4[2]; -extern MkTexture D_020040FC[2]; -extern MkTexture D_02004124[2]; -extern MkTexture D_0200414C[2]; -extern MkTexture D_02004174[2]; -extern MkTexture D_0200419C[2]; -extern MkTexture D_020041C4[2]; -extern MkTexture D_020041EC[2]; -extern MkTexture D_02004214[2]; -extern MkTexture D_0200423C[2]; -extern MkTexture D_02004264[2]; -extern MkTexture D_0200428C[2]; -extern MkTexture D_020042B4[2]; -extern MkTexture D_020042DC[2]; -extern MkTexture D_02004304[2]; -extern MkTexture D_0200432C[2]; -extern MkTexture D_02004354[2]; -extern MkTexture D_0200437C[2]; -extern MkTexture D_020043A4[2]; -extern MkTexture D_020043CC[2]; -extern MkTexture D_020043F4[2]; -extern MkTexture D_0200441C[2]; -extern MkTexture D_02004444[2]; -extern MkTexture D_0200446C[2]; -extern MkTexture D_02004494[2]; -extern MkTexture D_020044BC[2]; -extern MkTexture D_020044E4[2]; -extern MkTexture D_0200450C[2]; -extern MkTexture D_02004534[2]; -extern MkTexture D_0200455C[2]; -extern MkTexture D_02004584[1]; -extern MkTexture D_02004598[2]; -extern MkTexture D_020045C0[2]; -extern MkTexture D_020045E8[2]; -extern MkTexture D_02004610[2]; -extern MkTexture D_02004638[2]; -extern MkTexture D_02004660[2]; -extern MkTexture D_02004688[4]; -extern MkTexture D_020046D8[5]; -extern MkTexture D_0200473C[4]; -extern MkTexture D_0200478C[4]; -extern MkTexture D_020047DC[2]; -extern MkTexture D_02004804[2]; -extern MkTexture D_0200482C[2]; -extern MkTexture D_02004854[2]; -extern MkTexture D_0200487C[2]; -extern MkTexture D_020048A4[2]; -extern MkTexture D_020048CC[2]; -extern MkTexture D_020048F4[2]; -extern MkTexture D_0200491C[2]; -extern MkTexture D_02004944[2]; -extern MkTexture D_0200496C[2]; -extern MkTexture D_02004994[2]; -extern MkTexture D_020049BC[2]; -extern MkTexture D_020049E4[2]; -extern MkTexture D_02004A0C[2]; -extern MkTexture D_02004A34[2]; -extern MkTexture D_02004A5C[3]; -extern MkTexture D_02004A98[3]; -extern MkTexture D_02004AD4[3]; -extern MkTexture D_02004B10[3]; -extern MkTexture D_02004B4C[2]; -extern MkTexture D_02004B74[2]; -extern MkTexture D_02004B9C[2]; -extern MkTexture D_02004BC4[2]; -extern MkTexture D_02004BEC[2]; -extern MkTexture D_02004C14[2]; -extern MkTexture D_02004C3C[2]; -extern MkTexture D_02004C64[2]; -extern MkTexture D_02004C8C[5]; -extern MkTexture D_02004CF0[5]; -extern MkTexture D_02004D54[5]; -extern MkTexture D_02004DB8[5]; -extern MkTexture D_02004E1C[5]; -extern MkTexture D_02004E80[2]; -extern MkTexture D_02004EA8[2]; -extern MkTexture D_02004ED0[2]; -extern MkTexture D_02004EF8[2]; -extern MkTexture D_02004F20[2]; -extern MkTexture D_02004F48[2]; -extern MkTexture D_02004F70[2]; -extern MkTexture D_02004F98[2]; -extern MkTexture D_02004FC0[2]; -extern MkTexture D_02004FE8[2]; -extern MkTexture D_02005010[2]; -extern MkTexture D_02005038[2]; -extern MkTexture D_02005060[2]; -extern MkTexture D_02005088[2]; -extern MkTexture D_020050B0[2]; -extern MkTexture D_020050D8[2]; -extern MkTexture D_02005100[2]; -extern MkTexture D_02005128[2]; -extern MkTexture D_02005150[2]; -extern MkTexture D_02005178[2]; -extern MkTexture D_020051A0[2]; -extern MkTexture D_020051C8[2]; -extern MkTexture D_020051F0[2]; -extern MkTexture D_02005218[2]; -extern MkTexture D_02005240[2]; -extern MkTexture D_02005268[2]; -extern MkTexture D_02005290[2]; -extern MkTexture D_020052B8[2]; -extern MkTexture D_020052E0[2]; -extern MkTexture D_02005308[2]; -extern MkTexture D_02005330[2]; -extern MkTexture D_02005358[2]; -extern MkTexture D_02005380[2]; -extern MkTexture D_020053A8[2]; -extern MkTexture D_020053D0[2]; -extern MkTexture D_020053F8[2]; -extern MkTexture D_02005420[2]; -extern MkTexture D_02005448[2]; -extern MkTexture D_02005470[2]; -extern MkTexture D_02005498[2]; -extern MkTexture D_020054C0[2]; -extern MkTexture D_020054E8[2]; -extern MkTexture D_02005510[2]; -extern MkTexture D_02005538[2]; -extern MkTexture D_02005560[2]; -extern MkTexture D_02005588[2]; -extern MkTexture D_020055B0[2]; -extern MkTexture D_020055D8[2]; -extern MkTexture D_02005600[2]; -extern MkTexture D_02005628[2]; -extern MkTexture D_02005650[2]; -extern MkTexture D_02005678[2]; -extern MkTexture D_020056A0[2]; -extern MkTexture D_020056C8[2]; -extern MkTexture D_020056F0[2]; -extern MkTexture D_02005718[2]; -extern MkTexture D_02005740[2]; -extern MkTexture D_02005768[2]; -extern MkTexture D_02005790[2]; -extern MkTexture D_020057B8[2]; -extern MkTexture D_020057E0[2]; -extern MkTexture D_02005808[2]; -extern MkTexture D_02005830[2]; -extern MkTexture D_02005858[2]; -extern MkTexture D_02005880[2]; -extern MkTexture D_020058A8[2]; -extern MkTexture D_020058D0[2]; -extern MkTexture D_020058F8[2]; -extern MkTexture D_02005920[2]; -extern MkTexture D_02005948[2]; -extern MkTexture D_02005970[2]; -extern MkTexture D_02005998[2]; -extern MkTexture D_020059C0[2]; -extern MkTexture D_020059E8[2]; -extern MkTexture D_02005A10[2]; -extern MkTexture D_02005A38[2]; -extern MkTexture D_02005A60[2]; -extern MkTexture D_02005A88[2]; -extern MkTexture D_02005AB0[2]; -extern MkTexture D_02005AD8[2]; -extern MkTexture D_02005B00[2]; -extern MkTexture D_02005B28[2]; -extern MkTexture D_02005B50[2]; -extern MkTexture D_02005B78[2]; -extern MkTexture D_02005BA0[2]; -extern MkTexture D_02005BC8[2]; -extern MkTexture D_02005BF0[2]; -extern MkTexture D_02005C18[2]; -extern MkTexture D_02005C40[2]; -extern MkTexture D_02005C68[2]; -extern MkTexture D_02005C90[2]; -extern MkTexture D_02005CB8[2]; -extern MkTexture D_02005CE0[2]; -extern MkTexture D_02005D08[2]; -extern MkTexture D_02005D30[2]; -extern MkTexture D_02005D58[2]; -extern MkTexture D_02005D80[2]; -extern MkTexture D_02005DA8[2]; -extern MkTexture D_02005DD0[2]; -extern MkTexture D_02005DF8[2]; -extern MkTexture D_02005E20[2]; -extern MkTexture D_02005E48[2]; -extern MkTexture D_02005E70[2]; -extern MkTexture D_02005E98[2]; -extern MkTexture D_02005EC0[2]; -extern MkTexture D_02005EE8[2]; -extern MkTexture D_02005F10[2]; -extern MkTexture D_02005F38[2]; -extern MkTexture D_02005F60[2]; -extern MkTexture D_02005F88[2]; -extern MkTexture D_02005FB0[2]; -extern MkTexture D_02005FD8[2]; -extern MkTexture D_02006000[2]; -extern MkTexture D_02006028[2]; -extern MkTexture D_02006050[2]; -extern MkTexture D_02006078[2]; -extern MkTexture D_020060A0[2]; -extern MkTexture D_020060C8[2]; -extern MkTexture D_020060F0[2]; -extern MkTexture D_02006118[2]; -extern MkTexture D_02006140[2]; -extern MkTexture D_02006168[2]; -extern MkTexture D_02006190[2]; -extern MkTexture D_020061B8[2]; -extern MkTexture D_020061E0[2]; -extern MkTexture D_02006208[2]; -extern MkTexture D_02006230[2]; -extern MkTexture D_02006258[2]; -extern MkTexture D_02006280[2]; -extern MkTexture D_020062A8[2]; -extern MkTexture D_020062D0[2]; -extern MkTexture D_020062F8[2]; -extern MkTexture D_02006320[2]; -extern MkTexture D_02006348[2]; -extern MkTexture D_02006370[2]; -extern MkTexture D_02006398[2]; -extern MkTexture D_020063C0[2]; -extern MkTexture D_020063E8[2]; -extern MkTexture D_02006410[2]; -extern MkTexture D_02006438[2]; -extern MkTexture D_02006460[2]; -extern MkTexture D_02006488[2]; -extern MkTexture D_020064B0[2]; -extern MkTexture D_020064D8[2]; -extern MkTexture D_02006500[2]; -extern MkTexture D_02006528[2]; -extern MkTexture D_02006550[2]; -extern MkTexture D_02006578[2]; -extern MkTexture D_020065A0[2]; -extern MkTexture D_020065C8[2]; -extern MkTexture D_020065F0[2]; -extern MkTexture D_02006618[2]; -extern MkTexture D_02006640[2]; -extern MkTexture D_02006668[2]; -extern MkTexture D_02006690[2]; -extern MkTexture D_020066B8[2]; -extern MkTexture D_020066E0[2]; +extern MenuTexture seg2_textureFontLetterA[2]; +extern MenuTexture seg2_textureFontLetterB[2]; +extern MenuTexture seg2_textureFontLetterC[2]; +extern MenuTexture seg2_textureFontLetterD[2]; +extern MenuTexture seg2_textureFontLetterE[2]; +extern MenuTexture seg2_textureFontLetterF[2]; +extern MenuTexture seg2_textureFontLetterG[2]; +extern MenuTexture seg2_textureFontLetterH[2]; +extern MenuTexture seg2_textureFontLetterI[2]; +extern MenuTexture seg2_textureFontLetterJ[2]; +extern MenuTexture seg2_textureFontLetterK[2]; +extern MenuTexture seg2_textureFontLetterL[2]; +extern MenuTexture seg2_textureFontLetterM[2]; +extern MenuTexture seg2_textureFontLetterN[2]; +extern MenuTexture seg2_textureFontLetterO[2]; +extern MenuTexture seg2_textureFontLetterP[2]; +extern MenuTexture seg2_textureFontLetterQ[2]; +extern MenuTexture seg2_textureFontLetterR[2]; +extern MenuTexture seg2_textureFontLetterS[2]; +extern MenuTexture seg2_textureFontLetterT[2]; +extern MenuTexture seg2_textureFontLetterU[2]; +extern MenuTexture seg2_textureFontLetterV[2]; +extern MenuTexture seg2_textureFontLetterW[2]; +extern MenuTexture seg2_textureFontLetterX[2]; +extern MenuTexture seg2_textureFontLetterY[2]; +extern MenuTexture seg2_textureFontLetterZ[2]; +extern MenuTexture seg2_textureFontExclamationMark[2]; +extern MenuTexture seg2_textureFontMinus[2]; +extern MenuTexture seg2_textureFontInterogationMark[2]; +extern MenuTexture seg2_textureFontSimpleQuote[2]; +extern MenuTexture seg2_textureFontDoubleQuote[2]; +extern MenuTexture seg2_textureFontPlus[2]; +extern MenuTexture seg2_textureFontDot[2]; +extern MenuTexture seg2_textureFontFourDote[2]; +extern MenuTexture seg2_textureFontCC[2]; +extern MenuTexture seg2_textureFontNumberZero[2]; +extern MenuTexture seg2_textureFontNumberOne[2]; +extern MenuTexture seg2_textureFontNumberTwo[2]; +extern MenuTexture seg2_textureFontNumberThree[2]; +extern MenuTexture seg2_textureFontNumberFour[2]; +extern MenuTexture seg2_textureFontNumberFive[2]; +extern MenuTexture seg2_textureFontNumberSix[2]; +extern MenuTexture seg2_textureFontNumberSeven[2]; +extern MenuTexture seg2_textureFontNumberEight[2]; +extern MenuTexture seg2_textureFontNumberNine[2]; +extern MenuTexture D_02002824[2]; +extern MenuTexture D_0200284C[2]; +extern MenuTexture D_02002874[2]; +extern MenuTexture D_0200289C[2]; +extern MenuTexture D_020028C4[2]; +extern MenuTexture D_020028EC[2]; +extern MenuTexture D_02002914[2]; +extern MenuTexture D_0200293C[2]; +extern MenuTexture D_02002964[2]; +extern MenuTexture D_0200298C[2]; +extern MenuTexture D_020029B4[2]; +extern MenuTexture D_020029DC[2]; +extern MenuTexture D_02002A04[2]; +extern MenuTexture D_02002A2C[2]; +extern MenuTexture D_02002A54[2]; +extern MenuTexture D_02002A7C[2]; +extern MenuTexture D_02002AA4[2]; +extern MenuTexture D_02002ACC[2]; +extern MenuTexture D_02002AF4[2]; +extern MenuTexture D_02002B1C[2]; +extern MenuTexture D_02002B44[2]; +extern MenuTexture D_02002B6C[2]; +extern MenuTexture D_02002B94[2]; +extern MenuTexture D_02002BBC[2]; +extern MenuTexture D_02002BE4[2]; +extern MenuTexture D_02002C0C[2]; +extern MenuTexture D_02002C34[2]; +extern MenuTexture D_02002C5C[2]; +extern MenuTexture D_02002C84[2]; +extern MenuTexture D_02002CAC[2]; +extern MenuTexture D_02002CD4[2]; +extern MenuTexture D_02002CFC[2]; +extern MenuTexture D_02002D24[2]; +extern MenuTexture D_02002D4C[2]; +extern MenuTexture D_02002D74[2]; +extern MenuTexture D_02002D9C[2]; +extern MenuTexture D_02002DC4[2]; +extern MenuTexture D_02002DEC[2]; +extern MenuTexture D_02002E14[2]; +extern MenuTexture D_02002E3C[2]; +extern MenuTexture D_02002E64[2]; +extern MenuTexture D_02002E8C[2]; +extern MenuTexture D_02002EB4[2]; +extern MenuTexture D_02002EDC[2]; +extern MenuTexture D_02002F04[2]; +extern MenuTexture D_02002F2C[2]; +extern MenuTexture D_02002F54[2]; +extern MenuTexture D_02002F7C[2]; +extern MenuTexture D_02002FA4[2]; +extern MenuTexture D_02002FCC[2]; +extern MenuTexture D_02002FF4[2]; +extern MenuTexture D_0200301C[2]; +extern MenuTexture D_02003044[2]; +extern MenuTexture D_0200306C[2]; +extern MenuTexture D_02003094[2]; +extern MenuTexture D_020030BC[2]; +extern MenuTexture D_020030E4[2]; +extern MenuTexture D_0200310C[2]; +extern MenuTexture D_02003134[2]; +extern MenuTexture D_0200315C[2]; +extern MenuTexture D_02003184[2]; +extern MenuTexture D_020031AC[2]; +extern MenuTexture D_020031D4[2]; +extern MenuTexture D_020031FC[2]; +extern MenuTexture D_02003224[2]; +extern MenuTexture D_0200324C[2]; +extern MenuTexture D_02003274[2]; +extern MenuTexture D_0200329C[2]; +extern MenuTexture D_020032C4[2]; +extern MenuTexture D_020032EC[2]; +extern MenuTexture D_02003314[2]; +extern MenuTexture D_0200333C[2]; +extern MenuTexture D_02003364[2]; +extern MenuTexture D_0200338C[2]; +extern MenuTexture D_020033B4[2]; +extern MenuTexture D_020033DC[2]; +extern MenuTexture D_02003404[2]; +extern MenuTexture D_0200342C[2]; +extern MenuTexture D_02003454[2]; +extern MenuTexture D_0200347C[2]; +extern MenuTexture D_020034A4[2]; +extern MenuTexture D_020034CC[2]; +extern MenuTexture D_020034F4[2]; +extern MenuTexture D_0200351C[2]; +extern MenuTexture D_02003544[2]; +extern MenuTexture D_0200356C[2]; +extern MenuTexture D_02003594[2]; +extern MenuTexture D_020035BC[2]; +extern MenuTexture D_020035E4[2]; +extern MenuTexture D_0200360C[2]; +extern MenuTexture D_02003634[2]; +extern MenuTexture D_0200365C[2]; +extern MenuTexture D_02003684[2]; +extern MenuTexture D_020036AC[2]; +extern MenuTexture D_020036D4[2]; +extern MenuTexture D_020036FC[2]; +extern MenuTexture D_02003724[2]; +extern MenuTexture D_0200374C[2]; +extern MenuTexture D_02003774[2]; +extern MenuTexture D_0200379C[2]; +extern MenuTexture D_020037C4[2]; +extern MenuTexture D_020037EC[2]; +extern MenuTexture D_02003814[2]; +extern MenuTexture D_0200383C[2]; +extern MenuTexture D_02003864[2]; +extern MenuTexture D_0200388C[2]; +extern MenuTexture D_020038B4[2]; +extern MenuTexture D_020038DC[2]; +extern MenuTexture D_02003904[2]; +extern MenuTexture D_0200392C[2]; +extern MenuTexture D_02003954[2]; +extern MenuTexture D_0200397C[2]; +extern MenuTexture D_020039A4[2]; +extern MenuTexture D_020039CC[2]; +extern MenuTexture D_020039F4[2]; +extern MenuTexture D_02003A1C[2]; +extern MenuTexture D_02003A44[2]; +extern MenuTexture D_02003A6C[2]; +extern MenuTexture D_02003A94[2]; +extern MenuTexture D_02003ABC[2]; +extern MenuTexture D_02003AE4[2]; +extern MenuTexture D_02003B0C[2]; +extern MenuTexture D_02003B34[2]; +extern MenuTexture D_02003B5C[2]; +extern MenuTexture D_02003B84[2]; +extern MenuTexture D_02003BAC[2]; +extern MenuTexture D_02003BD4[2]; +extern MenuTexture D_02003BFC[2]; +extern MenuTexture D_02003C24[2]; +extern MenuTexture D_02003C4C[2]; +extern MenuTexture D_02003C74[2]; +extern MenuTexture D_02003C9C[2]; +extern MenuTexture D_02003CC4[2]; +extern MenuTexture D_02003CEC[2]; +extern MenuTexture D_02003D14[2]; +extern MenuTexture D_02003D3C[2]; +extern MenuTexture D_02003D64[2]; +extern MenuTexture D_02003D8C[2]; +extern MenuTexture D_02003DB4[2]; +extern MenuTexture D_02003DDC[2]; +extern MenuTexture D_02003E04[2]; +extern MenuTexture D_02003E2C[2]; +extern MenuTexture D_02003E54[2]; +extern MenuTexture D_02003E7C[2]; +extern MenuTexture D_02003EA4[2]; +extern MenuTexture D_02003ECC[2]; +extern MenuTexture D_02003EF4[2]; +extern MenuTexture D_02003F1C[2]; +extern MenuTexture D_02003F44[2]; +extern MenuTexture D_02003F6C[2]; +extern MenuTexture D_02003F94[2]; +extern MenuTexture D_02003FBC[2]; +extern MenuTexture D_02003FE4[2]; +extern MenuTexture D_0200400C[2]; +extern MenuTexture D_02004034[2]; +extern MenuTexture D_0200405C[2]; +extern MenuTexture D_02004084[2]; +extern MenuTexture D_020040AC[2]; +extern MenuTexture D_020040D4[2]; +extern MenuTexture D_020040FC[2]; +extern MenuTexture D_02004124[2]; +extern MenuTexture D_0200414C[2]; +extern MenuTexture D_02004174[2]; +extern MenuTexture D_0200419C[2]; +extern MenuTexture D_020041C4[2]; +extern MenuTexture D_020041EC[2]; +extern MenuTexture D_02004214[2]; +extern MenuTexture D_0200423C[2]; +extern MenuTexture D_02004264[2]; +extern MenuTexture D_0200428C[2]; +extern MenuTexture D_020042B4[2]; +extern MenuTexture D_020042DC[2]; +extern MenuTexture D_02004304[2]; +extern MenuTexture D_0200432C[2]; +extern MenuTexture D_02004354[2]; +extern MenuTexture D_0200437C[2]; +extern MenuTexture D_020043A4[2]; +extern MenuTexture D_020043CC[2]; +extern MenuTexture D_020043F4[2]; +extern MenuTexture D_0200441C[2]; +extern MenuTexture D_02004444[2]; +extern MenuTexture D_0200446C[2]; +extern MenuTexture D_02004494[2]; +extern MenuTexture D_020044BC[2]; +extern MenuTexture D_020044E4[2]; +extern MenuTexture D_0200450C[2]; +extern MenuTexture seg2_textureFontComma[2]; +extern MenuTexture D_0200455C[2]; +extern MenuTexture seg2_textureFontEmpty[1]; +extern MenuTexture seg2_blue_sky_background_texture[2]; +extern MenuTexture seg2_sunset_background_texture[2]; +extern MenuTexture seg2_copyright_1996_texture[2]; +extern MenuTexture seg2_push_start_button_texture[2]; +extern MenuTexture D_02004638[2]; +extern MenuTexture seg2_game_select_texture[2]; +extern MenuTexture seg2_menu_1p_column[4]; +extern MenuTexture seg2_menu_2p_column[5]; +extern MenuTexture seg2_menu_3p_column[4]; +extern MenuTexture seg2_menu_4p_column[4]; +extern MenuTexture D_020047DC[2]; +extern MenuTexture D_02004804[2]; +extern MenuTexture D_0200482C[2]; +extern MenuTexture D_02004854[2]; +extern MenuTexture D_0200487C[2]; +extern MenuTexture gTextureMenuLOption[2]; +extern MenuTexture seg2_textureMenuRData[2]; +extern MenuTexture seg2_50_CC_texture[2]; +extern MenuTexture seg2_100_CC_texture[2]; +extern MenuTexture seg2_150_CC_texture[2]; +extern MenuTexture seg2_extra_CC_texture[2]; +extern MenuTexture seg2_menu_no_item_texture[2]; +extern MenuTexture D_020049BC[2]; +extern MenuTexture D_020049E4[2]; +extern MenuTexture D_02004A0C[2]; +extern MenuTexture seg2_data_texture[2]; +extern MenuTexture seg2_P1_border_texture[3]; +extern MenuTexture seg2_P2_border_texture[3]; +extern MenuTexture seg2_P3_border_texture[3]; +extern MenuTexture seg2_P4_border_texture[3]; +extern MenuTexture D_02004B4C[2]; +extern MenuTexture D_02004B74[2]; +extern MenuTexture seg2_menu_select_texture[2]; +extern MenuTexture seg2_mushroom_cup_texture[2]; +extern MenuTexture seg2_flower_cup_texture[2]; +extern MenuTexture seg2_star_cup_texture[2]; +extern MenuTexture seg2_special_cup_texture[2]; +extern MenuTexture seg2_mario_raceway_preview_small_texture[2]; +extern MenuTexture seg2_mushroom_cup_title_texture[5]; +extern MenuTexture seg2_flower_cup_title_texture[5]; +extern MenuTexture seg2_star_cup_title_texture[5]; +extern MenuTexture seg2_special_cup_title_texture[5]; +extern MenuTexture seg2_battle_title_texture[5]; +extern MenuTexture D_02004E80[2]; +extern MenuTexture seg2_mario_raceway_title_texture[2]; +extern MenuTexture seg2_choco_mountain_title_texture[2]; +extern MenuTexture D_02004EF8[2]; +extern MenuTexture D_02004F20[2]; +extern MenuTexture D_02004F48[2]; +extern MenuTexture D_02004F70[2]; +extern MenuTexture D_02004F98[2]; +extern MenuTexture D_02004FC0[2]; +extern MenuTexture D_02004FE8[2]; +extern MenuTexture D_02005010[2]; +extern MenuTexture D_02005038[2]; +extern MenuTexture D_02005060[2]; +extern MenuTexture D_02005088[2]; +extern MenuTexture D_020050B0[2]; +extern MenuTexture D_020050D8[2]; +extern MenuTexture D_02005100[2]; +extern MenuTexture D_02005128[2]; +extern MenuTexture D_02005150[2]; +extern MenuTexture D_02005178[2]; +extern MenuTexture D_020051A0[2]; +extern MenuTexture D_020051C8[2]; +extern MenuTexture D_020051F0[2]; +extern MenuTexture D_02005218[2]; +extern MenuTexture D_02005240[2]; +extern MenuTexture D_02005268[2]; +extern MenuTexture D_02005290[2]; +extern MenuTexture D_020052B8[2]; +extern MenuTexture D_020052E0[2]; +extern MenuTexture D_02005308[2]; +extern MenuTexture D_02005330[2]; +extern MenuTexture D_02005358[2]; +extern MenuTexture D_02005380[2]; +extern MenuTexture D_020053A8[2]; +extern MenuTexture D_020053D0[2]; +extern MenuTexture D_020053F8[2]; +extern MenuTexture D_02005420[2]; +extern MenuTexture D_02005448[2]; +extern MenuTexture D_02005470[2]; +extern MenuTexture D_02005498[2]; +extern MenuTexture D_020054C0[2]; +extern MenuTexture D_020054E8[2]; +extern MenuTexture D_02005510[2]; +extern MenuTexture D_02005538[2]; +extern MenuTexture D_02005560[2]; +extern MenuTexture D_02005588[2]; +extern MenuTexture D_020055B0[2]; +extern MenuTexture D_020055D8[2]; +extern MenuTexture D_02005600[2]; +extern MenuTexture D_02005628[2]; +extern MenuTexture D_02005650[2]; +extern MenuTexture D_02005678[2]; +extern MenuTexture D_020056A0[2]; +extern MenuTexture D_020056C8[2]; +extern MenuTexture D_020056F0[2]; +extern MenuTexture D_02005718[2]; +extern MenuTexture D_02005740[2]; +extern MenuTexture D_02005768[2]; +extern MenuTexture D_02005790[2]; +extern MenuTexture D_020057B8[2]; +extern MenuTexture D_020057E0[2]; +extern MenuTexture D_02005808[2]; +extern MenuTexture D_02005830[2]; +extern MenuTexture D_02005858[2]; +extern MenuTexture D_02005880[2]; +extern MenuTexture D_020058A8[2]; +extern MenuTexture D_020058D0[2]; +extern MenuTexture D_020058F8[2]; +extern MenuTexture D_02005920[2]; +extern MenuTexture D_02005948[2]; +extern MenuTexture D_02005970[2]; +extern MenuTexture D_02005998[2]; +extern MenuTexture D_020059C0[2]; +extern MenuTexture D_020059E8[2]; +extern MenuTexture D_02005A10[2]; +extern MenuTexture D_02005A38[2]; +extern MenuTexture D_02005A60[2]; +extern MenuTexture D_02005A88[2]; +extern MenuTexture D_02005AB0[2]; +extern MenuTexture D_02005AD8[2]; +extern MenuTexture D_02005B00[2]; +extern MenuTexture D_02005B28[2]; +extern MenuTexture D_02005B50[2]; +extern MenuTexture D_02005B78[2]; +extern MenuTexture D_02005BA0[2]; +extern MenuTexture D_02005BC8[2]; +extern MenuTexture D_02005BF0[2]; +extern MenuTexture D_02005C18[2]; +extern MenuTexture D_02005C40[2]; +extern MenuTexture D_02005C68[2]; +extern MenuTexture D_02005C90[2]; +extern MenuTexture D_02005CB8[2]; +extern MenuTexture D_02005CE0[2]; +extern MenuTexture D_02005D08[2]; +extern MenuTexture D_02005D30[2]; +extern MenuTexture D_02005D58[2]; +extern MenuTexture D_02005D80[2]; +extern MenuTexture D_02005DA8[2]; +extern MenuTexture D_02005DD0[2]; +extern MenuTexture D_02005DF8[2]; +extern MenuTexture D_02005E20[2]; +extern MenuTexture D_02005E48[2]; +extern MenuTexture D_02005E70[2]; +extern MenuTexture D_02005E98[2]; +extern MenuTexture D_02005EC0[2]; +extern MenuTexture D_02005EE8[2]; +extern MenuTexture D_02005F10[2]; +extern MenuTexture D_02005F38[2]; +extern MenuTexture D_02005F60[2]; +extern MenuTexture D_02005F88[2]; +extern MenuTexture D_02005FB0[2]; +extern MenuTexture D_02005FD8[2]; +extern MenuTexture D_02006000[2]; +extern MenuTexture D_02006028[2]; +extern MenuTexture D_02006050[2]; +extern MenuTexture D_02006078[2]; +extern MenuTexture D_020060A0[2]; +extern MenuTexture D_020060C8[2]; +extern MenuTexture D_020060F0[2]; +extern MenuTexture D_02006118[2]; +extern MenuTexture D_02006140[2]; +extern MenuTexture D_02006168[2]; +extern MenuTexture D_02006190[2]; +extern MenuTexture D_020061B8[2]; +extern MenuTexture D_020061E0[2]; +extern MenuTexture D_02006208[2]; +extern MenuTexture D_02006230[2]; +extern MenuTexture D_02006258[2]; +extern MenuTexture D_02006280[2]; +extern MenuTexture D_020062A8[2]; +extern MenuTexture D_020062D0[2]; +extern MenuTexture D_020062F8[2]; +extern MenuTexture D_02006320[2]; +extern MenuTexture D_02006348[2]; +extern MenuTexture D_02006370[2]; +extern MenuTexture D_02006398[2]; +extern MenuTexture D_020063C0[2]; +extern MenuTexture D_020063E8[2]; +extern MenuTexture D_02006410[2]; +extern MenuTexture D_02006438[2]; +extern MenuTexture D_02006460[2]; +extern MenuTexture D_02006488[2]; +extern MenuTexture D_020064B0[2]; +extern MenuTexture D_020064D8[2]; +extern MenuTexture D_02006500[2]; +extern MenuTexture D_02006528[2]; +extern MenuTexture D_02006550[2]; +extern MenuTexture D_02006578[2]; +extern MenuTexture D_020065A0[2]; +extern MenuTexture D_020065C8[2]; +extern MenuTexture D_020065F0[2]; +extern MenuTexture D_02006618[2]; +extern MenuTexture D_02006640[2]; +extern MenuTexture D_02006668[2]; +extern MenuTexture D_02006690[2]; +extern MenuTexture D_020066B8[2]; +extern MenuTexture D_020066E0[2]; extern MkAnimation D_02006708[2]; extern MkAnimation D_02006718[12]; extern MkAnimation D_02006778[2]; @@ -857,51 +856,51 @@ extern u64 gTexture7F0F5C[]; extern u64 gTexture7F0FD8[]; extern u64 gTexture7F1038[]; extern u64 gTexture7F109C[]; -extern u64 gTexture7F1124[]; -extern u64 gTexture7F11F4[]; -extern u64 gTexture7F12C4[]; -extern u64 gTexture7F1394[]; -extern u64 gTexture7F1464[]; -extern u64 gTexture7F1534[]; -extern u64 gTexture7F1604[]; -extern u64 gTexture7F16D4[]; -extern u64 gTexture7F17A4[]; -extern u64 gTexture7F1874[]; -extern u64 gTexture7F1944[]; -extern u64 gTexture7F1A14[]; -extern u64 gTexture7F1AE4[]; -extern u64 gTexture7F1BB4[]; -extern u64 gTexture7F1C84[]; -extern u64 gTexture7F1D54[]; -extern u64 gTexture7F1E24[]; -extern u64 gTexture7F1EF4[]; -extern u64 gTexture7F1FC4[]; -extern u64 gTexture7F2094[]; -extern u64 gTexture7F2164[]; -extern u64 gTexture7F2234[]; -extern u64 gTexture7F2304[]; -extern u64 gTexture7F23D4[]; -extern u64 gTexture7F24A4[]; -extern u64 gTexture7F2574[]; -extern u64 gTexture7F2644[]; -extern u64 gTexture7F2714[]; -extern u64 gTexture7F27E4[]; -extern u64 gTexture7F28B4[]; -extern u64 gTexture7F2984[]; -extern u64 gTexture7F2A54[]; -extern u64 gTexture7F2B24[]; -extern u64 gTexture7F2BF4[]; -extern u64 gTexture7F2CC4[]; -extern u64 gTexture7F2D94[]; -extern u64 gTexture7F2E64[]; -extern u64 gTexture7F2F34[]; -extern u64 gTexture7F3004[]; -extern u64 gTexture7F30D4[]; -extern u64 gTexture7F31A4[]; -extern u64 gTexture7F3274[]; -extern u64 gTexture7F3344[]; -extern u64 gTexture7F3414[]; -extern u64 gTexture7F34E4[]; +extern u64 font_four_dote[]; +extern u64 font_cc[]; +extern u64 font_double_quote[]; +extern u64 font_exclamation_mark[]; +extern u64 font_minus[]; +extern u64 font_dot[]; +extern u64 font_plus[]; +extern u64 font_interogation_mark[]; +extern u64 font_simple_quote[]; +extern u64 font_number_zero[]; +extern u64 font_number_one[]; +extern u64 font_number_two[]; +extern u64 font_number_three[]; +extern u64 font_number_four[]; +extern u64 font_number_five[]; +extern u64 font_number_six[]; +extern u64 font_number_seven[]; +extern u64 font_number_eight[]; +extern u64 font_number_nine[]; +extern u64 font_letter_A[]; +extern u64 font_letter_B[]; +extern u64 font_letter_C[]; +extern u64 font_letter_D[]; +extern u64 font_letter_E[]; +extern u64 font_letter_F[]; +extern u64 font_letter_G[]; +extern u64 font_letter_H[]; +extern u64 font_letter_I[]; +extern u64 font_letter_J[]; +extern u64 font_letter_K[]; +extern u64 font_letter_L[]; +extern u64 font_letter_M[]; +extern u64 font_letter_N[]; +extern u64 font_letter_O[]; +extern u64 font_letter_P[]; +extern u64 font_letter_Q[]; +extern u64 font_letter_R[]; +extern u64 font_letter_S[]; +extern u64 font_letter_T[]; +extern u64 font_letter_U[]; +extern u64 font_letter_V[]; +extern u64 font_letter_W[]; +extern u64 font_letter_X[]; +extern u64 font_letter_Y[]; +extern u64 font_letter_Z[]; extern u64 gTexture7F35B4[]; extern u64 gTexture7F3634[]; extern u64 gTexture7F36B4[]; @@ -1085,13 +1084,13 @@ extern u64 gTexture7F9CF4[]; extern u64 gTexture7F9DC4[]; extern u64 gTexture7F9E44[]; extern u64 gTexture7F9EC4[]; -extern u64 gTexture7FA044[]; +extern u64 font_apostrophe[]; extern u64 gTexture7FA0C4[]; extern u64 gTexture7FA194[]; extern u64 gTexture7FA264[]; -extern u64 gTexture7FA334[]; -extern u64 gTextureBackgroundBlueSky[]; -extern u64 gTextureBackgroundSunset[]; +extern u64 font_comma[]; +extern u64 background_blue_sky[]; +extern u64 background_sunset[]; extern u64 gTextureBowserFace00[]; extern u64 gTextureBowserFace01[]; extern u64 gTextureBowserFace02[]; @@ -1109,7 +1108,7 @@ extern u64 gTextureBowserFace13[]; extern u64 gTextureBowserFace14[]; extern u64 gTextureBowserFace15[]; extern u64 gTextureBowserFace16[]; -extern u64 gTextureCopyright1996[]; +extern u64 copyright_1996[]; extern u64 gTextureCupBronze[]; extern u64 gTextureCupGold[]; extern u64 gTextureCupSilver[]; @@ -1132,7 +1131,7 @@ extern u64 gTextureDkFace15[]; extern u64 gTextureDkFace16[]; extern u64 gTextureEraseDataRecordConfirmation[]; extern u64 gTextureErasingSelectedRecord[]; -extern u64 gTextureGameSelect[]; +extern u64 texture_game_select[]; extern u64 gTextureGoldBar[]; extern u64 gTextureGoldStripe[]; extern u64 gTextureGreenGoldStripe[]; @@ -1171,40 +1170,40 @@ extern u64 gTextureMarioFace13[]; extern u64 gTextureMarioFace14[]; extern u64 gTextureMarioFace15[]; extern u64 gTextureMarioFace16[]; -extern u64 gTextureMenu100cc[]; -extern u64 gTextureMenu150cc[]; -extern u64 gTextureMenu1PGame[]; -extern u64 gTextureMenu2PGame[]; -extern u64 gTextureMenu3PGame[]; -extern u64 gTextureMenu4PGame[]; -extern u64 gTextureMenu50cc[]; -extern u64 gTextureMenuBegin[]; -extern u64 gTextureMenuData[]; -extern u64 gTextureMenuExtra[]; +extern u64 texture_100cc[]; +extern u64 texture_150cc[]; +extern u64 texture_menu_1p_game[]; +extern u64 texture_menu_2p_game[]; +extern u64 texture_menu_3p_game[]; +extern u64 texture_menu_4p_game[]; +extern u64 texture_50cc[]; +extern u64 texture_begin[]; +extern u64 texture_data[]; +extern u64 texture_extra[]; extern u64 gTextureMenuFlowerCup[]; -extern u64 gTextureMenuGhost[]; -extern u64 gTextureMenuLOption[]; -extern u64 gTextureMenuModeBattle[]; -extern u64 gTextureMenuModeMarioGP[]; -extern u64 gTextureMenuModeTimeTrials[]; -extern u64 gTextureMenuModeVS[]; +extern u64 texture_menu_ghost[]; +extern u64 texture_l_option[]; +extern u64 texture_mode_battle[]; +extern u64 texture_mode_mario_gp[]; +extern u64 texture_mode_time_trials[]; +extern u64 texture_mode_vs[]; extern u64 gTextureMenuMushroomCup[]; -extern u64 gTextureMenuOK[]; -extern u64 gTextureMenuRData[]; +extern u64 texture_ok[]; +extern u64 texture_r_data[]; extern u64 gTextureMenuSpecialCup[]; extern u64 gTextureMenuStarCup[]; extern u64 gTextureMenuWithItem[]; extern u64 gTextureMenuWithoutItem[]; extern u64 gTextureN64ControllerPakDataSelect[]; -extern u64 gTextureNameBowser[]; -extern u64 gTextureNameDK[]; -extern u64 gTextureNameLuigi[]; -extern u64 gTextureNameMario[]; -extern u64 gTextureNamePeach[]; -extern u64 gTextureNameToad[]; -extern u64 gTextureNameWario[]; -extern u64 gTextureNameYoshi[]; -extern u64 gTextureOption[]; +extern u64 texture_name_bowser[]; +extern u64 texture_name_dk[]; +extern u64 texture_name_luigi[]; +extern u64 texture_name_mario[]; +extern u64 texture_name_peach[]; +extern u64 texture_name_toad[]; +extern u64 texture_name_wario[]; +extern u64 texture_name_yoshi[]; +extern u64 texture_option[]; extern u64 gTextureP1BorderBlue[]; extern u64 gTextureP2BorderRed[]; extern u64 gTextureP3BorderOrange[]; @@ -1228,9 +1227,9 @@ extern u64 gTexturePeachFace15[]; extern u64 gTexturePeachFace16[]; extern u64 gTexturePinkBar[]; extern u64 gTexturePlaceN64ControllerPakIntoController1[]; -extern u64 gTexturePlayerSelect[]; +extern u64 texture_player_select[]; extern u64 gTexturePleaseReinsertOriginalN64ControllerPak[]; -extern u64 gTexturePushStartButton[]; +extern u64 push_start_button[]; extern u64 gTextureRecordNotErased[]; extern u64 gTextureSelectRecord[]; extern u64 gTextureSmallFont0[]; @@ -1243,7 +1242,7 @@ extern u64 gTextureSmallFont6[]; extern u64 gTextureSmallFont7[]; extern u64 gTextureSmallFont8[]; extern u64 gTextureSmallFont9[]; -extern u64 gTextureSmallGreenTriangle[]; +extern u64 texture_small_green_triangle[]; extern u64 gTextureTableOfContents[]; extern u64 gTextureTextEnd[]; extern u64 gTextureTextErase[]; diff --git a/src/update_objects.c b/src/update_objects.c index 687d01e7d6..5a6f4b5228 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -12,9 +12,9 @@ #include "math_util_2.h" #include "render_objects.h" #include "objects.h" -#include "waypoints.h" +#include "path.h" #include "code_800029B0.h" -#include "code_80005FD0.h" +#include "cpu_vehicles_camera_path.h" #include "code_80057C60.h" #include "code_8006E9C0.h" #include "code_80086E70.h" @@ -26,7 +26,7 @@ #include "collision.h" #include "effects.h" #include "code_80091440.h" -#include "code_80091750.h" +#include "menu_items.h" #include "podium_ceremony_actors.h" #include "courses/all_course_data.h" #include @@ -161,26 +161,18 @@ s32 add_unused_obj_index(s32* listIdx, s32* nextFree, s32 size) { } count = 0; id = &listIdx[*nextFree]; - /** - * @todo This HAS to be a for-loop of some variety, but I can't make a for-loop to match. - * If you replace this with ```for(var_v1 = 0; var_v1 < size; var_v1++)``` - * The diff gets massive. - */ - if (size > 0) { - loop_3: + + for (count = 0; count < size; count++) { if (*id == NULL_OBJECT_ID) { objectIndex = find_unused_obj_index(id); *nextFree += 1; + break; } else { *nextFree += 1; if (*nextFree >= size) { *nextFree = 0; } - count += 1; id = &listIdx[*nextFree]; - if (count != size) { // check if don't check all element of the list - goto loop_3; - } } } if (count == size) { @@ -205,8 +197,8 @@ void func_80072120(s32* arg0, s32 arg1) { void func_80072180(void) { if (gModeSelection == TIME_TRIALS) { if (((gPlayerOne->type & PLAYER_EXISTS) != 0) && - ((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_KART_AI)) == 0)) { - D_80162DF8 = 1; + ((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_CPU)) == 0)) { + gPostTimeTrialReplayCannotSave = 1; } } } @@ -2673,7 +2665,7 @@ void func_80078288(s32 objectIndex) { break; case 1: if (gGamestate != 9) { - sp3A = ((gPlayerOneCopy->unk_094 / 18) * 216) / 2; + sp3A = ((gPlayerOneCopy->speed / 18) * 216) / 2; sp3E = (random_int(0x000FU) - sp3A) + 0x2D; sp3C = random_int(0x012CU) + 0x1E; temp_t6 = camera1->rot[1] + ((s32) (random_int(0x3000U) - 0x1800) / (s16) ((sp3A / 15) + 1)); @@ -2831,7 +2823,7 @@ void update_stars(s32 arg0, Camera* camera, StarData* starList) { UNUSED void func_80078C68() { } -void func_80078C70(s32 arg0) { +void course_update_clouds(s32 arg0) { s32 sp1C; Camera* camera; @@ -2868,6 +2860,7 @@ void func_80078C70(s32 arg0) { D_8018D210 = (-(D_8018D200 / 2) * 0xB6) - 0x71C; D_8018D1E8 = 1.7578125 / D_8018D200; D_8018D218 = 0xA0; +#if !ENABLE_CUSTOM_COURSE_ENGINE switch (gCurrentCourseId) { /* switch 2 */ case COURSE_MARIO_RACEWAY: /* switch 2 */ // Uses Luigi Raceway's clouds for display purposes? @@ -2908,6 +2901,9 @@ void func_80078C70(s32 arg0) { break; } } +#else + +#endif } void func_80078F64(void) { @@ -2953,7 +2949,7 @@ void func_80079114(s32 objectIndex, s32 arg1, s32 arg2) { if (gObjectList[objectIndex].state >= 2) { if ((u8) gObjectList[objectIndex].unk_0D8 == 1) { if (arg1 == 0) { - func_80074894(objectIndex, D_8018C028); + func_80074894(objectIndex, gLakituTexturePtr); return; } a = gIndexLakituList[0]; @@ -2964,13 +2960,13 @@ void func_80079114(s32 objectIndex, s32 arg1, s32 arg2) { } switch (arg2) { case 0: - func_800748F4(objectIndex, D_8018C028); + func_800748F4(objectIndex, gLakituTexturePtr); break; case 1: - func_800748C4(objectIndex, D_8018C028); + func_800748C4(objectIndex, gLakituTexturePtr); break; case 2: - func_80074894(objectIndex, D_8018C028); + func_80074894(objectIndex, gLakituTexturePtr); break; } } @@ -2982,14 +2978,14 @@ void func_800791F0(s32 objectIndex, s32 playerId) { if ((gObjectList[objectIndex].unk_0D8 != 3) && (gObjectList[objectIndex].unk_0D8 != 7)) { func_800722CC(objectIndex, 1); if (gCurrentCourseId == COURSE_SHERBET_LAND) { - player->unk_0CA &= 0xFFEF; + player->lakituProps &= ~FRIGID_EFFECT; } } else { // ????? } if (gCurrentCourseId == COURSE_SHERBET_LAND) { func_800722CC(objectIndex, 0x00000010); - player->unk_0CA &= 0xFFDF; + player->lakituProps &= ~THAWING_EFFECT; } func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); } @@ -3094,7 +3090,7 @@ void init_obj_lakitu_red_flag(s32 objectIndex, s32 playerIndex) { init_texture_object(objectIndex, (u8*) common_tlut_lakitu_checkered_flag, gTextureLakituCheckeredFlag01, 0x48U, (u16) 0x00000038); object = &gObjectList[objectIndex]; - object->activeTexture = D_8018C028; + object->activeTexture = gLakituTexturePtr; object->vertex = common_vtx_also_lakitu; object->pos[2] = 5000.0f; object->pos[1] = 5000.0f; @@ -3131,9 +3127,9 @@ void func_800797AC(s32 playerId) { objectIndex = gIndexLakituList[playerId]; player = &gPlayerOne[playerId]; - if ((gCurrentCourseId == COURSE_SHERBET_LAND) && (player->unk_0CA & 1)) { + if ((gCurrentCourseId == COURSE_SHERBET_LAND) && (player->lakituProps & LAKITU_RETRIEVAL)) { init_object(objectIndex, 7); - player->unk_0CA |= 0x10; + player->lakituProps |= FRIGID_EFFECT; } else { init_object(objectIndex, 3); } @@ -3148,16 +3144,17 @@ void func_80079860(s32 playerId) { player = &gPlayerOne[playerId]; if ((func_80072354(objectIndex, 1) != 0) && (((func_802ABDF4(player->collision.meshIndexZX) != 0) && (player->collision.surfaceDistance[2] <= 3.0f)) || - (player->unk_0CA & 1) || ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)))) { + (player->lakituProps & LAKITU_RETRIEVAL) || + ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & MIDAIR_EFFECT)))) { func_80090778(player); func_800797AC(playerId); } } void func_8007993C(s32 objectIndex, Player* player) { - if (player->unk_0CA & 4) { + if (player->lakituProps & LAKITU_FIZZLE) { func_800722A4(objectIndex, 2); - gObjectList[objectIndex].primAlpha = player->unk_0C6; + gObjectList[objectIndex].primAlpha = player->alpha; return; } func_800722CC(objectIndex, 2); @@ -3232,7 +3229,7 @@ void update_object_lakitu_fishing(s32 objectIndex, s32 playerId) { func_80073654(objectIndex); break; case 3: - if (!(player->unk_0CA & 2)) { + if (!(player->lakituProps & HELD_BY_LAKITU)) { func_80086EAC(objectIndex, 0, 3); func_80073654(objectIndex); } @@ -3267,7 +3264,7 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { case 2: /* switch 1 */ set_object_flag_status_true(objectIndex, 0x00000010); func_800736E0(objectIndex); - player->unk_0CA |= 0x80; + player->lakituProps |= FROZEN_EFFECT; object_next_state(objectIndex); break; case 3: /* switch 1 */ @@ -3287,11 +3284,11 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { func_80073654(objectIndex); break; case 3: - if ((player->surfaceType == ICE) && !(player->unk_0CA & 1) && + if ((player->surfaceType == ICE) && !(player->lakituProps & LAKITU_RETRIEVAL) && ((f64) player->collision.surfaceDistance[2] <= 30.0)) { func_800722A4(objectIndex, 8); } - if (!(player->unk_0CA & 2)) { + if (!(player->lakituProps & HELD_BY_LAKITU)) { func_80086EAC(objectIndex, 0, 3); func_80073654(objectIndex); } @@ -3300,7 +3297,7 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { func_8007375C(objectIndex, 0x0000001E); break; case 5: - player->unk_0CA &= 0xFF7F; + player->lakituProps &= ~FROZEN_EFFECT; func_800722A4(objectIndex, 0x00000010); func_800722A4(objectIndex, 0x00000020); func_800722CC(objectIndex, 4); @@ -3311,8 +3308,8 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { case 6: if (func_8007375C(objectIndex, 0x000000A0) != 0) { func_800722CC(objectIndex, 0x00000010); - player->unk_0CA &= 0xFFEF; - player->unk_0CA |= 0x20; + player->lakituProps &= ~FRIGID_EFFECT; + player->lakituProps |= THAWING_EFFECT; } break; case 7: @@ -3321,7 +3318,7 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { case 8: func_80073720(objectIndex); func_80072428(objectIndex); - player->unk_0CA &= 0xFFDF; + player->lakituProps &= ~THAWING_EFFECT; func_800722CC(objectIndex, 1); func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); break; @@ -3340,7 +3337,7 @@ void func_8007A060(s32 objectIndex, s32 playerIndex) { init_texture_object(objectIndex, (u8*) common_tlut_lakitu_second_lap, gTextureLakituSecondLap01, 0x48U, (u16) 0x00000038); object = &gObjectList[objectIndex]; - object->activeTexture = D_8018C028; + object->activeTexture = gLakituTexturePtr; object->vertex = common_vtx_also_lakitu; object->pos[2] = 5000.0f; object->pos[1] = 5000.0f; @@ -3389,7 +3386,7 @@ void func_8007A228(s32 objectIndex, s32 playerIndex) { init_texture_object(objectIndex, (u8*) common_tlut_lakitu_final_lap, gTextureLakituFinalLap01, 0x48U, (u16) 0x00000038); object = &gObjectList[objectIndex]; - object->activeTexture = D_8018C028; + object->activeTexture = gLakituTexturePtr; object->vertex = common_vtx_also_lakitu; object->pos[2] = 5000.0f; object->pos[1] = 5000.0f; @@ -3436,7 +3433,7 @@ void func_8007A3F0(s32 objectIndex, s32 arg1) { func_800791F0(objectIndex, arg1); init_texture_object(objectIndex, (u8*) common_tlut_lakitu_reverse, gTextureLakituReverse01, 0x48U, (u16) 0x00000038); - gObjectList[objectIndex].activeTexture = D_8018C028; + gObjectList[objectIndex].activeTexture = gLakituTexturePtr; gObjectList[objectIndex].vertex = common_vtx_also_lakitu; gObjectList[objectIndex].pos[2] = var; gObjectList[objectIndex].pos[1] = var; @@ -3472,7 +3469,7 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) { } switch (gObjectList[objectIndex].unk_0D6) { /* switch 1; irregular */ case 1: /* switch 1 */ - if ((gObjectList[objectIndex].state >= 3) && (!(sp2C->effects & 0x400000))) { + if ((gObjectList[objectIndex].state >= 3) && (!(sp2C->effects & REVERSE_EFFECT))) { func_80086F10(objectIndex, 6, &D_800E69F4); gObjectList[objectIndex].unk_0D6 = 2; gObjectList[objectIndex].unk_04C = 0x00000050; @@ -3532,7 +3529,7 @@ void func_8007A88C(s32 playerId) { objectIndex = gIndexLakituList[playerId]; player = &gPlayerOne[playerId]; - if ((gObjectList[objectIndex].state == 0) && (player->effects & 0x400000)) { + if ((gObjectList[objectIndex].state == 0) && (player->effects & REVERSE_EFFECT)) { func_800790E4(playerId); } } @@ -3584,7 +3581,7 @@ void func_8007AA44(s32 playerId) { func_8007A910(playerId); objectIndex = gIndexLakituList[playerId]; - D_8018C028 = D_80183FA8[playerId]; + gLakituTexturePtr = D_80183FA8[playerId]; switch (gObjectList[objectIndex].unk_0D8) { case 1: func_80079114(objectIndex, playerId, 2); @@ -3694,7 +3691,7 @@ u8 gen_random_item(s16 rank, s16 isCpu) { if (isCpu == 0) { curve = segmented_to_virtual((void*) common_grand_prix_human_item_curve); } else { - curve = segmented_to_virtual((void*) common_grand_prix_kart_ai_item_curve); + curve = segmented_to_virtual((void*) common_grand_prix_cpu_item_curve); } randomItem = *((rank * 100) + curve + sRandomItemIndex); } @@ -3706,7 +3703,7 @@ u8 gen_random_item_human(UNUSED s16 arg0, s16 rank) { return gen_random_item(rank, false); } -u8 kart_ai_gen_random_item(UNUSED s32 arg0, s16 rank) { +u8 cpu_gen_random_item(UNUSED s32 arg0, s16 rank) { return gen_random_item(rank, true); } @@ -4046,8 +4043,8 @@ void func_8007BD04(s32 playerId) { objectIndex = indexObjectList2[0]; if (gObjectList[objectIndex].state == 0) { - if (((s32) gNearestWaypointByPlayerId[playerId] >= 0xA0) && - ((s32) gNearestWaypointByPlayerId[playerId] < 0xAB)) { + if (((s32) gNearestPathPointByPlayerId[playerId] >= 0xA0) && + ((s32) gNearestPathPointByPlayerId[playerId] < 0xAB)) { set_obj_origin_pos(objectIndex, xOrientation * -1650.0, -200.0f, -1650.0f); init_object(objectIndex, 1); } @@ -4314,7 +4311,7 @@ void func_8007C684(s32 objectIndex) { } } -void func_8007C7B4(s32 someIndex, s32 arg1) { +void func_8007C7B4(s32 someIndex, s32 playerIndex) { s32 temp_a0; s32 objectIndex; s16 temp_s1_2; @@ -4325,7 +4322,7 @@ void func_8007C7B4(s32 someIndex, s32 arg1) { for (temp_a0 = 0; temp_a0 < 5; temp_a0++) { objectIndex = indexObjectList3[someIndex + temp_a0]; init_object(objectIndex, 1); - gObjectList[objectIndex].unk_0D1 = arg1; + gObjectList[objectIndex].unk_0D1 = playerIndex; temp_s1_2 = random_int(0x003CU) - 0x1E; temp_s4 = random_int(0x0014U) - 0xA; temp_s5 = random_int(0x0050U) - 0x28; @@ -4336,7 +4333,7 @@ void func_8007C7B4(s32 someIndex, s32 arg1) { gObjectList[objectIndex].origin_pos[1] = (f32) temp_s4; gObjectList[objectIndex].origin_pos[2] = (f32) temp_s5; } - func_800C9060(arg1, 0x1900705AU); + func_800C9060(playerIndex, 0x1900705AU); if (someIndex == 0) { D_8018CFF0 = 1; @@ -4394,14 +4391,14 @@ void func_8007CA70(void) { if (D_8018CFF0 == 0) { playerId = func_8007C9F8(); D_8018D018 = playerId; - test = &gNearestWaypointByPlayerId[playerId]; + test = &gNearestPathPointByPlayerId[playerId]; if ((*test >= 0xC9) && (*test < 0xD2)) { func_8007C7B4(0, (s32) playerId); } } if (D_8018CFF0 != 0) { playerId = D_8018D018; - test = &gNearestWaypointByPlayerId[playerId]; + test = &gNearestPathPointByPlayerId[playerId]; if ((*test >= 0xB5) && (*test < 0xBE)) { func_8007C91C(0); } @@ -4412,14 +4409,14 @@ void func_8007CA70(void) { if (D_8018D048 == 0) { playerId = func_8007C9F8(); D_8018D110 = playerId; - test = &gNearestWaypointByPlayerId[playerId]; + test = &gNearestPathPointByPlayerId[playerId]; if ((*test >= 0x1FF) && (*test < 0x208)) { func_8007C7B4(5, (s32) playerId); } } if (D_8018D048 != 0) { playerId = D_8018D110; - test = &gNearestWaypointByPlayerId[playerId]; + test = &gNearestPathPointByPlayerId[playerId]; if ((*test >= 0x1EB) && (*test < 0x1F4)) { func_8007C91C(5); } @@ -5486,11 +5483,11 @@ s32 func_8007F75C(s32 playerId) { s32 objectIndex; s32 temp_s7; s32 var_s6; - s32 waypoint; + s32 pathPoint; - waypoint = gNearestWaypointByPlayerId[playerId]; + pathPoint = gNearestPathPointByPlayerId[playerId]; var_s6 = 0; - if ((waypoint >= 0xAA) && (waypoint < 0xB5)) { + if ((pathPoint >= 0xAA) && (pathPoint < 0xB5)) { temp_s7 = random_int(0x0032U) + 0x32; for (someIndex = 0; someIndex < gNumActiveThwomps; someIndex++) { objectIndex = indexObjectList1[someIndex]; @@ -5499,7 +5496,7 @@ s32 func_8007F75C(s32 playerId) { func_8007F660(objectIndex, playerId, temp_s7); } } - } else if ((waypoint >= 0xD7) && (waypoint < 0xE2)) { + } else if ((pathPoint >= 0xD7) && (pathPoint < 0xE2)) { for (someIndex = 0; someIndex < gNumActiveThwomps; someIndex++) { objectIndex = indexObjectList1[someIndex]; if (gObjectList[objectIndex].unk_0D5 == 3) { @@ -5534,7 +5531,7 @@ void func_8007F8D8(void) { } if (var_s4 != 0) { for (var_s0 = 0; var_s0 < 4; var_s0++, player++) { - if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) { + if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_CPU)) { if (func_8007F75C(var_s0) != 0) { break; } @@ -5587,7 +5584,7 @@ void func_8007FB48(s32 objectIndex) { func_80086FD4(objectIndex); break; case 2: - gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25; + gObjectList[objectIndex].velocity[0] = player->speed * xOrientation * 1.25; if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) { if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) { if (D_8018D400 & 1) { @@ -5977,15 +5974,15 @@ void func_80080B28(s32 objectIndex, s32 playerId) { temp_s0 = &gPlayerOne[playerId]; if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { - if (!(temp_s0->soundEffects & 0x100)) { + if (!(temp_s0->triggers & THWOMP_SQUISH_TRIGGER)) { temp_f0 = func_80088F54(objectIndex, temp_s0); - if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) && + if ((temp_f0 <= 9.0) && !(temp_s0->effects & SQUISH_EFFECT) && (has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) { - if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { - if (!(temp_s0->effects & 0x200)) { + if ((temp_s0->type & PLAYER_EXISTS) && !(temp_s0->type & PLAYER_INVISIBLE_OR_BOMB)) { + if (!(temp_s0->effects & STAR_EFFECT)) { func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C)); } else if (func_80072354(objectIndex, 0x00000040) != 0) { - if (temp_s0->type & 0x1000) { + if (temp_s0->type & PLAYER_CPU) { func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } else { func_800C9060((u8) playerId, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); @@ -5999,16 +5996,16 @@ void func_80080B28(s32 objectIndex, s32 playerId) { } } } else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) && - (is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->unk_094 * 0.5) + 7.0) != + (is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->speed * 0.5) + 7.0) != 0)) { - if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { + if ((temp_s0->type & PLAYER_EXISTS) && !(temp_s0->type & PLAYER_INVISIBLE_OR_BOMB)) { if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } func_800722A4(objectIndex, 2); temp_s0->unk_040 = (s16) objectIndex; - temp_s0->unk_046 |= 2; - temp_s0->soundEffects |= 0x100; + temp_s0->unk_046 |= CRITTER_TOUCH; + temp_s0->triggers |= THWOMP_SQUISH_TRIGGER; func_80088FF0(temp_s0); } } @@ -6025,37 +6022,29 @@ void func_80080DE4(s32 arg0) { player = gPlayerOne; for (var_v1 = 0; var_v1 < NUM_PLAYERS; var_v1++, player++) { if (arg0 == player->unk_040) { - player->soundEffects &= ~0x100; + player->triggers &= ~THWOMP_SQUISH_TRIGGER; player->unk_040 = -1; } } } -#ifdef NON_MATCHING -// https://decomp.me/scratch/YMJDJ -// No idea what the problem is void func_80080E8C(s32 objectIndex1, s32 objectIndex2, s32 arg2) { u16 anAngle; - f32 thing0; f32 thing1; - f32* temp_v1; + f32 thing0; init_object(objectIndex1, arg2); - temp_v1 = D_800E594C[arg2]; gObjectList[objectIndex1].unk_0D5 = 2; anAngle = gObjectList[objectIndex2].direction_angle[1]; - thing1 = func_800416D8(temp_v1[1], temp_v1[0], anAngle); - thing0 = func_80041724(temp_v1[1], temp_v1[0], anAngle); + thing1 = func_800416D8(D_800E594C[arg2 * 2 + 1], D_800E594C[arg2 * 2 + 0], anAngle); + thing0 = func_80041724(D_800E594C[arg2 * 2 + 1], D_800E594C[arg2 * 2 + 0], anAngle); gObjectList[objectIndex1].origin_pos[0] = gObjectList[objectIndex2].pos[0] + thing0; gObjectList[objectIndex1].origin_pos[1] = gObjectList[objectIndex2].surfaceHeight - 9.0; gObjectList[objectIndex1].origin_pos[2] = gObjectList[objectIndex2].pos[2] + thing1; - anAngle = D_800E597C[arg2] + gObjectList[objectIndex2].direction_angle[1]; + anAngle = gObjectList[objectIndex2].direction_angle[1] + D_800E597C[arg2]; gObjectList[objectIndex1].velocity[0] = sins(anAngle) * 0.6; gObjectList[objectIndex1].velocity[2] = coss(anAngle) * 0.6; } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_80080E8C.s") -#endif void func_80080FEC(s32 arg0) { s32 objectIndex; @@ -6155,7 +6144,7 @@ void func_80081210(void) { player = gPlayerOne; for (var_s4 = 0; var_s4 < NUM_PLAYERS; var_s4++, player++) { player->tyres[FRONT_LEFT].unk_14 &= ~3; - player->unk_046 &= ~0x0006; + player->unk_046 &= ~(CRITTER_TOUCH_GATE | CRITTER_TOUCH); for (var_s2_3 = 0; var_s2_3 < gNumActiveThwomps; var_s2_3++) { objectIndex = indexObjectList1[var_s2_3]; if (!(player->effects & BOO_EFFECT)) { @@ -6382,30 +6371,30 @@ void func_80081AFC(s32 objectIndex, s32 arg1) { void func_80081D34(s32 objectIndex) { Player* player; Camera* var_s4; - s32 var_s2; + s32 playerIndex; s32 var_s5; Object* object; var_s5 = 0; player = gPlayerOne; var_s4 = camera1; - for (var_s2 = 0; var_s2 < D_8018D158; var_s2++, player++, var_s4++) { - if ((is_obj_flag_status_active(objectIndex, 0x00000200) != 0) && !(player->effects & 0x80000000) && + for (playerIndex = 0; playerIndex < D_8018D158; playerIndex++, player++, var_s4++) { + if ((is_obj_flag_status_active(objectIndex, 0x00000200) != 0) && !(player->effects & BOO_EFFECT) && (has_collided_with_player(objectIndex, player) != 0)) { - if ((player->type & 0x8000) && !(player->type & 0x100)) { + if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) { var_s5 = 1; object = &gObjectList[objectIndex]; if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } - if (player->effects & 0x200) { - func_800C9060(var_s2, 0x1900A046U); + if (player->effects & STAR_EFFECT) { + func_800C9060(playerIndex, 0x1900A046U); } else { - player->soundEffects |= 2; + player->triggers |= HIGH_TUMBLE_TRIGGER; } object->direction_angle[1] = var_s4->rot[1]; - object->velocity[1] = (player->unk_094 / 2) + 3.0; - object->unk_034 = player->unk_094 + 1.0; + object->velocity[1] = (player->speed / 2) + 3.0; + object->unk_034 = player->speed + 1.0; if (object->velocity[1] >= 5.0) { object->velocity[1] = 5.0f; } @@ -6592,7 +6581,7 @@ void func_8008275C(s32 objectIndex) { gObjectList[objectIndex].offset[2] *= 2.0; object_calculate_new_pos_offset(objectIndex); gObjectList[objectIndex].direction_angle[1] = - get_angle_between_two_vectors(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); + get_xz_angle_between_points(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); break; } func_800873F4(objectIndex); @@ -6748,24 +6737,16 @@ void update_crabs(void) { } } -#ifdef NON_MATCHING -// https://decomp.me/scratch/PYAg4 -// Stack issue caused by the `test` variable, but removing it causes much, much larger differences void func_80082F1C(s32 objectIndex, s32 arg1) { - YVFlagPoleSpawn* test; gObjectList[objectIndex].model = (Gfx*) d_course_yoshi_valley_unk5; gObjectList[objectIndex].vertex = (Vtx*) d_course_yoshi_valley_unk4; gObjectList[objectIndex].sizeScaling = 0.027f; - if (test->rot && test->rot) {} - test = &D_800E5DF4[arg1]; object_next_state(objectIndex); - set_obj_origin_pos(objectIndex, test->pos[0] * xOrientation, test->pos[1], test->pos[2]); + set_obj_origin_pos(objectIndex, D_800E5DF4[arg1 * 4 + 0] * xOrientation, D_800E5DF4[arg1 * 4 + 1], + D_800E5DF4[arg1 * 4 + 2]); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); - set_obj_direction_angle(objectIndex, 0U, test->rot, 0U); + set_obj_direction_angle(objectIndex, 0U, D_800E5DF4[arg1 * 4 + 3], 0U); } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_80082F1C.s") -#endif void func_80083018(s32 objectIndex, s32 arg1) { switch (gObjectList[objectIndex].state) { @@ -7652,7 +7633,7 @@ void update_hot_air_balloon(void) { } void func_80085878(s32 objectIndex, s32 arg1) { - TrackWaypoint* temp_v0; + TrackPathPoint* temp_v0; Object* object; object = &gObjectList[objectIndex]; @@ -7664,7 +7645,7 @@ void func_80085878(s32 objectIndex, s32 arg1) { set_object_flag_status_true(objectIndex, 0x04000200); object->unk_084[8] = (arg1 * 0x12C) + 0x1F4; set_obj_origin_pos(objectIndex, 0.0f, -15.0f, 0.0f); - temp_v0 = &D_80164490[(u16) object->unk_084[8]]; + temp_v0 = &gCurrentTrackPath[(u16) object->unk_084[8]]; set_obj_origin_offset(objectIndex, temp_v0->posX, temp_v0->posY, temp_v0->posZ); set_obj_direction_angle(objectIndex, 0U, 0U, 0U); object->unk_034 = 4.0f; @@ -7704,7 +7685,7 @@ void update_chain_chomps(void) { func_800859C8(objectIndex, var_s4); vec3f_copy(object->unk_01C, object->offset); func_8000D940(object->offset, &object->unk_084[8], object->unk_034, object->surfaceHeight, 0); - object->direction_angle[1] = get_angle_between_two_vectors(object->unk_01C, object->offset); + object->direction_angle[1] = get_xz_angle_between_points(object->unk_01C, object->offset); object_calculate_new_pos_offset(objectIndex); func_80089CBC(objectIndex, 30.0f); } @@ -7826,22 +7807,13 @@ void func_80085F74(s32 objectIndex) { } } -#ifdef NON_MATCHING -/** - * arg1 is pushed onto the stack prior to set_obj_origin_pos, which is correct. - * But then it get popped back into v0 when its supposed to be popped into t0. - * I really, really don't get why that's happening and the permuter hasn't found anything - **/ - void func_80086074(s32 objectIndex, s32 arg1) { - set_obj_origin_pos(objectIndex, D_800E6734[arg1][0] * xOrientation, D_800E6734[arg1][1], D_800E6734[arg1][2]); - init_texture_object(objectIndex, d_course_rainbow_road_static_tluts[arg1], - d_course_rainbow_road_static_textures[arg1], 64, 64); + set_obj_origin_pos(objectIndex, D_800E6734[arg1 * 3 + 0] * xOrientation, D_800E6734[arg1 * 3 + 1], + D_800E6734[arg1 * 3 + 2]); + init_texture_object(objectIndex, &d_course_rainbow_road_static_tluts[arg1 * 256], + &d_course_rainbow_road_static_textures[arg1], 64, 64); func_80085BB4(objectIndex); } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_80086074.s") -#endif void func_80086110(s32 objectIndex, s32 arg1) { switch (gObjectList[objectIndex].state) { diff --git a/src/update_objects.h b/src/update_objects.h index 2984b04348..e9381a8b7c 100644 --- a/src/update_objects.h +++ b/src/update_objects.h @@ -181,7 +181,7 @@ void func_800788F8(s32, u16, Camera*); void update_clouds(s32, Camera*, CloudData*); void update_stars(s32, Camera*, StarData*); void func_80078C68(void); -void func_80078C70(s32); +void course_update_clouds(s32); void func_80078F64(void); void func_80079054(s32); void func_80079084(s32); @@ -204,7 +204,7 @@ void func_8007ABFC(s32, bool); void consume_item(s32); u8 gen_random_item(s16, s16); u8 gen_random_item_human(s16, s16); -u8 kart_ai_gen_random_item(s32, s16); +u8 cpu_gen_random_item(s32, s16); s16 func_8007AFB0(s32, s32); s32 func_8007B040(s32, s32); void func_8007B254(s32, s32); @@ -385,7 +385,7 @@ extern u16* gHudLapTextures[]; extern u16* gPortraitTLUTs[]; extern u8* gPortraitTextures[]; -extern s32 D_80162DF8; +extern s32 gPostTimeTrialReplayCannotSave; extern s16 D_8016347C; extern s32 D_80165594; extern s32 D_80165598; diff --git a/tools/Makefile b/tools/Makefile index 9dad1694c5..9fb926c3b0 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -16,7 +16,7 @@ n64graphics_SOURCES := n64graphics.c utils.c n64graphics_CFLAGS := -DN64GRAPHICS_STANDALONE displaylist_packer_SOURCES := displaylist_packer.c -displaylist_packer_CFLAGS := -Wno-unused-result +displaylist_packer_CFLAGS := -Wno-unused-result -I ../include -DF3DEX_GBI=1 -D_LANGUAGE_C=1 mio0_SOURCES := libmio0.c mio0_CFLAGS := -DMIO0_STANDALONE diff --git a/tools/displaylist_packer.c b/tools/displaylist_packer.c index 4ed20083c9..104f72f795 100644 --- a/tools/displaylist_packer.c +++ b/tools/displaylist_packer.c @@ -3,9 +3,60 @@ #include #include +#include "../include/PR/gbi.h" + +/* Fallbacks for symbols that may be hidden behind ucode/asm guards in gbi.h */ + #define MAX_STRING_LENGTH 256 #define MAX_STRING_OUTPUT 10000 +/* Named constants to replace magic comparisons */ +/* gSPSetOtherModeL presets (low 16 bits), rewritten using gbi.h flags */ +/* 0x2078 = AA_EN | Z_CMP | Z_UPD | IM_RD | ALPHA_CVG_SEL */ +/* Explicit name for readability: Anti-Aliasing + Z Compare/Update + Image Read + Alpha Coverage Select */ +#define OML_AA_ZCMP_ZUPD_IMRD_ALPHA_CVG_SEL (AA_EN | Z_CMP | Z_UPD | IM_RD | ALPHA_CVG_SEL) +/* 0x3078 = AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_X_ALPHA | ALPHA_CVG_SEL */ +/* Explicit name: same as above, with Coverage x Alpha enabled */ +#define OML_AA_ZCMP_ZUPD_IMRD_CVG_X_ALPHA_ALPHA_CVG_SEL (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_X_ALPHA | ALPHA_CVG_SEL) + +/* gSPTexture parameters (low 16 bits) */ +#define TEX_PARAM_ON 0x0001 +#define TEX_PARAM_OFF 0xFFFF + +/* gDPSetCombine presets (low 16 bits). + * Nommage en fonction des macros GBI G_CC_* utilisées côté runtime (memory.c): + * - 0xFFFF → G_CC_MODULATERGBA + * - 0xF3F9 → G_CC_MODULATERGBDECALA + * - 0x793C → G_CC_SHADE + * - 0xFFFD → G_CC_DECALRGBA + */ +#define COMB_CC_MODULATERGBA 0xFFFF +#define COMB_CC_MODULATERGBDECALA 0xF3F9 +#define COMB_CC_SHADE 0x793C +#define COMB_CC_DECALRGBA 0xFFFD +/* Variante « ALT » vue dans certains exports (reste une heuristique) */ +#define COMB_PRESET_ALT1 0xF9FC +/* (aliases retirés pour éviter la confusion et favoriser les noms G_CC_ explicites) */ + +/* gDPSetTextureImage quirks (kept for context; not used after gbi refactor) */ +/* #define SETTIMG_P4_EXPECT 0x70 */ +/* #define LOADBLOCK_CMD_OR 0x300000000ULL */ + +/* Segmented base addresses (common segment bases used in MK64) */ +#define SEG_BASE_4 0x04000000ULL +#define SEG_BASE_5 0x05000000ULL + +/* G_LOADBLOCK variants are detected by decoding tile/lrs/dxt */ + +/* Tile/size configurations are detected by decoding SETTILE/SETTILESIZE */ + +/* + * Non standard/special input opcode observed (0xD0): + * Note: There is no official PR/gbi.h opcode for 0xD0. Keep this as a + * project-specific remap for rare/unknown commands encountered in inputs. + */ +#define G_OP_D0 0xD0 + // Compile using gcc -o tools/displaylist_packer tools/displaylist_packer.c // Run using ./displaylist_packer input.bin output.bin @@ -55,6 +106,80 @@ uint32_t compressB1(uint8_t a, uint8_t b, uint8_t c) { #define ARG2WORD(val) ((val) >> 32) #define OPCODE(val) (uint8_t)((val) >> 56) +enum packed_op { + /* Set combine presets (renommés en fonction des macros G_CC_*) */ + PG_SETCOMBINE_CC_MODULATERGBA = 0x15, /* ex-PG_SETCOMBINE_PRESET_FFFF */ + PG_SETCOMBINE_CC_MODULATERGBDECALA = 0x16, /* ex-PG_SETCOMBINE_PRESET_F3F9 */ + PG_SETCOMBINE_CC_SHADE = 0x17, /* ex-PG_SETCOMBINE_PRESET_793C */ + + /* Render modes via gSPSetOtherModeL shortcuts (parité memory.c) */ + PG_RMODE_OPA = 0x18, /* ex-PG_SETOTHERMODE_L_2078 */ + PG_RMODE_TEXEDGE = 0x19, /* ex-PG_SETOTHERMODE_L_3078 */ + + /* Tile/tile size configurations following RDPTILESYNC+SETTILE+SETTILESIZE */ + PG_TILECFG_A = 0x1A, /* 0xF51010000007C07C */ + PG_TILECFG_B = 0x1B, /* 0xF5102000000FC07C */ + PG_TILECFG_C = 0x1C, /* 0xF51010000007C0FC */ + PG_TILECFG_D = 0x1D, /* 0xF57010000007C07C */ + PG_TILECFG_E = 0x1E, /* 0xF5702000000FC07C */ + PG_TILECFG_F = 0x1F, /* 0xF57010000007C0FC */ + + /* Texture loadblock variants after gDPSetTextureImage */ + PG_TIMG_LOADBLOCK_0 = 0x20, /* 0xF3000000073FF100 */ + PG_TIMG_LOADBLOCK_1 = 0x21, /* 0xF3000000077FF080 */ + PG_TIMG_LOADBLOCK_2 = 0x22, /* 0xF3000000077FF100 */ + PG_TIMG_LOADBLOCK_3 = 0x23, /* 0xF3000003073FF100 */ + PG_TIMG_LOADBLOCK_4 = 0x24, /* 0xF3000003077FF080 */ + PG_TIMG_LOADBLOCK_5 = 0x25, /* 0xF3000003077FF100 */ + + /* gSPTexture on/off */ + PG_TEXTURE_OFF = 0x26, + PG_TEXTURE_ON = 0x27, + + /* VTX compact op (bank/count encoded) */ + PG_VTX1 = 0x28, + + /* Display list ops */ + PG_TRI1 = 0x29, + PG_ENDDL = 0x2A, + PG_DL = 0x2B, + PG_TILECFG_G = 0x2C, /* 0xF51011000007C07C */ + PG_CULLDL = 0x2D, + + /* Alternate combine preset used in memory.c */ + PG_SETCOMBINE_ALT = 0x2E, + + /* XLU render mode (not currently emitted) */ + PG_RMODE_XLU = 0x2F, + + /* Project-specific primitive (spline), not currently emitted here */ + PG_SPLINE3D = 0x30, + + /* Vertex packet base (computed as base + bank index) */ + PG_VTX_BASE = 0x32, + + /* Extra combine preset used by memory.c */ + PG_SETCOMBINE_CC_DECALRGBA = 0x53, /* ex-PG_SETCOMBINE_DECALRGBA */ + + /* Render mode decal variants (not currently emitted) */ + PG_RMODE_OPA_DECAL = 0x54, + PG_RMODE_XLU_DECAL = 0x55, + + /* Geometry mode */ + PG_SETGEOMETRYMODE = 0x56, + PG_CLEARGEOMETRYMODE = 0x57, + + /* Triangle pair */ + PG_TRI2 = 0x58, + + /* Special remap */ + PG_D0_REMAP = 0xDD, + + /* Fallback/terminators */ + PG_UNKNOWN = 0xEE, + PG_EOF = 0xFF, +}; + void pack(FILE *input_file, FILE *output_file) { // Initialize the string to an empty string @@ -62,11 +187,8 @@ void pack(FILE *input_file, FILE *output_file) { uint8_t p1; uint8_t p2; uint8_t p3; - uint8_t p4; - uint32_t p5; - uint32_t p6; + /* temporary vars */ uint16_t p7; - uint64_t compare; // Read every u32 in the input file and concatenate a string based on the value @@ -77,21 +199,39 @@ void pack(FILE *input_file, FILE *output_file) { // Warning: Static variable size may result in overflow if input file is too large. // Solution: Increase array size. uint8_t data[50000]; + int debug = getenv("DLPACKER_DEBUG") != NULL; + int lb_bias = 0; /* 0 for RGBA (A/B/C/G), 3 for IA (D/E/F) */ while (fread(&cmd, sizeof(uint64_t), 1, input_file) == 1) { cmd = swap_endian(cmd); opCode = OPCODE(cmd); //printf("%X \n", opCode); switch (opCode) { - case 0xB9: + case (uint8_t)G_SETOTHERMODE_L: p7 = (uint16_t) cmd; - if (p7 == 0x2078) { - data[count++] = 0x18; - } else if (p7 == 0x3078) { - data[count++] = 0x19; + if (p7 == OML_AA_ZCMP_ZUPD_IMRD_ALPHA_CVG_SEL) { + data[count++] = PG_RMODE_OPA; + if (debug) fprintf(stderr, "@%u PG_RMODE_OPA\n", count-1); + } else if (p7 == OML_AA_ZCMP_ZUPD_IMRD_CVG_X_ALPHA_ALPHA_CVG_SEL) { + data[count++] = PG_RMODE_TEXEDGE; + if (debug) fprintf(stderr, "@%u PG_RMODE_TEXEDGE\n", count-1); + } else if ((p7 & ZMODE_XLU) == ZMODE_XLU) { + /* Any render mode with ZMODE_XLU set maps to translucent; refine as DECAL if ALPHA_CVG_SEL is set */ + if ((p7 & ALPHA_CVG_SEL) == ALPHA_CVG_SEL) { + data[count++] = PG_RMODE_XLU_DECAL; + if (debug) fprintf(stderr, "@%u PG_RMODE_XLU_DECAL (ZMODE_XLU|ALPHA_CVG_SEL)\n", count-1); + } else { + data[count++] = PG_RMODE_XLU; + if (debug) fprintf(stderr, "@%u PG_RMODE_XLU (ZMODE_XLU)\n", count-1); + } + } else if ((p7 & ALPHA_CVG_SEL) == ALPHA_CVG_SEL) { + /* Opaque decal variant (no ZMODE_XLU, but with ALPHA_CVG_SEL) */ + data[count++] = PG_RMODE_OPA_DECAL; + if (debug) fprintf(stderr, "@%u PG_RMODE_OPA_DECAL (ALPHA_CVG_SEL)\n", count-1); } break; - case 0xBF: - data[count++] = 0x29; + case (uint8_t)G_TRI1: + data[count++] = PG_TRI1; + if (debug) fprintf(stderr, "@%u PG_TRI1\n", count-1); p1 = (uint8_t) (cmd >> 16) / 2; p2 = (uint8_t) (cmd >> 8) / 2; p3 = (uint8_t) (cmd) / 2; @@ -99,140 +239,291 @@ void pack(FILE *input_file, FILE *output_file) { *(uint16_t*) (data + count) = (uint16_t) (p1 | (p2 << 5) | (p3 << 10)); count++; count++; break; - case 0x06: - data[count++] = 0x2B; + case G_DL: + data[count++] = PG_DL; + if (debug) fprintf(stderr, "@%u PG_DL\n", count-1); *(uint16_t*) (data + count) = (uint16_t)(((uint32_t)cmd) / 8); count++; count++; break; - case 0xB1: - data[count++] = 0x58; + case (uint8_t)G_QUAD: { + /* Pack MK64 quad into compact SPLINE3D triplet, mirroring unpack_spline_3D expectations */ + data[count++] = PG_SPLINE3D; + if (debug) fprintf(stderr, "@%u PG_SPLINE3D\n", count-1); + uint32_t w1 = (uint32_t)cmd; + uint8_t a0 = (uint8_t)(w1 >> 24) / 2; + uint8_t t0 = (uint8_t)(w1 >> 16) / 2; + uint8_t a3 = (uint8_t)(w1 >> 8) / 2; + uint8_t a2 = (uint8_t)(w1) / 2; + /* Build three packed bytes (non-mirror path in memory.c): + * P0: [a3 bits2:0]<<5 | (t0 & 0x1F) + * P1: [a0 bit0]<<7 | (a2 & 0x1F)<<2 | [a3 bits4:3] + * P2: (a0 >> 1) & 0x0F + */ + uint8_t P0 = ((a3 & 0x7) << 5) | (t0 & 0x1F); + uint8_t P1 = ((a0 & 0x1) << 7) | ((a2 & 0x1F) << 2) | ((a3 >> 3) & 0x3); + uint8_t P2 = (a0 >> 1) & 0x0F; + data[count++] = P0; + data[count++] = P1; + data[count++] = P2; + if (debug) fprintf(stderr, " quad a0=%u t0=%u a3=%u a2=%u -> P0=%02X P1=%02X P2=%02X\n", a0, t0, a3, a2, P0, P1, P2); + break; + } + case (uint8_t)G_TRI2: + data[count++] = PG_TRI2; + if (debug) fprintf(stderr, "@%u PG_TRI2\n", count-1); *(uint16_t*) (data + count) = compressB1(ARG1(cmd), ARG2(cmd), cmd >> 32); count++; count++; *(uint16_t*) (data + count) = compressB1(cmd >> 16, cmd >> 8, cmd); count++; count++; break; - case 0x04: + case G_VTX: // Skip the opcode and read bytes 2/3 from the u64 (Byte 1 is the opcode 0x04). - data[count++] = (uint8_t)(((((uint16_t)ARG1WORD(cmd)) + 1) / 0x410) + 0x32); + data[count++] = (uint8_t)(((((uint16_t)ARG1WORD(cmd)) + 1) / 0x410) + PG_VTX_BASE); + if (debug) fprintf(stderr, "@%u PG_VTX_%u\n", count-1, data[count-1]-PG_VTX_BASE); // Read the right side of the u64 (as a u32). - *(uint16_t*) (data + count) = (uint16_t)(((uint32_t)cmd - 0x04000000) / 16); + *(uint16_t*) (data + count) = (uint16_t)(((uint32_t)cmd - (uint32_t)SEG_BASE_4) / 16); count++; count++; break; - case 0xFD: - p1 = (uint32_t)(cmd - 0x05000000) >> 11; - p2 = 0x00; - p3 = 0x70; - - p4 = (uint8_t)ARG1(cmd); + case G_SETTIMG: { + /* Texture image parameters (usually segment 0x05) */ + p1 = (uint32_t)(cmd - SEG_BASE_5) >> 11; /* address >> 11, compacted */ + p2 = 0x00; /* reserved in the existing packed format */ + p3 = 0x70; /* expected format/siz on the packed side */ - - fseek(input_file, 24, SEEK_CUR); - fread(&cmd, sizeof(uint64_t), 1, input_file); - cmd = swap_endian(cmd); - - if (p4 == 0x70) { - cmd |= 0x300000000; - + /* Look ahead for the corresponding G_LOADBLOCK, consuming SETTILE/LOADSYNC */ + { + uint64_t next; + int found = 0; + for (int i = 0; i < 12; i++) { + if (fread(&next, sizeof(uint64_t), 1, input_file) != 1) { + printf("Error: Unexpected EOF scanning after G_SETTIMG\n"); + break; + } + next = swap_endian(next); + uint8_t nop = OPCODE(next); + if (nop == (uint8_t)G_LOADBLOCK) { + cmd = next; + found = 1; + break; + } + if (nop == (uint8_t)G_SETTILE || nop == (uint8_t)G_RDPLOADSYNC || nop == (uint8_t)G_RDPPIPESYNC) { + continue; /* consumed, keep scanning */ + } + /* Unexpected: keep scanning a few opcodes anyway */ + } + if (!found) { + printf("Error: Did not find G_LOADBLOCK after G_SETTIMG\n"); + /* Emit a default value and exit this case */ + data[count++] = PG_TIMG_LOADBLOCK_0; + data[count++] = p1; + data[count++] = p2; + data[count++] = p3; + break; + } } - if (cmd == 0xF3000000073FF100) { - data[count++] = 0x20; - } else if (cmd == 0xF3000000077FF080) { - data[count++] = 0x21; - } else if (cmd == 0xF3000000077FF100) { - data[count++] = 0x22; - } else if (cmd == 0xF3000003073FF100) { - data[count++] = 0x23; - } else if (cmd == 0xF3000003077FF080) { - data[count++] = 0x24; - } else if (cmd == 0xF3000003077FF100) { - data[count++] = 0x25; - } else { - printf("Error: %s\n", "Unknown FD"); + /* Classify by (lrs,dxt) then apply a bias from the last TILECFG (RGBA=+0, IA=+3) */ + { + uint32_t lb_w0 = (uint32_t)(cmd >> 32); + uint32_t lb_w1 = (uint32_t)(cmd); + uint16_t uls = (lb_w0 >> 12) & 0xFFF; + uint16_t ult = (lb_w0 >> 0) & 0xFFF; + uint8_t tile = (lb_w1 >> 24) & 0x7; + uint16_t lrs = (lb_w1 >> 12) & 0xFFF; + uint16_t dxt = (lb_w1 >> 0) & 0xFFF; + int base = -1; + if (tile == G_TX_LOADTILE && uls == 0 && (ult == 0 || ult == 3)) { + if (lrs == 0x3FF && dxt == 0x0100) base = 0; + else if (lrs == 0x7FF && dxt == 0x0080) base = 1; + else if (lrs == 0x7FF && dxt == 0x0100) base = 2; + } + if (base < 0) { + printf("Error: Unrecognized/Unexpected G_LOADBLOCK (tile=%u uls=%u ult=%u lrs=%03X dxt=%03X)\n", tile, uls, ult, lrs, dxt); + base = 0; + } + uint8_t variant = (uint8_t)(PG_TIMG_LOADBLOCK_0 + base + lb_bias); + data[count++] = variant; + if (debug) fprintf(stderr, "@%u PG_TIMG_LOADBLOCK_%d (base=%d,bias=%d) cmd=%016llX\n", count-1, (int)(variant-PG_TIMG_LOADBLOCK_0), base, lb_bias, (unsigned long long)cmd); } + data[count++] = p1; data[count++] = p2; data[count++] = p3; break; - case 0xE8: - - // Read 0xF5 - fread(&cmd, sizeof(uint64_t), 1, input_file); + } + case G_RDPTILESYNC: { + /* Read G_SETTILE (0xF5) */ + if (fread(&cmd, sizeof(uint64_t), 1, input_file) != 1) { + printf("Error: Unexpected EOF after G_RDPTILESYNC (SETTILE)\n"); + break; + } cmd = swap_endian(cmd); - p5 = ARG1WORD(cmd); + if ((uint8_t)OPCODE(cmd) != (uint8_t)G_SETTILE) { + printf("Error: Expected G_SETTILE after G_RDPTILESYNC, got 0x%02X\n", OPCODE(cmd)); + break; + } - p1 = (((cmd >> 14) & 0xF) << 4) | ((cmd >> 18) & 0xF); - p2 = (((cmd >> 4) & 0xF) << 4) | ((cmd >> 8) & 0xF); + uint32_t st_w0 = (uint32_t)(cmd >> 32); + uint32_t st_w1 = (uint32_t)cmd; + uint8_t fmt = (st_w0 >> 21) & 0x7; + uint8_t siz = (st_w0 >> 19) & 0x3; + uint16_t line = (st_w0 >> 9) & 0x1FF; + uint16_t tmem = (st_w0 >> 0) & 0x1FF; + uint8_t tile = (st_w1 >> 24) & 0x7; + uint8_t pal = (st_w1 >> 20) & 0xF; + uint8_t cmt = (st_w1 >> 18) & 0x3; + uint8_t maskt = (st_w1 >> 14) & 0xF; + uint8_t shiftt= (st_w1 >> 10) & 0xF; + uint8_t cms = (st_w1 >> 8) & 0x3; + uint8_t masks = (st_w1 >> 4) & 0xF; + uint8_t shifts= (st_w1 >> 0) & 0xF; - // Read 0xF2 - fread(&cmd, sizeof(uint64_t), 1, input_file); - cmd = swap_endian(cmd); - p6 = (uint32_t)cmd; - - compare = ((uint64_t) p5 << 32 ) | p6; - - switch (compare) { - case 0xF51011000007C07C: - data[count++] = 0x2C; - break; - case 0xF51010000007C07C: - data[count++] = 0x1A; - break; - case 0xF5102000000FC07C: - data[count++] = 0x1B; - break; - case 0xF51010000007C0FC: - data[count++] = 0x1C; - break; - case 0xF57010000007C07C: - data[count++] = 0x1D; - break; - case 0xF5702000000FC07C: - data[count++] = 0x1E; + /* p1/p2 stay as before (re-encodes 2 nibbles of clamp/mirror flags) */ + p1 = (((cmd >> 14) & 0xF) << 4) | ((cmd >> 18) & 0xF); /* shiftt|cmt */ + p2 = (((cmd >> 4) & 0xF) << 4) | ((cmd >> 8) & 0xF); /* masks|cms */ + + /* Read G_SETTILESIZE (0xF2), skipping syncs if present */ + { + int found = 0; + for (int i = 0; i < 6; i++) { + if (fread(&cmd, sizeof(uint64_t), 1, input_file) != 1) { + printf("Error: Unexpected EOF after G_SETTILE (SETTILESIZE)\n"); + break; + } + cmd = swap_endian(cmd); + uint8_t op2 = OPCODE(cmd); + if (op2 == (uint8_t)G_SETTILESIZE) { found = 1; break; } + if (op2 == (uint8_t)G_RDPLOADSYNC || op2 == (uint8_t)G_RDPPIPESYNC) { + continue; + } + /* something else: stop */ break; - case 0xF57010000007C0FC: - data[count++] = 0x1F; + } + if (!found) { + printf("Error: Expected G_SETTILESIZE after G_SETTILE, got 0x%02X\n", OPCODE(cmd)); break; + } } - data[count++] = p2; + uint32_t ss_w0 = (uint32_t)(cmd >> 32); + uint32_t ss_w1 = (uint32_t)cmd; + uint16_t uls = (ss_w0 >> 12) & 0xFFF; + uint16_t ult = (ss_w0 >> 0) & 0xFFF; + /* ss_tile not used in the current packed format */ + uint16_t lrs = (ss_w1 >> 12) & 0xFFF; + uint16_t lrt = (ss_w1 >> 0) & 0xFFF; + /* Classification A..G based on (fmt,siz) and (lrs,lrt), without constraining cmt/cms/masks/line/etc. */ + if (fmt == G_IM_FMT_RGBA && lrs == 0x07C && lrt == 0x07C) { + /* G-variant: legacy hint only (w0 byte[1] == 0x11). Do not rely on p1/p2 mask/shift patterns. */ + uint8_t w0_b1 = (uint8_t)((st_w0 >> 8) & 0xFF); + if (debug) fprintf(stderr, "#TILE RGBA7C7C st_w0=%08X ss_w1=%08X p2=%02X p1=%02X w0_b1=%02X\n", st_w0, ss_w1, p2, p1, w0_b1); + if (w0_b1 == 0x11) { + data[count++] = PG_TILECFG_G; /* legacy G variant */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_G p2=%02X p1=%02X\n", count-1, p2, p1); + } else { + data[count++] = PG_TILECFG_A; /* default RGBA16 tile */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_A p2=%02X p1=%02X\n", count-1, p2, p1); + } + lb_bias = 0; + } else if (fmt == G_IM_FMT_RGBA && lrs == 0x0FC && lrt == 0x07C) { + data[count++] = PG_TILECFG_B; /* F5102000000FC07C */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_B p2=%02X p1=%02X\n", count-1, p2, p1); + lb_bias = 0; + } else if (fmt == G_IM_FMT_RGBA && lrs == 0x07C && lrt == 0x0FC) { + data[count++] = PG_TILECFG_C; /* F51010000007C0FC */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_C p2=%02X p1=%02X\n", count-1, p2, p1); + lb_bias = 0; + } else if (fmt == G_IM_FMT_IA && lrs == 0x07C && lrt == 0x07C) { + data[count++] = PG_TILECFG_D; /* F57010000007C07C */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_D p2=%02X p1=%02X\n", count-1, p2, p1); + lb_bias = 3; + } else if (fmt == G_IM_FMT_IA && lrs == 0x0FC && lrt == 0x07C) { + data[count++] = PG_TILECFG_E; /* F5702000000FC07C */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_E p2=%02X p1=%02X\n", count-1, p2, p1); + lb_bias = 3; + } else if (fmt == G_IM_FMT_IA && lrs == 0x07C && lrt == 0x0FC) { + data[count++] = PG_TILECFG_F; /* F57010000007C0FC */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_F p2=%02X p1=%02X\n", count-1, p2, p1); + lb_bias = 3; + } else { + /* Unrecognized: choose A by default (rare) and trace in debug */ + if (debug) fprintf(stderr, "@%u PG_TILECFG_A (default) fmt=%u siz=%u line=%u tmem=%u tile=%u pal=%u cmt=%u cms=%u uls=%03X ult=%03X lrs=%03X lrt=%03X maskt=%u masks=%u shiftt=%u shifts=%u\n", + count, fmt, siz, line, tmem, tile, pal, cmt, cms, uls, ult, lrs, lrt, maskt, masks, shiftt, shifts); + data[count++] = PG_TILECFG_A; lb_bias = 0; + } + + /* Keep p2/p1 as historically encoded */ + data[count++] = p2; data[count++] = p1; break; - case 0xBB: - if ((uint16_t)cmd == 0x0001) { - data[count++] = 0x27; - } else if ((uint16_t)cmd == 0xFFFF) { - data[count++] = 0x26; - } else { - printf("Error: %s\n", "Unknown BB"); + } + case (uint8_t)G_TEXTURE: { + /* Parity with the legacy packer: primary test on t (low16 of w1) */ + uint16_t t = (uint16_t)cmd; + if (t == 0x0001) { + data[count++] = PG_TEXTURE_ON; + if (debug) fprintf(stderr, "@%u PG_TEXTURE_ON (t==0001)\n", count-1); + break; } + if (t == 0xFFFF) { + data[count++] = PG_TEXTURE_OFF; + if (debug) fprintf(stderr, "@%u PG_TEXTURE_OFF (t==FFFF)\n", count-1); + break; + } + /* Fallback: decode the 'on' flag via gbi.h for robustness */ + uint32_t w0 = (uint32_t)(cmd >> 32); + uint8_t on8 = (uint8_t)(w0 & 0xFF); + uint8_t on7 = (uint8_t)((w0 >> 1) & 0x7F); + data[count++] = ((on8 != 0) || (on7 != 0)) ? PG_TEXTURE_ON : PG_TEXTURE_OFF; + if (debug) fprintf(stderr, "@%u PG_TEXTURE_%s (decoded) on8=%u on7=%u\n", count-1, (((on8!=0)||(on7!=0))?"ON":"OFF"), on8, on7); + break; + } + case (uint8_t)G_ENDDL: + data[count++] = PG_ENDDL; + if (debug) fprintf(stderr, "@%u PG_ENDDL\n", count-1); + break; + case (uint8_t)G_RDPLOADSYNC: /* 0xE6 */ + case (uint8_t)G_RDPPIPESYNC: /* 0xE7 */ + /* ignored in the packed stream */ break; - case 0xB8: - data[count++] = 0x2A; + case (uint8_t)G_LOADBLOCK: /* Fallback: if encountered outside SETTIMG flow, ignore */ break; - case 0xBE: - data[count++] = 0x2D; + case (uint8_t)G_CULLDL: + data[count++] = PG_CULLDL; + if (debug) fprintf(stderr, "@%u PG_CULLDL\n", count-1); break; - case 0xD0: - data[count++] = 0xDD; + case G_OP_D0: + data[count++] = PG_D0_REMAP; + if (debug) fprintf(stderr, "@%u PG_D0_REMAP\n", count-1); break; - case 0xFC: + case G_SETCOMBINE: p7 = (uint16_t)cmd; - if (p7 == 0xF3F9) { - data[count++] = 0x16; - } else if (p7 == 0xFFFF) { - data[count++] = 0x15; - } else if (p7 == 0x793C) { - data[count++] = 0x17; + if (p7 == COMB_CC_MODULATERGBDECALA) { + data[count++] = PG_SETCOMBINE_CC_MODULATERGBDECALA; /* was: PRESET_F3F9 */ + if (debug) fprintf(stderr, "@%u PG_SETCOMBINE_PRESET_F3F9\n", count-1); + } else if (p7 == COMB_CC_MODULATERGBA) { + data[count++] = PG_SETCOMBINE_CC_MODULATERGBA; /* was: PRESET_FFFF */ + if (debug) fprintf(stderr, "@%u PG_SETCOMBINE_PRESET_FFFF\n", count-1); + } else if (p7 == COMB_CC_SHADE) { + data[count++] = PG_SETCOMBINE_CC_SHADE; /* was: PRESET_793C */ + if (debug) fprintf(stderr, "@%u PG_SETCOMBINE_PRESET_793C\n", count-1); + } else if (p7 == COMB_CC_DECALRGBA) { + data[count++] = PG_SETCOMBINE_CC_DECALRGBA; + if (debug) fprintf(stderr, "@%u PG_SETCOMBINE_DECALRGBA\n", count-1); + } else if (p7 == COMB_PRESET_ALT1) { + data[count++] = PG_SETCOMBINE_ALT; + if (debug) fprintf(stderr, "@%u PG_SETCOMBINE_ALT\n", count-1); } //data[count++] = 0x53; break; - case 0xB7: - data[count++] = 0x56; + case (uint8_t)G_SETGEOMETRYMODE: + data[count++] = PG_SETGEOMETRYMODE; + if (debug) fprintf(stderr, "@%u PG_SETGEOMETRYMODE\n", count-1); break; - case 0xB6: - data[count++] = 0x57; + case (uint8_t)G_CLEARGEOMETRYMODE: + data[count++] = PG_CLEARGEOMETRYMODE; + if (debug) fprintf(stderr, "@%u PG_CLEARGEOMETRYMODE\n", count-1); break; //case 0xFF: // data[count++] = 0xFF; @@ -241,14 +532,14 @@ void pack(FILE *input_file, FILE *output_file) { default: printf("Error: Unknown Opcode: 0x%X\n", opCode); printf("Opcode written to file as 0xEE\n"); - data[count++] = 0xEE; + data[count++] = PG_UNKNOWN; break; } offset += 4; } //eos: ; - data[count++] = 0xFF; + data[count++] = PG_EOF; size_t num_elements_written = fwrite(data, sizeof(uint8_t), count, output_file); if (num_elements_written != count) { printf("Failed to write data to file.\n"); diff --git a/tools/format.py b/tools/format.py index 9afd16ac25..f873d1c8c2 100644 --- a/tools/format.py +++ b/tools/format.py @@ -193,7 +193,7 @@ def main(): else: files = [] for folder in default_list_folder: - files += glob.glob(f"{folder}*/**/*.c", recursive=True) + glob.glob(f"{folder}*/**/*.h", recursive=True) + files += glob.glob(f"{folder}*/**/*.c", recursive=True) + glob.glob(f"{folder}*/**/*.cpp", recursive=True) + glob.glob(f"{folder}*/**/*.h", recursive=True) files = [x for x in files if "assets" not in x] extra_files = glob.glob("assets/**/*.xml", recursive=True) diff --git a/tools/torch b/tools/torch index 4d8ac381c0..5773373b36 160000 --- a/tools/torch +++ b/tools/torch @@ -1 +1 @@ -Subproject commit 4d8ac381c08fd30cc6a4f247576c7dbfe09dc708 +Subproject commit 5773373b3620e4a6bc6c92fdc4690d66741c086d diff --git a/tools/yaml/mk64.eu1.yaml b/tools/yaml/mk64.eu1.yaml deleted file mode 100644 index cccee61b29..0000000000 --- a/tools/yaml/mk64.eu1.yaml +++ /dev/null @@ -1,250 +0,0 @@ -name: Mario Kart 64 EU 1.0 -sha1: a729039453210b84f17019dda3f248d5888f7690 -options: - basename: mk64.eu - target_path: baserom.eu.z64 - base_path: . - compiler: IDO - platform: n64 - target_path: baserom.eu.z64 - build_path: build/eu - find_file_boundaries: True - header_encoding: ASCII - ld_script_path: mk64.eu.ld - asset_path: assets/eu - # platform: n64 - # undefined_funcs_auto: True - # undefined_funcs_auto_path: undefined_funcs_auto.txt - # undefined_syms_auto: True - # undefined_syms_auto_path: undefined_syms_auto.txt - # symbol_addrs_path: symbol_addrs.txt - asm_path: asm/eu - # src_path: src - extensions_path: tools/splat_ext - mips_abi_float_regs: o32 - section_order: [".text", ".data", ".rodata", ".bss"] - # auto_all_sections: [".data", ".rodata", ".bss"] -segments: - - name: header - type: header - start: 0x0 - - name: boot - type: code - start: 0x40 - vram: 0xA4000040 - subsegments: - - [0x40, asm, boot] - - [0xB70, i1, rspboot_font1, 13, 14] - - [0xB87, i1, rspboot_font2, 13, 14] - - [0xB9E, bin, rspboot_font] - - name: main - type: code - bss_size: 0x18985C - start: 0x1000 - vram: 0x80000400 - subsegments: - - [0x1000, asm, entry] - - [0x1050, c, main] - - [0x3590, c, code_80002990] - - [0x4130, c, profiler] - - [0x4CA0, c, crash_screen] - - [0x5320, c, animation] - - [0x5AD0, c, staff_ghosts] - - [0x6B90, asm, unused_overflow_check] - - [0x6BB0, c, code_80005FD0] - - [0x1D0B0, c, camera] - - [0x20560, c, render_player] - - [0x27C20, c, kart_dma] - - [0x288E0, c, code_80027D00] - - [0x39FA0, c, spawn_players] - - [0x3E820, c, code_8003DC40] - - [0x40C10, asm, unused_mio0_decode] - - [0x40CB0, asm, mio0_decode] - - [0x411B0, asm, tkmk00_decode] - - [0x418E0, c, gbiMacro] - - [0x41A30, c, math_util_2] - - [0x43D90, c, code_800431B0] - - [0x58840, c, code_80057C60] - - [0x6F5A0, c, code_8006E9C0] - - [0x72AE0, c, update_objects] - - [0x87A50, c, code_80086E70] - - [0x8CDB0, c, effects] - - [0x920A0, c, code_800914A0] - - [0x92350, c, code_80091750] - - [0xB05B0, c, code_800AF9B0] - - [0xB0F50, c, menus] - - [0xB51E0, c, save] - - [0xB77F0, c, audio/synthesis] - - [0xB99E0, c, audio/heap] - - [0xBB680, c, audio/load] - - [0xBD170, c, audio/playback] - - [0xBEA30, c, audio/effects] - - [0xBF4D0, c, audio/seqplayer] - - [0xC2000, c, audio/external] - - [0xCBFC0, c, audio/port_eu] - - [0xCCC00, c, ../lib/src/osCreateThread] - - [0xCCD90, c, ../lib/src/osInitialize] - - [0xCD030, c, ../lib/src/osStartThread] - - [0xCD180, c, ../lib/src/osCreateViManager] - - [0xCD4E0, c, ../lib/src/osViSetMode] - - [0xCD550, c, ../lib/src/osViBlack] - - [0xCD5C0, c, ../lib/src/osViSetSpecialFeatures] - - [0xCD780, c, ../lib/src/osCreatePiManager] - - [0xCD910, c, ../lib/src/osSetThreadPri] - - [0xCD9F0, c, ../lib/src/osCreateMesgQueue] - - [0xCDA20, c, ../lib/src/osViSetEvent] - - [0xCDA90, c, ../lib/src/osSetEventMesg] - - [0xCDB00, c, ../lib/src/osSpTaskLoadGo] - - [0xCDDC0, c, ../lib/src/osContInit] - - [0xCE180, c, ../lib/src/osContStartReadData] - - [0xCE3E0, c, ../lib/src/osRecvMesg] - - [0xCE520, asm, ../lib/asm/osWritebackDCacheAll] - - [0xCE550, c, ../lib/src/osSendMesg] - - [0xCE6A0, c, ../lib/src/osViSwapBuffer] - - [0xCE6F0, asm, ../lib/asm/bzero] - - [0xCE790, asm, ../lib/asm/osInvalICache] - - [0xCE810, asm, ../lib/asm/osInvalDCache] - - [0xCE8C0, c, ../lib/src/osPiStartDma] - - [0xCE9D0, c, ../lib/src/osSpTaskYield] - - [0xCE9F0, c, ../lib/src/osSpTaskYielded] - - [0xCEA70, c, ../lib/src/osGetTime] - - [0xCEB00, c, ../lib/src/math/llmuldiv] - - [0xCEDC0, c, ../lib/src/__osGetCurrFaultedThread] - - [0xCEDD0, asm, ../lib/asm/sqrtf] - - [0xCEDE0, c, ../lib/src/guOrthoF] - - [0xCEFA0, c, ../lib/src/osSetTime] - - [0xCEFD0, c, ../lib/src/osEepromProbe] - - [0xCF040, c, ../lib/src/osPfsIsPlug] - - [0xCF3B0, c, ../lib/src/osPfsInit] - - [0xCF570, c, ../lib/src/osPfsNumFiles] - - [0xCF6C0, c, ../lib/src/osPfsFileState] - - [0xCF9B0, c, ../lib/src/osPfsFreeBlocks] - - [0xCFB00, c, ../lib/src/guRotateF] - - [0xCFCF0, c, ../lib/src/guScaleF] - - [0xCFD90, c, ../lib/src/guPerspectiveF] - - [0xD0020, c, ../lib/src/guLookAtF] - - [0xD0350, c, ../lib/src/guTranslateF] - - [0xD03F0, c, ../lib/src/osSyncPrintf] - - [0xD0450, c, ../lib/src/guMtxCatL] - - [0xD0510, c, ../lib/src/osPfsSearchFile] - - [0xD06D0, c, ../lib/src/osPfsDeleteFile] - - [0xD0CE0, c, ../lib/src/osEepromLongWrite] - - [0xD0E20, c, ../lib/src/osEepromLongRead] - - [0xD0F60, c, ../lib/src/osPfsReadWriteFile] - - [0xD1460, c, ../lib/src/osPfsAllocateFile] - - [0xD1B48, c, ../lib/src/osAiSetFrequency] - - [0xD1D70, c, ../lib/src/osAiGetLength] - - [0xD1D80, c, ../lib/src/osAiSetNextBuffer] - - [0xD1E30, c, ../lib/src/osGetCount] - - [0xD1E40, asm, ../lib/asm/__osException] - - [0xD2740, asm, ../lib/asm/__osDisableInt] - - [0xD2760, asm, ../lib/asm/__osRestoreInt] - - [0xD2780, c, ../lib/src/__osDequeueThread] - - [0xD27C0, asm, ../lib/asm/__osSetSR] - - [0xD27D0, asm, ../lib/asm/__osGetSR] - - [0xD27E0, asm, ../lib/asm/__osSetFpcCsr] - - [0xD27F0, c, ../lib/src/__osSiRawReadIo] - - [0xD2840, c, ../lib/src/__osSiRawWriteIo] - - [0xD2890, asm, ../lib/asm/osWritebackDCache] - - [0xD2910, asm, ../lib/asm/osMapTLBRdb] - - [0xD2970, c, ../lib/src/osPiRawReadIo] - - [0xD29D0, c, ../lib/src/__osSetHWIntrRoutine] - - [0xD2A20, c, ../lib/src/__osLeoInterrupt] - - [0xD32A0, c, ../lib/src/osTimer] - - [0xD36A0, c, ../lib/src/osGetThreadPri] - - [0xD36C0, c, ../lib/src/__osViInit] - - [0xD3810, c, ../lib/src/__osViGetCurrentContext] - - [0xD3820, c, ../lib/src/__osViSwapContext] - - [0xD3B80, c, ../lib/src/__osPiCreateAccessQueue] - - [0xD3C40, c, ../lib/src/osPiRawStartDma] - - [0xD3D20, c, ../lib/src/osEPiRawStartDma] - - [0xD3E00, c, ../lib/src/__osDevMgrMain] - - [0xD41B0, c, ../lib/src/bcopy] - - [0xD44C0, c, ../lib/src/osVirtualToPhysical] - - [0xD4540, c, ../lib/src/__osSpSetStatus] - - [0xD4550, c, ../lib/src/__osSpSetPc] - - [0xD4590, c, ../lib/src/__osSpRawStartDma] - - [0xD4620, c, ../lib/src/__osSpDeviceBusy] - - [0xD4650, c, ../lib/src/osSetTimer] - - [0xD4730, c, ../lib/src/__osSiRawStartDma] - - [0xD47E0, c, ../lib/src/__osSiCreateAccessQueue] - - [0xD48A0, c, ../lib/src/osJamMesg] - - [0xD49F0, c, ../lib/src/osPiGetCmdQueue] - - [0xD4A20, c, ../lib/src/__osSpGetStatus] - - [0xD4A30, c, ../lib/src/guMtxF2L] - - [0xD4CA0, c, ../lib/src/osEepromWrite] - - [0xD5180, c, ../lib/src/contpfs] - - [0xD5EE0, c, ../lib/src/osPfsChecker] - - [0xD6940, c, ../lib/src/contramread] - - [0xD6CF0, c, ../lib/src/guNormalize] - - [0xD6D80, c, ../lib/src/math/sinf] - - [0xD6F40, c, ../lib/src/math/cosf] - - [0xD70B0, c, ../lib/src/_Printf] - - [0xD7D70, c, ../lib/src/guMtxCatF] - - [0xD7F80, c, ../lib/src/contramwrite] - - [0xD8330, c, ../lib/src/osEepromRead] - - [0xD8630, c, ../lib/src/__osAiDeviceBusy] - - [0xD8660, asm, ../lib/asm/osSetIntMask] - - [0xD8700, c, ../lib/src/osDestroyThread] - - [0xD8800, c, ../lib/src/__osSiDeviceBusy] - - [0xD8830, c, ../lib/src/osLeoDiskInit] - - [0xD8920, asm, ../lib/asm/__osSetCompare] - - [0xD8930, c, ../lib/src/__osResetGlobalIntMask] - - [0xD8990, c, ../lib/src/__osEPiRawWriteIo] - - [0xD89E0, c, ../lib/src/osYieldThread] - - [0xD8A30, asm, ../lib/asm/__osProbeTLB] - - [0xD8AF0, c, ../lib/src/crc] - - [0xD8C70, c, ../lib/src/string] - - [0xD8D10, c, ../lib/src/_Litob] - - [0xD8FB0, c, ../lib/src/_Ldtob] - - [0xD9A70, c, ../lib/src/ldiv] - - [0xD9C00, bin, lib/PR/boot/F3D_boot] - - [0xD9CD0, bin, lib/PR/f3dex/F3DEX] - - [0xDB0B0, bin, lib/PR/f3dlx/F3DLX] - - [0xDD0D0, data, data_main] - - [0xDD304, i1, crash_screen_font, 8, 136] - - [0xDD38C, bin, unkDD38C] - - [0xEC358, rodata, rodata_main] - - [0xF7650, bss, bss_main] - - name: seg2 - type: code - bss_size: 0xFD180 # 0x3F460 - start: 0xF7650 - vram: 0x8028DF00 - subsegments: - - [0xF7650, c, race_logic] - - [0xFA370, c, render_courses] - - [0x100148, c, actors] - - [0x10CE80, c, skybox_and_splitscreen] - - [0x111360, c, memory] - - [0x119A00, c, actors_extended] - - [0x11E750, c, math_util] - - [0x121F80, data, data_seg2] - - [0x1229D0, rodata, rodata_seg2] - - [0x123840, bss, bss_seg2] - - name: credits - type: code - bss_size: 0x1A0 - start: 0x123840 # end: 0x12B360 - vram: 0x80280000 - subsegments: - - [0x123840, c, code_80280000] - - [0x123E90, c, code_80280650] - - [0x124E50, c, camera_junk] - - [0x124FC0, c, code_80281780] - - [0x125480, c, code_80281C40] - - [0x1257E0, c, code_80281FA0] - - [0x128680, data, data_credits] - - [0x12ACC4, rodata, rodata_credits] - - [0x12ACE0, bss, bss_credits] - #- name: unkData - # type: bin - # start: 0x1313E0 - # vram: 0xDD000000 - - #- name: models - # type: mio0 - # start: 0x821F10 - # vram: 0x0C000000 - - - [0xC00000] # end of rom diff --git a/tools/yaml/mk64.us.yaml b/tools/yaml/mk64.us.yaml deleted file mode 100644 index 2628225ca4..0000000000 --- a/tools/yaml/mk64.us.yaml +++ /dev/null @@ -1,255 +0,0 @@ -name: Mario Kart 64 US -sha1: 579c48e211ae952530ffc8738709f078d5dd215e -options: - basename: mk64 - target_path: baserom.us.z64 - base_path: . - compiler: IDO - platform: n64 - target_path: baserom.us.z64 - build_path: build/us - find_file_boundaries: True - header_encoding: ASCII - ld_script_path: mk64.us.ld - asset_path: assets/us - # platform: n64 - # undefined_funcs_auto: True - # undefined_funcs_auto_path: undefined_funcs_auto.txt - # undefined_syms_auto: True - # undefined_syms_auto_path: undefined_syms_auto.txt - # symbol_addrs_path: symbol_addrs.txt - asm_path: asm/us - # src_path: src - # extensions_path: tools/splat_ext - mips_abi_float_regs: o32 - section_order: [".text", ".data", ".rodata", ".bss"] - # auto_all_sections: [".data", ".rodata", ".bss"] -segments: - - name: header - type: header - start: 0x0 - - - name: boot - type: code - start: 0x40 - vram: 0xA4000040 - subsegments: - - [0x0040, asm, boot] - - [0x0B70, bin, rspboot_font] - - name: main - type: code - bss_size: 0x18985C - start: 0x1000 - vram: 0x80000400 - subsegments: - - [0x1000, asm, entry] - - [0x1050, c, main] - - [0x35B0, c, code_800029B0] - - [0x4150, c, profiler] - - [0x4CC0, c, crash_screen] - - [0x5340, c, animation] - - [0x5AF0, c, staff_ghosts] - - [0x6BB0, asm, unused_overflow_check] - - [0x6BD0, c, code_80005FD0] - - [0x1D0D0, c, camera] - - [0x20580, c, render_player] - - [0x27C40, c, kart_dma] - - [0x28900, c, code_80027D00] - - [0x39FC0, c, spawn_players] - - [0x3E840, c, code_8003DC40] - - [0x40C30, asm, unused_mio0_decode] - - [0x40CD0, asm, mio0_decode] - - [0x411D0, asm, tkmk00_decode] - - [0x41900, c, gbiMacro] - - [0x41A50, c, math_util_2] - - [0x43DB0, c, code_800431B0] - - [0x58860, c, code_80057C60] - - [0x6F5C0, c, code_8006E9C0] - - [0x72B00, c, update_objects] - - [0x87A70, c, code_80086E70] - - [0x8CDD0, c, effects] - - [0x920C0, c, code_800914A0] - - [0x92350, c, code_80091750] - - [0xB05B0, c, code_800AF9B0] - - [0xB0F50, c, menus] - - [0xB51E0, c, save] - - [0xB77F0, c, audio/synthesis] - - [0xB99E0, c, audio/heap] - - [0xBB680, c, audio/load] - - [0xBD170, c, audio/playback] - - [0xBEA50, c, audio/effects] - - [0xBF4F0, c, audio/seqplayer] - - [0xC1FF0, c, audio/external] - - [0xCBF30, c, audio/port_eu] - - [0xCCB70, c, ../lib/src/osCreateThread] - - [0xCCCC0, c, ../lib/src/osInitialize] - - [0xCCF60, c, ../lib/src/osStartThread] - - [0xCD0B0, c, ../lib/src/osCreateViManager] - - [0xCD450, c, ../lib/src/osViSetMode] - - [0xCD4C0, c, ../lib/src/osViBlack] - - [0xCD530, c, ../lib/src/osViSetSpecialFeatures] - - [0xCD6F0, c, ../lib/src/osCreatePiManager] - - [0xCD880, c, ../lib/src/osSetThreadPri] - - [0xCD960, c, ../lib/src/osCreateMesgQueue] - - [0xCD990, c, ../lib/src/osViSetEvent] - - [0xCDA00, c, ../lib/src/osSetEventMesg] - - [0xCDA70, c, ../lib/src/osSpTaskLoadGo] - - [0xCDD30, c, ../lib/src/osContInit] - - [0xCE0F0, c, ../lib/src/osContStartReadData] - - [0xCE350, c, ../lib/src/osRecvMesg] - - [0xCE490, asm, ../lib/asm/osWritebackDCacheAll] - - [0xCE4C0, c, ../lib/src/osSendMesg] - - [0xCE610, c, ../lib/src/osViSwapBuffer] - - [0xCE660, asm, ../lib/asm/bzero] - - [0xCE700, asm, ../lib/asm/osInvalICache] - - [0xCE780, asm, ../lib/asm/osInvalDCache] # did this one - - [0xCE830, c, ../lib/src/osPiStartDma] # didn't do this one - - [0xCE940, c, ../lib/src/osSpTaskYield] - - [0xCE960, c, ../lib/src/osSpTaskYielded] - - [0xCE9E0, c, ../lib/src/osGetTime] - - [0xCEA70, c, ../lib/src/math/llmuldiv] - - [0xCED30, c, ../lib/src/__osGetCurrFaultedThread] - - [0xCED40, asm, ../lib/asm/sqrtf] - - [0xCED50, c, ../lib/src/guOrthoF] - - [0xCEF10, c, ../lib/src/osSetTime] - - [0xCEF40, c, ../lib/src/osEepromProbe] - - [0xCEFB0, c, ../lib/src/osPfsIsPlug] - - [0xCF320, c, ../lib/src/osPfsInit] - - [0xCF4E0, c, ../lib/src/osPfsNumFiles] - - [0xCF630, c, ../lib/src/osPfsFileState] - - [0xCF920, c, ../lib/src/osPfsFreeBlocks] - - [0xCFA70, c, ../lib/src/guRotateF] - - [0xCFC60, c, ../lib/src/guScaleF] - - [0xCFD00, c, ../lib/src/guPerspectiveF] - - [0xCFF90, c, ../lib/src/guLookAtF] - - [0xD02C0, c, ../lib/src/guTranslateF] - - [0xD0360, c, ../lib/src/osSyncPrintf] - - [0xD03C0, c, ../lib/src/guMtxCatL] - - [0xD0480, c, ../lib/src/osPfsSearchFile] - - [0xD0640, c, ../lib/src/osPfsDeleteFile] - - [0xD0C50, c, ../lib/src/osEepromLongWrite] - - [0xD0D90, c, ../lib/src/osEepromLongRead] - - [0xD0ED0, c, ../lib/src/osPfsReadWriteFile] - - [0xD13D0, c, ../lib/src/osPfsAllocateFile] - - [0xD1B80, c, ../lib/src/osAiSetFrequency] - - [0xD1CE0, c, ../lib/src/osAiGetLength] - - [0xD1CF0, c, ../lib/src/osAiSetNextBuffer] - - [0xD1DA0, c, ../lib/src/osGetCount] - - [0xD1DB0, asm, ../lib/asm/__osException] - - [0xD26B0, asm, ../lib/asm/__osDisableInt] - - [0xD26D0, asm, ../lib/asm/__osRestoreInt] - - [0xD26F0, c, ../lib/src/__osDequeueThread] - - [0xD2730, asm, ../lib/asm/__osSetSR] - - [0xD2740, asm, ../lib/asm/__osGetSR] - - [0xD2750, asm, ../lib/asm/__osSetFpcCsr] - - [0xD2760, c, ../lib/src/__osSiRawReadIo] - - [0xD27B0, c, ../lib/src/__osSiRawWriteIo] - - [0xD2800, asm, ../lib/asm/osWritebackDCache] - - [0xD2880, asm, ../lib/asm/osMapTLBRdb] - - [0xD28E0, c, ../lib/src/osPiRawReadIo] - - [0xD2940, c, ../lib/src/__osSetHWIntrRoutine] - - [0xD2990, c, ../lib/src/__osLeoInterrupt] - - [0xD3210, c, ../lib/src/osTimer] - - [0xD3610, c, ../lib/src/osGetThreadPri] - - [0xD3630, c, ../lib/src/__osViInit] - - [0xD3780, c, ../lib/src/__osViGetCurrentContext] - - [0xD3790, c, ../lib/src/__osViSwapContext] - - [0xD3AF0, c, ../lib/src/__osPiCreateAccessQueue] - - [0xD3BB0, c, ../lib/src/osPiRawStartDma] - - [0xD3C90, c, ../lib/src/osEPiRawStartDma] - - [0xD3D70, c, ../lib/src/__osDevMgrMain] - - [0xD4120, c, ../lib/src/bcopy] - - [0xD4430, c, ../lib/src/osVirtualToPhysical] - - [0xD44B0, c, ../lib/src/__osSpSetStatus] - - [0xD44C0, c, ../lib/src/__osSpSetPc] - - [0xD4500, c, ../lib/src/__osSpRawStartDma] - - [0xD4590, c, ../lib/src/__osSpDeviceBusy] - - [0xD45C0, c, ../lib/src/osSetTimer] - - [0xD46A0, c, ../lib/src/__osSiRawStartDma] - - [0xD4750, c, ../lib/src/__osSiCreateAccessQueue] - - [0xD4810, c, ../lib/src/osJamMesg] - - [0xD4960, c, ../lib/src/osPiGetCmdQueue] - - [0xD4990, c, ../lib/src/__osSpGetStatus] - - [0xD49A0, c, ../lib/src/guMtxF2L] - - [0xD4C10, c, ../lib/src/osEepromWrite] - - [0xD50F0, c, ../lib/src/contpfs] - - [0xD5E50, c, ../lib/src/osPfsChecker] - - [0xD68B0, c, ../lib/src/contramread] - - [0xD6C60, c, ../lib/src/guNormalize] - - [0xD6CF0, c, ../lib/src/math/sinf] - - [0xD6EB0, c, ../lib/src/math/cosf] - - [0xD7020, c, ../lib/src/_Printf] - - [0xD7CE0, c, ../lib/src/guMtxCatF] - - [0xD7EF0, c, ../lib/src/contramwrite] - - [0xD82A0, c, ../lib/src/osEepromRead] - - [0xD85A0, c, ../lib/src/__osAiDeviceBusy] - - [0xD85D0, asm, ../lib/asm/osSetIntMask] - - [0xD8670, c, ../lib/src/osDestroyThread] - - [0xD8770, c, ../lib/src/__osSiDeviceBusy] - - [0xD87A0, c, ../lib/src/osLeoDiskInit] - - [0xD8890, asm, ../lib/asm/__osSetCompare] - - [0xD88A0, c, ../lib/src/__osResetGlobalIntMask] - - [0xD8900, c, ../lib/src/__osEPiRawWriteIo] - - [0xD8950, c, ../lib/src/osYieldThread] - - [0xD89A0, asm, ../lib/asm/__osProbeTLB] - - [0xD8A60, c, ../lib/src/crc] - - [0xD8BE0, c, ../lib/src/string] - - [0xD8C80, c, ../lib/src/_Litob] - - [0xD8F20, c, ../lib/src/_Ldtob] - - [0xD99E0, c, ../lib/src/ldiv] - - [0xD9B70, bin, lib/PR/boot/F3D_boot] - - [0xD9C40, bin, lib/PR/f3dex/F3DEX] - - [0xDB020, bin, lib/PR/f3dlx/F3DLX] - - [0xDC430, bin, lib/PR/audio/aspMain] - - [0xDD0D0, data, data_main] - - [0xDD274, bin, textures/crash_screen/crash_screen_font] - - [0xEC358, rodata, rodata_main] - - [0xF4900, bin, lib/PR/f3d/F3DEX_data] - - [0xF5100, bin, lib/PR/f3d/F3DLX_data] - - [0xF5900, bin, lib/PR/audio/aspMain_data] - - name: seg2 - type: code - bss_size: 0xFD180 # 0x3F460 - start: 0xF7510 - vram: 0x8028DF00 - subsegments: - - [0xF7510, c, race_logic] - - [0xFA230, c, render_courses] - - [0x100060, c, actors] - - [0x10CD40, c, skybox_and_splitscreen] - - [0x111180, c, memory] - - [0x114080, c, code_802AAA70] - - [0x119820, c, actors_extended] - - [0x11E570, c, math_util] - - [0x121DA0, data, data_seg2] - #- [0x1227D0, data, race_logic] # race_logic .data location messed up?!? - #- [0x1227F0, rodata, race_logic] - - [0x1227D0, rodata, race_logic] - - [0x1228D0, rodata, render_courses] - - [0x122B10, rodata, actors] - - [0x1231C0, rodata, skybox_and_splitscreen] - - [0x123240, rodata, memory] - - [0x123410, rodata, code_802AAA70] - - [0x123490, rodata, actors_extended] - - [0x1235C0, rodata, math_util] - - [0x123640, hasm, bss_seg2] - - name: credits - type: code - bss_size: 0x1A0 - start: 0x123640 # end: 0x12B360 - vram: 0x80280000 - subsegments: - - [0x123640, c, code_80280000] - - [0x123C90, c, code_80280650] - - [0x124C50, c, camera_junk] - - [0x124DC0, c, code_80281780] - - [0x125280, c, code_80281C40] - - [0x1255E0, c, ceremony_and_credits] - - [0x128480, data, data_credits] - - [0x12A1B0, rodata, code_80280650] - - [0x12A1D0, rodata, camera_junk] - - [0x12A1F0, rodata, credits] - - [0x12AAB0, rodata, ceremony_and_credits] - - [0x12AAE0, bss, bss_credits] - - - [0xC00000] # end of rom diff --git a/tools/yaml/yamls are unused.txt b/tools/yaml/yamls are unused.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/yamls/courses/banshee_boardwalk_metadata.yml b/yamls/courses/banshee_boardwalk_metadata.yml index bbcfd560a0..8425e7d253 100644 --- a/yamls/courses/banshee_boardwalk_metadata.yml +++ b/yamls/courses/banshee_boardwalk_metadata.yml @@ -7,9 +7,9 @@ course: cup: SPECIAL_CUP cup_index: 2 course_length: 747m - kart_ai_behaviour_ptr: D_0D009058 - kart_ai_maximum_separation: 40.0f - kart_ai_minimum_separation: 0.4f + cpu_behaviour_ptr: D_0D009058 + cpu_maximum_separation: 40.0f + cpu_minimum_separation: 0.4f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,28 @@ course: path_sizes: [0x02EE, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_banshee_boardwalk_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [ + d_course_banshee_boardwalk_track_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] # Unused except in podium ceremony - path_table_unknown: [d_course_banshee_boardwalk_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_banshee_boardwalk_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [0, 0, 0, 0, 0, 0] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/big_donut_metadata.yml b/yamls/courses/big_donut_metadata.yml index b959215548..20f0ed54bf 100644 --- a/yamls/courses/big_donut_metadata.yml +++ b/yamls/courses/big_donut_metadata.yml @@ -7,9 +7,9 @@ course: cup: BATTLE_CUP cup_index: 0 course_length: "" - kart_ai_behaviour_ptr: D_0D008F18 - kart_ai_maximum_separation: -1.0f - kart_ai_minimum_separation: 0.5f + cpu_behaviour_ptr: D_0D008F18 + cpu_maximum_separation: -1.0f + cpu_minimum_separation: 0.5f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 40 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,16 @@ course: path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] sky_colors: [0, 0, 0, 0, 0, 0] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/block_fort_metadata.yml b/yamls/courses/block_fort_metadata.yml index 251e2ab2ec..81d510bc32 100644 --- a/yamls/courses/block_fort_metadata.yml +++ b/yamls/courses/block_fort_metadata.yml @@ -7,9 +7,9 @@ course: cup: BATTLE_CUP cup_index: 1 course_length: "" - kart_ai_behaviour_ptr: D_0D008F18 - kart_ai_maximum_separation: -1.0f - kart_ai_minimum_separation: 0.1f + cpu_behaviour_ptr: D_0D008F18 + cpu_maximum_separation: -1.0f + cpu_minimum_separation: 0.1f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,16 @@ course: path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] sky_colors: [128, 4280, 6136, 216, 7144, 32248] sky_colors2: [216, 7144, 32248, 0, 0, 0] diff --git a/yamls/courses/bowsers_castle_metadata.yml b/yamls/courses/bowsers_castle_metadata.yml index efa7b730c9..c98310736a 100644 --- a/yamls/courses/bowsers_castle_metadata.yml +++ b/yamls/courses/bowsers_castle_metadata.yml @@ -7,9 +7,9 @@ course: cup: STAR_CUP cup_index: 3 course_length: 777m - kart_ai_behaviour_ptr: D_0D008FB8 - kart_ai_maximum_separation: 35.0f - kart_ai_minimum_separation: 0.2f + cpu_behaviour_ptr: D_0D008FB8 + cpu_maximum_separation: 35.0f + cpu_minimum_separation: 0.2f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,23 @@ course: path_sizes: [0x030C, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_bowsers_castle_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_bowsers_castle_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_bowsers_castle_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_bowsers_castle_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [48, 1544, 49528, 0, 0, 0] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/choco_mountain_metadata.yml b/yamls/courses/choco_mountain_metadata.yml index c47733a1f1..a0cd55dd66 100644 --- a/yamls/courses/choco_mountain_metadata.yml +++ b/yamls/courses/choco_mountain_metadata.yml @@ -7,9 +7,9 @@ course: cup: FLOWER_CUP cup_index: 2 course_length: 687m - kart_ai_behaviour_ptr: D_0D008F80 - kart_ai_maximum_separation: 35.0f - kart_ai_minimum_separation: 0.3f + cpu_behaviour_ptr: D_0D008F80 + cpu_maximum_separation: 35.0f + cpu_minimum_separation: 0.3f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,23 @@ course: path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_choco_mountain_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_choco_mountain_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_choco_mountain_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_choco_mountain_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [255, 255, 255, 255, 255, 255] sky_colors2: [255, 255, 255, 255, 255, 255] diff --git a/yamls/courses/dks_jungle_parkway_metadata.yml b/yamls/courses/dks_jungle_parkway_metadata.yml index dafe032341..fb22ad10be 100644 --- a/yamls/courses/dks_jungle_parkway_metadata.yml +++ b/yamls/courses/dks_jungle_parkway_metadata.yml @@ -7,9 +7,9 @@ course: cup: SPECIAL_CUP cup_index: 0 course_length: 893m - kart_ai_behaviour_ptr: D_0D0093C0 - kart_ai_maximum_separation: 40.0f - kart_ai_minimum_separation: 0.1f + cpu_behaviour_ptr: D_0D0093C0 + cpu_maximum_separation: 40.0f + cpu_minimum_separation: 0.1f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,28 @@ course: path_sizes: [0x0370, 0x0001, 0x0001, 0x0001, 0x01F4, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_dks_jungle_parkway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [ + d_course_dks_jungle_parkway_track_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] # Unused except in podium ceremony - path_table_unknown: [d_course_dks_jungle_parkway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_dks_jungle_parkway_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [255, 174, 0, 255, 229, 124] sky_colors2: [22, 145, 22, 0, 0, 0] diff --git a/yamls/courses/double_deck_metadata.yml b/yamls/courses/double_deck_metadata.yml index 2ea7090b72..acd8dd9fa2 100644 --- a/yamls/courses/double_deck_metadata.yml +++ b/yamls/courses/double_deck_metadata.yml @@ -7,9 +7,9 @@ course: cup: BATTLE_CUP cup_index: 2 course_length: "" - kart_ai_behaviour_ptr: D_0D008F18 - kart_ai_maximum_separation: -1.0f - kart_ai_minimum_separation: 0.5f + cpu_behaviour_ptr: D_0D008F18 + cpu_maximum_separation: -1.0f + cpu_minimum_separation: 0.5f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,16 @@ course: path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] sky_colors: [113, 70, 255, 255, 184, 99] sky_colors2: [255, 224, 240, 0, 0, 0] diff --git a/yamls/courses/frappe_snowland_metadata.yml b/yamls/courses/frappe_snowland_metadata.yml index 9a63755e1b..8212d46f28 100644 --- a/yamls/courses/frappe_snowland_metadata.yml +++ b/yamls/courses/frappe_snowland_metadata.yml @@ -7,9 +7,9 @@ course: cup: FLOWER_CUP cup_index: 1 course_length: 734m - kart_ai_behaviour_ptr: D_0D0090F8 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.3f + cpu_behaviour_ptr: D_0D0090F8 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.3f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,23 @@ course: path_sizes: [0x02EE, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_frappe_snowland_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_frappe_snowland_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_frappe_snowland_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_frappe_snowland_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [28, 11, 90, 0, 99, 164] sky_colors2: [0, 99, 164, 0, 0, 0] diff --git a/yamls/courses/kalimari_desert_metadata.yml b/yamls/courses/kalimari_desert_metadata.yml index e428cee117..d2a9f69861 100644 --- a/yamls/courses/kalimari_desert_metadata.yml +++ b/yamls/courses/kalimari_desert_metadata.yml @@ -7,9 +7,9 @@ course: cup: MUSHROOM_CUP cup_index: 3 course_length: 753m - kart_ai_behaviour_ptr: D_0D009260 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.3f + cpu_behaviour_ptr: D_0D009260 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.3f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,23 @@ course: path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0226, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_kalimari_desert_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_kalimari_desert_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_kalimari_desert_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_kalimari_desert_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [195, 231, 255, 255, 192, 0] sky_colors2: [255, 192, 0, 0, 0, 0] diff --git a/yamls/courses/koopa_beach_metadata.yml b/yamls/courses/koopa_beach_metadata.yml index 27576fb138..f7547febbb 100644 --- a/yamls/courses/koopa_beach_metadata.yml +++ b/yamls/courses/koopa_beach_metadata.yml @@ -7,9 +7,9 @@ course: cup: MUSHROOM_CUP cup_index: 2 course_length: 691m - kart_ai_behaviour_ptr: D_0D009158 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.5f + cpu_behaviour_ptr: D_0D009158 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.5f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,28 @@ course: path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_koopa_troopa_beach_track_waypoints, "d_course_koopa_troopa_beach_track_waypoints_2", "&nullPath", "&nullPath"] + # Course path + path_table: + [ + d_course_koopa_troopa_beach_track_path, + "d_course_koopa_troopa_beach_track_path_2", + "&nullPath", + "&nullPath", + ] # Unused except in podium ceremony - path_table_unknown: [d_course_koopa_troopa_beach_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_koopa_troopa_beach_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [48, 1688, 54136, 216, 7144, 32248] sky_colors2: [48, 1688, 54136, 0, 0, 0] diff --git a/yamls/courses/luigi_raceway_metadata.yml b/yamls/courses/luigi_raceway_metadata.yml index 98b8b010a2..18907bdf34 100644 --- a/yamls/courses/luigi_raceway_metadata.yml +++ b/yamls/courses/luigi_raceway_metadata.yml @@ -7,9 +7,9 @@ course: cup: MUSHROOM_CUP cup_index: 0 course_length: 717m - kart_ai_behaviour_ptr: D_0D0091E8 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.7f + cpu_behaviour_ptr: D_0D0091E8 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.7f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 48 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x02DA, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_luigi_raceway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_luigi_raceway_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_luigi_raceway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_luigi_raceway_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [128, 4280, 6136, 216, 7144, 32248] sky_colors2: [216, 7144, 32248, 0, 0, 0] diff --git a/yamls/courses/mario_raceway_metadata.yml b/yamls/courses/mario_raceway_metadata.yml index eab36113f5..6756070a71 100644 --- a/yamls/courses/mario_raceway_metadata.yml +++ b/yamls/courses/mario_raceway_metadata.yml @@ -7,9 +7,9 @@ course: cup: FLOWER_CUP cup_index: 3 course_length: 567m - kart_ai_behaviour_ptr: D_0D008F28 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.3f + cpu_behaviour_ptr: D_0D008F28 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.3f D_800DCBB4: D_800DCB34 cpu_steering_sensitivity: 48 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x0258, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_mario_raceway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_mario_raceway_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_mario_raceway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_mario_raceway_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [128, 4280, 6136, 216, 7144, 32248] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/moo_moo_farm_metadata.yml b/yamls/courses/moo_moo_farm_metadata.yml index d156fd8621..d7a032fe19 100644 --- a/yamls/courses/moo_moo_farm_metadata.yml +++ b/yamls/courses/moo_moo_farm_metadata.yml @@ -7,9 +7,9 @@ course: cup: MUSHROOM_CUP cup_index: 1 course_length: 527m - kart_ai_behaviour_ptr: D_0D009210 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.5f + cpu_behaviour_ptr: D_0D009210 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.5f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 48 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x0230, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_moo_moo_farm_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_moo_moo_farm_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_moo_moo_farm_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_moo_moo_farm_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [0, 18, 255, 197, 211, 255] sky_colors2: [255, 184, 99, 0, 0, 0] diff --git a/yamls/courses/podium_ceremony_metadata.yml b/yamls/courses/podium_ceremony_metadata.yml index 5df6a435a4..b7d4c1ff58 100644 --- a/yamls/courses/podium_ceremony_metadata.yml +++ b/yamls/courses/podium_ceremony_metadata.yml @@ -7,10 +7,10 @@ course: cup: null cup_index: -1 course_length: null - kart_ai_behaviour_ptr: D_0D008F18 - kart_ai_maximum_separation: 40.0f # entry - kart_ai_minimum_separation: 0.5f # entry - D_800DCBB4: D_800DCAF4 + cpu_behaviour_ptr: D_0D008F18 + cpu_maximum_separation: 40.0f # entry + cpu_minimum_separation: 0.5f # entry + D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 # entry bomb_kart_spawns: # 7 bomb kart spawn locations - [0x0003, 0x0005, 1.25, 0.0, 0.0, 0.0, 0.0] @@ -23,16 +23,22 @@ course: path_sizes: [0x01F4, 0x01F4, 0x01F4, 0x01F4, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [0.0f, 0.0f, 0.0f, 0.0f] - D_0D009568: [0.0f, 0.0f, 0.0f, 0.0f] + cpu_CurveTargetSpeed: [0.0f, 0.0f, 0.0f, 0.0f] + cpu_NormalTargetSpeed: [0.0f, 0.0f, 0.0f, 0.0f] D_0D0096B8: [0.0f, 0.0f, 0.0f, 0.0f] - D_0D009808: [0.0f, 0.0f, 0.0f, 0.0f] + cpu_OffTrackTargetSpeed: [0.0f, 0.0f, 0.0f, 0.0f] - # Course waypoints - path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [podium_ceremony_path, podium_ceremony_path_2, podium_ceremony_path_3, podium_ceremony_path_4] + path_table_unknown: + [ + podium_ceremony_path, + podium_ceremony_path_2, + podium_ceremony_path_3, + podium_ceremony_path_4, + ] sky_colors: [238, 144, 255, 255, 224, 240] sky_colors2: [255, 224, 240, 0, 0, 0] diff --git a/yamls/courses/rainbow_road_metadata.yml b/yamls/courses/rainbow_road_metadata.yml index 66a9224ac5..14d7b264c9 100644 --- a/yamls/courses/rainbow_road_metadata.yml +++ b/yamls/courses/rainbow_road_metadata.yml @@ -7,9 +7,9 @@ course: cup: SPECIAL_CUP cup_index: 3 course_length: 2000m - kart_ai_behaviour_ptr: D_0D0092C8 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.4f + cpu_behaviour_ptr: D_0D0092C8 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.4f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 38 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x076C, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_rainbow_road_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_rainbow_road_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_rainbow_road_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_rainbow_road_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [0, 0, 0, 0, 0, 0] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/royal_raceway_metadata.yml b/yamls/courses/royal_raceway_metadata.yml index 1b4fecf3a9..4d1efe634c 100644 --- a/yamls/courses/royal_raceway_metadata.yml +++ b/yamls/courses/royal_raceway_metadata.yml @@ -7,9 +7,9 @@ course: cup: STAR_CUP cup_index: 2 course_length: 1025m - kart_ai_behaviour_ptr: D_0D009188 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.4f + cpu_behaviour_ptr: D_0D009188 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.4f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x03E8, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_royal_raceway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_royal_raceway_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_royal_raceway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_royal_raceway_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [238, 144, 255, 255, 224, 240] sky_colors2: [255, 224, 240, 0, 0, 0] diff --git a/yamls/courses/sherbet_land_metadata.yml b/yamls/courses/sherbet_land_metadata.yml index 2db2a434f6..ffce8e07ce 100644 --- a/yamls/courses/sherbet_land_metadata.yml +++ b/yamls/courses/sherbet_land_metadata.yml @@ -7,9 +7,9 @@ course: cup: STAR_CUP cup_index: 1 course_length: 756m - kart_ai_behaviour_ptr: D_0D009280 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.3f + cpu_behaviour_ptr: D_0D009280 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.3f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_sherbet_land_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_sherbet_land_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_sherbet_land_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_sherbet_land_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [128, 4280, 6136, 216, 7144, 32248] sky_colors2: [216, 7144, 32248, 128, 4280, 6136] diff --git a/yamls/courses/skyscraper_metadata.yml b/yamls/courses/skyscraper_metadata.yml index 451405a911..4b89c88c98 100644 --- a/yamls/courses/skyscraper_metadata.yml +++ b/yamls/courses/skyscraper_metadata.yml @@ -7,9 +7,9 @@ course: cup: BATTLE_CUP cup_index: 3 course_length: "" - kart_ai_behaviour_ptr: D_0D008F18 - kart_ai_maximum_separation: -1.0f - kart_ai_minimum_separation: 0.5f + cpu_behaviour_ptr: D_0D008F18 + cpu_maximum_separation: -1.0f + cpu_minimum_separation: 0.5f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,16 @@ course: path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"] sky_colors: [0, 0, 0, 0, 0, 0] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/toads_turnpike_metadata.yml b/yamls/courses/toads_turnpike_metadata.yml index a72049b226..d212be04c0 100644 --- a/yamls/courses/toads_turnpike_metadata.yml +++ b/yamls/courses/toads_turnpike_metadata.yml @@ -7,9 +7,9 @@ course: cup: FLOWER_CUP cup_index: 0 course_length: 1036m - kart_ai_behaviour_ptr: D_0D009238 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.5f + cpu_behaviour_ptr: D_0D009238 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.5f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 40 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,23 @@ course: path_sizes: [0x03E8, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_toads_turnpike_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_toads_turnpike_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_toads_turnpike_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [ + d_course_toads_turnpike_unknown_path, + "&nullPath", + "&nullPath", + "&nullPath", + ] sky_colors: [0, 2, 94, 209, 65, 23] sky_colors2: [209, 65, 23, 0, 0, 0] diff --git a/yamls/courses/wario_stadium_metadata.yml b/yamls/courses/wario_stadium_metadata.yml index 0d994227d2..006f8f47a2 100644 --- a/yamls/courses/wario_stadium_metadata.yml +++ b/yamls/courses/wario_stadium_metadata.yml @@ -7,9 +7,9 @@ course: cup: STAR_CUP cup_index: 0 course_length: 1591m - kart_ai_behaviour_ptr: D_0D009310 - kart_ai_maximum_separation: 50.0f - kart_ai_minimum_separation: 0.6f + cpu_behaviour_ptr: D_0D009310 + cpu_maximum_separation: 50.0f + cpu_minimum_separation: 0.6f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,18 @@ course: path_sizes: [0x0640, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f] - D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f] + cpu_OffTrackTargetSpeed: [3.75f, 5.1666665f, 5.75f, 6.3333334f] - # Course waypoints - path_table: [d_course_wario_stadium_track_waypoints, "&nullPath", "&nullPath", "&nullPath"] + # Course path + path_table: + [d_course_wario_stadium_track_path, "&nullPath", "&nullPath", "&nullPath"] # Unused except in podium ceremony - path_table_unknown: [d_course_wario_stadium_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"] + path_table_unknown: + [d_course_wario_stadium_unknown_path, "&nullPath", "&nullPath", "&nullPath"] sky_colors: [20, 30, 56, 40, 60, 110] sky_colors2: [0, 0, 0, 0, 0, 0] diff --git a/yamls/courses/yoshi_valley_metadata.yml b/yamls/courses/yoshi_valley_metadata.yml index 07448f07d5..d5b6548b46 100644 --- a/yamls/courses/yoshi_valley_metadata.yml +++ b/yamls/courses/yoshi_valley_metadata.yml @@ -7,9 +7,9 @@ course: cup: SPECIAL_CUP cup_index: 1 course_length: 772m - kart_ai_behaviour_ptr: D_0D0090B8 - kart_ai_maximum_separation: 35.0f - kart_ai_minimum_separation: 0.0f + cpu_behaviour_ptr: D_0D0090B8 + cpu_maximum_separation: 35.0f + cpu_minimum_separation: 0.0f D_800DCBB4: D_800DCAF4 cpu_steering_sensitivity: 53 bomb_kart_spawns: # 7 bomb kart spawn locations @@ -23,16 +23,28 @@ course: path_sizes: [0x02B2, 0x02A8, 0x02B2, 0x0320, 0x0001, 0x0000, 0x0000, 0x0000] # unk common_textures data - D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] - D_0D009568: [3.75f, 4.5833334f, 4.5833334f, 4.5833334f] + cpu_CurveTargetSpeed: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f] + cpu_NormalTargetSpeed: [3.75f, 4.5833334f, 4.5833334f, 4.5833334f] D_0D0096B8: [3.3333332f, 3.3333332f, 3.3333332f, 3.3333332f] - D_0D009808: [2.9166667f, 3.75f, 3.75f, 3.75f] + cpu_OffTrackTargetSpeed: [2.9166667f, 3.75f, 3.75f, 3.75f] - # Course waypoints - path_table: [d_course_yoshi_valley_track_waypoints, "d_course_yoshi_valley_track_waypoints_2", "d_course_yoshi_valley_track_waypoints_3", "d_course_yoshi_valley_track_waypoints_4"] + # Course path + path_table: + [ + d_course_yoshi_valley_track_path, + "d_course_yoshi_valley_track_path_2", + "d_course_yoshi_valley_track_path_3", + "d_course_yoshi_valley_track_path_4", + ] # Unused except in podium ceremony - path_table_unknown: [d_course_yoshi_valley_unknown_waypoints, d_course_yoshi_valley_unknown_waypoints_2, d_course_yoshi_valley_unknown_waypoints_3, d_course_yoshi_valley_unknown_waypoints_4] + path_table_unknown: + [ + d_course_yoshi_valley_unknown_path, + d_course_yoshi_valley_unknown_path_2, + d_course_yoshi_valley_unknown_path_3, + d_course_yoshi_valley_unknown_path_4, + ] sky_colors: [113, 70, 255, 255, 184, 99] sky_colors2: [95, 40, 15, 0, 0, 0] diff --git a/yamls/us/ceremony_data.yml b/yamls/us/ceremony_data.yml index bc68825e66..9a3cb1cf0e 100644 --- a/yamls/us/ceremony_data.yml +++ b/yamls/us/ceremony_data.yml @@ -1,13 +1,13 @@ :config: segments: - [0x0B, 0x821D10] - header: + header: code: - - '#include ' + - "#include " header: - - '#include ' - - '#include ' - - '#include ' + - "#include " + - "#include " + - "#include " silver_trophy_dl: symbol: silver_trophy_dl @@ -219,21 +219,21 @@ podium3_dl4: offset: 0x8AA0 ending_sequence: symbol: podium_ceremony_path - type: mk64:track_waypoints + type: mk64:track_path offset: 0x8AA8 count: 24 ending_sequence2: symbol: podium_ceremony_path_2 - type: mk64:track_waypoints + type: mk64:track_path offset: 0x8B68 count: 23 ending_sequence3: symbol: podium_ceremony_path_3 - type: mk64:track_waypoints + type: mk64:track_path offset: 0x8C20 count: 24 ending_sequence4: symbol: podium_ceremony_path_4 - type: mk64:track_waypoints + type: mk64:track_path offset: 0x8CE0 count: 21 diff --git a/yamls/us/common_data.yml b/yamls/us/common_data.yml index 75f6e250c7..a5261084e2 100644 --- a/yamls/us/common_data.yml +++ b/yamls/us/common_data.yml @@ -13,7 +13,7 @@ tables: common_grand_prix_human_item_curve: range: [0x8150, 0x840C] - common_grand_prix_kart_ai_item_curve: + common_grand_prix_cpu_item_curve: range: [0x8470, 0x872C] common_versus_2_player_item_curve: range: [0x8790, 0x87F4] @@ -48,9 +48,6 @@ common_texture_particle_smoke: range: [0x2BC58, 0x2C858] mode: APPEND - common_texture_minimap_kart_character: - range: [0x2CCD8, 0x2D058] - mode: APPEND common_tlut_finish_line_banner: symbol: common_tlut_finish_line_banner type: texture @@ -883,36 +880,36 @@ common_grand_prix_human_item_curve8: symbol: common_grand_prix_human_item_curve8 type: mk64:item_curve offset: 0x840C -common_grand_prix_kart_ai_item_curve: - symbol: common_grand_prix_kart_ai_item_curve +common_grand_prix_cpu_item_curve: + symbol: common_grand_prix_cpu_item_curve type: mk64:item_curve offset: 0x8470 -common_grand_prix_kart_ai_item_curve2: - symbol: common_grand_prix_kart_ai_item_curve2 +common_grand_prix_cpu_item_curve2: + symbol: common_grand_prix_cpu_item_curve2 type: mk64:item_curve offset: 0x84D4 -common_grand_prix_kart_ai_item_curve3: - symbol: common_grand_prix_kart_ai_item_curve3 +common_grand_prix_cpu_item_curve3: + symbol: common_grand_prix_cpu_item_curve3 type: mk64:item_curve offset: 0x8538 -common_grand_prix_kart_ai_item_curve4: - symbol: common_grand_prix_kart_ai_item_curve4 +common_grand_prix_cpu_item_curve4: + symbol: common_grand_prix_cpu_item_curve4 type: mk64:item_curve offset: 0x859C -common_grand_prix_kart_ai_item_curve5: - symbol: common_grand_prix_kart_ai_item_curve5 +common_grand_prix_cpu_item_curve5: + symbol: common_grand_prix_cpu_item_curve5 type: mk64:item_curve offset: 0x8600 -common_grand_prix_kart_ai_item_curve6: - symbol: common_grand_prix_kart_ai_item_curve6 +common_grand_prix_cpu_item_curve6: + symbol: common_grand_prix_cpu_item_curve6 type: mk64:item_curve offset: 0x8664 -common_grand_prix_kart_ai_item_curve7: - symbol: common_grand_prix_kart_ai_item_curve7 +common_grand_prix_cpu_item_curve7: + symbol: common_grand_prix_cpu_item_curve7 type: mk64:item_curve offset: 0x86C8 -common_grand_prix_kart_ai_item_curve8: - symbol: common_grand_prix_kart_ai_item_curve8 +common_grand_prix_cpu_item_curve8: + symbol: common_grand_prix_cpu_item_curve8 type: mk64:item_curve offset: 0x872C common_versus_2_player_item_curve: @@ -1098,31 +1095,31 @@ D_0D0093C0: symbol: D_0D0093C0 type: mk64:driving_behaviour offset: 0x93C0 -D_0D009418: - symbol: D_0D009418 +cpu_CurveTargetSpeed: + symbol: cpu_CurveTargetSpeed type: inc offset: 0x9418 ctype: Vec4f offset: 0x9418 - file_path: "assets/course_metadata/D_0D009418.inc.c" -D_0D009568: - symbol: D_0D009568 + file_path: "assets/course_metadata/cpu_CurveTargetSpeed.inc.c" +cpu_NormalTargetSpeed: + symbol: cpu_NormalTargetSpeed type: inc offset: 0x9568 ctype: Vec4f - file_path: "assets/course_metadata/D_0D009568.inc.c" + file_path: "assets/course_metadata/cpu_NormalTargetSpeed.inc.c" D_0D0096B8: symbol: D_0D0096B8 type: inc offset: 0x96B8 ctype: Vec4f file_path: "assets/course_metadata/D_0D0096B8.inc.c" -D_0D009808: - symbol: D_0D009808 +cpu_OffTrackTargetSpeed: + symbol: cpu_OffTrackTargetSpeed type: inc offset: 0x9808 ctype: Vec4f - file_path: "assets/course_metadata/D_0D009808.inc.c" + file_path: "assets/course_metadata/cpu_OffTrackTargetSpeed.inc.c" common_texture_speedometer: symbol: common_texture_speedometer type: texture diff --git a/yamls/us/data_800E8700.yml b/yamls/us/data_800E8700.yml index dad1283c48..9c0bb55f1d 100644 --- a/yamls/us/data_800E8700.yml +++ b/yamls/us/data_800E8700.yml @@ -117,16 +117,6 @@ D_800E8C00: type: vtx offset: 0x800E8C00 count: 4 -D_800E8C40: - symbol: D_800E8C40 - type: vtx - offset: 0x800E8C40 - count: 8 -D_800E8CC0: - symbol: D_800E8CC0 - type: vtx - offset: 0x800E8CC0 - count: 8 D_800E8D40: symbol: D_800E8D40 type: gfx diff --git a/yamls/us/rainbow_road_tluts.yml b/yamls/us/rainbow_road_tluts.yml new file mode 100644 index 0000000000..36209a4585 --- /dev/null +++ b/yamls/us/rainbow_road_tluts.yml @@ -0,0 +1,66 @@ +# This file is only used for compilation +# Because u16 output is required. +# The png output in assets/courses/ is from the identical .json extraction file +:config: + segments: + - [0x06, 0x872A00] + header: + code: + - '#include ' + - '#include ' +gTLUTRainbowRoadNeonPeach: + symbol: gTLUTRainbowRoadNeonPeach + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07200 + format: rgba16 +gTLUTRainbowRoadNeonLuigi: + symbol: gTLUTRainbowRoadNeonLuigi + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07400 + format: rgba16 +gTLUTRainbowRoadNeonDonkeyKong: + symbol: gTLUTRainbowRoadNeonDonkeyKong + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07600 + format: rgba16 +gTLUTRainbowRoadNeonYoshi: + symbol: gTLUTRainbowRoadNeonYoshi + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07800 + format: rgba16 +gTLUTRainbowRoadNeonBowser: + symbol: gTLUTRainbowRoadNeonBowser + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07A00 + format: rgba16 +gTLUTRainbowRoadNeonWario: + symbol: gTLUTRainbowRoadNeonWario + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07C00 + format: rgba16 +gTLUTRainbowRoadNeonToad: + symbol: gTLUTRainbowRoadNeonToad + type: texture + ctype: u16 + width: 16 + height: 16 + offset: 0x07E00 + format: rgba16