diff --git a/asm/non_matchings/game_ui/func_800A19A4.s b/asm/non_matchings/game_ui/func_800A19A4.s index 9fe1a298..841a6854 100644 --- a/asm/non_matchings/game_ui/func_800A19A4.s +++ b/asm/non_matchings/game_ui/func_800A19A4.s @@ -45,8 +45,8 @@ glabel func_800A19A4 /* 0A264C 800A1A4C 8E470000 */ lw $a3, ($s2) /* 0A2650 800A1A50 3C148012 */ lui $s4, %hi(gHUDCurrDisplayList) # $s4, 0x8012 /* 0A2654 800A1A54 3C158012 */ lui $s5, %hi(gHUDCurrMatrix) # $s5, 0x8012 -/* 0A2658 800A1A58 3C168012 */ lui $s6, %hi(gHUDCurrTriList) # $s6, 0x8012 -/* 0A265C 800A1A5C 26C66D04 */ addiu $a2, $s6, %lo(gHUDCurrTriList) +/* 0A2658 800A1A58 3C168012 */ lui $s6, %hi(gHUDCurrVertex) # $s6, 0x8012 +/* 0A265C 800A1A5C 26C66D04 */ addiu $a2, $s6, %lo(gHUDCurrVertex) /* 0A2660 800A1A60 26A56D00 */ addiu $a1, $s5, %lo(gHUDCurrMatrix) /* 0A2664 800A1A64 26846CFC */ addiu $a0, $s4, %lo(gHUDCurrDisplayList) /* 0A2668 800A1A68 24110003 */ li $s1, 3 @@ -57,8 +57,8 @@ glabel func_800A19A4 /* 0A2678 800A1A78 3C148012 */ lui $s4, %hi(gHUDCurrDisplayList) # $s4, 0x8012 /* 0A267C 800A1A7C 8142067A */ lb $v0, 0x67a($t2) /* 0A2680 800A1A80 3C158012 */ lui $s5, %hi(gHUDCurrMatrix) # $s5, 0x8012 -/* 0A2684 800A1A84 3C168012 */ lui $s6, %hi(gHUDCurrTriList) # $s6, 0x8012 -/* 0A2688 800A1A88 26D66D04 */ addiu $s6, %lo(gHUDCurrTriList) # addiu $s6, $s6, 0x6d04 +/* 0A2684 800A1A84 3C168012 */ lui $s6, %hi(gHUDCurrVertex) # $s6, 0x8012 +/* 0A2688 800A1A88 26D66D04 */ addiu $s6, %lo(gHUDCurrVertex) # addiu $s6, $s6, 0x6d04 /* 0A268C 800A1A8C 26B56D00 */ addiu $s5, %lo(gHUDCurrMatrix) # addiu $s5, $s5, 0x6d00 /* 0A2690 800A1A90 04410005 */ bgez $v0, .L800A1AA8 /* 0A2694 800A1A94 26946CFC */ addiu $s4, %lo(gHUDCurrDisplayList) # addiu $s4, $s4, 0x6cfc diff --git a/asm/non_matchings/game_ui/func_800A22F4.s b/asm/non_matchings/game_ui/func_800A22F4.s index 1177c4df..4eb4e41c 100644 --- a/asm/non_matchings/game_ui/func_800A22F4.s +++ b/asm/non_matchings/game_ui/func_800A22F4.s @@ -31,8 +31,8 @@ glabel func_800A22F4 /* 0A2F64 800A2364 8E070000 */ lw $a3, ($s0) /* 0A2F68 800A2368 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A2F6C 800A236C 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A2F70 800A2370 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A2F74 800A2374 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A2F70 800A2370 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A2F74 800A2374 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A2F78 800A2378 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A2F7C 800A237C 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A2F80 800A2380 0C02A980 */ jal func_800AA600 @@ -84,8 +84,8 @@ glabel func_800A22F4 .L800A242C: /* 0A302C 800A242C 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A3030 800A2430 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A3034 800A2434 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A3038 800A2438 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3034 800A2434 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A3038 800A2438 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A303C 800A243C 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3040 800A2440 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A3044 800A2444 00007012 */ mflo $t6 @@ -115,8 +115,8 @@ glabel func_800A22F4 /* 0A3098 800A2498 8E070000 */ lw $a3, ($s0) /* 0A309C 800A249C 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A30A0 800A24A0 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A30A4 800A24A4 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A30A8 800A24A8 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A30A4 800A24A4 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A30A8 800A24A8 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A30AC 800A24AC 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A30B0 800A24B0 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A30B4 800A24B4 0C02A980 */ jal func_800AA600 @@ -147,8 +147,8 @@ glabel func_800A22F4 /* 0A3114 800A2514 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3118 800A2518 8E070000 */ lw $a3, ($s0) /* 0A311C 800A251C 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 -/* 0A3120 800A2520 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A3124 800A2524 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3120 800A2520 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A3124 800A2524 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A3128 800A2528 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A312C 800A252C 0C02A980 */ jal func_800AA600 /* 0A3130 800A2530 24E706A0 */ addiu $a3, $a3, 0x6a0 @@ -160,8 +160,8 @@ glabel func_800A22F4 /* 0A3148 800A2548 8E070000 */ lw $a3, ($s0) /* 0A314C 800A254C 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A3150 800A2550 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A3154 800A2554 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A3158 800A2558 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3154 800A2554 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A3158 800A2558 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A315C 800A255C 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3160 800A2560 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A3164 800A2564 0C02A980 */ jal func_800AA600 diff --git a/asm/non_matchings/game_ui/func_800A277C.s b/asm/non_matchings/game_ui/func_800A277C.s index cfd45065..85a87a79 100644 --- a/asm/non_matchings/game_ui/func_800A277C.s +++ b/asm/non_matchings/game_ui/func_800A277C.s @@ -296,8 +296,8 @@ glabel func_800A277C /* 0A376C 800A2B6C 3C128012 */ lui $s2, %hi(gHUDCurrDisplayList) # $s2, 0x8012 /* 0A3770 800A2B70 26526CFC */ addiu $s2, %lo(gHUDCurrDisplayList) # addiu $s2, $s2, 0x6cfc /* 0A3774 800A2B74 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A3778 800A2B78 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A377C 800A2B7C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3778 800A2B78 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A377C 800A2B7C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A3780 800A2B80 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3784 800A2B84 02402025 */ move $a0, $s2 /* 0A3788 800A2B88 AFA900A8 */ sw $t1, 0xa8($sp) @@ -368,8 +368,8 @@ glabel func_800A277C /* 0A387C 800A2C7C 2403003C */ li $v1, 60 /* 0A3880 800A2C80 8E270000 */ lw $a3, ($s1) /* 0A3884 800A2C84 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A3888 800A2C88 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A388C 800A2C8C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3888 800A2C88 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A388C 800A2C8C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A3890 800A2C90 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3894 800A2C94 02402025 */ move $a0, $s2 /* 0A3898 800A2C98 AFA900A8 */ sw $t1, 0xa8($sp) @@ -426,8 +426,8 @@ glabel func_800A277C /* 0A3950 800A2D50 8FAF0098 */ lw $t7, 0x98($sp) /* 0A3954 800A2D54 8E270000 */ lw $a3, ($s1) /* 0A3958 800A2D58 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A395C 800A2D5C 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A3960 800A2D60 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A395C 800A2D5C 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A3960 800A2D60 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A3964 800A2D64 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3968 800A2D68 02402025 */ move $a0, $s2 /* 0A396C 800A2D6C 0C02A980 */ jal func_800AA600 @@ -519,8 +519,8 @@ glabel func_800A277C /* 0A3ABC 800A2EBC A5C90338 */ sh $t1, 0x338($t6) /* 0A3AC0 800A2EC0 8E270000 */ lw $a3, ($s1) /* 0A3AC4 800A2EC4 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A3AC8 800A2EC8 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A3ACC 800A2ECC 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3AC8 800A2EC8 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A3ACC 800A2ECC 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A3AD0 800A2ED0 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3AD4 800A2ED4 AFA90050 */ sw $t1, 0x50($sp) /* 0A3AD8 800A2ED8 02402025 */ move $a0, $s2 @@ -528,8 +528,8 @@ glabel func_800A277C /* 0A3AE0 800A2EE0 24E70320 */ addiu $a3, $a3, 0x320 /* 0A3AE4 800A2EE4 8E270000 */ lw $a3, ($s1) /* 0A3AE8 800A2EE8 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A3AEC 800A2EEC 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A3AF0 800A2EF0 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A3AEC 800A2EEC 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A3AF0 800A2EF0 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A3AF4 800A2EF4 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A3AF8 800A2EF8 02402025 */ move $a0, $s2 /* 0A3AFC 800A2EFC 0C02A980 */ jal func_800AA600 diff --git a/asm/non_matchings/game_ui/func_800A47A0.s b/asm/non_matchings/game_ui/func_800A47A0.s index fcd61f4d..e0db2fda 100644 --- a/asm/non_matchings/game_ui/func_800A47A0.s +++ b/asm/non_matchings/game_ui/func_800A47A0.s @@ -27,7 +27,7 @@ glabel func_800A47A0 /* 0A5404 800A4804 448F4000 */ mtc1 $t7, $f8 /* 0A5408 800A4808 3C148012 */ lui $s4, %hi(gHUDCurrMatrix) # $s4, 0x8012 /* 0A540C 800A480C 468042A0 */ cvt.s.w $f10, $f8 -/* 0A5410 800A4810 3C158012 */ lui $s5, %hi(gHUDCurrTriList) # $s5, 0x8012 +/* 0A5410 800A4810 3C158012 */ lui $s5, %hi(gHUDCurrVertex) # $s5, 0x8012 /* 0A5414 800A4814 0080B025 */ move $s6, $a0 /* 0A5418 800A4818 4459F800 */ cfc1 $t9, $31 /* 0A541C 800A481C E62A05D0 */ swc1 $f10, 0x5d0($s1) @@ -36,7 +36,7 @@ glabel func_800A47A0 /* 0A5428 800A4828 38210002 */ xori $at, $at, 2 /* 0A542C 800A482C 44C1F800 */ ctc1 $at, $31 /* 0A5430 800A4830 C71005D0 */ lwc1 $f16, 0x5d0($t8) -/* 0A5434 800A4834 26B56D04 */ addiu $s5, %lo(gHUDCurrTriList) # addiu $s5, $s5, 0x6d04 +/* 0A5434 800A4834 26B56D04 */ addiu $s5, %lo(gHUDCurrVertex) # addiu $s5, $s5, 0x6d04 /* 0A5438 800A4838 460084A4 */ cvt.w.s $f18, $f16 /* 0A543C 800A483C 26946D00 */ addiu $s4, %lo(gHUDCurrMatrix) # addiu $s4, $s4, 0x6d00 /* 0A5440 800A4840 44089000 */ mfc1 $t0, $f18 diff --git a/asm/non_matchings/game_ui/func_800A4C44.s b/asm/non_matchings/game_ui/func_800A4C44.s index 190b07e1..6c767575 100644 --- a/asm/non_matchings/game_ui/func_800A4C44.s +++ b/asm/non_matchings/game_ui/func_800A4C44.s @@ -61,8 +61,8 @@ glabel func_800A4C44 .L800A4D20: /* 0A5920 800A4D20 8D070000 */ lw $a3, ($t0) /* 0A5924 800A4D24 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A5928 800A4D28 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A592C 800A4D2C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A5928 800A4D28 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A592C 800A4D2C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A5930 800A4D30 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A5934 800A4D34 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A5938 800A4D38 AFA30034 */ sw $v1, 0x34($sp) @@ -114,8 +114,8 @@ glabel func_800A4C44 /* 0A59EC 800A4DEC 3C0141C0 */ li $at, 0x41C00000 # 24.000000 /* 0A59F0 800A4DF0 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A59F4 800A4DF4 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A59F8 800A4DF8 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A59FC 800A4DFC 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A59F8 800A4DF8 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A59FC 800A4DFC 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A5A00 800A4E00 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A5A04 800A4E04 460021A1 */ cvt.d.s $f6, $f4 /* 0A5A08 800A4E08 46309100 */ add.d $f4, $f18, $f16 diff --git a/asm/non_matchings/game_ui/func_800A5F18.s b/asm/non_matchings/game_ui/func_800A5F18.s index 820b0530..58e50061 100644 --- a/asm/non_matchings/game_ui/func_800A5F18.s +++ b/asm/non_matchings/game_ui/func_800A5F18.s @@ -17,8 +17,8 @@ glabel func_800A5F18 /* 0A6B28 800A5F28 AFBF001C */ sw $ra, 0x1c($sp) /* 0A6B2C 800A5F2C 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A6B30 800A5F30 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A6B34 800A5F34 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A6B38 800A5F38 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A6B34 800A5F34 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A6B38 800A5F38 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A6B3C 800A5F3C 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A6B40 800A5F40 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A6B44 800A5F44 0C02A980 */ jal func_800AA600 @@ -27,8 +27,8 @@ glabel func_800A5F18 /* 0A6B50 800A5F50 8CE76CDC */ lw $a3, %lo(D_80126CDC)($a3) /* 0A6B54 800A5F54 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A6B58 800A5F58 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A6B5C 800A5F5C 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A6B60 800A5F60 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A6B5C 800A5F5C 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A6B60 800A5F60 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A6B64 800A5F64 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A6B68 800A5F68 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A6B6C 800A5F6C 0C02A980 */ jal func_800AA600 diff --git a/asm/non_matchings/game_ui/func_800A6E30.s b/asm/non_matchings/game_ui/func_800A6E30.s index dacca678..fe4cd4a9 100644 --- a/asm/non_matchings/game_ui/func_800A6E30.s +++ b/asm/non_matchings/game_ui/func_800A6E30.s @@ -126,8 +126,8 @@ glabel L800A6F3C /* 0A7BE8 800A6FE8 8D070000 */ lw $a3, ($t0) /* 0A7BEC 800A6FEC 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A7BF0 800A6FF0 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A7BF4 800A6FF4 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A7BF8 800A6FF8 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A7BF4 800A6FF4 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A7BF8 800A6FF8 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A7BFC 800A6FFC 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A7C00 800A7000 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A7C04 800A7004 0C02A980 */ jal func_800AA600 @@ -181,8 +181,8 @@ glabel L800A7014 .L800A70AC: /* 0A7CAC 800A70AC 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A7CB0 800A70B0 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A7CB4 800A70B4 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A7CB8 800A70B8 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A7CB4 800A70B4 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A7CB8 800A70B8 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A7CBC 800A70BC 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A7CC0 800A70C0 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A7CC4 800A70C4 0C02A980 */ jal func_800AA600 @@ -200,14 +200,14 @@ glabel L800A70D4 /* 0A7CF0 800A70F0 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 /* 0A7CF4 800A70F4 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A7CF8 800A70F8 46048181 */ sub.s $f6, $f16, $f4 -/* 0A7CFC 800A70FC 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 +/* 0A7CFC 800A70FC 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 /* 0A7D00 800A7100 E44601CC */ swc1 $f6, 0x1cc($v0) /* 0A7D04 800A7104 8D020000 */ lw $v0, ($t0) /* 0A7D08 800A7108 240A0004 */ li $t2, 4 /* 0A7D0C 800A710C 804901DD */ lb $t1, 0x1dd($v0) /* 0A7D10 800A7110 C44801CC */ lwc1 $f8, 0x1cc($v0) /* 0A7D14 800A7114 44895000 */ mtc1 $t1, $f10 -/* 0A7D18 800A7118 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A7D18 800A7118 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A7D1C 800A711C 468054A0 */ cvt.s.w $f18, $f10 /* 0A7D20 800A7120 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A7D24 800A7124 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 diff --git a/asm/non_matchings/game_ui/func_800A718C.s b/asm/non_matchings/game_ui/func_800A718C.s index 24449857..5e183d73 100644 --- a/asm/non_matchings/game_ui/func_800A718C.s +++ b/asm/non_matchings/game_ui/func_800A718C.s @@ -109,8 +109,8 @@ glabel func_800A718C /* 0A7F14 800A7314 0006000D */ break 6 .L800A7318: /* 0A7F18 800A7318 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A7F1C 800A731C 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A7F20 800A7320 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A7F1C 800A731C 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A7F20 800A7320 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A7F24 800A7324 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A7F28 800A7328 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A7F2C 800A732C 00006010 */ mfhi $t4 @@ -143,8 +143,8 @@ glabel func_800A718C /* 0A7F88 800A7388 8CE76CDC */ lw $a3, %lo(D_80126CDC)($a3) /* 0A7F8C 800A738C 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A7F90 800A7390 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A7F94 800A7394 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A7F98 800A7398 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A7F94 800A7394 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A7F98 800A7398 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A7F9C 800A739C 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A7FA0 800A73A0 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A7FA4 800A73A4 0C02A980 */ jal func_800AA600 @@ -163,8 +163,8 @@ glabel func_800A718C /* 0A7FD4 800A73D4 8CE76CDC */ lw $a3, %lo(D_80126CDC)($a3) /* 0A7FD8 800A73D8 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A7FDC 800A73DC 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A7FE0 800A73E0 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A7FE4 800A73E4 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A7FE0 800A73E0 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A7FE4 800A73E4 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A7FE8 800A73E8 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A7FEC 800A73EC 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A7FF0 800A73F0 0C02A980 */ jal func_800AA600 @@ -177,8 +177,8 @@ glabel func_800A718C /* 0A800C 800A740C 8CE76CDC */ lw $a3, %lo(D_80126CDC)($a3) /* 0A8010 800A7410 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A8014 800A7414 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A8018 800A7418 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0A801C 800A741C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A8018 800A7418 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0A801C 800A741C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A8020 800A7420 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A8024 800A7424 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A8028 800A7428 0C02A980 */ jal func_800AA600 diff --git a/asm/non_matchings/game_ui/func_800A7A60.s b/asm/non_matchings/game_ui/func_800A7A60.s index 6db28e0d..2799193e 100644 --- a/asm/non_matchings/game_ui/func_800A7A60.s +++ b/asm/non_matchings/game_ui/func_800A7A60.s @@ -53,10 +53,10 @@ glabel func_800A7A60 /* 0A872C 800A7B2C 8FA70028 */ lw $a3, 0x28($sp) /* 0A8730 800A7B30 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0A8734 800A7B34 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0A8738 800A7B38 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 +/* 0A8738 800A7B38 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 /* 0A873C 800A7B3C 240E0100 */ li $t6, 256 /* 0A8740 800A7B40 AFAE0014 */ sw $t6, 0x14($sp) -/* 0A8744 800A7B44 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A8744 800A7B44 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A8748 800A7B48 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A874C 800A7B4C 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0A8750 800A7B50 0C01A145 */ jal render_sprite_billboard diff --git a/asm/non_matchings/game_ui/func_800A7FBC.s b/asm/non_matchings/game_ui/func_800A7FBC.s index 3349e3df..6e8264c8 100644 --- a/asm/non_matchings/game_ui/func_800A7FBC.s +++ b/asm/non_matchings/game_ui/func_800A7FBC.s @@ -51,8 +51,8 @@ glabel func_800A7FBC /* 0A8C78 800A8078 0155001A */ div $zero, $t2, $s5 /* 0A8C7C 800A807C 3C108012 */ lui $s0, %hi(gHUDCurrDisplayList) # $s0, 0x8012 /* 0A8C80 800A8080 3C118012 */ lui $s1, %hi(gHUDCurrMatrix) # $s1, 0x8012 -/* 0A8C84 800A8084 3C128012 */ lui $s2, %hi(gHUDCurrTriList) # $s2, 0x8012 -/* 0A8C88 800A8088 26526D04 */ addiu $s2, %lo(gHUDCurrTriList) # addiu $s2, $s2, 0x6d04 +/* 0A8C84 800A8084 3C128012 */ lui $s2, %hi(gHUDCurrVertex) # $s2, 0x8012 +/* 0A8C88 800A8088 26526D04 */ addiu $s2, %lo(gHUDCurrVertex) # addiu $s2, $s2, 0x6d04 /* 0A8C8C 800A808C 26316D00 */ addiu $s1, %lo(gHUDCurrMatrix) # addiu $s1, $s1, 0x6d00 /* 0A8C90 800A8090 26106CFC */ addiu $s0, %lo(gHUDCurrDisplayList) # addiu $s0, $s0, 0x6cfc /* 0A8C94 800A8094 27B30060 */ addiu $s3, $sp, 0x60 diff --git a/asm/non_matchings/game_ui/func_800A8474.s b/asm/non_matchings/game_ui/func_800A8474.s index 7d6b9ce2..b63a022c 100644 --- a/asm/non_matchings/game_ui/func_800A8474.s +++ b/asm/non_matchings/game_ui/func_800A8474.s @@ -202,8 +202,8 @@ glabel func_800A8474 /* 0A931C 800A871C 8F190000 */ lw $t9, ($t8) /* 0A9320 800A8720 3C0A8012 */ lui $t2, %hi(D_80126D60) # $t2, 0x8012 /* 0A9324 800A8724 8D4A6D60 */ lw $t2, %lo(D_80126D60)($t2) -/* 0A9328 800A8728 3C018012 */ lui $at, %hi(gHUDCurrTriList) # $at, 0x8012 -/* 0A932C 800A872C AC396D04 */ sw $t9, %lo(gHUDCurrTriList)($at) +/* 0A9328 800A8728 3C018012 */ lui $at, %hi(gHUDCurrVertex) # $at, 0x8012 +/* 0A932C 800A872C AC396D04 */ sw $t9, %lo(gHUDCurrVertex)($at) /* 0A9330 800A8730 8143004C */ lb $v1, 0x4c($t2) /* 0A9334 800A8734 24010042 */ li $at, 66 /* 0A9338 800A8738 146100D4 */ bne $v1, $at, .L800A8A8C @@ -675,7 +675,7 @@ glabel func_800A8474 /* 0A9A08 800A8E08 246A0001 */ addiu $t2, $v1, 1 /* 0A9A0C 800A8E0C 3C0E8000 */ lui $t6, %hi(osTvType) # $t6, 0x8000 /* 0A9A10 800A8E10 46006180 */ add.s $f6, $f12, $f0 -/* 0A9A14 800A8E14 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 +/* 0A9A14 800A8E14 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 /* 0A9A18 800A8E18 E446036C */ swc1 $f6, 0x36c($v0) /* 0A9A1C 800A8E1C 8E420000 */ lw $v0, ($s2) /* 0A9A20 800A8E20 468050A0 */ cvt.s.w $f2, $f10 @@ -685,7 +685,7 @@ glabel func_800A8474 /* 0A9A30 800A8E30 240F0001 */ li $t7, 1 /* 0A9A34 800A8E34 E4480370 */ swc1 $f8, 0x370($v0) /* 0A9A38 800A8E38 8E420000 */ lw $v0, ($s2) -/* 0A9A3C 800A8E3C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0A9A3C 800A8E3C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0A9A40 800A8E40 C45000EC */ lwc1 $f16, 0xec($v0) /* 0A9A44 800A8E44 02802025 */ move $a0, $s4 /* 0A9A48 800A8E48 46008100 */ add.s $f4, $f16, $f0 @@ -1280,10 +1280,10 @@ glabel func_800A8474 /* 0AA31C 800A971C AD8B0000 */ sw $t3, ($t4) /* 0AA320 800A9720 8FAE0164 */ lw $t6, 0x164($sp) /* 0AA324 800A9724 8DAD6D00 */ lw $t5, %lo(gHUDCurrMatrix)($t5) -/* 0AA328 800A9728 3C0F8012 */ lui $t7, %hi(gHUDCurrTriList) # $t7, 0x8012 +/* 0AA328 800A9728 3C0F8012 */ lui $t7, %hi(gHUDCurrVertex) # $t7, 0x8012 /* 0AA32C 800A972C ADCD0000 */ sw $t5, ($t6) /* 0AA330 800A9730 8FB80168 */ lw $t8, 0x168($sp) -/* 0AA334 800A9734 8DEF6D04 */ lw $t7, %lo(gHUDCurrTriList)($t7) +/* 0AA334 800A9734 8DEF6D04 */ lw $t7, %lo(gHUDCurrVertex)($t7) /* 0AA338 800A9738 3C198012 */ lui $t9, %hi(D_80126D60) # $t9, 0x8012 /* 0AA33C 800A973C AF0F0000 */ sw $t7, ($t8) /* 0AA340 800A9740 8F396D60 */ lw $t9, %lo(D_80126D60)($t9) @@ -1687,8 +1687,8 @@ glabel func_800A8474 .L800A9D00: /* 0AA900 800A9D00 8FAE0154 */ lw $t6, 0x154($sp) /* 0AA904 800A9D04 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0AA908 800A9D08 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0AA90C 800A9D0C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0AA908 800A9D08 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0AA90C 800A9D0C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0AA910 800A9D10 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0AA914 800A9D14 27A70120 */ addiu $a3, $sp, 0x120 /* 0AA918 800A9D18 AFA00014 */ sw $zero, 0x14($sp) @@ -1782,7 +1782,7 @@ glabel func_800A8474 /* 0AAA74 800A9E74 AD0E0000 */ sw $t6, ($t0) /* 0AAA78 800A9E78 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 /* 0AAA7C 800A9E7C 444AF800 */ cfc1 $t2, $31 -/* 0AAA80 800A9E80 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 +/* 0AAA80 800A9E80 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 /* 0AAA84 800A9E84 35410003 */ ori $at, $t2, 3 /* 0AAA88 800A9E88 38210002 */ xori $at, $at, 2 /* 0AAA8C 800A9E8C 44C1F800 */ ctc1 $at, $31 @@ -1795,7 +1795,7 @@ glabel func_800A8474 /* 0AAAA8 800A9EA8 03017825 */ or $t7, $t8, $at /* 0AAAAC 800A9EAC AD0F0004 */ sw $t7, 4($t0) /* 0AAAB0 800A9EB0 8E470000 */ lw $a3, ($s2) -/* 0AAAB4 800A9EB4 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0AAAB4 800A9EB4 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0AAAB8 800A9EB8 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0AAABC 800A9EBC 02802025 */ move $a0, $s4 /* 0AAAC0 800A9EC0 0C02A980 */ jal func_800AA600 @@ -1868,8 +1868,8 @@ glabel func_800A8474 /* 0AABC4 800A9FC4 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 /* 0AABC8 800A9FC8 A70E01E6 */ sh $t6, 0x1e6($t8) /* 0AABCC 800A9FCC 8E470000 */ lw $a3, ($s2) -/* 0AABD0 800A9FD0 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0AABD4 800A9FD4 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0AABD0 800A9FD0 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0AABD4 800A9FD4 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0AABD8 800A9FD8 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0AABDC 800A9FDC 02802025 */ move $a0, $s4 /* 0AABE0 800A9FE0 0C02A980 */ jal func_800AA600 @@ -1915,8 +1915,8 @@ glabel func_800A8474 /* 0AAC7C 800AA07C 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 /* 0AAC80 800AA080 E59201E8 */ swc1 $f18, 0x1e8($t4) /* 0AAC84 800AA084 8E470000 */ lw $a3, ($s2) -/* 0AAC88 800AA088 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0AAC8C 800AA08C 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0AAC88 800AA088 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0AAC8C 800AA08C 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0AAC90 800AA090 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0AAC94 800AA094 02802025 */ move $a0, $s4 /* 0AAC98 800AA098 0C02A980 */ jal func_800AA600 @@ -2108,8 +2108,8 @@ glabel func_800A8474 /* 0AAF44 800AA344 8E470000 */ lw $a3, ($s2) .L800AA348: /* 0AAF48 800AA348 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0AAF4C 800AA34C 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0AAF50 800AA350 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0AAF4C 800AA34C 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0AAF50 800AA350 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0AAF54 800AA354 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0AAF58 800AA358 0C02A980 */ jal func_800AA600 /* 0AAF5C 800AA35C 24E701E0 */ addiu $a3, $a3, 0x1e0 @@ -2137,10 +2137,10 @@ glabel func_800A8474 /* 0AAFA8 800AA3A8 AD4B0000 */ sw $t3, ($t2) /* 0AAFAC 800AA3AC 8FB90164 */ lw $t9, 0x164($sp) /* 0AAFB0 800AA3B0 8DEF6D00 */ lw $t7, %lo(gHUDCurrMatrix)($t7) -/* 0AAFB4 800AA3B4 3C0E8012 */ lui $t6, %hi(gHUDCurrTriList) # $t6, 0x8012 +/* 0AAFB4 800AA3B4 3C0E8012 */ lui $t6, %hi(gHUDCurrVertex) # $t6, 0x8012 /* 0AAFB8 800AA3B8 AF2F0000 */ sw $t7, ($t9) /* 0AAFBC 800AA3BC 8FB80168 */ lw $t8, 0x168($sp) -/* 0AAFC0 800AA3C0 8DCE6D04 */ lw $t6, %lo(gHUDCurrTriList)($t6) +/* 0AAFC0 800AA3C0 8DCE6D04 */ lw $t6, %lo(gHUDCurrVertex)($t6) /* 0AAFC4 800AA3C4 00000000 */ nop /* 0AAFC8 800AA3C8 AF0E0000 */ sw $t6, ($t8) .L800AA3CC: diff --git a/asm/non_matchings/game_ui/func_800AA600.s b/asm/non_matchings/game_ui/func_800AA600.s index dc723fdb..891d5f63 100644 --- a/asm/non_matchings/game_ui/func_800AA600.s +++ b/asm/non_matchings/game_ui/func_800AA600.s @@ -137,8 +137,8 @@ glabel func_800AA600 /* 0AB3E0 800AA7E0 3C018012 */ lui $at, %hi(gHUDCurrMatrix) # $at, 0x8012 /* 0AB3E4 800AA7E4 AC2E6D00 */ sw $t6, %lo(gHUDCurrMatrix)($at) /* 0AB3E8 800AA7E8 8DF90000 */ lw $t9, ($t7) -/* 0AB3EC 800AA7EC 3C018012 */ lui $at, %hi(gHUDCurrTriList) # $at, 0x8012 -/* 0AB3F0 800AA7F0 AC396D04 */ sw $t9, %lo(gHUDCurrTriList)($at) +/* 0AB3EC 800AA7EC 3C018012 */ lui $at, %hi(gHUDCurrVertex) # $at, 0x8012 +/* 0AB3F0 800AA7F0 AC396D04 */ sw $t9, %lo(gHUDCurrVertex)($at) /* 0AB3F4 800AA7F4 86080006 */ lh $t0, 6($s0) /* 0AB3F8 800AA7F8 24010028 */ li $at, 40 /* 0AB3FC 800AA7FC 11010021 */ beq $t0, $at, .L800AA884 @@ -539,8 +539,8 @@ glabel func_800AA600 /* 0AB9E0 800AADE0 A6190004 */ sh $t9, 4($s0) /* 0AB9E4 800AADE4 3C048012 */ lui $a0, %hi(gHUDCurrDisplayList) # $a0, 0x8012 /* 0AB9E8 800AADE8 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 -/* 0AB9EC 800AADEC 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 -/* 0AB9F0 800AADF0 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0AB9EC 800AADEC 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 +/* 0AB9F0 800AADF0 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0AB9F4 800AADF4 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0AB9F8 800AADF8 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc /* 0AB9FC 800AADFC AFA00014 */ sw $zero, 0x14($sp) @@ -571,10 +571,10 @@ glabel func_800AA600 /* 0ABA5C 800AAE5C 3C058012 */ lui $a1, %hi(gHUDCurrMatrix) # $a1, 0x8012 /* 0ABA60 800AAE60 A4EC0004 */ sh $t4, 4($a3) /* 0ABA64 800AAE64 C610000C */ lwc1 $f16, 0xc($s0) -/* 0ABA68 800AAE68 3C068012 */ lui $a2, %hi(gHUDCurrTriList) # $a2, 0x8012 +/* 0ABA68 800AAE68 3C068012 */ lui $a2, %hi(gHUDCurrVertex) # $a2, 0x8012 /* 0ABA6C 800AAE6C E4F0000C */ swc1 $f16, 0xc($a3) /* 0ABA70 800AAE70 C60A0010 */ lwc1 $f10, 0x10($s0) -/* 0ABA74 800AAE74 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 +/* 0ABA74 800AAE74 24C66D04 */ addiu $a2, %lo(gHUDCurrVertex) # addiu $a2, $a2, 0x6d04 /* 0ABA78 800AAE78 E4EA0010 */ swc1 $f10, 0x10($a3) /* 0ABA7C 800AAE7C C6040014 */ lwc1 $f4, 0x14($s0) /* 0ABA80 800AAE80 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 @@ -657,10 +657,10 @@ glabel func_800AA600 /* 0ABB9C 800AAF9C ADAB0000 */ sw $t3, ($t5) /* 0ABBA0 800AAFA0 8FAE00BC */ lw $t6, 0xbc($sp) /* 0ABBA4 800AAFA4 8D8C6D00 */ lw $t4, %lo(gHUDCurrMatrix)($t4) -/* 0ABBA8 800AAFA8 3C198012 */ lui $t9, %hi(gHUDCurrTriList) # $t9, 0x8012 +/* 0ABBA8 800AAFA8 3C198012 */ lui $t9, %hi(gHUDCurrVertex) # $t9, 0x8012 /* 0ABBAC 800AAFAC ADCC0000 */ sw $t4, ($t6) /* 0ABBB0 800AAFB0 8FAF00C0 */ lw $t7, 0xc0($sp) -/* 0ABBB4 800AAFB4 8F396D04 */ lw $t9, %lo(gHUDCurrTriList)($t9) +/* 0ABBB4 800AAFB4 8F396D04 */ lw $t9, %lo(gHUDCurrVertex)($t9) /* 0ABBB8 800AAFB8 00000000 */ nop /* 0ABBBC 800AAFBC ADF90000 */ sw $t9, ($t7) .L800AAFC0: diff --git a/asm/non_matchings/game_ui/render_rain_overlay.s b/asm/non_matchings/game_ui/render_rain_overlay.s index ac1c765e..68adc003 100644 --- a/asm/non_matchings/game_ui/render_rain_overlay.s +++ b/asm/non_matchings/game_ui/render_rain_overlay.s @@ -145,9 +145,9 @@ glabel render_rain_overlay /* 0AEAF8 800ADEF8 37010003 */ ori $at, $t8, 3 /* 0AEAFC 800ADEFC 38210002 */ xori $at, $at, 2 /* 0AEB00 800ADF00 44C1F800 */ ctc1 $at, $31 -/* 0AEB04 800ADF04 3C0C8012 */ lui $t4, %hi(D_80127C18) # $t4, 0x8012 +/* 0AEB04 800ADF04 3C0C8012 */ lui $t4, %hi(gCurrWeatherTriList) # $t4, 0x8012 /* 0AEB08 800ADF08 460042A4 */ cvt.w.s $f10, $f8 -/* 0AEB0C 800ADF0C 258C7C18 */ addiu $t4, %lo(D_80127C18) # addiu $t4, $t4, 0x7c18 +/* 0AEB0C 800ADF0C 258C7C18 */ addiu $t4, %lo(gCurrWeatherTriList) # addiu $t4, $t4, 0x7c18 /* 0AEB10 800ADF10 44D8F800 */ ctc1 $t8, $31 /* 0AEB14 800ADF14 440D5000 */ mfc1 $t5, $f10 /* 0AEB18 800ADF18 46008102 */ mul.s $f4, $f16, $f0 @@ -209,7 +209,7 @@ glabel render_rain_overlay /* 0AEBF8 800ADFF8 440F5000 */ mfc1 $t7, $f10 /* 0AEBFC 800ADFFC 4600C102 */ mul.s $f4, $f24, $f0 /* 0AEC00 800AE000 A44F0016 */ sh $t7, 0x16($v0) -/* 0AEC04 800AE004 3C0F8012 */ lui $t7, %hi(gWeatherDisplayListHead) # $t7, 0x8012 +/* 0AEC04 800AE004 3C0F8012 */ lui $t7, %hi(gCurrWeatherDisplayList) # $t7, 0x8012 /* 0AEC08 800AE008 4602D182 */ mul.s $f6, $f26, $f2 /* 0AEC0C 800AE00C 46062201 */ sub.s $f8, $f4, $f6 /* 0AEC10 800AE010 4458F800 */ cfc1 $t8, $31 @@ -239,7 +239,7 @@ glabel render_rain_overlay /* 0AEC70 800AE070 440E5000 */ mfc1 $t6, $f10 /* 0AEC74 800AE074 44D9F800 */ ctc1 $t9, $31 /* 0AEC78 800AE078 A44E0020 */ sh $t6, 0x20($v0) -/* 0AEC7C 800AE07C 8DEF7C0C */ lw $t7, %lo(gWeatherDisplayListHead)($t7) +/* 0AEC7C 800AE07C 8DEF7C0C */ lw $t7, %lo(gCurrWeatherDisplayList)($t7) /* 0AEC80 800AE080 8D820000 */ lw $v0, ($t4) /* 0AEC84 800AE084 AFAF0068 */ sw $t7, 0x68($sp) /* 0AEC88 800AE088 AC580000 */ sw $t8, ($v0) @@ -304,8 +304,8 @@ glabel render_rain_overlay /* 0AED74 800AE174 24AF0008 */ addiu $t7, $a1, 8 /* 0AED78 800AE178 AFAF0068 */ sw $t7, 0x68($sp) /* 0AED7C 800AE17C 3C010400 */ lui $at, 0x400 -/* 0AED80 800AE180 3C0C8012 */ lui $t4, %hi(D_80127C18) # $t4, 0x8012 -/* 0AED84 800AE184 258C7C18 */ addiu $t4, %lo(D_80127C18) # addiu $t4, $t4, 0x7c18 +/* 0AED80 800AE180 3C0C8012 */ lui $t4, %hi(gCurrWeatherTriList) # $t4, 0x8012 +/* 0AED84 800AE184 258C7C18 */ addiu $t4, %lo(gCurrWeatherTriList) # addiu $t4, $t4, 0x7c18 /* 0AED88 800AE188 00007012 */ mflo $t6 /* 0AED8C 800AE18C 016EC821 */ addu $t9, $t3, $t6 /* 0AED90 800AE190 03286821 */ addu $t5, $t9, $t0 @@ -317,7 +317,7 @@ glabel render_rain_overlay /* 0AEDA8 800AE1A8 35AF0050 */ ori $t7, $t5, 0x50 /* 0AEDAC 800AE1AC ACAF0000 */ sw $t7, ($a1) /* 0AEDB0 800AE1B0 8D380000 */ lw $t8, ($t1) -/* 0AEDB4 800AE1B4 3C018012 */ lui $at, %hi(gWeatherDisplayListHead) # $at, 0x8012 +/* 0AEDB4 800AE1B4 3C018012 */ lui $at, %hi(gCurrWeatherDisplayList) # $at, 0x8012 /* 0AEDB8 800AE1B8 030A0019 */ multu $t8, $t2 /* 0AEDBC 800AE1BC 00007012 */ mflo $t6 /* 0AEDC0 800AE1C0 016EC821 */ addu $t9, $t3, $t6 @@ -344,7 +344,7 @@ glabel render_rain_overlay /* 0AEE14 800AE214 272D0004 */ addiu $t5, $t9, 4 /* 0AEE18 800AE218 31AF000F */ andi $t7, $t5, 0xf /* 0AEE1C 800AE21C AD2F0000 */ sw $t7, ($t1) -/* 0AEE20 800AE220 AC387C0C */ sw $t8, %lo(gWeatherDisplayListHead)($at) +/* 0AEE20 800AE220 AC387C0C */ sw $t8, %lo(gCurrWeatherDisplayList)($at) /* 0AEE24 800AE224 AD820000 */ sw $v0, ($t4) .L800AE228: /* 0AEE28 800AE228 8FBF0044 */ lw $ra, 0x44($sp) diff --git a/asm/non_matchings/game_ui/render_rain_splashes.s b/asm/non_matchings/game_ui/render_rain_splashes.s index 68424991..6146a0d4 100644 --- a/asm/non_matchings/game_ui/render_rain_splashes.s +++ b/asm/non_matchings/game_ui/render_rain_splashes.s @@ -223,8 +223,8 @@ glabel render_rain_splashes /* 0AE5A8 800AD9A8 AC800000 */ sw $zero, ($a0) .L800AD9AC: /* 0AE5AC 800AD9AC 3C10800E */ lui $s0, %hi(D_800E2B4C) # $s0, 0x800e -/* 0AE5B0 800AD9B0 3C118012 */ lui $s1, %hi(gWeatherDisplayListHead) # $s1, 0x8012 -/* 0AE5B4 800AD9B4 26317C0C */ addiu $s1, %lo(gWeatherDisplayListHead) # addiu $s1, $s1, 0x7c0c +/* 0AE5B0 800AD9B0 3C118012 */ lui $s1, %hi(gCurrWeatherDisplayList) # $s1, 0x8012 +/* 0AE5B4 800AD9B4 26317C0C */ addiu $s1, %lo(gCurrWeatherDisplayList) # addiu $s1, $s1, 0x7c0c /* 0AE5B8 800AD9B8 26102B4C */ addiu $s0, %lo(D_800E2B4C) # addiu $s0, $s0, 0x2b4c .L800AD9BC: /* 0AE5BC 800AD9BC 86080006 */ lh $t0, 6($s0) @@ -265,12 +265,12 @@ glabel render_rain_splashes /* 0AE640 800ADA40 01215825 */ or $t3, $t1, $at /* 0AE644 800ADA44 AC4B0004 */ sw $t3, 4($v0) /* 0AE648 800ADA48 8D8C2C8C */ lw $t4, %lo(gRainSplashGfx)($t4) -/* 0AE64C 800ADA4C 3C058012 */ lui $a1, %hi(D_80127C10) # $a1, 0x8012 -/* 0AE650 800ADA50 3C068012 */ lui $a2, %hi(D_80127C14) # $a2, 0x8012 +/* 0AE64C 800ADA4C 3C058012 */ lui $a1, %hi(gCurrWeatherMatrix) # $a1, 0x8012 +/* 0AE650 800ADA50 3C068012 */ lui $a2, %hi(gCurrWeatherVertexList) # $a2, 0x8012 /* 0AE654 800ADA54 240D010E */ li $t5, 270 /* 0AE658 800ADA58 AFAD0014 */ sw $t5, 0x14($sp) -/* 0AE65C 800ADA5C 24C67C14 */ addiu $a2, %lo(D_80127C14) # addiu $a2, $a2, 0x7c14 -/* 0AE660 800ADA60 24A57C10 */ addiu $a1, %lo(D_80127C10) # addiu $a1, $a1, 0x7c10 +/* 0AE65C 800ADA5C 24C67C14 */ addiu $a2, %lo(gCurrWeatherVertexList) # addiu $a2, $a2, 0x7c14 +/* 0AE660 800ADA60 24A57C10 */ addiu $a1, %lo(gCurrWeatherMatrix) # addiu $a1, $a1, 0x7c10 /* 0AE664 800ADA64 02003825 */ move $a3, $s0 /* 0AE668 800ADA68 0C01A145 */ jal render_sprite_billboard /* 0AE66C 800ADA6C AFAC0010 */ sw $t4, 0x10($sp) diff --git a/asm/non_matchings/objects/func_8000E4E8.s b/asm/non_matchings/objects/func_8000E4E8.s deleted file mode 100644 index 27ad212e..00000000 --- a/asm/non_matchings/objects/func_8000E4E8.s +++ /dev/null @@ -1,32 +0,0 @@ -glabel func_8000E4E8 -/* 00F0E8 8000E4E8 00041880 */ sll $v1, $a0, 2 -/* 00F0EC 8000E4EC 3C028012 */ lui $v0, %hi(D_8011AEB0) # $v0, 0x8012 -/* 00F0F0 8000E4F0 3C0E8012 */ lui $t6, %hi(D_8011AEA0) # $t6, 0x8012 -/* 00F0F4 8000E4F4 00431021 */ addu $v0, $v0, $v1 -/* 00F0F8 8000E4F8 25CEAEA0 */ addiu $t6, %lo(D_8011AEA0) # addiu $t6, $t6, -0x5160 -/* 00F0FC 8000E4FC 8C42AEB0 */ lw $v0, %lo(D_8011AEB0)($v0) -/* 00F100 8000E500 006E2821 */ addu $a1, $v1, $t6 -/* 00F104 8000E504 8CAF0000 */ lw $t7, ($a1) -/* 00F108 8000E508 3C198012 */ lui $t9, %hi(D_8011AE98) # $t9, 0x8012 -/* 00F10C 8000E50C AC40000C */ sw $zero, 0xc($v0) -/* 00F110 8000E510 AC400008 */ sw $zero, 8($v0) -/* 00F114 8000E514 AC400004 */ sw $zero, 4($v0) -/* 00F118 8000E518 AC4F0000 */ sw $t7, ($v0) -/* 00F11C 8000E51C 0323C821 */ addu $t9, $t9, $v1 -/* 00F120 8000E520 8F39AE98 */ lw $t9, %lo(D_8011AE98)($t9) -/* 00F124 8000E524 8CB80000 */ lw $t8, ($a1) -/* 00F128 8000E528 24020010 */ li $v0, 16 -/* 00F12C 8000E52C 00003825 */ move $a3, $zero -/* 00F130 8000E530 03194021 */ addu $t0, $t8, $t9 -.L8000E534: -/* 00F134 8000E534 24E70004 */ addiu $a3, $a3, 4 -/* 00F138 8000E538 A1000000 */ sb $zero, ($t0) -/* 00F13C 8000E53C A1000001 */ sb $zero, 1($t0) -/* 00F140 8000E540 A1000002 */ sb $zero, 2($t0) -/* 00F144 8000E544 A1000003 */ sb $zero, 3($t0) -/* 00F148 8000E548 14E2FFFA */ bne $a3, $v0, .L8000E534 -/* 00F14C 8000E54C 25080004 */ addiu $t0, $t0, 4 -/* 00F150 8000E550 03E00008 */ jr $ra -/* 00F154 8000E554 00000000 */ nop - - diff --git a/asm/non_matchings/unknown_032760/func_8003F0F8.s b/asm/non_matchings/unknown_032760/func_8003F0F8.s deleted file mode 100644 index 7f652878..00000000 --- a/asm/non_matchings/unknown_032760/func_8003F0F8.s +++ /dev/null @@ -1,134 +0,0 @@ -glabel func_8003F0F8 -/* 03FCF8 8003F0F8 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 03FCFC 8003F0FC AFB20030 */ sw $s2, 0x30($sp) -/* 03FD00 8003F100 00809025 */ move $s2, $a0 -/* 03FD04 8003F104 AFBF0044 */ sw $ra, 0x44($sp) -/* 03FD08 8003F108 AFB60040 */ sw $s6, 0x40($sp) -/* 03FD0C 8003F10C AFB5003C */ sw $s5, 0x3c($sp) -/* 03FD10 8003F110 AFB40038 */ sw $s4, 0x38($sp) -/* 03FD14 8003F114 00A0A825 */ move $s5, $a1 -/* 03FD18 8003F118 30D6FFFF */ andi $s6, $a2, 0xffff -/* 03FD1C 8003F11C AFB30034 */ sw $s3, 0x34($sp) -/* 03FD20 8003F120 AFB1002C */ sw $s1, 0x2c($sp) -/* 03FD24 8003F124 AFB00028 */ sw $s0, 0x28($sp) -/* 03FD28 8003F128 E7B50020 */ swc1 $f21, 0x20($sp) -/* 03FD2C 8003F12C E7B40024 */ swc1 $f20, 0x24($sp) -/* 03FD30 8003F130 AFA60078 */ sw $a2, 0x78($sp) -/* 03FD34 8003F134 0000A025 */ move $s4, $zero -/* 03FD38 8003F138 0C006EA4 */ jal get_racer_objects_by_port -/* 03FD3C 8003F13C 27A40060 */ addiu $a0, $sp, 0x60 -/* 03FD40 8003F140 8FAE0060 */ lw $t6, 0x60($sp) -/* 03FD44 8003F144 00008025 */ move $s0, $zero -/* 03FD48 8003F148 19C00030 */ blez $t6, .L8003F20C -/* 03FD4C 8003F14C 00408825 */ move $s1, $v0 -/* 03FD50 8003F150 2413FFFF */ li $s3, -1 -.L8003F154: -/* 03FD54 8003F154 8E220000 */ lw $v0, ($s1) -/* 03FD58 8003F158 8EAF0004 */ lw $t7, 4($s5) -/* 03FD5C 8003F15C 00000000 */ nop -/* 03FD60 8003F160 11E20026 */ beq $t7, $v0, .L8003F1FC -/* 03FD64 8003F164 8FA80060 */ lw $t0, 0x60($sp) -/* 03FD68 8003F168 8C580064 */ lw $t8, 0x64($v0) -/* 03FD6C 8003F16C 00000000 */ nop -/* 03FD70 8003F170 87190000 */ lh $t9, ($t8) -/* 03FD74 8003F174 00000000 */ nop -/* 03FD78 8003F178 12790020 */ beq $s3, $t9, .L8003F1FC -/* 03FD7C 8003F17C 8FA80060 */ lw $t0, 0x60($sp) -/* 03FD80 8003F180 C444000C */ lwc1 $f4, 0xc($v0) -/* 03FD84 8003F184 C646000C */ lwc1 $f6, 0xc($s2) -/* 03FD88 8003F188 C4480010 */ lwc1 $f8, 0x10($v0) -/* 03FD8C 8003F18C 46062001 */ sub.s $f0, $f4, $f6 -/* 03FD90 8003F190 C64A0010 */ lwc1 $f10, 0x10($s2) -/* 03FD94 8003F194 46000102 */ mul.s $f4, $f0, $f0 -/* 03FD98 8003F198 460A4081 */ sub.s $f2, $f8, $f10 -/* 03FD9C 8003F19C C4500014 */ lwc1 $f16, 0x14($v0) -/* 03FDA0 8003F1A0 C6520014 */ lwc1 $f18, 0x14($s2) -/* 03FDA4 8003F1A4 46021182 */ mul.s $f6, $f2, $f2 -/* 03FDA8 8003F1A8 46128381 */ sub.s $f14, $f16, $f18 -/* 03FDAC 8003F1AC 460E7282 */ mul.s $f10, $f14, $f14 -/* 03FDB0 8003F1B0 46062200 */ add.s $f8, $f4, $f6 -/* 03FDB4 8003F1B4 0C0326B4 */ jal sqrtf -/* 03FDB8 8003F1B8 460A4300 */ add.s $f12, $f8, $f10 -/* 03FDBC 8003F1BC 46000506 */ mov.s $f20, $f0 -/* 03FDC0 8003F1C0 0C00072E */ jal func_80001CB8 -/* 03FDC4 8003F1C4 32C4FFFF */ andi $a0, $s6, 0xffff -/* 03FDC8 8003F1C8 44828000 */ mtc1 $v0, $f16 -/* 03FDCC 8003F1CC 04410005 */ bgez $v0, .L8003F1E4 -/* 03FDD0 8003F1D0 468084A0 */ cvt.s.w $f18, $f16 -/* 03FDD4 8003F1D4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 03FDD8 8003F1D8 44812000 */ mtc1 $at, $f4 -/* 03FDDC 8003F1DC 00000000 */ nop -/* 03FDE0 8003F1E0 46049480 */ add.s $f18, $f18, $f4 -.L8003F1E4: -/* 03FDE4 8003F1E4 4612A03E */ c.le.s $f20, $f18 -/* 03FDE8 8003F1E8 00000000 */ nop -/* 03FDEC 8003F1EC 45000003 */ bc1f .L8003F1FC -/* 03FDF0 8003F1F0 8FA80060 */ lw $t0, 0x60($sp) -/* 03FDF4 8003F1F4 24140001 */ li $s4, 1 -/* 03FDF8 8003F1F8 8FA80060 */ lw $t0, 0x60($sp) -.L8003F1FC: -/* 03FDFC 8003F1FC 26100001 */ addiu $s0, $s0, 1 -/* 03FE00 8003F200 0208082A */ slt $at, $s0, $t0 -/* 03FE04 8003F204 1420FFD3 */ bnez $at, .L8003F154 -/* 03FE08 8003F208 26310004 */ addiu $s1, $s1, 4 -.L8003F20C: -/* 03FE0C 8003F20C 1280001D */ beqz $s4, .L8003F284 -/* 03FE10 8003F210 00000000 */ nop -/* 03FE14 8003F214 8EA4001C */ lw $a0, 0x1c($s5) -/* 03FE18 8003F218 3C108012 */ lui $s0, %hi(D_8011D4DC) # $s0, 0x8012 -/* 03FE1C 8003F21C 14800012 */ bnez $a0, .L8003F268 -/* 03FE20 8003F220 2610D4DC */ addiu $s0, %lo(D_8011D4DC) # addiu $s0, $s0, -0x2b24 -/* 03FE24 8003F224 8E090000 */ lw $t1, ($s0) -/* 03FE28 8003F228 32C4FFFF */ andi $a0, $s6, 0xffff -/* 03FE2C 8003F22C 29210008 */ slti $at, $t1, 8 -/* 03FE30 8003F230 10200021 */ beqz $at, .L8003F2B8 -/* 03FE34 8003F234 240A0001 */ li $t2, 1 -/* 03FE38 8003F238 8E45000C */ lw $a1, 0xc($s2) -/* 03FE3C 8003F23C 8E460010 */ lw $a2, 0x10($s2) -/* 03FE40 8003F240 8E470014 */ lw $a3, 0x14($s2) -/* 03FE44 8003F244 26AB001C */ addiu $t3, $s5, 0x1c -/* 03FE48 8003F248 AFAB0014 */ sw $t3, 0x14($sp) -/* 03FE4C 8003F24C 0C002556 */ jal func_80009558 -/* 03FE50 8003F250 AFAA0010 */ sw $t2, 0x10($sp) -/* 03FE54 8003F254 8E0C0000 */ lw $t4, ($s0) -/* 03FE58 8003F258 00000000 */ nop -/* 03FE5C 8003F25C 258D0001 */ addiu $t5, $t4, 1 -/* 03FE60 8003F260 10000015 */ b .L8003F2B8 -/* 03FE64 8003F264 AE0D0000 */ sw $t5, ($s0) -.L8003F268: -/* 03FE68 8003F268 8E45000C */ lw $a1, 0xc($s2) -/* 03FE6C 8003F26C 8E460010 */ lw $a2, 0x10($s2) -/* 03FE70 8003F270 8E470014 */ lw $a3, 0x14($s2) -/* 03FE74 8003F274 0C0025B6 */ jal update_spatial_audio_position -/* 03FE78 8003F278 00000000 */ nop -/* 03FE7C 8003F27C 1000000F */ b .L8003F2BC -/* 03FE80 8003F280 8FBF0044 */ lw $ra, 0x44($sp) -.L8003F284: -/* 03FE84 8003F284 8EA4001C */ lw $a0, 0x1c($s5) -/* 03FE88 8003F288 00000000 */ nop -/* 03FE8C 8003F28C 1080000B */ beqz $a0, .L8003F2BC -/* 03FE90 8003F290 8FBF0044 */ lw $ra, 0x44($sp) -/* 03FE94 8003F294 0C0025BE */ jal func_800096F8 -/* 03FE98 8003F298 00000000 */ nop -/* 03FE9C 8003F29C 3C108012 */ lui $s0, %hi(D_8011D4DC) # $s0, 0x8012 -/* 03FEA0 8003F2A0 2610D4DC */ addiu $s0, %lo(D_8011D4DC) # addiu $s0, $s0, -0x2b24 -/* 03FEA4 8003F2A4 AEA0001C */ sw $zero, 0x1c($s5) -/* 03FEA8 8003F2A8 8E0E0000 */ lw $t6, ($s0) -/* 03FEAC 8003F2AC 00000000 */ nop -/* 03FEB0 8003F2B0 25CFFFFF */ addiu $t7, $t6, -1 -/* 03FEB4 8003F2B4 AE0F0000 */ sw $t7, ($s0) -.L8003F2B8: -/* 03FEB8 8003F2B8 8FBF0044 */ lw $ra, 0x44($sp) -.L8003F2BC: -/* 03FEBC 8003F2BC C7B50020 */ lwc1 $f21, 0x20($sp) -/* 03FEC0 8003F2C0 C7B40024 */ lwc1 $f20, 0x24($sp) -/* 03FEC4 8003F2C4 8FB00028 */ lw $s0, 0x28($sp) -/* 03FEC8 8003F2C8 8FB1002C */ lw $s1, 0x2c($sp) -/* 03FECC 8003F2CC 8FB20030 */ lw $s2, 0x30($sp) -/* 03FED0 8003F2D0 8FB30034 */ lw $s3, 0x34($sp) -/* 03FED4 8003F2D4 8FB40038 */ lw $s4, 0x38($sp) -/* 03FED8 8003F2D8 8FB5003C */ lw $s5, 0x3c($sp) -/* 03FEDC 8003F2DC 8FB60040 */ lw $s6, 0x40($sp) -/* 03FEE0 8003F2E0 03E00008 */ jr $ra -/* 03FEE4 8003F2E4 27BD0070 */ addiu $sp, $sp, 0x70 - diff --git a/include/audio_internal.h b/include/audio_internal.h index cf5f67f0..12758993 100644 --- a/include/audio_internal.h +++ b/include/audio_internal.h @@ -311,5 +311,6 @@ s32 __timeToSamples(ALSynth *ALSynth, s32 micros); ALMicroTime _samplesToTime(ALSynth *synth, s32 samples); void _init_lpfilter(ALLowPass *lp); +void alClose(ALGlobals *glob); #endif diff --git a/include/structs.h b/include/structs.h index 56ddacc9..9556172e 100644 --- a/include/structs.h +++ b/include/structs.h @@ -289,9 +289,8 @@ typedef struct LevelHeader { /* 0x03 */ u8 unk3; /* 0x04 */ s8 unk4[4]; /* 0x08 */ f32 course_height; - - /* 0x0C */ u8 padC[0x14]; - + /* 0x0C */ u8 unkC[10]; + /* 0x16 */ u8 unk16[10]; /* 0x20 */ s32 *unk20; /* 0x24 */ u8 pad24[6]; @@ -774,6 +773,8 @@ typedef struct Object_Weapon { /* 0x14 */ s32 unk14; /* 0x18 */ u8 weaponID; /* 0x19 */ u8 checkpoint; + /* 0x19 */ s16 unk1A; + /* 0x19 */ s32 unk1C; } Object_Weapon; typedef struct Object_Butterfly { @@ -1142,9 +1143,10 @@ typedef struct Object_Racer { /* 0x203 */ s8 boostType; /* 0x204 */ s16 unk204; /* 0x206 */ s16 unk206; - /* 0x208 */ s16 unk208; + /* 0x208 */ s8 unk208; + /* 0x209 */ u8 unk209; /* 0x20A */ u8 unk20A; - /* 0x20B */ s8 unk20B; + /* 0x20B */ u8 unk20B; /* 0x20C */ u8 throttleReleased; /* 0x20D */ u8 unk20D; /* 0x20E */ u16 unk20E; diff --git a/include/types.h b/include/types.h index 293eceab..d5e3bf63 100644 --- a/include/types.h +++ b/include/types.h @@ -40,6 +40,7 @@ typedef s32 ptrdiff_t; //#endif typedef float Matrix[4][4]; +typedef s32 MatrixS[4][4]; typedef s16 VertexList; typedef s8 TriangleList; diff --git a/src/audio.c b/src/audio.c index 7ba26f8d..c58f31d8 100644 --- a/src/audio.c +++ b/src/audio.c @@ -90,7 +90,7 @@ u8 D_80115F78; u8 D_80115F79; s32 D_80115F7C; s32 *gGlobalSoundMask; -u32 gSpatialSoundMask; +u32 *gSpatialSoundMask; u32 D_80115F88; /******************************/ @@ -101,41 +101,41 @@ void audio_init(OSSched *sc) { s32 *addrPtr; u32 seqfSize; u32 seq_max_len; - u32 tmp2; + UNUSED u32 pad; audioMgrConfig audConfig; seq_max_len = 0; alHeapInit(&gALHeap, gBssSectionStart, AUDIO_HEAP_SIZE); - addrPtr = load_asset_section_from_rom(ASSET_AUDIO_TABLE); - ALBankFile_80115D14 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[2] - addrPtr[1], COLOUR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D14, addrPtr[1], addrPtr[2] - addrPtr[1]); + addrPtr = (s32 *) load_asset_section_from_rom(ASSET_AUDIO_TABLE); + ALBankFile_80115D14 = (ALBankFile *) allocate_from_main_pool_safe(addrPtr[2] - addrPtr[1], COLOUR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, (u32) ALBankFile_80115D14, addrPtr[1], addrPtr[2] - addrPtr[1]); alBnkfNew(ALBankFile_80115D14, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[2])); sSoundEffectsPoolSize = addrPtr[7] - addrPtr[6]; - sSoundEffectsPool = (unk80115D18 *)allocate_from_main_pool_safe(sSoundEffectsPoolSize, COLOUR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, sSoundEffectsPool, addrPtr[6], sSoundEffectsPoolSize); + sSoundEffectsPool = (unk80115D18 *) allocate_from_main_pool_safe(sSoundEffectsPoolSize, COLOUR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, (u32) sSoundEffectsPool, addrPtr[6], sSoundEffectsPoolSize); D_80115D20 = sSoundEffectsPoolSize / 10; sMusicPoolSize = addrPtr[6] - addrPtr[5]; - sMusicPool = (unk80115D1C *)allocate_from_main_pool_safe(sMusicPoolSize, COLOUR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, sMusicPool, addrPtr[5], sMusicPoolSize); + sMusicPool = (unk80115D1C *) allocate_from_main_pool_safe(sMusicPoolSize, COLOUR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, (u32) sMusicPool, addrPtr[5], sMusicPoolSize); D_80115D24 = sMusicPoolSize / 3; - ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[0], COLOUR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D10, 0, addrPtr[0]); + ALBankFile_80115D10 = (ALBankFile *) allocate_from_main_pool_safe(addrPtr[0], COLOUR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, (u32) ALBankFile_80115D10, 0, addrPtr[0]); alBnkfNew(ALBankFile_80115D10, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[0])); - ALSeqFile_80115CF8 = (ALSeqFile *)alHeapDBAlloc(0, 0, &gALHeap, 1, 4); - load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, addrPtr[4], 4); + ALSeqFile_80115CF8 = (ALSeqFile *) alHeapDBAlloc(0, 0, &gALHeap, 1, 4); + load_asset_to_address(ASSET_AUDIO, (u32) ALSeqFile_80115CF8, addrPtr[4], 4); seqfSize = (ALSeqFile_80115CF8->seqCount) * 8 + 4; ALSeqFile_80115CF8 = allocate_from_main_pool_safe(seqfSize, COLOUR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, addrPtr[4], seqfSize); + load_asset_to_address(ASSET_AUDIO, (u32) ALSeqFile_80115CF8, addrPtr[4], seqfSize); alSeqFileNew(ALSeqFile_80115CF8, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[4])); - D_80115D0C = (u32 *)allocate_from_main_pool_safe((ALSeqFile_80115CF8->seqCount) * 4, COLOUR_TAG_CYAN); + D_80115D0C = (u32 *) allocate_from_main_pool_safe((ALSeqFile_80115CF8->seqCount) * 4, COLOUR_TAG_CYAN); for (iCnt = 0; iCnt < ALSeqFile_80115CF8->seqCount; iCnt++) { - (u32 *)((u32)ALSeqFile_80115CF8 + 8 + iCnt * 8); + (u32 *) ((u32) ALSeqFile_80115CF8 + 8 + iCnt * 8); D_80115D0C[iCnt] = ALSeqFile_80115CF8->seqArray[iCnt].len; if (D_80115D0C[iCnt] & 1) { D_80115D0C[iCnt]++; @@ -199,8 +199,8 @@ void func_80000968(s32 arg0) { func_80004A60(1, 32767); func_80004A60(2, 0); func_80004A60(4, 0); - alCSPSetVol(gMusicPlayer, (s16)(musicRelativeVolume * musicVolumeSliderPercentage >> 2)); - alCSPSetVol(gSndFxPlayer, 0); + alCSPSetVol((ALCSPlayer *) gMusicPlayer, (s16) (musicRelativeVolume * musicVolumeSliderPercentage >> 2)); + alCSPSetVol((ALCSPlayer *) gSndFxPlayer, 0); break; case 2: func_80004A60(0, 0); @@ -219,8 +219,8 @@ void func_80000968(s32 arg0) { func_80004A60(1, 32767); func_80004A60(2, 32767); func_80004A60(4, 32767); - alCSPSetVol(gMusicPlayer, (s16)(musicRelativeVolume * musicVolumeSliderPercentage)); - alCSPSetVol(gSndFxPlayer, (s16)(sfxGetVolumeSlider() * sfxRelativeVolume)); + alCSPSetVol((ALCSPlayer *) gMusicPlayer, (s16) (musicRelativeVolume * musicVolumeSliderPercentage)); + alCSPSetVol((ALCSPlayer *) gSndFxPlayer, (s16) (sfxGetVolumeSlider() * sfxRelativeVolume)); break; } D_80115F79 = arg0; @@ -241,7 +241,7 @@ void play_music(u8 seqID) { if (D_800DC640 != 0) { func_800022BC(D_80115D04, gMusicPlayer); } - musicTempo = alCSPGetTempo(gMusicPlayer); + musicTempo = alCSPGetTempo((ALCSPlayer *) gMusicPlayer); audioPrevCount = osGetCount(); D_80115D40 = 1; D_80115F7C = -1; @@ -319,7 +319,7 @@ void handle_music_fade(u8 updateRate) { D_80115D48[reg_s2].unk2 -= updateRate; if (D_80115D48[reg_s2].unk2 <= 0) { j = reg_s2; - play_sound_global(D_80115D48[reg_s2].unk0, D_80115D48[reg_s2].unk4); + play_sound_global(D_80115D48[reg_s2].unk0, (s32 *) D_80115D48[reg_s2].unk4); D_800DC658 -= 1; while (j < D_800DC658) { @@ -339,7 +339,7 @@ void handle_music_fade(u8 updateRate) { func_8000232C(gMusicPlayer, D_80115CFC, &D_800DC65C, &D_80115D88); func_8000232C(gSndFxPlayer, D_80115D00, &D_800DC660, &D_80115E80); if (sMusicTempo == -1 && gMusicPlayer->target) { - sMusicTempo = 60000000 / alCSPGetTempo(gMusicPlayer); + sMusicTempo = 60000000 / alCSPGetTempo((ALCSPlayer *) gMusicPlayer); } } @@ -395,13 +395,13 @@ void func_80001170(u8 chan) { void musicSetChlPan(u8 chan, ALPan pan) { if (chan < 16) { - alCSPSetChlPan(gMusicPlayer, chan, pan); + alCSPSetChlPan((ALCSPlayer *) gMusicPlayer, chan, pan); } } void musicSetChlVol(u8 chan, u8 vol) { if (chan < 0x10) { - alCSPSetChlVol(gMusicPlayer, chan, vol); + alCSPSetChlVol((ALCSPlayer *) gMusicPlayer, chan, vol); } } @@ -410,7 +410,7 @@ u8 musicGetChlVol(u8 chan) { if (chan >= 16) { return 0; } else { - return alCSPGetChlVol(gMusicPlayer, chan); + return alCSPGetChlVol((ALCSPlayer *) gMusicPlayer, chan); } } @@ -424,7 +424,7 @@ u8 func_800012A8(u8 chan) { if (chan >= 16) { return 0; } - return func_80063C00(gMusicPlayer, chan); + return func_80063C00((ALCSPlayer *) gMusicPlayer, chan); } void func_800012E8(void) { @@ -446,18 +446,18 @@ u8 func_80001358(u8 arg0, u8 arg1, s32 arg2) { //u8 fadeIn_chan = arg0; if (!(arg0 == 100)) { - val_1f = arg2 + alCSPGetChlVol(gMusicPlayer, arg0); + val_1f = arg2 + alCSPGetChlVol((ALCSPlayer *) gMusicPlayer, arg0); if (val_1f > 127) { val_1f = 127; } - alCSPSetChlVol(gMusicPlayer, arg0, val_1f); + alCSPSetChlVol((ALCSPlayer *) gMusicPlayer, arg0, val_1f); } if (arg1 != 100) { - updatedVol = alCSPGetChlVol(gMusicPlayer, arg1); + updatedVol = alCSPGetChlVol((ALCSPlayer *) gMusicPlayer, arg1); val_1e = (updatedVol > arg2) ? updatedVol - arg2 : 0; - alCSPSetChlVol(gMusicPlayer, arg1, val_1e); + alCSPSetChlVol((ALCSPlayer *) gMusicPlayer, arg1, val_1e); return val_1e; } else { return 127 - val_1f; @@ -485,7 +485,7 @@ void func_800014BC(f32 arg0) { void musicSetTempo(s32 tempo) { if (tempo != 0) { f32 inv_tempo = (1.0f / tempo); - alCSPSetTempo(gMusicPlayer, (s32)(inv_tempo * 60000000.0f)); + alCSPSetTempo((ALCSPlayer *) gMusicPlayer, (s32)(inv_tempo * 60000000.0f)); sMusicTempo = tempo; } } @@ -498,7 +498,7 @@ s16 musicGetTempo(void) { } u8 music_is_playing(void) { - return (alCSPGetState(gMusicPlayer) == AL_PLAYING); + return (alCSPGetState((ALCSPlayer *) gMusicPlayer) == AL_PLAYING); } f32 audio_get_chr_select_anim_frac(void) { @@ -533,7 +533,7 @@ void func_80001784(u8 a0) { void sfxSetTempo(s32 tempo) { f32 inv_tempo = (1.0f / tempo); - alCSPSetTempo(gSndFxPlayer, (s32)(inv_tempo * 60000000.0f)); + alCSPSetTempo((ALCSPlayer *) gSndFxPlayer, (s32)(inv_tempo * 60000000.0f)); } void func_80001844(void) { @@ -589,7 +589,7 @@ void set_relative_volume_for_music(u8 vol) { musicRelativeVolume = vol; normalized_vol = musicVolumeSliderPercentage * musicRelativeVolume * sMusicFadeVolume; - alCSPSetVol(gMusicPlayer, (s16)((s32)(sMusicVolumeMultiplier * normalized_vol) >> 8)); + alCSPSetVol((ALCSPlayer *) gMusicPlayer, (s16)((s32)(sMusicVolumeMultiplier * normalized_vol) >> 8)); } void set_music_volume_slider(u32 slider_val) { @@ -598,7 +598,7 @@ void set_music_volume_slider(u32 slider_val) { slider_val = (slider_val <= 256) ? slider_val : 256; musicVolumeSliderPercentage = slider_val; normalized_vol = musicVolumeSliderPercentage * musicRelativeVolume * sMusicFadeVolume; - alCSPSetVol(gMusicPlayer, (s16)((s32)(sMusicVolumeMultiplier * normalized_vol) >> 8)); + alCSPSetVol((ALCSPlayer *) gMusicPlayer, (s16)((s32)(sMusicVolumeMultiplier * normalized_vol) >> 8)); } u8 musicGetRelativeVolume(void) { @@ -611,13 +611,13 @@ s32 musicGetVolSliderPercentage(void) { void sfxSetRelativeVolume(u8 arg0) { sfxRelativeVolume = arg0; - alCSPSetVol(gSndFxPlayer, (s16)(sfxGetVolumeSlider() * sfxRelativeVolume)); + alCSPSetVol((ALCSPlayer *) gSndFxPlayer, (s16)(sfxGetVolumeSlider() * sfxRelativeVolume)); } void sfxSetPan(ALPan pan) { u32 iChan; for (iChan = 0; iChan < 16; iChan++) { - alCSPSetChlPan(gSndFxPlayer, iChan, pan); + alCSPSetChlPan((ALCSPlayer *) gSndFxPlayer, iChan, pan); } return; } @@ -674,14 +674,14 @@ void play_sound_global(u16 soundID, s32 *soundMask) { } else { volumeF = sSoundEffectsPool[soundID].unk4 / 100.0f; if (soundMask != NULL) { - func_80004668(ALBankFile_80115D14->bankArray[0], soundBite, sSoundEffectsPool[soundID].unk8, soundMask); + func_80004668(ALBankFile_80115D14->bankArray[0], soundBite, sSoundEffectsPool[soundID].unk8, (s32) soundMask); if (*soundMask != NULL) { func_800049F8(*soundMask, 8, sSoundEffectsPool[soundID].unk2 * 256); func_800049F8(*soundMask, 16, *((u32*) &volumeF)); } } else { soundMask = (s32 *) &gGlobalSoundMask; - func_80004668(ALBankFile_80115D14->bankArray[0], soundBite, sSoundEffectsPool[soundID].unk8, &gGlobalSoundMask); + func_80004668(ALBankFile_80115D14->bankArray[0], soundBite, sSoundEffectsPool[soundID].unk8, (s32) &gGlobalSoundMask); if (*soundMask != NULL) { func_800049F8(*soundMask, 8, sSoundEffectsPool[soundID].unk2 * 256); func_800049F8(*soundMask, 16, *((u32*) &volumeF)); @@ -698,26 +698,26 @@ void play_sound_global(u16 soundID, s32 *soundMask) { */ void play_sound_spatial(u16 soundID, f32 x, f32 y, f32 z, s32 **soundMask) { if (soundMask == NULL) { - soundMask = &gSpatialSoundMask; + soundMask = (s32 **) &gSpatialSoundMask; } - play_sound_global(soundID, soundMask); + play_sound_global(soundID, (s32 *) soundMask); if (*soundMask != NULL) { func_80009B7C(*soundMask, x, y, z); } } -void func_80001F14(u16 soundID, u32 *arg1) { +void func_80001F14(u16 soundID, s32 *arg1) { if (soundID <= 0 || ALBankFile_80115D14_GetSoundCount() < soundID) { if (arg1) { *arg1 = 0; } } else { if (arg1) { - func_80004638(ALBankFile_80115D14->bankArray[0], (s16)soundID, arg1); + func_80004638(ALBankFile_80115D14->bankArray[0], (s16) soundID, (s32) arg1); } else { - func_80004638(ALBankFile_80115D14->bankArray[0], (s16)soundID, &D_80115F88); + func_80004638(ALBankFile_80115D14->bankArray[0], (s16) soundID, (s32) &D_80115F88); } } } @@ -725,20 +725,20 @@ void func_80001F14(u16 soundID, u32 *arg1) { void func_80001FB8(u16 soundID, void *soundState, u8 volume) { s32 new_var = ((s32) (sSoundEffectsPool[soundID].unk2 * (volume / 127.0f))) * 256; if (soundState) { - func_800049F8(soundState, 8, new_var); + func_800049F8((s32) soundState, 8, new_var); } } UNUSED void func_8000208C(void *sndState, u8 arg1) { if (sndState != NULL) { - func_800049F8(sndState, 8, arg1 << 8); + func_800049F8((s32) sndState, 8, arg1 << 8); } } UNUSED void func_800020BC(void *sndState, u32 arg1) { u32 *temp = &arg1; if (sndState != NULL) { - func_800049F8(sndState, 16, *temp); + func_800049F8((s32) sndState, 16, *temp); } } @@ -800,7 +800,7 @@ ALSeqPlayer *func_80002224(s32 _max_voices, s32 _max_events) { alCSPSetBank(cseqp, ALBankFile_80115D10->bankArray[0]); cseqp->unk36 = 0x7F; - return cseqp; + return (ALSeqPlayer *) cseqp; } void func_800022BC(u8 arg0, ALSeqPlayer *arg1) { @@ -820,7 +820,7 @@ void func_8000232C(ALSeqPlayer *arg0, void *arg1, u8 *arg2, ALCSeq *arg3) { u8 temp_a0_2; if ((alCSPGetState((ALCSPlayer* ) arg0) == 0) && (*arg2 != 0)) { - load_asset_to_address(0x27U, arg1, ALSeqFile_80115CF8->seqArray[*arg2].offset - get_rom_offset_of_asset(0x27U, 0U), (s32) D_80115D0C[*arg2]); + load_asset_to_address(ASSET_AUDIO, (u32) arg1, ALSeqFile_80115CF8->seqArray[*arg2].offset - get_rom_offset_of_asset(ASSET_AUDIO, 0), (s32) D_80115D0C[*arg2]); alCSeqNew(arg3, arg1); alCSPSetSeq((ALCSPlayer* ) arg0, arg3); alCSPPlay((ALCSPlayer* ) arg0); @@ -859,12 +859,12 @@ void func_8000232C(ALSeqPlayer *arg0, void *arg1, u8 *arg2, ALCSeq *arg3) { void func_80002570(ALSeqPlayer *seqp) { if (gMusicPlayer == seqp && D_80115D40 != 0) { - alCSPStop(seqp); + alCSPStop((ALCSPlayer *) seqp); D_80115D40 = 0; D_80115D04 = 0; D_800DC65C = 0; } else if (gSndFxPlayer == seqp && D_80115D41 != 0) { - alCSPStop(seqp); + alCSPStop((ALCSPlayer *) seqp); D_80115D41 = 0; D_800DC660 = 0; } diff --git a/src/audio.h b/src/audio.h index 23686dea..66bc2cd4 100644 --- a/src/audio.h +++ b/src/audio.h @@ -122,7 +122,7 @@ u32 func_80001C08(void); void func_80001C5C(u16 arg0); u16 func_80001CB8(u16 arg0); void play_sound_spatial(u16 soundID, f32 x, f32 y, f32 z, s32 **arg4); -void func_80001F14(u16 soundID, u32 *arg1); +void func_80001F14(u16 soundID, s32 *arg1); u16 ALBankFile_80115D14_GetSoundCount(void); u8 ALSeqFile_80115CF8_GetSeqCount(void); void func_80002128(unk80115D18 **arg0, s32 *arg1, s32 *arg2); diff --git a/src/camera.c b/src/camera.c index 9d4b893f..bed16b02 100644 --- a/src/camera.c +++ b/src/camera.c @@ -125,14 +125,14 @@ f32 D_80120D40[6]; f32 D_80120D58[5]; u16 perspNorm; Matrix *D_80120D70[6]; -Matrix *D_80120D88[6]; +MatrixS *D_80120D88[6]; Matrix D_80120DA0[5]; Matrix D_80120EE0; // Perspective matrix? Matrix D_80120F20; Matrix D_80120F60; Matrix D_80120FA0; -Matrix D_80120FE0; -Matrix D_80121020; +MatrixS D_80120FE0; +MatrixS D_80121020; Matrix D_80121060; Matrix D_801210A0; OSMesgQueue sSIMesgQueue; @@ -248,7 +248,7 @@ s32 get_current_viewport(void) { return gActiveCameraID; } -void func_80066230(Gfx **dlist, Matrix **mats) { +void func_80066230(Gfx **dlist, MatrixS **mats) { ObjectSegment *someStruct; s16 sp2A; s16 sp28; @@ -615,7 +615,7 @@ UNUSED void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2) #define SCISSOR_INTERLACE G_SC_NON_INTERLACE -void func_80066CDC(Gfx **dlist, Matrix **mats) { +void func_80066CDC(Gfx **dlist, MatrixS **mats) { u32 sp58; u32 sp54; u32 sp4C; @@ -841,7 +841,7 @@ void func_80067A3C(Gfx **dlist) { gDPSetScissor((*dlist)++, 0, 0, 0, width, height); } -void func_80067D3C(Gfx **dlist, UNUSED Matrix **mats) { +void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats) { s32 temp; gSPPerspNormalize((*dlist)++, perspNorm); @@ -862,7 +862,7 @@ void func_80067D3C(Gfx **dlist, UNUSED Matrix **mats) { } D_80120CF0.z_position = -gActiveCameraStack[gActiveCameraID].trans.z_position; - object_transform_to_matrix_2(&D_80120F60, &D_80120CF0); + object_transform_to_matrix_2(D_80120F60, &D_80120CF0); f32_matrix_mult(&D_80120F60, &D_80120EE0, &D_80120F20); D_80120CF0.y_rotation = -0x8000 - gActiveCameraStack[gActiveCameraID].trans.y_rotation; @@ -890,7 +890,7 @@ void set_ortho_matrix_height(f32 value) { gOrthoMatrix[1][1] = value; } -void func_80067F2C(Gfx **dlist, Matrix **mats) { +void func_80067F2C(Gfx **dlist, MatrixS **mtx) { u32 widthAndHeight; s32 width, height; s32 i, j; @@ -898,14 +898,14 @@ void func_80067F2C(Gfx **dlist, Matrix **mats) { widthAndHeight = get_video_width_and_height_as_s32(); height = GET_VIDEO_HEIGHT(widthAndHeight); width = GET_VIDEO_WIDTH(widthAndHeight); - f32_matrix_to_s16_matrix(&gOrthoMatrix, (Matrix *)*mats); - D_80120D88[0] = (Matrix *) *mats; + f32_matrix_to_s16_matrix(&gOrthoMatrix, *mtx); + D_80120D88[0] = *mtx; D_800DD148[gActiveCameraID + 5].vp.vscale[0] = width * 2; D_800DD148[gActiveCameraID + 5].vp.vscale[1] = width * 2; D_800DD148[gActiveCameraID + 5].vp.vtrans[0] = width * 2; D_800DD148[gActiveCameraID + 5].vp.vtrans[1] = height * 2; gSPViewport((*dlist)++, OS_K0_TO_PHYSICAL(&D_800DD148[gActiveCameraID + 5])); - gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mats)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); D_80120D1C = 0; D_80120D08 = 0; @@ -917,13 +917,13 @@ void func_80067F2C(Gfx **dlist, Matrix **mats) { } } -void func_8006807C(Gfx **dlist, Matrix **mats) { - object_transform_to_matrix_2(&D_80121060, &D_800DD288); +void func_8006807C(Gfx **dlist, MatrixS **mtx) { + object_transform_to_matrix_2(D_80121060, &D_800DD288); f32_matrix_mult(&D_80121060, &D_80120EE0, &D_80120F20); - object_transform_to_matrix_2(D_80120D70[0], &D_800DD2A0); + object_transform_to_matrix_2((float (*)[4]) D_80120D70[0], &D_800DD2A0); f32_matrix_mult(D_80120D70[0], &D_80120F20, &D_80121060); - f32_matrix_to_s16_matrix(&D_80121060, (Matrix *)*mats); - gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mats)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + f32_matrix_to_s16_matrix(&D_80121060, *mtx); + gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); D_80120D1C = 0; D_80120D08 = 0; } @@ -962,12 +962,12 @@ void func_800682AC(Gfx **dlist) { gActiveCameraID = 0; } -void func_80068408(Gfx **dlist, Matrix **mats) { +void func_80068408(Gfx **dlist, MatrixS **mtx) { f32_matrix_from_position(D_80120D70[D_80120D1C], 0.0f, 0.0f, 0.0f); f32_matrix_mult(D_80120D70[D_80120D1C], &D_80120F20, &D_80121060); - f32_matrix_to_s16_matrix(&D_80121060, (Matrix *)*mats); - D_80120D88[D_80120D1C] = (Matrix *) *mats; - gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mats)++), D_80120D08 << 6); + f32_matrix_to_s16_matrix(&D_80121060, *mtx); + D_80120D88[D_80120D1C] = *mtx; + gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), D_80120D08 << 6); } void func_80068508(s32 arg0) { @@ -977,7 +977,7 @@ void func_80068508(s32 arg0) { /** * Calculates angle from object to camera, then renders the sprite as a billboard, facing the camera. */ -s32 render_sprite_billboard(Gfx **dlist, Matrix **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags) { +s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags) { f32 sp5C; f32 sp58; Vertex *v; @@ -1086,7 +1086,7 @@ s32 render_sprite_billboard(Gfx **dlist, Matrix **mtx, Vertex **vertexList, Obje return result; } -void func_80068BF4(Gfx **arg0, Matrix **arg1, Vertex **arg2, ObjectSegment *arg3, unk80068BF4 *arg4, s32 arg5) { +void func_80068BF4(Gfx **dList, MatrixS **mtx, Vertex **vtx, ObjectSegment *segment, unk80068BF4 *arg4, s32 flags) { UNUSED s32 pad; f32 scale; s32 index; @@ -1095,80 +1095,80 @@ void func_80068BF4(Gfx **arg0, Matrix **arg1, Vertex **arg2, ObjectSegment *arg3 Matrix sp50; if (arg4 != NULL) { - temp_v1 = *arg2; - temp_v1->x = arg3->trans.x_position; - temp_v1->y = arg3->trans.y_position; - temp_v1->z = arg3->trans.z_position; + temp_v1 = *vtx; + temp_v1->x = segment->trans.x_position; + temp_v1->y = segment->trans.y_position; + temp_v1->z = segment->trans.z_position; temp_v1->r = 255; temp_v1->g = 255; temp_v1->b = 255; temp_v1->a = 255; - gDkrVertices((*arg0)++, OS_PHYSICAL_TO_K0(*arg2), (((s32)OS_PHYSICAL_TO_K0(*arg2)) & 6), 13); - (*arg2)++; // Can't be done in the macro? - index = arg3->unk18; + gDkrVertices((*dList)++, OS_PHYSICAL_TO_K0(*vtx), (((s32)OS_PHYSICAL_TO_K0(*vtx)) & 6), 13); + (*vtx)++; // Can't be done in the macro? + index = segment->unk18; D_80120D1C ++; - D_80120CF0.y_rotation = -arg3->trans.y_rotation; - D_80120CF0.x_rotation = -arg3->trans.x_rotation; - D_80120CF0.z_rotation = gActiveCameraStack[gActiveCameraID].trans.z_rotation + arg3->trans.z_rotation; + D_80120CF0.y_rotation = -segment->trans.y_rotation; + D_80120CF0.x_rotation = -segment->trans.x_rotation; + D_80120CF0.z_rotation = gActiveCameraStack[gActiveCameraID].trans.z_rotation + segment->trans.z_rotation; D_80120CF0.x_position = 0.0f; D_80120CF0.y_position = 0.0f; D_80120CF0.z_position = 0.0f; if (gAdjustViewportHeight) { - scale = arg3->trans.scale; + scale = segment->trans.scale; f32_matrix_from_scale(sp50, scale, scale, 1.0f); f32_matrix_from_rotation_and_scale(sp90, 0, 1.0f, gVideoAspectRatio); f32_matrix_mult(&sp90, &sp50, &D_80121060); } else { - scale = arg3->trans.scale; + scale = segment->trans.scale; f32_matrix_from_scale(D_80121060, scale, scale, 1.0f); } - object_transform_to_matrix_2(&sp90, &D_80120CF0); + object_transform_to_matrix_2(sp90, &D_80120CF0); f32_matrix_mult(&D_80121060, &sp90, D_80120D70[D_80120D1C]); - f32_matrix_to_s16_matrix(D_80120D70[D_80120D1C], *arg1); - D_80120D88[D_80120D1C] = *arg1; - gSPMatrix((*arg0)++, OS_PHYSICAL_TO_K0((*arg1)++), G_MTX_DKR_INDEX_2); - gDkrEnableBillboard((*arg0)++); + f32_matrix_to_s16_matrix(D_80120D70[D_80120D1C], *mtx); + D_80120D88[D_80120D1C] = *mtx; + gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2); + gDkrEnableBillboard((*dList)++); if (D_80120D0C == 0) { index = (((u8) index) * arg4->unk0) >> 8; } - func_8007BF34(arg0, arg4->unk6 | arg5); + func_8007BF34(dList, arg4->unk6 | flags); if (index >= arg4->unk0) { index = arg4->unk0 - 1; } - gSPDisplayList((*arg0)++, arg4->unkC[index]); + gSPDisplayList((*dList)++, arg4->unkC[index]); if (--D_80120D1C == 0) { index = 0; } else { index = 1; } - gDkrInsertMatrix((*arg0)++, 0, index << 6); - gDkrDisableBillboard((*arg0)++); + gDkrInsertMatrix((*dList)++, 0, index << 6); + gDkrDisableBillboard((*dList)++); } } GLOBAL_ASM("asm/non_matchings/camera/func_80068FA8.s") -void func_80069484(Gfx **arg0, Matrix **arg1, ObjectTransform *arg2, f32 arg3, f32 arg4) { +void func_80069484(Gfx **dList, MatrixS **mtx, ObjectTransform *trans, f32 scale, f32 scaleY) { f32 tempX; f32 tempY; f32 tempZ; s32 index; f32 scaleFactor; - object_transform_to_matrix(D_80121060, arg2); - if (arg4 != 0.0f) { - f32_matrix_y_scale(&D_80121060, arg4); + object_transform_to_matrix(D_80121060, trans); + if (scaleY != 0.0f) { + f32_matrix_y_scale(&D_80121060, scaleY); } - if (arg3 != 1.0f) { - f32_matrix_scale(&D_80121060, arg3); + if (scale != 1.0f) { + f32_matrix_scale(&D_80121060, scale); } f32_matrix_mult(&D_80121060, D_80120D70[D_80120D1C], D_80120D70[D_80120D1C + 1]); f32_matrix_mult(D_80120D70[D_80120D1C + 1], &D_80120F20, &D_801210A0); - f32_matrix_to_s16_matrix(&D_801210A0, *arg1); + f32_matrix_to_s16_matrix(&D_801210A0, *mtx); D_80120D1C++; - D_80120D88[0, D_80120D1C] = *arg1; // Should be [D_80120D1C], but only matches with [0, D_80120D1C] - if (1) { } if (1) { } if (1) { }; // Necessary to match - gSPMatrix((*arg0)++, OS_PHYSICAL_TO_K0((*arg1)++), G_MTX_DKR_INDEX_1); + D_80120D88[0, D_80120D1C] = *mtx; // Should be [D_80120D1C], but only matches with [0, D_80120D1C] + if (1) { } if (1) { } if (1) { }; // Fakematch + gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_1); guMtxXFMF(*D_80120D70[D_80120D1C], 0.0f, 0.0f, 0.0f, &tempX, &tempY, &tempZ); index = gActiveCameraID; if (gCutsceneCameraActive) { @@ -1177,16 +1177,16 @@ void func_80069484(Gfx **arg0, Matrix **arg1, ObjectTransform *arg2, f32 arg3, f tempX = gActiveCameraStack[index].trans.x_position - tempX; tempY = gActiveCameraStack[index].trans.y_position - tempY; tempZ = gActiveCameraStack[index].trans.z_position - tempZ; - D_80120CF0.y_rotation = -arg2->y_rotation; - D_80120CF0.x_rotation = -arg2->x_rotation; - D_80120CF0.z_rotation = -arg2->z_rotation; + D_80120CF0.y_rotation = -trans->y_rotation; + D_80120CF0.x_rotation = -trans->x_rotation; + D_80120CF0.z_rotation = -trans->z_rotation; D_80120CF0.x_position = 0.0f; D_80120CF0.y_position = 0.0f; D_80120CF0.z_position = 0.0f; D_80120CF0.scale = 1.0f; - object_transform_to_matrix_2(&D_80121060, &D_80120CF0); + object_transform_to_matrix_2(D_80121060, &D_80120CF0); guMtxXFMF(D_80121060, tempX, tempY, tempZ, &tempX, &tempY, &tempZ); - scaleFactor = 1.0f / arg2->scale; + scaleFactor = 1.0f / trans->scale; tempX *= scaleFactor; tempY *= scaleFactor; tempZ *= scaleFactor; @@ -1272,7 +1272,7 @@ Matrix *func_80069DA4(void) { return &D_80120FA0; } -Matrix *func_80069DB0(void) { +MatrixS *func_80069DB0(void) { return &D_80120FE0; } diff --git a/src/camera.h b/src/camera.h index f8680db6..4ce1e61c 100644 --- a/src/camera.h +++ b/src/camera.h @@ -118,7 +118,7 @@ UNUSED void calculate_camera_perspective(void); Matrix *func_80066204(void); s32 get_viewport_count(void); s32 get_current_viewport(void); -void func_80066230(Gfx **dlist, Matrix **arg1); +void func_80066230(Gfx **dlist, MatrixS **arg1); f32 get_distance_to_active_camera(f32 xPos, f32 yPos, f32 zPos); void func_800663DC(s32 xPos, s32 yPos, s32 zPos, s32 arg3, s32 arg4, s32 arg5); void write_to_object_render_stack(s32 arg0, f32 xPos, f32 yPos, f32 zPos, s16 arg4, s16 arg5, s16 arg6); @@ -135,17 +135,17 @@ s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, void copy_viewport_frame_size_to_coords(s32 viewPortIndex, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4); void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2); void set_ortho_matrix_height(f32 value); -void func_80067F2C(Gfx **dlist, Matrix **mats); -void func_8006807C(Gfx **dlist, Matrix **mats); +void func_80067F2C(Gfx **dlist, MatrixS **mats); +void func_8006807C(Gfx **dlist, MatrixS **mats); void func_80068158(Gfx **dlist, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_800682AC(Gfx **dlist); -void func_80068408(Gfx **dlist, Matrix **mats); +void func_80068408(Gfx **dlist, MatrixS **mats); void func_80068508(s32 arg0); ObjectSegment *func_80069CFC(void); ObjectSegment *func_80069D20(void); ObjectSegment *func_80069D7C(void); Matrix *func_80069DA4(void); -Matrix *func_80069DB0(void); +MatrixS *func_80069DB0(void); Matrix *func_80069DBC(void); f32 func_80069DC8(f32 x, f32 y, f32 z); void func_80069E14(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4); @@ -164,10 +164,10 @@ s8 clamp_joystick_y_axis(s32 player); s8 clamp_joystick(s8 stickMag); void disable_button_mask(void); s32 init_controllers(void); -void func_80067D3C(Gfx **dlist, UNUSED Matrix **mats); -void func_80068BF4(Gfx **arg0, Matrix **arg1, Vertex **arg2, ObjectSegment *arg3, unk80068BF4 *arg4, s32 arg5); -s32 render_sprite_billboard(Gfx **dlist, Matrix **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags); -void func_80069484(Gfx **arg0, Matrix **arg1, ObjectTransform *arg2, f32 arg3, f32 arg4); +void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats); +void func_80068BF4(Gfx **dList, MatrixS **mtx, Vertex **vtx, ObjectSegment *segment, unk80068BF4 *arg4, s32 flags); +s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags); +void func_80069484(Gfx **arg0, MatrixS **arg1, ObjectTransform *arg2, f32 arg3, f32 arg4); void func_80067A3C(Gfx **dlist); void func_80069A40(Gfx **dlist); @@ -175,6 +175,6 @@ void func_80069A40(Gfx **dlist); void func_80066610(void); void func_80065EA0(void); s32 func_8006A1C4(s32 arg0, s32 logicUpdateRate); -void func_80066CDC(Gfx **dlist, Matrix **mats); +void func_80066CDC(Gfx **dlist, MatrixS **mats); #endif diff --git a/src/fade_transition.c b/src/fade_transition.c index ba9ab119..09a8a7a6 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -338,7 +338,7 @@ s32 handle_transitions(s32 updateRate) { * The rendering portion of transitions. * First establishes an orthogonal matrix, then renders a transition effect onscreen. */ -void render_fade_transition(Gfx **dlist, Matrix **mats, VertexList **verts) { +void render_fade_transition(Gfx **dlist, MatrixS **mats, Vertex **verts) { if (sTransitionStatus != TRANSITION_NONE) { if (osTvType == TV_TYPE_PAL) { set_ortho_matrix_height(1.4f); @@ -404,7 +404,7 @@ void func_800C0780(FadeTransition *transition) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0834.s") -void render_fade_fullscreen(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { +void render_fade_fullscreen(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts) { s32 screenSize = get_video_width_and_height_as_s32(); gSPDisplayList((*dlist)++, dTransitionFadeSettings); gDPSetPrimColor((*dlist)++, 0, 0, gCurFadeRed, gCurFadeGreen, gCurFadeBlue, gCurFadeAlpha); @@ -416,7 +416,7 @@ void render_fade_fullscreen(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0B00.s") GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1130.s") -void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { +void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts) { reset_render_settings(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. @@ -426,7 +426,7 @@ void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED Matrix **mats, UNUSED V } // This is exactly the same as render_fade_barndoor_horizontal; I wonder what gets changed then? -void render_fade_barndoor_vertical(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { +void render_fade_barndoor_vertical(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts) { reset_render_settings(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. @@ -439,7 +439,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C15D4.s") GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1EE8.s") #ifdef NON_EQUIVALENT -void render_fade_circle(Gfx **dlist, Matrix **mats, VertexList **verts) { +void render_fade_circle(Gfx **dlist, MatrixS **mats, Vertex **verts) { u8 *addr, *addr2; reset_render_settings(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); @@ -467,7 +467,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_circle.s") #ifdef NON_EQUIVALENT // This doesn't work properly. -void render_fade_waves(Gfx **dlist, Matrix **mats, VertexList **verts) { +void render_fade_waves(Gfx **dlist, MatrixS **mats, Vertex **verts) { s32 i; reset_render_settings(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); @@ -487,7 +487,7 @@ void render_fade_waves(Gfx **dlist, Matrix **mats, VertexList **verts) { GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_waves.s") #endif -void render_fade_barndoor_diagonal(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { +void render_fade_barndoor_diagonal(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts) { reset_render_settings(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. @@ -528,7 +528,7 @@ void func_800C27A0(s32 updateRate) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C27A0.s") #endif -void render_fade_disabled(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { +void render_fade_disabled(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts) { s32 screenSize = get_video_width_and_height_as_s32(); gSPDisplayList((*dlist)++, dTransitionFadeSettings); gDPSetPrimColor((*dlist)++, 0, 0, (gLastFadeRed >> 16), (gLastFadeGreen >> 16), (gLastFadeBlue >> 16), 255); diff --git a/src/fade_transition.h b/src/fade_transition.h index 4723a8e6..27a1f23a 100644 --- a/src/fade_transition.h +++ b/src/fade_transition.h @@ -41,16 +41,16 @@ void func_800C0180(void); u32 func_800C018C(void); void transition_end(void); s32 handle_transitions(s32 updateRate); -void render_fade_transition(Gfx **dlist, Matrix **mats, VertexList **verts); -void render_fade_fullscreen(Gfx **dlist, Matrix **mats, VertexList **verts); -void render_fade_barndoor_horizontal(Gfx **dlist, Matrix **mats, VertexList **verts); -void render_fade_barndoor_vertical(Gfx **dlist, Matrix **mats, VertexList **verts); -void render_fade_barndoor_diagonal(Gfx **dlist, Matrix **mats, VertexList **verts); -void render_fade_disabled(Gfx **dlist, Matrix **mats, VertexList **verts); +void render_fade_transition(Gfx **dlist, MatrixS **mats, Vertex **verts); +void render_fade_fullscreen(Gfx **dlist, MatrixS **mats, Vertex **verts); +void render_fade_barndoor_horizontal(Gfx **dlist, MatrixS **mats, Vertex **verts); +void render_fade_barndoor_vertical(Gfx **dlist, MatrixS **mats, Vertex **verts); +void render_fade_barndoor_diagonal(Gfx **dlist, MatrixS **mats, Vertex **verts); +void render_fade_disabled(Gfx **dlist, MatrixS **mats, Vertex **verts); void func_800C0780(FadeTransition *transition); -void render_fade_circle(Gfx **dlist, Matrix **mats, VertexList **verts); //Non Matching -void render_fade_waves(Gfx **dlist, Matrix **mats, VertexList **verts); //Non Matching +void render_fade_circle(Gfx **dlist, MatrixS **mats, Vertex **verts); //Non Matching +void render_fade_waves(Gfx **dlist, MatrixS **mats, Vertex **verts); //Non Matching void func_800C0834(s32); //Non Matching void func_800C1130(s32); //Non Matching void func_800C1EE8(s32); //Non Matching diff --git a/src/font.c b/src/font.c index e1a14193..c392fa5e 100644 --- a/src/font.c +++ b/src/font.c @@ -803,7 +803,7 @@ void func_800C56D0(s32 dialogueBoxID) { * Contains a timer that counts down two frames before closing a dialogue box * when the player exits out of one. */ -void render_dialogue_boxes(Gfx **dlist, Matrix **mat, VertexList **verts) { +void render_dialogue_boxes(Gfx **dlist, MatrixS **mat, Vertex **verts) { s32 i; if (sDialogueBoxIsOpen) { @@ -891,7 +891,7 @@ void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) { /** * Render the selected dialogue box. Background first, then text. */ -void render_dialogue_box(Gfx **dlist, Matrix **mat, VertexList **verts, s32 dialogueBoxID) { +void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogueBoxID) { DialogueBoxBackground *dialogueBox; DialogueBox *dialogueTextBox; s32 i; diff --git a/src/font.h b/src/font.h index ac7a8e4b..747a0bdc 100644 --- a/src/font.h +++ b/src/font.h @@ -175,9 +175,9 @@ UNUSED void set_dialogue_box_unused_flag(s32 dialogueBoxID); UNUSED void dialogue_box_clear_flags(s32 dialogueBoxID); UNUSED void enable_dialogue_box_vertices(s32 dialogueBoxID); void func_800C56D0(s32 dialogueBoxID); -void render_dialogue_boxes(Gfx **dlist, Matrix **mat, VertexList **verts); +void render_dialogue_boxes(Gfx **dlist, MatrixS **mat, Vertex **verts); void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry); -void render_dialogue_box(Gfx **dlist, Matrix **mat, VertexList **verts, s32 dialogueBoxID); +void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogueBoxID); void parse_string_with_number(char *input, char *output, s32 number); void s32_to_string(char **outString, s32 number); void load_font(s32 fontID); diff --git a/src/game.c b/src/game.c index 0bed50c2..da419453 100644 --- a/src/game.c +++ b/src/game.c @@ -61,7 +61,7 @@ UNUSED const char sDebugVehicleSwapString[] = "Swapping\n"; /************ .data ************/ -s8 *D_800DD310 = NULL; // Currently unknown, might be a different type. +char *D_800DD310 = NULL; // Currently unknown, might be a different type. s8 D_800DD314 = -1; u8 D_800DD318 = 0; s32 D_800DD31C = 0; @@ -123,9 +123,9 @@ extern s32 gShowControllerPakMenu; /************ .bss ************/ s32 *gTempAssetTable; -MapId gMapId; +s32 gMapId; LevelHeader *gCurrentLevelHeader; -u8 **gLevelNames; +char **gLevelNames; s32 gNumberOfLevelHeaders; s32 gNumberOfWorlds; @@ -139,10 +139,10 @@ s16 D_801211C8[20]; Gfx *gDisplayLists[2]; Gfx *gCurrDisplayList; UNUSED s32 D_801211FC; -Matrix *gHudMatrices[2]; -Matrix *gGameCurrMatrix; -VertexList *gHudVertices[2]; -VertexList *gGameCurrVertexList; +MatrixS *gHudMatrices[2]; +MatrixS *gGameCurrMatrix; +Vertex *gHudVertices[2]; +Vertex *gGameCurrVertexList; TriangleList *gHudTriangles[2]; TriangleList *gGameCurrTriList; UNUSED s32 D_80121230[8]; @@ -153,7 +153,7 @@ s32 gSPTaskNum; s32 sRenderContext; s32 D_801234F0; // Similar to gMapId, but is 0 if not currently playing a level (e.g. start menu). -MapId gPlayableMapId; +s32 gPlayableMapId; s32 D_801234F8; s32 D_801234FC; s32 D_80123500; @@ -246,7 +246,7 @@ void func_8006A6B0(void) { D_800DD310 = allocate_from_main_pool_safe(temp, COLOUR_TAG_YELLOW); load_asset_to_address(ASSET_LEVEL_NAMES, (u32) D_800DD310, 0, temp); for (count = 0; count < i; count++) { - gLevelNames[count] = (u8 *) &D_800DD310[gTempAssetTable[count]]; + gLevelNames[count] = (char *) &D_800DD310[gTempAssetTable[count]]; } free_from_memory_pool(gTempAssetTable); @@ -299,14 +299,14 @@ s32 func_8006B054(s8 arg0) { return out; } -Vehicle get_map_default_vehicle(MapId mapId) { +Vehicle get_map_default_vehicle(s32 mapId) { if (mapId > 0 && mapId < gNumberOfLevelHeaders) { return D_8012117C[mapId].unk2 & 0xF; } return VEHICLE_CAR; } -s32 get_map_available_vehicles(MapId mapId) { +s32 get_map_available_vehicles(s32 mapId) { if (mapId > 0 && mapId < gNumberOfLevelHeaders) { s32 temp = D_8012117C[mapId].unk2; if (temp != 0) { @@ -316,21 +316,21 @@ s32 get_map_available_vehicles(MapId mapId) { return 1; } -s8 func_8006B14C(MapId mapId) { +s8 func_8006B14C(s32 mapId) { if (mapId >= 0 && mapId < gNumberOfLevelHeaders) { return D_8012117C[mapId].unk1; } return -1; } -s8 func_8006B190(MapId mapId) { +s8 func_8006B190(s32 mapId) { if (mapId >= 0 && mapId < gNumberOfLevelHeaders) { return D_8012117C[mapId].unk0; } return 0; } -MapId get_hub_area_id(s32 worldId) { +s32 get_hub_area_id(s32 worldId) { s8 *hubAreaIds; if (worldId < 0 || worldId >= gNumberOfWorlds) { @@ -353,9 +353,9 @@ s32 func_8006B240(void) { // This isn't matching, but there shouldn't be any issues (hopefully). #ifdef NON_EQUIVALENT -void load_level(MapId levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId) { +void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId) { s32 maxLevelCount; - MapId sp44; + s32 sp44; s32 noPlayers; s32 phi_s0; s32 vehicle; @@ -612,7 +612,7 @@ void func_8006BD10(f32 arg0) { } } -MapId func_8006BD88(void) { +s32 func_8006BD88(void) { return gMapId; } @@ -641,8 +641,8 @@ UNUSED u8 get_total_level_header_count(void) { /** * Returns the name of the level from the passed ID */ -char *get_level_name(MapId levelId) { - u8 *levelName; +char *get_level_name(s32 levelId) { + char *levelName; u8 numberOfNullPointers = 0; if (levelId < 0 || levelId >= gNumberOfLevelHeaders) { @@ -765,7 +765,7 @@ s8 func_8006C19C(void) { } // Push a stack onto D_801211C8 -void func_8006C1AC(MapId levelId, s32 entranceId, Vehicle vehicleId, s32 cutsceneId) { +void func_8006C1AC(s32 levelId, s32 entranceId, Vehicle vehicleId, s32 cutsceneId) { D_801211C8[D_800DD328++] = levelId; D_801211C8[D_800DD328++] = entranceId; D_801211C8[D_800DD328++] = vehicleId; @@ -1031,7 +1031,7 @@ void func_8006CAE4(s32 arg0, s32 arg1, Vehicle vehicle) { * which is the value at D_80123508. Also does some other stuff. * Needs a better name! */ -void load_level_2(MapId levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId) { +void load_level_2(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId) { func_8006ECFC(numberOfPlayers); set_free_queue_state(0); func_80065EA0(); @@ -1273,8 +1273,8 @@ void ingame_logic_loop(s32 updateRate) { func_8006C22C(&gPlayableMapId, &D_80123504, &i, &D_80123508); func_8006F42C(); if (gPlayableMapId < 0) { - if (gPlayableMapId == (MapId)SPECIAL_MAP_ID_NO_LEVEL || gPlayableMapId == (MapId)SPECIAL_MAP_ID_UNK_NEG10) { - if (gPlayableMapId == (MapId)SPECIAL_MAP_ID_UNK_NEG10 && is_in_two_player_adventure()) { + if (gPlayableMapId == (s32)SPECIAL_MAP_ID_NO_LEVEL || gPlayableMapId == (s32)SPECIAL_MAP_ID_UNK_NEG10) { + if (gPlayableMapId == (s32)SPECIAL_MAP_ID_UNK_NEG10 && is_in_two_player_adventure()) { func_8006F398(); } buttonHeldInputs |= L_TRIG; @@ -1501,7 +1501,7 @@ Vehicle get_level_default_vehicle(void) { * Calls load_level() with the same arguments, but also does some other stuff. * Needs a better name! */ -void load_level_3(MapId levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId) { +void load_level_3(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId) { set_free_queue_state(0); func_80065EA0(); func_800C3048(); @@ -1661,7 +1661,7 @@ void func_8006DCF8(s32 updateRate) { GLOBAL_ASM("asm/non_matchings/game/func_8006DCF8.s") #endif -void load_level_for_menu(MapId levelId, s32 numberOfPlayers, s32 cutsceneId) { +void load_level_for_menu(s32 levelId, s32 numberOfPlayers, s32 cutsceneId) { if (!gIsLoading) { func_8006DBE4(); if (get_thread30_level_id_to_load() == 0) { @@ -1670,7 +1670,7 @@ void load_level_for_menu(MapId levelId, s32 numberOfPlayers, s32 cutsceneId) { gSPEndDisplayList(gCurrDisplayList++); } } - if (levelId != (MapId)SPECIAL_MAP_ID_NO_LEVEL) { + if (levelId != (s32) SPECIAL_MAP_ID_NO_LEVEL) { load_level_3(levelId, numberOfPlayers, 0, VEHICLE_PLANE, cutsceneId); gIsLoading = FALSE; return; @@ -1831,7 +1831,7 @@ s32 is_reset_pressed(void) { return gNMIMesgBuf[0]; } -MapId func_8006EB14(void) { +s32 func_8006EB14(void) { return gPlayableMapId; } diff --git a/src/game.h b/src/game.h index 605c1cfa..f6eaea2e 100644 --- a/src/game.h +++ b/src/game.h @@ -35,7 +35,6 @@ enum NumberOfPlayers { FOUR_PLAYERS = 3 }; -extern s8 *D_800DD310; extern s8 D_800DD314; extern u8 D_800DD318; extern s32 D_800DD31C; @@ -82,26 +81,26 @@ void dmacopy_doubleword(s32 videoLastFrameBuffer, s32 VideoCurrFrameBuffer, s32 s16 func_8006ABB4(s32 arg0); s32 func_8006B018(s8 arg0); s32 func_8006B054(s8 arg0); -Vehicle get_map_default_vehicle(MapId mapId); +Vehicle get_map_default_vehicle(s32 mapId); // Returns bitfield with (1 << Vehicle) set for every available vehicle. -s32 get_map_available_vehicles(MapId mapId); -s8 func_8006B14C(MapId mapId); -s8 func_8006B190(MapId mapId); -MapId get_hub_area_id(s32 worldId); +s32 get_map_available_vehicles(s32 mapId); +s8 func_8006B14C(s32 mapId); +s8 func_8006B190(s32 mapId); +s32 get_hub_area_id(s32 worldId); void get_number_of_levels_and_worlds(s32 *outLevelCount, s32 *outWorldCount); s32 func_8006B240(void); void func_8006BD10(f32 arg0); -MapId func_8006BD88(void); +s32 func_8006BD88(void); u8 get_current_level_race_type(void); LevelHeader *get_current_level_header(void); u8 get_total_level_header_count(void); -char *get_level_name(MapId levelId); +char *get_level_name(s32 levelId); void func_8006BEFC(void); void func_8006BFC8(s8 *arg0); void func_8006C164(void); TempStruct5 *func_8006C18C(void); s8 func_8006C19C(void); -void func_8006C1AC(MapId levelId, s32 entranceId, Vehicle vehicleId, s32 cutsceneId); +void func_8006C1AC(s32 levelId, s32 entranceId, Vehicle vehicleId, s32 cutsceneId); void func_8006C22C(s32 *levelId, s32 *entranceId, s32 *vehicleId, s32 *cutsceneId); void func_8006C2E4(void); s16 func_8006C2F0(void); @@ -110,7 +109,7 @@ void thread3_main(UNUSED void *unused); void init_game(void); void main_game_loop(void); void func_8006CAE4(s32 arg0, s32 arg1, Vehicle vehicle); -void load_level_2(MapId levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId); +void load_level_2(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId); void func_8006CC14(void); void func_8006D8A4(void); void func_8006D8E0(s32 arg0); @@ -122,10 +121,10 @@ void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId); void set_level_default_vehicle(Vehicle arg0); void func_8006DB20(Vehicle vehicleId); Vehicle get_level_default_vehicle(void); -void load_level_3(MapId levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId); +void load_level_3(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId); void func_8006DBE4(void); void func_8006DC58(s32 arg0); -void load_level_for_menu(MapId levelId, s32 numberOfPlayers, s32 cutsceneId); +void load_level_for_menu(s32 levelId, s32 numberOfPlayers, s32 cutsceneId); void calc_and_alloc_heap_for_settings(void); void func_8006E5BC(void); void func_8006E770(Settings *settings, s32 arg1); @@ -135,7 +134,7 @@ Settings *get_settings(void); s8 is_game_paused(void); s8 func_8006EAB0(void); s32 is_reset_pressed(void); -MapId func_8006EB14(void); +s32 func_8006EB14(void); void func_8006EB24(void); void func_8006EB40(void); void func_8006EB5C(void); @@ -167,7 +166,7 @@ void ingame_logic_loop(s32 updateRate); void func_8006ECFC(s32 numberOfPlayers); void func_8006DCF8(s32 arg0); void func_8006EFDC(void); -void load_level(MapId levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId); +void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicleId, s32 cutsceneId); void func_8006A6B0(void); void func_80010994(s32 updateRate); diff --git a/src/game_ui.c b/src/game_ui.c index 57cfa301..94f8b307 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -16,6 +16,8 @@ #include "game_text.h" #include "object_models.h" #include "unknown_0255E0.h" +#include "unknown_078050.h" +#include "unknown_003260.h" extern u32 osTvType; @@ -118,6 +120,8 @@ u16 D_800E2684[118] = { 0x0003, 0x0047, 0x0013, 0x0037, 0x0033, 0x003C, 0x0014, 0x003C, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, }; + +//!@bug Not every attribute is initialised, but since bss is initialised as 0, nothing happens. unk800E2770 D_800E2770[2] = { { 0, 0xFD, 0, 0, 0, 0, 0 }, { 0, 0xFF, 0, 0, 0, 0, 0 }, @@ -229,8 +233,8 @@ s16 *D_80126CF0; s32 *D_80126CF4; s32 D_80126CF8; Gfx *gHUDCurrDisplayList; -Matrix *gHUDCurrMatrix; -TriangleList *gHUDCurrTriList; +MatrixS *gHUDCurrMatrix; +Vertex *gHUDCurrVertex; s32 D_80126D08; s32 gHUDNumPlayers; s32 D_80126D10; @@ -300,7 +304,7 @@ u8 func_800A0190(void) { * The root function for all of the heads up display during an active event. * Branches off to its own function for each race type, but overridden completely in time trial. */ -void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s32 updateRate) { +void render_hud(Gfx **dList, MatrixS **mtx, Vertex **vertexList, Object *arg3, s32 updateRate) { s32 sp2C; Object_64* racer; @@ -318,7 +322,7 @@ void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s3 if (get_render_context() != DRAW_MENU) { gHUDCurrDisplayList = *dList; gHUDCurrMatrix = *mtx; - gHUDCurrTriList = *tris; + gHUDCurrVertex = *vertexList; D_80127180 = 0; if (D_80126CD1 != 0) { D_80126CD0 += updateRate; @@ -416,7 +420,7 @@ void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s3 } gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); func_800A7A60(arg3, &gHUDCurrDisplayList); - func_80067F2C(&gHUDCurrDisplayList, (Matrix **) &gHUDCurrMatrix); + func_80067F2C(&gHUDCurrDisplayList, &gHUDCurrMatrix); gDPSetEnvColor(gHUDCurrDisplayList++, 255, 255, 255, 0); sp2C = func_8001139C(&gHUDCurrDisplayList) >> 1; if (func_8000E4D8()) { @@ -477,11 +481,11 @@ block_95: func_8007BF1C(TRUE); if (D_80127180) { gHudSprites[D_80127180].texture = NULL; - render_textured_rectangle(&gHUDCurrDisplayList, &gHudSprites, 0, 0, 255, 255, 255, 255); + render_textured_rectangle(&gHUDCurrDisplayList, (DrawTexture *) &gHudSprites, 0, 0, 255, 255, 255, 255); } *dList = gHUDCurrDisplayList; *mtx = gHUDCurrMatrix; - *tris = gHUDCurrTriList; + *vertexList = gHUDCurrVertex; func_8007AE28(0xFFFFFFFF); } } @@ -529,18 +533,18 @@ void func_800A0DC0(s32 arg0, Object *arg1, s32 updateRate) { /** * Render the onscreen course arrows that show the player where to go. */ -void render_course_indicator_arrows(Object_64 *racer, s32 updateRate) { +void render_course_indicator_arrows(Object_Racer *racer, s32 updateRate) { s32 timer; s32 type; IndicatorArrow *indicator; if (D_800E2790) { - timer = racer->racer.indicator_timer; + timer = racer->indicator_timer; if (timer > 0) { - type = racer->racer.indicator_type; - racer->racer.indicator_timer = timer - updateRate; + type = racer->indicator_type; + racer->indicator_timer = timer - updateRate; if (type) { - indicator = &D_80126CDC->courseIndicator; + indicator = (IndicatorArrow *) &D_80126CDC->courseIndicator; switch (type) { case INDICATOR_LEFT: indicator->textureID = ASSET_TEX2D_33; @@ -581,21 +585,21 @@ void render_course_indicator_arrows(Object_64 *racer, s32 updateRate) { break; } // Flip the arrow direction on adventure 2. - if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS && racer->racer.indicator_type < ASSET_TEX2D_30) { + if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS && racer->indicator_type < ASSET_TEX2D_30) { indicator->unk0 = (s16) (0x8000 - indicator->unk0); } - if (gHUDNumPlayers == ONE_PLAYER && racer->racer.raceFinished == FALSE && racer->racer.indicator_type && D_800E27B8 == 0) { + if (gHUDNumPlayers == ONE_PLAYER && racer->raceFinished == FALSE && racer->indicator_type && D_800E27B8 == 0) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, indicator); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) indicator); indicator->unkC = -indicator->unkC; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, indicator); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) indicator); indicator->unkC = -indicator->unkC; indicator->unk2 = 0; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } } } else { - racer->racer.indicator_timer = 0; + racer->indicator_timer = 0; } if (D_800E27B8) { if (D_800E27B8 & 0x20) { @@ -604,12 +608,12 @@ void render_course_indicator_arrows(Object_64 *racer, s32 updateRate) { indicator->unk0 = 0; indicator->unk2 = 0; indicator->textureID = ASSET_TEX2D_29; - if ((get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) && ((s32) racer->racer.indicator_type < ASSET_TEX2D_30)) { + if ((get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) && ((s32) racer->indicator_type < ASSET_TEX2D_30)) { indicator->unk0 = (s16) (0x8000 - indicator->unk0); } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, indicator); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) indicator); indicator->unkC = (f32) -indicator->unkC; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, indicator); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) indicator); indicator->unkC = (f32) -indicator->unkC; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } @@ -654,36 +658,36 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A22F4.s") /** * When racing the boss, render the essentials, but skip the bananas. */ -void render_hud_race_boss(s32 arg0, Object *arg1, s32 updateRate) { +void render_hud_race_boss(s32 arg0, Object *obj, s32 updateRate) { LevelHeader *level; - Object_64 *temp = arg1->unk64; + Object_Racer *racer = (Object_Racer *) obj->unk64; func_80068508(1); - render_wrong_way_text(temp, updateRate); + render_wrong_way_text(racer, updateRate); render_race_start(arg0, updateRate); - render_race_time(temp, updateRate); - render_weapon_hud(arg1, updateRate); + render_race_time(racer, updateRate); + render_weapon_hud(obj, updateRate); level = get_current_level_header(); if (level->laps > 1) { - render_lap_count(temp, updateRate); + render_lap_count(racer, updateRate); } - render_speedometer(arg1, updateRate); - func_800A4C44(temp, updateRate); + render_speedometer(obj, updateRate); + func_800A4C44(racer, updateRate); func_80068508(0); } -void func_800A263C(s32 arg0, Object *arg1, s32 updateRate) { - Object_64 *temp = arg1->unk64; +void func_800A263C(s32 arg0, Object *obj, s32 updateRate) { + Object_Racer *racer = (Object_Racer *) obj->unk64; func_80068508(1); - render_wrong_way_text(temp, updateRate); - render_lap_count(temp, updateRate); - func_800A4C44(temp, updateRate); - render_race_time(temp, updateRate); + render_wrong_way_text(racer, updateRate); + render_lap_count(racer, updateRate); + func_800A4C44(racer, updateRate); + render_race_time(racer, updateRate); render_race_start(arg0, updateRate); - render_speedometer(arg1, updateRate); + render_speedometer(obj, updateRate); func_80068508(0); } @@ -703,7 +707,7 @@ void render_hud_hubworld(Object *obj, s32 updateRate) { if (is_in_two_player_adventure()) { temp_a3 = &D_80126CDC[1]; temp_a3->unk6 = (get_settings()->racers[1].character + 0x38); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, temp_a3); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) temp_a3); } func_80068508(0); } @@ -765,18 +769,18 @@ void render_speedometer(Object *obj, UNUSED s32 updateRate) { } else { opacity = 255; } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0xDA]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk5A0); reset_render_settings(&gHUDCurrDisplayList); func_8007BF1C(TRUE); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, opacity); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk49E[0x22]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk4C0); func_8007BF1C(FALSE); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0x1A]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0x3A]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0x5A]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0x7A]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0x9A]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk4C6[0xBA]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk4E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk500); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk520); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk540); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk560); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk580); } } } @@ -801,7 +805,7 @@ void render_race_start(s32 arg0, s32 updateRate) { if (arg0 > 0) { if (D_80126D34) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, (arg0 * 255) / 40); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk174[0x2C]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk1A0); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); if (gRaceStartShowHudStep == 2) { play_sound_global(SOUND_VOICE_TT_GET_READY, &gHUDVoiceSoundMask); @@ -827,7 +831,7 @@ void render_race_start(s32 arg0, s32 updateRate) { } } else if (D_80126CDC->unk18C > -200.0f) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk174[0xC]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk180); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); D_80126CDC->unk19A[D_80126D08] += updateRate; if (D_80126CDC->unk19A[D_80126D08] >= 60) { @@ -861,18 +865,18 @@ void render_race_start(s32 arg0, s32 updateRate) { * Renders the banana counter on screen. * When a banana is collected, render sparkles and animate the banana. for a brief moment. */ -void render_racer_bananas(Object_64 *obj, s32 updateRate) { +void render_racer_bananas(Object_Racer *racer, s32 updateRate) { s32 bananas; - s16 temp_v1; + UNUSED s16 pad; s32 temp_lo; u8 var_v1; - if(obj->racer.playerIndex == PLAYER_COMPUTER || ((gHUDNumPlayers < TWO_PLAYERS || D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] == PLAYER_THREE || D_80126D60->race_type == RACETYPE_CHALLENGE_BANANAS || D_80126D60->race_type == RACETYPE_CHALLENGE_BATTLE) && obj->racer.raceFinished == FALSE) && (gHUDNumPlayers < TWO_PLAYERS || (obj->racer.lap < 1) || obj->racer.lap_times[obj->racer.lap] >= 180 || D_80126D60->race_type & RACETYPE_CHALLENGE)) { - func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unk240); - bananas = obj->racer.bananas; + if(racer->playerIndex == PLAYER_COMPUTER || (((gHUDNumPlayers < TWO_PLAYERS || D_800E2794[gHUDNumPlayers][racer->playerIndex] == PLAYER_THREE || D_80126D60->race_type == RACETYPE_CHALLENGE_BANANAS || D_80126D60->race_type == RACETYPE_CHALLENGE_BATTLE) && racer->raceFinished == FALSE) && (gHUDNumPlayers < TWO_PLAYERS || (racer->lap < 1) || racer->lap_times[racer->lap] >= 180 || D_80126D60->race_type & RACETYPE_CHALLENGE))) { + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk240); + bananas = racer->bananas; var_v1 = D_80126CDC->unkF8; - if ((D_80126CDC->unkFA == 0) && (D_80126CDC->unkFB != obj->racer.bananas)) { + if ((D_80126CDC->unkFA == 0) && (D_80126CDC->unkFB != racer->bananas)) { D_80126CDC->unkFA = 2; - D_80126CDC->unkFB = obj->racer.bananas; + D_80126CDC->unkFB = racer->bananas; } else if (D_80126CDC->unkFA) { D_80126CDC->unk388 = 2.0f; var_v1 += updateRate * 13; @@ -889,7 +893,7 @@ void render_racer_bananas(Object_64 *obj, s32 updateRate) { if (var_v1 == 0) { func_8007BF1C(TRUE); set_viewport_tv_type(TV_TYPE_NTSC); - func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unk360); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk360); set_viewport_tv_type(TV_TYPE_PAL); func_8007BF1C(FALSE); D_80126CDC->unkF8 = var_v1; @@ -905,7 +909,7 @@ void render_racer_bananas(Object_64 *obj, s32 updateRate) { } } set_viewport_tv_type(TV_TYPE_NTSC); - func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unk380); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk380); set_viewport_tv_type(TV_TYPE_PAL); } } else { @@ -913,7 +917,7 @@ void render_racer_bananas(Object_64 *obj, s32 updateRate) { func_80068508(0); func_8007BF1C(TRUE); set_viewport_tv_type(TV_TYPE_NTSC); - func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unkE0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unkE0); func_8007BF1C(FALSE); set_viewport_tv_type(TV_TYPE_PAL); func_80068508(1); @@ -923,11 +927,11 @@ void render_racer_bananas(Object_64 *obj, s32 updateRate) { if (temp_lo) { D_80126CDC->unk118 = temp_lo; D_80126CDC->unk138 = bananas % 10; - func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unk120); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk120); } else { D_80126CDC->unk118 = bananas % 10; } - func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unk100); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk100); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } } @@ -940,7 +944,7 @@ void func_800A45F0(Object_Racer* racer) { if (D_80126D37 < 3 || (D_80126D37 == 3 && racer->playerIndex == PLAYER_COMPUTER)) { D_80126CDC->unk646 = racer->characterId + 56; D_80126CD5 = TRUE; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk640); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk640); D_80126CD5 = FALSE; } for (i = 0; i < 10; i++) { @@ -948,7 +952,7 @@ void func_800A45F0(Object_Racer* racer) { D_800E2834 = 0x80808080; } D_80126CD5 = TRUE; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk400); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk400); D_80126CD5 = FALSE; D_80126CDC->unk410 -= 3.0f; } @@ -969,8 +973,8 @@ void render_race_finish_position(Object_64 *obj, s32 updateRate) { unk800A497C* temp_s0; s8 drawPosition; - temp_a3 = &D_80126CDC->unk700; - temp_s0 = &D_80126CDC->unk700 + 16; // Hacky workaround to the struct being assumed to be 0x720 bytes. + temp_a3 = (unk800A497C *) &D_80126CDC->unk700; + temp_s0 = (unk800A497C *) (&D_80126CDC->unk700 + 16); // Hacky workaround to the struct being assumed to be 0x720 bytes. //temp_s0 = &D_80126CDC->unk740; drawPosition = FALSE; switch (temp_a3->unk1A) { @@ -1023,8 +1027,8 @@ void render_race_finish_position(Object_64 *obj, s32 updateRate) { } if (drawPosition) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 210); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) temp_a3); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, temp_s0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) temp_a3); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (unk80126CDC **) temp_s0); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } } @@ -1039,10 +1043,10 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A4C44.s") * Also displays the "Lap 2" and "Final Lap" messages when the line is crossed. * In multiplayer, shows a cut down display, if the display setting is set to show laps. */ -void render_lap_count(Object_64 *obj, s32 updateRate) { - if (obj->racer.raceFinished == FALSE && (gHUDNumPlayers <= ONE_PLAYER || obj->racer.lap <= 0 || obj->racer.lap_times[obj->racer.lap] >= 180) - && (gHUDNumPlayers <= ONE_PLAYER || D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] == 3)) { - if (D_80126D60->laps == (0, obj->racer.unk194 + 1) && gHUDNumPlayers < THREE_PLAYERS) { +void render_lap_count(Object_Racer *racer, s32 updateRate) { + if (racer->raceFinished == FALSE && (gHUDNumPlayers <= ONE_PLAYER || racer->lap <= 0 || racer->lap_times[racer->lap] >= 180) + && (gHUDNumPlayers <= ONE_PLAYER || D_800E2794[gHUDNumPlayers][racer->playerIndex] == 3)) { + if (D_80126D60->laps == (0, racer->unk194 + 1) && gHUDNumPlayers < THREE_PLAYERS) { D_80126CDC->unk21A += updateRate; if (D_80126CDC->unk21A > 6) { D_80126CDC->unk218++; @@ -1051,25 +1055,25 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { D_80126CDC->unk218 = 0; } } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk200); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk200); } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk60); - if (obj->racer.unk194 >= D_80126D60->laps - 1) { + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk60); + if (racer->unk194 >= D_80126D60->laps - 1) { D_80126CDC->unk98 = D_80126D60->laps; } else { - D_80126CDC->unk98 = obj->racer.unk194 + 1; + D_80126CDC->unk98 = racer->unk194 + 1; } D_80126CDC->unkD8 = D_80126D60->laps; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk68[0x18]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk68[0x38]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk68[0x58]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk80); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unkA0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unkC0); } if (gHUDNumPlayers == TWO_PLAYERS) { func_8007BF1C(TRUE); } if (is_game_paused() == FALSE) { - if (obj->racer.lap_times[obj->racer.lap] < 30 && D_80126CDC->unk3DA == 0 && obj->racer.raceFinished == FALSE) { - if ((obj->racer.lap == 1) && D_80126D60->laps >= 3) { + if (racer->lap_times[racer->lap] < 30 && D_80126CDC->unk3DA == 0 && racer->raceFinished == FALSE) { + if ((racer->lap == 1) && D_80126D60->laps >= 3) { D_80126CDC->unk3DA = 2; D_80126CDC->unk3DB = 1; D_80126CDC->unk3DD = 0; @@ -1088,7 +1092,7 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { D_80126CDC->unk3EC = 211.0f; break; default: - if (obj->racer.playerIndex != PLAYER_ONE && obj->racer.playerIndex != PLAYER_THREE) { + if (racer->playerIndex != PLAYER_ONE && racer->playerIndex != PLAYER_THREE) { D_80126CDC->unk3DC = 60; D_80126CDC->unk3FC = 91; D_80126CDC->unk3CC = -70.0f; @@ -1101,7 +1105,7 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { } break; } - } else if (D_80126D60->laps == (0, obj->racer.lap + 1) && obj->racer.lap != 0) { + } else if (D_80126D60->laps == (0, racer->lap + 1) && racer->lap != 0) { D_80126CDC->unk3DA = 3; D_80126CDC->unk3DB = -1; D_80126CDC->unk3DD = 0; @@ -1120,7 +1124,7 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { D_80126CDC->unk3AC = -200.0f; break; default: - if (obj->racer.playerIndex != PLAYER_ONE && obj->racer.playerIndex != PLAYER_THREE) { + if (racer->playerIndex != PLAYER_ONE && racer->playerIndex != PLAYER_THREE) { D_80126CDC->unk3DC = 100; D_80126CDC->unk3BC = 50; D_80126CDC->unk3CC = 100.0f; @@ -1148,7 +1152,7 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { } else { D_80126CDC->unk3EC = D_80126CDC->unk3FC; } - if (obj->racer.lap_times[obj->racer.lap] >= 60) { + if (racer->lap_times[racer->lap] >= 60) { D_80126CDC->unk3DB = -1; play_sound_global(SOUND_WHOOSH1, NULL); } @@ -1166,8 +1170,8 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { } } gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk39C[0x44]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk39C[0x24]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk3E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk3C0); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } else if (D_80126CDC->unk3DA == 3) { if (D_80126CDC->unk3DB == -1) { @@ -1181,7 +1185,7 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { } else { D_80126CDC->unk3AC = D_80126CDC->unk3BC; } - if (obj->racer.lap_times[obj->racer.lap] >= 0x3C) { + if (racer->lap_times[racer->lap] >= 60) { D_80126CDC->unk3DB = 1; play_sound_global(SOUND_WHOOSH1, NULL); } @@ -1200,8 +1204,8 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { } gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk39C[4]); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk39C[0x24]); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk3A0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk3C0); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } } @@ -1213,14 +1217,14 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { * Players going the wrong way will be nagged by T.T to turn around. * This function plays the audio, and makes the text fly in. */ -void render_wrong_way_text(Object_64* obj, s32 updateRate) { +void render_wrong_way_text(Object_Racer *obj, s32 updateRate) { f32 textMoveSpeed; f32 textPosTarget; if (gHUDNumPlayers == TWO_PLAYERS) { func_8007BF1C(TRUE); } - if (obj->racer.unk1FC > 120 && (gHUDNumPlayers || D_80126CDC->unk46C == D_80126CDC->unk47A[2]) && !is_game_paused()) { + if (obj->unk1FC > 120 && (gHUDNumPlayers || D_80126CDC->unk46C == D_80126CDC->unk47A[2]) && !is_game_paused()) { if ((gWrongWayNagPrefix || gWrongWayNagTimer == 0) && gHUDVoiceSoundMask == NULL) { // 20% chance that T.T decides not to precede his nagging with "No no no!" if (gWrongWayNagPrefix || (get_random_number_from_range(1, 10) >= 8)) { @@ -1251,7 +1255,7 @@ void render_wrong_way_text(Object_64* obj, s32 updateRate) { if (D_80126CDC->unk48C < textPosTarget) { D_80126CDC->unk48C = textPosTarget; } - if (obj->racer.unk1FC <= 90) { + if (obj->unk1FC <= 90) { D_80126CDC->unk47A[1] = -1; play_sound_global(SOUND_WHOOSH1, NULL); } @@ -1265,12 +1269,12 @@ void render_wrong_way_text(Object_64* obj, s32 updateRate) { } if (!is_game_paused()) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk460); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk480); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk460); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk480); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } } - } else if (obj->racer.unk1FC > 120) { + } else if (obj->unk1FC > 120) { D_80126CDC->unk47A[0] = 1; D_80126CDC->unk47A[1] = 1; D_80126CDC->unk47A[2] = -31; @@ -1280,7 +1284,7 @@ void render_wrong_way_text(Object_64* obj, s32 updateRate) { D_80126CDC->unk47A[2] = -21; D_80126CDC->unk49C = 42; } else if (gHUDNumPlayers > TWO_PLAYERS) { - if (obj->racer.playerIndex == PLAYER_ONE || obj->racer.playerIndex == PLAYER_THREE) { + if (obj->playerIndex == PLAYER_ONE || obj->playerIndex == PLAYER_THREE) { D_80126CDC->unk47A[2] = -100; D_80126CDC->unk49C = -55; } else { @@ -1388,7 +1392,7 @@ void render_weapon_hud(Object *obj, s32 updateRate) { if (D_80126CDC->unk48 != 1.0) { func_8007BF1C(TRUE); } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk40); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk40); func_8007BF1C(FALSE); if (racerObj->racer.balloon_quantity > 3) { D_80126CDC->unk63A = -128; @@ -1396,10 +1400,10 @@ void render_weapon_hud(Object *obj, s32 updateRate) { if (racerObj->racer.balloon_quantity < 3) { D_80126CDC->unk63A -= updateRate; } - if (racerObj->racer.balloon_quantity >= 3 || (((D_80126CDC->unk63A + 128) % 32) < 20) && racerObj->racer.balloon_quantity != 1) { + if (racerObj->racer.balloon_quantity >= 3 || ((((D_80126CDC->unk63A + 128) % 32) < 20) && racerObj->racer.balloon_quantity != 1)) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); D_80126CDC->unk638 = racerObj->racer.balloon_quantity - 1; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk620); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk620); gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); } } else { @@ -1414,7 +1418,7 @@ void render_weapon_hud(Object *obj, s32 updateRate) { if (gHUDNumPlayers != ONE_PLAYER) { D_80126CDC->unk48 /= 2; } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk40); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk40); } } gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); @@ -1428,7 +1432,7 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A7A60.s") * Render the lap time on the top right. * When the player begins a new lap, start flashing the previous lap time below instead. */ -void render_race_time(Object_64* obj, s32 updateRate) { +void render_race_time(Object_Racer *racer, s32 updateRate) { s32 i; s32 stopwatchTimer; s32 minutes; @@ -1437,26 +1441,26 @@ void render_race_time(Object_64* obj, s32 updateRate) { s32 countingDown; s32 timerHideCounter; - if (!(gHUDNumPlayers != ONE_PLAYER && D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] != 1) || (gHUDNumPlayers > ONE_PLAYER && obj->racer.lap > 0 && obj->racer.lap_times[obj->racer.lap] < 180)) { - if (obj->racer.raceFinished == FALSE) { + if (!(gHUDNumPlayers != ONE_PLAYER && D_800E2794[gHUDNumPlayers][racer->playerIndex] != 1) || (gHUDNumPlayers > ONE_PLAYER && racer->lap > 0 && racer->lap_times[racer->lap] < 180)) { + if (racer->raceFinished == FALSE) { timerHideCounter = D_80126CDC->unk15A + 127; - if (obj->racer.lap > 0 && obj->racer.lap_times[obj->racer.lap] < 180 && obj->racer.lap < D_80126D60->laps) { - stopwatchTimer = obj->racer.lap_times[obj->racer.lap - 1]; + if (racer->lap > 0 && racer->lap_times[racer->lap] < 180 && racer->lap < D_80126D60->laps) { + stopwatchTimer = racer->lap_times[racer->lap - 1]; countingDown = TRUE; if (timerHideCounter == 0) { timerHideCounter = 180; } } else { stopwatchTimer = 0; - for (i = 0; obj->racer.unk194 >= i && i < D_80126D60->laps; i++) { - stopwatchTimer += obj->racer.lap_times[i]; + for (i = 0; racer->unk194 >= i && i < D_80126D60->laps; i++) { + stopwatchTimer += racer->lap_times[i]; } - countingDown = stopwatchTimer == 0 || obj->racer.raceFinished || is_game_paused(); + countingDown = stopwatchTimer == 0 || racer->raceFinished || is_game_paused(); D_80126CDC->unk15A = -127; timerHideCounter = 0; } if (gHUDNumPlayers == ONE_PLAYER) { - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk140); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk140); } if (normalise_time(36000) < stopwatchTimer) { stopwatchTimer = normalise_time(36000); @@ -1515,16 +1519,16 @@ s8 func_800A8458(void) { } #ifdef NON_MATCHING -void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRate) { - s32 pad2; +void func_800A8474(Gfx **dList, MatrixS **mtx, Vertex **triList, s32 updateRate) { + UNUSED s32 pad2; LevelModel *lvlMdl; // sp158 s32 sp154; Object **objectGroup; - s32 pad4; + UNUSED s32 pad4; Object_Racer *someRacer; s32 i; s32 objectCount; - s32 pad6; + UNUSED s32 pad6; ObjectTransform_800A8474 objTrans; // sp120 f32 sp11C; f32 sp118; @@ -1533,17 +1537,17 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa s32 mapOpacity; s32 opacity; Object_Racer *pad11; - s32 pad10; + UNUSED s32 pad10; s32 pad12; - s32 pad5; + UNUSED s32 pad5; s32 sp144; - s32 pad1; - s32 pad8; + UNUSED s32 pad1; + UNUSED s32 pad8; Object_Racer *curRacerObj; s32 spE4; s32 spE0; - s32 pad3; - s32 pad9; + UNUSED s32 pad3; + UNUSED s32 pad9; s32 spF4; s32 spF0; s32 racerCount; @@ -1583,13 +1587,13 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa if (D_80126CF4[i] && i != 40) { if (++D_80126CD8[i] > 60) { if ((D_80126CF0[i] & (0x4000 | 0x8000)) == (0x4000 | 0x8000)) { - free_texture(D_80126CF4[i]); + free_texture((TextureHeader *) D_80126CF4[i]); } else if (D_80126CF0[i] & 0x8000) { - free_sprite(D_80126CF4[i]); + free_sprite((Sprite *) D_80126CF4[i]); } else if (D_80126CF0[i] & 0x4000) { - gParticlePtrList_addObject(D_80126CF4[i]); + gParticlePtrList_addObject((Object *) D_80126CF4[i]); } else { - func_8005FF40(D_80126CF4[i]); + func_8005FF40((ObjectModel **) D_80126CF4[i]); } D_80126CF4[i] = 0; } @@ -1600,7 +1604,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa objectGroup = get_racer_objects_by_port(&objectCount); gHUDCurrDisplayList = *dList; gHUDCurrMatrix = *mtx; - gHUDCurrTriList = *triList; + gHUDCurrVertex = *triList; if (D_80126D60->race_type == RACETYPE_CHALLENGE_EGGS) { if (D_80126D37 == 2 && D_800E27A4[gHUDNumPlayers] == FALSE) { func_800A14F0(NULL, updateRate); @@ -1693,12 +1697,12 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa D_80126CDC->unk66C -= 4.0f; } D_80126CD5 = TRUE; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk640); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk640); D_80126CD5 = FALSE; if (D_80126CDC->unkFB == 0 && curRacerObj->bananas == 10) { D_80126CDC->unkFB = curRacerObj->bananas; } - render_racer_bananas((Object_64 *)curRacerObj, updateRate); + render_racer_bananas(curRacerObj, updateRate); @@ -1777,16 +1781,16 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa } if (D_80127180 != 0) { gHudSprites[D_80127180].texture = NULL; - render_textured_rectangle(&gHUDCurrDisplayList, &gHudSprites, 0, 0, 255, 255, 255, 255); + render_textured_rectangle(&gHUDCurrDisplayList, (DrawTexture *) &gHudSprites, 0, 0, 255, 255, 255, 255); } *dList = gHUDCurrDisplayList; *mtx = gHUDCurrMatrix; - *triList = gHUDCurrTriList; + *triList = gHUDCurrVertex; if (!(D_80126D60->unkBC & 1)) { sp113 = TRUE; for(i = 0; i < objectCount; i++) { - if (&objectGroup[i]->unk64->racer != NULL && + if ( objectGroup[i]->unk64->racer.playerIndex != PLAYER_COMPUTER && objectGroup[i]->unk64->racer.raceFinished == FALSE) { sp113 = FALSE; @@ -1857,7 +1861,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa } else { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, gMinimapRed, gMinimapGreen, gMinimapBlue, mapOpacity); } - func_80068BF4(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (ObjectSegment* ) &objTrans.trans, (unk80068BF4* ) sp154, 0); + func_80068BF4(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, (ObjectSegment* ) &objTrans.trans, (unk80068BF4* ) sp154, 0); sp11C = (lvlMdl->unk3E - lvlMdl->unk3C) / (f32) (lvlMdl->unk46 - lvlMdl->unk44); sp118 = coss_f((lvlMdl->unk24 * 0xFFFF) / 360); sp114 = sins_f((lvlMdl->unk24 * 0xFFFF) / 360); @@ -1870,7 +1874,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa D_80126CDC->unk1E8 = 1.0f; temp = (opacity * (f32) temp_v0_8->segment.unk38.half.lower) * 0.0078125; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 60, 60, 60, temp); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk1E0); } } temp_v0_8 = func_8001B640(); @@ -1881,7 +1885,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, D_800E27BC[8].red, D_800E27BC[8].green, D_800E27BC[8].blue, temp); D_80126CDC->unk1E8 = 1.0f; D_80126CDC->unk1E6 = 14; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk1E0); } if (D_80126D60->race_type == RACETYPE_HUBWORLD) { temp_v0_8 = func_80018C6C(); @@ -1891,7 +1895,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa D_80126CDC->unk1E4 = 0; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 0, 255, opacity); D_80126CDC->unk1E8 = 1.0f; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk1E0); } } for(i = objectCount - 1; i >= 0; i--) { @@ -1938,7 +1942,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa } else { D_80126CDC->unk1E8 = 1.0f; } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, &D_80126CDC->unk1E0); } func_8007BF1C(FALSE); } @@ -1948,7 +1952,7 @@ void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRa func_8007BF1C(TRUE); *dList = gHUDCurrDisplayList; *mtx = gHUDCurrMatrix; - *triList = gHUDCurrTriList; + *triList = gHUDCurrVertex; } } } diff --git a/src/game_ui.h b/src/game_ui.h index 64bb108e..1ed66c59 100644 --- a/src/game_ui.h +++ b/src/game_ui.h @@ -49,10 +49,16 @@ typedef struct unk80126CDC { s8 unk5F; struct unk80126CDC *unk60; s8 unk64[4]; - u8 unk68[0x30]; + u8 unk68[0x18]; + struct unk80126CDC *unk80; + u8 unk84[0x14]; s16 unk98; s16 unk9A; - u8 unk9C[0x3C]; + u8 unk9C[0x4]; + struct unk80126CDC *unkA0; + u8 unkA4[0x1C]; + struct unk80126CDC *unkC0; + u8 unkC4[0x14]; s16 unkD8; s8 unkDA[0x6]; struct unk80126CDC *unkE0; @@ -78,19 +84,22 @@ typedef struct unk80126CDC { u8 unk134[0x4]; s16 unk138; u8 unk13A[0x6]; - u8 unk140; - u8 unk141; - u8 unk142[0x18]; + struct unk80126CDC * unk140; + u8 unk144[0x16]; s8 unk15A; s8 unk15B; u8 pad[0x10]; f32 unk16C; f32 unk170; - u8 unk174[0x18]; + u8 unk174[0xC]; + struct unk80126CDC *unk180; + u8 unk184[0x8]; f32 unk18C; u8 pad190[0xA]; s8 unk19A[1]; - u8 pad19C[0x44]; + u8 pad19C[4]; + struct unk80126CDC *unk1A0; + u8 pad1A4[0x3C]; struct unk80126CDC *unk1E0; s16 unk1E4; s16 unk1E6; @@ -126,7 +135,7 @@ typedef struct unk80126CDC { s32 unk354; s32 unk358; s32 unk35C; - s32 unk360; + struct unk80126CDC *unk360; u8 pad364[0x8]; f32 unk36C; f32 unk370; @@ -140,11 +149,15 @@ typedef struct unk80126CDC { s16 unk398; s8 unk39A; s8 unk39B; - u8 unk39C[0x10]; + s32 unk39C; + struct unk80126CDC *unk3A0; + u8 pad304[8]; f32 unk3AC; u8 unk3B0[0xC]; s8 unk3BC; - s8 unk3BD[0xF]; + s8 unk3BD[2]; + struct unk80126CDC *unk3C0; + s8 unk3C4[8]; f32 unk3CC; u8 unk3D0[0xA]; s8 unk3DA; @@ -153,7 +166,8 @@ typedef struct unk80126CDC { s8 unk3DD; s8 unk3DE; s8 unk3DF; - u8 unk3E0[0xC]; + struct unk80126CDC *unk3E0; + u8 unk3E4[8]; f32 unk3EC; u8 unk3F0[0xC]; s8 unk3FC; @@ -176,24 +190,37 @@ typedef struct unk80126CDC { u8 unk458; u8 unk459; u8 unk45A[0x6]; - u8 unk460; - s8 unk461; - u8 unk462[0xA]; + struct unk80126CDC *unk460; + u8 unk462[0x8]; f32 unk46C; u8 unk470[0xA]; s8 unk47A[4]; u8 unk47E; u8 unk47F; - u8 unk480; - s8 unk481; - u8 unk482[0x8]; + struct unk80126CDC *unk480; + u8 unk482[0x6]; f32 unk48C; u8 unk490[0xC]; s8 unk49C; s8 unk49D; - s8 unk49E[0x25]; + s8 unk49E[0x21]; + struct unk80126CDC *unk4C0; s16 unk4C4; - u8 unk4C6[0x15A]; + u8 unk4C6[0x1A]; + struct unk80126CDC *unk4E0; + u8 unk4E4[0x1C]; + struct unk80126CDC *unk500; + u8 unk504[0x1C]; + struct unk80126CDC *unk520; + u8 unk524[0x1C]; + struct unk80126CDC *unk540; + u8 unk544[0x1C]; + struct unk80126CDC *unk560; + u8 unk564[0x1C]; + struct unk80126CDC *unk580; + u8 unk584[0x1C]; + struct unk80126CDC *unk5A0; + u8 unk484[0x7C]; struct unk80126CDC *unk620; u8 unk624[0x14]; s16 unk638; @@ -256,12 +283,6 @@ typedef struct ObjectTransform_800A8474 { s16 unk18; } ObjectTransform_800A8474; -extern unk80126CDC *D_80126CDC; -extern Gfx *gHUDCurrDisplayList; -extern Matrix *gHUDCurrMatrix; -extern TriangleList *gHUDCurrTriList; -extern u8 D_80126D37; - extern u8 gGfxTaskYieldData[0xA00]; u8 func_800A0190(void); @@ -280,27 +301,27 @@ void func_800AB194(s32 arg0); void func_800AB1AC(s32 arg0); void func_800AB1C8(void); void func_800AB1D4(u8 arg0); -void render_race_time(Object_64 *obj, s32 updateRate); -void render_wrong_way_text(Object_64 *obj, s32 updateRate); -void render_course_indicator_arrows(Object_64 *obj, s32 updateRate); +void render_race_time(Object_Racer *obj, s32 updateRate); +void render_wrong_way_text(Object_Racer *racer, s32 updateRate); +void render_course_indicator_arrows(Object_Racer *racer, s32 updateRate); void render_hud_hubworld(Object *obj, s32 updateRate); -void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s32 updateRate); +void render_hud(Gfx **dList, MatrixS **mtx, Vertex **tris, Object *arg3, s32 updateRate); void render_weapon_hud(Object *obj, s32 updateRate); void render_race_start(s32 arg0, s32 updateRate); -void render_racer_bananas(Object_64 *obj, s32 updateRate); +void render_racer_bananas(Object_Racer *obj, s32 updateRate); void render_race_finish_position(Object_64 *obj, s32 updateRate); void render_speedometer(Object *obj, s32 updateRate); -void render_lap_count(Object_64 *obj, s32 updateRate); +void render_lap_count(Object_Racer *racer, s32 updateRate); // Non Matching void func_800A14F0(Object *, s32); -void func_800A4C44(Object_64 *obj, s32 updateRate); -void func_800A47A0(Object_64 *obj, s32 updateRate); +void func_800A4C44(Object_Racer *racer, s32 updateRate); +void func_800A47A0(Object_Racer *obj, s32 updateRate); void func_800A718C(Object_64 *obj); -void func_800AA600(Gfx **dList, Matrix **mtx, TriangleList **triList, unk80126CDC *arg3); +void func_800AA600(Gfx **dList, MatrixS **mtx, Vertex **vtxList, unk80126CDC **arg3); void func_8009ECF0(s32 viewPortCount); void func_800A003C(void); -void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRate); +void func_800A8474(Gfx **dList, MatrixS **mtx, Vertex **vtxList, s32 updateRate); void func_800A7FBC(s32, s32, s32 minutes, s32 seconds, s32 hundredths, s32); void func_800A1248(s32, Object*, s32); void func_800A1C04(s32, Object*, s32); diff --git a/src/gzip.c b/src/gzip.c index 727c4dfd..cc636423 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -42,7 +42,7 @@ s32 byteswap32(u8 *arg0) { * Returns the uncompressed size of a gzip compressed asset. */ s32 get_asset_uncompressed_size(s32 assetIndex, s32 assetOffset) { - load_asset_to_address(assetIndex, gAssetAddress, assetOffset, 8); + load_asset_to_address(assetIndex, (u32) gAssetAddress, assetOffset, 8); return byteswap32((u8 *)gAssetAddress); } diff --git a/src/math_util.c b/src/math_util.c index 0a1121fb..98a9d834 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -94,7 +94,7 @@ GLOBAL_ASM("asm/math_util/f32_matrix_mult.s") #endif #ifdef NON_EQUIVALENT -void f32_matrix_to_s16_matrix(Matrix *input, s16 **output) { +void f32_matrix_to_s16_matrix(Matrix *input, MatrixS *output) { s32 temp_f10; s32 temp_f4; s32 temp_f6; @@ -106,14 +106,14 @@ void f32_matrix_to_s16_matrix(Matrix *input, s16 **output) { temp_f6 = (*input)[i][1] * 65536.0f; temp_f8 = (*input)[i][2] * 65536.0f; temp_f10 = (*input)[i][3] * 65536.0f; - output[i+4][0] = temp_f4; - output[i+4][1] = temp_f6; - output[i+4][2] = temp_f8; - output[i+4][3] = temp_f10; - output[i][0] = (temp_f4 >> 16); - output[i][1] = (temp_f6 >> 16); - output[i][2] = (temp_f8 >> 16); - output[i][3] = (temp_f10 >> 16); + *output[i+4][0] = temp_f4; + *output[i+4][1] = temp_f6; + *output[i+4][2] = temp_f8; + *output[i+4][3] = temp_f10; + *output[i][0] = (temp_f4 >> 16); + *output[i][1] = (temp_f6 >> 16); + *output[i][2] = (temp_f8 >> 16); + *output[i][3] = (temp_f10 >> 16); } } #else @@ -499,22 +499,22 @@ GLOBAL_ASM("asm/math_util/point_triangle_2d_xz_intersection.s") #endif #ifdef NON_EQUIVALENT -void f32_matrix_from_position(Matrix mtx, f32 x, f32 y, f32 z) { +void f32_matrix_from_position(Matrix *mtx, f32 x, f32 y, f32 z) { s32 j; s32 i; // Clear matrix for(i = 0; i < 4; i++) { for(j = 0; j < 4; j++) { - mtx[i][j] = 0; + *mtx[i][j] = 0; } } - mtx[0][0] = 1.0f; - mtx[1][1] = 1.0f; - mtx[2][2] = 1.0f; - mtx[3][3] = 1.0f; - mtx[3][0] = x; - mtx[3][1] = y; - mtx[3][2] = z; + *mtx[0][0] = 1.0f; + *mtx[1][1] = 1.0f; + *mtx[2][2] = 1.0f; + *mtx[3][3] = 1.0f; + *mtx[3][0] = x; + *mtx[3][1] = y; + *mtx[3][2] = z; } #else GLOBAL_ASM("asm/math_util/f32_matrix_from_position.s") diff --git a/src/math_util.h b/src/math_util.h index 5f8171e9..80c7ce67 100644 --- a/src/math_util.h +++ b/src/math_util.h @@ -30,14 +30,15 @@ void set_rng_seed(s32 num); void save_rng_seed(s32 num); void load_rng_seed(s32 num); s32 get_rng_seed(void); +s32 get_random_number_from_range(s32, s32); void f32_matrix_to_s32_matrix(Matrix *input, Matrix *output); void guMtxXFMF(Matrix mf, float x, float y, float z, float *ox, float *oy, float *oz); void f32_matrix_dot(Matrix *mat1, Matrix *mat2, Matrix *output); void f32_matrix_mult(Matrix *mat1, Matrix *mat2, Matrix *output); -void f32_matrix_to_s16_matrix(Matrix *input, s16 **output); +void f32_matrix_to_s16_matrix(Matrix *input, MatrixS *output); void s16_matrix_rotate(s16 *arg0[4][4], s16 arg1[4][4]); void s16_vec3_mult_by_s32_matrix(s32 **input, s16 *output); -void object_transform_to_matrix(Matrix arg0, ObjectTransform *trans); +void object_transform_to_matrix(Matrix mtx, ObjectTransform *trans); void f32_matrix_scale(Matrix *input, f32 scale); void f32_matrix_y_scale(Matrix *input, f32 scale); void object_transform_to_matrix_2(Matrix mtx, ObjectTransform *trans); @@ -47,7 +48,7 @@ void f32_vec3_apply_object_rotation(ObjectTransform *trans, f32 *vec3_f32); void f32_vec3_apply_object_rotation2(ObjectTransform *trans, f32 *arg1); void f32_vec3_apply_object_rotation3(ObjectTransform *trans, f32 *vec3_f32); s32 point_triangle_2d_xz_intersection(s32 x, s32 z, s16 *vec3A, s16 *vec3B, s16 *vec3C); -void f32_matrix_from_position(Matrix mtx, f32 x, f32 y, f32 z); +void f32_matrix_from_position(Matrix *mtx, f32 x, f32 y, f32 z); void f32_matrix_from_scale(Matrix, f32, f32, f32); s32 atan2s(s32 xDelta, s32 zDelta); f32 area_triangle_2d(f32 x0, f32 z0, f32 x1, f32 z1, f32 x2, f32 z2); diff --git a/src/menu.c b/src/menu.c index 4caafbc6..4d5c6dc1 100644 --- a/src/menu.c +++ b/src/menu.c @@ -45,8 +45,8 @@ s32 gSaveGhostDelayCounter; s32 gPreviousMenuID; Gfx *sMenuCurrDisplayList; char **gTTSaveGhostPakErrorText; -Matrix *sMenuCurrHudMat; -VertexList *sMenuCurrHudVerts; +MatrixS *sMenuCurrHudMat; +Vertex *sMenuCurrHudVerts; TriangleList *sMenuCurrHudTris; unk801263C0 D_801263B4; unk801263C0 D_801263B8; @@ -319,7 +319,7 @@ s32 D_800DF4B4 = 0; s32 gIsInTracksMode = 1; s32 gNumberOfActivePlayers = 1; s32 gIsInTwoPlayerAdventure = 0; -MapId gTrackIdForPreview = ASSET_LEVEL_CENTRALAREAHUB; +s32 gTrackIdForPreview = ASSET_LEVEL_CENTRALAREAHUB; s32 gTrackSelectRow = 0; // 1 = Dino Domain, 2 = Sherbet Island, etc. s32 gSaveFileIndex = 0; s32 D_800DF4D0 = 0; // Unused? @@ -1847,7 +1847,7 @@ void menu_init(u32 menuId) { /** * Runs every frame. Calls the loop function of the current menu id */ -s32 menu_loop(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate) { +s32 menu_loop(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currHudVerts, TriangleList **currHudTris, s32 updateRate) { s32 ret; sMenuCurrDisplayList = *currDisplayList; @@ -4812,7 +4812,7 @@ s32 menu_game_select_loop(s32 updateRate) { func_80000B28(); gIsInTracksMode = TRUE; func_8006E5BC(); - load_level_for_menu((MapId)SPECIAL_MAP_ID_NO_LEVEL, -1, 0); + load_level_for_menu((s32)SPECIAL_MAP_ID_NO_LEVEL, -1, 0); menu_init(MENU_TRACK_SELECT); } else { gIsInAdventureTwo = D_800DF460; @@ -6028,7 +6028,7 @@ void func_80090918(s32 updateRate) { if (sp24 == 0) { var_a1 = (gFFLUnlocked == -1) ? 3 : 4; if (D_801267E8 & (A_BUTTON | START_BUTTON)) { - if (gTrackIdForPreview != (MapId) -1) { + if (gTrackIdForPreview != (s32) -1) { gMenuDelay = 1; gTrackIdToLoad = gTrackIdForPreview; D_800E1E1C = 1; @@ -6379,7 +6379,7 @@ GLOBAL_ASM("asm/non_matchings/menu/render_track_select_setup_ui.s") GLOBAL_ASM("asm/non_matchings/menu/func_80092188.s") -s32 func_80092BE0(MapId mapId) { +s32 func_80092BE0(s32 mapId) { s8 *trackIdArray; s32 index; s32 temp; @@ -6390,7 +6390,7 @@ s32 func_80092BE0(MapId mapId) { temp = -1; if (trackIdArray[0] != -1) { while (temp < 0) { - if (mapId == (MapId) trackIdArray[index]) { + if (mapId == (s32) trackIdArray[index]) { temp = index; } index++; @@ -6416,7 +6416,7 @@ s32 func_80092BE0(MapId mapId) { void menu_adventure_track_init(void) { Settings *settings; s32 result; - MapId mapId; + s32 mapId; s16 temp; settings = get_settings(); @@ -6588,7 +6588,7 @@ s32 menu_adventure_track_loop(s32 updateRate) { s32 sp30; s32 vehicle2; s32 sp28; - MapId mapId; + s32 mapId; s32 sp20; s32 sp1C; Settings *settings; @@ -7535,7 +7535,7 @@ void func_80098208(void) { #ifdef NON_MATCHING void menu_trophy_race_round_init(void) { - MapId levelId; + s32 levelId; s32 i; Settings *settings; s8 *levelIds; @@ -7550,7 +7550,7 @@ void menu_trophy_race_round_init(void) { } levelId = levelIds[((gTrophyRaceWorldId - 1) * 6) + gTrophyRaceRound]; - while (levelId == (MapId) -1) { + while (levelId == (s32) -1) { levelId = (levelId + 1) & 3; } @@ -9048,7 +9048,7 @@ void dialogue_close_stub(void) { * Renders a textbox with a displaylist. * Return value goes completely unused. */ -f32 func_8009E9B0(UNUSED DialogueBoxBackground *textbox, Gfx **dlist, Matrix **mat, VertexList **verts) { +f32 func_8009E9B0(UNUSED DialogueBoxBackground *textbox, Gfx **dlist, MatrixS **mat, Vertex **verts) { sMenuCurrDisplayList = *dlist; sMenuCurrHudMat = *mat; sMenuCurrHudVerts = *verts; diff --git a/src/menu.h b/src/menu.h index 91ee7a99..7091cc9c 100644 --- a/src/menu.h +++ b/src/menu.h @@ -315,7 +315,7 @@ extern s32 D_800DF4B4; extern s32 gIsInTracksMode; extern s32 gNumberOfActivePlayers; extern s32 gIsInTwoPlayerAdventure; -extern MapId gTrackIdForPreview; +extern s32 gTrackIdForPreview; extern s32 gTrackSelectRow; extern s32 gSaveFileIndex; @@ -688,7 +688,6 @@ extern DrawTexture D_800DFC40[2]; extern DrawTexture D_800DFC50[2]; extern DrawTexture D_800DFC60[2]; extern Gfx *sMenuCurrDisplayList; -extern Matrix *sMenuCurrHudMat; extern const char D_800E8208[]; extern s32 gOptionBlinkTimer; extern s32 D_801263E0; @@ -728,7 +727,7 @@ void func_8007FF88(void); void func_80080E6C(void); void func_800813C0(void); void menu_init(u32 menuId); -s32 menu_loop(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate); +s32 menu_loop(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currHudVerts, TriangleList **currHudTris, s32 updateRate); void show_timestamp(s32 frameCount, s32 xPos, s32 yPos, u8 red, u8 green, u8 blue, u8 fontID); void func_80081E54(MenuElement *arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); void func_800828B8(void); @@ -774,7 +773,7 @@ void assign_vehicle_icon_textures(void); void func_8008E4B0(void); void func_8008F534(void); void func_80090ED8(s32 updateRate); -s32 func_80092BE0(MapId mapId); +s32 func_80092BE0(s32 mapId); void menu_adventure_track_init(void); void func_80093A0C(void); void n_alSynRemovePlayer(void); @@ -841,7 +840,7 @@ s32 dialogue_race_defeat(void); s32 trophy_race_cabinet_menu_loop(void); void dialogue_open_stub(void); void dialogue_close_stub(void); -f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **dlist, Matrix **mat, VertexList **vtx); +f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **dlist, MatrixS **mat, Vertex **vtx); u64 *get_eeprom_settings_pointer(void); s32 set_eeprom_settings_value(u64 valueToSet); s32 unset_eeprom_settings_value(u64 valueToUnset); @@ -931,8 +930,8 @@ void func_8008D8BC(s32 updateRate); void renderTrackSelect(s32 arg0, s32 arg1, s8 *arg2, s8 *arg3, s32 arg4, s32 arg5, s32 arg6, DrawTexture *arg7, s32 arg8); //Possible names //void renderTrackSelect(s32 xPos, s32 yPos, char *levelName, char *arg3, s32 colour, s32 imageId, s32 copyViewPort, DrawTexture *arg7, s32 arg8); -s32 func_80095728(Gfx **gfx, Mtx **mtx, VertexList **vtx, s32 updateRate); -s32 func_8008F618(Gfx **dlist, Mtx **mat); +s32 func_80095728(Gfx **gfx, MatrixS **mtx, Vertex **vtx, s32 updateRate); +s32 func_8008F618(Gfx **dlist, MatrixS **mat); void func_80093D40(UNUSED s32 updateRate); void func_80080BC8(Gfx **); diff --git a/src/object_functions.c b/src/object_functions.c index 5ee7de1f..6a141f9d 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -3860,7 +3860,49 @@ void func_8003F0DC(void) { D_8011D4DC--; } -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003F0F8.s") +void func_8003F0F8(Object *obj, struct Object_Weapon *weapon, u16 soundID) { + Object *racer; + Object **racerGroup; + f32 distance; + s32 numRacers; + f32 diffX; + f32 diffZ; + f32 diffY; + s32 var_s4; + s32 i; + + var_s4 = FALSE; + racerGroup = get_racer_objects_by_port(&numRacers); + for (i = 0; i < numRacers; i++) { + racer = racerGroup[i]; + if (weapon->owner != racerGroup[i] && racer->unk64->racer.playerIndex != PLAYER_COMPUTER) { + diffX = racer->segment.trans.x_position - obj->segment.trans.x_position; + diffY = racer->segment.trans.y_position - obj->segment.trans.y_position; + diffZ = racer->segment.trans.z_position - obj->segment.trans.z_position; + distance = sqrtf((diffX * diffX) + (diffY * diffY) + (diffZ * diffZ)); + if (distance <= func_80001CB8(soundID)) { + var_s4 = TRUE; + } + } + } + if (var_s4) { + if (weapon->unk1C == 0) { + if (D_8011D4DC < 8) { + func_80009558(soundID, obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position, 1, &weapon->unk1C); + D_8011D4DC += 1; + } + } else { + update_spatial_audio_position(weapon->unk1C, obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position); + } + } else { + if (weapon->unk1C != 0) { + func_800096F8(weapon->unk1C); + weapon->unk1C = 0; + D_8011D4DC -= 1; + } + } +} + GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003F2E8.s") void func_8003FC44(f32 x, f32 y, f32 z, s32 objectID, s32 arg4, f32 scale, s32 arg6) { @@ -4248,7 +4290,7 @@ void obj_init_midichset(Object *obj, LevelObjectEntry_Midichset *entry) { } void obj_init_bubbler(Object *obj, LevelObjectEntry_Bubbler *entry) { - func_800AF134((unk800B2260 *) obj->unk6C, entry->unk9, entry->unk8, 0, 0, 0); + func_800AF134((unk800AF29C *) obj->unk6C, entry->unk9, entry->unk8, 0, 0, 0); obj->unk78 = entry->unkA; } diff --git a/src/object_functions.h b/src/object_functions.h index 3dbf528e..5013fa48 100644 --- a/src/object_functions.h +++ b/src/object_functions.h @@ -405,6 +405,7 @@ void obj_loop_modechange(Object *obj, s32 updateRate); void obj_loop_bonus(Object *obj, s32 updateRate); void obj_loop_fireball_octoweapon(Object *obj, s32 updateRate); void obj_loop_lasergun(Object *obj, s32 updateRate); +void func_8003F0F8(Object *obj, struct Object_Weapon *weapon, u16 soundID); //Non Matching void obj_loop_lavaspurt(Object *obj, s32 speed); diff --git a/src/objects.c b/src/objects.c index 6fa625c4..70fec9ed 100644 --- a/src/objects.c +++ b/src/objects.c @@ -209,11 +209,10 @@ s16 D_8011AE82; s16 gMapDefaultVehicle; // Vehicle enum s32 D_8011AE88; Gfx *gObjectCurrDisplayList; -Matrix *gObjectCurrMatrix; -VertexList *gObjectCurrVertexList; -s32 D_8011AE98[2]; -s32 D_8011AEA0; -s32 D_8011AEA4; +MatrixS *gObjectCurrMatrix; +Vertex *gObjectCurrVertexList; +u8 *D_8011AE98[2]; +s32 D_8011AEA0[2]; s32 D_8011AEA8[2]; s32 D_8011AEB0[2]; s16 *gAssetsLvlObjTranslationTable; @@ -701,7 +700,25 @@ u8 func_8000E4D8(void) { return D_8011AEF5; } -GLOBAL_ASM("asm/non_matchings/objects/func_8000E4E8.s") +void func_8000E4E8(s32 index) { + s32 *temp_v0; + s32 i; + u8 *temp_a1; + + temp_v0 = (s32 *) D_8011AEB0[index]; + temp_v0[0] = D_8011AEA0[index]; + temp_v0[3] = 0; + temp_v0[2] = 0; + temp_v0[1] = 0; + temp_a1 = &D_8011AE98[index][D_8011AEA0[index]]; + + // The backslash here is needed to match. And no, a for loop doesn't match. + i = 0; \ + while(i < 16) { + temp_a1[i] = 0; + i++; + } +} s32 func_8000E558(Object *arg0){ s32 temp_v0; @@ -710,13 +727,13 @@ s32 func_8000E558(Object *arg0){ return TRUE; } temp_v0 = (s32) arg0->segment.unk3C_a.level_entry; - new_var2 = D_8011AE98[0]; - if ((temp_v0 >= new_var2) && (((D_8011AEA0 * 8) + new_var2) >= temp_v0)) { + new_var2 = (s32) D_8011AE98[0]; + if ((temp_v0 >= new_var2) && (((D_8011AEA0[0] * 8) + new_var2) >= temp_v0)) { return FALSE; } - new_var = D_8011AE98[1]; + new_var = (s32) D_8011AE98[1]; // Why even bother with this check? - if (temp_v0 >= new_var && temp_v0 <= ((D_8011AEA4 * 8) + new_var)) { + if (temp_v0 >= new_var && temp_v0 <= ((D_8011AEA0[1] * 8) + new_var)) { return TRUE; } return TRUE; @@ -1236,19 +1253,19 @@ void func_80012CE8(Gfx **dlist) { } } -void func_80012D5C(Gfx **dlist, Matrix **mats, VertexList **verts, Object *object) { +void func_80012D5C(Gfx **dlist, MatrixS **mtx, Vertex **verts, Object *object) { f32 scale; if (object->segment.trans.unk6 & 0x5000) return; func_800B76B8(2, object->unk4A); gObjectCurrDisplayList = *dlist; - gObjectCurrMatrix = *mats; + gObjectCurrMatrix = *mtx; gObjectCurrVertexList = *verts; scale = object->segment.trans.scale; render_object(object); object->segment.trans.scale = scale; *dlist = gObjectCurrDisplayList; - *mats = gObjectCurrMatrix; + *mtx = gObjectCurrMatrix; *verts = gObjectCurrVertexList; func_800B76B8(2, -1); } @@ -1327,7 +1344,7 @@ GLOBAL_ASM("asm/non_matchings/objects/func_800138A8.s") * Get the racer object data, and fetch set visual shield properties based on that racer. * Afterwards, render the graphics with opacity scaling with the fadetimer. */ -void render_racer_shield(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj) { +void render_racer_shield(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *obj) { struct Object_Racer* racer; Object_68 *gfxData; ObjectModel *mdl; @@ -1399,7 +1416,7 @@ void render_racer_shield(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object * Get the racer object data, and fetch set visual magnet properties based on that racer. * Afterwards, render the graphics with opacity set by the properties. */ -void render_racer_magnet(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj) { +void render_racer_magnet(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *obj) { Object_Racer *racer; Object_68 *gfxData; ObjectModel *mdl; @@ -1629,7 +1646,7 @@ when TT is on. It looks like it checks some ghost data makes sure you've got a g with the default vehicle, Returns 0 if TT ghost was loaded successfully. */ -s32 func_8001B2F0(MapId mapId) { +s32 func_8001B2F0(s32 mapId) { TTGhostTable *ghostTable; TTGhostTable *prevGhostTable; s32 ret; @@ -1676,7 +1693,7 @@ s32 func_8001B668(s32 arg0) { s16 sp2E; s16 sp2C; s32 temp_v0; - MapId mapId; + s32 mapId; mapId = func_800599A8(); if ((func_8006BD88() != mapId) || (D_800DC728 != D_8011AE82)) { diff --git a/src/objects.h b/src/objects.h index bc570be6..7197b7ca 100644 --- a/src/objects.h +++ b/src/objects.h @@ -382,7 +382,7 @@ void func_80012C30(void); void func_80012C3C(Gfx** dlist); void func_80012C98(Gfx **dlist); void func_80012CE8(Gfx **dlist); -void func_80012D5C(Gfx **dlist, Matrix **mats, VertexList **verts, Object *object); +void func_80012D5C(Gfx **dlist, MatrixS **mtx, Vertex **verts, Object *object); void func_80012F30(Object *obj); void render_object(Object *this); void func_80013548(Object *arg0); @@ -454,11 +454,11 @@ void func_80021400(s32 arg0); s32 func_8001B668(s32 arg0); s32 func_80011570(Object *obj, f32 xPos, f32 yPos, f32 zPos); Object *get_racer_object_by_port(s32 index); -void render_racer_shield(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj); -void render_racer_magnet(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj); +void render_racer_shield(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *obj); +void render_racer_magnet(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *obj); void set_and_normalize_D_8011AFE8(f32 arg0, f32 arg1, f32 arg2); s32 func_8000FC6C(struct_8000FC6C_3 *arg0, struct_8000FC6C *arg1); -s32 func_8001B2F0(MapId mapId); +s32 func_8001B2F0(s32 mapId); void render_3d_billboard(Object *obj); void func_80011960(Object *obj, Vertex *verts, u32 numVertices, Triangle *triangles, u32 numTriangles, TextureHeader *tex, u32 arg6, u32 arg7, f32 arg8); void func_8000B290(void); @@ -467,6 +467,7 @@ s32 func_8001C48C(Object *obj); void func_80022CFC(s32 arg0, f32 x, f32 y, f32 z); Object *func_8001B7A8(Object *racer, s32 position, f32 *distance); s32 func_8000FD34(unk8000FD34 *arg0, unk_80016BC4_2 *arg1); +void func_8000E4E8(s32 index); //Non Matching void calc_dynamic_lighting_for_object_1(Object *, ObjectModel *, s16, Object *, f32, f32); @@ -487,7 +488,7 @@ s32 func_800185E4(s8, Object* obj, f32 xPos, f32 yPos, f32 zPos, f32* checkpoint void func_80011134(Object *, s32); void func_800113CC(Object *, s32, s32, s32, s32); s32 func_800143A8(ObjectModel*, Object*, s32, s32, s32); /* extern */ -void func_80068FA8(Gfx**, Matrix**, Object*, Object*, f32); /* extern */ +void func_80068FA8(Gfx**, MatrixS**, Object*, Object*, f32); /* extern */ void func_800138A8(Object*, unk80068514_arg4*, ObjectTransformExt *, s32); Object *func_8002342C(f32 x, f32 z); void func_8006017C(s32); diff --git a/src/particles.c b/src/particles.c index 5745d6f0..6be610a3 100644 --- a/src/particles.c +++ b/src/particles.c @@ -8,6 +8,8 @@ #include "memory.h" #include "textures_sprites.h" #include "thread0_epc.h" +#include "objects.h" +#include "asset_loading.h" /************ .rodata ************/ @@ -266,9 +268,9 @@ void init_particle_assets(void) { s32 *new_var2; s32 i; u32 new_var; - s32 temp; + func_800AE490(); - gParticlesAssetTable = (s32) load_asset_section_from_rom(ASSET_PARTICLES_TABLE); + gParticlesAssetTable = (unk800E2CF0 **) load_asset_section_from_rom(ASSET_PARTICLES_TABLE); gParticlesAssetTableCount = -1; while (((s32) gParticlesAssetTable[gParticlesAssetTableCount + 1]) != -1){ gParticlesAssetTableCount++; @@ -279,20 +281,20 @@ void init_particle_assets(void) { gParticlesAssetTable[i] = (unk800E2CF0 *) (((u8 *) gParticlesAssets) + ((s32) gParticlesAssetTable[i])); } - gParticleBehavioursAssetTable = (s32) load_asset_section_from_rom(ASSET_PARTICLE_BEHAVIORS_TABLE); + gParticleBehavioursAssetTable = (ParticleBehavior **) load_asset_section_from_rom(ASSET_PARTICLE_BEHAVIORS_TABLE); gParticleBehavioursAssetTableCount = -1; while (((s32) gParticleBehavioursAssetTable[gParticleBehavioursAssetTableCount + 1]) != (-1)) { gParticleBehavioursAssetTableCount++; } - gParticleBehavioursAssets = (s32) load_asset_section_from_rom(ASSET_PARTICLE_BEHAVIORS); + gParticleBehavioursAssets = (s32 *) load_asset_section_from_rom(ASSET_PARTICLE_BEHAVIORS); for (i = 0; i < gParticleBehavioursAssetTableCount; i++) { new_var = -1; gParticleBehavioursAssetTable[i] = (ParticleBehavior *) (((u8 *) gParticleBehavioursAssets) + ((s32) gParticleBehavioursAssetTable[i])); - if (((s32) gParticleBehavioursAssetTable[i]->unk9C) != new_var) + if (((u32) gParticleBehavioursAssetTable[i]->unk9C) != new_var) { new_var2 = gParticleBehavioursAssetTable[i]->unk9C; - gParticleBehavioursAssetTable[i]->unk9C = get_misc_asset(new_var2); + gParticleBehavioursAssetTable[i]->unk9C = (s32 *) get_misc_asset((s32) new_var2); } } } @@ -419,7 +421,7 @@ void func_800AF0A4(Object *obj) { s16 temp_t1, temp_t8_0; s32 temp_t8; - temp_v0 = obj->unk44; + temp_v0 = (Object_44 *) obj->unk44; temp_v1 = temp_v0->unkC; temp_t8_0 = (temp_v0->unk0->unk0 - 1) << 5; temp_t8 = (s32)temp_t8_0; @@ -437,7 +439,7 @@ void func_800AF0F0(Object *obj) { Object_44_C *temp_v1; s16 temp_t8, temp_t1; - temp_v0 = obj->unk44; + temp_v0 = (Object_44 *) obj->unk44; temp_v1 = temp_v0->unkC; temp_t8 = (temp_v0->unk0->unk0 - 1) << 5; temp_t1 = (temp_v0->unk0->unk1 - 1) << 5; @@ -449,7 +451,7 @@ void func_800AF0F0(Object *obj) { temp_v1->unk1C = temp_t8; } -void func_800AF134(unk800B2260 *arg0, s32 arg1, s32 arg2, s16 arg3, s16 arg4, s16 arg5) { +void func_800AF134(unk800AF29C *arg0, s32 arg1, s32 arg2, s16 arg3, s16 arg4, s16 arg5) { ParticleBehavior *temp; if (arg2 >= gParticlesAssetTableCount) { arg2 = 0; @@ -563,19 +565,19 @@ GLOBAL_ASM("asm/non_matchings/particles/func_800B1130.s") GLOBAL_ASM("asm/non_matchings/particles/func_800B1CB8.s") GLOBAL_ASM("asm/non_matchings/particles/func_800B2040.s") -void func_800B2260(unk800B2260 *arg0) { +void func_800B2260(unk800AF29C *arg0) { unk800B2260_C *temp_v0; s32 i; if (arg0->unk4 & 0x400) { - if (arg0->unkC != NULL) { + if (arg0->unkB.unkC_60 != NULL) { for (i = 0; i < arg0->unk6; i++) { - temp_v0 = arg0->unkC[i]; + temp_v0 = arg0->unkB.unkC_60[i]; temp_v0->unk3A = 0; temp_v0->unk70 = 0; } - free_from_memory_pool(arg0->unkC); - arg0->unkC = NULL; + free_from_memory_pool(arg0->unkB.unkC_60); + arg0->unkB.unkC_60 = NULL; } } } @@ -583,20 +585,20 @@ void func_800B2260(unk800B2260 *arg0) { GLOBAL_ASM("asm/non_matchings/particles/func_800B22FC.s") void func_800B263C(unk800B2260_C *arg0) { - unk800B2260 *new_var; + unk800AF29C *new_var; unk800B2260_C *new_var2; - unk800B2260 *temp_v0; + unk800AF29C *temp_v0; s32 i; - temp_v0 = (unk800B2260 *)arg0->unk70; + temp_v0 = (unk800AF29C *) arg0->unk70; if (temp_v0 != NULL) { new_var = temp_v0; if (temp_v0->unk6 != 0) { - if (arg0 == temp_v0->unkC[arg0->unk74]) { + if (arg0 == temp_v0->unkB.unkC_60[arg0->unk74]) { temp_v0->unk6--; for (i = arg0->unk74; i < temp_v0->unk6; i++) { - new_var->unkC[i] = new_var->unkC[i + 1]; - new_var2 = new_var->unkC[i]; + new_var->unkB.unkC_60[i] = new_var->unkB.unkC_60[i + 1]; + new_var2 = new_var->unkB.unkC_60[i]; new_var2->unk74 = i; } } diff --git a/src/particles.h b/src/particles.h index 85c48ef4..206e0f9c 100644 --- a/src/particles.h +++ b/src/particles.h @@ -49,24 +49,6 @@ typedef struct unk800AF29C_C { s16 unk16; } unk800AF29C_C; -typedef struct unk800AF29C { - ParticleBehavior *unk0; - s16 unk4; - u8 unk6; - u8 unk7; - s16 unk8; - s16 unkA; - union { - unk800AF29C_C_4000 unkC_4000; - unk800AF29C_C_400 unkC_400; - unk800AF29C_C unkC; - } unkB; - s16 unk18; - s16 unk1A; - s16 unk1C; - s16 unk1E; -} unk800AF29C; - typedef struct unk800E2CF0 { u8 pad0[8]; s16 unk8; @@ -100,15 +82,24 @@ typedef struct unk800B2260_C { u8 unk74; } unk800B2260_C; -//Could be the same as Object_6C -typedef struct unk800B2260 { +typedef struct unk800AF29C { ParticleBehavior *unk0; s16 unk4; - u8 unk6; + u8 unk6; + u8 unk7; s16 unk8; s16 unkA; - unk800B2260_C **unkC; -} unk800B2260; + union { + unk800AF29C_C_4000 unkC_4000; + unk800AF29C_C_400 unkC_400; + unk800B2260_C **unkC_60; + unk800AF29C_C unkC; + } unkB; + s16 unk18; + s16 unk1A; + s16 unk1C; + s16 unk1E; +} unk800AF29C; typedef struct XYStruct { s16 x, y; @@ -149,11 +140,11 @@ void func_800AF0F0(Object *obj); void func_800AF1E0(unk800AF29C *arg0, s32 arg1, s32 arg2); void func_800AF29C(unk800AF29C *arg0, s32 arg1, s32 arg2, s16 arg3, s16 arg4, s16 arg5); void func_800AF6E4(Object *obj, s32 arg1); -void func_800B2260(unk800B2260 *arg0); +void func_800B2260(unk800AF29C *arg0); void func_800B263C(unk800B2260_C *arg0); void init_particle_assets(void); -void func_800AF134(unk800B2260 *arg0, s32 arg1, s32 arg2, s16 arg3, s16 arg4, s16 arg5); // Non Matching +void func_800AF134(unk800AF29C *arg0, s32 arg1, s32 arg2, s16 arg3, s16 arg4, s16 arg5); // Non Matching void func_800AF404(s32 arg0); // Non Matching void func_800AFC3C(Object *, s32); // Non Matching void func_800AE728(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); // Non Matching diff --git a/src/printf.c b/src/printf.c index 3dc00445..01541748 100644 --- a/src/printf.c +++ b/src/printf.c @@ -78,7 +78,7 @@ GLOBAL_ASM("asm/non_matchings/printf/func_800B3358.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B34B0.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B3564.s") -UNUSED void func_800B3678(Gfx **arg0, Matrix **arg1, VertexList **arg2) { +UNUSED void func_800B3678(Gfx **arg0, MatrixS **arg1, Vertex **arg2) { UNUSED s32 pad; UNUSED s32 pad2; Object **temp_s0; diff --git a/src/printf.h b/src/printf.h index 65abc7a4..6fad8cb3 100644 --- a/src/printf.h +++ b/src/printf.h @@ -50,7 +50,7 @@ void print_debug_strings(Gfx **dList); void set_render_printf_position(u16 xpos, u16 ypos); // Non Matching s32 render_printf(const char *format, ...); // Non Matchingg -void func_800B3740(Object *, Gfx **, Matrix **, VertexList **, s32); // Non Matching +void func_800B3740(Object *, Gfx **, MatrixS **, Vertex **, s32); // Non Matching s32 func_800B653C(Gfx**, s8*); #endif diff --git a/src/racer.c b/src/racer.c index 42b57e8b..7033dbe0 100644 --- a/src/racer.c +++ b/src/racer.c @@ -3909,11 +3909,11 @@ void func_80059984(s32 arg0) { D_8011D5AC = arg0; } -MapId func_800599A8(void) { +s32 func_800599A8(void) { return D_8011D5AC; } -s32 func_800599B8(s32 arg0, MapId mapId, s16 arg2, s16 *arg3, s16 *arg4) { +s32 func_800599B8(s32 arg0, s32 mapId, s16 arg2, s16 *arg3, s16 *arg4) { s32 temp_v0; s32 temp_t8; s16 sp2E; @@ -3963,7 +3963,7 @@ void free_tt_ghost_data(void) { gGhostData[2] = NULL; } -s32 func_80059B7C(s32 controllerIndex, MapId mapId, s16 arg2, s16 arg3, s16 arg4) { +s32 func_80059B7C(s32 controllerIndex, s32 mapId, s16 arg2, s16 arg3, s16 arg4) { return func_80075000(controllerIndex, (s16)mapId, arg2, arg3, arg4, D_8011D5A0[D_8011D59C], gGhostData[D_8011D59C]); } diff --git a/src/racer.h b/src/racer.h index 9618659e..180e7849 100644 --- a/src/racer.h +++ b/src/racer.h @@ -120,7 +120,8 @@ typedef struct unk8005234C { } unk8005234C; typedef struct TempStruct5 { - s8 pad0[8]; + f32 unk0; + f32 unk4; s8 unk8[4][4]; } TempStruct5; @@ -236,11 +237,11 @@ void get_timestamp_from_frames(s32 frameCount, s32 *minutes, s32 *seconds, s32 * void func_800598D0(void); void func_80059944(void); void func_80059984(s32 arg0); -MapId func_800599A8(void); -s32 func_800599B8(s32 arg0, MapId mapId, s16 arg2, s16 *arg3, s16 *arg4); +s32 func_800599A8(void); +s32 func_800599B8(s32 arg0, s32 mapId, s16 arg2, s16 *arg3, s16 *arg4); s32 load_tt_ghost(s32 ghostOffset, s32 size, s16 *outTime); void free_tt_ghost_data(void); -s32 func_80059B7C(s32 controllerIndex, MapId mapId, s16 arg2, s16 arg3, s16 arg4); +s32 func_80059B7C(s32 controllerIndex, s32 mapId, s16 arg2, s16 arg3, s16 arg4); s16 func_80059E20(void); void func_8005A3B0(void); void func_8005A3C0(void); diff --git a/src/save_data.c b/src/save_data.c index 5cb0a6f0..c1a17d16 100644 --- a/src/save_data.c +++ b/src/save_data.c @@ -679,7 +679,7 @@ s32 read_time_data_from_controller_pak(s32 controllerIndex, char *fileExt, Setti status = read_data_from_controller_pak(controllerIndex, fileNumber, (u8 *)cpakData, fileSize); if (status == CONTROLLER_PAK_GOOD) { if (*cpakData == TIMD) { - func_80073588(settings, (u64 *) (cpakData + 1), 3); + func_80073588(settings, (u8 *) (cpakData + 1), 3); } else { status = CONTROLLER_PAK_BAD_DATA; } @@ -882,7 +882,7 @@ s32 read_eeprom_data(Settings *arg0, u8 arg1) { for (i = 0; i < blocks; i++) { osEepromRead(get_si_mesg_queue(), i + 0x10, (u8 *)&alloc[i]); } - func_80073588(arg0, alloc, 1); + func_80073588(arg0, (u8 *) alloc, 1); } if (arg1 & 2) { @@ -890,7 +890,7 @@ s32 read_eeprom_data(Settings *arg0, u8 arg1) { for (i = 0; i < blocks; i++) { osEepromRead(get_si_mesg_queue(), i + 0x28, (u8 *)(&alloc[24] + i)); } - func_80073588(arg0, alloc, 2); + func_80073588(arg0, (u8 *) alloc, 2); } free_from_memory_pool(alloc); diff --git a/src/save_data.h b/src/save_data.h index 2c7ec991..61b92101 100644 --- a/src/save_data.h +++ b/src/save_data.h @@ -87,7 +87,7 @@ void erase_save_file(s32 saveFileNum, Settings *settings); SIDeviceStatus func_800756D4(s32 controllerIndex, u8 *arg1, u8 *arg2, u8 *arg3, s16 *arg4); s32 func_800738A4(Settings *arg0, u8 *arg1); //Non matching -//void func_800732E8(Settings *arg0, u8 *arg1); //Non matching +void func_800732E8(Settings *arg0, u8 *arg1); //Non matching //void func_80073588(Settings *arg0, u64 *eepromData, s32 arg2); //Non matching s32 func_80073C5C(s32 controllerIndex, s32 arg1, char **arg2); //Non matching //Using some context, and best guesses, these could be the names of the variables diff --git a/src/textures_sprites.c b/src/textures_sprites.c index 76e4494e..a1787b09 100644 --- a/src/textures_sprites.c +++ b/src/textures_sprites.c @@ -5,6 +5,7 @@ #include "gzip.h" #include "asset_loading.h" #include "memory.h" +#include "math_util.h" /************ .data ************/ @@ -1113,9 +1114,9 @@ typedef struct Struct_Unk_8007B46C { Struct_Unk_8007B46C *func_8007B46C(Struct_Unk_8007B46C *arg0, s32 arg1) { if (arg1 > 0) { if (arg1 < arg0->unk12 << 8) { - arg0 = ((u8*)arg0) + ((arg1 >> 16) * arg0->unk16); + arg0 = (Struct_Unk_8007B46C *) (((u8*)arg0) + ((arg1 >> 16) * arg0->unk16)); } else { - arg0 = ((u8*)arg0) + ((arg0->unk12 >> 8) - 1) * arg0->unk16; + arg0 = (Struct_Unk_8007B46C *) (((u8*)arg0) + ((arg0->unk12 >> 8) - 1) * arg0->unk16); } } return arg0; @@ -1140,7 +1141,7 @@ void load_and_set_texture(Gfx **dlist, TextureHeader *texhead, s32 flags, s32 ar if (texhead != NULL) { if ((arg3) && (arg3 < (texhead->numOfTextures << 8))) { - texhead = (s8 *) texhead + ((arg3 >> 16) * texhead->textureSize); + texhead = (TextureHeader *) ((s8 *) texhead + ((arg3 >> 16) * texhead->textureSize)); } flags |= texhead->flags; @@ -1265,7 +1266,7 @@ void func_8007BA5C(Gfx **dlist, TextureHeader *texture_list, u32 flags, s32 text u16 *mblock; u16 *tblock; if ((texture_index != 0) && (texture_index < (texture_list->numOfTextures * 256))) { - texture_list = (s32)texture_list + ((texture_index >> 16) * texture_list->textureSize); + texture_list = (TextureHeader *) ((s32) texture_list + ((texture_index >> 16) * texture_list->textureSize)); } mblock = (u16*)(texture_list + 1); tblock = mblock + 0x400; @@ -1489,7 +1490,7 @@ GLOBAL_ASM("asm/non_matchings/textures_sprites/func_8007CDC0.s") GLOBAL_ASM("asm/non_matchings/textures_sprites/build_tex_display_list.s") s32 func_8007EF64(s16 arg0) { - return arg0 + gCiPalettes; + return (s32) (arg0 + gCiPalettes); } // There might be a file boundary here. diff --git a/src/unknown_003260.c b/src/unknown_003260.c index c2a3b15b..d8464352 100644 --- a/src/unknown_003260.c +++ b/src/unknown_003260.c @@ -3,13 +3,15 @@ #include "unknown_003260.h" #include "memory.h" +#include "audio_internal.h" +#include "video.h" /************ .bss ************/ // All of these are defined in unknown_003260_bss.c // This was needed, since there is a bss reordering issue with D_80119BD0 and gAlSndPlayer -extern s32 gAudioSched; +extern OSSched *gAudioSched; extern ALHeap *D_80115F94; extern s32 D_80115F98[2]; extern s32 D_80115FA0[3]; @@ -34,7 +36,6 @@ extern OSMesgQueue audDMAMessageQ; extern OSMesg audDMAMessageBuf[NUM_DMA_MESSAGES]; extern unk800DC6BC D_80119BD0; extern u16 *D_80119C28; -extern f32 gVideoRefreshRate; /******************************/ @@ -131,19 +132,19 @@ void audioStopThread(void) { void thread4_audio(UNUSED void *arg) { s32 audioThreadMarkExit; s16 *audioThreadRetraceMesg; - s16 *audioThreadUpdateMesg; + OSMesg *audioThreadUpdateMesg; audioThreadMarkExit = FALSE; audioThreadRetraceMesg = NULL; audioThreadUpdateMesg = NULL; - osScAddClient(gAudioSched, &audioStack, &gAudioMesgQueue, OS_SC_ID_AUDIO); + osScAddClient(gAudioSched, (OSScClient *) &audioStack, &gAudioMesgQueue, OS_SC_ID_AUDIO); while (!audioThreadMarkExit) { - osRecvMesg(&gAudioMesgQueue, &audioThreadRetraceMesg, 1); + osRecvMesg(&gAudioMesgQueue, (OSMesg *) &audioThreadRetraceMesg, 1); switch (*audioThreadRetraceMesg) { case 1: func_80002C00(D_80115F98[(((u32) audFrameCt % 3))+2], audioThreadUpdateMesg); - osRecvMesg(&D_80116198, &audioThreadUpdateMesg, 1); + osRecvMesg(&D_80116198, (OSMesg *) &audioThreadUpdateMesg, 1); func_80002DF8(audioThreadUpdateMesg); break; case 4: @@ -159,7 +160,7 @@ void thread4_audio(UNUSED void *arg) { GLOBAL_ASM("asm/non_matchings/unknown_003260/func_80002C00.s") -void func_80002DF8(s32 arg0) { +void func_80002DF8(UNUSED OSMesg mesg) { static s32 D_800DC6A0 = 1; if ((osAiGetLength() >> 2) == 0) { if (D_800DC6A0 == 0) { @@ -289,7 +290,6 @@ GLOBAL_ASM("asm/non_matchings/unknown_003260/__amDMA.s") * *****************************************************************************/ ALDMAproc __amDmaNew(AMDMAState **state) { - int i; if(!dmaState.initialized) { /* only do this once */ dmaState.firstUsed = 0; @@ -342,7 +342,7 @@ void alSndPNew(audioMgrConfig *c) { i = 1; for (i = 1; i < c->unk00; i++) { tmp1 = gAlSndPlayer->unk40; - alLink(i + tmp1, i + tmp1 - 1); + alLink((ALLink *) (i + tmp1), (ALLink *) (i + tmp1 - 1)); } D_80119C28 = alHeapDBAlloc(0, 0, c->hp, 2, c->unk10); @@ -350,12 +350,12 @@ void alSndPNew(audioMgrConfig *c) { D_80119C28[i] = 32767; } - gAlSndPlayer->drvr = alGlobals; + gAlSndPlayer->drvr = (ALSynth *) alGlobals; gAlSndPlayer->node.next = NULL; gAlSndPlayer->node.handler = &_sndpVoiceHandler; gAlSndPlayer->node.clientData = gAlSndPlayer; - alSynAddPlayer(gAlSndPlayer->drvr, gAlSndPlayer); + alSynAddPlayer(gAlSndPlayer->drvr, (ALPlayer *) gAlSndPlayer); sp_38.type = 32; alEvtqPostEvent(&(gAlSndPlayer->evtq), &sp_38, gAlSndPlayer->frameTime); gAlSndPlayer->nextDelta = alEvtqNextEvent(&(gAlSndPlayer->evtq), &(gAlSndPlayer->nextEvent)); @@ -447,10 +447,10 @@ void func_800049D8(void) { void func_800049F8(s32 soundMask, s16 type, u32 volume) { ALSndpEvent sndEvt; sndEvt.snd_event.type = type; - sndEvt.snd_event.state = soundMask; + sndEvt.snd_event.state = (void *) soundMask; sndEvt.snd_event.unk04 = volume; if (soundMask) { - alEvtqPostEvent(&(gAlSndPlayer->evtq), &sndEvt, 0); + alEvtqPostEvent(&(gAlSndPlayer->evtq), (ALEvent *) &sndEvt, 0); } } diff --git a/src/unknown_003260.h b/src/unknown_003260.h index 8904f909..cd774a9f 100644 --- a/src/unknown_003260.h +++ b/src/unknown_003260.h @@ -125,11 +125,13 @@ void func_800049F8(s32 soundMask, s16 type, u32 volume); u16 func_80004A3C(u8 arg0); ALDMAproc __amDmaNew(AMDMAState **state); void func_80004A60(u8 arg0, u16 arg1); -void func_80002DF8(s32 arg0); +void func_80002DF8(OSMesg mesg); // Non Matching ALMicroTime _sndpVoiceHandler(void *node); void func_80004668(ALBank *bnk, s16 sndIndx, u8, s32); void audioNewThread(ALSynConfig *c, OSPri p, OSSched *arg2); +void func_800048D8(s32); +void func_80002C00(s32, OSMesg mesg); #endif diff --git a/src/unknown_008C40.c b/src/unknown_008C40.c index 32c608a4..d06b715d 100644 --- a/src/unknown_008C40.c +++ b/src/unknown_008C40.c @@ -8,6 +8,7 @@ #include "unknown_005740.h" #include "memory.h" #include "audio.h" +#include "textures_sprites.h" /************ .data ************/ @@ -174,7 +175,7 @@ s32 func_80009AB4(u8 arg0) { ret = 1; levelHeader = &D_8011A6D8[arg0]; - var_a2 = &levelHeader->unk4; + var_a2 = (unk8011A6D8_04 *) &levelHeader->unk4; if (levelHeader->unkB8 <= 0) { return 0; diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index 58f17f92..873ef001 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -20,6 +20,7 @@ #include "particles.h" #include "lib/src/libc/rmonPrintf.h" #include "objects.h" +#include "math_util.h" // Maximum size for a level model is 522.5 KiB #define LEVEL_MODEL_MAX_SIZE 0x82A00 @@ -69,8 +70,8 @@ const char D_800E5E10[] = "TrackGetHeight() - Overflow!!!\n"; /************ .bss ************/ Gfx *gSceneCurrDisplayList; -Matrix *gSceneCurrMatrix; -VertexList *gSceneCurrVertexList; +MatrixS *gSceneCurrMatrix; +Vertex *gSceneCurrVertexList; TriangleList *gSceneCurrTriList; ObjectSegment *D_8011B0B0; // Camera Object? @@ -271,7 +272,7 @@ extern u32 D_A0000200; /** * The root function for rendering the entire scene */ -void render_scene(Gfx** dList, Matrix** mtx, s16** vtx, s8** tris, s32 updateRate) { +void render_scene(Gfx** dList, MatrixS** mtx, Vertex** vtx, s8** tris, s32 updateRate) { s32 i; s32 numViewports; s32 delta; @@ -598,7 +599,7 @@ void draw_gradient_background(void) { tris[1].uv2.u = 0; tris[1].uv2.v = 0; verts += 4; - gSceneCurrVertexList = (VertexList *) verts; + gSceneCurrVertexList = verts; tris += 2; gSceneCurrTriList = (TriangleList *) tris; } diff --git a/src/unknown_0255E0.h b/src/unknown_0255E0.h index cb303609..8dadb702 100644 --- a/src/unknown_0255E0.h +++ b/src/unknown_0255E0.h @@ -88,8 +88,6 @@ extern s32 D_800DC928; extern s8 D_800DC92C[24]; -void object_transform_to_matrix(Matrix, ObjectTransform *); // asm func - s32 func_800249E0(s32 arg0); void func_800257D0(void); void func_80027FC4(s32 arg0); @@ -130,7 +128,7 @@ void func_80028CD0(s32 updateRate); //Non Matching void render_level_segment(s32 segmentId, s32 nonOpaque); void func_80030664(s32 arg0, s16 arg1, s16 arg2, u8 arg3, u8 arg4, u8 arg5); -void render_scene(Gfx** dList, Matrix** mtx, s16** vtx, s8** tris, s32 updateRate); +void render_scene(Gfx** dList, MatrixS** mtx, Vertex** vtx, s8** tris, s32 updateRate); void func_8002C7D4(void); Gfx *func_8002581C(u8 *segmentIds, s32 numberOfSegments, s32 currentViewportIndex); s32 func_80027568(void); @@ -142,10 +140,9 @@ void func_80028050(void); void func_80028CD0(s32); void func_8002A31C(void); void func_8007F24C(s8*, s32); -void func_800ACA20(Gfx**, Matrix**, s16**, ObjectSegment*); void func_800AD030(ObjectSegment*); void func_800B9C18(s32); -void func_800BA8E4(Gfx**, Matrix**, s32); +void func_800BA8E4(Gfx**, MatrixS**, s32); void func_8002DE30(Object*); void func_8002E234(Object*, s32); void func_80030DE0(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6); diff --git a/src/unknown_05CEF0.c b/src/unknown_05CEF0.c index dbc42bee..e18a2cdf 100644 --- a/src/unknown_05CEF0.c +++ b/src/unknown_05CEF0.c @@ -250,9 +250,9 @@ void func_8005CB68(Object_Racer *racer, s8 *arg1) { s32 bossId; s32 racerUnk1AC; s8 *miscAsset67; - MapId miscAsset68Byte5; - MapId miscAsset68Byte6; - MapId miscAsset68Byte7; + s32 miscAsset68Byte5; + s32 miscAsset68Byte6; + s32 miscAsset68Byte7; s8 miscAsset67CourseByte; s32 var_t1; s32 i; @@ -295,21 +295,21 @@ void func_8005CB68(Object_Racer *racer, s8 *arg1) { } if (settings->worldId == WORLD_CENTRAL_AREA) { if (racerUnk1AC == 1) { - func_8006C1AC((MapId)SPECIAL_MAP_ID_UNK_NEG2, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_UNK_NEG2, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset68Byte5, 0, -1, 0); func_8006C1AC(miscAsset67CourseByte, 0, -1, 1); } else { - func_8006C1AC((MapId)SPECIAL_MAP_ID_UNK_NEG10, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_UNK_NEG10, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset67CourseByte, 0, -1, 2); } } else if (racerUnk1AC == 1) { set_eeprom_settings_value(1); //Set Adventure Two Unlocked - func_8006C1AC((MapId)SPECIAL_MAP_ID_UNK_NEG2, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_UNK_NEG2, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset68Byte7, 0, -1, 0); func_8006C1AC(miscAsset68Byte6, 0, -1, 0); func_8006C1AC(miscAsset67CourseByte, 0, -1, 1); } else { - func_8006C1AC((MapId)SPECIAL_MAP_ID_UNK_NEG10, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_UNK_NEG10, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset67CourseByte, 0, -1, 2); } if (racerUnk1AC == 1) { @@ -339,7 +339,7 @@ void func_8005CB68(Object_Racer *racer, s8 *arg1) { settings->courseFlagsPtr[settings->courseId] |= 2; if (!(settings->bosses & bossId)) { settings->bosses |= bossId; - func_8006C1AC((MapId)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset67CourseByte, 4, -1, 4); } else if (!(settings->bosses & (bossId << 6))) { settings->bosses |= bossId << 6; @@ -352,21 +352,21 @@ void func_8005CB68(Object_Racer *racer, s8 *arg1) { settings->wizpigAmulet = var_t1; } if (var_t1 != 0) { - func_8006C1AC((MapId)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); func_8006C1AC(ASSET_LEVELNAME_WIZPIGAMULETSEQUENCE, 0, -1, settings->wizpigAmulet - 1); func_8006C1AC(miscAsset67CourseByte, 6, -1, 6); } else { - func_8006C1AC((MapId)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset67CourseByte, 4, -1, 4); } } else { - func_8006C1AC((MapId)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_NO_LEVEL, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset67CourseByte, 4, -1, 4); } func_8006F140(4); func_8000E128(); } else { - func_8006C1AC((MapId)SPECIAL_MAP_ID_UNK_NEG10, 0, VEHICLE_CAR, 0); + func_8006C1AC((s32)SPECIAL_MAP_ID_UNK_NEG10, 0, VEHICLE_CAR, 0); func_8006C1AC(miscAsset67CourseByte, 5, -1, 5); func_8006F140(3); } diff --git a/src/unknown_05CEF0.h b/src/unknown_05CEF0.h index e2fb2888..60ac0001 100644 --- a/src/unknown_05CEF0.h +++ b/src/unknown_05CEF0.h @@ -17,8 +17,6 @@ extern f32 D_8011D5C0; extern s8 D_8011D5C4; extern s8 D_8011D5CC; -s32 get_random_number_from_range(s32, s32); //? - void func_8005C2F0(Object *object, unk8005C2F0 *arg1); void func_8005CA78(u16 *arg0); void func_8005CA84(f32 x, f32 y, f32 z, s32 arg3); diff --git a/src/weather.c b/src/weather.c index 6510fab3..c828dfa8 100644 --- a/src/weather.c +++ b/src/weather.c @@ -153,10 +153,10 @@ unk80127BF8 D_80127BF8; s32 D_80127C00; s32 D_80127C04; s32 D_80127C08; -Gfx *gWeatherDisplayListHead; -Matrix *D_80127C10; -VertexList *D_80127C14; -TriangleList *D_80127C18; +Gfx *gCurrWeatherDisplayList; +MatrixS *gCurrWeatherMatrix; +Vertex *gCurrWeatherVertexList; +TriangleList *gCurrWeatherTriList; ObjectSegment *D_80127C1C; Matrix *D_80127C20; s32 D_80127C24; @@ -290,12 +290,12 @@ void func_800ABC5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { * The root function for handling all weather. * Decide whether to perform rain or snow logic, execute it, then set it to render right after. */ -void process_weather(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate) { +void process_weather(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currHudVerts, TriangleList **currHudTris, s32 updateRate) { UNUSED s32 unused; - gWeatherDisplayListHead = *currDisplayList; - D_80127C10 = *currHudMat; - D_80127C14 = *currHudVerts; - D_80127C18 = *currHudTris; + gCurrWeatherDisplayList = *currDisplayList; + gCurrWeatherMatrix = *currHudMat; + gCurrWeatherVertexList = *currHudVerts; + gCurrWeatherTriList = *currHudTris; D_80127C1C = func_80069D20(); D_80127C20 = func_80069DBC(); if (gWeatherType != WEATHER_SNOW) { @@ -329,10 +329,10 @@ void process_weather(Gfx **currDisplayList, Matrix **currHudMat, VertexList **cu D_80127C08 = 1 - D_80127C08; } } - *currDisplayList = gWeatherDisplayListHead; - *currHudMat = D_80127C10; - *currHudVerts = D_80127C14; - *currHudTris = D_80127C18; + *currDisplayList = gCurrWeatherDisplayList; + *currHudMat = gCurrWeatherMatrix; + *currHudVerts = gCurrWeatherVertexList; + *currHudTris = gCurrWeatherTriList; } GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC0C8.s") @@ -351,18 +351,18 @@ void render_falling_snow(void) { if (D_800E2908 >= 4) { i = 0; mtx = (u32) func_80069DB0(); - gSPMatrix(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(mtx ^ 0), G_MTX_DKR_INDEX_0); - gDkrInsertMatrix(gWeatherDisplayListHead++, G_MTX_DKR_INDEX_0, 0); - func_8007B4C8(&gWeatherDisplayListHead, D_800E28D8.unk8, 2U); + gSPMatrix(gCurrWeatherDisplayList++, OS_PHYSICAL_TO_K0(mtx ^ 0), G_MTX_DKR_INDEX_0); + gDkrInsertMatrix(gCurrWeatherDisplayList++, G_MTX_DKR_INDEX_0, 0); + func_8007B4C8(&gCurrWeatherDisplayList, D_800E28D8.unk8, 2U); while (i + D_80127C00 < D_800E2908) { mtx = (u32) &D_800E2904[i]; - gSPVertexDKR(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(mtx), D_80127C00, 0); - gSPPolygon(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(D_800E290C), D_80127C04, 1); + gSPVertexDKR(gCurrWeatherDisplayList++, OS_PHYSICAL_TO_K0(mtx), D_80127C00, 0); + gSPPolygon(gCurrWeatherDisplayList++, OS_PHYSICAL_TO_K0(D_800E290C), D_80127C04, 1); i += D_80127C00; } mtx = (u32) &D_800E2904[i]; - gSPVertexDKR(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(mtx), (D_800E2908 - i), 0); - gSPPolygon(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(D_800E290C), ((s32) (D_800E2908 - i) >> 1), 1); + gSPVertexDKR(gCurrWeatherDisplayList++, OS_PHYSICAL_TO_K0(mtx), (D_800E2908 - i), 0); + gSPPolygon(gCurrWeatherDisplayList++, OS_PHYSICAL_TO_K0(D_800E290C), ((s32) (D_800E2908 - i) >> 1), 1); } } } @@ -509,14 +509,14 @@ void handle_weather_rain(s32 updateRate) { render_rain_splashes(updateRate); handle_rain_lightning(updateRate); if (gLightningFrequency >= 256) { - func_80067F2C(&gWeatherDisplayListHead, &D_80127C10); + func_80067F2C(&gCurrWeatherDisplayList, &gCurrWeatherMatrix); for(i = 0; i < 2; i++) { render_rain_overlay(&gRainGfx[i], updateRate); } - gDPSetPrimColor(gWeatherDisplayListHead++, 0, 0, 255, 255, 255, 255); - gDPSetEnvColor(gWeatherDisplayListHead++, 255, 255, 255, 0); - reset_render_settings(&gWeatherDisplayListHead); // Pipesync and some stuff idk yet - func_800682AC(&gWeatherDisplayListHead); // Looks to create a viewport scissor. + gDPSetPrimColor(gCurrWeatherDisplayList++, 0, 0, 255, 255, 255, 255); + gDPSetEnvColor(gCurrWeatherDisplayList++, 255, 255, 255, 0); + reset_render_settings(&gCurrWeatherDisplayList); // Pipesync and some stuff idk yet + func_800682AC(&gCurrWeatherDisplayList); // Looks to create a viewport scissor. } } } diff --git a/src/weather.h b/src/weather.h index 94346d6c..1a75154d 100644 --- a/src/weather.h +++ b/src/weather.h @@ -94,7 +94,7 @@ void handle_rain_sound(s32 updateRate); void render_rain_splashes(s32 updateRate); void handle_rain_lightning(s32 updateRate); void render_rain_overlay(unk800E2C2C*, s32); -void process_weather(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate); +void process_weather(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currHudVerts, TriangleList **currHudTris, s32 updateRate); void render_falling_snow(void); void free_weather_memory(void); void func_800ABC5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); @@ -106,5 +106,6 @@ s32 func_800AC0C8(s32, unk80127BF8 *); void f32_matrix_dot(Matrix *arg0, Matrix *arg1, Matrix *arg2); void func_800AC21C(void); void func_800AC8A8(Object *); +void func_800ACA20(Gfx**, MatrixS**, Vertex**, ObjectSegment*); #endif