static int render_legacy = 0; /* render original amiga screen, if set */
static int render_improved = 0; /* render improved image, if set */
static int debug_opengl = 0; /* render both, amiga screen and improved image, if set */
+static int intro_skipped = 0; /* indicated if we already have landed */
static const char *home_dir;
return 0;
}
+static void skip_intro(void)
+{
+ int event;
+ double render_delay = 0.0;
+ double cycle_count;
+
+ if (intro_skipped)
+ return;
+
+ print_info("*** Skipping intro, fast forwarding... ***\n\n");
+ do {
+ /* render, if not delayed */
+ if (render_delay <= 0.0) {
+ cycle_count = 0;
+ do {
+ cycle_count += execute_cpu(0, &event);
+ } while (event != STOP_AT_WAIT_VBL && event != STOP_AT_CLEAR_SCREEN1);
+ render_delay += (double)cycle_count / CPU_SPEED;
+ }
+ /* VBL */
+ execute_cpu(3, NULL);
+ execute_cpu(4, NULL);
+ /* count down render delay */
+ if (render_delay) {
+ render_delay -= 1.0 / (double)IRQ_RATE;
+ if (render_delay < 0.0)
+ render_delay = 0.0;
+ }
+ } while (event != STOP_AT_CLEAR_SCREEN1);
+
+ intro_skipped = 1;
+}
+
static void special_event(int event)
{
if (render_improved)
cycle_count += execute_cpu(0, &event);
/* handle special events */
special_event(event);
+ if (event == STOP_AT_CLEAR_SCREEN1)
+ intro_skipped = 1;
} while (event != STOP_AT_WAIT_VBL && event != STOP_AT_WAIT_INPUT);
/* stop capturing for improved graphics */
if (render_improved)
}
osd_info("Benson size", (config_benson_size == 0.5) ? "half" : "normal");
break;
+ case SDLK_i:
+ if (!intro_skipped)
+ skip_intro();
+ else
+ osd_info("", "not applicable");
+ break;
case SDLK_c:
if (config_ctrl_c)
quit = 1;
/* start cpu */
reset_cpu();
- if (config_skip_intro) {
- int event;
-
- print_info("*** Skipping intro, fast forwarding... ***\n\n");
- do {
- execute_cpu(0, &event);
- } while (event != STOP_AT_CLEAR_SCREEN1);
- do {
- execute_cpu(0, &event);
- } while (event != STOP_AT_WAIT_VBL);
- }
+ if (config_skip_intro)
+ skip_intro();
/* run game */
main_loop();