summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/trainer_tower.s76
-rw-r--r--data/data_8471F00.s17
-rw-r--r--data/graphics.s36
-rw-r--r--graphics/berry_fix/gba_small.binbin0 -> 2048 bytes
-rw-r--r--graphics/berry_fix/gba_small.pal35
-rw-r--r--graphics/berry_fix/gba_small.pngbin0 -> 2790 bytes
-rw-r--r--graphics/berry_fix/gba_transfer.binbin0 -> 2048 bytes
-rw-r--r--graphics/berry_fix/gba_transfer.pal35
-rw-r--r--graphics/berry_fix/gba_transfer.pngbin0 -> 2311 bytes
-rw-r--r--graphics/berry_fix/gba_transfer_error.binbin0 -> 2048 bytes
-rw-r--r--graphics/berry_fix/gba_transfer_error.pal35
-rw-r--r--graphics/berry_fix/gba_transfer_error.pngbin0 -> 1865 bytes
-rw-r--r--graphics/berry_fix/gba_transfer_highlight.binbin0 -> 2048 bytes
-rw-r--r--graphics/berry_fix/gba_transfer_highlight.pal35
-rw-r--r--graphics/berry_fix/gba_transfer_highlight.pngbin0 -> 2207 bytes
-rw-r--r--graphics/berry_fix/logo.binbin0 -> 2048 bytes
-rw-r--r--graphics/berry_fix/logo.pal51
-rw-r--r--graphics/berry_fix/logo.pngbin0 -> 2531 bytes
-rw-r--r--graphics/berry_fix/window.binbin0 -> 2048 bytes
-rw-r--r--graphics/berry_fix/window.pal35
-rw-r--r--graphics/berry_fix/window.pngbin0 -> 1430 bytes
-rw-r--r--src/trainer_tower.c33
22 files changed, 293 insertions, 95 deletions
diff --git a/asm/trainer_tower.s b/asm/trainer_tower.s
index d5cf80b9f..a8c331cec 100644
--- a/asm/trainer_tower.s
+++ b/asm/trainer_tower.s
@@ -5,82 +5,6 @@
.text
- thumb_func_start sub_815D838
-sub_815D838: @ 815D838
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- movs r2, 0
- ldr r0, _0815D8C0 @ =gUnknown_8479D38
- mov r10, r0
- movs r1, 0xFA
- lsls r1, 2
- adds r5, r1, 0
-_0815D84E:
- lsls r0, r2, 3
- subs r0, r2
- lsls r0, 2
- adds r1, r0, 0
- add r1, r10
- mov r8, r1
- mov r1, r10
- adds r1, 0x8
- adds r7, r0, r1
- ldr r1, _0815D8C4 @ =gUnknown_8479D48
- adds r6, r0, r1
- movs r4, 0
- adds r2, 0x1
- mov r9, r2
-_0815D86A:
- mov r0, r8
- adds r1, r0, r4
- ldrb r0, [r1]
- cmp r0, 0xFF
- beq _0815D87C
- ldrb r1, [r1]
- adds r0, r5, r1
- bl FlagSet
-_0815D87C:
- adds r1, r7, r4
- ldrb r0, [r1]
- cmp r0, 0xFF
- beq _0815D88C
- ldrb r1, [r1]
- adds r0, r5, r1
- bl FlagSet
-_0815D88C:
- adds r1, r6, r4
- ldrb r0, [r1]
- cmp r0, 0xFF
- beq _0815D89C
- ldrb r1, [r1]
- adds r0, r5, r1
- bl FlagSet
-_0815D89C:
- adds r0, r4, 0x1
- lsls r0, 24
- lsrs r4, r0, 24
- cmp r4, 0x7
- bls _0815D86A
- mov r1, r9
- lsls r0, r1, 24
- lsrs r2, r0, 24
- cmp r2, 0xE
- bls _0815D84E
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0815D8C0: .4byte gUnknown_8479D38
-_0815D8C4: .4byte gUnknown_8479D48
- thumb_func_end sub_815D838
-
thumb_func_start sub_815D8C8
sub_815D8C8: @ 815D8C8
push {r4,lr}
diff --git a/data/data_8471F00.s b/data/data_8471F00.s
index 28454ac2d..f43d61cd2 100644
--- a/data/data_8471F00.s
+++ b/data/data_8471F00.s
@@ -265,6 +265,8 @@ gUnknown_8479D10:: @ 8479D10
gUnknown_8479D24:: @ 8479D24
.asciz "ttdata->id == 0"
+ // trainer_tower
+
gUnknown_8479D34:: @ 8479D34
.incbin "baserom.gba", 0x479D34, 0x4
@@ -313,6 +315,8 @@ gUnknown_847A2FE:: @ 847A2FE
gUnknown_847A30E:: @ 847A30E
.incbin "baserom.gba", 0x47A30E, 0x48E
+ // unk_815F138
+
gUnknown_847A79C:: @ 847A79C
.incbin "baserom.gba", 0x47A79C, 0x8
@@ -325,8 +329,19 @@ gUnknown_847A860:: @ 847A860
gUnknown_847A878:: @ 847A878
.incbin "baserom.gba", 0x47A878, 0x18
+ // berry_fix_program
+
gUnknown_847A890:: @ 847A890
- .incbin "baserom.gba", 0x47A890, 0x7F1C
+ .4byte gUnknown_8EA467C, gUnknown_8EA52B8, gUnknown_8EA463C
+ .4byte gUnknown_8EA5664, gUnknown_8EA60C8, gUnknown_8EA5604
+ .4byte gUnknown_8EA6408, gUnknown_8EA7028, gUnknown_8EA63C8
+ .4byte gUnknown_8EA7320, gUnknown_8EA8118, gUnknown_8EA72E0
+ .4byte gUnknown_8EA8408, gUnknown_8EA8CC8, gUnknown_8EA83C8
+ .4byte gUnknown_8EA8F40, gUnknown_8EA9588, gUnknown_8EA8F00
+
+ .incbin "baserom.gba", 0x47A8D8, 0x7ED4
+
+ // trainer_tower (again?)
gUnknown_84827AC:: @ 84827AC
.incbin "baserom.gba", 0x4827AC, 0x8
diff --git a/data/graphics.s b/data/graphics.s
index 990a3dd9c..a1e421f2c 100644
--- a/data/graphics.s
+++ b/data/graphics.s
@@ -16222,58 +16222,58 @@ gUnknown_8EA1D68:: @ 8EA1D68
.incbin "baserom.gba", 0xEA1D68, 0x28D4
gUnknown_8EA463C:: @ 8EA463C
- .incbin "baserom.gba", 0xEA463C, 0x40 @UNKNOWN
+ .incbin "graphics/berry_fix/gba_small.gbapal"
gUnknown_8EA467C:: @ 8EA467C
- .incbin "baserom.gba", 0xEA467C, 0xC3C
+ .incbin "graphics/berry_fix/gba_small.4bpp.lz"
gUnknown_8EA52B8:: @ 8EA52B8
- .incbin "baserom.gba", 0xEA52B8, 0x34C
+ .incbin "graphics/berry_fix/gba_small.bin.lz"
gUnknown_8EA5604:: @ 8EA5604
- .incbin "baserom.gba", 0xEA5604, 0x60 @UNKNOWN
+ .incbin "graphics/berry_fix/logo.gbapal"
gUnknown_8EA5664:: @ 8EA5664
- .incbin "baserom.gba", 0xEA5664, 0xA64
+ .incbin "graphics/berry_fix/logo.4bpp.lz"
gUnknown_8EA60C8:: @ 8EA60C8
- .incbin "baserom.gba", 0xEA60C8, 0x300
+ .incbin "graphics/berry_fix/logo.bin.lz"
gUnknown_8EA63C8:: @ 8EA63C8
- .incbin "baserom.gba", 0xEA63C8, 0x40 @UNKNOWN
+ .incbin "graphics/berry_fix/gba_transfer.gbapal"
gUnknown_8EA6408:: @ 8EA6408
- .incbin "baserom.gba", 0xEA6408, 0xC20
+ .incbin "graphics/berry_fix/gba_transfer.4bpp.lz"
gUnknown_8EA7028:: @ 8EA7028
- .incbin "baserom.gba", 0xEA7028, 0x2B8
+ .incbin "graphics/berry_fix/gba_transfer.bin.lz"
gUnknown_8EA72E0:: @ 8EA72E0
- .incbin "baserom.gba", 0xEA72E0, 0x40 @UNKNOWN
+ .incbin "graphics/berry_fix/gba_transfer_highlight.gbapal"
gUnknown_8EA7320:: @ 8EA7320
- .incbin "baserom.gba", 0xEA7320, 0xDF8
+ .incbin "graphics/berry_fix/gba_transfer_highlight.4bpp.lz"
gUnknown_8EA8118:: @ 8EA8118
- .incbin "baserom.gba", 0xEA8118, 0x2B0
+ .incbin "graphics/berry_fix/gba_transfer_highlight.bin.lz"
gUnknown_8EA83C8:: @ 8EA83C8
- .incbin "baserom.gba", 0xEA83C8, 0x40 @UNKNOWN
+ .incbin "graphics/berry_fix/gba_transfer_error.gbapal"
gUnknown_8EA8408:: @ 8EA8408
- .incbin "baserom.gba", 0xEA8408, 0x8C0
+ .incbin "graphics/berry_fix/gba_transfer_error.4bpp.lz"
gUnknown_8EA8CC8:: @ 8EA8CC8
- .incbin "baserom.gba", 0xEA8CC8, 0x238
+ .incbin "graphics/berry_fix/gba_transfer_error.bin.lz"
gUnknown_8EA8F00:: @ 8EA8F00
- .incbin "baserom.gba", 0xEA8F00, 0x40 @UNKNOWN
+ .incbin "graphics/berry_fix/window.gbapal"
gUnknown_8EA8F40:: @ 8EA8F40
- .incbin "baserom.gba", 0xEA8F40, 0x648
+ .incbin "graphics/berry_fix/window.4bpp.lz"
gUnknown_8EA9588:: @ 8EA9588
- .incbin "baserom.gba", 0xEA9588, 0x26C
+ .incbin "graphics/berry_fix/window.bin.lz"
gUnknown_8EA97F4:: @ 8EA97F4
.incbin "baserom.gba", 0xEA97F4, 0x120 @UNKNOWN
diff --git a/graphics/berry_fix/gba_small.bin b/graphics/berry_fix/gba_small.bin
new file mode 100644
index 000000000..86a29cf70
--- /dev/null
+++ b/graphics/berry_fix/gba_small.bin
Binary files differ
diff --git a/graphics/berry_fix/gba_small.pal b/graphics/berry_fix/gba_small.pal
new file mode 100644
index 000000000..0e177217f
--- /dev/null
+++ b/graphics/berry_fix/gba_small.pal
@@ -0,0 +1,35 @@
+JASC-PAL
+0100
+32
+0 0 0
+255 255 255
+32 32 32
+172 172 172
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+164 213 90
+238 230 197
+148 197 213
+32 57 98
+106 148 197
+90 106 156
+255 255 255
+164 213 90
+32 32 32
+123 123 205
+255 255 255
+74 74 115
+197 197 197
+98 98 189
+106 106 197
+98 123 57
+131 131 131
+222 41 0
+189 123 41
+180 180 222
+0 0 0
+0 0 0
diff --git a/graphics/berry_fix/gba_small.png b/graphics/berry_fix/gba_small.png
new file mode 100644
index 000000000..59bfaf4d5
--- /dev/null
+++ b/graphics/berry_fix/gba_small.png
Binary files differ
diff --git a/graphics/berry_fix/gba_transfer.bin b/graphics/berry_fix/gba_transfer.bin
new file mode 100644
index 000000000..077beaa83
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer.bin
Binary files differ
diff --git a/graphics/berry_fix/gba_transfer.pal b/graphics/berry_fix/gba_transfer.pal
new file mode 100644
index 000000000..0e177217f
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer.pal
@@ -0,0 +1,35 @@
+JASC-PAL
+0100
+32
+0 0 0
+255 255 255
+32 32 32
+172 172 172
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+164 213 90
+238 230 197
+148 197 213
+32 57 98
+106 148 197
+90 106 156
+255 255 255
+164 213 90
+32 32 32
+123 123 205
+255 255 255
+74 74 115
+197 197 197
+98 98 189
+106 106 197
+98 123 57
+131 131 131
+222 41 0
+189 123 41
+180 180 222
+0 0 0
+0 0 0
diff --git a/graphics/berry_fix/gba_transfer.png b/graphics/berry_fix/gba_transfer.png
new file mode 100644
index 000000000..a741fe1b9
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer.png
Binary files differ
diff --git a/graphics/berry_fix/gba_transfer_error.bin b/graphics/berry_fix/gba_transfer_error.bin
new file mode 100644
index 000000000..9d1cfdae4
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer_error.bin
Binary files differ
diff --git a/graphics/berry_fix/gba_transfer_error.pal b/graphics/berry_fix/gba_transfer_error.pal
new file mode 100644
index 000000000..0e177217f
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer_error.pal
@@ -0,0 +1,35 @@
+JASC-PAL
+0100
+32
+0 0 0
+255 255 255
+32 32 32
+172 172 172
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+164 213 90
+238 230 197
+148 197 213
+32 57 98
+106 148 197
+90 106 156
+255 255 255
+164 213 90
+32 32 32
+123 123 205
+255 255 255
+74 74 115
+197 197 197
+98 98 189
+106 106 197
+98 123 57
+131 131 131
+222 41 0
+189 123 41
+180 180 222
+0 0 0
+0 0 0
diff --git a/graphics/berry_fix/gba_transfer_error.png b/graphics/berry_fix/gba_transfer_error.png
new file mode 100644
index 000000000..766b9f28e
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer_error.png
Binary files differ
diff --git a/graphics/berry_fix/gba_transfer_highlight.bin b/graphics/berry_fix/gba_transfer_highlight.bin
new file mode 100644
index 000000000..4683bab3a
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer_highlight.bin
Binary files differ
diff --git a/graphics/berry_fix/gba_transfer_highlight.pal b/graphics/berry_fix/gba_transfer_highlight.pal
new file mode 100644
index 000000000..0e177217f
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer_highlight.pal
@@ -0,0 +1,35 @@
+JASC-PAL
+0100
+32
+0 0 0
+255 255 255
+32 32 32
+172 172 172
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+164 213 90
+238 230 197
+148 197 213
+32 57 98
+106 148 197
+90 106 156
+255 255 255
+164 213 90
+32 32 32
+123 123 205
+255 255 255
+74 74 115
+197 197 197
+98 98 189
+106 106 197
+98 123 57
+131 131 131
+222 41 0
+189 123 41
+180 180 222
+0 0 0
+0 0 0
diff --git a/graphics/berry_fix/gba_transfer_highlight.png b/graphics/berry_fix/gba_transfer_highlight.png
new file mode 100644
index 000000000..25b47d036
--- /dev/null
+++ b/graphics/berry_fix/gba_transfer_highlight.png
Binary files differ
diff --git a/graphics/berry_fix/logo.bin b/graphics/berry_fix/logo.bin
new file mode 100644
index 000000000..673ff47e4
--- /dev/null
+++ b/graphics/berry_fix/logo.bin
Binary files differ
diff --git a/graphics/berry_fix/logo.pal b/graphics/berry_fix/logo.pal
new file mode 100644
index 000000000..4c76f3f9a
--- /dev/null
+++ b/graphics/berry_fix/logo.pal
@@ -0,0 +1,51 @@
+JASC-PAL
+0100
+48
+0 0 0
+255 255 255
+32 32 32
+172 172 172
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+164 213 90
+238 230 197
+148 197 213
+32 57 98
+106 148 197
+90 106 156
+255 255 255
+164 213 90
+32 32 32
+123 123 205
+255 255 255
+74 74 115
+197 197 197
+98 98 189
+106 106 197
+98 123 57
+131 131 131
+222 41 0
+189 123 41
+180 180 222
+0 0 0
+0 0 0
+0 0 0
+255 255 255
+238 238 238
+222 222 230
+205 205 222
+197 197 205
+180 180 197
+164 164 189
+156 156 172
+139 139 164
+123 123 156
+115 115 139
+98 98 131
+82 82 123
+74 74 115
+32 32 32
diff --git a/graphics/berry_fix/logo.png b/graphics/berry_fix/logo.png
new file mode 100644
index 000000000..ab91d5a26
--- /dev/null
+++ b/graphics/berry_fix/logo.png
Binary files differ
diff --git a/graphics/berry_fix/window.bin b/graphics/berry_fix/window.bin
new file mode 100644
index 000000000..100c5da6f
--- /dev/null
+++ b/graphics/berry_fix/window.bin
Binary files differ
diff --git a/graphics/berry_fix/window.pal b/graphics/berry_fix/window.pal
new file mode 100644
index 000000000..0e177217f
--- /dev/null
+++ b/graphics/berry_fix/window.pal
@@ -0,0 +1,35 @@
+JASC-PAL
+0100
+32
+0 0 0
+255 255 255
+32 32 32
+172 172 172
+230 8 8
+255 189 115
+32 156 8
+148 246 148
+49 82 205
+164 197 246
+164 213 90
+238 230 197
+148 197 213
+32 57 98
+106 148 197
+90 106 156
+255 255 255
+164 213 90
+32 32 32
+123 123 205
+255 255 255
+74 74 115
+197 197 197
+98 98 189
+106 106 197
+98 123 57
+131 131 131
+222 41 0
+189 123 41
+180 180 222
+0 0 0
+0 0 0
diff --git a/graphics/berry_fix/window.png b/graphics/berry_fix/window.png
new file mode 100644
index 000000000..5e437e727
--- /dev/null
+++ b/graphics/berry_fix/window.png
Binary files differ
diff --git a/src/trainer_tower.c b/src/trainer_tower.c
index 9d6ea8a3b..f2726d59b 100644
--- a/src/trainer_tower.c
+++ b/src/trainer_tower.c
@@ -1,8 +1,20 @@
#include "global.h"
#include "malloc.h"
#include "save.h"
+#include "event_data.h"
#include "cereader_tool.h"
+struct UnkStruct_8479D38
+{
+ u8 flags1[8];
+ u8 flags2[8];
+ u8 flags3[8];
+ u8 unk_24;
+ u8 unk_25;
+};
+
+extern const struct UnkStruct_8479D38 gUnknown_8479D38[15];
+
bool32 sub_815D7BC(void * dest, void * buffer)
{
if (TryCopySpecialSaveSection(30, buffer) != 1)
@@ -31,3 +43,24 @@ bool32 sub_815D834(void)
// Stubbed out?
return FALSE;
}
+
+void sub_815D838(void)
+{
+ u8 i, j;
+
+ for (i = 0; i < 15; i++)
+ {
+ const u8 * flags1 = gUnknown_8479D38[i].flags1;
+ const u8 * flags2 = gUnknown_8479D38[i].flags2;
+ const u8 * flags3 = gUnknown_8479D38[i].flags3;
+ for (j = 0; j < 8; j++)
+ {
+ if (flags1[j] != 0xFF)
+ FlagSet(1000 + flags1[j]);
+ if (flags2[j] != 0xFF)
+ FlagSet(1000 + flags2[j]);
+ if (flags3[j] != 0xFF)
+ FlagSet(1000 + flags3[j]);
+ }
+ }
+}