Kaynağa Gözat

refractor special file and add rival name copy special

SBird1337 7 yıl önce
ebeveyn
işleme
d4b82971fb

+ 0
- 78
.vscode/c_cpp_properties.json Dosyayı Görüntüle

@@ -1,78 +0,0 @@
1
-{
2
-    "configurations": [
3
-        {
4
-            "name": "Mac",
5
-            "includePath": [
6
-                "${workspaceRoot}",
7
-                "/usr/include",
8
-                "/usr/local/include",
9
-                "src/include"
10
-            ],
11
-            "defines": [],
12
-            "browse": {
13
-                "path": [
14
-                    "/usr/include",
15
-                    "/usr/local/include",
16
-                    "src/include",
17
-                    "${workspaceRoot}"
18
-                ],
19
-                "limitSymbolsToIncludedHeaders": true,
20
-                "databaseFilename": ""
21
-            },
22
-            "intelliSenseMode": "clang-x64"
23
-        },
24
-        {
25
-            "name": "Linux",
26
-            "includePath": [
27
-                "${workspaceRoot}",
28
-                "/usr/include",
29
-                "/usr/local/include",
30
-                "src/include"
31
-            ],
32
-            "defines": [],
33
-            "browse": {
34
-                "path": [
35
-                    "/usr/include",
36
-                    "/usr/local/include",
37
-                    "$(workspaceRoot)/src/include",
38
-                    "$(workspaceRoot}/g3headers/include",
39
-                    "$(workspaceRoot}/generated_image"
40
-                ],
41
-                "limitSymbolsToIncludedHeaders": true,
42
-                "databaseFilename": ""
43
-            },
44
-            "intelliSenseMode": "clang-x64"
45
-        },
46
-        {
47
-            "name": "Win32",
48
-            "includePath": [
49
-                "${workspaceRoot}",
50
-                "E:/Visual Studio 2015/VC/include/*",
51
-                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/um",
52
-                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt",
53
-                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/shared",
54
-                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/winrt",
55
-                "src/include"
56
-            ],
57
-            "defines": [
58
-                "_DEBUG",
59
-                "UNICODE"
60
-            ],
61
-            "browse": {
62
-                "path": [
63
-                    "E:/Visual Studio 2015/VC/include/*",
64
-                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/um",
65
-                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt",
66
-                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/shared",
67
-                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/winrt",
68
-                    "src/include",
69
-                    "${workspaceRoot}"
70
-                ],
71
-                "limitSymbolsToIncludedHeaders": true,
72
-                "databaseFilename": ""
73
-            },
74
-            "intelliSenseMode": "msvc-x64"
75
-        }
76
-    ],
77
-    "version": 2
78
-}

+ 0
- 18
.vscode/launch.json Dosyayı Görüntüle

@@ -1,18 +0,0 @@
1
-{
2
-    "version": "0.2.0",
3
-    "configurations": [
4
-        {
5
-            "type": "gdb",
6
-            "request": "attach",
7
-            "name": "Debug",
8
-            "preLaunchTask": "start",
9
-            "executable": "object/linked.o",
10
-            "gdbpath": "arm-none-eabi-gdb",
11
-            "target": "localhost:2345",
12
-            "remote": true,
13
-            "cwd": "${workspaceRoot}",
14
-            "autorun": [
15
-            ]
16
-        }
17
-    ]
18
-}

+ 0
- 165
.vscode/settings.json Dosyayı Görüntüle

