diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index 27eee478a..4df690e59 100644 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -7327,8 +7327,8 @@ _081A36C2: bx r1 thumb_func_end sub_81A3610 - thumb_func_start sub_81A36D0 -sub_81A36D0: @ 81A36D0 + thumb_func_start CopyFrontierTrainerText +CopyFrontierTrainerText: @ 81A36D0 push {lr} lsls r0, 24 lsrs r0, 24 @@ -7561,7 +7561,7 @@ _081A38F8: pop {r0} bx r0 .pool - thumb_func_end sub_81A36D0 + thumb_func_end CopyFrontierTrainerText thumb_func_start sub_81A3908 sub_81A3908: @ 81A3908 diff --git a/graphics/battle_interface/window4.png b/graphics/battle_interface/healthbox_doubles_opponent.png similarity index 100% rename from graphics/battle_interface/window4.png rename to graphics/battle_interface/healthbox_doubles_opponent.png diff --git a/graphics/battle_interface/window3.png b/graphics/battle_interface/healthbox_doubles_player.png similarity index 100% rename from graphics/battle_interface/window3.png rename to graphics/battle_interface/healthbox_doubles_player.png diff --git a/graphics/battle_interface/window5.png b/graphics/battle_interface/healthbox_safari.png similarity index 100% rename from graphics/battle_interface/window5.png rename to graphics/battle_interface/healthbox_safari.png diff --git a/graphics/battle_interface/window2.png b/graphics/battle_interface/healthbox_singles_opponent.png similarity index 100% rename from graphics/battle_interface/window2.png rename to graphics/battle_interface/healthbox_singles_opponent.png diff --git a/graphics/battle_interface/window.png b/graphics/battle_interface/healthbox_singles_player.png similarity index 100% rename from graphics/battle_interface/window.png rename to graphics/battle_interface/healthbox_singles_player.png diff --git a/include/battle_frontier_2.h b/include/battle_frontier_2.h index 4ef860e80..d032f9f74 100644 --- a/include/battle_frontier_2.h +++ b/include/battle_frontier_2.h @@ -1,6 +1,11 @@ #ifndef GUARD_BATTLE_FRONTIER_2_H #define GUARD_BATTLE_FRONTIER_2_H +#define FRONTIER_BEFORE_TEXT 0 +#define FRONTIER_WIN_TEXT 1 +#define FRONTIER_LOSE_TEXT 2 + +void CopyFrontierTrainerText(u8 whichText, u16 trainerId); void sub_81A8934(u8); void sub_81A895C(void); u16 sub_81A89A0(u8); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 23ed8a19f..b4dcf586d 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -47,11 +47,11 @@ extern const u32 gUnknown_08C093F0[]; extern const u32 gSubstituteDollTilemap[]; extern const u32 gSubstituteDollGfx[]; extern const u16 gSubstituteDollPal[]; -extern const u8 gUnknown_08C1F1C8[]; -extern const u8 gUnknown_08C1F46C[]; -extern const u8 gUnknown_08C1F5E8[]; -extern const u8 gUnknown_08C1F76C[]; -extern const u8 gUnknown_08C1F8E8[]; +extern const u8 gHealthboxSinglesPlayerGfx[]; +extern const u8 gHealthboxSinglesOpponentGfx[]; +extern const u8 gHealthboxDoublesPlayerGfx[]; +extern const u8 gHealthboxDoublesOpponentGfx[]; +extern const u8 gHealthboxSafariGfx[]; extern const u8 gBlankGfxCompressed[]; extern const u16 gBattleInterface_BallStatusBarPal[]; extern const u16 gBattleInterface_BallDisplayPal[]; @@ -72,29 +72,29 @@ static void ClearSpritesBattlerHealthboxAnimData(void); // const rom data static const struct CompressedSpriteSheet sSpriteSheet_SinglesPlayerHealthbox = { - gUnknown_08C1F1C8, 0x1000, TAG_HEALTHBOX_PLAYER1_TILE + gHealthboxSinglesPlayerGfx, 0x1000, TAG_HEALTHBOX_PLAYER1_TILE }; static const struct CompressedSpriteSheet sSpriteSheet_SinglesOpponentHealthbox = { - gUnknown_08C1F46C, 0x1000, TAG_HEALTHBOX_OPPONENT1_TILE + gHealthboxSinglesOpponentGfx, 0x1000, TAG_HEALTHBOX_OPPONENT1_TILE }; static const struct CompressedSpriteSheet sSpriteSheets_DoublesPlayerHealthbox[2] = { - {gUnknown_08C1F5E8, 0x800, TAG_HEALTHBOX_PLAYER1_TILE}, - {gUnknown_08C1F5E8, 0x800, TAG_HEALTHBOX_PLAYER2_TILE} + {gHealthboxDoublesPlayerGfx, 0x800, TAG_HEALTHBOX_PLAYER1_TILE}, + {gHealthboxDoublesPlayerGfx, 0x800, TAG_HEALTHBOX_PLAYER2_TILE} }; static const struct CompressedSpriteSheet sSpriteSheets_DoublesOpponentHealthbox[2] = { - {gUnknown_08C1F76C, 0x800, TAG_HEALTHBOX_OPPONENT1_TILE}, - {gUnknown_08C1F76C, 0x800, TAG_HEALTHBOX_OPPONENT2_TILE} + {gHealthboxDoublesOpponentGfx, 0x800, TAG_HEALTHBOX_OPPONENT1_TILE}, + {gHealthboxDoublesOpponentGfx, 0x800, TAG_HEALTHBOX_OPPONENT2_TILE} }; static const struct CompressedSpriteSheet sSpriteSheet_SafariHealthbox = { - gUnknown_08C1F8E8, 0x1000, TAG_HEALTHBOX_SAFARI_TILE + gHealthboxSafariGfx, 0x1000, TAG_HEALTHBOX_SAFARI_TILE }; static const struct CompressedSpriteSheet sSpriteSheets_HealthBar[MAX_BATTLERS_COUNT] = diff --git a/src/battle_message.c b/src/battle_message.c index f478df4df..47579d4f2 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -17,6 +17,7 @@ #include "menu.h" #include "recorded_battle.h" #include "international_string_util.h" +#include "battle_frontier_2.h" struct BattleWindowText { @@ -51,7 +52,6 @@ extern u8 GetEreaderTrainerClassId(void); // battle_tower extern void CopyFrontierBrainTrainerName(u8 *txtPtr); // battle_frontier_2 extern void sub_81D5554(u8 *txtPtr, u16 trainerId); // pokenav extern void GetEreaderTrainerName(u8 *txtPtr); -extern void sub_81A36D0(u8 arg0, u16 trainerId); // battle_frontier_2 extern void sub_81D572C(u8 arg0, u16 trainerId); // pokenav extern void GetFrontierTrainerName(u8 *dst, u16 trainerId); @@ -2582,7 +2582,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) case B_TXT_TRAINER1_LOSE_TEXT: // trainerA lose text if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) { - sub_81A36D0(2, gTrainerBattleOpponent_A); + CopyFrontierTrainerText(FRONTIER_LOSE_TEXT, gTrainerBattleOpponent_A); toCpy = gStringVar4; } else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) @@ -2598,7 +2598,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) case B_TXT_TRAINER1_WIN_TEXT: // trainerA win text if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) { - sub_81A36D0(1, gTrainerBattleOpponent_A); + CopyFrontierTrainerText(FRONTIER_WIN_TEXT, gTrainerBattleOpponent_A); toCpy = gStringVar4; } else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) @@ -2679,7 +2679,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) case B_TXT_TRAINER2_LOSE_TEXT: if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) { - sub_81A36D0(2, gTrainerBattleOpponent_B); + CopyFrontierTrainerText(FRONTIER_LOSE_TEXT, gTrainerBattleOpponent_B); toCpy = gStringVar4; } else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) @@ -2695,7 +2695,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) case B_TXT_TRAINER2_WIN_TEXT: if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) { - sub_81A36D0(1, gTrainerBattleOpponent_B); + CopyFrontierTrainerText(FRONTIER_WIN_TEXT, gTrainerBattleOpponent_B); toCpy = gStringVar4; } else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) diff --git a/src/graphics.c b/src/graphics.c index 38a79ce3c..5debb721a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -643,11 +643,11 @@ const u8 gBattleAnimSpritePalette_187[] = INCBIN_U8("graphics/battle_anims/sprit const u8 gBattleAnimSpriteSheet_186[] = INCBIN_U8("graphics/battle_anims/sprites/186.4bpp.lz"); const u8 gBattleAnimSpritePalette_186[] = INCBIN_U8("graphics/battle_anims/sprites/186.gbapal.lz"); -const u8 gUnknown_08C1F1C8[] = INCBIN_U8("graphics/battle_interface/window.4bpp.lz"); -const u8 gUnknown_08C1F46C[] = INCBIN_U8("graphics/battle_interface/window2.4bpp.lz"); -const u8 gUnknown_08C1F5E8[] = INCBIN_U8( "graphics/battle_interface/window3.4bpp.lz"); -const u8 gUnknown_08C1F76C[] = INCBIN_U8("graphics/battle_interface/window4.4bpp.lz"); -const u8 gUnknown_08C1F8E8[] = INCBIN_U8("graphics/battle_interface/window5.4bpp.lz"); +const u8 gHealthboxSinglesPlayerGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_singles_player.4bpp.lz"); +const u8 gHealthboxSinglesOpponentGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_singles_opponent.4bpp.lz"); +const u8 gHealthboxDoublesPlayerGfx[] = INCBIN_U8( "graphics/battle_interface/healthbox_doubles_player.4bpp.lz"); +const u8 gHealthboxDoublesOpponentGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_doubles_opponent.4bpp.lz"); +const u8 gHealthboxSafariGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_safari.4bpp.lz"); const u8 gUnusedGfx_Shadow[] = INCBIN_U8("graphics/unused/shadow.4bpp.lz"); const u8 gUnusedPal_Shadow[] = INCBIN_U8("graphics/unused/shadow.gbapal.lz");