Explorar el Código

crystal special effect finished

SBird1337 hace 7 años
padre
commit
eb20cfb209

+ 1
- 1
g3headers

@@ -1 +1 @@
1
-Subproject commit c4659d3ab4f6062818f1e776746d7be46582f992
1
+Subproject commit fd98d6c1df9c3f8e52c931dbbd019d2c439f62d8

+ 3
- 0
main.asm Ver fichero

@@ -64,6 +64,9 @@
64 64
 .org 0x0815F9B8
65 65
     .word 0x08069ED5 // fix nop1 for now...
66 66
 
67
+.org 0x08727994
68
+    .word the_old_test_script
69
+
67 70
 .org 0x09000000
68 71
 .importobj "object/linked.o"
69 72
 .close

+ 1
- 1
src/include/script_language.h Ver fichero

@@ -16,7 +16,7 @@
16 16
 
17 17
 @@@@@@@@@@@@@@@@@ Macro
18 18
 
19
-@@ Costum commands
19
+@@ Custom commands
20 20
 
21 21
 .macro msgbox msgbox_textpointer msgbox_callstd
22 22
 loadpointer 0x0 \msgbox_textpointer

+ 5
- 2
src/specials/custom_specials.c Ver fichero

@@ -73,9 +73,11 @@ void get_text_pointer_from_lookup();
73 73
 
74 74
 void sp_check_tileset();
75 75
 
76
+extern void sp_crystal_fade(void);
77
+
76 78
 /* === STATICS === */
77 79
 
