Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions patches/display_patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,23 +961,13 @@ RECOMP_PATCH void Aquas_BlueMarineReticle_Draw(void) {
}

#if 1
u32 bolse_ult = 0, bolse_lrt = 63, bolse_uls = 0, bolse_lrs = 63;

RECOMP_PATCH void Bolse_BoBaseShield_Update(BoBaseShield* this) {
D_i4_801A0530 = 0;

Math_SmoothStepToF(&this->fwork[0], D_BO_801A03DC * 9.0f + 10.0f, 1.0f, 10.0f, 0.0f);

// Lib_Texture_Scroll(aBoBaseShieldTex, 16, 16, 0);
bolse_ult = (bolse_ult - 4) & 0x3F;
bolse_lrt = (bolse_ult - 63) & 0xFFF;
bolse_lrt = (bolse_ult - 63) & 0xFFF;
// pointer to the SetTileSize cmd
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aBoBaseShieldDL + 2)));
// upper left coords
cmd->words.w0 = (G_SETTILESIZE << 24) | (bolse_uls << 12) | bolse_ult;
// lower right coords
cmd->words.w1 = (cmd->words.w1 & 0x07000000) | (bolse_lrs << 12) | bolse_lrt;
Gfx_Texture_UV_Scroll(aBoBaseShieldDL + 2, 16, 16, 0, 1);

switch (this->state) {
case 2:
Expand Down
147 changes: 24 additions & 123 deletions patches/effect_tagging.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ RECOMP_PATCH void TexturedLine_Draw(void) {
}
}

u32 a6_ult = 0, a6_lrt = 63;
extern Gfx D_A6_6012550[];
// extern int gUvOn; /* Debug */

Expand Down Expand Up @@ -167,11 +166,7 @@ RECOMP_PATCH void Effect_Effect395_Draw(Effect395* this) {
if (gPlayState != PLAY_PAUSE) {
// Lib_Texture_Scroll(D_A6_6012840, 16, 16, 0);
// @Recomp use UV scrolling instead of CPU
a6_ult = (a6_ult - 4) & 0x3F;
a6_lrt = (a6_ult + 63) & 0xFFF;
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (D_A6_6012550 + 6)));
cmd->words.w0 = (G_SETTILESIZE << 24) | a6_ult;
cmd->words.w1 = (cmd->words.w1 & 0x0703F000) | a6_lrt;
Gfx_Texture_UV_Scroll(D_A6_6012550 + 6, 16, 16, 0, 1);
}
RCP_SetupDL(&gMasterDisp, SETUPDL_53);
Matrix_Scale(gGfxMatrix, this->orient.x, this->orient.y, this->orient.z, MTXF_APPLY);
Expand Down Expand Up @@ -1506,15 +1501,10 @@ RECOMP_PATCH void Effect_ElectricArc_Draw(EffectElectricArc* this) {

// Texture scrolling for explosions
#if 1
u32 e383_ult = 0, e383_lrt = 127;
RECOMP_PATCH void Effect_Effect383_Update(Effect383* this) {
// Lib_Texture_Scroll(D_10190C0, 16, 32, 0);
// @Recomp use UV tex scrolling instead
e383_ult = (e383_ult - 4) & 0x7F;
e383_lrt = (e383_ult + 127) & 0xFFF;
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (D_10182C0 + 6)));
cmd->words.w0 = (G_SETTILESIZE << 24) | e383_ult;
cmd->words.w1 = (cmd->words.w1 & 0x0703F000) | e383_lrt;
Gfx_Texture_UV_Scroll(D_10182C0 + 6, 16, 32, 0, 1);

gGroundClipMode = 2;
this->obj.rot.y += 1.0f;
Expand Down Expand Up @@ -1548,21 +1538,13 @@ RECOMP_PATCH void Effect_Effect383_Update(Effect383* this) {
#if 1
void Obj54_8006AA3C(f32 xPos, f32 yPos, f32 zPos);

u32 wf_ult = 0, wf_lrt = 127;

RECOMP_PATCH void CoWaterfall_Update(CoWaterfall* this) {
Vec3f dest;
Vec3f src;

// Lib_Texture_Scroll(aCoWaterfallTex2, 32, 32, 1);
// @Recomp use UV tex scrolling instead
wf_ult = (wf_ult + 4) & 0x7F;
wf_lrt = (wf_ult + 127) & 0xFFF;
Gfx* cmd1 = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aCoWaterfallDL + 26)));
u32 words_w0 = (G_SETTILESIZE << 24) | wf_ult;
u32 words_w1 = (cmd1->words.w1 & 0x0707F000) | wf_lrt;
cmd1->words.w0 = words_w0;
cmd1->words.w1 = words_w1;
Gfx_Texture_UV_Scroll(aCoWaterfallDL + 26, 32, 32, 1, 1);

