start decompiling battle2
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
#define BATTLE_TYPE_KYORGE 0x20000000
|
||||
#define BATTLE_TYPE_RAYQUAZA 0x40000000
|
||||
|
||||
#define TRAINER_OPPONENT_C00 0xC00
|
||||
#define TRAINER_OPPONENT_800 0x800
|
||||
#define STEVEN_PARTNER_ID 0xC03
|
||||
#define SECRET_BASE_OPPONENT 0x400
|
||||
|
||||
@@ -215,14 +217,17 @@
|
||||
#define BATTLE_TERRAIN_POND 5
|
||||
#define BATTLE_TERRAIN_ROCK 6
|
||||
#define BATTLE_TERRAIN_CAVE 7
|
||||
#define BATTLE_TERRAIN_INSIDE 8
|
||||
|
||||
// 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 MULTIUSE_STATE 0x0
|
||||
#define CURSOR_POSITION 0x1
|
||||
#define TASK_ID 0x1 // task Id and cursor position share the same field
|
||||
#define SPRITES_INIT_STATE1 0x1 // shares the Id as well
|
||||
#define SPRITES_INIT_STATE2 0x2
|
||||
#define MOVE_EFFECT_BYTE 0x3
|
||||
#define MULTISTRING_CHOOSER 0x5
|
||||
#define MSG_DISPLAY 0x7
|
||||
|
||||
#define MOVE_TARGET_SELECTED 0x0
|
||||
#define MOVE_TARGET_DEPENDS 0x1
|
||||
@@ -633,15 +638,13 @@ struct BattleStruct
|
||||
u8 field_A5;
|
||||
u8 field_A6;
|
||||
u8 field_A7;
|
||||
u16 hpOnSwitchout[4];
|
||||
u16 hpOnSwitchout[2];
|
||||
u32 savedBattleTypeFlags;
|
||||
u8 field_B0;
|
||||
u8 hpScale;
|
||||
u8 synchronizeMoveEffect;
|
||||
u8 field_B3;
|
||||
u8 field_B4;
|
||||
u8 field_B5;
|
||||
u8 field_B6;
|
||||
u8 field_B7;
|
||||
void (*savedCallback)(void);
|
||||
u16 usedHeldItems[BATTLE_BANKS_COUNT];
|
||||
u8 field_C0[8];
|
||||
u16 choicedMove[BATTLE_BANKS_COUNT];
|
||||
@@ -654,7 +657,11 @@ struct BattleStruct
|
||||
u8 field_DF;
|
||||
u8 mirrorMoveArrays[32];
|
||||
u16 castformPalette[4][16];
|
||||
u8 field_180[32];
|
||||
u8 field_180;
|
||||
u8 field_181;
|
||||
u8 field_182;
|
||||
u8 field_183;
|
||||
struct BattleEnigmaBerry battleEnigmaBerry;
|
||||
u8 field_1A0;
|
||||
u8 field_1A1;
|
||||
u8 filler1A2;
|
||||
@@ -842,13 +849,24 @@ struct BattleScripting
|
||||
u8 atk6C_state;
|
||||
u8 learnMoveState;
|
||||
u8 field_20;
|
||||
u8 field_21;
|
||||
u8 field_22;
|
||||
u8 field_23;
|
||||
u8 field_24;
|
||||
u8 multiplayerId;
|
||||
};
|
||||
|
||||
extern struct BattleScripting gBattleScripting;
|
||||
|
||||
// functions
|
||||
|
||||
// battle_1
|
||||
void LoadBattleTextboxAndBackground(void);
|
||||
void LoadBattleEntryBackground(void);
|
||||
void task00_0800F6FC(u8 taskId);
|
||||
|
||||
// battle_2
|
||||
void CB2_InitBattle(void);
|
||||
void CancelMultiTurnMoves(u8 bank);
|
||||
void PressurePPLose(u8 bankAtk, u8 bankDef, u16 move);
|
||||
void PrepareStringBattle(u16 stringId, u8 bank);
|
||||
@@ -914,13 +932,18 @@ extern void (* const gBattleScriptingCommandsTable[])(void);
|
||||
extern const u8 gUnknown_0831C494[];
|
||||
|
||||
// battle_5
|
||||
void AllocateBattleResrouces(void);
|
||||
void AdjustFriendshipOnBattleFaint(u8 bank);
|
||||
void sub_80571DC(u8 bank, u8 arg1);
|
||||
u32 sub_805725C(u8 bank);
|
||||
|
||||
// battle 7
|
||||
void AllocateBattleSpritesData(void);
|
||||
void BattleMusicStop(void);
|
||||
void sub_805E990(struct Pokemon* mon, u8 bank);
|
||||
void AllocateMonSpritesGfx(void);
|
||||
void sub_805EF14(void);
|
||||
bool8 BattleInitAllSprites(u8 *state1, u8 *state2);
|
||||
|
||||
// rom_80A5C6C
|
||||
u8 GetBankSide(u8 bank);
|
||||
@@ -931,13 +954,13 @@ u8 GetBankByIdentity(u8 bank);
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
struct BattleSpritesGfx
|
||||
struct MonSpritesGfx
|
||||
{
|
||||
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
void* sprites[4];
|
||||
struct SpriteTemplate templates[4];
|
||||
};
|
||||
|
||||
extern struct BattleSpritesGfx* gBattleSpritesGfx;
|
||||
extern struct MonSpritesGfx* gMonSpritesGfxPtr;
|
||||
|
||||
#endif // GUARD_BATTLE_H
|
||||
|
||||
6
include/battle_setup.h
Normal file
6
include/battle_setup.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_BATTLE_SETUP_H
|
||||
#define GUARD_BATTLE_SETUP_H
|
||||
|
||||
u8 BattleSetup_GetTerrainId(void);
|
||||
|
||||
#endif // GUARD_BATTLE_SETUP_H
|
||||
@@ -84,6 +84,8 @@
|
||||
#define SYS_CTRL_OBJ_DELETE CODE_FLAGS + 0x61
|
||||
#define SYS_RESET_RTC_ENABLE CODE_FLAGS + 0x62
|
||||
|
||||
#define SYS_FRONTIER_PASS CODE_FLAGS + 0x72
|
||||
|
||||
#define SYS_STORAGE_UNKNOWN_FLAG CODE_FLAGS + 0x77
|
||||
|
||||
#define SYS_MYSTERY_GIFT_ENABLE CODE_FLAGS + 0x7B
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#ifndef GUARD_GLOBAL_BERRY_H
|
||||
#define GUARD_GLOBAL_BERRY_H
|
||||
|
||||
#define BERRY_NAME_COUNT 7
|
||||
#define BERRY_ITEM_EFFECT_COUNT 18
|
||||
|
||||
struct Berry
|
||||
{
|
||||
const u8 name[7];
|
||||
const u8 name[BERRY_NAME_COUNT];
|
||||
u8 firmness;
|
||||
u16 size;
|
||||
u8 maxYield;
|
||||
@@ -23,7 +26,7 @@ struct Berry
|
||||
|
||||
struct Berry2
|
||||
{
|
||||
u8 name[7];
|
||||
u8 name[BERRY_NAME_COUNT];
|
||||
u8 firmness;
|
||||
u16 size;
|
||||
u8 maxYield;
|
||||
@@ -42,7 +45,7 @@ struct Berry2
|
||||
struct EnigmaBerry
|
||||
{
|
||||
struct Berry2 berry;
|
||||
u8 itemEffect[18];
|
||||
u8 itemEffect[BERRY_ITEM_EFFECT_COUNT];
|
||||
u8 holdEffect;
|
||||
u8 holdEffectParam;
|
||||
u32 checksum;
|
||||
@@ -50,9 +53,9 @@ struct EnigmaBerry
|
||||
|
||||
struct BattleEnigmaBerry
|
||||
{
|
||||
/*0x00*/ u8 name[7];
|
||||
/*0x00*/ u8 name[BERRY_NAME_COUNT];
|
||||
/*0x07*/ u8 holdEffect;
|
||||
/*0x08*/ u8 itemEffect[18];
|
||||
/*0x08*/ u8 itemEffect[BERRY_ITEM_EFFECT_COUNT];
|
||||
/*0x1A*/ u8 holdEffectParam;
|
||||
};
|
||||
|
||||
|
||||
@@ -198,8 +198,13 @@ struct SaveBlock2
|
||||
// All below could be a one giant struct
|
||||
|
||||
/*0x64C*/ u8 field_64C[1629];
|
||||
/*0xCA9*/ u8 frontierChosenLvl : 2;
|
||||
/*0xCA9*/ u8 field_CA9_a : 6;
|
||||
/*0xCA9*/ u8 frontierChosenLvl : 2; // 0x1, 0x2 -> 0x3
|
||||
/*0xCA9*/ u8 field_CA9_a : 1; // 0x4
|
||||
/*0xCA9*/ u8 field_CA9_b : 1; // 0x8
|
||||
/*0xCA9*/ u8 field_CA9_c : 1; // 0x10
|
||||
/*0xCA9*/ u8 field_CA9_d : 1; // 0x20
|
||||
/*0xCA9*/ u8 field_CA9_e : 1; // 0x40
|
||||
/*0xCA9*/ u8 field_CA9_f : 1; // 0x80
|
||||
/*0xCAA*/ u8 field_CAA[368];
|
||||
/*0xE1A*/ u16 battlePyramidFloor; // possibly?
|
||||
/*0xE1C*/ u8 field_E1C[16];
|
||||
|
||||
@@ -143,7 +143,6 @@ extern u16 word_3002910[];
|
||||
extern bool8 gReceivedRemoteLinkPlayers;
|
||||
|
||||
void Task_DestroySelf(u8);
|
||||
void sub_8007270(u8);
|
||||
void OpenLink(void);
|
||||
void CloseLink(void);
|
||||
u16 LinkMain2(u16 *);
|
||||
@@ -162,24 +161,12 @@ 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);
|
||||
@@ -191,4 +178,9 @@ void LinkVSync(void);
|
||||
void Timer3Intr(void);
|
||||
void SerialCB(void);
|
||||
|
||||
void sub_800E0E8(void);
|
||||
bool8 sub_800A520(void);
|
||||
bool8 sub_8010500(void);
|
||||
void sub_800DFB4(u8, u8);
|
||||
|
||||
#endif // GUARD_LINK_H
|
||||
|
||||
@@ -19,5 +19,6 @@ void LoadSerializedGame(void);
|
||||
void LoadPlayerBag(void);
|
||||
void SavePlayerBag(void);
|
||||
void SetSaveBlocksPointers(u16);
|
||||
void MoveSaveBlocks_ResetHeap(void);
|
||||
|
||||
#endif // GUARD_LOAD_SAVE_H
|
||||
|
||||
@@ -632,6 +632,7 @@ void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
|
||||
s32 sub_806D864(u16 a1);
|
||||
bool16 sub_806D82C(u8 id);
|
||||
u16 MonTryLearningNewMove(struct Pokemon* mon, bool8);
|
||||
void sub_8068AA4(void); // sets stats for deoxys
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#ifndef GUARD_RECORDED_BATTLE_H
|
||||
#define GUARD_RECORDED_BATTLE_H
|
||||
|
||||
extern u32 gRecordedBattleRngSeed;
|
||||
|
||||
void sub_8185F84(void);
|
||||
void sub_8184E58(void);
|
||||
void RecordedBattle_SetBankAction(u8 bank, u8 action);
|
||||
void sub_8185F90(u16 arg0);
|
||||
|
||||
#endif // GUARD_RECORDED_BATTLE_H
|
||||
|
||||
@@ -2,10 +2,20 @@
|
||||
#define GUARD_unknown_task_H
|
||||
|
||||
// Exported type declarations
|
||||
struct UnknownTaskStruct
|
||||
{
|
||||
volatile void *dest;
|
||||
u32 control;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
};
|
||||
|
||||
extern struct UnknownTaskStruct gUnknown_0831AC70;
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void remove_some_task(void);
|
||||
void sub_80BA038(struct UnknownTaskStruct arg0);
|
||||
|
||||
#endif //GUARD_unknown_task_H
|
||||
#endif // GUARD_unknown_task_H
|
||||
|
||||
Reference in New Issue
Block a user