This commit is contained in:
Vas Crabb 2015-04-12 00:16:55 +10:00
commit e1f0422bc0
105 changed files with 680 additions and 618 deletions

View File

@ -494,7 +494,7 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, dev
owner.subtag(tag, entry->m_read.m_tag);
device_t *mapdevice = machine.device(tag);
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
address_map submap(*mapdevice, entry);

View File

@ -812,7 +812,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
logerror( "==============\n\n" );
logerror( "\tTitle: %.32s\n", head_title);
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\tSC Bankswitch: %s\n", BIT(head_mapper, 1) ? "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
logerror( "\n");
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr());
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr());
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.c_str());
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.c_str());
logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
}

View File

@ -307,7 +307,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
else if (!memcmp(&ROM[i], "SIIRTC_V", 8))
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
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;
}
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)
{

View File

@ -328,7 +328,7 @@ int intv_cart_slot_device::load_fullpath()
}
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);
//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))
{
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);
if (ram)

View File

@ -1082,10 +1082,10 @@ void base_md_cart_slot_device::file_logging(UINT8 *ROM8, UINT32 rom_len, UINT32
}
logerror("Checksum: %X\n", checksum);
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("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 End: 0x%.8X\n", rom_end);
logerror("RAM Start: 0x%.8X\n", ram_start);

View File

@ -290,7 +290,7 @@ void msx_slot_cartridge_device::get_default_card_software(astring &result)
if (hashfile_extrainfo(*this, extrainfo))
{
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[] = {
//{ 0, NOMAPPER },

View File

@ -392,7 +392,7 @@ void nes_cart_slot_device::call_load_ines()
}
else
{
logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.cstr());
logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.c_str());
}
}
else

View File

@ -540,7 +540,7 @@ void cheat_script::script_entry::save(emu_file &cheatfile) const
// output an output
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())
cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
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
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++;
// look for the next one
@ -597,9 +597,9 @@ void cheat_script::script_entry::validate_format(const char *filename, int line)
// did we match?
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)
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);
// 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)
cheatfile.printf(" tempvariables=\"%d\"", m_numtemp);
if (!m_comment && m_parameter == NULL && !has_scripts)
@ -793,7 +793,7 @@ void cheat_entry::save(emu_file &cheatfile) const
// save the 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
if (m_parameter != NULL)
@ -832,7 +832,7 @@ bool cheat_entry::activate()
{
execute_on_script();
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
@ -840,7 +840,7 @@ bool cheat_entry::activate()
{
execute_change_script();
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;

View File

@ -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());
// 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;
}
}
@ -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());
// 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)
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
astring exename;
@ -208,7 +208,7 @@ int cli_frontend::execute(int argc, char **argv)
m_options.parse_standard_inis(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
const game_driver *system = m_options.system();
@ -226,7 +226,7 @@ int cli_frontend::execute(int argc, char **argv)
catch (emu_fatalerror &fatal)
{
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;
// 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
astring filename;
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())
{
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());
// 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
astring extensions(imagedev->file_extensions());
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);
printf(".%-5s", curext.cstr());
printf(".%-5s", curext.c_str());
if (end == -1)
break;
}
@ -782,7 +782,7 @@ void cli_frontend::verifyroms(const char *gamename)
// output the summary of the audit
astring 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
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
astring 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
osd_printf_info("romset %s ", dev->shortname());
@ -880,7 +880,7 @@ void cli_frontend::verifyroms(const char *gamename)
{
astring temptag("_");
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
device_iterator subiter(*dev);
@ -907,7 +907,7 @@ void cli_frontend::verifyroms(const char *gamename)
// output the summary of the audit
astring 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
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
astring 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
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
astring 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
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
astring 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
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;
m_options.parse_standard_inis(option_errors);
if (option_errors)
osd_printf_error("%s\n", option_errors.cstr());
osd_printf_error("%s\n", option_errors.c_str());
// createconfig?
if (strcmp(m_options.command(), CLICOMMAND_CREATECONFIG) == 0)
@ -1779,7 +1779,7 @@ void media_identifier::identify_file(const char *name)
{
// output the name
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++;
// 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
m_total++;
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
int found = find_by_hash(hashes, length);

View File

@ -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())
{
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;
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

View File

@ -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())
{
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;
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

View File

@ -130,7 +130,7 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
if (device.machine().options().drc_log_uml())
{
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
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++;
flushcomments = TRUE;
}
else
m_drcuml.log_printf("\t%s\n", dasm.cstr());
m_drcuml.log_printf("\t%s\n", dasm.c_str());
}
// flush any comments pending

View File

@ -237,7 +237,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring
m_auc & 0x10 ? '0':'.',
m_auc & 0x08 ? '1':'.',
m_auc & 0x04 ? '0':'.',
alignString.cstr());
alignString.c_str());
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",
m_pioc & 0x8000 ? 'I':'.',
strobeString.cstr(),
strobeString.c_str(),
m_pioc & 0x1000 ? 'O':'I',
m_pioc & 0x0800 ? 'O':'I',
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",
m_sioc & 0x0200 ? 'I':'O',
clkString.cstr(),
clkString.c_str(),
m_sioc & 0x0040 ? 'L':'M',
m_sioc & 0x0020 ? 'I':'O',
m_sioc & 0x0010 ? 'I':'O',

View File

@ -270,7 +270,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 F1 = (op & 0x01e0) >> 5;
astring yString = disasmYField(Y);
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;
}
case 0x04: case 0x1c:
@ -285,7 +285,7 @@ CPU_DISASSEMBLE( dsp16a )
astring fString = disasmF1Field(F1, D, S);
astring aString = (opcode == 0x1c) ? "a0" : "a1";
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;
}
case 0x16:
@ -297,7 +297,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 F1 = (op & 0x01e0) >> 5;
astring yString = disasmYField(Y);
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;
}
case 0x17:
@ -311,7 +311,7 @@ CPU_DISASSEMBLE( dsp16a )
astring yString = disasmYField(Y);
astring fString = disasmF1Field(F1, D, S);
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;
}
case 0x1f:
@ -325,7 +325,7 @@ CPU_DISASSEMBLE( dsp16a )
astring yString = disasmYField(Y);
astring fString = disasmF1Field(F1, D, S);
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;
}
case 0x19: case 0x1b:
@ -339,7 +339,7 @@ CPU_DISASSEMBLE( dsp16a )
astring fString = disasmF1Field(F1, D, S);
astring xString = (X ? "*pt++i" : "*pt++");
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");
break;
}
@ -354,7 +354,7 @@ CPU_DISASSEMBLE( dsp16a )
astring yString = disasmYField(Y);
astring xString = (X ? "y" : "y1");
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;
}
@ -369,7 +369,7 @@ CPU_DISASSEMBLE( dsp16a )
astring yString = disasmYField(Y);
astring atString = (aT ? "a0" : "a1");
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;
}
@ -385,7 +385,7 @@ CPU_DISASSEMBLE( dsp16a )
astring zString = disasmZField(Z);
astring xString = (X ? "y" : "y1");
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;
}
case 0x1d:
@ -399,7 +399,7 @@ CPU_DISASSEMBLE( dsp16a )
astring zString = disasmZField(Z);
astring xString = (X ? "*pt++i" : "*pt++");
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;
}
@ -416,7 +416,7 @@ CPU_DISASSEMBLE( dsp16a )
astring atString = (aT ? "a0" : "a1");
atString += X ? "" : "1"; // TODO: Figure out unclear wording.
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;
}
@ -431,8 +431,8 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 F2 = (op & 0x01e0) >> 5;
astring fString = disasmF2Field(F2, D, S);
astring conString = disasmCONField(CON);
if (op & 0x0800) sprintf(buffer, "if %s : %s", conString.cstr(), fString.cstr());
else sprintf(buffer, "ifc %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.c_str(), fString.c_str());
break;
}
@ -458,7 +458,7 @@ CPU_DISASSEMBLE( dsp16a )
// goto B
const UINT8 B = (op & 0x0700) >> 8;
astring bString = disasmBField(B);
sprintf(buffer, "%s", bString.cstr());
sprintf(buffer, "%s", bString.c_str());
break;
}
@ -468,7 +468,7 @@ CPU_DISASSEMBLE( dsp16a )
// if CON [goto/call/return]
const UINT8 CON = (op & 0x001f);
astring conString = disasmCONField(CON);
sprintf(buffer, "if %s:", conString.cstr());
sprintf(buffer, "if %s:", conString.c_str());
// TODO: Test for invalid ops
// icall
if (op == 0xd40e) sprintf(buffer, "icall");
@ -482,7 +482,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 R = (op & 0x03f0) >> 4;
const UINT8 S = (op & 0x1000) >> 12;
astring rString = disasmRField(R);
sprintf(buffer, "%s = %s", rString.cstr(), (S ? "a1" : "a0"));
sprintf(buffer, "%s = %s", rString.c_str(), (S ? "a1" : "a0"));
break;
}
case 0x08:
@ -491,7 +491,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 R = (op & 0x03f0) >> 4;
const UINT8 aT = (op & 0x0400) >> 10;
astring rString = disasmRField(R);
sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.cstr());
sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.c_str());
break;
}
case 0x0f:
@ -501,7 +501,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 R = (op & 0x03f0) >> 4;
astring yString = disasmYField(Y);
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
break;
}
@ -513,7 +513,7 @@ CPU_DISASSEMBLE( dsp16a )
astring yString = disasmYField(Y);
astring rString = disasmRField(R);
// 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;
}
case 0x0d:
@ -523,7 +523,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT8 R = (op & 0x03f0) >> 4;
astring zString = disasmZField(Z);
astring rString = disasmRField(R);
sprintf(buffer, "%s <=> %s", zString.cstr(), rString.cstr());
sprintf(buffer, "%s <=> %s", zString.c_str(), rString.c_str());
break;
}
@ -533,7 +533,7 @@ CPU_DISASSEMBLE( dsp16a )
// R = N
const UINT8 R = (op & 0x03f0) >> 4;
astring rString = disasmRField(R);
sprintf(buffer, "%s = 0x%04x", rString.cstr(), op2);
sprintf(buffer, "%s = 0x%04x", rString.c_str(), op2);
opSize = 2;
break;
}
@ -545,7 +545,7 @@ CPU_DISASSEMBLE( dsp16a )
const UINT16 M = (op & 0x01ff);
const UINT8 R = (op & 0x0e00) >> 9;
astring rString = disasmRImmediateField(R);
sprintf(buffer, "%s = 0x%04x", rString.cstr(), M);
sprintf(buffer, "%s = 0x%04x", rString.c_str(), M);
break;
}

