diff options
Diffstat (limited to 'include')
30 files changed, 229 insertions, 88 deletions
diff --git a/include/battle.h b/include/battle.h index 90bef24ac..c4a0fe9a5 100644 --- a/include/battle.h +++ b/include/battle.h @@ -660,10 +660,22 @@ struct MonSpritesGfx u8 field_F4[0x80]; u8 *barFontGfx; void *field_178; - void *field_17C; + u16 *field_17C; }; // All battle variables are declared in battle_main.c +extern u16 gBattle_BG0_X; +extern u16 gBattle_BG0_Y; +extern u16 gBattle_BG1_X; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG2_X; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG3_X; +extern u16 gBattle_BG3_Y; +extern u16 gBattle_WIN0H; +extern u16 gBattle_WIN0V; +extern u16 gBattle_WIN1H; +extern u16 gBattle_WIN1V; extern u8 gDisplayedStringBattle[300]; extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT]; extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT]; diff --git a/include/battle_anim.h b/include/battle_anim.h index 653be10b8..16e9de0ac 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -9,7 +9,7 @@ enum BG_ANIM_SCREEN_SIZE, BG_ANIM_AREA_OVERFLOW_MODE, BG_ANIM2, - BG_ANIM3, + BG_ANIM_CHAR_BASE_BLOCK, BG_ANIM_PRIORITY, BG_ANIM_5, BG_ANIM_6 @@ -64,6 +64,7 @@ s8 BattleAnimAdjustPanning2(s8 pan); s16 KeepPanInRange(s16 a); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); void sub_80A4720(u16 a, u16 *b, u32 c, u8 d); +void sub_80A477C(bool8); // battle_anim_80FE840.s void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); @@ -72,9 +73,35 @@ void HandleIntroSlide(u8 terrainId); u32 GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_80A5C6C.s -void sub_80A6EEC(struct Sprite *sprite); -void sub_80A68D4(struct Sprite *sprite); +void sub_80A6450(struct Sprite *sprite); +void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y); +void move_anim_8074EE0(struct Sprite *sprite); +void sub_80A656C(struct Sprite *sprite); +void InitAnimSpritePos(struct Sprite *sprite, u8 a2); +void sub_80A6980(struct Sprite *sprite, bool8 a2); +void StartAnimLinearTranslation(struct Sprite *sprite); +void InitAnimArcTranslation(struct Sprite *sprite); bool8 TranslateAnimLinear(struct Sprite *sprite); +void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); +void sub_80A8EE4(struct Sprite *sprite); +u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); +void sub_80A6FD4(struct Sprite *sprite); +u16 ArcTan2Neg(s16 a, s16 b); +void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); +void sub_80A67BC(struct Sprite *sprite); +void sub_80A66DC(struct Sprite *sprite); +void sub_80A6838(struct Sprite *sprite); +void sub_80A67D8(struct Sprite *sprite); +void sub_80A6864(struct Sprite *sprite, s16 a2); +s16 sub_80A861C(u8 battlerId, u8 a2); +u8 GetBattlerYCoordWithElevation(u8 battlerId); +void WaitAnimForDuration(struct Sprite *sprite); +void sub_80A7938(struct Sprite *sprite); +void InitAnimLinearTranslation(struct Sprite *sprite); +void sub_80A6F98(struct Sprite *sprite); +u8 sub_80A8328(u8 battlerId); +void *sub_80A8050(s16 bottom, s16 top); +void sub_80A8048(s16 *bottom, s16 *top, const void *ptr); void sub_80A8278(void); void sub_80A6B30(struct UnknownAnimStruct2*); void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1); @@ -84,9 +111,18 @@ void sub_80A6630(struct Sprite *sprite); void sub_80A6680(struct Sprite *sprite); void sub_80A7344(u8 spriteId); void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); -void sub_80A6E14(struct Sprite *sprite); +void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void sub_80A7270(u8 spriteId, u8 objMode); void sub_80A73A0(u8 spriteId); +u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); +u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4); +u8 sub_80A77AC(u8 a1); +s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8); +void obj_delete_but_dont_free_vram(struct Sprite*); +u8 sub_80A89C8(int, u8, int); +void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32); +void sub_80A6CC0(u32, const void*, u32); +void sub_80A6DAC(bool8); enum { @@ -127,6 +163,11 @@ u8 ItemIdToBallId(u16 itemId); u8 LaunchBallStarsTask(u8 x, u8 y, u8 kindOfStars, u8 arg3, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 arg2, u8 ballId); +// battle_anim_utility_funcs.s +void sub_8116EB4(u8); + +u32 sub_811583C(s16); + u8 GetBattlerSpriteFinal_Y(u8, u16, u8); extern const struct OamData gUnknown_08524944; diff --git a/include/battle_pyramid.h b/include/battle_pyramid.h new file mode 100644 index 000000000..5d38e9f35 --- /dev/null +++ b/include/battle_pyramid.h @@ -0,0 +1,24 @@ +#ifndef GUARD_BATTLE_PYRAMID_H +#define GUARD_BATTLE_PYRAMID_H + +void CallBattlePyramidFunction(void); +u16 LocalIdToPyramidTrainerId(u8 localId); +bool8 GetBattlePyramidTrainerFlag(u8 eventId); +void sub_81A9B04(void); +void GenerateBattlePyramidWildMon(void); +u8 GetPyramidRunMultiplier(void); +u8 InBattlePyramid(void); +bool8 InBattlePyramid_(void); +void sub_81A9E90(void); +void sub_81A9EC8(void); +void CopyPyramidTrainerSpeechBefore(u16 trainerId); +void CopyPyramidTrainerWinSpeech(u16 trainerId); +void CopyPyramidTrainerLoseSpeech(u16 trainerId); +u8 GetTrainerEncounterMusicIdInBattlePyramind(u16 trainerId); +void sub_81AA078(u16 *mapArg, u8 arg1); +void sub_81AA1D8(void); +void sub_81AA2F8(void); +u8 sub_81AAA40(void); +u16 GetBattlePyramidPickupItemId(void); + +#endif // GUARD_BATTLE_PYRAMID_H diff --git a/include/battle_pyramid_bag.h b/include/battle_pyramid_bag.h index 2301b0aa0..48f8de3c0 100644 --- a/include/battle_pyramid_bag.h +++ b/include/battle_pyramid_bag.h @@ -34,6 +34,7 @@ struct PyramidBagCursorData extern struct PyramidBagResources *gPyramidBagResources; extern struct PyramidBagCursorData gPyramidBagCursorData; +void sub_81C4EEC(void); void CB2_PyramidBagMenuFromStartMenu(void); void sub_81C4F84(void); void sub_81C5924(void); diff --git a/include/battle_tower.h b/include/battle_tower.h index 90c22c982..b6adcec0c 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -38,6 +38,8 @@ extern const u8 gTowerMaleTrainerGfxIds[30]; extern const u8 gTowerFemaleFacilityClasses[20]; extern const u8 gTowerFemaleTrainerGfxIds[20]; +extern u16 gUnknown_03006298[]; + extern const struct BattleFrontierTrainer *gFacilityTrainers; extern const struct FacilityMon *gFacilityTrainerMons; diff --git a/include/berry_blender.h b/include/berry_blender.h index fb62e3fa3..e8f7bb83d 100644 --- a/include/berry_blender.h +++ b/include/berry_blender.h @@ -1,6 +1,8 @@ #ifndef GUARD_BERRY_BLENDER_H #define GUARD_BERRY_BLENDER_H +extern u8 gInGameOpponentsNo; + void DoBerryBlending(void); u16 GetBlenderArrowPosition(void); void ShowBerryBlenderRecordWindow(void); diff --git a/include/bg.h b/include/bg.h index f2d4e7948..a10abaa8d 100644 --- a/include/bg.h +++ b/include/bg.h @@ -70,14 +70,14 @@ void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset); void CopyBgTilemapBufferToVram(u8 bg); void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height); void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette); -void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2); +void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 unused, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, s16 palette1, s16 tileOffset); void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height); void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette); void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta); u16 GetBgMetricTextMode(u8 bg, u8 whichMetric); u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric); u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight); -void CopyTileMapEntry(u16 *src, u16 *dest, s32 palette1, u32 tileOffset, u32 palette2); +void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2); u32 GetBgType(u8 bg); bool32 IsInvalidBg32(u8 bg); bool32 IsTileMapOutsideWram(u8 bg); diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 78c1583b4..1a4741574 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -74,7 +74,10 @@ #define STAT_SPEED 3 #define STAT_SPATK 4 #define STAT_SPDEF 5 -#define STAT_ACC 6 // only in battles -#define STAT_EVASION 7 // only in battles +#define STAT_ACC 6 // Only in battles. +#define STAT_EVASION 7 // Only in battles. + +#define NUM_STATS 6 +#define NUM_BATTLE_STATS 8 #endif // GUARD_CONSTANTS_POKEMON_H diff --git a/include/contest.h b/include/contest.h index d62d33ab7..8790d7371 100644 --- a/include/contest.h +++ b/include/contest.h @@ -226,6 +226,11 @@ extern u8 gUnknown_02039F24; extern u16 gSpecialVar_ContestCategory; extern u16 gSpecialVar_ContestRank; extern u8 gUnknown_02039F30; +extern u8 gContestFinalStandings[4]; +extern u8 gContestPlayerMonIndex; +extern s16 gUnknown_02039F08[4]; +extern s16 gContestMonConditions[4]; +extern u8 gIsLinkContest; struct Shared18000 { @@ -239,7 +244,7 @@ struct Shared18000 struct ContestStruct_field_18 { - u16 unk0; + u16 species; u16 unk2; u8 unk4_0:1; u8 unk5; @@ -427,5 +432,6 @@ bool8 Contest_IsMonsTurnDisabled(u8 a); bool8 sub_80DE1E8(u8 a); void SetStartledString(u8 a, u8 b); s8 Contest_GetMoveExcitement(u16); +void sub_80DEDA8(u8); #endif //GUARD_CONTEST_H diff --git a/include/contest_link_80F57C4.h b/include/contest_link_80F57C4.h index 3c12e5e53..b4ccf2803 100644 --- a/include/contest_link_80F57C4.h +++ b/include/contest_link_80F57C4.h @@ -1,7 +1,10 @@ #ifndef GUARD_CONTEST_LINK_80F57C4_H #define GUARD_CONTEST_LINK_80F57C4_H +void sub_80F8264(void); +void sub_80F8290(void); void sub_80F840C(void); +void sub_80F8438(void); void sub_80F8484(void); void sub_80F84C4(u8); void sub_80FC998(u8 taskId); diff --git a/include/contest_painting.h b/include/contest_painting.h index f8366a997..67a845d62 100644 --- a/include/contest_painting.h +++ b/include/contest_painting.h @@ -2,5 +2,6 @@ #define GUARD_CONTESTPAINTING_H void sub_812FDA8(u32); +void sub_812FDEC(void); #endif diff --git a/include/decoration_inventory.h b/include/decoration_inventory.h index e1fec36ea..7539f7240 100644 --- a/include/decoration_inventory.h +++ b/include/decoration_inventory.h @@ -1,12 +1,15 @@ #ifndef GUARD_DECORATION_INVENTORY_H #define GUARD_DECORATION_INVENTORY_H -struct DecorationInventory { + +struct DecorationInventory +{ u8 *items; u8 size; }; extern struct DecorationInventory gDecorationInventories[]; +void SetDecorationInventoriesPointers(void); void ClearDecorationInventories(void); s8 GetFirstEmptyDecorSlot(u8 idx); u8 CheckHasDecoration(u8); diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 03faa1a87..c20b69886 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -565,12 +565,14 @@ #define WINOUT_WIN01_BG1 (1 << 1) #define WINOUT_WIN01_BG2 (1 << 2) #define WINOUT_WIN01_BG3 (1 << 3) +#define WINOUT_WIN01_BG_ALL (WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3) #define WINOUT_WIN01_OBJ (1 << 4) #define WINOUT_WIN01_CLR (1 << 5) #define WINOUT_WINOBJ_BG0 (1 << 8) #define WINOUT_WINOBJ_BG1 (1 << 9) #define WINOUT_WINOBJ_BG2 (1 << 10) #define WINOUT_WINOBJ_BG3 (1 << 11) +#define WINOUT_WINOBJ_BG_ALL (WINOUT_WINOBJ_BG0 | WINOUT_WINOBJ_BG1 | WINOUT_WINOBJ_BG2 | WINOUT_WINOBJ_BG3) #define WINOUT_WINOBJ_OBJ (1 << 12) #define WINOUT_WINOBJ_CLR (1 << 13) diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index f6273e80d..1f14880f0 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -192,8 +192,8 @@ struct EventObject struct __attribute__((packed)) { u8 x:4; u8 y:4; - } __attribute__((aligned (1))) as_nybbles; - } __attribute__((aligned (1))) range; + } ALIGNED(1) as_nybbles; + } ALIGNED(1) range; /*0x1A*/ u8 fieldEffectSpriteId; /*0x1B*/ u8 warpArrowSpriteId; /*0x1C*/ u8 movementActionId; diff --git a/include/global.h b/include/global.h index 5a86d5daa..cc8df049f 100644 --- a/include/global.h +++ b/include/global.h @@ -61,11 +61,6 @@ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) -extern u8 gStringVar1[]; -extern u8 gStringVar2[]; -extern u8 gStringVar3[]; -extern u8 gStringVar4[]; - // There are many quirks in the source code which have overarching behavioral differences from // a number of other files. For example, diploma.c seems to declare rodata before each use while // other files declare out of order and must be at the beginning. There are also a number of @@ -135,6 +130,7 @@ enum LanguageId #define BAG_POKEBALLS_COUNT 16 #define BAG_TMHM_COUNT 64 #define BAG_BERRIES_COUNT 46 +#define EVENT_OBJECT_TEMPLATES_COUNT 64 #define PYRAMID_BAG_ITEMS_COUNT 10 #define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode. @@ -442,12 +438,14 @@ struct BattleFrontier /*0xE10*/ u8 field_E10_1:3; /*0xE10*/ u8 field_E10_2:4; /*0xE10*/ u8 field_E10_3:1; - /*0xE12*/ u16 field_E12[4]; + /*0xE12*/ u16 field_E12[3]; + /*0xE18*/ u16 field_E18; /*0xE1A*/ u16 pyramidWinStreaks[2]; /*0xE1E*/ u16 pyramidRecordStreaks[2]; - /*0xE1E*/ u16 field_E1F[5]; + /*0xE22*/ u16 field_E22[4]; + /*0xE2A*/ u8 field_E2A; /*0xE2C*/ struct PyramidBag pyramidBag; - /*0xE58*/ u16 field_E58; + /*0xE68*/ u8 field_E68; /*0xE6A*/ u16 field_E6A; /*0xE6C*/ u16 field_E6C; /*0xE6E*/ u16 field_E6E; @@ -905,7 +903,7 @@ struct SaveBlock1 /*0x9C8*/ u16 trainerRematchStepCounter; /*0x9CA*/ u8 trainerRematches[100]; /*0xA30*/ struct EventObject eventObjects[EVENT_OBJECTS_COUNT]; - /*0xC70*/ struct EventObjectTemplate eventObjectTemplates[64]; + /*0xC70*/ struct EventObjectTemplate eventObjectTemplates[EVENT_OBJECT_TEMPLATES_COUNT]; /*0x1270*/ u8 flags[FLAGS_COUNT]; /*0x139C*/ u16 vars[VARS_COUNT]; /*0x159C*/ u32 gameStats[NUM_GAME_STATS]; diff --git a/include/graphics.h b/include/graphics.h index a2c86a67d..0620ea551 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -1237,7 +1237,7 @@ extern const u32 gMonBackPic_Pichu[]; extern const u32 gMonShinyPalette_Pichu[]; extern const u32 gMonStillFrontPic_Pichu[]; extern const u8 gMonIcon_Pichu[]; -extern const u32 gMonFootprint_Pichu[]; +extern const u8 gMonFootprint_Pichu[]; extern const u32 gMonFrontPic_Cleffa[]; extern const u32 gMonPalette_Cleffa[]; extern const u32 gMonBackPic_Cleffa[]; @@ -2860,6 +2860,7 @@ extern const u32 gMonPalette_CircledQuestionMark[]; extern const u32 gMonShinyPalette_CircledQuestionMark[]; extern const u32 gMonStillFrontPic_CircledQuestionMark[]; extern const u8 gMonIcon_QuestionMark[]; +extern const u8 gMonFootprint_QuestionMark[]; extern const u32 gMonFrontPic_DoubleQuestionMark[]; extern const u32 gMonBackPic_DoubleQuestionMark[]; extern const u32 gMonPalette_DoubleQuestionMark[]; @@ -4697,6 +4698,20 @@ extern const u32 gBattleAnimBackgroundTilemap_17[]; extern const u32 gBattleAnimBackgroundTilemap_20[]; extern const u32 gBattleAnimBackgroundTilemap_21[]; +extern const u32 gUnknown_08C20668[]; +extern const u32 gUnknown_08C20684[]; +extern const u32 gBattleStatMask_Gfx[]; +extern const u32 gBattleStatMask1_Tilemap[]; +extern const u32 gBattleStatMask2_Tilemap[]; +extern const u32 gBattleStatMask1_Pal[]; +extern const u32 gBattleStatMask2_Pal[]; +extern const u32 gBattleStatMask3_Pal[]; +extern const u32 gBattleStatMask4_Pal[]; +extern const u32 gBattleStatMask5_Pal[]; +extern const u32 gBattleStatMask6_Pal[]; +extern const u32 gBattleStatMask7_Pal[]; +extern const u32 gBattleStatMask8_Pal[]; + extern const u32 gUnknown_08D9A88C[]; extern const u32 gContestMiscGfx[]; extern const u32 gContestAudienceGfx[]; @@ -4718,4 +4733,7 @@ extern const u32 gUnknown_08D927EC[]; extern const u32 gSlotMachineReelTime_Gfx[]; +extern const u32 gUnknown_08D8D410[]; +extern const u32 gUnknown_08D8D58C[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/international_string_util.h b/include/international_string_util.h index 426a2d48c..343c5453c 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -16,7 +16,7 @@ s32 sub_81DB3D8(const struct MenuAction *str, const u8* arg1, s32 arg2); // sub_81DB494 void PadNameString(u8 *dst, u8 padWith); void sub_81DB554(u8 *, u8); -// sub_81DB5AC +void sub_81DB5AC(u8 *); u32 sub_81DB604(const u8 *); // sub_81DB620 diff --git a/include/load_save.h b/include/load_save.h index b8b27ade5..c64a1179b 100644 --- a/include/load_save.h +++ b/include/load_save.h @@ -30,6 +30,5 @@ void LoadPlayerBag(void); void SavePlayerBag(void); void ApplyNewEncryptionKeyToHword(u16 *hWord, u32 newKey); void ApplyNewEncryptionKeyToWord(u32 *word, u32 newKey); -void ApplyNewEncryptionKeyToAllEncryptedData(u32 encryptionKey); #endif // GUARD_LOAD_SAVE_H diff --git a/include/mossdeep_gym.h b/include/mossdeep_gym.h new file mode 100644 index 000000000..c16730094 --- /dev/null +++ b/include/mossdeep_gym.h @@ -0,0 +1,9 @@ +#ifndef GUARD_MOSSDEEP_GYM_H +#define GUARD_MOSSDEEP_GYM_H + +void InitMossdeepGymTiles(bool8 arg0); +void FinishMossdeepGymTiles(void); +u16 MossdeepGym_MoveEvents(u8 arg0); +void MossdeepGym_TurnEvents(void); + +#endif // GUARD_MOSSDEEP_GYM_H diff --git a/include/new_game.h b/include/new_game.h index 7032647ea..f4d69cbce 100644 --- a/include/new_game.h +++ b/include/new_game.h @@ -1,6 +1,9 @@ #ifndef GUARD_NEW_GAME_H #define GUARD_NEW_GAME_H +extern bool8 gDifferentSaveFile; +extern bool8 gUnknown_020322D5; // The purpose of this variable is unknown as it's read only 3 times(2 times in contest.c and 1 time in berry_blender.c), never written to. + void SetTrainerId(u32 trainerId, u8 *dst); u32 GetTrainerId(u8 *trainerId); void CopyTrainerId(u8 *dst, u8 *src); diff --git a/include/overworld.h b/include/overworld.h index 6b38a8782..6f7801905 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -22,9 +22,9 @@ extern struct LinkPlayerEventObject gLinkPlayerEventObjects[4]; extern u16 *gBGTilemapBuffers1; extern u16 *gBGTilemapBuffers2; extern u16 *gBGTilemapBuffers3; - +extern u16 gUnknown_03005DA8; extern void (*gFieldCallback)(void); - +extern bool8 (*gFieldCallback2)(void); extern u8 gUnknown_03005DB4; extern u8 gFieldLinkPlayerCount; @@ -73,7 +73,7 @@ void SetFixedHoleWarpAsDestination(s16 x, s16 y); void warp1_set_to_sav1w(void); void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void sub_8084F6C(u8 a1); -void sub_8084FAC(void); +void sub_8084FAC(int unused); const struct MapConnection *GetMapConnection(u8 dir); static bool8 SetDiveWarp(u8 dir, u16 x, u16 y); bool8 SetDiveWarpEmerge(u16 x, u16 y); diff --git a/include/pokedex.h b/include/pokedex.h index f9e236588..11e39997c 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -1,6 +1,9 @@ #ifndef GUARD_POKEDEX_H #define GUARD_POKEDEX_H +extern u8 gUnknown_030060B0; +extern void (*gUnknown_030060B4)(void); + void ResetPokedex(void); void CopyMonCategoryText(u32 species, u8 *dst); u16 GetPokedexHeightWeight(u16 dexNum, u8 data); diff --git a/include/pokemon.h b/include/pokemon.h index 7cf043ba3..5d7f7f2ae 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -112,25 +112,6 @@ #define MON_FEMALE 0xFE #define MON_GENDERLESS 0xFF -#define TYPE_NORMAL 0x00 -#define TYPE_FIGHTING 0x01 -#define TYPE_FLYING 0x02 -#define TYPE_POISON 0x03 -#define TYPE_GROUND 0x04 -#define TYPE_ROCK 0x05 -#define TYPE_BUG 0x06 -#define TYPE_GHOST 0x07 -#define TYPE_STEEL 0x08 -#define TYPE_MYSTERY 0x09 -#define TYPE_FIRE 0x0a -#define TYPE_WATER 0x0b -#define TYPE_GRASS 0x0c -#define TYPE_ELECTRIC 0x0d -#define TYPE_PSYCHIC 0x0e -#define TYPE_ICE 0x0f -#define TYPE_DRAGON 0x10 -#define TYPE_DARK 0x11 - #define FRIENDSHIP_EVENT_GROW_LEVEL 0x0 #define FRIENDSHIP_EVENT_VITAMIN 0x1 // unused #define FRIENDSHIP_EVENT_BATTLE_ITEM 0x2 // unused @@ -151,7 +132,6 @@ #define STATUS_PRIMARY_FAINTED 0x7 #define MAX_TOTAL_EVS 510 -#define NUM_STATS 6 #define UNOWN_FORM_COUNT 28 struct PokemonSubstruct0 @@ -293,8 +273,6 @@ struct Unknown_806F160_Struct struct SpriteFrameImage *frameImages; }; -#define BATTLE_STATS_NO 8 - struct BattlePokemon { /*0x00*/ u16 species; @@ -312,7 +290,7 @@ struct BattlePokemon /*0x17*/ u32 spDefenseIV:5; /*0x17*/ u32 isEgg:1; /*0x17*/ u32 altAbility:1; - /*0x18*/ s8 statStages[BATTLE_STATS_NO]; + /*0x18*/ s8 statStages[NUM_BATTLE_STATS]; /*0x20*/ u8 ability; /*0x21*/ u8 type1; /*0x22*/ u8 type2; @@ -468,7 +446,6 @@ extern const u8 gUnknown_08329D2A[]; extern const u8 gStatStageRatios[][2]; extern const u16 gUnknown_08329D54[]; extern const struct SpriteTemplate gUnknown_08329D98[]; -extern const struct CompressedSpritePalette gMonPaletteTable[]; extern const s8 gNatureStatTable[][5]; void ZeroBoxMonData(struct BoxPokemon *boxMon); diff --git a/include/save.h b/include/save.h index a5f014904..b151f1064 100644 --- a/include/save.h +++ b/include/save.h @@ -54,7 +54,12 @@ enum SAVE_HALL_OF_FAME_ERASE_BEFORE // unused }; -#define SECTION_ID_RECORDED_BATTLE 31 +#define SECTOR_SAVE_SLOT_LENGTH 14 +#define SECTOR_ID_HOF_1 28 +#define SECTOR_ID_HOF_2 29 +#define SECTOR_ID_TRAINER_HILL 30 +#define SECTOR_ID_RECORDED_BATTLE 31 +#define SECTORS_COUNT 32 extern u16 gLastWrittenSector; extern u32 gLastSaveCounter; @@ -72,26 +77,6 @@ extern struct SaveSection gSaveDataBuffer; void ClearSaveData(void); void Save_ResetSaveCounters(void); -bool32 SetDamagedSectorBits(u8 op, u8 bit); -u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location); -u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location); -u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size); -u8 TryWriteSector(u8 sector, u8 *data); -u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location); -u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location); -u8 sub_81529D4(u16 a1, const struct SaveSectionLocation *location); -u8 sub_8152A34(u16 a1, const struct SaveSectionLocation *location); -u8 ClearSaveData_2(u16 a1, const struct SaveSectionLocation *location); -u8 sav12_xor_get(u16 a1, const struct SaveSectionLocation *location); -u8 sub_8152CAC(u16 a1, const struct SaveSectionLocation *location); -u8 sub_8152D44(u16 a1, const struct SaveSectionLocation *location); -u8 sub_8152DD0(u16 a1, const struct SaveSectionLocation *location); -u8 sub_8152E10(u16 a1, const struct SaveSectionLocation *location); -u8 GetSaveValidStatus(const struct SaveSectionLocation *location); -u8 sub_81530DC(u8 a1, u8 *data, u16 size); -u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section); -u16 CalculateChecksum(void *data, u16 size); -void UpdateSaveAddresses(void); u8 HandleSavingData(u8 saveType); u8 TrySavingData(u8 saveType); bool8 sub_8153380(void); diff --git a/include/save_location.h b/include/save_location.h index 95b3a7d7d..71dbd3fd8 100644 --- a/include/save_location.h +++ b/include/save_location.h @@ -1,7 +1,6 @@ #ifndef GUARD_SAVE_LOCATION_H #define GUARD_SAVE_LOCATION_H -bool32 sub_81AFCEC(void); void TrySetMapSaveWarpStatus(void); void sub_81AFDA0(void); void sub_81AFDD0(void); diff --git a/include/script_pokemon_util_80F87D8.h b/include/script_pokemon_util_80F87D8.h index 7c2a1ff66..02a35ecba 100644 --- a/include/script_pokemon_util_80F87D8.h +++ b/include/script_pokemon_util_80F87D8.h @@ -1,9 +1,8 @@ - #ifndef GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H #define GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H u16 sub_80F903C(void); -void ReducePlayerPartyToThree(void); +void ReducePlayerPartyToSelectedMons(void); void HealPlayerParty(void); #endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H diff --git a/include/start_menu.h b/include/start_menu.h index 5551b149d..2fdb3e652 100644 --- a/include/start_menu.h +++ b/include/start_menu.h @@ -1,7 +1,7 @@ #ifndef GUARD_START_MENU_H #define GUARD_START_MENU_H -extern bool8 (*gMenuCallback)(void); // Defined in sym_common.txt +extern bool8 (*gMenuCallback)(void); void sub_809FA18(void); void sub_809FA34(u8 taskId); diff --git a/include/string_util.h b/include/string_util.h index 7b685fcea..67149bca0 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -1,6 +1,11 @@ #ifndef GUARD_STRING_UTIL_H #define GUARD_STRING_UTIL_H +extern u8 gStringVar1[]; +extern u8 gStringVar2[]; +extern u8 gStringVar3[]; +extern u8 gStringVar4[]; + enum StringConvertMode { STR_CONV_MODE_LEFT_ALIGN, diff --git a/include/strings.h b/include/strings.h index 3746e459a..495cb3a9b 100644 --- a/include/strings.h +++ b/include/strings.h @@ -989,6 +989,56 @@ extern const u8 gUnknown_0827EE03[]; extern const u8 gUnknown_0827EE05[]; extern const u8 gUnknown_0827EE07[]; extern const u8 gUnknown_0827EE09[]; + +// Pokedex strings +extern const u8 gUnknown_085E87A5[]; +extern const u8 gUnknown_085E87D6[]; +extern const u8 gUnknown_085E87EF[]; +extern const u8 gUnknown_085E8806[]; +extern const u8 gUnknown_085E881F[]; +extern const u8 gUnknown_085E8840[]; +extern const u8 gUnknown_085E887C[]; +extern const u8 gUnknown_085E88A6[]; +extern const u8 gUnknown_085E88C8[]; +extern const u8 gUnknown_085E88DF[]; +extern const u8 gUnknown_085E88E9[]; +extern const u8 gUnknown_085E88F6[]; +extern const u8 gUnknown_085E8905[]; +extern const u8 gUnknown_085E8911[]; +extern const u8 gUnknown_085E891F[]; +extern const u8 gUnknown_085E892D[]; +extern const u8 gUnknown_085E893A[]; +extern const u8 gUnknown_085E8948[]; +extern const u8 gUnknown_085E894C[]; +extern const u8 gUnknown_085E8950[]; +extern const u8 gUnknown_085E8954[]; +extern const u8 gUnknown_085E8958[]; +extern const u8 gUnknown_085E895C[]; +extern const u8 gUnknown_085E8960[]; +extern const u8 gUnknown_085E8964[]; +extern const u8 gUnknown_085E8968[]; +extern const u8 gUnknown_085E896B[]; +extern const u8 gUnknown_085E896F[]; +extern const u8 gUnknown_085E8974[]; +extern const u8 gUnknown_085E897B[]; +extern const u8 gUnknown_085E8981[]; +extern const u8 gUnknown_085E8987[]; +extern const u8 gUnknown_085E898D[]; +extern const u8 gUnknown_085E8994[]; +extern const u8 gUnknown_085E8999[]; +extern const u8 gUnknown_085E899F[]; +extern const u8 gUnknown_085E89A4[]; +extern const u8 gUnknown_085E89BB[]; +extern const u8 gUnknown_085E89D4[]; +extern const u8 gUnknown_085E8A02[]; +extern const u8 gUnknown_085E8A37[]; +extern const u8 gUnknown_085E8A73[]; +extern const u8 gUnknown_085E8AAF[]; +extern const u8 gUnknown_085E8AEA[]; +extern const u8 gUnknown_085E8B25[]; +extern const u8 gUnknown_085E8B26[]; +extern const u8 gUnknown_085E8B35[]; + extern const u8 gUnknown_085EAEC3[]; extern const u8 gUnknown_085EAED6[]; extern const u8 gUnknown_085EAEE6[]; diff --git a/include/text.h b/include/text.h index 4946f1c5f..27a6364bb 100644 --- a/include/text.h +++ b/include/text.h @@ -109,7 +109,8 @@ #define TEXT_SPEED_FF 0xFF -enum { +enum +{ FONTATTR_MAX_LETTER_WIDTH, FONTATTR_MAX_LETTER_HEIGHT, FONTATTR_LETTER_SPACING, @@ -205,21 +206,16 @@ typedef struct { struct Struct_03002F90 { - u8 unk0[0x20]; - u8 unk20[0x20]; - u8 unk40[0x20]; - u8 unk60[0x20]; + u32 unk0[8]; + u32 unk20[8]; + u32 unk40[8]; + u32 unk60[8]; u8 unk80; u8 unk81; }; extern TextFlags gTextFlags; -extern u8 gStringVar1[]; -extern u8 gStringVar2[]; -extern u8 gStringVar3[]; -extern u8 gStringVar4[]; - extern u8 gUnknown_03002F84; extern struct Struct_03002F90 gUnknown_03002F90; @@ -233,7 +229,7 @@ u32 RenderFont(struct TextPrinter *textPrinter); void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); -void DecompressGlyphTile(const u16 *src, u16 *dest); +void DecompressGlyphTile(const void *src_, void *dest_); u8 GetLastTextColor(u8 colorType); void CopyGlyphToWindow(struct TextPrinter *x); void ClearTextSpan(struct TextPrinter *textPrinter, u32 width); |