Merge branch 'master' into unk_text_util_2
This commit is contained in:
529
include/battle.h
529
include/battle.h
@@ -1,8 +1,28 @@
|
||||
#ifndef GUARD_BATTLE_H
|
||||
#define GUARD_BATTLE_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_SIDE(bank)((GetBankIdentity(bank) & BIT_SIDE))
|
||||
|
||||
#define BATTLE_TYPE_DOUBLE 0x0001
|
||||
#define BATTLE_TYPE_LINK 0x0002
|
||||
#define BATTLE_TYPE_WILD 0x0004
|
||||
@@ -40,9 +60,6 @@
|
||||
|
||||
#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000 | BATTLE_TYPE_PYRAMID)
|
||||
|
||||
#define SIDE_PLAYER 0x0
|
||||
#define SIDE_OPPONENT 0x1
|
||||
|
||||
#define BATTLE_WON 0x1
|
||||
#define BATTLE_LOST 0x2
|
||||
#define BATTLE_DREW 0x3
|
||||
@@ -66,11 +83,12 @@
|
||||
#define STATUS2_CONFUSION 0x00000007
|
||||
#define STATUS2_FLINCHED 0x00000008
|
||||
#define STATUS2_UPROAR 0x00000070
|
||||
#define STATUS2_BIDE 0x00000300 //two bits 0x100 0x200
|
||||
#define STATUS2_BIDE 0x00000300 // two bits 0x100, 0x200
|
||||
#define STATUS2_LOCK_CONFUSE 0x00000C00
|
||||
#define STATUS2_MULTIPLETURNS 0x00001000
|
||||
#define STATUS2_WRAPPED 0x0000E000
|
||||
#define STATUS2_INFATUATION 0x000F0000
|
||||
#define STATUS2_INFATUATION 0x000F0000 // 4 bits, one for every bank
|
||||
#define STATUS2_INFATUATED_WITH(bank)((gBitTable[bank] << 16))
|
||||
#define STATUS2_FOCUS_ENERGY 0x00100000
|
||||
#define STATUS2_TRANSFORMED 0x00200000
|
||||
#define STATUS2_RECHARGE 0x00400000
|
||||
@@ -86,7 +104,7 @@
|
||||
|
||||
#define STATUS3_LEECHSEED_BANK 0x3
|
||||
#define STATUS3_LEECHSEED 0x4
|
||||
#define STATUS3_ALWAYS_HITS 0x18 //two bits
|
||||
#define STATUS3_ALWAYS_HITS 0x18 // two bits
|
||||
#define STATUS3_PERISH_SONG 0x20
|
||||
#define STATUS3_ON_AIR 0x40
|
||||
#define STATUS3_UNDERGROUND 0x80
|
||||
@@ -94,7 +112,7 @@
|
||||
#define STATUS3_ROOTED 0x400
|
||||
#define STATUS3_CHARGED_UP 0x200
|
||||
#define STATUS3_YAWN 0x1800 //two bits
|
||||
#define STATUS3_IMPRISIONED 0x2000
|
||||
#define STATUS3_IMPRISONED_OTHERS 0x2000
|
||||
#define STATUS3_GRUDGE 0x4000
|
||||
#define STATUS3_CANT_SCORE_A_CRIT 0x8000
|
||||
#define STATUS3_MUDSPORT 0x10000
|
||||
@@ -154,7 +172,7 @@
|
||||
#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
|
||||
#define ABILITYEFFECT_FIELD_SPORT 0xE
|
||||
#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF
|
||||
#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
|
||||
#define ABILITYEFFECT_COUNT_OTHER_SIDE 0x10
|
||||
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
|
||||
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
|
||||
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
|
||||
@@ -187,27 +205,97 @@
|
||||
#define WEATHER_SUN_ANY ((WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT))
|
||||
#define WEATHER_HAIL (1 << 7)
|
||||
#define WEATHER_HAIL_ANY ((WEATHER_HAIL))
|
||||
#define WEATHER_ANY ((WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY))
|
||||
|
||||
#define REQUEST_ALL_BATTLE 0x0
|
||||
#define REQUEST_SPECIES_BATTLE 0x1
|
||||
#define REQUEST_HELDITEM_BATTLE 0x2
|
||||
#define REQUEST_MOVES_PP_BATTLE 0x3
|
||||
#define REQUEST_PPMOVE1_BATTLE 0x9
|
||||
#define REQUEST_PPMOVE2_BATTLE 0xA
|
||||
#define REQUEST_PPMOVE3_BATTLE 0xB
|
||||
#define REQUEST_PPMOVE4_BATTLE 0xC
|
||||
#define REQUEST_STATUS_BATTLE 0x28
|
||||
#define REQUEST_HP_BATTLE 0x2A
|
||||
#define BATTLE_TERRAIN_GRASS 0
|
||||
#define BATTLE_TERRAIN_LONG_GRASS 1
|
||||
#define BATTLE_TERRAIN_SAND 2
|
||||
#define BATTLE_TERRAIN_UNDERWATER 3
|
||||
#define BATTLE_TERRAIN_WATER 4
|
||||
#define BATTLE_TERRAIN_POND 5
|
||||
#define BATTLE_TERRAIN_ROCK 6
|
||||
#define BATTLE_TERRAIN_CAVE 7
|
||||
|
||||
// array entries for battle communication
|
||||
#define MULTIUSE_STATE 0x0
|
||||
#define CURSOR_POSITION 0x1
|
||||
#define TASK_ID 0x1 // task Id and cursor position share the same field
|
||||
#define MOVE_EFFECT_BYTE 0x3
|
||||
#define MULTISTRING_CHOOSER 0x5
|
||||
#define MSG_DISPLAY 0x7
|
||||
|
||||
// functions
|
||||
#define MOVE_TARGET_SELECTED 0x0
|
||||
#define MOVE_TARGET_DEPENDS 0x1
|
||||
#define MOVE_TARGET_USER 0x2
|
||||
#define MOVE_TARGET_RANDOM 0x4
|
||||
#define MOVE_TARGET_x10 0x10
|
||||
#define MOVE_TARGET_BOTH 0x8
|
||||
#define MOVE_TARGET_FOES_AND_ALLY 0x20
|
||||
#define MOVE_TARGET_OPPONENTS_FIELD 0x40
|
||||
|
||||
extern u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
|
||||
extern u8 GetBankSide(u8 bank);
|
||||
#define TYPE_MUL_NO_EFFECT 0
|
||||
#define TYPE_MUL_NOT_EFFECTIVE 5
|
||||
#define TYPE_MUL_NORMAL 10
|
||||
#define TYPE_MUL_SUPER_EFFECTIVE 20
|
||||
|
||||
#define BS_GET_TARGET 0
|
||||
#define BS_GET_ATTACKER 1
|
||||
#define BS_GET_EFFECT_BANK 2
|
||||
#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
|
||||
#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability
|
||||
#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
|
||||
#define BS_GET_SCRIPTING_BANK 10
|
||||
#define BS_GET_OPPONENT1 12
|
||||
#define BS_GET_PLAYER2 13
|
||||
#define BS_GET_OPPONENT2 14
|
||||
|
||||
// for battle script commands
|
||||
#define CMP_EQUAL 0x0
|
||||
#define CMP_NOT_EQUAL 0x1
|
||||
#define CMP_GREATER_THAN 0x2
|
||||
#define CMP_LESS_THAN 0x3
|
||||
#define CMP_COMMON_BITS 0x4
|
||||
#define CMP_NO_COMMON_BITS 0x5
|
||||
|
||||
struct TrainerMonNoItemDefaultMoves
|
||||
{
|
||||
u16 species;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
};
|
||||
|
||||
struct TrainerMonItemDefaultMoves
|
||||
{
|
||||
u16 species;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 heldItem;
|
||||
};
|
||||
|
||||
struct TrainerMonNoItemCustomMoves
|
||||
{
|
||||
u16 species;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 moves[4];
|
||||
};
|
||||
|
||||
struct TrainerMonItemCustomMoves
|
||||
{
|
||||
u16 species;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 heldItem;
|
||||
u16 moves[4];
|
||||
};
|
||||
|
||||
union TrainerMonPtr
|
||||
{
|
||||
struct TrainerMonNoItemDefaultMoves* NoItemDefaultMoves;
|
||||
struct TrainerMonNoItemCustomMoves* NoItemCustomMoves;
|
||||
struct TrainerMonItemDefaultMoves* ItemDefaultMoves;
|
||||
struct TrainerMonItemCustomMoves* ItemCustomMoves;
|
||||
};
|
||||
|
||||
struct Trainer
|
||||
{
|
||||
@@ -220,9 +308,12 @@ struct Trainer
|
||||
/*0x18*/ bool8 doubleBattle;
|
||||
/*0x1C*/ u32 aiFlags;
|
||||
/*0x20*/ u8 partySize;
|
||||
/*0x24*/ void *party;
|
||||
/*0x24*/ union TrainerMonPtr party;
|
||||
};
|
||||
|
||||
#define PARTY_FLAG_CUSTOM_MOVES 0x1
|
||||
#define PARTY_FLAG_HAS_ITEM 0x2
|
||||
|
||||
extern const struct Trainer gTrainers[];
|
||||
|
||||
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
||||
@@ -262,7 +353,8 @@ struct DisableStruct
|
||||
/*0x16*/ u8 isFirstTurn;
|
||||
/*0x17*/ u8 unk17;
|
||||
/*0x18*/ u8 truantCounter : 1;
|
||||
/*0x18*/ u8 unk18_a : 3;
|
||||
/*0x18*/ u8 truantUnknownBit : 1;
|
||||
/*0x18*/ u8 unk18_a_2 : 2;
|
||||
/*0x18*/ u8 unk18_b : 4;
|
||||
/*0x19*/ u8 rechargeCounter;
|
||||
/*0x1A*/ u8 unk1A[2];
|
||||
@@ -312,11 +404,11 @@ extern struct ProtectStruct gProtectStructs[BATTLE_BANKS_COUNT];
|
||||
|
||||
struct SpecialStatus
|
||||
{
|
||||
u8 statLowered : 1;
|
||||
u8 lightningRodRedirected : 1;
|
||||
u8 restoredBankSprite: 1;
|
||||
u8 intimidatedPoke : 1;
|
||||
u8 traced : 1;
|
||||
u8 statLowered : 1; // 0x1
|
||||
u8 lightningRodRedirected : 1; // 0x2
|
||||
u8 restoredBankSprite: 1; // 0x4
|
||||
u8 intimidatedPoke : 1; // 0x8
|
||||
u8 traced : 1; // 0x10
|
||||
u8 flag20 : 1;
|
||||
u8 flag40 : 1;
|
||||
u8 focusBanded : 1;
|
||||
@@ -359,7 +451,7 @@ struct WishFutureKnock
|
||||
u8 wishCounter[BATTLE_BANKS_COUNT];
|
||||
u8 wishUserID[BATTLE_BANKS_COUNT];
|
||||
u8 weatherDuration;
|
||||
u16 knockedOffPokes;
|
||||
u8 knockedOffPokes[2];
|
||||
};
|
||||
|
||||
extern struct WishFutureKnock gWishFutureKnock;
|
||||
@@ -405,13 +497,23 @@ struct BattleCallbacksStack
|
||||
u8 size;
|
||||
};
|
||||
|
||||
struct StatsArray
|
||||
{
|
||||
u16 hp;
|
||||
u16 atk;
|
||||
u16 def;
|
||||
u16 spd;
|
||||
u16 spAtk;
|
||||
u16 spDef;
|
||||
};
|
||||
|
||||
struct BattleResources
|
||||
{
|
||||
struct SecretBaseRecord* secretBase;
|
||||
struct UnknownFlags *flags;
|
||||
struct BattleScriptsStack* battleScriptsStack;
|
||||
struct BattleCallbacksStack* battleCallbackStack;
|
||||
void* statsBeforeLvlUp;
|
||||
struct StatsArray* statsBeforeLvlUp;
|
||||
struct AI_ThinkingStruct *ai;
|
||||
struct BattleHistory *battleHistory;
|
||||
struct BattleScriptsStack *AI_ScriptsStack;
|
||||
@@ -421,16 +523,20 @@ extern struct BattleResources* gBattleResources;
|
||||
|
||||
#define BATTLESCRIPTS_STACK (gBattleResources->battleScriptsStack)
|
||||
#define BATTLE_CALLBACKS_STACK (gBattleResources->battleCallbackStack)
|
||||
#define BATTLE_LVLUP_STATS (gBattleResources->statsBeforeLvlUp)
|
||||
|
||||
struct BattleResults
|
||||
{
|
||||
u8 playerFaintCounter; // 0x0
|
||||
u8 opponentFaintCounter; // 0x1
|
||||
u8 unk2; // 0x2
|
||||
u8 playerSwitchesCounter; // 0x2
|
||||
u8 unk3; // 0x3
|
||||
u8 unk4; // 0x4
|
||||
u8 unk5_0:1; // 0x5
|
||||
u8 unk5_1:1; // 0x5
|
||||
u8 caughtMonBall:4; // 0x5
|
||||
u8 unk5_6:1; // 0x5
|
||||
u8 unk5_7:1; // 0x5
|
||||
u16 poke1Species; // 0x6
|
||||
u8 pokeString1[10]; // 0x8
|
||||
u8 unk12;
|
||||
@@ -442,10 +548,10 @@ struct BattleResults
|
||||
u16 lastUsedMove; // 0x22
|
||||
u16 opponentMove; // 0x24
|
||||
u16 opponentSpecies; // 0x26
|
||||
u16 caughtPoke; // 0x28
|
||||
u8 caughtNick[10]; // 0x2A
|
||||
u16 caughtMonSpecies; // 0x28
|
||||
u8 caughtMonNick[10]; // 0x2A
|
||||
u8 filler34[2];
|
||||
u8 unk36[10]; // usedBalls?
|
||||
u8 catchAttempts[10]; // 0x36
|
||||
};
|
||||
|
||||
extern struct BattleResults gBattleResults;
|
||||
@@ -463,46 +569,7 @@ struct BattleStruct
|
||||
u8 wildVictorySong;
|
||||
u8 dynamicMoveType;
|
||||
u8 wrappedBy[4];
|
||||
u8 field_18;
|
||||
u8 field_19;
|
||||
u8 field_1A;
|
||||
u8 field_1B;
|
||||
u8 field_1C;
|
||||
u8 field_1D;
|
||||
u8 field_1E;
|
||||
u8 field_1F;
|
||||
u8 field_20;
|
||||
u8 field_21;
|
||||
u8 field_22;
|
||||
u8 field_23;
|
||||
u8 field_24;
|
||||
u8 field_25;
|
||||
u8 field_26;
|
||||
u8 field_27;
|
||||
u8 field_28;
|
||||
u8 field_29;
|
||||
u8 field_2A;
|
||||
u8 field_2B;
|
||||
u8 field_2C;
|
||||
u8 field_2D;
|
||||
u8 field_2E;
|
||||
u8 field_2F;
|
||||
u8 field_30;
|
||||
u8 field_31;
|
||||
u8 field_32;
|
||||
u8 field_33;
|
||||
u8 field_34;
|
||||
u8 field_35;
|
||||
u8 field_36;
|
||||
u8 field_37;
|
||||
u8 field_38;
|
||||
u8 field_39;
|
||||
u8 field_3A;
|
||||
u8 field_3B;
|
||||
u8 field_3C;
|
||||
u8 field_3D;
|
||||
u8 field_3E;
|
||||
u8 field_3F;
|
||||
u16 assistPossibleMoves[5 * 4]; // 5 mons, each of them knowing 4 moves
|
||||
u8 field_40;
|
||||
u8 field_41;
|
||||
u8 field_42;
|
||||
@@ -519,43 +586,15 @@ struct BattleStruct
|
||||
u8 field_4D;
|
||||
u8 field_4E;
|
||||
u8 field_4F;
|
||||
u8 field_50;
|
||||
u8 field_51;
|
||||
u16 expValue;
|
||||
u8 field_52;
|
||||
u8 field_53;
|
||||
u8 field_54;
|
||||
u8 field_55;
|
||||
u8 field_56;
|
||||
u8 field_57;
|
||||
u8 field_58;
|
||||
u8 field_59;
|
||||
u8 field_5A;
|
||||
u8 field_5B;
|
||||
u8 sentInPokes;
|
||||
u8 field_54[4];
|
||||
u8 field_58[4];
|
||||
u8 field_5C[4];
|
||||
u8 field_60;
|
||||
u8 field_61;
|
||||
u8 field_62;
|
||||
u8 field_63;
|
||||
u8 field_64;
|
||||
u8 field_65;
|
||||
u8 field_66;
|
||||
u8 field_67;
|
||||
u8 field_68;
|
||||
u8 field_69;
|
||||
u8 field_6A;
|
||||
u8 field_6B;
|
||||
u8 field_60[4][3];
|
||||
u8 field_6C;
|
||||
u8 field_6D;
|
||||
u8 field_6E;
|
||||
u8 field_6F;
|
||||
u8 field_70;
|
||||
u8 field_71;
|
||||
u8 field_72;
|
||||
u8 field_73;
|
||||
u8 field_74;
|
||||
u8 field_75;
|
||||
u8 field_76;
|
||||
u8 field_77;
|
||||
u8 caughtMonNick[11];
|
||||
u8 field_78;
|
||||
u8 field_79;
|
||||
u8 field_7A;
|
||||
@@ -585,14 +624,7 @@ struct BattleStruct
|
||||
u8 field_95;
|
||||
u8 field_96;
|
||||
u8 field_97;
|
||||
u8 field_98;
|
||||
u8 field_99;
|
||||
u8 field_9A;
|
||||
u8 field_9B;
|
||||
u8 field_9C;
|
||||
u8 field_9D;
|
||||
u8 field_9E;
|
||||
u8 field_9F;
|
||||
u8 mirrorMoves[8]; // ask gamefreak why they declared it that way
|
||||
u8 field_A0;
|
||||
u8 field_A1;
|
||||
u8 field_A2;
|
||||
@@ -610,21 +642,29 @@ struct BattleStruct
|
||||
u8 field_B5;
|
||||
u8 field_B6;
|
||||
u8 field_B7;
|
||||
u16 usedHeldItems[4];
|
||||
u16 usedHeldItems[BATTLE_BANKS_COUNT];
|
||||
u8 field_C0[8];
|
||||
u16 choicedMove[4];
|
||||
u8 field_D0[8];
|
||||
u16 choicedMove[BATTLE_BANKS_COUNT];
|
||||
u16 changedItems[BATTLE_BANKS_COUNT];
|
||||
u8 intimidateBank;
|
||||
u8 fillerD9[0xDA-0xD9];
|
||||
u8 field_DA;
|
||||
u8 turnSideTracker;
|
||||
u8 fillerDC[0xDF-0xDC];
|
||||
u8 field_DF;
|
||||
u8 fillerE0[0x1A0-0xE0];
|
||||
u8 mirrorMoveArrays[32];
|
||||
u16 castformPalette[4][16];
|
||||
u8 field_180[32];
|
||||
u8 field_1A0;
|
||||
u8 field_1A1;
|
||||
u8 filler1A2;
|
||||
u8 atkCancellerTracker;
|
||||
u8 field_1A4[240];
|
||||
u8 field_294[4];
|
||||
u8 field_298[8];
|
||||
u8 field_2A0;
|
||||
u8 field_2A1;
|
||||
u8 field_2A2;
|
||||
};
|
||||
|
||||
extern struct BattleStruct* gBattleStruct;
|
||||
@@ -636,19 +676,153 @@ extern struct BattleStruct* gBattleStruct;
|
||||
var2[offsetof(struct structName, offsetField)] = value; \
|
||||
}
|
||||
|
||||
#define GET_MOVE_TYPE(move, typeArg) \
|
||||
{ \
|
||||
if (gBattleStruct->dynamicMoveType) \
|
||||
typeArg = gBattleStruct->dynamicMoveType & 0x3F; \
|
||||
else \
|
||||
typeArg = gBattleMoves[move].type; \
|
||||
}
|
||||
|
||||
#define MOVE_EFFECT_SLEEP 0x1
|
||||
#define MOVE_EFFECT_POISON 0x2
|
||||
#define MOVE_EFFECT_BURN 0x3
|
||||
#define MOVE_EFFECT_FREEZE 0x4
|
||||
#define MOVE_EFFECT_PARALYSIS 0x5
|
||||
#define MOVE_EFFECT_TOXIC 0x6
|
||||
#define MOVE_EFFECT_CONFUSION 0x7
|
||||
#define MOVE_EFFECT_FLINCH 0x8
|
||||
#define MOVE_EFFECT_TRI_ATTACK 0x9
|
||||
#define MOVE_EFFECT_UPROAR 0xA
|
||||
#define MOVE_EFFECT_PAYDAY 0xB
|
||||
#define MOVE_EFFECT_CHARGING 0xC
|
||||
#define MOVE_EFFECT_WRAP 0xD
|
||||
#define MOVE_EFFECT_RECOIL_25 0xE
|
||||
#define MOVE_EFFECT_ATK_PLUS_1 0xF
|
||||
#define MOVE_EFFECT_DEF_PLUS_1 0x10
|
||||
#define MOVE_EFFECT_SPD_PLUS_1 0x11
|
||||
#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12
|
||||
#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13
|
||||
#define MOVE_EFFECT_ACC_PLUS_1 0x14
|
||||
#define MOVE_EFFECT_EVS_PLUS_1 0x15
|
||||
#define MOVE_EFFECT_ATK_MINUS_1 0x16
|
||||
#define MOVE_EFFECT_DEF_MINUS_1 0x17
|
||||
#define MOVE_EFFECT_SPD_MINUS_1 0x18
|
||||
#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19
|
||||
#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A
|
||||
#define MOVE_EFFECT_ACC_MINUS_1 0x1B
|
||||
#define MOVE_EFFECT_EVS_MINUS_1 0x1C
|
||||
#define MOVE_EFFECT_RECHARGE 0x1D
|
||||
#define MOVE_EFFECT_RAGE 0x1E
|
||||
#define MOVE_EFFECT_STEAL_ITEM 0x1F
|
||||
#define MOVE_EFFECT_PREVENT_ESCAPE 0x20
|
||||
#define MOVE_EFFECT_NIGHTMARE 0x21
|
||||
#define MOVE_EFFECT_ALL_STATS_UP 0x22
|
||||
#define MOVE_EFFECT_RAPIDSPIN 0x23
|
||||
#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24
|
||||
#define MOVE_EFFECT_ATK_DEF_DOWN 0x25
|
||||
#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26
|
||||
#define MOVE_EFFECT_ATK_PLUS_2 0x27
|
||||
#define MOVE_EFFECT_DEF_PLUS_2 0x28
|
||||
#define MOVE_EFFECT_SPD_PLUS_2 0x29
|
||||
#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A
|
||||
#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B
|
||||
#define MOVE_EFFECT_ACC_PLUS_2 0x2C
|
||||
#define MOVE_EFFECT_EVS_PLUS_2 0x2D
|
||||
#define MOVE_EFFECT_ATK_MINUS_2 0x2E
|
||||
#define MOVE_EFFECT_DEF_MINUS_2 0x2F
|
||||
#define MOVE_EFFECT_SPD_MINUS_2 0x30
|
||||
#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31
|
||||
#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32
|
||||
#define MOVE_EFFECT_ACC_MINUS_2 0x33
|
||||
#define MOVE_EFFECT_EVS_MINUS_2 0x34
|
||||
#define MOVE_EFFECT_THRASH 0x35
|
||||
#define MOVE_EFFECT_KNOCK_OFF 0x36
|
||||
#define MOVE_EFFECT_NOTHING_37 0x37
|
||||
#define MOVE_EFFECT_NOTHING_38 0x38
|
||||
#define MOVE_EFFECT_NOTHING_39 0x39
|
||||
#define MOVE_EFFECT_NOTHING_3A 0x3A
|
||||
#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
|
||||
#define MOVE_EFFECT_NOTHING_3C 0x3C
|
||||
#define MOVE_EFFECT_NOTHING_3D 0x3D
|
||||
#define MOVE_EFFECT_NOTHING_3E 0x3E
|
||||
#define MOVE_EFFECT_NOTHING_3F 0x3F
|
||||
#define MOVE_EFFECT_AFFECTS_USER 0x40
|
||||
#define MOVE_EFFECT_CERTAIN 0x80
|
||||
|
||||
// battle animations ids
|
||||
|
||||
#define B_ANIM_CASTFORM_CHANGE 0x0
|
||||
#define B_ANIM_STATS_CHANGE 0x1
|
||||
#define B_ANIM_SUBSTITUTE_FADE 0x2
|
||||
#define B_ANIM_SUBSTITUTE_APPEAR 0x3
|
||||
#define B_ANIM_x4 0x4
|
||||
#define B_ANIM_ITEM_KNOCKOFF 0x5
|
||||
#define B_ANIM_TURN_TRAP 0x6
|
||||
#define B_ANIM_ITEM_EFFECT 0x7
|
||||
#define B_ANIM_SMOKEBALL_ESCAPE 0x8
|
||||
#define B_ANIM_HANGED_ON 0x9
|
||||
#define B_ANIM_RAIN_CONTINUES 0xA
|
||||
#define B_ANIM_SUN_CONTINUES 0xB
|
||||
#define B_ANIM_SANDSTORM_CONTINUES 0xC
|
||||
#define B_ANIM_HAIL_CONTINUES 0xD
|
||||
#define B_ANIM_LEECH_SEED_DRAIN 0xE
|
||||
#define B_ANIM_MON_HIT 0xF
|
||||
#define B_ANIM_ITEM_STEAL 0x10
|
||||
#define B_ANIM_SNATCH_MOVE 0x11
|
||||
#define B_ANIM_FUTURE_SIGHT_HIT 0x12
|
||||
#define B_ANIM_x13 0x13
|
||||
#define B_ANIM_x14 0x14
|
||||
#define B_ANIM_INGRAIN_HEAL 0x15
|
||||
#define B_ANIM_WISH_HEAL 0x16
|
||||
#define B_ANIM_x17 0x17
|
||||
#define B_ANIM_x18 0x18
|
||||
#define B_ANIM_x19 0x19
|
||||
#define B_ANIM_x1A 0x1A
|
||||
#define B_ANIM_x1B 0x1B
|
||||
#define B_ANIM_x1C 0x1C
|
||||
#define B_ANIM_x1D 0x1D
|
||||
|
||||
#define ATK48_STAT_NEGATIVE 0x1
|
||||
#define ATK48_STAT_BY_TWO 0x2
|
||||
#define ATK48_BIT_x4 0x4
|
||||
#define ATK48_LOWER_FAIL_CHECK 0x8
|
||||
|
||||
#define ATK4F_DONT_CHECK_STATUSES 0x80
|
||||
|
||||
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
|
||||
#define VARIOUS_SET_MAGIC_COAT_TARGET 1
|
||||
#define VARIOUS_GET_MOVE_TARGET 3
|
||||
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
||||
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
||||
#define VARIOUS_WAIT_CRY 18
|
||||
#define VARIOUS_RETURN_OPPONENT_MON1 19
|
||||
#define VARIOUS_RETURN_OPPONENT_MON2 20
|
||||
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
||||
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
||||
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1
|
||||
#define ATK80_DMG_DOUBLED 2
|
||||
|
||||
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
|
||||
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
|
||||
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit
|
||||
|
||||
#define STAT_CHANGE_BS_PTR 0x1
|
||||
#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20
|
||||
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
#define STAT_CHANGE_DIDNT_WORK 1
|
||||
|
||||
#define SET_STAT_BUFF_ID(n)((n & 0xF))
|
||||
#define SET_STAT_BUFF_VALUE(n)(((s8)(((s8)(n) << 4)) & 0xF0))
|
||||
|
||||
struct BattleScripting
|
||||
{
|
||||
u8 field_0;
|
||||
u8 field_1;
|
||||
u8 field_2;
|
||||
u8 field_3;
|
||||
u32 bideDmg;
|
||||
u8 field_8;
|
||||
u8 field_9;
|
||||
u8 field_A;
|
||||
u8 field_B;
|
||||
u8 field_C;
|
||||
u8 field_D;
|
||||
s32 painSplitHp;
|
||||
s32 bideDmg;
|
||||
u8 multihitString[6];
|
||||
u8 dmgMultiplier;
|
||||
u8 field_F;
|
||||
u8 animArg1;
|
||||
@@ -659,13 +833,102 @@ struct BattleScripting
|
||||
u8 field_15;
|
||||
u8 field_16;
|
||||
u8 bank;
|
||||
u8 field_18;
|
||||
u8 field_19;
|
||||
u8 animTurn;
|
||||
u8 animTargetsHit;
|
||||
u8 statChanger;
|
||||
u8 field_1B;
|
||||
u8 atk23_state;
|
||||
u8 field_1D;
|
||||
u8 atk6C_state;
|
||||
u8 learnMoveState;
|
||||
u8 field_20;
|
||||
};
|
||||
|
||||
extern struct BattleScripting gBattleScripting;
|
||||
|
||||
// functions
|
||||
|
||||
// battle_2
|
||||
void CancelMultiTurnMoves(u8 bank);
|
||||
void PressurePPLose(u8 bankAtk, u8 bankDef, u16 move);
|
||||
void PrepareStringBattle(u16 stringId, u8 bank);
|
||||
u8 GetBattleBank(u8 caseId);
|
||||
void UndoEffectsAfterFainting(void);
|
||||
bool8 HasMoveFailed(u8 bank);
|
||||
void SwitchInClearStructs(void);
|
||||
void sub_803BDA0(u8 bank);
|
||||
void sub_803FA70(u8 bank);
|
||||
void BattleMainCB2(void);
|
||||
void VBlankCB_Battle(void);
|
||||
void ResetSentPokesToOpponentValue(void);
|
||||
bool8 CanRunFromBattle(u8 bank);
|
||||
bool8 IsRunningFromBattleImpossible(void);
|
||||
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
|
||||
void PressurePPLoseOnUsingImprision(u8 bankAtk);
|
||||
|
||||
// battle_3
|
||||
#define MOVE_LIMITATION_ZEROMOVE (1 << 0)
|
||||
#define MOVE_LIMITATION_PP (1 << 1)
|
||||
#define MOVE_LIMITATION_DISABLED (1 << 2)
|
||||
#define MOVE_LIMITATION_TORMENTED (1 << 3)
|
||||
#define MOVE_LIMITATION_TAUNT (1 << 4)
|
||||
#define MOVE_LIMITATION_IMPRISION (1 << 5)
|
||||
|
||||
void BattleScriptPush(const u8* bsPtr);
|
||||
void BattleScriptPushCursor(void);
|
||||
void BattleScriptPop(void);
|
||||
u8 sub_803FB4C(void); // msg, can't select a move
|
||||
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check);
|
||||
bool8 AreAllMovesUnusable(void);
|
||||
u8 GetImprisonedMovesCount(u8 bank, u16 move);
|
||||
u8 UpdateTurnCounters(void);
|
||||
u8 TurnBasedEffects(void);
|
||||
bool8 sub_8041364(void);
|
||||
bool8 sub_8041728(void);
|
||||
void b_clear_atk_up_if_hit_flag_unless_enraged(void);
|
||||
u8 AtkCanceller_UnableToUseMove(void);
|
||||
bool8 sub_80423F4(u8 bank, u8 r1, u8 r2);
|
||||
u8 CastformDataTypeChange(u8 bank);
|
||||
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
|
||||
void BattleScriptExecute(const u8* BS_ptr);
|
||||
void BattleScriptPushCursorAndCallback(const u8* BS_ptr);
|
||||
u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn);
|
||||
void sub_8045868(u8 bank);
|
||||
void sub_80458B4(void);
|
||||
u8 GetMoveTarget(u16 move, u8 useMoveTarget);
|
||||
u8 IsPokeDisobedient(void);
|
||||
|
||||
// battle_script_commands
|
||||
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
|
||||
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
|
||||
u8 AI_TypeCalc(u16 move, u16 species, u8 ability);
|
||||
u8 BankGetTurnOrder(u8 bank);
|
||||
void SetMoveEffect(bool8 primary, u8 certain);
|
||||
void BattleDestroyCursorAt(u8 cursorPosition);
|
||||
void BattleCreateCursorAt(u8 cursorPosition);
|
||||
void BufferMoveToLearnIntoBattleTextBuff2(void);
|
||||
void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
|
||||
bool8 UproarWakeUpCheck(u8 bank);
|
||||
|
||||
extern void (* const gBattleScriptingCommandsTable[])(void);
|
||||
extern const u8 gUnknown_0831C494[];
|
||||
|
||||
// battle_5
|
||||
void AdjustFriendshipOnBattleFaint(u8 bank);
|
||||
void sub_80571DC(u8 bank, u8 arg1);
|
||||
u32 sub_805725C(u8 bank);
|
||||
|
||||
// battle 7
|
||||
void BattleMusicStop(void);
|
||||
void sub_805E990(struct Pokemon* mon, u8 bank);
|
||||
|
||||
// rom_80A5C6C
|
||||
u8 GetBankSide(u8 bank);
|
||||
u8 GetBankIdentity(u8 bank);
|
||||
u8 GetBankByIdentity(u8 bank);
|
||||
|
||||
// Move this somewhere else
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
struct BattleSpritesGfx
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef GUARD_BATTLE_AI_H
|
||||
#define GUARD_BATTLE_AI_H
|
||||
#ifndef GUARD_BATTLE_AI_SCRIPT_COMMANDS_H
|
||||
#define GUARD_BATTLE_AI_SCRIPT_COMMANDS_H
|
||||
|
||||
void BattleAI_HandleItemUseBeforeAISetup(u8 defaultScoreMoves);
|
||||
void BattleAI_SetupAIData(u8 defaultScoreMoves);
|
||||
@@ -10,4 +10,4 @@ void ClearBankAbilityHistory(u8 bank);
|
||||
void RecordItemEffectBattle(u8 bank, u8 itemEffect);
|
||||
void ClearBankItemEffectHistory(u8 bank);
|
||||
|
||||
#endif // GUARD_BATTLE_AI_H
|
||||
#endif // GUARD_BATTLE_AI_SCRIPT_COMMANDS_H
|
||||
73
include/battle_controllers.h
Normal file
73
include/battle_controllers.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#ifndef GUARD_BATTLE_CONTROLLERS_H
|
||||
#define GUARD_BATTLE_CONTROLLERS_H
|
||||
|
||||
struct HpAndStatus
|
||||
{
|
||||
u16 hp;
|
||||
u32 status;
|
||||
};
|
||||
|
||||
struct MovePpInfo
|
||||
{
|
||||
u16 move[4];
|
||||
u8 pp[4];
|
||||
u8 ppBonuses;
|
||||
};
|
||||
|
||||
#define REQUEST_ALL_BATTLE 0x0
|
||||
#define REQUEST_SPECIES_BATTLE 0x1
|
||||
#define REQUEST_HELDITEM_BATTLE 0x2
|
||||
#define REQUEST_MOVES_PP_BATTLE 0x3
|
||||
#define REQUEST_PPMOVE1_BATTLE 0x9
|
||||
#define REQUEST_PPMOVE2_BATTLE 0xA
|
||||
#define REQUEST_PPMOVE3_BATTLE 0xB
|
||||
#define REQUEST_PPMOVE4_BATTLE 0xC
|
||||
#define REQUEST_STATUS_BATTLE 0x28
|
||||
#define REQUEST_HP_BATTLE 0x2A
|
||||
|
||||
// rom3.s, emitters
|
||||
void EmitSetMonData(u8 bufferId, u8 request, u8 c, u8 bytes, void *data);
|
||||
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct* disableStructPtr, u8 multihit);
|
||||
void EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
|
||||
void EmitEffectivenessSound(u8 bufferId, u16 songId);
|
||||
void EmitPlaySound(u8 bufferId, u16 songId, u8 arg2);
|
||||
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringId);
|
||||
void EmitFaintAnimation(u8 bufferId);
|
||||
void Emit_x2A(u8 bufferId);
|
||||
void EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
|
||||
void EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument);
|
||||
void EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);
|
||||
void EmitReturnPokeToBall(u8 bufferId, u8 arg1);
|
||||
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2);
|
||||
void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
|
||||
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, const u8* arg4);
|
||||
void EmitLinkStandbyMsg(u8 bufferId, u8 arg1, u8 arg2);
|
||||
void EmitTrainerSlide(u8 bufferId);
|
||||
void EmitTrainerSlideBack(u8 bufferId);
|
||||
void EmitFaintingCry(u8 bufferId);
|
||||
void Emit_x37(u8 bufferId, u8 arg1);
|
||||
void EmitHitAnimation(u8 bufferId);
|
||||
void EmitCmd48(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
|
||||
void EmitCmd49(u8 bufferId);
|
||||
void EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
|
||||
void EmitCmd13(u8 bufferId);
|
||||
void EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
|
||||
|
||||
#define RESET_ACTION_MOVE_SELECTION 0
|
||||
#define RESET_ACTION_SELECTION 1
|
||||
#define RESET_MOVE_SELECTION 2
|
||||
|
||||
void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
|
||||
|
||||
#define BALL_NO_SHAKES 0
|
||||
#define BALL_1_SHAKE 1
|
||||
#define BALL_2_SHAKES 2
|
||||
#define BALL_3_SHAKES_FAIL 3
|
||||
#define BALL_3_SHAKES_SUCCESS 4
|
||||
#define BALL_TRAINER_BLOCK 5
|
||||
|
||||
void EmitBallThrow(u8 bufferId, u8 caseId);
|
||||
|
||||
void MarkBufferBankForExecution(u8 bank);
|
||||
|
||||
#endif // GUARD_BATTLE_CONTROLLERS_H
|
||||
@@ -1,6 +1,191 @@
|
||||
#ifndef GUARD_BATTLE_MESSAGE_H
|
||||
#define GUARD_BATTLE_MESSAGE_H
|
||||
|
||||
// for 0xFD
|
||||
|
||||
#define B_TXT_BUFF1 00
|
||||
#define B_TXT_BUFF2 01
|
||||
#define B_TXT_COPY_VAR_1 02
|
||||
#define B_TXT_COPY_VAR_2 03
|
||||
#define B_TXT_COPY_VAR_3 04
|
||||
#define B_TXT_PLAYER_MON1_NAME 05
|
||||
#define B_TXT_OPPONENT_MON1_NAME 06
|
||||
#define B_TXT_PLAYER_MON2_NAME 07
|
||||
#define B_TXT_OPPONENT_MON2_NAME 08
|
||||
#define B_TXT_LINK_PLAYER_MON1_NAME 09
|
||||
#define B_TXT_LINK_OPPONENT_MON1_NAME 0A
|
||||
#define B_TXT_LINK_PLAYER_MON2_NAME 0B
|
||||
#define B_TXT_LINK_OPPONENT_MON2_NAME 0C
|
||||
#define B_TXT_ATK_NAME_WITH_PREFIX_MON1 0D
|
||||
#define B_TXT_ATK_NAME 0E
|
||||
#define B_TXT_ATK_NAME_WITH_PREFIX 0F
|
||||
#define B_TXT_DEF_NAME_WITH_PREFIX 10
|
||||
#define B_TXT_EFF_NAME_WITH_PREFIX 11 // EFF = short for gEffectBank
|
||||
#define B_TXT_SCR_ACTIVE_NAME_WITH_PREFIX 12
|
||||
#define B_TXT_ACTIVE_NAME_WITH_PREFIX 13
|
||||
#define B_TXT_CURRENT_MOVE 14
|
||||
#define B_TXT_LAST_MOVE 15
|
||||
#define B_TXT_LAST_ITEM 16
|
||||
#define B_TXT_LAST_ABILITY 17
|
||||
#define B_TXT_ATK_ABILITY 18
|
||||
#define B_TXT_DEF_ABILITY 19
|
||||
#define B_TXT_SCR_ACTIVE_ABILITY 1A
|
||||
#define B_TXT_EFF_ABILITY 1B
|
||||
#define B_TXT_TRAINER1_CLASS 1C
|
||||
#define B_TXT_TRAINER1_NAME 1D
|
||||
#define B_TXT_1E 1E // trainer name for a link player
|
||||
#define B_TXT_1F 1F // trainer name for a link player
|
||||
#define B_TXT_20 20 // trainer name for a link player
|
||||
#define B_TXT_21 21 // trainer name for a link player
|
||||
#define B_TXT_22 22 // trainer name for a link player
|
||||
#define B_TXT_PLAYER_NAME 23
|
||||
#define B_TXT_TRAINER1_LOSE_TEXT 24
|
||||
#define B_TXT_TRAINER1_WIN_TEXT 25
|
||||
#define B_TXT_26 26
|
||||
#define B_TXT_PC_CREATOR_NAME 27
|
||||
#define B_TXT_ATK_PREFIX1 28
|
||||
#define B_TXT_DEF_PREFIX1 29
|
||||
#define B_TXT_ATK_PREFIX2 2A
|
||||
#define B_TXT_DEF_PREFIX2 2B
|
||||
#define B_TXT_ATK_PREFIX3 2C
|
||||
#define B_TXT_DEF_PREFIX3 2D
|
||||
#define B_TXT_TRAINER2_CLASS 2E
|
||||
#define B_TXT_TRAINER2_NAME 2F
|
||||
#define B_TXT_TRAINER2_LOSE_TEXT 30
|
||||
#define B_TXT_TRAINER2_WIN_TEXT 31
|
||||
#define B_TXT_PARTNER_CLASS 32
|
||||
#define B_TXT_PARTNER_NAME 33
|
||||
#define B_TXT_BUFF3 34
|
||||
|
||||
// for B_TXT_BUFF1, B_TXT_BUFF2 and B_TXT_BUFF3
|
||||
|
||||
#define B_BUFF_STRING 0
|
||||
#define B_BUFF_NUMBER 1
|
||||
#define B_BUFF_MOVE 2
|
||||
#define B_BUFF_TYPE 3
|
||||
#define B_BUFF_MON_NICK_WITH_PREFIX 4
|
||||
#define B_BUFF_STAT 5
|
||||
#define B_BUFF_SPECIES 6
|
||||
#define B_BUFF_MON_NICK 7
|
||||
#define B_BUFF_NEGATIVE_FLAVOUR 8
|
||||
#define B_BUFF_ABILITY 9
|
||||
#define B_BUFF_ITEM 10
|
||||
|
||||
#define B_BUFF_PLACEHOLDER_BEGIN 0xFD
|
||||
#define B_BUFF_EOS 0xFF
|
||||
|
||||
#define PREPARE_STAT_BUFFER(textVar, statId) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_STAT; \
|
||||
textVar[2] = statId; \
|
||||
textVar[3] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_ABILITY_BUFFER(textVar, abilityId) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_ABILITY; \
|
||||
textVar[2] = abilityId; \
|
||||
textVar[3] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_TYPE_BUFFER(textVar, typeId) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_TYPE; \
|
||||
textVar[2] = typeId; \
|
||||
textVar[3] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_BYTE_NUMBER_BUFFER(textVar, maxDigits, number) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_NUMBER; \
|
||||
textVar[2] = 1; \
|
||||
textVar[3] = maxDigits; \
|
||||
textVar[4] = (number); \
|
||||
textVar[5] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_HWORD_NUMBER_BUFFER(textVar, maxDigits, number) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_NUMBER; \
|
||||
textVar[2] = 2; \
|
||||
textVar[3] = maxDigits; \
|
||||
textVar[4] = (number); \
|
||||
textVar[5] = (number & 0x0000FF00) >> 8; \
|
||||
textVar[6] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_WORD_NUMBER_BUFFER(textVar, maxDigits, number) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_NUMBER; \
|
||||
textVar[2] = 4; \
|
||||
textVar[3] = maxDigits; \
|
||||
textVar[4] = (number); \
|
||||
textVar[5] = (number & 0x0000FF00) >> 8; \
|
||||
textVar[6] = (number & 0x00FF0000) >> 16; \
|
||||
textVar[7] = (number & 0xFF000000) >> 24; \
|
||||
textVar[8] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_STRING_BUFFER(textVar, stringId) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_STRING; \
|
||||
textVar[2] = stringId; \
|
||||
textVar[3] = (stringId & 0xFF00) >> 8; \
|
||||
textVar[4] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_MOVE_BUFFER(textVar, move) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_MOVE; \
|
||||
textVar[2] = move; \
|
||||
textVar[3] = (move & 0xFF00) >> 8; \
|
||||
textVar[4] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_ITEM_BUFFER(textVar, item) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_ITEM; \
|
||||
textVar[2] = item; \
|
||||
textVar[3] = (item & 0xFF00) >> 8; \
|
||||
textVar[4] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_SPECIES_BUFFER(textVar, species) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_SPECIES; \
|
||||
textVar[2] = species; \
|
||||
textVar[3] = (species & 0xFF00) >> 8; \
|
||||
textVar[4] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_MON_NICK_WITH_PREFIX_BUFFER(textVar, bank, partyId) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_MON_NICK_WITH_PREFIX; \
|
||||
textVar[2] = bank; \
|
||||
textVar[3] = partyId; \
|
||||
textVar[4] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
#define PREPARE_MON_NICK_BUFFER(textVar, bank, partyId) \
|
||||
{ \
|
||||
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
|
||||
textVar[1] = B_BUFF_MON_NICK; \
|
||||
textVar[2] = bank; \
|
||||
textVar[3] = partyId; \
|
||||
textVar[4] = B_BUFF_EOS; \
|
||||
}
|
||||
|
||||
struct StringInfoBattle
|
||||
{
|
||||
u16 currentMove;
|
||||
@@ -17,12 +202,15 @@ struct StringInfoBattle
|
||||
};
|
||||
|
||||
void BufferStringBattle(u16 stringID);
|
||||
u32 StrCpyDecodeToDisplayedStringBattle(const u8* src);
|
||||
u32 StrCpyDecodeBattle(const u8* src, u8* dst);
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src);
|
||||
u32 BattleStringExpandPlaceholders(const u8* src, u8* dst);
|
||||
void sub_814F9EC(const u8* text, u8 arg1);
|
||||
|
||||
extern u8 gBattleTextBuff1[];
|
||||
extern u8 gBattleTextBuff2[];
|
||||
extern u8 gBattleTextBuff3[];
|
||||
extern u8 gDisplayedStringBattle[];
|
||||
|
||||
extern const u8* const gRefereeStringsTable[];
|
||||
|
||||
#endif // GUARD_BATTLE_MESSAGE_H
|
||||
|
||||
@@ -53,4 +53,11 @@ void ResetBerryTreeSparkleFlags(void);
|
||||
|
||||
extern const struct Berry gBerries[];
|
||||
|
||||
struct UnkStruct_0858AB24 {
|
||||
u8 unk0;
|
||||
u16 unk1;
|
||||
};
|
||||
|
||||
extern const struct UnkStruct_0858AB24 gUnknown_0858AB24[];
|
||||
|
||||
#endif // GUARD_BERRY_H
|
||||
|
||||
86
include/bg.h
86
include/bg.h
@@ -1,23 +1,75 @@
|
||||
#ifndef GUARD_bg_H
|
||||
#define GUARD_bg_H
|
||||
#ifndef GUARD_BG_H
|
||||
#define GUARD_BG_H
|
||||
|
||||
struct BgTemplate {
|
||||
u32 bg:2;
|
||||
u32 charBaseIndex:2;
|
||||
u32 mapBaseIndex:5;
|
||||
u32 screenSize:2;
|
||||
u32 paletteMode:1;
|
||||
u32 priority:2;
|
||||
enum
|
||||
{
|
||||
BG_CTRL_ATTR_VISIBLE = 1,
|
||||
BG_CTRL_ATTR_CHARBASEINDEX = 2,
|
||||
BG_CTRL_ATTR_MAPBASEINDEX = 3,
|
||||
BG_CTRL_ATTR_SCREENSIZE = 4,
|
||||
BG_CTRL_ATTR_PALETTEMODE = 5,
|
||||
BG_CTRL_ATTR_PRIORITY = 6,
|
||||
BG_CTRL_ATTR_MOSAIC = 7,
|
||||
BG_CTRL_ATTR_WRAPAROUND = 8,
|
||||
};
|
||||
|
||||
struct BgTemplate
|
||||
{
|
||||
u32 bg:2; // 0x1, 0x2 -> 0x3
|
||||
u32 charBaseIndex:2; // 0x4, 0x8 -> 0xC
|
||||
u32 mapBaseIndex:5; // 0x10, 0x20, 0x40, 0x80, 0x100 -> 0x1F0
|
||||
u32 screenSize:2; // 0x200, 0x400 -> 0x600
|
||||
u32 paletteMode:1; // 0x800
|
||||
u32 priority:2; // 0x1000, 0x2000 > 0x3000
|
||||
u32 baseTile:10;
|
||||
};
|
||||
|
||||
void ResetBgsAndClearDma3BusyFlags(u32);
|
||||
void InitBgsFromTemplates(u8, const struct BgTemplate *, u8);
|
||||
u32 ChangeBgX(u8, u32, u8);
|
||||
u32 ChangeBgY(u8, u32, u8);
|
||||
void ResetBgs(void);
|
||||
u8 GetBgMode(void);
|
||||
void ResetBgControlStructs(void);
|
||||
void Unused_ResetBgControlStruct(u8 bg);
|
||||
void SetBgControlAttributes(u8 bg, u8 charBaseIndex, u8 mapBaseIndex, u8 screenSize, u8 paletteMode, u8 priority, u8 mosaic, u8 wraparound);
|
||||
u16 GetBgControlAttribute(u8 bg, u8 attributeId);
|
||||
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode);
|
||||
void SetTextModeAndHideBgs(void);
|
||||
bool8 IsInvalidBg(u8 bg);
|
||||
int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4);
|
||||
void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable);
|
||||
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates);
|
||||
void InitBgFromTemplate(const struct BgTemplate *template);
|
||||
void SetBgMode(u8 bgMode);
|
||||
u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset);
|
||||
u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset);
|
||||
u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset);
|
||||
bool8 IsDma3ManagerBusyWithBgCopy(void);
|
||||
void ShowBg(u8 bg);
|
||||
void HideBg(u8 bg);
|
||||
void SetBgAttribute(u8 bg, u8 attributeId, u8 value);
|
||||
u16 GetBgAttribute(u8 bg, u8 attributeId);
|
||||
u32 ChangeBgX(u8 bg, u32 value, u8 op);
|
||||
u32 GetBgX(u8 bg);
|
||||
u32 ChangeBgY(u8 bg, u32 value, u8 op);
|
||||
u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op);
|
||||
u32 GetBgY(u8 bg);
|
||||
void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle);
|
||||
u8 Unused_AdjustBgMosaic(u8 a1, u8 a2);
|
||||
void SetBgTilemapBuffer(u8 bg, void *tilemap);
|
||||
void UnsetBgTilemapBuffer(u8 bg);
|
||||
void* GetBgTilemapBuffer(u8 bg);
|
||||
void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset);
|
||||
void CopyBgTilemapBufferToVram(u8 bg);
|
||||
void CopyToBgTilemapBufferRect(u8 bg, void* src, u8 destX, u8 destY, u8 width, u8 height);
|
||||
void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette);
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, 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 FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height);
|
||||
void ShowBg(u8);
|
||||
void HideBg(u8);
|
||||
void CopyBgTilemapBufferToVram(u8);
|
||||
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);
|
||||
u32 GetBgType(u8 bg);
|
||||
bool32 IsInvalidBg32(u8 bg);
|
||||
bool32 IsTileMapOutsideWram(u8 bg);
|
||||
|
||||
#endif //GUARD_bg_H
|
||||
#endif // GUARD_BG_H
|
||||
|
||||
6
include/calculate_base_damage.h
Normal file
6
include/calculate_base_damage.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_CALCULATE_BASE_DAMAGE_H
|
||||
#define GUARD_CALCULATE_BASE_DAMAGE_H
|
||||
|
||||
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef);
|
||||
|
||||
#endif // GUARD_CALCULATE_BASE_DAMAGE_H
|
||||
@@ -6,7 +6,7 @@ extern u8 gDma3RequestCursor;
|
||||
|
||||
struct DmaRequestsStruct
|
||||
{
|
||||
/* 0x00 */ u8 *src;
|
||||
/* 0x00 */ const u8 *src;
|
||||
/* 0x04 */ u8 *dest;
|
||||
/* 0x08 */ u16 size;
|
||||
/* 0x0A */ u16 mode;
|
||||
@@ -17,7 +17,8 @@ extern struct DmaRequestsStruct gDma3Requests[128];
|
||||
|
||||
void ClearDma3Requests(void);
|
||||
void ProcessDma3Requests(void);
|
||||
int RequestDma3Copy(void *src, void *dest, u16 size, u8 mode);
|
||||
int RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode);
|
||||
int RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode);
|
||||
int CheckForSpaceForDma3Request(s16 index);
|
||||
|
||||
#endif
|
||||
#endif // GUARD_DMA3_H
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
#define OAM 0x7000000
|
||||
#define OAM_SIZE 0x400
|
||||
|
||||
#define ROM_HEADER_SIZE 0xC0
|
||||
|
||||
#define DISPLAY_WIDTH 240
|
||||
#define DISPLAY_HEIGHT 160
|
||||
|
||||
|
||||
@@ -18,6 +18,14 @@ void memcpy(void *, const void *, size_t);
|
||||
|
||||
#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0]))
|
||||
|
||||
// useful math macros
|
||||
|
||||
// Converts a number to Q8.8 fixed-point format
|
||||
#define Q_8_8(n) ((s16)((n) * 256))
|
||||
|
||||
// Converts a number to Q4.12 fixed-point format
|
||||
#define Q_4_12(n) ((s16)((n) * 4096))
|
||||
|
||||
#define POKEMON_NAME_LENGTH 10
|
||||
#define OT_NAME_LENGTH 7
|
||||
|
||||
@@ -645,7 +653,8 @@ struct DaycareMon
|
||||
struct MailStruct mail;
|
||||
u8 OT_name[OT_NAME_LENGTH + 1];
|
||||
u8 monName[11];
|
||||
u8 language;
|
||||
u8 language_maybe : 4;
|
||||
u8 unknown : 4;
|
||||
u32 stepsTaken;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#ifndef GUARD_GPU_REGS_H
|
||||
#define GUARD_GPU_REGS_H
|
||||
|
||||
@@ -7,9 +6,14 @@
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void DisableInterrupts(u16);
|
||||
void EnableInterrupts(u16);
|
||||
void SetGpuReg(u8, u16);
|
||||
void InitGpuRegManager(void);
|
||||
void CopyBufferedValuesToGpuRegs(void);
|
||||
void SetGpuReg(u8 regOffset, u16 value);
|
||||
void SetGpuReg_ForcedBlank(u8 regOffset, u16 value);
|
||||
u16 GetGpuReg(u8 regOffset);
|
||||
void SetGpuRegBits(u8 regOffset, u16 mask);
|
||||
void ClearGpuRegBits(u8 regOffset, u16 mask);
|
||||
void EnableInterrupts(u16 mask);
|
||||
void DisableInterrupts(u16 mask);
|
||||
|
||||
#endif //GUARD_GPU_REGS_H
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "gba/m4a_internal.h"
|
||||
|
||||
void m4aSoundVSync(void);
|
||||
void m4aSoundVSyncOn(void);
|
||||
|
||||
void m4aSoundInit(void);
|
||||
void m4aSoundMain(void);
|
||||
|
||||
19
include/mail.h
Normal file
19
include/mail.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef GUARD_MAIL_H
|
||||
#define GUARD_MAIL_H
|
||||
|
||||
#include "items.h"
|
||||
|
||||
#define IS_ITEM_MAIL(itemId)((itemId == ITEM_ORANGE_MAIL \
|
||||
|| itemId == ITEM_HARBOR_MAIL \
|
||||
|| itemId == ITEM_GLITTER_MAIL \
|
||||
|| itemId == ITEM_MECH_MAIL \
|
||||
|| itemId == ITEM_WOOD_MAIL \
|
||||
|| itemId == ITEM_WAVE_MAIL \
|
||||
|| itemId == ITEM_BEAD_MAIL \
|
||||
|| itemId == ITEM_SHADOW_MAIL \
|
||||
|| itemId == ITEM_TROPIC_MAIL \
|
||||
|| itemId == ITEM_DREAM_MAIL \
|
||||
|| itemId == ITEM_FAB_MAIL \
|
||||
|| itemId == ITEM_RETRO_MAIL))
|
||||
|
||||
#endif // GUARD_MAIL_H
|
||||
1342
include/map_constants.h
Normal file
1342
include/map_constants.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_MENU_H
|
||||
#define GUARD_MENU_H
|
||||
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
|
||||
struct MenuAction
|
||||
{
|
||||
@@ -16,5 +16,8 @@ struct MenuAction2
|
||||
};
|
||||
|
||||
void box_print(u8, u8, u8, u8, const void *, s8, const u8 *);
|
||||
void sub_8198070(u8 windowId, bool8 copyToVram);
|
||||
void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock);
|
||||
void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette);
|
||||
|
||||
#endif // GUARD_MENU_H
|
||||
|
||||
@@ -1,11 +1,149 @@
|
||||
#ifndef GUARD_METATILE_BEHAVIOR_H
|
||||
#define GUARD_METATILE_BEHAVIOR_H
|
||||
#ifndef GUARD_METATILE_BEHAVIOR
|
||||
#define GUARD_METATILE_BEHAVIOR
|
||||
|
||||
// Exported type declarations
|
||||
bool8 ShouldDoJumpLandingDustEffect(u8);
|
||||
bool8 MetatileBehavior_IsEncounterTile(u8);
|
||||
bool8 MetatileBehavior_IsJumpEast(u8);
|
||||
bool8 MetatileBehavior_IsJumpWest(u8);
|
||||
bool8 MetatileBehavior_IsJumpNorth(u8);
|
||||
bool8 MetatileBehavior_IsJumpSouth(u8);
|
||||
bool8 MetatileBehavior_IsPokeGrass(u8);
|
||||
bool8 MetatileBehavior_IsSandOrDeepSand(u8);
|
||||
bool8 MetatileBehavior_IsDeepSand(u8);
|
||||
bool8 MetatileBehavior_IsReflective(u8);
|
||||
bool8 MetatileBehavior_IsIce(u8);
|
||||
bool8 MetatileBehavior_IsWarpDoor(u8);
|
||||
bool8 MetatileBehavior_IsDoor(u8);
|
||||
bool8 MetatileBehavior_IsEscalator(u8);
|
||||
bool8 MetatileBehavior_IsMB_04(u8);
|
||||
bool8 MetatileBehavior_IsLadder(u8);
|
||||
bool8 MetatileBehavior_IsNonAnimDoor(u8);
|
||||
bool8 MetatileBehavior_IsDeepSouthWarp(u8);
|
||||
bool8 MetatileBehavior_IsSurfableWaterOrUnderwater(u8);
|
||||
bool8 MetatileBehavior_IsEastArrowWarp(u8);
|
||||
bool8 MetatileBehavior_IsWestArrowWarp(u8);
|
||||
bool8 MetatileBehavior_IsNorthArrowWarp(u8);
|
||||
bool8 MetatileBehavior_IsSouthArrowWarp(u8);
|
||||
bool8 MetatileBehavior_IsArrowWarp(u8);
|
||||
bool8 MetatileBehavior_IsMoveTile(u8);
|
||||
bool8 MetatileBehavior_IsIce_2(u8);
|
||||
bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8);
|
||||
bool8 MetatileBehavior_IsMB_05(u8);
|
||||
bool8 MetatileBehavior_IsWalkNorth(u8);
|
||||
bool8 MetatileBehavior_IsWalkSouth(u8);
|
||||
bool8 MetatileBehavior_IsWalkWest(u8);
|
||||
bool8 MetatileBehavior_IsWalkEast(u8);
|
||||
bool8 MetatileBehavior_IsNorthwardCurrent(u8);
|
||||
bool8 MetatileBehavior_IsSouthwardCurrent(u8);
|
||||
bool8 MetatileBehavior_IsWestwardCurrent(u8);
|
||||
bool8 MetatileBehavior_IsEastwardCurrent(u8);
|
||||
bool8 MetatileBehavior_IsSlideNorth(u8);
|
||||
bool8 MetatileBehavior_IsSlideSouth(u8);
|
||||
bool8 MetatileBehavior_IsSlideWest(u8);
|
||||
bool8 MetatileBehavior_IsSlideEast(u8);
|
||||
bool8 MetatileBehavior_IsCounter(u8);
|
||||
bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 tile, u8 playerDir);
|
||||
bool8 MetatileBehavior_IsPC(u8);
|
||||
bool8 MetatileBehavior_IsCableBoxResults1(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseOpen(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseCave(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseTree(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseShrub(u8);
|
||||
bool8 MetatileBehavior_IsSecretBasePC(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseRegisterPC(u8);
|
||||
bool8 MetatileBehavior_IsMB_B2(u8);
|
||||
bool8 MetatileBehavior_IsMB_B3(u8);
|
||||
bool8 MetatileBehavior_IsMB_B9(u8);
|
||||
bool8 MetatileBehavior_IsMB_C6(u8);
|
||||
bool8 MetatileBehavior_IsSecretBasePoster(u8);
|
||||
bool8 MetatileBehavior_IsNormal(u8);
|
||||
bool8 MetatileBehavior_IsMB_B7(u8);
|
||||
bool8 MetatileBehavior_IsMB_B2_Duplicate(u8);
|
||||
bool8 MetatileBehavior_IsMB_B5(u8);
|
||||
bool8 MetatileBehavior_IsMB_C3(u8);
|
||||
bool8 MetatileBehavior_IsMB_C2(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseBalloon(u8);
|
||||
bool8 MetatileBehavior_IsMB_BE(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseSoundMat(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseGlitterMat(u8);
|
||||
bool8 MetatileBehavior_IsMB_BF(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseTvOrShield(u8);
|
||||
bool8 MetatileBehavior_IsMB_C5(u8);
|
||||
bool8 MetatileBehavior_HasRipples(u8);
|
||||
bool8 MetatileBehavior_IsPuddle(u8);
|
||||
bool8 MetatileBehavior_IsTallGrass(u8);
|
||||
bool8 MetatileBehavior_IsLongGrass(u8);
|
||||
bool8 MetatileBehavior_IsBerryTreeSoil(u8);
|
||||
bool8 MetatileBehavior_IsAsh(u8);
|
||||
bool8 MetatileBehavior_IsUnusedFootprintMetatile(u8);
|
||||
bool8 MetatileBehavior_IsBridge(u8);
|
||||
u8 MetatileBehavior_GetBridgeSth(u8);
|
||||
u8 MetatileBehavior_8089510(u8);
|
||||
bool8 MetatileBehavior_IsLandWildEncounter(u8);
|
||||
bool8 MetatileBehavior_IsWaterWildEncounter(u8);
|
||||
bool8 MetatileBehavior_IsMB_0B(u8);
|
||||
bool8 MetatileBehavior_IsMountain(u8);
|
||||
bool8 MetatileBehavior_IsDiveable(u8);
|
||||
bool8 MetatileBehavior_IsUnableToEmerge(u8);
|
||||
bool8 MetatileBehavior_IsShallowFlowingWater(u8);
|
||||
bool8 MetatileBehavior_IsThinIce(u8);
|
||||
bool8 MetatileBehavior_IsCrackedIce(u8);
|
||||
bool8 MetatileBehavior_IsDeepOrOceanWater(u8);
|
||||
bool8 MetatileBehavior_IsMB_18_OrMB_1A(u8);
|
||||
bool8 MetatileBehavior_IsSurfableAndNotWaterfall(u8);
|
||||
bool8 MetatileBehavior_IsEastBlocked(u8);
|
||||
bool8 MetatileBehavior_IsWestBlocked(u8);
|
||||
bool8 MetatileBehavior_IsNorthBlocked(u8);
|
||||
bool8 MetatileBehavior_IsSouthBlocked(u8);
|
||||
bool8 MetatileBehavior_IsShortGrass(u8);
|
||||
bool8 MetatileBehavior_IsHotSprings(u8);
|
||||
bool8 MetatileBehavior_IsWaterfall(u8);
|
||||
bool8 MetatileBehavior_IsFortreeBridge(u8);
|
||||
bool8 MetatileBehavior_IsPacifilogVerticalLog1(u8);
|
||||
bool8 MetatileBehavior_IsPacifilogVerticalLog2(u8);
|
||||
bool8 MetatileBehavior_IsPacifilogHorizontalLog1(u8);
|
||||
bool8 MetatileBehavior_IsPacifilogHorizontalLog2(u8);
|
||||
bool8 MetatileBehavior_IsPacifidlogLog(u8);
|
||||
bool8 MetatileBehavior_IsTrickHousePuzzleDoor(u8);
|
||||
bool8 MetatileBehavior_IsRegionMap(u8);
|
||||
bool8 MetatileBehavior_IsClosedSootopolisGymDoor(u8);
|
||||
bool8 MetatileBehavior_IsUnknownClosedDoor(u8);
|
||||
bool8 MetatileBehavior_IsRoulette(u8);
|
||||
bool8 MetatileBehavior_IsPokeblockFeeder(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseJumpMat(u8);
|
||||
bool8 MetatileBehavior_IsSecretBaseSpinMat(u8);
|
||||
bool8 MetatileBehavior_IsLavaridgeB1FWarp(u8);
|
||||
bool8 MetatileBehavior_IsLavaridgeB1FWarp(u8);
|
||||
bool8 MetatileBehavior_IsAquaHideoutWarp(u8);
|
||||
bool8 MetatileBehavior_IsWarpOrBridge(u8);
|
||||
bool8 MetatileBehavior_IsMossdeepGymWarp(u8);
|
||||
bool8 MetatileBehavior_IsSurfableFishableWater(u8);
|
||||
bool8 MetatileBehavior_IsMtPyreHole(u8);
|
||||
bool8 MetatileBehavior_IsCrackedFloorHole(u8);
|
||||
bool8 MetatileBehavior_IsCrackedFloor(u8);
|
||||
bool8 MetatileBehavior_IsMuddySlope(u8);
|
||||
bool8 MetatileBehavior_IsBumpySlope(u8);
|
||||
bool8 MetatileBehavior_IsIsolatedVerticalRail(u8);
|
||||
bool8 MetatileBehavior_IsIsolatedHorizontalRail(u8);
|
||||
bool8 MetatileBehavior_IsVerticalRail(u8);
|
||||
bool8 MetatileBehavior_IsHorizontalRail(u8);
|
||||
bool8 MetatileBehavior_IsSeaweed(u8);
|
||||
bool8 MetatileBehavior_IsRunningDisallowed(u8);
|
||||
bool8 MetatileBehavior_IsCuttableGrass(u8);
|
||||
bool8 MetatileBehavior_IsRunningShoesInstruction(u8);
|
||||
bool8 MetatileBehavior_IsPictureBookShelf(u8);
|
||||
bool8 MetatileBehavior_IsBookShelf(u8);
|
||||
bool8 MetatileBehavior_IsPokeCenterBookShelf(u8);
|
||||
bool8 MetatileBehavior_IsVase(u8);
|
||||
bool8 MetatileBehavior_IsTrashCan(u8);
|
||||
bool8 MetatileBehavior_IsShopShelf(u8);
|
||||
bool8 MetatileBehavior_IsBlueprint(u8);
|
||||
bool8 MetatileBehavior_IsBattlePyramidWarp(u8);
|
||||
bool8 MetatileBehavior_IsPlayerFacingWirelessBoxResults(u8 tile, u8 playerDir);
|
||||
bool8 MetatileBehavior_IsCableBoxResults2(u8 tile, u8 playerDir);
|
||||
bool8 MetatileBehavior_IsQuestionnaire(u8);
|
||||
bool8 MetatileBehavior_IsLongGrass_Duplicate(u8);
|
||||
bool8 MetatileBehavior_IsLongGrassSouthEdge(u8);
|
||||
bool8 MetatileBehavior_IsTrainerHillTimer(u8);
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
bool8 sub_8088E64(u8);
|
||||
|
||||
#endif //GUARD_METATILE_BEHAVIOR_H
|
||||
#endif // GUARD_METATILE_BEHAVIOR
|
||||
|
||||
179
include/metatile_behaviors.h
Normal file
179
include/metatile_behaviors.h
Normal file
@@ -0,0 +1,179 @@
|
||||
#ifndef GUARD_METATILE_BEHAVIORS
|
||||
#define GUARD_METATILE_BEHAVIORS
|
||||
|
||||
#define MB_NORMAL 0x00
|
||||
#define MB_TALL_GRASS 0x02
|
||||
#define MB_LONG_GRASS 0x03
|
||||
#define MB_04 0x04
|
||||
#define MB_05 0x05
|
||||
#define MB_DEEP_SAND 0x06
|
||||
#define MB_SHORT_GRASS 0x07
|
||||
#define MB_CAVE 0x08
|
||||
#define MB_LONG_GRASS_SOUTH_EDGE 0x09
|
||||
#define MB_NO_RUNNING 0x0A
|
||||
#define MB_0B 0x0B
|
||||
#define MB_MOUNTAIN_TOP 0x0C
|
||||
#define MB_BATTLE_PYRAMID_WARP 0x0D
|
||||
#define MB_MOSSDEEP_GYM_WARP 0x0E
|
||||
#define MB_MT_PYRE_HOLE 0x0F
|
||||
#define MB_POND_WATER 0x10
|
||||
#define MB_SEMI_DEEP_WATER 0x11
|
||||
#define MB_DEEP_WATER 0x12
|
||||
#define MB_WATERFALL 0x13
|
||||
#define MB_SOOTOPOLIS_DEEP_WATER 0x14
|
||||
#define MB_OCEAN_WATER 0x15
|
||||
#define MB_PUDDLE 0x16
|
||||
#define MB_SHALLOW_WATER 0x17
|
||||
#define MB_18 0x18
|
||||
#define MB_NO_SURFACING 0x19
|
||||
#define MB_1A 0x1A
|
||||
#define MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B
|
||||
#define MB_SHOAL_CAVE_ENTRANCE 0x1C
|
||||
#define MB_ICE 0x20
|
||||
#define MB_SAND 0x21
|
||||
#define MB_SEAWEED 0x22
|
||||
#define MB_ASHGRASS 0x24
|
||||
#define MB_25 0x25
|
||||
#define MB_THIN_ICE 0x26
|
||||
#define MB_CRACKED_ICE 0x27
|
||||
#define MB_HOT_SPRINGS 0x28
|
||||
#define MB_LAVARIDGE_GYM_B1F_WARP 0x29
|
||||
#define MB_SEAWEED_NO_SURFACING 0x2A
|
||||
#define MB_REFLECTION_UNDER_BRIDGE 0x2B
|
||||
#define MB_IMPASSABLE_EAST 0x30
|
||||
#define MB_IMPASSABLE_WEST 0x31
|
||||
#define MB_IMPASSABLE_NORTH 0x32
|
||||
#define MB_IMPASSABLE_SOUTH 0x33
|
||||
#define MB_IMPASSABLE_NORTHEAST 0x34
|
||||
#define MB_IMPASSABLE_NORTHWEST 0x35
|
||||
#define MB_IMPASSABLE_SOUTHEAST 0x36
|
||||
#define MB_IMPASSABLE_SOUTHWEST 0x37
|
||||
#define MB_JUMP_EAST 0x38
|
||||
#define MB_JUMP_WEST 0x39
|
||||
#define MB_JUMP_NORTH 0x3A
|
||||
#define MB_JUMP_SOUTH 0x3B
|
||||
#define MB_JUMP_SOUTHEAST 0x3E
|
||||
#define MB_JUMP_SOUTHWEST 0x3F
|
||||
#define MB_WALK_EAST 0x40
|
||||
#define MB_WALK_WEST 0x41
|
||||
#define MB_WALK_NORTH 0x42
|
||||
#define MB_WALK_SOUTH 0x43
|
||||
#define MB_SLIDE_EAST 0x44
|
||||
#define MB_SLIDE_WEST 0x45
|
||||
#define MB_SLIDE_NORTH 0x46
|
||||
#define MB_SLIDE_SOUTH 0x47
|
||||
#define MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48
|
||||
#define MB_EASTWARD_CURRENT 0x50
|
||||
#define MB_WESTWARD_CURRENT 0x51
|
||||
#define MB_NORTHWARD_CURRENT 0x52
|
||||
#define MB_SOUTHWARD_CURRENT 0x53
|
||||
#define MB_NON_ANIMATED_DOOR 0x60
|
||||
#define MB_LADDER 0x61
|
||||
#define MB_EAST_ARROW_WARP 0x62
|
||||
#define MB_WEST_ARROW_WARP 0x63
|
||||
#define MB_NORTH_ARROW_WARP 0x64
|
||||
#define MB_SOUTH_ARROW_WARP 0x65
|
||||
#define MB_CRACKED_FLOOR_HOLE 0x66
|
||||
#define MB_AQUA_HIDEOUT_WARP 0x67
|
||||
#define MB_LAVARIDGE_GYM_1F_WARP 0x68
|
||||
#define MB_ANIMATED_DOOR 0x69
|
||||
#define MB_UP_ESCALATOR 0x6A
|
||||
#define MB_DOWN_ESCALATOR 0x6B
|
||||
#define MB_WATER_DOOR 0x6C
|
||||
#define MB_WATER_SOUTH_ARROW_WARP 0x6D
|
||||
#define MB_DEEP_SOUTH_WARP 0x6E
|
||||
#define MB_WARP_OR_BRIDGE 0x70
|
||||
#define MB_71 0x71
|
||||
#define MB_ROUTE120_NORTH_BRIDGE_1 0x72
|
||||
#define MB_ROUTE120_NORTH_BRIDGE_2 0x73
|
||||
#define MB_PACIFIDLOG_VERTICAL_LOG_1 0x74
|
||||
#define MB_PACIFIDLOG_VERTICAL_LOG_2 0x75
|
||||
#define MB_PACIFIDLOG_HORIZONTAL_LOG_1 0x76
|
||||
#define MB_PACIFIDLOG_HORIZONTAL_LOG_2 0x77
|
||||
#define MB_FORTREE_BRIDGE 0x78
|
||||
#define MB_ROUTE120_SOUTH_BRIDGE_1 0x7A
|
||||
#define MB_ROUTE120_SOUTH_BRIDGE_2 0x7B
|
||||
#define MB_ROUTE120_NORTH_BRIDGE_3 0x7C
|
||||
#define MB_ROUTE120_NORTH_BRIDGE_4 0x7D
|
||||
#define MB_7E 0x7E
|
||||
#define MB_ROUTE110_BRIDGE 0x7F
|
||||
#define MB_COUNTER 0x80
|
||||
#define MB_PC 0x83
|
||||
#define MB_CABLE_BOX_RESULTS_1 0x84
|
||||
#define MB_REGION_MAP 0x85
|
||||
#define MB_TELEVISION 0x86
|
||||
#define MB_POKEBLOCK_FEEDER 0x87
|
||||
#define MB_SLOT_MACHINE 0x89
|
||||
#define MB_ROULETTE 0x8A
|
||||
#define MB_CLOSED_SOOTOPOLIS_GYM_DOOR 0x8B
|
||||
#define MB_TRICK_HOUSE_PUZZLE_DOOR 0x8C
|
||||
#define MB_8D 0x8D
|
||||
#define MB_RUNNING_SHOES_INSTRUCTION 0x8E
|
||||
#define MB_QUESTIONNAIRE 0x8F
|
||||
#define MB_SECRET_BASE_SPOT_RED_CAVE 0x90
|
||||
#define MB_SECRET_BASE_SPOT_RED_CAVE_OPEN 0x91
|
||||
#define MB_SECRET_BASE_SPOT_BROWN_CAVE 0x92
|
||||
#define MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN 0x93
|
||||
#define MB_SECRET_BASE_SPOT_YELLOW_CAVE 0x94
|
||||
#define MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN 0x95
|
||||
#define MB_SECRET_BASE_SPOT_TREE_LEFT 0x96
|
||||
#define MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN 0x97
|
||||
#define MB_SECRET_BASE_SPOT_SHRUB 0x98
|
||||
#define MB_SECRET_BASE_SPOT_SHRUB_OPEN 0x99
|
||||
#define MB_SECRET_BASE_SPOT_BLUE_CAVE 0x9A
|
||||
#define MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN 0x9B
|
||||
#define MB_SECRET_BASE_SPOT_TREE_RIGHT 0x9C
|
||||
#define MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN 0x9D
|
||||
#define MB_BERRY_TREE_SOIL 0xA0
|
||||
#define MB_SECRET_BASE_PC 0xB0
|
||||
#define MB_SECRET_BASE_REGISTER_PC 0xB1
|
||||
#define MB_B2 0xB2
|
||||
#define MB_B3 0xB3
|
||||
#define MB_B4 0xB4
|
||||
#define MB_B5 0xB5
|
||||
#define MB_B6 0xB6
|
||||
#define MB_B7 0xB7
|
||||
#define MB_SECRET_BASE_BALLOON 0xB8
|
||||
#define MB_B9 0xB9
|
||||
#define MB_SECRET_BASE_GLITTER_MAT 0xBA
|
||||
#define MB_SECRET_BASE_JUMP_MAT 0xBB
|
||||
#define MB_SECRET_BASE_SPIN_MAT 0xBC
|
||||
#define MB_SECRET_BASE_SOUND_MAT 0xBD
|
||||
#define MB_BE 0xBE
|
||||
#define MB_BF 0xBF
|
||||
#define MB_BED 0xC0
|
||||
#define MB_C1 0xC1
|
||||
#define MB_C2 0xC2
|
||||
#define MB_C3 0xC3
|
||||
#define MB_SECRET_BASE_TV_SHIELD 0xC4
|
||||
#define MB_C5 0xC5
|
||||
#define MB_C6 0xC6
|
||||
#define MB_SECRET_BASE_POSTER 0xC7
|
||||
#define MB_C8 0xC8
|
||||
#define MB_C9 0xC9
|
||||
#define MB_CA 0xCA
|
||||
#define MB_CB 0xCB
|
||||
#define MB_CC 0xCC
|
||||
#define MB_CD 0xCD
|
||||
#define MB_CE 0xCE
|
||||
#define MB_CF 0xCF
|
||||
#define MB_MUDDY_SLOPE 0xD0
|
||||
#define MB_BUMPY_SLOPE 0xD1
|
||||
#define MB_CRACKED_FLOOR 0xD2
|
||||
#define MB_ISOLATED_VERTICAL_RAIL 0xD3
|
||||
#define MB_ISOLATED_HORIZONTAL_RAIL 0xD4
|
||||
#define MB_VERTICAL_RAIL 0xD5
|
||||
#define MB_HORIZONTAL_RAIL 0xD6
|
||||
#define MB_PICTURE_BOOK_SHELF 0xE0
|
||||
#define MB_BOOKSHELF 0xE1
|
||||
#define MB_POKEMON_CENTER_BOOKSHELF 0xE2
|
||||
#define MB_VASE 0xE3
|
||||
#define MB_TRASH_CAN 0xE4
|
||||
#define MB_SHOP_SHELF 0xE5
|
||||
#define MB_BLUEPRINT 0xE6
|
||||
#define MB_CABLE_BOX_RESULTS_2 0xE7
|
||||
#define MB_WIRELESS_BOX_RESULTS 0xE8
|
||||
#define MB_TRAINER_HILL_TIMER 0xE9
|
||||
#define MB_UNKNOWN_CLOSED_DOOR 0xEA
|
||||
|
||||
#endif // GUARD_METATILE_BEHAVIORS
|
||||
@@ -6,5 +6,15 @@ void SetMoney(u32* moneyPtr, u32 newValue);
|
||||
bool8 IsEnoughMoney(u32* moneyPtr, u32 cost);
|
||||
void AddMoney(u32* moneyPtr, u32 toAdd);
|
||||
void SubtractMoney(u32* moneyPtr, u32 toSub);
|
||||
bool8 IsEnoughForCostInVar0x8005(void);
|
||||
void SubtractMoneyFromVar0x8005(void);
|
||||
void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed);
|
||||
void PrintMoneyAmount(u8 windowId, u8 x, u8 y, int amount, u8 speed);
|
||||
void PrintMoneyAmountInMoneyBoxWithBorder(u8 windowId, u16 tileStart, u8 pallete, int amount);
|
||||
void ChangeAmountInMoneyBox(int amount);
|
||||
void DrawMoneyBox(int amount, u8 x, u8 y);
|
||||
void HideMoneyBox(void);
|
||||
void AddMoneyLabelObject(u16 x, u16 y);
|
||||
void RemoveMoneyLabelObject(void);
|
||||
|
||||
#endif // GUARD_MONEY_H
|
||||
|
||||
@@ -360,4 +360,6 @@ enum
|
||||
MOVE_PSYCHO_BOOST,
|
||||
};
|
||||
|
||||
#endif // GUARD_MOVES_H
|
||||
#define LAST_MOVE_INDEX MOVE_PSYCHO_BOOST
|
||||
|
||||
#endif // GUARD_MOVES_H
|
||||
|
||||
12
include/naming_screen.h
Normal file
12
include/naming_screen.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef GUARD_NAMING_SCREEN_H
|
||||
#define GUARD_NAMING_SCREEN_H
|
||||
|
||||
#define NAMING_SCREEN_PLAYER 0
|
||||
#define NAMING_SCREEN_BOX 1
|
||||
#define NAMING_SCREEN_CAUGHT_MON 2
|
||||
#define NAMING_SCREEN_3 3
|
||||
#define NAMING_SCREEN_WANDA 4
|
||||
|
||||
void DoNamingScreen(u8 caseId, u8* dst, u16 monSpecies, u8 monGender, u32 monPersonality, void (*callback)(void));
|
||||
|
||||
#endif // GUARD_NAMING_SCREEN_H
|
||||
@@ -6,6 +6,7 @@ const u8 *GetPokemonCategory(u16);
|
||||
u16 GetPokedexHeightWeight(u16 dexNum, u8 data);
|
||||
u16 GetNationalPokedexCount(u8);
|
||||
u16 GetHoennPokedexCount(u8);
|
||||
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -126,6 +126,8 @@
|
||||
#define TYPE_DRAGON 0x10
|
||||
#define TYPE_DARK 0x11
|
||||
|
||||
#define NUMBER_OF_MON_TYPES 0x12
|
||||
|
||||
#define PARTY_SIZE 6
|
||||
#define MAX_TOTAL_EVS 510
|
||||
#define NUM_STATS 6
|
||||
@@ -333,6 +335,8 @@ struct UnknownPokemonStruct
|
||||
u8 friendship;
|
||||
};
|
||||
|
||||
#define BATTLE_STATS_NO 8
|
||||
|
||||
struct BattlePokemon
|
||||
{
|
||||
/*0x00*/ u16 species;
|
||||
@@ -350,7 +354,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;
|
||||
@@ -443,6 +447,7 @@ struct BattleMove
|
||||
#define FLAG_PROTECT_AFFECTED 0x2
|
||||
#define FLAG_MAGICCOAT_AFFECTED 0x4
|
||||
#define FLAG_SNATCH_AFFECTED 0x8
|
||||
#define FLAG_MIRROR_MOVE_AFFECTED 0x10
|
||||
#define FLAG_KINGSROCK_AFFECTED 0x20
|
||||
|
||||
struct SpindaSpot
|
||||
@@ -520,6 +525,7 @@ extern struct PokemonStorage* gPokemonStoragePtr;
|
||||
extern const u32 gExperienceTables[][MAX_MON_LEVEL + 1];
|
||||
extern const u16 *const gLevelUpLearnsets[];
|
||||
|
||||
u8 CountAliveMonsInBattle(u8 caseId);
|
||||
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
|
||||
#define BATTLE_ALIVE_ATK_SIDE 1
|
||||
#define BATTLE_ALIVE_DEF_SIDE 2
|
||||
@@ -620,4 +626,15 @@ bool8 IsPokeSpriteNotFlipped(u16 species);
|
||||
bool8 IsMonShiny(struct Pokemon *mon);
|
||||
bool8 IsShinyOtIdPersonality(u32 otId, u32 personality);
|
||||
|
||||
void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies);
|
||||
bool8 IsTradedMon(struct Pokemon *mon);
|
||||
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
|
||||
s32 sub_806D864(u16 a1);
|
||||
bool16 sub_806D82C(u8 id);
|
||||
u16 MonTryLearningNewMove(struct Pokemon* mon, bool8);
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
||||
7
include/pokemon_icon.h
Normal file
7
include/pokemon_icon.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef GUARD_POKEMON_ICON_H
|
||||
#define GUARD_POKEMON_ICON_H
|
||||
|
||||
const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo);
|
||||
const u16 *GetValidMonIconPalettePtr(u16 speciesId);
|
||||
|
||||
#endif // GUARD_POKEMON_ICON_H
|
||||
8
include/pokemon_item_effects.h
Normal file
8
include/pokemon_item_effects.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef GUARD_POKEMON_ITEM_EFFECTS
|
||||
#define GUARD_POKEMON_ITEM_EFFECTS
|
||||
|
||||
#include "pokemon.h"
|
||||
|
||||
bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 itemId, u8 partyId, u8 monMoveIndex, u8 a5);
|
||||
|
||||
#endif // GUARD_POKEMON_ITEM_EFFECTS
|
||||
6
include/pokemon_storage_system.h
Normal file
6
include/pokemon_storage_system.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
#define GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
|
||||
u8* GetBoxNamePtr(u8 boxNumber);
|
||||
|
||||
#endif // GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
6
include/recorded_battle.h
Normal file
6
include/recorded_battle.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_RECORDED_BATTLE_H
|
||||
#define GUARD_RECORDED_BATTLE_H
|
||||
|
||||
void RecordedBattle_SetBankAction(u8 bank, u8 action);
|
||||
|
||||
#endif // GUARD_RECORDED_BATTLE_H
|
||||
6
include/reshow_battle_screen.h
Normal file
6
include/reshow_battle_screen.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_RESHOW_BATTLE_SCREEN_H
|
||||
#define GUARD_RESHOW_BATTLE_SCREEN_H
|
||||
|
||||
void ReshowBattleScreenAfterMenu(void);
|
||||
|
||||
#endif // GUARD_RESHOW_BATTLE_SCREEN_H
|
||||
@@ -3,9 +3,15 @@
|
||||
|
||||
void ClearRoamerData(void);
|
||||
void ClearRoamerLocationData(void);
|
||||
void InitRoamer(void);
|
||||
void UpdateLocationHistoryForRoamer(void);
|
||||
void RoamerMoveToOtherLocationSet(void);
|
||||
void RoamerMove();
|
||||
void RoamerMove(void);
|
||||
bool8 IsRoamerAt(u8 mapGroup, u8 mapNum);
|
||||
void CreateRoamerMonInstance(void);
|
||||
u8 TryStartRoamerEncounter(void);
|
||||
void UpdateRoamerHPStatus(struct Pokemon *mon);
|
||||
void SetRoamerInactive(void);
|
||||
void GetRoamerLocation(u8 *mapGroup, u8 *mapNum);
|
||||
|
||||
#endif // GUARD_ROAMER_H
|
||||
|
||||
@@ -15,8 +15,8 @@ enum
|
||||
/*0x09*/ SE_KAIDAN,
|
||||
/*0x0A*/ SE_DANSA,
|
||||
/*0x0B*/ SE_JITENSYA,
|
||||
/*0x0C*/ SE_KOUKA_L,
|
||||
/*0x0D*/ SE_KOUKA_M,
|
||||
/*0x0C*/ SE_KOUKA_L, // Goggle told me Kouka means 'effectiveness' which makes sense, because
|
||||
/*0x0D*/ SE_KOUKA_M, // those three sounds play whenever you use a move
|
||||
/*0x0E*/ SE_KOUKA_H,
|
||||
/*0x0F*/ SE_BOWA2,
|
||||
/*0x10*/ SE_POKE_DEAD,
|
||||
@@ -359,7 +359,24 @@ enum
|
||||
BGM_DAIGO,
|
||||
BGM_THANKFOR,
|
||||
BGM_END,
|
||||
BGM_BATTLE27, // wild
|
||||
/*0x1C9*/ BGM_BATTLE_FRONTIER, // human-readable names start here because we don't know the actual filenames
|
||||
BGM_BATTLE_ARENA,
|
||||
BGM_ME_BATTLE_POINTS, // ME_ as in messagebox? Used for KINOMI (berries) and stuff above
|
||||
BGM_ME_MATCH_CALL,
|
||||
BGM_BATTLE_PYRAMID,
|
||||
BGM_BATTLE_PYRAMID_SUMMIT,
|
||||
BGM_BATTLE_PALACE,
|
||||
BGM_FANFA_RAYQUAZA,
|
||||
BGM_BATTLE_TOWER,
|
||||
BGM_ME_BATTLE_SYMBOL,
|
||||
BGM_BATTLE_DOME_TOURNAMENT,
|
||||
BGM_BATTLE_PIKE,
|
||||
BGM_BATTLE_FACTORY,
|
||||
BGM_BATTLE_LEGENDARY,
|
||||
BGM_BATTLE_FRONTIER_BRAIN,
|
||||
BGM_BATTLE_MEW,
|
||||
BGM_BATTLE_DOME, // end of the human-readable names
|
||||
/*0x1DA*/ BGM_BATTLE27, // wild
|
||||
BGM_BATTLE31, // aqua/magma grunt
|
||||
BGM_BATTLE20, // trainer
|
||||
BGM_BATTLE32, // gym leader
|
||||
@@ -369,6 +386,81 @@ enum
|
||||
BGM_BATTLE35, // rival
|
||||
BGM_BATTLE38, // elite four
|
||||
BGM_BATTLE30, // aqua/magma leader
|
||||
/*0x1E4*/ BGM_FRLG_FOLLOW_ME, // FR/LG names not known, human-readable again!
|
||||
BGM_FRLG_GAMECORNER,
|
||||
BGM_FRLG_ROCKET_HIDEOUT,
|
||||
BGM_FRLG_GYM,
|
||||
BGM_FRLG_JIGGLYPUFF,
|
||||
BGM_FRLG_OPENING,
|
||||
BGM_FRLG_TITLE,
|
||||
BGM_FRLG_CINNABAR_ISLAND,
|
||||
BGM_FRLG_LAVENDER_TOWN,
|
||||
BGM_FRLG_HEALING_TEST,
|
||||
BGM_FRLG_BICYCLE,
|
||||
BGM_FRLG_SUSPICIOUS_EYE,
|
||||
BGM_FRLG_GIRL_EYE,
|
||||
BGM_FRLG_BOY_EYE,
|
||||
BGM_FRLG_CONGRATULATIONS_HALL_OF_FAME,
|
||||
BGM_FRLG_VIRIDIAN_FOREST,
|
||||
BGM_FRLG_MT_MOON,
|
||||
BGM_FRLG_POKEMON_MANSION,
|
||||
BGM_FRLG_CREDITS,
|
||||
BGM_FRLG_ROUTE_1,
|
||||
BGM_FRLG_ROUTE_24,
|
||||
BGM_FRLG_ROUTE_3,
|
||||
BGM_FRLG_ROUTE_11,
|
||||
BGM_FRLG_INDIGO_PLATEAU,
|
||||
BGM_FRLG_BATTLE_LEADER,
|
||||
BGM_FRLG_BATTLE_TRAINER,
|
||||
BGM_FRLG_BATTLE_WILD_POKEMON,
|
||||
BGM_FRLG_BATTLE_CHAMPION,
|
||||
BGM_FRLG_PALLET_TOWN,
|
||||
BGM_FRLG_OAK_LAB,
|
||||
BGM_FRLG_PROF_OAK,
|
||||
BGM_FRLG_POKEMON_CENTER,
|
||||
BGM_FRLG_SS_ANNE,
|
||||
BGM_FRLG_SURF,
|
||||
BGM_FRLG_POKEMON_TOWER,
|
||||
BGM_FRLG_SILPH,
|
||||
BGM_FRLG_CERULEAN_CITY,
|
||||
BGM_FRLG_CELADON_CITY,
|
||||
BGM_FRLG_KACHI_TRAINER, // KACHI used in RS test - victory
|
||||
BGM_FRLG_KACHI_WILD_POKEMON,
|
||||
BGM_FRLG_KACHI_LEADER,
|
||||
BGM_FRLG_VERMILION_CITY,
|
||||
BGM_FRLG_VIRIDIAN_CITY,
|
||||
BGM_FRLG_RIVAL,
|
||||
BGM_FRLG_RIVAL_POSTBATTLE,
|
||||
BGM_FRLG_ME_POKEDEX_EVAL,
|
||||
BGM_FRLG_ME_KEYITEM,
|
||||
BGM_FRLG_FANFA_POKEMON_CAUGHT,
|
||||
BGM_FRLG_FANFA_TRAINERCARD_PHOTO,
|
||||
BGM_FRLG_GAMEFREAK_LOGO,
|
||||
BGM_FRLG_CAUGHT_POKEMON,
|
||||
BGM_FRLG_GAME_EXPLANATION_START,
|
||||
BGM_FRLG_GAME_EXPLANATION_MIDDLE,
|
||||
BGM_FRLG_GAME_EXPLANATION_END,
|
||||
BGM_FRLG_POKEMON_JUMP,
|
||||
BGM_FRLG_UNION_ROOM,
|
||||
BGM_FRLG_POKEMON_NETWORK_CENTER,
|
||||
BGM_FRLG_MYSTERY_GIFT,
|
||||
BGM_FRLG_DODRIO_BERRY_PICK,
|
||||
BGM_FRLG_MT_EMBER,
|
||||
BGM_FRLG_TEACHY_TV_EPISODE,
|
||||
BGM_FRLG_SEVII_ISLANDS,
|
||||
BGM_FRLG_TANOBY_RUINS,
|
||||
BGM_FRLG_ISLAND_ONE,
|
||||
BGM_FRLG_ISLAND_FOUR,
|
||||
BGM_FRLG_ISLAND_SIX,
|
||||
BGM_FRLG_FLUTE,
|
||||
BGM_FRLG_BATTLE_DEOXYS,
|
||||
BGM_FRLG_BATTLE_MEWTWO,
|
||||
BGM_FRLG_BATTLE_LEGENDARY,
|
||||
BGM_FRLG_LEADER_EYE,
|
||||
BGM_FRLG_DEOXYS_EYE,
|
||||
BGM_FRLG_TRAINER_TOWER,
|
||||
BGM_FRLG_HALL_OF_FAME_PALLET_TOWN,
|
||||
/*0x22E*/BGM_FRLG_TEACHY_TV,
|
||||
};
|
||||
|
||||
#endif // GUARD_SONGS_H
|
||||
|
||||
@@ -65,13 +65,20 @@
|
||||
#define CHAR_x 0xEC
|
||||
#define CHAR_y 0xED
|
||||
#define CHAR_z 0xEE
|
||||
#define CHAR_SPECIAL_F9 0xF9
|
||||
#define CHAR_COLON 0xF0
|
||||
#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog
|
||||
#define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog
|
||||
#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code
|
||||
#define PLACEHOLDER_BEGIN 0xFD // string placeholder
|
||||
#define CHAR_NEWLINE 0xFE
|
||||
#define EOS 0xFF // end of string
|
||||
#define EOS 0xFF // end of string
|
||||
|
||||
#define TEXT_COLOR_TRANSPARENT 0x0
|
||||
#define TEXT_COLOR_WHITE 0x1
|
||||
#define TEXT_COLOR_DARK_GREY 0x2
|
||||
|
||||
// battle placeholders are located in battle_message.h
|
||||
|
||||
#define EXT_CTRL_CODE_JPN 0x15
|
||||
#define EXT_CTRL_CODE_ENG 0x16
|
||||
@@ -94,7 +101,8 @@ struct TextPrinterSubStruct
|
||||
u8 active;
|
||||
};
|
||||
|
||||
struct TextSubPrinter { // TODO: Better name
|
||||
struct TextSubPrinter // TODO: Better name
|
||||
{
|
||||
u8* current_text_offset;
|
||||
u8 windowId;
|
||||
u8 fontId;
|
||||
@@ -145,12 +153,14 @@ struct FontInfo
|
||||
|
||||
extern const struct FontInfo *gFonts;
|
||||
|
||||
struct GlyphWidthFunc{
|
||||
struct GlyphWidthFunc
|
||||
{
|
||||
u32 font_id;
|
||||
u32 (*func)(u16 glyphId, bool32 isJapanese);
|
||||
};
|
||||
|
||||
struct KeypadIcon {
|
||||
struct KeypadIcon
|
||||
{
|
||||
u16 tile_offset;
|
||||
u8 width;
|
||||
u8 height;
|
||||
@@ -164,6 +174,13 @@ typedef struct {
|
||||
|
||||
extern TextFlags gTextFlags;
|
||||
|
||||
struct __attribute__((packed)) TextColor
|
||||
{
|
||||
u8 fgColor;
|
||||
u8 bgColor;
|
||||
u8 shadowColor;
|
||||
};
|
||||
|
||||
extern u8 gStringVar1[];
|
||||
extern u8 gStringVar2[];
|
||||
extern u8 gStringVar3[];
|
||||
@@ -177,11 +194,11 @@ u8 gUnknown_03002FF0[0x20];
|
||||
u8 gGlyphDimensions[0x2];
|
||||
|
||||
void SetFontsPointer(const struct FontInfo *fonts);
|
||||
void DeactivateAllTextPrinters (void);
|
||||
void DeactivateAllTextPrinters(void);
|
||||
u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16));
|
||||
bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*callback)(struct TextSubPrinter *, u16));
|
||||
void RunTextPrinters(void);
|
||||
bool8 IsTextPrinterActive(u8 id);
|
||||
bool16 IsTextPrinterActive(u8 id);
|
||||
u32 RenderFont(struct TextPrinter *textPrinter);
|
||||
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor);
|
||||
void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor);
|
||||
|
||||
@@ -24,6 +24,17 @@ struct WindowTemplate
|
||||
u16 baseBlock;
|
||||
};
|
||||
|
||||
#define DUMMY_WIN_TEMPLATE \
|
||||
{ \
|
||||
0xFF, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
}
|
||||
|
||||
struct Window
|
||||
{
|
||||
struct WindowTemplate window;
|
||||
@@ -44,7 +55,7 @@ void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height);
|
||||
void BlitBitmapToWindow(u8 windowId, u8 *pixels, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight);
|
||||
void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void CopyToWindowPixelBuffer(u8 windowId, u8 *src, u16 size, u16 tileOffset);
|
||||
void CopyToWindowPixelBuffer(u8 windowId, const u8 *src, u16 size, u16 tileOffset);
|
||||
void FillWindowPixelBuffer(u8 windowId, u8 fillValue);
|
||||
void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue);
|
||||
void CallWindowFunction(u8 windowId, void ( *func)(u8, u8, u8, u8, u8, u8));
|
||||
|
||||
Reference in New Issue
Block a user