diff --git a/assets/xml/interface/schedule_static.xml b/assets/xml/interface/schedule_static.xml new file mode 100644 index 0000000000..68b097d51b --- /dev/null +++ b/assets/xml/interface/schedule_static.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/PR/gbi.h b/include/PR/gbi.h index 3ba8748b0b..1b57c6a34c 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -4699,7 +4699,7 @@ _DW({ \ /* like gSPTextureRectangle but accepts negative position arguments */ #define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ -{ \ +_DW({ \ Gfx *_g = (Gfx *)(pkt); \ \ _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | \ @@ -4723,7 +4723,7 @@ _DW({ \ 0, 16))); \ gImmp1(pkt, G_RDPHALF_2, (_SHIFTL((dsdx), 16, 16) | \ _SHIFTL((dtdy), 0, 16))); \ -} +}) #define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ diff --git a/include/functions.h b/include/functions.h index 626bfc261f..04f6dfb732 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1695,7 +1695,7 @@ void func_801514B0(PlayState* play, u16 arg1, u8 arg2); void Message_StartTextbox(PlayState* play, u16 textId, Actor* Actor); void Message_ContinueTextbox(PlayState* play, u16 textId); void func_80151A68(PlayState* play, u16 textId); -void func_80151BB4(PlayState* play, u8 arg1); +void Message_BombersNotebookQueueEvent(PlayState* play, u8 event); // void func_80151C9C(void); void func_80151DA4(PlayState* play, u16 arg2); void func_80152434(PlayState* play, u16 arg2); @@ -1825,19 +1825,6 @@ void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId); void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); void Play_Init(GameState* thisx); -// void func_8016AC10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); -// void func_8016AE1C(void); -// void func_8016B278(void); -// void func_8016B4B0(void); -// void func_8016C344(void); -// void func_8016CD4C(void); -// void func_8016E40C(void); -// void func_8016EA90(void); -void BombersNotebook_Draw(BombersNotebook* this, GraphicsContext* gfxCtx); -// void func_8016F4EC(void); -void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input); -void BombersNotebook_Init(BombersNotebook* this); -void BombersNotebook_Destroy(BombersNotebook* this); void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg); void PreRender_Init(PreRender* this); void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf); diff --git a/include/macros.h b/include/macros.h index 9f2305e012..d2b98dec5a 100644 --- a/include/macros.h +++ b/include/macros.h @@ -34,6 +34,7 @@ #define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60)) #define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1)) +#define CLOCK_TIME_HOUR (CLOCK_TIME(1, 0)) #define DAY_LENGTH (CLOCK_TIME(24, 0)) #define TIME_TO_HOURS_F(time) ((time) * (24.0f / 0x10000)) @@ -44,6 +45,7 @@ #define CLOCK_TIME_F(hr, min) (((hr) * 60.0f + (min)) * (0x10000 / (24.0f * 60.0f))) #define CLOCK_TIME_ALT_F(hr, min) (((hr) * 60.0f + (min)) / (24.0f * 60.0f / 0x10000)) #define CLOCK_TIME_ALT2_F(hr, min) ((((hr) + (min) / 60.0f) * 60.0f) / (24.0f * 60.0f / 0x10000)) +#define CLOCK_TIME_HOUR_F (CLOCK_TIME_F(1, 0)) #define CAPACITY(upg, value) gUpgradeCapacities[upg][value] #define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg)) diff --git a/include/segment_symbols.h b/include/segment_symbols.h index a8e88e794c..d7c959d232 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -57,6 +57,7 @@ DECLARE_ROM_SEGMENT(icon_item_static_old) DECLARE_ROM_SEGMENT(icon_item_24_static_test) DECLARE_ROM_SEGMENT(icon_item_24_static_old) DECLARE_ROM_SEGMENT(schedule_dma_static_test) +DECLARE_ROM_SEGMENT(schedule_dma_static_old) DECLARE_ROM_SEGMENT(schedule_static) DECLARE_ROM_SEGMENT(story_static) DECLARE_ROM_SEGMENT(do_action_static) diff --git a/include/tables/bombers_notebook/event_table.h b/include/tables/bombers_notebook/event_table.h new file mode 100644 index 0000000000..161269a7e9 --- /dev/null +++ b/include/tables/bombers_notebook/event_table.h @@ -0,0 +1,48 @@ +/** + * Bombers Notebook Event Table + * + * DEFINE_EVENT should be used for events in the notebook + * - Argument 0: Enum value for the event + * - Argument 1: Icon to use (see BombersNotebookEventIcon) + * - Argument 2: WeekEventFlag that updates the icons color + * - Argument 3: Message id for the description of this event + * - Argument 4: Message id for the completion of this event + * - Argument 5: WeekEventFlag for the completion of this event + * + * Note: These events are after the MET events, so will start indexing at BOMBERS_NOTEBOOK_PERSON_MAX + */ +/* 0x14 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_RECEIVED_ROOM_KEY, 0x2198, 0x2152, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY) +/* 0x15 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING, 0x2199, 0x2153, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING) +/* 0x16 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x219A, 0x2154, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI) +/* 0x17 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x219B, 0x0000, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI) +/* 0x18 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI, 0x219C, 0x2156, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI) +/* 0x19 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_RECEIVED_PENDANT_OF_MEMORIES, 0x219D, 0x2157, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES) +/* 0x1A */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES, 0x219E, 0x2158, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES) +/* 0x1B */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT, 0x219F, 0x2159, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT) +/* 0x1C */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM, 0x21A0, 0x215A, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM) +/* 0x1D */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_DEFENDED_AGAINST_THEM, 0x21A1, 0x215B, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM) +/* 0x1E */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21A2, 0x0000, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE) +/* 0x1F */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_ESCORTED_CREMIA, 0x21A3, 0x215D, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA) +/* 0x20 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21A4, 0x0000, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK) +/* 0x21 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21A5, 0x215F, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK) +/* 0x22 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, WEEKEVENTREG_RECEIVED_PRIORITY_MAIL, 0x21A6, 0x2160, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL) +/* 0x23 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21A7, 0x2161, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL) +/* 0x24 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE, BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21A8, 0x0000, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE) +/* 0x25 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21A9, 0x2163, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK) +/* 0x26 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21AA, 0x2164, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP) +/* 0x27 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21AB, 0x2165, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP) +/* 0x28 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21AC, 0x2166, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP) +/* 0x29 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21AD, 0x2167, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP) +/* 0x2A */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21AE, 0x2168, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP) +/* 0x2B */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP, BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21AF, 0x2169, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP) +/* 0x2C */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B0, 0x216A, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK) +/* 0x2D */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B1, 0x216B, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK) +/* 0x2E */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B2, 0x216C, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD) +/* 0x2F */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B3, 0x216D, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK) +/* 0x30 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B4, 0x216E, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK) +/* 0x31 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B5, 0x216F, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT) +/* 0x32 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B6, 0x2170, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK) +/* 0x33 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B7, 0x2171, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK) +/* 0x34 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B8, 0x2172, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK) +/* 0x35 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21B9, 0x2173, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK) +/* 0x36 */ DEFINE_EVENT(BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK, BOMBERS_NOTEBOOK_EVENT_ICON_MASK, BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE, 0x21BA, 0x2174, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK) diff --git a/include/tables/bombers_notebook/person_table.h b/include/tables/bombers_notebook/person_table.h new file mode 100644 index 0000000000..71771956b0 --- /dev/null +++ b/include/tables/bombers_notebook/person_table.h @@ -0,0 +1,31 @@ +/** + * Bombers Notebook Person Table + * + * DEFINE_PERSON should be used for people with entries in the notebook + * - Argument 0: Enum value for this person + * - Argument 1: Photo texture for this person + * - Argument 2: Message id for the description of this person + * - Argument 3: Enum value for the event meeting this person + * - Argument 4: Message id for the event meeting this person + * - Argument 5: WeekEventFlag for the event meeting this person + */ +/* 0x00 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_BOMBERS, D_07009800, 0x21DD, BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS, 0x2147, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS) +/* 0x01 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_ANJU, D_07000000, 0x21CA, BOMBERS_NOTEBOOK_EVENT_MET_ANJU, 0x2134, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJU) +/* 0x02 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_KAFEI, D_07000800, 0x21CB, BOMBERS_NOTEBOOK_EVENT_MET_KAFEI, 0x2135, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAFEI) +/* 0x03 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_CURIOSITY_SHOP_MAN, D_07001000, 0x21CC, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN, 0x2136, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN) +/* 0x04 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_BOMB_SHOP_LADY, D_07001800, 0x21CD, BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY, 0x2137, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY) +/* 0x05 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_ROMANI, D_07002000, 0x21CE, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI, 0x2138, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROMANI) +/* 0x06 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_CREMIA, D_07002800, 0x21CF, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA, 0x2139, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CREMIA) +/* 0x07 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_MAYOR_DOTOUR, D_07003000, 0x21D0, BOMBERS_NOTEBOOK_EVENT_MET_MAYOR_DOTOUR, 0x213A, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MAYOR_DOTOUR) +/* 0x08 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_MADAME_AROMA, D_07003800, 0x21D1, BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA, 0x213B, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA) +/* 0x09 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_TOTO, D_07004000, 0x21D2, BOMBERS_NOTEBOOK_EVENT_MET_TOTO, 0x213C, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOTO) +/* 0x0A */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_GORMAN, D_07004800, 0x21D3, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN, 0x213D, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN) +/* 0x0B */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_POSTMAN, D_07005000, 0x21D4, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN, 0x213E, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN) +/* 0x0C */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_ROSA_SISTERS, D_07005800, 0x21D5, BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS, 0x213F, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS) +/* 0x0D */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_TOILET_HAND, D_07006000, 0x21D6, BOMBERS_NOTEBOOK_EVENT_MET_TOLIET_HAND, 0x2140, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOILET_HAND) +/* 0x0E */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_ANJUS_GRANDMOTHER, D_07006800, 0x21D7, BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER, 0x2141, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER) +/* 0x0F */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_KAMARO, D_07007000, 0x21D8, BOMBERS_NOTEBOOK_EVENT_MET_KAMARO, 0x2142, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAMARO) +/* 0x10 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_GROG, D_07007800, 0x21D9, BOMBERS_NOTEBOOK_EVENT_MET_GROG, 0x2143, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GROG) +/* 0x11 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_GORMAN_BROTHERS, D_07008000, 0x21DA, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS, 0x2144, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS) +/* 0x12 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_SHIRO, D_07008800, 0x21DB, BOMBERS_NOTEBOOK_EVENT_MET_SHIRO, 0x2145, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_SHIRO) +/* 0x13 */ DEFINE_PERSON(BOMBERS_NOTEBOOK_PERSON_GURU_GURU, D_07009000, 0x21DC, BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU, 0x2146, WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU) diff --git a/include/variables.h b/include/variables.h index ba1548f0fa..108fa58338 100644 --- a/include/variables.h +++ b/include/variables.h @@ -563,8 +563,6 @@ extern UNK_PTR D_801C5CB0; // extern UNK_TYPE2 D_801C6A90; // extern UNK_TYPE2 D_801C6A94; extern u8 gPageSwitchNextButtonStatus[6][5]; -// extern UNK_TYPE1 D_801C6AB8; -// extern UNK_TYPE1 D_801C6B28; // extern UNK_TYPE1 D_801CED40; // extern UNK_TYPE2 D_801CFC78; // extern UNK_TYPE1 D_801CFC7A; @@ -697,53 +695,6 @@ extern s32 gDbgCamEnabled; extern Input* D_801D0D60; // extern UNK_TYPE2 sPlayerCsIdToCsCamId; // extern UNK_TYPE1 D_801D0D7A; -// extern UNK_TYPE1 D_801D0D80; -// extern UNK_TYPE1 D_801D11F4; -// extern UNK_TYPE1 D_801D1230; -// extern UNK_TYPE1 D_801D1234; -// extern UNK_TYPE4 D_801D1238; -// extern UNK_TYPE1 D_801D1244; -// extern UNK_TYPE1 D_801D12C0; -// extern UNK_TYPE1 D_801D12D0; -// extern UNK_TYPE1 D_801D12D4; -// extern UNK_TYPE1 D_801D12D8; -// extern UNK_TYPE1 D_801D12DC; -// extern UNK_TYPE2 D_801D1330; -// extern UNK_TYPE1 D_801D1342; -// extern UNK_TYPE2 D_801D1344; -// extern UNK_TYPE1 D_801D1368; -// extern UNK_TYPE2 D_801D1374; -// extern UNK_TYPE1 D_801D1388; -// extern UNK_TYPE2 D_801D13D8; -// extern UNK_TYPE2 D_801D13DC; -// extern UNK_TYPE2 D_801D13E0; -// extern UNK_TYPE2 D_801D13E4; -// extern UNK_TYPE4 D_801D13E8; -// extern UNK_TYPE1 D_801D13EC; -// extern UNK_TYPE1 D_801D13F0; -// extern UNK_TYPE1 D_801D13F4; -// extern UNK_TYPE1 D_801D13F8; -// extern UNK_TYPE1 D_801D1420; -// extern UNK_TYPE2 D_801D142C; -// extern UNK_TYPE2 D_801D1434; -// extern UNK_TYPE2 D_801D1438; -// extern UNK_TYPE2 D_801D143C; -// extern UNK_TYPE2 D_801D1440; -// extern UNK_TYPE2 D_801D1444; -// extern UNK_TYPE2 D_801D1448; -// extern UNK_TYPE2 D_801D144C; -// extern UNK_TYPE2 D_801D1450; -// extern UNK_TYPE2 D_801D1454; -// extern UNK_TYPE2 D_801D1458; -// extern UNK_TYPE2 D_801D145C; -// extern UNK_TYPE2 D_801D1460; -// extern UNK_TYPE1 D_801D1464; -// extern UNK_TYPE1 D_801D1468; -// extern UNK_TYPE1 D_801D146C; -// extern UNK_TYPE2 D_801D14DC; -// extern UNK_TYPE2 D_801D14E0; -// extern UNK_TYPE2 D_801D14E4; -// extern UNK_TYPE2 D_801D14E8; // extern UNK_TYPE4 D_801D14F0; extern u32 retryCount; diff --git a/include/z64.h b/include/z64.h index 1b9cabdc96..641a060b42 100644 --- a/include/z64.h +++ b/include/z64.h @@ -35,6 +35,7 @@ #include "z64animation_legacy.h" #include "z64audio.h" #include "z64bgcheck.h" +#include "z64bombers_notebook.h" #include "z64camera.h" #include "z64collision_check.h" #include "z64curve.h" @@ -529,26 +530,6 @@ typedef struct PlayState { /* 0x18E6C */ char unk_18E6C[0x3EC]; } PlayState; // size = 0x19258 -typedef struct { - /* 0x00 */ u8 unk_00; - /* 0x01 */ char unk_01[0x3F]; - /* 0x40 */ void* unk_40; - /* 0x44 */ u32 unk_44; - /* 0x48 */ u32 unk_48; - /* 0x4C */ DmaRequest unk_4C; - /* 0x6C */ OSMesgQueue unk_6C; - /* 0x84 */ OSMesg unk_84[1]; - /* 0x88 */ void* unk_88; - /* 0x8C */ uintptr_t unk_8C; - /* 0x90 */ size_t unk_90; - /* 0x94 */ s32 unk_94; - /* 0x98 */ s32 unk_98; - /* 0x9C */ s32 unk_9C; - /* 0xA0 */ char unk_A0[0x4]; - /* 0xA4 */ s32 unk_A4; - /* 0xA8 */ s32 unk_A8; -} BombersNotebook; // size = 0xAC - typedef enum { /* 0 */ PICTO_PHOTO_STATE_OFF, /* 1 */ PICTO_PHOTO_STATE_SETUP, diff --git a/include/z64bombers_notebook.h b/include/z64bombers_notebook.h new file mode 100644 index 0000000000..403f4a88ab --- /dev/null +++ b/include/z64bombers_notebook.h @@ -0,0 +1,58 @@ +#ifndef Z64BOMBERS_NOTEBOOK_H +#define Z64BOMBERS_NOTEBOOK_H + +#include "ultra64.h" +#include "io/controller.h" +#include "z64dma.h" + +#define DEFINE_PERSON(enum, _photo, _description, _metEnum, _metMessage, _metFlag) enum, +typedef enum BombersNotebookPerson { + #include "tables/bombers_notebook/person_table.h" + /* 0x14 */ BOMBERS_NOTEBOOK_PERSON_MAX +} BombersNotebookPerson; + +#undef DEFINE_PERSON + +typedef enum BombersNotebookLoadState { + /* 0 */ BOMBERS_NOTEBOOK_LOAD_STATE_NONE, + /* 1 */ BOMBERS_NOTEBOOK_LOAD_STATE_STARTED, + /* 2 */ BOMBERS_NOTEBOOK_LOAD_STATE_DONE +} BombersNotebookLoadState; + +#define DEFINE_PERSON(_enum, _photo, _description, metEnum, _metMessage, _metFlag) metEnum, +#define DEFINE_EVENT(enum, _icon, _colorFlag, _description, _completedMessage, _completedFlag) enum, +typedef enum BombersNotebookEvent { + #include "tables/bombers_notebook/person_table.h" + #include "tables/bombers_notebook/event_table.h" + /* 0x37 */ BOMBERS_NOTEBOOK_EVENT_MAX +} BombersNotebookEvent; + +#undef DEFINE_PERSON +#undef DEFINE_EVENT + +typedef struct { + /* 0x00 */ u8 loadState; + /* 0x01 */ UNK_TYPE1 pad01[0x3F]; + /* 0x40 */ void* scheduleDmaSegment; + /* 0x44 */ uintptr_t scheduleDmaSegmentStart; + /* 0x48 */ size_t scheduleDmaSegmentSize; + /* 0x4C */ DmaRequest dmaRequest; + /* 0x6C */ OSMesgQueue loadQueue; + /* 0x84 */ OSMesg loadMsg[1]; + /* 0x88 */ void* scheduleSegment; + /* 0x8C */ uintptr_t scheduleSegmentStart; + /* 0x90 */ size_t scheduleSegmentSize; + /* 0x94 */ s32 cursorPageRow; + /* 0x98 */ s32 cursorEntry; // Entries are 3 apart, see BOMBERS_NOTEBOOK_ENTRY_SIZE + /* 0x9C */ s32 cursorPage; + /* 0xA0 */ UNK_TYPE1 padA0[0x4]; + /* 0xA4 */ s32 scrollAmount; + /* 0xA8 */ s32 scrollOffset; +} BombersNotebook; // size = 0xAC + +void BombersNotebook_Draw(BombersNotebook* this, struct GraphicsContext* gfxCtx); +void BombersNotebook_Update(struct PlayState* play, BombersNotebook* this, Input* input); +void BombersNotebook_Init(BombersNotebook* this); +void BombersNotebook_Destroy(BombersNotebook* this); + +#endif diff --git a/include/z64message.h b/include/z64message.h index 2b0387045b..09c9c4e048 100644 --- a/include/z64message.h +++ b/include/z64message.h @@ -9,6 +9,9 @@ struct Actor; struct MessageTableEntry; struct OcarinaStaff; +extern u16 sBombersNotebookEventMessages[BOMBERS_NOTEBOOK_EVENT_MAX]; +extern u16 gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_EVENT_MAX]; + typedef enum TextState { /* 0 */ TEXT_STATE_NONE, /* 1 */ TEXT_STATE_1, @@ -159,8 +162,8 @@ typedef struct MessageContext { /* 0x120A0 */ s32 unk120A0; /* 0x120A4 */ s16 unk120A4[6]; /* 0x120B0 */ u8 unk120B0; - /* 0x120B1 */ u8 unk120B1; - /* 0x120B2 */ u8 unk120B2[0xA]; + /* 0x120B1 */ u8 bombersNotebookEventQueueCount; + /* 0x120B2 */ u8 bombersNotebookEventQueue[10]; /* 0x120BC */ u16 unk_120BC; /* 0x120BE */ s16 unk120BE; /* 0x120C0 */ s16 unk120C0; diff --git a/include/z64save.h b/include/z64save.h index 805b62e5a0..312b18b2e1 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -733,13 +733,13 @@ typedef enum { #define WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON PACK_WEEKEVENTREG_FLAG(21, 0x08) #define WEEKEVENTREG_21_10 PACK_WEEKEVENTREG_FLAG(21, 0x10) -#define WEEKEVENTREG_21_20 PACK_WEEKEVENTREG_FLAG(21, 0x20) +#define WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM PACK_WEEKEVENTREG_FLAG(21, 0x20) #define WEEKEVENTREG_21_40 PACK_WEEKEVENTREG_FLAG(21, 0x40) #define WEEKEVENTREG_21_80 PACK_WEEKEVENTREG_FLAG(21, 0x80) // Aliens defeated // "Winning" the alien invasion -#define WEEKEVENTREG_22_01 PACK_WEEKEVENTREG_FLAG(22, 0x01) +#define WEEKEVENTREG_DEFENDED_AGAINST_THEM PACK_WEEKEVENTREG_FLAG(22, 0x01) #define WEEKEVENTREG_22_02 PACK_WEEKEVENTREG_FLAG(22, 0x02) @@ -795,11 +795,11 @@ typedef enum { #define WEEKEVENTREG_26_40 PACK_WEEKEVENTREG_FLAG(26, 0x40) #define WEEKEVENTREG_26_80 PACK_WEEKEVENTREG_FLAG(26, 0x80) #define WEEKEVENTREG_27_01 PACK_WEEKEVENTREG_FLAG(27, 0x01) -#define WEEKEVENTREG_27_02 PACK_WEEKEVENTREG_FLAG(27, 0x02) -#define WEEKEVENTREG_27_04 PACK_WEEKEVENTREG_FLAG(27, 0x04) -#define WEEKEVENTREG_27_08 PACK_WEEKEVENTREG_FLAG(27, 0x08) -#define WEEKEVENTREG_27_10 PACK_WEEKEVENTREG_FLAG(27, 0x10) -#define WEEKEVENTREG_27_20 PACK_WEEKEVENTREG_FLAG(27, 0x20) +#define WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN PACK_WEEKEVENTREG_FLAG(27, 0x02) +#define WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN PACK_WEEKEVENTREG_FLAG(27, 0x04) +#define WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN PACK_WEEKEVENTREG_FLAG(27, 0x08) +#define WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN PACK_WEEKEVENTREG_FLAG(27, 0x10) +#define WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN PACK_WEEKEVENTREG_FLAG(27, 0x20) #define WEEKEVENTREG_27_40 PACK_WEEKEVENTREG_FLAG(27, 0x40) #define WEEKEVENTREG_27_80 PACK_WEEKEVENTREG_FLAG(27, 0x80) #define WEEKEVENTREG_28_01 PACK_WEEKEVENTREG_FLAG(28, 0x01) @@ -956,22 +956,22 @@ typedef enum { #define WEEKEVENTREG_50_01 PACK_WEEKEVENTREG_FLAG(50, 0x01) #define WEEKEVENTREG_50_02 PACK_WEEKEVENTREG_FLAG(50, 0x02) #define WEEKEVENTREG_50_04 PACK_WEEKEVENTREG_FLAG(50, 0x04) -#define WEEKEVENTREG_50_08 PACK_WEEKEVENTREG_FLAG(50, 0x08) +#define WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING PACK_WEEKEVENTREG_FLAG(50, 0x08) #define WEEKEVENTREG_50_10 PACK_WEEKEVENTREG_FLAG(50, 0x10) -#define WEEKEVENTREG_50_20 PACK_WEEKEVENTREG_FLAG(50, 0x20) +#define WEEKEVENTREG_HAD_MIDNIGHT_MEETING PACK_WEEKEVENTREG_FLAG(50, 0x20) #define WEEKEVENTREG_50_40 PACK_WEEKEVENTREG_FLAG(50, 0x40) -#define WEEKEVENTREG_50_80 PACK_WEEKEVENTREG_FLAG(50, 0x80) -#define WEEKEVENTREG_51_01 PACK_WEEKEVENTREG_FLAG(51, 0x01) +#define WEEKEVENTREG_RECEIVED_PENDANT_OF_MEMORIES PACK_WEEKEVENTREG_FLAG(50, 0x80) +#define WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES PACK_WEEKEVENTREG_FLAG(51, 0x01) #define WEEKEVENTREG_51_02 PACK_WEEKEVENTREG_FLAG(51, 0x02) #define WEEKEVENTREG_51_04 PACK_WEEKEVENTREG_FLAG(51, 0x04) #define WEEKEVENTREG_51_08 PACK_WEEKEVENTREG_FLAG(51, 0x08) #define WEEKEVENTREG_51_10 PACK_WEEKEVENTREG_FLAG(51, 0x10) -#define WEEKEVENTREG_51_20 PACK_WEEKEVENTREG_FLAG(51, 0x20) +#define WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT PACK_WEEKEVENTREG_FLAG(51, 0x20) #define WEEKEVENTREG_51_40 PACK_WEEKEVENTREG_FLAG(51, 0x40) #define WEEKEVENTREG_51_80 PACK_WEEKEVENTREG_FLAG(51, 0x80) // ProtectedCremia -#define WEEKEVENTREG_52_01 PACK_WEEKEVENTREG_FLAG(52, 0x01) +#define WEEKEVENTREG_ESCORTED_CREMIA PACK_WEEKEVENTREG_FLAG(52, 0x01) // Lose Milk Run minigame #define WEEKEVENTREG_52_02 PACK_WEEKEVENTREG_FLAG(52, 0x02) @@ -1101,61 +1101,65 @@ typedef enum { #define WEEKEVENTREG_65_20 PACK_WEEKEVENTREG_FLAG(65, 0x20) #define WEEKEVENTREG_65_40 PACK_WEEKEVENTREG_FLAG(65, 0x40) #define WEEKEVENTREG_65_80 PACK_WEEKEVENTREG_FLAG(65, 0x80) -#define WEEKEVENTREG_66_01 PACK_WEEKEVENTREG_FLAG(66, 0x01) -#define WEEKEVENTREG_66_02 PACK_WEEKEVENTREG_FLAG(66, 0x02) -#define WEEKEVENTREG_66_04 PACK_WEEKEVENTREG_FLAG(66, 0x04) -#define WEEKEVENTREG_66_08 PACK_WEEKEVENTREG_FLAG(66, 0x08) -#define WEEKEVENTREG_66_10 PACK_WEEKEVENTREG_FLAG(66, 0x10) -#define WEEKEVENTREG_66_20 PACK_WEEKEVENTREG_FLAG(66, 0x20) -#define WEEKEVENTREG_66_40 PACK_WEEKEVENTREG_FLAG(66, 0x40) -#define WEEKEVENTREG_66_80 PACK_WEEKEVENTREG_FLAG(66, 0x80) -#define WEEKEVENTREG_67_01 PACK_WEEKEVENTREG_FLAG(67, 0x01) -#define WEEKEVENTREG_67_02 PACK_WEEKEVENTREG_FLAG(67, 0x02) -#define WEEKEVENTREG_67_04 PACK_WEEKEVENTREG_FLAG(67, 0x04) -#define WEEKEVENTREG_67_08 PACK_WEEKEVENTREG_FLAG(67, 0x08) -#define WEEKEVENTREG_67_10 PACK_WEEKEVENTREG_FLAG(67, 0x10) -#define WEEKEVENTREG_67_20 PACK_WEEKEVENTREG_FLAG(67, 0x20) -#define WEEKEVENTREG_67_40 PACK_WEEKEVENTREG_FLAG(67, 0x40) -#define WEEKEVENTREG_67_80 PACK_WEEKEVENTREG_FLAG(67, 0x80) -#define WEEKEVENTREG_68_01 PACK_WEEKEVENTREG_FLAG(68, 0x01) -#define WEEKEVENTREG_68_02 PACK_WEEKEVENTREG_FLAG(68, 0x02) -#define WEEKEVENTREG_68_04 PACK_WEEKEVENTREG_FLAG(68, 0x04) -#define WEEKEVENTREG_68_08 PACK_WEEKEVENTREG_FLAG(68, 0x08) -#define WEEKEVENTREG_68_10 PACK_WEEKEVENTREG_FLAG(68, 0x10) -#define WEEKEVENTREG_68_20 PACK_WEEKEVENTREG_FLAG(68, 0x20) -#define WEEKEVENTREG_68_40 PACK_WEEKEVENTREG_FLAG(68, 0x40) -#define WEEKEVENTREG_68_80 PACK_WEEKEVENTREG_FLAG(68, 0x80) -#define WEEKEVENTREG_69_01 PACK_WEEKEVENTREG_FLAG(69, 0x01) -#define WEEKEVENTREG_69_02 PACK_WEEKEVENTREG_FLAG(69, 0x02) -#define WEEKEVENTREG_69_04 PACK_WEEKEVENTREG_FLAG(69, 0x04) -#define WEEKEVENTREG_69_08 PACK_WEEKEVENTREG_FLAG(69, 0x08) -#define WEEKEVENTREG_69_10 PACK_WEEKEVENTREG_FLAG(69, 0x10) -#define WEEKEVENTREG_69_20 PACK_WEEKEVENTREG_FLAG(69, 0x20) -#define WEEKEVENTREG_69_40 PACK_WEEKEVENTREG_FLAG(69, 0x40) -#define WEEKEVENTREG_69_80 PACK_WEEKEVENTREG_FLAG(69, 0x80) -#define WEEKEVENTREG_70_01 PACK_WEEKEVENTREG_FLAG(70, 0x01) -#define WEEKEVENTREG_70_02 PACK_WEEKEVENTREG_FLAG(70, 0x02) -#define WEEKEVENTREG_70_04 PACK_WEEKEVENTREG_FLAG(70, 0x04) -#define WEEKEVENTREG_70_08 PACK_WEEKEVENTREG_FLAG(70, 0x08) -#define WEEKEVENTREG_70_10 PACK_WEEKEVENTREG_FLAG(70, 0x10) -#define WEEKEVENTREG_70_20 PACK_WEEKEVENTREG_FLAG(70, 0x20) -#define WEEKEVENTREG_70_40 PACK_WEEKEVENTREG_FLAG(70, 0x40) -#define WEEKEVENTREG_70_80 PACK_WEEKEVENTREG_FLAG(70, 0x80) -#define WEEKEVENTREG_71_01 PACK_WEEKEVENTREG_FLAG(71, 0x01) -#define WEEKEVENTREG_71_02 PACK_WEEKEVENTREG_FLAG(71, 0x02) -#define WEEKEVENTREG_71_04 PACK_WEEKEVENTREG_FLAG(71, 0x04) -#define WEEKEVENTREG_71_08 PACK_WEEKEVENTREG_FLAG(71, 0x08) -#define WEEKEVENTREG_71_10 PACK_WEEKEVENTREG_FLAG(71, 0x10) -#define WEEKEVENTREG_71_20 PACK_WEEKEVENTREG_FLAG(71, 0x20) -#define WEEKEVENTREG_71_40 PACK_WEEKEVENTREG_FLAG(71, 0x40) -#define WEEKEVENTREG_71_80 PACK_WEEKEVENTREG_FLAG(71, 0x80) -#define WEEKEVENTREG_72_01 PACK_WEEKEVENTREG_FLAG(72, 0x01) -#define WEEKEVENTREG_72_02 PACK_WEEKEVENTREG_FLAG(72, 0x02) -#define WEEKEVENTREG_72_04 PACK_WEEKEVENTREG_FLAG(72, 0x04) -#define WEEKEVENTREG_72_08 PACK_WEEKEVENTREG_FLAG(72, 0x08) -#define WEEKEVENTREG_72_10 PACK_WEEKEVENTREG_FLAG(72, 0x10) -#define WEEKEVENTREG_72_20 PACK_WEEKEVENTREG_FLAG(72, 0x20) -#define WEEKEVENTREG_72_40 PACK_WEEKEVENTREG_FLAG(72, 0x40) + +/* Bombers' Notebook Events */ + +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJU PACK_WEEKEVENTREG_FLAG(66, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAFEI PACK_WEEKEVENTREG_FLAG(66, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN PACK_WEEKEVENTREG_FLAG(66, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY PACK_WEEKEVENTREG_FLAG(66, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROMANI PACK_WEEKEVENTREG_FLAG(66, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CREMIA PACK_WEEKEVENTREG_FLAG(66, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MAYOR_DOTOUR PACK_WEEKEVENTREG_FLAG(66, 0x40) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MADAME_AROMA PACK_WEEKEVENTREG_FLAG(66, 0x80) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOTO PACK_WEEKEVENTREG_FLAG(67, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN PACK_WEEKEVENTREG_FLAG(67, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN PACK_WEEKEVENTREG_FLAG(67, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS PACK_WEEKEVENTREG_FLAG(67, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOILET_HAND PACK_WEEKEVENTREG_FLAG(67, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER PACK_WEEKEVENTREG_FLAG(67, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAMARO PACK_WEEKEVENTREG_FLAG(67, 0x40) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GROG PACK_WEEKEVENTREG_FLAG(67, 0x80) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS PACK_WEEKEVENTREG_FLAG(68, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_SHIRO PACK_WEEKEVENTREG_FLAG(68, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU PACK_WEEKEVENTREG_FLAG(68, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS PACK_WEEKEVENTREG_FLAG(68, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY PACK_WEEKEVENTREG_FLAG(68, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING PACK_WEEKEVENTREG_FLAG(68, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI PACK_WEEKEVENTREG_FLAG(68, 0x40) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI PACK_WEEKEVENTREG_FLAG(68, 0x80) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI PACK_WEEKEVENTREG_FLAG(69, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES PACK_WEEKEVENTREG_FLAG(69, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES PACK_WEEKEVENTREG_FLAG(69, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT PACK_WEEKEVENTREG_FLAG(69, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM PACK_WEEKEVENTREG_FLAG(69, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM PACK_WEEKEVENTREG_FLAG(69, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE PACK_WEEKEVENTREG_FLAG(69, 0x40) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA PACK_WEEKEVENTREG_FLAG(69, 0x80) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK PACK_WEEKEVENTREG_FLAG(70, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK PACK_WEEKEVENTREG_FLAG(70, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL PACK_WEEKEVENTREG_FLAG(70, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL PACK_WEEKEVENTREG_FLAG(70, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE PACK_WEEKEVENTREG_FLAG(70, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK PACK_WEEKEVENTREG_FLAG(70, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP PACK_WEEKEVENTREG_FLAG(70, 0x40) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP PACK_WEEKEVENTREG_FLAG(70, 0x80) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP PACK_WEEKEVENTREG_FLAG(71, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP PACK_WEEKEVENTREG_FLAG(71, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP PACK_WEEKEVENTREG_FLAG(71, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP PACK_WEEKEVENTREG_FLAG(71, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK PACK_WEEKEVENTREG_FLAG(71, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK PACK_WEEKEVENTREG_FLAG(71, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD PACK_WEEKEVENTREG_FLAG(71, 0x40) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK PACK_WEEKEVENTREG_FLAG(71, 0x80) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK PACK_WEEKEVENTREG_FLAG(72, 0x01) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT PACK_WEEKEVENTREG_FLAG(72, 0x02) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK PACK_WEEKEVENTREG_FLAG(72, 0x04) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK PACK_WEEKEVENTREG_FLAG(72, 0x08) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK PACK_WEEKEVENTREG_FLAG(72, 0x10) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK PACK_WEEKEVENTREG_FLAG(72, 0x20) +#define WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK PACK_WEEKEVENTREG_FLAG(72, 0x40) + #define WEEKEVENTREG_72_80 PACK_WEEKEVENTREG_FLAG(72, 0x80) #define WEEKEVENTREG_73_01 PACK_WEEKEVENTREG_FLAG(73, 0x01) #define WEEKEVENTREG_73_02 PACK_WEEKEVENTREG_FLAG(73, 0x02) @@ -1180,7 +1184,7 @@ typedef enum { #define WEEKEVENTREG_75_02 PACK_WEEKEVENTREG_FLAG(75, 0x02) #define WEEKEVENTREG_75_04 PACK_WEEKEVENTREG_FLAG(75, 0x04) #define WEEKEVENTREG_75_08 PACK_WEEKEVENTREG_FLAG(75, 0x08) -#define WEEKEVENTREG_75_10 PACK_WEEKEVENTREG_FLAG(75, 0x10) +#define WEEKEVENTREG_RECEIVED_ROOM_KEY PACK_WEEKEVENTREG_FLAG(75, 0x10) #define WEEKEVENTREG_75_20 PACK_WEEKEVENTREG_FLAG(75, 0x20) #define WEEKEVENTREG_75_40 PACK_WEEKEVENTREG_FLAG(75, 0x40) #define WEEKEVENTREG_75_80 PACK_WEEKEVENTREG_FLAG(75, 0x80) @@ -1226,7 +1230,7 @@ typedef enum { // Aveil has spotted Player #define WEEKEVENTREG_80_08 PACK_WEEKEVENTREG_FLAG(80, 0x08) -#define WEEKEVENTREG_80_10 PACK_WEEKEVENTREG_FLAG(80, 0x10) +#define WEEKEVENTREG_RECEIVED_PRIORITY_MAIL PACK_WEEKEVENTREG_FLAG(80, 0x10) #define WEEKEVENTREG_80_20 PACK_WEEKEVENTREG_FLAG(80, 0x20) #define WEEKEVENTREG_80_40 PACK_WEEKEVENTREG_FLAG(80, 0x40) #define WEEKEVENTREG_80_80 PACK_WEEKEVENTREG_FLAG(80, 0x80) diff --git a/spec b/spec index a3cde9e587..e427e6866f 100644 --- a/spec +++ b/spec @@ -373,7 +373,8 @@ endseg beginseg name "schedule_static" compress - include "build/baserom/schedule_static.o" + include "build/assets/interface/schedule_static/schedule_static.o" + number 8 endseg beginseg @@ -548,7 +549,6 @@ beginseg include "build/src/code/z_overlay.o" include "build/src/code/z_play.o" include "build/src/code/z_play_hireso.o" - include "build/data/code/z_play_hireso.data.o" include "build/src/code/PreRender.o" include "build/data/code/PreRender.bss.o" include "build/src/code/TwoHeadGfxArena.o" diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index d0f7571251..1d2046e575 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "z64shrink_window.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" diff --git a/src/code/z_message.c b/src/code/z_message.c index 8681967e67..38f44d9ec7 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -5,6 +5,27 @@ #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #if 0 +#define DEFINE_PERSON(_enum, _photo, _description, _metEnum, metMessage, _metFlag) metMessage, +#define DEFINE_EVENT(_enum, _icon, _colorFlag, _description, completedMessage, _completedFlag) completedMessage, + +u16 sBombersNotebookEventMessages[BOMBERS_NOTEBOOK_EVENT_MAX] = { +#include "tables/bombers_notebook/person_table.h" +#include "tables/bombers_notebook/event_table.h" +}; + +#undef DEFINE_PERSON +#undef DEFINE_EVENT + +#define DEFINE_PERSON(_enum, _photo, _description, _metEnum, _metMessage, metFlag) metFlag, +#define DEFINE_EVENT(_enum, _icon, _colorFlag, _description, _completedMessage, completedFlag) completedFlag, + +u16 gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_EVENT_MAX] = { +#include "tables/bombers_notebook/person_table.h" +#include "tables/bombers_notebook/event_table.h" +}; + +#undef DEFINE_PERSON +#undef DEFINE_EVENT s16 D_801D02D8[15] = { ACTOR_OCEFF_WIPE5, ACTOR_OCEFF_WIPE5, // Sonata of Awakening Effect, Sonata of Awakening Effect @@ -20,8 +41,6 @@ s32 D_801D02F8[15] = { 0,1,2,3,4,0,1,0,0,0,0,0,1,1,0 }; #endif -extern u16 D_801C6AB8[]; -extern u16 D_801C6B28[]; extern s16 D_801D02D8[]; extern s32 D_801D02F8[]; extern s16 D_801F6B0C; @@ -365,19 +384,19 @@ void func_80151A68(PlayState* play, u16 textId) { } } -void func_80151BB4(PlayState* play, u8 arg1) { +void Message_BombersNotebookQueueEvent(PlayState* play, u8 event) { MessageContext* msgCtx = &play->msgCtx; - u8 temp = arg1; if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - if (!CHECK_WEEKEVENTREG(D_801C6B28[arg1])) { - msgCtx->unk120B2[msgCtx->unk120B1] = temp; - msgCtx->unk120B1++; + if (!CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[event])) { + msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount] = event; + msgCtx->bombersNotebookEventQueueCount++; } - } else if (arg1 >= 20) { - if (!CHECK_WEEKEVENTREG(D_801C6B28[arg1])) { - msgCtx->unk120B2[msgCtx->unk120B1] = temp; - msgCtx->unk120B1++; + } else if (event >= BOMBERS_NOTEBOOK_PERSON_MAX) { + // Non MET events are processed even if the player does not have the notebook yet + if (!CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[event])) { + msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount] = event; + msgCtx->bombersNotebookEventQueueCount++; } } } @@ -386,16 +405,22 @@ u32 func_80151C9C(PlayState* play) { MessageContext* msgCtx = &play->msgCtx; while (true) { - if (msgCtx->unk120B1 == 0) { + if (msgCtx->bombersNotebookEventQueueCount == 0) { return false; } - msgCtx->unk120B1--; + msgCtx->bombersNotebookEventQueueCount--; - if (!CHECK_WEEKEVENTREG(D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]])) { - SET_WEEKEVENTREG(D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]]); + if (!CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags + [msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]])) { + SET_WEEKEVENTREG(gBombersNotebookWeekEventFlags + [msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]]); - if ((D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]] != 0) && CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - Message_ContinueTextbox(play, D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]]); + if ((sBombersNotebookEventMessages + [msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]] != 0) && + CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { + Message_ContinueTextbox( + play, sBombersNotebookEventMessages + [msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]]); play_sound(NA_SE_SY_SCHEDULE_WRITE); return true; } @@ -476,7 +501,7 @@ u8 Message_GetState(MessageContext* msgCtx) { if (msgCtx->msgMode == 0x40) { return TEXT_STATE_13; } - if ((msgCtx->msgMode == 0x43) && (msgCtx->stateTimer == 1) && (msgCtx->unk120B1 == 0)) { + if ((msgCtx->msgMode == 0x43) && (msgCtx->stateTimer == 1) && (msgCtx->bombersNotebookEventQueueCount == 0)) { return TEXT_STATE_CLOSING; } diff --git a/src/code/z_play.c b/src/code/z_play.c index dd9b6c561c..6ef734aeee 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,5 +1,6 @@ #include "global.h" #include "buffers.h" +#include "z64bombers_notebook.h" #include "z64debug_display.h" #include "z64quake.h" #include "z64rumble.h" @@ -1051,14 +1052,14 @@ void Play_Update(PlayState* this) { if (!sBombersNotebookOpen) { if (this->pauseCtx.bombersNotebookOpen) { sBombersNotebookOpen = true; - sBombersNotebook.unk_00 = 0; + sBombersNotebook.loadState = BOMBERS_NOTEBOOK_LOAD_STATE_NONE; } } else if (CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_L) || CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_B) || CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_START) || (gIrqMgrResetStatus != 0)) { sBombersNotebookOpen = false; this->pauseCtx.bombersNotebookOpen = false; - sBombersNotebook.unk_00 = 0; + sBombersNotebook.loadState = BOMBERS_NOTEBOOK_LOAD_STATE_NONE; this->msgCtx.msgLength = 0; this->msgCtx.msgMode = 0; this->msgCtx.currentTextId = 0; diff --git a/src/code/z_play_hireso.c b/src/code/z_play_hireso.c index 829fe71f21..b995028ca3 100644 --- a/src/code/z_play_hireso.c +++ b/src/code/z_play_hireso.c @@ -1,27 +1,1363 @@ #include "global.h" +#include "z64bombers_notebook.h" +#include "interface/schedule_static/schedule_static.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016AC10.s") +// TODO: Needs YAZ0 +// Segment 0x07 schedule_dma_static_test +extern TexturePtr D_07000000; +extern TexturePtr D_07000800; +extern TexturePtr D_07001000; +extern TexturePtr D_07001800; +extern TexturePtr D_07002000; +extern TexturePtr D_07002800; +extern TexturePtr D_07003000; +extern TexturePtr D_07003800; +extern TexturePtr D_07004000; +extern TexturePtr D_07004800; +extern TexturePtr D_07005000; +extern TexturePtr D_07005800; +extern TexturePtr D_07006000; +extern TexturePtr D_07006800; +extern TexturePtr D_07007000; +extern TexturePtr D_07007800; +extern TexturePtr D_07008000; +extern TexturePtr D_07008800; +extern TexturePtr D_07009000; +extern TexturePtr D_07009800; +extern TexturePtr D_0700AC00; +extern TexturePtr D_0700AEA0; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016AE1C.s") +#define BOMBERS_NOTEBOOK_ENTRY_SIZE 3 +#define BOMBERS_NOTEBOOK_ENTRY_MAX 10 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016B278.s") +#define BOMBERS_NOTEBOOK_ENTRY_GET_DAY(row, entry) (((&sBombersNotebookEntries[row][entry])[0] & 0xF00) >> 8) +#define BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(row, entry) ((&sBombersNotebookEntries[row][entry])[0] & 0xFF) +#define BOMBERS_NOTEBOOK_ENTRY_GET_START_TIME(row, entry) ((&sBombersNotebookEntries[row][entry])[1]) +#define BOMBERS_NOTEBOOK_ENTRY_GET_END_TIME(row, entry) ((&sBombersNotebookEntries[row][entry])[2]) -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016B4B0.s") +#define BOMBERS_NOTEBOOK_ENTRY(pos, day, event, startTime, endTime) \ + ((pos)&0xF000) | (((day)&0xF) << 8) | ((event)&0xFF), (startTime), (endTime) +#define BOMBERS_NOTEBOOK_ENTRY_END 0x9999 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016C344.s") +#define BOMBERS_NOTEBOOK_ENTRY_POS_CENTER 0x0000 +#define BOMBERS_NOTEBOOK_ENTRY_POS_BELOW 0x4000 +#define BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE 0x8000 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016CD4C.s") +typedef enum { + /* 0 */ BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT, + /* 1 */ BOMBERS_NOTEBOOK_EVENT_ICON_MASK, + /* 2 */ BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON +} BombersNotebookEventIcon; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016E40C.s") +#define BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE 0xFFF0 +#define BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI 0xFFF1 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016EA90.s") +u16 sBombersNotebookEntries[BOMBERS_NOTEBOOK_PERSON_MAX][BOMBERS_NOTEBOOK_ENTRY_MAX * BOMBERS_NOTEBOOK_ENTRY_SIZE] = { + { + /* Bombers */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 2, BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 3, BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Anju */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY, + CLOCK_TIME(13, 45), CLOCK_TIME(16, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING, + CLOCK_TIME(14, 30), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI, + CLOCK_TIME(23, 30), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI, + CLOCK_TIME(23, 30), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, + BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES, CLOCK_TIME(17, 0), + CLOCK_TIME(21, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, + BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES, CLOCK_TIME(6, 0), + CLOCK_TIME(12, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK, + CLOCK_TIME(5, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Kafei */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES, CLOCK_TIME(16, 30), + CLOCK_TIME(22, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT, + CLOCK_TIME(18, 0), CLOCK_TIME(19, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK, + CLOCK_TIME(5, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Curiosity Shop Man */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK, + CLOCK_TIME(13, 0), CLOCK_TIME(22, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL, + CLOCK_TIME(13, 0), CLOCK_TIME(22, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK, + CLOCK_TIME(22, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Old Lady from Bomb Shop */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK, + CLOCK_TIME(0, 30), CLOCK_TIME(1, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Romani */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM, + CLOCK_TIME(6, 0), CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM, + CLOCK_TIME(2, 30), CLOCK_TIME(5, 15)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE, + CLOCK_TIME(2, 30), CLOCK_TIME(5, 15)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Cremia */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 2, BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA, + CLOCK_TIME(18, 0), CLOCK_TIME(21, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK, + CLOCK_TIME(18, 0), CLOCK_TIME(21, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Mayor Dotour */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP, + CLOCK_TIME(8, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP, + CLOCK_TIME(8, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP, + CLOCK_TIME(8, 0), CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Madame Aroma */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK, + CLOCK_TIME(8, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK, + CLOCK_TIME(8, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL, + CLOCK_TIME(18, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Toto */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK, CLOCK_TIME(22, 0), + CLOCK_TIME(5, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK, CLOCK_TIME(22, 0), + CLOCK_TIME(5, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Gorman */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK, CLOCK_TIME(22, 0), + CLOCK_TIME(5, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK, CLOCK_TIME(22, 0), + CLOCK_TIME(5, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Postman */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP, + CLOCK_TIME(15, 0), CLOCK_TIME(0, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI, + CLOCK_TIME(6, 0), CLOCK_TIME(12, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP, + CLOCK_TIME(15, 0), CLOCK_TIME(0, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT, + CLOCK_TIME(18, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Rosa Sisters */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP, + CLOCK_TIME(18, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP, + CLOCK_TIME(18, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* ??? */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Anju's Grandmother */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP, CLOCK_TIME(8, 0), + CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP, CLOCK_TIME(8, 0), + CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 2, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP, CLOCK_TIME(8, 0), + CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 2, + BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP, CLOCK_TIME(8, 0), + CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Kamaro */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK, + CLOCK_TIME(0, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Grog */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD, + CLOCK_TIME(6, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD, + CLOCK_TIME(6, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD, + CLOCK_TIME(6, 0), CLOCK_TIME(20, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Gorman Brothers */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK, + CLOCK_TIME(6, 0), CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK, + CLOCK_TIME(6, 0), CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA, + CLOCK_TIME(18, 0), CLOCK_TIME(21, 0)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK, + CLOCK_TIME(6, 0), CLOCK_TIME(18, 0)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Shiro */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 3, BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK, + CLOCK_TIME(6, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, + { + /* Guru-Guru */ + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK, + CLOCK_TIME(18, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 2, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK, + CLOCK_TIME(18, 0), CLOCK_TIME(5, 59)), + BOMBERS_NOTEBOOK_ENTRY_END, + }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/BombersNotebook_Draw.s") +s16 sBombersNotebookDayRectRectLeft[] = { 120, 120, 270, 420 }; +TexturePtr sBombersNotebookDayTextures[] = { + gBombersNotebookDay1stTex, + gBombersNotebookDay2ndTex, + gBombersNotebookDayFinalTex, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016F4EC.s") +#define DEFINE_EVENT(_enum, icon, _colorFlag, _description, _completedMessage, _completedFlag) icon, -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/BombersNotebook_Update.s") +s32 sBombersNotebookEventIcons[] = { +#include "tables/bombers_notebook/event_table.h" +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/BombersNotebook_Init.s") +#undef DEFINE_EVENT -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/BombersNotebook_Destroy.s") +s32 sBombersNotebookEventIconWidths[] = { 16, 24, 32 }; +s32 sBombersNotebookEventIconHeights[] = { 16, 28, 28 }; + +#define DEFINE_EVENT(_enum, _icon, colorFlag, _description, _completedMessage, _completedFlag) colorFlag, + +u16 sBombersNotebookEventColorWeekEventFlags[] = { +#include "tables/bombers_notebook/event_table.h" +}; + +#undef DEFINE_EVENT + +void BombersNotebook_DrawScisTexRect(Gfx** gfxP, s32 rxl, s32 ryl, s32 rxh, s32 ryh, s32 tile, s32 s, s32 t, s32 dsdx, + s32 dtdy) { + s32 xl = rxl - (gCfbLeftAdjust * 4); + s32 yl = ryl - (gCfbUpperAdjust * 4); + s32 xh = rxh - (gCfbLeftAdjust * 4); + s32 yh = ryh - (gCfbUpperAdjust * 4); + Gfx* gfx = *gfxP; + + gSPScisTextureRectangle(gfx++, xl, yl, xh, yh, tile, s, t, dsdx, dtdy); + + *gfxP = gfx; +} + +s16 sBombersNotebookHeaderColors[][3] = { + { 116, 134, 146 }, // Column 1 + { 158, 156, 131 }, // Column 2 + { 174, 141, 151 }, // Column 3 +}; + +void BombersNotebook_DrawHeaders(Gfx** gfxP) { + Gfx* gfx = *gfxP; + s32 i; + s32 rectLeft; + + gDPLoadTextureBlock(gfx++, gBombersNotebookHeaderBoxTex, G_IM_FMT_I, G_IM_SIZ_8b, 8, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + for (i = 0, rectLeft = 120; i < ARRAY_COUNT(sBombersNotebookHeaderColors); i++, rectLeft += 150) { + gDPSetPrimColor(gfx++, 0, 0, sBombersNotebookHeaderColors[i][0], sBombersNotebookHeaderColors[i][1], + sBombersNotebookHeaderColors[i][2], 192); + BombersNotebook_DrawScisTexRect(&gfx, rectLeft * 4, 74 * 4, (rectLeft + 143) * 4, 98 * 4, 0, 0, 0, 1 << 10, + 1 << 10); + } + + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + for (i = 0, rectLeft = 124; i < ARRAY_COUNT(sBombersNotebookDayTextures); i++, rectLeft += 150) { + gDPLoadTextureBlock(gfx++, sBombersNotebookDayTextures[i], G_IM_FMT_IA, G_IM_SIZ_8b, 48, 22, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, rectLeft * 4, 77 * 4, (rectLeft + 48) * 4, 99 * 4, 0, 0, 0, 1 << 10, + 1 << 10); + } + + rectLeft = 172; + gDPLoadTextureBlock_4b(gfx++, gBombersNotebook1800Tex, G_IM_FMT_IA, 48, 11, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + for (i = 0; i < 3; i++) { + BombersNotebook_DrawScisTexRect(&gfx, rectLeft * 4, 86 * 4, (rectLeft + 48) * 4, 97 * 4, 0, 0, 0, 1 << 10, + 1 << 10); + rectLeft += 150; + } + + gDPPipeSync(gfx++); + *gfxP = gfx; +} + +// Each column/day gets subdivided into 4 sub columns, the first 2 sub columns use 1 color, the last 2 another +s16 sBombersNotebookColumnColors[][2][3] = { + { { 165, 183, 195 }, { 140, 158, 170 } }, // Column 1 + { { 197, 195, 172 }, { 172, 170, 147 } }, // Column 2 + { { 223, 190, 200 }, { 190, 165, 175 } }, // Column 3 +}; + +void BombersNotebook_DrawColumns(Gfx** gfxP) { + Gfx* gfx = *gfxP; + s16* color; + s32 i; + s32 j; + s32 k; + s32 columnRectLeft; + s32 subColumnRectLeft; + s32 pad; + + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookSubColumnBoxTex, G_IM_FMT_I, 48, 1, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + color = &sBombersNotebookColumnColors[0][0][0]; + for (i = 0, columnRectLeft = 120; i < ARRAY_COUNT(sBombersNotebookColumnColors); i++, columnRectLeft += 150) { + subColumnRectLeft = columnRectLeft; + for (j = 0; j < 2; j++) { + gDPSetPrimColor(gfx++, 0, 0, color[0], color[1], color[2], 192); + for (k = 0; k < 2; k++) { + BombersNotebook_DrawScisTexRect(&gfx, subColumnRectLeft * 4, 104 * 4, (subColumnRectLeft + 48) * 4, + 480 * 4, 0, 0, 0, 1 << 10, 1 << 10); + subColumnRectLeft += 36; + } + color += 3; + } + } + + gDPPipeSync(gfx++); + *gfxP = gfx; +} + +TexturePtr sBombersNotebookEventIconTextures[] = { + gBombersNotebookEntryIconExclamationPointTex, + &D_0700AC00, + &D_0700AEA0, +}; +s16 sBombersNotebookEntryIconColors[][3] = { + { 255, 255, 0 }, + { 141, 255, 182 }, + { 255, 100, 60 }, +}; + +void BombersNotebook_DrawEntries(Gfx** gfxP, s32 row, u32 rectTop) { + Gfx* gfx = *gfxP; + s32 entryRectLeft; + u32 eventIcon; + u32 unfinishedEvent = false; + u16 startTime; + u16 endTime; + s32 j = 0; + u32 iconRectLeft; + s32 entryRectRight; + u32 yOffset; + s32 entryWidth; + + while (true) { + if (sBombersNotebookEntries[row][j] == BOMBERS_NOTEBOOK_ENTRY_END) { + if (!unfinishedEvent) { + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 255); + gDPSetEnvColor(gfx++, 0, 0, 0, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookStampTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 48, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, 567 * 4, (rectTop + 1) * 4, 599 * 4, (rectTop + 49) * 4, 0, 0, 0, + 1 << 10, 1 << 10); + gDPPipeSync(gfx++); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + gDPSetEnvColor(gfx++, 255, 0, 0, 255); + BombersNotebook_DrawScisTexRect(&gfx, 565 * 4, (rectTop + -1) * 4, 597 * 4, (rectTop + 47) * 4, 0, 0, 0, + 1 << 10, 1 << 10); + gDPPipeSync(gfx++); + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetEnvColor(gfx++, 0, 0, 0, 255); + } + break; + } + + if (sBombersNotebookEntries[row][j] & BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE) { + yOffset = 8; + } else if (sBombersNotebookEntries[row][j] & BOMBERS_NOTEBOOK_ENTRY_POS_BELOW) { + yOffset = 24; + } else { // BOMBERS_NOTEBOOK_ENTRY_POS_CENTER + yOffset = 16; + } + + startTime = BOMBERS_NOTEBOOK_ENTRY_GET_START_TIME(row, j) - CLOCK_TIME(6, 0); + endTime = BOMBERS_NOTEBOOK_ENTRY_GET_END_TIME(row, j) - CLOCK_TIME(6, 0); + entryRectLeft = + sBombersNotebookDayRectRectLeft[BOMBERS_NOTEBOOK_ENTRY_GET_DAY(row, j)] + (startTime / CLOCK_TIME(0, 10)); + entryRectRight = + sBombersNotebookDayRectRectLeft[BOMBERS_NOTEBOOK_ENTRY_GET_DAY(row, j)] + (endTime / CLOCK_TIME(0, 10)); + entryWidth = entryRectRight - entryRectLeft - 8; + if ((entryRectRight - entryRectLeft) < 8) { + entryRectLeft = ((entryRectLeft + entryRectRight) - entryRectLeft) - 8; + entryRectRight = entryRectLeft + 8; + } + + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookEntryBoxEndTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 2, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (entryRectLeft + 2) * 4, (rectTop + yOffset + 2) * 4, + (entryRectLeft + 6) * 4, (rectTop + yOffset + 18) * 4, 0, 0, 0, 1 << 10, + 1 << 10); + BombersNotebook_DrawScisTexRect(&gfx, (entryRectRight + -2) * 4, (rectTop + yOffset + 2) * 4, + (entryRectRight + 2) * 4, (rectTop + yOffset + 18) * 4, 0, 0x80, 0, 1 << 10, + 1 << 10); + if (entryWidth > 0) { + gDPLoadTextureBlock(gfx++, gBombersNotebookEntryBoxMiddleTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 2, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (entryRectLeft + 6) * 4, (rectTop + yOffset + 2) * 4, + (entryRectLeft + 6 + entryWidth) * 4, (rectTop + yOffset + 18) * 4, 0, 0, 0, + 1 << 10, 1 << 10); + } + + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookEntryBoxEndTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 2, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + //! FAKE: the ^ 0 + BombersNotebook_DrawScisTexRect(&gfx, (entryRectLeft * 4) ^ 0, (rectTop + yOffset) * 4, (entryRectLeft + 4) * 4, + (rectTop + yOffset + 16) * 4, 0, 0, 0, 1 << 10, 1 << 10); + //! FAKE: the ^ 0 + BombersNotebook_DrawScisTexRect(&gfx, (entryRectRight + -4) * 4, (rectTop + yOffset) * 4, + (entryRectRight * 4) ^ 0, (rectTop + yOffset + 16) * 4, 0, 0x80, 0, 1 << 10, + 1 << 10); + if (entryWidth > 0) { + gDPLoadTextureBlock(gfx++, gBombersNotebookEntryBoxMiddleTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 2, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (entryRectLeft + 4) * 4, (rectTop + yOffset) * 4, + (entryRectLeft + 4 + entryWidth) * 4, (rectTop + yOffset + 16) * 4, 0, 0, 0, + 1 << 10, 1 << 10); + } + + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(row, j)])) { + eventIcon = + sBombersNotebookEventIcons[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(row, j) - BOMBERS_NOTEBOOK_PERSON_MAX]; + if ((entryRectRight - entryRectLeft) < sBombersNotebookEventIconWidths[eventIcon]) { + iconRectLeft = + (((entryRectLeft - sBombersNotebookEventIconWidths[eventIcon]) + entryRectRight) - entryRectLeft) + + 3; + } else { + iconRectLeft = (((entryRectRight - entryRectLeft) - sBombersNotebookEventIconWidths[eventIcon]) / 2) + + entryRectLeft; + } + + if ((eventIcon == BOMBERS_NOTEBOOK_EVENT_ICON_MASK) || (eventIcon == BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON)) { + if (sBombersNotebookEntries[row][j] & BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE) { + yOffset -= 12; + } else if (!(sBombersNotebookEntries[row][j] & BOMBERS_NOTEBOOK_ENTRY_POS_BELOW)) { + // BOMBERS_NOTEBOOK_ENTRY_POS_CENTER + yOffset -= 6; + } + } + gDPLoadTextureBlock(gfx++, sBombersNotebookEventIconTextures[eventIcon], G_IM_FMT_IA, G_IM_SIZ_8b, + sBombersNotebookEventIconWidths[eventIcon], sBombersNotebookEventIconHeights[eventIcon], + 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 255); + + BombersNotebook_DrawScisTexRect(&gfx, (iconRectLeft + 2) * 4, (rectTop + yOffset + 2) * 4, + (iconRectLeft + 2 + sBombersNotebookEventIconWidths[eventIcon]) * 4, + (rectTop + yOffset + 2 + sBombersNotebookEventIconHeights[eventIcon]) * 4, + 0, 0, 0, 1 << 10, 1 << 10); + if (sBombersNotebookEventColorWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(row, j) - + BOMBERS_NOTEBOOK_PERSON_MAX] == + BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_NONE) { + gDPSetPrimColor(gfx++, 0, 0, sBombersNotebookEntryIconColors[eventIcon][0], + sBombersNotebookEntryIconColors[eventIcon][1], + sBombersNotebookEntryIconColors[eventIcon][2], 255); + } else if (sBombersNotebookEventColorWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(row, j) - + BOMBERS_NOTEBOOK_PERSON_MAX] == + BOMBERS_NOTEBOOK_EVENT_COLOR_WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN) || + CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN) || + CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN) || + CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN) || + CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN)) { + gDPSetPrimColor(gfx++, 0, 0, sBombersNotebookEntryIconColors[eventIcon][0], + sBombersNotebookEntryIconColors[eventIcon][1], + sBombersNotebookEntryIconColors[eventIcon][2], 255); + } else { + gDPSetPrimColor(gfx++, 0, 0, 155, 155, 155, 255); + } + } else { + if (CHECK_WEEKEVENTREG( + sBombersNotebookEventColorWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(row, j) - + BOMBERS_NOTEBOOK_PERSON_MAX])) { + gDPSetPrimColor(gfx++, 0, 0, sBombersNotebookEntryIconColors[eventIcon][0], + sBombersNotebookEntryIconColors[eventIcon][1], + sBombersNotebookEntryIconColors[eventIcon][2], 255); + } else { + gDPSetPrimColor(gfx++, 0, 0, 155, 155, 155, 255); + } + } + BombersNotebook_DrawScisTexRect(&gfx, iconRectLeft * 4, (rectTop + yOffset) * 4, + (iconRectLeft + sBombersNotebookEventIconWidths[eventIcon]) * 4, + (rectTop + yOffset + sBombersNotebookEventIconHeights[eventIcon]) * 4, 0, 0, + 0, 1 << 10, 1 << 10); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + } else { + unfinishedEvent = true; + } + j += BOMBERS_NOTEBOOK_ENTRY_SIZE; + } + + *gfxP = gfx; +} + +#define DEFINE_PERSON(_enum, photo, _description, _metEnum, _metMessage, _metFlag) &photo, + +TexturePtr sBombersNotebookPhotoTextures[] = { +#include "tables/bombers_notebook/person_table.h" +}; + +#undef DEFINE_PERSON + +void BombersNotebook_DrawRows(BombersNotebook* this, Gfx** gfxP) { + static s16 sBarColorR = 0; + static s16 sBarColorG = 0; + static s16 sBarColorB = 0; + static s16 sBarColorTimer = 10; + static s16 sBarColorIndex = 0; + static s16 sBarColorTargetsR[] = { 100, 0 }; + static s16 sBarColorTargetsG[] = { 80, 0 }; + static s16 sBarColorTargetsB[] = { 255, 0 }; + Gfx* gfx = *gfxP; + s32 photoWidth; + s32 rowEnd; + s32 cursorPage; + u32 barRectLeft; + f32 photoRectDs; + u32 photoOffset; + s32 i; + u32 rectTop; + s16 colorStep; + + colorStep = ABS_ALT(sBarColorR - sBarColorTargetsR[sBarColorIndex]) / sBarColorTimer; + if (sBarColorR >= sBarColorTargetsR[sBarColorIndex]) { + sBarColorR -= colorStep; + } else { + sBarColorR += colorStep; + } + + colorStep = ABS_ALT(sBarColorG - sBarColorTargetsG[sBarColorIndex]) / sBarColorTimer; + if (sBarColorG >= sBarColorTargetsG[sBarColorIndex]) { + sBarColorG -= colorStep; + } else { + sBarColorG += colorStep; + } + + colorStep = ABS_ALT(sBarColorB - sBarColorTargetsB[sBarColorIndex]) / sBarColorTimer; + if (sBarColorB >= sBarColorTargetsB[sBarColorIndex]) { + sBarColorB -= colorStep; + } else { + sBarColorB += colorStep; + } + + sBarColorTimer--; + if (sBarColorTimer == 0) { + sBarColorTimer = 10; + sBarColorR = sBarColorTargetsR[sBarColorIndex]; + sBarColorG = sBarColorTargetsG[sBarColorIndex]; + sBarColorB = sBarColorTargetsB[sBarColorIndex]; + sBarColorIndex ^= 1; + } + + rectTop = this->scrollOffset + 107; + if (this->cursorPage >= (BOMBERS_NOTEBOOK_PERSON_MAX - 8)) { + rowEnd = BOMBERS_NOTEBOOK_PERSON_MAX; + i = this->cursorPage; + } else { + rowEnd = this->cursorPage + 8; + i = rowEnd - 8; + } + cursorPage = i; + for (; i < rowEnd; i++, rectTop += 52) { + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[i])) { + gDPLoadTextureBlock(gfx++, sBombersNotebookPhotoTextures[i], G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + } else { + gDPLoadTextureBlock(gfx++, gBombersNotebookEmptyPhotoTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + } + if ((i == (this->cursorPageRow + cursorPage)) && (this->scrollAmount == 0)) { + barRectLeft = 56; + photoOffset = 8; + photoRectDs = 200.0f; + photoWidth = 64; + } else { + barRectLeft = 48; + photoOffset = 0; + photoRectDs = 150.0f; + photoWidth = 48; + } + BombersNotebook_DrawScisTexRect(&gfx, (57 - photoOffset) * 4, (rectTop - photoOffset) * 4, + (57 - photoOffset + photoWidth) * 4, (rectTop - photoOffset + photoWidth) * 4, + 0, 0, 0, 1024.0f / (photoRectDs / 100.0f), 1024.0f / (photoRectDs / 100.0f)); + + if ((i == (this->cursorPageRow + cursorPage)) && (this->scrollAmount == 0)) { + gDPSetPrimColor(gfx++, 0, 0, sBarColorR, sBarColorG, sBarColorB, 255); + } else { + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 60); + } + gDPLoadTextureBlock(gfx++, gBombersNotebookBarTex, G_IM_FMT_I, G_IM_SIZ_8b, 8, 4, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + BombersNotebook_DrawScisTexRect(&gfx, (barRectLeft + 57) * 4, (rectTop + 22) * 4, + (barRectLeft - photoOffset + 527) * 4, (rectTop + 26) * 4, 0, 0, 0, 1 << 10, + 1 << 10); + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookCircleTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + BombersNotebook_DrawScisTexRect(&gfx, (barRectLeft - photoOffset + 527) * 4, (rectTop + 16) * 4, + (barRectLeft - photoOffset + 543) * 4, (rectTop + 32) * 4, 0, 0, 0, 1 << 10, + 1 << 10); + + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[i])) { + gDPPipeSync(gfx++); + gDPSetRenderMode(gfx++, G_RM_OPA_SURF, G_RM_OPA_SURF2); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + + BombersNotebook_DrawEntries(&gfx, i, rectTop); + + gDPPipeSync(gfx++); + gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + } + } + gDPPipeSync(gfx++); + *gfxP = gfx; +} + +TexturePtr sBombersNotebookDigitTextures[] = { + gBombersNotebookDigit0Tex, gBombersNotebookDigit1Tex, gBombersNotebookDigit2Tex, gBombersNotebookDigit3Tex, + gBombersNotebookDigit4Tex, gBombersNotebookDigit5Tex, gBombersNotebookDigit6Tex, gBombersNotebookDigit7Tex, + gBombersNotebookDigit8Tex, gBombersNotebookDigit9Tex, +}; +u8 sBombersNotebookDigitRectLeftOffsets[] = { 13, 8, 12, 13, 14, 13, 12, 12, 13, 12 }; +s16 sBombersNotebookDayTexRectLeftOffsets[] = { 16, 12, 9 }; + +#define CURRENT_DAY_CLAMP_MIN_1 ((CURRENT_DAY == 0) ? 1 : CURRENT_DAY) +void BombersNotebook_DrawTimeOfDay(Gfx** gfxP) { + Gfx* gfx = *gfxP; + u32 timeOfDayRectLeft; + u32 timeBoxRectLeft; + u32 connectorRectLeft; + u32 lineRectLeft; + u32 digitsRectLeft; + u16 time; + s32 onesDigit; + s32 tensDigit; + s32 hours; + + time = (((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0)); + if (CURRENT_DAY == 0) { + time = 0; + } + timeOfDayRectLeft = sBombersNotebookDayRectRectLeft[CURRENT_DAY] + (time / CLOCK_TIME(0, 10)); + if ((CURRENT_DAY_CLAMP_MIN_1 == 1) || + ((CURRENT_DAY_CLAMP_MIN_1 == 2) && (((void)0, gSaveContext.save.time) < CLOCK_TIME(12, 0)))) { + timeOfDayRectLeft -= 32; + lineRectLeft = timeOfDayRectLeft + 32; + } else if ((CURRENT_DAY_CLAMP_MIN_1 == 2) && (time >= (CLOCK_TIME(17, 0) - CLOCK_TIME(6, 0))) && + (time <= (CLOCK_TIME(19, 0) - CLOCK_TIME(6, 0)))) { + timeOfDayRectLeft -= 64; + lineRectLeft = timeOfDayRectLeft + 64; + } else { + timeOfDayRectLeft -= 96; + lineRectLeft = timeOfDayRectLeft + 96; + } + + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + gDPLoadTextureBlock_4b(gfx++, gBombersNoteoobkTimeOfDayBoxTex, G_IM_FMT_IA, 64, 28, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 6, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, timeOfDayRectLeft * 4, 42 * 4, (timeOfDayRectLeft + 128) * 4, 70 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 255); + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0); + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookTimeOfDayTex, G_IM_FMT_I, 96, 20, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + BombersNotebook_DrawScisTexRect(&gfx, (timeOfDayRectLeft + 16) * 4, 47 * 4, (timeOfDayRectLeft + 112) * 4, 67 * 4, + 0, 0, 0, 1 << 10, 1 << 10); + + gDPPipeSync(gfx++); + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + if (((CURRENT_DAY_CLAMP_MIN_1 >= 3) || + ((CURRENT_DAY_CLAMP_MIN_1 == 2) && (time > (CLOCK_TIME(18, 0) - CLOCK_TIME(6, 0)))))) { + timeBoxRectLeft = timeOfDayRectLeft - 159; + connectorRectLeft = timeOfDayRectLeft - 17; + } else { + timeBoxRectLeft = timeOfDayRectLeft + 130; + connectorRectLeft = timeOfDayRectLeft + 113; + } + + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookTimeBoxLeftTex, G_IM_FMT_IA, 16, 28, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, timeBoxRectLeft * 4, 42 * 4, (timeBoxRectLeft + 16) * 4, 70 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookTimeBoxMiddleTex, G_IM_FMT_IA, 16, 28, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (timeBoxRectLeft + 16) * 4, 42 * 4, (timeBoxRectLeft + 141) * 4, 70 * 4, 0, 0, + 0, 1 << 10, 1 << 10); + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookTimeBoxRightTex, G_IM_FMT_IA, 16, 28, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (timeBoxRectLeft + 141) * 4, 42 * 4, (timeBoxRectLeft + 157) * 4, 70 * 4, 0, + 0, 0, 1 << 10, 1 << 10); + gDPLoadTextureBlock(gfx++, sBombersNotebookDayTextures[CURRENT_DAY_CLAMP_MIN_1 - 1], G_IM_FMT_IA, G_IM_SIZ_8b, 48, + 22, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect( + &gfx, (timeBoxRectLeft + sBombersNotebookDayTexRectLeftOffsets[CURRENT_DAY_CLAMP_MIN_1 - 1]) * 4, 46 * 4, + (timeBoxRectLeft + sBombersNotebookDayTexRectLeftOffsets[CURRENT_DAY_CLAMP_MIN_1 - 1] + 48) * 4, 68 * 4, 0, 0, + 0, 1 << 10, 1 << 10); + + gDPSetPrimColor(gfx++, 0, 0, 150, 150, 150, 255); + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookCircleTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (timeBoxRectLeft + 56) * 4, 48 * 4, (timeBoxRectLeft + 72) * 4, 0x100, 0, 0, + 0, 1 << 10, 1 << 10); + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0); + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 255); + + tensDigit = 0; + onesDigit = ((void)0, gSaveContext.save.time) / CLOCK_TIME_HOUR; + if (CURRENT_DAY == 0) { + onesDigit = 6; + } + hours = onesDigit; + do { + if (onesDigit >= 10) { + tensDigit++; + onesDigit -= 10; + } + } while (onesDigit >= 10); + + digitsRectLeft = timeBoxRectLeft + 75; + gDPLoadTextureBlock_4b(gfx++, sBombersNotebookDigitTextures[tensDigit], G_IM_FMT_I, 16, 17, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, digitsRectLeft * 4, 48 * 4, (digitsRectLeft + 16) * 4, 65 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + + digitsRectLeft += sBombersNotebookDigitRectLeftOffsets[tensDigit]; + gDPLoadTextureBlock_4b(gfx++, sBombersNotebookDigitTextures[onesDigit], G_IM_FMT_I, 16, 17, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, digitsRectLeft * 4, 48 * 4, (digitsRectLeft + 16) * 4, 65 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + + digitsRectLeft += sBombersNotebookDigitRectLeftOffsets[onesDigit]; + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookColonTex, G_IM_FMT_I, 16, 17, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, digitsRectLeft * 4, 48 * 4, (digitsRectLeft + 16) * 4, 65 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + + digitsRectLeft += 7; + tensDigit = 0; + if (CURRENT_DAY == 0) { + onesDigit = TIME_TO_MINUTES_ALT_F((CLOCK_TIME_F(6, 0) - (hours * CLOCK_TIME_HOUR_F))); + } else { + onesDigit = TIME_TO_MINUTES_ALT_F(((void)0, gSaveContext.save.time) - (hours * CLOCK_TIME_HOUR_F)); + } + do { + if (onesDigit >= 10) { + tensDigit++; + onesDigit -= 10; + } + } while (onesDigit >= 10); + + gDPLoadTextureBlock_4b(gfx++, sBombersNotebookDigitTextures[tensDigit], G_IM_FMT_I, 16, 17, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, digitsRectLeft * 4, 48 * 4, (digitsRectLeft + 16) * 4, 65 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + digitsRectLeft += sBombersNotebookDigitRectLeftOffsets[tensDigit]; + gDPLoadTextureBlock_4b(gfx++, sBombersNotebookDigitTextures[onesDigit], G_IM_FMT_I, 16, 17, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, digitsRectLeft * 4, 48 * 4, (digitsRectLeft + 16) * 4, 65 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + + gDPPipeSync(gfx++); + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookConnectorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 14, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, connectorRectLeft * 4, 49 * 4, (connectorRectLeft + 32) * 4, 63 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + + gDPSetPrimColor(gfx++, 0, 0, 242, 0, 14, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookLineTex, G_IM_FMT_I, G_IM_SIZ_8b, 8, 1, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, lineRectLeft * 4, 74 * 4, (lineRectLeft + 32) * 4, 490 * 4, 0, 0, 0, 1 << 10, + 1 << 10); + + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, + ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, 255); + gDPSetEnvColor(gfx++, 200, 0, 0, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookArrowTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + BombersNotebook_DrawScisTexRect(&gfx, (lineRectLeft + -11) * 4, 70 * 4, (lineRectLeft + 13) * 4, 86 * 4, 0, 0, 0, + 1 << 10, 1 << 10); + + gDPPipeSync(gfx++); + *gfxP = gfx; +} + +void BombersNotebook_DrawCursor(BombersNotebook* this, Gfx** gfxP) { + Gfx* gfx = *gfxP; + s32 cursorRow; + s32 cursorEntry; + s32 entryRectRight; + s32 entryRectLeft; + s32 entryIcon; + u32 cursorRectLeft; + u32 cursorRectTop; + u32 yOffset; + u16 startTime; + u16 endTime; + + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, + ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfx++, 0, 0, 255, 205, 55, 255); + gDPSetEnvColor(gfx++, 0, 0, 0, 255); + gDPLoadTextureBlock_4b(gfx++, gBombersNotebookCursorTex, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); + + if (this->cursorEntry == 0) { + BombersNotebook_DrawScisTexRect(&gfx, 47 * 4, (this->cursorPageRow * 52 + 97) * 4, 63 * 4, + (this->cursorPageRow * 52 + 113) * 4, 0, 0, 0, 1 << 10, 1 << 10); + BombersNotebook_DrawScisTexRect(&gfx, 98 * 4, (this->cursorPageRow * 52 + 97) * 4, 114 * 4, + (this->cursorPageRow * 52 + 113) * 4, 0, 0x200, 0, 1 << 10, 1 << 10); + BombersNotebook_DrawScisTexRect(&gfx, 47 * 4, (this->cursorPageRow * 52 + 147) * 4, 63 * 4, + (this->cursorPageRow * 52 + 163) * 4, 0, 0, 0x200, 1 << 10, 1 << 10); + BombersNotebook_DrawScisTexRect(&gfx, 98 * 4, (this->cursorPageRow * 52 + 147) * 4, 114 * 4, + (this->cursorPageRow * 52 + 163) * 4, 0, 0x200, 0x200, 1 << 10, 1 << 10); + } else { + cursorRow = this->cursorPageRow + this->cursorPage; + cursorRectTop = (this->cursorPageRow * 52) + 107; + cursorEntry = this->cursorEntry - BOMBERS_NOTEBOOK_ENTRY_SIZE; // Offset from photo entry + if (sBombersNotebookEntries[cursorRow][cursorEntry] & BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE) { + yOffset = 8; + } else if (sBombersNotebookEntries[cursorRow][cursorEntry] & BOMBERS_NOTEBOOK_ENTRY_POS_BELOW) { + yOffset = 24; + } else { // BOMBERS_NOTEBOOK_ENTRY_POS_CENTER + yOffset = 16; + } + + startTime = BOMBERS_NOTEBOOK_ENTRY_GET_START_TIME(cursorRow, cursorEntry) - CLOCK_TIME(6, 0); + endTime = BOMBERS_NOTEBOOK_ENTRY_GET_END_TIME(cursorRow, cursorEntry) - CLOCK_TIME(6, 0); + entryRectLeft = sBombersNotebookDayRectRectLeft[BOMBERS_NOTEBOOK_ENTRY_GET_DAY(cursorRow, cursorEntry)] + + (startTime / CLOCK_TIME(0, 10)); + entryRectRight = sBombersNotebookDayRectRectLeft[BOMBERS_NOTEBOOK_ENTRY_GET_DAY(cursorRow, cursorEntry)] + + (endTime / CLOCK_TIME(0, 10)); + if ((entryRectRight - entryRectLeft) < 8) { + entryRectLeft = ((entryRectLeft + entryRectRight) - entryRectLeft) - 8; + entryRectRight = entryRectLeft + 8; + } + entryIcon = sBombersNotebookEventIcons[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT(cursorRow, cursorEntry) - + BOMBERS_NOTEBOOK_PERSON_MAX]; + if ((entryRectRight - entryRectLeft) < sBombersNotebookEventIconWidths[entryIcon]) { + cursorRectLeft = + (((entryRectLeft - sBombersNotebookEventIconWidths[entryIcon]) + entryRectRight) - entryRectLeft) + 3; + } else { + cursorRectLeft = + (((entryRectRight - entryRectLeft) - sBombersNotebookEventIconWidths[entryIcon]) / 2) + entryRectLeft; + } + if (entryIcon == BOMBERS_NOTEBOOK_EVENT_ICON_EXCLAMATION_POINT) { + cursorRectLeft -= 8; + cursorRectTop -= 8; + } else { + cursorRectLeft -= 9; + cursorRectTop -= 8; + } + if ((entryIcon == BOMBERS_NOTEBOOK_EVENT_ICON_MASK) || (entryIcon == BOMBERS_NOTEBOOK_EVENT_ICON_RIBBON)) { + if (sBombersNotebookEntries[cursorRow][cursorEntry] & BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE) { + yOffset -= 12; + } else if (!(sBombersNotebookEntries[cursorRow][cursorEntry] & BOMBERS_NOTEBOOK_ENTRY_POS_BELOW)) { + // BOMBERS_NOTEBOOK_ENTRY_POS_CENTER + yOffset -= 6; + } + } + BombersNotebook_DrawScisTexRect(&gfx, cursorRectLeft * 4, (cursorRectTop + yOffset) * 4, + (cursorRectLeft + 16) * 4, (cursorRectTop + yOffset + 16) * 4, 0, 0, 0, 1 << 10, + 1 << 10); + BombersNotebook_DrawScisTexRect(&gfx, (cursorRectLeft + sBombersNotebookEventIconWidths[entryIcon]) * 4, + (cursorRectTop + yOffset) * 4, + (cursorRectLeft + sBombersNotebookEventIconWidths[entryIcon] + 16) * 4, + (cursorRectTop + yOffset + 16) * 4, 0, 0x200, 0, 1 << 10, 1 << 10); + BombersNotebook_DrawScisTexRect( + &gfx, cursorRectLeft * 4, (cursorRectTop + yOffset + sBombersNotebookEventIconHeights[entryIcon]) * 4, + (cursorRectLeft + 16) * 4, (cursorRectTop + yOffset + sBombersNotebookEventIconHeights[entryIcon] + 16) * 4, + 0, 0, 0x200, 1 << 10, 1 << 10); + BombersNotebook_DrawScisTexRect(&gfx, (cursorRectLeft + sBombersNotebookEventIconWidths[entryIcon]) * 4, + (cursorRectTop + yOffset + sBombersNotebookEventIconHeights[entryIcon]) * 4, + (cursorRectLeft + sBombersNotebookEventIconWidths[entryIcon] + 16) * 4, + (cursorRectTop + yOffset + sBombersNotebookEventIconHeights[entryIcon] + 16) * + 4, + 0, 0x200, 0x200, 1 << 10, 1 << 10); + } + + gDPPipeSync(gfx++); + *gfxP = gfx; +} + +void BombersNotebook_DrawArrows(BombersNotebook* this, Gfx** gfxP) { + static s16 sUpperArrowColorR = 0; + static s16 sUpperArrowColorG = 100; + static s16 sUpperArrowColorB = 255; + static s16 sLowerArrowColorR = 0; + static s16 sLowerArrowColorG = 100; + static s16 sLowerArrowColorB = 255; + static s16 sUpperArrowColorIndex = 0; + static s16 sLowerArrowColorIndex = 0; + static s16 sUpperArrowColorTimer = 6; + static s16 sLowerArrowColorTimer = 6; + static s16 sUpperArrowOffsetY = 0; + static s16 sLowerArrowOffsetY = 0; + static s16 sArrowColorTargetsG[] = { 175, 100 }; + static s16 sArrowColorTargetsB[] = { 205, 255 }; + Gfx* gfx = *gfxP; + u32 rectTop; + s16 colorStep; + + gDPPipeSync(gfx++); + gDPLoadTextureBlock(gfx++, gBombersNotebookArrowTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_MIRROR | G_TX_WRAP, G_TX_NOMASK, 4, G_TX_NOLOD, G_TX_NOLOD); + + colorStep = ABS_ALT(sUpperArrowColorG - sArrowColorTargetsG[sUpperArrowColorIndex]) / sUpperArrowColorTimer; + if (sUpperArrowColorG >= sArrowColorTargetsG[sUpperArrowColorIndex]) { + sUpperArrowColorG -= colorStep; + } else { + sUpperArrowColorG += colorStep; + } + + colorStep = ABS_ALT(sUpperArrowColorB - sArrowColorTargetsB[sUpperArrowColorIndex]) / sUpperArrowColorTimer; + if (sUpperArrowColorB >= sArrowColorTargetsB[sUpperArrowColorIndex]) { + sUpperArrowColorB -= colorStep; + } else { + sUpperArrowColorB += colorStep; + } + + sUpperArrowColorTimer--; + if (sUpperArrowColorTimer == 0) { + sUpperArrowOffsetY ^= 6; + sUpperArrowColorTimer = 6; + sUpperArrowColorG = sArrowColorTargetsG[sUpperArrowColorIndex]; + sUpperArrowColorB = sArrowColorTargetsB[sUpperArrowColorIndex]; + sUpperArrowColorIndex ^= 1; + } + + colorStep = ABS_ALT(sLowerArrowColorG - sArrowColorTargetsG[sLowerArrowColorIndex]) / sLowerArrowColorTimer; + if (sLowerArrowColorG >= sArrowColorTargetsG[sLowerArrowColorIndex]) { + sLowerArrowColorG -= colorStep; + } else { + sLowerArrowColorG += colorStep; + } + + colorStep = ABS_ALT(sLowerArrowColorB - sArrowColorTargetsB[sLowerArrowColorIndex]) / sLowerArrowColorTimer; + if (sLowerArrowColorB >= sArrowColorTargetsB[sLowerArrowColorIndex]) { + sLowerArrowColorB -= colorStep; + } else { + sLowerArrowColorB += colorStep; + } + + sLowerArrowColorTimer--; + if (sLowerArrowColorTimer == 0) { + sLowerArrowOffsetY ^= 6; + sLowerArrowColorTimer = 6; + sLowerArrowColorG = sArrowColorTargetsG[sLowerArrowColorIndex]; + sLowerArrowColorB = sArrowColorTargetsB[sLowerArrowColorIndex]; + sLowerArrowColorIndex ^= 1; + } + + if (this->cursorPage != 0) { + gDPPipeSync(gfx++); + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, + ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(gfx++, 0, 0, sUpperArrowColorR, sUpperArrowColorG, sUpperArrowColorB, 255); + gDPSetEnvColor(gfx++, sUpperArrowColorR, sUpperArrowColorG, sUpperArrowColorB, 255); + rectTop = (-sUpperArrowOffsetY + 83) * 4; + BombersNotebook_DrawScisTexRect(&gfx, 46 * 4, rectTop, 70 * 4, rectTop + (16 * 4), 0, 0, 0x200, 1 << 10, + 1 << 10); + } + + if (this->cursorPage < 16) { + gDPPipeSync(gfx++); + gDPSetPrimColor(gfx++, 0, 0, sLowerArrowColorR, sLowerArrowColorG, sLowerArrowColorB, 255); + gDPSetEnvColor(gfx++, sLowerArrowColorR, sLowerArrowColorG, sLowerArrowColorB, 255); + BombersNotebook_DrawScisTexRect(&gfx, 46 * 4, (sLowerArrowOffsetY + 319) * 4, 70 * 4, + (sLowerArrowOffsetY + 335) * 4, 0, 0, 0, 1 << 10, 1 << 10); + } + gDPPipeSync(gfx++); + *gfxP = gfx; +} + +void BombersNotebook_Draw(BombersNotebook* this, GraphicsContext* gfxCtx) { + Gfx* gfx; + s32 pad[2]; + + func_8012CF0C(gfxCtx, this->loadState != BOMBERS_NOTEBOOK_LOAD_STATE_DONE, false, 0, 0, 0); + + OPEN_DISPS(gfxCtx); + + gfx = POLY_OPA_DISP; + + if (this->loadState == BOMBERS_NOTEBOOK_LOAD_STATE_DONE) { + gSPSegment(gfx++, 0x07, this->scheduleDmaSegment); + gSPSegment(gfx++, 0x08, this->scheduleSegment); + gfx = Gfx_SetupDL39(gfx); + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, + ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetRenderMode(gfx++, G_RM_OPA_SURF, G_RM_OPA_SURF2); + gDPSetPrimColor(gfx++, 0, 0, 255, 255, 215, 255); + gDPSetEnvColor(gfx++, 100, 100, 100, 255); + gDPLoadTextureBlock(gfx++, gBombersNotebookBackgroundTex, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + + BombersNotebook_DrawScisTexRect(&gfx, 0 * 4, 0 * 4, SCREEN_WIDTH_HIRES * 4, SCREEN_HEIGHT_HIRES * 4, 0, 0, 0, + 0x200, 0x200); + + gDPPipeSync(gfx++); + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + + BombersNotebook_DrawHeaders(&gfx); + BombersNotebook_DrawColumns(&gfx); + + gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 86, 600, 450); + BombersNotebook_DrawRows(this, &gfx); + + gDPPipeSync(gfx++); + gSPDisplayList(gfx++, D_0E000000.setScissor); + + BombersNotebook_DrawTimeOfDay(&gfx); + + if (this->scrollAmount == 0) { + BombersNotebook_DrawCursor(this, &gfx); + } + BombersNotebook_DrawArrows(this, &gfx); + } + POLY_OPA_DISP = gfx; + + CLOSE_DISPS(gfxCtx); +} + +void BombersNotebook_LoadFiles(BombersNotebook* this, s32 flag) { + switch (this->loadState) { + case BOMBERS_NOTEBOOK_LOAD_STATE_NONE: + if (this->scheduleDmaSegment == NULL) { + break; + } + CmpDma_LoadAllFiles(this->scheduleDmaSegmentStart, this->scheduleDmaSegment, this->scheduleDmaSegmentSize); + osCreateMesgQueue(&this->loadQueue, this->loadMsg, ARRAY_COUNT(this->loadMsg)); + DmaMgr_SendRequestImpl(&this->dmaRequest, this->scheduleSegment, this->scheduleSegmentStart, + this->scheduleSegmentSize, 0, &this->loadQueue, NULL); + this->loadState = BOMBERS_NOTEBOOK_LOAD_STATE_STARTED; + // fallthrough + case BOMBERS_NOTEBOOK_LOAD_STATE_STARTED: + if (osRecvMesg(&this->loadQueue, NULL, flag) == 0) { + this->loadState = BOMBERS_NOTEBOOK_LOAD_STATE_DONE; + } + break; + + default: + break; + } +} + +#define DEFINE_PERSON(_enum, _photo, description, _metEnum, _metMessage, _metFlag) description, +#define DEFINE_EVENT(_enum, _icon, _colorFlag, description, _completedMessage, _completedFlag) description, + +u16 sBombersNotebookTextIds[] = { +#include "tables/bombers_notebook/person_table.h" +#include "tables/bombers_notebook/event_table.h" +}; + +#undef DEFINE_PERSON +#undef DEFINE_EVENT + +void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input) { + static s16 sStickXRepeatTimer = 0; + static s16 sStickYRepeatTimer = 0; + static s16 sStickXRepeatState = 0; + static s16 sStickYRepeatState = 0; + s32 stickAdjX = input->rel.stick_x; + s32 stickAdjY = input->rel.stick_y; + s32 cursorEntryScan; + + this->scheduleDmaSegmentStart = SEGMENT_ROM_START(schedule_dma_static_test); + this->scheduleDmaSegmentSize = SEGMENT_ROM_SIZE(schedule_dma_static_old); + this->scheduleSegmentStart = SEGMENT_ROM_START(schedule_static); + this->scheduleSegmentSize = SEGMENT_ROM_SIZE(schedule_static); + + if (this->scheduleDmaSegment == NULL) { + this->scheduleDmaSegment = ZeldaArena_Malloc(this->scheduleDmaSegmentSize); + } + + if (this->scheduleSegment == NULL) { + this->scheduleSegment = ZeldaArena_Malloc(this->scheduleSegmentSize); + } + + BombersNotebook_LoadFiles(this, OS_MESG_NOBLOCK); + + if (this->loadState == BOMBERS_NOTEBOOK_LOAD_STATE_DONE) { + if (stickAdjX < -30) { + if (sStickXRepeatState == -1) { + sStickXRepeatTimer--; + if (sStickXRepeatTimer < 0) { + sStickXRepeatTimer = 2; + } else { + stickAdjX = 0; + } + } else { + sStickXRepeatTimer = 10; + sStickXRepeatState = -1; + } + } else if (stickAdjX > 30) { + if (sStickXRepeatState == 1) { + sStickXRepeatTimer--; + if (sStickXRepeatTimer < 0) { + sStickXRepeatTimer = 2; + } else { + stickAdjX = 0; + } + } else { + sStickXRepeatTimer = 10; + sStickXRepeatState = 1; + } + } else { + sStickXRepeatState = 0; + } + + if (stickAdjY < -30) { + if (sStickYRepeatState == -1) { + sStickYRepeatTimer--; + if (sStickYRepeatTimer < 0) { + sStickYRepeatTimer = 2; + } else { + stickAdjY = 0; + } + } else { + sStickYRepeatTimer = 10; + sStickYRepeatState = -1; + } + } else if (stickAdjY > 30) { + if (sStickYRepeatState == 1) { + sStickYRepeatTimer--; + if (sStickYRepeatTimer < 0) { + sStickYRepeatTimer = 2; + } else { + stickAdjY = 0; + } + } else { + sStickYRepeatTimer = 10; + sStickYRepeatState = 1; + } + } else { + sStickYRepeatState = 0; + } + + if (this->scrollAmount == 0) { + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[this->cursorPageRow + this->cursorPage])) { + cursorEntryScan = this->cursorEntry; + if (stickAdjX > 30) { + while (true) { + cursorEntryScan += BOMBERS_NOTEBOOK_ENTRY_SIZE; + if (sBombersNotebookEntries[this->cursorPageRow + this->cursorPage] + [cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE] == + BOMBERS_NOTEBOOK_ENTRY_END) { + while (true) { + cursorEntryScan -= BOMBERS_NOTEBOOK_ENTRY_SIZE; + if (cursorEntryScan == 0) { + play_sound(NA_SE_SY_ERROR); + break; + } + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( + this->cursorPageRow + this->cursorPage, + cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE)])) { + play_sound(NA_SE_SY_ERROR); + break; + } + } + break; + } + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( + this->cursorPageRow + this->cursorPage, + cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE)])) { + play_sound(NA_SE_SY_CURSOR); + break; + } + } + this->cursorEntry = cursorEntryScan; + } else if (stickAdjX < -30) { + if (cursorEntryScan != 0) { + do { + cursorEntryScan -= BOMBERS_NOTEBOOK_ENTRY_SIZE; + if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( + this->cursorPageRow + this->cursorPage, + cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE)])) { + play_sound(NA_SE_SY_CURSOR); + break; + } + } while (cursorEntryScan != 0); + this->cursorEntry = cursorEntryScan; + } + } + if (this->cursorEntry != 0) { + if (play->msgCtx.currentTextId != + sBombersNotebookTextIds[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( + this->cursorPageRow + this->cursorPage, this->cursorEntry - BOMBERS_NOTEBOOK_ENTRY_SIZE)]) { + Message_ContinueTextbox(play, sBombersNotebookTextIds[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( + this->cursorPageRow + this->cursorPage, + this->cursorEntry - BOMBERS_NOTEBOOK_ENTRY_SIZE)]); + } + } else { + if (play->msgCtx.currentTextId != sBombersNotebookTextIds[this->cursorPageRow + this->cursorPage]) { + Message_ContinueTextbox(play, sBombersNotebookTextIds[this->cursorPageRow + this->cursorPage]); + } + } + } else { + Message_CloseTextbox(play); + } + + if (stickAdjY < -30) { + if (this->cursorPageRow < 3) { + play_sound(NA_SE_SY_CURSOR); + this->cursorEntry = 0; + this->cursorPageRow++; + } else if (this->cursorPage < (BOMBERS_NOTEBOOK_PERSON_MAX - 4)) { + if (sStickYRepeatState == -1) { + this->scrollAmount = -24; + } else { + this->scrollAmount = -12; + } + this->scrollOffset = 0; + this->cursorEntry = 0; + } + } else if (stickAdjY > 30) { + if (this->cursorPageRow > 0) { + play_sound(NA_SE_SY_CURSOR); + this->cursorEntry = 0; + this->cursorPageRow--; + } else if (this->cursorPage != 0) { + play_sound(NA_SE_SY_CURSOR); + this->cursorPage--; + if (sStickYRepeatState == 1) { + this->scrollAmount = 24; + } else { + this->scrollAmount = 12; + } + this->scrollOffset = -48; + this->cursorEntry = 0; + } + } + } else if (this->scrollAmount < 0) { + this->scrollOffset += this->scrollAmount; + if (ABS_ALT(this->scrollOffset) >= 48) { + play_sound(NA_SE_SY_CURSOR); + this->scrollOffset = 0; + this->scrollAmount = 0; + this->cursorPage++; + } + } else { + this->scrollOffset += this->scrollAmount; + if (this->scrollOffset == 0) { + this->scrollOffset = 0; + this->scrollAmount = 0; + } + } + } +} + +void BombersNotebook_Init(BombersNotebook* this) { + bzero(this, sizeof(BombersNotebook)); +} + +void BombersNotebook_Destroy(BombersNotebook* this) { + if (this->loadState == BOMBERS_NOTEBOOK_LOAD_STATE_STARTED) { + BombersNotebook_LoadFiles(this, OS_MESG_BLOCK); + } + if (this->scheduleDmaSegment != NULL) { + ZeldaArena_Free(this->scheduleDmaSegment); + this->scheduleDmaSegment = NULL; + } + //! @bug: Does not free malloc'd memory for schedule segment +} diff --git a/src/code/z_quake.c b/src/code/z_quake.c index c5115375c3..8225c6347f 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "z64quake.h" #include "z64view.h" diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index cff66dacbb..79af1b73f9 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #define ANIM_INTERP 1 diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 737d480ad0..efe92eebc9 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -145,7 +145,7 @@ s32 func_808B736C(BgBreakwall* this, PlayState* play) { } s32 func_808B7380(BgBreakwall* this, PlayState* play) { - if ((gSaveContext.save.day >= 2) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((gSaveContext.save.day >= 2) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } return true; diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index 8bf39145c9..132f8f13f7 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -133,11 +133,11 @@ void BgUmajump_Update(Actor* thisx, PlayState* play) { Actor_SetObjectDependency(play, &this->dyna.actor); if (this->dyna.actor.params == BG_UMAJUMP_TYPE_5) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_umajump_Colheader_001558); } } else if (this->dyna.actor.params == BG_UMAJUMP_TYPE_6) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_umajump_Colheader_001558); } } else if ((this->dyna.actor.params == BG_UMAJUMP_TYPE_4) || (this->dyna.actor.params == BG_UMAJUMP_TYPE_3)) { @@ -154,11 +154,11 @@ void BgUmajump_Update(Actor* thisx, PlayState* play) { this->dyna.actor.update = func_8091A5A0; } else if ((this->dyna.actor.params == BG_UMAJUMP_TYPE_5) || (this->dyna.actor.params == BG_UMAJUMP_TYPE_6)) { if (this->dyna.actor.params == BG_UMAJUMP_TYPE_5) { - if ((this->dyna.bgId == BGACTOR_NEG_ONE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((this->dyna.bgId == BGACTOR_NEG_ONE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_umajump_Colheader_001558); } } else if ((this->dyna.actor.params == BG_UMAJUMP_TYPE_6) && (this->dyna.bgId == BGACTOR_NEG_ONE) && - (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01) || + (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM) || ((gSaveContext.save.day == 2) && (gSaveContext.save.isNight == true) && ((gSaveContext.save.time >= CLOCK_TIME(5, 30)) && (gSaveContext.save.time <= CLOCK_TIME(6, 0)))))) { @@ -190,18 +190,18 @@ void func_8091A5A0(Actor* thisx, PlayState* play) { } if (this->dyna.actor.params == BG_UMAJUMP_TYPE_5) { - if ((this->dyna.bgId == BGACTOR_NEG_ONE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((this->dyna.bgId == BGACTOR_NEG_ONE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_umajump_Colheader_001558); - } else if ((this->dyna.bgId != BGACTOR_NEG_ONE) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + } else if ((this->dyna.bgId != BGACTOR_NEG_ONE) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } } else if (this->dyna.actor.params == BG_UMAJUMP_TYPE_6) { if ((this->dyna.bgId == BGACTOR_NEG_ONE) && - (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01) || + (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM) || ((gSaveContext.save.day == 2) && (gSaveContext.save.isNight == true) && (gSaveContext.save.time >= CLOCK_TIME(5, 30)) && (gSaveContext.save.time <= CLOCK_TIME(6, 0))))) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_umajump_Colheader_001558); - } else if ((this->dyna.bgId != BGACTOR_NEG_ONE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01) && + } else if ((this->dyna.bgId != BGACTOR_NEG_ONE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM) && ((gSaveContext.save.day != 2) || (gSaveContext.save.isNight != true) || (gSaveContext.save.time < CLOCK_TIME(5, 30)) || (gSaveContext.save.time > CLOCK_TIME(6, 0)))) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 61f493b83f..0a8df4f40d 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -25,7 +25,7 @@ static u8 D_80BD3DB0[] = { /* 0x08 */ SCHEDULE_CMD_RET_VAL_L(1), /* 0x0B */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x20 - 0x0F), /* 0x0F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 0, 23, 0, 0x1D - 0x15), - /* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_50_20, 0x1C - 0x19), + /* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x1C - 0x19), /* 0x19 */ SCHEDULE_CMD_RET_VAL_L(1), /* 0x1C */ SCHEDULE_CMD_RET_NONE(), /* 0x1D */ SCHEDULE_CMD_RET_VAL_L(3), diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.c b/src/overlays/actors/ovl_En_Baba/z_en_baba.c index f41dcbd312..e62cc45f44 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -293,9 +293,9 @@ void EnBaba_HandleConversation(EnBaba* this, PlayState* play) { if (this->stateFlags & BOMB_SHOP_LADY_STATE_END_CONVERSATION) { if (this->stateFlags & BOMB_SHOP_LADY_STATE_GAVE_BLAST_MASK) { this->stateFlags &= ~BOMB_SHOP_LADY_STATE_GAVE_BLAST_MASK; - func_80151BB4(play, 0x33); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK); } - func_80151BB4(play, 4); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY); } } @@ -602,7 +602,7 @@ void EnBaba_Talk(EnBaba* this, PlayState* play) { play->msgCtx.stateTimer = 4; if (this->stateFlags & BOMB_SHOP_LADY_STATE_AUTOTALK) { if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - if (play->msgCtx.unk120B1 == 0) { + if (play->msgCtx.bombersNotebookEventQueueCount == 0) { SET_WEEKEVENTREG(WEEKEVENTREG_81_02); EnBaba_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7)); return; @@ -625,7 +625,7 @@ void EnBaba_Talk(EnBaba* this, PlayState* play) { } } } else if (talkState == TEXT_STATE_DONE) { - if (Message_ShouldAdvance(play) && (play->msgCtx.unk120B1 == 0)) { + if (Message_ShouldAdvance(play) && (play->msgCtx.bombersNotebookEventQueueCount == 0)) { SET_WEEKEVENTREG(WEEKEVENTREG_81_02); EnBaba_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7)); } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 834d5f7f79..19f2e1d9b1 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -309,9 +309,9 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { break; case 5: - func_80151BB4(play, 0x24); - func_80151BB4(play, 0x25); - func_80151BB4(play, 0); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS); this->actionFunc = func_809C51B4; sp28 = true; break; @@ -330,7 +330,7 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { void func_809C51B4(EnBomBowlMan* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((play->msgCtx.unk120B1 == 0) && + if ((play->msgCtx.bombersNotebookEventQueueCount == 0) && ((play->msgCtx.msgMode == 0) || (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE))) { play->nextEntrance = Entrance_CreateFromSpawn(6); gSaveContext.nextCutsceneIndex = 0; @@ -432,9 +432,9 @@ void func_809C5598(EnBomBowlMan* this, PlayState* play) { } else if (this->actor.textId == 0x735) { this->unk_2C2 = 0; func_809C493C(this, 17, 1.0f); - func_80151BB4(play, 0x24); - func_80151BB4(play, 0x25); - func_80151BB4(play, 0); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS); func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->actionFunc = func_809C5738; return; @@ -448,7 +448,7 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) { s16 yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2A0); if (this->unk_2C2 == 0) { - if ((play->msgCtx.unk120B1 == 0) && + if ((play->msgCtx.bombersNotebookEventQueueCount == 0) && ((play->msgCtx.msgMode == 0) || (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE))) { this->unk_2C2 = 1; func_809C4B6C(this); diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 266e2c47b9..aa74c5007d 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -117,7 +117,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnCow_Idle; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01) && (CURRENT_DAY != 1) && + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM) && (CURRENT_DAY != 1) && (EN_COW_TYPE(thisx) == EN_COW_TYPE_ABDUCTED)) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 07dfe95f07..89bf08d7b7 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -157,7 +157,7 @@ u16 EnFsn_GetWelcome(PlayState* play) { void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) { switch (this->textId) { case 0: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_80_10)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_PRIORITY_MAIL)) { this->textId = 0x29E0; break; } else { @@ -171,7 +171,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) { this->flags |= ENFSN_GIVE_ITEM; this->flags |= ENFSN_GAVE_LETTER_TO_MAMA; this->getItemId = GI_LETTER_TO_MAMA; - SET_WEEKEVENTREG(WEEKEVENTREG_80_10); + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_PRIORITY_MAIL); this->textId = 0x29F1; break; } else { @@ -194,7 +194,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) { this->flags |= ENFSN_GIVE_ITEM; this->flags |= ENFSN_GAVE_LETTER_TO_MAMA; this->getItemId = GI_LETTER_TO_MAMA; - SET_WEEKEVENTREG(WEEKEVENTREG_80_10); + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_PRIORITY_MAIL); this->textId = 0x29F1; break; @@ -210,13 +210,13 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) { if (this->flags & ENFSN_END_CONVERSATION) { if (this->flags & ENFSN_GAVE_LETTER_TO_MAMA) { this->flags &= ~ENFSN_GAVE_LETTER_TO_MAMA; - func_80151BB4(play, 34); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL); } if (this->flags & ENFSN_GAVE_KEATONS_MASK) { this->flags &= ~ENFSN_GAVE_KEATONS_MASK; - func_80151BB4(play, 33); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK); } - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); } } @@ -425,7 +425,7 @@ s32 EnFsn_TestEndInteraction(EnFsn* this, PlayState* play, Input* input) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) { this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1; Message_StartTextbox(play, this->actor.textId, &this->actor); - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); this->actionFunc = EnFsn_SetupEndInteraction; return true; } @@ -473,7 +473,7 @@ s32 EnFsn_FacingShopkeeperDialogResult(EnFsn* this, PlayState* play) { func_8019F230(); this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1; Message_StartTextbox(play, this->actor.textId, &this->actor); - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); this->actionFunc = EnFsn_SetupEndInteraction; return true; @@ -977,7 +977,7 @@ void EnFsn_DeterminePrice(EnFsn* this, PlayState* play) { this->actor.textId = 0x29D1; } Message_StartTextbox(play, this->actor.textId, &this->actor); - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); this->actionFunc = EnFsn_SetupEndInteraction; } } @@ -1036,8 +1036,8 @@ void EnFsn_MakeOffer(EnFsn* this, PlayState* play) { void EnFsn_GiveItem(EnFsn* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { if ((this->isSelling == true) && (this->items[this->cursorIndex]->getItemId == GI_MASK_ALL_NIGHT)) { - func_80151BB4(play, 45); - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); } this->actor.parent = NULL; if (ENFSN_IS_SHOP(&this->actor) && !this->isSelling) { @@ -1053,7 +1053,7 @@ void EnFsn_GiveItem(EnFsn* this, PlayState* play) { void EnFsn_SetupResumeInteraction(EnFsn* this, PlayState* play) { if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - if (play->msgCtx.unk120B1 == 0) { + if (play->msgCtx.bombersNotebookEventQueueCount == 0) { EnFsn_HandleSetupResumeInteraction(this, play); } } else { @@ -1239,7 +1239,7 @@ void EnFsn_SetupEndInteraction(EnFsn* this, PlayState* play) { if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) { if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - if (play->msgCtx.unk120B1 == 0) { + if (play->msgCtx.bombersNotebookEventQueueCount == 0) { EnFsn_EndInteraction(this, play); } else { play->msgCtx.msgMode = 0x43; @@ -1311,7 +1311,7 @@ void EnFsn_AskCanBuyMore(EnFsn* this, PlayState* play) { func_8019F230(); this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1; Message_StartTextbox(play, this->actor.textId, &this->actor); - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); break; default: @@ -1320,7 +1320,7 @@ void EnFsn_AskCanBuyMore(EnFsn* this, PlayState* play) { } } else if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) { if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - if (play->msgCtx.unk120B1 == 0) { + if (play->msgCtx.bombersNotebookEventQueueCount == 0) { EnFsn_EndInteraction(this, play); } else { play->msgCtx.msgMode = 0x43; @@ -1362,7 +1362,7 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, PlayState* play) { func_8019F230(); this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1; Message_StartTextbox(play, this->actor.textId, &this->actor); - func_80151BB4(play, 3); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN); break; default: @@ -1371,7 +1371,7 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, PlayState* play) { } } else if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) { if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - if (play->msgCtx.unk120B1 == 0) { + if (play->msgCtx.bombersNotebookEventQueueCount == 0) { EnFsn_EndInteraction(this, play); } else { play->msgCtx.msgMode = 0x43; diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index bdc4637d14..cb9545d7a2 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -211,7 +211,7 @@ void func_80BC7068(EnGuruguru* this, PlayState* play) { Message_CloseTextbox(play); this->headZRotTarget = 0; if ((this->textIdIndex == 13) || (this->textIdIndex == 14)) { - func_80151BB4(play, 0x13); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU); SET_WEEKEVENTREG(WEEKEVENTREG_79_04); func_80BC6E10(this); return; @@ -223,7 +223,7 @@ void func_80BC7068(EnGuruguru* this, PlayState* play) { if (this->actor.textId == 0x292A) { SET_WEEKEVENTREG(WEEKEVENTREG_38_10); } - func_80151BB4(play, 0x13); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU); func_80BC6E10(this); return; } @@ -234,8 +234,8 @@ void func_80BC7068(EnGuruguru* this, PlayState* play) { if (this->textIdIndex == 12) { SET_WEEKEVENTREG(WEEKEVENTREG_38_40); func_801A3B48(0); - func_80151BB4(play, 0x36); - func_80151BB4(play, 0x13); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU); func_80BC6E10(this); return; } @@ -275,7 +275,7 @@ void func_80BC7068(EnGuruguru* this, PlayState* play) { return; } func_801A3B48(0); - func_80151BB4(play, 0x13); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU); func_80BC6E10(this); } } diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 5c06e292a0..648a13d46d 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -99,9 +99,9 @@ void EnHs_Destroy(Actor* thisx, PlayState* play) { void func_80952DFC(PlayState* play) { if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) { - func_80151BB4(play, 0x2E); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD); } - func_80151BB4(play, 0x10); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GROG); } void EnHs_UpdateChickPos(Vec3f* dst, Vec3f src, f32 offset) { diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index d4ccc8fd6e..abdf870b97 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -25,7 +25,7 @@ static u8 D_80BF3260[] = { /* 0x05 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_TOWN, 0x57 - 0x09), /* 0x09 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 25, 15, 45, 0x51 - 0x0F), /* 0x0F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 45, 15, 50, 0x4B - 0x15), - /* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_75_10, 0x1A - 0x19), + /* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_RECEIVED_ROOM_KEY, 0x1A - 0x19), /* 0x19 */ SCHEDULE_CMD_RET_NONE(), /* 0x1A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 50, 16, 55, 0x45 - 0x20), /* 0x20 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 55, 17, 15, 0x3F - 0x26), @@ -42,7 +42,7 @@ static u8 D_80BF3260[] = { /* 0x5B */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 45, 15, 50, 0xAF - 0x61), /* 0x61 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 50, 16, 10, 0xA9 - 0x67), /* 0x67 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 10, 16, 30, 0xA3 - 0x6D), - /* 0x6D */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_75_10, 0x8A - 0x71), + /* 0x6D */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_RECEIVED_ROOM_KEY, 0x8A - 0x71), /* 0x71 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 30, 16, 50, 0x84 - 0x77), /* 0x77 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 50, 16, 55, 0x7E - 0x7D), /* 0x7D */ SCHEDULE_CMD_RET_NONE(), @@ -372,7 +372,7 @@ s32 func_80BF17BC(EnIg* this, PlayState* play) { case 1: case 3: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_10) && (this->unk_3F6 == 3)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_ROOM_KEY) && (this->unk_3F6 == 3)) { CutsceneManager_Stop(csId); this->unk_3F6 = 5; } else { diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index ad60ad5512..ca764b1347 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -225,7 +225,7 @@ s32 func_808F33B8(void) { s32 ret = (((gSaveContext.save.day == 1) && ((gSaveContext.save.time >= CLOCK_TIME(5, 30)) && (gSaveContext.save.time <= CLOCK_TIME(6, 0)))) || (gSaveContext.save.day >= 2)) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01); + !CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM); return ret; } @@ -561,8 +561,9 @@ void func_808F4054(PlayState* play, EnIn* this, s32 arg2, u16 textId) { s32 pad; if ((textId == 0x34AE) || (textId == 0x34B0) || (textId == 0x34B2)) { - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); } + switch (arg2) { case 1: case 5: @@ -722,12 +723,12 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x345A: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; case 0x345B: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -747,7 +748,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x345F: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -762,7 +763,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x3462: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -817,7 +818,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3467: case 0x3468: case 0x3469: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -833,7 +834,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x346A: this->actionFunc = func_808F5A94; - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; } break; @@ -863,13 +864,13 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3472: func_808F43E0(this); CLEAR_WEEKEVENTREG(WEEKEVENTREG_56_08); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; case 0x3473: CLEAR_WEEKEVENTREG(WEEKEVENTREG_56_08); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x3475: @@ -925,11 +926,11 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x3484: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x3485: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x3474: @@ -981,14 +982,14 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3480: func_808F43E0(this); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; case 0x3479: func_808F43E0(this); func_808F35D8(this, play); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -1002,15 +1003,15 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3481: this->actionFunc = func_808F5A34; func_808F43E0(this); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; case 0x347D: this->actionFunc = func_808F5A34; func_808F43E0(this); - func_80151BB4(play, 0x11); - func_80151BB4(play, 0x2F); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK); ret = true; break; @@ -1033,16 +1034,16 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x3488: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; case 0x3489: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x348A: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x348B: @@ -1056,7 +1057,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x348D: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -1070,7 +1071,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3468: case 0x3469: case 0x3491: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x348E: @@ -1118,7 +1119,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3492: this->actionFunc = func_808F5A94; - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; } break; @@ -1126,11 +1127,11 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 7: switch (textId) { case 0x34A8: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x34A7: - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x3495: @@ -1148,7 +1149,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x34A4: this->actionFunc = func_808F5A34; func_808F43E0(this); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -1160,7 +1161,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3473: CLEAR_WEEKEVENTREG(WEEKEVENTREG_56_08); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); break; case 0x3474: @@ -1199,8 +1200,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x34A0: this->actionFunc = func_808F5A34; - func_80151BB4(play, 0x11); - func_80151BB4(play, 0x2F); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK); func_808F43E0(this); ret = true; break; @@ -1224,7 +1225,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x34A3: func_808F43E0(this); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -1254,7 +1255,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x349C: func_808F43E0(this); func_808F35D8(this, play); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -1284,7 +1285,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { case 0x3472: func_808F43E0(this); CLEAR_WEEKEVENTREG(WEEKEVENTREG_56_08); - func_80151BB4(play, 0x11); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS); ret = true; break; @@ -1552,7 +1553,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0); this->actionFunc = func_808F5A94; } else { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0xF); @@ -1563,7 +1564,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { } } } else { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { Actor_Kill(&this->actor); } else { EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_7); diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index fe26c18eb9..29a09cd907 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -202,7 +202,7 @@ void EnMa4_Init(Actor* thisx, PlayState* play) { if (CURRENT_DAY == 1) { this->type = MA4_TYPE_DAY1; - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { this->type = MA4_TYPE_ALIENS_DEFEATED; } else { this->type = MA4_TYPE_ALIENS_WON; @@ -374,7 +374,7 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { case 0x3341: if (play->msgCtx.choiceIndex == 0) { func_8019F208(); - SET_WEEKEVENTREG(WEEKEVENTREG_21_20); + SET_WEEKEVENTREG(WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM); Message_StartTextbox(play, 0x3343, &this->actor); this->textId = 0x3343; } else { @@ -383,14 +383,14 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { Message_StartTextbox(play, 0x3342, &this->actor); this->textId = 0x3342; this->state = MA4_STATE_DEFAULT; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } break; case 0x3346: if (play->msgCtx.choiceIndex == 0) { func_8019F208(); - SET_WEEKEVENTREG(WEEKEVENTREG_21_20); + SET_WEEKEVENTREG(WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM); Message_StartTextbox(play, 0x3343, &this->actor); this->textId = 0x3343; } else { @@ -410,7 +410,7 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { func_8019F230(); Message_StartTextbox(play, 0x3348, &this->actor); this->textId = 0x3348; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } break; @@ -422,9 +422,9 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { Message_StartTextbox(play, 0x334E, &this->actor); this->textId = 0x334E; if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { - func_80151BB4(play, 0x1C); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM); } - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } else { // No. func_8019F230(); EnMa4_SetFaceExpression(this, 0, 0); @@ -443,7 +443,7 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { EnMa4_SetFaceExpression(this, 1, 0); Message_StartTextbox(play, 0x3355, &this->actor); this->textId = 0x3355; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } break; @@ -459,13 +459,13 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { EnMa4_SetFaceExpression(this, 3, 3); Message_StartTextbox(play, 0x3357, &this->actor); this->textId = 0x3357; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } else { func_8019F230(); EnMa4_SetFaceExpression(this, 4, 2); Message_StartTextbox(play, 0x335B, &this->actor); this->textId = 0x335B; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } } break; @@ -480,7 +480,7 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, PlayState* play) { EnMa4_SetFaceExpression(this, 4, 2); Message_StartTextbox(play, 0x335A, &this->actor); this->textId = 0x335A; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } break; @@ -505,7 +505,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, PlayState* play) { EnMa4_SetFaceExpression(this, 0, 3); Message_StartTextbox(play, 0x3336, &this->actor); this->textId = 0x3336; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x3338: @@ -611,7 +611,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, PlayState* play) { if ((gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) || !CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { Message_StartTextbox(play, 0x335C, &this->actor); this->textId = 0x335C; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } else { Message_StartTextbox(play, 0x3359, &this->actor); this->textId = 0x3359; @@ -645,7 +645,7 @@ void EnMa4_DialogueHandler(EnMa4* this, PlayState* play) { case TEXT_STATE_DONE: // End conversation if (Message_ShouldAdvance(play)) { - if ((play->msgCtx.unk120B1 == 0) || !CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { + if ((play->msgCtx.bombersNotebookEventQueueCount == 0) || !CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { EnMa4_SetupWait(this); } } @@ -888,7 +888,7 @@ void EnMa4_StartDialogue(EnMa4* this, PlayState* play) { EnMa4_SetFaceExpression(this, 3, 3); Message_StartTextbox(play, 0x3337, &this->actor); this->textId = 0x3337; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } else { Message_StartTextbox(play, 0x3335, &this->actor); this->textId = 0x3335; @@ -896,7 +896,7 @@ void EnMa4_StartDialogue(EnMa4* this, PlayState* play) { } } else if (this->state == MA4_STATE_DEFAULT) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_21_40)) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_21_20)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM)) { Message_StartTextbox(play, 0x3346, &this->actor); this->textId = 0x3346; } else { @@ -944,7 +944,7 @@ void EnMa4_StartDialogue(EnMa4* this, PlayState* play) { EnMa4_SetFaceExpression(this, 3, 3); Message_StartTextbox(play, 0x3337, &this->actor); this->textId = 0x3337; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } else { Message_StartTextbox(play, 0x3335, &this->actor); this->textId = 0x3335; diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 00281d6e42..5dd7130192 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -153,7 +153,7 @@ void EnMaYto_Init(Actor* thisx, PlayState* play) { this->unk320 = 0; this->eyeTexIndex = 0; - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { EnMaYto_SetFaceExpression(this, 0, 1); } else { EnMaYto_SetFaceExpression(this, 5, 2); @@ -186,19 +186,19 @@ void EnMaYto_Init(Actor* thisx, PlayState* play) { s32 EnMaYto_CheckValidSpawn(EnMaYto* this, PlayState* play) { switch (this->type) { case MA_YTO_TYPE_DEFAULT: - if ((CURRENT_DAY == 3) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 3) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } break; case MA_YTO_TYPE_DINNER: - if ((CURRENT_DAY != 1) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY != 1) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } break; case MA_YTO_TYPE_BARN: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { if (((this->actor.params & 0x0F00) >> 8) != 0) { return false; } @@ -211,7 +211,7 @@ s32 EnMaYto_CheckValidSpawn(EnMaYto* this, PlayState* play) { break; case MA_YTO_TYPE_AFTERMILKRUN: - if ((!CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_02)) || + if ((!CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_02)) || CHECK_WEEKEVENTREG(WEEKEVENTREG_14_01)) { return false; } @@ -240,7 +240,7 @@ void EnMaYto_InitAnimation(EnMaYto* this, PlayState* play) { break; case MA_YTO_TYPE_BARN: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { EnMaYto_ChangeAnim(this, 12); } else { EnMaYto_ChangeAnim(this, 8); @@ -278,8 +278,8 @@ void EnMaYto_ChooseAction(EnMaYto* this, PlayState* play) { case MA_YTO_TYPE_AFTERMILKRUN: this->unk310 = 0; - if ((INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) && CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01) && - (Rand_Next() & 0x80)) { + if ((INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA) && (Rand_Next() & 0x80)) { EnMaYto_SetupBeginWarmFuzzyFeelingCs(this); } else { EnMaYto_SetupAfterMilkRunInit(this); @@ -333,7 +333,7 @@ s32 EnMaYto_TryFindRomani(EnMaYto* this, PlayState* play) { return 0; case MA_YTO_TYPE_DINNER: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01) && (CURRENT_DAY == 2)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM) && (CURRENT_DAY == 2)) { return 0; } if (EnMaYto_SearchRomani(this, play)) { @@ -342,7 +342,7 @@ s32 EnMaYto_TryFindRomani(EnMaYto* this, PlayState* play) { return 1; case MA_YTO_TYPE_BARN: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { if (EnMaYto_SearchRomani(this, play)) { return 2; } @@ -476,7 +476,7 @@ void EnMaYto_DefaultChooseNextDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetFaceExpression(this, 3, 1); Message_StartTextbox(play, 0x3393, &this->actor); this->textId = 0x3393; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); break; case 0x3394: @@ -489,7 +489,7 @@ void EnMaYto_DefaultChooseNextDialogue(EnMaYto* this, PlayState* play) { EnMaYto_ChangeAnim(this, 1); Message_StartTextbox(play, 0x3396, &this->actor); this->textId = 0x3396; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); break; default: @@ -499,7 +499,7 @@ void EnMaYto_DefaultChooseNextDialogue(EnMaYto* this, PlayState* play) { } void EnMaYto_SetupDinnerWait(EnMaYto* this) { - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { func_80B90E50(this, 0); this->unk31E = 0; } else { @@ -540,7 +540,7 @@ void EnMaYto_DinnerWait(EnMaYto* this, PlayState* play) { } void EnMaYto_SetupDinnerDialogueHandler(EnMaYto* this) { - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { func_80B90E50(this, 1); } else { func_80B90E50(this, 2); @@ -635,8 +635,8 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetRomaniFaceExpression(this, 0, 1); Message_StartTextbox(play, 0x339E, &this->actor); this->textId = 0x339E; - func_80151BB4(play, 6); - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x339F: @@ -671,20 +671,20 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetFaceExpression(this, 3, 3); Message_StartTextbox(play, 0x33A4, &this->actor); this->textId = 0x33A4; - func_80151BB4(play, 6); - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x33A5: Message_StartTextbox(play, 0x33A6, &this->actor); this->textId = 0x33A6; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); break; case 0x33A7: Message_StartTextbox(play, 0x33A8, &this->actor); this->textId = 0x33A8; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); break; default: @@ -694,7 +694,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, PlayState* play) { } void EnMaYto_SetupBarnWait(EnMaYto* this) { - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { EnMaYto_ChangeAnim(this, 13); func_80B90E50(this, 0); this->unk31E = 0; @@ -722,7 +722,7 @@ void EnMaYto_BarnWait(EnMaYto* this, PlayState* play) { Actor_ChangeFocus(&this->actor, play, &this->actor); EnMaYto_BarnStartDialogue(this, play); EnMaYto_SetupBarnDialogueHandler(this); - } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01) || (ABS_ALT(direction) < 0x2000)) { + } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM) || (ABS_ALT(direction) < 0x2000)) { func_800B8614(&this->actor, play, 100.0f); child = this->actor.child; @@ -734,7 +734,7 @@ void EnMaYto_BarnWait(EnMaYto* this, PlayState* play) { } void EnMaYto_SetupBarnDialogueHandler(EnMaYto* this) { - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { func_80B90E50(this, 1); } else { func_80B90E50(this, 2); @@ -796,8 +796,8 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, PlayState* play) { Actor_ChangeFocus(&this->actor, play, &this->actor); Message_StartTextbox(play, 0x33AD, &this->actor); this->textId = 0x33AD; - func_80151BB4(play, 6); - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x33AE: @@ -814,8 +814,8 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetFaceExpression(this, 4, 2); Message_StartTextbox(play, 0x33B0, &this->actor); this->textId = 0x33B0; - func_80151BB4(play, 6); - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x33B1: @@ -824,7 +824,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, PlayState* play) { // "I should had believed what Romani said" Message_StartTextbox(play, 0x33B2, &this->actor); this->textId = 0x33B2; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); break; case 0x33C6: @@ -871,8 +871,8 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetRomaniFaceExpression(this, 3, 3); Message_StartTextbox(play, 0x33CC, &this->actor); this->textId = 0x33CC; - func_80151BB4(play, 6); - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; default: @@ -882,7 +882,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, PlayState* play) { } void EnMaYto_SetupAfterMilkRunInit(EnMaYto* this) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { EnMaYto_SetFaceExpression(this, 3, 1); } else { Audio_PlayFanfare(NA_BGM_FAILURE_1); @@ -897,7 +897,7 @@ void EnMaYto_AfterMilkRunInit(EnMaYto* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actor.flags &= ~ACTOR_FLAG_10000; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { Message_StartTextbox(play, 0x33C1, &this->actor); this->textId = 0x33C1; } else { @@ -908,7 +908,7 @@ void EnMaYto_AfterMilkRunInit(EnMaYto* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_14_01); this->unk310 = 4; EnMaYto_SetupPostMilkRunWaitDialogueEnd(this); - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); return; } @@ -991,9 +991,9 @@ void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, PlayState* play) { this->textId = 0x33C3; SET_WEEKEVENTREG(WEEKEVENTREG_14_01); this->unk310 = 3; - func_80151BB4(play, 0x20); - func_80151BB4(play, 0x1F); - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); EnMaYto_SetupPostMilkRunWaitDialogueEnd(this); } else { // You already have the mask @@ -1002,7 +1002,7 @@ void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, PlayState* play) { this->textId = 0x33D0; SET_WEEKEVENTREG(WEEKEVENTREG_14_01); this->unk310 = 3; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); EnMaYto_SetupPostMilkRunWaitDialogueEnd(this); } } else { @@ -1086,7 +1086,7 @@ void EnMaYto_PostMilkRunWaitDialogueEnd(EnMaYto* this, PlayState* play) { } } - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) && (play->msgCtx.unk120B1 == 0)) { + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) && (play->msgCtx.bombersNotebookEventQueueCount == 0)) { EnMaYto_SetupPostMilkRunEnd(this); } } @@ -1154,13 +1154,13 @@ void EnMaYto_DefaultStartDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetFaceExpression(this, 0, 3); Message_StartTextbox(play, 0x33C5, &this->actor); this->textId = 0x33C5; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); } else { EnMaYto_SetTalkedFlag(); EnMaYto_SetFaceExpression(this, 0, 3); Message_StartTextbox(play, 0x33C4, &this->actor); this->textId = 0x33C4; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); } } } @@ -1211,7 +1211,7 @@ void EnMaYto_DinnerStartDialogue(EnMaYto* this, PlayState* play) { if (EnMaYto_HasSpokenToPlayer()) { Message_StartTextbox(play, 0x33A6, &this->actor); this->textId = 0x33A6; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); } else { EnMaYto_SetTalkedFlag(); Message_StartTextbox(play, 0x33A5, &this->actor); @@ -1223,7 +1223,7 @@ void EnMaYto_DinnerStartDialogue(EnMaYto* this, PlayState* play) { if (EnMaYto_HasSpokenToPlayer()) { Message_StartTextbox(play, 0x33A8, &this->actor); this->textId = 0x33A8; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); } else { EnMaYto_SetTalkedFlag(); Message_StartTextbox(play, 0x33A7, &this->actor); @@ -1237,7 +1237,7 @@ void EnMaYto_DinnerStartDialogue(EnMaYto* this, PlayState* play) { } void EnMaYto_BarnStartDialogue(EnMaYto* this, PlayState* play) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { if (CURRENT_DAY == 2) { if (this->unk310 == 1) { Message_StartTextbox(play, 0x33AE, &this->actor); @@ -1266,7 +1266,7 @@ void EnMaYto_BarnStartDialogue(EnMaYto* this, PlayState* play) { EnMaYto_SetFaceExpression(this, 5, 3); Message_StartTextbox(play, 0x33B3, &this->actor); this->textId = 0x33B3; - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); } else { EnMaYto_SetTalkedFlag(); EnMaYto_SetFaceExpression(this, 5, 3); @@ -1360,7 +1360,7 @@ void EnMaYto_SetFaceExpression(EnMaYto* this, s16 overrideEyeTexIndex, s16 mouth } void EnMaYto_InitFaceExpression(EnMaYto* this) { - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { EnMaYto_SetFaceExpression(this, 0, 1); EnMaYto_SetRomaniFaceExpression(this, 0, 0); } else { @@ -1484,7 +1484,7 @@ void EnMaYto_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - if ((this->type == MA_YTO_TYPE_BARN) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((this->type == MA_YTO_TYPE_BARN) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gCremiaWoodenBoxDL); } diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index 163f89fcda..bb9c9c926d 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -144,7 +144,7 @@ void EnMaYts_InitAnimation(EnMaYts* this, PlayState* play) { case MA_YTS_TYPE_SITTING: this->actor.targetMode = 6; // Day 1 or "Winning" the alien invasion - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { EnMaYts_ChangeAnim(this, 14); } else { EnMaYts_ChangeAnim(this, 18); @@ -177,14 +177,14 @@ s32 EnMaYts_CheckValidSpawn(EnMaYts* this, PlayState* play) { case 2: // Failing the alien invasion - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } break; case 3: // "Winning" the alien invasion - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } break; @@ -196,7 +196,7 @@ s32 EnMaYts_CheckValidSpawn(EnMaYts* this, PlayState* play) { case MA_YTS_TYPE_BARN: // Failing the alien invasion - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } else if ((gSaveContext.save.time >= CLOCK_TIME(20, 0)) && (CURRENT_DAY == 3)) { return false; @@ -205,7 +205,7 @@ s32 EnMaYts_CheckValidSpawn(EnMaYts* this, PlayState* play) { case MA_YTS_TYPE_SLEEPING: // "Winning" the alien invasion - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } break; @@ -254,7 +254,7 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) { this->hasBow = false; } - if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { this->overrideEyeTexIndex = 0; this->eyeTexIndex = 0; this->mouthTexIndex = 0; @@ -272,7 +272,8 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) { this->mouthTexIndex = 0; this->unk_32C = 2; EnMaYts_SetupEndCreditsHandler(this); - } else if ((CURRENT_DAY == 2) && (gSaveContext.save.isNight == 1) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + } else if ((CURRENT_DAY == 2) && (gSaveContext.save.isNight == 1) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { EnMaYts_SetupStartDialogue(this); } else { EnMaYts_SetupDoNothing(this); @@ -313,7 +314,7 @@ void EnMaYts_StartDialogue(EnMaYts* this, PlayState* play) { EnMaYts_SetFaceExpression(this, 4, 3); Message_StartTextbox(play, 0x3362, &this->actor); this->textId = 0x3362; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } } else if (Player_GetMask(play) != PLAYER_MASK_NONE) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_65_40)) { @@ -325,9 +326,9 @@ void EnMaYts_StartDialogue(EnMaYts* this, PlayState* play) { EnMaYts_SetFaceExpression(this, 4, 2); Message_StartTextbox(play, 0x3366, &this->actor); this->textId = 0x3366; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } - } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_21_20)) { + } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM)) { EnMaYts_SetFaceExpression(this, 0, 0); Message_StartTextbox(play, 0x3367, &this->actor); this->textId = 0x3367; @@ -343,7 +344,7 @@ void EnMaYts_StartDialogue(EnMaYts* this, PlayState* play) { EnMaYts_SetFaceExpression(this, 0, 0); Message_StartTextbox(play, 0x336C, &this->actor); this->textId = 0x336C; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); } } EnMaYts_SetupDialogueHandler(this); @@ -445,7 +446,7 @@ void EnMaYts_ChooseNextDialogue(EnMaYts* this, PlayState* play) { EnMaYts_SetFaceExpression(this, 4, 3); Message_StartTextbox(play, 0x3361, &this->actor); this->textId = 0x3361; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x3363: @@ -458,14 +459,14 @@ void EnMaYts_ChooseNextDialogue(EnMaYts* this, PlayState* play) { EnMaYts_SetFaceExpression(this, 4, 2); Message_StartTextbox(play, 0x3365, &this->actor); this->textId = 0x3365; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x3367: EnMaYts_SetFaceExpression(this, 4, 3); Message_StartTextbox(play, 0x3368, &this->actor); this->textId = 0x3368; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; case 0x3369: @@ -478,7 +479,7 @@ void EnMaYts_ChooseNextDialogue(EnMaYts* this, PlayState* play) { EnMaYts_SetFaceExpression(this, 3, 3); Message_StartTextbox(play, 0x336B, &this->actor); this->textId = 0x336B; - func_80151BB4(play, 5); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROMANI); break; default: diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c index abf5503a46..ab387771c9 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c @@ -157,7 +157,7 @@ void func_80A6F3B4(EnMm3* this, PlayState* play) { play_sound(NA_SE_SY_ERROR); Message_StartTextbox(play, 0x279C, &this->actor); this->unk_2B4 = 0x279C; - func_80151BB4(play, 0xB); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN); } } else { func_8019F208(); @@ -168,7 +168,7 @@ void func_80A6F3B4(EnMm3* this, PlayState* play) { func_8019F230(); Message_StartTextbox(play, 0x278F, &this->actor); this->unk_2B4 = 0x278F; - func_80151BB4(play, 0xB); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN); } break; @@ -183,13 +183,13 @@ void func_80A6F3B4(EnMm3* this, PlayState* play) { play_sound(NA_SE_SY_ERROR); Message_StartTextbox(play, 0x279C, &this->actor); this->unk_2B4 = 0x279C; - func_80151BB4(play, 0xB); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN); } } else { func_8019F230(); Message_StartTextbox(play, 0x279B, &this->actor); this->unk_2B4 = 0x279B; - func_80151BB4(play, 0xB); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN); } break; } @@ -282,7 +282,7 @@ void func_80A6F5E4(EnMm3* this, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_KICKOUT_TIME_PASSED)) { Message_StartTextbox(play, 0x279B, &this->actor); this->unk_2B4 = 0x279B; - func_80151BB4(play, 0xB); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN); } else { Message_StartTextbox(play, 0x2798, &this->actor); this->unk_2B4 = 0x2798; @@ -448,8 +448,8 @@ void func_80A6FEEC(EnMm3* this, PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_20; Message_StartTextbox(play, 0x2794, &this->actor); this->unk_2B4 = 0x2794; - func_80151BB4(play, 0xB); - func_80151BB4(play, 0x2B); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP); this->actor.flags &= ~ACTOR_FLAG_10000; func_80A6F9C8(this); } else { diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 474c1d2df3..79c2e5cba9 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -66,7 +66,7 @@ static u8 sScheduleScript[] = { /* 0x3E */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_1), /* 0x41 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_2), /* 0x44 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_1), - /* 0x47 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_50_20, 0x57 - 0x4B), + /* 0x47 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_HAD_MIDNIGHT_MEETING, 0x57 - 0x4B), /* 0x4B */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(8, 0, 18, 0, 0x54 - 0x51), /* 0x51 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_3), /* 0x54 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_1), diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 0627ddbf82..072f6d6acf 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1105,7 +1105,11 @@ void func_80AF8AC8(EnPm* this) { void func_80AF8BA8(s32 arg0) { static u16 D_80AFB8D4[] = { - WEEKEVENTREG_27_02, WEEKEVENTREG_27_04, WEEKEVENTREG_27_08, WEEKEVENTREG_27_10, WEEKEVENTREG_27_20, + WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN, + WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN, + WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN, + WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN, + WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN, }; static u16 D_80AFB8E0[] = { WEEKEVENTREG_27_40, WEEKEVENTREG_27_80, WEEKEVENTREG_28_01, WEEKEVENTREG_28_02, WEEKEVENTREG_28_04, diff --git a/src/overlays/actors/ovl_En_Pst/z_en_pst.c b/src/overlays/actors/ovl_En_Pst/z_en_pst.c index 9b5f1ef383..7a507e0efd 100644 --- a/src/overlays/actors/ovl_En_Pst/z_en_pst.c +++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.c @@ -162,15 +162,15 @@ void EnPst_UpdateCollision(EnPst* this, PlayState* play) { s32 EnPst_HandleLetterDay1(EnPst* this) { switch (this->actor.params) { case POSTBOX_SOUTH_UPPER_CLOCKTOWN: - return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_02); + return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN); case POSTBOX_NORTH_CLOCKTOWN: - return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_04); + return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN); case POSTBOX_EAST_UPPER_CLOCKTOWN: - return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_08); + return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN); case POSTBOX_EAST_LOWER_CLOCKTOWN: - return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_10); + return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN); case POSTBOX_SOUTH_LOWER_CLOCKTOWN: - return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_20); + return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN); default: return false; } diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.c b/src/overlays/actors/ovl_En_Rz/z_en_rz.c index 1a43768fcc..e980d1cb58 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -347,9 +347,9 @@ EnRz* EnRz_FindSister(EnRz* this, PlayState* play) { void func_80BFBDFC(PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_80)) { - func_80151BB4(play, 0x27); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP); } - func_80151BB4(play, 0xC); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS); } void EnRz_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c index e41fc5dc75..3a32031d36 100644 --- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c +++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c @@ -230,7 +230,7 @@ void func_80BC9680(EnStoneheishi* this, PlayState* play) { player->actor.textId = sEnStoneHeishiTextIds[this->textIdIndex]; Message_ContinueTextbox(play, sEnStoneHeishiTextIds[this->textIdIndex]); - func_80151BB4(play, 0x12); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_SHIRO); } } @@ -250,7 +250,7 @@ void func_80BC9680(EnStoneheishi* this, PlayState* play) { if (this->textIdIndex < 7) { this->textIdIndex++; } else { - func_80151BB4(play, 0x12); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_SHIRO); func_80BC94B0(this); return; } @@ -293,7 +293,7 @@ void EnStoneheishi_CheckGivenItem(EnStoneheishi* this, PlayState* play) { } } else if (itemAction <= PLAYER_IA_MINUS1) { Message_CloseTextbox(play); - func_80151BB4(play, 0x12); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_SHIRO); func_80BC94B0(this); } } @@ -411,8 +411,8 @@ void func_80BC9E50(EnStoneheishi* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - func_80151BB4(play, 0x35); - func_80151BB4(play, 0x12); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_SHIRO); this->action = EN_STONE_ACTION_1; this->actionFunc = func_80BC9680; } else { diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c index 6711fcde6c..2000e0e53a 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -126,7 +126,7 @@ static u8 sScheduleScript[] = { /* 0x0A5 */ SCHEDULE_CMD_CHECK_FLAG_L(WEEKEVENTREG_79_40, 0x12C - 0x0AA), /* 0x0AA */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_SECOM, 0x0B0 - 0x0AE), /* 0x0AE */ SCHEDULE_CMD_RET_VAL_S(7), - /* 0x0B0 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_51_20, 0x0DD - 0x0B4), + /* 0x0B0 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT, 0x0DD - 0x0B4), /* 0x0B4 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_IKANA, 0x0DC - 0x0B8), /* 0x0B8 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_51_08, 0x0BE - 0x0BC), /* 0x0BC */ SCHEDULE_CMD_RET_VAL_S(5), @@ -150,7 +150,7 @@ static u8 sScheduleScript[] = { /* 0x0F3 */ SCHEDULE_CMD_RET_TIME(4, 0, 4, 10, 11), /* 0x0F9 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x12B - 0x0FD), /* 0x0FD */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(4, 10, 4, 30, 0x125 - 0x103), - /* 0x103 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_51_01, 0x11C - 0x107), + /* 0x103 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES, 0x11C - 0x107), /* 0x107 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(4, 30, 4, 45, 0x116 - 0x10D), /* 0x10D */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(4, 45, 6, 0, 0x114 - 0x113), /* 0x113 */ SCHEDULE_CMD_RET_NONE(), @@ -313,7 +313,7 @@ s32 func_80A3E898(EnTest3* this, PlayState* play) { u16 textId = this->unk_D78->textId; if ((this->unk_D78->unk_0 == 4) && CHECK_WEEKEVENTREG(WEEKEVENTREG_51_08)) { - func_80151BB4(play, 2); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_KAFEI); } if (textId == 0xFFFF) { Message_CloseTextbox(play); @@ -658,7 +658,7 @@ s32 func_80A3F73C(EnTest3* this, PlayState* play) { this->player.stateFlags2 &= ~PLAYER_STATE2_40000; D_80A41D5C = true; if ((this->unk_D78->unk_0 == 4) && CHECK_WEEKEVENTREG(WEEKEVENTREG_51_08)) { - func_80151BB4(play, 2); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_KAFEI); } } else { if (play->actorCtx.flags & ACTORCTX_FLAG_4) { @@ -785,7 +785,7 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) { func_800FE658(TIME_TO_MINUTES_ALT_F(fabsf((s16) - ((void)0, gSaveContext.save.time)))); } if (play->actorCtx.flags & ACTORCTX_FLAG_6) { - SET_WEEKEVENTREG(WEEKEVENTREG_51_20); + SET_WEEKEVENTREG(WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT); CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_02); } D_80A41D20 = 3; @@ -1019,8 +1019,8 @@ void func_80A40908(EnTest3* this, PlayState* play) { func_80A3E7E0(this, func_80A4084C); this->player.targetedActor = &GET_PLAYER(play)->actor; SET_WEEKEVENTREG(WEEKEVENTREG_51_08); - func_80151BB4(play, 0x19); - func_80151BB4(play, 2); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_KAFEI); } else { func_800B8500(&this->player.actor, play, 9999.9f, 9999.9f, PLAYER_IA_MINUS1); this->unk_D78 = &D_80A41854[6]; @@ -1217,7 +1217,7 @@ void EnTest3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList1, Gfx** dL Matrix_MultVec3f(&D_80A418CC, &this->player.actor.focus.pos); } } else if (limbIndex == OBJECT_TEST3_LIMB_15) { - if (D_80A41D60 || CHECK_WEEKEVENTREG(WEEKEVENTREG_50_80) || + if (D_80A41D60 || CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_PENDANT_OF_MEMORIES) || (INV_CONTENT(ITEM_PENDANT_OF_MEMORIES) == ITEM_PENDANT_OF_MEMORIES) || (this->player.getItemDrawIdPlusOne - 1 == GID_PENDANT_OF_MEMORIES)) { D_80A41D60 = true; diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index 21ddf2bee4..fb18d4a395 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -4,7 +4,6 @@ * Description: Three-Day Events */ -#include "prevent_bss_reordering.h" #include "z_en_test4.h" #include "z64horse.h" #include "overlays/gamestates/ovl_daytelop/z_daytelop.h" diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index 7de3b50c29..2177742dcf 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -290,7 +290,7 @@ void func_80BA3BFC(EnToto* this, PlayState* play) { this->unk2B4 = 0; } else { if (this->text->unk0 == 4) { - func_80151BB4(play, 9); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_TOTO); } Animation_MorphToLoop(&this->skelAnime, &object_zm_Anim_00B3E0, -4.0f); } @@ -333,9 +333,9 @@ void func_80BA3DBC(EnToto* this, PlayState* play) { } else { player = GET_PLAYER(play); if ((player->stateFlags1 & PLAYER_STATE1_400) && player->unk_AE7 != 0) { - func_80151BB4(play, 48); - func_80151BB4(play, 9); - func_80151BB4(play, 10); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_TOTO); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN); } else { return; } @@ -369,7 +369,7 @@ s32 func_80BA3F2C(EnToto* this, PlayState* play) { func_80BA3EE8(this, play); } if (this->text->unk0 == 4) { - func_80151BB4(play, 9); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_TOTO); } return 0; } @@ -686,8 +686,8 @@ void func_80BA4CB4(EnToto* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, (this->cueId == 1) ? &object_zm_Anim_0016A4 : &object_zm_Anim_0022C8); if ((this->cueId == 2) && (this->unk2B3 != 0xF)) { - func_80151BB4(play, 9); - func_80151BB4(play, 10); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_TOTO); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN); } } } diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index 9df560150c..9238a166b4 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -136,9 +136,9 @@ void EnYb_Destroy(Actor* thisx, PlayState* play) { void func_80BFA2FC(PlayState* play) { if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) { - func_80151BB4(play, 0x34); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK); } - func_80151BB4(play, 0xF); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_KAMARO); } /** diff --git a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c index ee8c84877c..774632cb4c 100644 --- a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c +++ b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c @@ -31,7 +31,8 @@ ActorInit Obj_Dinner_InitVars = { void ObjDinner_Init(Actor* thisx, PlayState* play) { ObjDinner* this = THIS; - if ((gSaveContext.save.isNight != true) || ((CURRENT_DAY == 3) && CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01))) { + if ((gSaveContext.save.isNight != true) || + ((CURRENT_DAY == 3) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM))) { Actor_Kill(&this->actor); } Actor_SetScale(&this->actor, 0.1f); diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c index 8ff6e84559..75ff18b6bf 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c @@ -58,7 +58,7 @@ void ObjMilkBin_Init(Actor* thisx, PlayState* play) { this->disableDraw = 0; this->type = thisx->params; - if ((this->type == OBJ_MILK_BIN_TYPE_2) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if ((this->type == OBJ_MILK_BIN_TYPE_2) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { this->disableDraw |= 1; } } @@ -74,14 +74,14 @@ void ObjMilkBin_Update(Actor* thisx, PlayState* play2) { ObjMilkBin* this = THIS; if (this->type == OBJ_MILK_BIN_TYPE_1) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { if (((gSaveContext.save.day == 2) && (gSaveContext.save.isNight == 1)) || (gSaveContext.save.day >= 3)) { Actor_Kill(&this->actor); return; } } } else if (this->type == OBJ_MILK_BIN_TYPE_2) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { this->disableDraw &= ~1; } else { this->disableDraw |= 1; diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index c4f884694d..a6085ef513 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -15,7 +15,7 @@ /** * weekEventReg flags checked by this actor: - * - WEEKEVENTREG_22_01: Aliens defeated + * - WEEKEVENTREG_DEFENDED_AGAINST_THEM: Aliens defeated * If false: The actor doesn't spawn * - WEEKEVENTREG_31_40 * If true: Cremia doesn't explain again she'll deliever milk to town @@ -23,7 +23,7 @@ * If true: Triggers cutscene on Romani's Ranch * - WEEKEVENTREG_34_80 * If true: Doesn't spawn on Romani's Ranch - * - WEEKEVENTREG_52_01 + * - WEEKEVENTREG_ESCORTED_CREMIA * If true: Doesn't spawn on Romani's Ranch or Milk Road * - WEEKEVENTREG_52_02 * If true: Doesn't spawn on Romani's Ranch or Milk Road @@ -37,7 +37,7 @@ * Player accepts the ride and is with Cremia during the Milk Run * - WEEKEVENTREG_34_80: Cremia does Milk Run alone * Player didn't interact or didn't accept the ride - * - WEEKEVENTREG_52_01: Won Milk Run minigame + * - WEEKEVENTREG_ESCORTED_CREMIA: Won Milk Run minigame * At least one pot is safe. Turns off the "Lose Milk Run minigame" * - WEEKEVENTREG_52_02: Lose Milk Run minigame * Every pot was broken by bandits. Turns off the "Win Milk Run minigame" @@ -47,7 +47,7 @@ * weekEventReg flags unset by this actor: * - WEEKEVENTREG_31_80 * Turned off when the Milk Run finishes - * - WEEKEVENTREG_52_01 + * - WEEKEVENTREG_ESCORTED_CREMIA * Turned off if Player lose the Milk Run * - WEEKEVENTREG_52_02 * Turned off if Player wins the Milk Run @@ -682,7 +682,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { this->initialPathIndex = OBJ_UM_GET_PATH_INDEX(thisx); // if (!AliensDefeated) - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { Actor_Kill(&this->dyna.actor); return; } @@ -702,7 +702,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { // Waiting for player if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_80) || (gSaveContext.save.time >= CLOCK_TIME(19, 0)) || - (gSaveContext.save.time <= CLOCK_TIME(6, 0)) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01) || + (gSaveContext.save.time <= CLOCK_TIME(6, 0)) || CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_02)) { Actor_Kill(&this->dyna.actor); return; @@ -713,7 +713,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { ObjUm_SetupAction(this, ObjUm_RanchWait); } } else if (this->type == OBJ_UM_TYPE_PRE_MILK_RUN) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA)) { Actor_Kill(&this->dyna.actor); return; } @@ -739,7 +739,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { this->unk_354 = 0; ObjUm_RotatePlayer(this, play, 0); } else if (this->type == OBJ_UM_TYPE_POST_MILK_RUN) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01) || CHECK_WEEKEVENTREG(WEEKEVENTREG_59_02)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA) || CHECK_WEEKEVENTREG(WEEKEVENTREG_59_02)) { Actor_Kill(&this->dyna.actor); return; } @@ -843,7 +843,7 @@ s32 func_80B795A0(PlayState* play, ObjUm* this, s32 arg2) { } else { Actor_ContinueText(play, &this->dyna.actor, 0x33B5); func_8019F230(); - func_80151BB4(play, 6); + Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_CREMIA); phi_v1 = false; } break; @@ -1302,13 +1302,13 @@ void ObjUm_RunMinigame(ObjUm* this, PlayState* play) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_31_80); gSaveContext.ambienceId = AMBIENCE_ID_DISABLED; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_52_01) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_02)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_02)) { if (!this->areAllPotsBroken) { play->nextEntrance = ENTRANCE(MILK_ROAD, 6); play->transitionType = TRANS_TYPE_64; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; play->transitionTrigger = TRANS_TRIGGER_START; - SET_WEEKEVENTREG(WEEKEVENTREG_52_01); + SET_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA); CLEAR_WEEKEVENTREG(WEEKEVENTREG_52_02); } else { play->nextEntrance = ENTRANCE(ROMANI_RANCH, 8); @@ -1316,7 +1316,7 @@ void ObjUm_RunMinigame(ObjUm* this, PlayState* play) { gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; play->transitionTrigger = TRANS_TRIGGER_START; SET_WEEKEVENTREG(WEEKEVENTREG_52_02); - CLEAR_WEEKEVENTREG(WEEKEVENTREG_52_01); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_ESCORTED_CREMIA); } } break; diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c index 46a6b994d7..23e6eb0acb 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c @@ -80,7 +80,7 @@ s32 func_80C07CD0(void) { } } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM)) { return false; } return true; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index bbde013ef7..01c732aa2a 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -3,7 +3,6 @@ * Overlay: ovl_player_actor * Description: Player */ - #include "prevent_bss_reordering.h" #include "global.h" #include "z64horse.h" @@ -19110,7 +19109,7 @@ void func_80859708(PlayState* play, Player* this, UNK_TYPE arg2) { PlayerAnimation_Update(play, &this->skelAnime); if ((this->actor.id == ACTOR_EN_TEST3) && Animation_OnFrame(&this->skelAnime, 20.0f)) { this->getItemDrawIdPlusOne = GID_MASK_SUN + 1; - func_80151BB4(play, 0x1B); + Message_BombersNotebookQueueEvent(play, 0x1B); Audio_PlayFanfare(NA_BGM_GET_NEW_MASK); } } @@ -19786,7 +19785,7 @@ void func_8085A7C0(PlayState* play, Player* this, UNK_TYPE arg2) { } } } else if (PlayerAnimation_OnFrame(&this->skelAnime, 4.0f)) { - SET_WEEKEVENTREG(WEEKEVENTREG_50_80); + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_PENDANT_OF_MEMORIES); } } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index 64da25451f..b60a00f9e6 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -3,7 +3,7 @@ * Overlay: ovl_kaleido_scope * Description: Pause Menu */ - +#include "prevent_bss_reordering.h" #include "z_kaleido_scope.h" #include "overlays/gamestates/ovl_opening/z_opening.h" #include "interface/icon_item_gameover_static/icon_item_gameover_static.h" diff --git a/tools/disasm/disasm.py b/tools/disasm/disasm.py index 37ba8b45ea..78d66d337b 100755 --- a/tools/disasm/disasm.py +++ b/tools/disasm/disasm.py @@ -169,7 +169,6 @@ variable_addrs = None files_text = {} - def proper_name(symbol, in_data=False, is_symbol=True): # hacks # ovl_En_Encount4 fake symbol at the very end of the data section @@ -181,6 +180,10 @@ def proper_name(symbol, in_data=False, is_symbol=True): return variables_ast[0x801EF670][0] + f" - 0x{0x801EF670 - 0x801EF51D:X}" elif symbol == 0x801D0D7A: # play_hireso constant-folding D_801D0D80 array return variables_ast[0x801D0D80][0] + f" - 0x{0x801D0D80 - 0x801D0D7A:X}" + elif symbol == 0x801D11F4: # play_hireso constant-folding D_801D1244 array + return variables_ast[0x801D1244][0] + f" - 0x{0x801D1244 - 0x801D11F4:X}" + elif symbol == 0x801D12C0: # play_hireso constant-folding D_801D12E8 array + return variables_ast[0x801D12E8][0] + f" - 0x{0x801D12E8 - 0x801D12C0:X}" elif symbol == 0x80A09740: # boss_07 symbol with large addend folded into %lo return variables_ast[0x80A09A60][0] + f" - 0x{0x80A09A60 - 0x80A09740:X}" # bg_ikana_mirror symbol with large addend folded into %lo diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 1d38ccc2ee..4fc8f07c15 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2855,7 +2855,7 @@ 0x801518B0:("Message_StartTextbox",), 0x80151938:("Message_ContinueTextbox",), 0x80151A68:("func_80151A68",), - 0x80151BB4:("func_80151BB4",), + 0x80151BB4:("Message_BombersNotebookQueueEvent",), 0x80151C9C:("func_80151C9C",), 0x80151DA4:("func_80151DA4",), 0x80152434:("func_80152434",), @@ -3040,16 +3040,16 @@ 0x8016A178:("Play_AssignPlayerCsIdsFromScene",), 0x8016A268:("Play_FillScreen",), 0x8016A2C8:("Play_Init",), - 0x8016AC10:("func_8016AC10",), - 0x8016AE1C:("func_8016AE1C",), - 0x8016B278:("func_8016B278",), - 0x8016B4B0:("func_8016B4B0",), - 0x8016C344:("func_8016C344",), - 0x8016CD4C:("func_8016CD4C",), - 0x8016E40C:("func_8016E40C",), - 0x8016EA90:("func_8016EA90",), + 0x8016AC10:("BombersNotebook_DrawScisTexRect",), + 0x8016AE1C:("BombersNotebook_DrawHeaders",), + 0x8016B278:("BombersNotebook_DrawColumns",), + 0x8016B4B0:("BombersNotebook_DrawEntries",), + 0x8016C344:("BombersNotebook_DrawRows",), + 0x8016CD4C:("BombersNotebook_DrawTimeOfDay",), + 0x8016E40C:("BombersNotebook_DrawCursor",), + 0x8016EA90:("BombersNotebook_DrawArrows",), 0x8016F1A8:("BombersNotebook_Draw",), - 0x8016F4EC:("func_8016F4EC",), + 0x8016F4EC:("BombersNotebook_LoadFiles",), 0x8016F5A8:("BombersNotebook_Update",), 0x8016FC78:("BombersNotebook_Init",), 0x8016FC98:("BombersNotebook_Destroy",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 3a14118c56..749ee5878f 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1958,8 +1958,8 @@ 0x801C6A90:("D_801C6A90","UNK_TYPE2","",0x2), 0x801C6A94:("D_801C6A94","UNK_TYPE2","",0x2), 0x801C6A98:("gPageSwitchNextButtonStatus","UNK_TYPE1","",0x1), - 0x801C6AB8:("D_801C6AB8","UNK_TYPE1","",0x1), - 0x801C6B28:("D_801C6B28","UNK_TYPE1","",0x1), + 0x801C6AB8:("sBombersNotebookEventMessages","UNK_TYPE1","",0x1), + 0x801C6B28:("gBombersNotebookWeekEventFlags","UNK_TYPE1","",0x1), 0x801C6B98:("D_801C6B98","UNK_TYPE1","",0x1), 0x801CED40:("D_801CED40","UNK_TYPE1","",0x1), 0x801CFB08:("D_801CFB08","UNK_TYPE1","",0x1), @@ -2115,19 +2115,14 @@ 0x801D0D5C:("sIsCameraUnderwater","UNK_TYPE2","",0x2), 0x801D0D60:("D_801D0D60","Input*","",0x4), 0x801D0D64:("sPlayerCsIdToCsCamId","s16","[10]",0x14), - 0x801D0D80:("D_801D0D80","UNK_TYPE1","",0x1), - 0x801D11F4:("D_801D11F4","UNK_TYPE1","",0x1), - 0x801D1230:("D_801D1230","UNK_TYPE1","",0x1), - 0x801D1234:("D_801D1234","UNK_TYPE1","",0x1), - 0x801D1238:("D_801D1238","UNK_TYPE4","",0x4), - 0x801D1244:("D_801D1244","UNK_TYPE1","",0x1), - 0x801D12C0:("D_801D12C0","UNK_TYPE1","",0x1), - 0x801D12D0:("D_801D12D0","UNK_TYPE1","",0x1), - 0x801D12D4:("D_801D12D4","UNK_TYPE1","",0x1), - 0x801D12D8:("D_801D12D8","UNK_TYPE1","",0x1), + 0x801D0D80:("D_801D0D80","UNK_TYPE1","",0x4B0), + 0x801D1230:("D_801D1230","UNK_TYPE1","",0x8), + 0x801D1238:("D_801D1238","UNK_TYPE4","",0x1), + 0x801D1244:("D_801D1244","UNK_TYPE1","",0x8C), + 0x801D12D0:("D_801D12D0","UNK_TYPE1","",0xC), 0x801D12DC:("D_801D12DC","UNK_TYPE1","",0x1), - 0x801D1330:("D_801D1330","UNK_TYPE2","",0x2), - 0x801D1342:("D_801D1342","UNK_TYPE1","",0x1), + 0x801D12E8:("D_801D12E8","UNK_TYPE1","",0x1), + 0x801D1330:("D_801D1330","UNK_TYPE1","",0x14), 0x801D1344:("D_801D1344","UNK_TYPE2","",0x2), 0x801D1368:("D_801D1368","UNK_TYPE1","",0x1), 0x801D1374:("D_801D1374","UNK_TYPE2","",0x2), diff --git a/tools/namefixer.py b/tools/namefixer.py index a755cc88c0..417210d8f3 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -713,6 +713,7 @@ wordReplace = { "func_80158FB0": "Message_LoadTimeNES", "func_8015926C": "Message_LoadOwlWarpTextNES", "func_8015E750": "Message_FindCreditsMessage", + "func_80151BB4": "Message_BombersNotebookQueueEvent", "func_80133038": "Schedule_RunScript", "EffectSsKiraKira_SpawnSmallYellow": "EffectSsKirakira_SpawnSmallYellow", diff --git a/tools/permuter_settings.toml b/tools/permuter_settings.toml index 5f42d30d69..efa3bc2fe2 100644 --- a/tools/permuter_settings.toml +++ b/tools/permuter_settings.toml @@ -5,6 +5,8 @@ compiler_type = "ido" "gs[DS]P.*" = "void" "gDma.*" = "void" "G_IM_SIZ_.*" = "int" +"G_IM_FMT_.*" = "int" +"G_TX_.*" = "int" "G_[AC]C.*" = "int" LOG = "void" SET_FULLSCREEN_VIEWPORT = "void" diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 834b933ef9..80d36de95a 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -2369,7 +2369,7 @@ asm/non_matchings/code/z_message/func_801514B0.s,func_801514B0,0x801514B0,0x100 asm/non_matchings/code/z_message/Message_StartTextbox.s,Message_StartTextbox,0x801518B0,0x22 asm/non_matchings/code/z_message/Message_ContinueTextbox.s,Message_ContinueTextbox,0x80151938,0x4C asm/non_matchings/code/z_message/func_80151A68.s,func_80151A68,0x80151A68,0x53 -asm/non_matchings/code/z_message/func_80151BB4.s,func_80151BB4,0x80151BB4,0x3A +asm/non_matchings/code/z_message/Message_BombersNotebookQueueEvent.s,Message_BombersNotebookQueueEvent,0x80151BB4,0x3A asm/non_matchings/code/z_message/func_80151C9C.s,func_80151C9C,0x80151C9C,0x42 asm/non_matchings/code/z_message/func_80151DA4.s,func_80151DA4,0x80151DA4,0x1A4 asm/non_matchings/code/z_message/func_80152434.s,func_80152434,0x80152434,0xC @@ -2554,16 +2554,16 @@ asm/non_matchings/code/z_play/Play_IsDebugCamEnabled.s,Play_IsDebugCamEnabled,0x asm/non_matchings/code/z_play/func_8016A178.s,func_8016A178,0x8016A178,0x3C asm/non_matchings/code/z_play/Play_FillScreen.s,Play_FillScreen,0x8016A268,0x18 asm/non_matchings/code/z_play/Play_Init.s,Play_Init,0x8016A2C8,0x252 -asm/non_matchings/code/z_play_hireso/func_8016AC10.s,func_8016AC10,0x8016AC10,0x83 -asm/non_matchings/code/z_play_hireso/func_8016AE1C.s,func_8016AE1C,0x8016AE1C,0x117 -asm/non_matchings/code/z_play_hireso/func_8016B278.s,func_8016B278,0x8016B278,0x8E -asm/non_matchings/code/z_play_hireso/func_8016B4B0.s,func_8016B4B0,0x8016B4B0,0x3A5 -asm/non_matchings/code/z_play_hireso/func_8016C344.s,func_8016C344,0x8016C344,0x282 -asm/non_matchings/code/z_play_hireso/func_8016CD4C.s,func_8016CD4C,0x8016CD4C,0x5B0 -asm/non_matchings/code/z_play_hireso/func_8016E40C.s,func_8016E40C,0x8016E40C,0x1A1 -asm/non_matchings/code/z_play_hireso/func_8016EA90.s,func_8016EA90,0x8016EA90,0x1C6 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawScisTexRect.s,BombersNotebook_DrawScisTexRect,0x8016AC10,0x83 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawHeaders.s,BombersNotebook_DrawHeaders,0x8016AE1C,0x117 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawColumns.s,BombersNotebook_DrawColumns,0x8016B278,0x8E +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawEntries.s,BombersNotebook_DrawEntries,0x8016B4B0,0x3A5 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawRows.s,BombersNotebook_DrawRows,0x8016C344,0x282 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawTimeOfDay.s,BombersNotebook_DrawTimeOfDay,0x8016CD4C,0x5B0 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawCursor.s,BombersNotebook_DrawCursor,0x8016E40C,0x1A1 +asm/non_matchings/code/z_play_hireso/BombersNotebook_DrawArrows.s,BombersNotebook_DrawArrows,0x8016EA90,0x1C6 asm/non_matchings/code/z_play_hireso/BombersNotebook_Draw.s,BombersNotebook_Draw,0x8016F1A8,0xD1 -asm/non_matchings/code/z_play_hireso/func_8016F4EC.s,func_8016F4EC,0x8016F4EC,0x2F +asm/non_matchings/code/z_play_hireso/BombersNotebook_LoadFiles.s,BombersNotebook_LoadFiles,0x8016F4EC,0x2F asm/non_matchings/code/z_play_hireso/BombersNotebook_Update.s,BombersNotebook_Update,0x8016F5A8,0x1B4 asm/non_matchings/code/z_play_hireso/BombersNotebook_Init.s,BombersNotebook_Init,0x8016FC78,0x8 asm/non_matchings/code/z_play_hireso/BombersNotebook_Destroy.s,BombersNotebook_Destroy,0x8016FC98,0x16 diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index 28b64d2fa1..591671ab8f 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -177,10 +177,10 @@ weekEventReg = { (21 << 8) | 0x04: "WEEKEVENTREG_TALKED_GORON_GRAVEMAKER_AS_GORON", (21 << 8) | 0x08: "WEEKEVENTREG_TALKED_THAWED_GRAVEYARD_GORON", (21 << 8) | 0x10: "WEEKEVENTREG_21_10", - (21 << 8) | 0x20: "WEEKEVENTREG_21_20", + (21 << 8) | 0x20: "WEEKEVENTREG_PROMISED_TO_HELP_WITH_THEM", (21 << 8) | 0x40: "WEEKEVENTREG_21_40", (21 << 8) | 0x80: "WEEKEVENTREG_21_80", - (22 << 8) | 0x01: "WEEKEVENTREG_22_01", + (22 << 8) | 0x01: "WEEKEVENTREG_DEFENDED_AGAINST_THEM", (22 << 8) | 0x02: "WEEKEVENTREG_22_02", (22 << 8) | 0x04: "WEEKEVENTREG_CALMED_GORON_ELDERS_SON", (22 << 8) | 0x08: "WEEKEVENTREG_22_08", @@ -221,11 +221,11 @@ weekEventReg = { (26 << 8) | 0x40: "WEEKEVENTREG_26_40", (26 << 8) | 0x80: "WEEKEVENTREG_26_80", (27 << 8) | 0x01: "WEEKEVENTREG_27_01", - (27 << 8) | 0x02: "WEEKEVENTREG_27_02", - (27 << 8) | 0x04: "WEEKEVENTREG_27_04", - (27 << 8) | 0x08: "WEEKEVENTREG_27_08", - (27 << 8) | 0x10: "WEEKEVENTREG_27_10", - (27 << 8) | 0x20: "WEEKEVENTREG_27_20", + (27 << 8) | 0x02: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN", + (27 << 8) | 0x04: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN", + (27 << 8) | 0x08: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN", + (27 << 8) | 0x10: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN", + (27 << 8) | 0x20: "WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN", (27 << 8) | 0x40: "WEEKEVENTREG_27_40", (27 << 8) | 0x80: "WEEKEVENTREG_27_80", (28 << 8) | 0x01: "WEEKEVENTREG_28_01", @@ -407,20 +407,20 @@ weekEventReg = { (50 << 8) | 0x01: "WEEKEVENTREG_50_01", (50 << 8) | 0x02: "WEEKEVENTREG_50_02", (50 << 8) | 0x04: "WEEKEVENTREG_50_04", - (50 << 8) | 0x08: "WEEKEVENTREG_50_08", + (50 << 8) | 0x08: "WEEKEVENTREG_PROMISED_MIDNIGHT_MEETING", (50 << 8) | 0x10: "WEEKEVENTREG_50_10", - (50 << 8) | 0x20: "WEEKEVENTREG_50_20", + (50 << 8) | 0x20: "WEEKEVENTREG_HAD_MIDNIGHT_MEETING", (50 << 8) | 0x40: "WEEKEVENTREG_50_40", - (50 << 8) | 0x80: "WEEKEVENTREG_50_80", - (51 << 8) | 0x01: "WEEKEVENTREG_51_01", + (50 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_PENDANT_OF_MEMORIES", + (51 << 8) | 0x01: "WEEKEVENTREG_DELIVERED_PENDANT_OF_MEMORIES", (51 << 8) | 0x02: "WEEKEVENTREG_51_02", (51 << 8) | 0x04: "WEEKEVENTREG_51_04", (51 << 8) | 0x08: "WEEKEVENTREG_51_08", (51 << 8) | 0x10: "WEEKEVENTREG_51_10", - (51 << 8) | 0x20: "WEEKEVENTREG_51_20", + (51 << 8) | 0x20: "WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT", (51 << 8) | 0x40: "WEEKEVENTREG_51_40", (51 << 8) | 0x80: "WEEKEVENTREG_51_80", - (52 << 8) | 0x01: "WEEKEVENTREG_52_01", + (52 << 8) | 0x01: "WEEKEVENTREG_ESCORTED_CREMIA", (52 << 8) | 0x02: "WEEKEVENTREG_52_02", (52 << 8) | 0x04: "WEEKEVENTREG_52_04", (52 << 8) | 0x08: "WEEKEVENTREG_52_08", @@ -532,61 +532,61 @@ weekEventReg = { (65 << 8) | 0x20: "WEEKEVENTREG_65_20", (65 << 8) | 0x40: "WEEKEVENTREG_65_40", (65 << 8) | 0x80: "WEEKEVENTREG_65_80", - (66 << 8) | 0x01: "WEEKEVENTREG_66_01", - (66 << 8) | 0x02: "WEEKEVENTREG_66_02", - (66 << 8) | 0x04: "WEEKEVENTREG_66_04", - (66 << 8) | 0x08: "WEEKEVENTREG_66_08", - (66 << 8) | 0x10: "WEEKEVENTREG_66_10", - (66 << 8) | 0x20: "WEEKEVENTREG_66_20", - (66 << 8) | 0x40: "WEEKEVENTREG_66_40", - (66 << 8) | 0x80: "WEEKEVENTREG_66_80", - (67 << 8) | 0x01: "WEEKEVENTREG_67_01", - (67 << 8) | 0x02: "WEEKEVENTREG_67_02", - (67 << 8) | 0x04: "WEEKEVENTREG_67_04", - (67 << 8) | 0x08: "WEEKEVENTREG_67_08", - (67 << 8) | 0x10: "WEEKEVENTREG_67_10", - (67 << 8) | 0x20: "WEEKEVENTREG_67_20", - (67 << 8) | 0x40: "WEEKEVENTREG_67_40", - (67 << 8) | 0x80: "WEEKEVENTREG_67_80", - (68 << 8) | 0x01: "WEEKEVENTREG_68_01", - (68 << 8) | 0x02: "WEEKEVENTREG_68_02", - (68 << 8) | 0x04: "WEEKEVENTREG_68_04", - (68 << 8) | 0x08: "WEEKEVENTREG_68_08", - (68 << 8) | 0x10: "WEEKEVENTREG_68_10", - (68 << 8) | 0x20: "WEEKEVENTREG_68_20", - (68 << 8) | 0x40: "WEEKEVENTREG_68_40", - (68 << 8) | 0x80: "WEEKEVENTREG_68_80", - (69 << 8) | 0x01: "WEEKEVENTREG_69_01", - (69 << 8) | 0x02: "WEEKEVENTREG_69_02", - (69 << 8) | 0x04: "WEEKEVENTREG_69_04", - (69 << 8) | 0x08: "WEEKEVENTREG_69_08", - (69 << 8) | 0x10: "WEEKEVENTREG_69_10", - (69 << 8) | 0x20: "WEEKEVENTREG_69_20", - (69 << 8) | 0x40: "WEEKEVENTREG_69_40", - (69 << 8) | 0x80: "WEEKEVENTREG_69_80", - (70 << 8) | 0x01: "WEEKEVENTREG_70_01", - (70 << 8) | 0x02: "WEEKEVENTREG_70_02", - (70 << 8) | 0x04: "WEEKEVENTREG_70_04", - (70 << 8) | 0x08: "WEEKEVENTREG_70_08", - (70 << 8) | 0x10: "WEEKEVENTREG_70_10", - (70 << 8) | 0x20: "WEEKEVENTREG_70_20", - (70 << 8) | 0x40: "WEEKEVENTREG_70_40", - (70 << 8) | 0x80: "WEEKEVENTREG_70_80", - (71 << 8) | 0x01: "WEEKEVENTREG_71_01", - (71 << 8) | 0x02: "WEEKEVENTREG_71_02", - (71 << 8) | 0x04: "WEEKEVENTREG_71_04", - (71 << 8) | 0x08: "WEEKEVENTREG_71_08", - (71 << 8) | 0x10: "WEEKEVENTREG_71_10", - (71 << 8) | 0x20: "WEEKEVENTREG_71_20", - (71 << 8) | 0x40: "WEEKEVENTREG_71_40", - (71 << 8) | 0x80: "WEEKEVENTREG_71_80", - (72 << 8) | 0x01: "WEEKEVENTREG_72_01", - (72 << 8) | 0x02: "WEEKEVENTREG_72_02", - (72 << 8) | 0x04: "WEEKEVENTREG_72_04", - (72 << 8) | 0x08: "WEEKEVENTREG_72_08", - (72 << 8) | 0x10: "WEEKEVENTREG_72_10", - (72 << 8) | 0x20: "WEEKEVENTREG_72_20", - (72 << 8) | 0x40: "WEEKEVENTREG_72_40", + (66 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJU", + (66 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAFEI", + (66 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CURIOSITY_SHOP_MAN", + (66 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMB_SHOP_LADY", + (66 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROMANI", + (66 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_CREMIA", + (66 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MAYOR_DOTOUR", + (66 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_MADAOME_AROMA", + (67 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOTO", + (67 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN", + (67 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_POSTMAN", + (67 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ROSA_SISTERS", + (67 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_TOILET_HAND", + (67 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_ANJUS_GRANDMOTHER", + (67 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_KAMARO", + (67 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GROG", + (68 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GORMAN_BROTHERS", + (68 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_SHIRO", + (68 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_GURU_GURU", + (68 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_MET_BOMBERS", + (68 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROOM_KEY", + (68 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_MIDNIGHT_MEETING", + (68 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_MEET_KAFEI", + (68 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_LETTER_TO_KAFEI", + (69 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEPOSITED_LETTER_TO_KAFEI", + (69 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES", + (69 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES", + (69 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT", + (69 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM", + (69 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM", + (69 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE", + (69 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA", + (70 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK", + (70 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KEATON_MASK", + (70 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PRIORITY_MAIL", + (70 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PRIORITY_MAIL", + (70 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_LEARNED_SECRET_CODE", + (70 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BOMBERS_NOTEBOOK", + (70 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MAYOR_HP", + (70 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROSA_SISTERS_HP", + (71 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_TOILET_HAND_HP", + (71 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_SHORT_STORY_HP", + (71 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GRANDMA_LONG_STORY_HP", + (71 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMAN_HP", + (71 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAFEIS_MASK", + (71 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALL_NIGHT_MASK", + (71 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BUNNY_HOOD", + (71 << 8) | 0x80: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_GAROS_MASK", + (72 << 8) | 0x01: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_CIRCUS_LEADERS_MASK", + (72 << 8) | 0x02: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_POSTMANS_HAT", + (72 << 8) | 0x04: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK", + (72 << 8) | 0x08: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BLAST_MASK", + (72 << 8) | 0x10: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_KAMAROS_MASK", + (72 << 8) | 0x20: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_STONE_MASK", + (72 << 8) | 0x40: "WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_BREMEN_MASK", (72 << 8) | 0x80: "WEEKEVENTREG_72_80", (73 << 8) | 0x01: "WEEKEVENTREG_73_01", (73 << 8) | 0x02: "WEEKEVENTREG_73_02", @@ -608,7 +608,7 @@ weekEventReg = { (75 << 8) | 0x02: "WEEKEVENTREG_75_02", (75 << 8) | 0x04: "WEEKEVENTREG_75_04", (75 << 8) | 0x08: "WEEKEVENTREG_75_08", - (75 << 8) | 0x10: "WEEKEVENTREG_75_10", + (75 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_ROOM_KEY", (75 << 8) | 0x20: "WEEKEVENTREG_75_20", (75 << 8) | 0x40: "WEEKEVENTREG_75_40", (75 << 8) | 0x80: "WEEKEVENTREG_75_80", @@ -648,7 +648,7 @@ weekEventReg = { (80 << 8) | 0x02: "WEEKEVENTREG_80_02", (80 << 8) | 0x04: "WEEKEVENTREG_80_04", (80 << 8) | 0x08: "WEEKEVENTREG_80_08", - (80 << 8) | 0x10: "WEEKEVENTREG_80_10", + (80 << 8) | 0x10: "WEEKEVENTREG_RECEIVED_PRIORITY_MAIL", (80 << 8) | 0x20: "WEEKEVENTREG_80_20", (80 << 8) | 0x40: "WEEKEVENTREG_80_40", (80 << 8) | 0x80: "WEEKEVENTREG_80_80", diff --git a/undefined_syms.txt b/undefined_syms.txt index a45e5c682d..e586991ff4 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -1100,6 +1100,29 @@ D_06000D60 = 0x06000D60; // segment 0x07 +D_07000000 = 0x07000000; +D_07000800 = 0x07000800; +D_07001000 = 0x07001000; +D_07001800 = 0x07001800; +D_07002000 = 0x07002000; +D_07002800 = 0x07002800; +D_07003000 = 0x07003000; +D_07003800 = 0x07003800; +D_07004000 = 0x07004000; +D_07004800 = 0x07004800; +D_07005000 = 0x07005000; +D_07005800 = 0x07005800; +D_07006000 = 0x07006000; +D_07006800 = 0x07006800; +D_07007000 = 0x07007000; +D_07007800 = 0x07007800; +D_07008000 = 0x07008000; +D_07008800 = 0x07008800; +D_07009000 = 0x07009000; +D_07009800 = 0x07009800; +D_0700AC00 = 0x0700AC00; +D_0700AEA0 = 0x0700AEA0; + // segment 0x08