rnd-20090919-1-src
[rocksndiamonds.git] / src / game_sp / Globals.c
1 // ----------------------------------------------------------------------------
2 // Globals.c
3 // ----------------------------------------------------------------------------
4
5 #include "Globals.h"
6
7 static void ReadDemo();
8 void ReadLevel();
9
10 // static char *VB_Name = "modGlobals";
11
12 // --- Option Explicit
13 // --- Option Compare Text
14 // --- Option Base 0
15
16 // --- const long StretchWidth = 16;
17 // --- const long StretchWidth2 = StretchWidth / 2;
18 // --- const long BaseWidth = 16;
19 // --- const int TwoPixels = 2;
20
21 boolean Original;
22 boolean Cracked;
23 boolean Level_Arg;
24 boolean EGA_Arg;
25 boolean Record_Fix;
26 boolean SpeedKeys;
27 boolean Level_Fix;
28 boolean Dead_Code;
29 boolean Redundant;
30 boolean Alignments;
31 boolean Ctrl_Alt_Fix;
32 boolean Protection;
33 boolean EP_ENHANCE;
34 boolean EP_DEMO;
35 boolean EP_DEBUG;
36 boolean EXTRASPEED;
37 boolean TIMINGFIX;
38 boolean SafeRecord;
39 boolean Norm_Time;
40 boolean EP_OLD8;
41 boolean SAVEGAME;
42 boolean HP_DEMO;
43 boolean ScreenFix;
44 boolean DemoRecordFix;
45 boolean DebugSwitch;
46 boolean Ver62;
47 boolean Ver62test;
48 boolean Ver63;
49 boolean Ver64;
50
51 int LevelNumber;
52 char *CurPath, *OrigPath, *TmpPath;
53 boolean LevelLoaded;
54 long SignatureDelay;
55
56 boolean bCapturePane;
57
58 int FieldWidth; // = 60
59 int FieldHeight; // = 24
60 int HeaderSize; // = 96
61 int FieldMax, LevelMax;
62 long FileMax;
63 int *PlayField16;
64 byte *PlayField8;
65 byte *DisPlayField;
66
67 // Public DisplayMin%, DisplayMax%, DisplayWidth%, DisplayHeight%
68
69 int TimerVar, RandomSeed;
70 currency DeltaT; // Interval between two frames (in ms)
71 long DeltaTPlay, DeltaTDemo;
72 boolean BlockingSpeed;
73
74 // --- const int posFrameCorner = 55;
75 // --- const int posFrameVertical = 110;
76 // --- const int posFrameHorizontal = 111;
77
78 int FreezeZonks;
79
80 // constants for  Fixed Fields:
81 // --- const int fiSpace = 0; // &H00  space(28 = wall space ...)
82 // --- const int fiZonk = 1; // &H01  zonk
83 // --- const int fiBase = 2; // &H02  base
84 // --- const int fiMurphy = 3; // &H03  Murphy
85 // --- const int fiInfotron = 4; // &H04  infotron
86 // --- const int fiRAM = 5; // &H05  small RAM chip
87 // --- const int fiHardWare = 6; // &H06  hardware (square, standard pyramid shape)
88 // --- const int fiExit = 7; // &H07  exit
89 // --- const int fiOrangeDisk = 8; // &H08  brown/orange utility disk
90 // --- const int fiPortRight = 9; // &H09  port 1 left to right
91 // --- const int fiPortDown = 10; // &H0A  port 1 up to down
92 // --- const int fiPortLeft = 11; // &H0B  port 1 right to left
93 // --- const int fiPortUp = 12; // &H0C  port 1 down to up
94 // --- const int fiSpPortRight = 13; // &H0D  port 2 left to right (gravity change)
95 // --- const int fiSpPortDown = 14; // &H0E  port 2 up to down     (gravity change)
96 // --- const int fiSpPortLeft = 15; // &H0F  port 2 right to left (gravity change)
97 // --- const int fiSpPortUp = 16; // &H10  port 2 down to up     (gravity change)
98 // --- const int fiSnikSnak = 17; // &H11  snik snak
99 // --- const int fiYellowDisk = 18; // &H12  yellow utility disk
100 // --- const int fiTerminal = 19; // &H13  terminal
101 // --- const int fiRedDisk = 20; // &H14  red utility disk
102 // --- const int fiPortUpAndDown = 21; // &H15  vertical port
103 // --- const int fiPortLeftAndRight = 22; // &H16  horizontal port
104 // --- const int fiPortAllDirections = 23; // &H17  horizontal + vertical port
105 // --- const int fiElectron = 24; // &H18  electron
106 // --- const int fiBug = 25; // &H19  bug
107 // --- const int fiRAMLeft = 26; // &H1A  horizontal RAM chip, left (pin 1)
108 // --- const int fiRAMRight = 27; // &H1B  horizontal RAM chip, right
109 // --- const int fiHWFirst = 28; // &H1C  hardware (radial blue circular cap + coloured shapes)
110
111 // Public Const fiHW1% = 29               '  29 = 1D  hardware (green signal lamp)
112 // Public Const fiHW2% = 30               '  30 = 1E  hardware (blue signal lamp)
113 // Public Const fiHW3% = 31               '  31 = 1F  hardware (red signal lamp)
114 // Public Const fiHW4% = 32               '  32 = 20  hardware (yellow/black diagonal stripes)
115 // Public Const fiHW5% = 33               '  33 = 21  hardware (yellow resistor + blue + red shapes)
116 // Public Const fiHW6% = 34               '  34 = 22  hardware (horizontal red capacitor + smd shape)
117 // Public Const fiHW7% = 35               '  35 = 23  hardware (red + yellow + blue horizontal resistors)
118 // Public Const fiHW8% = 36               '  36 = 24  hardware (3 red vertical resistors)
119 // --- const int fiHWLast = 37;             //  37 = 25  hardware (3 yellow horizontal resistors)
120 // --- const int fiRAMTop = 38;             //  38 = 26  vertical RAM chip, top (pin 1)
121 // --- const int fiRAMBottom = 39;          //  39 = 27  vertical RAM chip, bottom
122
123 // Specials to experiment with ...
124 // --- const int fiWallSpace = 40;          //  40 = 28  invisible wall (can explode, zonks don't roll off)
125 // --- const int fiHWTrash1 = 41;           //  41 = 29  hardware trash
126 // --- const int fiHWTrash2 = 42;           //  42 = 2A  hardware trash
127 // --- const int fiHWMurphy = 43;           //  43 = 2B  hardware inverted Murphy ... (maybe nice for use?)
128
129 // --- const int fiExplosion = 0x1F;
130
131 // --- const int keyNone = 0;
132 // --- const int keyUp = 1;
133 // --- const int keyLeft = 2;
134 // --- const int keyDown = 3;
135 // --- const int keyRight = 4;
136 // --- const int keySpaceUp = 5;
137 // --- const int keySpaceLeft = 6;
138 // --- const int keySpaceDown = 7;
139 // --- const int keySpaceRight = 8;
140 // --- const int keySpace = 9;
141
142 #if 0
143 int *aniBug, *aniZonkRollRight, *aniZonkRollLeft;
144 int *aniInfotronRollRight, *aniInfotronRollLeft;
145 int *aniSnikSnak, *aniElectron, *aniExplosion;
146 int *aniTouchBase, *aniTouchInfotron, *aniTouchRedDisk;
147 // --- const int aniExplosionInfo = 111;
148 // --- const int aniSnikSnakUp = 159;
149 // --- const int aniSnikSnakDown = 167;
150 // --- const int aniSnikSnakLeft = 239;
151 // --- const int aniSnikSnakRight = 247;
152 // --- const int aniMurphyYawn = 56;
153 // --- const int aniMurphySleepLeft = 71;
154 // --- const int aniMurphySleepRight = 68;
155 int *aniMurphyExit; // , aniMurphyFaceLeft%, aniMurphyFaceRight%
156 int *aniMurphyEatLeft, *aniMurphyEatRight; // , aniMurphyEatRightRedDisk
157 int *aniMurphyEatUpLeft, *aniMurphyEatUpRight, *aniSplitUpDown;
158 int *aniYellowDisk, *aniOrangeDisk, *aniRedDisk;
159 // --- const int aniMurphyTouchUp = 46;
160 // --- const int aniMurphyTouchLeft = 95;
161 // --- const int aniMurphyTouchDown = 47;
162 // --- const int aniMurphyTouchRight = 94;
163 int *aniEatInfotronLeft, *aniEatInfotronRight;
164 // --- const int aniPushLeft = 45;
165 // --- const int aniPushRight = 44;
166 // --- const int aniPushUpDown = 79;
167 #endif
168
169 #if 1
170 int aniBug[] = { 74, 75, 76, 77, 78, 77, 76, 77, 78, 77, 76, 75, 74, 25 };
171 int aniZonkRollRight[] = { 198, 197, 196, 195, 194, 193, 192, 1, -1 };
172 int aniZonkRollLeft[] = { 192, 193, 194, 195, 196, 197, 198, 1, -1 };
173 int aniInfotronRollRight[] = { 206, 205, 204, 203, 202, 201, 200, 4 };
174 int aniInfotronRollLeft[] = { 200, 201, 202, 203, 204, 205, 206, 4 };
175 int aniSnikSnak[] = { 121, 122, 123, 124, 125, 126, 127, 120, 121 };
176 int aniElectron[] = { 144, 145, 146, 147, 148, 149, 150, 151, 144 };
177 int aniExplosion[] = { 3, 103, 104, 105, 106, 107, 108, 109, 0 };
178 int aniTouchBase[] = { 80, 81, 82, 83, 84, 85, 86, 0, -1 };
179 int aniTouchInfotron[] = { 87, 88, 89, 91, 92, 93, 0, -1 }; // Only seven frames!!!!
180 int aniTouchRedDisk[] = { 96, 97, 98, 99, 100, 101, 102, 0, -1 };
181 int aniMurphyExit[] = { 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 0, 0, 0, 0, -1 };
182 int aniMurphyEatLeft[] = { 176, 177, 178, 179, 180, 181, 182, 183, -1 };
183 int aniMurphyEatRight[] = { 184, 185, 186, 187, 188, 189, 190, 191, -1 };
184 int aniMurphyEatUpLeft[] = { 183, 182, 181, 180, 179, 178, 177, 176, -1 };
185 int aniMurphyEatUpRight[] = { 191, 190, 189, 188, 187, 186, 185, 184, -1 };
186   // aniMurphyEatRightRedDisk = { 184, 184, 185, 186, 187, 188, 189, 190, 191, -1) '9 frames!
187 int aniEatInfotronLeft[] = { 209, 211, 213, 215, 217, 219, 221, 223, -1 };
188 int aniEatInfotronRight[] = { 224, 226, 228, 230, 232, 234, 236, 238, -1 };
189 int aniSplitUpDown[] = { 3, 3, 3, 3, 3, 3, 3, 3, -1 };
190 int aniYellowDisk[] = { 18, 18, 18, 18, 18, 18, 18, 18, -1 };
191 int aniOrangeDisk[] = { 8, 8, 8, 8, 8, 8, 8, 8, -1 };
192 int aniRedDisk[] = { 20, -1 };
193 #endif
194
195 void InitGlobals()
196 {
197 #if 0
198   aniBug = Array(74, 75, 76, 77, 78, 77, 76, 77, 78, 77, 76, 75, 74, 25);
199   aniZonkRollRight = Array(198, 197, 196, 195, 194, 193, 192, 1, -1);
200   aniZonkRollLeft = Array(192, 193, 194, 195, 196, 197, 198, 1, -1);
201   aniInfotronRollRight = Array(206, 205, 204, 203, 202, 201, 200, 4);
202   aniInfotronRollLeft = Array(200, 201, 202, 203, 204, 205, 206, 4);
203   aniSnikSnak = Array(121, 122, 123, 124, 125, 126, 127, 120, 121);
204   aniElectron = Array(144, 145, 146, 147, 148, 149, 150, 151, 144);
205   aniExplosion = Array(3, 103, 104, 105, 106, 107, 108, 109, 0);
206   aniTouchBase = Array(80, 81, 82, 83, 84, 85, 86, 0, -1);
207   aniTouchInfotron = Array(87, 88, 89, 91, 92, 93, 0, -1); // Only seven frames!!!!
208   aniTouchRedDisk = Array(96, 97, 98, 99, 100, 101, 102, 0, -1);
209   aniMurphyExit = Array(46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 0, 0, 0, 0, -1);
210   aniMurphyEatLeft = Array(176, 177, 178, 179, 180, 181, 182, 183, -1);
211   aniMurphyEatRight = Array(184, 185, 186, 187, 188, 189, 190, 191, -1);
212   aniMurphyEatUpLeft = Array(183, 182, 181, 180, 179, 178, 177, 176, -1);
213   aniMurphyEatUpRight = Array(191, 190, 189, 188, 187, 186, 185, 184, -1);
214   // aniMurphyEatRightRedDisk = Array(184, 184, 185, 186, 187, 188, 189, 190, 191, -1) '9 frames!
215   aniEatInfotronLeft = Array(209, 211, 213, 215, 217, 219, 221, 223, -1);
216   aniEatInfotronRight = Array(224, 226, 228, 230, 232, 234, 236, 238, -1);
217   aniSplitUpDown = Array(3, 3, 3, 3, 3, 3, 3, 3, -1);
218   aniYellowDisk = Array(18, 18, 18, 18, 18, 18, 18, 18, -1);
219   aniOrangeDisk = Array(8, 8, 8, 8, 8, 8, 8, 8, -1);
220   aniRedDisk = Array(20, -1);
221 #endif
222
223   InitPseudoCompileFlags();
224   UserDragFlag = False;
225   AutoScrollFlag = True;
226   FreezeZonks = 0;
227   BlockingSpeed = False;
228   LevelLoaded = False;
229   FieldWidth = 60;
230   FieldHeight = 24;
231   HeaderSize = 96;
232   FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
233   LevelMax = (FieldWidth * FieldHeight) - 1;
234   Let_ModifiedFlag(False);
235   bPlaying = False;
236   gSignature = "";
237   bSignatureAvailable = False;
238   FirstDemoByte = 0x81;
239   MySignature = "";
240   InitErrorReporting();
241 }
242
243 void InitPseudoCompileFlags()
244 {
245   Cracked = 1;       // If protection Then crack it
246   Level_Arg = 1;     // :number is cmd line option
247   // Level_Arg  = 0     ' Remove Level cmd line option
248   EGA_Arg = 1;       // EGA is command line option
249   Record_Fix = 1;      // Assemble with fixed Demo rec
250   SpeedKeys = 0;     // Remove Speed Keys fix
251   Level_Fix = 1;     // Assemble with Level Fix
252   Dead_Code = 0;     // Remove dead code
253   Redundant = 0;     // Remove redundant code
254   Alignments = 1;      // Assemble with alignments
255   Ctrl_Alt_Fix = 1;      // Assemble with Ctrl/Alt fix
256   Protection = 0;      // Remove protection code,do HP
257   // EP added by EP for version 5.
258   EP_ENHANCE = 1;      // Some more nice things (EP)
259   EP_DEMO = 1;       // Use .SP files for demos (EP)
260   // Including record demo!
261   EP_DEBUG = 0;      // little cmdline debugging
262   EXTRASPEED = 1;      // '@' option, superfast!
263   TIMINGFIX = 1;     // "Fixed" the timing problem..
264   // Inactive If DemoRecordFix Then1
265   SafeRecord = 1;      // skip debug keys in recording
266   Norm_Time = 1;     // force automatic speed test,
267   // save result and then do as
268   // requested from cmd line.
269   EP_OLD8 = 1;       // call old int8 from current.
270   SAVEGAME = 1;      // Allow saving to SUPAPLEX.SAV
271   HP_DEMO = 1;       // Use fixed demo routines 5.5
272   ScreenFix = 1;     // No menu-write to gamy field
273   DemoRecordFix = 1;     // Demo record timing fix on
274   DebugSwitch = 1;     // Allow Ctrl/Alt-ScrollLock
275   Ver62 = 1;       // Version 6.2 stuff
276   Ver62test = 0;     // Version 6.2 test stuff
277   Ver63 = 1;       // Version 6.3 stuff
278   Ver64 = 1;       // Version 6.4 stuff
279
280 }
281
282 int GetSI(int X, int Y)
283 {
284   int GetSI;
285
286   GetSI = Y * FieldWidth + X;
287
288   return GetSI;
289 }
290
291 int GetX(int si)
292 {
293   int GetX;
294
295   GetX = si % FieldWidth;
296
297   return GetX;
298 }
299
300 int GetY(int si)
301 {
302   int GetY;
303
304   GetY = si / FieldWidth;
305
306   return GetY;
307 }
308
309 int GetStretchX(int si)
310 {
311   int GetStretchX;
312
313   GetStretchX = StretchWidth * (si % FieldWidth);
314
315   return GetStretchX;
316 }
317
318 int GetStretchY(int si)
319 {
320   int GetStretchY;
321
322   GetStretchY = StretchWidth * (si / FieldWidth);
323
324   return GetStretchY;
325 }
326
327 void ReadLevel()
328 {
329 #if 1
330   static char CurPathTEST[1024];
331 #endif
332
333   // int FNum;
334   FILE *FNum;
335   long i;
336   // byte T;
337
338 #if 1
339   // CurPath = "/home/aeglos/projects/rocksndiamonds/levels/TEST_supaplex/supaplex/levels.dat";
340
341 #if 0
342   CurPath = "/home/aeglos/projects/rocksndiamonds/supaplex_demo_JENS0001.sp";
343   LevelNumber = 1;
344 #else
345   sprintf(CurPathTEST, "/home/aeglos/projects/Level_Stuff/SUPAPLEX/SUPAPLEX_LEVELS/solve00/JENS%04d.SP", level_nr);
346   CurPath = CurPathTEST;
347   LevelNumber = level_nr;
348 #endif
349
350 #endif
351
352   DemoAvailable = False;
353
354   if (STRING_IS_LIKE(CurPath, "*.mpx") ||
355       STRING_IS_LIKE(CurPath, "*.MPX"))
356   {
357     printf("::: reading MPX file ...\n");
358
359     ReadMPX();
360     return;
361   }
362
363   if (STRING_IS_LIKE(CurPath, "*.sp") ||
364       STRING_IS_LIKE(CurPath, "*.SP"))
365   {
366     printf("::: reading SP file ...\n");
367
368     ReadDemo();
369     return;
370   }
371
372   if (DemoFlag != 0)
373   {
374     printf("::: reading demo file ...\n");
375
376     ReadDemo();
377     return;
378   }
379
380   printf("::: reading level file ...\n");
381
382   FileMax = 0;
383   FieldWidth = 60;
384   FieldHeight = 24;
385   HeaderSize = 96;
386
387   FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
388   LevelMax = (FieldWidth * FieldHeight) - 1;
389
390   PlayField8 = REDIM_1D(sizeof(byte), 0, FieldMax + 1 - 1);
391   DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax + 1 - 1);
392
393   // FNum = FreeFile();
394
395   // --- On Error GoTo ReadLevelEH
396
397   printf("::: '%s', %d\n", CurPath, LevelNumber);
398
399   FNum = fopen(CurPath, "rb");
400
401   i = (LevelNumber - 1) * ((long)(FieldMax) + 1) + 1;
402 #if 1
403   FILE_GET(FNum, i, PlayField8, FieldMax + 1);
404 #else
405   FILE_GET(FNum, i, &PlayField8, sizeof(PlayField8));
406 #endif
407
408   i = (LevelNumber) * ((long)(FieldMax) + 1) + 1 - HeaderSize;
409   FILE_GET(FNum, i, &LInfo, sizeof(LInfo)); // store level info in an extra structure
410
411   fclose(FNum);
412
413   // --- On Error GoTo 0
414
415   if (FieldMax < FileMax)
416     DemoAvailable = True;
417
418   ReadSignature();
419
420   PlayField16 = REDIM_1D(sizeof(int), -FieldWidth, FieldMax);
421
422   for (i = 0; i <= FieldMax; i++)
423   {
424     PlayField16[i]  = PlayField8[i];
425     DisPlayField[i] = PlayField8[i];
426     PlayField8[i] = 0;
427   }
428
429 #if 0
430  {
431    int x, y;
432
433    for (x = 0; x < 60; x++)
434      printf("%02d.", x);
435    printf("\n");
436
437    for (x = 0; x < 60; x++)
438      printf("...");
439    printf("\n");
440
441    for (y = 0; y < 24; y++)
442    {
443      for (x = 0; x < 60; x++)
444      {
445        printf("%02d.", PlayField16[y * 60 + x]);
446      }
447
448      printf("\n");
449    }
450  }
451 #endif
452
453   AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax - 2 * FieldWidth);
454   AnimationSubTable = REDIM_1D(sizeof(byte), 0, LevelMax - 2 * FieldWidth);
455   TerminalState = REDIM_1D(sizeof(byte), FieldWidth, LevelMax - FieldWidth);
456
457   GravityFlag = LInfo.InitialGravity;
458   FreezeZonks = LInfo.InitialFreezeZonks;
459
460   subRandomize();
461
462   LevelLoaded = True;
463
464   return;
465
466 #if 0
467 ReadLevelEH:
468   Close();
469 #endif
470 }
471
472 static void ReadDemo()
473 {
474   // int FNum, i;
475   FILE *FNum;
476   int i;
477   // byte T;
478
479   int RecordNumber = LevelNumber;
480
481 #if 1
482   RecordNumber = 1;     // always "1" for "*.sp" style one level/demo files
483 #endif
484
485   FieldWidth = 60;
486   FieldHeight = 24;
487   HeaderSize = 96;
488
489   FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
490   LevelMax = (FieldWidth * FieldHeight) - 1;
491
492   // --- On Error GoTo ReadDemoEH
493
494   FileMax = FileLen(CurPath) - 1;
495
496   PlayField8 = REDIM_1D(sizeof(byte), 0, FileMax + 1 - 1);
497   DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax + 1 - 1);
498
499   // FNum = FreeFile();
500
501   FNum = fopen(CurPath, "rb");
502
503   i = (RecordNumber - 1) * ((long)(FieldMax) + 1) + 1;
504 #if 1
505   FILE_GET(FNum, i, PlayField8, FileMax + 1);
506 #else
507   FILE_GET(FNum, i, &PlayField8, sizeof(PlayField8));
508 #endif
509
510   i = (RecordNumber) * ((long)(FieldMax) + 1) + 1 - HeaderSize;
511   FILE_GET(FNum, i, &LInfo, sizeof(LInfo)); // store level info in an extra structure
512
513   fclose(FNum);
514
515   // --- On Error GoTo 0
516
517   if (FieldMax < FileMax)
518     DemoAvailable = True;
519
520   ReadSignature();
521
522   PlayField16 = REDIM_1D(sizeof(int), -FieldWidth, FieldMax);
523
524   for (i = 0; i <= FieldMax; i++)
525   {
526     PlayField16[i] = PlayField8[i];
527     DisPlayField[i] = PlayField8[i];
528     PlayField8[i] = 0;
529   }
530
531   AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax - 2 * FieldWidth);
532   AnimationSubTable = REDIM_1D(sizeof(byte), 0, LevelMax - 2 * FieldWidth);
533   TerminalState = REDIM_1D(sizeof(byte), 0, FieldMax + 1 - 1);
534
535   DemoPointer = FieldMax + 1;
536   DemoOffset = DemoPointer;
537   DemoKeyRepeatCounter = 0;
538
539   // DemoFlag = 1
540   // DemoAvailable = True
541
542   GravityFlag = LInfo.InitialGravity;
543   FreezeZonks = LInfo.InitialFreezeZonks;
544
545 #if 0
546   printf("::: Globals.c: ReadDemo(): %d / %d\n", GravityFlag, FreezeZonks);
547 #endif
548
549   RandomSeed = LInfo.DemoRandomSeed;
550
551 #if 1
552   printf("::: RandomSeed == %d\n", RandomSeed);
553
554 #if 1
555   {
556     int i;
557
558     for (i = 0; i < 10; i++)
559       printf("::: TEST random number: %d\n", subGetRandomNumber());
560
561     int buffer, value = -3;
562
563     MovHighByte(&buffer, value);
564     value = SgnHighByte(buffer);
565
566     printf("::: TEST: 0x%08x / %d\n", value, value);
567   }
568 #endif
569
570 #endif
571
572   LevelLoaded = True;
573
574   return;
575
576 #if 0
577 ReadDemoEH:
578   Close();
579 #endif
580 }