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


C++ ROM_GETNAME函数代码示例

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


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

示例1: open_rom_file

static int open_rom_file(rom_load_data *romdata, const rom_entry *romp)
{
	mame_file_error filerr = FILERR_NOT_FOUND;
	const game_driver *drv;

	++romdata->romsloaded;

	/* update status display */
	display_loading_rom_message(ROM_GETNAME(romp), romdata);

	/* Attempt reading up the chain through the parents. It automatically also
       attempts any kind of load by checksum supported by the archives. */
	romdata->file = NULL;
	for (drv = Machine->gamedrv; !romdata->file && drv; drv = driver_get_clone(drv))
		if (drv->name && *drv->name)
		{
			UINT8 crcs[4];
			char *fname;

			fname = assemble_3_strings(drv->name, PATH_SEPARATOR, ROM_GETNAME(romp));
			if (hash_data_extract_binary_checksum(ROM_GETHASHDATA(romp), HASH_CRC, crcs))
			{
				UINT32 crc = (crcs[0] << 24) | (crcs[1] << 16) | (crcs[2] << 8) | crcs[3];
				filerr = mame_fopen_crc(SEARCHPATH_ROM, fname, crc, OPEN_FLAG_READ, &romdata->file);
			}
			else
				filerr = mame_fopen(SEARCHPATH_ROM, fname, OPEN_FLAG_READ, &romdata->file);
			free(fname);
		}

	/* return the result */
	return (filerr == FILERR_NONE);
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:33,代码来源:romload.c

示例2: common_process_file

file_error common_process_file(emu_options &options, const char *location, const char *ext, const rom_entry *romp, emu_file &image_file)
{
	file_error filerr;

	if (location != NULL && strcmp(location, "") != 0)
		filerr = image_file.open(location, PATH_SEPARATOR, ROM_GETNAME(romp), ext);
	else
		filerr = image_file.open(ROM_GETNAME(romp), ext);

	return filerr;
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:11,代码来源:romload.c

示例3: determine_bios_rom

static void determine_bios_rom(rom_load_data *romdata)
{
	const char *specbios = romdata->machine().options().bios();
	const char *defaultname = NULL;
	const rom_entry *rom;
	int default_no = 1;
	int bios_count = 0;


	device_t &rootdevice = romdata->machine().config().root_device();
	rootdevice.set_system_bios(0);
	/* first determine the default BIOS name */
	for (rom = rootdevice.rom_region(); !ROMENTRY_ISEND(rom); rom++)
		if (ROMENTRY_ISDEFAULT_BIOS(rom))
			defaultname = ROM_GETNAME(rom);

	/* look for a BIOS with a matching name */
	for (rom = rootdevice.rom_region(); !ROMENTRY_ISEND(rom); rom++)
		if (ROMENTRY_ISSYSTEM_BIOS(rom))
		{
			const char *biosname = ROM_GETNAME(rom);
			int bios_flags = ROM_GETBIOSFLAGS(rom);
			char bios_number[20];

			/* Allow '-bios n' to still be used */
			sprintf(bios_number, "%d", bios_flags - 1);
			if (mame_stricmp(bios_number, specbios) == 0 || mame_stricmp(biosname, specbios) == 0)
				rootdevice.set_system_bios(bios_flags);
			if (defaultname != NULL && mame_stricmp(biosname, defaultname) == 0)
				default_no = bios_flags;
			bios_count++;
		}

	/* if none found, use the default */
	if (rootdevice.system_bios() == 0 && bios_count > 0)
	{
		/* if we got neither an empty string nor 'default' then warn the user */
		if (specbios[0] != 0 && strcmp(specbios, "default") != 0 && romdata != NULL)
		{
			romdata->errorstring.catprintf("%s: invalid bios\n", specbios);
			romdata->warnings++;
		}

		/* set to default */
		rootdevice.set_system_bios(default_no);
	}
	rootdevice.set_default_bios(default_no);
	LOG(("Using System BIOS: %d\n", rootdevice.system_bios()));
}
开发者ID:broftkd,项目名称:mess-svn,代码行数:49,代码来源:romload.c

示例4: common_process_file

std::unique_ptr<emu_file> common_process_file(emu_options &options, const char *location, bool has_crc, UINT32 crc, const rom_entry *romp, file_error &filerr)
{
	auto image_file = std::make_unique<emu_file>(options.media_path(), OPEN_FLAG_READ);

	if (has_crc)
		filerr = image_file->open(location, PATH_SEPARATOR, ROM_GETNAME(romp), crc);
	else
		filerr = image_file->open(location, PATH_SEPARATOR, ROM_GETNAME(romp));

	if (filerr != FILERR_NONE)
	{
		image_file = nullptr;
	}
	return image_file;
}
开发者ID:notaz,项目名称:mame,代码行数:15,代码来源:romload.cpp

示例5: cli_info_listcrc

int cli_info_listcrc(core_options *options, const char *gamename)
{
	int drvindex, count = 0;

	/* iterate over drivers */
	for (drvindex = 0; drivers[drvindex]; drvindex++)
		if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
		{
			const rom_entry *region, *rom;

			/* iterate over regions, and then ROMs within the region */
			for (region = rom_first_region(drivers[drvindex]); region; region = rom_next_region(region))
				for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
				{
					char hashbuf[HASH_BUF_SIZE];

					/* if we have a CRC, display it */
					if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), HASH_CRC, hashbuf))
						mame_printf_info("%s %-12s %s\n", hashbuf, ROM_GETNAME(rom), drivers[drvindex]->description);
				}

			count++;
		}

	/* return an error if none found */
	return (count > 0) ? MAMERR_NONE : MAMERR_NO_SUCH_GAME;
}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:27,代码来源:clifront.c

