- printf("::: playing game ...\n");
-#endif
-
- // EP set level success byte: game, not demo
- WasDemoFlag = 0;
- EP_GameDemoVar0DAA = 1; // game
- }
-
- // RestartGameLoop:
- // If RecordDemoFlag = 1 Then
- // RecordDemoFlag = 0 ' clear Demo Recording flag
- // Call subDisplayPlayingTime ' playing time on screen
- // ' Record key still pressed?' >= (Ctrl-)F1 and <= (Ctrl-)F10
- // While &H3B <= KeyScanCode7 And KeyScanCode7 <= &H44
- // ' yes -> wait until released
- // ' should we DoEvents here???? ... depends on how ... but yes!
- // ' ...or we can rather poll the keyboardstate inside this loop???
- // Wend
- // Call subInitGameConditions ' Init game conditions (vars)
- // If MusicOnFlag = 0 Then Call subMusicInit
- // WasDemoFlag = 0 ' no demo anymore
- // EP_GameDemoVar0DAA = 1 ' force game
- // End If
-
- // This was a bug in the original Supaplex: sometimes red disks could not
- // be released. This happened If Murphy was killed DURING a red disk release
- // and the next try started.
-
- RedDiskReleasePhase = 0; // (re-)enable red disk release
- UpdatedFlag = 0;
- GameLoopRunning = 1;
- LevelStatus = 0;
-
- // ----------------------------------------------------------------------------
- // --------------------- START OF GAME-BUSY LOOP ------------------------------
- // ----------------------------------------------------------------------------
-
-locRepeatMainGameLoop: // start repeating game loop
-
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- // FS synchronization
- while (PauseMode != 0)
- {
- DoEvents();
- }
-
- do
- {
- DoEvents(); // user may klick on menus or move the window here ...
- }
-#if 1
- while (0);
-#else
- while (Clock.TickDiffUS(LastFrame) < DeltaT); // wait till its time for the next frame
-#endif
-
- // never any additional code between here!
-#if 0
- LastFrame = Clock.TickNow(); // store the frame time
-#endif
- // never any additional code between here!
- if (! NoDisplayFlag) // copy the BackBuffer(=Stage) to visible screen
- Stage.Blt();
-
- // FS end of synchronization
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- if (EndFlag)
- goto locExitMainGameLoop;
-
- // If DemoFlag = 0 Then Call subCheckJoystick ' check joystick
- // bx = subCheckRightMouseButton() ' check (right) mouse button
- // If bx = 2 And LeadOutCounter < 1 Then KillMurphyFlag = 1 ' lead-out busy after quit? -> kill Murphy!
-
- // If DebugVersionFlag <> 0 Then ' debug mode on?
- // If Data_SubRest <> 0 Then Data_SubRest = Data_SubRest - 1
- // If keyEnter <> 0 Then GoTo loc_g_186F ' Was it the Enter key? -> yes--skip! No mouse!
- // ' fixes ENTER bug If no mouse driver!
- // If bx <> 1 Then GoTo loc_g_186F ' Left button=Init game field
- // ' Also Enter If no mouse!
- // If Data_SubRest <> 0 Then GoTo loc_g_186F
- // Data_SubRest = 10
- // Call subRestoreFancy
- // Call subDisplayLevel ' Paint (Init) game field
- // Call subConvertToEasySymbols ' Convert to easy symbols
- // End If
-
- // loc_g_186F:
-
- subProcessKeyboardInput(); // Check keyboard, act on keys
-
- // 'HACK:
- // TimerVar = TimerVar + 1
- // DoEvents
- // GoTo loc_g_186F
- // 'END HACK
- // If RecordDemoFlag = 1 Then GoTo RestartGameLoop
-
- // ----------------------------------------------------------------------------
- //
-
-#if 0
- printf("::: >>>>>>>>>> MainGameLoop.c: subDoGameStuff() START\n");
-#endif
-
- subDoGameStuff(); // do all game stuff
-
-#if 0
- printf("::: <<<<<<<<<< MainGameLoop.c: subDoGameStuff() END\n");
-#endif
-
- //
- // ----------------------------------------------------------------------------
-
- // Call subDisplayPlayingTime ' playing time on screen
-
- subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole
-
- subRedDiskReleaseExplosion(); // Red Disk release and explode
- subFollowUpExplosions(); // every explosion may cause up to 8 following explosions