コード例 #1
0
ファイル: config.c プロジェクト: lunixbochs/fs-uae-gles
static void configure_accuracy(amiga_config *c) {
#ifdef NEW_ACCURACY_SYSTEM
    int cpu_accuracy = fs_config_get_int("cpu_accuracy");
    if (cpu_accuracy == FS_CONFIG_NONE) {
    	cpu_accuracy = fs_config_get_int("accuracy");
    }
    if (cpu_accuracy != FS_CONFIG_NONE) {
    	if (cpu_accuracy <= 0) {
    		amiga_set_option("cpu_cycle_exact", "false");
    		if (g_fs_uae_amiga_model == MODEL_A1200
    				|| g_fs_uae_amiga_model == MODEL_CD32) {
    			// FIXME: test this setting some more
    			//amiga_set_option("cpu_speed", "2");
    		    amiga_set_option("cpu_speed", "0");
    		}
    	}
    	if (cpu_accuracy <= -1) {
    		amiga_set_option("cpu_compatible", "false");
    	}
    }
    int blitter_accuracy = fs_config_get_int("blitter_accuracy");
    if (blitter_accuracy == FS_CONFIG_NONE) {
    	blitter_accuracy = fs_config_get_int("accuracy");
    }
    if (blitter_accuracy != FS_CONFIG_NONE) {
    	if (blitter_accuracy <= 0) {
    		amiga_set_option("blitter_cycle_exact", "false");
    	}
    	if (blitter_accuracy <= -1) {
    		amiga_set_option("immediate_blits", "true");
    	}
    }
    int audio_accuracy = fs_config_get_int("audio_accuracy");
    if (audio_accuracy == FS_CONFIG_NONE) {
    	// we don't want to use interrupts unless we specifically requested
    	// audio_accuracy of -1
    	audio_accuracy = fs_config_get_int_clamped("accuracy", 0, 1);
    }
    if (audio_accuracy != FS_CONFIG_NONE) {
    	if (audio_accuracy == 0) {
    		amiga_set_option("sound_output", "normal");
    	}
    	else if (audio_accuracy <= -1) {
    		amiga_set_option("sound_output", "interrupts");
    	}
    }
#endif
}
コード例 #2
0
void fs_emu_audio_openal_init(void)
{
    fs_log("fs_emu_audio_openal_init\n");
    register_functions();

    // select the "preferred device"
    g_device = alcOpenDevice(NULL);
    if (g_device) {
        fs_log("[OPENAL] Opened device: %s\n",
               alcGetString(g_device, ALC_DEVICE_SPECIFIER));
    } else {
        fs_log("[OPENAL] NULL from alcOpenDevice\n");
        ALenum error_code = alGetError();
        fs_log("[OPENAL] Error code %d\n", error_code);
        if (alGetString(error_code)) {
            fs_log("[OPENAL] %s\n", alGetString(error_code));
        }
        fs_emu_warning("OPENAL: Could not open audio device");
    }
    if (!g_device) {
        return;
    }
    log_openal_info();
    log_openal_devices();

    int frequencies[] = { 48000, 44100, 0 };
    if (fs_config_get_int("audio_frequency") != FS_CONFIG_NONE) {
        frequencies[0] = fs_config_get_int("audio_frequency");
    }

    for (int i = 0; frequencies[i]; i++) {
        int frequency = frequencies[i];
        fs_log("OPENAL: trying frequency %d\n", frequency);
        ALCint attributes[] = {
            ALC_MONO_SOURCES, 0,
            ALC_STEREO_SOURCES, 2,
            ALC_FREQUENCY, frequency,
            0
        };

        g_context = alcCreateContext(g_device, attributes);
        if (g_context) {
            g_audio_out_frequency = frequency;
            break;
        }
    }

    if (g_context) {
        fs_log("OPENAL: created context\n");
        alcMakeContextCurrent(g_context);
        check_al_error("alcMakeContextCurrent");
        fs_log("OPENAL: made context current\n");
    } else {
        fs_emu_warning("OpenAL: no context created\n");
        //check_al_error("alcCreateContext");
    }

    int stereo_sources;
    alcGetIntegerv(g_device, ALC_STEREO_SOURCES, 1, &stereo_sources);
    fs_log("openal: number of stereo sources is %d\n", stereo_sources);

    // FIXME: configure elsewhere
    int abt = fs_config_get_int_clamped("audio_buffer_target_size",
                                        1, 100);
    if (abt == FS_CONFIG_NONE) {
        if (fs_config_get_int("audio_buffer_target_bytes") != FS_CONFIG_NONE) {
            fs_emu_warning("Use audio_buffer_target_size instead\n");
        }
        abt = 40;
#if 0
        if (abt == FS_CONFIG_NONE) {
            abt = 40;
        } else {
            abt = (int) (abt / 1000.0 * (options->frequency * 2 * 2));
        }
#endif
    }
    fs_log("AUDIO: Buffer target size (ms) = %d\n", abt);
    //abt = (int) (abt / 1000.0 * (options->frequency * 2 * 2));
    // fs_log("AUDIO: Buffer target size (bytes) = %d\n", abt);
    /* Specifying fill target in microseconds */
    g_default_fill_target = abt * 1000;
}
コード例 #3
0
ファイル: video_options.c プロジェクト: engur/fs-uae
void fs_emu_video_init_options(void) {

	//int auto_sync_mode = 1;
    //int sync_to_vblank = 1;
    //int sync_with_emu = 0;
    char *sync_mode_str = NULL;

    int fsaa = fs_config_get_int_clamped("fsaa", 0, 4);
    if (fsaa != FS_CONFIG_NONE) {
        fs_log("setting full-scene anti-aliasing (FSAA) to %dx%d\n",
                fsaa, fsaa);
        fs_ml_set_video_fsaa(fsaa);
    }
    else {
        fs_log("full-scene anti-aliasing is not requested\n");
    }

    fs_ml_video_mode mode;
    memset(&mode, 0, sizeof(fs_ml_video_mode));
    if (fs_ml_video_mode_get_current(&mode) == 0) {
        fs_log("current display mode is %dx%d @ %d Hz\n", mode.width,
                mode.height, mode.fps);
        int assume_refresh_rate = fs_config_get_int("assume_refresh_rate");
        if (assume_refresh_rate != FS_CONFIG_NONE) {
            fs_log("assuming host refresh rate: %d Hz (from config)\n",
                    assume_refresh_rate);
            g_fs_emu_video_frame_rate_host = assume_refresh_rate;
        }
        else {
            g_fs_emu_video_frame_rate_host = mode.fps;
        }
    }
    else {
        fs_log("could not get display mode\n");
    }

    fs_log("checking video sync mode\n");

    sync_mode_str = fs_config_get_string("video_sync");
    if (!sync_mode_str) {
        // compatibility key, FIXME: remove when FS-UAE translates compat
        // option names when loading config.
        sync_mode_str = fs_config_get_string("sync");
    }
    if (sync_mode_str) {
        if (g_ascii_strcasecmp(sync_mode_str, "auto") == 0) {
            g_fs_emu_video_sync_to_vblank = 1;
            g_fs_emu_video_allow_full_sync = 1;
        }
        else if (g_ascii_strcasecmp(sync_mode_str, "1") == 0) {
            // shortcut option, nice from command line (e.g. --video-sync)
            g_fs_emu_video_sync_to_vblank = 1;
            g_fs_emu_video_allow_full_sync = 1;
        }
        else if (g_ascii_strcasecmp(sync_mode_str, "full") == 0) {
            // old compatibility option
            g_fs_emu_video_sync_to_vblank = 1;
            g_fs_emu_video_allow_full_sync = 1;
        }
        else if (g_ascii_strcasecmp(sync_mode_str, "0") == 0) {
            // shortcut option, nice from command line (e.g. --no-video-sync)
            g_fs_emu_video_sync_to_vblank = 0;
            g_fs_emu_video_allow_full_sync = 0;
        }
        else if (g_ascii_strcasecmp(sync_mode_str, "off") == 0) {
            //g_fs_emu_video_sync_to_vblank = 0;
            //g_fs_emu_video_allow_full_sync = 0;
        }
        else if (g_ascii_strcasecmp(sync_mode_str, "vblank") == 0) {
            g_fs_emu_video_sync_to_vblank = 1;
        }
        else {
            fs_log("WARNING: invalid value for video-sync: %s\n",
                    sync_mode_str);
        }
        free(sync_mode_str);
    }
    else {
        //fs_log("not specified: using automatic video sync mode\n");

        fs_log("not specified: no video sync\n");
        //g_fs_emu_video_sync_to_vblank = 0;
        //g_fs_emu_video_allow_full_sync = 0;
    }

/*
    if (auto_sync_mode) {
        fs_log("auto sync mode is enabled\n");
        if (frame_rate && frame_rate == mode.fps) {
            fs_log("frame rate (%d) equals screen refresh (%d)\n",
                    frame_rate, mode.fps);
            sync_to_vblank = 1;
            sync_with_emu = 1;
        }
        else {
            fs_log("frame rate (%d) does not equal screen refresh (%d)\n",
                    frame_rate, mode.fps);
            sync_to_vblank = 1;
        }
    }
*/

    if (fs_emu_netplay_enabled()) {
        fs_log("netplay is enabled, disabling full video/emulator sync\n");
        g_fs_emu_video_allow_full_sync = 0;
        //sync_with_emu = 0;
        //sync_to_vblank = 0;
    }

    if (fs_config_get_boolean("benchmark") != FS_CONFIG_NONE) {
        fs_log("benchmarking enable, disabling video sync\n");
        g_fs_emu_video_sync_to_vblank = 0;
        //sync_with_emu = 0;
        g_fs_emu_benchmarking = 1;
        g_fs_ml_benchmarking = 1;

        g_fs_emu_video_allow_full_sync = 0;
    }

    //if (sync_with_emu && !g_fs_emu_full_sync_allowed) {

    // FIXME: check where g_fs_emu_full_sync_allowed is used
    if (!g_fs_emu_full_sync_allowed) {
        fs_log("full video/emu sync is not allowed in this mode\n");
        //sync_with_emu = 0;
        g_fs_emu_video_allow_full_sync = 0;
    }

    /*
    if (sync_with_emu) {
        fs_log("will sync emulation and video with vblank\n");
        fs_ml_video_sync_enable();

        if (frame_rate && mode.fps) {
            double pitch = (1.0 * mode.fps) / frame_rate;
            fs_log("changing audio pitch to %0.2f based on frame rates\n",
                    pitch);
            fs_emu_audio_set_default_pitch(pitch);
        }
    }
    else if (sync_to_vblank) {
        fs_log("will sync video output only to vblank (no tearing)\n");
        fs_ml_vblank_sync_enable();
    }
    else {
        fs_log("no video sync\n");
    }
    */

    if (g_fs_emu_video_sync_to_vblank) {
        fs_log("will sync video updates to vblank\n");
        fs_ml_vblank_sync_enable();
    }
    else {
        fs_log("no video sync (using timers only)\n");
    }

    if (fs_config_get_boolean("disable_aspect_correction") == 1) {
        g_fs_emu_disable_aspect_correction = 1;
    }
    else if (fs_config_get_boolean("keep_aspect") == 1) {
        fs_emu_video_set_aspect_correction(1);
    }

    // the default texture format is RGB, set here because some video
    // formats implicitly changes the default texture format
    g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB;

    const char *s = fs_config_get_const_string("video_format");
    if (s) {
        if (g_ascii_strcasecmp(s, "bgra") == 0) {
            fs_log("using video format BGRA\n");
            g_fs_emu_video_format = FS_EMU_VIDEO_FORMAT_BGRA;
            g_fs_emu_video_bpp = 4;
        }
        else if (g_ascii_strcasecmp(s, "rgba") == 0) {
            fs_log("using video format RGBA\n");
            g_fs_emu_video_format = FS_EMU_VIDEO_FORMAT_RGBA;
            g_fs_emu_video_bpp = 4;
        }
        else if (g_ascii_strcasecmp(s, "rgb") == 0) {
            fs_log("using video format RGB\n");
            g_fs_emu_video_format = FS_EMU_VIDEO_FORMAT_RGB;
            g_fs_emu_video_bpp = 3;
        }
        else if (g_ascii_strcasecmp(s, "rgb565") == 0) {
            fs_log("using video format RGB565\n");
            g_fs_emu_video_format = FS_EMU_VIDEO_FORMAT_R5G6B5;
            g_fs_emu_video_bpp = 2;
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB5;
        }
        else if (g_ascii_strcasecmp(s, "rgba5551") == 0) {
            fs_log("using video format RGBA5551\n");
            g_fs_emu_video_format = FS_EMU_VIDEO_FORMAT_R5G5B5A1;
            g_fs_emu_video_bpp = 2;
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB5_A1;
        }
        else {
            fs_emu_warning("Unknown video format");
        }
    }
    if (!g_fs_emu_video_format) {
        fs_log("using default video format BGRA\n");
        g_fs_emu_video_format = FS_EMU_VIDEO_FORMAT_BGRA;
        g_fs_emu_video_bpp = 4;
    }

    s = fs_config_get_const_string("texture_format");
    if (s) {
        if (g_ascii_strcasecmp(s, "rgb") == 0) {
            fs_log("using texture format RGB\n");
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB;
        }
        else if (g_ascii_strcasecmp(s, "rgb8") == 0) {
            fs_log("using texture format RGB8\n");
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB8;
        }
        else if (g_ascii_strcasecmp(s, "rgba") == 0) {
            fs_log("using texture format RGBA\n");
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGBA;
        }
        else if (g_ascii_strcasecmp(s, "rgba8") == 0) {
            fs_log("using texture format RGBA8\n");
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGBA8;
        }
        else if (g_ascii_strcasecmp(s, "rgb5") == 0) {
            fs_log("using texture format RGB5\n");
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB5;
        }
        else if (g_ascii_strcasecmp(s, "rgb5_a1") == 0) {
            fs_log("using texture format RGB5_A1\n");
            g_fs_emu_texture_format = FS_EMU_TEXTURE_FORMAT_RGB5_A1;
        }
        else {
            fs_emu_warning("Unknown texture format (using default)");
        }
    }
    else {
        fs_log("using default texture format\n");
    }

    double dval;

    if (fs_config_get_boolean("scanlines") == 1) {
        g_fs_emu_scanlines = 1;
    }
    dval = fs_config_get_double_clamped("scanlines_light", 0, 100);
    if (dval != FS_CONFIG_NONE) {
        g_fs_emu_scanlines_light = 255.0 * dval / 100.0;
    }
    dval = fs_config_get_double_clamped("scanlines_dark", 0, 100);
    if (dval != FS_CONFIG_NONE) {
        g_fs_emu_scanlines_dark = 255.0 * dval / 100.0;
    }
}
コード例 #4
0
ファイル: config-hardware.c プロジェクト: adurdin/fs-uae
static void configure_cpu(void)
{
    bool uae_cpu_24bit_addressing = !cfg->cpu_32bit_addressing;
    const char *uae_cpu_model = cfg->default_cpu;
    const char *uae_fpu_model = cfg->default_fpu;
    const char *uae_mmu_model = cfg->default_mmu;
    //bool allow_6888x_fpu = false;
    //bool allow_68040_fpu = false;
    //bool allow_68060_fpu = false;

    const char *cpu = fs_config_get_const_string(OPTION_CPU);
    if (cpu == NULL) {
        cpu = cfg->accelerator_cpu;
    }
    if (cpu == NULL || fs_uae_values_matches(cpu, "auto")) {
        /* Go with the already configured value */
    } else if (fs_uae_values_matches(cpu, "68000")) {
        uae_cpu_24bit_addressing = true;
        uae_cpu_model = "68000";
        uae_fpu_model = "0";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68010")) {
        uae_cpu_24bit_addressing = true;
        uae_cpu_model = "68010";
        uae_fpu_model = "0";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68EC020")) {
        uae_cpu_24bit_addressing = true;
        uae_cpu_model = "68020";
        uae_fpu_model = cfg->default_fpu_noninternal;
        uae_mmu_model = "0";
        //allow_6888x_fpu = true;
    } else if (fs_uae_values_matches(cpu, "68020")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68020";
        uae_fpu_model = cfg->default_fpu_noninternal;
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68EC030")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68030";
        uae_fpu_model = "0";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68030")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68030";
        uae_fpu_model = cfg->default_fpu_noninternal;
        uae_mmu_model = "68030";
    } else if (fs_uae_values_matches(cpu, "68EC040")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68040";
        uae_fpu_model = "0";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68LC040")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68040";
        uae_fpu_model = "0";
        uae_mmu_model = "68040";
    } else if (fs_uae_values_matches(cpu, "68040")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68040";
        uae_fpu_model = "68040";
        uae_mmu_model = "68040";
    } else if (fs_uae_values_matches(cpu, "68040-NOMMU")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68040";
        uae_fpu_model = "68040";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68EC060")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68060";
        uae_fpu_model = "0";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68LC060")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68060";
        uae_fpu_model = "0";
        uae_mmu_model = "68060";
    } else if (fs_uae_values_matches(cpu, "68060-NOMMU")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68060";
        uae_fpu_model = "68060";
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(cpu, "68060")) {
        uae_cpu_24bit_addressing = false;
        uae_cpu_model = "68060";
        uae_fpu_model = "68060";
        uae_mmu_model = "68060";
    } else {
        fs_emu_warning("Unknown CPU specified");
    }

    const char *fpu = fs_config_get_const_string(OPTION_FPU);
    if (fpu == NULL || fs_uae_values_matches(fpu, "auto")) {
        /* Go with the already configured value */
    } else if (fs_uae_values_matches(fpu, "0")) {
        uae_fpu_model = "0";
    } else if (fs_uae_values_matches(fpu, "68881")) {
        if (fs_uae_values_matches(uae_cpu_model, "68020")
                || fs_uae_values_matches(uae_cpu_model, "68030")) {
            uae_fpu_model = "68881";
        } else {
            fs_emu_warning("68881 FPU must be paired with 68020/68030 CPU\n");
        }
    } else if (fs_uae_values_matches(fpu, "68882")) {
        if (strcmp(uae_cpu_model, "68020") == 0
                || strcmp(uae_cpu_model, "68030") == 0) {
            uae_fpu_model = "68882";
        } else {
            fs_emu_warning("68882 FPU must be paired with 68020/68030 CPU\n");
        }
    } else if (fs_uae_values_matches(fpu, "68040")) {
        if (strcmp(uae_cpu_model, "68040") == 0) {
            uae_fpu_model = "68040";
        } else {
            fs_emu_warning("68040 FPU must be paired with 68040 CPU");
        }
    } else if (fs_uae_values_matches(fpu, "68060")) {
        if (strcmp(uae_cpu_model, "68060") == 0) {
            uae_fpu_model = "68060";
        } else {
            fs_emu_warning("68060 FPU must be paired with 68060 CPU");
        }
    } else {
        fs_emu_warning("Unknown FPU specified");
    }

    const char *mmu = fs_config_get_const_string(OPTION_MMU);
    if (mmu == NULL || fs_uae_values_matches(mmu, "auto")) {
        /* Go with the already configured value */
    } else if (fs_uae_values_matches(mmu, "0")) {
        uae_mmu_model = "0";
    } else if (fs_uae_values_matches(mmu, "68030")) {
        if (strcmp(uae_cpu_model, "68030") == 0) {
            uae_mmu_model = "68030";
        } else {
            fs_emu_warning("68030 MMU must be paired with 68030 CPU");
        }
    } else if (fs_uae_values_matches(mmu, "68040")) {
        if (strcmp(uae_cpu_model, "68040") == 0) {
            uae_mmu_model = "68040";
        } else {
            fs_emu_warning("68040 MMU must be paired with 68040 CPU");
        }
    } else if (fs_uae_values_matches(mmu, "68060")) {
        if (strcmp(uae_cpu_model, "68060") == 0) {
            uae_mmu_model = "68060";
        } else {
            fs_emu_warning("68060 MMU must be paired with 68060 CPU");
        }
    } else {
        fs_emu_warning("Unknown MMU specified");
    }

    if (uae_cpu_model[0]) {
        amiga_set_option("cpu_model", uae_cpu_model);
    }
    if (uae_fpu_model[0]) {
        amiga_set_option("fpu_model", uae_fpu_model);
    }
    if (uae_mmu_model[0]) {
        amiga_set_option("mmu_model", uae_mmu_model);
    }

    if (uae_cpu_24bit_addressing) {
        amiga_set_option("cpu_24bit_addressing", "true");
    } else {
        amiga_set_option("cpu_24bit_addressing", "false");
    }
    cfg->cpu_32bit_addressing = !uae_cpu_24bit_addressing;
    cfg->allow_z3_memory = !uae_cpu_24bit_addressing;

    int accuracy = fs_config_get_int("accuracy");
    if (accuracy == FS_CONFIG_NONE) {
        accuracy = 1;
    }

    int blitter_mode = BLITTER_MODE_NORMAL;
    int cpu_mode = CPU_MODE_CYCLE_EXACT;
    int cpu_speed = CPU_SPEED_REAL;

    if (strcmp(uae_cpu_model, "68030") == 0 ||
            strcmp(uae_cpu_model, "68040") == 0 ||
            strcmp(uae_cpu_model, "68060") == 0) {
        cpu_speed = CPU_SPEED_MAX;
        cpu_mode = CPU_MODE_NONCOMPATIBLE;
    } else {
        cpu_speed = CPU_SPEED_REAL;
        if (accuracy > 0) {
            cpu_mode = CPU_MODE_CYCLE_EXACT;
        } else if (accuracy == 0) {
            cpu_mode = CPU_MODE_COMPATIBLE;
        } else if (accuracy < 0) {
            cpu_mode = CPU_MODE_NONCOMPATIBLE;
        }
    }

    if (cpu_mode == CPU_MODE_CYCLE_EXACT &&
            strcmp(uae_cpu_model, "68000") == 0) {
        blitter_mode = BLITTER_MODE_NORMAL;
    } else if (accuracy < 0) {
        blitter_mode = BLITTER_MODE_IMMEDIATE;
    } else {
        blitter_mode = BLITTER_MODE_WAITING;
    }

    if (cpu_speed == CPU_SPEED_MAX) {
        amiga_set_option("cpu_speed", "max");
    } else {
        amiga_set_option("cpu_speed", "real");
    }

    if (cpu_mode == CPU_MODE_CYCLE_EXACT) {
        amiga_set_option("blitter_cycle_exact", "true");
        amiga_set_option("cpu_compatible", "true");
        amiga_set_option("cpu_cycle_exact", "true");
    } else if (cpu_mode == CPU_MODE_COMPATIBLE) {
        amiga_set_option("blitter_cycle_exact", "false");
        amiga_set_option("cpu_compatible", "true");
        amiga_set_option("cpu_cycle_exact", "false");
    } else if (cpu_mode == CPU_MODE_NONCOMPATIBLE) {
        amiga_set_option("blitter_cycle_exact", "false");
        amiga_set_option("cpu_compatible", "false");
        amiga_set_option("cpu_cycle_exact", "false");
    }

    if (blitter_mode == BLITTER_MODE_NORMAL) {
        amiga_set_option("waiting_blits", "false");
        amiga_set_option("immediate_blits", "false");
    } else if (blitter_mode == BLITTER_MODE_WAITING) {
        amiga_set_option("waiting_blits", "true");
        amiga_set_option("immediate_blits", "false");
    } else if (blitter_mode == BLITTER_MODE_IMMEDIATE) {
        amiga_set_option("waiting_blits", "false");
        amiga_set_option("immediate_blits", "true");
    }

    int cpu_idle = fs_config_get_int_clamped(OPTION_CPU_IDLE, 0, 10);
    if (cpu_idle == FS_CONFIG_NONE) {
        cpu_idle = cfg->cpu_idle;
    }
    if (cpu_idle != FS_CONFIG_NONE) {
        fs_log("Setting cpu_idle to %d\n", cpu_idle);
        amiga_set_cpu_idle(cpu_idle);
    }
}
コード例 #5
0
ファイル: config.c プロジェクト: lunixbochs/fs-uae-gles
void fs_uae_configure_amiga_model() {
    char *path;

    fs_emu_log("fs_uae_configure_amiga_model\n");
    fs_uae_init_configs();
    //amiga_set_option("kickstart_rom_file", "aa:AROS");

    if (fs_config_get_boolean("ntsc_mode") == 1) {
        fs_emu_log("enabling NTSC mode (60Hz)\n");
        g_fs_uae_ntsc_mode = 1;
        fs_emu_set_video_frame_rate(60);
    }
    else {
        fs_emu_log("using PAL mode (50Hz)\n");
        fs_emu_set_video_frame_rate(50);
    }

    g_fs_uae_amiga_config = -1;

    const char *config_model = fs_config_get_const_string("amiga_model");
    if (config_model == NULL) {
        config_model = fs_config_get_const_string("model");
    }
    if (config_model) {
        int i = 0;
        for (amiga_config* c = g_fs_uae_amiga_configs; c->id; c++, i++) {
            if (fs_ascii_strcasecmp(config_model, c->id) == 0) {
                fs_emu_log("config match for \"%s\"\n", c->id);
                g_fs_uae_amiga_config = i;
                break;
            }

        }
    }
    if (g_fs_uae_amiga_config == -1) {
        fs_emu_log("WARNING: unknown amiga config specified, using A500\n");
        g_fs_uae_amiga_config = CONFIG_A500;
    }

    amiga_config *c = g_fs_uae_amiga_configs + g_fs_uae_amiga_config;
    g_fs_uae_amiga_model = c->model;
    g_accuracy = fs_config_get_int_clamped("accuracy", -2, 1);

    if (c->no_accuracy_adjustment) {
        fs_emu_log("ignoring accuracy for this model\n");
        g_accuracy = 1;
    }

    if (g_accuracy == FS_CONFIG_NONE) {
        g_accuracy = 1;
    }
    if (g_accuracy <= c->fast_on_accuracy_level) {
        fs_emu_log("this model / accuracy combination is a "
                "\"fastest possibly\" mode\n");
        g_fs_uae_fastest_possible = 1;
    }

    if (!fs_emu_get_title()) {
        fs_emu_set_title(c->name);
    }
    if (!fs_emu_get_sub_title()) {
        fs_emu_set_sub_title("FS-UAE");
    }
}