From 2e41368ac4a4c409cd97a1afe166a7f9a363eb1e Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Mon, 11 Dec 2017 17:11:30 -0500 Subject: [PATCH] Factor out one more data table --- battle/objects/functions.asm | 20 +++++--------------- data/ball_colors.asm | 13 +++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 data/ball_colors.asm diff --git a/battle/objects/functions.asm b/battle/objects/functions.asm index 3af7b6dad..77c56c7b2 100755 --- a/battle/objects/functions.asm +++ b/battle/objects/functions.asm @@ -424,7 +424,7 @@ BattleAnimFunction_PokeBallBlocked: ; cd212 (33:5212) ret GetBallAnimPal: ; cd249 (33:5249) - ld hl, .balls + ld hl, BallColors ld a, [rSVBK] push af ld a, $1 @@ -448,22 +448,12 @@ GetBallAnimPal: ; cd249 (33:5249) add hl, bc ld [hl], a ret - ; cd26c (33:526c) -.balls - db MASTER_BALL, PAL_BATTLE_OB_GREEN - db ULTRA_BALL, PAL_BATTLE_OB_YELLOW - db GREAT_BALL, PAL_BATTLE_OB_BLUE - db POKE_BALL, PAL_BATTLE_OB_RED - db HEAVY_BALL, PAL_BATTLE_OB_GRAY - db LEVEL_BALL, PAL_BATTLE_OB_BROWN - db LURE_BALL, PAL_BATTLE_OB_BLUE - db FAST_BALL, PAL_BATTLE_OB_BLUE - db FRIEND_BALL, PAL_BATTLE_OB_YELLOW - db MOON_BALL, PAL_BATTLE_OB_GRAY - db LOVE_BALL, PAL_BATTLE_OB_RED - db -1, PAL_BATTLE_OB_GRAY + +BallColors: +INCLUDE "data/ball_colors.asm" ; cd284 + BattleAnimFunction_10: ; cd284 (33:5284) call BattleAnim_AnonJumptable .anon_dw diff --git a/data/ball_colors.asm b/data/ball_colors.asm new file mode 100644 index 000000000..9b6cdc50a --- /dev/null +++ b/data/ball_colors.asm @@ -0,0 +1,13 @@ +; colors of balls thrown in battle + db MASTER_BALL, PAL_BATTLE_OB_GREEN + db ULTRA_BALL, PAL_BATTLE_OB_YELLOW + db GREAT_BALL, PAL_BATTLE_OB_BLUE + db POKE_BALL, PAL_BATTLE_OB_RED + db HEAVY_BALL, PAL_BATTLE_OB_GRAY + db LEVEL_BALL, PAL_BATTLE_OB_BROWN + db LURE_BALL, PAL_BATTLE_OB_BLUE + db FAST_BALL, PAL_BATTLE_OB_BLUE + db FRIEND_BALL, PAL_BATTLE_OB_YELLOW + db MOON_BALL, PAL_BATTLE_OB_GRAY + db LOVE_BALL, PAL_BATTLE_OB_RED + db -1, PAL_BATTLE_OB_GRAY