diff --git a/asm/non_matchings/audio/func_800015F8.s b/asm/non_matchings/audio/func_800015F8.s index ed4b0ed9..2bf969fb 100644 --- a/asm/non_matchings/audio/func_800015F8.s +++ b/asm/non_matchings/audio/func_800015F8.s @@ -17,7 +17,7 @@ glabel func_800015F8 /* 002210 80001610 3C198011 */ lui $t9, %hi(D_80115D40) # $t9, 0x8011 /* 002214 80001614 0082082B */ sltu $at, $a0, $v0 /* 002218 80001618 10200013 */ beqz $at, .L80001668 -/* 00221C 8000161C 3C098011 */ lui $t1, %hi(D_80115D30) # $t1, 0x8011 +/* 00221C 8000161C 3C098011 */ lui $t1, %hi(sMusicTempo) # $t1, 0x8011 /* 002220 80001620 00447023 */ subu $t6, $v0, $a0 /* 002224 80001624 448E2000 */ mtc1 $t6, $f4 /* 002228 80001628 3C038011 */ lui $v1, %hi(D_80115D34) # $v1, 0x8011 @@ -61,10 +61,10 @@ glabel func_800015F8 /* 0022B0 800016B0 93395D40 */ lbu $t9, %lo(D_80115D40)($t9) /* 0022B4 800016B4 240800B6 */ li $t0, 182 /* 0022B8 800016B8 17200002 */ bnez $t9, .L800016C4 -/* 0022BC 800016BC 3C018011 */ lui $at, %hi(D_80115D30) # $at, 0x8011 -/* 0022C0 800016C0 A4285D30 */ sh $t0, %lo(D_80115D30)($at) +/* 0022BC 800016BC 3C018011 */ lui $at, %hi(sMusicTempo) # $at, 0x8011 +/* 0022C0 800016C0 A4285D30 */ sh $t0, %lo(sMusicTempo)($at) .L800016C4: -/* 0022C4 800016C4 85295D30 */ lh $t1, %lo(D_80115D30)($t1) +/* 0022C4 800016C4 85295D30 */ lh $t1, %lo(sMusicTempo)($t1) /* 0022C8 800016C8 3C01800E */ lui $at, %hi(D_800E49E8) # $at, 0x800e /* 0022CC 800016CC 44893000 */ mtc1 $t1, $f6 /* 0022D0 800016D0 C42A49E8 */ lwc1 $f10, %lo(D_800E49E8)($at) diff --git a/asm/non_matchings/audio/func_80001D04.s b/asm/non_matchings/audio/func_80001D04.s index 0ac3fabe..6a099b68 100644 --- a/asm/non_matchings/audio/func_80001D04.s +++ b/asm/non_matchings/audio/func_80001D04.s @@ -15,8 +15,8 @@ glabel func_80001D04 /* 002938 80001D38 ACA00000 */ sw $zero, ($a1) .L80001D3C: /* 00293C 80001D3C 00044080 */ sll $t0, $a0, 2 -/* 002940 80001D40 3C188011 */ lui $t8, %hi(D_80115D18) # $t8, 0x8011 -/* 002944 80001D44 8F185D18 */ lw $t8, %lo(D_80115D18)($t8) +/* 002940 80001D40 3C188011 */ lui $t8, %hi(sSoundEffectsPool) # $t8, 0x8011 +/* 002944 80001D44 8F185D18 */ lw $t8, %lo(sSoundEffectsPool)($t8) /* 002948 80001D48 01044021 */ addu $t0, $t0, $a0 /* 00294C 80001D4C 00084040 */ sll $t0, $t0, 1 /* 002950 80001D50 03081021 */ addu $v0, $t8, $t0 @@ -60,10 +60,10 @@ glabel func_80001D04 /* 0029E0 80001DE0 8FA7002C */ lw $a3, 0x2c($sp) /* 0029E4 80001DE4 8FA8001C */ lw $t0, 0x1c($sp) /* 0029E8 80001DE8 8CE40000 */ lw $a0, ($a3) -/* 0029EC 80001DEC 3C0B8011 */ lui $t3, %hi(D_80115D18) # $t3, 0x8011 +/* 0029EC 80001DEC 3C0B8011 */ lui $t3, %hi(sSoundEffectsPool) # $t3, 0x8011 /* 0029F0 80001DF0 1080002A */ beqz $a0, .L80001E9C /* 0029F4 80001DF4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0029F8 80001DF8 8D6B5D18 */ lw $t3, %lo(D_80115D18)($t3) +/* 0029F8 80001DF8 8D6B5D18 */ lw $t3, %lo(sSoundEffectsPool)($t3) /* 0029FC 80001DFC 24050008 */ li $a1, 8 /* 002A00 80001E00 01686021 */ addu $t4, $t3, $t0 /* 002A04 80001E04 91860002 */ lbu $a2, 2($t4) @@ -90,8 +90,8 @@ glabel func_80001D04 /* 002A54 80001E54 8F185F80 */ lw $t8, %lo(D_80115F80)($t8) /* 002A58 80001E58 8FA8001C */ lw $t0, 0x1c($sp) /* 002A5C 80001E5C 1300000E */ beqz $t8, .L80001E98 -/* 002A60 80001E60 3C198011 */ lui $t9, %hi(D_80115D18) # $t9, 0x8011 -/* 002A64 80001E64 8F395D18 */ lw $t9, %lo(D_80115D18)($t9) +/* 002A60 80001E60 3C198011 */ lui $t9, %hi(sSoundEffectsPool) # $t9, 0x8011 +/* 002A64 80001E64 8F395D18 */ lw $t9, %lo(sSoundEffectsPool)($t9) /* 002A68 80001E68 03002025 */ move $a0, $t8 /* 002A6C 80001E6C 03284821 */ addu $t1, $t9, $t0 /* 002A70 80001E70 91260002 */ lbu $a2, 2($t1) diff --git a/asm/non_matchings/audio/func_80001FB8.s b/asm/non_matchings/audio/func_80001FB8.s index cbd0872c..37d7b079 100644 --- a/asm/non_matchings/audio/func_80001FB8.s +++ b/asm/non_matchings/audio/func_80001FB8.s @@ -2,8 +2,8 @@ glabel func_80001FB8 /* 002BB8 80001FB8 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 002BBC 80001FBC 308EFFFF */ andi $t6, $a0, 0xffff /* 002BC0 80001FC0 000EC880 */ sll $t9, $t6, 2 -/* 002BC4 80001FC4 3C188011 */ lui $t8, %hi(D_80115D18) # $t8, 0x8011 -/* 002BC8 80001FC8 8F185D18 */ lw $t8, %lo(D_80115D18)($t8) +/* 002BC4 80001FC4 3C188011 */ lui $t8, %hi(sSoundEffectsPool) # $t8, 0x8011 +/* 002BC8 80001FC8 8F185D18 */ lw $t8, %lo(sSoundEffectsPool)($t8) /* 002BCC 80001FCC 032EC821 */ addu $t9, $t9, $t6 /* 002BD0 80001FD0 0019C840 */ sll $t9, $t9, 1 /* 002BD4 80001FD4 AFBF0014 */ sw $ra, 0x14($sp) diff --git a/asm/non_matchings/audio/func_8000232C.s b/asm/non_matchings/audio/func_8000232C.s index 477abdb5..6aff971d 100644 --- a/asm/non_matchings/audio/func_8000232C.s +++ b/asm/non_matchings/audio/func_8000232C.s @@ -49,8 +49,8 @@ glabel func_8000232C /* 002FE8 800023E8 926E0000 */ lbu $t6, ($s3) /* 002FEC 800023EC 24110003 */ li $s1, 3 /* 002FF0 800023F0 01D10019 */ multu $t6, $s1 -/* 002FF4 800023F4 3C108011 */ lui $s0, %hi(D_80115D1C) # $s0, 0x8011 -/* 002FF8 800023F8 26105D1C */ addiu $s0, %lo(D_80115D1C) # addiu $s0, $s0, 0x5d1c +/* 002FF4 800023F4 3C108011 */ lui $s0, %hi(sMusicPool) # $s0, 0x8011 +/* 002FF8 800023F8 26105D1C */ addiu $s0, %lo(sMusicPool) # addiu $s0, $s0, 0x5d1c /* 002FFC 800023FC 8E0D0000 */ lw $t5, ($s0) /* 003000 80002400 00007812 */ mflo $t7 /* 003004 80002404 01AFC021 */ addu $t8, $t5, $t7 @@ -61,7 +61,7 @@ glabel func_8000232C /* 003018 80002418 8E020000 */ lw $v0, ($s0) /* 00301C 8000241C 03310019 */ multu $t9, $s1 /* 003020 80002420 240AFFFF */ li $t2, -1 -/* 003024 80002424 3C018011 */ lui $at, %hi(D_80115D30) # $at, 0x8011 +/* 003024 80002424 3C018011 */ lui $at, %hi(sMusicTempo) # $at, 0x8011 /* 003028 80002428 00004012 */ mflo $t0 /* 00302C 8000242C 00484821 */ addu $t1, $v0, $t0 /* 003030 80002430 91240001 */ lbu $a0, 1($t1) @@ -70,12 +70,12 @@ glabel func_8000232C /* 00303C 8000243C 00000000 */ nop /* 003040 80002440 0C00054D */ jal musicSetTempo /* 003044 80002444 00000000 */ nop -/* 003048 80002448 3C028011 */ lui $v0, %hi(D_80115D1C) # $v0, 0x8011 -/* 00304C 8000244C 8C425D1C */ lw $v0, %lo(D_80115D1C)($v0) +/* 003048 80002448 3C028011 */ lui $v0, %hi(sMusicPool) # $v0, 0x8011 +/* 00304C 8000244C 8C425D1C */ lw $v0, %lo(sMusicPool)($v0) /* 003050 80002450 10000003 */ b .L80002460 /* 003054 80002454 926B0000 */ lbu $t3, ($s3) .L80002458: -/* 003058 80002458 A42A5D30 */ sh $t2, %lo(D_80115D30)($at) +/* 003058 80002458 A42A5D30 */ sh $t2, %lo(sMusicTempo)($at) /* 00305C 8000245C 926B0000 */ lbu $t3, ($s3) .L80002460: /* 003060 80002460 00000000 */ nop @@ -119,8 +119,8 @@ glabel func_8000232C /* 0030E8 800024E8 926B0000 */ lbu $t3, ($s3) /* 0030EC 800024EC 24110003 */ li $s1, 3 /* 0030F0 800024F0 01710019 */ multu $t3, $s1 -/* 0030F4 800024F4 3C108011 */ lui $s0, %hi(D_80115D1C) # $s0, 0x8011 -/* 0030F8 800024F8 26105D1C */ addiu $s0, %lo(D_80115D1C) # addiu $s0, $s0, 0x5d1c +/* 0030F4 800024F4 3C108011 */ lui $s0, %hi(sMusicPool) # $s0, 0x8011 +/* 0030F8 800024F8 26105D1C */ addiu $s0, %lo(sMusicPool) # addiu $s0, $s0, 0x5d1c /* 0030FC 800024FC 8E0A0000 */ lw $t2, ($s0) /* 003100 80002500 00006012 */ mflo $t4 /* 003104 80002504 014C7021 */ addu $t6, $t2, $t4 diff --git a/asm/non_matchings/camera/func_8006A1C4.s b/asm/non_matchings/camera/func_8006A1C4.s index ad2c9a24..783ea0e0 100644 --- a/asm/non_matchings/camera/func_8006A1C4.s +++ b/asm/non_matchings/camera/func_8006A1C4.s @@ -4,20 +4,20 @@ glabel func_8006A1C4 /* 06ADCC 8006A1CC 00809025 */ move $s2, $a0 /* 06ADD0 8006A1D0 AFBF0024 */ sw $ra, 0x24($sp) /* 06ADD4 8006A1D4 AFA5005C */ sw $a1, 0x5c($sp) -/* 06ADD8 8006A1D8 3C048012 */ lui $a0, %hi(D_801210E0) # $a0, 0x8012 +/* 06ADD8 8006A1D8 3C048012 */ lui $a0, %hi(sSIMesgQueue) # $a0, 0x8012 /* 06ADDC 8006A1DC AFB1001C */ sw $s1, 0x1c($sp) /* 06ADE0 8006A1E0 AFB00018 */ sw $s0, 0x18($sp) -/* 06ADE4 8006A1E4 248410E0 */ addiu $a0, %lo(D_801210E0) # addiu $a0, $a0, 0x10e0 +/* 06ADE4 8006A1E4 248410E0 */ addiu $a0, %lo(sSIMesgQueue) # addiu $a0, $a0, 0x10e0 /* 06ADE8 8006A1E8 27A50050 */ addiu $a1, $sp, 0x50 /* 06ADEC 8006A1EC 0C0322EC */ jal osRecvMesg /* 06ADF0 8006A1F0 00003025 */ move $a2, $zero /* 06ADF4 8006A1F4 1440005D */ bnez $v0, .L8006A36C -/* 06ADF8 8006A1F8 3C068012 */ lui $a2, %hi(D_80121110+24) # $a2, 0x8012 -/* 06ADFC 8006A1FC 3C028012 */ lui $v0, %hi(D_80121110) # $v0, 0x8012 -/* 06AE00 8006A200 3C038012 */ lui $v1, %hi(D_80121110+24) # $v1, 0x8012 -/* 06AE04 8006A204 24631128 */ addiu $v1, %lo(D_80121110+24) # addiu $v1, $v1, 0x1128 -/* 06AE08 8006A208 24421110 */ addiu $v0, %lo(D_80121110) # addiu $v0, $v0, 0x1110 -/* 06AE0C 8006A20C 24C61128 */ addiu $a2, %lo(D_80121110+24) # addiu $a2, $a2, 0x1128 +/* 06ADF8 8006A1F8 3C068012 */ lui $a2, %hi(sControllerData+24) # $a2, 0x8012 +/* 06ADFC 8006A1FC 3C028012 */ lui $v0, %hi(sControllerData) # $v0, 0x8012 +/* 06AE00 8006A200 3C038012 */ lui $v1, %hi(sControllerData+24) # $v1, 0x8012 +/* 06AE04 8006A204 24631128 */ addiu $v1, %lo(sControllerData+24) # addiu $v1, $v1, 0x1128 +/* 06AE08 8006A208 24421110 */ addiu $v0, %lo(sControllerData) # addiu $v0, $v0, 0x1110 +/* 06AE0C 8006A20C 24C61128 */ addiu $a2, %lo(sControllerData+24) # addiu $a2, $a2, 0x1128 .L8006A210: /* 06AE10 8006A210 88410000 */ lwl $at, ($v0) /* 06AE14 8006A214 98410003 */ lwr $at, 3($v0) @@ -30,9 +30,9 @@ glabel func_8006A1C4 /* 06AE30 8006A230 0043082B */ sltu $at, $v0, $v1 /* 06AE34 8006A234 1420FFF6 */ bnez $at, .L8006A210 /* 06AE38 8006A238 00000000 */ nop -/* 06AE3C 8006A23C 3C048012 */ lui $a0, %hi(D_80121110) # $a0, 0x8012 +/* 06AE3C 8006A23C 3C048012 */ lui $a0, %hi(sControllerData) # $a0, 0x8012 /* 06AE40 8006A240 0C033429 */ jal osContGetReadData -/* 06AE44 8006A244 24841110 */ addiu $a0, %lo(D_80121110) # addiu $a0, $a0, 0x1110 +/* 06AE44 8006A244 24841110 */ addiu $a0, %lo(sControllerData) # addiu $a0, $a0, 0x1110 /* 06AE48 8006A248 12400043 */ beqz $s2, .L8006A358 /* 06AE4C 8006A24C 8FA4005C */ lw $a0, 0x5c($sp) /* 06AE50 8006A250 0C01BAA4 */ jal get_settings @@ -113,24 +113,24 @@ glabel func_8006A1C4 .L8006A358: /* 06AF58 8006A358 0C01C9C6 */ jal func_80072718 /* 06AF5C 8006A35C 00000000 */ nop -/* 06AF60 8006A360 3C048012 */ lui $a0, %hi(D_801210E0) # $a0, 0x8012 +/* 06AF60 8006A360 3C048012 */ lui $a0, %hi(sSIMesgQueue) # $a0, 0x8012 /* 06AF64 8006A364 0C0333F8 */ jal osContStartReadData -/* 06AF68 8006A368 248410E0 */ addiu $a0, %lo(D_801210E0) # addiu $a0, $a0, 0x10e0 +/* 06AF68 8006A368 248410E0 */ addiu $a0, %lo(sSIMesgQueue) # addiu $a0, $a0, 0x10e0 .L8006A36C: /* 06AF6C 8006A36C 3C0A800E */ lui $t2, %hi(D_800DD300) # $t2, 0x800e /* 06AF70 8006A370 3C09800E */ lui $t1, %hi(gButtonMask) # $t1, 0x800e -/* 06AF74 8006A374 3C068012 */ lui $a2, %hi(D_80121110+24) # $a2, 0x8012 -/* 06AF78 8006A378 3C028012 */ lui $v0, %hi(D_80121110) # $v0, 0x8012 -/* 06AF7C 8006A37C 3C088012 */ lui $t0, %hi(D_80121140) # $t0, 0x8012 +/* 06AF74 8006A374 3C068012 */ lui $a2, %hi(sControllerData+24) # $a2, 0x8012 +/* 06AF78 8006A378 3C028012 */ lui $v0, %hi(sControllerData) # $v0, 0x8012 +/* 06AF7C 8006A37C 3C088012 */ lui $t0, %hi(sControllerButtonsPressed) # $t0, 0x8012 /* 06AF80 8006A380 3C078012 */ lui $a3, %hi(D_80121148) # $a3, 0x8012 -/* 06AF84 8006A384 3C0B8012 */ lui $t3, %hi(D_80121150) # $t3, 0x8012 +/* 06AF84 8006A384 3C0B8012 */ lui $t3, %hi(sPlayerID) # $t3, 0x8012 /* 06AF88 8006A388 9529D304 */ lhu $t1, %lo(gButtonMask)($t1) /* 06AF8C 8006A38C 8D4AD300 */ lw $t2, %lo(D_800DD300)($t2) -/* 06AF90 8006A390 256B1150 */ addiu $t3, %lo(D_80121150) # addiu $t3, $t3, 0x1150 +/* 06AF90 8006A390 256B1150 */ addiu $t3, %lo(sPlayerID) # addiu $t3, $t3, 0x1150 /* 06AF94 8006A394 24E71148 */ addiu $a3, %lo(D_80121148) # addiu $a3, $a3, 0x1148 -/* 06AF98 8006A398 25081140 */ addiu $t0, %lo(D_80121140) # addiu $t0, $t0, 0x1140 -/* 06AF9C 8006A39C 24421110 */ addiu $v0, %lo(D_80121110) # addiu $v0, $v0, 0x1110 -/* 06AFA0 8006A3A0 24C61128 */ addiu $a2, %lo(D_80121110+24) # addiu $a2, $a2, 0x1128 +/* 06AF98 8006A398 25081140 */ addiu $t0, %lo(sControllerButtonsPressed) # addiu $t0, $t0, 0x1140 +/* 06AF9C 8006A39C 24421110 */ addiu $v0, %lo(sControllerData) # addiu $v0, $v0, 0x1110 +/* 06AFA0 8006A3A0 24C61128 */ addiu $a2, %lo(sControllerData+24) # addiu $a2, $a2, 0x1128 .L8006A3A4: /* 06AFA4 8006A3A4 11400002 */ beqz $t2, .L8006A3B0 /* 06AFA8 8006A3A8 00000000 */ nop diff --git a/asm/non_matchings/fade_transition/render_fade_circle.s b/asm/non_matchings/fade_transition/render_fade_circle.s index e6aa5031..f6b315c5 100644 --- a/asm/non_matchings/fade_transition/render_fade_circle.s +++ b/asm/non_matchings/fade_transition/render_fade_circle.s @@ -16,9 +16,9 @@ glabel render_fade_circle /* 0C2EAC 800C22AC 8CE731C0 */ lw $a3, %lo(sTransitionVtx)($a3) /* 0C2EB0 800C22B0 010F4021 */ addu $t0, $t0, $t7 /* 0C2EB4 800C22B4 8D0831C8 */ lw $t0, %lo(sTransitionTris)($t0) -/* 0C2EB8 800C22B8 3C19800E */ lui $t9, %hi(dl_transition_shape_settings) # $t9, 0x800e +/* 0C2EB8 800C22B8 3C19800E */ lui $t9, %hi(dTransitionShapeSettings) # $t9, 0x800e /* 0C2EBC 800C22BC 00402025 */ move $a0, $v0 -/* 0C2EC0 800C22C0 27393648 */ addiu $t9, %lo(dl_transition_shape_settings) # addiu $t9, $t9, 0x3648 +/* 0C2EC0 800C22C0 27393648 */ addiu $t9, %lo(dTransitionShapeSettings) # addiu $t9, $t9, 0x3648 /* 0C2EC4 800C22C4 3C180600 */ lui $t8, 0x600 /* 0C2EC8 800C22C8 AC980000 */ sw $t8, ($a0) /* 0C2ECC 800C22CC AC990004 */ sw $t9, 4($a0) diff --git a/asm/non_matchings/fade_transition/render_fade_waves.s b/asm/non_matchings/fade_transition/render_fade_waves.s index 36108975..df403f20 100644 --- a/asm/non_matchings/fade_transition/render_fade_waves.s +++ b/asm/non_matchings/fade_transition/render_fade_waves.s @@ -18,8 +18,8 @@ glabel render_fade_waves /* 0C3038 800C2438 00402025 */ move $a0, $v0 /* 0C303C 800C243C 8CC631C0 */ lw $a2, %lo(sTransitionVtx)($a2) /* 0C3040 800C2440 8CE731C8 */ lw $a3, %lo(sTransitionTris)($a3) -/* 0C3044 800C2444 3C19800E */ lui $t9, %hi(dl_transition_shape_settings) # $t9, 0x800e -/* 0C3048 800C2448 27393648 */ addiu $t9, %lo(dl_transition_shape_settings) # addiu $t9, $t9, 0x3648 +/* 0C3044 800C2444 3C19800E */ lui $t9, %hi(dTransitionShapeSettings) # $t9, 0x800e +/* 0C3048 800C2448 27393648 */ addiu $t9, %lo(dTransitionShapeSettings) # addiu $t9, $t9, 0x3648 /* 0C304C 800C244C 3C180600 */ lui $t8, 0x600 /* 0C3050 800C2450 3C1005D0 */ lui $s0, (0x05D000E0 >> 16) # lui $s0, 0x5d0 /* 0C3054 800C2454 3C0D05B0 */ lui $t5, (0x05B000C0 >> 16) # lui $t5, 0x5b0 diff --git a/asm/non_matchings/font/func_800C45A4.s b/asm/non_matchings/font/func_800C45A4.s index 8eb0eed2..8cbbc986 100644 --- a/asm/non_matchings/font/func_800C45A4.s +++ b/asm/non_matchings/font/func_800C45A4.s @@ -29,8 +29,8 @@ glabel func_800C45A4 /* 0C51FC 800C45FC 03195821 */ addu $t3, $t8, $t9 /* 0C5200 800C4600 246E0008 */ addiu $t6, $v1, 8 /* 0C5204 800C4604 AC8E0000 */ sw $t6, ($a0) -/* 0C5208 800C4608 3C18800E */ lui $t8, %hi(dl_dialogue_box_begin) # $t8, 0x800e -/* 0C520C 800C460C 27183690 */ addiu $t8, %lo(dl_dialogue_box_begin) # addiu $t8, $t8, 0x3690 +/* 0C5208 800C4608 3C18800E */ lui $t8, %hi(dDialogueBoxBegin) # $t8, 0x800e +/* 0C520C 800C460C 27183690 */ addiu $t8, %lo(dDialogueBoxBegin) # addiu $t8, $t8, 0x3690 /* 0C5210 800C4610 3C0F0600 */ lui $t7, 0x600 /* 0C5214 800C4614 3C198013 */ lui $t9, %hi(gDialogueBoxBackground) # $t9, 0x8013 /* 0C5218 800C4618 AC6F0000 */ sw $t7, ($v1) @@ -201,9 +201,9 @@ glabel func_800C45A4 /* 0C5494 800C4894 24790008 */ addiu $t9, $v1, 8 /* 0C5498 800C4898 AE390000 */ sw $t9, ($s1) /* 0C549C 800C489C 3C180702 */ lui $t8, (0x07020010 >> 16) # lui $t8, 0x702 - # dl_dialogue_box_begin - 0x7FFFFFB8 = 0xE36D8 -/* 0C54A0 800C48A0 3C0E000E */ lui $t6, %hi(dl_dialogue_box_begin - 0x7FFFFFB8) # $t6, 0xe -/* 0C54A4 800C48A4 25CE36D8 */ addiu $t6, %lo(dl_dialogue_box_begin - 0x7FFFFFB8) # addiu $t6, $t6, 0x36d8 + # dDialogueBoxBegin - 0x7FFFFFB8 = 0xE36D8 +/* 0C54A0 800C48A0 3C0E000E */ lui $t6, %hi(dDialogueBoxBegin - 0x7FFFFFB8) # $t6, 0xe +/* 0C54A4 800C48A4 25CE36D8 */ addiu $t6, %lo(dDialogueBoxBegin - 0x7FFFFFB8) # addiu $t6, $t6, 0x36d8 /* 0C54A8 800C48A8 37180010 */ ori $t8, (0x07020010 & 0xFFFF) # ori $t8, $t8, 0x10 /* 0C54AC 800C48AC AC780000 */ sw $t8, ($v1) /* 0C54B0 800C48B0 AC6E0004 */ sw $t6, 4($v1) @@ -272,14 +272,14 @@ glabel func_800C45A4 /* 0C55A8 800C49A8 032FC025 */ or $t8, $t9, $t7 /* 0C55AC 800C49AC AC780004 */ sw $t8, 4($v1) /* 0C55B0 800C49B0 8E230000 */ lw $v1, ($s1) - # dl_dialogue_box_begin - 0x7FFFFFC8 = 0xE36C8 -/* 0C55B4 800C49B4 3C0F000E */ lui $t7, %hi(dl_dialogue_box_begin - 0x7FFFFFC8) # $t7, 0xe + # dDialogueBoxBegin - 0x7FFFFFC8 = 0xE36C8 +/* 0C55B4 800C49B4 3C0F000E */ lui $t7, %hi(dDialogueBoxBegin - 0x7FFFFFC8) # $t7, 0xe /* 0C55B8 800C49B8 246E0008 */ addiu $t6, $v1, 8 /* 0C55BC 800C49BC AE2E0000 */ sw $t6, ($s1) /* 0C55C0 800C49C0 3C190702 */ lui $t9, (0x07020010 >> 16) # lui $t9, 0x702 /* 0C55C4 800C49C4 37390010 */ ori $t9, (0x07020010 & 0xFFFF) # ori $t9, $t9, 0x10 - # dl_dialogue_box_begin - 0x7FFFFFC8 = 0xE36C8 -/* 0C55C8 800C49C8 25EF36C8 */ addiu $t7, %lo(dl_dialogue_box_begin - 0x7FFFFFC8) # addiu $t7, $t7, 0x36c8 + # dDialogueBoxBegin - 0x7FFFFFC8 = 0xE36C8 +/* 0C55C8 800C49C8 25EF36C8 */ addiu $t7, %lo(dDialogueBoxBegin - 0x7FFFFFC8) # addiu $t7, $t7, 0x36c8 /* 0C55CC 800C49CC AC6F0004 */ sw $t7, 4($v1) /* 0C55D0 800C49D0 AC790000 */ sw $t9, ($v1) /* 0C55D4 800C49D4 8E230000 */ lw $v1, ($s1) diff --git a/asm/non_matchings/menu/func_8008B4C8.s b/asm/non_matchings/menu/func_8008B4C8.s index 65e33abc..5b79d560 100644 --- a/asm/non_matchings/menu/func_8008B4C8.s +++ b/asm/non_matchings/menu/func_8008B4C8.s @@ -103,7 +103,7 @@ glabel func_8008B4C8 /* 08C244 8008B644 164C0039 */ bne $s2, $t4, .L8008B72C /* 08C248 8008B648 8FBF003C */ lw $ra, 0x3c($sp) .L8008B64C: -/* 08C24C 8008B64C 0C000326 */ jal func_80000C98 +/* 08C24C 8008B64C 0C000326 */ jal set_music_fade_timer /* 08C250 8008B650 2404FF80 */ li $a0, -128 /* 08C254 8008B654 10000035 */ b .L8008B72C /* 08C258 8008B658 8FBF003C */ lw $ra, 0x3c($sp) diff --git a/asm/non_matchings/menu/func_80093A40.s b/asm/non_matchings/menu/func_80093A40.s index fffeab85..ca61007a 100644 --- a/asm/non_matchings/menu/func_80093A40.s +++ b/asm/non_matchings/menu/func_80093A40.s @@ -12,7 +12,7 @@ glabel func_80093A40 /* 094668 80093A68 240EFFFF */ li $t6, -1 /* 09466C 80093A6C AFA20024 */ sw $v0, 0x24($sp) /* 094670 80093A70 AE2E0000 */ sw $t6, ($s1) -/* 094674 80093A74 0C0270F6 */ jal func_8009C3D8 +/* 094674 80093A74 0C0270F6 */ jal get_active_player_count /* 094678 80093A78 00008025 */ move $s0, $zero /* 09467C 80093A7C 18400014 */ blez $v0, .L80093AD0 /* 094680 80093A80 00000000 */ nop @@ -28,7 +28,7 @@ glabel func_80093A40 /* 0946A4 80093AA4 00000000 */ nop /* 0946A8 80093AA8 AE300000 */ sw $s0, ($s1) .L80093AAC: -/* 0946AC 80093AAC 0C0270F6 */ jal func_8009C3D8 +/* 0946AC 80093AAC 0C0270F6 */ jal get_active_player_count /* 0946B0 80093AB0 26100001 */ addiu $s0, $s0, 1 /* 0946B4 80093AB4 0202082A */ slt $at, $s0, $v0 /* 0946B8 80093AB8 10200005 */ beqz $at, .L80093AD0 diff --git a/asm/non_matchings/menu/func_80093D40.s b/asm/non_matchings/menu/func_80093D40.s index 17df5444..16656e75 100644 --- a/asm/non_matchings/menu/func_80093D40.s +++ b/asm/non_matchings/menu/func_80093D40.s @@ -63,7 +63,7 @@ glabel func_80093D40 /* 094A20 80093E20 3C11800E */ lui $s1, %hi(D_800E098C) # $s1, 0x800e /* 094A24 80093E24 2631098C */ addiu $s1, %lo(D_800E098C) # addiu $s1, $s1, 0x98c /* 094A28 80093E28 8E240000 */ lw $a0, ($s1) -/* 094A2C 80093E2C 0C01A93E */ jal func_8006A4F8 +/* 094A2C 80093E2C 0C01A93E */ jal get_player_id /* 094A30 80093E30 00000000 */ nop /* 094A34 80093E34 3C09800E */ lui $t1, %hi(D_800E0990) # $t1, 0x800e /* 094A38 80093E38 25290990 */ addiu $t1, %lo(D_800E0990) # addiu $t1, $t1, 0x990 @@ -86,7 +86,7 @@ glabel func_80093D40 /* 094A7C 80093E7C 0C031414 */ jal set_current_text_background_colour /* 094A80 80093E80 AFA00010 */ sw $zero, 0x10($sp) /* 094A84 80093E84 8E240000 */ lw $a0, ($s1) -/* 094A88 80093E88 0C01A93E */ jal func_8006A4F8 +/* 094A88 80093E88 0C01A93E */ jal get_player_id /* 094A8C 80093E8C 00000000 */ nop /* 094A90 80093E90 3C0C800E */ lui $t4, %hi(D_800E09A0) # $t4, 0x800e /* 094A94 80093E94 258C09A0 */ addiu $t4, %lo(D_800E09A0) # addiu $t4, $t4, 0x9a0 diff --git a/asm/non_matchings/menu/func_80095728.s b/asm/non_matchings/menu/func_80095728.s index b1077db4..845aa1a6 100644 --- a/asm/non_matchings/menu/func_80095728.s +++ b/asm/non_matchings/menu/func_80095728.s @@ -292,7 +292,7 @@ glabel L80095B34 /* 09674C 80095B4C 8FA7002C */ lw $a3, 0x2c($sp) /* 096750 80095B50 1180000A */ beqz $t4, .L80095B7C /* 096754 80095B54 00000000 */ nop -/* 096758 80095B58 0C000326 */ jal func_80000C98 +/* 096758 80095B58 0C000326 */ jal set_music_fade_timer /* 09675C 80095B5C 2404FF80 */ li $a0, -128 /* 096760 80095B60 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 096764 80095B64 0C030076 */ jal func_800C01D8 @@ -626,7 +626,7 @@ glabel L80095EC8 /* 096C38 80096038 24190001 */ li $t9, 1 /* 096C3C 8009603C 24180001 */ li $t8, 1 /* 096C40 80096040 AFB80050 */ sw $t8, 0x50($sp) -/* 096C44 80096044 0C000326 */ jal func_80000C98 +/* 096C44 80096044 0C000326 */ jal set_music_fade_timer /* 096C48 80096048 2404FF80 */ li $a0, -128 /* 096C4C 8009604C 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 096C50 80096050 0C030076 */ jal func_800C01D8 @@ -784,7 +784,7 @@ glabel L80095EC8 /* 096E64 80096264 1000007B */ b .L80096454 /* 096E68 80096268 AD060000 */ sw $a2, ($t0) .L8009626C: -/* 096E6C 8009626C 0C000326 */ jal func_80000C98 +/* 096E6C 8009626C 0C000326 */ jal set_music_fade_timer /* 096E70 80096270 2404FF80 */ li $a0, -128 /* 096E74 80096274 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 096E78 80096278 0C030076 */ jal func_800C01D8 @@ -950,7 +950,7 @@ glabel L800964AC /* 0970AC 800964AC 306F9000 */ andi $t7, $v1, 0x9000 /* 0970B0 800964B0 11E00098 */ beqz $t7, .L80096714 /* 0970B4 800964B4 00000000 */ nop -/* 0970B8 800964B8 0C000326 */ jal func_80000C98 +/* 0970B8 800964B8 0C000326 */ jal set_music_fade_timer /* 0970BC 800964BC 2404FF80 */ li $a0, -128 /* 0970C0 800964C0 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 0970C4 800964C4 0C030076 */ jal func_800C01D8 diff --git a/asm/non_matchings/menu/func_80097D10.s b/asm/non_matchings/menu/func_80097D10.s index 43b6f020..38acf168 100644 --- a/asm/non_matchings/menu/func_80097D10.s +++ b/asm/non_matchings/menu/func_80097D10.s @@ -12,7 +12,7 @@ glabel func_80097D10 /* 098924 80097D24 0C01A955 */ jal get_buttons_pressed_from_player /* 098928 80097D28 00002025 */ move $a0, $zero /* 09892C 80097D2C 00002025 */ move $a0, $zero -/* 098930 80097D30 0C01A967 */ jal func_8006A59C +/* 098930 80097D30 0C01A967 */ jal clamp_joystick_x_axis /* 098934 80097D34 AFA20024 */ sw $v0, 0x24($sp) /* 098938 80097D38 8FA80024 */ lw $t0, 0x24($sp) /* 09893C 80097D3C 2841FFDE */ slti $at, $v0, -0x22 diff --git a/asm/non_matchings/menu/menu_audio_options_loop.s b/asm/non_matchings/menu/menu_audio_options_loop.s index ebae621d..6b7a728b 100644 --- a/asm/non_matchings/menu/menu_audio_options_loop.s +++ b/asm/non_matchings/menu/menu_audio_options_loop.s @@ -60,7 +60,7 @@ glabel menu_audio_options_loop /* 08594C 80084D4C 8FAD0040 */ lw $t5, 0x40($sp) /* 085950 80084D50 02002025 */ move $a0, $s0 /* 085954 80084D54 01A27025 */ or $t6, $t5, $v0 -/* 085958 80084D58 0C01A967 */ jal func_8006A59C +/* 085958 80084D58 0C01A967 */ jal clamp_joystick_x_axis /* 08595C 80084D5C AFAE0040 */ sw $t6, 0x40($sp) /* 085960 80084D60 8FA30028 */ lw $v1, 0x28($sp) /* 085964 80084D64 8FA50024 */ lw $a1, 0x24($sp) @@ -122,7 +122,7 @@ glabel menu_audio_options_loop /* 085A30 80084E30 00000000 */ nop /* 085A34 80084E34 07200004 */ bltz $t9, .L80084E48 /* 085A38 80084E38 240A0003 */ li $t2, 3 -/* 085A3C 80084E3C 0C000326 */ jal func_80000C98 +/* 085A3C 80084E3C 0C000326 */ jal set_music_fade_timer /* 085A40 80084E40 2404FF80 */ li $a0, -128 /* 085A44 80084E44 240A0003 */ li $t2, 3 .L80084E48: diff --git a/asm/non_matchings/menu/menu_character_select_loop.s b/asm/non_matchings/menu/menu_character_select_loop.s index 9b9cfdd5..23dd58e1 100644 --- a/asm/non_matchings/menu/menu_character_select_loop.s +++ b/asm/non_matchings/menu/menu_character_select_loop.s @@ -117,7 +117,7 @@ glabel menu_character_select_loop /* 08CAD4 8008BED4 0C022ECF */ jal randomize_ai_racer_slots /* 08CAD8 8008BED8 AFAB0024 */ sw $t3, 0x24($sp) /* 08CADC 8008BEDC 3C048012 */ lui $a0, %hi(gActivePlayersArray) # $a0, 0x8012 -/* 08CAE0 8008BEE0 0C01A916 */ jal func_8006A458 +/* 08CAE0 8008BEE0 0C01A916 */ jal assign_player_ids /* 08CAE4 8008BEE4 248463D4 */ addiu $a0, %lo(gActivePlayersArray) # addiu $a0, $a0, 0x63d4 /* 08CAE8 8008BEE8 3C0C800E */ lui $t4, %hi(gNumberOfActivePlayers) # $t4, 0x800e /* 08CAEC 8008BEEC 8FAB0024 */ lw $t3, 0x24($sp) diff --git a/asm/non_matchings/menu/menu_credits_loop.s b/asm/non_matchings/menu/menu_credits_loop.s index 5988707a..2018fadb 100644 --- a/asm/non_matchings/menu/menu_credits_loop.s +++ b/asm/non_matchings/menu/menu_credits_loop.s @@ -639,7 +639,7 @@ glabel L8009BB9C /* 09C83C 8009BC3C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c /* 09C840 8009BC40 0C03005C */ jal func_800C0170 /* 09C844 8009BC44 00000000 */ nop -/* 09C848 8009BC48 0C000326 */ jal func_80000C98 +/* 09C848 8009BC48 0C000326 */ jal set_music_fade_timer /* 09C84C 8009BC4C 2404FF80 */ li $a0, -128 .L8009BC50: /* 09C850 8009BC50 3C02800E */ lui $v0, %hi(gMenuDelay) # $v0, 0x800e diff --git a/asm/non_matchings/menu/menu_file_select_loop.s b/asm/non_matchings/menu/menu_file_select_loop.s index 595791cb..b2853807 100644 --- a/asm/non_matchings/menu/menu_file_select_loop.s +++ b/asm/non_matchings/menu/menu_file_select_loop.s @@ -197,7 +197,7 @@ glabel menu_file_select_loop /* 08ED4C 8008E14C 8C84F4CC */ lw $a0, %lo(gSaveFileIndex)($a0) /* 08ED50 8008E150 0C01BADE */ jal func_8006EB78 /* 08ED54 8008E154 00000000 */ nop -/* 08ED58 8008E158 0C000326 */ jal func_80000C98 +/* 08ED58 8008E158 0C000326 */ jal set_music_fade_timer /* 08ED5C 8008E15C 2404FF80 */ li $a0, -128 /* 08ED60 8008E160 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 08ED64 8008E164 0C030076 */ jal func_800C01D8 @@ -231,7 +231,7 @@ glabel menu_file_select_loop /* 08EDD0 8008E1D0 8C84F4CC */ lw $a0, %lo(gSaveFileIndex)($a0) /* 08EDD4 8008E1D4 0C01BADE */ jal func_8006EB78 /* 08EDD8 8008E1D8 00000000 */ nop -/* 08EDDC 8008E1DC 0C000326 */ jal func_80000C98 +/* 08EDDC 8008E1DC 0C000326 */ jal set_music_fade_timer /* 08EDE0 8008E1E0 2404FF80 */ li $a0, -128 /* 08EDE4 8008E1E4 10000021 */ b .L8008E26C /* 08EDE8 8008E1E8 8FB80040 */ lw $t8, 0x40($sp) diff --git a/asm/non_matchings/menu/menu_game_select_loop.s b/asm/non_matchings/menu/menu_game_select_loop.s index 1e8143e3..e0f6e3d7 100644 --- a/asm/non_matchings/menu/menu_game_select_loop.s +++ b/asm/non_matchings/menu/menu_game_select_loop.s @@ -151,7 +151,7 @@ glabel menu_game_select_loop /* 08D5E8 8008C9E8 00000000 */ nop /* 08D5EC 8008C9EC 152A0003 */ bne $t1, $t2, .L8008C9FC /* 08D5F0 8008C9F0 00000000 */ nop -/* 08D5F4 8008C9F4 0C000326 */ jal func_80000C98 +/* 08D5F4 8008C9F4 0C000326 */ jal set_music_fade_timer /* 08D5F8 8008C9F8 2404FF80 */ li $a0, -128 .L8008C9FC: /* 08D5FC 8008C9FC 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e diff --git a/asm/non_matchings/menu/menu_options_loop.s b/asm/non_matchings/menu/menu_options_loop.s index 540584d8..5eed90fb 100644 --- a/asm/non_matchings/menu/menu_options_loop.s +++ b/asm/non_matchings/menu/menu_options_loop.s @@ -82,7 +82,7 @@ glabel menu_options_loop /* 085088 80084488 17010011 */ bne $t8, $at, .L800844D0 /* 08508C 8008448C 00000000 */ nop .L80084490: -/* 085090 80084490 0C000326 */ jal func_80000C98 +/* 085090 80084490 0C000326 */ jal set_music_fade_timer /* 085094 80084494 2404FF80 */ li $a0, -128 /* 085098 80084498 2419FFFF */ li $t9, -1 /* 08509C 8008449C 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e diff --git a/asm/non_matchings/menu/menu_results_loop.s b/asm/non_matchings/menu/menu_results_loop.s index 1ea8a9c9..82e160f4 100644 --- a/asm/non_matchings/menu/menu_results_loop.s +++ b/asm/non_matchings/menu/menu_results_loop.s @@ -113,7 +113,7 @@ glabel menu_results_loop /* 098050 80097450 1502000B */ bne $t0, $v0, .L80097480 /* 098054 80097454 240B0001 */ li $t3, 1 /* 098058 80097458 AFA80020 */ sw $t0, 0x20($sp) -/* 09805C 8009745C 0C000326 */ jal func_80000C98 +/* 09805C 8009745C 0C000326 */ jal set_music_fade_timer /* 098060 80097460 2404FF80 */ li $a0, -128 /* 098064 80097464 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 098068 80097468 0C030076 */ jal func_800C01D8 @@ -181,7 +181,7 @@ glabel menu_results_loop /* 098144 80097544 AD280000 */ sw $t0, ($t1) /* 098148 80097548 0C030076 */ jal func_800C01D8 /* 09814C 8009754C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c -/* 098150 80097550 0C000326 */ jal func_80000C98 +/* 098150 80097550 0C000326 */ jal set_music_fade_timer /* 098154 80097554 2404FF80 */ li $a0, -128 /* 098158 80097558 10000019 */ b .L800975C0 /* 09815C 8009755C 8FAC0024 */ lw $t4, 0x24($sp) diff --git a/asm/non_matchings/menu/menu_title_screen_loop.s b/asm/non_matchings/menu/menu_title_screen_loop.s index efcf00fc..ccb31e16 100644 --- a/asm/non_matchings/menu/menu_title_screen_loop.s +++ b/asm/non_matchings/menu/menu_title_screen_loop.s @@ -94,7 +94,7 @@ glabel menu_title_screen_loop /* 084724 80083B24 29E1003C */ slti $at, $t7, 0x3c /* 084728 80083B28 1420000B */ bnez $at, .L80083B58 /* 08472C 80083B2C 2404FD00 */ li $a0, -768 -/* 084730 80083B30 0C000326 */ jal func_80000C98 +/* 084730 80083B30 0C000326 */ jal set_music_fade_timer /* 084734 80083B34 AFA00028 */ sw $zero, 0x28($sp) /* 084738 80083B38 3C04800E */ lui $a0, %hi(D_800E1E08) # $a0, 0x800e /* 08473C 80083B3C 0C030076 */ jal func_800C01D8 diff --git a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s index 1d84ba78..2c09bef4 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s @@ -307,7 +307,7 @@ glabel menu_trophy_race_rankings_init /* 099A68 80098E68 24040018 */ li $a0, 24 /* 099A6C 80098E6C 0C0002CD */ jal play_music /* 099A70 80098E70 24040018 */ li $a0, 24 -/* 099A74 80098E74 0C000326 */ jal func_80000C98 +/* 099A74 80098E74 0C000326 */ jal set_music_fade_timer /* 099A78 80098E78 24040100 */ li $a0, 256 /* 099A7C 80098E7C 0C0261DD */ jal func_80098774 /* 099A80 80098E80 00002025 */ move $a0, $zero diff --git a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s index 6c6bf361..c59d92ba 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s @@ -197,7 +197,7 @@ glabel menu_trophy_race_rankings_loop /* 099EA4 800992A4 2404FF80 */ li $a0, -128 /* 099EA8 800992A8 00002825 */ move $a1, $zero /* 099EAC 800992AC AFA0004C */ sw $zero, 0x4c($sp) -/* 099EB0 800992B0 0C000326 */ jal func_80000C98 +/* 099EB0 800992B0 0C000326 */ jal set_music_fade_timer /* 099EB4 800992B4 AFAB002C */ sw $t3, 0x2c($sp) /* 099EB8 800992B8 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e /* 099EBC 800992BC 0C030076 */ jal func_800C01D8 diff --git a/asm/non_matchings/menu/menu_trophy_race_round_init.s b/asm/non_matchings/menu/menu_trophy_race_round_init.s index 32c69bbe..ab6cfb8d 100644 --- a/asm/non_matchings/menu/menu_trophy_race_round_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_init.s @@ -81,7 +81,7 @@ glabel menu_trophy_race_round_init /* 098F90 80098390 24040018 */ li $a0, 24 /* 098F94 80098394 0C0002CD */ jal play_music /* 098F98 80098398 24040018 */ li $a0, 24 -/* 098F9C 8009839C 0C000326 */ jal func_80000C98 +/* 098F9C 8009839C 0C000326 */ jal set_music_fade_timer /* 098FA0 800983A0 24040100 */ li $a0, 256 /* 098FA4 800983A4 8FBF0024 */ lw $ra, 0x24($sp) /* 098FA8 800983A8 8FB00014 */ lw $s0, 0x14($sp) diff --git a/asm/non_matchings/menu/menu_trophy_race_round_loop.s b/asm/non_matchings/menu/menu_trophy_race_round_loop.s index 04121dea..3f64a0b6 100644 --- a/asm/non_matchings/menu/menu_trophy_race_round_loop.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_loop.s @@ -77,7 +77,7 @@ glabel menu_trophy_race_round_loop /* 0992B8 800986B8 24090001 */ li $t1, 1 /* 0992BC 800986BC 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 0992C0 800986C0 AC29F47C */ sw $t1, %lo(gMenuDelay)($at) -/* 0992C4 800986C4 0C000326 */ jal func_80000C98 +/* 0992C4 800986C4 0C000326 */ jal set_music_fade_timer /* 0992C8 800986C8 2404FF80 */ li $a0, -128 .L800986CC: /* 0992CC 800986CC 3C03800E */ lui $v1, %hi(gMenuDelay) # $v1, 0x800e diff --git a/asm/non_matchings/menu/update_controller_sticks.s b/asm/non_matchings/menu/update_controller_sticks.s index 02141f2e..15ba3922 100644 --- a/asm/non_matchings/menu/update_controller_sticks.s +++ b/asm/non_matchings/menu/update_controller_sticks.s @@ -25,10 +25,10 @@ glabel update_controller_sticks /* 09CB7C 8009BF7C 0000A825 */ move $s5, $zero /* 09CB80 8009BF80 241EFFFF */ li $fp, -1 .L8009BF84: -/* 09CB84 8009BF84 0C01A967 */ jal func_8006A59C +/* 09CB84 8009BF84 0C01A967 */ jal clamp_joystick_x_axis /* 09CB88 8009BF88 02A02025 */ move $a0, $s5 /* 09CB8C 8009BF8C 0040A025 */ move $s4, $v0 -/* 09CB90 8009BF90 0C01A978 */ jal func_8006A5E0 +/* 09CB90 8009BF90 0C01A978 */ jal clamp_joystick_y_axis /* 09CB94 8009BF94 02A02025 */ move $a0, $s5 /* 09CB98 8009BF98 2A81FFDD */ slti $at, $s4, -0x23 /* 09CB9C 8009BF9C A2C00000 */ sb $zero, ($s6) diff --git a/asm/non_matchings/printf/print_debug_strings.s b/asm/non_matchings/printf/print_debug_strings.s index f37cd358..f6bdd1fc 100644 --- a/asm/non_matchings/printf/print_debug_strings.s +++ b/asm/non_matchings/printf/print_debug_strings.s @@ -69,10 +69,10 @@ glabel print_debug_strings /* 0B6C7C 800B607C 0C02DB94 */ jal func_800B6E50 /* 0B6C80 800B6080 AC790004 */ sw $t9, 4($v1) /* 0B6C84 800B6084 8E710000 */ lw $s1, ($s3) -/* 0B6C88 800B6088 3C0A800E */ lui $t2, %hi(dl_debug_font_settings) # $t2, 0x800e +/* 0B6C88 800B6088 3C0A800E */ lui $t2, %hi(dDebugFontSettings) # $t2, 0x800e /* 0B6C8C 800B608C 26280008 */ addiu $t0, $s1, 8 /* 0B6C90 800B6090 AE680000 */ sw $t0, ($s3) -/* 0B6C94 800B6094 254A2FB8 */ addiu $t2, %lo(dl_debug_font_settings) # addiu $t2, $t2, 0x2fb8 +/* 0B6C94 800B6094 254A2FB8 */ addiu $t2, %lo(dDebugFontSettings) # addiu $t2, $t2, 0x2fb8 /* 0B6C98 800B6098 3C090600 */ lui $t1, 0x600 /* 0B6C9C 800B609C 3C108012 */ lui $s0, %hi(D_80127CD8) # $s0, 0x8012 /* 0B6CA0 800B60A0 26107CD8 */ addiu $s0, %lo(D_80127CD8) # addiu $s0, $s0, 0x7cd8 diff --git a/asm/non_matchings/thread0_epc/render_epc_lock_up_display.s b/asm/non_matchings/thread0_epc/render_epc_lock_up_display.s index a66d70a5..853bfb30 100644 --- a/asm/non_matchings/thread0_epc/render_epc_lock_up_display.s +++ b/asm/non_matchings/thread0_epc/render_epc_lock_up_display.s @@ -101,8 +101,8 @@ glabel render_epc_lock_up_display /* 0B8458 800B7858 ADC10008 */ sw $at, 8($t6) /* 0B845C 800B785C 0C02D8D7 */ jal set_render_printf_position /* 0B8460 800B7860 ADC80004 */ sw $t0, 4($t6) -/* 0B8464 800B7864 3C03800E */ lui $v1, %hi(D_800E3024) # $v1, 0x800e -/* 0B8468 800B7868 24633024 */ addiu $v1, %lo(D_800E3024) # addiu $v1, $v1, 0x3024 +/* 0B8464 800B7864 3C03800E */ lui $v1, %hi(sLockupPage) # $v1, 0x800e +/* 0B8468 800B7868 24633024 */ addiu $v1, %lo(sLockupPage) # addiu $v1, $v1, 0x3024 /* 0B846C 800B786C 8C620000 */ lw $v0, ($v1) /* 0B8470 800B7870 00000000 */ nop /* 0B8474 800B7874 2C410006 */ sltiu $at, $v0, 6 diff --git a/asm/non_matchings/unknown_00BC20/func_8001F460.s b/asm/non_matchings/unknown_00BC20/func_8001F460.s index 901d55c4..382c32c0 100644 --- a/asm/non_matchings/unknown_00BC20/func_8001F460.s +++ b/asm/non_matchings/unknown_00BC20/func_8001F460.s @@ -205,7 +205,7 @@ glabel func_8001F460 /* 02031C 8001F71C 00000000 */ nop /* 020320 8001F720 10400004 */ beqz $v0, .L8001F734 /* 020324 8001F724 00000000 */ nop -/* 020328 8001F728 0C000326 */ jal func_80000C98 +/* 020328 8001F728 0C000326 */ jal set_music_fade_timer /* 02032C 8001F72C 00022200 */ sll $a0, $v0, 8 /* 020330 8001F730 A2600043 */ sb $zero, 0x43($s3) .L8001F734: diff --git a/asm/non_matchings/unknown_032760/func_80034E9C.s b/asm/non_matchings/unknown_032760/func_80034E9C.s index ff48d29f..95679003 100644 --- a/asm/non_matchings/unknown_032760/func_80034E9C.s +++ b/asm/non_matchings/unknown_032760/func_80034E9C.s @@ -143,7 +143,7 @@ glabel func_80034E9C /* 035CA8 800350A8 A5AB0004 */ sh $t3, 4($t5) /* 035CAC 800350AC 0C00030E */ jal set_sndfx_player_voice_limit /* 035CB0 800350B0 ADAE0000 */ sw $t6, ($t5) -/* 035CB4 800350B4 0C000326 */ jal func_80000C98 +/* 035CB4 800350B4 0C000326 */ jal set_music_fade_timer /* 035CB8 800350B8 2404FFF8 */ li $a0, -8 /* 035CBC 800350BC 0C0006F0 */ jal play_sound /* 035CC0 800350C0 24040011 */ li $a0, 17 @@ -170,7 +170,7 @@ glabel func_80034E9C /* 035D0C 8003510C 10000005 */ b .L80035124 /* 035D10 80035110 AF090000 */ sw $t1, ($t8) .L80035114: -/* 035D14 80035114 0C000326 */ jal func_80000C98 +/* 035D14 80035114 0C000326 */ jal set_music_fade_timer /* 035D18 80035118 AF200000 */ sw $zero, ($t9) /* 035D1C 8003511C 0C00030E */ jal set_sndfx_player_voice_limit /* 035D20 80035120 24040006 */ li $a0, 6 diff --git a/asm/non_matchings/unknown_032760/func_8003B988.s b/asm/non_matchings/unknown_032760/func_8003B988.s index acfb60ea..dd0f6c00 100644 --- a/asm/non_matchings/unknown_032760/func_8003B988.s +++ b/asm/non_matchings/unknown_032760/func_8003B988.s @@ -100,7 +100,7 @@ glabel func_8003B988 /* 03C6EC 8003BAEC 15C0001D */ bnez $t6, .L8003BB64 /* 03C6F0 8003BAF0 240B012C */ li $t3, 300 /* 03C6F4 8003BAF4 AFA80044 */ sw $t0, 0x44($sp) -/* 03C6F8 8003BAF8 0C000326 */ jal func_80000C98 +/* 03C6F8 8003BAF8 0C000326 */ jal set_music_fade_timer /* 03C6FC 8003BAFC AFA90040 */ sw $t1, 0x40($sp) /* 03C700 8003BB00 8FA80044 */ lw $t0, 0x44($sp) /* 03C704 8003BB04 240F008C */ li $t7, 140 @@ -161,7 +161,7 @@ glabel func_8003B988 .L8003BBD4: /* 03C7D4 8003BBD4 AD000008 */ sw $zero, 8($t0) /* 03C7D8 8003BBD8 AFA90040 */ sw $t1, 0x40($sp) -/* 03C7DC 8003BBDC 0C000326 */ jal func_80000C98 +/* 03C7DC 8003BBDC 0C000326 */ jal set_music_fade_timer /* 03C7E0 8003BBE0 AFA80044 */ sw $t0, 0x44($sp) /* 03C7E4 8003BBE4 0C00030E */ jal set_sndfx_player_voice_limit /* 03C7E8 8003BBE8 24040006 */ li $a0, 6 diff --git a/asm/non_matchings/unknown_032760/func_8003C2E4.s b/asm/non_matchings/unknown_032760/func_8003C2E4.s index 9afe9c04..4ca7b9e4 100644 --- a/asm/non_matchings/unknown_032760/func_8003C2E4.s +++ b/asm/non_matchings/unknown_032760/func_8003C2E4.s @@ -80,7 +80,7 @@ glabel func_8003C2E4 /* 03D010 8003C410 00000000 */ nop /* 03D014 8003C414 1540000F */ bnez $t2, .L8003C454 /* 03D018 8003C418 240D012C */ li $t5, 300 -/* 03D01C 8003C41C 0C000326 */ jal func_80000C98 +/* 03D01C 8003C41C 0C000326 */ jal set_music_fade_timer /* 03D020 8003C420 2404FFF8 */ li $a0, -8 /* 03D024 8003C424 240B008C */ li $t3, 140 /* 03D028 8003C428 AE0B0008 */ sw $t3, 8($s0) @@ -120,7 +120,7 @@ glabel func_8003C2E4 /* 03D0A4 8003C4A4 10000005 */ b .L8003C4BC /* 03D0A8 8003C4A8 AE180008 */ sw $t8, 8($s0) .L8003C4AC: -/* 03D0AC 8003C4AC 0C000326 */ jal func_80000C98 +/* 03D0AC 8003C4AC 0C000326 */ jal set_music_fade_timer /* 03D0B0 8003C4B0 AE000008 */ sw $zero, 8($s0) /* 03D0B4 8003C4B4 0C00030E */ jal set_sndfx_player_voice_limit /* 03D0B8 8003C4B8 24040006 */ li $a0, 6 diff --git a/asm/non_matchings/unknown_043920/func_8004DE38.s b/asm/non_matchings/unknown_043920/func_8004DE38.s index 93859daf..e5f10c4a 100644 --- a/asm/non_matchings/unknown_043920/func_8004DE38.s +++ b/asm/non_matchings/unknown_043920/func_8004DE38.s @@ -588,7 +588,7 @@ glabel func_8004DE38 /* 04F25C 8004E65C 01E63023 */ subu $a2, $t7, $a2 .L8004E660: /* 04F260 8004E660 00C02025 */ move $a0, $a2 -/* 04F264 8004E664 0C01A967 */ jal func_8006A59C +/* 04F264 8004E664 0C01A967 */ jal clamp_joystick_x_axis /* 04F268 8004E668 AFA600AC */ sw $a2, 0xac($sp) /* 04F26C 8004E66C 3C018012 */ lui $at, %hi(D_8011D534) # $at, 0x8012 /* 04F270 8004E670 0C0270C3 */ jal get_filtered_cheats @@ -603,7 +603,7 @@ glabel func_8004DE38 /* 04F294 8004E694 0018C823 */ negu $t9, $t8 /* 04F298 8004E698 AC39D534 */ sw $t9, %lo(D_8011D534)($at) .L8004E69C: -/* 04F29C 8004E69C 0C01A978 */ jal func_8006A5E0 +/* 04F29C 8004E69C 0C01A978 */ jal clamp_joystick_y_axis /* 04F2A0 8004E6A0 AFA600AC */ sw $a2, 0xac($sp) /* 04F2A4 8004E6A4 8FA400AC */ lw $a0, 0xac($sp) /* 04F2A8 8004E6A8 3C018012 */ lui $at, %hi(D_8011D538) # $at, 0x8012 @@ -615,7 +615,7 @@ glabel func_8004DE38 /* 04F2C0 8004E6C0 AC22D528 */ sw $v0, %lo(D_8011D528)($at) /* 04F2C4 8004E6C4 8FA400AC */ lw $a0, 0xac($sp) /* 04F2C8 8004E6C8 3C018012 */ lui $at, %hi(gActivePlayerButtonPress) # $at, 0x8012 -/* 04F2CC 8004E6CC 0C01A95E */ jal func_8006A578 +/* 04F2CC 8004E6CC 0C01A95E */ jal get_buttons_released_from_player /* 04F2D0 8004E6D0 AC22D52C */ sw $v0, %lo(gActivePlayerButtonPress)($at) /* 04F2D4 8004E6D4 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 /* 04F2D8 8004E6D8 10000009 */ b .L8004E700 diff --git a/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s index 2771c662..fa51032a 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s @@ -15,7 +15,7 @@ glabel func_8006CCF0 /* 06D900 8006CD00 AFA00040 */ sw $zero, 0x40($sp) /* 06D904 8006CD04 00008025 */ move $s0, $zero /* 06D908 8006CD08 AFA0004C */ sw $zero, 0x4c($sp) -/* 06D90C 8006CD0C 0C0270F6 */ jal func_8009C3D8 +/* 06D90C 8006CD0C 0C0270F6 */ jal get_active_player_count /* 06D910 8006CD10 AFA00044 */ sw $zero, 0x44($sp) /* 06D914 8006CD14 8FAE0044 */ lw $t6, 0x44($sp) /* 06D918 8006CD18 00000000 */ nop @@ -34,7 +34,7 @@ glabel func_8006CCF0 /* 06D948 8006CD48 27290001 */ addiu $t1, $t9, 1 /* 06D94C 8006CD4C 01E2C025 */ or $t8, $t7, $v0 /* 06D950 8006CD50 AFA90044 */ sw $t1, 0x44($sp) -/* 06D954 8006CD54 0C0270F6 */ jal func_8009C3D8 +/* 06D954 8006CD54 0C0270F6 */ jal get_active_player_count /* 06D958 8006CD58 AFB8004C */ sw $t8, 0x4c($sp) /* 06D95C 8006CD5C 8FAA0044 */ lw $t2, 0x44($sp) /* 06D960 8006CD60 00000000 */ nop @@ -42,8 +42,8 @@ glabel func_8006CCF0 /* 06D968 8006CD68 1420FFF0 */ bnez $at, .L8006CD2C /* 06D96C 8006CD6C 8FA40044 */ lw $a0, 0x44($sp) .L8006CD70: -/* 06D970 8006CD70 3C0B800E */ lui $t3, %hi(D_800DD374) # $t3, 0x800e -/* 06D974 8006CD74 816BD374 */ lb $t3, %lo(D_800DD374)($t3) +/* 06D970 8006CD70 3C0B800E */ lui $t3, %hi(sAntiPiracyTriggered) # $t3, 0x800e +/* 06D974 8006CD74 816BD374 */ lb $t3, %lo(sAntiPiracyTriggered)($t3) /* 06D978 8006CD78 8FAC004C */ lw $t4, 0x4c($sp) /* 06D97C 8006CD7C 11600003 */ beqz $t3, .L8006CD8C /* 06D980 8006CD80 3C0E8012 */ lui $t6, %hi(gIsPaused) # $t6, 0x8012 diff --git a/asm/non_matchings/unknown_06B2B0/load_level.s b/asm/non_matchings/unknown_06B2B0/load_level.s index 91e3bd55..02844f6c 100644 --- a/asm/non_matchings/unknown_06B2B0/load_level.s +++ b/asm/non_matchings/unknown_06B2B0/load_level.s @@ -28,7 +28,7 @@ glabel load_level /* 06BEAC 8006B2AC 00000000 */ nop /* 06BEB0 8006B2B0 17200006 */ bnez $t9, .L8006B2CC /* 06BEB4 8006B2B4 8FAA0064 */ lw $t2, 0x64($sp) -/* 06BEB8 8006B2B8 0C000C63 */ jal func_8000318C +/* 06BEB8 8006B2B8 0C000C63 */ jal set_sound_channel_count /* 06BEBC 8006B2BC 24040008 */ li $a0, 8 /* 06BEC0 8006B2C0 1000000B */ b .L8006B2F0 /* 06BEC4 8006B2C4 00000000 */ nop @@ -37,12 +37,12 @@ glabel load_level /* 06BECC 8006B2CC 24010001 */ li $at, 1 /* 06BED0 8006B2D0 15410005 */ bne $t2, $at, .L8006B2E8 /* 06BED4 8006B2D4 00000000 */ nop -/* 06BED8 8006B2D8 0C000C63 */ jal func_8000318C +/* 06BED8 8006B2D8 0C000C63 */ jal set_sound_channel_count /* 06BEDC 8006B2DC 2404000C */ li $a0, 12 /* 06BEE0 8006B2E0 10000003 */ b .L8006B2F0 /* 06BEE4 8006B2E4 00000000 */ nop .L8006B2E8: -/* 06BEE8 8006B2E8 0C000C63 */ jal func_8000318C +/* 06BEE8 8006B2E8 0C000C63 */ jal set_sound_channel_count /* 06BEEC 8006B2EC 24040010 */ li $a0, 16 .L8006B2F0: /* 06BEF0 8006B2F0 0C01BAA4 */ jal get_settings diff --git a/asm/non_matchings/unknown_09F8F0/func_800A01A0.s b/asm/non_matchings/unknown_09F8F0/func_800A01A0.s index b7da7ea3..96680145 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800A01A0.s +++ b/asm/non_matchings/unknown_09F8F0/func_800A01A0.s @@ -299,7 +299,7 @@ glabel func_800A01A0 /* 0A1204 800A0604 00000000 */ nop /* 0A1208 800A0608 0C0002CD */ jal play_music /* 0A120C 800A060C 2404001E */ li $a0, 30 -/* 0A1210 800A0610 0C000C63 */ jal func_8000318C +/* 0A1210 800A0610 0C000C63 */ jal set_sound_channel_count /* 0A1214 800A0614 2404000C */ li $a0, 12 /* 0A1218 800A0618 10000005 */ b .L800A0630 /* 0A121C 800A061C 00000000 */ nop diff --git a/asm/non_matchings/unknown_09F8F0/func_800A0BD4.s b/asm/non_matchings/unknown_09F8F0/func_800A0BD4.s index 8766de8f..13f976af 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800A0BD4.s +++ b/asm/non_matchings/unknown_09F8F0/func_800A0BD4.s @@ -109,7 +109,7 @@ glabel func_800A0BD4 /* 0A1960 800A0D60 24010001 */ li $at, 1 /* 0A1964 800A0D64 14410006 */ bne $v0, $at, .L800A0D80 /* 0A1968 800A0D68 24010002 */ li $at, 2 -/* 0A196C 800A0D6C 0C000C63 */ jal func_8000318C +/* 0A196C 800A0D6C 0C000C63 */ jal set_sound_channel_count /* 0A1970 800A0D70 24040008 */ li $a0, 8 /* 0A1974 800A0D74 1000000B */ b .L800A0DA4 /* 0A1978 800A0D78 8FBF002C */ lw $ra, 0x2c($sp) @@ -117,12 +117,12 @@ glabel func_800A0BD4 .L800A0D80: /* 0A1980 800A0D80 14410005 */ bne $v0, $at, .L800A0D98 /* 0A1984 800A0D84 00000000 */ nop -/* 0A1988 800A0D88 0C000C63 */ jal func_8000318C +/* 0A1988 800A0D88 0C000C63 */ jal set_sound_channel_count /* 0A198C 800A0D8C 2404000C */ li $a0, 12 /* 0A1990 800A0D90 10000004 */ b .L800A0DA4 /* 0A1994 800A0D94 8FBF002C */ lw $ra, 0x2c($sp) .L800A0D98: -/* 0A1998 800A0D98 0C000C63 */ jal func_8000318C +/* 0A1998 800A0D98 0C000C63 */ jal set_sound_channel_count /* 0A199C 800A0D9C 24040010 */ li $a0, 16 /* 0A19A0 800A0DA0 8FBF002C */ lw $ra, 0x2c($sp) .L800A0DA4: diff --git a/include/structs.h b/include/structs.h index b0afb602..84e82d43 100644 --- a/include/structs.h +++ b/include/structs.h @@ -225,8 +225,8 @@ typedef struct LevelHeader { /* 0x38 */ s16 skybox; // Fog related? - /* 0x3A */ s16 unk3A; - /* 0x3C */ s16 unk3C; + /* 0x3A */ s16 fogNear; + /* 0x3C */ s16 fogFar; /* 0x3E */ s16 fogR; /* 0x40 */ s16 fogG; /* 0x42 */ s16 fogB; diff --git a/src/audio.c b/src/audio.c index 4172c5fd..1497e501 100644 --- a/src/audio.c +++ b/src/audio.c @@ -16,20 +16,20 @@ ALSeqPlayer *gMusicPlayer = NULL; ALSeqPlayer *gSndFxPlayer = NULL; -u8 musicRelativeVolume = 0x7F; -u8 sfxRelativeVolume = 0x7F; +u8 musicRelativeVolume = 127; +u8 sfxRelativeVolume = 127; u8 D_800DC640 = 1; u8 D_800DC644 = 0; s32 D_800DC648 = 0; s32 audioPrevCount = 0; -f32 D_800DC650 = 1.0; -s32 musicVolumeSliderPercentage = 0x100; +f32 sMusicFadeVolume = 1.0f; +s32 musicVolumeSliderPercentage = 256; s32 D_800DC658 = 0; u8 D_800DC65C = 0; u8 D_800DC660 = 0; s32 D_800DC664 = 0; // Currently unknown, might be a different type. s32 D_800DC668 = 0; // Currently unknown, might be a different type. -s32 D_800DC66C = 0x100; +s32 sMusicVolumeMultiplier = 256; // This is never not 256... u8 D_800DC670 = 0; /*******************************/ @@ -37,9 +37,9 @@ u8 D_800DC670 = 0; /************ .rodata ************/ // Debug strings -const char D_800E4950[] = "amSndPlay: Illegal sound effects table index\n"; -const char D_800E4980[] = "amSndPlayDirect: Somebody tried to play illegal sound %d\n"; -const char D_800E49BC[] = "Invalid midi sequence index\n"; +UNUSED const char sAudioErrorString_01[] = "amSndPlay: Illegal sound effects table index\n"; +UNUSED const char sAudioErrorString_02[] = "amSndPlayDirect: Somebody tried to play illegal sound %d\n"; +UNUSED const char sAudioErrorString_03[] = "Invalid midi sequence index\n"; /*********************************/ @@ -66,20 +66,20 @@ u8 D_80115D04; u8 D_80115D05; s32 musicTempo; u32 *D_80115D0C; -ALBankFile *ALBankFile_80115D10; -ALBankFile *ALBankFile_80115D14; +ALBankFile *ALBankFile_80115D10; // And I have reason to believe these are voice clips. +ALBankFile *ALBankFile_80115D14; // These are sound effects, I do not know if it is ALL the sound effects. -unk80115D18 *D_80115D18; -unk80115D1C *D_80115D1C; +unk80115D18 *sSoundEffectsPool; +unk80115D1C *sMusicPool; s32 D_80115D20; s32 D_80115D24; -u32 D_80115D28; -u32 D_80115D2C; -s16 D_80115D30; +u32 sSoundEffectsPoolSize; +u32 sMusicPoolSize; +s16 sMusicTempo; f32 D_80115D34; -s32 D_80115D38; -s32 D_80115D3C; +s32 sMusicDelayTimer; +s32 sMusicDelayLength; u8 D_80115D40; u8 D_80115D41; unk80115D48 D_80115D48[8]; @@ -97,7 +97,7 @@ u32 D_80115F88; void audio_init(OSSched *arg0) { s32 iCnt; ALSynConfig synth_config; - s32 *reg_s2; + s32 *addrPtr; u32 seqfSize; u32 seq_max_len; u32 tmp2; @@ -106,31 +106,31 @@ void audio_init(OSSched *arg0) { seq_max_len = 0; alHeapInit(&gALHeap, gBssSectionStart, AUDIO_HEAP_SIZE); - reg_s2 = load_asset_section_from_rom(ASSET_AUDIO_TABLE); - ALBankFile_80115D14 = (ALBankFile *)allocate_from_main_pool_safe(reg_s2[2] - reg_s2[1], COLOR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D14, reg_s2[1], reg_s2[2] - reg_s2[1]); - alBnkfNew(ALBankFile_80115D14, get_rom_offset_of_asset(ASSET_AUDIO, reg_s2[2])); + addrPtr = load_asset_section_from_rom(ASSET_AUDIO_TABLE); + ALBankFile_80115D14 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[2] - addrPtr[1], COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D14, addrPtr[1], addrPtr[2] - addrPtr[1]); + alBnkfNew(ALBankFile_80115D14, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[2])); - D_80115D28 = reg_s2[7] - reg_s2[6]; - D_80115D18 = (unk80115D18 *)allocate_from_main_pool_safe(D_80115D28, COLOR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, D_80115D18, reg_s2[6], D_80115D28); - D_80115D20 = D_80115D28 / 10; + sSoundEffectsPoolSize = addrPtr[7] - addrPtr[6]; + sSoundEffectsPool = (unk80115D18 *)allocate_from_main_pool_safe(sSoundEffectsPoolSize, COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, sSoundEffectsPool, addrPtr[6], sSoundEffectsPoolSize); + D_80115D20 = sSoundEffectsPoolSize / 10; - D_80115D2C = reg_s2[6] - reg_s2[5]; - D_80115D1C = (unk80115D1C *)allocate_from_main_pool_safe(D_80115D2C, COLOR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, D_80115D1C, reg_s2[5], D_80115D2C); - D_80115D24 = D_80115D2C / 3; + sMusicPoolSize = addrPtr[6] - addrPtr[5]; + sMusicPool = (unk80115D1C *)allocate_from_main_pool_safe(sMusicPoolSize, COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, sMusicPool, addrPtr[5], sMusicPoolSize); + D_80115D24 = sMusicPoolSize / 3; - ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(reg_s2[0], COLOR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D10, 0, reg_s2[0]); - alBnkfNew(ALBankFile_80115D10, get_rom_offset_of_asset(ASSET_AUDIO, reg_s2[0])); + ALBankFile_80115D10 = (ALBankFile *)allocate_from_main_pool_safe(addrPtr[0], COLOR_TAG_CYAN); + load_asset_to_address(ASSET_AUDIO, ALBankFile_80115D10, 0, addrPtr[0]); + alBnkfNew(ALBankFile_80115D10, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[0])); ALSeqFile_80115CF8 = (ALSeqFile *)alHeapDBAlloc(0, 0, &gALHeap, 1, 4); - load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, reg_s2[4], 4); + load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, addrPtr[4], 4); seqfSize = (ALSeqFile_80115CF8->seqCount) * 8 + 4; ALSeqFile_80115CF8 = allocate_from_main_pool_safe(seqfSize, COLOR_TAG_CYAN); - load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, reg_s2[4], seqfSize); - alSeqFileNew(ALSeqFile_80115CF8, get_rom_offset_of_asset(ASSET_AUDIO, reg_s2[4])); + load_asset_to_address(ASSET_AUDIO, ALSeqFile_80115CF8, addrPtr[4], seqfSize); + alSeqFileNew(ALSeqFile_80115CF8, get_rom_offset_of_asset(ASSET_AUDIO, addrPtr[4])); D_80115D0C = (u32 *)allocate_from_main_pool_safe((ALSeqFile_80115CF8->seqCount) * 4, COLOR_TAG_CYAN); for (iCnt = 0; iCnt < ALSeqFile_80115CF8->seqCount; iCnt++) { @@ -166,8 +166,8 @@ void audio_init(OSSched *arg0) { alSndPNew(&audConfig); audioStartThread(); func_80000968(0); - free_from_memory_pool(reg_s2); - func_8000318C(10); + free_from_memory_pool(addrPtr); + set_sound_channel_count(10); D_800DC648 = 0; D_80115D40 = 0; D_80115D41 = 0; @@ -181,12 +181,12 @@ void func_80000890(u8 arg0) { if (!D_80115F79) { D_80115F78 = arg0; if (D_80115F78 == 0) { - D_800DC66C = 256; + sMusicVolumeMultiplier = 256; set_relative_volume_for_music(musicRelativeVolume); - func_80004A60(0, D_800DC66C * 128 - 1); - func_80004A60(1, D_800DC66C * 128 - 1); - func_80004A60(2, D_800DC66C * 128 - 1); - func_80004A60(4, D_800DC66C * 128 - 1); + func_80004A60(0, sMusicVolumeMultiplier * 128 - 1); + func_80004A60(1, sMusicVolumeMultiplier * 128 - 1); + func_80004A60(2, sMusicVolumeMultiplier * 128 - 1); + func_80004A60(4, sMusicVolumeMultiplier * 128 - 1); } } } @@ -195,7 +195,7 @@ void func_80000968(s32 arg0) { switch (arg0) { case 1: func_80004A60(0, 0); - func_80004A60(1, 0x7FFF); + func_80004A60(1, 32767); func_80004A60(2, 0); func_80004A60(4, 0); alCSPSetVol(gMusicPlayer, (s16)(musicRelativeVolume * musicVolumeSliderPercentage >> 2)); @@ -203,21 +203,21 @@ void func_80000968(s32 arg0) { break; case 2: func_80004A60(0, 0); - func_80004A60(1, 0x7FFF); - func_80004A60(2, 0x7FFF); - func_80004A60(4, 0x7FFF); + func_80004A60(1, 32767); + func_80004A60(2, 32767); + func_80004A60(4, 32767); break; case 3: func_80004A60(0, 0); - func_80004A60(1, 0x7FFF); + func_80004A60(1, 32767); func_80004A60(2, 0); func_80004A60(4, 0); break; default: - func_80004A60(0, 0x7FFF); - func_80004A60(1, 0x7FFF); - func_80004A60(2, 0x7FFF); - func_80004A60(4, 0x7FFF); + func_80004A60(0, 32767); + func_80004A60(1, 32767); + func_80004A60(2, 32767); + func_80004A60(4, 32767); alCSPSetVol(gMusicPlayer, (s16)(musicRelativeVolume * musicVolumeSliderPercentage)); alCSPSetVol(gSndFxPlayer, (s16)(sfxGetVolumeSlider() * sfxRelativeVolume)); break; @@ -270,40 +270,44 @@ void func_80000C68(u8 arg0) { func_80063A90(gMusicPlayer, arg0); } -void func_80000C98(s32 arg0) { - D_80115D38 = 0; - D_80115D3C = (arg0 * 0x3C) >> 8; +/** + * Enables the timer to start fading in or out the background music. + * Give it a positive number to fade in, otherwise, give it a negative one to fade out. + */ +void set_music_fade_timer(s32 time) { + sMusicDelayTimer = 0; + sMusicDelayLength = (time * 60) >> 8; } void func_80000CBC(void) { - D_80115D38 = 0; - D_80115D3C = 0; - D_800DC650 = 1.0f; + sMusicDelayTimer = 0; + sMusicDelayLength = 0; + sMusicFadeVolume = 1.0f; set_relative_volume_for_music(musicRelativeVolume); } -void process_audio(u8 updateRate) { +void handle_music_fade(u8 updateRate) { s32 reg_s2; s32 j; - if (D_80115D3C > 0) { + if (sMusicDelayLength > 0) { - D_80115D38 += updateRate; - D_800DC650 = ((f32)D_80115D38) / ((f32)D_80115D3C); + sMusicDelayTimer += updateRate; + sMusicFadeVolume = ((f32)sMusicDelayTimer) / ((f32)sMusicDelayLength); - if ((f64)D_800DC650 > 1.0f) { - D_80115D38 = 0; - D_80115D3C = 0; - D_800DC650 = 1.0f; + if ((f64)sMusicFadeVolume > 1.0f) { + sMusicDelayTimer = 0; + sMusicDelayLength = 0; + sMusicFadeVolume = 1.0f; } set_relative_volume_for_music(musicRelativeVolume); - } else if (D_80115D3C < 0) { + } else if (sMusicDelayLength < 0) { - D_80115D38 -= updateRate; - D_800DC650 = 1.0f - ((f32)D_80115D38) / ((f32)D_80115D3C); - if ((f64)D_800DC650 < 0) { - D_80115D38 = 0; - D_80115D3C = 0; - D_800DC650 = 0.0f; + sMusicDelayTimer -= updateRate; + sMusicFadeVolume = 1.0f - ((f32)sMusicDelayTimer) / ((f32)sMusicDelayLength); + if ((f64)sMusicFadeVolume < 0) { + sMusicDelayTimer = 0; + sMusicDelayLength = 0; + sMusicFadeVolume = 0.0f; } set_relative_volume_for_music(musicRelativeVolume); } @@ -333,8 +337,8 @@ void process_audio(u8 updateRate) { func_8000232C(gMusicPlayer, D_80115CFC, &D_800DC65C, &D_80115D88); func_8000232C(gSndFxPlayer, D_80115D00, &D_800DC660, &D_80115E80); - if (D_80115D30 == -1 && gMusicPlayer->target) { - D_80115D30 = 0x03938700 / alCSPGetTempo(gMusicPlayer); + if (sMusicTempo == -1 && gMusicPlayer->target) { + sMusicTempo = 60000000 / alCSPGetTempo(gMusicPlayer); } } @@ -474,16 +478,22 @@ void func_800014BC(f32 arg0) { musicSetTempo((s32)((f32)(u32)(musicGetTempo() & 0xFF) * arg0)); } +/** + * Set the tempo of the current playing background music. + */ void musicSetTempo(s32 tempo) { if (tempo != 0) { f32 inv_tempo = (1.0f / tempo); alCSPSetTempo(gMusicPlayer, (s32)(inv_tempo * 60000000.0f)); - D_80115D30 = tempo; + sMusicTempo = tempo; } } +/** + * Return the tempo of the current playing background music. + */ s16 musicGetTempo(void) { - return D_80115D30; + return sMusicTempo; } u8 music_is_playing(void) { @@ -515,9 +525,9 @@ f32 func_800015F8(void) { *tmp2 = delta_f / D_800E49E0 + D_80115D34; } if (D_80115D40 == 0) { - D_80115D30 = 182; + sMusicTempo = 182; } - tmp = D_800E49E8 / (f32)D_80115D30; + tmp = D_800E49E8 / (f32)sMusicTempo; while (D_80115D34 > tmp) { D_80115D34 -= tmp; } @@ -527,9 +537,9 @@ f32 func_800015F8(void) { #endif void func_80001728(u8 arg0, u8 *arg1, u8 *arg2, u8 *arg3) { - *arg1 = D_80115D1C[arg0].unk1; - *arg2 = D_80115D1C[arg0].unk0; - *arg3 = D_80115D1C[arg0].unk2; + *arg1 = sMusicPool[arg0].unk1; + *arg2 = sMusicPool[arg0].unk0; + *arg3 = sMusicPool[arg0].unk2; } void func_80001784(u8 a0) { @@ -596,17 +606,17 @@ void set_relative_volume_for_music(u8 vol) { f32 normalized_vol; musicRelativeVolume = vol; - normalized_vol = musicVolumeSliderPercentage * musicRelativeVolume * D_800DC650; - alCSPSetVol(gMusicPlayer, (s16)((s32)(D_800DC66C * normalized_vol) >> 8)); + normalized_vol = musicVolumeSliderPercentage * musicRelativeVolume * sMusicFadeVolume; + alCSPSetVol(gMusicPlayer, (s16)((s32)(sMusicVolumeMultiplier * normalized_vol) >> 8)); } void set_music_volume_slider(u32 slider_val) { f32 normalized_vol; - slider_val = (slider_val < 0x101) ? slider_val : 256; + slider_val = (slider_val <= 256) ? slider_val : 256; musicVolumeSliderPercentage = slider_val; - normalized_vol = musicVolumeSliderPercentage * musicRelativeVolume * D_800DC650; - alCSPSetVol(gMusicPlayer, (s16)((s32)(D_800DC66C * normalized_vol) >> 8)); + normalized_vol = musicVolumeSliderPercentage * musicRelativeVolume * sMusicFadeVolume; + alCSPSetVol(gMusicPlayer, (s16)((s32)(sMusicVolumeMultiplier * normalized_vol) >> 8)); } u8 musicGetRelativeVolume(void) { @@ -654,7 +664,7 @@ u16 func_80001CB8(u16 arg0) { if (D_80115D20 < arg0) { return 0; } - return D_80115D18[arg0].unk6; + return sSoundEffectsPool[arg0].unk6; } GLOBAL_ASM("asm/non_matchings/audio/func_80001D04.s") @@ -689,7 +699,7 @@ void func_80001F14(u16 sndIndx, u32 *arg1) { GLOBAL_ASM("asm/non_matchings/audio/func_80001FB8.s") #else void func_80001FB8(u16 arg0) { - arg0 * 10 + D_80115D18[0].unk00; + arg0 * 10 + sSoundEffectsPool[0].unk00; } #endif @@ -703,10 +713,10 @@ u8 ALSeqFile_80115CF8_GetSeqCount(void) { void func_80002128(unk80115D18 **arg0, s32 *arg1, s32 *arg2) { if (arg0 != NULL) { - *arg0 = D_80115D18; + *arg0 = sSoundEffectsPool; } if (arg1 != NULL) { - *arg1 = D_80115D28; + *arg1 = sSoundEffectsPoolSize; } if (arg2 != NULL) { *arg2 = D_80115D20; @@ -716,10 +726,10 @@ void func_80002128(unk80115D18 **arg0, s32 *arg1, s32 *arg2) { /* Unused? */ void func_8000216C(unk80115D1C **arg0, s32 *arg1, s32 *arg2) { if (arg0 != NULL) { - *arg0 = D_80115D1C; + *arg0 = sMusicPool; } if (arg1 != NULL) { - *arg1 = D_80115D2C; + *arg1 = sMusicPoolSize; } if (arg2 != NULL) { *arg2 = D_80115D24; @@ -770,14 +780,14 @@ GLOBAL_ASM("asm/non_matchings/audio/func_8000232C.s") #else void func_8000232C(ALSeqPlayer *seqp, void *ptr, u8 *arg2, ALCSeq *seq) { if (alCSPGetState(seqp) == AL_STOPPED && *arg2) { - /*load_asset_to_address(ASSET_AUDIO, ptr, + /*load_asset_to_address(ASSET_AUDIO, ptr, (u32)((ALSeqFile_80115CF8->seqArray)[*arg2]) - get_rom_offset_of_asset(ASSET_AUDIO,0), *((u32*)(((*arg2) << 3) + D_80115D0C)));*/ alCSeqNew(seq, ptr); alCSPSetSeq(seqp, seq); alCSPPlay(seqp); if (seqp == gMusicPlayer) { - set_relative_volume_for_music(*((u8 *)((*arg2) * 3 + D_80115D1C->unk0))); + set_relative_volume_for_music(*((u8 *)((*arg2) * 3 + sMusicPool->unk0))); } else { } } @@ -803,5 +813,5 @@ void func_80002608(u8 arg0) { } u8 func_80002630(void) { - return D_80115D1C[D_80115D04].unk2; + return sMusicPool[D_80115D04].unk2; } diff --git a/src/audio.h b/src/audio.h index e961ef29..20a51d2e 100644 --- a/src/audio.h +++ b/src/audio.h @@ -13,14 +13,14 @@ extern u8 D_800DC640; extern u8 D_800DC644; extern s32 D_800DC648; extern s32 audioPrevCount; -extern f32 D_800DC650; +extern f32 sMusicFadeVolume; extern s32 musicVolumeSliderPercentage; extern s32 D_800DC658; extern u8 D_800DC65C; extern u8 D_800DC660; extern s32 D_800DC664; extern s32 D_800DC668; -extern s32 D_800DC66C; +extern s32 sMusicVolumeMultiplier; extern u8 D_800DC670; extern u8 D_800DC65C; @@ -74,9 +74,9 @@ void func_80000C1C(void); void func_80000C2C(void); void set_sndfx_player_voice_limit(u8 voiceLimit); void func_80000C68(u8 arg0); -void func_80000C98(s32 arg0); +void set_music_fade_timer(s32 time); void func_80000CBC(void); -void process_audio(u8 arg0); +void handle_music_fade(u8 updateRate); void func_80000FDC(u16 arg0, s32 arg1, f32 arg2); void func_80001050(void); u16 musicGetChanMask(void); diff --git a/src/camera.c b/src/camera.c index 677bc3f1..1b749f97 100644 --- a/src/camera.c +++ b/src/camera.c @@ -51,26 +51,26 @@ s16 D_800DD138[8] = { // RSP Viewports Vp D_800DD148[20] = { - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, - { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, + { 0, 0, 511, 0, 0, 0, 511, 0 }, }; unk8011D510 D_800DD288 = { @@ -81,7 +81,7 @@ unk8011D510 D_800DD2A0 = { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f, }; -Matrix D_800DD2B8 = { +Matrix gOrthoMatrix = { { 1.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 0.0f }, @@ -128,15 +128,15 @@ Matrix D_80120FE0; Matrix D_80121020; Matrix D_80121060; Matrix D_801210A0; -OSMesgQueue D_801210E0; -OSMesg D_801210F8; +OSMesgQueue sSIMesgQueue; +OSMesg sSIMesgBuf; OSMesg D_801210FC; OSContStatus status; s32 D_80121108[2]; //Padding? -unk80121110 D_80121110[8]; -u16 D_80121140[4]; +ControllerData sControllerData[8]; +u16 sControllerButtonsPressed[4]; u16 D_80121148[4]; -u8 D_80121150[16]; +u8 sPlayerID[16]; /******************************/ @@ -697,8 +697,13 @@ GLOBAL_ASM("asm/non_matchings/camera/func_80066CDC.s") GLOBAL_ASM("asm/non_matchings/camera/func_80067A3C.s") GLOBAL_ASM("asm/non_matchings/camera/func_80067D3C.s") -void func_80067F20(f32 arg0) { - D_800DD2B8[1][1] = arg0; +/** + * Sets the Y value of the Y axis in the matrix to the passed value. + * This is used to vertically scale ortho geometry to look identical across NTSC and PAL systems. + */ + +void set_ortho_matrix_height(f32 value) { + gOrthoMatrix[1][1] = value; } void func_80067F2C(Gfx **dlist, s32 *arg1) { @@ -709,7 +714,7 @@ void func_80067F2C(Gfx **dlist, s32 *arg1) { widthAndHeight = get_video_width_and_height_as_s32(); height = widthAndHeight >> 0x10; width = widthAndHeight & 0xFFFF; - func_8006F870(D_800DD2B8, *arg1); + func_8006F870(gOrthoMatrix, *arg1); D_80120D88[0] = *arg1; D_800DD148[D_80120CE4 + 5].vp.vscale[0] = width * 2; D_800DD148[D_80120CE4 + 5].vp.vscale[1] = width * 2; @@ -725,7 +730,7 @@ void func_80067F2C(Gfx **dlist, s32 *arg1) { while (i < 4) { // for loop doesn't match here. j = 0; while (j < 4) { - D_80120F20[i][j] = D_800DD2B8[i][j]; + D_80120F20[i][j] = gOrthoMatrix[i][j]; j++; } i++; @@ -863,7 +868,10 @@ void func_80069F28(f32 arg0) { } #ifdef NON_MATCHING -// Unused. Prints/Displays a 4x4 fixed-point RSP matrix. +/** + * Unused function that prints out the passed matrix values to the debug output. + * This function prints in fixed point. + */ void func_80069F64(s16 *mtx) { s32 i, j; s32 val; @@ -882,8 +890,11 @@ void func_80069F64(s16 *mtx) { GLOBAL_ASM("asm/non_matchings/camera/func_80069F64.s") #endif -// Unused. Prints/Displays a 4x4 floating-point matrix. -void func_8006A03C(f32 *mtx) { +/** + * Unused function that prints out the passed matrix values to the debug output. + * This function prints in floating point. + */ +UNUSED void debug_print_float_matrix_values(f32 *mtx) { s32 i, j; for (i = 0; i < 4; i++) { @@ -896,23 +907,22 @@ void func_8006A03C(f32 *mtx) { } OSMesgQueue *func_8006A100(void) { - return &D_801210E0; + return &sSIMesgQueue; } /** * Initialise the player controllers, and return the status when finished. */ - s32 init_controllers(void) { s32 *temp1; // Unused u8 bitpattern; s32 *temp2; // Unused - osCreateMesgQueue(&D_801210E0, &D_801210F8, 1); - osSetEventMesg(OS_EVENT_SI, &D_801210E0, D_801210FC); - osContInit(&D_801210E0, &bitpattern, &status); - osContStartReadData(&D_801210E0); - func_8006A434(); + osCreateMesgQueue(&sSIMesgQueue, &sSIMesgBuf, 1); + osSetEventMesg(OS_EVENT_SI, &sSIMesgQueue, D_801210FC); + osContInit(&sSIMesgQueue, &bitpattern, &status); + osContStartReadData(&sSIMesgQueue); + initialise_player_ids(); D_800DD300 = 0; @@ -920,7 +930,7 @@ s32 init_controllers(void) { return CONTROLLER_EXISTS; } - if (!bitpattern) {} + if (!bitpattern) {} // Fakematch D_800DD300 = 1; @@ -929,77 +939,112 @@ s32 init_controllers(void) { GLOBAL_ASM("asm/non_matchings/camera/func_8006A1C4.s") -void func_8006A434(void) { +/** + * Set the first 4 player ID's to the controller numbers, so players can input in the menus after boot. + */ +void initialise_player_ids(void) { s32 i; for (i = 0; i < 4; i++) { - D_80121150[i] = i; + sPlayerID[i] = i; } } -void func_8006A458(s8 *activePlayers) { +/** + * Assign the first four player ID's to the index of the connected players. + * Assign the next four player ID's to the index of the players who are not connected. + */ +void assign_player_ids(s8 *activePlayers) { s32 i; s32 temp = 0; for (i = 0; i < 4; i++) { if (activePlayers[i]) { - D_80121150[temp++] = i; + sPlayerID[temp++] = i; } } for (i = 0; i < 4; i++) { if (!activePlayers[i]) { - D_80121150[temp++] = i; + sPlayerID[temp++] = i; } } } -u8 func_8006A4F8(s32 arg0) { - return D_80121150[arg0]; +/** + * Returns the id of the selected index. + */ +u8 get_player_id(s32 player) { + return sPlayerID[player]; } -void func_8006A50C(void) { - u8 temp = D_80121150[0]; - D_80121150[0] = D_80121150[1]; - D_80121150[1] = temp; +/** + * Swaps the ID's of the first two indexes. + * This applies in 2 player adventure, so that player 2 can control the car in the overworld. + */ +void swap_player_1_and_2_ids(void) { + u8 tempID = sPlayerID[0]; + sPlayerID[0] = sPlayerID[1]; + sPlayerID[1] = tempID; } -u16 get_buttons_held_from_player(s32 arg0) { - return D_80121110[D_80121150[arg0]].unk0; +/** + * Returns the buttons that are currently pressed down on the controller. + */ +u16 get_buttons_held_from_player(s32 player) { + return sControllerData[sPlayerID[player]].buttonData; } -u16 get_buttons_pressed_from_player(s32 arg0) { - return D_80121140[D_80121150[arg0]]; +/** + * Returns the buttons that are newly pressed during that frame. + */ +u16 get_buttons_pressed_from_player(s32 player) { + return sControllerButtonsPressed[sPlayerID[player]]; } -u16 func_8006A578(s32 arg0) { - return D_80121148[D_80121150[arg0]]; +/** + * Unused function that returns the buttons that are no longer pressed in that frame. + */ +UNUSED u16 get_buttons_released_from_player(s32 player) { + return D_80121148[sPlayerID[player]]; } -s32 func_8006A59C(s32 arg0) { - func_8006A624(D_80121110[D_80121150[arg0]].unk2); +/** + * Clamps the X joystick axis of the selected player to 70 and returns it. + */ +s32 clamp_joystick_x_axis(s32 player) { + return clamp_joystick(sControllerData[sPlayerID[player]].rawStickX); } -s32 func_8006A5E0(s32 arg0) { - func_8006A624(D_80121110[D_80121150[arg0]].unk3); +/** + * Clamps the Y joystick axis of the selected player to 70 and returns it. + */ +s32 clamp_joystick_y_axis(s32 player) { + return clamp_joystick(sControllerData[sPlayerID[player]].rawStickY); } -s32 func_8006A624(s8 arg0) { - if (arg0 < 8 && arg0 >= -7) { +/** + * Keeps the joysticks axis reads no higher than 70 (of a possible 127 or -128) + * Will also pull the reading towards the centre. + */ +s32 clamp_joystick(s8 stickMag) { + if (stickMag < JOYSTICK_DEADZONE && stickMag > -JOYSTICK_DEADZONE) { return 0; } - if (arg0 > 0) { - arg0 -= 8; - if (arg0 >= 0x47) { - arg0 = 0x46; + if (stickMag > 0) { + stickMag -= 8; + if (stickMag > JOYSTICK_MAX_RANGE) { + stickMag = JOYSTICK_MAX_RANGE; } } else { - arg0 += 8; - if (arg0 < -0x46) { - arg0 = -0x46; + stickMag += 8; + if (stickMag < -JOYSTICK_MAX_RANGE) { + stickMag = -JOYSTICK_MAX_RANGE; } } - return arg0; + return stickMag; } -// Used when anti-cheat/anti-tamper has failed in func_8006A6B0() +/** + * Used when anti-cheat/anti-tamper has failed in func_8006A6B0() + */ void disable_button_mask(void) { gButtonMask = 0; } diff --git a/src/camera.h b/src/camera.h index 436f5aac..9086ca11 100644 --- a/src/camera.h +++ b/src/camera.h @@ -27,6 +27,9 @@ #define CONTROLLER_MISSING -1 #define CONTROLLER_EXISTS 0 +#define JOYSTICK_DEADZONE 8 +#define JOYSTICK_MAX_RANGE 70 + enum ViewportCount { VIEWPORTS_COUNT_1_PLAYER, VIEWPORTS_COUNT_2_PLAYERS, @@ -54,13 +57,13 @@ typedef struct ScreenViewport { } ScreenViewport; /* Size: 6 bytes */ -typedef struct unk80121110 { - u16 unk0; - s8 unk2; - s8 unk3; +typedef struct ControllerData { + u16 buttonData; // Buttons + s8 rawStickX; + s8 rawStickY; s8 unk4; s8 unk6; -} unk80121110; +} ControllerData; extern ScreenViewport gScreenViewports[4]; @@ -74,7 +77,7 @@ extern unk8011D510 D_800DD288; extern unk8011D510 D_800DD2A0; -extern Matrix D_800DD2B8; +extern Matrix gOrthoMatrix; extern u8 D_800DD2F8[8]; @@ -118,7 +121,7 @@ s32 func_80066BA8(s32 viewPortIndex, s32 *upperLeftX, s32 *upperLeftY, s32 *lowe void func_80066C2C(s32 viewPortIndex, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4); void func_80066C80(s32 *arg0, s32 *arg1, s32 *arg2, s32 *arg3); void func_80066CDC(Gfx **dlist, s32 arg1); -void func_80067F20(f32 arg0); +void set_ortho_matrix_height(f32 value); void func_80067F2C(Gfx **dlist, s32 *arg1); void func_8006807C(Gfx **dlist, s32 *arg1); void func_80068158(Gfx **dlist, s32 arg1, s32 arg2, s32 arg3, s32 arg4); @@ -134,18 +137,18 @@ 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); void func_80069F28(f32 arg0); -void func_8006A03C(f32 *mtx); +UNUSED void debug_print_float_matrix_values(f32 *mtx); OSMesgQueue *func_8006A100(void); -void func_8006A434(void); -void func_8006A458(s8 *activePlayers); -u8 func_8006A4F8(s32 arg0); -void func_8006A50C(void); -u16 get_buttons_held_from_player(s32 arg0); -u16 get_buttons_pressed_from_player(s32 arg0); -u16 func_8006A578(s32 arg0); -s32 func_8006A59C(s32 arg0); -s32 func_8006A5E0(s32 arg0); -s32 func_8006A624(s8 arg0); +void initialise_player_ids(void); +void assign_player_ids(s8 *activePlayers); +u8 get_player_id(s32 player); +void swap_player_1_and_2_ids(void); +u16 get_buttons_held_from_player(s32 player); +u16 get_buttons_pressed_from_player(s32 player); +UNUSED u16 get_buttons_released_from_player(s32 player); +s32 clamp_joystick_x_axis(s32 player); +s32 clamp_joystick_y_axis(s32 player); +s32 clamp_joystick(s8 stickMag); void disable_button_mask(void); // Non Matching diff --git a/src/controller_pak.c b/src/controller_pak.c index ce0334fc..42b11312 100644 --- a/src/controller_pak.c +++ b/src/controller_pak.c @@ -83,7 +83,7 @@ u8 func_80072250(s32 arg0) { if ((arg0 == 0 || arg0 == 1) && func_8000E158()) { arg0 = 1 - arg0; } - return func_8006A4F8(arg0); + return get_player_id(arg0); } void func_80072298(u8 arg0) { diff --git a/src/fade_transition.c b/src/fade_transition.c index 46415cdd..e96cf9fb 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -26,7 +26,7 @@ VertexList *sTransitionVtx[2] = { NULL, NULL }; TriangleList *sTransitionTris[2] = { NULL, NULL }; s32 sTransitionTaskNum[2] = { 0, 0 }; // The second index goes unused. Is it even an array at all? -Gfx dl_fade_transition_settings[] = { +Gfx dTransitionFadeSettings[] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetTextureLOD(G_TL_TILE), @@ -173,7 +173,7 @@ TriangleList D_800E3554[244] = { 0, 0, 0, 0, }; -Gfx dl_transition_shape_settings[] = { +Gfx dTransitionShapeSettings[] = { gsDPPipeSync(), gsSPClearGeometryMode(G_FOG), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -334,15 +334,19 @@ s32 handle_transitions(s32 updateRate) { return sTransitionStatus; } +/** + * The rendering portion of transitions. + * First establishes an orthogonal matrix, then renders a transition effect onscreen. + */ void render_fade_transition(s32 dlist, s32 arg1, s32 arg2) { if (sTransitionStatus != TRANSITION_NONE) { if (osTvType == TV_TYPE_PAL) { - func_80067F20(1.4f); + set_ortho_matrix_height(1.4f); } else { - func_80067F20(1.2f); + set_ortho_matrix_height(1.2f); } func_80067F2C(dlist, arg1); - func_80067F20(1.0f); + set_ortho_matrix_height(1.0f); switch (gCurFaceTransition) { case FADE_FULLSCREEN: render_fade_fullscreen(dlist, arg1, arg2); @@ -402,7 +406,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0834.s") void render_fade_fullscreen(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 arg2) { s32 screenSize = get_video_width_and_height_as_s32(); - gSPDisplayList((*dlist)++, dl_fade_transition_settings); + gSPDisplayList((*dlist)++, dTransitionFadeSettings); gDPSetPrimColor((*dlist)++, 0, 0, gCurFadeRed, gCurFadeGreen, gCurFadeBlue, gCurFadeAlpha); gDPSetCombineMode((*dlist)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPFillRectangle((*dlist)++, 0, 0, screenSize & 0x3FF, (screenSize >> 16) & 0x3FF); @@ -414,7 +418,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1130.s") void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 arg2) { func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, dl_transition_shape_settings); + gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. gDkrVertices((*dlist)++, (s32)sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000, (((s32)sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000) & 6) | 0x58, 0x70); gDkrTriangles((*dlist)++, (s32)sTransitionTris[sTransitionTaskNum[0]] + 0x80000000, 8, TRIN_DISABLE_TEXTURE); @@ -424,7 +428,7 @@ void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 ar // This is exactly the same as render_fade_barndoor_horizontal; I wonder what gets changed then? void render_fade_barndoor_vertical(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 arg2) { func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, dl_transition_shape_settings); + gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. gDkrVertices((*dlist)++, (s32)sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000, (((s32)sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000) & 6) | 0x58, 0x70); gDkrTriangles((*dlist)++, (s32)sTransitionTris[sTransitionTaskNum[0]] + 0x80000000, 8, TRIN_DISABLE_TEXTURE); @@ -438,7 +442,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1EE8.s") void render_fade_circle(Gfx **dlist, s32 arg1, s32 arg2) { u8 *addr, *addr2; func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, dl_transition_shape_settings); + gSPDisplayList((*dlist)++, dTransitionShapeSettings); addr = (sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000); addr2 = (sTransitionTris[sTransitionTaskNum[0]] + 0x80000000); gDkrVertices((*dlist)++, (s32)addr, ((s32)addr & 6) | 0x88, 0xA6); @@ -465,7 +469,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_circle.s") void render_fade_waves(Gfx **dlist, s32 arg1, s32 arg2) { s32 i; func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, dl_transition_shape_settings); + gSPDisplayList((*dlist)++, dTransitionShapeSettings); for(i = 0; i < 6; i++) { s32 index = sTransitionTaskNum[0] + i; if(i != 1 && i != 4) { @@ -484,7 +488,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_waves.s") void render_fade_barndoor_diagonal(Gfx **dlist, s32 arg1, s32 arg2) { func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, dl_transition_shape_settings); + gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. gDkrVertices((*dlist)++, (s32)sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000, (((s32)sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000) & 6) | 0x48, 0x5E); gDkrTriangles((*dlist)++, (s32)sTransitionTris[sTransitionTaskNum[0]] + 0x80000000, 6, TRIN_DISABLE_TEXTURE); @@ -525,7 +529,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C27A0.s") void render_fade_disabled(Gfx **dlist, s32 arg1, s32 arg2) { s32 screenSize = get_video_width_and_height_as_s32(); - gSPDisplayList((*dlist)++, dl_fade_transition_settings); + gSPDisplayList((*dlist)++, dTransitionFadeSettings); gDPSetPrimColor((*dlist)++, 0, 0, (gLastFadeRed >> 16), (gLastFadeGreen >> 16), (gLastFadeBlue >> 16), 255); gDPSetCombineMode((*dlist)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPFillRectangle((*dlist)++, 0, 0, screenSize & 0x3FF, (screenSize >> 16) & 0x3FF); diff --git a/src/font.c b/src/font.c index 9566f369..f39915f3 100644 --- a/src/font.c +++ b/src/font.c @@ -7,7 +7,7 @@ /************ .data ************/ -Gfx dl_dialogue_box_begin[] = { +Gfx dDialogueBoxBegin[] = { gsDPPipeSync(), gsDPSetTextureLOD(G_TL_TILE), gsDPSetTextureLUT(G_TT_NONE), @@ -17,7 +17,7 @@ Gfx dl_dialogue_box_begin[] = { gsSPEndDisplayList(), }; -Gfx dl_dialogue_box_drawmodes[][2] = { +Gfx dDialogueBoxDrawModes[][2] = { { gsDPSetCombineMode(DKR_CC_UNK11, DKR_CC_UNK11), gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2), @@ -646,8 +646,8 @@ void render_dialogue_box(Gfx **dlist, Gfx *mat, VertexList *verts, s32 dialogueB // Render dialogue box background. if (dialogueBox->backgroundColourA != 0) { - gSPDisplayList((*dlist)++, dl_dialogue_box_begin); - gDkrDmaDisplayList((*dlist)++, ((u8 *)&dl_dialogue_box_drawmodes[1]) + 0x80000000, 2); + gSPDisplayList((*dlist)++, dDialogueBoxBegin); + gDkrDmaDisplayList((*dlist)++, ((u8 *)&dDialogueBoxDrawModes[1]) + 0x80000000, 2); gDPSetEnvColor((*dlist)++, 0, 0, 0, 0); if ((dialogueBox->x2 - dialogueBox->x1) < 10 || (dialogueBox->y2 - dialogueBox->y1) < 10) { render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y1 - 2, dialogueBox->x2 + 2, dialogueBox->y2 + 2); diff --git a/src/menu.c b/src/menu.c index 12e6512a..f7dcdc71 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1787,7 +1787,7 @@ void menu_init(u32 menuId) { /** * Runs every frame. Calls the loop function of the current menu id */ -s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4) { +s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 updateRate) { s32 sp1C; D_801263A0 = *arg0; @@ -1797,64 +1797,64 @@ s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4) { update_controller_sticks(); switch (gCurrentMenuId) { case MENU_LOGOS: - sp1C = menu_logo_screen_loop(arg4); + sp1C = menu_logo_screen_loop(updateRate); break; case MENU_TITLE: - sp1C = menu_title_screen_loop(arg4); + sp1C = menu_title_screen_loop(updateRate); break; case MENU_OPTIONS: - sp1C = menu_options_loop(arg4); + sp1C = menu_options_loop(updateRate); break; case MENU_AUDIO_OPTIONS: - sp1C = menu_audio_options_loop(arg4); + sp1C = menu_audio_options_loop(updateRate); break; case MENU_SAVE_OPTIONS: - sp1C = menu_save_options_loop(arg4); + sp1C = menu_save_options_loop(updateRate); break; case MENU_MAGIC_CODES: - sp1C = menu_magic_codes_loop(arg4); + sp1C = menu_magic_codes_loop(updateRate); break; case MENU_MAGIC_CODES_LIST: - sp1C = menu_magic_codes_list_loop(arg4); + sp1C = menu_magic_codes_list_loop(updateRate); break; case MENU_CHARACTER_SELECT: - sp1C = menu_character_select_loop(arg4); + sp1C = menu_character_select_loop(updateRate); break; case MENU_FILE_SELECT: - sp1C = menu_file_select_loop(arg4); + sp1C = menu_file_select_loop(updateRate); break; case MENU_GAME_SELECT: - sp1C = menu_game_select_loop(arg4); + sp1C = menu_game_select_loop(updateRate); break; case MENU_TRACK_SELECT: - sp1C = menu_track_select_loop(arg4); + sp1C = menu_track_select_loop(updateRate); break; case MENU_UNKNOWN_5: - sp1C = menu_5_loop(arg4); + sp1C = menu_5_loop(updateRate); break; case MENU_RESULTS: - sp1C = menu_results_loop(arg4); + sp1C = menu_results_loop(updateRate); break; case MENU_TROPHY_RACE_ROUND: - sp1C = menu_trophy_race_round_loop(arg4); + sp1C = menu_trophy_race_round_loop(updateRate); break; case MENU_TROPHY_RACE_RANKINGS: - sp1C = menu_trophy_race_rankings_loop(arg4); + sp1C = menu_trophy_race_rankings_loop(updateRate); break; case MENU_UNKNOWN_23: - sp1C = menu_23_loop(arg4); + sp1C = menu_23_loop(updateRate); break; case MENU_GHOST_DATA: - sp1C = menu_ghost_data_loop(arg4); + sp1C = menu_ghost_data_loop(updateRate); break; case MENU_CREDITS: - sp1C = menu_credits_loop(arg4); + sp1C = menu_credits_loop(updateRate); break; case MENU_BOOT: - sp1C = menu_boot_loop(arg4); + sp1C = menu_boot_loop(updateRate); break; case MENU_CAUTION: - sp1C = menu_caution_loop(arg4); + sp1C = menu_caution_loop(updateRate); break; } *arg0 = (Gfx *)D_801263A0; @@ -2173,7 +2173,7 @@ void menu_logos_screen_init(void) { func_80066818(0, 1); } -s32 menu_logo_screen_loop(s32 arg0) { +s32 menu_logo_screen_loop(s32 updateRate) { s32 phi_v0; // sp24? s32 yOffset; // sp28 s32 sp20; @@ -2184,14 +2184,14 @@ s32 menu_logo_screen_loop(s32 arg0) { func_800C01D8(&D_800E1DE8); gMenuDelay = 1; } - D_80126450 -= arg0 / 50.0f; + D_80126450 -= updateRate / 50.0f; } else { yOffset = 0; if (D_80126450 < 2.17f && gMenuDelay == 0) { func_800C01D8(&D_800E1DE8); gMenuDelay = 1; } - D_80126450 -= arg0 / 60.0f; + D_80126450 -= updateRate / 60.0f; } if (D_80126450 <= 0.0f) { func_80066894(0, 0); @@ -2262,7 +2262,7 @@ void menu_title_screen_init(void) { gSaveFileIndex = 0; gTitleScreenCurrentOption = 0; gNumberOfActivePlayers = 4; - func_8006A434(); + initialise_player_ids(); play_music(1); D_800DF760 = musicGetRelativeVolume(); if (D_800DF458 != 0) { @@ -2392,7 +2392,7 @@ s32 menu_options_loop(s32 arg0) { if ((buttonsPressed & B_BUTTON) || ((buttonsPressed & (A_BUTTON | START_BUTTON)) && D_800DF460 == 5)) { // Leave the option menu - func_80000C98(-0x80); + set_music_fade_timer(-0x80); gMenuDelay = -1; func_800C01D8(&D_800DF774); func_80001D04(0x241, 0); @@ -2537,7 +2537,7 @@ s32 menu_audio_options_loop(s32 arg0) { // Check all 4 controllers for inputs for (i = 0; i < 4; i++) { buttonInputs |= get_buttons_pressed_from_player(i); - phi_a2 += func_8006A59C(i); + phi_a2 += clamp_joystick_x_axis(i); contY += gControllersYAxisDirection[i]; contX += gControllersXAxisDirection[i]; } @@ -2558,7 +2558,7 @@ s32 menu_audio_options_loop(s32 arg0) { gMenuDelay = -1; func_800C01D8(&D_800DF774); if (D_801263D8 >= 0) { - func_80000C98(-0x80); + set_music_fade_timer(-0x80); } sp30 = 3; } else if (contY < 0 && gOptionsMenuItemIndex < D_801263E0 - 1) { @@ -2661,7 +2661,7 @@ void func_800851FC(void) { if (D_801263D8 >= 0) { set_music_player_voice_limit(0x18); play_music(0x18); - func_80000C98(0x100); + set_music_fade_timer(0x100); func_80000B18(); } func_8009C4A8(D_800DFA2C); @@ -3413,7 +3413,7 @@ void menu_character_select_init(void) { u8 *temp; breakTheLoop = FALSE; - func_8006A434(); + initialise_player_ids(); if (is_drumstick_unlocked()) { if (is_tt_unlocked()) { D_801263CC = D_800DFF40; @@ -3545,14 +3545,14 @@ GLOBAL_ASM("asm/non_matchings/menu/menu_character_select_loop.s") void func_8008C128(void); -s32 menu_character_select_loop(s32 arg0) { +s32 menu_character_select_loop(s32 updateRate) { s32 i; s32 phi_a0; s32 phi_t3; s8 activePlayers[4]; - draw_character_select_text(arg0); - func_8008C168(arg0); + draw_character_select_text(updateRate); + func_8008C168(updateRate); func_8008E4EC(); for (i = 0; i < 4; i++) { @@ -3574,7 +3574,7 @@ s32 menu_character_select_loop(s32 arg0) { } return 0; // This return needs to be here. } else if (gMenuDelay > 0) { - gMenuDelay += arg0; + gMenuDelay += updateRate; if (gMenuDelay >= 0x1F) { phi_t3 = 0; if (D_800DFFD0 == 0) { @@ -3594,7 +3594,7 @@ s32 menu_character_select_loop(s32 arg0) { } } randomize_ai_racer_slots(phi_a0); - func_8006A458(gActivePlayersArray); + assign_player_ids(gActivePlayersArray); gIsInTracksMode = 1; if (phi_t3 >= gNumberOfActivePlayers) { @@ -3613,7 +3613,7 @@ s32 menu_character_select_loop(s32 arg0) { } } } else if (gMenuDelay < 0) { - gMenuDelay -= arg0; + gMenuDelay -= updateRate; if (gMenuDelay < -0x1E) { func_80000B28(); func_8008C128(); @@ -3675,9 +3675,9 @@ void menu_caution_init(void) { gPlayerHasSeenCautionMenu = 1; } -s32 menu_caution_loop(s32 arg0) { +s32 menu_caution_loop(s32 updateRate) { if (gMenuDelay != 0) { - gMenuDelay += arg0; + gMenuDelay += updateRate; } else if (gIgnorePlayerInput <= 0 && (get_buttons_pressed_from_player(0) & (A_BUTTON | B_BUTTON | START_BUTTON))) { func_80001D04(0xEF, NULL); gMenuDelay = 1; @@ -3691,7 +3691,7 @@ s32 menu_caution_loop(s32 arg0) { menu_init(MENU_GAME_SELECT); } if (gIgnorePlayerInput > 0) { - gIgnorePlayerInput -= arg0; + gIgnorePlayerInput -= updateRate; } return 0; } @@ -3854,7 +3854,7 @@ s32 menu_game_select_loop(s32 arg0) { } if (playerInputs & (A_BUTTON | START_BUTTON)) { if (D_800DF460 == D_801263E0) { - func_80000C98(-0x80); + set_music_fade_timer(-0x80); } func_800C01D8(&D_800DF774); gMenuDelay = 1; @@ -4860,7 +4860,7 @@ void func_80094C14(s32 arg0) { switch (D_800DF460) { case 0: if (func_8000C8B4(0xF0) < D_801263D8) { - func_80000C98(-0x100); + set_music_fade_timer(-0x100); D_800DF460 = 1; } break; @@ -4868,7 +4868,7 @@ void func_80094C14(s32 arg0) { if (func_8000C8B4(0x12C) < D_801263D8) { set_music_player_voice_limit(0x18); play_music(0x18); - func_80000C98(0x100); + set_music_fade_timer(0x100); } break; } @@ -4972,7 +4972,7 @@ void menu_11_init(void) { func_800C01D8(&D_800DF77C); set_music_player_voice_limit(0x18); play_music(0x18); - func_80000C98(0x80); + set_music_fade_timer(0x80); } GLOBAL_ASM("asm/non_matchings/menu/func_80096978.s") @@ -5142,7 +5142,7 @@ void menu_trophy_race_round_init(void) { func_800C4170(2); set_music_player_voice_limit(0x18); play_music(0x18); - func_80000C98(0x100); + set_music_fade_timer(0x100); } #endif @@ -5618,8 +5618,8 @@ void update_controller_sticks(void) { for (i = 0; i < 4; i++) { prevXAxis = gControllersXAxis[i]; prevYAxis = gControllersYAxis[i]; - gControllersXAxis[i] = func_8006A59C(i); - gControllersYAxis[i] = func_8006A5E0(i); + gControllersXAxis[i] = clamp_joystick_x_axis(i); + gControllersYAxis[i] = clamp_joystick_y_axis(i); gControllersXAxisDirection[i] = 0; gControllersYAxisDirection[i] = 0; if (gControllersXAxis[i] < -STICK_DEADZONE && prevXAxis > -STICK_DEADZONE) { @@ -5806,7 +5806,12 @@ s32 get_number_of_active_players(void) { return gNumberOfActivePlayers; } -s32 func_8009C3D8(void) { +/** + * Returns the number of active players. + * However, it will explicitly return 2 players if you're on a track in 2 player adventure mode, + * as it would otherwise return 1. + */ +s32 get_active_player_count(void) { unk8006BDB0 *temp = (unk8006BDB0 *)get_current_level_header(); if (gIsInTwoPlayerAdventure && !gIsInTracksMode) { if (temp->unk4C == 0 || (temp->unk4C & 0x40) != 0) { diff --git a/src/menu.h b/src/menu.h index 862460c4..78ec1a24 100644 --- a/src/menu.h +++ b/src/menu.h @@ -751,7 +751,7 @@ s32 is_in_tracks_mode(void); void set_magic_code_flags(s32 flags); s32 get_filtered_cheats(void); s32 get_number_of_active_players(void); -s32 func_8009C3D8(void); +s32 get_active_player_count(void); s32 get_multiplayer_racer_count(void); Settings** func_8009C490(void); void func_8009C49C(void); diff --git a/src/printf.c b/src/printf.c index 4960bc73..a2b6d427 100644 --- a/src/printf.c +++ b/src/printf.c @@ -30,7 +30,7 @@ u8 D_800E2EF4[196] = { 0x00, 0x00, 0x00, 0x00 }; -Gfx dl_debug_font_settings[] = { +Gfx dDebugFontSettings[] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetTextureLOD(G_TL_TILE), diff --git a/src/thread0_epc.c b/src/thread0_epc.c index 983f455b..35d1e1e8 100644 --- a/src/thread0_epc.c +++ b/src/thread0_epc.c @@ -9,6 +9,7 @@ #include "printf.h" #include "unknown_00BC20.h" #include "controller.h" +#include "unknown_06B2B0.h" /************ .rodata ************/ @@ -26,9 +27,9 @@ const u8 D_800E8EFC[4] = { 0, 0, 0, 0 }; /************ .data ************/ -s32 D_800E3020 = -1; -s32 D_800E3024 = 0; -s32 D_800E3028 = 0; +s32 sLockupStatus = -1; +s32 sLockupPage = 0; +s32 sLockupDelay = 0; char *D_800E302C[3] = { "setup", "control", "print" @@ -213,17 +214,17 @@ void func_800B76B8(s32 arg0, s32 arg1) { } //Called as a check to see if render_epc_lock_up_display should be called. -s32 get_crash_status(void) { +s32 get_lockup_status(void) { s32 fileNum; s32 controllerIndex = 0; - u8 *sp420[256]; - u8 *sp220[128]; + char *sp420[256]; + char *sp220[128]; u8 dataFromControllerPak[512]; - if (D_800E3020 != -1) { - return D_800E3020; + if (sLockupStatus != -1) { + return sLockupStatus; } else { - D_800E3020 = 0; + sLockupStatus = 0; if ((func_800758DC(controllerIndex) == 0) && //Rumble pack check? (func_800764E8(controllerIndex, &D_800E8EF4, &D_800E8EFC, &fileNum) == 0) && (read_data_from_controller_pak(controllerIndex, fileNum, (u8 *)&dataFromControllerPak, @@ -231,21 +232,21 @@ s32 get_crash_status(void) { bcopy(&dataFromControllerPak, &gEpcInfo, sizeof(dataFromControllerPak) - 80); //Why less 80 (0x50)? bcopy(&sp220, &D_801299B0, sizeof(sp220)); bcopy(&sp420, &D_80129BB0, sizeof(sp420)); - D_800E3020 = 1; + sLockupStatus = 1; } func_80075AEC(controllerIndex); - if (D_800E3020 != 0) { + if (sLockupStatus) { func_800762C8(controllerIndex, fileNum); } - return D_800E3020; + return sLockupStatus; } } -void func_800B77D4(s32 updateRate) { - D_800E3028 += updateRate; - if (D_800E3028 >= 0x3D) { - D_800E3028 = 0; - D_800E3024++; +void lockup_screen_loop(s32 updateRate) { + sLockupDelay += updateRate; + if (sLockupDelay >= 61) { + sLockupDelay = 0; + sLockupPage++; } } @@ -265,7 +266,7 @@ void render_epc_lock_up_display(void) { set_render_printf_position(0x10, 0x20); - switch (D_800E3024) { + switch (sLockupPage) { case 0: D_80129FB0[0] = gEpcInfo.unk130; D_80129FB0[1] = gEpcInfo.unk134; @@ -332,7 +333,7 @@ void render_epc_lock_up_display(void) { } break; case 5: - D_800E3024 = 0; + sLockupPage = 0; break; } } diff --git a/src/thread0_epc.h b/src/thread0_epc.h index 589019d8..5091318e 100644 --- a/src/thread0_epc.h +++ b/src/thread0_epc.h @@ -77,8 +77,8 @@ void func_800B6F40(s32 arg0, s32 arg1, s32 arg2); void func_800B70D0(void); void func_800B7144(void); void func_800B76B8(s32 arg0, s32 arg1); -s32 get_crash_status(void); -void func_800B77D4(s32 arg0); +s32 get_lockup_status(void); +void lockup_screen_loop(s32 arg0); void func_800B6F50(void); // Non Matching void thread0_Main(s32 arg0); // Non Matching diff --git a/src/unknown_003260.c b/src/unknown_003260.c index 0ced63bb..ada655a2 100644 --- a/src/unknown_003260.c +++ b/src/unknown_003260.c @@ -58,7 +58,7 @@ s32 D_800DC6B4 = 0; // Currently unknown, might be a different type. unk800DC6BC_40 *D_800DC6B8 = NULL; unk800DC6BC *gAlSndPlayer = &D_80119BD0; -s32 sfxVolumeSlider = 0x100; +s32 sfxVolumeSlider = 256; s32 D_800DC6C4 = 0; // Currently unknown, might be a different type. /*******************************/ @@ -265,23 +265,26 @@ ALDMAproc __amDmaNew(AMDMAState **state) { GLOBAL_ASM("asm/non_matchings/unknown_003260/func_80003040.s") -void set_sfx_volume_slider(u32 arg0) { - if (arg0 > 256) { - arg0 = 256; +void set_sfx_volume_slider(u32 volume) { + if (volume > 256) { + volume = 256; } - sfxVolumeSlider = arg0; + sfxVolumeSlider = volume; } s32 sfxGetVolumeSlider(void) { return sfxVolumeSlider; } -void func_8000318C(s32 arg0) { - if (gAlSndPlayer->unk44 >= arg0) { - gAlSndPlayer->unk48 = arg0; +/** + * Sets the number of active sound channels to either the passed number, or the maximum amount, whichever's lower. + */ +void set_sound_channel_count(s32 numChannels) { + if (gAlSndPlayer->soundChannelsMax >= numChannels) { + gAlSndPlayer->soundChannels = numChannels; } else { - gAlSndPlayer->unk48 = gAlSndPlayer->unk44; + gAlSndPlayer->soundChannels = gAlSndPlayer->soundChannelsMax; } } @@ -290,8 +293,8 @@ void alSndPNew(audioMgrConfig *c) { unk800DC6BC_40 *tmp1; ALEvent sp_38; - gAlSndPlayer->unk44 = c->maxChannels; - gAlSndPlayer->unk48 = c->maxChannels; + gAlSndPlayer->soundChannelsMax = c->maxChannels; + gAlSndPlayer->soundChannels = c->maxChannels; gAlSndPlayer->unk3C = 0; gAlSndPlayer->frameTime = 33000; gAlSndPlayer->unk40 = (unk800DC6BC_40 *)alHeapDBAlloc(0, 0, c->hp, 1, (c->unk00) << 6); diff --git a/src/unknown_003260.h b/src/unknown_003260.h index 42ad6c2d..e65d2f78 100644 --- a/src/unknown_003260.h +++ b/src/unknown_003260.h @@ -34,8 +34,8 @@ typedef struct unk800DC6BC { ALSynth *drvr; u32 unk3C; unk800DC6BC_40 *unk40; - s32 unk44; - s32 unk48; + s32 soundChannelsMax; + s32 soundChannels; s32 frameTime; ALMicroTime nextDelta; ALMicroTime curTime; @@ -113,7 +113,7 @@ void audioStartThread(void); void audioStopThread(void); void set_sfx_volume_slider(u32 arg0); s32 sfxGetVolumeSlider(void); -void func_8000318C(s32 arg0); +void set_sound_channel_count(s32 arg0); void alSndPNew(audioMgrConfig *c); void func_80004604(u8 *arg0, u8 arg1); u8 func_8000461C(u8 *arg0); diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 90aca06b..253c8826 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -78,7 +78,7 @@ char *D_800DD334[6] = { // Unused char gBuildString[40] = "Version 7.7 29/09/97 15.00 L.Schuneman"; -s8 D_800DD374 = 0; +s8 sAntiPiracyTriggered = 0; s32 D_800DD378 = 1; s32 D_800DD37C = 0; s32 D_800DD380 = 0; // Currently unknown, might be a different type. @@ -369,11 +369,11 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, noPlayers = FALSE; } if (numberOfPlayers == ONE_PLAYER) { - func_8000318C(8); + set_sound_channel_count(8); } else if (numberOfPlayers == TWO_PLAYERS) { - func_8000318C(12); + set_sound_channel_count(12); } else { - func_8000318C(16); + set_sound_channel_count(16); } settings = get_settings(); @@ -549,13 +549,13 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, } func_8001E450(cutsceneId); func_800249F0(gCurrentLevelHeader->geometry, gCurrentLevelHeader->skybox, numberOfPlayers, vehicleId, entranceId, gCurrentLevelHeader->collectables, gCurrentLevelHeader->unkBA); - if (gCurrentLevelHeader->unk3A == 0 && gCurrentLevelHeader->unk3C == 0 && gCurrentLevelHeader->fogR == 0 && gCurrentLevelHeader->fogG == 0 && gCurrentLevelHeader->fogB == 0) { + if (gCurrentLevelHeader->fogNear == 0 && gCurrentLevelHeader->fogFar == 0 && gCurrentLevelHeader->fogR == 0 && gCurrentLevelHeader->fogG == 0 && gCurrentLevelHeader->fogB == 0) { for (i = 0; i < 4; i++) { func_800307BC(i); } } else { for (i = 0; i < 4; i++) { - func_80030664(i, gCurrentLevelHeader->unk3A, gCurrentLevelHeader->unk3C, (u8)gCurrentLevelHeader->fogR, gCurrentLevelHeader->fogG, gCurrentLevelHeader->fogB); + func_80030664(i, gCurrentLevelHeader->fogNear, gCurrentLevelHeader->fogFar, (u8)gCurrentLevelHeader->fogR, gCurrentLevelHeader->fogG, gCurrentLevelHeader->fogB); } } settings = get_settings(); @@ -816,9 +816,9 @@ void init_game(void) { init_main_memory_pool(); func_800C6170(); - D_800DD374 = TRUE; - if (func_8006F4EC() != 0) { - D_800DD374 = FALSE; + sAntiPiracyTriggered = TRUE; + if (check_imem_validity()) { + sAntiPiracyTriggered = FALSE; } D_80123514 = FALSE; D_80123518 = 0; @@ -873,7 +873,6 @@ void init_game(void) { * The main gameplay loop. * Contains all game logic, audio and graphics processing. */ - void main_game_loop(void) { s32 debugLoopCounter; s32 framebufferSize; @@ -910,7 +909,7 @@ void main_game_loop(void) { init_rdp_and_framebuffer(&gCurrDisplayList); render_background(&gCurrDisplayList, &gCurrHudMat, 1); D_800DD37C = func_8006A1C4(D_800DD37C, sLogicUpdateRate); - if (get_crash_status()) { + if (get_lockup_status()) { render_epc_lock_up_display(); sRenderContext = DRAW_CRASH_SCREEN; } @@ -935,14 +934,14 @@ void main_game_loop(void) { func_8006CCF0(sLogicUpdateRate); break; case DRAW_CRASH_SCREEN: // EPC (lockup display) - func_800B77D4(sLogicUpdateRate); + lockup_screen_loop(sLogicUpdateRate); break; } // This is a good spot to place custom text if you want it to overlay it over ALL the // menus & gameplay. - process_audio(sLogicUpdateRate); + handle_music_fade(sLogicUpdateRate); print_debug_strings(&gCurrDisplayList); render_dialogue_boxes(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); close_dialogue_box(4); @@ -1047,11 +1046,11 @@ void func_8006CCF0(s32 updateRate) { buttonHeldInputs = 0; buttonPressedInputs = 0; - for (i = 0; i < func_8009C3D8(); i++) { + for (i = 0; i < get_active_player_count(); i++) { buttonHeldInputs |= get_buttons_held_from_player(i); buttonPressedInputs |= get_buttons_pressed_from_player(i); } - if (D_800DD374) { + if (sAntiPiracyTriggered) { buttonPressedInputs |= START_BUTTON; } if (!gIsPaused) { @@ -1431,9 +1430,9 @@ void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId) { func_8006ECFC(0); sRenderContext = DRAW_MENU; D_801234F0 = 1; - func_80004A60(0, 0x7FFF); - func_80004A60(1, 0x7FFF); - func_80004A60(2, 0x7FFF); + func_80004A60(0, 32767); + func_80004A60(1, 32767); + func_80004A60(2, 32767); func_80065EA0(); if (!D_80123514) { @@ -1493,13 +1492,13 @@ void func_8006DBE4(void) { D_80123514 = FALSE; } -void func_8006DC58(s32 arg0) { +void func_8006DC58(s32 updateRate) { if (get_thread30_level_id_to_load() == 0) { - func_80010994(arg0); + func_80010994(updateRate); gParticlePtrList_flush(); func_8001BF20(); - func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); - func_800C3440(arg0); + func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, updateRate); + func_800C3440(updateRate); init_rdp_and_framebuffer(&gCurrDisplayList); render_borders_for_multiplayer(&gCurrDisplayList); func_80077268(&gCurrDisplayList); @@ -1975,7 +1974,7 @@ void func_8006F398(void) { u8 *first_racer_data; u8 *second_racer_data; - func_8006A50C(); + swap_player_1_and_2_ids(); func_8000E194(); first_racer_data = (u8 *)(gSettingsPtr->racers); @@ -1995,7 +1994,6 @@ void func_8006F42C(void) { /** * Give the player 8 frames to enter the CPak menu with start, then load the intro sequence. */ - void pre_intro_loop(void) { s32 i; s32 buttonInputs = 0; @@ -2015,7 +2013,6 @@ void pre_intro_loop(void) { /** * Returns TRUE if the game doesn't detect any controllers. */ - s32 is_controller_missing(void) { if (sControllerStatus == CONTROLLER_MISSING) { return TRUE; @@ -2024,11 +2021,16 @@ s32 is_controller_missing(void) { } } -s32 func_8006F4EC(void) { - if (IO_READ(SP_IMEM_START) != - (SP_STATUS_HALT | SP_STATUS_BROKE | SP_STATUS_DMA_BUSY | SP_STATUS_IO_FULL | SP_STATUS_INTR_BREAK | SP_STATUS_YIELD | - SP_STATUS_YIELDED | SP_STATUS_TASKDONE | SP_STATUS_TASKDONE | SP_STATUS_RSPSIGNAL | SP_STATUS_SIG5)) { - return 0; +/** + * Ran on boot, will make sure the CIC chip (CIC6103) is to spec. Will return true if it's all good, otherwise it returns false. + * The intention of this function, is an attempt to check that the cartridge is a legitimate copy. + * A false read, meaning you're caught running an illegitimate copy, will force the game to pause when you enter the world. + */ +s32 check_imem_validity(void) { + /*(SP_STATUS_HALT | SP_STATUS_BROKE | SP_STATUS_DMA_BUSY | SP_STATUS_IO_FULL | SP_STATUS_INTR_BREAK | SP_STATUS_YIELD | + SP_STATUS_YIELDED | SP_STATUS_TASKDONE | SP_STATUS_TASKDONE | SP_STATUS_RSPSIGNAL | SP_STATUS_SIG5))*/ + if (IO_READ(SP_IMEM_START) != 0x17D7) { + return FALSE; } - return 1; + return TRUE; } diff --git a/src/unknown_06B2B0.h b/src/unknown_06B2B0.h index c59f919b..ce69ca8a 100644 --- a/src/unknown_06B2B0.h +++ b/src/unknown_06B2B0.h @@ -32,11 +32,12 @@ enum NumberOfPlayers { FOUR_PLAYERS = 3 }; -#define NUMBER_OF_VEHICLE_TYPES 3 enum Vehicle { VEHICLE_CAR, VEHICLE_HOVERCRAFT, - VEHICLE_PLANE + VEHICLE_PLANE, + + NUMBER_OF_VEHICLE_TYPES, }; enum RaceType { @@ -68,7 +69,7 @@ extern char *D_800DD334[6]; // Unused? extern char gBuildString[40]; -extern s8 D_800DD374; +extern s8 sAntiPiracyTriggered; extern s32 D_800DD378; extern s32 D_800DD37C; extern s32 D_800DD380; @@ -183,7 +184,7 @@ void func_8006F398(void); void func_8006F42C(void); void pre_intro_loop(void); s32 is_controller_missing(void); -s32 func_8006F4EC(void); +s32 check_imem_validity(void); //Non Matching void func_8006ECFC(s32 numberOfPlayers); diff --git a/src/unknown_078050.c b/src/unknown_078050.c index de0258bf..9387e3fb 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -29,7 +29,7 @@ s32 D_800DE4D4 = 0; s32 D_800DE4D8 = 0; s32 D_800DE4DC = 0; -Gfx dl_rsp_init[] = { +Gfx dRspInit[] = { gsSPClearGeometryMode(0x001F3204), gsSPTexture(0, 0, 0, 0, 0), gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), @@ -38,7 +38,7 @@ Gfx dl_rsp_init[] = { }; // Default RDP settings -Gfx dl_rdp_init[] = { +Gfx dRdpInit[] = { gsDPSetCycleType(G_CYC_1CYCLE), gsDPPipelineMode(G_PM_1PRIMITIVE), gsDPSetTextureLOD(G_TL_TILE), @@ -270,11 +270,11 @@ void init_rdp_and_framebuffer(Gfx **dlist) { s32 width = get_video_width_and_height_as_s32() & 0xFFF; gDPSetColorImage((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, 0x01000000); gDPSetDepthImage((*dlist)++, 0x2000000); - gSPDisplayList((*dlist)++, dl_rdp_init); + gSPDisplayList((*dlist)++, dRdpInit); } void init_rsp(Gfx **dlist) { - gSPDisplayList((*dlist)++, dl_rsp_init); + gSPDisplayList((*dlist)++, dRspInit); } void func_80078100(OSSched *sc) { diff --git a/src/video.c b/src/video.c index 77287961..78c82a63 100644 --- a/src/video.c +++ b/src/video.c @@ -308,8 +308,12 @@ void func_8007AB24(s8 arg0) { D_801262E4 = arg0; } -// Unused? -s32 func_8007AB34(void) { +/** + * Unused function that returns the refresh rate, after performance. + * A fully performant game would return 60. + * Perhaps may have been used originally to calculate the factor in which to handle frameskipping with. + */ +UNUSED s32 get_video_refresh_speed(void) { return (s32)((f32)gVideoRefreshRate / (f32)D_80126309); } diff --git a/src/video.h b/src/video.h index 3c3972b1..f80c53c6 100644 --- a/src/video.h +++ b/src/video.h @@ -74,7 +74,7 @@ void init_vi_settings(void); void init_framebuffer(s32 index); void func_8007A974(void); void func_8007AB24(s8 arg0); -s32 func_8007AB34(void); +s32 get_video_refresh_speed(void); void swap_framebuffers(void); void memory_copy(u8 *src, u8 *dest, s32 len);