summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-04-05 18:37:03 -0700
committerGitHub <noreply@github.com>2018-04-05 18:37:03 -0700
commit781d0ca44c8eab2b7751fe8f337d6acde7fe8582 (patch)
tree0668eb03388e9404e134e24b3dcd753f7bc47050
parent62388f3bfd5b1abd9fa369628b805e683e64c302 (diff)
parentd975a85c84616155e226b2d5120aee9adcae16b5 (diff)
Merge pull request #539 from progreon/various_data
Decompiling various data
-rw-r--r--data/battle_interface.s318
-rw-r--r--include/graphics.h12
-rw-r--r--ld_script.txt3
-rw-r--r--src/battle/battle_7.c51
-rw-r--r--src/battle/battle_interface.c454
-rw-r--r--src/rom_8077ABC.c2
6 files changed, 464 insertions, 376 deletions
diff --git a/data/battle_interface.s b/data/battle_interface.s
deleted file mode 100644
index 3c79b9f4b..000000000
--- a/data/battle_interface.s
+++ /dev/null
@@ -1,318 +0,0 @@
- .include "include/macros.inc"
- .include "constants/constants.inc"
-
- .section .rodata
-
- .align 2
-gUnknown_0820A47C:: @ 820A47C
- obj_tiles gBattleWindowLargeGfx, 4096, 0xd6ff
-
- .align 2
-gUnknown_0820A484:: @ 820A484
- obj_tiles gBattleWindowSmallGfx, 4096, 0xd701
-
- .align 2
-gUnknown_0820A48C:: @ 820A48C
- obj_tiles gBattleWindowSmall2Gfx, 2048, 0xd6ff
-
- .align 2
-gUnknown_0820A494:: @ 820A494
- obj_tiles gBattleWindowSmall2Gfx, 2048, 0xd700
-
- .align 2
-gUnknown_0820A49C:: @ 820A49C
- obj_tiles gBattleWindowSmall3Gfx, 2048, 0xd701
-
- .align 2
-gUnknown_0820A4A4:: @ 820A4A4
- obj_tiles gBattleWindowSmall3Gfx, 2048, 0xd702
-
- .align 2
-gUnknown_0820A4AC:: @ 820A4AC
- obj_tiles gBattleWindowLarge2Gfx, 4096, 0xd70b
-
- .align 2
-gUnknown_0820A4B4:: @ 820A4B4
- obj_tiles gBlankGfxCompressed, 256, 0xd704
- obj_tiles gBlankGfxCompressed, 288, 0xd705
- obj_tiles gBlankGfxCompressed, 256, 0xd706
- obj_tiles gBlankGfxCompressed, 288, 0xd707
-
- .align 2
-gUnknown_0820A4D4:: @ 820A4D4
- obj_pal gUnknown_08D1212C, 0xD6FF
- obj_pal gUnknown_08D1214C, 0xD704
-
- .align 2
-gOamData_820A4E4:: @ 820A4E4
- .2byte 0x4000
- .2byte 0xC000
- .2byte 0x0400
-
- .align 2
-gSpriteTemplate_820A4EC:: @ 820A4EC
- spr_template 55039, 55039, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gSpriteTemplate_820A504:: @ 820A504
- spr_template 55040, 55039, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gSpriteTemplate_820A51C:: @ 820A51C
- spr_template 55041, 55039, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gSpriteTemplate_820A534:: @ 820A534
- spr_template 55042, 55039, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gSpriteTemplate_820A54C:: @ 820A54C
- spr_template 55051, 55039, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gOamData_820A564:: @ 820A564
- .2byte 0x4000
- .2byte 0x4000
- .2byte 0x0400
-
- .align 2
-gSpriteTemplate_820A56C:: @ 820A56C
- spr_template 55044, 55044, gOamData_820A564, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8043CEC
-
- .align 2
-gSpriteTemplate_820A584:: @ 820A584
- spr_template 55045, 55044, gOamData_820A564, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8043CEC
-
- .align 2
-gSpriteTemplate_820A59C:: @ 820A59C
- spr_template 55046, 55044, gOamData_820A564, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8043CEC
-
- .align 2
-gSpriteTemplate_820A5B4:: @ 820A5B4
- spr_template 55047, 55044, gOamData_820A564, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8043CEC
-
- .align 2
-gSubspriteTable_820A5CC:: @ 820A5CC
- subsprite -16, 0, 1, 0, 64x32
- subsprite 48, 0, 1, 32, 32x32
- subsprite -16, 32, 1, 48, 32x8
- subsprite 16, 32, 1, 52, 32x8
- subsprite 48, 32, 1, 56, 32x8
-
- .align 2
-gSubspriteTable_820A5F4:: @ 820A5F4
- subsprite -16, 0, 1, 64, 64x32
- subsprite 48, 0, 1, 96, 32x32
- subsprite -16, 32, 1, 112, 32x8
- subsprite 16, 32, 1, 116, 32x8
- subsprite 48, 32, 1, 120, 32x8
-
- .align 2
-gSubspriteTable_820A61C:: @ 820A61C
- subsprite -16, 0, 1, 0, 64x32
- subsprite 48, 0, 1, 32, 32x32
-
- .align 2
-gSubspriteTable_820A62C:: @ 820A62C
- subsprite -16, 0, 1, 0, 64x32
- subsprite 48, 0, 1, 32, 32x32
-
- .align 2
-gSubspriteTable_820A63C:: @ 820A63C
- subsprite -16, 0, 1, 0, 32x8
- subsprite 16, 0, 1, 4, 32x8
-
- .align 2
-gSubspriteTable_820A64C:: @ 820A64C
- subsprite -16, 0, 1, 0, 32x8
- subsprite 16, 0, 1, 4, 32x8
- subsprite -32, 0, 1, 8, 8x8
-
-@ unreferenced
- .align 2
- .4byte 5, gSubspriteTable_820A5CC
- .4byte 2, gSubspriteTable_820A61C
- .4byte 5, gSubspriteTable_820A5F4
- .4byte 2, gSubspriteTable_820A62C
-
- .align 2
-gSubspriteTables_820A684:: @ 820A684
- .4byte 2, gSubspriteTable_820A63C
- .4byte 3, gSubspriteTable_820A64C
-
- .align 2
-gSubspriteTable_820A694:: @ 820A694
- subsprite -96, 0, 1, 0, 32x8
- subsprite -64, 0, 1, 4, 32x8
- subsprite -32, 0, 1, 8, 32x8
- subsprite 0, 0, 1, 12, 32x8
-
- .align 2
-gSubspriteTable_820A6B4:: @ 820A6B4
- subsprite -96, 0, 1, 0, 32x8
- subsprite -64, 0, 1, 4, 32x8
- subsprite -32, 0, 1, 8, 32x8
- subsprite 0, 0, 1, 8, 32x8
- subsprite 32, 0, 1, 8, 32x8
- subsprite 64, 0, 1, 12, 32x8
-
- .align 2
-gSubspriteTables_820A6E4:: @ 820A6E4
- .4byte 4, gSubspriteTable_820A694
-
- .align 2
-gSubspriteTables_820A6EC:: @ 820A6EC
- .4byte 6, gSubspriteTable_820A6B4
-
-@ unused dakuten/handakuten tiles
- .incbin "graphics/unused/dakuten.4bpp"
-
- .align 2
-gUnknown_0820A754:: @ 820A754
- obj_tiles gBattleGfx_BallStatusBar, 512, 0xd70c
- obj_tiles gBattleGfx_BallStatusBar, 512, 0xd70d
-
- .align 2
-gUnknown_0820A764:: @ 820A764
- obj_pal gUnknown_08D1212C, 0xd710
- obj_pal gUnknown_08D1212C, 0xd711
-
- .align 2
-gUnknown_0820A774:: @ 820A774
- obj_pal gUnknown_08D1214C, 0xd712
- obj_pal gUnknown_08D1214C, 0xd713
-
- .align 2
-gUnknown_0820A784:: @ 820A784
- obj_tiles Tiles_D129AC, 0x80, 0xd714
- obj_tiles Tiles_D129AC, 0x80, 0xd715
-
- .align 2
-gOamData_820A794:: @ 820A794
- .2byte 0x4000
- .2byte 0xC000
- .2byte 0x0400
-
- .align 2
-gOamData_820A79C:: @ 820A79C
- .2byte 0x0000
- .2byte 0x0000
- .2byte 0x0400
-
- .align 2
-gSpriteTemplate_820A7A4:: @ 820A7A4
- spr_template 55052, 55056, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8045030
-
- .align 2
-gSpriteTemplate_820A7BC:: @ 820A7BC
- spr_template 55053, 55057, gOamData_820A4E4, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8045030
-
- .align 2
-gSpriteTemplate_820A7D4:: @ 820A7D4
- spr_template 55060, 55058, gOamData_820A79C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_804507C
-
- .align 2
-gSpriteTemplate_820A7EC:: @ 820A7EC
- spr_template 55061, 55059, gOamData_820A79C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_804507C
-
- .align 2
-gUnknown_0820A804:: @ 820A804
- .4byte OBJ_VRAM0 + 0x940
- .4byte OBJ_VRAM0 + 0x960
-
- .align 2
-gUnknown_0820A80C:: @ 820A80C
- .4byte OBJ_VRAM0 + 0x520
- .4byte OBJ_VRAM0 + 0x540
-
- .align 2
-gUnknown_0820A814:: @ 820A814
- .4byte OBJ_VRAM0 + 0x540
- .4byte OBJ_VRAM0 + 0x560
-
-gUnknown_0820A81C:: @ 820A81C
- .string "{COLOR DARK_GREY}{HIGHLIGHT RED} "
-
- .align 2
-gUnknown_0820A83C:: @ 820A83C
- .4byte OBJ_VRAM0 + 0x3E0
- .4byte OBJ_VRAM0 + 0xB00
- .4byte OBJ_VRAM0 + 0xB20
-
- .align 2
-gUnknown_0820A848:: @ 820A848
- .4byte OBJ_VRAM0 + 0x2C0
- .4byte OBJ_VRAM0 + 0x2E0
- .4byte OBJ_VRAM0 + 0x600
-
- .align 2
-gUnknown_0820A854:: @ 820A854
- .4byte OBJ_VRAM0 + 0xB40
- .4byte OBJ_VRAM0 + 0xB60
-
- .align 2
-gUnknown_0820A85C:: @ 820A85C
- .4byte OBJ_VRAM0 + 0x620
- .4byte OBJ_VRAM0 + 0x640
-
-gUnknown_0820A864:: @ 820A864
- .string "{COLOR DARK_GREY}{HIGHLIGHT RED} /$"
-
- .align 2
-gUnknown_0820A87C:: @ 820A87C
- .4byte OBJ_VRAM0
- .4byte OBJ_VRAM0 + 0x20
- .4byte OBJ_VRAM0 + 0x40
- .4byte OBJ_VRAM0 + 0x60
- .4byte OBJ_VRAM0 + 0x80
- .4byte OBJ_VRAM0 + 0xA0
-
- .align 2
-gUnknown_0820A894:: @ 820A894
- .4byte OBJ_VRAM0 + 0xC0
- .4byte OBJ_VRAM0 + 0xE0
-
-gUnknown_0820A89C:: @ 820A89C
- .string "{COLOR DARK_GREY}{HIGHLIGHT TRANSPARENT} "
-
-gUnknown_0820A8B0:: @ 820A8B0
- .string "{HIGHLIGHT RED}$"
-
- .align 2
-gUnknown_0820A8B4:: @ 820A8B4
- .4byte OBJ_VRAM0 + 0x40
- .4byte OBJ_VRAM0 + 0x60
- .4byte OBJ_VRAM0 + 0x80
- .4byte OBJ_VRAM0 + 0xA0
- .4byte OBJ_VRAM0 + 0xC0
- .4byte OBJ_VRAM0 + 0xE0
- .4byte OBJ_VRAM0 + 0x800
- .4byte OBJ_VRAM0 + 0x820
- .4byte OBJ_VRAM0 + 0x840
- .4byte OBJ_VRAM0 + 0x860
-
- .align 2
-gUnknown_0820A8DC:: @ 820A8DC
- .4byte OBJ_VRAM0 + 0x20
- .4byte OBJ_VRAM0 + 0x40
- .4byte OBJ_VRAM0 + 0x60
- .4byte OBJ_VRAM0 + 0x80
- .4byte OBJ_VRAM0 + 0xA0
- .4byte OBJ_VRAM0 + 0xC0
- .4byte OBJ_VRAM0 + 0xE0
- .4byte OBJ_VRAM0 + 0x400
- .4byte OBJ_VRAM0 + 0x420
- .4byte OBJ_VRAM0 + 0x440
-
- .align 2
-gUnknown_0820A904:: @ 820A904
- .4byte OBJ_VRAM0 + 0x40
- .4byte OBJ_VRAM0 + 0x60
- .4byte OBJ_VRAM0 + 0x80
- .4byte OBJ_VRAM0 + 0xA0
- .4byte OBJ_VRAM0 + 0xC0
- .4byte OBJ_VRAM0 + 0xE0
- .4byte OBJ_VRAM0 + 0x400
- .4byte OBJ_VRAM0 + 0x420
- .4byte OBJ_VRAM0 + 0x440
- .4byte OBJ_VRAM0 + 0x460
diff --git a/include/graphics.h b/include/graphics.h
index b779c2dcd..e0d202202 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -3345,4 +3345,16 @@ extern struct BattleAnimBackground gBattleAnimBackgroundTilemap_17;
extern struct BattleAnimBackground gBattleAnimBackgroundTilemap_20;
extern struct BattleAnimBackground gBattleAnimBackgroundTilemap_21;
+// data/graphics.s
+extern const u8 gBattleWindowLargeGfx[];
+extern const u8 gBattleWindowSmallGfx[];
+extern const u8 gBattleWindowSmall2Gfx[];
+extern const u8 gBattleWindowSmall3Gfx[];
+extern const u8 gBattleWindowLarge2Gfx[];
+extern const u8 gBlankGfxCompressed[];
+extern const u8 gBattleGfx_BallStatusBar[];
+extern const u16 gUnknown_08D1212C[];
+extern const u16 gUnknown_08D1214C[];
+extern const u8 Tiles_D129AC[];
+
#endif // GUARD_GRAPHICS_H
diff --git a/ld_script.txt b/ld_script.txt
index 245dbdb19..d4e4e2fdb 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -513,7 +513,8 @@ SECTIONS {
src/util.o(.rodata);
src/daycare.o(.rodata);
src/egg_hatch.o(.rodata);
- data/battle_interface.o(.rodata);
+ src/battle/battle_7.o(.rodata);
+ src/battle/battle_interface.o(.rodata);
src/battle/pokeball.o(.rodata);
src/trade.o(.rodata);
src/berry_blender.o(.rodata);
diff --git a/src/battle/battle_7.c b/src/battle/battle_7.c
index 85c1d4aed..564d8b518 100644
--- a/src/battle/battle_7.c
+++ b/src/battle/battle_7.c
@@ -20,6 +20,7 @@
#include "text.h"
#include "gba/m4a_internal.h"
#include "ewram.h"
+#include "graphics.h"
extern u8 gBattleBufferA[][0x200];
extern u8 gActiveBank;
@@ -49,19 +50,47 @@ extern const u8 *const gBattleAnims_Special[];
extern const struct CompressedSpriteSheet gTrainerFrontPicTable[];
extern const struct MonCoords gTrainerFrontPicCoords[];
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
-extern const u8 gSubstituteDollTilemap[];
-extern const u8 gSubstituteDollGfx[];
-extern const u8 gSubstituteDollPal[];
extern const struct CompressedSpriteSheet gUnknown_081FAF24;
extern const struct SpriteTemplate gSpriteTemplate_81FAF34;
-extern const struct CompressedSpriteSheet gUnknown_0820A47C;
-extern const struct CompressedSpriteSheet gUnknown_0820A484;
-extern const struct CompressedSpriteSheet gUnknown_0820A48C[];
-extern const struct CompressedSpriteSheet gUnknown_0820A49C[];
-extern const struct CompressedSpriteSheet gUnknown_0820A4AC;
-extern const struct CompressedSpriteSheet gUnknown_0820A4B4[];
-extern const struct SpritePalette gUnknown_0820A4D4[];
-extern const u8 gUnknown_08D09C48[];
+extern const u8 gSubstituteDollTilemap[]; // graphics.s
+extern const u8 gSubstituteDollGfx[]; // graphics.s
+extern const u8 gSubstituteDollPal[]; // graphics.s
+extern const u8 gUnknown_08D09C48[]; // graphics.s
+
+const struct CompressedSpriteSheet gUnknown_0820A47C =
+{ gBattleWindowLargeGfx, 4096, 0xd6ff };
+
+const struct CompressedSpriteSheet gUnknown_0820A484 =
+{ gBattleWindowSmallGfx, 4096, 0xd701 };
+
+const struct CompressedSpriteSheet gUnknown_0820A48C[] =
+{
+ { gBattleWindowSmall2Gfx, 2048, 0xd6ff },
+ { gBattleWindowSmall2Gfx, 2048, 0xd700 },
+};
+
+const struct CompressedSpriteSheet gUnknown_0820A49C[] =
+{
+ { gBattleWindowSmall3Gfx, 2048, 0xd701 },
+ { gBattleWindowSmall3Gfx, 2048, 0xd702 },
+};
+
+const struct CompressedSpriteSheet gUnknown_0820A4AC =
+{ gBattleWindowLarge2Gfx, 4096, 0xd70b };
+
+const struct CompressedSpriteSheet gUnknown_0820A4B4[] =
+{
+ { gBlankGfxCompressed, 256, 0xd704 },
+ { gBlankGfxCompressed, 288, 0xd705 },
+ { gBlankGfxCompressed, 256, 0xd706 },
+ { gBlankGfxCompressed, 288, 0xd707 },
+};
+
+const struct SpritePalette gUnknown_0820A4D4[] =
+{
+ { gUnknown_08D1212C, 0xD6FF },
+ { gUnknown_08D1214C, 0xD704 },
+};
extern void c3_0802FDF4(u8);
extern void sub_80440EC();
diff --git a/src/battle/battle_interface.c b/src/battle/battle_interface.c
index 9be026d53..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[];
@@ -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];
@@ -654,7 +1018,7 @@ void sub_8043F44(u8 a)
/*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
@@ -909,7 +1273,7 @@ _0804420C: .4byte 0x04000008\n\
{
u8 str[0x14];
u8 *ptr;
- void *const *r7;
+ u8 *const *r7;
int r10;
int r4;
int i;
@@ -942,7 +1306,7 @@ _0804420C: .4byte 0x04000008\n\
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);
}
}
@@ -2275,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];
@@ -2291,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;
diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c
index 9d864fec3..4be3390ee 100644
--- a/src/rom_8077ABC.c
+++ b/src/rom_8077ABC.c
@@ -1971,7 +1971,7 @@ u8 sub_8079F44(u16 species, u8 isBackpic, u8 a3, s16 a4, s16 a5, u8 a6, u32 a7,
);
}
- DmaCopy32Defvars(3, (void *)0x2000000, (void *)(VRAM + 0x10000 + (sheet * 0x20)), 0x800);
+ DmaCopy32Defvars(3, (void *)0x2000000, (void *)(OBJ_VRAM0 + (sheet * 0x20)), 0x800);
if (!isBackpic)
sprite = CreateSprite(&gSpriteTemplate_837F5B0[a3], a4, a5 + gMonFrontPicCoords[species].y_offset, a6);