static int set_tfe_enabled(int value, void *param) { int val = value ? 1 : 0; if (!tfe_cannot_use) { if (!val) { /* TFE should be deactived */ if (tfe_enabled) { tfe_enabled = 0; if (tfe_deactivate() < 0) { DBG(("TFE: set disabled: error\n")); return -1; } io_source_unregister(tfe_list_item); tfe_list_item = NULL; export_remove(&export_res); } tfe_clockport_changed(); return 0; } else { if (!tfe_enabled) { tfe_enabled = 1; if (tfe_activate() < 0) { return -1; } export_res.io1 = tfe_current_device; if (export_add(&export_res) < 0) { DBG(("TFE: set enabled: error\n")); tfe_list_item = NULL; tfe_enabled = 0; return -1; } if (machine_class == VICE_MACHINE_VIC20) { /* set correct addresses for masC=uerade */ if (tfe_io_swap) { tfe_current_device->start_address = 0x9c00; tfe_current_device->end_address = 0x9fff; } else { tfe_current_device->start_address = 0x9800; tfe_current_device->end_address = 0x9bff; } } tfe_list_item = io_source_register(tfe_current_device); } tfe_clockport_changed(); return 0; } } return 0; }
/* Resets the card */ void mmc64_reset(void) { mmc64_active = 0; mmc64_spi_mode = 0; mmc64_extrom = 0; mmc64_flashmode = 0; mmc64_cport = 0; mmc64_speed = 0; mmc64_cardsel = 0; mmc64_biossel = mmc64_hw_flashjumper; /* disable bios at reset when flash jumper is set */ #if 0 mmc64_extexrom = 0x04; mmc64_extgame = 0x02; #endif if (mmc64_clockport_enabled != 1) { mmc64_clockport_enabled = 1; #ifdef HAVE_TFE tfe_clockport_changed(); #endif } if (mmc64_enabled) { #if USEPASSTHROUGHHACK mmc64_io2_device.io_source_prio = 1; cart_set_port_exrom_slot0(1); cart_port_config_changed_slot0(); #else cart_config_changed_slot0(0, 0, CMODE_READ); #endif } }
/* Resets the card */ void mmc64_reset(void) { mmc64_active = 0; mmc64_spi_mode = 0; mmc64_extrom = 0; mmc64_flashmode = 0; mmc64_cport = 0; mmc64_speed = 0; mmc64_cardsel = 0; mmc64_biossel = 0; mmc64_extexrom = 0x04; mmc64_extgame = 0x02; if (mmc64_clockport_enabled != 1) { mmc64_clockport_enabled = 1; #ifdef HAVE_TFE tfe_clockport_changed(); #endif } if (mmc64_enabled) { #if USEPASSTHROUGHHACK export.exrom = 1; mem_pla_config_changed(); #else cartridge_config_changed(0, 0, CMODE_READ); #endif }
static int set_tfe_rr_net(int val, void *param) { if (!tfe_cannot_use) { if (!val) { /* TFE should not be used as rr net */ if (tfe_as_rr_net) { tfe_as_rr_net = 0; tfe_clockport_changed(); } } else { if (!tfe_as_rr_net) { tfe_as_rr_net = 1; tfe_clockport_changed(); } } } return 0; }