示例6: copy_rom_data

static void copy_rom_data(romload_private *romdata, const rom_entry *romp)
{
	UINT8 *base = romdata->region->base() + ROM_GETOFFSET(romp);
	const char *srcrgntag = ROM_GETNAME(romp);
	UINT32 numbytes = ROM_GETLENGTH(romp);
	UINT32 srcoffs = (FPTR)ROM_GETHASHDATA(romp);  /* srcoffset in place of hashdata */

	/* make sure we copy within the region space */
	if (ROM_GETOFFSET(romp) + numbytes > romdata->region->bytes())
		fatalerror("Error in RomModule definition: COPY out of target memory region space\n");

	/* make sure the length was valid */
	if (numbytes == 0)
		fatalerror("Error in RomModule definition: COPY has an invalid length\n");

	/* make sure the source was valid */
	memory_region *region = romdata->machine().root_device().memregion(srcrgntag);
	if (region == NULL)
		fatalerror("Error in RomModule definition: COPY from an invalid region\n");

	/* make sure we find within the region space */
	if (srcoffs + numbytes > region->bytes())
		fatalerror("Error in RomModule definition: COPY out of source memory region space\n");

	/* fill the data */
	memcpy(base, region->base() + srcoffs, numbytes);
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:27,代码来源:romload.c

示例7: ROM_GETNAME

HRESULT CRom::Init(const struct GameDriver *gamedrv, const struct RomModule *region, const struct RomModule *rom)
{
	if ( !gamedrv || !region ||!rom )
		return S_FALSE;

	m_gamedrv = gamedrv;
	m_region = region;
	m_rom = rom;

	m_pszName = ROM_GETNAME(m_rom);

	m_dwState = 0;
	m_dwLength = 0;
	m_dwExpLength = 0;

	const struct RomModule *chunk;
	for (chunk = rom_first_chunk(m_rom); chunk; chunk = rom_next_chunk(chunk))
		m_dwExpLength += ROM_GETLENGTH(chunk);

	m_dwChecksum = 0;

	char szExpChecksum[256];
	lstrcpy(szExpChecksum, ROM_GETHASHDATA(m_rom));
	m_dwExpChecksum = GetChecksumFromHash(szExpChecksum);

	m_dwRegionFlags = ROMREGION_GETFLAGS(m_region);

	return S_OK;
}
开发者ID:CarnyPriest,项目名称:SAMbuild,代码行数:29,代码来源:ControllerRom.cpp

示例8: match_roms

static void match_roms(core_options *options, const char *hash, int length, int *found)
{
	int drvindex;

	/* iterate over drivers */
	for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
	{
		machine_config *config = global_alloc(machine_config(drivers[drvindex]->machine_config));
		const rom_entry *region, *rom;
		const rom_source *source;

		/* iterate over sources, regions and files within the region */
		for (source = rom_first_source(drivers[drvindex], config); source != NULL; source = rom_next_source(drivers[drvindex], config, source))
			for (region = rom_first_region(drivers[drvindex], source); region; region = rom_next_region(region))
				for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
					if (hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0))
					{
						int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP);

						/* output information about the match */
						if (*found != 0)
							mame_printf_info("                    ");
						mame_printf_info("= %s%-20s  %-10s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), drivers[drvindex]->name, drivers[drvindex]->description);
						(*found)++;
					}

		global_free(config);
	}

	softlist_match_roms( options, hash, length, found );
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:31,代码来源:clifront.c

示例9: ROM_GETNAME

void rom_load_manager::determine_bios_rom(device_t *device, const char *specbios)
{
	const char *defaultname = nullptr;
	const rom_entry *rom;
	int default_no = 1;
	int bios_count = 0;

	device->set_system_bios(0);

	/* first determine the default BIOS name */
	for (rom = device->rom_region(); !ROMENTRY_ISEND(rom); rom++)
		if (ROMENTRY_ISDEFAULT_BIOS(rom))
			defaultname = ROM_GETNAME(rom);

	/* look for a BIOS with a matching name */
	for (rom = device->rom_region(); !ROMENTRY_ISEND(rom); rom++)
		if (ROMENTRY_ISSYSTEM_BIOS(rom))
		{
			const char *biosname = ROM_GETNAME(rom);
			int bios_flags = ROM_GETBIOSFLAGS(rom);
			char bios_number[20];

			/* Allow '-bios n' to still be used */
			sprintf(bios_number, "%d", bios_flags - 1);
			if (core_stricmp(bios_number, specbios) == 0 || core_stricmp(biosname, specbios) == 0)
				device->set_system_bios(bios_flags);
			if (defaultname != nullptr && core_stricmp(biosname, defaultname) == 0)
				default_no = bios_flags;
			bios_count++;
		}

	/* if none found, use the default */
	if (device->system_bios() == 0 && bios_count > 0)
	{
		/* if we got neither an empty string nor 'default' then warn the user */
		if (specbios[0] != 0 && strcmp(specbios, "default") != 0)
		{
			strcatprintf(m_errorstring, "%s: invalid bios\n", specbios);
			m_errors++;
		}

		/* set to default */
		device->set_system_bios(default_no);
	}
	device->set_default_bios(default_no);
	LOG(("For \"%s\" using System BIOS: %d\n", device->tag().c_str(), device->system_bios()));
}
开发者ID:notaz,项目名称:mame,代码行数:47,代码来源:romload.cpp

示例10: m_next

audit_record::audit_record(const rom_entry &media, media_type type)
	: m_next(NULL),
	  m_type(type),
	  m_status(STATUS_ERROR),
	  m_substatus(SUBSTATUS_ERROR),
	  m_name(ROM_GETNAME(&media)),
	  m_explength(rom_file_size(&media)),
	  m_length(0)
{
	m_exphashes.from_internal_string(ROM_GETHASHDATA(&media));
}
开发者ID:lidibupa,项目名称:ClientServerMAME,代码行数:11,代码来源:audit.c

示例11: open_rom_file

static int open_rom_file(struct rom_load_data *romdata, const struct RomModule *romp)
{
	const struct GameDriver *drv;

	++romdata->romsloaded;

	/* update status display */
	if (osd_display_loading_rom_message(ROM_GETNAME(romp), romdata))
       return 0;

	/* Attempt reading up the chain through the parents. It automatically also
	   attempts any kind of load by checksum supported by the archives. */
	romdata->file = NULL;
	for (drv = Machine->gamedrv; !romdata->file && drv; drv = drv->clone_of)
		if (drv->name && *drv->name)
			romdata->file = mame_fopen_rom(drv->name, ROM_GETNAME(romp), ROM_GETHASHDATA(romp));

	/* return the result */
	return (romdata->file != NULL);
}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:20,代码来源:common.c

示例12: open_disk_image

chd_error open_disk_image(const game_driver *gamedrv, const rom_entry *romp, chd_file **image)
{
	const game_driver *drv;
	const rom_entry *region, *rom;
	const char *fname;
	chd_error err;

	/* attempt to open the properly named file */
	fname = assemble_2_strings(ROM_GETNAME(romp), ".chd");
	err = chd_open(fname, CHD_OPEN_READ, NULL, image);
	free((void *)fname);

	/* if that worked, we're done */
	if (err == CHDERR_NONE)
		return err;

	/* otherwise, look at our parents for a CHD with an identical checksum */
	/* and try to open that */
	for (drv = gamedrv; drv != NULL; drv = driver_get_clone(drv))
		for (region = rom_first_region(drv); region != NULL; region = rom_next_region(region))
			if (ROMREGION_ISDISKDATA(region))
				for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))

					/* look for a differing name but with the same hash data */
					if (strcmp(ROM_GETNAME(romp), ROM_GETNAME(rom)) != 0 &&
						hash_data_is_equal(ROM_GETHASHDATA(romp), ROM_GETHASHDATA(rom), 0))
					{
						fname = assemble_2_strings(ROM_GETNAME(rom), ".chd");
						err = chd_open(fname, CHD_OPEN_READ, NULL, image);
						free((void *)fname);

						/* if that worked, we're done */
						if (err == CHDERR_NONE)
							return err;
					}

	return err;
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:38,代码来源:romload.c

