Esempio n. 1
0
static int set_cart2_rom_name(const char *val, void *param)
{
    if (util_string_set(&cart_2_name, val))
        return 0;

    return cbm2rom_load_cart_2(cart_2_name);
}
Esempio n. 2
0
/* Load memory image files. */
int mem_load(void)
{
    int i;
    const char *rom_name = NULL;

    if (cbm2rom_log == LOG_ERR)
        cbm2rom_log = log_open("CBM2MEM");

    rom_loaded = 1;

    if (resources_get_string("ChargenName", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_chargen(rom_name) < 0)
        return -1;

    /* Init Disk/Cartridge ROM with 'unused address' values.  */
    for (i = 0x800; i < 0x8000; i++) {
        mem_rom[i] = 0xff;
    }

    if (resources_get_string("KernalName", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_kernal(rom_name) < 0)
        return -1;

    if (resources_get_string("BasicName", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_basic(rom_name) < 0)
        return -1;

    /* Load extension ROMs.  */
    if (resources_get_string("Cart1Name", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_cart_1(rom_name) < 0)
        return -1;

    if (resources_get_string("Cart2Name", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_cart_2(rom_name) < 0)
        return -1;

    if (resources_get_string("Cart4Name", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_cart_4(rom_name) < 0)
        return -1;

    if (resources_get_string("Cart6Name", &rom_name) < 0)
        return -1;
    if (cbm2rom_load_cart_6(rom_name) < 0)
        return -1;

    /* FIXME: VIC-II config */

    return 0;
}