std::string colecovision_cartridge_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { UINT32 length = m_file->size(); if (length == 0x100000 || length == 0x200000) return software_get_default_slot("xin1"); } return software_get_default_slot("standard"); }
void a5200_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "a5200"; dynamic_buffer head(0x10); UINT32 len = core_fsize(m_file); int type = A5200_8K; // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { core_fread(m_file, &head[0], 0x10); type = identify_cart_type(&head[0]); std::string info; if (hashfile_extrainfo(*this, info) && info.compare("A13MIRRORING")==0) type = A5200_16K_2CHIPS; } if (type < A5200_4K) osd_printf_info("This game is not designed for A5200. You might want to run it in A800 or A800XL.\n"); slot_string = a800_get_slot(type); clear(); result.assign(slot_string); } else software_get_default_slot(result, "a5200"); }
void xegs_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "xegs"; dynamic_buffer head(0x10); UINT32 len = core_fsize(m_file); int type = A800_8K; // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { core_fread(m_file, &head[0], 0x10); type = identify_cart_type(&head[0]); } if (type != A800_XEGS) { osd_printf_info("This game is not designed for XEGS. "); if (type >= A5200_4K) osd_printf_info("You might want to run it in A5200.\n"); else osd_printf_info("You might want to run it in A800 or A800XL.\n"); } slot_string = a800_get_slot(type); clear(); result.assign(slot_string); } else software_get_default_slot(result, "xegs"); }
std::string a800_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; std::vector<uint8_t> head(0x10); uint32_t len = m_file->size(); int type = A800_8K; // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { m_file->read(&head[0], 0x10); type = identify_cart_type(&head[0]); } else // otherwise try to guess based on size { if (len == 0x4000) type = A800_16K; if (len == 0x2000) type = A800_8K; } if (type >= A5200_4K) osd_printf_info("This game is not designed for A800. You might want to run it in A5200.\n"); slot_string = a800_get_slot(type); clear(); return std::string(slot_string); } else return software_get_default_slot("a800_8k"); }
const char * sega8_cart_slot_device::get_default_card_software(const machine_config &config, emu_options &options) { if (open_image_file(options)) { const char *slot_string = "rom"; UINT32 len = core_fsize(m_file), offset = 0; UINT8 *ROM = global_alloc_array(UINT8, len); int type; core_fread(m_file, ROM, len); if ((len % 0x4000) == 512) offset = 512; type = get_cart_type(ROM + offset, len - offset); slot_string = sega8_get_slot(type); //printf("type: %s\n", slot_string); global_free(ROM); clear(); return slot_string; } return software_get_default_slot(config, options, this, "rom"); }
std::string a5200_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; std::vector<uint8_t> head(0x10); uint32_t len = m_file->size(); int type = A5200_8K; // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { m_file->read(&head[0], 0x10); type = identify_cart_type(&head[0]); } else { std::string info; if (hashfile_extrainfo(*this, info) && info.compare("A13MIRRORING")==0) type = A5200_16K_2CHIPS; } if (type < A5200_4K) osd_printf_info("This game is not designed for A5200. You might want to run it in A800 or A800XL.\n"); slot_string = a800_get_slot(type); clear(); return std::string(slot_string); } else return software_get_default_slot("a5200"); }
void vc4000_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "std"; UINT32 size = core_fsize(m_file); int type = VC4000_STD; // attempt to identify the non-standard types if (size > 0x1000) // 6k rom + 1k ram - Chess2 only type = VC4000_CHESS2; else if (size > 0x0800) // some 4k roms have 1k of mirrored ram type = VC4000_RAM1K; slot_string = vc4000_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.assign(slot_string); return; } software_get_default_slot(result, "std"); }
std::string xegs_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; std::vector<uint8_t> head(0x10); uint32_t len = m_file->size(); int type = A800_8K; // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { m_file->read(&head[0], 0x10); type = identify_cart_type(&head[0]); } if (type != A800_XEGS) { osd_printf_info("This game is not designed for XEGS. "); if (type >= A5200_4K) osd_printf_info("You might want to run it in A5200.\n"); else osd_printf_info("You might want to run it in A800 or A800XL.\n"); } slot_string = a800_get_slot(type); clear(); return std::string(slot_string); } else return software_get_default_slot("xegs"); }
void apf_cart_slot_device::get_default_card_software(astring &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "std"; UINT32 size = core_fsize(m_file); int type = APF_STD; // attempt to identify Space Destroyer, which needs 1K of additional RAM if (size == 0x1800) type = APF_SPACEDST; if (size > 0x2000) type = APF_BASIC; slot_string = apf_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.cpy(slot_string); return; } software_get_default_slot(result, "std"); }
void sega8_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "rom"; UINT32 len = core_fsize(m_file), offset = 0; dynamic_buffer rom(len); int type; core_fread(m_file, &rom[0], len); if ((len % 0x4000) == 512) offset = 512; type = get_cart_type(&rom[offset], len - offset); slot_string = sega8_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.assign(slot_string); return; } software_get_default_slot(result, "rom"); }
std::string sega8_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 len = m_file->size(), offset = 0; dynamic_buffer rom(len); int type; m_file->read(&rom[0], len); if ((len % 0x4000) == 512) offset = 512; type = get_cart_type(&rom[offset], len - offset); slot_string = sega8_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("rom"); }
std::string vectrex_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 size = core_fsize(m_file); dynamic_buffer rom(size); int type = VECTREX_STD; core_fread(m_file, &rom[0], size); if (!memcmp(&rom[0x06], "SRAM", 4)) type = VECTREX_SRAM; if (size > 0x8000) type = VECTREX_64K; slot_string = vectrex_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("vec_rom"); }
void a800_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "a800_8k"; dynamic_buffer head(0x10); UINT32 len = core_fsize(m_file); int type = A800_8K; // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { core_fread(m_file, &head[0], 0x10); type = identify_cart_type(&head[0]); } else // otherwise try to guess based on size { if (len == 0x4000) type = A800_16K; if (len == 0x2000) type = A800_8K; } if (type >= A5200_4K) osd_printf_info("This game is not designed for A800. You might want to run it in A5200.\n"); slot_string = a800_get_slot(type); clear(); result.assign(slot_string); } else software_get_default_slot(result, "a800_8k"); }
std::string c64_expansion_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { if (is_filetype("crt")) return cbm_crt_get_card(*m_file); clear(); } return software_get_default_slot("standard"); }
const char * c64_expansion_slot_device::get_default_card_software(const machine_config &config, emu_options &options) { if (open_image_file(options)) { if (!mame_stricmp(filetype(), "crt")) { return cbm_crt_get_card(m_file); } clear(); } return software_get_default_slot(config, options, this, "standard"); }
void c64_expansion_slot_device::get_default_card_software(astring &result) { if (open_image_file(mconfig().options())) { if (!mame_stricmp(filetype(), "crt")) { cbm_crt_get_card(result, m_file); return; } clear(); } software_get_default_slot(result, "standard"); }
void crvision_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 size = core_fsize(m_file); int type = CRV_4K; switch (size) { case 0x4800: type = CRV_18K; break; case 0x4000: type = CRV_16K; break; case 0x3000: type = CRV_12K; break; case 0x2800: type = CRV_10K; break; case 0x2000: type = CRV_8K; break; case 0x1800: type = CRV_6K; break; case 0x1000: default: break; } slot_string = crvision_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.assign(slot_string); return; } software_get_default_slot(result, "crv_rom4k"); }
std::string vcs_cart_slot_device::get_default_card_software(get_default_card_software_hook &hook) const { if (hook.image_file()) { const char *slot_string; uint32_t len = hook.image_file()->size(); std::vector<uint8_t> rom(len); int type; hook.image_file()->read(&rom[0], len); type = identify_cart_type(&rom[0], len); slot_string = vcs_get_slot(type); return std::string(slot_string); } else return software_get_default_slot("a26_4k"); }
std::string vcs_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 len = m_file->size(); dynamic_buffer rom(len); int type; m_file->read(&rom[0], len); type = identify_cart_type(&rom[0], len); slot_string = vcs_get_slot(type); clear(); return std::string(slot_string); } else return software_get_default_slot("a26_4k"); }
void vcs_cart_slot_device::get_default_card_software(astring &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "a26_4k"; UINT32 len = core_fsize(m_file); dynamic_buffer rom(len); int type; core_fread(m_file, rom, len); type = identify_cart_type(rom, len); slot_string = vcs_get_slot(type); clear(); result.cpy(slot_string); } else software_get_default_slot(result, "a26_4k"); }
std::string gba_cart_slot_device::get_default_card_software(get_default_card_software_hook &hook) const { if (hook.image_file()) { const char *slot_string; uint32_t len = hook.image_file()->size(); std::vector<uint8_t> rom(len); int type; hook.image_file()->read(&rom[0], len); type = get_cart_type(&rom[0], len); slot_string = gba_get_slot(type); //printf("type: %s\n", slot_string); return std::string(slot_string); } return software_get_default_slot("gba_rom"); }
std::string channelf_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; uint32_t len = m_file->size(); int type; if (len == 0x40000) type = CF_MULTI; else type = CF_CHESS; // is there any way to detect the other carts from fullpath? slot_string = chanf_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("chess"); }
std::string scv_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 len = m_file->size(); dynamic_buffer rom(len); int type; m_file->read(&rom[0], len); type = get_cart_type(&rom[0], len); slot_string = scv_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("rom8k"); }
void gba_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "gba_rom"; UINT32 len = core_fsize(m_file); dynamic_buffer rom(len); int type; core_fread(m_file, &rom[0], len); type = get_cart_type(&rom[0], len); slot_string = gba_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.assign(slot_string); return; } software_get_default_slot(result, "gba_rom"); }
const char * gba_cart_slot_device::get_default_card_software(const machine_config &config, emu_options &options) { if (open_image_file(options)) { const char *slot_string = "gba_rom"; UINT32 len = core_fsize(m_file); UINT8 *ROM = global_alloc_array(UINT8, len); int type; core_fread(m_file, ROM, len); type = get_cart_type(ROM, len); slot_string = gba_get_slot(type); //printf("type: %s\n", slot_string); global_free(ROM); clear(); return slot_string; } return software_get_default_slot(config, options, this, "gba_rom"); }
void channelf_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "chess"; UINT32 len = core_fsize(m_file); int type; if (len == 0x40000) type = CF_MULTI; else type = CF_CHESS; // is there any way to detect the other carts from fullpath? slot_string = chanf_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.assign(slot_string); return; } software_get_default_slot(result, "chess"); }
std::string astrocade_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 size = core_fsize(m_file); int type = ASTROCADE_STD; if (size == 0x40000) type = ASTROCADE_256K; if (size == 0x80000) type = ASTROCADE_512K; slot_string = astrocade_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("rom"); }
std::string o2_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; UINT32 size = m_file->size(); int type = O2_STD; if (size == 12288) type = O2_ROM12; if (size == 16384) type = O2_ROM16; slot_string = o2_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("o2_rom"); }
void o2_cart_slot_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "o2_rom"; UINT32 size = core_fsize(m_file); int type = O2_STD; if (size == 12288) type = O2_ROM12; if (size == 16384) type = O2_ROM16; slot_string = o2_get_slot(type); //printf("type: %s\n", slot_string); clear(); result.assign(slot_string); return; } software_get_default_slot(result, "o2_rom"); }
std::string vc4000_cart_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { const char *slot_string; uint32_t size = m_file->size(); int type = VC4000_STD; // attempt to identify the non-standard types if (size > 0x1000) // 6k rom + 1k ram - Chess2 only type = VC4000_CHESS2; else if (size > 0x0800) // some 4k roms have 1k of mirrored ram type = VC4000_RAM1K; slot_string = vc4000_get_slot(type); //printf("type: %s\n", slot_string); clear(); return std::string(slot_string); } return software_get_default_slot("std"); }