diff --git a/asm/bss_credits.s b/asm/bss_credits.s index ca06ae550..518638804 100644 --- a/asm/bss_credits.s +++ b/asm/bss_credits.s @@ -29,7 +29,7 @@ glabel D_802874D4 glabel D_802874D8 .skip 8 -glabel D_802874E0 +glabel sActorTimer .skip 20 glabel D_802874F4 @@ -41,7 +41,7 @@ glabel D_802874F5 glabel D_802874F6 .skip 2 -glabel D_802874F8 +glabel sPodiumActorList .skip 4 glabel D_802874FC diff --git a/asm/non_matchings/code_80057C60/func_8006BB34.s b/asm/non_matchings/code_80057C60/render_balloon.s similarity index 99% rename from asm/non_matchings/code_80057C60/func_8006BB34.s rename to asm/non_matchings/code_80057C60/render_balloon.s index 660e36d51..779b840f2 100644 --- a/asm/non_matchings/code_80057C60/func_8006BB34.s +++ b/asm/non_matchings/code_80057C60/render_balloon.s @@ -10,7 +10,7 @@ glabel D_800E4994 .section .text -glabel func_8006BB34 +glabel render_balloon /* 06C734 8006BB34 27BDFEB8 */ addiu $sp, $sp, -0x148 /* 06C738 8006BB38 3C18800E */ lui $t8, %hi(D_800E4974) # $t8, 0x800e /* 06C73C 8006BB3C AFBF0024 */ sw $ra, 0x24($sp) diff --git a/asm/non_matchings/staff_ghosts/func_80005B18.s b/asm/non_matchings/staff_ghosts/func_80005B18.s deleted file mode 100644 index 7f99bed81..000000000 --- a/asm/non_matchings/staff_ghosts/func_80005B18.s +++ /dev/null @@ -1,224 +0,0 @@ -glabel func_80005B18 -/* 006718 80005B18 3C04800E */ lui $a0, %hi(gModeSelection) # $a0, 0x800e -/* 00671C 80005B1C 8C84C53C */ lw $a0, %lo(gModeSelection)($a0) -/* 006720 80005B20 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 006724 80005B24 24030001 */ li $v1, 1 -/* 006728 80005B28 146400CC */ bne $v1, $a0, .L80005E5C -/* 00672C 80005B2C AFBF0014 */ sw $ra, 0x14($sp) -/* 006730 80005B30 3C088016 */ lui $t0, %hi(gLapCountByPlayerId) # $t0, 0x8016 -/* 006734 80005B34 25084390 */ addiu $t0, %lo(gLapCountByPlayerId) # addiu $t0, $t0, 0x4390 -/* 006738 80005B38 8D020000 */ lw $v0, ($t0) -/* 00673C 80005B3C 24060003 */ li $a2, 3 -/* 006740 80005B40 3C058016 */ lui $a1, %hi(D_80162DDC) # $a1, 0x8016 -/* 006744 80005B44 14C20072 */ bne $a2, $v0, .L80005D10 -/* 006748 80005B48 24A52DDC */ addiu $a1, %lo(D_80162DDC) # addiu $a1, $a1, 0x2ddc -/* 00674C 80005B4C 8CAE0000 */ lw $t6, ($a1) -/* 006750 80005B50 3C0F8016 */ lui $t7, %hi(D_80162DF8) # $t7, 0x8016 -/* 006754 80005B54 15C0006E */ bnez $t6, .L80005D10 -/* 006758 80005B58 00000000 */ nop -/* 00675C 80005B5C 8DEF2DF8 */ lw $t7, %lo(D_80162DF8)($t7) -/* 006760 80005B60 3C078016 */ lui $a3, %hi(D_80162DD4) # $a3, 0x8016 -/* 006764 80005B64 24E72DD4 */ addiu $a3, %lo(D_80162DD4) # addiu $a3, $a3, 0x2dd4 -/* 006768 80005B68 106F0069 */ beq $v1, $t7, .L80005D10 -/* 00676C 80005B6C 00000000 */ nop -/* 006770 80005B70 94F80000 */ lhu $t8, ($a3) -/* 006774 80005B74 3C198016 */ lui $t9, %hi(D_80162DCC) # $t9, 0x8016 -/* 006778 80005B78 54780023 */ bnel $v1, $t8, .L80005C08 -/* 00677C 80005B7C 8D0C0004 */ lw $t4, 4($t0) -/* 006780 80005B80 8F392DCC */ lw $t9, %lo(D_80162DCC)($t9) -/* 006784 80005B84 3C018016 */ lui $at, %hi(D_80162DD0) # $at, 0x8016 -/* 006788 80005B88 0C0014A9 */ jal func_800052A4 -/* 00678C 80005B8C AC392DD0 */ sw $t9, %lo(D_80162DD0)($at) -/* 006790 80005B90 3C058016 */ lui $a1, %hi(D_80162DDC) # $a1, 0x8016 -/* 006794 80005B94 3C078016 */ lui $a3, %hi(D_80162DD4) # $a3, 0x8016 -/* 006798 80005B98 24E72DD4 */ addiu $a3, %lo(D_80162DD4) # addiu $a3, $a3, 0x2dd4 -/* 00679C 80005B9C 24A52DDC */ addiu $a1, %lo(D_80162DDC) # addiu $a1, $a1, 0x2ddc -/* 0067A0 80005BA0 24030001 */ li $v1, 1 -/* 0067A4 80005BA4 A4E00000 */ sh $zero, ($a3) -/* 0067A8 80005BA8 ACA30000 */ sw $v1, ($a1) -/* 0067AC 80005BAC 3C02800E */ lui $v0, %hi(gPlayerOne) # $v0, 0x800e -/* 0067B0 80005BB0 8C42C4DC */ lw $v0, %lo(gPlayerOne)($v0) -/* 0067B4 80005BB4 3C018016 */ lui $at, %hi(D_80162DE0) # $at, 0x8016 -/* 0067B8 80005BB8 3C0B8019 */ lui $t3, %hi(D_8018CA78) # $t3, 0x8019 -/* 0067BC 80005BBC 94490254 */ lhu $t1, 0x254($v0) -/* 0067C0 80005BC0 8D6BCA78 */ lw $t3, %lo(D_8018CA78)($t3) -/* 0067C4 80005BC4 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 0067C8 80005BC8 AC292DE0 */ sw $t1, %lo(D_80162DE0)($at) -/* 0067CC 80005BCC 944A0254 */ lhu $t2, 0x254($v0) -/* 0067D0 80005BD0 3C018016 */ lui $at, %hi(D_80162DE8) # $at, 0x8016 -/* 0067D4 80005BD4 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 0067D8 80005BD8 AC2A2DE8 */ sw $t2, %lo(D_80162DE8)($at) -/* 0067DC 80005BDC 3C018016 */ lui $at, %hi(D_80162E00) # $at, 0x8016 -/* 0067E0 80005BE0 AC202E00 */ sw $zero, %lo(D_80162E00)($at) -/* 0067E4 80005BE4 3C018016 */ lui $at, %hi(D_80162DFC) # $at, 0x8016 -/* 0067E8 80005BE8 0C0016BA */ jal func_80005AE8 -/* 0067EC 80005BEC AC2B2DFC */ sw $t3, %lo(D_80162DFC)($at) -/* 0067F0 80005BF0 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 0067F4 80005BF4 0C0016BA */ jal func_80005AE8 -/* 0067F8 80005BF8 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 0067FC 80005BFC 10000098 */ b .L80005E60 -/* 006800 80005C00 8FBF0014 */ lw $ra, 0x14($sp) -/* 006804 80005C04 8D0C0004 */ lw $t4, 4($t0) -.L80005C08: -/* 006808 80005C08 3C0B802C */ lui $t3, %hi(D_802BFB80) # $t3, 0x802c -/* 00680C 80005C0C 256BFB80 */ addiu $t3, %lo(D_802BFB80) # addiu $t3, $t3, -0x480 -/* 006810 80005C10 10CC0020 */ beq $a2, $t4, .L80005C94 -/* 006814 80005C14 3C198016 */ lui $t9, %hi(D_80162DC8) # $t9, 0x8016 -/* 006818 80005C18 3C0D8016 */ lui $t5, %hi(D_80162DCC) # $t5, 0x8016 -/* 00681C 80005C1C 8DAD2DCC */ lw $t5, %lo(D_80162DCC)($t5) -/* 006820 80005C20 3C018016 */ lui $at, %hi(D_80162DD0) # $at, 0x8016 -/* 006824 80005C24 0C0014A9 */ jal func_800052A4 -/* 006828 80005C28 AC2D2DD0 */ sw $t5, %lo(D_80162DD0)($at) -/* 00682C 80005C2C 3C058016 */ lui $a1, %hi(D_80162DDC) # $a1, 0x8016 -/* 006830 80005C30 24A52DDC */ addiu $a1, %lo(D_80162DDC) # addiu $a1, $a1, 0x2ddc -/* 006834 80005C34 24030001 */ li $v1, 1 -/* 006838 80005C38 ACA30000 */ sw $v1, ($a1) -/* 00683C 80005C3C 3C02800E */ lui $v0, %hi(gPlayerOne) # $v0, 0x800e -/* 006840 80005C40 8C42C4DC */ lw $v0, %lo(gPlayerOne)($v0) -/* 006844 80005C44 3C0F8019 */ lui $t7, %hi(D_8018CA78) # $t7, 0x8019 -/* 006848 80005C48 8DEFCA78 */ lw $t7, %lo(D_8018CA78)($t7) -/* 00684C 80005C4C 944E0254 */ lhu $t6, 0x254($v0) -/* 006850 80005C50 3C018016 */ lui $at, %hi(D_80162DE0) # $at, 0x8016 -/* 006854 80005C54 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 006858 80005C58 AC2E2DE0 */ sw $t6, %lo(D_80162DE0)($at) -/* 00685C 80005C5C 3C018016 */ lui $at, %hi(D_80162DFC) # $at, 0x8016 -/* 006860 80005C60 AC2F2DFC */ sw $t7, %lo(D_80162DFC)($at) -/* 006864 80005C64 3C018016 */ lui $at, %hi(D_80162E00) # $at, 0x8016 -/* 006868 80005C68 AC202E00 */ sw $zero, %lo(D_80162E00)($at) -/* 00686C 80005C6C 94580254 */ lhu $t8, 0x254($v0) -/* 006870 80005C70 3C018016 */ lui $at, %hi(D_80162DE8) # $at, 0x8016 -/* 006874 80005C74 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 006878 80005C78 0C0016BA */ jal func_80005AE8 -/* 00687C 80005C7C AC382DE8 */ sw $t8, %lo(D_80162DE8)($at) -/* 006880 80005C80 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 006884 80005C84 0C0016BA */ jal func_80005AE8 -/* 006888 80005C88 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 00688C 80005C8C 10000074 */ b .L80005E60 -/* 006890 80005C90 8FBF0014 */ lw $ra, 0x14($sp) -.L80005C94: -/* 006894 80005C94 8F392DC8 */ lw $t9, %lo(D_80162DC8)($t9) -/* 006898 80005C98 3C0D8016 */ lui $t5, %hi(D_80162D84+0x2) # $t5, 0x8016 -/* 00689C 80005C9C 85AD2D86 */ lh $t5, %lo(D_80162D84+0x2)($t5) -/* 0068A0 80005CA0 00194BC0 */ sll $t1, $t9, 0xf -/* 0068A4 80005CA4 252A3000 */ addiu $t2, $t1, 0x3000 -/* 0068A8 80005CA8 014B6021 */ addu $t4, $t2, $t3 -/* 0068AC 80005CAC 3C018016 */ lui $at, %hi(D_80162D80) # $at, 0x8016 -/* 0068B0 80005CB0 AC2C2D80 */ sw $t4, %lo(D_80162D80)($at) -/* 0068B4 80005CB4 3C0E8016 */ lui $t6, %hi(D_80162DCC) # $t6, 0x8016 -/* 0068B8 80005CB8 8DCE2DCC */ lw $t6, %lo(D_80162DCC)($t6) -/* 0068BC 80005CBC 3C018016 */ lui $at, %hi(D_80162D84) # $at, 0x8016 -/* 0068C0 80005CC0 3C0F800E */ lui $t7, %hi(gPlayerOne) # $t7, 0x800e -/* 0068C4 80005CC4 8DEFC4DC */ lw $t7, %lo(gPlayerOne)($t7) -/* 0068C8 80005CC8 A42D2D84 */ sh $t5, %lo(D_80162D84)($at) -/* 0068CC 80005CCC 3C018016 */ lui $at, %hi(D_80162DD0) # $at, 0x8016 -/* 0068D0 80005CD0 AC2E2DD0 */ sw $t6, %lo(D_80162DD0)($at) -/* 0068D4 80005CD4 95F80254 */ lhu $t8, 0x254($t7) -/* 0068D8 80005CD8 3C018016 */ lui $at, %hi(D_80162DE8) # $at, 0x8016 -/* 0068DC 80005CDC 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 0068E0 80005CE0 AC382DE8 */ sw $t8, %lo(D_80162DE8)($at) -/* 0068E4 80005CE4 3C018016 */ lui $at, %hi(D_80162DD8) # $at, 0x8016 -/* 0068E8 80005CE8 A4202DD8 */ sh $zero, %lo(D_80162DD8)($at) -/* 0068EC 80005CEC A4E00000 */ sh $zero, ($a3) -/* 0068F0 80005CF0 ACA30000 */ sw $v1, ($a1) -/* 0068F4 80005CF4 0C0016BA */ jal func_80005AE8 -/* 0068F8 80005CF8 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 0068FC 80005CFC 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 006900 80005D00 0C0016BA */ jal func_80005AE8 -/* 006904 80005D04 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 006908 80005D08 10000055 */ b .L80005E60 -/* 00690C 80005D0C 8FBF0014 */ lw $ra, 0x14($sp) -.L80005D10: -/* 006910 80005D10 3C058016 */ lui $a1, %hi(D_80162DDC) # $a1, 0x8016 -/* 006914 80005D14 14C20015 */ bne $a2, $v0, .L80005D6C -/* 006918 80005D18 24A52DDC */ addiu $a1, %lo(D_80162DDC) # addiu $a1, $a1, 0x2ddc -/* 00691C 80005D1C 8CB90000 */ lw $t9, ($a1) -/* 006920 80005D20 3C098016 */ lui $t1, %hi(D_80162DF8) # $t1, 0x8016 -/* 006924 80005D24 17200011 */ bnez $t9, .L80005D6C -/* 006928 80005D28 00000000 */ nop -/* 00692C 80005D2C 8D292DF8 */ lw $t1, %lo(D_80162DF8)($t1) -/* 006930 80005D30 3C0D802C */ lui $t5, %hi(D_802BFB80) # $t5, 0x802c -/* 006934 80005D34 25ADFB80 */ addiu $t5, %lo(D_802BFB80) # addiu $t5, $t5, -0x480 -/* 006938 80005D38 1469000C */ bne $v1, $t1, .L80005D6C -/* 00693C 80005D3C 3C0A8016 */ lui $t2, %hi(D_80162DC8) # $t2, 0x8016 -/* 006940 80005D40 8D4A2DC8 */ lw $t2, %lo(D_80162DC8)($t2) -/* 006944 80005D44 3C0F8016 */ lui $t7, %hi(D_80162D84+0x2) # $t7, 0x8016 -/* 006948 80005D48 85EF2D86 */ lh $t7, %lo(D_80162D84+0x2)($t7) -/* 00694C 80005D4C 000A5BC0 */ sll $t3, $t2, 0xf -/* 006950 80005D50 256C3000 */ addiu $t4, $t3, 0x3000 -/* 006954 80005D54 018D7021 */ addu $t6, $t4, $t5 -/* 006958 80005D58 3C018016 */ lui $at, %hi(D_80162D80) # $at, 0x8016 -/* 00695C 80005D5C AC2E2D80 */ sw $t6, %lo(D_80162D80)($at) -/* 006960 80005D60 3C018016 */ lui $at, %hi(D_80162D84) # $at, 0x8016 -/* 006964 80005D64 A42F2D84 */ sh $t7, %lo(D_80162D84)($at) -/* 006968 80005D68 ACA30000 */ sw $v1, ($a1) -.L80005D6C: -/* 00696C 80005D6C 3C18800E */ lui $t8, %hi(gPlayerOne) # $t8, 0x800e -/* 006970 80005D70 8F18C4DC */ lw $t8, %lo(gPlayerOne)($t8) -/* 006974 80005D74 24010800 */ li $at, 2048 -/* 006978 80005D78 3C028016 */ lui $v0, %hi(D_80162DEC) # $v0, 0x8016 -/* 00697C 80005D7C 97190000 */ lhu $t9, ($t8) -/* 006980 80005D80 24422DEC */ addiu $v0, %lo(D_80162DEC) # addiu $v0, $v0, 0x2dec -/* 006984 80005D84 33290800 */ andi $t1, $t9, 0x800 -/* 006988 80005D88 5521000A */ bnel $t1, $at, .L80005DB4 -/* 00698C 80005D8C 8C4A0000 */ lw $t2, ($v0) -/* 006990 80005D90 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 006994 80005D94 0C0016BA */ jal func_80005AE8 -/* 006998 80005D98 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 00699C 80005D9C 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 0069A0 80005DA0 0C0016BA */ jal func_80005AE8 -/* 0069A4 80005DA4 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 0069A8 80005DA8 1000002D */ b .L80005E60 -/* 0069AC 80005DAC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0069B0 80005DB0 8C4A0000 */ lw $t2, ($v0) -.L80005DB4: -/* 0069B4 80005DB4 240D0064 */ li $t5, 100 -/* 0069B8 80005DB8 3C0E800E */ lui $t6, %hi(gActiveScreenMode) # $t6, 0x800e -/* 0069BC 80005DBC 254B0001 */ addiu $t3, $t2, 1 -/* 0069C0 80005DC0 29610065 */ slti $at, $t3, 0x65 -/* 0069C4 80005DC4 14200002 */ bnez $at, .L80005DD0 -/* 0069C8 80005DC8 AC4B0000 */ sw $t3, ($v0) -/* 0069CC 80005DCC AC4D0000 */ sw $t5, ($v0) -.L80005DD0: -/* 0069D0 80005DD0 54640023 */ bnel $v1, $a0, .L80005E60 -/* 0069D4 80005DD4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0069D8 80005DD8 8DCEC52C */ lw $t6, %lo(gActiveScreenMode)($t6) -/* 0069DC 80005DDC 3C078016 */ lui $a3, %hi(D_80162DD4) # $a3, 0x8016 -/* 0069E0 80005DE0 24E72DD4 */ addiu $a3, %lo(D_80162DD4) # addiu $a3, $a3, 0x2dd4 -/* 0069E4 80005DE4 55C0001E */ bnel $t6, $zero, .L80005E60 -/* 0069E8 80005DE8 8FBF0014 */ lw $ra, 0x14($sp) -/* 0069EC 80005DEC 94EF0000 */ lhu $t7, ($a3) -/* 0069F0 80005DF0 15E00009 */ bnez $t7, .L80005E18 -/* 0069F4 80005DF4 00000000 */ nop -/* 0069F8 80005DF8 8D180004 */ lw $t8, 4($t0) -/* 0069FC 80005DFC 10D80006 */ beq $a2, $t8, .L80005E18 -/* 006A00 80005E00 00000000 */ nop -/* 006A04 80005E04 0C0015F7 */ jal func_800057DC -/* 006A08 80005E08 00000000 */ nop -/* 006A0C 80005E0C 3C088016 */ lui $t0, %hi(gLapCountByPlayerId) # $t0, 0x8016 -/* 006A10 80005E10 25084390 */ addiu $t0, %lo(gLapCountByPlayerId) # addiu $t0, $t0, 0x4390 -/* 006A14 80005E14 24060003 */ li $a2, 3 -.L80005E18: -/* 006A18 80005E18 3C198016 */ lui $t9, %hi(D_80162DD4+0x2) # $t9, 0x8016 -/* 006A1C 80005E1C 97392DD6 */ lhu $t9, %lo(D_80162DD4+0x2)($t9) -/* 006A20 80005E20 17200006 */ bnez $t9, .L80005E3C -/* 006A24 80005E24 00000000 */ nop -/* 006A28 80005E28 8D090008 */ lw $t1, 8($t0) -/* 006A2C 80005E2C 10C90003 */ beq $a2, $t1, .L80005E3C -/* 006A30 80005E30 00000000 */ nop -/* 006A34 80005E34 0C001587 */ jal func_8000561C -/* 006A38 80005E38 00000000 */ nop -.L80005E3C: -/* 006A3C 80005E3C 3C0A800E */ lui $t2, %hi(gPlayerOne) # $t2, 0x800e -/* 006A40 80005E40 8D4AC4DC */ lw $t2, %lo(gPlayerOne)($t2) -/* 006A44 80005E44 954B0000 */ lhu $t3, ($t2) -/* 006A48 80005E48 316C0800 */ andi $t4, $t3, 0x800 -/* 006A4C 80005E4C 55800004 */ bnel $t4, $zero, .L80005E60 -/* 006A50 80005E50 8FBF0014 */ lw $ra, 0x14($sp) -/* 006A54 80005E54 0C001667 */ jal func_8000599C -/* 006A58 80005E58 00000000 */ nop -.L80005E5C: -/* 006A5C 80005E5C 8FBF0014 */ lw $ra, 0x14($sp) -.L80005E60: -/* 006A60 80005E60 27BD0018 */ addiu $sp, $sp, 0x18 -/* 006A64 80005E64 03E00008 */ jr $ra -/* 006A68 80005E68 00000000 */ nop diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 2c2456ce2..9016e634a 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -6267,7 +6267,7 @@ extern Vtx D_800E5250[]; /* unable to generate in extern Vtx D_800E5290[]; /* unable to generate initializer */ extern u8 D_800E52D0[]; /* unable to generate initializer */ -void func_8006BB34(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { +void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { Mat4 sp108; Vec3f spFC; Vec3s spF4; @@ -6319,7 +6319,7 @@ void func_8006BB34(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { D_80164AF0 += 1; } #else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006BB34.s") +GLOBAL_ASM("asm/non_matchings/code_80057C60/render_balloon.s") #endif void func_8006C0C8(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { diff --git a/src/code_80057C60.h b/src/code_80057C60.h index 821271b1d..b48c18dfe 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -197,7 +197,7 @@ void func_8006B8B4(Player*, s8); void func_8006B974(s32, s8, s8); void func_8006B9CC(Player*, s8); void func_8006BA94(Player*, s8, s8); -void func_8006BB34(Vec3f, f32, s16, s16); +void render_balloon(Vec3f, f32, s16, s16); void func_8006C0C8(Vec3f, f32, s32, s16); void func_8006C294(Vec3f, f32, s32, s16); diff --git a/src/code_80281C40.c b/src/code_80281C40.c index 0f6e3aba3..c3daae287 100644 --- a/src/code_80281C40.c +++ b/src/code_80281C40.c @@ -73,7 +73,7 @@ void func_80281D00(void) { gSPDisplayList(gDisplayListHead++, &D_00284F70); func_800212B4(); gSPDisplayList(gDisplayListHead++, &D_00284EE0); - func_80281438(); + update_actors_loop(); func_80058090(0); func_80021B0C(); gSPDisplayList(gDisplayListHead++, &D_00284EE0); diff --git a/src/podium_ceremony_actors.c b/src/podium_ceremony_actors.c index 3bda653d0..22e43de7b 100644 --- a/src/podium_ceremony_actors.c +++ b/src/podium_ceremony_actors.c @@ -39,106 +39,83 @@ s32 fireworkColour[] = { u16 sRandomSeed16 = 0; -UnkStruct_80284E64 D_80284E64 = { - 1, - 0xF3AF, - 34, - 0xFE2D, - 0, - 0, - 0, - 0, +ActorInitParams initBalloon = { + Balloon, + { 0xF3AF, 34, 0xFE2D }, + 0, 0, 0, 0, }; -UnkStruct_80284E64 D_80284E70 = { - 3, - 0xF3AF, - 34, - 0xFE2D, - 0, - 0, - 0, - 0, +ActorInitParams initBurst = { + FireworkBurst, + { 0xF3AF, 34, 0xFE2D }, + 0, 0, 0, 0, }; -UnkStruct_80284E64 D_80284E7C = { - 2, - 0xF3AF, - 34, - 0xFE2D, - 0, - 0, - 0, - 0, +ActorInitParams initCone = { + FireworkCone, + { 0xF3AF, 34, 0xFE2D }, + 0, 0, 0, 0, }; -UnkStruct_80284E64 D_80284E88 = { - 0, - 0xF2CC, - 250, - 0xFE11, - 0, - 0, - 0, - 0, +// This appears to be a dummy actor placed in index 0 of the actor list. +ActorInitParams initDummy = { + Initial, + { 0xF2CC, 250, 0xFE11 }, + 0, 0, 0, 0, }; void func_80280650(void) { } -void set_actor_with_next(struct UnkStruct_80280658 *arg0) { - UnkStruct_80284E64 *temp_v0 = arg0->unk28; +void set_initial_position(CeremonyActor *actor) { + ActorInitParams *params = actor->initParams; - arg0->unk10[0] = temp_v0->unk2; - arg0->unk10[1] = temp_v0->unk4; - arg0->unk10[2] = temp_v0->unk6; + actor->pos[0] = params->unk2[0]; + actor->pos[1] = params->unk2[1]; + actor->pos[2] = params->unk2[2]; // Place value in the high bits of s16. // Example: 85, 0b01010101 -> 0b0101010100000000 - arg0->unkA = temp_v0->unk8 << 8; - arg0->unkC = temp_v0->unk9 << 8; - arg0->unkE = temp_v0->unkA << 8; - arg0->unk4 = temp_v0->unk0; + actor->unkA = params->unk8 << 8; + actor->unkC = params->unk9 << 8; + actor->unkE = params->unkA << 8; + actor->type = params->type; } -struct UnkStruct_80280658 *find_available_entry(void) { +CeremonyActor *find_available_entry(void) { UNUSED s32 pad[2]; - struct UnkStruct_80280658 *phi_a0 = D_802874F8; + CeremonyActor *actor = sPodiumActorList; s32 i; for (i = 0; i < 200 ; i++) { - // Find an unused actor, initialize and return it. - if ((phi_a0->unk0 & 1) == 0) { - bzero(phi_a0, 0x4C); - phi_a0->unk0 = 1; - phi_a0->unk24 = 1.0f; - return phi_a0; + // Find an inactive actor. + if ((actor->isActive & 1) == 0) { + bzero(actor, sizeof(CeremonyActor)); + actor->isActive = 1; + actor->unk24 = 1.0f; + return actor; } - phi_a0++; + actor++; } return NULL; } -struct UnkStruct_80280658 *new_actor(UnkStruct_80284E64 *arg0) { - struct UnkStruct_80280658 *actor = find_available_entry(); +CeremonyActor *new_actor(ActorInitParams *arg0) { + CeremonyActor *actor = find_available_entry(); // @bug No null check. - // todo: What am I even supposed to return here? - // I guess the other funcs need checks too + // todo: More indepth error checking/return value #ifdef AVOID_UB if (actor == NULL) { - // Something has gone terribly wrongg - while(1); - return NULL; // prevent warnings + return (CeremonyActor*) &sPodiumActorList[0]; // Return first actor to prevent crash } #endif - // Linked list? - actor->unk28 = arg0; - set_actor_with_next(actor); + actor->initParams = arg0; + set_initial_position(actor); return actor; } @@ -184,17 +161,19 @@ void func_80280884(void) { extern s16 D_802874CA; -void func_8028088C(struct UnkStruct_80280658 *arg0) { - func_8006BB34(arg0->unk10, 1.0f, arg0->unk2E, arg0->unk2C); - arg0->unk10[1] += 0.8f; - arg0->unk2E = sins(arg0->unk30) * arg0->unk34; - arg0->unk30 += arg0->unk32; - arg0->unk3C++; - if (arg0->unk3C >= 0x321) { - arg0->unk0 = 0; +void balloon_update(CeremonyActor *actor) { + render_balloon(actor->pos, 1.0f, actor->unk2E, actor->unk2C); + actor->pos[1] += 0.8f; + actor->unk2E = sins(actor->unk30) * actor->unk34; + actor->unk30 += actor->unk32; + actor->timer++; + + // Delete actor + if (actor->timer > 800) { + actor->isActive = 0; } if (D_802874CA == 1) { - arg0->unk0 = 0; + actor->isActive = 0; } } @@ -202,43 +181,41 @@ void func_8028088C(struct UnkStruct_80280658 *arg0) { * Spawns an aerial shell that ascends into the sky. * (note that the explode effect is a different actor) */ -void spawn_firework_cone(Firework *cone) { - Firework *actor; - - if (cone->unk44 < 0x1E) { - cone->unk10[1] += 2.5f; - cone->unk10[0] += random_who_knows(0.2f); - cone->unk10[2] += random_who_knows(0.2f); +void firework_cone_update_and_spawn_burst(Firework *cone) { + if (cone->unk44 < 30) { + cone->pos[1] += 2.5f; + cone->pos[0] += random_who_knows(0.2f); + cone->pos[2] += random_who_knows(0.2f); } else if (cone->unk2C == 4) { - actor = (Firework *) new_actor(&D_80284E7C); - actor->unk10[0] = cone->unk10[0]; - actor->unk10[1] = cone->unk10[1]; - actor->unk10[2] = cone->unk10[2]; - actor->unk30 = fireworkConeColour[cone->unk48]; - actor->unk3C = 0xFF; - actor->unk40 = -0x11; - actor->unk44 = 0x64; - actor->unk34 = 1.8700001f; - actor->unk38 = 1.8700001f; + Firework *burst = (Firework *) new_actor(&initCone); + burst->pos[0] = cone->pos[0]; + burst->pos[1] = cone->pos[1]; + burst->pos[2] = cone->pos[2]; + burst->unk30 = fireworkConeColour[cone->unk48]; + burst->unk3C = 0xFF; + burst->unk40 = -0x11; + burst->unk44 = 0x64; + burst->unk34 = 1.8700001f; + burst->unk38 = 1.8700001f; } } Mat4 D_80287500; void func_80280A28(Vec3f arg0, Vec3s arg1, f32 arg2) { - Mat4 sp20; + Mat4 mtx; - func_80021E10(sp20, arg0, arg1); - sp20[0][0] = D_80287500[0][0] * arg2; - sp20[0][1] = D_80287500[1][0] * arg2; - sp20[0][2] = D_80287500[2][0] * arg2; - sp20[1][0] = D_80287500[0][1] * arg2; - sp20[1][1] = D_80287500[1][1] * arg2; - sp20[1][2] = D_80287500[2][1] * arg2; - sp20[2][0] = D_80287500[0][2] * arg2; - sp20[2][1] = D_80287500[1][2] * arg2; - sp20[2][2] = D_80287500[2][2] * arg2; - func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], sp20); + func_80021E10(mtx, arg0, arg1); + mtx[0][0] = D_80287500[0][0] * arg2; + mtx[0][1] = D_80287500[1][0] * arg2; + mtx[0][2] = D_80287500[2][0] * arg2; + mtx[1][0] = D_80287500[0][1] * arg2; + mtx[1][1] = D_80287500[1][1] * arg2; + mtx[1][2] = D_80287500[2][1] * arg2; + mtx[2][0] = D_80287500[0][2] * arg2; + mtx[2][1] = D_80287500[1][2] * arg2; + mtx[2][2] = D_80287500[2][2] * arg2; + func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], mtx); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } @@ -268,15 +245,15 @@ void render_fireworks(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { D_80164AF0 += 1; } -void func_80280D1C(Firework *actor) { +void firework_update(Firework *actor) { s32 i; - Vec3f sp58; + Vec3f pos; if (actor->unk44 < 30) { for (i = 0; i < 10; i++) { - sp58[0] = actor->unk10[0]; - sp58[1] = actor->unk10[1] - i * 2; - sp58[2] = actor->unk10[2]; - render_fireworks(sp58, ((10 - i) / 10.0f) * 2, fireworkColour[actor->unk48], ( ((((30 - actor->unk44) * 100)) / 30.0f))); + pos[0] = actor->pos[0]; + pos[1] = actor->pos[1] - i * 2; + pos[2] = actor->pos[2]; + render_fireworks(pos, ((10 - i) / 10.0f) * 2, fireworkColour[actor->unk48], ( ((((30 - actor->unk44) * 100)) / 30.0f))); } } else { @@ -292,27 +269,27 @@ void func_80280D1C(Firework *actor) { } actor->unk2C += 1; if (((actor->unk3C > 0) && ((actor->unk34 > 0.0f))) || (actor->unk2C < 30)) { - render_fireworks(actor->unk10, actor->unk34, actor->unk30, (s16) actor->unk3C); + render_fireworks(actor->pos, actor->unk34, actor->unk30, (s16) actor->unk3C); } else { - actor->unk0 = 0; + actor->isActive = 0; } } actor->unk44 += 1; } -void func_80280FA0(UNUSED s32 arg0) { +void unused_80280FA0(UNUSED CeremonyActor *actor) { } -void func_80280FA8(UNUSED s32 arg0) { +void unused_80280FA8(UNUSED CeremonyActor *actor) { } void balloons_and_fireworks_init(void) { - D_802874E0 = 0; - D_802874F8 = (struct UnkStruct_80280658 *) get_next_available_memory_addr(0x3B60); - bzero(D_802874F8, 0x3B60); - new_actor(&D_80284E88); + sActorTimer = 0; + sPodiumActorList = (CeremonyActor *) get_next_available_memory_addr(0x3B60); + bzero(sPodiumActorList, 0x3B60); + new_actor(&initDummy); } void func_80280FFC(void) { @@ -331,11 +308,11 @@ void spawn_balloons(s32 arg0, s32 arg1, s32 arg2) { s32 i; for (i = 0; i < 100; i++) { - struct UnkStruct_80280658 *balloon; - balloon = new_actor(&D_80284E64); - balloon->unk10[0] = random_who_knows(200.0f) + arg0; - balloon->unk10[1] = random_who_knows(380.0f) + arg1; - balloon->unk10[2] = random_who_knows(600.0f) + arg2; + CeremonyActor *balloon; + balloon = new_actor(&initBalloon); + balloon->pos[0] = random_who_knows(200.0f) + arg0; + balloon->pos[1] = random_who_knows(380.0f) + arg1; + balloon->pos[2] = random_who_knows(600.0f) + arg2; balloon->unk2C = (s16) (s32) (random_float_between_0_and_1() * 7.0f); balloon->unk30 = random_u16_credits(); balloon->unk32 = (s16) (s32) (random_who_knows(400.0f) + 900.0f); @@ -352,32 +329,32 @@ extern s32 fireworkColour[]; * The explosive effect when the firework's charge detonates * resulting in a small variety of amusing colours. */ -void spawn_firework_burst(s32 arg0, s32 arg1, s32 arg2) { +void spawn_firework_cone(s32 arg0, s32 arg1, s32 arg2) { f32 num; static u32 D_80287540; if (((f32) random_float_between_0_and_1() * (D_802874BE[0] + 0xD)) < 1.0f) { - Firework *burst; - burst = (Firework *) new_actor(&D_80284E70); - burst->unk10[0] = random_who_knows(0.0f) + arg0; - burst->unk10[1] = random_who_knows((f32) (D_802874C6 + 100)) + (f32) arg1; - burst->unk10[2] = random_who_knows((f32) (D_802874C8 + 700)) + (f32) arg2; + Firework *cone; + cone = (Firework *) new_actor(&initBurst); + cone->pos[0] = random_who_knows(0.0f) + arg0; + cone->pos[1] = random_who_knows((f32) (D_802874C6 + 100)) + (f32) arg1; + cone->pos[2] = random_who_knows((f32) (D_802874C8 + 700)) + (f32) arg2; num = 1.1f; // Wrap the counter from zero to three - burst->unk48 = D_80287540 % 4U; - burst->unk30 = fireworkColour[D_80287540 % 4U]; - burst->unk34 = num; - burst->unk38 = num; + cone->unk48 = D_80287540 % 4U; + cone->unk30 = fireworkColour[D_80287540 % 4U]; + cone->unk34 = num; + cone->unk38 = num; D_80287540 += 1; - burst->unk3C = 0xFF; - burst->unk40 = -0x11; + cone->unk3C = 0xFF; + cone->unk40 = -0x11; } } extern s16 D_802874C4; -extern s32 D_802874E0; +extern s32 sActorTimer; extern Mat4 D_80287500; extern s8 D_802874F5; @@ -385,54 +362,61 @@ extern s8 D_802874F5; /** * Allegedly controls fireworks movement. */ -void fireworks_update(void) { +void spawn_timer(void) { Camera *camera = &cameras[0]; - f32 temp_f0; + f32 lookAtY; guLookAtF(D_80287500, camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_802874F5 < 3) { - if (D_802874E0 < 300) { - temp_f0 = camera->lookAt[1]; - spawn_firework_burst(-0xE0E, (s32) (((temp_f0 - camera->pos[1]) * 1.5f) + temp_f0), -0x258); + if (sActorTimer < 300) { + lookAtY = camera->lookAt[1]; + spawn_firework_cone(-0xE0E, (s32) (((lookAtY - camera->pos[1]) * 1.5f) + lookAtY), -0x258); } - if (D_802874E0 == 120) { + if (sActorTimer == 120) { spawn_balloons(-0xC6C, (s32) ((f32) D_802874C4 + 210.0f), -0x1EF); } - } else if (D_802874E0 == 2) { + } else if (sActorTimer == 2) { spawn_balloons(-0xC6C, (s32) ((f32) D_802874C4 + 210.0f), -0x1EF); } - D_802874E0 += 1; + sActorTimer += 1; } -void *D_80284E94[][3] = { - {func_80280FA8, func_80280FA0, 0}, - {func_80280FA8, func_8028088C, 0}, - {func_80280FA8, func_80280D1C, 0}, - {spawn_firework_cone, 0, func_80280D1C}, +void *sUpdate[][3] = { + // Dummy actor + {unused_80280FA8, unused_80280FA0, 0}, + // Balloon + {unused_80280FA8, balloon_update, 0}, + // Firework Cone + {unused_80280FA8, firework_update, 0}, + // Firework Burst + {firework_cone_update_and_spawn_burst, 0, firework_update}, }; extern s16 D_802874D0; -void func_80281438(void) { +void update_actors_loop(void) { void (*func)(void *); - struct UnkStruct_80280658 *phi_s0; + CeremonyActor *actor; s32 i; s32 j; - fireworks_update(); + spawn_timer(); D_802874D0 = 0; for (i = 0; i < 3; i++) { - phi_s0 = D_802874F8; + actor = sPodiumActorList; + // High loop count to produce randomness? May also be a sort of delta? + // If this was for random, wouldn't it make everything move farther? for (j = 0; j < 200; j++) { - if ((phi_s0->unk0 & 1) != 0) { + // @bug Check should be outside of this loop + if (actor->isActive & 1) { - func = D_80284E94[phi_s0->unk4][i]; + func = sUpdate[actor->type][i]; if (func != 0) { - func(phi_s0); + func(actor); } } - phi_s0++; + actor++; } } } diff --git a/src/podium_ceremony_actors.h b/src/podium_ceremony_actors.h index 7acd78051..79ecc5413 100644 --- a/src/podium_ceremony_actors.h +++ b/src/podium_ceremony_actors.h @@ -3,31 +3,37 @@ #include "common_structs.h" +enum ActorType { + Initial, + Balloon, + FireworkCone, + FireworkBurst, +}; + typedef struct { - s16 unk0; - s16 unk2; - s16 unk4; - s16 unk6; + s16 type; + Vec3s unk2; s8 unk8; s8 unk9; s8 unkA; s8 unkB; -} UnkStruct_80284E64; +} ActorInitParams; -struct UnkStruct_80280658 { - /* 0x00 */ s32 unk0; - /* 0x04 */ s16 unk4; +// A generic actor, usually a balloon. +typedef struct { + /* 0x00 */ s32 isActive; + /* 0x04 */ s16 type; /* 0x06 */ s16 unk6; /* 0x08 */ s8 unk8; /* 0x09 */ s8 unk9; /* 0x0A */ s16 unkA; /* 0x0C */ s16 unkC; /* 0x0E */ s16 unkE; - /* 0x10 */ Vec3f unk10; + /* 0x10 */ Vec3f pos; /* 0x1C */ f32 unk1C; /* 0x20 */ f32 unk20; /* 0x24 */ f32 unk24; - /* 0x28 */ UnkStruct_80284E64 *unk28; + /* 0x28 */ ActorInitParams *initParams; /* 0x2C */ s16 unk2C; /* 0x2E */ s16 unk2E; /* 0x30 */ s16 unk30; @@ -35,26 +41,26 @@ struct UnkStruct_80280658 { /* 0x34 */ s16 unk34; /* 0x36 */ s16 unk36; /* 0x38 */ f32 unk38; - /* 0x3C */ s32 unk3C; + /* 0x3C */ s32 timer; // Used to delete the actor after some time. /* 0x40 */ s32 unk40; /* 0x44 */ s32 unk44; /* 0x48 */ s32 unk48; -}; +} CeremonyActor; typedef struct { - /* 0x00 */ s32 unk0; - /* 0x04 */ s16 unk4; + /* 0x00 */ s32 isActive; + /* 0x04 */ s16 type; /* 0x06 */ s16 unk6; /* 0x08 */ s8 unk8; /* 0x09 */ s8 unk9; /* 0x0A */ s16 unkA; /* 0x0C */ s16 unkC; /* 0x0E */ s16 unkE; - /* 0x10 */ Vec3f unk10; + /* 0x10 */ Vec3f pos; /* 0x1C */ f32 unk1C; /* 0x20 */ f32 unk20; /* 0x24 */ f32 unk24; - /* 0x28 */ UnkStruct_80284E64 *unk28; + /* 0x28 */ ActorInitParams *initParams; /* 0x2C */ s32 unk2C; /* 0x30 */ s32 unk30; // s32 instead of s16 /* 0x34 */ f32 unk34; // f32 instead of s16 @@ -65,20 +71,18 @@ typedef struct { /* 0x48 */ s32 unk48; } Firework; -void func_80281438(void); +void update_actors_loop(void); void func_80280650(); -void set_actor_with_next(struct UnkStruct_80280658*); -struct UnkStruct_80280658 *find_available_entry(); -struct UnkStruct_80280658 *new_actor(UnkStruct_80284E64*); +void set_initial_position(CeremonyActor*); +CeremonyActor *find_available_entry(); +CeremonyActor *new_actor(ActorInitParams*); u16 random_u16_credits(); f32 random_float_between_0_and_1(); f32 random_who_knows(f32); void func_80280884(); -void spawn_firework_cone(Firework *); +void firework_cone_update_and_spawn_burst(Firework *); void func_80280A28(Vec3f, Vec3s, f32 ); void render_fireworks(Vec3f, f32, s32, s16); -void func_80280FA0(s32); -void func_80280FA8(s32); void balloons_and_fireworks_init(); void func_80280FFC(); void func_8028100C(s32, s32, s32); @@ -91,14 +95,14 @@ void func_80281540(); void podium_ceremony_loop(); -extern struct UnkStruct_80280658 *D_802874F8; +extern CeremonyActor *sPodiumActorList; -extern UnkStruct_80284E64 D_80284E64; -extern UnkStruct_80284E64 D_80284E7C; -extern UnkStruct_80284E64 D_80284E88; -extern UnkStruct_80284E64 D_80284E70; +extern ActorInitParams initBalloon; +extern ActorInitParams initCone; +extern ActorInitParams initInitUnk; +extern ActorInitParams initBurst; -extern s32 D_802874E0; +extern s32 sActorTimer; extern s8 D_802874F4; extern Gfx *D_802874D4; extern s32 D_802874FC; diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c index 6bddea22e..8f621141a 100644 --- a/src/staff_ghosts.c +++ b/src/staff_ghosts.c @@ -14,7 +14,7 @@ extern s32 func_80040174(void *, s32, s32); u8 *D_80162D80; s16 D_80162D84; -u16 D_80162D86; +s16 D_80162D86; u16 D_80162D88; u32 D_80162D8C; @@ -477,18 +477,6 @@ void func_80005AE8(Player *ply) { } } -#ifdef MIPS_TO_C -//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b -extern s32 D_80162DC8; -extern s32 D_80162DCC; -extern s32 D_80162DD0; -extern s32 D_80162DDC; -extern s32 D_80162DEC; -extern s32 D_80162DF8; -extern s32 D_80162DFC; -extern s32 D_80162E00; -extern s32 D_8018CA78; - void func_80005B18(void) { if (gModeSelection == 1) { if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 != 1)) { @@ -553,9 +541,6 @@ void func_80005B18(void) { } } } -#else -GLOBAL_ASM("asm/non_matchings/staff_ghosts/func_80005B18.s") -#endif void func_80005E6C(void) { if ((gModeSelection == TIME_TRIALS) && (gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) {