Merge branch 'master' into movement-action

This commit is contained in:
cbt6
2022-08-15 12:54:47 +08:00
committed by GitHub
286 changed files with 8970 additions and 9432 deletions
+4
View File
@@ -12,4 +12,8 @@
#define MAP(map) MAP_GROUP(map), MAP_NUM(map)
// Used to indicate an invalid warp id, for dummy warps or when a warp should
// use the given coordinates rather than the coordinates of a target warp.
#define WARP_ID_NONE (-1)
#endif // GUARD_CONSTANTS_MAPS_H
+7
View File
@@ -334,4 +334,11 @@
#define SPECIAL_VARS_END 0x8014
// Text color ids for VAR_TEXT_COLOR / VAR_PREV_TEXT_COLOR
#define NPC_TEXT_COLOR_MALE 0 // Blue, for male NPCs
#define NPC_TEXT_COLOR_FEMALE 1 // Red, for female NPCs
#define NPC_TEXT_COLOR_MON 2 // Black, for Pokémon
#define NPC_TEXT_COLOR_NEUTRAL 3 // Black, for inanimate objects and messages from the game
#define NPC_TEXT_COLOR_DEFAULT 255 // If an NPC is selected, use the color specified by GetColorFromTextColorTable, otherwise use Neutral.
#endif // GUARD_CONSTANTS_VARS_H
+47 -89
View File
@@ -1,106 +1,64 @@
#ifndef GUARD_DODRIO_BERRY_PICKING_H
#define GUARD_DODRIO_BERRY_PICKING_H
struct DodrioSubstruct_0160
{
/*0x0000 : 0x3000*/ u16 ALIGNED(4) tilemapBuffers[3][BG_SCREEN_SIZE];
/*0x3000 : 0x3160*/ bool32 finished;
/*0x3004 : 0x3164*/ u8 ALIGNED(4) unk3004;
/*0x3008 : 0x3168*/ u8 ALIGNED(4) unk3008[10];
/*0x3014 : 0x3174*/ u8 ALIGNED(4) state;
/*0x3018 : 0x3178*/ u8 ALIGNED(4) unk3018;
/*0x301C : 0x317C*/ u16 ALIGNED(4) unk301C;
/*0x3020 : 0x3180*/ u8 ALIGNED(4) unk3020;
/*0x3024 : 0x3184*/ u8 ALIGNED(4) unk3024;
/*0x3024 : 0x3184*/ void (*unk3028)(void);
}; // size = 0x302C
// Berries fall in predefined columns.
// A total of 10 are available, though fewer will be used with < 5 players
// The 11th column is a repeat of the 1st column wrapped around, so only
// the values 0-9 are unique 'valid' columns
#define NUM_BERRY_COLUMNS 11
struct DodrioSubstruct_318C
struct DodrioGame_Berries
{
bool8 isShiny;
u8 ids[NUM_BERRY_COLUMNS];
u8 fallDist[NUM_BERRY_COLUMNS];
};
struct DodrioSubstruct_31A0_14
struct DodrioGame_PlayerCommData
{
u8 unk0[11];
u8 unkB[11];
u8 pickState;
bool8 ALIGNED(4) ateBerry;
bool8 ALIGNED(4) missedBerry;
};
struct DodrioSubstruct_31A0_2C
struct DodrioGame_Player
{
u8 unk0;
u8 ALIGNED(4) unk4;
u8 ALIGNED(4) unk8;
};
struct DodrioSubstruct_31A0
{
u8 name[0x10];
u32 unk10;
struct DodrioSubstruct_31A0_14 unk14;
struct DodrioSubstruct_31A0_2C unk2C;
u8 filler_35[4];
u8 name[16];
bool32 receivedGameStatePacket; // Never read
struct DodrioGame_Berries berries;
struct DodrioGame_PlayerCommData comm;
u32 unused;
}; // size = 0x3C
struct DodrioSubstruct_3308
{
u8 unk0;
u32 unk4;
};
void StartDodrioBerryPicking(u16 species, MainCallback callback);
u32 sub_815A950(u32 unused, struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 *arg6, u32 *arg7, u32 *arg8);
u32 sub_815AB04(u32 arg0, u8 *arg1);
bool32 sub_815AB60(u32 a0);
void sub_815A61C(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 arg6, u32 arg7, u32 arg8);
void sub_815A5BC(s32 a0);
void sub_815AAD8(u8 a0);
void sub_815AB3C(u32 a0);
u8 sub_815A5E8(s32 a0);
u32 IncrementWithLimit(u32, u32);
void sub_8153A9C(void);
void sub_8153AFC(struct DodrioSubstruct_318C * unk318C, u8 a1, u8 a2, u8 a3);
void sub_8153BC0(u8 a0);
void sub_8153BF8(u8 a0);
void sub_8153D08(u8 playerCount);
u8 sub_8155E8C(void);
u8 sub_81533B4(void);
void sub_8153DA8(u8 a0, u8 a1);
void sub_8153D80(bool8 a0, u8 a1);
void sub_8153FC8(u8 a0);
void sub_8153DD8(void);
void sub_8153E28(void);
void sub_8153ED8(void);
bool32 sub_8153F1C(void);
void sub_81540DC(bool8 a0);
void sub_8154128(void);
void sub_815417C(void);
void sub_8154274(void);
void sub_81542EC(u8 a0, u8 a1);
void sub_8154370(u8 a0, u8 a1);
void sub_8154398(u16 a0, u8 a1);
void sub_8154438(void);
void sub_81544F0(void);
void sub_8154540(void);
void sub_8154578(void);
void sub_81545BC(bool8 a0);
void sub_81546C0(void);
void sub_8154730(void);
void sub_8154968(struct DodrioSubstruct_0160 * unk0160);
void sub_81549D4(u8 a0);
u8 *sub_81533C4(u8 id);
u8 sub_81537AC(u8 id);
void sub_81536A0(struct DodrioSubstruct_3308 *dst, u8 id);
u32 sub_81534AC(void);
u32 Min(u32 x, u32 y);
u16 sub_8153404(u8 arg0, u8 arg1);
u32 sub_81534F0(u8 arg0);
u32 sub_81535B0(void);
u16 sub_8153390(void);
u8 sub_815372C(void);
bool32 sub_8155E68(void);
// dodrio_berry_picking.c
void StartDodrioBerryPicking(u16 partyId, MainCallback exitCallback);
void ShowDodrioBerryPickingRecords(void);
void IsDodrioInParty(void);
// dodrio_berry_picking_comm.c
void SendPacket_ReadyToStart(bool32 ready);
bool8 RecvPacket_ReadyToStart(s32 playerId);
void SendPacket_GameState(struct DodrioGame_Player *player,
struct DodrioGame_PlayerCommData *player1,
struct DodrioGame_PlayerCommData *player2,
struct DodrioGame_PlayerCommData *player3,
struct DodrioGame_PlayerCommData *player4,
struct DodrioGame_PlayerCommData *player5,
u8 numGraySquares,
bool32 berriesFalling,
bool32 allReadyToEnd);
bool32 RecvPacket_GameState(u32 playerId,
struct DodrioGame_Player *player,
struct DodrioGame_PlayerCommData *player1,
struct DodrioGame_PlayerCommData *player2,
struct DodrioGame_PlayerCommData *player3,
struct DodrioGame_PlayerCommData *player4,
struct DodrioGame_PlayerCommData *player5,
u8 *numGraySquares,
bool32 *berriesFalling,
bool32 *allReadyToEnd);
void SendPacket_PickState(u8 pickState);
bool32 RecvPacket_PickState(u32 playerId, u8 *pickState);
void SendPacket_ReadyToEnd(bool32 readyToEnd);
bool32 RecvPacket_ReadyToEnd(u32 playerId);
#endif //GUARD_DODRIO_BERRY_PICKING_H
+4 -4
View File
@@ -3,10 +3,10 @@
#include "global.h"
bool8 NativeScript_WaitPlayerStopMoving(void);
void ScriptFreezeObjectEvents(void);
bool8 NativeScript_WaitPlayerAndTargetNPCStopMoving(void);
void LockSelectedObjectEvent(void);
bool8 IsFreezePlayerFinished(void);
void FreezeObjects_WaitForPlayer(void);
bool8 IsFreezeSelectedObjectAndPlayerFinished(void);
void FreezeObjects_WaitForPlayerAndSelected(void);
void ClearPlayerHeldMovementAndUnfreezeObjectEvents(void);
bool8 walkrun_is_standing_still(void);
void UnionRoom_UnlockPlayerAndChatPartner(void);
+5 -5
View File
@@ -76,7 +76,7 @@ void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16);
void ObjectEventClearHeldMovement(struct ObjectEvent *);
void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
void SpawnObjectEventsInView(s16, s16);
u8 sprite_new(u8, u8, s16, s16, u8, u8);
u8 CreateVirtualObject(u8, u8, s16, s16, u8, u8);
u8 AddPseudoObjectEvent(u16, SpriteCallback, s16, s16, u8);
u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup);
int SpawnSpecialObjectEventParameterized(u8, u8, u8, s16, s16, u8);
@@ -88,11 +88,11 @@ void ObjectEventTurn(struct ObjectEvent *, u8);
void ObjectEventTurnByLocalIdAndMap(u8, u8, u8, u8);
void ObjectEventForceSetHeldMovement(struct ObjectEvent *, u8);
const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8);
void ShowOrHideObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 state);
void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, u8 state);
void FreeAndReserveObjectSpritePalettes(void);
void SetObjectPositionByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y);
void UnfixObjectPriorityByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup);
void SetObjectPriorityByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority);
void ResetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup);
void SetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority);
void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup);
void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16);
void TryOverrideObjectEventTemplateCoords(u8, u8, u8);
@@ -138,7 +138,7 @@ bool8 UpdateWalkSlowerAnim(struct Sprite *sprite);
void SetJumpSpriteData(struct Sprite *, u8, u8, u8);
u8 DoJumpSpriteMovement(struct Sprite *);
u8 DoJumpSpecialSpriteMovement(struct Sprite *);
void TurnObjectEvent(u8, u8);
void TurnVirtualObject(u8, u8);
const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId);
u8 GetFirstInactiveObjectEventId(void);
u8 GetCollisionFlagsAtCoords(struct ObjectEvent * objectEvent, s16 x, s16 y, u8 direction);
+2 -2
View File
@@ -113,11 +113,11 @@ extern struct Weather *const gWeatherPtr;
void FadeScreen(u8 mode, s8 delay);
void SetSav1Weather(u32);
void SetSavedWeather(u32);
u8 GetSav1Weather(void);
void DoCurrentWeather(void);
void SetSav1WeatherFromCurrMapHeader(void);
void SetSavedWeatherFromCurrMapHeader(void);
void SlightlyDarkenPalsInWeather(u16 *, u16 *, u32);
void PlayRainStoppingSoundEffect(void);
bool8 IsWeatherNotFadingIn(void);
+8
View File
@@ -12,6 +12,14 @@
#define MAX_MAP_DATA_SIZE 0x2800
#define VIRTUAL_MAP_SIZE (MAX_MAP_DATA_SIZE)
// Map coordinates are offset by 7 when using the map
// buffer because it needs to load sufficient border
// metatiles to fill the player's view (the player has
// 7 metatiles of view horizontally in either direction).
#define MAP_OFFSET 7
#define MAP_OFFSET_W (MAP_OFFSET * 2 + 1)
#define MAP_OFFSET_H (MAP_OFFSET * 2)
extern struct BackupMapLayout VMap;
extern const struct MapLayout Route1_Layout;
+19 -19
View File
@@ -4902,26 +4902,26 @@ extern const u32 gEasyChatSelectGroupHelp_Tiles[];
extern const u32 gEasyChatModeIcons_Tiles[];
// naming_screen
extern const u32 gUnknown_8E982BC[];
extern const u32 gUnknown_8E98458[];
extern const u32 gUnknown_8E98398[];
extern const u32 gUnknown_8E98518[];
extern const u32 gNamingScreenBackground_Tilemap[];
extern const u32 gNamingScreenKeyboardLower_Tilemap[];
extern const u32 gNamingScreenKeyboardUpper_Tilemap[];
extern const u32 gNamingScreenKeyboardSymbols_Tilemap[];
extern const u32 gNamingScreenMenu_Gfx[];
extern const u16 gUnknown_8E98004[];
extern const u16 gUnknown_8E97FE4[];
extern const u16 gNamingScreenMenu_Pal[];
extern const u16 gUnknown_8E98858[];
extern const u16 gUnknown_8E98A38[];
extern const u16 gUnknown_8E985D8[];
extern const u16 gUnknown_8E98FD8[];
extern const u16 gUnknown_8E98C18[];
extern const u16 gUnknown_8E98CB8[];
extern const u16 gUnknown_8E98D58[];
extern const u16 gUnknown_8E98DF8[];
extern const u16 gUnknown_8E98E98[];
extern const u16 gUnknown_8E98F38[];
extern const u16 gUnknown_8E990D8[];
extern const u16 gUnknown_8E990F8[];
extern const u16 gNamingScreenRival_Pal[];
extern const u16 gNamingScreenKeyboard_Pal[];
extern const u16 gNamingScreenMenu_Pal[6][16];
extern const u16 gNamingScreenBackButton_Gfx[];
extern const u16 gNamingScreenOKButton_Gfx[];
extern const u16 gNamingScreenPageSwapFrame_Gfx[];
extern const u16 gNamingScreenPageSwapButton_Gfx[];
extern const u16 gNamingScreenPageSwapUpper_Gfx[];
extern const u16 gNamingScreenPageSwapLower_Gfx[];
extern const u16 gNamingScreenPageSwapOthers_Gfx[];
extern const u16 gNamingScreenCursor_Gfx[];
extern const u16 gNamingScreenCursorSquished_Gfx[];
extern const u16 gNamingScreenCursorFilled_Gfx[];
extern const u16 gNamingScreenInputArrow_Gfx[];
extern const u16 gNamingScreenUnderscore_Gfx[];
// pokemon_storage_system
extern const u32 gPSSMenu_Gfx[];
+1 -1
View File
@@ -6,7 +6,7 @@
#define NAMING_SCREEN_PLAYER 0
#define NAMING_SCREEN_BOX 1
#define NAMING_SCREEN_CAUGHT_MON 2
#define NAMING_SCREEN_NAME_RATER 3
#define NAMING_SCREEN_NICKNAME 3
#define NAMING_SCREEN_RIVAL 4
void DoNamingScreen(u8 templateNum, u8 *destBuffer, u16 monSpecies, u16 monGender, u32 monPersonality, MainCallback returnCallback);
+3 -3
View File
@@ -60,8 +60,8 @@ extern u8 gLocalLinkPlayerId;
void IncrementGameStat(u8 index);
void Overworld_SetMapObjTemplateCoords(u8, s16, s16);
void Overworld_SetObjEventTemplateMovementType(u8, u8);
void SetObjEventTemplateCoords(u8, s16, s16);
void SetObjEventTemplateMovementType(u8, u8);
void SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
@@ -77,7 +77,7 @@ u8 IsMapTypeOutdoors(u8 mapType);
void Overworld_ClearSavedMusic(void);
bool32 Overworld_MusicCanOverrideMapMusic(u16 song);
void Overworld_SetFlashLevel(s32 a1);
void SetFlashLevel(s32 a1);
u8 Overworld_GetFlashLevel(void);
void Overworld_SetSavedMusic(u16);
+1 -1
View File
@@ -61,7 +61,7 @@ bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objec
const u8 *GetRamScript(u8 objectId, const u8 *script);
bool32 ValidateRamScript(void);
void MEventSetRamScript(u8 * script, u16 scriptSize);
u8 * sub_8069E48(void);
u8 * GetSavedRamScriptIfValid(void);
void RegisterQuestLogInput(u8 var);
void ClearMsgBoxCancelableState(void);
void SetQuestLogInputIsDpadFlag(void);
+1 -1
View File
@@ -13,7 +13,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 var1, u8 var2, u8 var3);
bool8 CreatePCMenu(void);
void ScriptMenu_DisplayPCStartupPrompt(void);
bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void);
bool8 (*ScriptMenu_HidePokemonPic(void))(void);
void QLPlaybackCB_DestroyScriptMenuMonPicSprites(void);
void PicboxCancel(void);
+1 -1
View File
@@ -169,7 +169,7 @@ enum {
FONT_3,
FONT_4,
FONT_5,
FONT_6,
FONT_BRAILLE,
};
enum