mirror of https://github.com/zeldaret/mm.git
EnMm2 OK (#492)
* all matching except draw * all matching * done except importing data * data extracted * added xml for asset extraction * clang format * remove global_asm macros * bit of documentation * format * use THIS macro * remove unnecessary & * space between vars and code * feedback * use OPEN_DISPS, CLOSE_DISPS, and POLY_OPA_DISP++ macros * remove comment * use matrix macros * change comment format * change comment format * rename assets in xml * fix indent
This commit is contained in:
parent
99761a9c0d
commit
de61e04312
|
|
@ -0,0 +1,14 @@
|
|||
<Root>
|
||||
<File Name="ovl_En_Mm2" BaseAddress="0x809A2030" RangeStart="0x240" RangeEnd="0xAD0">
|
||||
<Texture Name="sEnMm2EnvelopeTex" OutName="mm2_envelope" Format="i8" Width="32" Height="32" Offset="0x240"/>
|
||||
<Texture Name="sEnMm2LetterTex" OutName="mm2_letter" Format="i8" Width="16" Height="16" Offset="0x640"/>
|
||||
<Array Name="sEnMm21Vtx" Count="10" Offset="0x840">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="sEnMm22Vtx" Count="12" Offset="0x8E0">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="sEnMm2DL" Offset="0x9A8"/>
|
||||
</File>
|
||||
</Root>
|
||||
|
||||
3
spec
3
spec
|
|
@ -2275,8 +2275,7 @@ beginseg
|
|||
name "ovl_En_Mm2"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Mm2/z_en_mm2.o"
|
||||
include "build/data/ovl_En_Mm2/ovl_En_Mm2.data.o"
|
||||
include "build/data/ovl_En_Mm2/ovl_En_Mm2.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Mm2/ovl_En_Mm2_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
|||
|
|
@ -15,10 +15,9 @@ void EnMm2_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EnMm2_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnMm2_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void func_809A2080(EnMm2* this, GlobalContext* globalCtx);
|
||||
void func_809A20FC(EnMm2* this, GlobalContext* globalCtx);
|
||||
void EnMm2_Reading(EnMm2* this, GlobalContext* globalCtx);
|
||||
void EnMm2_WaitForRead(EnMm2* this, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
const ActorInit En_Mm2_InitVars = {
|
||||
ACTOR_EN_MM2,
|
||||
ACTORCAT_ITEMACTION,
|
||||
|
|
@ -31,16 +30,59 @@ const ActorInit En_Mm2_InitVars = {
|
|||
(ActorFunc)EnMm2_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
#include "overlays/ovl_En_Mm2/ovl_En_Mm2.c"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mm2/EnMm2_Init.s")
|
||||
void EnMm2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnMm2* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mm2/EnMm2_Destroy.s")
|
||||
Actor_SetScale(&this->actor, 0.015f);
|
||||
this->actionFunc = EnMm2_WaitForRead;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mm2/func_809A2080.s")
|
||||
void EnMm2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mm2/func_809A20FC.s")
|
||||
/**
|
||||
* Action function whilst Link is reading the letter.
|
||||
*/
|
||||
void EnMm2_Reading(EnMm2* this, GlobalContext* globalCtx) {
|
||||
u8 talkState = func_80152498(&globalCtx->msgCtx);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mm2/EnMm2_Update.s")
|
||||
if (talkState != 2) {
|
||||
if (talkState == 5 && func_80147624(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
this->actionFunc = EnMm2_WaitForRead;
|
||||
}
|
||||
} else {
|
||||
this->actionFunc = EnMm2_WaitForRead;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mm2/EnMm2_Draw.s")
|
||||
/**
|
||||
* Action function that awaits Link to read the letter, changing the A button to "Check" when he is within range to do
|
||||
* so (and facing the letter).
|
||||
*/
|
||||
void EnMm2_WaitForRead(EnMm2* this, GlobalContext* globalCtx) {
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
func_801518B0(globalCtx, 0x277B, &this->actor);
|
||||
this->actionFunc = EnMm2_Reading;
|
||||
} else if ((this->actor.xzDistToPlayer < 60.0f) && (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx))) {
|
||||
func_800B8614(&this->actor, globalCtx, 110.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void EnMm2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnMm2* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
void EnMm2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sEnMm2DL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8678,8 +8678,8 @@
|
|||
0x809A1E60:("EnZl4_Draw",),
|
||||
0x809A2030:("EnMm2_Init",),
|
||||
0x809A2070:("EnMm2_Destroy",),
|
||||
0x809A2080:("func_809A2080",),
|
||||
0x809A20FC:("func_809A20FC",),
|
||||
0x809A2080:("EnMm2_Reading",),
|
||||
0x809A20FC:("EnMm2_WaitForRead",),
|
||||
0x809A2194:("EnMm2_Update",),
|
||||
0x809A21B8:("EnMm2_Draw",),
|
||||
0x809A2B60:("DoorSpiral_SetupAction",),
|
||||
|
|
|
|||
Loading…
Reference in New Issue