diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/battle.h | 104 | ||||
-rwxr-xr-x | include/battle_ai_switch_items.h | 6 | ||||
-rw-r--r-- | include/choose_party.h | 3 | ||||
-rw-r--r-- | include/constants/battle_constants.h | 73 | ||||
-rw-r--r-- | include/debug.h | 3 | ||||
-rw-r--r-- | include/decoration_inventory.h | 5 | ||||
-rw-r--r-- | include/ewram.h | 38 | ||||
-rw-r--r-- | include/field_fadetransition.h | 2 | ||||
-rw-r--r-- | include/global.h | 6 | ||||
-rw-r--r-- | include/macros/battle_script.inc | 2 | ||||
-rw-r--r-- | include/menu.h | 4 | ||||
-rw-r--r-- | include/menu_helpers.h | 3 | ||||
-rw-r--r-- | include/overworld.h | 2 | ||||
-rw-r--r-- | include/pokeblock.h | 2 | ||||
-rw-r--r-- | include/pokemon.h | 9 | ||||
-rw-r--r-- | include/roamer.h | 7 | ||||
-rw-r--r-- | include/rom_8077ABC.h | 26 | ||||
-rw-r--r-- | include/secret_base.h | 4 | ||||
-rw-r--r-- | include/strings.h | 2 | ||||
-rw-r--r-- | include/wild_encounter.h | 5 |
20 files changed, 194 insertions, 112 deletions
diff --git a/include/battle.h b/include/battle.h index 6a5a97e90..af0b48013 100644 --- a/include/battle.h +++ b/include/battle.h @@ -4,29 +4,43 @@ #include "sprite.h" #include "constants/battle_constants.h" -/* - Banks are a name given to what could be called a 'battlerId' or 'monControllerId'. - Each bank has a value consisting of two bits. - 0x1 bit is responsible for the side, 0 = player's side, 1 = opponent's side. - 0x2 bit is responsible for the id of sent out pokemon. 0 means it's the first sent out pokemon, 1 it's the second one. (Triple battle didn't exist at the time yet.) -*/ - -#define BATTLE_BANKS_COUNT 4 - -#define IDENTITY_PLAYER_MON1 0 -#define IDENTITY_OPPONENT_MON1 1 -#define IDENTITY_PLAYER_MON2 2 -#define IDENTITY_OPPONENT_MON2 3 - -#define SIDE_PLAYER 0x0 -#define SIDE_OPPONENT 0x1 - -#define BIT_SIDE 0x1 -#define BIT_MON 0x2 - -#define GET_BANK_IDENTITY(bank)((gBanksByIdentity[bank])) -#define GET_BANK_SIDE(bank)((GetBankIdentity(bank) & BIT_SIDE)) -#define GET_BANK_SIDE2(bank)((GET_BANK_IDENTITY(bank) & BIT_SIDE)) +#define GET_BATTLER_POSITION(bank)((gBattlerPositions[bank])) +#define GET_BATTLER_SIDE(bank)((GetBattlerPosition(bank) & BIT_SIDE)) +#define GET_BATTLER_SIDE2(bank)((GET_BATTLER_POSITION(bank) & BIT_SIDE)) + +// Battle Actions +// These determine what each battler will do in a turn +#define B_ACTION_USE_MOVE 0 +#define B_ACTION_USE_ITEM 1 +#define B_ACTION_SWITCH 2 +#define B_ACTION_RUN 3 +#define B_ACTION_SAFARI_WATCH_CAREFULLY 4 +#define B_ACTION_SAFARI_BALL 5 +#define B_ACTION_SAFARI_POKEBLOCK 6 +#define B_ACTION_SAFARI_GO_NEAR 7 +#define B_ACTION_SAFARI_RUN 8 +// The exact purposes of these are unclear +#define B_ACTION_UNKNOWN9 9 +#define B_ACTION_EXEC_SCRIPT 10 // when executing an action +#define B_ACTION_CANCEL_PARTNER 12 // when choosing an action +#define B_ACTION_FINISHED 12 // when executing an action +#define B_ACTION_NOTHING_FAINTED 13 // when choosing an action +#define B_ACTION_NONE 0xFF + +// defines for the u8 array gTypeEffectiveness +#define TYPE_EFFECT_ATK_TYPE(i)((gTypeEffectiveness[i + 0])) +#define TYPE_EFFECT_DEF_TYPE(i)((gTypeEffectiveness[i + 1])) +#define TYPE_EFFECT_MULTIPLIER(i)((gTypeEffectiveness[i + 2])) + +// defines for the gTypeEffectiveness multipliers +#define TYPE_MUL_NO_EFFECT 0 +#define TYPE_MUL_NOT_EFFECTIVE 5 +#define TYPE_MUL_NORMAL 10 +#define TYPE_MUL_SUPER_EFFECTIVE 20 + +// special type table Ids +#define TYPE_FORESIGHT 0xFE +#define TYPE_ENDTABLE 0xFF enum { @@ -56,13 +70,13 @@ struct Trainer /*0x24*/ const void *party; }; -struct UnkBattleStruct1 // AI_Opponent_Info? +struct BattleHistory { - /*0x00*/ u16 movesUsed[2][8]; // 0xFFFF means move not used (confuse self hit, etc) - /*0x20*/ u8 unk20[2]; - /*0x22*/ u8 unk22[2]; - /*0x24*/ u16 items[4]; - /*0x2C*/ u8 numOfItems; + /*0x00*/ u16 usedMoves[2][8]; // 0xFFFF means move not used (confuse self hit, etc) + /*0x20*/ u8 abilities[MAX_BATTLERS_COUNT / 2]; + /*0x22*/ u8 itemEffects[MAX_BATTLERS_COUNT / 2]; + /*0x24*/ u16 trainerItems[MAX_BATTLERS_COUNT]; + /*0x2C*/ u8 numItems; }; struct AI_Stack @@ -179,7 +193,7 @@ struct BattleStruct /* 0x2000000 */ /*0x1605F*/ u8 sentInPokes; /*0x16060*/ u8 unk16060[4]; /*0x16064*/ u8 unk16064[4]; - /*0x16068*/ u8 unk16068[4]; + /*0x16068*/ u8 monToSwitchIntoId[MAX_BATTLERS_COUNT]; /*0x1606C*/ u8 unk1606C[4][3]; /*0x16078*/ u8 unk16078; /*0x16079*/ u8 caughtNick[11]; @@ -242,8 +256,7 @@ struct BattleStruct /* 0x2000000 */ /*0x160C5*/ u8 unk160C5; /*0x160C6*/ u8 unk160C6; /*0x160C7*/ u8 unk160C7; - /*0x160C8*/ u8 unk160C8; - /*0x160C9*/ u8 unk160C9; + /*0x160C8*/ u8 AI_monToSwitchIntoId[2]; /*0x160CA*/ u8 synchroniseEffect; /*0x160CB*/ u8 linkPlayerIndex; /*0x160CC*/ u16 usedHeldItems[4]; @@ -323,7 +336,7 @@ struct BattleStruct /* 0x2000000 */ /*0x1611F*/ u8 unk1611F; //u8 filler2[0x72E]; - /* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2; + /* 0x16A00 */ struct BattleHistory unk_2016A00_2; }; struct StatsArray @@ -352,8 +365,8 @@ struct DisableStruct /*0x0D*/ u8 unkD; /*0x0E*/ u8 encoreTimer1 : 4; /*0x0E*/ u8 encoreTimer2 : 4; - /*0x0F*/ u8 perishSong1 : 4; - /*0x0F*/ u8 perishSong2 : 4; + /*0x0F*/ u8 perishSongTimer1 : 4; + /*0x0F*/ u8 perishSongTimer2 : 4; /*0x10*/ u8 furyCutterCounter; /*0x11*/ u8 rolloutTimer1 : 4; /*0x11*/ u8 rolloutTimer2 : 4; @@ -520,21 +533,21 @@ struct sideTimer struct WishFutureKnock { - u8 futureSightCounter[MAX_BANKS_BATTLE]; - u8 futureSightAttacker[MAX_BANKS_BATTLE]; - s32 futureSightDmg[MAX_BANKS_BATTLE]; - u16 futureSightMove[MAX_BANKS_BATTLE]; - u8 wishCounter[MAX_BANKS_BATTLE]; - u8 wishUserID[MAX_BANKS_BATTLE]; + u8 futureSightCounter[MAX_BATTLERS_COUNT]; + u8 futureSightAttacker[MAX_BATTLERS_COUNT]; + s32 futureSightDmg[MAX_BATTLERS_COUNT]; + u16 futureSightMove[MAX_BATTLERS_COUNT]; + u8 wishCounter[MAX_BATTLERS_COUNT]; + u8 wishUserID[MAX_BATTLERS_COUNT]; u8 weatherDuration; u8 knockedOffPokes[2]; }; -extern struct UnkBattleStruct1 unk_2016A00; -extern struct DisableStruct gDisableStructs[MAX_BANKS_BATTLE]; +extern struct BattleHistory unk_2016A00; +extern struct DisableStruct gDisableStructs[MAX_BATTLERS_COUNT]; extern struct BattleResults gBattleResults; -extern struct ProtectStruct gProtectStructs[MAX_BANKS_BATTLE]; -extern struct SpecialStatus gSpecialStatuses[MAX_BANKS_BATTLE]; +extern struct ProtectStruct gProtectStructs[MAX_BATTLERS_COUNT]; +extern struct SpecialStatus gSpecialStatuses[MAX_BATTLERS_COUNT]; extern struct sideTimer gSideTimers[2]; extern struct WishFutureKnock gWishFutureKnock; extern struct AI_ThinkingStruct gAIThinkingSpace; @@ -803,7 +816,6 @@ void sub_8032AA8(u8, u8); void SetBankFuncToOpponentBufferRunCommand(void); void BattleStopLowHpSound(void); -// asm/battle_9.o void SetBankFuncToLinkOpponentBufferRunCommand(void); #endif // GUARD_BATTLE_H diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h new file mode 100755 index 000000000..648cfad74 --- /dev/null +++ b/include/battle_ai_switch_items.h @@ -0,0 +1,6 @@ +#ifndef GUARD_BATTLE_AI_SWITCH_ITEMS_H +#define GUARD_BATTLE_AI_SWITCH_ITEMS_H + +u8 GetMostSuitableMonToSwitchInto(void); + +#endif diff --git a/include/choose_party.h b/include/choose_party.h index 853202a89..9aacef27d 100644 --- a/include/choose_party.h +++ b/include/choose_party.h @@ -9,5 +9,8 @@ bool8 SetupLinkMultiBattlePartyMenu(void); void HandleLinkMultiBattlePartyMenu(u8 taskId); void HandleDaycarePartyMenu(u8 taskId); void sub_8123138(u8 taskId); +#if DEBUG +void Debug_CopyLastThreePartyMonsToMultiPartnerParty(void); +#endif #endif // GUARD_CHOOSE_PARTY_H diff --git a/include/constants/battle_constants.h b/include/constants/battle_constants.h index 49768f33e..65f44d8aa 100644 --- a/include/constants/battle_constants.h +++ b/include/constants/battle_constants.h @@ -1,12 +1,47 @@ #ifndef GUARD_CONSTANTS_BATTLE_CONSTANTS_H #define GUARD_CONSTANTS_BATTLE_CONSTANTS_H -// Bank sides -#define SIDE_PLAYER 0x0 -#define SIDE_OPPONENT 0x1 - -#define BIT_SIDE 0x1 -#define BIT_MON 0x2 +/* + * A battler may be in one of four positions on the field. The first bit determines + * what side the battler is on, either the player's side or the opponent's side. + * The second bit determines what flank the battler is on, either the left or right. + * Note that the opponent's flanks are drawn corresponding to their perspective, so + * their right mon appears on the left, and their left mon appears on the right. + * The battler ID is usually the same as the position, except in the case of link battles. + * + * + ------------------------- + + * | Opponent's side | + * | Right Left | + * | 3 1 | + * | | + * | Player's side | + * | Left Right | + * | 0 2 | + * ----------------------------+ + * | | + * | | + * +---------------------------+ + */ + +#define MAX_BATTLERS_COUNT 4 + +#define B_POSITION_PLAYER_LEFT 0 +#define B_POSITION_OPPONENT_LEFT 1 +#define B_POSITION_PLAYER_RIGHT 2 +#define B_POSITION_OPPONENT_RIGHT 3 + +// These macros can be used with either battler ID or positions to get the partner or the opposite mon +#define BATTLE_OPPOSITE(id) ((id) ^ 1) +#define BATTLE_PARTNER(id) ((id) ^ 2) + +#define B_SIDE_PLAYER 0 +#define B_SIDE_OPPONENT 1 + +#define B_FLANK_LEFT 0 +#define B_FLANK_RIGHT 1 + +#define BIT_SIDE 1 +#define BIT_FLANK 2 #define STATUS_SLEEP 0x7 #define STATUS_POISON 0x8 @@ -88,19 +123,16 @@ #define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C)) #define HITMARKER_UNK(bank) ((0x10000000 << bank)) -#define MOVESTATUS_MISSED (1 << 0) -#define MOVESTATUS_SUPEREFFECTIVE (1 << 1) -#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2) -#define MOVESTATUS_NOTAFFECTED (1 << 3) -#define MOVESTATUS_ONEHITKO (1 << 4) -#define MOVESTATUS_FAILED (1 << 5) -#define MOVESTATUS_ENDURED (1 << 6) -#define MOVESTATUS_HUNGON (1 << 7) - -#define IDENTITY_PLAYER_MON1 0 -#define IDENTITY_OPPONENT_MON1 1 -#define IDENTITY_PLAYER_MON2 2 -#define IDENTITY_OPPONENT_MON2 3 +// Flags describing move's result +#define MOVE_RESULT_MISSED (1 << 0) +#define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1) +#define MOVE_RESULT_NOT_VERY_EFFECTIVE (1 << 2) +#define MOVE_RESULT_DOESNT_AFFECT_FOE (1 << 3) +#define MOVE_RESULT_ONE_HIT_KO (1 << 4) +#define MOVE_RESULT_FAILED (1 << 5) +#define MOVE_RESULT_FOE_ENDURED (1 << 6) +#define MOVE_RESULT_FOE_HUNG_ON (1 << 7) +#define MOVE_RESULT_NO_EFFECT (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED) #define BATTLE_TYPE_DOUBLE 0x0001 #define BATTLE_TYPE_LINK 0x0002 @@ -206,11 +238,8 @@ #define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0))) -#define MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED)) - #define MAX_TRAINER_ITEMS 4 #define MAX_MON_MOVES 4 -#define MAX_BANKS_BATTLE 4 #define WEATHER_RAIN_TEMPORARY (1 << 0) #define WEATHER_RAIN_DOWNPOUR (1 << 1) diff --git a/include/debug.h b/include/debug.h index 2136dbfb8..469560b9e 100644 --- a/include/debug.h +++ b/include/debug.h @@ -14,4 +14,7 @@ void debug_nullsub_66(void); // sound_check_menu void CB2_StartSoundCheckMenu(void); +// nakamura_debug_menu +void NakaGenderTest(void); + #endif // GUARD_DEBUG_H diff --git a/include/decoration_inventory.h b/include/decoration_inventory.h index e59a23008..e2e31bee9 100644 --- a/include/decoration_inventory.h +++ b/include/decoration_inventory.h @@ -4,9 +4,12 @@ void ClearDecorationInventories(void); s8 sub_8133F9C(u8); u8 sub_8133FE4(u8); -u8 IsThereStorageSpaceForDecoration(u8); +u8 GiveDecoration(u8); u8 sub_8134074(u8); s8 sub_81340A8(u8); u8 sub_8134194(u8); +#if DEBUG +void Debug_GiveAllDecorations(void); +#endif // DEBUG #endif // GUARD_DECORATION_INVENTORY_H diff --git a/include/ewram.h b/include/ewram.h index f1d9baa78..6b164648b 100644 --- a/include/ewram.h +++ b/include/ewram.h @@ -98,13 +98,13 @@ extern u8 gSharedMem[]; #define ewram16001 (gSharedMem[0x16001]) #define ewram16002 (gSharedMem[0x16002]) #define ewram16003 (gSharedMem[0x16003]) -#define ewram16004arr(i, bank) (gSharedMem[0x16004 + i + bank * 2]) +#define ewram16004arr(i, battler) (gSharedMem[0x16004 + i + battler * 2]) #define ewram1600C (gSharedMem[0x1600C]) #define ewram1600E (gSharedMem[0x1600E]) -#define ewram16010arr(bank) (gSharedMem[0x16010 + bank]) +#define ewram16010arr(battler) (gSharedMem[0x16010 + battler]) #define ewram1601B (gSharedMem[0x1601B]) #define eDynamicMoveType (gSharedMem[0x1601C]) -#define eFocusPunchBank (gSharedMem[0x1601D]) +#define eFocusPunchBattler (gSharedMem[0x1601D]) #define eDmgMultiplier (gSharedMem[0x1601F]) #define ewram16020 ((u8 *)(gSharedMem + 0x16020)) #define ewram16020arr(i) (gSharedMem[0x16020 + i]) @@ -112,10 +112,10 @@ extern u8 gSharedMem[]; #define ewram16056 (gSharedMem[0x16056]) #define ewram16058 (gSharedMem[0x16058]) #define ewram16059 (gSharedMem[0x16059]) -#define ewram16060(bank) (gSharedMem[0x16060 + bank]) -#define BATTLE_PARTY_ID(bank) (gSharedMem[0x16064 + bank]) +#define ewram16060(battler) (gSharedMem[0x16060 + battler]) +#define BATTLE_PARTY_ID(battler) (gSharedMem[0x16064 + battler]) #define ewram16064 (&gSharedMem[0x16064]) -#define ewram16064arr(bank) (gSharedMem[0x16064 + bank]) +#define ewram16064arr(battler) (gSharedMem[0x16064 + battler]) #define ewram16068arr(i) (gSharedMem[0x16068 + i]) #define UNK_201606C_ARRAY (gSharedMem + 0x1606C) // lazy define but whatever. #define ewram1606Carr(i, a) (gSharedMem[0x1606C + i + a * 3]) @@ -132,7 +132,7 @@ extern u8 gSharedMem[]; #define ewram1608A gSharedMem[0x1608A] #define ewram1608B gSharedMem[0x1608B] -#define ewram1608Carr(bank) (gSharedMem[0x1608C + bank]) +#define ewram1608Carr(battler) (gSharedMem[0x1608C + battler]) #define EWRAM_1609D (gSharedMem[0x1609D]) #define ewram160A1 (gSharedMem[0x160A1]) #define ewram160A4 (gSharedMem[0x160A4]) @@ -144,31 +144,31 @@ extern u8 gSharedMem[]; #define ewram160AB (gSharedMem[0x160AB]) #define ewram160AC ((u8 *)(gSharedMem + 0x160AC)) #define ewram160ACarr(i) (gSharedMem[0x160AC + i]) -#define ewram160ACarr2(i, bank) (gSharedMem[0x160AC + i + bank * 2]) +#define ewram160ACarr2(i, battler) (gSharedMem[0x160AC + i + battler * 2]) #define ewram160BC ((u16 *)(gSharedMem + 0x160BC)) // hp -#define ewram160BCarr(bank) (gSharedMem[0x160BC + bank * 2]) +#define ewram160BCarr(battler) (gSharedMem[0x160BC + battler * 2]) #define ewram160C0 (gSharedMem[0x160C0]) #define ewram160C2_Flags ((u16 *)(gSharedMem + 0x160C2)) #define ewram160C4_Callback ((MainCallback *)(gSharedMem + 0x160C4)) #define ewram160C8 (gSharedMem[0x160C8]) -#define ewram160C8arr(bank) (gSharedMem[0x160C8 + (bank / 2)]) +#define ewram160C8arr(battler) (gSharedMem[0x160C8 + (battler / 2)]) #define ewram160C9 (gSharedMem[0x160C9]) #define ewram160CB (gSharedMem[0x160CB]) #define ewram160CC ((u8 *)(gSharedMem + 0x160CC)) #define ewram160CCarr(i) (gSharedMem[0x160CC + i]) -#define USED_HELD_ITEM(bank) ((((u16*)(&gSharedMem[0x160CC + bank * 2])))) -#define USED_HELD_ITEMS(bank) (*(u16 *)&gSharedMem[0x160CC + 2 * (bank)]) -#define ewram160D4(bank) (gSharedMem[0x160D4 + (bank / 2) * 2]) -#define ewram160D8(bank) (gSharedMem[0x160D8 + (bank / 2)]) -#define ewram160DA(bank) (gSharedMem[0x160DA + (bank / 2)]) +#define USED_HELD_ITEM(battler) ((((u16*)(&gSharedMem[0x160CC + battler * 2])))) +#define USED_HELD_ITEMS(battler) (*(u16 *)&gSharedMem[0x160CC + 2 * (battler)]) +#define ewram160D4(battler) (gSharedMem[0x160D4 + (battler / 2) * 2]) +#define ewram160D8(battler) (gSharedMem[0x160D8 + (battler / 2)]) +#define ewram160DA(battler) (gSharedMem[0x160DA + (battler / 2)]) #define ewram160DD (gSharedMem[0x160DD]) #define ewram160E0(i) (gSharedMem[0x160E0 + i]) #define ewram160E6 (gSharedMem[0x160E6]) #define ewram160E7 (gSharedMem[0x160E7]) -#define CHOICED_MOVE(bank) (((u16*)(&gSharedMem[0x160E8 + bank * 2]))) +#define CHOICED_MOVE(battler) (((u16*)(&gSharedMem[0x160E8 + battler * 2]))) #define ewram160E8 ((u8 *)(gSharedMem + 0x160E8)) #define ewram160E8arr(i) (gSharedMem[0x160E8 + i]) -#define ewram160E8arr2(i, bank) (gSharedMem[0x160E8 + i + bank * 2]) +#define ewram160E8arr2(i, battler) (gSharedMem[0x160E8 + i + battler * 2]) #define ewram160F0 ((u8 *)(gSharedMem + 0x160F0)) #define ewram160F0arr(i) (gSharedMem[0x160F0 + i]) #define ewram160F8 (gSharedMem[0x160F8]) @@ -177,7 +177,7 @@ extern u8 gSharedMem[]; #define ewram160FB (gSharedMem[0x160FB]) #define ewram16100 ((u8 *)(gSharedMem + 0x16100)) #define ewram16100arr(i) (gSharedMem[0x16100 + i]) -#define ewram16100arr2(i, bank) (gSharedMem[0x16100 + i + bank * 4]) +#define ewram16100arr2(i, battler) (gSharedMem[0x16100 + i + battler * 4]) #define ewram16108 ((u8 *)(gSharedMem + 0x16108)) #define ewram16108arr(i) (gSharedMem[0x16108 + i]) #define ewram16110 (gSharedMem[0x16110]) @@ -186,7 +186,7 @@ extern u8 gSharedMem[]; #define ewram16113 (gSharedMem[0x16113]) #define ewram16400 (gSharedMem + 0x16400) #define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gSharedMem + 0x16800)) -#define UNK_2016A00_STRUCT ((struct UnkBattleStruct1 *) (gSharedMem + 0x16A00)) +#define AI_BATTLE_HISTORY ((struct BattleHistory *) (gSharedMem + 0x16A00)) #define AI_STACK ((struct AI_Stack *) (gSharedMem + 0x16C00)) #define AI_ARRAY_160CC(i) (gSharedMem[0x160CC + i * 2]) #define ewram16800 (&gSharedMem[0x16800]) diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h index cd0cb6eab..64e922651 100644 --- a/include/field_fadetransition.h +++ b/include/field_fadetransition.h @@ -13,7 +13,7 @@ void sub_8080A3C(void); void sub_8080AC4(void); void mapldr_default(); void sub_8080B60(void); -void atk17_seteffectsecondary(void); +void sub_8080DEC(void); void sub_8080E28(void); void sub_8080E44(void); bool32 sub_8080E70(void); diff --git a/include/global.h b/include/global.h index 0949c87cb..4437b7feb 100644 --- a/include/global.h +++ b/include/global.h @@ -1,6 +1,8 @@ #ifndef GUARD_GLOBAL_H #define GUARD_GLOBAL_H +#include <string.h> +#include <stdlib.h> #include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines. #include "gba/gba.h" @@ -14,10 +16,6 @@ #define INCBIN_S8 {0} #define INCBIN_S16 {0} #define INCBIN_S32 {0} -void *memcpy (void *, const void *, size_t); -void *memset (void *, int, size_t); -int strcmp (const char *, const char *); -#define abs(a) ((a) >= 0 ? (a) : -(a)) #endif // Prevent cross-jump optimization. diff --git a/include/macros/battle_script.inc b/include/macros/battle_script.inc index e4fa0c454..d92e28934 100644 --- a/include/macros/battle_script.inc +++ b/include/macros/battle_script.inc @@ -1402,7 +1402,7 @@ .endm .macro jumpifmovehadnoeffect jumpptr - jumpifbyte COMMON_BITS, gBattleMoveFlags, MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED, \jumpptr + jumpifbyte COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED, \jumpptr .endm .macro jumpifbattletype flags, jumpptr diff --git a/include/menu.h b/include/menu.h index 3295cd5c5..523037839 100644 --- a/include/menu.h +++ b/include/menu.h @@ -4,10 +4,12 @@ #include "task.h" #include "text.h" +typedef bool8 (*MenuFunc)(); + struct MenuAction { const u8 *text; - u8 (*func)(); + MenuFunc func; }; struct MenuAction2 diff --git a/include/menu_helpers.h b/include/menu_helpers.h index a1c872c73..fb50ae724 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -50,5 +50,8 @@ void StartVerticalScrollIndicators(u8); void sub_80F98DC(u8); void PauseVerticalScrollIndicator(u8); void SetVerticalScrollIndicatorPriority(u8, u8); +#if DEBUG +void PrintTriangleCursorWithPalette(u8, u8, u8); +#endif // DEBUG #endif // GUARD_MENU_HELPERS_H diff --git a/include/overworld.h b/include/overworld.h index dc393cc63..b18027933 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -138,7 +138,7 @@ void c2_exit_to_overworld_2_switch(void); void c2_exit_to_overworld_2_local(void); void c2_exit_to_overworld_2_link(void); // sub_805465C -void sub_805469C(void); +void c2_exit_to_overworld_1_sub_8080DEC(void); // sub_80546B8 void c2_exit_to_overworld_1_continue_scripts_restart_music(void); void sub_80546F0(void); diff --git a/include/pokeblock.h b/include/pokeblock.h index a606a32ad..f674666ff 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -42,7 +42,7 @@ s16 PokeblockGetGain(u8, const struct Pokeblock *); u8 sub_810CB68(u8, u8*); void PokeblockCopyName(struct Pokeblock *pokeblock, u8 *dest); void CB2_PreparePokeblockFeedScene(void); -bool8 sub_810CA34(const struct Pokeblock *); +bool8 GivePokeblock(const struct Pokeblock *); #include "main.h" diff --git a/include/pokemon.h b/include/pokemon.h index 169045c0c..8864aee8a 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -312,6 +312,8 @@ struct UnknownPokemonStruct /*0x2B*/u8 friendship; }; +#define BATTLE_STATS_NO 8 + struct BattlePokemon { /*0x00*/ u16 species; @@ -329,7 +331,7 @@ struct BattlePokemon /*0x17*/ u32 spDefenseIV:5; /*0x17*/ u32 isEgg:1; /*0x17*/ u32 altAbility:1; - /*0x18*/ s8 statStages[8]; + /*0x18*/ s8 statStages[BATTLE_STATS_NO]; /*0x20*/ u8 ability; /*0x21*/ u8 type1; /*0x22*/ u8 type2; @@ -630,5 +632,10 @@ struct Sprite *sub_80F7920(u16, u16, const u16 *); void BoxMonRestorePP(struct BoxPokemon *); bool8 HealStatusConditions(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId); +u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit); + +#if DEBUG +void Nakamura_NakaGenderTest_RecalcStats(struct Pokemon *); +#endif // DEBUG #endif // GUARD_POKEMON_H diff --git a/include/roamer.h b/include/roamer.h index 86908bd00..6f0813eb8 100644 --- a/include/roamer.h +++ b/include/roamer.h @@ -10,4 +10,9 @@ u8 TryStartRoamerEncounter(void); void UpdateRoamerHPStatus(struct Pokemon *mon); void SetRoamerInactive(void); -#endif +#if DEBUG +void Debug_CreateRoamer(void); +void Debug_GetRoamerLocation(u8 *); +#endif // DEBUG + +#endif // GUARD_ROAMER_H diff --git a/include/rom_8077ABC.h b/include/rom_8077ABC.h index 1910b7cb2..7215e7fb3 100644 --- a/include/rom_8077ABC.h +++ b/include/rom_8077ABC.h @@ -10,24 +10,24 @@ struct Struct_sub_8078914 { u8 field_8; }; -u8 GetBankPosition(u8, u8); +u8 GetBattlerSpriteCoord(u8, u8); u8 sub_8077E44(u8 slot, u16 species, u8 a3); -u8 GetAnimBankSpriteId(u8 bank); +u8 GetAnimBattlerSpriteId(u8 bank); void StoreSpriteCallbackInData(struct Sprite *sprite, void(*callback)(struct Sprite *)); void sub_8078314(struct Sprite *sprite); void TranslateSpriteOverDuration(struct Sprite *sprite); void TranslateMonBGUntil(struct Sprite *sprite); void TranslateMonBGSubPixelUntil(struct Sprite *sprite); -u8 GetBankSide(u8); -u8 GetBankSide(u8); -u8 GetBankSide(u8 side); -u8 GetBankSide(u8 slot); -u8 GetBankSide(u8); -u8 GetBankIdentity(u8); -u8 GetBankIdentity(u8 slot); -u8 GetBankByIdentity(u8); -u8 GetBankByIdentity(u8); -u8 GetBankByIdentity(u8 state); +u8 GetBattlerSide(u8); +u8 GetBattlerSide(u8); +u8 GetBattlerSide(u8 side); +u8 GetBattlerSide(u8 slot); +u8 GetBattlerSide(u8); +u8 GetBattlerPosition(u8); +u8 GetBattlerPosition(u8 slot); +u8 GetBattlerAtPosition(u8); +u8 GetBattlerAtPosition(u8); +u8 GetBattlerAtPosition(u8 state); bool8 IsBankSpritePresent(u8); bool8 IsDoubleBattle(); u8 IsDoubleBattle(void); @@ -58,7 +58,7 @@ void sub_8079C08(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a u8 sub_8079C74(struct Task *task); void sub_8079E24(); u8 sub_8079E90(u8 slot); -u8 GetBankIdentity_permutated(u8 slot); +u8 GetBattlerPosition_permutated(u8 slot); void sub_807A784(u8 taskId); void sub_807A850(struct Task *task, u8 taskId); void sub_807A8D4(struct Sprite *sprite); diff --git a/include/secret_base.h b/include/secret_base.h index a3fa22c05..450850155 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -20,5 +20,9 @@ u8 sub_80BCCA4(u8 secretBaseIndex); const u8 *GetSecretBaseTrainerLoseText(void); void sub_80BCF1C(u8 taskId); void sub_80BD674(void *playerRecords, u32 size, u8 c); +#if DEBUG +void unref_sub_80BCD7C(u8 secretBaseIndex); +u8 *sub_80BC190(u8 *dest, u8 arg1); +#endif #endif // GUARD_SECRET_BASE_H diff --git a/include/strings.h b/include/strings.h index 91c5c5344..240e212ac 100644 --- a/include/strings.h +++ b/include/strings.h @@ -165,6 +165,7 @@ extern const u8 gOtherText_None[]; extern const u8 gOtherText_ThreeQuestions2[]; extern const u8 gOtherText_FiveQuestions[]; +extern const u8 gOtherText_Slash[]; extern const u8 gOtherText_OneDash[]; extern const u8 gOtherText_TwoDashes[]; @@ -250,6 +251,7 @@ extern const u8 gContestStatsText_Dry[]; extern const u8 gContestStatsText_Sweet[]; extern const u8 gContestStatsText_Bitter[]; extern const u8 gContestStatsText_Sour[]; +extern const u8 gContestStatsText_Tasty[]; extern const u8 gContestStatsText_StowCase[]; extern const u8 gContestStatsText_ThrowAwayPrompt[]; diff --git a/include/wild_encounter.h b/include/wild_encounter.h index c9d7c3fa1..41ca31835 100644 --- a/include/wild_encounter.h +++ b/include/wild_encounter.h @@ -35,5 +35,10 @@ void FishingWildEncounter(u8 rod); u16 GetLocalWildMon(bool8 *isWaterMon); u16 GetLocalWaterMon(void); bool8 UpdateRepelCounter(void); +#if DEBUG +u16 FeebasDebug_GetTrueNumberOfWaterTilesInMapThird(u8 arg0); +void FeebasSeedRng(u16 seed); +u16 FeebasRandom(void); +#endif // DEBUG #endif // GUARD_WILD_ENCOUNTER_H |