Browse Source

more movement execution commands

SBird1337 7 years ago
parent
commit
0f65883214

+ 1
- 1
g3headers

@@ -1 +1 @@
1
-Subproject commit 3934c9b2ba672863275d517403a558278e549786
1
+Subproject commit 7522abc1b9b557bd8a2ac643ac44adefa4eb28a2

+ 1
- 1
makefile View File

@@ -29,7 +29,7 @@ CHARMAP := charmap.txt
29 29
 
30 30
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0 -DLAN_DE
31 31
 ASFLAGS   := -mthumb
32
-CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fno-inline -fdiagnostics-show-option -fdiagnostics-color -mlong-calls -march=armv4t -Og -std=c11 -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color $(DEFINES)
32
+CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fdiagnostics-show-option -mlong-calls -march=armv4t -Og -std=c11 -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color $(DEFINES)
33 33
 GRITFLAGS := -ftc -fa
34 34
 LDFLAGS   := -z muldefs
35 35
 BLDPATH   := object

+ 9
- 1
patches/overworlds/overworld.asm View File

@@ -102,4 +102,12 @@ strb r0, [r4, #0x1A]
102 102
     .pool
103 103
 
104 104
 .org 0x08083484
105
-    .word oe_effect_table
105
+    .word oe_effect_table
106
+
107
+.org 0x08064540
108
+    .word movement_animations
109
+
110
+.org 0x08064584
111
+    .word movement_animations
112
+.org 0x080645B4
113
+    .word movement_animations

+ 252
- 0
src/overworld/movement_execution/movement_execution.c View File

@@ -0,0 +1,252 @@
1
+#include <pokeagb/pokeagb.h>
2
+
3
+typedef bool (*MovementCallback)(struct NpcState *npc, struct Object *obj);
4
+
5
+#define an_stop ((MovementCallback)0x08067935)
6
+
7
+bool movement_frame_set_general(struct NpcState *npc, struct Object *obj, u8 frame) {
8
+    obj->anim_delay |= 0x40;
9
+    obj->priv[2] = 1;
10
+    npc_set_direction(npc, 1);
11
+    npc_coords_shift_still(npc);
12
+    obj_npc_animation_step(npc, obj, frame);
13
+    return true;
14
+}
15
+
16
+bool an_fs_zero(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 0); }
17
+bool an_fs_one(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 1); }
18
+bool an_fs_two(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 2); }
19
+bool an_fs_three(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 3); }
20
+bool an_fs_four(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 4); }
21
+bool an_fs_five(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 5); }
22
+bool an_fs_six(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 6); }
23
+bool an_fs_seven(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 7); }
24
+bool an_fs_eight(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 8); }
25
+bool an_fs_nine(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 9); }
26
+bool an_fs_ten(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 10); }
27
+bool an_fs_eleven(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 11); }
28
+bool an_fs_twelve(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 12); }
29
+bool an_fs_thirteen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 13); }
30
+bool an_fs_fourteen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 14); }
31
+bool an_fs_fifteen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 15); }
32
+bool an_fs_sixteen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 16); }
33
+bool an_fs_seventeen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 17); }
34
+bool an_fs_eighteen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 18); }
35
+bool an_fs_nineteen(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 19); }
36
+bool an_fs_twenty(struct NpcState *npc, struct Object *obj) { return movement_frame_set_general(npc, obj, 20); }
37
+
38
+const MovementCallback mv_set_frame_zero[] = {an_fs_zero, an_stop};
39
+const MovementCallback mv_set_frame_one[] = {an_fs_one, an_stop};
40
+const MovementCallback mv_set_frame_two[] = {an_fs_two, an_stop};
41
+const MovementCallback mv_set_frame_three[] = {an_fs_three, an_stop};
42
+const MovementCallback mv_set_frame_four[] = {an_fs_four, an_stop};
43
+const MovementCallback mv_set_frame_five[] = {an_fs_five, an_stop};
44
+const MovementCallback mv_set_frame_six[] = {an_fs_six, an_stop};
45
+const MovementCallback mv_set_frame_seven[] = {an_fs_seven, an_stop};
46
+const MovementCallback mv_set_frame_eight[] = {an_fs_eight, an_stop};
47
+const MovementCallback mv_set_frame_nine[] = {an_fs_nine, an_stop};
48
+const MovementCallback mv_set_frame_ten[] = {an_fs_ten, an_stop};
49
+const MovementCallback mv_set_frame_eleven[] = {an_fs_eleven, an_stop};
50
+const MovementCallback mv_set_frame_twelve[] = {an_fs_twelve, an_stop};
51
+const MovementCallback mv_set_frame_thirteen[] = {an_fs_thirteen, an_stop};
52
+const MovementCallback mv_set_frame_fourteen[] = {an_fs_fourteen, an_stop};
53
+const MovementCallback mv_set_frame_fifteen[] = {an_fs_fifteen, an_stop};
54
+const MovementCallback mv_set_frame_sixteen[] = {an_fs_sixteen, an_stop};
55
+const MovementCallback mv_set_frame_seventeen[] = {an_fs_seventeen, an_stop};
56
+const MovementCallback mv_set_frame_eighteen[] = {an_fs_eighteen, an_stop};
57
+const MovementCallback mv_set_frame_nineteen[] = {an_fs_nineteen, an_stop};
58
+const MovementCallback mv_set_frame_twenty[] = {an_fs_twenty, an_stop};
59
+
60
+const MovementCallback *movement_animations[] = {
61
+    (MovementCallback *)0x083A6864,
62
+    (MovementCallback *)0x083A686C,
63
+    (MovementCallback *)0x083A6874,
64
+    (MovementCallback *)0x083A687C,
65
+    (MovementCallback *)0x083A6A30,
66
+    (MovementCallback *)0x083A6A38,
67
+    (MovementCallback *)0x083A6A40,
68
+    (MovementCallback *)0x083A6A48,
69
+    (MovementCallback *)0x083A68C8,
70
+    (MovementCallback *)0x083A68D4,
71
+    (MovementCallback *)0x083A68E0,
72
+    (MovementCallback *)0x083A68EC,
73
+    (MovementCallback *)0x083A6904,
74
+    (MovementCallback *)0x083A68F8,
75
+    (MovementCallback *)0x083A6910,
76
+    (MovementCallback *)0x083A691C,
77
+    (MovementCallback *)0x083A6928,
78
+    (MovementCallback *)0x083A6934,
79
+    (MovementCallback *)0x083A6940,
80
+    (MovementCallback *)0x083A694C,
81
+    (MovementCallback *)0x083A6964,
82
+    (MovementCallback *)0x083A6970,
83
+    (MovementCallback *)0x083A697C,
84
+    (MovementCallback *)0x083A6988,
85
+    (MovementCallback *)0x083A6994,
86
+    (MovementCallback *)0x083A69A0,
87
+    (MovementCallback *)0x083A69AC,
88
+    (MovementCallback *)0x083A69B8,
89
+    (MovementCallback *)0x083A69C4,
90
+    (MovementCallback *)0x083A69D0,
91
+    (MovementCallback *)0x083A69DC,
92
+    (MovementCallback *)0x083A69E8,
93
+    (MovementCallback *)0x083A69F4,
94
+    (MovementCallback *)0x083A6A50,
95
+    (MovementCallback *)0x083A6A5C,
96
+    (MovementCallback *)0x083A6A68,
97
+    (MovementCallback *)0x083A6A74,
98
+    (MovementCallback *)0x083A6A80,
99
+    (MovementCallback *)0x083A6A8C,
100
+    (MovementCallback *)0x083A6A98,
101
+    (MovementCallback *)0x083A6AA4,
102
+    (MovementCallback *)0x083A6AB0,
103
+    (MovementCallback *)0x083A6ABC,
104
+    (MovementCallback *)0x083A6AC8,
105
+    (MovementCallback *)0x083A6AD4,
106
+    (MovementCallback *)0x083A6AE0,
107
+    (MovementCallback *)0x083A6AEC,
108
+    (MovementCallback *)0x083A6AF8,
109
+    (MovementCallback *)0x083A6B04,
110
+    (MovementCallback *)0x083A6B10,
111
+    (MovementCallback *)0x083A6B1C,
112
+    (MovementCallback *)0x083A6B28,
113
+    (MovementCallback *)0x083A6B34,
114
+    (MovementCallback *)0x083A6B40,
115
+    (MovementCallback *)0x083A6B4C,
116
+    (MovementCallback *)0x083A6B58,
117
+    (MovementCallback *)0x083A6B64,
118
+    (MovementCallback *)0x083A6B70,
119
+    (MovementCallback *)0x083A6B7C,
120
+    (MovementCallback *)0x083A6B88,
121
+    (MovementCallback *)0x083A6B94,
122
+    (MovementCallback *)0x083A6BA0,
123
+    (MovementCallback *)0x083A6BAC,
124
+    (MovementCallback *)0x083A6BB8,
125
+    (MovementCallback *)0x083A6BC4,
126
+    (MovementCallback *)0x083A6BD0,
127
+    (MovementCallback *)0x083A6BDC,
128
+    (MovementCallback *)0x083A6BE8,
129
+    (MovementCallback *)0x083A6BF4,
130
+    (MovementCallback *)0x083A6C00,
131
+    (MovementCallback *)0x083A6C0C,
132
+    (MovementCallback *)0x083A6C18,
133
+    (MovementCallback *)0x083A6C24,
134
+    (MovementCallback *)0x083A6C30,
135
+    (MovementCallback *)0x083A6C6C,
136
+    (MovementCallback *)0x083A6C74,
137
+    (MovementCallback *)0x083A6C7C,
138
+    (MovementCallback *)0x083A6C84,
139
+    (MovementCallback *)0x083A6C8C,
140
+    (MovementCallback *)0x083A6C98,
141
+    (MovementCallback *)0x083A6CA4,
142
+    (MovementCallback *)0x083A6CB0,
143
+    (MovementCallback *)0x083A6CBC,
144
+    (MovementCallback *)0x083A6CC8,
145
+    (MovementCallback *)0x083A6CD4,
146
+    (MovementCallback *)0x083A6CE0,
147
+    (MovementCallback *)0x083A6CEC,
148
+    (MovementCallback *)0x083A6CF8,
149
+    (MovementCallback *)0x083A6D04,
150
+    (MovementCallback *)0x083A6D10,
151
+    (MovementCallback *)0x083A6D1C,
152
+    (MovementCallback *)0x083A6D24,
153
+    (MovementCallback *)0x083A6D30,
154
+    (MovementCallback *)0x083A6D38,
155
+    (MovementCallback *)0x083A6D40,
156
+    (MovementCallback *)0x083A6D48,
157
+    (MovementCallback *)0x083A6D50,
158
+    (MovementCallback *)0x083A6D58,
159
+    (MovementCallback *)0x083A6D60,
160
+    (MovementCallback *)0x083A6D68,
161
+    (MovementCallback *)0x083A6D70,
162
+    (MovementCallback *)0x083A6D78,
163
+    (MovementCallback *)0x083A6D80,
164
+    (MovementCallback *)0x083A6D88,
165
+    (MovementCallback *)0x083A6D94,
166
+    (MovementCallback *)0x083A6DA4,
167
+    (MovementCallback *)0x083A6DB4,
168
+    (MovementCallback *)0x083A6DBC,
169
+    (MovementCallback *)0x083A6DC4,
170
+    (MovementCallback *)0x083A6DCC,
171
+    (MovementCallback *)0x083A6DD4,
172
+    (MovementCallback *)0x083A6DE0,
173
+    (MovementCallback *)0x083A6DEC,
174
+    (MovementCallback *)0x083A6DF4,
175
+    (MovementCallback *)0x083A6DFC,
176
+    (MovementCallback *)0x083A6E04,
177
+    (MovementCallback *)0x083A6E0C,
178
+    (MovementCallback *)0x083A6E18,
179
+    (MovementCallback *)0x083A6E24,
180
+    (MovementCallback *)0x083A6E30,
181
+    (MovementCallback *)0x083A6E3C,
182
+    (MovementCallback *)0x083A6E48,
183
+    (MovementCallback *)0x083A6E54,
184
+    (MovementCallback *)0x083A6E60,
185
+    (MovementCallback *)0x083A6E9C,
186
+    (MovementCallback *)0x083A6EA8,
187
+    (MovementCallback *)0x083A6EB4,
188
+    (MovementCallback *)0x083A6EC0,
189
+    (MovementCallback *)0x083A6ECC,
190
+    (MovementCallback *)0x083A6ED8,
191
+    (MovementCallback *)0x083A6EE4,
192
+    (MovementCallback *)0x083A6EF0,
193
+    (MovementCallback *)0x083A6EFC,
194
+    (MovementCallback *)0x083A6F08,
195
+    (MovementCallback *)0x083A6F14,
196
+    (MovementCallback *)0x083A6F20,
197
+    (MovementCallback *)0x083A6F2C,
198
+    (MovementCallback *)0x083A6F38,
199
+    (MovementCallback *)0x083A6F44,
200
+    (MovementCallback *)0x083A6F50,
201
+    (MovementCallback *)0x083A6F5C,
202
+    (MovementCallback *)0x083A6F68,
203
+    (MovementCallback *)0x083A6F74,
204
+    (MovementCallback *)0x083A6F80,
205
+    (MovementCallback *)0x083A6F8C,
206
+    (MovementCallback *)0x083A6F98,
207
+    (MovementCallback *)0x083A6FA4,
208
+    (MovementCallback *)0x083A6FB0,
209
+    (MovementCallback *)0x083A6FBC,
210
+    (MovementCallback *)0x083A6FC8,
211
+    (MovementCallback *)0x083A6FD4,
212
+    (MovementCallback *)0x083A6FE0,
213
+    (MovementCallback *)0x083A6FEC,
214
+    (MovementCallback *)0x083A6FF4,
215
+    (MovementCallback *)0x083A6FFC,
216
+    (MovementCallback *)0x083A6898,
217
+    (MovementCallback *)0x083A68A4,
218
+    (MovementCallback *)0x083A68B0,
219
+    (MovementCallback *)0x083A68BC,
220
+    (MovementCallback *)0x083A7004,
221
+    (MovementCallback *)0x083A6A00,
222
+    (MovementCallback *)0x083A6A0C,
223
+    (MovementCallback *)0x083A6A18,
224
+    (MovementCallback *)0x083A6A24,
225
+    (MovementCallback *)0x083A700C,
226
+    (MovementCallback *)0x083A7018,
227
+    (MovementCallback *)0x083A6C3C,
228
+    (MovementCallback *)0x083A6C48,
229
+    (MovementCallback *)0x083A6C54,
230
+    (MovementCallback *)0x083A6C60,
231
+    mv_set_frame_zero,
232
+    mv_set_frame_one,
233
+    mv_set_frame_two,
234
+    mv_set_frame_three,
235
+    mv_set_frame_four,
236
+    mv_set_frame_five,
237
+    mv_set_frame_six,
238
+    mv_set_frame_seven,
239
+    mv_set_frame_eight,
240
+    mv_set_frame_nine,
241
+    mv_set_frame_ten,
242
+    mv_set_frame_eleven,
243
+    mv_set_frame_twelve,
244
+    mv_set_frame_thirteen,
245
+    mv_set_frame_fourteen,
246
+    mv_set_frame_fifteen,
247
+    mv_set_frame_sixteen,
248
+    mv_set_frame_seventeen,
249
+    mv_set_frame_eighteen,
250
+    mv_set_frame_nineteen,
251
+    mv_set_frame_twenty,
252
+};

+ 2
- 0
src/overworld/tileset_animation/text_animator.c View File

@@ -66,6 +66,8 @@ void set_pixel(u8 x, u8 y, u16 *start, u16 pixel) {
66 66
 
67 67
 #define ANIMATION_FRAME_SPEED 2
68 68
 
69
+/* TODO: Compile RELEASE Versions of the game with higher optimization flags */
70
+
69 71
 void text_animator(u16 current_frame) {
70 72
     if ((current_frame % ANIMATION_FRAME_SPEED) == 0) {
71 73
         u8 outer_pixels[16] = {