I hope this fixes merge conflicts
This commit is contained in:
718
include/battle.h
718
include/battle.h
@@ -1,6 +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
|
||||
@@ -24,6 +46,7 @@
|
||||
#define BATTLE_TYPE_x100000 0x100000
|
||||
#define BATTLE_TYPE_PYRAMID 0x200000
|
||||
#define BATTLE_TYPE_INGAME_PARTNER 0x400000
|
||||
#define BATTLE_TYPE_x800000 0x800000
|
||||
#define BATTLE_TYPE_RECORDED 0x1000000
|
||||
#define BATTLE_TYPE_x2000000 0x2000000
|
||||
#define BATTLE_TYPE_x4000000 0x4000000
|
||||
@@ -37,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
|
||||
@@ -63,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
|
||||
@@ -83,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
|
||||
@@ -91,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
|
||||
@@ -135,26 +156,26 @@
|
||||
#define SIDE_STATUS_MIST (1 << 8)
|
||||
#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
|
||||
|
||||
#define ABILITYEFFECT_ON_SWITCHIN 0x0
|
||||
#define ABILITYEFFECT_ENDTURN 0x1
|
||||
#define ABILITYEFFECT_MOVES_BLOCK 0x2
|
||||
#define ABILITYEFFECT_ABSORBING 0x3
|
||||
#define ABILITYEFFECT_CONTACT 0x4
|
||||
#define ABILITYEFFECT_IMMUNITY 0x5
|
||||
#define ABILITYEFFECT_FORECAST 0x6
|
||||
#define ABILITYEFFECT_SYNCHRONIZE 0x7
|
||||
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
|
||||
#define ABILITYEFFECT_INTIMIDATE1 0x9
|
||||
#define ABILITYEFFECT_INTIMIDATE2 0xA
|
||||
#define ABILITYEFFECT_TRACE 0xB
|
||||
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
|
||||
#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
|
||||
#define ABILITYEFFECT_FIELD_SPORT 0xE
|
||||
#define ABILITYEFFECT_ON_SWITCHIN 0x0
|
||||
#define ABILITYEFFECT_ENDTURN 0x1
|
||||
#define ABILITYEFFECT_MOVES_BLOCK 0x2
|
||||
#define ABILITYEFFECT_ABSORBING 0x3
|
||||
#define ABILITYEFFECT_CONTACT 0x4
|
||||
#define ABILITYEFFECT_IMMUNITY 0x5
|
||||
#define ABILITYEFFECT_FORECAST 0x6
|
||||
#define ABILITYEFFECT_SYNCHRONIZE 0x7
|
||||
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
|
||||
#define ABILITYEFFECT_INTIMIDATE1 0x9
|
||||
#define ABILITYEFFECT_INTIMIDATE2 0xA
|
||||
#define ABILITYEFFECT_TRACE 0xB
|
||||
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
|
||||
#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_BANK_SIDE 0x11
|
||||
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
|
||||
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
|
||||
#define ABILITYEFFECT_COUNT_OTHER_SIDE 0x10
|
||||
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
|
||||
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
|
||||
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
|
||||
|
||||
#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)))
|
||||
|
||||
@@ -171,7 +192,6 @@
|
||||
|
||||
#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)
|
||||
@@ -185,12 +205,103 @@
|
||||
#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 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
|
||||
|
||||
#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
|
||||
|
||||
#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;
|
||||
};
|
||||
|
||||
#include "global.h"
|
||||
|
||||
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
|
||||
u8 GetBankSide(u8 bank);
|
||||
|
||||
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
|
||||
{
|
||||
/*0x00*/ u8 partyFlags;
|
||||
@@ -202,9 +313,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))
|
||||
@@ -244,15 +358,109 @@ 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];
|
||||
};
|
||||
|
||||
extern struct DisableStruct gDisableStructs[];
|
||||
extern struct DisableStruct gDisableStructs[BATTLE_BANKS_COUNT];
|
||||
|
||||
struct ProtectStruct
|
||||
{
|
||||
/* field_0 */
|
||||
u32 protected:1;
|
||||
u32 endured:1;
|
||||
u32 onlyStruggle:1;
|
||||
u32 helpingHand:1;
|
||||
u32 bounceMove:1;
|
||||
u32 stealMove:1;
|
||||
u32 flag0Unknown:1;
|
||||
u32 prlzImmobility:1;
|
||||
/* field_1 */
|
||||
u32 confusionSelfDmg:1;
|
||||
u32 notEffective:1;
|
||||
u32 chargingTurn:1;
|
||||
u32 fleeFlag:2; // for RunAway and Smoke Ball
|
||||
u32 usedImprisionedMove:1;
|
||||
u32 loveImmobility:1;
|
||||
u32 usedDisabledMove:1;
|
||||
/* field_2 */
|
||||
u32 usedTauntedMove:1; // 0x1
|
||||
u32 flag2Unknown:1; // 0x2
|
||||
u32 flinchImmobility:1; // 0x4
|
||||
u32 notFirstStrike:1; // 0x8
|
||||
u32 flag_x10 : 1; // 0x10
|
||||
u32 flag_x20 : 1; // 0x20
|
||||
u32 flag_x40 : 1; // 0x40
|
||||
u32 flag_x80 : 1; // 0x80
|
||||
/* field_3 */
|
||||
u32 field3 : 8;
|
||||
|
||||
/* field_4 */ u32 physicalDmg;
|
||||
/* field_8 */ u32 specialDmg;
|
||||
/* field_C */ u8 physicalBank;
|
||||
/* field_D */ u8 specialBank;
|
||||
/* field_E */ u16 fieldE;
|
||||
};
|
||||
|
||||
extern struct ProtectStruct gProtectStructs[BATTLE_BANKS_COUNT];
|
||||
|
||||
struct SpecialStatus
|
||||
{
|
||||
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;
|
||||
u8 field1[3];
|
||||
s32 moveturnLostHP;
|
||||
s32 moveturnLostHP_physical;
|
||||
s32 moveturnLostHP_special;
|
||||
u8 moveturnPhysicalBank;
|
||||
u8 moveturnSpecialBank;
|
||||
u8 field12;
|
||||
u8 field13;
|
||||
};
|
||||
|
||||
extern struct SpecialStatus gSpecialStatuses[BATTLE_BANKS_COUNT];
|
||||
|
||||
struct SideTimer
|
||||
{
|
||||
/*0x00*/ u8 reflectTimer;
|
||||
/*0x01*/ u8 reflectBank;
|
||||
/*0x02*/ u8 lightscreenTimer;
|
||||
/*0x03*/ u8 lightscreenBank;
|
||||
/*0x04*/ u8 mistTimer;
|
||||
/*0x05*/ u8 mistBank;
|
||||
/*0x06*/ u8 safeguardTimer;
|
||||
/*0x07*/ u8 safeguardBank;
|
||||
/*0x08*/ u8 followmeTimer;
|
||||
/*0x09*/ u8 followmeTarget;
|
||||
/*0x0A*/ u8 spikesAmount;
|
||||
/*0x0B*/ u8 fieldB;
|
||||
};
|
||||
|
||||
extern struct SideTimer gSideTimers[];
|
||||
|
||||
struct WishFutureKnock
|
||||
{
|
||||
u8 futureSightCounter[BATTLE_BANKS_COUNT];
|
||||
u8 futureSightAttacker[BATTLE_BANKS_COUNT];
|
||||
s32 futureSightDmg[BATTLE_BANKS_COUNT];
|
||||
u16 futureSightMove[BATTLE_BANKS_COUNT];
|
||||
u8 wishCounter[BATTLE_BANKS_COUNT];
|
||||
u8 wishUserID[BATTLE_BANKS_COUNT];
|
||||
u8 weatherDuration;
|
||||
u8 knockedOffPokes[2];
|
||||
};
|
||||
|
||||
extern struct WishFutureKnock gWishFutureKnock;
|
||||
|
||||
//size should be 0x1C
|
||||
struct AI_ThinkingStruct
|
||||
{
|
||||
u8 aiState;
|
||||
@@ -269,33 +477,48 @@ struct AI_ThinkingStruct
|
||||
|
||||
struct UsedMoves
|
||||
{
|
||||
u16 moves[4];
|
||||
u16 unknown[4];
|
||||
u16 moves[BATTLE_BANKS_COUNT];
|
||||
u16 unknown[BATTLE_BANKS_COUNT];
|
||||
};
|
||||
|
||||
//size should be 0x54
|
||||
struct BattleHistory
|
||||
{
|
||||
struct UsedMoves usedMoves[4];
|
||||
u8 abilities[4];
|
||||
u8 itemEffects[4];
|
||||
u16 TrainerItems[4];
|
||||
struct UsedMoves usedMoves[BATTLE_BANKS_COUNT];
|
||||
u8 abilities[BATTLE_BANKS_COUNT];
|
||||
u8 itemEffects[BATTLE_BANKS_COUNT];
|
||||
u16 TrainerItems[BATTLE_BANKS_COUNT];
|
||||
u8 itemsNo;
|
||||
};
|
||||
|
||||
struct BattleScriptsStack
|
||||
{
|
||||
u8 *ptr[8];
|
||||
const u8 *ptr[8];
|
||||
u8 size;
|
||||
};
|
||||
|
||||
struct BattleCallbacksStack
|
||||
{
|
||||
void (*function[8])(void);
|
||||
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;
|
||||
void* battleCallbackStack;
|
||||
void* statsBeforeLvlUp;
|
||||
struct BattleCallbacksStack* battleCallbackStack;
|
||||
struct StatsArray* statsBeforeLvlUp;
|
||||
struct AI_ThinkingStruct *ai;
|
||||
struct BattleHistory *battleHistory;
|
||||
struct BattleScriptsStack *AI_ScriptsStack;
|
||||
@@ -303,15 +526,22 @@ struct BattleResources
|
||||
|
||||
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;
|
||||
@@ -323,68 +553,28 @@ 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;
|
||||
|
||||
struct BattleStruct
|
||||
{
|
||||
u8 field_1;
|
||||
u8 field_2;
|
||||
u8 field_3;
|
||||
u8 field_4;
|
||||
u8 wrappedMove1[4];
|
||||
u8 wrappedMove2[4];
|
||||
u8 turnEffectsTracker;
|
||||
u8 turnEffectsBank;
|
||||
u8 filler2;
|
||||
u8 turncountersTracker;
|
||||
u8 wrappedMove[8]; // ask gamefreak why they declared it that way
|
||||
u8 moveTarget[4];
|
||||
u8 expGetterId;
|
||||
u8 field_11;
|
||||
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;
|
||||
@@ -395,52 +585,21 @@ struct BattleStruct
|
||||
u8 field_47;
|
||||
u8 field_48;
|
||||
u8 field_49;
|
||||
u8 field_4A;
|
||||
u8 moneyMultiplier;
|
||||
u8 field_4B;
|
||||
u8 field_4C;
|
||||
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 field_5C;
|
||||
u8 field_5D;
|
||||
u8 field_5E;
|
||||
u8 field_5F;
|
||||
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 sentInPokes;
|
||||
u8 field_54[4];
|
||||
u8 field_58[4];
|
||||
u8 field_5C[4];
|
||||
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;
|
||||
@@ -470,14 +629,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;
|
||||
@@ -495,30 +647,296 @@ 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[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 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;
|
||||
|
||||
#define MEME_ACCESS_U8(structName, structPtr, arrayId, offsetField, value) \
|
||||
{ \
|
||||
u8* var2 = (u8*)((u32)(arrayId)); \
|
||||
var2 = (u32)(structPtr) + var2; \
|
||||
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;
|
||||
u8 animArg2;
|
||||
u8 field_12;
|
||||
u8 field_13;
|
||||
u8 atk49_state;
|
||||
u8 field_15;
|
||||
u8 field_16;
|
||||
u8 bank;
|
||||
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);
|
||||
|
||||
// battle_transition
|
||||
void sub_8149DFC(u8 a1);
|
||||
|
||||
// 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
|
||||
13
include/battle_dome_cards.h
Normal file
13
include/battle_dome_cards.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef GUARD_BATTLE_DOME_CARDS_H
|
||||
#define GUARD_BATTLE_DOME_CARDS_H
|
||||
|
||||
bool16 dp13_810BB8C(void);
|
||||
u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||
u16 sub_818D7D8(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||
u16 sub_818D820(u16 spriteId);
|
||||
u16 sub_818D8AC(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||
u16 sub_818D8F0(u16 spriteId);
|
||||
u16 sub_818D938(u16 species, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId);
|
||||
u8 sub_818D97C(u8 a0, u8 a1);
|
||||
|
||||
#endif //GUARD_BATTLE_DOME_CARDS_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
|
||||
|
||||
@@ -11,6 +11,12 @@ enum
|
||||
BERRY_FIRMNESS_SUPER_HARD,
|
||||
};
|
||||
|
||||
#define NUM_BERRIES 44
|
||||
|
||||
extern const u8 *const gBerryTreeFieldObjectGraphicsIdTablePointers[NUM_BERRIES];
|
||||
extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[NUM_BERRIES];
|
||||
extern const u8 *const gBerryTreePaletteSlotTablePointers[NUM_BERRIES];
|
||||
|
||||
void ClearEnigmaBerries(void);
|
||||
void SetEnigmaBerry(u8 *src);
|
||||
u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry);
|
||||
@@ -47,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
|
||||
|
||||
75
include/bg.h
Normal file
75
include/bg.h
Normal file
@@ -0,0 +1,75 @@
|
||||
#ifndef GUARD_BG_H
|
||||
#define GUARD_BG_H
|
||||
|
||||
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 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 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
|
||||
12
include/blend_palette.h
Normal file
12
include/blend_palette.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef GUARD_BLEND_PALETTE_H
|
||||
#define GUARD_BLEND_PALETTE_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
void BlendPalette(u16, u16, u8, u16);
|
||||
|
||||
#endif //GUARD_BLEND_PALETTE_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
|
||||
@@ -1,23 +1,10 @@
|
||||
#ifndef GUARD_DMA3_H
|
||||
#define GUARD_DMA3_H
|
||||
|
||||
extern u8 gDma3ManagerLocked;
|
||||
extern u8 gDma3RequestCursor;
|
||||
|
||||
struct DmaRequestsStruct
|
||||
{
|
||||
/* 0x00 */ u8 *src;
|
||||
/* 0x04 */ u8 *dest;
|
||||
/* 0x08 */ u16 size;
|
||||
/* 0x0A */ u16 mode;
|
||||
/* 0x0C */ u32 value;
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -29,5 +29,8 @@ enum
|
||||
};
|
||||
|
||||
void InitEasyChatPhrases(void);
|
||||
void easy_chat_input_maybe(void);
|
||||
void CopyEasyChatWord(u8 *, u16);
|
||||
bool32 sub_811F8D8(u16);
|
||||
|
||||
#endif // GUARD_EASYCHAT_H
|
||||
|
||||
11
include/event_scripts.h
Executable file
11
include/event_scripts.h
Executable file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Created by scott on 9/12/2017.
|
||||
//
|
||||
|
||||
#ifndef GUARD_EVENT_SCRIPTS_H
|
||||
#define GUARD_EVENT_SCRIPTS_H
|
||||
|
||||
extern const u8 gUnknown_082766A2[];
|
||||
extern const u8 gUnknown_082766A6[];
|
||||
|
||||
#endif //GUARD_EVENT_SCRIPTS_H
|
||||
25
include/field_camera.h
Normal file
25
include/field_camera.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef GUARD_FIELD_CAMERA_H
|
||||
#define GUARD_FIELD_CAMERA_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
struct CameraObject
|
||||
{
|
||||
void (*callback)(struct CameraObject *);
|
||||
u32 unk4;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
s32 x;
|
||||
s32 y;
|
||||
};
|
||||
|
||||
extern struct CameraObject gUnknown_03005DD0;
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
extern u16 gUnknown_03005DEC;
|
||||
extern u16 gUnknown_03005DE8;
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
#endif //GUARD_FIELD_CAMERA_H
|
||||
80
include/field_effect.h
Normal file
80
include/field_effect.h
Normal file
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// Created by Scott Norton on 9/15/17.
|
||||
//
|
||||
|
||||
#ifndef GUARD_FIELD_EFFECTS_H
|
||||
#define GUARD_FIELD_EFFECTS_H
|
||||
|
||||
enum FieldEffectScriptIdx
|
||||
{
|
||||
FLDEFF_EXCLAMATION_MARK_ICON_1,
|
||||
FLDEFF_USE_CUT_ON_GRASS,
|
||||
FLDEFF_USE_CUT_ON_TREE,
|
||||
FLDEFF_SHADOW,
|
||||
FLDEFF_TALL_GRASS,
|
||||
FLDEFF_RIPPLE,
|
||||
FLDEFF_FIELD_MOVE_SHOW_MON,
|
||||
FLDEFF_ASH,
|
||||
FLDEFF_SURF_BLOB,
|
||||
FLDEFF_USE_SURF,
|
||||
FLDEFF_DUST,
|
||||
FLDEFF_USE_SECRET_POWER_CAVE,
|
||||
FLDEFF_JUMP_TALL_GRASS,
|
||||
FLDEFF_SAND_FOOTPRINTS,
|
||||
FLDEFF_JUMP_BIG_SPLASH,
|
||||
FLDEFF_SPLASH,
|
||||
FLDEFF_JUMP_SMALL_SPLASH,
|
||||
FLDEFF_LONG_GRASS,
|
||||
FLDEFF_JUMP_LONG_GRASS,
|
||||
FLDEFF_UNKNOWN_19,
|
||||
FLDEFF_UNKNOWN_20,
|
||||
FLDEFF_UNKNOWN_21,
|
||||
FLDEFF_UNKNOWN_22,
|
||||
FLDEFF_BERRY_TREE_GROWTH_SPARKLE,
|
||||
FLDEFF_DEEP_SAND_FOOTPRINTS,
|
||||
FLDEFF_POKECENTER_HEAL,
|
||||
FLDEFF_USE_SECRET_POWER_TREE,
|
||||
FLDEFF_USE_SECRET_POWER_SHRUB,
|
||||
FLDEFF_TREE_DISGUISE,
|
||||
FLDEFF_MOUNTAIN_DISGUISE,
|
||||
FLDEFF_NPCFLY_OUT,
|
||||
FLDEFF_USE_FLY,
|
||||
FLDEFF_FLY_IN,
|
||||
FLDEFF_EXCLAMATION_MARK_ICON_2,
|
||||
FLDEFF_FEET_IN_FLOWING_WATER,
|
||||
FLDEFF_BIKE_TIRE_TRACKS,
|
||||
FLDEFF_SAND_DISGUISE,
|
||||
FLDEFF_USE_ROCK_SMASH,
|
||||
FLDEFF_USE_DIG,
|
||||
FLDEFF_SAND_PILE,
|
||||
FLDEFF_USE_STRENGTH,
|
||||
FLDEFF_SHORT_GRASS,
|
||||
FLDEFF_HOT_SPRINGS_WATER,
|
||||
FLDEFF_USE_WATERFALL,
|
||||
FLDEFF_USE_DIVE,
|
||||
FLDEFF_POKEBALL,
|
||||
FLDEFF_HEART_ICON,
|
||||
FLDEFF_NOP_47,
|
||||
FLDEFF_NOP_48,
|
||||
FLDEFF_POP_OUT_OF_ASH,
|
||||
FLDEFF_LAVARIDGE_GYM_WARP,
|
||||
FLDEFF_SWEET_SCENT,
|
||||
FLDEFF_SAND_PILLAR,
|
||||
FLDEFF_BUBBLES,
|
||||
FLDEFF_SPARKLE,
|
||||
FLDEFF_SECRET_POWER_CAVE,
|
||||
FLDEFF_SECRET_POWER_TREE,
|
||||
FLDEFF_SECRET_POWER_SHRUB,
|
||||
FLDEFF_CUT_GRASS,
|
||||
FLDEFF_FIELD_MOVE_SHOW_MON_INIT,
|
||||
FLDEFF_USE_FLY_ANCIENT_TOMB,
|
||||
FLDEFF_PCTURN_ON,
|
||||
FLDEFF_HALL_OF_FAME_RECORD,
|
||||
FLDEFF_USE_TELEPORT
|
||||
};
|
||||
|
||||
extern u32 gFieldEffectSpawnParams[8];
|
||||
|
||||
u8 FieldEffectStart(u8);
|
||||
|
||||
#endif //GUARD_FIELD_EFFECTS_H
|
||||
16
include/field_effect_helpers.h
Normal file
16
include/field_effect_helpers.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Created by scott on 9/7/2017.
|
||||
//
|
||||
|
||||
#ifndef GUARD_FIELD_EFFECT_HELPERS_H
|
||||
#define GUARD_FIELD_EFFECT_HELPERS_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
u8 sub_8154228(void);
|
||||
bool8 sub_8155DA0(struct MapObject *);
|
||||
|
||||
#endif //GUARD_FIELD_EFFECT_HELPERS_H
|
||||
22
include/field_ground_effect.h
Normal file
22
include/field_ground_effect.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by scott on 9/6/2017.
|
||||
//
|
||||
|
||||
#ifndef GUARD_FIELD_GROUND_EFFECT_H
|
||||
#define GUARD_FIELD_GROUND_EFFECT_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8);
|
||||
void InitObjectPriorityByZCoord(struct Sprite *, u8);
|
||||
bool8 IsZCoordMismatchAt(u8, s16, s16);
|
||||
bool8 AreZCoordsCompatible(u8, u8);
|
||||
void FieldObjectUpdateSubpriority(struct MapObject *, struct Sprite *);
|
||||
void DoGroundEffects_OnSpawn(struct MapObject *, struct Sprite *);
|
||||
void DoGroundEffects_OnBeginStep(struct MapObject *, struct Sprite *);
|
||||
void DoGroundEffects_OnFinishStep(struct MapObject *, struct Sprite *);
|
||||
|
||||
#endif //GUARD_FIELD_GROUND_EFFECT_H
|
||||
79
include/field_map_obj.h
Executable file
79
include/field_map_obj.h
Executable file
@@ -0,0 +1,79 @@
|
||||
#ifndef GUARD_FIELD_MAP_OBJ_H
|
||||
#define GUARD_FIELD_MAP_OBJ_H
|
||||
|
||||
#define NUM_OBJECT_GRAPHICS_INFO 239
|
||||
#define SPRITE_VAR 240
|
||||
|
||||
// Exported struct declarations
|
||||
|
||||
enum SpinnerRunnerFollowPatterns {
|
||||
RUNFOLLOW_ANY,
|
||||
RUNFOLLOW_NORTH_SOUTH,
|
||||
RUNFOLLOW_EAST_WEST,
|
||||
RUNFOLLOW_NORTH_WEST,
|
||||
RUNFOLLOW_NORTH_EAST,
|
||||
RUNFOLLOW_SOUTH_WEST,
|
||||
RUNFOLLOW_SOUTH_EAST,
|
||||
RUNFOLLOW_NORTH_SOUTH_WEST,
|
||||
RUNFOLLOW_NORTH_SOUTH_EAST,
|
||||
RUNFOLLOW_NORTH_EAST_WEST,
|
||||
RUNFOLLOW_SOUTH_EAST_WEST
|
||||
};
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
void sub_808D438(void);
|
||||
u8 GetFieldObjectIdByLocalIdAndMap(u8, u8, u8);
|
||||
bool8 TryGetFieldObjectIdByLocalIdAndMap(u8, u8, u8, u8 *);
|
||||
u8 GetFieldObjectIdByXY(s16, s16);
|
||||
void FieldObjectSetDirection(struct MapObject *, u8);
|
||||
u8 sub_808D4F4(void);
|
||||
void RemoveFieldObjectByLocalIdAndMap(u8, u8, u8);
|
||||
void npc_load_two_palettes__no_record(u16, u8);
|
||||
void npc_load_two_palettes__and_record(u16, u8);
|
||||
void pal_patch_for_npc(u16, u8);
|
||||
void sub_808E16C(s16, s16);
|
||||
void sub_8092FF0(s16, s16, s16 *, s16 *);
|
||||
u8 FieldObjectDirectionToImageAnimId(u8);
|
||||
void sub_80930E0(s16 *, s16 *, s16, s16);
|
||||
void FieldObjectClearAnim(struct MapObject *);
|
||||
void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *);
|
||||
void SpawnFieldObjectsInView(s16, s16);
|
||||
u8 sprite_new(u8, u8, s16, s16, u8, u8);
|
||||
u8 AddPseudoFieldObject(u16, void (*)(struct Sprite *), s16, s16, u8);
|
||||
u8 show_sprite(u8, u8, u8);
|
||||
u8 SpawnSpecialFieldObjectParametrized(u8, u8, u8, s16, s16, u8);
|
||||
u8 SpawnSpecialFieldObject(struct MapObjectTemplate *);
|
||||
void sub_8093038(s16, s16, s16 *, s16 *);
|
||||
void CameraObjectReset1(void);
|
||||
void FieldObjectSetGraphicsId(struct MapObject *, u8);
|
||||
void FieldObjectTurn(struct MapObject *, u8);
|
||||
void FieldObjectTurnByLocalIdAndMap(u8, u8, u8, u8);
|
||||
const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8);
|
||||
void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8);
|
||||
void gpu_pal_allocator_reset__manage_upper_four(void);
|
||||
void sub_808E82C(u8, u8, u8, s16, s16);
|
||||
void sub_808E7E4(u8, u8, u8);
|
||||
void sub_808E78C(u8, u8, u8, u8);
|
||||
void sub_808E75C(s16, s16);
|
||||
void FieldObjectGetLocalIdAndMap(struct MapObject *, u8 *, u8 *, u8 *);
|
||||
void npc_coords_shift(struct MapObject *, s16, s16);
|
||||
void sub_808EB08(struct MapObject *, s16, s16);
|
||||
void sub_808F254(u8, u8, u8);
|
||||
void FieldObjectStep(struct MapObject *, struct Sprite *, bool8(struct MapObject *, struct Sprite *));
|
||||
u8 GetOppositeDirection(u8);
|
||||
u8 GetStepInPlaceDelay4AnimId(u32);
|
||||
u8 GetStepInPlaceDelay8AnimId(u32);
|
||||
u8 GetStepInPlaceDelay16AnimId(u32);
|
||||
u8 GetStepInPlaceDelay32AnimId(u32);
|
||||
u8 npc_block_way(struct MapObject *, s16, s16, u32);
|
||||
void MoveCoords(u8, s16 *, s16 *);
|
||||
bool8 FieldObjectIsSpecialAnimActive(struct MapObject *);
|
||||
|
||||
// Exported data declarations
|
||||
|
||||
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
|
||||
|
||||
#endif //GUARD_FIELD_MAP_OBJ_H
|
||||
17
include/field_player_avatar.h
Normal file
17
include/field_player_avatar.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Scott Norton on 9/6/17.
|
||||
//
|
||||
|
||||
#ifndef GUARD_FIELD_PLAYER_AVATAR_H
|
||||
#define GUARD_FIELD_PLAYER_AVATAR_H
|
||||
|
||||
void ClearPlayerAvatarInfo(void);
|
||||
void SetPlayerAvatarExtraStateTransition(u8, u8);
|
||||
u8 GetPlayerAvatarGenderByGraphicsId(u8);
|
||||
bool8 TestPlayerAvatarFlags(u8);
|
||||
void PlayerGetDestCoords(s16 *, s16 *);
|
||||
u8 player_get_direction_lower_nybble(void);
|
||||
u8 player_get_direction_upper_nybble(void);
|
||||
u8 player_get_x22(void);
|
||||
|
||||
#endif //GUARD_FIELD_PLAYER_AVATAR_H
|
||||
@@ -1,6 +1,19 @@
|
||||
//
|
||||
// Created by scott on 9/16/2017.
|
||||
//
|
||||
|
||||
#ifndef GUARD_FIELDMAP_H
|
||||
#define GUARD_FIELDMAP_H
|
||||
|
||||
void GetCameraCoords(u16*, u16*);
|
||||
// Exported type declarations
|
||||
|
||||
#endif // GUARD_FIELDMAP_H
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
u8 MapGridGetMetatileBehaviorAt(s16, s16);
|
||||
void GetCameraCoords(u16*, u16*);
|
||||
bool8 MapGridIsImpassableAt(s16, s16);
|
||||
s32 GetMapBorderIdAt(s16, s16);
|
||||
bool32 CanCameraMoveInDirection(u8);
|
||||
|
||||
#endif //GUARD_FIELDMAP_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
|
||||
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
|
||||
struct MultiBootParam
|
||||
{
|
||||
u32 system_work[5];
|
||||
u8 handshake_data;
|
||||
u8 padding;
|
||||
u16 handshake_timeout;
|
||||
u8 probe_count;
|
||||
u8 client_data[MULTIBOOT_NCHILD];
|
||||
u8 palette_data;
|
||||
u8 response_bit;
|
||||
u8 client_bit;
|
||||
u8 reserved1;
|
||||
u8 *boot_srcp;
|
||||
u8 *boot_endp;
|
||||
u8 *masterp;
|
||||
u32 system_work[5]; // 00
|
||||
u8 handshake_data; // 14
|
||||
u8 padding; // 15
|
||||
u16 handshake_timeout; // 16
|
||||
u8 probe_count; // 18
|
||||
u8 client_data[MULTIBOOT_NCHILD]; // 19
|
||||
u8 palette_data; // 1c
|
||||
u8 response_bit; // 1d
|
||||
u8 client_bit; // 1e
|
||||
u8 reserved1; // 1f
|
||||
const u8 *boot_srcp; // 20
|
||||
const u8 *boot_endp; // 24
|
||||
const u8 *masterp;
|
||||
u8 *reserved2[MULTIBOOT_NCHILD];
|
||||
u32 system_work2[4];
|
||||
u8 sendflag;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_GLOBAL_FIELDMAP_H
|
||||
#define GUARD_GLOBAL_FIELDMAP_H
|
||||
|
||||
#define NUM_FIELD_OBJECTS 16
|
||||
|
||||
enum
|
||||
{
|
||||
CONNECTION_SOUTH = 1,
|
||||
@@ -84,7 +86,7 @@ struct MapObjectTemplate
|
||||
///*0x0B*/ u8 fillerB[1];
|
||||
/*0x0C*/ u16 unkC;
|
||||
/*0x0E*/ u16 unkE;
|
||||
/*0x10*/ u8 *script;
|
||||
/*0x10*/ const u8 *script;
|
||||
/*0x14*/ u16 flagId;
|
||||
/*0x16*/ u8 filler_16[2];
|
||||
}; /*size = 0x18*/
|
||||
@@ -224,7 +226,13 @@ struct MapObject
|
||||
/*0x14*/ struct Coords16 coords3;
|
||||
/*0x18*/ u8 mapobj_unk_18:4; //current direction?
|
||||
/*0x18*/ u8 placeholder18:4;
|
||||
/*0x19*/ u8 mapobj_unk_19;
|
||||
/*0x19*/ union __attribute__((packed)) {
|
||||
u8 as_byte;
|
||||
struct __attribute__((packed)) {
|
||||
u8 x:4;
|
||||
u8 y:4;
|
||||
} __attribute__((aligned (1))) as_nybbles;
|
||||
} __attribute__((aligned (1))) range;
|
||||
/*0x1A*/ u8 mapobj_unk_1A;
|
||||
/*0x1B*/ u8 mapobj_unk_1B;
|
||||
/*0x1C*/ u8 mapobj_unk_1C;
|
||||
@@ -237,68 +245,6 @@ struct MapObject
|
||||
/*size = 0x24*/
|
||||
};
|
||||
|
||||
// THIS IS NEEDED TO MAKE TRAINER_SEE.C MATCH, PLEASE DO NOT REMOVE UNLESS YOU FIX CHECKPATHBETWEENTRAINERANDPLAYER
|
||||
struct MapObject2
|
||||
{
|
||||
/*0x00*/ u32 active:1;
|
||||
u32 mapobj_bit_1:1;
|
||||
u32 mapobj_bit_2:1;
|
||||
u32 mapobj_bit_3:1;
|
||||
u32 mapobj_bit_4:1;
|
||||
u32 mapobj_bit_5:1;
|
||||
u32 mapobj_bit_6:1;
|
||||
u32 mapobj_bit_7:1;
|
||||
/*0x01*/ u32 mapobj_bit_8:1;
|
||||
u32 mapobj_bit_9:1;
|
||||
u32 mapobj_bit_10:1;
|
||||
u32 mapobj_bit_11:1;
|
||||
u32 mapobj_bit_12:1;
|
||||
u32 mapobj_bit_13:1;
|
||||
u32 mapobj_bit_14:1;
|
||||
u32 mapobj_bit_15:1;
|
||||
/*0x02*/ u32 mapobj_bit_16:1;
|
||||
u32 mapobj_bit_17:1;
|
||||
u32 mapobj_bit_18:1;
|
||||
u32 mapobj_bit_19:1;
|
||||
u32 mapobj_bit_20:1;
|
||||
u32 mapobj_bit_21:1;
|
||||
u32 mapobj_bit_22:1;
|
||||
u32 mapobj_bit_23:1;
|
||||
/*0x03*/ u32 mapobj_bit_24:1;
|
||||
u32 mapobj_bit_25:1;
|
||||
u32 mapobj_bit_26:1;
|
||||
u32 mapobj_bit_27:1;
|
||||
u32 mapobj_bit_28:1;
|
||||
u32 mapobj_bit_29:1;
|
||||
u32 mapobj_bit_30:1;
|
||||
u32 mapobj_bit_31:1;
|
||||
/*0x04*/ u8 spriteId;
|
||||
/*0x05*/ u8 graphicsId;
|
||||
/*0x06*/ u8 animPattern;
|
||||
/*0x07*/ u8 trainerType;
|
||||
/*0x08*/ u8 localId;
|
||||
/*0x09*/ u8 mapNum;
|
||||
/*0x0A*/ u8 mapGroup;
|
||||
/*0x0B*/ u8 mapobj_unk_0B_0:4;
|
||||
u8 elevation:4;
|
||||
/*0x0C*/ struct Coords16 coords1;
|
||||
/*0x10*/ struct Coords16 coords2;
|
||||
/*0x14*/ struct Coords16 coords3;
|
||||
/*0x18*/ u8 mapobj_unk_18:4;
|
||||
/*0x18*/ u8 placeholder18:4;
|
||||
/*0x19*/ u8 mapobj_unk_19:4;
|
||||
/*0x19*/ u8 mapobj_unk_19b:4;
|
||||
/*0x1A*/ u8 mapobj_unk_1A;
|
||||
/*0x1B*/ u8 mapobj_unk_1B;
|
||||
/*0x1C*/ u8 mapobj_unk_1C;
|
||||
/*0x1D*/ u8 trainerRange_berryTreeId;
|
||||
/*0x1E*/ u8 mapobj_unk_1E;
|
||||
/*0x1F*/ u8 mapobj_unk_1F;
|
||||
/*0x20*/ u8 mapobj_unk_20;
|
||||
/*0x21*/ u8 mapobj_unk_21;
|
||||
/*size = 0x24*/
|
||||
};
|
||||
|
||||
struct MapObjectGraphicsInfo
|
||||
{
|
||||
/*0x00*/ u16 tileTag;
|
||||
@@ -376,14 +322,15 @@ struct PlayerAvatar /* 0x202E858 */
|
||||
|
||||
struct Camera
|
||||
{
|
||||
bool8 field_0:1;
|
||||
bool8 active:1;
|
||||
s32 x;
|
||||
s32 y;
|
||||
};
|
||||
|
||||
extern struct MapObject gMapObjects[];
|
||||
extern struct MapObject gMapObjects[NUM_FIELD_OBJECTS];
|
||||
extern u8 gSelectedMapObject;
|
||||
extern struct MapHeader gMapHeader;
|
||||
extern struct PlayerAvatar gPlayerAvatar;
|
||||
extern struct Camera gCamera;
|
||||
|
||||
#endif // GUARD_GLOBAL_FIELDMAP_H
|
||||
|
||||
@@ -9,9 +9,23 @@
|
||||
|
||||
// to help in decompiling
|
||||
#define asm_comment(x) asm volatile("@ -- " x " -- ")
|
||||
#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided")
|
||||
|
||||
#if defined (__APPLE__) || defined (__CYGWIN__)
|
||||
void memset(void *, int, size_t);
|
||||
void memcpy(void *, const void *, size_t);
|
||||
#endif // __APPLE__
|
||||
|
||||
#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
|
||||
|
||||
@@ -639,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;
|
||||
};
|
||||
|
||||
@@ -655,6 +670,61 @@ struct DaycareData
|
||||
#define FLAGS_COUNT 300
|
||||
#define VARS_COUNT 256
|
||||
|
||||
enum {
|
||||
LILYCOVE_LADY_QUIZ,
|
||||
LILYCOVE_LADY_FAVOUR,
|
||||
LILYCOVE_LADY_CONTEST
|
||||
};
|
||||
|
||||
struct LilycoveLadyQuiz
|
||||
{
|
||||
/*0x000*/ u8 id;
|
||||
/*0x001*/ u8 phase;
|
||||
/*0x002*/ u16 unk_002[9];
|
||||
/*0x014*/ u16 unk_014;
|
||||
/*0x016*/ u16 unk_016;
|
||||
/*0x018*/ u8 playerName[8];
|
||||
/*0x020*/ u16 playerTrainerId[4];
|
||||
/*0x028*/ u16 itemId;
|
||||
/*0x02a*/ u8 unk_02a;
|
||||
/*0x02b*/ u8 unk_02b;
|
||||
/*0x02c*/ u8 unk_02c;
|
||||
/*0x02d*/ u8 language;
|
||||
};
|
||||
|
||||
struct LilycoveLadyFavour
|
||||
{
|
||||
/*0x000*/ u8 id;
|
||||
/*0x001*/ u8 phase;
|
||||
/*0x002*/ u8 unk_002;
|
||||
/*0x003*/ u8 unk_003;
|
||||
/*0x004*/ u8 playerName[8];
|
||||
/*0x00c*/ u8 unk_00c;
|
||||
/*0x00e*/ u16 itemId;
|
||||
/*0x010*/ u16 unk_010;
|
||||
/*0x012*/ u8 language;
|
||||
};
|
||||
|
||||
struct LilycoveLadyContest
|
||||
{
|
||||
/*0x000*/ u8 id;
|
||||
/*0x001*/ u8 phase;
|
||||
/*0x002*/ u8 fave_pkblk;
|
||||
/*0x003*/ u8 other_pkblk;
|
||||
/*0x004*/ u8 playerName[8];
|
||||
/*0x00c*/ u8 max_sheen;
|
||||
/*0x00d*/ u8 category;
|
||||
/*0x00e*/ u8 language;
|
||||
};
|
||||
|
||||
typedef union // TODO
|
||||
{
|
||||
struct LilycoveLadyQuiz quiz;
|
||||
struct LilycoveLadyFavour favour;
|
||||
struct LilycoveLadyContest contest;
|
||||
u8 id;
|
||||
} LilycoveLady;
|
||||
|
||||
struct SaveBlock1
|
||||
{
|
||||
/*0x00*/ struct Coords16 pos;
|
||||
@@ -738,7 +808,8 @@ struct SaveBlock1
|
||||
/*0x3728*/ struct RamScript ramScript;
|
||||
/*0x3B14*/ struct RecordMixingGift recordMixingGift;
|
||||
/*0x3B24*/ u8 seen2[52];
|
||||
/*0x3B58*/ u8 lilycoveLady[536]; // TODO: convert to a union
|
||||
/*0x3B58*/ LilycoveLady lilycoveLady;
|
||||
/*0x3B88*/ u8 filler_3B88[0x1E8];
|
||||
/*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct
|
||||
// sizeof: 0x3D88
|
||||
};
|
||||
@@ -752,4 +823,6 @@ struct Bitmap // TODO: Find a better spot for this
|
||||
u32 height:16;
|
||||
};
|
||||
|
||||
extern u8 gReservedSpritePaletteCount;
|
||||
|
||||
#endif // GUARD_GLOBAL_H
|
||||
|
||||
19
include/gpu_regs.h
Normal file
19
include/gpu_regs.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef GUARD_GPU_REGS_H
|
||||
#define GUARD_GPU_REGS_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
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
|
||||
9
include/hall_of_fame.h
Normal file
9
include/hall_of_fame.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef GUARD_HALL_OF_FAME_H
|
||||
#define GUARD_HALL_OF_FAME_H
|
||||
|
||||
void sub_8141F90(void);
|
||||
void sub_8143648(u16 paletteTag, u8 arg1);
|
||||
void sub_81428CC(void);
|
||||
void sub_8143680(int, u8);
|
||||
|
||||
#endif // GUARD_HALL_OF_FAME_H
|
||||
12
include/item_menu.h
Normal file
12
include/item_menu.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef GUARD_item_menu_H
|
||||
#define GUARD_item_menu_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void sub_81AAC50(void);
|
||||
void sub_81AAC70(void);
|
||||
|
||||
#endif //GUARD_item_menu_H
|
||||
@@ -1,6 +1,17 @@
|
||||
#ifndef GUARD_LILYCOVE_LADY_H
|
||||
#define GUARD_LILYCOVE_LADY_H
|
||||
|
||||
u8 GetLilycoveLadyId(void);
|
||||
void SetLilycoveLady(void);
|
||||
void sub_818DA78(void);
|
||||
void sub_818DEF4(void);
|
||||
void sub_818E564(void);
|
||||
void sub_818E570(const struct LilycoveLadyQuiz *quiz);
|
||||
bool8 sub_818E704(struct Pokeblock *pokeblock);
|
||||
void sub_818E7E0(u8 *dest1, u8 *dest2);
|
||||
void sub_818E81C(u8 *dest);
|
||||
void sub_818E848(u8 *dest);
|
||||
void sub_818E868(u8 *dest, u8 category);
|
||||
u8 sub_818E880(void);
|
||||
|
||||
#endif //GUARD_LILYCOVE_LADY_H
|
||||
|
||||
@@ -18,5 +18,6 @@ void SaveSerializedGame(void);
|
||||
void LoadSerializedGame(void);
|
||||
void LoadPlayerBag(void);
|
||||
void SavePlayerBag(void);
|
||||
void SetSaveBlocksPointers(u16);
|
||||
|
||||
#endif // GUARD_LOAD_SAVE_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
|
||||
@@ -1,8 +1,14 @@
|
||||
#ifndef GUARD_MALLOC_H
|
||||
#define GUARD_MALLOC_H
|
||||
|
||||
#define malloc Alloc
|
||||
#define calloc AllocZeroed
|
||||
#define free Free
|
||||
|
||||
extern u8 gHeap[];
|
||||
void *Alloc(u32 size);
|
||||
void *AllocZeroed(u32 size);
|
||||
void Free(void *pointer);
|
||||
void InitHeap(void *pointer, u32 size);
|
||||
|
||||
#endif // GUARD_MALLOC_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
32
include/map_obj_8097404.h
Normal file
32
include/map_obj_8097404.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Created by scott on 9/7/2017.
|
||||
//
|
||||
|
||||
#ifndef GUARD_MAP_OBJ_8097404_H
|
||||
#define GUARD_MAP_OBJ_8097404_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
extern void *gUnknown_020375B8;
|
||||
|
||||
// Exported ROM declarations
|
||||
void sub_8097AC8(struct Sprite *);
|
||||
void npc_sync_anim_pause_bits(struct MapObject *);
|
||||
void oamt_npc_ministep_reset(struct Sprite *, u8, u8);
|
||||
u8 sub_8097F78(struct MapObject *);
|
||||
bool8 obj_npc_ministep(struct Sprite *sprite);
|
||||
bool8 sub_80976EC(struct Sprite *sprite);
|
||||
void sub_80976DC(struct Sprite *, u8);
|
||||
void sub_809783C(struct Sprite *, u8, u8, u8);
|
||||
void DoShadowFieldEffect(struct MapObject *);
|
||||
u8 sub_809785C(struct Sprite *);
|
||||
u8 sub_80978E4(struct Sprite *);
|
||||
void obj_anim_image_set_and_seek(struct Sprite *, u8, u8);
|
||||
bool8 sub_80979BC(struct Sprite *);
|
||||
void sub_8097750(struct Sprite *);
|
||||
bool8 sub_8097758(struct Sprite *);
|
||||
void sub_8097FA4(struct MapObject *);
|
||||
void sub_8098044(u8);
|
||||
|
||||
#endif //GUARD_MAP_OBJ_8097404_H
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#ifndef GUARD_MAUVILLE_OLD_MAN_H
|
||||
#define GUARD_MAUVILLE_OLD_MAN_H
|
||||
|
||||
void SetMauvilleOldMan(void);
|
||||
u8 sub_81201C8(void);
|
||||
|
||||
#endif // GUARD_MAUVILLE_OLD_MAN_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_MENU_H
|
||||
#define GUARD_MENU_H
|
||||
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
|
||||
struct MenuAction
|
||||
{
|
||||
@@ -15,4 +15,9 @@ struct MenuAction2
|
||||
void (*func)(u8);
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
149
include/metatile_behavior.h
Normal file
149
include/metatile_behavior.h
Normal file
@@ -0,0 +1,149 @@
|
||||
#ifndef GUARD_METATILE_BEHAVIOR
|
||||
#define GUARD_METATILE_BEHAVIOR
|
||||
|
||||
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);
|
||||
|
||||
#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
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
void MultiBootInit(struct MultiBootParam *mp);
|
||||
int MultiBootMain(struct MultiBootParam *mp);
|
||||
void MultiBootStartProbe(struct MultiBootParam *mp);
|
||||
void MultiBootStartMaster(struct MultiBootParam *mp, u8 *srcp, int length, u8 palette_color, s8 palette_speed);
|
||||
void MultiBootStartMaster(struct MultiBootParam *mp, const u8 *srcp, int length, u8 palette_color, s8 palette_speed);
|
||||
int MultiBootCheckComplete(struct MultiBootParam *mp);
|
||||
|
||||
#endif // GUARD_MULTIBOOT_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
|
||||
@@ -9,5 +9,7 @@ void ClearPokedexFlags(void);
|
||||
void WarpToTruck(void);
|
||||
void NewGameInitData(void);
|
||||
void ResetMiniGamesResults(void);
|
||||
void sub_808447C(void);
|
||||
void Sav2_ClearSetDefault(void);
|
||||
|
||||
#endif // GUARD_NEW_GAME_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;
|
||||
@@ -439,6 +443,13 @@ struct BattleMove
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
#define FLAG_MAKES_CONTACT 0x1
|
||||
#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
|
||||
{
|
||||
u8 x, y;
|
||||
@@ -514,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
|
||||
@@ -614,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
|
||||
|
||||
33
include/rom4.h
Normal file
33
include/rom4.h
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
#ifndef GUARD_ROM4_H
|
||||
#define GUARD_ROM4_H
|
||||
|
||||
struct UnkPlayerStruct
|
||||
{
|
||||
u8 player_field_0;
|
||||
u8 player_field_1;
|
||||
};
|
||||
|
||||
struct LinkPlayerMapObject
|
||||
{
|
||||
u8 active;
|
||||
u8 linkPlayerId;
|
||||
u8 mapObjId;
|
||||
u8 mode;
|
||||
};
|
||||
|
||||
struct UCoords32
|
||||
{
|
||||
u32 x, y;
|
||||
};
|
||||
|
||||
|
||||
extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4];
|
||||
|
||||
void strange_npc_table_clear(void);
|
||||
const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8);
|
||||
void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *);
|
||||
void sub_8086230(void);
|
||||
void c2_exit_to_overworld_2_switch(void);
|
||||
|
||||
#endif //GUARD_ROM4_H
|
||||
6
include/rom6.h
Normal file
6
include/rom6.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_ROM6_H
|
||||
#define GUARD_ROM6_H
|
||||
|
||||
void sub_81357FC(u8, void(void));
|
||||
|
||||
#endif //GUARD_ROM6_H
|
||||
11
include/rom_818CFC8.h
Normal file
11
include/rom_818CFC8.h
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Created by Scott Norton on 9/6/17.
|
||||
//
|
||||
|
||||
#ifndef GUARD_ROM_818CFC8_H
|
||||
#define GUARD_ROM_818CFC8_H
|
||||
|
||||
bool8 InBattlePyramid(void);
|
||||
u8 sub_81AAA40(void);
|
||||
|
||||
#endif //GUARD_ROM_818CFC8_H
|
||||
12
include/rom_81BE66C.h
Normal file
12
include/rom_81BE66C.h
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Created by Scott Norton on 9/6/17.
|
||||
//
|
||||
|
||||
#ifndef GUARD_ROM_81BE66C_H
|
||||
#define GUARD_ROM_81BE66C_H
|
||||
|
||||
bool32 InTrainerHill(void);
|
||||
bool8 FieldObjectIsFarawayIslandMew(struct MapObject *);
|
||||
u32 sub_81D427C(void);
|
||||
|
||||
#endif //GUARD_ROM_81BE66C_H
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_SAVE_H
|
||||
#define GUARD_SAVE_H
|
||||
|
||||
extern u16 gSaveFileStatus;
|
||||
|
||||
struct SaveSectionLocation
|
||||
{
|
||||
void *data;
|
||||
@@ -88,5 +90,7 @@ u16 CalculateChecksum(void *, u16);
|
||||
//u8 unref_sub_8125FF0(u8 *data, u16 size);
|
||||
//u8 unref_sub_8126068(u8 sector, u8 *data, u32 size);
|
||||
//u8 unref_sub_8126080(u8 sector, u8 *data);
|
||||
u16 sub_815355C(void);
|
||||
u8 sub_81534D0(u8);
|
||||
|
||||
#endif // GUARD_SAVE_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
|
||||
|
||||
@@ -240,6 +240,8 @@ struct OamMatrix
|
||||
extern const struct OamData gDummyOamData;
|
||||
extern const union AnimCmd *const gDummySpriteAnimTable[];
|
||||
extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[];
|
||||
extern s16 gSpriteCoordOffsetX;
|
||||
extern s16 gSpriteCoordOffsetY;
|
||||
|
||||
extern struct Sprite gSprites[];
|
||||
|
||||
|
||||
115
include/text.h
115
include/text.h
@@ -65,54 +65,67 @@
|
||||
#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
|
||||
|
||||
#define NUM_TEXT_PRINTERS 32
|
||||
|
||||
struct TextPrinterSubStruct
|
||||
{
|
||||
u8 font_type:4; // 0x14
|
||||
u8 font_type_upper:1;
|
||||
u8 font_type_5:3;
|
||||
u8 field_1:5;
|
||||
u8 field_1_upmid:2;
|
||||
u8 field_1_top:1;
|
||||
u8 frames_visible_counter;
|
||||
u8 field_3;
|
||||
u8 field_4; // 0x18
|
||||
u8 field_5;
|
||||
u8 field_6;
|
||||
u8 active;
|
||||
};
|
||||
|
||||
struct TextSubPrinter // TODO: Better name
|
||||
{
|
||||
u8* current_text_offset;
|
||||
u8 windowId;
|
||||
u8 fontId;
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 currentX; // 0x8
|
||||
u8 currentY;
|
||||
u8 letterSpacing;
|
||||
u8 lineSpacing;
|
||||
u8 fontColor_l:4; // 0xC
|
||||
u8 fontColor_h:4;
|
||||
u8 bgColor:4;
|
||||
u8 shadowColor:4;
|
||||
};
|
||||
|
||||
struct TextPrinter
|
||||
{
|
||||
struct TextSubPrinter { // TODO: Better name
|
||||
u8* current_text_offset;
|
||||
u8 windowId;
|
||||
u8 fontId;
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 currentX; // 0x8
|
||||
u8 currentY;
|
||||
u8 letterSpacing;
|
||||
u8 lineSpacing;
|
||||
u8 fontColor_l:4; // 0xC
|
||||
u8 fontColor_h:4;
|
||||
u8 bgColor:4;
|
||||
u8 shadowColor:4;
|
||||
} subPrinter;
|
||||
struct TextSubPrinter subPrinter;
|
||||
|
||||
void (*callback)(struct TextSubPrinter *, u16); // 0x10
|
||||
|
||||
union {
|
||||
struct TextPrinterSubStruct
|
||||
{
|
||||
u8 font_type:4; // 0x14
|
||||
u8 font_type_upper:4;
|
||||
u8 field_1:5;
|
||||
u8 field_1_upmid:2;
|
||||
u8 field_1_top:1;
|
||||
u8 frames_visible_counter;
|
||||
u8 field_3;
|
||||
u8 field_4; // 0x18
|
||||
u8 field_5;
|
||||
u8 field_6;
|
||||
u8 active;
|
||||
} sub;
|
||||
struct TextPrinterSubStruct sub;
|
||||
|
||||
u8 sub_fields[8];
|
||||
} sub_union;
|
||||
@@ -138,28 +151,54 @@ struct FontInfo
|
||||
u8 shadowColor:4;
|
||||
};
|
||||
|
||||
struct GlyphWidthFunc{
|
||||
extern const struct FontInfo *gFonts;
|
||||
|
||||
struct GlyphWidthFunc
|
||||
{
|
||||
u32 font_id;
|
||||
u32 (*func)(u16 glyphId, bool32 isJapanese);
|
||||
};
|
||||
|
||||
struct KeypadIcon {
|
||||
struct KeypadIcon
|
||||
{
|
||||
u16 tile_offset;
|
||||
u8 width;
|
||||
u8 height;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
u8 flag_0:1;
|
||||
u8 flag_1:1;
|
||||
u8 flag_2:1;
|
||||
} TextFlags;
|
||||
|
||||
extern TextFlags gTextFlags;
|
||||
|
||||
struct __attribute__((packed)) TextColor
|
||||
{
|
||||
u8 fgColor;
|
||||
u8 bgColor;
|
||||
u8 shadowColor;
|
||||
};
|
||||
|
||||
extern u8 gStringVar1[];
|
||||
extern u8 gStringVar2[];
|
||||
extern u8 gStringVar3[];
|
||||
extern u8 gStringVar4[];
|
||||
|
||||
u8 gUnknown_03002F84;
|
||||
u8 gUnknown_03002F90[0x20];
|
||||
u8 gUnknown_03002FB0[0x20];
|
||||
u8 gUnknown_03002FD0[0x20];
|
||||
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);
|
||||
@@ -182,13 +221,13 @@ void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter);
|
||||
void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter);
|
||||
void TextPrinterClearDownArrow(struct TextPrinter *textPrinter);
|
||||
bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter);
|
||||
bool8 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter);
|
||||
bool8 TextPrinterWait(struct TextPrinter *textPrinter);
|
||||
bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter);
|
||||
bool16 TextPrinterWait(struct TextPrinter *textPrinter);
|
||||
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex);
|
||||
u16 RenderText(struct TextPrinter *textPrinter);
|
||||
u32 GetStringWidthFixedWidthFont(u8 *str, u8 fontId, u8 letterSpacing);
|
||||
u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing);
|
||||
u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32);
|
||||
s32 GetStringWidth(u8 fontId, u8 *str, s16 letterSpacing);
|
||||
u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing);
|
||||
u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str);
|
||||
u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y);
|
||||
u8 GetKeypadIconTileOffset(u8 keypadIconId);
|
||||
|
||||
7
include/trainer_see.h
Normal file
7
include/trainer_see.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef GUARD_TRAINER_SEE_H
|
||||
#define GUARD_TRAINER_SEE_H
|
||||
|
||||
void sub_80B4578(struct MapObject *);
|
||||
void sub_8155D78(struct MapObject *);
|
||||
|
||||
#endif //GUARD_TRAINER_SEE_H
|
||||
11
include/unknown_task.h
Normal file
11
include/unknown_task.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef GUARD_unknown_task_H
|
||||
#define GUARD_unknown_task_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void remove_some_task(void);
|
||||
|
||||
#endif //GUARD_unknown_task_H
|
||||
@@ -12,6 +12,8 @@
|
||||
#define VAR_0x4008 0x4008
|
||||
#define VAR_0x4009 0x4009
|
||||
#define VAR_0x400A 0x400A
|
||||
#define VAR_0x4010 0x4010
|
||||
#define VAR_0x4011 0x4011
|
||||
#define VAR_0x401F 0x401F
|
||||
#define VAR_RECYCLE_GOODS 0x4020
|
||||
#define VAR_REPEL_STEP_COUNT 0x4021
|
||||
|
||||
@@ -24,13 +24,24 @@ struct WindowTemplate
|
||||
u16 baseBlock;
|
||||
};
|
||||
|
||||
#define DUMMY_WIN_TEMPLATE \
|
||||
{ \
|
||||
0xFF, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
}
|
||||
|
||||
struct Window
|
||||
{
|
||||
struct WindowTemplate window;
|
||||
u8 *tileData;
|
||||
};
|
||||
|
||||
bool16 InitWindows(struct WindowTemplate *templates);
|
||||
bool16 InitWindows(const struct WindowTemplate *templates);
|
||||
u16 AddWindow(const struct WindowTemplate *template);
|
||||
int AddWindowWithoutTileMap(struct WindowTemplate *template);
|
||||
void RemoveWindow(u8 windowId);
|
||||
@@ -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