当前位置: 首页>>代码示例>>C++>>正文


C++ software_get_default_slot函数代码示例

本文整理汇总了C++中software_get_default_slot函数的典型用法代码示例。如果您正苦于以下问题:C++ software_get_default_slot函数的具体用法?C++ software_get_default_slot怎么用?C++ software_get_default_slot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了software_get_default_slot函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: software_get_default_slot

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");
}
开发者ID:Ashura-X,项目名称:mame,代码行数:10,代码来源:exp.cpp

示例2: head

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");
}
开发者ID:stengun,项目名称:mame,代码行数:31,代码来源:a800_slot.cpp

示例3: head

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");
}
开发者ID:Enverex,项目名称:mame,代码行数:35,代码来源:a800_slot.cpp

示例4: core_fsize

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");
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:26,代码来源:sega8_slot.c

示例5: core_fsize

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");
}
开发者ID:DanielAeolusLaude,项目名称:mame,代码行数:25,代码来源:slot.c

示例6: core_fsize

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");
}
开发者ID:crazii,项目名称:mameplus,代码行数:25,代码来源:slot.c

示例7: core_fsize

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");
}
开发者ID:BrandoCommando,项目名称:mame,代码行数:26,代码来源:sega8_slot.c

示例8: 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");
}
开发者ID:GiuseppeGorgoglione,项目名称:mame,代码行数:25,代码来源:sega8_slot.cpp

示例9: core_fsize

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");
}
开发者ID:BenjaminSiskoo,项目名称:mame,代码行数:26,代码来源:slot.cpp

示例10: cbm_crt_get_card

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");
}
开发者ID:Enverex,项目名称:mame,代码行数:12,代码来源:exp.cpp

示例11: cbm_crt_get_card

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");
}
开发者ID:dezi,项目名称:mame-libretro-odroid,代码行数:14,代码来源:exp.c

示例12: cbm_crt_get_card

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");
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:15,代码来源:exp.c

示例13: core_fsize

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");
}
开发者ID:ursine,项目名称:mame,代码行数:44,代码来源:slot.cpp

示例14: rom

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");
}
开发者ID:Dagarman,项目名称:mame,代码行数:19,代码来源:vcs_slot.cpp

示例15: rom

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");
}
开发者ID:Ashura-X,项目名称:mame,代码行数:21,代码来源:vcs_slot.cpp


注:本文中的software_get_default_slot函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。