Match z_effect.c (#176)

This commit is contained in:
engineer124
2021-06-10 22:13:43 +10:00
committed by GitHub
parent aae3c6f895
commit e9eb4d4e0a
7 changed files with 239 additions and 234 deletions
+26 -26
View File
@@ -67,19 +67,19 @@ void Game_Nop80173534(GameState* ctxt) {
;
}
void GameState_Draw(GameState* ctxt, GraphicsContext* gCtxt) {
void GameState_Draw(GameState* ctxt, GraphicsContext* gfxCtx) {
Gfx* nextDisplayList;
Gfx* _polyOpa;
// Unused vars impact regalloc
Gfx* temp_t2;
u32 temp_v1;
_polyOpa = gCtxt->polyOpa.p;
nextDisplayList = Graph_GfxPlusOne(gCtxt->polyOpa.p);
gSPDisplayList(gCtxt->overlay.p++, nextDisplayList);
_polyOpa = gfxCtx->polyOpa.p;
nextDisplayList = Graph_GfxPlusOne(gfxCtx->polyOpa.p);
gSPDisplayList(gfxCtx->overlay.p++, nextDisplayList);
if (R_FB_FILTER_TYPE && R_FB_FILTER_ENV_COLOR(3) == 0) {
GameState_SetFBFilter(&nextDisplayList, (u32)gCtxt->zbuffer);
GameState_SetFBFilter(&nextDisplayList, (u32)gfxCtx->zbuffer);
}
if (R_ENABLE_ARENA_DBG < 0) {
@@ -88,36 +88,36 @@ void GameState_Draw(GameState* ctxt, GraphicsContext* gCtxt) {
gSPEndDisplayList(nextDisplayList++);
Graph_BranchDlist(_polyOpa, nextDisplayList);
gCtxt->polyOpa.p = nextDisplayList;
gfxCtx->polyOpa.p = nextDisplayList;
lblUnk:; // Label prevents reordering, if(1) around the above block don't seem to help unlike in OoT
func_800E9F78(gCtxt);
func_800E9F78(gfxCtx);
if (R_ENABLE_ARENA_DBG != 0) {
SpeedMeter_DrawTimeEntries(&D_801F7FF0, gCtxt);
SpeedMeter_DrawAllocEntries(&D_801F7FF0, gCtxt, ctxt);
SpeedMeter_DrawTimeEntries(&D_801F7FF0, gfxCtx);
SpeedMeter_DrawAllocEntries(&D_801F7FF0, gfxCtx, ctxt);
}
}
void Game_ResetSegments(GraphicsContext* gCtxt) {
gSPSegment(gCtxt->polyOpa.p++, 0, 0);
gSPSegment(gCtxt->polyOpa.p++, 0xF, gCtxt->framebuffer);
gSPSegment(gCtxt->polyXlu.p++, 0, 0);
gSPSegment(gCtxt->polyXlu.p++, 0xF, gCtxt->framebuffer);
gSPSegment(gCtxt->overlay.p++, 0, 0);
gSPSegment(gCtxt->overlay.p++, 0xF, gCtxt->framebuffer);
void Game_ResetSegments(GraphicsContext* gfxCtx) {
gSPSegment(gfxCtx->polyOpa.p++, 0, 0);
gSPSegment(gfxCtx->polyOpa.p++, 0xF, gfxCtx->framebuffer);
gSPSegment(gfxCtx->polyXlu.p++, 0, 0);
gSPSegment(gfxCtx->polyXlu.p++, 0xF, gfxCtx->framebuffer);
gSPSegment(gfxCtx->overlay.p++, 0, 0);
gSPSegment(gfxCtx->overlay.p++, 0xF, gfxCtx->framebuffer);
}
void func_801736DC(GraphicsContext* gCtxt) {
void func_801736DC(GraphicsContext* gfxCtx) {
Gfx* nextDisplayList;
Gfx* _polyOpa;
nextDisplayList = Graph_GfxPlusOne(_polyOpa = gCtxt->polyOpa.p);
gSPDisplayList(gCtxt->overlay.p++, nextDisplayList);
nextDisplayList = Graph_GfxPlusOne(_polyOpa = gfxCtx->polyOpa.p);
gSPDisplayList(gfxCtx->overlay.p++, nextDisplayList);
gSPEndDisplayList(nextDisplayList++);
Graph_BranchDlist(_polyOpa, nextDisplayList);
gCtxt->polyOpa.p = nextDisplayList;
gfxCtx->polyOpa.p = nextDisplayList;
}
void Game_UpdateInput(GameState* ctxt) {
@@ -185,16 +185,16 @@ void Game_ResizeHeap(GameState* ctxt, u32 size) {
}
}
void Game_StateInit(GameState* ctxt, GameStateFunc gameStateInit, GraphicsContext* gCtxt) {
ctxt->gfxCtx = gCtxt;
void Game_StateInit(GameState* ctxt, GameStateFunc gameStateInit, GraphicsContext* gfxCtx) {
ctxt->gfxCtx = gfxCtx;
ctxt->frames = 0U;
ctxt->main = NULL;
ctxt->destroy = NULL;
ctxt->running = 1;
gCtxt->unk274 = D_801FBB88;
gCtxt->viConfigFeatures = gViConfigFeatures;
gCtxt->viConfigXScale = gViConfigXScale;
gCtxt->viConfigYScale = gViConfigYScale;
gfxCtx->unk274 = D_801FBB88;
gfxCtx->viConfigFeatures = gViConfigFeatures;
gfxCtx->viConfigXScale = gViConfigXScale;
gfxCtx->viConfigYScale = gViConfigYScale;
ctxt->nextGameStateInit = NULL;
ctxt->nextGameStateSize = 0U;
@@ -44,11 +44,11 @@ GlobalContext* Effect_GetContext(void) {
}
void* Effect_GetParams(s32 index) {
if (index == 46) {
if (index == TOTAL_EFFECT_COUNT) {
return NULL;
}
if (index < 3) {
if (index < SPARK_COUNT) {
if (sEffTable.sparks[index].base.active == 1) {
return &sEffTable.sparks[index].params;
} else {
@@ -56,8 +56,8 @@ void* Effect_GetParams(s32 index) {
}
}
index -= 3;
if (index < 25) {
index -= SPARK_COUNT;
if (index < BLURE_COUNT) {
if (sEffTable.blures[index].base.active == 1) {
return &sEffTable.blures[index].params;
} else {
@@ -65,8 +65,8 @@ void* Effect_GetParams(s32 index) {
}
}
index -= 25;
if (index < 3) {
index -= BLURE_COUNT;
if (index < SHIELD_PARTICLE_COUNT) {
if (sEffTable.shieldParticles[index].base.active == 1) {
return &sEffTable.shieldParticles[index].params;
} else {
@@ -74,8 +74,8 @@ void* Effect_GetParams(s32 index) {
}
}
index -= 3;
if (index < 15) {
index -= SHIELD_PARTICLE_COUNT;
if (index < TIRE_MARK_COUNT) {
if (sEffTable.tireMarks[index].base.active == 1) {
return &sEffTable.tireMarks[index].params;
} else {
@@ -95,20 +95,20 @@ void Effect_InitCommon(EffCommon* common) {
void Effect_Init(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 3; i++) {
for (i = 0; i < SPARK_COUNT; i++) {
Effect_InitCommon(&sEffTable.sparks[i].base);
}
for (i = 0; i < 25; i++) {
for (i = 0; i < BLURE_COUNT; i++) {
Effect_InitCommon(&sEffTable.blures[i].base);
}
//! @bug This is probably supposed to loop over shieldParticles, not blures again
for (i = 0; i < 3; i++) {
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
Effect_InitCommon(&sEffTable.blures[i].base);
}
for (i = 0; i < 15; i++) {
for (i = 0; i < TIRE_MARK_COUNT; i++) {
Effect_InitCommon(&sEffTable.tireMarks[i].base);
}
@@ -122,14 +122,14 @@ void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 p
EffCommon* common;
params = NULL;
*index = 46;
*index = TOTAL_EFFECT_COUNT;
common = NULL;
if (func_8016A01C(globalCtx) != 1) {
slotFound = 0;
switch (type) {
case 0:
for (i = 0; i < 3; i++) {
for (i = 0; i < SPARK_COUNT; i++) {
if (sEffTable.sparks[i].base.active == 0) {
slotFound = 1;
*index = i;
@@ -141,7 +141,7 @@ void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 p
break;
case 1:
case 2:
for (i = 0; i < 25; i++) {
for (i = 0; i < BLURE_COUNT; i++) {
if (sEffTable.blures[i].base.active == 0) {
slotFound = 1;
*index = i + 3;
@@ -152,7 +152,7 @@ void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 p
}
break;
case 3:
for (i = 0; i < 3; i++) {
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (sEffTable.shieldParticles[i].base.active == 0) {
slotFound = 1;
*index = i + 28;
@@ -163,7 +163,7 @@ void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 p
}
break;
case 4:
for (i = 0; i < 15; i++) {
for (i = 0; i < TIRE_MARK_COUNT; i++) {
if (sEffTable.tireMarks[i].base.active == 0) {
slotFound = 1;
*index = i + 31;
@@ -184,45 +184,43 @@ void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 p
}
}
#ifdef NON_MATCHING
// Contents of s2 and s3 swapped
void Effect_DrawAll(GraphicsContext* gCtxt) {
void Effect_DrawAll(GraphicsContext* gfxCtx) {
s32 i;
for (i = 0; i < 3; i++) {
for (i = 0; i < SPARK_COUNT; i++) {
if (1) {} // necessary to match
if (sEffTable.sparks[i].base.active) {
sEffInfoTable[0].draw(&sEffTable.sparks[i].params, gCtxt);
sEffInfoTable[0].draw(&sEffTable.sparks[i].params, gfxCtx);
}
}
for (i = 0; i < 25; i++) {
if (sEffTable.blures[i].base.active) {
sEffInfoTable[1].draw(&sEffTable.blures[i].params, gCtxt);
for (i = 0; i < BLURE_COUNT; i++) {
if (1) { if (gfxCtx) {} } // necessary to match
if (sEffTable.blures[i].base.active) {
sEffInfoTable[1].draw(&sEffTable.blures[i].params, gfxCtx);
}
}
for (i = 0; i < 3; i++) {
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (1) {} // necessary to match
if (sEffTable.shieldParticles[i].base.active) {
sEffInfoTable[3].draw(&sEffTable.shieldParticles[i].params, gCtxt);
sEffInfoTable[3].draw(&sEffTable.shieldParticles[i].params, gfxCtx);
}
}
for (i = 0; i < 15; i++) {
if (1) {} // necessary to match
for (i = 0; i < TIRE_MARK_COUNT; i++) {
if (sEffTable.tireMarks[i].base.active) {
sEffInfoTable[4].draw(&sEffTable.tireMarks[i].params, gCtxt);
sEffInfoTable[4].draw(&sEffTable.tireMarks[i].params, gfxCtx);
}
}
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x800AF710/Effect_DrawAll.asm")
#endif
#ifdef NON_MATCHING
// 15 is being placed in s5 instead of at
void Effect_UpdateAll(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 3; i++) {
for (i = 0; i < SPARK_COUNT; i++) {
if (1) {} // necessary to match
if (sEffTable.sparks[i].base.active) {
if (sEffInfoTable[0].update(&sEffTable.sparks[i].params) == 1) {
Effect_Destroy(globalCtx, i);
@@ -230,7 +228,8 @@ void Effect_UpdateAll(GlobalContext* globalCtx) {
}
}
for (i = 0; i < 25; i++) {
for (i = 0; i < BLURE_COUNT; i++) {
if (1) {} // necessary to match
if (sEffTable.blures[i].base.active) {
if (sEffInfoTable[1].update(&sEffTable.blures[i].params) == 1) {
Effect_Destroy(globalCtx, i + 3);
@@ -238,7 +237,8 @@ void Effect_UpdateAll(GlobalContext* globalCtx) {
}
}
for (i = 0; i < 3; i++) {
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (1) {} // necessary to match
if (sEffTable.shieldParticles[i].base.active) {
if (sEffInfoTable[3].update(&sEffTable.shieldParticles[i].params) == 1) {
Effect_Destroy(globalCtx, i + 28);
@@ -246,7 +246,8 @@ void Effect_UpdateAll(GlobalContext* globalCtx) {
}
}
for (i = 0; i < 15; i++) {
for (i = 0; i < TIRE_MARK_COUNT; i++) {
if (1) {} // necessary to match
if (sEffTable.tireMarks[i].base.active) {
if (sEffInfoTable[4].update(&sEffTable.tireMarks[i].params) == 1) {
Effect_Destroy(globalCtx, i + 31);
@@ -254,37 +255,34 @@ void Effect_UpdateAll(GlobalContext* globalCtx) {
}
}
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x800AF710/Effect_UpdateAll.asm")
#endif
void Effect_Destroy(GlobalContext* globalCtx, s32 index) {
if (index == 46) {
if (index == TOTAL_EFFECT_COUNT) {
return;
}
if (index < 3) {
if (index < SPARK_COUNT) {
sEffTable.sparks[index].base.active = 0;
sEffInfoTable[0].destroy(&sEffTable.sparks[index].params);
return;
}
index -= 3;
if (index < 25) {
index -= SPARK_COUNT;
if (index < BLURE_COUNT) {
sEffTable.blures[index].base.active = 0;
sEffInfoTable[1].destroy(&sEffTable.blures[index].params);
return;
}
index -= 25;
if (index < 3) {
index -= BLURE_COUNT;
if (index < SHIELD_PARTICLE_COUNT) {
sEffTable.shieldParticles[index].base.active = 0;
sEffInfoTable[3].destroy(&sEffTable.shieldParticles[index].params);
return;
}
index -= 3;
if (index < 15) {
index -= SHIELD_PARTICLE_COUNT;
if (index < TIRE_MARK_COUNT) {
sEffTable.tireMarks[index].base.active = 0;
sEffInfoTable[4].destroy(&sEffTable.tireMarks[index].params);
return;
@@ -294,22 +292,22 @@ void Effect_Destroy(GlobalContext* globalCtx, s32 index) {
void Effect_DestroyAll(GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 3; i++) {
for (i = 0; i < SPARK_COUNT; i++) {
sEffTable.sparks[i].base.active = 0;
sEffInfoTable[0].destroy(&sEffTable.sparks[i].params);
}
for (i = 0; i < 25; i++) {
for (i = 0; i < BLURE_COUNT; i++) {
sEffTable.blures[i].base.active = 0;
sEffInfoTable[1].destroy(&sEffTable.blures[i].params);
}
for (i = 0; i < 3; i++) {
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
sEffTable.shieldParticles[i].base.active = 0;
sEffInfoTable[3].destroy(&sEffTable.shieldParticles[i].params);
}
for (i = 0; i < 15; i++) {
for (i = 0; i < TIRE_MARK_COUNT; i++) {
sEffTable.tireMarks[i].base.active = 0;
sEffInfoTable[4].destroy(&sEffTable.tireMarks[i].params);
}
+82 -82
View File
@@ -843,36 +843,36 @@ Gfx* func_8012C014(Gfx* gfx) {
return gfx;
}
void func_8012C058(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x3A]);
void func_8012C058(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x3A]);
}
void func_8012C080(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x39]);
void func_8012C080(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x39]);
}
void func_8012C0A8(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x32]);
void func_8012C0A8(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x32]);
}
void func_8012C0D0(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x33]);
void func_8012C0D0(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x33]);
}
void func_8012C0F8(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x34]);
void func_8012C0F8(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x34]);
}
void func_8012C120(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x35]);
void func_8012C120(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x35]);
}
void func_8012C148(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x36]);
void func_8012C148(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x36]);
}
void func_8012C170(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x37]);
void func_8012C170(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x37]);
}
Gfx* func_8012C198(Gfx* gfx) {
@@ -880,8 +880,8 @@ Gfx* func_8012C198(Gfx* gfx) {
return gfx;
}
void func_8012C1C0(GraphicsContext* gCtxt) {
gCtxt->polyOpa.p = func_8012C198(gCtxt->polyOpa.p);
void func_8012C1C0(GraphicsContext* gfxCtx) {
gfxCtx->polyOpa.p = func_8012C198(gfxCtx->polyOpa.p);
}
Gfx* func_8012C1EC(Gfx* gfx) {
@@ -889,20 +889,20 @@ Gfx* func_8012C1EC(Gfx* gfx) {
return gfx;
}
void func_8012C214(GraphicsContext* gCtxt) {
gCtxt->polyOpa.p = func_8012C1EC(gCtxt->polyOpa.p);
void func_8012C214(GraphicsContext* gfxCtx) {
gfxCtx->polyOpa.p = func_8012C1EC(gfxCtx->polyOpa.p);
}
void func_8012C240(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x19]);
void func_8012C240(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x19]);
}
void func_8012C268(GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
}
void func_8012C28C(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x19]);
void func_8012C28C(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x19]);
}
Gfx* func_8012C2B4(Gfx* gfx) {
@@ -910,8 +910,8 @@ Gfx* func_8012C2B4(Gfx* gfx) {
return gfx;
}
void func_8012C2DC(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x19]);
void func_8012C2DC(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x19]);
}
Gfx* func_8012C304(Gfx* gfx) {
@@ -919,16 +919,16 @@ Gfx* func_8012C304(Gfx* gfx) {
return gfx;
}
void func_8012C32C(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x1F]);
void func_8012C32C(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x1F]);
}
void func_8012C354(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x20]);
void func_8012C354(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x20]);
}
void func_8012C37C(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x21]);
void func_8012C37C(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x21]);
}
Gfx* func_8012C3A4(Gfx* gfx) {
@@ -941,20 +941,20 @@ Gfx* func_8012C3CC(Gfx* gfx) {
return gfx;
}
void func_8012C3F4(GraphicsContext* gCtxt) {
gCtxt->polyOpa.p = func_8012C3CC(gCtxt->polyOpa.p);
void func_8012C3F4(GraphicsContext* gfxCtx) {
gfxCtx->polyOpa.p = func_8012C3CC(gfxCtx->polyOpa.p);
}
void func_8012C420(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x23]);
void func_8012C420(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x23]);
}
void func_8012C448(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x2C]);
void func_8012C448(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x2C]);
}
void func_8012C470(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x24]);
void func_8012C470(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x24]);
}
Gfx* func_8012C498(Gfx* gfx) {
@@ -962,36 +962,36 @@ Gfx* func_8012C498(Gfx* gfx) {
return gfx;
}
void func_8012C4C0(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x1C]);
void func_8012C4C0(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x1C]);
}
void func_8012C4E8(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x2B]);
void func_8012C4E8(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x2B]);
}
void func_8012C510(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x2D]);
void func_8012C510(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x2D]);
}
void func_8012C538(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->overlay.p++, &sSetupDL[6 * 0x2E]);
void func_8012C538(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->overlay.p++, &sSetupDL[6 * 0x2E]);
}
void func_8012C560(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x26]);
void func_8012C560(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x26]);
}
void func_8012C588(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x4]);
void func_8012C588(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x4]);
}
void func_8012C5B0(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x25]);
void func_8012C5B0(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x25]);
}
void func_8012C5D8(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x2]);
void func_8012C5D8(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x2]);
}
Gfx* func_8012C600(Gfx* gfx) {
@@ -999,12 +999,12 @@ Gfx* func_8012C600(Gfx* gfx) {
return gfx;
}
void func_8012C628(GraphicsContext* gCtxt) {
gCtxt->polyOpa.p = func_8012C600(gCtxt->polyOpa.p);
void func_8012C628(GraphicsContext* gfxCtx) {
gfxCtx->polyOpa.p = func_8012C600(gfxCtx->polyOpa.p);
}
void func_8012C654(GraphicsContext* gCtxt) {
gCtxt->overlay.p = func_8012C600(gCtxt->overlay.p);
void func_8012C654(GraphicsContext* gfxCtx) {
gfxCtx->overlay.p = func_8012C600(gfxCtx->overlay.p);
}
void func_8012C680(Gfx** gfxp) {
@@ -1013,16 +1013,16 @@ void func_8012C680(Gfx** gfxp) {
*gfxp = gfx;
}
void func_8012C6AC(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x28]);
void func_8012C6AC(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x28]);
}
void func_8012C6D4(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyOpa.p++, &sSetupDL[6 * 0x29]);
void func_8012C6D4(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, &sSetupDL[6 * 0x29]);
}
void func_8012C6FC(GraphicsContext* gCtxt) {
gSPDisplayList(gCtxt->polyXlu.p++, &sSetupDL[6 * 0x2F]);
void func_8012C6FC(GraphicsContext* gfxCtx) {
gSPDisplayList(gfxCtx->polyXlu.p++, &sSetupDL[6 * 0x2F]);
}
Gfx* func_8012C724(Gfx* gfx) {
@@ -1225,20 +1225,20 @@ Gfx* Gfx_PrimColor(GraphicsContext* gfxCtx, s32 lodfrac, s32 r, s32 g, s32 b, s3
#ifdef NON_MATCHING
// regalloc, some reorderings
void func_8012CF0C(GraphicsContext* gCtxt, s32 iParm2, s32 iParm3, u8 r, u8 g, u8 b) {
void func_8012CF0C(GraphicsContext* gfxCtx, s32 iParm2, s32 iParm3, u8 r, u8 g, u8 b) {
s32 i;
Gfx* gfx;
gSegments[0] = 0;
gSegments[14] = (u32)graphDlEntry;
gSegments[15] = (u32)gCtxt->framebuffer;
gSegments[15] = (u32)gfxCtx->framebuffer;
gfx = graphDlEntry + 0x16;
gSPDisplayList(gfx + 0, &D_0E000140);
gSPDisplayList(gfx + 1, D_801C1CA0);
gDPSetColorImage(gfx + 2, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, 0x0F000000);
if (gCtxt->zbuffer != NULL) {
gDPSetDepthImage(gfx + 3, gCtxt->zbuffer);
if (gfxCtx->zbuffer != NULL) {
gDPSetDepthImage(gfx + 3, gfxCtx->zbuffer);
} else {
gDPSetDepthImage(gfx + 3, 0x0F000000);
}
@@ -1249,16 +1249,16 @@ void func_8012CF0C(GraphicsContext* gCtxt, s32 iParm2, s32 iParm3, u8 r, u8 g, u
gSPEndDisplayList(gfx + 1);
gfx = graphDlEntry + 0x9;
if (gCtxt->zbuffer == NULL) {
if (gfxCtx->zbuffer == NULL) {
gSPEndDisplayList(gfx + 0);
} else {
gDPSetColorImage(gfx + 0, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, gCtxt->zbuffer);
gDPSetColorImage(gfx + 0, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, gfxCtx->zbuffer);
gDPPipeSync(gfx + 1);
gDPSetCycleType(gfx + 2, G_CYC_FILL);
gDPSetRenderMode(gfx + 3, G_RM_NOOP, G_RM_NOOP2);
gDPSetFillColor(gfx + 4, (GPACK_RGBA5551(0xFF, 0xFF, 0xF0, 0) << 16) | GPACK_RGBA5551(0xFF, 0xFF, 0xF0, 0));
gSPDisplayList(gfx + 5, &D_0E0002C8);
gDPSetColorImage(gfx + 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, gCtxt->zbuffer);
gDPSetColorImage(gfx + 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, gfxCtx->zbuffer);
gSPEndDisplayList(gfx + 7);
}
@@ -1289,27 +1289,27 @@ void func_8012CF0C(GraphicsContext* gCtxt, s32 iParm2, s32 iParm3, u8 r, u8 g, u
}
gSPEndDisplayList(gfx + i);
gSPDisplayList(gCtxt->polyOpa.p++, graphDlEntry + 0x16);
gSPDisplayList(gCtxt->polyXlu.p++, graphDlEntry + 0x16);
gSPDisplayList(gCtxt->overlay.p++, graphDlEntry + 0x16);
gSPDisplayList(gCtxt->unk1B8.p++, graphDlEntry + 0x16);
gSPDisplayList(gfxCtx->polyOpa.p++, graphDlEntry + 0x16);
gSPDisplayList(gfxCtx->polyXlu.p++, graphDlEntry + 0x16);
gSPDisplayList(gfxCtx->overlay.p++, graphDlEntry + 0x16);
gSPDisplayList(gfxCtx->unk1B8.p++, graphDlEntry + 0x16);
if (iParm3) {
gSPDisplayList(gCtxt->polyOpa.p++, &D_0E000048);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0E000048);
}
if (iParm2) {
gSPDisplayList(gCtxt->polyOpa.p++, &D_0E000088);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0E000088);
}
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_rcp/func_8012CF0C.asm")
#endif
void func_8012D374(GraphicsContext* gCtxt, u8 r, u8 g, u8 b) {
void func_8012D374(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
if ((R_PAUSE_MENU_MODE < 2) && (D_801F6D10 < 2)) {
func_8012CF0C(gCtxt, 1, 1, r, g, b);
func_8012CF0C(gfxCtx, 1, 1, r, g, b);
} else {
func_8012CF0C(gCtxt, 0, 0, r, g, b);
func_8012CF0C(gfxCtx, 0, 0, r, g, b);
}
}