View File

@ -21,7 +21,7 @@ CPU_DISASSEMBLE( dsp56k )
// Decode and disassemble.
DSP56K::Opcode op(w0, w1);
sprintf(buffer, "%s", op.disassemble().cstr());
sprintf(buffer, "%s", op.disassemble().c_str());
const unsigned size = op.size();
return (size | DASMFLAG_SUPPORTED);

View File

@ -204,7 +204,7 @@ public:
void disassemble(astring& retString) const
{
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);
// NEW // sprintf(opcode_str, "and(i)");
}
@ -438,7 +438,7 @@ public:
sprintf(temp, "#$%x", m_iVal);
astring source = temp;
sprintf(temp, "X:(%s)", regIdAsString(m_r).cstr());
sprintf(temp, "X:(%s)", regIdAsString(m_r).c_str());
astring destination = temp;
retString = m_opcode + " " + source + "," + destination;
@ -1138,7 +1138,7 @@ public:
astring destination = temp;
// 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;
retString = "do " + source + "," + destination;
@ -3042,7 +3042,7 @@ public:
void disassemble(astring& retString) const
{
char temp[32];
sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr());
sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str());
retString = "rep " + astring(temp);
}
void evaluate(dsp56k_core* cpustate) {}

View File

@ -158,9 +158,9 @@ public:
if (r == iR3) return false;
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;
sprintf(temp, "X:%s,%s", ea2.cstr(), regIdAsString(D2).cstr());
sprintf(temp, "X:%s,%s", ea2.c_str(), regIdAsString(D2).c_str());
parallelMove2 = temp;
return true;
@ -253,8 +253,8 @@ public:
decode_RR_table(BITSn(word0,0x00c0), r);
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_str2, "%s,%s", regIdAsString(S).cstr(), regIdAsString(Dnot).cstr());
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).c_str(), regIdAsString(Dnot).c_str());
pms = parallel_move_str;
pms2 = parallel_move_str2;
return true;

View File

@ -574,8 +574,8 @@ void assemble_D_from_P_table(UINT16 P, UINT16 ppppp, astring& D)
break;
case 0x1:
assemble_address_from_IO_short_address(ppppp, fullAddy);
sprintf(temp, "X:<<$%s", fullAddy.cstr());
// NEW // sprintf(temp, "X:$%s", fullAddy.cstr());
sprintf(temp, "X:<<$%s", fullAddy.c_str());
// NEW // sprintf(temp, "X:$%s", fullAddy.c_str());
break;
}
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)
{
char temp[32];
sprintf(temp, "%c:%s", ma, ea.cstr());
sprintf(temp, "%c:%s", ma, ea.c_str());
switch(W)
{
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)
{
char temp[32];
sprintf(temp, "%c:%s", ma, ea.cstr());
sprintf(temp, "%c:%s", ma, ea.c_str());
switch(W)
{
case 0x0: source = SD; destination = temp; break;

View File

@ -253,7 +253,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
int delta = oprom[2];
if(delta & 0x80)
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;
break;
}
@ -262,23 +262,23 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
int delta = oprom[2];
if(delta & 0x80)
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;
break;
}
case DASM_direct_1:
sprintf(buffer, " %s", regname(oprom[1]).cstr());
sprintf(buffer, " %s", regname(oprom[1]).c_str());
flags |= 2;
break;
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;
break;
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;
break;
@ -288,20 +288,20 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
break;
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;
break;
case DASM_immed_or_reg_2b:
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
sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]);
sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]);
flags |= 3;
break;
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;
break;
@ -311,46 +311,46 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
break;
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;
break;
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;
break;
case DASM_indirect_1n:
sprintf(buffer, " [%s]", regname(oprom[1]).cstr());
sprintf(buffer, " [%s]", regname(oprom[1]).c_str());
flags |= 2;
break;
case DASM_indirect_1:
if(oprom[1] & 0x01) {
sprintf(buffer, " [%s]+", regname(oprom[1]-1).cstr());
sprintf(buffer, " [%s]+", regname(oprom[1]-1).c_str());
flags |= 2;
} else {
sprintf(buffer, " [%s]", regname(oprom[1]).cstr());
sprintf(buffer, " [%s]", regname(oprom[1]).c_str());
flags |= 2;
}
break;
case DASM_indirect_2:
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;
} 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;
}
break;
case DASM_indirect_3:
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;
} 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;
}
break;
@ -360,7 +360,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
if(oprom[1] == 0x01)
sprintf(buffer, " %02x%02x", oprom[3], oprom[2]);
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;
} else {
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);
} else {
if(delta < 0)
sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).cstr());
sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).c_str());
else
sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).cstr());
sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).c_str());
}
flags |= 3;
}
@ -384,9 +384,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
case DASM_indexed_2:
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
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;
} else {
int delta = oprom[2];
@ -394,14 +394,14 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
delta -= 0x100;
if(oprom[1] == 0x00) {
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
sprintf(buffer, " %s, %02x", regname(oprom[3]).cstr(), delta);
sprintf(buffer, " %s, %02x", regname(oprom[3]).c_str(), delta);
} else {
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
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;
}
@ -410,9 +410,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
case DASM_indexed_3:
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
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;
} else {
int delta = oprom[2];
@ -420,14 +420,14 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom,
delta -= 0x100;
if(oprom[1] == 0x00) {
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
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 {
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
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;
}

View File

@ -83,13 +83,13 @@ void score7_cpu_device::device_start()
astring tmp_string;
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++)
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++)
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_CEL, "cel", REG_CEL).callimport().callexport().formatstr("%08X");

View File

@ -743,7 +743,7 @@ void uml::instruction::simplify()
astring disasm1, disasm2;
orig.disasm(disasm1, 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());
}
*/

View File

@ -1044,7 +1044,7 @@ static void execute_ignore(running_machine &machine, int ref, int params, const
/* special message for none */
if (!buffer)
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 */
@ -1109,7 +1109,7 @@ static void execute_observe(running_machine &machine, int ref, int params, const
/* special message for none */
if (!buffer)
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 */
@ -1332,7 +1332,7 @@ static void execute_bplist(running_machine &machine, int ref, int params, const
buffer.catprintf(" if %s", bp->condition());
if (astring(bp->action()) != astring(""))
buffer.catprintf(" do %s", bp->action());
debug_console_printf(machine, "%s\n", buffer.cstr());
debug_console_printf(machine, "%s\n", buffer.c_str());
printed++;
}
}
@ -1502,7 +1502,7 @@ static void execute_wplist(running_machine &machine, int ref, int params, const
buffer.catprintf(" if %s", wp->condition());
if (astring(wp->action()) != astring(""))
buffer.catprintf(" do %s", wp->action());
debug_console_printf(machine, "%s\n", buffer.cstr());
debug_console_printf(machine, "%s\n", buffer.c_str());
printed++;
}
}
@ -1641,7 +1641,7 @@ static void execute_rplist(running_machine &machine, int ref, int params, const
buffer.catprintf("if %s", rp->condition());
if (rp->action() != NULL)
buffer.catprintf(" do %s", rp->action());
debug_console_printf(machine, "%s\n", buffer.cstr());
debug_console_printf(machine, "%s\n", buffer.c_str());
printed++;
}
}
@ -2605,7 +2605,7 @@ static void execute_trace_internal(running_machine &machine, int ref, int params
/* do it */
cpu->debug()->trace(f, trace_over, action);
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
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
if (file != NULL)
fprintf(file, "%s\n", buffer.cstr());
fprintf(file, "%s\n", buffer.c_str());
else
debug_console_printf(machine, "%s\n", buffer.cstr());
debug_console_printf(machine, "%s\n", buffer.c_str());
// cleanup
if (file != NULL)

View File

@ -3059,7 +3059,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
}
else
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();
}
break;
@ -3493,7 +3493,7 @@ void device_debug::tracer::update(offs_t pc)
buffer.cat(dasm);
// 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?
if (m_trace_over && (dasmresult & DASMFLAG_SUPPORTED) != 0 && (dasmresult & DASMFLAG_STEP_OVER) != 0)

View File

@ -134,7 +134,7 @@ void debug_view_breakpoints::enumerate_sources()
{
astring name;
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
@ -196,7 +196,7 @@ void debug_view_breakpoints::pad_astring_to_length(astring& str, int len)
buffer.expand(diff);
for (int i = 0; i < diff; i++)
buffer.catprintf(" ");
str.catprintf("%s", buffer.cstr());
str.catprintf("%s", buffer.c_str());
}
}

