From 7b22f253b5759d2958fcec75f835e6279d2b296a Mon Sep 17 00:00:00 2001 From: Eblo <7004497+Eblo@users.noreply.github.com> Date: Mon, 10 Nov 2025 21:11:52 -0500 Subject: [PATCH 1/3] Scrolling texture interpolation Co-authored-by: Nicholas Estelami --- mm/2s2h/BenPort.cpp | 9 ++ mm/2s2h/BenPort.h | 1 + mm/2s2h/Rando/DrawFuncs.cpp | 4 +- mm/2s2h/Rando/DrawItem.cpp | 12 +-- mm/include/gfx.h | 4 + mm/src/code/stubs.c | 8 ++ mm/src/code/z_actor.c | 13 +-- mm/src/code/z_fireobj.c | 3 +- mm/src/code/z_kankyo.c | 5 +- mm/src/code/z_rcp.c | 82 ++++++++++++++++--- mm/src/code/z_scene_proc.c | 7 +- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 5 +- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 6 +- .../actors/ovl_Arrow_Light/z_arrow_light.c | 6 +- .../ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c | 9 +- .../overlays/actors/ovl_Boss_01/z_boss_01.c | 10 +-- .../overlays/actors/ovl_Boss_02/z_boss_02.c | 8 +- .../overlays/actors/ovl_Boss_06/z_boss_06.c | 5 +- .../overlays/actors/ovl_Boss_07/z_boss_07.c | 6 +- .../actors/ovl_Boss_Hakugin/z_boss_hakugin.c | 8 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 4 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 4 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 11 +-- mm/src/overlays/actors/ovl_En_An/z_en_an.c | 4 +- mm/src/overlays/actors/ovl_En_Bb/z_en_bb.c | 6 +- .../actors/ovl_En_Bbfall/z_en_bbfall.c | 5 +- .../overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 12 +-- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 4 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 6 +- mm/src/overlays/actors/ovl_En_Dai/z_en_dai.c | 5 +- .../overlays/actors/ovl_En_Death/z_en_death.c | 9 +- mm/src/overlays/actors/ovl_En_Dno/z_en_dno.c | 5 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 4 +- .../actors/ovl_En_Encount3/z_en_encount3.c | 5 +- .../overlays/actors/ovl_En_Fall/z_en_fall.c | 12 ++- mm/src/overlays/actors/ovl_En_Fz/z_en_fz.c | 8 +- mm/src/overlays/actors/ovl_En_Go/z_en_go.c | 7 +- mm/src/overlays/actors/ovl_En_Gs/z_en_gs.c | 5 +- .../actors/ovl_En_Honotrap/z_en_honotrap.c | 5 +- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 4 +- .../overlays/actors/ovl_En_Jso2/z_en_jso2.c | 5 +- .../actors/ovl_En_Knight/z_en_knight.c | 4 +- .../overlays/actors/ovl_En_Light/z_en_light.c | 10 +-- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 14 ++-- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 6 +- mm/src/overlays/actors/ovl_En_Poh/z_en_poh.c | 6 +- mm/src/overlays/actors/ovl_En_Rr/z_en_rr.c | 5 +- mm/src/overlays/actors/ovl_En_Tru/z_en_tru.c | 5 +- .../ovl_En_Water_Effect/z_en_water_effect.c | 4 +- mm/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c | 5 +- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 27 +++--- .../overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c | 3 +- .../overlays/actors/ovl_Obj_Chan/z_obj_chan.c | 3 +- .../ovl_Obj_Fireshield/z_obj_fireshield.c | 4 +- .../actors/ovl_Obj_Hunsui/z_obj_hunsui.c | 8 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 4 +- .../ovl_Obj_Jgame_Light/z_obj_jgame_light.c | 4 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 5 +- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 5 +- .../actors/ovl_Oceff_Spot/z_oceff_spot.c | 4 +- .../actors/ovl_Oceff_Storm/z_oceff_storm.c | 9 +- .../actors/ovl_Oceff_Wipe/z_oceff_wipe.c | 4 +- .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c | 4 +- .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c | 4 +- .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c | 4 +- .../actors/ovl_player_actor/z_player.c | 4 +- .../ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c | 4 +- .../z_eff_ss_fire_tail.c | 6 +- .../z_eff_ss_ice_piece.c | 6 +- .../z_eff_ss_ice_smoke.c | 4 +- .../ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c | 4 +- .../effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c | 3 +- 72 files changed, 318 insertions(+), 205 deletions(-) diff --git a/mm/2s2h/BenPort.cpp b/mm/2s2h/BenPort.cpp index e23afc2a1d..b3be6b1275 100644 --- a/mm/2s2h/BenPort.cpp +++ b/mm/2s2h/BenPort.cpp @@ -329,6 +329,11 @@ extern "C" uint32_t Ship_GetInterpolationFPS() { return OTRGlobals::Instance->GetInterpolationFPS(); } +// Number of interpolated frames +extern "C" uint32_t Ship_GetInterpolationFrameCount() { + return ceil((float)Ship_GetInterpolationFPS() / 20.0f); +} + struct ExtensionEntry { std::string path; std::string ext; @@ -908,8 +913,12 @@ void RunCommands(Gfx* Commands, const std::vector // Process window events for resize, mouse, keyboard events wnd->HandleEvents(); + auto intp = wnd->GetInterpreterWeak().lock().get(); + intp->mInterpolationIndex = 0; + for (const auto& m : mtx_replacements) { wnd->DrawAndRunGraphicsCommands(Commands, m); + intp->mInterpolationIndex++; } } diff --git a/mm/2s2h/BenPort.h b/mm/2s2h/BenPort.h index 2098117d72..d0a5ddd743 100644 --- a/mm/2s2h/BenPort.h +++ b/mm/2s2h/BenPort.h @@ -141,6 +141,7 @@ void Controller_UnblockGameInput(); void Overlay_DisplayText(float duration, const char* text); void Overlay_DisplayText_Seconds(int seconds, const char* text); uint32_t Ship_GetInterpolationFPS(); +uint32_t Ship_GetInterpolationFrameCount(); void Gfx_RegisterBlendedTexture(const char* name, u8* mask, u8* replacement); void Gfx_UnregisterBlendedTexture(const char* name); diff --git a/mm/2s2h/Rando/DrawFuncs.cpp b/mm/2s2h/Rando/DrawFuncs.cpp index 5abf1c4bf5..624e2bdb90 100644 --- a/mm/2s2h/Rando/DrawFuncs.cpp +++ b/mm/2s2h/Rando/DrawFuncs.cpp @@ -37,8 +37,8 @@ void DrawEnLight(Color_RGB8 flameColor, Vec3f flameSize) { Matrix_ReplaceRotation(&gPlayState->billboardMtxF); gSPSegment(POLY_XLU_DISP++, 0x08, - (uintptr_t)Gfx_TwoTexScroll(gPlayState->state.gfxCtx, 0, 0, 0, 0x10, 0x20, 1, (unk_144 * 2) & 0x3F, - (unk_144 * -6) & 0x7F, 0x10, 0x20)); + (uintptr_t)Gfx_TwoTexScrollEx(gPlayState->state.gfxCtx, 0, 0, 0, 0x10, 0x20, 1, (unk_144 * 2) & 0x3F, + (unk_144 * -6) & 0x7F, 0x10, 0x20, 0, 0, 2, -6)); sp68 = (Gfx*)gameplay_keep_DL_01ACF0; gDPSetPrimColor(POLY_XLU_DISP++, 0xC0, 0xC0, flameColor.r, flameColor.g, flameColor.b, 0); gDPSetEnvColor(POLY_XLU_DISP++, flameColor.r, flameColor.g, flameColor.b, 0); diff --git a/mm/2s2h/Rando/DrawItem.cpp b/mm/2s2h/Rando/DrawItem.cpp index 73e752e4f6..fe65e8c113 100644 --- a/mm/2s2h/Rando/DrawItem.cpp +++ b/mm/2s2h/Rando/DrawItem.cpp @@ -154,9 +154,9 @@ void DrawMilkRefill() { Gfx_SetupDL25_Opa(gPlayState->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, - (uintptr_t)Gfx_TwoTexScroll(gPlayState->state.gfxCtx, G_TX_RENDERTILE, -gPlayState->state.frames, - gPlayState->state.frames, 32, 32, 1, -gPlayState->state.frames, - gPlayState->state.frames, 32, 32)); + (uintptr_t)Gfx_TwoTexScrollEx(gPlayState->state.gfxCtx, G_TX_RENDERTILE, -gPlayState->state.frames, + gPlayState->state.frames, 32, 32, 1, -gPlayState->state.frames, + gPlayState->state.frames, 32, 32, -1, 1, -1, 1)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gPlayState->state.gfxCtx); // Container Color gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); @@ -290,9 +290,9 @@ void DrawSkulltulaToken(RandoItemId randoItemId, Actor* actor) { } gSPSegment(POLY_XLU_DISP++, 0x08, - (uintptr_t)Gfx_TwoTexScroll(gPlayState->state.gfxCtx, G_TX_RENDERTILE, gPlayState->state.frames * 0, - -(gPlayState->state.frames * 5), 32, 32, 1, gPlayState->state.frames * 0, - gPlayState->state.frames * 0, 32, 64)); + (uintptr_t)Gfx_TwoTexScrollEx(gPlayState->state.gfxCtx, G_TX_RENDERTILE, gPlayState->state.frames * 0, + -(gPlayState->state.frames * 5), 32, 32, 1, gPlayState->state.frames * 0, + gPlayState->state.frames * 0, 32, 64, 0, -5, 0, 0)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gPlayState->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, (Gfx*)gSkulltulaTokenFlameCopyDL); diff --git a/mm/include/gfx.h b/mm/include/gfx.h index d088b2605c..fcb2cf4737 100644 --- a/mm/include/gfx.h +++ b/mm/include/gfx.h @@ -91,8 +91,11 @@ Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height); void func_8012CB04(Gfx** gfxP, u32 x, u32 y); Gfx* func_8012CB28(GraphicsContext* gfxCtx, u32 x, u32 y); Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height); +Gfx* Gfx_TexScrollEx(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height, s32 xStep, s32 yStep); Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2); +Gfx* Gfx_TwoTexScrollEx(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, + u32 y2, s32 width2, s32 height2, s32 xStep1, s32 yStep1, s32 xStep2, s32 yStep2); Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a); Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a); @@ -105,6 +108,7 @@ void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target); // void gDPSetTextureImage(Gfx* pkt, u32 format, u32 size, u32 width, uintptr_t i); // void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb); void gSPDisplayList(Gfx* pkt, Gfx* dl); +int gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, float lrs, float lrt); void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset); void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0); void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr); diff --git a/mm/src/code/stubs.c b/mm/src/code/stubs.c index 9073dc1e5d..0d945b8445 100644 --- a/mm/src/code/stubs.c +++ b/mm/src/code/stubs.c @@ -200,6 +200,14 @@ void gSPDisplayList(Gfx* pkt, Gfx* dl) { __gSPDisplayList(pkt, dl); } +int gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, float lrs, float lrt) { + __gDPSetTileSizeInterp(pkt++, t, 0, 0, 0, 0); + memcpy(&pkt[0].words.w0, &uls, sizeof(float)); + memcpy(&pkt[0].words.w1, &ult, sizeof(float)); + memcpy(&pkt[1].words.w0, &lrs, sizeof(float)); + memcpy(&pkt[1].words.w1, &lrt, sizeof(float)); +} + void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset) { char* imgData = (char*)dl; diff --git a/mm/src/code/z_actor.c b/mm/src/code/z_actor.c index 8c86e337e9..ad41bb5e5e 100644 --- a/mm/src/code/z_actor.c +++ b/mm/src/code/z_actor.c @@ -5391,8 +5391,8 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[] // Setup to draw ice over frozen actor gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, gameplayFrames & 0xFF, 32, 16, 1, 0, - (gameplayFrames * 2) & 0xFF, 64, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, gameplayFrames & 0xFF, 32, 16, 1, 0, + (gameplayFrames * 2) & 0xFF, 64, 32, 0, 1, 0, 2)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, 255); gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment2MaterialDL); @@ -5449,8 +5449,8 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[] FrameInterpolation_RecordOpenChild(bodyPartsPos, type); twoTexScrollParam = ((bodyPartIndex * 3) + gameplayFrames); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, twoTexScrollParam * 3, twoTexScrollParam * -12, - 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, twoTexScrollParam * 3, twoTexScrollParam * -12, + 32, 64, 1, 0, 0, 32, 32, 3, -12, 0, 0)); Matrix_Translate(bodyPartsPos->x, bodyPartsPos->y, bodyPartsPos->z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); @@ -5497,8 +5497,9 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[] gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, type, (u8)alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, - ((bodyPartIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, + ((bodyPartIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128, 0, 0, + 0, -20)); Matrix_RotateYF(M_PIf, MTXMODE_APPLY); currentMatrix->mf[3][0] = bodyPartsPos->x; diff --git a/mm/src/code/z_fireobj.c b/mm/src/code/z_fireobj.c index 169619b554..dfa52bc87d 100644 --- a/mm/src/code/z_fireobj.c +++ b/mm/src/code/z_fireobj.c @@ -144,7 +144,8 @@ void FireObj_Draw(PlayState* play, FireObj* fire) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (fire->timer * -20) % 512U, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (fire->timer * -20) % 512U, 32, 128, 0, + 0, 0, -20)); gDPSetPrimColor(POLY_XLU_DISP++, 0, fireColors->lod, fireColors->primColor.r, fireColors->primColor.g, fireColors->primColor.b, fireColors->primColor.a); diff --git a/mm/src/code/z_kankyo.c b/mm/src/code/z_kankyo.c index 87129d15b0..77da3e4e7f 100644 --- a/mm/src/code/z_kankyo.c +++ b/mm/src/code/z_kankyo.c @@ -2967,8 +2967,9 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, primColor.r, primColor.g, primColor.b, play->envCtx.sandstormPrimA); gDPSetEnvColor(POLY_XLU_DISP++, envColor.r, envColor.g, envColor.b, play->envCtx.sandstormEnvA); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (u32)sp96 % 4096, 0, 512, 32, 1, - (u32)sp94 % 4096, 4095 - ((u32)sp92 % 4096), 256, 64)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, (u32)sp96 % 4096, 0, 512, 32, 1, + (u32)sp94 % 4096, 4095 - ((u32)sp92 % 4096), 256, 64, sp98, 0, sp98 * 1.5f, + -sp98)); gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE); // #region 2S2H [Widescreen] Widescreen Sandstorm // gSPDisplayList(POLY_XLU_DISP++, gFieldSandstormDL); // Original Dlist call diff --git a/mm/src/code/z_rcp.c b/mm/src/code/z_rcp.c index c099e1d1ce..27cf58e6a3 100644 --- a/mm/src/code/z_rcp.c +++ b/mm/src/code/z_rcp.c @@ -1376,37 +1376,93 @@ Gfx* func_8012CB28(GraphicsContext* gfxCtx, u32 x, u32 y) { return Gfx_TexScroll(gfxCtx, x, y, 0, 0); } -Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) { - Gfx* gfx = GRAPH_ALLOC(gfxCtx, 3 * sizeof(Gfx)); +Gfx* Gfx_TexScrollEx(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height, s32 xStep, s32 yStep) { + int interpFrames = Ship_GetInterpolationFrameCount(); + + Gfx* gfx = GRAPH_ALLOC(gfxCtx, (2 + (interpFrames * 4)) * sizeof(Gfx)); x %= 2048; y %= 2048; - gDPTileSync(&gfx[0]); - gDPSetTileSize(&gfx[1], 0, x, y, (x + ((width - 1) << 2)), (y + ((height - 1) << 2))); - gSPEndDisplayList(&gfx[2]); + float xFlt = (float)x; + float yFlt = (float)y; + + float xInc = (float)xStep / (float)interpFrames; + float yInc = (float)yStep / (float)interpFrames; + + int idx = 0; + + gDPTileSync(&gfx[idx++]); + + for (int i = 0; i < interpFrames; i++) { + gDPSetInterpolation(&gfx[idx++], i); + gDPSetTileSizeInterp(&gfx[idx], 0, xFlt, yFlt, (xFlt + ((width - 1) << 2)), (yFlt + ((height - 1) << 2))); + idx += 3; + + xFlt += xInc; + yFlt += yInc; + } + + gSPEndDisplayList(&gfx[idx++]); return gfx; } -Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, - u32 y2, s32 width2, s32 height2) { - Gfx* gfx = GRAPH_ALLOC(gfxCtx, 5 * sizeof(Gfx)); +Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) { + Gfx_TexScrollEx(gfxCtx, x, y, width, height, 0, 0); +} + +Gfx* Gfx_TwoTexScrollEx(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, + u32 y2, s32 width2, s32 height2, s32 xStep1, s32 yStep1, s32 xStep2, s32 yStep2) { + int interpFrames = Ship_GetInterpolationFrameCount(); + + Gfx* gfx = GRAPH_ALLOC(gfxCtx, (5 + (interpFrames * 7)) * sizeof(Gfx)); x1 %= 2048; y1 %= 2048; x2 %= 2048; y2 %= 2048; - gDPTileSync(&gfx[0]); - gDPSetTileSize(&gfx[1], tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2))); - gDPTileSync(&gfx[2]); - gDPSetTileSize(&gfx[3], tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2))); - gSPEndDisplayList(&gfx[4]); + float x1Flt = (float)x1; + float y1Flt = (float)y1; + float x2Flt = (float)x2; + float y2Flt = (float)y2; + + int index = 0; + + gDPTileSync(&gfx[index++]); + + float xInc1 = (float)xStep1 / (float)interpFrames; + float yInc1 = (float)yStep1 / (float)interpFrames; + + float xInc2 = (float)xStep2 / (float)interpFrames; + float yInc2 = (float)yStep2 / (float)interpFrames; + + for (int i = 0; i < interpFrames; i++) { + gDPSetInterpolation(&gfx[index++], i); + + gDPSetTileSizeInterp(&gfx[index], tile1, x1Flt, y1Flt, (x1Flt + ((width1 - 1) << 2)), + (y1Flt + ((height1 - 1) << 2))); + index += 3; + gDPSetTileSizeInterp(&gfx[index], tile2, x2Flt, y2Flt, (x2Flt + ((width2 - 1) << 2)), + (y2Flt + ((height2 - 1) << 2))); + index += 3; + + x1Flt += xInc1; + x2Flt += xInc2; + y1Flt += yInc1; + y2Flt += yInc2; + } + gSPEndDisplayList(&gfx[index]); return gfx; } +Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, + u32 y2, s32 width2, s32 height2) { + Gfx_TwoTexScrollEx(gfxCtx, tile1, x1, y1, width1, height1, tile2, x2, y2, width2, height2, 0, 0, 0, 0); +} + Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) { Gfx* gfx = GRAPH_ALLOC(gfxCtx, 6 * sizeof(Gfx)); diff --git a/mm/src/code/z_scene_proc.c b/mm/src/code/z_scene_proc.c index ab21c94ff8..1abaaa381b 100644 --- a/mm/src/code/z_scene_proc.c +++ b/mm/src/code/z_scene_proc.c @@ -86,9 +86,10 @@ void AnimatedMat_DrawTexScroll(PlayState* play, s32 segment, void* params) { * Returns a pointer to a two layer texture scroll displaylist. */ Gfx* AnimatedMat_TwoLayerTexScroll(PlayState* play, AnimatedMatTexScrollParams* params) { - return Gfx_TwoTexScroll(play->state.gfxCtx, 0, params[0].xStep * sMatAnimStep, -(params[0].yStep * sMatAnimStep), - params[0].width, params[0].height, 1, params[1].xStep * sMatAnimStep, - -(params[1].yStep * sMatAnimStep), params[1].width, params[1].height); + return Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, params[0].xStep * sMatAnimStep, -(params[0].yStep * sMatAnimStep), + params[0].width, params[0].height, 1, params[1].xStep * sMatAnimStep, + -(params[1].yStep * sMatAnimStep), params[1].width, params[1].height, params[0].xStep, + -(params[0].yStep), params[1].xStep, -(params[1].yStep)); } /** diff --git a/mm/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/mm/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 572c714bea..347dd796d7 100644 --- a/mm/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/mm/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -288,8 +288,9 @@ void ArrowFire_Draw(Actor* thisx, PlayState* play) { FireArrow_SetQuadVerticies(this); gSPDisplayList(POLY_XLU_DISP++, gFireArrowMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 255 - ((frames * 2) % 256), 0, 64, 32, - 1, 255 - (frames % 256), 511 - ((frames * 10) % 512), 64, 64)); + gSPDisplayList(POLY_XLU_DISP++, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 255 - ((frames * 2) % 256), 0, 64, 32, 1, + 255 - (frames % 256), 511 - ((frames * 10) % 512), 64, 64, -2, 0, -1, -10)); gSPDisplayList(POLY_XLU_DISP++, gFireArrowModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/mm/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index f3df615341..6838ea3b03 100644 --- a/mm/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/mm/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -226,9 +226,9 @@ void ArrowIce_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gIceArrowMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1, - 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, + 32, 1, 511 - (stateFrames * 10) % 512, + 511 - (stateFrames * 10) % 512, 4, 16, -5, 0, -10, -10)); gSPDisplayList(POLY_XLU_DISP++, gIceArrowModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/mm/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index b2d6a3b78b..a5c85e660c 100644 --- a/mm/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/mm/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -220,9 +220,9 @@ void ArrowLight_Draw(Actor* thisx, PlayState* play) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gLightArrowMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 511 - ((frames * 5) % 512), 0, 4, 32, 1, - 511 - ((frames * 10) % 512), 511 - ((frames * 30) % 512), 8, 16)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 511 - ((frames * 5) % 512), 0, 4, 32, + 1, 511 - ((frames * 10) % 512), 511 - ((frames * 30) % 512), + 8, 16, -5, 0, -10, -30)); gSPDisplayList(POLY_XLU_DISP++, gLightArrowModelDL); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/mm/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/mm/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c index 82b705b250..bc3c6e0212 100644 --- a/mm/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c +++ b/mm/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c @@ -830,10 +830,11 @@ void BgDblueMovebg_Draw(Actor* thisx, PlayState* play2) { for (j = 0; j < ARRAY_COUNT(this->unk_1D8); j++) { if (this->unk_1D8[j][i] > 0) { if (this->unk_1F8[j][i] > 0.1f) { - gSPSegment(gfx++, 0x09, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, - (s32)(((play->gameplayFrames % 128) * -9.0f) / this->unk_1F8[j][i]), - 0x20, 0x20, 1, 0, 0, 0x20, 0x20)); + gSPSegment( + gfx++, 0x09, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, + (s32)(((play->gameplayFrames % 128) * -9.0f) / this->unk_1F8[j][i]), + 0x20, 0x20, 1, 0, 0, 0x20, 0x20, 0, -9 / this->unk_1F8[j][i], 0, 0)); } Matrix_Push(); Matrix_RotateXS(i * 0x2000, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/mm/src/overlays/actors/ovl_Boss_01/z_boss_01.c index cd4fcca5c1..ce2fb1cc8c 100644 --- a/mm/src/overlays/actors/ovl_Boss_01/z_boss_01.c +++ b/mm/src/overlays/actors/ovl_Boss_01/z_boss_01.c @@ -2627,9 +2627,9 @@ void Boss01_DrawSwordTrail(Boss01* this, PlayState* play) { vtx[sSwordTrailInnerVertexIndices[i]].v.ob[2] = sinf((i * M_PIf) / sSwordTrailAngularRangeDivisor) * 100.0f; } - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 32, 1, play->gameplayFrames * 18, 0, 32, 32)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 32, 1, play->gameplayFrames * 18, 0, + 32, 32, 0, 0, 18, 0)); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)sOdolwaSwordTrailAlpha); @@ -3574,8 +3574,8 @@ void Boss01_DrawEffects(PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, (u8)alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 64, 1, 0, - ((effect->timer + (i * 10)) * -20) & 0x1FF, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 64, 1, 0, + ((effect->timer + (i * 10)) * -20) & 0x1FF, 32, 128, 0, 0, 0, -20)); Matrix_RotateYF(i * (M_PIf / 16.0f), MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, KREG(49) + 200.0f, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/mm/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 9059a2d518..592e62c595 100644 --- a/mm/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/mm/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -1586,8 +1586,8 @@ void Boss02_DrawEffects(PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 185, 140, 70, alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, effect->timer + (i * 3), (effect->timer + (i * 3)) * 5, - 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, effect->timer + (i * 3), (effect->timer + (i * 3)) * 5, + 32, 64, 1, 0, 0, 32, 32, 1, 5, 0, 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); @@ -1660,8 +1660,8 @@ void Boss02_DrawEffects(PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 30, 30, 30, (u8)effect->alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, effect->timer + (i * 3), (effect->timer + (i * 3)) * 5, - 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, effect->timer + (i * 3), (effect->timer + (i * 3)) * 5, + 32, 64, 1, 0, 0, 32, 32, 1, 5, 0, 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); diff --git a/mm/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/mm/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 3975fa2c23..ae040eb1b2 100644 --- a/mm/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/mm/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -734,8 +734,9 @@ void Boss06_Draw(Actor* thisx, PlayState* play2) { Matrix_Push(); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, - ((play->gameplayFrames + (i * 10)) * -20) % 512, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, + ((play->gameplayFrames + (i * 10)) * -20) % 512, 32, 128, 0, 0, 0, + -20)); Matrix_Translate((sCurtainFireEffectPositions[i].x - 32.0f) * -2.4f, (sCurtainFireEffectPositions[i].y - 32.0f) * -2.4f, 0.0f, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_Boss_07/z_boss_07.c b/mm/src/overlays/actors/ovl_Boss_07/z_boss_07.c index 8c42cb333a..f47b3e52fb 100644 --- a/mm/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/mm/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -6623,7 +6623,7 @@ void Boss07_Mask_DrawBeam(Boss07* this, PlayState* play) { if (this->actionFunc == Boss07_Mask_FireBeam) { gSPSegment(POLY_XLU_DISP++, 0x0C, - Gfx_TexScroll(play->state.gfxCtx, 0, (this->frameCounter * -15) & 0xFF, 32, 64)); + Gfx_TexScrollEx(play->state.gfxCtx, 0, (this->frameCounter * -15) & 0xFF, 32, 64, 0, -15)); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, 200); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); @@ -7855,8 +7855,8 @@ void Boss07_BattleHandler_DrawEffects(PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (3 * effect->texScroll) & 0x7F, - (15 * -effect->texScroll) & 0xFF, 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, (3 * effect->texScroll) & 0x7F, + (15 * -effect->texScroll) & 0xFF, 32, 64, 1, 0, 0, 32, 32, 3, -15, 0, 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c b/mm/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c index 8cfcbd1215..3c1dff66c9 100644 --- a/mm/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c +++ b/mm/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c @@ -3276,8 +3276,8 @@ void BossHakugin_DrawMalfunctionEffects(BossHakugin* this, PlayState* play) { FrameInterpolation_RecordOpenChild(malfunctionEffect, j); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, malfunctionEffect->alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, malfunctionEffect->timer * 3, - malfunctionEffect->timer * 15, 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, malfunctionEffect->timer * 3, + malfunctionEffect->timer * 15, 32, 64, 1, 0, 0, 32, 32, 3, 15, 0, 0)); Matrix_Translate(malfunctionEffect->pos.x, malfunctionEffect->pos.y, malfunctionEffect->pos.z, MTXMODE_NEW); Matrix_RotateYS(camYaw, MTXMODE_APPLY); @@ -3456,8 +3456,8 @@ void BossHakugin_DrawIce(BossHakugin* this, PlayState* play) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->gameplayFrames & 0xFF, 32, 16, 1, 0, - (play->gameplayFrames * 2) & 0xFF, 64, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->gameplayFrames & 0xFF, 32, 16, 1, 0, + (play->gameplayFrames * 2) & 0xFF, 64, 32, 0, 1, 0, 2)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, this->iceAlpha); gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment3DL); diff --git a/mm/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/mm/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index f1b724e407..cacbdd009e 100644 --- a/mm/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/mm/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -279,8 +279,8 @@ s32 DemoEffect_OverrideLimbDrawTimewarp(PlayState* play, SkelCurve* skelCurve, s gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, 255); gDPSetEnvColor(POLY_XLU_DISP++, this->envXluColor[0], this->envXluColor[1], this->envXluColor[2], 255); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 6) % 1024, 255 - ((frames * 16) % 256), 0x100, 0x40, 1, - (frames * 4) % 512, 127 - ((frames * 12) % 128), 0x80, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (frames * 6) % 1024, 255 - ((frames * 16) % 256), 0x100, 0x40, + 1, (frames * 4) % 512, 127 - ((frames * 12) % 128), 0x80, 0x20, 6, -16, 4, -12)); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/mm/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index e4a345c1c9..8ad05add5e 100644 --- a/mm/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/mm/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -146,8 +146,8 @@ s32 DemoTreLgt_OverrideLimbDraw(PlayState* play, SkelCurve* skelCuve, s32 limbIn OPEN_DISPS(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (play->state.frames * 2) % 256, 0, 64, 32, 1, - (play->state.frames * -2) % 256, 0, 64, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (play->state.frames * 2) % 256, 0, 64, 32, 1, + (play->state.frames * -2) % 256, 0, 64, 32, 2, 0, -2, 0)); if (limbIndex == OBJECT_BOX_LIGHT_LIMB_01) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 180, this->colorAlpha1); diff --git a/mm/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/mm/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index b29a713555..059091aeff 100644 --- a/mm/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/mm/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -991,9 +991,9 @@ void func_808BAE9C(DoorWarp1* this, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x0A, Matrix_Finalize(play->state.gfxCtx)); Matrix_Push(); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, sp94 & 0xFF, -(TRUNCF_BINANG(2.0f * this->unk_1AC) & 0x1FF), - 0x100, 0x100, 1, sp94 & 0xFF, -(TRUNCF_BINANG(2.0f * this->unk_1AC) & 0x1FF), 0x100, - 0x100)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, sp94 & 0xFF, -(TRUNCF_BINANG(2.0f * this->unk_1AC) & 0x1FF), + 0x100, 0x100, 1, sp94 & 0xFF, -(TRUNCF_BINANG(2.0f * this->unk_1AC) & 0x1FF), 0x100, + 0x100, 10, -2, 10, -2)); Matrix_Translate(0.0f, this->unk_1A4 * 230.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(((this->unk_1C6 * sp90) / 100.0f) + 1.0f, 1.0f, ((this->unk_1C6 * sp90) / 100.0f) + 1.0f, @@ -1010,8 +1010,9 @@ void func_808BAE9C(DoorWarp1* this, PlayState* play) { sp94 *= 2; gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, sp94 & 0xFF, -(TRUNCF_BINANG(this->unk_1AC) & 0x1FF), 0x100, - 0x100, 1, sp94 & 0xFF, -(TRUNCF_BINANG(this->unk_1AC) & 0x1FF), 0x100, 0x100)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, sp94 & 0xFF, -(TRUNCF_BINANG(this->unk_1AC) & 0x1FF), + 0x100, 0x100, 1, sp94 & 0xFF, -(TRUNCF_BINANG(this->unk_1AC) & 0x1FF), 0x100, + 0x100, 10, -1, 10, -1)); Matrix_Translate(0.0f, this->unk_1A8 * 60.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(((this->unk_1C8 * sp8C) / 100.0f) + 1.0f, 1.0f, ((this->unk_1C8 * sp8C) / 100.0f) + 1.0f, diff --git a/mm/src/overlays/actors/ovl_En_An/z_en_an.c b/mm/src/overlays/actors/ovl_En_An/z_en_an.c index f3392bbf3c..84b9a92ef5 100644 --- a/mm/src/overlays/actors/ovl_En_An/z_en_an.c +++ b/mm/src/overlays/actors/ovl_En_An/z_en_an.c @@ -1766,8 +1766,8 @@ void EnAn_DrawAccessory(EnAn* this, PlayState* play, EnAnAccessory accessoryId) MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, this->trayTexScrollTimer1, 0, 16, 16, 1, 0, - this->trayTexScrollTimer2, 16, 16)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, this->trayTexScrollTimer1, 0, 16, 16, 1, 0, + this->trayTexScrollTimer2, 16, 16, 1, 0, 0, -2)); gSPDisplayList(POLY_XLU_DISP++, gAnju1FoodTrayDL); Gfx_SetupDL25_Opa(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/mm/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 1fa1ddee6e..b05f011eec 100644 --- a/mm/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/mm/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -704,9 +704,9 @@ void EnBb_Draw(Actor* thisx, PlayState* play) { Matrix_Scale(this->flameScaleX, this->flameScaleY, 1.0f, MTXMODE_APPLY); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, 255); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0); - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->gameplayFrames * -20) & 0x1FF, 32, 128)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->gameplayFrames * -20) & 0x1FF, + 32, 128, 0, 0, 0, -20)); currentMatrixState->mf[3][1] -= 47.0f * this->flameScaleY; MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/mm/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c b/mm/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c index 04e5ec2a49..b3675abcec 100644 --- a/mm/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/mm/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -751,8 +751,9 @@ void EnBbfall_Draw(Actor* thisx, PlayState* play2) { for (i = 0; i < ARRAY_COUNT(this->flamePos); i++, pos++) { gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, - ((play->gameplayFrames + (i * 10)) * (-20 + i * 2)) & 0x1FF, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, + ((play->gameplayFrames + (i * 10)) * (-20 + i * 2)) & 0x1FF, 32, 128, 0, 0, 0, + -20 + i * 2)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, opacity); currentMatrixState->mf[3][0] = pos->x; currentMatrixState->mf[3][1] = pos->y; diff --git a/mm/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/mm/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index 4e15c3715e..8038196a8d 100644 --- a/mm/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/mm/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -1342,8 +1342,8 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -15) % 512, 0x20, - 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -15) % 512, + 0x20, 0x80, 0, 0, 0, -15)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->mainColor.a); @@ -1438,8 +1438,8 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, PlayState* play) { fireRadius = TRUNCF_BINANG(thisx->scale.x * 500.0f * 100.0f); } gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -20) % 512, 0x20, - 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -20) % 512, + 0x20, 0x80, 0, 0, 0, -20)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, 255 - this->mainColor.a); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 255); @@ -1471,8 +1471,8 @@ void EnBigpo_RevealedFire(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -20) % 512, 0x20, - 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -20) % 512, + 0x20, 0x80, 0, 0, 0, -20)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, 255); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 255); diff --git a/mm/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/mm/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index 7d0f9e6515..1663c2a94d 100644 --- a/mm/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/mm/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -3152,8 +3152,8 @@ void EnBigslime_DrawShatteringEffects(EnBigslime* this, PlayState* play) { if (this->shockwaveAlpha > 0) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, this->shockwaveAlpha); gSPSegment(POLY_XLU_DISP++, 0x0D, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, play->gameplayFrames % 128, (u8)(play->gameplayFrames * 8), - 32, 64, 1, (-play->gameplayFrames * 2) % 64, 0, 16, 16)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, play->gameplayFrames % 128, (u8)(play->gameplayFrames * 8), + 32, 64, 1, (-play->gameplayFrames * 2) % 64, 0, 16, 16, 1, 8, -2, 0)); Matrix_Translate(this->frozenPos.x, this->frozenPos.y, this->frozenPos.z, MTXMODE_NEW); Matrix_Scale(this->shockwaveScale, this->shockwaveScale, this->shockwaveScale, MTXMODE_APPLY); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/mm/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 42cc3d3268..716938feb5 100644 --- a/mm/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/mm/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -899,7 +899,8 @@ void EnClearTag_DrawEffects(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s8)effect->primColor.r, (s8)effect->primColor.g, (s8)effect->primColor.b, (s8)effect->primColor.a); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, -effect->actionTimer * 5, 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, -effect->actionTimer * 5, 32, 64, 1, 0, 0, 32, 32, + 0, -5, 0, 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->smokeScaleX * effect->scale, effect->smokeScaleY * effect->scale, 1.0f, MTXMODE_APPLY); @@ -926,7 +927,8 @@ void EnClearTag_DrawEffects(Actor* thisx, PlayState* play) { // Draw the fire effect. gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, (s8)effect->primColor.a); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, -effect->actionTimer * 15, 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, -effect->actionTimer * 15, 32, 64, 1, 0, 0, 32, 32, + 0, -15, 0, 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/mm/src/overlays/actors/ovl_En_Dai/z_en_dai.c index b7b35b130c..a744983a9a 100644 --- a/mm/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/mm/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -84,8 +84,9 @@ void func_80B3E168(EnDaiEffect* effect, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (u8)alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (effect->unk_02 + (i * 3)) * 3, - (effect->unk_02 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (effect->unk_02 + (i * 3)) * 3, + (effect->unk_02 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20, 3, 15, 0, + 0)); Matrix_Translate(effect->unk_10.x, effect->unk_10.y, effect->unk_10.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); diff --git a/mm/src/overlays/actors/ovl_En_Death/z_en_death.c b/mm/src/overlays/actors/ovl_En_Death/z_en_death.c index 9789c1b0d0..0bfd07506f 100644 --- a/mm/src/overlays/actors/ovl_En_Death/z_en_death.c +++ b/mm/src/overlays/actors/ovl_En_Death/z_en_death.c @@ -1541,8 +1541,8 @@ void EnDeath_DrawFlames(EnDeath* this, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 165, 255, 215, *flameAlpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, - ((play->gameplayFrames + i * 10) * -20) & 0x1FF, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, + ((play->gameplayFrames + i * 10) * -20) & 0x1FF, 32, 128, 0, 0, 0, -20)); cmf->mf[3][0] = sparklePos->x; cmf->mf[3][1] = sparklePos->y; @@ -1575,8 +1575,9 @@ void EnDeath_DrawFlames(EnDeath* this, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 165, 255, 215, alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, - ((play->gameplayFrames + ((i + j) * 10)) * -20) & 511, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, + ((play->gameplayFrames + ((i + j) * 10)) * -20) & 511, 32, 128, 0, 0, 0, + -20)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); FrameInterpolation_RecordCloseChild(); diff --git a/mm/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/mm/src/overlays/actors/ovl_En_Dno/z_en_dno.c index 45ccae5e12..095cef7093 100644 --- a/mm/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/mm/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -1110,8 +1110,9 @@ void EnDno_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, gfxXlu = Gfx_SetupDL71(POLY_XLU_DISP); MATRIX_FINALIZE_AND_LOAD(gfxXlu, play->state.gfxCtx); - gSPSegment(&gfxXlu[1], 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80)); + gSPSegment( + &gfxXlu[1], 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80, 0, 0, 0, -20)); gDPSetPrimColor(&gfxXlu[2], 0x80, 0x80, 255, 255, 0, 255); gDPSetEnvColor(&gfxXlu[3], 255, 0, 0, 0); gSPDisplayList(&gfxXlu[4], gEffFire1DL); diff --git a/mm/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/mm/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 8c19a0fd1b..7a8f222a4b 100644 --- a/mm/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/mm/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -120,8 +120,8 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, play->state.frames * 2, 0, 0x20, 0x40, 1, play->state.frames, - play->state.frames * -8, 0x10, 0x10)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, play->state.frames * 2, 0, 0x20, 0x40, 1, play->state.frames, + play->state.frames * -8, 0x10, 0x10, 2, 0, 1, -8)); gDPPipeSync(POLY_XLU_DISP++); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, sPrimColors[this->type].r, sPrimColors[this->type].g, diff --git a/mm/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c b/mm/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c index bc3f173e09..a060f31fef 100644 --- a/mm/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c +++ b/mm/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c @@ -186,8 +186,9 @@ void EnEncount3_Draw(Actor* thisx, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (s32)play->gameplayFrames, 0, 0x20, 0x40, 1, - (s32)play->gameplayFrames * -2, (s32)play->gameplayFrames * -8, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (s32)play->gameplayFrames, 0, 0x20, 0x40, 1, + (s32)play->gameplayFrames * -2, (s32)play->gameplayFrames * -8, 0x20, 0x20, 1, 0, + -2, -8)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 200, 0, (s8)this->unk170); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); diff --git a/mm/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/mm/src/overlays/actors/ovl_En_Fall/z_en_fall.c index b183ed8bc2..01a8981d53 100644 --- a/mm/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/mm/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -870,13 +870,17 @@ void EnFall_Fireball_Draw(Actor* thisx, PlayState* play) { // For the glowing sphere of fire gSPSegment(POLY_XLU_DISP++, 0x09, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, gameplayFrames, -this->fireballYTexScroll2, 64, 64, 1, - -gameplayFrames, -this->fireballYTexScroll1, 64, 64)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, gameplayFrames, -this->fireballYTexScroll2, 64, 64, 1, + -gameplayFrames, -this->fireballYTexScroll1, 64, 64, 1, + -(2.0f + (this->fireballIntensity * 6.0f)), -1, + -(4.0f + (this->fireballIntensity * 12.0f)))); // For the "flecks" of fire around the fireball gSPSegment(POLY_XLU_DISP++, 0x0A, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64, 1, - -gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64, 1, + -gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64, 2, + -(4.0f + (this->fireballIntensity * 12.0f)), -2, + -(4.0f + (this->fireballIntensity * 12.0f)))); gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE); gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE); diff --git a/mm/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/mm/src/overlays/actors/ovl_En_Fz/z_en_fz.c index aae0c8fd0f..669b9f156a 100644 --- a/mm/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/mm/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -849,8 +849,8 @@ void EnFz_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, play->state.frames % 128, 0x20, 0x20, 1, 0, - (play->state.frames * 2) % 128, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, play->state.frames % 128, 0x20, 0x20, 1, 0, + (play->state.frames * 2) % 128, 0x20, 0x20, 0, 1, 0, 2)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gDPSetCombineLERP(POLY_XLU_DISP++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, ENVIRONMENT, 0); @@ -1013,8 +1013,8 @@ void func_80934464(EnFz* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, ptr->unk_2C); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (ptr->unk_01 + (i * 3)) * 3, - (ptr->unk_01 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (ptr->unk_01 + (i * 3)) * 3, + (ptr->unk_01 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20, 3, 15, 0, 0)); Matrix_Translate(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); diff --git a/mm/src/overlays/actors/ovl_En_Go/z_en_go.c b/mm/src/overlays/actors/ovl_En_Go/z_en_go.c index 7d287560ed..2dfc0f65c3 100644 --- a/mm/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/mm/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -798,8 +798,9 @@ void EnGo_DrawSteam(EnGoEffect effect[ENGO_EFFECT_COUNT], PlayState* play2) { alpha *= 255.0f; gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (u8)alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (effect->alphaNumer + (i * 3)) * 3, - (effect->alphaNumer + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (effect->alphaNumer + (i * 3)) * 3, + (effect->alphaNumer + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20, 3, 15, 0, + 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); @@ -1806,7 +1807,7 @@ void EnGo_DrawIceBlockWhenFrozen(EnGo* this, PlayState* play, f32 scale, f32 alp y1 = play->gameplayFrames % 256; y2 = (play->gameplayFrames * 2) % 256; gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, y1, 0x20, 0x10, 1, 0, y2, 0x40, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, y1, 0x20, 0x10, 1, 0, y2, 0x40, 0x20, 0, 1, 0, 2)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, (u8)alpha); gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment3DL); diff --git a/mm/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/mm/src/overlays/actors/ovl_En_Gs/z_en_gs.c index e23a8ab352..93ae2e5f86 100644 --- a/mm/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/mm/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -1125,8 +1125,9 @@ void EnGs_Draw(Actor* thisx, PlayState* play) { Matrix_Scale(0.05f, -0.05f, 1.0f, MTXMODE_APPLY); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80)); + gSPSegment( + POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80, 0, 0, 0, -20)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/mm/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/mm/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 520ba3e379..ac8b2904dd 100644 --- a/mm/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/mm/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -762,7 +762,7 @@ void EnHonotrap_DrawFlame(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, this->flameScroll, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, this->flameScroll, 32, 128, 0, 0, 0, -20)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); Matrix_RotateYS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000, MTXMODE_APPLY); @@ -793,7 +793,8 @@ void EnHonotrap_DrawFlameGroup(Actor* thisx, PlayState* play) { flameElem = &flameGroup->flameList[i]; if (flameElem->isDrawn) { gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, flameElem->flameScroll, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, flameElem->flameScroll, 32, 128, 0, + 0, 0, -20)); Matrix_SetTranslateRotateYXZ(flameElem->pos.x, flameElem->pos.y - (4000.0f * flameElem->unkC), flameElem->pos.z, &camDir); Matrix_Scale(((fabsf(Math_SinS((s16)(camDir.y - thisx->shape.rot.y) >> 1)) * 0.2f) + 1.7f) * diff --git a/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index 6d55e117e5..d6aa7d181c 100644 --- a/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -5149,8 +5149,8 @@ void EnInvadepoh_DrawWarpEffects(PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, warpEffect->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0); gSPSegment(POLY_XLU_DISP++, 0x8, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, warpScrollX1, 0, 32, 64, 1, 0, - warpScrollY2, 32, 64)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, warpScrollX1, 0, 32, 64, 1, 0, + warpScrollY2, 32, 64, 1, 0, 0, -15)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_02E510); } diff --git a/mm/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/mm/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c index f49613aa56..c91f2d6c5f 100644 --- a/mm/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c +++ b/mm/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c @@ -1898,8 +1898,9 @@ void EnJso2_Draw(Actor* thisx, PlayState* play2) { Matrix_Translate(this->flamePos[i].x, this->flamePos[i].y, this->flamePos[i].z, MTXMODE_NEW); Matrix_Scale(this->flameScale[i].x, this->flameScale[i].y, this->flameScale[i].z, MTXMODE_APPLY); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 64, 1, 0, - ((this->flameScroll * 10) - (play->state.frames * 20)) & 0x1FF, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 64, 1, 0, + ((this->flameScroll * 10) - (play->state.frames * 20)) & 0x1FF, 32, 128, 0, 0, + 0, -20)); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 255); diff --git a/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c b/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c index 91b7192cb8..ea4b377b1f 100644 --- a/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c +++ b/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c @@ -4393,8 +4393,8 @@ void EnKnight_DrawEffects(EnKnight* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 155, 155, 255, eff->alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (eff->scrollTimer + i * 3) * 3, - (eff->scrollTimer + i * 3) * 15, 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, (eff->scrollTimer + i * 3) * 3, + (eff->scrollTimer + i * 3) * 15, 32, 64, 1, 0, 0, 32, 32, 3, 15, 0, 0)); Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); diff --git a/mm/src/overlays/actors/ovl_En_Light/z_en_light.c b/mm/src/overlays/actors/ovl_En_Light/z_en_light.c index 809173e896..26ba4dd78e 100644 --- a/mm/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/mm/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -169,16 +169,16 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); if (this->actor.params >= 0) { - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->unk_144 * -20) & 0x1FF, 0x20, 0x80)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->unk_144 * -20) & 0x1FF, + 0x20, 0x80, 0, 0, 0, -20)); sp68 = gEffFire1DL; gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, sp6C->unk_00.r, sp6C->unk_00.g, sp6C->unk_00.b, sp6C->unk_00.a); gDPSetEnvColor(POLY_XLU_DISP++, sp6C->unk_04.r, sp6C->unk_04.g, sp6C->unk_04.b, 0); } else { gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x10, 0x20, 1, (this->unk_144 * 2) & 0x3F, - (this->unk_144 * -6) & 0x7F, 0x10, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x10, 0x20, 1, (this->unk_144 * 2) & 0x3F, + (this->unk_144 * -6) & 0x7F, 0x10, 0x20, 0, 0, 2, -6)); sp68 = gameplay_keep_DL_01ACF0; gDPSetPrimColor(POLY_XLU_DISP++, 0xC0, 0xC0, 255, 200, 0, 0); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); diff --git a/mm/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/mm/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index ea2163a486..d0a465c0ba 100644 --- a/mm/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/mm/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -498,15 +498,16 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { case ENMTHUNDER_SUBTYPE_SPIN_GREAT: case ENMTHUNDER_SUBTYPE_SPIN_REGULAR: gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0xFF - ((u16)(s32)(this->scroll * 30.0f) & 0xFF), 0, 64, - 32, 1, 0xFF - ((u16)(s32)(this->scroll * 20.0f) & 0xFF), 0, 8, 8)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0xFF - ((u16)(s32)(this->scroll * 30.0f) & 0xFF), 0, + 64, 32, 1, 0xFF - ((u16)(s32)(this->scroll * 20.0f) & 0xFF), 0, 8, 8, -30, 0, + -20, 0)); break; case ENMTHUNDER_SUBTYPE_SWORDBEAM_GREAT: case ENMTHUNDER_SUBTYPE_SWORDBEAM_REGULAR: gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 16, 64, 1, 0, - 0x1FF - ((u16)(s32)(this->scroll * 10.0f) & 0x1FF), 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 16, 64, 1, 0, + 0x1FF - ((u16)(s32)(this->scroll * 10.0f) & 0x1FF), 32, 128, 0, 0, 0, -10)); break; default: @@ -576,8 +577,9 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x09, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (play->gameplayFrames * 5) & 0xFF, 0, 32, 32, 1, - (play->gameplayFrames * 20) & 0xFF, (play->gameplayFrames * y2Scroll) & 0xFF, 8, 8)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (play->gameplayFrames * 5) & 0xFF, 0, 32, 32, 1, + (play->gameplayFrames * 20) & 0xFF, (play->gameplayFrames * y2Scroll) & 0xFF, 8, 8, 5, + 0, 20, y2Scroll)); gSPDisplayList(POLY_XLU_DISP++, gSpinAttackChargingDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index d2e0f4a087..fc525c151b 100644 --- a/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1226,9 +1226,9 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_OPA_DISP++, gPoeSistersTorchDL); } - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->gameplayFrames * -20) % 512, 32, 128)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->gameplayFrames * -20) % 512, 32, + 128, 0, 0, 0, -20)); gDPSetEnvColor(POLY_XLU_DISP++, sisterEnvColor->r, sisterEnvColor->g, sisterEnvColor->b, sisterEnvColor->a); if (this->actionFunc == EnPoSisters_DeathStage2) { diff --git a/mm/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/mm/src/overlays/actors/ovl_En_Poh/z_en_poh.c index d675f296d3..ad4abecf33 100644 --- a/mm/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/mm/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -1023,9 +1023,9 @@ void func_80B2F37C(Actor* thisx, PlayState* play) { } else { Gfx_SetupDL25_Xlu(play->state.gfxCtx); - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->unk_190 * -8) & 0x1FF, 0x20, 0x80)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->unk_190 * -8) & 0x1FF, 0x20, + 0x80, 0, 0, 0, -8)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 170, 255, this->unk_197); gDPSetEnvColor(POLY_XLU_DISP++, this->unk_194, this->unk_195, this->unk_196, 255); diff --git a/mm/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/mm/src/overlays/actors/ovl_En_Rr/z_en_rr.c index d03e11535f..bb0e3d0581 100644 --- a/mm/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/mm/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -893,8 +893,9 @@ void EnRr_Draw(Actor* thisx, PlayState* play2) { gSPSegment(POLY_OPA_DISP++, 0x0C, mtx); gSPSegment(POLY_OPA_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (this->unk_1E8 * 0) & 0x7F, (this->unk_1E8 * 0) & 0x3F, 0x20, - 0x10, 1, (this->unk_1E8 * 0) & 0x3F, (this->unk_1E8 * -6) & 0x7F, 0x20, 0x10)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (this->unk_1E8 * 0) & 0x7F, (this->unk_1E8 * 0) & 0x3F, 0x20, + 0x10, 1, (this->unk_1E8 * 0) & 0x3F, (this->unk_1E8 * -6) & 0x7F, 0x20, 0x10, 0, 0, 0, + -6)); Matrix_Push(); Matrix_Scale((1.0f + this->unk_324[0].unk_10) * this->unk_324[0].unk_08, 1.0f, diff --git a/mm/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/mm/src/overlays/actors/ovl_En_Tru/z_en_tru.c index a98847c7e0..c78e0b3ae8 100644 --- a/mm/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/mm/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -256,8 +256,9 @@ void func_80A85788(EnTruUnkStruct* arg0, PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)alpha); - gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, -arg0->unk_02 * 5, 32, 64, 1, 0, 0, 32, 32)); + gSPSegment( + POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, -arg0->unk_02 * 5, 32, 64, 1, 0, 0, 32, 32, 0, -5, 0, 0)); Matrix_Translate(arg0->unk_04.x, arg0->unk_04.y, arg0->unk_04.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); diff --git a/mm/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/mm/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index 87f7323a78..34670a16f5 100644 --- a/mm/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/mm/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -544,8 +544,8 @@ void func_80A5A184(Actor* thisx, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, (u8)ptr->unk_38, 0, 0, (u8)ptr->unk_3C); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (ptr->unk_01 * -20) & 0x1FF, - 0x20, 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (ptr->unk_01 * -20) & 0x1FF, + 0x20, 0x80, 0, 0, 0, -20)); Matrix_Translate(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, MTXMODE_NEW); diff --git a/mm/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/mm/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c index 1131a29d5e..5c8bad4c1f 100644 --- a/mm/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/mm/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -1560,8 +1560,9 @@ void EnWiz_Draw(Actor* thisx, PlayState* play) { Matrix_Translate(this->staffFlamePos.x, this->staffFlamePos.y, this->staffFlamePos.z, MTXMODE_NEW); Matrix_Scale(this->staffFlameScale.x, this->staffFlameScale.y, this->staffFlameScale.z, MTXMODE_APPLY); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, - ((this->staffFlameScroll * 10) - (play->state.frames * 20)) % 512, 32, 128)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, + ((this->staffFlameScroll * 10) - (play->state.frames * 20)) % 512, 32, 128, 0, 0, 0, + -20)); gDPPipeSync(POLY_XLU_DISP++); if ((this->type == EN_WIZ_TYPE_FIRE) || (this->type == EN_WIZ_TYPE_FIRE_NO_BGM)) { diff --git a/mm/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/mm/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index a680e1a4bd..7fb2f2220d 100644 --- a/mm/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/mm/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -681,8 +681,9 @@ void EnWizFire_DrawIcePool(EnWizFire* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 215, 215, 215, (s8)this->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, -play->state.frames & 0x7F, -play->state.frames & 0x7F, 32, - 64, 1, play->state.frames & 0xFF, play->state.frames & 0xFF, 16, 16)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, -play->state.frames & 0x7F, -play->state.frames & 0x7F, 32, + 64, 1, play->state.frames & 0xFF, play->state.frames & 0xFF, 16, 16, -1, -1, 1, + 1)); Matrix_RotateYS(0, MTXMODE_APPLY); @@ -709,8 +710,8 @@ void EnWizFire_DrawFirePoolAndFlame(EnWizFire* this, PlayState* play2) { Matrix_Scale(this->poolScale, this->poolScale, this->poolScale, MTXMODE_APPLY); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, -play->state.frames % 128, 0, 0x20, 0x20, 1, - (play->state.frames * 2) % 128, 0, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, -play->state.frames % 128, 0, 0x20, 0x20, 1, + (play->state.frames * 2) % 128, 0, 0x20, 0x20, -1, 0, 2, 0)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 40, 0, (s8)this->alpha); @@ -724,9 +725,9 @@ void EnWizFire_DrawFirePoolAndFlame(EnWizFire* this, PlayState* play2) { Matrix_ReplaceRotation(&play->billboardMtxF); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, play->state.frames % 128, (-play->state.frames * 6) % 256, - 0x20, 0x40, 1, (play->state.frames * 2) % 128, (-play->state.frames * 6) % 256, - 0x20, 0x40)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, play->state.frames % 128, (-play->state.frames * 6) % 256, + 0x20, 0x40, 1, (play->state.frames * 2) % 128, (-play->state.frames * 6) % 256, + 0x20, 0x40, 1, -6, 2, -6)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 80, 0, 0, (s8)this->alpha); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 100); @@ -742,8 +743,8 @@ void EnWizFire_DrawFirePoolAndFlame(EnWizFire* this, PlayState* play2) { Matrix_ReplaceRotation(&play->billboardMtxF); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (-play->state.frames * 3) % 128, 0, 0x20, 0x20, 1, 0, - (-play->state.frames * 10) % 256, 0x20, 0x40)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (-play->state.frames * 3) % 128, 0, 0x20, 0x20, 1, 0, + (-play->state.frames * 10) % 256, 0x20, 0x40, -3, 0, 0, -10)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 50, 0, 255); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 200, 235, 240, 128); @@ -813,8 +814,8 @@ void EnWizFire_DrawSmallFlame(Actor* thisx, PlayState* play) { MTXMODE_APPLY); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 32, 1, this->smallFlameScroll & 0x7F, - (-this->smallFlameScroll * 10) & 0x7F, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 32, 1, this->smallFlameScroll & 0x7F, + (-this->smallFlameScroll * 10) & 0x7F, 32, 32, 0, 0, 1, -10)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 100, 50, 0, (s8)this->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 200, 235, 245, 255); @@ -898,8 +899,8 @@ void EnWizFire_DrawEffects(EnWizFire* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, effect->alpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, (effect->smokeScroll * 3) & 0x7F, - (effect->smokeScroll * 0xF) & 0xFF, 32, 64, 1, 0, 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, (effect->smokeScroll * 3) & 0x7F, + (effect->smokeScroll * 0xF) & 0xFF, 32, 64, 1, 0, 0, 32, 32, 3, 0xF, 0, 0)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); diff --git a/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c index f5420c4c61..5f950ebea0 100644 --- a/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -279,7 +279,8 @@ void ObjAqua_Draw(Actor* thisx, PlayState* play) { framesTemp >>= 1; } gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, framesTemp, 0x20, 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, framesTemp, 0x20, 0x80, 0, 0, 0, + actionFuncTemp ? -5 : -0xA)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, this->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 0, 150, 255, 0); if (actionFuncTemp) { diff --git a/mm/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/mm/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index 4c385c2408..ab920dd360 100644 --- a/mm/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/mm/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -435,7 +435,8 @@ void ObjChan_DrawFire(ObjChan* this, PlayState* play) { dl = Gfx_SetupDL71(POLY_XLU_DISP); MATRIX_FINALIZE_AND_LOAD(&dl[0], play->state.gfxCtx); - gSPSegment(&dl[1], 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, -sp4C * 20, 32, 128)); + gSPSegment(&dl[1], 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, -sp4C * 20, 32, 128, 0, 0, 0, -20)); gDPSetPrimColor(&dl[2], 128, 128, 255, 255, 0, 255); gDPSetEnvColor(&dl[3], 255, 0, 0, 0); gSPDisplayList(&dl[4], gEffFire1DL); diff --git a/mm/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c b/mm/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c index 87284183fd..39b6100491 100644 --- a/mm/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c +++ b/mm/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c @@ -386,8 +386,8 @@ void ObjFireshield_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 220, 0, this->unk_1A6); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, this->unk_1A4 & 0x7F, 0, 0x20, 0x40, 1, 0, - (this->unk_1A4 * -15) & 0xFF, 0x20, 0x40)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, this->unk_1A4 & 0x7F, 0, 0x20, 0x40, 1, 0, + (this->unk_1A4 * -15) & 0xFF, 0x20, 0x40, 1, 0, 0, -15)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_02E510); diff --git a/mm/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/mm/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index 3afa4ac60c..385c69e613 100644 --- a/mm/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/mm/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -661,11 +661,11 @@ void func_80B9DA60(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, (play->gameplayFrames % 128) * -9, 0x20, 0x20, 1, 0, - (play->gameplayFrames % 128) * -8, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, (play->gameplayFrames % 128) * -9, 0x20, 0x20, 1, 0, + (play->gameplayFrames % 128) * -8, 0x20, 0x20, 0, -9, 0, -8)); gSPSegment(POLY_XLU_DISP++, 0x09, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, (s32)this->unk_1AC, 0x20, 0x20, 1, 0, - (s32)this->unk_1B0, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, (s32)this->unk_1AC, 0x20, 0x20, 1, 0, + (s32)this->unk_1B0, 0x20, 0x20, 0, 1, 0, 1)); CLOSE_DISPS(play->state.gfxCtx); } else { diff --git a/mm/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/mm/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 0aabb59a78..c2a9928220 100644 --- a/mm/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/mm/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -350,8 +350,8 @@ void ObjIcePoly_Draw(Actor* thisx, PlayState* play) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, play->gameplayFrames % 256, 0x20, 0x10, 1, 0, - (play->gameplayFrames * 2) % 256, 0x40, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, play->gameplayFrames % 256, 0x20, 0x10, 1, 0, + (play->gameplayFrames * 2) % 256, 0x40, 0x20, 0, 1, 0, 2)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, this->unk_148); gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment3DL); diff --git a/mm/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c b/mm/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c index 9f6bd9ce2e..5d1d3e6c00 100644 --- a/mm/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c +++ b/mm/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c @@ -193,8 +193,8 @@ void ObjJgameLight_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); scale = (this->flameScaleProportion * 27.0f) / 10000.0f; gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->flameScroll * -20) & 0x1FF, - 0x20, 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->flameScroll * -20) & 0x1FF, + 0x20, 0x80, 0, 0, 0, -20)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); Matrix_Translate(0.0f, 52.0f, 0.0f, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/mm/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index bb171a380f..71e6e82891 100644 --- a/mm/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/mm/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -309,8 +309,9 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { flameScale *= 0.0027f; Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, - (this->flameTexScroll * -OBJ_SYOKUDAI_SNUFF_DEFAULT) & 0x1FF, 0x20, 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, + (this->flameTexScroll * -OBJ_SYOKUDAI_SNUFF_DEFAULT) & 0x1FF, 0x20, 0x80, 0, 0, 0, + -OBJ_SYOKUDAI_SNUFF_DEFAULT)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); Matrix_Translate(0.0f, OBJ_SYOKUDAI_FLAME_HEIGHT, 0.0f, MTXMODE_APPLY); diff --git a/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index adee50a1d9..799c245fdf 100644 --- a/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -861,8 +861,9 @@ void ObjTokeidai_Counterweight_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); // For scrolling the spotlight's mask texture down the length of the light beam. - gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, -gameplayFrames, 0, 0x20, 0x20)); + gSPSegment( + POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, -gameplayFrames, 0, 0x20, 0x20, 0, 0, -1, 0)); // Draws the counterweight MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/mm/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 86480b58fa..0653a92fce 100644 --- a/mm/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/mm/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -163,8 +163,8 @@ void OceffSpot_Draw(Actor* thisx, PlayState* play) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, &sSunSongEffectCylinderMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, 0, scroll * 2, scroll * -2, 0x20, 0x20, 1, 0, - scroll * -8, 0x20, 0x20)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, scroll * 2, scroll * -2, 0x20, 0x20, 1, 0, + scroll * -8, 0x20, 0x20, 2, -2, 0, -8)); gSPDisplayList(POLY_XLU_DISP++, &sSunSongEffectCylinderModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/mm/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index dbbd50c4bc..63c9e1ad89 100644 --- a/mm/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/mm/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -185,8 +185,8 @@ void OceffStorm_Draw2(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 200, 200, 150, this->primColorAlpha); gSPDisplayList(POLY_XLU_DISP++, &sSongOfStormsMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 8, scroll * 4, 64, - 64, 1, scroll * 4, scroll * 4, 64, 64)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 8, scroll * 4, 64, + 64, 1, scroll * 4, scroll * 4, 64, 64, 8, 4, 4, 4)); // 2S2H [Cosmetic] Changed to Wide variant to support widescreen gSPWideTextureRectangle(POLY_XLU_DISP++, OTRGetRectDimensionFromLeftEdge(0) << 2, 0, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) << 2, SCREEN_HEIGHT << 2, G_TX_RENDERTILE, 0, @@ -218,8 +218,9 @@ void OceffStorm_Draw(Actor* thisx, PlayState* play) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, &sSongOfStormsCylinderMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 4, (0 - scroll) * 8, - 32, 32, 1, scroll * 8, (0 - scroll) * 12, 32, 32)); + gSPDisplayList(POLY_XLU_DISP++, + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 4, (0 - scroll) * 8, 32, 32, 1, + scroll * 8, (0 - scroll) * 12, 32, 32, 4, -8, 8, -12)); gSPDisplayList(POLY_XLU_DISP++, &sSongOfStormsCylinderModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/mm/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 05e37fb526..fc0390c394 100644 --- a/mm/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/mm/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -131,8 +131,8 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) { } gSPDisplayList(POLY_XLU_DISP++, sSongOfTimeFrustumMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 - scroll, scroll * -2, 32, - 32, 1, 0 - scroll, scroll * -2, 32, 32)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, 0 - scroll, scroll * -2, 32, + 32, 1, 0 - scroll, scroll * -2, 32, 32, -1, -2, -1, -2)); gSPDisplayList(POLY_XLU_DISP++, sSongOfTimeFrustumModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/mm/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 15dcdf81ab..b93123c3ec 100644 --- a/mm/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/mm/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -109,8 +109,8 @@ void OceffWipe2_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128); gSPDisplayList(POLY_XLU_DISP++, sEponaSongFrustumMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 6, scroll * -6, 64, - 64, 1, scroll * -6, 0, 64, 64)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 6, scroll * -6, 64, + 64, 1, scroll * -6, 0, 64, 64, 6, -6, -6, 0)); gSPDisplayList(POLY_XLU_DISP++, sEponaSongFrustumModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/mm/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index babffe882e..62f71d35c2 100644 --- a/mm/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/mm/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -109,8 +109,8 @@ void OceffWipe3_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, 255); gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 128); gSPDisplayList(POLY_XLU_DISP++, &sSariaSongFrustrumMaterialDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, 0, scroll * 12, scroll * -12, 64, 64, 1, - scroll * 8, scroll * -8, 64, 64)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, scroll * 12, scroll * -12, 64, 64, 1, + scroll * 8, scroll * -8, 64, 64, 12, -12, 8, -8)); gSPDisplayList(POLY_XLU_DISP++, &sSariaSongFrustumModelDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/mm/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/mm/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index a5471e83d4..80b34cf90a 100644 --- a/mm/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/mm/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -118,8 +118,8 @@ void OceffWipe4_Draw(Actor* thisx, PlayState* play) { Gfx* scarecrowSongModelDL = ResourceMgr_LoadTexOrDListByName(sScarecrowSongModelDL); gSPDisplayList(POLY_XLU_DISP++, scarecrowSongModelDL); - gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 2, scroll * -2, 32, - 64, 1, scroll * -1, scroll, 32, 32)); + gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 2, scroll * -2, 32, + 64, 1, scroll * -1, scroll, 32, 32, 2, -2, -1, 1)); // Index adjust 11 -> 14 (for gsSPVertex) to account for our extraction size changes gSPDisplayList(POLY_XLU_DISP++, &scarecrowSongModelDL[14]); // #endregion diff --git a/mm/src/overlays/actors/ovl_player_actor/z_player.c b/mm/src/overlays/actors/ovl_player_actor/z_player.c index 129ba3dd6f..b1146b2784 100644 --- a/mm/src/overlays/actors/ovl_player_actor/z_player.c +++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c @@ -13466,8 +13466,8 @@ void Player_Draw(Actor* thisx, PlayState* play) { f32 temp_fa0 = this->unk_B48; gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, -(s32)play->gameplayFrames & 0x7F, 0x20, 0x20, 1, 0, - ((s32)play->gameplayFrames * -2) & 0x7F, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, -(s32)play->gameplayFrames & 0x7F, 0x20, 0x20, 1, 0, + ((s32)play->gameplayFrames * -2) & 0x7F, 0x20, 0x20, 0, -1, 0, -2)); Matrix_Scale(temp_fa0, temp_fa0, temp_fa0, MTXMODE_APPLY); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); diff --git a/mm/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/mm/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c index 1a1df5afcf..66fe31cdf8 100644 --- a/mm/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c +++ b/mm/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c @@ -115,8 +115,8 @@ void EffectSsEnIce_Draw(PlayState* play, u32 index, EffectSs* this) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); func_800BCC68(&this->pos, play); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, gameplayFrames & 0xFF, 0x20, 0x10, 1, 0, - (gameplayFrames * 2) & 0xFF, 0x40, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, gameplayFrames & 0xFF, 0x20, 0x10, 1, 0, + (gameplayFrames * 2) & 0xFF, 0x40, 0x20, 0, 1, 0, 2)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA); gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, (u32)alpha); diff --git a/mm/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c b/mm/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c index bff9e8f457..bfa82590be 100644 --- a/mm/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c +++ b/mm/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c @@ -124,9 +124,9 @@ void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255); gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0); - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->state.frames * -20) & 0x1FF, 32, 128)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->state.frames * -20) & 0x1FF, 32, + 128, 0, 0, 0, -20)); if (this->rType != 0) { gSPDisplayList(POLY_XLU_DISP++, gEffFire2DL); diff --git a/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c b/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c index fb64ffcd7d..8a60bcb53c 100644 --- a/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c +++ b/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c @@ -68,9 +68,9 @@ void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, (u8)(s32)alpha); func_800BCC68(&this->pos, play); - gSPSegment( - POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, frames % 256, 0x20, 0x10, 1, 0, (2 * frames) % 256, 0x40, 0x20)); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, frames % 256, 0x20, 0x10, 1, 0, (2 * frames) % 256, 0x40, + 0x20, 0, 1, 0, 2)); gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment1DL); CLOSE_DISPS(gfxCtx); diff --git a/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c index 5c8c1de8f1..3b02b42239 100644 --- a/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c +++ b/mm/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c @@ -55,8 +55,8 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 235, 235, this->rAlpha); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, this->rScrollX * this->life, this->rScrollY * this->life, 0x20, - 0x40, 1, 0, 0, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, this->rScrollX * this->life, this->rScrollY * this->life, 0x20, + 0x40, 1, 0, 0, 0x20, 0x20, -1, -1, 0, 0)); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); scale = this->rScale * 0.0001f; diff --git a/mm/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c b/mm/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c index 877d3e5c75..d2f72f1d69 100644 --- a/mm/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c +++ b/mm/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c @@ -57,8 +57,8 @@ void EffectSsKFire_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_Scale(xzScale, yScale, xzScale, MTXMODE_APPLY); Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->rScroll, 0x20, - 0x80)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->rScroll, + 0x20, 0x80, 0, 0, 0, this->rScroll)); if (this->rType >= 100) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, this->rAlpha); diff --git a/mm/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c b/mm/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c index 74cb27e3ef..996074fbd9 100644 --- a/mm/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c +++ b/mm/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.c @@ -155,7 +155,8 @@ void EffectSsSbn_DrawSliding(PlayState* play, u32 index, EffectSs* this) { this->rScroll += this->rScrollStep; } gSPSegment(POLY_XLU_DISP++, 0x09, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, this->rScroll, 0x20, 0x20)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, this->rScroll, 0x20, 0x20, 0, 0, 0, + this->rScrollStep)); gSPDisplayList(POLY_XLU_DISP++, gEffPoppedDekuBubbleSlidingDL); CLOSE_DISPS(gfxCtx); From 1274ea79a337f2b9204cd0d7762a095863064ec7 Mon Sep 17 00:00:00 2001 From: Eblo <7004497+Eblo@users.noreply.github.com> Date: Sun, 30 Nov 2025 15:41:03 -0500 Subject: [PATCH 2/3] Interpolate remaining GIs --- mm/src/code/z_draw.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/mm/src/code/z_draw.c b/mm/src/code/z_draw.c index 0624d2dd72..64f9f45510 100644 --- a/mm/src/code/z_draw.c +++ b/mm/src/code/z_draw.c @@ -412,8 +412,8 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) { gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[1]); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, play->state.frames * 0, 16, - 32, 1, play->state.frames, -(play->state.frames * 6), 16, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, play->state.frames * 0, + 16, 32, 1, play->state.frames, -(play->state.frames * 6), 16, 32, 0, 0, 1, -6)); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); @@ -442,8 +442,8 @@ void GetItem_DrawFairyBottle(PlayState* play, s16 drawId) { MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[1]); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, play->state.frames * 0, 32, - 32, 1, play->state.frames, -(play->state.frames * 6), 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, play->state.frames * 0, + 32, 32, 1, play->state.frames, -(play->state.frames * 6), 32, 320, 0, 0, 1, -6)); Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); @@ -469,8 +469,9 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, -(play->state.frames * 5), - 32, 32, 1, play->state.frames * 0, play->state.frames * 0, 32, 64)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, + -(play->state.frames * 5), 32, 32, 1, play->state.frames * 0, play->state.frames * 0, + 32, 64, 0, -5, 0, 0)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[1]); @@ -503,8 +504,8 @@ void GetItem_DrawPotion(PlayState* play, s16 drawId) { Gfx_SetupDL25_Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -play->state.frames, play->state.frames, 32, 32, 1, - -play->state.frames, play->state.frames, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, -play->state.frames, play->state.frames, 32, 32, + 1, -play->state.frames, play->state.frames, 32, 32, -1, 1, -1, 1)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].drawResources[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].drawResources[0]); @@ -528,8 +529,8 @@ void GetItem_DrawGoronSword(PlayState* play, s16 drawId) { Gfx_SetupDL25_Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 1, play->state.frames * 0, 32, - 32, 1, play->state.frames * 0, play->state.frames * 0, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 1, play->state.frames * 0, + 32, 32, 1, play->state.frames * 0, play->state.frames * 0, 32, 32, 1, 0, 0, 0)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].drawResources[0]); @@ -544,8 +545,8 @@ void GetItem_DrawDekuNuts(PlayState* play, s16 drawId) { Gfx_SetupDL25_Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 6, play->state.frames * 6, 32, - 32, 1, play->state.frames * 6, play->state.frames * 6, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 6, play->state.frames * 6, + 32, 32, 1, play->state.frames * 6, play->state.frames * 6, 32, 32, 6, 6, 6, 6)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].drawResources[0]); @@ -560,8 +561,9 @@ void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, -(play->state.frames * 3), - 32, 32, 1, play->state.frames * 0, -(play->state.frames * 2), 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, + -(play->state.frames * 3), 32, 32, 1, play->state.frames * 0, + -(play->state.frames * 2), 32, 32, 0, -3, 0, -2)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[0]); @@ -576,8 +578,8 @@ void GetItem_DrawFish(PlayState* play, s16 drawId) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, play->state.frames * 1, 32, - 32, 1, play->state.frames * 0, play->state.frames * 1, 32, 32)); + Gfx_TwoTexScrollEx(play->state.gfxCtx, G_TX_RENDERTILE, play->state.frames * 0, play->state.frames * 1, + 32, 32, 1, play->state.frames * 0, play->state.frames * 1, 32, 32, 0, 1, 0, 1)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[0]); From bf6f239a18d8272afb36be2f7146a7d85701749f Mon Sep 17 00:00:00 2001 From: Eblo <7004497+Eblo@users.noreply.github.com> Date: Sat, 20 Dec 2025 20:13:16 -0500 Subject: [PATCH 3/3] Clean up gDPSetTileSizeInterp --- mm/include/gfx.h | 2 +- mm/src/code/stubs.c | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mm/include/gfx.h b/mm/include/gfx.h index 4ee941d960..d7409720fa 100644 --- a/mm/include/gfx.h +++ b/mm/include/gfx.h @@ -109,7 +109,7 @@ void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target); // void gDPSetTextureImage(Gfx* pkt, u32 format, u32 size, u32 width, uintptr_t i); // void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb); void gSPDisplayList(Gfx* pkt, Gfx* dl); -int gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, float lrs, float lrt); +void gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, float lrs, float lrt); void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset); void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0); void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr); diff --git a/mm/src/code/stubs.c b/mm/src/code/stubs.c index 0d945b8445..9e34b8040b 100644 --- a/mm/src/code/stubs.c +++ b/mm/src/code/stubs.c @@ -200,12 +200,18 @@ void gSPDisplayList(Gfx* pkt, Gfx* dl) { __gSPDisplayList(pkt, dl); } -int gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, float lrs, float lrt) { - __gDPSetTileSizeInterp(pkt++, t, 0, 0, 0, 0); - memcpy(&pkt[0].words.w0, &uls, sizeof(float)); - memcpy(&pkt[0].words.w1, &ult, sizeof(float)); - memcpy(&pkt[1].words.w0, &lrs, sizeof(float)); - memcpy(&pkt[1].words.w1, &lrt, sizeof(float)); +void gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, float lrs, float lrt) { + __gDPSetTileSizeInterp(pkt, t, 0, 0, 0, 0); + pkt->words.w0 = _SHIFTL(G_SETTILESIZE_INTERP, 24, 8); + pkt++; + + pkt->words.w0 = *(u32*)&uls; + pkt->words.w1 = *(u32*)&ult; + pkt++; + + pkt->words.w0 = *(u32*)&lrs; + pkt->words.w1 = *(u32*)&lrt; + pkt++; } void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset) {