`Effect_Ss_Extra` (points that appear above targets in Swamp Archery Minigame) and `object_yabusame_point` (#822)

* EffectExtra: start

* EffectExtra: matched

* EffectExtra: docs

* EffectExtra: warnings

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update assets/xml/objects/object_yabusame_point.xml

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* EffectExtra: fixes

* Update src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

God damn it lenovo

* Extra delete

* EffectExtra: namefixer

* EffectExtra: updated brief description

Co-authored-by: Isghj8 <isghj8@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Isghj 2022-06-18 19:00:48 -07:00 committed by GitHub
parent 271b7c7827
commit b3104f898b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 81 additions and 12 deletions

View File

@ -1,6 +1,8 @@
<Root>
<File Name="object_yabusame_point" Segment="6">
<!-- <Blob Name="object_yabusame_point_Blob_000000" Size="0xD80" Offset="0x0" /> -->
<DList Name="object_yabusame_point_DL_000DC0" Offset="0xDC0" />
<Texture Name="gYabusamePoint30Tex" OutName="points_30" Format="ia8" Width="48" Height="24" Offset="0x0"/>
<Texture Name="gYabusamePoint60Tex" OutName="points_60" Format="ia8" Width="48" Height="24" Offset="0x480"/>
<Texture Name="gYabusamePoint100Tex" OutName="points_100" Format="ia8" Width="48" Height="24" Offset="0x900"/>
<DList Name="gYabusamePointDL" Offset="0xDC0" />
</File>
</Root>

3
spec
View File

@ -1965,8 +1965,7 @@ beginseg
name "ovl_Effect_Ss_Extra"
compress
include "build/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.o"
include "build/data/ovl_Effect_Ss_Extra/ovl_Effect_Ss_Extra.data.o"
include "build/data/ovl_Effect_Ss_Extra/ovl_Effect_Ss_Extra.reloc.o"
include "build/src/overlays/effects/ovl_Effect_Ss_Extra/ovl_Effect_Ss_Extra_reloc.o"
endseg
beginseg

View File

@ -1,29 +1,97 @@
/*
* File: z_eff_ss_extra.c
* Overlay: ovl_Effect_Ss_Extra
* Description:
* Description: The floating points that pop-up in Swamp Bow Minigame
* i.e. 100 points for hitting the deku scrubs in the background
*/
#include "z_eff_ss_extra.h"
#include "objects/object_yabusame_point/object_yabusame_point.h"
#define PARAMS ((EffectSsExtraInitParams*)initParamsx)
s32 EffectSsExtra_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx);
u32 EffectSsExtra_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx);
void EffectSsExtra_Update(GlobalContext* globalCtx, u32 index, EffectSs* this);
void EffectSsExtra_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this);
#if 0
static s16 sScores[] = { 30, 60, 100 };
const EffectSsInit Effect_Ss_Extra_InitVars = {
EFFECT_SS_EXTRA,
EffectSsExtra_Init,
};
#endif
static TexturePtr sPointTextures[] = { gYabusamePoint30Tex, gYabusamePoint60Tex, gYabusamePoint100Tex };
extern UNK_TYPE D_06000DC0;
#define rObjId regs[0]
#define rTimer regs[1]
#define rScoreIndex regs[2]
#define rScale regs[3]
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Extra/EffectSsExtra_Init.s")
u32 EffectSsExtra_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) {
s32 pad;
EffectSsExtraInitParams* params = PARAMS;
s32 objIndex;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Extra/EffectSsExtra_Draw.s")
objIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_YABUSAME_POINT);
if ((objIndex >= 0) && (Object_IsLoaded(&globalCtx->objectCtx, objIndex))) {
void* segBackup = gSegments[6];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Extra/EffectSsExtra_Update.s")
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objIndex].segment);
this->pos = params->pos;
this->velocity = params->velocity;
this->accel = params->accel;
this->draw = EffectSsExtra_Draw;
this->update = EffectSsExtra_Update;
this->life = 50;
this->rScoreIndex = params->scoreIdx;
this->rScale = params->scale;
this->rTimer = 5;
this->rObjId = objIndex;
gSegments[6] = segBackup;
return 1;
}
return 0;
}
void EffectSsExtra_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
s32 pad;
f32 scale;
void* storedSegment;
scale = this->rScale / 100.0f;
storedSegment = globalCtx->objectCtx.status[this->rObjId].segment;
OPEN_DISPS(globalCtx->state.gfxCtx);
gSegments[6] = PHYSICAL_TO_VIRTUAL(storedSegment);
gSPSegment(POLY_XLU_DISP++, 0x06, storedSegment);
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
func_8012C2DC(globalCtx->state.gfxCtx);
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sPointTextures[this->rScoreIndex]));
gSPDisplayList(POLY_XLU_DISP++, &gYabusamePointDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void EffectSsExtra_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
if (this->rTimer != 0) {
this->rTimer--;
} else {
this->velocity.y = 0.0f;
}
if (this->rTimer == 1) {
globalCtx->interfaceCtx.unk_25C = sScores[this->rScoreIndex];
}
}