diff --git a/config/RSPE01_01/splits.txt b/config/RSPE01_01/splits.txt
index f912a997d..df4085de5 100644
--- a/config/RSPE01_01/splits.txt
+++ b/config/RSPE01_01/splits.txt
@@ -3623,15 +3623,167 @@ Pack/RPUtility/RPUtlLoadSaveDataScene.cpp:
.data start:0x803C1B88 end:0x803C1BF0
.sdata2 start:0x804C1C70 end:0x804C1C98
+Pack/RPSports/RPSportsCommon/RPSports_801CCB70.cpp:
+ .text start:0x801CCB70 end:0x801CD384
+ .rodata start:0x80383990 end:0x80383AC0
+ .data start:0x803C1BF0 end:0x803C1C20
+ .sbss start:0x804BF6E8 end:0x804BF6F0
+ .sdata2 start:0x804C1C98 end:0x804C1CA8
+
+Pack/RPSports/RPSportsCommon/RPSports_801CD384.cpp:
+ .text start:0x801CD384 end:0x801CDD90
+ .rodata start:0x80383AC0 end:0x80383BD8
+ .data start:0x803C1C20 end:0x803C1C50
+ .sdata start:0x804BDC38 end:0x804BDC40
+ .sdata2 start:0x804C1CA8 end:0x804C1CB0
+
+Pack/RPSports/RPSportsCommon/RPSports_801CDD90.cpp:
+ .text start:0x801CDD90 end:0x801CE630
+ .data start:0x803C1C50 end:0x803C1C60
+ .sdata2 start:0x804C1CB0 end:0x804C1CC8
+
+Pack/RPSports/RPSportsCommon/RPSportsAppMiiManager.cpp:
+ .text start:0x801CE630 end:0x801CE7F8
+ .rodata start:0x80383BD8 end:0x80383BF0
+ .data start:0x803C1C60 end:0x803C1C70
+
+Pack/RPSports/RPSportsCommon/RPSports_801CE7F8.cpp:
+ .text start:0x801CE7F8 end:0x801CED10
+ .rodata start:0x80383BF0 end:0x80383C58
+ .data start:0x803C1C70 end:0x803C1CB0
+ .sdata2 start:0x804C1CC8 end:0x804C1CD8
+
+Pack/RPSports/RPSportsCommon/RPSportsKokeshiLyt.cpp:
+ .text start:0x801CED10 end:0x801CFC60
+ .rodata start:0x80383C58 end:0x80383E60
+ .data start:0x803C1CB0 end:0x803C1D00
+ .sdata2 start:0x804C1CD8 end:0x804C1CE8
+
+Pack/RPSports/RPSportsCommon/RPSportsKokeshiLytDebug.cpp:
+ .text start:0x801CFC60 end:0x801CFE90
+ .data start:0x803C1D00 end:0x803C1D18
+ .sdata2 start:0x804C1CE8 end:0x804C1CF8
+
+Pack/RPSports/RPSportsCommon/RPSportsButtonA.cpp:
+ .text start:0x801CFE90 end:0x801D1408
+ .rodata start:0x80383E60 end:0x80384070
+ .data start:0x803C1D18 end:0x803C1D68
+ .sdata start:0x804BDC40 end:0x804BDC58
+ .sdata2 start:0x804C1CF8 end:0x804C1D38
+
+Pack/RPSports/RPSportsCommon/RPSports_801D1408.cpp:
+ .text start:0x801D1408 end:0x801D26E0
+ .rodata start:0x80384070 end:0x803841D0
+ .data start:0x803C1D68 end:0x803C1D78
+ .sdata2 start:0x804C1D38 end:0x804C1D60
+
+Pack/RPSports/RPSportsCommon/RPSportsBodyManager.cpp:
+ .text start:0x801D26E0 end:0x801D29D8
+ .rodata start:0x803841D0 end:0x80384560
+ .data start:0x803C1D78 end:0x803C1F78
+ .sdata start:0x804BDC58 end:0x804BDC60
+ .sdata2 start:0x804C1D60 end:0x804C1D68
+
+Pack/RPSports/RPSportsCommon/RPSysBootScene.cpp:
+ .text start:0x801D29D8 end:0x801D3140
+ .rodata start:0x80384560 end:0x803846D0
+ .data start:0x803C1F78 end:0x803C1FD8
+ .sdata start:0x804BDC60 end:0x804BDC68
+ .sdata2 start:0x804C1D68 end:0x804C1D88
+
+Pack/RPSports/RPSportsCommon/RPSysPlayerSelectScene.cpp:
+ .text start:0x801D3140 end:0x801D57E4
+ .rodata start:0x803846D0 end:0x803847A0
+ .data start:0x803C1FD8 end:0x803C2038
+ .sbss start:0x804BF6F0 end:0x804BF708
+ .sdata2 start:0x804C1D88 end:0x804C1D90
+
+Pack/RPSports/RPSportsCommon/RPSportsMenuBgModel.cpp:
+ .text start:0x801D57E4 end:0x801D5DD4
+ .rodata start:0x803847A0 end:0x803847C8
+ .data start:0x803C2038 end:0x803C2080
+ .sdata2 start:0x804C1D90 end:0x804C1DB8
+
+Pack/RPSports/RPSportsCommon/RPSysLytMenuFrame.cpp:
+ .text start:0x801D5DD4 end:0x801D8DF0
+ .rodata start:0x803847C8 end:0x80384F20
+ .data start:0x803C2080 end:0x803C20A0
+ .sdata start:0x804BDC68 end:0x804BDC90
+ .sdata2 start:0x804C1DB8 end:0x804C1DE8
+
+Pack/RPSports/RPSportsCommon/RPSysKokeshiHead.cpp:
+ .text start:0x801D8DF0 end:0x801D9078
+ .rodata start:0x80384F20 end:0x80384F30
+ .data start:0x803C20A0 end:0x803C20C8
+ .sdata2 start:0x804C1DE8 end:0x804C1DF0
+
+Pack/RPSports/RPSportsCommon/RPSysMenuKokeshiMgr.cpp:
+ .text start:0x801D9078 end:0x801DAD24
+ .rodata start:0x80384F30 end:0x80384FE0
+ .data start:0x803C20C8 end:0x803C2110
+ .sdata2 start:0x804C1DF0 end:0x804C1E38
+
+Pack/RPSports/RPSportsCommon/RPSysLytRimoconEntry.cpp:
+ .text start:0x801DAD24 end:0x801DC37C
+ .rodata start:0x80384FE0 end:0x80385718
+ .data start:0x803C2110 end:0x803C2130
+ .sdata2 start:0x804C1E38 end:0x804C1E50
+
+Pack/RPSports/RPSportsCommon/RPSysLytPlayerSelect.cpp:
+ .text start:0x801DC37C end:0x801DF984
+ .rodata start:0x80385718 end:0x80386100
+ .data start:0x803C2130 end:0x803C2150
+ .sdata2 start:0x804C1E50 end:0x804C1E88
+
+Pack/RPSports/RPSportsCommon/RPSports_801DF984.cpp:
+ .text start:0x801DF984 end:0x801E2C0C
+ .rodata start:0x80386100 end:0x80386558
+ .sdata start:0x804BDC90 end:0x804BDC98
+ .sdata2 start:0x804C1E88 end:0x804C1EA0
+
+Pack/RPSports/RPSportsCommon/RPSysNunchukCheckScene.cpp:
+ .text start:0x801E2C0C end:0x801E4828
+ .rodata start:0x80386558 end:0x80386928
+ .data start:0x803C2150 end:0x803C2418
+ .sdata start:0x804BDC98 end:0x804BDCB0
+ .sdata2 start:0x804C1EA0 end:0x804C1EB8
+
+Pack/RPSports/RPSportsCommon/RPPartyMenuBgModel.cpp:
+ .text start:0x801E4828 end:0x801E51B4
+ .rodata start:0x80386928 end:0x803869A0
+ .data start:0x803C2418 end:0x803C2490
+ .sdata start:0x804BDCB0 end:0x804BDCB8
+ .sdata2 start:0x804C1EB8 end:0x804C1EE8
+
+Pack/RPSports/RPSportsCommon/RPSports_801E51B4.cpp:
+ .text start:0x801E51B4 end:0x801E7290
+ .rodata start:0x803869A0 end:0x80386F08
+ .data start:0x803C2490 end:0x803C25E8
+ .sdata start:0x804BDCB8 end:0x804BDCC0
+ .sdata2 start:0x804C1EE8 end:0x804C1F08
+
+Pack/RPSports/RPSportsCommon/RPSportsStaticMem.cpp:
+ .text start:0x801E7290 end:0x801E7EB4
+ .rodata start:0x80386F08 end:0x80387004
+ .data start:0x803C25E8 end:0x803C2650
+ .sbss start:0x804BF708 end:0x804BF710
+ .sdata2 start:0x804C1F08 end:0x804C1F18
+
+Pack/RPSports/RPSportsCommon/RPSports_801E7EB4.cpp:
+ .text start:0x801E7EB4 end:0x801EA458
+ .rodata start:0x80387004 end:0x80387438
+ .sbss start:0x804BF710 end:0x804BF718
+ .sdata2 start:0x804C1F18 end:0x804C1F70
+
Pack/RPSports/RPSportsCommon/RPSportsCommon_unsplit.o:
- .text start:0x801CCB70 end:0x80214480
+ .text start:0x801EA458 end:0x80214480
.ctors start:0x80355160 end:0x8035516C
- .rodata start:0x80383990 end:0x8038B1A8
- .data start:0x803C1BF0 end:0x803C3730
+ .rodata start:0x80387438 end:0x8038B1A8
+ .data start:0x803C2650 end:0x803C3730
.bss start:0x804A48A0 end:0x804A6000
- .sdata start:0x804BDC38 end:0x804BDDD0
- .sbss start:0x804BF6E8 end:0x804BF768
- .sdata2 start:0x804C1C98 end:0x804C2338
+ .sdata start:0x804BDCC0 end:0x804BDDD0
+ .sbss start:0x804BF718 end:0x804BF768
+ .sdata2 start:0x804C1F70 end:0x804C2338
Pack/RPSports/RPTnsScene/RPTnsScene_unsplit.o:
.text start:0x80214480 end:0x8024E334
diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt
index 019607a39..ae0913a7b 100644
--- a/config/RSPE01_01/symbols.txt
+++ b/config/RSPE01_01/symbols.txt
@@ -7022,9 +7022,9 @@ LoadGameLocalArchive__20RPSysResourceManagerFlPQ23EGG4Heap = .text:0x80187964; /
LoadGameCommonArchive__20RPSysResourceManagerFlPQ23EGG4Heap = .text:0x80187A0C; // type:function size:0x9C
__dt__20RPSysResourceManagerFv = .text:0x80187AA8; // type:function size:0x40
CreateInstance__20RPSysResourceManagerFv = .text:0x80187AE8; // type:function size:0x6C
-fn_80187B54 = .text:0x80187B54; // type:function size:0x40
-fn_80187B94 = .text:0x80187B94; // type:function size:0xC
-fn_80187BA0 = .text:0x80187BA0; // type:function size:0x70
+__dt__16RPSysQueuedSceneFv = .text:0x80187B54; // type:function size:0x40
+reset__16RPSysQueuedSceneFv = .text:0x80187B94; // type:function size:0xC
+CreateInstance__16RPSysQueuedSceneFPQ23EGG4Heap = .text:0x80187BA0; // type:function size:0x70
fn_80187C10 = .text:0x80187C10; // type:function size:0x7C
postUpdate__17RPSysCommonObjectFv = .text:0x80187C8C; // type:function size:0x88
preUpdate__17RPSysCommonObjectFv = .text:0x80187D14; // type:function size:0x64
@@ -7310,7 +7310,7 @@ AllocHeap__24RPSysEffectMemoryManagerFUl = .text:0x80193100; // type:function si
RoundUp
__Q34nw4r2ut24@unnamed@SportsPack_pch@FUlUi_Ul = .text:0x80193250; // type:function size:0x18 scope:weak
__ct__Q34nw4r2ef17MemoryManagerBaseFv = .text:0x80193268; // type:function size:0x10 scope:weak
createEffect__14RPSysEffectMgrFPCcUlUl = .text:0x80193278; // type:function size:0x10
-draw__14RPSysEffectMgrFRCQ34nw4r2ef8DrawInfoUlUl = .text:0x80193288; // type:function size:0x22C
+draw__14RPSysEffectMgrFRCQ34nw4r4math5MTX34UlUl = .text:0x80193288; // type:function size:0x22C
setCaptureEfb__14RPSysEffectMgrFPvRCQ214RPSysEffectMgr10EfbTexData = .text:0x801934B4; // type:function size:0xD0
update__14RPSysEffectMgrFQ214RPSysEffectMgr12ECalcSetting = .text:0x80193584; // type:function size:0x7C
stopAllEffect__14RPSysEffectMgrFv = .text:0x80193600; // type:function size:0x9C
@@ -7942,7 +7942,7 @@ __ct__20RPGrpModelResManagerFv = .text:0x801AF184; // type:function size:0x10
__dt__20RPGrpModelResManagerFv = .text:0x801AF194; // type:function size:0x40
fn_801AF1D4 = .text:0x801AF1D4; // type:function size:0x4
fn_801AF1D8 = .text:0x801AF1D8; // type:function size:0x230
-fn_801AF408 = .text:0x801AF408; // type:function size:0x4
+PrepareDrawGX__9RPGrpViewFv = .text:0x801AF408; // type:function size:0x4
fn_801AF40C = .text:0x801AF40C; // type:function size:0x24
AppendDrawObject__13RPGrpRendererFP16IRPGrpDrawObject = .text:0x801AF430; // type:function size:0x24
fn_801AF454 = .text:0x801AF454; // type:function size:0x138
@@ -7971,42 +7971,42 @@ DrawQuad__11RPGrpScreenCFffff8_GXColor = .text:0x801B0378; // type:function size
BeginDrawQuad__11RPGrpScreenCFv = .text:0x801B03E8; // type:function size:0x1C
Initialize__11RPGrpScreenFPCUsPCUs = .text:0x801B0404; // type:function size:0xC
__sinit_\RPGrpScreen_cpp = .text:0x801B0410; // type:function size:0x5C scope:local
-fn_801B046C = .text:0x801B046C; // type:function size:0x734
-fn_801B0BA0 = .text:0x801B0BA0; // type:function size:0x150
-fn_801B0CF0 = .text:0x801B0CF0; // type:function size:0x184
-fn_801B0E74 = .text:0x801B0E74; // type:function size:0x8
-fn_801B0E7C = .text:0x801B0E7C; // type:function size:0x60
-fn_801B0EDC = .text:0x801B0EDC; // type:function size:0x18
-fn_801B0EF4 = .text:0x801B0EF4; // type:function size:0xC4
-fn_801B0FB8 = .text:0x801B0FB8; // type:function size:0xC4
-fn_801B107C = .text:0x801B107C; // type:function size:0x14C
-fn_801B11C8 = .text:0x801B11C8; // type:function size:0x10
-fn_801B11D8 = .text:0x801B11D8; // type:function size:0x1BC
-fn_801B1394 = .text:0x801B1394; // type:function size:0x40
-fn_801B13D4 = .text:0x801B13D4; // type:function size:0x40
-fn_801B1414 = .text:0x801B1414; // type:function size:0xC4
-fn_801B14D8 = .text:0x801B14D8; // type:function size:0x4
-fn_801B14DC = .text:0x801B14DC; // type:function size:0x58
-fn_801B1534 = .text:0x801B1534; // type:function size:0x40
-fn_801B1574 = .text:0x801B1574; // type:function size:0x40
-fn_801B15B4 = .text:0x801B15B4; // type:function size:0x8
-fn_801B15BC = .text:0x801B15BC; // type:function size:0x28
-fn_801B15E4 = .text:0x801B15E4; // type:function size:0x40
-fn_801B1624 = .text:0x801B1624; // type:function size:0x48
-fn_801B166C = .text:0x801B166C; // type:function size:0x4
-fn_801B1670 = .text:0x801B1670; // type:function size:0x4
-fn_801B1674 = .text:0x801B1674; // type:function size:0x44
-fn_801B16B8 = .text:0x801B16B8; // type:function size:0x40
-fn_801B16F8 = .text:0x801B16F8; // type:function size:0x8
-fn_801B1700 = .text:0x801B1700; // type:function size:0x10
-fn_801B1710 = .text:0x801B1710; // type:function size:0x30
-fn_801B1740 = .text:0x801B1740; // type:function size:0x38
-fn_801B1778 = .text:0x801B1778; // type:function size:0xD8
-fn_801B1850 = .text:0x801B1850; // type:function size:0x6C
-fn_801B18BC = .text:0x801B18BC; // type:function size:0x8
-fn_801B18C4 = .text:0x801B18C4; // type:function size:0x4C
-fn_801B1910 = .text:0x801B1910; // type:function size:0x40
-fn_801B1950 = .text:0x801B1950; // type:function size:0x8
+Draw__Q29RPGrpView12ScreenEffectFPC11RPGrpScreen = .text:0x801B046C; // type:function size:0x734
+Calc__Q29RPGrpView7ClipperFPC11RPGrpScreen = .text:0x801B0BA0; // type:function size:0x150
+Clip__9RPGrpViewCFRCQ34nw4r4math4VEC3f = .text:0x801B0CF0; // type:function size:0x184
+GetCamera__9RPGrpViewCFv = .text:0x801B0E74; // type:function size:0x8
+GetEnableCamera__9RPGrpViewCFv = .text:0x801B0E7C; // type:function size:0x60
+GetEnableScreen__9RPGrpViewCFv = .text:0x801B0EDC; // type:function size:0x18
+GetScreenToWorld__9RPGrpViewCFPQ34nw4r4math4VEC3RCQ34nw4r4math4VEC2 = .text:0x801B0EF4; // type:function size:0xC4
+GetWorldToScreen__9RPGrpViewCFPQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3 = .text:0x801B0FB8; // type:function size:0xC4
+SetProjectionGX__9RPGrpViewCFv = .text:0x801B107C; // type:function size:0x14C
+AttachScreen__9RPGrpViewFP11RPGrpScreen = .text:0x801B11C8; // type:function size:0x10
+ClearBuffer__9RPGrpViewFv = .text:0x801B11D8; // type:function size:0x1BC
+PrepareDraw__9RPGrpViewFv = .text:0x801B1394; // type:function size:0x40
+Calc__9RPGrpViewFv = .text:0x801B13D4; // type:function size:0x40
+CreateScreenEffect__9RPGrpViewFv = .text:0x801B1414; // type:function size:0xC4
+Configure__9RPGrpViewFv = .text:0x801B14D8; // type:function size:0x4
+__ct__9RPGrpViewFUc = .text:0x801B14DC; // type:function size:0x58
+__dt__Q29RPGrpView12ScreenEffectFv = .text:0x801B1534; // type:function size:0x40
+__dt__9RPGrpViewFv = .text:0x801B1574; // type:function size:0x40
+AttachCamera__9RPGrpViewFP11RPGrpCamera = .text:0x801B15B4; // type:function size:0x8
+__sinit_\RPGrpView_cpp = .text:0x801B15BC; // type:function size:0x28
+__dt__Q29RPGrpView7ClipperFv = .text:0x801B15E4; // type:function size:0x40
+Draw__17RPGrpViewRender2DFv = .text:0x801B1624; // type:function size:0x48
+PrepareDraw__17RPGrpViewRender2DFv = .text:0x801B166C; // type:function size:0x4
+Configure__17RPGrpViewRender2DFv = .text:0x801B1670; // type:function size:0x4
+__ct__17RPGrpViewRender2DFUc = .text:0x801B1674; // type:function size:0x44
+__dt__17RPGrpViewRender2DFv = .text:0x801B16B8; // type:function size:0x40 scope:weak
+GetType__17RPGrpViewRender2DCFv = .text:0x801B16F8; // type:function size:0x8 scope:weak
+AttachCamera__17RPGrpViewRender3DFP11RPGrpCamera = .text:0x801B1700; // type:function size:0x10
+PrepareDrawGX__17RPGrpViewRender3DFv = .text:0x801B1710; // type:function size:0x30
+Draw__17RPGrpViewRender3DFv = .text:0x801B1740; // type:function size:0x38
+PrepareDraw__17RPGrpViewRender3DFv = .text:0x801B1778; // type:function size:0xD8
+Calc__17RPGrpViewRender3DFv = .text:0x801B1850; // type:function size:0x6C
+GetCamera__17RPGrpViewRender3DCFv = .text:0x801B18BC; // type:function size:0x8 scope:weak
+__ct__17RPGrpViewRender3DFUc = .text:0x801B18C4; // type:function size:0x4C
+__dt__17RPGrpViewRender3DFv = .text:0x801B1910; // type:function size:0x40 scope:weak
+GetType__17RPGrpViewRender3DCFv = .text:0x801B1950; // type:function size:0x8 scope:weak
fn_801B1958 = .text:0x801B1958; // type:function size:0x98
fn_801B19F0 = .text:0x801B19F0; // type:function size:0x24
fn_801B1A14 = .text:0x801B1A14; // type:function size:0x80
@@ -8014,7 +8014,7 @@ fn_801B1A94 = .text:0x801B1A94; // type:function size:0x18
fn_801B1AAC = .text:0x801B1AAC; // type:function size:0x14
fn_801B1AC0 = .text:0x801B1AC0; // type:function size:0x14
fn_801B1AD4 = .text:0x801B1AD4; // type:function size:0x120
-fn_801B1BF4 = .text:0x801B1BF4; // type:function size:0x50
+DrawPrepare__15RPGrpModelSceneFPC11RPGrpCameraPC11RPGrpScreen = .text:0x801B1BF4; // type:function size:0x50
fn_801B1C44 = .text:0x801B1C44; // type:function size:0x40
fn_801B1C84 = .text:0x801B1C84; // type:function size:0x100
fn_801B1D84 = .text:0x801B1D84; // type:function size:0x38
@@ -8317,8 +8317,8 @@ fn_801BF564 = .text:0x801BF564; // type:function size:0x80
fn_801BF5E4 = .text:0x801BF5E4; // type:function size:0x74
fn_801BF658 = .text:0x801BF658; // type:function size:0x6C
fn_801BF6C4 = .text:0x801BF6C4; // type:function size:0x30C
-drawShadow__17RPUtlShadowDrawerFRCQ217RPUtlShadowDrawer3Arg = .text:0x801BF9D0; // type:function size:0x88
-fn_801BFA58 = .text:0x801BFA58; // type:function size:0x88
+drawShadow__17RPUtlShadowDrawerFv = .text:0x801BF9D0; // type:function size:0x88
+initMtx__17RPUtlShadowDrawerCFv = .text:0x801BFA58; // type:function size:0x88
__sinit_\RPUtlShadowDrawer_cpp = .text:0x801BFAE0; // type:function size:0x4
fn_801BFAE4 = .text:0x801BFAE4; // type:function size:0xC
fn_801BFAF0 = .text:0x801BFAF0; // type:function size:0x5C
@@ -8450,7 +8450,7 @@ fn_801C389C = .text:0x801C389C; // type:function size:0x1C
fn_801C38B8 = .text:0x801C38B8; // type:function size:0x114
fn_801C39CC = .text:0x801C39CC; // type:function size:0x18
fn_801C39E4 = .text:0x801C39E4; // type:function size:0x4
-fn_801C39E8 = .text:0x801C39E8; // type:function size:0xD0
+beginDrawLine__12RPUtlLytBaseF8_GXColorUsUc = .text:0x801C39E8; // type:function size:0xD0
fn_801C3AB8 = .text:0x801C3AB8; // type:function size:0x4
fn_801C3ABC = .text:0x801C3ABC; // type:function size:0x14
fn_801C3AD0 = .text:0x801C3AD0; // type:function size:0xC4
@@ -12179,13 +12179,13 @@ fn_8028E7BC = .text:0x8028E7BC; // type:function size:0x58
fn_8028E814 = .text:0x8028E814; // type:function size:0x44
fn_8028E858 = .text:0x8028E858; // type:function size:0x4C
fn_8028E8A4 = .text:0x8028E8A4; // type:function size:0x5C
-fn_8028E900 = .text:0x8028E900; // type:function size:0x58
-fn_8028E958 = .text:0x8028E958; // type:function size:0x44
-fn_8028E99C = .text:0x8028E99C; // type:function size:0x1C
+createModel__20RPGolResourceManagerFPCcQ220RPGolResourceManager8EArchive = .text:0x8028E900; // type:function size:0x58
+checkFile__20RPGolResourceManagerFPCcQ220RPGolResourceManager8EArchive = .text:0x8028E958; // type:function size:0x44
+hasFile__20RPGolResourceManagerFPCcQ220RPGolResourceManager8EArchive = .text:0x8028E99C; // type:function size:0x1C
fn_8028E9B8 = .text:0x8028E9B8; // type:function size:0x50
-fn_8028EA08 = .text:0x8028EA08; // type:function size:0x40
-fn_8028EA48 = .text:0x8028EA48; // type:function size:0x44
-fn_8028EA8C = .text:0x8028EA8C; // type:function size:0x54
+__dt__20RPGolResourceManagerFv = .text:0x8028EA08; // type:function size:0x40
+DestroyInstance__20RPGolResourceManagerFv = .text:0x8028EA48; // type:function size:0x44
+CreateInstance__20RPGolResourceManagerFv = .text:0x8028EA8C; // type:function size:0x54
fn_8028EAE0 = .text:0x8028EAE0; // type:function size:0x1C
fn_8028EAFC = .text:0x8028EAFC; // type:function size:0x24
fn_8028EB20 = .text:0x8028EB20; // type:function size:0xAC
@@ -15607,7 +15607,8 @@ lbl_80386F38 = .rodata:0x80386F38; // type:object size:0x10 data:4byte
lbl_80386F48 = .rodata:0x80386F48; // type:object size:0xA data:string
lbl_80386F52 = .rodata:0x80386F52; // type:object size:0xA data:string
lbl_80386F5C = .rodata:0x80386F5C; // type:object size:0xA data:string
-lbl_80386F66 = .rodata:0x80386F66; // type:object size:0xA2
+lbl_80386F66 = .rodata:0x80386F66; // type:object size:0x9E
+lbl_80387004 = .rodata:0x80387004; // type:object size:0x4 data:4byte
lbl_80387008 = .rodata:0x80387008; // type:object size:0x90 data:4byte
lbl_80387098 = .rodata:0x80387098; // type:object size:0x90 data:4byte
lbl_80387128 = .rodata:0x80387128; // type:object size:0x40 data:4byte
@@ -17240,8 +17241,8 @@ __vt__Q23EGG13ModelSnapshot = .data:0x80397C30; // type:object size:0x20 scope:g
@STRING@getShapeSphere__Q23EGG17ModelBoundingInfoCFv = .data:0x80397C5C; // type:object size:0x17 scope:weak data:string
@11930 = .data:0x80397C78; // type:object size:0x28 scope:local
__vt__Q23EGG14PostEffectBase = .data:0x80397CA0; // type:object size:0x24 scope:global
-lbl_80397CC8 = .data:0x80397CC8; // type:object size:0x10 data:string
-lbl_80397CD8 = .data:0x80397CD8; // type:object size:0xD data:string
+@STRING@SetProjectionType__Q23EGG7FrustumFQ33EGG7Frustum14ProjectionType@0 = .data:0x80397CC8; // type:object size:0x10 data:string
+@STRING@SetProjectionType__Q23EGG7FrustumFQ33EGG7Frustum14ProjectionType = .data:0x80397CD8; // type:object size:0xD data:string
lbl_80397CE8 = .data:0x80397CE8; // type:object size:0x28
lbl_80397D10 = .data:0x80397D10; // type:object size:0x28
lbl_80397D38 = .data:0x80397D38; // type:object size:0x28
@@ -18565,7 +18566,7 @@ __vt__18RPSysStringTagParm = .data:0x803B9828; // type:object size:0x14 scope:gl
__vt__12RPSysTagParm = .data:0x803B983C; // type:object size:0x14 scope:global
STATIC_DIR_NAMES__20RPSysResourceManager = .data:0x803B9850; // type:object size:0x10 scope:global
__vt__20RPSysResourceManager = .data:0x803B9860; // type:object size:0x10 scope:global
-__vt__16RPSysQueuedScene = .data:0x803B9870; // type:object size:0x10 scope:global
+__vt__16RPSysQueuedScene = .data:0x803B9870; // type:object size:0xC scope:global
__vt__17RPSysCommonObject = .data:0x803B9880; // type:object size:0x14 scope:global
__vt__11RPGrpScreen = .data:0x803B9894; // type:object size:0x14 scope:global
LANGUAGE_ENG__14RPSysDvdStatus = .data:0x803B98A8; // type:object size:0x10
@@ -18676,8 +18677,8 @@ lbl_803BA5B0 = .data:0x803BA5B0; // type:object size:0xD data:string
lbl_803BA5C0 = .data:0x803BA5C0; // type:object size:0x2C
lbl_803BA5EC = .data:0x803BA5EC; // type:object size:0xC
lbl_803BA5F8 = .data:0x803BA5F8; // type:object size:0x10
-lbl_803BA608 = .data:0x803BA608; // type:object size:0x30
-lbl_803BA638 = .data:0x803BA638; // type:object size:0x30
+__vt__17RPGrpViewRender2D = .data:0x803BA608; // type:object size:0x2C
+__vt__17RPGrpViewRender3D = .data:0x803BA638; // type:object size:0x2C
lbl_803BA668 = .data:0x803BA668; // type:object size:0x10
lbl_803BA678 = .data:0x803BA678; // type:object size:0x20
lbl_803BA698 = .data:0x803BA698; // type:object size:0x28
@@ -18759,7 +18760,9 @@ lbl_803C1C60 = .data:0x803C1C60; // type:object size:0x10
lbl_803C1C70 = .data:0x803C1C70; // type:object size:0x30
lbl_803C1CA0 = .data:0x803C1CA0; // type:object size:0x10
lbl_803C1CB0 = .data:0x803C1CB0; // type:object size:0x20
-lbl_803C1CD0 = .data:0x803C1CD0; // type:object size:0x48
+lbl_803C1CD0 = .data:0x803C1CD0; // type:object size:0x2C
+lbl_803C1CFC = .data:0x803C1CFC; // type:object size:0x4
+lbl_803C1D00 = .data:0x803C1D00; // type:object size:0x18
lbl_803C1D18 = .data:0x803C1D18; // type:object size:0x10
jumptable_803C1D28 = .data:0x803C1D28; // type:object size:0x1C scope:local
gap_08_803C1D44_data = .data:0x803C1D44; // type:object size:0x4 scope:global
@@ -18768,8 +18771,10 @@ lbl_803C1D68 = .data:0x803C1D68; // type:object size:0x10
lbl_803C1D78 = .data:0x803C1D78; // type:object size:0x180
lbl_803C1EF8 = .data:0x803C1EF8; // type:object size:0x50
lbl_803C1F48 = .data:0x803C1F48; // type:object size:0x30
-__vt__14RPSysBootScene = .data:0x803C1F78; // type:object size:0x60
-__vt__22RPSysPlayerSelectScene = .data:0x803C1FD8; // type:object size:0x60
+lbl_803C1F78 = .data:0x803C1F78; // type:object size:0x28
+lbl_803C1FA0 = .data:0x803C1FA0; // type:object size:0x38
+lbl_803C1FD8 = .data:0x803C1FD8; // type:object size:0x28
+lbl_803C2000 = .data:0x803C2000; // type:object size:0x38
lbl_803C2038 = .data:0x803C2038; // type:object size:0xC
lbl_803C2044 = .data:0x803C2044; // type:object size:0x22 data:string
lbl_803C2068 = .data:0x803C2068; // type:object size:0x12 data:string
@@ -19154,7 +19159,7 @@ __vt__10RPGolScene = .data:0x803C7718; // type:object size:0x80
lbl_803C7798 = .data:0x803C7798; // type:object size:0x10
lbl_803C77A8 = .data:0x803C77A8; // type:object size:0xC
lbl_803C77B4 = .data:0x803C77B4; // type:object size:0xC
-lbl_803C77C0 = .data:0x803C77C0; // type:object size:0x10
+__vt__20RPGolResourceManager = .data:0x803C77C0; // type:object size:0xC
lbl_803C77D0 = .data:0x803C77D0; // type:object size:0xC
lbl_803C77DC = .data:0x803C77DC; // type:object size:0xC
lbl_803C77E8 = .data:0x803C77E8; // type:object size:0x10
@@ -21862,7 +21867,7 @@ spInstance__13RPSysSceneMgr = .sbss:0x804BF4D8; // type:object size:0x4 data:4by
spInstance__17RPSysProjectLocal = .sbss:0x804BF4E0; // type:object size:0x4 data:4byte
spInstance__15RPSysGameConfig = .sbss:0x804BF4E8; // type:object size:0x4 data:4byte
spInstance__20RPSysResourceManager = .sbss:0x804BF4F0; // type:object size:0x8 data:4byte
-lbl_804BF4F8 = .sbss:0x804BF4F8; // type:object size:0x8 data:4byte
+spInstance__16RPSysQueuedScene = .sbss:0x804BF4F8; // type:object size:0x4 data:4byte
spInstance__14RPSysDvdStatus = .sbss:0x804BF500; // type:object size:0x4 data:4byte
spInstance__16RPSysSaveDataMgr = .sbss:0x804BF508; // type:object size:0x8 data:4byte
spInstance__16RPSysFontManager = .sbss:0x804BF510; // type:object size:0x8 data:4byte
@@ -21903,7 +21908,7 @@ spCalcModel__10RPGrpModel = .sbss:0x804BF5E0; // type:object size:0x4 data:4byte
spCalcWorldMtxArray__10RPGrpModel = .sbss:0x804BF5E4; // type:object size:0x4 data:4byte
spCalcViewMtxArray__10RPGrpModel = .sbss:0x804BF5E8; // type:object size:0x4 data:4byte
lbl_804BF5F0 = .sbss:0x804BF5F0; // type:object size:0x8 data:byte
-lbl_804BF5F8 = .sbss:0x804BF5F8; // type:object size:0x8 data:4byte
+spCurrent__17RPGrpModelManager = .sbss:0x804BF5F8; // type:object size:0x8 data:4byte
spCurrent__20RPGrpModelResManager = .sbss:0x804BF600; // type:object size:0x8 data:4byte
lbl_804BF608 = .sbss:0x804BF608; // type:object size:0x8 data:4byte
spCurrent__13RPGrpRenderer = .sbss:0x804BF610; // type:object size:0x4 data:4byte
@@ -22044,7 +22049,7 @@ gap_11_804BF83D_sbss = .sbss:0x804BF83D; // type:object size:0x3 scope:global
lbl_804BF840 = .sbss:0x804BF840; // type:object size:0x8 data:4byte
lbl_804BF848 = .sbss:0x804BF848; // type:object size:0x8 data:byte
lbl_804BF850 = .sbss:0x804BF850; // type:object size:0x8 data:4byte
-lbl_804BF858 = .sbss:0x804BF858; // type:object size:0x8 data:4byte
+spInstance__20RPGolResourceManager = .sbss:0x804BF858; // type:object size:0x4 data:4byte
lbl_804BF860 = .sbss:0x804BF860; // type:object size:0x8 data:4byte
lbl_804BF868 = .sbss:0x804BF868; // type:object size:0x4 data:4byte
lbl_804BF86C = .sbss:0x804BF86C; // type:object size:0x4 align:4 data:float
diff --git a/configure.py b/configure.py
index 40db118c9..b89279eb2 100755
--- a/configure.py
+++ b/configure.py
@@ -1228,7 +1228,7 @@ def MatchingFor(*versions):
Object(NonMatching, "Pack/RPSystem/RPSysLoadScene.cpp"),
Object(NonMatching, "Pack/RPSystem/RP_80186E40.cpp"),
Object(NonMatching, "Pack/RPSystem/RPSysResourceManager.cpp"),
- Object(NonMatching, "Pack/RPSystem/RPSysQueuedScene.cpp"),
+ Object(Matching, "Pack/RPSystem/RPSysQueuedScene.cpp"),
Object(NonMatching, "Pack/RPSystem/RPSysCommonObject.cpp"),
Object(Matching, "Pack/RPSystem/RPSysDvdStatus.cpp"),
Object(NonMatching, "Pack/RPSystem/RPSysSaveDataMgr.cpp"),
@@ -1262,8 +1262,8 @@ def MatchingFor(*versions):
Object(NonMatching, "Pack/RPGraphics/RPGrpRenderer.cpp"),
Object(Matching, "Pack/RPGraphics/RPGrpScreen.cpp"),
Object(NonMatching, "Pack/RPGraphics/RPGrpView.cpp"),
- Object(NonMatching, "Pack/RPGraphics/RPGrpViewRender2D.cpp"),
- Object(NonMatching, "Pack/RPGraphics/RPGrpViewRender3D.cpp"),
+ Object(Matching, "Pack/RPGraphics/RPGrpViewRender2D.cpp"),
+ Object(Matching, "Pack/RPGraphics/RPGrpViewRender3D.cpp"),
Object(NonMatching, "Pack/RPGraphics/RPGrpModelScene.cpp"),
Object(NonMatching, "Pack/RPGraphics/RPGrpDrawPathLightMap.cpp"),
Object(Matching, "Pack/RPGraphics/RPGrpModelBoundingInfo.cpp"),
@@ -1314,9 +1314,29 @@ def MatchingFor(*versions):
Object(Matching, "Pack/RPUtility/RPUtlRandom.cpp"),
Object(NonMatching, "Pack/RPUtility/RPUtlMath.cpp"),
Object(NonMatching, "Pack/RPUtility/RPUtlMapData.cpp"),
- Object(NonMatching, "Pack/RPUtility/RPUtlShadowDrawer.cpp"),
+ Object(Matching, "Pack/RPUtility/RPUtlShadowDrawer.cpp"),
Object(NonMatching, "Pack/RPUtility/RPUtlObject.cpp"),
- Object(NonMatching, "Pack/RPUtility_unsplit.o"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801BFEA8.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801C0D90.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlKokeshi.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlResourceManager.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlModelDebug.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlDohGraphSun.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlDebugStub1.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlDebugStub2.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlDebugStub3.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPSportsUtlModel_unsplit.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlLytBase.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlLyt.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801C4704.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801C4828.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlBaseSequence.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801C4B7C.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPSportsUtlModelRigid.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801C67B8.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlLytFrameCursor.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtl_801C9E7C.cpp"),
+ Object(NonMatching, "Pack/RPUtility/RPUtlLoadSaveDataScene.cpp"),
],
},
{
@@ -1325,6 +1345,30 @@ def MatchingFor(*versions):
"cflags": cflags_rp_pch,
"progress_category": "sports", # str | List[str]
"objects": [
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801CCB70.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801CD384.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801CDD90.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsAppMiiManager.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801CE7F8.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsKokeshiLyt.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsKokeshiLytDebug.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsButtonA.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801D1408.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsBodyManager.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysBootScene.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysPlayerSelectScene.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsMenuBgModel.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysLytMenuFrame.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysKokeshiHead.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysKokeshiMgr.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysLytRimoconEntry.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysLytPlayerSelect.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801DF984.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSysNunchukCheckScene.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPPartyMenuBgModel.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801E51B4.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsStaticMem.cpp"),
+ Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSports_801E7EB4.cpp"),
Object(NonMatching, "Pack/RPSports/RPSportsCommon/RPSportsCommon_unsplit.o"),
],
},
diff --git a/include/Pack/RPGraphics.h b/include/Pack/RPGraphics.h
index 75160af7b..87c6b3d33 100644
--- a/include/Pack/RPGraphics.h
+++ b/include/Pack/RPGraphics.h
@@ -27,11 +27,14 @@
#include
#include
#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+#include
#endif
diff --git a/include/Pack/RPGraphics/RPGrpModelManager.h b/include/Pack/RPGraphics/RPGrpModelManager.h
index 92e4e2549..6a3f8aacf 100644
--- a/include/Pack/RPGraphics/RPGrpModelManager.h
+++ b/include/Pack/RPGraphics/RPGrpModelManager.h
@@ -7,11 +7,16 @@
// Forward declarations
class RPGrpDrawPathManager;
+class RPGrpModelScene;
/**
* @brief Model manager
*/
class RPGrpModelManager {
+public:
+ //! Maximum number of model scenes
+ static const int MAX_SCENE = 8;
+
public:
/**
* @brief Gets the currently active manager instance
@@ -22,9 +27,16 @@ class RPGrpModelManager {
RPGrpDrawPathManager* GetDrawPathManager(u8 drawScene) const;
+ RPGrpModelScene* GetModelScene(int i) {
+ return mpModelScenes[i];
+ }
+
private:
//! Allocator used for model-related allocations
static RPGrpModelManager* spCurrent;
+
+ //! Model scenes
+ RPGrpModelScene* mpModelScenes[MAX_SCENE]; // at 0x4
};
//! @}
diff --git a/include/Pack/RPGraphics/RPGrpModelScene.h b/include/Pack/RPGraphics/RPGrpModelScene.h
new file mode 100644
index 000000000..2f4fed433
--- /dev/null
+++ b/include/Pack/RPGraphics/RPGrpModelScene.h
@@ -0,0 +1,32 @@
+#ifndef RP_GRAPHICS_MODEL_SCENE_H
+#define RP_GRAPHICS_MODEL_SCENE_H
+#include
+
+//! @addtogroup rp_graphics
+//! @{
+
+// Forward declarations
+class RPGrpCamera;
+class RPGrpScreen;
+
+/**
+ * @brief Model rendering scene
+ */
+class RPGrpModelScene {
+private:
+ char unk00[0xA4];
+
+public:
+ virtual ~RPGrpModelScene(); // at 0x8
+ virtual void CalcView(); // at 0xC
+ virtual void CalcDrawList(); // at 0x10
+ virtual void Draw(); // at 0x14
+ virtual void DrawFinish(); // at 0x18
+ virtual void PreConditionForRenderingGX() const; // at 0x1C
+
+ void DrawPrepare(const RPGrpCamera* pCamera, const RPGrpScreen* pScreen);
+};
+
+//! @}
+
+#endif
diff --git a/include/Pack/RPGraphics/RPGrpRenderer.h b/include/Pack/RPGraphics/RPGrpRenderer.h
index 3f89e4912..24fd2ed83 100644
--- a/include/Pack/RPGraphics/RPGrpRenderer.h
+++ b/include/Pack/RPGraphics/RPGrpRenderer.h
@@ -36,7 +36,7 @@ class RPGrpRenderer {
}
RPGrpView* GetView(int idx) const {
- return mDrawViews[idx];
+ return mpDrawViews[idx];
}
/**
@@ -78,7 +78,7 @@ class RPGrpRenderer {
char unk0[0xC];
IRPGrpDrawObject* mpDrawList; // at 0xC
char unk10[0x14 - 0x10];
- RPGrpView* mDrawViews[MAX_VIEW]; // at 0x14
+ RPGrpView* mpDrawViews[MAX_VIEW]; // at 0x14
};
//! @}
diff --git a/include/Pack/RPGraphics/RPGrpView.h b/include/Pack/RPGraphics/RPGrpView.h
index 433a7f627..b6029061b 100644
--- a/include/Pack/RPGraphics/RPGrpView.h
+++ b/include/Pack/RPGraphics/RPGrpView.h
@@ -2,6 +2,10 @@
#define RP_GRAPHICS_VIEW_H
#include
+#include
+
+#include
+
//! @addtogroup rp_graphics
//! @{
@@ -9,42 +13,375 @@
class RPGrpCamera;
class RPGrpScreen;
+/**
+ * @brief Base class for renderer views
+ */
class RPGrpView {
public:
+ /**
+ * @brief View class type
+ */
+ enum EType {
+ EType_Render3D, //!< RPGrpViewRender3D
+ EType_Render2D, //!< RPGrpViewRender2D
+ };
+
+ /**
+ * @brief Projection type
+ */
enum EProjType {
- EProjType_Persp,
- EProjType_Ortho,
+ EProjType_Persp, //!< Perspective
+ EProjType_Ortho, //!< Orthographic
EProjType_Max,
};
+ /**
+ * @brief View clipper
+ */
+ class Clipper {
+ private:
+ //! Left clipping plane
+ nw4r::math::VEC3 l; // at 0x0
+ //! Top clipping plane
+ nw4r::math::VEC3 t; // at 0xC
+ //! Right clipping plane
+ nw4r::math::VEC3 r; // at 0x18
+ //! Bottom clipping plane
+ nw4r::math::VEC3 b; // at 0x24
+
+ char unk30[0x48 - 0x30];
+
+ public:
+ /**
+ * @brief Destructor
+ */
+ virtual ~Clipper() {} // at 0x8
+
+ /**
+ * @brief Re-calculates this clipper's clipping planes
+ *
+ * @param pScreen Screen rendering surface
+ */
+ void Calc(const RPGrpScreen* pScreen) DECOMP_DONT_INLINE;
+
+ /**
+ * @brief Tests whether the specified bounding sphere falls within the
+ * view frustum
+ *
+ * @param pScreen Screen rendering surface
+ * @param rPos Bounding sphere position
+ * @param radius Bounding sphere radius
+ */
+ bool Clip(const RPGrpScreen* pScreen, const nw4r::math::VEC3& rPos,
+ f32 radius);
+ };
+
+ /**
+ * @brief Screen post-effect
+ */
+ class ScreenEffect {
+ private:
+ //! Color to apply through multiply blending
+ GXColor mColorMultiply; // at 0x0
+ //! Color to apply through addition blending
+ GXColor mColorAdd; // at 0x4
+ //! Color to apply through normal blending
+ GXColor mColorBlend; // at 0x8
+
+ //! Blur effect horizontal offset
+ f32 mBlurOffset; // at 0xC
+ //! Blur effect transparency
+ u8 mBlurAlpha; // at 0x10
+
+ public:
+ /**
+ * @brief Constructor
+ */
+ ScreenEffect();
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~ScreenEffect() {} // at 0x8
+
+ /**
+ * @brief Draws this effect to the specified screen
+ *
+ * @param pScreen Screen rendering surface
+ */
+ void Draw(const RPGrpScreen* pScreen);
+
+ /**
+ * @brief Sets the color applied through multiply blending
+ *
+ * @param rColor Multiply color
+ */
+ void SetColorMultiply(const GXColor& rColor) {
+ mColorMultiply = rColor;
+ }
+
+ /**
+ * @brief Sets the color applied through addition blending
+ *
+ * @param rColor Addition color
+ */
+ void SetColorAdd(const GXColor& rColor) {
+ mColorAdd = rColor;
+ }
+
+ /**
+ * @brief Sets the color applied through normal blending
+ *
+ * @param rColor Normal blend color
+ */
+ void SetColorBlend(const GXColor& rColor) {
+ mColorBlend = rColor;
+ }
+
+ /**
+ * @brief Sets the horizontal offset of the blur effect's copies
+ *
+ * @param offset Horizontal offset
+ */
+ void SetBlurOffset(f32 offset) {
+ mBlurOffset = offset;
+ }
+
+ /**
+ * @brief Sets the transparency of the blur effect
+ *
+ * @param alpha Blur effect transparency
+ */
+ void SetBlurAlpha(u8 alpha) {
+ mBlurAlpha = alpha;
+ }
+ };
+
protected:
- u8 mViewNo; // at 0x0
+ /**
+ * @brief Renderer view flags
+ */
+ enum {
+ //! Update this view
+ EFlag_SysCalc = 1 << 0,
+ //! Update color when clearing the framebuffer
+ EFlag_FillBufferColor = 1 << 1,
+ //! Update alpha when clearing the framebuffer
+ EFlag_FillBufferAlpha = 1 << 2,
+ //! Update depth when clearing the framebuffer
+ EFlag_FillBufferTexture = 1 << 3,
+ //! Render this view
+ EFlag_SysDraw = 1 << 4,
+
+ EFlag_9 = 1 << 9,
+ };
+
+protected:
+ //! Renderer view ID
+ u8 mViewNo; // at 0x0
+ //! Model scene ID
u8 mDrawScene; // at 0x1
- char unk2[0x8 - 0x2];
+ char unk2[0x4 - 0x2];
+
+ //! Renderer view flags
+ u16 mFlags; // at 0x4
+
+ //! Projection type
EProjType mProjType; // at 0x8
- char unkC[0x10 - 0xC];
+ //! Framebuffer clear color
+ GXColor mClearColor; // at 0xC
+
+ //! Screen rendering surface
RPGrpScreen* mpScreen; // at 0x10
- char unk14[0x1C - 0x14];
+ u32 unk14;
+ //! Screen post-effect
+ ScreenEffect* mpScreenEffect; // at 0x18
+
+private:
+ //! Default framebuffer clear color
+ static GXColor DEFAULT_CLEAR_COLOR;
+
+ //! View clipper instance
+ static Clipper sClipper;
public:
- virtual ~RPGrpView(); // at 0x8
- virtual UNKTYPE VF_0xC(UNKTYPE) = 0; // at 0xC
- virtual void AttachCamera(RPGrpCamera* pCamera) = 0; // at 0x10
+ /**
+ * @brief Constructor
+ *
+ * @param no View ID
+ */
+ explicit RPGrpView(u8 no);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~RPGrpView() {} // at 0x8
+
+ /**
+ * @brief Gets the type of this view
+ */
+ virtual EType GetType() const = 0; // at 0xC
+
+ /**
+ * @brief Attaches a new camera to this view
+ *
+ * @param pCamera New camera
+ * @return Previously attached camera
+ */
+ virtual RPGrpCamera* AttachCamera(RPGrpCamera* /* pCamera */) { // at 0x10
+ return NULL;
+ }
+
+ /**
+ * @brief Gets the camera currently attached to this view
+ */
+ virtual RPGrpCamera* GetCamera() const { // at 0x14
+ return NULL;
+ }
+
+ /**
+ * @brief Initializes this view's state
+ */
+ virtual void Configure(); // at 0x18
+
+ /**
+ * @brief Updates this view's state
+ */
+ virtual void Calc(); // at 0x1C
+
+ /**
+ * @brief Prepares this view for a new frame
+ */
+ virtual void PrepareDraw(); // at 0x20
+
+ /**
+ * @brief Renders the contents of this view
+ */
+ virtual void Draw() = 0; // at 0x24
+
+ /**
+ * @brief Prepares this view for a new render pass
+ */
+ virtual void PrepareDrawGX() {
+ SetProjectionGX();
+ } // at 0x28
+
+ /**
+ * @brief Attaches a screen effect to this view
+ */
+ void CreateScreenEffect();
+
+ /**
+ * @brief Clears the framebuffer of the attached screen
+ */
+ void ClearBuffer();
+
+ /**
+ * @brief Attaches a new screen to this view
+ *
+ * @param pScreen Screen rendering surface
+ * @return Previously attached screen
+ */
+ RPGrpScreen* AttachScreen(RPGrpScreen* pScreen);
+ /**
+ * @brief Configures the GX projection matrix
+ */
+ void SetProjectionGX() const;
+
+ /**
+ * @brief Converts a position from world-space to screen-space
+ *
+ * @param[out] pScreenPos Position in screen-space
+ * @param rWorldPos Position in world-space
+ */
+ void GetWorldToScreen(nw4r::math::VEC3* pScreenPos,
+ const nw4r::math::VEC3& rWorldPos) const;
+
+ /**
+ * @brief Converts a position from screen-space to world-space
+ *
+ * @param[out] pWorldPos Position in world-space
+ * @param rScreenPos Position in screen-space
+ */
+ void GetScreenToWorld(nw4r::math::VEC3* pWorldPos,
+ const nw4r::math::VEC2& rScreenPos) const;
+
+ /**
+ * @brief Gets the screen used by this view.
+ * @details If no screen is attached, this function returns the root screen.
+ */
+ RPGrpScreen* GetEnableScreen() const;
+
+ /**
+ * @brief Gets the camera used by this view.
+ * @details If no camera is attached, this function returns the default
+ * camera.
+ */
+ RPGrpCamera* GetEnableCamera() const;
+
+ /**
+ * @brief Tests whether the specified bounding sphere falls within the
+ * view frustum
+ *
+ * @param pScreen Screen rendering surface
+ * @param rPos Bounding sphere position
+ * @param radius Bounding sphere radius
+ */
+ bool Clip(const nw4r::math::VEC3& rPos, f32 radius) const;
+
+ /**
+ * @brief Sets this view's model scene
+ *
+ * @param scene Model scene ID
+ */
void SetDrawScene(u8 scene) {
mDrawScene = scene;
}
+ /**
+ * @brief Tests whether this view should be updated
+ */
+ bool IsSysCalc() const {
+ return mFlags & EFlag_SysCalc;
+ }
+
+ /**
+ * @brief Tests whether this view should be rendered
+ */
+ bool IsSysDraw() const {
+ return mFlags & EFlag_SysDraw;
+ }
+
+ /**
+ * @brief Gets this view's projection type
+ *
+ * @return EProjType
+ */
EProjType GetProjType() const {
return mProjType;
}
+ /**
+ * @brief Get this view's framebuffer clear color
+ */
+ GXColor GetClearColor() const {
+ return mClearColor;
+ }
+
+ /**
+ * @brief Gets the screen attached to this view
+ */
RPGrpScreen* GetScreen() const {
return mpScreen;
}
-private:
- ;
+ /**
+ * @brief Gets this view's screen post-effect
+ */
+ ScreenEffect* GetScreenEffect() const {
+ return mpScreenEffect;
+ }
};
//! @}
diff --git a/include/Pack/RPGraphics/RPGrpViewRender2D.h b/include/Pack/RPGraphics/RPGrpViewRender2D.h
new file mode 100644
index 000000000..ed60df01c
--- /dev/null
+++ b/include/Pack/RPGraphics/RPGrpViewRender2D.h
@@ -0,0 +1,47 @@
+#ifndef RP_GRAPHICS_VIEW_RENDER_2D_H
+#define RP_GRAPHICS_VIEW_RENDER_2D_H
+#include
+
+#include
+
+//! @addtogroup rp_graphics
+//! @{
+
+/**
+ * @brief Renderer view for 2D graphics
+ */
+class RPGrpViewRender2D : public RPGrpView {
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param no View ID
+ */
+ explicit RPGrpViewRender2D(u8 no);
+
+ /**
+ * @brief Gets the type of this view
+ */
+ virtual EType GetType() const override { // at 0xC
+ return EType_Render2D;
+ }
+
+ /**
+ * @brief Initializes this view's state
+ */
+ virtual void Configure() override; // at 0x18
+
+ /**
+ * @brief Prepares this view for a new frame
+ */
+ virtual void PrepareDraw() override; // at 0x20
+
+ /**
+ * @brief Renders the contents of this view
+ */
+ virtual void Draw() override; // at 0x24
+};
+
+//! @}
+
+#endif
diff --git a/include/Pack/RPGraphics/RPGrpViewRender3D.h b/include/Pack/RPGraphics/RPGrpViewRender3D.h
new file mode 100644
index 000000000..8eb316e79
--- /dev/null
+++ b/include/Pack/RPGraphics/RPGrpViewRender3D.h
@@ -0,0 +1,76 @@
+#ifndef RP_GRAPHICS_VIEW_RENDER_3D_H
+#define RP_GRAPHICS_VIEW_RENDER_3D_H
+#include
+
+#include
+
+//! @addtogroup rp_graphics
+//! @{
+
+// Forward declarations
+class RPGrpCamera;
+
+/**
+ * @brief Renderer view for 3D graphics
+ */
+class RPGrpViewRender3D : public RPGrpView {
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param no View ID
+ */
+ explicit RPGrpViewRender3D(u8 no);
+
+ /**
+ * @brief Gets the type of this view
+ */
+ virtual EType GetType() const override { // at 0xC
+ return EType_Render3D;
+ }
+
+ /**
+ * @brief Attaches a new camera to this view
+ *
+ * @param pCamera New camera
+ * @return Previously attached camera
+ */
+ virtual RPGrpCamera* AttachCamera(RPGrpCamera* pCamera) override;
+
+ /**
+ * @brief Gets the camera currently attached to this view
+ */
+ virtual RPGrpCamera* GetCamera() const override { // at 0x14
+ return mpCamera;
+ }
+
+ /**
+ * @brief Updates this view's state
+ */
+ virtual void Calc() override; // at 0x1C
+
+ /**
+ * @brief Prepares this view for a new frame
+ */
+ virtual void PrepareDraw() override; // at 0x20
+
+ /**
+ * @brief Renders the contents of this view
+ */
+ virtual void Draw() override; // at 0x24
+
+ /**
+ * @brief Prepares this view for a new render pass
+ */
+ virtual void PrepareDrawGX() override; // at 0x28
+
+private:
+ //! Camera attached to this view
+ RPGrpCamera* mpCamera; // at 0x20
+
+ u8 unk24;
+};
+
+//! @}
+
+#endif
diff --git a/include/Pack/RPKernel/RPSysEffectCreator.h b/include/Pack/RPKernel/RPSysEffectCreator.h
index 91ba2fc95..e2e288b62 100644
--- a/include/Pack/RPKernel/RPSysEffectCreator.h
+++ b/include/Pack/RPKernel/RPSysEffectCreator.h
@@ -150,9 +150,10 @@ class RPSysEffectCreator : public EGG::Disposer {
RPSysEffectMemoryManager* mpMemoryManager; // at 0x30
//! Emitter parameter save buffers
- nw4r::ef::EmitterParameter* mEmitterParamSave[ESaveBuffer_Max]; // at 0x34
+ nw4r::ef::EmitterParameter* mpEmitterParamSave[ESaveBuffer_Max]; // at 0x34
//! Particle parameter save buffers
- nw4r::ef::ParticleParameter* mParticleParamSave[ESaveBuffer_Max]; // at 0x3C
+ nw4r::ef::ParticleParameter*
+ mpParticleParamSave[ESaveBuffer_Max]; // at 0x3C
};
//! @}
diff --git a/include/Pack/RPKernel/RPSysEffectMgr.h b/include/Pack/RPKernel/RPSysEffectMgr.h
index bd5a85d03..8af7feac9 100644
--- a/include/Pack/RPKernel/RPSysEffectMgr.h
+++ b/include/Pack/RPKernel/RPSysEffectMgr.h
@@ -123,12 +123,11 @@ class RPSysEffectMgr : public IRPSysHostIOSocket {
/**
* @brief Draws the specified set of effects
*
- * @param rDrawInfo Graphics configuration
+ * @param rViewMtx View matrix
* @param drawGroup Effect draw group
* @param drawScene Effect draw scene
*/
- void draw(const nw4r::ef::DrawInfo& rDrawInfo, u32 drawGroup,
- u32 drawScene);
+ void draw(const nw4r::math::MTX34& rViewMtx, u32 drawGroup, u32 drawScene);
/**
* @brief Creates an instance of the specified effect
diff --git a/include/Pack/RPSports/RPGolScene.h b/include/Pack/RPSports/RPGolScene.h
index fbcb80f80..6f7ce6b90 100644
--- a/include/Pack/RPSports/RPGolScene.h
+++ b/include/Pack/RPSports/RPGolScene.h
@@ -1,6 +1,8 @@
#ifndef RP_PUBLIC_SPORTS_GOL_H
#define RP_PUBLIC_SPORTS_GOL_H
+#include
+#include
#include
#include
diff --git a/include/Pack/RPSports/RPGolScene/RPGolCamera.h b/include/Pack/RPSports/RPGolScene/RPGolCamera.h
new file mode 100644
index 000000000..32fec989e
--- /dev/null
+++ b/include/Pack/RPSports/RPGolScene/RPGolCamera.h
@@ -0,0 +1,21 @@
+#ifndef RP_SPORTS_GOL_CAMERA_H
+#define RP_SPORTS_GOL_CAMERA_H
+
+#include
+
+#include
+#include
+
+#include
+
+class RPGolCamera {
+
+private:
+ void* placeholder;
+ u32 unk4;
+ nw4r::math::MTX34 mMtx; // at 0x8
+ nw4r::math::VEC3 mVec; // at 0x38; tentative
+ RPGrpCamera* mpCamera; // at 0x44
+};
+
+#endif
diff --git a/include/Pack/RPSports/RPGolScene/RPGolResourceManager.h b/include/Pack/RPSports/RPGolScene/RPGolResourceManager.h
new file mode 100644
index 000000000..909313cf3
--- /dev/null
+++ b/include/Pack/RPSports/RPGolScene/RPGolResourceManager.h
@@ -0,0 +1,56 @@
+#ifndef RP_SPORTS_GOL_RESOURCE_MANAGER_H
+#define RP_SPORTS_GOL_RESOURCE_MANAGER_H
+
+#include
+
+#include
+#include
+
+#include
+
+//! @addtogroup rp_gol
+//! @{
+
+/**
+ * @brief Resource manager for Golf
+ */
+class RPGolResourceManager {
+
+ RP_SINGLETON_DECL(RPGolResourceManager);
+
+public:
+ enum EArchive {
+ EArchive_GameCommon,
+ EArchive_GameLocal,
+ EArchive_GameStage,
+ EArchive_StaticCommon,
+ EArchive_StaticLocal,
+ EArchive_Max,
+ };
+
+ static void getGameArchive(const char* pName);
+
+ static void* hasFile(const char* pName, EArchive archive);
+
+ static bool checkFile(const char* pName, EArchive archive);
+
+ /**
+ * @brief Creates 3D models from a provided archive.
+ *
+ * @param pName Name of 3D model
+ * @param archive Archive type
+ */
+
+ static RPGrpHandle createModel(const char* pName, EArchive archive);
+
+private:
+ EGG::Archive** mppArchives; // at 0x4
+ void* unk8;
+ void* unkC;
+ void* unk10;
+ void* unk14;
+};
+
+//! @}
+
+#endif
diff --git a/include/Pack/RPSystem.h b/include/Pack/RPSystem.h
index d46be6880..1398cecc3 100644
--- a/include/Pack/RPSystem.h
+++ b/include/Pack/RPSystem.h
@@ -16,6 +16,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/include/Pack/RPSystem/RPSysQueuedScene.h b/include/Pack/RPSystem/RPSysQueuedScene.h
new file mode 100644
index 000000000..756ecd10d
--- /dev/null
+++ b/include/Pack/RPSystem/RPSysQueuedScene.h
@@ -0,0 +1,26 @@
+#ifndef RP_SYSTEM_QUEUED_SCENE_H
+#define RP_SYSTEM_QUEUED_SCENE_H
+
+#include
+
+#include
+
+
+class RPSysQueuedScene {
+ RP_SINGLETON_DECL_EX(RPSysQueuedScene);
+
+public:
+ void reset();
+
+ s32 getNextSceneID() const {
+ return mNextSceneID;
+ }
+ void setNextSceneID(s32 id) {
+ mNextSceneID = id;
+ }
+
+private:
+ s32 mNextSceneID; // at 0x8
+};
+
+#endif
diff --git a/include/Pack/RPUtility.h b/include/Pack/RPUtility.h
index 855d76232..94381d598 100644
--- a/include/Pack/RPUtility.h
+++ b/include/Pack/RPUtility.h
@@ -3,6 +3,7 @@
#include
#include
+#include
#include
#include
#include
diff --git a/include/Pack/RPUtility/RPUtlLytBase.h b/include/Pack/RPUtility/RPUtlLytBase.h
new file mode 100644
index 000000000..cc478f7c3
--- /dev/null
+++ b/include/Pack/RPUtility/RPUtlLytBase.h
@@ -0,0 +1,14 @@
+#ifndef RP_UTILITY_LYT_BASE_H
+#define RP_UTILITY_LYT_BASE_H
+
+#include
+
+#include
+
+class RPUtlLytBase {
+
+public:
+ static void beginDrawLine(GXColor color, u16 num, u8 width);
+};
+
+#endif
diff --git a/include/Pack/RPUtility/RPUtlShadowDrawer.h b/include/Pack/RPUtility/RPUtlShadowDrawer.h
index 7e6519cd7..2aba91cb3 100644
--- a/include/Pack/RPUtility/RPUtlShadowDrawer.h
+++ b/include/Pack/RPUtility/RPUtlShadowDrawer.h
@@ -9,7 +9,7 @@
class RPUtlShadowDrawer {
public:
- void initMtx();
+ void initMtx() const;
void drawShadow();
private:
@@ -18,7 +18,7 @@ class RPUtlShadowDrawer {
nw4r::ut::Color mColor; // at 0x34
private:
- static nw4r::math::MTX34 sGlobalMtx;
+ static nw4r::math::MTX34 sCameraMtx;
};
#endif
diff --git a/include/egg/gfxe.h b/include/egg/gfxe.h
index 9605a9aa8..10e080d69 100644
--- a/include/egg/gfxe.h
+++ b/include/egg/gfxe.h
@@ -26,6 +26,9 @@
#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
diff --git a/include/egg/gfxe/eggCapTexture.h b/include/egg/gfxe/eggCapTexture.h
index c8e74b6a6..bfc3c5278 100644
--- a/include/egg/gfxe/eggCapTexture.h
+++ b/include/egg/gfxe/eggCapTexture.h
@@ -22,6 +22,9 @@ class CapTexture : public CpuTexture {
GXTexMapID getLoadMap() const {
return mLoadMap;
}
+ void setLoadMap(GXTexMapID loadMap) {
+ mLoadMap = loadMap;
+ }
void setClearColor(const GXColor& rColor) {
mClearColor = rColor;
diff --git a/include/egg/gfxe/eggFrustum.h b/include/egg/gfxe/eggFrustum.h
index fba86ab20..aa272255f 100644
--- a/include/egg/gfxe/eggFrustum.h
+++ b/include/egg/gfxe/eggFrustum.h
@@ -188,6 +188,10 @@ class Frustum {
mTanFovY = sin / cos;
}
+ f32 GetTanFovy() const {
+ return mTanFovY;
+ }
+
f32 GetNearZ() const {
return mNearZ;
}
diff --git a/include/egg/gfxe/eggPostEffectBlurSimple.h b/include/egg/gfxe/eggPostEffectBlurSimple.h
new file mode 100644
index 000000000..011661b7b
--- /dev/null
+++ b/include/egg/gfxe/eggPostEffectBlurSimple.h
@@ -0,0 +1,21 @@
+#ifndef EGG_GFXE_POST_EFFECT_BLUR_SIMPLE_H
+#define EGG_GFXE_POST_EFFECT_BLUR_SIMPLE_H
+#include "eggPostEffectBase.h"
+#include "types_egg.h"
+
+namespace EGG {
+
+class PostEffectBlurSimple : public PostEffectBase {
+public:
+ PostEffectBlurSimple();
+ virtual ~PostEffectBlurSimple() {} // at 0x8
+ virtual void reset(); // at 0x14
+ virtual void setMaterialInternal(); // at 0x18
+
+public:
+ char unk20[0x34 - 0x20];
+};
+
+} // namespace EGG
+
+#endif
diff --git a/include/egg/gfxe/eggScreen.h b/include/egg/gfxe/eggScreen.h
index b32d3f1f7..d3587f86d 100644
--- a/include/egg/gfxe/eggScreen.h
+++ b/include/egg/gfxe/eggScreen.h
@@ -58,7 +58,7 @@ class Screen : public Frustum {
void CalcMatrixForDrawQuad(nw4r::math::MTX34* pMtx, f32 x, f32 y, f32 width,
f32 height) const;
- void FillBufferGX(u32 flags, GXColor color, u32 arg2) const;
+ void FillBufferGX(u32 flags, GXColor color, u32 arg2 = 0) const;
void GetGlobalPos(f32* pX, f32* pY) const;
const Screen* GetParent() const {
diff --git a/include/egg/gfxe/eggStateGX.h b/include/egg/gfxe/eggStateGX.h
index 023b298b8..51f2d36c8 100644
--- a/include/egg/gfxe/eggStateGX.h
+++ b/include/egg/gfxe/eggStateGX.h
@@ -127,11 +127,19 @@ class StateGX {
cCacheFlag_AlphaUpdate = 1 << 6,
};
+ // TODO(kiwi) Add flag inlines
+public:
enum {
+ cFlag_0 = 1 << 0,
+ cFlag_1 = 1 << 1,
cFlag_EnableTMem = 1 << 4,
cFlag_EnableCache = 1 << 5,
};
+ // TODO(kiwi) Add flag inlines
+public:
+ static u16 s_flag;
+
private:
static GXCache s_cacheGX;
@@ -146,8 +154,6 @@ class StateGX {
static GXColor s_clearEfb;
- static u16 s_flag;
-
static f32 s_modifyRatio;
static nw4r::g3d::tmem::TMemLayout s_tmem_layout;
diff --git a/src/Pack/RPGraphics/RPGrpView.cpp b/src/Pack/RPGraphics/RPGrpView.cpp
new file mode 100644
index 000000000..f517faad4
--- /dev/null
+++ b/src/Pack/RPGraphics/RPGrpView.cpp
@@ -0,0 +1,435 @@
+#include
+
+#include
+
+#include
+
+#include
+
+/******************************************************************************
+ *
+ * RPGrpView
+ *
+ ******************************************************************************/
+
+/**
+ * @brief Default framebuffer clear color
+ */
+GXColor RPGrpView::DEFAULT_CLEAR_COLOR = {0, 0, 0, 255};
+
+/**
+ * @brief View clipper instance
+ */
+RPGrpView::Clipper RPGrpView::sClipper;
+
+/**
+ * @brief Constructor
+ *
+ * @param no View ID
+ */
+RPGrpView::RPGrpView(u8 no)
+ : mViewNo(no),
+ mDrawScene(0),
+ mFlags(EFlag_9 | EFlag_SysDraw | EFlag_SysCalc),
+ mProjType(EProjType_Max),
+ mClearColor(DEFAULT_CLEAR_COLOR),
+ mpScreen(NULL),
+ unk14(0),
+ mpScreenEffect(NULL) {}
+
+/**
+ * @brief Initializes this view's state
+ */
+void RPGrpView::Configure() {}
+
+/**
+ * @brief Attaches a screen effect to this view
+ */
+void RPGrpView::CreateScreenEffect() {
+ mpScreenEffect = new ScreenEffect();
+}
+
+/**
+ * @brief Updates this view's state
+ */
+void RPGrpView::Calc() {
+ RPGrpView::PrepareDraw();
+}
+
+/**
+ * @brief Prepares this view for a new frame
+ */
+void RPGrpView::PrepareDraw() {
+ if (!IsSysCalc()) {
+ return;
+ }
+
+ if (mProjType == EProjType_Persp) {
+ sClipper.Calc(GetEnableScreen());
+ }
+}
+
+/**
+ * @brief Clears the framebuffer of the attached screen
+ */
+void RPGrpView::ClearBuffer() {
+ GXColor clearColor = EGG::StateGX::getEfbClearColor();
+ u8 flags = 0;
+
+ if (mFlags & EFlag_FillBufferColor) {
+ clearColor.r = GetClearColor().r;
+ clearColor.g = GetClearColor().g;
+ clearColor.b = GetClearColor().b;
+
+ flags |= EGG::Screen::FILLBUFFER_COLOR;
+ EGG::StateGX::s_flag |= EGG::StateGX::cFlag_0;
+ } else {
+ EGG::StateGX::s_flag &= ~EGG::StateGX::cFlag_0;
+ }
+
+ if (mFlags & EFlag_FillBufferAlpha) {
+ clearColor.a = GetClearColor().a;
+
+ flags |= EGG::Screen::FILLBUFFER_ALPHA;
+ EGG::StateGX::s_flag |= EGG::StateGX::cFlag_1;
+ } else {
+ EGG::StateGX::s_flag &= ~EGG::StateGX::cFlag_1;
+ }
+
+ if (mFlags & EFlag_FillBufferTexture) {
+ flags |= EGG::Screen::FILLBUFFER_TEXTURE;
+ }
+
+ if (flags != 0) {
+ GetEnableScreen()->FillBufferGX(flags, GetClearColor());
+ EGG::StateGX::setEfbClearColor(clearColor);
+ }
+
+ if (mpScreenEffect != NULL) {
+ mpScreenEffect->Draw(GetEnableScreen());
+ }
+}
+
+/**
+ * @brief Attaches a new screen to this view
+ *
+ * @param pScreen Screen rendering surface
+ * @return Previously attached screen
+ */
+RPGrpScreen* RPGrpView::AttachScreen(RPGrpScreen* pScreen) {
+ RPGrpScreen* pOldScreen = mpScreen;
+ mpScreen = pScreen;
+ return pOldScreen;
+}
+
+/**
+ * @brief Configures the GX projection matrix
+ */
+void RPGrpView::SetProjectionGX() const {
+ EGG::DrawGX::SetCameraMtx(GetEnableCamera()->GetSavedCameraMatrix());
+
+ EGG::Screen clone(*GetEnableScreen());
+
+ switch (mProjType) {
+ case EProjType_Persp: {
+ clone.SetProjectionType(EGG::Screen::PROJ_PERSP);
+ break;
+ }
+
+ case EProjType_Ortho: {
+ if (GetType() == EType_Render2D) {
+ clone.SetNearZ(-10000.0f);
+ clone.SetFarZ(10000.0f);
+ }
+
+ clone.SetProjectionType(EGG::Screen::PROJ_ORTHO);
+ break;
+ }
+
+ default: {
+ break;
+ }
+ }
+
+ clone.SetProjectionGX();
+}
+
+/**
+ * @brief Converts a position from world-space to screen-space
+ *
+ * @param[out] pScreenPos Position in screen-space
+ * @param rWorldPos Position in world-space
+ */
+void RPGrpView::GetWorldToScreen(nw4r::math::VEC3* pScreenPos,
+ const nw4r::math::VEC3& rWorldPos) const {
+ if (GetCamera() != NULL) {
+ GetCamera()->GetWorldToScreen(pScreenPos, rWorldPos, GetEnableScreen());
+ } else {
+ GetEnableScreen()->GetViewToScreen(pScreenPos, rWorldPos);
+ }
+}
+
+/**
+ * @brief Converts a position from screen-space to world-space
+ *
+ * @param[out] pWorldPos Position in world-space
+ * @param rScreenPos Position in screen-space
+ */
+void RPGrpView::GetScreenToWorld(nw4r::math::VEC3* pWorldPos,
+ const nw4r::math::VEC2& rScreenPos) const {
+ if (GetCamera() != NULL) {
+ GetCamera()->GetScreenToWorld(pWorldPos, rScreenPos, GetEnableScreen());
+ } else {
+ GetEnableScreen()->GetScreenToView(pWorldPos, rScreenPos);
+ }
+}
+
+/**
+ * @brief Gets the screen used by this view.
+ * @details If no screen is attached, this function returns the root screen.
+ */
+RPGrpScreen* RPGrpView::GetEnableScreen() const {
+ if (GetScreen() != NULL) {
+ return GetScreen();
+ }
+
+ return &RPGrpScreen::GetRootScreen();
+}
+
+/**
+ * @brief Gets the camera used by this view.
+ * @details If no camera is attached, this function returns the default
+ * camera.
+ */
+RPGrpCamera* RPGrpView::GetEnableCamera() const {
+ if (GetCamera() != NULL) {
+ return GetCamera();
+ }
+
+ return &RPGrpCamera::GetDefaultCamera();
+}
+
+/**
+ * @brief Tests whether the specified bounding sphere falls within the
+ * view frustum
+ *
+ * @param pScreen Screen rendering surface
+ * @param rPos Bounding sphere position
+ * @param radius Bounding sphere radius
+ */
+bool RPGrpView::Clip(const nw4r::math::VEC3& rPos, f32 radius) const {
+ nw4r::math::VEC3 local;
+ nw4r::math::VEC3TransformCoord(
+ &local, &GetEnableCamera()->GetSavedCameraMatrix(), &rPos);
+
+ return sClipper.Clip(GetEnableScreen(), local, radius);
+}
+
+/******************************************************************************
+ *
+ * Clipper
+ *
+ ******************************************************************************/
+
+/**
+ * @brief Re-calculates this clipper's clipping planes
+ *
+ * @param pScreen Screen rendering surface
+ */
+void RPGrpView::Clipper::Calc(const RPGrpScreen* pScreen) {
+ f32 ny = pScreen->GetNearZ() * pScreen->GetTanFovy();
+ f32 nx = ny * pScreen->GetWidth() / pScreen->GetHeight();
+
+ nw4r::math::VEC3 bl(-nx, -ny, -pScreen->GetNearZ());
+ nw4r::math::VEC3 tl(-nx, ny, -pScreen->GetNearZ());
+ nw4r::math::VEC3 tr(nx, ny, -pScreen->GetNearZ());
+ nw4r::math::VEC3 br(nx, -ny, -pScreen->GetNearZ());
+
+ nw4r::math::VEC3Cross(&l, &tl, &bl);
+ nw4r::math::VEC3Cross(&t, &tr, &tl);
+ nw4r::math::VEC3Cross(&r, &br, &tr);
+ nw4r::math::VEC3Cross(&b, &bl, &br);
+
+ nw4r::math::VEC3Normalize(&l, &l);
+ nw4r::math::VEC3Normalize(&t, &t);
+ nw4r::math::VEC3Normalize(&r, &r);
+ nw4r::math::VEC3Normalize(&b, &b);
+}
+
+/**
+ * @brief Tests whether the specified bounding sphere falls within the
+ * view frustum
+ *
+ * @param pScreen Screen rendering surface
+ * @param rPos Bounding sphere position
+ * @param radius Bounding sphere radius
+ */
+bool RPGrpView::Clipper::Clip(const RPGrpScreen* pScreen,
+ const nw4r::math::VEC3& rPos, f32 radius) {
+
+ if (-rPos.z < pScreen->GetNearZ() - radius ||
+ -rPos.z > pScreen->GetFarZ() + radius) {
+
+ return true;
+ }
+
+ if (rPos.x * l.x + rPos.y * l.y + rPos.z * l.z > radius) {
+ return true;
+ }
+
+ if (rPos.x * t.x + rPos.y * t.y + rPos.z * t.z > radius) {
+ return true;
+ }
+
+ if (rPos.x * r.x + rPos.y * r.y + rPos.z * r.z > radius) {
+ return true;
+ }
+
+ if (rPos.x * b.x + rPos.y * b.y + rPos.z * b.z > radius) {
+ return true;
+ }
+
+ return false;
+}
+
+/******************************************************************************
+ *
+ * ScreenEffect
+ *
+ ******************************************************************************/
+
+/**
+ * @brief Constructor
+ */
+RPGrpView::ScreenEffect::ScreenEffect() {
+ mColorMultiply = EGG::DrawGX::WHITE;
+ mColorAdd = EGG::DrawGX::BLACK;
+ mColorBlend = (GXColor){0, 0, 0, 0};
+
+ mBlurOffset = 1.2f;
+ mBlurAlpha = 0;
+}
+
+/**
+ * @brief Draws this effect to the specified screen
+ *
+ * @param pScreen Screen rendering surface
+ */
+void RPGrpView::ScreenEffect::Draw(const RPGrpScreen* pScreen) {
+ bool needBlur = mBlurAlpha > 0;
+
+ bool needMul = mColorMultiply.r != 255 || mColorMultiply.g != 255 ||
+ mColorMultiply.b != 255;
+
+ bool needAdd = (mColorAdd.r != 0 || mColorAdd.g != 0 || mColorAdd.b != 0) &&
+ mColorAdd.a > 0;
+
+ bool needNormal = mColorBlend.a > 0;
+
+ if (needBlur || needMul || needAdd || needNormal) {
+ EGG::StateGX::GXSetColorUpdate_(true);
+ EGG::StateGX::GXSetAlphaUpdate_(false);
+
+ GXInvalidateTexAll();
+
+ EGG::Screen clone(*pScreen);
+ clone.SetNearZ(0.0f);
+ clone.SetFarZ(1.0f);
+ clone.SetCanvasMode(EGG::Screen::CANVAS_LU);
+ clone.SetProjectionType(EGG::Screen::PROJ_ORTHO);
+ clone.SetProjectionGX();
+
+ const EGG::Screen::DataEfb& rEfb = pScreen->GetDataEfb();
+ u16 x = static_cast(rEfb.vp.x);
+ u16 y = static_cast(rEfb.vp.y);
+ // Downscaled for mipmapping
+ u16 halfWidth = static_cast(rEfb.vp.width / 2);
+ u16 halfHeight = static_cast(rEfb.vp.height / 2);
+
+ if (needBlur) {
+ // Screenshot used as a base for blurring
+ EGG::TextureBuffer* pScreenCapture = EGG::TextureBuffer::alloc( //
+ halfWidth, //
+ halfHeight, //
+ GX_TF_RGBA8);
+
+ // Backup of original pixels that will be clobbered by blurring
+ EGG::TextureBuffer* pScreenBackup = EGG::TextureBuffer::alloc( //
+ halfWidth / 2, //
+ halfHeight / 2, //
+ GX_TF_RGBA8);
+
+ // Blur posteffect result in texture form
+ EGG::TextureBuffer* pEffectCapture = EGG::TextureBuffer::alloc( //
+ halfWidth / 2, //
+ halfHeight / 2, //
+ GX_TF_RGBA8);
+
+ // Save the appearance of the screen space
+ // that will be overwritten by the blur posteffect.
+ pScreenBackup->capture(x, y);
+
+ // Take a screenshot to use as a base for blurring
+ pScreenCapture->setVFilterBlur();
+ pScreenCapture->capture(x, y, true);
+
+ // TODO(kiwi) PostEffectBlurSimple needs work
+ EGG::PostEffectBlurSimple eff;
+ eff.configure();
+ eff.setBlendMode(EGG::PostEffectBase::cBlendMode_None);
+ eff.setCapTexture(pScreenCapture);
+
+ // Draw the result of the blur posteffect (downscaled)
+ pScreenCapture->setLoadMap(GX_TEXMAP0);
+ eff.draw(pScreen->GetWidth() / 4.0f, pScreen->GetHeight() / 4.0f);
+
+ // Capture the posteffect result as a new texture
+ pEffectCapture->setVFilterBlur();
+ pEffectCapture->capture(x, y);
+
+ nw4r::math::MTX34 proj;
+ EGG::DrawGX::BeginDrawScreen(true, true, true);
+
+ // Restore the pixels overwritten by the posteffect work
+ PSMTXScale( //
+ proj, //
+ pScreen->GetWidth() / 4.0f, //
+ pScreen->GetHeight() / 4.0f, //
+ 1.0f);
+ pScreenBackup->load(GX_TEXMAP0);
+ EGG::DrawGX::DrawScreenTexture(proj, EGG::DrawGX::WHITE);
+
+ // Upscale the blur effect to the entire screen
+ PSMTXScale(proj, pScreen->GetWidth(), pScreen->GetHeight(), 1.0f);
+ pEffectCapture->load(GX_TEXMAP0);
+ GXColor color = (GXColor){255, 255, 255, mBlurAlpha};
+ EGG::DrawGX::DrawScreenTexture(proj, color);
+
+ pScreenBackup->free();
+ pScreenCapture->free();
+ pEffectCapture->free();
+ }
+
+ if (needMul || needAdd || needNormal) {
+ EGG::DrawGX::BeginDrawScreen(true, false, false);
+
+ nw4r::math::MTX34 proj;
+ PSMTXScale(proj, pScreen->GetWidth(), pScreen->GetHeight(), 1.0f);
+
+ if (needMul) {
+ EGG::DrawGX::SetBlendMode(EGG::DrawGX::BLEND_MUL);
+ EGG::DrawGX::DrawScreen(proj, mColorMultiply);
+ }
+
+ if (needAdd) {
+ EGG::DrawGX::SetBlendMode(EGG::DrawGX::BLEND_ADD_ALPHA);
+ EGG::DrawGX::DrawScreen(proj, mColorAdd);
+ }
+
+ if (needNormal) {
+ EGG::DrawGX::SetBlendMode(EGG::DrawGX::BLEND_NORMAL);
+ EGG::DrawGX::DrawScreen(proj, mColorBlend);
+ }
+ }
+ }
+}
diff --git a/src/Pack/RPGraphics/RPGrpViewRender2D.cpp b/src/Pack/RPGraphics/RPGrpViewRender2D.cpp
new file mode 100644
index 000000000..693f0de52
--- /dev/null
+++ b/src/Pack/RPGraphics/RPGrpViewRender2D.cpp
@@ -0,0 +1,35 @@
+#include
+
+/**
+ * @brief Constructor
+ *
+ * @param no View ID
+ */
+RPGrpViewRender2D::RPGrpViewRender2D(u8 no) : RPGrpView(no) {
+ mProjType = EProjType_Ortho;
+}
+
+/**
+ * @brief Initializes this view's state
+ */
+void RPGrpViewRender2D::Configure() {}
+
+/**
+ * @brief Prepares this view for a new frame
+ */
+void RPGrpViewRender2D::PrepareDraw() {
+ RPGrpView::PrepareDraw();
+}
+
+/**
+ * @brief Renders the contents of this view
+ */
+void RPGrpViewRender2D::Draw() {
+ if (!IsSysCalc()) {
+ return;
+ }
+
+ ClearBuffer();
+ SetProjectionGX();
+ EGG::StateGX::GXSetAlphaUpdate_(false);
+}
diff --git a/src/Pack/RPGraphics/RPGrpViewRender3D.cpp b/src/Pack/RPGraphics/RPGrpViewRender3D.cpp
new file mode 100644
index 000000000..da7b70c46
--- /dev/null
+++ b/src/Pack/RPGraphics/RPGrpViewRender3D.cpp
@@ -0,0 +1,101 @@
+#include
+
+/**
+ * @brief Constructor
+ *
+ * @param no View ID
+ */
+RPGrpViewRender3D::RPGrpViewRender3D(u8 no)
+ : RPGrpView(no), mpCamera(NULL), unk24(0) {
+
+ mProjType = EProjType_Persp;
+}
+
+/**
+ * @brief Updates this view's state
+ */
+void RPGrpViewRender3D::Calc() {
+ RPGrpView::Calc();
+
+ if (!IsSysCalc()) {
+ return;
+ }
+
+ if (GetCamera() == NULL) {
+ return;
+ }
+
+ GetCamera()->SaveCameraMatrix();
+}
+
+/**
+ * @brief Prepares this view for a new frame
+ */
+void RPGrpViewRender3D::PrepareDraw() {
+ RPGrpView::PrepareDraw();
+
+ if (!IsSysCalc()) {
+ return;
+ }
+
+ ClearBuffer();
+
+ if (!IsSysDraw()) {
+ return;
+ }
+
+ RPGrpModelScene* pModelScene =
+ RPGrpModelManager::GetCurrent()->GetModelScene(mDrawScene);
+
+ RPGrpScreen clone(*GetEnableScreen());
+
+ clone.SetProjectionType(mProjType == EProjType_Persp
+ ? EGG::Screen::PROJ_PERSP
+ : EGG::Screen::PROJ_ORTHO);
+
+ pModelScene->DrawPrepare(GetEnableCamera(), &clone);
+}
+
+/**
+ * @brief Renders the contents of this view
+ */
+void RPGrpViewRender3D::Draw() {
+ if (!IsSysCalc()) {
+ return;
+ }
+
+ if (!IsSysDraw()) {
+ return;
+ }
+
+ RPGrpModelScene* pModelScene =
+ RPGrpModelManager::GetCurrent()->GetModelScene(mDrawScene);
+
+ pModelScene->Draw();
+}
+
+/**
+ * @brief Prepares this view for a new render pass
+ */
+void RPGrpViewRender3D::PrepareDrawGX() {
+ if (IsSysDraw()) {
+ RPGrpModelScene* pModelScene =
+ RPGrpModelManager::GetCurrent()->GetModelScene(mDrawScene);
+
+ pModelScene->PreConditionForRenderingGX();
+ } else {
+ SetProjectionGX();
+ }
+}
+
+/**
+ * @brief Attaches a new camera to this view
+ *
+ * @param pCamera New camera
+ * @return Previously attached camera
+ */
+RPGrpCamera* RPGrpViewRender3D::AttachCamera(RPGrpCamera* pCamera) {
+ RPGrpCamera* pOldCamera = mpCamera;
+ mpCamera = pCamera;
+ return pOldCamera;
+}
diff --git a/src/Pack/RPKernel/RPSysEffectCreator.cpp b/src/Pack/RPKernel/RPSysEffectCreator.cpp
index 43225eb4f..2616be11e 100644
--- a/src/Pack/RPKernel/RPSysEffectCreator.cpp
+++ b/src/Pack/RPKernel/RPSysEffectCreator.cpp
@@ -31,8 +31,8 @@ RPSysEffectCreator::RPSysEffectCreator(u32 drawScene) {
mpMemoryManager = NULL;
for (int i = 0; i < ESaveBuffer_Max; i++) {
- mEmitterParamSave[i] = NULL;
- mParticleParamSave[i] = NULL;
+ mpEmitterParamSave[i] = NULL;
+ mpParticleParamSave[i] = NULL;
}
}
@@ -116,9 +116,9 @@ void RPSysEffectCreator::createSlowSystem() {
RPSysEffectDefine::MAX_GROUP_ID);
for (int i = 0; i < ESaveBuffer_Max; i++) {
- mEmitterParamSave[i] = //
+ mpEmitterParamSave[i] = //
new nw4r::ef::EmitterParameter[SLOW_MAX_EMITTER];
- mParticleParamSave[i] = //
+ mpParticleParamSave[i] = //
new nw4r::ef::ParticleParameter[SLOW_MAX_PARTICLE];
}
}
@@ -226,20 +226,20 @@ void RPSysEffectCreator::update() {
const nw4r::ut::List *pListEmitter, *pListParticle;
const nw4r::ef::EmitterParameter* pLoadEmitter =
- mEmitterParamSave[mBackSaveBuffer == ESaveBuffer_1st
- ? ESaveBuffer_2nd
- : ESaveBuffer_1st];
-
- const nw4r::ef::ParticleParameter* pLoadParticle =
- mParticleParamSave[mBackSaveBuffer == ESaveBuffer_1st
+ mpEmitterParamSave[mBackSaveBuffer == ESaveBuffer_1st
? ESaveBuffer_2nd
: ESaveBuffer_1st];
+ const nw4r::ef::ParticleParameter* pLoadParticle =
+ mpParticleParamSave[mBackSaveBuffer == ESaveBuffer_1st
+ ? ESaveBuffer_2nd
+ : ESaveBuffer_1st];
+
nw4r::ef::EmitterParameter* pSaveEmitter =
- mEmitterParamSave[mBackSaveBuffer];
+ mpEmitterParamSave[mBackSaveBuffer];
nw4r::ef::ParticleParameter* pSaveParticle =
- mParticleParamSave[mBackSaveBuffer];
+ mpParticleParamSave[mBackSaveBuffer];
pListEmitter = &mpMemoryManager->mEmitterOM->mLeasedList;
pListParticle = &mpMemoryManager->mParticleOM->mLeasedList;
diff --git a/src/Pack/RPKernel/RPSysEffectMgr.cpp b/src/Pack/RPKernel/RPSysEffectMgr.cpp
index b035ccf61..cc0bb8426 100644
--- a/src/Pack/RPKernel/RPSysEffectMgr.cpp
+++ b/src/Pack/RPKernel/RPSysEffectMgr.cpp
@@ -128,15 +128,15 @@ void RPSysEffectMgr::setCaptureEfb(void* pTexture, const EfbTexData& rData) {
/**
* @brief Draws the specified set of effects
*
- * @param rDrawInfo Graphics configuration
+ * @param rViewMtx Graphics configuration
* @param drawGroup Effect draw group
* @param drawScene Effect draw scene
*/
-void RPSysEffectMgr::draw(const nw4r::ef::DrawInfo& rDrawInfo, u32 drawGroup,
+void RPSysEffectMgr::draw(const nw4r::math::MTX34& rViewMtx, u32 drawGroup,
u32 drawScene) {
- nw4r::ef::DrawInfo sceneDrawInfo;
- sceneDrawInfo.SetViewMtx(*rDrawInfo.GetViewMtx());
+ nw4r::ef::DrawInfo drawInfo;
+ drawInfo.SetViewMtx(rViewMtx);
RPGrpScreen* pScreen = RPGrpRenderer::GetCurrentScreen();
RPGrpView* pView = RPGrpRenderer::GetCurrentView();
@@ -151,7 +151,7 @@ void RPSysEffectMgr::draw(const nw4r::ef::DrawInfo& rDrawInfo, u32 drawGroup,
C_MTXLightOrtho(proj, cy, -cy, -cx, cx, 0.5f, -0.5f, 0.5f, 0.5f);
}
- sceneDrawInfo.SetProjMtx(proj);
+ drawInfo.SetProjMtx(proj);
if (drawGroup < EDrawGroup_16) {
for (int i = 0; i < EDrawScene_Max; i++) {
@@ -159,7 +159,7 @@ void RPSysEffectMgr::draw(const nw4r::ef::DrawInfo& rDrawInfo, u32 drawGroup,
continue;
}
- mpEffectCreators[i]->draw(sceneDrawInfo, drawGroup, drawScene);
+ mpEffectCreators[i]->draw(drawInfo, drawGroup, drawScene);
}
}
}
diff --git a/src/Pack/RPSports/RPGolScene/RPGolResourceManager.cpp b/src/Pack/RPSports/RPGolScene/RPGolResourceManager.cpp
new file mode 100644
index 000000000..7292b7d62
--- /dev/null
+++ b/src/Pack/RPSports/RPGolScene/RPGolResourceManager.cpp
@@ -0,0 +1,33 @@
+#include
+#include
+
+RP_SINGLETON_IMPL(RPGolResourceManager);
+
+RPGolResourceManager::RPGolResourceManager()
+ : mppArchives(NULL), unk8(NULL), unkC(NULL), unk10(NULL), unk14(NULL) {}
+
+RPGolResourceManager::~RPGolResourceManager() {}
+
+void RPGolResourceManager::getGameArchive(const char* pName) {
+ instance()->mppArchives[EArchive_GameCommon] =
+ RPSysResourceManager::LoadGameCommonArchive();
+ RPSysResourceManager::LoadGameStageArchive(pName);
+}
+
+void* RPGolResourceManager::hasFile(const char* pName, EArchive archive) {
+ return RPSysResourceManager::GetFileFromArchive(
+ instance()->mppArchives[archive], pName);
+}
+
+bool RPGolResourceManager::checkFile(const char* pName, EArchive archive) {
+ return (instance()->mppArchives[archive])->getFile(pName, NULL) != NULL;
+}
+
+RPGrpHandle RPGolResourceManager::createModel(const char* pName,
+ EArchive archive) {
+ RPGrpModelResManager* pResMgr = RPGrpModelResManager::GetCurrent();
+
+ void* pFileData = RPSysResourceManager::GetFileFromArchive(
+ (instance()->mppArchives[archive]), pName);
+ return pResMgr->CreateData(RPGrpModelResManager::Type_ResFile, pFileData);
+}
diff --git a/src/Pack/RPSystem/RPSysQueuedScene.cpp b/src/Pack/RPSystem/RPSysQueuedScene.cpp
new file mode 100644
index 000000000..7e9a94bc5
--- /dev/null
+++ b/src/Pack/RPSystem/RPSysQueuedScene.cpp
@@ -0,0 +1,13 @@
+#include
+
+RP_SINGLETON_IMPL_EX(RPSysQueuedScene);
+
+RPSysQueuedScene::RPSysQueuedScene(EGG::Heap* pHeap) : mpParentHeap(pHeap) {
+ mNextSceneID = -1;
+}
+
+void RPSysQueuedScene::reset() {
+ mNextSceneID = -1;
+}
+
+RPSysQueuedScene::~RPSysQueuedScene() {}
diff --git a/src/Pack/RPUtility/RPUtlLytBase.cpp b/src/Pack/RPUtility/RPUtlLytBase.cpp
new file mode 100644
index 000000000..2c073409f
--- /dev/null
+++ b/src/Pack/RPUtility/RPUtlLytBase.cpp
@@ -0,0 +1,31 @@
+#include
+
+#include
+
+#include
+
+#include
+
+void RPUtlLytBase::beginDrawLine(GXColor color, u16 verts, u8 width) {
+ nw4r::math::MTX34 ident;
+
+ ident._00 = 1.0f;
+ ident._01 = 0.0f;
+ ident._02 = 0.0f;
+ ident._03 = 0.0f;
+ ident._10 = 0.0f;
+ ident._11 = 1.0f;
+ ident._12 = 0.0f;
+ ident._13 = 0.0f;
+ ident._20 = 0.0f;
+ ident._21 = 0.0f;
+ ident._22 = 1.0f;
+ ident._23 = 0.0f;
+
+ GXLoadPosMtxImm(ident, GX_PNMTX0);
+ EGG::DrawGX::BeginDrawLine(EGG::DrawGX::COLORCHAN_COLOR,
+ EGG::DrawGX::ZMODE_ALWAYS);
+ GXSetChanMatColor(GX_COLOR0A0, color);
+ GXSetLineWidth(width, 0);
+ GXBegin(GX_LINESTRIP, GX_VTXFMT0, verts);
+}
diff --git a/src/Pack/RPUtility/RPUtlShadowDrawer.cpp b/src/Pack/RPUtility/RPUtlShadowDrawer.cpp
index 2b551e60e..5d661b38c 100644
--- a/src/Pack/RPUtility/RPUtlShadowDrawer.cpp
+++ b/src/Pack/RPUtility/RPUtlShadowDrawer.cpp
@@ -4,7 +4,13 @@
#include
-nw4r::math::MTX34 RPUtlShadowDrawer::sGlobalMtx;
+nw4r::math::MTX34 RPUtlShadowDrawer::sCameraMtx;
+
+//! NOTE: mLocalMtx may be an argument, though this requires
+//! further analysis of RPGrpRenderer.
+void RPUtlShadowDrawer::initMtx() const {
+ sCameraMtx = mLocalMtx;
+}
/**
* @brief Draws basic shadows.
@@ -12,7 +18,7 @@ nw4r::math::MTX34 RPUtlShadowDrawer::sGlobalMtx;
void RPUtlShadowDrawer::drawShadow() {
nw4r::math::MTX34 ab;
- nw4r::math::MTX34Mult(&ab, &sGlobalMtx, &mLocalMtx);
+ nw4r::math::MTX34Mult(&ab, &sCameraMtx, &mLocalMtx);
GXLoadPosMtxImm(ab, GX_PNMTX0);
GXLoadNrmMtxImm(ab, GX_PNMTX0);
GXSetChanMatColor(GX_COLOR0A0, mColor);