EffectSsStone1 Ok (#730)

* EffectSsStone1 OK

* gameplay object stuff

* unk_C -> reg0

* Fix

* Reverse order of stone textures

* undef syms
This commit is contained in:
Derek Hensley 2022-04-17 11:35:13 -07:00 committed by GitHub
parent f4bb821b56
commit bfe22610f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 75 additions and 22 deletions

View File

@ -1053,15 +1053,15 @@
<Texture Name="gExplosionSplashTex7" OutName="tex_0396F0" Format="i8" Width="32" Height="40" Offset="0x396F0" />
<Texture Name="gExplosionSplashTex8" OutName="tex_039BF0" Format="i8" Width="32" Height="40" Offset="0x39BF0" />
<DList Name="gExplosionSplashDL" Offset="0x3A0F0" />
<Texture Name="gameplay_keep_Tex_03A190" OutName="tex_03A190" Format="ia8" Width="32" Height="32" Offset="0x3A190" />
<Texture Name="gameplay_keep_Tex_03A590" OutName="tex_03A590" Format="ia8" Width="32" Height="32" Offset="0x3A590" />
<Texture Name="gameplay_keep_Tex_03A990" OutName="tex_03A990" Format="ia8" Width="32" Height="32" Offset="0x3A990" />
<Texture Name="gameplay_keep_Tex_03AD90" OutName="tex_03AD90" Format="ia8" Width="32" Height="32" Offset="0x3AD90" />
<Texture Name="gameplay_keep_Tex_03B190" OutName="tex_03B190" Format="ia8" Width="32" Height="32" Offset="0x3B190" />
<Texture Name="gameplay_keep_Tex_03B590" OutName="tex_03B590" Format="ia8" Width="32" Height="32" Offset="0x3B590" />
<Texture Name="gameplay_keep_Tex_03B990" OutName="tex_03B990" Format="ia8" Width="32" Height="32" Offset="0x3B990" />
<Texture Name="gameplay_keep_Tex_03BD90" OutName="tex_03BD90" Format="ia8" Width="32" Height="32" Offset="0x3BD90" />
<DList Name="gameplay_keep_DL_03C190" Offset="0x3C190" />
<Texture Name="gEffStone1Tex" OutName="eff_stone_1" Format="ia8" Width="32" Height="32" Offset="0x3A190" />
<Texture Name="gEffStone2Tex" OutName="eff_stone_2" Format="ia8" Width="32" Height="32" Offset="0x3A590" />
<Texture Name="gEffStone3Tex" OutName="eff_stone_3" Format="ia8" Width="32" Height="32" Offset="0x3A990" />
<Texture Name="gEffStone4Tex" OutName="eff_stone_4" Format="ia8" Width="32" Height="32" Offset="0x3AD90" />
<Texture Name="gEffStone5Tex" OutName="eff_stone_5" Format="ia8" Width="32" Height="32" Offset="0x3B190" />
<Texture Name="gEffStone6Tex" OutName="eff_stone_6" Format="ia8" Width="32" Height="32" Offset="0x3B590" />
<Texture Name="gEffStone7Tex" OutName="eff_stone_7" Format="ia8" Width="32" Height="32" Offset="0x3B990" />
<Texture Name="gEffStone8Tex" OutName="eff_stone_8" Format="ia8" Width="32" Height="32" Offset="0x3BD90" />
<DList Name="gEffStoneDL" Offset="0x3C190" />
<Texture Name="gameplay_keep_Tex_03C230" OutName="tex_03C230" Format="i4" Width="32" Height="96" Offset="0x3C230" />
<Texture Name="gameplay_keep_Tex_03C830" OutName="tex_03C830" Format="i4" Width="32" Height="96" Offset="0x3C830" />
<Texture Name="gameplay_keep_Tex_03CE30" OutName="tex_03CE30" Format="i4" Width="32" Height="96" Offset="0x3CE30" />

View File

@ -572,7 +572,7 @@ void EffectSsHahen_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos, f32 burstSca
// void EffectSsStick_Spawn(UNK_TYPE4 uParm1, UNK_PTR puParm2, UNK_TYPE2 uParm3);
// void EffectSsSibuki_Spawn(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
void EffectSsSibuki_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos);
void EffectSsStone1_Spawn(GlobalContext* globalCtx, Vec3f* arg1, s32 arg2);
void EffectSsStone1_Spawn(GlobalContext* globalCtx, Vec3f* pos, s32 reg0);
// void EffectSsHitMark_Spawn(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, UNK_TYPE2 uParm3, Vec3f* pzParm4);
void EffectSsHitMark_SpawnFixedScale(GlobalContext* globalCtx, s32 type, Vec3f* pos);
void EffectSsHitMark_SpawnCustomScale(GlobalContext* globalCtx, s32 type, s16 scale, Vec3f* pos);

3
spec
View File

