From c8710555214a9fd0a04936df77c1bc0e2f578395 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sun, 30 Nov 2025 19:44:12 -0500 Subject: [PATCH] Clean palette_util --- include/code_80958E8.h | 6 + include/code_8099360.h | 10 - include/constants/palette_util.h | 38 ++ include/data_script.h | 15 +- include/gba/defines.h | 3 +- include/palette_util.h | 7 +- src/credits1.c | 136 +++--- src/data/ground/ground_data_a01p01_station.h | 18 +- src/data/ground/ground_data_a01p02_station.h | 4 +- src/data/ground/ground_data_a03p03_station.h | 32 +- src/data/ground/ground_data_a04p01_station.h | 6 +- src/data/ground/ground_data_a04p03_station.h | 12 +- src/data/ground/ground_data_a04p04_station.h | 8 +- src/data/ground/ground_data_a05p01_station.h | 8 +- src/data/ground/ground_data_a05p02_station.h | 6 +- src/data/ground/ground_data_b01p01a_station.h | 10 +- src/data/ground/ground_data_b01p02a_station.h | 8 +- src/data/ground/ground_data_d02p01_station.h | 2 +- src/data/ground/ground_data_d02p02_station.h | 2 +- src/data/ground/ground_data_d05p02_station.h | 36 +- src/data/ground/ground_data_d09p03_station.h | 16 +- src/data/ground/ground_data_d10p03_station.h | 28 +- src/data/ground/ground_data_d11p03_station.h | 16 +- src/data/ground/ground_data_d12p04_station.h | 8 +- src/data/ground/ground_data_d13p03_station.h | 26 +- src/data/ground/ground_data_d16p01_station.h | 16 +- src/data/ground/ground_data_d17p01_station.h | 16 +- src/data/ground/ground_data_d18p01_station.h | 16 +- src/data/ground/ground_data_d20p01_station.h | 18 +- src/data/ground/ground_data_d21p01_station.h | 4 +- src/data/ground/ground_data_d22p01_station.h | 2 +- src/data/ground/ground_data_d23p01_station.h | 2 +- src/data/ground/ground_data_d24p01_station.h | 26 +- src/data/ground/ground_data_d25p01_station.h | 2 +- src/data/ground/ground_data_h29p01_station.h | 12 +- src/data/ground/ground_data_s02_station.h | 2 +- src/data/ground/ground_data_s03_station.h | 2 +- src/data/ground/ground_data_t01p01_station.h | 58 +-- src/data/ground/ground_data_t01p02a_station.h | 4 +- src/ground_bg.c | 16 +- src/ground_main.c | 3 - src/ground_script.c | 58 ++- src/main_loops.c | 1 + src/palette_fade_util.c | 46 +- src/palette_util.c | 411 ++++++++++-------- src/wigglytuff_shop3.c | 5 +- 46 files changed, 626 insertions(+), 555 deletions(-) create mode 100644 include/constants/palette_util.h diff --git a/include/code_80958E8.h b/include/code_80958E8.h index aa1b0d452..26f7358e9 100644 --- a/include/code_80958E8.h +++ b/include/code_80958E8.h @@ -56,6 +56,7 @@ void LoadMailInfo(void); void ReadWonderMailBits(DataSerializer *a, WonderMail *b); void ReceivePKMNNews(u8 index); void ResetJobSlot(u8 index); +void ResetMailbox(void); void ResetMailboxSlot(u8 index); void ResetPelipperBoardSlot(u8); void ShiftJobSlotsDown(void); @@ -63,6 +64,11 @@ void ShiftMailboxSlotsDown(void); void ShiftPelipperJobsDown(void); void SortJobSlots(void); void sub_80961B4(void); +bool8 sub_80961D8(void); +void sub_80963FC(void); +void sub_8096488(void); +bool8 sub_80964B4(void); +bool8 sub_80964E4(void); bool8 sub_809693C(WonderMail *mail); void sub_8096AF8(struct unkStruct_8096AF8 *, u8 slotIndex, u8 dungeon); bool8 sub_8096C08(u8 *jobIndex); diff --git a/include/code_8099360.h b/include/code_8099360.h index 22fc816c0..bbe27c936 100644 --- a/include/code_8099360.h +++ b/include/code_8099360.h @@ -6,14 +6,4 @@ void nullsub_103(void); void sub_809965C(void); void sub_8099690(u32 param_1); -// code_8099360.s - -#include "structs/rgb.h" - -void sub_8099744(void); -void sub_8099750(void); -void sub_8099A5C(s32 a0, s32 a1, RGB_Array a2); -void sub_8099AFC(s32 a0, s32 a1, RGB_Array a2); -bool8 sub_8099B94(void); - #endif //GUARD_CODE_8099360_H diff --git a/include/constants/palette_util.h b/include/constants/palette_util.h new file mode 100644 index 000000000..150d74fa4 --- /dev/null +++ b/include/constants/palette_util.h @@ -0,0 +1,38 @@ +#ifndef GUARD_CONSTANTS_PALETTE_UTIL_H +#define GUARD_CONSTANTS_PALETTE_UTIL_H + +enum PaletteUtilUnk0Kind +{ + // None? + PALUTIL_KIND_00, + // Blend Pals [0, 15] then [16, 31] + PALUTIL_KIND_01, + // FadeToBlack Pals [0, 15] then [16, 31] + PALUTIL_KIND_02, + // Desaturate Pals [0, 15] then [16, 31] + PALUTIL_KIND_03, + // Modulate Pals [0, 15] then [16, 31] + PALUTIL_KIND_04, + // Blend Pals [0, 13] then [16, 30] + PALUTIL_KIND_05, + // FadeToBlack Pals [0, 13] then [16, 30] + PALUTIL_KIND_06, + // Desaturate Pals [0, 13] then [16, 30] + PALUTIL_KIND_07, + // Modulate Pals [0, 13] then [16, 30] + PALUTIL_KIND_08, + // Blend Pals [14, 15] then [31, 31] + PALUTIL_KIND_09, + // FadeToBlack Pals [14, 15] then [31, 31] + PALUTIL_KIND_10, + // Desaturate Pals [14, 15] then [31, 31] + PALUTIL_KIND_11, + // Modulate Pals [14, 15] then [31, 31] + PALUTIL_KIND_12, + // ModulatePurple Pals [0, 13] then [16, 30] + PALUTIL_KIND_13, + // ModulateOrange Pals [0, 13] then [16, 30] + PALUTIL_KIND_14, +}; + +#endif // GUARD_CONSTANTS_PALETTE_UTIL_H diff --git a/include/data_script.h b/include/data_script.h index 76652d1ca..5ed91e16f 100644 --- a/include/data_script.h +++ b/include/data_script.h @@ -7,6 +7,7 @@ #include "constants/event_flag.h" #include "constants/ground_map.h" #include "constants/item.h" +#include "constants/palette_util.h" #include "constants/rescue_dungeon_id.h" #include "constants/script_dungeon_id.h" #include "constants/script_cmd.h" @@ -108,9 +109,17 @@ // TODO: CMD_BYTE_26 -// TODO: CMD_BYTE_27 +// a0: Some bool +// kind: See enum "PaletteUtilUnk0Kind" +// a2: ? +// rgb: (R << 16) | (G << 8) | (B) +#define FLASH_FROM(a0, kind, a2, rgb) { CMD_BYTE_27, a0, kind, a2, rgb, NULL } -// TODO: CMD_BYTE_28 +// a0: Some bool +// kind: See enum "PaletteUtilUnk0Kind" +// a2: ? +// rgb: (R << 16) | (G << 8) | (B) +#define FLASH_TO(a0, kind, a2, rgb) { CMD_BYTE_28, a0, kind, a2, rgb, NULL } // TODO: CMD_BYTE_29 @@ -118,7 +127,7 @@ // Waits specified number of frames, then automatically does a button press without waiting for player's input. // -1 disables it. -#define TEXTBOX_AUTO_PRESS(endF, midF) { CMD_BYTE_2B, 0, 0, endF, midF, NULL} +#define TEXTBOX_AUTO_PRESS(endF, midF) { CMD_BYTE_2B, 0, 0, endF, midF, NULL } // TODO: CMD_BYTE_2C diff --git a/include/gba/defines.h b/include/gba/defines.h index b4265399a..1ccb7e9e0 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -62,7 +62,8 @@ #define TOTAL_OBJ_TILE_COUNT 1024 -#define RGB_U32(r, g, b) ((r) | ((g) << 8) | ((b) << 16)) // 32 bit RGB color +// 32 bit RGB color +#define RGB_U32(r, g, b) (((r) << 16) | ((g) << 8) | (b)) #define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) diff --git a/include/palette_util.h b/include/palette_util.h index 031a2feba..9f12455c5 100644 --- a/include/palette_util.h +++ b/include/palette_util.h @@ -1,6 +1,7 @@ #ifndef GUARD_PALETTE_UTIL_H #define GUARD_PALETTE_UTIL_H +#include "constants/palette_util.h" #include "structs/rgb.h" void sub_8099744(void); @@ -15,8 +16,10 @@ void sub_80999FC(s32 a0); void sub_8099A10(s32 a1, u16 a2, u16 a3); void sub_8099A34(s32 a0); void sub_8099A48(s32 a0); -void sub_8099A5C(s32 a0, s32 a1, RGB_Array a2); -void sub_8099AFC(s32 a0, s32 a1, RGB_Array a2); +// a0: See enum "PaletteUtilUnk0Kind" +void sub_8099A5C(s32 kind, s32 a1, RGB_Array a2); +// a0: See enum "PaletteUtilUnk0Kind" +void sub_8099AFC(s32 kind, s32 a1, RGB_Array a2); bool8 sub_8099B94(void); void sub_8099BE4(void); diff --git a/src/credits1.c b/src/credits1.c index 7f3d524e5..2c1bdf5fd 100644 --- a/src/credits1.c +++ b/src/credits1.c @@ -5,12 +5,14 @@ #include "event_flag.h" #include "input.h" #include "memory.h" +#include "palette_util.h" #include "text_1.h" #include "text_3.h" -EWRAM_INIT static Credits1Work *sCredits1Work = {NULL}; +EWRAM_INIT static Credits1Work *sCredits1Work = { NULL }; static const WindowTemplate sDummyWinTemplate = WIN_TEMPLATE_DUMMY; + static const WindowTemplate gUnknown_80E4A28 = { .flags = WINTEMPLATE_FLAG_NONE, .type = WINDOW_TYPE_ONLY_TEXT, @@ -25,68 +27,68 @@ static const WindowTemplate gUnknown_80E4A28 = { static const RGB_Array gUnknown_80E4A40 = {{0x18, 0x18, 0x38, 0}}; UNUSED static const u8 sUnknownUnusedData[][2] = { - {0x21, 0xff}, - {0x22, 0xff}, - {0x23, 0xff}, - {0x24, 0xff}, - {0x25, 0xff}, - {0x26, 0xff}, - {0x27, 0xff}, - {0x28, 0xff}, - {0x29, 0xff}, - {0x2a, 0xff}, - {0x2b, 0xff}, - {0x2c, 0xff}, - {0x2d, 0xff}, - {0x2e, 0xff}, - {0x2f, 0xff}, - {0x30, 0xff}, - {0x31, 0xff}, - {0x32, 0xff}, - {0x33, 0xff}, - {0x34, 0xff}, - {0x35, 0xff}, - {0x36, 0xff}, - {0x37, 0xff}, - {0x38, 0xff}, - {0x39, 0xff}, - {0x3a, 0xff}, - {0x41, 0xff}, - {0x42, 0xff}, - {0x43, 0xff}, - {0x44, 0xff}, - {0x45, 0xff}, - {0x46, 0xff}, - {0x47, 0xff}, - {0x48, 0xff}, - {0x49, 0xff}, - {0x4a, 0xff}, - {0x4b, 0xff}, - {0x4c, 0xff}, - {0x4d, 0xff}, - {0x4e, 0xff}, - {0x4f, 0xff}, - {0x50, 0xff}, - {0x51, 0xff}, - {0x52, 0xff}, - {0x53, 0xff}, - {0x54, 0xff}, - {0x55, 0xff}, - {0x56, 0xff}, - {0x57, 0xff}, - {0x58, 0xff}, - {0x59, 0xff}, - {0x5a, 0xff}, - {0x10, 0xff}, - {0x11, 0xff}, - {0x12, 0xff}, - {0x13, 0xff}, - {0x14, 0xff}, - {0x15, 0xff}, - {0x16, 0xff}, - {0x17, 0xff}, - {0x18, 0xff}, - {0x19, 0xff} + { 0x21, 0xFF }, + { 0x22, 0xFF }, + { 0x23, 0xFF }, + { 0x24, 0xFF }, + { 0x25, 0xFF }, + { 0x26, 0xFF }, + { 0x27, 0xFF }, + { 0x28, 0xFF }, + { 0x29, 0xFF }, + { 0x2A, 0xFF }, + { 0x2B, 0xFF }, + { 0x2C, 0xFF }, + { 0x2D, 0xFF }, + { 0x2E, 0xFF }, + { 0x2F, 0xFF }, + { 0x30, 0xFF }, + { 0x31, 0xFF }, + { 0x32, 0xFF }, + { 0x33, 0xFF }, + { 0x34, 0xFF }, + { 0x35, 0xFF }, + { 0x36, 0xFF }, + { 0x37, 0xFF }, + { 0x38, 0xFF }, + { 0x39, 0xFF }, + { 0x3A, 0xFF }, + { 0x41, 0xFF }, + { 0x42, 0xFF }, + { 0x43, 0xFF }, + { 0x44, 0xFF }, + { 0x45, 0xFF }, + { 0x46, 0xFF }, + { 0x47, 0xFF }, + { 0x48, 0xFF }, + { 0x49, 0xFF }, + { 0x4A, 0xFF }, + { 0x4B, 0xFF }, + { 0x4C, 0xFF }, + { 0x4D, 0xFF }, + { 0x4E, 0xFF }, + { 0x4F, 0xFF }, + { 0x50, 0xFF }, + { 0x51, 0xFF }, + { 0x52, 0xFF }, + { 0x53, 0xFF }, + { 0x54, 0xFF }, + { 0x55, 0xFF }, + { 0x56, 0xFF }, + { 0x57, 0xFF }, + { 0x58, 0xFF }, + { 0x59, 0xFF }, + { 0x5A, 0xFF }, + { 0x10, 0xFF }, + { 0x11, 0xFF }, + { 0x12, 0xFF }, + { 0x13, 0xFF }, + { 0x14, 0xFF }, + { 0x15, 0xFF }, + { 0x16, 0xFF }, + { 0x17, 0xFF }, + { 0x18, 0xFF }, + { 0x19, 0xFF } }; extern const CreditsData* gCreditsTable[27]; @@ -155,7 +157,7 @@ bool8 DrawCredits(s32 creditsCategoryIndex, s32 param_2) sub_80073E0(0); SelectCharmap(0); - sub_8099AFC(9, 0, gUnknown_80E4A40); + sub_8099AFC(PALUTIL_KIND_09, 0, gUnknown_80E4A40); return TRUE; } @@ -165,7 +167,7 @@ s32 sub_8035574(void) case 0: if (!sub_8099B94()) { sCredits1Work->unk60 = 1; - sub_8099A5C(9, 30, gUnknown_80E4A40); + sub_8099A5C(PALUTIL_KIND_09, 30, gUnknown_80E4A40); } break; case 1: @@ -175,7 +177,7 @@ s32 sub_8035574(void) case 2: if (sCredits1Work->unk64 < 1) { sCredits1Work->unk60 = 3; - sub_8099AFC(9, 30, gUnknown_80E4A40); + sub_8099AFC(PALUTIL_KIND_09, 30, gUnknown_80E4A40); } sCredits1Work->unk64--; break; @@ -188,7 +190,7 @@ s32 sub_8035574(void) break; case 4: sub_8099690(0); - sub_8099A5C(1, 0, gUnknown_80E4A40); + sub_8099A5C(PALUTIL_KIND_01, 0, gUnknown_80E4A40); return 3; } return 0; diff --git a/src/data/ground/ground_data_a01p01_station.h b/src/data/ground/ground_data_a01p01_station.h index f94e1c18e..a629f284f 100644 --- a/src/data/ground/ground_data_a01p01_station.h +++ b/src/data/ground/ground_data_a01p01_station.h @@ -379,10 +379,10 @@ static const struct ScriptCommand s_gs162_g5_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(MAP_PERSONALITY_TEST_CYAN), SELECT_ENTITIES(-1, 0), BGM_SWITCH(MUS_BENEVOLENT_SPIRIT), - { 0x27, 0x00, 0x0005, 0x00000020, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 32, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), FANFARE_PLAY2(506), - { 0x28, 0x01, 0x0005, 0x00000020, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 32, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; @@ -676,9 +676,9 @@ static const struct ScriptCommand s_gs162_g7_s0_station_sref_script[] = { /* 0x8 DEBUGINFO_O(676), SELECT_MAP(MAP_PERSONALITY_TEST_CYAN), SELECT_ENTITIES(-1, -1), - { 0x27, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), - { 0x28, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), RET, }; @@ -979,7 +979,7 @@ static const struct ScriptCommand s_gs162_g9_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(MAP_PERSONALITY_TEST_CYAN), SELECT_ENTITIES(-1, -1), BGM_SWITCH(MUS_BENEVOLENT_SPIRIT), - { 0x27, 0x00, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), BGM_FADEOUT(60), { 0x23, 0x01, 0x003c, 0x00000000, 0x00000000, NULL }, @@ -1103,9 +1103,9 @@ static const struct ScriptCommand s_gs162_g9_s0_lives0_dlg0[] = { /* 0x821452c * TEXTBOX_CLEAR, WAIT(30), FANFARE_PLAY2(485), - { 0x28, 0x01, 0x0005, 0x00000018, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 24, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(10), - { 0x27, 0x00, 0x0005, 0x00000018, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 24, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), PORTRAIT_REP(0x0000, 0x0000000c), MSG_QUIET(0, _("...!{WAIT_PRESS} W-what was that?!")), @@ -1237,9 +1237,9 @@ static const struct ScriptCommand s_gs162_g10_s0_station_sref_script[] = { /* 0x DEBUGINFO_O(1237), SELECT_MAP(MAP_PERSONALITY_TEST_CYAN), SELECT_ENTITIES(-1, 0), - { 0x27, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), - { 0x28, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), RET, }; diff --git a/src/data/ground/ground_data_a01p02_station.h b/src/data/ground/ground_data_a01p02_station.h index 5b276b732..547f7351c 100644 --- a/src/data/ground/ground_data_a01p02_station.h +++ b/src/data/ground/ground_data_a01p02_station.h @@ -60,7 +60,7 @@ static const struct ScriptCommand s_gs163_g2_s0_station_sref_script[] = { /* 0x8 SELECT_ENTITIES(-1, -1), { 0x22, 0x01, 0x003c, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; @@ -94,7 +94,7 @@ static const struct ScriptCommand s_gs163_g3_s0_station_sref_script[] = { /* 0x8 AWAIT_CUE(3), FANFARE_PLAY2(506), BGM_FADEOUT(90), - { 0x28, 0x01, 0x0005, 0x0000001e, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), RET, }; diff --git a/src/data/ground/ground_data_a03p03_station.h b/src/data/ground/ground_data_a03p03_station.h index 69d357f44..68c5bd7d1 100644 --- a/src/data/ground/ground_data_a03p03_station.h +++ b/src/data/ground/ground_data_a03p03_station.h @@ -23,7 +23,7 @@ static const struct ScriptCommand s_gs170_g1_s0_station_sref_script[] = { /* 0x8 { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), FANFARE_PLAY2(506), - { 0x28, 0x01, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; @@ -159,12 +159,12 @@ static const struct ScriptCommand s_gs170_g1_s0_lives0_dlg0[] = { /* 0x821d2f8 * WAIT(30), BGM_FADEOUT(30), FANFARE_PLAY2(476), - { 0x28, 0x01, 0x0007, 0x00000004, 0x00806040, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_07, 4, RGB_U32(0x80, 0x60, 0x40)), SELECT_ANIMATION(9), { 0x54, 0x00, 0x0200, 0x00000000, 0x00000000, NULL }, - { 0x27, 0x01, 0x0007, 0x00000008, 0x00806040, NULL }, - { 0x28, 0x01, 0x0007, 0x00000008, 0x00806040, NULL }, - { 0x27, 0x01, 0x0007, 0x0000000c, 0x00806040, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_07, 8, RGB_U32(0x80, 0x60, 0x40)), + FLASH_TO(TRUE, PALUTIL_KIND_07, 8, RGB_U32(0x80, 0x60, 0x40)), + FLASH_FROM(TRUE, PALUTIL_KIND_07, 12, RGB_U32(0x80, 0x60, 0x40)), { 0x54, 0x00, 0x0300, 0x00000000, 0x00000000, NULL }, SELECT_ANIMATION(2), WAIT(60), @@ -172,12 +172,12 @@ static const struct ScriptCommand s_gs170_g1_s0_lives0_dlg0[] = { /* 0x821d2f8 * MSG_QUIET(0, _("(...{WAIT_PRESS}Wh-what?{WAIT_PRESS} What was that?)")), TEXTBOX_CLEAR, FANFARE_PLAY2(476), - { 0x28, 0x01, 0x0007, 0x00000004, 0x00806040, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_07, 4, RGB_U32(0x80, 0x60, 0x40)), SELECT_ANIMATION(9), { 0x54, 0x00, 0x0200, 0x00000000, 0x00000000, NULL }, - { 0x27, 0x01, 0x0007, 0x00000008, 0x00806040, NULL }, - { 0x28, 0x01, 0x0007, 0x00000008, 0x00806040, NULL }, - { 0x27, 0x01, 0x0007, 0x0000000c, 0x00806040, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_07, 8, RGB_U32(0x80, 0x60, 0x40)), + FLASH_TO(TRUE, PALUTIL_KIND_07, 8, RGB_U32(0x80, 0x60, 0x40)), + FLASH_FROM(TRUE, PALUTIL_KIND_07, 12, RGB_U32(0x80, 0x60, 0x40)), { 0x54, 0x00, 0x0300, 0x00000000, 0x00000000, NULL }, SELECT_ANIMATION(2), MSG_QUIET(0, _("(...D-dizzy?{WAIT_PRESS} Or what?)")), @@ -192,13 +192,13 @@ static const struct ScriptCommand s_gs170_g1_s0_lives0_dlg0[] = { /* 0x821d2f8 * VARIANT_DEFAULT(_(" Huh?{WAIT_PRESS} Is something wrong?\n{NAME_0}?")), TEXTBOX_CLEAR, FANFARE_PLAY2(476), - { 0x28, 0x01, 0x0007, 0x00000004, 0x00806040, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_07, 4, RGB_U32(0x80, 0x60, 0x40)), SELECT_ANIMATION(9), { 0x54, 0x00, 0x0200, 0x00000000, 0x00000000, NULL }, - { 0x27, 0x01, 0x0007, 0x00000008, 0x00806040, NULL }, - { 0x28, 0x01, 0x0007, 0x00000008, 0x00806040, NULL }, - { 0x27, 0x01, 0x0007, 0x0000000c, 0x00806040, NULL }, - { 0x28, 0x01, 0x0005, 0x00000008, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_07, 8, RGB_U32(0x80, 0x60, 0x40)), + FLASH_TO(TRUE, PALUTIL_KIND_07, 8, RGB_U32(0x80, 0x60, 0x40)), + FLASH_FROM(TRUE, PALUTIL_KIND_07, 12, RGB_U32(0x80, 0x60, 0x40)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 8, RGB_U32(0x00, 0x00, 0x00)), { 0x54, 0x00, 0x0300, 0x00000000, 0x00000000, NULL }, SELECT_ANIMATION(2), MSG_NPC(-1, _(" ...Finally.")), @@ -212,7 +212,7 @@ static const struct ScriptCommand s_gs170_g1_s0_lives0_dlg0[] = { /* 0x821d2f8 * WAIT(10), FANFARE_PLAY2(477), SELECT_ENTITIES(-1, 1), - { 0x27, 0x01, 0x0005, 0x00000030, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 48, RGB_U32(0x00, 0x00, 0x00)), ROTATE_TO(4, DIR_TRANS_SPINLEFT1, DIRECTION_EAST), WAIT(30), MSG_NPC(-1, _(" Finally...")), @@ -271,7 +271,7 @@ static const struct ScriptCommand s_gs170_g2_s0_station_sref_script[] = { /* 0x8 DEBUGINFO_O(271), SELECT_MAP(170), SELECT_ENTITIES(-1, 0), - { 0x27, 0x00, 0x0005, 0x00000020, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 32, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), BGM_FADEOUT(120), { 0x23, 0x01, 0x0078, 0x00000000, 0x00000000, NULL }, diff --git a/src/data/ground/ground_data_a04p01_station.h b/src/data/ground/ground_data_a04p01_station.h index 235d2106c..acfb039dd 100644 --- a/src/data/ground/ground_data_a04p01_station.h +++ b/src/data/ground/ground_data_a04p01_station.h @@ -31,7 +31,7 @@ static const struct ScriptCommand s_gs171_g1_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(171), SELECT_ENTITIES(-1, 0), BGM_SWITCH(MUS_WORLD_CALAMITY), - { 0x27, 0x00, 0x0005, 0x00000020, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 32, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), { 0x23, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, RET, @@ -77,7 +77,7 @@ static const struct ScriptCommand s_gs171_g2_s0_station_sref_script[] = { /* 0x8 BGM_SWITCH(MUS_WORLD_CALAMITY), { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0005, 0x00000020, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 32, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; @@ -606,7 +606,7 @@ static const struct ScriptCommand s_gs171_g5_s0_lives0_dlg0[] = { /* 0x8221f00 * MSG_NPC(-1, _(" ...Hey, can you hear...")), MSG_NPC(2, _(" Snap out of it!")), TEXTBOX_CLEAR, - { 0x27, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), PORTRAIT(PLACEMENT_LEFT_BOTTOM_2, 0x0000, 0x00000000), MSG_QUIET(0, _("(...{WAIT_PRESS}Huh...?{WAIT_PRESS} This place...)")), diff --git a/src/data/ground/ground_data_a04p03_station.h b/src/data/ground/ground_data_a04p03_station.h index b153fef5f..fe5616c6b 100644 --- a/src/data/ground/ground_data_a04p03_station.h +++ b/src/data/ground/ground_data_a04p03_station.h @@ -76,18 +76,18 @@ static const struct ScriptCommand s_gs173_g3_s0_station_sref_script[] = { /* 0x8 SELECT_ENTITIES(-1, -1), BGM_SWITCH(MUS_RAYQUAZAS_DOMAIN), { 0x97, 0x00, 0x0001, 0x00000000, 0x00000000, NULL }, - { 0x27, 0x00, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(5), WAIT(120), - { 0x28, 0x01, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(20), - { 0x28, 0x01, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), - { 0x28, 0x01, 0x0005, 0x0000002d, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 45, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), RET, }; diff --git a/src/data/ground/ground_data_a04p04_station.h b/src/data/ground/ground_data_a04p04_station.h index 86053cb03..7ef0f2ffd 100644 --- a/src/data/ground/ground_data_a04p04_station.h +++ b/src/data/ground/ground_data_a04p04_station.h @@ -21,10 +21,10 @@ static const struct ScriptCommand s_gs174_g1_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(174), SELECT_ENTITIES(-1, -1), BGM_STOP, - { 0x27, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), BGM_FADEOUT(150), - { 0x28, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(180), RET, }; @@ -52,10 +52,10 @@ static const struct ScriptCommand s_gs174_g1_s0_lives0_dlg0[] = { /* 0x822a258 * TEXTBOX_CLEAR, WAIT(30), FANFARE_PLAY2(485), - { 0x28, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), SELECT_LIVES(-1, 1), - { 0x27, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), MSG_QUIET(0, _("(............)")), MSG_QUIET(0, _("(...This shadow...{WAIT_PRESS}\n{NAME_4}...)")), TEXTBOX_CLEAR, diff --git a/src/data/ground/ground_data_a05p01_station.h b/src/data/ground/ground_data_a05p01_station.h index f5cc1bf63..74222cab6 100644 --- a/src/data/ground/ground_data_a05p01_station.h +++ b/src/data/ground/ground_data_a05p01_station.h @@ -24,11 +24,11 @@ static const struct ScriptCommand s_gs175_g1_s0_station_sref_script[] = { /* 0x8 { 0x22, 0x01, 0x00b4, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), WAIT(0), - { 0x28, 0x01, 0x0001, 0x0000001e, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(45), RET, LABEL(0), /* = 0x00 */ - { 0x28, 0x01, 0x0001, 0x0000001e, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), RET, }; @@ -68,9 +68,9 @@ static const struct ScriptCommand s_gs175_g2_s0_station_sref_script[] = { /* 0x8 BGM_STOP, { 0x22, 0x01, 0x00b4, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(170), - { 0x28, 0x01, 0x0002, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_02, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), { 0x25, 0x01, 0x0000, 0x00000000, 0x00000000, NULL }, RET, diff --git a/src/data/ground/ground_data_a05p02_station.h b/src/data/ground/ground_data_a05p02_station.h index b070ca857..5214ca911 100644 --- a/src/data/ground/ground_data_a05p02_station.h +++ b/src/data/ground/ground_data_a05p02_station.h @@ -20,12 +20,12 @@ static const struct ScriptCommand s_gs176_g1_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(MAP_NIGHT_SKY_2), SELECT_ENTITIES(-1, 0), { 0x3b, 0x36, 0x0000, -0x00000002, 0x00000000, NULL }, - { 0x27, 0x01, 0x0001, 0x0000001e, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 30, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), - { 0x28, 0x01, 0x0005, 0x00000078, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 120, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), { 0x25, 0x01, 0x0000, 0x00000000, 0x00000000, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), SPECIAL_TEXT(SPECIAL_TEXT_CREDITS_NAME, 0, 200), WAIT(45), diff --git a/src/data/ground/ground_data_b01p01a_station.h b/src/data/ground/ground_data_b01p01a_station.h index b11c756d6..345dbd818 100644 --- a/src/data/ground/ground_data_b01p01a_station.h +++ b/src/data/ground/ground_data_b01p01a_station.h @@ -7475,9 +7475,9 @@ static const struct ScriptCommand s_gs9_g52_s0_station_sref_script[] = { /* 0x81 SELECT_MAP(MAP_TEAM_BASE), SELECT_ENTITIES(-1, -1), BGM_SWITCH(MUS_THE_ESCAPE), - { 0x27, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), - { 0x28, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), RET, }; @@ -8907,14 +8907,14 @@ static const struct ScriptCommand s_gs9_g68_s0_station_sref_script[] = { /* 0x81 DEBUGINFO_O(9048), SELECT_MAP(MAP_TEAM_BASE), SELECT_ENTITIES(-1, -1), - { 0x27, 0x01, 0x000d, 0x0000001e, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_13, 30, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), WAIT(0), - { 0x28, 0x01, 0x000d, 0x00000023, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_13, 35, RGB_U32(0x00, 0x00, 0x00)), WAIT(90), RET, LABEL(0), /* = 0x00 */ - { 0x28, 0x01, 0x000d, 0x00000078, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_13, 120, RGB_U32(0x00, 0x00, 0x00)), WAIT(80), RET, }; diff --git a/src/data/ground/ground_data_b01p02a_station.h b/src/data/ground/ground_data_b01p02a_station.h index eb2d6f28f..91c632c66 100644 --- a/src/data/ground/ground_data_b01p02a_station.h +++ b/src/data/ground/ground_data_b01p02a_station.h @@ -227,9 +227,9 @@ static const struct ScriptCommand s_gs12_g2_s0_station_sref_script[] = { /* 0x81 SELECT_MAP(MAP_TEAM_BASE_INSIDE), SELECT_ENTITIES(-1, 0), BGM_STOP, - { 0x27, 0x01, 0x000d, 0x0000003c, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_13, 60, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), - { 0x28, 0x01, 0x000d, 0x0000003c, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_13, 60, RGB_U32(0x00, 0x00, 0x00)), RET, }; @@ -2458,10 +2458,10 @@ static const struct ScriptCommand s_gs12_g42_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(MAP_TEAM_BASE_INSIDE), { 0x3b, 0x48, 0x0002, 0x00000000, 0x00000000, NULL }, SELECT_ENTITIES(-1, -1), - { 0x27, 0x01, 0x000d, 0x0000003c, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_13, 60, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), FANFARE_FADEOUT2(90, 484), - { 0x28, 0x01, 0x000d, 0x0000003c, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_13, 60, RGB_U32(0x00, 0x00, 0x00)), { 0x3b, 0x48, 0x0000, 0x00000000, 0x00000000, NULL }, RET, }; diff --git a/src/data/ground/ground_data_d02p01_station.h b/src/data/ground/ground_data_d02p01_station.h index f3f46c48a..51e06dfdd 100644 --- a/src/data/ground/ground_data_d02p01_station.h +++ b/src/data/ground/ground_data_d02p01_station.h @@ -241,7 +241,7 @@ static const struct ScriptCommand s_gs180_g3_s0_station_sref_script[] = { /* 0x8 SELECT_ENTITIES(-1, 0), BGM_SWITCH(MUS_A_SUCCESSFUL_RESCUE), WAIT(30), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), { 0x23, 0x01, 0x003c, 0x00000000, 0x00000000, NULL }, WAIT(30), diff --git a/src/data/ground/ground_data_d02p02_station.h b/src/data/ground/ground_data_d02p02_station.h index 2abc24060..3b8ccef60 100644 --- a/src/data/ground/ground_data_d02p02_station.h +++ b/src/data/ground/ground_data_d02p02_station.h @@ -27,7 +27,7 @@ static const struct ScriptCommand s_gs181_g1_s0_station_sref_script[] = { /* 0x8 { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), BGM_FADEOUT(120), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; diff --git a/src/data/ground/ground_data_d05p02_station.h b/src/data/ground/ground_data_d05p02_station.h index f012c8b7e..3b8e8f65b 100644 --- a/src/data/ground/ground_data_d05p02_station.h +++ b/src/data/ground/ground_data_d05p02_station.h @@ -117,11 +117,11 @@ static const struct ScriptCommand s_gs187_g1_s0_lives0_dlg0[] = { /* 0x8237d1c * TEXTBOX_CLEAR, BGM_STOP, FANFARE_PLAY2(502), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x27, 0x01, 0x0005, 0x00000003, 0x00777700, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x27, 0x01, 0x0005, 0x00000003, 0x00777700, NULL }, - { 0x28, 0x01, 0x0005, 0x00000004, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 3, RGB_U32(0x77, 0x77, 0x00)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 3, RGB_U32(0x77, 0x77, 0x00)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0x00, 0x00, 0x00)), MSG_VAR(2, PARTNER_TALK_KIND, 1), VARIANT(/* == */ 1, _(" Wh-what happened?!\nIt's pitch-black! I can't see!")), VARIANT_DEFAULT(_(" Wh-what's going on?!\nWhy did it turn pitch-black?")), @@ -135,32 +135,32 @@ static const struct ScriptCommand s_gs187_g1_s0_lives0_dlg0[] = { /* 0x8237d1c * MSG_NPC(NPC_SHIFTRY, _(" It's coming!")), TEXTBOX_CLEAR, FANFARE_PLAY2(502), - { 0x27, 0x01, 0x0005, 0x00000002, 0x00000000, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x28, 0x00, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x00, 0x00, 0x00)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_TO(FALSE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x00, 0x00, 0x00)), MSG_NPC(-1, _(" Move aside, you!")), MSG_NPC(-1, _(" He dared to disturb my sleep!")), TEXTBOX_CLEAR, FANFARE_PLAY2(502), - { 0x27, 0x01, 0x0005, 0x00000002, 0x00000000, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x28, 0x00, 0x0005, 0x00000002, 0x00777700, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x00, 0x00, 0x00)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_TO(FALSE, PALUTIL_KIND_05, 2, RGB_U32(0x77, 0x77, 0x00)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x00, 0x00, 0x00)), MSG_NPC(-1, _(" I have no mercy for meddlers!\nAnd that includes you!")), TEXTBOX_CLEAR, - { 0x27, 0x00, 0x0005, 0x00000020, 0x00000000, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 32, RGB_U32(0x00, 0x00, 0x00)), WAIT(32), FANFARE_PLAY2(517), - { 0x28, 0x01, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(32), MSG_OVERHEARD(_("Gyaooooh!")), WAIT(90), TEXTBOX_CLEAR, ALERT_CUE(8), - { 0x27, 0x00, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(64), ALERT_CUE(6), ALERT_CUE(12), diff --git a/src/data/ground/ground_data_d09p03_station.h b/src/data/ground/ground_data_d09p03_station.h index 635db38be..ee304e24f 100644 --- a/src/data/ground/ground_data_d09p03_station.h +++ b/src/data/ground/ground_data_d09p03_station.h @@ -122,11 +122,11 @@ static const struct ScriptCommand s_gs197_g1_s0_lives0_dlg0[] = { /* 0x82498b0 * FANFARE_PLAY2(492), ALERT_CUE(8), ALERT_CUE(9), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x0000000a, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 10, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(10), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x0000000a, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 10, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), TEXTBOX_CLEAR2, ALERT_CUE(6), @@ -177,11 +177,11 @@ static const struct ScriptCommand s_gs197_g1_s0_lives0_dlg0[] = { /* 0x82498b0 * FANFARE_PLAY2(492), ALERT_CUE(8), ALERT_CUE(9), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x0000000a, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 10, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(10), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x0000000a, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 10, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), TEXTBOX_CLEAR2, WAIT(10), diff --git a/src/data/ground/ground_data_d10p03_station.h b/src/data/ground/ground_data_d10p03_station.h index 6935fb444..baa43677d 100644 --- a/src/data/ground/ground_data_d10p03_station.h +++ b/src/data/ground/ground_data_d10p03_station.h @@ -123,11 +123,11 @@ static const struct ScriptCommand s_gs200_g1_s0_lives0_dlg0[] = { /* 0x824fcb4 * TEXTBOX_CLEAR, ALERT_CUE(7), FANFARE_PLAY2(685), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ccccff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00ccccff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), WAIT(4), - { 0x28, 0x00, 0x0005, 0x00000002, 0x00ccccff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00ccccff, NULL }, + FLASH_TO(FALSE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), AWAIT_CUE(5), ALERT_CUE(6), CALL_SCRIPT(NOTICE_FUNC), @@ -140,30 +140,30 @@ static const struct ScriptCommand s_gs200_g1_s0_lives0_dlg0[] = { /* 0x824fcb4 * WAIT(10), ALERT_CUE(7), FANFARE_PLAY2(685), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ccccff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00ccccff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), WAIT(4), - { 0x28, 0x00, 0x0005, 0x00000002, 0x00ccccff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00ccccff, NULL }, + FLASH_TO(FALSE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xCC, 0xCC, 0xFF)), AWAIT_CUE(5), ALERT_CUE(6), CALL_SCRIPT(NOTICE_FUNC), WAIT(15), ALERT_CUE(7), FANFARE_PLAY2(685), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(4), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(4), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(5), BGM_FADEOUT(120), MSG_NPC(-1, _(" Stop it!")), TEXTBOX_CLEAR, BGM_FADEOUT(120), - { 0x27, 0x00, 0x0005, 0x00000028, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 40, RGB_U32(0xFF, 0xFF, 0xFF)), SELECT_ENTITIES(-1, 1), AWAIT_CUE(5), ALERT_CUE(7), diff --git a/src/data/ground/ground_data_d11p03_station.h b/src/data/ground/ground_data_d11p03_station.h index cdfece895..d3fd35a37 100644 --- a/src/data/ground/ground_data_d11p03_station.h +++ b/src/data/ground/ground_data_d11p03_station.h @@ -78,10 +78,10 @@ static const struct ScriptCommand s_gs203_g1_s0_lives0_dlg0[] = { /* 0x82566f8 * TEXTBOX_CLEAR, WAIT(45), FANFARE_PLAY2(506), - { 0x28, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), SELECT_LIVES(-1, 1), - { 0x27, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), BGM_SWITCH(MUS_LEGEND_OF_NINETALES), WAIT(30), ALERT_CUE(7), @@ -406,7 +406,7 @@ static const struct ScriptCommand s_gs203_g2_s0_lives0_dlg0[] = { /* 0x8257ee8 * WALK_RELATIVE(512, 0, 16), WAIT(5), FANFARE_PLAY2(497), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), ALERT_CUE(6), ALERT_CUE(7), ALERT_CUE(8), @@ -419,7 +419,7 @@ static const struct ScriptCommand s_gs203_g2_s0_lives0_dlg0[] = { /* 0x8257ee8 * ALERT_CUE(7), ALERT_CUE(8), ALERT_CUE(9), - { 0x27, 0x00, 0x0005, 0x00000003, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 3, RGB_U32(0xFF, 0xFF, 0xFF)), { 0x62, 0x00, 0x0400, 0x00000040, 0x00000000, NULL }, { 0x62, 0x00, 0x0100, 0x00000010, 0x00000000, NULL }, { 0x62, 0x00, 0x0080, 0x00000008, 0x00000000, NULL }, @@ -430,14 +430,14 @@ static const struct ScriptCommand s_gs203_g2_s0_lives0_dlg0[] = { /* 0x8257ee8 * { 0x54, 0x00, 0x000c, 0x00000000, 0x00000000, NULL }, WALK_RELATIVE(768, -56, 0), FANFARE_PLAY2(497), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0xFF, 0xFF, 0xFF)), CMD_UNK_E5(7, 0), WARP_WAYPOINT(0, 3), { 0x54, 0x00, 0x000b, 0x00000000, 0x00000000, NULL }, SET_DIR_WAIT(DIRECTION_NORTH, 0), CMD_UNK_E5(7, 0), AWAIT_CUE(5), - { 0x27, 0x00, 0x0005, 0x00000003, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 3, RGB_U32(0xFF, 0xFF, 0xFF)), { 0x7e, 0x00, 0x0400, -0x00000020, 0x00000040, NULL }, { 0x7e, 0x00, 0x0100, -0x00000008, 0x00000010, NULL }, { 0x7e, 0x00, 0x0080, -0x00000004, 0x00000008, NULL }, @@ -452,7 +452,7 @@ static const struct ScriptCommand s_gs203_g2_s0_lives0_dlg0[] = { /* 0x8257ee8 * { 0x7e, 0x00, 0x0300, 0x00000018, -0x00000038, NULL }, BGM_FADEOUT(150), FANFARE_PLAY2(506), - { 0x28, 0x00, 0x0005, 0x0000005a, 0x00ffffff, NULL }, + FLASH_TO(FALSE, PALUTIL_KIND_05, 90, RGB_U32(0xFF, 0xFF, 0xFF)), { 0x54, 0x00, 0x0200, 0x00000000, 0x00000000, NULL }, { 0x72, 0x00, 0x005a, 0x00000008, -0x00000018, NULL }, { 0xdf, 0x00, 0x0000, 0x00000000, 0x00000000, NULL }, @@ -677,7 +677,7 @@ static const struct ScriptCommand s_gs203_g3_s0_lives0_dlg0[] = { /* 0x8259658 * FANFARE_PLAY2(466), MSG_NPC(-1, _(" Cease this at once!")), TEXTBOX_CLEAR, - { 0x27, 0x00, 0x0001, 0x0000001e, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_01, 30, RGB_U32(0xFF, 0xFF, 0xFF)), SELECT_ENTITIES(-1, 1), AWAIT_CUE(5), ALERT_CUE(7), diff --git a/src/data/ground/ground_data_d12p04_station.h b/src/data/ground/ground_data_d12p04_station.h index abcd217d7..c8649aeb7 100644 --- a/src/data/ground/ground_data_d12p04_station.h +++ b/src/data/ground/ground_data_d12p04_station.h @@ -58,14 +58,14 @@ static const struct ScriptCommand s_gs206_g1_s0_lives0_dlg0[] = { /* 0x825eb18 * { 0xdf, 0x00, 0x0000, 0x00000000, 0x00000000, NULL }, WAIT(30), FANFARE_PLAY2(493), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(15), FANFARE_PLAY2(493), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), ALERT_CUE(7), WAIT(20), diff --git a/src/data/ground/ground_data_d13p03_station.h b/src/data/ground/ground_data_d13p03_station.h index 11bd45fa2..8c0bbfe2f 100644 --- a/src/data/ground/ground_data_d13p03_station.h +++ b/src/data/ground/ground_data_d13p03_station.h @@ -48,14 +48,14 @@ static const struct ScriptCommand s_gs209_g1_s0_lives0_dlg0[] = { /* 0x826223c * MSG_OVERHEARD(_("Gyaaaaaaaaaaaaaaaah!")), WAIT(30), FANFARE_PLAY2(493), - { 0x28, 0x01, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(20), FANFARE_PLAY2(493), - { 0x28, 0x01, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(120), TEXTBOX_CLEAR2, FANFARE_PLAY2(848), @@ -71,10 +71,10 @@ static const struct ScriptCommand s_gs209_g1_s0_lives0_dlg0[] = { /* 0x826223c * ALERT_CUE(10), CALL_SCRIPT(SHOCK_FUNC), AWAIT_CUE(5), - { 0x28, 0x01, 0x0005, 0x0000001e, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), FANFARE_PLAY2(512), - { 0x27, 0x00, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), { 0x97, 0x00, 0x0002, 0x00000005, 0x00000002, NULL }, WAIT(40), { 0x97, 0x00, 0x0000, 0x00000000, 0x00000000, NULL }, @@ -201,17 +201,17 @@ static const struct ScriptCommand s_gs209_g1_s0_lives4_dlg0[] = { /* 0x8262a4c * FANFARE_PLAY2(774), SELECT_ANIMATION(23), MSG_OVERHEARD(_("Gyaaaaaaaaaaaaaah!")), - { 0x28, 0x01, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(5), - { 0x27, 0x00, 0x0005, 0x00000008, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 8, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), TEXTBOX_CLEAR2, SELECT_ANIMATION(24), STOP_ANIMATION_ON_CURRENT_FRAME, FANFARE_PLAY2(517), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(3), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), SELECT_ANIMATION(25), STOP_ANIMATION_ON_CURRENT_FRAME, ALERT_CUE(5), @@ -234,7 +234,7 @@ static const struct ScriptCommand s_gs209_g2_s0_station_sref_script[] = { /* 0x8 WAIT(15), { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; @@ -399,10 +399,10 @@ static const struct ScriptCommand s_gs209_g3_s0_station_sref_script[] = { /* 0x8 BGM_SWITCH(MUS_RAYQUAZAS_DOMAIN), { 0x97, 0x00, 0x0002, 0x00000005, 0x00000002, NULL }, WAIT(15), - { 0x27, 0x00, 0x0005, 0x00000010, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 16, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), BGM_FADEOUT(60), - { 0x28, 0x01, 0x0005, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(120), TEXTBOX_CLEAR2, TEXTBOX_AUTO_PRESS(-1, -1), diff --git a/src/data/ground/ground_data_d16p01_station.h b/src/data/ground/ground_data_d16p01_station.h index f19004c1b..ce023a182 100644 --- a/src/data/ground/ground_data_d16p01_station.h +++ b/src/data/ground/ground_data_d16p01_station.h @@ -51,14 +51,14 @@ static const struct ScriptCommand s_gs212_g1_s0_lives0_dlg0[] = { /* 0x82649c8 * WAIT(30), FANFARE_PLAY2(497), ALERT_CUE(7), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00fa7d7d, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00fa7d7d, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFA, 0x7D, 0x7D)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFA, 0x7D, 0x7D)), WAIT_FANFARE2(497), WAIT(20), FANFARE_PLAY2(497), ALERT_CUE(7), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00550000, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00550000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x55, 0x00, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x55, 0x00, 0x00)), WAIT_FANFARE2(497), WAIT(20), ALERT_CUE(7), @@ -89,9 +89,9 @@ static const struct ScriptCommand s_gs212_g1_s0_lives0_dlg0[] = { /* 0x82649c8 * SELECT_OBJECTS(1, 1), AWAIT_CUE(5), { 0x54, 0x00, 0x000b, 0x00000000, 0x00000000, NULL }, - { 0x28, 0x01, 0x0005, 0x00000004, 0x00550000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0x55, 0x00, 0x00)), WAIT(1), - { 0x27, 0x01, 0x0005, 0x00000004, 0x00550000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0x55, 0x00, 0x00)), WAIT(10), SELECT_ANIMATION(2), ALERT_CUE(8), @@ -101,12 +101,12 @@ static const struct ScriptCommand s_gs212_g1_s0_lives0_dlg0[] = { /* 0x82649c8 * UPDATE_VARINT(CALC_SET, EVENT_LOCAL, 1), WAIT(10), FANFARE_PLAY2(507), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), UPDATE_VARINT(CALC_SET, EVENT_LOCAL, 0), CANCEL_EFFECTS(1, 0), CANCEL_OBJECTS(1, 1), SELECT_EFFECTS(1, 1), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT_FANFARE2(507), BGM_SWITCH(MUS_IN_THE_DEPTHS_OF_THE_PIT), WAIT(60), diff --git a/src/data/ground/ground_data_d17p01_station.h b/src/data/ground/ground_data_d17p01_station.h index 5de64225e..21543c92b 100644 --- a/src/data/ground/ground_data_d17p01_station.h +++ b/src/data/ground/ground_data_d17p01_station.h @@ -51,14 +51,14 @@ static const struct ScriptCommand s_gs213_g1_s0_lives0_dlg0[] = { /* 0x82657d4 * WAIT(30), FANFARE_PLAY2(497), ALERT_CUE(7), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00707000, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00707000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x70, 0x70, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x70, 0x70, 0x00)), WAIT_FANFARE2(497), WAIT(20), FANFARE_PLAY2(497), ALERT_CUE(7), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00505000, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00505000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x50, 0x50, 0x00)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x50, 0x50, 0x00)), WAIT_FANFARE2(497), WAIT(20), ALERT_CUE(7), @@ -89,10 +89,10 @@ static const struct ScriptCommand s_gs213_g1_s0_lives0_dlg0[] = { /* 0x82657d4 * SELECT_OBJECTS(1, 1), AWAIT_CUE(5), WAIT(10), - { 0x28, 0x00, 0x0005, 0x00000003, 0x00505000, NULL }, + FLASH_TO(FALSE, PALUTIL_KIND_05, 3, RGB_U32(0x50, 0x50, 0x00)), CALL_SCRIPT(JUMP_SURPRISE_FUNC), WAIT(1), - { 0x27, 0x01, 0x0005, 0x00000003, 0x00505000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 3, RGB_U32(0x50, 0x50, 0x00)), ALERT_CUE(8), MSG_INSTANT(_("{CENTER_ALIGN}Raikou's thunderbolt\n{CENTER_ALIGN}electrified the {COLOR GREEN_I}Red Wing{RESET}!")), MSG_INSTANT(_("{CENTER_ALIGN}The {COLOR GREEN_I}Red Wing{RESET}...{WAIT_PRESS}\n{CENTER_ALIGN}transformed into\n{CENTER_ALIGN}the {COLOR GREEN_I}Sunset Wing{RESET}!")), @@ -100,11 +100,11 @@ static const struct ScriptCommand s_gs213_g1_s0_lives0_dlg0[] = { /* 0x82657d4 * UPDATE_VARINT(CALC_SET, EVENT_LOCAL, 1), WAIT(10), FANFARE_PLAY2(507), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), CANCEL_EFFECTS(1, 0), CANCEL_OBJECTS(1, 1), SELECT_EFFECTS(1, 1), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT_FANFARE2(507), BGM_SWITCH(MUS_IN_THE_DEPTHS_OF_THE_PIT), WAIT(60), diff --git a/src/data/ground/ground_data_d18p01_station.h b/src/data/ground/ground_data_d18p01_station.h index f5267cc54..421723527 100644 --- a/src/data/ground/ground_data_d18p01_station.h +++ b/src/data/ground/ground_data_d18p01_station.h @@ -51,14 +51,14 @@ static const struct ScriptCommand s_gs214_g1_s0_lives0_dlg0[] = { /* 0x8266664 * WAIT(30), FANFARE_PLAY2(497), ALERT_CUE(7), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00005077, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00005077, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x00, 0x50, 0x77)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x00, 0x50, 0x77)), WAIT_FANFARE2(497), WAIT(20), FANFARE_PLAY2(497), ALERT_CUE(7), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00005077, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00005077, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x00, 0x50, 0x77)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0x00, 0x50, 0x77)), WAIT_FANFARE2(497), WAIT(20), ALERT_CUE(7), @@ -91,8 +91,8 @@ static const struct ScriptCommand s_gs214_g1_s0_lives0_dlg0[] = { /* 0x8266664 * SELECT_OBJECTS(1, 1), AWAIT_CUE(5), SELECT_ANIMATION(9), - { 0x28, 0x00, 0x0005, 0x00000004, 0x00005077, NULL }, - { 0x27, 0x01, 0x0005, 0x00000004, 0x00005077, NULL }, + FLASH_TO(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0x00, 0x50, 0x77)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0x00, 0x50, 0x77)), ALERT_CUE(8), WAIT(20), SELECT_ANIMATION(2), @@ -102,11 +102,11 @@ static const struct ScriptCommand s_gs214_g1_s0_lives0_dlg0[] = { /* 0x8266664 * UPDATE_VARINT(CALC_SET, EVENT_LOCAL, 1), WAIT(10), FANFARE_PLAY2(507), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), CANCEL_EFFECTS(1, 0), CANCEL_OBJECTS(1, 1), SELECT_EFFECTS(1, 1), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT_FANFARE2(507), BGM_SWITCH(MUS_IN_THE_DEPTHS_OF_THE_PIT), WAIT(60), diff --git a/src/data/ground/ground_data_d20p01_station.h b/src/data/ground/ground_data_d20p01_station.h index c86be1caa..3171a4a01 100644 --- a/src/data/ground/ground_data_d20p01_station.h +++ b/src/data/ground/ground_data_d20p01_station.h @@ -33,9 +33,9 @@ static const struct ScriptCommand s_gs216_g1_s0_station_sref_script[] = { /* 0x8 BGM_SWITCH(MUS_THERES_TROUBLE), { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0002, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_02, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(1), - { 0x28, 0x01, 0x0000, 0x00000000, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_00, 0, RGB_U32(0x00, 0x00, 0x00)), { 0x23, 0x01, 0x0000, 0x00000000, 0x00000000, NULL }, { 0x25, 0x01, 0x0000, 0x00000000, 0x00000000, NULL }, RET, @@ -170,23 +170,23 @@ static const struct ScriptCommand s_gs216_g1_s0_lives0_dlg0[] = { /* 0x8267cc8 * WAIT(60), FANFARE_PLAY2(705), FANFARE_FADEOUT2(60, 453), - { 0x28, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(10), - { 0x27, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), MSG_ON_BG_AUTO(30, _("{CENTER_ALIGN}Created only to fight...")), TEXTBOX_CLEAR, WAIT(10), BGM_STOP, FANFARE_PLAY2(705), - { 0x28, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(10), - { 0x27, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(15), FANFARE_PLAY2(877), - { 0x28, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(10), BGM_SWITCH(MUS_BOSS_BATTLE), - { 0x27, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), { 0x23, 0x01, 0x000a, 0x00000000, 0x00000000, NULL }, TEXTBOX_AUTO_PRESS(120, 120), MSG_ON_BG_AUTO(30, _("{CENTER_ALIGN}The most powerful of all Pokémon!")), @@ -197,7 +197,7 @@ static const struct ScriptCommand s_gs216_g1_s0_lives0_dlg0[] = { /* 0x8267cc8 * ALERT_CUE(8), ALERT_CUE(6), WAIT(60), - { 0x28, 0x01, 0x0005, 0x00000078, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 120, RGB_U32(0xFF, 0xFF, 0xFF)), TEXTBOX_AUTO_PRESS(60, 60), PORTRAIT(PLACEMENT_LEFT_BOTTOM_2, 0x0000, 0x00000003), FANFARE_PLAY2(877), diff --git a/src/data/ground/ground_data_d21p01_station.h b/src/data/ground/ground_data_d21p01_station.h index 7a166e5cb..32579e6ba 100644 --- a/src/data/ground/ground_data_d21p01_station.h +++ b/src/data/ground/ground_data_d21p01_station.h @@ -39,8 +39,8 @@ static const struct ScriptCommand s_gs217_g1_s0_lives0_dlg0[] = { /* 0x8269878 * FANFARE_PLAY2(475), ALERT_CUE(7), WAIT(10), - { 0x28, 0x01, 0x0005, 0x00000005, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0005, 0x00000005, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 5, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT_FANFARE2(475), AWAIT_CUE(5), PORTRAIT(PLACEMENT_RIGHT_MIDTOP_FLIP, 0x0002, 0x00000000), diff --git a/src/data/ground/ground_data_d22p01_station.h b/src/data/ground/ground_data_d22p01_station.h index b12ea5e0a..94990b887 100644 --- a/src/data/ground/ground_data_d22p01_station.h +++ b/src/data/ground/ground_data_d22p01_station.h @@ -23,7 +23,7 @@ static const struct ScriptCommand s_gs218_g1_s0_station_sref_script[] = { /* 0x8 SELECT_MAP(218), SELECT_ENTITIES(-1, 0), AWAIT_CUE(3), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), RET, }; diff --git a/src/data/ground/ground_data_d23p01_station.h b/src/data/ground/ground_data_d23p01_station.h index dcd2b31dd..9295c9d20 100644 --- a/src/data/ground/ground_data_d23p01_station.h +++ b/src/data/ground/ground_data_d23p01_station.h @@ -27,7 +27,7 @@ static const struct ScriptCommand s_gs219_g1_s0_station_sref_script[] = { /* 0x8 { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), BGM_FADEOUT(120), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; diff --git a/src/data/ground/ground_data_d24p01_station.h b/src/data/ground/ground_data_d24p01_station.h index cc68cb7db..9023bcad7 100644 --- a/src/data/ground/ground_data_d24p01_station.h +++ b/src/data/ground/ground_data_d24p01_station.h @@ -82,20 +82,20 @@ static const struct ScriptCommand s_gs220_g1_s0_lives0_dlg0[] = { /* 0x826abb0 * WAIT(60), BGM_STOP, FANFARE_PLAY2(502), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(4), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(20), FANFARE_PLAY2(502), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(4), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), ALERT_CUE(7), WAIT(45), FANFARE_PLAY2(506), - { 0x28, 0x01, 0x0005, 0x0000001e, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), - { 0x27, 0x00, 0x0005, 0x0000001e, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(120), PORTRAIT_REP(0x0002, 0x00000044), MSG_NPC(2, _(" ............")), @@ -179,14 +179,14 @@ static const struct ScriptCommand s_gs220_g1_s0_lives0_dlg0[] = { /* 0x826abb0 * TEXTBOX_CLEAR, WAIT(10), FANFARE_PLAY2(502), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(4), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(20), FANFARE_PLAY2(502), - { 0x28, 0x01, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(4), - { 0x27, 0x00, 0x0005, 0x00000004, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 4, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), ALERT_CUE(7), AWAIT_CUE(5), @@ -313,7 +313,7 @@ static const struct ScriptCommand s_gs220_g2_s0_station_sref_script[] = { /* 0x8 DEBUGINFO_O(313), SELECT_MAP(220), SELECT_ENTITIES(-1, 0), - { 0x27, 0x01, 0x0005, 0x0000005a, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 90, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), { 0x23, 0x01, 0x0078, 0x00000000, 0x00000000, NULL }, WAIT(60), @@ -419,10 +419,10 @@ static const struct ScriptCommand s_gs220_g2_s0_lives0_dlg0[] = { /* 0x826c278 * TEXTBOX_CLEAR, WAIT(10), FANFARE_PLAY2(506), - { 0x28, 0x01, 0x0005, 0x0000001e, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(90), SELECT_ENTITIES(-1, 1), - { 0x27, 0x01, 0x0005, 0x0000001e, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_05, 30, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), FANFARE_PLAY2(465), ALERT_CUE(7), diff --git a/src/data/ground/ground_data_d25p01_station.h b/src/data/ground/ground_data_d25p01_station.h index cb3ab5384..046ca8a08 100644 --- a/src/data/ground/ground_data_d25p01_station.h +++ b/src/data/ground/ground_data_d25p01_station.h @@ -27,7 +27,7 @@ static const struct ScriptCommand s_gs222_g1_s0_station_sref_script[] = { /* 0x8 { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), BGM_FADEOUT(120), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), RET, }; diff --git a/src/data/ground/ground_data_h29p01_station.h b/src/data/ground/ground_data_h29p01_station.h index db59949b1..f28734cca 100644 --- a/src/data/ground/ground_data_h29p01_station.h +++ b/src/data/ground/ground_data_h29p01_station.h @@ -252,24 +252,24 @@ static const struct ScriptCommand s_gs158_g2_s0_lives0_dlg0[] = { /* 0x820d22c * WAIT(60), ALERT_CUE(8), // Moltres attack AWAIT_CUE(5), - { 0x28, 0x01, 0x0001, 0x00000005, 0x00ff1010, NULL }, // Flash to red? + FLASH_TO(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0x10, 0x10)), // Flash to red FANFARE_PLAY2(502), - { 0x27, 0x01, 0x0001, 0x00000005, 0x00ff1010, NULL }, // Flash from red? + FLASH_FROM(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0x10, 0x10)), // Flash from red ALERT_CUE(7), // Zapdos attack AWAIT_CUE(5), - { 0x28, 0x01, 0x0001, 0x00000005, 0x00ffff10, NULL }, // Flash to yellow? + FLASH_TO(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0x10)), // Flash to yellow FANFARE_PLAY2(502), - { 0x27, 0x01, 0x0001, 0x00000005, 0x00ffff10, NULL }, // Flash from yellow? + FLASH_FROM(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0x10)), // Flash from yellow ALERT_CUE(6), // Articuno attack AWAIT_CUE(5), FANFARE_PLAY2(506), - { 0x28, 0x01, 0x0001, 0x00000005, 0x00ffffff, NULL }, // Flash to white? + FLASH_TO(TRUE, PALUTIL_KIND_01, 5, RGB_U32(0xFF, 0xFF, 0xFF)), // Flash to white ALERT_CUE(6), // Articuno something? ALERT_CUE(7), // Zapdos something? ALERT_CUE(8), // Moltres something? ALERT_CUE(10), // Vortex stone or circle? WAIT(60), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, // Flash from white? + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), // Flash from white ALERT_CUE(10), // Vortex stone or circle? AWAIT_CUE(5), WAIT(60), diff --git a/src/data/ground/ground_data_s02_station.h b/src/data/ground/ground_data_s02_station.h index 1425487f9..de60a4098 100644 --- a/src/data/ground/ground_data_s02_station.h +++ b/src/data/ground/ground_data_s02_station.h @@ -60,7 +60,7 @@ static const struct ScriptCommand s_gs224_g3_s0_station_sref_script[] = { /* 0x8 SELECT_ENTITIES(1, 0), SELECT_ENTITIES(-1, 0), BGM_SWITCH(MUS_TITLE_SCREEN), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), SELECT_ENTITIES(-1, 1), SELECT_ENTITIES(-1, 2), AWAIT_CUE(3), diff --git a/src/data/ground/ground_data_s03_station.h b/src/data/ground/ground_data_s03_station.h index 985f53278..7ca4fa67b 100644 --- a/src/data/ground/ground_data_s03_station.h +++ b/src/data/ground/ground_data_s03_station.h @@ -40,7 +40,7 @@ static const struct ScriptCommand s_gs225_g1_s0_station_sref_script[] = { /* 0x8 WAIT(40), { 0x3b, 0x38, 0x0000, 0x00000001, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), { 0xe0, 0x00, 0x0028, 0x00000000, 0x00000000, NULL }, RET, }; diff --git a/src/data/ground/ground_data_t01p01_station.h b/src/data/ground/ground_data_t01p01_station.h index 916343e6a..2c9c937d2 100644 --- a/src/data/ground/ground_data_t01p01_station.h +++ b/src/data/ground/ground_data_t01p01_station.h @@ -2132,10 +2132,10 @@ static const struct ScriptCommand s_gs1_g9_s0_lives0_dlg0[] = { /* 0x813f614 */ MSG_NPC(2, _(" Let's do it!{WAIT_PRESS}\nWigglytuff〜♪ Wigglytuff〜♪{WAIT_PRESS}\nLet's be friends... Taaaaaaah!")), TEXTBOX_CLEAR, FANFARE_PLAY2(603), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), WAIT_FANFARE2(603), FANFARE_PLAY(206), { 0x3b, 0x17, 0x0000, 0x00000000, 0x00000000, NULL }, @@ -2169,10 +2169,10 @@ static const struct ScriptCommand s_gs1_g9_s0_lives0_dlg0[] = { /* 0x813f614 */ MSG_NPC(2, _(" I'm giving it away today!{WAIT_PRESS}\nWigglytuff〜♪ Wigglytuff〜♪{WAIT_PRESS}\nLet's be friends... Taaaaaaah!")), TEXTBOX_CLEAR, FANFARE_PLAY2(603), - { 0x28, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, - { 0x28, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, - { 0x27, 0x01, 0x0005, 0x00000002, 0x00808010, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), + FLASH_TO(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), + FLASH_FROM(TRUE, PALUTIL_KIND_05, 2, RGB_U32(0x80, 0x80, 0x10)), WAIT_FANFARE2(603), FANFARE_PLAY(206), MSG_NPC(2, _(" Congratulations!{WAIT_PRESS}\nYou can go to the {COLOR GREEN_H}Power Plant{RESET} now.")), @@ -3254,10 +3254,10 @@ static const struct ScriptCommand s_gs1_g12_s0_station_sref_script[] = { /* 0x81 SELECT_MAP(1), SELECT_ENTITIES(-1, 0), FANFARE_PLAY(0), - { 0x27, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), FANFARE_STOP(0), - { 0x28, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), RET, }; @@ -10836,7 +10836,7 @@ static const struct ScriptCommand s_gs1_g31_s0_station_sref_script[] = { /* 0x81 BGM_SWITCH(MUS_POKEMON_SQUARE), { 0x22, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, AWAIT_CUE(3), - { 0x28, 0x01, 0x0005, 0x00000014, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_05, 20, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(20), RET, }; @@ -10976,8 +10976,8 @@ static const struct ScriptCommand s_gs1_g31_s0_lives0_dlg0[] = { /* 0x81641b8 */ ALERT_CUE(7), BGM_FADEOUT(30), FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), FANFARE_PLAY2(468), ALERT_CUE(7), @@ -10997,8 +10997,8 @@ static const struct ScriptCommand s_gs1_g31_s0_lives0_dlg0[] = { /* 0x81641b8 */ ALERT_CUE(20), WAIT(60), FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), ALERT_CUE(6), ROTATE_TO(4, DIR_TRANS_10, DIRECTION_EAST), @@ -11022,8 +11022,8 @@ static const struct ScriptCommand s_gs1_g31_s0_lives0_dlg0[] = { /* 0x81641b8 */ ALERT_CUE(20), WAIT(60), FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(60), { 0x2d, 0x09, 0x0009, 0x00000061, 0x00000000, NULL }, ALERT_CUE(6), @@ -11044,8 +11044,8 @@ static const struct ScriptCommand s_gs1_g31_s0_lives0_dlg0[] = { /* 0x81641b8 */ TEXTBOX_CLEAR, WAIT(10), FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), BGM_SWITCH(MUS_WORLD_CALAMITY), { 0x2e, 0x00, 0x0009, -0x00000002, 0x00000000, NULL }, @@ -11519,7 +11519,7 @@ static const struct ScriptCommand s_gs1_g32_s0_station_sref_script[] = { /* 0x81 SELECT_MAP(1), SELECT_ENTITIES(-1, 0), BGM_SWITCH(MUS_WORLD_CALAMITY), - { 0x27, 0x00, 0x0005, 0x00000020, 0x00ffffff, NULL }, + FLASH_FROM(FALSE, PALUTIL_KIND_05, 32, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), { 0x23, 0x01, 0x001e, 0x00000000, 0x00000000, NULL }, RET, @@ -11539,8 +11539,8 @@ static const struct ScriptCommand s_gs1_g32_s0_lives0_dlg0[] = { /* 0x8166c80 */ WAIT(10), { 0x2d, 0x09, 0x0007, 0x0000006c, 0x00000000, NULL }, FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), { 0x2e, 0x00, 0x0009, -0x00000002, 0x00000000, NULL }, MSG_NPC(9, _(" ............{WAIT_PRESS}There is a way.")), @@ -11552,8 +11552,8 @@ static const struct ScriptCommand s_gs1_g32_s0_lives0_dlg0[] = { /* 0x8166c80 */ MSG_NPC(5, _(" {NAME_7}?{WAIT_PRESS}\nWhat might that be?")), TEXTBOX_CLEAR, FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), MSG_NPC(9, _(" A Pokémon, living far above\nus in the sky.\nLegendary, it is.")), MSG_NPC(9, _(" {NAME_7} must be asked\nto destroy the star from the sky.")), @@ -11564,8 +11564,8 @@ static const struct ScriptCommand s_gs1_g32_s0_lives0_dlg0[] = { /* 0x8166c80 */ TEXTBOX_CLEAR, WAIT(10), FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), MSG_NPC(9, _(" {NAME_8} and I\namplify our Teleport together...")), MSG_NPC(9, _(" And send Pokémon to the\nsky.")), @@ -11598,8 +11598,8 @@ static const struct ScriptCommand s_gs1_g32_s0_lives0_dlg0[] = { /* 0x8166c80 */ TEXTBOX_CLEAR, WAIT(10), FANFARE_PLAY2(487), - { 0x28, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, - { 0x27, 0x01, 0x0001, 0x0000000f, 0x00ffffff, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), + FLASH_FROM(TRUE, PALUTIL_KIND_01, 15, RGB_U32(0xFF, 0xFF, 0xFF)), WAIT(30), MSG_NPC(9, _(" {NAME_1}, {NAME_0}.{WAIT_PRESS}\nDo you hear?{WAIT_PRESS} This is {NAME_9}.")), MSG_NPC(9, _(" Discuss we will,\n{NAME_8} and I, about how our\nTeleport can be amplified.")), @@ -14770,7 +14770,7 @@ static const struct ScriptCommand s_gs1_g49_s0_station_sref_script[] = { /* 0x81 DEBUGINFO_O(14770), SELECT_MAP(1), SELECT_ENTITIES(-1, 0), - { 0x27, 0x01, 0x0001, 0x0000003c, 0x00ffffff, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_01, 60, RGB_U32(0xFF, 0xFF, 0xFF)), AWAIT_CUE(3), { 0x23, 0x01, 0x003c, 0x00000000, 0x00000000, NULL }, WAIT(30), diff --git a/src/data/ground/ground_data_t01p02a_station.h b/src/data/ground/ground_data_t01p02a_station.h index 2544af776..451803b1c 100644 --- a/src/data/ground/ground_data_t01p02a_station.h +++ b/src/data/ground/ground_data_t01p02a_station.h @@ -1550,9 +1550,9 @@ static const struct ScriptCommand s_gs2_g18_s0_station_sref_script[] = { /* 0x81 DEBUGINFO_O(1550), SELECT_MAP(2), SELECT_ENTITIES(-1, 0), - { 0x27, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_FROM(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), AWAIT_CUE(3), - { 0x28, 0x01, 0x000e, 0x0000001e, 0x00000000, NULL }, + FLASH_TO(TRUE, PALUTIL_KIND_14, 30, RGB_U32(0x00, 0x00, 0x00)), RET, }; diff --git a/src/ground_bg.c b/src/ground_bg.c index 9bb2a8204..e966f4d92 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -279,10 +279,10 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) rgbPal = bplData; r5 = groundBg->unk52C.unk0 * 16; str2 = (RGB_Array) {0}; - str1.c[0] = 0xff; - str1.c[1] = 0xff; - str1.c[2] = 0xff; - str1.c[3] = 0; + str1.c[RGB_R] = 0xff; + str1.c[RGB_G] = 0xff; + str1.c[RGB_B] = 0xff; + str1.c[RGB_UNK] = 0; for (i = 0; i < bplHeader->numPalettes && i < groundBg->unk52C.unk2; i++) { sub_8003810(r5++, str2); sub_809971C(r5, rgbPal, 15); @@ -479,10 +479,10 @@ void sub_80A3440(GroundBg *groundBg, s32 mapFileId_, const DungeonLocation *dung RGB_Array str0 = {0}; RGB_Array str1; - str1.c[0] = 0xff; - str1.c[1] = 0xff; - str1.c[2] = 0xff; - str1.c[3] = 0; + str1.c[RGB_R] = 0xff; + str1.c[RGB_G] = 0xff; + str1.c[RGB_B] = 0xff; + str1.c[RGB_UNK] = 0; for (i = 0; i < 12 && i < groundBg->unk52C.unk2; i++) { sub_8003810(r7++, str0); diff --git a/src/ground_main.c b/src/ground_main.c index d43358151..edaa01dd7 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -62,12 +62,9 @@ extern void sub_8095494(DungeonMailSeed *param_1, u8 index); // TODO: Move these externs to headers extern bool8 sub_80048BC(void); -extern bool8 sub_8099B94(void); extern void sub_8099768(void); extern void sub_809975C(void); extern void sub_8099BE4(void); -extern void sub_8099744(void); -extern void sub_8099750(void); extern void nullsub_16(void); extern void sub_80060EC(void); extern void sub_809977C(void); diff --git a/src/ground_script.c b/src/ground_script.c index a196a1fd0..250cca8cc 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -57,34 +57,29 @@ #include "code_809D148.h" #include "training_maze.h" #include "dungeon_list_menu.h" - -// Beware of the declarations without specified arguments, returning u32 or s32, these were quickly hacked in to get the code to compile and link -// The return values are almost certainly NOT correct and will need to be rechecked when moving to header files -bool8 sub_8099B94(void); -bool8 sub_80961D8(void); -void ResetMailbox(void); -void sub_80963FC(void); -void sub_8096488(void); -bool8 sub_80964B4(void); -u8 sub_80964E4(); +#include "data_script.h" // For gScriptLocks, gScriptLockConds, gUnlockBranchLabels #define SCRIPT_LOCKS_ARR_COUNT 129 +#define BUF_LEN 0x400 + +#define FAKE_FILENAME "../ground/ground_script.c" + static EWRAM_DATA s16 gCurrentMap = 0; static EWRAM_DATA s16 gUnknown_2039A32 = 0; // See enum "GroundMapID" static EWRAM_DATA s16 gUnknown_2039A34 = 0; // See enum "GroundMapID" static EWRAM_DATA u8 gAnyScriptLocked = 0; // Hard to say why the arrays are larger than SCRIPT_LOCKS_ARR_COUNT. Could be unused EWRAM variables or special case indexes. -static ALIGNED(4) EWRAM_DATA u8 gScriptLocks[SCRIPT_LOCKS_ARR_COUNT + 7] = {0}; -static ALIGNED(4) EWRAM_DATA u8 gScriptLockConds[SCRIPT_LOCKS_ARR_COUNT + 7] = {0}; -static EWRAM_DATA u32 gUnlockBranchLabels[SCRIPT_LOCKS_ARR_COUNT + 1] = {0}; -static EWRAM_DATA MenuItem gChoices[9] = {0}; -static EWRAM_DATA char sPokeNameBuffer[POKEMON_NAME_LENGTH + 2] = {0}; +static ALIGNED(4) EWRAM_DATA u8 gScriptLocks[SCRIPT_LOCKS_ARR_COUNT + 7] = { 0 }; +static ALIGNED(4) EWRAM_DATA u8 gScriptLockConds[SCRIPT_LOCKS_ARR_COUNT + 7] = { 0 }; +static EWRAM_DATA u32 gUnlockBranchLabels[SCRIPT_LOCKS_ARR_COUNT + 1] = { 0 }; +static EWRAM_DATA MenuItem gChoices[9] = { 0 }; +static EWRAM_DATA u8 sPokeNameBuffer[POKEMON_NAME_LENGTH + 2] = { 0 }; static EWRAM_DATA u32 gUnknown_2039DA4 = 0; static EWRAM_DATA u16 gUnknown_2039DA8 = 0; -static EWRAM_INIT int sNumChoices = 0; +static EWRAM_INIT s32 sNumChoices = 0; static EWRAM_INIT u8 *gUnknown_203B4B0 = NULL; static const CallbackData sNullCallbackData = { @@ -111,17 +106,18 @@ static const CallbackData sNullCallbackData = { .func50_spriteRelated = NULL, }; -static const PixelPos sPixelPosZero = {0, 0}; +static const PixelPos sPixelPosZero = { 0, 0 }; static const ScriptCommand gUnknown_81164E4[] = { - {0xF6, 0, 0xC5, 0, 0, "../ground/ground_script.c"}, - {0xEF, 0, 0, 0, 0, NULL}, + DEBUGINFO_O(197), + RET, }; static s32 ExecuteScriptCommand(Action *action); -static s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3); static const ScriptCommand *FindLabel(Action *action, s32 labelNum); static const ScriptCommand *ResolveJump(Action *action, s32 r1); + +static s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3); static void sub_80A2500(s32 param_1, ActionUnkIds *param_2); static void sub_80A252C(s32 param_1, ActionUnkIds *param_2); static void sub_80A2558(s32 param_1, ActionUnkIds *param_2); @@ -132,7 +128,7 @@ static u32 sub_80A25AC(u16 param_1); void sub_809D490(void) { UNUSED void *oldPtr = gUnknown_203B4B0; // Needed to match - gUnknown_203B4B0 = MemoryAlloc(0x400, 6); + gUnknown_203B4B0 = MemoryAlloc(BUF_LEN, 6); sub_809D4B0(); } @@ -556,8 +552,8 @@ s16 HandleAction(Action *action, const DebugLocation *debug) case CMD_BYTE_24: case CMD_BYTE_25: case CMD_BYTE_26: - case CMD_BYTE_27: - case CMD_BYTE_28: + case CMD_BYTE_27: // FLASH_FROM + case CMD_BYTE_28: // FLASH_TO case CMD_BYTE_DF: { if (sub_8099B94()) loopContinue = FALSE; @@ -1940,18 +1936,18 @@ static s32 ExecuteScriptCommand(Action *action) return 2; break; } - case CMD_BYTE_27: - case CMD_BYTE_28: { + case CMD_BYTE_27: // FLASH_FROM + case CMD_BYTE_28: { // FLASH_TO RGB_Array color = { curCmd.arg2 >> 16, curCmd.arg2 >> 8, curCmd.arg2, 0 }; switch (curCmd.op) { - case CMD_BYTE_27: + case CMD_BYTE_27: // FLASH_FROM sub_8099A5C(curCmd.argShort, curCmd.arg1, color); break; - case CMD_BYTE_28: + case CMD_BYTE_28: // FLASH_TO sub_8099AFC(curCmd.argShort, curCmd.arg1, color); break; } - if (curCmd.argByte != 0) + if (curCmd.argByte != FALSE) return 2; break; } @@ -3139,17 +3135,17 @@ static s32 ExecuteScriptCommand(Action *action) case CMD_BYTE_D2: case CMD_BYTE_D3: case CMD_BYTE_D6: { - sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, 0, (s16)curCmd.arg1, out); + sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, SCRIPT_TEXT_TYPE_INSTANT, (s16)curCmd.arg1, out); break; } case CMD_BYTE_D4: case CMD_BYTE_D7: { - sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, 1, (s16)curCmd.arg1, out); + sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, SCRIPT_TEXT_TYPE_QUIET, (s16)curCmd.arg1, out); break; } case CMD_BYTE_D5: case CMD_BYTE_D8: { - sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, 2, (s16)curCmd.arg1, out); + sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, SCRIPT_TEXT_TYPE_NPC, (s16)curCmd.arg1, out); break; } } diff --git a/src/main_loops.c b/src/main_loops.c index 8a4149497..30044e03d 100644 --- a/src/main_loops.c +++ b/src/main_loops.c @@ -31,6 +31,7 @@ #include "memory.h" #include "moves.h" #include "music.h" +#include "palette_util.h" #include "play_time.h" #include "pokemon.h" #include "pokemon_3.h" diff --git a/src/palette_fade_util.c b/src/palette_fade_util.c index a890eeabe..a1a9bcb2c 100644 --- a/src/palette_fade_util.c +++ b/src/palette_fade_util.c @@ -20,7 +20,7 @@ typedef struct PaletteFadeEntry #define MAX_FADE_AMOUNT 256 #define PALETTE_COLOR_COUNT 0x200 -#define PALETTE_FADE_ENTRY_COUNT 0x21 +#define PALETTE_FADE_ENTRY_COUNT 33 static IWRAM_DATA RGB_Union sRGBPaletteBuffer[PALETTE_COLOR_COUNT] = {0}; static IWRAM_DATA PaletteFadeEntry sPaletteFadeTable[PALETTE_FADE_ENTRY_COUNT] = {0}; @@ -64,21 +64,21 @@ void InitPaletteFadeTable(void) for (i = 0; i < PALETTE_COLOR_COUNT; it2++, i++) { - it2->asArr.c[0] = zero; - it2->asArr.c[1] = zero; - it2->asArr.c[2] = zero; - it2->asArr.c[3] = zero; + it2->asArr.c[RGB_R] = zero; + it2->asArr.c[RGB_G] = zero; + it2->asArr.c[RGB_B] = zero; + it2->asArr.c[RGB_UNK] = zero; } for (i = 0; i < PALETTE_FADE_ENTRY_COUNT; i++, it1++) { it1->active = FALSE; it1->fadeAmount = 256; - it1->fadeColor.c[0] = 0; - it1->fadeColor.c[1] = 0; - it1->fadeColor.c[2] = 0; - it1->fadeColor.c[3] = 0; - it1->fadeColorArray = 0; + it1->fadeColor.c[RGB_R] = 0; + it1->fadeColor.c[RGB_G] = 0; + it1->fadeColor.c[RGB_B] = 0; + it1->fadeColor.c[RGB_UNK] = 0; + it1->fadeColorArray = NULL; it1->applyFadeToSingle = &ApplySinglePalette; it1->applyFadeToRow = &ApplyRowPalette; } @@ -92,11 +92,11 @@ void SetPaletteFade_Brightness(u16 idx, s32 fadeAmount) ptr->active = TRUE; ptr->fadeAmount = fadeAmount; - ptr->fadeColor.c[0] = 0; - ptr->fadeColor.c[1] = 0; - ptr->fadeColor.c[2] = 0; - ptr->fadeColor.c[3] = 0; - ptr->fadeColorArray = 0; + ptr->fadeColor.c[RGB_R] = 0; + ptr->fadeColor.c[RGB_G] = 0; + ptr->fadeColor.c[RGB_B] = 0; + ptr->fadeColor.c[RGB_UNK] = 0; + ptr->fadeColorArray = NULL; ptr->applyFadeToSingle = &ApplySinglePaletteBrightness; ptr->applyFadeToRow = &ApplyRowPaletteBrightness; @@ -110,7 +110,7 @@ void SetPaletteFade_Blend(u16 idx, s32 fadeAmount, RGB_Array param_3) ptr->active = TRUE; ptr->fadeAmount = fadeAmount; ptr->fadeColor = param_3; - ptr->fadeColorArray = 0; + ptr->fadeColorArray = NULL; ptr->applyFadeToSingle = &BlendSinglePalette; ptr->applyFadeToRow = &BlendRowPalette; @@ -124,7 +124,7 @@ void SetPaletteFade_FadeToBlack(u16 idx, s32 fadeAmount, RGB_Array param_3) ptr->active = TRUE; ptr->fadeAmount = fadeAmount; ptr->fadeColor = param_3; - ptr->fadeColorArray = 0; + ptr->fadeColorArray = NULL; ptr->applyFadeToSingle = &FadeToBlackSingle; ptr->applyFadeToRow = &FadeToBlackRow; @@ -137,10 +137,10 @@ static UNUSED void SetPaletteFade_PerEntryBlend(u16 idx, s32 fadeAmount, RGB_Arr ptr->active = TRUE; ptr->fadeAmount = fadeAmount; - ptr->fadeColor.c[0] = 0; - ptr->fadeColor.c[1] = 0; - ptr->fadeColor.c[2] = 0; - ptr->fadeColor.c[3] = 0; + ptr->fadeColor.c[RGB_R] = 0; + ptr->fadeColor.c[RGB_G] = 0; + ptr->fadeColor.c[RGB_B] = 0; + ptr->fadeColor.c[RGB_UNK] = 0; ptr->fadeColorArray = param_3; ptr->applyFadeToSingle = &PerEntryBlendSingle; ptr->applyFadeToRow = &PerEntryBlendRow; @@ -155,7 +155,7 @@ void SetPaletteFade_Desaturate(u16 idx, s32 fadeAmount, RGB_Array param_3) ptr->active = TRUE; ptr->fadeAmount = fadeAmount; ptr->fadeColor = param_3; - ptr->fadeColorArray = 0; + ptr->fadeColorArray = NULL; ptr->applyFadeToSingle = &DesaturateSingle; ptr->applyFadeToRow = &DesaturateRow; @@ -169,7 +169,7 @@ void SetPaletteFade_Modulate(u16 idx, s32 fadeAmount, RGB_Array param_3) ptr->active = TRUE; ptr->fadeAmount = fadeAmount; ptr->fadeColor = param_3; - ptr->fadeColorArray = 0; + ptr->fadeColorArray = NULL; ptr->applyFadeToSingle = &ModulatePaletteSingle; ptr->applyFadeToRow = &ModulatePaletteRow; diff --git a/src/palette_util.c b/src/palette_util.c index 116dfc7ba..926d28d1e 100644 --- a/src/palette_util.c +++ b/src/palette_util.c @@ -4,36 +4,47 @@ #include "bg_palette_buffer.h" #include "palette_fade_util.h" -extern void TransferBGPaletteBuffer(void); - -struct UnkStruct_2039958 +enum PU_SomeStateID { - s32 unk0; - s16 unk4; - s16 unk6; - u16 unk8; - u16 unkA; - u16 unkC; + PU_SOMESTATE_0, + PU_SOMESTATE_1, + PU_SOMESTATE_2, + PU_SOMESTATE_3, + PU_SOMESTATE_4, + PU_SOMESTATE_5, }; -struct UnkStruct_2039978 -{ - u32 unk0; - RGB_Array unk4; - struct UnkStruct_2039958 unk8; -}; +#define ARR_COUNT_2039998 33 -static EWRAM_DATA struct UnkStruct_2039958 gUnknown_2039958 = {0}; -static EWRAM_DATA struct UnkStruct_2039958 gUnknown_2039968 = {0}; -static EWRAM_DATA struct UnkStruct_2039978 gUnknown_2039978 = {0}; -static EWRAM_DATA u8 gUnknown_2039990 = FALSE; +// Size: R=0x10 | B=0xE +typedef struct UnkStruct_2039958 +{ + /* 0x0 */ s32 unk0; // See enum "PU_SomeStateID" + /* 0x4 */ s16 unk4; + /* 0x6 */ s16 unk6; + /* 0x8 */ u16 unk8; + /* 0xA */ u16 unkA; + /* 0xC */ u16 unkC; +} UnkStruct_2039958; + +// Size: R=0x18 | B=16 +typedef struct UnkStruct_2039978 +{ + /* 0x0 */ u32 unk0; // See enum "PaletteUtilUnk0Kind" + /* 0x4 */ RGB_Array unk4; + /* 0x8 */ UnkStruct_2039958 unk8; +} UnkStruct_2039978; + +static EWRAM_DATA UnkStruct_2039958 gUnknown_2039958 = { 0 }; +static EWRAM_DATA UnkStruct_2039958 gUnknown_2039968 = { 0 }; +static EWRAM_DATA UnkStruct_2039978 gUnknown_2039978 = { 0 }; +static EWRAM_DATA bool8 gUnknown_2039990 = FALSE; static EWRAM_DATA s16 gUnknown_2039992 = 0; UNUSED static EWRAM_DATA s32 sUnused = 0; -#define ARR_COUNT_2039998 33 -static EWRAM_DATA u16 gUnknown_2039998[ARR_COUNT_2039998] = {0}; +static EWRAM_DATA u16 gUnknown_2039998[ARR_COUNT_2039998] = { 0 }; -static void sub_8099838(struct UnkStruct_2039958 *a0); -static void sub_8099848(struct UnkStruct_2039958 *a0); +static void sub_8099838(UnkStruct_2039958 *a0); +static void sub_8099848(UnkStruct_2039958 *a0); static void sub_8099DD0(u16 a0); static void sub_8099E58(u16 a0); static void sub_8099E80(u16 a0, RGB_Array a1); @@ -69,12 +80,13 @@ void sub_809977C(void) sub_8099838(&gUnknown_2039958); sub_8099838(&gUnknown_2039968); sub_8099838(&gUnknown_2039978.unk8); - gUnknown_2039978.unk0 = 0; + gUnknown_2039978.unk0 = PALUTIL_KIND_00; gUnknown_2039978.unk8.unkC = 0x100; gUnknown_2039958.unkC = 0; sub_8099DD0(0); gUnknown_2039968.unkC = 0x100; sub_8099E58(0x100); + for (i = 0; i < ARR_COUNT_2039998; i++) { gUnknown_2039998[i] = 0; } @@ -93,75 +105,75 @@ UNUSED static u32 sub_8099828(u16 a0) return gUnknown_2039998[a0]; } -static void sub_8099838(struct UnkStruct_2039958 *a0) +static void sub_8099838(UnkStruct_2039958 *a0) { - a0->unk0 = 1; + a0->unk0 = PU_SOMESTATE_1; a0->unkC = 0; a0->unk4 = 0; a0->unk6 = 0; } -static void sub_8099848(struct UnkStruct_2039958 *a0) +static void sub_8099848(UnkStruct_2039958 *a0) { - if (a0->unk0 == 0) { - a0->unk0 = 1; - } + if (a0->unk0 == PU_SOMESTATE_0) + a0->unk0 = PU_SOMESTATE_1; } -static void sub_809985C(struct UnkStruct_2039958 *a0, s32 a1) +static void sub_809985C(UnkStruct_2039958 *a0, s32 a1) { if (a1 >= 0) { if (a1 == 0) { a0->unkC = 0x100; - a0->unk0 = 1; + a0->unk0 = PU_SOMESTATE_1; } else { - a0->unk0 = 2; + a0->unk0 = PU_SOMESTATE_2; } } else { a1 = 30; - a0->unk0 = 2; + a0->unk0 = PU_SOMESTATE_2; } a0->unk4 = a1; a0->unk6 = a1; } -static void sub_8099880(struct UnkStruct_2039958 *a0, s32 a1) +static void sub_8099880(UnkStruct_2039958 *a0, s32 a1) { if (a1 >= 0) { if (a1 == 0) { a0->unkC = a1; - a0->unk0 = 1; + a0->unk0 = PU_SOMESTATE_1; } else { - a0->unk0 = 3; + a0->unk0 = PU_SOMESTATE_3; } } else { a1 = 30; - a0->unk0 = 3; + a0->unk0 = PU_SOMESTATE_3; } a0->unk4 = a1; a0->unk6 = a1; } -static void sub_80998A0(struct UnkStruct_2039958 *a0, s32 a1, u16 a2, u16 a3) +static void sub_80998A0(UnkStruct_2039958 *a0, s32 a1, u16 a2, u16 a3) { - if (a1 < 0) a1 = 30; + if (a1 < 0) + a1 = 30; if (a2 > a3) { - a0->unk0 = 5; + a0->unk0 = PU_SOMESTATE_5; a0->unkA = a2 - a3; } else if (a2 < a3) { - a0->unk0 = 4; + a0->unk0 = PU_SOMESTATE_4; a0->unkA = a3 - a2; } else { - a0->unk0 = 1; + a0->unk0 = PU_SOMESTATE_1; a0->unkA = 0; } @@ -171,15 +183,15 @@ static void sub_80998A0(struct UnkStruct_2039958 *a0, s32 a1, u16 a2, u16 a3) a0->unk8 = a3; } -static bool8 sub_80998E0(struct UnkStruct_2039958 *a0) +static bool8 sub_80998E0(UnkStruct_2039958 *a0) { switch (a0->unk0) { - case 0: + case PU_SOMESTATE_0: break; - case 1: - a0->unk0 = 0; + case PU_SOMESTATE_1: + a0->unk0 = PU_SOMESTATE_0; return TRUE; - case 2: + case PU_SOMESTATE_2: if (--a0->unk4 > 0) { u16 var = 0x100 - ((a0->unk4 << 8) / a0->unk6); if (a0->unkC < var) { @@ -188,10 +200,10 @@ static bool8 sub_80998E0(struct UnkStruct_2039958 *a0) } else { a0->unkC = 0x100; - a0->unk0 = 0; + a0->unk0 = PU_SOMESTATE_0; } return TRUE; - case 3: + case PU_SOMESTATE_3: if (--a0->unk4 > 0) { u16 var = (a0->unk4 << 8) / a0->unk6; if (a0->unkC > var) { @@ -200,25 +212,25 @@ static bool8 sub_80998E0(struct UnkStruct_2039958 *a0) } else { a0->unkC = 0; - a0->unk0 = 0; + a0->unk0 = PU_SOMESTATE_0; } return TRUE; - case 4: + case PU_SOMESTATE_4: if (--a0->unk4 > 0) { a0->unkC = a0->unk8 - ((a0->unk4 * a0->unkA) / a0->unk6); } else { a0->unkC = a0->unk8; - a0->unk0 = 0; + a0->unk0 = PU_SOMESTATE_0; } return TRUE; - case 5: + case PU_SOMESTATE_5: if (--a0->unk4 > 0) { a0->unkC = a0->unk8 + ((a0->unk4 * a0->unkA) / a0->unk6); } else { a0->unkC = a0->unk8; - a0->unk0 = 0; + a0->unk0 = PU_SOMESTATE_0; } return TRUE; } @@ -257,53 +269,53 @@ void sub_8099A48(s32 a0) sub_8099880(&gUnknown_2039968, a0); } -void sub_8099A5C(s32 a0, s32 a1, RGB_Array a2) +void sub_8099A5C(s32 kind, s32 a1, RGB_Array a2) { - gUnknown_2039978.unk0 = a0; + gUnknown_2039978.unk0 = kind; gUnknown_2039978.unk4 = a2; gUnknown_2039978.unk8.unkC = 0; sub_809985C(&gUnknown_2039978.unk8, a1); - switch (a0) { - case 1: - case 3: + switch (kind) { + case PALUTIL_KIND_01: + case PALUTIL_KIND_03: gUnknown_2039968.unkC = 0x100; gUnknown_2039958.unkC = 0x100; break; - case 9: - case 11: + case PALUTIL_KIND_09: + case PALUTIL_KIND_11: gUnknown_2039968.unkC = 0x100; break; - case 5: - case 7: - case 13: - case 14: + case PALUTIL_KIND_05: + case PALUTIL_KIND_07: + case PALUTIL_KIND_13: + case PALUTIL_KIND_14: gUnknown_2039958.unkC = 0x100; break; } } -void sub_8099AFC(s32 a0, s32 a1, RGB_Array a2) +void sub_8099AFC(s32 kind, s32 a1, RGB_Array a2) { - gUnknown_2039978.unk0 = a0; + gUnknown_2039978.unk0 = kind; gUnknown_2039978.unk4 = a2; gUnknown_2039978.unk8.unkC = 0x100; sub_8099880(&gUnknown_2039978.unk8, a1); - switch (a0) { - case 2: - case 4: + switch (kind) { + case PALUTIL_KIND_02: + case PALUTIL_KIND_04: gUnknown_2039968.unkC = 0; gUnknown_2039958.unkC = 0; break; - case 10: - case 12: + case PALUTIL_KIND_10: + case PALUTIL_KIND_12: gUnknown_2039968.unkC = 0; break; - case 6: - case 8: - case 13: - case 14: + case PALUTIL_KIND_06: + case PALUTIL_KIND_08: + case PALUTIL_KIND_13: + case PALUTIL_KIND_14: gUnknown_2039958.unkC = 0; break; } @@ -313,58 +325,71 @@ bool8 sub_8099B94(void) { if (gUnknown_2039990) return TRUE; - if (gUnknown_2039978.unk0 != 0) { - return (gUnknown_2039978.unk8.unk0 != 0); - } - return (gUnknown_2039958.unk0 != 0 || gUnknown_2039968.unk0 != 0); + + if (gUnknown_2039978.unk0 != PALUTIL_KIND_00) + return (gUnknown_2039978.unk8.unk0 != PU_SOMESTATE_0); + + return (gUnknown_2039958.unk0 != PU_SOMESTATE_0 || gUnknown_2039968.unk0 != PU_SOMESTATE_0); } void sub_8099BE4(void) { - if (gUnknown_2039978.unk0 != 0 || gUnknown_2039978.unk8.unk0 != 0) { + if (gUnknown_2039978.unk0 != PALUTIL_KIND_00 || gUnknown_2039978.unk8.unk0 != PU_SOMESTATE_0) { if (sub_80998E0(&gUnknown_2039978.unk8)) { sub_8099E80(gUnknown_2039978.unk8.unkC, gUnknown_2039978.unk4); } - else if (gUnknown_2039978.unk8.unk0 == 0) { + else if (gUnknown_2039978.unk8.unk0 == PU_SOMESTATE_0) { switch (gUnknown_2039978.unk0) { - case 0: + case PALUTIL_KIND_00: break; - case 1: - case 3: - case 5: - case 7: - case 9: - case 11: - if (gUnknown_2039978.unk8.unkC >= 256) { - gUnknown_2039978.unk0 = 0; + case PALUTIL_KIND_01: + case PALUTIL_KIND_03: + case PALUTIL_KIND_05: + case PALUTIL_KIND_07: + case PALUTIL_KIND_09: + case PALUTIL_KIND_11: + if (gUnknown_2039978.unk8.unkC >= 0x100) { + gUnknown_2039978.unk0 = PALUTIL_KIND_00; } else if (gUnknown_2039990) { - s32 var = 0; + s32 kind = PALUTIL_KIND_00; + switch (gUnknown_2039978.unk0) { - case 1: var = 2; break; - case 3: var = 4; break; - case 5: var = 6; break; - case 7: var = 8; break; + case PALUTIL_KIND_01: { + kind = PALUTIL_KIND_02; + break; + } + case PALUTIL_KIND_03: { + kind = PALUTIL_KIND_04; + break; + } + case PALUTIL_KIND_05: { + kind = PALUTIL_KIND_06; + break; + } + case PALUTIL_KIND_07: { + kind = PALUTIL_KIND_08; + break; + } } - if (var != 0) { - sub_8099AFC(var, gUnknown_2039992, gUnknown_2039978.unk4); - } - else { - gUnknown_2039978.unk0 = 0; - } + if (kind != PALUTIL_KIND_00) + sub_8099AFC(kind, gUnknown_2039992, gUnknown_2039978.unk4); + else + gUnknown_2039978.unk0 = PALUTIL_KIND_00; + } break; - case 2: - case 4: - case 6: - case 8: - case 10: - case 12: - case 13: - case 14: + case PALUTIL_KIND_02: + case PALUTIL_KIND_04: + case PALUTIL_KIND_06: + case PALUTIL_KIND_08: + case PALUTIL_KIND_10: + case PALUTIL_KIND_12: + case PALUTIL_KIND_13: + case PALUTIL_KIND_14: if (gUnknown_2039978.unk8.unkC == 0) { - gUnknown_2039978.unk0 = 0; + gUnknown_2039978.unk0 = PALUTIL_KIND_00; } else if (gUnknown_2039990) { sub_8099AFC(gUnknown_2039978.unk0, gUnknown_2039992, gUnknown_2039978.unk4); @@ -375,18 +400,18 @@ void sub_8099BE4(void) } else if (gUnknown_2039990) { bool8 r5 = TRUE; - if (gUnknown_2039958.unkC != 0 || gUnknown_2039958.unk0 != 0) { + if (gUnknown_2039958.unkC != 0 || gUnknown_2039958.unk0 != PU_SOMESTATE_0) { r5 = FALSE; - if (gUnknown_2039958.unk0 != 3) { + if (gUnknown_2039958.unk0 != PU_SOMESTATE_3) { sub_8099880(&gUnknown_2039958, gUnknown_2039992); } if (sub_80998E0(&gUnknown_2039958)) { sub_8099DD0(gUnknown_2039958.unkC); } } - if (gUnknown_2039968.unkC != 0 || gUnknown_2039968.unk0 != 0) { + if (gUnknown_2039968.unkC != 0 || gUnknown_2039968.unk0 != PU_SOMESTATE_0) { r5 = FALSE; - if (gUnknown_2039968.unk0 != 3) { + if (gUnknown_2039968.unk0 != PU_SOMESTATE_3) { sub_8099880(&gUnknown_2039968, gUnknown_2039992); } if (sub_80998E0(&gUnknown_2039968)) { @@ -445,270 +470,272 @@ static void sub_8099E80(u16 param_1,RGB_Array param_2) s32 i; switch (gUnknown_2039978.unk0) { - case 0: + case PALUTIL_KIND_00: break; - case 1: + case PALUTIL_KIND_01: for (i = 0; i < 16; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Blend(i,param_1,param_2); + SetPaletteFade_Blend(i, param_1, param_2); } } for (i = 16; i < 32; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Blend(i,param_1,param_2); + SetPaletteFade_Blend(i, param_1, param_2); } } break; - case 9: + case PALUTIL_KIND_09: for (i = 14; i < 16; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Blend(i,param_1,param_2); + SetPaletteFade_Blend(i, param_1, param_2); } } for (i = 31; i < 32; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Blend(i,param_1,param_2); + SetPaletteFade_Blend(i, param_1, param_2); } } break; - case 5: + case PALUTIL_KIND_05: for (i = 0; i < 14; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Blend(i,param_1,param_2); + SetPaletteFade_Blend(i, param_1, param_2); } } for (i = 16; i < 31; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Blend(i,param_1,param_2); + SetPaletteFade_Blend(i, param_1, param_2); } } break; - case 2: + case PALUTIL_KIND_02: for (i = 0; i < 16; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_FadeToBlack(i,param_1,param_2); + SetPaletteFade_FadeToBlack(i, param_1, param_2); } } for (i = 16; i < 32; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_FadeToBlack(i,param_1,param_2); + SetPaletteFade_FadeToBlack(i, param_1, param_2); } } break; - case 10: + case PALUTIL_KIND_10: for (i = 14; i < 16; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_FadeToBlack(i,param_1,param_2); + SetPaletteFade_FadeToBlack(i, param_1, param_2); } } for (i = 31; i < 32; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_FadeToBlack(i,param_1,param_2); + SetPaletteFade_FadeToBlack(i, param_1, param_2); } } break; - case 6: + case PALUTIL_KIND_06: for (i = 0; i < 14; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_FadeToBlack(i,param_1,param_2); + SetPaletteFade_FadeToBlack(i, param_1, param_2); } } for (i = 16; i < 31; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_FadeToBlack(i,param_1,param_2); + SetPaletteFade_FadeToBlack(i, param_1, param_2); } } break; - case 3: + case PALUTIL_KIND_03: for (i = 0; i < 16; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Desaturate(i,param_1,param_2); + SetPaletteFade_Desaturate(i, param_1, param_2); } } for (i = 16; i < 32; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Desaturate(i,param_1,param_2); + SetPaletteFade_Desaturate(i, param_1, param_2); } } break; - case 11: + case PALUTIL_KIND_11: for (i = 14; i < 16; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Desaturate(i,param_1,param_2); + SetPaletteFade_Desaturate(i, param_1, param_2); } } for (i = 31; i < 32; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Desaturate(i,param_1,param_2); + SetPaletteFade_Desaturate(i, param_1, param_2); } } break; - case 7: + case PALUTIL_KIND_07: for (i = 0; i < 14; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Desaturate(i,param_1,param_2); + SetPaletteFade_Desaturate(i, param_1, param_2); } } for (i = 16; i < 31; i++) { if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else { - SetPaletteFade_Desaturate(i,param_1,param_2); + SetPaletteFade_Desaturate(i, param_1, param_2); } } break; - case 4: + case PALUTIL_KIND_04: for (i = 0; i < 16; i ++) { if (gUnknown_2039998[i] & 1) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else if (gUnknown_2039998[i] & 2) { SetPaletteFade_Brightness(i,param_1); } else { - SetPaletteFade_Modulate(i,param_1,param_2); + SetPaletteFade_Modulate(i, param_1, param_2); } } for (i = 16; i < 32; i ++) { if (gUnknown_2039998[i] & 1) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else if (gUnknown_2039998[i] & 2) { SetPaletteFade_Brightness(i,param_1); } else { - SetPaletteFade_Modulate(i,param_1,param_2); + SetPaletteFade_Modulate(i, param_1, param_2); } } break; - case 12: + case PALUTIL_KIND_12: for (i = 14; i < 16; i ++) { if (gUnknown_2039998[i] & 1) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else if (gUnknown_2039998[i] & 2) { SetPaletteFade_Brightness(i,param_1); } else { - SetPaletteFade_Modulate(i,param_1,param_2); + SetPaletteFade_Modulate(i, param_1, param_2); } } for (i = 31; i < 32; i ++) { if (gUnknown_2039998[i] & 1) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else if (gUnknown_2039998[i] & 2) { SetPaletteFade_Brightness(i,param_1); } else { - SetPaletteFade_Modulate(i,param_1,param_2); + SetPaletteFade_Modulate(i, param_1, param_2); } } break; - case 13: - case 14: + case PALUTIL_KIND_13: + case PALUTIL_KIND_14: { switch (gUnknown_2039978.unk0) { - case 13: - param_2.c[0] = 0x90; - param_2.c[1] = 0x90; - param_2.c[2] = 0xFF; - param_2.c[3] = 0xFF; + case PALUTIL_KIND_13: + param_2.c[RGB_R] = 0x90; + param_2.c[RGB_G] = 0x90; + param_2.c[RGB_B] = 0xFF; + param_2.c[RGB_UNK] = 0xFF; break; - case 14: - param_2.c[0] = 0xFF; - param_2.c[1] = 0xC0; - param_2.c[2] = 0x80; - param_2.c[3] = 0xFF; + case PALUTIL_KIND_14: + param_2.c[RGB_R] = 0xFF; + param_2.c[RGB_G] = 0xC0; + param_2.c[RGB_B] = 0x80; + param_2.c[RGB_UNK] = 0xFF; break; } - // NOTE: fallthrough needed here - case 8: + // Fallthrough + } + case PALUTIL_KIND_08: { for (i = 0; i < 14; i ++) { if (gUnknown_2039998[i] & 1) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,param_1); + SetPaletteFade_Brightness(i, param_1); } else { - SetPaletteFade_Modulate(i,param_1,param_2); + SetPaletteFade_Modulate(i, param_1, param_2); } } for (i = 16; i < 31; i ++) { if (gUnknown_2039998[i] & 1) { - SetPaletteFade_Brightness(i,0x100); + SetPaletteFade_Brightness(i, 0x100); } else if (gUnknown_2039998[i] & 2) { - SetPaletteFade_Brightness(i,param_1); + SetPaletteFade_Brightness(i, param_1); } else { - SetPaletteFade_Modulate(i,param_1,param_2); + SetPaletteFade_Modulate(i, param_1, param_2); } } break; + } } } diff --git a/src/wigglytuff_shop3.c b/src/wigglytuff_shop3.c index 0d9863480..93522045e 100644 --- a/src/wigglytuff_shop3.c +++ b/src/wigglytuff_shop3.c @@ -10,6 +10,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" +#include "palette_util.h" #include "pokemon.h" #include "string_format.h" #include "text_1.h" @@ -565,11 +566,11 @@ static void sub_80226F0(void) switch (sWigglytuffShop3Work->unk130) { case 1: case 3: - sub_8099AFC(5, 2, unkStr); + sub_8099AFC(PALUTIL_KIND_05, 2, unkStr); break; case 2: case 4: - sub_8099A5C(5, 2, unkStr); + sub_8099A5C(PALUTIL_KIND_05, 2, unkStr); break; case 0: default: