/[projet1]/users/chema/1337intro/main.c
Defence Force logotype

Contents of /users/chema/1337intro/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 390 - (show annotations)
Mon Sep 6 17:22:30 2010 UTC (9 years, 7 months ago) by Chema
File MIME type: text/plain
File size: 3444 byte(s)
More (final?) tweaks, changed the "An exclusive..", and put starfield back on 1337 logo and starwars crawl...
1 #include <stdio.h>
2 #include "oobj3d/obj3d.h"
3
4 #define A_FWBLACK 0
5 #define A_FWRED 1
6 #define A_FWGREEN 2
7 #define A_FWYELLOW 3
8 #define A_FWBLUE 4
9 #define A_FWMAGENTA 5
10 #define A_FWCYAN 6
11 #define A_FWWHITE 7
12 #define A_BGBLACK 16
13 #define A_BGRED 17
14 #define A_BGGREEN 18
15 #define A_BGYELLOW 19
16 #define A_BGBLUE 20
17 #define A_BGMAGENTA 21
18 #define A_BGCYAN 22
19 #define A_BGWHITE 23
20
21
22
23 // tables.s
24 void TablesInit();
25
26 // -------------
27
28 // Starwars.s
29
30 extern unsigned int position;
31
32 void RasterizeInitScanlineBuffer();
33 void RasterizeNextLineMapping();
34 void RasterizeScroller();
35
36 // -------------
37
38 extern unsigned char XIncTableLow[256];
39 extern unsigned char XIncTableHigh[256];
40
41 extern unsigned char EmptyTextureLine[16];
42
43
44
45 void ComputeDivTable()
46 {
47 int y;
48 unsigned char dst_w;
49 unsigned int x_inc;
50
51 dst_w=2;
52 for (y=1;y<128;y++)
53 {
54 x_inc=((((unsigned int)(128)<<8))/dst_w);
55
56 XIncTableLow[y] =(x_inc&255);
57 XIncTableHigh[y]=(x_inc>>8);
58
59 dst_w+=2;
60 }
61 }
62
63
64
65
66
67 /* Prototipes */
68
69 typedef struct t_obj
70 {
71 int CenterX,CenterY,CenterZ;
72 void * objp;
73 char ID;
74 char User;
75 char XRem, YRem, ZRem;
76 char orientation[18];
77 }t_obj;
78
79
80 extern t_obj * pointer;
81
82 extern void * LabelPictureFont;
83 extern void * BufferUnpack;
84 char X,Y,x,y;
85
86 char * p;
87
88
89 void launch_game();
90
91 main()
92 {
93 switch_ovl();
94 InitIRQ();
95
96 DoubleBuffOff();
97 GenerateExtraTables();
98 SequenceDefenceForceLogo();
99 //Wait(8);
100
101 init_disk();
102 load_overlay();
103
104 InitIRQ();
105
106 DoubleBuffOn();
107 FontUnpack();
108 DoubleBuffOff();
109 FontInit();
110
111 CreditsElite();
112 Wait(15);
113
114 InitMusic();
115
116 clr_all();
117
118 //goto kk;
119
120 p=(char *)(0xa000+40*49);
121 *p=A_BGBLUE;
122 p=(char *)(0xa000+40*151);
123 *p=A_BGBLUE;
124
125 InitTestCode();
126
127 Test1337();
128 EmptyObj3D();
129 DoubleBuffOff();
130
131 SWTablesInit();
132 ComputeDivTable();
133 RasterizeInitScanlineBuffer();
134 position=0;
135 while (position<323)
136 {
137 RasterizeScroller();
138 position++;
139 }
140
141
142 FontUnpack();
143 FirstText();
144 Wait(8+3);
145
146 //InitTestCode();
147 ReInit3D();
148 clr_toparea();
149 FirstScene();
150 RotateThargoid();
151
152 DoubleBuffOff();
153 Dialogue1();
154 DoubleBuffOn();
155 RotateThargoid();
156 DoubleBuffOff();
157 Dialogue2();
158
159 DoubleBuffOn();
160 RotateThargoid();
161
162 DoubleBuffOff();
163 ShowThargoid();
164 Dialogue3();
165 Wait(15-1);
166 Dialogue3b();
167 Wait(15-1);
168
169
170 ShowBadguy();
171 DoubleBuffOff();
172 Dialogue4();
173 Wait(25-1);
174
175 ClearWideBuff();
176 Dialogue5();
177 DoubleBuffOn();
178 PutSun();
179 RotateThargoid();
180
181 DoubleBuffOff();
182 Dialogue6();
183
184 DoubleBuffOn();
185 RotateThargoid();
186 clr_bottomarea();
187 clr_toparea();
188 FinalScene();
189
190
191 kk:
192 FontUnpack();
193 DoubleBuffOff();
194
195 #ifdef OLDCREDITS
196
197 Credits1();
198 Wait(6-4);
199 BurnText();
200
201 Credits3();
202 Wait(5-3);
203 BurnText();
204
205 Credits4();
206 Wait(5-1);
207 BurnText();
208
209 Credits5();
210 Wait(5-3);
211 BurnText();
212
213 CreditsEnd();
214 Wait(5-3);
215 BurnText();
216 clr_all();
217
218 #else
219 Credits1();
220 Wait(20+3);
221 BurnText();
222
223 Credits2();
224 Wait(20+3);
225 BurnText();
226
227 CreditsEnd();
228 Wait(16);
229 BurnText();
230 clr_all();
231
232 #endif
233
234 ShowLogo();
235 Wait(10+3);//20);
236 BurnText();
237 clr_all();
238 //Wait(5);
239
240 launch_game();
241
242 }
243
244
245 void launch_game()
246 {
247
248 clr_all();
249 StopMusic();
250 Wait(2);
251
252 reboot_oric();
253 }
254
255

  ViewVC Help
Powered by ViewVC 1.1.26