-
Notifications
You must be signed in to change notification settings - Fork 44
/
LOAD_LEV.C
434 lines (398 loc) · 23.5 KB
/
LOAD_LEV.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
#include "LOAD_LEV.H"
#include "CD.H"
#include "GAMEFLOW.H"
#include "GPU.H"
#include "MISC.H"
#include "PROFILE.H"
#include <assert.h>
#include <stddef.h>
#include <LIBGTE.H>
#include <LIBETC.H>
#if !DISC_VERSION
#include "FILE.H"
#include <LIBSN.H>
#endif
unsigned char LtLoadingBarEnabled;
unsigned char LoadingBarEnabled;
unsigned char _first_time_ever = 1;
short DelRotAng;
struct STASHEDOBJ* cur_stashed_object;
struct STASHEDDAT* cur_stashed_matrix;
int num_objects_stashed;
struct STASHEDOBJ stashed_objects_list[128];
struct STASHEDDAT stashed_matrix_list[240];
unsigned char char_anim;
unsigned char OurSqrt[1024];
struct WATERTAB WaterTable[22][64];
struct MATRIX3D* Matrix = &MatrixStack[0];
unsigned short SqrtTable[] =
{
0x1000, 0x101F, 0x103F, 0x105E, 0x107E, 0x109C, 0x10BB, 0x10DA, 0x10F8, 0x1116,
0x1134, 0x1152, 0x116F, 0x118C, 0x11A9, 0x11C6, 0x11E3, 0x1200, 0x121C, 0x1238,
0x1254, 0x1270, 0x128C, 0x12A7, 0x12C2, 0x12DE, 0x12F9, 0x1314, 0x132E, 0x1349,
0x1364, 0x137E, 0x1398, 0x13B2, 0x13CC, 0x13E6, 0x1400, 0x1419, 0x1432, 0x144C,
0x1465, 0x147E, 0x1497, 0x14B0, 0x14C8, 0x14E1, 0x14F9, 0x1512, 0x152A, 0x1542,
0x155A, 0x1572, 0x158A, 0x15A2, 0x15B9, 0x15D1, 0x15E8, 0x1600, 0x1617, 0x162E,
0x1645, 0x165C, 0x1673, 0x1689, 0x16A0, 0x16B7, 0x16CD, 0x16E4, 0x16FA, 0x1710,
0x1726, 0x173C, 0x1752, 0x1768, 0x177E, 0x1794, 0x17AA, 0x17BF, 0x17D5, 0x17EA,
0x1800, 0x1815, 0x182A, 0x183F, 0x1854, 0x1869, 0x187E, 0x1893, 0x18A8, 0x18BD,
0x18D1, 0x18E6, 0x18FA, 0x190F, 0x1923, 0x1938, 0x194C, 0x1960, 0x1974, 0x1988,
0x199C, 0x19B0, 0x19C4, 0x19D8, 0x19EC, 0x1A00, 0x1A13, 0x1A27, 0x1A3A, 0x1A4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D, 0x0CCC, 0x0CBC, 0x0CAC, 0x0C9C,
0x0C8D, 0x0C7D, 0x0C6E, 0x0C5F, 0x0C51, 0x0C42, 0x0C34, 0x0C26, 0x0C18, 0x0C0A,
0x0BFD, 0x0BEF, 0x0BE2, 0x0BD5, 0x0BC8, 0x0BBB, 0x0BAF, 0x0BA2, 0x0B96, 0x0B8A,
0x0B7E, 0x0B72, 0x0B67, 0x0B5B, 0x0B50, 0x0B45, 0x0B39, 0x0B2E, 0x0B24, 0x0B19,
0x0B0E, 0x0B04, 0x0AF9, 0x0AEF, 0x0AE5, 0x0ADB, 0x0AD1, 0x0AC7, 0x0ABD, 0x0AB4,
0x0AAA, 0x0AA1, 0x0A97, 0x0A8E, 0x0A85, 0x0A7C, 0x0A73, 0x0A6A, 0x0A61, 0x0A59,
0x0A50, 0x0A47, 0x0A3F, 0x0A37, 0x0A2E, 0x0A26, 0x0A1E, 0x0A16, 0x0A0E, 0x0A06,
0x09FE, 0x09F6, 0x09EF, 0x09E7, 0x09E0, 0x09D8, 0x09D1, 0x09C9, 0x09C2, 0x09BB,
0x09B4, 0x09AD, 0x09A5, 0x099E, 0x0998, 0x0991, 0x098A, 0x0983, 0x097C, 0x0976,
0x096F, 0x0969, 0x0962, 0x095C, 0x0955, 0x094F, 0x0949, 0x0943, 0x093C, 0x0936,
0x0930, 0x092A, 0x0924, 0x091E, 0x0918, 0x0912, 0x090D, 0x0907, 0x0901, 0x08FB,
0x08F6, 0x08F0, 0x08EB, 0x08E5, 0x08E0, 0x08DA, 0x08D5, 0x08CF, 0x08CA, 0x08C5,
0x08BF, 0x08BA, 0x08B5, 0x08B0, 0x08AB, 0x08A6, 0x08A1, 0x089C, 0x0897, 0x0892,
0x088D, 0x0888, 0x0883, 0x087E, 0x087A, 0x0875, 0x0870, 0x086B, 0x0867, 0x0862,
0x085E, 0x0859, 0x0855, 0x0850, 0x084C, 0x0847, 0x0843, 0x083E, 0x083A, 0x0836,
0x0831, 0x082D, 0x0829, 0x0824, 0x0820, 0x081C, 0x0818, 0x0814, 0x0810, 0x080C,
0x0808, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
struct MATRIX3D iMatrixStack[32];
SVECTOR CamRot;
struct MATRIX3D* iMatrix;
unsigned short MatrixSP;
struct MATRIX3D MatrixStack[32];
long iFrac;
long iRate;
long iAmbientR;
long iAmbientG;
long iAmbientB;
long atanOctantTab [] =
{
0, -16384, -65535, 49152, -32768, 16384, 32768, -49152
};
short atanTab[] =
{
0x0000, 0x0005, 0x000A, 0x000F, 0x0014, 0x0019, 0x001F, 0x0024, 0x0029, 0x002E,
0x0033, 0x0038, 0x003D, 0x0042, 0x0047, 0x004C, 0x0051, 0x0057, 0x005C, 0x0061,
0x0066, 0x006B, 0x0070, 0x0075, 0x007A, 0x007F, 0x0084, 0x008A, 0x008F, 0x0094,
0x0099, 0x009E, 0x00A3, 0x00A8, 0x00AD, 0x00B2, 0x00B7, 0x00BC, 0x00C2, 0x00C7,
0x00CC, 0x00D1, 0x00D6, 0x00DB, 0x00E0, 0x00E5, 0x00EA, 0x00EF, 0x00F4, 0x00FA,
0x00FF, 0x0104, 0x0109, 0x010E, 0x0113, 0x0118, 0x011D, 0x0122, 0x0127, 0x012C,
0x0131, 0x0137, 0x013C, 0x0141, 0x0146, 0x014B, 0x0150, 0x0155, 0x015A, 0x015F,
0x0164, 0x0169, 0x016F, 0x0174, 0x0179, 0x017E, 0x0183, 0x0188, 0x018D, 0x0192,
0x0197, 0x019C, 0x01A1, 0x01A6, 0x01AC, 0x01B1, 0x01B6, 0x01BB, 0x01C0, 0x01C5,
0x01CA, 0x01CF, 0x01D4, 0x01D9, 0x01DE, 0x01E3, 0x01E9, 0x01EE, 0x01F3, 0x01F8,
0x01FD, 0x0202, 0x0207, 0x020C, 0x0211, 0x0216, 0x021B, 0x0220, 0x0226, 0x022B,
0x0230, 0x0235, 0x023A, 0x023F, 0x0244, 0x0249, 0x024E, 0x0253, 0x0258, 0x025D,
0x0262, 0x0268, 0x026D, 0x0272, 0x0277, 0x027C, 0x0281, 0x0286, 0x028B, 0x0290,
0x0295, 0x029A, 0x029F, 0x02A4, 0x02A9, 0x02AF, 0x02B4, 0x02B9, 0x02BE, 0x02C3,
0x02C8, 0x02CD, 0x02D2, 0x02D7, 0x02DC, 0x02E1, 0x02E6, 0x02EB, 0x02F0, 0x02F6,
0x02FB, 0x0300, 0x0305, 0x030A, 0x030F, 0x0314, 0x0319, 0x031E, 0x0323, 0x0328,
0x032D, 0x0332, 0x0337, 0x033C, 0x0341, 0x0347, 0x034C, 0x0351, 0x0356, 0x035B,
0x0360, 0x0365, 0x036A, 0x036F, 0x0374, 0x0379, 0x037E, 0x0383, 0x0388, 0x038D,
0x0392, 0x0397, 0x039C, 0x03A2, 0x03A7, 0x03AC, 0x03B1, 0x03B6, 0x03BB, 0x03C0,
0x03C5, 0x03CA, 0x03CF, 0x03D4, 0x03D9, 0x03DE, 0x03E3, 0x03E8, 0x03ED, 0x03F2,
0x03F7, 0x03FC, 0x0401, 0x0407, 0x040C, 0x0411, 0x0416, 0x041B, 0x0420, 0x0425,
0x042A, 0x042F, 0x0434, 0x0439, 0x043E, 0x0443, 0x0448, 0x044D, 0x0452, 0x0457,
0x045C, 0x0461, 0x0466, 0x046B, 0x0470, 0x0475, 0x047A, 0x047F, 0x0484, 0x0489,
0x048E, 0x0494, 0x0499, 0x049E, 0x04A3, 0x04A8, 0x04AD, 0x04B2, 0x04B7, 0x04BC,
0x04C1, 0x04C6, 0x04CB, 0x04D0, 0x04D5, 0x04DA, 0x04DF, 0x04E4, 0x04E9, 0x04EE,
0x04F3, 0x04F8, 0x04FD, 0x0502, 0x0507, 0x050C, 0x0511, 0x0516, 0x051B, 0x0520,
0x0525, 0x052A, 0x052F, 0x0534, 0x0539, 0x053E, 0x0543, 0x0548, 0x054D, 0x0552,
0x0557, 0x055C, 0x0561, 0x0566, 0x056B, 0x0570, 0x0575, 0x057A, 0x057F, 0x0584,
0x0589, 0x058E, 0x0593, 0x0598, 0x059D, 0x05A2, 0x05A7, 0x05AC, 0x05B1, 0x05B6,
0x05BB, 0x05C0, 0x05C5, 0x05CA, 0x05CF, 0x05D4, 0x05D9, 0x05DE, 0x05E3, 0x05E8,
0x05ED, 0x05F2, 0x05F7, 0x05FC, 0x0601, 0x0606, 0x060B, 0x0610, 0x0615, 0x061A,
0x061F, 0x0624, 0x0629, 0x062E, 0x0633, 0x0638, 0x063D, 0x0642, 0x0647, 0x064C,
0x0651, 0x0656, 0x065B, 0x0660, 0x0665, 0x066A, 0x066E, 0x0673, 0x0678, 0x067D,
0x0682, 0x0687, 0x068C, 0x0691, 0x0696, 0x069B, 0x06A0, 0x06A5, 0x06AA, 0x06AF,
0x06B4, 0x06B9, 0x06BE, 0x06C3, 0x06C8, 0x06CD, 0x06D2, 0x06D7, 0x06DC, 0x06E1,
0x06E5, 0x06EA, 0x06EF, 0x06F4, 0x06F9, 0x06FE, 0x0703, 0x0708, 0x070D, 0x0712,
0x0717, 0x071C, 0x0721, 0x0726, 0x072B, 0x0730, 0x0735, 0x0739, 0x073E, 0x0743,
0x0748, 0x074D, 0x0752, 0x0757, 0x075C, 0x0761, 0x0766, 0x076B, 0x0770, 0x0775,
0x077A, 0x077E, 0x0783, 0x0788, 0x078D, 0x0792, 0x0797, 0x079C, 0x07A1, 0x07A6,
0x07AB, 0x07B0, 0x07B5, 0x07B9, 0x07BE, 0x07C3, 0x07C8, 0x07CD, 0x07D2, 0x07D7,
0x07DC, 0x07E1, 0x07E6, 0x07EB, 0x07EF, 0x07F4, 0x07F9, 0x07FE, 0x0803, 0x0808,
0x080D, 0x0812, 0x0817, 0x081C, 0x0820, 0x0825, 0x082A, 0x082F, 0x0834, 0x0839,
0x083E, 0x0843, 0x0848, 0x084C, 0x0851, 0x0856, 0x085B, 0x0860, 0x0865, 0x086A,
0x086F, 0x0873, 0x0878, 0x087D, 0x0882, 0x0887, 0x088C, 0x0891, 0x0896, 0x089A,
0x089F, 0x08A4, 0x08A9, 0x08AE, 0x08B3, 0x08B8, 0x08BD, 0x08C1, 0x08C6, 0x08CB,
0x08D0, 0x08D5, 0x08DA, 0x08DF, 0x08E3, 0x08E8, 0x08ED, 0x08F2, 0x08F7, 0x08FC,
0x0901, 0x0905, 0x090A, 0x090F, 0x0914, 0x0919, 0x091E, 0x0922, 0x0927, 0x092C,
0x0931, 0x0936, 0x093B, 0x093F, 0x0944, 0x0949, 0x094E, 0x0953, 0x0958, 0x095C,
0x0961, 0x0966, 0x096B, 0x0970, 0x0975, 0x0979, 0x097E, 0x0983, 0x0988, 0x098D,
0x0992, 0x0996, 0x099B, 0x09A0, 0x09A5, 0x09AA, 0x09AE, 0x09B3, 0x09B8, 0x09BD,
0x09C2, 0x09C6, 0x09CB, 0x09D0, 0x09D5, 0x09DA, 0x09DE, 0x09E3, 0x09E8, 0x09ED,
0x09F2, 0x09F6, 0x09FB, 0x0A00, 0x0A05, 0x0A0A, 0x0A0E, 0x0A13, 0x0A18, 0x0A1D,
0x0A22, 0x0A26, 0x0A2B, 0x0A30, 0x0A35, 0x0A39, 0x0A3E, 0x0A43, 0x0A48, 0x0A4D,
0x0A51, 0x0A56, 0x0A5B, 0x0A60, 0x0A64, 0x0A69, 0x0A6E, 0x0A73, 0x0A77, 0x0A7C,
0x0A81, 0x0A86, 0x0A8B, 0x0A8F, 0x0A94, 0x0A99, 0x0A9E, 0x0AA2, 0x0AA7, 0x0AAC,
0x0AB1, 0x0AB5, 0x0ABA, 0x0ABF, 0x0AC4, 0x0AC8, 0x0ACD, 0x0AD2, 0x0AD7, 0x0ADB,
0x0AE0, 0x0AE5, 0x0AE9, 0x0AEE, 0x0AF3, 0x0AF8, 0x0AFC, 0x0B01, 0x0B06, 0x0B0B,
0x0B0F, 0x0B14, 0x0B19, 0x0B1E, 0x0B22, 0x0B27, 0x0B2C, 0x0B30, 0x0B35, 0x0B3A,
0x0B3F, 0x0B43, 0x0B48, 0x0B4D, 0x0B51, 0x0B56, 0x0B5B, 0x0B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102A, 0x102E,
0x1033, 0x1037, 0x103B, 0x1040, 0x1044, 0x1048, 0x104D, 0x1051, 0x1055, 0x105A,
0x105E, 0x1062, 0x1067, 0x106B, 0x106F, 0x1073, 0x1078, 0x107C, 0x1080, 0x1085,
0x1089, 0x108D, 0x1092, 0x1096, 0x109A, 0x109E, 0x10A3, 0x10A7, 0x10AB, 0x10B0,
0x10B4, 0x10B8, 0x10BC, 0x10C1, 0x10C5, 0x10C9, 0x10CE, 0x10D2, 0x10D6, 0x10DA,
0x10DF, 0x10E3, 0x10E7, 0x10EB, 0x10F0, 0x10F4, 0x10F8, 0x10FD, 0x1101, 0x1105,
0x1109, 0x110E, 0x1112, 0x1116, 0x111A, 0x111F, 0x1123, 0x1127, 0x112B, 0x1130,
0x1134, 0x1138, 0x113C, 0x1140, 0x1145, 0x1149, 0x114D, 0x1151, 0x1156, 0x115A,
0x115E, 0x1162, 0x1166, 0x116B, 0x116F, 0x1173, 0x1177, 0x117C, 0x1180, 0x1184,
0x1188, 0x118C, 0x1191, 0x1195, 0x1199, 0x119D, 0x11A1, 0x11A6, 0x11AA, 0x11AE,
0x11B2, 0x11B6, 0x11BB, 0x11BF, 0x11C3, 0x11C7, 0x11CB, 0x11CF, 0x11D4, 0x11D8,
0x11DC, 0x11E0, 0x11E4, 0x11E9, 0x11ED, 0x11F1, 0x11F5, 0x11F9, 0x11FD, 0x1202,
0x1206, 0x120A, 0x120E, 0x1212, 0x1216, 0x121A, 0x121F, 0x1223, 0x1227, 0x122B,
0x122F, 0x1233, 0x1237, 0x123C, 0x1240, 0x1244, 0x1248, 0x124C, 0x1250, 0x1254,
0x1259, 0x125D, 0x1261, 0x1265, 0x1269, 0x126D, 0x1271, 0x1275, 0x127A, 0x127E,
0x1282, 0x1286, 0x128A, 0x128E, 0x1292, 0x1296, 0x129A, 0x129F, 0x12A3, 0x12A7,
0x12AB, 0x12AF, 0x12B3, 0x12B7, 0x12BB, 0x12BF, 0x12C3, 0x12C7, 0x12CC, 0x12D0,
0x12D4, 0x12D8, 0x12DC, 0x12E0, 0x12E4, 0x12E8, 0x12EC, 0x12F0, 0x12F4, 0x12F8,
0x12FC, 0x1301, 0x1305, 0x1309, 0x130D, 0x1311, 0x1315, 0x1319, 0x131D, 0x1321,
0x1325, 0x1329, 0x132D, 0x1331, 0x1335, 0x1339, 0x133D, 0x1341, 0x1345, 0x1349,
0x134D, 0x1351, 0x1355, 0x135A, 0x135E, 0x1362, 0x1366, 0x136A, 0x136E, 0x1372,
0x1376, 0x137A, 0x137E, 0x1382, 0x1386, 0x138A, 0x138E, 0x1392, 0x1396, 0x139A,
0x139E, 0x13A2, 0x13A6, 0x13AA, 0x13AE, 0x13B2, 0x13B6, 0x13BA, 0x13BE, 0x13C2,
0x13C6, 0x13CA, 0x13CE, 0x13D2, 0x13D6, 0x13DA, 0x13DE, 0x13E2, 0x13E6, 0x13E9,
0x13ED, 0x13F1, 0x13F5, 0x13F9, 0x13FD, 0x1401, 0x1405, 0x1409, 0x140D, 0x1411,
0x1415, 0x1419, 0x141D, 0x1421, 0x1425, 0x1429, 0x142D, 0x1431, 0x1435, 0x1439,
0x143D, 0x1440, 0x1444, 0x1448, 0x144C, 0x1450, 0x1454, 0x1458, 0x145C, 0x1460,
0x1464, 0x1468, 0x146C, 0x1470, 0x1473, 0x1477, 0x147B, 0x147F, 0x1483, 0x1487,
0x148B, 0x148F, 0x1493, 0x1497, 0x149B, 0x149E, 0x14A2, 0x14A6, 0x14AA, 0x14AE,
0x14B2, 0x14B6, 0x14BA, 0x14BE, 0x14C1, 0x14C5, 0x14C9, 0x14CD, 0x14D1, 0x14D5,
0x14D9, 0x14DD, 0x14E0, 0x14E4, 0x14E8, 0x14EC, 0x14F0, 0x14F4, 0x14F8, 0x14FB,
0x14FF, 0x1503, 0x1507, 0x150B, 0x150F, 0x1513, 0x1516, 0x151A, 0x151E, 0x1522,
0x1526, 0x152A, 0x152D, 0x1531, 0x1535, 0x1539, 0x153D, 0x1541, 0x1544, 0x1548,
0x154C, 0x1550, 0x1554, 0x1558, 0x155B, 0x155F, 0x1563, 0x1567, 0x156B, 0x156E,
0x1572, 0x1576, 0x157A, 0x157E, 0x1581, 0x1585, 0x1589, 0x158D, 0x1591, 0x1594,
0x1598, 0x159C, 0x15A0, 0x15A4, 0x15A7, 0x15AB, 0x15AF, 0x15B3, 0x15B7, 0x15BA,
0x15BE, 0x15C2, 0x15C6, 0x15C9, 0x15CD, 0x15D1, 0x15D5, 0x15D8, 0x15DC, 0x15E0,
0x15E4, 0x15E8, 0x15EB, 0x15EF, 0x15F3, 0x15F7, 0x15FA, 0x15FE, 0x1602, 0x1606,
0x1609, 0x160D, 0x1611, 0x1614, 0x1618, 0x161C, 0x1620, 0x1623, 0x1627, 0x162B,
0x162F, 0x1632, 0x1636, 0x163A, 0x163E, 0x1641, 0x1645, 0x1649, 0x164C, 0x1650,
0x1654, 0x1658, 0x165B, 0x165F, 0x1663, 0x1666, 0x166A, 0x166E, 0x1671, 0x1675,
0x1679, 0x167D, 0x1680, 0x1684, 0x1688, 0x168B, 0x168F, 0x1693, 0x1696, 0x169A,
0x169E, 0x16A1, 0x16A5, 0x16A9, 0x16AC, 0x16B0, 0x16B4, 0x16B7, 0x16BB, 0x16BF,
0x16C2, 0x16C6, 0x16CA, 0x16CD, 0x16D1, 0x16D5, 0x16D8, 0x16DC, 0x16E0, 0x16E3,
0x16E7, 0x16EB, 0x16EE, 0x16F2, 0x16F6, 0x16F9, 0x16FD, 0x1700, 0x1704, 0x1708,
0x170B, 0x170F, 0x1713, 0x1716, 0x171A, 0x171D, 0x1721, 0x1725, 0x1728, 0x172C,
0x1730, 0x1733, 0x1737, 0x173A, 0x173E, 0x1742, 0x1745, 0x1749, 0x174C, 0x1750,
0x1754, 0x1757, 0x175B, 0x175E, 0x1762, 0x1766, 0x1769, 0x176D, 0x1770, 0x1774,
0x1778, 0x177B, 0x177F, 0x1782, 0x1786, 0x1789, 0x178D, 0x1791, 0x1794, 0x1798,
0x179B, 0x179F, 0x17A2, 0x17A6, 0x17AA, 0x17AD, 0x17B1, 0x17B4, 0x17B8, 0x17BB,
0x17BF, 0x17C2, 0x17C6, 0x17C9, 0x17CD, 0x17D1, 0x17D4, 0x17D8, 0x17DB, 0x17DF,
0x17E2, 0x17E6, 0x17E9, 0x17ED, 0x17F0, 0x17F4, 0x17F7, 0x17FB, 0x17FE, 0x1802,
0x1806, 0x1809, 0x180D, 0x1810, 0x1814, 0x1817, 0x181B, 0x181E, 0x1822, 0x1825,
0x1829, 0x182C, 0x1830, 0x1833, 0x1837, 0x183A, 0x183E, 0x1841, 0x1845, 0x1848,
0x184C, 0x184F, 0x1853, 0x1856, 0x185A, 0x185D, 0x1860, 0x1864, 0x1867, 0x186B,
0x186E, 0x1872, 0x1875, 0x1879, 0x187C, 0x1880, 0x1883, 0x1887, 0x188A, 0x188E,
0x1891, 0x1894, 0x1898, 0x189B, 0x189F, 0x18A2, 0x18A6, 0x18A9, 0x18AD, 0x18B0,
0x18B3, 0x18B7, 0x18BA, 0x18BE, 0x18C1, 0x18C5, 0x18C8, 0x18CC, 0x18CF, 0x18D2,
0x18D6, 0x18D9, 0x18DD, 0x18E0, 0x18E3, 0x18E7, 0x18EA, 0x18EE, 0x18F1, 0x18F5,
0x18F8, 0x18FB, 0x18FF, 0x1902, 0x1906, 0x1909, 0x190C, 0x1910, 0x1913, 0x1917,
0x191A, 0x191D, 0x1921, 0x1924, 0x1928, 0x192B, 0x192E, 0x1932, 0x1935, 0x1938,
0x193C, 0x193F, 0x1943, 0x1946, 0x1949, 0x194D, 0x1950, 0x1953, 0x1957, 0x195A,
0x195D, 0x1961, 0x1964, 0x1968, 0x196B, 0x196E, 0x1972, 0x1975, 0x1978, 0x197C,
0x197F, 0x1982, 0x1986, 0x1989, 0x198C, 0x1990, 0x1993, 0x1996, 0x199A, 0x199D,
0x19A0, 0x19A4, 0x19A7, 0x19AA, 0x19AE, 0x19B1, 0x19B4, 0x19B8, 0x19BB, 0x19BE,
0x19C2, 0x19C5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1FEE, 0x1FF1, 0x1FF3, 0x1FF6, 0x1FF8, 0x1FFB, 0x1FFD, 0x2000, 0x2000
};
void LOAD_Start(int file_number)//602AC(<), 60DEC(<) (F) (*) (*) (D) (D)
{
char* gfx = NULL;
unsigned short* gfx2 = NULL;
unsigned short* cdgfx = NULL;
int x = 0;
int y = 0;
unsigned long* tmpptr = NULL;
int file = 0;
unsigned short dat = 0;
#if DEBUG_VERSION
ProfileDraw = 0;
#endif
DrawSync(0);
VSync(0);
GPU_UseOrderingTables(&GadwOrderingTables[0], 1);
db.draw[0].isbg = 0;
db.draw[1].isbg = 0;
db.draw[0].dtd = 0;
db.draw[1].dtd = 0;
db.current_buffer = 0;
PutDispEnv(&db.disp[1]);
//We're going to allocate enough memory for the loading screen background picture and loading disc image
//The result pointer is later used as the base to read the loading screen/disc bitmap from GAMEWAD.OBJ on disk.
gfx = game_malloc(LOADING_SCREEN_IMG_SIZE + LOADING_CD_IMG_SIZE);
cdgfx = (unsigned short*) &gfx[LOADING_SCREEN_IMG_SIZE];
gfx2 = (unsigned short*) &gfx[0x4000];//256*256 rect icrm
#if !DISC_VERSION
file = PCopen("data\\loadpic.raw", 0, file);
FILE_Read(gfx, 1, LOADING_SCREEN_IMG_SIZE, file);
PCclose(file);
#else
if (_first_time_ever)
{
//UNKNOWN_41 is the first loading screen image, simply add Gameflow->Language to the base to load language specific load screens.
DEL_CDFS_OpenFile(UNKNOWN_41 + Gameflow->Language);
//Request the loading screen/disc bitmaps to be read into gfx ptr.
//We don't actually pass the file ID or offset since this is already cached by the previous GAMEWAD_InitialiseFileEntry call.
DEL_CDFS_Read(gfx, LOADING_SCREEN_IMG_SIZE + LOADING_CD_IMG_SIZE);
//TITLE is the base file entry index for levels, simply as a result, we must add gameflow level id to this.
DEL_CDFS_OpenFile(file_number);
//We will skip past the loading screen and disc image data so on the next read call we're ready to read SETUP.MOD
DEL_CDFS_Seek(LOADING_SCREEN_IMG_SIZE + LOADING_CD_IMG_SIZE);
}
else
{
//loc_60EC4
DEL_CDFS_Read(gfx, LOADING_SCREEN_IMG_SIZE + LOADING_CD_IMG_SIZE);
}
#endif
tmpptr = (unsigned long*) gfx;
for (x = 0; x < LOADING_SCREEN_IMG_SIZE / 4; x++)
{
*tmpptr++ |= 0x80008000;
}
LoadImage(&db.disp[1].disp, (unsigned long*)gfx);
DrawSync(0);
//loc_603AC
for(y = 0; y < LOADING_CD_IMG_HEIGHT; y++, gfx2 += 448)
{
//loc_603B4
for (x = 0; x < LOADING_CD_IMG_WIDTH; x++, gfx2++)
{
dat = *cdgfx++;
if (dat == 0)
{
dat = 0x8000;
}
//loc_603C8
if (dat == 0xFC1F)
{
dat = 0;
}
*gfx2 = dat;
}
}
//loc_603D4
LoadImage(&db.disp[0].disp, (unsigned long*)gfx);
DrawSync(0);
game_free(LOADING_SCREEN_IMG_SIZE + LOADING_CD_IMG_SIZE);
#if DISC_VERSION
LOAD_DrawEnable(1);
LoadingBarEnabled = 1;
#endif
}
void LOAD_Stop()//60434(<), 60FB4(<) (F) (*) (*) (D) (D)
{
LOAD_DrawEnable(0);
LoadingBarEnabled = 0;
db.draw[1].isbg = 1;
db.draw[0].isbg = 1;
db.draw[1].dtd = 1;
db.draw[0].dtd = 1;
GPU_UseOrderingTables(&GadwOrderingTables[0], sizeof(GadwOrderingTables) / 8);
db.current_buffer = 0;
GPU_SyncBothScreens();
db.current_buffer = 1;
#if DEBUG_VERSION
ProfileDraw = 1;
#endif
_first_time_ever = 0;
}