diff options
author | 2015-04-12 08:05:15 +0200 | |
---|---|---|
committer | 2015-04-12 08:05:43 +0200 | |
commit | 7faba31b1b8dcd6caa5f1b651d2693106de08d35 (patch) | |
tree | c528d5479eee247ee5305df53a298a09b594fccc | |
parent | 15a464dac99052edc0645374a77ecef8d1a65b0d (diff) |
There is no implicit conversion to char* in std::string (nw)
249 files changed, 782 insertions, 783 deletions
diff --git a/src/emu/addrmap.c b/src/emu/addrmap.c index 9da36efa2e3..4453da2668f 100644 --- a/src/emu/addrmap.c +++ b/src/emu/addrmap.c @@ -492,7 +492,7 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, dev { astring tag; owner.subtag(tag, entry->m_read.m_tag); - device_t *mapdevice = machine.device(tag); + device_t *mapdevice = machine.device(tag.c_str()); if (mapdevice == NULL) { 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()); } diff --git a/src/emu/audit.c b/src/emu/audit.c index 8de307d0728..bba38b56014 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -67,7 +67,7 @@ const char *driverpath = m_enumerator.config().root_device().searchpath(); astring combinedpath(device->searchpath(), ";", driverpath); if (device->shortname()) combinedpath.cat(";").cat(device->shortname()); -m_searchpath = combinedpath; +m_searchpath = combinedpath.c_str(); for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom)) { @@ -195,7 +195,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, soft locationtag.cat(swinfo->parentname()); combinedpath.cat(";").cat(swinfo->parentname()).cat(";").cat(list_name).cat(PATH_SEPARATOR).cat(swinfo->parentname()); } - m_searchpath = combinedpath; + m_searchpath = combinedpath.c_str(); int found = 0; int required = 0; @@ -226,7 +226,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, soft // audit a disk else if (ROMREGION_ISDISKDATA(region)) { - record = audit_one_disk(rom, (const char *)locationtag); + record = audit_one_disk(rom, locationtag.c_str()); } // count the number of files that are found. @@ -284,14 +284,14 @@ media_auditor::summary media_auditor::audit_samples() // look for the files emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD); - path_iterator path(searchpath); + path_iterator path(searchpath.c_str()); astring curpath; while (path.next(curpath, samplename)) { // attempt to access the file (.flac) or (.wav) - file_error filerr = file.open(curpath, ".flac"); + file_error filerr = file.open(curpath.c_str(), ".flac"); if (filerr != FILERR_NONE) - filerr = file.open(curpath, ".wav"); + filerr = file.open(curpath.c_str(), ".wav"); if (filerr == FILERR_NONE) { @@ -429,9 +429,9 @@ audit_record *media_auditor::audit_one_rom(const rom_entry *rom) // open the file if we can file_error filerr; if (has_crc) - filerr = file.open(curpath, crc); + filerr = file.open(curpath.c_str(), crc); else - filerr = file.open(curpath); + filerr = file.open(curpath.c_str()); // if it worked, get the actual length and hashes, then stop if (filerr == FILERR_NONE) diff --git a/src/emu/bus/a1bus/a1cassette.c b/src/emu/bus/a1bus/a1cassette.c index 0de09b41ced..3c27cc339a1 100644 --- a/src/emu/bus/a1bus/a1cassette.c +++ b/src/emu/bus/a1bus/a1cassette.c @@ -79,7 +79,7 @@ void a1bus_cassette_device::device_start() set_a1bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CASSETTE_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CASSETTE_ROM_REGION).c_str())->base(); install_device(0xc000, 0xc0ff, read8_delegate(FUNC(a1bus_cassette_device::cassette_r), this), write8_delegate(FUNC(a1bus_cassette_device::cassette_w), this)); install_bank(0xc100, 0xc1ff, 0, 0, (char *)"bank_a1cas", m_rom); diff --git a/src/emu/bus/a1bus/a1cffa.c b/src/emu/bus/a1bus/a1cffa.c index b3f1f631610..da73162547b 100644 --- a/src/emu/bus/a1bus/a1cffa.c +++ b/src/emu/bus/a1bus/a1cffa.c @@ -74,7 +74,7 @@ void a1bus_cffa_device::device_start() set_a1bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CFFA_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CFFA_ROM_REGION).c_str())->base(); install_device(0xafe0, 0xafff, read8_delegate(FUNC(a1bus_cffa_device::cffa_r), this), write8_delegate(FUNC(a1bus_cffa_device::cffa_w), this)); install_bank(0x9000, 0xafdf, 0, 0, (char *)"bank_cffa1", m_rom); diff --git a/src/emu/bus/a2bus/a2applicard.c b/src/emu/bus/a2bus/a2applicard.c index 7e09ac1ae5b..4552ee3dd62 100644 --- a/src/emu/bus/a2bus/a2applicard.c +++ b/src/emu/bus/a2bus/a2applicard.c @@ -98,7 +98,7 @@ void a2bus_applicard_device::device_start() // locate Z80 ROM astring tempstring; - m_z80rom = device().machine().root_device().memregion(this->subtag(tempstring, Z80_ROM_REGION))->base(); + m_z80rom = device().machine().root_device().memregion(this->subtag(tempstring, Z80_ROM_REGION).c_str())->base(); save_item(NAME(m_bROMAtZ80Zero)); save_item(NAME(m_z80stat)); diff --git a/src/emu/bus/a2bus/a2cffa.c b/src/emu/bus/a2bus/a2cffa.c index e3d5dfa3c09..484e121948a 100644 --- a/src/emu/bus/a2bus/a2cffa.c +++ b/src/emu/bus/a2bus/a2cffa.c @@ -110,7 +110,7 @@ void a2bus_cffa2000_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CFFA2_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CFFA2_ROM_REGION).c_str())->base(); // patch default setting so slave device is enabled and up to 13 devices on both connectors m_rom[0x800] = 13; diff --git a/src/emu/bus/a2bus/a2corvus.c b/src/emu/bus/a2bus/a2corvus.c index e8a91030884..3f85c8446af 100644 --- a/src/emu/bus/a2bus/a2corvus.c +++ b/src/emu/bus/a2bus/a2corvus.c @@ -123,7 +123,7 @@ void a2bus_corvus_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CORVUS_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, CORVUS_ROM_REGION).c_str())->base(); } void a2bus_corvus_device::device_reset() diff --git a/src/emu/bus/a2bus/a2diskii.c b/src/emu/bus/a2bus/a2diskii.c index e5cd748b6df..d48a4ccd7e2 100644 --- a/src/emu/bus/a2bus/a2diskii.c +++ b/src/emu/bus/a2bus/a2diskii.c @@ -115,7 +115,7 @@ void a2bus_floppy_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, DISKII_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, DISKII_ROM_REGION).c_str())->base(); } void a2bus_floppy_device::device_reset() diff --git a/src/emu/bus/a2bus/a2diskiing.c b/src/emu/bus/a2bus/a2diskiing.c index 7bef71293c6..843b7cde714 100644 --- a/src/emu/bus/a2bus/a2diskiing.c +++ b/src/emu/bus/a2bus/a2diskiing.c @@ -85,7 +85,7 @@ void a2bus_diskiing_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, DISKII_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, DISKII_ROM_REGION).c_str())->base(); } void a2bus_diskiing_device::device_reset() diff --git a/src/emu/bus/a2bus/a2hsscsi.c b/src/emu/bus/a2bus/a2hsscsi.c index 7b295a9122e..ef912a2ea7f 100644 --- a/src/emu/bus/a2bus/a2hsscsi.c +++ b/src/emu/bus/a2bus/a2hsscsi.c @@ -137,7 +137,7 @@ void a2bus_hsscsi_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SCSI_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SCSI_ROM_REGION).c_str())->base(); memset(m_ram, 0, 8192); diff --git a/src/emu/bus/a2bus/a2memexp.c b/src/emu/bus/a2bus/a2memexp.c index 2608e89e760..2ae514b6495 100644 --- a/src/emu/bus/a2bus/a2memexp.c +++ b/src/emu/bus/a2bus/a2memexp.c @@ -103,7 +103,7 @@ void a2bus_memexp_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, MEMEXP_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, MEMEXP_ROM_REGION).c_str())->base(); memset(m_ram, 0xff, 1024*1024*sizeof(UINT8)); diff --git a/src/emu/bus/a2bus/a2pic.c b/src/emu/bus/a2bus/a2pic.c index 1e59f3673c9..19d5a442c6a 100644 --- a/src/emu/bus/a2bus/a2pic.c +++ b/src/emu/bus/a2bus/a2pic.c @@ -128,7 +128,7 @@ void a2bus_pic_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, PIC_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, PIC_ROM_REGION).c_str())->base(); m_timer = timer_alloc(0, NULL); m_timer->adjust(attotime::never); diff --git a/src/emu/bus/a2bus/a2scsi.c b/src/emu/bus/a2bus/a2scsi.c index e2d3d0973a0..e85ccc53115 100644 --- a/src/emu/bus/a2bus/a2scsi.c +++ b/src/emu/bus/a2bus/a2scsi.c @@ -130,7 +130,7 @@ void a2bus_scsi_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SCSI_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SCSI_ROM_REGION).c_str())->base(); memset(m_ram, 0, 8192); diff --git a/src/emu/bus/a2bus/a2ssc.c b/src/emu/bus/a2bus/a2ssc.c index 05ffd4e06e4..8fcfd4d4b63 100644 --- a/src/emu/bus/a2bus/a2ssc.c +++ b/src/emu/bus/a2bus/a2ssc.c @@ -155,7 +155,7 @@ void a2bus_ssc_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SSC_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SSC_ROM_REGION).c_str())->base(); } void a2bus_ssc_device::device_reset() diff --git a/src/emu/bus/a2bus/a2swyft.c b/src/emu/bus/a2bus/a2swyft.c index a7e011bd1c3..bbfb910d920 100644 --- a/src/emu/bus/a2bus/a2swyft.c +++ b/src/emu/bus/a2bus/a2swyft.c @@ -65,7 +65,7 @@ void a2bus_swyft_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SWYFT_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, SWYFT_ROM_REGION).c_str())->base(); save_item(NAME(m_rombank)); } diff --git a/src/emu/bus/a2bus/a2thunderclock.c b/src/emu/bus/a2bus/a2thunderclock.c index ea5604521b6..34780319800 100644 --- a/src/emu/bus/a2bus/a2thunderclock.c +++ b/src/emu/bus/a2bus/a2thunderclock.c @@ -98,7 +98,7 @@ void a2bus_thunderclock_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, THUNDERCLOCK_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, THUNDERCLOCK_ROM_REGION).c_str())->base(); save_item(NAME(m_dataout)); } diff --git a/src/emu/bus/a2bus/a2ultraterm.c b/src/emu/bus/a2bus/a2ultraterm.c index 5989ceae9bd..dc078a62172 100644 --- a/src/emu/bus/a2bus/a2ultraterm.c +++ b/src/emu/bus/a2bus/a2ultraterm.c @@ -163,10 +163,10 @@ void a2bus_videx160_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, ULTRATERM_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, ULTRATERM_ROM_REGION).c_str())->base(); astring tempstring2; - m_chrrom = device().machine().root_device().memregion(this->subtag(tempstring2, ULTRATERM_GFX_REGION))->base(); + m_chrrom = device().machine().root_device().memregion(this->subtag(tempstring2, ULTRATERM_GFX_REGION).c_str())->base(); memset(m_ram, 0, 256*16); diff --git a/src/emu/bus/a2bus/a2videoterm.c b/src/emu/bus/a2bus/a2videoterm.c index 947bb7a1aa4..eeccd16bd78 100644 --- a/src/emu/bus/a2bus/a2videoterm.c +++ b/src/emu/bus/a2bus/a2videoterm.c @@ -218,10 +218,10 @@ void a2bus_videx80_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, VIDEOTERM_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, VIDEOTERM_ROM_REGION).c_str())->base(); astring tempstring2; - m_chrrom = device().machine().root_device().memregion(this->subtag(tempstring2, VIDEOTERM_GFX_REGION))->base(); + m_chrrom = device().machine().root_device().memregion(this->subtag(tempstring2, VIDEOTERM_GFX_REGION).c_str())->base(); memset(m_ram, 0, 4*512); diff --git a/src/emu/bus/a2bus/a2vulcan.c b/src/emu/bus/a2bus/a2vulcan.c index 0261e43a013..52ffd8f0c9c 100644 --- a/src/emu/bus/a2bus/a2vulcan.c +++ b/src/emu/bus/a2bus/a2vulcan.c @@ -139,7 +139,7 @@ void a2bus_vulcanbase_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, VULCAN_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, VULCAN_ROM_REGION).c_str())->base(); save_item(NAME(m_lastdata)); save_item(NAME(m_ram)); diff --git a/src/emu/bus/a2bus/a2zipdrive.c b/src/emu/bus/a2bus/a2zipdrive.c index 61ccb2d9495..d16bc099f04 100644 --- a/src/emu/bus/a2bus/a2zipdrive.c +++ b/src/emu/bus/a2bus/a2zipdrive.c @@ -89,7 +89,7 @@ void a2bus_zipdrivebase_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, ZIPDRIVE_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, ZIPDRIVE_ROM_REGION).c_str())->base(); save_item(NAME(m_lastdata)); } diff --git a/src/emu/bus/a2bus/corvfdc01.c b/src/emu/bus/a2bus/corvfdc01.c index baf1f17a2d3..9c8382513cc 100644 --- a/src/emu/bus/a2bus/corvfdc01.c +++ b/src/emu/bus/a2bus/corvfdc01.c @@ -140,7 +140,7 @@ void a2bus_corvfdc01_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, FDC01_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, FDC01_ROM_REGION).c_str())->base(); save_item(NAME(m_fdc_local_status)); save_item(NAME(m_fdc_local_command)); diff --git a/src/emu/bus/a2bus/corvfdc02.c b/src/emu/bus/a2bus/corvfdc02.c index e66ef98d4ba..8302a88343e 100644 --- a/src/emu/bus/a2bus/corvfdc02.c +++ b/src/emu/bus/a2bus/corvfdc02.c @@ -109,7 +109,7 @@ void a2bus_corvfdc02_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, FDC02_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, FDC02_ROM_REGION).c_str())->base(); m_timer = timer_alloc(0); diff --git a/src/emu/bus/a2bus/mouse.c b/src/emu/bus/a2bus/mouse.c index a0340174034..7327ed8dc96 100644 --- a/src/emu/bus/a2bus/mouse.c +++ b/src/emu/bus/a2bus/mouse.c @@ -206,7 +206,7 @@ void a2bus_mouse_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, MOUSE_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, MOUSE_ROM_REGION).c_str())->base(); // allocate two timers: one for the 68705, one for the quadrature magic m_timer = timer_alloc(TIMER_68705, NULL); diff --git a/src/emu/bus/a2bus/timemasterho.c b/src/emu/bus/a2bus/timemasterho.c index 9c1191d3aa9..0639afa0b38 100644 --- a/src/emu/bus/a2bus/timemasterho.c +++ b/src/emu/bus/a2bus/timemasterho.c @@ -149,7 +149,7 @@ void a2bus_timemasterho_device::device_start() set_a2bus_device(); astring tempstring; - m_rom = device().machine().root_device().memregion(this->subtag(tempstring, TIMEMASTER_ROM_REGION))->base(); + m_rom = device().machine().root_device().memregion(this->subtag(tempstring, TIMEMASTER_ROM_REGION).c_str())->base(); } void a2bus_timemasterho_device::device_reset() diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c index 1e667d32110..9dc1a9040bf 100644 --- a/src/emu/bus/a7800/a78_slot.c +++ b/src/emu/bus/a7800/a78_slot.c @@ -68,7 +68,7 @@ void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(A78SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; // setup other helpers diff --git a/src/emu/bus/a800/a800_slot.c b/src/emu/bus/a800/a800_slot.c index e6d06c936e6..566b4475380 100644 --- a/src/emu/bus/a800/a800_slot.c +++ b/src/emu/bus/a800/a800_slot.c @@ -65,7 +65,7 @@ void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(A800SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; // setup other helpers diff --git a/src/emu/bus/apf/slot.c b/src/emu/bus/apf/slot.c index 6a92271fc7c..80e08a5753a 100644 --- a/src/emu/bus/apf/slot.c +++ b/src/emu/bus/apf/slot.c @@ -51,7 +51,7 @@ void device_apf_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(APFSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/arcadia/slot.c b/src/emu/bus/arcadia/slot.c index 13ed093e412..119d5d2d883 100644 --- a/src/emu/bus/arcadia/slot.c +++ b/src/emu/bus/arcadia/slot.c @@ -51,7 +51,7 @@ void device_arcadia_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(EA2001SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/astrocde/slot.c b/src/emu/bus/astrocde/slot.c index 5b70beff977..706f3a821de 100644 --- a/src/emu/bus/astrocde/slot.c +++ b/src/emu/bus/astrocde/slot.c @@ -51,7 +51,7 @@ void device_astrocade_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(ASTROCADESLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/chanf/slot.c b/src/emu/bus/chanf/slot.c index e42a69629b9..136d135835c 100644 --- a/src/emu/bus/chanf/slot.c +++ b/src/emu/bus/chanf/slot.c @@ -51,7 +51,7 @@ void device_channelf_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(CHANFSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/crvision/slot.c b/src/emu/bus/crvision/slot.c index 195dd476588..eb3f63c3e4c 100644 --- a/src/emu/bus/crvision/slot.c +++ b/src/emu/bus/crvision/slot.c @@ -51,7 +51,7 @@ void device_crvision_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(CRVSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/gameboy/gb_slot.c b/src/emu/bus/gameboy/gb_slot.c index 5caab4688c8..c04645d3290 100644 --- a/src/emu/bus/gameboy/gb_slot.c +++ b/src/emu/bus/gameboy/gb_slot.c @@ -63,7 +63,7 @@ void device_gb_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(GBSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/gba/gba_slot.c b/src/emu/bus/gba/gba_slot.c index 064bbb60add..64906667b53 100644 --- a/src/emu/bus/gba/gba_slot.c +++ b/src/emu/bus/gba/gba_slot.c @@ -51,7 +51,7 @@ void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag) astring tempstring(tag); tempstring.cat(GBASLOT_ROM_REGION_TAG); // we always alloc 32MB of rom region! - m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring, 0x2000000, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring.c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/generic/slot.c b/src/emu/bus/generic/slot.c index 40f959e404e..9473e2aa3e0 100644 --- a/src/emu/bus/generic/slot.c +++ b/src/emu/bus/generic/slot.c @@ -61,7 +61,7 @@ void device_generic_cart_interface::rom_alloc(size_t size, int width, endianness { astring tempstring(tag); tempstring.cat(GENERIC_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, width, endian)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, width, endian)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/intv/ecs.c b/src/emu/bus/intv/ecs.c index d9146a73495..fd953808e56 100644 --- a/src/emu/bus/intv/ecs.c +++ b/src/emu/bus/intv/ecs.c @@ -55,7 +55,7 @@ void intv_ecs_device::device_start() if (m_rom == NULL) { astring region_tag; - m_rom = memregion(region_tag.cpy(tag()).cat(":ecs"))->base(); + m_rom = memregion(region_tag.cpy(tag()).cat(":ecs").c_str())->base(); } if (!m_ram.count()) { diff --git a/src/emu/bus/intv/slot.c b/src/emu/bus/intv/slot.c index 231b291b153..155cb308824 100644 --- a/src/emu/bus/intv/slot.c +++ b/src/emu/bus/intv/slot.c @@ -120,7 +120,7 @@ void device_intv_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(INTVSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); memset(m_rom, 0xff, size); m_rom_size = size; } diff --git a/src/emu/bus/isa/cga.c b/src/emu/bus/isa/cga.c index b894632d715..a9efd79de45 100644 --- a/src/emu/bus/isa/cga.c +++ b/src/emu/bus/isa/cga.c @@ -363,7 +363,7 @@ void isa8_cga_device::device_start() } astring tempstring; - m_chr_gen_base = memregion(subtag(tempstring, "gfx1"))->base(); + m_chr_gen_base = memregion(subtag(tempstring, "gfx1").c_str())->base(); m_chr_gen = m_chr_gen_base + m_chr_gen_offset[1]; save_item(NAME(m_framecnt)); diff --git a/src/emu/bus/isa/ega.c b/src/emu/bus/isa/ega.c index 7d4d0537d93..2f620fc0e62 100644 --- a/src/emu/bus/isa/ega.c +++ b/src/emu/bus/isa/ega.c @@ -608,8 +608,8 @@ void isa8_ega_device::device_start() if(m_default_bios_tag != "iskr3104") { - UINT8 *dst = memregion(subtag(tempstring, "user2" ))->base() + 0x0000; - UINT8 *src = memregion(subtag(tempstring, "user1" ))->base() + 0x3fff; + UINT8 *dst = memregion(subtag(tempstring, "user2").c_str())->base() + 0x0000; + UINT8 *src = memregion(subtag(tempstring, "user1").c_str())->base() + 0x3fff; int i; /* Perform the EGA bios address line swaps */ @@ -619,10 +619,10 @@ void isa8_ega_device::device_start() } } else - memcpy(memregion(subtag(tempstring, "user2" ))->base(), memregion(subtag(tempstring, "user1" ))->base(), 0x4000); + memcpy(memregion(subtag(tempstring, "user2").c_str())->base(), memregion(subtag(tempstring, "user1").c_str())->base(), 0x4000); /* Install 256KB Video ram on our EGA card */ - m_vram = machine().memory().region_alloc(subtag(tempstring,"vram"), 256*1024, 1, ENDIANNESS_LITTLE); + m_vram = machine().memory().region_alloc(subtag(tempstring, "vram").c_str(), 256 * 1024, 1, ENDIANNESS_LITTLE); m_videoram = m_vram->base(); m_plane[0] = m_videoram + 0x00000; diff --git a/src/emu/bus/isa/hdc.c b/src/emu/bus/isa/hdc.c index 79dc7185d00..c2176f66c42 100644 --- a/src/emu/bus/isa/hdc.c +++ b/src/emu/bus/isa/hdc.c @@ -261,10 +261,10 @@ hard_disk_file *isa8_hdc_device::pc_hdc_file(int id) switch( id ) { case 0: - img = dynamic_cast<harddisk_image_device *>(machine().device(subtag(tempstring,"primary"))); + img = dynamic_cast<harddisk_image_device *>(machine().device(subtag(tempstring, "primary").c_str())); break; case 1: - img = dynamic_cast<harddisk_image_device *>(machine().device(subtag(tempstring,"slave"))); + img = dynamic_cast<harddisk_image_device *>(machine().device(subtag(tempstring, "slave").c_str())); break; } if ( img == NULL ) diff --git a/src/emu/bus/isa/isa.c b/src/emu/bus/isa/isa.c index 289c4492a90..68068691958 100644 --- a/src/emu/bus/isa/isa.c +++ b/src/emu/bus/isa/isa.c @@ -337,7 +337,7 @@ void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t ma } else { m_prgspace->install_read_bank(start, end, mask, mirror, tag); m_prgspace->unmap_write(start, end, mask, mirror); - machine().root_device().membank(tag)->set_base(machine().root_device().memregion(dev->subtag(tempstring, region))->base()); + machine().root_device().membank(tag)->set_base(machine().root_device().memregion(dev->subtag(tempstring, region).c_str())->base()); } } diff --git a/src/emu/bus/isa/mda.c b/src/emu/bus/isa/mda.c index fc2953061fc..48a2a8a9243 100644 --- a/src/emu/bus/isa/mda.c +++ b/src/emu/bus/isa/mda.c @@ -196,7 +196,7 @@ void isa8_mda_device::device_reset() m_pixel = 0; astring tempstring; - m_chr_gen = memregion(subtag(tempstring, "gfx1"))->base(); + m_chr_gen = memregion(subtag(tempstring, "gfx1").c_str())->base(); } /*************************************************************************** @@ -613,7 +613,7 @@ void isa8_hercules_device::device_reset() m_configuration_switch = 0; astring tempstring; - m_chr_gen = memregion(subtag(tempstring, "gfx1"))->base(); + m_chr_gen = memregion(subtag(tempstring, "gfx1").c_str())->base(); } /*************************************************************************** diff --git a/src/emu/bus/isa/mufdc.c b/src/emu/bus/isa/mufdc.c index 5ef6abc219b..1a720ebc1b7 100644 --- a/src/emu/bus/isa/mufdc.c +++ b/src/emu/bus/isa/mufdc.c @@ -163,7 +163,7 @@ void mufdc_device::device_start() void mufdc_device::device_reset() { - m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, m_shortname, "option"); + m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, m_shortname.c_str(), "option"); m_isa->install_device(0x3f0, 0x3f7, *m_fdc, &pc_fdc_interface::map); m_isa->set_dma_channel(2, this, true); } diff --git a/src/emu/bus/isa/pc1640_iga.c b/src/emu/bus/isa/pc1640_iga.c index e456266d33b..0238301e6d8 100644 --- a/src/emu/bus/isa/pc1640_iga.c +++ b/src/emu/bus/isa/pc1640_iga.c @@ -99,7 +99,7 @@ void isa8_pc1640_iga_device::device_start() } /* Install 256KB Video ram on our EGA card */ - m_vram = machine().memory().region_alloc(subtag(tempstring,"vram"), 256*1024, 1, ENDIANNESS_LITTLE); + m_vram = machine().memory().region_alloc(subtag(tempstring, "vram").c_str(), 256 * 1024, 1, ENDIANNESS_LITTLE); m_videoram = m_vram->base(); m_plane[0] = m_videoram + 0x00000; diff --git a/src/emu/bus/macpds/macpds.c b/src/emu/bus/macpds/macpds.c index 9131b721e79..08355e2c47c 100644 --- a/src/emu/bus/macpds/macpds.c +++ b/src/emu/bus/macpds/macpds.c @@ -188,8 +188,8 @@ void device_macpds_card_interface::install_bank(offs_t start, offs_t end, offs_t void device_macpds_card_interface::install_rom(device_t *dev, const char *romregion, UINT32 addr) { astring tempstring; - UINT8 *rom = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->base(); - UINT32 romlen = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->bytes(); + UINT8 *rom = device().machine().root_device().memregion(dev->subtag(tempstring, romregion).c_str())->base(); + UINT32 romlen = device().machine().root_device().memregion(dev->subtag(tempstring, romregion).c_str())->bytes(); char bankname[128]; sprintf(bankname, "rom_%x", addr); diff --git a/src/emu/bus/macpds/pds_tpdfpd.c b/src/emu/bus/macpds/pds_tpdfpd.c index 9d09f31285e..275046182ad 100644 --- a/src/emu/bus/macpds/pds_tpdfpd.c +++ b/src/emu/bus/macpds/pds_tpdfpd.c @@ -89,7 +89,7 @@ macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, device_macpds_card_interface(mconfig, *this), m_assembled_tag(tag, ":", SEDISPLAY_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -98,7 +98,7 @@ macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, device_macpds_card_interface(mconfig, *this), m_assembled_tag(tag, ":", SEDISPLAY_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/megadrive/md_slot.c b/src/emu/bus/megadrive/md_slot.c index 168c23cb25e..8b07d773fc1 100644 --- a/src/emu/bus/megadrive/md_slot.c +++ b/src/emu/bus/megadrive/md_slot.c @@ -87,7 +87,7 @@ void device_md_cart_interface::rom_alloc(size_t size, const char *tag) { astring tempstring(tag); tempstring.cat(MDSLOT_ROM_REGION_TAG); - m_rom = (UINT16 *)device().machine().memory().region_alloc(tempstring, size, 2, ENDIANNESS_LITTLE)->base(); + m_rom = (UINT16 *)device().machine().memory().region_alloc(tempstring.c_str(), size, 2, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/nes/nes_ines.inc b/src/emu/bus/nes/nes_ines.inc index d783715a029..1fb4119618f 100644 --- a/src/emu/bus/nes/nes_ines.inc +++ b/src/emu/bus/nes/nes_ines.inc @@ -379,7 +379,7 @@ void nes_cart_slot_device::call_load_ines() // use info from nes.hsi if available! if (hashfile_extrainfo(*this, mapinfo)) { - if (4 == sscanf(mapinfo,"%d %d %d %d", &mapint1, &mapint2, &mapint3, &mapint4)) + if (4 == sscanf(mapinfo.c_str(),"%d %d %d %d", &mapint1, &mapint2, &mapint3, &mapint4)) { /* image is present in nes.hsi: overwrite the header settings with these */ mapper = mapint1; @@ -837,7 +837,7 @@ const char * nes_cart_slot_device::get_default_card_ines(UINT8 *ROM, UINT32 len) // use info from nes.hsi if available! if (hashfile_extrainfo(*this, mapinfo)) { - if (4 == sscanf(mapinfo,"%d %d %d %d", &mapint1, &mapint2, &mapint3, &mapint4)) + if (4 == sscanf(mapinfo.c_str(),"%d %d %d %d", &mapint1, &mapint2, &mapint3, &mapint4)) { /* image is present in nes.hsi: overwrite the header settings with these */ mapper = mapint1; diff --git a/src/emu/bus/nes/nes_slot.c b/src/emu/bus/nes/nes_slot.c index 89107fb1664..aad722536dd 100644 --- a/src/emu/bus/nes/nes_slot.c +++ b/src/emu/bus/nes/nes_slot.c @@ -150,7 +150,7 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag) { astring tempstring(tag); tempstring.cat(NESSLOT_PRGROM_REGION_TAG); - m_prg = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_prg = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_prg_size = size; m_prg_chunks = size / 0x4000; if (size % 0x2000) @@ -219,7 +219,7 @@ void device_nes_cart_interface::vrom_alloc(size_t size, const char *tag) { astring tempstring(tag); tempstring.cat(NESSLOT_CHRROM_REGION_TAG); - m_vrom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_vrom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_vrom_size = size; m_vrom_chunks = size / 0x2000; } diff --git a/src/emu/bus/nubus/nubus.c b/src/emu/bus/nubus/nubus.c index 4b4ccd5bfab..f41088292ee 100644 --- a/src/emu/bus/nubus/nubus.c +++ b/src/emu/bus/nubus/nubus.c @@ -326,8 +326,8 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c bool inverted = false; astring tempstring; - UINT8 *rom = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->base(); - UINT32 romlen = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->bytes(); + UINT8 *rom = device().machine().root_device().memregion(dev->subtag(tempstring, romregion).c_str())->base(); + UINT32 romlen = device().machine().root_device().memregion(dev->subtag(tempstring, romregion).c_str())->bytes(); // printf("ROM length is %x, last bytes are %02x %02x\n", romlen, rom[romlen-2], rom[romlen-1]); diff --git a/src/emu/bus/nubus/nubus_48gc.c b/src/emu/bus/nubus/nubus_48gc.c index 6ed43c99d1d..3651b27a81c 100644 --- a/src/emu/bus/nubus/nubus_48gc.c +++ b/src/emu/bus/nubus/nubus_48gc.c @@ -80,7 +80,7 @@ jmfb_device::jmfb_device(const machine_config &mconfig, device_type type, const device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", GC48_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_48gc_device::nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : diff --git a/src/emu/bus/nubus/nubus_m2hires.c b/src/emu/bus/nubus/nubus_m2hires.c index d5b71fccc6c..c3ddc80fff2 100644 --- a/src/emu/bus/nubus/nubus_m2hires.c +++ b/src/emu/bus/nubus/nubus_m2hires.c @@ -69,7 +69,7 @@ nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, const device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", M2HIRES_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -78,7 +78,7 @@ nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, device device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", M2HIRES_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/nubus_m2video.c b/src/emu/bus/nubus/nubus_m2video.c index e4db9e7da95..0a0618a06c9 100644 --- a/src/emu/bus/nubus/nubus_m2video.c +++ b/src/emu/bus/nubus/nubus_m2video.c @@ -70,7 +70,7 @@ nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, const device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", M2VIDEO_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -79,7 +79,7 @@ nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, device device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", M2VIDEO_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/nubus_radiustpd.c b/src/emu/bus/nubus/nubus_radiustpd.c index 878e6dc095c..17f48d8bd0f 100644 --- a/src/emu/bus/nubus/nubus_radiustpd.c +++ b/src/emu/bus/nubus/nubus_radiustpd.c @@ -69,7 +69,7 @@ nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, co device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", RADIUSTPD_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -78,7 +78,7 @@ nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, de device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", RADIUSTPD_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/nubus_spec8.c b/src/emu/bus/nubus/nubus_spec8.c index 4bd8aa05911..f2251721b6d 100644 --- a/src/emu/bus/nubus/nubus_spec8.c +++ b/src/emu/bus/nubus/nubus_spec8.c @@ -71,7 +71,7 @@ nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, const device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", SPEC8S3_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -80,7 +80,7 @@ nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, device device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", SPEC8S3_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/nubus_specpdq.c b/src/emu/bus/nubus/nubus_specpdq.c index c191819bacf..2a849734d1b 100644 --- a/src/emu/bus/nubus/nubus_specpdq.c +++ b/src/emu/bus/nubus/nubus_specpdq.c @@ -87,7 +87,7 @@ nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, const m_assembled_tag(tag, ":", SPECPDQ_SCREEN_NAME), m_palette(*this, "palette") { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -97,7 +97,7 @@ nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, device m_assembled_tag(tag, ":", SPECPDQ_SCREEN_NAME), m_palette(*this, "palette") { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/nubus_wsportrait.c b/src/emu/bus/nubus/nubus_wsportrait.c index 9f59e684cce..27a6a6034e3 100644 --- a/src/emu/bus/nubus/nubus_wsportrait.c +++ b/src/emu/bus/nubus/nubus_wsportrait.c @@ -72,7 +72,7 @@ nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", WSPORTRAIT_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -81,7 +81,7 @@ nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", WSPORTRAIT_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/pds30_30hr.c b/src/emu/bus/nubus/pds30_30hr.c index f34e3de7106..cdd958207d6 100644 --- a/src/emu/bus/nubus/pds30_30hr.c +++ b/src/emu/bus/nubus/pds30_30hr.c @@ -72,7 +72,7 @@ nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, co device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", XCEED30HR_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -81,7 +81,7 @@ nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, de device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", XCEED30HR_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/pds30_cb264.c b/src/emu/bus/nubus/pds30_cb264.c index 1bbd91cc2dc..34c1ec08305 100644 --- a/src/emu/bus/nubus/pds30_cb264.c +++ b/src/emu/bus/nubus/pds30_cb264.c @@ -65,7 +65,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, co device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", CB264SE30_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -74,7 +74,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, de device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", CB264SE30_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/pds30_mc30.c b/src/emu/bus/nubus/pds30_mc30.c index 3fdd479311e..c5ba7501093 100644 --- a/src/emu/bus/nubus/pds30_mc30.c +++ b/src/emu/bus/nubus/pds30_mc30.c @@ -68,7 +68,7 @@ nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, co device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", XCEEDMC30_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -77,7 +77,7 @@ nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, de device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", XCEEDMC30_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/pds30_procolor816.c b/src/emu/bus/nubus/pds30_procolor816.c index ba375aa1a4b..e0a14347357 100644 --- a/src/emu/bus/nubus/pds30_procolor816.c +++ b/src/emu/bus/nubus/pds30_procolor816.c @@ -71,7 +71,7 @@ nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", PROCOLOR816_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -80,7 +80,7 @@ nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", PROCOLOR816_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/nubus/pds30_sigmalview.c b/src/emu/bus/nubus/pds30_sigmalview.c index 838ee488e6d..3aa59e8acc7 100644 --- a/src/emu/bus/nubus/pds30_sigmalview.c +++ b/src/emu/bus/nubus/pds30_sigmalview.c @@ -65,7 +65,7 @@ nubus_lview_device::nubus_lview_device(const machine_config &mconfig, const char device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", LVIEW_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } nubus_lview_device::nubus_lview_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : @@ -74,7 +74,7 @@ nubus_lview_device::nubus_lview_device(const machine_config &mconfig, device_typ device_nubus_card_interface(mconfig, *this), m_assembled_tag(tag, ":", LVIEW_SCREEN_NAME) { - m_screen_tag = m_assembled_tag; + m_screen_tag = m_assembled_tag.c_str(); } //------------------------------------------------- diff --git a/src/emu/bus/odyssey2/slot.c b/src/emu/bus/odyssey2/slot.c index c8dc8e053f5..f5a8afc6b04 100644 --- a/src/emu/bus/odyssey2/slot.c +++ b/src/emu/bus/odyssey2/slot.c @@ -51,7 +51,7 @@ void device_o2_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(O2SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/oricext/jasmin.c b/src/emu/bus/oricext/jasmin.c index 0435d30ffcb..bb09ca39063 100644 --- a/src/emu/bus/oricext/jasmin.c +++ b/src/emu/bus/oricext/jasmin.c @@ -54,7 +54,7 @@ void jasmin_device::device_start() { oricext_device::device_start(); astring tempstring; - jasmin_rom = device().machine().root_device().memregion(this->subtag(tempstring, "jasmin"))->base(); + jasmin_rom = device().machine().root_device().memregion(this->subtag(tempstring, "jasmin").c_str())->base(); cpu->space(AS_PROGRAM).install_device(0x0000, 0xffff, *this, &jasmin_device::map); for(int i=0; i<4; i++) { diff --git a/src/emu/bus/oricext/microdisc.c b/src/emu/bus/oricext/microdisc.c index 0351c1be0e0..9c05d2e261c 100644 --- a/src/emu/bus/oricext/microdisc.c +++ b/src/emu/bus/oricext/microdisc.c @@ -49,7 +49,7 @@ void microdisc_device::device_start() { oricext_device::device_start(); astring tempstring; - microdisc_rom = device().machine().root_device().memregion(this->subtag(tempstring, "microdisc"))->base(); + microdisc_rom = device().machine().root_device().memregion(this->subtag(tempstring, "microdisc").c_str())->base(); cpu->space(AS_PROGRAM).install_device(0x0000, 0xffff, *this, µdisc_device::map); for(int i=0; i<4; i++) { diff --git a/src/emu/bus/pce/pce_slot.c b/src/emu/bus/pce/pce_slot.c index 7ed13a71e6c..38b99125d88 100644 --- a/src/emu/bus/pce/pce_slot.c +++ b/src/emu/bus/pce/pce_slot.c @@ -53,7 +53,7 @@ void device_pce_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(PCESLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/saturn/sat_slot.c b/src/emu/bus/saturn/sat_slot.c index ebd9c6e8890..77108f2fa01 100644 --- a/src/emu/bus/saturn/sat_slot.c +++ b/src/emu/bus/saturn/sat_slot.c @@ -60,7 +60,7 @@ void device_sat_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(SATSLOT_ROM_REGION_TAG); - m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring, size, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring.c_str(), size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/scv/slot.c b/src/emu/bus/scv/slot.c index dcd3639c1ed..d41508e8781 100644 --- a/src/emu/bus/scv/slot.c +++ b/src/emu/bus/scv/slot.c @@ -51,7 +51,7 @@ void device_scv_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(SCVSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/sega8/sega8_slot.c b/src/emu/bus/sega8/sega8_slot.c index 98c91a1ae45..fef84a6b084 100644 --- a/src/emu/bus/sega8/sega8_slot.c +++ b/src/emu/bus/sega8/sega8_slot.c @@ -78,7 +78,7 @@ void device_sega8_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(S8SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; m_rom_page_count = size / 0x4000; if (!m_rom_page_count) diff --git a/src/emu/bus/snes/snes_slot.c b/src/emu/bus/snes/snes_slot.c index d063842b34f..ce685937314 100644 --- a/src/emu/bus/snes/snes_slot.c +++ b/src/emu/bus/snes/snes_slot.c @@ -92,7 +92,7 @@ void device_sns_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(SNSSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -802,37 +802,37 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath() switch (m_addon) { case ADDON_DSP1: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP1B: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP2: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP3: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_DSP4: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x2800); memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); break; case ADDON_ST010: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x11000); memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); break; case ADDON_ST011: - ROM = machine().root_device().memregion(region)->base(); + ROM = machine().root_device().memregion(region.c_str())->base(); m_cart->addon_bios_alloc(0x11000); memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); break; diff --git a/src/emu/bus/vboy/slot.c b/src/emu/bus/vboy/slot.c index bcc3961e842..2cf3441d656 100644 --- a/src/emu/bus/vboy/slot.c +++ b/src/emu/bus/vboy/slot.c @@ -52,7 +52,7 @@ void device_vboy_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(VBOYSLOT_ROM_REGION_TAG); - m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring, size, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring.c_str(), size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size/4; m_rom_mask = m_rom_size - 1; } diff --git a/src/emu/bus/vc4000/slot.c b/src/emu/bus/vc4000/slot.c index 14ec2edb593..c16d5b25aa0 100644 --- a/src/emu/bus/vc4000/slot.c +++ b/src/emu/bus/vc4000/slot.c @@ -51,7 +51,7 @@ void device_vc4000_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(VC4000SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/vcs/vcs_slot.c b/src/emu/bus/vcs/vcs_slot.c index a1a8797c18b..dfcf8bd9a63 100755 --- a/src/emu/bus/vcs/vcs_slot.c +++ b/src/emu/bus/vcs/vcs_slot.c @@ -53,7 +53,7 @@ void device_vcs_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(A26SLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/vectrex/slot.c b/src/emu/bus/vectrex/slot.c index 448b48beebd..16120b850ca 100644 --- a/src/emu/bus/vectrex/slot.c +++ b/src/emu/bus/vectrex/slot.c @@ -51,7 +51,7 @@ void device_vectrex_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(VECSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } diff --git a/src/emu/bus/wswan/slot.c b/src/emu/bus/wswan/slot.c index 72fa3d21677..d64aa84f3ca 100644 --- a/src/emu/bus/wswan/slot.c +++ b/src/emu/bus/wswan/slot.c @@ -52,7 +52,7 @@ void device_ws_cart_interface::rom_alloc(UINT32 size, const char *tag) { astring tempstring(tag); tempstring.cat(WSSLOT_ROM_REGION_TAG); - m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; m_bank_mask = ((m_rom_size >> 16) - 1); } diff --git a/src/emu/bus/x68k/x68k_scsiext.c b/src/emu/bus/x68k/x68k_scsiext.c index 5609fc909fe..f7b89c8e305 100644 --- a/src/emu/bus/x68k/x68k_scsiext.c +++ b/src/emu/bus/x68k/x68k_scsiext.c @@ -70,7 +70,7 @@ void x68k_scsiext_device::device_start() m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner()); space.install_read_bank(0xea0020,0xea1fff,0,0,"scsi_ext"); space.unmap_write(0xea0020,0xea1fff,0,0); - ROM = machine().root_device().memregion(subtag(temp,"scsiexrom"))->base(); + ROM = machine().root_device().memregion(subtag(temp, "scsiexrom").c_str())->base(); machine().root_device().membank("scsi_ext")->set_base(ROM); space.install_readwrite_handler(0xea0000,0xea001f,0,0,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff); } diff --git a/src/emu/cheat.c b/src/emu/cheat.c index 7bc0308f705..30473345027 100644 --- a/src/emu/cheat.c +++ b/src/emu/cheat.c @@ -122,7 +122,7 @@ inline const char *number_and_format::format(astring &string) const string.printf("0x%X", (UINT32)m_value); break; } - return string; + return string.c_str(); } @@ -191,7 +191,7 @@ const char *cheat_parameter::text() break; } } - return m_curtext; + return m_curtext.c_str(); } @@ -507,7 +507,7 @@ void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &arginde curarg += arg->values(argindex, ¶ms[curarg]); // generate the astring - manager.get_output_astring(m_line, m_justify).printf(m_format, + manager.get_output_astring(m_line, m_justify).printf(m_format.c_str(), (UINT32)params[0], (UINT32)params[1], (UINT32)params[2], (UINT32)params[3], (UINT32)params[4], (UINT32)params[5], (UINT32)params[6], (UINT32)params[7], (UINT32)params[8], (UINT32)params[9], (UINT32)params[10], (UINT32)params[11], @@ -577,7 +577,7 @@ void cheat_script::script_entry::validate_format(const char *filename, int line) argsprovided += curarg->count(); // now scan the string for valid argument usage - const char *p = strchr(m_format, '%'); + const char *p = strchr(m_format.c_str(), '%'); int argscounted = 0; while (p != NULL) { @@ -711,7 +711,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons m_symbols.add("argindex", symbol_table::READ_ONLY, &m_argindex); astring tempname; for (int curtemp = 0; curtemp < tempcount; curtemp++) - m_symbols.add(tempname.format("temp%d", curtemp), symbol_table::READ_WRITE); + m_symbols.add(tempname.format("temp%d", curtemp).c_str(), symbol_table::READ_WRITE); // read the first comment node xml_data_node *commentnode = xml_get_sibling(cheatnode.child, "comment"); @@ -1151,7 +1151,7 @@ void cheat_manager::reload() { astring filename; filename.printf("%08X", crc); - load_cheats(filename); + load_cheats(filename.c_str()); break; } } @@ -1221,7 +1221,7 @@ void cheat_manager::render_text(render_container &container) if (m_output[linenum]) { // output the text - machine().ui().draw_text_full(&container, m_output[linenum], + machine().ui().draw_text_full(&container, m_output[linenum].c_str(), 0.0f, (float)linenum * machine().ui().get_line_height(), 1.0f, m_justify[linenum], WRAP_NEVER, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL); @@ -1292,7 +1292,7 @@ const char *cheat_manager::quote_expression(astring &string, const parsed_expres string.replace(0, "<< ", " lshift "); string.replace(0, "<<", " lshift "); - return string; + return string.c_str(); } diff --git a/src/emu/cheat.h b/src/emu/cheat.h index 601687c7882..8f61e472b60 100644 --- a/src/emu/cheat.h +++ b/src/emu/cheat.h @@ -104,7 +104,7 @@ private: // getters item *next() const { return m_next; } const number_and_format &value() const { return m_value; } - const char *text() const { return m_text; } + const char *text() const { return m_text.c_str(); } private: // internal state @@ -221,8 +221,8 @@ public: cheat_manager &manager() const { return m_manager; } cheat_entry *next() const { return m_next; } script_state state() const { return m_state; } - const char *description() const { return m_description; } - const char *comment() const { return m_comment; } + const char *description() const { return m_description.c_str(); } + const char *comment() const { return m_comment.c_str(); } // script detection bool has_run_script() const { return (m_run_script != NULL); } diff --git a/src/emu/clifront.c b/src/emu/clifront.c index 719aff6f6f5..607c436304f 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -195,7 +195,7 @@ int cli_frontend::execute(int argc, char **argv) // if we have a command, execute that if (*(m_options.command()) != 0) - execute_commands(exename); + execute_commands(exename.c_str()); // otherwise, check for a valid system else @@ -1687,7 +1687,7 @@ void media_identifier::identify(const char *filename) if (entry->type == ENTTYPE_FILE) { astring curfile(filename, PATH_SEPARATOR, entry->name); - identify(curfile); + identify(curfile.c_str()); } // close the directory and be done diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c index 8032018c09f..21bee63ada8 100644 --- a/src/emu/cpu/adsp2100/adsp2100.c +++ b/src/emu/cpu/adsp2100/adsp2100.c @@ -546,13 +546,13 @@ void adsp21xx_device::device_start() astring tempstring; for (int ireg = 0; ireg < 8; ireg++) - state_add(ADSP2100_I0 + ireg, tempstring.format("I%d", ireg), m_i[ireg]).mask(0x3fff).callimport(); + state_add(ADSP2100_I0 + ireg, tempstring.format("I%d", ireg).c_str(), m_i[ireg]).mask(0x3fff).callimport(); for (int lreg = 0; lreg < 8; lreg++) - state_add(ADSP2100_L0 + lreg, tempstring.format("L%d", lreg), m_l[lreg]).mask(0x3fff).callimport(); + state_add(ADSP2100_L0 + lreg, tempstring.format("L%d", lreg).c_str(), m_l[lreg]).mask(0x3fff).callimport(); for (int mreg = 0; mreg < 8; mreg++) - state_add(ADSP2100_M0 + mreg, tempstring.format("M%d", mreg), m_m[mreg]).signed_mask(0x3fff); + state_add(ADSP2100_M0 + mreg, tempstring.format("M%d", mreg).c_str(), m_m[mreg]).signed_mask(0x3fff); state_add(ADSP2100_PX, "PX", m_px); state_add(ADSP2100_CNTR, "CNTR", m_cntr).mask(0x3fff); @@ -571,7 +571,7 @@ void adsp21xx_device::device_start() for (int irqnum = 0; irqnum < 4; irqnum++) if (irqnum < 4 || m_chip_type == CHIP_TYPE_ADSP2100) - state_add(ADSP2100_IRQSTATE0 + irqnum, tempstring.format("IRQ%d", irqnum), m_irq_state[irqnum]).mask(1).callimport(); + state_add(ADSP2100_IRQSTATE0 + irqnum, tempstring.format("IRQ%d", irqnum).c_str(), m_irq_state[irqnum]).mask(1).callimport(); state_add(ADSP2100_FLAGIN, "FLAGIN", m_flagin).mask(1); state_add(ADSP2100_FLAGOUT, "FLAGOUT", m_flagout).mask(1); diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c index ffa58a598cc..c5aa31e69ff 100644 --- a/src/emu/cpu/asap/asap.c +++ b/src/emu/cpu/asap/asap.c @@ -194,7 +194,7 @@ void asap_device::device_start() state_add(ASAP_PC, "PC", m_pc); state_add(ASAP_PS, "PS", m_flagsio).callimport().callexport(); for (int regnum = 0; regnum < 32; regnum++) - state_add(ASAP_R0 + regnum, tempstr.format("R%d", regnum), m_src2val[REGBASE + regnum]); + state_add(ASAP_R0 + regnum, tempstr.format("R%d", regnum).c_str(), m_src2val[REGBASE + regnum]); // register our state for saving save_item(NAME(m_pc)); diff --git a/src/emu/cpu/cosmac/cosmac.c b/src/emu/cpu/cosmac/cosmac.c index 09f05174b34..bdca0cca8e9 100644 --- a/src/emu/cpu/cosmac/cosmac.c +++ b/src/emu/cpu/cosmac/cosmac.c @@ -358,7 +358,7 @@ void cosmac_device::device_start() astring tempstr; for (int regnum = 0; regnum < 16; regnum++) - state_add(COSMAC_R0 + regnum, tempstr.format("R%x", regnum), m_r[regnum]); + state_add(COSMAC_R0 + regnum, tempstr.format("R%x", regnum).c_str(), m_r[regnum]); state_add(COSMAC_DF, "DF", m_df).mask(0x1).noshow(); state_add(COSMAC_IE, "IE", m_ie).mask(0x1).noshow(); diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c index 0c61c2a66ed..316577f4abd 100644 --- a/src/emu/cpu/drcbex64.c +++ b/src/emu/cpu/drcbex64.c @@ -808,7 +808,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT3 if (inst.opcode() == OP_HANDLE) blockname = inst.param(0).handle().string(); else if (inst.opcode() == OP_HASH) - blockname = tempstring.format("Code: mode=%d PC=%08X", (UINT32)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()); + blockname = tempstring.format("Code: mode=%d PC=%08X", (UINT32)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()).c_str(); } // generate code diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c index ff9e49576e0..311228db2ec 100644 --- a/src/emu/cpu/drcbex86.c +++ b/src/emu/cpu/drcbex86.c @@ -791,7 +791,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT3 if (inst.opcode() == OP_HANDLE) blockname = inst.param(0).handle().string(); else if (inst.opcode() == OP_HASH) - blockname = tempstring.format("Code: mode=%d PC=%08X", (UINT32)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()); + blockname = tempstring.format("Code: mode=%d PC=%08X", (UINT32)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()).c_str(); } // generate code diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c index e6596f3c9bd..ca52ee34e3e 100644 --- a/src/emu/cpu/drcuml.c +++ b/src/emu/cpu/drcuml.c @@ -253,7 +253,7 @@ const char *drcuml_state::symbol_find(void *base, UINT32 *offset) // return the offset and name if (offset != NULL) *offset = search - cursym->m_base; - return cursym->m_name; + return cursym->m_name.c_str(); } // not found; return NULL @@ -396,7 +396,7 @@ void drcuml_block::append_comment(const char *format, ...) char *comment = (char *)m_drcuml.cache().alloc_temporary(temp.len() + 1); if (comment == NULL) return; - strcpy(comment, temp); + strcpy(comment, temp.c_str()); // add an instruction with a pointer append().comment(comment); @@ -524,11 +524,11 @@ const char *drcuml_block::get_comment_text(const instruction &inst, astring &com { // comments return their strings if (inst.opcode() == OP_COMMENT) - return comment.cpy(inst.param(0).string()); + return comment.cpy(inst.param(0).string()).c_str(); // mapvars comment about their values else if (inst.opcode() == OP_MAPVAR) - return comment.format("m%d = $%X", (int)inst.param(0).mapvar() - MAPVAR_M0, (UINT32)inst.param(1).immediate()); + return comment.format("m%d = $%X", (int)inst.param(0).mapvar() - MAPVAR_M0, (UINT32)inst.param(1).immediate()).c_str(); // everything else is NULL return NULL; diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c index 8edc343fad0..dfb229780e8 100644 --- a/src/emu/cpu/dsp32/dsp32.c +++ b/src/emu/cpu/dsp32/dsp32.c @@ -201,7 +201,7 @@ void dsp32c_device::device_start() state_add(STATE_GENFLAGS, "GENFLAGS", m_iotemp).callimport().callexport().formatstr("%6s").noshow(); state_add(DSP32_PC, "PC", m_r[15]).mask(0xffffff); for (int regnum = 0; regnum <= 14; regnum++) - state_add(DSP32_R0 + regnum, tempstr.format("R%d", regnum), m_r[regnum]).mask(0xffffff); + state_add(DSP32_R0 + regnum, tempstr.format("R%d", regnum).c_str(), m_r[regnum]).mask(0xffffff); state_add(DSP32_R15, "R15", m_r[17]).mask(0xffffff); state_add(DSP32_R16, "R16", m_r[18]).mask(0xffffff); state_add(DSP32_R17, "R17", m_r[19]).mask(0xffffff); diff --git a/src/emu/cpu/hd61700/hd61700.c b/src/emu/cpu/hd61700/hd61700.c index 21c040851da..fde61241690 100644 --- a/src/emu/cpu/hd61700/hd61700.c +++ b/src/emu/cpu/hd61700/hd61700.c @@ -184,7 +184,7 @@ void hd61700_cpu_device::device_start() for (int ireg=0; ireg<32; ireg++) { astring tmpstr; - state_add(HD61700_MAINREG + ireg, tmpstr.format("R%d", ireg), m_regmain[ireg]).callimport().callexport().formatstr("%02X"); + state_add(HD61700_MAINREG + ireg, tmpstr.format("R%d", ireg).c_str(), m_regmain[ireg]).callimport().callexport().formatstr("%02X"); } state_add(STATE_GENPC, "curpc", m_curpc).callimport().callexport().formatstr("%8s").noshow(); diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c index faadf2198d5..e6316e2ccb7 100644 --- a/src/emu/cpu/i4004/i4004.c +++ b/src/emu/cpu/i4004/i4004.c @@ -422,12 +422,12 @@ void i4004_cpu_device::device_start() astring tempstr; for (int regnum = 0; regnum < 8; regnum++) { - state_add(I4004_R01 + regnum, tempstr.format("R%X%X", regnum*2, regnum*2+1), m_R[regnum]); + state_add(I4004_R01 + regnum, tempstr.format("R%X%X", regnum * 2, regnum * 2 + 1).c_str(), m_R[regnum]); } for (int addrnum = 0; addrnum < 4; addrnum++) { - state_add(I4004_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1), m_ADDR[addrnum].w.l).mask(0xfff); + state_add(I4004_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1).c_str(), m_ADDR[addrnum].w.l).mask(0xfff); } state_add(I4004_RAM, "RAM", m_RAM.w.l).mask(0x0fff); diff --git a/src/emu/cpu/i8008/i8008.c b/src/emu/cpu/i8008/i8008.c index 73cd80f0c66..e3051f79480 100644 --- a/src/emu/cpu/i8008/i8008.c +++ b/src/emu/cpu/i8008/i8008.c @@ -94,7 +94,7 @@ void i8008_device::device_start() astring tempstr; for (int addrnum = 0; addrnum < 8; addrnum++) - state_add(I8008_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1), m_ADDR[addrnum].w.l).mask(0xfff); + state_add(I8008_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1).c_str(), m_ADDR[addrnum].w.l).mask(0xfff); init_tables(); } diff --git a/src/emu/cpu/ie15/ie15.c b/src/emu/cpu/ie15/ie15.c index a25a3318e63..a457aa2abba 100644 --- a/src/emu/cpu/ie15/ie15.c +++ b/src/emu/cpu/ie15/ie15.c @@ -64,7 +64,7 @@ void ie15_device::device_start() astring tempstring; for (int ireg = 0; ireg < 32; ireg++) - state_add(IE15_R0 + ireg, tempstring.format("R%d", ireg), m_REGS[ireg]); + state_add(IE15_R0 + ireg, tempstring.format("R%d", ireg).c_str(), m_REGS[ireg]); } //------------------------------------------------- diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index bbff8fa0354..c5ccd5e47d8 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -1739,9 +1739,9 @@ void m68000_base_device::define_state(void) astring tempstr; for (int regnum = 0; regnum < 8; regnum++) - state_add(M68K_D0 + regnum, tempstr.format("D%d", regnum), dar[regnum]); + state_add(M68K_D0 + regnum, tempstr.format("D%d", regnum).c_str(), dar[regnum]); for (int regnum = 0; regnum < 8; regnum++) - state_add(M68K_A0 + regnum, tempstr.format("A%d", regnum), dar[8 + regnum]); + state_add(M68K_A0 + regnum, tempstr.format("A%d", regnum).c_str(), dar[8 + regnum]); state_add(M68K_PREF_ADDR, "PREF_ADDR", pref_addr).mask(addrmask); state_add(M68K_PREF_DATA, "PREF_DATA", pref_data); @@ -1762,7 +1762,7 @@ void m68000_base_device::define_state(void) if (cpu_type & MASK_030_OR_LATER) { for (int regnum = 0; regnum < 8; regnum++) - state_add(M68K_FP0 + regnum, tempstr.format("FP%d", regnum), iotemp).callimport().callexport().formatstr("%10s"); + state_add(M68K_FP0 + regnum, tempstr.format("FP%d", regnum).c_str(), iotemp).callimport().callexport().formatstr("%10s"); state_add(M68K_FPSR, "FPSR", fpsr); state_add(M68K_FPCR, "FPCR", fpcr); } diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c index ffcb38c0e63..901d90e6330 100644 --- a/src/emu/cpu/mcs48/mcs48.c +++ b/src/emu/cpu/mcs48/mcs48.c @@ -978,7 +978,7 @@ void mcs48_cpu_device::device_start() astring tempstr; for (int regnum = 0; regnum < 8; regnum++) - state_add(MCS48_R0 + regnum, tempstr.format("R%d", regnum), m_rtemp).callimport().callexport(); + state_add(MCS48_R0 + regnum, tempstr.format("R%d", regnum).c_str(), m_rtemp).callimport().callexport(); state_add(MCS48_EA, "EA", m_ea).mask(0x1); diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 22db4ceecad..0c3944c1a94 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -593,11 +593,11 @@ void tms340x0_device::device_start() astring tempstr; for (int regnum = 0; regnum < 15; regnum++) { - state_add(TMS34010_A0 + regnum, tempstr.format("A%d", regnum), m_regs[regnum].reg); + state_add(TMS34010_A0 + regnum, tempstr.format("A%d", regnum).c_str(), m_regs[regnum].reg); } for (int regnum = 0; regnum < 15; regnum++) { - state_add(TMS34010_B0 + regnum, tempstr.format("B%d", regnum), m_regs[30 - regnum].reg); + state_add(TMS34010_B0 + regnum, tempstr.format("B%d", regnum).c_str(), m_regs[30 - regnum].reg); } } diff --git a/src/emu/cpu/uml.c b/src/emu/cpu/uml.c index 86748604f6c..b1ca222771e 100644 --- a/src/emu/cpu/uml.c +++ b/src/emu/cpu/uml.c @@ -1026,5 +1026,5 @@ const char *uml::instruction::disasm(astring &buffer, drcuml_state *drcuml) cons if (m_flags & FLAG_C) buffer.cat('C'); } - return buffer; + return buffer.c_str(); } diff --git a/src/emu/cpu/uml.h b/src/emu/cpu/uml.h index 53eacfa49d9..96f73366fa5 100644 --- a/src/emu/cpu/uml.h +++ b/src/emu/cpu/uml.h @@ -239,7 +239,7 @@ namespace uml code_handle *next() const { return m_next; } drccodeptr codeptr() const { return *m_code; } drccodeptr *codeptr_addr() { return m_code; } - const char *string() const { return m_string; } + const char *string() const { return m_string.c_str(); } // setters void set_codeptr(drccodeptr code); diff --git a/src/emu/cpu/x86log.c b/src/emu/cpu/x86log.c index 07527d35c32..95013f1d579 100644 --- a/src/emu/cpu/x86log.c +++ b/src/emu/cpu/x86log.c @@ -269,7 +269,7 @@ void x86log_printf(x86log_context *log, const char *format, ...) /* open the file, creating it if necessary */ if (log->file == NULL) - log->file = fopen(log->filename, "w"); + log->file = fopen(log->filename.c_str(), "w"); if (log->file == NULL) return; diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c index 5be954d9124..fc2da2d6b60 100644 --- a/src/emu/cpu/z8/z8.c +++ b/src/emu/cpu/z8/z8.c @@ -680,7 +680,7 @@ void z8_device::device_start() astring tempstr; for (int regnum = 0; regnum < 16; regnum++) - state_add(Z8_R0 + regnum, tempstr.format("R%d", regnum), m_fake_r[regnum]).callimport().callexport(); + state_add(Z8_R0 + regnum, tempstr.format("R%d", regnum).c_str(), m_fake_r[regnum]).callimport().callexport(); } /* find address spaces */ diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 6d5771430eb..0b0d2cffdfd 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -1702,7 +1702,7 @@ static void execute_hotspot(running_machine &machine, int ref, int params, const static void execute_statesave(running_machine &machine, int ref, int params, const char *param[]) { astring filename(param[0]); - machine.immediate_save(filename); + machine.immediate_save(filename.c_str()); debug_console_printf(machine, "State save attempted. Please refer to window message popup for results.\n"); } @@ -1714,7 +1714,7 @@ static void execute_statesave(running_machine &machine, int ref, int params, con static void execute_stateload(running_machine &machine, int ref, int params, const char *param[]) { astring filename(param[0]); - machine.immediate_load(filename); + machine.immediate_load(filename.c_str()); // Clear all PC & memory tracks device_iterator iter(machine.root_device()); @@ -2583,7 +2583,7 @@ static void execute_trace_internal(running_machine &machine, int ref, int params return; /* open the file */ - if (core_stricmp(filename, "off") != 0) + if (core_stricmp(filename.c_str(), "off") != 0) { mode = "w"; @@ -2594,7 +2594,7 @@ static void execute_trace_internal(running_machine &machine, int ref, int params filename = filename.substr(2); } - f = fopen(filename, mode); + f = fopen(filename.c_str(), mode); if (!f) { debug_console_printf(machine, "Error opening file '%s'\n", param[0]); @@ -2835,7 +2835,7 @@ static void execute_snap(running_machine &machine, int ref, int params, const ch if (fname.find(0, ".png") == -1) fname.cat(".png"); emu_file file(machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - file_error filerr = file.open(fname); + file_error filerr = file.open(fname.c_str()); if (filerr != FILERR_NONE) { diff --git a/src/emu/debug/debugcon.c b/src/emu/debug/debugcon.c index e51ec8d2eb8..639e6e479db 100644 --- a/src/emu/debug/debugcon.c +++ b/src/emu/debug/debugcon.c @@ -482,7 +482,7 @@ void CLIB_DECL debug_console_printf(running_machine &machine, const char *format buffer.vprintf(format, arg); va_end(arg); - text_buffer_print(console_textbuf, buffer); + text_buffer_print(console_textbuf, buffer.c_str()); /* force an update of any console views */ machine.debug_view().update_all(DVT_CONSOLE); @@ -500,7 +500,7 @@ void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *forma astring buffer; buffer.vprintf(format, args); - text_buffer_print(console_textbuf, buffer); + text_buffer_print(console_textbuf, buffer.c_str()); /* force an update of any console views */ machine.debug_view().update_all(DVT_CONSOLE); @@ -522,7 +522,7 @@ void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, buffer.vprintf(format, arg); va_end(arg); - text_buffer_print_wrap(console_textbuf, buffer, wrapcol); + text_buffer_print_wrap(console_textbuf, buffer.c_str(), wrapcol); /* force an update of any console views */ machine.debug_view().update_all(DVT_CONSOLE); diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index e5afbd71202..81380a7e5fb 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -1111,7 +1111,7 @@ static device_t *expression_get_device(running_machine &machine, const char *tag // convert to lowercase then lookup the name (tags are enforced to be all lower case) astring fullname(tag); fullname.makelower(); - return machine.device(fullname); + return machine.device(fullname.c_str()); } @@ -1668,7 +1668,7 @@ device_debug::device_debug(device_t &device) // add all registers into it astring tempstr; for (const device_state_entry *entry = m_state->state_first(); entry != NULL; entry = entry->next()) - m_symtable.add(tempstr.cpy(entry->symbol()).makelower(), (void *)(FPTR)entry->index(), get_state, set_state); + m_symtable.add(tempstr.cpy(entry->symbol()).makelower().c_str(), (void *)(FPTR)entry->index(), get_state, set_state); } // set up execution-related stuff @@ -2668,7 +2668,7 @@ const char *device_debug::comment_text(offs_t addr) const const UINT32 crc = compute_opcode_crc32(addr); std::set<dasm_comment>::iterator comment = m_comment_set.find(dasm_comment(addr, crc, "", 0)); if (comment == m_comment_set.end()) return NULL; - return comment->m_text; + return comment->m_text.c_str(); } @@ -2683,13 +2683,13 @@ bool device_debug::comment_export(xml_data_node &curnode) astring crc_buf; for (std::set<dasm_comment>::iterator item = m_comment_set.begin(); item != m_comment_set.end(); ++item) { - xml_data_node *datanode = xml_add_child(&curnode, "comment", xml_normalize_string(item->m_text)); + xml_data_node *datanode = xml_add_child(&curnode, "comment", xml_normalize_string(item->m_text.c_str())); if (datanode == NULL) return false; xml_set_attribute_int(datanode, "address", item->m_address); xml_set_attribute_int(datanode, "color", item->m_color); crc_buf.printf("%08X", item->m_crc); - xml_set_attribute(datanode, "crc", crc_buf); + xml_set_attribute(datanode, "crc", crc_buf.c_str()); } return true; } @@ -2908,7 +2908,7 @@ void device_debug::breakpoint_check(offs_t pc) // if we hit, evaluate the action if (bp->m_action) - debug_console_execute_command(m_device.machine(), bp->m_action, 0); + debug_console_execute_command(m_device.machine(), bp->m_action.c_str(), 0); // print a notification, unless the action made us go again if (global->execution_state == EXECUTION_STATE_STOPPED) @@ -2928,7 +2928,7 @@ void device_debug::breakpoint_check(offs_t pc) // if we hit, evaluate the action if (rp->m_action) { - debug_console_execute_command(m_device.machine(), rp->m_action, 0); + debug_console_execute_command(m_device.machine(), rp->m_action.c_str(), 0); } // print a notification, unless the action made us go again @@ -3037,7 +3037,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre // if we hit, evaluate the action if (wp->m_action) - debug_console_execute_command(space.machine(), wp->m_action, 0); + debug_console_execute_command(space.machine(), wp->m_action.c_str(), 0); // print a notification, unless the action made us go again if (global->execution_state == EXECUTION_STATE_STOPPED) @@ -3480,7 +3480,7 @@ void device_debug::tracer::update(offs_t pc) // execute any trace actions first if (m_action) - debug_console_execute_command(m_debug.m_device.machine(), m_action, 0); + debug_console_execute_command(m_debug.m_device.machine(), m_action.c_str(), 0); // print the address astring buffer; diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 1eee2871c59..d08d333ef5f 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -68,7 +68,7 @@ public: bool enabled() const { return m_enabled; } offs_t address() const { return m_address; } const char *condition() const { return m_condition.original_string(); } - const char *action() const { return m_action; } + const char *action() const { return m_action.c_str(); } // setters void setEnabled(bool value) { m_enabled = value; } @@ -113,7 +113,7 @@ public: offs_t address() const { return m_address; } offs_t length() const { return m_length; } const char *condition() const { return m_condition.original_string(); } - const char *action() const { return m_action; } + const char *action() const { return m_action.c_str(); } // setters void setEnabled(bool value) { m_enabled = value; } @@ -148,7 +148,7 @@ public: int index() const { return m_index; } bool enabled() const { return m_enabled; } const char *condition() const { return m_condition.original_string(); } - const char *action() const { return m_action; } + const char *action() const { return m_action.c_str(); } private: // internals diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index bb0092e6e0e..dd568e81d3d 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -504,11 +504,11 @@ bool debug_view_expression::recompute() astring oldstring(m_parsed.original_string()); try { - m_parsed.parse(m_string); + m_parsed.parse(m_string.c_str()); } catch (expression_error &) { - m_parsed.parse(oldstring); + m_parsed.parse(oldstring.c_str()); } } diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h index 2b7148cf813..29fe543e9f4 100644 --- a/src/emu/debug/debugvw.h +++ b/src/emu/debug/debugvw.h @@ -121,7 +121,7 @@ public: virtual ~debug_view_source(); // getters - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } debug_view_source *next() const { return m_next; } device_t *device() const { return m_device; } bool is_octal() const { return m_is_octal; } @@ -266,7 +266,7 @@ public: bool dirty() const { return m_dirty; } UINT64 last_value() const { return m_result; } UINT64 value() { recompute(); return m_result; } - const char *string() const { return m_string; } + const char *string() const { return m_string.c_str(); } symbol_table *context() const { return m_parsed.symbols(); } // setters diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c index 7623b0c829a..2dfb2536b1e 100644 --- a/src/emu/debug/dvdisasm.c +++ b/src/emu/debug/dvdisasm.c @@ -99,7 +99,7 @@ void debug_view_disasm::enumerate_sources() for (device_disasm_interface *dasm = iter.first(); dasm != NULL; dasm = iter.next()) { name.printf("%s '%s'", dasm->device().name(), dasm->device().tag()); - m_source_list.append(*global_alloc(debug_view_disasm_source(name, dasm->device()))); + m_source_list.append(*global_alloc(debug_view_disasm_source(name.c_str(), dasm->device()))); } // reset the source to a known good entry diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c index 5dfbfa0ef8c..fc30971c033 100644 --- a/src/emu/debug/dvmemory.c +++ b/src/emu/debug/dvmemory.c @@ -138,14 +138,14 @@ void debug_view_memory::enumerate_sources() { address_space &space = memintf->space(spacenum); name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space.name()); - m_source_list.append(*global_alloc(debug_view_memory_source(name, space))); + m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), space))); } // then add all the memory regions for (memory_region *region = machine().memory().first_region(); region != NULL; region = region->next()) { name.printf("Region '%s'", region->name()); - m_source_list.append(*global_alloc(debug_view_memory_source(name, *region))); + m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), *region))); } // finally add all global array symbols @@ -163,7 +163,7 @@ void debug_view_memory::enumerate_sources() if (strncmp(itemname, "timer/", 6)) { name.cpy(itemname); - m_source_list.append(*global_alloc(debug_view_memory_source(name, base, valsize, valcount))); + m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), base, valsize, valcount))); } } @@ -245,7 +245,7 @@ void debug_view_memory::view_update() char addrtext[20]; // generate the address - sprintf(addrtext, m_addrformat, address); + sprintf(addrtext, m_addrformat.c_str(), address); dest = destrow + m_section[0].m_pos + 1; for (int ch = 0; addrtext[ch] != 0 && ch < m_section[0].m_width - 1; ch++, dest++) if (dest >= destmin && dest < destmax) diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c index 77afdcc43cf..432895fce86 100644 --- a/src/emu/debug/dvstate.c +++ b/src/emu/debug/dvstate.c @@ -79,7 +79,7 @@ void debug_view_state::enumerate_sources() for (device_state_interface *state = iter.first(); state != NULL; state = iter.next()) { name.printf("%s '%s'", state->device().name(), state->device().tag()); - m_source_list.append(*global_alloc(debug_view_state_source(name, state->device()))); + m_source_list.append(*global_alloc(debug_view_state_source(name.c_str(), state->device()))); } // reset the source to a known good entry diff --git a/src/emu/debug/express.c b/src/emu/debug/express.c index 176cf8d0f19..28b2e408e3b 100644 --- a/src/emu/debug/express.c +++ b/src/emu/debug/express.c @@ -703,7 +703,7 @@ void parsed_expression::print_tokens(FILE *out) void parsed_expression::parse_string_into_tokens() { // loop until done - const char *stringstart = m_original_string; + const char *stringstart = m_original_string.c_str(); const char *string = stringstart; while (string[0] != 0) { @@ -876,7 +876,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& if (string[0] == '@') { string += 1; - return parse_memory_operator(token, buffer); + return parse_memory_operator(token, buffer.c_str()); } // empty string is automatically invalid @@ -938,7 +938,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& 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); + symbol_entry *symbol = m_symtable->find_deep(buffer.c_str()); if (symbol != NULL) { token.configure_symbol(*symbol); @@ -953,7 +953,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& } // attempt to parse as a number in the default base - parse_number(token, buffer, DEFAULT_BASE, expression_error::UNKNOWN_SYMBOL); + parse_number(token, buffer.c_str(), DEFAULT_BASE, expression_error::UNKNOWN_SYMBOL); } @@ -1052,7 +1052,7 @@ void parsed_expression::parse_quoted_string(parse_token &token, const char *&str string++; // make the token - token.configure_string(m_stringlist.append(*global_alloc(expression_string(buffer)))); + token.configure_string(m_stringlist.append(*global_alloc(expression_string(buffer.c_str())))); } diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h index aa7b459747b..3063f5e9c04 100644 --- a/src/emu/debug/express.h +++ b/src/emu/debug/express.h @@ -120,7 +120,7 @@ protected: public: // getters symbol_entry *next() const { return m_next; } - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } // type checking bool is_function() const { return (m_type == SMT_FUNCTION); } @@ -221,7 +221,7 @@ public: // getters bool is_empty() const { return (m_tokenlist.count() == 0); } - const char *original_string() const { return m_original_string; } + const char *original_string() const { return m_original_string.c_str(); } symbol_table *symbols() const { return m_symtable; } // setters @@ -335,8 +335,8 @@ private: m_string(string, (length == 0) ? strlen(string) : length) { } // operators - operator const char *() { return m_string; } - operator const char *() const { return m_string; } + operator const char *() { return m_string.c_str(); } + operator const char *() const { return m_string.c_str(); } private: // internal state diff --git a/src/emu/devfind.h b/src/emu/devfind.h index f1a9d5f952f..69dbec203e8 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -268,7 +268,7 @@ public: ioport_array_finder(device_t &base, const char *basetag) { for (int index = 0; index < _Count; index++) - m_array[index].reset(global_alloc(ioport_finder_type(base, m_tag[index].format("%s.%d", basetag, index)))); + m_array[index].reset(global_alloc(ioport_finder_type(base, m_tag[index].format("%s.%d", basetag, index).c_str()))); } ioport_array_finder(device_t &base, const char * const *tags) @@ -436,7 +436,7 @@ public: shared_ptr_array_finder(device_t &base, const char *basetag, UINT8 width = sizeof(_PointerType) * 8) { for (int index = 0; index < _Count; index++) - m_array[index].reset(global_alloc(shared_ptr_type(base, m_tag[index].format("%s.%d", basetag, index), width))); + m_array[index].reset(global_alloc(shared_ptr_type(base, m_tag[index].format("%s.%d", basetag, index).c_str(), width))); } // array accessors diff --git a/src/emu/device.c b/src/emu/device.c index 25687338338..334505591b6 100644 --- a/src/emu/device.c +++ b/src/emu/device.c @@ -130,7 +130,7 @@ memory_region *device_t::memregion(const char *_tag) const // build a fully-qualified name and look it up astring fullpath; - return machine().memory().region(subtag(fullpath, _tag)); + return machine().memory().region(subtag(fullpath, _tag).c_str()); } @@ -147,7 +147,7 @@ memory_share *device_t::memshare(const char *_tag) const // build a fully-qualified name and look it up astring fullpath; - return machine().memory().shared(subtag(fullpath, _tag)); + return machine().memory().shared(subtag(fullpath, _tag).c_str()); } @@ -164,7 +164,7 @@ memory_bank *device_t::membank(const char *_tag) const // build a fully-qualified name and look it up astring fullpath; - return machine().memory().bank(subtag(fullpath, _tag)); + return machine().memory().bank(subtag(fullpath, _tag).c_str()); } @@ -181,7 +181,7 @@ ioport_port *device_t::ioport(const char *tag) const // build a fully-qualified name and look it up astring fullpath; - return machine().ioport().port(subtag(fullpath, tag)); + return machine().ioport().port(subtag(fullpath, tag).c_str()); } diff --git a/src/emu/device.h b/src/emu/device.h index 6ef44bbcb1b..bdd3ef45234 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -111,13 +111,13 @@ public: // getters running_machine &machine() const { /*assert(m_machine != NULL);*/ return *m_machine; } - const char *tag() const { return m_tag; } - const char *basetag() const { return m_basetag; } + const char *tag() const { return m_tag.c_str(); } + const char *basetag() const { return m_basetag.c_str(); } device_type type() const { return m_type; } - const char *name() const { return m_name; } - const char *shortname() const { return m_shortname; } - const char *searchpath() const { return m_searchpath; } - const char *source() const { return m_source; } + const char *name() const { return m_name.c_str(); } + const char *shortname() const { return m_shortname.c_str(); } + const char *searchpath() const { return m_searchpath.c_str(); } + const char *source() const { return m_source.c_str(); } device_t *owner() const { return m_owner; } device_t *next() const { return m_next; } UINT32 configured_clock() const { return m_configured_clock; } diff --git a/src/emu/diexec.c b/src/emu/diexec.c index d19183b47ee..73148950ea8 100644 --- a/src/emu/diexec.c +++ b/src/emu/diexec.c @@ -548,7 +548,7 @@ void device_execute_interface::interface_post_reset() { // get the screen that will trigger the VBLANK astring tempstring; - screen_device *screen = downcast<screen_device *>(device().machine().device(device().siblingtag(tempstring,m_vblank_interrupt_screen))); + screen_device *screen = downcast<screen_device *>(device().machine().device(device().siblingtag(tempstring, m_vblank_interrupt_screen).c_str())); assert(screen != NULL); screen->register_vblank_callback(vblank_state_delegate(FUNC(device_execute_interface::on_vblank), this)); diff --git a/src/emu/digfx.c b/src/emu/digfx.c index 8e7c8059727..d3673aa6179 100644 --- a/src/emu/digfx.c +++ b/src/emu/digfx.c @@ -325,7 +325,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con else device().owner()->subtag(gfxregion, region); - UINT32 region_length = valid.region_length(gfxregion); + UINT32 region_length = valid.region_length(gfxregion.c_str()); if (region_length == 0) osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.c_str()); diff --git a/src/emu/diimage.c b/src/emu/diimage.c index 92eff0e159f..58a46671c4e 100644 --- a/src/emu/diimage.c +++ b/src/emu/diimage.c @@ -312,7 +312,7 @@ bool device_image_interface::try_change_working_directory(const char *subdir) /* did we successfully identify the directory? */ if (success) - zippath_combine(m_working_directory, m_working_directory, subdir); + zippath_combine(m_working_directory, m_working_directory.c_str(), subdir); return success; } @@ -354,7 +354,7 @@ const char * device_image_interface::working_directory() if (!m_working_directory) setup_working_directory(); - return m_working_directory; + return m_working_directory.c_str(); } @@ -499,14 +499,14 @@ UINT32 device_image_interface::crc() -------------------------------------------------*/ void device_image_interface::battery_load(void *buffer, int length, int fill) { - astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv"); - image_battery_load_by_name(device().machine().options(), fname, buffer, length, fill); + astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext.c_str(), ".nv"); + image_battery_load_by_name(device().machine().options(), fname.c_str(), buffer, length, fill); } void device_image_interface::battery_load(void *buffer, int length, void *def_buffer) { - astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv"); - image_battery_load_by_name(device().machine().options(), fname, buffer, length, def_buffer); + astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext.c_str(), ".nv"); + image_battery_load_by_name(device().machine().options(), fname.c_str(), buffer, length, def_buffer); } /*------------------------------------------------- @@ -517,9 +517,9 @@ void device_image_interface::battery_load(void *buffer, int length, void *def_bu -------------------------------------------------*/ void device_image_interface::battery_save(const void *buffer, int length) { - astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv"); + astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext.c_str(), ".nv"); - image_battery_save_by_name(device().machine().options(), fname, buffer, length); + image_battery_save_by_name(device().machine().options(), fname.c_str(), buffer, length); } //------------------------------------------------- @@ -614,7 +614,7 @@ image_error_t device_image_interface::load_image_by_path(UINT32 open_flags, cons /* if successful, set the file name */ if (filerr == FILERR_NONE) - set_image_filename(revised_path); + set_image_filename(revised_path.c_str()); return err; } @@ -668,7 +668,7 @@ int device_image_interface::reopen_for_write(const char *path) /* if successful, set the file name */ if (filerr == FILERR_NONE) - set_image_filename(revised_path); + set_image_filename(revised_path.c_str()); return err; } @@ -900,7 +900,7 @@ bool device_image_interface::load_internal(const char *path, bool is_create, int // if we had launched from softlist with a specified part, e.g. "shortname:part" // we would have recorded the wrong name, so record it again based on software_info if (m_software_info_ptr && m_full_software_name) - m_err = set_image_filename(m_full_software_name); + m_err = set_image_filename(m_full_software_name.c_str()); // check if image should be read-only const char *read_only = get_feature("read_only"); @@ -1218,10 +1218,10 @@ software_part *device_image_interface::find_software_item(const char *path, bool { if (swlist_name == swlistdev->list_name() || !(swlist_name.len() > 0)) { - software_info *info = swlistdev->find(swinfo_name); + software_info *info = swlistdev->find(swinfo_name.c_str()); if (info != NULL) { - software_part *part = info->find_part(swpart_name, interface); + software_part *part = info->find_part(swpart_name.c_str(), interface); if (part != NULL) return part; } @@ -1233,7 +1233,7 @@ software_part *device_image_interface::find_software_item(const char *path, bool // gameboy:sml) which is not handled properly by software_name_split // since the function cannot distinguish between this and the case // path = swinfo_name:swpart_name - software_info *info = swlistdev->find(swpart_name); + software_info *info = swlistdev->find(swpart_name.c_str()); if (info != NULL) { software_part *part = info->find_part(NULL, interface); diff --git a/src/emu/diimage.h b/src/emu/diimage.h index 5a35899ba4e..3878732dfbd 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -80,10 +80,10 @@ public: m_optspec(optspec) { } image_device_format *next() const { return m_next; } - const char *name() const { return m_name; } - const char *description() const { return m_description; } - const char *extensions() const { return m_extensions; } - const char *optspec() const { return m_optspec; } + const char *name() const { return m_name.c_str(); } + const char *description() const { return m_description.c_str(); } + const char *extensions() const { return m_extensions.c_str(); } + const char *optspec() const { return m_optspec.c_str(); } private: image_device_format *m_next; @@ -171,10 +171,10 @@ public: void message(const char *format, ...) ATTR_PRINTF(2,3); bool exists() { return m_image_name; } - const char *filename() { if (!m_image_name) return NULL; else return m_image_name; } - const char *basename() { if (!m_basename) return NULL; else return m_basename; } - const char *basename_noext() { if (!m_basename_noext) return NULL; else return m_basename_noext; } - const char *filetype() { if (!m_filetype) return NULL; else return m_filetype; } + const char *filename() { if (!m_image_name) return NULL; else return m_image_name.c_str(); } + const char *basename() { if (!m_basename) return NULL; else return m_basename.c_str(); } + const char *basename_noext() { if (!m_basename_noext) return NULL; else return m_basename_noext.c_str(); } + const char *filetype() { if (!m_filetype) return NULL; else return m_filetype.c_str(); } core_file *image_core_file() { return m_file; } UINT64 length() { check_for_file(); return core_fsize(m_file); } bool is_readonly() { return m_readonly; } @@ -193,14 +193,14 @@ public: // configuration access void set_init_phase() { m_init_phase = TRUE; } - const char* longname() { return m_longname; } - const char* manufacturer() { return m_manufacturer; } - const char* year() { return m_year; } + const char* longname() { return m_longname.c_str(); } + const char* manufacturer() { return m_manufacturer.c_str(); } + const char* year() { return m_year.c_str(); } UINT32 supported() { return m_supported; } const software_info *software_entry() { return m_software_info_ptr; } const software_part *part_entry() { return m_software_part_ptr; } - const char *software_list_name() { return m_software_list_name; } + const char *software_list_name() { return m_software_list_name.c_str(); } void set_working_directory(const char *working_directory) { m_working_directory = working_directory; } const char * working_directory(); @@ -221,8 +221,8 @@ public: - const char *instance_name() const { return m_instance_name; } - const char *brief_instance_name() const { return m_brief_instance_name; } + const char *instance_name() const { return m_instance_name.c_str(); } + const char *brief_instance_name() const { return m_brief_instance_name.c_str(); } bool uses_file_extension(const char *file_extension) const; image_device_format *formatlist() const { return m_formatlist.first(); } diff --git a/src/emu/dimemory.c b/src/emu/dimemory.c index 57acebf7b32..c36a68531ea 100644 --- a/src/emu/dimemory.c +++ b/src/emu/dimemory.c @@ -327,13 +327,13 @@ void device_memory_interface::interface_validity_check(validity_checker &valid) if (entry->m_read.m_type == AMH_DEVICE_DELEGATE && entry->m_read.m_tag != NULL) { astring temp(entry->m_read.m_tag); - if (device().siblingdevice(temp) == NULL) + if (device().siblingdevice(temp.c_str()) == NULL) osd_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig->m_name, entry->m_read.m_tag); } if (entry->m_write.m_type == AMH_DEVICE_DELEGATE && entry->m_write.m_tag != NULL) { astring temp(entry->m_write.m_tag); - if (device().siblingdevice(temp) == NULL) + if (device().siblingdevice(temp.c_str()) == NULL) osd_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig->m_name, entry->m_write.m_tag); } diff --git a/src/emu/disound.c b/src/emu/disound.c index 2e9b2cca36b..506ae9c4d07 100644 --- a/src/emu/disound.c +++ b/src/emu/disound.c @@ -265,7 +265,7 @@ void device_sound_interface::interface_pre_start() for (const sound_route *route = sound->first_route(); route != NULL; route = route->next()) { // see if we are the target of this route; if we are, make sure the source device is started - device_t *target_device = sound->device().siblingdevice(route->m_target); + device_t *target_device = sound->device().siblingdevice(route->m_target.c_str()); if (target_device == &m_device && !sound->device().started()) throw device_missing_dependencies(); } @@ -279,7 +279,7 @@ void device_sound_interface::interface_pre_start() for (const sound_route *route = sound->first_route(); route != NULL; route = route->next()) { // see if we are the target of this route - device_t *target_device = sound->device().siblingdevice(route->m_target); + device_t *target_device = sound->device().siblingdevice(route->m_target.c_str()); if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT) { const_cast<sound_route *>(route)->m_input = m_auto_allocated_inputs; @@ -305,7 +305,7 @@ void device_sound_interface::interface_post_start() for (const sound_route *route = sound->first_route(); route != NULL; route = route->next()) { // if we are the target of this route, hook it up - device_t *target_device = sound->device().siblingdevice(route->m_target); + device_t *target_device = sound->device().siblingdevice(route->m_target.c_str()); if (target_device == &m_device) { // iterate over all outputs, matching any that apply @@ -421,7 +421,7 @@ void device_mixer_interface::interface_pre_start() for (const sound_route *route = sound->first_route(); route != NULL; route = route->next()) { // see if we are the target of this route - device_t *target_device = sound->device().siblingdevice(route->m_target); + device_t *target_device = sound->device().siblingdevice(route->m_target.c_str()); if (target_device == &device() && route->m_input < m_auto_allocated_inputs) { int count = (route->m_output == ALL_OUTPUTS) ? sound->outputs() : 1; diff --git a/src/emu/distate.c b/src/emu/distate.c index 1b9f03973bd..467ae5447c1 100644 --- a/src/emu/distate.c +++ b/src/emu/distate.c @@ -175,7 +175,7 @@ astring &device_state_entry::format(astring &dest, const char *string, bool maxo bool hitnonzero = false; bool reset = true; int width = 0; - for (const char *fptr = m_format; *fptr != 0; fptr++) + for (const char *fptr = m_format.c_str(); *fptr != 0; fptr++) { // reset any accumulated state if (reset) @@ -449,7 +449,7 @@ astring &device_state_interface::state_string(int index, astring &dest) state_string_export(*entry, custom); // ask the entry to format itself - return entry->format(dest, custom); + return entry->format(dest, custom.c_str()); } diff --git a/src/emu/distate.h b/src/emu/distate.h index 1d16e81f793..5999d3281bc 100644 --- a/src/emu/distate.h +++ b/src/emu/distate.h @@ -66,7 +66,7 @@ public: // query information int index() const { return m_index; } void *dataptr() const { return m_dataptr.v; } - const char *symbol() const { return m_symbol; } + const char *symbol() const { return m_symbol.c_str(); } bool visible() const { return ((m_flags & DSF_NOSHOW) == 0); } bool divider() const { return m_flags & DSF_DIVIDER; } device_state_interface *parent_state() const {return m_device_state;} diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index 8a5b3a20fb0..f4609d53a2c 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -275,8 +275,8 @@ void emu_options::update_slot_options() slot->get_default_card_software(defvalue); if (defvalue.len() > 0) { - set_default_value(name, defvalue); - const device_slot_option *option = slot->option(defvalue); + set_default_value(name, defvalue.c_str()); + const device_slot_option *option = slot->option(defvalue.c_str()); set_flag(name, ~OPTION_FLAG_INTERNAL, (option != NULL && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); } } @@ -317,7 +317,7 @@ void emu_options::add_device_options(bool isfirstpass) // add the option if (!exists(image->instance_name())) - add_entry(option_name, NULL, OPTION_STRING | OPTION_FLAG_DEVICE, NULL, true); + add_entry(option_name.c_str(), NULL, OPTION_STRING | OPTION_FLAG_DEVICE, NULL, true); } } @@ -444,10 +444,10 @@ void emu_options::parse_standard_inis(astring &error_string) // next parse "source/<sourcefile>.ini"; if that doesn't exist, try <sourcefile>.ini astring sourcename; core_filename_extract_base(sourcename, cursystem->source_file, true).ins(0, "source" PATH_SEPARATOR); - if (!parse_one_ini(sourcename, OPTION_PRIORITY_SOURCE_INI, &error_string)) + if (!parse_one_ini(sourcename.c_str(), OPTION_PRIORITY_SOURCE_INI, &error_string)) { core_filename_extract_base(sourcename, cursystem->source_file, true); - parse_one_ini(sourcename, OPTION_PRIORITY_SOURCE_INI, &error_string); + parse_one_ini(sourcename.c_str(), OPTION_PRIORITY_SOURCE_INI, &error_string); } // then parse the grandparent, parent, and system-specific INIs @@ -472,7 +472,7 @@ void emu_options::parse_standard_inis(astring &error_string) const game_driver *emu_options::system() const { astring tempstr; - int index = driver_list::find(core_filename_extract_base(tempstr, system_name(), true)); + int index = driver_list::find(core_filename_extract_base(tempstr, system_name(), true).c_str()); return (index != -1) ? &driver_list::driver(index) : NULL; } @@ -551,7 +551,7 @@ const char *emu_options::sub_value(astring &buffer, const char *name, const char { astring tmp(",", subname, "="); buffer = value(name); - int pos = buffer.find(0, tmp); + int pos = buffer.find(0, tmp.c_str()); if (pos != -1) { int endpos = buffer.chr(pos + 1, ','); diff --git a/src/emu/fileio.c b/src/emu/fileio.c index 646825ae13e..5d9514702e4 100644 --- a/src/emu/fileio.c +++ b/src/emu/fileio.c @@ -114,7 +114,7 @@ const osd_directory_entry *file_enumerator::next() return NULL; // open the path - m_curdir = osd_opendir(m_pathbuffer); + m_curdir = osd_opendir(m_pathbuffer.c_str()); } // get the next entry from the current directory @@ -241,13 +241,13 @@ hash_collection &emu_file::hashes(const char *types) // if we have ZIP data, just hash that directly if (m__7zdata.count() != 0) { - m_hashes.compute(m__7zdata, m__7zdata.count(), needed); + m_hashes.compute(m__7zdata, m__7zdata.count(), needed.c_str()); return m_hashes; } if (m_zipdata.count() != 0) { - m_hashes.compute(m_zipdata, m_zipdata.count(), needed); + m_hashes.compute(m_zipdata, m_zipdata.count(), needed.c_str()); return m_hashes; } @@ -257,7 +257,7 @@ hash_collection &emu_file::hashes(const char *types) return m_hashes; // compute the hash - m_hashes.compute(filedata, core_fsize(m_file), needed); + m_hashes.compute(filedata, core_fsize(m_file), needed.c_str()); return m_hashes; } @@ -282,21 +282,21 @@ file_error emu_file::open(const char *name1, const char *name2) { // concatenate the strings and do a standard open astring name(name1, name2); - return open(name); + return open(name.c_str()); } file_error emu_file::open(const char *name1, const char *name2, const char *name3) { // concatenate the strings and do a standard open astring name(name1, name2, name3); - return open(name); + return open(name.c_str()); } file_error emu_file::open(const char *name1, const char *name2, const char *name3, const char *name4) { // concatenate the strings and do a standard open astring name(name1, name2, name3, name4); - return open(name); + return open(name.c_str()); } file_error emu_file::open(const char *name, UINT32 crc) @@ -315,21 +315,21 @@ file_error emu_file::open(const char *name1, const char *name2, UINT32 crc) { // concatenate the strings and do a standard open astring name(name1, name2); - return open(name, crc); + return open(name.c_str(), crc); } file_error emu_file::open(const char *name1, const char *name2, const char *name3, UINT32 crc) { // concatenate the strings and do a standard open astring name(name1, name2, name3); - return open(name, crc); + return open(name.c_str(), crc); } file_error emu_file::open(const char *name1, const char *name2, const char *name3, const char *name4, UINT32 crc) { // concatenate the strings and do a standard open astring name(name1, name2, name3, name4); - return open(name, crc); + return open(name.c_str(), crc); } @@ -346,10 +346,10 @@ file_error emu_file::open_next() // loop over paths file_error filerr = FILERR_NOT_FOUND; - while (m_iterator.next(m_fullpath, m_filename)) + while (m_iterator.next(m_fullpath, m_filename.c_str())) { // attempt to open the file directly - filerr = core_fopen(m_fullpath, m_openflags, &m_file); + filerr = core_fopen(m_fullpath.c_str(), m_openflags, &m_file); if (filerr == FILERR_NONE) break; @@ -413,7 +413,7 @@ void emu_file::close() m_zipdata.reset(); if (m_remove_on_close) - osd_rmfile(m_fullpath); + osd_rmfile(m_fullpath.c_str()); m_remove_on_close = false; // reset our hashes and path as well @@ -698,7 +698,7 @@ file_error emu_file::attempt_zipped() // attempt to open the ZIP file zip_file *zip; - zip_error ziperr = zip_file_open(m_fullpath, &zip); + zip_error ziperr = zip_file_open(m_fullpath.c_str(), &zip); // chop the .zip back off the filename before continuing m_fullpath.substr(0, dirsep); @@ -833,7 +833,7 @@ file_error emu_file::attempt__7zped() // attempt to open the _7Z file _7z_file *_7z; - _7z_error _7zerr = _7z_file_open(m_fullpath, &_7z); + _7z_error _7zerr = _7z_file_open(m_fullpath.c_str(), &_7z); // chop the ._7z back off the filename before continuing m_fullpath.substr(0, dirsep); diff --git a/src/emu/fileio.h b/src/emu/fileio.h index 846f828a6be..2f2dee57214 100644 --- a/src/emu/fileio.h +++ b/src/emu/fileio.h @@ -93,8 +93,8 @@ public: operator core_file *(); operator core_file &(); bool is_open() const { return (m_file != NULL); } - const char *filename() const { return m_filename; } - const char *fullpath() const { return m_fullpath; } + const char *filename() const { return m_filename.c_str(); } + const char *fullpath() const { return m_fullpath.c_str(); } UINT32 openflags() const { return m_openflags; } hash_collection &hashes(const char *types); bool restrict_to_mediapath() { return m_restrict_to_mediapath; } diff --git a/src/emu/hash.c b/src/emu/hash.c index f9a04e8fd90..9b64d18f299 100644 --- a/src/emu/hash.c +++ b/src/emu/hash.c @@ -122,7 +122,7 @@ const char *hash_collection::hash_types(astring &buffer) const buffer.cat(HASH_CRC); if (m_has_sha1) buffer.cat(HASH_SHA1); - return buffer; + return buffer.c_str(); } @@ -204,7 +204,7 @@ const char *hash_collection::internal_string(astring &buffer) const buffer.cat(HASH_SHA1).cat(m_sha1.as_string(temp)); // append flags - return buffer.cat(m_flags); + return buffer.cat(m_flags).c_str(); } @@ -231,7 +231,7 @@ const char *hash_collection::macro_string(astring &buffer) const buffer.cat("NO_DUMP "); if (flag(FLAG_BAD_DUMP)) buffer.cat("BAD_DUMP "); - return buffer.trimspace(); + return buffer.trimspace().c_str(); } @@ -258,7 +258,7 @@ const char *hash_collection::attribute_string(astring &buffer) const buffer.cat("status=\"nodump\"" ); if (flag(FLAG_BAD_DUMP)) buffer.cat("status=\"baddump\"" ); - return buffer.trimspace(); + return buffer.trimspace().c_str(); } diff --git a/src/emu/image.c b/src/emu/image.c index 1ca389f61cd..555294033bf 100644 --- a/src/emu/image.c +++ b/src/emu/image.c @@ -143,7 +143,7 @@ static int write_config(emu_options &options, const char *filename, const game_d { astring inistring; options.output_ini(inistring); - file.puts(inistring); + file.puts(inistring.c_str()); retval = 0; } return retval; diff --git a/src/emu/imagedev/chd_cd.c b/src/emu/imagedev/chd_cd.c index 091502b3d2d..54d360a1225 100644 --- a/src/emu/imagedev/chd_cd.c +++ b/src/emu/imagedev/chd_cd.c @@ -103,21 +103,21 @@ bool cdrom_image_device::call_load() if (software_entry() == NULL) { - if (strstr(m_image_name,".chd") && is_loaded()) { + if (strstr(m_image_name.c_str(), ".chd") && is_loaded()) { err = m_self_chd.open( *image_core_file() ); /* CDs are never writeable */ if ( err ) goto error; chd = &m_self_chd; } } else { - chd = get_disk_handle(device().machine(), device().subtag(tempstring,"cdrom")); + chd = get_disk_handle(device().machine(), device().subtag(tempstring, "cdrom").c_str()); } /* open the CHD file */ if (chd) { m_cdrom_handle = cdrom_open( chd ); } else { - m_cdrom_handle = cdrom_open( m_image_name ); + m_cdrom_handle = cdrom_open(m_image_name.c_str()); } if ( ! m_cdrom_handle ) goto error; diff --git a/src/emu/imagedev/diablo.c b/src/emu/imagedev/diablo.c index 49d68cc62d6..66731719920 100644 --- a/src/emu/imagedev/diablo.c +++ b/src/emu/imagedev/diablo.c @@ -175,20 +175,20 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file /* try to open the diff */ //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); + file_error filerr = diff_file.open(fname.c_str()); if (filerr == FILERR_NONE) { astring fullpath(diff_file.fullpath()); diff_file.close(); //printf("Opening differencing image file: %s\n", fullpath.c_str()); - return diff_chd.open(fullpath, true, &source); + return diff_chd.open(fullpath.c_str(), true, &source); } /* didn't work; try creating it instead */ //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); + filerr = diff_file.open(fname.c_str()); if (filerr == FILERR_NONE) { astring fullpath(diff_file.fullpath()); @@ -197,7 +197,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file /* create the CHD */ //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); + chd_error err = diff_chd.create(fullpath.c_str(), source.logical_bytes(), source.hunk_bytes(), compression, source); if (err != CHDERR_NONE) return err; @@ -220,7 +220,7 @@ int diablo_image_device::internal_load_dsk() /* open the CHD file */ if (software_entry() != NULL) { - m_chd = get_disk_handle(device().machine(), device().subtag(tempstring,"harddriv")); + m_chd = get_disk_handle(device().machine(), device().subtag(tempstring, "harddriv").c_str()); } else { diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c index 1a2f09e16dd..780bdf2d5b7 100644 --- a/src/emu/imagedev/floppy.c +++ b/src/emu/imagedev/floppy.c @@ -325,7 +325,7 @@ floppy_image_format_t *floppy_image_device::identify(astring filename) core_file *fd; astring revised_path; - file_error err = zippath_fopen(filename, OPEN_FLAG_READ, fd, revised_path); + file_error err = zippath_fopen(filename.c_str(), OPEN_FLAG_READ, fd, revised_path); if(err) { seterror(IMAGE_ERROR_INVALIDIMAGE, "Unable to open the image file"); return 0; @@ -867,16 +867,16 @@ void ui_menu_control_floppy_image::do_load_create() { floppy_image_device *fd = static_cast<floppy_image_device *>(image); if(input_filename == "") { - int err = fd->create(output_filename, 0, NULL); + int err = fd->create(output_filename.c_str(), 0, NULL); if (err != 0) { popmessage("Error: %s", fd->error()); return; } fd->setup_write(output_format); } else { - int err = fd->load(input_filename); + int err = fd->load(input_filename.c_str()); if(!err && output_filename != "") - err = fd->reopen_for_write(output_filename); + err = fd->reopen_for_write(output_filename.c_str()); if(err != 0) { popmessage("Error: %s", fd->error()); return; @@ -891,7 +891,7 @@ void ui_menu_control_floppy_image::hook_load(astring filename, bool softlist) if (softlist) { popmessage("When loaded from software list, the disk is Read-only.\n"); - image->load(filename); + image->load(filename.c_str()); ui_menu::stack_pop(machine()); return; } @@ -912,7 +912,7 @@ void ui_menu_control_floppy_image::hook_load(astring filename, bool softlist) astring tmp_path; core_file *tmp_file; /* attempt to open the file for writing but *without* create */ - filerr = zippath_fopen(filename, OPEN_FLAG_READ|OPEN_FLAG_WRITE, tmp_file, tmp_path); + filerr = zippath_fopen(filename.c_str(), OPEN_FLAG_READ | OPEN_FLAG_WRITE, tmp_file, tmp_path); if(!filerr) core_fclose(tmp_file); else @@ -933,14 +933,14 @@ void ui_menu_control_floppy_image::handle() for(floppy_image_format_t *i = fif_list; i; i = i->next) { if(!i->supports_save()) continue; - if(i->extension_matches(current_file)) + if (i->extension_matches(current_file.c_str())) format_array[total_usable++] = i; } ext_match = total_usable; for(floppy_image_format_t *i = fif_list; i; i = i->next) { if(!i->supports_save()) continue; - if(!i->extension_matches(current_file)) + if (!i->extension_matches(current_file.c_str())) format_array[total_usable++] = i; } submenu_result = -1; @@ -955,7 +955,7 @@ void ui_menu_control_floppy_image::handle() state = START_FILE; handle(); } else { - zippath_combine(output_filename, current_directory, current_file); + zippath_combine(output_filename, current_directory.c_str(), current_file.c_str()); output_format = format_array[submenu_result]; do_load_create(); ui_menu::stack_pop(machine()); diff --git a/src/emu/imagedev/harddriv.c b/src/emu/imagedev/harddriv.c index 6960662dc64..780317e9193 100644 --- a/src/emu/imagedev/harddriv.c +++ b/src/emu/imagedev/harddriv.c @@ -181,20 +181,20 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file /* try to open the diff */ //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); + file_error filerr = diff_file.open(fname.c_str()); if (filerr == FILERR_NONE) { astring fullpath(diff_file.fullpath()); diff_file.close(); //printf("Opening differencing image file: %s\n", fullpath.c_str()); - return diff_chd.open(fullpath, true, &source); + return diff_chd.open(fullpath.c_str(), true, &source); } /* didn't work; try creating it instead */ //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); + filerr = diff_file.open(fname.c_str()); if (filerr == FILERR_NONE) { astring fullpath(diff_file.fullpath()); @@ -203,7 +203,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file /* create the CHD */ //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); + chd_error err = diff_chd.create(fullpath.c_str(), source.logical_bytes(), source.hunk_bytes(), compression, source); if (err != CHDERR_NONE) return err; @@ -226,7 +226,7 @@ int harddisk_image_device::internal_load_hd() /* open the CHD file */ if (software_entry() != NULL) { - m_chd = get_disk_handle(device().machine(), device().subtag(tempstring,"harddriv")); + m_chd = get_disk_handle(device().machine(), device().subtag(tempstring, "harddriv").c_str()); } else { diff --git a/src/emu/info.c b/src/emu/info.c index 54cd2734c34..67a31eae63b 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -628,11 +628,11 @@ void info_xml_creator::output_chips(device_t &device, const char *root_tag) if (strcmp(exec->device().tag(), device.tag())) { astring newtag(exec->device().tag()), oldtag(":"); - newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); + newtag.substr(newtag.find(oldtag.cat(root_tag).c_str()) + oldtag.len()); fprintf(m_output, "\t\t<chip"); fprintf(m_output, " type=\"cpu\""); - fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag)); + fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str())); fprintf(m_output, " name=\"%s\"", xml_normalize_string(exec->device().name())); fprintf(m_output, " clock=\"%d\"", exec->device().clock()); fprintf(m_output, "/>\n"); @@ -646,11 +646,11 @@ void info_xml_creator::output_chips(device_t &device, const char *root_tag) if (strcmp(sound->device().tag(), device.tag())) { astring newtag(sound->device().tag()), oldtag(":"); - newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); + newtag.substr(newtag.find(oldtag.cat(root_tag).c_str()) + oldtag.len()); fprintf(m_output, "\t\t<chip"); fprintf(m_output, " type=\"audio\""); - fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag)); + fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str())); fprintf(m_output, " name=\"%s\"", xml_normalize_string(sound->device().name())); if (sound->device().clock() != 0) fprintf(m_output, " clock=\"%d\"", sound->device().clock()); @@ -674,10 +674,10 @@ void info_xml_creator::output_display(device_t &device, const char *root_tag) if (strcmp(screendev->tag(), device.tag())) { astring newtag(screendev->tag()), oldtag(":"); - newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); + newtag.substr(newtag.find(oldtag.cat(root_tag).c_str()) + oldtag.len()); fprintf(m_output, "\t\t<display"); - fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag)); + fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str())); switch (screendev->screen_type()) { @@ -1080,11 +1080,11 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char * astring output; astring newtag(port->tag()), oldtag(":"); - newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); + newtag.substr(newtag.find(oldtag.cat(root_tag).c_str()) + oldtag.len()); // output the switch name information astring normalized_field_name(xml_normalize_string(field->name())); - astring normalized_newtag(xml_normalize_string(newtag)); + astring normalized_newtag(xml_normalize_string(newtag.c_str())); 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 @@ -1211,14 +1211,14 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag) if (strcmp(imagedev->device().tag(), device.tag())) { astring newtag(imagedev->device().tag()), oldtag(":"); - newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); + newtag.substr(newtag.find(oldtag.cat(root_tag).c_str()) + oldtag.len()); // print m_output device type fprintf(m_output, "\t\t<device type=\"%s\"", xml_normalize_string(imagedev->image_type_name())); // does this device have a tag? if (imagedev->device().tag()) - fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag)); + fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str())); // is this device mandatory? if (imagedev->must_be_loaded()) @@ -1269,10 +1269,10 @@ void info_xml_creator::output_slots(device_t &device, const char *root_tag) if (strcmp(slot->device().tag(), device.tag())) { astring newtag(slot->device().tag()), oldtag(":"); - newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); + newtag.substr(newtag.find(oldtag.cat(root_tag).c_str()) + oldtag.len()); // print m_output device type - fprintf(m_output, "\t\t<slot name=\"%s\">\n", xml_normalize_string(newtag)); + fprintf(m_output, "\t\t<slot name=\"%s\">\n", xml_normalize_string(newtag.c_str())); /* if (slot->slot_interface()[0]) @@ -1346,7 +1346,7 @@ void info_xml_creator::output_ramoptions() { astring option; option.cpysubstr(options, start, (end == -1) ? -1 : end - start); - fprintf(m_output, "\t\t<ramoption>%u</ramoption>\n", ram_device::parse_string(option)); + fprintf(m_output, "\t\t<ramoption>%u</ramoption>\n", ram_device::parse_string(option.c_str())); if (end == -1) break; } diff --git a/src/emu/input.c b/src/emu/input.c index 1db105bc1db..9ca93699b15 100644 --- a/src/emu/input.c +++ b/src/emu/input.c @@ -553,7 +553,7 @@ const char *joystick_map::to_string(astring &string) const string.catprintf("\n"); } - return string; + return string.c_str(); } @@ -1468,7 +1468,7 @@ const char *input_manager::code_name(astring &string, input_code code) const // if nothing there, return an empty string input_device_item *item = item_from_code(code); if (item == NULL) - return string; + return string.c_str(); // determine the devclass part const char *devclass = (*devclass_string_table)[code.device_class()]; @@ -1510,7 +1510,7 @@ const char *input_manager::code_name(astring &string, input_code code) const string.cat(" ").cat(modifier); // delete any leading spaces - return string.trimspace(); + return string.trimspace().c_str(); } @@ -1551,7 +1551,7 @@ const char *input_manager::code_to_token(astring &string, input_code code) const string.cat("_").cat(modifier); if (itemclass[0] != 0) string.cat("_").cat(itemclass); - return string; + return string.c_str(); } @@ -1585,7 +1585,7 @@ input_code input_manager::code_from_token(const char *_token) // second token might be index; look for number int devindex = 0; - if (numtokens > 2 && sscanf(token[curtok], "%d", &devindex) == 1) + if (numtokens > 2 && sscanf(token[curtok].c_str(), "%d", &devindex) == 1) { curtok++; devindex--; @@ -1946,7 +1946,7 @@ const char *input_manager::seq_name(astring &string, const input_seq &seq) const // special case: empty if (clean_index == 0) - return string.cpy((seq.length() == 0) ? "None" : "n/a"); + return string.cpy((seq.length() == 0) ? "None" : "n/a").c_str(); // start with an empty buffer string.reset(); @@ -1969,7 +1969,7 @@ const char *input_manager::seq_name(astring &string, const input_seq &seq) const else string.cat(code_name(codestr, code)); } - return string; + return string.c_str(); } @@ -2004,7 +2004,7 @@ const char *input_manager::seq_to_tokens(astring &string, const input_seq &seq) else string.cat(code_to_token(codestr, code)); } - return string; + return string.c_str(); } diff --git a/src/emu/input.h b/src/emu/input.h index 72763bb2ac7..04bf0502ab4 100644 --- a/src/emu/input.h +++ b/src/emu/input.h @@ -500,11 +500,11 @@ public: input_device &device() const { return m_device; } input_manager &manager() const; running_machine &machine() const; - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } void *internal() const { return m_internal; } input_item_id itemid() const { return m_itemid; } input_item_class itemclass() const { return m_itemclass; } - const char *token() const { return m_token; } + const char *token() const { return m_token.c_str(); } INT32 current() const { return m_current; } INT32 memory() const { return m_memory; } @@ -549,7 +549,7 @@ public: input_manager &manager() const; running_machine &machine() const; input_device_class devclass() const; - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } int devindex() const { return m_devindex; } input_device_item *item(input_item_id index) const { return m_item[index]; } input_item_id maxitem() const { return m_maxitem; } diff --git a/src/emu/ioport.c b/src/emu/ioport.c index 25da324ee38..2be5b9c31f6 100644 --- a/src/emu/ioport.c +++ b/src/emu/ioport.c @@ -1264,7 +1264,7 @@ const char *natural_keyboard::unicode_to_string(astring &buffer, unicode_char ch buffer.format("U+%04X", unsigned(ch)); break; } - return buffer; + return buffer.c_str(); } @@ -1327,7 +1327,7 @@ const char *natural_keyboard::key_name(astring &string, unicode_char ch) // otherwise, opt for question marks else string.cpy("???"); - return string; + return string.c_str(); } @@ -1520,7 +1520,7 @@ const char *ioport_field::name() const { // if we have a non-default name, use that if (m_live != NULL && m_live->name) - return m_live->name; + return m_live->name.c_str(); if (m_name != NULL) return m_name; @@ -2066,13 +2066,13 @@ void ioport_field::expand_diplocation(const char *location, astring &errorbuf) tempstr.cpy(curentry, comma - curentry); // first extract the switch name if present - const char *number = tempstr; - const char *colon = strchr(tempstr, ':'); + const char *number = tempstr.c_str(); + const char *colon = strchr(tempstr.c_str(), ':'); // allocate and copy the name if it is present if (colon != NULL) { - lastname = name.cpy(number, colon - number); + lastname = name.cpy(number, colon - number).c_str(); number = colon + 1; } @@ -2101,7 +2101,7 @@ void ioport_field::expand_diplocation(const char *location, astring &errorbuf) errorbuf.catprintf("Switch location '%s' has invalid format!\n", location); // allocate a new entry - m_diploclist.append(*global_alloc(ioport_diplocation(name, swnum, invert))); + m_diploclist.append(*global_alloc(ioport_diplocation(name.c_str(), swnum, invert))); entries++; // advance to the next item @@ -3176,7 +3176,7 @@ void ioport_manager::save_sequence(xml_data_node *parentnode, input_seq_type typ machine().input().seq_to_tokens(seqstring, seq); // add the new node - xml_data_node *seqnode = xml_add_child(parentnode, "newseq", seqstring); + xml_data_node *seqnode = xml_add_child(parentnode, "newseq", seqstring.c_str()); if (seqnode != NULL) xml_set_attribute(seqnode, "type", seqtypestrings[type]); } @@ -3685,7 +3685,7 @@ void ioport_configurer::port_alloc(const char *tag) m_owner.subtag(fulltag, tag); // add it to the list, and reset current field/setting - m_curport = &m_portlist.append(fulltag, *global_alloc(ioport_port(m_owner, fulltag))); + m_curport = &m_portlist.append(fulltag.c_str(), *global_alloc(ioport_port(m_owner, fulltag.c_str()))); m_curfield = NULL; m_cursetting = NULL; } @@ -4402,10 +4402,10 @@ const char *ioport_manager::input_type_to_token(astring &string, ioport_type typ // look up the port and return the token input_type_entry *entry = m_type_to_entry[type][player]; if (entry != NULL) - return string.cpy(entry->token()); + return string.cpy(entry->token()).c_str(); // if that fails, carry on - return string.format("TYPE_OTHER(%d,%d)", type, player); + return string.format("TYPE_OTHER(%d,%d)", type, player).c_str(); } diff --git a/src/emu/ioport.h b/src/emu/ioport.h index eeb8d5c7ca1..19c2424e0a8 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -969,7 +969,7 @@ public: // getters ioport_diplocation *next() const { return m_next; } - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } UINT8 number() const { return m_number; } bool inverted() const { return m_invert; } @@ -1197,7 +1197,7 @@ public: device_t &device() const { return m_device; } running_machine &machine() const; ioport_field *first_field() const { return m_fieldlist.first(); } - const char *tag() const { return m_tag; } + const char *tag() const { return m_tag.c_str(); } int modcount() const { return m_modcount; } ioport_value active() const { return m_active; } ioport_value active_safe(ioport_value defval) const { return (this == NULL) ? defval : active(); } diff --git a/src/emu/machine.c b/src/emu/machine.c index ca3c7a6c531..229a507f3ac 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -195,7 +195,7 @@ const char *running_machine::describe_context() else m_context.cpy("(no context)"); - return m_context; + return m_context.c_str(); } TIMER_CALLBACK_MEMBER(running_machine::autoboot_callback) @@ -206,8 +206,8 @@ TIMER_CALLBACK_MEMBER(running_machine::autoboot_callback) else if (strlen(options().autoboot_command())!=0) { astring cmd = astring(options().autoboot_command()); cmd.replace("'","\\'"); - astring val = astring("emu.keypost('",cmd,"')"); - manager().lua()->load_string(val); + astring val = astring("emu.keypost('", cmd.c_str(), "')").c_str(); + manager().lua()->load_string(val.c_str()); } } @@ -560,12 +560,12 @@ astring running_machine::get_statename(const char *option) // handle %d in the template (for image devices) astring statename_dev("%d_"); - int pos = statename_str.find(0, statename_dev); + int pos = statename_str.find(0, statename_dev.c_str()); if (pos != -1) { // if more %d are found, revert to default and ignore them all - if (statename_str.find(pos + 3, statename_dev) != -1) + if (statename_str.find(pos + 3, statename_dev.c_str()) != -1) statename_str.cpy("%g"); // else if there is a single %d, try to create the correct snapname else @@ -610,7 +610,7 @@ astring running_machine::get_statename(const char *option) astring filename(image->basename_noext()); // setup snapname and remove the %d_ - statename_str.replace(0, devname_str, filename); + statename_str.replace(0, devname_str.c_str(), filename.c_str()); statename_str.del(pos, 3); //printf("check image: %s\n", filename.c_str()); @@ -909,7 +909,7 @@ void running_machine::handle_saveload() } // open the file - filerr = file.open(m_saveload_pending_file); + filerr = file.open(m_saveload_pending_file.c_str()); if (filerr == FILERR_NONE) { // read/write the save state @@ -1237,7 +1237,7 @@ void running_machine::nvram_load() { astring filename; emu_file file(options().nvram_directory(), OPEN_FLAG_READ); - if (file.open(nvram_filename(filename, nvram->device())) == FILERR_NONE) + if (file.open(nvram_filename(filename, nvram->device()).c_str()) == FILERR_NONE) { nvram->nvram_load(file); file.close(); @@ -1259,7 +1259,7 @@ void running_machine::nvram_save() { astring filename; emu_file file(options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - if (file.open(nvram_filename(filename, nvram->device())) == FILERR_NONE) + if (file.open(nvram_filename(filename, nvram->device()).c_str()) == FILERR_NONE) { nvram->nvram_save(file); file.close(); diff --git a/src/emu/machine.h b/src/emu/machine.h index 30ca9a633ed..9fb264f9963 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -180,7 +180,7 @@ public: bool paused() const { return m_paused || (m_current_phase != MACHINE_PHASE_RUNNING); } bool exit_pending() const { return m_exit_pending; } bool ui_active() const { return m_ui_active; } - const char *basename() const { return m_basename; } + const char *basename() const { return m_basename.c_str(); } int sample_rate() const { return m_sample_rate; } bool save_or_load_pending() const { return m_saveload_pending_file; } screen_device *first_screen() const { return primary_screen; } diff --git a/src/emu/machine/laserdsc.c b/src/emu/machine/laserdsc.c index b6373ecb627..9966ae39964 100644 --- a/src/emu/machine/laserdsc.c +++ b/src/emu/machine/laserdsc.c @@ -762,7 +762,7 @@ void laserdisc_device::init_disc() // extract the metadata int fps, fpsfrac, interlaced, channels; - if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &m_width, &m_height, &interlaced, &channels, &m_samplerate) != 7) + if (sscanf(metadata.c_str(), AV_METADATA_FORMAT, &fps, &fpsfrac, &m_width, &m_height, &interlaced, &channels, &m_samplerate) != 7) throw emu_fatalerror("Invalid metadata in CHD file"); else m_fps_times_1million = fps * 1000000 + fpsfrac; diff --git a/src/emu/machine/wozfdc.c b/src/emu/machine/wozfdc.c index 14cb788cd4b..f43620ff427 100644 --- a/src/emu/machine/wozfdc.c +++ b/src/emu/machine/wozfdc.c @@ -64,7 +64,7 @@ appleiii_fdc::appleiii_fdc(const machine_config &mconfig, const char *tag, devic void wozfdc_device::device_start() { astring tempstring; - m_rom_p6 = machine().root_device().memregion(this->subtag(tempstring, DISKII_P6_REGION))->base(); + m_rom_p6 = machine().root_device().memregion(this->subtag(tempstring, DISKII_P6_REGION).c_str())->base(); timer = timer_alloc(0); delay_timer = timer_alloc(1); diff --git a/src/emu/memory.c b/src/emu/memory.c index 96f2fe2eb3a..da2c9c18b87 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -1840,7 +1840,7 @@ void address_space::prepare_map() { 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); + manager().m_sharelist.append(fulltag.c_str(), *share); } } @@ -1863,7 +1863,7 @@ void address_space::prepare_map() entry->m_devbase.subtag(fulltag, entry->m_region); // find the region - memory_region *region = machine().root_device().memregion(fulltag); + memory_region *region = machine().root_device().memregion(fulltag.c_str()); if (region == NULL) fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"\n", m_device.tag(), m_name, entry->m_addrstart, entry->m_addrend, entry->m_region); @@ -2293,7 +2293,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off { // find the port astring fulltag; - ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag)); + ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag).c_str()); if (port == NULL) throw emu_fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, m_name, m_device.tag()); @@ -2305,7 +2305,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off { // find the port astring fulltag; - ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag)); + ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag).c_str()); if (port == NULL) fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, m_name, m_device.tag()); @@ -2335,7 +2335,7 @@ void address_space::install_bank_generic(offs_t addrstart, offs_t addrend, offs_ { astring fulltag; device().siblingtag(fulltag, rtag); - memory_bank &bank = bank_find_or_allocate(fulltag, addrstart, addrend, addrmask, addrmirror, ROW_READ); + memory_bank &bank = bank_find_or_allocate(fulltag.c_str(), addrstart, addrend, addrmask, addrmirror, ROW_READ); read().map_range(addrstart, addrend, addrmask, addrmirror, bank.index()); } @@ -2344,7 +2344,7 @@ void address_space::install_bank_generic(offs_t addrstart, offs_t addrend, offs_ { astring fulltag; device().siblingtag(fulltag, wtag); - memory_bank &bank = bank_find_or_allocate(fulltag, addrstart, addrend, addrmask, addrmirror, ROW_WRITE); + memory_bank &bank = bank_find_or_allocate(fulltag.c_str(), addrstart, addrend, addrmask, addrmirror, ROW_WRITE); write().map_range(addrstart, addrend, addrmask, addrmirror, bank.index()); } @@ -2681,7 +2681,7 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst membank = global_alloc(memory_bank(*this, banknum, bytestart, byteend, tag)); astring temptag; if (tag == NULL) - tag = temptag.format("anon_%p", membank); + tag = temptag.format("anon_%p", membank).c_str(); manager().m_banklist.append(tag, *membank); } @@ -3874,7 +3874,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen int bytes_per_element = space.data_width() / 8; astring name; name.printf("%08x-%08x", bytestart, byteend); - space.machine().save().save_memory(NULL, "memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element); + space.machine().save().save_memory(NULL, "memory", space.device().tag(), space.spacenum(), name.c_str(), m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element); } } @@ -3921,7 +3921,7 @@ memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs } if (!m_anonymous && space.machine().save().registration_allowed()) - space.machine().save().save_item(NULL, "memory", m_tag, 0, NAME(m_curentry)); + space.machine().save().save_item(NULL, "memory", m_tag.c_str(), 0, NAME(m_curentry)); } diff --git a/src/emu/memory.h b/src/emu/memory.h index e90cc58394c..128538e0735 100644 --- a/src/emu/memory.h +++ b/src/emu/memory.h @@ -587,8 +587,8 @@ public: offs_t bytestart() const { return m_bytestart; } void *base() const { return *m_baseptr; } void *base_decrypted() const { return *m_basedptr; } - const char *tag() const { return m_tag; } - const char *name() const { return m_name; } + const char *tag() const { return m_tag.c_str(); } + const char *name() const { return m_name.c_str(); } // compare a range against our range bool matches_exactly(offs_t bytestart, offs_t byteend) const { return (m_bytestart == bytestart && m_byteend == byteend); } @@ -695,7 +695,7 @@ public: UINT8 *base() { return (this != NULL) ? &m_buffer[0] : NULL; } UINT8 *end() { return (this != NULL) ? base() + m_buffer.count() : NULL; } UINT32 bytes() const { return (this != NULL) ? m_buffer.count() : 0; } - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } // flag expansion endianness_t endianness() const { return m_endianness; } diff --git a/src/emu/output.c b/src/emu/output.c index 10bd135b4d1..842473b25cc 100644 --- a/src/emu/output.c +++ b/src/emu/output.c @@ -99,7 +99,7 @@ INLINE output_item *find_item(const char *string) /* use the hash as a starting point and find an entry */ for (item = itemtable[hash % HASH_SIZE]; item != NULL; item = item->next) - if (item->hash == hash && strcmp(string, item->name) == 0) + if (item->hash == hash && strcmp(string, item->name.c_str()) == 0) return item; return NULL; @@ -333,7 +333,7 @@ void output_notify_all(output_notifier_func callback, void *param) /* remove all items */ for (hash = 0; hash < HASH_SIZE; hash++) for (item = itemtable[hash]; item != NULL; item = item->next) - (*callback)(item->name, item->value, param); + (*callback)(item->name.c_str(), item->value, param); } @@ -367,7 +367,7 @@ const char *output_id_to_name(UINT32 id) for (hash = 0; hash < HASH_SIZE; hash++) for (item = itemtable[hash]; item != NULL; item = item->next) if (item->id == id) - return item->name; + return item->name.c_str(); /* nothing found, return NULL */ return NULL; diff --git a/src/emu/parameters.c b/src/emu/parameters.c index 8b313380064..5fb8a051223 100644 --- a/src/emu/parameters.c +++ b/src/emu/parameters.c @@ -17,10 +17,10 @@ parameters_manager::parameters_manager(running_machine &machine) astring parameters_manager::lookup(astring tag) const { - return m_parameters.find(tag); + return m_parameters.find(tag.c_str()); } void parameters_manager::add(astring tag, astring value) { - m_parameters.add(tag, value); + m_parameters.add(tag.c_str(), value); } diff --git a/src/emu/profiler.c b/src/emu/profiler.c index 6dd07a2236e..6da529325f0 100644 --- a/src/emu/profiler.c +++ b/src/emu/profiler.c @@ -130,7 +130,7 @@ const char *real_profiler_state::text(running_machine &machine) } stop(); - return m_text; + return m_text.c_str(); } diff --git a/src/emu/render.c b/src/emu/render.c index af95b896cf5..b7da5fcbb38 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -1577,7 +1577,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename) // attempt to open the file; bail if we can't emu_file layoutfile(manager().machine().options().art_path(), OPEN_FLAG_READ); - file_error filerr = layoutfile.open(fname); + file_error filerr = layoutfile.open(fname.c_str()); if (filerr != FILERR_NONE) return false; diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c index 7baf4db606a..b4070dc45ec 100644 --- a/src/emu/rendfont.c +++ b/src/emu/rendfont.c @@ -392,7 +392,7 @@ bool render_font::load_cached_bdf(const char *filename) // attempt to open the cached version of the font { emu_file cachefile(manager().machine().options().font_path(), OPEN_FLAG_READ); - filerr = cachefile.open(cachedname); + filerr = cachefile.open(cachedname.c_str()); if (filerr == FILERR_NONE) { // if we have a cached version, load it @@ -427,7 +427,7 @@ bool render_font::load_cached_bdf(const char *filename) // if we loaded okay, create a cached one if (result) - save_cached(cachedname, hash); + save_cached(cachedname.c_str(), hash); // close the file return result; diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c index fe52fa8216f..9ac68126fa3 100644 --- a/src/emu/rendlay.c +++ b/src/emu/rendlay.c @@ -910,7 +910,7 @@ void layout_element::component::draw_text(running_machine &machine, bitmap_argb3 while (1) { - width = font->string_width(bounds.height(), aspect, m_string); + width = font->string_width(bounds.height(), aspect, m_string.c_str()); if (width < bounds.width()) break; aspect *= 0.9f; @@ -941,7 +941,7 @@ void layout_element::component::draw_text(running_machine &machine, bitmap_argb3 bitmap_argb32 tempbitmap(dest.width(), dest.height()); // loop over characters - for (const char *s = m_string; *s != 0; s++) + for (const char *s = m_string.c_str(); *s != 0; s++) { // get the font bitmap rectangle chbounds; @@ -1048,7 +1048,7 @@ void layout_element::component::draw_reel(running_machine &machine, bitmap_argb3 { while (1) { - width = font->string_width(ourheight/num_shown, aspect, m_stopnames[fruit]); + width = font->string_width(ourheight / num_shown, aspect, m_stopnames[fruit].c_str()); if (width < bounds.width()) break; aspect *= 0.9f; @@ -1100,7 +1100,7 @@ void layout_element::component::draw_reel(running_machine &machine, bitmap_argb3 bitmap_argb32 tempbitmap(dest.width(), dest.height()); // loop over characters - for (const char *s = m_stopnames[fruit]; *s != 0; s++) + for (const char *s = m_stopnames[fruit].c_str(); *s != 0; s++) { // get the font bitmap rectangle chbounds; @@ -1198,7 +1198,7 @@ void layout_element::component::draw_beltreel(running_machine &machine, bitmap_a { while (1) { - width = font->string_width(dest.height(), aspect, m_stopnames[fruit]); + width = font->string_width(dest.height(), aspect, m_stopnames[fruit].c_str()); if (width < bounds.width()) break; aspect *= 0.9f; @@ -1250,7 +1250,7 @@ void layout_element::component::draw_beltreel(running_machine &machine, bitmap_a bitmap_argb32 tempbitmap(dest.width(), dest.height()); // loop over characters - for (const char *s = m_stopnames[fruit]; *s != 0; s++) + for (const char *s = m_stopnames[fruit].c_str(); *s != 0; s++) { // get the font bitmap rectangle chbounds; @@ -1310,11 +1310,11 @@ void layout_element::component::load_bitmap() { // load the basic bitmap assert(m_file[0] != NULL); - m_hasalpha[0] = render_load_png(m_bitmap[0], *m_file[0], m_dirname, m_imagefile[0]); + m_hasalpha[0] = render_load_png(m_bitmap[0], *m_file[0], m_dirname.c_str(), m_imagefile[0].c_str()); // load the alpha bitmap if specified if (m_bitmap[0].valid() && m_alphafile[0]) - render_load_png(m_bitmap[0], *m_file[0], m_dirname, m_alphafile[0], true); + render_load_png(m_bitmap[0], *m_file[0], m_dirname.c_str(), m_alphafile[0].c_str(), true); // if we can't load the bitmap, allocate a dummy one and report an error if (!m_bitmap[0].valid()) @@ -1339,7 +1339,7 @@ void layout_element::component::load_reel_bitmap(int number) { // load the basic bitmap assert(m_file != NULL); - /*m_hasalpha[number] = */ render_load_png(m_bitmap[number], *m_file[number], m_dirname, m_imagefile[number]); + /*m_hasalpha[number] = */ render_load_png(m_bitmap[number], *m_file[number], m_dirname.c_str(), m_imagefile[number].c_str()); // load the alpha bitmap if specified //if (m_bitmap[number].valid() && m_alphafile[number]) @@ -2346,7 +2346,7 @@ layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simpl } m_input_mask = xml_get_attribute_int_with_subst(machine, itemnode, "inputmask", 0); if (m_output_name[0] != 0 && m_element != NULL) - output_set_value(m_output_name, m_element->default_state()); + output_set_value(m_output_name.c_str(), m_element->default_state()); parse_bounds(machine, xml_get_sibling(itemnode.child, "bounds"), m_rawbounds); parse_color(machine, xml_get_sibling(itemnode.child, "color"), m_color); parse_orientation(machine, xml_get_sibling(itemnode.child, "orientation"), m_orientation); @@ -2396,12 +2396,12 @@ int layout_view::item::state() const // if configured to an output, fetch the output value if (m_output_name[0] != 0) - state = output_get_value(m_output_name); + state = output_get_value(m_output_name.c_str()); // if configured to an input, fetch the input value else if (m_input_tag[0] != 0) { - ioport_port *port = m_element->machine().root_device().ioport(m_input_tag); + ioport_port *port = m_element->machine().root_device().ioport(m_input_tag.c_str()); if (port != NULL) { ioport_field *field = port->field(m_input_mask); diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h index af2eff64e59..91cd7a00dc0 100644 --- a/src/emu/rendlay.h +++ b/src/emu/rendlay.h @@ -52,7 +52,7 @@ public: // getters layout_element *next() const { return m_next; } - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } running_machine &machine() const { return m_machine; } int default_state() const { return m_defstate; } int maxstate() const { return m_maxstate; } @@ -208,7 +208,7 @@ public: int orientation() const { return m_orientation; } render_container *screen_container(running_machine &machine) const; bool has_input() const { return bool(m_input_tag); } - const char *input_tag_and_mask(ioport_value &mask) const { mask = m_input_mask; return m_input_tag; } + const char *input_tag_and_mask(ioport_value &mask) const { mask = m_input_mask; return m_input_tag.c_str(); } // fetch state based on configured source int state() const; @@ -234,7 +234,7 @@ public: // getters layout_view *next() const { return m_next; } item *first_item(item_layer layer) const; - const char *name() const { return m_name; } + const char *name() const { return m_name.c_str(); } const render_screen_list &screens() const { return m_screens; } bool layer_enabled(item_layer layer) const { return m_layenabled[layer]; } diff --git a/src/emu/rendutil.c b/src/emu/rendutil.c index 34b783ee90e..59f4fb4b55d 100644 --- a/src/emu/rendutil.c +++ b/src/emu/rendutil.c @@ -542,7 +542,7 @@ bool render_load_png(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, fname.cpy(filename); else fname.cpy(dirname).cat(PATH_SEPARATOR).cat(filename); - file_error filerr = file.open(fname); + file_error filerr = file.open(fname.c_str()); if (filerr != FILERR_NONE) return false; diff --git a/src/emu/romload.c b/src/emu/romload.c index d18896734ba..4ccc05da1fb 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -44,7 +44,7 @@ public: m_region(region) { } open_chd *next() const { return m_next; } - const char *region() const { return m_region; } + const char *region() const { return m_region.c_str(); } chd_file &chd() { return m_diffchd.opened() ? m_diffchd : m_origchd; } chd_file &orig_chd() { return m_origchd; } chd_file &diff_chd() { return m_diffchd; } @@ -1125,7 +1125,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ image_file.close(); /* try to open the CHD */ - err = image_chd.open(fullpath); + err = image_chd.open(fullpath.c_str()); if (err == CHDERR_NONE) return err; } @@ -1163,7 +1163,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ image_file.close(); /* try to open the CHD */ - err = image_chd.open(fullpath); + err = image_chd.open(fullpath.c_str()); if (err == CHDERR_NONE) return err; } @@ -1184,20 +1184,20 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd /* try to open the diff */ 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); + file_error filerr = diff_file.open(fname.c_str()); if (filerr == FILERR_NONE) { astring fullpath(diff_file.fullpath()); diff_file.close(); LOG(("Opening differencing image file: %s\n", fullpath.c_str())); - return diff_chd.open(fullpath, true, &source); + return diff_chd.open(fullpath.c_str(), true, &source); } /* didn't work; try creating it instead */ 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); + filerr = diff_file.open(fname.c_str()); if (filerr == FILERR_NONE) { astring fullpath(diff_file.fullpath()); @@ -1206,7 +1206,7 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd /* create the CHD */ 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); + chd_error err = diff_chd.create(fullpath.c_str(), source.logical_bytes(), source.hunk_bytes(), compression, source); if (err != CHDERR_NONE) return err; @@ -1393,18 +1393,18 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c /* if this is a device region, override with the device width and endianness */ endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE; UINT8 width = ROMREGION_GETWIDTH(region) / 8; - memory_region *memregion = romdata->machine().root_device().memregion(regiontag); + memory_region *memregion = romdata->machine().root_device().memregion(regiontag.c_str()); if (memregion != NULL) { - if (romdata->machine().device(regiontag) != NULL) - normalize_flags_for_device(romdata->machine(), regiontag, width, endianness); + if (romdata->machine().device(regiontag.c_str()) != NULL) + normalize_flags_for_device(romdata->machine(), regiontag.c_str(), width, endianness); /* clear old region (todo: should be moved to an image unload function) */ romdata->machine().memory().region_free(memregion->name()); } /* remember the base and length */ - romdata->region = romdata->machine().memory().region_alloc(regiontag, regionlength, width, endianness); + romdata->region = romdata->machine().memory().region_alloc(regiontag.c_str(), regionlength, width, endianness); LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base())); /* clear the region if it's requested */ @@ -1430,9 +1430,9 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c /* now process the entries in the region */ if (ROMREGION_ISROMDATA(region)) - process_rom_entries(romdata, locationtag, region, region + 1, &device, TRUE); + process_rom_entries(romdata, locationtag.c_str(), region, region + 1, &device, TRUE); else if (ROMREGION_ISDISKDATA(region)) - process_disk_entries(romdata, regiontag, region, region + 1, locationtag); + process_disk_entries(romdata, regiontag.c_str(), region, region + 1, locationtag.c_str()); } /* now go back and post-process all the regions */ @@ -1473,11 +1473,11 @@ static void process_region_list(romload_private *romdata) /* if this is a device region, override with the device width and endianness */ UINT8 width = ROMREGION_GETWIDTH(region) / 8; endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE; - if (romdata->machine().device(regiontag) != NULL) - normalize_flags_for_device(romdata->machine(), regiontag, width, endianness); + if (romdata->machine().device(regiontag.c_str()) != NULL) + normalize_flags_for_device(romdata->machine(), regiontag.c_str(), width, endianness); /* remember the base and length */ - romdata->region = romdata->machine().memory().region_alloc(regiontag, regionlength, width, endianness); + romdata->region = romdata->machine().memory().region_alloc(regiontag.c_str(), regionlength, width, endianness); LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base())); /* clear the region if it's requested */ @@ -1498,7 +1498,7 @@ static void process_region_list(romload_private *romdata) process_rom_entries(romdata, device->shortname(), region, region + 1, device, FALSE); } else if (ROMREGION_ISDISKDATA(region)) - process_disk_entries(romdata, regiontag, region, region + 1, NULL); + process_disk_entries(romdata, regiontag.c_str(), region, region + 1, NULL); } /* now go back and post-process all the regions */ @@ -1506,7 +1506,7 @@ static void process_region_list(romload_private *romdata) for (const rom_entry *region = rom_first_region(*device); region != NULL; region = rom_next_region(region)) { rom_region_name(regiontag, *device, region); - region_post_process(romdata, regiontag, ROMREGION_ISINVERTED(region)); + region_post_process(romdata, regiontag.c_str(), ROMREGION_ISINVERTED(region)); } /* and finally register all per-game parameters */ diff --git a/src/emu/save.c b/src/emu/save.c index 6344027d8e9..c4a93a0cefd 100644 --- a/src/emu/save.c +++ b/src/emu/save.c @@ -96,7 +96,7 @@ const char *save_manager::indexed_item(int index, void *&base, UINT32 &valsize, valsize = entry->m_typesize; valcount = entry->m_typecount; - return entry->m_name; + return entry->m_name.c_str(); } @@ -183,7 +183,7 @@ void save_manager::save_memory(device_t *device, const char *module, const char } // insert us into the list - m_entry_list.insert_after(*global_alloc(state_entry(val, totalname, device, module, tag ? tag : "", index, valsize, valcount)), insert_after); + m_entry_list.insert_after(*global_alloc(state_entry(val, totalname.c_str(), device, module, tag ? tag : "", index, valsize, valcount)), insert_after); } diff --git a/src/emu/save.h b/src/emu/save.h index ad352d6121d..a4d6e041e08 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -268,9 +268,9 @@ template<> inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, attotime &value, const char *name) { astring tempstr(name, ".attoseconds"); - save_memory(device, module, tag, index, tempstr, &value.attoseconds, sizeof(value.attoseconds)); + save_memory(device, module, tag, index, tempstr.c_str(), &value.attoseconds, sizeof(value.attoseconds)); tempstr.cpy(name).cat(".seconds"); - save_memory(device, module, tag, index, tempstr, &value.seconds, sizeof(value.seconds)); + save_memory(device, module, tag, index, tempstr.c_str(), &value.seconds, sizeof(value.seconds)); } diff --git a/src/emu/schedule.c b/src/emu/schedule.c index 445d9c9c408..d777f1d1b41 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -260,11 +260,11 @@ void emu_timer::register_save() } // save the bits - machine().save().save_item(m_device, "timer", name, index, NAME(m_param)); - machine().save().save_item(m_device, "timer", name, index, NAME(m_enabled)); - machine().save().save_item(m_device, "timer", name, index, NAME(m_period)); - machine().save().save_item(m_device, "timer", name, index, NAME(m_start)); - machine().save().save_item(m_device, "timer", name, index, NAME(m_expire)); + machine().save().save_item(m_device, "timer", name.c_str(), index, NAME(m_param)); + machine().save().save_item(m_device, "timer", name.c_str(), index, NAME(m_enabled)); + machine().save().save_item(m_device, "timer", name.c_str(), index, NAME(m_period)); + machine().save().save_item(m_device, "timer", name.c_str(), index, NAME(m_start)); + machine().save().save_item(m_device, "timer", name.c_str(), index, NAME(m_expire)); } @@ -755,7 +755,7 @@ void device_scheduler::rebuild_execute_list() // if the configuration specifies a device to make perfect, pick that as the minimum if (machine().config().m_perfect_cpu_quantum) { - device_t *device = machine().device(machine().config().m_perfect_cpu_quantum); + device_t *device = machine().device(machine().config().m_perfect_cpu_quantum.c_str()); if (device == NULL) fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.c_str()); diff --git a/src/emu/screen.c b/src/emu/screen.c index 44fee2e560c..9648eef6069 100644 --- a/src/emu/screen.c +++ b/src/emu/screen.c @@ -1054,7 +1054,7 @@ void screen_device::load_effect_overlay(const char *filename) // load the file emu_file file(machine().options().art_path(), OPEN_FLAG_READ); - render_load_png(m_screen_overlay_bitmap, file, NULL, fullname); + render_load_png(m_screen_overlay_bitmap, file, NULL, fullname.c_str()); if (m_screen_overlay_bitmap.valid()) m_container->set_overlay(&m_screen_overlay_bitmap); else diff --git a/src/emu/softlist.c b/src/emu/softlist.c index 755650d794f..fd70d3dd12d 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -156,7 +156,7 @@ bool software_part::is_compatible(const software_list_device &swlistdev) const for (int start = 0, end = filt.chr(start, ','); end != -1; start = end + 1, end = filt.chr(start, ',')) { astring token(filt, start, end - start + 1); - if (comp.find(0, token) != -1) + if (comp.find(0, token.c_str()) != -1) return true; } return false; @@ -179,7 +179,7 @@ bool software_part::matches_interface(const char *interface_list) const // then add a comma to the end of our interface and return true if we find it in the list string astring our_interface(m_interface, ","); - return (interfaces.find(0, our_interface) != -1); + return (interfaces.find(0, our_interface.c_str()) != -1); } @@ -476,7 +476,7 @@ void software_list_device::parse() m_errors.reset(); // attempt to open the file - file_error filerr = m_file.open(m_list_name, ".xml"); + file_error filerr = m_file.open(m_list_name.c_str(), ".xml"); if (filerr == FILERR_NONE) { // parse if no error @@ -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.c_str()))) + if (valid.already_checked(astring("softlist/", m_list_name.c_str()).c_str())) return; // do device validation only in case of validate command @@ -1172,7 +1172,7 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu else if (loadflag != NULL && strcmp(loadflag, "load32_byte") == 0) romflags = ROM_SKIP(3); - add_rom_entry(name, hashdata, offset, length, ROMENTRYTYPE_ROM | romflags); + add_rom_entry(name, hashdata.c_str(), offset, length, ROMENTRYTYPE_ROM | romflags); } else parse_error("Rom name missing"); @@ -1200,7 +1200,7 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu astring hashdata; hashdata.printf( "%c%s%s", hash_collection::HASH_SHA1, sha1, (nodump ? NO_DUMP : (baddump ? BAD_DUMP : ""))); - add_rom_entry(name, hashdata, 0, 0, ROMENTRYTYPE_ROM | (writeable ? DISK_READWRITE : DISK_READONLY)); + add_rom_entry(name, hashdata.c_str(), 0, 0, ROMENTRYTYPE_ROM | (writeable ? DISK_READWRITE : DISK_READONLY)); } else if (status == NULL || !strcmp(status, "nodump")) // a no_dump chd is not an incomplete entry parse_error("Incomplete disk definition"); @@ -1225,15 +1225,15 @@ void softlist_parser::parse_soft_end(const char *tagname) // <description> if (strcmp(tagname, "description") == 0) - m_current_info->m_longname = m_list.add_string(m_data_accum); + m_current_info->m_longname = m_list.add_string(m_data_accum.c_str()); // <year> else if (strcmp(tagname, "year") == 0) - m_current_info->m_year = m_list.add_string(m_data_accum); + m_current_info->m_year = m_list.add_string(m_data_accum.c_str()); // <publisher> else if (strcmp(tagname, "publisher") == 0) - m_current_info->m_publisher = m_list.add_string(m_data_accum); + m_current_info->m_publisher = m_list.add_string(m_data_accum.c_str()); // </part> else if (strcmp(tagname, "part") == 0) diff --git a/src/emu/softlist.h b/src/emu/softlist.h index 0a659baf502..ee800b4f4c8 100644 --- a/src/emu/softlist.h +++ b/src/emu/softlist.h @@ -193,7 +193,7 @@ public: static void static_set_filter(device_t &device, const char *filter); // getters - const char *list_name() const { return m_list_name; } + const char *list_name() const { return m_list_name.c_str(); } softlist_type list_type() const { return m_list_type; } const char *filter() const { return m_filter; } const char *filename() { return m_file.filename(); } @@ -201,7 +201,7 @@ public: // getters that may trigger a parse const char *description() { if (!m_parsed) parse(); return m_description; } bool valid() { if (!m_parsed) parse(); return m_infolist.count() > 0; } - const char *errors_string() { if (!m_parsed) parse(); return m_errors; } + const char *errors_string() { if (!m_parsed) parse(); return m_errors.c_str(); } // operations software_info *find(const char *look_for, software_info *prev = NULL); diff --git a/src/emu/sound.c b/src/emu/sound.c index 3bd8236beee..793d19448db 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -77,19 +77,19 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample // create a unique tag for saving astring state_tag; state_tag.printf("%d", m_device.machine().sound().m_stream_list.count()); - m_device.machine().save().save_item(&m_device, "stream", state_tag, 0, NAME(m_sample_rate)); + m_device.machine().save().save_item(&m_device, "stream", state_tag.c_str(), 0, NAME(m_sample_rate)); m_device.machine().save().register_postload(save_prepost_delegate(FUNC(sound_stream::postload), this)); // save the gain of each input and output for (int inputnum = 0; inputnum < m_input.count(); inputnum++) { - m_device.machine().save().save_item(&m_device, "stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain)); - m_device.machine().save().save_item(&m_device, "stream", state_tag, inputnum, NAME(m_input[inputnum].m_user_gain)); + m_device.machine().save().save_item(&m_device, "stream", state_tag.c_str(), inputnum, NAME(m_input[inputnum].m_gain)); + m_device.machine().save().save_item(&m_device, "stream", state_tag.c_str(), inputnum, NAME(m_input[inputnum].m_user_gain)); } for (int outputnum = 0; outputnum < m_output.count(); outputnum++) { m_output[outputnum].m_stream = this; - m_device.machine().save().save_item(&m_device, "stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain)); + m_device.machine().save().save_item(&m_device, "stream", state_tag.c_str(), outputnum, NAME(m_output[outputnum].m_gain)); } // Mark synchronous streams as such @@ -191,7 +191,7 @@ const char *sound_stream::input_name(int inputnum, astring &string) const } } } - return string; + return string.c_str(); } diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c index ea5c06559f6..7bd00040d38 100644 --- a/src/emu/sound/2610intf.c +++ b/src/emu/sound/2610intf.c @@ -157,8 +157,8 @@ void ym2610_device::device_start() pcmbufa = region()->base(); pcmsizea = region()->bytes(); name.printf("%s.deltat", tag()); - pcmbufb = (void *)(machine().root_device().memregion(name)->base()); - pcmsizeb = machine().root_device().memregion(name)->bytes(); + pcmbufb = (void *)(machine().root_device().memregion(name.c_str())->base()); + pcmsizeb = machine().root_device().memregion(name.c_str())->bytes(); if (pcmbufb == NULL || pcmsizeb == 0) { pcmbufb = pcmbufa; diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c index 1d42602b922..a7a66c91e46 100644 --- a/src/emu/sound/fm.c +++ b/src/emu/sound/fm.c @@ -3678,17 +3678,17 @@ void ym2610_reset_chip(void *chip) /* setup PCM buffers again */ name.printf("%s",dev->tag()); - F2610->pcmbuf = (const UINT8 *)dev->machine().root_device().memregion(name)->base(); - F2610->pcm_size = dev->machine().root_device().memregion(name)->bytes(); + F2610->pcmbuf = (const UINT8 *)dev->machine().root_device().memregion(name.c_str())->base(); + F2610->pcm_size = dev->machine().root_device().memregion(name.c_str())->bytes(); name.printf("%s.deltat",dev->tag()); - F2610->deltaT.memory = (UINT8 *)dev->machine().root_device().memregion(name)->base(); + F2610->deltaT.memory = (UINT8 *)dev->machine().root_device().memregion(name.c_str())->base(); if(F2610->deltaT.memory == NULL) { F2610->deltaT.memory = (UINT8*)F2610->pcmbuf; F2610->deltaT.memory_size = F2610->pcm_size; } else - F2610->deltaT.memory_size = dev->machine().root_device().memregion(name)->bytes(); + F2610->deltaT.memory_size = dev->machine().root_device().memregion(name.c_str())->bytes(); /* Reset Prescaler */ OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */ diff --git a/src/emu/ui/barcode.c b/src/emu/ui/barcode.c index 4cba5554499..ee556b305f2 100644 --- a/src/emu/ui/barcode.c +++ b/src/emu/ui/barcode.c @@ -56,13 +56,13 @@ void ui_menu_barcode_reader::populate() const char *new_barcode; // selected device - item_append(current_display_name(), "", current_display_flags(), ITEMREF_SELECT_READER); + item_append(current_display_name().c_str(), "", current_display_flags(), ITEMREF_SELECT_READER); // append the "New Barcode" item if (get_selection() == ITEMREF_NEW_BARCODE) { buffer.cat(m_barcode_buffer); - new_barcode = buffer; + new_barcode = buffer.c_str(); } else { diff --git a/src/emu/ui/cheatopt.c b/src/emu/ui/cheatopt.c index 7737e2dca4e..b14ae03a963 100644 --- a/src/emu/ui/cheatopt.c +++ b/src/emu/ui/cheatopt.c @@ -115,7 +115,7 @@ void ui_menu_cheat::populate() { UINT32 flags; curcheat->menu_text(text, subtext, flags); - item_append(text, subtext, flags, curcheat); + item_append(text.c_str(), subtext.c_str(), flags, curcheat); } /* add a separator */ diff --git a/src/emu/ui/devopt.c b/src/emu/ui/devopt.c index 775e7f64410..3f574673962 100644 --- a/src/emu/ui/devopt.c +++ b/src/emu/ui/devopt.c @@ -279,7 +279,7 @@ void ui_menu_device_config::populate() string.cat("[None]\n"); const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name()); - item_append(string, NULL, MENU_FLAG_MULTILINE, NULL); + item_append(string.c_str(), NULL, MENU_FLAG_MULTILINE, NULL); } void ui_menu_device_config::handle() diff --git a/src/emu/ui/filemngr.c b/src/emu/ui/filemngr.c index 9b4cc42c4f4..38e4a55a9c7 100644 --- a/src/emu/ui/filemngr.c +++ b/src/emu/ui/filemngr.c @@ -106,7 +106,7 @@ void ui_menu_file_manager::populate() if (m_warnings) { - item_append(m_warnings, NULL, MENU_FLAG_DISABLE, NULL); + item_append(m_warnings.c_str(), NULL, MENU_FLAG_DISABLE, NULL); item_append("", NULL, MENU_FLAG_DISABLE, NULL); } @@ -139,12 +139,12 @@ void ui_menu_file_manager::populate() else item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); buffer.printf("[root%s]", dev->tag()); - item_append(buffer, NULL, 0, NULL); + item_append(buffer.c_str(), NULL, 0, NULL); tag_appended = true; } // finally, append the image interface to the menu fill_image_line(scan, tmp_inst, tmp_name); - item_append(tmp_inst, tmp_name, 0, (void *) scan); + item_append(tmp_inst.c_str(), tmp_name.c_str(), 0, (void *)scan); } } } diff --git a/src/emu/ui/filesel.c b/src/emu/ui/filesel.c index 1ac5efe0d2a..6828e29ae35 100644 --- a/src/emu/ui/filesel.c +++ b/src/emu/ui/filesel.c @@ -246,7 +246,7 @@ ui_menu_file_create::~ui_menu_file_create() void ui_menu_file_create::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { extra_text_render(container, top, bottom, origx1, origy1, origx2, origy2, - m_current_directory, + m_current_directory.c_str(), NULL); } @@ -265,7 +265,7 @@ void ui_menu_file_create::populate() if (get_selection() == ITEMREF_NEW_IMAGE_NAME) { buffer.cat(m_filename_buffer).cat("_"); - new_image_name = buffer; + new_image_name = buffer.c_str(); } else { @@ -374,7 +374,7 @@ void ui_menu_file_selector::custom_render(void *selectedref, float top, float bo { extra_text_render(container, top, bottom, origx1, origy1, origx2, origy2, - m_current_directory, + m_current_directory.c_str(), NULL); } @@ -476,13 +476,13 @@ ui_menu_file_selector::file_selector_entry *ui_menu_file_selector::append_dirent } // determine the full path - zippath_combine(buffer, m_current_directory, dirent->name); + zippath_combine(buffer, m_current_directory.c_str(), dirent->name); // create the file selector entry entry = append_entry( entry_type, dirent->name, - buffer); + buffer.c_str()); return entry; } @@ -544,7 +544,7 @@ void ui_menu_file_selector::populate() const file_selector_entry *selected_entry = NULL; int i; const char *volume_name; - const char *path = m_current_directory; + const char *path = m_current_directory.c_str(); // open the directory err = zippath_opendir(path, &directory); @@ -594,7 +594,7 @@ void ui_menu_file_selector::populate() selected_entry = entry; // do we have to select this file? - if (!core_stricmp(m_current_file, dirent->name)) + if (!core_stricmp(m_current_file.c_str(), dirent->name)) selected_entry = entry; } } diff --git a/src/emu/ui/imgcntrl.c b/src/emu/ui/imgcntrl.c index 21d14b9a59a..fa3ebff3136 100644 --- a/src/emu/ui/imgcntrl.c +++ b/src/emu/ui/imgcntrl.c @@ -56,12 +56,12 @@ ui_menu_control_device_image::ui_menu_control_device_image(running_machine &mach if (image->exists()) { current_file.cpy(image->filename()); - zippath_parent(current_directory, current_file); + zippath_parent(current_directory, current_file.c_str()); } else current_directory.cpy(image->working_directory()); /* check to see if the path exists; if not clear it */ - if (zippath_opendir(current_directory, NULL) != FILERR_NONE) + if (zippath_opendir(current_directory.c_str(), NULL) != FILERR_NONE) current_directory.reset(); } } @@ -87,10 +87,10 @@ void ui_menu_control_device_image::test_create(bool &can_create, bool &need_conf osd_dir_entry_type file_type; /* assemble the full path */ - zippath_combine(path, current_directory, current_file); + zippath_combine(path, current_directory.c_str(), current_file.c_str()); /* does a file or a directory exist at the path */ - entry = osd_stat(path); + entry = osd_stat(path.c_str()); file_type = (entry != NULL) ? entry->type : ENTTYPE_NONE; switch(file_type) @@ -155,7 +155,7 @@ void ui_menu_control_device_image::load_software_part() void ui_menu_control_device_image::hook_load(astring name, bool softlist) { if (image->is_reset_on_load()) image->set_init_phase(); - image->load(name); + image->load(name.c_str()); ui_menu::stack_pop(machine()); } @@ -180,7 +180,7 @@ void ui_menu_control_device_image::handle() bool can_create = false; if(image->is_creatable()) { zippath_directory *directory = NULL; - file_error err = zippath_opendir(current_directory, &directory); + file_error err = zippath_opendir(current_directory.c_str(), &directory); can_create = err == FILERR_NONE && !zippath_is_zip(directory); if(directory) zippath_closedir(directory); @@ -215,7 +215,7 @@ void ui_menu_control_device_image::handle() break; case SELECT_PARTLIST: - swi = sld->find(software_info_name); + swi = sld->find(software_info_name.c_str()); if (!swi) state = START_SOFTLIST; else if(swi->has_multiple_parts(image->image_interface())) @@ -331,8 +331,8 @@ void ui_menu_control_device_image::handle() case DO_CREATE: { astring path; - zippath_combine(path, current_directory, current_file); - int err = image->create(path, 0, NULL); + zippath_combine(path, current_directory.c_str(), current_file.c_str()); + int err = image->create(path.c_str(), 0, NULL); if (err != 0) popmessage("Error: %s", image->error()); ui_menu::stack_pop(machine()); diff --git a/src/emu/ui/info.c b/src/emu/ui/info.c index ba4fa24977a..9efe3bded81 100644 --- a/src/emu/ui/info.c +++ b/src/emu/ui/info.c @@ -30,7 +30,7 @@ ui_menu_game_info::~ui_menu_game_info() void ui_menu_game_info::populate() { astring tempstring; - item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL); + item_append(machine().ui().game_info_astring(tempstring).c_str(), NULL, MENU_FLAG_MULTILINE, NULL); } void ui_menu_game_info::handle() @@ -92,7 +92,7 @@ void ui_menu_image_info::image_info(device_image_interface *image) // display manufacturer and year string.catprintf("%s, %s", image->manufacturer(), image->year()); - item_append(string, "", MENU_FLAG_DISABLE, NULL); + item_append(string.c_str(), "", MENU_FLAG_DISABLE, NULL); // display supported information, if available switch (image->supported()) diff --git a/src/emu/ui/inputmap.c b/src/emu/ui/inputmap.c index b4f9cf06aeb..06f1fa748d0 100644 --- a/src/emu/ui/inputmap.c +++ b/src/emu/ui/inputmap.c @@ -421,7 +421,7 @@ void ui_menu_input::populate_and_sort(input_item_data *itemlist) else item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); text.printf("[root%s]", item->owner_name); - item_append(text, NULL, 0, NULL); + item_append(text.c_str(), NULL, 0, NULL); prev_owner.cpy(item->owner_name); } @@ -442,7 +442,7 @@ void ui_menu_input::populate_and_sort(input_item_data *itemlist) } /* add the item */ - item_append(text, subtext, flags, item); + item_append(text.c_str(), subtext.c_str(), flags, item); } } @@ -575,13 +575,13 @@ void ui_menu_settings::populate() else item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); name.printf("[root%s]", field->device().tag()); - item_append(name, NULL, 0, NULL); + item_append(name.c_str(), NULL, 0, NULL); prev_owner.cpy(field->device().tag()); } name.cpy(field->name()); - item_append(name, field->setting_name(), flags, (void *)field); + item_append(name.c_str(), field->setting_name(), flags, (void *)field); /* for DIP switches, build up the model */ if (type == IPT_DIPSWITCH && field->first_diplocation() != NULL) @@ -879,7 +879,7 @@ void ui_menu_analog::populate() else item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); name.printf("[root%s]", field->device().tag()); - item_append(name, NULL, 0, NULL); + item_append(name.c_str(), NULL, 0, NULL); prev_owner.cpy(field->device().tag()); } @@ -938,7 +938,7 @@ void ui_menu_analog::populate() flags |= MENU_FLAG_RIGHT_ARROW; /* append a menu item */ - item_append(text, subtext, flags, data); + item_append(text.c_str(), subtext.c_str(), flags, data); } } } diff --git a/src/emu/ui/miscmenu.c b/src/emu/ui/miscmenu.c index 75f801d394b..a3f55b31cd7 100644 --- a/src/emu/ui/miscmenu.c +++ b/src/emu/ui/miscmenu.c @@ -267,7 +267,7 @@ void ui_menu_bookkeeping::populate() } /* append the single item */ - item_append(tempstring, NULL, MENU_FLAG_MULTILINE, NULL); + item_append(tempstring.c_str(), NULL, MENU_FLAG_MULTILINE, NULL); } /*------------------------------------------------- diff --git a/src/emu/ui/selgame.c b/src/emu/ui/selgame.c index e7163c5d0e8..8a78d8a5c4f 100644 --- a/src/emu/ui/selgame.c +++ b/src/emu/ui/selgame.c @@ -239,7 +239,7 @@ void ui_menu_select_game::populate() emulator_info::get_gamesnoun(), emulator_info::get_configname(), emulator_info::get_appname(),emulator_info::get_appname() ); - item_append(txt, NULL, MENU_FLAG_MULTILINE | MENU_FLAG_REDTEXT, NULL); + item_append(txt.c_str(), NULL, MENU_FLAG_MULTILINE | MENU_FLAG_REDTEXT, NULL); return; } @@ -293,7 +293,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott tempbuf[0].printf("Type name or select: (random)"); // get the size of the text - machine().ui().draw_text_full(container, tempbuf[0], 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, + machine().ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, NULL); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(width, origx2 - origx1); @@ -314,7 +314,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott y2 -= UI_BOX_TB_BORDER; // draw the text within it - machine().ui().draw_text_full(container, tempbuf[0], x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, + machine().ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL); // determine the text to render below @@ -384,7 +384,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott maxwidth = origx2 - origx1; for (line = 0; line < 4; line++) { - machine().ui().draw_text_full(container, tempbuf[line], 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, + machine().ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, NULL); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -415,7 +415,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott // draw all lines for (line = 0; line < 4; line++) { - machine().ui().draw_text_full(container, tempbuf[line], x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, + machine().ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL); y1 += machine().ui().get_line_height(); } diff --git a/src/emu/ui/sliders.c b/src/emu/ui/sliders.c index 5f3e6c9a717..73b077e7c08 100644 --- a/src/emu/ui/sliders.c +++ b/src/emu/ui/sliders.c @@ -141,7 +141,7 @@ void ui_menu_sliders::populate() flags |= MENU_FLAG_LEFT_ARROW; if (curval < curslider->maxval) flags |= MENU_FLAG_RIGHT_ARROW; - item_append(curslider->description, tempstring, flags, (void *)curslider); + item_append(curslider->description, tempstring.c_str(), flags, (void *)curslider); if (menuless_mode) break; @@ -156,7 +156,7 @@ void ui_menu_sliders::populate() flags |= MENU_FLAG_LEFT_ARROW; if (curval < curslider->maxval) flags |= MENU_FLAG_RIGHT_ARROW; - item_append(curslider->description, tempstring, flags, (void *)curslider); + item_append(curslider->description, tempstring.c_str(), flags, (void *)curslider); } custombottom = 2.0f * machine().ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER; @@ -200,7 +200,7 @@ void ui_menu_sliders::custom_render(void *selectedref, float top, float bottom, y1 += UI_BOX_TB_BORDER; /* determine the text height */ - machine().ui().draw_text_full(container, tempstring, 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, + machine().ui().draw_text_full(container, tempstring.c_str(), 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height); /* draw the thermometer */ @@ -227,7 +227,7 @@ void ui_menu_sliders::custom_render(void *selectedref, float top, float bottom, container->add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); /* draw the actual text */ - machine().ui().draw_text_full(container, tempstring, x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, + machine().ui().draw_text_full(container, tempstring.c_str(), x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, &text_height); } } diff --git a/src/emu/ui/slotopt.c b/src/emu/ui/slotopt.c index 04e9b1fafa4..ff1d7a54482 100644 --- a/src/emu/ui/slotopt.c +++ b/src/emu/ui/slotopt.c @@ -166,7 +166,7 @@ void ui_menu_slot_devices::populate() opt_name.cat(" [internal]"); } - item_append(slot->device().tag() + 1, opt_name, (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot); + item_append(slot->device().tag() + 1, opt_name.c_str(), (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot); } item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); item_append("Reset", NULL, 0, (void *)1); diff --git a/src/emu/ui/tapectrl.c b/src/emu/ui/tapectrl.c index 2b27278da26..2de59a87767 100644 --- a/src/emu/ui/tapectrl.c +++ b/src/emu/ui/tapectrl.c @@ -58,7 +58,7 @@ void ui_menu_tape_control::populate() if (current_device()) { // name of tape - item_append(current_display_name(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT); + item_append(current_display_name().c_str(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT); if (current_device()->exists()) { @@ -86,7 +86,7 @@ void ui_menu_tape_control::populate() ? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "playing" : "(playing)") : ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "recording" : "(recording)") ), - timepos, + timepos.c_str(), tapeflags, TAPECMD_SLIDER); diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c index 80a61aeb02b..3c6ebf0ee13 100644 --- a/src/emu/ui/ui.c +++ b/src/emu/ui/ui.c @@ -442,7 +442,7 @@ void ui_manager::update_and_render(render_container *container) // display any popup messages if (osd_ticks() < m_popup_text_end) - draw_text_box(container, messagebox_text, JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor); + draw_text_box(container, messagebox_text.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor); else m_popup_text_end = 0; @@ -1253,7 +1253,7 @@ astring &ui_manager::game_info_astring(astring &string) UINT32 ui_manager::handler_messagebox(running_machine &machine, render_container *container, UINT32 state) { - machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); + machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); return 0; } @@ -1266,7 +1266,7 @@ UINT32 ui_manager::handler_messagebox(running_machine &machine, render_container UINT32 ui_manager::handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state) { // draw a standard message window - machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); + machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); // an 'O' or left joystick kicks us to the next state if (state == 0 && (machine.input().code_pressed_once(KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT))) @@ -1296,7 +1296,7 @@ UINT32 ui_manager::handler_messagebox_ok(running_machine &machine, render_contai UINT32 ui_manager::handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state) { // draw a standard message window - machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); + machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); // if the user cancels, exit out completely if (ui_input_pressed(machine, IPT_UI_CANCEL)) @@ -1469,7 +1469,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co if (machine.ui().show_fps_counter()) { astring tempstring; - machine.ui().draw_text_full(container, machine.video().speed_text(tempstring), 0.0f, 0.0f, 1.0f, + machine.ui().draw_text_full(container, machine.video().speed_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL); } @@ -1764,7 +1764,7 @@ UINT32 ui_manager::handler_confirm_quit(running_machine &machine, render_contain 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.ui().draw_text_box(container, quit_message.c_str(), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR); machine.pause(); // if the user press ENTER, quit the game @@ -1844,7 +1844,7 @@ static slider_state *slider_init(running_machine &machine) info.stream->input_name(info.inputnum, string); string.cat(" Volume"); - *tailptr = slider_alloc(machine, string, 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item); + *tailptr = slider_alloc(machine, string.c_str(), 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item); tailptr = &(*tailptr)->next; } @@ -1866,7 +1866,7 @@ static slider_state *slider_init(running_machine &machine) { void *param = (void *)&exec->device(); string.printf("Overclock CPU %s", exec->device().tag()); - *tailptr = slider_alloc(machine, string, 10, 1000, 2000, 1, slider_overclock, param); + *tailptr = slider_alloc(machine, string.c_str(), 10, 1000, 2000, 1, slider_overclock, param); tailptr = &(*tailptr)->next; } } @@ -1885,33 +1885,33 @@ static slider_state *slider_init(running_machine &machine) if (machine.options().cheat()) { string.printf("%s Refresh Rate", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, -10000, 0, 10000, 1000, slider_refresh, param); + *tailptr = slider_alloc(machine, string.c_str(), -10000, 0, 10000, 1000, slider_refresh, param); tailptr = &(*tailptr)->next; } // add standard brightness/contrast/gamma controls per-screen string.printf("%s Brightness", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, 100, 1000, 2000, 10, slider_brightness, param); + *tailptr = slider_alloc(machine, string.c_str(), 100, 1000, 2000, 10, slider_brightness, param); tailptr = &(*tailptr)->next; string.printf("%s Contrast", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, 100, 1000, 2000, 50, slider_contrast, param); + *tailptr = slider_alloc(machine, string.c_str(), 100, 1000, 2000, 50, slider_contrast, param); tailptr = &(*tailptr)->next; string.printf("%s Gamma", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, 100, 1000, 3000, 50, slider_gamma, param); + *tailptr = slider_alloc(machine, string.c_str(), 100, 1000, 3000, 50, slider_gamma, param); tailptr = &(*tailptr)->next; // add scale and offset controls per-screen string.printf("%s Horiz Stretch", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, 500, defxscale, 1500, 2, slider_xscale, param); + *tailptr = slider_alloc(machine, string.c_str(), 500, defxscale, 1500, 2, slider_xscale, param); tailptr = &(*tailptr)->next; string.printf("%s Horiz Position", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, -500, defxoffset, 500, 2, slider_xoffset, param); + *tailptr = slider_alloc(machine, string.c_str(), -500, defxoffset, 500, 2, slider_xoffset, param); tailptr = &(*tailptr)->next; string.printf("%s Vert Stretch", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, 500, defyscale, 1500, 2, slider_yscale, param); + *tailptr = slider_alloc(machine, string.c_str(), 500, defyscale, 1500, 2, slider_yscale, param); tailptr = &(*tailptr)->next; string.printf("%s Vert Position", slider_get_screen_desc(*screen)); - *tailptr = slider_alloc(machine, string, -500, defyoffset, 500, 2, slider_yoffset, param); + *tailptr = slider_alloc(machine, string.c_str(), -500, defyoffset, 500, 2, slider_yoffset, param); tailptr = &(*tailptr)->next; } @@ -1929,16 +1929,16 @@ static slider_state *slider_init(running_machine &machine) // add scale and offset controls per-overlay string.printf("Laserdisc '%s' Horiz Stretch", laserdisc->tag()); - *tailptr = slider_alloc(machine, string, 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_overxscale, param); + *tailptr = slider_alloc(machine, string.c_str(), 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_overxscale, param); tailptr = &(*tailptr)->next; string.printf("Laserdisc '%s' Horiz Position", laserdisc->tag()); - *tailptr = slider_alloc(machine, string, -500, defxoffset, 500, 2, slider_overxoffset, param); + *tailptr = slider_alloc(machine, string.c_str(), -500, defxoffset, 500, 2, slider_overxoffset, param); tailptr = &(*tailptr)->next; string.printf("Laserdisc '%s' Vert Stretch", laserdisc->tag()); - *tailptr = slider_alloc(machine, string, 500, (defyscale == 0) ? 1000 : defyscale, 1500, 2, slider_overyscale, param); + *tailptr = slider_alloc(machine, string.c_str(), 500, (defyscale == 0) ? 1000 : defyscale, 1500, 2, slider_overyscale, param); tailptr = &(*tailptr)->next; string.printf("Laserdisc '%s' Vert Position", laserdisc->tag()); - *tailptr = slider_alloc(machine, string, -500, defyoffset, 500, 2, slider_overyoffset, param); + *tailptr = slider_alloc(machine, string.c_str(), -500, defyoffset, 500, 2, slider_overyoffset, param); tailptr = &(*tailptr)->next; } @@ -1961,10 +1961,10 @@ static slider_state *slider_init(running_machine &machine) { void *param = (void *)field; string.printf("Crosshair Scale %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y"); - *tailptr = slider_alloc(machine, string, -3000, 1000, 3000, 100, slider_crossscale, param); + *tailptr = slider_alloc(machine, string.c_str(), -3000, 1000, 3000, 100, slider_crossscale, param); tailptr = &(*tailptr)->next; string.printf("Crosshair Offset %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y"); - *tailptr = slider_alloc(machine, string, -3000, 0, 3000, 100, slider_crossoffset, param); + *tailptr = slider_alloc(machine, string.c_str(), -3000, 0, 3000, 100, slider_crossoffset, param); tailptr = &(*tailptr)->next; } #endif diff --git a/src/emu/ui/videoopt.c b/src/emu/ui/videoopt.c index dabfff4fdfa..d0788527b2e 100644 --- a/src/emu/ui/videoopt.c +++ b/src/emu/ui/videoopt.c @@ -187,7 +187,7 @@ void ui_menu_video_options::populate() /* create a string for the item, replacing underscores with spaces */ tempstring.cpy(name).replace(0, "_", " "); - item_append(tempstring, NULL, 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum)); + item_append(tempstring.c_str(), NULL, 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum)); } /* add a separator */ diff --git a/src/emu/validity.c b/src/emu/validity.c index df0e6e30e34..a0367b95c86 100644 --- a/src/emu/validity.c +++ b/src/emu/validity.c @@ -644,7 +644,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) + if (m_region_map.add(fulltag.c_str(), current_length, false) == TMERR_DUPLICATE) osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.c_str()); } @@ -852,7 +852,7 @@ void validity_checker::validate_condition(ioport_condition &condition, device_t device.subtag(porttag, condition.tag()); // then find a matching port - if (port_map.find(porttag) == 0) + if (port_map.find(porttag.c_str()) == 0) osd_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag()); } diff --git a/src/emu/video.c b/src/emu/video.c index aa2bd696b6a..abdaf4056b9 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -311,8 +311,8 @@ void video_manager::save_snapshot(screen_device *screen, emu_file &file) astring text1(emulator_info::get_appname(), " ", build_version); astring text2(machine().system().manufacturer, " ", machine().system().description); png_info pnginfo = { 0 }; - png_add_text(&pnginfo, "Software", text1); - png_add_text(&pnginfo, "System", text2); + png_add_text(&pnginfo, "Software", text1.c_str()); + png_add_text(&pnginfo, "System", text2.c_str()); // now do the actual work const rgb_t *palette = (screen !=NULL && screen->palette() != NULL) ? screen->palette()->palette()->entry_list_adjusted() : NULL; @@ -417,7 +417,7 @@ void video_manager::begin_recording(const char *name, movie_format format) m_avi_frame_period = attotime::from_seconds(1000) / info.video_timescale; // create the file and free the string - avi_error avierr = avi_create(fullpath, &info, &m_avi_file); + avi_error avierr = avi_create(fullpath.c_str(), &info, &m_avi_file); if (avierr != AVIERR_NONE) { osd_printf_error("Error creating AVI: %s\n", avi_error_string(avierr)); @@ -1126,12 +1126,12 @@ file_error video_manager::open_next(emu_file &file, const char *extension) // handle %d in the template (for image devices) astring snapdev("%d_"); - int pos = snapstr.find(0, snapdev); + int pos = snapstr.find(0, snapdev.c_str()); if (pos != -1) { // if more %d are found, revert to default and ignore them all - if (snapstr.find(pos + 3, snapdev) != -1) + if (snapstr.find(pos + 3, snapdev.c_str()) != -1) snapstr.cpy("%g/%i"); // else if there is a single %d, try to create the correct snapname else @@ -1179,7 +1179,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) filename.substr(0, filename.rchr(0, '.')); // setup snapname and remove the %d_ - snapstr.replace(0, snapdevname, filename); + snapstr.replace(0, snapdevname.c_str(), filename.c_str()); snapstr.del(pos, 3); //printf("check image: %s\n", filename.c_str()); @@ -1218,7 +1218,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) 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); + file_error filerr = file.open(fname.c_str()); if (filerr != FILERR_NONE) break; } @@ -1226,7 +1226,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) // create the final file file.set_openflags(origflags); - return file.open(fname); + return file.open(fname.c_str()); } @@ -1280,8 +1280,8 @@ void video_manager::record_frame() { astring text1(emulator_info::get_appname(), " ", build_version); astring text2(machine().system().manufacturer, " ", machine().system().description); - png_add_text(&pnginfo, "Software", text1); - png_add_text(&pnginfo, "System", text2); + png_add_text(&pnginfo, "Software", text1.c_str()); + png_add_text(&pnginfo, "System", text2.c_str()); } // write the next frame diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index baf215e89c7..1105e666e82 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -331,7 +331,7 @@ void ibm8514a_device::device_config_complete() { if(m_vga_tag.len() != 0) { - m_vga = machine().device<vga_device>(m_vga_tag); + m_vga = machine().device<vga_device>(m_vga_tag.c_str()); } } diff --git a/src/emu/webengine.c b/src/emu/webengine.c index 4ea56689d94..78be772a731 100644 --- a/src/emu/webengine.c +++ b/src/emu/webengine.c @@ -261,10 +261,10 @@ static int filename_endswith(const char *str, const char *suffix) int web_engine::begin_request_handler(struct mg_connection *conn) { astring file_path(mg_get_option(m_server, "document_root"), PATH_SEPARATOR, conn->uri); - if (filename_endswith(file_path,".lp")) + if (filename_endswith(file_path.c_str(), ".lp")) { FILE *fp = NULL; - if ((fp = fopen(file_path, "rb")) != NULL) { + if ((fp = fopen(file_path.c_str(), "rb")) != NULL) { fseek (fp, 0, SEEK_END); size_t size = ftell(fp); fseek (fp, 0, SEEK_SET); @@ -442,7 +442,7 @@ int web_engine::begin_request_handler(struct mg_connection *conn) astring fname("screenshot.png"); emu_file file(m_machine->options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - file_error filerr = file.open(fname); + file_error filerr = file.open(fname.c_str()); if (filerr != FILERR_NONE) { diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c index b3158257691..da94f8331bf 100644 --- a/src/ldplayer/ldplayer.c +++ b/src/ldplayer/ldplayer.c @@ -234,7 +234,7 @@ chd_file *ldplayer_state::get_disc() // try to open the CHD - if (set_disk_handle(machine(), "laserdisc", fullpath) == CHDERR_NONE) + if (set_disk_handle(machine(), "laserdisc", fullpath.c_str()) == CHDERR_NONE) { m_filename.cpy(dir->name); found = TRUE; diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h index 14f26cb3990..0858896184a 100644 --- a/src/lib/util/astring.h +++ b/src/lib/util/astring.h @@ -73,7 +73,6 @@ public: operator bool() const { return m_text[0] != 0; } // C string conversion operators and helpers - operator const char *() const { return m_text; } const char *c_str() const { return m_text; } // buffer management diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index e747261c74f..ce9a0e7b130 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -161,7 +161,7 @@ cdrom_file *cdrom_open(const char *inputfile) for (i = 0; i < file->cdtoc.numtrks; i++) { - file_error filerr = core_fopen(file->track_info.track[i].fname, OPEN_FLAG_READ, &file->fhandle[i]); + file_error filerr = core_fopen(file->track_info.track[i].fname.c_str(), OPEN_FLAG_READ, &file->fhandle[i]); if (filerr != FILERR_NONE) { fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.c_str()); @@ -833,7 +833,7 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) /* parse the metadata */ type[0] = subtype[0] = 0; pgtype[0] = pgsub[0] = 0; - if (sscanf(metadata, CDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames) != 4) + if (sscanf(metadata.c_str(), CDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames) != 4) return CHDERR_INVALID_DATA; if (tracknum == 0 || tracknum > CD_MAX_TRACKS) return CHDERR_INVALID_DATA; @@ -847,7 +847,7 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) /* parse the metadata */ type[0] = subtype[0] = 0; pregap = postgap = 0; - if (sscanf(metadata, CDROM_TRACK_METADATA2_FORMAT, &tracknum, type, subtype, &frames, &pregap, pgtype, pgsub, &postgap) != 8) + if (sscanf(metadata.c_str(), CDROM_TRACK_METADATA2_FORMAT, &tracknum, type, subtype, &frames, &pregap, pgtype, pgsub, &postgap) != 8) return CHDERR_INVALID_DATA; if (tracknum == 0 || tracknum > CD_MAX_TRACKS) return CHDERR_INVALID_DATA; @@ -867,7 +867,7 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) /* parse the metadata */ type[0] = subtype[0] = 0; pregap = postgap = 0; - if (sscanf(metadata, GDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames, &padframes, &pregap, pgtype, pgsub, &postgap) != 9) + if (sscanf(metadata.c_str(), GDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames, &padframes, &pregap, pgtype, pgsub, &postgap) != 9) return CHDERR_INVALID_DATA; if (tracknum == 0 || tracknum > CD_MAX_TRACKS) return CHDERR_INVALID_DATA; diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c index d3992ae7ea4..c56465b48a2 100644 --- a/src/lib/util/chd.c +++ b/src/lib/util/chd.c @@ -1411,7 +1411,7 @@ UINT32 chd_file::guess_unitbytes() // look for hard disk metadata; if found, then the unit size == sector size astring metadata; int i0, i1, i2, i3; - if (read_metadata(HARD_DISK_METADATA_TAG, 0, metadata) == CHDERR_NONE && sscanf(metadata, HARD_DISK_METADATA_FORMAT, &i0, &i1, &i2, &i3) == 4) + if (read_metadata(HARD_DISK_METADATA_TAG, 0, metadata) == CHDERR_NONE && sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &i0, &i1, &i2, &i3) == 4) return i3; // look for CD-ROM metadata; if found, then the unit size == CD frame size diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c index 244c900bc28..0720a6b9aa0 100644 --- a/src/lib/util/chdcd.c +++ b/src/lib/util/chdcd.c @@ -679,7 +679,7 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_ } outinfo.track[trknum].fname.cpy(path).cat(name); - sz = get_file_size(outinfo.track[trknum].fname); + sz = get_file_size(outinfo.track[trknum].fname.c_str()); outtoc.tracks[trknum].frames = sz/trksize; outtoc.tracks[trknum].padframes = 0; @@ -768,7 +768,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i } else if (!strcmp(token, "WAVE")) { - wavlen = parse_wav_sample(lastfname, &wavoffs); + wavlen = parse_wav_sample(lastfname.c_str(), &wavoffs); if (!wavlen) { printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.c_str()); @@ -938,7 +938,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i } else /* data files are different */ { - tlen = get_file_size(outinfo.track[trknum].fname); + 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.c_str()); @@ -973,7 +973,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i } else /* data files are different */ { - tlen = get_file_size(outinfo.track[trknum].fname); + 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].fname.c_str()); diff --git a/src/lib/util/chdcodec.c b/src/lib/util/chdcodec.c index 3bf1d6dfd63..8a43c79ea80 100644 --- a/src/lib/util/chdcodec.c +++ b/src/lib/util/chdcodec.c @@ -1626,7 +1626,7 @@ void chd_avhuff_compressor::postinit() // extract the info int fps, fpsfrac, width, height, interlaced, channels, rate; - if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) + if (sscanf(metadata.c_str(), AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) throw CHDERR_INVALID_METADATA; // compute the bytes per frame diff --git a/src/lib/util/harddisk.c b/src/lib/util/harddisk.c index 46d8f5bab9a..7fce13ca638 100644 --- a/src/lib/util/harddisk.c +++ b/src/lib/util/harddisk.c @@ -53,7 +53,7 @@ hard_disk_file *hard_disk_open(chd_file *chd) return NULL; /* parse the metadata */ - if (sscanf(metadata, HARD_DISK_METADATA_FORMAT, &cylinders, &heads, §ors, §orbytes) != 4) + if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &cylinders, &heads, §ors, §orbytes) != 4) return NULL; /* allocate memory for the hard disk file */ diff --git a/src/lib/util/hashing.c b/src/lib/util/hashing.c index a29818910c2..d7be3af1427 100644 --- a/src/lib/util/hashing.c +++ b/src/lib/util/hashing.c @@ -84,7 +84,7 @@ const char *sha1_t::as_string(astring &buffer) const buffer.reset(); for (int i = 0; i < ARRAY_LENGTH(m_raw); i++) buffer.catformat("%02x", m_raw[i]); - return buffer; + return buffer.c_str(); } @@ -127,7 +127,7 @@ const char *md5_t::as_string(astring &buffer) const buffer.reset(); for (int i = 0; i < ARRAY_LENGTH(m_raw); i++) buffer.catformat("%02x", m_raw[i]); - return buffer; + return buffer.c_str(); } @@ -168,7 +168,7 @@ bool crc32_t::from_string(const char *string, int length) const char *crc32_t::as_string(astring &buffer) const { - return buffer.format("%08x", m_raw); + return buffer.format("%08x", m_raw).c_str(); } @@ -220,7 +220,7 @@ bool crc16_t::from_string(const char *string, int length) const char *crc16_t::as_string(astring &buffer) const { - return buffer.format("%04x", m_raw); + return buffer.format("%04x", m_raw).c_str(); } diff --git a/src/lib/util/options.c b/src/lib/util/options.c index dc3f69933fc..d1d69db2e82 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -532,7 +532,7 @@ const char *core_options::output_ini(astring &buffer, const core_options *diff) } } } - return buffer; + return buffer.c_str(); } @@ -556,7 +556,7 @@ const char *core_options::output_help(astring &buffer) else if (curentry->description() != NULL) buffer.catprintf("-%-20s%s\n", curentry->name(), curentry->description()); } - return buffer; + return buffer.c_str(); } @@ -687,7 +687,7 @@ void core_options::append_entry(core_options::entry &newentry) // for boolean options add a "no" variant as well if (newentry.type() == OPTION_BOOLEAN) - m_entrymap.add(astring("no", newentry.name(name)), &newentry); + m_entrymap.add(astring("no", newentry.name(name)).c_str(), &newentry); } } @@ -702,7 +702,7 @@ void core_options::remove_entry(core_options::entry &delentry) // remove all names from the map for (int name = 0; name < ARRAY_LENGTH(delentry.m_name); name++) if (delentry.m_name[name]) - m_entrymap.remove(delentry.m_name[name]); + m_entrymap.remove(delentry.m_name[name].c_str()); // remove the entry from the list m_entrylist.remove(delentry); @@ -750,7 +750,7 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch { // booleans must be 0 or 1 case OPTION_BOOLEAN: - if (sscanf(data, "%d", &ival) != 1 || ival < 0 || ival > 1) + if (sscanf(data.c_str(), "%d", &ival) != 1 || ival < 0 || ival > 1) { error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; @@ -759,7 +759,7 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch // integers must be integral case OPTION_INTEGER: - if (sscanf(data, "%d", &ival) != 1) + if (sscanf(data.c_str(), "%d", &ival) != 1) { error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; @@ -773,7 +773,7 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch // floating-point values must be numeric case OPTION_FLOAT: - if (sscanf(data, "%f", &fval) != 1) + if (sscanf(data.c_str(), "%f", &fval) != 1) { error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; @@ -798,6 +798,6 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch } // set the data - curentry.set_value(data, priority); + curentry.set_value(data.c_str(), priority); return true; } diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 941d3c7df70..1b9528ff433 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -77,10 +77,10 @@ public: 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].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; } - const char *minimum() const { return m_minimum; } - const char *maximum() const { return m_maximum; } + const char *value() const { return m_data.c_str(); } + const char *default_value() const { return m_defdata.c_str(); } + const char *minimum() const { return m_minimum.c_str(); } + const char *maximum() const { return m_maximum.c_str(); } UINT32 seqid() const { return m_seqid; } int type() const { return (m_flags & OPTION_TYPE_MASK); } UINT32 flags() const { return m_flags; } @@ -127,7 +127,7 @@ public: // getters entry *first() const { return m_entrylist.first(); } - const char *command() const { return m_command; } + const char *command() const { return m_command.c_str(); } // configuration void add_entry(const char *name, const char *description, UINT32 flags = 0, const char *defvalue = NULL, bool override_existing = false); diff --git a/src/lib/util/zippath.c b/src/lib/util/zippath.c index e5e563cdbde..4872f379135 100644 --- a/src/lib/util/zippath.c +++ b/src/lib/util/zippath.c @@ -263,10 +263,10 @@ file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&fil && ((openflags == OPEN_FLAG_READ) || (subpath.len() == 0))) { /* is the mainpath a ZIP path? */ - if (is_zip_file(mainpath)) + if (is_zip_file(mainpath.c_str())) { /* this file might be a zip file - lets take a look */ - ziperr = zip_file_open(mainpath, &zip); + ziperr = zip_file_open(mainpath.c_str(), &zip); if (ziperr == ZIPERR_NONE) { /* it is a zip file - error if we're not opening for reading */ @@ -277,7 +277,7 @@ file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&fil } if (subpath.len() > 0) - header = zippath_find_sub_path(zip, subpath, &entry_type); + header = zippath_find_sub_path(zip, subpath.c_str(), &entry_type); else header = zip_file_first_file(zip); @@ -300,7 +300,7 @@ file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&fil goto done; } } - else if (is_7z_file(mainpath)) + else if (is_7z_file(mainpath.c_str())) { filerr = FILERR_INVALID_DATA; goto done; @@ -316,7 +316,7 @@ file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&fil { /* go up a directory */ astring temp; - zippath_parent(temp, mainpath); + zippath_parent(temp, mainpath.c_str()); /* append to the sub path */ if (subpath.len() > 0) @@ -342,7 +342,7 @@ done: if (filerr == FILERR_NONE) { /* cannonicalize mainpath */ - filerr = osd_get_full_path(&alloc_fullpath, mainpath); + filerr = osd_get_full_path(&alloc_fullpath, mainpath.c_str()); if (filerr == FILERR_NONE) { if (subpath.len() > 0) @@ -559,7 +559,7 @@ static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_ty apath_trimmed.cpysubstr(apath, 0, i); /* stat the path */ - current_entry = osd_stat(apath_trimmed); + current_entry = osd_stat(apath_trimmed.c_str()); /* did we find anything? */ if (current_entry != NULL) @@ -575,10 +575,10 @@ static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_ty current_entry_type = ENTTYPE_NONE; went_up = TRUE; astring parent; - apath.cpy(zippath_parent(parent, apath)); + apath.cpy(zippath_parent(parent, apath.c_str())); } } - while (current_entry_type == ENTTYPE_NONE && !is_root(apath)); + while (current_entry_type == ENTTYPE_NONE && !is_root(apath.c_str())); /* if we did not find anything, then error out */ if (current_entry_type == ENTTYPE_NONE) @@ -588,8 +588,8 @@ static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_ty } /* is this file a ZIP file? */ - if ((current_entry_type == ENTTYPE_FILE) && is_zip_file(apath_trimmed) - && (zip_file_open(apath_trimmed, &zipfile) == ZIPERR_NONE)) + if ((current_entry_type == ENTTYPE_FILE) && is_zip_file(apath_trimmed.c_str()) + && (zip_file_open(apath_trimmed.c_str(), &zipfile) == ZIPERR_NONE)) { i = strlen(path + apath.len()); while (i > 0 && is_zip_path_separator(path[apath.len() + i - 1])) @@ -597,7 +597,7 @@ static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_ty newpath.cpy(path + apath.len(), i); /* this was a true ZIP path - attempt to identify the type of path */ - zippath_find_sub_path(zipfile, newpath, ¤t_entry_type); + zippath_find_sub_path(zipfile, newpath.c_str(), ¤t_entry_type); if (current_entry_type == ENTTYPE_NONE) { err = FILERR_NOT_FOUND; @@ -719,7 +719,7 @@ static const char *get_relative_path(zippath_directory *directory, const zip_fil int len = directory->zipprefix.len(); if ((len <= strlen(header->filename)) - && !strncmp(directory->zipprefix, header->filename, len)) + && !strncmp(directory->zipprefix.c_str(), header->filename, len)) { result = &header->filename[len]; while(is_zip_file_separator(*result)) @@ -798,7 +798,7 @@ const osd_directory_entry *zippath_readdir(zippath_directory *directory) /* a nested entry; loop through returned_dirlist to see if we've returned the parent directory */ for (rdent = directory->returned_dirlist; rdent != NULL; rdent = rdent->next) { - if (!core_strnicmp(rdent->name, relpath, separator - relpath)) + if (!core_strnicmp(rdent->name.c_str(), relpath, separator - relpath)) break; } @@ -812,7 +812,7 @@ const osd_directory_entry *zippath_readdir(zippath_directory *directory) /* ...and return it */ memset(&directory->returned_entry, 0, sizeof(directory->returned_entry)); - directory->returned_entry.name = rdent->name; + directory->returned_entry.name = rdent->name.c_str(); directory->returned_entry.type = ENTTYPE_DIR; result = &directory->returned_entry; } diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index ee32966a2e0..21a05f72d53 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -780,7 +780,7 @@ void cps3_state::init_common(void) astring tempstr; for (int simmnum = 0; simmnum < 7; simmnum++) for (int chipnum = 0; chipnum < 8; chipnum++) - m_simm[simmnum][chipnum] = machine().device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum)); + m_simm[simmnum][chipnum] = machine().device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum).c_str()); m_eeprom = auto_alloc_array(machine(), UINT32, 0x400/4); machine().device<nvram_device>("eeprom")->set_base(m_eeprom, 0x400); diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c index 6f006ceaa32..ffdf32dfbdd 100644 --- a/src/mame/drivers/megatech.c +++ b/src/mame/drivers/megatech.c @@ -644,23 +644,23 @@ MACHINE_RESET_MEMBER(mtech_state, megatech) astring region_tag; if (m_cart1) - m_cart_reg[0] = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[0] = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); else m_cart_reg[0] = memregion("cart"); if (m_cart2) - m_cart_reg[1] = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[1] = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart3) - m_cart_reg[2] = memregion(region_tag.cpy(m_cart3->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[2] = memregion(region_tag.cpy(m_cart3->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart4) - m_cart_reg[3] = memregion(region_tag.cpy(m_cart4->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[3] = memregion(region_tag.cpy(m_cart4->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart5) - m_cart_reg[4] = memregion(region_tag.cpy(m_cart5->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[4] = memregion(region_tag.cpy(m_cart5->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart6) - m_cart_reg[5] = memregion(region_tag.cpy(m_cart6->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[5] = memregion(region_tag.cpy(m_cart6->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart7) - m_cart_reg[6] = memregion(region_tag.cpy(m_cart7->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[6] = memregion(region_tag.cpy(m_cart7->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart8) - m_cart_reg[7] = memregion(region_tag.cpy(m_cart8->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[7] = memregion(region_tag.cpy(m_cart8->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); switch_cart(0); } diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index 29704dce9fb..e28160ca16c 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -1239,15 +1239,15 @@ MACHINE_RESET_MEMBER(stv_state,stv) astring region_tag; if (m_cart1) - m_cart_reg[0] = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[0] = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); else m_cart_reg[0] = memregion("cart"); if (m_cart2) - m_cart_reg[1] = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[1] = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart3) - m_cart_reg[2] = memregion(region_tag.cpy(m_cart3->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[2] = memregion(region_tag.cpy(m_cart3->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart4) - m_cart_reg[3] = memregion(region_tag.cpy(m_cart4->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg[3] = memregion(region_tag.cpy(m_cart4->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_en_68k = 0; m_NMI_reset = 0; diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index 6ce56c35a8c..0f59207fb62 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -49,7 +49,7 @@ #define MCFG_ATARI_VAD_PLAYFIELD(_class, _gfxtag, _getinfo) \ { astring fulltag(device->tag(), ":playfield"); device_t *device; \ - MCFG_TILEMAP_ADD(fulltag) \ + MCFG_TILEMAP_ADD(fulltag.c_str()) \ MCFG_TILEMAP_GFXDECODE("^" _gfxtag) \ MCFG_TILEMAP_BYTES_PER_ENTRY(2) \ MCFG_TILEMAP_INFO_CB_DEVICE(DEVICE_SELF_OWNER, _class, _getinfo) \ @@ -58,7 +58,7 @@ #define MCFG_ATARI_VAD_PLAYFIELD2(_class, _gfxtag, _getinfo) \ { astring fulltag(device->tag(), ":playfield2"); device_t *device; \ - MCFG_TILEMAP_ADD(fulltag) \ + MCFG_TILEMAP_ADD(fulltag.c_str()) \ MCFG_TILEMAP_GFXDECODE("^" _gfxtag) \ MCFG_TILEMAP_BYTES_PER_ENTRY(2) \ MCFG_TILEMAP_INFO_CB_DEVICE(DEVICE_SELF_OWNER, _class, _getinfo) \ @@ -68,7 +68,7 @@ #define MCFG_ATARI_VAD_ALPHA(_class, _gfxtag, _getinfo) \ { astring fulltag(device->tag(), ":alpha"); device_t *device; \ - MCFG_TILEMAP_ADD(fulltag) \ + MCFG_TILEMAP_ADD(fulltag.c_str()) \ MCFG_TILEMAP_GFXDECODE("^" _gfxtag) \ MCFG_TILEMAP_BYTES_PER_ENTRY(2) \ MCFG_TILEMAP_INFO_CB_DEVICE(DEVICE_SELF_OWNER, _class, _getinfo) \ @@ -78,7 +78,7 @@ #define MCFG_ATARI_VAD_MOB(_config, _gfxtag) \ { astring fulltag(device->tag(), ":mob"); device_t *device; \ - MCFG_ATARI_MOTION_OBJECTS_ADD(fulltag, "^^screen", _config) \ + MCFG_ATARI_MOTION_OBJECTS_ADD(fulltag.c_str(), "^^screen", _config) \ MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("^" _gfxtag) } diff --git a/src/mess/drivers/beta.c b/src/mess/drivers/beta.c index 14799269d79..e586d8a547e 100644 --- a/src/mess/drivers/beta.c +++ b/src/mess/drivers/beta.c @@ -317,7 +317,7 @@ void beta_state::machine_start() else { astring region_tag; - memcpy(m_eprom_rom, memregion(region_tag.cpy(m_eprom->tag()).cat(GENERIC_ROM_REGION_TAG))->base(), 0x800); + memcpy(m_eprom_rom, memregion(region_tag.cpy(m_eprom->tag()).cat(GENERIC_ROM_REGION_TAG).c_str())->base(), 0x800); } // state saving diff --git a/src/mess/drivers/cc40.c b/src/mess/drivers/cc40.c index 185fcb60b5b..b17d13d023f 100644 --- a/src/mess/drivers/cc40.c +++ b/src/mess/drivers/cc40.c @@ -546,7 +546,7 @@ void cc40_state::machine_start() { // init astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); membank("sysbank")->configure_entries(0, 4, memregion("system")->base(), 0x2000); if (m_cart_rom) diff --git a/src/mess/drivers/gameking.c b/src/mess/drivers/gameking.c index 205d857eb83..4a7ac0bb425 100644 --- a/src/mess/drivers/gameking.c +++ b/src/mess/drivers/gameking.c @@ -119,7 +119,7 @@ DEVICE_IMAGE_LOAD_MEMBER( gameking_state, gameking_cart ) void gameking_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (!m_cart_rom) { diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c index 3788f0631cc..f1ec69c97ab 100644 --- a/src/mess/drivers/gba.c +++ b/src/mess/drivers/gba.c @@ -2118,7 +2118,7 @@ void gba_state::machine_start() m_maincpu->space(AS_PROGRAM).install_read_bank(0x0c000000, 0x0cffffff, 0, 0, "rom3"); astring region_tag; - memory_region *cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GBASLOT_ROM_REGION_TAG)); + memory_region *cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GBASLOT_ROM_REGION_TAG).c_str()); // install ROM accesses membank("rom1")->set_base(cart_rom->base()); diff --git a/src/mess/drivers/kyocera.c b/src/mess/drivers/kyocera.c index 2dca599ff66..f6b8df08143 100644 --- a/src/mess/drivers/kyocera.c +++ b/src/mess/drivers/kyocera.c @@ -1169,7 +1169,7 @@ void kc85_state::machine_start() address_space &program = m_maincpu->space(AS_PROGRAM); astring region_tag; - m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); /* initialize RTC */ m_rtc->cs_w(1); @@ -1212,7 +1212,7 @@ void pc8201_state::machine_start() UINT8 *ram = m_ram->pointer(); astring region_tag; - m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); /* initialize RTC */ m_rtc->cs_w(1); @@ -1246,7 +1246,7 @@ void trsm100_state::machine_start() address_space &program = m_maincpu->space(AS_PROGRAM); astring region_tag; - m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); /* initialize RTC */ m_rtc->cs_w(1); @@ -1297,7 +1297,7 @@ void trsm100_state::machine_start() void tandy200_state::machine_start() { astring region_tag; - m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_opt_region = memregion(region_tag.cpy(m_opt_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); /* configure ROM banking */ membank("bank1")->configure_entry(0, m_rom->base()); diff --git a/src/mess/drivers/leapster.c b/src/mess/drivers/leapster.c index fe1fca5215f..49c712dc0cc 100644 --- a/src/mess/drivers/leapster.c +++ b/src/mess/drivers/leapster.c @@ -270,7 +270,7 @@ DEVICE_IMAGE_LOAD_MEMBER( leapster_state, leapster_cart ) void leapster_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_cart_rom) { diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c index b023f6107ad..bfe79bc11b9 100644 --- a/src/mess/drivers/nc.c +++ b/src/mess/drivers/nc.c @@ -796,7 +796,7 @@ void nc_state::machine_start() m_type = NC_TYPE_1xx; astring region_tag; - m_card_ram = memregion(region_tag.cpy(m_card->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_card_ram = memregion(region_tag.cpy(m_card->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_card_ram) m_card_size = m_card_ram->bytes(); else @@ -1140,7 +1140,7 @@ MACHINE_START_MEMBER(nc_state, nc200) m_type = NC_TYPE_200; astring region_tag; - m_card_ram = memregion(region_tag.cpy(m_card->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_card_ram = memregion(region_tag.cpy(m_card->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_card_ram) m_card_size = m_card_ram->bytes(); else diff --git a/src/mess/drivers/ngp.c b/src/mess/drivers/ngp.c index d98dfb9c3e7..e7d980cb999 100644 --- a/src/mess/drivers/ngp.c +++ b/src/mess/drivers/ngp.c @@ -645,7 +645,7 @@ void ngp_state::machine_start() if (m_cart->exists()) { astring region_tag; - UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base(); + UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str())->base(); m_maincpu->space(AS_PROGRAM).install_read_bank(0x200000, 0x3fffff, "flash0"); m_maincpu->space(AS_PROGRAM).install_read_bank(0x800000, 0x9fffff, "flash1"); diff --git a/src/mess/drivers/pasogo.c b/src/mess/drivers/pasogo.c index f505d79c666..0ee66b8a748 100644 --- a/src/mess/drivers/pasogo.c +++ b/src/mess/drivers/pasogo.c @@ -518,7 +518,7 @@ void pasogo_state::machine_reset() { astring region_tag; ioport_port *color = ioport("COLOR"); - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (!m_cart_rom) // this should never happen, since we make carts mandatory! m_cart_rom = memregion("maincpu"); diff --git a/src/mess/drivers/pb1000.c b/src/mess/drivers/pb1000.c index 9ad8930eb29..3a313497501 100644 --- a/src/mess/drivers/pb1000.c +++ b/src/mess/drivers/pb1000.c @@ -461,9 +461,9 @@ void pb1000_state::machine_start() astring region_tag; m_rom_reg = memregion("rom"); if (m_card1) - m_card1_reg = memregion(region_tag.cpy(m_card1->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_card1_reg = memregion(region_tag.cpy(m_card1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (m_card2) - m_card2_reg = memregion(region_tag.cpy(m_card2->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_card2_reg = memregion(region_tag.cpy(m_card2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); membank("bank1")->set_base(m_rom_reg->base()); diff --git a/src/mess/drivers/pc2000.c b/src/mess/drivers/pc2000.c index c6b4f23c81a..bd29eaee6cc 100644 --- a/src/mess/drivers/pc2000.c +++ b/src/mess/drivers/pc2000.c @@ -742,7 +742,7 @@ void pc2000_state::machine_start() { astring region_tag; UINT8 *bios = memregion("bios")->base(); - UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base(); + UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str())->base(); if (!cart) cart = memregion("bios")->base(); @@ -756,7 +756,7 @@ void gl4004_state::machine_start() { astring region_tag; UINT8 *bios = memregion("bios")->base(); - UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base(); + UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str())->base(); if (!cart) cart = memregion("bios")->base(); diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c index d1b451e3635..6316e4cc26d 100644 --- a/src/mess/drivers/pc6001.c +++ b/src/mess/drivers/pc6001.c @@ -2079,7 +2079,7 @@ void pc6001_state::machine_reset() m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart)); astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_port_c_8255=0; @@ -2097,7 +2097,7 @@ MACHINE_RESET_MEMBER(pc6001_state,pc6001m2) m_video_ram = m_region_maincpu->base() + 0xc000 + 0x28000; astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); // hackish way to simplify bankswitch handling if (m_cart_rom) memcpy(m_region_maincpu->base() + 0x48000, m_cart_rom->base(), 0x4000); @@ -2136,7 +2136,7 @@ MACHINE_RESET_MEMBER(pc6001_state,pc6001sr) m_video_ram = m_region_maincpu->base() + 0x70000; astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); // should this be mirrored into the EXROM regions? hard to tell without an actual cart dump... m_port_c_8255=0; diff --git a/src/mess/drivers/pc8401a.c b/src/mess/drivers/pc8401a.c index b5c1ef4cd4b..fdce7dbb51f 100644 --- a/src/mess/drivers/pc8401a.c +++ b/src/mess/drivers/pc8401a.c @@ -489,7 +489,7 @@ INPUT_PORTS_END void pc8401a_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); /* initialize RTC */ m_rtc->cs_w(1); diff --git a/src/mess/drivers/pockstat.c b/src/mess/drivers/pockstat.c index cb599de0751..6442d04c47b 100644 --- a/src/mess/drivers/pockstat.c +++ b/src/mess/drivers/pockstat.c @@ -886,7 +886,7 @@ void pockstat_state::machine_start() m_rtc_regs.timer->adjust(attotime::from_hz(1), index); astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); save_item(NAME(m_ftlb_regs.control)); save_item(NAME(m_ftlb_regs.stat)); diff --git a/src/mess/drivers/prestige.c b/src/mess/drivers/prestige.c index 42b2a1bf5c4..3a15969e0e6 100644 --- a/src/mess/drivers/prestige.c +++ b/src/mess/drivers/prestige.c @@ -619,7 +619,7 @@ IRQ_CALLBACK_MEMBER(prestige_state::prestige_int_ack) void prestige_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); UINT8 *rom = memregion("maincpu")->base(); UINT8 *cart = m_cart_rom->base(); diff --git a/src/mess/drivers/pv1000.c b/src/mess/drivers/pv1000.c index 5dff81ea8e1..b555fba8505 100644 --- a/src/mess/drivers/pv1000.c +++ b/src/mess/drivers/pv1000.c @@ -406,7 +406,7 @@ void pv1000_state::machine_start() // FIXME: this is needed for gfx decoding, but there is probably a cleaner solution! astring region_tag; - memcpy(memregion("gfxrom")->base(), memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base(), m_cart->get_rom_size()); + memcpy(memregion("gfxrom")->base(), memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str())->base(), m_cart->get_rom_size()); } save_item(NAME(m_io_regs)); diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c index a07843f409d..0e379ce08e4 100644 --- a/src/mess/drivers/px4.c +++ b/src/mess/drivers/px4.c @@ -1229,8 +1229,8 @@ DRIVER_INIT_MEMBER( px4p_state, px4p ) void px4_state::machine_start() { astring region_tag; - m_caps1_rom = memregion(region_tag.cpy(m_caps1->tag()).cat(GENERIC_ROM_REGION_TAG)); - m_caps2_rom = memregion(region_tag.cpy(m_caps2->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_caps1_rom = memregion(region_tag.cpy(m_caps1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); + m_caps2_rom = memregion(region_tag.cpy(m_caps2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_nvram->set_base(m_ram->pointer(), 0x10000); diff --git a/src/mess/drivers/socrates.c b/src/mess/drivers/socrates.c index 28ee3002644..b6c2fe87868 100644 --- a/src/mess/drivers/socrates.c +++ b/src/mess/drivers/socrates.c @@ -318,7 +318,7 @@ void socrates_state::socrates_check_kb_latch( ) // if kb[1] is full and kb[0] i void socrates_state::machine_reset() { astring region_tag; - m_cart_reg = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_rom_bank = 0xF3; // actually set semi-randomly on real console but we need to initialize it somewhere... socrates_set_rom_bank(); @@ -897,7 +897,7 @@ WRITE8_MEMBER( iqunlim_state::video_regs_w ) void iqunlim_state::machine_start() { astring region_tag; - m_cart_reg = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_reg = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); UINT8 *bios = m_bios_reg->base(); UINT8 *cart = m_cart_reg ? m_cart_reg->base() : m_bios_reg->base(); diff --git a/src/mess/drivers/svision.c b/src/mess/drivers/svision.c index c90ec362418..4752c1adfcf 100644 --- a/src/mess/drivers/svision.c +++ b/src/mess/drivers/svision.c @@ -469,7 +469,7 @@ void svision_state::machine_start() { int num_banks; astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); num_banks = m_cart_rom->bytes() / 0x4000; m_bank1 = membank("bank1"); diff --git a/src/mess/drivers/timex.c b/src/mess/drivers/timex.c index 8a462e340e8..a42f182b1f0 100644 --- a/src/mess/drivers/timex.c +++ b/src/mess/drivers/timex.c @@ -545,7 +545,7 @@ MACHINE_RESET_MEMBER(spectrum_state,ts2068) m_port_f4_data = 0; astring region_tag; - m_dock_crt = memregion(region_tag.cpy(m_dock->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_dock_crt = memregion(region_tag.cpy(m_dock->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_dock_cart_type = m_dock_crt ? TIMEX_CART_DOCK : TIMEX_CART_NONE; ts2068_update_memory(); diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c index ba7f64a5fd7..b7264622879 100644 --- a/src/mess/drivers/tispeak.c +++ b/src/mess/drivers/tispeak.c @@ -355,7 +355,7 @@ void tispeak_state::init_cartridge() if (m_cart != NULL && m_cart->exists()) { astring region_tag; - memory_region *src = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + memory_region *src = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (src) memcpy(m_cart_base, src->base(), src->bytes()); } diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c index 8e32ce7ea77..01b74a2386e 100644 --- a/src/mess/drivers/tutor.c +++ b/src/mess/drivers/tutor.c @@ -226,7 +226,7 @@ public: void tutor_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_tape_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tutor_state::tape_interrupt_handler),this)); diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c index 826c70315c3..6b992f5a8fc 100644 --- a/src/mess/drivers/tvc.c +++ b/src/mess/drivers/tvc.c @@ -608,7 +608,7 @@ void tvc_state::machine_start() m_vram = memregion("vram"); astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); } void tvc_state::machine_reset() diff --git a/src/mess/drivers/vboy.c b/src/mess/drivers/vboy.c index 00db7737ac3..db507565c2e 100644 --- a/src/mess/drivers/vboy.c +++ b/src/mess/drivers/vboy.c @@ -1174,7 +1174,7 @@ void vboy_state::machine_start() if (m_cart->exists()) { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(VBOYSLOT_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(VBOYSLOT_ROM_REGION_TAG).c_str()); m_maincpu->space(AS_PROGRAM).install_read_bank(0x07000000, 0x071fffff, 0, 0x0e00000, "prog_cart_bank"); m_maincpu->space(AS_IO).install_read_bank(0x07000000, 0x071fffff, 0, 0x0e00000, "io_cart_bank"); diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c index 47cae138502..81fa71770ae 100644 --- a/src/mess/drivers/vii.c +++ b/src/mess/drivers/vii.c @@ -1024,7 +1024,7 @@ void vii_state::machine_start() if (m_cart && m_cart->exists()) { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); memcpy(m_p_cart, m_cart_rom->base(), 0x400000 * 2); } else if (m_spg243_mode == SPG243_VII) // Vii bios is banked diff --git a/src/mess/machine/advision.c b/src/mess/machine/advision.c index 045d5620c2a..7f3199d8870 100644 --- a/src/mess/machine/advision.c +++ b/src/mess/machine/advision.c @@ -28,7 +28,7 @@ void advision_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); /* configure EA banking */ m_bank1->configure_entry(0, memregion(I8048_TAG)->base()); diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c index 1baa812651e..86c0b59ecbd 100644 --- a/src/mess/machine/amstrad.c +++ b/src/mess/machine/amstrad.c @@ -3033,7 +3033,7 @@ MACHINE_START_MEMBER(amstrad_state,plus) m_centronics->write_data7(0); astring region_tag; - m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (!m_region_cart) // this should never happen, since we make carts mandatory! m_region_cart = memregion("maincpu"); } @@ -3077,7 +3077,7 @@ MACHINE_START_MEMBER(amstrad_state,gx4000) m_system_type = SYSTEM_GX4000; astring region_tag; - m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (!m_region_cart) // this should never happen, since we make carts mandatory! m_region_cart = memregion("maincpu"); } diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index bc16f55fcef..a3a1f517b8b 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -2036,19 +2036,19 @@ void bbc_state::bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, U astring region_tag; memory_region *tmp_reg; UINT8 *eprom[4]; - if (m_exp1 && (tmp_reg = memregion(region_tag.cpy(m_exp1->tag()).cat(GENERIC_ROM_REGION_TAG)))) + if (m_exp1 && (tmp_reg = memregion(region_tag.cpy(m_exp1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()))) eprom[0] = tmp_reg->base() + shift; else eprom[0] = m_region_opt->base() + 0x0000 + shift; - if (m_exp2 && (tmp_reg = memregion(region_tag.cpy(m_exp2->tag()).cat(GENERIC_ROM_REGION_TAG)))) + if (m_exp2 && (tmp_reg = memregion(region_tag.cpy(m_exp2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()))) eprom[1] = tmp_reg->base() + shift; else eprom[1] = m_region_opt->base() + 0x4000 + shift; - if (m_exp3 && (tmp_reg = memregion(region_tag.cpy(m_exp3->tag()).cat(GENERIC_ROM_REGION_TAG)))) + if (m_exp3 && (tmp_reg = memregion(region_tag.cpy(m_exp3->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()))) eprom[2] = tmp_reg->base() + shift; else eprom[2] = m_region_opt->base() + 0x8000 + shift; - if (m_exp4 && (tmp_reg = memregion(region_tag.cpy(m_exp4->tag()).cat(GENERIC_ROM_REGION_TAG)))) + if (m_exp4 && (tmp_reg = memregion(region_tag.cpy(m_exp4->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()))) eprom[3] = tmp_reg->base() + shift; else eprom[3] = m_region_opt->base() + 0xc000 + shift; @@ -2070,11 +2070,11 @@ void bbc_state::bbcm_setup_banks(memory_bank *membank, int banks, UINT32 shift, astring region_tag; memory_region *tmp_reg; UINT8 *eprom[2]; - if (m_exp1 && (tmp_reg = memregion(region_tag.cpy(m_exp1->tag()).cat(GENERIC_ROM_REGION_TAG)))) + if (m_exp1 && (tmp_reg = memregion(region_tag.cpy(m_exp1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()))) eprom[0] = tmp_reg->base() + shift; else eprom[0] = m_region_opt->base() + 0x0000 + shift; - if (m_exp2 && (tmp_reg = memregion(region_tag.cpy(m_exp2->tag()).cat(GENERIC_ROM_REGION_TAG)))) + if (m_exp2 && (tmp_reg = memregion(region_tag.cpy(m_exp2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()))) eprom[1] = tmp_reg->base() + shift; else eprom[1] = m_region_opt->base() + 0x8000 + shift; diff --git a/src/mess/machine/cuda.c b/src/mess/machine/cuda.c index 896fa3dd87a..aa2dc4e4222 100644 --- a/src/mess/machine/cuda.c +++ b/src/mess/machine/cuda.c @@ -439,7 +439,7 @@ void cuda_device::device_start() save_item(NAME(disk_pram)); astring tempstring; - UINT8 *rom = device().machine().root_device().memregion(device().subtag(tempstring, CUDA_CPU_TAG))->base(); + UINT8 *rom = device().machine().root_device().memregion(device().subtag(tempstring, CUDA_CPU_TAG).c_str())->base(); if (rom) { diff --git a/src/mess/machine/egret.c b/src/mess/machine/egret.c index 50b45811890..b8cb5e78cf6 100644 --- a/src/mess/machine/egret.c +++ b/src/mess/machine/egret.c @@ -388,7 +388,7 @@ void egret_device::device_start() save_item(NAME(disk_pram)); astring tempstring; - UINT8 *rom = device().machine().root_device().memregion(device().subtag(tempstring, EGRET_CPU_TAG))->base(); + UINT8 *rom = device().machine().root_device().memregion(device().subtag(tempstring, EGRET_CPU_TAG).c_str())->base(); if (rom) { diff --git a/src/mess/machine/electron.c b/src/mess/machine/electron.c index ca6efe3b4d6..d88d2cfcc2c 100644 --- a/src/mess/machine/electron.c +++ b/src/mess/machine/electron.c @@ -347,7 +347,7 @@ void electron_state::machine_start() { UINT8 *lo_rom, *up_rom; astring region_tag; - memory_region *cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + memory_region *cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); if (cart_rom) up_rom = cart_rom->base(); diff --git a/src/mess/machine/gamecom.c b/src/mess/machine/gamecom.c index 2395f30d318..49742f3ffa4 100644 --- a/src/mess/machine/gamecom.c +++ b/src/mess/machine/gamecom.c @@ -26,8 +26,8 @@ void gamecom_state::machine_reset() m_lcdc_reg = 0xb0; astring region_tag; - m_cart1_rom = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG)); - m_cart2_rom = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart1_rom = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); + m_cart2_rom = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); } void gamecom_state::gamecom_set_mmu(UINT8 mmu, UINT8 data) diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c index 51d41e42fdb..e5c0e96c1dd 100644 --- a/src/mess/machine/primo.c +++ b/src/mess/machine/primo.c @@ -243,8 +243,8 @@ void primo_state::primo_common_machine_init () void primo_state::machine_start() { astring region_tag; - m_cart1_rom = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG)); - m_cart2_rom = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart1_rom = memregion(region_tag.cpy(m_cart1->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); + m_cart2_rom = memregion(region_tag.cpy(m_cart2->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); } void primo_state::machine_reset() diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c index 3a16ff819a1..43533d4b1b3 100644 --- a/src/mess/machine/svi318.c +++ b/src/mess/machine/svi318.c @@ -422,7 +422,7 @@ DRIVER_INIT_MEMBER(svi318_state, svi328_806) void svi318_state::machine_start() { astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); m_bios_rom = memregion("maincpu"); // 80 column card start diff --git a/src/mess/machine/vtech2.c b/src/mess/machine/vtech2.c index e13f23c43da..98480ab5e6c 100644 --- a/src/mess/machine/vtech2.c +++ b/src/mess/machine/vtech2.c @@ -74,7 +74,7 @@ DRIVER_INIT_MEMBER(vtech2_state,laser) // check ROM expansion astring region_tag; - m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); + m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG).c_str()); for (i = 0; i < ARRAY_LENGTH(m_laser_bank); i++) m_laser_bank[i] = -1; diff --git a/src/osd/modules/debugger/debugint.c b/src/osd/modules/debugger/debugint.c index 545682b4456..9e2c988deff 100644 --- a/src/osd/modules/debugger/debugint.c +++ b/src/osd/modules/debugger/debugint.c @@ -484,7 +484,7 @@ static void dview_draw_title(DView *dv) if (!dv->title) return; - for (i=0; i<strlen(dv->title); i++) + for (i = 0; i<strlen(dv->title.c_str()); i++) { dview_draw_char(dv, RECT_DVIEW_TITLE, i * debug_font_width + BORDER_XTHICKNESS, BORDER_YTHICKNESS, debug_font_height, //r.max_y - 2 * BORDER_YTHICKNESS, @@ -1113,7 +1113,7 @@ static void render_editor(DView_edit *editor) editor->container->empty(); /* get the size of the text */ - editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str, 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, + editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, NULL); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(width, 0.5); @@ -1134,7 +1134,7 @@ static void render_editor(DView_edit *editor) y2 -= UI_BOX_TB_BORDER; /* draw the text within it */ - editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str, x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, + editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL); } @@ -1180,7 +1180,7 @@ static void CreateMainMenu(running_machine &machine) break; } - menu->item_append(title.cat(focus_view->title), NULL, MENU_FLAG_DISABLE, NULL); + menu->item_append(title.cat(focus_view->title).c_str(), NULL, MENU_FLAG_DISABLE, NULL); menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); switch (focus_view->type) @@ -1322,7 +1322,7 @@ static void handle_editor(running_machine &machine) render_editor(cur_editor); if (ui_input_pressed(machine, IPT_UI_SELECT)) { - process_string(focus_view, focus_view->editor.str); + process_string(focus_view, focus_view->editor.str.c_str()); focus_view->editor.str = ""; cur_editor = NULL; } diff --git a/src/osd/modules/debugger/qt/deviceinformationwindow.c b/src/osd/modules/debugger/qt/deviceinformationwindow.c index 8cb6300b510..ba0f06027a1 100644 --- a/src/osd/modules/debugger/qt/deviceinformationwindow.c +++ b/src/osd/modules/debugger/qt/deviceinformationwindow.c @@ -121,7 +121,7 @@ void DeviceInformationWindowQtConfig::applyToQWidget(QWidget* widget) void DeviceInformationWindowQtConfig::addToXmlDataNode(xml_data_node* node) const { WindowQtConfig::addToXmlDataNode(node); - xml_set_attribute(node, "device-tag", m_device_tag); + xml_set_attribute(node, "device-tag", m_device_tag.c_str()); } diff --git a/src/osd/modules/debugger/qt/mainwindow.c b/src/osd/modules/debugger/qt/mainwindow.c index f549012c756..8e07cd09c3e 100644 --- a/src/osd/modules/debugger/qt/mainwindow.c +++ b/src/osd/modules/debugger/qt/mainwindow.c @@ -234,7 +234,7 @@ void MainWindow::toggleBreakpointAtCursor(bool changedTo) { command.printf("bpclear 0x%X", bpindex); } - debug_console_execute_command(*m_machine, command, 1); + debug_console_execute_command(*m_machine, command.c_str(), 1); } refreshAll(); @@ -259,7 +259,7 @@ void MainWindow::enableBreakpointAtCursor(bool changedTo) INT32 const bpindex = bp->index(); astring command; command.printf(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", bpindex); - debug_console_execute_command(*m_machine, command, 1); + debug_console_execute_command(*m_machine, command.c_str(), 1); } } @@ -275,7 +275,7 @@ void MainWindow::runToCursor(bool changedTo) offs_t address = downcast<debug_view_disasm*>(dasmView)->selected_address(); astring command; command.printf("go 0x%X", address); - debug_console_execute_command(*m_machine, command, 1); + debug_console_execute_command(*m_machine, command.c_str(), 1); } } diff --git a/src/osd/modules/debugger/win/consolewininfo.c b/src/osd/modules/debugger/win/consolewininfo.c index e24271a6f50..892eec0768f 100644 --- a/src/osd/modules/debugger/win/consolewininfo.c +++ b/src/osd/modules/debugger/win/consolewininfo.c @@ -46,7 +46,7 @@ consolewin_info::consolewin_info(debugger_windows_interface &debugger) : { astring temp; temp.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[no image]"); - TCHAR *tc_buf = tstring_from_utf8(temp); + TCHAR *tc_buf = tstring_from_utf8(temp.c_str()); if (tc_buf != NULL) { AppendMenu(m_devices_menu, MF_ENABLED, 0, tc_buf); @@ -112,7 +112,7 @@ void consolewin_info::set_cpu(device_t &device) title.printf("Debug: %s - %s '%s'", device.machine().system().name, device.name(), device.tag()); win_get_window_text_utf8(window(), curtitle, ARRAY_LENGTH(curtitle)); if (title.cmp(curtitle) != 0) - win_set_window_text_utf8(window(), title); + win_set_window_text_utf8(window(), title.c_str()); // and recompute the children recompute_children(); @@ -203,7 +203,7 @@ void consolewin_info::update_menu() astring temp; temp.format("%s :%s", img->device().name(), img->exists() ? img->filename() : "[empty slot]"); - TCHAR *tc_buf = tstring_from_utf8(temp); + TCHAR *tc_buf = tstring_from_utf8(temp.c_str()); if (tc_buf != NULL) { ModifyMenu(m_devices_menu, cnt, MF_BYPOSITION | MF_POPUP, (UINT_PTR)devicesubmenu, tc_buf); @@ -229,7 +229,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) { astring filter; build_generic_filter(img, false, filter); - LPTSTR t_filter = tstring_from_utf8(filter); + LPTSTR t_filter = tstring_from_utf8(filter.c_str()); if (t_filter) { // convert a pipe-char delimited string into a NUL delimited string diff --git a/src/osd/modules/debugger/win/disasmbasewininfo.c b/src/osd/modules/debugger/win/disasmbasewininfo.c index c1b9ef5759e..c06c6cf1326 100644 --- a/src/osd/modules/debugger/win/disasmbasewininfo.c +++ b/src/osd/modules/debugger/win/disasmbasewininfo.c @@ -200,7 +200,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) command.printf("bpset 0x%X", address); else command.printf("bpclear 0x%X", bpindex); - debug_console_execute_command(machine(), command, 1); + debug_console_execute_command(machine(), command.c_str(), 1); } } return true; @@ -230,7 +230,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { astring command; command.printf(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", (UINT32)bp->index()); - debug_console_execute_command(machine(), command, 1); + debug_console_execute_command(machine(), command.c_str(), 1); } } } @@ -244,7 +244,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { astring command; command.printf("go 0x%X", address); - debug_console_execute_command(machine(), command, 1); + debug_console_execute_command(machine(), command.c_str(), 1); } else { diff --git a/src/osd/modules/debugger/win/disasmwininfo.c b/src/osd/modules/debugger/win/disasmwininfo.c index 9c6c02e23eb..59e97d6e0c1 100644 --- a/src/osd/modules/debugger/win/disasmwininfo.c +++ b/src/osd/modules/debugger/win/disasmwininfo.c @@ -145,5 +145,5 @@ void disasmwin_info::process_string(char const *string) void disasmwin_info::update_caption() { - win_set_window_text_utf8(window(), astring("Disassembly: ", m_views[0]->source_name())); + win_set_window_text_utf8(window(), astring("Disassembly: ", m_views[0]->source_name()).c_str()); } diff --git a/src/osd/modules/debugger/win/editwininfo.c b/src/osd/modules/debugger/win/editwininfo.c index f89c766ebd4..1ccd96ff7aa 100644 --- a/src/osd/modules/debugger/win/editwininfo.c +++ b/src/osd/modules/debugger/win/editwininfo.c @@ -51,7 +51,7 @@ bool editwin_info::restore_field(HWND wnd) { if (wnd == m_editwnd) { - set_editwnd_text(m_edit_defstr); + set_editwnd_text(m_edit_defstr.c_str()); editwnd_select_all(); return true; } @@ -206,7 +206,7 @@ LRESULT editwin_info::edit_proc(UINT message, WPARAM wparam, LPARAM lparam) if (_tcslen(buffer) > 0) { set_ignore_char_lparam(lparam); - set_editwnd_text(m_edit_defstr); + set_editwnd_text(m_edit_defstr.c_str()); editwnd_select_all(); } break; diff --git a/src/osd/modules/debugger/win/logwininfo.c b/src/osd/modules/debugger/win/logwininfo.c index 32e31bd48c8..5f8b28b9217 100644 --- a/src/osd/modules/debugger/win/logwininfo.c +++ b/src/osd/modules/debugger/win/logwininfo.c @@ -12,7 +12,7 @@ logwin_info::logwin_info(debugger_windows_interface &debugger) : - debugwin_info(debugger, false, astring("Errorlog: ", debugger.machine().system().description, " [", debugger.machine().system().name, "]"), NULL) + debugwin_info(debugger, false, astring("Errorlog: ", debugger.machine().system().description, " [", debugger.machine().system().name, "]").c_str(), NULL) { if (!window()) return; diff --git a/src/osd/modules/debugger/win/memorywininfo.c b/src/osd/modules/debugger/win/memorywininfo.c index 8de8749de7b..3e91168cb11 100644 --- a/src/osd/modules/debugger/win/memorywininfo.c +++ b/src/osd/modules/debugger/win/memorywininfo.c @@ -275,5 +275,5 @@ void memorywin_info::process_string(char const *string) void memorywin_info::update_caption() { - win_set_window_text_utf8(window(), astring("Memory: ", m_views[0]->source_name())); + win_set_window_text_utf8(window(), astring("Memory: ", m_views[0]->source_name()).c_str()); } diff --git a/src/osd/modules/debugger/win/pointswininfo.c b/src/osd/modules/debugger/win/pointswininfo.c index 87c981ef557..6395603ec6e 100644 --- a/src/osd/modules/debugger/win/pointswininfo.c +++ b/src/osd/modules/debugger/win/pointswininfo.c @@ -14,7 +14,7 @@ pointswin_info::pointswin_info(debugger_windows_interface &debugger) : - debugwin_info(debugger, false, astring("All Breakpoints"), NULL) + debugwin_info(debugger, false, astring("All Breakpoints").c_str(), NULL) { if (!window()) return; diff --git a/src/osd/modules/font/font_windows.c b/src/osd/modules/font/font_windows.c index 8263bc9020d..9056b98054a 100644 --- a/src/osd/modules/font/font_windows.c +++ b/src/osd/modules/font/font_windows.c @@ -68,7 +68,7 @@ bool osd_font_windows::open(const char *font_path, const char *_name, int &heigh logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; // copy in the face name - TCHAR *face = tstring_from_utf8(name); + TCHAR *face = tstring_from_utf8(name.c_str()); _tcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR)); logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR)-1] = 0; osd_free(face); @@ -89,7 +89,7 @@ bool osd_font_windows::open(const char *font_path, const char *_name, int &heigh // if it doesn't match our request, fail char *utf = utf8_from_tstring(realname); - int result = core_stricmp(utf, name); + int result = core_stricmp(utf, name.c_str()); osd_free(utf); // if we didn't match, nuke our font and fall back diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index dd703a697e6..baa317107fc 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -113,10 +113,10 @@ public: const char *aspect() const { return value(OSDOPTION_ASPECT); } const char *resolution() const { return value(OSDOPTION_RESOLUTION); } const char *view() const { return value(OSDOPTION_VIEW); } - const char *screen(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SCREEN, index)); } - const char *aspect(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_ASPECT, index)); } - const char *resolution(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_RESOLUTION, index)); } - const char *view(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_VIEW, index)); } + const char *screen(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SCREEN, index).c_str()); } + const char *aspect(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_ASPECT, index).c_str()); } + const char *resolution(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_RESOLUTION, index).c_str()); } + const char *view(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_VIEW, index).c_str()); } // full screen options bool switch_res() const { return bool_value(OSDOPTION_SWITCHRES); } @@ -136,12 +136,12 @@ public: bool gl_pbo() const { return bool_value(OSDOPTION_GL_PBO); } bool gl_glsl() const { return bool_value(OSDOPTION_GL_GLSL); } bool glsl_filter() const { return bool_value(OSDOPTION_GLSL_FILTER); } - const char *shader_mame(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SHADER_MAME, index)); } - const char *shader_screen(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SHADER_SCREEN, index)); } + const char *shader_mame(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SHADER_MAME, index).c_str()); } + const char *shader_screen(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SHADER_SCREEN, index).c_str()); } // CoreAudio specific options const char *audio_output() const { return value(OSDOPTION_AUDIO_OUTPUT); } - const char *audio_effect(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_AUDIO_EFFECT, index)); } + const char *audio_effect(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_AUDIO_EFFECT, index).c_str()); } private: static const options_entry s_option_entries[]; @@ -240,15 +240,15 @@ private: // FIXME: should be elsewhere osd_module *select_module_options(const core_options &opts, const astring &opt_name) { - astring opt_val = opts.value(opt_name); + astring opt_val = opts.value(opt_name.c_str()); if (opt_val == "auto") opt_val = ""; - else if (!m_mod_man.type_has_name(opt_name, opt_val)) + else if (!m_mod_man.type_has_name(opt_name.c_str(), opt_val.c_str())) { 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); + return m_mod_man.select_module(opt_name.c_str(), opt_val.c_str()); } template<class C> diff --git a/src/osd/modules/osdmodule.h b/src/osd/modules/osdmodule.h index 9c7e7a62e36..f8378fb6dcb 100644 --- a/src/osd/modules/osdmodule.h +++ b/src/osd/modules/osdmodule.h @@ -32,8 +32,8 @@ public: {} virtual ~osd_module() { } - const char * name() const { return m_name; } - const char * type() const { return m_type; } + const char * name() const { return m_name.c_str(); } + const char * type() const { return m_type.c_str(); } virtual bool probe() { return true; } diff --git a/src/osd/modules/render/d3d/d3dhlsl.c b/src/osd/modules/render/d3d/d3dhlsl.c index aac4e969257..9c854d1d889 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.c +++ b/src/osd/modules/render/d3d/d3dhlsl.c @@ -373,8 +373,8 @@ void shaders::render_snapshot(surface *surface) astring text1(emulator_info::get_appname(), " ", build_version); astring text2(machine->system().manufacturer, " ", machine->system().description); png_info pnginfo = { 0 }; - png_add_text(&pnginfo, "Software", text1); - png_add_text(&pnginfo, "System", text2); + png_add_text(&pnginfo, "Software", text1.c_str()); + png_add_text(&pnginfo, "System", text2.c_str()); // now do the actual work png_error error = png_write_bitmap(file, &pnginfo, avi_snap, 1 << 24, NULL); @@ -567,7 +567,7 @@ void shaders::begin_avi_recording(const char *name) if (filerr == FILERR_NONE) { // create the file and free the string - avi_error avierr = avi_create(fullpath, &info, &avi_output_file); + avi_error avierr = avi_create(fullpath.c_str(), &info, &avi_output_file); if (avierr != AVIERR_NONE) { osd_printf_error("Error creating AVI: %s\n", avi_error_string(avierr)); @@ -3402,12 +3402,12 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp // handle %d in the template (for image devices) astring snapdev("%d_"); - int pos = snapstr.find(0, snapdev); + int pos = snapstr.find(0, snapdev.c_str()); if (pos != -1) { // if more %d are found, revert to default and ignore them all - if (snapstr.find(pos + 3, snapdev) != -1) + if (snapstr.find(pos + 3, snapdev.c_str()) != -1) snapstr.cpy("%g/%i"); // else if there is a single %d, try to create the correct snapname else @@ -3453,7 +3453,7 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp filename.substr(0, filename.rchr(0, '.')); // setup snapname and remove the %d_ - snapstr.replace(0, snapdevname, filename); + snapstr.replace(0, snapdevname.c_str(), filename.c_str()); snapstr.del(pos, 3); name_found = 1; @@ -3492,7 +3492,7 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp 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); + file_error filerr = file.open(fname.c_str()); if (filerr != FILERR_NONE) break; } @@ -3500,5 +3500,5 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp // create the final file file.set_openflags(origflags); - return file.open(fname); + return file.open(fname.c_str()); } diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c index 8648b77a6a6..5fab6a71fde 100644 --- a/src/osd/sdl/input.c +++ b/src/osd/sdl/input.c @@ -687,14 +687,14 @@ static device_info *devmap_class_register(running_machine &machine, device_map_t { sprintf(tempname, "NC%d", index); devinfo = generic_device_alloc(devlist, tempname); - devinfo->device = machine.input().device_class(devclass).add_device(devinfo->name, devinfo); + devinfo->device = machine.input().device_class(devclass).add_device(devinfo->name.c_str(), devinfo); } return NULL; } else { devinfo = generic_device_alloc(devlist, devmap->map[index].name); - devinfo->device = machine.input().device_class(devclass).add_device(devinfo->name, devinfo); + devinfo->device = machine.input().device_class(devclass).add_device(devinfo->name.c_str(), devinfo); } return devinfo; } diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h index 66cea9a964e..c1dd01cd837 100644 --- a/src/osd/sdl/osdsdl.h +++ b/src/osd/sdl/osdsdl.h @@ -119,12 +119,12 @@ public: const char *ui_mode_key() const { return value(SDLOPTION_UIMODEKEY); } // joystick mapping - const char *joy_index(int index) const { astring temp; return value(temp.format("%s%d", SDLOPTION_JOYINDEX, index)); } + const char *joy_index(int index) const { astring temp; return value(temp.format("%s%d", SDLOPTION_JOYINDEX, index).c_str()); } bool sixaxis() const { return bool_value(SDLOPTION_SIXAXIS); } #if (SDLMAME_SDL2) - const char *mouse_index(int index) const { astring temp; return value(temp.format("%s%d", SDLOPTION_MOUSEINDEX, index)); } - const char *keyboard_index(int index) const { astring temp; return value(temp.format("%s%d", SDLOPTION_KEYBINDEX, index)); } + const char *mouse_index(int index) const { astring temp; return value(temp.format("%s%d", SDLOPTION_MOUSEINDEX, index).c_str()); } + const char *keyboard_index(int index) const { astring temp; return value(temp.format("%s%d", SDLOPTION_KEYBINDEX, index).c_str()); } #endif const char *video_driver() const { return value(SDLOPTION_VIDEODRIVER); } diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index 06d1ce462e0..d3615b88d97 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -591,7 +591,7 @@ void windows_osd_interface::init(running_machine &machine) for (win_window_info *info = win_window_list; info != NULL; info = info->m_next) { tempstring.printf("Orientation(%s)", info->m_monitor->devicename()); - output_set_value(tempstring, info->m_targetorient); + output_set_value(tempstring.c_str(), info->m_targetorient); } // hook up the debugger log @@ -1062,7 +1062,7 @@ const char *symbol_manager::symbol_for_address(FPTR address) else scan_file_for_address(address, false); } - return m_buffer; + return m_buffer.c_str(); } @@ -1116,13 +1116,13 @@ void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) #ifdef __GNUC__ // see if we have a symbol file (gcc only) - srcfile = fopen(m_symfile, "r"); + srcfile = fopen(m_symfile.c_str(), "r"); is_symfile = (srcfile != NULL); #endif // if not, see if we have a map file if (srcfile == NULL) - srcfile = fopen(m_mapfile, "r"); + srcfile = fopen(m_mapfile.c_str(), "r"); // if not, fail if (srcfile == NULL) @@ -1153,7 +1153,7 @@ void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) // also create a cache entry if we can if (create_cache) - m_cache.append(*global_alloc(cache_entry(addr, symbol))); + m_cache.append(*global_alloc(cache_entry(addr, symbol.c_str()))); } } @@ -1161,7 +1161,7 @@ void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) fclose(srcfile); // format the symbol and remember the last base - format_symbol(best_symbol, address - best_addr); + format_symbol(best_symbol.c_str(), address - best_addr); m_last_base = best_addr; } @@ -1188,7 +1188,7 @@ void symbol_manager::scan_cache_for_address(FPTR address) } // format the symbol and remember the last base - format_symbol(best_symbol, address - best_addr); + format_symbol(best_symbol.c_str(), address - best_addr); m_last_base = best_addr; } diff --git a/src/tools/chdman.c b/src/tools/chdman.c index c253c73b483..6978f191978 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -325,7 +325,7 @@ public: if (m_file != NULL) core_fclose(m_file); m_lastfile = m_info.track[tracknum].fname; - file_error filerr = core_fopen(m_lastfile, OPEN_FLAG_READ, &m_file); + file_error filerr = core_fopen(m_lastfile.c_str(), OPEN_FLAG_READ, &m_file); if (filerr != FILERR_NONE) report_error(1, "Error opening input file (%s)'", m_lastfile.c_str()); } @@ -826,7 +826,7 @@ const char *big_int_string(astring &string, UINT64 intvalue) { // 0 is a special case if (intvalue == 0) - return string.cpy("0"); + return string.cpy("0").c_str(); // loop until all chunks are done string.reset(); @@ -840,11 +840,11 @@ const char *big_int_string(astring &string, UINT64 intvalue) insert.format((intvalue != 0) ? "%03d" : "%d", chunk); if (!first) - string.ins(0, ","); + string.ins(0, ",").c_str(); first = false; string.ins(0, insert); } - return string; + return string.c_str(); } @@ -855,7 +855,7 @@ const char *big_int_string(astring &string, UINT64 intvalue) const char *msf_string_from_frames(astring &string, UINT32 frames) { - return string.format("%02d:%02d:%02d", frames / (75 * 60), (frames / 75) % 60, frames % 75); + return string.format("%02d:%02d:%02d", frames / (75 * 60), (frames / 75) % 60, frames % 75).c_str(); } @@ -899,7 +899,7 @@ UINT64 parse_number(const char *string) static void guess_chs(astring *filename, UINT64 filesize, int sectorsize, UINT32 &cylinders, UINT32 &heads, UINT32 §ors, UINT32 &bps) { // if this is a direct physical drive read, handle it specially - if (filename != NULL && osd_get_physical_drive_geometry(*filename, &cylinders, &heads, §ors, &bps)) + if (filename != NULL && osd_get_physical_drive_geometry(filename->c_str(), &cylinders, &heads, §ors, &bps)) return; // if we have no length to work with, we can't guess @@ -938,7 +938,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp astring *input_chd_parent_str = params.find(OPTION_INPUT_PARENT); if (input_chd_parent_str != NULL) { - chd_error err = input_parent_chd.open(*input_chd_parent_str); + chd_error err = input_parent_chd.open(input_chd_parent_str->c_str()); if (err != CHDERR_NONE) report_error(1, "Error opening parent CHD file (%s): %s", input_chd_parent_str->c_str(), chd_file::error_string(err)); } @@ -947,7 +947,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp astring *input_chd_str = params.find(OPTION_INPUT); if (input_chd_str != NULL) { - chd_error err = input_chd.open(*input_chd_str, writeable, input_parent_chd.opened() ? &input_parent_chd : NULL); + chd_error err = input_chd.open(input_chd_str->c_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->c_str(), chd_file::error_string(err)); } @@ -970,11 +970,11 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz astring *input_start_hunk_str = params.find(OPTION_INPUT_START_HUNK); astring *input_start_frame_str = params.find(OPTION_INPUT_START_FRAME); if (input_start_byte_str != NULL) - input_start = parse_number(*input_start_byte_str); + input_start = parse_number(input_start_byte_str->c_str()); if (input_start_hunk_str != NULL) - input_start = parse_number(*input_start_hunk_str) * hunkbytes; + input_start = parse_number(input_start_hunk_str->c_str()) * hunkbytes; if (input_start_frame_str != NULL) - input_start = parse_number(*input_start_frame_str) * framebytes; + input_start = parse_number(input_start_frame_str->c_str()) * framebytes; if (input_start >= input_end) report_error(1, "Input start offset greater than input file size"); @@ -984,11 +984,11 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz astring *input_length_frames_str = params.find(OPTION_INPUT_LENGTH_FRAMES); UINT64 input_length = input_end; if (input_length_bytes_str != NULL) - input_length = parse_number(*input_length_bytes_str); + input_length = parse_number(input_length_bytes_str->c_str()); if (input_length_hunks_str != NULL) - input_length = parse_number(*input_length_hunks_str) * hunkbytes; + input_length = parse_number(input_length_hunks_str->c_str()) * hunkbytes; if (input_length_frames_str != NULL) - input_length = parse_number(*input_length_frames_str) * framebytes; + input_length = parse_number(input_length_frames_str->c_str()) * framebytes; if (input_start + input_length < input_end) input_end = input_start + input_length; } @@ -1026,7 +1026,7 @@ static astring *parse_output_chd_parameters(const parameters_t ¶ms, chd_file astring *output_chd_parent_str = params.find(OPTION_OUTPUT_PARENT); if (output_chd_parent_str != NULL) { - chd_error err = output_parent_chd.open(*output_chd_parent_str); + chd_error err = output_parent_chd.open(output_chd_parent_str->c_str()); if (err != CHDERR_NONE) report_error(1, "Error opening parent CHD file (%s): %s", output_chd_parent_str->c_str(), chd_file::error_string(err)); } @@ -1034,7 +1034,7 @@ static astring *parse_output_chd_parameters(const parameters_t ¶ms, chd_file // process output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - check_existing_output_file(params, *output_chd_str); + check_existing_output_file(params, output_chd_str->c_str()); return output_chd_str; } @@ -1049,7 +1049,7 @@ static void parse_hunk_size(const parameters_t ¶ms, UINT32 required_granular astring *hunk_size_str = params.find(OPTION_HUNK_SIZE); if (hunk_size_str != NULL) { - hunk_size = parse_number(*hunk_size_str); + hunk_size = parse_number(hunk_size_str->c_str()); if (hunk_size < 16 || hunk_size > 1024 * 1024) report_error(1, "Invalid hunk size"); if (hunk_size % required_granularity != 0) @@ -1110,7 +1110,7 @@ static void parse_numprocessors(const parameters_t ¶ms) if (numprocessors_str == NULL) return; - int count = atoi(*numprocessors_str); + int count = atoi(numprocessors_str->c_str()); if (count > 0) { extern int osd_num_processors; @@ -1129,7 +1129,7 @@ static const char *compression_string(astring &string, chd_codec_type compressio // output compression types string.reset(); if (compression[0] == CHD_CODEC_NONE) - return string.cpy("none"); + return string.cpy("none").c_str(); // iterate over types for (int index = 0; index < 4; index++) @@ -1142,7 +1142,7 @@ static const char *compression_string(astring &string, chd_codec_type compressio string.cat((type >> 24) & 0xff).cat((type >> 16) & 0xff).cat((type >> 8) & 0xff).cat(type & 0xff); string.cat(" (").cat(chd_codec_list::codec_name(type)).cat(")"); } - return string; + return string.c_str(); } @@ -1566,7 +1566,7 @@ static void do_create_raw(parameters_t ¶ms) astring *input_file_str = params.find(OPTION_INPUT); if (input_file_str != NULL) { - file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file); + file_error filerr = core_fopen(input_file_str->c_str(), OPEN_FLAG_READ, &input_file); if (filerr != FILERR_NONE) report_error(1, "Unable to open file (%s)", input_file_str->c_str()); } @@ -1584,7 +1584,7 @@ static void do_create_raw(parameters_t ¶ms) astring *unit_size_str = params.find(OPTION_UNIT_SIZE); if (unit_size_str != NULL) { - unit_size = parse_number(*unit_size_str); + unit_size = parse_number(unit_size_str->c_str()); if (hunk_size % unit_size != 0) report_error(1, "Unit size is not an even divisor of the hunk size"); } @@ -1625,9 +1625,9 @@ static void do_create_raw(parameters_t ¶ms) chd = new chd_rawfile_compressor(input_file, input_start, input_end); chd_error err; if (output_parent.opened()) - err = chd->create(*output_chd_str, input_end - input_start, hunk_size, compression, output_parent); + err = chd->create(output_chd_str->c_str(), input_end - input_start, hunk_size, compression, output_parent); else - err = chd->create(*output_chd_str, input_end - input_start, hunk_size, unit_size, compression); + err = chd->create(output_chd_str->c_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->c_str(), chd_file::error_string(err)); @@ -1645,7 +1645,7 @@ static void do_create_raw(parameters_t ¶ms) // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - osd_rmfile(*output_chd_str); + osd_rmfile(output_chd_str->c_str()); throw; } } @@ -1663,7 +1663,7 @@ static void do_create_hd(parameters_t ¶ms) astring *input_file_str = params.find(OPTION_INPUT); if (input_file_str != NULL) { - file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file); + file_error filerr = core_fopen(input_file_str->c_str(), OPEN_FLAG_READ, &input_file); if (filerr != FILERR_NONE) report_error(1, "Unable to open file (%s)", input_file_str->c_str()); } @@ -1679,7 +1679,7 @@ static void do_create_hd(parameters_t ¶ms) { if (output_parent.opened()) report_error(1, "Sector size does not apply when creating a diff from the parent"); - sector_size = parse_number(*sectorsize_str); + sector_size = parse_number(sectorsize_str->c_str()); } // process hunk size (needs to know sector_size) @@ -1700,7 +1700,7 @@ static void do_create_hd(parameters_t ¶ms) astring *size_str = params.find(OPTION_SIZE); if (size_str != NULL) { - if (sscanf(*size_str, "%" I64FMT"d", &filesize) != 1) + if (sscanf(size_str->c_str(), "%" I64FMT"d", &filesize) != 1) report_error(1, "Invalid size string"); } } @@ -1726,7 +1726,7 @@ static void do_create_hd(parameters_t ¶ms) { if (output_parent.opened()) report_error(1, "CHS does not apply when creating a diff from the parent"); - if (sscanf(*chs_str, "%d,%d,%d", &cylinders, &heads, §ors) != 3) + if (sscanf(chs_str->c_str(), "%d,%d,%d", &cylinders, &heads, §ors) != 3) report_error(1, "Invalid CHS string; must be of the form <cylinders>,<heads>,<sectors>"); } @@ -1738,7 +1738,7 @@ static void do_create_hd(parameters_t ¶ms) if (ident_str != NULL) { // load the file - file_error filerr = core_fload(*ident_str, identdata); + file_error filerr = core_fload(ident_str->c_str(), identdata); if (filerr != FILERR_NONE) report_error(1, "Error reading ident file (%s)", ident_str->c_str()); @@ -1756,7 +1756,7 @@ static void do_create_hd(parameters_t ¶ms) astring metadata; if (output_parent.read_metadata(HARD_DISK_METADATA_TAG, 0, metadata) != CHDERR_NONE) report_error(1, "Unable to find hard disk metadata in parent CHD"); - if (sscanf(metadata, HARD_DISK_METADATA_FORMAT, &cylinders, &heads, §ors, §or_size) != 4) + if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &cylinders, &heads, §ors, §or_size) != 4) report_error(1, "Error parsing hard disk metadata in parent CHD"); } @@ -1803,9 +1803,9 @@ static void do_create_hd(parameters_t ¶ms) chd = new chd_rawfile_compressor(input_file, input_start, input_end); chd_error err; if (output_parent.opened()) - err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(sector_size), hunk_size, compression, output_parent); + err = chd->create(output_chd_str->c_str(), UINT64(totalsectors) * UINT64(sector_size), hunk_size, compression, output_parent); else - err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(sector_size), hunk_size, sector_size, compression); + err = chd->create(output_chd_str->c_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->c_str(), chd_file::error_string(err)); @@ -1835,7 +1835,7 @@ static void do_create_hd(parameters_t ¶ms) // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - osd_rmfile(*output_chd_str); + osd_rmfile(output_chd_str->c_str()); throw; } } @@ -1854,7 +1854,7 @@ static void do_create_cd(parameters_t ¶ms) astring *input_file_str = params.find(OPTION_INPUT); if (input_file_str != NULL) { - chd_error err = chdcd_parse_toc(*input_file_str, toc, track_info); + chd_error err = chdcd_parse_toc(input_file_str->c_str(), toc, track_info); if (err != CHDERR_NONE) report_error(1, "Error parsing input file (%s: %s)\n", input_file_str->c_str(), chd_file::error_string(err)); } @@ -1906,9 +1906,9 @@ static void do_create_cd(parameters_t ¶ms) chd = new chd_cd_compressor(toc, track_info); chd_error err; if (output_parent.opened()) - err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, compression, output_parent); + err = chd->create(output_chd_str->c_str(), UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, compression, output_parent); else - err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, CD_FRAME_SIZE, compression); + err = chd->create(output_chd_str->c_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->c_str(), chd_file::error_string(err)); @@ -1927,7 +1927,7 @@ static void do_create_cd(parameters_t ¶ms) // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - osd_rmfile(*output_chd_str); + osd_rmfile(output_chd_str->c_str()); throw; } } @@ -1945,7 +1945,7 @@ static void do_create_ld(parameters_t ¶ms) astring *input_file_str = params.find(OPTION_INPUT); if (input_file_str != NULL) { - avi_error avierr = avi_open(*input_file_str, &input_file); + avi_error avierr = avi_open(input_file_str->c_str(), &input_file); if (avierr != AVIERR_NONE) report_error(1, "Error opening AVI file (%s): %s\n", input_file_str->c_str(), avi_error_string(avierr)); } @@ -2024,9 +2024,9 @@ static void do_create_ld(parameters_t ¶ms) chd = new chd_avi_compressor(*input_file, info, input_start, input_end); chd_error err; if (output_parent.opened()) - err = chd->create(*output_chd_str, UINT64(input_end - input_start) * hunk_size, hunk_size, compression, output_parent); + err = chd->create(output_chd_str->c_str(), UINT64(input_end - input_start) * hunk_size, hunk_size, compression, output_parent); else - err = chd->create(*output_chd_str, UINT64(input_end - input_start) * hunk_size, hunk_size, info.bytes_per_frame, compression); + err = chd->create(output_chd_str->c_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->c_str(), chd_file::error_string(err)); @@ -2055,7 +2055,7 @@ static void do_create_ld(parameters_t ¶ms) // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - osd_rmfile(*output_chd_str); + osd_rmfile(output_chd_str->c_str()); throw; } } @@ -2133,9 +2133,9 @@ static void do_copy(parameters_t ¶ms) chd = new chd_chdfile_compressor(input_chd, input_start, input_end); chd_error err; if (output_parent.opened()) - err = chd->create(*output_chd_str, input_end - input_start, hunk_size, compression, output_parent); + err = chd->create(output_chd_str->c_str(), input_end - input_start, hunk_size, compression, output_parent); else - err = chd->create(*output_chd_str, input_end - input_start, hunk_size, input_chd.unit_bytes(), compression); + err = chd->create(output_chd_str->c_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->c_str(), chd_file::error_string(err)); @@ -2191,7 +2191,7 @@ static void do_copy(parameters_t ¶ms) // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - osd_rmfile(*output_chd_str); + osd_rmfile(output_chd_str->c_str()); throw; } } @@ -2217,7 +2217,7 @@ static void do_extract_raw(parameters_t ¶ms) // verify output file doesn't exist astring *output_file_str = params.find(OPTION_OUTPUT); if (output_file_str != NULL) - check_existing_output_file(params, *output_file_str); + check_existing_output_file(params, output_file_str->c_str()); // print some info astring tempstr; @@ -2234,7 +2234,7 @@ static void do_extract_raw(parameters_t ¶ms) try { // process output file - file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file); + file_error filerr = core_fopen(output_file_str->c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file); if (filerr != FILERR_NONE) report_error(1, "Unable to open file (%s)", output_file_str->c_str()); @@ -2269,7 +2269,7 @@ static void do_extract_raw(parameters_t ¶ms) if (output_file != NULL) { core_fclose(output_file); - osd_rmfile(*output_file_str); + osd_rmfile(output_file_str->c_str()); } throw; } @@ -2297,7 +2297,7 @@ static void do_extract_cd(parameters_t ¶ms) // verify output file doesn't exist astring *output_file_str = params.find(OPTION_OUTPUT); if (output_file_str != NULL) - check_existing_output_file(params, *output_file_str); + check_existing_output_file(params, output_file_str->c_str()); // verify output BIN file doesn't exist astring *output_bin_file_str = params.find(OPTION_OUTPUT_BIN); @@ -2310,7 +2310,7 @@ static void do_extract_cd(parameters_t ¶ms) default_name.cat(".bin"); if (output_bin_file_str == NULL) output_bin_file_str = &default_name; - check_existing_output_file(params, *output_bin_file_str); + check_existing_output_file(params, output_bin_file_str->c_str()); // print some info astring tempstr; @@ -2335,14 +2335,14 @@ static void do_extract_cd(parameters_t ¶ms) } // process output file - file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &output_toc_file); + file_error filerr = core_fopen(output_file_str->c_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->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); + filerr = core_fopen(output_bin_file_str->c_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->c_str()); } @@ -2382,7 +2382,7 @@ static void do_extract_cd(parameters_t ¶ms) output_bin_file = NULL; } - filerr = core_fopen(trackbin_name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file); + filerr = core_fopen(trackbin_name.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file); if (filerr != FILERR_NONE) report_error(1, "Unable to open file (%s)", trackbin_name.c_str()); @@ -2394,11 +2394,11 @@ static void do_extract_cd(parameters_t ¶ms) astring temp; if (mode == MODE_GDI) { - output_track_metadata(mode, output_toc_file, tracknum, trackinfo, core_filename_extract_base(temp,trackbin_name), discoffs, outputoffs); + output_track_metadata(mode, output_toc_file, tracknum, trackinfo, core_filename_extract_base(temp, trackbin_name.c_str()).c_str(), discoffs, outputoffs); } else { - output_track_metadata(mode, output_toc_file, tracknum, trackinfo, core_filename_extract_base(temp,*output_bin_file_str), discoffs, outputoffs); + output_track_metadata(mode, output_toc_file, tracknum, trackinfo, core_filename_extract_base(temp, output_bin_file_str->c_str()).c_str(), discoffs, outputoffs); } // If this is bin/cue output and the CHD contains subdata, warn the user and don't include @@ -2470,8 +2470,8 @@ static void do_extract_cd(parameters_t ¶ms) core_fclose(output_bin_file); if (output_toc_file != NULL) core_fclose(output_toc_file); - osd_rmfile(*output_bin_file_str); - osd_rmfile(*output_file_str); + osd_rmfile(output_bin_file_str->c_str()); + osd_rmfile(output_file_str->c_str()); throw; } } @@ -2507,7 +2507,7 @@ static void do_extract_ld(parameters_t ¶ms) { int fps; int fpsfrac; - if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) + if (sscanf(metadata.c_str(), AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) report_error(1, "Improperly formatted A/V metadata found"); fps_times_1million = fps * 1000000 + fpsfrac; } @@ -2544,7 +2544,7 @@ static void do_extract_ld(parameters_t ¶ms) // verify output file doesn't exist astring *output_file_str = params.find(OPTION_OUTPUT); if (output_file_str != NULL) - check_existing_output_file(params, *output_file_str); + check_existing_output_file(params, output_file_str->c_str()); // print some info astring tempstr; @@ -2561,7 +2561,7 @@ static void do_extract_ld(parameters_t ¶ms) try { // process output file - avi_error avierr = avi_create(*output_file_str, &info, &output_file); + avi_error avierr = avi_create(output_file_str->c_str(), &info, &output_file); if (avierr != AVIERR_NONE) report_error(1, "Unable to open file (%s)", output_file_str->c_str()); @@ -2621,7 +2621,7 @@ static void do_extract_ld(parameters_t ¶ms) // delete the output file if (output_file != NULL) avi_close(output_file); - osd_rmfile(*output_file_str); + osd_rmfile(output_file_str->c_str()); throw; } } @@ -2652,7 +2652,7 @@ static void do_add_metadata(parameters_t ¶ms) UINT32 index = 0; astring *index_str = params.find(OPTION_INDEX); if (index_str != NULL) - index = atoi(*index_str); + index = atoi(index_str->c_str()); // process text input astring *text_str = params.find(OPTION_VALUE_TEXT); @@ -2669,7 +2669,7 @@ static void do_add_metadata(parameters_t ¶ms) dynamic_buffer file; if (file_str != NULL) { - file_error filerr = core_fload(*file_str, file); + file_error filerr = core_fload(file_str->c_str(), file); if (filerr != FILERR_NONE) report_error(1, "Error reading metadata file (%s)", file_str->c_str()); } @@ -2732,7 +2732,7 @@ static void do_del_metadata(parameters_t ¶ms) UINT32 index = 0; astring *index_str = params.find(OPTION_INDEX); if (index_str != NULL) - index = atoi(*index_str); + index = atoi(index_str->c_str()); // print some info astring tempstr; @@ -2763,7 +2763,7 @@ static void do_dump_metadata(parameters_t ¶ms) // verify output file doesn't exist astring *output_file_str = params.find(OPTION_OUTPUT); if (output_file_str != NULL) - check_existing_output_file(params, *output_file_str); + check_existing_output_file(params, output_file_str->c_str()); // process tag chd_metadata_tag tag = CHD_MAKE_TAG('?','?','?','?'); @@ -2778,7 +2778,7 @@ static void do_dump_metadata(parameters_t ¶ms) UINT32 index = 0; astring *index_str = params.find(OPTION_INDEX); if (index_str != NULL) - index = atoi(*index_str); + index = atoi(index_str->c_str()); // write the metadata dynamic_buffer buffer; @@ -2793,7 +2793,7 @@ static void do_dump_metadata(parameters_t ¶ms) // create the file if (output_file_str != NULL) { - file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file); + file_error filerr = core_fopen(output_file_str->c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file); if (filerr != FILERR_NONE) report_error(1, "Unable to open file (%s)", output_file_str->c_str()); @@ -2820,7 +2820,7 @@ static void do_dump_metadata(parameters_t ¶ms) // delete the output file if (output_file != NULL) core_fclose(output_file); - osd_rmfile(*output_file_str); + osd_rmfile(output_file_str->c_str()); throw; } } diff --git a/src/tools/ldresample.c b/src/tools/ldresample.c index 7851814e0aa..f1718e7297d 100644 --- a/src/tools/ldresample.c +++ b/src/tools/ldresample.c @@ -177,7 +177,7 @@ static chd_error open_chd(chd_file &file, const char *filename, movie_info &info // extract the info int fps, fpsfrac, width, height, interlaced, channels, rate; - if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) + if (sscanf(metadata.c_str(), AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) { fprintf(stderr, "Improperly formatted metadata\n"); return CHDERR_INVALID_DATA; diff --git a/src/tools/ldverify.c b/src/tools/ldverify.c index 2d8ff1365d2..664112e60f0 100644 --- a/src/tools/ldverify.c +++ b/src/tools/ldverify.c @@ -194,7 +194,7 @@ static void *open_chd(const char *filename, movie_info &info) // extract the info int fps, fpsfrac, width, height, interlaced, channels, rate; - if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) + if (sscanf(metadata.c_str(), AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7) { fprintf(stderr, "Improperly formatted metadata\n"); delete chd; diff --git a/src/tools/pngcmp.c b/src/tools/pngcmp.c index 139c196dce0..3fa7e8ba724 100644 --- a/src/tools/pngcmp.c +++ b/src/tools/pngcmp.c @@ -80,7 +80,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c int x, y; /* open the source image */ - filerr = core_fopen(imgfile1, OPEN_FLAG_READ, &file); + filerr = core_fopen(imgfile1.c_str(), OPEN_FLAG_READ, &file); if (filerr != FILERR_NONE) { printf("Could not open %s (%d)\n", imgfile1.c_str(), filerr); @@ -97,7 +97,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c } /* open the source image */ - filerr = core_fopen(imgfile2, OPEN_FLAG_READ, &file); + filerr = core_fopen(imgfile2.c_str(), OPEN_FLAG_READ, &file); if (filerr != FILERR_NONE) { printf("Could not open %s (%d)\n", imgfile2.c_str(), filerr); @@ -170,7 +170,7 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c } /* write the final PNG */ - filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file); + filerr = core_fopen(outfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file); if (filerr != FILERR_NONE) { printf("Could not open %s (%d)\n", outfilename.c_str(), filerr); @@ -193,6 +193,6 @@ static int generate_png_diff(const astring& imgfile1, const astring& imgfile2, c error: if (error == -1) - osd_rmfile(outfilename); + osd_rmfile(outfilename.c_str()); return error; } diff --git a/src/tools/regrep.c b/src/tools/regrep.c index 534703cb5e2..c6b27f99192 100644 --- a/src/tools/regrep.c +++ b/src/tools/regrep.c @@ -235,7 +235,7 @@ int main(int argc, char *argv[]) /* read the template file into an astring */ astring tempheader; - if (core_fload(tempfilename, &buffer, &bufsize) == FILERR_NONE) + if (core_fload(tempfilename.c_str(), &buffer, &bufsize) == FILERR_NONE) { tempheader.cpy((const char *)buffer, bufsize); osd_free(buffer); @@ -565,12 +565,12 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp core_file *file; /* create the indexfile */ - if (core_fopen(filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS | OPEN_FLAG_NO_BOM, &file) != FILERR_NONE) + if (core_fopen(filename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS | OPEN_FLAG_NO_BOM, &file) != FILERR_NONE) return NULL; /* print a header */ astring modified(templatefile); - modified.replace("<!--TITLE-->", title); + modified.replace("<!--TITLE-->", title.c_str()); core_fwrite(file, modified.c_str(), modified.len()); /* return the file */ @@ -586,7 +586,7 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp static void output_footer_and_close_file(core_file *file, astring &templatefile, astring &title) { astring modified(templatefile); - modified.replace(0, "<!--TITLE-->", title); + modified.replace(0, "<!--TITLE-->", title.c_str()); core_fwrite(file, modified.c_str(), modified.len()); core_fclose(file); } @@ -735,7 +735,7 @@ static int compare_screenshots(summary_file *curfile) fullname.printf("%s" PATH_SEPARATOR "snap" PATH_SEPARATOR "%s" PATH_SEPARATOR "final.png", lists[listnum].dir, curfile->name); /* open the file */ - filerr = core_fopen(fullname, OPEN_FLAG_READ, &file); + filerr = core_fopen(fullname.c_str(), OPEN_FLAG_READ, &file); /* if that failed, look in the old location */ if (filerr != FILERR_NONE) @@ -744,7 +744,7 @@ static int compare_screenshots(summary_file *curfile) fullname.printf("%s" PATH_SEPARATOR "snap" PATH_SEPARATOR "_%s.png", lists[listnum].dir, curfile->name); /* open the file */ - filerr = core_fopen(fullname, OPEN_FLAG_READ, &file); + filerr = core_fopen(fullname.c_str(), OPEN_FLAG_READ, &file); } /* if that worked, load the file */ @@ -853,7 +853,7 @@ static int generate_png_diff(const summary_file *curfile, astring &destdir, cons tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.c_str()); /* open the source image */ - filerr = core_fopen(tempname, OPEN_FLAG_READ, &file); + filerr = core_fopen(tempname.c_str(), OPEN_FLAG_READ, &file); if (filerr != FILERR_NONE) goto error; @@ -925,7 +925,7 @@ static int generate_png_diff(const summary_file *curfile, astring &destdir, cons } /* write the final PNG */ - filerr = core_fopen(dstfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file); + filerr = core_fopen(dstfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file); if (filerr != FILERR_NONE) goto error; pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL); @@ -938,7 +938,7 @@ static int generate_png_diff(const summary_file *curfile, astring &destdir, cons error: if (error) - osd_rmfile(dstfilename); + osd_rmfile(dstfilename.c_str()); return error; } diff --git a/src/tools/split.c b/src/tools/split.c index ec4a5434fcc..4e3d93c8bb8 100644 --- a/src/tools/split.c +++ b/src/tools/split.c @@ -120,7 +120,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi splitfilename.cpy(basename).cat(".split"); // create the split file - filerr = core_fopen(splitfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile); + filerr = core_fopen(splitfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile); if (filerr != FILERR_NONE) { fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.c_str()); @@ -156,7 +156,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi outfilename.printf("%s.%03d", basename, partnum); // create it - filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile); + filerr = core_fopen(outfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile); if (filerr != FILERR_NONE) { printf("\n"); @@ -193,7 +193,7 @@ cleanup: { core_fclose(splitfile); if (error != 0) - remove(splitfilename); + remove(splitfilename.c_str()); } if (infile != NULL) core_fclose(infile); @@ -201,7 +201,7 @@ cleanup: { core_fclose(outfile); if (error != 0) - remove(outfilename); + remove(outfilename.c_str()); } if (splitbuffer != NULL) free(splitbuffer); @@ -268,7 +268,7 @@ static int join_file(const char *filename, const char *outname, int write_output if (write_output) { // don't overwrite the original! - filerr = core_fopen(outfilename, OPEN_FLAG_READ, &outfile); + filerr = core_fopen(outfilename.c_str(), OPEN_FLAG_READ, &outfile); if (filerr == FILERR_NONE) { core_fclose(outfile); @@ -278,7 +278,7 @@ static int join_file(const char *filename, const char *outname, int write_output } // open the output for write - filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile); + filerr = core_fopen(outfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile); if (filerr != FILERR_NONE) { fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.c_str()); @@ -306,7 +306,7 @@ static int join_file(const char *filename, const char *outname, int write_output // read the file's contents infilename.ins(0, basepath); - filerr = core_fload(infilename, &splitbuffer, &length); + filerr = core_fload(infilename.c_str(), &splitbuffer, &length); if (filerr != FILERR_NONE) { printf("\n"); @@ -364,7 +364,7 @@ cleanup: { core_fclose(outfile); if (error != 0) - remove(outfilename); + remove(outfilename.c_str()); } if (splitbuffer != NULL) osd_free(splitbuffer); diff --git a/src/tools/src2html.c b/src/tools/src2html.c index 2f6d1a6ca6a..33dd77604f4 100644 --- a/src/tools/src2html.c +++ b/src/tools/src2html.c @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) // read the template file into an astring UINT32 bufsize; void *buffer; - if (core_fload(tempfilename, &buffer, &bufsize) == FILERR_NONE) + if (core_fload(tempfilename.c_str(), &buffer, &bufsize) == FILERR_NONE) { tempheader.cpy((const char *)buffer, bufsize); osd_free(buffer); @@ -347,7 +347,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring osd_dir_entry_type entry_type = typelist[entindex]; // open the directory and iterate through it - osd_directory *dir = osd_opendir(srcdir); + osd_directory *dir = osd_opendir(srcdir.c_str()); if (dir == NULL) { result = 1; @@ -411,7 +411,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // make sure we care, first file_type type = FILE_TYPE_INVALID; for (int extnum = 0; extnum < ARRAY_LENGTH(extension_lookup); extnum++) - if (core_filename_ends_with(curlist->name, extension_lookup[extnum].extension)) + if (core_filename_ends_with(curlist->name.c_str(), extension_lookup[extnum].extension)) { type = extension_lookup[extnum].type; break; @@ -517,7 +517,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & // open the source file core_file *src; - if (core_fopen(srcfile, OPEN_FLAG_READ, &src) != FILERR_NONE) + if (core_fopen(srcfile.c_str(), OPEN_FLAG_READ, &src) != FILERR_NONE) { fprintf(stderr, "Unable to read file '%s'\n", srcfile.c_str()); return 1; @@ -706,7 +706,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & // append a break and move on dstline.catprintf("\n"); - core_fputs(dst, dstline); + core_fputs(dst, dstline.c_str()); } // close tags @@ -733,7 +733,7 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp { // create the indexfile core_file *file; - if (core_fopen(filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS | OPEN_FLAG_NO_BOM, &file) != FILERR_NONE) + if (core_fopen(filename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS | OPEN_FLAG_NO_BOM, &file) != FILERR_NONE) return NULL; // print a header @@ -865,7 +865,7 @@ static bool find_include_file(astring &srcincpath, int srcrootlen, int dstrootle // see if we can open it core_file *testfile; - if (core_fopen(srcincpath, OPEN_FLAG_READ, &testfile) == FILERR_NONE) + if (core_fopen(srcincpath.c_str(), OPEN_FLAG_READ, &testfile) == FILERR_NONE) { // close the file core_fclose(testfile); |