summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdata/berry_powder.s36
-rw-r--r--ld_script.txt2
-rwxr-xr-xsrc/berry_powder.c112
3 files changed, 113 insertions, 37 deletions
diff --git a/data/berry_powder.s b/data/berry_powder.s
deleted file mode 100755
index 2e8002bdd..000000000
--- a/data/berry_powder.s
+++ /dev/null
@@ -1,36 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .section .rodata
-
-
- .align 2
-gUnknown_082F7BA4_UnrefDupe:: @ 82F444C struct BgTemplate(???)
- .4byte 0x000001e0
- .4byte 0x000012c9
- .4byte 0x000012ea
- .4byte 0x000021ff
- .4byte 0x000000ff
- .4byte 0x00000000
-
- .align 2
-gUnknown_082F7BBC_UnrefDupe:: @ 82F4464
- window_template 0x00, 0x01, 0x01, 0x1c, 0x02, 0x0d, 0x0013
- window_template 0x00, 0x01, 0x05, 0x1c, 0x0e, 0x0d, 0x004b
-
- .align 2
-gUnknown_082F7BCC_UnrefDupe:: @ 82F4474
- window_template 0x00, 0x01, 0x05, 0x1c, 0x07, 0x0d, 0x004b
-
- .align 2
-gUnknown_082F7BD4_UnrefDupe:: @ 82F447C
- window_template 0x00, 0x01, 0x08, 0x13, 0x03, 0x0d, 0x0013
- window_template 0x00, 0x16, 0x07, 0x06, 0x04, 0x0d, 0x004c
-
- .align 2
-gUnknown_082F7BE4_UnrefDupe:: @ 82F448C
- window_template 0x00, 0x04, 0x06, 0x16, 0x05, 0x0d, 0x0013
-
- .align 2
-gUnknown_082F7BEC_UnrefDupe:: @ 82F4494
- window_template 0x00, 0x05, 0x08, 0x13, 0x03, 0x0d, 0x0013
diff --git a/ld_script.txt b/ld_script.txt
index b3b149f66..7e7ee4ee0 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -455,7 +455,7 @@ SECTIONS {
src/union_room_chat.o(.rodata);
src/berry_crush.o(.rodata);
data/berry_crush.o(.rodata);
- data/berry_powder.o(.rodata);
+ src/berry_powder.o(.rodata);
src/dodrio_berry_picking.o(.rodata);
src/pokemon_jump.o(.rodata);
src/rtc.o(.rodata);
diff --git a/src/berry_powder.c b/src/berry_powder.c
index 91f9d0d4e..50d280f0a 100755
--- a/src/berry_powder.c
+++ b/src/berry_powder.c
@@ -14,6 +14,118 @@
static EWRAM_DATA u8 sBerryPowderVendorWindowId = 0;
+// Unused
+static const struct BgTemplate sBerryPowderBgTemplates[] =
+{
+ {
+ .bg = 0,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 30,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0
+ },
+ {
+ .bg = 1,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 12,
+ .screenSize = 1,
+ .paletteMode = 0,
+ .priority = 1,
+ .baseTile = 0
+ },
+ {
+ .bg = 2,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 14,
+ .screenSize = 1,
+ .paletteMode = 0,
+ .priority = 1,
+ .baseTile = 0
+ },
+ {
+ .bg = 3,
+ .charBaseIndex = 3,
+ .mapBaseIndex = 31,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 2,
+ .baseTile = 0
+ },
+};
+
+// ? Part of the BG templates?
+static const u32 sUnknown[] = {0xFF, 0x00};
+
+// Unused
+static const struct WindowTemplate sBerryPowderWindowTemplates[] =
+{
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 1,
+ .width = 28,
+ .height = 2,
+ .paletteNum = 13,
+ .baseBlock = 19
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 5,
+ .width = 28,
+ .height = 14,
+ .paletteNum = 13,
+ .baseBlock = 75
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 5,
+ .width = 28,
+ .height = 7,
+ .paletteNum = 13,
+ .baseBlock = 75
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 8,
+ .width = 19,
+ .height = 3,
+ .paletteNum = 13,
+ .baseBlock = 19
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 22,
+ .tilemapTop = 7,
+ .width = 6,
+ .height = 4,
+ .paletteNum = 13,
+ .baseBlock = 76
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 4,
+ .tilemapTop = 6,
+ .width = 22,
+ .height = 5,
+ .paletteNum = 13,
+ .baseBlock = 19
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 5,
+ .tilemapTop = 8,
+ .width = 19,
+ .height = 3,
+ .paletteNum = 13,
+ .baseBlock = 19
+ },
+};
+
static u32 DecryptBerryPowder(u32 *powder)
{
return *powder ^ gSaveBlock2Ptr->encryptionKey;