From 3f221d6f252e673aa24c313c46501832c790c716 Mon Sep 17 00:00:00 2001 From: AloXado320 <38191089+AloXado320@users.noreply.github.com> Date: Sun, 17 Sep 2023 17:39:25 -0500 Subject: [PATCH] Label mtx variables in GfxPool (#424) --- asm/bss_8001C4D0.s | 4 +- .../code_80057C60/func_80065AB0.s | 4 +- .../code_80057C60/func_80065F0C.s | 4 +- .../code_80057C60/func_80066714.s | 4 +- .../code_80057C60/func_80066BAC.s | 4 +- .../code_80057C60/func_80067604.s | 4 +- .../code_80057C60/func_80067964.s | 4 +- .../code_80057C60/func_80068310.s | 4 +- .../code_80057C60/func_80068724.s | 4 +- .../code_80057C60/func_80068AA4.s | 4 +- .../code_80057C60/func_80068DA0.s | 4 +- .../code_80057C60/func_800691B8.s | 4 +- .../code_80057C60/func_80069444.s | 4 +- .../code_80057C60/func_800696CC.s | 4 +- .../code_80057C60/func_80069938.s | 4 +- .../code_80057C60/func_80069DB8.s | 4 +- .../code_80057C60/func_8006A280.s | 4 +- .../code_80057C60/func_8006AFD0.s | 12 +- .../code_80057C60/func_8006C294.s | 4 +- .../code_80057C60/render_balloon.s | 12 +- .../code_80091750/func_80095BD0.s | 8 +- .../code_80091750/func_800A54EC.s | 8 +- .../code_80091750/func_800A66A8.s | 8 +- .../hud_renderer/func_80052590.s | 8 +- .../hud_renderer/func_800528EC.s | 4 +- .../hud_renderer/func_80053870.s | 4 +- include/variables.h | 6 +- src/actors.c | 7 +- src/actors.h | 2 +- src/code_80004740.c | 5 +- src/code_8001F980.c | 34 ++--- src/code_80057C60.c | 106 ++++++++-------- src/code_80057C60.h | 2 +- src/code_80091750.c | 90 +++++++------- src/code_80091750.h | 2 +- src/code_80280000.c | 14 +-- src/code_80280000.h | 4 +- src/code_80281C40.c | 8 +- src/gbiMacro.c | 3 +- src/hud_renderer.c | 50 ++++---- src/main.c | 9 +- src/main.h | 45 ++++++- src/math_util.c | 16 +-- src/math_util_2.c | 74 +++++------ src/math_util_2.h | 2 +- src/player_controller.c | 6 +- src/player_controller.h | 2 +- src/podium_ceremony_actors.c | 8 +- src/podium_ceremony_actors.h | 2 +- src/render_courses.c | 16 +-- src/skybox_and_splitscreen.c | 116 +++++++++--------- 51 files changed, 390 insertions(+), 375 deletions(-) diff --git a/asm/bss_8001C4D0.s b/asm/bss_8001C4D0.s index bb1863eb2..03d7fc73b 100644 --- a/asm/bss_8001C4D0.s +++ b/asm/bss_8001C4D0.s @@ -64,7 +64,7 @@ glabel D_80164AC0 glabel D_80164AD0 .skip 32 -glabel D_80164AF0 +glabel gMatrixEffectCount .skip 20 glabel D_80164B04 @@ -1171,7 +1171,7 @@ glabel D_8018D110 glabel D_8018D114 .skip 12 -glabel D_8018D120 +glabel gMatrixHudCount .skip 32 glabel D_8018D140 diff --git a/asm/non_matchings/code_80057C60/func_80065AB0.s b/asm/non_matchings/code_80057C60/func_80065AB0.s index ecccf9a62..56fdf79e1 100644 --- a/asm/non_matchings/code_80057C60/func_80065AB0.s +++ b/asm/non_matchings/code_80057C60/func_80065AB0.s @@ -278,8 +278,8 @@ glabel func_80065AB0 /* 066ADC 80065EDC AC590000 */ sw $t9, ($v0) /* 066AE0 80065EE0 AC4F0004 */ sw $t7, 4($v0) .L80065EE4: -/* 066AE4 80065EE4 3C028016 */ lui $v0, %hi(D_80164AF0) # $v0, 0x8016 -/* 066AE8 80065EE8 24424AF0 */ addiu $v0, %lo(D_80164AF0) # addiu $v0, $v0, 0x4af0 +/* 066AE4 80065EE4 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 +/* 066AE8 80065EE8 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 /* 066AEC 80065EEC 844E0000 */ lh $t6, ($v0) /* 066AF0 80065EF0 25D80001 */ addiu $t8, $t6, 1 /* 066AF4 80065EF4 A4580000 */ sh $t8, ($v0) diff --git a/asm/non_matchings/code_80057C60/func_80065F0C.s b/asm/non_matchings/code_80057C60/func_80065F0C.s index 863df9c4f..693fcd3ba 100644 --- a/asm/non_matchings/code_80057C60/func_80065F0C.s +++ b/asm/non_matchings/code_80057C60/func_80065F0C.s @@ -363,8 +363,8 @@ glabel func_80065F0C /* 0670A8 800664A8 AE180000 */ sw $t8, ($s0) /* 0670AC 800664AC AE190004 */ sw $t9, 4($s0) .L800664B0: -/* 0670B0 800664B0 3C028016 */ lui $v0, %hi(D_80164AF0) # $v0, 0x8016 -/* 0670B4 800664B4 24424AF0 */ addiu $v0, %lo(D_80164AF0) # addiu $v0, $v0, 0x4af0 +/* 0670B0 800664B0 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 +/* 0670B4 800664B4 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 /* 0670B8 800664B8 844E0000 */ lh $t6, ($v0) /* 0670BC 800664BC 25CF0001 */ addiu $t7, $t6, 1 /* 0670C0 800664C0 A44F0000 */ sh $t7, ($v0) diff --git a/asm/non_matchings/code_80057C60/func_80066714.s b/asm/non_matchings/code_80057C60/func_80066714.s index 5c4af5f0e..fa833b678 100644 --- a/asm/non_matchings/code_80057C60/func_80066714.s +++ b/asm/non_matchings/code_80057C60/func_80066714.s @@ -145,12 +145,12 @@ glabel func_80066714 /* 067550 80066950 AC590000 */ sw $t9, ($v0) /* 067554 80066954 8C620000 */ lw $v0, ($v1) /* 067558 80066958 3C190D01 */ lui $t9, %hi(D_0D008DA0) # $t9, 0xd01 -/* 06755C 8006695C 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06755C 8006695C 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 067560 80066960 244F0008 */ addiu $t7, $v0, 8 /* 067564 80066964 AC6F0000 */ sw $t7, ($v1) /* 067568 80066968 27398DA0 */ addiu $t9, %lo(D_0D008DA0) # addiu $t9, $t9, -0x7260 /* 06756C 8006696C 3C180600 */ lui $t8, 0x600 -/* 067570 80066970 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 067570 80066970 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 067574 80066974 AC580000 */ sw $t8, ($v0) /* 067578 80066978 AC590004 */ sw $t9, 4($v0) /* 06757C 8006697C 84EE0000 */ lh $t6, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_80066BAC.s b/asm/non_matchings/code_80057C60/func_80066BAC.s index 10dbb6607..603553e69 100644 --- a/asm/non_matchings/code_80057C60/func_80066BAC.s +++ b/asm/non_matchings/code_80057C60/func_80066BAC.s @@ -431,8 +431,8 @@ glabel func_80066BAC /* 067E50 80067250 AC4E0004 */ sw $t6, 4($v0) /* 067E54 80067254 AC500000 */ sw $s0, ($v0) .L80067258: -/* 067E58 80067258 3C028016 */ lui $v0, %hi(D_80164AF0) # $v0, 0x8016 -/* 067E5C 8006725C 24424AF0 */ addiu $v0, %lo(D_80164AF0) # addiu $v0, $v0, 0x4af0 +/* 067E58 80067258 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 +/* 067E5C 8006725C 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 /* 067E60 80067260 844F0000 */ lh $t7, ($v0) /* 067E64 80067264 25F80001 */ addiu $t8, $t7, 1 /* 067E68 80067268 A4580000 */ sh $t8, ($v0) diff --git a/asm/non_matchings/code_80057C60/func_80067604.s b/asm/non_matchings/code_80057C60/func_80067604.s index f6570ba7e..a23f8a134 100644 --- a/asm/non_matchings/code_80057C60/func_80067604.s +++ b/asm/non_matchings/code_80057C60/func_80067604.s @@ -208,8 +208,8 @@ glabel func_80067604 /* 068538 80067938 AC590000 */ sw $t9, ($v0) /* 06853C 8006793C AC4F0004 */ sw $t7, 4($v0) .L80067940: -/* 068540 80067940 3C028016 */ lui $v0, %hi(D_80164AF0) # $v0, 0x8016 -/* 068544 80067944 24424AF0 */ addiu $v0, %lo(D_80164AF0) # addiu $v0, $v0, 0x4af0 +/* 068540 80067940 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 +/* 068544 80067944 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 /* 068548 80067948 844E0000 */ lh $t6, ($v0) /* 06854C 8006794C 25D80001 */ addiu $t8, $t6, 1 /* 068550 80067950 A4580000 */ sh $t8, ($v0) diff --git a/asm/non_matchings/code_80057C60/func_80067964.s b/asm/non_matchings/code_80057C60/func_80067964.s index a68d1b353..27ef32aaf 100644 --- a/asm/non_matchings/code_80057C60/func_80067964.s +++ b/asm/non_matchings/code_80057C60/func_80067964.s @@ -110,7 +110,7 @@ glabel func_80067964 /* 068714 80067B14 AC4F0004 */ sw $t7, 4($v0) /* 068718 80067B18 8C620000 */ lw $v0, ($v1) /* 06871C 80067B1C 3C19F550 */ lui $t9, 0xf550 -/* 068720 80067B20 3C0B8016 */ lui $t3, %hi(D_80164AF0) # $t3, 0x8016 +/* 068720 80067B20 3C0B8016 */ lui $t3, %hi(gMatrixEffectCount) # $t3, 0x8016 /* 068724 80067B24 24580008 */ addiu $t8, $v0, 8 /* 068728 80067B28 AC780000 */ sw $t8, ($v1) /* 06872C 80067B2C AC4E0004 */ sw $t6, 4($v0) @@ -180,7 +180,7 @@ glabel func_80067964 /* 06882C 80067C2C AC4F0004 */ sw $t7, 4($v0) /* 068830 80067C30 8C620000 */ lw $v0, ($v1) /* 068834 80067C34 3C19F550 */ lui $t9, 0xf550 -/* 068838 80067C38 256B4AF0 */ addiu $t3, %lo(D_80164AF0) # addiu $t3, $t3, 0x4af0 +/* 068838 80067C38 256B4AF0 */ addiu $t3, %lo(gMatrixEffectCount) # addiu $t3, $t3, 0x4af0 /* 06883C 80067C3C 24580008 */ addiu $t8, $v0, 8 /* 068840 80067C40 AC780000 */ sw $t8, ($v1) /* 068844 80067C44 AC4E0004 */ sw $t6, 4($v0) diff --git a/asm/non_matchings/code_80057C60/func_80068310.s b/asm/non_matchings/code_80057C60/func_80068310.s index 54abe9db4..0802bfbbe 100644 --- a/asm/non_matchings/code_80057C60/func_80068310.s +++ b/asm/non_matchings/code_80057C60/func_80068310.s @@ -126,7 +126,7 @@ glabel func_80068310 /* 069100 80068500 AC580004 */ sw $t8, 4($v0) /* 069104 80068504 8C620000 */ lw $v0, ($v1) /* 069108 80068508 3C0EF550 */ lui $t6, 0xf550 -/* 06910C 8006850C 3C0A8016 */ lui $t2, %hi(D_80164AF0) # $t2, 0x8016 +/* 06910C 8006850C 3C0A8016 */ lui $t2, %hi(gMatrixEffectCount) # $t2, 0x8016 /* 069110 80068510 24590008 */ addiu $t9, $v0, 8 /* 069114 80068514 AC790000 */ sw $t9, ($v1) /* 069118 80068518 AC4F0004 */ sw $t7, 4($v0) @@ -140,7 +140,7 @@ glabel func_80068310 /* 069138 80068538 AC500000 */ sw $s0, ($v0) /* 06913C 8006853C 8C620000 */ lw $v0, ($v1) /* 069140 80068540 3C0EF300 */ lui $t6, 0xf300 -/* 069144 80068544 254A4AF0 */ addiu $t2, %lo(D_80164AF0) # addiu $t2, $t2, 0x4af0 +/* 069144 80068544 254A4AF0 */ addiu $t2, %lo(gMatrixEffectCount) # addiu $t2, $t2, 0x4af0 /* 069148 80068548 24590008 */ addiu $t9, $v0, 8 /* 06914C 8006854C AC790000 */ sw $t9, ($v1) /* 069150 80068550 AC4F0004 */ sw $t7, 4($v0) diff --git a/asm/non_matchings/code_80057C60/func_80068724.s b/asm/non_matchings/code_80057C60/func_80068724.s index 1dafc05ef..1cc32a599 100644 --- a/asm/non_matchings/code_80057C60/func_80068724.s +++ b/asm/non_matchings/code_80057C60/func_80068724.s @@ -160,8 +160,8 @@ glabel func_80068724 /* 06959C 8006899C 3C19F570 */ lui $t9, 0xf570 /* 0695A0 800689A0 AC4F0004 */ sw $t7, 4($v0) /* 0695A4 800689A4 8C620000 */ lw $v0, ($v1) -/* 0695A8 800689A8 3C058016 */ lui $a1, %hi(D_80164AF0) # $a1, 0x8016 -/* 0695AC 800689AC 24A54AF0 */ addiu $a1, %lo(D_80164AF0) # addiu $a1, $a1, 0x4af0 +/* 0695A8 800689A8 3C058016 */ lui $a1, %hi(gMatrixEffectCount) # $a1, 0x8016 +/* 0695AC 800689AC 24A54AF0 */ addiu $a1, %lo(gMatrixEffectCount) # addiu $a1, $a1, 0x4af0 /* 0695B0 800689B0 24580008 */ addiu $t8, $v0, 8 /* 0695B4 800689B4 AC780000 */ sw $t8, ($v1) /* 0695B8 800689B8 AC4E0004 */ sw $t6, 4($v0) diff --git a/asm/non_matchings/code_80057C60/func_80068AA4.s b/asm/non_matchings/code_80057C60/func_80068AA4.s index 83b2be961..2a7542f4d 100644 --- a/asm/non_matchings/code_80057C60/func_80068AA4.s +++ b/asm/non_matchings/code_80057C60/func_80068AA4.s @@ -174,12 +174,12 @@ glabel func_80068AA4 /* 069954 80068D54 AC590000 */ sw $t9, ($v0) /* 069958 80068D58 8C620000 */ lw $v0, ($v1) /* 06995C 80068D5C 3C190D01 */ lui $t9, %hi(D_0D008DA0) # $t9, 0xd01 -/* 069960 80068D60 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 069960 80068D60 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 069964 80068D64 24580008 */ addiu $t8, $v0, 8 /* 069968 80068D68 AC780000 */ sw $t8, ($v1) /* 06996C 80068D6C 27398DA0 */ addiu $t9, %lo(D_0D008DA0) # addiu $t9, $t9, -0x7260 /* 069970 80068D70 3C0F0600 */ lui $t7, 0x600 -/* 069974 80068D74 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 069974 80068D74 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 069978 80068D78 AC4F0000 */ sw $t7, ($v0) /* 06997C 80068D7C AC590004 */ sw $t9, 4($v0) /* 069980 80068D80 84EE0000 */ lh $t6, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_80068DA0.s b/asm/non_matchings/code_80057C60/func_80068DA0.s index 24aa7c03b..7dcf6bb0b 100644 --- a/asm/non_matchings/code_80057C60/func_80068DA0.s +++ b/asm/non_matchings/code_80057C60/func_80068DA0.s @@ -129,11 +129,11 @@ glabel func_80068DA0 /* 069B9C 80068F9C AC4E0000 */ sw $t6, ($v0) /* 069BA0 80068FA0 8DEFD4A4 */ lw $t7, %lo(D_8018D4A4)($t7) /* 069BA4 80068FA4 3C19F550 */ lui $t9, 0xf550 -/* 069BA8 80068FA8 3C0A8016 */ lui $t2, %hi(D_80164AF0) # $t2, 0x8016 +/* 069BA8 80068FA8 3C0A8016 */ lui $t2, %hi(gMatrixEffectCount) # $t2, 0x8016 /* 069BAC 80068FAC AC4F0004 */ sw $t7, 4($v0) /* 069BB0 80068FB0 8C620000 */ lw $v0, ($v1) /* 069BB4 80068FB4 3C0FE600 */ lui $t7, 0xe600 -/* 069BB8 80068FB8 254A4AF0 */ addiu $t2, %lo(D_80164AF0) # addiu $t2, $t2, 0x4af0 +/* 069BB8 80068FB8 254A4AF0 */ addiu $t2, %lo(gMatrixEffectCount) # addiu $t2, $t2, 0x4af0 /* 069BBC 80068FBC 24580008 */ addiu $t8, $v0, 8 /* 069BC0 80068FC0 AC780000 */ sw $t8, ($v1) /* 069BC4 80068FC4 AC500004 */ sw $s0, 4($v0) diff --git a/asm/non_matchings/code_80057C60/func_800691B8.s b/asm/non_matchings/code_80057C60/func_800691B8.s index b07ce0ec4..6d333c6e9 100644 --- a/asm/non_matchings/code_80057C60/func_800691B8.s +++ b/asm/non_matchings/code_80057C60/func_800691B8.s @@ -147,12 +147,12 @@ glabel func_800691B8 /* 069FFC 800693FC AC580000 */ sw $t8, ($v0) /* 06A000 80069400 8C620000 */ lw $v0, ($v1) /* 06A004 80069404 3C180D01 */ lui $t8, %hi(D_0D008DA0) # $t8, 0xd01 -/* 06A008 80069408 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06A008 80069408 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 06A00C 8006940C 244E0008 */ addiu $t6, $v0, 8 /* 06A010 80069410 AC6E0000 */ sw $t6, ($v1) /* 06A014 80069414 27188DA0 */ addiu $t8, %lo(D_0D008DA0) # addiu $t8, $t8, -0x7260 /* 06A018 80069418 3C0F0600 */ lui $t7, 0x600 -/* 06A01C 8006941C 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 06A01C 8006941C 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 06A020 80069420 AC4F0000 */ sw $t7, ($v0) /* 06A024 80069424 AC580004 */ sw $t8, 4($v0) /* 06A028 80069428 84F90000 */ lh $t9, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_80069444.s b/asm/non_matchings/code_80057C60/func_80069444.s index 2bf188289..eed19554f 100644 --- a/asm/non_matchings/code_80057C60/func_80069444.s +++ b/asm/non_matchings/code_80057C60/func_80069444.s @@ -146,12 +146,12 @@ glabel func_80069444 /* 06A284 80069684 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 /* 06A288 80069688 8C620000 */ lw $v0, ($v1) /* 06A28C 8006968C 3C190D01 */ lui $t9, %hi(D_0D008E48) # $t9, 0xd01 -/* 06A290 80069690 3C058016 */ lui $a1, %hi(D_80164AF0) # $a1, 0x8016 +/* 06A290 80069690 3C058016 */ lui $a1, %hi(gMatrixEffectCount) # $a1, 0x8016 /* 06A294 80069694 24580008 */ addiu $t8, $v0, 8 /* 06A298 80069698 AC780000 */ sw $t8, ($v1) /* 06A29C 8006969C 27398E48 */ addiu $t9, %lo(D_0D008E48) # addiu $t9, $t9, -0x71b8 /* 06A2A0 800696A0 3C0E0600 */ lui $t6, 0x600 -/* 06A2A4 800696A4 24A54AF0 */ addiu $a1, %lo(D_80164AF0) # addiu $a1, $a1, 0x4af0 +/* 06A2A4 800696A4 24A54AF0 */ addiu $a1, %lo(gMatrixEffectCount) # addiu $a1, $a1, 0x4af0 /* 06A2A8 800696A8 AC4E0000 */ sw $t6, ($v0) /* 06A2AC 800696AC AC590004 */ sw $t9, 4($v0) /* 06A2B0 800696B0 84AF0000 */ lh $t7, ($a1) diff --git a/asm/non_matchings/code_80057C60/func_800696CC.s b/asm/non_matchings/code_80057C60/func_800696CC.s index 86ef1ce57..b143dc6d8 100644 --- a/asm/non_matchings/code_80057C60/func_800696CC.s +++ b/asm/non_matchings/code_80057C60/func_800696CC.s @@ -139,12 +139,12 @@ glabel func_800696CC /* 06A4F0 800698F0 AC590000 */ sw $t9, ($v0) /* 06A4F4 800698F4 8C620000 */ lw $v0, ($v1) /* 06A4F8 800698F8 3C190D01 */ lui $t9, %hi(D_0D008DA0) # $t9, 0xd01 -/* 06A4FC 800698FC 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06A4FC 800698FC 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 06A500 80069900 244F0008 */ addiu $t7, $v0, 8 /* 06A504 80069904 AC6F0000 */ sw $t7, ($v1) /* 06A508 80069908 27398DA0 */ addiu $t9, %lo(D_0D008DA0) # addiu $t9, $t9, -0x7260 /* 06A50C 8006990C 3C180600 */ lui $t8, 0x600 -/* 06A510 80069910 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 06A510 80069910 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 06A514 80069914 AC580000 */ sw $t8, ($v0) /* 06A518 80069918 AC590004 */ sw $t9, 4($v0) /* 06A51C 8006991C 84EE0000 */ lh $t6, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_80069938.s b/asm/non_matchings/code_80057C60/func_80069938.s index c7b0a3a2c..dea7bc8f9 100644 --- a/asm/non_matchings/code_80057C60/func_80069938.s +++ b/asm/non_matchings/code_80057C60/func_80069938.s @@ -140,12 +140,12 @@ glabel func_80069938 /* 06A760 80069B60 AC4F0000 */ sw $t7, ($v0) /* 06A764 80069B64 8C620000 */ lw $v0, ($v1) /* 06A768 80069B68 3C0F0D01 */ lui $t7, %hi(D_0D008DA0) # $t7, 0xd01 -/* 06A76C 80069B6C 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06A76C 80069B6C 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 06A770 80069B70 24580008 */ addiu $t8, $v0, 8 /* 06A774 80069B74 AC780000 */ sw $t8, ($v1) /* 06A778 80069B78 25EF8DA0 */ addiu $t7, %lo(D_0D008DA0) # addiu $t7, $t7, -0x7260 /* 06A77C 80069B7C 3C190600 */ lui $t9, 0x600 -/* 06A780 80069B80 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 06A780 80069B80 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 06A784 80069B84 AC590000 */ sw $t9, ($v0) /* 06A788 80069B88 AC4F0004 */ sw $t7, 4($v0) /* 06A78C 80069B8C 84EE0000 */ lh $t6, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_80069DB8.s b/asm/non_matchings/code_80057C60/func_80069DB8.s index 71fe1e5f3..52d742348 100644 --- a/asm/non_matchings/code_80057C60/func_80069DB8.s +++ b/asm/non_matchings/code_80057C60/func_80069DB8.s @@ -137,12 +137,12 @@ glabel func_80069DB8 /* 06ABD4 80069FD4 AC580000 */ sw $t8, ($v0) /* 06ABD8 80069FD8 8C620000 */ lw $v0, ($v1) /* 06ABDC 80069FDC 3C180D01 */ lui $t8, %hi(D_0D008DA0) # $t8, 0xd01 -/* 06ABE0 80069FE0 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06ABE0 80069FE0 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 06ABE4 80069FE4 24590008 */ addiu $t9, $v0, 8 /* 06ABE8 80069FE8 AC790000 */ sw $t9, ($v1) /* 06ABEC 80069FEC 27188DA0 */ addiu $t8, %lo(D_0D008DA0) # addiu $t8, $t8, -0x7260 /* 06ABF0 80069FF0 3C0F0600 */ lui $t7, 0x600 -/* 06ABF4 80069FF4 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 06ABF4 80069FF4 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 06ABF8 80069FF8 AC4F0000 */ sw $t7, ($v0) /* 06ABFC 80069FFC AC580004 */ sw $t8, 4($v0) /* 06AC00 8006A000 84EE0000 */ lh $t6, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_8006A280.s b/asm/non_matchings/code_80057C60/func_8006A280.s index 9c4bd2225..f0c0b3f59 100644 --- a/asm/non_matchings/code_80057C60/func_8006A280.s +++ b/asm/non_matchings/code_80057C60/func_8006A280.s @@ -147,12 +147,12 @@ glabel func_8006A280 /* 06B0C4 8006A4C4 AC4E0000 */ sw $t6, ($v0) /* 06B0C8 8006A4C8 8C620000 */ lw $v0, ($v1) /* 06B0CC 8006A4CC 3C0E0D01 */ lui $t6, %hi(D_0D008DA0) # $t6, 0xd01 -/* 06B0D0 8006A4D0 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06B0D0 8006A4D0 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 06B0D4 8006A4D4 244F0008 */ addiu $t7, $v0, 8 /* 06B0D8 8006A4D8 AC6F0000 */ sw $t7, ($v1) /* 06B0DC 8006A4DC 25CE8DA0 */ addiu $t6, %lo(D_0D008DA0) # addiu $t6, $t6, -0x7260 /* 06B0E0 8006A4E0 3C180600 */ lui $t8, 0x600 -/* 06B0E4 8006A4E4 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 06B0E4 8006A4E4 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 06B0E8 8006A4E8 AC580000 */ sw $t8, ($v0) /* 06B0EC 8006A4EC AC4E0004 */ sw $t6, 4($v0) /* 06B0F0 8006A4F0 84F90000 */ lh $t9, ($a3) diff --git a/asm/non_matchings/code_80057C60/func_8006AFD0.s b/asm/non_matchings/code_80057C60/func_8006AFD0.s index 2202db75e..3f16b5de9 100644 --- a/asm/non_matchings/code_80057C60/func_8006AFD0.s +++ b/asm/non_matchings/code_80057C60/func_8006AFD0.s @@ -286,8 +286,8 @@ glabel func_8006AFD0 /* 06BFA8 8006B3A8 4405A000 */ mfc1 $a1, $f20 /* 06BFAC 8006B3AC 0C0087E1 */ jal func_80021F84 /* 06BFB0 8006B3B0 02002025 */ move $a0, $s0 -/* 06BFB4 8006B3B4 3C198016 */ lui $t9, %hi(D_80164AF0) # $t9, 0x8016 -/* 06BFB8 8006B3B8 87394AF0 */ lh $t9, %lo(D_80164AF0)($t9) +/* 06BFB4 8006B3B4 3C198016 */ lui $t9, %hi(gMatrixEffectCount) # $t9, 0x8016 +/* 06BFB8 8006B3B8 87394AF0 */ lh $t9, %lo(gMatrixEffectCount)($t9) /* 06BFBC 8006B3BC 3C0F8015 */ lui $t7, %hi(gGfxPool) # $t7, 0x8015 /* 06BFC0 8006B3C0 8DEFEF40 */ lw $t7, %lo(gGfxPool)($t7) /* 06BFC4 8006B3C4 0019C180 */ sll $t8, $t9, 6 @@ -303,9 +303,9 @@ glabel func_8006AFD0 /* 06BFEC 8006B3EC 37390040 */ ori $t9, (0x01020040 & 0xFFFF) # ori $t9, $t9, 0x40 /* 06BFF0 8006B3F0 244E0008 */ addiu $t6, $v0, 8 /* 06BFF4 8006B3F4 AC6E0000 */ sw $t6, ($v1) -/* 06BFF8 8006B3F8 3C188016 */ lui $t8, %hi(D_80164AF0) # $t8, 0x8016 +/* 06BFF8 8006B3F8 3C188016 */ lui $t8, %hi(gMatrixEffectCount) # $t8, 0x8016 /* 06BFFC 8006B3FC AC590000 */ sw $t9, ($v0) -/* 06C000 8006B400 87184AF0 */ lh $t8, %lo(D_80164AF0)($t8) +/* 06C000 8006B400 87184AF0 */ lh $t8, %lo(gMatrixEffectCount)($t8) /* 06C004 8006B404 3C0F8015 */ lui $t7, %hi(gGfxPool) # $t7, 0x8015 /* 06C008 8006B408 8DEFEF40 */ lw $t7, %lo(gGfxPool)($t7) /* 06C00C 8006B40C 00187180 */ sll $t6, $t8, 6 @@ -544,8 +544,8 @@ glabel func_8006AFD0 /* 06C3B0 8006B7B0 AC6E0000 */ sw $t6, ($v1) /* 06C3B4 8006B7B4 AC580004 */ sw $t8, 4($v0) /* 06C3B8 8006B7B8 AC590000 */ sw $t9, ($v0) -/* 06C3BC 8006B7BC 3C028016 */ lui $v0, %hi(D_80164AF0) # $v0, 0x8016 -/* 06C3C0 8006B7C0 24424AF0 */ addiu $v0, %lo(D_80164AF0) # addiu $v0, $v0, 0x4af0 +/* 06C3BC 8006B7BC 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 +/* 06C3C0 8006B7C0 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 /* 06C3C4 8006B7C4 844F0000 */ lh $t7, ($v0) /* 06C3C8 8006B7C8 8FBF0034 */ lw $ra, 0x34($sp) /* 06C3CC 8006B7CC 8FB00030 */ lw $s0, 0x30($sp) diff --git a/asm/non_matchings/code_80057C60/func_8006C294.s b/asm/non_matchings/code_80057C60/func_8006C294.s index a753602ed..7134f77ea 100644 --- a/asm/non_matchings/code_80057C60/func_8006C294.s +++ b/asm/non_matchings/code_80057C60/func_8006C294.s @@ -130,12 +130,12 @@ glabel func_8006C294 /* 06D090 8006C490 AC4F0000 */ sw $t7, ($v0) /* 06D094 8006C494 8C620000 */ lw $v0, ($v1) /* 06D098 8006C498 3C0F0D01 */ lui $t7, %hi(D_0D008DA0) # $t7, 0xd01 -/* 06D09C 8006C49C 3C078016 */ lui $a3, %hi(D_80164AF0) # $a3, 0x8016 +/* 06D09C 8006C49C 3C078016 */ lui $a3, %hi(gMatrixEffectCount) # $a3, 0x8016 /* 06D0A0 8006C4A0 24580008 */ addiu $t8, $v0, 8 /* 06D0A4 8006C4A4 AC780000 */ sw $t8, ($v1) /* 06D0A8 8006C4A8 25EF8DA0 */ addiu $t7, %lo(D_0D008DA0) # addiu $t7, $t7, -0x7260 /* 06D0AC 8006C4AC 3C190600 */ lui $t9, 0x600 -/* 06D0B0 8006C4B0 24E74AF0 */ addiu $a3, %lo(D_80164AF0) # addiu $a3, $a3, 0x4af0 +/* 06D0B0 8006C4B0 24E74AF0 */ addiu $a3, %lo(gMatrixEffectCount) # addiu $a3, $a3, 0x4af0 /* 06D0B4 8006C4B4 AC590000 */ sw $t9, ($v0) /* 06D0B8 8006C4B8 AC4F0004 */ sw $t7, 4($v0) /* 06D0BC 8006C4BC 84EE0000 */ lh $t6, ($a3) diff --git a/asm/non_matchings/code_80057C60/render_balloon.s b/asm/non_matchings/code_80057C60/render_balloon.s index 779b840f2..812158f80 100644 --- a/asm/non_matchings/code_80057C60/render_balloon.s +++ b/asm/non_matchings/code_80057C60/render_balloon.s @@ -99,8 +99,8 @@ glabel render_balloon /* 06C888 8006BC88 27A40108 */ addiu $a0, $sp, 0x108 /* 06C88C 8006BC8C 0C0087E1 */ jal func_80021F84 /* 06C890 8006BC90 8FA5014C */ lw $a1, 0x14c($sp) -/* 06C894 8006BC94 3C198016 */ lui $t9, %hi(D_80164AF0) # $t9, 0x8016 -/* 06C898 8006BC98 87394AF0 */ lh $t9, %lo(D_80164AF0)($t9) +/* 06C894 8006BC94 3C198016 */ lui $t9, %hi(gMatrixEffectCount) # $t9, 0x8016 +/* 06C898 8006BC98 87394AF0 */ lh $t9, %lo(gMatrixEffectCount)($t9) /* 06C89C 8006BC9C 3C188015 */ lui $t8, %hi(gGfxPool) # $t8, 0x8015 /* 06C8A0 8006BCA0 8F18EF40 */ lw $t8, %lo(gGfxPool)($t8) /* 06C8A4 8006BCA4 00197180 */ sll $t6, $t9, 6 @@ -116,9 +116,9 @@ glabel render_balloon /* 06C8CC 8006BCCC 37390040 */ ori $t9, (0x01020040 & 0xFFFF) # ori $t9, $t9, 0x40 /* 06C8D0 8006BCD0 244F0008 */ addiu $t7, $v0, 8 /* 06C8D4 8006BCD4 AC6F0000 */ sw $t7, ($v1) -/* 06C8D8 8006BCD8 3C0E8016 */ lui $t6, %hi(D_80164AF0) # $t6, 0x8016 +/* 06C8D8 8006BCD8 3C0E8016 */ lui $t6, %hi(gMatrixEffectCount) # $t6, 0x8016 /* 06C8DC 8006BCDC AC590000 */ sw $t9, ($v0) -/* 06C8E0 8006BCE0 85CE4AF0 */ lh $t6, %lo(D_80164AF0)($t6) +/* 06C8E0 8006BCE0 85CE4AF0 */ lh $t6, %lo(gMatrixEffectCount)($t6) /* 06C8E4 8006BCE4 3C188015 */ lui $t8, %hi(gGfxPool) # $t8, 0x8015 /* 06C8E8 8006BCE8 8F18EF40 */ lw $t8, %lo(gGfxPool)($t8) /* 06C8EC 8006BCEC 000E7980 */ sll $t7, $t6, 6 @@ -360,8 +360,8 @@ glabel render_balloon /* 06CC9C 8006C09C AC6F0000 */ sw $t7, ($v1) /* 06CCA0 8006C0A0 AC4E0004 */ sw $t6, 4($v0) /* 06CCA4 8006C0A4 AC590000 */ sw $t9, ($v0) -/* 06CCA8 8006C0A8 3C028016 */ lui $v0, %hi(D_80164AF0) # $v0, 0x8016 -/* 06CCAC 8006C0AC 24424AF0 */ addiu $v0, %lo(D_80164AF0) # addiu $v0, $v0, 0x4af0 +/* 06CCA8 8006C0A8 3C028016 */ lui $v0, %hi(gMatrixEffectCount) # $v0, 0x8016 +/* 06CCAC 8006C0AC 24424AF0 */ addiu $v0, %lo(gMatrixEffectCount) # addiu $v0, $v0, 0x4af0 /* 06CCB0 8006C0B0 84580000 */ lh $t8, ($v0) /* 06CCB4 8006C0B4 8FBF0024 */ lw $ra, 0x24($sp) /* 06CCB8 8006C0B8 27BD0148 */ addiu $sp, $sp, 0x148 diff --git a/asm/non_matchings/code_80091750/func_80095BD0.s b/asm/non_matchings/code_80091750/func_80095BD0.s index e465edc3b..5d6ea6a6f 100644 --- a/asm/non_matchings/code_80091750/func_80095BD0.s +++ b/asm/non_matchings/code_80091750/func_80095BD0.s @@ -10,8 +10,8 @@ glabel D_800F0BEC .section .text glabel func_80095BD0 -/* 0967D0 80095BD0 3C098016 */ lui $t1, %hi(D_80164AF0) # $t1, 0x8016 -/* 0967D4 80095BD4 25294AF0 */ addiu $t1, %lo(D_80164AF0) # addiu $t1, $t1, 0x4af0 +/* 0967D0 80095BD0 3C098016 */ lui $t1, %hi(gMatrixEffectCount) # $t1, 0x8016 +/* 0967D4 80095BD4 25294AF0 */ addiu $t1, %lo(gMatrixEffectCount) # addiu $t1, $t1, 0x4af0 /* 0967D8 80095BD8 85220000 */ lh $v0, ($t1) /* 0967DC 80095BDC 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 0967E0 80095BE0 AFB00020 */ sw $s0, 0x20($sp) @@ -52,10 +52,10 @@ glabel func_80095BD0 /* 096860 80095C60 E7A40010 */ swc1 $f4, 0x10($sp) /* 096864 80095C64 3C0B0102 */ lui $t3, (0x01020040 >> 16) # lui $t3, 0x102 /* 096868 80095C68 8FA40040 */ lw $a0, 0x40($sp) -/* 09686C 80095C6C 3C098016 */ lui $t1, %hi(D_80164AF0) # $t1, 0x8016 +/* 09686C 80095C6C 3C098016 */ lui $t1, %hi(gMatrixEffectCount) # $t1, 0x8016 /* 096870 80095C70 356B0040 */ ori $t3, (0x01020040 & 0xFFFF) # ori $t3, $t3, 0x40 /* 096874 80095C74 02001025 */ move $v0, $s0 -/* 096878 80095C78 25294AF0 */ addiu $t1, %lo(D_80164AF0) # addiu $t1, $t1, 0x4af0 +/* 096878 80095C78 25294AF0 */ addiu $t1, %lo(gMatrixEffectCount) # addiu $t1, $t1, 0x4af0 /* 09687C 80095C7C AC4B0000 */ sw $t3, ($v0) /* 096880 80095C80 852D0000 */ lh $t5, ($t1) /* 096884 80095C84 3C0C8015 */ lui $t4, %hi(gGfxPool) # $t4, 0x8015 diff --git a/asm/non_matchings/code_80091750/func_800A54EC.s b/asm/non_matchings/code_80091750/func_800A54EC.s index 09e45c60b..c90a54f61 100644 --- a/asm/non_matchings/code_80091750/func_800A54EC.s +++ b/asm/non_matchings/code_80091750/func_800A54EC.s @@ -22,10 +22,10 @@ glabel func_800A54EC /* 0A613C 800A553C 3421FFFF */ ori $at, (0x1FFFFFFF & 0xFFFF) # ori $at, $at, 0xffff /* 0A6140 800A5540 27398880 */ addiu $t9, %lo(D_802B8880) # addiu $t9, $t9, -0x7780 /* 0A6144 800A5544 3C180380 */ lui $t8, (0x03800010 >> 16) # lui $t8, 0x380 -/* 0A6148 800A5548 3C098016 */ lui $t1, %hi(D_80164AF0) # $t1, 0x8016 +/* 0A6148 800A5548 3C098016 */ lui $t1, %hi(gMatrixEffectCount) # $t1, 0x8016 /* 0A614C 800A554C 37180010 */ ori $t8, (0x03800010 & 0xFFFF) # ori $t8, $t8, 0x10 /* 0A6150 800A5550 03216024 */ and $t4, $t9, $at -/* 0A6154 800A5554 25294AF0 */ addiu $t1, %lo(D_80164AF0) # addiu $t1, $t1, 0x4af0 +/* 0A6154 800A5554 25294AF0 */ addiu $t1, %lo(gMatrixEffectCount) # addiu $t1, $t1, 0x4af0 /* 0A6158 800A5558 AC6C0004 */ sw $t4, 4($v1) /* 0A615C 800A555C AC780000 */ sw $t8, ($v1) /* 0A6160 800A5560 852E0000 */ lh $t6, ($t1) @@ -59,10 +59,10 @@ glabel func_800A54EC /* 0A61D0 800A55D0 8FAA0040 */ lw $t2, 0x40($sp) /* 0A61D4 800A55D4 24780008 */ addiu $t8, $v1, 8 /* 0A61D8 800A55D8 8FA40048 */ lw $a0, 0x48($sp) -/* 0A61DC 800A55DC 3C098016 */ lui $t1, %hi(D_80164AF0) # $t1, 0x8016 +/* 0A61DC 800A55DC 3C098016 */ lui $t1, %hi(gMatrixEffectCount) # $t1, 0x8016 /* 0A61E0 800A55E0 AD180000 */ sw $t8, ($t0) /* 0A61E4 800A55E4 37390040 */ ori $t9, (0x01030040 & 0xFFFF) # ori $t9, $t9, 0x40 -/* 0A61E8 800A55E8 25294AF0 */ addiu $t1, %lo(D_80164AF0) # addiu $t1, $t1, 0x4af0 +/* 0A61E8 800A55E8 25294AF0 */ addiu $t1, %lo(gMatrixEffectCount) # addiu $t1, $t1, 0x4af0 /* 0A61EC 800A55EC AC790000 */ sw $t9, ($v1) /* 0A61F0 800A55F0 852E0000 */ lh $t6, ($t1) /* 0A61F4 800A55F4 3C0C8015 */ lui $t4, %hi(gGfxPool) # $t4, 0x8015 diff --git a/asm/non_matchings/code_80091750/func_800A66A8.s b/asm/non_matchings/code_80091750/func_800A66A8.s index 5d8179f97..5b70cb238 100644 --- a/asm/non_matchings/code_80091750/func_800A66A8.s +++ b/asm/non_matchings/code_80091750/func_800A66A8.s @@ -10,8 +10,8 @@ glabel D_800F1F20 glabel func_800A66A8 /* 0A72A8 800A66A8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0A72AC 800A66AC 3C0F8016 */ lui $t7, %hi(D_80164AF0) # $t7, 0x8016 -/* 0A72B0 800A66B0 85EF4AF0 */ lh $t7, %lo(D_80164AF0)($t7) +/* 0A72AC 800A66AC 3C0F8016 */ lui $t7, %hi(gMatrixEffectCount) # $t7, 0x8016 +/* 0A72B0 800A66B0 85EF4AF0 */ lh $t7, %lo(gMatrixEffectCount)($t7) /* 0A72B4 800A66B4 3C0E8015 */ lui $t6, %hi(gGfxPool) # $t6, 0x8015 /* 0A72B8 800A66B8 8DCEEF40 */ lw $t6, %lo(gGfxPool)($t6) /* 0A72BC 800A66BC AFB10028 */ sw $s1, 0x28($sp) @@ -146,11 +146,11 @@ glabel func_800A66A8 /* 0A74B8 800A68B8 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 /* 0A74BC 800A68BC 8C620000 */ lw $v0, ($v1) /* 0A74C0 800A68C0 3C0F0102 */ lui $t7, (0x01020040 >> 16) # lui $t7, 0x102 -/* 0A74C4 800A68C4 3C0A8016 */ lui $t2, %hi(D_80164AF0) # $t2, 0x8016 +/* 0A74C4 800A68C4 3C0A8016 */ lui $t2, %hi(gMatrixEffectCount) # $t2, 0x8016 /* 0A74C8 800A68C8 244D0008 */ addiu $t5, $v0, 8 /* 0A74CC 800A68CC AC6D0000 */ sw $t5, ($v1) /* 0A74D0 800A68D0 35EF0040 */ ori $t7, (0x01020040 & 0xFFFF) # ori $t7, $t7, 0x40 -/* 0A74D4 800A68D4 254A4AF0 */ addiu $t2, %lo(D_80164AF0) # addiu $t2, $t2, 0x4af0 +/* 0A74D4 800A68D4 254A4AF0 */ addiu $t2, %lo(gMatrixEffectCount) # addiu $t2, $t2, 0x4af0 /* 0A74D8 800A68D8 AC4F0000 */ sw $t7, ($v0) /* 0A74DC 800A68DC 85580000 */ lh $t8, ($t2) /* 0A74E0 800A68E0 3C0E8015 */ lui $t6, %hi(gGfxPool) # $t6, 0x8015 diff --git a/asm/non_matchings/hud_renderer/func_80052590.s b/asm/non_matchings/hud_renderer/func_80052590.s index ac7e21a3d..f05b3a1ef 100644 --- a/asm/non_matchings/hud_renderer/func_80052590.s +++ b/asm/non_matchings/hud_renderer/func_80052590.s @@ -49,10 +49,10 @@ glabel func_80052590 /* 05324C 8005264C 11600022 */ beqz $t3, .L800526D8 .L80052650: /* 053250 80052650 3C160D00 */ lui $s6, %hi(D_0D0062B0) # $s6, 0xd00 -/* 053254 80052654 3C158019 */ lui $s5, %hi(D_8018D120) # $s5, 0x8019 +/* 053254 80052654 3C158019 */ lui $s5, %hi(gMatrixHudCount) # $s5, 0x8019 /* 053258 80052658 3C138019 */ lui $s3, %hi(D_8018C490) # $s3, 0x8019 /* 05325C 8005265C 2673C490 */ addiu $s3, %lo(D_8018C490) # addiu $s3, $s3, -0x3b70 -/* 053260 80052660 26B5D120 */ addiu $s5, %lo(D_8018D120) # addiu $s5, $s5, -0x2ee0 +/* 053260 80052660 26B5D120 */ addiu $s5, %lo(gMatrixHudCount) # addiu $s5, $s5, -0x2ee0 /* 053264 80052664 26D662B0 */ addiu $s6, %lo(D_0D0062B0) # addiu $s6, $s6, 0x62b0 /* 053268 80052668 2414FFFF */ li $s4, -1 /* 05326C 8005266C 8E220000 */ lw $v0, ($s1) @@ -88,10 +88,10 @@ glabel func_80052590 .L800526D8: /* 0532D8 800526D8 3C0F8019 */ lui $t7, %hi(D_8018CFE8) # $t7, 0x8019 /* 0532DC 800526DC 85EFCFE8 */ lh $t7, %lo(D_8018CFE8)($t7) -/* 0532E0 800526E0 3C158019 */ lui $s5, %hi(D_8018D120) # $s5, 0x8019 +/* 0532E0 800526E0 3C158019 */ lui $s5, %hi(gMatrixHudCount) # $s5, 0x8019 /* 0532E4 800526E4 3C160D00 */ lui $s6, %hi(D_0D0062B0) # $s6, 0xd00 /* 0532E8 800526E8 26D662B0 */ addiu $s6, %lo(D_0D0062B0) # addiu $s6, $s6, 0x62b0 -/* 0532EC 800526EC 26B5D120 */ addiu $s5, %lo(D_8018D120) # addiu $s5, $s5, -0x2ee0 +/* 0532EC 800526EC 26B5D120 */ addiu $s5, %lo(gMatrixHudCount) # addiu $s5, $s5, -0x2ee0 /* 0532F0 800526F0 15E00004 */ bnez $t7, .L80052704 /* 0532F4 800526F4 2414FFFF */ li $s4, -1 /* 0532F8 800526F8 3C188019 */ lui $t8, %hi(D_8018D000) # $t8, 0x8019 diff --git a/asm/non_matchings/hud_renderer/func_800528EC.s b/asm/non_matchings/hud_renderer/func_800528EC.s index 7e025f1bb..f33dd546d 100644 --- a/asm/non_matchings/hud_renderer/func_800528EC.s +++ b/asm/non_matchings/hud_renderer/func_800528EC.s @@ -93,7 +93,7 @@ glabel func_800528EC /* 053658 80052A58 2673C3F0 */ addiu $s3, %lo(D_8018C3F0) # addiu $s3, $s3, -0x3c10 /* 05365C 80052A5C 29C10003 */ slti $at, $t6, 3 /* 053660 80052A60 1020002D */ beqz $at, .L80052B18 -/* 053664 80052A64 3C1E8019 */ lui $fp, %hi(D_8018D120) # 0x8019 +/* 053664 80052A64 3C1E8019 */ lui $fp, %hi(gMatrixHudCount) # 0x8019 /* 053668 80052A68 3C138019 */ lui $s3, %hi(D_8018C3F0) # $s3, 0x8019 /* 05366C 80052A6C 3C1E8019 */ lui $fp, %hi(D_8018C5F0) # $fp, 0x8019 /* 053670 80052A70 3C170400 */ lui $s7, (0x04000C2F >> 16) # lui $s7, 0x400 @@ -145,7 +145,7 @@ glabel func_800528EC /* 05371C 80052B1C 3C158016 */ lui $s5, %hi(D_80165C18) # $s5, 0x8016 /* 053720 80052B20 26B55C18 */ addiu $s5, %lo(D_80165C18) # addiu $s5, $s5, 0x5c18 /* 053724 80052B24 36F70C2F */ ori $s7, (0x04000C2F & 0xFFFF) # ori $s7, $s7, 0xc2f -/* 053728 80052B28 27DED120 */ addiu $fp, $fp, %lo(D_8018D120) # -0x2ee0 +/* 053728 80052B28 27DED120 */ addiu $fp, $fp, %lo(gMatrixHudCount) # -0x2ee0 /* 05372C 80052B2C 241600E0 */ li $s6, 224 /* 053730 80052B30 2414FFFF */ li $s4, -1 /* 053734 80052B34 8E620000 */ lw $v0, ($s3) diff --git a/asm/non_matchings/hud_renderer/func_80053870.s b/asm/non_matchings/hud_renderer/func_80053870.s index e0403bb63..3d3de2584 100644 --- a/asm/non_matchings/hud_renderer/func_80053870.s +++ b/asm/non_matchings/hud_renderer/func_80053870.s @@ -184,8 +184,8 @@ glabel func_80053870 /* 05472C 80053B2C 0C010F54 */ jal func_80043D50 /* 054730 80053B30 AC4D0004 */ sw $t5, 4($v0) /* 054734 80053B34 3C078019 */ lui $a3, %hi(D_8018C630) # $a3, 0x8019 -/* 054738 80053B38 3C168019 */ lui $s6, %hi(D_8018D120) # $s6, 0x8019 -/* 05473C 80053B3C 26D6D120 */ addiu $s6, %lo(D_8018D120) # addiu $s6, $s6, -0x2ee0 +/* 054738 80053B38 3C168019 */ lui $s6, %hi(gMatrixHudCount) # $s6, 0x8019 +/* 05473C 80053B3C 26D6D120 */ addiu $s6, %lo(gMatrixHudCount) # addiu $s6, $s6, -0x2ee0 /* 054740 80053B40 24E7C630 */ addiu $a3, %lo(D_8018C630) # addiu $a3, $a3, -0x39d0 /* 054744 80053B44 2415FFFF */ li $s5, -1 /* 054748 80053B48 24140003 */ li $s4, 3 diff --git a/include/variables.h b/include/variables.h index ad3a24831..793ae5f98 100644 --- a/include/variables.h +++ b/include/variables.h @@ -90,7 +90,7 @@ extern u16 gDemoMode; extern s32 D_800DC540; extern u16 gIsGamePaused; -extern u16 D_80150112; +extern u16 gMatrixObjectCount; extern u16 D_80162DD8; extern s32 D_80162DE0; @@ -99,7 +99,7 @@ extern s32 D_80162DE8; extern f32 D_80164510[]; extern s32 D_80164A28; -extern s16 D_80164AF0; +extern s16 gMatrixEffectCount; extern s16 D_80165020[]; extern s16 D_801650D0[4][8]; @@ -148,7 +148,7 @@ extern s8 D_801657E8; extern s8 D_801658FE; -extern s32 D_8018D120; +extern s32 gMatrixHudCount; extern s32 D_8018D900[]; extern s8 D_8018EDEC; diff --git a/src/actors.c b/src/actors.c index 3d5c009ee..23f1ab5d0 100644 --- a/src/actors.c +++ b/src/actors.c @@ -7,6 +7,7 @@ #include #include #include +#include "main.h" #include "math_util.h" #include "memory.h" #include "actors_extended.h" @@ -747,7 +748,7 @@ void func_802986B4(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) { arg1[3][0] = sp88[0]; arg1[3][1] = sp88[1]; arg1[3][2] = sp88[2]; - if ((D_80150112 < 0x80) && (func_802B4FF8(arg1, 0) != 0)) { + if ((gMatrixObjectCount < MTX_OBJECT_POOL_SIZE) && (func_802B4FF8(arg1, 0) != 0)) { switch (var_s1->someId) { case 0: gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow1); @@ -885,14 +886,14 @@ void func_80298D7C(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) { test = (s16)test; if (test == 6) { func_802B5F74(sp90, spD4, sp88); - if (!(D_80150112 < 0x80)) { break; } + if (!(gMatrixObjectCount < MTX_OBJECT_POOL_SIZE)) { break; } func_802B4FF8(sp90, 0); goto dummylabel; } else { arg1[3][0] = spD4[0]; arg1[3][1] = spD4[1]; arg1[3][2] = spD4[2]; - if (D_80150112 < 0x80) { + if (gMatrixObjectCount < MTX_OBJECT_POOL_SIZE) { func_802B4FF8(arg1, 0); dummylabel: gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); diff --git a/src/actors.h b/src/actors.h index 1c408c5fe..7a30d3cac 100644 --- a/src/actors.h +++ b/src/actors.h @@ -145,7 +145,7 @@ extern f32 D_80150130[]; extern u16 D_801637B8[]; extern Lights1 D_800DC610[]; -extern u16 D_80150112; +extern u16 gMatrixObjectCount; extern uintptr_t gSegmentTable[]; extern s16 gPlaceItemBoxes; diff --git a/src/code_80004740.c b/src/code_80004740.c index 38022c16b..a3fcaf384 100644 --- a/src/code_80004740.c +++ b/src/code_80004740.c @@ -94,10 +94,9 @@ void func_80004A1C(animation_type_1 *arg0, s16 *arg1, animation_type_3_triplet a } func_800048D8(sp4C, sp94, sp8C); - func_80004740(&gGfxPool->mtxPool[D_8018D120 + 11], sp4C); + func_80004740(&gGfxPool->mtxHud[gMatrixHudCount], sp4C); D_80162D7A += 1; - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&gGfxPool->mtxPool[D_8018D120 + 11]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_8018D120 += 1; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); if (some_segmented_dl != NULL) { some_dl = segmented_to_virtual(some_segmented_dl); gSPDisplayList(gDisplayListHead++, some_dl); diff --git a/src/code_8001F980.c b/src/code_8001F980.c index 195c53305..1ea615eb9 100644 --- a/src/code_8001F980.c +++ b/src/code_8001F980.c @@ -1246,9 +1246,9 @@ void func_80023C84(Player *player, s8 arg1, s8 arg2) { func_80021E10(sp118, spCC, spC4); func_80021F84(sp118, D_800DDBD4[player->characterId] * player->unk_224); } - func_80022180(&gGfxPool->mtxPool[arg1 + (arg2 << 3) + 0x3AB], sp118); + func_80022180(&gGfxPool->mtxShadow[arg1 + (arg2 * 8)], sp118); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 << 3) + 0x3AB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxShadow[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gDPLoadTextureBlock(gDisplayListHead++, D_8018D474, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR @@ -1295,8 +1295,8 @@ void func_80024374(Player *player, s8 arg1, s8 arg2) { func_80021E10(sp118, spCC, spC4); func_80021F84(sp118, D_800DDBD4[player->characterId] * player->unk_224); - func_80022180(&gGfxPool->mtxPool[arg1 + (arg2 << 3) + 0x3AB], sp118); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 << 3) + 0x3AB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxShadow[arg1 + (arg2 * 8)], sp118); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxShadow[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008D58); gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gDPLoadTextureBlock(gDisplayListHead++, D_8018D474, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, @@ -1382,17 +1382,17 @@ void func_800248D0(Player *player, s8 arg1, s8 arg2, s8 arg3) { } func_80021E10(sp1A4, sp154, sp14C); func_80021F84(sp1A4, D_800DDBD4[player->characterId] * player->unk_224); - func_80022180(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB], sp1A4); + func_80022180(&gGfxPool->mtxKart[arg1 + (arg2 * 8)], sp1A4); if ((player->unk_0BC & 0x80000000) == 0x80000000) { if (arg2 == arg1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008CD8); gDPLoadTLUT_pal256(gDisplayListHead++, D_80164B04); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614(D_80164B10[arg1], D_80164B20[arg1], D_80164B30[arg1], D_80164B40[arg1], D_80164B50[arg1], D_80164B60[arg1], (s32) player->unk_0C6); gDPSetRenderMode(gDisplayListHead++, AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008CD8); gDPLoadTLUT_pal256(gDisplayListHead++, D_80164B04); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); @@ -1400,7 +1400,7 @@ void func_800248D0(Player *player, s8 arg1, s8 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); } } else if (((player->unk_0CA & 4) == 4) || (player->statusEffects & 0x08000000) || (player->statusEffects & 0x04000000)) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008CD8); gDPLoadTLUT_pal256(gDisplayListHead++, D_80164B04); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); @@ -1408,7 +1408,7 @@ void func_800248D0(Player *player, s8 arg1, s8 arg2, s8 arg3) { gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008CD8); gDPLoadTLUT_pal256(gDisplayListHead++, D_80164B04); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); @@ -1478,8 +1478,8 @@ void func_800256F4(Player *player, s8 arg1, s8 arg2, s8 arg3) { } func_80021E10(sp12C, spDC, spD4); func_80021F84(sp12C, D_800DDBD4[player->characterId] * player->unk_224); - func_80022180(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB], sp12C); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[arg1 + (arg2 * 8) + 0x3CB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxKart[arg1 + (arg2 * 8)], sp12C); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[arg1 + (arg2 * 8)]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008CD8); gDPLoadTLUT_pal256(gDisplayListHead++, D_80164B04); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); @@ -1508,8 +1508,8 @@ void func_80025DE8(Player *player, s8 arg1, s8 arg2, s8 arg3) { sp94[2] = player->unk_050[arg2]; func_80021E10(spA8, sp9C, sp94); func_80021F84(spA8, D_800DDBD4[player->characterId] * player->unk_224); - func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], spA8); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxEffect[gMatrixEffectCount], spA8); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008D10); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614((s32) D_80164B10[arg1], (s32) D_80164B20[arg1], (s32) D_80164B30[arg1], (s32) D_80164B40[arg1], (s32) D_80164B50[arg1], (s32) D_80164B60[arg1], 0x00000040); @@ -1521,7 +1521,7 @@ void func_80025DE8(Player *player, s8 arg1, s8 arg2, s8 arg3) { gSPVertex(gDisplayListHead++, &D_800DDBB4[arg1][arg3 + 4], 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008C78); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } void func_800262E0(Player *player, s8 arg1, s8 arg2, s8 arg3) { @@ -1542,8 +1542,8 @@ void func_800262E0(Player *player, s8 arg1, s8 arg2, s8 arg3) { } func_80021E10(spA8, sp9C, sp94); func_80021F84(spA8, D_800DDBD4[player->characterId] * player->unk_224); - func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], spA8); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxEffect[gMatrixEffectCount], spA8); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008CD8); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); func_8004B614((s32) D_80164B10[arg1], (s32) D_80164B20[arg1], (s32) D_80164B30[arg1], (s32) D_80164B40[arg1], (s32) D_80164B50[arg1], (s32) D_80164B60[arg1], (s16) player->unk_0C6 / 2); @@ -1555,7 +1555,7 @@ void func_800262E0(Player *player, s8 arg1, s8 arg2, s8 arg3) { gSPVertex(gDisplayListHead++, &D_800DDBB4[arg1][arg3 + 4], 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008C78); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } void func_800267AC(Player *player, s8 arg1, s8 arg2) { diff --git a/src/code_80057C60.c b/src/code_80057C60.c index c7d66732a..c3fffaf91 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -231,8 +231,8 @@ void func_80058090(u32 arg0) { void func_800581C8(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_8001C3C4(0); if (gGamestate == ENDING_SEQUENCE) { @@ -251,8 +251,8 @@ void func_800581C8(void) { void func_800582CC(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_8001C3C4(1); if (!gDemoMode) { func_800532A4(1); @@ -262,8 +262,8 @@ void func_800582CC(void) { void func_80058394(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_8001C3C4(2); if (!gDemoMode) { func_800532A4(2); @@ -274,8 +274,8 @@ void func_80058394(void) { void func_8005845C(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_8001C3C4(3); if ((!gDemoMode) && (gPlayerCountSelection1 == 4)) { func_800532A4(3); @@ -328,8 +328,8 @@ void func_80058538(u32 arg0) { void func_80058640(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); if (gGamestate != ENDING_SEQUENCE) { func_80058B58(0); } @@ -337,22 +337,22 @@ void func_80058640(void) { void func_800586FC(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_80058B58(1); } void func_800587A4(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_80058B58(2); } void func_8005884C(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_80058B58(3); } @@ -1080,7 +1080,7 @@ void func_80059D00(void) { void func_8005A070(void) { func_8008C1D8(&D_80165678); - D_8018D120 = 0; + gMatrixHudCount = 0; D_801655C0 = 0; func_80041D34(); if (gIsGamePaused == 0) { @@ -4648,8 +4648,8 @@ void func_800652D4(Vec3f arg0, Vec3s arg1, f32 arg2) { func_80021E10(sp20, arg0, arg1); func_80021F84(sp20, arg2); - func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], sp20); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxEffect[gMatrixEffectCount], sp20); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } void func_8006538C(Player *player, s8 arg1, s16 arg2, s8 arg3) { @@ -4700,7 +4700,7 @@ void func_8006538C(Player *player, s8 arg1, s16 arg2, s8 arg3) { func_8004B72C(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); } - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -4728,7 +4728,7 @@ void func_800658A0(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B35C(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -4781,7 +4781,7 @@ void func_80065AB0(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); gSPDisplayList(gDisplayListHead++, D_0D008E48); } - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5030,7 +5030,7 @@ void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) { temp_s0_31->words.w0 = 0x06000000; temp_s0_31->words.w1 = (u32) D_0D008DA0; } - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5062,7 +5062,7 @@ void func_800664E0(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B35C(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -5097,7 +5097,7 @@ void func_80066714(Player *player, s32 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); gSPVertex(gDisplayListHead++, D_800E8B00, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5128,7 +5128,7 @@ void func_80066998(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B35C(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -5178,7 +5178,7 @@ void func_80066BAC(Player *player, s32 arg1, s16 arg2, s8 arg3) { gSPVertex(gDisplayListHead++, &D_800E8900[1][player->unk_258[arg2].unk_038], 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); } - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5218,7 +5218,7 @@ void func_80067280(Player *player, s8 arg1, s16 arg2, s8 arg3) { func_8004B35C(red, green, blue, alpha & 0xFFFFFFFF); // huh? gSPDisplayList(gDisplayListHead++, D_0D008E48); } - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -5254,7 +5254,7 @@ void func_80067604(Player *player, s8 arg1, s16 arg2, s8 arg3) { func_8004B72C(0x000000FF, 0x000000FF, 0x000000DF, 0x000000FF, 0x0000005F, 0, 0x00000060); gSPDisplayList(gDisplayListHead++, D_0D008E48); } - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5291,7 +5291,7 @@ void func_80067964(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D4B0, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8800, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5321,7 +5321,7 @@ void func_80067D3C(Player *player, s8 arg1, u8 *texture, s8 arg3, f32 arg4, s32 func_8004B414(red, green, blue, 0x000000FF); gSPDisplayList(gDisplayListHead++, D_0D008E20); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -5348,7 +5348,7 @@ void func_8006801C(Player *player, s8 arg1, u8 *texture, s8 arg3, f32 arg4, s32 func_8004B414(red, green, blue, 0x000000FF); gSPDisplayList(gDisplayListHead++, D_0D008E20); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -5381,7 +5381,7 @@ void func_80068310(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D4B8, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E88C0, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5415,7 +5415,7 @@ void func_80068724(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C8, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8A40, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5445,7 +5445,7 @@ void func_80068AA4(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E8B40, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5480,7 +5480,7 @@ void func_80068DA0(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D4A8, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, D_800E8BC0, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5513,7 +5513,7 @@ void func_800691B8(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E87C0, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0++; + gMatrixEffectCount++; } } #else @@ -5561,7 +5561,7 @@ void func_80069444(Player *player, s8 arg1, s16 arg2, s8 arg3) { test = envRed; func_8004B72C(primRed, primGreen, primBlue, (s16)test, envGreen, envBlue, primAlpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5592,7 +5592,7 @@ void func_800696CC(Player *player, s8 arg1, s16 arg2, s8 arg3, f32 arg4) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E87C0, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5624,7 +5624,7 @@ void func_80069938(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E87C0, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5655,7 +5655,7 @@ void func_80069BA8(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B35C(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } @@ -5683,7 +5683,7 @@ void func_80069DB8(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E8740, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -5710,7 +5710,7 @@ void func_8006A01C(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_0D008B78, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0++; + gMatrixEffectCount++; } } @@ -5745,7 +5745,7 @@ void func_8006A280(Player *player, s8 arg1, s16 arg2, s8 arg3) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E8780, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } } #else @@ -6142,9 +6142,9 @@ void func_8006AFD0(Player *player, s16 arg1, s8 arg2, s8 arg3) { sp130 = (s16) (s32) (((f32) *(&D_8018D7D0 + (((s8) arg1 * 6) + temp_t6)) - ((f32) *(&D_8018D860 + (((s8) arg1 * 6) + temp_t6)) * sp58)) - (sins(unksp46) * (f32) (*sp3C * 8))); func_80021E10((f32 (*)[4]) &sp140[0], &sp134, &sp12C); func_80021F84((f32 (*)[4]) &sp140[0], var_f20); - func_80022180(&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0, (f32 (*)[4]) &sp140[0]); + func_80022180(&gGfxPool->mtxEffect[gMatrixEffectCount], (f32 (*)[4]) &sp140[0]); - gSPMatrix(gDisplayListHead++, PHYSICAL_TO_VIRTUAL(&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, PHYSICAL_TO_VIRTUAL(&gGfxPool->mtxEffect[gMatrixEffectCount], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTLUT_pal256(gDisplayListHead++, 0x800E52D0); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); @@ -6159,7 +6159,7 @@ void func_8006AFD0(Player *player, s16 arg1, s8 arg2, s8 arg3) { gSPVertex(gDisplayListHead++, D_800E5290, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008C78); gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF); - D_80164AF0++; + gMatrixEffectCount++; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006AFD0.s") @@ -6265,8 +6265,8 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { spF4[2] = arg2; func_80021E10(sp108[0], spFC, spF4); func_80021F84(sp108[0], arg1); - func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], sp108); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxEffect[gMatrixEffectCount], sp108); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008DB8); gDPLoadTLUT_pal256(gDisplayListHead++, D_800E52D0); gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16); @@ -6280,7 +6280,7 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { gSPVertex(gDisplayListHead++, D_800E5290, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008C78); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/render_balloon.s") @@ -6310,7 +6310,7 @@ void func_8006C0C8(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { // ??????????????????????????????????? func_8004B35C(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } #ifdef NEEDS_RODATA @@ -6340,7 +6340,7 @@ void func_8006C294(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); gSPVertex(gDisplayListHead++, D_800E87C0, 4, 0); gSPDisplayList(gDisplayListHead++, D_0D008DA0); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C294.s") @@ -6366,7 +6366,7 @@ void func_8006C4D4(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha, s16 arg4) { gDPLoadTextureBlock(gDisplayListHead++, D_0D02AC58[arg4], G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); func_8004B414(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } #ifdef NON_MATCHING diff --git a/src/code_80057C60.h b/src/code_80057C60.h index fc8db3625..dc6ec843c 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -335,7 +335,7 @@ extern s32 D_8018D400; extern s32 D_8018D40C; extern s32 D_8018D410; -extern s32 D_8018D120; +extern s32 gMatrixHudCount; extern s32 D_8018D170; extern s32 D_8018D178; extern s32 D_8018D188; diff --git a/src/code_80091750.c b/src/code_80091750.c index 47fe4c430..6e3ccaf6e 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -2446,17 +2446,16 @@ UNUSED void func_80093C90(void) { void func_80093C98(s32 arg0) { gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(D_802B8880)); - guOrtho(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - D_80164AF0++; + guOrtho(&gGfxPool->mtxEffect[gMatrixEffectCount], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPDisplayList(gDisplayListHead++, D_02007F18); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 320, 240); func_800A8250(); if (arg0 == 0) { func_800A54EC(); func_8009CA6C(4); - D_80165754 = D_80164AF0; - D_80164AF0 = 0; + D_80165754 = gMatrixEffectCount; + gMatrixEffectCount = 0; } } @@ -2503,9 +2502,8 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80093E60.s") void func_80093F10(void) { gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(D_802B8880)); - guOrtho(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - D_80164AF0++; + guOrtho(&gGfxPool->mtxEffect[gMatrixEffectCount], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPDisplayList(gDisplayListHead++, D_02007F18); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 320, 240); func_80092290(4, D_8018E850, D_8018E858); @@ -2518,15 +2516,14 @@ void func_80093F10(void) { func_80099EC4(); func_8009CA2C(); gSPDisplayList(gDisplayListHead++, D_02007F48); - D_80164AF0 = 0; + gMatrixEffectCount = 0; } void func_800940EC(s32 arg0) { gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(D_802B8880)); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 320, 240); - guOrtho(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - D_80164AF0++; + guOrtho(&gGfxPool->mtxEffect[gMatrixEffectCount], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPDisplayList(gDisplayListHead++, D_02007F18); func_80092290(4, D_8018E850, D_8018E858); func_80092290(5, (s32 *) &D_8018E850[1], (s32 *) &D_8018E858[1]); @@ -2546,9 +2543,9 @@ void func_800942D0(void) { f32 var_f26; s32 var_s2; s32 thing; - test = &gGfxPool->mtxPool[0x32B]; - gSPMatrix(gDisplayListHead++, &gGfxPool->mtxPool[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, &gGfxPool->mtxPool[7], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + test = &gGfxPool->mtxObject[0]; + gSPMatrix(gDisplayListHead++, &gGfxPool->mtxScreen, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, &gGfxPool->mtxLookAt[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); guRotate(test, D_8018EDC8, 1.0f, 0.0f, 0.0f); guRotate(test + 1, D_8018EDCC, 0.0f, 1.0f, 0.0f); guScale( test + 2, 1.0f, 1.0f, D_8018EDC4); @@ -2583,9 +2580,9 @@ void func_80094660(struct GfxPool *arg0, UNUSED s32 arg1) { u16 perspNorm; move_segment_table_to_dmem(); gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - guPerspective(&arg0->mtxPool[0], &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); + guPerspective(&arg0->mtxScreen, &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - guLookAt(&arg0->mtxPool[7], 0.0f, 0.0f, (f32) D_8018EDC0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + guLookAt(&arg0->mtxLookAt[0], 0.0f, 0.0f, (f32) D_8018EDC0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); func_800942D0(); gDPPipeSync(gDisplayListHead++); gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE); @@ -2595,33 +2592,33 @@ void func_80094660(struct GfxPool *arg0, UNUSED s32 arg1) { void func_800947B4(struct GfxPool *arg0, UNUSED s32 arg1) { u16 perspNorm; move_segment_table_to_dmem(); - guPerspective(&arg0->mtxPool[1], &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); + guPerspective(&arg0->mtxPersp[0], &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - guLookAt(&arg0->mtxPool[8], 0.0f, 0.0f, (f32) D_8018EDC0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); - guRotate(&arg0->mtxPool[0x32B], D_8018EDC8, 1.0f, 0, 0); - guRotate(&arg0->mtxPool[0x32C], D_8018EDCC, 0, 1.0f, 0); - guRotate(&arg0->mtxPool[0x32D], D_8018EDD0, 0, 0, 1.0f); - guScale(&arg0->mtxPool[0x32E], D_8018EDC4, D_8018EDC4, D_8018EDC4); - guTranslate(&arg0->mtxPool[0x32F], D_8018EDD4, D_8018EDD8, D_8018EDDC); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[1], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[8], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[0x32B], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[0x32C], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[0x32D], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[0x32E], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - gSPMatrix(gDisplayListHead++, &arg0->mtxPool[0x32F], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + guLookAt(&arg0->mtxLookAt[1], 0.0f, 0.0f, (f32) D_8018EDC0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + guRotate(&arg0->mtxObject[0], D_8018EDC8, 1.0f, 0, 0); + guRotate(&arg0->mtxObject[1], D_8018EDCC, 0, 1.0f, 0); + guRotate(&arg0->mtxObject[2], D_8018EDD0, 0, 0, 1.0f); + guScale(&arg0->mtxObject[3], D_8018EDC4, D_8018EDC4, D_8018EDC4); + guTranslate(&arg0->mtxObject[4], D_8018EDD4, D_8018EDD8, D_8018EDDC); + gSPMatrix(gDisplayListHead++, &arg0->mtxPersp[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, &arg0->mtxLookAt[1], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, &arg0->mtxObject[0], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, &arg0->mtxObject[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, &arg0->mtxObject[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, &arg0->mtxObject[3], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, &arg0->mtxObject[4], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_02007FC8); func_800B0004(); gSPDisplayList(gDisplayListHead++, D_02007650); } -void func_80094A64(Mtx *arg0) { - D_8018D120 = 0; - D_80164AF0 = 0; +void func_80094A64(struct GfxPool *pool) { + gMatrixHudCount = 0; + gMatrixEffectCount = 0; gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_802B8880)); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 320, 240); - guOrtho(arg0, 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); - gSPMatrix(gDisplayListHead++, arg0, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guOrtho(&pool->mtxScreen, 0.0f, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0.0f, -100.0f, 100.0f, 1.0f); + gSPMatrix(gDisplayListHead++, &pool->mtxScreen, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPDisplayList(gDisplayListHead++, D_02007650); func_80094C60(); func_80092290(4, &D_8018E850, &D_8018E858); @@ -2984,16 +2981,16 @@ Gfx *func_80095BD0(Gfx *arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, s32 arg5, s32 temp_a3; s32 temp_v0; - if (D_80164AF0 < 0x2F7) { - sp28 = &gGfxPool->mtxPool[D_80164AF0] + 0xFAC0; - if (D_80164AF0 < 0) { + if (gMatrixEffectCount <= MTX_EFFECT_POOL_SIZE_MAX) { + sp28 = &gGfxPool->mtxEffect[gMatrixEffectCount]; + if (gMatrixEffectCount < 0) { rmonPrintf("effectcount < 0 !!!!!!(kawano)\n"); } func_80095AE0(sp28, arg2, arg3, arg6, arg7); arg0->words.w0 = 0x01020040; - arg0->words.w1 = (s32) (&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0) & 0x1FFFFFFF; + arg0->words.w1 = (s32) (&gGfxPool->mtxEffect[gMatrixEffectCount]) & 0x1FFFFFFF; temp_s0_2 = arg0 + 8; - D_80164AF0 += 1; + gMatrixEffectCount += 1; temp_s0_2->words.w0 = (((arg4 >> 1) - 1) & 0xFFF) | 0xFD880000; temp_s0_3 = temp_s0_2 + 8; temp_s0_2->words.w1 = (u32) arg1; @@ -9930,9 +9927,8 @@ void func_800A54EC(void) { if (gIsGamePaused != 0) { sp48 = find_8018D9E0_entry(0x000000C7); gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(D_802B8880)); - guOrtho(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - D_80164AF0 += 1; + guOrtho(&gGfxPool->mtxEffect[gMatrixEffectCount], 0.0f, 319.0f, 239.0f, 0.0f, -100.0f, 100.0f, 1.0f); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); switch (gModeSelection) { /* irregular */ default: var_v1 = huh; // This is digusting and dumb and broken @@ -10240,7 +10236,7 @@ void func_800A66A8(struct_8018D9E0_entry *arg0, s16 *arg1) { f32 temp_f2; f64 temp_f0; - temp_s1 = &gGfxPool->mtxPool[D_80164AF0] + 0xFAC0; + temp_s1 = &gGfxPool->mtxEffect[gMatrixEffectCount]; temp_f0 = (f64) arg0->unk24; if (temp_f0 > 1.5) { arg0->unk24 = (f32) (temp_f0 * 0.95); @@ -10270,9 +10266,9 @@ void func_800A66A8(struct_8018D9E0_entry *arg0, s16 *arg1) { temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; temp_v0->words.w0 = 0x01020040; - temp_v0->words.w1 = (s32) (&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0) & 0x1FFFFFFF; + temp_v0->words.w1 = (s32) (&gGfxPool->mtxEffect[gMatrixEffectCount]) & 0x1FFFFFFF; temp_v0_2 = gDisplayListHead; - D_80164AF0 += 1; + gMatrixEffectCount += 1; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->words.w0 = 0xB6000000; temp_v0_2->words.w1 = 0x00020000; diff --git a/src/code_80091750.h b/src/code_80091750.h index a148551b2..faf3ec5b1 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -121,7 +121,7 @@ void func_800940EC(s32); void func_800942D0(void); void func_80094660(struct GfxPool*, s32); void func_800947B4(struct GfxPool*, s32); -void func_80094A64(Mtx*); +void func_80094A64(struct GfxPool*); void func_80094C60(void); void func_80095574(void); Gfx *func_800958D4(Gfx*, s32, s32, s32, s32, s32); diff --git a/src/code_80280000.c b/src/code_80280000.c index 78c52aa2f..0bf41a6db 100644 --- a/src/code_80280000.c +++ b/src/code_80280000.c @@ -42,20 +42,20 @@ void func_80280038(void) { UNUSED s32 pad; Mat4 matrix; - D_80150112 = 0; - D_80164AF0 = 0; - D_8018D120 = 0; + gMatrixObjectCount = 0; + gMatrixEffectCount = 0; + gMatrixHudCount = 0; init_rdp(); func_802A53A4(); init_rdp(); func_80057FC4(0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); gCurrentCourseId = gCreditsCourseId; mtxf_identity(matrix); func_802B4FF8(matrix, 0); diff --git a/src/code_80280000.h b/src/code_80280000.h index 8f5fce874..68dde76fd 100644 --- a/src/code_80280000.h +++ b/src/code_80280000.h @@ -16,8 +16,8 @@ extern Gfx *gDisplayListHead; extern f32 D_80150148, D_8015014C, D_80150150; extern f32 D_80150130[4]; extern s16 gCreditsCourseId; -extern u16 D_80150112; -extern s16 D_80164AF0; +extern u16 gMatrixObjectCount; +extern s16 gMatrixEffectCount; extern u16 gIsInQuitToMenuTransition, gQuitToMenuTransitionCounter; extern s32 D_802874A0; diff --git a/src/code_80281C40.c b/src/code_80281C40.c index 5c6ff4585..583e3befa 100644 --- a/src/code_80281C40.c +++ b/src/code_80281C40.c @@ -67,11 +67,11 @@ void func_80281D00(void) { } func_8028150C(); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective((Mtx*) &gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective((Mtx*) &gGfxPool->mtxPersp[0], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt((Mtx*) &gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt((Mtx*) &gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); gSPDisplayList(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_80284F70)); diff --git a/src/gbiMacro.c b/src/gbiMacro.c index 1952caea4..e7d4f1ddd 100644 --- a/src/gbiMacro.c +++ b/src/gbiMacro.c @@ -3,6 +3,7 @@ #include "types.h" #include "PR/gu.h" #include "main.h" +#include "config.h" extern s16 D_800E43A8; extern Mtx D_0D008E98; @@ -15,7 +16,7 @@ UNUSED void gfx_func_80040D00(void) { gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - guOrtho(&gGfxPool->mtxPool[0], 0.0f, 320.0f, 0.0f, 240.0f, -1.0f, 1.0f, 1.0f); + guOrtho(&gGfxPool->mtxScreen, 0.0f, SCREEN_WIDTH, 0.0f, SCREEN_HEIGHT, -1.0f, 1.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, 0xFFFF); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(gGfxPool), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_0D008E98), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/hud_renderer.c b/src/hud_renderer.c index f267e3b31..44d388b47 100644 --- a/src/hud_renderer.c +++ b/src/hud_renderer.c @@ -1535,9 +1535,8 @@ void func_8004A870(s32 objectIndex, f32 arg1) { D_80183E50[1] = temp_v0->unk_044 + 0.8; D_80183E50[2] = temp_v0->pos[2]; func_80042A20(sp30, temp_v0->unk_01C, D_80183E50, 0U, arg1); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], sp30); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], sp30); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D007B98); } } @@ -3542,7 +3541,7 @@ void func_80051638(UNUSED s32 arg0) { leafIndex = D_8018C970[someIndex]; if (leafIndex != -1) { object = &D_80165C18[leafIndex]; - if ((object->unk_0A6 >= 2) && (object->unk_0D5 == 7) && (D_8018D120 < 0x2EF)) { + if ((object->unk_0A6 >= 2) && (object->unk_0D5 == 7) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { func_80043104(leafIndex); gSPDisplayList(gDisplayListHead++, D_0D0069C8); } @@ -4019,7 +4018,7 @@ void func_80052590(s32 cameraId) { temp_v0 = *var_s1; if (temp_v0 != -1) { temp_s0_2 = &D_80165C18[temp_v0]; - if ((temp_s0_2->unk_0A6 >= 2) && (D_8018D120 < 0x2EF)) { + if ((temp_s0_2->unk_0A6 >= 2) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { D_80183E80.unk2 = func_800418AC(temp_s0_2->pos[0], temp_s0_2->pos[2], temp_s7->pos); func_800431B0(temp_s0_2->pos, &D_80183E80, temp_s0_2->sizeScaling, D_0D0062B0); } @@ -4033,7 +4032,7 @@ void func_80052590(s32 cameraId) { temp_v0_2 = *var_s1_2; if (temp_v0_2 != -1) { temp_s0_3 = &D_80165C18[temp_v0_2]; - if ((temp_s0_3->unk_0A6 >= 2) && (D_8018D120 < 0x2EF)) { + if ((temp_s0_3->unk_0A6 >= 2) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { D_80183E80.unk2 = func_800418AC(temp_s0_3->pos[0], temp_s0_3->pos[2], temp_s7->pos); func_800431B0(temp_s0_3->pos, &D_80183E80, temp_s0_3->sizeScaling, D_0D0062B0); } @@ -4167,7 +4166,7 @@ void func_800528EC(s32 arg0) { temp_v0_11 = *var_s3; if (temp_v0_11 != -1) { temp_v1_2 = &D_80165C18[temp_v0_11]; - if ((temp_v1_2->unk_0A6 > 0) && (arg0 == temp_v1_2->unk_084[7]) && (D_8018D120 < 0x2EF)) { + if ((temp_v1_2->unk_0A6 > 0) && (arg0 == temp_v1_2->unk_084[7]) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { func_80042E00(temp_v1_2->pos, &D_80183E80, temp_v1_2->sizeScaling); temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; @@ -4561,7 +4560,7 @@ void func_80053870(s32 cameraId) { temp_s1_3 = *var_a3; if (temp_s1_3 != -1) { temp_s0 = &D_80165C18[temp_s1_3]; - if ((temp_s0->unk_0A6 > 0) && (temp_s0->unk_0D5 == 3) && (D_8018D120 < 0x2EF)) { + if ((temp_s0->unk_0A6 > 0) && (temp_s0->unk_0D5 == 3) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { sp44 = var_a3; func_80042E00(temp_s0->pos, temp_s0->unk_0B2, temp_s0->sizeScaling); temp_v0_10 = gDisplayListHead; @@ -4601,7 +4600,7 @@ void func_80053870(s32 cameraId) { temp_s1_4 = *var_s3; if (temp_s1_4 != -1) { temp_s0_2 = &D_80165C18[temp_s1_4]; - if ((temp_s0_2->unk_0A6 >= 2) && (temp_s0_2->unk_0D5 == 2) && (D_8018D120 < 0x2EF)) { + if ((temp_s0_2->unk_0A6 >= 2) && (temp_s0_2->unk_0D5 == 2) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) temp_s0_2->unk_0A0); D_80183E80->unk2 = func_800418AC(temp_s0_2->pos[0], temp_s0_2->pos[2], sp84->pos); func_800431B0(temp_s0_2->pos, D_80183E80, temp_s0_2->sizeScaling, D_0D005AE0); @@ -4617,7 +4616,7 @@ GLOBAL_ASM("asm/non_matchings/hud_renderer/func_80053870.s") void func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 vertexIndex) { struct_80165C18_entry *temp_v0; - if (D_8018D120 < 0x2EF) { + if (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX) { temp_v0 = &D_80165C18[objectIndex]; D_80183E80[2] = (s16) (temp_v0->unk_084[6] + 0x8000); func_80042E00(temp_v0->pos, (u16 *) D_80183E80, temp_v0->sizeScaling); @@ -4714,7 +4713,7 @@ void func_800540CC(s32 objectIndex, s32 cameraId) { camera = &camera1[cameraId]; if (objectIndex != -1) { - if ((D_80165C18[objectIndex].unk_0A6 >= 2) && (D_80165C18[objectIndex].unk_0D5 == 1) && (D_8018D120 < 0x2EF)) { + if ((D_80165C18[objectIndex].unk_0A6 >= 2) && (D_80165C18[objectIndex].unk_0D5 == 1) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { func_8004B1C8((s32) D_80165C18[objectIndex].unk_0A4, (s32) D_80165C18[objectIndex].unk_0A4, (s32) D_80165C18[objectIndex].unk_0A4, 0, 0, 0, (s32) D_80165C18[objectIndex].unk_0A0); D_80183E80[1] = func_800418AC(D_80165C18[objectIndex].pos[0], D_80165C18[objectIndex].pos[2], camera->pos); func_800431B0(D_80165C18[objectIndex].pos, D_80183E80, D_80165C18[objectIndex].sizeScaling, D_0D005AE0); @@ -4769,7 +4768,7 @@ void func_80054324(s32 objectIndex, s32 cameraId) { camera = &camera1[cameraId]; if (objectIndex != -1) { - if ((D_80165C18[objectIndex].unk_0A6 >= 2) && (D_80165C18[objectIndex].unk_0D5 == 6) && (D_8018D120 < 0x2EF)) { + if ((D_80165C18[objectIndex].unk_0A6 >= 2) && (D_80165C18[objectIndex].unk_0D5 == 6) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { func_8004B1C8((s32) D_80165C18[objectIndex].unk_0A4, (s32) D_80165C18[objectIndex].unk_0A4, (s32) D_80165C18[objectIndex].unk_0A4, D_80165C18[objectIndex].unk_0A2, D_80165C18[objectIndex].unk_0A2, D_80165C18[objectIndex].unk_0A2, (s32) D_80165C18[objectIndex].unk_0A0); D_80183E80[1] = func_800418AC(D_80165C18[objectIndex].pos[0], D_80165C18[objectIndex].pos[2], camera->pos); func_800431B0(D_80165C18[objectIndex].pos, D_80183E80, D_80165C18[objectIndex].sizeScaling, D_0D005AE0); @@ -4824,7 +4823,7 @@ void func_8005457C(s32 objectIndex, s32 cameraId) { struct_80165C18_entry *temp_s0; camera = &camera1[cameraId]; - if (D_8018D120 < 0x2EF) { + if (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX) { temp_s0 = &D_80165C18[objectIndex]; if (temp_s0->unk_0D5 == 9) { func_8004B72C(0x000000FF, (s32) temp_s0->unk_0A4, 0, (s32) temp_s0->unk_0A2, 0, 0, (s32) temp_s0->unk_0A0); @@ -4854,7 +4853,7 @@ void func_80054664(s32 cameraId) { } void func_8005477C(s32 objectIndex, u8 arg1, Vec3f arg2) { - if (D_8018D120 < 0x2EF) { + if (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX) { switch (arg1) { /* irregular */ case 0: func_8004B1C8(0x000000E6, 0x000000FF, 0x000000FF, 0, 0, 0x000000FF, (s32) D_80165C18[objectIndex].unk_0A0); @@ -5000,7 +4999,7 @@ void func_80054F04(s32 cameraId) { object = &D_80165C18[objectIndex]; if (object->unk_0A6 > 0) { func_8008A364(objectIndex, cameraId, 0x2AABU, 0x000000C8); - if ((func_8007223C(objectIndex, 0x00040000) != 0) && (D_8018D120 < 0x2EF)) { + if ((func_8007223C(objectIndex, 0x00040000) != 0) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { object->unk_0B2[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos); func_80043104(objectIndex); gSPDisplayList(gDisplayListHead++, D_0D006980); @@ -5313,15 +5312,14 @@ void func_80055FA0(s32 objectIndex, UNUSED s32 arg1) { object = &D_80165C18[objectIndex]; if (object->unk_0A6 >= 2) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_800425D0(someMatrix1,object->pos, object->unk_0BE, object->sizeScaling); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], someMatrix1); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], someMatrix1); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D0077A0); gSPDisplayList(gDisplayListHead++, object->unk_070); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(someMatrix2); func_802B4FF8(someMatrix2, 0); } @@ -5490,9 +5488,8 @@ void func_800568A0(s32 objectIndex, s32 playerId) { D_80183E50[1] = D_80165C18[objectIndex].unk_044 + 0.8; D_80183E50[2] = D_80165C18[objectIndex].pos[2]; func_80042A20(sp30, player->unk_110.unk60, D_80183E50, 0U, 0.5f); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], sp30); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], sp30); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D007B98); } @@ -5609,9 +5606,8 @@ void func_80056FCC(s32 bombIndex) { D_80183E50[1] = temp_v0->yPos + 1.0; D_80183E50[2] = temp_v0->bombPos[2]; func_80042A20(sp30, D_80164038[bombIndex].unk60, D_80183E50, 0U, 0.5f); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], sp30); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_LOAD | G_MTX_NOPUSH| G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], sp30); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_LOAD | G_MTX_NOPUSH| G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D007B98); } diff --git a/src/main.c b/src/main.c index c753b4192..cebffeed4 100644 --- a/src/main.c +++ b/src/main.c @@ -107,7 +107,7 @@ u8 gControllerBits; struct UnkStruct_8015F584 D_8014F110[1024]; u16 gNumActors; -u16 D_80150112; +u16 gMatrixObjectCount; s32 gTickSpeed; f32 D_80150118; u16 wasSoftReset; @@ -546,8 +546,8 @@ void race_logic_loop(void) { s16 i; u16 rotY; - D_80150112 = 0; - D_80164AF0 = 0; + gMatrixObjectCount = 0; + gMatrixEffectCount = 0; if (gIsGamePaused != 0) { func_80290B14(); } @@ -871,8 +871,7 @@ void game_state_handler(void) { osViBlack(0); update_menus(); init_rcp(); - // gGfxPool->mtxPool->m or gGfxPool? - func_80094A64((Mtx *) gGfxPool->mtxPool->m); + func_80094A64(gGfxPool); #if DVDL display_dvdl(); #endif diff --git a/src/main.h b/src/main.h index c415ccbb7..9d63ce5ea 100644 --- a/src/main.h +++ b/src/main.h @@ -10,10 +10,49 @@ #define MESG_START_GFX_SPTASK 103 #define MESG_NMI_REQUEST 104 -#define MTX_POOL_SIZE 0x0683 +#define MTX_HUD_POOL_SIZE 800 + +#ifdef AVOID_UB +#define MTX_HUD_POOL_SIZE_MAX MTX_HUD_POOL_SIZE +#else +#define MTX_HUD_POOL_SIZE_MAX MTX_HUD_POOL_SIZE - 50 +#endif + +#define MTX_OBJECT_POOL_SIZE 128 + +// TODO: Verify with proper documentation +// functions called by mtxShadow multiply by 8 +// 8 CPU Players * 4 real players in coop +#define MTX_SHADOW_POOL_SIZE 8 * 4 + +// TODO: Verify with proper documentation +// functions called by mtxKart multiply by 8 +// 8 CPU Players * 4 real players in coop +#define MTX_KART_POOL_SIZE 8 * 4 + +#define MTX_EFFECT_POOL_SIZE 660 + +// func_80095BD0 sets an OOB pool size max check (760) +#ifdef AVOID_UB +#define MTX_EFFECT_POOL_SIZE_MAX MTX_EFFECT_POOL_SIZE +#else +#define MTX_EFFECT_POOL_SIZE_MAX MTX_EFFECT_POOL_SIZE + 100 +#endif + #define GFX_POOL_SIZE 0x1D4C + struct GfxPool { - /* 0x00000 */ Mtx mtxPool[MTX_POOL_SIZE]; + /* 0x00000 */ Mtx mtxScreen; // Matrix for skybox and startup logo + /* 0x00040 */ Mtx mtxPersp[4]; // Matrix for perspective screen modes + /* 0x00140 */ Mtx mtxOrtho; // Matrix for ortho hud screen modes + /* 0x00180 */ Mtx mtxUnk; // Matrix unused + /* 0x001C0 */ Mtx mtxLookAt[4]; // Matrix for lookat screen modes + /* 0x002C0 */ Mtx mtxHud[MTX_HUD_POOL_SIZE]; // Matrix hud elements and 2D related effects + /* 0x0CAC0 */ Mtx mtxObject[MTX_OBJECT_POOL_SIZE]; // Matrix course objects + /* 0x0EAC0 */ Mtx mtxShadow[MTX_SHADOW_POOL_SIZE]; // Matrix shadow characters + /* 0x0F2C0 */ Mtx mtxKart[MTX_KART_POOL_SIZE]; // Matrix kart characters + /* 0x0FAC0 */ Mtx mtxEffect[MTX_EFFECT_POOL_SIZE]; // Matrix misc effects + /* 0x19FC0 */ Mtx mtxArr[4]; // Matrix unused array /* 0x1A0C0 */ Gfx gfxPool[GFX_POOL_SIZE]; /* 0x28B20 */ struct SPTask spTask; }; // size = 0x28B70 @@ -132,7 +171,7 @@ extern u32 *D_801978D0; // Segment? Keeps track of segmented addresses? extern s16 gCurrentlyLoadedCourseId; extern s16 gCurrentCourseId; -extern s16 D_80164AF0; +extern s16 gMatrixEffectCount; extern u16 gIsGamePaused; // 1 if the game is paused and 0 if the game is not paused extern u16 gIsInQuitToMenuTransition; diff --git a/src/math_util.c b/src/math_util.c index 3ee564fb1..ec1f1da6b 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -40,26 +40,22 @@ UNUSED void func_802B4FF0() { } s32 func_802B4FF8(Mat4 arg0, s32 arg1) { - if (D_80150112 >= 0x80) { + if (gMatrixObjectCount >= MTX_OBJECT_POOL_SIZE) { return 0; } - mtxf_to_mtx(&gGfxPool->mtxPool[D_80150112 + 0x32B], arg0); + mtxf_to_mtx(&gGfxPool->mtxObject[gMatrixObjectCount], arg0); switch (arg1) { /* irregular */ case 0: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_80150112 += 1; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxObject[gMatrixObjectCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); break; case 1: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_80150112 += 1; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxObject[gMatrixObjectCount++]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); break; case 3: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_80150112 += 1; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxObject[gMatrixObjectCount++]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); break; case 2: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_80150112 += 1; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxObject[gMatrixObjectCount++]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); break; } return 1; diff --git a/src/math_util_2.c b/src/math_util_2.c index de6fe5d9b..5344c9a77 100644 --- a/src/math_util_2.c +++ b/src/math_util_2.c @@ -605,61 +605,58 @@ void func_80041D34(void) { guOrtho((Mtx *)D_80183D60, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); switch (gActiveScreenMode) { case SCREEN_MODE_1P: - guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); + guOrtho(&gGfxPool->mtxOrtho, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); break; case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - guOrtho(&gGfxPool->mtxPool[5], 0.0f, 160.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f); + guOrtho(&gGfxPool->mtxOrtho, 0.0f, 160.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f); break; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: if (D_801658FE == 0) { - guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f); + guOrtho(&gGfxPool->mtxOrtho, 0.0f, 320.0f, 120.0f, 0.0f, -1.0f, 1.0f, 1.0f); } else { - guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); + guOrtho(&gGfxPool->mtxOrtho, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); } break; case SCREEN_MODE_3P_4P_SPLITSCREEN: - guOrtho(&gGfxPool->mtxPool[5], 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); + guOrtho(&gGfxPool->mtxOrtho, 0.0f, 320.0f, 240.0f, 0.0f, -1.0f, 1.0f, 1.0f); break; } } void func_80041EF4(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[5]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxOrtho), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); } -extern s32 D_8018D120; +extern s32 gMatrixHudCount; //void func_80022180(Mtx*, Mat4); UNUSED void func_80041F54(s32 arg0, s32 arg1) { Mat4 matrix; func_80041A78(matrix, arg0, arg1); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } UNUSED void func_80042000(u16 arg0) { Mat4 matrix; func_80041AD8(matrix, arg0); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } UNUSED void func_800420A8(f32 arg0) { Mat4 matrix; func_80041B68(matrix, arg0); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } @@ -667,33 +664,29 @@ UNUSED void func_8004214C(u16 arg1, f32 arg2) { Mat4 matrix; func_80041BBC(matrix, arg1, arg2); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } UNUSED void func_800421FC(s32 arg0, s32 arg1, f32 arg2) { Mat4 matrix; func_80041A78(matrix, arg0, arg1); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_80041B68(matrix, arg2); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); } void func_80042330(s32 arg0, s32 arg1, u16 arg2, f32 arg3) { Mat4 matrix; func_80041C64(matrix, arg0, arg1, arg2, arg3); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } UNUSED void func_800423F0(Mat4 arg0, u16 arg1, u16 arg2, u16 arg3) { @@ -944,18 +937,16 @@ void func_80042E00(Vec3f arg0, Vec3su arg1, f32 arg2) { Mat4 matrix; func_800425D0(matrix, arg0, arg1, arg2); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } UNUSED void func_80042EB8(Vec3f arg0, Vec3f arg1, f32 arg2) { Mat4 matrix; func_80042760(matrix, arg0, arg1, arg2); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } @@ -967,27 +958,24 @@ void func_80042F70(Vec3f arg0, Vec3su arg1, f32 arg2) { sp20[1] = arg1[1] + 0x8000; sp20[2] = arg1[2]; func_800425D0(matrix, arg0, sp20, arg2); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } void func_80043050(Vec3f arg0,Vec3f arg1, f32 arg2) { Mat4 matrix; func_80042A20(matrix, arg1, arg0, 0, arg2); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], matrix); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], matrix); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } void func_80043104(s32 arg0) { Mat4 sp20; func_800427DC(arg0, sp20); - func_80022180(&gGfxPool->mtxPool[D_8018D120 + 0xB], sp20); + func_80022180(&gGfxPool->mtxHud[gMatrixHudCount], sp20); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_8018D120 + 0xB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_8018D120++; + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } diff --git a/src/math_util_2.h b/src/math_util_2.h index d6cdd00aa..0115a048f 100644 --- a/src/math_util_2.h +++ b/src/math_util_2.h @@ -85,6 +85,6 @@ void func_80043104(s32); extern Vec3su D_80165834; extern s8 D_80165840[]; extern s8 D_801658FE; -extern s32 D_8018D120; +extern s32 gMatrixHudCount; #endif // MATH_UTIL_2_H diff --git a/src/player_controller.c b/src/player_controller.c index 3cf3b2a3a..492eaf28e 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -759,7 +759,7 @@ UNUSED void func_80028F5C(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNU } void func_80028F70(void) { - D_80164AF0 = 0; + gMatrixEffectCount = 0; func_80028E70(gPlayerOneCopy, camera1, 0, 0); func_80028E70(gPlayerTwo, camera1, 1, 0); func_80028E70(gPlayerThree, camera1, 2, 0); @@ -771,7 +771,7 @@ void func_80028F70(void) { } void func_80029060(void) { - D_80164AF0 = 0; + gMatrixEffectCount = 0; func_80028E70(gPlayerOneCopy, camera1, 0, 0); func_80028E70(gPlayerTwo, camera1, 1, 0); func_80028E70(gPlayerThree, camera1, 2, 0); @@ -787,7 +787,7 @@ void func_80029150(void) { } void func_80029158(void) { - D_80164AF0 = 0; + gMatrixEffectCount = 0; func_80028E70(gPlayerOneCopy, camera1, 0, 0); func_80028E70(gPlayerTwo, camera1, 1, 0); func_80028E70(gPlayerThree, camera1, 2, 0); diff --git a/src/player_controller.h b/src/player_controller.h index dfc854a8c..c2507a504 100644 --- a/src/player_controller.h +++ b/src/player_controller.h @@ -189,7 +189,7 @@ extern s16 *D_800E3C10[]; extern s16 *D_800E3C30[]; extern s16 **D_800E3C50[]; -extern s16 D_80164AF0; +extern s16 gMatrixEffectCount; extern Player *D_801653C0[8]; extern s16 D_801656F0; diff --git a/src/podium_ceremony_actors.c b/src/podium_ceremony_actors.c index 56df5d88a..090c05936 100644 --- a/src/podium_ceremony_actors.c +++ b/src/podium_ceremony_actors.c @@ -233,8 +233,8 @@ void func_80280A28(Vec3f arg0, Vec3s arg1, f32 arg2) { mtx[2][0] = D_80287500[0][2] * arg2; mtx[2][1] = D_80287500[1][2] * arg2; mtx[2][2] = D_80287500[2][2] * arg2; - func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], mtx); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80022180(&gGfxPool->mtxEffect[gMatrixEffectCount], mtx); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } void render_fireworks(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { @@ -260,7 +260,7 @@ void render_fireworks(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { // ??????????????????????????????????? func_8004B35C(red, green, blue, alpha); gSPDisplayList(gDisplayListHead++, D_0D008E48); - D_80164AF0 += 1; + gMatrixEffectCount += 1; } void firework_update(Firework *actor) { @@ -462,7 +462,7 @@ void func_80281540(void) { } void podium_ceremony_loop(void) { - D_80150112 = 0; + gMatrixObjectCount = 0; D_802874FC = 0; setup_camera_podium_ceremony(); func_80028F70(); diff --git a/src/podium_ceremony_actors.h b/src/podium_ceremony_actors.h index 28f060c01..4663483df 100644 --- a/src/podium_ceremony_actors.h +++ b/src/podium_ceremony_actors.h @@ -117,6 +117,6 @@ extern ActorInitParams initBurst; extern Gfx *D_802874D4; extern s32 D_802874FC; extern Mat4 D_80287500; -extern s16 D_80164AF0; +extern s16 gMatrixEffectCount; #endif diff --git a/src/render_courses.c b/src/render_courses.c index ef671aa2e..666468bbe 100644 --- a/src/render_courses.c +++ b/src/render_courses.c @@ -211,20 +211,20 @@ void func_8029122C(struct UnkStruct_800DC5EC *arg0, s32 arg1) { playerDirection = arg0->playerDirection; switch (arg1) { case 0: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); break; case 1: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); break; case 2: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); break; case 3: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); break; } mtxf_identity(matrix); diff --git a/src/skybox_and_splitscreen.c b/src/skybox_and_splitscreen.c index 2ca26c537..320e6ac63 100644 --- a/src/skybox_and_splitscreen.c +++ b/src/skybox_and_splitscreen.c @@ -435,9 +435,9 @@ void func_802A487C(Vtx *arg0, UNUSED struct UnkStruct_800DC5EC *arg1, UNUSED s32 gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_LIGHTING); - guOrtho(&gGfxPool->mtxPool[0], 0.0f, 320.0f, 0.0f, 240.0f, 0.0f, 5.0f, 1.0f); + guOrtho(&gGfxPool->mtxScreen, 0.0f, SCREEN_WIDTH, 0.0f, SCREEN_HEIGHT, 0.0f, 5.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, 0xFFFF); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxScreen), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_0D008E98), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(gDisplayListHead++, &arg0[4], 4, 0); gSP2Triangles(gDisplayListHead++, 0, 3, 1, 0, 1, 3, 2, 0); @@ -487,9 +487,9 @@ void func_802A4A0C(Vtx *vtx, struct UnkStruct_800DC5EC *arg1, UNUSED s32 arg2, U init_rdp(); gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_LIGHTING); - guOrtho(&gGfxPool->mtxPool[0], 0.0f, SCREEN_WIDTH, 0.0f, SCREEN_HEIGHT, 0.0f, 5.0f, 1.0f); + guOrtho(&gGfxPool->mtxScreen, 0.0f, SCREEN_WIDTH, 0.0f, SCREEN_HEIGHT, 0.0f, 5.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, 0xFFFF); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxScreen), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_0D008E98), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(gDisplayListHead++, &vtx[0], 4, 0); gSP2Triangles(gDisplayListHead++, 0, 3, 1, 0, 1, 3, 2, 0); @@ -778,23 +778,23 @@ void func_802A59A4(void) { gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], + guLookAt(&gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -826,23 +826,23 @@ void func_802A5CB4(void) { func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); @@ -876,21 +876,21 @@ void func_802A5FAC(void) { func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[1], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F0); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -924,22 +924,22 @@ void func_802A62A4(void) { func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -974,21 +974,21 @@ void func_802A65B8(void) { func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[1], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F0); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -1021,21 +1021,21 @@ void func_802A68CC(void) { func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5EC); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -1068,21 +1068,21 @@ void func_802A6BB0(void) { func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + guLookAt(&gGfxPool->mtxLookAt[1], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F0); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -1115,21 +1115,21 @@ void func_802A6E94(void) { func_802A3730(D_800DC5F4); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[3], &perspNorm, D_80150130[2], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, D_80150130[2], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[9], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[2], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F4); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } @@ -1171,20 +1171,20 @@ void func_802A7178(void) { func_802A3730(D_800DC5F8); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[4], &perspNorm, D_80150130[3], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, D_80150130[3], D_80150148, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guLookAt(&gGfxPool->mtxPool[10], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + guLookAt(&gGfxPool->mtxLookAt[3], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); if (D_800DC5C8 == 0) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); } else { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } func_80295A38(D_800DC5F8); if (D_800DC5C8 == 1) { - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); mtxf_identity(matrix); func_802B4FF8(matrix, 0); }