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"); }
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 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"); }
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 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"); }
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 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 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"); }
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"); }
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 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 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"); }
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"); }
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 isa16_device::device_config_complete() { // inherit a copy of the static data const isa16bus_interface *intf = reinterpret_cast<const isa16bus_interface *>(static_config()); if (intf != NULL) { *static_cast<isa16bus_interface *>(this) = *intf; memcpy(&(isa8bus_interface::m_out_irq2_cb),&(isa16bus_interface::m_out_irq2_cb), sizeof(isa16bus_interface::m_out_irq2_cb)); memcpy(&(isa8bus_interface::m_out_irq3_cb),&(isa16bus_interface::m_out_irq3_cb), sizeof(isa16bus_interface::m_out_irq3_cb)); memcpy(&(isa8bus_interface::m_out_irq4_cb),&(isa16bus_interface::m_out_irq4_cb), sizeof(isa16bus_interface::m_out_irq4_cb)); memcpy(&(isa8bus_interface::m_out_irq5_cb),&(isa16bus_interface::m_out_irq5_cb), sizeof(isa16bus_interface::m_out_irq5_cb)); memcpy(&(isa8bus_interface::m_out_irq6_cb),&(isa16bus_interface::m_out_irq6_cb), sizeof(isa16bus_interface::m_out_irq6_cb)); memcpy(&(isa8bus_interface::m_out_irq7_cb),&(isa16bus_interface::m_out_irq7_cb), sizeof(isa16bus_interface::m_out_irq7_cb)); memcpy(&(isa8bus_interface::m_out_drq1_cb),&(isa16bus_interface::m_out_drq1_cb), sizeof(isa16bus_interface::m_out_drq1_cb)); memcpy(&(isa8bus_interface::m_out_drq2_cb),&(isa16bus_interface::m_out_drq2_cb), sizeof(isa16bus_interface::m_out_drq2_cb)); memcpy(&(isa8bus_interface::m_out_drq3_cb),&(isa16bus_interface::m_out_drq3_cb), sizeof(isa16bus_interface::m_out_drq3_cb)); } // or initialize to defaults if none provided else { memset(&(isa8bus_interface::m_out_irq2_cb), 0, sizeof(isa8bus_interface::m_out_irq2_cb)); memset(&(isa8bus_interface::m_out_irq3_cb), 0, sizeof(isa8bus_interface::m_out_irq3_cb)); memset(&(isa8bus_interface::m_out_irq4_cb), 0, sizeof(isa8bus_interface::m_out_irq4_cb)); memset(&(isa8bus_interface::m_out_irq5_cb), 0, sizeof(isa8bus_interface::m_out_irq5_cb)); memset(&(isa8bus_interface::m_out_irq6_cb), 0, sizeof(isa8bus_interface::m_out_irq6_cb)); memset(&(isa8bus_interface::m_out_irq7_cb), 0, sizeof(isa8bus_interface::m_out_irq7_cb)); memset(&m_out_irq10_cb, 0, sizeof(m_out_irq10_cb)); memset(&m_out_irq11_cb, 0, sizeof(m_out_irq11_cb)); memset(&m_out_irq12_cb, 0, sizeof(m_out_irq12_cb)); memset(&m_out_irq14_cb, 0, sizeof(m_out_irq14_cb)); memset(&m_out_irq15_cb, 0, sizeof(m_out_irq15_cb)); memset(&m_out_drq0_cb, 0, sizeof(m_out_drq0_cb)); memset(&(isa8bus_interface::m_out_drq1_cb), 0, sizeof(isa8bus_interface::m_out_drq1_cb)); memset(&(isa8bus_interface::m_out_drq2_cb), 0, sizeof(isa8bus_interface::m_out_drq2_cb)); memset(&(isa8bus_interface::m_out_drq3_cb), 0, sizeof(isa8bus_interface::m_out_drq3_cb)); memset(&m_out_drq5_cb, 0, sizeof(m_out_drq5_cb)); memset(&m_out_drq6_cb, 0, sizeof(m_out_drq6_cb)); memset(&m_out_drq7_cb, 0, sizeof(m_out_drq7_cb)); } m_maincpu = mconfig().devicelist().find(m_cputag); }
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"); }
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 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"); }
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 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 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"); }
std::string apf_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 = 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(); return std::string(slot_string); } return software_get_default_slot("std"); }
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"); }
void msx_slot_cartridge_device::get_default_card_software(std::string &result) { if (open_image_file(mconfig().options())) { const char *slot_string = "nomapper"; UINT32 length = core_fsize(m_file); dynamic_buffer rom(length); int type = NOMAPPER; // Check if there's some mapper related information in the hashfiles std::string extrainfo; if (hashfile_extrainfo(*this, extrainfo)) { int extrainfo_type = -1; if (1 == sscanf(extrainfo.c_str(), "%d", &extrainfo_type)) { static const struct { int extrainfo; int mapper; } extrainfo_map[] = { //{ 0, NOMAPPER }, { 1, MSXDOS2 }, { 2, KONAMI_SCC }, { 3, KONAMI }, { 4, ASCII8 }, { 5, ASCII16 }, { 6, GAMEMASTER2 }, { 7, ASCII8_SRAM }, { 8, ASCII16_SRAM }, { 9, RTYPE }, { 10, MAJUTSUSHI }, { 11, FMPAC }, { 12, SUPERLODERUNNER }, { 13, SYNTHESIZER }, { 14, CROSSBLAIM }, { 15, DISK_ROM }, { 16, KOREAN_80IN1 }, { 17, KOREAN_126IN1 } }; for (int i = 0; i < ARRAY_LENGTH(extrainfo_map); i++) { if (extrainfo_map[i].extrainfo == extrainfo_type) { type = extrainfo_map[i].mapper; } } } } if (type == NOMAPPER) { // Not identified through hashfile, try automatic detection type = get_cart_type(&rom[0], length); } if (type > NOMAPPER) { slot_string = msx_cart_get_slot_option(type); } result.assign(slot_string); return; } software_get_default_slot(result, "nomapper"); }
void legacy_device_base::device_validity_check(validity_checker &valid) const { device_validity_check_func validity_func = reinterpret_cast<device_validity_check_func>(get_legacy_fct(DEVINFO_FCT_VALIDITY_CHECK)); if (validity_func != NULL) (*validity_func)(&mconfig().gamedrv(), this, mconfig().options()); }
void isa16_device::device_config_complete() { m_maincpu = mconfig().device<cpu_device>(m_cputag); }