Move vars to battle_main.c

This commit is contained in:
DizzyEggg 2018-11-19 17:36:39 +01:00
parent 5d5b4b853c
commit 37d49b34e0
4 changed files with 25 additions and 49 deletions

View File

@ -664,6 +664,18 @@ struct MonSpritesGfx
};
// All battle variables are declared in battle_main.c
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattle_WIN1H;
extern u16 gBattle_WIN1V;
extern u8 gDisplayedStringBattle[300];
extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT];
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
@ -769,17 +781,4 @@ extern u8 gMultiUsePlayerCursor;
extern u8 gNumberOfMovesToChoose;
extern u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT];
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattle_WIN1H;
extern u16 gBattle_WIN1V;
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
#endif // GUARD_BATTLE_H

View File

@ -173,6 +173,18 @@ static void HandleAction_NothingIsFainted(void);
static void HandleAction_ActionFinished(void);
// EWRAM vars
EWRAM_DATA u16 gBattle_BG0_X = 0;
EWRAM_DATA u16 gBattle_BG0_Y = 0;
EWRAM_DATA u16 gBattle_BG1_X = 0;
EWRAM_DATA u16 gBattle_BG1_Y = 0;
EWRAM_DATA u16 gBattle_BG2_X = 0;
EWRAM_DATA u16 gBattle_BG2_Y = 0;
EWRAM_DATA u16 gBattle_BG3_X = 0;
EWRAM_DATA u16 gBattle_BG3_Y = 0;
EWRAM_DATA u16 gBattle_WIN0H = 0;
EWRAM_DATA u16 gBattle_WIN0V = 0;
EWRAM_DATA u16 gBattle_WIN1H = 0;
EWRAM_DATA u16 gBattle_WIN1V = 0;
EWRAM_DATA u8 gDisplayedStringBattle[300] = {0};
EWRAM_DATA u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT] = {0};
EWRAM_DATA u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT] = {0};

View File

@ -10,6 +10,7 @@
#include "item.h"
#include "battle_factory_screen.h"
#include "frontier_util.h"
#include "string_util.h"
#include "constants/items.h"
#include "constants/region_map_sections.h"

View File

@ -122,42 +122,6 @@ gUnknown_02022D0C: @ 2022D0C
gUnknown_02022E10: @ 2022E10
.space 0x4
gBattle_BG0_X: @ 2022E14
.space 0x2
gBattle_BG0_Y: @ 2022E16
.space 0x2
gBattle_BG1_X: @ 2022E18
.space 0x2
gBattle_BG1_Y: @ 2022E1A
.space 0x2
gBattle_BG2_X: @ 2022E1C
.space 0x2
gBattle_BG2_Y: @ 2022E1E
.space 0x2
gBattle_BG3_X: @ 2022E20
.space 0x2
gBattle_BG3_Y: @ 2022E22
.space 0x2
gBattle_WIN0H: @ 2022E24
.space 0x2
gBattle_WIN0V: @ 2022E26
.space 0x2
gBattle_WIN1H: @ 2022E28
.space 0x2
gBattle_WIN1V: @ 2022E2A
.space 0x2
.include "src/battle_main.o"
.include "src/pokemon.o"
.include "src/random.o"