1 | #include <string.h> |
2 | #include <stddef.h> |
3 | #include <stdio.h> |
4 | #include "demos.h" |
5 | #include "api.h" |
6 | |
7 | #if defined (TIC_BUILD_WITH_LUA) |
8 | static const u8 LuaDemoRom[] = |
9 | { |
10 | #include "../build/assets/luademo.tic.dat" |
11 | }; |
12 | static const u8 LuaMarkRom[] = |
13 | { |
14 | #include "../build/assets/luamark.tic.dat" |
15 | }; |
16 | tic_script_config_extra = |
17 | { |
18 | .name = "lua" , |
19 | .demoRom = LuaDemoRom, |
20 | .demoRomSize = sizeof LuaDemoRom, |
21 | .markRom = LuaMarkRom, |
22 | .markRomSize = sizeof LuaMarkRom, |
23 | }; |
24 | #endif |
25 | |
26 | #if defined (TIC_BUILD_WITH_MOON) |
27 | static const u8 MoonDemoRom[] = |
28 | { |
29 | #include "../build/assets/moondemo.tic.dat" |
30 | }; |
31 | static const u8 MoonMarkRom[] = |
32 | { |
33 | #include "../build/assets/moonmark.tic.dat" |
34 | }; |
35 | tic_script_config_extra = |
36 | { |
37 | .name = "moon" , |
38 | .demoRom = MoonDemoRom, |
39 | .demoRomSize = sizeof MoonDemoRom, |
40 | .markRom = MoonMarkRom, |
41 | .markRomSize = sizeof MoonMarkRom, |
42 | }; |
43 | #endif |
44 | |
45 | #if defined (TIC_BUILD_WITH_FENNEL) |
46 | static const u8 FennelDemoRom[] = |
47 | { |
48 | #include "../build/assets/fenneldemo.tic.dat" |
49 | }; |
50 | /* does not exists |
51 | static const u8 FennelMarkRom[] = |
52 | { |
53 | #include "../build/assets/fennelmark.tic.dat" |
54 | }; |
55 | */ |
56 | |
57 | tic_script_config_extra = |
58 | { |
59 | .name = "fennel" , |
60 | .demoRom = FennelDemoRom, |
61 | .demoRomSize = sizeof FennelDemoRom, |
62 | .markRom = NULL, |
63 | .markRomSize = 0, |
64 | }; |
65 | #endif |
66 | |
67 | |
68 | #if defined(TIC_BUILD_WITH_JS) |
69 | |
70 | static const u8 JsDemoRom[] = |
71 | { |
72 | #include "../build/assets/jsdemo.tic.dat" |
73 | }; |
74 | |
75 | static const u8 jsmark[] = |
76 | { |
77 | #include "../build/assets/jsmark.tic.dat" |
78 | }; |
79 | |
80 | tic_script_config_extra = |
81 | { |
82 | .name = "js" , |
83 | .demoRom = JsDemoRom, |
84 | .demoRomSize = sizeof JsDemoRom, |
85 | .markRom = jsmark, |
86 | .markRomSize = sizeof jsmark, |
87 | }; |
88 | |
89 | #endif |
90 | |
91 | #if defined(TIC_BUILD_WITH_MRUBY) |
92 | |
93 | static const u8 RubyDemoRom[] = |
94 | { |
95 | #include "../build/assets/rubydemo.tic.dat" |
96 | }; |
97 | |
98 | static const u8 rubymark[] = |
99 | { |
100 | #include "../build/assets/rubymark.tic.dat" |
101 | }; |
102 | |
103 | tic_script_config_extra MRubySyntaxConfigExtra = |
104 | { |
105 | .name = "ruby" , |
106 | .demoRom = RubyDemoRom, |
107 | .demoRomSize = sizeof RubyDemoRom, |
108 | .markRom = rubymark, |
109 | .markRomSize = sizeof rubymark, |
110 | }; |
111 | |
112 | #endif |
113 | |
114 | #if defined(TIC_BUILD_WITH_WREN) |
115 | |
116 | static const u8 WrenDemoRom[] = |
117 | { |
118 | #include "../build/assets/wrendemo.tic.dat" |
119 | }; |
120 | |
121 | static const u8 wrenmark[] = |
122 | { |
123 | #include "../build/assets/wrenmark.tic.dat" |
124 | }; |
125 | |
126 | tic_script_config_extra = |
127 | { |
128 | .name = "wren" , |
129 | .demoRom = WrenDemoRom, |
130 | .demoRomSize = sizeof WrenDemoRom, |
131 | .markRom = wrenmark, |
132 | .markRomSize = sizeof wrenmark, |
133 | }; |
134 | |
135 | #endif |
136 | |
137 | #if defined (TIC_BUILD_WITH_SQUIRREL) |
138 | static const u8 SquirrelDemoRom[] = |
139 | { |
140 | #include "../build/assets/squirreldemo.tic.dat" |
141 | }; |
142 | |
143 | static const u8 squirrelmark[] = |
144 | { |
145 | #include "../build/assets/squirrelmark.tic.dat" |
146 | }; |
147 | tic_script_config_extra = |
148 | { |
149 | .name = "squirrel" , |
150 | .demoRom = SquirrelDemoRom, |
151 | .demoRomSize = sizeof SquirrelDemoRom, |
152 | .markRom = squirrelmark, |
153 | .markRomSize = sizeof squirrelmark, |
154 | }; |
155 | #endif |
156 | |
157 | |
158 | #if defined(TIC_BUILD_WITH_WASM) |
159 | |
160 | static const u8 WasmDemoRom[] = |
161 | { |
162 | #include "../build/assets/wasmdemo.tic.dat" |
163 | }; |
164 | |
165 | static const u8 wasmmark[] = |
166 | { |
167 | #include "../build/assets/wasmmark.tic.dat" |
168 | }; |
169 | |
170 | tic_script_config_extra = |
171 | { |
172 | .name = "wasm" , |
173 | .demoRom = WasmDemoRom, |
174 | .demoRomSize = sizeof WasmDemoRom, |
175 | .markRom = wasmmark, |
176 | .markRomSize = sizeof wasmmark, |
177 | }; |
178 | |
179 | #endif |
180 | |
181 | tic_script_config_extra* (const tic_script_config* config) |
182 | { |
183 | |
184 | for (tic_script_config_extra** conf = LanguagesExtra ; *conf != NULL; conf++ ) { |
185 | tic_script_config_extra* ln = *conf; |
186 | if (strcmp(config->name, ln->name) == 0) |
187 | { |
188 | return ln; |
189 | } |
190 | } |
191 | return NULL; |
192 | } |
193 | |
194 | tic_script_config_extra* [] = { |
195 | #if defined(TIC_BUILD_WITH_LUA) |
196 | &LuaSyntaxConfigExtra, |
197 | #endif |
198 | #if defined(TIC_BUILD_WITH_MOON) |
199 | &MoonSyntaxConfigExtra, |
200 | #endif |
201 | #if defined(TIC_BUILD_WITH_FENNEL) |
202 | &FennelSyntaxConfigExtra, |
203 | #endif |
204 | #if defined(TIC_BUILD_WITH_WREN) |
205 | &WrenSyntaxConfigExtra, |
206 | #endif |
207 | #if defined(TIC_BUILD_WITH_SQUIRREL) |
208 | &SquirrelSyntaxConfigExtra, |
209 | #endif |
210 | #if defined(TIC_BUILD_WITH_JS) |
211 | &JsSyntaxConfigExtra, |
212 | #endif |
213 | #if defined(TIC_BUILD_WITH_MRUBY) |
214 | &MRubySyntaxConfigExtra, |
215 | #endif |
216 | #if defined(TIC_BUILD_WITH_WASM) |
217 | &WasmSyntaxConfigExtra, |
218 | #endif |
219 | NULL |
220 | }; |
221 | |
222 | |
223 | |