Procházet zdrojové kódy

start with some grass animation stuff

SBird1337 před 7 roky
rodič
revize
b1c0e6ae38

+ 77
- 0
data/overworld/oe_effect_table.s Zobrazit soubor

@@ -0,0 +1,77 @@
1
+.align 2
2
+.thumb
3
+.text
4
+
5
+.global oe_effect_table
6
+oe_effect_table:
7
+
8
+.word 0x081D97C4 @0x00
9
+.word 0x081D97CA @0x01
10
+.word 0x081D97D0 @0x02
11
+.word 0x081D97D6 @0x03
12
+.word 0x081D97DC @0x04 grass animation
13
+.word 0x081D97E6 @0x05
14
+.word 0x081D97F0 @0x06
15
+.word 0x081D97F6 @0x07
16
+.word 0x081D9800 @0x08
17
+.word 0x081D9806 @0x09
18
+.word 0x081D980C @0x0A
19
+.word 0x081D9816 @0x0B
20
+.word 0x081D9817 @0x0C
21
+.word 0x081D9821 @0x0D
22
+.word 0x081D982B @0x0E
23
+.word 0x081D9835 @0x0F
24
+.word 0x081D983F @0x10
25
+.word 0x081D9849 @0x11
26
+.word 0x081D9853 @0x12
27
+.word 0x081D985D @0x13
28
+.word 0x081D9867 @0x14
29
+.word 0x081D9871 @0x15
30
+.word 0x081D987B @0x16
31
+.word 0x081D9885 @0x17
32
+.word 0x081D988B @0x18
33
+.word 0x081D9895 @0x19
34
+.word 0x081D98A4 @0x1A
35
+.word 0x081D98A5 @0x1B
36
+.word 0x081D98A6 @0x1C
37
+.word 0x081D98AC @0x1D
38
+.word 0x081D98B2 @0x1E
39
+.word 0x081D98B8 @0x1F
40
+.word 0x081D98BE @0x20
41
+.word 0x081D98C4 @0x21
42
+.word 0x081D98CA @0x22
43
+.word 0x081D98D4 @0x23
44
+.word 0x081D98DE @0x24
45
+.word 0x081D98E4 @0x25
46
+.word 0x081D98F0 @0x26
47
+.word 0x081D98F6 @0x27
48
+.word 0x081D98EA @0x28
49
+.word 0x081D9900 @0x29
50
+.word 0x081D990A @0x2A
51
+.word 0x081D9914 @0x2B
52
+.word 0x081D991A @0x2C
53
+.word 0x081D9920 @0x2D
54
+.word 0x081D992B @0x2E
55
+.word 0x081D9931 @0x2F
56
+.word 0x081D9932 @0x30
57
+.word 0x081D9933 @0x31
58
+.word 0x081D993D @0x32
59
+.word 0x081D9947 @0x33
60
+.word 0x081D994D @0x34
61
+.word 0x081D994E @0x35
62
+.word 0x081D9958 @0x36
63
+.word 0x081D9962 @0x37
64
+.word 0x081D9963 @0x38
65
+.word 0x081D9964 @0x39
66
+.word 0x081D9965 @0x3A
67
+.word 0x081D996F @0x3B
68
+.word 0x081D9975 @0x3C
69
+.word 0x081D9976 @0x3D
70
+.word 0x081D9977 @0x3E
71
+.word 0x081D9986 @0x3F
72
+.word 0x081D998C @0x40
73
+.word 0x081D9992 @0x41
74
+.word 0x081D9998 @0x42
75
+.word 0x081D999E @0x43
76
+.word 0x081D99A4 @0x44
77
+.word 0x081D99AA @0x45

+ 1
- 1
g3headers

@@ -1 +1 @@
1
-Subproject commit 99262700aa37a47c4ccc7b110dcc5bb716bc1e61
1
+Subproject commit acea6cc201acf0d81a5fd8367f6af9a136e0eab4

+ 4
- 1
patches/overworlds/overworld.asm Zobrazit soubor

@@ -99,4 +99,7 @@ strb r0, [r4, #0x1A]
99 99
 .org 0x080683C8
100 100
     ldr r3, =grass_step_elastic+1
101 101
     bx r3
102
-    .pool
102
+    .pool
103
+
104
+.org 0x08083484
105
+    .word oe_effect_table

+ 1
- 1
sots-private

@@ -1 +1 @@
1
-Subproject commit d208915b0707c7710bc28ec3b0bea5cfccb86917
1
+Subproject commit 6f9ef909f235f4f3b14b8269f37153ce5f1f2709

+ 21
- 26
src/overworld/grass_animation.c Zobrazit soubor

@@ -1,35 +1,30 @@
1
-#include <oe_animation.h>
2
-#include <npc.h>
3
-#include <save_one.h>
4
-#include <agb_debug.h>
1
+#include <pokeagb/pokeagb.h>
5 2
 
6
-extern u16 current_map_block_role_get(u16 x, u16 y);
7
-void sp_check_tileset(void);
8
-
9
-void grass_step_general(struct npc_state *npc)
3
+void grass_step_general(struct NpcState *npc)
10 4
 {
11
-    current_oe_state.to_x___local_id = npc->to.x;
12
-    current_oe_state.to_y___local_mapnumber = npc->to.y;
13
-    current_oe_state.height_lsr_4___local_mapbank = (npc->height) >> 4;
14
-    current_oe_state.field_C = 2;
15
-    current_oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_mapnumber);
16
-    current_oe_state.local_mapbank = npc->local_mapbank;
17
-    current_oe_state.sav1_location = (((sav_one->location.map) << 8) | sav_one->location.bank);
18
-    current_oe_state.field_1C = 1;
5
+    oe_state.effect_pos.x = npc->to.x;
6
+    oe_state.effect_pos.y = npc->to.y;
7
+    oe_state.priority = (npc->height) >> 4;
8
+    oe_state.field_c = 2;
9
+    oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_map_number);
10
+    oe_state.local_mapbank = npc->local_map_bank;
11
+    oe_state.sav1_location = (((saveblock1->location.map) << 8) | saveblock1->location.bank);
12
+    oe_state.field_1c = 1;
19 13
     (void)oe_exec(4);
20 14
 }
21 15
 
22
-void grass_step_elastic(struct npc_state *npc)
16
+void grass_step_elastic(struct NpcState *npc)
23 17
 {
24
-    current_oe_state.to_x___local_id = npc->to.x;
25
-    current_oe_state.to_y___local_mapnumber = npc->to.y;
26
-    current_oe_state.height_lsr_4___local_mapbank = (npc->height) >> 4;
27
-    current_oe_state.field_C = 2;
28
-    current_oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_mapnumber);
29
-    current_oe_state.local_mapbank = npc->local_mapbank;
30
-    current_oe_state.sav1_location = (((sav_one->location.map) << 8) | sav_one->location.bank);
31
-    current_oe_state.field_1C = 0;
18
+    oe_state.effect_pos.x = npc->to.x;
19
+    oe_state.effect_pos.y = npc->to.y;
20
+    oe_state.priority = (npc->height) >> 4;
21
+    oe_state.field_c = 2;
22
+    oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_map_number);
23
+    oe_state.local_mapbank = npc->local_map_bank;
24
+    oe_state.sav1_location = (((saveblock1->location.map) << 8) | saveblock1->location.bank);
25
+    oe_state.field_1c = 0;
32 26
 
33 27
     /* use variable to determine the oe animation to play */
34 28
     (void)oe_exec(4);
35
-}
29
+}
30
+