Doc code 80005fd0 (#697)

* Document code_80005FD0.c
This commit is contained in:
coco875
2025-01-19 01:24:09 +01:00
committed by GitHub
parent 5e1ce53a4c
commit 731b24eabf
126 changed files with 10427 additions and 10050 deletions
+1 -1
View File
@@ -244,7 +244,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/menu_items.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.
@@ -21,7 +21,7 @@ glabel jpt_800ED4A0
.section .text
glabel kart_ai_use_item_strategy
glabel cpu_use_item_strategy
/* 01B810 8001AC10 000478C0 */ sll $t7, $a0, 3
/* 01B814 8001AC14 01E47823 */ subu $t7, $t7, $a0
/* 01B818 8001AC18 000F7900 */ sll $t7, $t7, 4
@@ -46,8 +46,8 @@ glabel kart_ai_use_item_strategy
/* 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
/* 01B870 8001AC70 3C0B8016 */ lui $t3, %hi(cpu_ItemStrategy) # $t3, 0x8016
/* 01B874 8001AC74 256B42D8 */ addiu $t3, %lo(cpu_ItemStrategy) # addiu $t3, $t3, 0x42d8
/* 01B878 8001AC78 31CF0800 */ andi $t7, $t6, 0x800
/* 01B87C 8001AC7C 15E00479 */ bnez $t7, .L8001BE64
/* 01B880 8001AC80 0004C900 */ sll $t9, $a0, 4
@@ -65,12 +65,12 @@ 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
/* 01B8B8 8001ACB8 3C0E8016 */ lui $t6, %hi(gNumPathPointsTraversed) # 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)
/* 01B8CC 8001ACCC 8DCE4450 */ lw $t6, %lo(gNumPathPointsTraversed)($t6) # 0x4450($t6)
/* 01B8D0 8001ACD0 01ED7821 */ addu $t7, $t7, $t5
/* 01B8D4 8001ACD4 000F7880 */ sll $t7, $t7, 2
/* 01B8D8 8001ACD8 25F80064 */ addiu $t8, $t7, 0x64
@@ -96,11 +96,11 @@ glabel L8001ACAC
/* 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
/* 01B934 8001AD34 0C01EBDE */ jal cpu_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
/* 01B944 8001AD44 0C006ADD */ jal cpu_decisions_branch_item
/* 01B948 8001AD48 00403025 */ move $a2, $v0
/* 01B94C 8001AD4C 10000003 */ b .L8001AD5C
/* 01B950 8001AD50 00000000 */ nop
@@ -118,10 +118,10 @@ glabel L8001AD64
/* 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
/* 01B980 8001AD80 3C038016 */ lui $v1, %hi(gBestRankedHumanPlayer) # $v1, 0x8016
/* 01B984 8001AD84 19C0004B */ blez $t6, .L8001AEB4
/* 01B988 8001AD88 00000000 */ nop
/* 01B98C 8001AD8C 84633478 */ lh $v1, %lo(D_80163478)($v1)
/* 01B98C 8001AD8C 84633478 */ lh $v1, %lo(gBestRankedHumanPlayer)($v1)
/* 01B990 8001AD90 00CF5821 */ addu $t3, $a2, $t7
/* 01B994 8001AD94 8D6C0000 */ lw $t4, ($t3)
/* 01B998 8001AD98 0003C080 */ sll $t8, $v1, 2
@@ -134,27 +134,27 @@ glabel L8001AD64
/* 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
/* 01B9C0 8001ADC0 3C088016 */ lui $t0, %hi(gNearestPathPointByPlayerId) # $t0, 0x8016
/* 01B9C4 8001ADC4 10410006 */ beq $v0, $at, .L8001ADE0
/* 01B9C8 8001ADC8 25084438 */ addiu $t0, %lo(gNearestWaypointByPlayerId) # addiu $t0, $t0, 0x4438
/* 01B9C8 8001ADC8 25084438 */ addiu $t0, %lo(gNearestPathPointByPlayerId) # 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
/* 01B9D4 8001ADD4 3C088016 */ lui $t0, %hi(gNearestPathPointByPlayerId) # 0x8016
/* 01B9D8 8001ADD8 10000024 */ b .L8001AE6C
/* 01B9DC 8001ADDC 3C088016 */ lui $t0, %hi(gNearestWaypointByPlayerId) # $t0, 0x8016
/* 01B9DC 8001ADDC 3C088016 */ lui $t0, %hi(gNearestPathPointByPlayerId) # $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
/* 01B9E8 8001ADE8 3C0C8016 */ lui $t4, %hi(gSelectedPathCount) # $t4, 0x8016
/* 01B9EC 8001ADEC 000F7040 */ sll $t6, $t7, 1
/* 01B9F0 8001ADF0 958C4430 */ lhu $t4, %lo(D_80164430)($t4)
/* 01B9F0 8001ADF0 958C4430 */ lhu $t4, %lo(gSelectedPathCount)($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
/* 01BA0C 8001AE0C 0C001EFE */ jal is_path_point_in_range
/* 01BA10 8001AE10 AFAC0010 */ sw $t4, 0x10($sp)
/* 01BA14 8001AE14 18400045 */ blez $v0, .L8001AF2C
/* 01BA18 8001AE18 240D0022 */ li $t5, 34
@@ -162,18 +162,18 @@ glabel L8001AD64
/* 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
/* 01BA28 8001AE28 25084438 */ addiu $t0, %lo(gNearestPathPointByPlayerId) # addiu $t0, $t0, 0x4438
/* 01BA2C 8001AE2C 0003C840 */ sll $t9, $v1, 1
/* 01BA30 8001AE30 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016
/* 01BA30 8001AE30 3C0C8016 */ lui $t4, %hi(gSelectedPathCount) # $t4, 0x8016
/* 01BA34 8001AE34 000F7040 */ sll $t6, $t7, 1
/* 01BA38 8001AE38 958C4430 */ lhu $t4, %lo(D_80164430)($t4)
/* 01BA38 8001AE38 958C4430 */ lhu $t4, %lo(gSelectedPathCount)($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
/* 01BA54 8001AE54 0C001EFE */ jal is_path_point_in_range
/* 01BA58 8001AE58 AFAC0010 */ sw $t4, 0x10($sp)
/* 01BA5C 8001AE5C 18400033 */ blez $v0, .L8001AF2C
/* 01BA60 8001AE60 240D0022 */ li $t5, 34
@@ -181,18 +181,18 @@ glabel L8001AD64
/* 01BA68 8001AE68 A60D0000 */ sh $t5, ($s0)
.L8001AE6C:
/* 01BA6C 8001AE6C 8FAF0030 */ lw $t7, 0x30($sp)
/* 01BA70 8001AE70 25084438 */ addiu $t0, $t0, %lo(gNearestWaypointByPlayerId) # 0x4438
/* 01BA70 8001AE70 25084438 */ addiu $t0, $t0, %lo(gNearestPathPointByPlayerId) # 0x4438
/* 01BA74 8001AE74 0003C840 */ sll $t9, $v1, 1
/* 01BA78 8001AE78 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016
/* 01BA78 8001AE78 3C0C8016 */ lui $t4, %hi(gSelectedPathCount) # $t4, 0x8016
/* 01BA7C 8001AE7C 000F7040 */ sll $t6, $t7, 1
/* 01BA80 8001AE80 958C4430 */ lhu $t4, %lo(D_80164430)($t4)
/* 01BA80 8001AE80 958C4430 */ lhu $t4, %lo(gSelectedPathCount)($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
/* 01BA9C 8001AE9C 0C001EFE */ jal is_path_point_in_range
/* 01BAA0 8001AEA0 AFAC0010 */ sw $t4, 0x10($sp)
/* 01BAA4 8001AEA4 18400021 */ blez $v0, .L8001AF2C
/* 01BAA8 8001AEA8 240D0022 */ li $t5, 34
@@ -359,7 +359,7 @@ glabel L8001B0EC
/* 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
/* 01BD0C 8001B10C 3C088016 */ lui $t0, %hi(gNearestPathPointByPlayerId) # $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
@@ -381,9 +381,9 @@ glabel L8001B0EC
/* 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
/* 01BD64 8001B164 3C068016 */ lui $a2, %hi(gBestRankedHumanPlayer) # $a2, 0x8016
/* 01BD68 8001B168 84C63478 */ lh $a2, %lo(gBestRankedHumanPlayer)($a2)
/* 01BD6C 8001B16C 25084438 */ addiu $t0, %lo(gNearestPathPointByPlayerId) # 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
@@ -393,16 +393,16 @@ glabel L8001B0EC
/* 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
/* 01BD94 8001B194 3C0F8016 */ lui $t7, %hi(gPathCountByPathIndex) # 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)
/* 01BDA0 8001B1A0 95EF45C8 */ lhu $t7, %lo(gPathCountByPathIndex)($t7) # 0x45c8($t7)
/* 01BDA4 8001B1A4 952D0000 */ lhu $t5, ($t1)
/* 01BDA8 8001B1A8 3C0B8016 */ lui $t3, %hi(D_80164550) # 0x8016
/* 01BDA8 8001B1A8 3C0B8016 */ lui $t3, %hi(gTrackPaths) # 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)
/* 01BDB8 8001B1B8 8D6B4550 */ lw $t3, %lo(gTrackPaths)($t3) # 0x4550($t3)
/* 01BDBC 8001B1BC 00007010 */ mfhi $t6
/* 01BDC0 8001B1C0 000EC0C0 */ sll $t8, $t6, 3
/* 01BDC4 8001B1C4 030B1021 */ addu $v0, $t8, $t3
@@ -782,7 +782,7 @@ glabel L8001B6AC
/* 01C330 8001B730 100001C0 */ b .L8001BE34
/* 01C334 8001B734 86020004 */ lh $v0, 4($s0)
glabel L8001B738
/* 01C338 8001B738 0C006AFB */ jal func_8001ABEC
/* 01C338 8001B738 0C006AFB */ jal clear_expired_strategies
/* 01C33C 8001B73C 02002025 */ move $a0, $s0
/* 01C340 8001B740 860D0002 */ lh $t5, 2($s0)
/* 01C344 8001B744 3C0F8016 */ lui $t7, %hi(gActorList) # $t7, 0x8016
@@ -986,7 +986,7 @@ glabel L8001B9D0
/* 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
/* 01C60C 8001BA0C 0C0AC192 */ jal drop_banana_in_banana_bunch
/* 01C610 8001BA10 00E02025 */ move $a0, $a3
/* 01C614 8001BA14 86030008 */ lh $v1, 8($s0)
/* 01C618 8001BA18 24790001 */ addiu $t9, $v1, 1
@@ -69,14 +69,14 @@ glabel func_800088D8
/* 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
/* 0095DC 800089DC 3C048016 */ lui $a0, %hi(gNumPathPointsTraversed) # $a0, 0x8016
/* 0095E0 800089E0 24844450 */ addiu $a0, %lo(gNumPathPointsTraversed) # 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
/* 0095F4 800089F4 3C048016 */ lui $a0, %hi(gNumPathPointsTraversed) # $a0, 0x8016
/* 0095F8 800089F8 24844450 */ addiu $a0, %lo(gNumPathPointsTraversed) # 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
@@ -134,14 +134,14 @@ glabel func_800088D8
/* 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)
/* 0096D0 80008AD0 3C0F8016 */ lui $t7, %hi(gPathCountByPathIndex) # $t7, 0x8016
/* 0096D4 80008AD4 95EF45C8 */ lhu $t7, %lo(gPathCountByPathIndex)($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)
/* 0096E8 80008AE8 3C0B8016 */ lui $t3, %hi(gBestRankedHumanPlayer) # $t3, 0x8016
/* 0096EC 80008AEC 856B3478 */ lh $t3, %lo(gBestRankedHumanPlayer)($t3)
/* 0096F0 80008AF0 3C0D8016 */ lui $t5, %hi(gGPCurrentRaceRankByPlayerId + 0x2) # 0x8016
/* 0096F4 80008AF4 000BC880 */ sll $t9, $t3, 2
/* 0096F8 80008AF8 00997021 */ addu $t6, $a0, $t9
@@ -220,8 +220,8 @@ glabel func_800088D8
.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
/* 009810 80008C10 3C048016 */ lui $a0, %hi(gNumPathPointsTraversed) # $a0, 0x8016
/* 009814 80008C14 24844450 */ addiu $a0, %lo(gNumPathPointsTraversed) # 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
@@ -41,8 +41,8 @@ glabel func_8000B140
/* 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
/* 00BDB4 8000B1B4 3C0B8016 */ lui $t3, %hi(gTrackPositionFactor) # $t3, 0x8016
/* 00BDB8 8000B1B8 256B3068 */ addiu $t3, %lo(gTrackPositionFactor) # 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
@@ -76,9 +76,9 @@ glabel func_8000B140
/* 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
/* 00BE40 8000B240 3C098016 */ lui $t1, %hi(gNearestPathPointByPlayerId) # 0x8016
/* 00BE44 8000B244 012D4821 */ addu $t1, $t1, $t5
/* 00BE48 8000B248 85294438 */ lh $t1, %lo(gNearestWaypointByPlayerId)($t1) # 0x4438($t1)
/* 00BE48 8000B248 85294438 */ lh $t1, %lo(gNearestPathPointByPlayerId)($t1) # 0x4438($t1)
/* 00BE4C 8000B24C 240303E8 */ li $v1, 1000
/* 00BE50 8000B250 27A5009C */ addiu $a1, $sp, 0x9c
/* 00BE54 8000B254 27A200B0 */ addiu $v0, $sp, 0xb0
@@ -134,31 +134,31 @@ glabel func_8000B140
/* 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
/* 00BF1C 8000B31C 3C038016 */ lui $v1, %hi(gNearestPathPointByPlayerId) # 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)
/* 00BF28 8000B328 84634438 */ lh $v1, %lo(gNearestPathPointByPlayerId)($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
/* 00BF38 8000B338 3C0C8016 */ lui $t4, %hi(gSelectedPathCount) # $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)
/* 00BF54 8000B354 958C4430 */ lhu $t4, %lo(gSelectedPathCount)($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
/* 00BF70 8000B370 0C001EFE */ jal is_path_point_in_range
/* 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
/* 00BF78 8000B378 3C0B8016 */ lui $t3, %hi(gTrackPositionFactor) # $t3, 0x8016
/* 00BF7C 8000B37C 256B3068 */ addiu $t3, %lo(gTrackPositionFactor) # 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)
@@ -179,8 +179,8 @@ glabel func_8000B140
/* 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)
/* 00BFCC 8000B3CC 3C0E8016 */ lui $t6, %hi(gSelectedPathCount) # $t6, 0x8016
/* 00BFD0 8000B3D0 95CE4430 */ lhu $t6, %lo(gSelectedPathCount)($t6)
/* 00BFD4 8000B3D4 006E6021 */ addu $t4, $v1, $t6
/* 00BFD8 8000B3D8 01896823 */ subu $t5, $t4, $t1
/* 00BFDC 8000B3DC A4CD0000 */ sh $t5, ($a2)
@@ -37,17 +37,17 @@ glabel func_80017054
/* 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
/* 017CB8 800170B8 3C0F8016 */ lui $t7, %hi(gNearestPathPointByCameraId) # $t7, 0x8016
/* 017CBC 800170BC E5240000 */ swc1 $f4, ($t1)
/* 017CC0 800170C0 3C0C8016 */ lui $t4, %hi(gWaypointCountByPathIndex) # 0x8016
/* 017CC0 800170C0 3C0C8016 */ lui $t4, %hi(gPathCountByPathIndex) # 0x8016
/* 017CC4 800170C4 3C018016 */ lui $at, %hi(D_80163238) # $at, 0x8016
/* 017CC8 800170C8 25EF4668 */ addiu $t7, %lo(gNearestWaypointByCameraId) # addiu $t7, $t7, 0x4668
/* 017CC8 800170C8 25EF4668 */ addiu $t7, %lo(gNearestPathPointByCameraId) # 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)
/* 017CE0 800170E0 958C45C8 */ lhu $t4, %lo(gPathCountByPathIndex)($t4) # 0x45c8($t4)
/* 017CE4 800170E4 85070000 */ lh $a3, ($t0)
/* 017CE8 800170E8 00808025 */ move $s0, $a0
/* 017CEC 800170EC AFAC0058 */ sw $t4, 0x58($sp)
@@ -134,10 +134,10 @@ glabel func_80017054
/* 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
/* 017E28 80017228 0C002EF6 */ jal set_track_offset_position
/* 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
/* 017E30 80017230 3C038016 */ lui $v1, %hi(gOffsetPosition) # $v1, 0x8016
/* 017E34 80017234 24632FA0 */ addiu $v1, %lo(gOffsetPosition) # addiu $v1, $v1, 0x2fa0
/* 017E38 80017238 C4660000 */ lwc1 $f6, ($v1)
/* 017E3C 8001723C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000
/* 017E40 80017240 44810800 */ mtc1 $at, $f1
@@ -154,10 +154,10 @@ glabel func_80017054
/* 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
/* 017E78 80017278 0C002EF6 */ jal set_track_offset_position
/* 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
/* 017E80 80017280 3C038016 */ lui $v1, %hi(gOffsetPosition) # $v1, 0x8016
/* 017E84 80017284 24632FA0 */ addiu $v1, %lo(gOffsetPosition) # 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
@@ -201,9 +201,9 @@ glabel func_80017054
/* 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
/* 017F2C 8001732C 3C0E8016 */ lui $t6, %hi(gTrackPaths) # $t6, 0x8016
/* 017F30 80017330 00004810 */ mfhi $t1
/* 017F34 80017334 25CE4550 */ addiu $t6, %lo(D_80164550) # addiu $t6, $t6, 0x4550
/* 017F34 80017334 25CE4550 */ addiu $t6, %lo(gTrackPaths) # 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
@@ -270,10 +270,10 @@ glabel func_80017054
/* 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
/* 018028 80017428 0C002EF6 */ jal set_track_offset_position
/* 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
/* 018030 80017430 3C038016 */ lui $v1, %hi(gOffsetPosition) # $v1, 0x8016
/* 018034 80017434 24632FA0 */ addiu $v1, %lo(gOffsetPosition) # addiu $v1, $v1, 0x2fa0
/* 018038 80017438 C4660000 */ lwc1 $f6, ($v1)
/* 01803C 8001743C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000
/* 018040 80017440 44810800 */ mtc1 $at, $f1
@@ -290,10 +290,10 @@ glabel func_80017054
/* 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
/* 018078 80017478 0C002EF6 */ jal set_track_offset_position
/* 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
/* 018080 80017480 3C038016 */ lui $v1, %hi(gOffsetPosition) # $v1, 0x8016
/* 018084 80017484 24632FA0 */ addiu $v1, %lo(gOffsetPosition) # addiu $v1, $v1, 0x2fa0
/* 018088 80017488 C4640000 */ lwc1 $f4, ($v1)
/* 01808C 8001748C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000
/* 018090 80017490 44810800 */ mtc1 $at, $f1
@@ -23,14 +23,14 @@ glabel D_800ECFC8
.section .text
glabel func_80009B60
glabel update_player
/* 00A760 80009B60 3C0E800E */ lui $t6, %hi(gCurrentCourseId)
/* 00A764 80009B64 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6)
/* 00A768 80009B68 3C01800E */ lui $at, %hi(gKartAICourseMaximumSeparation)
/* 00A768 80009B68 3C01800E */ lui $at, %hi(cpu_CourseMaximumSeparation)
/* 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)
/* 00A778 80009B78 C424CA4C */ lwc1 $f4, %lo(cpu_CourseMaximumSeparation)($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
@@ -42,8 +42,8 @@ glabel func_80009B60
/* 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
/* 00A7A8 80009BA8 3C088016 */ lui $t0, %hi(gIncrementUpdatePlayer) # $t0, 0x8016
/* 00A7AC 80009BAC 25083378 */ addiu $t0, %lo(gIncrementUpdatePlayer) # addiu $t0, $t0, 0x3378
/* 00A7B0 80009BB0 256C0001 */ addiu $t4, $t3, 1
/* 00A7B4 80009BB4 1480000B */ bnez $a0, .L80009BE4
/* 00A7B8 80009BB8 AC4C0000 */ sw $t4, ($v0)
@@ -76,10 +76,10 @@ glabel func_80009B60
/* 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
/* 00A82C 80009C2C 3C018016 */ lui $at, %hi(gNumPathPointsTraversed) # 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)
/* 00A838 80009C38 AC2F4450 */ sw $t7, %lo(gNumPathPointsTraversed)($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)
@@ -146,16 +146,16 @@ glabel func_80009B60
/* 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
/* 00A930 80009D30 3C028016 */ lui $v0, %hi(gPlayerPathIndex) # $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
/* 00A940 80009D40 24423448 */ addiu $v0, %lo(gPlayerPathIndex) # 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
/* 00A954 80009D54 0C002370 */ jal set_current_path
/* 00A958 80009D58 AC440000 */ sw $a0, ($v0)
/* 00A95C 80009D5C 3C02800E */ lui $v0, %hi(gCurrentCourseId)
/* 00A960 80009D60 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0)
@@ -171,7 +171,7 @@ glabel func_80009B60
/* 00A988 80009D88 1000001A */ b .L80009DF4
/* 00A98C 80009D8C 8FA50040 */ lw $a1, 0x40($sp)
.L80009D90:
/* 00A990 80009D90 0C004B70 */ jal func_80012DC0
/* 00A990 80009D90 0C004B70 */ jal handle_trains_interactions
/* 00A994 80009D94 8FA50040 */ lw $a1, 0x40($sp)
/* 00A998 80009D98 8FAC00D0 */ lw $t4, 0xd0($sp)
/* 00A99C 80009D9C 55800015 */ bnel $t4, $zero, .L80009DF4
@@ -181,21 +181,21 @@ glabel func_80009B60
/* 00A9AC 80009DAC 10000011 */ b .L80009DF4
/* 00A9B0 80009DB0 8FA50040 */ lw $a1, 0x40($sp)
.L80009DB4:
/* 00A9B4 80009DB4 0C004E15 */ jal func_80013854
/* 00A9B4 80009DB4 0C004E15 */ jal handle_paddleBoats_interactions
/* 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
/* 00A9C4 80009DC4 0C005231 */ jal handle_box_trucks_interactions
/* 00A9C8 80009DC8 8FA50040 */ lw $a1, 0x40($sp)
/* 00A9CC 80009DCC 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00A9D0 80009DD0 0C005286 */ jal func_80014A18
/* 00A9D0 80009DD0 0C005286 */ jal handle_school_buses_interactions
/* 00A9D4 80009DD4 8FA50040 */ lw $a1, 0x40($sp)
/* 00A9D8 80009DD8 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00A9DC 80009DDC 0C0052DB */ jal func_80014B6C
/* 00A9DC 80009DDC 0C0052DB */ jal handle_tanker_trucks_interactions
/* 00A9E0 80009DE0 8FA50040 */ lw $a1, 0x40($sp)
/* 00A9E4 80009DE4 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00A9E8 80009DE8 0C005330 */ jal func_80014CC0
/* 00A9E8 80009DE8 0C005330 */ jal handle_cars_interactions
/* 00A9EC 80009DEC 8FA50040 */ lw $a1, 0x40($sp)
/* 00A9F0 80009DF0 8FA50040 */ lw $a1, 0x40($sp)
.L80009DF4:
@@ -212,7 +212,7 @@ glabel func_80009B60
/* 00AA1C 80009E1C ACB800BC */ sw $t8, 0xbc($a1)
/* 00AA20 80009E20 A4AA0044 */ sh $t2, 0x44($a1)
.L80009E24:
/* 00AA24 80009E24 0C0024A7 */ jal func_8000929C
/* 00AA24 80009E24 0C0024A7 */ jal update_player_path_completion
/* 00AA28 80009E28 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00AA2C 80009E2C 3C0B800E */ lui $t3, %hi(gCurrentCourseId)
/* 00AA30 80009E30 856BC5A0 */ lh $t3, %lo(gCurrentCourseId)($t3)
@@ -234,12 +234,12 @@ glabel func_80009B60
.L80009E6C:
/* 00AA6C 80009E6C 8FAF0040 */ lw $t7, 0x40($sp)
.L80009E70:
/* 00AA70 80009E70 3C0A8016 */ lui $t2, %hi(D_801630E2) # $t2, 0x8016
/* 00AA70 80009E70 3C0A8016 */ lui $t2, %hi(gIsPlayerNewPathPoint) # $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)
/* 00AA84 80009E84 854A30E2 */ lh $t2, %lo(gIsPlayerNewPathPoint)($t2)
/* 00AA88 80009E88 24010001 */ li $at, 1
/* 00AA8C 80009E8C 15410007 */ bne $t2, $at, .L80009EAC
/* 00AA90 80009E90 3C0B800E */ lui $t3, %hi(gCurrentCourseId)
@@ -247,21 +247,21 @@ glabel func_80009B60
/* 00AA98 80009E98 24010014 */ li $at, 20
/* 00AA9C 80009E9C 11610003 */ beq $t3, $at, .L80009EAC
/* 00AAA0 80009EA0 00000000 */ nop
/* 00AAA4 80009EA4 0C00478E */ jal kart_ai_behaviour
/* 00AAA4 80009EA4 0C00478E */ jal cpu_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)
/* 00AAAC 80009EAC 3C0E8016 */ lui $t6, %hi(gIncrementUpdatePlayer) # $t6, 0x8016
/* 00AAB0 80009EB0 8DCE3378 */ lw $t6, %lo(gIncrementUpdatePlayer)($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
/* 00AAC8 80009EC8 0C006B04 */ jal cpu_use_item_strategy
/* 00AACC 80009ECC 01802025 */ move $a0, $t4
.L80009ED0:
/* 00AAD0 80009ED0 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00AAD4 80009ED4 0C00267B */ jal func_800099EC
/* 00AAD4 80009ED4 0C00267B */ jal update_player_timer_sound
/* 00AAD8 80009ED8 8FA50040 */ lw $a1, 0x40($sp)
/* 00AADC 80009EDC 3C02800E */ lui $v0, %hi(gModeSelection)
/* 00AAE0 80009EE0 8C42C53C */ lw $v0, %lo(gModeSelection)($v0)
@@ -317,42 +317,42 @@ glabel func_80009B60
/* 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)
/* 00ABA0 80009FA0 3C018016 */ lui $at, %hi(gPlayerTrackPositionFactorInstruction + 4)
/* 00ABA4 80009FA4 002B0821 */ addu $at, $at, $t3
/* 00ABA8 80009FA8 E43034FC */ swc1 $f16, %lo(D_801634F8 + 4)($at)
/* 00ABA8 80009FA8 E43034FC */ swc1 $f16, %lo(gPlayerTrackPositionFactorInstruction + 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)
/* 00ABB4 80009FB4 3C018016 */ lui $at, %hi(gPlayerTrackPositionFactorInstruction + 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)
/* 00ABC0 80009FC0 E4323504 */ swc1 $f18, %lo(gPlayerTrackPositionFactorInstruction + 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
/* 00ABC4 80009FC4 3C028016 */ lui $v0, %hi(gPlayerPathIndex) # $v0, 0x8016
/* 00ABC8 80009FC8 8C423448 */ lw $v0, %lo(gPlayerPathIndex)($v0)
/* 00ABCC 80009FCC 3C0A8016 */ lui $t2, %hi(gPlayerPathY) # $t2, 0x8016
/* 00ABD0 80009FD0 254A4510 */ addiu $t2, %lo(gPlayerPathY) # addiu $t2, $t2, 0x4510
/* 00ABD4 80009FD4 1840000A */ blez $v0, .L8000A000
/* 00ABD8 80009FD8 3C0B8016 */ lui $t3, %hi(gNearestWaypointByPlayerId) # $t3, 0x8016
/* 00ABD8 80009FD8 3C0B8016 */ lui $t3, %hi(gNearestPathPointByPlayerId) # $t3, 0x8016
/* 00ABDC 80009FDC 8FAD00D0 */ lw $t5, 0xd0($sp)
/* 00ABE0 80009FE0 3C188016 */ lui $t8, %hi(D_801634F8) # $t8, 0x8016
/* 00ABE0 80009FE0 3C188016 */ lui $t8, %hi(gPlayerTrackPositionFactorInstruction) # $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
/* 00ABEC 80009FEC 271834F8 */ addiu $t8, %lo(gPlayerTrackPositionFactorInstruction) # 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
/* 00AC00 8000A000 256B4438 */ addiu $t3, %lo(gNearestPathPointByPlayerId) # 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
/* 00AC14 8000A014 3C0D8016 */ lui $t5, %hi(gTrackPaths) # 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)
/* 00AC20 8000A020 8DAD4550 */ lw $t5, %lo(gTrackPaths)($t5) # 0x4550($t5)
/* 00AC24 8000A024 032A3021 */ addu $a2, $t9, $t2
/* 00AC28 8000A028 0018C8C0 */ sll $t9, $t8, 3
/* 00AC2C 8000A02C 01B95021 */ addu $t2, $t5, $t9
@@ -410,18 +410,18 @@ glabel func_80009B60
/* 00ACEC 8000A0EC 00602025 */ move $a0, $v1
.L8000A0F0:
/* 00ACF0 8000A0F0 44803000 */ mtc1 $zero, $f6
/* 00ACF4 8000A0F4 3C018016 */ lui $at, %hi(D_801634F8 + 4)
/* 00ACF4 8000A0F4 3C018016 */ lui $at, %hi(gPlayerTrackPositionFactorInstruction + 4)
/* 00ACF8 8000A0F8 00390821 */ addu $at, $at, $t9
/* 00ACFC 8000A0FC 1000000D */ b .L8000A134
/* 00AD00 8000A100 E42634FC */ swc1 $f6, %lo(D_801634F8 + 4)($at)
/* 00AD00 8000A100 E42634FC */ swc1 $f6, %lo(gPlayerTrackPositionFactorInstruction + 4)($at)
.L8000A104:
/* 00AD04 8000A104 0C005243 */ jal func_8001490C
/* 00AD04 8000A104 0C005243 */ jal update_player_track_position_factor_from_box_trucks
/* 00AD08 8000A108 AFA5002C */ sw $a1, 0x2c($sp)
/* 00AD0C 8000A10C 0C005298 */ jal func_80014A60
/* 00AD0C 8000A10C 0C005298 */ jal update_player_track_position_factor_from_buses
/* 00AD10 8000A110 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00AD14 8000A114 0C0052ED */ jal func_80014BB4
/* 00AD14 8000A114 0C0052ED */ jal update_player_track_position_factor_from_tanker_truck
/* 00AD18 8000A118 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00AD1C 8000A11C 0C005342 */ jal func_80014D08
/* 00AD1C 8000A11C 0C005342 */ jal update_player_track_position_factor_from_cars
/* 00AD20 8000A120 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00AD24 8000A124 8FA5002C */ lw $a1, 0x2c($sp)
/* 00AD28 8000A128 24090001 */ li $t1, 1
@@ -436,23 +436,23 @@ glabel func_80009B60
/* 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
/* 00AD54 8000A154 3C0F8016 */ lui $t7, %hi(gIncrementUpdatePlayer) # $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)
/* 00AD60 8000A160 8DEF3378 */ lw $t7, %lo(gIncrementUpdatePlayer)($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
/* 00AD78 8000A178 0C00DA03 */ jal apply_cpu_turn
/* 00AD7C 8000A17C 00002825 */ move $a1, $zero
/* 00AD80 8000A180 8FAD0038 */ lw $t5, 0x38($sp)
/* 00AD84 8000A184 3C058016 */ lui $a1, %hi(D_80163210) # 0x8016
/* 00AD84 8000A184 3C058016 */ lui $a1, %hi(gPreviousCpuTargetSpeed) # 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
/* 00AD90 8000A190 8CA53210 */ lw $a1, %lo(gPreviousCpuTargetSpeed)($a1) # 0x3210($a1)
/* 00AD94 8000A194 0C002109 */ jal regulate_cpu_speed
/* 00AD98 8000A198 8FA60040 */ lw $a2, 0x40($sp)
/* 00AD9C 8000A19C 100003E5 */ b .L8000B134
/* 00ADA0 8000A1A0 8FBF0014 */ lw $ra, 0x14($sp)
@@ -472,8 +472,8 @@ glabel func_80009B60
/* 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
/* 00ADE0 8000A1E0 3C0C8016 */ lui $t4, %hi(gPreviousCpuTargetSpeed) # $t4, 0x8016
/* 00ADE4 8000A1E4 258C3210 */ addiu $t4, %lo(gPreviousCpuTargetSpeed) # 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
@@ -491,8 +491,8 @@ glabel func_80009B60
/* 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
/* 00AE28 8000A228 3C0A8016 */ lui $t2, %hi(gPlayerTrackPositionFactorInstruction) # $t2, 0x8016
/* 00AE2C 8000A22C 254A34F8 */ addiu $t2, %lo(gPlayerTrackPositionFactorInstruction) # 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
@@ -503,21 +503,21 @@ glabel func_80009B60
/* 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
/* 00AE58 8000A258 3C0D8016 */ lui $t5, %hi(gPreviousCpuTargetSpeed) # $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
/* 00AE6C 8000A26C 25AD3210 */ addiu $t5, %lo(gPreviousCpuTargetSpeed) # 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)
/* 00AE80 8000A280 3C0F8016 */ lui $t7, %hi(sSomeNearestPathPoint) # $t7, 0x8016
/* 00AE84 8000A284 85EF2FCE */ lh $t7, %lo(sSomeNearestPathPoint)($t7)
/* 00AE88 8000A288 3C0B8016 */ lui $t3, %hi(gCurrentTrackConsecutiveCurveCountsPath) # $t3, 0x8016
/* 00AE8C 8000A28C 8D6B45E0 */ lw $t3, %lo(gCurrentTrackConsecutiveCurveCountsPath)($t3)
/* 00AE90 8000A290 000F7040 */ sll $t6, $t7, 1
/* 00AE94 8000A294 016E6021 */ addu $t4, $t3, $t6
/* 00AE98 8000A298 85980000 */ lh $t8, ($t4)
@@ -526,17 +526,17 @@ glabel func_80009B60
/* 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
/* 00AEB0 8000A2B0 3C0E0D01 */ lui $t6, %hi(cpu_CurveTargetSpeed) # $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
/* 00AEC0 8000A2C0 25CE9418 */ addiu $t6, %lo(cpu_CurveTargetSpeed) # 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
/* 00AED0 8000A2D0 3C188016 */ lui $t8, %hi(gPreviousCpuTargetSpeed) # $t8, 0x8016
/* 00AED4 8000A2D4 C4520000 */ lwc1 $f18, ($v0)
/* 00AED8 8000A2D8 27183210 */ addiu $t8, %lo(D_80163210) # addiu $t8, $t8, 0x3210
/* 00AED8 8000A2D8 27183210 */ addiu $t8, %lo(gPreviousCpuTargetSpeed) # addiu $t8, $t8, 0x3210
/* 00AEDC 8000A2DC 01984021 */ addu $t0, $t4, $t8
/* 00AEE0 8000A2E0 10000012 */ b .L8000A32C
/* 00AEE4 8000A2E4 E5120000 */ swc1 $f18, ($t0)
@@ -545,32 +545,32 @@ glabel func_80009B60
/* 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
/* 00AEF8 8000A2F8 3C0E0D01 */ lui $t6, %hi(cpu_NormalTargetSpeed) # $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
/* 00AF08 8000A308 25CE9568 */ addiu $t6, %lo(cpu_NormalTargetSpeed) # 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
/* 00AF1C 8000A31C 3C188016 */ lui $t8, %hi(gPreviousCpuTargetSpeed) # $t8, 0x8016
/* 00AF20 8000A320 27183210 */ addiu $t8, %lo(gPreviousCpuTargetSpeed) # 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
/* 00AF38 8000A338 0C0034EE */ jal cpu_track_position_factor
/* 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
/* 00AF40 8000A340 3C058016 */ lui $a1, %hi(gCurrentNearestPathPoint) # $a1, 0x8016
/* 00AF44 8000A344 94A530E0 */ lhu $a1, %lo(gCurrentNearestPathPoint)($a1)
/* 00AF48 8000A348 0C00350E */ jal determine_ideal_cpu_position_offset
/* 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
/* 00AF54 8000A354 3C078016 */ lui $a3, %hi(gOffsetPosition) # $a3, 0x8016
/* 00AF58 8000A358 24E72FA0 */ addiu $a3, %lo(gOffsetPosition) # addiu $a3, $a3, 0x2fa0
/* 00AF5C 8000A35C 8CC200BC */ lw $v0, 0xbc($a2)
/* 00AF60 8000A360 C4E80000 */ lwc1 $f8, ($a3)
/* 00AF64 8000A364 C4EA0008 */ lwc1 $f10, 8($a3)
@@ -590,17 +590,17 @@ glabel func_80009B60
/* 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
/* 00AFA8 8000A3A8 3C0B8016 */ lui $t3, %hi(gCurrentNearestPathPoint) # 0x8016
/* 00AFAC 8000A3AC 3C0C8016 */ lui $t4, %hi(gSelectedPathCount) # $t4, 0x8016
/* 00AFB0 8000A3B0 3C198016 */ lui $t9, %hi(gPlayerPathIndex) # 0x8016
/* 00AFB4 8000A3B4 3C0F8016 */ lui $t7, %hi(gPathExpectedRotation) # 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)
/* 00AFCC 8000A3CC 3C0F8016 */ lui $t7, %hi(gPlayerPathIndex) # $t7, 0x8016
/* 00AFD0 8000A3D0 8DEF3448 */ lw $t7, %lo(gPlayerPathIndex)($t7)
/* 00AFD4 8000A3D4 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00AFD8 8000A3D8 55E0002B */ bnel $t7, $zero, .L8000A488
/* 00AFDC 8000A3DC 8FA60040 */ lw $a2, 0x40($sp)
@@ -608,16 +608,16 @@ glabel func_80009B60
/* 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
/* 00AFF0 8000A3F0 3C078016 */ lui $a3, %hi(gOffsetPosition) # $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
/* 00AFFC 8000A3FC 24E72FA0 */ addiu $a3, %lo(gOffsetPosition) # 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)
/* 00B008 8000A408 3C048016 */ lui $a0, %hi(gCurrentNearestPathPoint) # $a0, 0x8016
/* 00B00C 8000A40C 948430E0 */ lhu $a0, %lo(gCurrentNearestPathPoint)($a0)
/* 00B010 8000A410 3C188016 */ lui $t8, %hi(gSelectedPathCount) # $t8, 0x8016
/* 00B014 8000A414 97184430 */ lhu $t8, %lo(gSelectedPathCount)($t8)
/* 00B018 8000A418 24840005 */ addiu $a0, $a0, 5
/* 00B01C 8000A41C 308CFFFF */ andi $t4, $a0, 0xffff
/* 00B020 8000A420 0198001A */ div $zero, $t4, $t8
@@ -637,15 +637,15 @@ glabel func_80009B60
/* 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
/* 00B05C 8000A45C 3C068016 */ lui $a2, %hi(gPlayerPathIndex + 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
/* 00B06C 8000A46C 84C6344A */ lh $a2, %lo(gPlayerPathIndex + 2)($a2)
/* 00B070 8000A470 0C002EF6 */ jal set_track_offset_position
/* 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
/* 00B078 8000A478 3C078016 */ lui $a3, %hi(gOffsetPosition) # $a3, 0x8016
/* 00B07C 8000A47C 24E72FA0 */ addiu $a3, %lo(gOffsetPosition) # addiu $a3, $a3, 0x2fa0
/* 00B080 8000A480 8FA8003C */ lw $t0, 0x3c($sp)
.L8000A484:
/* 00B084 8000A484 8FA60040 */ lw $a2, 0x40($sp)
@@ -660,14 +660,14 @@ glabel func_80009B60
/* 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)
/* 00B0AC 8000A4AC 956B30E0 */ lhu $t3, %lo(gCurrentNearestPathPoint)($t3) # 0x30e0($t3)
/* 00B0B0 8000A4B0 958C4430 */ lhu $t4, %lo(gSelectedPathCount)($t4)
/* 00B0B4 8000A4B4 8F393448 */ lw $t9, %lo(gPlayerPathIndex)($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)
/* 00B0C8 8000A4C8 8DEF4590 */ lw $t7, %lo(gPathExpectedRotation)($t7) # 0x4590($t7)
/* 00B0CC 8000A4CC 0000C010 */ mfhi $t8
/* 00B0D0 8000A4D0 00185040 */ sll $t2, $t8, 1
/* 00B0D4 8000A4D4 15800002 */ bnez $t4, .L8000A4E0
@@ -688,12 +688,12 @@ glabel func_80009B60
/* 00B104 8000A504 00C02025 */ move $a0, $a2
.L8000A508:
/* 00B108 8000A508 00002825 */ move $a1, $zero
/* 00B10C 8000A50C 0C00DA03 */ jal func_8003680C
/* 00B10C 8000A50C 0C00DA03 */ jal apply_cpu_turn
/* 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
/* 00B120 8000A520 0C002109 */ jal regulate_cpu_speed
/* 00B124 8000A524 8D050000 */ lw $a1, ($t0)
/* 00B128 8000A528 10000302 */ b .L8000B134
/* 00B12C 8000A52C 8FBF0014 */ lw $ra, 0x14($sp)
@@ -721,19 +721,19 @@ glabel func_80009B60
/* 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
/* 00B184 8000A584 3C188016 */ lui $t8, %hi(sPlayerAngle) # $t8, 0x8016
/* 00B188 8000A588 27183300 */ addiu $t8, %lo(sPlayerAngle) # 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)
/* 00B198 8000A598 3C0F8016 */ lui $t7, %hi(sSomeNearestPathPoint) # $t7, 0x8016
/* 00B19C 8000A59C 85EF2FCE */ lh $t7, %lo(sSomeNearestPathPoint)($t7)
/* 00B1A0 8000A5A0 3C0D8016 */ lui $t5, %hi(gSelectedPathCount) # $t5, 0x8016
/* 00B1A4 8000A5A4 95AD4430 */ lhu $t5, %lo(gSelectedPathCount)($t5)
/* 00B1A8 8000A5A8 25EA0002 */ addiu $t2, $t7, 2
/* 00B1AC 8000A5AC 3C0C8016 */ lui $t4, %hi(D_801631DC) # $t4, 0x8016
/* 00B1AC 8000A5AC 3C0C8016 */ lui $t4, %hi(gCurrentPathPointExpectedRotationPath) # $t4, 0x8016
/* 00B1B0 8000A5B0 014D001A */ div $zero, $t2, $t5
/* 00B1B4 8000A5B4 8D8C31DC */ lw $t4, %lo(D_801631DC)($t4)
/* 00B1B4 8000A5B4 8D8C31DC */ lw $t4, %lo(gCurrentPathPointExpectedRotationPath)($t4)
/* 00B1B8 8000A5B8 00005810 */ mfhi $t3
/* 00B1BC 8000A5BC 000B7040 */ sll $t6, $t3, 1
/* 00B1C0 8000A5C0 018EC021 */ addu $t8, $t4, $t6
@@ -870,43 +870,43 @@ glabel func_80009B60
/* 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)
/* 00B398 8000A798 3C0B8016 */ lui $t3, %hi(gIncrementUpdatePlayer) # $t3, 0x8016
/* 00B39C 8000A79C 8D6B3378 */ lw $t3, %lo(gIncrementUpdatePlayer)($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
/* 00B3B8 8000A7B8 3C058016 */ lui $a1, %hi(gPreviousAngleSteering) # 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)
/* 00B3C4 8000A7C4 0C00DA03 */ jal apply_cpu_turn
/* 00B3C8 8000A7C8 84A53050 */ lh $a1, %lo(gPreviousAngleSteering)($a1) # 0x3050($a1)
/* 00B3CC 8000A7CC 8FAE0038 */ lw $t6, 0x38($sp)
/* 00B3D0 8000A7D0 3C058016 */ lui $a1, %hi(D_80163210) # 0x8016
/* 00B3D0 8000A7D0 3C058016 */ lui $a1, %hi(gPreviousCpuTargetSpeed) # 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
/* 00B3DC 8000A7DC 8CA53210 */ lw $a1, %lo(gPreviousCpuTargetSpeed)($a1) # 0x3210($a1)
/* 00B3E0 8000A7E0 0C002109 */ jal regulate_cpu_speed
/* 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
/* 00B3F0 8000A7F0 3C058016 */ lui $a1, %hi(sSomeNearestPathPoint) # $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)
/* 00B3FC 8000A7FC 0C002DF9 */ jal are_in_curve
/* 00B400 8000A800 94A52FCE */ lhu $a1, %lo(sSomeNearestPathPoint)($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
/* 00B408 8000A808 3C0B8016 */ lui $t3, %hi(gIsPlayerInCurve) # $t3, 0x8016
/* 00B40C 8000A80C 256B30B8 */ addiu $t3, %lo(gIsPlayerInCurve) # 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)
/* 00B418 8000A818 3C058016 */ lui $a1, %hi(sSomeNearestPathPoint) # $a1, 0x8016
/* 00B41C 8000A81C 94A52FCE */ lhu $a1, %lo(sSomeNearestPathPoint)($a1)
/* 00B420 8000A820 AFA30028 */ sw $v1, 0x28($sp)
/* 00B424 8000A824 0C00350E */ jal func_8000D438
/* 00B424 8000A824 0C00350E */ jal determine_ideal_cpu_position_offset
/* 00B428 8000A828 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00B42C 8000A82C 3C02800E */ lui $v0, %hi(gCurrentCourseId)
/* 00B430 8000A830 8442C5A0 */ lh $v0, %lo(gCurrentCourseId)($v0)
@@ -914,17 +914,17 @@ glabel func_80009B60
/* 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
/* 00B444 8000A844 3C058016 */ lui $a1, %hi(gNumPathPointsTraversed) # 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
/* 00B44C 8000A84C 8CA54450 */ lw $a1, %lo(gNumPathPointsTraversed)($a1) # 0x4450($a1)
/* 00B450 8000A850 3C198016 */ lui $t9, %hi(gPlayerTrackPositionFactorInstruction) # $t9, 0x8016
/* 00B454 8000A854 273934F8 */ addiu $t9, %lo(gPlayerTrackPositionFactorInstruction) # 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)
/* 00B468 8000A868 3C048016 */ lui $a0, %hi(gCurrentNearestPathPoint) # $a0, 0x8016
/* 00B46C 8000A86C 948430E0 */ lhu $a0, %lo(gCurrentNearestPathPoint)($a0)
/* 00B470 8000A870 000CC100 */ sll $t8, $t4, 4
/* 00B474 8000A874 18A0001F */ blez $a1, .L8000A8F4
/* 00B478 8000A878 03191821 */ addu $v1, $t8, $t9
@@ -933,8 +933,8 @@ glabel func_80009B60
/* 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)
/* 00B490 8000A890 3C0A8016 */ lui $t2, %hi(gSelectedPathCount) # $t2, 0x8016
/* 00B494 8000A894 954A4430 */ lhu $t2, %lo(gSelectedPathCount)($t2)
/* 00B498 8000A898 01C02025 */ move $a0, $t6
/* 00B49C 8000A89C 24050000 */ li $a1, 0
/* 00B4A0 8000A8A0 01CA001A */ div $zero, $t6, $t2
@@ -953,7 +953,7 @@ glabel func_80009B60
/* 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
/* 00B4D8 8000A8D8 0C002EF6 */ jal set_track_offset_position
/* 00B4DC 8000A8DC AFA30030 */ sw $v1, 0x30($sp)
/* 00B4E0 8000A8E0 8FA30030 */ lw $v1, 0x30($sp)
/* 00B4E4 8000A8E4 44805000 */ mtc1 $zero, $f10
@@ -964,10 +964,10 @@ glabel func_80009B60
/* 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)
/* 00B4FC 8000A8FC 3C0B8016 */ lui $t3, %hi(gSelectedPathCount) # $t3, 0x8016
/* 00B500 8000A900 956B4430 */ lhu $t3, %lo(gSelectedPathCount)($t3)
/* 00B504 8000A904 01E02025 */ move $a0, $t7
/* 00B508 8000A908 3C188016 */ lui $t8, %hi(D_80163068) # $t8, 0x8016
/* 00B508 8000A908 3C188016 */ lui $t8, %hi(gTrackPositionFactor) # $t8, 0x8016
/* 00B50C 8000A90C 01EB001A */ div $zero, $t7, $t3
/* 00B510 8000A910 15600002 */ bnez $t3, .L8000A91C
/* 00B514 8000A914 00000000 */ nop
@@ -981,15 +981,15 @@ glabel func_80009B60
/* 00B530 8000A930 0006000D */ break 6
.L8000A934:
/* 00B534 8000A934 00002010 */ mfhi $a0
/* 00B538 8000A938 27183068 */ addiu $t8, %lo(D_80163068) # addiu $t8, $t8, 0x3068
/* 00B538 8000A938 27183068 */ addiu $t8, %lo(gTrackPositionFactor) # 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
/* 00B544 8000A944 3C068016 */ lui $a2, %hi(gPlayerPathIndex + 2) # $a2, 0x8016
/* 00B548 8000A948 01802025 */ move $a0, $t4
/* 00B54C 8000A94C 84C6344A */ lh $a2, %lo(D_80163448 + 2)($a2)
/* 00B54C 8000A94C 84C6344A */ lh $a2, %lo(gPlayerPathIndex + 2)($a2)
/* 00B550 8000A950 8D050000 */ lw $a1, ($t0)
/* 00B554 8000A954 AFA80020 */ sw $t0, 0x20($sp)
/* 00B558 8000A958 0C002EF6 */ jal func_8000BBD8
/* 00B558 8000A958 0C002EF6 */ jal set_track_offset_position
/* 00B55C 8000A95C AFA30030 */ sw $v1, 0x30($sp)
/* 00B560 8000A960 8FA80020 */ lw $t0, 0x20($sp)
/* 00B564 8000A964 8FA30030 */ lw $v1, 0x30($sp)
@@ -1005,12 +1005,12 @@ glabel func_80009B60
/* 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
/* 00B594 8000A994 3C0F8016 */ lui $t7, %hi(gSelectedPathCount) # $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)
/* 00B5A0 8000A9A0 3C048016 */ lui $a0, %hi(gCurrentNearestPathPoint) # $a0, 0x8016
/* 00B5A4 8000A9A4 948430E0 */ lhu $a0, %lo(gCurrentNearestPathPoint)($a0)
/* 00B5A8 8000A9A8 95EF4430 */ lhu $t7, %lo(gSelectedPathCount)($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
@@ -1029,14 +1029,14 @@ glabel func_80009B60
.L8000A9E4:
/* 00B5E4 8000A9E4 00002010 */ mfhi $a0
/* 00B5E8 8000A9E8 308BFFFF */ andi $t3, $a0, 0xffff
/* 00B5EC 8000A9EC 3C068016 */ lui $a2, %hi(D_80163448 + 2) # $a2, 0x8016
/* 00B5EC 8000A9EC 3C068016 */ lui $a2, %hi(gPlayerPathIndex + 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
/* 00B5F4 8000A9F4 84C6344A */ lh $a2, %lo(gPlayerPathIndex + 2)($a2)
/* 00B5F8 8000A9F8 0C002EF6 */ jal set_track_offset_position
/* 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)
/* 00B600 8000AA00 3C0C8016 */ lui $t4, %hi(gPlayerPathIndex) # $t4, 0x8016
/* 00B604 8000AA04 8D8C3448 */ lw $t4, %lo(gPlayerPathIndex)($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
@@ -1046,14 +1046,14 @@ glabel func_80009B60
/* 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
/* 00B62C 8000AA2C 3C0B8016 */ lui $t3, %hi(gSelectedPathCount) # $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)
/* 00B640 8000AA40 3C048016 */ lui $a0, %hi(gCurrentNearestPathPoint) # $a0, 0x8016
/* 00B644 8000AA44 948430E0 */ lhu $a0, %lo(gCurrentNearestPathPoint)($a0)
/* 00B648 8000AA48 956B4430 */ lhu $t3, %lo(gSelectedPathCount)($t3)
/* 00B64C 8000AA4C 3C058016 */ lui $a1, %hi(D_80163090) # 0x8016
/* 00B650 8000AA50 24840005 */ addiu $a0, $a0, 5
/* 00B654 8000AA54 308FFFFF */ andi $t7, $a0, 0xffff
@@ -1073,17 +1073,17 @@ glabel func_80009B60
/* 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
/* 00B690 8000AA90 3C068016 */ lui $a2, %hi(gPlayerPathIndex + 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
/* 00B698 8000AA98 84C6344A */ lh $a2, %lo(gPlayerPathIndex + 2)($a2)
/* 00B69C 8000AA9C 0C002EF6 */ jal set_track_offset_position
/* 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
/* 00B6B0 8000AAB0 3C198016 */ lui $t9, %hi(gTrackPositionFactor) # $t9, 0x8016
/* 00B6B4 8000AAB4 27393068 */ addiu $t9, %lo(gTrackPositionFactor) # addiu $t9, $t9, 0x3068
/* 00B6B8 8000AAB8 24010014 */ li $at, 20
/* 00B6BC 8000AABC 15C10038 */ bne $t6, $at, .L8000ABA0
/* 00B6C0 8000AAC0 01394021 */ addu $t0, $t1, $t9
@@ -1092,8 +1092,8 @@ glabel func_80009B60
/* 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
/* 00B6D8 8000AAD8 3C078016 */ lui $a3, %hi(gOffsetPosition) # $a3, 0x8016
/* 00B6DC 8000AADC 24E72FA0 */ addiu $a3, %lo(gOffsetPosition) # addiu $a3, $a3, 0x2fa0
/* 00B6E0 8000AAE0 10410005 */ beq $v0, $at, .L8000AAF8
/* 00B6E4 8000AAE4 24010004 */ li $at, 4
/* 00B6E8 8000AAE8 1041000C */ beq $v0, $at, .L8000AB1C
@@ -1112,21 +1112,21 @@ glabel func_80009B60
/* 00B718 8000AB18 E4E60008 */ swc1 $f6, 8($a3)
.L8000AB1C:
/* 00B71C 8000AB1C 8FAC0034 */ lw $t4, 0x34($sp)
/* 00B720 8000AB20 3C188016 */ lui $t8, %hi(gWaypointCountByPathIndex) # 0x8016
/* 00B720 8000AB20 3C188016 */ lui $t8, %hi(gPathCountByPathIndex) # 0x8016
/* 00B724 8000AB24 95AF0000 */ lhu $t7, ($t5)
/* 00B728 8000AB28 030CC021 */ addu $t8, $t8, $t4
/* 00B72C 8000AB2C 971845C8 */ lhu $t8, %lo(gWaypointCountByPathIndex)($t8) # 0x45c8($t8)
/* 00B72C 8000AB2C 971845C8 */ lhu $t8, %lo(gPathCountByPathIndex)($t8) # 0x45c8($t8)
/* 00B730 8000AB30 25EB000A */ addiu $t3, $t7, 0xa
/* 00B734 8000AB34 3C0A8016 */ lui $t2, %hi(D_80164550) # 0x8016
/* 00B734 8000AB34 3C0A8016 */ lui $t2, %hi(gTrackPaths) # 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)
/* 00B740 8000AB40 8D4A4550 */ lw $t2, %lo(gTrackPaths)($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
/* 00B754 8000AB54 3C078016 */ lui $a3, %hi(gOffsetPosition) # $a3, 0x8016
/* 00B758 8000AB58 24E72FA0 */ addiu $a3, %lo(gOffsetPosition) # addiu $a3, $a3, 0x2fa0
/* 00B75C 8000AB5C 448D9000 */ mtc1 $t5, $f18
/* 00B760 8000AB60 17000002 */ bnez $t8, .L8000AB6C
/* 00B764 8000AB64 00000000 */ nop
@@ -1147,18 +1147,18 @@ glabel func_80009B60
/* 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
/* 00B7A0 8000ABA0 3C0C8016 */ lui $t4, %hi(gPreviousPlayerAiOffsetX) # $t4, 0x8016
/* 00B7A4 8000ABA4 3C078016 */ lui $a3, %hi(gOffsetPosition) # 0x8016
/* 00B7A8 8000ABA8 258C3178 */ addiu $t4, %lo(gPreviousPlayerAiOffsetX) # addiu $t4, $t4, 0x3178
/* 00B7AC 8000ABAC 24E52FA0 */ addiu $a1, $a3, %lo(gOffsetPosition) # 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
/* 00B7C8 8000ABC8 3C0B8016 */ lui $t3, %hi(gPreviousPlayerAiOffsetZ) # $t3, 0x8016
/* 00B7CC 8000ABCC 256B31A0 */ addiu $t3, %lo(gPreviousPlayerAiOffsetZ) # 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)
@@ -1195,7 +1195,7 @@ glabel func_80009B60
/* 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)
/* 00B860 8000AC60 3C03800E */ lui $v1, %hi(cpu_SteeringSensitivity)
/* 00B864 8000AC64 00057C00 */ sll $t7, $a1, 0x10
/* 00B868 8000AC68 44023000 */ mfc1 $v0, $f6
/* 00B86C 8000AC6C 000F6403 */ sra $t4, $t7, 0x10
@@ -1209,12 +1209,12 @@ glabel func_80009B60
/* 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
/* 00B894 8000AC94 3C188016 */ lui $t8, %hi(gCurrentTrackSectionTypesPath) # $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)
/* 00B8A4 8000ACA4 8F1831D8 */ lw $t8, %lo(gCurrentTrackSectionTypesPath)($t8)
/* 00B8A8 8000ACA8 8FB90034 */ lw $t9, 0x34($sp)
/* 00B8AC 8000ACAC 856BC5A0 */ lh $t3, %lo(gCurrentCourseId)($t3)
/* 00B8B0 8000ACB0 24010002 */ li $at, 2
@@ -1223,7 +1223,7 @@ glabel func_80009B60
/* 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)
/* 00B8C8 8000ACC8 8463CA20 */ lh $v1, %lo(cpu_SteeringSensitivity)($v1)
/* 00B8CC 8000ACCC 24010003 */ li $at, 3
/* 00B8D0 8000ACD0 50410014 */ beql $v0, $at, .L8000AD24
/* 00B8D4 8000ACD4 3C013F00 */ lui $at, 0x3f00
@@ -1267,10 +1267,10 @@ glabel func_80009B60
.L8000AD5C:
/* 00B95C 8000AD5C 8FAA0034 */ lw $t2, 0x34($sp)
.L8000AD60:
/* 00B960 8000AD60 3C0D8016 */ lui $t5, %hi(gKartAIBehaviourState) # 0x8016
/* 00B960 8000AD60 3C0D8016 */ lui $t5, %hi(cpu_BehaviourState) # 0x8016
/* 00B964 8000AD64 24010002 */ li $at, 2
/* 00B968 8000AD68 01AA6821 */ addu $t5, $t5, $t2
/* 00B96C 8000AD6C 95AD32E8 */ lhu $t5, %lo(gKartAIBehaviourState)($t5) # 0x32e8($t5)
/* 00B96C 8000AD6C 95AD32E8 */ lhu $t5, %lo(cpu_BehaviourState)($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)
@@ -1309,8 +1309,8 @@ glabel func_80009B60
/* 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
/* 00B9FC 8000ADFC 3C0A8016 */ lui $t2, %hi(gPreviousAngleSteering) # $t2, 0x8016
/* 00BA00 8000AE00 254A3050 */ addiu $t2, %lo(gPreviousAngleSteering) # 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
@@ -1331,13 +1331,13 @@ glabel func_80009B60
/* 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
/* 00BA50 8000AE50 3C0E8016 */ lui $t6, %hi(gPreviousAngleSteering) # $t6, 0x8016
/* 00BA54 8000AE54 25CE3050 */ addiu $t6, %lo(gPreviousAngleSteering) # 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
/* 00BA60 8000AE60 3C0D8016 */ lui $t5, %hi(gPreviousAngleSteering) # $t5, 0x8016
/* 00BA64 8000AE64 25AD3050 */ addiu $t5, %lo(gPreviousAngleSteering) # 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
@@ -1347,16 +1347,16 @@ glabel func_80009B60
/* 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
/* 00BA88 8000AE88 3C0C8016 */ lui $t4, %hi(gPreviousAngleSteering) # $t4, 0x8016
/* 00BA8C 8000AE8C 258C3050 */ addiu $t4, %lo(gPreviousAngleSteering) # 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
/* 00BAA4 8000AEA4 3C198016 */ lui $t9, %hi(gPreviousAngleSteering) # $t9, 0x8016
/* 00BAA8 8000AEA8 27393050 */ addiu $t9, %lo(gPreviousAngleSteering) # 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
@@ -1378,7 +1378,7 @@ glabel func_80009B60
/* 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
/* 00BAFC 8000AEFC 0C00DA03 */ jal apply_cpu_turn
/* 00BB00 8000AF00 AFA80020 */ sw $t0, 0x20($sp)
/* 00BB04 8000AF04 8FA2003C */ lw $v0, 0x3c($sp)
/* 00BB08 8000AF08 87A50094 */ lh $a1, 0x94($sp)
@@ -1406,18 +1406,18 @@ glabel func_80009B60
/* 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
/* 00BB68 8000AF68 3C0E0D01 */ lui $t6, %hi(cpu_CurveTargetSpeed) # $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
/* 00BB78 8000AF78 25CE9418 */ addiu $t6, %lo(cpu_CurveTargetSpeed) # 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
/* 00BB8C 8000AF8C 3C0D8016 */ lui $t5, %hi(cpu_TargetSpeed) # $t5, 0x8016
/* 00BB90 8000AF90 C4440000 */ lwc1 $f4, ($v0)
/* 00BB94 8000AF94 25AD3028 */ addiu $t5, %lo(D_80163028) # addiu $t5, $t5, 0x3028
/* 00BB94 8000AF94 25AD3028 */ addiu $t5, %lo(cpu_TargetSpeed) # addiu $t5, $t5, 0x3028
/* 00BB98 8000AF98 014D1821 */ addu $v1, $t2, $t5
/* 00BB9C 8000AF9C 8FA80020 */ lw $t0, 0x20($sp)
/* 00BBA0 8000AFA0 10000014 */ b .L8000AFF4
@@ -1427,18 +1427,18 @@ glabel func_80009B60
/* 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
/* 00BBB8 8000AFB8 3C0E0D01 */ lui $t6, %hi(cpu_NormalTargetSpeed) # $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
/* 00BBC8 8000AFC8 25CE9568 */ addiu $t6, %lo(cpu_NormalTargetSpeed) # 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
/* 00BBE0 8000AFE0 3C0D8016 */ lui $t5, %hi(cpu_TargetSpeed) # $t5, 0x8016
/* 00BBE4 8000AFE4 25AD3028 */ addiu $t5, %lo(cpu_TargetSpeed) # addiu $t5, $t5, 0x3028
/* 00BBE8 8000AFE8 014D1821 */ addu $v1, $t2, $t5
/* 00BBEC 8000AFEC 8FA80020 */ lw $t0, 0x20($sp)
/* 00BBF0 8000AFF0 E46A0000 */ swc1 $f10, ($v1)
@@ -1446,10 +1446,10 @@ glabel func_80009B60
/* 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
/* 00BC00 8000B000 3C0E0D01 */ lui $t6, %hi(cpu_OffTrackTargetSpeed) # $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
/* 00BC0C 8000B00C 25CE9808 */ addiu $t6, %lo(cpu_OffTrackTargetSpeed) # addiu $t6, $t6, -0x67f8
/* 00BC10 8000B010 3C0F800E */ lui $t7, %hi(gCurrentCourseId)
/* 00BC14 8000B014 3C0C800E */ lui $t4, %hi(gCCSelection)
/* 00BC18 8000B018 45010006 */ bc1t .L8000B034
@@ -1507,8 +1507,8 @@ glabel func_80009B60
.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
/* 00BCE0 8000B0E0 3C028016 */ lui $v0, %hi(gCurrentCpuTargetSpeed) # $v0, 0x8016
/* 00BCE4 8000B0E4 2442320C */ addiu $v0, %lo(gCurrentCpuTargetSpeed) # 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
@@ -1517,15 +1517,15 @@ glabel func_80009B60
/* 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)
/* 00BD08 8000B108 3C018016 */ lui $at, %hi(gPreviousCpuTargetSpeed)
/* 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)
/* 00BD18 8000B118 E4303210 */ swc1 $f16, %lo(gPreviousCpuTargetSpeed)($at)
/* 00BD1C 8000B11C 3C058016 */ lui $a1, %hi(gCurrentCpuTargetSpeed) # $a1, 0x8016
/* 00BD20 8000B120 8CA5320C */ lw $a1, %lo(gCurrentCpuTargetSpeed)($a1)
/* 00BD24 8000B124 8FA400D0 */ lw $a0, 0xd0($sp)
/* 00BD28 8000B128 0C002109 */ jal func_80008424
/* 00BD28 8000B128 0C002109 */ jal regulate_cpu_speed
/* 00BD2C 8000B12C 8FA60040 */ lw $a2, 0x40($sp)
.L8000B130:
/* 00BD30 8000B130 8FBF0014 */ lw $ra, 0x14($sp)
@@ -8,23 +8,23 @@ glabel D_800ECFAC
.section .text
glabel func_8000929C
glabel update_player_path_completion
/* 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
/* 009EB4 800092B4 3C018016 */ lui $at, %hi(gIsPlayerNewPathPoint) # $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)
/* 009EC0 800092C0 A42030E2 */ sh $zero, %lo(gIsPlayerNewPathPoint)($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
/* 009ECC 800092CC 3C0F8016 */ lui $t7, %hi(gNearestPathPointByPlayerId) # $t7, 0x8016
/* 009ED0 800092D0 3C188016 */ lui $t8, %hi(gPlayerPathIndex) # $t8, 0x8016
/* 009ED4 800092D4 8F183448 */ lw $t8, %lo(gPlayerPathIndex)($t8)
/* 009ED8 800092D8 25EF4438 */ addiu $t7, %lo(gNearestPathPointByPlayerId) # addiu $t7, $t7, 0x4438
/* 009EDC 800092DC 004F4021 */ addu $t0, $v0, $t7
/* 009EE0 800092E0 44060000 */ mfc1 $a2, $f0
/* 009EE4 800092E4 85070000 */ lh $a3, ($t0)
@@ -36,15 +36,15 @@ glabel func_8000929C
/* 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
/* 009F08 80009308 0C003349 */ jal update_player_path
/* 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
/* 009F10 80009310 3C058016 */ lui $a1, %hi(sSomeNearestPathPoint) # $a1, 0x8016
/* 009F14 80009314 24A52FCE */ addiu $a1, %lo(sSomeNearestPathPoint) # 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)
/* 009F24 80009324 3C018016 */ lui $at, %hi(gCurrentNearestPathPoint) # $at, 0x8016
/* 009F28 80009328 A42730E0 */ sh $a3, %lo(gCurrentNearestPathPoint)($at)
/* 009F2C 8000932C 95190000 */ lhu $t9, ($t0)
/* 009F30 80009330 8FA40050 */ lw $a0, 0x50($sp)
/* 009F34 80009334 C7AC004C */ lwc1 $f12, 0x4c($sp)
@@ -52,13 +52,13 @@ glabel func_8000929C
/* 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)
/* 009F48 80009348 3C018016 */ lui $at, %hi(gIsPlayerNewPathPoint) # $at, 0x8016
/* 009F4C 8000934C A42930E2 */ sh $t1, %lo(gIsPlayerNewPathPoint)($at)
/* 009F50 80009350 AFA40050 */ sw $a0, 0x50($sp)
/* 009F54 80009354 0C0023CE */ jal func_80008F38
/* 009F54 80009354 0C0023CE */ jal update_player_completion
/* 009F58 80009358 E7AC004C */ swc1 $f12, 0x4c($sp)
/* 009F5C 8000935C 3C078016 */ lui $a3, %hi(sSomeNearestWaypoint) # $a3, 0x8016
/* 009F60 80009360 84E72FCE */ lh $a3, %lo(sSomeNearestWaypoint)($a3)
/* 009F5C 8000935C 3C078016 */ lui $a3, %hi(sSomeNearestPathPoint) # $a3, 0x8016
/* 009F60 80009360 84E72FCE */ lh $a3, %lo(sSomeNearestPathPoint)($a3)
/* 009F64 80009364 8FA40050 */ lw $a0, 0x50($sp)
/* 009F68 80009368 C7AC004C */ lwc1 $f12, 0x4c($sp)
.L8000936C:
@@ -67,20 +67,20 @@ glabel func_8000929C
/* 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)
/* 009F80 80009380 3C068016 */ lui $a2, %hi(gPlayerPathIndex) # $a2, 0x8016
/* 009F84 80009384 0C002E57 */ jal update_player_position_factor
/* 009F88 80009388 8CC63448 */ lw $a2, %lo(gPlayerPathIndex)($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
/* 009F9C 8000939C 3C0A8016 */ lui $t2, %hi(gPlayerPathIndex) # $t2, 0x8016
/* 009FA0 800093A0 8D4A3448 */ lw $t2, %lo(gPlayerPathIndex)($t2)
/* 009FA4 800093A4 3C0C8016 */ lui $t4, %hi(gPathCountByPathIndex) # 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)
/* 009FB0 800093B0 958C45C8 */ lhu $t4, %lo(gPathCountByPathIndex)($t4) # 0x45c8($t4)
/* 009FB4 800093B4 258DFFEC */ addiu $t5, $t4, -0x14
/* 009FB8 800093B8 01A7082A */ slt $at, $t5, $a3
/* 009FBC 800093BC 14200002 */ bnez $at, .L800093C8
@@ -174,13 +174,13 @@ glabel func_8000929C
/* 00A100 80009500 24080001 */ li $t0, 1
/* 00A104 80009504 00043880 */ sll $a3, $a0, 2
.L80009508:
/* 00A108 80009508 3C018016 */ lui $at, %hi(D_80163450)
/* 00A108 80009508 3C018016 */ lui $at, %hi(gPreviousPlayerZ)
/* 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
/* 00A110 80009510 C4303450 */ lwc1 $f16, %lo(gPreviousPlayerZ)($at)
/* 00A114 80009514 3C018016 */ lui $at, %hi(gPathStartZ) # $at, 0x8016
/* 00A118 80009518 10600052 */ beqz $v1, .L80009664
/* 00A11C 8000951C E7B00038 */ swc1 $f16, 0x38($sp)
/* 00A120 80009520 C420344C */ lwc1 $f0, %lo(D_8016344C)($at)
/* 00A120 80009520 C420344C */ lwc1 $f0, %lo(gPathStartZ)($at)
/* 00A124 80009524 C7B20044 */ lwc1 $f18, 0x44($sp)
/* 00A128 80009528 C7A40038 */ lwc1 $f4, 0x38($sp)
/* 00A12C 8000952C 4600903E */ c.le.s $f18, $f0
@@ -202,9 +202,9 @@ glabel func_8000929C
/* 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
/* 00A178 80009578 3C0C8016 */ lui $t4, %hi(gGPCurrentRaceRankByPlayerIdDup) # 0x8016
/* 00A17C 8000957C 01876021 */ addu $t4, $t4, $a3
/* 00A180 80009580 8D8C4408 */ lw $t4, %lo(D_80164408)($t4) # 0x4408($t4)
/* 00A180 80009580 8D8C4408 */ lw $t4, %lo(gGPCurrentRaceRankByPlayerIdDup)($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
@@ -233,20 +233,20 @@ glabel func_8000929C
/* 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
/* 00A1E8 800095E8 0C0023CE */ jal update_player_completion
/* 00A1EC 800095EC AFA40050 */ sw $a0, 0x50($sp)
/* 00A1F0 800095F0 0C0046B9 */ jal reset_kart_ai_behaviour
/* 00A1F0 800095F0 0C0046B9 */ jal reset_cpu_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
/* 00A204 80009604 3C018016 */ lui $at, %hi(cpu_ItemStrategy + 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)
/* 00A21C 8000961C A42042DE */ sh $zero, %lo(cpu_ItemStrategy + 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)
@@ -266,8 +266,8 @@ glabel func_8000929C
/* 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)
/* 00A268 80009668 3C018016 */ lui $at, %hi(gPathStartZ) # $at, 0x8016
/* 00A26C 8000966C C420344C */ lwc1 $f0, %lo(gPathStartZ)($at)
/* 00A270 80009670 C7A60038 */ lwc1 $f6, 0x38($sp)
/* 00A274 80009674 C7A80044 */ lwc1 $f8, 0x44($sp)
/* 00A278 80009678 4600303E */ c.le.s $f6, $f0
@@ -283,26 +283,26 @@ glabel func_8000929C
/* 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
/* 00A2AC 800096AC 0C0023CE */ jal update_player_completion
/* 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)
/* 00A2C0 800096C0 3C018016 */ lui $at, %hi(gPreviousPlayerZ)
/* 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)
/* 00A2D0 800096D0 E42A3450 */ swc1 $f10, %lo(gPreviousPlayerZ)($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)
/* 00A2DC 800096DC 3C0F8016 */ lui $t7, %hi(gIsPlayerNewPathPoint) # $t7, 0x8016
/* 00A2E0 800096E0 85EF30E2 */ lh $t7, %lo(gIsPlayerNewPathPoint)($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
/* 00A2F0 800096F0 0C002400 */ jal yoshi_valley_cpu_path
/* 00A2F4 800096F4 AFA40050 */ sw $a0, 0x50($sp)
/* 00A2F8 800096F8 8FB80054 */ lw $t8, 0x54($sp)
/* 00A2FC 800096FC 8FA40050 */ lw $a0, 0x50($sp)
@@ -314,56 +314,56 @@ glabel func_8000929C
/* 00A314 80009714 51200005 */ beql $t1, $zero, .L8000972C
/* 00A318 80009718 8FAA0054 */ lw $t2, 0x54($sp)
.L8000971C:
/* 00A31C 8000971C 0C00243C */ jal func_800090F0
/* 00A31C 8000971C 0C00243C */ jal update_cpu_path_completion
/* 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
/* 00A32C 8000972C 3C068016 */ lui $a2, %hi(gPlayerPathIndex) # 0x8016
/* 00A330 80009730 3C038016 */ lui $v1, %hi(sSomeNearestPathPoint) # 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
/* 00A34C 8000974C 0C001974 */ jal detect_wrong_player_direction
/* 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
/* 00A360 80009760 3C068016 */ lui $a2, %hi(gPlayerPathIndex) # $a2, 0x8016
/* 00A364 80009764 15A00013 */ bnez $t5, .L800097B4
/* 00A368 80009768 3C038016 */ lui $v1, %hi(sSomeNearestWaypoint) # $v1, 0x8016
/* 00A368 80009768 3C038016 */ lui $v1, %hi(sSomeNearestPathPoint) # $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)
/* 00A384 80009784 3C0F8016 */ lui $t7, %hi(gGPCurrentRaceRankByPlayerIdDup) # $t7, 0x8016
/* 00A388 80009788 3C188016 */ lui $t8, %hi(gGPCurrentRaceRankByPlayerIdDup + 0x4) # $t8, 0x8016
/* 00A38C 8000978C 8F18440C */ lw $t8, %lo(gGPCurrentRaceRankByPlayerIdDup + 0x4)($t8)
/* 00A390 80009790 8DEF4408 */ lw $t7, %lo(gGPCurrentRaceRankByPlayerIdDup)($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
/* 00A3A0 800097A0 3C018016 */ lui $at, %hi(gBestRankedHumanPlayer) # $at, 0x8016
/* 00A3A4 800097A4 10000003 */ b .L800097B4
/* 00A3A8 800097A8 A4203478 */ sh $zero, %lo(D_80163478)($at)
/* 00A3A8 800097A8 A4203478 */ sh $zero, %lo(gBestRankedHumanPlayer)($at)
.L800097AC:
/* 00A3AC 800097AC 3C018016 */ lui $at, %hi(D_80163478) # $at, 0x8016
/* 00A3B0 800097B0 A4393478 */ sh $t9, %lo(D_80163478)($at)
/* 00A3AC 800097AC 3C018016 */ lui $at, %hi(gBestRankedHumanPlayer) # $at, 0x8016
/* 00A3B0 800097B0 A4393478 */ sh $t9, %lo(gBestRankedHumanPlayer)($at)
.L800097B4:
/* 00A3B4 800097B4 8CC63448 */ lw $a2, %lo(D_80163448)($a2)
/* 00A3B4 800097B4 8CC63448 */ lw $a2, %lo(gPlayerPathIndex)($a2)
/* 00A3B8 800097B8 10000003 */ b .L800097C8
/* 00A3BC 800097BC 84632FCE */ lh $v1, %lo(sSomeNearestWaypoint)($v1)
/* 00A3BC 800097BC 84632FCE */ lh $v1, %lo(sSomeNearestPathPoint)($v1)
.L800097C0:
/* 00A3C0 800097C0 8CC63448 */ lw $a2, %lo(D_80163448)($a2) # 0x3448($a2)
/* 00A3C4 800097C4 84632FCE */ lh $v1, %lo(sSomeNearestWaypoint)($v1)
/* 00A3C0 800097C0 8CC63448 */ lw $a2, %lo(gPlayerPathIndex)($a2) # 0x3448($a2)
/* 00A3C4 800097C4 84632FCE */ lh $v1, %lo(sSomeNearestPathPoint)($v1)
.L800097C8:
/* 00A3C8 800097C8 0C002E57 */ jal func_8000B95C
/* 00A3C8 800097C8 0C002E57 */ jal update_player_position_factor
/* 00A3CC 800097CC 3065FFFF */ andi $a1, $v1, 0xffff
/* 00A3D0 800097D0 8FBF0024 */ lw $ra, 0x24($sp)
.L800097D4:
@@ -1,4 +1,4 @@
glabel func_8004F168
glabel draw_minimap_character
/* 04FD68 8004F168 000570C0 */ sll $t6, $a1, 3
/* 04FD6C 8004F16C 01C57023 */ subu $t6, $t6, $a1
/* 04FD70 8004F170 000E7100 */ sll $t6, $t6, 4
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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];
+3 -3
View File
@@ -2,7 +2,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+4 -4
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+4 -4
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+4 -4
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+4 -4
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+5 -5
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
#include <animation.h>
@@ -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 },
+5 -5
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -4,7 +4,7 @@
#include <PR/gbi.h>
#include <actor_types.h>
#include <course.h>
#include <waypoints.h>
#include <path.h>
#include <mk64.h>
#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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <animation.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include "animation.h"
@@ -58,8 +58,8 @@ 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];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
#include <animation.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+3 -3
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <mk64.h>
@@ -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 },
+3 -3
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
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[];
+9 -9
View File
@@ -3,7 +3,7 @@
#include <macros.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#include <animation.h>
#include <mk64.h>
@@ -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 },
+9 -9
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <actor_types.h>
#include <waypoints.h>
#include <path.h>
#include <course.h>
#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;
+56 -40
View File
@@ -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:<br />
* [idle](@ref thread1_idle), [video](@ref thread3_video), [audio](@ref thread4_audio), [game loop](@ref thread5_game_loop)<br />
* [game loop](@ref thread5_game_loop):<br />
* [audio](@ref thread4_audio)<br />
* [jumpTo a specific menu or race based on a gameState flag.](@ref update_gamestate)<br />
* [profiler](@ref profiler_log_thread5_time)<br />
* [config_gfx_pool](@ref config_gfx_pool)<br />
* [read_controllers](@ref read_controllers)<br />
* [game_state_handler](@ref game_state_handler)<br />
* [endDL/vsync](@ref display_and_vsync)<br />
* [game_state_handler](@ref game_state_handler):<br />
* switch([gGamestate](@ref gGamestate))<br />
* [menus](@ref update_menus) -> switch([menu](@ref gMenuSelection)) { // do menu stuff }<br />
* [race_logic_loop](@ref race_logic_loop) -> spaghetti<br />
* [podium_ceremony](@ref podium_ceremony_loop)<br />
* [credits](@ref credits_loop)<br />
* [video](@ref thread3_video):<br />
- init_threads:<br />
- [idle](@ref thread1_idle), [video](@ref thread3_video), [audio](@ref thread4_audio), [game loop](@ref thread5_game_loop)<br />
- [game loop](@ref thread5_game_loop):<br />
- [audio](@ref thread4_audio)<br />
- [jumpTo a specific menu or race based on a gameState flag.](@ref update_gamestate)<br />
- [profiler](@ref profiler_log_thread5_time)<br />
- [config_gfx_pool](@ref config_gfx_pool)<br />
- [read_controllers](@ref read_controllers)<br />
- [game_state_handler](@ref game_state_handler)<br />
- [endDL/vsync](@ref display_and_vsync)<br />
- [game_state_handler](@ref game_state_handler):<br />
- switch([gGamestate](@ref gGamestate))<br />
- [menus](@ref update_menus) -> switch([menu](@ref gMenuSelection)) { // do menu stuff }<br />
- [race_logic_loop](@ref race_logic_loop) -> spaghetti<br />
- [podium_ceremony](@ref podium_ceremony_loop)<br />
- [credits](@ref credits_loop)<br />
- [video](@ref thread3_video):<br />
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 |
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -17,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;
@@ -42,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 pathPoint that the bomb circles
/* 0x44 */ u16 state;
/* 0x46 */ u16 bounceTimer; // timer? state? height?
/* 0x48 */ u16 circleTimer; // timer? state? Somehow controls how it circles around
+6 -6
View File
@@ -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,
@@ -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;
@@ -336,12 +336,12 @@ 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;
/* 0x022C */ f32 previousSpeed;
/* 0x0230 */ f32 unk_230;
/* 0x0234 */ s16 unk_234;
/* 0x0236 */ s16 unk_236;
+24 -21
View File
@@ -4,7 +4,7 @@
#include <ultra64.h>
#include <PR/gbi.h>
#include <macros.h>
#include "waypoints.h"
#include "path.h"
/**
* @file Include for course gfx.inc.c.
@@ -18,10 +18,10 @@ typedef struct {
} TrackSections;
struct _struct_gCoursePathSizes_0x10 {
/* 0x00 */ u16 unk0;
/* 0x02 */ u16 unk2;
/* 0x04 */ u16 unk4;
/* 0x06 */ u16 unk6;
/* 0x00 */ u16 firstPath;
/* 0x02 */ u16 secondPath;
/* 0x04 */ u16 thirdPath;
/* 0x06 */ u16 fourthPath;
/* 0x08 */ u16 unk8;
/* 0x0A */ char padA[6];
}; // size 0x10
@@ -83,20 +83,20 @@ typedef enum {
extern s16 gCurrentCourseId;
extern s16* D_800DCBB4[];
#define GET_COURSE_800DCBB4(n) D_800DCBB4[gCurrentCourseId][n]
extern f32 gKartAICourseMaximumSeparation[];
#define GET_COURSE_AIMaximumSeparation gKartAICourseMaximumSeparation[gCurrentCourseId]
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 gKartAISteeringSensitivity[];
#define GET_COURSE_AISteeringSensitivity gKartAISteeringSensitivity[gCurrentCourseId]
extern f32 gKartAICourseMinimumSeparation[];
#define GET_COURSE_AIMinimumSeparation gKartAICourseMinimumSeparation[gCurrentCourseId]
extern TrackWaypoint* gCoursePathTable[][4];
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 TrackWaypoint* gCoursePathTable2[][4];
extern TrackPathPoint* gCoursePathTable2[][4];
#define GET_COURSE_PathTable2(p) segmented_to_virtual_dupe_2(gCoursePathTable2[gCurrentCourseId][p])
extern KartAIBehaviour* gKartAIBehaviourLUT[];
#define GET_COURSE_AIBehaviour segmented_to_virtual_dupe_2(gKartAIBehaviourLUT[i])
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[];
@@ -108,9 +108,12 @@ extern f32 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_D_0D009808(cc) *(f32*) segmented_to_virtual_dupe_2(&D_0D009808[gCurrentCourseId][cc])
#define GET_COURSE_D_0D009418(cc) *(f32*) segmented_to_virtual_dupe_2(&D_0D009418[gCurrentCourseId][cc])
#define GET_COURSE_D_0D009568(cc) *(f32*) segmented_to_virtual_dupe_2(&D_0D009568[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)
@@ -127,9 +130,9 @@ extern f32 gCourseNearPersp;
#define gCourseFarPersp
#define gCourseNearPersp
#define GET_COURSE_D_0D0096B8(cc)
#define GET_COURSE_D_0D009808(cc)
#define GET_COURSE_D_0D009418(cc)
#define GET_COURSE_D_0D009568(cc)
#define GET_COURSE_cpu_OffTrackTargetSpeed(cc)
#define GET_COURSE_cpu_CurveTargetSpeed(cc)
#define GET_COURSE_cpu_NormalTargetSpeed(cc)
#endif
#endif // COURSE_H
+29 -14
View File
@@ -74,13 +74,13 @@
#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
@@ -273,13 +273,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,
@@ -290,6 +290,8 @@ enum KART_AI_BEHAVIOURS {
enum DIRECTION { NORTH, EAST, SOUTH, WEST };
enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
/**
* @brief Balloon status
*/
@@ -321,14 +323,27 @@ enum DIRECTION { NORTH, EAST, SOUTH, WEST };
* @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
#define UNKNOWN_EFFECT_0x1 0x1 //
#define BOOST_RAMP_WOOD_EFFECT 0x4 // being boosted by a ramp
#define UNKNOWN_EFFECT_0x10 0x10 //
#define UNKNOWN_EFFECT_0x40 0x40 //
#define UNKNOWN_EFFECT_0x80 0x80 //
#define UNKNOWN_EFFECT_0xC 0xC //
#define UNKNOWN_EFFECT_0x10 0x10 //
#define UNKNOWN_EFFECT_0x100 0x100 //
#define UNKNOWN_EFFECT_0x1000 0x1000 //
#define STAR_EFFECT 0x200 // being a star
#define BOOST_EFFECT 0x2000 // being boosted by trigger a mushroom
#define UNKNOWN_EFFECT_0x10000 0x10000 //
#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by a boost pad
#define UNKNOWN_EFFECT_0x200000 0x200000 //
#define REVERSE_EFFECT 0x400000 // being in reverse of the course
#define UNKNOWN_EFFECT_0x1000000 0x1000000 //
#define HIT_BY_ITEM_EFFECT 0x2000000 // being hit by an item
#define HIT_EFFECT 0x4000000 // hitting an object
#define UNKNOWN_EFFECT_0x10000000 0x10000000 //
#define LIGHTNING_EFFECT 0x40000000 // being hit by lightning
#define BOO_EFFECT 0x80000000 // being a boo
/**
* @brief shell state
+98
View File
@@ -0,0 +1,98 @@
#ifndef PATH_H
#define PATH_H
#include <common_structs.h>
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 gCurrentTrackRightPath 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 gCurrentTrackRightPath
* 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
// gPathExpectedRotation[i] = atan2(pathPoint_i, pathPoint_i+1)?
extern s16* gPathExpectedRotation[];
// No idea. Adjacency list?
extern s16* gTrackConsecutiveCurveCounts[];
/**
* Certain parts of the pathPoint 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 gCurrentTrackRightPath
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 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 pathPoint 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 pathPoint count
extern s32 D_80163368[];
// Seemingly the Z position of the 1st pathPoint 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
+15 -15
View File
@@ -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; //
-90
View File
@@ -1,90 +0,0 @@
#ifndef WAYPOINTS_H
#define WAYPOINTS_H
#include <common_structs.h>
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
+3 -3
View File
@@ -52,7 +52,7 @@ SECTIONS
BUILD_DIR/src/animation.o(.text*);
BUILD_DIR/src/staff_ghosts.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*);
@@ -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*);
@@ -328,7 +328,7 @@ SECTIONS
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/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*);
Binary file not shown.
+1 -1
View File
@@ -11,7 +11,7 @@ SAFE_C_FILES := \
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 \
+3 -3
View File
@@ -58,7 +58,7 @@ 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;
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
@@ -66,10 +66,10 @@ void update_actor_banana(struct BananaActor* banana) {
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);
+29 -29
View File
@@ -1,13 +1,13 @@
#include <actors.h>
#include <waypoints.h>
#include <path.h>
#include <defines.h>
#include <main.h>
#include <actors_extended.h>
#include <code_800029B0.h>
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;
@@ -317,8 +317,8 @@ 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;
@@ -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];
+4 -4
View File
@@ -60,8 +60,8 @@ 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;
@@ -112,8 +112,8 @@ 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;
+7 -7
View File
@@ -1,7 +1,7 @@
#include <actors.h>
#include <main.h>
#include <defines.h>
#include <waypoints.h>
#include <path.h>
/**
* @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;
+10 -9
View File
@@ -12,7 +12,7 @@
#include "audio/data.h"
#include "audio/port_eu.h"
#include "code_800029B0.h"
#include "code_80005FD0.h"
#include "cpu_vehicles_camera_path.h"
#include "menu_items.h"
s8 D_8018EF10;
@@ -1868,7 +1868,7 @@ void func_800C6108(u8 playerId) {
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;
}
@@ -1880,7 +1880,7 @@ void func_800C6108(u8 playerId) {
} else {
D_800E9E54[playerId] = (f32) -player->unk_0C0;
}
if ((player->effects & 0x10) == 0x10) {
if ((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId];
} else {
D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId] - (D_800E9E54[playerId] / 12000.0f);
@@ -1927,7 +1927,7 @@ 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:
@@ -1950,7 +1950,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;
@@ -1978,7 +1978,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:
@@ -2150,7 +2150,8 @@ 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 & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10)) {
D_800E9E74[playerId] = 1;
switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) {
case DIRT: /* switch 1 */
@@ -2182,7 +2183,7 @@ void func_800C70A8(u8 playerId) {
break;
}
}
if ((gPlayers[playerId].effects & 0x10) == 0x10) {
if ((gPlayers[playerId].effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
D_800E9E74[playerId] = 2;
switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) { /* switch 2 */
case DIRT: /* switch 2 */
@@ -2334,7 +2335,7 @@ 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 & 8) == 8)) &&
(D_800E9E74[playerId] != 0x0000001C)) {
D_800E9E74[playerId] = 0;
}
+14 -14
View File
@@ -9,11 +9,11 @@
#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"
@@ -221,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];
@@ -362,7 +362,7 @@ 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 & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) {
sp84[2] /= 3.0f;
}
calculate_orientation_matrix(sp9C, 0, 1, 0, arg7);
@@ -375,7 +375,7 @@ 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 & 2) == 2)) {
arg2[1] += ((y - camera->lookAt[1]) * 0.02);
} else {
arg2[1] += ((y - camera->lookAt[1]) * 0.5);
@@ -383,7 +383,7 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
mtxf_translate_vec3f_mat3(sp90, sp9C);
x = player->pos[0] + sp90[0];
z = player->pos[2] + sp90[2];
if ((player->effects & 0x01000000) != 0x01000000) {
if ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000) {
var_f0 = player->pos[1] + sp90[1];
// permute
y = var_f0;
@@ -394,7 +394,7 @@ 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 & 2) == 2)) {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01));
} else {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15));
@@ -582,7 +582,7 @@ 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 & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) {
sp84[2] /= 3.0f;
}
calculate_orientation_matrix(sp9C, 0, 1, 0, arg7);
@@ -595,7 +595,7 @@ 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 & 2) == 2)) {
arg2[1] += ((y - camera->lookAt[1]) * 0.02);
} else {
arg2[1] += ((y - camera->lookAt[1]) * 0.5);
@@ -603,7 +603,7 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
mtxf_translate_vec3f_mat3(sp90, sp9C);
x = player->pos[0] + sp90[0];
z = player->pos[2] + sp90[2];
if ((player->effects & 0x01000000) != 0x01000000) {
if ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000) {
var_f0 = player->pos[1] + sp90[1];
// permute
y = var_f0;
@@ -614,7 +614,7 @@ 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 & 2) == 2)) {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01));
} else {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15));
@@ -704,7 +704,7 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) {
UNUSED s16 pad6;
s16 temp;
if ((player->effects & 0x10) == 0x10) {
if ((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
var_a3 = 100;
if (player->unk_078 == 0) {
camera->unk_B0 = 0;
@@ -826,7 +826,7 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) {
UNUSED s16 pad6;
s16 temp;
if ((player->effects & 0x10) == 0x10) {
if ((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
var_a3 = 100;
if (player->unk_078 == 0) {
camera->unk_B0 = 0;
+8 -9
View File
@@ -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"
@@ -24,7 +24,7 @@
#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;
@@ -208,7 +208,7 @@ void setup_race(void) {
gNumSpawnedShells = 0;
D_800DC5B8 = 0;
D_80152308 = 0;
D_802BA038 = -1;
gDemoTimer = -1;
D_802BA048 = 0;
func_802A74BC();
set_perspective_and_aspect_ratio();
@@ -216,15 +216,14 @@ void setup_race(void) {
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) {
-7750
View File
File diff suppressed because it is too large Load Diff
-413
View File
@@ -1,413 +0,0 @@
#ifndef CODE_80005FD0_H
#define CODE_80005FD0_H
#include "vehicles.h"
#include "camera.h"
#include "waypoints.h"
#include <assets/common_data.h>
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;
/* 0x08 */ s32 unk8;
/* 0x0C */ u16 unkC;
/* 0x0E */ u16 actorIndex;
/* 0x10 */ s16 unk10;
/* 0x12 */ // s16 compilerPadding;
/* 0x14 */ u32 unk14;
/* 0x18 */ s32 unk18;
}; // size = 0x1C
typedef struct {
/* 0x00 */ f32 unk0;
/* 0x04 */ f32 unk4;
/* 0x08 */ f32 unk8;
/* 0x0C */ f32 unkC;
} Test; // size = 0x10
// Something related to CPU item usage
typedef struct {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 actorIndex;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ s16 unk_08;
/* 0x0A */ s16 unk_0A;
/* 0x0C */ s16 unk_0C;
/* 0x0E */ s16 unk_0E;
} D_801642D8_entry; // size = 0x10
typedef struct {
s16 unk0;
s16 unk2;
s16 unk4;
u16 unk6;
} UnkStruct_46D0;
typedef struct {
s16 x;
s16 z;
} Path2D;
/* Function Prototypes */
s16 get_angle_between_waypoints(Vec3f, Vec3f);
s32 func_80006018(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 set_places(void);
void func_800070F4(void);
void func_800074D4(void);
s32 func_80007BF8(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 func_80009000(s32);
void func_800090F0(s32, Player*);
f32 func_80009258(s32, f32, f32);
void func_8000929C(s32, Player*);
void update_vehicles(void);
void func_800098FC(s32, Player*);
void func_800099EC(s32, Player*);
void func_80009B60(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);
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_vehicles_waypoint(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);
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);
void set_bomb_kart_spawn_positions(void);
void func_8000DF8C(s32);
s32 add_actor_in_unexpired_actor_list(s32, s16);
s32 add_red_shell_in_unexpired_actor_list(s32);
s32 add_green_shell_in_unexpired_actor_list(s32);
s32 add_blue_shell_in_unexpired_actor_list(s32);
void delete_actor_in_unexpired_actor_list(s32);
void func_8000EEDC(void);
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);
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);
void func_80011EC0(s32, Player*, s32, u16);
void generate_train_waypoints(void);
void generate_ferry_waypoints(void);
void spawn_vehicle_on_road(VehicleStuff*);
void spawn_course_vehicles(void);
void set_vehicle_pos_waypoint(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 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*);
f32 func_80013C74(s16, s16);
void update_vehicle_follow_waypoint(VehicleStuff*);
void func_80013F7C(s32, Player*, VehicleStuff*, f32, f32, s32, u32);
f32 func_800145A8(s16, f32, s16);
void func_800146B8(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 init_vehicles_school_buses(void);
void update_vehicle_school_bus(void);
void func_80014A18(s32, Player*);
void func_80014A60(s32);
void init_vehicles_trucks(void);
void update_vehicle_tanker_trucks(void);
void func_80014B6C(s32, Player*);
void func_80014BB4(s32);
void init_vehicles_cars(void);
void update_vehicle_cars(void);
void func_80014CC0(s32, Player*);
void func_80014D08(s32);
void func_80014D30(s32, s32);
void func_80014DE4(s32);
f32 func_80014EE4(f32, s32);
void calculate_camera_up_vector(Camera*, s32);
void func_8001530C(void);
void func_80015314(s32, f32, s32);
void func_80015390(Camera*, Player*, s32);
void func_80015544(s32, f32, s32, s32);
void func_8001577C(Camera*, UNUSED Player*, s32, s32);
void func_80015A9C(s32, f32, s32, s16);
void func_80015C94(Camera*, Player*, s32, s32);
void func_800162CC(s32, f32, s32, s16);
void func_80016494(Camera*, Player*, s32, s32);
void func_80016C3C(s32, f32, s32);
void func_80017720(s32, f32, s32, s16);
void func_800178F4(Camera*, Player*, s32, s32);
void func_80017F10(s32, f32, s32, s16);
void func_800180F0(Camera*, Player*, s32, s32);
void func_80018718(s32, f32, s32, s16);
void func_800188F4(Camera*, Player*, s32, s32);
void func_80019118(s32, f32, s32, s16);
void func_8001933C(Camera*, UNUSED Player*, s32, s32);
void func_8001968C(void);
void func_8001969C(s32, f32, s32, s16);
void func_80019760(Camera*, UNUSED Player*, s32, s32);
void func_80019890(s32, s32);
void func_80019B50(s32, u16);
void func_80019C50(s32);
void func_80019D2C(Camera*, Player*, s32);
void func_80019DE4(void);
void func_80019DF4(void);
void func_80019E58(void);
void func_80019ED0(void);
void func_80019FB4(s32);
void func_8001A0A4(u16*, Camera*, Player*, s8, s32);
void func_8001A0DC(u16*, Camera*, Player*, s8, s32);
void func_8001A124(s32, s32);
s32 func_8001A310(s32, s32);
void func_8001A348(s32, f32, s32);
void func_8001A3D8(s32, f32, s32);
void func_8001A450(s32, s32, s32);
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 func_8001BE78(void);
void func_8001C05C(void);
void func_8001C14C(void);
void func_8001C3C4(s32);
void func_8001C42C(void);
/* This is where I'd put my static data, if I had any */
extern Collision D_80162E70;
extern s16 D_80162EB0; // Possibly a float.
extern s16 D_80162EB2; // possibly [3]
extern KartAIBehaviour* gCoursesKartAIBehaviour[];
extern s16 D_80162F10[];
extern s16 D_80162F50[];
extern Vec3f D_80162FA0;
extern Vec3f D_80162FB0;
extern Vec3f D_80162FC0;
extern s16 gTrainSmokeTimer;
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 D_80163090[];
extern s32 D_801630B8[];
extern u16 D_801630E0;
extern s16 D_801630E2;
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 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 s32 D_80163238;
extern u16 D_80163240[];
extern u16 D_80163258[];
extern u16 D_80163270[];
extern s32 D_80163288[];
// Exact pointer type unknown
extern KartAIBehaviour* sCurrentKartAIBehaviour;
extern u16 gCurrentKartAIBehaviourId[];
extern u16 gPreviousKartAIBehaviourId[];
extern u16 gKartAIBehaviourState[];
enum { KART_AI_BEHAVIOUR_STATE_NONE, KART_AI_BEHAVIOUR_STATE_START, KART_AI_BEHAVIOUR_STATE_RUNNING };
extern s16 D_80163300[];
extern u16 D_80163318[];
extern u16 D_80163330[];
extern u16 D_80163344[];
extern u16 D_80163348[];
extern u16 D_8016334C[];
extern u16 gSpeedKartAIBehaviour[];
enum {
SPEED_KART_AI_BEHAVIOUR_NORMAL,
SPEED_KART_AI_BEHAVIOUR_FAST,
SPEED_KART_AI_BEHAVIOUR_SLOW,
SPEED_KART_AI_BEHAVIOUR_MAX
};
extern s32 D_80163368[];
extern s32 D_80163378;
extern s32 D_8016337C;
extern s16 D_80163380[];
extern s16 D_80163398[];
extern s16 D_801633B0[];
extern s16 D_801633C8[];
extern s16 D_801633E0[];
extern s16 D_801633F8[];
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;
// 0 or 1, only 1 when when in extra (mirror) mode
extern s16 D_8016347A;
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 u16 isCrossingTriggeredByIndex[];
extern u16 sCrossingActiveTimer[];
extern s32 D_80163DD8[];
extern struct unexpiredActors gUnexpiredActorsList[];
extern D_801642D8_entry D_801642D8[];
extern s16 D_80164358;
extern s16 D_8016435A;
extern s16 D_8016435C;
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 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 s16 D_80164538[];
extern s32 D_801645D0[];
extern s32 D_801645E8[];
extern f32 D_801645F8[];
extern s32 D_80164608[];
extern f32 D_80164618[];
extern s32 D_80164628[];
extern f32 D_80164638[];
extern f32 D_80164648[];
extern f32 D_80164658[];
extern s16 D_80164670[];
extern s16 D_80164678[];
extern s16 D_80164680[];
extern f32 D_80164688[];
extern f32 D_80164698;
extern f32 D_8016469C;
extern f32 D_801646A0;
extern s16 D_801646C0[];
extern u32 D_801646C8;
extern u16 D_801646CC;
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;
// extern Gfx D_0D0076F8[];
#endif
+28 -21
View File
@@ -61,6 +61,7 @@ UNUSED void func_8003DE4C(Player* player, Vec3f arg1) {
arg1[1] = 0.0f;
mtxf_translate_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;
@@ -70,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);
decelerate_player(player, 4.0f);
player->unk_DAC = 0.5f;
if ((player->effects & BOOST_EFFECT) != 0) {
remove_boost_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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
arg3[0] = ((player->unk_206 / 182) * 0x32);
arg3[2] = (-(player->slopeAccel / 182) * 0x3C);
} else {
@@ -96,8 +98,8 @@ 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) {
decelerate_player(player, 5.0f);
}
player->unk_DAC = 0.5f;
if ((player->effects & BOOST_EFFECT) != 0) {
@@ -105,7 +107,8 @@ void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
arg3[0] = ((player->unk_206 / 182) * 0x32);
arg3[2] = (-(player->slopeAccel / 182) * 0x32);
} else {
@@ -124,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);
decelerate_player(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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
arg3[0] = ((player->unk_206 / 182) * 0x32);
arg3[2] = (-(player->slopeAccel / 182) * 0x3C);
} else {
@@ -145,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);
decelerate_player(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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
if ((player->tyres[BACK_LEFT].surfaceType == ASPHALT) ||
(player->tyres[BACK_RIGHT].surfaceType == ASPHALT) ||
(player->tyres[FRONT_RIGHT].surfaceType == ASPHALT) ||
@@ -162,7 +167,7 @@ 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 & UNKNOWN_EFFECT_0x10000) != 0) {
arg3[0] = ((player->unk_206 / 182) * 0x78);
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
}
@@ -179,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);
decelerate_player(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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
arg3[0] = ((player->unk_206 / 182) * 0x32);
arg3[2] = (-(player->slopeAccel / 182) * 0x3C);
} else {
@@ -203,10 +209,11 @@ void func_8003F138(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
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);
decelerate_player(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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
arg3[0] = ((player->unk_206 / 182) * 0x78);
arg3[2] = (-(player->slopeAccel / 182) * 0x78);
arg3[0] = 0;
@@ -261,7 +268,7 @@ void func_8003F46C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
#else
#endif
if (player->effects & 0x10000) {
if (player->effects & UNKNOWN_EFFECT_0x10000) {
player->unk_DAC = 0.5f;
}
}
@@ -279,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);
@@ -289,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 & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
arg2[1] *= -1e-05;
}
} else {
@@ -302,7 +309,7 @@ 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 & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
arg2[1] *= -1e-05;
}
}
@@ -333,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);
@@ -343,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 & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
arg2[1] *= -1e-05;
}
} else {
@@ -356,7 +363,7 @@ 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 & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
arg2[1] *= -1e-05;
}
}
+60 -57
View File
@@ -18,7 +18,7 @@
#include <defines.h>
#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"
@@ -785,7 +785,7 @@ void render_object_for_player(s32 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);
@@ -1321,7 +1321,7 @@ void func_80059D00(void) {
}
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 {
@@ -2718,22 +2718,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;
@@ -2930,7 +2930,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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);
@@ -2954,7 +2954,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
}
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
}
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -2982,7 +2982,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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);
@@ -2991,7 +2991,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3005,14 +3005,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3023,14 +3023,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3041,14 +3041,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3059,14 +3059,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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);
}
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3079,14 +3079,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) {
if (((player->speed / 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->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3099,9 +3099,9 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
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) &&
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)) {
((player->previousSpeed - player->speed) >= 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);
@@ -3109,9 +3109,9 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
}
} else if ((player->unk_258[10 + arg2].unk_01E > 0) &&
(((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) &&
(((((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))) {
((player->previousSpeed - player->speed) >= 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);
@@ -3156,12 +3156,12 @@ void func_8005EA94(Player* player, s16 arg1, s32 arg2, s8 arg3, UNUSED s8 arg4)
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) {
if (((player->speed / 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->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 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);
@@ -3647,7 +3647,7 @@ void func_800608E0(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8
func_8005D800(&player->unk_258[arg1], 0x00FFFFFF, 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_01E * (player->speed / 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;
@@ -3832,8 +3832,8 @@ void func_80061754(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3, U
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)) {
if ((player->effects & HIT_BY_ITEM_EFFECT) || ((player->effects) & UNKNOWN_EFFECT_0x1000000) ||
((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;
@@ -4419,34 +4419,34 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
if (player->unk_258[10 + 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_01E * (player->speed / 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;
} else {
player->unk_258[10 + arg1].unk_000[2] =
player->tyres[BACK_LEFT].pos[2] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
coss(player->unk_258[10 + arg1].unk_020);
player->unk_258[10 + arg1].unk_000[0] =
player->tyres[BACK_LEFT].pos[0] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
sins(player->unk_258[10 + arg1].unk_020);
}
} 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_01E * (player->speed / 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;
} else {
player->unk_258[10 + arg1].unk_000[2] =
player->tyres[BACK_RIGHT].pos[2] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
coss(player->unk_258[10 + arg1].unk_020);
player->unk_258[10 + arg1].unk_000[0] =
player->tyres[BACK_RIGHT].pos[0] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
sins(player->unk_258[10 + arg1].unk_020);
}
@@ -4557,20 +4557,20 @@ 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] =
player->tyres[BACK_LEFT].pos[2] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
coss(player->unk_258[10 + arg1].unk_020);
player->unk_258[10 + arg1].unk_000[0] =
player->tyres[BACK_LEFT].pos[0] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
sins(player->unk_258[10 + arg1].unk_020);
} else {
player->unk_258[10 + arg1].unk_000[2] =
player->tyres[BACK_RIGHT].pos[2] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
coss(player->unk_258[10 + arg1].unk_020);
player->unk_258[10 + arg1].unk_000[0] =
player->tyres[BACK_RIGHT].pos[0] +
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
sins(player->unk_258[10 + arg1].unk_020);
}
@@ -4601,11 +4601,11 @@ void func_80063FBC(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3) {
if (player->unk_258[10 + 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)),
-5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->speed / 18.0f) * 216.0f) / 15.0f)),
-player->unk_258[10 + arg1].unk_020, 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)),
-5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->speed / 18.0f) * 216.0f) / 15.0f)),
-player->unk_258[10 + arg1].unk_020, 0);
}
player->unk_258[10 + arg1].unk_000[0] = player->pos[0] + sp3C;
@@ -4630,7 +4630,7 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) {
}
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),
-4.0f + ((-player->unk_258[arg1].unk_01E * (player->speed / 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;
@@ -5896,9 +5896,9 @@ 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;
sp6C = (-(player->speed / 18.0f) * 216.0f) / 10.0f;
if ((gPlayerBalloonStatus[arg3][arg4] & 2) != 2) {
D_8018D650[arg3][arg4] += -0.003 + (-player->unk_094 * 0.0006);
D_8018D650[arg3][arg4] += -0.003 + (-player->speed * 0.0006);
if (D_8018D650[arg3][arg4] >= 0.05) {
D_8018D650[arg3][arg4] = 0.05f;
}
@@ -5919,12 +5919,12 @@ void func_8006A7C0(Player* player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) {
D_8018D710[arg3][arg4] = 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);
move_s16_towards(&D_8018D890[arg3][arg4], player->speed * 182.0f, 0.1f);
}
if (D_8018D830[arg3][arg4] == 1) {
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] - player->unk_094;
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] - player->speed;
} else {
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] + player->unk_094;
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] + player->speed;
}
if (D_8018D770[arg3][arg4] >= 0xB) {
D_8018D770[arg3][arg4] = 0x000B;
@@ -6296,7 +6296,8 @@ void func_8006C6AC(Player* player, s16 arg1, s8 arg2, s8 arg3) {
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)) {
if (((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_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)) {
@@ -6367,7 +6368,8 @@ void func_8006C9B8(Player* player, s16 arg1, s8 arg2, s8 arg3) {
player->unk_044 &= ~0x0100;
return;
}
if (((((player->unk_0CA & 0x1000) == 0x1000) || ((player->unk_0E0 < 2) && (player->effects & 0x01000000))) ||
if (((((player->unk_0CA & 0x1000) == 0x1000) ||
((player->unk_0E0 < 2) && (player->effects & UNKNOWN_EFFECT_0x1000000))) ||
((player->unk_0E0 < 2) && (player->effects & HIT_BY_ITEM_EFFECT))) ||
(player->effects & 0x400)) {
func_8006199C(player, arg1, sp28, arg2, arg3);
@@ -6392,7 +6394,7 @@ void func_8006C9B8(Player* player, s16 arg1, s8 arg2, s8 arg3) {
player->unk_044 &= ~0x0100;
return;
}
if (((player->unk_046 & 0x20) == 0x20) && (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) {
if (((player->unk_046 & 0x20) == 0x20) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) {
func_80061D4C(player, arg1, sp28, arg2, arg3);
player->unk_046 &= ~0x0008;
player->unk_044 &= ~0x0100;
@@ -6459,7 +6461,7 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) {
switch (gActiveScreenMode) {
case SCREEN_MODE_1P:
if (((arg0->effects & 0x04000000) != 0x04000000) && ((arg0->effects & 0x400) != 0x400) &&
((arg0->effects & 0x01000000) != 0x01000000)) {
((arg0->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000)) {
if (((arg0->unk_0CA & 2) != 2) && ((arg0->unk_0CA & 0x10) != 0x10) && !(arg0->unk_0CA & 0x100)) {
func_80060504(arg0, arg1, sp20, arg2, arg3);
}
@@ -6471,7 +6473,8 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) {
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)) {
((arg0->effects & 0x400) != 0x400) &&
((arg0->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000)) {
if (((arg0->unk_0CA & 2) != 2) && ((arg0->unk_0CA & 0x10) != 0x10) && !(arg0->unk_0CA & 0x100)) {
func_80060504(arg0, arg1, sp20, arg2, arg3);
}
@@ -6787,7 +6790,7 @@ void func_8006E058(void) {
case TIME_TRIALS:
func_8006E420(gPlayerOne, 0, 0);
if ((gPlayerTwo->type & 0x8000) == 0x8000) {
if ((gPlayerTwo->type & PLAYER_EXISTS) == PLAYER_EXISTS) {
func_8006E420(gPlayerTwo, 1, 0);
break;
}
+1 -1
View File
@@ -5,7 +5,7 @@
#include <mk64.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"
+5 -7
View File
@@ -1070,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);
}
}
@@ -1081,8 +1080,7 @@ 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);
}
}
@@ -1144,7 +1142,7 @@ 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)) {
((player->type & PLAYER_CPU) != PLAYER_CPU)) {
func_800C9060(var_s1, arg3);
}
}
@@ -1183,7 +1181,7 @@ s32 func_80089B50(s32 objectIndex) {
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) &&
if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | UNKNOWN_EFFECT_0x1000000)) &&
(player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) &&
(has_collided_horizontally_with_player(objectIndex, player) != 0)) {
if (!(player->effects & STAR_EFFECT)) {
@@ -1210,7 +1208,7 @@ s32 func_80089CBC(s32 objectIndex, f32 arg1) {
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)) {
if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | UNKNOWN_EFFECT_0x1000000))) {
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)) {
File diff suppressed because it is too large Load Diff
+448
View File
@@ -0,0 +1,448 @@
#ifndef cpu_vehicles_camera_path_H
#define cpu_vehicles_camera_path_H
#include "vehicles.h"
#include "camera.h"
#include "path.h"
#include <assets/common_data.h>
struct unexpiredActors {
/* 0x00 */ s32 unk0;
/* 0x04 */ s32 unk4;
/* 0x08 */ s32 unk8;
/* 0x0C */ u16 unkC;
/* 0x0E */ u16 actorIndex;
/* 0x10 */ s16 unk10;
/* 0x12 */ // s16 compilerPadding;
/* 0x14 */ u32 unk14;
/* 0x18 */ s32 unk18;
}; // size = 0x1C
typedef struct {
/* 0x00 */ f32 current;
/* 0x04 */ f32 target;
/* 0x08 */ f32 step;
/* 0x0C */ f32 unkC;
} TrackPositionFactorInstruction; // size = 0x10
// Something related to CPU item usage
typedef struct {
/* 0x00 */ s16 branch;
/* 0x02 */ s16 actorIndex;
/* 0x04 */ s16 timer; // confirm?
/* 0x06 */ s16 numItemUse; // confirm?
/* 0x08 */ s16 numDroppedBananaBunch;
/* 0x0A */ s16 unk_0A;
/* 0x0C */ s16 unk_0C;
/* 0x0E */ s16 timeBeforeThrow;
} CpuItemStrategyData; // size = 0x10
typedef struct {
s16 unk0;
s16 unk2;
s16 unk4;
u16 unk6;
} UnkStruct_46D0;
typedef struct {
s16 x;
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_path(Vec3f, Vec3f);
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 detect_wrong_player_direction(s32, Player*);
void set_places(void);
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 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 yoshi_valley_cpu_path(s32);
void update_cpu_path_completion(s32, Player*);
f32 func_80009258(s32, f32, f32);
void update_player_path_completion(s32, Player*);
void update_vehicles(void);
void play_cpu_sound_effect(s32, Player*);
void update_player_timer_sound(s32, Player*);
void update_player(s32);
void func_8000B140(s32);
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_pathPoint_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_pathPoint(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 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_path(Vec3f, s16*, f32);
void set_bomb_kart_spawn_positions(void);
void func_8000DF8C(s32);
s32 add_actor_in_unexpired_actor_list(s32, s16);
s32 add_red_shell_in_unexpired_actor_list(s32);
s32 add_green_shell_in_unexpired_actor_list(s32);
s32 add_blue_shell_in_unexpired_actor_list(s32);
void delete_actor_in_unexpired_actor_list(s32);
void func_8000EEDC(void);
void generate_player_smoke(void);
void func_8000F0E0(void);
void func_8000F124(void);
void clear_pathPoint(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(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_path(void);
void generate_ferry_path(void);
void spawn_vehicle_on_road(VehicleStuff*);
void spawn_course_vehicles(void);
void set_vehicle_pos_pathPoint(TrainCarStuff*, Path2D*, u16);
void init_vehicles_trains(void);
void sync_train_components(TrainCarStuff*, s16);
void update_vehicle_trains(void);
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 handle_paddleBoats_interactions(Player*);
void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackPathPoint*);
f32 func_80013C74(s16, s16);
void update_vehicle_follow_pathPoint(VehicleStuff*);
void handle_vehicle_interactions(s32, Player*, VehicleStuff*, f32, f32, s32, u32);
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 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 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 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 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);
void calculate_camera_up_vector(Camera*, s32);
void func_8001530C(void);
void func_80015314(s32, f32, s32);
void func_80015390(Camera*, Player*, s32);
void func_80015544(s32, f32, s32, s32);
void func_8001577C(Camera*, UNUSED Player*, s32, s32);
void func_80015A9C(s32, f32, s32, s16);
void func_80015C94(Camera*, Player*, s32, s32);
void func_800162CC(s32, f32, s32, s16);
void func_80016494(Camera*, Player*, s32, s32);
void func_80016C3C(s32, f32, s32);
void func_80017720(s32, f32, s32, s16);
void func_800178F4(Camera*, Player*, s32, s32);
void func_80017F10(s32, f32, s32, s16);
void func_800180F0(Camera*, Player*, s32, s32);
void func_80018718(s32, f32, s32, s16);
void func_800188F4(Camera*, Player*, s32, s32);
void func_80019118(s32, f32, s32, s16);
void func_8001933C(Camera*, UNUSED Player*, s32, s32);
void func_8001968C(void);
void func_8001969C(s32, f32, s32, s16);
void func_80019760(Camera*, UNUSED Player*, s32, s32);
void func_80019890(s32, s32);
void func_80019B50(s32, u16);
void func_80019C50(s32);
void func_80019D2C(Camera*, Player*, s32);
void func_80019DE4(void);
void func_80019DF4(void);
void func_80019E58(void);
void func_80019ED0(void);
void func_80019FB4(s32);
void func_8001A0A4(u16*, Camera*, Player*, s8, s32);
void func_8001A0DC(u16*, Camera*, Player*, s8, s32);
void func_8001A124(s32, s32);
s32 func_8001A310(s32, s32);
void func_8001A348(s32, f32, s32);
void func_8001A3D8(s32, f32, s32);
void func_8001A450(s32, s32, s32);
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 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 func_8001C42C(void);
/* This is where I'd put my static data, if I had any */
extern Collision D_80162E70;
extern s16 D_80162EB0; // Possibly a float.
extern s16 D_80162EB2; // possibly [3]
extern CPUBehaviour* gCoursesCPUBehaviour[];
extern s16 D_80162F10[];
extern s16 D_80162F50[];
extern Vec3f gOffsetPosition;
extern Vec3f D_80162FB0;
extern Vec3f D_80162FC0;
extern s16 gTrainSmokeTimer;
extern s16 D_80162FD0;
extern f32 gCourseCompletionPercentByRank[]; // D_80162FD8
extern s16 D_80162FF8[];
extern s16 D_80163010[];
extern f32 cpu_TargetSpeed[];
extern s16 gPreviousAngleSteering[];
extern f32 gTrackPositionFactor[];
extern f32 D_80163090[];
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 gPreviousPlayerAiOffsetX[];
extern f32 gPreviousPlayerAiOffsetZ[];
extern s16 sVehicleSoundRenderCounter;
extern s32 D_801631CC;
extern TrackPathPoint* gCurrentTrackLeftPath;
extern TrackPathPoint* gCurrentTrackRightPath;
extern s16* gCurrentTrackSectionTypesPath;
extern u16 D_801631E0[];
extern u16 D_801631F8[];
extern f32 gCurrentCpuTargetSpeed;
extern f32 gPreviousCpuTargetSpeed[];
extern s32 D_80163238;
extern u16 D_80163240[];
extern u16 gWrongDirectionCounter[];
extern u16 gIsPlayerWrongDirection[];
extern s32 gPreviousLapProgressScore[];
// Exact pointer type unknown
extern CPUBehaviour* sCurrentCPUBehaviour;
extern u16 gCurrentCPUBehaviourId[];
extern u16 gPreviousCPUBehaviourId[];
extern u16 cpu_BehaviourState[];
enum { cpu_BEHAVIOUR_STATE_NONE, cpu_BEHAVIOUR_STATE_START, cpu_BEHAVIOUR_STATE_RUNNING };
extern s16 sPlayerAngle[];
extern u16 gPlayersTrackSectionId[];
extern u16 D_80163330[];
extern u16 D_80163344[];
extern u16 D_80163348[];
extern u16 D_8016334C[];
extern u16 gSpeedCPUBehaviour[];
enum { SPEED_cpu_BEHAVIOUR_NORMAL, SPEED_cpu_BEHAVIOUR_FAST, SPEED_cpu_BEHAVIOUR_SLOW, SPEED_cpu_BEHAVIOUR_MAX };
extern s32 D_80163368[];
extern s32 gIncrementUpdatePlayer;
extern s32 D_8016337C;
extern s16 gCurrentPlayerLookAhead[];
extern s16 D_80163398[];
extern s16 D_801633B0[];
extern s16 D_801633C8[];
extern s16 D_801633E0[];
extern s16 D_801633F8[];
extern s16 D_80163410[];
extern f32 D_80163418[];
extern f32 D_80163428[];
extern f32 D_80163438[];
extern s32 gPlayerPathIndex;
extern f32 gPathStartZ;
extern f32 gPreviousPlayerZ[];
extern s16 gBestRankedHumanPlayer;
// 0 or 1, only 1 when when in extra (mirror) mode
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 cpu_enteringPathIntersection[];
extern s16 cpu_exitingPathIntersection[];
extern s16 D_801634C0[];
extern s16 bStopAICrossing[];
extern s16 D_801634EC;
extern s32 D_801634F0;
extern s32 D_801634F4;
extern TrackPositionFactorInstruction gPlayerTrackPositionFactorInstruction[];
extern Path2D* gVehicle2DPathPoint;
extern s32 gVehicle2DPathLength;
extern u16 isCrossingTriggeredByIndex[];
extern u16 sCrossingActiveTimer[];
extern s32 D_80163DD8[];
extern struct unexpiredActors gUnexpiredActorsList[];
extern CpuItemStrategyData cpu_ItemStrategy[];
extern s16 D_80164358;
extern s16 D_8016435A;
extern s16 D_8016435C;
extern s16 gGPCurrentRacePlayerIdByRank[]; // D_80164360
extern s16 D_80164378[];
extern s32 gLapCountByPlayerId[]; // D_80164390
extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8
extern s32 gPreviousGPCurrentRaceRankByPlayerId[];
extern s32 gGPCurrentRaceRankByPlayerIdDup[];
extern u16 gSelectedPathCount;
extern u16 gNearestPathPointByPlayerId[];
extern s32 gNumPathPointsTraversed[];
extern s16 gGetPlayerByCharacterId[];
extern s32 D_8016448C;
extern f32 D_80164498[];
extern f32 gLapCompletionPercentByPlayerId[]; // D_801644A8
extern f32 gCourseCompletionPercentByPlayerId[]; // D_801644D0
extern s16 bInMultiPathSection[];
extern f32 gPlayerPathY[];
extern s16 D_80164538[];
extern s32 D_801645D0[];
extern s32 D_801645E8[];
extern f32 D_801645F8[];
extern s32 D_80164608[];
extern f32 D_80164618[];
extern s32 D_80164628[];
extern f32 D_80164638[];
extern f32 D_80164648[];
extern f32 D_80164658[];
extern s16 D_80164670[];
extern s16 D_80164678[];
extern s16 D_80164680[];
extern f32 D_80164688[];
extern f32 D_80164698;
extern f32 D_8016469C;
extern f32 D_801646A0;
extern s16 D_801646C0[];
extern u32 D_801646C8;
extern u16 D_801646CC;
extern UnkStruct_46D0 D_801646D0[];
// See bss_80005FD0.s
extern f32 gCourseCompletionPercentByRank[NUM_PLAYERS];
extern s32 gPreviousGPCurrentRaceRankByPlayerId[];
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
@@ -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);
}
}
}
}
@@ -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 &= ~0x10;
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 &= ~UNKNOWN_EFFECT_0x1000;
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 &= ~0x10;
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 arg0, Player* player, s32 arg2, UNUSED u16 arg3) {
if ((((player->speed / 18.0f) * 216.0f) >= 45.0f) && (D_801630E8[arg0] == 0)) {
switch (gCurrentTrackSectionTypesPath[sSomeNearestPathPoint]) {
case RIGHT_LEANING_CURVE:
case RIGHT_CURVE:
if ((arg2 >= -9) && (D_80162FF8[arg0] == 0)) {
if ((gTrackPositionFactor[arg0] > -0.8) && (gTrackPositionFactor[arg0] < 0.5)) {
kart_hop(player);
player->effects |= UNKNOWN_EFFECT_0x10;
D_801630E8[arg0] = 1;
break;
}
}
D_801630E8[arg0] = 2;
break;
case LEFT_LEANING_CURVE:
case LEFT_CURVE:
if ((arg2 < 0xA) && (D_80162FF8[arg0] == 0)) {
if ((gTrackPositionFactor[arg0] > -0.5) && (gTrackPositionFactor[arg0] < 0.8)) {
kart_hop(player);
player->effects |= UNKNOWN_EFFECT_0x10;
D_801630E8[arg0] = -1;
break;
}
}
D_801630E8[arg0] = -2;
break;
}
} else {
D_801630E8[arg0] = 3;
}
}
@@ -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->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 = &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_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 = &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_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) || (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_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 = &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_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->pathPointIndex = spCA;
bombKart2->unk_3C = spC4;
bombKart2->someRot = spC2;
bombKart2->state = sp7E;
bombKart2->bounceTimer = sp7C;
bombKart2->circleTimer = var_s1;
}
}
@@ -0,0 +1,59 @@
#include <ultra64.h>
#include "cpu_vehicles_camera_path.h"
#include <defines.h>
#include <macros.h>
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;
}
}
@@ -0,0 +1,228 @@
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 &= ~UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
D_801634C0[playerId] = 4;
return;
}
} else {
player->effects |= UNKNOWN_EFFECT_0x200000;
player_accelerate(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 |= UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
D_801634C0[playerId] = 1;
} else if (temp_t2 < (temp_t1 + var_v0 + 0x32)) {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
D_801634C0[playerId] = 3;
} else if (D_801631E0[playerId] == false) {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
D_801634C0[playerId] = 2;
} else {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
decelerate_player(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) : decelerate_player(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) : decelerate_player(player, 5.0f);
} else {
(arg2 < ((20.0 * 18.0) / 216.0)) ? func_80038BE4(player, 10) : decelerate_player(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) : decelerate_player(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) : decelerate_player(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) : decelerate_player(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) : decelerate_player(player, 1.0f);
} else if (D_80163410[playerId] == 0) {
test = 35;
(arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) : decelerate_player(player, 1.0f);
} else {
decelerate_player(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 & 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, speed);
} else if ((bStopAICrossing[playerId] == true) && !(player->effects & (STAR_EFFECT | BOO_EFFECT))) {
decelerate_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 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 &= ~UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
} else if (player->type & PLAYER_CINEMATIC_MODE) {
if (speed < targetSpeed) {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
} else {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
decelerate_player(player, 1.0f);
}
} else if ((D_801631E0[playerId] == true) && (D_80163330[playerId] != 1)) {
if (func_800088D8(playerId, gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerIdDup[playerId]) ==
1) {
player->effects |= UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
} else {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
decelerate_player(player, 1.0f);
}
} else {
var_a1 = 1;
switch (gSpeedCPUBehaviour[playerId]) { /* switch 1; irregular */
case SPEED_cpu_BEHAVIOUR_FAST: /* switch 1 */
player->effects &= ~UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
break;
case SPEED_cpu_BEHAVIOUR_MAX: /* switch 1 */
player->effects |= UNKNOWN_EFFECT_0x200000;
player_accelerate(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(player);
} else if (D_80163330[playerId] == 1) {
func_80007D04(playerId, player);
} else if (func_800088D8(playerId, gLapCountByPlayerId[playerId],
gGPCurrentRaceRankByPlayerIdDup[playerId]) == true) {
player->effects |= UNKNOWN_EFFECT_0x200000;
player_accelerate(player);
} else {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
decelerate_player(player, 1.0f);
}
} else {
player->effects &= ~UNKNOWN_EFFECT_0x200000;
if (targetSpeed > 1.0f) {
decelerate_player(player, 2.0f);
} else {
decelerate_player(player, 5.0f);
}
}
}
}
}
}
}
@@ -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_angle_between_two_vectors(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;
}
@@ -0,0 +1,849 @@
#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include <path.h>
#include <course.h>
#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
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_pathPoint_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 pathPoint 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 pathPoint 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_pathPoint_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->unk_0CA & 1) {
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->unk_0CA &= ~0x0001;
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_pathPoint_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_pathPoint(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_pathPoint_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_pathPoint(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);
}
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -4,38 +4,38 @@
#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
#endif
TrackWaypoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 };
TrackPathPoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 };
#if !ENABLE_CUSTOM_COURSE_ENGINE
TrackWaypoint* gCoursePathTable[][4] = {
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"
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
+2 -2
View File
@@ -1,12 +1,12 @@
#ifndef PATH_SPAWN_METADATA_H
#define PATH_SPAWN_METADATA_H
#include "waypoints.h"
#include "path.h"
#include <common_structs.h>
#include <assets/common_data.h>
#include "include/bomb_kart.h"
extern TrackWaypoint nullPath;
extern TrackPathPoint nullPath;
extern s16 D_800DCAF4[];
extern s16 D_800DCB34[];
extern BombKartSpawn gBombKartSpawns[][NUM_BOMB_KARTS_MAX];
+2 -2
View File
@@ -12,7 +12,7 @@
#include <ceremony_and_credits.h>
#include <code_800029B0.h>
#include <animation.h>
#include <code_80005FD0.h>
#include <cpu_vehicles_camera_path.h>
#include <render_player.h>
#include <player_controller.h>
#include <code_8003DC40.h>
@@ -65,7 +65,7 @@
#include "buffers/trig_tables.h"
#include <ultra64.h>
#include <vehicles.h>
#include <waypoints.h>
#include <path.h>
#include <courses/all_course_data.h>
#include <courses/all_course_packed.h>
+95 -94
View File
@@ -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"
@@ -167,7 +167,7 @@ void clean_effect(Player* player, s8 arg1) {
if ((player->effects & 0x800000) == 0x800000) {
func_8008D97C(player);
}
if ((player->effects & 0x1000000) == 0x1000000) {
if ((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) {
func_8008E884(player, arg1);
}
if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) {
@@ -182,10 +182,10 @@ void clean_effect(Player* player, s8 arg1) {
if ((player->effects & 0x4000) == 0x4000) {
func_8008F3E0(player);
}
if ((player->effects & 0x10000) == 0x10000) {
if ((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000) {
func_8008F5A4(player, arg1);
}
if ((player->effects & 0x10000000) == 0x10000000) {
if ((player->effects & UNKNOWN_EFFECT_0x10000000) == UNKNOWN_EFFECT_0x10000000) {
func_8008FEDC(player, arg1);
}
player->unk_044 = (s16) (player->unk_044 & 0xFFFE);
@@ -214,14 +214,14 @@ void func_8008C528(Player* player, s8 arg1) {
func_800C90F4(arg1, (temp_v1 * 0x10) + 0x29008005);
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
} else {
func_800098FC(arg1, player);
play_cpu_sound_effect(arg1, player);
}
player->soundEffects = (s32) (player->soundEffects & ~4);
}
void func_8008C62C(Player* player, s8 arg1) {
decelerate_ai_player(player, 5.0f);
decelerate_player(player, 5.0f);
player->unk_0A8 += (s16) 0xA0;
player->unk_042 += (s16) 0x71C;
if (player->unk_0A8 >= 0x2000) {
@@ -285,7 +285,7 @@ void func_8008C73C(Player* player, s8 arg1) {
((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) {
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003);
} else {
func_800098FC(arg1, player);
play_cpu_sound_effect(arg1, player);
}
}
}
@@ -309,7 +309,7 @@ void func_8008C8C4(Player* player, s8 playerId) {
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) &&
if ((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) == PLAYER_CPU) && (!gDemoMode) &&
((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) {
player->soundEffects = (s32) (player->soundEffects | REVERSE_SOUND_EFFECT);
}
@@ -323,15 +323,15 @@ void func_8008C9EC(Player* player, s8 arg1) {
player->unk_206 = 0;
player->slopeAccel = 0;
if ((player->unk_046 & 0x40) == 0x40) {
decelerate_ai_player(player, 100.0f);
decelerate_player(player, 100.0f);
} else {
if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) {
decelerate_ai_player(player, 1.0f);
decelerate_player(player, 1.0f);
} else {
decelerate_ai_player(player, 4.0f);
decelerate_player(player, 4.0f);
}
if (!(player->type & PLAYER_HUMAN)) {
decelerate_ai_player(player, 30.0f);
decelerate_player(player, 30.0f);
}
}
if ((player->effects & 0x80) == 0x80) {
@@ -379,8 +379,8 @@ void func_8008CDC0(Player* player, s8 arg1) {
player->effects &= ~0x10;
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))) {
(((player->speed / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) ||
(((player->type & PLAYER_HUMAN) == 0) && ((player->effects & UNKNOWN_EFFECT_0x1000) == 0))) {
func_8008C73C(player, arg1);
} else {
player->effects |= 0x800;
@@ -714,7 +714,7 @@ void apply_hit_sound_effect(Player* player, s8 arg1) {
player->effects |= HIT_EFFECT;
if (((player->type) & 0x1000) != 0) {
func_800098FC(arg1, player);
play_cpu_sound_effect(arg1, player);
}
}
}
@@ -727,7 +727,7 @@ 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 & UNKNOWN_EFFECT_0x1000) != 0)) { D_8018D990[arg1] = 3; } // placed block on same line to match
// clang-format on
switch (D_8018D990[arg1]) {
@@ -854,7 +854,7 @@ void apply_hit_rotating_sound_effect(Player* player, s8 arg1) {
((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) {
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003);
} else {
func_800098FC(arg1, player);
play_cpu_sound_effect(arg1, player);
}
if (gModeSelection == BATTLE) {
func_8006B8B4(player, arg1);
@@ -893,7 +893,7 @@ void apply_lightning_effect(Player* player, s8 arg1) {
D_80165190[3][arg1] = 1;
}
}
decelerate_ai_player(player, 1.0f);
decelerate_player(player, 1.0f);
} else {
player->unk_0B0 += 1;
player->unk_08C = (f32) ((f64) player->unk_08C * 0.6);
@@ -949,7 +949,7 @@ void func_8008E4A4(Player* player, s8 arg1) {
}
if (player->unk_0E0 == 3) {
player->effects &= ~0x01000000;
player->effects &= ~UNKNOWN_EFFECT_0x1000000;
player->unk_0A8 = 0;
player->unk_236 = 0;
D_80165190[0][arg1] = 1;
@@ -971,7 +971,7 @@ void func_8008E4A4(Player* player, s8 arg1) {
player->unk_0A8 = 0;
--player->unk_236;
if (player->unk_236 == 0) {
player->effects &= ~0x01000000;
player->effects &= ~UNKNOWN_EFFECT_0x1000000;
player->unk_236 = 0;
D_80165190[0][arg1] = 1;
D_80165190[1][arg1] = 1;
@@ -997,7 +997,7 @@ void apply_reverse_sound_effect(Player* player, s8 arg1) {
func_8008C310(player);
player->unk_0A8 = 0;
player->effects |= 0x01000000;
player->effects |= UNKNOWN_EFFECT_0x1000000;
player->effects &= ~0x10;
player->kartHopJerk = 0.0f;
player->kartHopAcceleration = 0.0f;
@@ -1010,19 +1010,19 @@ 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)) {
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) {
func_800CA24C(arg1);
}
if (1) {}
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) {
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) {
func_800CA24C(arg1);
}
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
} else {
func_800098FC(arg1, player);
play_cpu_sound_effect(arg1, player);
}
player->soundEffects &= ~(REVERSE_SOUND_EFFECT | 0x80000);
@@ -1034,7 +1034,7 @@ void apply_reverse_sound_effect(Player* player, s8 arg1) {
}
void func_8008E884(Player* player, s8 arg1) {
player->effects &= ~0x01000000;
player->effects &= ~UNKNOWN_EFFECT_0x1000000;
player->unk_0A8 = 0;
player->unk_236 = 0;
D_80165190[0][arg1] = 1;
@@ -1121,7 +1121,7 @@ void apply_hit_by_item_sound_effect(Player* player, s8 arg1) {
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
} else {
func_800098FC(arg1, player);
play_cpu_sound_effect(arg1, player);
}
player->effects |= HIT_BY_ITEM_EFFECT;
@@ -1315,7 +1315,7 @@ 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 &= ~UNKNOWN_EFFECT_0x10000;
func_80090778(player);
func_80090868(player);
}
@@ -1323,8 +1323,9 @@ void func_8008F3F4(Player* player, UNUSED s8 arg1) {
}
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)) &&
if ((((player->effects & UNKNOWN_EFFECT_0x80) != 0) || ((player->effects & UNKNOWN_EFFECT_0x40) != 0) ||
((player->effects & UNKNOWN_EFFECT_0x1000000)) || ((player->effects & HIT_BY_ITEM_EFFECT)) ||
((player->effects & 0x400) != 0)) &&
(gModeSelection == BATTLE)) {
player->unk_044 |= 0x8000;
}
@@ -1333,7 +1334,7 @@ void func_8008F494(Player* player, s8 arg1) {
func_8008F86C(player, arg1);
player->unk_0A8 = 0;
player->effects |= 0x10000;
player->effects |= UNKNOWN_EFFECT_0x10000;
player->effects &= ~0x10;
player->unk_236 = 0x1E;
player->unk_042 = 0;
@@ -1353,7 +1354,7 @@ void func_8008F5A4(Player* player, s8 arg1) {
player->unk_206 = 0;
player->slopeAccel = 0;
player->effects &= ~0x10000;
player->effects &= ~UNKNOWN_EFFECT_0x10000;
player->unk_0A8 = 0;
player->unk_0C0 = 0;
player->unk_07C = 0;
@@ -1569,94 +1570,94 @@ void func_8008FDF4(Player* player, UNUSED s8 arg1) {
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = D_800E37D0[player->characterId];
player->soundEffects &= ~0x00100000;
player->effects |= 0x10000000;
player->effects |= UNKNOWN_EFFECT_0x10000000;
}
void func_8008FE84(Player* player, UNUSED s8 arg1) {
player->effects &= ~0x10;
if ((player->effects & 8) != 8) {
player->effects &= ~0x10000000;
player->effects &= ~UNKNOWN_EFFECT_0x10000000;
player->currentSpeed /= 2;
player->unk_08C /= 2;
}
}
void func_8008FEDC(Player* player, UNUSED s8 arg1) {
player->effects &= ~0x10000000;
player->effects &= ~UNKNOWN_EFFECT_0x10000000;
player->kartHopJerk = 0.0f;
player->kartHopVelocity = 0.0f;
player->kartHopAcceleration = 0.0f;
}
void course_update_waypoint(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;
@@ -1664,12 +1665,12 @@ void course_update_waypoint(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;
}
@@ -1680,7 +1681,7 @@ void course_update_waypoint(Player* player, s8 playerId) {
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 };
@@ -1700,14 +1701,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;
@@ -1745,12 +1746,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;
@@ -1801,7 +1802,7 @@ void func_80090868(Player* player) {
player->unk_D98 = 1;
player->unk_D9C = 0.0f;
player->unk_DA0 = 0.5f;
course_update_waypoint(player, playerIndex);
course_update_path_point(player, playerIndex);
player->unk_222 = 0;
player->unk_0CA |= 2;
player->unk_0C8 = 0;
@@ -1825,7 +1826,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;
@@ -1866,7 +1867,7 @@ 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) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) {
func_8009E088(playerId, 0xA);
}
if ((player->unk_0CA & 1) == 1) {
@@ -1898,7 +1899,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);
@@ -1921,10 +1922,10 @@ 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++;
@@ -2080,7 +2081,7 @@ void func_80091298(Player* player, s8 arg1) {
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) {
+1 -1
View File
@@ -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 course_update_waypoint(Player*, s8);
void course_update_path_point(Player*, s8);
void func_80090178(Player*, s8, Vec3f, Vec3f);
void func_80090778(Player*);
void func_80090868(Player*);
+1 -1
View File
@@ -13,7 +13,7 @@
#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"
+1 -1
View File
@@ -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"
+2
View File
@@ -79,6 +79,8 @@ void rsp_set_matrix_transformation_inverted_x_y_orientation(Vec3f, Vec3su, f32);
void rsp_set_matrix_transl_rot_scale(Vec3f, Vec3f, f32);
void rsp_set_matrix_gObjectList(s32);
#define DEGREES_CONVERSION_FACTOR 182
/* This is where I'd put my static data, if I had any */
extern s8 D_801658FE;
+6 -5
View File
@@ -9,7 +9,7 @@
#include "code_800029B0.h"
#include "menu_items.h"
#include "code_80005FD0.h"
#include "cpu_vehicles_camera_path.h"
#include "code_8006E9C0.h"
#include "menus.h"
#include "save.h"
@@ -7227,7 +7227,7 @@ void func_800A34A8(MenuItem* arg0) {
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;
@@ -7254,7 +7254,7 @@ void func_800A34A8(MenuItem* arg0) {
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;
@@ -7295,7 +7295,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 {
@@ -10820,7 +10821,7 @@ void func_800AC458(MenuItem* arg0) {
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;
}
+1 -1
View File
@@ -654,7 +654,7 @@ void tkmk00decode(u8*, u8*, u8*, s32);
/* This is where I'd put my static data, if I had any */
extern s32 D_800DDB24;
extern s16 D_80164478[];
extern s16 gGetPlayerByCharacterId[];
extern u16* gMenuTextureBuffer;
extern u8* gMenuCompressedBuffer;
+1 -1
View File
@@ -11,7 +11,7 @@
#include "actors.h"
#include "audio/external.h"
#include "code_800029B0.h"
#include "code_80005FD0.h"
#include "cpu_vehicles_camera_path.h"
#include "menu_items.h"
#include "code_800AF9B0.h"
#include "save.h"
+380 -369
View File
File diff suppressed because it is too large Load Diff
+78 -78
View File
@@ -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,8 +73,8 @@ 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(Player*);
void decelerate_player(Player*, f32);
void detect_triple_b_combo_b_released(Player*);
void detect_triple_b_combo_b_pressed(Player*);
void func_800323E4(Player*);
@@ -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);
@@ -113,81 +113,81 @@ 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 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 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_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;
+8 -8
View File
@@ -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"
@@ -1659,7 +1659,7 @@ bool collision_yoshi_egg(Player* player, struct YoshiValleyEgg* egg) {
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)) {
if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_CPU) == 0)) {
D_80162DF8 = 1;
}
}
@@ -1736,7 +1736,7 @@ bool collision_tree(Player* player, struct Actor* actor) {
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) {
@@ -2148,7 +2148,7 @@ 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 & UNKNOWN_EFFECT_0x1000000) {
break;
}
if (player->soundEffects & 2) {
@@ -2199,7 +2199,7 @@ 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)) {
if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_CPU)) {
D_80162DF8 = 1;
}
if (player->effects & STAR_EFFECT) {
@@ -2281,7 +2281,7 @@ 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 & 0x4000000) == 0)) {
func_802977E4(phi_s1);
for (j = 0; j < ACTOR_LIST_SIZE; j++) {
temp_a1 = &gActorList[j];
@@ -2376,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;
}
+6 -6
View File
@@ -5,8 +5,8 @@
#include "code_800029B0.h"
#include "math_util.h"
#include "memory.h"
#include "waypoints.h"
#include "code_80005FD0.h"
#include "path.h"
#include "cpu_vehicles_camera_path.h"
#include "menu_items.h"
#include "collision.h"
#include "actors.h"
@@ -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,12 +185,12 @@ 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);
@@ -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);
}
}
}
+1 -1
View File
@@ -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*);
+32 -32
View File
@@ -7,14 +7,14 @@
#include <course.h>
#include "camera.h"
#include "waypoints.h"
#include "path.h"
#include "staff_ghosts.h"
#include "main.h"
#include "code_800029B0.h"
#include "code_80057C60.h"
#include "update_objects.h"
#include "menu_items.h"
#include "code_80005FD0.h"
#include "cpu_vehicles_camera_path.h"
#include "spawn_players.h"
#include "audio/external.h"
#include "race_logic.h"
@@ -40,7 +40,7 @@ u16 D_802BA032;
float D_802BA034;
s32 D_802BA038;
s32 gDemoTimer;
UNUSED s32 D_802BA03C;
s16 D_802BA040[4];
@@ -81,7 +81,7 @@ void func_8028E028(void) {
}
func_800CA118((u8) gPlayerWinningIndex);
D_800DC510 = 5;
D_802BA038 = 10;
gDemoTimer = 10;
}
void update_player_battle_status(void) {
@@ -132,14 +132,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) {
@@ -404,7 +404,7 @@ void func_8028E678(void) {
}
}
void func_8028EC38(s32 arg0) {
UNUSED void func_8028EC38(s32 arg0) {
gGotoMode = arg0;
D_800DC510 = 6;
func_800CA330(25);
@@ -412,7 +412,7 @@ void func_8028EC38(s32 arg0) {
D_800DC5B4 = 1;
D_800DC5B0 = 1;
D_800DC5B8 = 0;
D_802BA038 = 5;
gDemoTimer = 5;
}
void func_8028EC98(s32 arg0) {
@@ -529,7 +529,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;
@@ -551,7 +551,7 @@ void func_8028EF28(void) {
}
if (gModeSelection == VERSUS) {
D_802BA038 = 180;
gDemoTimer = 180;
if (currentPosition == 0) {
gPlayerWinningIndex = i;
}
@@ -566,7 +566,7 @@ void func_8028EF28(void) {
D_800DC510 = 5;
i = gPlayerPositionLUT[1];
gPlayers[i].soundEffects |= 0x200000;
gPlayers[i].type |= PLAYER_KART_AI;
gPlayers[i].type |= PLAYER_CPU;
func_800CA118((u8) i);
break;
case 3:
@@ -584,7 +584,7 @@ void func_8028EF28(void) {
*(gNmiUnknown2 + i * 3 + 2) = 99;
}
gPlayers[i].soundEffects |= 0x200000;
gPlayers[i].type |= PLAYER_KART_AI;
gPlayers[i].type |= PLAYER_CPU;
func_800CA118((u8) i);
}
break;
@@ -599,7 +599,7 @@ void func_8028EF28(void) {
D_800DC510 = 5;
i = gPlayerPositionLUT[3];
gPlayers[i].soundEffects |= 0x200000;
gPlayers[i].type |= PLAYER_KART_AI;
gPlayers[i].type |= PLAYER_CPU;
func_800CA118((u8) i);
}
break;
@@ -625,7 +625,7 @@ void func_8028EF28(void) {
}
if ((D_802BA048 != 0) && (D_802BA048 != 100)) {
D_802BA048 = 100;
func_800074D4();
set_places_end_course_with_time();
}
}
@@ -656,7 +656,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:
@@ -677,7 +677,7 @@ void func_8028F4E8(void) {
D_800DC5B4 = 1;
D_800DC5B0 = 1;
D_800DC5B8 = 0;
D_802BA038 = 5;
gDemoTimer = 5;
}
}
}
@@ -791,7 +791,7 @@ void func_8028F970(void) {
if (!(player->type & PLAYER_HUMAN)) {
continue;
}
if (player->type & PLAYER_KART_AI) {
if (player->type & PLAYER_CPU) {
continue;
}
@@ -862,27 +862,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;
}
@@ -894,7 +894,7 @@ void func_8028FCBC(void) {
u32 phi_v0_4;
if (gDemoUseController) {
func_8028FC34();
end_demo_update();
}
switch (D_800DC510) {
case 0:
@@ -991,7 +991,7 @@ void func_8028FCBC(void) {
switch (gScreenModeSelection) {
case SCREEN_MODE_1P:
D_802BA038 = 690;
gDemoTimer = 690;
D_800DC510 = 5;
func_8028E298();
break;
@@ -1007,7 +1007,7 @@ void func_8028FCBC(void) {
}
func_8028E298();
D_802BA038 = 600;
gDemoTimer = 600;
D_800DC510 = 5;
}
break;
@@ -1020,7 +1020,7 @@ void func_8028FCBC(void) {
func_8028F970();
break;
case TIME_TRIALS:
D_802BA038 = 360;
gDemoTimer = 360;
if (D_8015F890 != 0) {
D_800DC510 = 7;
} else {
@@ -1030,8 +1030,8 @@ void func_8028FCBC(void) {
}
break;
case 5:
if (D_802BA038 != 0) {
D_802BA038--;
if (gDemoTimer != 0) {
gDemoTimer--;
} else {
switch (gModeSelection) {
case GRAND_PRIX:
+1 -1
View File
@@ -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);
+31 -31
View File
@@ -15,12 +15,12 @@
#include "math_util.h"
#include "math_util_2.h"
#include "objects.h"
#include "waypoints.h"
#include "path.h"
#include "bomb_kart.h"
#include <assets/common_data.h>
#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"
@@ -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);
}
@@ -2475,52 +2475,52 @@ void render_mini_map_finish_line(s32 arg0) {
* 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] * gMiniMapMarkerScale;
thing1 = player->pos[2] * gMiniMapMarkerScale;
temp_a0 = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX + (s16) (thing0);
temp_a1 = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY + (s16) (thing1);
x = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX + (s16) (thing0);
y = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY + (s16) (thing1);
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,
func_80046424(x, y, (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,
func_80046424(x, y, player->rotation[1] + 0x8000, 1.0f,
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
8, 8, 8, 8);
#endif
} else {
#if EXPLICIT_AND == 1
func_800463B0(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
func_800463B0(x, y, (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,
func_800463B0(x, y, player->rotation[1] + 0x8000, 1.0f,
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
8, 8, 8, 8);
#endif
}
} 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")
GLOBAL_ASM("asm/non_matchings/render_objects/draw_minimap_character.s")
#endif
// WTF is up with the gPlayerOne access in this function?
@@ -2533,35 +2533,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;
@@ -2843,11 +2843,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;
@@ -3073,12 +3073,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]);
}
@@ -3745,7 +3745,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;
@@ -3761,7 +3761,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)) {
+2 -2
View File
@@ -295,7 +295,7 @@ void func_8004EE54(s32);
void func_8004EF9C(s32);
void render_mini_map_finish_line(s32);
void func_8004F168(s32, s32, 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);
+42 -42
View File
@@ -17,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 <assets/common_data.h>
@@ -1091,12 +1091,12 @@ void change_player_color_effect_cmy(UNUSED Player* player, s8 arg1, s32 arg2, f3
bool is_player_under_light_luigi_raceway(Player* player, s8 arg1) {
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
if (((gNearestPathPointByPlayerId[arg1] >= 0x14F) && (gNearestPathPointByPlayerId[arg1] < 0x158)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x15E) && (gNearestPathPointByPlayerId[arg1] < 0x164)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x169) && (gNearestPathPointByPlayerId[arg1] < 0x170)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x174) && (gNearestPathPointByPlayerId[arg1] < 0x17A)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x17E) &&
(gNearestPathPointByPlayerId[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;
@@ -1112,20 +1112,20 @@ bool is_player_under_light_luigi_raceway(Player* player, s8 arg1) {
void render_light_environment_on_player(Player* player, s8 arg1) {
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[arg1] >= 0x15) && (gNearestPathPointByPlayerId[arg1] < 0x2A)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x14D) && (gNearestPathPointByPlayerId[arg1] < 0x15C)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x1D1) && (gNearestPathPointByPlayerId[arg1] < 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
} else if (((gNearestPathPointByPlayerId[arg1] >= 0xF1) && (gNearestPathPointByPlayerId[arg1] < 0xF5)) ||
((gNearestPathPointByPlayerId[arg1] >= 0xFB) && (gNearestPathPointByPlayerId[arg1] < 0xFF)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x105) && (gNearestPathPointByPlayerId[arg1] < 0x109)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x10F) && (gNearestPathPointByPlayerId[arg1] < 0x113)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x145) && (gNearestPathPointByPlayerId[arg1] < 0x14A)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x15E) &&
(gNearestPathPointByPlayerId[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;
@@ -1136,25 +1136,25 @@ void render_light_environment_on_player(Player* player, s8 arg1) {
}
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
if (((gNearestPathPointByPlayerId[arg1] >= 0xD) && (gNearestPathPointByPlayerId[arg1] < 0x15)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x29) && (gNearestPathPointByPlayerId[arg1] < 0x39)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x46) && (gNearestPathPointByPlayerId[arg1] < 0x4E)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x5F) && (gNearestPathPointByPlayerId[arg1] < 0x67)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x7B) && (gNearestPathPointByPlayerId[arg1] < 0x86)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x9D) && (gNearestPathPointByPlayerId[arg1] < 0xA6)) ||
((gNearestPathPointByPlayerId[arg1] >= 0xB9) && (gNearestPathPointByPlayerId[arg1] < 0xC3)) ||
((gNearestPathPointByPlayerId[arg1] >= 0xB9) && (gNearestPathPointByPlayerId[arg1] < 0xC3)) ||
((gNearestPathPointByPlayerId[arg1] >= 0xD7) && (gNearestPathPointByPlayerId[arg1] < 0xE1)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x10E) && (gNearestPathPointByPlayerId[arg1] < 0x119)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x154) && (gNearestPathPointByPlayerId[arg1] < 0x15F)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x1EF) && (gNearestPathPointByPlayerId[arg1] < 0x1F7)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x202) && (gNearestPathPointByPlayerId[arg1] < 0x209)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x216) && (gNearestPathPointByPlayerId[arg1] < 0x21D)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x230) && (gNearestPathPointByPlayerId[arg1] < 0x23A)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x24C) && (gNearestPathPointByPlayerId[arg1] < 0x256)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x288) && (gNearestPathPointByPlayerId[arg1] < 0x269)) ||
((gNearestPathPointByPlayerId[arg1] >= 0x274) &&
(gNearestPathPointByPlayerId[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;
@@ -1298,11 +1298,11 @@ 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 & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) ||
((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 & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000) || ((player->effects & 8) == 8)) {
var_f2 = (f32) (1.0 - ((f64) player->collision.surfaceDistance[2] * 0.02));
if (var_f2 < 0.0f) {
@@ -1753,7 +1753,7 @@ void func_80026A48(Player* player, s8 arg1) {
return;
}
temp_f0 = ((player->unk_094 * (1.0f + player->unk_104)) / 18.0f) * 216.0f;
temp_f0 = ((player->speed * (1.0f + player->unk_104)) / 18.0f) * 216.0f;
if ((temp_f0 <= 1.0f) || (gIsPlayerTripleBButtonCombo[arg1] == true)) {
player->unk_240 = 0;
} else {
+120 -128
View File
@@ -6,7 +6,7 @@
#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"
@@ -16,7 +16,7 @@
#include "collision.h"
#include "render_courses.h"
#include "staff_ghosts.h"
#include "code_80005FD0.h"
#include "cpu_vehicles_camera_path.h"
#include "render_player.h"
#include "podium_ceremony_actors.h"
#include "main.h"
@@ -37,8 +37,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];
@@ -58,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;
@@ -118,7 +118,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
player->oldPos[0] = startingRow;
player->oldPos[1] = ret;
D_80164510[playerIndex] = ret;
gPlayerPathY[playerIndex] = ret;
player->rotation[0] = 0;
player->oldPos[2] = startingColumn;
@@ -141,7 +141,7 @@ 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;
@@ -193,7 +193,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
player->unk_10C = 0;
player->unk_200 = 0;
player->unk_204 = 0;
player->nearestWaypointId = 0;
player->nearestPathPointId = 0;
player->unk_228 = 0;
player->unk_22A = 0;
player->unk_234 = 0;
@@ -223,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;
@@ -243,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;
@@ -494,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];
}
}
}
@@ -511,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();
@@ -551,22 +551,22 @@ 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);
@@ -575,14 +575,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) {
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,
@@ -592,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) {
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;
@@ -622,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);
@@ -668,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);
@@ -713,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();
}
@@ -729,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();
}
@@ -762,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();
}
@@ -781,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();
}
@@ -818,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);
@@ -871,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;
}
@@ -1143,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();
}
}
+2 -2
View File
@@ -34,7 +34,7 @@ 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;
+2 -2
View File
@@ -243,7 +243,7 @@ void func_8000546C(void) {
s16 phi_v0 = 0;
if (D_80162DB0 >= 0x1000) {
gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI;
gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU;
return;
}
@@ -473,7 +473,7 @@ void func_8000599C(void) {
// 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;
ply->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU;
}
}

Some files were not shown because too many files have changed in this diff Show More