diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/berry.h | 2 | ||||
-rw-r--r-- | include/berry_crush.h | 178 | ||||
-rw-r--r-- | include/constants/flags.h | 8 | ||||
-rw-r--r-- | include/digit_obj_util.h | 8 | ||||
-rw-r--r-- | include/event_object_movement.h | 15 | ||||
-rw-r--r-- | include/field_effect_helpers.h | 2 | ||||
-rw-r--r-- | include/field_weather.h | 2 | ||||
-rw-r--r-- | include/global.fieldmap.h | 12 | ||||
-rw-r--r-- | include/global.h | 4 | ||||
-rw-r--r-- | include/graphics.h | 7 | ||||
-rw-r--r-- | include/item.h | 1 | ||||
-rw-r--r-- | include/link_rfu.h | 1 | ||||
-rw-r--r-- | include/math_util.h | 4 | ||||
-rw-r--r-- | include/overworld.h | 2 | ||||
-rw-r--r-- | include/strings.h | 34 |
15 files changed, 258 insertions, 22 deletions
diff --git a/include/berry.h b/include/berry.h index 5bf272d42..905ce291b 100644 --- a/include/berry.h +++ b/include/berry.h @@ -72,6 +72,6 @@ struct UnkStruct_0858AB24 { u16 unk1; }; -extern const struct UnkStruct_0858AB24 gUnknown_0858AB24[]; +extern const struct UnkStruct_0858AB24 gUnknown_83DFC9C[]; #endif // GUARD_BERRY_H diff --git a/include/berry_crush.h b/include/berry_crush.h index e8e9c216f..9077b966e 100644 --- a/include/berry_crush.h +++ b/include/berry_crush.h @@ -1,6 +1,184 @@ #ifndef GUARD_BERRY_CRUSH_H #define GUARD_BERRY_CRUSH_H +struct BerryCrushGame_Player +{ + u16 unk0; + u16 unk2; + union + { + u8 as_2d_bytes[2][8]; + u16 as_hwords[8]; + } unk4; + u8 unk14[12]; +}; + +struct __attribute__((packed, aligned(2))) BerryCrushGame_4E +{ + u16 unk0; + u16 filler2; + u8 unk4_0:1; + u8 unk4_1:1; + s8 unk5; + u16 unk6; + u16 unk8; + u16 unkA; + u16 unkC; +}; + +struct __attribute__((packed)) BerryCrushGame_40 +{ + u8 unk0[2]; + u16 unk2[6]; + struct BerryCrushGame_4E unkE; +}; + +struct BerryCrushGame_5C +{ + u16 unk00; + u8 unk02_0:1; + u8 unk02_1:1; + u8 unk02_2:1; + u8 unk02_3:5; + u8 unk03; + u16 unk04; + u16 unk06; + u16 unk08; + u16 unk0A; +}; + +union BerryCrushGame_68 +{ + struct BerryCrushGame_68_x + { + struct BerryCrushGame_68_x_SubStruct + { + s32 unk00; + u16 unk04; + s16 unk06; + u16 unk08; + u16 unk0A; + u16 unk0C[2][5]; + u8 filler20[16]; + } unk00; + u8 unk30[12]; + struct BerryCrushGame_Player others[4]; + u8 fillerBC[20]; + } as_four_players; + struct BerryCrushGame_68_y + { + u8 filler00[28]; + struct BerryCrushGame_Player unk1C[5]; + u8 fillerBC[20]; + } as_five_players; +}; + +struct BerryCrushGame_138_C +{ + u8 unk0; + u8 unk1; + u8 unk2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; +}; + +struct BerryCrushGame_138 +{ + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + s16 unk4; + s16 unk6; + s16 unk8; + const struct BerryCrushGame_138_C *unkC[5]; + struct Sprite *unk20; + struct Sprite *unk24[5]; + struct Sprite *unk38[5]; + struct Sprite *unk4C[11]; + struct Sprite *unk78[2]; + u8 unk80; + u8 filler81; + u8 unk82; + u8 unk83[5]; +}; + +struct BerryCrushGame +{ + MainCallback unk0; + u32 (*unk4)(struct BerryCrushGame *, u8 *); + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 unkE; + u8 unkF; + u16 unk10; + u16 unk12; + u16 unk14; + u16 unk16; + s16 unk18; + s16 unk1A; + int unk1C; + s32 unk20; + u8 unk24; + u8 unk25_0:1; + u8 unk25_1:1; + u8 unk25_2:1; + u8 unk25_3:1; + u8 unk25_4:1; + u8 unk25_5:3; + u16 unk26; + u16 unk28; + s16 unk2A; + s16 unk2C; + s16 unk2E; + s16 unk30; + s16 unk32; + s16 unk34; + u8 unk36[0xA]; + struct BerryCrushGame_40 unk40; + struct BerryCrushGame_5C unk5C; + union BerryCrushGame_68 unk68; + struct BerryCrushGame_138 unk138; + u8 unk1C0[0x1000]; + u8 unk11C0[0x1000]; + u8 unk21C0[0x1000]; + u8 unk31C0[0x1000]; +}; + +#define PLAYER_UNK14(game, i) \ + ((u8 *)(game) \ + + offsetof(struct BerryCrushGame, unk68) \ + + offsetof(struct BerryCrushGame_68_x, unk30) \ + + sizeof(struct BerryCrushGame_Player) * (i)) + +struct BerryCrushGame *sub_814B6F0(void); void StartBerryCrush(MainCallback callback); +u32 sub_814B6FC(MainCallback callback); +void sub_814B8F0(void); +void sub_814B914(void); +void sub_814B924(void); +void sub_814B930(void); +void sub_814BABC(struct BerryCrushGame *arg0); +void sub_814BB4C(u16, u8, u8 *); +void sub_814D564(u8 *, u32, s32, u32, u32, u32, u32); +int sub_814D9CC(struct BerryCrushGame *arg0); +int sub_814D5C8(void); +int sub_814D888(void); +void sub_814DA24(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1); +void sub_814DC24(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1); +void sub_814DC5C(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1); +bool32 sub_814DE50(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1); +bool32 sub_814E644(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1); +void sub_814E80C(struct BerryCrushGame *arg0); +void sub_814DA04(struct BerryCrushGame *arg0); +void sub_814EB04(struct BerryCrushGame_138 *arg0); +void sub_814DB84(struct Sprite * sprite); +void ShowBerryCrushRankings(void); #endif //GUARD_BERRY_CRUSH_H diff --git a/include/constants/flags.h b/include/constants/flags.h index 11b09512f..85d704680 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -766,8 +766,8 @@ #define FLAG_REVIVED_HELIX 0x2ED #define FLAG_REVIVED_AMBER 0x2EE #define FLAG_GOT_HM06 0x2EF -#define FLAG_SHOWED_MYSTICTICKET_TO_CAPTAIN 0x2F0 -#define FLAG_SHOWED_AURORATICKET_TO_CAPTAIN 0x2F1 +#define FLAG_SHOWN_MYSTIC_TICKET 0x2F0 +#define FLAG_SHOWN_AURORA_TICKET 0x2F1 #define FLAG_FOUGHT_LUGIA 0x2F2 #define FLAG_FOUGHT_HO_OH 0x2F3 #define FLAG_OAK_SAW_DEX_COMPLETION 0x2F4 @@ -1372,8 +1372,8 @@ #define FLAG_SYS_GOT_BERRY_POUCH (SYS_FLAGS + 0x47) #define FLAG_SYS_DEOXYS_AWAKENED (SYS_FLAGS + 0x48) #define FLAG_SYS_UNLOCKED_TANOBY_RUINS (SYS_FLAGS + 0x49) -#define FLAG_SYS_GOT_MYSTIC_TICKET (SYS_FLAGS + 0x4A) -#define FLAG_SYS_GOT_AURORA_TICKET (SYS_FLAGS + 0x4B) +#define FLAG_ENABLE_SHIP_NAVEL_ROCK (SYS_FLAGS + 0x4A) +#define FLAG_ENABLE_SHIP_BIRTH_ISLAND (SYS_FLAGS + 0x4B) // World Map Flags #define FLAG_WORLD_MAP_PALLET_TOWN (SYS_FLAGS + 0x90) diff --git a/include/digit_obj_util.h b/include/digit_obj_util.h index 11d51f1fc..1db775d26 100644 --- a/include/digit_obj_util.h +++ b/include/digit_obj_util.h @@ -11,8 +11,12 @@ struct DigitObjUtilTemplate u8 xDelta; s16 x; s16 y; - const struct SpriteSheet *spriteSheet; - const struct SpritePalette *spritePal; + union + { + const struct SpriteSheet * uncompressed; + const struct CompressedSpriteSheet * compressed; + } spriteSheet; + const struct SpritePalette * spritePal; }; extern const u16 gUnknown_8479668[]; diff --git a/include/event_object_movement.h b/include/event_object_movement.h index edc5c8b11..7828d0bcb 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -33,10 +33,10 @@ u8 GetObjectEventIdByXY(s16, s16); void ObjectEventSetDirection(struct ObjectEvent *, u8); u8 sub_808D4F4(void); void RemoveObjectEventByLocalIdAndMap(u8, u8, u8); -void npc_load_two_palettes__no_record(u16, u8); -void npc_load_two_palettes__and_record(u16, u8); +void LoadPlayerObjectReflectionPalette(u16, u8); +void LoadSpecialObjectReflectionPalette(u16, u8); void sub_805F7C4(u8, u8, u8, s16, s16); -void pal_patch_for_npc(u16, u8); +void PatchObjectPalette(u16, u8); void sub_808E16C(s16, s16); void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat); void sub_8092FF0(s16, s16, s16 *, s16 *); @@ -121,6 +121,13 @@ u8 sub_8064194(u8 direction); u8 sub_80641C0(u8 direction); void sub_805F378(s16 x, s16 y); +void sub_805F724(struct ObjectEvent *, s16 x, s16 y); +u8 CreateCopySpriteAt(struct Sprite * sprite, s16 x, s16 y, u8 subpriority); +u16 GetObjectPaletteTag(u8 paletteIndex); +void SetSpritePosToMapCoords(s16 x, s16 y, s16 *x2, s16 *y2); +void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible); +u8 ZCoordToPriority(u8 z); +void SetObjectSubpriorityByZCoord(u8 z, struct Sprite * sprite, u8 offset); // Exported data declarations @@ -131,6 +138,6 @@ extern const struct OamData gObjectEventBaseOam_32x32; extern const struct UCoords16 gUnknown_83A64C8[]; extern const u16 gUnknown_8398648[]; extern const u16 gUnknown_8398688[]; -void sub_805F724(struct ObjectEvent *, s16 x, s16 y); +extern const u8 gReflectionEffectPaletteMap[]; #endif // GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index c3e5ae29a..831f83fd5 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -13,7 +13,7 @@ // Exported ROM declarations u8 sub_8154228(void); -bool8 sub_8155DA0(struct ObjectEvent *); +bool8 sub_80DCBE0(struct ObjectEvent *); void sub_80DC44C(u8, u8); void sub_80DC478(u8, u8); void StartAshFieldEffect(s16, s16, u16, s16); diff --git a/include/field_weather.h b/include/field_weather.h index 7488c8c5a..115cc0dca 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -18,7 +18,7 @@ void SetWeatherScreenFadeOut(void); void sub_807B070(void); u8 GetCurrentWeather(void); void FieldWeather_StartFadingOutCreditsMap(u8, u8, u32); -void sub_807AA8C(u8 palIdx); +void UpdateSpritePaletteWithWeather(u8 palIdx); void ResetPreservedPalettesInWeather(void); void PreservePaletteInWeather(u8 palIdx); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index b3f5b1d42..9c380d993 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -217,17 +217,17 @@ struct ObjectEvent /*0x0C*/ struct Coords16 initialCoords; /*0x10*/ struct Coords16 currentCoords; /*0x14*/ struct Coords16 previousCoords; - /*0x18*/ u8 facingDirection:4; //current direction? - /*0x18*/ u8 placeholder18:4; + /*0x18*/ u8 facingDirection:4; + /*0x18*/ u8 movementDirection:4; /*0x19*/ union ObjectEventRange range; - /*0x1A*/ u8 mapobj_unk_1A; + /*0x1A*/ u8 fieldEffectSpriteId; /*0x1B*/ u8 mapobj_unk_1B; /*0x1C*/ u8 mapobj_unk_1C; /*0x1D*/ u8 trainerRange_berryTreeId; - /*0x1E*/ u8 mapobj_unk_1E; - /*0x1F*/ u8 mapobj_unk_1F; + /*0x1E*/ u8 currentMetatileBehavior; + /*0x1F*/ u8 previousMetatileBehavior; /*0x20*/ u8 mapobj_unk_20; - /*0x21*/ u8 mapobj_unk_21; + /*0x21*/ u8 directionSequenceIndex; /*0x22*/ u8 animId; /*size = 0x24*/ }; diff --git a/include/global.h b/include/global.h index b3fdfe231..8a8877143 100644 --- a/include/global.h +++ b/include/global.h @@ -612,8 +612,8 @@ struct QuestLogObjectEvent /*0x0a*/ s16 x; /*0x0c*/ s16 y; /*0x0e*/ u8 trainerRange_berryTreeId; - /*0x0f*/ u8 mapobj_unk_1F; - /*0x10*/ u8 mapobj_unk_21; + /*0x0f*/ u8 previousMetatileBehavior; + /*0x10*/ u8 directionSequenceIndex; /*0x11*/ u8 animId; }; diff --git a/include/graphics.h b/include/graphics.h index 1405cdcf1..2c3aa7c4b 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4875,10 +4875,15 @@ extern const u32 gLinkMiscMenu_Tilemap[]; // union_room_chat_objects extern const u32 gUnionRoomChatIcons[]; -//battle_bg +// battle_bg extern const u32 gFile_graphics_battle_transitions_vs_frame_sheet[]; extern const u32 gVsLettersGfx[]; extern const u32 gFile_graphics_battle_transitions_vs_frame_palette[]; extern const u32 gFile_graphics_battle_transitions_vs_frame_tilemap[]; +// berry_crush +extern const u16 gUnknown_8EAFEA0[]; +extern const u32 gUnknown_8EAFFC0[]; +extern const u32 gUnknown_8EB0ADC[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/item.h b/include/item.h index 1d63c1a22..2c5852617 100644 --- a/include/item.h +++ b/include/item.h @@ -79,5 +79,6 @@ void RemovePCItem(u16 itemId, u16 quantity); void SortAndCompactBagPocket(struct BagPocket * pocket); u8 CountItemsInPC(void); void ApplyNewEncryptionKeyToBagItems_(u32 newKey); +bool8 CheckHasAtLeastOneBerry(void); #endif // GUARD_ITEM_H diff --git a/include/link_rfu.h b/include/link_rfu.h index 5ef954dd5..ba2eb0120 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -275,6 +275,7 @@ bool32 GetRfuUnkCE8(void); void sub_80FA4A8(void); void sub_80FB9D0(void); void sub_80FB030(u32 a0); +void sub_80FBA44(void); #include "mevent_server.h" extern const struct mevent_server_cmd gMEventSrvScript_OtherTrainerCanceled[]; diff --git a/include/math_util.h b/include/math_util.h index 473be5d45..71e87dad1 100644 --- a/include/math_util.h +++ b/include/math_util.h @@ -3,5 +3,9 @@ s16 sub_80D8B90(s16 y); s16 sub_80D8AA0(s16 x, s16 y); +s32 sub_80D8B68(s32 x, s32 y); +s32 sub_80D8AE0(s32 x, s32 y); +s16 sub_80D8B40(u8 s, s16 x, s16 y); +s16 sub_80D8ABC(u8 s, s16 x, s16 y); #endif //GUARD_MATH_UTIL_H diff --git a/include/overworld.h b/include/overworld.h index 1775a6896..a67c7cd88 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -189,6 +189,8 @@ void sub_8057F34(void); u32 sub_8057EC0(void); void sub_8057F70(void); void sub_8057F48(void); +void SetMainCallback1(MainCallback cb); +void CB1_Overworld(void); extern u16 gHeldKeyCodeToSend; diff --git a/include/strings.h b/include/strings.h index bcb5031c1..feb63cd05 100644 --- a/include/strings.h +++ b/include/strings.h @@ -1148,4 +1148,38 @@ extern const u8 gUnknown_841DF92[]; extern const u8 gUnknown_841DF99[]; extern const u8 gUnknown_841DFA0[]; +// berry_crush +extern const u8 gUnknown_841CE3C[]; +extern const u8 gUnknown_841CE78[]; +extern const u8 gUnknown_841CEA8[]; +extern const u8 gUnknown_841CF14[]; +extern const u8 gUnknown_841CF50[]; +extern const u8 gUnknown_841CF70[]; +extern const u8 gUnknown_841CFA0[]; +extern const u8 gUnknown_841CFD4[]; +extern const u8 gUnknown_841D008[]; +extern const u8 gText_1_ClrLtGryShdwBlk_Dynamic0[]; +extern const u8 gText_1_Dynamic0[]; +extern const u8 gText_SpaceTimes[]; +extern const u8 gText_XDotY[]; +extern const u8 gText_StrVar1Berry[]; +extern const u8 gText_TimeColon[]; +extern const u8 gText_PressingSpeed[]; +extern const u8 gText_Silkiness[]; +extern const u8 gText_StrVar1[]; +extern const u8 gText_SpaceMin[]; +extern const u8 gText_XDotY2[]; +extern const u8 gText_SpaceSec[]; +extern const u8 gText_XDotY3[]; +extern const u8 gText_TimesPerSec[]; +extern const u8 gText_Var1Percent[]; +extern const u8 gText_PressesRankings[]; +extern const u8 gText_CrushingResults[]; +extern const u8 gText_BerryCrush2[]; +extern const u8 gText_PressingSpeedRankings[]; +extern const u8 gText_Var1Players[]; +extern const u8 gText_NeatnessRankings[]; +extern const u8 gText_CooperativeRankings[]; +extern const u8 gText_PressingPowerRankings[]; + #endif //GUARD_STRINGS_H |