+
+ /* only save actions from input devices, but not programmed actions */
+ if (tape.recording)
+ TapeRecordAction(tape_action);
+
+#if 1
+ {
+ byte effective_action[MAX_PLAYERS];
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ effective_action[i] = stored_player[i].effective_action;
+
+
+#if 0
+ printf("::: %s: ",
+ tape.playing ? "PLAYING" :
+ tape.recording ? "RECORDING" :
+ "STOPPED");
+
+ for (i = 1; i < MAX_PLAYERS; i++)
+ if ((recorded_player_action && recorded_player_action[i] != 0) ||
+ tape_action[i] != 0 ||
+ effective_action[i] != 0)
+ printf("::: -----------------> WARNING!\n");
+
+ printf("::: %08d: %08x [%08x] [%08x]\n",
+ FrameCounter,
+ (recorded_player_action ? recorded_player_action[0] : -1),
+ tape_action[0],
+ effective_action[0]);
+#endif
+
+
+ GameActions_EM(effective_action);
+ }
+#else
+ GameActions_EM(local_player->effective_action);
+#endif
+
+ if (TimeFrames >= FRAMES_PER_SECOND)
+ {
+ TimeFrames = 0;
+ TapeTime++;
+
+ if (!level.use_step_counter)
+ {
+ TimePlayed++;
+
+ if (TimeLeft > 0)
+ {
+ TimeLeft--;
+
+ if (TimeLeft <= 10 && setup.time_limit)
+ PlaySoundStereo(SND_GAME_RUNNING_OUT_OF_TIME, SOUND_MIDDLE);
+
+ DrawGameValue_Time(TimeLeft);
+
+ if (!TimeLeft && setup.time_limit)
+ level.native_em_level->lev->killed_out_of_time = TRUE;
+ }
+ else if (level.time == 0 && level.native_em_level->lev->home > 0)
+ DrawGameValue_Time(TimePlayed);
+
+ level.native_em_level->lev->time =
+ (level.time == 0 ? TimePlayed : TimeLeft);
+ }
+
+ if (tape.recording || tape.playing)
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime);
+ }
+
+ FrameCounter++;
+ TimeFrames++;
+
+ BackToFront();
+ }
+ else
+ {
+ if (game.restart_level)
+ StartGameActions(options.network, setup.autorecord, NEW_RANDOMIZE);
+
+ if (local_player->LevelSolved)
+ GameWon();
+
+ if (AllPlayersGone && !TAPE_IS_STOPPED(tape))
+ TapeStop();
+
+ GameActions();
+ BackToFront();
+
+ if (tape.auto_play && !tape.playing)
+ AutoPlayTape(); /* continue automatically playing next tape */