diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 84d009fd..c5887d59 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -27,6 +27,12 @@ toBeSorted/file_manager.cpp: toBeSorted/save_manager.cpp: .text start:0x80011730 end:0x80015310 +toBeSorted/blur_and_palette_manager.cpp: + .text start:0x800221A0 end:0x800268AC + .ctors start:0x804DB65C end:0x804DB660 + .sdata2 start:0x80576BA0 end:0x80576C18 + .bss start:0x8058F210 end:0x80594FA0 + toBeSorted/sound_info.cpp: .text start:0x8002C250 end:0x8002C308 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index bafbdc61..16fd5b73 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -802,7 +802,7 @@ fn_800223A0__21BlurAndPaletteManagerFPv = .text:0x800223A0; // type:function siz fn_80022440__21BlurAndPaletteManagerFPv = .text:0x80022440; // type:function size:0x34 fn_80022480 = .text:0x80022480; // type:function size:0xCC fn_80022550 = .text:0x80022550; // type:function size:0x74 -Vec3f__copy = .text:0x800225D0; // type:function size:0x1C +__as__7mVec3_cFRC7mVec3_c = .text:0x800225D0; // type:function size:0x1C fn_800225F0 = .text:0x800225F0; // type:function size:0xEC fn_800226E0 = .text:0x800226E0; // type:function size:0x34 fn_80022720 = .text:0x80022720; // type:function size:0xCC @@ -827,19 +827,19 @@ fn_80022F10 = .text:0x80022F10; // type:function size:0x8C fn_80022FA0 = .text:0x80022FA0; // type:function size:0x34 fn_80022FE0 = .text:0x80022FE0; // type:function size:0x8 fn_80022FF0 = .text:0x80022FF0; // type:function size:0x8 -PalatteSPF_CombineColors = .text:0x80023000; // type:function size:0x144 -Color__ctor_white = .text:0x80023150; // type:function size:0xC +combineColors__21BlurAndPaletteManagerFRC6mColorRC6mColorf = .text:0x80023000; // type:function size:0x144 +__ct__6mColorFv = .text:0x80023150; // type:function size:0xC fn_80023160 = .text:0x80023160; // type:function size:0x4C fn_800231B0 = .text:0x800231B0; // type:function size:0x10 fn_800231C0 = .text:0x800231C0; // type:function size:0x5C fn_80023220 = .text:0x80023220; // type:function size:0x60 fn_80023280 = .text:0x80023280; // type:function size:0xD24 -Color__copy = .text:0x80023FB0; // type:function size:0x24 -Color__copy2 = .text:0x80023FE0; // type:function size:0x24 -fn_80024010 = .text:0x80024010; // type:function size:0x114 -fn_80024130 = .text:0x80024130; // type:function size:0xC -fn_80024140 = .text:0x80024140; // type:function size:0x40 -fn_80024180 = .text:0x80024180; // type:function size:0xBC +__as__6mColorFRC6mColor = .text:0x80023FB0; // type:function size:0x24 +__as__14UnalignedColorFRC6mColor = .text:0x80023FE0; // type:function size:0x24 +__ct__3SpfFv = .text:0x80024010; // type:function size:0x114 +__ct__6SffSubFv = .text:0x80024130; // type:function size:0xC +__dt__6SffSubFv = .text:0x80024140; // type:function size:0x40 +__dt__3SpfFv = .text:0x80024180; // type:function size:0xBC fn_80024240 = .text:0x80024240; // type:function size:0xF8 fn_80024340 = .text:0x80024340; // type:function size:0x10 BlurAndPaletteMgr__setMist = .text:0x80024350; // type:function size:0x18 @@ -847,40 +847,40 @@ fn_80024370 = .text:0x80024370; // type:function size:0x58 BlurAndPaletteMgr__setDof = .text:0x800243D0; // type:function size:0x10 BlurAndPaletteMgr__disableDofOverride = .text:0x800243E0; // type:function size:0xC fn_800243F0 = .text:0x800243F0; // type:function size:0x178 -Color__ctor = .text:0x80024570; // type:function size:0x14 +__ct__6mColorFiiii = .text:0x80024570; // type:function size:0x14 fn_80024590 = .text:0x80024590; // type:function size:0xE4 -fn_80024680 = .text:0x80024680; // type:function size:0x48 -fn_800246D0 = .text:0x800246D0; // type:function size:0x64 +__ct__3SffFv = .text:0x80024680; // type:function size:0x48 +__dt__3SffFv = .text:0x800246D0; // type:function size:0x64 fn_80024740 = .text:0x80024740; // type:function size:0x24 fn_80024770 = .text:0x80024770; // type:function size:0x24 fn_800247A0 = .text:0x800247A0; // type:function size:0x30 fn_800247D0__21BlurAndPaletteManagerF7mVec3_cf = .text:0x800247D0; // type:function size:0x20 -createBlurAndPaletteMgr = .text:0x800247F0; // type:function size:0xBB0 -Vec3f__ctor = .text:0x800253A0; // type:function size:0x10 -fn_800253B0 = .text:0x800253B0; // type:function size:0xC -fn_800253C0 = .text:0x800253C0; // type:function size:0x4 -fn_800253D0 = .text:0x800253D0; // type:function size:0x4 -fn_800253E0 = .text:0x800253E0; // type:function size:0x40 -fn_80025420 = .text:0x80025420; // type:function size:0x4 -fn_80025430 = .text:0x80025430; // type:function size:0x40 -fn_80025470 = .text:0x80025470; // type:function size:0x4 -fn_80025480 = .text:0x80025480; // type:function size:0x40 -fn_800254C0 = .text:0x800254C0; // type:function size:0x48 -fn_80025510 = .text:0x80025510; // type:function size:0x48 -fn_80025560 = .text:0x80025560; // type:function size:0x18 -fn_80025580 = .text:0x80025580; // type:function size:0x40 -fn_800255C0 = .text:0x800255C0; // type:function size:0x64 -fn_80025630 = .text:0x80025630; // type:function size:0x48 -fn_80025680 = .text:0x80025680; // type:function size:0x48 -fn_800256D0 = .text:0x800256D0; // type:function size:0x18 -fn_800256F0 = .text:0x800256F0; // type:function size:0x40 -fn_80025730 = .text:0x80025730; // type:function size:0x64 -fn_800257A0 = .text:0x800257A0; // type:function size:0x28 -fn_800257D0 = .text:0x800257D0; // type:function size:0x48 -PaletteSPF__initMaybe = .text:0x80025820; // type:function size:0x8C4 -PaletteSFF__initMaybe = .text:0x800260F0; // type:function size:0xB4 -PaletteDefaultMCF__copy = .text:0x800261B0; // type:function size:0x154 -fn_80026310 = .text:0x80026310; // type:function size:0x1EC +__ct__21BlurAndPaletteManagerFv = .text:0x800247F0; // type:function size:0xBB0 +__ct__7mVec3_cFfff = .text:0x800253A0; // type:function size:0x10 +__ct__4Bpm1Fv = .text:0x800253B0; // type:function size:0xC +__ct__4Bpm2Fv = .text:0x800253C0; // type:function size:0x4 +__ct__4Bpm7Fv = .text:0x800253D0; // type:function size:0x4 +__dt__4Bpm7Fv = .text:0x800253E0; // type:function size:0x40 +__ct__4Bpm8Fv = .text:0x80025420; // type:function size:0x4 +__dt__4Bpm8Fv = .text:0x80025430; // type:function size:0x40 +__ct__4Bpm9Fv = .text:0x80025470; // type:function size:0x4 +__dt__4Bpm9Fv = .text:0x80025480; // type:function size:0x40 +__ct__4Bpm3Fv = .text:0x800254C0; // type:function size:0x48 +__ct__15PaletteEAF_smolFv = .text:0x80025510; // type:function size:0x48 +__ct__21PaletteEAF_smol_entryFv = .text:0x80025560; // type:function size:0x18 +__dt__21PaletteEAF_smol_entryFv = .text:0x80025580; // type:function size:0x40 +__dt__15PaletteEAF_smolFv = .text:0x800255C0; // type:function size:0x64 +__ct__4Bpm4Fv = .text:0x80025630; // type:function size:0x48 +__ct__14PaletteEAF_bigFv = .text:0x80025680; // type:function size:0x48 +__ct__20PaletteEAF_big_entryFv = .text:0x800256D0; // type:function size:0x18 +__dt__20PaletteEAF_big_entryFv = .text:0x800256F0; // type:function size:0x40 +__dt__14PaletteEAF_bigFv = .text:0x80025730; // type:function size:0x64 +__ct__17PaletteDefaultMCFFv = .text:0x800257A0; // type:function size:0x28 +__ct__20TwoPaletteDefaultMCFFv = .text:0x800257D0; // type:function size:0x48 +__as__3SpfFRC3Spf = .text:0x80025820; // type:function size:0x8C4 +__as__3SffFRC3Sff = .text:0x800260F0; // type:function size:0xB4 +__as__17PaletteDefaultMCFFRC17PaletteDefaultMCF = .text:0x800261B0; // type:function size:0x154 +__dt__21BlurAndPaletteManagerFv = .text:0x80026310; // type:function size:0x1EC fn_80026500 = .text:0x80026500; // type:function size:0x38 fn_80026540 = .text:0x80026540; // type:function size:0x40 fn_80026580 = .text:0x80026580; // type:function size:0x188 @@ -888,7 +888,7 @@ fn_80026710 = .text:0x80026710; // type:function size:0x4C fn_80026760 = .text:0x80026760; // type:function size:0x4C fn_800267B0 = .text:0x800267B0; // type:function size:0x4C fn_80026800 = .text:0x80026800; // type:function size:0x4C -BlurAndPaletteMgr__sinit = .text:0x80026850; // type:function size:0x5C +__sinit_\blur_and_palette_manager_cpp = .text:0x80026850; // type:function size:0x5C scope:local fn_800268B0 = .text:0x800268B0; // type:function size:0xB4 fn_80026970 = .text:0x80026970; // type:function size:0x88 fn_80026A00 = .text:0x80026A00; // type:function size:0xB4 @@ -29894,7 +29894,7 @@ lbl_80500CD8 = .data:0x80500CD8; // type:object size:0x70 lbl_80500D48 = .data:0x80500D48; // type:object size:0x78 lbl_80500DC0 = .data:0x80500DC0; // type:object size:0x70 lbl_80500E30 = .data:0x80500E30; // type:object size:0x50 -lbl_80500E80 = .data:0x80500E80; // type:object size:0xC +__vt__21BlurAndPaletteManager = .data:0x80500E80; // type:object size:0xC lbl_80500E8C = .data:0x80500E8C; // type:object size:0xC lbl_80500E98 = .data:0x80500E98; // type:object size:0x10 data:string lbl_80500EA8 = .data:0x80500EA8; // type:object size:0x444 @@ -39885,7 +39885,7 @@ lbl_80575054 = .sbss:0x80575054; // type:object size:0x1 data:byte lbl_80575058 = .sbss:0x80575058; // type:object size:0x8 data:byte lbl_80575060 = .sbss:0x80575060; // type:object size:0x1 data:byte lbl_80575064 = .sbss:0x80575064; // type:object size:0x4 data:4byte -ENVIRONMENT = .sbss:0x80575068; // type:object size:0x8 data:4byte +sPInstance__21BlurAndPaletteManager = .sbss:0x80575068; // type:object size:0x8 data:4byte lbl_80575070 = .sbss:0x80575070; // type:object size:0x4 data:4byte CURRENT_EFFECT_MANAGER_INIT = .sbss:0x80575074; // type:object size:0x4 data:4byte lbl_80575078 = .sbss:0x80575078; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index ed55ef46..fd28565a 100644 --- a/configure.py +++ b/configure.py @@ -433,6 +433,7 @@ config.libs = [ Object(Matching, "d/lyt/d_lyt_common_arrow.cpp"), Object(NonMatching, "toBeSorted/file_manager.cpp"), Object(NonMatching, "toBeSorted/save_manager.cpp"), + Object(NonMatching, "toBeSorted/blur_and_palette_manager.cpp"), Object(Matching, "DynamicLink.cpp"), ], }, diff --git a/include/toBeSorted/blur_and_palette_manager.h b/include/toBeSorted/blur_and_palette_manager.h index cedc1ee4..1c0d8338 100644 --- a/include/toBeSorted/blur_and_palette_manager.h +++ b/include/toBeSorted/blur_and_palette_manager.h @@ -2,10 +2,224 @@ #define BLUR_AND_PALETTE_MANAGER_H #include "common.h" +#include "m/m_color.h" #include "m/m_vec.h" +#include "toBeSorted/tlist.h" + +struct UnkBlurPaletteListNode { + TListNode mNode; +}; + +struct SffSub { + mColor field_0x00; + f32 field_0x04; + f32 field_0x08; +}; + +struct SpfSub2 { + mColor field_0x00; + u8 field_0x04[5]; +}; + +// This is a weird one - mColor / nw4r::ut::Color are assumed +// to be 4-byte-aligned so that all the u32 type punning works +// correctly, but field_0x1D5 is unaligned and uses a separate +// assignment operator! So we'll go with a separate type for now. +struct UnalignedColor { + UnalignedColor &operator=(const mColor &color) { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + return *this; + } + u8 r, g, b, a; +}; + +struct PaletteDefaultMCF { + /* 0x00 */ mColor MA00_kcolor3; + /* 0x04 */ mColor MA01_tevReg1; + /* 0x08 */ mColor MA01_kColor2; + /* 0x0C */ mColor MA02_tevReg1; + /* 0x10 */ mColor MA02_kcolor2; + /* 0x14 */ mColor MA03_kcolor3; + /* 0x18 */ mColor MA06_kColor3; + /* 0x1C */ mColor field_0x1C; +}; + +struct TwoPaletteDefaultMCF { + /* 0x00 */ PaletteDefaultMCF field_0x00; + /* 0x20 */ PaletteDefaultMCF field_0x20; +}; + +// Ghidra had contents of this in an array but that won't work due to dtor codegen. +// Start is correct (dtor offset), needs to at least include field_0x104 +struct SpfSub { + /* 0x000 */ f32 field_0x000; + /* 0x004 */ mColor grey_787878; + /* 0x008 */ SffSub white3_ffffff; + /* 0x014 */ SpfSub2 field_0x014; + /* 0x020 */ mColor field_0x020[5]; + /* 0x034 */ f32 field_0x034[5]; + /* 0x048 */ f32 field_0x048[5]; + /* 0x05C */ f32 field_0x05C; + /* 0x060 */ SpfSub2 field_0x060; + /* 0x06C */ mColor field_0x06C[5]; + /* 0x080 */ f32 field_0x080[5]; + /* 0x094 */ f32 field_0x094[5]; + /* 0x0A8 */ f32 field_0x0A8; + /* 0x0AC */ SpfSub2 field_0x0AC; + /* 0x0B8 */ mColor field_0x0B8[5]; + /* 0x0CC */ f32 field_0x0CC[5]; + /* 0x0E0 */ f32 field_0x0E0[5]; + /* 0x0F4 */ f32 field_0x0F4; + /* 0x0F8 */ SpfSub2 field_0x0F8; + /* 0x104 */ mColor field_0x104[5]; + /* 0x118 */ f32 field_0x118[5]; + /* 0x12C */ f32 field_0x12C[5]; +}; + +// We assume there's SffSub in here because of weak function order +// The size is correct now, but the default assignment operator doesn't match yet, +// which could have many reasons. Need to tweak the layout. +struct Spf { + Spf(); + ~Spf() {} + + /* 0x000 */ mColor grey_aaaaaa; + /* 0x004 */ mColor white_ffffff; + /* 0x008 */ mColor grey_808080; + /* 0x00C */ mColor cream_ffffc0; + /* 0x010 */ mColor grey2_aaaaaa; + /* 0x014 */ mColor white2_ffffff; + /* 0x018 */ f32 field_0x18; + /* 0x01C */ mColor pastel_orange_ffb787; + /* 0x020 */ f32 field_0x20; + /* 0x024 */ f32 field_0x24; + /* 0x028 */ mColor black_000000; + /* 0x02C */ mColor black2_000000; + /* 0x030 */ SpfSub mSub; + /* 0x170 */ mColor grey_787878; + /* 0x174 */ mColor grey2_787878; + /* 0x178 */ mColor grey3_787878; + /* 0x17C */ mColor mCloudColor; + /* 0x180 */ mColor mSkyColor; + /* 0x184 */ mColor seafoam_green_b9d8b7; + /* 0x188 */ mColor white3_ffffff; + /* 0x18C */ mVec3_c field_0x18C; + /* 0x198 */ mVec3_c field_0x198; + /* 0x1A4 */ SffSub MAO5_kColor3; // assuming SffSub here due to initialization with same values + /* 0x1B0 */ mVec3_c field_0x1B0; + /* 0x1BC */ u8 field_0x1BC; + /* 0x1C0 */ f32 field_0x1C0; + /* 0x1C4 */ f32 field_0x1C4; + /* 0x1C8 */ u8 field_0x1C8; + /* 0x1CC */ f32 field_0x1CC; + /* 0x1D0 */ f32 field_0x1D0; + /* 0x1D4 */ u8 field_0x1D4; + /* 0x1D5 */ UnalignedColor field_0x1D5; // pastel_yelow_#fff0b4 + /* 0x1D9 */ u8 field_0x1D9; + /* 0x1DC */ f32 field_0x1DC; + /* 0x1E0 */ f32 field_0x1E0; + /* 0x1E4 */ f32 field_0x1E4; + /* 0x1E8 */ f32 field_0x1E8; + /* 0x1EC */ u8 field_0x1EC; + /* 0x1ED */ u8 field_0x1ED; + /* 0x1EE */ u16 field_0x1EE; + /* 0x1F0 */ f32 field_0x1F0; + /* 0x1F4 */ f32 field_0x1F4; + /* 0x1F8 */ f32 field_0x1F8; + /* 0x1FC */ f32 field_0x1FC; + /* 0x200 */ mColor black3_000000; + /* 0x204 */ mColor black4_000000; +}; + +struct Sff { + Sff(); + ~Sff() {} + + SffSub field_0x00[3]; +}; + +struct Bpm1 { + Bpm1() {} + ~Bpm1() {} + + u8 field_0x00[0x14 - 0x00]; + mColor field_0x14; +}; + +struct Bpm2 { + Bpm2() {} + ~Bpm2() {} +}; + +struct PaletteEAF_smol_entry { + PaletteEAF_smol_entry() {} + ~PaletteEAF_smol_entry() {} + mColor field_0x00; + mColor field_0x04; + mColor field_0x08; + mColor field_0x0C; +}; + +struct PaletteEAF_smol { + ~PaletteEAF_smol() {} + PaletteEAF_smol_entry field_0x00[8]; +}; + +struct PaletteEAF_big_entry { + PaletteEAF_big_entry() {} + ~PaletteEAF_big_entry() {} + mColor field_0x00; + mColor field_0x04; + mColor field_0x08; + mColor field_0x0C; + u8 field_0x10; +}; + + +struct PaletteEAF_big { + ~PaletteEAF_big() {} + PaletteEAF_big_entry field_0x00[8]; +}; + +struct Bpm3 { + Bpm3() {} + ~Bpm3() {} + + PaletteEAF_smol field_0x00[0x20]; +}; + +struct Bpm4 { + Bpm4() {} + ~Bpm4() {} + + PaletteEAF_big field_0x00[0x20]; +}; + +struct Bpm7 { + Bpm7() {} + ~Bpm7() {} +}; + +struct Bpm8 { + Bpm8() {} + ~Bpm8() {} +}; + +struct Bpm9 { + Bpm9() {} + ~Bpm9() {} +}; class BlurAndPaletteManager { public: + BlurAndPaletteManager(); + virtual ~BlurAndPaletteManager() { + sPInstance = nullptr; + } + static BlurAndPaletteManager &GetInstance() { return sInstance; } @@ -19,9 +233,46 @@ public: void fn_80022440(void *); private: - u8 field_0x0000[0x2F20 - 0x0000]; - f32 field_0x2F20; + mColor combineColors(const mColor &c1, const mColor &c2, f32 ratio); + + /* 0x0004 */ Spf currentSpf; + /* 0x020C */ Spf spfs[20]; + /* 0x2AAC */ Sff currentSff; + /* 0x2AD0 */ Sff sffs[20]; + /* 0x2DA0 */ u8 field_0x2DA0[0x2DD4 - 0x2DA0]; + /* 0x2DD4 */ mVec3_c field_0x2DD4; + /* 0x2DE0 */ u8 field_0x2DE0[0x2DEC - 0x2DE0]; + /* 0x2DEC */ mColor field_0x2DEC; + /* 0x2DF0 */ u8 field_0x2DF0[0x2DF4 - 0x2DF0]; + /* 0x2DF4 */ mColor field_0x2DF4; + /* 0x2DF8 */ mVec3_c field_0x2DF8; + /* 0x2E04 */ u8 field_0x2E04[0x2E08 - 0x2E04]; + /* 0x2E08 */ mVec3_c field_0x2E08[5]; + /* 0x2E44 */ mVec3_c field_0x2E44[5]; + /* 0x2E80 */ mVec3_c field_0x2E80[5]; + /* 0x2EBC */ mVec3_c field_0x2EBC[5]; + /* 0x2EF8 */ mColor field_0x2EF8; + /* 0x2EFC */ mColor field_0x2EFC; + /* 0x2F00 */ mVec3_c field_0x2F00; + /* 0x2F0C */ s16 field_0x2F0C; + /* 0x2F0E */ s16 field_0x2F0E; + /* 0x2F10 */ u8 field_0x2F10; + /* 0x2F11 */ u8 field_0x2F11[0x2F20 - 0x2F11]; + /* 0x2F20 */ f32 field_0x2F20; + /* 0x357C */ Bpm1 field_0x357C; + /* 0x35A0 */ Bpm2 field_0x35A0; + /* 0x35B4 */ Bpm7 field_0x35B4[8]; + /* 0x3654 */ Bpm8 field_0x3654[10]; + /* 0x371C */ Bpm9 field_0x371C[20]; + /* 0x38B4 */ mVec3_c field_0x38B4; + /* 0x38C8 */ mVec3_c field_0x38C8; + /* 0x38E4 */ Bpm3 field_0x38E4; + /* 0x48E4 */ Bpm4 field_0x48E4; + /* 0x5CE4 */ PaletteDefaultMCF field_0x5CE4; + /* 0x5D04 */ TwoPaletteDefaultMCF field_0x5D04; + static BlurAndPaletteManager sInstance; + static BlurAndPaletteManager *sPInstance; }; #endif diff --git a/src/toBeSorted/blur_and_palette_manager.cpp b/src/toBeSorted/blur_and_palette_manager.cpp new file mode 100644 index 00000000..3cca4706 --- /dev/null +++ b/src/toBeSorted/blur_and_palette_manager.cpp @@ -0,0 +1,191 @@ +#include "toBeSorted/blur_and_palette_manager.h" + +#include "m/m_color.h" + +BlurAndPaletteManager BlurAndPaletteManager::sInstance; +BlurAndPaletteManager *BlurAndPaletteManager::sPInstance; + +TList sList; + +mColor BlurAndPaletteManager::combineColors(const mColor &c1, const mColor &c2, f32 ratio) { + mColor result; + result.Set(0xff, 0xff, 0xff, 0xff); + result.r = (c1.r + ratio * ((f32)c2.r - (f32)c1.r)); + result.g = (c1.g + ratio * ((f32)c2.g - (f32)c1.g)); + result.b = (c1.b + ratio * ((f32)c2.b - (f32)c1.b)); + result.a = (c1.a + ratio * ((f32)c2.a - (f32)c1.a)); + return result; +} + +Spf::Spf() {} + +Sff::Sff() {} + +#pragma dont_inline on +BlurAndPaletteManager::BlurAndPaletteManager() { + mColor grey_aaaaaa = mColor(0xaa, 0xaa, 0xaa, 0xff); + mColor white_ffffff = mColor(0xff, 0xff, 0xff, 0xff); + mColor cream_ffffc0 = mColor(0xff, 0xff, 0xc0, 0xff); + mColor grey_808080 = mColor(0x80, 0x80, 0x80, 0xff); + mColor grey_787878 = mColor(0x78, 0x78, 0x78, 0xff); + mColor white2_ffffff = mColor(0xff, 0xff, 0xff, 0xff); + mColor grey_7f7f7f = mColor(0x7f, 0x7f, 0x7f, 0xff); + mColor yellow_ffd86b = mColor(0xff, 0xd8, 0x6b, 0xff); + mColor sea_blue_29424e = mColor(0x29, 0x42, 0x4e, 0xff); + mColor seafoam_green_b9d8b7 = mColor(0xb9, 0xd8, 0xb7, 0xff); + mColor white3_ffffff = mColor(0xff, 0xff, 0xff, 0xff); + mColor black_000000 = mColor(0x00, 0x00, 0x00, 0xff); + mColor pastel_orange_ffb787 = mColor(0xff, 0xb7, 0x87, 0xff); + mColor lightblue_aad2ff = mColor(0xaa, 0xd2, 0xff, 0xff); + mVec3_c v1(0.0f, 1.0f, 0.0f); + mColor white4_ffffff = mColor(0xff, 0xff, 0xff, 0xff); + f32 f1 = 2000.0f; + f32 f2 = 10000.0f; + mVec3_c v2(0.0f, 0.0f, 0.0f); + mVec3_c v3(1.0f, 1.0f, 1.0f); + mColor white5_ffffff = mColor(0xff, 0xff, 0xff, 0xff); + mColor pastel_yellow_fffb04 = mColor(0xff, 0xf0, 0xb4, 0xff); + mColor grey_3c3c3c = mColor(0x3c, 0x3c, 0x3c, 0xff); + mColor grey_a0a091 = mColor(0xa0, 0xa0, 0x91, 0xff); + mColor magenta_7d0091 = mColor(0x7d, 0x00, 0x91, 0xff); + mColor sand_ffebb4 = mColor(0xff, 0xeb, 0xb4, 0xff); + + sPInstance = this; + + currentSpf.grey_aaaaaa = grey_aaaaaa; + currentSpf.white_ffffff = white_ffffff; + currentSpf.grey_808080 = grey_808080; + currentSpf.cream_ffffc0 = cream_ffffc0; + currentSpf.grey2_aaaaaa = grey_aaaaaa; + currentSpf.white2_ffffff = white_ffffff; + currentSpf.field_0x18 = 0.6f; + currentSpf.pastel_orange_ffb787 = pastel_orange_ffb787; + currentSpf.field_0x24 = 195.0f; + currentSpf.field_0x20 = 0.5f; + currentSpf.black_000000 = black_000000; + currentSpf.black2_000000 = black_000000; + currentSpf.mSub.grey_787878 = grey_787878; + currentSpf.mSub.white3_ffffff.field_0x00 = white2_ffffff; + currentSpf.mSub.field_0x014.field_0x00 = grey_7f7f7f; + currentSpf.mSub.field_0x060.field_0x00 = grey_7f7f7f; + currentSpf.mSub.field_0x0AC.field_0x00 = grey_7f7f7f; + currentSpf.mSub.field_0x0F8.field_0x00 = grey_7f7f7f; + currentSpf.mCloudColor = yellow_ffd86b; + currentSpf.mSkyColor = sea_blue_29424e; + currentSpf.seafoam_green_b9d8b7 = seafoam_green_b9d8b7; + currentSpf.white3_ffffff = white3_ffffff; + currentSpf.field_0x18C = v2; + currentSpf.field_0x198 = v3; + currentSpf.mSub.field_0x000 = 0.0625f; + currentSpf.mSub.field_0x05C = 0.0625f; + currentSpf.mSub.field_0x0A8 = 0.0625f; + currentSpf.mSub.field_0x0F4 = 0.0625f; + + currentSpf.grey_787878 = grey_787878; + currentSpf.grey2_787878 = grey_787878; + currentSpf.grey3_787878 = grey_787878; + currentSpf.MAO5_kColor3.field_0x00 = white4_ffffff; + currentSpf.MAO5_kColor3.field_0x04 = f1; + currentSpf.MAO5_kColor3.field_0x08 = f2; + currentSpf.mSub.white3_ffffff.field_0x04 = 45.0f; + currentSpf.mSub.white3_ffffff.field_0x08 = 180.0f; + + for (int i = 0; i < 5; i++) { + currentSpf.mSub.field_0x020[i] = black_000000; + field_0x2E08[i] = v1; + currentSpf.mSub.field_0x014.field_0x04[i] = 0; + currentSpf.mSub.field_0x034[i] = 0.0f; + currentSpf.mSub.field_0x048[i] = 0.0f; + + currentSpf.mSub.field_0x06C[i] = black_000000; + field_0x2E44[i] = v1; + currentSpf.mSub.field_0x060.field_0x04[i] = 0; + currentSpf.mSub.field_0x080[i] = 0.0f; + currentSpf.mSub.field_0x094[i] = 0.0f; + + currentSpf.mSub.field_0x0B8[i] = black_000000; + field_0x2E80[i] = v1; + currentSpf.mSub.field_0x0AC.field_0x04[i] = 0; + currentSpf.mSub.field_0x0CC[i] = 0.0f; + currentSpf.mSub.field_0x0E0[i] = 0.0f; + + currentSpf.mSub.field_0x104[i] = black_000000; + field_0x2EBC[i] = v1; + currentSpf.mSub.field_0x0F8.field_0x04[i] = 0; + currentSpf.mSub.field_0x118[i] = 0.0f; + currentSpf.mSub.field_0x12C[i] = 0.0f; + } + + currentSpf.field_0x1B0.x = 0.55f; + currentSpf.field_0x1B0.y = 1.0f; + currentSpf.field_0x1B0.z = 0.0f; + currentSpf.field_0x1BC = 0; + currentSpf.field_0x1C0 = 1.0f; + currentSpf.field_0x1C4 = 0.5f; + currentSpf.field_0x1C8 = 0; + currentSpf.field_0x1CC = 0.5f; + currentSpf.field_0x1D0 = 0.0f; + currentSpf.field_0x1D4 = 0; + currentSpf.field_0x1D5 = pastel_yellow_fffb04; + currentSpf.field_0x1D9 = 1; + currentSpf.field_0x1DC = 3300.0f; + currentSpf.field_0x1E0 = 3300.0f; + currentSpf.field_0x1E4 = 1000.0f; + currentSpf.field_0x1E8 = 500.0f; + currentSpf.field_0x1EC = 0xFF; + currentSpf.field_0x1ED = 1; + currentSpf.field_0x1EE = 0; + currentSpf.field_0x1F0 = 0.0f; + currentSpf.field_0x1F4 = 0.0f; + currentSpf.field_0x1F8 = 6.93359f; + currentSpf.field_0x1FC = 8.0f; + currentSpf.black3_000000 = black_000000; + currentSpf.black4_000000 = black_000000; + + for (int i = 0; i < 3; i++) { + currentSff.field_0x00[i].field_0x00 = white4_ffffff; + currentSff.field_0x00[i].field_0x04 = f1; + currentSff.field_0x00[i].field_0x08 = f2; + } + + for (int i = 0; i < 20; i++) { + spfs[i] = currentSpf; + sffs[i] = currentSff; + } + + field_0x2DEC = lightblue_aad2ff; + field_0x2EF8 = grey_a0a091; + field_0x2EFC = grey_3c3c3c; + field_0x2F00 = v1; + + field_0x2F0C = 30000; + field_0x2F0E = -8000; + field_0x2F10 = 0; + field_0x2DF8 = v1; + + for (int i = 0; i < 32; i++) { + for (int j = 0; j < 8; j++) { + field_0x38E4.field_0x00[i].field_0x00[j].field_0x00 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x38E4.field_0x00[i].field_0x00[j].field_0x04 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x38E4.field_0x00[i].field_0x00[j].field_0x08 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x38E4.field_0x00[i].field_0x00[j].field_0x0C = mColor(0xff, 0xff, 0xff, 0xff); + field_0x48E4.field_0x00[i].field_0x00[j].field_0x00 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x48E4.field_0x00[i].field_0x00[j].field_0x04 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x48E4.field_0x00[i].field_0x00[j].field_0x08 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x48E4.field_0x00[i].field_0x00[j].field_0x0C = mColor(0xff, 0xff, 0xff, 0xff); + field_0x48E4.field_0x00[i].field_0x00[j].field_0x10 = 0; + } + } + + + field_0x5CE4.MA06_kColor3 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x5CE4.MA01_tevReg1 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x5CE4.MA01_kColor2 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x5CE4.MA02_tevReg1 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x5CE4.MA02_kcolor2 = mColor(0xff, 0xff, 0xff, 0xff); + field_0x5CE4.MA03_kcolor3 = mColor(0xff, 0xff, 0xff, 0xff); + + field_0x5D04.field_0x00 = field_0x5CE4; + field_0x5D04.field_0x20 = field_0x5CE4; +} +#pragma dont_inline reset