if ((gGameFrameCount % 4) == 0) {
Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW);
Expand All @@ -1581,7 +1563,6 @@ RECOMP_PATCH void CoWaterfall_Update(CoWaterfall* this) {
#if 1
void func_tank_80043280(u16* text0, u16* text1, f32 zRot);
void func_tank_80043B18(Player* player);
u32 lm6_ult = 0, lm6_lrt = 0;

#if 0
extern int gUvOn;
Expand Down Expand Up @@ -1724,33 +1705,11 @@ RECOMP_PATCH void func_tank_80044868(Player* player) {
if (player->baseSpeed > 0.0f) {
// Lib_Texture_Scroll(aLandmasterModelTex6, 32, 32, 0);
// @recomp: UV Scrolling
lm6_ult = (lm6_ult - 4) & 0x7F;
lm6_lrt = (lm6_ult + 127) & 0xFFF;
// aLandmasterModelDL
// + 92
// + 141
// + 150
// + 177
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 92)));
u32 cmd_words_w0, cmd_words_w1;
// upper left coords
cmd_words_w0 = (G_SETTILESIZE << 24) | lm6_ult;
// lower right coords
cmd_words_w1 = (cmd->words.w1 & 0x0707F000) | lm6_lrt;
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;

cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 141)));
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;

cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 150)));
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;

cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 177)));
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 92, 32, 32, 0, 1);
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 141, 32, 32, 0, 1);
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 150, 32, 32, 0, 1);
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 177, 32, 32, 0, 1);

if ((gCurrentLevel == LEVEL_TITANIA) && !gBossActive) {
func_tank_80043280(aLandmasterModelTex4, D_TI_6009BB8, gGameFrameCount * -55.0f);
}
Expand All @@ -1762,33 +1721,10 @@ RECOMP_PATCH void func_tank_80044868(Player* player) {
if (player->baseSpeed > 10.0f) {
// Lib_Texture_Scroll(aLandmasterModelTex6, 32, 32, 0);
// @recomp: UV Scrolling
lm6_ult = (lm6_ult - 4) & 0x7F;
lm6_lrt = (lm6_ult + 127) & 0xFFF;
// aLandmasterModelDL
// + 92
// + 141
// + 150
// + 177
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 92)));
u32 cmd_words_w0, cmd_words_w1;
// upper left coords
cmd_words_w0 = (G_SETTILESIZE << 24) | lm6_ult;
// lower right coords
cmd_words_w1 = (cmd->words.w1 & 0x0707F000) | lm6_lrt;
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;

cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 141)));
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;

cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 150)));
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;

cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (aLandmasterModelDL + 177)));
cmd->words.w0 = cmd_words_w0;
cmd->words.w1 = cmd_words_w1;
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 92, 32, 32, 0, 1);
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 141, 32, 32, 0, 1);
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 150, 32, 32, 0, 1);
Gfx_Texture_UV_Scroll(aLandmasterModelDL + 177, 32, 32, 0, 1);