View File

@ -291,13 +291,13 @@ void debug_view_state::view_update()
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();
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;
temp[len++] = ' ';

View File

@ -156,7 +156,7 @@ void debug_view_watchpoints::enumerate_sources()
{
astring name;
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
@ -220,7 +220,7 @@ void debug_view_watchpoints::pad_astring_to_length(astring& str, int len)
buffer.expand(diff);
for (int i = 0; i < diff; i++)
buffer.catprintf(" ");
str.catprintf("%s", buffer.cstr());
str.catprintf("%s", buffer.c_str());
}
}

View File

@ -287,7 +287,7 @@ void integer_symbol_entry::set_value(UINT64 newvalue)
if (m_setter != NULL)
(*m_setter)(m_table, m_ref, newvalue);
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
{
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)
{
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)
{
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)
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);
}
@ -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 (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 (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 (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
symbol_entry *symbol = m_symtable->find_deep(buffer);

View File

@ -327,7 +327,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
UINT32 region_length = valid.region_length(gfxregion);
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
else if (!IS_FRAC(layout.total))

View File

@ -236,7 +236,7 @@ static const char *const messages[] =
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 done = FALSE;
directory = osd_opendir(m_working_directory.cstr());
directory = osd_opendir(m_working_directory.c_str());
if (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 */
astring extensions(file_extensions());
char *ext = strtok((char*)extensions.cstr(),",");
char *ext = strtok((char*)extensions.c_str(),",");
while (ext != NULL)
{
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 using lists, we have: list/clonename, list/parentname, clonename, parentname
// try to load from list/setname
if ((m_mame_file == NULL) && (tag2.cstr() != NULL))
filerr = common_process_file(device().machine().options(), tag2.cstr(), has_crc, crc, romp, &m_mame_file);
if ((m_mame_file == NULL) && (tag2.c_str() != NULL))
filerr = common_process_file(device().machine().options(), tag2.c_str(), has_crc, crc, romp, &m_mame_file);
// try to load from list/parentname
if ((m_mame_file == NULL) && (tag3.cstr() != NULL))
filerr = common_process_file(device().machine().options(), tag3.cstr(), has_crc, crc, romp, &m_mame_file);
if ((m_mame_file == NULL) && (tag3.c_str() != NULL))
filerr = common_process_file(device().machine().options(), tag3.c_str(), has_crc, crc, romp, &m_mame_file);
// try to load from setname
if ((m_mame_file == NULL) && (tag4.cstr() != NULL))
filerr = common_process_file(device().machine().options(), tag4.cstr(), has_crc, crc, romp, &m_mame_file);
if ((m_mame_file == NULL) && (tag4.c_str() != NULL))
filerr = common_process_file(device().machine().options(), tag4.c_str(), has_crc, crc, romp, &m_mame_file);
// try to load from parentname
if ((m_mame_file == NULL) && (tag5.cstr() != NULL))
filerr = common_process_file(device().machine().options(), tag5.cstr(), has_crc, crc, romp, &m_mame_file);
if ((m_mame_file == NULL) && (tag5.c_str() != NULL))
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)));

View File

@ -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())
{
// 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)
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
const device_sound_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;
sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum);
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
int streaminputnum;
sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
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
inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);

View File

@ -532,7 +532,7 @@ bool emu_options::parse_one_ini(const char *basename, int priority, astring *err
// append errors if requested
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;
}
@ -544,7 +544,7 @@ const char *emu_options::main_value(astring &buffer, const char *name) const
int pos = buffer.chr(0, ',');
if (pos != -1)
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
@ -561,5 +561,5 @@ const char *emu_options::sub_value(astring &buffer, const char *name, const char
}
else
buffer.reset();
return buffer.cstr();
return buffer.c_str();
}

View File

@ -409,7 +409,7 @@ void palette_device::device_start()
{
// find the extended (split) memory, if present
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
assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified");

View File

@ -845,16 +845,16 @@ file_error emu_file::attempt__7zped()
int fileno = -1;
// 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 (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
// is more helpful and less confusing than reporting "rom not found"
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)
{

View File

@ -232,8 +232,8 @@ void image_device_init(running_machine &machine)
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
image->device().name(),
image_basename.cstr(),
image_err.cstr());
image_basename.c_str(),
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",
image->device().name(),
image_err.cstr());
image_err.c_str());
}
}

View File

@ -280,7 +280,7 @@ bool cassette_image_device::call_load()
fname = m_mame_file->filename();
int loc = fname.rchr(0,'.');
if (loc!=-1) {
extension = fname.substr(loc + 1,fname.len()-loc).cstr();
extension = fname.substr(loc + 1,fname.len()-loc).c_str();
} else {
extension = "";
}

View File

@ -173,7 +173,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
astring fname(name, ".dif");
/* 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);
file_error filerr = diff_file.open(fname);
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());
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);
}
/* 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);
filerr = diff_file.open(fname);
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();
/* 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_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
if (err != CHDERR_NONE)

View File

@ -179,7 +179,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file
astring fname(name, ".dif");
/* 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);
file_error filerr = diff_file.open(fname);
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());
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);
}
/* 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);
filerr = diff_file.open(fname);
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();
/* 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_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
if (err != CHDERR_NONE)

View File

@ -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_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
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()));
astring src(device.source());
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, " runnable=\"no\"");
output_sampleof();
@ -404,7 +404,7 @@ void info_xml_creator::output_devices()
{
astring temptag("_");
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
device_iterator subiter(*dev);
@ -413,9 +413,9 @@ void info_xml_creator::output_devices()
device->config_complete();
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");
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
astring normalized_field_name(xml_normalize_string(field->name()));
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
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
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());
char *ext = strtok((char *)extensions.cstr(), ",");
char *ext = strtok((char *)extensions.c_str(), ",");
while (ext != NULL)
{
fprintf(m_output, "\t\t\t<extension");

View File

@ -531,7 +531,7 @@ bool joystick_map::parse(const char *mapstring)
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++)
{
string.catprintf(" ");
@ -1579,7 +1579,7 @@ input_code input_manager::code_from_token(const char *_token)
// first token should be the devclass
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)
return INPUT_CODE_INVALID;
@ -1594,7 +1594,7 @@ input_code input_manager::code_from_token(const char *_token)
return INPUT_CODE_INVALID;
// 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);
// 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;
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)
curtok++;
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 (curtok < numtokens)
{
UINT32 temp = (*itemclass_token_table)[token[curtok].cstr()];
UINT32 temp = (*itemclass_token_table)[token[curtok].c_str()];
if (temp != ~0)
{
curtok++;
@ -2020,7 +2020,7 @@ void input_manager::seq_from_tokens(input_seq &seq, const char *string)
// loop until we're done
astring strcopy = string;
char *str = const_cast<char *>(strcopy.cstr());
char *str = const_cast<char *>(strcopy.c_str());
while (1)
{
// trim any leading spaces

View File

@ -2482,7 +2482,7 @@ time_t ioport_manager::initialize()
astring errors;
m_portlist.append(*device, 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
@ -3703,9 +3703,9 @@ void ioport_configurer::port_modify(const char *tag)
m_owner.subtag(fulltag, tag);
// find the existing port
m_curport = m_portlist.find(fulltag.cstr());
m_curport = m_portlist.find(fulltag.c_str());
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
m_curport->m_modcount++;

View File

@ -1044,7 +1044,7 @@ void lua_engine::periodic_check()
osd_lock_acquire(lock);
if (msg.ready == 1) {
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 (status == LUA_OK) status = docall(0, LUA_MULTRET);

View File

@ -592,7 +592,7 @@ astring running_machine::get_statename(const char *option)
// copy the device name to an astring
astring devname_str;
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
image_interface_iterator iter(root_device());
@ -600,7 +600,7 @@ astring running_machine::get_statename(const char *option)
{
// get the device 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)
{
@ -612,7 +612,7 @@ astring running_machine::get_statename(const char *option)
// setup snapname and remove the %d_
statename_str.replace(0, devname_str, filename);
statename_str.del(pos, 3);
//printf("check image: %s\n", filename.cstr());
//printf("check image: %s\n", filename.c_str());
name_found = 1;
}
@ -651,7 +651,7 @@ void running_machine::set_saveload_filename(const char *filename)
// take into account the statename option
const char *stateopt = options().state_name();
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");
}
}

View File

@ -60,7 +60,7 @@ int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const att
#if 0
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
if(next > limit)

View File

@ -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)
{
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);
m_substate = param;
}
@ -1784,7 +1784,7 @@ astring hdc9234_device::ttsn()
*/
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.state = state;
m_live_state.next_state = -1;
@ -1828,9 +1828,9 @@ void hdc9234_device::live_run_until(attotime limit)
if (TRACE_LIVE)
{
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
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)
@ -1862,7 +1862,7 @@ void hdc9234_device::live_run_until(attotime limit)
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;
}
@ -1871,11 +1871,11 @@ void hdc9234_device::live_run_until(attotime 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;
}
// logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).cstr());
if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
// 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).c_str(), m_live_state.shift_reg,
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
@ -1890,7 +1890,7 @@ void hdc9234_device::live_run_until(attotime limit)
// MFM case
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.data_separator_phase = false;
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)
{
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;
}
// Beyond time limit?
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);
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;
}
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
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)
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:
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;
}
@ -2017,7 +2017,7 @@ void hdc9234_device::live_run_until(attotime limit)
case 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;
}
@ -2026,7 +2026,7 @@ void hdc9234_device::live_run_until(attotime limit)
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);
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 (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.data_separator_phase = false;
m_live_state.bit_counter = 0;
@ -2074,14 +2074,14 @@ void hdc9234_device::live_run_until(attotime limit)
case 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;
}
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);
// Repeat until we have collected 16 bits
@ -2098,12 +2098,12 @@ void hdc9234_device::live_run_until(attotime limit)
return;
}
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
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)
{
@ -2133,7 +2133,7 @@ void hdc9234_device::live_run_until(attotime limit)
{
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;
}
@ -2158,7 +2158,7 @@ void hdc9234_device::live_run_until(attotime limit)
// Repeat until we have collected 16 bits
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;
if (slot < calc_sector_size())
@ -2179,7 +2179,7 @@ void hdc9234_device::live_run_until(attotime limit)
}
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);
}
return;
@ -2191,7 +2191,7 @@ void hdc9234_device::live_run_until(attotime limit)
case 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;
}
@ -2237,7 +2237,7 @@ void hdc9234_device::live_run_until(attotime limit)
// 5. Write the CRC bytes
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);
break;
@ -2554,14 +2554,14 @@ void hdc9234_device::live_run_until(attotime limit)
// The pause is implemented by doing dummy reads on the floppy
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;
}
// Repeat until we have collected 16 bits
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);
return;
}
@ -2636,7 +2636,7 @@ void hdc9234_device::live_sync()
if(m_live_state.time > machine().time())
{
// 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();
// and replay until we reach the 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
// 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
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 (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();
live_run_until(machine().time());
}
@ -2735,7 +2735,7 @@ void hdc9234_device::wait_for_realtime(int state)
{
m_live_state.next_state = state;
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.last_data_bit = raw & 1;
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();
}
@ -2872,7 +2872,7 @@ void hdc9234_device::encode_raw(UINT16 raw)
m_live_state.bit_counter = 16;
m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
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();
}
@ -2960,7 +2960,7 @@ WRITE8_MEMBER( hdc9234_device::write )
{
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
{
@ -3169,7 +3169,7 @@ void hdc9234_device::auxbus_in(UINT8 data)
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
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 (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_state_after_line = UNDEF;
if (m_stopwrite)
@ -3197,7 +3197,7 @@ void hdc9234_device::index_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_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)
{
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
live_sync();
@ -3323,7 +3323,7 @@ WRITE_LINE_MEMBER( hdc9234_device::dmaack )
{
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);
}
}

View File

@ -162,7 +162,7 @@ void ram_device::device_validity_check(validity_checker &valid) const
else
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);
astring error;

View File

@ -676,7 +676,7 @@ void upd765_family_device::live_run(attotime limit)
if(read_one_bit(limit))
return;
#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 & 0x1000 ? 0x40 : 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))
return;
#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 & 0x1000 ? 0x40 : 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;
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;
if(slot == 5) {
live_delay(IDLE);
@ -760,7 +760,7 @@ void upd765_family_device::live_run(attotime limit)
if(read_one_bit(limit))
return;
#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 & 0x1000 ? 0x40 : 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))
return;
#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 & 0x1000 ? 0x40 : 0x00) |
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
@ -1117,7 +1117,7 @@ void upd765_family_device::live_run(attotime limit)
break;
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;
}
}
@ -1711,7 +1711,7 @@ void upd765_family_device::read_data_continue(floppy_info &fi)
return;
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;
}
}
@ -1837,7 +1837,7 @@ void upd765_family_device::write_data_continue(floppy_info &fi)
return;
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;
}
}
@ -2007,7 +2007,7 @@ void upd765_family_device::read_track_continue(floppy_info &fi)
return;
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;
}
}
@ -2080,7 +2080,7 @@ void upd765_family_device::format_track_continue(floppy_info &fi)
return;
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;
}
}
@ -2159,7 +2159,7 @@ void upd765_family_device::read_id_continue(floppy_info &fi)
return;
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;
}
}
@ -2287,7 +2287,7 @@ void upd765_family_device::index_callback(floppy_image_device *floppy, int state
break;
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;
}
@ -2335,7 +2335,7 @@ void upd765_family_device::general_continue(floppy_info &fi)
break;
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;
}
}

View File

@ -383,7 +383,7 @@ void wd_fdc_t::seek_continue()
return;
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;
}
}
@ -505,7 +505,7 @@ void wd_fdc_t::read_sector_continue()
break;
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;
}
}
@ -584,7 +584,7 @@ void wd_fdc_t::read_track_continue()
return;
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;
}
}
@ -659,7 +659,7 @@ void wd_fdc_t::read_id_continue()
return;
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;
}
}
@ -763,12 +763,12 @@ void wd_fdc_t::write_track_continue()
sprintf(buf, "%02x", format_last_byte);
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();
return;
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;
}
}
@ -867,7 +867,7 @@ void wd_fdc_t::write_sector_continue()
break;
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;
}
}
@ -898,7 +898,7 @@ void wd_fdc_t::interrupt_start()
}
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();
break;
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;
}
}
@ -963,7 +963,7 @@ void wd_fdc_t::do_generic()
default:
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;
}
}
@ -1285,7 +1285,7 @@ void wd_fdc_t::index_callback(floppy_image_device *floppy, int state)
break;
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;
}
@ -1360,12 +1360,12 @@ void wd_fdc_t::live_sync()
{
if(!cur_live.tm.is_never()) {
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();
live_run(machine().time());
pll_commit(floppy, cur_live.tm);
} 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);
if(cur_live.next_state != -1) {
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(;;) {
switch(cur_live.state) {
@ -1493,7 +1493,7 @@ void wd_fdc_t::live_run(attotime limit)
if(read_one_bit(limit))
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 & 0x1000 ? 0x40 : 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))
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 & 0x1000 ? 0x40 : 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)
break;
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;
if(slot == 5) {
live_delay(IDLE);
@ -1609,7 +1609,7 @@ void wd_fdc_t::live_run(attotime limit)
if(read_one_bit(limit))
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 & 0x1000 ? 0x40 : 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))
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 & 0x1000 ? 0x40 : 0x00) |
(cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
@ -1954,7 +1954,7 @@ void wd_fdc_t::live_run(attotime limit)
break;
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();
return;
}
@ -2017,7 +2017,7 @@ void wd_fdc_t::live_run(attotime limit)
break;
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;
}
}
@ -2186,12 +2186,12 @@ int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_dev
/* if (TRACE_TRANSITION)
if(!when.is_never())
logerror("transition_time=%s\n", tts(when).cstr());
logerror("transition_time=%s\n", tts(when).c_str());
*/
for(;;) {
// if (TRACE_TRANSITION) logerror("slot=%2d, counter=%03x\n", slot, counter);
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)
return -1;
if(transition_time == 0xffff && !when.is_never() && etime >= when)

View File

@ -285,15 +285,15 @@ void CLIB_DECL popmessage(const char *format, ...)
va_end(arg);
// 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
logerror("popmessage: %s\n", temp.cstr());
logerror("popmessage: %s\n", temp.c_str());
#ifdef MAME_DEBUG
// 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
*/
}

View File

@ -129,7 +129,7 @@ device_t *machine_config::device_add(device_t *owner, const char *tag, device_ty
break;
if (!curdevice)
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;
tag = next+1;
}

View File

@ -1836,9 +1836,9 @@ void address_space::prepare_map()
{
// if we can't find it, add it to our map
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()));
manager().m_sharelist.append(fulltag, *share);
}
@ -1880,7 +1880,7 @@ void address_space::prepare_map()
entry->m_devbase.subtag(fulltag, entry->m_region);
// 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)
{
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)
{
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)
{
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)
{
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)
{
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)
return true;
}
@ -4022,7 +4022,7 @@ void memory_bank::set_entry(int entrynum)
if (entrynum < 0 || entrynum >= m_entry.count())
throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
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
m_curentry = entrynum;

View File

@ -1328,9 +1328,9 @@ void layout_element::component::load_bitmap()
// log an error
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
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());
}
}

View File

@ -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);
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 */
if (ROM_ISOPTIONAL(romp))
{
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++;
}
@ -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))
{
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++;
}
@ -463,7 +463,7 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp,
else
{
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++;
}
}
@ -560,7 +560,7 @@ static void display_rom_load_results(romload_private *romdata, bool from_list)
if (romdata->errors != 0)
{
/* 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());
}
@ -570,7 +570,7 @@ static void display_rom_load_results(romload_private *romdata, bool from_list)
romdata->errorstring.cat("WARNING: the ");
romdata->errorstring.cat(emulator_info::get_gamenoun());
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
astring swlist(tag1.cstr());
astring swlist(tag1.c_str());
tag2.cpy(swlist.cat(tag4));
if (has_parent)
{
@ -695,33 +695,33 @@ static int open_rom_file(romload_private *romdata, const char *regiontag, const
if (!is_list)
{
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
{
// 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;
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
if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL))
if ((romdata->file == NULL) && has_parent && (tag3.c_str() != NULL))
{
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
if ((romdata->file == NULL) && (tag4.cstr() != NULL))
if ((romdata->file == NULL) && (tag4.c_str() != NULL))
{
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
if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL))
if ((romdata->file == NULL) && has_parent && (tag5.c_str() != NULL))
{
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
astring swlist(tag1.cstr());
astring swlist(tag1.c_str());
tag2.cpy(swlist.cat(tag4));
if (has_parent)
{
@ -1098,22 +1098,22 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_
else
{
// try to load from list/setname
if ((filerr != FILERR_NONE) && (tag2.cstr() != NULL))
filerr = common_process_file(options, tag2.cstr(), ".chd", romp, image_file);
if ((filerr != FILERR_NONE) && (tag2.c_str() != NULL))
filerr = common_process_file(options, tag2.c_str(), ".chd", romp, image_file);
// try to load from list/parentname (if any)
if ((filerr != FILERR_NONE) && has_parent && (tag3.cstr() != NULL))
filerr = common_process_file(options, tag3.cstr(), ".chd", romp, image_file);
if ((filerr != FILERR_NONE) && has_parent && (tag3.c_str() != NULL))
filerr = common_process_file(options, tag3.c_str(), ".chd", romp, image_file);
// try to load from setname
if ((filerr != FILERR_NONE) && (tag4.cstr() != NULL))
filerr = common_process_file(options, tag4.cstr(), ".chd", romp, image_file);
if ((filerr != FILERR_NONE) && (tag4.c_str() != NULL))
filerr = common_process_file(options, tag4.c_str(), ".chd", romp, image_file);
// try to load from parentname (if any)
if ((filerr != FILERR_NONE) && has_parent && (tag5.cstr() != NULL))
filerr = common_process_file(options, tag5.cstr(), ".chd", romp, image_file);
if ((filerr != FILERR_NONE) && has_parent && (tag5.c_str() != NULL))
filerr = common_process_file(options, tag5.c_str(), ".chd", romp, image_file);
// 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
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");
/* 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);
file_error filerr = diff_file.open(fname);
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());
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);
}
/* 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);
filerr = diff_file.open(fname);
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();
/* 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_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
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");
/* 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));
if (err != CHDERR_NONE)
{
@ -1255,13 +1255,13 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag
/* verify the hash */
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);
romdata->warnings++;
}
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++;
}
@ -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());
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++;
global_free(chd);
continue;
@ -1385,7 +1385,7 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c
UINT32 regionlength = ROMREGION_GETLENGTH(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 */
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))
{
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 */
@ -1463,7 +1463,7 @@ static void process_region_list(romload_private *romdata)
UINT32 regionlength = ROMREGION_GETLENGTH(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 */
assert(ROMENTRY_ISREGION(region));
@ -1548,7 +1548,7 @@ void rom_init(running_machine &machine)
} else {
specbios = romdata->machine().options().sub_value(temp,device->owner()->tag()+1,"bios");
if (strlen(specbios) == 0) {
specbios = device->default_bios_tag().cstr();
specbios = device->default_bios_tag().c_str();
}
}
determine_bios_rom(romdata, device, specbios);

View File

@ -179,7 +179,7 @@ void save_manager::save_memory(device_t *device, const char *module, const char
// error if we are equal
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
@ -333,7 +333,7 @@ UINT32 save_manager::signature() const
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
{
// 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
UINT32 temp[2];
@ -353,7 +353,7 @@ UINT32 save_manager::signature() const
void save_manager::dump_registry() const
{
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));
}

View File

@ -757,11 +757,11 @@ void device_scheduler::rebuild_execute_list()
{
device_t *device = machine().device(machine().config().m_perfect_cpu_quantum);
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;
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);
}

View File

@ -1058,5 +1058,5 @@ void screen_device::load_effect_overlay(const char *filename)
if (m_screen_overlay_bitmap.valid())
m_container->set_overlay(&m_screen_overlay_bitmap);
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());
}

View File

@ -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
// 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;
// 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
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());
bool is_clone = false;

View File

@ -63,7 +63,7 @@ DISCRETE_RESET(dss_adjustment)
double min, max;
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)
fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag\n", this->index());

View File

@ -1786,7 +1786,7 @@ void tilemap_device::device_start()
// look for an extension entry
astring tag_ext(tag(), "_ext");
share = memshare(tag_ext.cstr());
share = memshare(tag_ext.c_str());
if (share != NULL)
m_extmem.set(*share, m_bytes_per_entry);
}

View File

@ -118,7 +118,7 @@ void ui_menu_barcode_reader::handle()
machine().ui().popup_time(5, "Barcode length invalid!");
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 (m_barcode_buffer[0] != '\0')
memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer));

View File

@ -29,7 +29,7 @@ ui_menu_device_config::ui_menu_device_config(running_machine &machine, render_co
device_iterator deviter(machine.config().root_device());
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;
break;
@ -176,7 +176,7 @@ void ui_menu_device_config::populate()
}
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;

View File

@ -414,7 +414,7 @@ void ui_menu_input::populate_and_sort(input_item_data *itemlist)
item = itemarray[curitem];
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)
first_entry = false;
@ -568,7 +568,7 @@ void ui_menu_settings::populate()
flags |= MENU_FLAG_RIGHT_ARROW;
/* 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)
first_entry = false;
@ -872,7 +872,7 @@ void ui_menu_analog::populate()
analog_item_data *data;
UINT32 flags = 0;
astring name;
if (strcmp(field->device().tag(), prev_owner.cstr()) != 0)
if (strcmp(field->device().tag(), prev_owner.c_str()) != 0)
{
if (first_entry)
first_entry = false;
@ -895,7 +895,7 @@ void ui_menu_analog::populate()
{
default:
case ANALOG_ITEM_KEYSPEED:
text.printf("%s Digital Speed", name.cstr());
text.printf("%s Digital Speed", name.c_str());
subtext.printf("%d", settings.delta);
data->min = 0;
data->max = 255;
@ -904,7 +904,7 @@ void ui_menu_analog::populate()
break;
case ANALOG_ITEM_CENTERSPEED:
text.printf("%s Autocenter Speed", name.cstr());
text.printf("%s Autocenter Speed", name.c_str());
subtext.printf("%d", settings.centerdelta);
data->min = 0;
data->max = 255;
@ -913,7 +913,7 @@ void ui_menu_analog::populate()
break;
case ANALOG_ITEM_REVERSE:
text.printf("%s Reverse", name.cstr());
text.printf("%s Reverse", name.c_str());
subtext.cpy(settings.reverse ? "On" : "Off");
data->min = 0;
data->max = 1;
@ -922,7 +922,7 @@ void ui_menu_analog::populate()
break;
case ANALOG_ITEM_SENSITIVITY:
text.printf("%s Sensitivity", name.cstr());
text.printf("%s Sensitivity", name.c_str());
subtext.printf("%d", settings.sensitivity);
data->min = 1;
data->max = 255;

View File

@ -56,7 +56,7 @@ void ui_menu_main::populate()
item_append("Input (general)", NULL, 0, (void *)INPUT_GROUPS);
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 */
if (machine().ioport().has_analog())
@ -66,7 +66,7 @@ void ui_menu_main::populate()
if (machine().ioport().has_configs())
{
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 */
@ -74,7 +74,7 @@ void ui_menu_main::populate()
/* add game info menu */
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());
if (imgiter.first() != NULL)
@ -135,7 +135,7 @@ void ui_menu_main::populate()
/* add reset and exit menus */
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()

View File

@ -185,7 +185,7 @@ void ui_menu::reset(ui_menu_reset_options options)
// add an item to return
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())
item_append("Exit", NULL, 0, NULL);
else

View File

@ -128,7 +128,7 @@ void ui_menu_bios_selection::handle()
astring value;
astring temp;
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);
}
reset(UI_MENU_RESET_REMEMBER_REF);

View File

@ -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);
// 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
if (driver->flags & GAME_NOT_WORKING)

View File

@ -87,7 +87,7 @@ void ui_menu_software_parts::populate()
menu_part_name.cat(" (").cat(swpart->feature("part_id")).cat(")");
entry->type = T_ENTRY;
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);
}
}
}

View File

@ -360,7 +360,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
{
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));
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;
}
@ -1134,7 +1134,7 @@ astring &ui_manager::game_info_astring(astring &string)
{
// print description, manufacturer, and CPU:
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
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"
"Press ''%s'' to quit,\n"
"Press ''%s'' to return to emulation.",
ui_select_text.cstr(),
ui_cancel_text.cstr());
ui_select_text.c_str(),
ui_cancel_text.c_str());
machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
machine.pause();

View File

@ -203,12 +203,12 @@ void validity_checker::check_all()
if (m_errors > 0)
{
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)
{
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");
}
@ -299,16 +299,16 @@ void validity_checker::validate_one(const game_driver &driver)
if (m_errors > start_errors || m_warnings > start_warnings)
{
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)
{
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)
{
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");
}
@ -523,14 +523,14 @@ void validity_checker::validate_driver()
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);
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
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);
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
@ -645,7 +645,7 @@ void validity_checker::validate_roms()
// attempt to add it to the map, reporting duplicates as errors
current_length = ROMREGION_GETLENGTH(romp);
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
@ -883,7 +883,7 @@ void validity_checker::validate_inputs()
// report any errors during construction
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
for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
@ -1010,7 +1010,7 @@ void validity_checker::validate_devices()
{
astring temptag("_");
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
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());
}
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());
}
}

View File

@ -1158,7 +1158,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
// copy the device name to an astring
astring snapdevname;
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
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
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)
{
@ -1181,7 +1181,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
// setup snapname and remove the %d_
snapstr.replace(0, snapdevname, filename);
snapstr.del(pos, 3);
//printf("check image: %s\n", filename.cstr());
//printf("check image: %s\n", filename.c_str());
name_found = 1;
}
@ -1215,7 +1215,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
for (int seq = 0; ; seq++)
{
// 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
file_error filerr = file.open(fname);

View File

@ -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, "Pragma", "no-cache");
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 0;

