From 9158d035af3ab866c62b7825ad332b74191d5ef2 Mon Sep 17 00:00:00 2001 From: Doesnty Date: Wed, 2 Aug 2017 14:18:39 -0500 Subject: Improve battle_4 --- include/battle.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 4b2542017..495432259 100644 --- a/include/battle.h +++ b/include/battle.h @@ -220,12 +220,11 @@ struct BattleStruct /* 0x2000000 */ /*0x16001*/ u8 turnEffectsBank; /*0x16002*/ u8 animTurn; /*0x16003*/ u8 scriptingActive; - /*0x16004*/ u8 wrappedMove1[4]; - /*0x16008*/ u8 wrappedMove2[4]; + /*0x16004*/ u8 wrappedMove[8]; /*0x1600C*/ u8 cmd49StateTracker; /*0x1600D*/ u8 unk1600D; /*0x1600E*/ u8 turncountersTracker; - /*0x1600F*/ u8 cmd23StateTracker; + /*0x1600F*/ u8 atk23StateTracker; /*0x16010*/ u8 moveTarget[4]; /*0x16014*/ u8 unk16014; /*0x16015*/ u8 unk16015; -- cgit v1.2.3 From 4f36e317f9d2489e7c192f2a70c44a087e7d1998 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 23 Aug 2017 15:55:01 +0200 Subject: name labels --- include/battle.h | 2 +- include/battle_anim.h | 4 ++-- include/decompress.h | 2 +- include/global.h | 14 ++++++++++---- include/pokedex.h | 12 +++++++++++- include/pokemon.h | 8 ++++---- include/rom_8077ABC.h | 16 ++++++++++++---- 7 files changed, 41 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 9d8092197..669f65d0a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -782,7 +782,7 @@ void BattleTurnPassed(void); // asm/battle_2.o void sub_8012324(void); void sub_8012FBC(u8, u8); -u8 b_first_side(u8, u8, u8); +u8 GetWhoStrikesFirst(u8, u8, u8); void TurnValuesCleanUp(u8); void SpecialStatusesClear(void); void sub_80138F0(void); diff --git a/include/battle_anim.h b/include/battle_anim.h index 48ceece21..2386c515c 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -53,14 +53,14 @@ struct UnknownStruct3 }; void DoMoveAnim(const u8 *const moveAnims[], u16 b, u8 c); -bool8 b_side_obj__get_some_boolean(u8 a); +bool8 IsAnimBankSpriteVisible(u8 a); void sub_8076034(u8, u8); bool8 IsContest(void); void battle_anim_clear_some_data(void); void move_anim_8072740(struct Sprite *sprite); void DestroyAnimVisualTask(u8 task); void DestroyAnimVisualTask(u8 task); -bool8 b_side_obj__get_some_boolean(u8); +bool8 IsAnimBankSpriteVisible(u8); u8 IsContest(); diff --git a/include/decompress.h b/include/decompress.h index 84c1f29c0..01f66971c 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -3,7 +3,7 @@ #include "sprite.h" -void sub_800D238(const void *src, void *dest); +void LZDecompressWram(const void *src, void *dest); void LZDecompressVram(const void *src, void *dest); void LoadCompressedObjectPic(const struct CompressedSpriteSheet *a); void LoadCompressedObjectPicOverrideBuffer(const struct CompressedSpriteSheet *a, void *buffer); diff --git a/include/global.h b/include/global.h index f076274cc..8f28c8c59 100644 --- a/include/global.h +++ b/include/global.h @@ -37,6 +37,7 @@ fndec\ #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) +#define POKEMON_SLOTS_NUMBER 412 #define POKEMON_NAME_LENGTH 10 #define OT_NAME_LENGTH 7 @@ -571,6 +572,11 @@ struct RecordMixingGift struct RecordMixingGiftData data; }; +// there should be enough flags for all 412 slots +// each slot takes up 8 flags +// if the value is not divisible by 8, we need to account for the reminder as well +#define DEX_FLAGS_NO ((POKEMON_SLOTS_NUMBER / 8) + ((POKEMON_SLOTS_NUMBER % 8) ? 1 : 0)) + struct SaveBlock1 /* 0x02025734 */ { /*0x00*/ struct Coords16 pos; @@ -597,7 +603,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x640*/ struct ItemSlot bagPocket_TMHM[64]; /*0x740*/ struct ItemSlot bagPocket_Berries[46]; /*0x7F8*/ struct Pokeblock pokeblocks[40]; - /*0x938*/ u8 unk938[52]; // pokedex related + /*0x938*/ u8 dexSeen2[DEX_FLAGS_NO]; /*0x96C*/ u16 berryBlenderRecords[3]; /*0x972*/ u8 filler_972[0x6]; /*0x978*/ u16 trainerRematchStepCounter; @@ -657,7 +663,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x3160*/ struct EnigmaBerry enigmaBerry; /*0x3690*/ struct RamScript ramScript; /*0x3A7C*/ struct RecordMixingGift recordMixingGift; - /*0x3A8C*/ u8 unk3A8C[52]; //pokedex related + /*0x3A8C*/ u8 dexSeen3[DEX_FLAGS_NO]; }; extern struct SaveBlock1 gSaveBlock1; @@ -679,8 +685,8 @@ struct Pokedex /*0x04*/ u32 unownPersonality; // set when you first see Unown /*0x08*/ u32 spindaPersonality; // set when you first see Spinda /*0x0C*/ u32 unknown3; - /*0x10*/ u8 owned[52]; - /*0x44*/ u8 seen[52]; + /*0x10*/ u8 owned[DEX_FLAGS_NO]; + /*0x44*/ u8 seen[DEX_FLAGS_NO]; }; struct SaveBlock2_Sub diff --git a/include/pokedex.h b/include/pokedex.h index 1bc63a4ff..c47494e1f 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -9,7 +9,17 @@ void CB2_InitPokedex(void); u8 sub_809070C(u16 dexNum, u32 b, u32 c); const u8 *GetPokemonCategory(u16); u16 GetPokedexHeightWeight(u16 dexNum, u8 data); -s8 GetNationalPokedexFlag(u16, u8); + +enum +{ + FLAG_GET_SEEN, + FLAG_GET_CAUGHT, + FLAG_SET_SEEN, + FLAG_SET_CAUGHT +}; + +s8 GetSetPokedexFlag(u16, u8); + u16 GetNationalPokedexCount(u8); u16 GetHoennPokedexCount(u8); bool8 sub_8090FC0(void); diff --git a/include/pokemon.h b/include/pokemon.h index d0ceaf15e..e2c7bd60e 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -391,7 +391,7 @@ struct BaseStats /*0x17*/ u8 ability2; /*0x18*/ u8 safariZoneFleeRate; /*0x19*/ u8 bodyColor:7; - u8 unk19_7:1; + u8 noFlip:1; }; struct BattleMove @@ -588,9 +588,9 @@ u8 sub_8040574(struct Pokemon *party); void ClearBattleMonForms(void); void sub_80408BC(); void current_map_music_set__default_for_battle(u16); -const u8 *pokemon_get_pal(struct Pokemon *mon); -const u8 *species_and_otid_get_pal(u16, u32, u32); -const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32); +const u8 *GetMonSpritePal(struct Pokemon *mon); +const u8 *GetMonSpritePalFromOtIdPersonality(u16, u32, u32); +const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16, u32, u32); bool8 IsOtherTrainer(u32, u8 *); void sub_8040B8C(void); void SetWildMonHeldItem(void); diff --git a/include/rom_8077ABC.h b/include/rom_8077ABC.h index 11e94e1f5..7e2cf4cee 100644 --- a/include/rom_8077ABC.h +++ b/include/rom_8077ABC.h @@ -4,10 +4,18 @@ #include "sprite.h" #include "task.h" +enum +{ + ANIM_BANK_ATK, + ANIM_BANK_DEF, + ANIM_BANK_ATK_PARTNER, + ANIM_BANK_DEF_PARTNER +}; + u8 sub_8077ABC(u8, u8); u8 sub_8077E44(u8 slot, u16 species, u8 a3); -u8 obj_id_for_side_relative_to_move(u8 side); -void oamt_set_x3A_32(struct Sprite *sprite, void(*callback)(struct Sprite *)); +u8 GetAnimBankSpriteId(u8 side); +void StoreSpriteCallbackInData6(struct Sprite *sprite, void(*callback)(struct Sprite *)); void sub_8078314(struct Sprite *sprite); void sub_8078364(struct Sprite *sprite); void sub_8078458(struct Sprite *sprite); @@ -22,8 +30,8 @@ u8 GetBankIdentity(u8 slot); u8 GetBankByPlayerAI(u8); u8 GetBankByPlayerAI(u8); u8 GetBankByPlayerAI(u8 state); -u8 sub_8078874(u8); -bool8 sub_8078874(u8); +u8 AnimBankSpriteExists(u8); +bool8 AnimBankSpriteExists(u8); bool8 IsDoubleBattle(); u8 IsDoubleBattle(void); bool8 IsDoubleBattle(void); -- cgit v1.2.3 From cdc5d1b683dd89e80d3daaf13965cae916ed9f6c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 23 Sep 2017 23:49:37 -0500 Subject: do some scrcmd/overworld labeling --- include/global.h | 2 +- include/overworld.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 79269937f..2d049a412 100644 --- a/include/global.h +++ b/include/global.h @@ -603,7 +603,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x04*/ struct WarpData location; /*0x0C*/ struct WarpData warp1; /*0x14*/ struct WarpData warp2; - /*0x1C*/ struct WarpData warp3; + /*0x1C*/ struct WarpData lastHealLocation; /*0x24*/ struct WarpData warp4; /*0x2C*/ u16 battleMusic; /*0x2E*/ u8 weather; diff --git a/include/overworld.h b/include/overworld.h index fcdc8ed97..1a7151529 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -26,10 +26,10 @@ extern const struct UCoords32 gUnknown_0821664C[]; extern void (*gFieldCallback)(void); // sub_8052F5C -void flag_var_implications_of_teleport_(void); +void Overworld_ResetStateAfterFly(void); void Overworld_ResetStateAfterTeleport(void); -void sub_8053014(void); -void sub_8053050(void); +void Overworld_ResetStateAfterDigEscRope(void); +void Overworld_ResetStateAfterWhiteOut(void); // sub_805308C void ResetGameStats(void); void IncrementGameStat(u8 index); @@ -41,8 +41,8 @@ void Overworld_SaveMapObjCoords(u8, s16, s16); void Overworld_SaveMapObjMovementType(u8, u8); // mapdata_load_assets_to_gpu_and_full_redraw // get_mapdata_header -// warp_shift -// warp_set +// ApplyCurrentWarp +// SetWarpData // warp_data_is_not_neg_1 struct MapHeader * const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum); struct MapHeader * const warp1_get_mapheader(void); @@ -50,14 +50,14 @@ struct MapHeader * const warp1_get_mapheader(void); // LoadSaveblockMapHeader // sub_80533CC void warp_in(void); -void warp1_set(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); +void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpId); void saved_warp2_set(int unused, s8 mapGroup, s8 mapNum, s8 warpId); void saved_warp2_set_2(int unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused); void sub_8053538(u8); -void sub_8053570(void); -void sub_8053588(u8); +void Overworld_SetWarpDestToLastHealLoc(void); +void Overworld_SetHealLocationWarp(u8); void sub_80535C4(s16 a1, s16 a2); void sub_805363C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void sub_8053678(void); @@ -69,7 +69,7 @@ void sub_8053720(s16, s16); // unref_sub_8053790 void sub_80537CC(u8); void gpu_sync_bg_hide(); -// sub_8053818 +// GetMapConnection // sub_8053850 bool8 sub_80538B0(u16 x, u16 y); bool8 sub_80538D0(u16 x, u16 y); @@ -89,7 +89,7 @@ void sub_8053D14(u16); // sub_8053D30 // sub_8053D6C // GetLocationMusic -// sav1_map_get_music +// GetCurrLocationMusic // warp1_target_get_music // call_map_music_set_to_zero void sub_8053E90(void); -- cgit v1.2.3 From 0c234d0929a6f7bb41277275f06abae1b3d7e823 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 24 Sep 2017 12:12:53 -0500 Subject: more renaming --- include/global.h | 2 +- include/overworld.h | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 2d049a412..240f58ece 100644 --- a/include/global.h +++ b/include/global.h @@ -605,7 +605,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x14*/ struct WarpData warp2; /*0x1C*/ struct WarpData lastHealLocation; /*0x24*/ struct WarpData warp4; - /*0x2C*/ u16 battleMusic; + /*0x2C*/ u16 savedMusic; /*0x2E*/ u8 weather; /*0x2F*/ u8 filler_2F; /*0x30*/ u8 flashLevel; // flash level on current map, 0 being normal and 4 being the darkest diff --git a/include/overworld.h b/include/overworld.h index 1a7151529..7151f75ca 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -35,10 +35,10 @@ void ResetGameStats(void); void IncrementGameStat(u8 index); u32 GetGameStat(u8 index); void SetGameStat(u8, u32); -// sub_8053154 +// LoadMapObjTemplatesFromHeader // LoadSaveblockMapObjScripts -void Overworld_SaveMapObjCoords(u8, s16, s16); -void Overworld_SaveMapObjMovementType(u8, u8); +void Overworld_SetMapObjTemplateCoords(u8, s16, s16); +void Overworld_SetMapObjTemplateMovementType(u8, u8); // mapdata_load_assets_to_gpu_and_full_redraw // get_mapdata_header // ApplyCurrentWarp @@ -81,7 +81,7 @@ void walkrun_find_lowest_active_bit_in_bitfield(void); u8 sub_8053B00(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3); u8 sub_8053B60(struct UnkPlayerStruct *playerStruct, u8, u16, u8); u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void); -bool32 Overworld_IsBikeAllowedOnCurrentMap(void); +bool32 Overworld_IsBikingAllowed(void); void SetDefaultFlashLevel(void); void Overworld_SetFlashLevel(s32 a1); u8 Overworld_GetFlashLevel(void); @@ -89,19 +89,19 @@ void sub_8053D14(u16); // sub_8053D30 // sub_8053D6C // GetLocationMusic -// GetCurrLocationMusic -// warp1_target_get_music -// call_map_music_set_to_zero -void sub_8053E90(void); -void sav1_set_battle_music_maybe(u16); -void sav1_reset_battle_music_maybe(void); +// GetCurrLocationDefaultMusic +// GetWarpDestinationMusic +// Overworld_ResetMapMusic +void Overworld_PlaySpecialMapMusic(void); +void Overworld_SetSavedMusic(u16); +void Overworld_ClearSavedMusic(void); void sub_8053F0C(void); -void sub_8053F84(void); +void Overworld_ChangeMusicToDefault(void); void Overworld_ChangeMusicTo(u16); // GetMapMusicFadeoutSpeed void sub_8053FF8(void); bool8 sub_8054034(void); -void sub_8054044(void); +void Overworld_FadeOutMapMusic(void); // PlayAmbientCry void UpdateAmbientCry(s16 *, u16 *); void ChooseAmbientCrySpecies(void); -- cgit v1.2.3 From 37b891cbd49780d63fe2295add70bf003c59de48 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 30 Sep 2017 16:48:30 -0700 Subject: Add missing extern to included texts --- include/trade.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/trade.h b/include/trade.h index a44388506..f950aca53 100644 --- a/include/trade.h +++ b/include/trade.h @@ -14,9 +14,9 @@ struct SomeTradeStruct extern struct SomeTradeStruct* gUnknown_03004828; -const u8 gOtherText_MaleSymbol3[1]; -const u8 gOtherText_FemaleSymbol3[1]; -const u8 gOtherText_GenderlessSymbol[1]; +extern const u8 gOtherText_MaleSymbol3[1]; +extern const u8 gOtherText_FemaleSymbol3[1]; +extern const u8 gOtherText_GenderlessSymbol[1]; void sub_804E22C(void); -- cgit v1.2.3