/[projet1]/public/oric/games/Space 1999/Sources/trailer/Main.c
Defence Force logotype

Contents of /public/oric/games/Space 1999/Sources/trailer/Main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 365 - (show annotations)
Mon Jul 19 10:58:27 2010 UTC (9 years, 3 months ago) by dbug
File MIME type: text/plain
File size: 7251 byte(s)
Added the Space:1999 Trailer to the repository.

1
2 #include <lib.h>
3
4 // --------------------------------------
5 // Space: 1999
6 // The Game Trailer
7 // --------------------------------------
8 // (c) 2010 Mickael Pointier.
9 // This code is provided as-is.
10 // I do not assume any responsability
11 // concerning the fact this is a bug-free
12 // software !!!
13 // Except that, you can use this example
14 // without any limitation !
15 // If you manage to do something with that
16 // please, contact me :)
17 // --------------------------------------
18 // For more information, please contact me
19 // on internet:
20 // e-mail: mike@defence-force.org
21 // URL: http://www.defence-force.org
22 // --------------------------------------
23 // Note: This text was typed with a Win32
24 // editor. So perhaps the text will not be
25 // displayed correctly with other OS.
26
27 // http://www.space1999.net/catacombs/main/pguide/up10.html <- Good pictures !
28
29 //#define ENABLE_TESTS
30
31 #define ENABLE_MUSIC
32 #define ENABLE_RATING
33 #define ENABLE_QUOTES
34 #define ENABLE_ITC_LOGO
35 #define ENABLE_DEFENCEFORCE_LOGO
36 #define ENABLE_SPACE1999_LOGO
37 #define ENABLE_CREDIT_PICTURES
38
39
40 // Sequences.s
41 void SequenceRating();
42 void SequenceQuotes();
43 void SequenceItcLogo();
44 void SequenceSpace1999Logo();
45 void SequenceDefenceForceLogo();
46 void SequenceMartinLandau();
47 void SequenceBarbaraBain();
48 void SequenceBarryMorse();
49 void SequenceSylviaAnderson();
50 void SequenceGerryAnderson();
51
52 void SequenceChema();
53 void SequenceTwilighte();
54 void SequenceDbug();
55
56 void SequenceMoonExplodes();
57
58 void SequenceEmergency();
59
60 void SequenceEndMessage();
61
62 void SequenceThisEpisode();
63 void Sequence13September1999();
64
65 void SetInkYellow();
66 void SetInkBlack();
67
68 void UnpackFont();
69
70 // Tables.s
71
72 extern unsigned char BufferUnpack[8000];
73
74 extern unsigned char CosTable[];
75
76 void TablesInit();
77 void CreateHalfDisc();
78 void GenerateSquareTables();
79 void MirrorTheDisc();
80
81 // Display.s
82 void DisplayDefenceForceFrame();
83 void DisplayMakeShiftedLogos();
84 void DisplayScrappIt();
85
86 // Bitmap.s
87 void FontInit();
88 void BlackScreen();
89 void DrawCar();
90
91 // Draw.s
92 extern unsigned char X0,X1,Y;
93 extern unsigned char CX,CY,RAY;
94
95 extern unsigned char FrameCounter;
96 extern unsigned char TimerCounter;
97
98 void DrawDisc();
99 void FlipToScreen();
100
101 extern unsigned char FontTableX0[];
102 extern unsigned char FontTableY0[];
103 extern unsigned char FontTableWidth[];
104 extern unsigned char FontTableHeight[];
105 extern unsigned char TableBit6Reverse[];
106
107 extern char Message_StarringBarbaraBain[];
108 extern char Message_StarringMartinLandau[];
109 extern char Message_StarringBarryMorse[];
110 extern char Message_SylviaAnderson[];
111 extern char Message_GerryAnderson[];
112 extern char Message_Chema[];
113 extern char Message_Dbug[];
114 extern char Message_Music[];
115 extern char Message_Twilighte[];
116
117 extern char Message_Exclusive[];
118 extern char Message_Title[];
119 extern char Message_Website[];
120 extern char Message_Quote1[];
121 extern char Message_Quote2[];
122 extern char Message_Quote3[];
123 extern char Message_Quote4[];
124
125
126 extern char FontChars[];
127 extern unsigned char FontCharOffset;
128
129 extern unsigned char FontIndex[];
130
131 extern unsigned char X;
132 extern unsigned char Y;
133 extern unsigned char CAR;
134
135 // Auxiliar
136 extern void switch_ovl(void);
137
138 unsigned char gShadingAngle=0;
139
140
141 // part three, filter out the part of the cycling which are hidden by graphics
142 void FilterTheDisc1();
143 void FilterTheDisc2();
144
145
146
147 void DisplayPaperSet();
148 int counter; // That one as a local trashes the music
149
150
151 extern unsigned char BoomColorBase;
152 extern unsigned char GlowColor[6];
153 extern unsigned char BoomColorMinus16[37+16];
154 extern unsigned char BoomColor[37];
155
156 void DrawNuclearBoom();
157
158 void UnpackToBuffer(void *pPackedData)
159 {
160 file_unpack(BufferUnpack,pPackedData);
161 }
162
163
164 unsigned char yscroll;
165 unsigned char* ptrscroll;
166
167 void MoonScrollsDown()
168 {
169 gShadingAngle=64;
170
171 //BlackScreen();
172
173 //UnpackToBuffer(LabelPictureLogo);
174 //BlitRectangle((unsigned char*)0xa000+(40*89),BufferUnpack+(40*89),40,111);
175
176 FrameCounter=64;
177 while (FrameCounter--)
178 {
179 yscroll=112;
180 ptrscroll=(unsigned char*)0xa000+(40*197);
181
182 RAY=20;
183 CX=120;
184 CY=50;
185
186 DrawDisc();
187
188 gShadingAngle+=3;
189
190 while (yscroll)
191 {
192 memcpy(ptrscroll+80,ptrscroll,80);
193 ptrscroll-=80;
194 yscroll-=2;
195 }
196 }
197 }
198
199 /*
200 void MoonZoomer()
201 {
202 RAY=1;
203 CX=120;
204 CY=100;
205
206 gShadingAngle=64;
207
208 while (1)
209 {
210 //RAY=1;
211 DrawDisc();
212 //draw_disc();
213
214 //printf("%d\n",gShadingAngle);
215 if (RAY<64)
216 {
217 RAY++;
218 }
219 if (RAY>30)
220 {
221 gShadingAngle+=3;
222 }
223 if (RAY==64)
224 {
225 break;
226 }
227 }
228 }
229 */
230
231
232
233
234
235 void main()
236 {
237 //paper(0);
238 hires();
239
240 switch_ovl();
241
242 init_irq_routine();
243
244 TablesInit();
245 FontInit();
246
247 #ifdef ENABLE_TESTS
248 {
249 // Tests
250 while (1)
251 {
252 SequenceMoonExplodes();
253 }
254 SequenceEmergency();
255 SequenceDefenceForceLogo();
256 SequenceThisEpisode();
257 Sequence13September1999();
258 SequenceRating();
259 SequenceTwilighte();
260 SequenceSylviaAnderson();
261 SequenceBarbaraBain();
262 SequenceQuotes();
263 SequenceGerryAnderson();
264 SequenceDbug();
265 SequenceBarryMorse();
266 SequenceChema();
267 while (1);
268 }
269 #endif
270
271 #ifdef ENABLE_RATING
272 //
273 // Need some kind of "all audience advisory" whatnots
274 //
275 SequenceRating();
276 //while (1);
277 #endif
278
279
280 #ifdef ENABLE_QUOTES
281 //
282 // Start by some quotes - no music
283 //
284 SequenceQuotes();
285 #endif
286
287
288 #ifdef ENABLE_MUSIC
289 //
290 // Start the music
291 //
292 PlayMainTune();
293 #endif
294
295
296 #ifdef ENABLE_ITC_LOGO
297 //
298 // ITC entertainment logo
299 //
300 SequenceItcLogo();
301 #endif
302
303 #ifdef ENABLE_CREDIT_PICTURES
304 //
305 // Starring Martin Landau
306 //
307 SequenceMartinLandau();
308
309 //
310 // Starring Barbara Bain
311 //
312 SequenceBarbaraBain();
313 #endif
314
315 #ifdef ENABLE_SPACE1999_LOGO
316 //
317 // Space:1999 title picture
318 //
319 SequenceSpace1999Logo();
320 #endif
321
322 //
323 // Emergency RED ALERT
324 //
325 SequenceEmergency();
326
327 #ifdef ENABLE_CREDIT_PICTURES
328 // ---- This Episode yellow message
329 //
330 // This episode
331 //
332 SequenceThisEpisode();
333
334 //
335 // designer/programmer Jose Maria "Chema" Enguita
336 //
337 SequenceChema();
338 #endif
339
340 #ifdef ENABLE_DEFENCEFORCE_LOGO
341 //
342 // Show the animated logo
343 //
344 SequenceDefenceForceLogo();
345 #endif
346
347 #ifdef ENABLE_CREDIT_PICTURES
348 // Original theme - Barry Gray
349 // adaptation Jonathan "Twilighte" Bristow
350 SequenceTwilighte();
351
352 // ---- This Episode yellow message
353 //
354 // This episode
355 //
356 SequenceThisEpisode();
357
358 //
359 // Also starring Barry Morse
360 //
361 SequenceBarryMorse();
362
363 //
364 // Producer Sylvia Anderson
365 //
366 SequenceSylviaAnderson();
367
368 //
369 // Executive producer Gerry Anderson
370 //
371 SequenceGerryAnderson();
372
373 //
374 // in fast succession:
375 // - September
376 // - 13th
377 // - 1999
378 //
379 Sequence13September1999();
380
381 //
382 // Explosion on the moon
383 // The moon base alpha scroll downs with the earth standing still
384 //
385 SequenceMoonExplodes();
386
387 //
388 // intro Mickael "Dbug" Pointier
389 //
390 SequenceDbug();
391 #endif
392
393 StopMusic();
394
395 //
396 // Out Of Memory title message
397 //
398 SequenceEndMessage();
399
400 while (1);
401
402 BlackScreen();
403 while (1);
404
405 }
406

  ViewVC Help
Powered by ViewVC 1.1.26