示例13: specbios

void ui_menu_machine_configure::setup_bios()
{
	if (m_drv->rom == nullptr)
		return;

	std::string specbios(m_opts.bios());
	std::string default_name;
	for (const rom_entry *rom = m_drv->rom; !ROMENTRY_ISEND(rom); ++rom)
		if (ROMENTRY_ISDEFAULT_BIOS(rom))
			default_name = ROM_GETNAME(rom);
	
	int bios_count = 0;
	for (const rom_entry *rom = m_drv->rom; !ROMENTRY_ISEND(rom); ++rom)
	{
		if (ROMENTRY_ISSYSTEM_BIOS(rom))
		{
			std::string name(ROM_GETHASHDATA(rom));
			std::string biosname(ROM_GETNAME(rom));
			int bios_flags = ROM_GETBIOSFLAGS(rom);
			std::string bios_number = std::to_string(bios_flags - 1);

			// check biosnumber and name
			if (bios_number == specbios || biosname == specbios)
				m_curbios = bios_count;

			if (biosname == default_name)
			{
				name.append(_(" (default)"));
				if (specbios == "default")
					m_curbios = bios_count;
			}

			m_bios.emplace_back(name, bios_flags - 1);
			bios_count++;
		}
	}

}
开发者ID:chrisisonwildcode,项目名称:mame,代码行数:38,代码来源:miscmenu.cpp

