Browse Source

more refractoring and documentation

SBird1337 8 years ago
parent
commit
b3389ecf7a

+ 3
- 0
nbproject/configurations.xml View File

4634
           <in>dns_core.h</in>
4634
           <in>dns_core.h</in>
4635
           <in>item_effects.h</in>
4635
           <in>item_effects.h</in>
4636
           <in>items.h</in>
4636
           <in>items.h</in>
4637
+          <in>memory.h</in>
4637
           <in>oe_animation.h</in>
4638
           <in>oe_animation.h</in>
4638
           <in>pkmn_attributes.h</in>
4639
           <in>pkmn_attributes.h</in>
4639
           <in>pokemon.h</in>
4640
           <in>pokemon.h</in>
27383
       </item>
27384
       </item>
27384
       <item path="src/include/items.h" ex="false" tool="3" flavor2="0">
27385
       <item path="src/include/items.h" ex="false" tool="3" flavor2="0">
27385
       </item>
27386
       </item>
27387
+      <item path="src/include/memory.h" ex="false" tool="3" flavor2="0">
27388
+      </item>
27386
       <item path="src/include/oe_animation.h" ex="false" tool="3" flavor2="0">
27389
       <item path="src/include/oe_animation.h" ex="false" tool="3" flavor2="0">
27387
       </item>
27390
       </item>
27388
       <item path="src/include/pkmn_attributes.h" ex="false" tool="3" flavor2="0">
27391
       <item path="src/include/pkmn_attributes.h" ex="false" tool="3" flavor2="0">

+ 1
- 0
nbproject/private/configurations.xml View File

6066
           <in>item_effects.h</in>
6066
           <in>item_effects.h</in>
6067
           <in>items.h</in>
6067
           <in>items.h</in>
6068
           <in>lcd.h</in>
6068
           <in>lcd.h</in>
6069
+          <in>memory.h</in>
6069
           <in>moves.h</in>
6070
           <in>moves.h</in>
6070
           <in>objects.h</in>
6071
           <in>objects.h</in>
6071
           <in>oe_animation.h</in>
6072
           <in>oe_animation.h</in>

+ 5
- 10
src/include/bpre.h View File

21
 void* memset (void* dst, int value, size_t size);
21
 void* memset (void* dst, int value, size_t size);
22
 
22
 
23
 //debug
23
 //debug
24
-void agbprintf(const char* pBuf, ...);
24
+/*void agbprintf(const char* pBuf, ...);
25
 void agbprint_flush();
25
 void agbprint_flush();
26
-void agb_assert(const char *file, int line, const char *expression, u32 stop);
26
+void agb_assert(const char *file, int line, const char *expression, u32 stop);*/
27
 
27
 
28
 // sound related stuff
28
 // sound related stuff
29
-extern MPlayTable mplay_table[];
30
-extern SongTable _songtable[];
31
-void m4aSongNumStart(u16 songid);
32
-void MPlayStart_rev01(MusicPlayerArea *ma, SongHeader *so);
33
-void MPlayContinue(MusicPlayerArea *ma);
29
+
34
 
30
 
35
 //graphical stuff
31
 //graphical stuff
36
 
32
 
37
 //object related stuff
33
 //object related stuff
38
-void objc_exec();
39
-void obj_sync();
34
+
40
 
35
 
41
 //task related stuff
36
 //task related stuff
42
-void task_exec();
37
+
43
 
38
 
44
 //attribute setter and getter
39
 //attribute setter and getter
45
 u8 get_attributes(struct pokemon* poke_address, u8 request, void* destination);
40
 u8 get_attributes(struct pokemon* poke_address, u8 request, void* destination);

+ 60
- 0
src/include/callback.h View File

1
+/****************************************************************************
2
+ * Copyright (C) 2015-2016 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
23
+/**
24
+ * @file callback.h
25
+ * @author Sturmvogel
26
+ * @date 15 dec 2016
27
+ * @brief Manage callbacks and tasks
28
+ * 
29
+ * This header file provides methods to interact with callbacks and
30
+ * the task handler. It also defines the superstate structure,
31
+ * which contains callback information, sprite pointers, kesypad etc.
32
+ */
33
+
1
 #ifndef CALLBACK_H_