View File

@ -371,7 +371,7 @@ void ldplayer_state::machine_reset()
timer_set(attotime::zero, TIMER_ID_AUTOPLAY);
// indicate the name of the file we opened
popmessage("Opened %s\n", m_filename.cstr());
popmessage("Opened %s\n", m_filename.c_str());
}

View File

@ -74,7 +74,7 @@ public:
// C string conversion operators and helpers
operator const char *() const { return m_text; }
const char *cstr() const { return m_text; }
const char *c_str() const { return m_text; }
// buffer management
astring &reset() { return cpy(""); }
@ -86,19 +86,19 @@ public:
// copy helpers
astring &cpy(const char *src, int count);
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)); }
// insertion helpers
astring &ins(int insbefore, const char *src, int count);
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)); }
// concatenation helpers (== insert at end)
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 &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(char ch) { return ins(-1, &ch, 1); }
@ -117,13 +117,13 @@ public:
// comparison helpers
int cmp(const char *str2, int count) 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)); }
// case-insensitive comparison helpers
int icmp(const char *str2, int count) 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)); }
// character searching helpers

View File

@ -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]);
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);
return NULL;
}

View File

@ -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, 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 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 delete_metadata(chd_metadata_tag metatag, UINT32 metaindex);
chd_error clone_all_metadata(chd_file &source);

View File

@ -695,7 +695,7 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_
#if 0
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
@ -771,7 +771,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
wavlen = parse_wav_sample(lastfname, &wavoffs);
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;
}
}
@ -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
// 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]);
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 (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)
{
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;
}
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);
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;
}
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);
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;
}
tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);

View File

@ -364,7 +364,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri
// can only have one 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;
}
m_command = curentry->name();
@ -635,14 +635,14 @@ bool core_options::set_value(const char *name, int value, int priority, astring
{
astring tempstr;
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)
{
astring tempstr;
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:
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;
}
break;
@ -761,12 +761,12 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch
case OPTION_INTEGER:
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;
}
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;
}
break;
@ -775,12 +775,12 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch
case OPTION_FLOAT:
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;
}
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;
}
break;

View File

@ -75,7 +75,7 @@ public:
public:
// getters
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 *value() const { return m_data; }
const char *default_value() const { return m_defdata; }

View File

@ -237,7 +237,7 @@ int find_input_strings(running_machine &machine)
sc45helperlog("%s", tempstring.cstr());
sc45helperlog("%s", tempstring.c_str());
sc45helperlog("\n");
@ -316,48 +316,48 @@ int find_input_strings(running_machine &machine)
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++;
}
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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++;
}
@ -390,7 +390,7 @@ void set_clickable_temp(running_machine &machine, const astring &teststring, int
{
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].clickmask = clickmask;
@ -507,7 +507,7 @@ int find_lamp_strings(running_machine &machine)
fatalerror("duplicate lamp?\n");
}
//sc45helperlog("%s", tempstring.cstr());
//sc45helperlog("%s", tempstring.c_str());
//sc45helperlog("\n");
@ -521,7 +521,7 @@ int find_lamp_strings(running_machine &machine)
//sc45helperlog("---ROW %02d---\n", y);
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++;
}
}
@ -536,7 +536,7 @@ int find_lamp_strings(running_machine &machine)
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;
if (!strcmp(lamps[y][x].lampname_alt.cstr(), "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.cstr(), "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.cstr(), "start")) lamps[y][x].lampname_alt = "strt exch";
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2";
if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3";
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.c_str(), "canc/coll")) lamps[y][x].lampname_alt = "cancel";
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++)
{
if (!strcmp(tempname2, lamps[y][x].lampname_alt.cstr()))
if (!strcmp(tempname2, lamps[y][x].lampname_alt.c_str()))
{
//sc45helperlog("%s found\n", tempname2);
lamps[y][x].draw_label = false;
@ -640,7 +640,7 @@ int find_lamp_strings(running_machine &machine)
}
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);
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);
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);
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.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");
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");
}
sc45helperlog("%s", tempstring.cstr());
sc45helperlog("%s", tempstring.c_str());

View File

@ -462,7 +462,7 @@ public:
TILE_GET_INFO_MEMBER(get_sfbonus_reel4_tile_info);
virtual void machine_reset();
virtual void video_start();
void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int catagory);
void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category);
UINT32 screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
@ -929,7 +929,7 @@ void sfbonus_state::video_start()
}
void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int catagory)
void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category)
{
int zz;
int i;
@ -1021,38 +1021,38 @@ void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap,
if (rowenable2==0)
{
m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),3);
m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),3);
}
if (rowenable==0)
{
m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),3);
m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),3);
}
if (rowenable2==0x1)
{
m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),2);
m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),2);
}
if (rowenable==0x1)
{
m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),2);
m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),2);
}
if (rowenable2==0x2)
{
m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),1);
m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),1);
}
if (rowenable==0x2)
{
m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),1);
m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),1);
}
if (rowenable2==0x3)
{
m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),4);
m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),4);
}
if (rowenable==0x3)
{
m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),4);
m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),4);
}

View File