78
-static callback special_routines[8] = {
80
+static callback special_routines[9] = {
79 81
     met_play,
80 82
     cam_sp_move_camera,
81 83
     sp_init_script,
@@ -83,7 +85,8 @@ static callback special_routines[8] = {
83 85
     sp_dns_switch,
84 86
     sp_random_number,
85 87
     sp_check_tileset,
86
-    sp_batchmaptile
88
+    sp_batchmaptile,
89
+    sp_crystal_fade,
87 90
 };
88 91
 
89 92
 /* === IMPLEMENTATIONS === */

+ 7
- 4
src/specials/special_effects/crystal_fade.c Ver fichero

@@ -1,21 +1,24 @@
1 1
 #include <pokeagb/pokeagb.h>
2 2
 
3
+#define CRYSTAL_MAX_INTENSITY 5
4
+#define CRYSTAL_SPEED 1
5
+
3 6
 void task_fade_flash(u8 id) {
4 7
     switch (tasks[id].priv[1]) {
5 8
     case 0:
6
-        fade_screen(0xFFFFFFFF, 5, 0, 16, tasks[id].priv[0]);
9
+        fade_screen(0xFFFFFFFF, CRYSTAL_SPEED, 0, CRYSTAL_MAX_INTENSITY, tasks[id].priv[0]);
7 10
         tasks[id].priv[1]++;
8 11
         break;
9 12
     case 1:
10 13
         if (!pal_fade_control.active) {
11
-            fade_screen(0xFFFFFFFF, 5, 16, 0, tasks[id].priv[0]);
14
+            fade_screen(0xFFFFFFFF, CRYSTAL_SPEED, CRYSTAL_MAX_INTENSITY, 0, tasks[id].priv[0]);
12 15
             tasks[id].priv[1]++;
13 16
         }
14 17
         break;
15 18
     case 2:
16
-        if(!pal_fade_control.active)
17
-        {
19
+        if (!pal_fade_control.active) {
18 20
             task_del(id);
21
+            script_env_2_enable_and_set_ctx_running();
19 22
         }
20 23
         break;
21 24
     }

+ 0
- 171
src/test/alabastia.S Ver fichero

@@ -1,171 +0,0 @@
1
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2
-@                                                                    @
3
-@           file: E:\OneDrive\sots tilesets\alabastia.tmx            @
4
-@                     converted using tiled2agb                      @
5
-@                      converted on 31.05.2017                       @
6
-@                   program created by Sturmvogel                    @
7
-@                                                                    @
8
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
9
-
10
-@@@  SECTION: MAPHEADER  @@@
11
-
12
-.align 2
13
-.global mapheader_alabastia
14
-mapheader_alabastia:
15
-	.word mapfooter_alabastia
16
-	.word mapevents_alabastia
17
-	.word 0x0816545A
18
-	.word 0x0835276C
19
-	.hword 0x012C @music
20
-	.hword 0x004E @index
21
-	.byte 0x58 @name
22
-	.byte 0x00 @cave
23
-	.byte 0x02 @weather
24
-	.byte 0x01 @light
25
-	.byte 0x01 @unknown
26
-	.hword 0x0006 @showName
27
-	.byte 0x00 @battleStyle
28
-
29
-@@@  SECTION: MAPFOOTER  @@@
30
-
31
-.align 2
32
-.global mapfooter_alabastia
33
-mapfooter_alabastia:
34
-	.word 0x00000018
35
-	.word 0x00000014
36
-	.word mapborderblocks_alabastia
37
-	.word mapblocks_alabastia
38
-	.word 0x082D4A94
39
-	.word 0x082D4AAC
40
-	.byte 2
41
-	.byte 2
42
-	.hword 0
43
-@@@  SECTION: MAPBLOCKS  @@@
44
-.align 2
45
-
46
-.global mapblocks_alabastia
47
-mapblocks_alabastia:
48
-	.hword 0x041C,0x041D,0x041C,0x041D,0x041C,0x041D,0x041C,0x041D,0x041C,0x041D,0x041C,0x041D,0x32A6,0x32A7,0x041C,0x041D,0x041C,0x041D,0x041C,0x041D,0x041C,0x041D,0x041E,0x041F
49
-	.hword 0x0414,0x0415,0x0424,0x0425,0x0424,0x0425,0x0424,0x0425,0x0424,0x0425,0x0424,0x0425,0x32AE,0x32AF,0x0424,0x0425,0x0424,0x0425,0x0424,0x0425,0x0424,0x0425,0x0416,0x0417
50
-	.hword 0x041C,0x041D,0x32A6,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x3285,0x3286,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x328F,0x041E,0x041F
51
-	.hword 0x0414,0x0415,0x32AE,0x3296,0x3296,0x3281,0x3282,0x3282,0x3282,0x3283,0x3296,0x3296,0x3296,0x3296,0x3281,0x3282,0x3282,0x3282,0x3283,0x3296,0x3296,0x3297,0x0416,0x0417
52
-	.hword 0x041C,0x041D,0x32AE,0x32C7,0x329E,0x0689,0x068A,0x068A,0x068A,0x068B,0x329E,0x329E,0x329E,0x329E,0x0689,0x068A,0x068A,0x068A,0x068B,0x32C6,0x3296,0x3297,0x041E,0x041F
53
-	.hword 0x0414,0x0415,0x32AE,0x3297,0x3001,0x0691,0x0692,0x0692,0x0693,0x0694,0x300E,0x300F,0x3008,0x3001,0x0691,0x0692,0x0692,0x0693,0x0694,0x3295,0x3296,0x3297,0x0416,0x0417
54
-	.hword 0x041C,0x041D,0x32AE,0x3297,0x32A5,0x0698,0x0699,0x069A,0x069B,0x069C,0x041E,0x041F,0x3008,0x32A5,0x0698,0x0699,0x069A,0x069B,0x069C,0x3295,0x3296,0x3297,0x041E,0x041F
55
-	.hword 0x0414,0x0415,0x32AE,0x3297,0x06AD,0x06A0,0x06A3,0x06A2,0x06A1,0x06A4,0x0426,0x0427,0x3008,0x06AD,0x06A0,0x06A3,0x06A2,0x06A1,0x06A4,0x3295,0x3296,0x3297,0x0416,0x0417
56
-	.hword 0x041C,0x041D,0x32AE,0x32BF,0x328E,0x32BE,0x3296,0x32BF,0x328E,0x328E,0x328E,0x328E,0x328E,0x328E,0x32BE,0x3296,0x32BF,0x328E,0x328E,0x32BE,0x3296,0x3297,0x041E,0x041F
57
-	.hword 0x0414,0x0415,0x32AE,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x32A8,0x32A9,0x32A9,0x32A9,0x32A9,0x32BD,0x32B5,0x3296,0x3297,0x0416,0x0417
58
-	.hword 0x041C,0x041D,0x32AE,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x32C7,0x06B0,0x06B1,0x06B1,0x06B1,0x06B1,0x06B3,0x06B4,0x3296,0x3297,0x041E,0x041F
59
-	.hword 0x0414,0x0415,0x32AE,0x3296,0x32C7,0x0684,0x0684,0x0684,0x0684,0x0402,0x32C6,0x3296,0x3297,0x06B8,0x06B9,0x06B9,0x06B9,0x06B9,0x06BB,0x06BC,0x32CE,0x3297,0x0416,0x0417
60
-	.hword 0x041C,0x041D,0x32AE,0x3296,0x3297,0x3004,0x3004,0x3004,0x3004,0x3001,0x3295,0x3296,0x3297,0x06C0,0x06C1,0x06D0,0x06C2,0x06C3,0x06C4,0x06C5,0x32AE,0x3297,0x041E,0x041F
61
-	.hword 0x0414,0x0415,0x32AE,0x3296,0x3297,0x3004,0x3004,0x3004,0x3004,0x3001,0x3295,0x3296,0x3297,0x06C8,0x06C9,0x06D8,0x06AC,0x06CB,0x06CC,0x06CD,0x32AE,0x3297,0x0416,0x0417
62
-	.hword 0x041C,0x041D,0x32AE,0x3296,0x3297,0x0403,0x3001,0x3001,0x3001,0x3001,0x3295,0x3296,0x32BF,0x328E,0x328E,0x32BE,0x3296,0x32BF,0x328E,0x328E,0x3285,0x3297,0x041E,0x041F
63
-	.hword 0x0414,0x0415,0x32AE,0x3296,0x32BF,0x328E,0x328E,0x328E,0x328E,0x328E,0x32BE,0x3296,0x32C7,0x329E,0x329E,0x329E,0x329E,0x329E,0x329E,0x32C6,0x3296,0x3297,0x0416,0x0417
64
-	.hword 0x041C,0x041D,0x32AE,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3290,0x0687,0x0687,0x0687,0x0687,0x0687,0x0687,0x32BE,0x3296,0x3297,0x041E,0x041F
65
-	.hword 0x0414,0x0415,0x32B6,0x329E,0x329E,0x329E,0x329E,0x32D1,0x3123,0x3123,0x32D2,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3296,0x3297,0x0416,0x0417
66
-	.hword 0x041C,0x041D,0x3004,0x3001,0x3004,0x3001,0x3001,0x312A,0x312B,0x312B,0x312C,0x329E,0x329E,0x329E,0x329E,0x329E,0x329E,0x329E,0x329E,0x329E,0x329E,0x329F,0x041E,0x041F
67
-	.hword 0x0414,0x0415,0x300E,0x300F,0x300E,0x300F,0x3001,0x312A,0x312B,0x312B,0x312C,0x3001,0x3004,0x3001,0x3001,0x3001,0x3004,0x3001,0x300E,0x300F,0x300E,0x300F,0x0416,0x0417
68
-@@@  SECTION: BORDERBLOCKS  @@@
69
-.align 2
70
-
71
-.global mapborderblocks_alabastia
72
-mapborderblocks_alabastia:
73
-	.hword 0x001C,0x001D
74
-	.hword 0x0014,0x0015
75
-@@@  SECTION: MAPEVENTS  @@@
76
-
77
-.align 2
78
-.global mapevents_alabastia
79
-mapevents_alabastia:
80
-.byte	0x02, 0x03, 0x02, 0x00
81
-.word 	mapevents_persons_alabastia
82
-.word 	mapevents_warps_alabastia
83
-.word 	mapevents_triggers_alabastia
84
-.word 	00000000
85
-
86
-@@@ SECTION: PERSON EVENTS @@@
87
-.align 2
88
-mapevents_persons_alabastia:
89
-@PERSON ID: 0
90
-
91
-	.byte 0x09
92
-	.byte 0x14
93
-	.byte 0x00
94
-	.byte 0x00
95
-	.hword 0x000A
96
-	.hword 0x0004
97
-	.byte 0x00
98
-	.byte 0x01
99
-	.byte 0x40
100
-	.byte 0x00
101
-	.byte 0x00
102
-	.byte 0x00
103
-	.hword 0x0000
104
-	.word scr_map_test
105
-	.hword 0x0500
106
-	.hword 0x0000
107
-@PERSON ID: 1
108
-
109
-	.byte 0x07
110
-	.byte 0x0A
111
-	.byte 0x00
112
-	.byte 0x00
113
-	.hword 0x000E
114
-	.hword 0x0002
115
-	.byte 0x00
116
-	.byte 0x03
117
-	.byte 0x40
118
-	.byte 0x00
119
-	.byte 0x01
120
-	.byte 0x00
121
-	.hword 0x0004
122
-	.word 0x00000000
123
-	.hword 0x0501
124
-	.hword 0x0000
125
-@@@ SECTION: WARP EVENTS @@@
126
-.align 2
127
-mapevents_warps_alabastia:
128
-@WARP ID: 0
129
-	.hword 6
130
-	.hword 7
131
-	.byte 0
132
-	.byte 1
133
-	.byte 0
134
-	.byte 4
135
-@WARP ID: 1
136
-	.hword 15
137
-	.hword 7
138
-	.byte 0
139
-	.byte 0
140
-	.byte 2
141
-	.byte 4
142
-@WARP ID: 2
143
-	.hword 16
144
-	.hword 13
145
-	.byte 0
146
-	.byte 0
147
-	.byte 3
148
-	.byte 4
149
-@@@ SECTION: TRIGGER EVENTS @@@
150
-.align 2
151
-mapevents_triggers_alabastia:
152
-@WARP ID: 0
153
-	.hword 12
154
-	.hword 1
155
-	.byte 0
156
-	.byte 0
157
-	.hword 20497
158
-	.hword 0
159
-	.byte 0
160
-	.byte 0
161
-	.word scr_trigger_test_two
162
-@WARP ID: 1
163
-	.hword 13
164
-	.hword 1
165
-	.byte 0
166
-	.byte 0
167
-	.hword 20498
168
-	.hword 0
169
-	.byte 0
170
-	.byte 0
171
-	.word scr_trigger_test

+ 8
- 29
src/test/test_scripts.S Ver fichero

@@ -3,36 +3,15 @@
3 3
 .align 2
4 4
 .thumb
5 5
 
6
-.global scr_map_test
7
-scr_map_test:
6
+.global the_old_test_script
7
+the_old_test_script:
8
+
8 9
 lock
9 10
 faceplayer
11
+setvar 0x8000 0x7C00
12
+setvar 0x5006 8
13
+special 0x68
14
+waitstate
10 15
 msgbox str_test_text 0x6
11 16
 release
12
-end
13
-
14
-.global scr_trainer_test
15
-scr_trainer_test:
16
-trainerbattle 0 5 0 str_test_text str_test_text
17
-
18
-.global scr_trigger_test
19
-scr_trigger_test:
20
-lockall
21
-msgbox str_test_text 6
22
-applymovement 0xFF move_data
23
-waitmovement 0x0
24
-releaseall
25
-end
26
-
27
-.global scr_trigger_test_two
28
-scr_trigger_test_two:
29
-lockall
30
-msgbox str_test_text_two 6
31
-applymovement 0xFF move_data
32
-waitmovement 0x0
33
-setvar 0x5011
34
-releaseall
35
-end
36
-
37
-move_data:
38
-.byte APPLYMOVE_JUMP_ONE_DOWN, APPLYMOVE_END
17
+end