mirror of https://github.com/zeldaret/mm.git
parent
2167cb6a77
commit
122e4f3982
|
@ -0,0 +1,7 @@
|
||||||
|
<Root>
|
||||||
|
<File Name="ovl_Obj_Toudai" BaseAddress="0x80A33B00" RangeStart="0xA90" RangeEnd="0xB70">
|
||||||
|
<Array Name="ovl_Obj_Toudai_Vtx_D_80A34590" Count="14" Offset="0xA90">
|
||||||
|
<Vtx/>
|
||||||
|
</Array>
|
||||||
|
</File>
|
||||||
|
</Root>
|
3
spec
3
spec
|
@ -2655,8 +2655,7 @@ beginseg
|
||||||
name "ovl_Obj_Toudai"
|
name "ovl_Obj_Toudai"
|
||||||
compress
|
compress
|
||||||
include "build/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.o"
|
include "build/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.o"
|
||||||
include "build/data/ovl_Obj_Toudai/ovl_Obj_Toudai.data.o"
|
include "build/src/overlays/actors/ovl_Obj_Toudai/ovl_Obj_Toudai_reloc.o"
|
||||||
include "build/data/ovl_Obj_Toudai/ovl_Obj_Toudai.reloc.o"
|
|
||||||
endseg
|
endseg
|
||||||
|
|
||||||
beginseg
|
beginseg
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_obj_toudai.h"
|
#include "z_obj_toudai.h"
|
||||||
|
#include "objects/object_f53_obj/object_f53_obj.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||||
|
|
||||||
|
@ -15,7 +16,6 @@ void ObjToudai_Destroy(Actor* thisx, PlayState* play);
|
||||||
void ObjToudai_Update(Actor* thisx, PlayState* play);
|
void ObjToudai_Update(Actor* thisx, PlayState* play);
|
||||||
void ObjToudai_Draw(Actor* thisx, PlayState* play);
|
void ObjToudai_Draw(Actor* thisx, PlayState* play);
|
||||||
|
|
||||||
#if 0
|
|
||||||
const ActorInit Obj_Toudai_InitVars = {
|
const ActorInit Obj_Toudai_InitVars = {
|
||||||
ACTOR_OBJ_TOUDAI,
|
ACTOR_OBJ_TOUDAI,
|
||||||
ACTORCAT_PROP,
|
ACTORCAT_PROP,
|
||||||
|
@ -28,21 +28,102 @@ const ActorInit Obj_Toudai_InitVars = {
|
||||||
(ActorFunc)ObjToudai_Draw,
|
(ActorFunc)ObjToudai_Draw,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#include "assets/overlays/ovl_Obj_Toudai/ovl_Obj_Toudai.c"
|
||||||
|
|
||||||
extern UNK_TYPE D_060023B0;
|
void func_80A33B00(ObjToudai* this, PlayState* play) {
|
||||||
extern UNK_TYPE D_060024E8;
|
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||||
|
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/func_80A33B00.s")
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/func_80A33BB4.s")
|
func_8012C28C(play->state.gfxCtx);
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/func_80A342F4.s")
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, object_f53_obj_DL_0024E8);
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/ObjToudai_Init.s")
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/ObjToudai_Destroy.s")
|
void func_80A33BB4(ObjToudai* this, PlayState* play) {
|
||||||
|
u8 sp57;
|
||||||
|
u8 sp56;
|
||||||
|
s32 i;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/ObjToudai_Update.s")
|
this->unk_22C += 1.8f;
|
||||||
|
this->unk_230 += 0.6f;
|
||||||
|
sp57 = this->unk_22C;
|
||||||
|
sp56 = this->unk_230;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Toudai/ObjToudai_Draw.s")
|
this->unk_228 = CLAMP(this->unk_228, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_COUNT(ovl_Obj_Toudai_Vtx_D_80A34590); i++) {
|
||||||
|
this->unk_148[i].v.cn[3] = ovl_Obj_Toudai_Vtx_D_80A34590[i].v.cn[3] * this->unk_228;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->unk_228 > 0.0f) {
|
||||||
|
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||||
|
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||||
|
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||||
|
|
||||||
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
|
func_8012C28C(play->state.gfxCtx);
|
||||||
|
|
||||||
|
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||||
|
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, sp57, 0x20, 0x80, 1, 0, sp56, 0x20, 0x20));
|
||||||
|
gSPSegment(POLY_XLU_DISP++, 0x09, Lib_SegmentedToVirtual(this->unk_148));
|
||||||
|
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
gSPDisplayList(POLY_XLU_DISP++, object_f53_obj_DL_0023B0);
|
||||||
|
|
||||||
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 func_80A342F4(s16 arg0) {
|
||||||
|
u8 var_v1 = 0;
|
||||||
|
s16 minutes = TIME_TO_MINUTES_F(gSaveContext.save.time);
|
||||||
|
s32 hours = minutes / 60;
|
||||||
|
|
||||||
|
if (hours >= 17) {
|
||||||
|
if ((hours == 17) && ((minutes % 60) < arg0)) {
|
||||||
|
return var_v1;
|
||||||
|
}
|
||||||
|
var_v1 = 2;
|
||||||
|
} else if (hours < 6) {
|
||||||
|
if ((hours == 5) && ((minutes % 60) < arg0)) {
|
||||||
|
return var_v1;
|
||||||
|
}
|
||||||
|
var_v1 = 1;
|
||||||
|
}
|
||||||
|
return var_v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjToudai_Init(Actor* thisx, PlayState* play) {
|
||||||
|
ObjToudai* this = THIS;
|
||||||
|
|
||||||
|
Lib_MemCpy(this->unk_148, &ovl_Obj_Toudai_Vtx_D_80A34590, sizeof(ovl_Obj_Toudai_Vtx_D_80A34590));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjToudai_Destroy(Actor* thisx, PlayState* play) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjToudai_Update(Actor* thisx, PlayState* play) {
|
||||||
|
ObjToudai* this = THIS;
|
||||||
|
u8 temp_v0 = func_80A342F4(this->unk_238);
|
||||||
|
|
||||||
|
if (temp_v0 != this->unk_236) {
|
||||||
|
this->unk_236 = temp_v0;
|
||||||
|
this->unk_238 = Rand_S16Offset(0, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
Math_ApproachF(&this->unk_228, (this->unk_236 == 0) ? 0.0f : 1.0f, 0.01f, 1000.0f);
|
||||||
|
this->unk_234 += 100;
|
||||||
|
thisx->shape.rot.y = (s16)(Math_SinS(this->unk_234) * 16000.0f) + thisx->world.rot.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjToudai_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
ObjToudai* this = THIS;
|
||||||
|
|
||||||
|
func_80A33B00(this, play);
|
||||||
|
func_80A33BB4(this, play);
|
||||||
|
}
|
||||||
|
|
|
@ -7,7 +7,15 @@ struct ObjToudai;
|
||||||
|
|
||||||
typedef struct ObjToudai {
|
typedef struct ObjToudai {
|
||||||
/* 0x000 */ Actor actor;
|
/* 0x000 */ Actor actor;
|
||||||
/* 0x144 */ char unk_144[0xFC];
|
/* 0x144 */ UNK_TYPE1 pad144[4];
|
||||||
|
/* 0x148 */ Vtx unk_148[14];
|
||||||
|
/* 0x228 */ f32 unk_228;
|
||||||
|
/* 0x22C */ f32 unk_22C;
|
||||||
|
/* 0x230 */ f32 unk_230;
|
||||||
|
/* 0x234 */ s16 unk_234;
|
||||||
|
/* 0x236 */ u8 unk_236;
|
||||||
|
/* 0x238 */ s16 unk_238;
|
||||||
|
/* 0x23A */ UNK_TYPE1 pad23A[6];
|
||||||
} ObjToudai;// size = 0x240
|
} ObjToudai;// size = 0x240
|
||||||
|
|
||||||
extern const ActorInit Obj_Toudai_InitVars;
|
extern const ActorInit Obj_Toudai_InitVars;
|
||||||
|
|
|
@ -1525,11 +1525,6 @@ D_06001100 = 0x06001100;
|
||||||
D_06001140 = 0x06001140;
|
D_06001140 = 0x06001140;
|
||||||
D_06001CB0 = 0x06001CB0;
|
D_06001CB0 = 0x06001CB0;
|
||||||
|
|
||||||
// ovl_Obj_Toudai
|
|
||||||
|
|
||||||
D_060023B0 = 0x060023B0;
|
|
||||||
D_060024E8 = 0x060024E8;
|
|
||||||
|
|
||||||
// ovl_Obj_Um
|
// ovl_Obj_Um
|
||||||
|
|
||||||
D_06007E20 = 0x06007E20;
|
D_06007E20 = 0x06007E20;
|
||||||
|
|
Loading…
Reference in New Issue