@@ -1,165 +0,0 @@
1
-{
2
-    "files.associations": {
3
-        "filesystem": "cpp",
4
-        "regex": "cpp",
5
-        "xlocmon": "cpp",
6
-        "functional": "cpp",
7
-        "chrono": "cpp",
8
-        "future": "cpp",
9
-        "random": "cpp",
10
-        "ratio": "cpp",
11
-        "scoped_allocator": "cpp",
12
-        "tuple": "cpp",
13
-        "type_traits": "cpp",
14
-        "utility": "cpp",
15
-        "xmemory0": "cpp",
16
-        "xstddef": "cpp",
17
-        "xtr1common": "cpp",
18
-        "xutility": "cpp",
19
-        "ios": "cpp",
20
-        "iosfwd": "cpp",
21
-        "sstream": "cpp",
22
-        "strstream": "cpp",
23
-        "system_error": "cpp",
24
-        "typeindex": "cpp",
25
-        "xlocale": "cpp",
26
-        "array": "cpp",
27
-        "bitset": "cpp",
28
-        "deque": "cpp",
29
-        "forward_list": "cpp",
30
-        "initializer_list": "cpp",
31
-        "iterator": "cpp",
32
-        "list": "cpp",
33
-        "map": "cpp",
34
-        "queue": "cpp",
35
-        "set": "cpp",
36
-        "stack": "cpp",
37
-        "unordered_map": "cpp",
38
-        "unordered_set": "cpp",
39
-        "vector": "cpp",
40
-        "xhash": "cpp",
41
-        "xstring": "cpp",
42
-        "xtree": "cpp",
43
-        "xiosbase": "cpp",
44
-        "xfunctional": "cpp",
45
-        "streambuf": "cpp",
46
-        "xlocmes": "cpp",
47
-        "memory": "cpp",
48
-        "xlocbuf": "cpp",
49
-        "atomic": "cpp",
50
-        "valarray": "cpp",
51
-        "locale": "cpp",
52
-        "thread": "cpp",
53
-        "xlocnum": "cpp",
54
-        "xloctime": "cpp",
55
-        "corecrt_io.h": "c",
56
-        "corecrt_wio.h": "c",
57
-        "ocidl.h": "c",
58
-        "wingdi.h": "c",
59
-        "m4a.h": "c",
60
-        "background.h": "c",
61
-        "sprites.h": "c",
62
-        "berry.h": "c",
63
-        "fieldmap.h": "c",
64
-        "flash_internal.h": "c",
65
-        "m4a_internal.h": "c",
66
-        "types.h": "c",
67
-        "sprite.h": "c",
68
-        "lcd.h": "c",
69
-        "objects.h": "c",
70
-        "map.h": "c",
71
-        "dns_core.h": "c",
72
-        "task.h": "c",
73
-        "xkeycheck.h": "c",
74
-        "pkmn_bank.h": "c",
75
-        "bios.h": "c",
76
-        "gba_video.h": "c",
77
-        "compression.h": "c",
78
-        "switch_bg.h": "c",
79
-        "flags.h": "c",
80
-        "battle_structs.h": "c",
81
-        "palette.h": "c",
82
-        "string.h": "c",
83
-        "callback.h": "c",
84
-        "gba_types.h": "c",
85
-        "text.h": "c",
86
-        "base.h": "c",
87
-        "oam_types.h": "c",
88
-        "debug.h": "c",
89
-        "common.h": "c",
90
-        "ole.h": "c",
91
-        "oleidl.h": "c",
92
-        "battle_state.h": "c",
93
-        "crtdbg.h": "c",
94
-        "useful-bped.h": "c",
95
-        "pokeagb.h": "c",
96
-        "graphics.h": "c",
97
-        "version.h": "c",
98
-        "core.h": "c",
99
-        "pokemon.h": "c",
100
-        "save.h": "c",
101
-        "battle.h": "c",
102
-        "overworld.h": "c",
103
-        "audio.h": "c",
104
-        "memory.h": "c",
105
-        "io.h": "c",
106
-        "battle_pick_message.h": "c",
107
-        "battle_abilities.h": "c",
108
-        "moves.h": "c",
109
-        "pkmn_bank_stats.h": "c",
110
-        "constants.h": "c",
111
-        "math.h": "c",
112
-        "objidl.h": "c",
113
-        "objidlbase.h": "c",
114
-        "winuser.h": "c",
115
-        "winnt.h": "c",
116
-        "internal.h": "c",
117
-        "item.h": "c",
118
-        "evolution.h": "c",
119
-        "move.h": "c",
120
-        "game_engine.h": "c",
121
-        "agile.h": "c",
122
-        "xtgmath.h": "c",
123
-        "stdbool.h": "c",
124
-        "stdint.h": "c",
125
-        "grass_bg.h": "c",
126
-        "fade.h": "c",
127
-        "block.h": "c",
128
-        "gba_keys.h": "c",
129
-        "data.h": "c",
130
-        "ability.h": "c",
131
-        "battle_common.h": "c",
132
-        "nb30.h": "c",
133
-        "trainer.h": "c",
134
-        "decoration.h": "c",
135
-        "link.h": "c",
136
-        "vcruntime_typeinfo.h": "c",
137
-        "msxml.h": "c",
138
-        "wmp.h": "c",
139
-        "minwindef.h": "c",
140
-        "corecrt.h": "c",
141
-        "vcruntime.h": "c",
142
-        "virtual_map.h": "c",
143
-        "wincrypt.h": "c",
144
-        "gba_compress.h": "c",
145
-        "windef.h": "c",
146
-        "wtypes.h": "c",
147
-        "effects.h": "c",
148
-        "npc.h": "c",
149
-        "global.h": "c",
150
-        "save_one.h": "c",
151
-        "type.h": "c",
152
-        "pkmn_types.h": "c",
153
-        "type_icons.h": "c",
154
-        "ppltasks.h": "c",
155
-        "stat.h": "c",
156
-        "pokedex.h": "c",
157
-        "config.h": "c",
158
-        "agb_debug.h": "c",
159
-        "met_background.h": "c",
160
-        "met_clouds.h": "c",
161
-        "met_sky.h": "c",
162
-        "met_meteor.h": "c",
163
-        "met_foreground.h": "c"
164
-    }
165
-}