if ((gCurrentLevel == LEVEL_TITANIA) && !gBossActive) {
func_tank_80043280(aLandmasterModelTex4, D_TI_6009BB8, gGameFrameCount * -55.0f);
Expand All @@ -1805,8 +1741,6 @@ void Corneria_Garuda_HandleDamage(Actor* this);
#if 1
s32 Corneria_CoGaruda1_CheckCollision(CoGaruda1* this);

u32 garuda1_ult = 0, garuda1_lrt = 63;

RECOMP_PATCH void Corneria_CoGaruda1_Update(CoGaruda1* this) {
Vec3f frameTable[20];
f32 sin;
Expand All @@ -1828,14 +1762,7 @@ RECOMP_PATCH void Corneria_CoGaruda1_Update(CoGaruda1* this) {

// @recomp: UV texture scrolling
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
garuda1_ult = (garuda1_ult + 4) & 0x3F;
garuda1_lrt = (garuda1_ult + 63) & 0xFFF;
// gfx+59
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (ast_corneria_seg6_gfx_31ED0 + 59)));
// upper left coords
cmd->words.w0 = (G_SETTILESIZE << 24) | garuda1_ult;
// lower right coords
cmd->words.w1 = (cmd->words.w1 & 0x0703F000) | garuda1_lrt;
Gfx_Texture_UV_Scroll(ast_corneria_seg6_gfx_31ED0 + 59, 16, 16, 1, 1);

this->animFrame = 0;

Expand Down Expand Up @@ -1872,8 +1799,6 @@ RECOMP_PATCH void Corneria_CoGaruda1_Update(CoGaruda1* this) {
#endif

#if 1
u32 garuda2_ult = 0, garuda2_lrt = 63;

RECOMP_PATCH void Corneria_CoGaruda2_Update(CoGaruda2* this) {
Vec3f frameTable[20];
Vec3f src;
Expand Down Expand Up @@ -1903,17 +1828,9 @@ RECOMP_PATCH void Corneria_CoGaruda2_Update(CoGaruda2* this) {
case 1:
this->fwork[0] = -10.0f;

{
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
garuda2_ult = (garuda2_ult - 4) & 0x3F;
garuda2_lrt = (garuda2_ult + 63) & 0xFFF;
// gfx+59
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (ast_corneria_seg6_gfx_31ED0 + 59)));
// upper left coords
cmd->words.w0 = (G_SETTILESIZE << 24) | garuda2_ult;
// lower right coords
cmd->words.w1 = (cmd->words.w1 & 0x0703F000) | garuda2_lrt;
}
// @recomp: UV texture scrolling
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
Gfx_Texture_UV_Scroll(ast_corneria_seg6_gfx_31ED0 + 59, 16, 16, 1, 1);

if (this->timer_0BC == 0) {
this->state = 2;
Expand All @@ -1924,17 +1841,9 @@ RECOMP_PATCH void Corneria_CoGaruda2_Update(CoGaruda2* this) {
case 2:
this->fwork[0] = -10.0f;

{
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
garuda2_ult = (garuda2_ult - 4) & 0x3F;
garuda2_lrt = (garuda2_ult + 63) & 0xFFF;
// gfx+59
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (ast_corneria_seg6_gfx_31ED0 + 59)));
// upper left coords
cmd->words.w0 = (G_SETTILESIZE << 24) | garuda2_ult;
// lower right coords
cmd->words.w1 = (cmd->words.w1 & 0x0703F000) | garuda2_lrt;
}
// @recomp: UV texture scrolling
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
Gfx_Texture_UV_Scroll(ast_corneria_seg6_gfx_31ED0 + 59, 16, 16, 1, 1);

this->animFrame++;

Expand Down Expand Up @@ -1973,8 +1882,6 @@ RECOMP_PATCH void Corneria_CoGaruda2_Update(CoGaruda2* this) {
#endif

#if 1
u32 garuda3_ult = 0, garuda3_lrt = 63;

RECOMP_PATCH void Corneria_CoGaruda3_Update(CoGaruda3* this) {
s32 pad;
Vec3f frameTable[20];
Expand All @@ -1998,17 +1905,11 @@ RECOMP_PATCH void Corneria_CoGaruda3_Update(CoGaruda3* this) {
case 1:
this->fwork[0] = 5.0f;
this->fwork[1] += 5.0f;
{
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
garuda3_ult = (garuda3_ult - 4) & 0x3F;
garuda3_lrt = (garuda3_ult + 63) & 0xFFF;
// gfx+59
Gfx* cmd = (Gfx*) SEGMENTED_TO_VIRTUAL((void*) ((Gfx*) (ast_corneria_seg6_gfx_31ED0 + 59)));
// upper left coords
cmd->words.w0 = (G_SETTILESIZE << 24) | garuda3_ult;
// lower right coords
cmd->words.w1 = (cmd->words.w1 & 0x0703F000) | garuda3_lrt;
}

// @recomp: UV texture scrolling
// Lib_Texture_Scroll(aCoGarudaTracksTex, 16, 16, 1);
Gfx_Texture_UV_Scroll(ast_corneria_seg6_gfx_31ED0 + 59, 16, 16, 1, 1);

this->animFrame++;
if (this->animFrame >= Animation_GetFrameCount(&aCoGaruda3Anim)) {
this->animFrame = 0;
Expand Down
Loading
Loading