@ -47,7 +47,7 @@ void sega_315_5881_crypt_device::device_start()
astring skey = parameter("key");
if(skey)
key = strtoll(skey.cstr(), 0, 16);
key = strtoll(skey.c_str(), 0, 16);
else
{
logerror("%s: Warning: key not provided\n", tag());

View File

@ -32,7 +32,7 @@ void naomi_m1_board::device_start()
astring skey = parameter("key");
if(skey)
key = strtoll(skey.cstr(), 0, 16);
key = strtoll(skey.c_str(), 0, 16);
else
{
logerror("%s: Warning: key not provided\n", tag());

View File

@ -159,7 +159,7 @@ int aim65_state::load_cart(device_image_interface &image, generic_slot_device *s
astring errmsg;
errmsg.printf("Attempted to load file with wrong extension\nSocket '%s' only accepts files with '.%s' extension",
slot_tag, slot_tag);
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.c_str());
return IMAGE_INIT_FAIL;
}

View File

@ -19,6 +19,7 @@
@27 HD38800A 1981, Bandai Packri Monster (DM-21Z)
*51 HD38800A 1981, Actronics(Hanzawa) Twinvader
@70 HD38800A 1982, Coleco Galaxian
@73 HD38800A 1982, Mattel Star Hawk
@23 HD38800B 1982, Tomy Kingman (THF-01II)
*24 HD38800B 1982, Actronics(Hanzawa) Wanted G-Man
@ -43,6 +44,26 @@
***************************************************************************/
/***************************************************************************
Mattel Star Hawk (manufactured in Japan)
* PCBs are labeled Kaken, PT-317B
* Hitachi HD38800A73 MCU
* cyan/red VFD display Futaba DM-41ZK, with partial color overlay
NOTE!: MESS external artwork is recommended
***************************************************************************/
#include "emu.h"
#include "cpu/hmcs40/hmcs40.h"
#include "sound/speaker.h"
@ -287,7 +308,7 @@ INPUT_CHANGED_MEMBER(hh_hmcs40_state::single_interrupt_line)
/***************************************************************************
Bambino Basketball - Dribble Away (manufactured in Japan)
* boards are labeled Emix Corp. ET-05
* PCBs are labeled Emix Corp. ET-05
* Hitachi HD38750A08 MCU
* green VFD display Emix-106, with bezel overlay
@ -399,7 +420,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Bandai Packri Monster (manufactured in Japan)
* board label DM-21ZA2
* PCB label DM-21ZA2
* Hitachi HD38800A27 MCU
* cyan/red/green VFD display Futaba DM-21ZK 2B, with bezel overlay
@ -731,7 +752,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Coleco Donkey Kong (manufactured in Taiwan)
* board label Coleco Rev C 75790 DK
* PCB label Coleco Rev C 75790 DK
* Hitachi HD38820A45 MCU
* cyan/red VFD display Futaba DM-47ZK 2K, with color overlay
@ -859,7 +880,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Coleco Galaxian (manufactured in Taiwan)
* board label Coleco Rev A 75718
* PCB label Coleco Rev A 75718
* Hitachi HD38800A70 MCU
* cyan/red VFD display Futaba DM-36Z 2H, with color overlay
@ -976,7 +997,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Coleco Pac-Man (manufactured in Taiwan)
* board label Coleco 75690
* PCB label Coleco 75690
* Hitachi HD38820A28/29 MCU
* cyan/red VFD display Futaba DM-34Z 2A, with color overlay
@ -1097,7 +1118,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Coleco Ms. Pac-Man (manufactured in Taiwan)
* board label Coleco 911171
* PCB label Coleco 911171
* Hitachi HD38820A61 MCU
* cyan/red VFD display Futaba DM-60Z 3I, with color overlay
@ -1501,7 +1522,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Tomy Kingman (manufactured in Japan)
* boards are labeled THF-01II 2E138E01/2E128E02
* PCBs are labeled THF-01II 2E138E01/2E128E02
* Hitachi HD38800B23 MCU
* cyan/red/blue VFD display Futaba DM-65ZK 3A
@ -1622,9 +1643,9 @@ MACHINE_CONFIG_END
/***************************************************************************
Tomy(tronic) Tron (manufactured in Japan)
* boards are labeled THN-02 2E114E07
* PCBs are labeled THN-02 2E114E07
* Hitachi HD38800A88 MCU
* cyan/red/green VFD display NEC FIP10AM24T
* cyan/red/green VFD display NEC FIP10AM24T no. 2-8 1
NOTE!: MESS external artwork is recommended

View File

@ -26,7 +26,7 @@
*MP2139 TMS1370? 1982, Gakken Galaxy Invader 1000
*MP2788 ? 1980, Bandai Flight Time (? note: VFD-capable)
@MP3226 TMS1000 1978, Milton Bradley Simon
*MP3301 TMS1000 1979, Milton Bradley Bigtrak
*MP3301 TMS1000 1979, Milton Bradley Big Trak
*MP3320A TMS1000 1979, Coleco Head to Head Basketball
MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.c
@MP3404 TMS1100 1978, Parker Brothers Merlin
@ -918,7 +918,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Entex Electronic Baseball 2
* boards are labeled: ZENY
* PCBs are labeled: ZENY
* TMS1000 MCU, MP0923 (die labeled MP0923)
* 3 7seg LEDs, and other LEDs behind bezel, 1bit sound
@ -1045,7 +1045,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Entex Electronic Baseball 3
* boards are labeled: ZENY
* PCBs are labeled: ZENY
* TMS1100NLL 6007 MP1204 (die labeled MP1204)
* 2*SN75492N LED display driver
* 4 7seg LEDs, and other LEDs behind bezel, 1bit sound

View File

@ -12,6 +12,7 @@
@031 uPD553C 1979, Bambino Superstar Football (ET-03)
*042 uPD552C 1979, Tomy Space Attack
@048 uPD552C 1980, Tomy Tennis (TN-04)
@049 uPD553C 1979, Mego Mini-Vid Break Free
@055 uPD553C 1980, Bambino Laser Fight (ET-12)
*085 uPD650C 1980, Roland TR-808
*102 uPD553C 1981, Bandai Block Out
@ -19,15 +20,55 @@
*128 uPD650C 1982, Roland TR-606
133 uPD650C 1982, Roland TB-303 -> tb303.c
@160 uPD553C 1982, Tomy Pac Man (TN-08)
@192 uPD553C 1982, Tomy Scramble (TN-10)
@202 uPD553C 1982, Epoch Astro Command
@206 uPD553C 1982, Epoch Dracula
*209 uPD553C 1982, Tomy Caveman (TN-12)
@209 uPD553C 1982, Tomy Caveman (TN-12)
@258 uPD553C 1984, Tomy Alien Chase (TN-16)
(* denotes not yet emulated by MESS, @ denotes it's in this driver)
***************************************************************************/
/***************************************************************************
Mego Mini-Vid Break Free (manufactured in Japan)
* PCB label Mego 79 rev F
* NEC uCOM-43 MCU, labeled D553C 031
* cyan VFD display Futaba DM-4.5 91
NOTE!: MESS external artwork is recommended
***************************************************************************/
/***************************************************************************
Tomy(tronic) Caveman (manufactured in Japan)
* PCBs are labeled TN-12 2E114E03
* NEC uCOM-43 MCU, labeled D553C 209
* cyan/red/green VFD display NEC FIP8AM20T no. 2-42
NOTE!: MESS external artwork is recommended
***************************************************************************/
/***************************************************************************
Tomy(tronic) Scramble (manufactured in Japan)
* PCBs are labeled TN-10 2E114E01
* NEC uCOM-43 MCU, labeled D553C 192
* cyan/red/green VFD display NEC FIP10CM20T no. 2-41
NOTE!: MESS external artwork is recommended
***************************************************************************/
#include "emu.h"
#include "cpu/ucom4/ucom4.h"
#include "sound/speaker.h"
@ -515,7 +556,7 @@ MACHINE_CONFIG_END
Epoch Astro Command (manufactured in Japan)
* PCB label 96111
* NEC uCOM-43 MCU, labeled D553C 202
* cyan/red VFD display NEC FIP9AM20T NO.42, with color overlay
* cyan/red VFD display NEC FIP9AM20T no. 42-42, with color overlay (FIP=fluorescent indicator panel)
known releases:
- Japan: Astro Command
@ -624,7 +665,7 @@ MACHINE_CONFIG_END
Epoch Dracula (manufactured in Japan)
* PCB label 96121
* NEC uCOM-43 MCU, labeled D553C 206
* cyan/red/green VFD display NEC FIP8BM20T (FIP=fluorescent indicator panel)
* cyan/red/green VFD display NEC FIP8BM20T no. 2-42
known releases:
- Japan: Dracula House, yellow case
@ -717,9 +758,9 @@ MACHINE_CONFIG_END
/***************************************************************************
Tomy(tronic) Tennis (manufactured in Japan)
* board labeled TOMY TN-04 TENNIS
* PCB labeled TOMY TN-04 TENNIS
* NEC uCOM-44 MCU, labeled D552C 048
* VFD display NEC FIP11AM15T
* VFD display NEC FIP11AM15T tube no. 0F
The initial release of this game was in 1979, known as Pro-Tennis,
it has a D553 instead of D552, with just a little over 50% ROM used.
@ -876,9 +917,9 @@ MACHINE_CONFIG_END
/***************************************************************************
Tomy(tronic) Pac-Man (manufactured in Japan)
* boards are labeled TN-08 2E108E01
* PCBs are labeled TN-08 2E108E01
* NEC uCOM-43 MCU, labeled D553C 160
* cyan/red/green VFD display NEC FIP8AM18T
* cyan/red/green VFD display NEC FIP8AM18T no. 2-21
* bright yellow round casing
known releases:
@ -984,7 +1025,7 @@ MACHINE_CONFIG_END
/***************************************************************************
Tomy Alien Chase (manufactured in Japan)
* boards are labeled TN-16 2E121B01
* PCBs are labeled TN-16 2E121B01
* NEC uCOM-43 MCU, labeled D553C 258
* red/green VFD display NEC FIP9AM24T, with color overlay, 2-sided*

View File

@ -427,7 +427,7 @@ int pegasus_state::load_cart(device_image_interface &image, generic_slot_device
{
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.");
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.c_str());
return IMAGE_INIT_FAIL;
}
}

View File

@ -64,7 +64,7 @@ static void log_quickload(running_machine &machine, const char *type, UINT32 sta
tempstring.catprintf(exec_format, exec);
}
machine.ui().popup_time(10, "%s", tempstring.cstr());
machine.ui().popup_time(10, "%s", tempstring.c_str());
}
/*******************************************************************

View File

@ -377,7 +377,7 @@ DEVICE_IMAGE_LOAD_MEMBER( thomson_state, to7_cartridge )
{
astring errmsg;
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;
}
@ -1518,7 +1518,7 @@ DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge )
{
astring errmsg;
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;
}

View File

@ -1227,7 +1227,7 @@ bool ti99_cartridge_device::call_load()
{
// File name is in m_basename
// 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)
{
@ -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");
}
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
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);

View File

@ -510,7 +510,7 @@ public:
{
if (m_detail==NULL) return error_text[(int)m_err];
astring errormsg(error_text[(int)m_err], ": ", m_detail);
return core_strdup(errormsg.cstr());
return core_strdup(errormsg.c_str());
}
private:

View File

@ -114,7 +114,7 @@ void DeviceInformationWindowQtConfig::applyToQWidget(QWidget* widget)
{
WindowQtConfig::applyToQWidget(widget);
DeviceInformationWindow* window = dynamic_cast<DeviceInformationWindow*>(widget);
window->set_device(m_device_tag.cstr());
window->set_device(m_device_tag.c_str());
}

View File

@ -138,7 +138,7 @@ void MainWindow::setProcessor(device_t* processor)
// Window title
astring title;
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;
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());
QAction* mountAct = new QAction("Mount...", interfaceMenu);

View File

@ -54,7 +54,7 @@ bool osd_font_osx::open(const char *font_path, const char *_name, int &height)
}
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)
{
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)
{
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;
}

View File

@ -72,7 +72,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
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(font_path, OPEN_FLAG_READ);
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();
font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
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))
{
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;
}
@ -195,7 +195,7 @@ TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(astring name, int fsize)
if (memcmp(buffer, magic, 5))
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)
@ -227,7 +227,7 @@ TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic,
config = FcConfigGetCurrent();
pat = FcPatternCreate();
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
if (bold)
@ -287,7 +287,7 @@ TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic,
FcFontSetDestroy(fontset);
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_FONTFORMAT, (const FcChar8 *)"TrueType");
fontset = FcFontList(config, pat, os);

View File

@ -260,7 +260,7 @@ void osd_common_t::update_option(const char * key, dynamic_array<const char *> &
new_option_value.cat(t);
}
// 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()));
}

View File

@ -245,7 +245,7 @@ private:
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 = "";
}
return m_mod_man.select_module(opt_name, opt_val);

View File

@ -3489,7 +3489,7 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp
for (int seq = 0; ; seq++)
{
// 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
file_error filerr = file.open(fname);

View File

@ -742,7 +742,7 @@ static void sdlinput_register_joysticks(running_machine &machine)
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: ... 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
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]);
}
@ -809,9 +809,9 @@ static void sdlinput_register_joysticks(running_machine &machine)
else
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]);
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]);
}
}
@ -869,9 +869,9 @@ static void sdlinput_register_mice(running_machine &machine)
continue;
// 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);
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);
for (button = 0; button < 4; button++)
@ -886,7 +886,7 @@ static void sdlinput_register_mice(running_machine &machine)
if (0 && mouse_enabled)
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");
}
@ -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
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();
@ -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]);
}
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");
}
#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);
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);
@ -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)]);
}
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");
}
@ -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)
// add it now
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
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)]);
}
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");
}
#endif
@ -1742,7 +1742,7 @@ void sdlinput_poll(running_machine &machine)
case SDL_KEYDOWN:
#ifdef SDL2_MULTIAPI
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
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]);
#endif
@ -1841,7 +1841,7 @@ void sdlinput_poll(running_machine &machine)
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[0]);
#endif
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)
{
// FIXME Move static declaration
@ -1899,7 +1899,7 @@ void sdlinput_poll(running_machine &machine)
#endif
#if (SDLMAME_SDL2)
// 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.lY += event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
#else

View File

@ -212,7 +212,7 @@ sdl_options::sdl_options()
astring ini_path(INI_PATH);
add_entries(sdl_options::s_option_entries);
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());
}
//============================================================

View File

@ -327,7 +327,7 @@ public:
m_lastfile = m_info.track[tracknum].fname;
file_error filerr = core_fopen(m_lastfile, OPEN_FLAG_READ, &m_file);
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
@ -351,7 +351,7 @@ public:
core_fseek(m_file, src_frame_start, SEEK_SET);
UINT32 count = core_fread(m_file, dest, 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
@ -940,7 +940,7 @@ static void parse_input_chd_parameters(const parameters_t &params, chd_file &inp
{
chd_error err = input_parent_chd.open(*input_chd_parent_str);
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
@ -949,7 +949,7 @@ static void parse_input_chd_parameters(const parameters_t &params, chd_file &inp
{
chd_error err = input_chd.open(*input_chd_str, writeable, input_parent_chd.opened() ? &input_parent_chd : NULL);
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 &params, chd_file
{
chd_error err = output_parent_chd.open(*output_chd_parent_str);
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
@ -1083,10 +1083,10 @@ static void parse_compression(const parameters_t &params, chd_codec_type compres
{
astring name(*compression_str, start, (end == -1) ? -1 : end - start);
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]);
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;
if (end == -1)
break;
@ -1258,7 +1258,7 @@ void output_track_metadata(int mode, core_file *file, int tracknum, const cdrom_
}
// 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
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));
else
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
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
astring tempstr;
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
if (tracknum > 0)
@ -1340,7 +1340,7 @@ static void do_info(parameters_t &params)
// print filename and version
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());
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());
@ -1504,7 +1504,7 @@ static void do_verify(parameters_t &params)
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);
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
rawsha1.append(buffer, bytes_to_read);
@ -1568,7 +1568,7 @@ static void do_create_raw(parameters_t &params)
{
file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
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
@ -1604,10 +1604,10 @@ static void do_create_raw(parameters_t &params)
// print some info
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())
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
printf("Input file: %s\n", input_file_str->cstr());
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
printf("Input file: %s\n", input_file_str->c_str());
if (input_start != 0 || input_end != core_fsize(input_file))
{
printf("Input start: %s\n", big_int_string(tempstr, input_start));
@ -1629,7 +1629,7 @@ static void do_create_raw(parameters_t &params)
else
err = chd->create(*output_chd_str, input_end - input_start, hunk_size, unit_size, compression);
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 (output_parent.opened())
@ -1665,7 +1665,7 @@ static void do_create_hd(parameters_t &params)
{
file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
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
@ -1740,11 +1740,11 @@ static void do_create_hd(parameters_t &params)
// load the file
file_error filerr = core_fload(*ident_str, identdata);
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
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];
heads = (identdata[7] << 8) | identdata[6];
sectors = (identdata[13] << 8) | identdata[12];
@ -1775,12 +1775,12 @@ static void do_create_hd(parameters_t &params)
// print some info
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())
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)
{
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))
{
printf("Input start: %s\n", big_int_string(tempstr, input_start));
@ -1807,7 +1807,7 @@ static void do_create_hd(parameters_t &params)
else
err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(sector_size), hunk_size, sector_size, compression);
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
astring metadata;
@ -1856,7 +1856,7 @@ static void do_create_cd(parameters_t &params)
{
chd_error err = chdcd_parse_toc(*input_file_str, toc, track_info);
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
@ -1889,10 +1889,10 @@ static void do_create_cd(parameters_t &params)
// print some info
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())
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
printf("Input file: %s\n", input_file_str->cstr());
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
printf("Input file: %s\n", input_file_str->c_str());
printf("Input tracks: %d\n", toc.numtrks);
printf("Input length: %s\n", msf_string_from_frames(tempstr, origtotalsectors));
printf("Compression: %s\n", compression_string(tempstr, compression));
@ -1910,7 +1910,7 @@ static void do_create_cd(parameters_t &params)
else
err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, CD_FRAME_SIZE, compression);
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
err = cdrom_write_metadata(chd, &toc);
@ -1947,7 +1947,7 @@ static void do_create_ld(parameters_t &params)
{
avi_error avierr = avi_open(*input_file_str, &input_file);
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);
@ -1999,10 +1999,10 @@ static void do_create_ld(parameters_t &params)
// print some info
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())
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
printf("Input file: %s\n", input_file_str->cstr());
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
printf("Input file: %s\n", input_file_str->c_str());
if (input_start != 0 && input_end != aviinfo->video_numsamples)
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),
@ -2028,7 +2028,7 @@ static void do_create_ld(parameters_t &params)
else
err = chd->create(*output_chd_str, UINT64(input_end - input_start) * hunk_size, hunk_size, info.bytes_per_frame, compression);
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
astring metadata;
@ -2112,10 +2112,10 @@ static void do_copy(parameters_t &params)
// print some info
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())
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
if (input_start != 0 || input_end != input_chd.logical_bytes())
{
printf("Input start: %s\n", big_int_string(tempstr, input_start));
@ -2137,7 +2137,7 @@ static void do_copy(parameters_t &params)
else
err = chd->create(*output_chd_str, input_end - input_start, hunk_size, input_chd.unit_bytes(), compression);
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
dynamic_buffer metadata;
@ -2221,8 +2221,8 @@ static void do_extract_raw(parameters_t &params)
// print some info
astring tempstr;
printf("Output File: %s\n", output_file_str->cstr());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
printf("Output File: %s\n", output_file_str->c_str());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
if (input_start != 0 || input_end != input_chd.logical_bytes())
{
printf("Input start: %s\n", big_int_string(tempstr, input_start));
@ -2236,7 +2236,7 @@ static void do_extract_raw(parameters_t &params)
// process output file
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
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
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 &params)
UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_end - offset);
chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
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
UINT32 count = core_fwrite(output_file, buffer, 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
offset += bytes_to_read;
@ -2306,7 +2306,7 @@ static void do_extract_cd(parameters_t &params)
if (chop != -1)
default_name.substr(0, chop);
char basename[128];
strncpy(basename, default_name.cstr(), 127);
strncpy(basename, default_name.c_str(), 127);
default_name.cat(".bin");
if (output_bin_file_str == NULL)
output_bin_file_str = &default_name;
@ -2314,9 +2314,9 @@ static void do_extract_cd(parameters_t &params)
// print some info
astring tempstr;
printf("Output TOC: %s\n", output_file_str->cstr());
printf("Output Data: %s\n", output_bin_file_str->cstr());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
printf("Output TOC: %s\n", output_file_str->c_str());
printf("Output Data: %s\n", output_bin_file_str->c_str());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
// catch errors so we can close & delete the output file
core_file *output_bin_file = NULL;
@ -2337,14 +2337,14 @@ static void do_extract_cd(parameters_t &params)
// process output 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)
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
if (mode != MODE_GDI)
{
filerr = core_fopen(*output_bin_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
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
@ -2384,7 +2384,7 @@ static void do_extract_cd(parameters_t &params)
filerr = core_fopen(trackbin_name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
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;
}
@ -2449,7 +2449,7 @@ static void do_extract_cd(parameters_t &params)
core_fseek(output_bin_file, outputoffs, SEEK_SET);
UINT32 byteswritten = core_fwrite(output_bin_file, buffer, 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;
bufferoffs = 0;
}
@ -2548,8 +2548,8 @@ static void do_extract_ld(parameters_t &params)
// print some info
astring tempstr;
printf("Output File: %s\n", output_file_str->cstr());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->cstr());
printf("Output File: %s\n", output_file_str->c_str());
printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str());
if (input_start != 0 || input_end != input_chd.hunk_count())
{
printf("Input start: %s\n", big_int_string(tempstr, input_start));
@ -2563,7 +2563,7 @@ static void do_extract_ld(parameters_t &params)
// process output file
avi_error avierr = avi_create(*output_file_str, &info, &output_file);
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
avhuff_decompress_config avconfig;
@ -2592,7 +2592,7 @@ static void do_extract_ld(parameters_t &params)
if (err != CHDERR_NONE)
{
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
@ -2600,7 +2600,7 @@ static void do_extract_ld(parameters_t &params)
{
avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0);
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
@ -2608,7 +2608,7 @@ static void do_extract_ld(parameters_t &params)
{
avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
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 &params)
{
file_error filerr = core_fload(*file_str, file);
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
@ -2687,13 +2687,13 @@ static void do_add_metadata(parameters_t &params)
// print some info
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("Index: %d\n", index);
if (text_str != NULL)
printf("Text: %s\n", text.cstr());
printf("Text: %s\n", text.c_str());
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
chd_error err;
@ -2736,7 +2736,7 @@ static void do_del_metadata(parameters_t &params)
// print some info
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("Index: %d\n", index);
@ -2795,17 +2795,17 @@ static void do_dump_metadata(parameters_t &params)
{
file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
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
UINT32 count = core_fwrite(output_file, buffer, 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);
// provide some feedback
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

Some files were not shown because too many files have changed in this diff Show More