+ 0
- 27
.vscode/tasks.json Dosyayı Görüntüle

@@ -1,27 +0,0 @@
1
-{
2
-    "version": "2.0.0",
3
-    "command": "C:/cygwin64/bin/bash",
4
-    "args": ["-lc", "make"],
5
-    "suppressTaskName": true,
6
-    "tasks": [
7
-        {
8
-            "type": "shell",
9
-            "group": "build",
10
-            "taskName": "build",
11
-            "args": [],
12
-            "problemMatcher": [],
13
-            "presentation": {
14
-                "reveal": "always",
15
-                "echo": true
16
-            }
17
-        },
18
-        {
19
-            "type": "shell",
20
-            "group": "none",
21
-            "taskName": "start",
22
-            "command": "~/sots/source_of_the_sovereign/debug.sh",
23
-            "args":[],
24
-            "problemMatcher": []
25
-        }
26
-    ]
27
-}

+ 1
- 1
sots-private

@@ -1 +1 @@
1
-Subproject commit 7c0c2b2e5f9fde3cf3796734b3c4b85d3cf12f36
1
+Subproject commit 78e9ed7d9d986b5ecfbbd607f2ca935b67ab5338

+ 0
- 2
src/include/config.h Dosyayı Görüntüle

@@ -1,5 +1,3 @@
1
-#include "pkmn_types.h"
2
-
3 1
 #ifndef CONFIG_S_
4 2
 #define CONFIG_S_
5 3
 

+ 21
- 8
src/specials/custom_specials.c Dosyayı Görüntüle

@@ -32,11 +32,11 @@
32 32
 
33 33
 #include "camera_move.h"
34 34
 #include "cutscene_meteor.h"
35
-#include <callback.h>
36 35
 #include <config.h>
37
-#include <debug.h>
38
-#include <game_engine.h>
39
-#include <math.h>
36
+#include <pokeagb/pokeagb.h>
37
+
38
+/* === TYPES === */
39
+typedef void (*special_func)();
40 40
 
41 41
 /* === PROTOTYPES === */
42 42
 
@@ -71,17 +71,30 @@ void get_text_pointer_from_lookup();
71 71
 
72 72
 void sp_check_tileset();
73 73
 
74
+void sp_set_rival(void);
75
+
74 76
 extern void sp_crystal_fade(void);
75 77
 
78
+extern pchar name_rival_male[5];
79
+extern pchar name_rival_female[5];
80
+
76 81
 /* === STATICS === */
77 82
 
78
-static callback special_routines[9] = {
79
-    met_play,         cam_sp_move_camera, sp_init_script,  debug_some_test, sp_dns_switch,
80
-    sp_random_number, sp_check_tileset,   sp_batchmaptile, sp_crystal_fade,
83
+static special_func special_routines[10] = {
84
+    met_play,         cam_sp_move_camera, sp_init_script,  NULL, sp_dns_switch,
85
+    sp_random_number, sp_check_tileset,   sp_batchmaptile, sp_crystal_fade, sp_set_rival,
81 86
 };
82 87
 
83 88
 /* === IMPLEMENTATIONS === */
84 89
 
90
+void sp_set_rival(void) {
91
+    if (saveblock2->gender == GENDER_MALE) {
92
+        pstrcpy(&(saveblock1->rival_name[0]), &name_rival_female[0]);
93
+    } else {
94
+        pstrcpy(&(saveblock1->rival_name[0]), &name_rival_male[0]);
95
+    }
96
+}
97
+
85 98
 void sp_dns_switch() {
86 99
     volatile u8 *test_pointer = (u8 *)(0x0203FAB0);
87 100
     *(test_pointer + 1) = (*(test_pointer + 1) == 3 ? 0 : (*(test_pointer + 1)) + 1);
@@ -112,4 +125,4 @@ void sp_clear_variables() {
112 125
     return;
113 126
 }
114 127
 
115
-void sp_random_number() { var_set(0x800D, (random() % var_get(0x8000))); }
128
+void sp_random_number() { var_set(0x800D, (rand() % var_load(0x8000))); }