DragonflySotS 7 jaren geleden
bovenliggende
commit
36c843b922

+ 1
- 1
battle_engine

@@ -1 +1 @@
1
-Subproject commit a201b518834f0208efdb82ac95b08675f5279950
1
+Subproject commit 4a4fb7ac2ac3def1d4270796bdd2c04e8231d382

+ 1
- 1
g3headers

@@ -1 +1 @@
1
-Subproject commit bcc741a7ec06fc8a1b7c0e0b93a7f94f318a658e
1
+Subproject commit 21b52cecff9250d0bdaf18660b4bea40606a675e

+ 3
- 0
main.asm Bestand weergeven

@@ -31,13 +31,16 @@
31 31
 .include "patches/pokemon_data/pokedex_entries.asm"
32 32
 .include "patches/pokemon_data/pokemon_names.asm"
33 33
 .include "patches/pokemon_data/limits.asm"
34
+
34 35
 .include "patches/pokemon_data/pokemon_stats.asm"
35 36
 .include "patches/pokemon_data/moveset_table.asm"
36 37
 .include "patches/pokemon_data/pokemon_back_sprites.asm"
37 38
 .include "patches/pokemon_data/pokemon_front_sprites.asm"
38 39
 .include "patches/pokemon_data/pokemon_normal_pal.asm"
39 40
 .include "patches/pokemon_data/pokemon_shiny_pal.asm"
41
+
40 42
 .include "patches/pokemon_data/pokemon_icons.asm"
43
+
41 44
 .include "patches/pokemon_data/pokemon_habitats.asm"
42 45
 .include "patches/pokemon_data/pokemon_evolution.asm"
43 46
 

+ 19
- 0
patches/graphics/char.asm Bestand weergeven

@@ -1,14 +1,33 @@
1 1
 .org 0x08234718
2 2
 .word hero_backspriteTiles
3
+.word 0x800
4
+.word hero_backspriteTiles + 0x800
5
+.word 0x800
6
+.word hero_backspriteTiles + 0x800*2
7
+.word 0x800
8
+.word hero_backspriteTiles + 0x800*3
9
+.word 0x800
10
+.word hero_backspriteTiles + 0x800*4
11
+.word 0x800
3 12
 
4 13
 .org 0x08239FA4
5 14
 .word hero_backspriteTiles
15
+.word 0x800
6 16
 
7 17
 .org 0x08239FD4
8 18
 .word hero_backspritePal
9 19
 
10 20
 .org 0x08234740
11 21
 .word heroine_backspriteTiles
22
+.word 0x800
23
+.word heroine_backspriteTiles + 0x800
24
+.word 0x800
25
+.word heroine_backspriteTiles + 0x800*2
26
+.word 0x800
27
+.word heroine_backspriteTiles + 0x800*3
28
+.word 0x800
29
+.word heroine_backspriteTiles + 0x800*4
30
+.word 0x800
12 31
 
13 32
 .org 0x08239FAC
14 33
 .word heroine_backspriteTiles

+ 3
- 1
patches/pokemon_data/pokemon_icons.asm Bestand weergeven

@@ -11,7 +11,9 @@
11 11
 .word icon_palette_table
12 12
 
13 13
 .org 0x08091390
14
-.word icon_palette_table
14
+//.word icon_palette_table
15
+/* NOTE: this is referencing the icon template, overriding this will break stuff, for now we do not need to modify the template */
16
+
15 17
 
16 18
 .org 0x08096EC0
17 19
 .word icon_palette_table

+ 66
- 57
src/battle_engine/battle_help.c Bestand weergeven

@@ -29,44 +29,45 @@
29 29
 
30 30
 /* === INCLUDE === */
31 31
 
32
+#include <battle_common.h>
33
+#include <battle_custom_structs.h>
32 34
 #include <battle_help.h>
33 35
 #include <battle_locations.h>
34
-#include <battle_custom_structs.h>
35 36
 #include <game_engine.h>
36
-#include <pkmn_types.h>
37 37
 #include <pkmn_abilities.h>
38
+#include <pkmn_attributes.h>
38 39
 #include <pkmn_item_effects.h>
39 40
 #include <pkmn_items.h>
40
-#include <pkmn_attributes.h>
41
-#include <battle_common.h>
41
+#include <pkmn_types.h>
42 42
 
43 43
 /* === STATICS === */
