start pokemon3 decomp
This commit is contained in:
+12
-3
@@ -187,8 +187,7 @@ struct Trainer
|
||||
{
|
||||
/*0x00*/ u8 partyFlags;
|
||||
/*0x01*/ u8 trainerClass;
|
||||
/*0x02*/ u8 encounterMusic:7;
|
||||
/*0x02*/ u8 gender:1;
|
||||
/*0x02*/ u8 encounterMusic_gender; // last bit is gender
|
||||
/*0x03*/ u8 trainerPic;
|
||||
/*0x04*/ u8 trainerName[12];
|
||||
/*0x10*/ u16 items[4];
|
||||
@@ -200,6 +199,8 @@ struct Trainer
|
||||
|
||||
extern const struct Trainer gTrainers[];
|
||||
|
||||
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
||||
|
||||
struct UnknownFlags
|
||||
{
|
||||
u32 flags[4];
|
||||
@@ -412,4 +413,12 @@ struct BattleScripting
|
||||
|
||||
extern struct BattleScripting gBattleScripting;
|
||||
|
||||
#endif
|
||||
struct BattleDecompressedSprites
|
||||
{
|
||||
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
void* sprites[4];
|
||||
};
|
||||
|
||||
extern struct BattleDecompressedSprites* gBattleDecompressedSprites;
|
||||
|
||||
#endif // GUARD_BATTLE_H
|
||||
|
||||
@@ -20,4 +20,9 @@ void BufferStringBattle(u16 stringID);
|
||||
u32 StrCpyDecodeToDisplayedStringBattle(const u8* src);
|
||||
u32 StrCpyDecodeBattle(const u8* src, u8* dst);
|
||||
|
||||
extern u8 gBattleTextBuff1[];
|
||||
extern u8 gBattleTextBuff2[];
|
||||
extern u8 gBattleTextBuff3[];
|
||||
extern u8 gDisplayedStringBattle[];
|
||||
|
||||
#endif // GUARD_BATTLE_MESSAGE_H
|
||||
|
||||
@@ -42,14 +42,14 @@ struct Berry2
|
||||
struct EnigmaBerry
|
||||
{
|
||||
struct Berry2 berry;
|
||||
u8 pic[(6 * 6) * TILE_SIZE_4BPP];
|
||||
u16 palette[16];
|
||||
u8 description1[45];
|
||||
u8 description2[45];
|
||||
u8 itemEffect[18];
|
||||
u8 holdEffect;
|
||||
u8 holdEffectParam;
|
||||
u32 checksum;
|
||||
u8 pic[(6 * 6) * TILE_SIZE_4BPP];
|
||||
u16 palette[16];
|
||||
u8 description1[45];
|
||||
u8 description2[45];
|
||||
};
|
||||
|
||||
struct BattleEnigmaBerry
|
||||
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
#ifndef GUARD_LINK_H
|
||||
#define GUARD_LINK_H
|
||||
|
||||
#define MAX_LINK_PLAYERS 4
|
||||
#define CMD_LENGTH 8
|
||||
#define QUEUE_CAPACITY 50
|
||||
#define BLOCK_BUFFER_SIZE 0x100
|
||||
|
||||
#define LINK_STAT_LOCAL_ID 0x00000003
|
||||
#define LINK_STAT_PLAYER_COUNT 0x0000001C
|
||||
#define LINK_STAT_PLAYER_COUNT_SHIFT 2
|
||||
#define LINK_STAT_MASTER 0x00000020
|
||||
#define LINK_STAT_MASTER_SHIFT 5
|
||||
#define LINK_STAT_CONN_ESTABLISHED 0x00000040
|
||||
#define LINK_STAT_CONN_ESTABLISHED_SHIFT 6
|
||||
#define LINK_STAT_RECEIVED_NOTHING 0x00000100
|
||||
#define LINK_STAT_RECEIVED_NOTHING_SHIFT 8
|
||||
#define LINK_STAT_ERRORS 0x0007F000
|
||||
|
||||
#define EXTRACT_PLAYER_COUNT(status) \
|
||||
(((status) & LINK_STAT_PLAYER_COUNT) >> LINK_STAT_PLAYER_COUNT_SHIFT)
|
||||
#define EXTRACT_MASTER(status) \
|
||||
(((status) >> LINK_STAT_MASTER_SHIFT) & 1)
|
||||
#define EXTRACT_CONN_ESTABLISHED(status) \
|
||||
(((status) >> LINK_STAT_CONN_ESTABLISHED_SHIFT) & 1)
|
||||
#define EXTRACT_RECEIVED_NOTHING(status) \
|
||||
(((status) >> LINK_STAT_RECEIVED_NOTHING_SHIFT) & 1)
|
||||
|
||||
#define MASTER_HANDSHAKE 0x8FFF
|
||||
#define SLAVE_HANDSHAKE 0xB9A0
|
||||
|
||||
enum
|
||||
{
|
||||
LINK_STATE_START0,
|
||||
LINK_STATE_START1,
|
||||
LINK_STATE_HANDSHAKE,
|
||||
LINK_STATE_INIT_TIMER,
|
||||
LINK_STATE_CONN_ESTABLISHED,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
EXCHANGE_NOT_STARTED,
|
||||
EXCHANGE_COMPLETE,
|
||||
EXCHANGE_TIMED_OUT,
|
||||
EXCHANGE_IN_PROGRESS,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
QUEUE_FULL_NONE,
|
||||
QUEUE_FULL_SEND,
|
||||
QUEUE_FULL_RECV,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
LAG_NONE,
|
||||
LAG_MASTER,
|
||||
LAG_SLAVE,
|
||||
};
|
||||
|
||||
struct LinkPlayer
|
||||
{
|
||||
/* 0x00 */ u16 version;
|
||||
/* 0x02 */ u16 lp_field_2;
|
||||
/* 0x04 */ u32 trainerId;
|
||||
/* 0x08 */ u8 name[11];
|
||||
/* 0x13 */ u8 gender;
|
||||
/* 0x14 */ u32 linkType;
|
||||
/* 0x18 */ u16 lp_field_18;
|
||||
/* 0x1A */ u16 language;
|
||||
};
|
||||
|
||||
struct LinkPlayerBlock
|
||||
{
|
||||
u8 magic1[16];
|
||||
struct LinkPlayer linkPlayer;
|
||||
u8 magic2[16];
|
||||
};
|
||||
|
||||
// circular queues
|
||||
|
||||
struct SendQueue
|
||||
{
|
||||
u16 data[CMD_LENGTH][QUEUE_CAPACITY];
|
||||
u8 pos;
|
||||
u8 count;
|
||||
};
|
||||
|
||||
struct RecvQueue
|
||||
{
|
||||
u16 data[MAX_LINK_PLAYERS][CMD_LENGTH][QUEUE_CAPACITY];
|
||||
u8 pos;
|
||||
u8 count;
|
||||
};
|
||||
|
||||
struct Link
|
||||
{
|
||||
u8 isMaster; // 0: slave, 8: master
|
||||
u8 state;
|
||||
u8 localId; // local multi-player ID
|
||||
u8 playerCount;
|
||||
u16 tempRecvBuffer[4];
|
||||
bool8 receivedNothing;
|
||||
s8 serialIntrCounter;
|
||||
bool8 handshakeAsMaster;
|
||||
u8 link_field_F;
|
||||
|
||||
// error conditions
|
||||
bool8 hardwareError; // hardware reported an error
|
||||
bool8 badChecksum; // checksum didn't match between devices
|
||||
u8 queueFull; // send or recv queue out of space
|
||||
u8 lag; // connection is lagging
|
||||
|
||||
u16 checksum;
|
||||
|
||||
u8 sendCmdIndex;
|
||||
u8 recvCmdIndex;
|
||||
|
||||
struct SendQueue sendQueue;
|
||||
struct RecvQueue recvQueue;
|
||||
};
|
||||
|
||||
struct BlockRequest
|
||||
{
|
||||
void * address;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
extern const struct BlockRequest sBlockRequestLookupTable[5];
|
||||
|
||||
extern struct Link gLink;
|
||||
extern u16 gRecvCmds[CMD_LENGTH][MAX_LINK_PLAYERS];
|
||||
extern u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE];
|
||||
extern u16 gLinkType;
|
||||
extern u32 gLinkStatus;
|
||||
extern u16 gBlockRecvBuffer[MAX_LINK_PLAYERS][BLOCK_BUFFER_SIZE / 2];
|
||||
extern u16 gSendCmd[CMD_LENGTH];
|
||||
extern u8 gShouldAdvanceLinkState;
|
||||
extern struct LinkPlayer gLinkPlayers[];
|
||||
extern u16 word_3002910[];
|
||||
extern bool8 gReceivedRemoteLinkPlayers;
|
||||
|
||||
void Task_DestroySelf(u8);
|
||||
void sub_8007270(u8);
|
||||
void OpenLink(void);
|
||||
void CloseLink(void);
|
||||
u16 LinkMain2(u16 *);
|
||||
void sub_8007B14(void);
|
||||
bool32 sub_8007B24(void);
|
||||
void ClearLinkCallback(void);
|
||||
void ClearLinkCallback_2(void);
|
||||
u8 GetLinkPlayerCount(void);
|
||||
void OpenLinkTimed(void);
|
||||
u8 GetLinkPlayerDataExchangeStatusTimed(void);
|
||||
bool8 IsLinkPlayerDataExchangeComplete(void);
|
||||
u32 GetLinkPlayerTrainerId(u8);
|
||||
void ResetLinkPlayers(void);
|
||||
void sub_8007E24(void);
|
||||
void sub_8007E4C(void);
|
||||
u8 GetMultiplayerId(void);
|
||||
u8 bitmask_all_link_players_but_self(void);
|
||||
bool8 SendBlock(u8, void *, u16);
|
||||
bool8 sub_8007E9C(u8);
|
||||
bool8 sub_8007ECC(void);
|
||||
u8 GetBlockReceivedStatus(void);
|
||||
void ResetBlockReceivedFlags(void);
|
||||
void ResetBlockReceivedFlag(u8);
|
||||
void sub_8007F4C(void);
|
||||
void SetLinkDebugValues(u32, u32);
|
||||
u8 sub_8008198(void);
|
||||
void sub_80081C8(u8);
|
||||
u8 sub_800820C(void);
|
||||
u8 sub_8008218(void);
|
||||
void sub_800826C(void);
|
||||
void sub_80082EC(void);
|
||||
u8 GetLinkPlayerCount_2(void);
|
||||
bool8 IsLinkMaster(void);
|
||||
void sub_800832C(void);
|
||||
void sub_8008480(void);
|
||||
void sub_80084A4(void);
|
||||
void CB2_LinkError(void);
|
||||
u8 GetSioMultiSI(void);
|
||||
bool8 IsLinkConnectionEstablished(void);
|
||||
void SetSuppressLinkErrorMessage(bool8);
|
||||
bool8 HasLinkErrorOccurred(void);
|
||||
void ResetSerial(void);
|
||||
u32 LinkMain1(u8 *, u16 *, u16[CMD_LENGTH][MAX_LINK_PLAYERS]);
|
||||
void LinkVSync(void);
|
||||
void Timer3Intr(void);
|
||||
void SerialCB(void);
|
||||
|
||||
#endif // GUARD_LINK_H
|
||||
@@ -420,6 +420,12 @@ struct BattleMove
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
struct SpindaSpot
|
||||
{
|
||||
u8 x, y;
|
||||
u16 image[16];
|
||||
};
|
||||
|
||||
struct __attribute__((packed)) LevelUpMove
|
||||
{
|
||||
u16 move:9;
|
||||
@@ -483,9 +489,11 @@ extern struct Pokemon gPlayerParty[PARTY_SIZE];
|
||||
extern u8 gEnemyPartyCount;
|
||||
extern struct Pokemon gEnemyParty[PARTY_SIZE];
|
||||
extern const struct BaseStats gBaseStats[];
|
||||
extern const u8 *const gItemEffectTable[];
|
||||
extern const struct EvolutionData gEvolutionTable[];
|
||||
extern struct PokemonStorage* gPokemonStoragePtr;
|
||||
extern const u32 gExperienceTables[][MAX_MON_LEVEL + 1];
|
||||
extern const u16 *const gLevelUpLearnsets[];
|
||||
|
||||
void ZeroBoxMonData(struct BoxPokemon *boxMon);
|
||||
void ZeroMonData(struct Pokemon *mon);
|
||||
@@ -551,4 +559,28 @@ void CopyPlayerPartyMonToBattleData(u8 battleIndex, u8 partyIndex);
|
||||
u8 GetNature(struct Pokemon *mon);
|
||||
u8 GetNatureFromPersonality(u32 personality);
|
||||
|
||||
u16 nature_stat_mod(u8 nature, u16 n, u8 statIndex);
|
||||
|
||||
void MonRestorePP(struct Pokemon *);
|
||||
|
||||
u16 NationalPokedexNumToSpecies(u16 nationalNum);
|
||||
u16 NationalToHoennOrder(u16);
|
||||
u16 SpeciesToNationalPokedexNum(u16);
|
||||
u16 HoennToNationalOrder(u16);
|
||||
u16 SpeciesToCryId(u16 species);
|
||||
void DrawSpindaSpots(u16, u32, u8 *, u8);
|
||||
void AdjustFriendship(struct Pokemon *, u8);
|
||||
u8 CheckPartyHasHadPokerus(struct Pokemon *, u8);
|
||||
void UpdatePartyPokerusTime(u16);
|
||||
u32 CanMonLearnTMHM(struct Pokemon *, u8);
|
||||
u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
|
||||
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
|
||||
void ClearBattleMonForms(void);
|
||||
const u8 *pokemon_get_pal(struct Pokemon *mon);
|
||||
const u8 *species_and_otid_get_pal(u16, u32, u32);
|
||||
const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32);
|
||||
bool8 IsOtherTrainer(u32, u8 *);
|
||||
void SetWildMonHeldItem(void);
|
||||
u16 GetMonEVCount(struct Pokemon *);
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef GUARD_TRAINER_CLASS_H
|
||||
#define GUARD_TRAINER_CLASS_H
|
||||
|
||||
enum
|
||||
{
|
||||
CLASS_PKMN_TRAINER0, //0
|
||||
CLASS_PKMN_TRAINER1, //1
|
||||
CLASS_HIKER, //2
|
||||
CLASS_TEAM_AQUA, //3
|
||||
CLASS_PKMN_BREEDER, //4
|
||||
CLASS_COOLTRAINER, //5
|
||||
CLASS_BIRDKEEPER, //6
|
||||
CLASS_COLLECTOR, //7
|
||||
CLASS_SWIMMER_MALE, //8
|
||||
CLASS_TEAM_MAGMA, //9
|
||||
CLASS_EXPERT, // 0xA
|
||||
CLASS_AQUA_ADMIN, // 0xB
|
||||
CLASS_BLACK_BELT, // 0xC
|
||||
CLASS_AQUA_LEADER, // 0xD
|
||||
CLASS_HEX_MANIAC, // 0xE
|
||||
CLASS_AROMA_LADY, // 0xF
|
||||
CLASS_RUIN_MANIAC, // 0x10
|
||||
CLASS_INTERVIEWER, // 0x11
|
||||
CLASS_TUBER_FEMALE, // 0x12
|
||||
CLASS_TUBER_MALE, // 0x13
|
||||
CLASS_LADY, // 0x14
|
||||
CLASS_BEAUTY, // 0x15
|
||||
CLASS_RICH_BOY, // 0x16
|
||||
CLASS_POKEMANIAC, // 0x17
|
||||
CLASS_GUITARIST, // 0x18
|
||||
CLASS_KINDLER, // 0x19
|
||||
CLASS_CAMPER, // 0x1A
|
||||
CLASS_PICKNICKER, // 0x1B
|
||||
CLASS_BUG_MANIAC, // 0x1C
|
||||
CLASS_PSYCHIC, // 0x1D
|
||||
CLASS_GENTLEMAN, // 0x1E
|
||||
CLASS_ELITE_FOUR, // 0x1F
|
||||
CLASS_LEADER, // 0x20
|
||||
CLASS_CHAMPION = 0x26,
|
||||
CLASS_MAGMA_ADMIN = 0x31,
|
||||
CLASS_PKMN_TRAINER_RIVAL = 0x32,
|
||||
CLASS_MAGMA_LEADER = 0x35,
|
||||
CLASS_SALON_MAIDEN = 0x3A,
|
||||
CLASS_DOME_ACE, // 0x3B
|
||||
CLASS_PALACE_MAVEN, // 0x3C
|
||||
CLASS_ARENA_TYCOON, // 0x3D
|
||||
CLASS_FACTORY_HEAD, // 0x3E
|
||||
CLASS_PIKE_QUEEN, // 0x3F
|
||||
CLASS_PYRAMID_KING, // 0x40
|
||||
CLASS_PKMN_TRAINER2, // 0x41
|
||||
};
|
||||
|
||||
#endif // GUARD_TRAINER_CLASS_H
|
||||
Reference in New Issue
Block a user