diff options
author | Marcus Huderle <huderlem@gmail.com> | 2018-04-05 18:41:42 -0700 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2018-04-05 18:41:42 -0700 |
commit | 66367c82ef07c10957d45ce7f0f776a178454e18 (patch) | |
tree | 0dd4fcd5cce3ef14dae4fc9ae91e54c6e070eef6 /src/battle/battle_interface.c | |
parent | 171dd32df8a56e1f10956be8b944cb216edb8f9d (diff) | |
parent | 781d0ca44c8eab2b7751fe8f337d6acde7fe8582 (diff) |
Merge remote-tracking branch 'upstream/master' into btl_attrs
Diffstat (limited to 'src/battle/battle_interface.c')
-rw-r--r-- | src/battle/battle_interface.c | 485 |
1 files changed, 432 insertions, 53 deletions
diff --git a/src/battle/battle_interface.c b/src/battle/battle_interface.c index 97568d254..4022f07ce 100644 --- a/src/battle/battle_interface.c +++ b/src/battle/battle_interface.c @@ -14,6 +14,7 @@ #include "task.h" #include "text.h" #include "ewram.h" +#include "graphics.h" struct UnknownStruct5 { @@ -29,6 +30,398 @@ struct UnknownStruct7 u8 filler0[0x180]; }; +static void sub_8043CEC(struct Sprite *sprite); +static void sub_8045030(struct Sprite *sprite); +static void sub_804507C(struct Sprite *sprite); + +const struct OamData gOamData_820A4E4 = +{ + .shape = 1, + .size = 3, + .priority = 1, +}; + +const struct SpriteTemplate gSpriteTemplates_820A4EC[] = +{ + { + .tileTag = 55039, + .paletteTag = 55039, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 55040, + .paletteTag = 55039, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, +}; + +const struct SpriteTemplate gSpriteTemplates_820A51C[] = +{ + { + .tileTag = 55041, + .paletteTag = 55039, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 55042, + .paletteTag = 55039, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, +}; + +const struct SpriteTemplate gSpriteTemplate_820A54C = +{ + .tileTag = 55051, + .paletteTag = 55039, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +const struct OamData gOamData_820A564 = +{ + .shape = 1, + .size = 1, + .priority = 1, +}; + +const struct SpriteTemplate gSpriteTemplates_820A56C[] = +{ + { + .tileTag = 55044, + .paletteTag = 55044, + .oam = &gOamData_820A564, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8043CEC, + }, + { + .tileTag = 55045, + .paletteTag = 55044, + .oam = &gOamData_820A564, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8043CEC, + }, + { + .tileTag = 55046, + .paletteTag = 55044, + .oam = &gOamData_820A564, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8043CEC, + }, + { + .tileTag = 55047, + .paletteTag = 55044, + .oam = &gOamData_820A564, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8043CEC, + }, +}; + +const struct Subsprite gSubspriteTable_820A5CC[] = +{ + { .x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 3 }, // size := 64x32 + { .x = 48, .y = 0, .shape = ST_OAM_SQUARE, .priority = 1, .tileOffset = 32, .size = 2 }, // size := 32x32 + { .x = -16, .y = 32, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 48, .size = 1 }, // size := 32x8 + { .x = 16, .y = 32, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 52, .size = 1 }, // size := 32x8 + { .x = 48, .y = 32, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 56, .size = 1 }, // size := 32x8 +}; + +const struct Subsprite gSubspriteTable_820A5F4[] = +{ + { .x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 64, .size = 3 }, // size := 64x32 + { .x = 48, .y = 0, .shape = ST_OAM_SQUARE, .priority = 1, .tileOffset = 96, .size = 2 }, // size := 32x32 + { .x = -16, .y = 32, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset =112, .size = 1 }, // size := 32x8 + { .x = 16, .y = 32, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset =116, .size = 1 }, // size := 32x8 + { .x = 48, .y = 32, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset =120, .size = 1 }, // size := 32x8 +}; + +const struct Subsprite gSubspriteTable_820A61C[] = +{ + { .x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 3 }, // size := 64x32 + { .x = 48, .y = 0, .shape = ST_OAM_SQUARE, .priority = 1, .tileOffset = 32, .size = 2 }, // size := 32x32 +}; + +const struct Subsprite gSubspriteTable_820A62C[] = +{ + { .x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 3 }, // size := 64x32 + { .x = 48, .y = 0, .shape = ST_OAM_SQUARE, .priority = 1, .tileOffset = 32, .size = 2 }, // size := 32x32 +}; + +const struct Subsprite gSubspriteTable_820A63C[] = +{ + { .x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 1 }, // size := 32x8 + { .x = 16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 4, .size = 1 }, // size := 32x8 +}; + +const struct Subsprite gSubspriteTable_820A64C[] = +{ + { .x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 1 }, // size := 32x8 + { .x = 16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 4, .size = 1 }, // size := 32x8 + { .x = -32, .y = 0, .shape = ST_OAM_SQUARE, .priority = 1, .tileOffset = 8, .size = 0 }, // size := 8x8 +}; + +const struct SubspriteTable gSubspriteTables_unreferenced[] = +{ + { ARRAY_COUNT(gSubspriteTable_820A5CC), gSubspriteTable_820A5CC }, + { ARRAY_COUNT(gSubspriteTable_820A61C), gSubspriteTable_820A61C }, + { ARRAY_COUNT(gSubspriteTable_820A5F4), gSubspriteTable_820A5F4 }, + { ARRAY_COUNT(gSubspriteTable_820A62C), gSubspriteTable_820A62C }, +}; + +const struct SubspriteTable gSubspriteTables_820A684[] = +{ + { ARRAY_COUNT(gSubspriteTable_820A63C), gSubspriteTable_820A63C }, + { ARRAY_COUNT(gSubspriteTable_820A64C), gSubspriteTable_820A64C }, +}; + +const struct Subsprite gSubspriteTable_820A694[] = +{ + { .x = -96, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 1 }, // size := 32x8 + { .x = -64, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 4, .size = 1 }, // size := 32x8 + { .x = -32, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 8, .size = 1 }, // size := 32x8 + { .x = 0, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 12, .size = 1 }, // size := 32x8 +}; + +const struct Subsprite gSubspriteTable_820A6B4[] = +{ + { .x = -96, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 0, .size = 1 }, // size := 32x8 + { .x = -64, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 4, .size = 1 }, // size := 32x8 + { .x = -32, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 8, .size = 1 }, // size := 32x8 + { .x = 0, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 8, .size = 1 }, // size := 32x8 + { .x = 32, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 8, .size = 1 }, // size := 32x8 + { .x = 64, .y = 0, .shape = ST_OAM_H_RECTANGLE, .priority = 1, .tileOffset = 12, .size = 1 }, // size := 32x8 +}; + +const struct SubspriteTable gSubspriteTables_820A6E4[] = +{ + { ARRAY_COUNT(gSubspriteTable_820A694), gSubspriteTable_820A694 }, +}; + +const struct SubspriteTable gSubspriteTables_820A6EC[] = +{ + { ARRAY_COUNT(gSubspriteTable_820A6B4), gSubspriteTable_820A6B4 }, +}; + +// unused dakuten/handakuten tiles +const u8 gUnusedDakuten[] = INCBIN_U8("graphics/unused/dakuten.4bpp"); + +const struct CompressedSpriteSheet gUnknown_0820A754[] = +{ + { gBattleGfx_BallStatusBar, 512, 0xd70c }, + { gBattleGfx_BallStatusBar, 512, 0xd70d }, +}; + +const struct SpritePalette gUnknown_0820A764[] = +{ + { gUnknown_08D1212C, 0xd710 }, + { gUnknown_08D1212C, 0xd711 }, +}; + +const struct SpritePalette gUnknown_0820A774[] = +{ + { gUnknown_08D1214C, 0xd712 }, + { gUnknown_08D1214C, 0xd713 }, +}; + +const struct CompressedSpriteSheet gUnknown_0820A784[] = +{ + { Tiles_D129AC, 0x80, 0xd714 }, + { Tiles_D129AC, 0x80, 0xd715 }, +}; + +const struct OamData gOamData_820A794 = +{ + .shape = 1, + .size = 3, + .priority = 1, +}; + +const struct OamData gOamData_820A79C = +{ + .shape = 0, + .size = 0, + .priority = 1, +}; + +const struct SpriteTemplate gSpriteTemplate_820A7A4 = +{ + .tileTag = 55052, + .paletteTag = 55056, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8045030, +}; + +const struct SpriteTemplate gSpriteTemplate_820A7BC = +{ + .tileTag = 55053, + .paletteTag = 55057, + .oam = &gOamData_820A4E4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8045030, +}; + +const struct SpriteTemplate gSpriteTemplate_820A7D4 = +{ + .tileTag = 55060, + .paletteTag = 55058, + .oam = &gOamData_820A79C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_804507C, +}; + +const struct SpriteTemplate gSpriteTemplate_820A7EC = +{ + .tileTag = 55061, + .paletteTag = 55059, + .oam = &gOamData_820A79C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_804507C, +}; + +u8 *const gUnknown_0820A804[2] = +{ + OBJ_VRAM0 + 32 * 74, + OBJ_VRAM0 + 32 * 75, +}; + +u8 *const gUnknown_0820A80C[2] = +{ + OBJ_VRAM0 + 32 * 41, + OBJ_VRAM0 + 32 * 42, +}; + +u8 *const gUnknown_0820A814[2] = +{ + OBJ_VRAM0 + 32 * 42, + OBJ_VRAM0 + 32 * 43, +}; + +const u8 gUnknown_0820A81C[] = __("{COLOR DARK_GREY}{HIGHLIGHT RED} "); + +u8 *const gUnknown_0820A83C[3] = +{ + OBJ_VRAM0 + 32 * 31, + OBJ_VRAM0 + 32 * 88, + OBJ_VRAM0 + 32 * 89, +}; + +u8 *const gUnknown_0820A848[3] = +{ + OBJ_VRAM0 + 32 * 22, + OBJ_VRAM0 + 32 * 23, + OBJ_VRAM0 + 32 * 48, +}; + +u8 *const gUnknown_0820A854[2] = +{ + OBJ_VRAM0 + 32 * 90, + OBJ_VRAM0 + 32 * 91, +}; + +u8 *const gUnknown_0820A85C[2] = +{ + OBJ_VRAM0 + 32 * 49, + OBJ_VRAM0 + 32 * 50, +}; + +const u8 gUnknown_0820A864[] = _("{COLOR DARK_GREY}{HIGHLIGHT RED} /"); + +u8 *const gUnknown_0820A87C[6] = +{ + OBJ_VRAM0 + 32 * 0, + OBJ_VRAM0 + 32 * 1, + OBJ_VRAM0 + 32 * 2, + OBJ_VRAM0 + 32 * 3, + OBJ_VRAM0 + 32 * 4, + OBJ_VRAM0 + 32 * 5, +}; + +u8 *const gUnknown_0820A894[2] = +{ + OBJ_VRAM0 + 32 * 6, + OBJ_VRAM0 + 32 * 7, +}; + +const u8 gUnknown_0820A89C[] = __("{COLOR DARK_GREY}{HIGHLIGHT TRANSPARENT} "); +const u8 gUnknown_0820A8B0[] = _("{HIGHLIGHT RED}"); + +u8 *const gUnknown_0820A8B4[10] = +{ + OBJ_VRAM0 + 32 * 2, + OBJ_VRAM0 + 32 * 3, + OBJ_VRAM0 + 32 * 4, + OBJ_VRAM0 + 32 * 5, + OBJ_VRAM0 + 32 * 6, + OBJ_VRAM0 + 32 * 7, + OBJ_VRAM0 + 32 * 64, + OBJ_VRAM0 + 32 * 65, + OBJ_VRAM0 + 32 * 66, + OBJ_VRAM0 + 32 * 67, +}; + +u8 *const gUnknown_0820A8DC[10] = +{ + OBJ_VRAM0 + 32 * 1, + OBJ_VRAM0 + 32 * 2, + OBJ_VRAM0 + 32 * 3, + OBJ_VRAM0 + 32 * 4, + OBJ_VRAM0 + 32 * 5, + OBJ_VRAM0 + 32 * 6, + OBJ_VRAM0 + 32 * 7, + OBJ_VRAM0 + 32 * 32, + OBJ_VRAM0 + 32 * 33, + OBJ_VRAM0 + 32 * 34, +}; + +u8 *const gUnknown_0820A904[10] = +{ + OBJ_VRAM0 + 32 * 2, + OBJ_VRAM0 + 32 * 3, + OBJ_VRAM0 + 32 * 4, + OBJ_VRAM0 + 32 * 5, + OBJ_VRAM0 + 32 * 6, + OBJ_VRAM0 + 32 * 7, + OBJ_VRAM0 + 32 * 32, + OBJ_VRAM0 + 32 * 33, + OBJ_VRAM0 + 32 * 34, + OBJ_VRAM0 + 32 * 35, +}; + extern u8 gDisplayedStringBattle[]; extern u8 gNoOfAllBanks; extern u16 gBattlePartyID[]; @@ -37,35 +430,6 @@ extern u8 gHealthboxIDs[]; extern u16 gBattleTypeFlags; -extern const struct SpriteTemplate gSpriteTemplate_820A4EC[]; -extern const struct SpriteTemplate gSpriteTemplate_820A51C[]; -extern const struct SpriteTemplate gSpriteTemplate_820A54C; -extern const struct SpriteTemplate gSpriteTemplate_820A56C[]; -extern const struct SubspriteTable gSubspriteTables_820A684[]; -extern const struct SubspriteTable gSubspriteTables_820A6E4[]; -extern const struct SubspriteTable gSubspriteTables_820A6EC[]; -extern const struct SpriteSheet gUnknown_0820A754[]; -extern const struct SpritePalette gUnknown_0820A764[]; -extern const struct SpritePalette gUnknown_0820A774[]; -extern const struct SpriteSheet gUnknown_0820A784[]; -extern const struct SpriteTemplate gSpriteTemplate_820A7A4[]; -extern const struct SpriteTemplate gSpriteTemplate_820A7D4[]; -extern void *const gUnknown_0820A804[]; -extern void *const gUnknown_0820A80C[]; -extern void *const gUnknown_0820A814[]; -extern void *const gUnknown_0820A83C[]; -extern void *const gUnknown_0820A848[]; -extern void *const gUnknown_0820A854[]; -extern void *const gUnknown_0820A85C[]; -extern void *const gUnknown_0820A87C[]; -extern void *const gUnknown_0820A894[]; -extern void *const gUnknown_0820A8B4[]; -extern void *const gUnknown_0820A8DC[]; -extern void *const gUnknown_0820A904[]; -extern const u8 gUnknown_0820A81C[]; -extern const u8 gUnknown_0820A864[]; -extern const u8 gUnknown_0820A89C[]; -extern const u8 gUnknown_0820A8B0[]; extern const u8 BattleText_SafariBalls[]; extern const u8 BattleText_SafariBallsLeft[]; extern const u8 BattleText_HighlightRed[]; @@ -79,8 +443,8 @@ extern const u16 gBattleInterfaceStatusIcons_DynPal[]; static void sub_8043D5C(struct Sprite *); static const void *sub_8043CDC(u8); -static void sub_8044210(u8, s16, u8); -static void draw_status_ailment_maybe(u8); +/*static*/ void sub_8044210(u8, s16, u8); +/*static*/ void draw_status_ailment_maybe(u8); extern void sub_8045180(struct Sprite *); static void sub_8045110(struct Sprite *); static void sub_8045048(struct Sprite *); @@ -421,8 +785,8 @@ u8 battle_make_oam_normal_battle(u8 a) { if (GetBankSide(a) == 0) { - spriteId1 = CreateSprite(&gSpriteTemplate_820A4EC[0], 240, 160, 1); - spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A4EC[0], 240, 160, 1); + spriteId1 = CreateSprite(&gSpriteTemplates_820A4EC[0], 240, 160, 1); + spriteId2 = CreateSpriteAtEnd(&gSpriteTemplates_820A4EC[0], 240, 160, 1); gSprites[spriteId1].oam.shape = 0; gSprites[spriteId2].oam.shape = 0; @@ -430,8 +794,8 @@ u8 battle_make_oam_normal_battle(u8 a) } else { - spriteId1 = CreateSprite(&gSpriteTemplate_820A51C[0], 240, 160, 1); - spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A51C[0], 240, 160, 1); + spriteId1 = CreateSprite(&gSpriteTemplates_820A51C[0], 240, 160, 1); + spriteId2 = CreateSpriteAtEnd(&gSpriteTemplates_820A51C[0], 240, 160, 1); gSprites[spriteId2].oam.tileNum += 32; sp0 = 2; @@ -447,8 +811,8 @@ u8 battle_make_oam_normal_battle(u8 a) { if (GetBankSide(a) == 0) { - spriteId1 = CreateSprite(&gSpriteTemplate_820A4EC[GetBankIdentity(a) / 2], 240, 160, 1); - spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A4EC[GetBankIdentity(a) / 2], 240, 160, 1); + spriteId1 = CreateSprite(&gSpriteTemplates_820A4EC[GetBankIdentity(a) / 2], 240, 160, 1); + spriteId2 = CreateSpriteAtEnd(&gSpriteTemplates_820A4EC[GetBankIdentity(a) / 2], 240, 160, 1); gSprites[spriteId1].oam.affineParam = spriteId2; gSprites[spriteId2].data[5] = spriteId1; @@ -459,8 +823,8 @@ u8 battle_make_oam_normal_battle(u8 a) //_08043ACC else { - spriteId1 = CreateSprite(&gSpriteTemplate_820A51C[GetBankIdentity(a) / 2], 240, 160, 1); - spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A51C[GetBankIdentity(a) / 2], 240, 160, 1); + spriteId1 = CreateSprite(&gSpriteTemplates_820A51C[GetBankIdentity(a) / 2], 240, 160, 1); + spriteId2 = CreateSpriteAtEnd(&gSpriteTemplates_820A51C[GetBankIdentity(a) / 2], 240, 160, 1); gSprites[spriteId1].oam.affineParam = spriteId2; gSprites[spriteId2].data[5] = spriteId1; @@ -472,7 +836,7 @@ u8 battle_make_oam_normal_battle(u8 a) } //_08043B50 - spriteId3 = CreateSpriteAtEnd(&gSpriteTemplate_820A56C[gBanksBySide[a]], 140, 60, 0); + spriteId3 = CreateSpriteAtEnd(&gSpriteTemplates_820A56C[gBanksBySide[a]], 140, 60, 0); sprite = &gSprites[spriteId3]; SetSubspriteTables(sprite, &gSubspriteTables_820A684[GetBankSide(a)]); sprite->subspriteMode = 2; @@ -509,7 +873,7 @@ static const void *sub_8043CDC(u8 a) return gUnknown_08D1216C[a]; } -void sub_8043CEC(struct Sprite *sprite) +static void sub_8043CEC(struct Sprite *sprite) { u8 r5 = sprite->data[5]; @@ -651,10 +1015,10 @@ void sub_8043F44(u8 a) #define CHAR_LV_SEPARATOR CHAR_PERIOD #endif -static void sub_8043FC0(u8 a, u8 b) +/*static*/ void sub_8043FC0(u8 a, u8 b) { u8 str[30]; - void *const *r7; + u8 *const *r7; u8 *ptr; s32 i; s32 two; @@ -713,7 +1077,7 @@ void sub_80440EC(u8 a, s16 b, u8 c) u8 str[0x14]; u8 *ptr; s32 foo; - void *const *r4; + u8 *const *r4; s32 i; // TODO: make this a local variable @@ -905,11 +1269,11 @@ _0804420C: .4byte 0x04000008\n\ } #endif -static void sub_8044210(u8 a, s16 b, u8 c) +/*static*/ void sub_8044210(u8 a, s16 b, u8 c) { u8 str[0x14]; u8 *ptr; - void *const *r7; + u8 *const *r7; int r10; int r4; int i; @@ -942,7 +1306,7 @@ static void sub_8044210(u8 a, s16 b, u8 c) sub_80034D4(ewram0_9(0), str); for (i = 0; i < r10; i++) { - CpuCopy32((void *)(ewram0_9(1) + i * 0x40), r7[i] + gSprites[r4].oam.tileNum * 32, 0x20); + CpuCopy32((void *)(ewram0_9(1) + i * 0x40), r7[i] + gSprites[r4].oam.tileNum * 32, 32); } } @@ -1277,6 +1641,8 @@ _08044548: .4byte 0x04000008\n\ } #endif +extern u8 gUnknown_020297ED; + void sub_804454C(void) { s32 i; @@ -1285,7 +1651,11 @@ void sub_804454C(void) for (i = 0; i < gNoOfAllBanks; i++) { if (gSprites[gHealthboxIDs[i]].callback == SpriteCallbackDummy +#if DEBUG + && (gUnknown_020297ED != 0 || GetBankSide(i) != 1) +#else && GetBankSide(i) != 1 +#endif && (IsDoubleBattle() || GetBankSide(i) != 0)) { u8 r6; @@ -2269,7 +2639,7 @@ static void sub_8044F70(u8 taskId) } } -void sub_8045030(struct Sprite *sprite) +static void sub_8045030(struct Sprite *sprite) { if (sprite->pos2.x != 0) sprite->pos2.x += sprite->data[0]; @@ -2285,7 +2655,7 @@ static void sub_8045048(struct Sprite *sprite) sprite->data[1] &= 0xF; } -void sub_804507C(struct Sprite *sprite) +static void sub_804507C(struct Sprite *sprite) { u8 r3; u16 r2; @@ -2359,7 +2729,7 @@ void sub_8045180(struct Sprite *sprite) sprite->pos2.y = gSprites[spriteId].pos2.y; } -static void sub_80451A0(u8 a, struct Pokemon *pkmn) +/*static*/ void sub_80451A0(u8 a, struct Pokemon *pkmn) { u8 nickname[POKEMON_NAME_LENGTH]; u8 gender; @@ -2507,7 +2877,7 @@ static void sub_8045458(u8 a, u8 b) } } -static void draw_status_ailment_maybe(u8 a) +/*static*/ void draw_status_ailment_maybe(u8 a) { s32 r4; s32 r4_2; @@ -2649,7 +3019,7 @@ static u8 sub_80457E8(u8 a, u8 b) return ret; } -static void sub_80458B0(u8 a) +/*static*/ void sub_80458B0(u8 a) { u8 *r6; u8 r8; @@ -2675,7 +3045,7 @@ static void sub_80458B0(u8 a) } -static void sub_8045998(u8 a) +/*static*/ void sub_8045998(u8 a) { u8 *r7; u8 status; @@ -2752,6 +3122,15 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c) { if (c == 3 || c == 0) sub_8043FC0(a, GetMonData(pkmn, MON_DATA_LEVEL)); +#if DEBUG + if (gUnknown_020297ED == 1) + { + if (c == 1 || c == 0) + sub_80440EC(a, GetMonData(pkmn, MON_DATA_HP), 0); + if (c == 2 || c == 0) + sub_80440EC(a, GetMonData(pkmn, MON_DATA_MAX_HP), 1); + } +#endif if (c == 5 || c == 0) { load_gfxc_health_bar(0); |