44 44
 
45 45
 /* from kds emerald battle engine upgrade */
46 46
 u8 type_effectiveness_table[TYPE_FAIRY - 0x4][TYPE_FAIRY - 0x4] = {
47
-    {10, 10, 10, 10, 10, 05, 10, 00, 05, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, //normal
48
-    {20, 10, 05, 05, 10, 20, 05, 00, 20, 10, 10, 10, 10, 10, 05, 20, 10, 20, 05}, //fight
49
-    {10, 20, 10, 10, 10, 05, 20, 10, 05, 10, 10, 10, 20, 05, 10, 10, 10, 10, 10}, //flying
50
-    {10, 10, 10, 05, 05, 05, 10, 05, 00, 10, 10, 10, 20, 10, 10, 10, 10, 10, 20}, //poison
51
-    {10, 10, 00, 20, 10, 20, 05, 10, 20, 10, 20, 10, 05, 20, 10, 10, 10, 10, 10}, //ground
52
-    {10, 05, 20, 10, 05, 10, 20, 10, 05, 10, 20, 10, 10, 10, 10, 20, 10, 10, 10}, //rock
53
-    {10, 05, 05, 05, 10, 10, 10, 05, 05, 10, 05, 10, 20, 10, 20, 10, 10, 20, 05}, //bug
54
-    {00, 10, 10, 10, 10, 10, 10, 20, 10, 10, 10, 10, 10, 10, 20, 10, 10, 05, 10}, //ghost
55
-    {10, 10, 10, 10, 10, 20, 10, 10, 05, 10, 05, 05, 10, 05, 10, 20, 10, 10, 20}, //steel
56
-    {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, //egg
57
-    {10, 10, 10, 10, 10, 05, 20, 10, 20, 10, 05, 05, 20, 10, 10, 20, 05, 10, 10}, //fire
58
-    {10, 10, 10, 10, 20, 20, 10, 10, 10, 10, 20, 05, 05, 10, 10, 10, 05, 10, 10}, //water
59
-    {10, 10, 05, 05, 20, 20, 05, 10, 05, 10, 05, 20, 05, 10, 10, 10, 05, 10, 10}, //grass
60
-    {10, 10, 20, 10, 00, 10, 10, 10, 10, 10, 10, 20, 05, 05, 10, 10, 05, 10, 10}, //electric
61
-    {10, 20, 10, 20, 10, 10, 10, 10, 05, 10, 10, 10, 10, 10, 05, 10, 10, 00, 10}, //psychic
62
-    {10, 10, 20, 10, 20, 10, 10, 10, 05, 10, 05, 05, 20, 10, 10, 05, 20, 10, 10}, //ice
63
-    {10, 10, 10, 10, 10, 10, 10, 10, 05, 10, 10, 10, 10, 10, 10, 10, 20, 10, 00}, //dragon
64
-    {10, 05, 10, 10, 10, 10, 10, 20, 10, 10, 10, 10, 10, 10, 20, 10, 10, 05, 05}, //dark
65
-    {10, 20, 10, 05, 10, 10, 10, 10, 05, 10, 05, 10, 10, 10, 10, 10, 20, 20, 10} //fairy
47
+    {10, 10, 10, 10, 10, 05, 10, 00, 05, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, // normal
48
+    {20, 10, 05, 05, 10, 20, 05, 00, 20, 10, 10, 10, 10, 10, 05, 20, 10, 20, 05}, // fight
49
+    {10, 20, 10, 10, 10, 05, 20, 10, 05, 10, 10, 10, 20, 05, 10, 10, 10, 10, 10}, // flying
50
+    {10, 10, 10, 05, 05, 05, 10, 05, 00, 10, 10, 10, 20, 10, 10, 10, 10, 10, 20}, // poison
51
+    {10, 10, 00, 20, 10, 20, 05, 10, 20, 10, 20, 10, 05, 20, 10, 10, 10, 10, 10}, // ground
52
+    {10, 05, 20, 10, 05, 10, 20, 10, 05, 10, 20, 10, 10, 10, 10, 20, 10, 10, 10}, // rock
53
+    {10, 05, 05, 05, 10, 10, 10, 05, 05, 10, 05, 10, 20, 10, 20, 10, 10, 20, 05}, // bug
54
+    {00, 10, 10, 10, 10, 10, 10, 20, 10, 10, 10, 10, 10, 10, 20, 10, 10, 05, 10}, // ghost
55
+    {10, 10, 10, 10, 10, 20, 10, 10, 05, 10, 05, 05, 10, 05, 10, 20, 10, 10, 20}, // steel
56
+    {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, // egg
57
+    {10, 10, 10, 10, 10, 05, 20, 10, 20, 10, 05, 05, 20, 10, 10, 20, 05, 10, 10}, // fire
58
+    {10, 10, 10, 10, 20, 20, 10, 10, 10, 10, 20, 05, 05, 10, 10, 10, 05, 10, 10}, // water
59
+    {10, 10, 05, 05, 20, 20, 05, 10, 05, 10, 05, 20, 05, 10, 10, 10, 05, 10, 10}, // grass
60
+    {10, 10, 20, 10, 00, 10, 10, 10, 10, 10, 10, 20, 05, 05, 10, 10, 05, 10, 10}, // electric
61
+    {10, 20, 10, 20, 10, 10, 10, 10, 05, 10, 10, 10, 10, 10, 05, 10, 10, 00, 10}, // psychic
62
+    {10, 10, 20, 10, 20, 10, 10, 10, 05, 10, 05, 05, 20, 10, 10, 05, 20, 10, 10}, // ice
63
+    {10, 10, 10, 10, 10, 10, 10, 10, 05, 10, 10, 10, 10, 10, 10, 10, 20, 10, 00}, // dragon
64
+    {10, 05, 10, 10, 10, 10, 10, 20, 10, 10, 10, 10, 10, 10, 20, 10, 10, 05, 05}, // dark
65
+    {10, 20, 10, 05, 10, 10, 10, 10, 05, 10, 05, 10, 10, 10, 10, 10, 20, 20, 10}  // fairy
66 66
 };
67 67
 
68 68
 /* === IMPLEMENTATIONS === */
69
-u16 battle_damage_type_effectiveness_update(u8 attacking_type, u8 defending_type, u8 atk_bank, u8 def_bank, u16 chained_effect, u8 airstatus) {
69
+u16 battle_damage_type_effectiveness_update(u8 attacking_type, u8 defending_type, u8 atk_bank, u8 def_bank,
70
+                                            u16 chained_effect, u8 airstatus) {
70 71
     u8 effect, atype = attacking_type, dtype = defending_type;
71 72
     if (!chained_effect || atype == TYPE_EGG || dtype == TYPE_EGG)
72 73
         return chained_effect;
@@ -86,24 +87,26 @@ u16 battle_damage_type_effectiveness_update(u8 attacking_type, u8 defending_type
86 87
         }
87 88
     }
88 89
     /* handle normal / fighting on ghost */
89
-    if ((((attacking_type == TYPE_NORMAL || attacking_type == TYPE_FIGHTING) && defending_type == TYPE_GHOST && ((battle_participants[def_bank].status2.foresight))) || battle_participants[atk_bank].ability_id == ABILITY_SCRAPPY) && effect == 0) {
90
+    if ((((attacking_type == TYPE_NORMAL || attacking_type == TYPE_FIGHTING) && defending_type == TYPE_GHOST &&
91
+          ((battle_participants[def_bank].status2.foresight))) ||
92
+         battle_participants[atk_bank].ability_id == ABILITY_SCRAPPY) &&
93
+        effect == 0) {
90 94
         effect = 10;
91 95
     }
92 96
     /* handle other effectiveness changers here */
93 97
 
94 98
     switch (effect) {
95
-        case 0:
96
-            chained_effect = 0;
97
-            break;
98
-        case 5:
99
-            chained_effect = chained_effect >> 1;
100
-            break;
101
-        case 20:
102
-            chained_effect = chained_effect << 1;
103
-            break;
99
+    case 0:
100
+        chained_effect = 0;
101
+        break;
102
+    case 5:
103
+        chained_effect = chained_effect >> 1;
104
+        break;
105
+    case 20:
106
+        chained_effect = chained_effect << 1;
107
+        break;
104 108
     }
105 109
     return chained_effect;
106
-
107 110
 }
108 111
 
109 112
 u16 battle_apply_type_effectiveness(u16 chained_effect, u8 move_type, u8 target_bank, u8 atk_bank, u8 airstatus) {
@@ -112,18 +115,21 @@ u16 battle_apply_type_effectiveness(u16 chained_effect, u8 move_type, u8 target_
112 115
     /* set different types */
113 116
     if (defender_type2 == defender_type1)
114 117
         defender_type2 = TYPE_EGG;
115
-    chained_effect = battle_damage_type_effectiveness_update(move_type, defender_type1, atk_bank, target_bank, chained_effect, airstatus);
116
-    chained_effect = battle_damage_type_effectiveness_update(move_type, defender_type2, atk_bank, target_bank, chained_effect, airstatus);
118
+    chained_effect = battle_damage_type_effectiveness_update(move_type, defender_type1, atk_bank, target_bank,
119
+                                                             chained_effect, airstatus);
120
+    chained_effect = battle_damage_type_effectiveness_update(move_type, defender_type2, atk_bank, target_bank,
121
+                                                             chained_effect, airstatus);
117 122
     return chained_effect;
118 123
 }
119 124
 
120
-u16 battle_type_effectiveness_calc(u16 move, u8 move_type, u8 atk_bank, u8 def_bank, u8 effects_handling_and_recording) {
125
+u16 battle_type_effectiveness_calc(u16 move, u8 move_type, u8 atk_bank, u8 def_bank,
126
+                                   u8 effects_handling_and_recording) {
121 127
     u16 chained_effect = 64;
122
-    //TODO: double_type moves
123
-    //TODO: get air status
128
+    // TODO: double_type moves
129
+    // TODO: get air status
124 130
     chained_effect = battle_apply_type_effectiveness(chained_effect, move_type, def_bank, atk_bank, 2);
125
-    //TODO: save into structs
126
-    //TODO: effect_handling_and_recording
131
+    // TODO: save into structs
132
+    // TODO: effect_handling_and_recording
127 133
     return chained_effect;
128 134
 }
129 135
 
@@ -133,7 +139,8 @@ u8 battle_bank_has_type(u8 bank, u8 type) {
133 139
 
134 140
 u8 battle_item_get_effect(u8 bank, u8 check_negating_effects) {
135 141
     if (check_negating_effects) {
136
-        if (battle_participants[bank].ability_id == ABILITY_KLUTZ || custom_battle_elements.ptr->bank_affecting[bank].embargo)
142
+        if (battle_participants[bank].ability_id == ABILITY_KLUTZ ||
143
+            custom_battle_elements.ptr->bank_affecting[bank].embargo)
137 144
             return ITEM_EFFECT_NOEFFECT;
138 145
     }
139 146
     if (battle_participants[bank].held_item == ITEM_ENIGMABERRY) {
@@ -143,37 +150,39 @@ u8 battle_item_get_effect(u8 bank, u8 check_negating_effects) {
143 150
     }
144 151
 }
145 152
 
146
-u8 battle_bank_is_poison_resistant(u8 bank, u8 self_inflicted) { //0 == can poison
147
-    //1 == is already poisoned
148
-    //2 == has other major condition
149
-    //3 == type doesn't allow it
150
-    //4 == ability doesn't allow it
151
-    //5 == safeguard protection
152
-    //8 == misty terrain doesn't allow it !TODO!
153
+u8 battle_bank_is_poison_resistant(u8 bank, u8 self_inflicted) { // 0 == can poison
154
+    // 1 == is already poisoned
155
+    // 2 == has other major condition
156
+    // 3 == type doesn't allow it
157
+    // 4 == ability doesn't allow it
158
+    // 5 == safeguard protection
159
+    // 8 == misty terrain doesn't allow it !TODO!
153 160
     if (battle_participants[bank].status.flags.poison || battle_participants[bank].status.flags.toxic_poison)
154 161
         return 1;
155 162
     if (battle_participants[bank].status.int_status)
156 163
         return 2;
157 164
     if (battle_bank_has_type(bank, TYPE_POISON) || battle_bank_has_type(bank, TYPE_STEEL))
158 165
         return 3;
159
-    if (((battle_participants[bank].ability_id == ABILITY_IMMUNITY || (battle_participants[bank].ability_id == ABILITY_LEAF_GUARD && (battle_weather.flags.sun || battle_weather.flags.permament_sun || battle_weather.flags.harsh_sun)))))
166
+    if (((battle_participants[bank].ability_id == ABILITY_IMMUNITY ||
167
+          (battle_participants[bank].ability_id == ABILITY_LEAF_GUARD &&
168
+           (battle_weather.flags.sun || battle_weather.flags.permament_sun || battle_weather.flags.harsh_sun)))))
160 169
         return 4;
161 170
     if (side_affecting_halfword[get_side_from_bank(bank)].safeguard_on && !self_inflicted)
162 171
         return 5;
163 172
     return 0;
164 173
 }
165 174
 
166
-u8 battle_count_party_pokemon(u8 bank)
167
-{
168
-    struct pokemon* poke;
175
+u8 battle_count_party_pokemon(u8 bank) {
176
+    struct pokemon *poke;
169 177
     if (get_side_from_bank(bank))
170 178
         poke = &party_opponent[0];
171 179
     else
172 180
         poke = &party_player[0];
173 181
     u8 usable_pokes = 0;
174
-    for (u8 i = 0; i < 6; i ++)
175
-    {
176
-        if (pokemon_get_attribute(&poke[i], ATTR_CURRENT_HP, 0) != 0 && pokemon_get_attribute(&poke[i], ATTR_IS_EGG, 0) != 1 && pokemon_get_attribute(&poke[i], ATTR_SPECIES, 0) != 0)
182
+    for (u8 i = 0; i < 6; i++) {
183
+        if (pokemon_get_attribute(&poke[i], ATTR_CURRENT_HP, 0) != 0 &&
184
+            pokemon_get_attribute(&poke[i], ATTR_IS_EGG, 0) != 1 &&
185
+            pokemon_get_attribute(&poke[i], ATTR_SPECIES, 0) != 0)
177 186
             usable_pokes++;
178 187
     }
179 188
     return usable_pokes;

+ 10
- 11
src/battle_engine/battle_load_elements/battle_load_elements.c Bestand weergeven

@@ -1,15 +1,5 @@
1
-#include <config.h>
2
-#include <pokeagb/pokeagb.h>
3 1
 #include <battlescreen/battlescreen_0.h>
4 2
 #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 3
 #include <battlescreen/battlescreen_10.h>
14 4
 #include <battlescreen/battlescreen_11.h>
15 5
 #include <battlescreen/battlescreen_12.h>
@@ -20,12 +10,21 @@
20 10
 #include <battlescreen/battlescreen_17.h>
21 11
 #include <battlescreen/battlescreen_18.h>
22 12
 #include <battlescreen/battlescreen_19.h>
13
+#include <battlescreen/battlescreen_2.h>
23 14
 #include <battlescreen/battlescreen_20.h>
24 15
 #include <battlescreen/battlescreen_21.h>
25 16
 #include <battlescreen/battlescreen_22.h>
26 17
 #include <battlescreen/battlescreen_23.h>
27 18
 #include <battlescreen/battlescreen_24.h>
28
-
19
+#include <battlescreen/battlescreen_3.h>
20
+#include <battlescreen/battlescreen_4.h>
21
+#include <battlescreen/battlescreen_5.h>
22
+#include <battlescreen/battlescreen_6.h>
23
+#include <battlescreen/battlescreen_7.h>
24
+#include <battlescreen/battlescreen_8.h>
25
+#include <battlescreen/battlescreen_9.h>
26
+#include <config.h>
27
+#include <pokeagb/pokeagb.h>
29 28
 
30 29
 #define SIZEOF_ARR(a) (sizeof(a) / sizeof(a[0]))
31 30
 #define BATTLE_ELEMENT(n)                                                                                              \

+ 39
- 49
src/debug/debug.c Bestand weergeven

@@ -29,28 +29,27 @@
29 29
 
30 30
 /* === INCLUDE === */
31 31
 
32
-#include <types.h>
33
-#include <callback.h>
34
-#include <lcd.h>
35
-#include <debug.h>
36
-#include <memory.h>
37 32
 #include <assets/ascii.h>
38 33
 #include <battle_test.h>
39
-#include <math.h>
34
+#include <callback.h>
35
+#include <debug.h>
40 36
 #include <fade.h>
37
+#include <lcd.h>
38
+#include <math.h>
39
+#include <memory.h>
40
+#include <types.h>
41 41
 
42 42
 /* === STRUCTURES === */
43 43
 
44
-struct assert_memory
45
-{
46
-    char* file;
44
+struct assert_memory {
45
+    char *file;
47 46
     int line;
48
-    char* expression;
47
+    char *expression;
49 48
 };
50 49
 
51 50
 /* === STATICS === */
52
-struct assert_memory* assert_global = (struct assert_memory*)0x0203FEC4;
53
-static struct print_engine* print_memory = (struct print_engine*)(0x0203FFF0);
51
+struct assert_memory *assert_global = (struct assert_memory *)0x0203FEC4;
52
+static struct print_engine *print_memory = (struct print_engine *)(0x0203FFF0);
54 53
 
55 54
 /* === PROTOTYPES === */
56 55
 
@@ -59,7 +58,7 @@ static struct print_engine* print_memory = (struct print_engine*)(0x0203FFF0);
59 58
  * @param i integer
60 59
  * @param ref buffer to output to
61 60
  */
62
-void debug_int_to_char(u32 i, char* ref);
61
+void debug_int_to_char(u32 i, char *ref);
63 62
 
64 63
 /**
65 64
  * @get length of integer
@@ -111,7 +110,7 @@ void debug_print_char(u16 line, u16 row, char character, u8 color);
111 110
  * @param color color to print in
112 111
  * @param pBuf string buffer to print (null terminated)
113 112
  */
114
-void debug_print_string(u16 line, u16 row, u8 color, char* pBuf);
113
+void debug_print_string(u16 line, u16 row, u8 color, char *pBuf);
115 114
 
116 115
 /**
117 116
  * @brief build power
@@ -129,7 +128,7 @@ void debug_init_stage_two();
129 128
  * @param color color to set to
130 129
  */
131 130
 void debug_set_bg(u16 color) {
132
-    u16* bgc = (u16*) 0x020375f8;
131
+    u16 *bgc = (u16 *)0x020375f8;
133 132
     *bgc = color;
134 133
     return;
135 134
 }
@@ -137,20 +136,15 @@ void debug_set_bg(u16 color) {
137 136
 /* === STATIC STRUCTURES === */
138 137
 
139 138
 static struct bg_config debug_bg_config[4] = {
140
-    {0, 0, 0x19, 0, 0, 0},
141
-    {1, 1, 0x1A, 0, 0, 1},
142
-    {2, 2, 0x1B, 0, 0, 2},
143
-    {3, 3, 0x1C, 0, 0, 3}
144
-};
139
+    {0, 0, 0x19, 0, 0, 0}, {1, 1, 0x1A, 0, 0, 1}, {2, 2, 0x1B, 0, 0, 2}, {3, 3, 0x1C, 0, 0, 3}};
145 140
 
146 141
 /* === IMPLEMENTATIONS === */
147 142
 
148
-void as_assert(char* expression, char* file, int line)
149
-{
143
+void as_assert(char *expression, char *file, int line) {
150 144
     assert_global->file = file;
151 145
     assert_global->line = line;
152 146
     assert_global->expression = expression;
153
-    
147
+
154 148
     set_callback2(debug_assert_scene);
155 149
     vblank_handler_set(debug_update);
156 150
     superstate.multi_purpose_state_tracker = 0;
@@ -174,7 +168,7 @@ void debug_some_test() {
174 168
     set_callback2(debug_scene);
175 169
     vblank_handler_set(debug_update);
176 170
     superstate.multi_purpose_state_tracker = 0;
177
-    
171
+
178 172
     return;
179 173
 }
180 174
 
@@ -190,28 +184,26 @@ void debug_reset_scrolling() {
190 184
     return;
191 185
 }
192 186
 
193
-void debug_init_unit_test() {
194
-    test_speed();
195
-}
187
+void debug_init_unit_test() { test_speed(); }
196 188
 
197
-void debug_print_string(u16 line, u16 row, u8 color, char* pBuf) {
189
+void debug_print_string(u16 line, u16 row, u8 color, char *pBuf) {
198 190
     while (*pBuf) {
199 191
         debug_print_char(line, row++, *pBuf++, color);
200 192
     }
201 193
     return;
202 194
 }
203 195
 
204
-void debug_print(char* str) {
196
+void debug_print(char *str) {
205 197
     while (*str) {
206
-        if(print_memory->row > 29)
207
-        {
198
+        if (print_memory->row > 29) {
208 199
             print_memory->line++;
209 200
             print_memory->row = 0;
210 201
         }
211 202
         if (*str == '\n') {
212 203
             print_memory->line++;
213 204
             print_memory->row = 0;
214
-        } if (*str == '\xFE') {
205
+        }
206
+        if (*str == '\xFE') {
215 207
             str++;
216 208
             u8 c = *str;
217 209
             if (c > 2)
@@ -226,17 +218,17 @@ void debug_print(char* str) {
226 218
     return;
227 219
 }
228 220
 
229
-void debug_printf(char* str, int arg) {
221
+void debug_printf(char *str, int arg) {
230 222
     while (*str) {
231
-        if(print_memory->row > 29)
232
-        {
223
+        if (print_memory->row > 29) {
233 224
             print_memory->line++;
234 225
             print_memory->row = 0;
235 226
         }
236 227
         if (*str == '\n') {
237 228
             print_memory->line++;
238 229
             print_memory->row = 0;
239
-        } if (*str == '\xFE') {
230
+        }
231
+        if (*str == '\xFE') {
240 232
             str++;
241 233
             u8 c = *str;
242 234
             if (c > 2)
@@ -254,7 +246,7 @@ void debug_printf(char* str, int arg) {
254 246
                 debug_int_to_char(arg, temp);
255 247
                 debug_print(temp);
256 248
             } else if (*str == 'c') {
257
-                char print_char = (char) (arg);
249
+                char print_char = (char)(arg);
258 250
                 debug_print_char(print_memory->line, print_memory->row, print_char, print_memory->color);
259 251
                 print_memory->row++;
260 252
             }
@@ -267,7 +259,7 @@ void debug_printf(char* str, int arg) {
267 259
 }
268 260
 
269 261
 void debug_clean() {
270
-    memset((void*) 0x0600C800, 0, 0x800);
262
+    memset((void *)0x0600C800, 0, 0x800);
271 263
     print_memory->row = 0;
272 264
     print_memory->line = 0;
273 265
     print_memory->color = 0;
@@ -275,14 +267,13 @@ void debug_clean() {
275 267
 }
276 268
 
277 269
 void debug_wait_for_btn(u16 field) {
278
-    volatile u16* control_io = (volatile u16*) (0x04000130);
270
+    volatile u16 *control_io = (volatile u16 *)(0x04000130);
279 271
     while (*control_io & field) {
280 272
     }
281 273
     return;
282 274
 }
283 275
 
284
-void debug_init_stage_one()
285
-{
276
+void debug_init_stage_one() {
286 277
     print_memory->row = 0;
287 278
     print_memory->line = 0;
288 279
     print_memory->color = 0;
@@ -301,14 +292,13 @@ void debug_init_stage_one()
301 292
     gpu_sync_bg_visibility_and_mode();
302 293
     debug_reset_scrolling();
303 294
     obj_delete_all();
304
-    memset((void*) 0x06000000, 0, 0x17fe0);
305
-    memset((void*) 0x020375F8, 0, 0x400);
295
+    memset((void *)0x06000000, 0, 0x17fe0);
296
+    memset((void *)0x020375F8, 0, 0x400);
306 297
 }
307 298
 
308
-void debug_init_stage_two()
309
-{
310
-    vram_decompress((void*) asciiTiles, (void*) 0x06000000);
311
-    memcpy((void*) 0x020375F8, (void*) asciiPal, 0x60);
299
+void debug_init_stage_two() {
300
+    vram_decompress((void *)asciiTiles, (void *)0x06000000);
301
+    memcpy((void *)0x020375F8, (void *)asciiPal, 0x60);
312 302
     debug_set_bg(0x0000);
313 303
 }
314 304
 
@@ -338,7 +328,7 @@ void debug_print_char(u16 line, u16 row, char character, u8 color) {
338 328
     union t_map_entry map_entry;
339 329
     map_entry.entry.tile = char_to_byte(character);
340 330
     map_entry.entry.pal = color;
341
-    u16* ptr = (u16*) (0x0600c800 + (position * 2));
331
+    u16 *ptr = (u16 *)(0x0600c800 + (position * 2));
342 332
     *ptr = map_entry.short_map;
343 333
     return;
344 334
 }
@@ -359,7 +349,7 @@ void debug_update() {
359 349
     obj_gpu_sprites_upload();
360 350
 }
361 351
 
362
-void debug_int_to_char(u32 i, char* ref) {
352
+void debug_int_to_char(u32 i, char *ref) {
363 353
     if (i == 0) {
364 354
         ref[0] = '0';
365 355
         return;