|
@@ -0,0 +1,88 @@
|
|
1
|
+#include <config.h>
|
|
2
|
+#include <pokeagb/pokeagb.h>
|
|
3
|
+#include <battlescreen/battlescreen_0.h>
|
|
4
|
+#include <battlescreen/battlescreen_1.h>
|
|
5
|
+#include <battlescreen/battlescreen_2.h>
|
|
6
|
+#include <battlescreen/battlescreen_3.h>
|
|
7
|
+#include <battlescreen/battlescreen_4.h>
|
|
8
|
+#include <battlescreen/battlescreen_5.h>
|
|
9
|
+#include <battlescreen/battlescreen_6.h>
|
|
10
|
+#include <battlescreen/battlescreen_7.h>
|
|
11
|
+#include <battlescreen/battlescreen_8.h>
|
|
12
|
+#include <battlescreen/battlescreen_9.h>
|
|
13
|
+#include <battlescreen/battlescreen_10.h>
|
|
14
|
+#include <battlescreen/battlescreen_11.h>
|
|
15
|
+#include <battlescreen/battlescreen_12.h>
|
|
16
|
+#include <battlescreen/battlescreen_13.h>
|
|
17
|
+#include <battlescreen/battlescreen_14.h>
|
|
18
|
+#include <battlescreen/battlescreen_15.h>
|
|
19
|
+#include <battlescreen/battlescreen_16.h>
|
|
20
|
+#include <battlescreen/battlescreen_17.h>
|
|
21
|
+#include <battlescreen/battlescreen_18.h>
|
|
22
|
+#include <battlescreen/battlescreen_19.h>
|
|
23
|
+#include <battlescreen/battlescreen_20.h>
|
|
24
|
+#include <battlescreen/battlescreen_21.h>
|
|
25
|
+#include <battlescreen/battlescreen_22.h>
|
|
26
|
+#include <battlescreen/battlescreen_23.h>
|
|
27
|
+#include <battlescreen/battlescreen_24.h>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+#define SIZEOF_ARR(a) (sizeof(a) / sizeof(a[0]))
|
|
31
|
+#define BATTLE_ELEMENT(n) \
|
|
32
|
+ (n > SIZEOF_ARR(battle_screen_elements) ? battle_screen_elements[0] : battle_screen_elements[n])
|
|
33
|
+#define BATTLE_ELEMENT_VAR (walkrun_state.is_surfing ? BATTLE_SEA_VAR : BATTLE_NORMAL_VAR)
|
|
34
|
+
|
|
35
|
+struct BattleScreenElements {
|
|
36
|
+ const void *gfx_bg;
|
|
37
|
+ const void *map_bg;
|
|
38
|
+ const void *gfx_grass;
|
|
39
|
+ const void *map_grass;
|
|
40
|
+ const void *palette;
|
|
41
|
+};
|
|
42
|
+
|
|
43
|
+const struct BattleScreenElements battle_screen_elements[] = {
|
|
44
|
+ {battlescreen_0Tiles, battlescreen_0Map, NULL, NULL, battlescreen_0Pal},
|
|
45
|
+ {battlescreen_1Tiles, battlescreen_1Map, NULL, NULL, battlescreen_1Pal},
|
|
46
|
+ {battlescreen_2Tiles, battlescreen_2Map, NULL, NULL, battlescreen_2Pal},
|
|
47
|
+ {battlescreen_3Tiles, battlescreen_3Map, NULL, NULL, battlescreen_3Pal},
|
|
48
|
+ {battlescreen_4Tiles, battlescreen_4Map, NULL, NULL, battlescreen_4Pal},
|
|
49
|
+ {battlescreen_5Tiles, battlescreen_5Map, NULL, NULL, battlescreen_5Pal},
|
|
50
|
+ {battlescreen_6Tiles, battlescreen_6Map, NULL, NULL, battlescreen_6Pal},
|
|
51
|
+ {battlescreen_7Tiles, battlescreen_7Map, NULL, NULL, battlescreen_7Pal},
|
|
52
|
+ {battlescreen_8Tiles, battlescreen_8Map, NULL, NULL, battlescreen_8Pal},
|
|
53
|
+ {battlescreen_9Tiles, battlescreen_9Map, NULL, NULL, battlescreen_9Pal},
|
|
54
|
+ {battlescreen_10Tiles, battlescreen_10Map, NULL, NULL, battlescreen_10Pal},
|
|
55
|
+ {battlescreen_11Tiles, battlescreen_11Map, NULL, NULL, battlescreen_11Pal},
|
|
56
|
+ {battlescreen_12Tiles, battlescreen_12Map, NULL, NULL, battlescreen_12Pal},
|
|
57
|
+ {battlescreen_13Tiles, battlescreen_13Map, NULL, NULL, battlescreen_13Pal},
|
|
58
|
+ {battlescreen_14Tiles, battlescreen_14Map, NULL, NULL, battlescreen_14Pal},
|
|
59
|
+ {battlescreen_15Tiles, battlescreen_15Map, NULL, NULL, battlescreen_15Pal},
|
|
60
|
+ {battlescreen_16Tiles, battlescreen_16Map, NULL, NULL, battlescreen_16Pal},
|
|
61
|
+ {battlescreen_17Tiles, battlescreen_17Map, NULL, NULL, battlescreen_17Pal},
|
|
62
|
+ {battlescreen_18Tiles, battlescreen_18Map, NULL, NULL, battlescreen_18Pal},
|
|
63
|
+ {battlescreen_19Tiles, battlescreen_19Map, NULL, NULL, battlescreen_19Pal},
|
|
64
|
+ {battlescreen_20Tiles, battlescreen_20Map, NULL, NULL, battlescreen_20Pal},
|
|
65
|
+ {battlescreen_21Tiles, battlescreen_21Map, NULL, NULL, battlescreen_21Pal},
|
|
66
|
+ {battlescreen_22Tiles, battlescreen_22Map, NULL, NULL, battlescreen_22Pal},
|
|
67
|
+ {battlescreen_23Tiles, battlescreen_23Map, NULL, NULL, battlescreen_23Pal},
|
|
68
|
+ {battlescreen_24Tiles, battlescreen_24Map, NULL, NULL, battlescreen_24Pal},
|
|
69
|
+};
|
|
70
|
+
|
|
71
|
+void battle_load_background(u16 idx) {
|
|
72
|
+ (void)idx;
|
|
73
|
+
|
|
74
|
+ struct BattleScreenElements element = BATTLE_ELEMENT(var_load(BATTLE_ELEMENT_VAR));
|
|
75
|
+ lz77UnCompVram(element.gfx_bg, (void *)0x06008000);
|
|
76
|
+ lz77UnCompVram(element.map_bg, (void *)0x0600D000);
|
|
77
|
+ gpu_pal_apply_compressed(element.palette, 32, 96);
|
|
78
|
+}
|
|
79
|
+
|
|
80
|
+void battle_load_decals(u16 idx) {
|
|
81
|
+ (void)idx;
|
|
82
|
+
|
|
83
|
+ struct BattleScreenElements element = BATTLE_ELEMENT(var_load(BATTLE_ELEMENT_VAR));
|
|
84
|
+ if (element.gfx_grass == NULL | element.map_grass == NULL)
|
|
85
|
+ return;
|
|
86
|
+ lz77UnCompVram(element.gfx_grass, (void *)0x06004000);
|
|
87
|
+ lz77UnCompVram(element.map_grass, (void *)0x0600E000);
|
|
88
|
+}
|