Berry Crush documentation, 2

This commit is contained in:
PikalaxALT
2020-04-11 21:47:47 -04:00
parent 8f8665e1dc
commit 4e3b3cdd3c
15 changed files with 955 additions and 931 deletions
+3 -3
View File
@@ -67,11 +67,11 @@ const struct Berry * GetBerryInfo(u8 berryIdx);
extern const struct Berry gBerries[];
struct UnkStruct_0858AB24 {
struct BerryCrushStats {
u8 unk0;
u16 unk1;
u16 powder;
};
extern const struct UnkStruct_0858AB24 gUnknown_83DFC9C[];
extern const struct BerryCrushStats gBerryCrushStats[];
#endif // GUARD_BERRY_H
+66 -49
View File
@@ -13,9 +13,37 @@ enum {
BCTEXT_COMMSTANDBY,
};
enum {
BCCMD_BeginNormalPaletteFade = 1,
BCCMD_WaitPaletteFade,
BCCMD_PrintMessage,
BCCMD_InitGfx,
BCCMD_TeardownGfx,
BCCMD_SignalReadyToBegin,
BCCMD_AskPickBerry,
BCCMD_GoToBerryPouch,
BCCMD_WaitForOthersToPickBerries,
BCCMD_DropBerriesIntoCrusher,
BCCMD_DropLid,
BCCMD_Countdown,
BCCMD_PlayGame_Master,
BCCMD_PlayGame_Slave,
BCCMD_FinishGame,
BCCMD_HandleTimeUp,
BCCMD_TabulateResults,
BCCMD_ShowResults,
BCCMD_SaveTheGame,
BCCMD_AskPlayAgain,
BCCMD_CommunicatePlayAgainResponses,
BCCMD_FadeOutToPlayAgain,
BCCMD_PlayAgainFailureMessage,
BCCMD_GracefulExit,
BCCMD_Quit,
};
struct BerryCrushGame_Player
{
u16 unk0;
u16 berryId;
u16 unk2;
union
{
@@ -25,40 +53,26 @@ struct BerryCrushGame_Player
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 pushedAButton:1;
u8 unk02_3:5;
u8 unk03;
s8 unk03;
u16 unk04;
u16 unk06;
u16 unk08;
u16 unk0A;
};
struct __attribute__((packed, aligned(2))) BerryCrushGame_4E
{
u16 unk0;
struct BerryCrushGame_5C data;
};
union BerryCrushGame_68
{
struct BerryCrushGame_68_x
@@ -70,7 +84,9 @@ union BerryCrushGame_68
s16 unk06;
u16 unk08;
u16 unk0A;
u16 unk0C[2][5];
// 0: Number of A presses
// 1: Neatness
u16 stats[2][5];
u8 filler20[16];
} unk00;
u8 unk30[12];
@@ -85,7 +101,7 @@ union BerryCrushGame_68
} as_five_players;
};
struct BerryCrushGame_138_C
struct BerryCrushPlayerSeatCoords
{
u8 unk0;
u8 unk1;
@@ -98,19 +114,19 @@ struct BerryCrushGame_138_C
struct BerryCrushGame_138
{
u8 unk0;
u8 animBerryIdx;
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];
s16 minutes;
s16 secondsInt;
s16 secondsFrac;
const struct BerryCrushPlayerSeatCoords * seatCoords[5];
struct Sprite *coreSprite;
struct Sprite *impactSprites[5];
struct Sprite *berrySprites[5];
struct Sprite *sparkleSprites[11];
struct Sprite *timerSprites[2];
u8 unk80;
u8 filler81;
u8 unk82;
@@ -130,12 +146,12 @@ struct BerryCrushGame
u8 nextCmd;
u8 afterPalFadeCmd;
u16 unk10;
u16 unk12;
u16 gameState;
u16 unk14;
u16 unk16;
u16 pressingSpeed;
s16 unk18;
s16 unk1A;
int unk1C;
int powder;
s32 unk20;
u8 unk24;
u8 unk25_0:1;
@@ -145,18 +161,19 @@ struct BerryCrushGame
u8 unk25_4:1;
u8 unk25_5:3;
u16 unk26;
u16 unk28;
s16 unk2A;
s16 unk2C;
u16 timer;
s16 depth;
s16 vibration;
s16 unk2E;
s16 unk30;
s16 unk32;
s16 unk34;
u8 commandParams[10];
struct BerryCrushGame_40 unk40;
struct BerryCrushGame_5C unk5C;
u16 sendCmd[7];
u16 recvCmd[7];
struct BerryCrushGame_5C localState;
union BerryCrushGame_68 unk68;
struct BerryCrushGame_138 unk138;
struct BerryCrushGame_138 spritesManager;
u8 bg1Buffer[0x1000];
u8 unk11C0[0x1000];
u8 bg2Buffer[0x1000];
@@ -175,21 +192,21 @@ u32 ExitBerryCrushWithCallback(MainCallback callback);
void CB2_BerryCrush_GoToBerryPouch(void);
void BerryCrush_SetVBlankCallback(void);
void BerryCrush_UnsetVBlankCallback(void);
void sub_814B930(void);
void BerryCrush_UpdateSav2Records(void);
void BerryCrush_RunOrScheduleCommand(u16 command, u8 runMode, u8 *params);
void BerryCrush_SetPaletteFadeParams(u8 *params, bool8 communicateAfter, u32 selectedPals, s8 delay, u8 startY, u8 targetY, u16 palette);
int sub_814D9CC(struct BerryCrushGame *arg0);
int BerryCrush_InitBgs(void);
int BerryCrush_TeardownBgs(void);
void sub_814DA24(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1);
void sub_814DC24(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1);
void BerryCrush_CreateBerrySprites(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1);
void BerryCrushFreeBerrySpriteGfx(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 BerryCrush_HideTimerSprites(struct BerryCrushGame_138 *arg0);
void SpriteCB_DropBerryIntoCrusher(struct Sprite * sprite);
void ShowBerryCrushRankings(void);
#endif //GUARD_BERRY_CRUSH_H
+6 -6
View File
@@ -1,11 +1,11 @@
#ifndef GUARD_MATH_UTIL_H
#define GUARD_MATH_UTIL_H
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);
s16 MathUtil_Inv16(s16 y);
s16 MathUtil_Mul16(s16 x, s16 y);
s32 MathUtil_Div32(s32 x, s32 y);
s32 MathUtil_Mul32(s32 x, s32 y);
s16 MathUtil_Div16Shift(u8 s, s16 x, s16 y);
s16 MathUtil_Mul16Shift(u8 s, s16 x, s16 y);
#endif //GUARD_MATH_UTIL_H
+1 -1
View File
@@ -114,6 +114,6 @@ bool8 sub_80DA4A0(void);
u8 Save_LoadGameData(u8 saveType);
u32 TryCopySpecialSaveSection(u8 sector, u8* dst);
u32 TryWriteSpecialSaveSection(u8 sector, u8* src);
void sub_80DA634(u8 taskId);
void Task_SaveGame_UpdatedLinkRecords(u8 taskId);
#endif // GUARD_SAVE_H