diff --git a/asm/non_matchings/fade_transition/func_800C01D8.s b/asm/non_matchings/fade_transition/func_800C01D8.s index 6411a5cc..91da68c3 100644 --- a/asm/non_matchings/fade_transition/func_800C01D8.s +++ b/asm/non_matchings/fade_transition/func_800C01D8.s @@ -12,7 +12,7 @@ glabel func_800C01D8 /* 0C0DEC 800C01EC 100000A5 */ b .L800C0484 /* 0C0DF0 800C01F0 00001025 */ move $v0, $zero .L800C01F4: -/* 0C0DF4 800C01F4 0C0301C9 */ jal func_800C0724 +/* 0C0DF4 800C01F4 0C0301C9 */ jal transition_end /* 0C0DF8 800C01F8 AFA40030 */ sw $a0, 0x30($sp) /* 0C0DFC 800C01FC 8FA40030 */ lw $a0, 0x30($sp) /* 0C0E00 800C0200 3C03800E */ lui $v1, %hi(D_800E31BC) # $v1, 0x800e @@ -22,15 +22,15 @@ glabel func_800C01D8 /* 0C0E10 800C0210 00001025 */ move $v0, $zero .L800C0214: /* 0C0E14 800C0214 948F0004 */ lhu $t7, 4($a0) -/* 0C0E18 800C0218 3C06800E */ lui $a2, %hi(D_800E31B0) # $a2, 0x800e -/* 0C0E1C 800C021C 24C631B0 */ addiu $a2, %lo(D_800E31B0) # addiu $a2, $a2, 0x31b0 +/* 0C0E18 800C0218 3C06800E */ lui $a2, %hi(sTransitionFadeTimer) # $a2, 0x800e +/* 0C0E1C 800C021C 24C631B0 */ addiu $a2, %lo(sTransitionFadeTimer) # addiu $a2, $a2, 0x31b0 /* 0C0E20 800C0220 A4CF0000 */ sh $t7, ($a2) /* 0C0E24 800C0224 94980004 */ lhu $t8, 4($a0) /* 0C0E28 800C0228 3C01800E */ lui $at, %hi(D_800E31B8) # $at, 0x800e /* 0C0E2C 800C022C A43831B8 */ sh $t8, %lo(D_800E31B8)($at) /* 0C0E30 800C0230 94990006 */ lhu $t9, 6($a0) -/* 0C0E34 800C0234 3C01800E */ lui $at, %hi(D_800E31B4) # $at, 0x800e -/* 0C0E38 800C0238 A43931B4 */ sh $t9, %lo(D_800E31B4)($at) +/* 0C0E34 800C0234 3C01800E */ lui $at, %hi(sTransitionFlags) # $at, 0x800e +/* 0C0E38 800C0238 A43931B4 */ sh $t9, %lo(sTransitionFlags)($at) /* 0C0E3C 800C023C 90820000 */ lbu $v0, ($a0) /* 0C0E40 800C0240 3C078013 */ lui $a3, %hi(gCurFaceTransition) # $a3, 0x8013 /* 0C0E44 800C0244 30480080 */ andi $t0, $v0, 0x80 @@ -45,8 +45,8 @@ glabel func_800C01D8 /* 0C0E68 800C0268 318D0040 */ andi $t5, $t4, 0x40 /* 0C0E6C 800C026C AC2D31A8 */ sw $t5, %lo(D_800E31A8)($at) /* 0C0E70 800C0270 806E0000 */ lb $t6, ($v1) -/* 0C0E74 800C0274 3C05800E */ lui $a1, %hi(D_800E31A4) # $a1, 0x800e -/* 0C0E78 800C0278 24A531A4 */ addiu $a1, %lo(D_800E31A4) # addiu $a1, $a1, 0x31a4 +/* 0C0E74 800C0274 3C05800E */ lui $a1, %hi(sLevelTransitionDelayTimer) # $a1, 0x800e +/* 0C0E78 800C0278 24A531A4 */ addiu $a1, %lo(sLevelTransitionDelayTimer) # addiu $a1, $a1, 0x31a4 /* 0C0E7C 800C027C 15C00003 */ bnez $t6, .L800C028C /* 0C0E80 800C0280 ACA00000 */ sw $zero, ($a1) /* 0C0E84 800C0284 24180002 */ li $t8, 2 @@ -183,8 +183,8 @@ glabel L800C0470 /* 0C1070 800C0470 0C030990 */ jal func_800C2640 /* 0C1074 800C0474 00000000 */ nop .L800C0478: -/* 0C1078 800C0478 3C02800E */ lui $v0, %hi(D_800E31AC) # $v0, 0x800e -/* 0C107C 800C047C 8C4231AC */ lw $v0, %lo(D_800E31AC)($v0) +/* 0C1078 800C0478 3C02800E */ lui $v0, %hi(sTransitionStatus) # $v0, 0x800e +/* 0C107C 800C047C 8C4231AC */ lw $v0, %lo(sTransitionStatus)($v0) /* 0C1080 800C0480 00000000 */ nop .L800C0484: /* 0C1084 800C0484 8FBF002C */ lw $ra, 0x2c($sp) diff --git a/asm/non_matchings/fade_transition/func_800C0834.s b/asm/non_matchings/fade_transition/func_800C0834.s index 206a804f..b9b73863 100644 --- a/asm/non_matchings/fade_transition/func_800C0834.s +++ b/asm/non_matchings/fade_transition/func_800C0834.s @@ -3,16 +3,16 @@ glabel func_800C0834 /* 0C1438 800C0838 3C0C8013 */ lui $t4, %hi(D_8012A754) # $t4, 0x8013 /* 0C143C 800C083C 3C0B800E */ lui $t3, %hi(D_800E31B8) # $t3, 0x800e /* 0C1440 800C0840 3C0A800E */ lui $t2, %hi(D_800E31A8) # $t2, 0x800e -/* 0C1444 800C0844 3C09800E */ lui $t1, %hi(D_800E31B4) # $t1, 0x800e +/* 0C1444 800C0844 3C09800E */ lui $t1, %hi(sTransitionFlags) # $t1, 0x800e /* 0C1448 800C0848 3C078013 */ lui $a3, %hi(gCurFadeAlpha) # $a3, 0x8013 -/* 0C144C 800C084C 3C068013 */ lui $a2, %hi(D_8012A750) # $a2, 0x8013 -/* 0C1450 800C0850 3C05800E */ lui $a1, %hi(D_800E31B0) # $a1, 0x800e +/* 0C144C 800C084C 3C068013 */ lui $a2, %hi(sTransitionOpacity) # $a2, 0x8013 +/* 0C1450 800C0850 3C05800E */ lui $a1, %hi(sTransitionFadeTimer) # $a1, 0x800e /* 0C1454 800C0854 44816000 */ mtc1 $at, $f12 /* 0C1458 800C0858 44801000 */ mtc1 $zero, $f2 -/* 0C145C 800C085C 24A531B0 */ addiu $a1, %lo(D_800E31B0) # addiu $a1, $a1, 0x31b0 -/* 0C1460 800C0860 24C6A750 */ addiu $a2, %lo(D_8012A750) # addiu $a2, $a2, -0x58b0 +/* 0C145C 800C085C 24A531B0 */ addiu $a1, %lo(sTransitionFadeTimer) # addiu $a1, $a1, 0x31b0 +/* 0C1460 800C0860 24C6A750 */ addiu $a2, %lo(sTransitionOpacity) # addiu $a2, $a2, -0x58b0 /* 0C1464 800C0864 24E7A737 */ addiu $a3, %lo(gCurFadeAlpha) # addiu $a3, $a3, -0x58c9 -/* 0C1468 800C0868 252931B4 */ addiu $t1, %lo(D_800E31B4) # addiu $t1, $t1, 0x31b4 +/* 0C1468 800C0868 252931B4 */ addiu $t1, %lo(sTransitionFlags) # addiu $t1, $t1, 0x31b4 /* 0C146C 800C086C 254A31A8 */ addiu $t2, %lo(D_800E31A8) # addiu $t2, $t2, 0x31a8 /* 0C1470 800C0870 256B31B8 */ addiu $t3, %lo(D_800E31B8) # addiu $t3, $t3, 0x31b8 /* 0C1474 800C0874 258CA754 */ addiu $t4, %lo(D_8012A754) # addiu $t4, $t4, -0x58ac diff --git a/asm/non_matchings/fade_transition/func_800C0B00.s b/asm/non_matchings/fade_transition/func_800C0B00.s index 0f244855..b416dc97 100644 --- a/asm/non_matchings/fade_transition/func_800C0B00.s +++ b/asm/non_matchings/fade_transition/func_800C0B00.s @@ -27,23 +27,23 @@ glabel func_800C0B00 /* 0C1764 800C0B64 0C01C327 */ jal allocate_from_main_pool_safe /* 0C1768 800C0B68 AFA30030 */ sw $v1, 0x30($sp) /* 0C176C 800C0B6C 8FA30030 */ lw $v1, 0x30($sp) -/* 0C1770 800C0B70 3C04800E */ lui $a0, %hi(D_800E31C0) # $a0, 0x800e -/* 0C1774 800C0B74 248431C0 */ addiu $a0, %lo(D_800E31C0) # addiu $a0, $a0, 0x31c0 +/* 0C1770 800C0B70 3C04800E */ lui $a0, %hi(sTransitionVtx) # $a0, 0x800e +/* 0C1774 800C0B74 248431C0 */ addiu $a0, %lo(sTransitionVtx) # addiu $a0, $a0, 0x31c0 /* 0C1778 800C0B78 AC820000 */ sw $v0, ($a0) -/* 0C177C 800C0B7C 3C01800E */ lui $at, %hi(D_800E31C0+4) # $at, 0x800e +/* 0C177C 800C0B7C 3C01800E */ lui $at, %hi(sTransitionVtx+4) # $at, 0x800e /* 0C1780 800C0B80 00436021 */ addu $t4, $v0, $v1 -/* 0C1784 800C0B84 AC2C31C4 */ sw $t4, %lo(D_800E31C0+4)($at) +/* 0C1784 800C0B84 AC2C31C4 */ sw $t4, %lo(sTransitionVtx+4)($at) /* 0C1788 800C0B88 8C8D0004 */ lw $t5, 4($a0) -/* 0C178C 800C0B8C 3C05800E */ lui $a1, %hi(D_800E31C8) # $a1, 0x800e -/* 0C1790 800C0B90 3C01800E */ lui $at, %hi(D_800E31C8+4) # $at, 0x800e +/* 0C178C 800C0B8C 3C05800E */ lui $a1, %hi(sTransitionTris) # $a1, 0x800e +/* 0C1790 800C0B90 3C01800E */ lui $at, %hi(sTransitionTris+4) # $at, 0x800e /* 0C1794 800C0B94 01A37021 */ addu $t6, $t5, $v1 -/* 0C1798 800C0B98 24A531C8 */ addiu $a1, %lo(D_800E31C8) # addiu $a1, $a1, 0x31c8 -/* 0C179C 800C0B9C AC2E31C8 */ sw $t6, %lo(D_800E31C8)($at) +/* 0C1798 800C0B98 24A531C8 */ addiu $a1, %lo(sTransitionTris) # addiu $a1, $a1, 0x31c8 +/* 0C179C 800C0B9C AC2E31C8 */ sw $t6, %lo(sTransitionTris)($at) /* 0C17A0 800C0BA0 8FA8002C */ lw $t0, 0x2c($sp) /* 0C17A4 800C0BA4 8CAF0000 */ lw $t7, ($a1) /* 0C17A8 800C0BA8 3C068013 */ lui $a2, %hi(D_8012A770) # $a2, 0x8013 /* 0C17AC 800C0BAC 01E8C021 */ addu $t8, $t7, $t0 -/* 0C17B0 800C0BB0 AC3831CC */ sw $t8, %lo(D_800E31C8+4)($at) +/* 0C17B0 800C0BB0 AC3831CC */ sw $t8, %lo(sTransitionTris+4)($at) /* 0C17B4 800C0BB4 8CB90004 */ lw $t9, 4($a1) /* 0C17B8 800C0BB8 3C018013 */ lui $at, %hi(D_8012A770) # $at, 0x8013 /* 0C17BC 800C0BBC 03286021 */ addu $t4, $t9, $t0 @@ -65,7 +65,7 @@ glabel func_800C0B00 /* 0C17FC 800C0BFC 8FA20060 */ lw $v0, 0x60($sp) /* 0C1800 800C0C00 318D0080 */ andi $t5, $t4, 0x80 /* 0C1804 800C0C04 11A00008 */ beqz $t5, .L800C0C28 -/* 0C1808 800C0C08 3C09800E */ lui $t1, %hi(D_800E31B0) # $t1, 0x800e +/* 0C1808 800C0C08 3C09800E */ lui $t1, %hi(sTransitionFadeTimer) # $t1, 0x800e /* 0C180C 800C0C0C 8FAE0064 */ lw $t6, 0x64($sp) /* 0C1810 800C0C10 AFA20064 */ sw $v0, 0x64($sp) /* 0C1814 800C0C14 8FA20068 */ lw $v0, 0x68($sp) @@ -83,7 +83,7 @@ glabel func_800C0B00 /* 0C1840 800C0C40 8FA8006C */ lw $t0, 0x6c($sp) /* 0C1844 800C0C44 2463A778 */ addiu $v1, %lo(D_8012A778) # addiu $v1, $v1, -0x5888 /* 0C1848 800C0C48 00001025 */ move $v0, $zero -/* 0C184C 800C0C4C 252931B0 */ addiu $t1, %lo(D_800E31B0) # addiu $t1, $t1, 0x31b0 +/* 0C184C 800C0C4C 252931B0 */ addiu $t1, %lo(sTransitionFadeTimer) # addiu $t1, $t1, 0x31b0 .L800C0C50: /* 0C1850 800C0C50 90980000 */ lbu $t8, ($a0) /* 0C1854 800C0C54 8CCE0000 */ lw $t6, ($a2) @@ -232,8 +232,8 @@ glabel func_800C0B00 .L800C0E78: /* 0C1A78 800C0E78 1A000065 */ blez $s0, .L800C1010 /* 0C1A7C 800C0E7C 00002825 */ move $a1, $zero -/* 0C1A80 800C0E80 3C0E800E */ lui $t6, %hi(D_800E31C0) # $t6, 0x800e -/* 0C1A84 800C0E84 25CE31C0 */ addiu $t6, %lo(D_800E31C0) # addiu $t6, $t6, 0x31c0 +/* 0C1A80 800C0E80 3C0E800E */ lui $t6, %hi(sTransitionVtx) # $t6, 0x800e +/* 0C1A84 800C0E84 25CE31C0 */ addiu $t6, %lo(sTransitionVtx) # addiu $t6, $t6, 0x31c0 /* 0C1A88 800C0E88 000A6880 */ sll $t5, $t2, 2 /* 0C1A8C 800C0E8C 320B0003 */ andi $t3, $s0, 3 /* 0C1A90 800C0E90 11600017 */ beqz $t3, .L800C0EF0 @@ -347,8 +347,8 @@ glabel func_800C0B00 .L800C1030: /* 0C1C30 800C1030 1A200031 */ blez $s1, .L800C10F8 /* 0C1C34 800C1034 00002825 */ move $a1, $zero -/* 0C1C38 800C1038 3C18800E */ lui $t8, %hi(D_800E31C8) # $t8, 0x800e -/* 0C1C3C 800C103C 271831C8 */ addiu $t8, %lo(D_800E31C8) # addiu $t8, $t8, 0x31c8 +/* 0C1C38 800C1038 3C18800E */ lui $t8, %hi(sTransitionTris) # $t8, 0x800e +/* 0C1C3C 800C103C 271831C8 */ addiu $t8, %lo(sTransitionTris) # addiu $t8, $t8, 0x31c8 /* 0C1C40 800C1040 000A7880 */ sll $t7, $t2, 2 /* 0C1C44 800C1044 01F81821 */ addu $v1, $t7, $t8 /* 0C1C48 800C1048 00001025 */ move $v0, $zero @@ -401,8 +401,8 @@ glabel func_800C0B00 /* 0C1CFC 800C10FC 1548FFCC */ bne $t2, $t0, .L800C1030 /* 0C1D00 800C1100 00000000 */ nop /* 0C1D04 800C1104 240D0001 */ li $t5, 1 -/* 0C1D08 800C1108 3C01800E */ lui $at, %hi(D_800E31AC) # $at, 0x800e -/* 0C1D0C 800C110C AC2D31AC */ sw $t5, %lo(D_800E31AC)($at) +/* 0C1D08 800C1108 3C01800E */ lui $at, %hi(sTransitionStatus) # $at, 0x800e +/* 0C1D0C 800C110C AC2D31AC */ sw $t5, %lo(sTransitionStatus)($at) /* 0C1D10 800C1110 3C018013 */ lui $at, %hi(D_8012A77C) # $at, 0x8013 /* 0C1D14 800C1114 8FBF0024 */ lw $ra, 0x24($sp) /* 0C1D18 800C1118 AC30A77C */ sw $s0, %lo(D_8012A77C)($at) diff --git a/asm/non_matchings/fade_transition/func_800C1130.s b/asm/non_matchings/fade_transition/func_800C1130.s index 53fbdc39..5bb317b4 100644 --- a/asm/non_matchings/fade_transition/func_800C1130.s +++ b/asm/non_matchings/fade_transition/func_800C1130.s @@ -1,6 +1,6 @@ glabel func_800C1130 -/* 0C1D30 800C1130 3C07800E */ lui $a3, %hi(D_800E31B0) # $a3, 0x800e -/* 0C1D34 800C1134 24E731B0 */ addiu $a3, %lo(D_800E31B0) # addiu $a3, $a3, 0x31b0 +/* 0C1D30 800C1130 3C07800E */ lui $a3, %hi(sTransitionFadeTimer) # $a3, 0x800e +/* 0C1D34 800C1134 24E731B0 */ addiu $a3, %lo(sTransitionFadeTimer) # addiu $a3, $a3, 0x31b0 /* 0C1D38 800C1138 44842000 */ mtc1 $a0, $f4 /* 0C1D3C 800C113C 94E20000 */ lhu $v0, ($a3) /* 0C1D40 800C1140 3C03800E */ lui $v1, 0x800e @@ -105,10 +105,10 @@ glabel func_800C1130 .L800C12B8: /* 0C1EB8 800C12B8 18A00048 */ blez $a1, .L800C13DC /* 0C1EBC 800C12BC 00001025 */ move $v0, $zero -/* 0C1EC0 800C12C0 3C06800E */ lui $a2, %hi(D_800E31D0) # $a2, 0x800e -/* 0C1EC4 800C12C4 3C05800E */ lui $a1, %hi(D_800E31C0) # $a1, 0x800e -/* 0C1EC8 800C12C8 24A531C0 */ addiu $a1, %lo(D_800E31C0) # addiu $a1, $a1, 0x31c0 -/* 0C1ECC 800C12CC 24C631D0 */ addiu $a2, %lo(D_800E31D0) # addiu $a2, $a2, 0x31d0 +/* 0C1EC0 800C12C0 3C06800E */ lui $a2, %hi(sTransitionTaskNum) # $a2, 0x800e +/* 0C1EC4 800C12C4 3C05800E */ lui $a1, %hi(sTransitionVtx) # $a1, 0x800e +/* 0C1EC8 800C12C8 24A531C0 */ addiu $a1, %lo(sTransitionVtx) # addiu $a1, $a1, 0x31c0 +/* 0C1ECC 800C12CC 24C631D0 */ addiu $a2, %lo(sTransitionTaskNum) # addiu $a2, $a2, 0x31d0 /* 0C1ED0 800C12D0 00002025 */ move $a0, $zero .L800C12D4: /* 0C1ED4 800C12D4 4459F800 */ cfc1 $t9, $31 @@ -169,7 +169,7 @@ glabel func_800C1130 /* 0C1FB0 800C13B0 00000000 */ nop .L800C13B4: -/* 0C1FB4 800C13B4 246331B4 */ addiu $v1, $v1, %lo(D_800E31B4)# 0x31b4 +/* 0C1FB4 800C13B4 246331B4 */ addiu $v1, $v1, %lo(sTransitionFlags)# 0x31b4 /* 0C1FB8 800C13B8 94620000 */ lhu $v0, ($v1) /* 0C1FBC 800C13BC 3401FFFF */ li $at, 65535 /* 0C1FC0 800C13C0 10410006 */ beq $v0, $at, .L800C13DC diff --git a/asm/non_matchings/fade_transition/func_800C15D4.s b/asm/non_matchings/fade_transition/func_800C15D4.s index 1301e186..24d6ae32 100644 --- a/asm/non_matchings/fade_transition/func_800C15D4.s +++ b/asm/non_matchings/fade_transition/func_800C15D4.s @@ -14,11 +14,11 @@ glabel func_800C15D4 /* 0C2204 800C1604 34A500FF */ ori $a1, (0xFFFF00FF & 0xFFFF) # ori $a1, $a1, 0xff /* 0C2208 800C1608 0C01C327 */ jal allocate_from_main_pool_safe /* 0C220C 800C160C 24040DA0 */ li $a0, 3488 -/* 0C2210 800C1610 3C04800E */ lui $a0, %hi(D_800E31C0) # $a0, 0x800e -/* 0C2214 800C1614 3C05800E */ lui $a1, %hi(D_800E31C8) # $a1, 0x800e +/* 0C2210 800C1610 3C04800E */ lui $a0, %hi(sTransitionVtx) # $a0, 0x800e +/* 0C2214 800C1614 3C05800E */ lui $a1, %hi(sTransitionTris) # $a1, 0x800e /* 0C2218 800C1618 244F02D0 */ addiu $t7, $v0, 0x2d0 -/* 0C221C 800C161C 24A531C8 */ addiu $a1, %lo(D_800E31C8) # addiu $a1, $a1, 0x31c8 -/* 0C2220 800C1620 248431C0 */ addiu $a0, %lo(D_800E31C0) # addiu $a0, $a0, 0x31c0 +/* 0C221C 800C161C 24A531C8 */ addiu $a1, %lo(sTransitionTris) # addiu $a1, $a1, 0x31c8 +/* 0C2220 800C1620 248431C0 */ addiu $a0, %lo(sTransitionVtx) # addiu $a0, $a0, 0x31c0 /* 0C2224 800C1624 25F902D0 */ addiu $t9, $t7, 0x2d0 /* 0C2228 800C1628 272D0400 */ addiu $t5, $t9, 0x400 /* 0C222C 800C162C AC820000 */ sw $v0, ($a0) @@ -27,12 +27,12 @@ glabel func_800C15D4 /* 0C2238 800C1638 ACAD0004 */ sw $t5, 4($a1) /* 0C223C 800C163C 3C058013 */ lui $a1, %hi(gCurFadeGreen) # $a1, 0x8013 /* 0C2240 800C1640 3C048013 */ lui $a0, %hi(gCurFadeRed) # $a0, 0x8013 -/* 0C2244 800C1644 3C03800E */ lui $v1, %hi(D_800E31C0) # $v1, 0x800e -/* 0C2248 800C1648 3C0A800E */ lui $t2, %hi(D_800E31C8) # $t2, 0x800e +/* 0C2244 800C1644 3C03800E */ lui $v1, %hi(sTransitionVtx) # $v1, 0x800e +/* 0C2248 800C1648 3C0A800E */ lui $t2, %hi(sTransitionTris) # $t2, 0x800e /* 0C224C 800C164C 3C068013 */ lui $a2, %hi(gCurFadeBlue) # $a2, 0x8013 /* 0C2250 800C1650 24C6A736 */ addiu $a2, %lo(gCurFadeBlue) # addiu $a2, $a2, -0x58ca -/* 0C2254 800C1654 254A31C8 */ addiu $t2, %lo(D_800E31C8) # addiu $t2, $t2, 0x31c8 -/* 0C2258 800C1658 246331C0 */ addiu $v1, %lo(D_800E31C0) # addiu $v1, $v1, 0x31c0 +/* 0C2254 800C1654 254A31C8 */ addiu $t2, %lo(sTransitionTris) # addiu $t2, $t2, 0x31c8 +/* 0C2258 800C1658 246331C0 */ addiu $v1, %lo(sTransitionVtx) # addiu $v1, $v1, 0x31c0 /* 0C225C 800C165C 2484A734 */ addiu $a0, %lo(gCurFadeRed) # addiu $a0, $a0, -0x58cc /* 0C2260 800C1660 24A5A735 */ addiu $a1, %lo(gCurFadeGreen) # addiu $a1, $a1, -0x58cb /* 0C2264 800C1664 240902D0 */ li $t1, 720 @@ -109,10 +109,10 @@ glabel func_800C15D4 /* 0C237C 800C177C 006A082B */ sltu $at, $v1, $t2 /* 0C2380 800C1780 1420FFBB */ bnez $at, .L800C1670 /* 0C2384 800C1784 00001025 */ move $v0, $zero -/* 0C2388 800C1788 3C03800E */ lui $v1, %hi(D_800E31C0) # $v1, 0x800e -/* 0C238C 800C178C 3C0A800E */ lui $t2, %hi(D_800E31C8) # $t2, 0x800e -/* 0C2390 800C1790 254A31C8 */ addiu $t2, %lo(D_800E31C8) # addiu $t2, $t2, 0x31c8 -/* 0C2394 800C1794 246331C0 */ addiu $v1, %lo(D_800E31C0) # addiu $v1, $v1, 0x31c0 +/* 0C2388 800C1788 3C03800E */ lui $v1, %hi(sTransitionVtx) # $v1, 0x800e +/* 0C238C 800C178C 3C0A800E */ lui $t2, %hi(sTransitionTris) # $t2, 0x800e +/* 0C2390 800C1790 254A31C8 */ addiu $t2, %lo(sTransitionTris) # addiu $t2, $t2, 0x31c8 +/* 0C2394 800C1794 246331C0 */ addiu $v1, %lo(sTransitionVtx) # addiu $v1, $v1, 0x31c0 /* 0C2398 800C1798 24090009 */ li $t1, 9 /* 0C239C 800C179C 2408000A */ li $t0, 10 .L800C17A0: @@ -171,10 +171,10 @@ glabel func_800C15D4 /* 0C246C 800C186C 1420FFCC */ bnez $at, .L800C17A0 /* 0C2470 800C1870 00000000 */ nop /* 0C2474 800C1874 3C014370 */ li $at, 0x43700000 # 240.000000 -/* 0C2478 800C1878 3C12800E */ lui $s2, %hi(D_800E31C8) # $s2, 0x800e +/* 0C2478 800C1878 3C12800E */ lui $s2, %hi(sTransitionTris) # $s2, 0x800e /* 0C247C 800C187C 4481A000 */ mtc1 $at, $f20 /* 0C2480 800C1880 0000A825 */ move $s5, $zero -/* 0C2484 800C1884 265231C8 */ addiu $s2, %lo(D_800E31C8) # addiu $s2, $s2, 0x31c8 +/* 0C2484 800C1884 265231C8 */ addiu $s2, %lo(sTransitionTris) # addiu $s2, $s2, 0x31c8 /* 0C2488 800C1888 0000A025 */ move $s4, $zero /* 0C248C 800C188C 2410FFF0 */ li $s0, -16 .L800C1890: @@ -207,9 +207,9 @@ glabel func_800C15D4 /* 0C24F8 800C18F8 46080282 */ mul.s $f10, $f0, $f8 /* 0C24FC 800C18FC 0003C080 */ sll $t8, $v1, 2 /* 0C2500 800C1900 0303C021 */ addu $t8, $t8, $v1 -/* 0C2504 800C1904 3C02800E */ lui $v0, %hi(D_800E31C0) # $v0, 0x800e +/* 0C2504 800C1904 3C02800E */ lui $v0, %hi(sTransitionVtx) # $v0, 0x800e /* 0C2508 800C1908 4459F800 */ cfc1 $t9, $31 -/* 0C250C 800C190C 244231C0 */ addiu $v0, %lo(D_800E31C0) # addiu $v0, $v0, 0x31c0 +/* 0C250C 800C190C 244231C0 */ addiu $v0, %lo(sTransitionVtx) # addiu $v0, $v0, 0x31c0 /* 0C2510 800C1910 37210003 */ ori $at, $t9, 3 /* 0C2514 800C1914 38210002 */ xori $at, $at, 2 /* 0C2518 800C1918 44C1F800 */ ctc1 $at, $31 @@ -275,16 +275,16 @@ glabel func_800C15D4 /* 0C2604 800C1A04 1420FFA2 */ bnez $at, .L800C1890 /* 0C2608 800C1A08 26B51000 */ addiu $s5, $s5, 0x1000 /* 0C260C 800C1A0C 8FAE0038 */ lw $t6, 0x38($sp) -/* 0C2610 800C1A10 3C03800E */ lui $v1, %hi(D_800E31C8) # $v1, 0x800e +/* 0C2610 800C1A10 3C03800E */ lui $v1, %hi(sTransitionTris) # $v1, 0x800e /* 0C2614 800C1A14 91CF0000 */ lbu $t7, ($t6) -/* 0C2618 800C1A18 246331C8 */ addiu $v1, %lo(D_800E31C8) # addiu $v1, $v1, 0x31c8 +/* 0C2618 800C1A18 246331C8 */ addiu $v1, %lo(sTransitionTris) # addiu $v1, $v1, 0x31c8 /* 0C261C 800C1A1C 31F80080 */ andi $t8, $t7, 0x80 /* 0C2620 800C1A20 1300001D */ beqz $t8, .L800C1A98 -/* 0C2624 800C1A24 3C06800E */ lui $a2, %hi(D_800E31D0) # $a2, 0x800e +/* 0C2624 800C1A24 3C06800E */ lui $a2, %hi(sTransitionTaskNum) # $a2, 0x800e /* 0C2628 800C1A28 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0C262C 800C1A2C 3C19800E */ lui $t9, %hi(D_800E31B0) # $t9, 0x800e +/* 0C262C 800C1A2C 3C19800E */ lui $t9, %hi(sTransitionFadeTimer) # $t9, 0x800e /* 0C2630 800C1A30 44801000 */ mtc1 $zero, $f2 -/* 0C2634 800C1A34 973931B0 */ lhu $t9, %lo(D_800E31B0)($t9) +/* 0C2634 800C1A34 973931B0 */ lhu $t9, %lo(sTransitionFadeTimer)($t9) /* 0C2638 800C1A38 44816000 */ mtc1 $at, $f12 /* 0C263C 800C1A3C 3C018013 */ lui $at, %hi(D_8012A758) # $at, 0x8013 /* 0C2640 800C1A40 44999000 */ mtc1 $t9, $f18 @@ -312,9 +312,9 @@ glabel func_800C15D4 /* 0C2694 800C1A94 E42CA76C */ swc1 $f12, %lo(D_8012A76C)($at) .L800C1A98: /* 0C2698 800C1A98 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0C269C 800C1A9C 3C0D800E */ lui $t5, %hi(D_800E31B0) # $t5, 0x800e +/* 0C269C 800C1A9C 3C0D800E */ lui $t5, %hi(sTransitionFadeTimer) # $t5, 0x800e /* 0C26A0 800C1AA0 44816000 */ mtc1 $at, $f12 -/* 0C26A4 800C1AA4 95AD31B0 */ lhu $t5, %lo(D_800E31B0)($t5) +/* 0C26A4 800C1AA4 95AD31B0 */ lhu $t5, %lo(sTransitionFadeTimer)($t5) /* 0C26A8 800C1AA8 3C018013 */ lui $at, %hi(D_8012A758) # $at, 0x8013 /* 0C26AC 800C1AAC 448D5000 */ mtc1 $t5, $f10 /* 0C26B0 800C1AB0 E434A758 */ swc1 $f20, %lo(D_8012A758)($at) @@ -342,7 +342,7 @@ glabel func_800C15D4 /* 0C2704 800C1B04 3C018013 */ lui $at, %hi(D_8012A76C) # $at, 0x8013 /* 0C2708 800C1B08 E422A76C */ swc1 $f2, %lo(D_8012A76C)($at) .L800C1B0C: -/* 0C270C 800C1B0C 24C631D0 */ addiu $a2, %lo(D_800E31D0) # addiu $a2, $a2, 0x31d0 +/* 0C270C 800C1B0C 24C631D0 */ addiu $a2, %lo(sTransitionTaskNum) # addiu $a2, $a2, 0x31d0 /* 0C2710 800C1B10 24050400 */ li $a1, 1024 /* 0C2714 800C1B14 24040040 */ li $a0, 64 /* 0C2718 800C1B18 00001025 */ move $v0, $zero @@ -465,14 +465,14 @@ glabel func_800C15D4 /* 0C28E8 800C1CE8 0066082B */ sltu $at, $v1, $a2 /* 0C28EC 800C1CEC 1420FF8B */ bnez $at, .L800C1B1C /* 0C28F0 800C1CF0 00001025 */ move $v0, $zero -/* 0C28F4 800C1CF4 3C0A800E */ lui $t2, %hi(D_800E31D0) # $t2, 0x800e -/* 0C28F8 800C1CF8 254A31D0 */ addiu $t2, %lo(D_800E31D0) # addiu $t2, $t2, 0x31d0 +/* 0C28F4 800C1CF4 3C0A800E */ lui $t2, %hi(sTransitionTaskNum) # $t2, 0x800e +/* 0C28F8 800C1CF8 254A31D0 */ addiu $t2, %lo(sTransitionTaskNum) # addiu $t2, $t2, 0x31d0 /* 0C28FC 800C1CFC 0000A025 */ move $s4, $zero /* 0C2900 800C1D00 240B0008 */ li $t3, 8 /* 0C2904 800C1D04 00142040 */ sll $a0, $s4, 1 .L800C1D08: -/* 0C2908 800C1D08 3C02800E */ lui $v0, %hi(D_800E31C8) # $v0, 0x800e -/* 0C290C 800C1D0C 244231C8 */ addiu $v0, %lo(D_800E31C8) # addiu $v0, $v0, 0x31c8 +/* 0C2908 800C1D08 3C02800E */ lui $v0, %hi(sTransitionTris) # $v0, 0x800e +/* 0C290C 800C1D0C 244231C8 */ addiu $v0, %lo(sTransitionTris) # addiu $v0, $v0, 0x31c8 /* 0C2910 800C1D10 00041900 */ sll $v1, $a0, 4 /* 0C2914 800C1D14 24860001 */ addiu $a2, $a0, 1 /* 0C2918 800C1D18 24850003 */ addiu $a1, $a0, 3 @@ -580,7 +580,7 @@ glabel func_800C15D4 /* 0C2AAC 800C1EAC 00142040 */ sll $a0, $s4, 1 /* 0C2AB0 800C1EB0 8FBF0034 */ lw $ra, 0x34($sp) /* 0C2AB4 800C1EB4 240F0001 */ li $t7, 1 -/* 0C2AB8 800C1EB8 3C01800E */ lui $at, %hi(D_800E31AC) # $at, 0x800e +/* 0C2AB8 800C1EB8 3C01800E */ lui $at, %hi(sTransitionStatus) # $at, 0x800e /* 0C2ABC 800C1EBC C7B50010 */ lwc1 $f21, 0x10($sp) /* 0C2AC0 800C1EC0 C7B40014 */ lwc1 $f20, 0x14($sp) /* 0C2AC4 800C1EC4 8FB0001C */ lw $s0, 0x1c($sp) @@ -589,7 +589,7 @@ glabel func_800C15D4 /* 0C2AD0 800C1ED0 8FB30028 */ lw $s3, 0x28($sp) /* 0C2AD4 800C1ED4 8FB4002C */ lw $s4, 0x2c($sp) /* 0C2AD8 800C1ED8 8FB50030 */ lw $s5, 0x30($sp) -/* 0C2ADC 800C1EDC AC2F31AC */ sw $t7, %lo(D_800E31AC)($at) +/* 0C2ADC 800C1EDC AC2F31AC */ sw $t7, %lo(sTransitionStatus)($at) /* 0C2AE0 800C1EE0 03E00008 */ jr $ra /* 0C2AE4 800C1EE4 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/asm/non_matchings/fade_transition/func_800C1EE8.s b/asm/non_matchings/fade_transition/func_800C1EE8.s index 75e4cc35..2bebd001 100644 --- a/asm/non_matchings/fade_transition/func_800C1EE8.s +++ b/asm/non_matchings/fade_transition/func_800C1EE8.s @@ -5,8 +5,8 @@ glabel D_800E932C .text glabel func_800C1EE8 /* 0C2AE8 800C1EE8 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 0C2AEC 800C1EEC 3C03800E */ lui $v1, %hi(D_800E31B0) # $v1, 0x800e -/* 0C2AF0 800C1EF0 246331B0 */ addiu $v1, %lo(D_800E31B0) # addiu $v1, $v1, 0x31b0 +/* 0C2AEC 800C1EEC 3C03800E */ lui $v1, %hi(sTransitionFadeTimer) # $v1, 0x800e +/* 0C2AF0 800C1EF0 246331B0 */ addiu $v1, %lo(sTransitionFadeTimer) # addiu $v1, $v1, 0x31b0 /* 0C2AF4 800C1EF4 44842000 */ mtc1 $a0, $f4 /* 0C2AF8 800C1EF8 94620000 */ lhu $v0, ($v1) /* 0C2AFC 800C1EFC AFBF004C */ sw $ra, 0x4c($sp) @@ -61,11 +61,11 @@ glabel func_800C1EE8 /* 0C2BBC 800C1FBC E7D00000 */ swc1 $f16, ($fp) .L800C1FC0: /* 0C2BC0 800C1FC0 3C01800F */ lui $at, %hi(D_800E932C) # $at, 0x800f -/* 0C2BC4 800C1FC4 3C11800E */ lui $s1, %hi(D_800E31D0) # $s1, 0x800e -/* 0C2BC8 800C1FC8 3C10800E */ lui $s0, %hi(D_800E31C0) # $s0, 0x800e +/* 0C2BC4 800C1FC4 3C11800E */ lui $s1, %hi(sTransitionTaskNum) # $s1, 0x800e +/* 0C2BC8 800C1FC8 3C10800E */ lui $s0, %hi(sTransitionVtx) # $s0, 0x800e /* 0C2BCC 800C1FCC C436932C */ lwc1 $f22, %lo(D_800E932C)($at) -/* 0C2BD0 800C1FD0 261031C0 */ addiu $s0, %lo(D_800E31C0) # addiu $s0, $s0, 0x31c0 -/* 0C2BD4 800C1FD4 263131D0 */ addiu $s1, %lo(D_800E31D0) # addiu $s1, $s1, 0x31d0 +/* 0C2BD0 800C1FD0 261031C0 */ addiu $s0, %lo(sTransitionVtx) # addiu $s0, $s0, 0x31c0 +/* 0C2BD4 800C1FD4 263131D0 */ addiu $s1, %lo(sTransitionTaskNum) # addiu $s1, $s1, 0x31d0 /* 0C2BD8 800C1FD8 00009025 */ move $s2, $zero /* 0C2BDC 800C1FDC 24160009 */ li $s6, 9 /* 0C2BE0 800C1FE0 2415000A */ li $s5, 10 @@ -208,8 +208,8 @@ glabel func_800C1EE8 /* 0C2E00 800C2200 1000000D */ b .L800C2238 /* 0C2E04 800C2204 8FBF004C */ lw $ra, 0x4c($sp) .L800C2208: -/* 0C2E08 800C2208 3C03800E */ lui $v1, %hi(D_800E31B4) # $v1, 0x800e -/* 0C2E0C 800C220C 246331B4 */ addiu $v1, %lo(D_800E31B4) # addiu $v1, $v1, 0x31b4 +/* 0C2E08 800C2208 3C03800E */ lui $v1, %hi(sTransitionFlags) # $v1, 0x800e +/* 0C2E0C 800C220C 246331B4 */ addiu $v1, %lo(sTransitionFlags) # addiu $v1, $v1, 0x31b4 /* 0C2E10 800C2210 94620000 */ lhu $v0, ($v1) /* 0C2E14 800C2214 3401FFFF */ li $at, 65535 /* 0C2E18 800C2218 10410006 */ beq $v0, $at, .L800C2234 diff --git a/asm/non_matchings/fade_transition/func_800C2640.s b/asm/non_matchings/fade_transition/func_800C2640.s index 8c1b8638..13cb6f2c 100644 --- a/asm/non_matchings/fade_transition/func_800C2640.s +++ b/asm/non_matchings/fade_transition/func_800C2640.s @@ -20,16 +20,16 @@ glabel func_800C2640 /* 0C3288 800C2688 A02AA737 */ sb $t2, %lo(gCurFadeAlpha)($at) /* 0C328C 800C268C 3C01437F */ li $at, 0x437F0000 # 255.000000 /* 0C3290 800C2690 44812000 */ mtc1 $at, $f4 -/* 0C3294 800C2694 3C018013 */ lui $at, %hi(D_8012A750) # $at, 0x8013 +/* 0C3294 800C2694 3C018013 */ lui $at, %hi(sTransitionOpacity) # $at, 0x8013 /* 0C3298 800C2698 44803000 */ mtc1 $zero, $f6 -/* 0C329C 800C269C E424A750 */ swc1 $f4, %lo(D_8012A750)($at) +/* 0C329C 800C269C E424A750 */ swc1 $f4, %lo(sTransitionOpacity)($at) /* 0C32A0 800C26A0 3C018013 */ lui $at, %hi(D_8012A754) # $at, 0x8013 /* 0C32A4 800C26A4 3C0B8013 */ lui $t3, %hi(gCurFadeRed) # $t3, 0x8013 /* 0C32A8 800C26A8 916BA734 */ lbu $t3, %lo(gCurFadeRed)($t3) /* 0C32AC 800C26AC E426A754 */ swc1 $f6, %lo(D_8012A754)($at) /* 0C32B0 800C26B0 8C6D0000 */ lw $t5, ($v1) -/* 0C32B4 800C26B4 3C02800E */ lui $v0, %hi(D_800E31B0) # $v0, 0x800e -/* 0C32B8 800C26B8 944231B0 */ lhu $v0, %lo(D_800E31B0)($v0) +/* 0C32B4 800C26B4 3C02800E */ lui $v0, %hi(sTransitionFadeTimer) # $v0, 0x800e +/* 0C32B8 800C26B8 944231B0 */ lhu $v0, %lo(sTransitionFadeTimer)($v0) /* 0C32BC 800C26BC 000B6400 */ sll $t4, $t3, 0x10 /* 0C32C0 800C26C0 018D7023 */ subu $t6, $t4, $t5 /* 0C32C4 800C26C4 01C2001A */ div $zero, $t6, $v0 @@ -90,7 +90,7 @@ glabel func_800C2640 /* 0C3388 800C2788 3C018013 */ lui $at, %hi(D_8012A74C) # $at, 0x8013 /* 0C338C 800C278C 00007812 */ mflo $t7 /* 0C3390 800C2790 AC2FA74C */ sw $t7, %lo(D_8012A74C)($at) -/* 0C3394 800C2794 3C01800E */ lui $at, %hi(D_800E31AC) # $at, 0x800e +/* 0C3394 800C2794 3C01800E */ lui $at, %hi(sTransitionStatus) # $at, 0x800e /* 0C3398 800C2798 03E00008 */ jr $ra -/* 0C339C 800C279C AC3831AC */ sw $t8, %lo(D_800E31AC)($at) +/* 0C339C 800C279C AC3831AC */ sw $t8, %lo(sTransitionStatus)($at) diff --git a/asm/non_matchings/fade_transition/func_800C27A0.s b/asm/non_matchings/fade_transition/func_800C27A0.s index 8dee2e01..62c868d7 100644 --- a/asm/non_matchings/fade_transition/func_800C27A0.s +++ b/asm/non_matchings/fade_transition/func_800C27A0.s @@ -4,7 +4,7 @@ glabel func_800C27A0 /* 0C33A8 800C27A8 AFB00004 */ sw $s0, 4($sp) /* 0C33AC 800C27AC AFB10008 */ sw $s1, 8($sp) /* 0C33B0 800C27B0 3C108013 */ lui $s0, %hi(gCurFadeBlue) # $s0, 0x8013 -/* 0C33B4 800C27B4 3C12800E */ lui $s2, %hi(D_800E31B4) # $s2, 0x800e +/* 0C33B4 800C27B4 3C12800E */ lui $s2, %hi(sTransitionFlags) # $s2, 0x800e /* 0C33B8 800C27B8 3C0D8013 */ lui $t5, %hi(gCurFadeGreen) # $t5, 0x8013 /* 0C33BC 800C27BC 3C0C8013 */ lui $t4, %hi(gCurFadeRed) # $t4, 0x8013 /* 0C33C0 800C27C0 3C0B8013 */ lui $t3, %hi(D_8012A74C) # $t3, 0x8013 @@ -13,8 +13,8 @@ glabel func_800C27A0 /* 0C33CC 800C27CC 3C088013 */ lui $t0, %hi(gLastFadeGreen) # $t0, 0x8013 /* 0C33D0 800C27D0 3C078013 */ lui $a3, %hi(D_8012A744) # $a3, 0x8013 /* 0C33D4 800C27D4 3C068013 */ lui $a2, %hi(gLastFadeRed) # $a2, 0x8013 -/* 0C33D8 800C27D8 3C05800E */ lui $a1, %hi(D_800E31B0) # $a1, 0x800e -/* 0C33DC 800C27DC 24A531B0 */ addiu $a1, %lo(D_800E31B0) # addiu $a1, $a1, 0x31b0 +/* 0C33D8 800C27D8 3C05800E */ lui $a1, %hi(sTransitionFadeTimer) # $a1, 0x800e +/* 0C33DC 800C27DC 24A531B0 */ addiu $a1, %lo(sTransitionFadeTimer) # addiu $a1, $a1, 0x31b0 /* 0C33E0 800C27E0 24C6A738 */ addiu $a2, %lo(gLastFadeRed) # addiu $a2, $a2, -0x58c8 /* 0C33E4 800C27E4 24E7A744 */ addiu $a3, %lo(D_8012A744) # addiu $a3, $a3, -0x58bc /* 0C33E8 800C27E8 2508A73C */ addiu $t0, %lo(gLastFadeGreen) # addiu $t0, $t0, -0x58c4 @@ -23,7 +23,7 @@ glabel func_800C27A0 /* 0C33F4 800C27F4 256BA74C */ addiu $t3, %lo(D_8012A74C) # addiu $t3, $t3, -0x58b4 /* 0C33F8 800C27F8 258CA734 */ addiu $t4, %lo(gCurFadeRed) # addiu $t4, $t4, -0x58cc /* 0C33FC 800C27FC 25ADA735 */ addiu $t5, %lo(gCurFadeGreen) # addiu $t5, $t5, -0x58cb -/* 0C3400 800C2800 265231B4 */ addiu $s2, %lo(D_800E31B4) # addiu $s2, $s2, 0x31b4 +/* 0C3400 800C2800 265231B4 */ addiu $s2, %lo(sTransitionFlags) # addiu $s2, $s2, 0x31b4 /* 0C3404 800C2804 2610A736 */ addiu $s0, %lo(gCurFadeBlue) # addiu $s0, $s0, -0x58ca /* 0C3408 800C2808 3411FFFF */ li $s1, 65535 /* 0C340C 800C280C 24020001 */ li $v0, 1 diff --git a/asm/non_matchings/fade_transition/render_fade_circle.s b/asm/non_matchings/fade_transition/render_fade_circle.s index f761cf54..e6aa5031 100644 --- a/asm/non_matchings/fade_transition/render_fade_circle.s +++ b/asm/non_matchings/fade_transition/render_fade_circle.s @@ -5,20 +5,20 @@ glabel render_fade_circle /* 0C2E80 800C2280 AFA5001C */ sw $a1, 0x1c($sp) /* 0C2E84 800C2284 0C01ECF4 */ jal func_8007B3D0 /* 0C2E88 800C2288 AFA60020 */ sw $a2, 0x20($sp) -/* 0C2E8C 800C228C 3C03800E */ lui $v1, %hi(D_800E31D0) # $v1, 0x800e -/* 0C2E90 800C2290 8C6331D0 */ lw $v1, %lo(D_800E31D0)($v1) +/* 0C2E8C 800C228C 3C03800E */ lui $v1, %hi(sTransitionTaskNum) # $v1, 0x800e +/* 0C2E90 800C2290 8C6331D0 */ lw $v1, %lo(sTransitionTaskNum)($v1) /* 0C2E94 800C2294 8FAE0018 */ lw $t6, 0x18($sp) -/* 0C2E98 800C2298 3C07800E */ lui $a3, %hi(D_800E31C0) # $a3, 0x800e +/* 0C2E98 800C2298 3C07800E */ lui $a3, %hi(sTransitionVtx) # $a3, 0x800e /* 0C2E9C 800C229C 00037880 */ sll $t7, $v1, 2 /* 0C2EA0 800C22A0 8DC20000 */ lw $v0, ($t6) /* 0C2EA4 800C22A4 00EF3821 */ addu $a3, $a3, $t7 -/* 0C2EA8 800C22A8 3C08800E */ lui $t0, %hi(D_800E31C8) # $t0, 0x800e -/* 0C2EAC 800C22AC 8CE731C0 */ lw $a3, %lo(D_800E31C0)($a3) +/* 0C2EA8 800C22A8 3C08800E */ lui $t0, %hi(sTransitionTris) # $t0, 0x800e +/* 0C2EAC 800C22AC 8CE731C0 */ lw $a3, %lo(sTransitionVtx)($a3) /* 0C2EB0 800C22B0 010F4021 */ addu $t0, $t0, $t7 -/* 0C2EB4 800C22B4 8D0831C8 */ lw $t0, %lo(D_800E31C8)($t0) -/* 0C2EB8 800C22B8 3C19800E */ lui $t9, %hi(D_800E3648) # $t9, 0x800e +/* 0C2EB4 800C22B4 8D0831C8 */ lw $t0, %lo(sTransitionTris)($t0) +/* 0C2EB8 800C22B8 3C19800E */ lui $t9, %hi(dl_transition_shape_settings) # $t9, 0x800e /* 0C2EBC 800C22BC 00402025 */ move $a0, $v0 -/* 0C2EC0 800C22C0 27393648 */ addiu $t9, %lo(D_800E3648) # addiu $t9, $t9, 0x3648 +/* 0C2EC0 800C22C0 27393648 */ addiu $t9, %lo(dl_transition_shape_settings) # 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 13f9b394..36108975 100644 --- a/asm/non_matchings/fade_transition/render_fade_waves.s +++ b/asm/non_matchings/fade_transition/render_fade_waves.s @@ -6,20 +6,20 @@ glabel render_fade_waves /* 0C3008 800C2408 AFA50024 */ sw $a1, 0x24($sp) /* 0C300C 800C240C 0C01ECF4 */ jal func_8007B3D0 /* 0C3010 800C2410 AFA60028 */ sw $a2, 0x28($sp) -/* 0C3014 800C2414 3C03800E */ lui $v1, %hi(D_800E31D0) # $v1, 0x800e +/* 0C3014 800C2414 3C03800E */ lui $v1, %hi(sTransitionTaskNum) # $v1, 0x800e /* 0C3018 800C2418 8FAE0020 */ lw $t6, 0x20($sp) -/* 0C301C 800C241C 8C6331D0 */ lw $v1, %lo(D_800E31D0)($v1) +/* 0C301C 800C241C 8C6331D0 */ lw $v1, %lo(sTransitionTaskNum)($v1) /* 0C3020 800C2420 8DC20000 */ lw $v0, ($t6) /* 0C3024 800C2424 00037880 */ sll $t7, $v1, 2 -/* 0C3028 800C2428 3C06800E */ lui $a2, %hi(D_800E31C0) # $a2, 0x800e -/* 0C302C 800C242C 3C07800E */ lui $a3, %hi(D_800E31C8) # $a3, 0x800e +/* 0C3028 800C2428 3C06800E */ lui $a2, %hi(sTransitionVtx) # $a2, 0x800e +/* 0C302C 800C242C 3C07800E */ lui $a3, %hi(sTransitionTris) # $a3, 0x800e /* 0C3030 800C2430 00CF3021 */ addu $a2, $a2, $t7 /* 0C3034 800C2434 00EF3821 */ addu $a3, $a3, $t7 /* 0C3038 800C2438 00402025 */ move $a0, $v0 -/* 0C303C 800C243C 8CC631C0 */ lw $a2, %lo(D_800E31C0)($a2) -/* 0C3040 800C2440 8CE731C8 */ lw $a3, %lo(D_800E31C8)($a3) -/* 0C3044 800C2444 3C19800E */ lui $t9, %hi(D_800E3648) # $t9, 0x800e -/* 0C3048 800C2448 27393648 */ addiu $t9, %lo(D_800E3648) # addiu $t9, $t9, 0x3648 +/* 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 /* 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 a75f8509..8eb0eed2 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(D_800E3690) # $t8, 0x800e -/* 0C520C 800C460C 27183690 */ addiu $t8, %lo(D_800E3690) # addiu $t8, $t8, 0x3690 +/* 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 /* 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 - # D_800E3690 - 0x7FFFFFB8 = 0xE36D8 -/* 0C54A0 800C48A0 3C0E000E */ lui $t6, %hi(D_800E3690 - 0x7FFFFFB8) # $t6, 0xe -/* 0C54A4 800C48A4 25CE36D8 */ addiu $t6, %lo(D_800E3690 - 0x7FFFFFB8) # addiu $t6, $t6, 0x36d8 + # 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 /* 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) - # D_800E3690 - 0x7FFFFFC8 = 0xE36C8 -/* 0C55B4 800C49B4 3C0F000E */ lui $t7, %hi(D_800E3690 - 0x7FFFFFC8) # $t7, 0xe + # dl_dialogue_box_begin - 0x7FFFFFC8 = 0xE36C8 +/* 0C55B4 800C49B4 3C0F000E */ lui $t7, %hi(dl_dialogue_box_begin - 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 - # D_800E3690 - 0x7FFFFFC8 = 0xE36C8 -/* 0C55C8 800C49C8 25EF36C8 */ addiu $t7, %lo(D_800E3690 - 0x7FFFFFC8) # addiu $t7, $t7, 0x36c8 + # dl_dialogue_box_begin - 0x7FFFFFC8 = 0xE36C8 +/* 0C55C8 800C49C8 25EF36C8 */ addiu $t7, %lo(dl_dialogue_box_begin - 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/font/s32_to_string.s b/asm/non_matchings/font/s32_to_string.s index c0f25d3e..50682d6d 100644 --- a/asm/non_matchings/font/s32_to_string.s +++ b/asm/non_matchings/font/s32_to_string.s @@ -43,8 +43,8 @@ glabel s32_to_string .L800C58A0: /* 0C64A0 800C58A0 3C0D800E */ lui $t5, %hi(gDescPowsOf10) # $t5, 0x800e /* 0C64A4 800C58A4 25AD36EC */ addiu $t5, %lo(gDescPowsOf10) # addiu $t5, $t5, 0x36ec -/* 0C64A8 800C58A8 3C0C800E */ lui $t4, %hi(D_800E3710) # $t4, 0x800e -/* 0C64AC 800C58AC 258C3710 */ addiu $t4, %lo(D_800E3710) # addiu $t4, $t4, 0x3710 +/* 0C64A8 800C58A8 3C0C800E */ lui $t4, %hi(sDialogueBoxDimensions) # $t4, 0x800e +/* 0C64AC 800C58AC 258C3710 */ addiu $t4, %lo(sDialogueBoxDimensions) # addiu $t4, $t4, 0x3710 /* 0C64B0 800C58B0 032D4021 */ addu $t0, $t9, $t5 .L800C58B4: /* 0C64B4 800C58B4 8D060000 */ lw $a2, ($t0) diff --git a/asm/non_matchings/game_text/func_800C2B00.s b/asm/non_matchings/game_text/func_800C2B00.s index 6f36c50a..cbde9fd2 100644 --- a/asm/non_matchings/game_text/func_800C2B00.s +++ b/asm/non_matchings/game_text/func_800C2B00.s @@ -10,7 +10,7 @@ glabel func_800C2B00 /* 0C3720 800C2B20 AFB20028 */ sw $s2, 0x28($sp) /* 0C3724 800C2B24 AFB10024 */ sw $s1, 0x24($sp) /* 0C3728 800C2B28 AFB00020 */ sw $s0, 0x20($sp) -/* 0C372C 800C2B2C 0C031525 */ jal func_800C5494 +/* 0C372C 800C2B2C 0C031525 */ jal assign_dialogue_box_id /* 0C3730 800C2B30 24040006 */ li $a0, 6 /* 0C3734 800C2B34 3C118013 */ lui $s1, %hi(D_8012A7B4) # $s1, 0x8013 /* 0C3738 800C2B38 2631A7B4 */ addiu $s1, %lo(D_8012A7B4) # addiu $s1, $s1, -0x584c diff --git a/asm/non_matchings/menu/func_8008377C.s b/asm/non_matchings/menu/func_8008377C.s index f2059977..4badf1e7 100644 --- a/asm/non_matchings/menu/func_8008377C.s +++ b/asm/non_matchings/menu/func_8008377C.s @@ -70,7 +70,7 @@ glabel func_8008377C /* 084488 80083888 0C01E2AE */ jal render_textured_rectangle /* 08448C 8008388C 24070034 */ li $a3, 52 .L80083890: -/* 084490 80083890 0C01BD32 */ jal func_8006F4C8 +/* 084490 80083890 0C01BD32 */ jal is_controller_missing /* 084494 80083894 00000000 */ nop /* 084498 80083898 14400047 */ bnez $v0, .L800839B8 /* 08449C 8008389C 3C0D8000 */ lui $t5, %hi(osTvType) # $t5, 0x8000 diff --git a/asm/non_matchings/menu/func_80084854.s b/asm/non_matchings/menu/func_80084854.s index 21de0848..58de7a46 100644 --- a/asm/non_matchings/menu/func_80084854.s +++ b/asm/non_matchings/menu/func_80084854.s @@ -125,7 +125,7 @@ glabel func_80084854 /* 085624 80084A24 AFA80020 */ sw $t0, 0x20($sp) /* 085628 80084A28 0C0202F2 */ jal func_80080BC8 /* 08562C 80084A2C 02402025 */ move $a0, $s2 -/* 085630 80084A30 0C031525 */ jal func_800C5494 +/* 085630 80084A30 0C031525 */ jal assign_dialogue_box_id /* 085634 80084A34 24040007 */ li $a0, 7 /* 085638 80084A38 240900FF */ li $t1, 255 /* 08563C 80084A3C AFA90010 */ sw $t1, 0x10($sp) @@ -144,7 +144,7 @@ glabel func_80084854 /* 085670 80084A70 02402025 */ move $a0, $s2 /* 085674 80084A74 00002825 */ move $a1, $zero /* 085678 80084A78 00003025 */ move $a2, $zero -/* 08567C 80084A7C 0C0316D6 */ jal func_800C5B58 +/* 08567C 80084A7C 0C0316D6 */ jal render_dialogue_box /* 085680 80084A80 24070007 */ li $a3, 7 /* 085684 80084A84 240A00A3 */ li $t2, 163 /* 085688 80084A88 AFAA0010 */ sw $t2, 0x10($sp) @@ -156,7 +156,7 @@ glabel func_80084854 /* 0856A0 80084AA0 02402025 */ move $a0, $s2 /* 0856A4 80084AA4 00002825 */ move $a1, $zero /* 0856A8 80084AA8 00003025 */ move $a2, $zero -/* 0856AC 80084AAC 0C0316D6 */ jal func_800C5B58 +/* 0856AC 80084AAC 0C0316D6 */ jal render_dialogue_box /* 0856B0 80084AB0 24070007 */ li $a3, 7 /* 0856B4 80084AB4 3C06800E */ lui $a2, %hi(gSfxVolumeSliderValue) # $a2, 0x800e /* 0856B8 80084AB8 8CC6FAC0 */ lw $a2, %lo(gSfxVolumeSliderValue)($a2) diff --git a/asm/non_matchings/menu/func_80085B9C.s b/asm/non_matchings/menu/func_80085B9C.s index b3d1480b..925765af 100644 --- a/asm/non_matchings/menu/func_80085B9C.s +++ b/asm/non_matchings/menu/func_80085B9C.s @@ -338,7 +338,7 @@ glabel L80085C30 /* 086C6C 8008606C 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 086C70 80086070 00002825 */ move $a1, $zero /* 086C74 80086074 00003025 */ move $a2, $zero -/* 086C78 80086078 0C0316D6 */ jal func_800C5B58 +/* 086C78 80086078 0C0316D6 */ jal render_dialogue_box /* 086C7C 8008607C 24070007 */ li $a3, 7 .L80086080: /* 086C80 80086080 0C02039B */ jal func_80080E6C diff --git a/asm/non_matchings/menu/func_800871D8.s b/asm/non_matchings/menu/func_800871D8.s index 3f30b2d7..91c02c01 100644 --- a/asm/non_matchings/menu/func_800871D8.s +++ b/asm/non_matchings/menu/func_800871D8.s @@ -59,7 +59,7 @@ glabel func_800871D8 /* 087EAC 800872AC 8CB80000 */ lw $t8, ($a1) /* 087EB0 800872B0 24040007 */ li $a0, 7 /* 087EB4 800872B4 2719FFFF */ addiu $t9, $t8, -1 -/* 087EB8 800872B8 0C031525 */ jal func_800C5494 +/* 087EB8 800872B8 0C031525 */ jal assign_dialogue_box_id /* 087EBC 800872BC AC396A78 */ sw $t9, %lo(D_80126A78)($at) /* 087EC0 800872C0 00101100 */ sll $v0, $s0, 4 /* 087EC4 800872C4 2442002C */ addiu $v0, $v0, 0x2c diff --git a/asm/non_matchings/menu/func_80088938.s b/asm/non_matchings/menu/func_80088938.s index 16681f23..1690ff75 100644 --- a/asm/non_matchings/menu/func_80088938.s +++ b/asm/non_matchings/menu/func_80088938.s @@ -77,7 +77,7 @@ glabel func_80088938 /* 08965C 80088A5C 0C031110 */ jal draw_text /* 089660 80088A60 2406001E */ li $a2, 30 /* 089664 80088A64 24150030 */ li $s5, 48 -/* 089668 80088A68 0C031525 */ jal func_800C5494 +/* 089668 80088A68 0C031525 */ jal assign_dialogue_box_id /* 08966C 80088A6C 24040006 */ li $a0, 6 /* 089670 80088A70 26AE001E */ addiu $t6, $s5, 0x1e /* 089674 80088A74 AFAE0010 */ sw $t6, 0x10($sp) @@ -155,7 +155,7 @@ glabel func_80088938 /* 08978C 80088B8C 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 089790 80088B90 00002825 */ move $a1, $zero /* 089794 80088B94 00003025 */ move $a2, $zero -/* 089798 80088B98 0C0316D6 */ jal func_800C5B58 +/* 089798 80088B98 0C0316D6 */ jal render_dialogue_box /* 08979C 80088B9C 24070006 */ li $a3, 6 /* 0897A0 80088BA0 26B50022 */ addiu $s5, $s5, 0x22 /* 0897A4 80088BA4 24040006 */ li $a0, 6 @@ -173,7 +173,7 @@ glabel func_80088938 /* 0897D4 80088BD4 04400077 */ bltz $v0, .L80088DB4 /* 0897D8 80088BD8 00000000 */ nop .L80088BDC: -/* 0897DC 80088BDC 0C031525 */ jal func_800C5494 +/* 0897DC 80088BDC 0C031525 */ jal assign_dialogue_box_id /* 0897E0 80088BE0 24040006 */ li $a0, 6 /* 0897E4 80088BE4 26A9000E */ addiu $t1, $s5, 0xe /* 0897E8 80088BE8 AFA90010 */ sw $t1, 0x10($sp) @@ -287,7 +287,7 @@ glabel func_80088938 /* 089988 80088D88 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 08998C 80088D8C 00002825 */ move $a1, $zero /* 089990 80088D90 00003025 */ move $a2, $zero -/* 089994 80088D94 0C0316D6 */ jal func_800C5B58 +/* 089994 80088D94 0C0316D6 */ jal render_dialogue_box /* 089998 80088D98 24070006 */ li $a3, 6 /* 08999C 80088D9C 3C028012 */ lui $v0, %hi(D_80126BB4) # $v0, 0x8012 /* 0899A0 80088DA0 8C426BB4 */ lw $v0, %lo(D_80126BB4)($v0) @@ -377,7 +377,7 @@ glabel func_80088938 /* 089ADC 80088EDC 10000001 */ b .L80088EE4 /* 089AE0 80088EE0 24150086 */ li $s5, 134 .L80088EE4: -/* 089AE4 80088EE4 0C031525 */ jal func_800C5494 +/* 089AE4 80088EE4 0C031525 */ jal assign_dialogue_box_id /* 089AE8 80088EE8 24040006 */ li $a0, 6 /* 089AEC 80088EEC 24040006 */ li $a0, 6 /* 089AF0 80088EF0 0C0313DF */ jal set_dialogue_font @@ -463,7 +463,7 @@ glabel func_80088938 /* 089C18 80089018 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 089C1C 8008901C 00002825 */ move $a1, $zero /* 089C20 80089020 00003025 */ move $a2, $zero -/* 089C24 80089024 0C0316D6 */ jal func_800C5B58 +/* 089C24 80089024 0C0316D6 */ jal render_dialogue_box /* 089C28 80089028 24070006 */ li $a3, 6 .L8008902C: /* 089C2C 8008902C 3C0F8012 */ lui $t7, %hi(D_80126C10) # $t7, 0x8012 diff --git a/asm/non_matchings/menu/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s index 6d028fff..a0877356 100644 --- a/asm/non_matchings/menu/func_80092E94.s +++ b/asm/non_matchings/menu/func_80092E94.s @@ -272,7 +272,7 @@ glabel func_80092E94 /* 093EBC 800932BC 02402025 */ move $a0, $s2 /* 093EC0 800932C0 00002825 */ move $a1, $zero /* 093EC4 800932C4 00003025 */ move $a2, $zero -/* 093EC8 800932C8 0C0316D6 */ jal func_800C5B58 +/* 093EC8 800932C8 0C0316D6 */ jal render_dialogue_box /* 093ECC 800932CC 24070007 */ li $a3, 7 /* 093ED0 800932D0 8FA70060 */ lw $a3, 0x60($sp) /* 093ED4 800932D4 3C05800E */ lui $a1, %hi(D_800E05B4) # $a1, 0x800e diff --git a/asm/non_matchings/menu/func_80093D40.s b/asm/non_matchings/menu/func_80093D40.s index 8541b37c..17df5444 100644 --- a/asm/non_matchings/menu/func_80093D40.s +++ b/asm/non_matchings/menu/func_80093D40.s @@ -47,7 +47,7 @@ glabel func_80093D40 /* 0949E0 80093DE0 24040007 */ li $a0, 7 /* 0949E4 80093DE4 0C0315B4 */ jal func_800C56D0 /* 0949E8 80093DE8 AFA80038 */ sw $t0, 0x38($sp) -/* 0949EC 80093DEC 0C031525 */ jal func_800C5494 +/* 0949EC 80093DEC 0C031525 */ jal assign_dialogue_box_id /* 0949F0 80093DF0 24040007 */ li $a0, 7 /* 0949F4 80093DF4 8FA80038 */ lw $t0, 0x38($sp) /* 0949F8 80093DF8 00118043 */ sra $s0, $s1, 1 diff --git a/asm/non_matchings/menu/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s index 867fb7ff..28e7c3bd 100644 --- a/asm/non_matchings/menu/func_80094D28.s +++ b/asm/non_matchings/menu/func_80094D28.s @@ -334,7 +334,7 @@ glabel L80095110 glabel L800951CC /* 095DCC 800951CC 0C0315B4 */ jal func_800C56D0 /* 095DD0 800951D0 24040007 */ li $a0, 7 -/* 095DD4 800951D4 0C031525 */ jal func_800C5494 +/* 095DD4 800951D4 0C031525 */ jal assign_dialogue_box_id /* 095DD8 800951D8 24040007 */ li $a0, 7 /* 095DDC 800951DC 24040007 */ li $a0, 7 /* 095DE0 800951E0 0C0313DF */ jal set_dialogue_font diff --git a/asm/non_matchings/menu/func_80095728.s b/asm/non_matchings/menu/func_80095728.s index e6d9fb2e..b1077db4 100644 --- a/asm/non_matchings/menu/func_80095728.s +++ b/asm/non_matchings/menu/func_80095728.s @@ -1000,7 +1000,7 @@ glabel L800964DC /* 097168 80096568 00000000 */ nop /* 09716C 8009656C 0C031588 */ jal close_dialogue_box /* 097170 80096570 24040007 */ li $a0, 7 -/* 097174 80096574 0C031525 */ jal func_800C5494 +/* 097174 80096574 0C031525 */ jal assign_dialogue_box_id /* 097178 80096578 24040007 */ li $a0, 7 /* 09717C 8009657C 3C028012 */ lui $v0, %hi(D_80126C28) # $v0, 0x8012 /* 097180 80096580 80426C28 */ lb $v0, %lo(D_80126C28)($v0) diff --git a/asm/non_matchings/menu/func_80096978.s b/asm/non_matchings/menu/func_80096978.s index 167233af..1f946ea7 100644 --- a/asm/non_matchings/menu/func_80096978.s +++ b/asm/non_matchings/menu/func_80096978.s @@ -413,7 +413,7 @@ glabel func_80096978 /* 097B98 80096F98 000B60C0 */ sll $t4, $t3, 3 /* 097B9C 80096F9C 0C0315B4 */ jal func_800C56D0 /* 097BA0 80096FA0 AFAC00A8 */ sw $t4, 0xa8($sp) -/* 097BA4 80096FA4 0C031525 */ jal func_800C5494 +/* 097BA4 80096FA4 0C031525 */ jal assign_dialogue_box_id /* 097BA8 80096FA8 24040007 */ li $a0, 7 /* 097BAC 80096FAC 8FA20098 */ lw $v0, 0x98($sp) /* 097BB0 80096FB0 8FAE00A8 */ lw $t6, 0xa8($sp) diff --git a/asm/non_matchings/menu/func_80099E8C.s b/asm/non_matchings/menu/func_80099E8C.s index dbeb25f0..befda9d0 100644 --- a/asm/non_matchings/menu/func_80099E8C.s +++ b/asm/non_matchings/menu/func_80099E8C.s @@ -439,7 +439,7 @@ glabel func_80099E8C /* 09B10C 8009A50C AFA900D8 */ sw $t1, 0xd8($sp) /* 09B110 8009A510 0C0315B4 */ jal func_800C56D0 /* 09B114 8009A514 24040007 */ li $a0, 7 -/* 09B118 8009A518 0C031525 */ jal func_800C5494 +/* 09B118 8009A518 0C031525 */ jal assign_dialogue_box_id /* 09B11C 8009A51C 24040007 */ li $a0, 7 /* 09B120 8009A520 240B008A */ li $t3, 138 /* 09B124 8009A524 AFAB0010 */ sw $t3, 0x10($sp) @@ -537,7 +537,7 @@ glabel func_80099E8C /* 09B284 8009A684 02E02025 */ move $a0, $s7 /* 09B288 8009A688 00002825 */ move $a1, $zero /* 09B28C 8009A68C 00003025 */ move $a2, $zero -/* 09B290 8009A690 0C0316D6 */ jal func_800C5B58 +/* 09B290 8009A690 0C0316D6 */ jal render_dialogue_box /* 09B294 8009A694 24070007 */ li $a3, 7 .L8009A698: /* 09B298 8009A698 3C098012 */ lui $t1, %hi(D_801263BC) # $t1, 0x8012 diff --git a/asm/non_matchings/menu/menu_results_loop.s b/asm/non_matchings/menu/menu_results_loop.s index a60b4d45..1ea8a9c9 100644 --- a/asm/non_matchings/menu/menu_results_loop.s +++ b/asm/non_matchings/menu/menu_results_loop.s @@ -248,7 +248,7 @@ glabel menu_results_loop /* 098230 80097630 00000000 */ nop /* 098234 80097634 0C031588 */ jal close_dialogue_box /* 098238 80097638 24040007 */ li $a0, 7 -/* 09823C 8009763C 0C031525 */ jal func_800C5494 +/* 09823C 8009763C 0C031525 */ jal assign_dialogue_box_id /* 098240 80097640 24040007 */ li $a0, 7 /* 098244 80097644 3C068012 */ lui $a2, %hi(D_80126A68) # $a2, 0x8012 /* 098248 80097648 24C66A68 */ addiu $a2, %lo(D_80126A68) # addiu $a2, $a2, 0x6a68 diff --git a/asm/non_matchings/menu/menu_title_screen_loop.s b/asm/non_matchings/menu/menu_title_screen_loop.s index e42df968..efcf00fc 100644 --- a/asm/non_matchings/menu/menu_title_screen_loop.s +++ b/asm/non_matchings/menu/menu_title_screen_loop.s @@ -374,7 +374,7 @@ glabel menu_title_screen_loop /* 084B40 80083F40 00000000 */ nop /* 084B44 80083F44 15A00041 */ bnez $t5, .L8008404C /* 084B48 80083F48 00000000 */ nop -/* 084B4C 80083F4C 0C01BD32 */ jal func_8006F4C8 +/* 084B4C 80083F4C 0C01BD32 */ jal is_controller_missing /* 084B50 80083F50 00000000 */ nop /* 084B54 80083F54 1440003D */ bnez $v0, .L8008404C /* 084B58 80083F58 3C038012 */ lui $v1, %hi(D_80126838) # $v1, 0x8012 diff --git a/asm/non_matchings/menu/menu_track_select_init.s b/asm/non_matchings/menu/menu_track_select_init.s index c3f38062..cec61731 100644 --- a/asm/non_matchings/menu/menu_track_select_init.s +++ b/asm/non_matchings/menu/menu_track_select_init.s @@ -514,7 +514,7 @@ glabel menu_track_select_init /* 08FB54 8008EF54 3C018012 */ lui $at, %hi(D_801269F8) # $at, 0x8012 /* 08FB58 8008EF58 AC2069F8 */ sw $zero, %lo(D_801269F8)($at) .L8008EF5C: -/* 08FB5C 8008EF5C 0C031525 */ jal func_800C5494 +/* 08FB5C 8008EF5C 0C031525 */ jal assign_dialogue_box_id /* 08FB60 8008EF60 24040007 */ li $a0, 7 /* 08FB64 8008EF64 0C01FFFB */ jal func_8007FFEC /* 08FB68 8008EF68 24040002 */ li $a0, 2 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 5e4e8fb6..6c6bf361 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s @@ -238,7 +238,7 @@ glabel menu_trophy_race_rankings_loop /* 099F40 80099340 AFAB002C */ sw $t3, 0x2c($sp) /* 099F44 80099344 0C031588 */ jal close_dialogue_box /* 099F48 80099348 24040007 */ li $a0, 7 -/* 099F4C 8009934C 0C031525 */ jal func_800C5494 +/* 099F4C 8009934C 0C031525 */ jal assign_dialogue_box_id /* 099F50 80099350 24040007 */ li $a0, 7 /* 099F54 80099354 3C18800E */ lui $t8, %hi(D_800E0FEC) # $t8, 0x800e /* 099F58 80099358 8F180FEC */ lw $t8, %lo(D_800E0FEC)($t8) diff --git a/asm/non_matchings/menu/render_magic_codes_ui.s b/asm/non_matchings/menu/render_magic_codes_ui.s index 05cabce2..40be4168 100644 --- a/asm/non_matchings/menu/render_magic_codes_ui.s +++ b/asm/non_matchings/menu/render_magic_codes_ui.s @@ -20,7 +20,7 @@ glabel render_magic_codes_ui /* 08A2EC 800896EC 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 08A2F0 800896F0 00002825 */ move $a1, $zero /* 08A2F4 800896F4 00003025 */ move $a2, $zero -/* 08A2F8 800896F8 0C0316D6 */ jal func_800C5B58 +/* 08A2F8 800896F8 0C0316D6 */ jal render_dialogue_box /* 08A2FC 800896FC 24070007 */ li $a3, 7 /* 08A300 80089700 0C0310BB */ jal set_text_font /* 08A304 80089704 24040002 */ li $a0, 2 @@ -332,7 +332,7 @@ glabel render_magic_codes_ui /* 08A77C 80089B7C 10000001 */ b .L80089B84 /* 08A780 80089B80 24130086 */ li $s3, 134 .L80089B84: -/* 08A784 80089B84 0C031525 */ jal func_800C5494 +/* 08A784 80089B84 0C031525 */ jal assign_dialogue_box_id /* 08A788 80089B88 24040006 */ li $a0, 6 /* 08A78C 80089B8C 24040006 */ li $a0, 6 /* 08A790 80089B90 0C0313DF */ jal set_dialogue_font @@ -402,7 +402,7 @@ glabel render_magic_codes_ui /* 08A878 80089C78 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 08A87C 80089C7C 00002825 */ move $a1, $zero /* 08A880 80089C80 00003025 */ move $a2, $zero -/* 08A884 80089C84 0C0316D6 */ jal func_800C5B58 +/* 08A884 80089C84 0C0316D6 */ jal render_dialogue_box /* 08A888 80089C88 24070006 */ li $a3, 6 .L80089C8C: /* 08A88C 80089C8C 0C0270C3 */ jal get_filtered_cheats diff --git a/asm/non_matchings/menu/render_track_select_setup_ui.s b/asm/non_matchings/menu/render_track_select_setup_ui.s index fc218a0a..a89951db 100644 --- a/asm/non_matchings/menu/render_track_select_setup_ui.s +++ b/asm/non_matchings/menu/render_track_select_setup_ui.s @@ -457,7 +457,7 @@ glabel render_track_select_setup_ui /* 0921E4 800915E4 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 0921E8 800915E8 00002825 */ move $a1, $zero /* 0921EC 800915EC 00003025 */ move $a2, $zero -/* 0921F0 800915F0 0C0316D6 */ jal func_800C5B58 +/* 0921F0 800915F0 0C0316D6 */ jal render_dialogue_box /* 0921F4 800915F4 24070007 */ li $a3, 7 /* 0921F8 800915F8 3C0F8012 */ lui $t7, %hi(D_801263E0) # $t7, 0x8012 /* 0921FC 800915FC 8DEF63E0 */ lw $t7, %lo(D_801263E0)($t7) @@ -599,7 +599,7 @@ glabel render_track_select_setup_ui /* 0923F8 800917F8 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 0923FC 800917FC 00002825 */ move $a1, $zero /* 092400 80091800 00003025 */ move $a2, $zero -/* 092404 80091804 0C0316D6 */ jal func_800C5B58 +/* 092404 80091804 0C0316D6 */ jal render_dialogue_box /* 092408 80091808 24070007 */ li $a3, 7 .L8009180C: /* 09240C 8009180C 86180002 */ lh $t8, 2($s0) diff --git a/asm/non_matchings/printf/func_800B5F78.s b/asm/non_matchings/printf/print_debug_strings.s similarity index 97% rename from asm/non_matchings/printf/func_800B5F78.s rename to asm/non_matchings/printf/print_debug_strings.s index de495bae..f37cd358 100644 --- a/asm/non_matchings/printf/func_800B5F78.s +++ b/asm/non_matchings/printf/print_debug_strings.s @@ -1,4 +1,4 @@ -glabel func_800B5F78 +glabel print_debug_strings /* 0B6B78 800B5F78 27BDFFC8 */ addiu $sp, $sp, -0x38 /* 0B6B7C 800B5F7C AFBF0034 */ sw $ra, 0x34($sp) /* 0B6B80 800B5F80 AFB3002C */ sw $s3, 0x2c($sp) @@ -69,10 +69,10 @@ glabel func_800B5F78 /* 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(D_800E2FB8) # $t2, 0x800e +/* 0B6C88 800B6088 3C0A800E */ lui $t2, %hi(dl_debug_font_settings) # $t2, 0x800e /* 0B6C8C 800B608C 26280008 */ addiu $t0, $s1, 8 /* 0B6C90 800B6090 AE680000 */ sw $t0, ($s3) -/* 0B6C94 800B6094 254A2FB8 */ addiu $t2, %lo(D_800E2FB8) # addiu $t2, $t2, 0x2fb8 +/* 0B6C94 800B6094 254A2FB8 */ addiu $t2, %lo(dl_debug_font_settings) # 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/unknown_032760/func_80042A90.s b/asm/non_matchings/unknown_032760/func_80042A90.s index c4c88cfd..94204ac9 100644 --- a/asm/non_matchings/unknown_032760/func_80042A90.s +++ b/asm/non_matchings/unknown_032760/func_80042A90.s @@ -84,7 +84,7 @@ glabel func_80042A90 /* 0437CC 80042BCC AFA8004C */ sw $t0, 0x4c($sp) /* 0437D0 80042BD0 AFA90044 */ sw $t1, 0x44($sp) .L80042BD4: -/* 0437D4 80042BD4 0C031525 */ jal func_800C5494 +/* 0437D4 80042BD4 0C031525 */ jal assign_dialogue_box_id /* 0437D8 80042BD8 24040004 */ li $a0, 4 /* 0437DC 80042BDC 8FAA0044 */ lw $t2, 0x44($sp) /* 0437E0 80042BE0 8FA50050 */ lw $a1, 0x50($sp) diff --git a/include/structs.h b/include/structs.h index 303429e9..b0afb602 100644 --- a/include/structs.h +++ b/include/structs.h @@ -988,57 +988,4 @@ typedef struct unk80042178 { u8 pad0[0x20]; } unk80042178; -//Dialogue Box text (Including background struct) -typedef struct DialogueBox { - u8 unk00; - u8 unk01; - char *unk4; - s16 unk8; - s16 unkA; - s16 unkC; - s16 unkE; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 unk14; - u8 unk15; - u8 unk16; - u8 unk17; - u8 unk18; - u8 unk19; - struct DialogueBox *unk1C; -} DialogueBox; - -/* Size: 0x28 bytes */ -// Dialogue Box background -typedef struct DialogueBoxBackground { - s16 xpos; - s16 ypos; - s16 x1; - s16 y1; - s16 x2; - s16 y2; - s16 width; - s16 height; - u8 backgroundColourR; - u8 backgroundColourG; - u8 backgroundColourB; - u8 backgroundColourA; - u8 textColourR; - u8 textColourG; - u8 textColourB; - u8 textColourA; - u8 textBGColourR; - u8 textBGColourG; - u8 textBGColourB; - u8 textBGColourA; - u8 opacity; - u8 font; - u16 flags; - s16 unk20; - s16 unk22; - DialogueBox *text; -} DialogueBoxBackground; - #endif diff --git a/include/types.h b/include/types.h index 89ade3aa..62bd6686 100644 --- a/include/types.h +++ b/include/types.h @@ -40,7 +40,9 @@ typedef s32 ptrdiff_t; //#endif typedef float Matrix[4][4]; +typedef s16 VertexList; +typedef s8 TriangleList; -#define stubbed_printf +#define stubbed_printf #endif diff --git a/src/audio.c b/src/audio.c index a4f49310..4172c5fd 100644 --- a/src/audio.c +++ b/src/audio.c @@ -282,7 +282,7 @@ void func_80000CBC(void) { set_relative_volume_for_music(musicRelativeVolume); } -void func_80000D00(u8 updateRate) { +void process_audio(u8 updateRate) { s32 reg_s2; s32 j; if (D_80115D3C > 0) { diff --git a/src/audio.h b/src/audio.h index 3f7755d5..e961ef29 100644 --- a/src/audio.h +++ b/src/audio.h @@ -76,7 +76,7 @@ void set_sndfx_player_voice_limit(u8 voiceLimit); void func_80000C68(u8 arg0); void func_80000C98(s32 arg0); void func_80000CBC(void); -void func_80000D00(u8 arg0); +void process_audio(u8 arg0); 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 cadee97f..677bc3f1 100644 --- a/src/camera.c +++ b/src/camera.c @@ -73,11 +73,11 @@ Vp D_800DD148[20] = { { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, }; -unk8011D510 D_800DD288 = { +unk8011D510 D_800DD288 = { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, -281.0f, }; -unk8011D510 D_800DD2A0 = { +unk8011D510 D_800DD2A0 = { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f, }; @@ -581,10 +581,10 @@ void func_80066CDC(Gfx **dlist, s32 arg1) { temp_t0 = widthAndHeight >> 16; temp_a3 = temp_t0 >> 1; if (gScreenViewports[D_80120CE4].flags & 1) { - gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, - gScreenViewports[D_80120CE4].upperLeftX, - gScreenViewports[D_80120CE4].upperLeftY, - gScreenViewports[D_80120CE4].lowerRightX, + gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, + gScreenViewports[D_80120CE4].upperLeftX, + gScreenViewports[D_80120CE4].upperLeftY, + gScreenViewports[D_80120CE4].lowerRightX, gScreenViewports[D_80120CE4].lowerRightY ); func_80068158(dlist, 0, 0, 0, 0); @@ -899,10 +899,14 @@ OSMesgQueue *func_8006A100(void) { return &D_801210E0; } -s32 func_8006A10C(void) { - s32 *temp1; +/** + * Initialise the player controllers, and return the status when finished. + */ + +s32 init_controllers(void) { + s32 *temp1; // Unused u8 bitpattern; - s32 *temp2; + s32 *temp2; // Unused osCreateMesgQueue(&D_801210E0, &D_801210F8, 1); osSetEventMesg(OS_EVENT_SI, &D_801210E0, D_801210FC); @@ -913,14 +917,14 @@ s32 func_8006A10C(void) { D_800DD300 = 0; if ((bitpattern & CONT_ABSOLUTE) && (!(status.errno & CONT_NO_RESPONSE_ERROR))) { - return 0; + return CONTROLLER_EXISTS; } if (!bitpattern) {} D_800DD300 = 1; - return -1; + return CONTROLLER_MISSING; } GLOBAL_ASM("asm/non_matchings/camera/func_8006A1C4.s") diff --git a/src/camera.h b/src/camera.h index c606842c..436f5aac 100644 --- a/src/camera.h +++ b/src/camera.h @@ -24,6 +24,9 @@ #define CAMERA_MAX_FOV 90.0f #define CAMERA_SCALE 1.0f +#define CONTROLLER_MISSING -1 +#define CONTROLLER_EXISTS 0 + enum ViewportCount { VIEWPORTS_COUNT_1_PLAYER, VIEWPORTS_COUNT_2_PLAYERS, @@ -65,7 +68,7 @@ extern ScreenViewport gScreenViewports[4]; extern s16 D_800DD138[8]; // RSP Viewports -extern Vp D_800DD148[20]; +extern Vp D_800DD148[20]; extern unk8011D510 D_800DD288; diff --git a/src/fade_transition.c b/src/fade_transition.c index 2253289b..46415cdd 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -15,18 +15,18 @@ /************ .data ************/ s32 D_800E31A0 = 0; -s32 D_800E31A4 = 0; +s32 sLevelTransitionDelayTimer = 0; // Set when a level is loaded after a transition, to hold it for a few extra frames. s32 D_800E31A8 = 0; -s32 D_800E31AC = 0; -u16 D_800E31B0 = 0; -u16 D_800E31B4 = 0; +s32 sTransitionStatus = TRANSITION_NONE; +u16 sTransitionFadeTimer = 0; +u16 sTransitionFlags = 0; u16 D_800E31B8 = 0; s8 D_800E31BC = 0; -s32 *D_800E31C0[2] = { NULL, NULL }; -s32 *D_800E31C8[2] = { NULL, NULL }; -s32 D_800E31D0[2] = { 0, 0 }; +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 D_800E31D8[] = { +Gfx dl_fade_transition_settings[] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetTextureLOD(G_TL_TILE), @@ -40,33 +40,33 @@ Gfx D_800E31D8[] = { gsSPEndDisplayList(), }; -s16 D_800E3230[28] = { - 0xFE20, 0x0078, 0xFEC0, 0x0078, 0xFF60, 0x0078, 0x0000, 0x0078, - 0x00A0, 0x0078, 0x0140, 0x0078, 0x01E0, 0x0078, 0xFE20, 0xFF88, - 0xFEC0, 0xFF88, 0xFF60, 0xFF88, 0x0000, 0xFF88, 0x00A0, 0xFF88, +VertexList D_800E3230[28] = { + 0xFE20, 0x0078, 0xFEC0, 0x0078, 0xFF60, 0x0078, 0x0000, 0x0078, + 0x00A0, 0x0078, 0x0140, 0x0078, 0x01E0, 0x0078, 0xFE20, 0xFF88, + 0xFEC0, 0xFF88, 0xFF60, 0xFF88, 0x0000, 0xFF88, 0x00A0, 0xFF88, 0x0140, 0xFF88, 0x01E0, 0xFF88, }; -s16 D_800E3268[28] = { - 0xFF60, 0x0168, 0xFF60, 0x00F0, 0xFF60, 0x0078, 0xFF60, 0x0000, - 0xFF60, 0xFF88, 0xFF60, 0xFF10, 0xFF60, 0xFF10, 0x00A0, 0x0168, +VertexList D_800E3268[28] = { + 0xFF60, 0x0168, 0xFF60, 0x00F0, 0xFF60, 0x0078, 0xFF60, 0x0000, + 0xFF60, 0xFF88, 0xFF60, 0xFF10, 0xFF60, 0xFF10, 0x00A0, 0x0168, 0x00A0, 0x00F0, 0x00A0, 0x0078, 0x00A0, 0x0000, 0x00A0, 0xFF88, 0x00A0, 0xFF10, 0x00A0, 0xFF10, }; -s8 D_800E32A0[12] = { +TriangleList D_800E32A0[12] = { 0x00, 0x02, 0x04, 0x0E, 0x10, 0x12, 0x08, 0x0A, 0x0C, 0x16, 0x18, 0x1A, }; -s8 D_800E32AC[12] = { +TriangleList D_800E32AC[12] = { 0x04, 0x06, 0x08, 0x12, 0x14, 0x16, 0x04, 0x06, 0x08, 0x12, 0x14, 0x16, }; s8 D_800E32B8[24] = { - 0, 3, 1, 1, 3, 4, 1, 4, - 2, 2, 4, 5, 6, 9, 7, 7, + 0, 3, 1, 1, 3, 4, 1, 4, + 2, 2, 4, 5, 6, 9, 7, 7, 9, 10, 7, 10, 8, 8, 10, 11, }; @@ -74,9 +74,9 @@ s8 D_800E32D0[12] = { -1, -1, 0, -1, -1, 0, 0, -1, -1, 0, -1, -1, }; -s16 D_800E32DC[24] = { - 0xFCE0, 0x0078, 0xFE20, 0x0078, 0xFF60, 0x0078, 0x00A0, 0x0078, - 0x01E0, 0x0078, 0x0320, 0x0078, 0xFCE0, 0xFF88, 0xFE20, 0xFF88, +VertexList D_800E32DC[24] = { + 0xFCE0, 0x0078, 0xFE20, 0x0078, 0xFF60, 0x0078, 0x00A0, 0x0078, + 0x01E0, 0x0078, 0x0320, 0x0078, 0xFCE0, 0xFF88, 0xFE20, 0xFF88, 0xFF60, 0xFF88, 0x00A0, 0xFF88, 0x01E0, 0xFF88, 0x0320, 0xFF88, }; @@ -96,84 +96,84 @@ s8 D_800E3338[12] = { -1, -1, 0, -1, 0, 0, -1, 0, -1, -1, 0, 0, }; -s16 D_800E3344[126] = { - 0xFF60, 0x00A0, 0xFF70, 0x00A0, 0xFF80, 0x00A0, 0xFF90, 0x00A0, - 0xFFA0, 0x00A0, 0xFFB0, 0x00A0, 0xFFC0, 0x00A0, 0xFFD0, 0x00A0, - 0xFFE0, 0x00A0, 0xFFF0, 0x00A0, 0x0000, 0x00A0, 0x0010, 0x00A0, - 0x0020, 0x00A0, 0x0030, 0x00A0, 0x0040, 0x00A0, 0x0050, 0x00A0, - 0x0060, 0x00A0, 0x0070, 0x00A0, 0x0080, 0x00A0, 0x0090, 0x00A0, - 0x00A0, 0x00A0, 0xFF60, 0xFF38, 0xFF70, 0xFF60, 0xFF80, 0xFF74, - 0xFF90, 0xFF7E, 0xFFA0, 0xFF74, 0xFFB0, 0xFF38, 0xFFC0, 0xFF10, - 0xFFD0, 0xFEFC, 0xFFE0, 0xFEF2, 0xFFF0, 0xFEFC, 0x0000, 0xFF24, - 0x0010, 0xFF2E, 0x0020, 0xFF38, 0x0030, 0xFF2E, 0x0040, 0xFF24, - 0x0050, 0xFEFC, 0x0060, 0xFEF2, 0x0070, 0xFEFC, 0x0080, 0xFF24, - 0x0090, 0xFF60, 0x00A0, 0xFF74, 0xFF60, 0xFEE8, 0xFF70, 0xFEE8, - 0xFF80, 0xFEE8, 0xFF90, 0xFEE8, 0xFFA0, 0xFEE8, 0xFFB0, 0xFEE8, - 0xFFC0, 0xFEE8, 0xFFD0, 0xFEE8, 0xFFE0, 0xFEE8, 0xFFF0, 0xFEE8, - 0x0000, 0xFEE8, 0x0010, 0xFEE8, 0x0020, 0xFEE8, 0x0030, 0xFEE8, - 0x0040, 0xFEE8, 0x0050, 0xFEE8, 0x0060, 0xFEE8, 0x0070, 0xFEE8, +VertexList D_800E3344[126] = { + 0xFF60, 0x00A0, 0xFF70, 0x00A0, 0xFF80, 0x00A0, 0xFF90, 0x00A0, + 0xFFA0, 0x00A0, 0xFFB0, 0x00A0, 0xFFC0, 0x00A0, 0xFFD0, 0x00A0, + 0xFFE0, 0x00A0, 0xFFF0, 0x00A0, 0x0000, 0x00A0, 0x0010, 0x00A0, + 0x0020, 0x00A0, 0x0030, 0x00A0, 0x0040, 0x00A0, 0x0050, 0x00A0, + 0x0060, 0x00A0, 0x0070, 0x00A0, 0x0080, 0x00A0, 0x0090, 0x00A0, + 0x00A0, 0x00A0, 0xFF60, 0xFF38, 0xFF70, 0xFF60, 0xFF80, 0xFF74, + 0xFF90, 0xFF7E, 0xFFA0, 0xFF74, 0xFFB0, 0xFF38, 0xFFC0, 0xFF10, + 0xFFD0, 0xFEFC, 0xFFE0, 0xFEF2, 0xFFF0, 0xFEFC, 0x0000, 0xFF24, + 0x0010, 0xFF2E, 0x0020, 0xFF38, 0x0030, 0xFF2E, 0x0040, 0xFF24, + 0x0050, 0xFEFC, 0x0060, 0xFEF2, 0x0070, 0xFEFC, 0x0080, 0xFF24, + 0x0090, 0xFF60, 0x00A0, 0xFF74, 0xFF60, 0xFEE8, 0xFF70, 0xFEE8, + 0xFF80, 0xFEE8, 0xFF90, 0xFEE8, 0xFFA0, 0xFEE8, 0xFFB0, 0xFEE8, + 0xFFC0, 0xFEE8, 0xFFD0, 0xFEE8, 0xFFE0, 0xFEE8, 0xFFF0, 0xFEE8, + 0x0000, 0xFEE8, 0x0010, 0xFEE8, 0x0020, 0xFEE8, 0x0030, 0xFEE8, + 0x0040, 0xFEE8, 0x0050, 0xFEE8, 0x0060, 0xFEE8, 0x0070, 0xFEE8, 0x0080, 0xFEE8, 0x0090, 0xFEE8, 0x00A0, 0xFEE8, }; -s8 D_800E3440[92] = { - 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, - 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, - 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x0E, - 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1A, 0x1C, - 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28, 0x1A, 0x1C, - 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28, 0x00, 0x02, - 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x54, 0x56, - 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x0E, 0x10, - 0x12, 0x14, 0x16, 0x18, 0x1A, 0x62, 0x64, 0x66, - 0x68, 0x6A, 0x6C, 0x6E, 0x1A, 0x1C, 0x1E, 0x20, - 0x22, 0x24, 0x26, 0x28, 0x6E, 0x70, 0x72, 0x74, +TriangleList D_800E3440[92] = { + 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, + 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, + 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x0E, + 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1A, 0x1C, + 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28, 0x1A, 0x1C, + 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28, 0x00, 0x02, + 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x54, 0x56, + 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x0E, 0x10, + 0x12, 0x14, 0x16, 0x18, 0x1A, 0x62, 0x64, 0x66, + 0x68, 0x6A, 0x6C, 0x6E, 0x1A, 0x1C, 0x1E, 0x20, + 0x22, 0x24, 0x26, 0x28, 0x6E, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, }; -s8 D_800E349C[92] = { - 0x2A, 0x2C, 0x2E, 0x30, 0x32, 0x34, 0x36, 0x38, - 0x54, 0x56, 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, - 0x38, 0x3A, 0x3C, 0x3E, 0x40, 0x42, 0x44, 0x62, - 0x64, 0x66, 0x68, 0x6A, 0x6C, 0x6E, 0x44, 0x46, - 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x6E, 0x70, - 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, 0x54, 0x56, - 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x54, 0x56, - 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x62, 0x64, - 0x66, 0x68, 0x6A, 0x6C, 0x6E, 0x62, 0x64, 0x66, - 0x68, 0x6A, 0x6C, 0x6E, 0x6E, 0x70, 0x72, 0x74, - 0x76, 0x78, 0x7A, 0x7C, 0x6E, 0x70, 0x72, 0x74, +TriangleList D_800E349C[92] = { + 0x2A, 0x2C, 0x2E, 0x30, 0x32, 0x34, 0x36, 0x38, + 0x54, 0x56, 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, + 0x38, 0x3A, 0x3C, 0x3E, 0x40, 0x42, 0x44, 0x62, + 0x64, 0x66, 0x68, 0x6A, 0x6C, 0x6E, 0x44, 0x46, + 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x6E, 0x70, + 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, 0x54, 0x56, + 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x54, 0x56, + 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x62, 0x64, + 0x66, 0x68, 0x6A, 0x6C, 0x6E, 0x62, 0x64, 0x66, + 0x68, 0x6A, 0x6C, 0x6E, 0x6E, 0x70, 0x72, 0x74, + 0x76, 0x78, 0x7A, 0x7C, 0x6E, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, }; s8 D_800E34F8[92] = { - 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, - 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, + 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; -s8 D_800E3554[244] = { - 0, 8, 9, 0, 9, 1, 1, 9, 10, 1, 10, 2, 2, 10, 11, 2, - 11, 3, 3, 11, 12, 3, 12, 4, 4, 12, 13, 4, 13, 5, 5, 13, - 14, 5, 14, 6, 6, 14, 15, 6, 15, 7, 0, 7, 8, 0, 8, 1, - 1, 8, 9, 1, 9, 2, 2, 9, 10, 2, 10, 3, 3, 10, 11, 3, - 11, 4, 4, 11, 12, 4, 12, 5, 5, 12, 13, 5, 13, 6, 0, 8, - 9, 0, 9, 1, 1, 9, 10, 1, 10, 2, 2, 10, 11, 2, 11, 3, - 3, 11, 12, 3, 12, 4, 4, 12, 13, 4, 13, 5, 5, 13, 14, 5, - 14, 6, 6, 14, 15, 6, 15, 7, 0, 8, 9, 0, 9, 1, 1, 9, - 10, 1, 10, 2, 2, 10, 11, 2, 11, 3, 3, 11, 12, 3, 12, 4, - 4, 12, 13, 4, 13, 5, 5, 13, 14, 5, 14, 6, 6, 14, 15, 6, - 15, 7, 0, 7, 8, 0, 8, 1, 1, 8, 9, 1, 9, 2, 2, 9, - 10, 2, 10, 3, 3, 10, 11, 3, 11, 4, 4, 11, 12, 4, 12, 5, - 5, 12, 13, 5, 13, 6, 0, 8, 9, 0, 9, 1, 1, 9, 10, 1, - 10, 2, 2, 10, 11, 2, 11, 3, 3, 11, 12, 3, 12, 4, 4, 12, - 13, 4, 13, 5, 5, 13, 14, 5, 14, 6, 6, 14, 15, 6, 15, 7, +TriangleList D_800E3554[244] = { + 0, 8, 9, 0, 9, 1, 1, 9, 10, 1, 10, 2, 2, 10, 11, 2, + 11, 3, 3, 11, 12, 3, 12, 4, 4, 12, 13, 4, 13, 5, 5, 13, + 14, 5, 14, 6, 6, 14, 15, 6, 15, 7, 0, 7, 8, 0, 8, 1, + 1, 8, 9, 1, 9, 2, 2, 9, 10, 2, 10, 3, 3, 10, 11, 3, + 11, 4, 4, 11, 12, 4, 12, 5, 5, 12, 13, 5, 13, 6, 0, 8, + 9, 0, 9, 1, 1, 9, 10, 1, 10, 2, 2, 10, 11, 2, 11, 3, + 3, 11, 12, 3, 12, 4, 4, 12, 13, 4, 13, 5, 5, 13, 14, 5, + 14, 6, 6, 14, 15, 6, 15, 7, 0, 8, 9, 0, 9, 1, 1, 9, + 10, 1, 10, 2, 2, 10, 11, 2, 11, 3, 3, 11, 12, 3, 12, 4, + 4, 12, 13, 4, 13, 5, 5, 13, 14, 5, 14, 6, 6, 14, 15, 6, + 15, 7, 0, 7, 8, 0, 8, 1, 1, 8, 9, 1, 9, 2, 2, 9, + 10, 2, 10, 3, 3, 10, 11, 3, 11, 4, 4, 11, 12, 4, 12, 5, + 5, 12, 13, 5, 13, 6, 0, 8, 9, 0, 9, 1, 1, 9, 10, 1, + 10, 2, 2, 10, 11, 2, 11, 3, 3, 11, 12, 3, 12, 4, 4, 12, + 13, 4, 13, 5, 5, 13, 14, 5, 14, 6, 6, 14, 15, 6, 15, 7, 0, 0, 0, 0, }; -Gfx D_800E3648[] = { +Gfx dl_transition_shape_settings[] = { gsDPPipeSync(), gsSPClearGeometryMode(G_FOG), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -196,7 +196,7 @@ s32 gLastFadeBlue; s32 D_8012A744; s32 D_8012A748; s32 D_8012A74C; -f32 D_8012A750; +f32 sTransitionOpacity; f32 D_8012A754; s32 D_8012A758; s32 D_8012A75C; @@ -221,9 +221,9 @@ void func_800C0180(void) { //@bug: This doesn't seem to guarantee a return. u32 func_800C018C(void) { - u32 phi_v0 = (D_800E31B0 != 0); + u32 phi_v0 = (sTransitionFadeTimer != 0); if (phi_v0 == 0) { - phi_v0 = (D_800E31B4 != 0); + phi_v0 = (sTransitionFlags != 0); if (phi_v0 != 0) { return (D_800E31BC != 0); } @@ -237,21 +237,21 @@ s32 func_800C01D8(FadeTransition *transition) { if (D_800E31A0) { return 0; } - func_800C0724(); + transition_end(); if (transition == NULL) { return 0; } - D_800E31B0 = transition->duration; + sTransitionFadeTimer = transition->duration; D_800E31B8 = transition->duration; - D_800E31B4 = transition->unk6; + sTransitionFlags = transition->unk6; D_800E31BC = !(transition->type & 0x80); gCurFaceTransition = transition->type & 0x3F; D_800E31A8 = transition->type & 0x40; - D_800E31A4 = 0; + sLevelTransitionDelayTimer = 0; if (!D_800E31BC) { - D_800E31A4 = 2; + sLevelTransitionDelayTimer = 2; } - if (D_800E31B0 > 0) { + if (sTransitionFadeTimer > 0) { gLastFadeRed = gCurFadeRed; gLastFadeGreen = gCurFadeGreen; gLastFadeBlue = gCurFadeBlue; @@ -282,29 +282,35 @@ s32 func_800C01D8(FadeTransition *transition) { break; } } - return D_800E31AC; + return sTransitionStatus; } #else GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C01D8.s") #endif -s32 func_800C0494(s32 updateRate) { - if (D_800E31A4 != 0) { - D_800E31A4 = D_800E31A4 - 1; +/** + * Handle the logic portion of the transitions. Runs always and calls the specific transition func from here. + * Afterwards, it will return the transition status. The condition where this function is called wants a nonzero + * return, which will then call the bit that renders the transitions. + */ +s32 handle_transitions(s32 updateRate) { + if (sLevelTransitionDelayTimer) { + sLevelTransitionDelayTimer--; updateRate = LOGIC_NULL; - } else if (updateRate >= LOGIC_10FPS) { + } else if (updateRate >= LOGIC_10FPS) { // Redundant because the logic update rate is clamped before this function is called. updateRate = LOGIC_12FPS; } - if (D_800E31AC != 0) { - if (D_800E31B0 == 0) { - D_800E31AC = -1; + if (sTransitionStatus != TRANSITION_NONE) { + if (sTransitionFadeTimer == 0) { + sTransitionStatus = TRANSITION_LEVELSWAP; } - if ((D_800E31B0 == 0) && (D_800E31B4 == 0)) { - func_800C0724(); +//@bug Not yet confirmed as a bug, but sTransitionFlags will not be zero when ingame, leaving stray transitions up. + if ((sTransitionFadeTimer == 0) && (sTransitionFlags == 0)) { + transition_end(); } else { - if (D_800E31B0 > 0) { - D_800E31D0[0] = 1 - D_800E31D0[0]; + if (sTransitionFadeTimer > 0) { + sTransitionTaskNum[0] = 1 - sTransitionTaskNum[0]; // Haven't you heard of a XOR, Rareware employee? } switch (gCurFaceTransition) { case FADE_FULLSCREEN: @@ -325,11 +331,11 @@ s32 func_800C0494(s32 updateRate) { } } } - return D_800E31AC; + return sTransitionStatus; } void render_fade_transition(s32 dlist, s32 arg1, s32 arg2) { - if (D_800E31AC != 0) { + if (sTransitionStatus != TRANSITION_NONE) { if (osTvType == TV_TYPE_PAL) { func_80067F20(1.4f); } else { @@ -365,34 +371,38 @@ void render_fade_transition(s32 dlist, s32 arg1, s32 arg2) { } } -void func_800C0724(void) { - if (D_800E31C0[0] != NULL) { - free_from_memory_pool(D_800E31C0[0]); - D_800E31C0[0] = NULL; - D_800E31C0[1] = NULL; - D_800E31C8[0] = NULL; - D_800E31C8[1] = NULL; +/** + * Disable the transition effect. + * If there's existing allocated memory for transitions, free it. + */ +void transition_end(void) { + if (sTransitionVtx[0] != NULL) { + free_from_memory_pool(sTransitionVtx[0]); + sTransitionVtx[0] = NULL; + sTransitionVtx[1] = NULL; + sTransitionTris[0] = NULL; + sTransitionTris[1] = NULL; } - D_800E31AC = 0; - D_800E31D0[0] = 0; + sTransitionStatus = TRANSITION_NONE; + sTransitionTaskNum[0] = 0; } void func_800C0780(FadeTransition *transition) { if (transition->type & 0x80) { - D_8012A750 = 255.0f; - D_8012A754 = -255.0f / (f32)D_800E31B0; + sTransitionOpacity = 255.0f; + D_8012A754 = -255.0f / (f32)sTransitionFadeTimer; } else { - D_8012A750 = 0.0f; - D_8012A754 = 255.0f / (f32)D_800E31B0; + sTransitionOpacity = 0.0f; + D_8012A754 = 255.0f / (f32)sTransitionFadeTimer; } - D_800E31AC = 1; + sTransitionStatus = TRANSITION_ACTIVE; } GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0834.s") -void render_fade_fullscreen(Gfx **dlist, s32 arg1, s32 arg2) { +void render_fade_fullscreen(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 arg2) { s32 screenSize = get_video_width_and_height_as_s32(); - gSPDisplayList((*dlist)++, D_800E31D8); + gSPDisplayList((*dlist)++, dl_fade_transition_settings); 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); @@ -402,22 +412,22 @@ void render_fade_fullscreen(Gfx **dlist, s32 arg1, s32 arg2) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0B00.s") GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1130.s") -void render_fade_barndoor_horizontal(Gfx **dlist, s32 arg1, s32 arg2) { +void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 arg2) { func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, D_800E3648); + gSPDisplayList((*dlist)++, dl_transition_shape_settings); // TODO: Need to clean this up. - gDkrVertices((*dlist)++, (s32)D_800E31C0[D_800E31D0[0]] + 0x80000000, (((s32)D_800E31C0[D_800E31D0[0]] + 0x80000000) & 6) | 0x58, 0x70); - gDkrTriangles((*dlist)++, (s32)D_800E31C8[D_800E31D0[0]] + 0x80000000, 8, TRIN_DISABLE_TEXTURE); + 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); func_8007B3D0(dlist); } // This is exactly the same as render_fade_barndoor_horizontal; I wonder what gets changed then? -void render_fade_barndoor_vertical(Gfx **dlist, s32 arg1, s32 arg2) { +void render_fade_barndoor_vertical(Gfx **dlist, UNUSED s32 arg1, UNUSED s32 arg2) { func_8007B3D0(dlist); - gSPDisplayList((*dlist)++, D_800E3648); + gSPDisplayList((*dlist)++, dl_transition_shape_settings); // TODO: Need to clean this up. - gDkrVertices((*dlist)++, (s32)D_800E31C0[D_800E31D0[0]] + 0x80000000, (((s32)D_800E31C0[D_800E31D0[0]] + 0x80000000) & 6) | 0x58, 0x70); - gDkrTriangles((*dlist)++, (s32)D_800E31C8[D_800E31D0[0]] + 0x80000000, 8, TRIN_DISABLE_TEXTURE); + 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); func_8007B3D0(dlist); } @@ -428,9 +438,9 @@ 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)++, D_800E3648); - addr = (D_800E31C0[D_800E31D0[0]] + 0x80000000); - addr2 = (D_800E31C8[D_800E31D0[0]] + 0x80000000); + gSPDisplayList((*dlist)++, dl_transition_shape_settings); + addr = (sTransitionVtx[sTransitionTaskNum[0]] + 0x80000000); + addr2 = (sTransitionTris[sTransitionTaskNum[0]] + 0x80000000); gDkrVertices((*dlist)++, (s32)addr, ((s32)addr & 6) | 0x88, 0xA6); gDkrTriangles((*dlist)++, (s32)addr2, 16, TRIN_DISABLE_TEXTURE); addr += 0xB4; @@ -455,15 +465,15 @@ 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)++, D_800E3648); + gSPDisplayList((*dlist)++, dl_transition_shape_settings); for(i = 0; i < 6; i++) { - s32 index = D_800E31D0[0] + i; + s32 index = sTransitionTaskNum[0] + i; if(i != 1 && i != 4) { - gDkrVertices((*dlist)++, (s32)D_800E31C0[index] + 0x80000000, (((s32)D_800E31C0[index] + 0x80000000) & 6) | 0x78, 0x94); - gDkrTriangles((*dlist)++, (s32)D_800E31C8[index] + 0x80000000, 14, TRIN_DISABLE_TEXTURE); + gDkrVertices((*dlist)++, (s32)sTransitionVtx[index] + 0x80000000, (((s32)sTransitionVtx[index] + 0x80000000) & 6) | 0x78, 0x94); + gDkrTriangles((*dlist)++, (s32)sTransitionTris[index] + 0x80000000, 14, TRIN_DISABLE_TEXTURE); } else { - gDkrVertices((*dlist)++, (s32)D_800E31C0[index] + 0x80000000, (((s32)D_800E31C0[index] + 0x80000000) & 6) | 0x68, 0x82); - gDkrTriangles((*dlist)++, (s32)D_800E31C8[index] + 0x80000000, 12, TRIN_DISABLE_TEXTURE); + gDkrVertices((*dlist)++, (s32)sTransitionVtx[index] + 0x80000000, (((s32)sTransitionVtx[index] + 0x80000000) & 6) | 0x68, 0x82); + gDkrTriangles((*dlist)++, (s32)sTransitionTris[index] + 0x80000000, 12, TRIN_DISABLE_TEXTURE); } } func_8007B3D0(dlist); @@ -474,36 +484,36 @@ 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)++, D_800E3648); + gSPDisplayList((*dlist)++, dl_transition_shape_settings); // TODO: Need to clean this up. - gDkrVertices((*dlist)++, (s32)D_800E31C0[D_800E31D0[0]] + 0x80000000, (((s32)D_800E31C0[D_800E31D0[0]] + 0x80000000) & 6) | 0x48, 0x5E); - gDkrTriangles((*dlist)++, (s32)D_800E31C8[D_800E31D0[0]] + 0x80000000, 6, TRIN_DISABLE_TEXTURE); + 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); func_8007B3D0(dlist); } GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C2640.s") #ifdef NON_MATCHING -void func_800C27A0(s32 arg0) { +void func_800C27A0(s32 updateRate) { //do { - if (D_800E31B0 > 0) { - gLastFadeRed += D_8012A744 * arg0; - gLastFadeGreen += D_8012A748 * arg0; - gLastFadeBlue += D_8012A74C * arg0; - if (arg0 >= D_800E31B0) { + if (sTransitionFadeTimer > 0) { + gLastFadeRed += D_8012A744 * updateRate; + gLastFadeGreen += D_8012A748 * updateRate; + gLastFadeBlue += D_8012A74C * updateRate; + if (updateRate >= sTransitionFadeTimer) { gLastFadeRed = gCurFadeRed << 16; gLastFadeGreen = gCurFadeGreen << 16; gLastFadeBlue = gCurFadeBlue << 16; - D_800E31B0 = 0; - arg0 -= D_800E31B0; + sTransitionFadeTimer = 0; + updateRate -= sTransitionFadeTimer; } else { - D_800E31B0 -= arg0; + sTransitionFadeTimer -= updateRate; } } else { - D_800E31B4 -= arg0; - if (D_800E31B4 != 0xFFFF) { - if ((D_800E31B4 & 0xFFFF) <= 0) { - D_800E31B4 = 0; + sTransitionFlags -= updateRate; + if (sTransitionFlags != 0xFFFF) { + if ((sTransitionFlags & 0xFFFF) <= 0) { + sTransitionFlags = 0; } } } @@ -515,7 +525,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)++, D_800E31D8); + gSPDisplayList((*dlist)++, dl_fade_transition_settings); 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/fade_transition.h b/src/fade_transition.h index a410fe60..11098dee 100644 --- a/src/fade_transition.h +++ b/src/fade_transition.h @@ -18,6 +18,12 @@ #define FADE_TRANSITION(type, color, duration, unk6) { type, color, duration, unk6 } +enum TransitionStatus { + TRANSITION_LEVELSWAP = -1, + TRANSITION_NONE, + TRANSITION_ACTIVE, +}; + /* Size: 8 bytes */ typedef struct FadeTransition { u8 type; // top 2 bits also act as flags @@ -33,8 +39,8 @@ extern u32 osTvType; void func_800C0170(void); void func_800C0180(void); u32 func_800C018C(void); -void func_800C0724(void); -s32 func_800C0494(s32 arg0); +void transition_end(void); +s32 handle_transitions(s32 updateRate); void render_fade_transition(s32 dlist, s32 arg1, s32 arg2); void render_fade_fullscreen(Gfx **dlist, s32 arg1, s32 arg2); void render_fade_barndoor_horizontal(Gfx **dlist, s32 arg1, s32 arg2); diff --git a/src/font.c b/src/font.c index bb5f036a..9566f369 100644 --- a/src/font.c +++ b/src/font.c @@ -7,7 +7,7 @@ /************ .data ************/ -Gfx D_800E3690[] = { +Gfx dl_dialogue_box_begin[] = { gsDPPipeSync(), gsDPSetTextureLOD(G_TL_TILE), gsDPSetTextureLUT(G_TT_NONE), @@ -17,8 +17,7 @@ Gfx D_800E3690[] = { gsSPEndDisplayList(), }; -// Unused? -Gfx D_800E36C8[][2] = { +Gfx dl_dialogue_box_drawmodes[][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), @@ -29,7 +28,7 @@ Gfx D_800E36C8[][2] = { }, }; -s8 D_800E36E8 = 0; +s8 sDialogueBoxIsOpen = FALSE; // Descending powers of 10 s32 gDescPowsOf10[9] = { @@ -44,18 +43,27 @@ s32 gDescPowsOf10[9] = { 10, }; -s8 D_800E3710[48] = { - 4, FALSE, 0, FALSE, 1, - 2, FALSE, 1, FALSE, 2, - 1, FALSE, 2, FALSE, 4, - 0, FALSE, 4, TRUE, -4, - 1, TRUE, -4, TRUE, -2, - 2, TRUE, -2, TRUE, -1, - 4, TRUE, -1, TRUE, 0, - -1, 0, 0, 0, 0, // End of Data - 0, 0, 0, 0, 0, 0, 0, 0, +// The dialogue box will draw in pieces, using properties from each line. It starts with a box +// and goes inwards or outwards depending on the direction, set by the define. + +#define INWARDS 0 +#define OUTWARDS 1 + +s8 sDialogueBoxDimensions[48] = { + /*X Offset*/ 4, INWARDS, /*Y Start*/ 0, INWARDS, /*Y end*/ 1, + /*X Offset*/ 2, INWARDS, /*Y Start*/ 1, INWARDS, /*Y end*/ 2, + /*X Offset*/ 1, INWARDS, /*Y Start*/ 2, INWARDS, /*Y end*/ 4, + /*X Offset*/ 0, INWARDS, /*Y Start*/ 4, OUTWARDS, /*Y end*/ -4, + /*X Offset*/ 1, OUTWARDS, /*Y Start*/ -4, OUTWARDS, /*Y end*/ -2, + /*X Offset*/ 2, OUTWARDS, /*Y Start*/ -2, OUTWARDS, /*Y end*/ -1, + /*X Offset*/ 4, OUTWARDS, /*Y Start*/ -1, OUTWARDS, 0, + /*X Offset*/ -1, 0, 0, 0, 0, // End of Data + /*X Offset*/ 0, 0, 0, 0, 0, 0, 0, 0, }; +#undef INWARDS +#undef OUTWARDS + OSDevMgr __osPiDevMgr = { 0, NULL, NULL, NULL, NULL, NULL, NULL, }; /*******************************/ @@ -67,12 +75,15 @@ FontData *gFonts; DialogueBoxBackground (*gDialogueBoxBackground)[1]; unk8012A7EC (*D_8012A7EC)[1]; s32 D_8012A7F0; -s8 D_8012A7F4; +s8 sDialogueBoxCloseTimer; s32 D_8012A7F8; s32 D_8012A7FC; /******************************/ +/** + * Loads the text asset data and sets the default values for each dialogue box in the list. + */ void load_fonts(void) { s32 *fontAssetData; s32 i; @@ -112,7 +123,7 @@ void load_fonts(void) { (*gDialogueBoxBackground)[i].textBGColourB = 0xFF; (*gDialogueBoxBackground)[i].textBGColourA = 0; (*gDialogueBoxBackground)[i].opacity = 0xFF; - (*gDialogueBoxBackground)[i].font = 0xFF; + (*gDialogueBoxBackground)[i].font = FONT_UNK_FF; if (i != 0) { (*gDialogueBoxBackground)[i].flags = DIALOGUE_BOX_UNK_01; } else { @@ -120,19 +131,19 @@ void load_fonts(void) { } (*gDialogueBoxBackground)[i].unk20 = 0; (*gDialogueBoxBackground)[i].unk22 = 0; - (*gDialogueBoxBackground)[i].text = 0; + (*gDialogueBoxBackground)[i].textBox = 0; } for (i = 0; i < unk8012A7EC_COUNT; i++) { (*D_8012A7EC)[i].unk1 = 0xFF; (*D_8012A7EC)[i].unk4 = 0; - (*D_8012A7EC)[i].unk10 = 0xFF; - (*D_8012A7EC)[i].unk11 = 0xFF; - (*D_8012A7EC)[i].unk12 = 0xFF; - (*D_8012A7EC)[i].unk13 = 0; - (*D_8012A7EC)[i].unk14 = 0xFF; - (*D_8012A7EC)[i].unk15 = 0xFF; - (*D_8012A7EC)[i].unk16 = 0xFF; - (*D_8012A7EC)[i].unk17 = 0; + (*D_8012A7EC)[i].textColourR = 0xFF; + (*D_8012A7EC)[i].textColourG = 0xFF; + (*D_8012A7EC)[i].textColourB = 0xFF; + (*D_8012A7EC)[i].textColourA = 0; + (*D_8012A7EC)[i].textBGColourR = 0xFF; + (*D_8012A7EC)[i].textBGColourG = 0xFF; + (*D_8012A7EC)[i].textBGColourB = 0xFF; + (*D_8012A7EC)[i].textBGColourA = 0; (*D_8012A7EC)[i].unk1C = 0; } func_800C4170(0); @@ -193,9 +204,12 @@ void func_800C422C(s32 arg0) { GLOBAL_ASM("asm/non_matchings/font/func_800C422C.s") #endif -void set_text_font(s32 arg0) { - if (arg0 < gNumberOfFonts) { - (*gDialogueBoxBackground)[0].font = arg0; +/** + * Set the font of the current dialogue box's text. + */ +void set_text_font(s32 fontID) { + if (fontID < gNumberOfFonts) { + (*gDialogueBoxBackground)[0].font = fontID; } } @@ -221,6 +235,9 @@ TextureHeader *func_800C4318(s32 font, u8 arg1) { GLOBAL_ASM("asm/non_matchings/font/func_800C4318.s") #endif +/** + * Sets the colour of the current dialogue box's text. + */ void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { (*gDialogueBoxBackground)[0].textColourR = red; (*gDialogueBoxBackground)[0].textColourG = green; @@ -229,6 +246,9 @@ void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { (*gDialogueBoxBackground)[0].opacity = opacity; } +/** + * Sets the colour of the current dialogue box's text background. + */ void set_text_background_color(s32 red, s32 green, s32 blue, s32 alpha) { (*gDialogueBoxBackground)[0].textBGColourR = red; (*gDialogueBoxBackground)[0].textBGColourG = green; @@ -241,6 +261,9 @@ void func_800C4404(Gfx **displayList, char *text, s32 alignmentFlags) { func_800C45A4(displayList, &(*gDialogueBoxBackground)[0], text, alignmentFlags, 1.0f); } +/** + * Builds the background settings, then renders the given text at a given position. + */ void draw_text(Gfx **displayList, s32 xpos, s32 ypos, char *text, s32 alignmentFlags) { DialogueBoxBackground *temp = &(*gDialogueBoxBackground)[0]; temp->xpos = (xpos == POS_CENTRED) ? temp->width >> 1 : xpos; @@ -370,37 +393,37 @@ void set_current_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, } void set_current_text_background_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha) { - DialogueBoxBackground *temp; + DialogueBoxBackground *dialogueBox; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &gDialogueBoxBackground[arg0]; - temp->textBGColourR = red; - temp->textBGColourG = green; - temp->textBGColourB = blue; - temp->textBGColourA = alpha; + dialogueBox = &gDialogueBoxBackground[arg0]; + dialogueBox->textBGColourR = red; + dialogueBox->textBGColourG = green; + dialogueBox->textBGColourB = blue; + dialogueBox->textBGColourA = alpha; } // Unused? void func_800C5094(s32 arg0, s32 arg1, s32 arg2) { - DialogueBoxBackground *temp; + DialogueBoxBackground *dialogueBox; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &gDialogueBoxBackground[arg0]; - temp->unk20 += arg1; - temp->unk22 += arg2; + dialogueBox = &gDialogueBoxBackground[arg0]; + dialogueBox->unk20 += arg1; + dialogueBox->unk22 += arg2; } // Unused? void func_800C50D8(s32 arg0) { - DialogueBoxBackground *temp; + DialogueBoxBackground *dialogueBox; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &gDialogueBoxBackground[arg0]; - temp->unk20 = 0; - temp->unk22 = 0; + dialogueBox = &gDialogueBoxBackground[arg0]; + dialogueBox->unk20 = 0; + dialogueBox->unk22 = 0; } // Unused? @@ -410,47 +433,54 @@ void func_800C510C(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { GLOBAL_ASM("asm/non_matchings/font/render_dialogue_text.s") -// Unused -void func_800C5428(s32 arg0, DialogueBox *arg1) { - DialogueBoxBackground *temp; - DialogueBox *temp_24; - DialogueBox **temp_24_ptr; +/** + * Unused function that moved a dialogue box ID to the front of the stack. + */ - temp = &gDialogueBoxBackground[arg0]; - temp_24_ptr = &temp->text; - temp_24 = temp->text; - while ((temp_24 != NULL) && (temp_24 != arg1)) { - temp_24_ptr = &temp_24->unk1C; - temp_24 = temp_24->unk1C; +UNUSED void move_dialogue_box_to_front(s32 dialogueBoxID, DialogueBox *dialogueBox) { + DialogueBoxBackground *dialogueBoxTemp; + DialogueBox *dialogueTextBox; + DialogueBox **dialogueTextBoxTemp; + + dialogueBoxTemp = &gDialogueBoxBackground[dialogueBoxID]; + dialogueTextBoxTemp = &dialogueBoxTemp->textBox; + dialogueTextBox = dialogueBoxTemp->textBox; + while ((dialogueTextBox != NULL) && (dialogueTextBox != dialogueBox)) { + dialogueTextBoxTemp = &dialogueTextBox->nextBox; + dialogueTextBox = dialogueTextBox->nextBox; } - if (temp_24 != NULL) { - *temp_24_ptr = temp_24->unk1C; - arg1->unk01 = 0xFF; + if (dialogueTextBox != NULL) { + *dialogueTextBoxTemp = dialogueTextBox->nextBox; + dialogueBox->textNum = DIALOGUE_NUM_NULL; } } -void func_800C5494(s32 arg0) { - DialogueBoxBackground *temp; - DialogueBox *temp_24, *temp_24_2; +/** + * Unused function that moved a dialogue box ID to the front of the list. + */ - temp = &gDialogueBoxBackground[arg0]; - temp_24 = temp->text; - if (temp_24 != NULL) { - temp_24_2 = temp_24; // This seems redundant. - while (temp_24_2 != NULL) { - temp_24_2->unk01 = 0xFF; - temp_24_2 = temp_24_2->unk1C; +void assign_dialogue_box_id(s32 dialogueBoxID) { + DialogueBoxBackground *dialogueBox; + DialogueBox *dialogueTextBox, *dialogueTextBoxTemp; + + dialogueBox = &gDialogueBoxBackground[dialogueBoxID]; + dialogueTextBox = dialogueBox->textBox; + if (dialogueTextBox != NULL) { + dialogueTextBoxTemp = dialogueTextBox; // This seems redundant. + while (dialogueTextBoxTemp != NULL) { + dialogueTextBoxTemp->textNum = DIALOGUE_NUM_NULL; + dialogueTextBoxTemp = dialogueTextBoxTemp->nextBox; } - temp->text = NULL; + dialogueBox->textBox = NULL; } } // Unused -void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { +void func_800C54E8(s32 dialogueBoxID, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { FontData *fontData; - DialogueBoxBackground *temp; + DialogueBoxBackground *dialogueBox; - temp = &gDialogueBoxBackground[arg0]; + dialogueBox = &gDialogueBoxBackground[dialogueBoxID]; if (arg1 != NULL) { if (arg1->unk19 != 0xFF) { @@ -461,7 +491,7 @@ void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { arg3 *= fontData->unk22; break; case 2: - arg3 *= (temp->height / fontData->unk22) * fontData->unk22; + arg3 *= (dialogueBox->height / fontData->unk22) * fontData->unk22; break; } arg1->unkC += arg2; @@ -475,50 +505,71 @@ void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { } } -void open_dialogue_box(s32 arg0) { - (*gDialogueBoxBackground)[arg0].flags |= DIALOGUE_BOX_OPEN; +/** + * Mark the selected dialogue box as open + */ +void open_dialogue_box(s32 dialogueBoxID) { + (*gDialogueBoxBackground)[dialogueBoxID].flags |= DIALOGUE_BOX_OPEN; } -void close_dialogue_box(s32 arg0) { - (*gDialogueBoxBackground)[arg0].flags &= DIALOGUE_BOX_CLOSED; +/** + * Mark the selected dialogue box as closed + */ +void close_dialogue_box(s32 dialogueBoxID) { + (*gDialogueBoxBackground)[dialogueBoxID].flags &= DIALOGUE_BOX_CLOSED; } -// Unused? -void func_800C564C(s32 arg0) { - (*gDialogueBoxBackground)[arg0].flags |= DIALOGUE_BOX_UNUSED_01; +/** + * Mark the selected dialogue box as an unknown value + */ +UNUSED void func_800C564C(s32 dialogueBoxID) { + (*gDialogueBoxBackground)[dialogueBoxID].flags |= DIALOGUE_BOX_UNUSED_01; } -// Unused? -void func_800C5678(s32 arg0) { - (*gDialogueBoxBackground)[arg0].flags &= DIALOGUE_BOX_UNUSED_02; +/** + * Mark the selected dialogue box with every flag + */ +UNUSED void func_800C5678(s32 dialogueBoxID) { + (*gDialogueBoxBackground)[dialogueBoxID].flags &= DIALOGUE_BOX_UNUSED_02; } -// Unused? -void func_800C56A4(s32 arg0) { - (*gDialogueBoxBackground)[arg0].flags |= DIALOGUE_BOX_UNK_01; +/** + * Mark the selected dialogue box as + */ +UNUSED void func_800C56A4(s32 dialogueBoxID) { + (*gDialogueBoxBackground)[dialogueBoxID].flags |= DIALOGUE_BOX_UNK_01; } -void func_800C56D0(s32 arg0) { - (*gDialogueBoxBackground)[arg0].flags &= DIALOGUE_BOX_UNK_02; +/** + * Mark the selected dialogue box as open with + */ +void func_800C56D0(s32 dialogueBoxID) { + (*gDialogueBoxBackground)[dialogueBoxID].flags &= DIALOGUE_BOX_UNK_02; } -void func_800C56FC(s32 arg0, s32 arg1, s32 arg2) { +/** + * Main function to render each dialogue box entry. + * Contains a timer that counts down two frames before closing a dialogue box + * when the player exits out of one. + */ +void render_dialogue_boxes(Gfx *dlist, Gfx *mat, VertexList *verts) { s32 i; - if (D_800E36E8 != 0) { - D_8012A7F4--; - if (D_8012A7F4 == 0) { - func_8009E9A8(); - D_800E36E8 = 0; + if (sDialogueBoxIsOpen) { + sDialogueBoxCloseTimer--; + if (sDialogueBoxCloseTimer == 0) { + dialogue_close_stub(); + sDialogueBoxIsOpen = FALSE; } } for (i = 1; i < 8; i++) { if ((*gDialogueBoxBackground)[i].flags & DIALOGUE_BOX_OPEN) { + //render_printf("%X\n", (*gDialogueBoxBackground)[i].flags); if ((*gDialogueBoxBackground)[i].flags & DIALOGUE_BOX_UNK_01) { - func_800C5B58(arg0, arg1, arg2, i); + render_dialogue_box(dlist, mat, verts, i); } else { - func_800C5B58(arg0, 0, 0, i); + render_dialogue_box(dlist, 0, 0, i); } } } @@ -580,64 +631,71 @@ void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) { } } -void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3) { - DialogueBoxBackground *temp; - DialogueBox *temp_24; +/** + * Render the selected dialogue box. Background first, then text. + */ +void render_dialogue_box(Gfx **dlist, Gfx *mat, VertexList *verts, s32 dialogueBoxID) { + DialogueBoxBackground *dialogueBox; + DialogueBox *dialogueTextBox; s32 i; - s32 x0, x1; - char sp6C[256]; - s32 y0, y1; + s32 x1, x2; + char text[256]; + s32 y1, y2; - temp = &gDialogueBoxBackground[arg3]; + dialogueBox = &gDialogueBoxBackground[dialogueBoxID]; - if (temp->backgroundColourA != 0) { - gSPDisplayList((*dlist)++, &D_800E3690); - gDkrDmaDisplayList((*dlist)++, ((u8 *)&D_800E36C8[1]) + 0x80000000, 2); + // Render dialogue box background. + if (dialogueBox->backgroundColourA != 0) { + gSPDisplayList((*dlist)++, dl_dialogue_box_begin); + gDkrDmaDisplayList((*dlist)++, ((u8 *)&dl_dialogue_box_drawmodes[1]) + 0x80000000, 2); gDPSetEnvColor((*dlist)++, 0, 0, 0, 0); - if ((temp->x2 - temp->x1) < 10 || (temp->y2 - temp->y1) < 10) { - render_fill_rectangle(dlist, temp->x1 - 2, temp->y1 - 2, temp->x2 + 2, temp->y2 + 2); + 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); } else { - render_fill_rectangle(dlist, temp->x1 - 2, temp->y1 + 2, temp->x1 + 2, temp->y2 - 2); - render_fill_rectangle(dlist, temp->x1 - 2, temp->y1 - 2, temp->x2 + 2, temp->y1 + 2); - render_fill_rectangle(dlist, temp->x2 - 2, temp->y1 + 2, temp->x2 + 2, temp->y2 - 2); - render_fill_rectangle(dlist, temp->x1 - 2, temp->y2 - 2, temp->x2 + 2, temp->y2 + 2); + render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y1 + 2, dialogueBox->x1 + 2, dialogueBox->y2 - 2); + render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y1 - 2, dialogueBox->x2 + 2, dialogueBox->y1 + 2); + render_fill_rectangle(dlist, dialogueBox->x2 - 2, dialogueBox->y1 + 2, dialogueBox->x2 + 2, dialogueBox->y2 - 2); + render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y2 - 2, dialogueBox->x2 + 2, dialogueBox->y2 + 2); } gDPPipeSync((*dlist)++); - gDPSetEnvColor((*dlist)++, temp->backgroundColourR, temp->backgroundColourG, temp->backgroundColourB, temp->backgroundColourA); - for (i = 0; D_800E3710[i] >= 0; i += 5) { - x0 = D_800E3710[i] + temp->x1; - y0 = (D_800E3710[i + 1]) ? D_800E3710[i + 2] + temp->y2 : D_800E3710[i + 2] + temp->y1; - x1 = temp->x2 - D_800E3710[i]; - y1 = (D_800E3710[i + 3]) ? D_800E3710[i + 4] + temp->y2 : D_800E3710[i + 4] + temp->y1; - render_fill_rectangle(dlist, x0, y0, x1, y1); + gDPSetEnvColor((*dlist)++, dialogueBox->backgroundColourR, dialogueBox->backgroundColourG, dialogueBox->backgroundColourB, dialogueBox->backgroundColourA); + // Loops through sDialogueBoxDimensions, rendering fillrects until it forms a rounded rectangle. + // The array determines the width and height of each entry before drawing it. + for (i = 0; sDialogueBoxDimensions[i] >= 0; i += 5) { + x1 = sDialogueBoxDimensions[i] + dialogueBox->x1; + y1 = (sDialogueBoxDimensions[i + 1]) ? sDialogueBoxDimensions[i + 2] + dialogueBox->y2 : sDialogueBoxDimensions[i + 2] + dialogueBox->y1; + x2 = dialogueBox->x2 - sDialogueBoxDimensions[i]; + y2 = (sDialogueBoxDimensions[i + 3]) ? sDialogueBoxDimensions[i + 4] + dialogueBox->y2 : sDialogueBoxDimensions[i + 4] + dialogueBox->y1; + render_fill_rectangle(dlist, x1, y1, x2, y2); } gDPPipeSync((*dlist)++); } - if (arg1 != NULL && arg2 != NULL) { - if (!D_800E36E8) { - func_8009E9A0(); - D_800E36E8 = 1; + if (mat != NULL && verts != NULL) { + if (!sDialogueBoxIsOpen) { + dialogue_open_stub(); + sDialogueBoxIsOpen = TRUE; } - D_8012A7F4 = 2; - func_8009E9B0(temp, dlist, arg1, arg2); + sDialogueBoxCloseTimer = 2; + func_8009E9B0(dialogueBox, dlist, mat, verts); } - temp_24 = temp->text; - while (temp_24 != NULL) { - temp->xpos = temp_24->unk8 + temp_24->unkC; - temp->ypos = temp_24->unkA + temp_24->unkE; - temp->textColourR = temp_24->unk10; - temp->textColourG = temp_24->unk11; - temp->textColourB = temp_24->unk12; - temp->textColourA = temp_24->unk13; - temp->textBGColourR = temp_24->unk14; - temp->textBGColourG = temp_24->unk15; - temp->textBGColourB = temp_24->unk16; - temp->textBGColourA = temp_24->unk17; - temp->opacity = temp_24->unk18; - temp->font = temp_24->unk19; - parse_string_with_number(temp_24->unk4, &sp6C, temp_24->unk01); - func_800C45A4(dlist, temp, &sp6C, 0, 1.0f); - temp_24 = temp_24->unk1C; + // Set and render the text portions of the dialogue box. + dialogueTextBox = dialogueBox->textBox; + while (dialogueTextBox != NULL) { + dialogueBox->xpos = dialogueTextBox->x1 + dialogueTextBox->x2; + dialogueBox->ypos = dialogueTextBox->y1 + dialogueTextBox->y2; + dialogueBox->textColourR = dialogueTextBox->textColourR; + dialogueBox->textColourG = dialogueTextBox->textColourG; + dialogueBox->textColourB = dialogueTextBox->textColourB; + dialogueBox->textColourA = dialogueTextBox->textColourA; + dialogueBox->textBGColourR = dialogueTextBox->textBGColourR; + dialogueBox->textBGColourG = dialogueTextBox->textBGColourG; + dialogueBox->textBGColourB = dialogueTextBox->textBGColourB; + dialogueBox->textBGColourA = dialogueTextBox->textBGColourA; + dialogueBox->opacity = dialogueTextBox->opacity; + dialogueBox->font = dialogueTextBox->font; + parse_string_with_number(dialogueTextBox->text, &text, dialogueTextBox->textNum); + func_800C45A4(dlist, dialogueBox, &text, 0, 1.0f); + dialogueTextBox = dialogueTextBox->nextBox; } } diff --git a/src/font.h b/src/font.h index 7348a5ff..3b842021 100644 --- a/src/font.h +++ b/src/font.h @@ -16,9 +16,12 @@ #define POS_CENTRED -0x8000 +#define DIALOGUE_NUM_NULL 0xFF + enum TextFonts { FONT_COLOURFUL, FONT_SMALL, + FONT_UNK_FF = 255, }; enum DialogueFlags { @@ -39,14 +42,14 @@ typedef struct unk8012A7EC { s32 unk4; s32 unk8; s32 unkC; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 unk14; - u8 unk15; - u8 unk16; - u8 unk17; + u8 textColourR; + u8 textColourG; + u8 textColourB; + u8 textColourA; + u8 textBGColourR; + u8 textBGColourG; + u8 textBGColourB; + u8 textBGColourA; s32 unk18; s32 unk1C; } unk8012A7EC; @@ -85,6 +88,67 @@ typedef struct FontData { /* 0x100 */ FontCharData unk100[96]; } FontData; +//Dialogue Box text linked list (Including background struct) +typedef struct DialogueBox { + u8 unk00; // Unused + u8 textNum; // A number that is drawn with the text, like a balloon door telling you how many more you need. + char *text; // Pointer to the text array + s16 x1; // Left position of the text + s16 y1; // Top portion of the text + s16 x2; // Right portion of the text + s16 y2; // Bottom portion of the text + u8 textColourR; + u8 textColourG; + u8 textColourB; + u8 textColourA; + u8 textBGColourR; + u8 textBGColourG; + u8 textBGColourB; + u8 textBGColourA; + u8 opacity; + u8 font; + struct DialogueBox *nextBox; +} DialogueBox; + +typedef struct { + u8 r; + u8 b; + u8 g; + u8 a; +} ColourRGBA; + +/* Size: 0x28 bytes */ +// Dialogue Box background +typedef struct DialogueBoxBackground { + s16 xpos; + s16 ypos; + s16 x1; + s16 y1; + s16 x2; + s16 y2; + s16 width; + s16 height; + u8 backgroundColourR; //Ideally should also be an array like the rest, but doesn't currently match. + u8 backgroundColourG; + u8 backgroundColourB; + u8 backgroundColourA; + //ColourRGBA textColour; + u8 textColourR; + u8 textColourG; + u8 textColourB; + u8 textColourA; + u8 textBGColourR; + u8 textBGColourG; + u8 textBGColourB; + u8 textBGColourA; + u8 opacity; + u8 font; + u16 flags; + s16 unk20; // Functionally Unused + s16 unk22; // Functionally Unused + DialogueBox *textBox; +} DialogueBoxBackground; + #define DIALOGUEBOXBACKGROUND_COUNT 8 #define unk8012A7EC_COUNT 64 #define DIALOGUEBOXBACKGROUND_TOTAL_SIZE (sizeof(DialogueBoxBackground) * DIALOGUEBOXBACKGROUND_COUNT) @@ -93,7 +157,7 @@ typedef struct FontData { void load_fonts(void); void func_800C4164(s32 arg0); void set_text_font(s32 arg0); -void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3); +void render_dialogue_box(Gfx **dlist, Gfx *mat, VertexList *verts, s32 index); void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity); void set_text_background_color(s32 red, s32 green, s32 blue, s32 alpha); void func_800C4404(Gfx** displayList, char *text, s32 alignmentFlags); @@ -108,18 +172,18 @@ void set_current_text_background_colour(s32 arg0, s32 arg1, s32 arg2, s32 arg3, void func_800C5094(s32 arg0, s32 arg1, s32 arg2); void func_800C50D8(s32 arg0); void func_800C510C(s32 arg0, s32 arg1, s32 arg2, s32 arg3); -void func_800C5428(s32 arg0, DialogueBox *arg1); -void func_800C5494(s32 arg0); +void move_dialogue_box_to_front(s32 arg0, DialogueBox *arg1); +void assign_dialogue_box_id(s32 arg0); void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4); -void open_dialogue_box(s32 arg0); -void close_dialogue_box(s32 arg0); -void func_800C564C(s32 arg0); -void func_800C5678(s32 arg0); -void func_800C56A4(s32 arg0); -void func_800C56D0(s32 arg0); -void func_800C56FC(s32 arg0, s32 arg1, s32 arg2); +void open_dialogue_box(s32 dialogueBoxID); +void close_dialogue_box(s32 dialogueBoxID); +UNUSED void func_800C564C(s32 dialogueBoxID); +UNUSED void func_800C5678(s32 dialogueBoxID); +UNUSED void func_800C56A4(s32 dialogueBoxID); +void func_800C56D0(s32 dialogueBoxID); +void render_dialogue_boxes(Gfx *dlist, Gfx *mat, VertexList *verts); void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry); -void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3); +void render_dialogue_box(Gfx **dlist, Gfx *mat, VertexList *verts, s32 index); void parse_string_with_number(unsigned char *input, char *output, s32 number); void s32_to_string(char** outString, s32 number); //Non Matching diff --git a/src/game_text.c b/src/game_text.c index f2f8b612..acaeaf48 100644 --- a/src/game_text.c +++ b/src/game_text.c @@ -78,7 +78,7 @@ void func_800C2AB4(void) { free_from_memory_pool(D_8012A7C8.unk0); D_8012A7B6 = 0; close_dialogue_box(6); - func_800C5494(6); + assign_dialogue_box_id(6); } void func_800C2AF4(s32 arg0) { @@ -99,7 +99,7 @@ void func_800C2F1C(s32 arg0) { D_8012A7A8 = 0; D_8012A7B6 = 0; close_dialogue_box(6); - func_800C5494(6); + assign_dialogue_box_id(6); } } else { D_8012A7A8 += arg0 * D_8012A7AA; diff --git a/src/menu.c b/src/menu.c index edd3d7e4..12e6512a 100644 --- a/src/menu.c +++ b/src/menu.c @@ -39,8 +39,8 @@ s32 D_80126398; s32 D_8012639C; Gfx *D_801263A0; s32 **D_801263A4; -s32 *D_801263A8; -s32 *D_801263AC; +Gfx *D_801263A8; +VertexList *D_801263AC; s32 *D_801263B0; unk801263C0 D_801263B4; unk801263C0 D_801263B8; @@ -496,33 +496,33 @@ s16 D_800DFCAC[4] = { }; u16 D_800DFCB4[112] = { - 0x00A1, 0x0020, 0x00A1, 0x0021, - 0x00A1, 0x0020, 0x0000, 0x00FF, - 0x8002, 0x0C00, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x001E, 0x00A0, 0x001E, - 0x00A0, 0x001E, 0xFFFF, 0xFF00, - 0xFF02, 0x0C00, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x0070, 0x00A0, 0x0070, - 0x00A0, 0x0070, 0xFFFF, 0xFF00, - 0xFF00, 0x0C00, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x0080, 0x00A0, 0x0080, - 0x00A0, 0x0080, 0xFFFF, 0xFF00, - 0xFF00, 0x0C00, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x00C0, 0x00A0, 0x00C0, - 0x00A0, 0x00C0, 0xFFFF, 0xFF00, - 0xFF00, 0x0C00, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x00D0, 0x00A0, 0x00D0, - 0x00A0, 0x00D0, 0xFFFF, 0xFF00, - 0xFF00, 0x0C00, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A1, 0x0020, 0x00A1, 0x0021, + 0x00A1, 0x0020, 0x0000, 0x00FF, + 0x8002, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x001E, 0x00A0, 0x001E, + 0x00A0, 0x001E, 0xFFFF, 0xFF00, + 0xFF02, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x0070, 0x00A0, 0x0070, + 0x00A0, 0x0070, 0xFFFF, 0xFF00, + 0xFF00, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x0080, 0x00A0, 0x0080, + 0x00A0, 0x0080, 0xFFFF, 0xFF00, + 0xFF00, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x00C0, 0x00A0, 0x00C0, + 0x00A0, 0x00C0, 0xFFFF, 0xFF00, + 0xFF00, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x00D0, 0x00A0, 0x00D0, + 0x00A0, 0x00D0, 0xFFFF, 0xFF00, + 0xFF00, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; @@ -616,8 +616,8 @@ MenuElement gCautionMenuTextElements[14] = { { 160, 200, 160, 208, 160, 200, 255, 255, 255, 0, 255, 0, 12, 0, NULL, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0 }, }; - -MenuElement gGameSelectTextElemsNoAdv2[7] = { + +MenuElement gGameSelectTextElemsNoAdv2[7] = { { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, 2, 12, 0, NULL, 0, 0, 0, 0 }, { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, 2, 12, 0, NULL, 0, 0, 0, 0 }, { -96, 39, -96, 39, -96, 39, 176, 224, 192, 255, 255, 0, 0, 7, NULL, 192, 44, 4, 4 }, @@ -625,9 +625,9 @@ MenuElement gGameSelectTextElemsNoAdv2[7] = { { -96, -9, -96, -9, -96, -9, 176, 224, 192, 255, 255, 0, 0, 7, NULL, 192, 44, 4, 4 }, { 160, 152, 160, 152, 160, 152, 255, 255, 255, 0, 255, 2, 12, 0, NULL, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0 }, -}; - -MenuElement gGameSelectTextElemsWithAdv2[9] = { +}; + +MenuElement gGameSelectTextElemsWithAdv2[9] = { { 161, 35, 161, 35, 161, 35, 0, 0, 0, 255, 128, 2, 12, 0, NULL, 0, 0, 0, 0 }, { 160, 32, 160, 32, 160, 32, 255, 255, 255, 0, 255, 2, 12, 0, NULL, 0, 0, 0, 0 }, { -112, 55, -112, 55, -112, 55, 176, 224, 192, 255, 255, 0, 0, 7, NULL, 224, 44, 4, 4 }, @@ -771,10 +771,10 @@ s16 D_800E0710[16] = { }; s16 D_800E0730[19] = { - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; @@ -796,9 +796,9 @@ s16 D_800E0758[54] = { }; s16 D_800E07C4[14] = { - 0x05, 0x06, 0x07, 0x3D, - 0x3C, 0x3F, 0x3E, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, + 0x05, 0x06, 0x07, 0x3D, + 0x3C, 0x3F, 0x3E, 0x08, + 0x09, 0x0A, 0x0B, 0x0C, 0x0D, -1 }; @@ -807,59 +807,59 @@ s16 D_800E07E0[4] = { }; s16 D_800E07E8[36] = { - 0x0004, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0018, 0x0019, 0x001A, - 0x001B, 0x001C, 0x001D, 0x0024, - 0x0025, 0x0026, 0x0027, 0x0028, - 0x0029, 0x002A, 0x002B, 0x001E, - 0x001F, 0x0020, 0x0021, 0x0022, - 0x0023, 0x002C, 0x002D, 0x002E, - 0x002F, 0x0030, 0x0031, 0x0040, + 0x0004, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x0024, + 0x0025, 0x0026, 0x0027, 0x0028, + 0x0029, 0x002A, 0x002B, 0x001E, + 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x002C, 0x002D, 0x002E, + 0x002F, 0x0030, 0x0031, 0x0040, 0x0041, 0x0043, 0x005E, 0xFFFF }; s16 D_800E0830[8] = { - 0x07, 0x00, 0x01, 0x02, + 0x07, 0x00, 0x01, 0x02, 0x03, 0x0B, 0x0C, -1 }; s16 D_800E0840[148] = { - 0x0000, 0xFFFF, 0x0001, 0x01FF, - 0xFF00, 0x0200, 0xFFFF, 0x0003, - 0x01FF, 0xFF00, 0x0400, 0xFFFF, - 0x0005, 0x01FF, 0xFF00, 0x0600, - 0xFFFF, 0x0006, 0x0200, 0x4000, - 0x0701, 0xFFFF, 0x0007, 0x0340, - 0x8000, 0x0800, 0xFFFF, 0x0008, - 0x0280, 0xC020, 0x0901, 0xFFFF, - 0x0009, 0x03C0, 0xFF20, 0x0A02, - 0xFFFF, 0x000B, 0x03FF, 0xFF00, - 0x0C02, 0xFFFF, 0x200D, 0x03FF, - 0xFF20, 0x0E02, 0xFFFF, 0x000E, - 0x0400, 0x4000, 0x0F03, 0xFFFF, - 0x000F, 0x0540, 0x8000, 0x1002, - 0xFFFF, 0x2010, 0x0480, 0xC000, - 0x1103, 0xFFFF, 0x2011, 0x05C0, - 0xFF00, 0x1204, 0xFFFF, 0x0013, - 0x05FF, 0xFF00, 0x1404, 0xFFFF, - 0x0015, 0x05FF, 0xFF00, 0x1604, - 0xFFFF, 0x0016, 0x0600, 0x4000, - 0x1705, 0xFFFF, 0x0017, 0x0740, - 0x8000, 0x1804, 0xFFFF, 0x0018, - 0x0680, 0xC020, 0x1905, 0xFFFF, - 0x0019, 0x07C0, 0xFF20, 0x1A06, - 0xFFFF, 0x001B, 0x07FF, 0xFF00, - 0x1C06, 0xFFFF, 0x201D, 0x07FF, - 0xFF20, 0x1E06, 0xFFFF, 0x001E, - 0x0800, 0x4000, 0x1F07, 0xFFFF, - 0x001F, 0x0940, 0x8000, 0x2006, - 0xFFFF, 0x2020, 0x0880, 0xC020, - 0x2107, 0xFFFF, 0x2021, 0x09C0, - 0xFF20, 0x2208, 0xFFFF, 0x0023, - 0x09FF, 0xFF00, 0x2408, 0xFFFF, - 0x2025, 0x09FF, 0xFF20, 0x2608, - 0xFFFF, 0x0027, 0x09FF, 0xFF00, - 0x2808, 0xFFFF, 0x2029, 0x09FF, + 0x0000, 0xFFFF, 0x0001, 0x01FF, + 0xFF00, 0x0200, 0xFFFF, 0x0003, + 0x01FF, 0xFF00, 0x0400, 0xFFFF, + 0x0005, 0x01FF, 0xFF00, 0x0600, + 0xFFFF, 0x0006, 0x0200, 0x4000, + 0x0701, 0xFFFF, 0x0007, 0x0340, + 0x8000, 0x0800, 0xFFFF, 0x0008, + 0x0280, 0xC020, 0x0901, 0xFFFF, + 0x0009, 0x03C0, 0xFF20, 0x0A02, + 0xFFFF, 0x000B, 0x03FF, 0xFF00, + 0x0C02, 0xFFFF, 0x200D, 0x03FF, + 0xFF20, 0x0E02, 0xFFFF, 0x000E, + 0x0400, 0x4000, 0x0F03, 0xFFFF, + 0x000F, 0x0540, 0x8000, 0x1002, + 0xFFFF, 0x2010, 0x0480, 0xC000, + 0x1103, 0xFFFF, 0x2011, 0x05C0, + 0xFF00, 0x1204, 0xFFFF, 0x0013, + 0x05FF, 0xFF00, 0x1404, 0xFFFF, + 0x0015, 0x05FF, 0xFF00, 0x1604, + 0xFFFF, 0x0016, 0x0600, 0x4000, + 0x1705, 0xFFFF, 0x0017, 0x0740, + 0x8000, 0x1804, 0xFFFF, 0x0018, + 0x0680, 0xC020, 0x1905, 0xFFFF, + 0x0019, 0x07C0, 0xFF20, 0x1A06, + 0xFFFF, 0x001B, 0x07FF, 0xFF00, + 0x1C06, 0xFFFF, 0x201D, 0x07FF, + 0xFF20, 0x1E06, 0xFFFF, 0x001E, + 0x0800, 0x4000, 0x1F07, 0xFFFF, + 0x001F, 0x0940, 0x8000, 0x2006, + 0xFFFF, 0x2020, 0x0880, 0xC020, + 0x2107, 0xFFFF, 0x2021, 0x09C0, + 0xFF20, 0x2208, 0xFFFF, 0x0023, + 0x09FF, 0xFF00, 0x2408, 0xFFFF, + 0x2025, 0x09FF, 0xFF20, 0x2608, + 0xFFFF, 0x0027, 0x09FF, 0xFF00, + 0x2808, 0xFFFF, 0x2029, 0x09FF, 0xFF20, 0xFF00, 0x0000, 0x0000 }; @@ -918,24 +918,24 @@ unk800DFC10 *D_800E0AF0[10] = { }; s16 D_800E0B18[74] = { - 0x0140, 0x017C, 0x01B8, 0x01F4, - 0x0230, 0x026C, 0x02A8, 0x02E4, - 0x01E0, 0x0000, 0x0018, 0x0039, - 0x005A, 0x007B, 0x009C, 0x00BD, - 0x00DE, 0x00FF, 0x00A0, 0x0000, - 0x0140, 0x01B8, 0x0230, 0x02A8, - 0x01E0, 0x0000, 0x0018, 0x0065, - 0x00B3, 0x0100, 0x00A0, 0x0000, - 0x0140, 0x01F4, 0x02A8, 0x01E0, - 0x0028, 0x008C, 0x00F0, 0x00A0, - 0x01E0, 0x00C0, 0x00A0, 0x00C0, - 0xFF60, 0x00C0, 0xFF80, 0xFFEC, - 0xFFE4, 0xFFE6, 0x0050, 0xFFF8, - 0xFFE4, 0xFFF4, 0xFFE4, 0x0006, - 0xFFE4, 0x0018, 0x0050, 0x0008, - 0x0000, 0x0078, 0x0000, 0x003C, - 0x0000, 0x001E, 0x0000, 0x0384, - 0x0000, 0x001E, 0x0000, 0x001E, + 0x0140, 0x017C, 0x01B8, 0x01F4, + 0x0230, 0x026C, 0x02A8, 0x02E4, + 0x01E0, 0x0000, 0x0018, 0x0039, + 0x005A, 0x007B, 0x009C, 0x00BD, + 0x00DE, 0x00FF, 0x00A0, 0x0000, + 0x0140, 0x01B8, 0x0230, 0x02A8, + 0x01E0, 0x0000, 0x0018, 0x0065, + 0x00B3, 0x0100, 0x00A0, 0x0000, + 0x0140, 0x01F4, 0x02A8, 0x01E0, + 0x0028, 0x008C, 0x00F0, 0x00A0, + 0x01E0, 0x00C0, 0x00A0, 0x00C0, + 0xFF60, 0x00C0, 0xFF80, 0xFFEC, + 0xFFE4, 0xFFE6, 0x0050, 0xFFF8, + 0xFFE4, 0xFFF4, 0xFFE4, 0x0006, + 0xFFE4, 0x0018, 0x0050, 0x0008, + 0x0000, 0x0078, 0x0000, 0x003C, + 0x0000, 0x001E, 0x0000, 0x0384, + 0x0000, 0x001E, 0x0000, 0x001E, 0x0000, 0x0384 }; @@ -953,7 +953,7 @@ char *gRacePlacementsArray[8] = { gFifthPlace, gSixthPlace, gSeventhPlace, gEighthPlace }; -MenuElement D_800E0BEC[8] = { +MenuElement D_800E0BEC[8] = { { 352, 172, 32, 172, -288, 172, 255, 255, 255, 0, 255, 0, 0, 3, &D_800E0A50, 0, 0, 0, 0 }, { 452, 166, 132, 166, -188, 166, 255, 255, 255, 0, 255, 0, 12, 0, NULL, 0, 0, 0, 0 }, { 560, 184, 240, 184, -80, 184, 255, 255, 255, 0, 255, 0, 12, 0, NULL, 0, 0, 0, 0 }, @@ -962,9 +962,9 @@ MenuElement D_800E0BEC[8] = { { 452, 216, 132, 216, -188, 216, 255, 192, 255, 0, 255, 0, 0, 1, NULL, 0, 0, 0, 0 }, { 560, 200, 240, 200, -80, 200, 128, 255, 255, 0, 255, 0, 0, 1, NULL, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0 }, -}; +}; -MenuElement D_800E0CEC[11] = { +MenuElement D_800E0CEC[11] = { { 575, 172, 255, 172, -65, 172, 255, 255, 255, 0, 255, 0, 0, 3, &D_800E0A50, 0, 0, 0, 0 }, { 542, 172, 222, 172, -98, 172, 255, 255, 255, 0, 255, 0, 0, 3, &D_800E0A50, 0, 0, 0, 0 }, { 509, 172, 189, 172, -131, 172, 255, 255, 255, 0, 255, 0, 0, 3, &D_800E0A50, 0, 0, 0, 0 }, @@ -976,12 +976,12 @@ MenuElement D_800E0CEC[11] = { { 481, 166, 161, 166, -159, 166, 0, 0, 0, 255, 128, 0, 12, 0, NULL, 0, 0, 0, 0 }, { 479, 164, 159, 164, -161, 164, 255, 255, 255, 0, 255, 0, 12, 0, NULL, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0 }, - + }; -MenuElement D_800E0E4C[9] = { +MenuElement D_800E0E4C[9] = { { 481, 174, 161, 174, -159, 174, 0, 0, 0, 255, 128, 0, 12, 0, NULL, 0, 0, 0, 0 }, { 479, 172, 159, 172, -161, 172, 255, 255, 255, 0, 255, 0, 12, 0, NULL, 0, 0, 0, 0 }, { 368, 192, 48, 192, -272, 192, 255, 64, 64, 96, 255, 0, 8, 0, NULL, 0, 0, 0, 0 }, @@ -1091,23 +1091,23 @@ MenuElement D_800E1048[9][3] = { }; s16 D_800E13A8[138] = { - 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, - 0x0082, 0x0040, 0x0020, 0x0082, 0x00DC, 0x00BC, 0x011E, 0x00DC, - 0x00BC, 0x011E, 0x00DC, 0x00BC, 0x011E, 0x00DC, 0x00BC, 0x011E, - 0x0030, 0x0030, 0x0044, 0x005A, 0x005A, 0x006E, 0x0084, 0x0084, - 0x0098, 0x00AE, 0x00AE, 0x00C2, 0x0030, 0x0030, 0x0044, 0x005A, - 0x005A, 0x006E, 0x0084, 0x0084, 0x0098, 0x00AE, 0x00AE, 0x00C2, - 0x0038, 0x0038, 0x0040, 0x006A, 0x006A, 0x0072, 0x009C, 0x009C, - 0x00A4, 0x00CE, 0x00CE, 0x00D6, 0x0038, 0x0038, 0x0040, 0x006A, - 0x006A, 0x0072, 0x009C, 0x009C, 0x00A4, 0x00CE, 0x00CE, 0x00D6, - 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, - 0x0082, 0x00DC, 0x00BC, 0x011E, 0x00DC, 0x00BC, 0x011E, 0x00DC, - 0x00BC, 0x011E, 0x0034, 0x0034, 0x0048, 0x006F, 0x006F, 0x0083, - 0x00AA, 0x00AA, 0x00BE, 0x0034, 0x0034, 0x0048, 0x006F, 0x006F, - 0x0083, 0x00AA, 0x00AA, 0x00BE, 0x004C, 0x004C, 0x0054, 0x007E, - 0x007E, 0x0086, 0x00B0, 0x00B0, 0x00B8, 0x004C, 0x004C, 0x0054, - 0x007E, 0x007E, 0x0086, 0x00B0, 0x00B0, 0x00B8, 0x008C, 0x006C, - 0x00CE, 0x008C, 0x006C, 0x00CE, 0x008C, 0x006C, 0x00CE, 0x008C, + 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, + 0x0082, 0x0040, 0x0020, 0x0082, 0x00DC, 0x00BC, 0x011E, 0x00DC, + 0x00BC, 0x011E, 0x00DC, 0x00BC, 0x011E, 0x00DC, 0x00BC, 0x011E, + 0x0030, 0x0030, 0x0044, 0x005A, 0x005A, 0x006E, 0x0084, 0x0084, + 0x0098, 0x00AE, 0x00AE, 0x00C2, 0x0030, 0x0030, 0x0044, 0x005A, + 0x005A, 0x006E, 0x0084, 0x0084, 0x0098, 0x00AE, 0x00AE, 0x00C2, + 0x0038, 0x0038, 0x0040, 0x006A, 0x006A, 0x0072, 0x009C, 0x009C, + 0x00A4, 0x00CE, 0x00CE, 0x00D6, 0x0038, 0x0038, 0x0040, 0x006A, + 0x006A, 0x0072, 0x009C, 0x009C, 0x00A4, 0x00CE, 0x00CE, 0x00D6, + 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, 0x0082, 0x0040, 0x0020, + 0x0082, 0x00DC, 0x00BC, 0x011E, 0x00DC, 0x00BC, 0x011E, 0x00DC, + 0x00BC, 0x011E, 0x0034, 0x0034, 0x0048, 0x006F, 0x006F, 0x0083, + 0x00AA, 0x00AA, 0x00BE, 0x0034, 0x0034, 0x0048, 0x006F, 0x006F, + 0x0083, 0x00AA, 0x00AA, 0x00BE, 0x004C, 0x004C, 0x0054, 0x007E, + 0x007E, 0x0086, 0x00B0, 0x00B0, 0x00B8, 0x004C, 0x004C, 0x0054, + 0x007E, 0x007E, 0x0086, 0x00B0, 0x00B0, 0x00B8, 0x008C, 0x006C, + 0x00CE, 0x008C, 0x006C, 0x00CE, 0x008C, 0x006C, 0x00CE, 0x008C, 0x006C, 0x00CE }; @@ -1193,10 +1193,10 @@ unk800E153C *D_800E16F4[5] = { }; s16 D_800E1708[34] = { - 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, - 0x32, 0x33, 0x34, 0x36, 0x35, 0x37, 0x38, 0x39, - 0x3A, 0x3B, 0x00, 0x01, 0x04, 0x3D, 0x3C, 0x3F, + 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, + 0x32, 0x33, 0x34, 0x36, 0x35, 0x37, 0x38, 0x39, + 0x3A, 0x3B, 0x00, 0x01, 0x04, 0x3D, 0x3C, 0x3F, 0x3E, -1 }; @@ -1235,22 +1235,22 @@ s16 D_800E17F0[2] = { }; s16 D_800E17F4[130] = { - 0x20A5, 0x0000, 0x20A5, 0x0001, 0x0002, 0x20A5, 0x0003, 0x0004, - 0x0005, 0x0006, 0x4000, 0x20A5, 0x0007, 0x0008, 0x20A5, 0x0009, - 0x000A, 0x000B, 0x000C, 0x30A5, 0x000D, 0x000E, 0x000F, 0x4000, - 0x20A5, 0x0010, 0x0011, 0x20A5, 0x0012, 0x0013, 0x20A5, 0x0014, - 0x4000, 0x20A5, 0x0015, 0x0016, 0x20A5, 0x0017, 0x0018, 0x20A5, - 0x0019, 0x001A, 0x4000, 0x20A5, 0x001B, 0x001C, 0x001D, 0x001E, - 0x001F, 0x30A5, 0x0020, 0x0021, 0x0022, 0x0023, 0x30A5, 0x0024, - 0x0025, 0x0026, 0x4000, 0x20A5, 0x0027, 0x0028, 0x0029, 0x002A, - 0x002B, 0x30A5, 0x002C, 0x002D, 0x002E, 0x30A5, 0x002F, 0x0030, - 0x0031, 0x4000, 0x20A5, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, - 0x30A5, 0x0037, 0x0038, 0x0039, 0x003A, 0x30A5, 0x003B, 0x003C, - 0x003D, 0x003E, 0x4000, 0x20A5, 0x003F, 0x0040, 0x0041, 0x20A5, - 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x20A5, 0x0047, 0x0048, - 0x0049, 0x4000, 0x20A5, 0x004A, 0x004B, 0x30A5, 0x004C, 0x30A5, - 0x004D, 0x4000, 0x20A5, 0x004E, 0x004F, 0x20A5, 0x0050, 0x0051, - 0x20A5, 0x0052, 0x0053, 0x4000, 0x20A5, 0x0054, 0x210E, 0x0055, + 0x20A5, 0x0000, 0x20A5, 0x0001, 0x0002, 0x20A5, 0x0003, 0x0004, + 0x0005, 0x0006, 0x4000, 0x20A5, 0x0007, 0x0008, 0x20A5, 0x0009, + 0x000A, 0x000B, 0x000C, 0x30A5, 0x000D, 0x000E, 0x000F, 0x4000, + 0x20A5, 0x0010, 0x0011, 0x20A5, 0x0012, 0x0013, 0x20A5, 0x0014, + 0x4000, 0x20A5, 0x0015, 0x0016, 0x20A5, 0x0017, 0x0018, 0x20A5, + 0x0019, 0x001A, 0x4000, 0x20A5, 0x001B, 0x001C, 0x001D, 0x001E, + 0x001F, 0x30A5, 0x0020, 0x0021, 0x0022, 0x0023, 0x30A5, 0x0024, + 0x0025, 0x0026, 0x4000, 0x20A5, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x30A5, 0x002C, 0x002D, 0x002E, 0x30A5, 0x002F, 0x0030, + 0x0031, 0x4000, 0x20A5, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, + 0x30A5, 0x0037, 0x0038, 0x0039, 0x003A, 0x30A5, 0x003B, 0x003C, + 0x003D, 0x003E, 0x4000, 0x20A5, 0x003F, 0x0040, 0x0041, 0x20A5, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x20A5, 0x0047, 0x0048, + 0x0049, 0x4000, 0x20A5, 0x004A, 0x004B, 0x30A5, 0x004C, 0x30A5, + 0x004D, 0x4000, 0x20A5, 0x004E, 0x004F, 0x20A5, 0x0050, 0x0051, + 0x20A5, 0x0052, 0x0053, 0x4000, 0x20A5, 0x0054, 0x210E, 0x0055, 0x0056, 0x4000 }; @@ -1258,41 +1258,41 @@ u16 D_800E18F8 = 0x1000; // Unused? u16 D_800E18FC[30] = { - 0x0001, 0x0002, 0x0003, 0x4000, - 0x61F4, 0x0004, 0x0005, 0x0006, - 0x0007, 0x4000, 0x61F4, 0x0008, - 0x0009, 0x000A, 0x000B, 0x4000, - 0x61F4, 0x000C, 0x000D, 0x000E, - 0x000F, 0x4000, 0x61F4, 0x0010, - 0x0011, 0x0012, 0x0013, 0x4000, + 0x0001, 0x0002, 0x0003, 0x4000, + 0x61F4, 0x0004, 0x0005, 0x0006, + 0x0007, 0x4000, 0x61F4, 0x0008, + 0x0009, 0x000A, 0x000B, 0x4000, + 0x61F4, 0x000C, 0x000D, 0x000E, + 0x000F, 0x4000, 0x61F4, 0x0010, + 0x0011, 0x0012, 0x0013, 0x4000, 0x1000, 0x0000 }; // List of amazing people. char *gCreditsArray[87] = { - "CREDITS", - "Software Director", "R.Harrison", - "Software Engineers", "P.Mountain", "J.Pegg", "R.Gale", - "Art Director", "K.Bayliss", + "CREDITS", + "Software Director", "R.Harrison", + "Software Engineers", "P.Mountain", "J.Pegg", "R.Gale", + "Art Director", "K.Bayliss", "3D Artists", "L.Musgrave", "K.Rabbette", "D.Smith", "J.Christensen", "B.Smyth", "P.Cunningham", - "Music", "D.Wise", - "Sound Effects", "G.Norgate", - "ALSO", - "Additional Design", "M.Wakeley", - "Documentation", "L.Loveday", "Liason", "E.Hochberg", - "Character Voices", "K.Bayliss", "J.Christensen", "E.Fischer", "K.Rabbette", "L.Ray", + "Music", "D.Wise", + "Sound Effects", "G.Norgate", + "ALSO", + "Additional Design", "M.Wakeley", + "Documentation", "L.Loveday", "Liason", "E.Hochberg", + "Character Voices", "K.Bayliss", "J.Christensen", "E.Fischer", "K.Rabbette", "L.Ray", "L.Schuneman", "C.Seavor", "D.Smith", "J.Stamper", "K.Stamper", "C.Sutherland", - "Rare Quality Assurance", "H.Ward", "G.Richards", "S.Farmer", "J.Williams", "D.Wong", - "G.Jones", "M.Penny", "S.Brand", "S.Malpass", "A.Wilson", - "NOA Thanks To", "M.Fukuda", "K.Lobb", "M.Kelbaugh", "A.Williams", "R.Johnson", "M.Forrest", - "P.Sandhop", "H.Sterchi", "T.Hertzog", "D.Bridgham", "G.Richardson", "B.Smith", - "NOA Thanks To", "NOA Tree House", "NOA Tree Branch", - "NCL Thank You's", "K.Terasaki", "M.Goto", "H.Yamada", "Mario Club", - "NOE Thank You's", "J.Kraft", "J.Bardakoff", - "Special Thanks To", "J.Hochberg", "H.Lincoln", "M.Arakawa", - "Game Director", "L.Schuneman", - "Producer", "C.Stamper", - "Executive Producer", "T.Stamper", + "Rare Quality Assurance", "H.Ward", "G.Richards", "S.Farmer", "J.Williams", "D.Wong", + "G.Jones", "M.Penny", "S.Brand", "S.Malpass", "A.Wilson", + "NOA Thanks To", "M.Fukuda", "K.Lobb", "M.Kelbaugh", "A.Williams", "R.Johnson", "M.Forrest", + "P.Sandhop", "H.Sterchi", "T.Hertzog", "D.Bridgham", "G.Richardson", "B.Smith", + "NOA Thanks To", "NOA Tree House", "NOA Tree Branch", + "NCL Thank You's", "K.Terasaki", "M.Goto", "H.Yamada", "Mario Club", + "NOE Thank You's", "J.Kraft", "J.Bardakoff", + "Special Thanks To", "J.Hochberg", "H.Lincoln", "M.Arakawa", + "Game Director", "L.Schuneman", + "Producer", "C.Stamper", + "Executive Producer", "T.Stamper", NULL, NULL, NULL }; @@ -1379,7 +1379,7 @@ Gfx D_800E1CA0[][2] = { s8 D_800E1CD0[32] = { 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, - 10, 11, 12, 13, 14, 12, 14, 15, + 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 0, 0 }; @@ -1395,10 +1395,10 @@ s8 D_800E1CF0[60] = { }; u16 D_800E1D2C[40] = { - 0x0000, 0x0000, 0x0100, 0x0000, 0x01FF, 0x00FF, 0x0001, 0x00FF, - 0x01FF, 0x00FF, 0x0100, 0x0000, 0x0100, 0xFF00, 0x01FF, 0xFF01, - 0x0001, 0xFF01, 0x01FF, 0xFF01, 0x0100, 0xFF00, 0x0000, 0xFF00, - 0x0000, 0x0000, 0x0001, 0x00FF, 0x0001, 0xFF01, 0x0000, 0xFF00, + 0x0000, 0x0000, 0x0100, 0x0000, 0x01FF, 0x00FF, 0x0001, 0x00FF, + 0x01FF, 0x00FF, 0x0100, 0x0000, 0x0100, 0xFF00, 0x01FF, 0xFF01, + 0x0001, 0xFF01, 0x01FF, 0xFF01, 0x0100, 0xFF00, 0x0000, 0xFF00, + 0x0000, 0x0000, 0x0001, 0x00FF, 0x0001, 0xFF01, 0x0000, 0xFF00, 0x0001, 0x00FF, 0x01FF, 0x00FF, 0x01FF, 0xFF01, 0x0001, 0xFF01 }; @@ -2140,8 +2140,8 @@ void func_800828B8(void) { } } -void func_800829F8(Gfx *dl, s32 updateRate) { - s32 temp; +void print_missing_controller_text(Gfx *dl, s32 updateRate) { + s32 posY; D_800DF46C += updateRate; @@ -2150,11 +2150,11 @@ void func_800829F8(Gfx *dl, s32 updateRate) { set_text_font(0); set_text_color(255, 255, 255, 0, 0xFF); set_text_background_color(0, 0, 0, 0); - temp = 0xD0; + posY = 208; if (osTvType == TV_TYPE_PAL) { - temp = 0xEA; + posY = 234; } - draw_text(dl, POS_CENTRED, temp, gMenuText[151], 0xC); + draw_text(dl, POS_CENTRED, posY, gMenuText[151], 0xC); } } @@ -2836,7 +2836,7 @@ void func_80087EB8(void) { func_800C422C(2); func_8007FF88(); func_8009C4A8(D_800DFC78); - func_800C5494(7); + assign_dialogue_box_id(7); free_from_memory_pool(D_80126A0C); free_from_memory_pool(D_80126A64); } @@ -2996,7 +2996,7 @@ void menu_magic_codes_init(void) { func_800C01D8(&D_800DF77C); set_current_dialogue_box_coords(7, 0x32, 0x32, 0x10E, 0x84); set_current_dialogue_background_colour(7, 0, 0, 0, 0x80); - func_800C5494(7); + assign_dialogue_box_id(7); func_800C4170(2); } @@ -3011,7 +3011,7 @@ void render_magic_codes_ui(s32 arg0) { char c; set_text_background_color(0, 0, 0, 0); - func_800C5B58(&D_801263A0, 0, 0, 7); + render_dialogue_box(&D_801263A0, 0, 0, 7); set_text_font(2); set_text_color(0, 0, 0, 0xFF, 0x80); draw_text(&D_801263A0, 0xA1, 0x23, gMenuText[17], 0xC); // gMenuText[17] = "MAGIC CODES" @@ -3090,7 +3090,7 @@ void render_magic_codes_ui(s32 arg0) { if (osTvType == TV_TYPE_PAL) { yPos = 0x86; } - func_800C5494(6); + assign_dialogue_box_id(6); set_dialogue_font(6, FONT_COLOURFUL); set_current_dialogue_box_coords(6, 0x4C, yPos - 0x1C, 0xF4, yPos + 0x1C); set_current_dialogue_background_colour(6, 0, 0, 0, 0xA0); @@ -3115,7 +3115,7 @@ void render_magic_codes_ui(s32 arg0) { yPos += 0x14; } } - func_800C5B58(&D_801263A0, 0, 0, 6); + render_dialogue_box(&D_801263A0, 0, 0, 6); } if ((get_filtered_cheats() << 3) < 0) { calculate_and_display_rom_checksum(); @@ -4427,7 +4427,7 @@ void render_track_select_setup_ui(s32 arg0) { if (gNumberOfActivePlayers == 1) { // Glow effect set_current_dialogue_box_coords(7, 0x86, sp80 + 0x70, 0xBA, sp80 + 0x89); - func_800C5B58(&D_801263A0, 0, 0, 7); + render_dialogue_box(&D_801263A0, 0, 0, 7); if (D_801263E0 <= 0) { render_textured_rectangle(&D_801263A0, &D_800E05B4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, D_800DF764); } else { @@ -4451,7 +4451,7 @@ void render_track_select_setup_ui(s32 arg0) { s32 temp_v1 = D_800E0688[s3 + (i * 2) + 1] + sp80; // Glow effect around Player image set_current_dialogue_box_coords(7, temp_v0_9 - 2, temp_v1 - 2, temp_v0_9 + 0x32, temp_v1 + 0x17); - func_800C5B58(&D_801263A0, 0, 0, 7); + render_dialogue_box(&D_801263A0, 0, 0, 7); } // "Player" text image @@ -4690,7 +4690,7 @@ void menu_5_init(void) { func_800C4170(2); load_level_for_menu(s0, -1, 1); } - func_800C5494(7); + assign_dialogue_box_id(7); if (func_8006B14C(s0) & 0x40) { func_800C31EC(func_8006B190(s0) + 0x3B); } @@ -4828,7 +4828,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_80094170.s") void n_alSynRemovePlayer(void) { func_80072298(1); close_dialogue_box(7); - func_800C5494(7); + assign_dialogue_box_id(7); D_800E0984 = 0; } @@ -5958,7 +5958,7 @@ s32 func_8009CFEC(u32 dialogueOption) { } result = 0; update_controller_sticks(); - func_800C5494(1); + assign_dialogue_box_id(1); open_dialogue_box(1); set_current_dialogue_background_colour(1, 0, 0, 0, 0x80); func_8001F450(); @@ -5998,6 +5998,9 @@ void set_option_text_colour(s32 condition) { gDialogOptionTangible = (u8)FALSE; } +/** + * Render a line of text at a given Y position, and pass through the text ID and option ID. + */ void render_dialogue_option(char *text, s32 yOffset, s32 optionID) { set_option_text_colour(sDialogueOption == sDialogueOptionMax); if (sDialogueOption == sDialogueOptionMax) { @@ -6040,6 +6043,9 @@ void func_8009D33C(s32 arg0, s32 arg1) { } } +/** + * Handles all of the rendering and logic of Taj's dialogue menu. + */ s32 taj_menu_loop(void) { s32 sp2C; s32 buttonsPressed; // sp28 @@ -6449,6 +6455,9 @@ GLOBAL_ASM("asm/non_matchings/menu/tt_menu_loop.s") GLOBAL_ASM("asm/non_matchings/menu/func_8009E3D0.s") +/** + * Dialogue menu for the trophy cabinets in each world hub. + */ s32 trophy_race_cabinet_menu_loop(void) { s32 currentOption; s32 buttonsPressed; @@ -6482,24 +6491,37 @@ s32 trophy_race_cabinet_menu_loop(void) { return currentOption; } -void func_8009E9A0(void) { +/** + * Blank function called when a dialogue box is opened. + */ + +void dialogue_open_stub(void) { } -void func_8009E9A8(void) { +/** + * Blank function called when a dialogue box is closed. + */ + +void dialogue_close_stub(void) { } -f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { - D_801263A0 = *arg1; - D_801263A8 = *arg2; - D_801263AC = *arg3; +/** + * Renders a textbox with a displaylist. + * Return value goes completely unused. + */ + +f32 func_8009E9B0(UNUSED DialogueBoxBackground *textbox, Gfx **dlist, Gfx **mat, VertexList **verts) { + D_801263A0 = *dlist; + D_801263A8 = *mat; + D_801263AC = *verts; func_80067F2C(&D_801263A0, &D_801263A8); if (D_800E1E28 != 0 && sCurrentMenuID == 4) { func_8009E3D0(); } - *arg1 = D_801263A0; - *arg2 = D_801263A8; - *arg3 = D_801263AC; - return 1.0f; + *dlist = D_801263A0; + *mat = D_801263A8; + *verts = D_801263AC; + return TRUE; } s64 *func_8009EA6C(void) { @@ -6543,8 +6565,8 @@ s32 get_language(void) { } /** - * Sets the language used by the game. Even though German is not selectable in the US version, it is - * still fully intact. Japanese is not properly implemented in the US 1.0 version of the game. If you + * Sets the language used by the game. Even though German is not selectable in the US version, it is + * still fully intact. Japanese is not properly implemented in the US 1.0 version of the game. If you * tried to switch to it, all you would see is the word "Japanese" used everywhere as a placeholder. */ void set_language(s32 language) { @@ -6569,6 +6591,9 @@ void set_language(s32 language) { func_8006ECE0(); } +/** + * Returns TRUE if the player has adventure two unlocked. + */ s32 is_adventure_two_unlocked(void) { return D_80126448 & 1; } @@ -6586,7 +6611,7 @@ s32 is_in_adventure_two(void) { */ s32 is_in_two_player_adventure(void) { if (is_in_tracks_mode()) { - return 0; + return FALSE; } return gIsInTwoPlayerAdventure; } diff --git a/src/menu.h b/src/menu.h index a7fb4ede..862460c4 100644 --- a/src/menu.h +++ b/src/menu.h @@ -5,6 +5,7 @@ #include "structs.h" #include "PR/gbi.h" #include "fade_transition.h" +#include "font.h" #define TT_MENU_ROOT 0 #define TT_MENU_CONT_PAK_ERROR_1 1 @@ -395,9 +396,9 @@ extern s32 D_800DFFD0; extern s32 D_800DFFD4; extern MenuElement gCautionMenuTextElements[14]; - + extern MenuElement gGameSelectTextElemsNoAdv2[7]; - + extern MenuElement gGameSelectTextElemsWithAdv2[9]; extern s16 D_800E0398[6]; @@ -665,7 +666,7 @@ s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4); void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 arg6); void func_80081E54(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); void func_800828B8(void); -void func_800829F8(Gfx *dl, s32 updateRate); +void print_missing_controller_text(Gfx *dl, s32 updateRate); void menu_logos_screen_init(void); s32 menu_logo_screen_loop(s32 arg0); void func_80082FAC(void); @@ -772,9 +773,9 @@ void func_8009D33C(s32 arg0, s32 arg1); s32 taj_menu_loop(void); s32 func_8009D9F4(void); s32 trophy_race_cabinet_menu_loop(void); -void func_8009E9A0(void); -void func_8009E9A8(void); -f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **arg1, s32 *arg2, s32 *arg3); +void dialogue_open_stub(void); +void dialogue_close_stub(void); +f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **dlist, Gfx **mat, VertexList **vtx); s64 *func_8009EA6C(void); s32 func_8009EA78(s64 arg0); s32 func_8009EABC(s64 arg0); diff --git a/src/printf.c b/src/printf.c index 035f83d1..4960bc73 100644 --- a/src/printf.c +++ b/src/printf.c @@ -30,7 +30,7 @@ u8 D_800E2EF4[196] = { 0x00, 0x00, 0x00, 0x00 }; -Gfx D_800E2FB8[] = { +Gfx dl_debug_font_settings[] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetTextureLOD(G_TL_TILE), @@ -119,12 +119,18 @@ s32 render_printf(const char *format, ...) { #else GLOBAL_ASM("asm/non_matchings/printf/render_printf.s") #endif -GLOBAL_ASM("asm/non_matchings/printf/func_800B5F78.s") +GLOBAL_ASM("asm/non_matchings/printf/print_debug_strings.s") +/** + * Set the colour of the current debug text. + */ void set_render_printf_color(u8 red, u8 green, u8 blue, u8 alpha) { RENDER_PRINTF_CMD_SET_COLOR(red, green, blue, alpha) } +/** + * Set the background colour of the current debug text. + */ void set_render_printf_background_color(u8 red, u8 green, u8 blue, u8 alpha) { RENDER_PRINTF_CMD_SET_BACKGROUND_COLOR(red, green, blue, alpha) } diff --git a/src/screen_asset.c b/src/screen_asset.c index 6d1b2e0a..baaeb7fd 100644 --- a/src/screen_asset.c +++ b/src/screen_asset.c @@ -15,7 +15,7 @@ Gfx gRdpSetModeScreenAsset[] = { * Returns the address of the screen asset, or 0x80100000 if no screen assets were found. * Unused. */ -u8 *load_screen(s32 screenIndex) { +UNUSED u8 *load_screen(s32 screenIndex) { u8 *someAddr; s32 screenTableCount, start, size; s32 *screenTable; @@ -55,7 +55,7 @@ u8 *load_screen(s32 screenIndex) { * Renders a 320x240 RGBA16 screen asset. * Unused. */ -void render_screen(Gfx **dlist, u8 *screenAddress) { +UNUSED void render_screen(Gfx **dlist, u8 *screenAddress) { s32 y_pos; gDkrDmaDisplayList((*dlist)++, (u32)&gRdpSetModeScreenAsset + 0x80000000, numberOfGfxCommands(gRdpSetModeScreenAsset)); diff --git a/src/screen_asset.h b/src/screen_asset.h index c82f1a0a..f9ad7914 100644 --- a/src/screen_asset.h +++ b/src/screen_asset.h @@ -11,7 +11,7 @@ #define SCREEN_HEIGHT_PART 6 -u8 *load_screen(s32 screenIndex); -void render_screen(Gfx **dlist, u8 *screenAddress); +UNUSED u8 *load_screen(s32 screenIndex); +UNUSED void render_screen(Gfx **dlist, u8 *screenAddress); #endif diff --git a/src/thread0_epc.c b/src/thread0_epc.c index f09b1f99..983f455b 100644 --- a/src/thread0_epc.c +++ b/src/thread0_epc.c @@ -213,7 +213,7 @@ void func_800B76B8(s32 arg0, s32 arg1) { } //Called as a check to see if render_epc_lock_up_display should be called. -s32 func_800B76DC(void) { +s32 get_crash_status(void) { s32 fileNum; s32 controllerIndex = 0; u8 *sp420[256]; diff --git a/src/thread0_epc.h b/src/thread0_epc.h index b7a46294..589019d8 100644 --- a/src/thread0_epc.h +++ b/src/thread0_epc.h @@ -77,7 +77,7 @@ 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 func_800B76DC(void); +s32 get_crash_status(void); void func_800B77D4(s32 arg0); void func_800B6F50(void); // Non Matching diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 442fe5d5..90aca06b 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -82,14 +82,14 @@ s8 D_800DD374 = 0; s32 D_800DD378 = 1; s32 D_800DD37C = 0; s32 D_800DD380 = 0; // Currently unknown, might be a different type. -s32 D_800DD384 = 0; +s32 sControllerStatus = 0; s32 D_800DD388 = 0; // Currently unknown, might be a different type. s8 D_800DD38C = 0; s8 D_800DD390 = 0; s16 D_800DD394 = 0; s8 D_800DD398 = 0; s8 D_800DD39C = 0; -s8 D_800DD3A0 = 0; +s8 D_800DD3A0 = FALSE; s32 D_800DD3A4 = 0; // Currently unknown, might be a different type. s32 D_800DD3A8 = 0; // Currently unknown, might be a different type. s32 D_800DD3AC = 0; // Currently unknown, might be a different type. @@ -133,12 +133,12 @@ s16 D_801211C8[20]; Gfx *gDisplayLists[2]; Gfx *gCurrDisplayList; s32 D_801211FC; -s32 *gHudMatrices[2]; -s32 gCurrHudMat; -s32 *gHudVertices[2]; -s32 gCurrHudVerts; -s32 *gHudTriangles[2]; -s32 gCurrHudTris; +Mtx *gHudMatrices[2]; +Gfx *gCurrHudMat; +VertexList *gHudVertices[2]; +VertexList *gCurrHudVerts; +TriangleList *gHudTriangles[2]; +TriangleList *gCurrHudTris; s32 D_80121230[8]; s8 D_80121250[16]; OSSched gMainSched; // 0x288 / 648 bytes @@ -159,7 +159,7 @@ s8 gIsPaused; s8 D_80123516; s32 D_80123518; s32 D_8012351C; -s32 D_80123520; +s32 sBootDelayTimer; s8 D_80123524; s8 D_80123525; s8 D_80123526; @@ -781,10 +781,14 @@ s32 func_8006C300(void) { } } +/** + * Main looping function for the main thread. + */ + void thread3_main(s32 arg0) { - func_8006C3E0(); + init_game(); D_800DD37C = func_8006A1C4(D_800DD37C, 0); - D_80123520 = 0; + sBootDelayTimer = 0; sRenderContext = DRAW_INTRO; while (1) { if (is_reset_pressed()) { @@ -797,12 +801,17 @@ void thread3_main(s32 arg0) { | DPC_CLR_CMD_CTR | DPC_CLR_CMD_CTR); while (1); // Infinite loop } - render(); + main_game_loop(); func_80065E30(); } } -void func_8006C3E0(void) { +/** + * Setup all of the necessary pieces required for the game to function. + * This includes the memory pool. controllers, video, audio, core assets and more. + */ + +void init_game(void) { s32 mode; init_main_memory_pool(); @@ -823,16 +832,16 @@ void func_8006C3E0(void) { } osCreateScheduler(&gMainSched, &gSPTaskNum, /*priority*/ 13, (u8)mode, 1); - D_800DD3A0 = 0; - if (func_8006EFB8() == 0) { - D_800DD3A0 = 1; + D_800DD3A0 = FALSE; + if (!func_8006EFB8()) { + D_800DD3A0 = TRUE; } init_video(1, &gMainSched); func_80076BA0(); func_80078100(&gMainSched); audio_init(&gMainSched); func_80008040(); - D_800DD384 = func_8006A10C(); + sControllerStatus = init_controllers(); func_8007AC70(); func_8005F850(); func_8000BF8C(); @@ -860,9 +869,14 @@ void func_8006C3E0(void) { osSetTime(0); } -void render(void) { - s32 phi_v0; - s32 phi_v0_2; +/** + * The main gameplay loop. + * Contains all game logic, audio and graphics processing. + */ + +void main_game_loop(void) { + s32 debugLoopCounter; + s32 framebufferSize; s32 tempLogicUpdateRate, tempLogicUpdateRateMax; osSetTime(0); @@ -896,23 +910,23 @@ void render(void) { init_rdp_and_framebuffer(&gCurrDisplayList); render_background(&gCurrDisplayList, &gCurrHudMat, 1); D_800DD37C = func_8006A1C4(D_800DD37C, sLogicUpdateRate); - if (func_800B76DC() != 0) { + if (get_crash_status()) { render_epc_lock_up_display(); sRenderContext = DRAW_CRASH_SCREEN; } - if (D_800DD3A0 != 0) { - phi_v0 = 0; - while (phi_v0 != 10000000) { - phi_v0 += 1; + if (D_800DD3A0) { + debugLoopCounter = 0; + while (debugLoopCounter != 10000000) { + debugLoopCounter += 1; } - if (phi_v0 >= 20000001) { // This shouldn't ever be true? + if (debugLoopCounter >= 20000001) { // This shouldn't ever be true? render_printf(D_800E7134 /* "BBB\n" */); } } switch (sRenderContext) { case DRAW_INTRO: // Pre-boot screen - func_8006F43C(); + pre_intro_loop(); break; case DRAW_MENU: // In a menu func_8006DCF8(sLogicUpdateRate); @@ -928,16 +942,17 @@ void render(void) { // This is a good spot to place custom text if you want it to overlay it over ALL the // menus & gameplay. - func_80000D00((u8)sLogicUpdateRate); - func_800B5F78(&gCurrDisplayList); - func_800C56FC(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); + process_audio(sLogicUpdateRate); + print_debug_strings(&gCurrDisplayList); + render_dialogue_boxes(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); close_dialogue_box(4); - func_800C5494(4); - if (func_800C0494(sLogicUpdateRate) != 0) { + assign_dialogue_box_id(4); + // handle_transitions will perform the logic of transitions and return the transition ID. + if (handle_transitions(sLogicUpdateRate)) { render_fade_transition(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); } - if ((D_80123520 >= 8) && (func_8006F4C8() != 0)) { - func_800829F8(&gCurrDisplayList, sLogicUpdateRate); + if ((sBootDelayTimer >= 8) && (is_controller_missing())) { + print_missing_controller_text(&gCurrDisplayList, sLogicUpdateRate); } gDPFullSync(gCurrDisplayList++); @@ -957,11 +972,11 @@ void render(void) { func_80066520(); } if (D_800DD3F0 == 2) { - phi_v0_2 = 320 * 240 * 2; + framebufferSize = SCREEN_WIDTH * SCREEN_HEIGHT * 2; if (osTvType == TV_TYPE_PAL) { - phi_v0_2 = (s32)((320 * 240 * 2) * 1.1); + framebufferSize = (s32)((SCREEN_WIDTH * SCREEN_HEIGHT * 2) * 1.1f); } - func_80070B04(gVideoLastFramebuffer, gVideoCurrFramebuffer, gVideoCurrFramebuffer + phi_v0_2); + func_80070B04(gVideoLastFramebuffer, gVideoCurrFramebuffer, gVideoCurrFramebuffer + framebufferSize); } // tempLogicUpdateRate will be set to a value 2 or higher, based on the framerate. // the mul factor is hardcapped at 6, which happens at 10FPS. The mul factor @@ -1773,6 +1788,9 @@ s8 func_8006EAB0(void) { return D_80123516; } +/** + * Sets and returns (nonzero) the message set when pressing the reset button. + */ s32 is_reset_pressed(void) { if (D_80123560[0] == 0) { D_80123560[0] = (s32)((osRecvMesg(&gNMIMesgQueue, NULL, OS_MESG_NOBLOCK) + 1) != 0); @@ -1849,9 +1867,9 @@ GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006ECFC.s") s32 func_8006EFB8(void) { //Could be SP_DMEM_START / CACHERR_EE / SR_FR / M_K0 / LEO_STATUS_BUFFER_MANAGER_INTERRUPT if (IO_READ(SP_DMEM_START) != -1) { - return 0; + return FALSE; } - return 1; + return TRUE; } #ifdef NON_MATCHING @@ -1974,7 +1992,11 @@ void func_8006F42C(void) { D_800DD3F0 = 2; } -void func_8006F43C(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; @@ -1984,17 +2006,21 @@ void func_8006F43C(void) { if (buttonInputs & START_BUTTON) { gShowControllerPakMenu = TRUE; } - D_80123520++; - if (D_80123520 >= 8) { + sBootDelayTimer++; + if (sBootDelayTimer >= 8) { load_menu_with_level_background(MENU_BOOT, 0x27, 2); } } -s32 func_8006F4C8(void) { - if (D_800DD384 == -1) { - return 1; +/** + * Returns TRUE if the game doesn't detect any controllers. + */ + +s32 is_controller_missing(void) { + if (sControllerStatus == CONTROLLER_MISSING) { + return TRUE; } else { - return 0; + return FALSE; } } diff --git a/src/unknown_06B2B0.h b/src/unknown_06B2B0.h index 87e64eea..c59f919b 100644 --- a/src/unknown_06B2B0.h +++ b/src/unknown_06B2B0.h @@ -72,7 +72,7 @@ extern s8 D_800DD374; extern s32 D_800DD378; extern s32 D_800DD37C; extern s32 D_800DD380; -extern s32 D_800DD384; +extern s32 sControllerStatus; extern s32 D_800DD388; extern s8 D_800DD38C; extern s8 D_800DD390; @@ -130,8 +130,8 @@ void func_8006C2E4(void); s16 func_8006C2F0(void); s32 func_8006C300(void); void thread3_main(s32 arg0); -void func_8006C3E0(void); -void render(void); +void init_game(void); +void main_game_loop(void); void func_8006CAE4(s32 arg0, s32 arg1, s32 arg2); void load_level_2(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId); void func_8006CC14(void); @@ -181,8 +181,8 @@ void func_8006F338(s32 arg0); void func_8006F388(u8 arg0); void func_8006F398(void); void func_8006F42C(void); -void func_8006F43C(void); -s32 func_8006F4C8(void); +void pre_intro_loop(void); +s32 is_controller_missing(void); s32 func_8006F4EC(void); //Non Matching diff --git a/src/video.c b/src/video.c index 1ffdc79e..77287961 100644 --- a/src/video.c +++ b/src/video.c @@ -52,6 +52,11 @@ s32 D_8012630C; OSScClient D_80126310; /******************************/ + +/** + * Set up the framebuffers and the VI. + * Framebuffers are allocated at runtime. + */ void init_video(s32 videoModeIndex, OSSched *sc) { if (osTvType == TV_TYPE_PAL) { gVideoRefreshRate = REFRESH_50HZ; @@ -91,25 +96,43 @@ void init_video(s32 videoModeIndex, OSSched *sc) { D_801262E4 = 3; } +/** + * Set the current video mode to the id specified. + */ void set_video_mode_index(s32 videoModeIndex) { gVideoModeIndex = videoModeIndex; } -/* Unused? */ -s32 get_video_mode_index(void) { +/** + * Unused function that would return the current video mode index. + */ +UNUSED s32 get_video_mode_index(void) { return gVideoModeIndex; } -/* Unused? */ -void set_video_width_and_height_from_index(s32 fbIndex) { +/** + * Unused function that would change the framebuffer dimensions. + * Since only one kind of video mode is ever used, this function is never called. + */ +UNUSED void set_video_width_and_height_from_index(s32 fbIndex) { gVideoFbWidths[fbIndex] = gVideoModeResolutions[gVideoModeIndex & 7].width; gVideoFbHeights[fbIndex] = gVideoModeResolutions[gVideoModeIndex & 7].height; } +/** + * Return the current framebuffer dimenions as a single s32 value. + * The high 16 bits are the height of the frame, and the low 16 bits are the width. + */ s32 get_video_width_and_height_as_s32(void) { return (gVideoFbHeights[gVideoCurrFbIndex] << 16) | gVideoFbWidths[gVideoCurrFbIndex]; } +/** + * Initialise the VI settings. + * It first checks the TV type ad then will set the properties of the VI + * depending on the gVideoModeIndex value. + * Most of these go unused, as the value is always 1. + */ void init_vi_settings(void) { s32 viModeTableIndex; OSViMode *tvViMode; @@ -201,6 +224,10 @@ void init_vi_settings(void) { osViSetSpecialFeatures(OS_VI_GAMMA_OFF); } +/** + * Allocate the selected framebuffer index from the main pool. + * Will also allocate the depthbuffer if it does not already exist. + */ void init_framebuffer(s32 index) { if (gVideoFramebuffers[index] != 0) { func_80071538((u8 *)gVideoFramebuffers[index]); @@ -286,6 +313,10 @@ s32 func_8007AB34(void) { return (s32)((f32)gVideoRefreshRate / (f32)D_80126309); } +/** + * Flips the current framebuffer index, swapping to the other framebuffer + * for the next frame, then update the current and previous framebuffer pointers. + */ void swap_framebuffers(void) { gVideoLastFramebuffer = gVideoFramebuffers[gVideoCurrFbIndex]; gVideoLastDepthBuffer = gVideoDepthBuffer; @@ -294,6 +325,9 @@ void swap_framebuffers(void) { gVideoCurrDepthBuffer = gVideoDepthBuffer; } +/** + * Copy byte-by-byte a region from one address to another. + */ void memory_copy(u8 *src, u8 *dest, s32 len) { s32 i; diff --git a/src/video.h b/src/video.h index c8e47d98..3c3972b1 100644 --- a/src/video.h +++ b/src/video.h @@ -67,8 +67,8 @@ extern s32 D_800DE7BC; void init_video(s32 videoModeIndex, OSSched *sc); void set_video_mode_index(s32 videoModeIndex); -s32 get_video_mode_index(void); -void set_video_width_and_height_from_index(s32 fbIndex); +UNUSED s32 get_video_mode_index(void); +UNUSED void set_video_width_and_height_from_index(s32 fbIndex); s32 get_video_width_and_height_as_s32(void); void init_vi_settings(void); void init_framebuffer(s32 index); @@ -76,9 +76,9 @@ void func_8007A974(void); void func_8007AB24(s8 arg0); s32 func_8007AB34(void); void swap_framebuffers(void); +void memory_copy(u8 *src, u8 *dest, s32 len); //Non Matching -void memory_copy(u8 *src, u8 *dest, s32 len); s32 func_8007A98C(s32 arg0); #endif