mirror of https://github.com/zeldaret/mm.git
`z_fbdemo_wipe1` OK and assorted asset cleanup (#1244)
This commit is contained in:
parent
6d20839ab0
commit
c84eab6efb
|
@ -0,0 +1,9 @@
|
||||||
|
<Root>
|
||||||
|
<File Name="ovl_fbdemo_wipe1" BaseAddress="0x80AC57B0" RangeStart="0x470" RangeEnd="0xEF8">
|
||||||
|
<Array Name="sTransWipe1Vtx" Count="25" Offset="0x470">
|
||||||
|
<Vtx/>
|
||||||
|
</Array>
|
||||||
|
<Texture Name="sTransWipe1Tex" OutName="trans_wipe" Format="i4" Width="64" Height="64" Offset="0x600"/>
|
||||||
|
<DList Name="sTransWipe1DL" Offset="0xE00"/>
|
||||||
|
</File>
|
||||||
|
</Root>
|
3
spec
3
spec
|
@ -3194,8 +3194,7 @@ beginseg
|
||||||
name "ovl_fbdemo_wipe1"
|
name "ovl_fbdemo_wipe1"
|
||||||
compress
|
compress
|
||||||
include "build/src/overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.o"
|
include "build/src/overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.o"
|
||||||
include "build/data/ovl_fbdemo_wipe1/ovl_fbdemo_wipe1.data.o"
|
include "build/src/overlays/fbdemos/ovl_fbdemo_wipe1/ovl_fbdemo_wipe1_reloc.o"
|
||||||
include "build/data/ovl_fbdemo_wipe1/ovl_fbdemo_wipe1.reloc.o"
|
|
||||||
endseg
|
endseg
|
||||||
|
|
||||||
beginseg
|
beginseg
|
||||||
|
|
|
@ -19,7 +19,7 @@ void ArrowFire_Draw(Actor* thisx, PlayState* play);
|
||||||
void FireArrow_ChargeAndWait(ArrowFire* this, PlayState* play);
|
void FireArrow_ChargeAndWait(ArrowFire* this, PlayState* play);
|
||||||
void FireArrow_Fly(ArrowFire* this, PlayState* play);
|
void FireArrow_Fly(ArrowFire* this, PlayState* play);
|
||||||
|
|
||||||
#include "overlays/ovl_Arrow_fire/ovl_Arrow_Fire.c"
|
#include "overlays/ovl_Arrow_Fire/ovl_Arrow_Fire.c"
|
||||||
|
|
||||||
ActorInit Arrow_Fire_InitVars = {
|
ActorInit Arrow_Fire_InitVars = {
|
||||||
ACTOR_ARROW_FIRE,
|
ACTOR_ARROW_FIRE,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "z_fbdemo_triforce.h"
|
#include "z_fbdemo_triforce.h"
|
||||||
#include "assets/objects/object_fbdemo_triforce/ovl_fbdemo_triforce.c"
|
#include "assets/overlays/ovl_fbdemo_triforce/ovl_fbdemo_triforce.c"
|
||||||
|
|
||||||
void* TransitionTriforce_Init(void* thisx);
|
void* TransitionTriforce_Init(void* thisx);
|
||||||
void TransitionTriforce_Destroy(void* thisx);
|
void TransitionTriforce_Destroy(void* thisx);
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "z_fbdemo_wipe1.h"
|
#include "z_fbdemo_wipe1.h"
|
||||||
|
|
||||||
|
#define THIS ((TransitionWipe1*)thisx)
|
||||||
|
|
||||||
void* TransitionWipe1_Init(void* thisx);
|
void* TransitionWipe1_Init(void* thisx);
|
||||||
void TransitionWipe1_Destroy(void* thisx);
|
void TransitionWipe1_Destroy(void* thisx);
|
||||||
void TransitionWipe1_Update(void* thisx, s32 updateRate);
|
void TransitionWipe1_Update(void* thisx, s32 updateRate);
|
||||||
|
@ -17,35 +19,120 @@ void TransitionWipe1_SetColor(void* thisx, u32 color);
|
||||||
void TransitionWipe1_SetEnvColor(void* thisx, u32 color);
|
void TransitionWipe1_SetEnvColor(void* thisx, u32 color);
|
||||||
s32 TransitionWipe1_IsDone(void* thisx);
|
s32 TransitionWipe1_IsDone(void* thisx);
|
||||||
|
|
||||||
#if 0
|
#include "assets/overlays/ovl_fbdemo_wipe1/ovl_fbdemo_wipe1.c"
|
||||||
|
|
||||||
TransitionInit TransitionWipe1_InitVars = {
|
TransitionInit TransitionWipe1_InitVars = {
|
||||||
TransitionWipe1_Init,
|
TransitionWipe1_Init, TransitionWipe1_Destroy, TransitionWipe1_Update,
|
||||||
TransitionWipe1_Destroy,
|
TransitionWipe1_Draw, TransitionWipe1_Start, TransitionWipe1_SetType,
|
||||||
TransitionWipe1_Update,
|
TransitionWipe1_SetColor, TransitionWipe1_SetEnvColor, TransitionWipe1_IsDone,
|
||||||
TransitionWipe1_Draw,
|
|
||||||
TransitionWipe1_Start,
|
|
||||||
TransitionWipe1_SetType,
|
|
||||||
TransitionWipe1_SetColor,
|
|
||||||
TransitionWipe1_SetEnvColor,
|
|
||||||
TransitionWipe1_IsDone,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
typedef enum {
|
||||||
|
/* 0 */ TRANS_WIPE1_DIR_IN,
|
||||||
|
/* 1 */ TRANS_WIPE1_DIR_OUT
|
||||||
|
} TransitionWipe1Direction;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_Start.s")
|
void TransitionWipe1_Start(void* thisx) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_Init.s")
|
this->isDone = false;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_Destroy.s")
|
if (this->direction != TRANS_WIPE1_DIR_IN) {
|
||||||
|
this->texY = (s32)(83.25f * (1 << 2));
|
||||||
|
} else {
|
||||||
|
this->texY = (s32)(153.0f * (1 << 2));
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_Update.s")
|
guPerspective(&this->projection, &this->normal, 60.0f, (4.0f / 3.0f), 10.0f, 12800.0f, 1.0f);
|
||||||
|
guLookAt(&this->lookAt, 0.0f, 0.0f, 400.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_Draw.s")
|
void* TransitionWipe1_Init(void* thisx) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_IsDone.s")
|
bzero(this, sizeof(TransitionWipe1));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_SetType.s")
|
void TransitionWipe1_Destroy(void* thisx) {
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_SetColor.s")
|
void TransitionWipe1_Update(void* thisx, s32 updateRate) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe1/TransitionWipe1_SetEnvColor.s")
|
if (this->direction != TRANS_WIPE1_DIR_IN) {
|
||||||
|
this->texY += (((void)0, gSaveContext.transWipeSpeed) * 3) / updateRate;
|
||||||
|
if (this->texY >= (s32)(153.0f * (1 << 2))) {
|
||||||
|
this->texY = (s32)(153.0f * (1 << 2));
|
||||||
|
this->isDone = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this->texY -= (((void)0, gSaveContext.transWipeSpeed) * 3) / updateRate;
|
||||||
|
if (this->texY <= (s32)(83.25f * (1 << 2))) {
|
||||||
|
this->texY = (s32)(83.25f * (1 << 2));
|
||||||
|
this->isDone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe1_Draw(void* thisx, Gfx** gfxP) {
|
||||||
|
Gfx* gfx = *gfxP;
|
||||||
|
Mtx* modelView;
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
Gfx* texScroll;
|
||||||
|
s32 pad[4];
|
||||||
|
|
||||||
|
modelView = this->modelView[this->frame];
|
||||||
|
this->frame ^= 1;
|
||||||
|
|
||||||
|
guScale(&modelView[0], 0.56f, 0.56f, 1.0f);
|
||||||
|
guRotate(&modelView[1], 0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
guTranslate(&modelView[2], 0.0f, 0.0f, 0.0f);
|
||||||
|
gDPPipeSync(gfx++);
|
||||||
|
texScroll = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 0, 0);
|
||||||
|
gSPSegment(gfx++, 8, texScroll);
|
||||||
|
gDPSetPrimColor(gfx++, 0, 0x80, this->primColor.r, this->primColor.g, this->primColor.b, 255);
|
||||||
|
gSPMatrix(gfx++, &this->projection, G_MTX_LOAD | G_MTX_PROJECTION);
|
||||||
|
gSPPerspNormalize(gfx++, this->normal);
|
||||||
|
gSPMatrix(gfx++, &this->lookAt, G_MTX_MUL | G_MTX_PROJECTION);
|
||||||
|
gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||||
|
gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||||
|
gSPDisplayList(gfx++, sTransWipe1DL);
|
||||||
|
gDPPipeSync(gfx++);
|
||||||
|
*gfxP = gfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 TransitionWipe1_IsDone(void* thisx) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
|
return this->isDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe1_SetType(void* thisx, s32 type) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
|
if (type == TRANS_INSTANCE_TYPE_FILL_OUT) {
|
||||||
|
this->direction = TRANS_WIPE1_DIR_OUT;
|
||||||
|
} else {
|
||||||
|
this->direction = TRANS_WIPE1_DIR_IN;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->direction != TRANS_WIPE1_DIR_IN) {
|
||||||
|
this->texY = (s32)(83.25f * (1 << 2));
|
||||||
|
} else {
|
||||||
|
this->texY = (s32)(153.0f * (1 << 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe1_SetColor(void* thisx, u32 color) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
|
this->primColor.rgba = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe1_SetEnvColor(void* thisx, u32 color) {
|
||||||
|
TransitionWipe1* this = THIS;
|
||||||
|
|
||||||
|
this->envColor.rgba = color;
|
||||||
|
}
|
||||||
|
|
|
@ -5,7 +5,17 @@
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x000 */ char unk_0[0x218];
|
/* 0x000 */ Color_RGBA8_u32 primColor;
|
||||||
|
/* 0x004 */ Color_RGBA8_u32 envColor;
|
||||||
|
/* 0x008 */ u8 direction;
|
||||||
|
/* 0x009 */ u8 frame;
|
||||||
|
/* 0x00A */ u8 isDone;
|
||||||
|
/* 0x00C */ u16 texX;
|
||||||
|
/* 0x00E */ u16 texY;
|
||||||
|
/* 0x010 */ u16 normal;
|
||||||
|
/* 0x018 */ Mtx projection;
|
||||||
|
/* 0x058 */ Mtx lookAt;
|
||||||
|
/* 0x098 */ Mtx modelView[2][3];
|
||||||
} TransitionWipe1; // size = 0x218
|
} TransitionWipe1; // size = 0x218
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue