Exemplo n.º 1
0
static void configure_memory(amiga_config *c) {
    int chip_memory = fs_config_get_int("chip_memory");
    if (chip_memory != FS_CONFIG_NONE) {
        if (chip_memory % 512 == 0) {
            amiga_set_int_option("chipmem_size", chip_memory / 512);
        }
        else {
            fs_emu_warning("chip_memory must be a multiple of 512");
            chip_memory = 0;
        }
    }
    else {
    	chip_memory = 0;
    }
    int slow_memory = fs_config_get_int("slow_memory");
    if (slow_memory != FS_CONFIG_NONE) {
        if (slow_memory % 256 == 0) {
            amiga_set_int_option("bogomem_size", slow_memory / 256);
        }
        else {
            fs_emu_warning("slow_memory must be a multiple of 256");
            slow_memory = 0;
        }
    }
    else {
    	slow_memory = 0;
    }
    int fast_memory = fs_config_get_int("fast_memory");
    if (fast_memory != FS_CONFIG_NONE) {
        if (fast_memory % 1024 == 0) {
            amiga_set_int_option("fastmem_size", fast_memory / 1024);
        }
        else {
            fs_emu_warning("fast_memory must be a multiple of 1024");
            fast_memory = 0;
        }
    }
    else {
    	fast_memory = 0;
    }
    int z3_memory = fs_config_get_int("zorro_iii_memory");
    if (z3_memory != FS_CONFIG_NONE) {
        if (z3_memory && !c->allow_z3_memory) {
            fs_emu_warning("Zorro III fast memory needs a processor "
                    "with 32-bit addressing");
            z3_memory = 0;
        }
        else if (z3_memory % 1024 == 0) {
            amiga_set_int_option("z3mem_size", z3_memory / 1024);
        }
        else {
            fs_emu_warning("zorro_iii_memory must be a multiple of 1024");
            z3_memory = 0;
        }
    }
    else {
    	z3_memory = 0;
    }
}
Exemplo n.º 2
0
void fs_uae_configure_graphics_card(amiga_config *c)
{
    const char *card = NULL;
    int memory = 0;
    bool found = false;

    if (fs_config_get_const_string(OPTION_GRAPHICS_CARD)) {
        card = fs_config_get_const_string(OPTION_GRAPHICS_CARD);
    } else {
        int uaegfx_card = fs_config_get_boolean(OPTION_UAEGFX_CARD);
        if (uaegfx_card != FS_CONFIG_NONE) {
            fs_log("DEPRECATED: uaegfx_card is deprecated, use graphics_card "
                   "instead\n");
            if (uaegfx_card == 1) {
                if (!c->allow_z3_memory) {
                    fs_emu_warning(_("Option uaegfx.card needs a CPU with "
                                     "32-bit addressing"));
                } else {
                    card = "ZorroIII";
                    memory = 32;
                    found = true;
                }
            }
        }
    }

    if (card == NULL) {
        /* For example A4000/OS4 defaults to picasso-iv-z3 */
        card = cfg->default_graphics_card;
    }

    CHECK_CARD("none", NULL, 0, NULL, 0)
    CHECK_CARD("uaegfx", "ZorroII", 8, "ZorroIII", 512)
    CHECK_CARD("picasso-ii", "PicassoII", 2, NULL, 0)
    CHECK_CARD("picasso-ii+", "PicassoII+", 2, NULL, 0)
    CHECK_CARD("picasso-iv", "PicassoIV_Z2", 4, "PicassoIV_Z3", 4)

    if (card && !found) {
        fs_emu_warning("Unsupported graphics card: %s\n", card);
    }

    if (fs_config_get_const_string(OPTION_GRAPHICS_CARD_MEMORY)) {
        memory = fs_uae_read_memory_option(OPTION_GRAPHICS_CARD_MEMORY);
        memory /= 1024;
        fs_log("CONFIG: Overriding graphics card memory: %d MB\n", memory);
    }

    if (card != NULL) {
        if (memory != 0) {
            amiga_set_option("gfxcard_type", card);
            amiga_set_int_option("gfxcard_size", memory);
        }
    }

    char *path = fs_config_get_string(OPTION_GRAPHICS_CARD_ROM);
    if (path) {
        path = fs_uae_expand_path_and_free(path);
        path = fs_uae_resolve_path_and_free(path, FS_UAE_ROM_PATHS);
        amiga_set_option("picassoiv_rom_file", path);
        g_free(path);
    }
}
Exemplo n.º 3
0
static void configure_memory()
{
    int chip_memory = fs_uae_read_memory_option_small(OPTION_CHIP_MEMORY);
    if (chip_memory != FS_CONFIG_NONE) {
        if (chip_memory == 128) {
            amiga_set_int_option("chipmem_size", -1); /* 128 KB */
        } else if (chip_memory == 256) {
            amiga_set_int_option("chipmem_size", 0); /* 256 KB */
        } else if (chip_memory % 512 == 0) {
            amiga_set_int_option("chipmem_size", chip_memory / 512);
            if (chip_memory >= 2 && cfg->can_use_ecs_agnus) {
                fs_log("[CONFIG] >= 1 MB chip RAM, enabling ECS Agnus\n");
                amiga_set_option("chipset", "ecs_agnus");
            }
        } else {
            fs_emu_warning(_("Option chip_memory must be a multiple of 512"));
            chip_memory = 0;
        }
    } else {
        chip_memory = 0;
    }

    int slow_memory = fs_uae_read_memory_option_small(OPTION_SLOW_MEMORY);
    if (slow_memory != FS_CONFIG_NONE) {
        if (slow_memory % 256 == 0) {
            amiga_set_int_option("bogomem_size", slow_memory / 256);
        } else {
            fs_emu_warning(_("Option slow_memory must be a multiple of 256"));
            slow_memory = 0;
        }
    } else {
        slow_memory = 0;
    }

    int fast_memory = fs_uae_read_memory_option(OPTION_FAST_MEMORY);
    if (fast_memory != FS_CONFIG_NONE) {
        if (fast_memory % 1024 == 0) {
            amiga_set_int_option("fastmem_size", fast_memory / 1024);
        } else {
            fs_emu_warning(_("Option fast_memory must be a multiple of 1024"));
            fast_memory = 0;
        }
    } else {
        fast_memory = 0;
    }

    int z3_memory = fs_uae_read_memory_option(OPTION_ZORRO_III_MEMORY);
    if (z3_memory != FS_CONFIG_NONE) {
        if (z3_memory && !cfg->allow_z3_memory) {
            fs_emu_warning(_("Option zorro_iii_memory needs a CPU "
                             "with 32-bit addressing"));
        }
        if (z3_memory % 1024 != 0) {
            fs_emu_warning(_("Option zorro_iii_memory must be a multiple "
                             "of 1024"));
        }
        amiga_set_int_option("z3mem_size", z3_memory / 1024);
    }

    int mb_ram = fs_uae_read_memory_option(OPTION_MOTHERBOARD_RAM);
    if (mb_ram != FS_CONFIG_NONE) {
        if (mb_ram && !cfg->allow_z3_memory) {
            fs_emu_warning(_("Option motherboard_ram needs a CPU "
                             "with 32-bit addressing"));
            mb_ram = 0;
        } else if (mb_ram % 1024 == 0) {
            amiga_set_int_option("a3000mem_size", mb_ram / 1024);
        } else {
            fs_emu_warning(_("Option motherboard_ram must be a multiple "
                             "of 1024"));
            mb_ram = 0;
        }
    } else {
        mb_ram = 0;
    }
}
Exemplo n.º 4
0
void fs_uae_configure_amiga_hardware() {
    amiga_config *c = g_fs_uae_amiga_configs + g_fs_uae_amiga_config;
    char *path;

    fs_emu_log("fs_uae_configure_amiga_hardware\n");

    fs_uae_load_rom_files(fs_uae_kickstarts_dir());

#ifdef NEW_ACCURACY_SYSTEM
    g_accuracy = 1;
#endif
    fs_emu_log("configuring \"%s\", accuracy=%d\n", c->name, g_accuracy);

    amiga_quickstart(c->quickstart_model, c->quickstart_config, g_accuracy);
    amiga_set_option("cachesize", "0");

    if (c->cpu_model) {
        amiga_set_option("cpu_model", c->cpu_model);
    }
    if (c->z3mem_size) {
        amiga_set_int_option("z3mem_size", c->z3mem_size);
    }
    if (c->cpu_32bit_addressing) {
        amiga_set_option("cpu_24bit_addressing", "false");
    }
    if (c->fast) {
        amiga_set_option("cpu_speed", "max");
        amiga_set_option("blitter_cycle_exact", "false");
        amiga_set_option("cpu_cycle_exact", "false");

        amiga_set_option("cpu_compatible", "false");
        amiga_set_option("immediate_blits", "true");


    }

    //if (g_fs_uae_fastest_possible) {
        amiga_set_cpu_idle(2);
    //}

    if (g_fs_uae_ntsc_mode) {
        // FIXME: ciiatod on some Amiga models?
        amiga_set_option("ntsc", "true");
    }

    path = fs_config_get_string("kickstart_file");
    if (path) {
        path = fs_uae_expand_path_and_free(path);
        path = fs_uae_resolve_path_and_free(path, FS_UAE_ROM_PATHS);
        amiga_set_option("kickstart_rom_file", path);
        free(path);
    }
    path = fs_config_get_string("kickstart_ext_file");
    if (path) {
        path = fs_uae_expand_path_and_free(path);
        path = fs_uae_resolve_path_and_free(path, FS_UAE_ROM_PATHS);
        amiga_set_option("kickstart_ext_rom_file", path);
        free(path);
    }

    configure_memory(c);

    if (fs_config_get_boolean("bsdsocket_library") == 1) {
        amiga_set_option("bsdsocket_emu", "yes");
    }

    amiga_enable_serial_port();
    configure_accuracy(c);

    /*
    if (g_fs_uae_amiga_model == MODEL_A500) {
    	if (slow_memory || fast_memory || chip_memory > 512) {
    		fs_log("using A500 and memory expansions, "
    				"enabling real-time clock");
    		amiga_set_option("rtc", "MSM6242B");
    	}
    }
    */

    /*
    char **keys = g_key_file_get_keys(g_fs_uae_config, "uae", NULL, NULL);
    if (keys) {
        for (char **key = keys; *key; key++) {
            char *value = g_key_file_get_string(g_fs_uae_config, "uae",
                    *key, NULL);
            if (value != NULL) {
                amiga_set_option(*key, value);
                free(value);
            }
        }
        g_strfreev(keys);
    }
    */
}