summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiegoisawesome <Diegoisawesome@users.noreply.github.com>2018-09-11 22:10:26 -0500
committerGitHub <noreply@github.com>2018-09-11 22:10:26 -0500
commit095cbbc5c297055d2cb2c01a2c8c04dc7d055cb6 (patch)
tree4b3fac0beaabc937d07e352b531cb8ffd514497f /src
parentb9e0cf9f6fef7eaec9ff19422933df04b4031c1b (diff)
parentf40fa373988288ee6ca9b8938cb6c33aa409575e (diff)
Merge pull request #321 from Slawter666/data
Move more data to C
Diffstat (limited to 'src')
-rw-r--r--src/battle_bg.c671
-rw-r--r--src/battle_main.c2
-rw-r--r--src/braille_puzzles.c53
-rw-r--r--src/data2b.c252
-rw-r--r--src/field_special_scene.c24
-rwxr-xr-xsrc/item_use.c59
6 files changed, 994 insertions, 67 deletions
diff --git a/src/battle_bg.c b/src/battle_bg.c
index fb3e52eac..a6c66b3c4 100644
--- a/src/battle_bg.c
+++ b/src/battle_bg.c
@@ -1,24 +1,26 @@
#include "global.h"
#include "battle.h"
-#include "sprite.h"
-#include "constants/trainers.h"
-#include "graphics.h"
-#include "decompress.h"
+#include "battle_bg.h"
+#include "battle_main.h"
+#include "battle_message.h"
+#include "battle_setup.h"
#include "bg.h"
-#include "palette.h"
-#include "main.h"
+#include "decompress.h"
#include "gpu_regs.h"
+#include "graphics.h"
#include "link.h"
-#include "battle_message.h"
+#include "main.h"
+#include "menu.h"
+#include "palette.h"
+#include "sound.h"
+#include "sprite.h"
#include "task.h"
+#include "text_window.h"
#include "trig.h"
-#include "sound.h"
-#include "constants/songs.h"
#include "window.h"
-#include "text_window.h"
-#include "menu.h"
-#include "battle_setup.h"
#include "constants/map_types.h"
+#include "constants/songs.h"
+#include "constants/trainers.h"
struct BattleBackground
{
@@ -29,13 +31,6 @@ struct BattleBackground
const void *palette;
};
-extern const struct SpriteTemplate gUnknown_0831A9D0;
-extern const struct SpriteTemplate gUnknown_0831A9E8;
-extern const struct CompressedSpriteSheet gUnknown_0831AA00;
-extern const struct BgTemplate gBattleBgTemplates[4];
-extern const struct WindowTemplate *const gBattleWindowTemplates[];
-extern const struct BattleBackground gBattleTerrainTable[];
-
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
@@ -43,6 +38,644 @@ extern u16 gBattle_BG2_Y;
extern u8 GetCurrentMapBattleScene(void);
+// .rodata
+static const u16 sUnrefArray[] = {0x0300, 0x0000}; //OamData?
+
+static const struct OamData gUnknown_0831A988 =
+{
+ .y = 0,
+ .affineMode = 3,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = 0,
+ .x = 0,
+ .matrixNum = 0,
+ .size = 3,
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
+ .affineParam = 0,
+};
+
+static const struct OamData gUnknown_0831A990 =
+{
+ .y = 0,
+ .affineMode = 3,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = 0,
+ .x = 0,
+ .matrixNum = 0,
+ .size = 3,
+ .tileNum = 64,
+ .priority = 0,
+ .paletteNum = 0,
+ .affineParam = 0,
+};
+
+static const union AffineAnimCmd gUnknown_0831A998[] =
+{
+ AFFINEANIMCMD_FRAME(0x0080, 0x0080, 0x00, 0x00),
+ AFFINEANIMCMD_END,
+};
+
+static const union AffineAnimCmd gUnknown_0831A9A8[] =
+{
+ AFFINEANIMCMD_FRAME(0x0080, 0x0080, 0x00, 0x00),
+ AFFINEANIMCMD_FRAME(0x0018, 0x0018, 0x00, 0x80),
+ AFFINEANIMCMD_FRAME(0x0018, 0x0018, 0x00, 0x80),
+ AFFINEANIMCMD_END,
+};
+
+static const union AffineAnimCmd * const gUnknown_0831A9C8[] =
+{
+ gUnknown_0831A998,
+ gUnknown_0831A9A8,
+};
+
+static const struct SpriteTemplate gUnknown_0831A9D0 =
+{
+ .tileTag = 0x2710,
+ .paletteTag = 0x2710,
+ .oam = &gUnknown_0831A988,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gUnknown_0831A9C8,
+ .callback = nullsub_17
+};
+
+static const struct SpriteTemplate gUnknown_0831A9E8 =
+{
+ .tileTag = 0x2710,
+ .paletteTag = 0x2710,
+ .oam = &gUnknown_0831A990,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gUnknown_0831A9C8,
+ .callback = nullsub_17
+};
+
+static const struct CompressedSpriteSheet gUnknown_0831AA00 =
+{
+ gUnknown_08D77B0C, 0x1000, 0x2710
+};
+
+const struct BgTemplate gBattleBgTemplates[] =
+{
+ {
+ .bg = 0,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 24,
+ .screenSize = 2,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0
+ },
+ {
+ .bg = 1,
+ .charBaseIndex = 1,
+ .mapBaseIndex = 28,
+ .screenSize = 2,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0
+ },
+ {
+ .bg = 2,
+ .charBaseIndex = 1,
+ .mapBaseIndex = 30,
+ .screenSize = 1,
+ .paletteMode = 0,
+ .priority = 1,
+ .baseTile = 0
+ },
+ {
+ .bg = 3,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 26,
+ .screenSize = 1,
+ .paletteMode = 0,
+ .priority = 3,
+ .baseTile = 0
+ },
+};
+
+static const struct WindowTemplate gUnknown_0831AA18[] =
+{
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 15,
+ .width = 26,
+ .height = 4,
+ .paletteNum = 0,
+ .baseBlock = 0x0090,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 35,
+ .width = 14,
+ .height = 4,
+ .paletteNum = 0,
+ .baseBlock = 0x01c0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 17,
+ .tilemapTop = 35,
+ .width = 12,
+ .height = 4,
+ .paletteNum = 5,
+ .baseBlock = 0x0190,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 55,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0300,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 11,
+ .tilemapTop = 55,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0310,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 57,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0320,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 11,
+ .tilemapTop = 57,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0330,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 55,
+ .width = 4,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0290,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 57,
+ .width = 0,
+ .height = 0,
+ .paletteNum = 5,
+ .baseBlock = 0x0298,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 25,
+ .tilemapTop = 55,
+ .width = 4,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0298,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 57,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x02a0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 55,
+ .width = 8,
+ .height = 4,
+ .paletteNum = 5,
+ .baseBlock = 0x02b0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 26,
+ .tilemapTop = 9,
+ .width = 3,
+ .height = 4,
+ .paletteNum = 5,
+ .baseBlock = 0x0100,
+ },
+ {
+ .priority = 1,
+ .tilemapLeft = 19,
+ .tilemapTop = 8,
+ .width = 10,
+ .height = 11,
+ .paletteNum = 5,
+ .baseBlock = 0x0100,
+ },
+ {
+ .priority = 2,
+ .tilemapLeft = 18,
+ .tilemapTop = 0,
+ .width = 12,
+ .height = 3,
+ .paletteNum = 6,
+ .baseBlock = 0x016e,
+ },
+ {
+ .priority = 1,
+ .tilemapLeft = 2,
+ .tilemapTop = 3,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0020,
+ },
+ {
+ .priority = 2,
+ .tilemapLeft = 2,
+ .tilemapTop = 3,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0040,
+ },
+ {
+ .priority = 1,
+ .tilemapLeft = 2,
+ .tilemapTop = 2,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0020,
+ },
+ {
+ .priority = 2,
+ .tilemapLeft = 2,
+ .tilemapTop = 2,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0040,
+ },
+ {
+ .priority = 1,
+ .tilemapLeft = 2,
+ .tilemapTop = 6,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0060,
+ },
+ {
+ .priority = 2,
+ .tilemapLeft = 2,
+ .tilemapTop = 6,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0080,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 12,
+ .tilemapTop = 2,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 0,
+ .baseBlock = 0x00a0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 4,
+ .tilemapTop = 2,
+ .width = 7,
+ .height = 2,
+ .paletteNum = 0,
+ .baseBlock = 0x00a0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 19,
+ .tilemapTop = 2,
+ .width = 7,
+ .height = 2,
+ .paletteNum = 0,
+ .baseBlock = 0x00b0,
+ },
+ DUMMY_WIN_TEMPLATE
+};
+
+static const struct WindowTemplate gUnknown_0831AAE0[] =
+{
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 15,
+ .width = 26,
+ .height = 4,
+ .paletteNum = 0,
+ .baseBlock = 0x0090,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 35,
+ .width = 14,
+ .height = 4,
+ .paletteNum = 0,
+ .baseBlock = 0x01c0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 17,
+ .tilemapTop = 35,
+ .width = 12,
+ .height = 4,
+ .paletteNum = 5,
+ .baseBlock = 0x0190,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 55,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0300,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 11,
+ .tilemapTop = 55,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0310,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 57,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0320,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 11,
+ .tilemapTop = 57,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0330,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 55,
+ .width = 4,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0290,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 57,
+ .width = 0,
+ .height = 0,
+ .paletteNum = 5,
+ .baseBlock = 0x0298,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 25,
+ .tilemapTop = 55,
+ .width = 4,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0298,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 57,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x02a0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 55,
+ .width = 8,
+ .height = 4,
+ .paletteNum = 5,
+ .baseBlock = 0x02b0,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 26,
+ .tilemapTop = 9,
+ .width = 3,
+ .height = 4,
+ .paletteNum = 5,
+ .baseBlock = 0x0100,
+ },
+ {
+ .priority = 1,
+ .tilemapLeft = 19,
+ .tilemapTop = 8,
+ .width = 10,
+ .height = 11,
+ .paletteNum = 5,
+ .baseBlock = 0x0100,
+ },
+ {
+ .priority = 2,
+ .tilemapLeft = 18,
+ .tilemapTop = 0,
+ .width = 12,
+ .height = 3,
+ .paletteNum = 6,
+ .baseBlock = 0x016e,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 6,
+ .tilemapTop = 1,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0100,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 14,
+ .tilemapTop = 1,
+ .width = 2,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0110,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 16,
+ .tilemapTop = 1,
+ .width = 8,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0114,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 12,
+ .tilemapTop = 4,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0124,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 12,
+ .tilemapTop = 6,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0130,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 12,
+ .tilemapTop = 8,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x013c,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 8,
+ .tilemapTop = 11,
+ .width = 14,
+ .height = 2,
+ .paletteNum = 5,
+ .baseBlock = 0x0148,
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 15,
+ .width = 26,
+ .height = 4,
+ .paletteNum = 7,
+ .baseBlock = 0x0090,
+ },
+ DUMMY_WIN_TEMPLATE
+};
+
+const struct WindowTemplate * const gBattleWindowTemplates[] =
+{
+ gUnknown_0831AA18,
+ gUnknown_0831AAE0,
+};
+
+static const struct BattleBackground gBattleTerrainTable[] =
+{
+ {
+ .tileset = gBattleTerrainTiles_TallGrass,
+ .tilemap = gBattleTerrainTilemap_TallGrass,
+ .entryTileset = gBattleTerrainAnimTiles_TallGrass,
+ .entryTilemap = gBattleTerrainAnimTilemap_TallGrass,
+ .palette = gBattleTerrainPalette_TallGrass,
+ },
+ {
+ .tileset = gBattleTerrainTiles_LongGrass,
+ .tilemap = gBattleTerrainTilemap_LongGrass,
+ .entryTileset = gBattleTerrainAnimTiles_LongGrass,
+ .entryTilemap = gBattleTerrainAnimTilemap_LongGrass,
+ .palette = gBattleTerrainPalette_LongGrass,
+ },
+ {
+ .tileset = gBattleTerrainTiles_Sand,
+ .tilemap = gBattleTerrainTilemap_Sand,
+ .entryTileset = gBattleTerrainAnimTiles_Sand,
+ .entryTilemap = gBattleTerrainAnimTilemap_Sand,
+ .palette = gBattleTerrainPalette_Sand,
+ },
+ {
+ .tileset = gBattleTerrainTiles_Underwater,
+ .tilemap = gBattleTerrainTilemap_Underwater,
+ .entryTileset = gBattleTerrainAnimTiles_Underwater,
+ .entryTilemap = gBattleTerrainAnimTilemap_Underwater,
+ .palette = gBattleTerrainPalette_Underwater,
+ },
+ {
+ .tileset = gBattleTerrainTiles_Water,
+ .tilemap = gBattleTerrainTilemap_Water,
+ .entryTileset = gBattleTerrainAnimTiles_Water,
+ .entryTilemap = gBattleTerrainAnimTilemap_Water,
+ .palette = gBattleTerrainPalette_Water,
+ },
+ {
+ .tileset = gBattleTerrainTiles_PondWater,
+ .tilemap = gBattleTerrainTilemap_PondWater,
+ .entryTileset = gBattleTerrainAnimTiles_PondWater,
+ .entryTilemap = gBattleTerrainAnimTilemap_PondWater,
+ .palette = gBattleTerrainPalette_PondWater,
+ },
+ {
+ .tileset = gBattleTerrainTiles_Rock,
+ .tilemap = gBattleTerrainTilemap_Rock,
+ .entryTileset = gBattleTerrainAnimTiles_Rock,
+ .entryTilemap = gBattleTerrainAnimTilemap_Rock,
+ .palette = gBattleTerrainPalette_Rock,
+ },
+ {
+ .tileset = gBattleTerrainTiles_Cave,
+ .tilemap = gBattleTerrainTilemap_Cave,
+ .entryTileset = gBattleTerrainAnimTiles_Cave,
+ .entryTilemap = gBattleTerrainAnimTilemap_Cave,
+ .palette = gBattleTerrainPalette_Cave,
+ },
+ {
+ .tileset = gBattleTerrainTiles_Building,
+ .tilemap = gBattleTerrainTilemap_Building,
+ .entryTileset = gBattleTerrainAnimTiles_Building,
+ .entryTilemap = gBattleTerrainAnimTilemap_Building,
+ .palette = gBattleTerrainPalette_Building,
+ },
+ {// plain
+ .tileset = gBattleTerrainTiles_Building,
+ .tilemap = gBattleTerrainTilemap_Building,
+ .entryTileset = gBattleTerrainAnimTiles_Building,
+ .entryTilemap = gBattleTerrainAnimTilemap_Building,
+ .palette = gBattleTerrainPalette_Plain,
+ },
+};
+
+// .text
void BattleInitBgsAndWindows(void)
{
ResetBgsAndClearDma3BusyFlags(0);
diff --git a/src/battle_main.c b/src/battle_main.c
index 1a1f6f61a..781fbeff4 100644
--- a/src/battle_main.c
+++ b/src/battle_main.c
@@ -2055,7 +2055,7 @@ void VBlankCB_Battle(void)
ScanlineEffect_InitHBlankDmaTransfer();
}
-void nullsub_17(void)
+void nullsub_17(struct Sprite *sprite)
{
}
diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c
index b7ed1f713..4765141de 100644
--- a/src/braille_puzzles.c
+++ b/src/braille_puzzles.c
@@ -1,19 +1,16 @@
#include "global.h"
#include "event_data.h"
-#include "constants/songs.h"
-#include "sound.h"
+#include "field_camera.h"
+#include "field_effect.h"
#include "script.h"
-#include "constants/species.h"
+#include "sound.h"
#include "task.h"
-#include "field_effect.h"
#include "constants/flags.h"
#include "constants/maps.h"
+#include "constants/songs.h"
+#include "constants/species.h"
extern void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId); // fieldmap
-extern void DrawWholeMapView(); // field_camera
-extern void SetCameraPanningCallback(void ( *callback)()); // field_camera
-extern void InstallCameraPanAheadCallback(void);
-extern void SetCameraPanning(s16 x, s16 y);
extern u8 GetCursorSelectionMonId(void);
extern u8 oei_task_add(void);
@@ -26,7 +23,45 @@ enum
EWRAM_DATA static u8 sBraillePuzzleCallbackFlag = 0;
-extern const u8 gUnknown_085EFE74[][2];
+static const u8 gUnknown_085EFE74[][2] =
+{
+ {0x04, 0x15},
+ {0x05, 0x15},
+ {0x06, 0x15},
+ {0x07, 0x15},
+ {0x08, 0x15},
+ {0x09, 0x15},
+ {0x0a, 0x15},
+ {0x0b, 0x15},
+ {0x0c, 0x15},
+ {0x0c, 0x16},
+ {0x0c, 0x17},
+ {0x0d, 0x17},
+ {0x0d, 0x18},
+ {0x0d, 0x19},
+ {0x0d, 0x1a},
+ {0x0d, 0x1b},
+ {0x0c, 0x1b},
+ {0x0c, 0x1c},
+ {0x04, 0x1d},
+ {0x05, 0x1d},
+ {0x06, 0x1d},
+ {0x07, 0x1d},
+ {0x08, 0x1d},
+ {0x09, 0x1d},
+ {0x0a, 0x1d},
+ {0x0b, 0x1d},
+ {0x0c, 0x1d},
+ {0x04, 0x1c},
+ {0x04, 0x1b},
+ {0x03, 0x1b},
+ {0x03, 0x1a},
+ {0x03, 0x19},
+ {0x03, 0x18},
+ {0x03, 0x17},
+ {0x04, 0x17},
+ {0x04, 0x16},
+};
void SealedChamberShakingEffect(u8);
void sub_8179860(void);
diff --git a/src/data2b.c b/src/data2b.c
index 46a158e09..50cdee323 100644
--- a/src/data2b.c
+++ b/src/data2b.c
@@ -1,9 +1,257 @@
#include "global.h"
#include "data2.h"
#include "graphics.h"
+#include "malloc.h"
-extern const union AnimCmd gAnimCmd_General_Frame0[];
-extern const union AnimCmd AnimCmd_82FF540[];
+const u16 gUnknown_082FF1D8[] = INCBIN_U16("graphics/link/minigame_digits.gbapal");
+const u8 gUnknown_082FF1F8[] = INCBIN_U8("graphics/link/minigame_digits.4bpp.lz");
+const u8 gUnknown_082FF2B8[] = INCBIN_U8("graphics/link/minigame_digits2.4bpp.lz");
+
+const struct SpriteFrameImage gUnknown_082FF3A8[] =
+{
+ gHeap + 0x8000, 0x800,
+ gHeap + 0x8800, 0x800,
+ gHeap + 0x9000, 0x800,
+ gHeap + 0x9800, 0x800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF3C8[] =
+{
+ gHeap + 0xA000, 0x800,
+ gHeap + 0xA800, 0x800,
+ gHeap + 0xB000, 0x800,
+ gHeap + 0xB800, 0x800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF3E8[] =
+{
+ gHeap + 0xC000, 0x800,
+ gHeap + 0xC800, 0x800,
+ gHeap + 0xD000, 0x800,
+ gHeap + 0xD800, 0x800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF408[] =
+{
+ gHeap + 0xE000, 0x800,
+ gHeap + 0xE800, 0x800,
+ gHeap + 0xF000, 0x800,
+ gHeap + 0xF800, 0x800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF428[] =
+{
+ gTrainerBackPic_Brendan, 0x0800,
+ gTrainerBackPic_Brendan + 0x0800, 0x0800,
+ gTrainerBackPic_Brendan + 0x1000, 0x0800,
+ gTrainerBackPic_Brendan + 0x1800, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF448[] =
+{
+ gTrainerBackPic_May, 0x0800,
+ gTrainerBackPic_May + 0x0800, 0x0800,
+ gTrainerBackPic_May + 0x1000, 0x0800,
+ gTrainerBackPic_May + 0x1800, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF468[] =
+{
+ gTrainerBackPic_Red, 0x0800,
+ gTrainerBackPic_Red + 0x0800, 0x0800,
+ gTrainerBackPic_Red + 0x1000, 0x0800,
+ gTrainerBackPic_Red + 0x1800, 0x0800,
+ gTrainerBackPic_Red + 0x2000, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF490[] =
+{
+ gTrainerBackPic_Leaf, 0x0800,
+ gTrainerBackPic_Leaf + 0x0800, 0x0800,
+ gTrainerBackPic_Leaf + 0x1000, 0x0800,
+ gTrainerBackPic_Leaf + 0x1800, 0x0800,
+ gTrainerBackPic_Leaf + 0x2000, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF4B8[] =
+{
+ gTrainerBackPic_RubySapphireBrendan, 0x0800,
+ gTrainerBackPic_RubySapphireBrendan + 0x0800, 0x0800,
+ gTrainerBackPic_RubySapphireBrendan + 0x1000, 0x0800,
+ gTrainerBackPic_RubySapphireBrendan + 0x1800, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF4D8[] =
+{
+ gTrainerBackPic_RubySapphireMay, 0x0800,
+ gTrainerBackPic_RubySapphireMay + 0x0800, 0x0800,
+ gTrainerBackPic_RubySapphireMay + 0x1000, 0x0800,
+ gTrainerBackPic_RubySapphireMay + 0x1800, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF4F8[] =
+{
+ gTrainerBackPic_Wally, 0x0800,
+ gTrainerBackPic_Wally + 0x0800, 0x0800,
+ gTrainerBackPic_Wally + 0x1000, 0x0800,
+ gTrainerBackPic_Wally + 0x1800, 0x0800,
+};
+
+const struct SpriteFrameImage gUnknown_082FF518[] =
+{
+ gTrainerBackPic_Steven, 0x0800,
+ gTrainerBackPic_Steven + 0x0800, 0x0800,
+ gTrainerBackPic_Steven + 0x1000, 0x0800,
+ gTrainerBackPic_Steven + 0x1800, 0x0800,
+};
+
+const union AnimCmd gAnimCmd_General_Frame0[] =
+{
+ ANIMCMD_FRAME(0, 0),
+ ANIMCMD_END,
+};
+
+const union AnimCmd AnimCmd_82FF540[] =
+{
+ ANIMCMD_FRAME(3, 0),
+ ANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF548[] =
+{
+ AFFINEANIMCMD_FRAME(0x0100, 0x0100, 0x00, 0x00),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF558[] =
+{
+ AFFINEANIMCMD_FRAME(0xff00, 0x0100, 0x00, 0x00),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF568[] =
+{
+ AFFINEANIMCMD_FRAME(0x0028, 0x0028, 0x00, 0x00),
+ AFFINEANIMCMD_FRAME(0x0012, 0x0012, 0x00, 0x0c),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF580[] =
+{
+ AFFINEANIMCMD_FRAME(0xfffe, 0xfffe, 0x00, 0x12),
+ AFFINEANIMCMD_FRAME(0xfff0, 0xfff0, 0x00, 0x0f),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF598[] =
+{
+ AFFINEANIMCMD_FRAME(0x00a0, 0x0100, 0x00, 0x00),
+ AFFINEANIMCMD_FRAME(0x0004, 0x0000, 0x00, 0x08),
+ AFFINEANIMCMD_FRAME(0xfffc, 0x0000, 0x00, 0x08),
+ AFFINEANIMCMD_JUMP(1),
+};
+
+const union AffineAnimCmd gUnknown_082FF5B8[] =
+{
+ AFFINEANIMCMD_FRAME(0x0002, 0x0002, 0x00, 0x14),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF5C8[] =
+{
+ AFFINEANIMCMD_FRAME(0xfffe, 0xfffe, 0x00, 0x14),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF5D8[] =
+{
+ AFFINEANIMCMD_FRAME(0x0100, 0x0100, 0x00, 0000),
+ AFFINEANIMCMD_FRAME(0xfff0, 0xfff0, 0x00, 0x09),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF5F0[] =
+{
+ AFFINEANIMCMD_FRAME(0x0004, 0x0004, 0x00, 0x3f),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF600[] =
+{
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfd, 0x05),
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x03, 0x05),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd * const gUnknown_082FF618[] =
+{
+ gUnknown_082FF548,
+ gUnknown_082FF568,
+ gUnknown_082FF580,
+ gUnknown_082FF598,
+ gUnknown_082FF5B8,
+ gUnknown_082FF5C8,
+ gUnknown_082FF5F0,
+ gUnknown_082FF600,
+ gUnknown_082FF5D8,
+};
+
+const union AffineAnimCmd gUnknown_082FF63C[] =
+{
+ AFFINEANIMCMD_FRAME(0xfffc, 0xfffc, 0x04, 0x3f),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF64C[] =
+{
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x03, 0x05),
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfd, 0x05),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF664[] =
+{
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfb, 0x14),
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x00, 0x14),
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x05, 0x14),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd gUnknown_082FF684[] =
+{
+ AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x09, 0x6e),
+ AFFINEANIMCMD_END,
+};
+
+const union AffineAnimCmd * const gUnknown_082FF694[] =
+{
+ gUnknown_082FF548,
+ gUnknown_082FF568,
+ gUnknown_082FF580,
+ gUnknown_082FF598,
+ gUnknown_082FF5B8,
+ gUnknown_082FF5C8,
+ gUnknown_082FF63C,
+ gUnknown_082FF64C,
+ gUnknown_082FF664,
+ gUnknown_082FF5D8,
+ gUnknown_082FF684,
+};
+
+const union AffineAnimCmd * const gUnknown_082FF6C0[] =
+{
+ gUnknown_082FF558,
+ gUnknown_082FF568,
+ gUnknown_082FF580,
+ gUnknown_082FF598,
+ gUnknown_082FF5B8,
+ gUnknown_082FF5C8,
+ gUnknown_082FF63C,
+ gUnknown_082FF64C,
+ gUnknown_082FF664,
+ gUnknown_082FF5D8,
+ gUnknown_082FF684,
+};
#include "data/pokemon_graphics/unknown_anims.h"
#include "data/pokemon_graphics/front_pic_coordinates.h"
diff --git a/src/field_special_scene.c b/src/field_special_scene.c
index c6cb0741d..1cabf63d6 100644
--- a/src/field_special_scene.c
+++ b/src/field_special_scene.c
@@ -1,22 +1,21 @@
#include "global.h"
-#include "task.h"
-#include "sprite.h"
+#include "event_data.h"
#include "event_object_movement.h"
-#include "constants/songs.h"
-#include "sound.h"
+#include "main.h"
#include "palette.h"
#include "script.h"
+#include "script_movement.h"
+#include "sound.h"
+#include "sprite.h"
+#include "task.h"
+#include "constants/songs.h"
#include "constants/vars.h"
-#include "event_data.h"
-#include "main.h"
#define SECONDS(value) ((signed) (60.0 * value + 0.5))
extern u8 GetSSTidalLocation(s8 *, s8 *, s16 *, s16 *); // should be in field_specials.h
extern void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
-extern bool8 ScriptMovement_IsObjectMovementFinished(u8, u8, u8);
extern bool32 CountSSTidalStep(u16);
-extern bool8 ScriptMovement_StartObjectMovementScript(u8, u8, u8, u8 *);
extern void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused);
extern void sp13E_warp_to_last_warp(void);
extern void saved_warp2_set(int unused, s8 mapGroup, s8 mapNum, s8 warpId);
@@ -38,11 +37,12 @@ extern void pal_fill_black(void);
extern void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId);
extern void DrawWholeMapView();
-extern s8 gTruckCamera_HorizontalTable[];
-
-extern u8 gUnknown_0858E8AB[];
-extern u8 gUnknown_0858E8AD[];
+//. rodata
+static const s8 gTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0};
+const u8 gUnknown_0858E8AB[] = {0x18, 0xFE};
+const u8 gUnknown_0858E8AD[] = {0x17, 0xFE};
+// .text
void Task_Truck3(u8);
s16 GetTruckCameraBobbingY(int a1)
diff --git a/src/item_use.c b/src/item_use.c
index ea8206502..67bdabd87 100755
--- a/src/item_use.c
+++ b/src/item_use.c
@@ -1,15 +1,10 @@
#include "global.h"
#include "item_use.h"
#include "battle.h"
-#include "main.h"
+#include "battle_pyramid_bag.h"
#include "berry.h"
#include "bike.h"
#include "coins.h"
-#include "constants/bg_event_constants.h"
-#include "constants/flags.h"
-#include "constants/items.h"
-#include "constants/songs.h"
-#include "constants/vars.h"
#include "data2.h"
#include "event_data.h"
#include "fieldmap.h"
@@ -18,25 +13,31 @@
#include "field_screen.h"
#include "field_weather.h"
#include "item.h"
+#include "item_menu.h"
#include "mail.h"
+#include "main.h"
+#include "menu.h"
+#include "menu_helpers.h"
#include "metatile_behavior.h"
#include "overworld.h"
#include "palette.h"
+#include "party_menu.h"
+#include "pokeblock.h"
#include "pokemon.h"
#include "rom_818CFC8.h"
#include "script.h"
#include "sound.h"
+#include "strings.h"
#include "string_util.h"
#include "task.h"
#include "text.h"
-#include "strings.h"
-#include "pokeblock.h"
-#include "menu.h"
-#include "item_menu.h"
-#include "battle_pyramid_bag.h"
+#include "constants/bg_event_constants.h"
+#include "constants/flags.h"
+#include "constants/items.h"
+#include "constants/songs.h"
+#include "constants/vars.h"
extern void(*gUnknown_0203A0F4)(u8 taskId);
-extern void(*gUnknown_085920D8[])(void);
extern void (*gUnknown_03006328)(u8, u16, TaskFunc);
extern void unknown_ItemMenu_Confirm(u8 taskId);
extern void sub_81C5B14(u8 taskId);
@@ -45,7 +46,6 @@ extern void ItemUseOutOfBattle_TMHM(u8 a);
extern void ItemUseOutOfBattle_EvolutionStone(u8 b);
extern bool8 IsPlayerFacingSurfableFishableWater(void);
extern bool8 sub_81221AC(void);
-extern u8 gUnknown_085920E4[];
extern u8 Route102_EventScript_274482[];
extern u8 Route102_EventScript_2744C0[];
extern u8 BattleFrontier_OutsideEast_EventScript_242CFC[];
@@ -53,16 +53,7 @@ extern int sub_80247BC(void);
extern struct MapHeader* mapconnection_get_mapheader(struct MapConnection *connection);
extern void SetUpItemUseCallback(u8 taskId);
extern void ItemUseCB_Medicine(u8, u16, TaskFunc);
-extern void sub_81B67C8(u8, u16, TaskFunc);
-extern void sub_81B79E8(u8, u16, TaskFunc);
-extern void dp05_ether(u8, u16, TaskFunc);
-extern void dp05_pp_up(u8, u16, TaskFunc);
-extern void dp05_rare_candy(u8, u16, TaskFunc);
-extern void sub_81B6DC4(u8, u16, TaskFunc);
-extern void sub_81B7C74(u8, u16, TaskFunc);
-extern u16 ItemIdToBattleMoveId(u16);
-extern void bag_menu_yes_no(u8, u8, void(**)(u8 taskId));
-extern void (*gUnknown_085920E8[])(u8 taskId);
+extern void bag_menu_yes_no(u8, u8, const struct YesNoFuncTable*);
extern void sub_81C5924(void);
extern void sub_81C59BC(void);
extern void sub_81AB9A8(u8);
@@ -92,6 +83,7 @@ void sub_80FDE7C(u8 taskId);
void sub_80FDF90(u8 taskId);
void task08_0809AD8C(u8 taskId);
void sub_80FE024(u8 taskId);
+void sub_80FE03C(u8 taskId);
void sub_80FE124(u8 taskId);
void sub_80FE164(u8 taskId);
@@ -108,6 +100,25 @@ void sub_80FDBEC(void);
bool8 sub_80FDE2C(void);
void ItemUseOutOfBattle_CannotUse(u8 taskId);
+// .rodata
+
+static const MainCallback gUnknown_085920D8[] =
+{
+ sub_81B617C,
+ CB2_ReturnToField,
+ NULL,
+};
+
+static const u8 gUnknown_085920E4[] = {DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST};
+
+static const struct YesNoFuncTable gUnknown_085920E8 =
+{
+ .yesFunc = sub_80FE03C,
+ .noFunc = bag_menu_inits_lists_menu,
+};
+
+// .text
+
void SetUpItemUseCallback(u8 taskId)
{
u8 type;
@@ -784,7 +795,7 @@ void task08_0809AD8C(u8 taskId)
void sub_80FE024(u8 taskId)
{
- bag_menu_yes_no(taskId, 6, gUnknown_085920E8);
+ bag_menu_yes_no(taskId, 6, &gUnknown_085920E8);
}
void sub_80FE03C(u8 taskId)