34
 #ifndef CALLBACK_H_
2
 #define CALLBACK_H_
35
 #define CALLBACK_H_
3
 
36
 
4
 #include <objects.h>
37
 #include <objects.h>
38
+
39
+/* === TYPES === */
40
+
5
 typedef void (*callback)();
41
 typedef void (*callback)();
6
 
42
 
43
+/* === STRUCTURES === */
44
+
7
 struct int_superstate {
45
 struct int_superstate {
8
 	callback callback1;
46
 	callback callback1;
9
 	callback callback2;
47
 	callback callback2;
26
 	u8 multi_purpose_state_tracker;
64
 	u8 multi_purpose_state_tracker;
27
 	u8 gpu_sprites_upload_skip;
65
 	u8 gpu_sprites_upload_skip;
28
  };
66
  };
67
+
68
+/* === EXTERN STRUCTURES === */
29
  
69
  
30
 extern struct int_superstate superstate;
70
 extern struct int_superstate superstate;
71
+
72
+/* === EXTERN METHODS === */
73
+
74
+/**
75
+ * @brief sets the second main callback
76
+ * @param address callback which should be set
77
+ */
31
 extern void set_callback2(callback address);
78
 extern void set_callback2(callback address);
79
+
80
+/**
81
+ * @brief sets the vblank callback
82
+ * @param address callback which should be set
83
+ */
32
 extern void vblank_handler_set(callback address);
84
 extern void vblank_handler_set(callback address);
33
 
85
 
86
+/**
87
+ * @brief does everything the overworld needs to do
88
+ */
34
 extern void callback_overworld();
89
 extern void callback_overworld();
35
 
90
 
91
+/**
92
+ * @brief executes the task handler stack
93
+ */
94
+extern void task_exec();
95
+
36
 #endif
96
 #endif

+ 74
- 0
src/include/memory.h View File

1
+/****************************************************************************
2
+ * Copyright (C) 2015-2016 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
23
+/**
24
+ * @file memory.h
25
+ * @author Sturmvogel
26
+ * @date 15 dec 2016
27
+ * @brief Manage memory
28
+ * 
29
+ * This header file provides methods to allocate and free memory areas.
30
+ * It also provides basic memory copy/set methods.
31
+ */
32
+
33
+#ifndef MEMORY_H
34
+#define MEMORY_H
35
+
36
+/* === INCLUDE === */
37
+
38
+#include <types.h>
39
+
40
+/* === EXTERN METHODS === */
41
+
42
+/**
43
+ * @brief allocates memory
44
+ * @param size amount of bytes to allocate
45
+ * @return address to allocated memory area
46
+ */
47
+extern void* malloc(size_t size);
48
+
49
+/**
50
+ * @brief frees previously allocated memory
51
+ * @param address address to free
52
+ */
53
+extern void free(void* address);
54
+
55
+/**
56
+ * @brief copy bytes in memory
57
+ * @param destination address to copy to
58
+ * @param source address to copy from
59
+ * @param num amount of bytes to copy
60
+ * @return destination pointer
61
+ */
62
+extern void* memcpy (void * destination, const void* source, size_t num);
63
+
64
+/**
65
+ * @brief set bytes in memory
66
+ * @param dst destination to set words
67
+ * @param value to be set
68
+ * @param size number of bytes to set
69
+ * @return 
70
+ */
71
+extern void* memset (void* dst, int value, size_t size);
72
+
73
+#endif /* MEMORY_H */
74
+

+ 12
- 1
src/include/objects.h View File

16
  *   GNU Lesser General Public License for more details.                    *
16
  *   GNU Lesser General Public License for more details.                    *
17
  *                                                                          *
17
  *                                                                          *
18
  *   You should have received a copy of the GNU Lesser General Public       *
18
  *   You should have received a copy of the GNU Lesser General Public       *
19
- *   License along with Box.  If not, see <http://www.gnu.org/licenses/>.   *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
20
  ****************************************************************************/
