summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrakxo <87568477+Prakxo@users.noreply.github.com>2023-12-08 19:57:31 +0100
committerGitHub <noreply@github.com>2023-12-08 11:57:31 -0700
commit268c1f8c95fe092125fce01a339d5aae4776f1c0 (patch)
tree5e74ae9d6f932f7012f917d663bfbcb43f8fe18c
parente36e3d9d945570adc94cb3ca0200772687b14801 (diff)
train_window OK (#123)
* train_window OK * review
-rw-r--r--include/evw_anime.h10
-rw-r--r--include/m_common_data.h4
-rw-r--r--include/m_kankyo.h4
-rw-r--r--include/m_rcp.h4
-rw-r--r--linker_scripts/jp/symbol_addrs_code.txt2
-rw-r--r--linker_scripts/jp/symbol_addrs_overlays.txt12
-rw-r--r--linker_scripts/jp/undefined_syms.ld6
-rw-r--r--src/code/m_scene.c2
-rw-r--r--src/overlays/actors/ovl_Lamp_Light/ef_lamp_light.c2
-rw-r--r--src/overlays/actors/ovl_Train_Window/ac_train_window.c298
-rw-r--r--src/overlays/actors/ovl_Train_Window/ac_train_window.h26
-rw-r--r--src/overlays/gamestates/ovl_play/m_play.c8
12 files changed, 331 insertions, 47 deletions
diff --git a/include/evw_anime.h b/include/evw_anime.h
index fec4e25..14a2273 100644
--- a/include/evw_anime.h
+++ b/include/evw_anime.h
@@ -3,6 +3,14 @@
#include "ultra64.h"
+struct Game;
+
+typedef struct EvwAnimeUnk {
+ s8 unk_0;
+ s16 unk1;
+ void* unk_4;
+} EvwAnimeUnk;
+
// void func_800549C0_jp();
// void func_80054A28_jp();
// void func_80054A94_jp();
@@ -15,6 +23,6 @@
// void func_80055214_jp();
// void func_80055248_jp();
// void func_800554D8_jp();
-// void Evw_Anime_Set();
+void Evw_Anime_Set(struct Game*,EvwAnimeUnk*);
#endif
diff --git a/include/m_common_data.h b/include/m_common_data.h
index 6ccff3d..b592f64 100644
--- a/include/m_common_data.h
+++ b/include/m_common_data.h
@@ -156,7 +156,7 @@ typedef struct CommonData_unk_100E4 {
typedef struct CommonData {
/* 0x00000 */ u8 unk_00000[0x14];
- /* 0x00014 */ s32 unk_00014;
+ /* 0x00014 */ s32 sceneNo;
/* 0x00018 */ u8 nowNpcMax;
/* 0x00019 */ u8 removeAnimalIdx;
/* 0x0001A */ u8 unk_1A[0x20 - 0x1A];
@@ -229,7 +229,7 @@ typedef struct CommonData {
/* 0x104AA */ u16 lastFieldId;
/* 0x104AC */ UNK_TYPE1 unk_104AC[0x1];
/* 0x104AD */ u8 unk_104AD;
- /* 0x104AE */ u8 unk_104AE;
+ /* 0x104AE */ u8 sunlightFlag;
/* 0x104AF */ UNK_TYPE1 unk_104AF[0x1];
/* 0x104B0 */ UNK_TYPE1 unk_104B0[0xE8];
/* 0x10598 */ mQst_not_saved_c quest;
diff --git a/include/m_kankyo.h b/include/m_kankyo.h
index a10a24e..5447f4f 100644
--- a/include/m_kankyo.h
+++ b/include/m_kankyo.h
@@ -18,7 +18,9 @@ typedef struct Kankyo {
/* 0x05 */ UNK_TYPE1 unk_05[0x3];
/* 0x08 */ UNK_TYPE1 unk_08[0x14];
/* 0x1C */ struct Lights* unk_1C;
- /* 0x2C */ UNK_TYPE1 unk_20[0x8E];
+ /* 0x2C */ UNK_TYPE1 unk_20[0x72];
+ /* 0x92 */ u8 sunColor[3];
+ /* 0x95 */ UNK_TYPE1 unk_95[0x19];
/* 0xAE */ u8 unk_AE;
/* 0xAF */ u8 unk_AF;
/* 0xB0 */ u8 unk_B0;
diff --git a/include/m_rcp.h b/include/m_rcp.h
index 464c5f6..6d6c641 100644
--- a/include/m_rcp.h
+++ b/include/m_rcp.h
@@ -33,8 +33,8 @@ Gfx* func_800BD7C0_jp(Gfx* gfx);
// void func_800BD8A8_jp();
// void func_800BD9D8_jp();
// void func_800BD9FC_jp();
-// void func_800BDA20_jp();
-// void two_tex_scroll();
+Gfx* tex_scroll2(struct GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height);
+extern Gfx* two_tex_scroll(struct GraphicsContext* gfxCtx, s32 tile1, s32 x1, s32 y1, s32 width1, s32 height1, s32 tile2, s32 x2, s32 y2, s32 width2, s32 height2);
void DisplayList_initialize(struct GraphicsContext* gfxCtx, u8 arg1, u8 arg2, u8 arg3, struct Game_Play* game_play);
void fade_rgba8888_draw(Gfx** gfx, s32 arg1);
// void func_800BE030_jp();
diff --git a/linker_scripts/jp/symbol_addrs_code.txt b/linker_scripts/jp/symbol_addrs_code.txt
index b906f64..ea74999 100644
--- a/linker_scripts/jp/symbol_addrs_code.txt
+++ b/linker_scripts/jp/symbol_addrs_code.txt
@@ -2899,7 +2899,7 @@ func_800BD804_jp = 0x800BD804; // type:func
func_800BD8A8_jp = 0x800BD8A8; // type:func
func_800BD9D8_jp = 0x800BD9D8; // type:func
func_800BD9FC_jp = 0x800BD9FC; // type:func
-func_800BDA20_jp = 0x800BDA20; // type:func
+tex_scroll2 = 0x800BDA20; // type:func
two_tex_scroll = 0x800BDAA8; // type:func
DisplayList_initialize = 0x800BDBB4; // type:func
fade_rgba8888_draw = 0x800BDF90; // type:func
diff --git a/linker_scripts/jp/symbol_addrs_overlays.txt b/linker_scripts/jp/symbol_addrs_overlays.txt
index a173f12..d16175d 100644
--- a/linker_scripts/jp/symbol_addrs_overlays.txt
+++ b/linker_scripts/jp/symbol_addrs_overlays.txt
@@ -17808,17 +17808,11 @@ Train_Window_Actor_draw = 0x80A5A198; // type:func
// .data
D_80A5A580_jp = 0x80A5A580; //
-D_80A5A588_jp = 0x80A5A588; //
+aTrainWindow_tree_pal_table = 0x80A5A588; //
D_80A5A768_jp = 0x80A5A768; //
-D_80A5A76C_jp = 0x80A5A76C; //
+aTrainWindow_evw_anime_data = 0x80A5A76C; //
Train_Window_Profile = 0x80A5A774; //
-D_80A5A798_jp = 0x80A5A798; // type:u8
-D_80A5A799_jp = 0x80A5A799; // type:u8
-D_80A5A79A_jp = 0x80A5A79A; // type:u8
-D_80A5A79B_jp = 0x80A5A79B; // type:u8
-D_80A5A79C_jp = 0x80A5A79C; // type:u8
-D_80A5A79D_jp = 0x80A5A79D; // type:u8
-D_80A5A79E_jp = 0x80A5A79E; // type:u8
+till_data = 0x80A5A798; // type:u8
// .rodata
diff --git a/linker_scripts/jp/undefined_syms.ld b/linker_scripts/jp/undefined_syms.ld
index e862fd5..e120cda 100644
--- a/linker_scripts/jp/undefined_syms.ld
+++ b/linker_scripts/jp/undefined_syms.ld
@@ -3763,9 +3763,9 @@ D_6000D28 = 0x06000D28;
// ovl_Train_Window
-D_6000300 = 0x06000300;
-D_6000398 = 0x06000398;
-D_6000508 = 0x06000508;
+rom_train_out_bgcloud_modelT = 0x06000300;
+rom_train_out_shineglass_modelT = 0x06000398;
+rom_train_out_bgsky_model = 0x06000508;
// ovl__00922380
diff --git a/src/code/m_scene.c b/src/code/m_scene.c
index 21b2f5c..2616ef9 100644
--- a/src/code/m_scene.c
+++ b/src/code/m_scene.c
@@ -362,5 +362,5 @@ void return_emu_game(Game* game) {
common_data.unk_10754 = common_data.unk_107A0 + 1;
game->unk_74 = 0;
game_goto_next_game_play(game);
- common_data.unk_00014 = common_data.unk_107A0;
+ common_data.sceneNo = common_data.unk_107A0;
}
diff --git a/src/overlays/actors/ovl_Lamp_Light/ef_lamp_light.c b/src/overlays/actors/ovl_Lamp_Light/ef_lamp_light.c
index 8f9da28..67c7c4e 100644
--- a/src/overlays/actors/ovl_Lamp_Light/ef_lamp_light.c
+++ b/src/overlays/actors/ovl_Lamp_Light/ef_lamp_light.c
@@ -76,7 +76,7 @@ s32 eLL_get_light_sw_start_demo(void) {
s32 var_v1;
var_v1 = 1;
- if (common_data.unk_104AE == 1) {
+ if (common_data.sunlightFlag == 1) {
var_v1 = 0;
}
return var_v1;
diff --git a/src/overlays/actors/ovl_Train_Window/ac_train_window.c b/src/overlays/actors/ovl_Train_Window/ac_train_window.c
index a869ac0..299198f 100644
--- a/src/overlays/actors/ovl_Train_Window/ac_train_window.c
+++ b/src/overlays/actors/ovl_Train_Window/ac_train_window.c
@@ -1,12 +1,14 @@
#include "ac_train_window.h"
#include "m_actor_dlftbls.h"
#include "m_object.h"
+#include "evw_anime.h"
+#include "m_rcp.h"
#include "overlays/gamestates/ovl_play/m_play.h"
void Train_Window_Actor_ct(Actor* thisx, Game_Play* game_play);
void Train_Window_Actor_dt(Actor* thisx, Game_Play* game_play);
void Train_Window_Actor_move(Actor* thisx, Game_Play* game_play);
-void Train_Window_Actor_draw(Actor* thisx, Game_Play* game_play);
+void Train_Window_Actor_draw(Actor* thisx, Game_Play* play);
#if 0
ActorProfile Train_Window_Profile = {
@@ -24,32 +26,296 @@ ActorProfile Train_Window_Profile = {
};
#endif
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59360_jp.s")
+// TODO: Import data
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/Train_Window_Actor_ct.s")
+extern Gfx rom_train_out_bgsky_model[];
+extern Gfx rom_train_out_bgcloud_modelT[];
+extern Gfx rom_train_out_shineglass_modelT[];
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/Train_Window_Actor_dt.s")
+extern u8 till_data[15][2];
+extern u16 aTrainWindow_tree_pal_table[15][16];
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A5961C_jp.s")
+extern EvwAnimeUnk aTrainWindow_evw_anime_data;
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/Train_Window_Actor_move.s")
+s32 aTrainWindow_NoDraw(Actor* thisx, Game* game);
+s32 aTrainWindow_DrawGoneOutTunnel(Actor* thisx, Game* game);
+s32 aTrainWindow_DrawInTunnel(Actor* thisx, Game* game);
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A599DC_jp.s")
+s32 aTrainWindow_GetTreePalletIdx(void) {
+ s32 i;
+ lbRTC_month_t month = common_data.time.rtcTime.month;
+ lbRTC_day_t day = common_data.time.rtcTime.day;
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59A2C_jp.s")
+ for (i = 0; i < 15; i++) {
+ if (month < till_data[i][0]) {
+ return i;
+ }
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59AB0_jp.s")
+ if (month == till_data[i][0] && day <= till_data[i][1]) {
+ return i;
+ }
+ }
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59BA0_jp.s")
+ return 0;
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59CF0_jp.s")
+void Train_Window_Actor_ct(Actor* thisx, UNUSED Game_Play* play) {
+ Train_Window* this = (Train_Window*)thisx;
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59E88_jp.s")
+ if (common_data.sceneNo == 15) {
+ this->drawType = aTrainWindow_NoDraw;
+ this->singleScrollX = 0;
+ this->singleScrollY = 0;
+ this->twoScrollX1 = 0;
+ this->twoScrollY1 = 0;
+ this->twoScrollX2 = 0;
+ this->twoScrollY2 = 0;
+ this->scrollSpeed = 0.07f;
+ } else {
+ this->drawType = aTrainWindow_DrawGoneOutTunnel;
+ this->singleScrollX = 1000;
+ this->singleScrollY = 0;
+ this->twoScrollX1 = 1000;
+ this->twoScrollY1 = 0;
+ this->twoScrollX2 = 0;
+ this->twoScrollY2 = 0;
+ this->scrollSpeed = 1.0f;
+ }
+ this->paletteId = aTrainWindow_GetTreePalletIdx();
+ this->currentPalette = aTrainWindow_tree_pal_table[this->paletteId];
+ this->treeScrollX = 500;
+ this->treeScrollY = 0;
+ this->pos.x = 0;
+ this->pos.y = 0;
+ this->pos.z = 0;
+ this->xluAlpha = 254.0f;
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A59EA4_jp.s")
+void Train_Window_Actor_dt(UNUSED Actor* thisx, UNUSED Game_Play* play) {
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A5A034_jp.s")
+u8 aTW_GetNowAlpha(void) {
+ if ((common_data.time.nowSec >= 14400) && (common_data.time.nowSec < 72000)) {
+ if (common_data.time.nowSec < 43200) {
+ UNUSED f32 scopedTemp;
+ return ((void)0, 255.0f) * ((f32)(common_data.time.nowSec - 14400) / 28800.0f);
+ } else {
+ return 255.0f * (1.0f - ((f32)(common_data.time.nowSec - 43200) / 28800.0f));
+ }
+ } else if (common_data.time.nowSec < 14400) {
+ UNUSED f32 scopedTemp;
+ return (1.0f - (0.5f + ((f32)common_data.time.nowSec / 28800.0f))) * 200.0f;
+ } else {
+ return ((f32)(common_data.time.nowSec - 72000) / 28800.0f) * ((void)0, 200.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/func_80A5A120_jp.s")
+void Train_Window_Actor_move(Actor* thisx, UNUSED Game_Play* play) {
+ Train_Window* this = (Train_Window*)thisx;
+ add_calc(&this->xluAlpha, aTW_GetNowAlpha(), this->scrollSpeed, 50.0f, 1.0f);
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Train_Window/ac_train_window/Train_Window_Actor_draw.s")
+s32 aTrainWindow_OperateScrollLimit(s32 a, s32 b, s32 c) {
+ if (b != 0) {
+ if (b > 0) {
+ a += b;
+ if (a > c) {
+ a = c;
+ }
+ } else if (b < 0) {
+ a += b;
+ if (a < c) {
+ a = c;
+ }
+ }
+ }
+ return a;
+}
+
+Gfx* aTrainWindow_TileScroll(u32* x, u32* y, s32 xamt, s32 yamt, s32 xend, s32 yend, s32 width, s32 height,
+ GraphicsContext** graph) {
+ *x = aTrainWindow_OperateScrollLimit(*x, xamt, xend);
+ *y = aTrainWindow_OperateScrollLimit(*y, yamt, yend);
+
+ return tex_scroll2(*graph, *x, *y, width, height);
+}
+
+Gfx* aTrainWindow_TileScroll2(u32* x1, u32* y1, s32 x1amt, s32 y1amt, s32 x1end, s32 y1end, s32 width1, s32 height1,
+ u32* x2, u32* y2, s32 x2amt, s32 y2amt, s32 x2end, s32 y2end, s32 width2, s32 height2,
+ GraphicsContext** graph) {
+ *x1 = aTrainWindow_OperateScrollLimit(*x1, x1amt, x1end);
+ *y1 = aTrainWindow_OperateScrollLimit(*y1, y1amt, y1end);
+ *x2 = aTrainWindow_OperateScrollLimit(*x2, x2amt, x2end);
+ *y2 = aTrainWindow_OperateScrollLimit(*y2, y2amt, y2end);
+
+ return two_tex_scroll(*graph, 0, *x1, *y1, width1, height1, 1, *x2, *y2, width2, height2);
+}
+s32 aTrainWindow_DrawGoneOutTunnel(Actor* thisx, Game* game) {
+ Train_Window* this = (Train_Window*)thisx;
+ Gfx* ssc;
+ Gfx* tsc;
+ GraphicsContext** graph = &game->gfxCtx;
+
+ ssc = aTrainWindow_TileScroll(&this->singleScrollX, &this->singleScrollY, 0, 0, 1000, 0, 64, 32, graph);
+ tsc = aTrainWindow_TileScroll2(&this->twoScrollX1, &this->twoScrollY1, 0, 0, 1000, 0, 64, 8, &this->twoScrollX2,
+ &this->twoScrollY2, 0, 0, 0, 0, 16, 16, graph);
+
+ if ((ssc == NULL) || (tsc == NULL)) {
+ return 0;
+ } else {
+ OPEN_DISPS(*graph);
+ if (!this->paletteId) {}
+ gSPSegment(POLY_OPA_DISP++, 11, ssc);
+ gSPSegment(POLY_XLU_DISP++, 11, ssc);
+
+ gSPSegment(POLY_OPA_DISP++, 12, tsc);
+ gSPSegment(POLY_XLU_DISP++, 12, tsc);
+
+ CLOSE_DISPS(*graph);
+
+ return 1;
+ }
+}
+
+s32 aTrainWindow_DrawGoingOutTunnel(Actor* thisx, Game* game) {
+ Train_Window* this = (Train_Window*)thisx;
+ Gfx* ssc;
+ Gfx* tsc;
+
+ GraphicsContext** graph = &game->gfxCtx;
+
+ ssc = aTrainWindow_TileScroll(&this->singleScrollX, &this->singleScrollY, 30, 0, 1000, 0, 64, 32, graph);
+ tsc = aTrainWindow_TileScroll2(&this->twoScrollX1, &this->twoScrollY1, 30, 0, 1000, 0, 64, 8, &this->twoScrollX2,
+ &this->twoScrollY2, 0, 0, 0, 0, 16, 16, graph);
+
+ if ((ssc == NULL) || (tsc == NULL)) {
+ return 0;
+ } else {
+ OPEN_DISPS(*graph);
+ if (!this->paletteId) {}
+ gSPSegment(POLY_OPA_DISP++, 11, ssc);
+ gSPSegment(POLY_XLU_DISP++, 11, ssc);
+ gSPSegment(POLY_OPA_DISP++, 12, tsc);
+ if (1) {
+ gSPSegment(POLY_XLU_DISP++, 12, tsc);
+
+ CLOSE_DISPS(*graph);
+
+ if (((s32)this->singleScrollX == 1000) && ((s32)this->twoScrollX1 == 1000)) {
+ this->drawType = aTrainWindow_DrawGoneOutTunnel;
+ this->paletteId = aTrainWindow_GetTreePalletIdx();
+ this->currentPalette = aTrainWindow_tree_pal_table[this->paletteId];
+ }
+
+ return 1;
+ }
+ }
+}
+
+s32 aTrainWindow_NoDraw(Actor* thisx, UNUSED Game* game) {
+ Train_Window* this = (Train_Window*)thisx;
+
+ this->drawType = aTrainWindow_DrawInTunnel;
+ return 0;
+}
+
+s32 aTrainWindow_DrawInTunnel(Actor* thisx, Game* game) {
+ Train_Window* this = (Train_Window*)thisx;
+ Gfx* ssc;
+ Gfx* tsc;
+
+ ssc = aTrainWindow_TileScroll(&this->singleScrollX, &this->singleScrollY, 0, 0, 1000, 0, 64, 32, &game->gfxCtx);
+ tsc = aTrainWindow_TileScroll2(&this->twoScrollX1, &this->twoScrollY1, 0, 0, 1000, 0, 64, 8, &this->twoScrollX2,
+ &this->twoScrollY2, 0, 0, 0, 0, 16, 16, &game->gfxCtx);
+
+ if ((ssc == NULL) || (tsc == NULL)) {
+ return 0;
+ } else {
+ OPEN_DISPS(game->gfxCtx);
+ if (!this->paletteId) {}
+ gSPSegment(POLY_OPA_DISP++, 11, ssc);
+ gSPSegment(POLY_XLU_DISP++, 11, ssc);
+
+ gSPSegment(POLY_OPA_DISP++, 12, tsc);
+ gSPSegment(POLY_XLU_DISP++, 12, tsc);
+
+ CLOSE_DISPS(game->gfxCtx);
+
+ if (common_data.sunlightFlag != 0) {
+ this->paletteId = aTrainWindow_GetTreePalletIdx();
+ this->currentPalette = aTrainWindow_tree_pal_table[this->paletteId];
+ this->drawType = aTrainWindow_DrawGoingOutTunnel;
+ }
+ return 1;
+ }
+}
+
+void aTrainWindow_SetLightPrimColorDetail(Game* game, u8 l, u8 polyAlpha, u8 xluAlpha) {
+ Game_Play* play = (Game_Play*)game;
+ u8 color[3];
+ s32 i;
+ s32 current;
+
+ for (i = 0; i < 3; i++) {
+ current = play->glight.ambientColor[i] + play->kankyo.sunColor[i];
+ if (current < 0) {
+ current = 0;
+ } else if (current >= 256) {
+ current = 255;
+ }
+ color[i] = current;
+ }
+
+ OPEN_DISPS(game->gfxCtx);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, l, color[0], color[1], color[2], polyAlpha);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, l, color[0], color[1], color[2], xluAlpha);
+ CLOSE_DISPS(game->gfxCtx);
+}
+
+void aTrainWindow_SetTreeTextureScroll(Actor* thisx, Game* game) {
+ Train_Window* this = (Train_Window*)thisx;
+ Gfx* tree;
+ GraphicsContext** graphp = &game->gfxCtx;
+
+ this->treeScrollX += 10;
+
+ tree = tex_scroll2(*graphp, this->treeScrollX, this->treeScrollY, 128, 32);
+
+ OPEN_DISPS(*graphp);
+
+ gSPSegment(POLY_XLU_DISP++, 8, tree);
+
+ CLOSE_DISPS(*graphp);
+}
+
+void Train_Window_Actor_draw(Actor* thisx, Game_Play* play) {
+ Train_Window* this = (Train_Window*)thisx;
+ UNUSED s32 pad;
+
+ if (1) {}
+ OPEN_DISPS(play->state.gfxCtx);
+ Matrix_translate(0.0f, 0.0f, 0.0f, FALSE);
+ Matrix_scale(0.05f, 0.05f, 0.05f, TRUE);
+
+ gSPMatrix(POLY_OPA_DISP++, _Matrix_to_Mtx_new(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, _Matrix_to_Mtx_new(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ if (this->drawType(thisx, &play->state) != 0) {
+ _texture_z_light_fog_prim(play->state.gfxCtx);
+ _texture_z_light_fog_prim_xlu(play->state.gfxCtx);
+ if (1) {}
+ aTrainWindow_SetLightPrimColorDetail(&play->state, 127, 255, this->xluAlpha);
+ gSPSegment(POLY_XLU_DISP++, 10, this->currentPalette);
+ if (1) {}
+ Evw_Anime_Set(&play->state, &aTrainWindow_evw_anime_data);
+
+ aTrainWindow_SetLightPrimColorDetail(&play->state, 255, 255, this->xluAlpha);
+ gSPDisplayList(POLY_OPA_DISP++, rom_train_out_bgsky_model);
+ aTrainWindow_SetLightPrimColorDetail(&play->state, this->xluAlpha, 255, this->xluAlpha);
+ gSPDisplayList(POLY_XLU_DISP++, rom_train_out_bgcloud_modelT);
+ aTrainWindow_SetTreeTextureScroll(thisx, &play->state);
+ aTrainWindow_SetLightPrimColorDetail(&play->state, 127, 255, this->xluAlpha);
+ gSPDisplayList(POLY_XLU_DISP++, rom_train_out_shineglass_modelT);
+ }
+ CLOSE_DISPS(play->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Train_Window/ac_train_window.h b/src/overlays/actors/ovl_Train_Window/ac_train_window.h
index 5a56e05..77af624 100644
--- a/src/overlays/actors/ovl_Train_Window/ac_train_window.h
+++ b/src/overlays/actors/ovl_Train_Window/ac_train_window.h
@@ -5,14 +5,28 @@
#include "m_actor.h"
#include "unk.h"
-struct Game_Play;
-struct Train_Window;
+struct Game;
-typedef void (*Train_WindowActionFunc)(struct Train_Window*, struct Game_Play*);
+typedef s32 (*TrainWindowType)(Actor*, struct Game*);
-typedef struct Train_Window {
+typedef struct Train_Window{
/* 0x000 */ Actor actor;
- /* 0x174 */ UNK_TYPE1 unk_174[0x40];
-} Train_Window; // size = 0x1B4
+ /* 0x174 */ TrainWindowType drawType;
+ /* 0x178 */ s16 paletteId;
+ /* 0x17C */ UNK_TYPE unk17C;
+ /* 0x180 */ u16* currentPalette;
+ /* 0x184 */ u32 singleScrollX;
+ /* 0x188 */ u32 singleScrollY;
+ /* 0x18C */ u32 twoScrollX1;
+ /* 0x190 */ u32 twoScrollY1;
+ /* 0x194 */ u32 twoScrollX2;
+ /* 0x198 */ u32 twoScrollY2;
+ /* 0x19C */ s32 treeScrollX;
+ /* 0x1A0 */ s32 treeScrollY;
+ /* 0x1A4 */ f32 xluAlpha;
+ /* 0x1A8 */ f32 scrollSpeed;
+ /* 0x1AC */ s_xyz pos;
+ /* 0x1B0 */ UNK_TYPE unk_1B0;
+}Train_Window; // size = 0x1B4
#endif
diff --git a/src/overlays/gamestates/ovl_play/m_play.c b/src/overlays/gamestates/ovl_play/m_play.c
index 2c56cdf..8e953b5 100644
--- a/src/overlays/gamestates/ovl_play/m_play.c
+++ b/src/overlays/gamestates/ovl_play/m_play.c
@@ -211,8 +211,8 @@ void Game_play_fbdemo_fade_out_game_end_move_end(Game_Play* game_play) {
void Game_play_change_scene_move_end(Game_Play* game_play) {
game_goto_next_game_play(&game_play->state);
- common_data.unk_10004 = common_data.unk_00014;
- common_data.unk_00014 = game_play->unk_1E18;
+ common_data.unk_10004 = common_data.sceneNo;
+ common_data.sceneNo = game_play->unk_1E18;
}
void Game_play_fbdemo_wipe_move(Game_Play* game_play) {
@@ -395,7 +395,7 @@ void play_init(Game* game) {
func_8006BB64_jp();
func_8006C8D0_jp();
game_play->unk_1DAC = -1;
- Gameplay_Scene_Read(game_play, common_data.unk_00014);
+ Gameplay_Scene_Read(game_play, common_data.sceneNo);
mSM_submenu_ct(&game_play->submenu);
game_play->submenu.unk_00 = 0;
PreRender_init(&game_play->unk_1DC0);
@@ -871,5 +871,5 @@ void Gameplay_Scene_Read(Game_Play* game_play, s16 arg1) {
sp1C->unk_13 = 0;
gSegments[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
Gameplay_Scene_Init(game_play);
- sAdo_RoomType(mPl_SceneNo2SoundRoomType(common_data.unk_00014));
+ sAdo_RoomType(mPl_SceneNo2SoundRoomType(common_data.sceneNo));
}