示例14: printromlist

void printromlist(const struct RomModule *romp,const char *basename)
{
	const struct RomModule *region, *rom, *chunk;
	char buf[512];

	if (!romp) return;

#ifdef MESS
	if (!strcmp(basename,"nes")) return;
#endif

	printf("This is the list of the ROMs required for driver \"%s\".\n"
			"Name              Size       Checksum\n",basename);

	for (region = romp; region; region = rom_next_region(region))
	{
		for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
		{
			const char *name = ROM_GETNAME(rom);
			const char* hash = ROM_GETHASHDATA(rom);
			int length = -1; /* default is for disks! */

			if (ROMREGION_ISROMDATA(region))
			{
				length = 0;
				for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
					length += ROM_GETLENGTH(chunk);
			}

			printf("%-12s ", name);
			if (length >= 0)
				printf("%7d",length);
				else
				printf("       ");

			if (!hash_data_has_info(hash, HASH_INFO_NO_DUMP))
			{
				if (hash_data_has_info(hash, HASH_INFO_BAD_DUMP))
					printf(" BAD");

				hash_data_print(hash, 0, buf);
				printf(" %s", buf);
			}
			else
				printf(" NO GOOD DUMP KNOWN");

			printf("\n");
		}
	}
}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:50,代码来源:common.c

示例15: handle_missing_file

static void handle_missing_file(rom_load_data *romdata, const rom_entry *romp)
{
	/* optional files are okay */
	if (ROM_ISOPTIONAL(romp))
	{
		sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "OPTIONAL %s NOT FOUND\n", ROM_GETNAME(romp));
		romdata->warnings++;
	}

	/* no good dumps are okay */
	else if (ROM_NOGOODDUMP(romp))
	{
		sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NOT FOUND (NO GOOD DUMP KNOWN)\n", ROM_GETNAME(romp));
		romdata->warnings++;
	}

	/* anything else is bad */
	else
	{
		sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NOT FOUND\n", ROM_GETNAME(romp));
		romdata->errors++;
	}
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:23,代码来源:romload.c


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