mirror of
https://github.com/holub/mame
synced 2025-06-09 06:13:04 +03:00
cstr() - > c_str() as preparation for move to std::string (nw)
This commit is contained in:
parent
c334fda9a9
commit
6b36c7ab22
@ -494,7 +494,7 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, dev
|
|||||||
owner.subtag(tag, entry->m_read.m_tag);
|
owner.subtag(tag, entry->m_read.m_tag);
|
||||||
device_t *mapdevice = machine.device(tag);
|
device_t *mapdevice = machine.device(tag);
|
||||||
if (mapdevice == NULL) {
|
if (mapdevice == NULL) {
|
||||||
throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag.cstr(), m_spacenum, device.basetag());
|
throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag.c_str(), m_spacenum, device.basetag());
|
||||||
}
|
}
|
||||||
// Grab the submap
|
// Grab the submap
|
||||||
address_map submap(*mapdevice, entry);
|
address_map submap(*mapdevice, entry);
|
||||||
|
@ -812,7 +812,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
|
|||||||
logerror( "==============\n\n" );
|
logerror( "==============\n\n" );
|
||||||
logerror( "\tTitle: %.32s\n", head_title);
|
logerror( "\tTitle: %.32s\n", head_title);
|
||||||
logerror( "\tLength: 0x%X [real 0x%X]\n", head_length, len);
|
logerror( "\tLength: 0x%X [real 0x%X]\n", head_length, len);
|
||||||
logerror( "\tMapper: %s [0x%X]\n", cart_mapper.cstr(), head_mapper);
|
logerror( "\tMapper: %s [0x%X]\n", cart_mapper.c_str(), head_mapper);
|
||||||
logerror( "\t\tPOKEY: %s\n", BIT(head_mapper, 0) ? "Yes" : "No");
|
logerror( "\t\tPOKEY: %s\n", BIT(head_mapper, 0) ? "Yes" : "No");
|
||||||
logerror( "\t\tSC Bankswitch: %s\n", BIT(head_mapper, 1) ? "Yes" : "No");
|
logerror( "\t\tSC Bankswitch: %s\n", BIT(head_mapper, 1) ? "Yes" : "No");
|
||||||
logerror( "\t\tRAM at $4000: %s\n", BIT(head_mapper, 2) ? "Yes" : "No");
|
logerror( "\t\tRAM at $4000: %s\n", BIT(head_mapper, 2) ? "Yes" : "No");
|
||||||
@ -827,7 +827,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
logerror( "\n");
|
logerror( "\n");
|
||||||
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr());
|
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.c_str());
|
||||||
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr());
|
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.c_str());
|
||||||
logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
|
logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
|
|||||||
else if (!memcmp(&ROM[i], "SIIRTC_V", 8))
|
else if (!memcmp(&ROM[i], "SIIRTC_V", 8))
|
||||||
chip |= GBA_CHIP_RTC;
|
chip |= GBA_CHIP_RTC;
|
||||||
}
|
}
|
||||||
osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).cstr());
|
osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).c_str());
|
||||||
|
|
||||||
// fix for games which return more than one kind of chip: either it is one of the known titles, or we default to no battery
|
// fix for games which return more than one kind of chip: either it is one of the known titles, or we default to no battery
|
||||||
if (gba_chip_has_conflict(chip))
|
if (gba_chip_has_conflict(chip))
|
||||||
@ -364,7 +364,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
|
|||||||
chip &= ~GBA_CHIP_RTC;
|
chip &= ~GBA_CHIP_RTC;
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).cstr());
|
osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).c_str());
|
||||||
|
|
||||||
switch (chip)
|
switch (chip)
|
||||||
{
|
{
|
||||||
|
@ -328,7 +328,7 @@ int intv_cart_slot_device::load_fullpath()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
|
sscanf(extrainfo.c_str() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
|
||||||
&rom[3], &ram, &extra);
|
&rom[3], &ram, &extra);
|
||||||
//printf("extrainfo: %d %d %d %d %d %d %d \n", mapper, rom[0], rom[1], rom[2], rom[3], ram, extra);
|
//printf("extrainfo: %d %d %d %d %d %d %d \n", mapper, rom[0], rom[1], rom[2], rom[3], ram, extra);
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
|
|||||||
|
|
||||||
if (hashfile_extrainfo(*this, extrainfo))
|
if (hashfile_extrainfo(*this, extrainfo))
|
||||||
{
|
{
|
||||||
sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
|
sscanf(extrainfo.c_str() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
|
||||||
&rom[3], &ram, &extra);
|
&rom[3], &ram, &extra);
|
||||||
|
|
||||||
if (ram)
|
if (ram)
|
||||||
|
@ -1082,10 +1082,10 @@ void base_md_cart_slot_device::file_logging(UINT8 *ROM8, UINT32 rom_len, UINT32
|
|||||||
}
|
}
|
||||||
logerror("Checksum: %X\n", checksum);
|
logerror("Checksum: %X\n", checksum);
|
||||||
logerror(" - Calculated Checksum: %X\n", csum);
|
logerror(" - Calculated Checksum: %X\n", csum);
|
||||||
logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.cstr());
|
logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.c_str());
|
||||||
logerror("Modem: %.12s\n", modem);
|
logerror("Modem: %.12s\n", modem);
|
||||||
logerror("Memo: %.40s\n", memo);
|
logerror("Memo: %.40s\n", memo);
|
||||||
logerror("Country: %.16s\n%s", country, reg.cstr());
|
logerror("Country: %.16s\n%s", country, reg.c_str());
|
||||||
logerror("ROM Start: 0x%.8X\n", rom_start);
|
logerror("ROM Start: 0x%.8X\n", rom_start);
|
||||||
logerror("ROM End: 0x%.8X\n", rom_end);
|
logerror("ROM End: 0x%.8X\n", rom_end);
|
||||||
logerror("RAM Start: 0x%.8X\n", ram_start);
|
logerror("RAM Start: 0x%.8X\n", ram_start);
|
||||||
|
@ -290,7 +290,7 @@ void msx_slot_cartridge_device::get_default_card_software(astring &result)
|
|||||||
if (hashfile_extrainfo(*this, extrainfo))
|
if (hashfile_extrainfo(*this, extrainfo))
|
||||||
{
|
{
|
||||||
int extrainfo_type = -1;
|
int extrainfo_type = -1;
|
||||||
if (1 == sscanf(extrainfo.cstr(), "%d", &extrainfo_type))
|
if (1 == sscanf(extrainfo.c_str(), "%d", &extrainfo_type))
|
||||||
{
|
{
|
||||||
static const struct { int extrainfo; int mapper; } extrainfo_map[] = {
|
static const struct { int extrainfo; int mapper; } extrainfo_map[] = {
|
||||||
//{ 0, NOMAPPER },
|
//{ 0, NOMAPPER },
|
||||||
|
@ -392,7 +392,7 @@ void nes_cart_slot_device::call_load_ines()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.cstr());
|
logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -540,7 +540,7 @@ void cheat_script::script_entry::save(emu_file &cheatfile) const
|
|||||||
// output an output
|
// output an output
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.cstr());
|
cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.c_str());
|
||||||
if (!m_condition.is_empty())
|
if (!m_condition.is_empty())
|
||||||
cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
|
cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
|
||||||
if (m_line != 0)
|
if (m_line != 0)
|
||||||
@ -588,7 +588,7 @@ void cheat_script::script_entry::validate_format(const char *filename, int line)
|
|||||||
|
|
||||||
// look for a valid type
|
// look for a valid type
|
||||||
if (strchr("cdiouxX", *p) == NULL)
|
if (strchr("cdiouxX", *p) == NULL)
|
||||||
throw emu_fatalerror("%s.xml(%d): invalid format specification \"%s\"\n", filename, line, m_format.cstr());
|
throw emu_fatalerror("%s.xml(%d): invalid format specification \"%s\"\n", filename, line, m_format.c_str());
|
||||||
argscounted++;
|
argscounted++;
|
||||||
|
|
||||||
// look for the next one
|
// look for the next one
|
||||||
@ -597,9 +597,9 @@ void cheat_script::script_entry::validate_format(const char *filename, int line)
|
|||||||
|
|
||||||
// did we match?
|
// did we match?
|
||||||
if (argscounted < argsprovided)
|
if (argscounted < argsprovided)
|
||||||
throw emu_fatalerror("%s.xml(%d): too many arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.cstr());
|
throw emu_fatalerror("%s.xml(%d): too many arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str());
|
||||||
if (argscounted > argsprovided)
|
if (argscounted > argsprovided)
|
||||||
throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.cstr());
|
throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ void cheat_entry::save(emu_file &cheatfile) const
|
|||||||
bool has_scripts = (m_off_script != NULL || m_on_script != NULL || m_run_script != NULL || m_change_script != NULL);
|
bool has_scripts = (m_off_script != NULL || m_on_script != NULL || m_run_script != NULL || m_change_script != NULL);
|
||||||
|
|
||||||
// output the cheat tag
|
// output the cheat tag
|
||||||
cheatfile.printf("\t<cheat desc=\"%s\"", m_description.cstr());
|
cheatfile.printf("\t<cheat desc=\"%s\"", m_description.c_str());
|
||||||
if (m_numtemp != DEFAULT_TEMP_VARIABLES)
|
if (m_numtemp != DEFAULT_TEMP_VARIABLES)
|
||||||
cheatfile.printf(" tempvariables=\"%d\"", m_numtemp);
|
cheatfile.printf(" tempvariables=\"%d\"", m_numtemp);
|
||||||
if (!m_comment && m_parameter == NULL && !has_scripts)
|
if (!m_comment && m_parameter == NULL && !has_scripts)
|
||||||
@ -793,7 +793,7 @@ void cheat_entry::save(emu_file &cheatfile) const
|
|||||||
|
|
||||||
// save the comment
|
// save the comment
|
||||||
if (m_comment)
|
if (m_comment)
|
||||||
cheatfile.printf("\t\t<comment><![CDATA[\n%s\n\t\t]]></comment>\n", m_comment.cstr());
|
cheatfile.printf("\t\t<comment><![CDATA[\n%s\n\t\t]]></comment>\n", m_comment.c_str());
|
||||||
|
|
||||||
// output the parameter, if present
|
// output the parameter, if present
|
||||||
if (m_parameter != NULL)
|
if (m_parameter != NULL)
|
||||||
@ -832,7 +832,7 @@ bool cheat_entry::activate()
|
|||||||
{
|
{
|
||||||
execute_on_script();
|
execute_on_script();
|
||||||
changed = true;
|
changed = true;
|
||||||
popmessage("Activated %s", m_description.cstr());
|
popmessage("Activated %s", m_description.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we're a oneshot parameter cheat and we're active, execute the "state change" script and indicate change
|
// if we're a oneshot parameter cheat and we're active, execute the "state change" script and indicate change
|
||||||
@ -840,7 +840,7 @@ bool cheat_entry::activate()
|
|||||||
{
|
{
|
||||||
execute_change_script();
|
execute_change_script();
|
||||||
changed = true;
|
changed = true;
|
||||||
popmessage("Activated\n %s = %s", m_description.cstr(), m_parameter->text());
|
popmessage("Activated\n %s = %s", m_description.c_str(), m_parameter->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
|
@ -153,7 +153,7 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
val.printf("%s:%s:%s", swlistdev->list_name(), m_options.software_name(), swpart->name());
|
val.printf("%s:%s:%s", swlistdev->list_name(), m_options.software_name(), swpart->name());
|
||||||
|
|
||||||
// call this in order to set slot devices according to mounting
|
// call this in order to set slot devices according to mounting
|
||||||
m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.cstr());
|
m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -184,10 +184,10 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
|
throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
|
||||||
|
|
||||||
// otherwise, error on the options
|
// otherwise, error on the options
|
||||||
throw emu_fatalerror(MAMERR_INVALID_CONFIG, "%s", option_errors.trimspace().cstr());
|
throw emu_fatalerror(MAMERR_INVALID_CONFIG, "%s", option_errors.trimspace().c_str());
|
||||||
}
|
}
|
||||||
if (option_errors)
|
if (option_errors)
|
||||||
osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr());
|
osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().c_str());
|
||||||
|
|
||||||
// determine the base name of the EXE
|
// determine the base name of the EXE
|
||||||
astring exename;
|
astring exename;
|
||||||
@ -208,7 +208,7 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
m_options.parse_standard_inis(option_errors);
|
m_options.parse_standard_inis(option_errors);
|
||||||
}
|
}
|
||||||
if (option_errors)
|
if (option_errors)
|
||||||
osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr());
|
osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().c_str());
|
||||||
|
|
||||||
// if we can't find it, give an appropriate error
|
// if we can't find it, give an appropriate error
|
||||||
const game_driver *system = m_options.system();
|
const game_driver *system = m_options.system();
|
||||||
@ -226,7 +226,7 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
catch (emu_fatalerror &fatal)
|
catch (emu_fatalerror &fatal)
|
||||||
{
|
{
|
||||||
astring string(fatal.string());
|
astring string(fatal.string());
|
||||||
osd_printf_error("%s\n", string.trimspace().cstr());
|
osd_printf_error("%s\n", string.trimspace().c_str());
|
||||||
m_result = (fatal.exitcode() != 0) ? fatal.exitcode() : MAMERR_FATALERROR;
|
m_result = (fatal.exitcode() != 0) ? fatal.exitcode() : MAMERR_FATALERROR;
|
||||||
|
|
||||||
// if a game was specified, wasn't a wildcard, and our error indicates this was the
|
// if a game was specified, wasn't a wildcard, and our error indicates this was the
|
||||||
@ -328,7 +328,7 @@ void cli_frontend::listsource(const char *gamename)
|
|||||||
// iterate through drivers and output the info
|
// iterate through drivers and output the info
|
||||||
astring filename;
|
astring filename;
|
||||||
while (drivlist.next())
|
while (drivlist.next())
|
||||||
osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(filename, drivlist.driver().source_file).cstr());
|
osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(filename, drivlist.driver().source_file).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ void cli_frontend::listbrothers(const char *gamename)
|
|||||||
while (drivlist.next())
|
while (drivlist.next())
|
||||||
{
|
{
|
||||||
int clone_of = drivlist.clone();
|
int clone_of = drivlist.clone();
|
||||||
osd_printf_info("%-16s %-16s %-16s\n", core_filename_extract_base(filename, drivlist.driver().source_file).cstr(), drivlist.driver().name, (clone_of == -1 ? "" : drivlist.driver(clone_of).name));
|
osd_printf_info("%-16s %-16s %-16s\n", core_filename_extract_base(filename, drivlist.driver().source_file).c_str(), drivlist.driver().name, (clone_of == -1 ? "" : drivlist.driver(clone_of).name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,14 +726,14 @@ void cli_frontend::listmedia(const char *gamename)
|
|||||||
paren_shortname.format("(%s)", imagedev->brief_instance_name());
|
paren_shortname.format("(%s)", imagedev->brief_instance_name());
|
||||||
|
|
||||||
// output the line, up to the list of extensions
|
// output the line, up to the list of extensions
|
||||||
printf("%-13s%-12s%-8s ", first ? drivlist.driver().name : "", imagedev->instance_name(), paren_shortname.cstr());
|
printf("%-13s%-12s%-8s ", first ? drivlist.driver().name : "", imagedev->instance_name(), paren_shortname.c_str());
|
||||||
|
|
||||||
// get the extensions and print them
|
// get the extensions and print them
|
||||||
astring extensions(imagedev->file_extensions());
|
astring extensions(imagedev->file_extensions());
|
||||||
for (int start = 0, end = extensions.chr(0, ','); ; start = end + 1, end = extensions.chr(start, ','))
|
for (int start = 0, end = extensions.chr(0, ','); ; start = end + 1, end = extensions.chr(start, ','))
|
||||||
{
|
{
|
||||||
astring curext(extensions, start, (end == -1) ? extensions.len() - start : end - start);
|
astring curext(extensions, start, (end == -1) ? extensions.len() - start : end - start);
|
||||||
printf(".%-5s", curext.cstr());
|
printf(".%-5s", curext.c_str());
|
||||||
if (end == -1)
|
if (end == -1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -782,7 +782,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(drivlist.driver().name,&summary_string);
|
auditor.summarize(drivlist.driver().name,&summary_string);
|
||||||
osd_printf_info("%s", summary_string.cstr());
|
osd_printf_info("%s", summary_string.c_str());
|
||||||
|
|
||||||
// output the name of the driver and its clone
|
// output the name of the driver and its clone
|
||||||
osd_printf_info("romset %s ", drivlist.driver().name);
|
osd_printf_info("romset %s ", drivlist.driver().name);
|
||||||
@ -842,7 +842,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(dev->shortname(),&summary_string);
|
auditor.summarize(dev->shortname(),&summary_string);
|
||||||
osd_printf_info("%s", summary_string.cstr());
|
osd_printf_info("%s", summary_string.c_str());
|
||||||
|
|
||||||
// display information about what we discovered
|
// display information about what we discovered
|
||||||
osd_printf_info("romset %s ", dev->shortname());
|
osd_printf_info("romset %s ", dev->shortname());
|
||||||
@ -880,7 +880,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
{
|
{
|
||||||
astring temptag("_");
|
astring temptag("_");
|
||||||
temptag.cat(option->name());
|
temptag.cat(option->name());
|
||||||
device_t *dev = const_cast<machine_config &>(config).device_add(&config.root_device(), temptag.cstr(), option->devtype(), 0);
|
device_t *dev = const_cast<machine_config &>(config).device_add(&config.root_device(), temptag.c_str(), option->devtype(), 0);
|
||||||
|
|
||||||
// notify this device and all its subdevices that they are now configured
|
// notify this device and all its subdevices that they are now configured
|
||||||
device_iterator subiter(*dev);
|
device_iterator subiter(*dev);
|
||||||
@ -907,7 +907,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(dev->shortname(),&summary_string);
|
auditor.summarize(dev->shortname(),&summary_string);
|
||||||
osd_printf_info("%s", summary_string.cstr());
|
osd_printf_info("%s", summary_string.c_str());
|
||||||
|
|
||||||
// display information about what we discovered
|
// display information about what we discovered
|
||||||
osd_printf_info("romset %s ", dev->shortname());
|
osd_printf_info("romset %s ", dev->shortname());
|
||||||
@ -938,7 +938,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const_cast<machine_config &>(config).device_remove(&config.root_device(), temptag.cstr());
|
const_cast<machine_config &>(config).device_remove(&config.root_device(), temptag.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1004,7 +1004,7 @@ void cli_frontend::verifysamples(const char *gamename)
|
|||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(drivlist.driver().name,&summary_string);
|
auditor.summarize(drivlist.driver().name,&summary_string);
|
||||||
osd_printf_info("%s", summary_string.cstr());
|
osd_printf_info("%s", summary_string.c_str());
|
||||||
|
|
||||||
// output the name of the driver and its clone
|
// output the name of the driver and its clone
|
||||||
osd_printf_info("sampleset %s ", drivlist.driver().name);
|
osd_printf_info("sampleset %s ", drivlist.driver().name);
|
||||||
@ -1322,7 +1322,7 @@ void cli_frontend::verifysoftware(const char *gamename)
|
|||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(swinfo->shortname(), &summary_string);
|
auditor.summarize(swinfo->shortname(), &summary_string);
|
||||||
osd_printf_info("%s", summary_string.cstr());
|
osd_printf_info("%s", summary_string.c_str());
|
||||||
|
|
||||||
// display information about what we discovered
|
// display information about what we discovered
|
||||||
osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname());
|
osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname());
|
||||||
@ -1444,7 +1444,7 @@ void cli_frontend::verifysoftlist(const char *gamename)
|
|||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(swinfo->shortname(), &summary_string);
|
auditor.summarize(swinfo->shortname(), &summary_string);
|
||||||
osd_printf_info("%s", summary_string.cstr());
|
osd_printf_info("%s", summary_string.c_str());
|
||||||
|
|
||||||
// display information about what we discovered
|
// display information about what we discovered
|
||||||
osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname());
|
osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname());
|
||||||
@ -1556,7 +1556,7 @@ void cli_frontend::execute_commands(const char *exename)
|
|||||||
astring option_errors;
|
astring option_errors;
|
||||||
m_options.parse_standard_inis(option_errors);
|
m_options.parse_standard_inis(option_errors);
|
||||||
if (option_errors)
|
if (option_errors)
|
||||||
osd_printf_error("%s\n", option_errors.cstr());
|
osd_printf_error("%s\n", option_errors.c_str());
|
||||||
|
|
||||||
// createconfig?
|
// createconfig?
|
||||||
if (strcmp(m_options.command(), CLICOMMAND_CREATECONFIG) == 0)
|
if (strcmp(m_options.command(), CLICOMMAND_CREATECONFIG) == 0)
|
||||||
@ -1779,7 +1779,7 @@ void media_identifier::identify_file(const char *name)
|
|||||||
{
|
{
|
||||||
// output the name
|
// output the name
|
||||||
astring basename;
|
astring basename;
|
||||||
osd_printf_info("%-20s", core_filename_extract_base(basename, name).cstr());
|
osd_printf_info("%-20s", core_filename_extract_base(basename, name).c_str());
|
||||||
m_total++;
|
m_total++;
|
||||||
|
|
||||||
// attempt to open as a CHD; fail if not
|
// attempt to open as a CHD; fail if not
|
||||||
@ -1855,7 +1855,7 @@ void media_identifier::identify_data(const char *name, const UINT8 *data, int le
|
|||||||
// output the name
|
// output the name
|
||||||
m_total++;
|
m_total++;
|
||||||
astring basename;
|
astring basename;
|
||||||
osd_printf_info("%-20s", core_filename_extract_base(basename, name).cstr());
|
osd_printf_info("%-20s", core_filename_extract_base(basename, name).c_str());
|
||||||
|
|
||||||
// see if we can find a match in the ROMs
|
// see if we can find a match in the ROMs
|
||||||
int found = find_by_hash(hashes, length);
|
int found = find_by_hash(hashes, length);
|
||||||
|
@ -655,7 +655,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U
|
|||||||
if (device.machine().options().drc_log_native())
|
if (device.machine().options().drc_log_native())
|
||||||
{
|
{
|
||||||
astring filename("drcbex64_", device.shortname(), ".asm");
|
astring filename("drcbex64_", device.shortname(), ".asm");
|
||||||
m_log = x86log_create_context(filename.cstr());
|
m_log = x86log_create_context(filename.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -799,7 +799,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT3
|
|||||||
{
|
{
|
||||||
astring dasm;
|
astring dasm;
|
||||||
inst.disasm(dasm, &m_drcuml);
|
inst.disasm(dasm, &m_drcuml);
|
||||||
x86log_add_comment(m_log, dst, "%s", dasm.cstr());
|
x86log_add_comment(m_log, dst, "%s", dasm.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract a blockname
|
// extract a blockname
|
||||||
|
@ -569,7 +569,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, U
|
|||||||
if (device.machine().options().drc_log_native())
|
if (device.machine().options().drc_log_native())
|
||||||
{
|
{
|
||||||
astring filename("drcbex86_", device.shortname(), ".asm");
|
astring filename("drcbex86_", device.shortname(), ".asm");
|
||||||
m_log = x86log_create_context(filename.cstr());
|
m_log = x86log_create_context(filename.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT3
|
|||||||
{
|
{
|
||||||
astring dasm;
|
astring dasm;
|
||||||
inst.disasm(dasm, &m_drcuml);
|
inst.disasm(dasm, &m_drcuml);
|
||||||
x86log_add_comment(m_log, dst, "%s", dasm.cstr());
|
x86log_add_comment(m_log, dst, "%s", dasm.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract a blockname
|
// extract a blockname
|
||||||
|
@ -130,7 +130,7 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
|
|||||||
if (device.machine().options().drc_log_uml())
|
if (device.machine().options().drc_log_uml())
|
||||||
{
|
{
|
||||||
astring filename("drcuml_", m_device.shortname(), ".asm");
|
astring filename("drcuml_", m_device.shortname(), ".asm");
|
||||||
m_umllog = fopen(filename.cstr(), "w");
|
m_umllog = fopen(filename.c_str(), "w");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,12 +490,12 @@ void drcuml_block::disassemble()
|
|||||||
// include the first accumulated comment with this line
|
// include the first accumulated comment with this line
|
||||||
if (firstcomment != -1)
|
if (firstcomment != -1)
|
||||||
{
|
{
|
||||||
m_drcuml.log_printf("\t%-50.50s; %s\n", dasm.cstr(), get_comment_text(m_inst[firstcomment], comment));
|
m_drcuml.log_printf("\t%-50.50s; %s\n", dasm.c_str(), get_comment_text(m_inst[firstcomment], comment));
|
||||||
firstcomment++;
|
firstcomment++;
|
||||||
flushcomments = TRUE;
|
flushcomments = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_drcuml.log_printf("\t%s\n", dasm.cstr());
|
m_drcuml.log_printf("\t%s\n", dasm.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// flush any comments pending
|
// flush any comments pending
|
||||||
|
@ -237,7 +237,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring
|
|||||||
m_auc & 0x10 ? '0':'.',
|
m_auc & 0x10 ? '0':'.',
|
||||||
m_auc & 0x08 ? '1':'.',
|
m_auc & 0x08 ? '1':'.',
|
||||||
m_auc & 0x04 ? '0':'.',
|
m_auc & 0x04 ? '0':'.',
|
||||||
alignString.cstr());
|
alignString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring
|
|||||||
}
|
}
|
||||||
string.printf("%c%s%c%c%c%c%c%c%c%c%c%c%c%c%c",
|
string.printf("%c%s%c%c%c%c%c%c%c%c%c%c%c%c%c",
|
||||||
m_pioc & 0x8000 ? 'I':'.',
|
m_pioc & 0x8000 ? 'I':'.',
|
||||||
strobeString.cstr(),
|
strobeString.c_str(),
|
||||||
m_pioc & 0x1000 ? 'O':'I',
|
m_pioc & 0x1000 ? 'O':'I',
|
||||||
m_pioc & 0x0800 ? 'O':'I',
|
m_pioc & 0x0800 ? 'O':'I',
|
||||||
m_pioc & 0x0400 ? 'S':'.',
|
m_pioc & 0x0400 ? 'S':'.',
|
||||||
@ -305,7 +305,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring
|
|||||||
}
|
}
|
||||||
string.printf("%c%s%c%c%c%c%c%c%c",
|
string.printf("%c%s%c%c%c%c%c%c%c",
|
||||||
m_sioc & 0x0200 ? 'I':'O',
|
m_sioc & 0x0200 ? 'I':'O',
|
||||||
clkString.cstr(),
|
clkString.c_str(),
|
||||||
m_sioc & 0x0040 ? 'L':'M',
|
m_sioc & 0x0040 ? 'L':'M',
|
||||||
m_sioc & 0x0020 ? 'I':'O',
|
m_sioc & 0x0020 ? 'I':'O',
|
||||||
m_sioc & 0x0010 ? 'I':'O',
|
m_sioc & 0x0010 ? 'I':'O',
|
||||||
|
@ -270,7 +270,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 F1 = (op & 0x01e0) >> 5;
|
const UINT8 F1 = (op & 0x01e0) >> 5;
|
||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
sprintf(buffer, "%s, %s", fString.cstr(), yString.cstr());
|
sprintf(buffer, "%s, %s", fString.c_str(), yString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x04: case 0x1c:
|
case 0x04: case 0x1c:
|
||||||
@ -285,7 +285,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
astring aString = (opcode == 0x1c) ? "a0" : "a1";
|
astring aString = (opcode == 0x1c) ? "a0" : "a1";
|
||||||
astring xString = (X) ? "" : "l";
|
astring xString = (X) ? "" : "l";
|
||||||
sprintf(buffer, "%s = %s%s, %s", yString.cstr(), aString.cstr(), xString.cstr(), fString.cstr());
|
sprintf(buffer, "%s = %s%s, %s", yString.c_str(), aString.c_str(), xString.c_str(), fString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x16:
|
case 0x16:
|
||||||
@ -297,7 +297,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 F1 = (op & 0x01e0) >> 5;
|
const UINT8 F1 = (op & 0x01e0) >> 5;
|
||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
sprintf(buffer, "%s, x = %s", fString.cstr(), yString.cstr());
|
sprintf(buffer, "%s, x = %s", fString.c_str(), yString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x17:
|
case 0x17:
|
||||||
@ -311,7 +311,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
astring xString = (X ? "y" : "y1");
|
astring xString = (X ? "y" : "y1");
|
||||||
sprintf(buffer, "%s, %s = %s", fString.cstr(), xString.cstr(), yString.cstr());
|
sprintf(buffer, "%s, %s = %s", fString.c_str(), xString.c_str(), yString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x1f:
|
case 0x1f:
|
||||||
@ -325,7 +325,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
astring xString = (X ? "*pt++i" : "*pt++");
|
astring xString = (X ? "*pt++i" : "*pt++");
|
||||||
sprintf(buffer, "%s, y = %s, x = %s", fString.cstr(), yString.cstr(), xString.cstr());
|
sprintf(buffer, "%s, y = %s, x = %s", fString.c_str(), yString.c_str(), xString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x19: case 0x1b:
|
case 0x19: case 0x1b:
|
||||||
@ -339,7 +339,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
astring xString = (X ? "*pt++i" : "*pt++");
|
astring xString = (X ? "*pt++i" : "*pt++");
|
||||||
astring aString = (opcode == 0x19) ? "a0" : "a1";
|
astring aString = (opcode == 0x19) ? "a0" : "a1";
|
||||||
sprintf(buffer, "%s, y = %s, x = %s", fString.cstr(), aString.cstr(), xString.cstr());
|
sprintf(buffer, "%s, y = %s, x = %s", fString.c_str(), aString.c_str(), xString.c_str());
|
||||||
if (Y != 0x00) sprintf(buffer, "UNKNOWN");
|
if (Y != 0x00) sprintf(buffer, "UNKNOWN");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring xString = (X ? "y" : "y1");
|
astring xString = (X ? "y" : "y1");
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
sprintf(buffer, "%s, %s = %s", fString.cstr(), yString.cstr(), xString.cstr());
|
sprintf(buffer, "%s, %s = %s", fString.c_str(), yString.c_str(), xString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring atString = (aT ? "a0" : "a1");
|
astring atString = (aT ? "a0" : "a1");
|
||||||
astring fString = disasmF1Field(F1, aT, S);
|
astring fString = disasmF1Field(F1, aT, S);
|
||||||
sprintf(buffer, "%s, %s = %s", fString.cstr(), atString.cstr(), yString.cstr());
|
sprintf(buffer, "%s, %s = %s", fString.c_str(), atString.c_str(), yString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring zString = disasmZField(Z);
|
astring zString = disasmZField(Z);
|
||||||
astring xString = (X ? "y" : "y1");
|
astring xString = (X ? "y" : "y1");
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
sprintf(buffer, "%s, %s <=> %s", fString.cstr(), xString.cstr(), zString.cstr());
|
sprintf(buffer, "%s, %s <=> %s", fString.c_str(), xString.c_str(), zString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x1d:
|
case 0x1d:
|
||||||
@ -399,7 +399,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring zString = disasmZField(Z);
|
astring zString = disasmZField(Z);
|
||||||
astring xString = (X ? "*pt++i" : "*pt++");
|
astring xString = (X ? "*pt++i" : "*pt++");
|
||||||
astring fString = disasmF1Field(F1, D, S);
|
astring fString = disasmF1Field(F1, D, S);
|
||||||
sprintf(buffer, "%s, %s <=> y, x = %s", fString.cstr(), zString.cstr(), xString.cstr());
|
sprintf(buffer, "%s, %s <=> y, x = %s", fString.c_str(), zString.c_str(), xString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring atString = (aT ? "a0" : "a1");
|
astring atString = (aT ? "a0" : "a1");
|
||||||
atString += X ? "" : "1"; // TODO: Figure out unclear wording.
|
atString += X ? "" : "1"; // TODO: Figure out unclear wording.
|
||||||
astring fString = disasmF1Field(F1, aT, S);
|
astring fString = disasmF1Field(F1, aT, S);
|
||||||
sprintf(buffer, "%s, %s <=> %s", fString.cstr(), zString.cstr(), atString.cstr());
|
sprintf(buffer, "%s, %s <=> %s", fString.c_str(), zString.c_str(), atString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,8 +431,8 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 F2 = (op & 0x01e0) >> 5;
|
const UINT8 F2 = (op & 0x01e0) >> 5;
|
||||||
astring fString = disasmF2Field(F2, D, S);
|
astring fString = disasmF2Field(F2, D, S);
|
||||||
astring conString = disasmCONField(CON);
|
astring conString = disasmCONField(CON);
|
||||||
if (op & 0x0800) sprintf(buffer, "if %s : %s", conString.cstr(), fString.cstr());
|
if (op & 0x0800) sprintf(buffer, "if %s : %s", conString.c_str(), fString.c_str());
|
||||||
else sprintf(buffer, "ifc %s : %s", conString.cstr(), fString.cstr());
|
else sprintf(buffer, "ifc %s : %s", conString.c_str(), fString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
// goto B
|
// goto B
|
||||||
const UINT8 B = (op & 0x0700) >> 8;
|
const UINT8 B = (op & 0x0700) >> 8;
|
||||||
astring bString = disasmBField(B);
|
astring bString = disasmBField(B);
|
||||||
sprintf(buffer, "%s", bString.cstr());
|
sprintf(buffer, "%s", bString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +468,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
// if CON [goto/call/return]
|
// if CON [goto/call/return]
|
||||||
const UINT8 CON = (op & 0x001f);
|
const UINT8 CON = (op & 0x001f);
|
||||||
astring conString = disasmCONField(CON);
|
astring conString = disasmCONField(CON);
|
||||||
sprintf(buffer, "if %s:", conString.cstr());
|
sprintf(buffer, "if %s:", conString.c_str());
|
||||||
// TODO: Test for invalid ops
|
// TODO: Test for invalid ops
|
||||||
// icall
|
// icall
|
||||||
if (op == 0xd40e) sprintf(buffer, "icall");
|
if (op == 0xd40e) sprintf(buffer, "icall");
|
||||||
@ -482,7 +482,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 R = (op & 0x03f0) >> 4;
|
const UINT8 R = (op & 0x03f0) >> 4;
|
||||||
const UINT8 S = (op & 0x1000) >> 12;
|
const UINT8 S = (op & 0x1000) >> 12;
|
||||||
astring rString = disasmRField(R);
|
astring rString = disasmRField(R);
|
||||||
sprintf(buffer, "%s = %s", rString.cstr(), (S ? "a1" : "a0"));
|
sprintf(buffer, "%s = %s", rString.c_str(), (S ? "a1" : "a0"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x08:
|
case 0x08:
|
||||||
@ -491,7 +491,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 R = (op & 0x03f0) >> 4;
|
const UINT8 R = (op & 0x03f0) >> 4;
|
||||||
const UINT8 aT = (op & 0x0400) >> 10;
|
const UINT8 aT = (op & 0x0400) >> 10;
|
||||||
astring rString = disasmRField(R);
|
astring rString = disasmRField(R);
|
||||||
sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.cstr());
|
sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x0f:
|
case 0x0f:
|
||||||
@ -501,7 +501,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 R = (op & 0x03f0) >> 4;
|
const UINT8 R = (op & 0x03f0) >> 4;
|
||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring rString = disasmRField(R);
|
astring rString = disasmRField(R);
|
||||||
sprintf(buffer, "%s = %s", rString.cstr(), yString.cstr());
|
sprintf(buffer, "%s = %s", rString.c_str(), yString.c_str());
|
||||||
// TODO: Special case the R == [y, y1, or x] case
|
// TODO: Special case the R == [y, y1, or x] case
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -513,7 +513,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
astring yString = disasmYField(Y);
|
astring yString = disasmYField(Y);
|
||||||
astring rString = disasmRField(R);
|
astring rString = disasmRField(R);
|
||||||
// TODO: page 3-31 "special function encoding"
|
// TODO: page 3-31 "special function encoding"
|
||||||
sprintf(buffer, "%s = %s", yString.cstr(), rString.cstr());
|
sprintf(buffer, "%s = %s", yString.c_str(), rString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x0d:
|
case 0x0d:
|
||||||
@ -523,7 +523,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT8 R = (op & 0x03f0) >> 4;
|
const UINT8 R = (op & 0x03f0) >> 4;
|
||||||
astring zString = disasmZField(Z);
|
astring zString = disasmZField(Z);
|
||||||
astring rString = disasmRField(R);
|
astring rString = disasmRField(R);
|
||||||
sprintf(buffer, "%s <=> %s", zString.cstr(), rString.cstr());
|
sprintf(buffer, "%s <=> %s", zString.c_str(), rString.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
// R = N
|
// R = N
|
||||||
const UINT8 R = (op & 0x03f0) >> 4;
|
const UINT8 R = (op & 0x03f0) >> 4;
|
||||||
astring rString = disasmRField(R);
|
astring rString = disasmRField(R);
|
||||||
sprintf(buffer, "%s = 0x%04x", rString.cstr(), op2);
|
sprintf(buffer, "%s = 0x%04x", rString.c_str(), op2);
|
||||||
opSize = 2;
|
opSize = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ CPU_DISASSEMBLE( dsp16a )
|
|||||||
const UINT16 M = (op & 0x01ff);
|
const UINT16 M = (op & 0x01ff);
|
||||||
const UINT8 R = (op & 0x0e00) >> 9;
|
const UINT8 R = (op & 0x0e00) >> 9;
|
||||||
astring rString = disasmRImmediateField(R);
|
astring rString = disasmRImmediateField(R);
|
||||||
sprintf(buffer, "%s = 0x%04x", rString.cstr(), M);
|
sprintf(buffer, "%s = 0x%04x", rString.c_str(), M);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ CPU_DISASSEMBLE( dsp56k )
|
|||||||
|
|
||||||
// Decode and disassemble.
|
// Decode and disassemble.
|
||||||
DSP56K::Opcode op(w0, w1);
|
DSP56K::Opcode op(w0, w1);
|
||||||
sprintf(buffer, "%s", op.disassemble().cstr());
|
sprintf(buffer, "%s", op.disassemble().c_str());
|
||||||
|
|
||||||
const unsigned size = op.size();
|
const unsigned size = op.size();
|
||||||
return (size | DASMFLAG_SUPPORTED);
|
return (size | DASMFLAG_SUPPORTED);
|
||||||
|
@ -204,7 +204,7 @@ public:
|
|||||||
void disassemble(astring& retString) const
|
void disassemble(astring& retString) const
|
||||||
{
|
{
|
||||||
char temp[32];
|
char temp[32];
|
||||||
sprintf(temp, "#$%x,%s", m_immediate, regIdAsString(m_destination).cstr());
|
sprintf(temp, "#$%x,%s", m_immediate, regIdAsString(m_destination).c_str());
|
||||||
retString = "andi " + astring(temp);
|
retString = "andi " + astring(temp);
|
||||||
// NEW // sprintf(opcode_str, "and(i)");
|
// NEW // sprintf(opcode_str, "and(i)");
|
||||||
}
|
}
|
||||||
@ -438,7 +438,7 @@ public:
|
|||||||
sprintf(temp, "#$%x", m_iVal);
|
sprintf(temp, "#$%x", m_iVal);
|
||||||
astring source = temp;
|
astring source = temp;
|
||||||
|
|
||||||
sprintf(temp, "X:(%s)", regIdAsString(m_r).cstr());
|
sprintf(temp, "X:(%s)", regIdAsString(m_r).c_str());
|
||||||
astring destination = temp;
|
astring destination = temp;
|
||||||
|
|
||||||
retString = m_opcode + " " + source + "," + destination;
|
retString = m_opcode + " " + source + "," + destination;
|
||||||
@ -1138,7 +1138,7 @@ public:
|
|||||||
astring destination = temp;
|
astring destination = temp;
|
||||||
// NEW // sprintf(temp, "X:(R%d),$%02x", Rnum, pc + 2 + word1);
|
// NEW // sprintf(temp, "X:(R%d),$%02x", Rnum, pc + 2 + word1);
|
||||||
|
|
||||||
sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr());
|
sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str());
|
||||||
astring source = temp;
|
astring source = temp;
|
||||||
|
|
||||||
retString = "do " + source + "," + destination;
|
retString = "do " + source + "," + destination;
|
||||||
@ -3042,7 +3042,7 @@ public:
|
|||||||
void disassemble(astring& retString) const
|
void disassemble(astring& retString) const
|
||||||
{
|
{
|
||||||
char temp[32];
|
char temp[32];
|
||||||
sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr());
|
sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str());
|
||||||
retString = "rep " + astring(temp);
|
retString = "rep " + astring(temp);
|
||||||
}
|
}
|
||||||
void evaluate(dsp56k_core* cpustate) {}
|
void evaluate(dsp56k_core* cpustate) {}
|
||||||
|
@ -158,9 +158,9 @@ public:
|
|||||||
if (r == iR3) return false;
|
if (r == iR3) return false;
|
||||||
|
|
||||||
char temp[32];
|
char temp[32];
|
||||||
sprintf(temp, "X:%s,%s", ea1.cstr(), regIdAsString(D1).cstr());
|
sprintf(temp, "X:%s,%s", ea1.c_str(), regIdAsString(D1).c_str());
|
||||||
parallelMove = temp;
|
parallelMove = temp;
|
||||||
sprintf(temp, "X:%s,%s", ea2.cstr(), regIdAsString(D2).cstr());
|
sprintf(temp, "X:%s,%s", ea2.c_str(), regIdAsString(D2).c_str());
|
||||||
parallelMove2 = temp;
|
parallelMove2 = temp;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -253,8 +253,8 @@ public:
|
|||||||
decode_RR_table(BITSn(word0,0x00c0), r);
|
decode_RR_table(BITSn(word0,0x00c0), r);
|
||||||
decode_DD_table(BITSn(word0,0x0030), S);
|
decode_DD_table(BITSn(word0,0x0030), S);
|
||||||
|
|
||||||
sprintf(parallel_move_str, "%s,X:(R%d)+N%d", regIdAsString(Dnot).cstr(), regIDAsNum(r), regIDAsNum(r));
|
sprintf(parallel_move_str, "%s,X:(R%d)+N%d", regIdAsString(Dnot).c_str(), regIDAsNum(r), regIDAsNum(r));
|
||||||
sprintf(parallel_move_str2, "%s,%s", regIdAsString(S).cstr(), regIdAsString(Dnot).cstr());
|
sprintf(parallel_move_str2, "%s,%s", regIdAsString(S).c_str(), regIdAsString(Dnot).c_str());
|
||||||
pms = parallel_move_str;
|
pms = parallel_move_str;
|
||||||
pms2 = parallel_move_str2;
|
pms2 = parallel_move_str2;
|
||||||
return true;
|
return true;
|
||||||
|
@ -574,8 +574,8 @@ void assemble_D_from_P_table(UINT16 P, UINT16 ppppp, astring& D)
|
|||||||
break;
|
break;
|
||||||
case 0x1:
|
case 0x1:
|
||||||
assemble_address_from_IO_short_address(ppppp, fullAddy);
|
assemble_address_from_IO_short_address(ppppp, fullAddy);
|
||||||
sprintf(temp, "X:<<$%s", fullAddy.cstr());
|
sprintf(temp, "X:<<$%s", fullAddy.c_str());
|
||||||
// NEW // sprintf(temp, "X:$%s", fullAddy.cstr());
|
// NEW // sprintf(temp, "X:$%s", fullAddy.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
D = temp;
|
D = temp;
|
||||||
@ -585,7 +585,7 @@ void assemble_arguments_from_W_table(UINT16 W, char ma, const reg_id& SD, const
|
|||||||
astring& source, astring& destination)
|
astring& source, astring& destination)
|
||||||
{
|
{
|
||||||
char temp[32];
|
char temp[32];
|
||||||
sprintf(temp, "%c:%s", ma, ea.cstr());
|
sprintf(temp, "%c:%s", ma, ea.c_str());
|
||||||
switch(W)
|
switch(W)
|
||||||
{
|
{
|
||||||
case 0x0: source = regIdAsString(SD); destination = temp; break;
|
case 0x0: source = regIdAsString(SD); destination = temp; break;
|
||||||
@ -597,7 +597,7 @@ void assemble_arguments_from_W_table(UINT16 W, char ma, const astring& SD, const
|
|||||||
astring& source, astring& destination)
|
astring& source, astring& destination)
|
||||||
{
|
{
|
||||||
char temp[32];
|
char temp[32];
|
||||||
sprintf(temp, "%c:%s", ma, ea.cstr());
|
sprintf(temp, "%c:%s", ma, ea.c_str());
|
||||||
switch(W)
|
switch(W)
|
||||||
{
|
{
|
||||||
case 0x0: source = SD; destination = temp; break;
|
case 0x0: source = SD; destination = temp; break;
|
||||||
|
@ -253,7 +253,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
int delta = oprom[2];
|
int delta = oprom[2];
|
||||||
if(delta & 0x80)
|
if(delta & 0x80)
|
||||||
delta -= 0x100;
|
delta -= 0x100;
|
||||||
sprintf(buffer, " %s, %04x", regname(oprom[1]).cstr(), (pc+3+delta) & 0xffff);
|
sprintf(buffer, " %s, %04x", regname(oprom[1]).c_str(), (pc+3+delta) & 0xffff);
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -262,23 +262,23 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
int delta = oprom[2];
|
int delta = oprom[2];
|
||||||
if(delta & 0x80)
|
if(delta & 0x80)
|
||||||
delta -= 0x100;
|
delta -= 0x100;
|
||||||
sprintf(buffer, " %d, %s, %04x", oprom[0] & 7, regname(oprom[1]).cstr(), (pc+3+delta) & 0xffff);
|
sprintf(buffer, " %d, %s, %04x", oprom[0] & 7, regname(oprom[1]).c_str(), (pc+3+delta) & 0xffff);
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case DASM_direct_1:
|
case DASM_direct_1:
|
||||||
sprintf(buffer, " %s", regname(oprom[1]).cstr());
|
sprintf(buffer, " %s", regname(oprom[1]).c_str());
|
||||||
flags |= 2;
|
flags |= 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_direct_2:
|
case DASM_direct_2:
|
||||||
sprintf(buffer, " %s, %s", regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %s", regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_direct_3:
|
case DASM_direct_3:
|
||||||
sprintf(buffer, " %s, %s, %s", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %s, %s", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -288,20 +288,20 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_immed_2b:
|
case DASM_immed_2b:
|
||||||
sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]);
|
sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]);
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_immed_or_reg_2b:
|
case DASM_immed_or_reg_2b:
|
||||||
if(oprom[1] >= 0x10)
|
if(oprom[1] >= 0x10)
|
||||||
sprintf(buffer, " %s, %s", regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %s", regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]);
|
sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]);
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_immed_3b:
|
case DASM_immed_3b:
|
||||||
sprintf(buffer, " %s, %s, #%02x", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), oprom[1]);
|
sprintf(buffer, " %s, %s, #%02x", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), oprom[1]);
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -311,46 +311,46 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_immed_2w:
|
case DASM_immed_2w:
|
||||||
sprintf(buffer, " %s, #%02x%02x", regname(oprom[3]).cstr(), oprom[2], oprom[1]);
|
sprintf(buffer, " %s, #%02x%02x", regname(oprom[3]).c_str(), oprom[2], oprom[1]);
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_immed_3w:
|
case DASM_immed_3w:
|
||||||
sprintf(buffer, " %s, %s, #%02x%02x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), oprom[2], oprom[1]);
|
sprintf(buffer, " %s, %s, #%02x%02x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), oprom[2], oprom[1]);
|
||||||
flags |= 5;
|
flags |= 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_indirect_1n:
|
case DASM_indirect_1n:
|
||||||
sprintf(buffer, " [%s]", regname(oprom[1]).cstr());
|
sprintf(buffer, " [%s]", regname(oprom[1]).c_str());
|
||||||
flags |= 2;
|
flags |= 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_indirect_1:
|
case DASM_indirect_1:
|
||||||
if(oprom[1] & 0x01) {
|
if(oprom[1] & 0x01) {
|
||||||
sprintf(buffer, " [%s]+", regname(oprom[1]-1).cstr());
|
sprintf(buffer, " [%s]+", regname(oprom[1]-1).c_str());
|
||||||
flags |= 2;
|
flags |= 2;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buffer, " [%s]", regname(oprom[1]).cstr());
|
sprintf(buffer, " [%s]", regname(oprom[1]).c_str());
|
||||||
flags |= 2;
|
flags |= 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_indirect_2:
|
case DASM_indirect_2:
|
||||||
if(oprom[1] & 0x01) {
|
if(oprom[1] & 0x01) {
|
||||||
sprintf(buffer, " %s, [%s]+", regname(oprom[2]).cstr(), regname(oprom[1]-1).cstr());
|
sprintf(buffer, " %s, [%s]+", regname(oprom[2]).c_str(), regname(oprom[1]-1).c_str());
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buffer, " %s, [%s]", regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, [%s]", regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DASM_indirect_3:
|
case DASM_indirect_3:
|
||||||
if(oprom[1] & 0x01) {
|
if(oprom[1] & 0x01) {
|
||||||
sprintf(buffer, " %s, %s, [%s]+", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]-1).cstr());
|
sprintf(buffer, " %s, %s, [%s]+", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]-1).c_str());
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buffer, " %s, %s, [%s]", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %s, [%s]", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -360,7 +360,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
if(oprom[1] == 0x01)
|
if(oprom[1] == 0x01)
|
||||||
sprintf(buffer, " %02x%02x", oprom[3], oprom[2]);
|
sprintf(buffer, " %02x%02x", oprom[3], oprom[2]);
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %02x%02x[%s]", oprom[3], oprom[2], regname(oprom[1]-1).cstr());
|
sprintf(buffer, " %02x%02x[%s]", oprom[3], oprom[2], regname(oprom[1]-1).c_str());
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
} else {
|
} else {
|
||||||
int delta = oprom[2];
|
int delta = oprom[2];
|
||||||
@ -373,9 +373,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
sprintf(buffer, " %02x", delta);
|
sprintf(buffer, " %02x", delta);
|
||||||
} else {
|
} else {
|
||||||
if(delta < 0)
|
if(delta < 0)
|
||||||
sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).cstr());
|
sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).c_str());
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).cstr());
|
sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).c_str());
|
||||||
}
|
}
|
||||||
flags |= 3;
|
flags |= 3;
|
||||||
}
|
}
|
||||||
@ -384,9 +384,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
case DASM_indexed_2:
|
case DASM_indexed_2:
|
||||||
if(oprom[1] & 0x01) {
|
if(oprom[1] & 0x01) {
|
||||||
if(oprom[1] == 0x01)
|
if(oprom[1] == 0x01)
|
||||||
sprintf(buffer, " %s, %02x%02x", regname(oprom[4]).cstr(), oprom[3], oprom[2]);
|
sprintf(buffer, " %s, %02x%02x", regname(oprom[4]).c_str(), oprom[3], oprom[2]);
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, %02x%02x[%s]", regname(oprom[4]).cstr(), oprom[3], oprom[2], regname(oprom[1]-1).cstr());
|
sprintf(buffer, " %s, %02x%02x[%s]", regname(oprom[4]).c_str(), oprom[3], oprom[2], regname(oprom[1]-1).c_str());
|
||||||
flags |= 5;
|
flags |= 5;
|
||||||
} else {
|
} else {
|
||||||
int delta = oprom[2];
|
int delta = oprom[2];
|
||||||
@ -394,14 +394,14 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
delta -= 0x100;
|
delta -= 0x100;
|
||||||
if(oprom[1] == 0x00) {
|
if(oprom[1] == 0x00) {
|
||||||
if(delta < 0)
|
if(delta < 0)
|
||||||
sprintf(buffer, " %s, %04x", regname(oprom[3]).cstr(), delta & 0xffff);
|
sprintf(buffer, " %s, %04x", regname(oprom[3]).c_str(), delta & 0xffff);
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, %02x", regname(oprom[3]).cstr(), delta);
|
sprintf(buffer, " %s, %02x", regname(oprom[3]).c_str(), delta);
|
||||||
} else {
|
} else {
|
||||||
if(delta < 0)
|
if(delta < 0)
|
||||||
sprintf(buffer, " %s, -%02x[%s]", regname(oprom[3]).cstr(), -delta, regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, -%02x[%s]", regname(oprom[3]).c_str(), -delta, regname(oprom[1]).c_str());
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, %02x[%s]", regname(oprom[3]).cstr(), delta, regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %02x[%s]", regname(oprom[3]).c_str(), delta, regname(oprom[1]).c_str());
|
||||||
}
|
}
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
}
|
}
|
||||||
@ -410,9 +410,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
case DASM_indexed_3:
|
case DASM_indexed_3:
|
||||||
if(oprom[1] & 0x01) {
|
if(oprom[1] & 0x01) {
|
||||||
if(oprom[1] == 0x01)
|
if(oprom[1] == 0x01)
|
||||||
sprintf(buffer, " %s, %s, %02x%02x", regname(oprom[5]).cstr(), regname(oprom[4]).cstr(), oprom[3], oprom[2]);
|
sprintf(buffer, " %s, %s, %02x%02x", regname(oprom[5]).c_str(), regname(oprom[4]).c_str(), oprom[3], oprom[2]);
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, %s, %02x%02x[%s]", regname(oprom[5]).cstr(), regname(oprom[4]).cstr(), oprom[3], oprom[2], regname(oprom[1]-1).cstr());
|
sprintf(buffer, " %s, %s, %02x%02x[%s]", regname(oprom[5]).c_str(), regname(oprom[4]).c_str(), oprom[3], oprom[2], regname(oprom[1]-1).c_str());
|
||||||
flags |= 6;
|
flags |= 6;
|
||||||
} else {
|
} else {
|
||||||
int delta = oprom[2];
|
int delta = oprom[2];
|
||||||
@ -420,14 +420,14 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
|
|||||||
delta -= 0x100;
|
delta -= 0x100;
|
||||||
if(oprom[1] == 0x00) {
|
if(oprom[1] == 0x00) {
|
||||||
if(delta < 0)
|
if(delta < 0)
|
||||||
sprintf(buffer, " %s, %s, %04x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta & 0xffff);
|
sprintf(buffer, " %s, %s, %04x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta & 0xffff);
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, %s, %02x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta);
|
sprintf(buffer, " %s, %s, %02x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta);
|
||||||
} else {
|
} else {
|
||||||
if(delta < 0)
|
if(delta < 0)
|
||||||
sprintf(buffer, " %s, %s, -%02x[%s]", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), -delta, regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %s, -%02x[%s]", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), -delta, regname(oprom[1]).c_str());
|
||||||
else
|
else
|
||||||
sprintf(buffer, " %s, %s, %02x[%s]", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta, regname(oprom[1]).cstr());
|
sprintf(buffer, " %s, %s, %02x[%s]", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta, regname(oprom[1]).c_str());
|
||||||
}
|
}
|
||||||
flags |= 5;
|
flags |= 5;
|
||||||
}
|
}
|
||||||
|
@ -83,13 +83,13 @@ void score7_cpu_device::device_start()
|
|||||||
astring tmp_string;
|
astring tmp_string;
|
||||||
|
|
||||||
for(int i=0; i<0x20; i++)
|
for(int i=0; i<0x20; i++)
|
||||||
state_add(SCORE_GPR + i, tmp_string.format("r%d", i).cstr(), m_gpr[i]).callimport().callexport().formatstr("%08X");
|
state_add(SCORE_GPR + i, tmp_string.format("r%d", i).c_str(), m_gpr[i]).callimport().callexport().formatstr("%08X");
|
||||||
|
|
||||||
for(int i=0; i<0x20; i++)
|
for(int i=0; i<0x20; i++)
|
||||||
state_add(SCORE_CR + i, tmp_string.format("cr%d", i).cstr(), m_cr[i]).callimport().callexport().formatstr("%08X");
|
state_add(SCORE_CR + i, tmp_string.format("cr%d", i).c_str(), m_cr[i]).callimport().callexport().formatstr("%08X");
|
||||||
|
|
||||||
for(int i=0; i<3; i++)
|
for(int i=0; i<3; i++)
|
||||||
state_add(SCORE_SR + i, tmp_string.format("sr%d", i).cstr(), m_sr[i]).callimport().callexport().formatstr("%08X");
|
state_add(SCORE_SR + i, tmp_string.format("sr%d", i).c_str(), m_sr[i]).callimport().callexport().formatstr("%08X");
|
||||||
|
|
||||||
state_add(SCORE_CEH, "ceh", REG_CEH).callimport().callexport().formatstr("%08X");
|
state_add(SCORE_CEH, "ceh", REG_CEH).callimport().callexport().formatstr("%08X");
|
||||||
state_add(SCORE_CEL, "cel", REG_CEL).callimport().callexport().formatstr("%08X");
|
state_add(SCORE_CEL, "cel", REG_CEL).callimport().callexport().formatstr("%08X");
|
||||||
|
@ -743,7 +743,7 @@ void uml::instruction::simplify()
|
|||||||
astring disasm1, disasm2;
|
astring disasm1, disasm2;
|
||||||
orig.disasm(disasm1, block->drcuml);
|
orig.disasm(disasm1, block->drcuml);
|
||||||
inst->disasm(disasm2, block->drcuml);
|
inst->disasm(disasm2, block->drcuml);
|
||||||
osd_printf_debug("Simplified: %-50.50s -> %s\n", disasm1.cstr(), disasm2.cstr());
|
osd_printf_debug("Simplified: %-50.50s -> %s\n", disasm1.c_str(), disasm2.c_str());
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1044,7 +1044,7 @@ static void execute_ignore(running_machine &machine, int ref, int params, const
|
|||||||
/* special message for none */
|
/* special message for none */
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
buffer.printf("Not currently ignoring any devices");
|
buffer.printf("Not currently ignoring any devices");
|
||||||
debug_console_printf(machine, "%s\n", buffer.cstr());
|
debug_console_printf(machine, "%s\n", buffer.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* otherwise clear the ignore flag on all requested CPUs */
|
/* otherwise clear the ignore flag on all requested CPUs */
|
||||||
@ -1109,7 +1109,7 @@ static void execute_observe(running_machine &machine, int ref, int params, const
|
|||||||
/* special message for none */
|
/* special message for none */
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
buffer.printf("Not currently observing any devices");
|
buffer.printf("Not currently observing any devices");
|
||||||
debug_console_printf(machine, "%s\n", buffer.cstr());
|
debug_console_printf(machine, "%s\n", buffer.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* otherwise set the ignore flag on all requested CPUs */
|
/* otherwise set the ignore flag on all requested CPUs */
|
||||||
@ -1332,7 +1332,7 @@ static void execute_bplist(running_machine &machine, int ref, int params, const
|
|||||||
buffer.catprintf(" if %s", bp->condition());
|
buffer.catprintf(" if %s", bp->condition());
|
||||||
if (astring(bp->action()) != astring(""))
|
if (astring(bp->action()) != astring(""))
|
||||||
buffer.catprintf(" do %s", bp->action());
|
buffer.catprintf(" do %s", bp->action());
|
||||||
debug_console_printf(machine, "%s\n", buffer.cstr());
|
debug_console_printf(machine, "%s\n", buffer.c_str());
|
||||||
printed++;
|
printed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1502,7 +1502,7 @@ static void execute_wplist(running_machine &machine, int ref, int params, const
|
|||||||
buffer.catprintf(" if %s", wp->condition());
|
buffer.catprintf(" if %s", wp->condition());
|
||||||
if (astring(wp->action()) != astring(""))
|
if (astring(wp->action()) != astring(""))
|
||||||
buffer.catprintf(" do %s", wp->action());
|
buffer.catprintf(" do %s", wp->action());
|
||||||
debug_console_printf(machine, "%s\n", buffer.cstr());
|
debug_console_printf(machine, "%s\n", buffer.c_str());
|
||||||
printed++;
|
printed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1641,7 +1641,7 @@ static void execute_rplist(running_machine &machine, int ref, int params, const
|
|||||||
buffer.catprintf("if %s", rp->condition());
|
buffer.catprintf("if %s", rp->condition());
|
||||||
if (rp->action() != NULL)
|
if (rp->action() != NULL)
|
||||||
buffer.catprintf(" do %s", rp->action());
|
buffer.catprintf(" do %s", rp->action());
|
||||||
debug_console_printf(machine, "%s\n", buffer.cstr());
|
debug_console_printf(machine, "%s\n", buffer.c_str());
|
||||||
printed++;
|
printed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2605,7 +2605,7 @@ static void execute_trace_internal(running_machine &machine, int ref, int params
|
|||||||
/* do it */
|
/* do it */
|
||||||
cpu->debug()->trace(f, trace_over, action);
|
cpu->debug()->trace(f, trace_over, action);
|
||||||
if (f)
|
if (f)
|
||||||
debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename.cstr());
|
debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename.c_str());
|
||||||
else
|
else
|
||||||
debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag());
|
debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag());
|
||||||
}
|
}
|
||||||
@ -3100,9 +3100,9 @@ static void execute_dumpkbd(running_machine &machine, int ref, int params, const
|
|||||||
|
|
||||||
// and output it as appropriate
|
// and output it as appropriate
|
||||||
if (file != NULL)
|
if (file != NULL)
|
||||||
fprintf(file, "%s\n", buffer.cstr());
|
fprintf(file, "%s\n", buffer.c_str());
|
||||||
else
|
else
|
||||||
debug_console_printf(machine, "%s\n", buffer.cstr());
|
debug_console_printf(machine, "%s\n", buffer.c_str());
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
if (file != NULL)
|
if (file != NULL)
|
||||||
|
@ -3061,7 +3061,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc);
|
buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc);
|
||||||
debug_console_printf(space.machine(), "%s\n", buffer.cstr());
|
debug_console_printf(space.machine(), "%s\n", buffer.c_str());
|
||||||
space.device().debug()->compute_debug_flags();
|
space.device().debug()->compute_debug_flags();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3495,7 +3495,7 @@ void device_debug::tracer::update(offs_t pc)
|
|||||||
buffer.cat(dasm);
|
buffer.cat(dasm);
|
||||||
|
|
||||||
// output the result
|
// output the result
|
||||||
fprintf(&m_file, "%s\n", buffer.cstr());
|
fprintf(&m_file, "%s\n", buffer.c_str());
|
||||||
|
|
||||||
// do we need to step the trace over this instruction?
|
// do we need to step the trace over this instruction?
|
||||||
if (m_trace_over && (dasmresult & DASMFLAG_SUPPORTED) != 0 && (dasmresult & DASMFLAG_STEP_OVER) != 0)
|
if (m_trace_over && (dasmresult & DASMFLAG_SUPPORTED) != 0 && (dasmresult & DASMFLAG_STEP_OVER) != 0)
|
||||||
|
@ -134,7 +134,7 @@ void debug_view_breakpoints::enumerate_sources()
|
|||||||
{
|
{
|
||||||
astring name;
|
astring name;
|
||||||
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
|
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
|
||||||
m_source_list.append(*global_alloc(debug_view_source(name.cstr(), &dasm->device())));
|
m_source_list.append(*global_alloc(debug_view_source(name.c_str(), &dasm->device())));
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset the source to a known good entry
|
// reset the source to a known good entry
|
||||||
@ -196,7 +196,7 @@ void debug_view_breakpoints::pad_astring_to_length(astring& str, int len)
|
|||||||
buffer.expand(diff);
|
buffer.expand(diff);
|
||||||
for (int i = 0; i < diff; i++)
|
for (int i = 0; i < diff; i++)
|
||||||
buffer.catprintf(" ");
|
buffer.catprintf(" ");
|
||||||
str.catprintf("%s", buffer.cstr());
|
str.catprintf("%s", buffer.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,13 +291,13 @@ void debug_view_state::view_update()
|
|||||||
len += m_divider - 1 - curitem->m_symbol.len();
|
len += m_divider - 1 - curitem->m_symbol.len();
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&temp[len], curitem->m_symbol.cstr(), curitem->m_symbol.len());
|
memcpy(&temp[len], curitem->m_symbol.c_str(), curitem->m_symbol.len());
|
||||||
len += curitem->m_symbol.len();
|
len += curitem->m_symbol.len();
|
||||||
|
|
||||||
temp[len++] = ' ';
|
temp[len++] = ' ';
|
||||||
temp[len++] = ' ';
|
temp[len++] = ' ';
|
||||||
|
|
||||||
memcpy(&temp[len], valstr.cstr(), curitem->m_vallen);
|
memcpy(&temp[len], valstr.c_str(), curitem->m_vallen);
|
||||||
len += curitem->m_vallen;
|
len += curitem->m_vallen;
|
||||||
|
|
||||||
temp[len++] = ' ';
|
temp[len++] = ' ';
|
||||||
|
@ -156,7 +156,7 @@ void debug_view_watchpoints::enumerate_sources()
|
|||||||
{
|
{
|
||||||
astring name;
|
astring name;
|
||||||
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
|
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
|
||||||
m_source_list.append(*global_alloc(debug_view_source(name.cstr(), &dasm->device())));
|
m_source_list.append(*global_alloc(debug_view_source(name.c_str(), &dasm->device())));
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset the source to a known good entry
|
// reset the source to a known good entry
|
||||||
@ -220,7 +220,7 @@ void debug_view_watchpoints::pad_astring_to_length(astring& str, int len)
|
|||||||
buffer.expand(diff);
|
buffer.expand(diff);
|
||||||
for (int i = 0; i < diff; i++)
|
for (int i = 0; i < diff; i++)
|
||||||
buffer.catprintf(" ");
|
buffer.catprintf(" ");
|
||||||
str.catprintf("%s", buffer.cstr());
|
str.catprintf("%s", buffer.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ void integer_symbol_entry::set_value(UINT64 newvalue)
|
|||||||
if (m_setter != NULL)
|
if (m_setter != NULL)
|
||||||
(*m_setter)(m_table, m_ref, newvalue);
|
(*m_setter)(m_table, m_ref, newvalue);
|
||||||
else
|
else
|
||||||
throw emu_fatalerror("Symbol '%s' is read-only", m_name.cstr());
|
throw emu_fatalerror("Symbol '%s' is read-only", m_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ bool function_symbol_entry::is_lval() const
|
|||||||
|
|
||||||
UINT64 function_symbol_entry::value() const
|
UINT64 function_symbol_entry::value() const
|
||||||
{
|
{
|
||||||
throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.cstr());
|
throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ UINT64 function_symbol_entry::value() const
|
|||||||
|
|
||||||
void function_symbol_entry::set_value(UINT64 newvalue)
|
void function_symbol_entry::set_value(UINT64 newvalue)
|
||||||
{
|
{
|
||||||
throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.cstr());
|
throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -368,9 +368,9 @@ void function_symbol_entry::set_value(UINT64 newvalue)
|
|||||||
UINT64 function_symbol_entry::execute(int numparams, const UINT64 *paramlist)
|
UINT64 function_symbol_entry::execute(int numparams, const UINT64 *paramlist)
|
||||||
{
|
{
|
||||||
if (numparams < m_minparams)
|
if (numparams < m_minparams)
|
||||||
throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.cstr(), m_minparams);
|
throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.c_str(), m_minparams);
|
||||||
if (numparams > m_maxparams)
|
if (numparams > m_maxparams)
|
||||||
throw emu_fatalerror("Function '%s' accepts no more than %d parameters", m_name.cstr(), m_maxparams);
|
throw emu_fatalerror("Function '%s' accepts no more than %d parameters", m_name.c_str(), m_maxparams);
|
||||||
return (*m_execute)(m_table, m_ref, numparams, paramlist);
|
return (*m_execute)(m_table, m_ref, numparams, paramlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,15 +927,15 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
|
|||||||
|
|
||||||
// if we have an 0x prefix, we must be a hex value
|
// if we have an 0x prefix, we must be a hex value
|
||||||
if (buffer[0] == '0' && buffer[1] == 'x')
|
if (buffer[0] == '0' && buffer[1] == 'x')
|
||||||
return parse_number(token, buffer.cstr() + 2, 16, expression_error::INVALID_NUMBER);
|
return parse_number(token, buffer.c_str() + 2, 16, expression_error::INVALID_NUMBER);
|
||||||
|
|
||||||
// if we have a # prefix, we must be a decimal value
|
// if we have a # prefix, we must be a decimal value
|
||||||
if (buffer[0] == '#')
|
if (buffer[0] == '#')
|
||||||
return parse_number(token, buffer.cstr() + 1, 10, expression_error::INVALID_NUMBER);
|
return parse_number(token, buffer.c_str() + 1, 10, expression_error::INVALID_NUMBER);
|
||||||
|
|
||||||
// if we have a $ prefix, we are a hex value
|
// if we have a $ prefix, we are a hex value
|
||||||
if (buffer[0] == '$')
|
if (buffer[0] == '$')
|
||||||
return parse_number(token, buffer.cstr() + 1, 16, expression_error::INVALID_NUMBER);
|
return parse_number(token, buffer.c_str() + 1, 16, expression_error::INVALID_NUMBER);
|
||||||
|
|
||||||
// check for a symbol match
|
// check for a symbol match
|
||||||
symbol_entry *symbol = m_symtable->find_deep(buffer);
|
symbol_entry *symbol = m_symtable->find_deep(buffer);
|
||||||
|
@ -327,7 +327,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
|
|||||||
|
|
||||||
UINT32 region_length = valid.region_length(gfxregion);
|
UINT32 region_length = valid.region_length(gfxregion);
|
||||||
if (region_length == 0)
|
if (region_length == 0)
|
||||||
osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.cstr());
|
osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.c_str());
|
||||||
|
|
||||||
// if we have a valid region, and we're not using auto-sizing, check the decode against the region length
|
// if we have a valid region, and we're not using auto-sizing, check the decode against the region length
|
||||||
else if (!IS_FRAC(layout.total))
|
else if (!IS_FRAC(layout.total))
|
||||||
|
@ -236,7 +236,7 @@ static const char *const messages[] =
|
|||||||
|
|
||||||
const char *device_image_interface::error()
|
const char *device_image_interface::error()
|
||||||
{
|
{
|
||||||
return (m_err_message) ? m_err_message.cstr() : messages[m_err];
|
return (m_err_message) ? m_err_message.c_str() : messages[m_err];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ bool device_image_interface::try_change_working_directory(const char *subdir)
|
|||||||
bool success = FALSE;
|
bool success = FALSE;
|
||||||
bool done = FALSE;
|
bool done = FALSE;
|
||||||
|
|
||||||
directory = osd_opendir(m_working_directory.cstr());
|
directory = osd_opendir(m_working_directory.c_str());
|
||||||
if (directory != NULL)
|
if (directory != NULL)
|
||||||
{
|
{
|
||||||
while(!done && (entry = osd_readdir(directory)) != NULL)
|
while(!done && (entry = osd_readdir(directory)) != NULL)
|
||||||
@ -536,7 +536,7 @@ bool device_image_interface::uses_file_extension(const char *file_extension) con
|
|||||||
|
|
||||||
/* find the extensions */
|
/* find the extensions */
|
||||||
astring extensions(file_extensions());
|
astring extensions(file_extensions());
|
||||||
char *ext = strtok((char*)extensions.cstr(),",");
|
char *ext = strtok((char*)extensions.c_str(),",");
|
||||||
while (ext != NULL)
|
while (ext != NULL)
|
||||||
{
|
{
|
||||||
if (!core_stricmp(ext, file_extension))
|
if (!core_stricmp(ext, file_extension))
|
||||||
@ -823,17 +823,17 @@ bool device_image_interface::load_software(software_list_device &swlist, const c
|
|||||||
// - if we are not using lists, we have regiontag only;
|
// - if we are not using lists, we have regiontag only;
|
||||||
// - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
|
// - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
|
||||||
// try to load from list/setname
|
// try to load from list/setname
|
||||||
if ((m_mame_file == NULL) && (tag2.cstr() != NULL))
|
if ((m_mame_file == NULL) && (tag2.c_str() != NULL))
|
||||||
filerr = common_process_file(device().machine().options(), tag2.cstr(), has_crc, crc, romp, &m_mame_file);
|
filerr = common_process_file(device().machine().options(), tag2.c_str(), has_crc, crc, romp, &m_mame_file);
|
||||||
// try to load from list/parentname
|
// try to load from list/parentname
|
||||||
if ((m_mame_file == NULL) && (tag3.cstr() != NULL))
|
if ((m_mame_file == NULL) && (tag3.c_str() != NULL))
|
||||||
filerr = common_process_file(device().machine().options(), tag3.cstr(), has_crc, crc, romp, &m_mame_file);
|
filerr = common_process_file(device().machine().options(), tag3.c_str(), has_crc, crc, romp, &m_mame_file);
|
||||||
// try to load from setname
|
// try to load from setname
|
||||||
if ((m_mame_file == NULL) && (tag4.cstr() != NULL))
|
if ((m_mame_file == NULL) && (tag4.c_str() != NULL))
|
||||||
filerr = common_process_file(device().machine().options(), tag4.cstr(), has_crc, crc, romp, &m_mame_file);
|
filerr = common_process_file(device().machine().options(), tag4.c_str(), has_crc, crc, romp, &m_mame_file);
|
||||||
// try to load from parentname
|
// try to load from parentname
|
||||||
if ((m_mame_file == NULL) && (tag5.cstr() != NULL))
|
if ((m_mame_file == NULL) && (tag5.c_str() != NULL))
|
||||||
filerr = common_process_file(device().machine().options(), tag5.cstr(), has_crc, crc, romp, &m_mame_file);
|
filerr = common_process_file(device().machine().options(), tag5.c_str(), has_crc, crc, romp, &m_mame_file);
|
||||||
|
|
||||||
warningcount += verify_length_and_hash(m_mame_file,ROM_GETNAME(romp),ROM_GETLENGTH(romp),hash_collection(ROM_GETHASHDATA(romp)));
|
warningcount += verify_length_and_hash(m_mame_file,ROM_GETNAME(romp),ROM_GETLENGTH(romp),hash_collection(ROM_GETHASHDATA(romp)));
|
||||||
|
|
||||||
|
@ -238,14 +238,14 @@ void device_sound_interface::interface_validity_check(validity_checker &valid) c
|
|||||||
for (const sound_route *route = first_route(); route != NULL; route = route->next())
|
for (const sound_route *route = first_route(); route != NULL; route = route->next())
|
||||||
{
|
{
|
||||||
// find a device with the requested tag
|
// find a device with the requested tag
|
||||||
const device_t *target = device().siblingdevice(route->m_target.cstr());
|
const device_t *target = device().siblingdevice(route->m_target.c_str());
|
||||||
if (target == NULL)
|
if (target == NULL)
|
||||||
osd_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.cstr());
|
osd_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.c_str());
|
||||||
|
|
||||||
// if it's not a speaker or a sound device, error
|
// if it's not a speaker or a sound device, error
|
||||||
const device_sound_interface *sound;
|
const device_sound_interface *sound;
|
||||||
if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
|
if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
|
||||||
osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.cstr(), target->name());
|
osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.c_str(), target->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,13 +318,13 @@ void device_sound_interface::interface_post_start()
|
|||||||
int streamoutputnum;
|
int streamoutputnum;
|
||||||
sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum);
|
sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum);
|
||||||
if (outputstream == NULL)
|
if (outputstream == NULL)
|
||||||
fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.cstr(), outputnum);
|
fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.c_str(), outputnum);
|
||||||
|
|
||||||
// find the input stream to connect to
|
// find the input stream to connect to
|
||||||
int streaminputnum;
|
int streaminputnum;
|
||||||
sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
|
sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
|
||||||
if (inputstream == NULL)
|
if (inputstream == NULL)
|
||||||
fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d\n", route->m_target.cstr(), outputnum, m_device.tag(), inputnum - 1);
|
fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d\n", route->m_target.c_str(), outputnum, m_device.tag(), inputnum - 1);
|
||||||
|
|
||||||
// set the input
|
// set the input
|
||||||
inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);
|
inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);
|
||||||
|
@ -532,7 +532,7 @@ bool emu_options::parse_one_ini(const char *basename, int priority, astring *err
|
|||||||
|
|
||||||
// append errors if requested
|
// append errors if requested
|
||||||
if (error && error_string != NULL)
|
if (error && error_string != NULL)
|
||||||
error_string->catprintf("While parsing %s:\n%s\n", file.fullpath(), error.cstr());
|
error_string->catprintf("While parsing %s:\n%s\n", file.fullpath(), error.c_str());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -544,7 +544,7 @@ const char *emu_options::main_value(astring &buffer, const char *name) const
|
|||||||
int pos = buffer.chr(0, ',');
|
int pos = buffer.chr(0, ',');
|
||||||
if (pos != -1)
|
if (pos != -1)
|
||||||
buffer = buffer.substr(0, pos);
|
buffer = buffer.substr(0, pos);
|
||||||
return buffer.cstr();
|
return buffer.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *emu_options::sub_value(astring &buffer, const char *name, const char *subname) const
|
const char *emu_options::sub_value(astring &buffer, const char *name, const char *subname) const
|
||||||
@ -561,5 +561,5 @@ const char *emu_options::sub_value(astring &buffer, const char *name, const char
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
buffer.reset();
|
buffer.reset();
|
||||||
return buffer.cstr();
|
return buffer.c_str();
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ void palette_device::device_start()
|
|||||||
{
|
{
|
||||||
// find the extended (split) memory, if present
|
// find the extended (split) memory, if present
|
||||||
astring tag_ext(tag(), "_ext");
|
astring tag_ext(tag(), "_ext");
|
||||||
const memory_share *share_ext = memshare(tag_ext.cstr());
|
const memory_share *share_ext = memshare(tag_ext.c_str());
|
||||||
|
|
||||||
// make sure we have specified a format
|
// make sure we have specified a format
|
||||||
assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified");
|
assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified");
|
||||||
|
@ -845,16 +845,16 @@ file_error emu_file::attempt__7zped()
|
|||||||
int fileno = -1;
|
int fileno = -1;
|
||||||
|
|
||||||
// see if we can find a file with the right name and (if available) crc
|
// see if we can find a file with the right name and (if available) crc
|
||||||
if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), true, true);
|
if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), true, true);
|
||||||
|
|
||||||
// if that failed, look for a file with the right crc, but the wrong filename
|
// if that failed, look for a file with the right crc, but the wrong filename
|
||||||
if (fileno==-1)
|
if (fileno==-1)
|
||||||
if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), true, false);
|
if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), true, false);
|
||||||
|
|
||||||
// if that failed, look for a file with the right name; reporting a bad checksum
|
// if that failed, look for a file with the right name; reporting a bad checksum
|
||||||
// is more helpful and less confusing than reporting "rom not found"
|
// is more helpful and less confusing than reporting "rom not found"
|
||||||
if (fileno==-1)
|
if (fileno==-1)
|
||||||
fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), false, true);
|
fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), false, true);
|
||||||
|
|
||||||
if (fileno != -1)
|
if (fileno != -1)
|
||||||
{
|
{
|
||||||
|
@ -232,8 +232,8 @@ void image_device_init(running_machine &machine)
|
|||||||
|
|
||||||
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
|
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
|
||||||
image->device().name(),
|
image->device().name(),
|
||||||
image_basename.cstr(),
|
image_basename.c_str(),
|
||||||
image_err.cstr());
|
image_err.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ void image_postdevice_init(running_machine &machine)
|
|||||||
|
|
||||||
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
|
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
|
||||||
image->device().name(),
|
image->device().name(),
|
||||||
image_err.cstr());
|
image_err.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ bool cassette_image_device::call_load()
|
|||||||
fname = m_mame_file->filename();
|
fname = m_mame_file->filename();
|
||||||
int loc = fname.rchr(0,'.');
|
int loc = fname.rchr(0,'.');
|
||||||
if (loc!=-1) {
|
if (loc!=-1) {
|
||||||
extension = fname.substr(loc + 1,fname.len()-loc).cstr();
|
extension = fname.substr(loc + 1,fname.len()-loc).c_str();
|
||||||
} else {
|
} else {
|
||||||
extension = "";
|
extension = "";
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
|
|||||||
astring fname(name, ".dif");
|
astring fname(name, ".dif");
|
||||||
|
|
||||||
/* try to open the diff */
|
/* try to open the diff */
|
||||||
//printf("Opening differencing image file: %s\n", fname.cstr());
|
//printf("Opening differencing image file: %s\n", fname.c_str());
|
||||||
emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
|
emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
|
||||||
file_error filerr = diff_file.open(fname);
|
file_error filerr = diff_file.open(fname);
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
@ -181,12 +181,12 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
|
|||||||
astring fullpath(diff_file.fullpath());
|
astring fullpath(diff_file.fullpath());
|
||||||
diff_file.close();
|
diff_file.close();
|
||||||
|
|
||||||
//printf("Opening differencing image file: %s\n", fullpath.cstr());
|
//printf("Opening differencing image file: %s\n", fullpath.c_str());
|
||||||
return diff_chd.open(fullpath, true, &source);
|
return diff_chd.open(fullpath, true, &source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* didn't work; try creating it instead */
|
/* didn't work; try creating it instead */
|
||||||
//printf("Creating differencing image: %s\n", fname.cstr());
|
//printf("Creating differencing image: %s\n", fname.c_str());
|
||||||
diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
||||||
filerr = diff_file.open(fname);
|
filerr = diff_file.open(fname);
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
@ -195,7 +195,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
|
|||||||
diff_file.close();
|
diff_file.close();
|
||||||
|
|
||||||
/* create the CHD */
|
/* create the CHD */
|
||||||
//printf("Creating differencing image file: %s\n", fullpath.cstr());
|
//printf("Creating differencing image file: %s\n", fullpath.c_str());
|
||||||
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
||||||
chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
|
chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
|
@ -179,7 +179,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
|
|||||||
astring fname(name, ".dif");
|
astring fname(name, ".dif");
|
||||||
|
|
||||||
/* try to open the diff */
|
/* try to open the diff */
|
||||||
//printf("Opening differencing image file: %s\n", fname.cstr());
|
//printf("Opening differencing image file: %s\n", fname.c_str());
|
||||||
emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
|
emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
|
||||||
file_error filerr = diff_file.open(fname);
|
file_error filerr = diff_file.open(fname);
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
@ -187,12 +187,12 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
|
|||||||
astring fullpath(diff_file.fullpath());
|
astring fullpath(diff_file.fullpath());
|
||||||
diff_file.close();
|
diff_file.close();
|
||||||
|
|
||||||
//printf("Opening differencing image file: %s\n", fullpath.cstr());
|
//printf("Opening differencing image file: %s\n", fullpath.c_str());
|
||||||
return diff_chd.open(fullpath, true, &source);
|
return diff_chd.open(fullpath, true, &source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* didn't work; try creating it instead */
|
/* didn't work; try creating it instead */
|
||||||
//printf("Creating differencing image: %s\n", fname.cstr());
|
//printf("Creating differencing image: %s\n", fname.c_str());
|
||||||
diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
||||||
filerr = diff_file.open(fname);
|
filerr = diff_file.open(fname);
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
@ -201,7 +201,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
|
|||||||
diff_file.close();
|
diff_file.close();
|
||||||
|
|
||||||
/* create the CHD */
|
/* create the CHD */
|
||||||
//printf("Creating differencing image file: %s\n", fullpath.cstr());
|
//printf("Creating differencing image file: %s\n", fullpath.c_str());
|
||||||
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
||||||
chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
|
chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
|
@ -197,7 +197,7 @@ void info_xml_creator::output(FILE *out)
|
|||||||
dtd.replace(0,"__XML_ROOT__", emulator_info::get_xml_root());
|
dtd.replace(0,"__XML_ROOT__", emulator_info::get_xml_root());
|
||||||
dtd.replace(0,"__XML_TOP__", emulator_info::get_xml_top());
|
dtd.replace(0,"__XML_TOP__", emulator_info::get_xml_top());
|
||||||
|
|
||||||
fprintf(m_output, "%s\n\n", dtd.cstr());
|
fprintf(m_output, "%s\n\n", dtd.c_str());
|
||||||
|
|
||||||
// top-level tag
|
// top-level tag
|
||||||
fprintf(m_output, "<%s build=\"%s\" debug=\""
|
fprintf(m_output, "<%s build=\"%s\" debug=\""
|
||||||
@ -343,7 +343,7 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
|
|||||||
fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
|
fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
|
||||||
astring src(device.source());
|
astring src(device.source());
|
||||||
src.replace("../","");
|
src.replace("../","");
|
||||||
fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.cstr()));
|
fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.c_str()));
|
||||||
fprintf(m_output, " isdevice=\"yes\"");
|
fprintf(m_output, " isdevice=\"yes\"");
|
||||||
fprintf(m_output, " runnable=\"no\"");
|
fprintf(m_output, " runnable=\"no\"");
|
||||||
output_sampleof();
|
output_sampleof();
|
||||||
@ -404,7 +404,7 @@ void info_xml_creator::output_devices()
|
|||||||
{
|
{
|
||||||
astring temptag("_");
|
astring temptag("_");
|
||||||
temptag.cat(option->name());
|
temptag.cat(option->name());
|
||||||
device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), option->devtype(), 0);
|
device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.c_str(), option->devtype(), 0);
|
||||||
|
|
||||||
// notify this device and all its subdevices that they are now configured
|
// notify this device and all its subdevices that they are now configured
|
||||||
device_iterator subiter(*dev);
|
device_iterator subiter(*dev);
|
||||||
@ -413,9 +413,9 @@ void info_xml_creator::output_devices()
|
|||||||
device->config_complete();
|
device->config_complete();
|
||||||
|
|
||||||
if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE)
|
if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE)
|
||||||
output_one_device(*dev, temptag.cstr());
|
output_one_device(*dev, temptag.c_str());
|
||||||
|
|
||||||
const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.cstr());
|
const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -582,7 +582,7 @@ void info_xml_creator::output_rom(device_t &device)
|
|||||||
|
|
||||||
output.cat("/>\n");
|
output.cat("/>\n");
|
||||||
|
|
||||||
fprintf(m_output, "%s", output.cstr());
|
fprintf(m_output, "%s", output.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1085,7 +1085,7 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char *
|
|||||||
// output the switch name information
|
// output the switch name information
|
||||||
astring normalized_field_name(xml_normalize_string(field->name()));
|
astring normalized_field_name(xml_normalize_string(field->name()));
|
||||||
astring normalized_newtag(xml_normalize_string(newtag));
|
astring normalized_newtag(xml_normalize_string(newtag));
|
||||||
output.catprintf("\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.cstr(), normalized_newtag.cstr(), field->mask());
|
output.catprintf("\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.c_str(), normalized_newtag.c_str(), field->mask());
|
||||||
|
|
||||||
// loop over settings
|
// loop over settings
|
||||||
for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
|
for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
|
||||||
@ -1096,7 +1096,7 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char *
|
|||||||
// terminate the switch entry
|
// terminate the switch entry
|
||||||
output.catprintf("\t\t</%s>\n", outertag);
|
output.catprintf("\t\t</%s>\n", outertag);
|
||||||
|
|
||||||
fprintf(m_output, "%s", output.cstr());
|
fprintf(m_output, "%s", output.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1240,7 +1240,7 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
|
|||||||
|
|
||||||
astring extensions(imagedev->file_extensions());
|
astring extensions(imagedev->file_extensions());
|
||||||
|
|
||||||
char *ext = strtok((char *)extensions.cstr(), ",");
|
char *ext = strtok((char *)extensions.c_str(), ",");
|
||||||
while (ext != NULL)
|
while (ext != NULL)
|
||||||
{
|
{
|
||||||
fprintf(m_output, "\t\t\t<extension");
|
fprintf(m_output, "\t\t\t<extension");
|
||||||
|
@ -531,7 +531,7 @@ bool joystick_map::parse(const char *mapstring)
|
|||||||
|
|
||||||
const char *joystick_map::to_string(astring &string) const
|
const char *joystick_map::to_string(astring &string) const
|
||||||
{
|
{
|
||||||
string.printf("%s\n", m_origstring.cstr());
|
string.printf("%s\n", m_origstring.c_str());
|
||||||
for (int rownum = 0; rownum < 9; rownum++)
|
for (int rownum = 0; rownum < 9; rownum++)
|
||||||
{
|
{
|
||||||
string.catprintf(" ");
|
string.catprintf(" ");
|
||||||
@ -1579,7 +1579,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
|
|
||||||
// first token should be the devclass
|
// first token should be the devclass
|
||||||
int curtok = 0;
|
int curtok = 0;
|
||||||
input_device_class devclass = input_device_class((*devclass_token_table)[token[curtok++].cstr()]);
|
input_device_class devclass = input_device_class((*devclass_token_table)[token[curtok++].c_str()]);
|
||||||
if (devclass == ~0)
|
if (devclass == ~0)
|
||||||
return INPUT_CODE_INVALID;
|
return INPUT_CODE_INVALID;
|
||||||
|
|
||||||
@ -1594,7 +1594,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
return INPUT_CODE_INVALID;
|
return INPUT_CODE_INVALID;
|
||||||
|
|
||||||
// next token is the item ID
|
// next token is the item ID
|
||||||
input_item_id itemid = input_item_id((*itemid_token_table)[token[curtok].cstr()]);
|
input_item_id itemid = input_item_id((*itemid_token_table)[token[curtok].c_str()]);
|
||||||
bool standard = (itemid != ~0);
|
bool standard = (itemid != ~0);
|
||||||
|
|
||||||
// if we're a standard code, default the itemclass based on it
|
// if we're a standard code, default the itemclass based on it
|
||||||
@ -1632,7 +1632,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
input_item_modifier modifier = ITEM_MODIFIER_NONE;
|
input_item_modifier modifier = ITEM_MODIFIER_NONE;
|
||||||
if (curtok < numtokens)
|
if (curtok < numtokens)
|
||||||
{
|
{
|
||||||
modifier = input_item_modifier((*modifier_token_table)[token[curtok].cstr()]);
|
modifier = input_item_modifier((*modifier_token_table)[token[curtok].c_str()]);
|
||||||
if (modifier != ~0)
|
if (modifier != ~0)
|
||||||
curtok++;
|
curtok++;
|
||||||
else
|
else
|
||||||
@ -1642,7 +1642,7 @@ input_code input_manager::code_from_token(const char *_token)
|
|||||||
// if we have another token, it is the item class
|
// if we have another token, it is the item class
|
||||||
if (curtok < numtokens)
|
if (curtok < numtokens)
|
||||||
{
|
{
|
||||||
UINT32 temp = (*itemclass_token_table)[token[curtok].cstr()];
|
UINT32 temp = (*itemclass_token_table)[token[curtok].c_str()];
|
||||||
if (temp != ~0)
|
if (temp != ~0)
|
||||||
{
|
{
|
||||||
curtok++;
|
curtok++;
|
||||||
@ -2020,7 +2020,7 @@ void input_manager::seq_from_tokens(input_seq &seq, const char *string)
|
|||||||
|
|
||||||
// loop until we're done
|
// loop until we're done
|
||||||
astring strcopy = string;
|
astring strcopy = string;
|
||||||
char *str = const_cast<char *>(strcopy.cstr());
|
char *str = const_cast<char *>(strcopy.c_str());
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
// trim any leading spaces
|
// trim any leading spaces
|
||||||
|
@ -2482,7 +2482,7 @@ time_t ioport_manager::initialize()
|
|||||||
astring errors;
|
astring errors;
|
||||||
m_portlist.append(*device, errors);
|
m_portlist.append(*device, errors);
|
||||||
if (errors)
|
if (errors)
|
||||||
osd_printf_error("Input port errors:\n%s", errors.cstr());
|
osd_printf_error("Input port errors:\n%s", errors.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// renumber player numbers for controller ports
|
// renumber player numbers for controller ports
|
||||||
@ -3703,9 +3703,9 @@ void ioport_configurer::port_modify(const char *tag)
|
|||||||
m_owner.subtag(fulltag, tag);
|
m_owner.subtag(fulltag, tag);
|
||||||
|
|
||||||
// find the existing port
|
// find the existing port
|
||||||
m_curport = m_portlist.find(fulltag.cstr());
|
m_curport = m_portlist.find(fulltag.c_str());
|
||||||
if (m_curport == NULL)
|
if (m_curport == NULL)
|
||||||
throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr());
|
throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.c_str());
|
||||||
|
|
||||||
// bump the modification count, and reset current field/setting
|
// bump the modification count, and reset current field/setting
|
||||||
m_curport->m_modcount++;
|
m_curport->m_modcount++;
|
||||||
|
@ -1044,7 +1044,7 @@ void lua_engine::periodic_check()
|
|||||||
osd_lock_acquire(lock);
|
osd_lock_acquire(lock);
|
||||||
if (msg.ready == 1) {
|
if (msg.ready == 1) {
|
||||||
lua_settop(m_lua_state, 0);
|
lua_settop(m_lua_state, 0);
|
||||||
int status = luaL_loadbuffer(m_lua_state, msg.text.cstr(), strlen(msg.text.cstr()), "=stdin");
|
int status = luaL_loadbuffer(m_lua_state, msg.text.c_str(), strlen(msg.text.c_str()), "=stdin");
|
||||||
if (incomplete(status)==0) /* cannot try to add lines? */
|
if (incomplete(status)==0) /* cannot try to add lines? */
|
||||||
{
|
{
|
||||||
if (status == LUA_OK) status = docall(0, LUA_MULTRET);
|
if (status == LUA_OK) status = docall(0, LUA_MULTRET);
|
||||||
|
@ -592,7 +592,7 @@ astring running_machine::get_statename(const char *option)
|
|||||||
// copy the device name to an astring
|
// copy the device name to an astring
|
||||||
astring devname_str;
|
astring devname_str;
|
||||||
devname_str.cpysubstr(statename_str, pos + 3, end - pos - 3);
|
devname_str.cpysubstr(statename_str, pos + 3, end - pos - 3);
|
||||||
//printf("check template: %s\n", devname_str.cstr());
|
//printf("check template: %s\n", devname_str.c_str());
|
||||||
|
|
||||||
// verify that there is such a device for this system
|
// verify that there is such a device for this system
|
||||||
image_interface_iterator iter(root_device());
|
image_interface_iterator iter(root_device());
|
||||||
@ -600,7 +600,7 @@ astring running_machine::get_statename(const char *option)
|
|||||||
{
|
{
|
||||||
// get the device name
|
// get the device name
|
||||||
astring tempdevname(image->brief_instance_name());
|
astring tempdevname(image->brief_instance_name());
|
||||||
//printf("check device: %s\n", tempdevname.cstr());
|
//printf("check device: %s\n", tempdevname.c_str());
|
||||||
|
|
||||||
if (devname_str.cmp(tempdevname) == 0)
|
if (devname_str.cmp(tempdevname) == 0)
|
||||||
{
|
{
|
||||||
@ -612,7 +612,7 @@ astring running_machine::get_statename(const char *option)
|
|||||||
// setup snapname and remove the %d_
|
// setup snapname and remove the %d_
|
||||||
statename_str.replace(0, devname_str, filename);
|
statename_str.replace(0, devname_str, filename);
|
||||||
statename_str.del(pos, 3);
|
statename_str.del(pos, 3);
|
||||||
//printf("check image: %s\n", filename.cstr());
|
//printf("check image: %s\n", filename.c_str());
|
||||||
|
|
||||||
name_found = 1;
|
name_found = 1;
|
||||||
}
|
}
|
||||||
@ -651,7 +651,7 @@ void running_machine::set_saveload_filename(const char *filename)
|
|||||||
// take into account the statename option
|
// take into account the statename option
|
||||||
const char *stateopt = options().state_name();
|
const char *stateopt = options().state_name();
|
||||||
astring statename = get_statename(stateopt);
|
astring statename = get_statename(stateopt);
|
||||||
m_saveload_pending_file.cpy(statename.cstr()).cat(PATH_SEPARATOR).cat(filename).cat(".sta");
|
m_saveload_pending_file.cpy(statename.c_str()).cat(PATH_SEPARATOR).cat(filename).cat(".sta");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const att
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(!edge.is_never())
|
if(!edge.is_never())
|
||||||
fprintf(stderr, "ctime=%s, transition_time=%s, next=%s, pha=%s\n", tts(ctime).cstr(), tts(edge).cstr(), tts(next).cstr(), tts(phase_adjust).cstr());
|
fprintf(stderr, "ctime=%s, transition_time=%s, next=%s, pha=%s\n", tts(ctime).c_str(), tts(edge).c_str(), tts(next).c_str(), tts(phase_adjust).c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(next > limit)
|
if(next > limit)
|
||||||
|
@ -572,7 +572,7 @@ void hdc9234_device::wait_time(emu_timer *tm, int microsec, int next_substate)
|
|||||||
|
|
||||||
void hdc9234_device::wait_time(emu_timer *tm, const attotime &delay, int param)
|
void hdc9234_device::wait_time(emu_timer *tm, const attotime &delay, int param)
|
||||||
{
|
{
|
||||||
if (TRACE_DELAY) logerror("%s: [%s] Delaying by %4.2f microsecs\n", tag(), ttsn().cstr(), delay.as_double()*1000000);
|
if (TRACE_DELAY) logerror("%s: [%s] Delaying by %4.2f microsecs\n", tag(), ttsn().c_str(), delay.as_double()*1000000);
|
||||||
tm->adjust(delay);
|
tm->adjust(delay);
|
||||||
m_substate = param;
|
m_substate = param;
|
||||||
}
|
}
|
||||||
@ -1784,7 +1784,7 @@ astring hdc9234_device::ttsn()
|
|||||||
*/
|
*/
|
||||||
void hdc9234_device::live_start(int state)
|
void hdc9234_device::live_start(int state)
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().cstr(), state);
|
if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().c_str(), state);
|
||||||
m_live_state.time = machine().time();
|
m_live_state.time = machine().time();
|
||||||
m_live_state.state = state;
|
m_live_state.state = state;
|
||||||
m_live_state.next_state = -1;
|
m_live_state.next_state = -1;
|
||||||
@ -1828,9 +1828,9 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
if (TRACE_LIVE)
|
if (TRACE_LIVE)
|
||||||
{
|
{
|
||||||
if (limit == attotime::never)
|
if (limit == attotime::never)
|
||||||
logerror("%s: [%s] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).cstr(), m_live_state.state, fm_mode()? "FM":"MFM");
|
logerror("%s: [%s] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
|
||||||
else
|
else
|
||||||
logerror("%s: [%s] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).cstr(), tts(limit).cstr(), m_live_state.state, fm_mode()? "FM":"MFM");
|
logerror("%s: [%s] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit == attotime::never)
|
if (limit == attotime::never)
|
||||||
@ -1862,7 +1862,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
|
|
||||||
if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM)
|
if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).cstr(), tts(limit).cstr());
|
logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1871,11 +1871,11 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
|
|
||||||
if (read_one_bit(limit))
|
if (read_one_bit(limit))
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).cstr());
|
// logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).c_str());
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
|
||||||
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
||||||
|
|
||||||
// [1] p. 9: The ID field sync mark must be found within 33,792 byte times
|
// [1] p. 9: The ID field sync mark must be found within 33,792 byte times
|
||||||
@ -1890,7 +1890,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
// MFM case
|
// MFM case
|
||||||
if (m_live_state.shift_reg == 0x4489)
|
if (m_live_state.shift_reg == 0x4489)
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_live_state.crc = 0x443b;
|
m_live_state.crc = 0x443b;
|
||||||
m_live_state.data_separator_phase = false;
|
m_live_state.data_separator_phase = false;
|
||||||
m_live_state.bit_counter = 0;
|
m_live_state.bit_counter = 0;
|
||||||
@ -1921,14 +1921,14 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
|
|
||||||
if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_IDAM)
|
if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_IDAM)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).cstr());
|
logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Beyond time limit?
|
// Beyond time limit?
|
||||||
if (read_one_bit(limit)) return;
|
if (read_one_bit(limit)) return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
|
||||||
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
||||||
|
|
||||||
if (m_live_state.bit_count_total > 33792*16)
|
if (m_live_state.bit_count_total > 33792*16)
|
||||||
@ -1950,12 +1950,12 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
m_live_state.state = SEARCH_IDAM;
|
m_live_state.state = SEARCH_IDAM;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
|
||||||
// Continue
|
// Continue
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg);
|
if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
|
||||||
|
|
||||||
// Check for ident field (fe, ff, fd, fc)
|
// Check for ident field (fe, ff, fd, fc)
|
||||||
if ((m_live_state.data_reg & 0xfc) != 0xfc)
|
if ((m_live_state.data_reg & 0xfc) != 0xfc)
|
||||||
@ -1976,7 +1976,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
case READ_ID_FIELDS_INTO_REGS:
|
case READ_ID_FIELDS_INTO_REGS:
|
||||||
if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS)
|
if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).cstr());
|
logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2017,7 +2017,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
case SEARCH_DAM:
|
case SEARCH_DAM:
|
||||||
if (TRACE_LIVE && m_last_live_state != SEARCH_DAM)
|
if (TRACE_LIVE && m_last_live_state != SEARCH_DAM)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).cstr());
|
logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2026,7 +2026,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
|
||||||
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
||||||
|
|
||||||
if (!fm_mode())
|
if (!fm_mode())
|
||||||
@ -2040,7 +2040,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
|
|
||||||
if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489)
|
if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489)
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_live_state.crc = 0x443b;
|
m_live_state.crc = 0x443b;
|
||||||
m_live_state.data_separator_phase = false;
|
m_live_state.data_separator_phase = false;
|
||||||
m_live_state.bit_counter = 0;
|
m_live_state.bit_counter = 0;
|
||||||
@ -2074,14 +2074,14 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
case READ_TWO_MORE_A1_DAM: {
|
case READ_TWO_MORE_A1_DAM: {
|
||||||
if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_DAM)
|
if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_DAM)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).cstr());
|
logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
|
||||||
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
|
||||||
|
|
||||||
// Repeat until we have collected 16 bits
|
// Repeat until we have collected 16 bits
|
||||||
@ -2098,12 +2098,12 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
|
||||||
// Continue
|
// Continue
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg);
|
if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
|
||||||
|
|
||||||
if ((m_live_state.data_reg & 0xff) == 0xf8)
|
if ((m_live_state.data_reg & 0xff) == 0xf8)
|
||||||
{
|
{
|
||||||
@ -2133,7 +2133,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
{
|
{
|
||||||
if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA)
|
if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).cstr());
|
logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2158,7 +2158,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
// Repeat until we have collected 16 bits
|
// Repeat until we have collected 16 bits
|
||||||
if (m_live_state.bit_counter & 15) break;
|
if (m_live_state.bit_counter & 15) break;
|
||||||
|
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg, m_live_state.crc);
|
if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc);
|
||||||
int slot = (m_live_state.bit_counter >> 4)-1;
|
int slot = (m_live_state.bit_counter >> 4)-1;
|
||||||
|
|
||||||
if (slot < calc_sector_size())
|
if (slot < calc_sector_size())
|
||||||
@ -2179,7 +2179,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).c_str());
|
||||||
wait_for_realtime(IDLE);
|
wait_for_realtime(IDLE);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -2191,7 +2191,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
case READ_SECTOR_DATA1:
|
case READ_SECTOR_DATA1:
|
||||||
if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA1)
|
if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA1)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).cstr());
|
logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).c_str());
|
||||||
m_last_live_state = m_live_state.state;
|
m_last_live_state = m_live_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2237,7 +2237,7 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
// 5. Write the CRC bytes
|
// 5. Write the CRC bytes
|
||||||
|
|
||||||
if (TRACE_LIVE)
|
if (TRACE_LIVE)
|
||||||
logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).cstr());
|
logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str());
|
||||||
|
|
||||||
skip_on_track(m_gap2_size, WRITE_DAM_SYNC);
|
skip_on_track(m_gap2_size, WRITE_DAM_SYNC);
|
||||||
break;
|
break;
|
||||||
@ -2554,14 +2554,14 @@ void hdc9234_device::live_run_until(attotime limit)
|
|||||||
// The pause is implemented by doing dummy reads on the floppy
|
// The pause is implemented by doing dummy reads on the floppy
|
||||||
if (read_one_bit(limit))
|
if (read_one_bit(limit))
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).cstr(), tts(limit).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repeat until we have collected 16 bits
|
// Repeat until we have collected 16 bits
|
||||||
if ((m_live_state.bit_counter & 15)==0)
|
if ((m_live_state.bit_counter & 15)==0)
|
||||||
{
|
{
|
||||||
if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).cstr(), m_live_state.data_reg, m_live_state.repeat);
|
if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat);
|
||||||
wait_for_realtime(READ_TRACK_NEXT_BYTE);
|
wait_for_realtime(READ_TRACK_NEXT_BYTE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2636,7 +2636,7 @@ void hdc9234_device::live_sync()
|
|||||||
if(m_live_state.time > machine().time())
|
if(m_live_state.time > machine().time())
|
||||||
{
|
{
|
||||||
// If so, we must roll back to the last checkpoint
|
// If so, we must roll back to the last checkpoint
|
||||||
if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().cstr(), tts(m_live_state.time).cstr());
|
if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
|
||||||
rollback();
|
rollback();
|
||||||
// and replay until we reach the machine time
|
// and replay until we reach the machine time
|
||||||
live_run_until(machine().time());
|
live_run_until(machine().time());
|
||||||
@ -2647,7 +2647,7 @@ void hdc9234_device::live_sync()
|
|||||||
{
|
{
|
||||||
// We are behind machine time, so we will never get back to that
|
// We are behind machine time, so we will never get back to that
|
||||||
// time, thus we can commit that position
|
// time, thus we can commit that position
|
||||||
if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().cstr(), tts(m_live_state.time).cstr());
|
if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
|
||||||
// Write on floppy image
|
// Write on floppy image
|
||||||
m_pll.commit(m_floppy, m_live_state.time);
|
m_pll.commit(m_floppy, m_live_state.time);
|
||||||
|
|
||||||
@ -2672,7 +2672,7 @@ void hdc9234_device::live_abort()
|
|||||||
{
|
{
|
||||||
if (!m_live_state.time.is_never() && m_live_state.time > machine().time())
|
if (!m_live_state.time.is_never() && m_live_state.time > machine().time())
|
||||||
{
|
{
|
||||||
if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().cstr(), tts(m_live_state.time).cstr());
|
if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().c_str(), tts(m_live_state.time).c_str());
|
||||||
rollback();
|
rollback();
|
||||||
live_run_until(machine().time());
|
live_run_until(machine().time());
|
||||||
}
|
}
|
||||||
@ -2735,7 +2735,7 @@ void hdc9234_device::wait_for_realtime(int state)
|
|||||||
{
|
{
|
||||||
m_live_state.next_state = state;
|
m_live_state.next_state = state;
|
||||||
m_timer->adjust(m_live_state.time - machine().time());
|
m_timer->adjust(m_live_state.time - machine().time());
|
||||||
if (TRACE_LIVE) logerror("%s: [%s] Waiting for real time [%s] to catch up\n", tag(), tts(m_live_state.time).cstr(), tts(machine().time()).cstr());
|
if (TRACE_LIVE) logerror("%s: [%s] Waiting for real time [%s] to catch up\n", tag(), tts(m_live_state.time).c_str(), tts(machine().time()).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2858,7 +2858,7 @@ void hdc9234_device::encode_byte(UINT8 byte)
|
|||||||
m_live_state.bit_counter = 16;
|
m_live_state.bit_counter = 16;
|
||||||
m_live_state.last_data_bit = raw & 1;
|
m_live_state.last_data_bit = raw & 1;
|
||||||
m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
|
m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
|
||||||
if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).cstr(), byte, raw);
|
if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), byte, raw);
|
||||||
checkpoint();
|
checkpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2872,7 +2872,7 @@ void hdc9234_device::encode_raw(UINT16 raw)
|
|||||||
m_live_state.bit_counter = 16;
|
m_live_state.bit_counter = 16;
|
||||||
m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
|
m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
|
||||||
m_live_state.last_data_bit = raw & 1;
|
m_live_state.last_data_bit = raw & 1;
|
||||||
if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).cstr(), get_data_from_encoding(raw), raw);
|
if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), get_data_from_encoding(raw), raw);
|
||||||
checkpoint();
|
checkpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2960,7 +2960,7 @@ WRITE8_MEMBER( hdc9234_device::write )
|
|||||||
{
|
{
|
||||||
if (m_executing)
|
if (m_executing)
|
||||||
{
|
{
|
||||||
logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().cstr(), current_command(), data);
|
logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().c_str(), current_command(), data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3169,7 +3169,7 @@ void hdc9234_device::auxbus_in(UINT8 data)
|
|||||||
|
|
||||||
void hdc9234_device::index_callback(int level)
|
void hdc9234_device::index_callback(int level)
|
||||||
{
|
{
|
||||||
if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().cstr(), level);
|
if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().c_str(), level);
|
||||||
|
|
||||||
// Synchronize our position on the track
|
// Synchronize our position on the track
|
||||||
live_sync();
|
live_sync();
|
||||||
@ -3182,7 +3182,7 @@ void hdc9234_device::index_callback(int level)
|
|||||||
|
|
||||||
if (m_event_line == INDEX_LINE && level == m_line_level && m_state_after_line != UNDEF)
|
if (m_event_line == INDEX_LINE && level == m_line_level && m_state_after_line != UNDEF)
|
||||||
{
|
{
|
||||||
if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().cstr(), level);
|
if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().c_str(), level);
|
||||||
m_substate = m_state_after_line;
|
m_substate = m_state_after_line;
|
||||||
m_state_after_line = UNDEF;
|
m_state_after_line = UNDEF;
|
||||||
if (m_stopwrite)
|
if (m_stopwrite)
|
||||||
@ -3197,7 +3197,7 @@ void hdc9234_device::index_callback(int level)
|
|||||||
|
|
||||||
void hdc9234_device::ready_callback(int level)
|
void hdc9234_device::ready_callback(int level)
|
||||||
{
|
{
|
||||||
if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().cstr(), level);
|
if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().c_str(), level);
|
||||||
|
|
||||||
// Set the interrupt status flag
|
// Set the interrupt status flag
|
||||||
set_bits(m_register_r[INT_STATUS], ST_RDYCHNG, true);
|
set_bits(m_register_r[INT_STATUS], ST_RDYCHNG, true);
|
||||||
@ -3222,7 +3222,7 @@ void hdc9234_device::ready_callback(int level)
|
|||||||
|
|
||||||
void hdc9234_device::seek_complete_callback(int level)
|
void hdc9234_device::seek_complete_callback(int level)
|
||||||
{
|
{
|
||||||
if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().cstr(), level);
|
if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().c_str(), level);
|
||||||
|
|
||||||
// Synchronize our position on the track
|
// Synchronize our position on the track
|
||||||
live_sync();
|
live_sync();
|
||||||
@ -3323,7 +3323,7 @@ WRITE_LINE_MEMBER( hdc9234_device::dmaack )
|
|||||||
{
|
{
|
||||||
if (state==ASSERT_LINE)
|
if (state==ASSERT_LINE)
|
||||||
{
|
{
|
||||||
if (TRACE_DMA) logerror("%s: [%s] DMA acknowledged\n", tag(), ttsn().cstr());
|
if (TRACE_DMA) logerror("%s: [%s] DMA acknowledged\n", tag(), ttsn().c_str());
|
||||||
set_bits(m_register_r[INT_STATUS], ST_OVRUN, false);
|
set_bits(m_register_r[INT_STATUS], ST_OVRUN, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ void ram_device::device_validity_check(validity_checker &valid) const
|
|||||||
else
|
else
|
||||||
output.catprintf(").\n");
|
output.catprintf(").\n");
|
||||||
|
|
||||||
osd_printf_error("%s", output.cstr());
|
osd_printf_error("%s", output.c_str());
|
||||||
|
|
||||||
osd_printf_warning("Setting value to default %s\n",m_default_size);
|
osd_printf_warning("Setting value to default %s\n",m_default_size);
|
||||||
astring error;
|
astring error;
|
||||||
|
@ -676,7 +676,7 @@ void upd765_family_device::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
fprintf(stderr, "%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -707,7 +707,7 @@ void upd765_family_device::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -747,7 +747,7 @@ void upd765_family_device::live_run(attotime limit)
|
|||||||
int slot = (cur_live.bit_counter >> 4)-1;
|
int slot = (cur_live.bit_counter >> 4)-1;
|
||||||
|
|
||||||
if(0)
|
if(0)
|
||||||
fprintf(stderr, "%s: slot=%d data=%02x crc=%04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc);
|
fprintf(stderr, "%s: slot=%d data=%02x crc=%04x\n", tts(cur_live.tm).c_str(), slot, cur_live.data_reg, cur_live.crc);
|
||||||
cur_live.idbuf[slot] = cur_live.data_reg;
|
cur_live.idbuf[slot] = cur_live.data_reg;
|
||||||
if(slot == 5) {
|
if(slot == 5) {
|
||||||
live_delay(IDLE);
|
live_delay(IDLE);
|
||||||
@ -760,7 +760,7 @@ void upd765_family_device::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
fprintf(stderr, "%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -806,7 +806,7 @@ void upd765_family_device::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -1117,7 +1117,7 @@ void upd765_family_device::live_run(attotime limit)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: Unknown live state %d\n", tts(cur_live.tm).cstr(), cur_live.state);
|
logerror("%s: Unknown live state %d\n", tts(cur_live.tm).c_str(), cur_live.state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1711,7 +1711,7 @@ void upd765_family_device::read_data_continue(floppy_info &fi)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: read sector unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
|
logerror("%s: read sector unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1837,7 +1837,7 @@ void upd765_family_device::write_data_continue(floppy_info &fi)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: write sector unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
|
logerror("%s: write sector unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2007,7 +2007,7 @@ void upd765_family_device::read_track_continue(floppy_info &fi)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: read track unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
|
logerror("%s: read track unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2080,7 +2080,7 @@ void upd765_family_device::format_track_continue(floppy_info &fi)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: format track unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
|
logerror("%s: format track unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2159,7 +2159,7 @@ void upd765_family_device::read_id_continue(floppy_info &fi)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: read id unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
|
logerror("%s: read id unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2287,7 +2287,7 @@ void upd765_family_device::index_callback(floppy_image_device *floppy, int state
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
|
logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2335,7 +2335,7 @@ void upd765_family_device::general_continue(floppy_info &fi)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: general_continue on unknown main-state %d\n", ttsn().cstr(), fi.main_state);
|
logerror("%s: general_continue on unknown main-state %d\n", ttsn().c_str(), fi.main_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ void wd_fdc_t::seek_continue()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: seek unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: seek unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -505,7 +505,7 @@ void wd_fdc_t::read_sector_continue()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: read sector unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: read sector unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -584,7 +584,7 @@ void wd_fdc_t::read_track_continue()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: read track unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: read track unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -659,7 +659,7 @@ void wd_fdc_t::read_id_continue()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: read id unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: read id unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -763,12 +763,12 @@ void wd_fdc_t::write_track_continue()
|
|||||||
sprintf(buf, "%02x", format_last_byte);
|
sprintf(buf, "%02x", format_last_byte);
|
||||||
format_description_string += buf;
|
format_description_string += buf;
|
||||||
}
|
}
|
||||||
if (TRACE_DESC) logerror("%s: track description %s\n", tag(), format_description_string.cstr());
|
if (TRACE_DESC) logerror("%s: track description %s\n", tag(), format_description_string.c_str());
|
||||||
command_end();
|
command_end();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: write track unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: write track unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -867,7 +867,7 @@ void wd_fdc_t::write_sector_continue()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: write sector unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: write sector unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -898,7 +898,7 @@ void wd_fdc_t::interrupt_start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(command & 0x03) {
|
if(command & 0x03) {
|
||||||
logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().cstr(), command);
|
logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().c_str(), command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -932,7 +932,7 @@ void wd_fdc_t::general_continue()
|
|||||||
write_sector_continue();
|
write_sector_continue();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logerror("%s: general_continue on unknown main-state %d\n", ttsn().cstr(), main_state);
|
logerror("%s: general_continue on unknown main-state %d\n", ttsn().c_str(), main_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -963,7 +963,7 @@ void wd_fdc_t::do_generic()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if(cur_live.tm.is_never())
|
if(cur_live.tm.is_never())
|
||||||
logerror("%s: do_generic on unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: do_generic on unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1285,7 +1285,7 @@ void wd_fdc_t::index_callback(floppy_image_device *floppy, int state)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().cstr(), sub_state);
|
logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().c_str(), sub_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1360,12 +1360,12 @@ void wd_fdc_t::live_sync()
|
|||||||
{
|
{
|
||||||
if(!cur_live.tm.is_never()) {
|
if(!cur_live.tm.is_never()) {
|
||||||
if(cur_live.tm > machine().time()) {
|
if(cur_live.tm > machine().time()) {
|
||||||
if (TRACE_SYNC) logerror("%s: Rolling back and replaying (%s)\n", ttsn().cstr(), tts(cur_live.tm).cstr());
|
if (TRACE_SYNC) logerror("%s: Rolling back and replaying (%s)\n", ttsn().c_str(), tts(cur_live.tm).c_str());
|
||||||
rollback();
|
rollback();
|
||||||
live_run(machine().time());
|
live_run(machine().time());
|
||||||
pll_commit(floppy, cur_live.tm);
|
pll_commit(floppy, cur_live.tm);
|
||||||
} else {
|
} else {
|
||||||
if (TRACE_SYNC) logerror("%s: Committing (%s)\n", ttsn().cstr(), tts(cur_live.tm).cstr());
|
if (TRACE_SYNC) logerror("%s: Committing (%s)\n", ttsn().c_str(), tts(cur_live.tm).c_str());
|
||||||
pll_commit(floppy, cur_live.tm);
|
pll_commit(floppy, cur_live.tm);
|
||||||
if(cur_live.next_state != -1) {
|
if(cur_live.next_state != -1) {
|
||||||
cur_live.state = cur_live.next_state;
|
cur_live.state = cur_live.next_state;
|
||||||
@ -1485,7 +1485,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fprintf(stderr, "%s: live_run(%s)\n", ttsn().cstr(), tts(limit).cstr());
|
// fprintf(stderr, "%s: live_run(%s)\n", ttsn().c_str(), tts(limit).c_str());
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
switch(cur_live.state) {
|
switch(cur_live.state) {
|
||||||
@ -1493,7 +1493,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -1526,7 +1526,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -1568,7 +1568,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
if(cur_live.bit_counter & 15)
|
if(cur_live.bit_counter & 15)
|
||||||
break;
|
break;
|
||||||
int slot = (cur_live.bit_counter >> 4)-1;
|
int slot = (cur_live.bit_counter >> 4)-1;
|
||||||
// fprintf(stderr, "%s: slot[%d] = %02x crc = %04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc);
|
// fprintf(stderr, "%s: slot[%d] = %02x crc = %04x\n", tts(cur_live.tm).c_str(), slot, cur_live.data_reg, cur_live.crc);
|
||||||
cur_live.idbuf[slot] = cur_live.data_reg;
|
cur_live.idbuf[slot] = cur_live.data_reg;
|
||||||
if(slot == 5) {
|
if(slot == 5) {
|
||||||
live_delay(IDLE);
|
live_delay(IDLE);
|
||||||
@ -1609,7 +1609,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -1656,7 +1656,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
if(read_one_bit(limit))
|
if(read_one_bit(limit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
|
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
|
||||||
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
(cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
(cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
|
||||||
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
|
||||||
@ -1954,7 +1954,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: Unknown sub state %d in WRITE_BYTE_DONE\n", tts(cur_live.tm).cstr(), sub_state);
|
logerror("%s: Unknown sub state %d in WRITE_BYTE_DONE\n", tts(cur_live.tm).c_str(), sub_state);
|
||||||
live_abort();
|
live_abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2017,7 +2017,7 @@ void wd_fdc_t::live_run(attotime limit)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("%s: Unknown live state %d\n", tts(cur_live.tm).cstr(), cur_live.state);
|
logerror("%s: Unknown live state %d\n", tts(cur_live.tm).c_str(), cur_live.state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2186,12 +2186,12 @@ int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_dev
|
|||||||
|
|
||||||
/* if (TRACE_TRANSITION)
|
/* if (TRACE_TRANSITION)
|
||||||
if(!when.is_never())
|
if(!when.is_never())
|
||||||
logerror("transition_time=%s\n", tts(when).cstr());
|
logerror("transition_time=%s\n", tts(when).c_str());
|
||||||
*/
|
*/
|
||||||
for(;;) {
|
for(;;) {
|
||||||
// if (TRACE_TRANSITION) logerror("slot=%2d, counter=%03x\n", slot, counter);
|
// if (TRACE_TRANSITION) logerror("slot=%2d, counter=%03x\n", slot, counter);
|
||||||
attotime etime = ctime+delays[slot];
|
attotime etime = ctime+delays[slot];
|
||||||
// if (TRACE_TRANSITION) logerror("etime=%s\n", tts(etime).cstr());
|
// if (TRACE_TRANSITION) logerror("etime=%s\n", tts(etime).c_str());
|
||||||
if(etime > limit)
|
if(etime > limit)
|
||||||
return -1;
|
return -1;
|
||||||
if(transition_time == 0xffff && !when.is_never() && etime >= when)
|
if(transition_time == 0xffff && !when.is_never() && etime >= when)
|
||||||
|
@ -285,15 +285,15 @@ void CLIB_DECL popmessage(const char *format, ...)
|
|||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
// pop it in the UI
|
// pop it in the UI
|
||||||
machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.cstr());
|
machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.c_str());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// also write to error.log
|
// also write to error.log
|
||||||
logerror("popmessage: %s\n", temp.cstr());
|
logerror("popmessage: %s\n", temp.c_str());
|
||||||
|
|
||||||
#ifdef MAME_DEBUG
|
#ifdef MAME_DEBUG
|
||||||
// and to command-line in a DEBUG build
|
// and to command-line in a DEBUG build
|
||||||
osd_printf_info("popmessage: %s\n", temp.cstr());
|
osd_printf_info("popmessage: %s\n", temp.c_str());
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ device_t *machine_config::device_add(device_t *owner, const char *tag, device_ty
|
|||||||
break;
|
break;
|
||||||
if (!curdevice)
|
if (!curdevice)
|
||||||
throw emu_fatalerror("Could not find %s when looking up path for device %s\n",
|
throw emu_fatalerror("Could not find %s when looking up path for device %s\n",
|
||||||
part.cstr(), orig_tag);
|
part.c_str(), orig_tag);
|
||||||
owner = curdevice;
|
owner = curdevice;
|
||||||
tag = next+1;
|
tag = next+1;
|
||||||
}
|
}
|
||||||
|
@ -1836,9 +1836,9 @@ void address_space::prepare_map()
|
|||||||
{
|
{
|
||||||
// if we can't find it, add it to our map
|
// if we can't find it, add it to our map
|
||||||
astring fulltag;
|
astring fulltag;
|
||||||
if (manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr()) == NULL)
|
if (manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str()) == NULL)
|
||||||
{
|
{
|
||||||
VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.cstr(), entry->m_byteend + 1 - entry->m_bytestart));
|
VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.c_str(), entry->m_byteend + 1 - entry->m_bytestart));
|
||||||
memory_share *share = global_alloc(memory_share(m_map->m_databits, entry->m_byteend + 1 - entry->m_bytestart, endianness()));
|
memory_share *share = global_alloc(memory_share(m_map->m_databits, entry->m_byteend + 1 - entry->m_bytestart, endianness()));
|
||||||
manager().m_sharelist.append(fulltag, *share);
|
manager().m_sharelist.append(fulltag, *share);
|
||||||
}
|
}
|
||||||
@ -1880,7 +1880,7 @@ void address_space::prepare_map()
|
|||||||
entry->m_devbase.subtag(fulltag, entry->m_region);
|
entry->m_devbase.subtag(fulltag, entry->m_region);
|
||||||
|
|
||||||
// set the memory address
|
// set the memory address
|
||||||
entry->m_memory = machine().root_device().memregion(fulltag.cstr())->base() + entry->m_rgnoffs;
|
entry->m_memory = machine().root_device().memregion(fulltag.c_str())->base() + entry->m_rgnoffs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2154,7 +2154,7 @@ address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, of
|
|||||||
if (entry->m_memory == NULL && entry->m_share != NULL)
|
if (entry->m_memory == NULL && entry->m_share != NULL)
|
||||||
{
|
{
|
||||||
astring fulltag;
|
astring fulltag;
|
||||||
memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr());
|
memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str());
|
||||||
if (share != NULL && share->ptr() != NULL)
|
if (share != NULL && share->ptr() != NULL)
|
||||||
{
|
{
|
||||||
entry->m_memory = share->ptr();
|
entry->m_memory = share->ptr();
|
||||||
@ -2177,7 +2177,7 @@ address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, of
|
|||||||
if (entry->m_memory != NULL && entry->m_share != NULL)
|
if (entry->m_memory != NULL && entry->m_share != NULL)
|
||||||
{
|
{
|
||||||
astring fulltag;
|
astring fulltag;
|
||||||
memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr());
|
memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str());
|
||||||
if (share != NULL && share->ptr() == NULL)
|
if (share != NULL && share->ptr() == NULL)
|
||||||
{
|
{
|
||||||
share->set_ptr(entry->m_memory);
|
share->set_ptr(entry->m_memory);
|
||||||
@ -2613,7 +2613,7 @@ bool address_space::needs_backing_store(const address_map_entry *entry)
|
|||||||
if (entry->m_share != NULL)
|
if (entry->m_share != NULL)
|
||||||
{
|
{
|
||||||
astring fulltag;
|
astring fulltag;
|
||||||
memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr());
|
memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str());
|
||||||
if (share != NULL && share->ptr() == NULL)
|
if (share != NULL && share->ptr() == NULL)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -4022,7 +4022,7 @@ void memory_bank::set_entry(int entrynum)
|
|||||||
if (entrynum < 0 || entrynum >= m_entry.count())
|
if (entrynum < 0 || entrynum >= m_entry.count())
|
||||||
throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
|
throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
|
||||||
if (m_entry[entrynum].m_raw == NULL)
|
if (m_entry[entrynum].m_raw == NULL)
|
||||||
throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.cstr(), entrynum);
|
throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.c_str(), entrynum);
|
||||||
|
|
||||||
// set both raw and decrypted values
|
// set both raw and decrypted values
|
||||||
m_curentry = entrynum;
|
m_curentry = entrynum;
|
||||||
|
@ -1328,9 +1328,9 @@ void layout_element::component::load_bitmap()
|
|||||||
|
|
||||||
// log an error
|
// log an error
|
||||||
if (!m_alphafile[0])
|
if (!m_alphafile[0])
|
||||||
osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].cstr());
|
osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].c_str());
|
||||||
else
|
else
|
||||||
osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].cstr(), m_alphafile[0].cstr());
|
osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].c_str(), m_alphafile[0].c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,13 +441,13 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp,
|
|||||||
|
|
||||||
bool is_chd_error = (is_chd && chderr != CHDERR_FILE_NOT_FOUND);
|
bool is_chd_error = (is_chd && chderr != CHDERR_FILE_NOT_FOUND);
|
||||||
if (is_chd_error)
|
if (is_chd_error)
|
||||||
romdata->errorstring.catprintf("%s CHD ERROR: %s\n", name.cstr(), chd_file::error_string(chderr));
|
romdata->errorstring.catprintf("%s CHD ERROR: %s\n", name.c_str(), chd_file::error_string(chderr));
|
||||||
|
|
||||||
/* optional files are okay */
|
/* optional files are okay */
|
||||||
if (ROM_ISOPTIONAL(romp))
|
if (ROM_ISOPTIONAL(romp))
|
||||||
{
|
{
|
||||||
if (!is_chd_error)
|
if (!is_chd_error)
|
||||||
romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", name.cstr(), tried_file_names.cstr());
|
romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", name.c_str(), tried_file_names.c_str());
|
||||||
romdata->warnings++;
|
romdata->warnings++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,7 +455,7 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp,
|
|||||||
else if (hash_collection(ROM_GETHASHDATA(romp)).flag(hash_collection::FLAG_NO_DUMP))
|
else if (hash_collection(ROM_GETHASHDATA(romp)).flag(hash_collection::FLAG_NO_DUMP))
|
||||||
{
|
{
|
||||||
if (!is_chd_error)
|
if (!is_chd_error)
|
||||||
romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name.cstr(), tried_file_names.cstr());
|
romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name.c_str(), tried_file_names.c_str());
|
||||||
romdata->knownbad++;
|
romdata->knownbad++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!is_chd_error)
|
if (!is_chd_error)
|
||||||
romdata->errorstring.catprintf("%s NOT FOUND%s\n", name.cstr(), tried_file_names.cstr());
|
romdata->errorstring.catprintf("%s NOT FOUND%s\n", name.c_str(), tried_file_names.c_str());
|
||||||
romdata->errors++;
|
romdata->errors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -560,7 +560,7 @@ static void display_rom_load_results(romload_private *romdata, bool from_list)
|
|||||||
if (romdata->errors != 0)
|
if (romdata->errors != 0)
|
||||||
{
|
{
|
||||||
/* create the error message and exit fatally */
|
/* create the error message and exit fatally */
|
||||||
osd_printf_error("%s", romdata->errorstring.cstr());
|
osd_printf_error("%s", romdata->errorstring.c_str());
|
||||||
fatalerror_exitcode(romdata->machine(), MAMERR_MISSING_FILES, "Required files are missing, the %s cannot be run.",emulator_info::get_gamenoun());
|
fatalerror_exitcode(romdata->machine(), MAMERR_MISSING_FILES, "Required files are missing, the %s cannot be run.",emulator_info::get_gamenoun());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,7 +570,7 @@ static void display_rom_load_results(romload_private *romdata, bool from_list)
|
|||||||
romdata->errorstring.cat("WARNING: the ");
|
romdata->errorstring.cat("WARNING: the ");
|
||||||
romdata->errorstring.cat(emulator_info::get_gamenoun());
|
romdata->errorstring.cat(emulator_info::get_gamenoun());
|
||||||
romdata->errorstring.cat(" might not run correctly.");
|
romdata->errorstring.cat(" might not run correctly.");
|
||||||
osd_printf_warning("%s\n", romdata->errorstring.cstr());
|
osd_printf_warning("%s\n", romdata->errorstring.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -677,7 +677,7 @@ static int open_rom_file(romload_private *romdata, const char *regiontag, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prepare locations where we have to load from: list/parentname & list/clonename
|
// prepare locations where we have to load from: list/parentname & list/clonename
|
||||||
astring swlist(tag1.cstr());
|
astring swlist(tag1.c_str());
|
||||||
tag2.cpy(swlist.cat(tag4));
|
tag2.cpy(swlist.cat(tag4));
|
||||||
if (has_parent)
|
if (has_parent)
|
||||||
{
|
{
|
||||||
@ -695,33 +695,33 @@ static int open_rom_file(romload_private *romdata, const char *regiontag, const
|
|||||||
if (!is_list)
|
if (!is_list)
|
||||||
{
|
{
|
||||||
tried_file_names += " " + tag1;
|
tried_file_names += " " + tag1;
|
||||||
filerr = common_process_file(romdata->machine().options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
|
filerr = common_process_file(romdata->machine().options(), tag1.c_str(), has_crc, crc, romp, &romdata->file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// try to load from list/setname
|
// try to load from list/setname
|
||||||
if ((romdata->file == NULL) && (tag2.cstr() != NULL))
|
if ((romdata->file == NULL) && (tag2.c_str() != NULL))
|
||||||
{
|
{
|
||||||
tried_file_names += " " + tag2;
|
tried_file_names += " " + tag2;
|
||||||
filerr = common_process_file(romdata->machine().options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
|
filerr = common_process_file(romdata->machine().options(), tag2.c_str(), has_crc, crc, romp, &romdata->file);
|
||||||
}
|
}
|
||||||
// try to load from list/parentname
|
// try to load from list/parentname
|
||||||
if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL))
|
if ((romdata->file == NULL) && has_parent && (tag3.c_str() != NULL))
|
||||||
{
|
{
|
||||||
tried_file_names += " " + tag3;
|
tried_file_names += " " + tag3;
|
||||||
filerr = common_process_file(romdata->machine().options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
|
filerr = common_process_file(romdata->machine().options(), tag3.c_str(), has_crc, crc, romp, &romdata->file);
|
||||||
}
|
}
|
||||||
// try to load from setname
|
// try to load from setname
|
||||||
if ((romdata->file == NULL) && (tag4.cstr() != NULL))
|
if ((romdata->file == NULL) && (tag4.c_str() != NULL))
|
||||||
{
|
{
|
||||||
tried_file_names += " " + tag4;
|
tried_file_names += " " + tag4;
|
||||||
filerr = common_process_file(romdata->machine().options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
|
filerr = common_process_file(romdata->machine().options(), tag4.c_str(), has_crc, crc, romp, &romdata->file);
|
||||||
}
|
}
|
||||||
// try to load from parentname
|
// try to load from parentname
|
||||||
if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL))
|
if ((romdata->file == NULL) && has_parent && (tag5.c_str() != NULL))
|
||||||
{
|
{
|
||||||
tried_file_names += " " + tag5;
|
tried_file_names += " " + tag5;
|
||||||
filerr = common_process_file(romdata->machine().options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
|
filerr = common_process_file(romdata->machine().options(), tag5.c_str(), has_crc, crc, romp, &romdata->file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1078,7 +1078,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prepare locations where we have to load from: list/parentname (if any) & list/clonename
|
// prepare locations where we have to load from: list/parentname (if any) & list/clonename
|
||||||
astring swlist(tag1.cstr());
|
astring swlist(tag1.c_str());
|
||||||
tag2.cpy(swlist.cat(tag4));
|
tag2.cpy(swlist.cat(tag4));
|
||||||
if (has_parent)
|
if (has_parent)
|
||||||
{
|
{
|
||||||
@ -1098,22 +1098,22 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// try to load from list/setname
|
// try to load from list/setname
|
||||||
if ((filerr != FILERR_NONE) && (tag2.cstr() != NULL))
|
if ((filerr != FILERR_NONE) && (tag2.c_str() != NULL))
|
||||||
filerr = common_process_file(options, tag2.cstr(), ".chd", romp, image_file);
|
filerr = common_process_file(options, tag2.c_str(), ".chd", romp, image_file);
|
||||||
// try to load from list/parentname (if any)
|
// try to load from list/parentname (if any)
|
||||||
if ((filerr != FILERR_NONE) && has_parent && (tag3.cstr() != NULL))
|
if ((filerr != FILERR_NONE) && has_parent && (tag3.c_str() != NULL))
|
||||||
filerr = common_process_file(options, tag3.cstr(), ".chd", romp, image_file);
|
filerr = common_process_file(options, tag3.c_str(), ".chd", romp, image_file);
|
||||||
// try to load from setname
|
// try to load from setname
|
||||||
if ((filerr != FILERR_NONE) && (tag4.cstr() != NULL))
|
if ((filerr != FILERR_NONE) && (tag4.c_str() != NULL))
|
||||||
filerr = common_process_file(options, tag4.cstr(), ".chd", romp, image_file);
|
filerr = common_process_file(options, tag4.c_str(), ".chd", romp, image_file);
|
||||||
// try to load from parentname (if any)
|
// try to load from parentname (if any)
|
||||||
if ((filerr != FILERR_NONE) && has_parent && (tag5.cstr() != NULL))
|
if ((filerr != FILERR_NONE) && has_parent && (tag5.c_str() != NULL))
|
||||||
filerr = common_process_file(options, tag5.cstr(), ".chd", romp, image_file);
|
filerr = common_process_file(options, tag5.c_str(), ".chd", romp, image_file);
|
||||||
// only for CHD we also try to load from list/
|
// only for CHD we also try to load from list/
|
||||||
if ((filerr != FILERR_NONE) && (tag1.cstr() != NULL))
|
if ((filerr != FILERR_NONE) && (tag1.c_str() != NULL))
|
||||||
{
|
{
|
||||||
tag1.del(tag1.len() - 1, 1); // remove the PATH_SEPARATOR
|
tag1.del(tag1.len() - 1, 1); // remove the PATH_SEPARATOR
|
||||||
filerr = common_process_file(options, tag1.cstr(), ".chd", romp, image_file);
|
filerr = common_process_file(options, tag1.c_str(), ".chd", romp, image_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1182,7 +1182,7 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd
|
|||||||
astring fname(ROM_GETNAME(romp), ".dif");
|
astring fname(ROM_GETNAME(romp), ".dif");
|
||||||
|
|
||||||
/* try to open the diff */
|
/* try to open the diff */
|
||||||
LOG(("Opening differencing image file: %s\n", fname.cstr()));
|
LOG(("Opening differencing image file: %s\n", fname.c_str()));
|
||||||
emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
|
emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
|
||||||
file_error filerr = diff_file.open(fname);
|
file_error filerr = diff_file.open(fname);
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
@ -1190,12 +1190,12 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd
|
|||||||
astring fullpath(diff_file.fullpath());
|
astring fullpath(diff_file.fullpath());
|
||||||
diff_file.close();
|
diff_file.close();
|
||||||
|
|
||||||
LOG(("Opening differencing image file: %s\n", fullpath.cstr()));
|
LOG(("Opening differencing image file: %s\n", fullpath.c_str()));
|
||||||
return diff_chd.open(fullpath, true, &source);
|
return diff_chd.open(fullpath, true, &source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* didn't work; try creating it instead */
|
/* didn't work; try creating it instead */
|
||||||
LOG(("Creating differencing image: %s\n", fname.cstr()));
|
LOG(("Creating differencing image: %s\n", fname.c_str()));
|
||||||
diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
||||||
filerr = diff_file.open(fname);
|
filerr = diff_file.open(fname);
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
@ -1204,7 +1204,7 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd
|
|||||||
diff_file.close();
|
diff_file.close();
|
||||||
|
|
||||||
/* create the CHD */
|
/* create the CHD */
|
||||||
LOG(("Creating differencing image file: %s\n", fullpath.cstr()));
|
LOG(("Creating differencing image file: %s\n", fullpath.c_str()));
|
||||||
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
||||||
chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
|
chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
@ -1239,7 +1239,7 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag
|
|||||||
astring filename(ROM_GETNAME(romp), ".chd");
|
astring filename(ROM_GETNAME(romp), ".chd");
|
||||||
|
|
||||||
/* first open the source drive */
|
/* first open the source drive */
|
||||||
LOG(("Opening disk image: %s\n", filename.cstr()));
|
LOG(("Opening disk image: %s\n", filename.c_str()));
|
||||||
err = chd_error(open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, chd->orig_chd(), locationtag));
|
err = chd_error(open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, chd->orig_chd(), locationtag));
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
{
|
{
|
||||||
@ -1255,13 +1255,13 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag
|
|||||||
/* verify the hash */
|
/* verify the hash */
|
||||||
if (hashes != acthashes)
|
if (hashes != acthashes)
|
||||||
{
|
{
|
||||||
romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.cstr());
|
romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.c_str());
|
||||||
dump_wrong_and_correct_checksums(romdata, hashes, acthashes);
|
dump_wrong_and_correct_checksums(romdata, hashes, acthashes);
|
||||||
romdata->warnings++;
|
romdata->warnings++;
|
||||||
}
|
}
|
||||||
else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
|
else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
|
||||||
{
|
{
|
||||||
romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.cstr());
|
romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.c_str());
|
||||||
romdata->knownbad++;
|
romdata->knownbad++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1272,7 +1272,7 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag
|
|||||||
err = open_disk_diff(romdata->machine().options(), romp, chd->orig_chd(), chd->diff_chd());
|
err = open_disk_diff(romdata->machine().options(), romp, chd->orig_chd(), chd->diff_chd());
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
{
|
{
|
||||||
romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_file::error_string(err));
|
romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.c_str(), chd_file::error_string(err));
|
||||||
romdata->errors++;
|
romdata->errors++;
|
||||||
global_free(chd);
|
global_free(chd);
|
||||||
continue;
|
continue;
|
||||||
@ -1385,7 +1385,7 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c
|
|||||||
UINT32 regionlength = ROMREGION_GETLENGTH(region);
|
UINT32 regionlength = ROMREGION_GETLENGTH(region);
|
||||||
|
|
||||||
device.subtag(regiontag, ROMREGION_GETTAG(region));
|
device.subtag(regiontag, ROMREGION_GETTAG(region));
|
||||||
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
|
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength));
|
||||||
|
|
||||||
/* the first entry must be a region */
|
/* the first entry must be a region */
|
||||||
assert(ROMENTRY_ISREGION(region));
|
assert(ROMENTRY_ISREGION(region));
|
||||||
@ -1439,7 +1439,7 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c
|
|||||||
for (region = start_region; region != NULL; region = rom_next_region(region))
|
for (region = start_region; region != NULL; region = rom_next_region(region))
|
||||||
{
|
{
|
||||||
device.subtag(regiontag, ROMREGION_GETTAG(region));
|
device.subtag(regiontag, ROMREGION_GETTAG(region));
|
||||||
region_post_process(romdata, regiontag.cstr(), ROMREGION_ISINVERTED(region));
|
region_post_process(romdata, regiontag.c_str(), ROMREGION_ISINVERTED(region));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* display the results and exit */
|
/* display the results and exit */
|
||||||
@ -1463,7 +1463,7 @@ static void process_region_list(romload_private *romdata)
|
|||||||
UINT32 regionlength = ROMREGION_GETLENGTH(region);
|
UINT32 regionlength = ROMREGION_GETLENGTH(region);
|
||||||
|
|
||||||
rom_region_name(regiontag, *device, region);
|
rom_region_name(regiontag, *device, region);
|
||||||
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
|
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength));
|
||||||
|
|
||||||
/* the first entry must be a region */
|
/* the first entry must be a region */
|
||||||
assert(ROMENTRY_ISREGION(region));
|
assert(ROMENTRY_ISREGION(region));
|
||||||
@ -1548,7 +1548,7 @@ void rom_init(running_machine &machine)
|
|||||||
} else {
|
} else {
|
||||||
specbios = romdata->machine().options().sub_value(temp,device->owner()->tag()+1,"bios");
|
specbios = romdata->machine().options().sub_value(temp,device->owner()->tag()+1,"bios");
|
||||||
if (strlen(specbios) == 0) {
|
if (strlen(specbios) == 0) {
|
||||||
specbios = device->default_bios_tag().cstr();
|
specbios = device->default_bios_tag().c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
determine_bios_rom(romdata, device, specbios);
|
determine_bios_rom(romdata, device, specbios);
|
||||||
|
@ -179,7 +179,7 @@ void save_manager::save_memory(device_t *device, const char *module, const char
|
|||||||
|
|
||||||
// error if we are equal
|
// error if we are equal
|
||||||
if (entry->m_name == totalname)
|
if (entry->m_name == totalname)
|
||||||
fatalerror("Duplicate save state registration entry (%s)\n", totalname.cstr());
|
fatalerror("Duplicate save state registration entry (%s)\n", totalname.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert us into the list
|
// insert us into the list
|
||||||
@ -333,7 +333,7 @@ UINT32 save_manager::signature() const
|
|||||||
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
|
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
|
||||||
{
|
{
|
||||||
// add the entry name to the CRC
|
// add the entry name to the CRC
|
||||||
crc = crc32(crc, (UINT8 *)entry->m_name.cstr(), entry->m_name.len());
|
crc = crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.len());
|
||||||
|
|
||||||
// add the type and size to the CRC
|
// add the type and size to the CRC
|
||||||
UINT32 temp[2];
|
UINT32 temp[2];
|
||||||
@ -353,7 +353,7 @@ UINT32 save_manager::signature() const
|
|||||||
void save_manager::dump_registry() const
|
void save_manager::dump_registry() const
|
||||||
{
|
{
|
||||||
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
|
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
|
||||||
LOG(("%s: %d x %d\n", entry->m_name.cstr(), entry->m_typesize, entry->m_typecount));
|
LOG(("%s: %d x %d\n", entry->m_name.c_str(), entry->m_typesize, entry->m_typecount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -757,11 +757,11 @@ void device_scheduler::rebuild_execute_list()
|
|||||||
{
|
{
|
||||||
device_t *device = machine().device(machine().config().m_perfect_cpu_quantum);
|
device_t *device = machine().device(machine().config().m_perfect_cpu_quantum);
|
||||||
if (device == NULL)
|
if (device == NULL)
|
||||||
fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.cstr());
|
fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.c_str());
|
||||||
|
|
||||||
device_execute_interface *exec;
|
device_execute_interface *exec;
|
||||||
if (!device->interface(exec))
|
if (!device->interface(exec))
|
||||||
fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.cstr());
|
fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.c_str());
|
||||||
|
|
||||||
min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum);
|
min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum);
|
||||||
}
|
}
|
||||||
|
@ -1058,5 +1058,5 @@ void screen_device::load_effect_overlay(const char *filename)
|
|||||||
if (m_screen_overlay_bitmap.valid())
|
if (m_screen_overlay_bitmap.valid())
|
||||||
m_container->set_overlay(&m_screen_overlay_bitmap);
|
m_container->set_overlay(&m_screen_overlay_bitmap);
|
||||||
else
|
else
|
||||||
osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.cstr());
|
osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.c_str());
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ void software_list_device::device_validity_check(validity_checker &valid) const
|
|||||||
{
|
{
|
||||||
// add to the global map whenever we check a list so we don't re-check
|
// add to the global map whenever we check a list so we don't re-check
|
||||||
// it in the future
|
// it in the future
|
||||||
if (valid.already_checked(astring("softlist/", m_list_name.cstr())))
|
if (valid.already_checked(astring("softlist/", m_list_name.c_str())))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// do device validation only in case of validate command
|
// do device validation only in case of validate command
|
||||||
@ -565,7 +565,7 @@ void software_list_device::internal_validity_check(validity_checker &valid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check for duplicate descriptions
|
// check for duplicate descriptions
|
||||||
if (descriptions.add(astring(swinfo->longname()).makelower().cstr(), swinfo, false) == TMERR_DUPLICATE)
|
if (descriptions.add(astring(swinfo->longname()).makelower().c_str(), swinfo, false) == TMERR_DUPLICATE)
|
||||||
osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo->longname(), swinfo->shortname());
|
osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo->longname(), swinfo->shortname());
|
||||||
|
|
||||||
bool is_clone = false;
|
bool is_clone = false;
|
||||||
|
@ -63,7 +63,7 @@ DISCRETE_RESET(dss_adjustment)
|
|||||||
double min, max;
|
double min, max;
|
||||||
|
|
||||||
astring fulltag;
|
astring fulltag;
|
||||||
m_port = m_device->machine().root_device().ioport(m_device->siblingtag(fulltag, (const char *)this->custom_data()).cstr());
|
m_port = m_device->machine().root_device().ioport(m_device->siblingtag(fulltag, (const char *)this->custom_data()).c_str());
|
||||||
if (m_port == NULL)
|
if (m_port == NULL)
|
||||||
fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag\n", this->index());
|
fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag\n", this->index());
|
||||||
|
|
||||||
|
@ -1786,7 +1786,7 @@ void tilemap_device::device_start()
|
|||||||
|
|
||||||
// look for an extension entry
|
// look for an extension entry
|
||||||
astring tag_ext(tag(), "_ext");
|
astring tag_ext(tag(), "_ext");
|
||||||
share = memshare(tag_ext.cstr());
|
share = memshare(tag_ext.c_str());
|
||||||
if (share != NULL)
|
if (share != NULL)
|
||||||
m_extmem.set(*share, m_bytes_per_entry);
|
m_extmem.set(*share, m_bytes_per_entry);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ void ui_menu_barcode_reader::handle()
|
|||||||
machine().ui().popup_time(5, "Barcode length invalid!");
|
machine().ui().popup_time(5, "Barcode length invalid!");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
current_device()->write_code(tmp_file.cstr(), tmp_file.len());
|
current_device()->write_code(tmp_file.c_str(), tmp_file.len());
|
||||||
// if sending was successful, reset char buffer
|
// if sending was successful, reset char buffer
|
||||||
if (m_barcode_buffer[0] != '\0')
|
if (m_barcode_buffer[0] != '\0')
|
||||||
memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer));
|
memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer));
|
||||||
|
@ -29,7 +29,7 @@ ui_menu_device_config::ui_menu_device_config(running_machine &machine, render_co
|
|||||||
device_iterator deviter(machine.config().root_device());
|
device_iterator deviter(machine.config().root_device());
|
||||||
for (device_t *device = deviter.first(); device != NULL; device = deviter.next())
|
for (device_t *device = deviter.first(); device != NULL; device = deviter.next())
|
||||||
{
|
{
|
||||||
if (strcmp(device->tag(), tmp_tag.cstr()) == 0)
|
if (strcmp(device->tag(), tmp_tag.c_str()) == 0)
|
||||||
{
|
{
|
||||||
m_mounted = true;
|
m_mounted = true;
|
||||||
break;
|
break;
|
||||||
@ -176,7 +176,7 @@ void ui_menu_device_config::populate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bios)
|
if (bios)
|
||||||
string.catprintf("* BIOS settings:\n %d options [default: %s]\n", bios, bios_str.cstr());
|
string.catprintf("* BIOS settings:\n %d options [default: %s]\n", bios, bios_str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0;
|
int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0;
|
||||||
|
@ -414,7 +414,7 @@ void ui_menu_input::populate_and_sort(input_item_data *itemlist)
|
|||||||
item = itemarray[curitem];
|
item = itemarray[curitem];
|
||||||
assert(nameformat[item->type] != NULL);
|
assert(nameformat[item->type] != NULL);
|
||||||
|
|
||||||
if (item->owner_name && strcmp(item->owner_name, prev_owner.cstr()) != 0)
|
if (item->owner_name && strcmp(item->owner_name, prev_owner.c_str()) != 0)
|
||||||
{
|
{
|
||||||
if (first_entry)
|
if (first_entry)
|
||||||
first_entry = false;
|
first_entry = false;
|
||||||
@ -568,7 +568,7 @@ void ui_menu_settings::populate()
|
|||||||
flags |= MENU_FLAG_RIGHT_ARROW;
|
flags |= MENU_FLAG_RIGHT_ARROW;
|
||||||
|
|
||||||
/* add the menu item */
|
/* add the menu item */
|
||||||
if (strcmp(field->device().tag(), prev_owner.cstr()) != 0)
|
if (strcmp(field->device().tag(), prev_owner.c_str()) != 0)
|
||||||
{
|
{
|
||||||
if (first_entry)
|
if (first_entry)
|
||||||
first_entry = false;
|
first_entry = false;
|
||||||
@ -872,7 +872,7 @@ void ui_menu_analog::populate()
|
|||||||
analog_item_data *data;
|
analog_item_data *data;
|
||||||
UINT32 flags = 0;
|
UINT32 flags = 0;
|
||||||
astring name;
|
astring name;
|
||||||
if (strcmp(field->device().tag(), prev_owner.cstr()) != 0)
|
if (strcmp(field->device().tag(), prev_owner.c_str()) != 0)
|
||||||
{
|
{
|
||||||
if (first_entry)
|
if (first_entry)
|
||||||
first_entry = false;
|
first_entry = false;
|
||||||
@ -895,7 +895,7 @@ void ui_menu_analog::populate()
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case ANALOG_ITEM_KEYSPEED:
|
case ANALOG_ITEM_KEYSPEED:
|
||||||
text.printf("%s Digital Speed", name.cstr());
|
text.printf("%s Digital Speed", name.c_str());
|
||||||
subtext.printf("%d", settings.delta);
|
subtext.printf("%d", settings.delta);
|
||||||
data->min = 0;
|
data->min = 0;
|
||||||
data->max = 255;
|
data->max = 255;
|
||||||
@ -904,7 +904,7 @@ void ui_menu_analog::populate()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ANALOG_ITEM_CENTERSPEED:
|
case ANALOG_ITEM_CENTERSPEED:
|
||||||
text.printf("%s Autocenter Speed", name.cstr());
|
text.printf("%s Autocenter Speed", name.c_str());
|
||||||
subtext.printf("%d", settings.centerdelta);
|
subtext.printf("%d", settings.centerdelta);
|
||||||
data->min = 0;
|
data->min = 0;
|
||||||
data->max = 255;
|
data->max = 255;
|
||||||
@ -913,7 +913,7 @@ void ui_menu_analog::populate()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ANALOG_ITEM_REVERSE:
|
case ANALOG_ITEM_REVERSE:
|
||||||
text.printf("%s Reverse", name.cstr());
|
text.printf("%s Reverse", name.c_str());
|
||||||
subtext.cpy(settings.reverse ? "On" : "Off");
|
subtext.cpy(settings.reverse ? "On" : "Off");
|
||||||
data->min = 0;
|
data->min = 0;
|
||||||
data->max = 1;
|
data->max = 1;
|
||||||
@ -922,7 +922,7 @@ void ui_menu_analog::populate()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ANALOG_ITEM_SENSITIVITY:
|
case ANALOG_ITEM_SENSITIVITY:
|
||||||
text.printf("%s Sensitivity", name.cstr());
|
text.printf("%s Sensitivity", name.c_str());
|
||||||
subtext.printf("%d", settings.sensitivity);
|
subtext.printf("%d", settings.sensitivity);
|
||||||
data->min = 1;
|
data->min = 1;
|
||||||
data->max = 255;
|
data->max = 255;
|
||||||
|
@ -56,7 +56,7 @@ void ui_menu_main::populate()
|
|||||||
item_append("Input (general)", NULL, 0, (void *)INPUT_GROUPS);
|
item_append("Input (general)", NULL, 0, (void *)INPUT_GROUPS);
|
||||||
|
|
||||||
menu_text.printf("Input (this %s)",emulator_info::get_capstartgamenoun());
|
menu_text.printf("Input (this %s)",emulator_info::get_capstartgamenoun());
|
||||||
item_append(menu_text.cstr(), NULL, 0, (void *)INPUT_SPECIFIC);
|
item_append(menu_text.c_str(), NULL, 0, (void *)INPUT_SPECIFIC);
|
||||||
|
|
||||||
/* add optional input-related menus */
|
/* add optional input-related menus */
|
||||||
if (machine().ioport().has_analog())
|
if (machine().ioport().has_analog())
|
||||||
@ -66,7 +66,7 @@ void ui_menu_main::populate()
|
|||||||
if (machine().ioport().has_configs())
|
if (machine().ioport().has_configs())
|
||||||
{
|
{
|
||||||
menu_text.printf("%s Configuration",emulator_info::get_capstartgamenoun());
|
menu_text.printf("%s Configuration",emulator_info::get_capstartgamenoun());
|
||||||
item_append(menu_text.cstr(), NULL, 0, (void *)SETTINGS_DRIVER_CONFIG);
|
item_append(menu_text.c_str(), NULL, 0, (void *)SETTINGS_DRIVER_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add bookkeeping menu */
|
/* add bookkeeping menu */
|
||||||
@ -74,7 +74,7 @@ void ui_menu_main::populate()
|
|||||||
|
|
||||||
/* add game info menu */
|
/* add game info menu */
|
||||||
menu_text.printf("%s Information",emulator_info::get_capstartgamenoun());
|
menu_text.printf("%s Information",emulator_info::get_capstartgamenoun());
|
||||||
item_append(menu_text.cstr(), NULL, 0, (void *)GAME_INFO);
|
item_append(menu_text.c_str(), NULL, 0, (void *)GAME_INFO);
|
||||||
|
|
||||||
image_interface_iterator imgiter(machine().root_device());
|
image_interface_iterator imgiter(machine().root_device());
|
||||||
if (imgiter.first() != NULL)
|
if (imgiter.first() != NULL)
|
||||||
@ -135,7 +135,7 @@ void ui_menu_main::populate()
|
|||||||
|
|
||||||
/* add reset and exit menus */
|
/* add reset and exit menus */
|
||||||
menu_text.printf("Select New %s",emulator_info::get_capstartgamenoun());
|
menu_text.printf("Select New %s",emulator_info::get_capstartgamenoun());
|
||||||
item_append(menu_text.cstr(), NULL, 0, (void *)SELECT_GAME);
|
item_append(menu_text.c_str(), NULL, 0, (void *)SELECT_GAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_menu_main::~ui_menu_main()
|
ui_menu_main::~ui_menu_main()
|
||||||
|
@ -185,7 +185,7 @@ void ui_menu::reset(ui_menu_reset_options options)
|
|||||||
|
|
||||||
// add an item to return
|
// add an item to return
|
||||||
if (parent == NULL)
|
if (parent == NULL)
|
||||||
item_append(backtext.cstr(), NULL, 0, NULL);
|
item_append(backtext.c_str(), NULL, 0, NULL);
|
||||||
else if (parent->is_special_main_menu())
|
else if (parent->is_special_main_menu())
|
||||||
item_append("Exit", NULL, 0, NULL);
|
item_append("Exit", NULL, 0, NULL);
|
||||||
else
|
else
|
||||||
|
@ -128,7 +128,7 @@ void ui_menu_bios_selection::handle()
|
|||||||
astring value;
|
astring value;
|
||||||
astring temp;
|
astring temp;
|
||||||
value.printf("%s,bios=%d",machine().options().main_value(temp,dev->owner()->tag()+1),val-1);
|
value.printf("%s,bios=%d",machine().options().main_value(temp,dev->owner()->tag()+1),val-1);
|
||||||
machine().options().set_value(dev->owner()->tag()+1, value.cstr(), OPTION_PRIORITY_CMDLINE, error);
|
machine().options().set_value(dev->owner()->tag()+1, value.c_str(), OPTION_PRIORITY_CMDLINE, error);
|
||||||
assert(!error);
|
assert(!error);
|
||||||
}
|
}
|
||||||
reset(UI_MENU_RESET_REMEMBER_REF);
|
reset(UI_MENU_RESET_REMEMBER_REF);
|
||||||
|
@ -330,7 +330,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott
|
|||||||
tempbuf[1].printf("%s, %-.100s", driver->year, driver->manufacturer);
|
tempbuf[1].printf("%s, %-.100s", driver->year, driver->manufacturer);
|
||||||
|
|
||||||
// next line source path
|
// next line source path
|
||||||
tempbuf[2].printf("Driver: %-.100s", core_filename_extract_base(tempbuf[3], driver->source_file).cstr());
|
tempbuf[2].printf("Driver: %-.100s", core_filename_extract_base(tempbuf[3], driver->source_file).c_str());
|
||||||
|
|
||||||
// next line is overall driver status
|
// next line is overall driver status
|
||||||
if (driver->flags & GAME_NOT_WORKING)
|
if (driver->flags & GAME_NOT_WORKING)
|
||||||
|
@ -87,7 +87,7 @@ void ui_menu_software_parts::populate()
|
|||||||
menu_part_name.cat(" (").cat(swpart->feature("part_id")).cat(")");
|
menu_part_name.cat(" (").cat(swpart->feature("part_id")).cat(")");
|
||||||
entry->type = T_ENTRY;
|
entry->type = T_ENTRY;
|
||||||
entry->part = swpart;
|
entry->part = swpart;
|
||||||
item_append(m_info->shortname(), menu_part_name.cstr(), 0, entry);
|
item_append(m_info->shortname(), menu_part_name.c_str(), 0, entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
|
|||||||
{
|
{
|
||||||
astring warning;
|
astring warning;
|
||||||
warning.cpy("This driver requires images to be loaded in the following device(s): ").cat(messagebox_text.substr(0, messagebox_text.len() - 2));
|
warning.cpy("This driver requires images to be loaded in the following device(s): ").cat(messagebox_text.substr(0, messagebox_text.len() - 2));
|
||||||
ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.cstr());
|
ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1134,7 +1134,7 @@ astring &ui_manager::game_info_astring(astring &string)
|
|||||||
{
|
{
|
||||||
// print description, manufacturer, and CPU:
|
// print description, manufacturer, and CPU:
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
string.printf("%s\n%s %s\nDriver: %s\n\nCPU:\n", machine().system().description, machine().system().year, machine().system().manufacturer, core_filename_extract_base(tempstr, machine().system().source_file).cstr());
|
string.printf("%s\n%s %s\nDriver: %s\n\nCPU:\n", machine().system().description, machine().system().year, machine().system().manufacturer, core_filename_extract_base(tempstr, machine().system().source_file).c_str());
|
||||||
|
|
||||||
// loop over all CPUs
|
// loop over all CPUs
|
||||||
execute_interface_iterator execiter(machine().root_device());
|
execute_interface_iterator execiter(machine().root_device());
|
||||||
@ -1761,8 +1761,8 @@ UINT32 ui_manager::handler_confirm_quit(running_machine &machine, render_contain
|
|||||||
"Are you sure you want to quit?\n\n"
|
"Are you sure you want to quit?\n\n"
|
||||||
"Press ''%s'' to quit,\n"
|
"Press ''%s'' to quit,\n"
|
||||||
"Press ''%s'' to return to emulation.",
|
"Press ''%s'' to return to emulation.",
|
||||||
ui_select_text.cstr(),
|
ui_select_text.c_str(),
|
||||||
ui_cancel_text.cstr());
|
ui_cancel_text.c_str());
|
||||||
|
|
||||||
machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||||
machine.pause();
|
machine.pause();
|
||||||
|
@ -203,12 +203,12 @@ void validity_checker::check_all()
|
|||||||
if (m_errors > 0)
|
if (m_errors > 0)
|
||||||
{
|
{
|
||||||
m_error_text.replace("\n", "\n ");
|
m_error_text.replace("\n", "\n ");
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.cstr());
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.c_str());
|
||||||
}
|
}
|
||||||
if (m_warnings > 0)
|
if (m_warnings > 0)
|
||||||
{
|
{
|
||||||
m_warning_text.replace("\n", "\n ");
|
m_warning_text.replace("\n", "\n ");
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.cstr());
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.c_str());
|
||||||
}
|
}
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n");
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n");
|
||||||
}
|
}
|
||||||
@ -299,16 +299,16 @@ void validity_checker::validate_one(const game_driver &driver)
|
|||||||
if (m_errors > start_errors || m_warnings > start_warnings)
|
if (m_errors > start_errors || m_warnings > start_warnings)
|
||||||
{
|
{
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Driver %s (file %s): %d errors, %d warnings\n", driver.name, core_filename_extract_base(tempstr, driver.source_file).cstr(), m_errors - start_errors, m_warnings - start_warnings);
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Driver %s (file %s): %d errors, %d warnings\n", driver.name, core_filename_extract_base(tempstr, driver.source_file).c_str(), m_errors - start_errors, m_warnings - start_warnings);
|
||||||
if (m_errors > start_errors)
|
if (m_errors > start_errors)
|
||||||
{
|
{
|
||||||
m_error_text.replace("\n", "\n ");
|
m_error_text.replace("\n", "\n ");
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.cstr());
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.c_str());
|
||||||
}
|
}
|
||||||
if (m_warnings > start_warnings)
|
if (m_warnings > start_warnings)
|
||||||
{
|
{
|
||||||
m_warning_text.replace("\n", "\n ");
|
m_warning_text.replace("\n", "\n ");
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.cstr());
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.c_str());
|
||||||
}
|
}
|
||||||
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n");
|
output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n");
|
||||||
}
|
}
|
||||||
@ -523,14 +523,14 @@ void validity_checker::validate_driver()
|
|||||||
if (m_names_map.add(m_current_driver->name, m_current_driver, false) == TMERR_DUPLICATE)
|
if (m_names_map.add(m_current_driver->name, m_current_driver, false) == TMERR_DUPLICATE)
|
||||||
{
|
{
|
||||||
const game_driver *match = m_names_map.find(m_current_driver->name);
|
const game_driver *match = m_names_map.find(m_current_driver->name);
|
||||||
osd_printf_error("Driver name is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).cstr(), match->name);
|
osd_printf_error("Driver name is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).c_str(), match->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for duplicate descriptions
|
// check for duplicate descriptions
|
||||||
if (m_descriptions_map.add(m_current_driver->description, m_current_driver, false) == TMERR_DUPLICATE)
|
if (m_descriptions_map.add(m_current_driver->description, m_current_driver, false) == TMERR_DUPLICATE)
|
||||||
{
|
{
|
||||||
const game_driver *match = m_descriptions_map.find(m_current_driver->description);
|
const game_driver *match = m_descriptions_map.find(m_current_driver->description);
|
||||||
osd_printf_error("Driver description is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).cstr(), match->name);
|
osd_printf_error("Driver description is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).c_str(), match->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine if we are a clone
|
// determine if we are a clone
|
||||||
@ -645,7 +645,7 @@ void validity_checker::validate_roms()
|
|||||||
// attempt to add it to the map, reporting duplicates as errors
|
// attempt to add it to the map, reporting duplicates as errors
|
||||||
current_length = ROMREGION_GETLENGTH(romp);
|
current_length = ROMREGION_GETLENGTH(romp);
|
||||||
if (m_region_map.add(fulltag, current_length, false) == TMERR_DUPLICATE)
|
if (m_region_map.add(fulltag, current_length, false) == TMERR_DUPLICATE)
|
||||||
osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.cstr());
|
osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a system bios, make sure it is using the next available bios number
|
// If this is a system bios, make sure it is using the next available bios number
|
||||||
@ -883,7 +883,7 @@ void validity_checker::validate_inputs()
|
|||||||
|
|
||||||
// report any errors during construction
|
// report any errors during construction
|
||||||
if (errorbuf)
|
if (errorbuf)
|
||||||
osd_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr());
|
osd_printf_error("I/O port error during construction:\n%s\n", errorbuf.c_str());
|
||||||
|
|
||||||
// do a first pass over ports to add their names and find duplicates
|
// do a first pass over ports to add their names and find duplicates
|
||||||
for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
|
for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
|
||||||
@ -1010,7 +1010,7 @@ void validity_checker::validate_devices()
|
|||||||
{
|
{
|
||||||
astring temptag("_");
|
astring temptag("_");
|
||||||
temptag.cat(option->name());
|
temptag.cat(option->name());
|
||||||
device_t *dev = const_cast<machine_config &>(*m_current_config).device_add(&m_current_config->root_device(), temptag.cstr(), option->devtype(), 0);
|
device_t *dev = const_cast<machine_config &>(*m_current_config).device_add(&m_current_config->root_device(), temptag.c_str(), option->devtype(), 0);
|
||||||
|
|
||||||
// notify this device and all its subdevices that they are now configured
|
// notify this device and all its subdevices that they are now configured
|
||||||
device_iterator subiter(*dev);
|
device_iterator subiter(*dev);
|
||||||
@ -1023,7 +1023,7 @@ void validity_checker::validate_devices()
|
|||||||
osd_printf_error("Device '%s' is slot cart device but does not have short name defined\n",dev->name());
|
osd_printf_error("Device '%s' is slot cart device but does not have short name defined\n",dev->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
const_cast<machine_config &>(*m_current_config).device_remove(&m_current_config->root_device(), temptag.cstr());
|
const_cast<machine_config &>(*m_current_config).device_remove(&m_current_config->root_device(), temptag.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1158,7 +1158,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
|
|||||||
// copy the device name to an astring
|
// copy the device name to an astring
|
||||||
astring snapdevname;
|
astring snapdevname;
|
||||||
snapdevname.cpysubstr(snapstr, pos + 3, end - pos - 3);
|
snapdevname.cpysubstr(snapstr, pos + 3, end - pos - 3);
|
||||||
//printf("check template: %s\n", snapdevname.cstr());
|
//printf("check template: %s\n", snapdevname.c_str());
|
||||||
|
|
||||||
// verify that there is such a device for this system
|
// verify that there is such a device for this system
|
||||||
image_interface_iterator iter(machine().root_device());
|
image_interface_iterator iter(machine().root_device());
|
||||||
@ -1166,7 +1166,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
|
|||||||
{
|
{
|
||||||
// get the device name
|
// get the device name
|
||||||
astring tempdevname(image->brief_instance_name());
|
astring tempdevname(image->brief_instance_name());
|
||||||
//printf("check device: %s\n", tempdevname.cstr());
|
//printf("check device: %s\n", tempdevname.c_str());
|
||||||
|
|
||||||
if (snapdevname.cmp(tempdevname) == 0)
|
if (snapdevname.cmp(tempdevname) == 0)
|
||||||
{
|
{
|
||||||
@ -1181,7 +1181,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
|
|||||||
// setup snapname and remove the %d_
|
// setup snapname and remove the %d_
|
||||||
snapstr.replace(0, snapdevname, filename);
|
snapstr.replace(0, snapdevname, filename);
|
||||||
snapstr.del(pos, 3);
|
snapstr.del(pos, 3);
|
||||||
//printf("check image: %s\n", filename.cstr());
|
//printf("check image: %s\n", filename.c_str());
|
||||||
|
|
||||||
name_found = 1;
|
name_found = 1;
|
||||||
}
|
}
|
||||||
@ -1215,7 +1215,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
|
|||||||
for (int seq = 0; ; seq++)
|
for (int seq = 0; ; seq++)
|
||||||
{
|
{
|
||||||
// build up the filename
|
// build up the filename
|
||||||
fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).cstr());
|
fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).c_str());
|
||||||
|
|
||||||
// try to open the file; stop when we fail
|
// try to open the file; stop when we fail
|
||||||
file_error filerr = file.open(fname);
|
file_error filerr = file.open(fname);
|
||||||
|
@ -455,7 +455,7 @@ int web_engine::begin_request_handler(struct mg_connection *conn)
|
|||||||
mg_send_header(conn, "Cache-Control", "no-cache, no-store, must-revalidate");
|
mg_send_header(conn, "Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
mg_send_header(conn, "Pragma", "no-cache");
|
mg_send_header(conn, "Pragma", "no-cache");
|
||||||
mg_send_header(conn, "Expires", "0");
|
mg_send_header(conn, "Expires", "0");
|
||||||
mg_send_file(conn, fullpath.cstr(), NULL);
|
mg_send_file(conn, fullpath.c_str(), NULL);
|
||||||
return MG_MORE; // It is important to return MG_MORE after mg_send_file!
|
return MG_MORE; // It is important to return MG_MORE after mg_send_file!
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -371,7 +371,7 @@ void ldplayer_state::machine_reset()
|
|||||||
timer_set(attotime::zero, TIMER_ID_AUTOPLAY);
|
timer_set(attotime::zero, TIMER_ID_AUTOPLAY);
|
||||||
|
|
||||||
// indicate the name of the file we opened
|
// indicate the name of the file we opened
|
||||||
popmessage("Opened %s\n", m_filename.cstr());
|
popmessage("Opened %s\n", m_filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
// C string conversion operators and helpers
|
// C string conversion operators and helpers
|
||||||
operator const char *() const { return m_text; }
|
operator const char *() const { return m_text; }
|
||||||
const char *cstr() const { return m_text; }
|
const char *c_str() const { return m_text; }
|
||||||
|
|
||||||
// buffer management
|
// buffer management
|
||||||
astring &reset() { return cpy(""); }
|
astring &reset() { return cpy(""); }
|
||||||
@ -86,19 +86,19 @@ public:
|
|||||||
// copy helpers
|
// copy helpers
|
||||||
astring &cpy(const char *src, int count);
|
astring &cpy(const char *src, int count);
|
||||||
astring &cpysubstr(const astring &src, int start, int count = -1);
|
astring &cpysubstr(const astring &src, int start, int count = -1);
|
||||||
astring &cpy(const astring &src) { return cpy(src.cstr(), src.len()); }
|
astring &cpy(const astring &src) { return cpy(src.c_str(), src.len()); }
|
||||||
astring &cpy(const char *src) { return cpy(src, strlen(src)); }
|
astring &cpy(const char *src) { return cpy(src, strlen(src)); }
|
||||||
|
|
||||||
// insertion helpers
|
// insertion helpers
|
||||||
astring &ins(int insbefore, const char *src, int count);
|
astring &ins(int insbefore, const char *src, int count);
|
||||||
astring &inssubstr(int insbefore, const astring &src, int start, int count = -1);
|
astring &inssubstr(int insbefore, const astring &src, int start, int count = -1);
|
||||||
astring &ins(int insbefore, const astring &src) { return ins(insbefore, src.cstr(), src.len()); }
|
astring &ins(int insbefore, const astring &src) { return ins(insbefore, src.c_str(), src.len()); }
|
||||||
astring &ins(int insbefore, const char *src) { return ins(insbefore, src, strlen(src)); }
|
astring &ins(int insbefore, const char *src) { return ins(insbefore, src, strlen(src)); }
|
||||||
|
|
||||||
// concatenation helpers (== insert at end)
|
// concatenation helpers (== insert at end)
|
||||||
astring &cat(const char *src, int count) { return ins(-1, src, count); }
|
astring &cat(const char *src, int count) { return ins(-1, src, count); }
|
||||||
astring &catsubstr(const astring &src, int start, int count = -1) { return inssubstr(-1, src, start, count); }
|
astring &catsubstr(const astring &src, int start, int count = -1) { return inssubstr(-1, src, start, count); }
|
||||||
astring &cat(const astring &src) { return ins(-1, src.cstr(), src.len()); }
|
astring &cat(const astring &src) { return ins(-1, src.c_str(), src.len()); }
|
||||||
astring &cat(const char *src) { return ins(-1, src, strlen(src)); }
|
astring &cat(const char *src) { return ins(-1, src, strlen(src)); }
|
||||||
astring &cat(char ch) { return ins(-1, &ch, 1); }
|
astring &cat(char ch) { return ins(-1, &ch, 1); }
|
||||||
|
|
||||||
@ -117,13 +117,13 @@ public:
|
|||||||
// comparison helpers
|
// comparison helpers
|
||||||
int cmp(const char *str2, int count) const;
|
int cmp(const char *str2, int count) const;
|
||||||
int cmpsubstr(const astring &str2, int start, int count = -1) const;
|
int cmpsubstr(const astring &str2, int start, int count = -1) const;
|
||||||
int cmp(const astring &str2) const { return cmp(str2.cstr(), str2.len()); }
|
int cmp(const astring &str2) const { return cmp(str2.c_str(), str2.len()); }
|
||||||
int cmp(const char *str2) const { return cmp(str2, strlen(str2)); }
|
int cmp(const char *str2) const { return cmp(str2, strlen(str2)); }
|
||||||
|
|
||||||
// case-insensitive comparison helpers
|
// case-insensitive comparison helpers
|
||||||
int icmp(const char *str2, int count) const;
|
int icmp(const char *str2, int count) const;
|
||||||
int icmpsubstr(const astring &str2, int start, int count = -1) const;
|
int icmpsubstr(const astring &str2, int start, int count = -1) const;
|
||||||
int icmp(const astring &str2) const { return icmp(str2.cstr(), str2.len()); }
|
int icmp(const astring &str2) const { return icmp(str2.c_str(), str2.len()); }
|
||||||
int icmp(const char *str2) const { return icmp(str2, strlen(str2)); }
|
int icmp(const char *str2) const { return icmp(str2, strlen(str2)); }
|
||||||
|
|
||||||
// character searching helpers
|
// character searching helpers
|
||||||
|
@ -164,7 +164,7 @@ cdrom_file *cdrom_open(const char *inputfile)
|
|||||||
file_error filerr = core_fopen(file->track_info.track[i].fname, OPEN_FLAG_READ, &file->fhandle[i]);
|
file_error filerr = core_fopen(file->track_info.track[i].fname, OPEN_FLAG_READ, &file->fhandle[i]);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.cstr());
|
fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.c_str());
|
||||||
cdrom_close(file);
|
cdrom_close(file);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ public:
|
|||||||
chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen);
|
chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen);
|
||||||
chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags);
|
chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags);
|
||||||
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags = CHD_MDFLAGS_CHECKSUM);
|
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags = CHD_MDFLAGS_CHECKSUM);
|
||||||
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const astring &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.cstr(), input.len() + 1, flags); }
|
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const astring &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.c_str(), input.len() + 1, flags); }
|
||||||
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const dynamic_buffer &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input, input.count(), flags); }
|
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const dynamic_buffer &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input, input.count(), flags); }
|
||||||
chd_error delete_metadata(chd_metadata_tag metatag, UINT32 metaindex);
|
chd_error delete_metadata(chd_metadata_tag metatag, UINT32 metaindex);
|
||||||
chd_error clone_all_metadata(chd_file &source);
|
chd_error clone_all_metadata(chd_file &source);
|
||||||
|
@ -695,7 +695,7 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_
|
|||||||
#if 0
|
#if 0
|
||||||
for(i=0; i < numtracks; i++)
|
for(i=0; i < numtracks; i++)
|
||||||
{
|
{
|
||||||
printf("%s %d %d %d (true %d)\n", outinfo.track[i].fname.cstr(), outtoc.tracks[i].frames, outtoc.tracks[i].padframes, outtoc.tracks[i].physframeofs, outtoc.tracks[i].frames - outtoc.tracks[i].padframes);
|
printf("%s %d %d %d (true %d)\n", outinfo.track[i].fname.c_str(), outtoc.tracks[i].frames, outtoc.tracks[i].padframes, outtoc.tracks[i].physframeofs, outtoc.tracks[i].frames - outtoc.tracks[i].padframes);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
|
|||||||
wavlen = parse_wav_sample(lastfname, &wavoffs);
|
wavlen = parse_wav_sample(lastfname, &wavoffs);
|
||||||
if (!wavlen)
|
if (!wavlen)
|
||||||
{
|
{
|
||||||
printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.cstr());
|
printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.c_str());
|
||||||
return CHDERR_INVALID_DATA;
|
return CHDERR_INVALID_DATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -812,7 +812,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
|
|||||||
|
|
||||||
outinfo.track[trknum].fname.cpy(lastfname); // default filename to the last one
|
outinfo.track[trknum].fname.cpy(lastfname); // default filename to the last one
|
||||||
|
|
||||||
// printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.cstr(), outinfo.track[trknum].offset);
|
// printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset);
|
||||||
|
|
||||||
cdrom_convert_type_string_to_track_info(token, &outtoc.tracks[trknum]);
|
cdrom_convert_type_string_to_track_info(token, &outtoc.tracks[trknum]);
|
||||||
if (outtoc.tracks[trknum].datasize == 0)
|
if (outtoc.tracks[trknum].datasize == 0)
|
||||||
@ -927,10 +927,10 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
|
|||||||
/* if we have the same filename as the last track, do it that way */
|
/* if we have the same filename as the last track, do it that way */
|
||||||
if (trknum != 0 && outinfo.track[trknum].fname == outinfo.track[trknum-1].fname)
|
if (trknum != 0 && outinfo.track[trknum].fname == outinfo.track[trknum-1].fname)
|
||||||
{
|
{
|
||||||
tlen = get_file_size(outinfo.track[trknum].fname.cstr());
|
tlen = get_file_size(outinfo.track[trknum].fname.c_str());
|
||||||
if (tlen == 0)
|
if (tlen == 0)
|
||||||
{
|
{
|
||||||
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.cstr());
|
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str());
|
||||||
return CHDERR_FILE_NOT_FOUND;
|
return CHDERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
outinfo.track[trknum].offset = outinfo.track[trknum-1].offset + outtoc.tracks[trknum-1].frames * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize);
|
outinfo.track[trknum].offset = outinfo.track[trknum-1].offset + outtoc.tracks[trknum-1].frames * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize);
|
||||||
@ -941,7 +941,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
|
|||||||
tlen = get_file_size(outinfo.track[trknum].fname);
|
tlen = get_file_size(outinfo.track[trknum].fname);
|
||||||
if (tlen == 0)
|
if (tlen == 0)
|
||||||
{
|
{
|
||||||
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.cstr());
|
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str());
|
||||||
return CHDERR_FILE_NOT_FOUND;
|
return CHDERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
|
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
|
||||||
@ -976,7 +976,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
|
|||||||
tlen = get_file_size(outinfo.track[trknum].fname);
|
tlen = get_file_size(outinfo.track[trknum].fname);
|
||||||
if (tlen == 0)
|
if (tlen == 0)
|
||||||
{
|
{
|
||||||
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.cstr());
|
printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.c_str());
|
||||||
return CHDERR_FILE_NOT_FOUND;
|
return CHDERR_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
|
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
|
||||||
|
@ -364,7 +364,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri
|
|||||||
// can only have one command
|
// can only have one command
|
||||||
if (m_command)
|
if (m_command)
|
||||||
{
|
{
|
||||||
error_string.catprintf("Error: multiple commands specified -%s and %s\n", m_command.cstr(), curarg);
|
error_string.catprintf("Error: multiple commands specified -%s and %s\n", m_command.c_str(), curarg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_command = curentry->name();
|
m_command = curentry->name();
|
||||||
@ -635,14 +635,14 @@ bool core_options::set_value(const char *name, int value, int priority, astring
|
|||||||
{
|
{
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
tempstr.printf("%d", value);
|
tempstr.printf("%d", value);
|
||||||
return set_value(name, tempstr.cstr(), priority, error_string);
|
return set_value(name, tempstr.c_str(), priority, error_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool core_options::set_value(const char *name, float value, int priority, astring &error_string)
|
bool core_options::set_value(const char *name, float value, int priority, astring &error_string)
|
||||||
{
|
{
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
tempstr.printf("%f", value);
|
tempstr.printf("%f", value);
|
||||||
return set_value(name, tempstr.cstr(), priority, error_string);
|
return set_value(name, tempstr.c_str(), priority, error_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -752,7 +752,7 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch
|
|||||||
case OPTION_BOOLEAN:
|
case OPTION_BOOLEAN:
|
||||||
if (sscanf(data, "%d", &ival) != 1 || ival < 0 || ival > 1)
|
if (sscanf(data, "%d", &ival) != 1 || ival < 0 || ival > 1)
|
||||||
{
|
{
|
||||||
error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value());
|
error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -761,12 +761,12 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch
|
|||||||
case OPTION_INTEGER:
|
case OPTION_INTEGER:
|
||||||
if (sscanf(data, "%d", &ival) != 1)
|
if (sscanf(data, "%d", &ival) != 1)
|
||||||
{
|
{
|
||||||
error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value());
|
error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (curentry.has_range() && (ival < atoi(curentry.minimum()) || ival > atoi(curentry.maximum())))
|
if (curentry.has_range() && (ival < atoi(curentry.minimum()) || ival > atoi(curentry.maximum())))
|
||||||
{
|
{
|
||||||
error_string.catprintf("Out-of-range integer value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.cstr(), curentry.minimum(), curentry.maximum(), curentry.value());
|
error_string.catprintf("Out-of-range integer value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.c_str(), curentry.minimum(), curentry.maximum(), curentry.value());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -775,12 +775,12 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch
|
|||||||
case OPTION_FLOAT:
|
case OPTION_FLOAT:
|
||||||
if (sscanf(data, "%f", &fval) != 1)
|
if (sscanf(data, "%f", &fval) != 1)
|
||||||
{
|
{
|
||||||
error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value());
|
error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (curentry.has_range() && (fval < atof(curentry.minimum()) || fval > atof(curentry.maximum())))
|
if (curentry.has_range() && (fval < atof(curentry.minimum()) || fval > atof(curentry.maximum())))
|
||||||
{
|
{
|
||||||
error_string.catprintf("Out-of-range float value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.cstr(), curentry.minimum(), curentry.maximum(), curentry.value());
|
error_string.catprintf("Out-of-range float value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.c_str(), curentry.minimum(), curentry.maximum(), curentry.value());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
// getters
|
// getters
|
||||||
entry *next() const { return m_next; }
|
entry *next() const { return m_next; }
|
||||||
const char *name(int index = 0) const { return (index < ARRAY_LENGTH(m_name) && m_name[index]) ? m_name[index].cstr() : NULL; }
|
const char *name(int index = 0) const { return (index < ARRAY_LENGTH(m_name) && m_name[index]) ? m_name[index].c_str() : NULL; }
|
||||||
const char *description() const { return m_description; }
|
const char *description() const { return m_description; }
|
||||||
const char *value() const { return m_data; }
|
const char *value() const { return m_data; }
|
||||||
const char *default_value() const { return m_defdata; }
|
const char *default_value() const { return m_defdata; }
|
||||||
|
@ -237,7 +237,7 @@ int find_input_strings(running_machine &machine)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
sc45helperlog("%s", tempstring.cstr());
|
sc45helperlog("%s", tempstring.c_str());
|
||||||
|
|
||||||
sc45helperlog("\n");
|
sc45helperlog("\n");
|
||||||
|
|
||||||
@ -316,48 +316,48 @@ int find_input_strings(running_machine &machine)
|
|||||||
|
|
||||||
if (ignoreports[i][j] > 0)
|
if (ignoreports[i][j] > 0)
|
||||||
{
|
{
|
||||||
printf(" PORT_BIT( 0x%04x, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_%d_%d ) PORT_NAME(\"%s\")\n", 1 << j, i,j/*ignoreports[i][j]*/, sc4inputs[i][j].name.cstr());
|
printf(" PORT_BIT( 0x%04x, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_%d_%d ) PORT_NAME(\"%s\")\n", 1 << j, i,j/*ignoreports[i][j]*/, sc4inputs[i][j].name.c_str());
|
||||||
buttons_used++;
|
buttons_used++;
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -3)
|
else if (ignoreports[i][j] == -3)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -2)
|
else if (ignoreports[i][j] == -2)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -1)
|
else if (ignoreports[i][j] == -1)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -4)
|
else if (ignoreports[i][j] == -4)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -5)
|
else if (ignoreports[i][j] == -5)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -6)
|
else if (ignoreports[i][j] == -6)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -7)
|
else if (ignoreports[i][j] == -7)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -8)
|
else if (ignoreports[i][j] == -8)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -9)
|
else if (ignoreports[i][j] == -9)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
else if (ignoreports[i][j] == -10)
|
else if (ignoreports[i][j] == -10)
|
||||||
{
|
{
|
||||||
printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.cstr());
|
printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.c_str());
|
||||||
}
|
}
|
||||||
buttons_used++;
|
buttons_used++;
|
||||||
}
|
}
|
||||||
@ -390,7 +390,7 @@ void set_clickable_temp(running_machine &machine, const astring &teststring, int
|
|||||||
{
|
{
|
||||||
for (int x = 0; x < 16; x++)
|
for (int x = 0; x < 16; x++)
|
||||||
{
|
{
|
||||||
if (!strcmp(teststring.cstr(), lamps[y][x].lampname_alt.cstr()))
|
if (!strcmp(teststring.c_str(), lamps[y][x].lampname_alt.c_str()))
|
||||||
{
|
{
|
||||||
lamps[y][x].clickport = clickport;
|
lamps[y][x].clickport = clickport;
|
||||||
lamps[y][x].clickmask = clickmask;
|
lamps[y][x].clickmask = clickmask;
|
||||||
@ -507,7 +507,7 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
fatalerror("duplicate lamp?\n");
|
fatalerror("duplicate lamp?\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//sc45helperlog("%s", tempstring.cstr());
|
//sc45helperlog("%s", tempstring.c_str());
|
||||||
|
|
||||||
//sc45helperlog("\n");
|
//sc45helperlog("\n");
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
//sc45helperlog("---ROW %02d---\n", y);
|
//sc45helperlog("---ROW %02d---\n", y);
|
||||||
for (int x = 0; x < 16; x++)
|
for (int x = 0; x < 16; x++)
|
||||||
{
|
{
|
||||||
sc45helperlog("<element name=\"lamplabelel%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", d, lamps[y][x].lampname.cstr());
|
sc45helperlog("<element name=\"lamplabelel%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", d, lamps[y][x].lampname.c_str());
|
||||||
d++;
|
d++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -536,7 +536,7 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
|
|
||||||
for (int x = 0; x < 6; x++)
|
for (int x = 0; x < 6; x++)
|
||||||
{
|
{
|
||||||
sc45helperlog("<element name=\"inputlabel%d-%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", realy,x,sc4inputs[realy][x].name.cstr());
|
sc45helperlog("<element name=\"inputlabel%d-%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", realy,x,sc4inputs[realy][x].name.c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -593,11 +593,11 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
{
|
{
|
||||||
lamps[y][x].lampname_alt = lamps[y][x].lampname;
|
lamps[y][x].lampname_alt = lamps[y][x].lampname;
|
||||||
|
|
||||||
if (!strcmp(lamps[y][x].lampname_alt.cstr(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2";
|
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2";
|
||||||
if (!strcmp(lamps[y][x].lampname_alt.cstr(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3";
|
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3";
|
||||||
if (!strcmp(lamps[y][x].lampname_alt.cstr(), "chg stake")) lamps[y][x].lampname_alt = "chnge stk";
|
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "chg stake")) lamps[y][x].lampname_alt = "chnge stk";
|
||||||
if (!strcmp(lamps[y][x].lampname_alt.cstr(), "canc/coll")) lamps[y][x].lampname_alt = "cancel";
|
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "canc/coll")) lamps[y][x].lampname_alt = "cancel";
|
||||||
if (!strcmp(lamps[y][x].lampname_alt.cstr(), "start")) lamps[y][x].lampname_alt = "strt exch";
|
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "start")) lamps[y][x].lampname_alt = "strt exch";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -625,7 +625,7 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
{
|
{
|
||||||
for (int x = 0; x < 16; x++)
|
for (int x = 0; x < 16; x++)
|
||||||
{
|
{
|
||||||
if (!strcmp(tempname2, lamps[y][x].lampname_alt.cstr()))
|
if (!strcmp(tempname2, lamps[y][x].lampname_alt.c_str()))
|
||||||
{
|
{
|
||||||
//sc45helperlog("%s found\n", tempname2);
|
//sc45helperlog("%s found\n", tempname2);
|
||||||
lamps[y][x].draw_label = false;
|
lamps[y][x].draw_label = false;
|
||||||
@ -640,7 +640,7 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//printf("%s:%s:\n", tempname2, lamps[y][x].lampname_alt.cstr());
|
//printf("%s:%s:\n", tempname2, lamps[y][x].lampname_alt.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -679,8 +679,8 @@ int find_lamp_strings(running_machine &machine)
|
|||||||
//sc45helperlog("---ROW %02d---\n", y);
|
//sc45helperlog("---ROW %02d---\n", y);
|
||||||
for (int x = 0; x < 16; x++)
|
for (int x = 0; x < 16; x++)
|
||||||
{
|
{
|
||||||
if (lamps[y][x].clickport== -1) sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\"/></bezel>\n", d, lamps[y][x].lamptypename.cstr(), lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
|
if (lamps[y][x].clickport== -1) sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\"/></bezel>\n", d, lamps[y][x].lamptypename.c_str(), lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
|
||||||
else sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\" inputtag=\"IN-%d\" inputmask=\"0x%02x\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" /></bezel>\n", d, lamps[y][x].lamptypename.cstr(), lamps[y][x].clickport, lamps[y][x].clickmask, lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
|
else sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\" inputtag=\"IN-%d\" inputmask=\"0x%02x\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" /></bezel>\n", d, lamps[y][x].lamptypename.c_str(), lamps[y][x].clickport, lamps[y][x].clickmask, lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
|
||||||
|
|
||||||
if (lamps[y][x].draw_label == false) sc45helperlog("<!-- Label not drawn\n");
|
if (lamps[y][x].draw_label == false) sc45helperlog("<!-- Label not drawn\n");
|
||||||
sc45helperlog("<bezel name=\"lamplabel%d\" element=\"lamplabelel%d\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"10\" /></bezel>\n", d,d, lamps[y][x].x, lamps[y][x].y-10, lamps[y][x].width);
|
sc45helperlog("<bezel name=\"lamplabel%d\" element=\"lamplabelel%d\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"10\" /></bezel>\n", d,d, lamps[y][x].x, lamps[y][x].y-10, lamps[y][x].width);
|
||||||
@ -905,7 +905,7 @@ int find_reel_strings(running_machine &machine)
|
|||||||
tempstring.cat("PND");
|
tempstring.cat("PND");
|
||||||
}
|
}
|
||||||
|
|
||||||
sc45helperlog("%s", tempstring.cstr());
|
sc45helperlog("%s", tempstring.c_str());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ void sega_315_5881_crypt_device::device_start()
|
|||||||
|
|
||||||
astring skey = parameter("key");
|
astring skey = parameter("key");
|
||||||
if(skey)
|
if(skey)
|
||||||
key = strtoll(skey.cstr(), 0, 16);
|
key = strtoll(skey.c_str(), 0, 16);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logerror("%s: Warning: key not provided\n", tag());
|
logerror("%s: Warning: key not provided\n", tag());
|
||||||
|
@ -32,7 +32,7 @@ void naomi_m1_board::device_start()
|
|||||||
|
|
||||||
astring skey = parameter("key");
|
astring skey = parameter("key");
|
||||||
if(skey)
|
if(skey)
|
||||||
key = strtoll(skey.cstr(), 0, 16);
|
key = strtoll(skey.c_str(), 0, 16);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logerror("%s: Warning: key not provided\n", tag());
|
logerror("%s: Warning: key not provided\n", tag());
|
||||||
|
@ -159,7 +159,7 @@ int aim65_state::load_cart(device_image_interface &image, generic_slot_device *s
|
|||||||
astring errmsg;
|
astring errmsg;
|
||||||
errmsg.printf("Attempted to load file with wrong extension\nSocket '%s' only accepts files with '.%s' extension",
|
errmsg.printf("Attempted to load file with wrong extension\nSocket '%s' only accepts files with '.%s' extension",
|
||||||
slot_tag, slot_tag);
|
slot_tag, slot_tag);
|
||||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
|
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.c_str());
|
||||||
return IMAGE_INIT_FAIL;
|
return IMAGE_INIT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ int pegasus_state::load_cart(device_image_interface &image, generic_slot_device
|
|||||||
{
|
{
|
||||||
astring errmsg;
|
astring errmsg;
|
||||||
errmsg.printf("Attempted to load a file that does not work in this socket.\nPlease check \"Usage\" field in the software list for the correct socket(s) to use.");
|
errmsg.printf("Attempted to load a file that does not work in this socket.\nPlease check \"Usage\" field in the software list for the correct socket(s) to use.");
|
||||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
|
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.c_str());
|
||||||
return IMAGE_INIT_FAIL;
|
return IMAGE_INIT_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ static void log_quickload(running_machine &machine, const char *type, UINT32 sta
|
|||||||
tempstring.catprintf(exec_format, exec);
|
tempstring.catprintf(exec_format, exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
machine.ui().popup_time(10, "%s", tempstring.cstr());
|
machine.ui().popup_time(10, "%s", tempstring.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
|
@ -377,7 +377,7 @@ DEVICE_IMAGE_LOAD_MEMBER( thomson_state, to7_cartridge )
|
|||||||
{
|
{
|
||||||
astring errmsg;
|
astring errmsg;
|
||||||
errmsg.printf("Invalid cartridge size %u", size);
|
errmsg.printf("Invalid cartridge size %u", size);
|
||||||
image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.cstr());
|
image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.c_str());
|
||||||
return IMAGE_INIT_FAIL;
|
return IMAGE_INIT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1518,7 +1518,7 @@ DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge )
|
|||||||
{
|
{
|
||||||
astring errmsg;
|
astring errmsg;
|
||||||
errmsg.printf("Invalid cartridge size %" I64FMT "d", size);
|
errmsg.printf("Invalid cartridge size %" I64FMT "d", size);
|
||||||
image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.cstr());
|
image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.c_str());
|
||||||
return IMAGE_INIT_FAIL;
|
return IMAGE_INIT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1227,7 +1227,7 @@ bool ti99_cartridge_device::call_load()
|
|||||||
{
|
{
|
||||||
// File name is in m_basename
|
// File name is in m_basename
|
||||||
// return true = error
|
// return true = error
|
||||||
if (VERBOSE>8) LOG("cartridge_device: loading %s in slot %s\n", m_basename.cstr(), tag());
|
if (VERBOSE>8) LOG("cartridge_device: loading %s in slot %s\n", m_basename.c_str(), tag());
|
||||||
|
|
||||||
if (m_softlist)
|
if (m_softlist)
|
||||||
{
|
{
|
||||||
@ -2286,7 +2286,7 @@ rpk_socket* rpk_reader::load_ram_resource(emu_options &options, xml_data_node* r
|
|||||||
throw rpk_exception(RPK_INVALID_RAM_SPEC, "<ram type='persistent'> must have a 'file' attribute");
|
throw rpk_exception(RPK_INVALID_RAM_SPEC, "<ram type='persistent'> must have a 'file' attribute");
|
||||||
}
|
}
|
||||||
astring ram_pathname(system_name, PATH_SEPARATOR, ram_filename);
|
astring ram_pathname(system_name, PATH_SEPARATOR, ram_filename);
|
||||||
ram_pname = core_strdup(ram_pathname.cstr());
|
ram_pname = core_strdup(ram_pathname.c_str());
|
||||||
// load, and fill rest with 00
|
// load, and fill rest with 00
|
||||||
if (VERBOSE>6) LOG("gromport/RPK: Loading NVRAM contents from '%s'\n", ram_pname);
|
if (VERBOSE>6) LOG("gromport/RPK: Loading NVRAM contents from '%s'\n", ram_pname);
|
||||||
image_battery_load_by_name(options, ram_pname, contents, length, 0x00);
|
image_battery_load_by_name(options, ram_pname, contents, length, 0x00);
|
||||||
|
@ -510,7 +510,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (m_detail==NULL) return error_text[(int)m_err];
|
if (m_detail==NULL) return error_text[(int)m_err];
|
||||||
astring errormsg(error_text[(int)m_err], ": ", m_detail);
|
astring errormsg(error_text[(int)m_err], ": ", m_detail);
|
||||||
return core_strdup(errormsg.cstr());
|
return core_strdup(errormsg.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -114,7 +114,7 @@ void DeviceInformationWindowQtConfig::applyToQWidget(QWidget* widget)
|
|||||||
{
|
{
|
||||||
WindowQtConfig::applyToQWidget(widget);
|
WindowQtConfig::applyToQWidget(widget);
|
||||||
DeviceInformationWindow* window = dynamic_cast<DeviceInformationWindow*>(widget);
|
DeviceInformationWindow* window = dynamic_cast<DeviceInformationWindow*>(widget);
|
||||||
window->set_device(m_device_tag.cstr());
|
window->set_device(m_device_tag.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ void MainWindow::setProcessor(device_t* processor)
|
|||||||
// Window title
|
// Window title
|
||||||
astring title;
|
astring title;
|
||||||
title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag());
|
title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag());
|
||||||
setWindowTitle(title.cstr());
|
setWindowTitle(title.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ void MainWindow::createImagesMenu()
|
|||||||
astring menuName;
|
astring menuName;
|
||||||
menuName.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]");
|
menuName.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]");
|
||||||
|
|
||||||
QMenu* interfaceMenu = imagesMenu->addMenu(menuName.cstr());
|
QMenu* interfaceMenu = imagesMenu->addMenu(menuName.c_str());
|
||||||
interfaceMenu->setObjectName(img->device().name());
|
interfaceMenu->setObjectName(img->device().name());
|
||||||
|
|
||||||
QAction* mountAct = new QAction("Mount...", interfaceMenu);
|
QAction* mountAct = new QAction("Mount...", interfaceMenu);
|
||||||
|
@ -54,7 +54,7 @@ bool osd_font_osx::open(const char *font_path, const char *_name, int &height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CTFontRef ct_font = NULL;
|
CTFontRef ct_font = NULL;
|
||||||
CFStringRef const font_name = CFStringCreateWithCString(NULL, name.cstr(), kCFStringEncodingUTF8);
|
CFStringRef const font_name = CFStringCreateWithCString(NULL, name.c_str(), kCFStringEncodingUTF8);
|
||||||
if (font_name != NULL)
|
if (font_name != NULL)
|
||||||
{
|
{
|
||||||
CTFontDescriptorRef const font_descriptor = CTFontDescriptorCreateWithNameAndSize(font_name, 0.0);
|
CTFontDescriptorRef const font_descriptor = CTFontDescriptorCreateWithNameAndSize(font_name, 0.0);
|
||||||
@ -68,7 +68,7 @@ bool osd_font_osx::open(const char *font_path, const char *_name, int &height)
|
|||||||
|
|
||||||
if (!ct_font)
|
if (!ct_font)
|
||||||
{
|
{
|
||||||
osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.cstr());
|
osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
|
|||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
{
|
{
|
||||||
osd_printf_verbose("Searching font %s in -%s\n", name.cstr(), OPTION_FONTPATH);
|
osd_printf_verbose("Searching font %s in -%s\n", name.c_str(), OPTION_FONTPATH);
|
||||||
//emu_file file(options().font_path(), OPEN_FLAG_READ);
|
//emu_file file(options().font_path(), OPEN_FLAG_READ);
|
||||||
emu_file file(font_path, OPEN_FLAG_READ);
|
emu_file file(font_path, OPEN_FLAG_READ);
|
||||||
if (file.open(name) == FILERR_NONE)
|
if (file.open(name) == FILERR_NONE)
|
||||||
@ -80,7 +80,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
|
|||||||
astring full_name = file.fullpath();
|
astring full_name = file.fullpath();
|
||||||
font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
|
font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
|
||||||
if (font)
|
if (font)
|
||||||
osd_printf_verbose("Found font %s\n", full_name.cstr());
|
osd_printf_verbose("Found font %s\n", full_name.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
|
|||||||
{
|
{
|
||||||
if (!BDF_Check_Magic(name))
|
if (!BDF_Check_Magic(name))
|
||||||
{
|
{
|
||||||
osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.cstr());
|
osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.c_str());
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(astring name, int fsize)
|
|||||||
if (memcmp(buffer, magic, 5))
|
if (memcmp(buffer, magic, 5))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return TTF_OpenFont(name.cstr(), POINT_SIZE);
|
return TTF_OpenFont(name.c_str(), POINT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool osd_font_sdl::BDF_Check_Magic(astring name)
|
bool osd_font_sdl::BDF_Check_Magic(astring name)
|
||||||
@ -227,7 +227,7 @@ TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic,
|
|||||||
config = FcConfigGetCurrent();
|
config = FcConfigGetCurrent();
|
||||||
pat = FcPatternCreate();
|
pat = FcPatternCreate();
|
||||||
os = FcObjectSetCreate();
|
os = FcObjectSetCreate();
|
||||||
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
|
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.c_str());
|
||||||
|
|
||||||
// try and get a font with the requested styles baked-in
|
// try and get a font with the requested styles baked-in
|
||||||
if (bold)
|
if (bold)
|
||||||
@ -287,7 +287,7 @@ TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic,
|
|||||||
FcFontSetDestroy(fontset);
|
FcFontSetDestroy(fontset);
|
||||||
|
|
||||||
pat = FcPatternCreate();
|
pat = FcPatternCreate();
|
||||||
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
|
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.c_str());
|
||||||
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
|
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
|
||||||
FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
|
FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
|
||||||
fontset = FcFontList(config, pat, os);
|
fontset = FcFontList(config, pat, os);
|
||||||
|
@ -260,7 +260,7 @@ void osd_common_t::update_option(const char * key, dynamic_array<const char *> &
|
|||||||
new_option_value.cat(t);
|
new_option_value.cat(t);
|
||||||
}
|
}
|
||||||
// TODO: core_strdup() is leaked
|
// TODO: core_strdup() is leaked
|
||||||
m_options.set_description(key, core_strdup(current_value.cat(new_option_value).cstr()));
|
m_options.set_description(key, core_strdup(current_value.cat(new_option_value).c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ private:
|
|||||||
opt_val = "";
|
opt_val = "";
|
||||||
else if (!m_mod_man.type_has_name(opt_name, opt_val))
|
else if (!m_mod_man.type_has_name(opt_name, opt_val))
|
||||||
{
|
{
|
||||||
osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val.cstr(), opt_name.cstr());
|
osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val.c_str(), opt_name.c_str());
|
||||||
opt_val = "";
|
opt_val = "";
|
||||||
}
|
}
|
||||||
return m_mod_man.select_module(opt_name, opt_val);
|
return m_mod_man.select_module(opt_name, opt_val);
|
||||||
|
@ -3489,7 +3489,7 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp
|
|||||||
for (int seq = 0; ; seq++)
|
for (int seq = 0; ; seq++)
|
||||||
{
|
{
|
||||||
// build up the filename
|
// build up the filename
|
||||||
fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d_%d", seq, idx).cstr());
|
fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d_%d", seq, idx).c_str());
|
||||||
|
|
||||||
// try to open the file; stop when we fail
|
// try to open the file; stop when we fail
|
||||||
file_error filerr = file.open(fname);
|
file_error filerr = file.open(fname);
|
||||||
|
@ -742,7 +742,7 @@ static void sdlinput_register_joysticks(running_machine &machine)
|
|||||||
|
|
||||||
devinfo->joystick.device = joy;
|
devinfo->joystick.device = joy;
|
||||||
|
|
||||||
osd_printf_verbose("Joystick: %s\n", devinfo->name.cstr());
|
osd_printf_verbose("Joystick: %s\n", devinfo->name.c_str());
|
||||||
osd_printf_verbose("Joystick: ... %d axes, %d buttons %d hats %d balls\n", SDL_JoystickNumAxes(joy), SDL_JoystickNumButtons(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumBalls(joy));
|
osd_printf_verbose("Joystick: ... %d axes, %d buttons %d hats %d balls\n", SDL_JoystickNumAxes(joy), SDL_JoystickNumButtons(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumBalls(joy));
|
||||||
osd_printf_verbose("Joystick: ... Physical id %d mapped to logical id %d\n", physical_stick, stick + 1);
|
osd_printf_verbose("Joystick: ... Physical id %d mapped to logical id %d\n", physical_stick, stick + 1);
|
||||||
|
|
||||||
@ -758,7 +758,7 @@ static void sdlinput_register_joysticks(running_machine &machine)
|
|||||||
else
|
else
|
||||||
itemid = ITEM_ID_OTHER_AXIS_ABSOLUTE;
|
itemid = ITEM_ID_OTHER_AXIS_ABSOLUTE;
|
||||||
|
|
||||||
sprintf(tempname, "A%d %s", axis, devinfo->name.cstr());
|
sprintf(tempname, "A%d %s", axis, devinfo->name.c_str());
|
||||||
devinfo->device->add_item(tempname, itemid, generic_axis_get_state, &devinfo->joystick.axes[axis]);
|
devinfo->device->add_item(tempname, itemid, generic_axis_get_state, &devinfo->joystick.axes[axis]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,9 +809,9 @@ static void sdlinput_register_joysticks(running_machine &machine)
|
|||||||
else
|
else
|
||||||
itemid = ITEM_ID_OTHER_AXIS_RELATIVE;
|
itemid = ITEM_ID_OTHER_AXIS_RELATIVE;
|
||||||
|
|
||||||
sprintf(tempname, "R%d %s", ball * 2, devinfo->name.cstr());
|
sprintf(tempname, "R%d %s", ball * 2, devinfo->name.c_str());
|
||||||
devinfo->device->add_item(tempname, (input_item_id) itemid, generic_axis_get_state, &devinfo->joystick.balls[ball * 2]);
|
devinfo->device->add_item(tempname, (input_item_id) itemid, generic_axis_get_state, &devinfo->joystick.balls[ball * 2]);
|
||||||
sprintf(tempname, "R%d %s", ball * 2 + 1, devinfo->name.cstr());
|
sprintf(tempname, "R%d %s", ball * 2 + 1, devinfo->name.c_str());
|
||||||
devinfo->device->add_item(tempname, (input_item_id) (itemid + 1), generic_axis_get_state, &devinfo->joystick.balls[ball * 2 + 1]);
|
devinfo->device->add_item(tempname, (input_item_id) (itemid + 1), generic_axis_get_state, &devinfo->joystick.balls[ball * 2 + 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -869,9 +869,9 @@ static void sdlinput_register_mice(running_machine &machine)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// add the axes
|
// add the axes
|
||||||
sprintf(defname, "X %s", devinfo->name.cstr());
|
sprintf(defname, "X %s", devinfo->name.c_str());
|
||||||
devinfo->device->add_item(defname, ITEM_ID_XAXIS, generic_axis_get_state, &devinfo->mouse.lX);
|
devinfo->device->add_item(defname, ITEM_ID_XAXIS, generic_axis_get_state, &devinfo->mouse.lX);
|
||||||
sprintf(defname, "Y %s", devinfo->name.cstr());
|
sprintf(defname, "Y %s", devinfo->name.c_str());
|
||||||
devinfo->device->add_item(defname, ITEM_ID_YAXIS, generic_axis_get_state, &devinfo->mouse.lY);
|
devinfo->device->add_item(defname, ITEM_ID_YAXIS, generic_axis_get_state, &devinfo->mouse.lY);
|
||||||
|
|
||||||
for (button = 0; button < 4; button++)
|
for (button = 0; button < 4; button++)
|
||||||
@ -886,7 +886,7 @@ static void sdlinput_register_mice(running_machine &machine)
|
|||||||
|
|
||||||
if (0 && mouse_enabled)
|
if (0 && mouse_enabled)
|
||||||
SDL_SetRelativeMouseMode(index, SDL_TRUE);
|
SDL_SetRelativeMouseMode(index, SDL_TRUE);
|
||||||
osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.cstr());
|
osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.c_str());
|
||||||
}
|
}
|
||||||
osd_printf_verbose("Mouse: End initialization\n");
|
osd_printf_verbose("Mouse: End initialization\n");
|
||||||
}
|
}
|
||||||
@ -903,7 +903,7 @@ static void sdlinput_register_mice(running_machine &machine)
|
|||||||
|
|
||||||
// SDL 1.2 has only 1 mouse - 1.3+ will also change that, so revisit this then
|
// SDL 1.2 has only 1 mouse - 1.3+ will also change that, so revisit this then
|
||||||
devinfo = generic_device_alloc(&mouse_list, "System mouse");
|
devinfo = generic_device_alloc(&mouse_list, "System mouse");
|
||||||
devinfo->device = machine.input().device_class(DEVICE_CLASS_MOUSE).add_device(devinfo->name.cstr(), devinfo);
|
devinfo->device = machine.input().device_class(DEVICE_CLASS_MOUSE).add_device(devinfo->name.c_str(), devinfo);
|
||||||
|
|
||||||
mouse_enabled = machine.options().mouse();
|
mouse_enabled = machine.options().mouse();
|
||||||
|
|
||||||
@ -919,7 +919,7 @@ static void sdlinput_register_mice(running_machine &machine)
|
|||||||
devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->mouse.buttons[button]);
|
devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->mouse.buttons[button]);
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.cstr());
|
osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.c_str());
|
||||||
osd_printf_verbose("Mouse: End initialization\n");
|
osd_printf_verbose("Mouse: End initialization\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1126,9 +1126,9 @@ static void sdlinput_register_lightguns(running_machine &machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sprintf(defname, "X %s", devinfo->name.cstr());
|
sprintf(defname, "X %s", devinfo->name.c_str());
|
||||||
devinfo->device->add_item(defname, ITEM_ID_XAXIS, generic_axis_get_state, &devinfo->lightgun.lX);
|
devinfo->device->add_item(defname, ITEM_ID_XAXIS, generic_axis_get_state, &devinfo->lightgun.lX);
|
||||||
sprintf(defname, "Y %s", devinfo->name.cstr());
|
sprintf(defname, "Y %s", devinfo->name.c_str());
|
||||||
devinfo->device->add_item(defname, ITEM_ID_YAXIS, generic_axis_get_state, &devinfo->lightgun.lY);
|
devinfo->device->add_item(defname, ITEM_ID_YAXIS, generic_axis_get_state, &devinfo->lightgun.lY);
|
||||||
|
|
||||||
|
|
||||||
@ -1325,7 +1325,7 @@ static void sdlinput_register_keyboards(running_machine &machine)
|
|||||||
devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)]);
|
devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.cstr());
|
osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.c_str());
|
||||||
}
|
}
|
||||||
osd_printf_verbose("Keyboard: End initialization\n");
|
osd_printf_verbose("Keyboard: End initialization\n");
|
||||||
}
|
}
|
||||||
@ -1346,7 +1346,7 @@ static void sdlinput_register_keyboards(running_machine &machine)
|
|||||||
// SDL 1.2 only has 1 keyboard (1.3+ will have multiple, this must be revisited then)
|
// SDL 1.2 only has 1 keyboard (1.3+ will have multiple, this must be revisited then)
|
||||||
// add it now
|
// add it now
|
||||||
devinfo = generic_device_alloc(&keyboard_list, "System keyboard");
|
devinfo = generic_device_alloc(&keyboard_list, "System keyboard");
|
||||||
devinfo->device = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device(devinfo->name.cstr(), devinfo);
|
devinfo->device = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device(devinfo->name.c_str(), devinfo);
|
||||||
|
|
||||||
// populate it
|
// populate it
|
||||||
for (keynum = 0; sdl_key_trans_table[keynum].mame_key != ITEM_ID_INVALID; keynum++)
|
for (keynum = 0; sdl_key_trans_table[keynum].mame_key != ITEM_ID_INVALID; keynum++)
|
||||||
@ -1363,7 +1363,7 @@ static void sdlinput_register_keyboards(running_machine &machine)
|
|||||||
devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)]);
|
devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.cstr());
|
osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.c_str());
|
||||||
osd_printf_verbose("Keyboard: End initialization\n");
|
osd_printf_verbose("Keyboard: End initialization\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1742,7 +1742,7 @@ void sdlinput_poll(running_machine &machine)
|
|||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
#ifdef SDL2_MULTIAPI
|
#ifdef SDL2_MULTIAPI
|
||||||
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[event.key.which]);
|
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[event.key.which]);
|
||||||
//printf("Key down %d %d %s => %d %s (scrlock keycode is %d)\n", event.key.which, event.key.keysym.scancode, devinfo->name.cstr(), OSD_SDL_INDEX_KEYSYM(&event.key.keysym), sdl_key_trans_table[event.key.keysym.scancode].mame_key_name, KEYCODE_SCRLOCK);
|
//printf("Key down %d %d %s => %d %s (scrlock keycode is %d)\n", event.key.which, event.key.keysym.scancode, devinfo->name.c_str(), OSD_SDL_INDEX_KEYSYM(&event.key.keysym), sdl_key_trans_table[event.key.keysym.scancode].mame_key_name, KEYCODE_SCRLOCK);
|
||||||
#else
|
#else
|
||||||
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]);
|
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]);
|
||||||
#endif
|
#endif
|
||||||
@ -1841,7 +1841,7 @@ void sdlinput_poll(running_machine &machine)
|
|||||||
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[0]);
|
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[0]);
|
||||||
#endif
|
#endif
|
||||||
devinfo->mouse.buttons[event.button.button-1] = 0x80;
|
devinfo->mouse.buttons[event.button.button-1] = 0x80;
|
||||||
//printf("But down %d %d %d %d %s\n", event.button.which, event.button.button, event.button.x, event.button.y, devinfo->name.cstr());
|
//printf("But down %d %d %d %d %s\n", event.button.which, event.button.button, event.button.x, event.button.y, devinfo->name.c_str());
|
||||||
if (event.button.button == 1)
|
if (event.button.button == 1)
|
||||||
{
|
{
|
||||||
// FIXME Move static declaration
|
// FIXME Move static declaration
|
||||||
@ -1899,7 +1899,7 @@ void sdlinput_poll(running_machine &machine)
|
|||||||
#endif
|
#endif
|
||||||
#if (SDLMAME_SDL2)
|
#if (SDLMAME_SDL2)
|
||||||
// FIXME: may apply to 1.2 as well ...
|
// FIXME: may apply to 1.2 as well ...
|
||||||
//printf("Motion %d %d %d %s\n", event.motion.which, event.motion.x, event.motion.y, devinfo->name.cstr());
|
//printf("Motion %d %d %d %s\n", event.motion.which, event.motion.x, event.motion.y, devinfo->name.c_str());
|
||||||
devinfo->mouse.lX += event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
|
devinfo->mouse.lX += event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
|
||||||
devinfo->mouse.lY += event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
|
devinfo->mouse.lY += event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
|
||||||
#else
|
#else
|
||||||
|
@ -212,7 +212,7 @@ sdl_options::sdl_options()
|
|||||||
astring ini_path(INI_PATH);
|
astring ini_path(INI_PATH);
|
||||||
add_entries(sdl_options::s_option_entries);
|
add_entries(sdl_options::s_option_entries);
|
||||||
ini_path.replace(0, "APP_NAME", emulator_info::get_appname_lower());
|
ini_path.replace(0, "APP_NAME", emulator_info::get_appname_lower());
|
||||||
set_default_value(SDLOPTION_INIPATH, ini_path.cstr());
|
set_default_value(SDLOPTION_INIPATH, ini_path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
|
@ -327,7 +327,7 @@ public:
|
|||||||
m_lastfile = m_info.track[tracknum].fname;
|
m_lastfile = m_info.track[tracknum].fname;
|
||||||
file_error filerr = core_fopen(m_lastfile, OPEN_FLAG_READ, &m_file);
|
file_error filerr = core_fopen(m_lastfile, OPEN_FLAG_READ, &m_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Error opening input file (%s)'", m_lastfile.cstr());
|
report_error(1, "Error opening input file (%s)'", m_lastfile.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterate over frames
|
// iterate over frames
|
||||||
@ -351,7 +351,7 @@ public:
|
|||||||
core_fseek(m_file, src_frame_start, SEEK_SET);
|
core_fseek(m_file, src_frame_start, SEEK_SET);
|
||||||
UINT32 count = core_fread(m_file, dest, bytesperframe);
|
UINT32 count = core_fread(m_file, dest, bytesperframe);
|
||||||
if (count != bytesperframe)
|
if (count != bytesperframe)
|
||||||
report_error(1, "Error reading input file (%s)'", m_lastfile.cstr());
|
report_error(1, "Error reading input file (%s)'", m_lastfile.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// swap if appropriate
|
// swap if appropriate
|
||||||
@ -940,7 +940,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp
|
|||||||
{
|
{
|
||||||
chd_error err = input_parent_chd.open(*input_chd_parent_str);
|
chd_error err = input_parent_chd.open(*input_chd_parent_str);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error opening parent CHD file (%s): %s", input_chd_parent_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error opening parent CHD file (%s): %s", input_chd_parent_str->c_str(), chd_file::error_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
// process input file
|
// process input file
|
||||||
@ -949,7 +949,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp
|
|||||||
{
|
{
|
||||||
chd_error err = input_chd.open(*input_chd_str, writeable, input_parent_chd.opened() ? &input_parent_chd : NULL);
|
chd_error err = input_chd.open(*input_chd_str, writeable, input_parent_chd.opened() ? &input_parent_chd : NULL);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error opening CHD file (%s): %s", input_chd_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error opening CHD file (%s): %s", input_chd_str->c_str(), chd_file::error_string(err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1028,7 +1028,7 @@ static astring *parse_output_chd_parameters(const parameters_t ¶ms, chd_file
|
|||||||
{
|
{
|
||||||
chd_error err = output_parent_chd.open(*output_chd_parent_str);
|
chd_error err = output_parent_chd.open(*output_chd_parent_str);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error opening parent CHD file (%s): %s", output_chd_parent_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error opening parent CHD file (%s): %s", output_chd_parent_str->c_str(), chd_file::error_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
// process output file
|
// process output file
|
||||||
@ -1083,10 +1083,10 @@ static void parse_compression(const parameters_t ¶ms, chd_codec_type compres
|
|||||||
{
|
{
|
||||||
astring name(*compression_str, start, (end == -1) ? -1 : end - start);
|
astring name(*compression_str, start, (end == -1) ? -1 : end - start);
|
||||||
if (name.len() != 4)
|
if (name.len() != 4)
|
||||||
report_error(1, "Invalid compressor '%s' specified", name.cstr());
|
report_error(1, "Invalid compressor '%s' specified", name.c_str());
|
||||||
chd_codec_type type = CHD_MAKE_TAG(name[0], name[1], name[2], name[3]);
|
chd_codec_type type = CHD_MAKE_TAG(name[0], name[1], name[2], name[3]);
|
||||||
if (!chd_codec_list::codec_exists(type))
|
if (!chd_codec_list::codec_exists(type))
|
||||||
report_error(1, "Invalid compressor '%s' specified", name.cstr());
|
report_error(1, "Invalid compressor '%s' specified", name.c_str());
|
||||||
compression[index++] = type;
|
compression[index++] = type;
|
||||||
if (end == -1)
|
if (end == -1)
|
||||||
break;
|
break;
|
||||||
@ -1258,7 +1258,7 @@ void output_track_metadata(int mode, core_file *file, int tracknum, const cdrom_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// output TRACK entry
|
// output TRACK entry
|
||||||
core_fprintf(file, " TRACK %02d %s\n", tracknum + 1, tempstr.cstr());
|
core_fprintf(file, " TRACK %02d %s\n", tracknum + 1, tempstr.c_str());
|
||||||
|
|
||||||
// output PREGAP tag if pregap sectors are not in the file
|
// output PREGAP tag if pregap sectors are not in the file
|
||||||
if ((info.pregap > 0) && (info.pgdatasize == 0))
|
if ((info.pregap > 0) && (info.pgdatasize == 0))
|
||||||
@ -1296,7 +1296,7 @@ void output_track_metadata(int mode, core_file *file, int tracknum, const cdrom_
|
|||||||
modesubmode.format("%s %s", cdrom_get_type_string(info.trktype), cdrom_get_subtype_string(info.subtype));
|
modesubmode.format("%s %s", cdrom_get_type_string(info.trktype), cdrom_get_subtype_string(info.subtype));
|
||||||
else
|
else
|
||||||
modesubmode.format("%s", cdrom_get_type_string(info.trktype));
|
modesubmode.format("%s", cdrom_get_type_string(info.trktype));
|
||||||
core_fprintf(file, "TRACK %s\n", modesubmode.cstr());
|
core_fprintf(file, "TRACK %s\n", modesubmode.c_str());
|
||||||
|
|
||||||
// write out the attributes
|
// write out the attributes
|
||||||
core_fprintf(file, "NO COPY\n");
|
core_fprintf(file, "NO COPY\n");
|
||||||
@ -1309,7 +1309,7 @@ void output_track_metadata(int mode, core_file *file, int tracknum, const cdrom_
|
|||||||
// output pregap
|
// output pregap
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
if (info.pregap > 0)
|
if (info.pregap > 0)
|
||||||
core_fprintf(file, "ZERO %s %s\n", modesubmode.cstr(), msf_string_from_frames(tempstr, info.pregap));
|
core_fprintf(file, "ZERO %s %s\n", modesubmode.c_str(), msf_string_from_frames(tempstr, info.pregap));
|
||||||
|
|
||||||
// all tracks but the first one have a file offset
|
// all tracks but the first one have a file offset
|
||||||
if (tracknum > 0)
|
if (tracknum > 0)
|
||||||
@ -1340,7 +1340,7 @@ static void do_info(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print filename and version
|
// print filename and version
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Input file: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input file: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
printf("File Version: %d\n", input_chd.version());
|
printf("File Version: %d\n", input_chd.version());
|
||||||
if (input_chd.version() < 3)
|
if (input_chd.version() < 3)
|
||||||
report_error(1, "Unsupported version (%d); use an older chdman to upgrade to version 3 or later", input_chd.version());
|
report_error(1, "Unsupported version (%d); use an older chdman to upgrade to version 3 or later", input_chd.version());
|
||||||
@ -1504,7 +1504,7 @@ static void do_verify(parameters_t ¶ms)
|
|||||||
UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_chd.logical_bytes() - offset);
|
UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_chd.logical_bytes() - offset);
|
||||||
chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
|
chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
|
report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// add to the checksum
|
// add to the checksum
|
||||||
rawsha1.append(buffer, bytes_to_read);
|
rawsha1.append(buffer, bytes_to_read);
|
||||||
@ -1568,7 +1568,7 @@ static void do_create_raw(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
|
file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", input_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", input_file_str->c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// process output CHD
|
// process output CHD
|
||||||
@ -1604,10 +1604,10 @@ static void do_create_raw(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output CHD: %s\n", output_chd_str->cstr());
|
printf("Output CHD: %s\n", output_chd_str->c_str());
|
||||||
if (output_parent.opened())
|
if (output_parent.opened())
|
||||||
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
|
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
|
||||||
printf("Input file: %s\n", input_file_str->cstr());
|
printf("Input file: %s\n", input_file_str->c_str());
|
||||||
if (input_start != 0 || input_end != core_fsize(input_file))
|
if (input_start != 0 || input_end != core_fsize(input_file))
|
||||||
{
|
{
|
||||||
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
||||||
@ -1629,7 +1629,7 @@ static void do_create_raw(parameters_t ¶ms)
|
|||||||
else
|
else
|
||||||
err = chd->create(*output_chd_str, input_end - input_start, hunk_size, unit_size, compression);
|
err = chd->create(*output_chd_str, input_end - input_start, hunk_size, unit_size, compression);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// if we have a parent, copy forward all the metadata
|
// if we have a parent, copy forward all the metadata
|
||||||
if (output_parent.opened())
|
if (output_parent.opened())
|
||||||
@ -1665,7 +1665,7 @@ static void do_create_hd(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
|
file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", input_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", input_file_str->c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// process output CHD
|
// process output CHD
|
||||||
@ -1740,11 +1740,11 @@ static void do_create_hd(parameters_t ¶ms)
|
|||||||
// load the file
|
// load the file
|
||||||
file_error filerr = core_fload(*ident_str, identdata);
|
file_error filerr = core_fload(*ident_str, identdata);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Error reading ident file (%s)", ident_str->cstr());
|
report_error(1, "Error reading ident file (%s)", ident_str->c_str());
|
||||||
|
|
||||||
// must be at least 14 bytes; extract CHS data from there
|
// must be at least 14 bytes; extract CHS data from there
|
||||||
if (identdata.count() < 14)
|
if (identdata.count() < 14)
|
||||||
report_error(1, "Ident file '%s' is invalid (too short)", ident_str->cstr());
|
report_error(1, "Ident file '%s' is invalid (too short)", ident_str->c_str());
|
||||||
cylinders = (identdata[3] << 8) | identdata[2];
|
cylinders = (identdata[3] << 8) | identdata[2];
|
||||||
heads = (identdata[7] << 8) | identdata[6];
|
heads = (identdata[7] << 8) | identdata[6];
|
||||||
sectors = (identdata[13] << 8) | identdata[12];
|
sectors = (identdata[13] << 8) | identdata[12];
|
||||||
@ -1775,12 +1775,12 @@ static void do_create_hd(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output CHD: %s\n", output_chd_str->cstr());
|
printf("Output CHD: %s\n", output_chd_str->c_str());
|
||||||
if (output_parent.opened())
|
if (output_parent.opened())
|
||||||
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
|
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
|
||||||
if (input_file != NULL)
|
if (input_file != NULL)
|
||||||
{
|
{
|
||||||
printf("Input file: %s\n", input_file_str->cstr());
|
printf("Input file: %s\n", input_file_str->c_str());
|
||||||
if (input_start != 0 || input_end != core_fsize(input_file))
|
if (input_start != 0 || input_end != core_fsize(input_file))
|
||||||
{
|
{
|
||||||
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
||||||
@ -1807,7 +1807,7 @@ static void do_create_hd(parameters_t ¶ms)
|
|||||||
else
|
else
|
||||||
err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(sector_size), hunk_size, sector_size, compression);
|
err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(sector_size), hunk_size, sector_size, compression);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// add the standard hard disk metadata
|
// add the standard hard disk metadata
|
||||||
astring metadata;
|
astring metadata;
|
||||||
@ -1856,7 +1856,7 @@ static void do_create_cd(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
chd_error err = chdcd_parse_toc(*input_file_str, toc, track_info);
|
chd_error err = chdcd_parse_toc(*input_file_str, toc, track_info);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error parsing input file (%s: %s)\n", input_file_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error parsing input file (%s: %s)\n", input_file_str->c_str(), chd_file::error_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
// process output CHD
|
// process output CHD
|
||||||
@ -1889,10 +1889,10 @@ static void do_create_cd(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output CHD: %s\n", output_chd_str->cstr());
|
printf("Output CHD: %s\n", output_chd_str->c_str());
|
||||||
if (output_parent.opened())
|
if (output_parent.opened())
|
||||||
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
|
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
|
||||||
printf("Input file: %s\n", input_file_str->cstr());
|
printf("Input file: %s\n", input_file_str->c_str());
|
||||||
printf("Input tracks: %d\n", toc.numtrks);
|
printf("Input tracks: %d\n", toc.numtrks);
|
||||||
printf("Input length: %s\n", msf_string_from_frames(tempstr, origtotalsectors));
|
printf("Input length: %s\n", msf_string_from_frames(tempstr, origtotalsectors));
|
||||||
printf("Compression: %s\n", compression_string(tempstr, compression));
|
printf("Compression: %s\n", compression_string(tempstr, compression));
|
||||||
@ -1910,7 +1910,7 @@ static void do_create_cd(parameters_t ¶ms)
|
|||||||
else
|
else
|
||||||
err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, CD_FRAME_SIZE, compression);
|
err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, CD_FRAME_SIZE, compression);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// add the standard CD metadata; we do this even if we have a parent because it might be different
|
// add the standard CD metadata; we do this even if we have a parent because it might be different
|
||||||
err = cdrom_write_metadata(chd, &toc);
|
err = cdrom_write_metadata(chd, &toc);
|
||||||
@ -1947,7 +1947,7 @@ static void do_create_ld(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
avi_error avierr = avi_open(*input_file_str, &input_file);
|
avi_error avierr = avi_open(*input_file_str, &input_file);
|
||||||
if (avierr != AVIERR_NONE)
|
if (avierr != AVIERR_NONE)
|
||||||
report_error(1, "Error opening AVI file (%s): %s\n", input_file_str->cstr(), avi_error_string(avierr));
|
report_error(1, "Error opening AVI file (%s): %s\n", input_file_str->c_str(), avi_error_string(avierr));
|
||||||
}
|
}
|
||||||
const avi_movie_info *aviinfo = avi_get_movie_info(input_file);
|
const avi_movie_info *aviinfo = avi_get_movie_info(input_file);
|
||||||
|
|
||||||
@ -1999,10 +1999,10 @@ static void do_create_ld(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output CHD: %s\n", output_chd_str->cstr());
|
printf("Output CHD: %s\n", output_chd_str->c_str());
|
||||||
if (output_parent.opened())
|
if (output_parent.opened())
|
||||||
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
|
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
|
||||||
printf("Input file: %s\n", input_file_str->cstr());
|
printf("Input file: %s\n", input_file_str->c_str());
|
||||||
if (input_start != 0 && input_end != aviinfo->video_numsamples)
|
if (input_start != 0 && input_end != aviinfo->video_numsamples)
|
||||||
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
||||||
printf("Input length: %s (%02d:%02d:%02d)\n", big_int_string(tempstr, input_end - input_start),
|
printf("Input length: %s (%02d:%02d:%02d)\n", big_int_string(tempstr, input_end - input_start),
|
||||||
@ -2028,7 +2028,7 @@ static void do_create_ld(parameters_t ¶ms)
|
|||||||
else
|
else
|
||||||
err = chd->create(*output_chd_str, UINT64(input_end - input_start) * hunk_size, hunk_size, info.bytes_per_frame, compression);
|
err = chd->create(*output_chd_str, UINT64(input_end - input_start) * hunk_size, hunk_size, info.bytes_per_frame, compression);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// write the core A/V metadata
|
// write the core A/V metadata
|
||||||
astring metadata;
|
astring metadata;
|
||||||
@ -2112,10 +2112,10 @@ static void do_copy(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output CHD: %s\n", output_chd_str->cstr());
|
printf("Output CHD: %s\n", output_chd_str->c_str());
|
||||||
if (output_parent.opened())
|
if (output_parent.opened())
|
||||||
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
|
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
|
||||||
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
if (input_start != 0 || input_end != input_chd.logical_bytes())
|
if (input_start != 0 || input_end != input_chd.logical_bytes())
|
||||||
{
|
{
|
||||||
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
||||||
@ -2137,7 +2137,7 @@ static void do_copy(parameters_t ¶ms)
|
|||||||
else
|
else
|
||||||
err = chd->create(*output_chd_str, input_end - input_start, hunk_size, input_chd.unit_bytes(), compression);
|
err = chd->create(*output_chd_str, input_end - input_start, hunk_size, input_chd.unit_bytes(), compression);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
|
report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// clone all the metadata, upgrading where appropriate
|
// clone all the metadata, upgrading where appropriate
|
||||||
dynamic_buffer metadata;
|
dynamic_buffer metadata;
|
||||||
@ -2221,8 +2221,8 @@ static void do_extract_raw(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output File: %s\n", output_file_str->cstr());
|
printf("Output File: %s\n", output_file_str->c_str());
|
||||||
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
if (input_start != 0 || input_end != input_chd.logical_bytes())
|
if (input_start != 0 || input_end != input_chd.logical_bytes())
|
||||||
{
|
{
|
||||||
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
||||||
@ -2236,7 +2236,7 @@ static void do_extract_raw(parameters_t ¶ms)
|
|||||||
// process output file
|
// process output file
|
||||||
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
|
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", output_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", output_file_str->c_str());
|
||||||
|
|
||||||
// copy all data
|
// copy all data
|
||||||
dynamic_buffer buffer((TEMP_BUFFER_SIZE / input_chd.hunk_bytes()) * input_chd.hunk_bytes());
|
dynamic_buffer buffer((TEMP_BUFFER_SIZE / input_chd.hunk_bytes()) * input_chd.hunk_bytes());
|
||||||
@ -2248,12 +2248,12 @@ static void do_extract_raw(parameters_t ¶ms)
|
|||||||
UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_end - offset);
|
UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_end - offset);
|
||||||
chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
|
chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
|
report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->c_str(), chd_file::error_string(err));
|
||||||
|
|
||||||
// write to the output
|
// write to the output
|
||||||
UINT32 count = core_fwrite(output_file, buffer, bytes_to_read);
|
UINT32 count = core_fwrite(output_file, buffer, bytes_to_read);
|
||||||
if (count != bytes_to_read)
|
if (count != bytes_to_read)
|
||||||
report_error(1, "Error writing to file; check disk space (%s)", output_file_str->cstr());
|
report_error(1, "Error writing to file; check disk space (%s)", output_file_str->c_str());
|
||||||
|
|
||||||
// advance
|
// advance
|
||||||
offset += bytes_to_read;
|
offset += bytes_to_read;
|
||||||
@ -2306,7 +2306,7 @@ static void do_extract_cd(parameters_t ¶ms)
|
|||||||
if (chop != -1)
|
if (chop != -1)
|
||||||
default_name.substr(0, chop);
|
default_name.substr(0, chop);
|
||||||
char basename[128];
|
char basename[128];
|
||||||
strncpy(basename, default_name.cstr(), 127);
|
strncpy(basename, default_name.c_str(), 127);
|
||||||
default_name.cat(".bin");
|
default_name.cat(".bin");
|
||||||
if (output_bin_file_str == NULL)
|
if (output_bin_file_str == NULL)
|
||||||
output_bin_file_str = &default_name;
|
output_bin_file_str = &default_name;
|
||||||
@ -2314,9 +2314,9 @@ static void do_extract_cd(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output TOC: %s\n", output_file_str->cstr());
|
printf("Output TOC: %s\n", output_file_str->c_str());
|
||||||
printf("Output Data: %s\n", output_bin_file_str->cstr());
|
printf("Output Data: %s\n", output_bin_file_str->c_str());
|
||||||
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
|
|
||||||
// catch errors so we can close & delete the output file
|
// catch errors so we can close & delete the output file
|
||||||
core_file *output_bin_file = NULL;
|
core_file *output_bin_file = NULL;
|
||||||
@ -2337,14 +2337,14 @@ static void do_extract_cd(parameters_t ¶ms)
|
|||||||
// process output file
|
// process output file
|
||||||
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &output_toc_file);
|
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &output_toc_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", output_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", output_file_str->c_str());
|
||||||
|
|
||||||
// process output BIN file
|
// process output BIN file
|
||||||
if (mode != MODE_GDI)
|
if (mode != MODE_GDI)
|
||||||
{
|
{
|
||||||
filerr = core_fopen(*output_bin_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
|
filerr = core_fopen(*output_bin_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", output_bin_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", output_bin_file_str->c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine total frames
|
// determine total frames
|
||||||
@ -2384,7 +2384,7 @@ static void do_extract_cd(parameters_t ¶ms)
|
|||||||
|
|
||||||
filerr = core_fopen(trackbin_name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
|
filerr = core_fopen(trackbin_name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", trackbin_name.cstr());
|
report_error(1, "Unable to open file (%s)", trackbin_name.c_str());
|
||||||
|
|
||||||
outputoffs = 0;
|
outputoffs = 0;
|
||||||
}
|
}
|
||||||
@ -2449,7 +2449,7 @@ static void do_extract_cd(parameters_t ¶ms)
|
|||||||
core_fseek(output_bin_file, outputoffs, SEEK_SET);
|
core_fseek(output_bin_file, outputoffs, SEEK_SET);
|
||||||
UINT32 byteswritten = core_fwrite(output_bin_file, buffer, bufferoffs);
|
UINT32 byteswritten = core_fwrite(output_bin_file, buffer, bufferoffs);
|
||||||
if (byteswritten != bufferoffs)
|
if (byteswritten != bufferoffs)
|
||||||
report_error(1, "Error writing frame %d to file (%s): %s\n", frame, output_file_str->cstr(), chd_file::error_string(CHDERR_WRITE_ERROR));
|
report_error(1, "Error writing frame %d to file (%s): %s\n", frame, output_file_str->c_str(), chd_file::error_string(CHDERR_WRITE_ERROR));
|
||||||
outputoffs += bufferoffs;
|
outputoffs += bufferoffs;
|
||||||
bufferoffs = 0;
|
bufferoffs = 0;
|
||||||
}
|
}
|
||||||
@ -2548,8 +2548,8 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Output File: %s\n", output_file_str->cstr());
|
printf("Output File: %s\n", output_file_str->c_str());
|
||||||
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
if (input_start != 0 || input_end != input_chd.hunk_count())
|
if (input_start != 0 || input_end != input_chd.hunk_count())
|
||||||
{
|
{
|
||||||
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
printf("Input start: %s\n", big_int_string(tempstr, input_start));
|
||||||
@ -2563,7 +2563,7 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
// process output file
|
// process output file
|
||||||
avi_error avierr = avi_create(*output_file_str, &info, &output_file);
|
avi_error avierr = avi_create(*output_file_str, &info, &output_file);
|
||||||
if (avierr != AVIERR_NONE)
|
if (avierr != AVIERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", output_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", output_file_str->c_str());
|
||||||
|
|
||||||
// create the codec configuration
|
// create the codec configuration
|
||||||
avhuff_decompress_config avconfig;
|
avhuff_decompress_config avconfig;
|
||||||
@ -2592,7 +2592,7 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
{
|
{
|
||||||
UINT64 filepos = core_ftell(input_chd);
|
UINT64 filepos = core_ftell(input_chd);
|
||||||
report_error(1, "Error reading hunk %" I64FMT "d at offset %" I64FMT "d from CHD file (%s): %s\n", framenum, filepos, params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
|
report_error(1, "Error reading hunk %" I64FMT "d at offset %" I64FMT "d from CHD file (%s): %s\n", framenum, filepos, params.find(OPTION_INPUT)->c_str(), chd_file::error_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
// write audio
|
// write audio
|
||||||
@ -2600,7 +2600,7 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0);
|
avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0);
|
||||||
if (avierr != AVIERR_NONE)
|
if (avierr != AVIERR_NONE)
|
||||||
report_error(1, "Error writing samples for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
|
report_error(1, "Error writing samples for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->c_str(), avi_error_string(avierr));
|
||||||
}
|
}
|
||||||
|
|
||||||
// write video
|
// write video
|
||||||
@ -2608,7 +2608,7 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
|
avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
|
||||||
if (avierr != AVIERR_NONE)
|
if (avierr != AVIERR_NONE)
|
||||||
report_error(1, "Error writing video for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
|
report_error(1, "Error writing video for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->c_str(), avi_error_string(avierr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2671,7 +2671,7 @@ static void do_add_metadata(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
file_error filerr = core_fload(*file_str, file);
|
file_error filerr = core_fload(*file_str, file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Error reading metadata file (%s)", file_str->cstr());
|
report_error(1, "Error reading metadata file (%s)", file_str->c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure we have one or the other
|
// make sure we have one or the other
|
||||||
@ -2687,13 +2687,13 @@ static void do_add_metadata(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Input file: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input file: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
printf("Tag: %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff);
|
printf("Tag: %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff);
|
||||||
printf("Index: %d\n", index);
|
printf("Index: %d\n", index);
|
||||||
if (text_str != NULL)
|
if (text_str != NULL)
|
||||||
printf("Text: %s\n", text.cstr());
|
printf("Text: %s\n", text.c_str());
|
||||||
else
|
else
|
||||||
printf("Data: %s (%d bytes)\n", file_str->cstr(), file.count());
|
printf("Data: %s (%d bytes)\n", file_str->c_str(), file.count());
|
||||||
|
|
||||||
// write the metadata
|
// write the metadata
|
||||||
chd_error err;
|
chd_error err;
|
||||||
@ -2736,7 +2736,7 @@ static void do_del_metadata(parameters_t ¶ms)
|
|||||||
|
|
||||||
// print some info
|
// print some info
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("Input file: %s\n", params.find(OPTION_INPUT)->cstr());
|
printf("Input file: %s\n", params.find(OPTION_INPUT)->c_str());
|
||||||
printf("Tag: %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff);
|
printf("Tag: %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff);
|
||||||
printf("Index: %d\n", index);
|
printf("Index: %d\n", index);
|
||||||
|
|
||||||
@ -2795,17 +2795,17 @@ static void do_dump_metadata(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
|
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
report_error(1, "Unable to open file (%s)", output_file_str->cstr());
|
report_error(1, "Unable to open file (%s)", output_file_str->c_str());
|
||||||
|
|
||||||
// output the metadata
|
// output the metadata
|
||||||
UINT32 count = core_fwrite(output_file, buffer, buffer.count());
|
UINT32 count = core_fwrite(output_file, buffer, buffer.count());
|
||||||
if (count != buffer.count())
|
if (count != buffer.count())
|
||||||
report_error(1, "Error writing file (%s)", output_file_str->cstr());
|
report_error(1, "Error writing file (%s)", output_file_str->c_str());
|
||||||
core_fclose(output_file);
|
core_fclose(output_file);
|
||||||
|
|
||||||
// provide some feedback
|
// provide some feedback
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
printf("File (%s) written, %s bytes\n", output_file_str->cstr(), big_int_string(tempstr, buffer.count()));
|
printf("File (%s) written, %s bytes\n", output_file_str->c_str(), big_int_string(tempstr, buffer.count()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// flush to stdout
|
// flush to stdout
|
||||||
|
@ -303,7 +303,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n");
|
fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n");
|
||||||
if (!opts.parse_command_line(argc, argv, OPTION_PRIORITY_DEFAULT, aerror))
|
if (!opts.parse_command_line(argc, argv, OPTION_PRIORITY_DEFAULT, aerror))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n", aerror.cstr());
|
fprintf(stderr, "%s\n", aerror.c_str());
|
||||||
usage(opts);
|
usage(opts);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c
|
|||||||
filerr = core_fopen(imgfile1, OPEN_FLAG_READ, &file);
|
filerr = core_fopen(imgfile1, OPEN_FLAG_READ, &file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
printf("Could not open %s (%d)\n", imgfile1.cstr(), filerr);
|
printf("Could not open %s (%d)\n", imgfile1.c_str(), filerr);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c
|
|||||||
core_fclose(file);
|
core_fclose(file);
|
||||||
if (pngerr != PNGERR_NONE)
|
if (pngerr != PNGERR_NONE)
|
||||||
{
|
{
|
||||||
printf("Could not read %s (%d)\n", imgfile1.cstr(), pngerr);
|
printf("Could not read %s (%d)\n", imgfile1.c_str(), pngerr);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c
|
|||||||
filerr = core_fopen(imgfile2, OPEN_FLAG_READ, &file);
|
filerr = core_fopen(imgfile2, OPEN_FLAG_READ, &file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
printf("Could not open %s (%d)\n", imgfile2.cstr(), filerr);
|
printf("Could not open %s (%d)\n", imgfile2.c_str(), filerr);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c
|
|||||||
core_fclose(file);
|
core_fclose(file);
|
||||||
if (pngerr != PNGERR_NONE)
|
if (pngerr != PNGERR_NONE)
|
||||||
{
|
{
|
||||||
printf("Could not read %s (%d)\n", imgfile2.cstr(), pngerr);
|
printf("Could not read %s (%d)\n", imgfile2.c_str(), pngerr);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,14 +173,14 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c
|
|||||||
filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file);
|
filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
printf("Could not open %s (%d)\n", outfilename.cstr(), filerr);
|
printf("Could not open %s (%d)\n", outfilename.c_str(), filerr);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL);
|
pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL);
|
||||||
core_fclose(file);
|
core_fclose(file);
|
||||||
if (pngerr != PNGERR_NONE)
|
if (pngerr != PNGERR_NONE)
|
||||||
{
|
{
|
||||||
printf("Could not write %s (%d)\n", outfilename.cstr(), pngerr);
|
printf("Could not write %s (%d)\n", outfilename.c_str(), pngerr);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -571,7 +571,7 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp
|
|||||||
/* print a header */
|
/* print a header */
|
||||||
astring modified(templatefile);
|
astring modified(templatefile);
|
||||||
modified.replace("<!--TITLE-->", title);
|
modified.replace("<!--TITLE-->", title);
|
||||||
core_fwrite(file, modified.cstr(), modified.len());
|
core_fwrite(file, modified.c_str(), modified.len());
|
||||||
|
|
||||||
/* return the file */
|
/* return the file */
|
||||||
return file;
|
return file;
|
||||||
@ -587,7 +587,7 @@ static void output_footer_and_close_file(core_file *file, astring &templatefile,
|
|||||||
{
|
{
|
||||||
astring modified(templatefile);
|
astring modified(templatefile);
|
||||||
modified.replace(0, "<!--TITLE-->", title);
|
modified.replace(0, "<!--TITLE-->", title);
|
||||||
core_fwrite(file, modified.cstr(), modified.len());
|
core_fwrite(file, modified.c_str(), modified.len());
|
||||||
core_fclose(file);
|
core_fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,11 +686,11 @@ static void output_report(astring &dirname, astring &tempheader, astring &tempfo
|
|||||||
*buckettailptr[bucknum] = NULL;
|
*buckettailptr[bucknum] = NULL;
|
||||||
|
|
||||||
/* output header */
|
/* output header */
|
||||||
tempname.printf("%s" PATH_SEPARATOR "%s", dirname.cstr(), "index.html");
|
tempname.printf("%s" PATH_SEPARATOR "%s", dirname.c_str(), "index.html");
|
||||||
indexfile = create_file_and_output_header(tempname, tempheader, title);
|
indexfile = create_file_and_output_header(tempname, tempheader, title);
|
||||||
if (indexfile == NULL)
|
if (indexfile == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error creating file '%s'\n", tempname.cstr());
|
fprintf(stderr, "Error creating file '%s'\n", tempname.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -843,14 +843,14 @@ static int generate_png_diff(const summary_file *curfile, astring &destdir, cons
|
|||||||
int starty;
|
int starty;
|
||||||
|
|
||||||
/* generate the common source filename */
|
/* generate the common source filename */
|
||||||
dstfilename.printf("%s" PATH_SEPARATOR "%s", destdir.cstr(), destname);
|
dstfilename.printf("%s" PATH_SEPARATOR "%s", destdir.c_str(), destname);
|
||||||
srcimgname.printf("snap" PATH_SEPARATOR "%s" PATH_SEPARATOR "final.png", curfile->name);
|
srcimgname.printf("snap" PATH_SEPARATOR "%s" PATH_SEPARATOR "final.png", curfile->name);
|
||||||
|
|
||||||
/* open and load all unique bitmaps */
|
/* open and load all unique bitmaps */
|
||||||
for (listnum = 0; listnum < list_count; listnum++)
|
for (listnum = 0; listnum < list_count; listnum++)
|
||||||
if (curfile->matchbitmap[listnum] == listnum)
|
if (curfile->matchbitmap[listnum] == listnum)
|
||||||
{
|
{
|
||||||
tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.cstr());
|
tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.c_str());
|
||||||
|
|
||||||
/* open the source image */
|
/* open the source image */
|
||||||
filerr = core_fopen(tempname, OPEN_FLAG_READ, &file);
|
filerr = core_fopen(tempname, OPEN_FLAG_READ, &file);
|
||||||
@ -961,11 +961,11 @@ static void create_linked_file(astring &dirname, const summary_file *curfile, co
|
|||||||
|
|
||||||
/* output header */
|
/* output header */
|
||||||
title.printf("%s Regressions (%s)", curfile->name, curfile->source);
|
title.printf("%s Regressions (%s)", curfile->name, curfile->source);
|
||||||
linkname.printf("%s" PATH_SEPARATOR "%s", dirname.cstr(), filename.cstr());
|
linkname.printf("%s" PATH_SEPARATOR "%s", dirname.c_str(), filename.c_str());
|
||||||
linkfile = create_file_and_output_header(linkname, tempheader, title);
|
linkfile = create_file_and_output_header(linkname, tempheader, title);
|
||||||
if (linkfile == NULL)
|
if (linkfile == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error creating file '%s'\n", filename.cstr());
|
fprintf(stderr, "Error creating file '%s'\n", filename.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1002,7 +1002,7 @@ static void create_linked_file(astring &dirname, const summary_file *curfile, co
|
|||||||
{
|
{
|
||||||
core_fprintf(linkfile, "\t<p>\n");
|
core_fprintf(linkfile, "\t<p>\n");
|
||||||
core_fprintf(linkfile, "\t<b>Errors:</b>\n");
|
core_fprintf(linkfile, "\t<b>Errors:</b>\n");
|
||||||
core_fprintf(linkfile, "\t<pre>%s</pre>\n", curfile->text[listnum].cstr());
|
core_fprintf(linkfile, "\t<pre>%s</pre>\n", curfile->text[listnum].c_str());
|
||||||
core_fprintf(linkfile, "\t</p>\n");
|
core_fprintf(linkfile, "\t</p>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,16 +123,16 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi
|
|||||||
filerr = core_fopen(splitfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile);
|
filerr = core_fopen(splitfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.cstr());
|
fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.c_str());
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the basics out
|
// write the basics out
|
||||||
core_fprintf(splitfile, "splitfile=%s\n", basefilename.cstr());
|
core_fprintf(splitfile, "splitfile=%s\n", basefilename.c_str());
|
||||||
core_fprintf(splitfile, "splitsize=%d\n", splitsize);
|
core_fprintf(splitfile, "splitsize=%d\n", splitsize);
|
||||||
|
|
||||||
printf("Split file is '%s'\n", splitfilename.cstr());
|
printf("Split file is '%s'\n", splitfilename.c_str());
|
||||||
printf("Splitting file %s into chunks of %dMB...\n", basefilename.cstr(), splitsize / (1024 * 1024));
|
printf("Splitting file %s into chunks of %dMB...\n", basefilename.c_str(), splitsize / (1024 * 1024));
|
||||||
|
|
||||||
// now iterate until done
|
// now iterate until done
|
||||||
for (partnum = 0; partnum < 1000; partnum++)
|
for (partnum = 0; partnum < 1000; partnum++)
|
||||||
@ -150,7 +150,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi
|
|||||||
compute_hash_as_string(computedhash, splitbuffer, length);
|
compute_hash_as_string(computedhash, splitbuffer, length);
|
||||||
|
|
||||||
// write that info to the split file
|
// write that info to the split file
|
||||||
core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.cstr(), basefilename.cstr(), partnum);
|
core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.c_str(), basefilename.c_str(), partnum);
|
||||||
|
|
||||||
// compute the full filename for this guy
|
// compute the full filename for this guy
|
||||||
outfilename.printf("%s.%03d", basename, partnum);
|
outfilename.printf("%s.%03d", basename, partnum);
|
||||||
@ -160,11 +160,11 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi
|
|||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.cstr());
|
fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.c_str());
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" writing %s.%03d...", basefilename.cstr(), partnum);
|
printf(" writing %s.%03d...", basefilename.c_str(), partnum);
|
||||||
|
|
||||||
// write the data
|
// write the data
|
||||||
actual = core_fwrite(outfile, splitbuffer, length);
|
actual = core_fwrite(outfile, splitbuffer, length);
|
||||||
@ -273,7 +273,7 @@ static int join_file(const char *filename, const char *outname, int write_output
|
|||||||
{
|
{
|
||||||
core_fclose(outfile);
|
core_fclose(outfile);
|
||||||
outfile = NULL;
|
outfile = NULL;
|
||||||
fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.cstr());
|
fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.c_str());
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,12 +281,12 @@ static int join_file(const char *filename, const char *outname, int write_output
|
|||||||
filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile);
|
filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile);
|
||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.cstr());
|
fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.c_str());
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.cstr());
|
printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.c_str());
|
||||||
|
|
||||||
// now iterate through each file
|
// now iterate through each file
|
||||||
while (core_fgets(buffer, sizeof(buffer), splitfile))
|
while (core_fgets(buffer, sizeof(buffer), splitfile))
|
||||||
@ -302,7 +302,7 @@ static int join_file(const char *filename, const char *outname, int write_output
|
|||||||
expectedhash.cpy(buffer + 5, SHA1_DIGEST_SIZE * 2);
|
expectedhash.cpy(buffer + 5, SHA1_DIGEST_SIZE * 2);
|
||||||
infilename.cpy(buffer + 5 + SHA1_DIGEST_SIZE * 2 + 6).trimspace();
|
infilename.cpy(buffer + 5 + SHA1_DIGEST_SIZE * 2 + 6).trimspace();
|
||||||
|
|
||||||
printf(" Reading file '%s'...", infilename.cstr());
|
printf(" Reading file '%s'...", infilename.c_str());
|
||||||
|
|
||||||
// read the file's contents
|
// read the file's contents
|
||||||
infilename.ins(0, basepath);
|
infilename.ins(0, basepath);
|
||||||
@ -310,7 +310,7 @@ static int join_file(const char *filename, const char *outname, int write_output
|
|||||||
if (filerr != FILERR_NONE)
|
if (filerr != FILERR_NONE)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.cstr());
|
fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.c_str());
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ static int join_file(const char *filename, const char *outname, int write_output
|
|||||||
if (computedhash != expectedhash)
|
if (computedhash != expectedhash)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n Expected: %s\n Computed: %s\n", infilename.cstr(), expectedhash.cstr(), computedhash.cstr());
|
fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n Expected: %s\n Computed: %s\n", infilename.c_str(), expectedhash.c_str(), computedhash.c_str());
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user