Exemplo n.º 1
0
/* Autostart `file_name', trying to auto-detect its type.  */
int autostart_autodetect(const char *file_name, const char *program_name,
                         unsigned int program_number, unsigned int runmode)
{
    if (network_connected() || event_record_active() || event_playback_active()
        || file_name == NULL) {
        return -1;
    }

    if (!autostart_enabled) {
        log_error(autostart_log,
                  "Autostart is not available on this setup.");
        return -1;
    }

    log_message(autostart_log, "Autodetecting image type of `%s'.", file_name);

    if (autostart_disk(file_name, program_name, program_number, runmode) == 0) {
        log_message(autostart_log, "`%s' recognized as disk image.", file_name);
        return 0;
    }

    if (machine_class != VICE_MACHINE_C64DTV && machine_class != VICE_MACHINE_SCPU64) {
        if (autostart_tape(file_name, program_name, program_number, runmode) == 0) {
            log_message(autostart_log, "`%s' recognized as tape image.", file_name);
            return 0;
        }
    }

    if (autostart_snapshot(file_name, program_name) == 0) {
        log_message(autostart_log, "`%s' recognized as snapshot image.",
                    file_name);
        return 0;
    }

    if ((machine_class == VICE_MACHINE_C64) || (machine_class == VICE_MACHINE_C64SC) ||
       (machine_class == VICE_MACHINE_SCPU64) ||(machine_class == VICE_MACHINE_C128)) {
        if (cartridge_attach_image(CARTRIDGE_CRT, file_name) == 0) {
            log_message(autostart_log, "`%s' recognized as cartridge image.",
                        file_name);
            return 0;
        }
    }

    if (autostart_prg(file_name, runmode) == 0) {
        log_message(autostart_log, "`%s' recognized as program/p00 file.",
                    file_name);
        return 0;
    }

    log_error(autostart_log, "`%s' is not a valid file.", file_name);
    return -1;
}
Exemplo n.º 2
0
/* Autostart `file_name', trying to auto-detect its type.  */
int autostart_autodetect(const char *file_name, const char *program_name,
                         unsigned int program_number, unsigned int runmode)
{
    if (network_connected() || file_name == NULL)
        return -1;

    if (!autostart_enabled) {
        log_error(autostart_log,
                  "Autostart is not available on this setup.");
        return -1;
    }

    log_message(autostart_log, "Autodetecting image type of `%s'.", file_name);

    if (autostart_disk(file_name, program_name, program_number, runmode) == 0) {
        log_message(autostart_log, "`%s' recognized as disk image.", file_name);
		check_for_label_file(file_name);
        return 0;
    }
    if (autostart_tape(file_name, program_name, program_number, runmode) == 0) {
        log_message(autostart_log, "`%s' recognized as tape image.", file_name);
		check_for_label_file(file_name);
        return 0;
    }
    if (autostart_snapshot(file_name, program_name) == 0) {
        log_message(autostart_log, "`%s' recognized as snapshot image.",
                    file_name);
		check_for_label_file(file_name);
        return 0;
    }
    if (autostart_prg(file_name, runmode) == 0) {
        log_message(autostart_log, "`%s' recognized as program/p00 file.",
                    file_name);
		check_for_label_file(file_name);
        return 0;
    }

    log_error(autostart_log, "`%s' is not a valid file.", file_name);
    return -1;
}
Exemplo n.º 3
0
/* Autostart `file_name', trying to auto-detect its type.  */
int autostart_autodetect(const char *file_name, const char *program_name,
                         unsigned int program_number, unsigned int runmode)
{
	if (event_record_active() || event_playback_active() || file_name == NULL)
		return -1;

	if (!autostart_enabled)
	{
		//log_error(autostart_log, "Autostart is not available on this setup.");
		return -1;
	}

	//log_message(autostart_log, "Autodetecting image type of `%s'.", file_name);

	if (autostart_disk(file_name, program_name, program_number, runmode) == 0) {
		//log_message(autostart_log, "`%s' recognized as disk image.", file_name);
		return 0;
	}

	if (machine_class != VICE_MACHINE_C64DTV)
	{
		if (autostart_tape(file_name, program_name, program_number, runmode) == 0) {
			//log_message(autostart_log, "`%s' recognized as tape image.", file_name);
			return 0;
		}
	}

	if (autostart_snapshot(file_name, program_name) == 0) {
		//log_message(autostart_log, "`%s' recognized as snapshot image.", file_name);
		return 0;
	}
	if (autostart_prg(file_name, runmode) == 0) {
		//log_message(autostart_log, "`%s' recognized as program/p00 file.", file_name);
		return 0;
	}

	//log_error(autostart_log, "`%s' is not a valid file.", file_name);
	return -1;
}