@ -1910,8 +1910,7 @@ beginseg
name "ovl_Effect_Ss_Stone1"
compress
include "build/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.o"
include "build/data/ovl_Effect_Ss_Stone1/ovl_Effect_Ss_Stone1.data.o"
include "build/data/ovl_Effect_Ss_Stone1/ovl_Effect_Ss_Stone1.reloc.o"
include "build/src/overlays/effects/ovl_Effect_Ss_Stone1/ovl_Effect_Ss_Stone1_reloc.o"
endseg
beginseg

View File

@ -625,11 +625,11 @@ void EffectSsSibuki_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos) {
// EffectSsStone1 Spawn Functions
void EffectSsStone1_Spawn(GlobalContext* globalCtx, Vec3f* pos, s32 arg2) {
void EffectSsStone1_Spawn(GlobalContext* globalCtx, Vec3f* pos, s32 reg0) {
EffectSsStone1InitParams initParams;
initParams.pos = *pos;
initParams.unk_C = arg2;
initParams.reg0 = reg0;
EffectSs_Spawn(globalCtx, EFFECT_SS_STONE1, 128, &initParams);
}

View File

@ -5,23 +5,78 @@
*/
#include "z_eff_ss_stone1.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define PARAMS ((EffectSsStone1InitParams*)initParamsx)
s32 EffectSsStone1_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx);
#define rReg0 regs[0]
u32 EffectSsStone1_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx);
void EffectSsStone1_Update(GlobalContext* globalCtx, u32 index, EffectSs* this);
void EffectSsStone1_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this);
#if 0
const EffectSsInit Effect_Ss_Stone1_InitVars = {
EFFECT_SS_STONE1,
EffectSsStone1_Init,
};
#endif
typedef struct {
/* 0x00 */ TexturePtr texture;
/* 0x04 */ Color_RGBA8 primColor;
/* 0x08 */ Color_RGBA8 envColor;
} EffStoneDrawInfo;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Stone1/EffectSsStone1_Init.s")
static EffStoneDrawInfo sDrawInfo[] = {
{ gEffStone8Tex, { 200, 0, 0, 255 }, { 0, 0, 0, 255 } },
{ gEffStone7Tex, { 255, 100, 0, 255 }, { 100, 0, 0, 255 } },
{ gEffStone6Tex, { 255, 200, 0, 255 }, { 200, 0, 0, 255 } },
{ gEffStone5Tex, { 255, 255, 0, 255 }, { 255, 0, 0, 255 } },
{ gEffStone4Tex, { 255, 255, 150, 255 }, { 255, 150, 0, 255 } },
{ gEffStone3Tex, { 255, 255, 255, 255 }, { 255, 255, 0, 255 } },
{ gEffStone2Tex, { 255, 255, 255, 255 }, { 0, 255, 0, 255 } },
{ gEffStone1Tex, { 255, 255, 255, 255 }, { 0, 255, 255, 255 } },
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Stone1/EffectSsStone1_Draw.s")
u32 EffectSsStone1_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) {
EffectSsStone1InitParams* initParams = PARAMS;
Vec3f pos = initParams->pos;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Stone1/EffectSsStone1_Update.s")
this->pos = pos;
this->vec = pos;
this->life = 8;
this->rReg0 = initParams->reg0;
this->draw = EffectSsStone1_Draw;
this->update = EffectSsStone1_Update;
return 1;
}
void EffectSsStone1_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
EffStoneDrawInfo* drawParams = &sDrawInfo[this->life];
Vec3f mfVec;
f32 mfW;
f32 scale;
OPEN_DISPS(gfxCtx);
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &this->pos, &mfVec, &mfW);
scale = (mfW < 1500.0f) ? 3.0f : (mfW / 1500.0f) * 3.0f;
Matrix_InsertTranslation(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C9BC(gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(drawParams->texture));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, drawParams->primColor.r, drawParams->primColor.g, drawParams->primColor.b,
255);
gDPSetEnvColor(POLY_XLU_DISP++, drawParams->envColor.r, drawParams->envColor.g, drawParams->envColor.b, 255);
gSPDisplayList(POLY_XLU_DISP++, gEffStoneDL);
CLOSE_DISPS(gfxCtx);
}
void EffectSsStone1_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
if ((this->life == 6) && (this->rReg0 != 0)) {
iREG(50) = 0;
}
}

View File

@ -5,7 +5,7 @@
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x00 */ s32 unk_C;
/* 0x0C */ s32 reg0;
} EffectSsStone1InitParams; // size = 0x10
extern const EffectSsInit Effect_Ss_Stone1_InitVars;

View File

@ -430,7 +430,6 @@ D_040367B0 = 0x040367B0;
D_040377B0 = 0x040377B0;
D_04037850 = 0x04037850;
D_0403A0F0 = 0x0403A0F0;
D_0403C190 = 0x0403C190;
D_0403F230 = 0x0403F230;
D_04044300 = 0x04044300;
D_0404F250 = 0x0404F250;