/* this is called after successful loading */ static void autostart_finish(void) { if (autostart_run_mode == AUTOSTART_MODE_RUN) { log_message(autostart_log, "Starting program."); if ((machine_class == VICE_MACHINE_C128) && (c128_column4080_key == 0)) { kbdbuf_feed("GRAPHIC5:"); } /* log_message(autostart_log, "Run command is: '%s' (%s)", AutostartRunCommand, AutostartDelayRandom ? "delayed" : "no delay"); */ if (AutostartDelayRandom) { kbdbuf_feed_runcmd(AutostartRunCommand); } else { kbdbuf_feed(AutostartRunCommand); } } else { log_message(autostart_log, "Program loaded."); if ((machine_class == VICE_MACHINE_C128) && (c128_column4080_key == 0)) { kbdbuf_feed("GRAPHIC5\x0d"); } } /* printf("autostart_finish cmdline_get_autostart_mode(): %d\n", cmdline_get_autostart_mode()); */ /* inject string given to -keybuf option on commandline into keyboard buffer */ if (cmdline_get_autostart_mode() != AUTOSTART_MODE_NONE) { kbdbuf_feed_cmdline(); } }
/* Initialization. */ void kbdbuf_init(int location, int plocation, int size, CLOCK mincycles) { int isautoload = (cmdline_get_autostart_mode() != AUTOSTART_MODE_NONE); if (!isautoload) { mincycles += KbdbufDelay; } kbdbuf_flush_alarm = alarm_new(maincpu_alarm_context, "Keybuf", kbdbuf_flush_alarm_triggered, NULL); kbdbuf_reset(location, plocation, size, mincycles); /* printf("kbdbuf_init cmdline_get_autostart_mode(): %d\n", cmdline_get_autostart_mode()); */ /* inject string given to -keybuf option on commandline into keyboard buffer, except autoload/start was used, then it is postponed to after the loading */ if (!isautoload) { kbdbuf_feed_cmdline(); } }