21
  ****************************************************************************/
21
 
22
 
22
 /**
23
 /**
149
  */
150
  */
150
 extern void obj_delete_all();
151
 extern void obj_delete_all();
151
 
152
 
153
+/**
154
+ * @brief execute object callbacks
155
+ */
156
+extern void objc_exec();
157
+
158
+/**
159
+ * @brief synchronize object data with object hardware memory
160
+ */
161
+void obj_sync();
162
+
152
 
163
 
153
 #endif
164
 #endif

+ 47
- 8
src/include/sound.h View File

1
+/****************************************************************************
2
+ * Copyright (C) 2015-2016 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
23
+/**
24
+ * @file callback.h
25
+ * @author ipatix
26
+ * @date 15 dec 2016
27
+ * @brief Manage callbacks and tasks
28
+ * 
29
+ * This header file provides methods to interact with callbacks and
30
+ * the task handler. It also defines the superstate structure,
31
+ * which contains callback information, sprite pointers, kesypad etc.
32
+ */
33
+
1
 #ifndef SOUND_H_
34
 #ifndef SOUND_H_
2
 #define SOUND_H_
35
 #define SOUND_H_
3
 
36
 
4
 #include "types.h"
37
 #include "types.h"
5
 
38
 
6
-typedef struct MusicPlayerArea MusicPlayerArea;
7
-typedef struct MusicPlayerTrack MusicPlayerTrack;
8
-typedef struct SongHeader SongHeader;
39
+typedef struct music_player_area music_player_area;
40
+typedef struct music_player_track music_player_track;
41
+typedef struct song_header song_header;
9
 
42
 
10
 typedef struct {
43
 typedef struct {
11
-    MusicPlayerArea *ma;
12
-    MusicPlayerTrack *ta;
44
+    music_player_area *ma;
45
+    music_player_track *ta;
13
     u32 tn;
46
     u32 tn;
14
-} MPlayTable;
47
+} m_play_table;
15
 
48
 
16
 typedef struct {
49
 typedef struct {
17
-    SongHeader *so;
50
+    song_header *so;
18
     u16 ms, me;
51
     u16 ms, me;
19
-} SongTable;
52
+} song_table;
53
+
54
+extern m_play_table mplay_table[];
55
+extern song_table _songtable[];
56
+extern void m4aSongNumStart(u16 songid);
57
+extern void MPlayStart_rev01(music_player_area *ma, song_header *so);
58
+extern void MPlayContinue(music_player_area *ma);
20
 
59
 
21
 #endif
60
 #endif

+ 1
- 1
src/specials/custom_specials.c View File

19
 }
19
 }
20
 
20
 
