summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrakxo <87568477+Prakxo@users.noreply.github.com>2024-10-21 16:57:26 +0200
committerGitHub <noreply@github.com>2024-10-21 07:57:26 -0700
commit943287ddfa1bc36685c541eab209b01f75078c52 (patch)
treee4c57bfdc61c6a1f452fd6e8f999e3cb533a30ab
parent78d0c294c50f9ade86f9e60cb2bea6479b56357a (diff)
m_fbdemo* OK (#223)
* m_fbdemo OK * m_fbdemo_wipe1 OK * fix play * m_fbdemo_triforce OK * link triforce * m_fbdemo_fade OK * typo * newline * format
-rw-r--r--include/6A6E80.h30
-rw-r--r--include/6A7D20.h15
-rw-r--r--include/6A8180.h20
-rw-r--r--include/m_common_data.h4
-rw-r--r--include/m_fbdemo.h32
-rw-r--r--include/m_fbdemo_fade.h26
-rw-r--r--include/m_fbdemo_triforce.h29
-rw-r--r--include/m_fbdemo_wipe1.h30
-rw-r--r--include/z64math.h6
-rw-r--r--linker_scripts/jp/symbol_addrs_code.txt2
-rw-r--r--linker_scripts/jp/undefined_syms.ld6
-rw-r--r--src/code/m_fbdemo.c223
-rw-r--r--src/code/m_fbdemo_fade.c91
-rw-r--r--src/code/m_fbdemo_triforce.c109
-rw-r--r--src/code/m_fbdemo_wipe1.c94
-rw-r--r--src/overlays/gamestates/ovl_play/m_play.c160
-rw-r--r--src/overlays/gamestates/ovl_play/m_play.h58
-rw-r--r--yamls/jp/code.yaml16
18 files changed, 764 insertions, 187 deletions
diff --git a/include/6A6E80.h b/include/6A6E80.h
deleted file mode 100644
index 5bea574..0000000
--- a/include/6A6E80.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef C_6A6E80_H
-#define C_6A6E80_H
-
-#include "ultra64.h"
-
-struct Game_Play;
-
-typedef struct Play80804480 {
- /* 0x00 */ char unk00[0xDC];
-} Play80804480; // size = 0xDC
-
-// void func_800831E0_jp();
-// void func_800835AC_jp();
-void fbdemo_cleanup(Play80804480* arg0);
-s32 fbdemo_init(Play80804480* arg0, s32 arg1, s32 arg2, struct Game_Play* game_play);
-// void func_80083870_jp();
-void fbdemo_draw(Play80804480* arg0, Gfx** gfx);
-// void func_80083AB0_jp();
-void fbdemo_move(Play80804480* arg0);
-// void func_80083BF0_jp();
-void fbdemo_triforce_startup(void*);
-void fbdemo_triforce_init(void*);
-// void func_80083CE8_jp();
-void fbdemo_triforce_move(void*, u8);
-void fbdemo_triforce_draw(void*, Gfx**);
-s32 fbdemo_triforce_is_finish(void*, Game_Play* game_play);
-void fbdemo_triforce_settype(void*, s32);
-void fbdemo_triforce_setcolor_rgba8888(void*, s32);
-
-#endif
diff --git a/include/6A7D20.h b/include/6A7D20.h
deleted file mode 100644
index 3a0a651..0000000
--- a/include/6A7D20.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef C_6A7D20_H
-#define C_6A7D20_H
-
-#include "ultra64.h"
-
-void fbdemo_wipe1_init(void*);
-void fbdemo_wipe1_move(void*, u8);
-void fbdemo_wipe1_draw(void*, Gfx**);
-void fbdemo_wipe1_startup(void*);
-void fbdemo_wipe1_settype(void*, s32);
-void fbdemo_wipe1_setcolor_rgba8888(void*, s32);
-// void func_800844BC_jp();
-s32 fbdemo_wipe1_is_finish(void*, Game_Play* game_play);
-
-#endif
diff --git a/include/6A8180.h b/include/6A8180.h
deleted file mode 100644
index 5092a06..0000000
--- a/include/6A8180.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef C_6A8180_H
-#define C_6A8180_H
-
-#include "ultra64.h"
-
-struct Game_Play;
-
-typedef struct Game_Play2128 {
- /* 0x00 */ char unk00[0x10];
-} Game_Play2128; // size = 0x10
-
-void fbdemo_fade_init(void* arg0);
-void fbdemo_fade_move(void* arg0, u8 arg1);
-void fbdemo_fade_draw(void* arg0, Gfx** gfx);
-void fbdemo_fade_startup(void* arg0);
-void fbdemo_fade_settype(void* arg0, s32 arg1);
-void fbdemo_fade_setcolor_rgba8888(void* arg0, s32 arg1);
-s32 fbdemo_fade_is_finish(void* arg0, struct Game_Play* game_play);
-
-#endif
diff --git a/include/m_common_data.h b/include/m_common_data.h
index 0c399d4..23836cd 100644
--- a/include/m_common_data.h
+++ b/include/m_common_data.h
@@ -129,8 +129,8 @@ typedef struct CommonData {
/* 0x10141 */ u8 fish_location;
/* 0x10142 */ u8 unk_10142[0x6];
/* 0x10148 */ u8 unk_10148;
- /* 0x10149 */ u8 unk_10149;
- /* 0x1014A */ u8 unk_1014A;
+ /* 0x10149 */ u8 fadeRate;
+ /* 0x1014A */ u8 wipeRate;
/* 0x1014B */ u8 unk_1014B; // named "wipeType" in AC GCN decomp
/* 0x1014C */ s16 unk_1014C;
/* 0x1014E */ s16 unk_1014E;
diff --git a/include/m_fbdemo.h b/include/m_fbdemo.h
new file mode 100644
index 0000000..5878f2c
--- /dev/null
+++ b/include/m_fbdemo.h
@@ -0,0 +1,32 @@
+#ifndef M_FBDEMO_H
+#define M_FBDEMO_H
+
+#include "ultra64.h"
+#include "z64math.h"
+
+typedef struct fbDemo {
+ /* 0x00 */ s32 cols;
+ /* 0x04 */ s32 rows;
+ /* 0x08 */ s32 frame;
+ /* 0x0C */ xy_t* vtxData;
+ /* 0x10 */ Vtx* vtxFrame1;
+ /* 0x14 */ Vtx* vtxFrame2;
+ /* 0x18 */ Mtx projection;
+ /* 0x58 */ Mtx modelView1;
+ /* 0x98 */ Mtx modelView2;
+ /* 0xD8 */ Gfx* gfxtbl;
+ /* 0xDC */ u16* zBuffer;
+} fbDemo; // size = 0xE0
+
+void fbdemo_init_gfx(fbDemo* this);
+void fbdemo_init_data(fbDemo* this);
+void fbdemo_cleanup(fbDemo* this);
+fbDemo* fbdemo_init(fbDemo* this, s32 cols, s32 rows);
+void fbdemo_update(fbDemo* this);
+void fbdemo_draw(fbDemo* this, Gfx** gfxP);
+void fbdemo_move_type_A(fbDemo* this);
+void fbdemo_move(fbDemo* this);
+s32 fbdemo_is_finish(fbDemo* this);
+
+
+#endif
diff --git a/include/m_fbdemo_fade.h b/include/m_fbdemo_fade.h
new file mode 100644
index 0000000..0368e73
--- /dev/null
+++ b/include/m_fbdemo_fade.h
@@ -0,0 +1,26 @@
+#ifndef M_FBDEMO_FADE_H
+#define M_FBDEMO_FADE_H
+
+#include "ultra64.h"
+#include "color.h"
+
+typedef struct fbDemoFade {
+ /* 0x000 */ u8 type;
+ /* 0x001 */ u8 isDone;
+ /* 0x002 */ u8 direction;
+ /* 0x004 */ Color_RGBA8_u32 color;
+ /* 0x008 */ s16 frame;
+ /* 0x00A */ u16 unkA;
+ /* 0x00C */ u16 timer;
+} fbDemoFade; // size = 0x10
+
+fbDemoFade* fbdemo_fade_init(fbDemoFade* this);
+void fbdemo_fade_move(fbDemoFade* this, s32 rate);
+void fbdemo_fade_draw(fbDemoFade* this, Gfx** gfxP);
+void fbdemo_fade_startup(fbDemoFade* this);
+void fbdemo_fade_settype(fbDemoFade* this, int type);
+void fbdemo_fade_setcolor_rgba8888(fbDemoFade* this, u32 color);
+u8 fbdemo_fade_is_finish(fbDemoFade* this);
+
+
+#endif
diff --git a/include/m_fbdemo_triforce.h b/include/m_fbdemo_triforce.h
new file mode 100644
index 0000000..43a7564
--- /dev/null
+++ b/include/m_fbdemo_triforce.h
@@ -0,0 +1,29 @@
+#ifndef M_FBDEMO_TRIFORCE_H
+#define M_FBDEMO_TRIFORCE_H
+
+#include "ultra64.h"
+
+typedef struct fbDemoTriforce {
+ /* 0x00 */ s32 txt;
+ /* 0x04 */ s32 frame;
+ /* 0x08 */ u8 direction;
+ /* 0x09 */ u8 textureNo;
+ /* 0x0A */ u8 finished;
+ /* 0x0B */ u8 unkB;
+ /* 0x0C */ u16 normal;
+ /* 0x0E */ u8 unkE[2];
+ /* 0x10 */ Mtx perspMtx;
+ /* 0x50 */ Mtx lookAtMtx;
+} fbDemoTriforce; // size = 0x90;
+
+void fbdemo_triforce_startup(fbDemoTriforce* this);
+fbDemoTriforce* fbdemo_triforce_init(fbDemoTriforce* this);
+void fbdemo_triforce_setrate(s32* rate, f32 scale);
+void fbdemo_triforce_move(fbDemoTriforce* this, s32 rate);
+void fbdemo_triforce_draw(fbDemoTriforce* this, Gfx** gfxP);
+u8 fbdemo_triforce_is_finish(fbDemoTriforce* this);
+void fbdemo_triforce_settype(fbDemoTriforce* this, s32 type);
+void fbdemo_triforce_setcolor_rgba8888(fbDemoTriforce* this, u32* color);
+
+
+#endif
diff --git a/include/m_fbdemo_wipe1.h b/include/m_fbdemo_wipe1.h
new file mode 100644
index 0000000..27f236e
--- /dev/null
+++ b/include/m_fbdemo_wipe1.h
@@ -0,0 +1,30 @@
+#ifndef M_FBDEMO_WIPE_H
+#define M_FBDEMO_WIPE_H
+
+#include "ultra64.h"
+#include "color.h"
+
+typedef struct fbDemoWipe1 {
+ /* 0x000 */ Color_RGBA8_u32 color;
+ /* 0x004 */ Color_RGBA8_u32 altColor;
+ /* 0x008 */ u8 direction;
+ /* 0x009 */ u8 frame;
+ /* 0x00A */ u8 finished;
+ /* 0x00C */ u16 texX;
+ /* 0x00E */ u16 texY;
+ /* 0x010 */ u16 normal;
+ /* 0x018 */ Mtx projection;
+ /* 0x058 */ Mtx lookAt;
+ /* 0x098 */ Mtx modelView[2][3];
+} fbDemoWipe1; // size = 0x218
+
+fbDemoWipe1* fbdemo_wipe1_init(fbDemoWipe1* this);
+void fbdemo_wipe1_move(fbDemoWipe1* this, s32 rate);
+void fbdemo_wipe1_draw(fbDemoWipe1* this, Gfx** gfxP);
+void fbdemo_wipe1_startup(fbDemoWipe1* this);
+void fbdemo_wipe1_settype(fbDemoWipe1* this, s32 type);
+void fbdemo_wipe1_setcolor_rgba8888(fbDemoWipe1* this, u32 color);
+void fbdemo_wipe1_setaltcolor_rgba8888(fbDemoWipe1* this, u32 color);
+u8 fbdemo_wipe1_is_finish(fbDemoWipe1* this);
+
+#endif
diff --git a/include/z64math.h b/include/z64math.h
index f7aac28..b268839 100644
--- a/include/z64math.h
+++ b/include/z64math.h
@@ -13,10 +13,10 @@ typedef struct {
/* 0x2 */ s16 z;
} Vec2s; // size = 0x4
-typedef struct {
+typedef struct xy_t {
/* 0x0 */ f32 x;
- /* 0x4 */ f32 z;
-} Vec2f; // size = 0x8
+ /* 0x4 */ f32 y;
+} xy_t; // size = 0x8
typedef struct xyz_t {
/* 0x0 */ f32 x;
diff --git a/linker_scripts/jp/symbol_addrs_code.txt b/linker_scripts/jp/symbol_addrs_code.txt
index 290949b..5a146be 100644
--- a/linker_scripts/jp/symbol_addrs_code.txt
+++ b/linker_scripts/jp/symbol_addrs_code.txt
@@ -4548,7 +4548,7 @@ D_80105628_jp = 0x80105628; //
D_80105670_jp = 0x80105670; //
D_801056A0_jp = 0x801056A0; //
D_80105830_jp = 0x80105830; //
-D_80106030_jp = 0x80106030; //
+wipe1_modelT = 0x80106030; //
D_80106130_jp = 0x80106130; //
D_80106158_jp = 0x80106158; // type:s16
D_80106170_jp = 0x80106170; //
diff --git a/linker_scripts/jp/undefined_syms.ld b/linker_scripts/jp/undefined_syms.ld
index 68c6490..cca06da 100644
--- a/linker_scripts/jp/undefined_syms.ld
+++ b/linker_scripts/jp/undefined_syms.ld
@@ -148,9 +148,9 @@ D_4003614 = 0x04003614;
// 6A6E80
-D_4004740 = 0x04004740;
-D_4004D60 = 0x04004D60;
-D_4005360 = 0x04005360;
+ef_wipe1_modelT = 0x04004740;
+ef_wipe2_modelT = 0x04004D60;
+ef_wipe3_modelT = 0x04005360;
// 6B3DC0
diff --git a/src/code/m_fbdemo.c b/src/code/m_fbdemo.c
new file mode 100644
index 0000000..1b60b94
--- /dev/null
+++ b/src/code/m_fbdemo.c
@@ -0,0 +1,223 @@
+#include "m_fbdemo.h"
+#include "libc64/sleep.h"
+#include "libc64/malloc.h"
+#include "attributes.h"
+
+Gfx fbdemo_gfx_init[] = {
+ gsDPPipeSync(),
+ gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
+ gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
+ G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
+ gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
+ gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
+ G_AC_NONE | G_ZS_PIXEL | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
+ gsSPEndDisplayList(),
+};
+
+#define SET_VERTEX(vtx, x, y, z, s, t, nx, ny, nz, alpha) \
+ { \
+ Vtx_tn* vtxn = &(vtx)->n; \
+ vtxn->ob[0] = (x); \
+ vtxn->ob[1] = (y); \
+ vtxn->ob[2] = (z); \
+ vtxn->flag = 0; \
+ vtxn->tc[0] = (s); \
+ vtxn->tc[1] = (t); \
+ vtxn->n[0] = (nx); \
+ vtxn->n[1] = (ny); \
+ vtxn->n[2] = (nz); \
+ vtxn->a = (alpha); \
+ }
+
+void fbdemo_init_gfx(fbDemo* this) {
+ s32 col;
+ s32 col2;
+ s32 colTex;
+ s32 rowTex;
+ s32 row;
+ s32 frame;
+ Vtx* vtx;
+ Gfx* gfx;
+
+ guMtxIdent(&this->modelView1);
+ guMtxIdent(&this->modelView2);
+ guOrtho(&this->projection, 0.0f, 320, 240, 0.0f, -1000.0f, 1000.0f, 1.0f);
+
+ for (frame = 0; frame < 2; frame++) {
+ this->frame = frame;
+ vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
+ for (rowTex = 0, row = 0; row < (this->rows + 1); rowTex += 0x20, row++) {
+ for (colTex = 0, col = 0; col < (this->cols + 1); col++, colTex += 0x20) {
+ SET_VERTEX(vtx++, col * 0x20, row * 0x20, -5, colTex << 6, rowTex << 6, 0, 0, 120, 255);
+ }
+ }
+ }
+
+ gfx = this->gfxtbl;
+
+ for (rowTex = 0, row = 0; row < this->rows; rowTex += 0x20, row++) {
+ gSPVertex(gfx++, SEGMENT_ADDR(G_MWO_SEGMENT_A, (u32)row * (this->cols + 1) * sizeof(Vtx)), 2 * (this->cols + 1),
+ 0);
+
+ colTex = 0;
+ col = 0;
+ col2 = 0;
+ while (col < this->cols) {
+ gDPPipeSync(gfx++);
+
+ gDPLoadTextureTile(gfx++, SEGMENT_ADDR(G_MWO_SEGMENT_B, 0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, 240, colTex,
+ rowTex, colTex + 0x20, rowTex + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+
+ gSP1Quadrangle(gfx++, col2, col2 + 1, col2 + (this->cols) + 2, this->cols + 1 + col2, 0);
+
+ colTex += 0x20;
+ col2++;
+ col++;
+ }
+ }
+
+ gDPPipeSync(gfx++);
+ gSPEndDisplayList(gfx++);
+}
+
+void fbdemo_init_data(fbDemo* this) {
+ s32 col;
+ s32 row;
+
+ for (row = 0; row < this->rows + 1; row++) {
+ for (col = 0; col < this->cols + 1; col++) {
+ (this->vtxData + col + row * (this->cols + 1))->x = col * 0x20;
+ (this->vtxData + col + row * (this->cols + 1))->y = row * 0x20;
+ }
+ }
+}
+
+void fbdemo_cleanup(fbDemo* this) {
+ msleep(100);
+
+ if (this->vtxData != NULL) {
+ free(this->vtxData);
+ this->vtxData = NULL;
+ }
+ if (this->vtxFrame1 != NULL) {
+ free(this->vtxFrame1);
+ this->vtxFrame1 = NULL;
+ }
+ if (this->vtxFrame2 != NULL) {
+ free(this->vtxFrame2);
+ this->vtxFrame2 = NULL;
+ }
+ if (this->gfxtbl != NULL) {
+ free(this->gfxtbl);
+ this->gfxtbl = NULL;
+ }
+}
+
+fbDemo* fbdemo_init(fbDemo* this, s32 cols, s32 rows) {
+ bzero(this, sizeof(fbDemo));
+
+ this->cols = cols;
+ this->rows = rows;
+
+ this->frame = 0;
+ this->vtxData = malloc((cols + 1) * sizeof(xy_t) * (rows + 1));
+
+ this->vtxFrame1 = malloc((cols + 1) * sizeof(Vtx) * (rows + 1));
+ this->vtxFrame2 = malloc((cols + 1) * sizeof(Vtx) * (rows + 1));
+
+ this->gfxtbl = malloc((this->rows * (this->cols * 9 + 1) + 2) * sizeof(Gfx));
+
+ if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) || (this->vtxFrame2 == NULL) || (this->gfxtbl == NULL)) {
+ if (this->vtxData != NULL) {
+ free(this->vtxData);
+ this->vtxData = NULL;
+ }
+
+ if (this->vtxFrame1 != NULL) {
+ free(this->vtxFrame1);
+ this->vtxFrame1 = NULL;
+ }
+
+ if (this->vtxFrame2 != NULL) {
+ free(this->vtxFrame2);
+ this->vtxFrame2 = NULL;
+ }
+
+ if (this->gfxtbl != NULL) {
+ free(this->gfxtbl);
+ this->gfxtbl = NULL;
+ }
+
+ return NULL;
+ }
+
+ fbdemo_init_gfx(this);
+ fbdemo_init_data(this);
+ this->frame = 0;
+
+ return this;
+}
+
+void fbdemo_update(fbDemo* this) {
+ s32 col;
+ s32 row;
+ Vtx* vtx;
+
+ for (row = 0; row < this->rows + 1; row++) {
+ for (col = 0; col < this->cols + 1; col++) {
+ vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
+ (vtx + col + row * (this->cols + 1))->n.ob[0] = (this->vtxData + col + row * (this->cols + 1))->x;
+
+ vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
+ (vtx + col + row * (this->cols + 1))->n.ob[1] = (this->vtxData + col + row * (this->cols + 1))->y;
+ }
+ }
+}
+
+void fbdemo_draw(fbDemo* this, Gfx** gfxP) {
+ Gfx* gfx = *gfxP;
+
+ gSPDisplayList(gfx++, fbdemo_gfx_init);
+ fbdemo_update(this);
+ gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
+ gSPMatrix(gfx++, &this->modelView1, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPSegment(gfx++, G_MWO_SEGMENT_A, this->frame == 0 ? this->vtxFrame1 : this->vtxFrame2);
+ gSPSegment(gfx++, G_MWO_SEGMENT_B, this->zBuffer);
+ gSPDisplayList(gfx++, fbdemo_gfx_init);
+ gSPDisplayList(gfx++, this->gfxtbl);
+ gDPPipeSync(gfx++);
+ this->frame ^= 1;
+ *gfxP = gfx;
+}
+
+void fbdemo_move_type_A(fbDemo* this) {
+ s32 row;
+ s32 col;
+ f32 diffX;
+ f32 diffY;
+ f32 scale;
+
+ for (row = 0; row < this->rows + 1; row++) {
+ for (col = 0; col < this->cols + 1; col++) {
+ diffX = (this->vtxData + col + row * (this->cols + 1))->x - (this->vtxData + 5 + 4 * (this->cols + 1))->x;
+ diffY = (this->vtxData + col + row * (this->cols + 1))->y - (this->vtxData + 5 + 4 * (this->cols + 1))->y;
+ scale = (SQ(diffX) + SQ(diffY)) / 100.0f;
+ if (scale != 0.0f) {
+ if (scale < 1.0f) {
+ scale = 1.0f;
+ }
+ (this->vtxData + col + row * (this->cols + 1))->x -= diffX / scale;
+ (this->vtxData + col + row * (this->cols + 1))->y -= diffY / scale;
+ }
+ }
+ }
+}
+
+void fbdemo_move(UNUSED fbDemo* this) {
+}
+
+s32 fbdemo_is_finish(UNUSED fbDemo* this) {
+ return FALSE;
+}
diff --git a/src/code/m_fbdemo_fade.c b/src/code/m_fbdemo_fade.c
new file mode 100644
index 0000000..4229859
--- /dev/null
+++ b/src/code/m_fbdemo_fade.c
@@ -0,0 +1,91 @@
+#include "m_fbdemo_fade.h"
+#include "m_common_data.h"
+#include "macros.h"
+
+Gfx fbdemo_fade_gfx_init[] = {
+ gsDPPipeSync(),
+ gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
+ G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
+ gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
+ G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
+ gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
+ gsSPEndDisplayList(),
+};
+
+fbDemoFade* fbdemo_fade_init(fbDemoFade* this) {
+ bzero(this, sizeof(fbDemoFade));
+ return this;
+}
+
+void fbdemo_fade_move(fbDemoFade* this, s32 rate) {
+ f32 ftimer;
+ s32 alpha;
+
+ if (this->timer != 0) {
+ this->timer -= 1;
+ return;
+ }
+
+ if (this->type != 7) {
+ this->frame += rate;
+ if (this->frame >= common_data.fadeRate) {
+ this->frame = common_data.fadeRate;
+ this->isDone = 1;
+ }
+ ftimer = (f32)this->frame;
+ if (ftimer < 0.0f) {
+ ftimer = 0.0f;
+ }
+
+ alpha = (255.0f * ftimer) / common_data.fadeRate;
+ if (this->type == 1) {
+ this->color.a = 255 - alpha;
+ } else {
+ this->color.a = alpha;
+ }
+ }
+}
+
+void fbdemo_fade_draw(fbDemoFade* this, Gfx** gfxP) {
+ Gfx* gfx;
+ Color_RGBA8_u32* color = &this->color;
+
+ if (color->a != 0) {
+ gfx = *gfxP;
+ gSPDisplayList(gfx++, fbdemo_fade_gfx_init);
+ gDPSetPrimColor(gfx++, 0, 0, color->r, color->g, color->b, color->a);
+ gDPFillRectangle(gfx++, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+ gDPPipeSync(gfx++);
+ *gfxP = gfx;
+ }
+}
+
+void fbdemo_fade_startup(fbDemoFade* this) {
+ static s16 start_frame[] = { 0x0000, 0xFFFA, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xFFAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 };
+
+ static s32 start_color[] = { 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+ u8 type = this->type;
+
+ this->color.a = start_color[type];
+ this->frame = start_frame[type];
+
+ this->isDone = 0;
+ if (this->type == 1) {
+ this->timer = 5;
+ }
+}
+
+void fbdemo_fade_settype(fbDemoFade* this, int type) {
+ this->type = type;
+}
+
+void fbdemo_fade_setcolor_rgba8888(fbDemoFade* this, u32 color) {
+ this->color.rgba = color;
+}
+
+u8 fbdemo_fade_is_finish(fbDemoFade* this) {
+ return this->isDone;
+}
diff --git a/src/code/m_fbdemo_triforce.c b/src/code/m_fbdemo_triforce.c
new file mode 100644
index 0000000..48137e6
--- /dev/null
+++ b/src/code/m_fbdemo_triforce.c
@@ -0,0 +1,109 @@
+#include "m_fbdemo_triforce.h"
+#include "gfxalloc.h"
+#include "m_rcp.h"
+#include "attributes.h"
+
+extern u8 ef_wipe1_modelT[];
+extern u8 ef_wipe2_modelT[];
+extern u8 ef_wipe3_modelT[];
+
+void fbdemo_triforce_startup(fbDemoTriforce* this) {
+ this->finished = 0;
+ this->frame = 16;
+
+ if (this->direction != 0) {
+ this->txt = 0;
+ } else {
+ this->txt = 0x224;
+ }
+
+ guPerspective(&this->perspMtx, &this->normal, 60.0f, 4.0f / 3.0f, 10.0f, 12800.0f, 1.0f);
+ guLookAt(&this->lookAtMtx, 0.0f, 0.0f, 400.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
+}
+
+fbDemoTriforce* fbdemo_triforce_init(fbDemoTriforce* this) {
+ bzero(this, sizeof(fbDemoTriforce));
+ return this;
+}
+
+void fbdemo_triforce_setrate(s32* rate, f32 scale) {
+ *rate = 548.0f * scale;
+}
+
+void fbdemo_triforce_move(fbDemoTriforce* this, s32 rate) {
+ s32 moveRate;
+ UNUSED s32 txt = this->txt;
+ f32 temp = (1.0f - (this->txt / 548.0f));
+
+ moveRate = this->frame + (s32)(12.0f * temp);
+
+ if (this->direction != 0) {
+
+ this->txt += (moveRate << 1) / rate;
+ if (this->txt >= 548) {
+ this->txt = 548;
+ this->finished = TRUE;
+ }
+ } else {
+ this->txt -= (moveRate << 1) / rate;
+ if (this->txt <= 0) {
+ this->txt = 0;
+ this->finished = TRUE;
+ }
+ }
+}
+
+void fbdemo_triforce_draw(fbDemoTriforce* this, Gfx** gfxP) {
+ Gfx* gfx = *gfxP;
+ Gfx* scroll;
+ f32 scale;
+
+ gDPPipeSync(gfx++);
+ scroll = gfx_tex_scroll2(&gfx, this->txt, 0, 16, 4);
+ gSPSegment(gfx++, G_MWO_SEGMENT_9, scroll);
+ gSPMatrix(gfx++, &this->perspMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
+ gSPPerspNormalize(gfx++, this->normal);
+ gSPMatrix(gfx++, &this->lookAtMtx, G_MTX_MUL | G_MTX_PROJECTION);
+
+ scale = 0.019f;
+
+ if (1.0f != scale) {
+ Mtx* mtxBuf;
+
+ mtxBuf = gfxalloc(&gfx, sizeof(Mtx));
+
+ guScale(mtxBuf, 0.019f, 0.019f, 1.0f);
+ gSPMatrix(gfx++, mtxBuf, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ }
+
+ switch (this->textureNo) {
+ case 0:
+ gSPDisplayList(gfx++, ef_wipe1_modelT);
+ break;
+ case 1:
+ gSPDisplayList(gfx++, ef_wipe2_modelT);
+ break;
+ case 2:
+ gSPDisplayList(gfx++, ef_wipe3_modelT);
+ break;
+ }
+ gDPPipeSync(gfx++);
+ *gfxP = gfx;
+}
+
+u8 fbdemo_triforce_is_finish(fbDemoTriforce* this) {
+ return this->finished;
+}
+
+void fbdemo_triforce_settype(fbDemoTriforce* this, s32 type) {
+ this->textureNo = ((type & 0x80) != 0) ? 1 : ((type & 0x40) != 0 ? 2 : 0);
+
+ if ((type & 0xF) == 1) {
+ this->direction = 0;
+ } else {
+ this->direction = 1;
+ }
+}
+
+void fbdemo_triforce_setcolor_rgba8888(UNUSED fbDemoTriforce* this, UNUSED u32* rgba) {
+}
diff --git a/src/code/m_fbdemo_wipe1.c b/src/code/m_fbdemo_wipe1.c
new file mode 100644
index 0000000..3fc67f2
--- /dev/null
+++ b/src/code/m_fbdemo_wipe1.c
@@ -0,0 +1,94 @@
+#include "m_fbdemo_wipe1.h"
+#include "m_common_data.h"
+#include "m_rcp.h"
+
+extern Gfx wipe1_modelT[]; // TODO: extract
+
+fbDemoWipe1* fbdemo_wipe1_init(fbDemoWipe1* this) {
+ bzero(this, sizeof(fbDemoWipe1));
+ return this;
+}
+
+void fbdemo_wipe1_move(fbDemoWipe1* this, s32 rate) {
+ if (this->direction != 0) {
+ this->texY += (common_data.wipeRate * 3) / rate;
+ if (this->texY >= (s32)(153.0f * (1 << 2))) {
+ this->texY = (s32)(153.0f * (1 << 2));
+ this->finished = TRUE;
+ }
+ } else {
+ this->texY -= (common_data.wipeRate * 3) / rate;
+ if (this->texY <= (s32)(83.25f * (1 << 2))) {
+ this->texY = (s32)(83.25f * (1 << 2));
+ this->finished = TRUE;
+ }
+ }
+}
+
+void fbdemo_wipe1_draw(fbDemoWipe1* this, Gfx** gfxP) {
+ Gfx* gfx = *gfxP;
+ Mtx* modelView;
+ UNUSED s32 pad[5];
+
+ Gfx* texScroll;
+
+ 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_tex_scroll2(&gfx, this->texX, this->texY, 0, 0);
+ gSPSegment(gfx++, 8, texScroll);
+
+ gDPSetPrimColor(gfx++, 0, 0x80, this->color.r, this->color.g, this->color.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++, wipe1_modelT);
+ gDPPipeSync(gfx++);
+ *gfxP = gfx;
+}
+
+void fbdemo_wipe1_startup(fbDemoWipe1* this) {
+ this->finished = 0;
+
+ if (this->direction != 0) {
+ this->texY = (s32)(83.25f * (1 << 2));
+ } else {
+ this->texY = (s32)(153.0f * (1 << 2));
+ }
+
+ 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);
+}
+
+void fbdemo_wipe1_settype(fbDemoWipe1* this, s32 type) {
+ if (type == 1) {
+ this->direction = 1;
+ this->texY = 0x14D;
+ return;
+ }
+ this->direction = 0;
+ this->texY = 0x264;
+}
+
+void fbdemo_wipe1_setcolor_rgba8888(fbDemoWipe1* this, u32 color) {
+ this->color.rgba = color;
+}
+
+void fbdemo_wipe1_setaltcolor_rgba8888(fbDemoWipe1* this, u32 color) {
+ this->altColor.rgba = color;
+}
+
+u8 fbdemo_wipe1_is_finish(fbDemoWipe1* this) {
+ return this->finished;
+}
diff --git a/src/overlays/gamestates/ovl_play/m_play.c b/src/overlays/gamestates/ovl_play/m_play.c
index f5fbca7..1cbd4a2 100644
--- a/src/overlays/gamestates/ovl_play/m_play.c
+++ b/src/overlays/gamestates/ovl_play/m_play.c
@@ -1,6 +1,6 @@
#include "global.h"
#include "m_play.h"
-#include "6A6E80.h"
+#include "m_fbdemo.h"
#include "m_npc.h"
#include "m_handbill.h"
#include "m_field_make.h"
@@ -37,7 +37,6 @@
#include "m_bgm.h"
#include "overlays/gamestates/ovl_famicom_emu/famicom_emu.h"
#include "overlays/gamestates/ovl_trademark/m_trademark.h"
-#include "6A7D20.h"
#include "m_scene_table.h"
#include "zurumode.h"
#include "prevent_bss_reordering.h"
@@ -48,56 +47,7 @@ void Game_play_fbdemo_wipe_create(Game_Play* game_play);
void Game_play_fbdemo_wipe_init(Game_Play* game_play);
void Game_play_fbdemo_wipe_move(Game_Play* game_play);
-Game_PlayUnkFuncsStruct D_80804320_jp = {
- fbdemo_wipe1_init,
- (void*)none_proc1,
- fbdemo_wipe1_move,
- fbdemo_wipe1_draw,
- fbdemo_wipe1_startup,
- fbdemo_wipe1_settype,
- fbdemo_wipe1_setcolor_rgba8888,
- NULL,
- fbdemo_wipe1_is_finish,
-};
-
-Game_PlayUnkFuncsStruct D_80804344_jp = {
- fbdemo_triforce_init,
- (void*)none_proc1,
- fbdemo_triforce_move,
- fbdemo_triforce_draw,
- fbdemo_triforce_startup,
- fbdemo_triforce_settype,
- fbdemo_triforce_setcolor_rgba8888,
- NULL,
- fbdemo_triforce_is_finish,
-};
-
-Game_PlayUnkFuncsStruct D_80804368_jp = {
- fbdemo_fade_init,
- (void*)none_proc1,
- fbdemo_fade_move,
- fbdemo_fade_draw,
- fbdemo_fade_startup,
- fbdemo_fade_settype,
- fbdemo_fade_setcolor_rgba8888,
- NULL,
- fbdemo_fade_is_finish,
-};
-
-Game_PlayUnkFuncsStruct* D_8080438C_jp[] = {
- &D_80804320_jp, &D_80804344_jp, &D_80804368_jp, &D_80804368_jp, &D_80804344_jp, &D_80804344_jp, &D_80804368_jp,
-};
-
-typedef void (*Game_PlayUnkFunc)(Game_Play* game_play);
-Game_PlayUnkFunc D_808043A8_jp[] = {
- (void*)none_proc1,
- Game_play_fbdemo_wipe_create,
- Game_play_fbdemo_wipe_init,
- Game_play_fbdemo_wipe_move,
-};
-
-static Play80804480 fbdemo;
-static void* B_8080455C_jp;
+static fbDemo fbdemo;
static u16 S_back_title_timer;
static u16 S_se_endcheck_timeout;
@@ -131,31 +81,70 @@ void Game_play_camera_proc(Game_Play* game_play) {
}
void Game_play_fbdemo_wipe_destroy(Game_Play* game_play) {
- game_play->unk_1EE8.unk_21C.unk_04(&game_play->unk_1EE8, game_play);
+ game_play->unk_1EE8.fbdemoInfo.destroy(&game_play->unk_1EE8, game_play);
game_play->unk_1EE3 = 0;
- game_play->unk_1EE8.unk_218 = -1;
+ game_play->unk_1EE8.wipeType = -1;
}
void Game_play_fbdemo_wipe_create_sub(Game_Play* game_play) {
- s32 sp1C = game_play->unk_1EE1;
+ static void* wipe_normal_proc[] = {
+ fbdemo_wipe1_init,
+ none_proc1,
+ fbdemo_wipe1_move,
+ fbdemo_wipe1_draw,
+ fbdemo_wipe1_startup,
+ fbdemo_wipe1_settype,
+ fbdemo_wipe1_setcolor_rgba8888,
+ NULL,
+ fbdemo_wipe1_is_finish,
+ };
+ static void* wipe_triforce_proc[] = {
+ fbdemo_triforce_init,
+ none_proc1,
+ fbdemo_triforce_move,
+ fbdemo_triforce_draw,
+ fbdemo_triforce_startup,
+ fbdemo_triforce_settype,
+ fbdemo_triforce_setcolor_rgba8888,
+ NULL,
+ fbdemo_triforce_is_finish,
+ };
+ static void* wipe_fade_proc[] = {
+ fbdemo_fade_init,
+ none_proc1,
+ fbdemo_fade_move,
+ fbdemo_fade_draw,
+ fbdemo_fade_startup,
+ fbdemo_fade_settype,
+ fbdemo_fade_setcolor_rgba8888,
+ NULL,
+ fbdemo_fade_is_finish,
+ };
+
+ static void* wipe_proc[] = {
+ wipe_normal_proc, wipe_triforce_proc, wipe_fade_proc, wipe_fade_proc,
+ wipe_triforce_proc, wipe_triforce_proc, wipe_fade_proc,
+ };
+
+ s32 type = game_play->unk_1EE1;
bzero(&game_play->unk_1EE8, sizeof(Game_Play_Unk_1EE8));
- if (sp1C >= 7) {
- sp1C = 1;
+ if (type >= 7) {
+ type = 1;
}
- game_play->unk_1EE8.unk_218 = sp1C;
+ game_play->unk_1EE8.wipeType = type;
{
- Game_PlayUnkFuncsStruct* temp_v0 = D_8080438C_jp[sp1C];
-
- game_play->unk_1EE8.unk_21C.unk_00 = temp_v0->unk_00;
- game_play->unk_1EE8.unk_21C.unk_04 = temp_v0->unk_04;
- game_play->unk_1EE8.unk_21C.unk_08 = temp_v0->unk_08;
- game_play->unk_1EE8.unk_21C.unk_0C = temp_v0->unk_0C;
- game_play->unk_1EE8.unk_21C.unk_10 = temp_v0->unk_10;
- game_play->unk_1EE8.unk_21C.unk_14 = temp_v0->unk_14;
- game_play->unk_1EE8.unk_21C.unk_18 = temp_v0->unk_18;
- game_play->unk_1EE8.unk_21C.unk_20 = temp_v0->unk_20;
+ Game_PlayfbDemoInfo* info = (Game_PlayfbDemoInfo*)wipe_proc[type];
+
+ game_play->unk_1EE8.fbdemoInfo.init = info->init;
+ game_play->unk_1EE8.fbdemoInfo.destroy = info->destroy;
+ game_play->unk_1EE8.fbdemoInfo.move = info->move;
+ game_play->unk_1EE8.fbdemoInfo.draw = info->draw;
+ game_play->unk_1EE8.fbdemoInfo.startUp = info->startUp;
+ game_play->unk_1EE8.fbdemoInfo.setType = info->setType;
+ game_play->unk_1EE8.fbdemoInfo.setColor = info->setColor;
+ game_play->unk_1EE8.fbdemoInfo.isFinish = info->isFinish;
}
}
@@ -168,22 +157,22 @@ void Game_play_fbdemo_wipe_init(Game_Play* game_play) {
Game_Play_Unk_1EE8* temp_s0 = &game_play->unk_1EE8;
u8 var_v0;
- game_play->unk_1EE8.unk_21C.unk_00(temp_s0);
+ game_play->unk_1EE8.fbdemoInfo.init(temp_s0);
- common_data.unk_1014A = 14;
- common_data.unk_10149 = 30;
+ common_data.wipeRate = 14;
+ common_data.fadeRate = 30;
- temp_s0->unk_21C.unk_18(temp_s0, 0);
+ temp_s0->fbdemoInfo.setColor(temp_s0, 0);
var_v0 = game_play->unk_1EE0;
- if (temp_s0->unk_218 == 4) {
+ if (temp_s0->wipeType == 4) {
var_v0 |= 0x80;
- } else if (temp_s0->unk_218 == 5) {
+ } else if (temp_s0->wipeType == 5) {
var_v0 |= 0x40;
}
- temp_s0->unk_21C.unk_14(temp_s0, var_v0);
- temp_s0->unk_21C.unk_10(temp_s0);
+ temp_s0->fbdemoInfo.setType(temp_s0, var_v0);
+ temp_s0->fbdemoInfo.startUp(temp_s0);
game_play->unk_1EE3 = 3;
S_back_title_timer = 300;
@@ -221,7 +210,7 @@ void Game_play_fbdemo_wipe_move(Game_Play* game_play) {
s32 sp20 = 1;
Game_Play_Unk_1EE8* sp18 = &game_play->unk_1EE8;
- if (game_play->unk_1EE8.unk_21C.unk_20(sp18, game_play) != 0) {
+ if (game_play->unk_1EE8.fbdemoInfo.isFinish(sp18) != 0) {
if ((game_play->unk_1EE0 != 1) && (game_play->unk_1EE0 != 11)) {
if (S_se_endcheck_timeout != 0) {
S_se_endcheck_timeout--;
@@ -301,15 +290,22 @@ void Game_play_fbdemo_wipe_move(Game_Play* game_play) {
}
}
} else {
- sp18->unk_21C.unk_08(sp18, game_GameFrame);
+ sp18->fbdemoInfo.move(sp18, game_GameFrame);
}
}
+typedef void (*PlayWipeProc)(Game_Play* game_play);
void Game_play_fbdemo_wipe_proc(Game_Play* game_play) {
+ static PlayWipeProc wipe_proc[] = {
+ (void*)none_proc1,
+ Game_play_fbdemo_wipe_create,
+ Game_play_fbdemo_wipe_init,
+ Game_play_fbdemo_wipe_move,
+ };
if ((game_play->unk_1EE3 == 0) && (game_play->unk_1EE0 != 0)) {
game_play->unk_1EE3 = 1;
}
- D_808043A8_jp[game_play->unk_1EE3](game_play);
+ wipe_proc[game_play->unk_1EE3](game_play);
}
Gfx* game_play_set_fog(Game_Play* game_play, Gfx* gfx) {
@@ -323,10 +319,10 @@ void Game_play_fbdemo_proc(Game_Play* game_play) {
switch (game_play->unk_1EE2) {
case 2:
- if (fbdemo_init(&fbdemo, 10, 7, game_play) == 0) {
+ if (fbdemo_init(&fbdemo, 10, 7) == 0) {
game_play->unk_1EE2 = 0;
} else {
- B_8080455C_jp = gfxCtx->unk_008;
+ fbdemo.zBuffer = gfxCtx->unk_008;
game_play->unk_1EE2 = 3;
SetGameFrame(1);
}
@@ -623,7 +619,7 @@ s32 makeBumpTexture(Game_Play* game_play, GraphicsContext* __gfxCtx, GraphicsCon
}
SET_FULLSCREEN_VIEWPORT(&view);
showView1(&view, 0xF, &sp194);
- game_play->unk_1EE8.unk_21C.unk_0C(&game_play->unk_1EE8, &sp194);
+ game_play->unk_1EE8.fbdemoInfo.draw(&game_play->unk_1EE8.fbdemo, &sp194);
}
fbdemo_fade_draw(&game_play->unk_2128, &sp194);
diff --git a/src/overlays/gamestates/ovl_play/m_play.h b/src/overlays/gamestates/ovl_play/m_play.h
index 7400a44..fcb9f82 100644
--- a/src/overlays/gamestates/ovl_play/m_play.h
+++ b/src/overlays/gamestates/ovl_play/m_play.h
@@ -19,7 +19,9 @@
#include "m_lights.h"
#include "m_collision_bg.h"
#include "m_pause.h"
-#include "6A8180.h"
+#include "m_fbdemo_fade.h"
+#include "m_fbdemo_wipe1.h"
+#include "m_fbdemo_triforce.h"
#include "m_scene.h"
#include "683030.h"
@@ -31,32 +33,38 @@ struct SceneDmaStatus;
typedef void (*Game_Play_unk_1C58)(struct Actor*);
typedef UNK_RET (*Game_Play_unk_2208)(struct Actor*, struct Game_Play*);
-typedef void (*Game_PlayUnkFunc_00)(void*);
-typedef void (*Game_PlayUnkFunc_04)(void*, struct Game_Play*);
-typedef void (*Game_PlayUnkFunc_08)(void*, u8);
-typedef void (*Game_PlayUnkFunc_0C)(void*, Gfx**);
-typedef void (*Game_PlayUnkFunc_10)(void*);
-typedef void (*Game_PlayUnkFunc_14)(void*, s32);
-typedef void (*Game_PlayUnkFunc_18)(void*, s32);
-typedef void (*Game_PlayUnkFunc_1C)(void);
-typedef s32 (*Game_PlayUnkFunc_20)(void*, struct Game_Play*);
+typedef void (*FBDemoInitProc)(void*);
+typedef void (*FBDemoDestroyProc)(void*, struct Game_Play*);
+typedef void (*FBDemoMoveProc)(void*, u8);
+typedef void (*FBDemoDrawProc)(void*, Gfx**);
+typedef void (*FBDemoStartUpProc)(void*);
+typedef void (*FBDemoSetTypeProc)(void*, s32);
+typedef void (*FBDemoSetColorProc)(void*, u32);
+typedef void (*FBDemoUnkProc)(void);
+typedef s32 (*FBDemoIsFinishProc)(void*);
-typedef struct Game_PlayUnkFuncsStruct {
- /* 0x00 */ Game_PlayUnkFunc_00 unk_00;
- /* 0x04 */ Game_PlayUnkFunc_04 unk_04;
- /* 0x08 */ Game_PlayUnkFunc_08 unk_08;
- /* 0x0C */ Game_PlayUnkFunc_0C unk_0C;
- /* 0x10 */ Game_PlayUnkFunc_10 unk_10;
- /* 0x14 */ Game_PlayUnkFunc_14 unk_14;
- /* 0x18 */ Game_PlayUnkFunc_18 unk_18;
- /* 0x1C */ Game_PlayUnkFunc_1C unk_1C;
- /* 0x20 */ Game_PlayUnkFunc_20 unk_20;
-} Game_PlayUnkFuncsStruct; // size = 0x24
+typedef struct Game_PlayfbDemoInfo {
+ /* 0x00 */ FBDemoInitProc init;
+ /* 0x04 */ FBDemoDestroyProc destroy;
+ /* 0x08 */ FBDemoMoveProc move;
+ /* 0x0C */ FBDemoDrawProc draw;
+ /* 0x10 */ FBDemoStartUpProc startUp;
+ /* 0x14 */ FBDemoSetTypeProc setType;
+ /* 0x18 */ FBDemoSetColorProc setColor;
+ /* 0x1C */ FBDemoUnkProc unk_1C;
+ /* 0x20 */ FBDemoIsFinishProc isFinish;
+} Game_PlayfbDemoInfo; // size = 0x24
+
+typedef union Game_Play_FBDemo {
+ fbDemoWipe1 wipe1;
+ fbDemoTriforce triforce;
+ fbDemoFade fade;
+} Game_Play_FBDemo; // size = 0x218
typedef struct Game_Play_Unk_1EE8 {
- /* 0x000 */ char unk000[0x218];
- /* 0x218 */ s32 unk_218;
- /* 0x21C */ Game_PlayUnkFuncsStruct unk_21C;
+ /* 0x000 */ Game_Play_FBDemo fbdemo;
+ /* 0x218 */ s32 wipeType;
+ /* 0x21C */ Game_PlayfbDemoInfo fbdemoInfo;
} Game_Play_Unk_1EE8; // size = 0x240
typedef struct Game_Play {
@@ -104,7 +112,7 @@ typedef struct Game_Play {
/* 0x1EE3 */ u8 unk_1EE3;
/* 0x1EE4 */ UNK_TYPE1 unk_1EE4[0x4];
/* 0x1EE8 */ Game_Play_Unk_1EE8 unk_1EE8;
- /* 0x2128 */ Game_Play2128 unk_2128;
+ /* 0x2128 */ fbDemoFade unk_2128;
/* 0x2138 */ CollisionCheck unk_2138;
/* 0x2208 */ Game_Play_unk_2208 unk_2208;
/* 0x220C */ s32 unk_220C;
diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml
index 3d00310..78c21c8 100644
--- a/yamls/jp/code.yaml
+++ b/yamls/jp/code.yaml
@@ -32,10 +32,10 @@
- [0x6A0DE0, asm, code/6A0DE0]
- [0x6A5B00, asm, code/6A5B00]
- [0x6A6C40, asm, code/6A6C40]
- - [0x6A6E80, asm, code/m_fbdemo]
- - [0x6A78A0, asm, code/m_fbdemo_triforce]
- - [0x6A7D20, asm, code/m_fbdemo_wipe1]
- - [0x6A8180, asm, code/m_fbdemo_fade]
+ - [0x6A6E80, c, code/m_fbdemo]
+ - [0x6A78A0, c, code/m_fbdemo_triforce]
+ - [0x6A7D20, c, code/m_fbdemo_wipe1]
+ - [0x6A8180, c, code/m_fbdemo_fade]
- [0x6A83A0, asm, code/m_field_assessment]
- [0x6A8B70, asm, code/m_field_make]
- [0x6AB8D0, c, code/m_field_info]
@@ -163,6 +163,10 @@
- [0x7284B0, data, code/69E2C0]
- [0x7286C0, .data, code/m_demo]
- [0x728800, data, code/728800]
+ - [0x729310, .data, code/m_fbdemo]
+ - [0x729340, data, code/729340]
+ - [0x729DD0, .data, code/m_fbdemo_fade]
+ - [0x729E40, data, code/729E40]
- [0x72AAC0, .data, code/m_game_dlftbls]
- [0x72ACB0, data, code/72ACB0]
- [0x72B400, .data, code/m_kankyo]
@@ -224,8 +228,8 @@
- [0x73A6A0, .rodata, code/m_demo]
- [0x73A730, rodata, code/73A730]
- [0x73A9B0, rodata, code/73A9B0]
- - [0x73A9C0, rodata, code/73A9C0]
- - [0x73A9D0, rodata, code/73A9D0]
+ - [0x73A9C0, .rodata, code/m_fbdemo_triforce]
+ - [0x73A9D0, .rodata, code/m_fbdemo_wipe1]
- [0x73A9E0, rodata, code/73A9E0]
- [0x73AA10, rodata, code/73AA10]
- [0x73AAE0, .rodata, code/m_field_info]