21
 static callback special_routines[5] = {
21
 static callback special_routines[5] = {
22
-	play_meteor,
22
+	met_play,
23
 	sp_move_camera,
23
 	sp_move_camera,
24
 	init_script,
24
 	init_script,
25
         some_test,
25
         some_test,

+ 120
- 36
src/specials/cutscene_meteor.c View File

1
-#include "cutscene_meteor.h"
1
+/****************************************************************************
2
+ * Copyright (C) 2015-2016 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
23
+/**
24
+ * @file cutscene_meteor.c
25
+ * @author Sturmvogel
26
+ * @date 15 dec 2016
27
+ * @brief Cutscene to play "crashing meteor"
28
+ * 
29
+ * This source is able to play a cutscene, a meteor crashing on earth.
30
+ */
31
+
32
+/* === INCLUDES === */
33
+
34
+#include "../assets/meteor/met_background.h"
35
+#include "../assets/meteor/met_foreground.h"
36
+#include "../assets/meteor/met_sky.h"
37
+#include "../assets/meteor/met_meteor.h"
38
+#include "../assets/meteor/met_clouds.h"
39
+
40
+#include <callback.h>
41
+#include <lcd.h>
42
+#include <fade.h>
43
+#include <sound.h>
44
+#include <memory.h>
45
+
46
+/* === MACROS & DEFINES === */
2
 
47
 
3
 #define CLOUD_THROTTLE 4
48
 #define CLOUD_THROTTLE 4
4
 #define PALETTE_BG 0
49
 #define PALETTE_BG 0
8
 
53
 
9
 #define TAG_METEOR 0x2000
54
 #define TAG_METEOR 0x2000
10
 
55
 
56
+/* === STRUCTURES === */
57
+
11
 struct meteor_memory{
58
 struct meteor_memory{
12
 	void* bg_gfx;
59
 	void* bg_gfx;
13
 	void* bg_map;
60
 	void* bg_map;
27
 	u16 delay_end;
74
 	u16 delay_end;
28
 };
75
 };
29
 
76
 
77
+/* === PROTOTYPES === */
78
+
79
+/**
80
+ * @brief readies VRAM for our graphic setup
81
+ */
82
+void met_setup_vram();
83
+
84
+/**
85
+ * @brief callback for doing the actual animation
86
+ */
87
+void met_cutscene_cb();
88
+
89
+/**
90
+ * @brief callback to update the screen elements
91
+ */
92
+void met_update_screen();
93
+
94
+/**
95
+ * @brief callback for the meteor object entity
96
+ * @param self pointer to the meteor object entity
97
+ */
98
+void met_entity_cb(struct obj_entity* self);
99
+
100
+/**
101
+ * @brief finish the animation and free memory
102
+ */
103
+void met_free_end();
104
+
105
+/**
106
+ * @brief disable overworld scrolling in scrolling controller
107
+ */
108
+void met_setup_scrolling();
109
+
110
+/**
111
+ * @brief setup palettes for cutscene environment
112
+ */
113
+void met_setup_palettes();
114
+
115
+/* === STATIC ELEMENTS === */
116
+
117
+/*static memory block pointer for used structure*/
30
 static struct meteor_memory* memory = (struct meteor_memory*)(0x0203FFC0);
118
 static struct meteor_memory* memory = (struct meteor_memory*)(0x0203FFC0);
31
 
119
 
120
+/*oam attributes for the meteor object entity*/
32
 static struct obj_oam_attributes sprite_meteor = {0, 0x8000, 0x800, 0x0};
121
 static struct obj_oam_attributes sprite_meteor = {0, 0x8000, 0x800, 0x0};
33
 
122
 
123
+/*frame list for the meteor object entity*/
34
 static struct obj_frame meteor_frames [4] = {
124
 static struct obj_frame meteor_frames [4] = {
35
 	{0, 10},
125
 	{0, 10},
36
 	{16, 10},
126
 	{16, 10},
38
 	{0xFFFE, 0}
128
 	{0xFFFE, 0}
39
 };
129
 };
40
 
130
 
131
+/*pointer to the frame list*/
41
 static struct obj_frame* meteor_frames_a [1] = {
132
 static struct obj_frame* meteor_frames_a [1] = {
42
 	meteor_frames
133
 	meteor_frames
43
 };
134
 };
44
 
135
 
136
+/*template for the meteor object entity*/
45
 static struct obj_template template_meteor = {
137
 static struct obj_template template_meteor = {
46
 	TAG_METEOR,
138
 	TAG_METEOR,
47
 	TAG_METEOR,
139
 	TAG_METEOR,
49
 	meteor_frames_a,
141
 	meteor_frames_a,
50
 	0,
142
 	0,
51
 	(struct obj_rotscale_frame **) 0x08231CFC,
143
 	(struct obj_rotscale_frame **) 0x08231CFC,
52
-	meteor_callback
144
+	met_entity_cb
53
 };
145
 };
54
 
146
 
55
-void meteor_callback(struct obj_entity* self)
147
+void met_entity_cb(struct obj_entity* self)
56
 {
148
 {
57
-	if(memory->meteor_moving > 0)
58
-	{
59
-		self->x--;
60
-		self->y++;
61
-		if(self->y > 130)
62
-		{
63
-			memory->meteor_moving = 0;
64
-			m4aSongNumStart(0xAB);
65
-		}
66
-
67
-	}
149
+    if(memory->meteor_moving > 0)
150
+    {
151
+        self->x--;
152
+        self->y++;
153
+        if(self->y > 130)
154
+        {
155
+            memory->meteor_moving = 0;
156
+            m4aSongNumStart(0xAB);
157
+        }
158
+    }
68
 }
159
 }
69
 
160
 
70
-void play_meteor()
161
+void met_play()
71
 {
162
 {
163
+        
72
 	memory->animate_clouds = 0;
164
 	memory->animate_clouds = 0;
73
 	memory->cloud_animation_state = 0;
165
 	memory->cloud_animation_state = 0;
74
 	memory-> meteor_moving = 0;
166
 	memory-> meteor_moving = 0;
75
 	superstate.multi_purpose_state_tracker = 0;
167
 	superstate.multi_purpose_state_tracker = 0;
76
-	vblank_handler_set(update_screen);
77
-	set_callback2(cutscene);
168
+	vblank_handler_set(met_update_screen);
169
+	set_callback2(met_cutscene_cb);
78
 }
170
 }
79
-void cutscene()
171
+void met_cutscene_cb()
80
 {
172
 {
81
 	if(superstate.multi_purpose_state_tracker == 0)
173
 	if(superstate.multi_purpose_state_tracker == 0)
82
 	{
174
 	{
87
 	{
179
 	{
88
 		if((fade_controller.mix_color & 0x8000) == 0)
180
 		if((fade_controller.mix_color & 0x8000) == 0)
89
 		{
181
 		{
90
-			setup_vram();
182
+			met_setup_vram();
91
 			fade_screen(0xFFFFFFFF,0,0x10,0,0x0000);
183
 			fade_screen(0xFFFFFFFF,0,0x10,0,0x0000);
92
 			memory->delay = 60*3;
184
 			memory->delay = 60*3;
93
 			memory->delay_end = 90;
185
 			memory->delay_end = 90;
132
 	else if(superstate.multi_purpose_state_tracker == 6)
224
 	else if(superstate.multi_purpose_state_tracker == 6)
133
 	{
225
 	{
134
 		if(memory->delay_end == 0)
226
 		if(memory->delay_end == 0)
135
-			end_playback();
227
+			met_free_end();
136
 		else
228
 		else
137
 			memory->delay_end--;
229
 			memory->delay_end--;
138
 	}
230
 	}
141
 		memory->cloud_animation_state=0;
233
 		memory->cloud_animation_state=0;
142
 }
234
 }
143
 
235
 
144
-void end_playback()
236
+void met_free_end()
145
 {
237
 {
146
 	set_callback2(callback_overworld);
238
 	set_callback2(callback_overworld);
147
 	free(memory->bg_gfx);
239
 	free(memory->bg_gfx);
157
 	free(memory->cloud_map);
249
 	free(memory->cloud_map);
158
 }
250
 }
159
 
251
 
160
-void setup_scrolling()
252
+void met_setup_scrolling()
161
 {
253
 {
162
 	lcd_io_set_func(0x14, 0x0);
254
 	lcd_io_set_func(0x14, 0x0);
163
 	lcd_io_set_func(0x16, 0x0);
255
 	lcd_io_set_func(0x16, 0x0);
167
 	lcd_io_set_func(0x1E, 0x0);
259
 	lcd_io_set_func(0x1E, 0x0);
168
 }
260
 }
169
 
261
 
170
-void setup_palettes()
262
+void met_setup_palettes()
171
 {
263
 {
172
 	wram_decompress((void*)met_skyPal, palette_unfaded_buffer + PALETTE_SKY*32);
264
 	wram_decompress((void*)met_skyPal, palette_unfaded_buffer + PALETTE_SKY*32);
173
 	wram_decompress((void*)met_cloudsPal, palette_unfaded_buffer + PALETTE_CLOUD*32);
265
 	wram_decompress((void*)met_cloudsPal, palette_unfaded_buffer + PALETTE_CLOUD*32);
175
 	wram_decompress((void*)met_backgroundPal, palette_unfaded_buffer + PALETTE_BG*32);
267
 	wram_decompress((void*)met_backgroundPal, palette_unfaded_buffer + PALETTE_BG*32);
176
 }
268
 }
177
 
269
 
178
-void setup_vram()
270
+void met_setup_vram()
179
 {
271
 {
180
 	gpu_tile_bg_drop_all_sets(0);
272
 	gpu_tile_bg_drop_all_sets(0);
181
 	gpu_tile_bg_drop_all_sets(1);
273
 	gpu_tile_bg_drop_all_sets(1);
190
 	gpu_bg_show(3);
282
 	gpu_bg_show(3);
191
 
283
 
192
 	gpu_sync_bg_visibility_and_mode();
284
 	gpu_sync_bg_visibility_and_mode();
193
-
194
-	setup_scrolling();
285
+	met_setup_scrolling();
195
 
286
 
196
 	//copy tilesets
287
 	//copy tilesets
197
 	memory->bg_gfx = malloc(0x40);
288
 	memory->bg_gfx = malloc(0x40);
210
 	wram_decompress((void*)met_skyTiles, memory->sky_gfx);
301
 	wram_decompress((void*)met_skyTiles, memory->sky_gfx);
211
 	gpu_copy_to_vram_by_bgid(3, memory->sky_gfx,0x7A0,0,1);
302
 	gpu_copy_to_vram_by_bgid(3, memory->sky_gfx,0x7A0,0,1);
212
 
303
 
213
-
214
-
215
-
304
+        
216
 	//copy tilemaps
305
 	//copy tilemaps
217
 	memory->bg_map = malloc(0x500);
306
 	memory->bg_map = malloc(0x500);
218
 	wram_decompress((void*)met_backgroundMap, memory->bg_map);
307
 	wram_decompress((void*)met_backgroundMap, memory->bg_map);
230
 	wram_decompress((void*)met_skyMap, memory->sky_map);
319
 	wram_decompress((void*)met_skyMap, memory->sky_map);
231
 	gpu_copy_to_vram_by_bgid(3, memory->sky_map,0x500,0,2);
320
 	gpu_copy_to_vram_by_bgid(3, memory->sky_map,0x500,0,2);
232
 
321
 
233
-
234
-	//copy palettes
235
-	//pal_decompress_slice_to_faded_and_unfaded((void*)met_skyPal, 16, 32);
236
-	//pal_decompress_slice_to_faded_and_unfaded((void*)met_foregroundPal, 48, 32);
237
-	//pal_decompress_slice_to_faded_and_unfaded((void*)met_cloudsPal, 32, 32);
238
-	setup_palettes();
322
+	met_setup_palettes();
239
 
323
 
240
 	//setup oam
324
 	//setup oam
241
 	obj_delete_all();
325
 	obj_delete_all();
251
 	memory->animate_clouds = 1;
335
 	memory->animate_clouds = 1;
252
 }
336
 }
253
 
337
 
254
-void update_screen()
338
+void met_update_screen()
255
 {
339
 {
256
 	fade_update();
340
 	fade_update();
257
 	task_exec();
341
 	task_exec();

+ 26
- 13
src/specials/cutscene_meteor.h View File

1
+/****************************************************************************
2
+ * Copyright (C) 2015-2016 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
1
 #ifndef CUTSCENE_METEOR_H_
23
 #ifndef CUTSCENE_METEOR_H_
2
 #define CUTSCENE_METEOR_H_
24
 #define CUTSCENE_METEOR_H_
3
 
25
 
4
-#include "../assets/meteor/met_background.h"
5
-#include "../assets/meteor/met_foreground.h"
6
-#include "../assets/meteor/met_sky.h"
7
-#include "../assets/meteor/met_meteor.h"
8
-#include "../assets/meteor/met_clouds.h"
9
-#include <bpre.h>
10
-
11
-void play_meteor();
12
-void setup_vram();
13
-void cutscene();
14
-void update_screen();
15
-void meteor_callback(struct obj_entity* self);
16
-void end_playback();
26
+/**
27
+ * @brief initiates the animation
28
+ */
29
+void met_play();
17
 
30
 
18
 #endif
31
 #endif