From 7c0db7b2a69c6d7477c60c4a8ed7db4ef64da6a4 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 11 Apr 2015 15:10:16 +0200 Subject: [PATCH 1/4] prepare notes --- src/mess/drivers/hh_hmcs40.c | 39 ++++++++++++++++++------ src/mess/drivers/hh_tms1k.c | 6 ++-- src/mess/drivers/hh_ucom4.c | 57 +++++++++++++++++++++++++++++++----- 3 files changed, 82 insertions(+), 20 deletions(-) diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index a3c364e0b9a..ace823af2c0 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -19,6 +19,7 @@ @27 HD38800A 1981, Bandai Packri Monster (DM-21Z) *51 HD38800A 1981, Actronics(Hanzawa) Twinvader @70 HD38800A 1982, Coleco Galaxian + @73 HD38800A 1982, Mattel Star Hawk @23 HD38800B 1982, Tomy Kingman (THF-01II) *24 HD38800B 1982, Actronics(Hanzawa) Wanted G-Man @@ -43,6 +44,26 @@ ***************************************************************************/ + + + + +/*************************************************************************** + + Mattel Star Hawk (manufactured in Japan) + * PCBs are labeled Kaken, PT-317B + * Hitachi HD38800A73 MCU + * cyan/red VFD display Futaba DM-41ZK, with partial color overlay + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + + + + + + #include "emu.h" #include "cpu/hmcs40/hmcs40.h" #include "sound/speaker.h" @@ -287,7 +308,7 @@ INPUT_CHANGED_MEMBER(hh_hmcs40_state::single_interrupt_line) /*************************************************************************** Bambino Basketball - Dribble Away (manufactured in Japan) - * boards are labeled Emix Corp. ET-05 + * PCBs are labeled Emix Corp. ET-05 * Hitachi HD38750A08 MCU * green VFD display Emix-106, with bezel overlay @@ -399,7 +420,7 @@ MACHINE_CONFIG_END /*************************************************************************** Bandai Packri Monster (manufactured in Japan) - * board label DM-21ZA2 + * PCB label DM-21ZA2 * Hitachi HD38800A27 MCU * cyan/red/green VFD display Futaba DM-21ZK 2B, with bezel overlay @@ -731,7 +752,7 @@ MACHINE_CONFIG_END /*************************************************************************** Coleco Donkey Kong (manufactured in Taiwan) - * board label Coleco Rev C 75790 DK + * PCB label Coleco Rev C 75790 DK * Hitachi HD38820A45 MCU * cyan/red VFD display Futaba DM-47ZK 2K, with color overlay @@ -859,7 +880,7 @@ MACHINE_CONFIG_END /*************************************************************************** Coleco Galaxian (manufactured in Taiwan) - * board label Coleco Rev A 75718 + * PCB label Coleco Rev A 75718 * Hitachi HD38800A70 MCU * cyan/red VFD display Futaba DM-36Z 2H, with color overlay @@ -976,7 +997,7 @@ MACHINE_CONFIG_END /*************************************************************************** Coleco Pac-Man (manufactured in Taiwan) - * board label Coleco 75690 + * PCB label Coleco 75690 * Hitachi HD38820A28/29 MCU * cyan/red VFD display Futaba DM-34Z 2A, with color overlay @@ -1097,7 +1118,7 @@ MACHINE_CONFIG_END /*************************************************************************** Coleco Ms. Pac-Man (manufactured in Taiwan) - * board label Coleco 911171 + * PCB label Coleco 911171 * Hitachi HD38820A61 MCU * cyan/red VFD display Futaba DM-60Z 3I, with color overlay @@ -1501,7 +1522,7 @@ MACHINE_CONFIG_END /*************************************************************************** Tomy Kingman (manufactured in Japan) - * boards are labeled THF-01II 2E138E01/2E128E02 + * PCBs are labeled THF-01II 2E138E01/2E128E02 * Hitachi HD38800B23 MCU * cyan/red/blue VFD display Futaba DM-65ZK 3A @@ -1622,9 +1643,9 @@ MACHINE_CONFIG_END /*************************************************************************** Tomy(tronic) Tron (manufactured in Japan) - * boards are labeled THN-02 2E114E07 + * PCBs are labeled THN-02 2E114E07 * Hitachi HD38800A88 MCU - * cyan/red/green VFD display NEC FIP10AM24T + * cyan/red/green VFD display NEC FIP10AM24T no. 2-8 1 NOTE!: MESS external artwork is recommended diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index fe760123f50..6e3e26b4e0e 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -26,7 +26,7 @@ *MP2139 TMS1370? 1982, Gakken Galaxy Invader 1000 *MP2788 ? 1980, Bandai Flight Time (? note: VFD-capable) @MP3226 TMS1000 1978, Milton Bradley Simon - *MP3301 TMS1000 1979, Milton Bradley Bigtrak + *MP3301 TMS1000 1979, Milton Bradley Big Trak *MP3320A TMS1000 1979, Coleco Head to Head Basketball MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.c @MP3404 TMS1100 1978, Parker Brothers Merlin @@ -918,7 +918,7 @@ MACHINE_CONFIG_END /*************************************************************************** Entex Electronic Baseball 2 - * boards are labeled: ZENY + * PCBs are labeled: ZENY * TMS1000 MCU, MP0923 (die labeled MP0923) * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound @@ -1045,7 +1045,7 @@ MACHINE_CONFIG_END /*************************************************************************** Entex Electronic Baseball 3 - * boards are labeled: ZENY + * PCBs are labeled: ZENY * TMS1100NLL 6007 MP1204 (die labeled MP1204) * 2*SN75492N LED display driver * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c index bf972e13ed7..fbdbae3b3f5 100644 --- a/src/mess/drivers/hh_ucom4.c +++ b/src/mess/drivers/hh_ucom4.c @@ -12,6 +12,7 @@ @031 uPD553C 1979, Bambino Superstar Football (ET-03) *042 uPD552C 1979, Tomy Space Attack @048 uPD552C 1980, Tomy Tennis (TN-04) + @049 uPD553C 1979, Mego Mini-Vid Break Free @055 uPD553C 1980, Bambino Laser Fight (ET-12) *085 uPD650C 1980, Roland TR-808 *102 uPD553C 1981, Bandai Block Out @@ -19,15 +20,55 @@ *128 uPD650C 1982, Roland TR-606 133 uPD650C 1982, Roland TB-303 -> tb303.c @160 uPD553C 1982, Tomy Pac Man (TN-08) + @192 uPD553C 1982, Tomy Scramble (TN-10) @202 uPD553C 1982, Epoch Astro Command @206 uPD553C 1982, Epoch Dracula - *209 uPD553C 1982, Tomy Caveman (TN-12) + @209 uPD553C 1982, Tomy Caveman (TN-12) @258 uPD553C 1984, Tomy Alien Chase (TN-16) (* denotes not yet emulated by MESS, @ denotes it's in this driver) ***************************************************************************/ + + + +/*************************************************************************** + + Mego Mini-Vid Break Free (manufactured in Japan) + * PCB label Mego 79 rev F + * NEC uCOM-43 MCU, labeled D553C 031 + * cyan VFD display Futaba DM-4.5 91 + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + + +/*************************************************************************** + + Tomy(tronic) Caveman (manufactured in Japan) + * PCBs are labeled TN-12 2E114E03 + * NEC uCOM-43 MCU, labeled D553C 209 + * cyan/red/green VFD display NEC FIP8AM20T no. 2-42 + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + + +/*************************************************************************** + + Tomy(tronic) Scramble (manufactured in Japan) + * PCBs are labeled TN-10 2E114E01 + * NEC uCOM-43 MCU, labeled D553C 192 + * cyan/red/green VFD display NEC FIP10CM20T no. 2-41 + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + + #include "emu.h" #include "cpu/ucom4/ucom4.h" #include "sound/speaker.h" @@ -515,7 +556,7 @@ MACHINE_CONFIG_END Epoch Astro Command (manufactured in Japan) * PCB label 96111 * NEC uCOM-43 MCU, labeled D553C 202 - * cyan/red VFD display NEC FIP9AM20T NO.42, with color overlay + * cyan/red VFD display NEC FIP9AM20T no. 42-42, with color overlay (FIP=fluorescent indicator panel) known releases: - Japan: Astro Command @@ -624,7 +665,7 @@ MACHINE_CONFIG_END Epoch Dracula (manufactured in Japan) * PCB label 96121 * NEC uCOM-43 MCU, labeled D553C 206 - * cyan/red/green VFD display NEC FIP8BM20T (FIP=fluorescent indicator panel) + * cyan/red/green VFD display NEC FIP8BM20T no. 2-42 known releases: - Japan: Dracula House, yellow case @@ -717,9 +758,9 @@ MACHINE_CONFIG_END /*************************************************************************** Tomy(tronic) Tennis (manufactured in Japan) - * board labeled TOMY TN-04 TENNIS + * PCB labeled TOMY TN-04 TENNIS * NEC uCOM-44 MCU, labeled D552C 048 - * VFD display NEC FIP11AM15T + * VFD display NEC FIP11AM15T tube no. 0F The initial release of this game was in 1979, known as Pro-Tennis, it has a D553 instead of D552, with just a little over 50% ROM used. @@ -876,9 +917,9 @@ MACHINE_CONFIG_END /*************************************************************************** Tomy(tronic) Pac-Man (manufactured in Japan) - * boards are labeled TN-08 2E108E01 + * PCBs are labeled TN-08 2E108E01 * NEC uCOM-43 MCU, labeled D553C 160 - * cyan/red/green VFD display NEC FIP8AM18T + * cyan/red/green VFD display NEC FIP8AM18T no. 2-21 * bright yellow round casing known releases: @@ -984,7 +1025,7 @@ MACHINE_CONFIG_END /*************************************************************************** Tomy Alien Chase (manufactured in Japan) - * boards are labeled TN-16 2E121B01 + * PCBs are labeled TN-16 2E121B01 * NEC uCOM-43 MCU, labeled D553C 258 * red/green VFD display NEC FIP9AM24T, with color overlay, 2-sided* From 6b36c7ab225c4619dcb5ac33c34813a66277457e Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 11 Apr 2015 15:26:58 +0200 Subject: [PATCH 2/4] cstr() - > c_str() as preparation for move to std::string (nw) --- src/emu/addrmap.c | 2 +- src/emu/bus/a7800/a78_slot.c | 6 +- src/emu/bus/gba/gba_slot.c | 4 +- src/emu/bus/intv/slot.c | 4 +- src/emu/bus/megadrive/md_slot.c | 4 +- src/emu/bus/msx_slot/cartridge.c | 2 +- src/emu/bus/nes/nes_ines.inc | 2 +- src/emu/cheat.c | 16 +-- src/emu/clifront.c | 40 +++--- src/emu/cpu/drcbex64.c | 4 +- src/emu/cpu/drcbex86.c | 4 +- src/emu/cpu/drcuml.c | 6 +- src/emu/cpu/dsp16/dsp16.c | 6 +- src/emu/cpu/dsp16/dsp16dis.c | 44 +++--- src/emu/cpu/dsp56k/dsp56dsm.c | 2 +- src/emu/cpu/dsp56k/inst.h | 8 +- src/emu/cpu/dsp56k/pmove.h | 8 +- src/emu/cpu/dsp56k/tables.c | 8 +- src/emu/cpu/mcs96/mcs96.c | 66 ++++----- src/emu/cpu/score/score.c | 6 +- src/emu/cpu/uml.c | 2 +- src/emu/debug/debugcmd.c | 16 +-- src/emu/debug/debugcpu.c | 4 +- src/emu/debug/dvbpoints.c | 4 +- src/emu/debug/dvstate.c | 4 +- src/emu/debug/dvwpoints.c | 4 +- src/emu/debug/express.c | 16 +-- src/emu/digfx.c | 2 +- src/emu/diimage.c | 22 +-- src/emu/disound.c | 10 +- src/emu/emuopts.c | 6 +- src/emu/emupal.c | 2 +- src/emu/fileio.c | 6 +- src/emu/image.c | 6 +- src/emu/imagedev/cassette.c | 2 +- src/emu/imagedev/diablo.c | 8 +- src/emu/imagedev/harddriv.c | 8 +- src/emu/info.c | 18 +-- src/emu/input.c | 12 +- src/emu/ioport.c | 6 +- src/emu/luaengine.c | 2 +- src/emu/machine.c | 8 +- src/emu/machine/fdc_pll.c | 2 +- src/emu/machine/hdc9234.c | 80 +++++------ src/emu/machine/ram.c | 2 +- src/emu/machine/upd765.c | 26 ++-- src/emu/machine/wd_fdc.c | 46 +++---- src/emu/mame.c | 6 +- src/emu/mconfig.c | 2 +- src/emu/memory.c | 14 +- src/emu/rendlay.c | 4 +- src/emu/romload.c | 78 +++++------ src/emu/save.c | 6 +- src/emu/schedule.c | 4 +- src/emu/screen.c | 2 +- src/emu/softlist.c | 4 +- src/emu/sound/disc_inp.inc | 2 +- src/emu/tilemap.c | 2 +- src/emu/ui/barcode.c | 2 +- src/emu/ui/devopt.c | 4 +- src/emu/ui/inputmap.c | 14 +- src/emu/ui/mainmenu.c | 8 +- src/emu/ui/menu.c | 2 +- src/emu/ui/miscmenu.c | 2 +- src/emu/ui/selgame.c | 2 +- src/emu/ui/swlist.c | 2 +- src/emu/ui/ui.c | 8 +- src/emu/validity.c | 22 +-- src/emu/video.c | 8 +- src/emu/webengine.c | 2 +- src/ldplayer/ldplayer.c | 2 +- src/lib/util/astring.h | 12 +- src/lib/util/cdrom.c | 2 +- src/lib/util/chd.h | 2 +- src/lib/util/chdcd.c | 14 +- src/lib/util/options.c | 16 +-- src/lib/util/options.h | 2 +- src/mame/drivers/bfm_sc45_helper.c | 52 +++---- src/mame/machine/315-5881_crypt.c | 2 +- src/mame/machine/naomim1.c | 2 +- src/mess/drivers/aim65.c | 2 +- src/mess/drivers/pegasus.c | 2 +- src/mess/machine/spec_snqk.c | 2 +- src/mess/machine/thomson.c | 4 +- src/mess/machine/ti99/gromport.c | 4 +- src/mess/machine/ti99/gromport.h | 2 +- .../debugger/qt/deviceinformationwindow.c | 2 +- src/osd/modules/debugger/qt/mainwindow.c | 4 +- src/osd/modules/font/font_osx.c | 4 +- src/osd/modules/font/font_sdl.c | 12 +- src/osd/modules/lib/osdobj_common.c | 2 +- src/osd/modules/lib/osdobj_common.h | 2 +- src/osd/modules/render/d3d/d3dhlsl.c | 2 +- src/osd/sdl/input.c | 34 ++--- src/osd/sdl/sdlmain.c | 2 +- src/tools/chdman.c | 130 +++++++++--------- src/tools/nltool.c | 2 +- src/tools/pngcmp.c | 12 +- src/tools/regrep.c | 18 +-- src/tools/split.c | 26 ++-- src/tools/src2html.c | 36 ++--- 101 files changed, 588 insertions(+), 588 deletions(-) diff --git a/src/emu/addrmap.c b/src/emu/addrmap.c index 8e0ef0b1919..9da36efa2e3 100644 --- a/src/emu/addrmap.c +++ b/src/emu/addrmap.c @@ -494,7 +494,7 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, dev owner.subtag(tag, entry->m_read.m_tag); device_t *mapdevice = machine.device(tag); if (mapdevice == NULL) { - throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag.cstr(), m_spacenum, device.basetag()); + throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag.c_str(), m_spacenum, device.basetag()); } // Grab the submap address_map submap(*mapdevice, entry); diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c index d1d6130ba26..1e667d32110 100644 --- a/src/emu/bus/a7800/a78_slot.c +++ b/src/emu/bus/a7800/a78_slot.c @@ -812,7 +812,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len) logerror( "==============\n\n" ); logerror( "\tTitle: %.32s\n", head_title); logerror( "\tLength: 0x%X [real 0x%X]\n", head_length, len); - logerror( "\tMapper: %s [0x%X]\n", cart_mapper.cstr(), head_mapper); + logerror( "\tMapper: %s [0x%X]\n", cart_mapper.c_str(), head_mapper); logerror( "\t\tPOKEY: %s\n", BIT(head_mapper, 0) ? "Yes" : "No"); logerror( "\t\tSC Bankswitch: %s\n", BIT(head_mapper, 1) ? "Yes" : "No"); logerror( "\t\tRAM at $4000: %s\n", BIT(head_mapper, 2) ? "Yes" : "No"); @@ -827,7 +827,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len) } else logerror( "\n"); - logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr()); - logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr()); + logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.c_str()); + logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.c_str()); logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC"); } diff --git a/src/emu/bus/gba/gba_slot.c b/src/emu/bus/gba/gba_slot.c index 78bb00bcd14..064bbb60add 100644 --- a/src/emu/bus/gba/gba_slot.c +++ b/src/emu/bus/gba/gba_slot.c @@ -307,7 +307,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) else if (!memcmp(&ROM[i], "SIIRTC_V", 8)) chip |= GBA_CHIP_RTC; } - osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).cstr()); + osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).c_str()); // fix for games which return more than one kind of chip: either it is one of the known titles, or we default to no battery if (gba_chip_has_conflict(chip)) @@ -364,7 +364,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) chip &= ~GBA_CHIP_RTC; } - osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).cstr()); + osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).c_str()); switch (chip) { diff --git a/src/emu/bus/intv/slot.c b/src/emu/bus/intv/slot.c index 621c4014bb2..231b291b153 100644 --- a/src/emu/bus/intv/slot.c +++ b/src/emu/bus/intv/slot.c @@ -328,7 +328,7 @@ int intv_cart_slot_device::load_fullpath() } else { - sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2], + sscanf(extrainfo.c_str() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2], &rom[3], &ram, &extra); //printf("extrainfo: %d %d %d %d %d %d %d \n", mapper, rom[0], rom[1], rom[2], rom[3], ram, extra); @@ -483,7 +483,7 @@ void intv_cart_slot_device::get_default_card_software(astring &result) if (hashfile_extrainfo(*this, extrainfo)) { - sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2], + sscanf(extrainfo.c_str() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2], &rom[3], &ram, &extra); if (ram) diff --git a/src/emu/bus/megadrive/md_slot.c b/src/emu/bus/megadrive/md_slot.c index 5cc2c124ecb..168c23cb25e 100644 --- a/src/emu/bus/megadrive/md_slot.c +++ b/src/emu/bus/megadrive/md_slot.c @@ -1082,10 +1082,10 @@ void base_md_cart_slot_device::file_logging(UINT8 *ROM8, UINT32 rom_len, UINT32 } logerror("Checksum: %X\n", checksum); logerror(" - Calculated Checksum: %X\n", csum); - logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.cstr()); + logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.c_str()); logerror("Modem: %.12s\n", modem); logerror("Memo: %.40s\n", memo); - logerror("Country: %.16s\n%s", country, reg.cstr()); + logerror("Country: %.16s\n%s", country, reg.c_str()); logerror("ROM Start: 0x%.8X\n", rom_start); logerror("ROM End: 0x%.8X\n", rom_end); logerror("RAM Start: 0x%.8X\n", ram_start); diff --git a/src/emu/bus/msx_slot/cartridge.c b/src/emu/bus/msx_slot/cartridge.c index 3ef1a45f3e8..57b2a668ac5 100644 --- a/src/emu/bus/msx_slot/cartridge.c +++ b/src/emu/bus/msx_slot/cartridge.c @@ -290,7 +290,7 @@ void msx_slot_cartridge_device::get_default_card_software(astring &result) if (hashfile_extrainfo(*this, extrainfo)) { int extrainfo_type = -1; - if (1 == sscanf(extrainfo.cstr(), "%d", &extrainfo_type)) + if (1 == sscanf(extrainfo.c_str(), "%d", &extrainfo_type)) { static const struct { int extrainfo; int mapper; } extrainfo_map[] = { //{ 0, NOMAPPER }, diff --git a/src/emu/bus/nes/nes_ines.inc b/src/emu/bus/nes/nes_ines.inc index b99dea5cda2..d783715a029 100644 --- a/src/emu/bus/nes/nes_ines.inc +++ b/src/emu/bus/nes/nes_ines.inc @@ -392,7 +392,7 @@ void nes_cart_slot_device::call_load_ines() } else { - logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.cstr()); + logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.c_str()); } } else diff --git a/src/emu/cheat.c b/src/emu/cheat.c index 1ccd40a7daf..7bc0308f705 100644 --- a/src/emu/cheat.c +++ b/src/emu/cheat.c @@ -540,7 +540,7 @@ void cheat_script::script_entry::save(emu_file &cheatfile) const // output an output else { - cheatfile.printf("\t\t\t argsprovided) - throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.cstr()); + throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str()); } @@ -782,7 +782,7 @@ void cheat_entry::save(emu_file &cheatfile) const bool has_scripts = (m_off_script != NULL || m_on_script != NULL || m_run_script != NULL || m_change_script != NULL); // output the cheat tag - cheatfile.printf("\t\n", m_comment.cstr()); + cheatfile.printf("\t\t\n", m_comment.c_str()); // output the parameter, if present if (m_parameter != NULL) @@ -832,7 +832,7 @@ bool cheat_entry::activate() { execute_on_script(); changed = true; - popmessage("Activated %s", m_description.cstr()); + popmessage("Activated %s", m_description.c_str()); } // if we're a oneshot parameter cheat and we're active, execute the "state change" script and indicate change @@ -840,7 +840,7 @@ bool cheat_entry::activate() { execute_change_script(); changed = true; - popmessage("Activated\n %s = %s", m_description.cstr(), m_parameter->text()); + popmessage("Activated\n %s = %s", m_description.c_str(), m_parameter->text()); } return changed; diff --git a/src/emu/clifront.c b/src/emu/clifront.c index c9b82dbe4a7..719aff6f6f5 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -153,7 +153,7 @@ int cli_frontend::execute(int argc, char **argv) val.printf("%s:%s:%s", swlistdev->list_name(), m_options.software_name(), swpart->name()); // call this in order to set slot devices according to mounting - m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.cstr()); + m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.c_str()); break; } } @@ -184,10 +184,10 @@ int cli_frontend::execute(int argc, char **argv) throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name()); // otherwise, error on the options - throw emu_fatalerror(MAMERR_INVALID_CONFIG, "%s", option_errors.trimspace().cstr()); + throw emu_fatalerror(MAMERR_INVALID_CONFIG, "%s", option_errors.trimspace().c_str()); } if (option_errors) - osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr()); + osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().c_str()); // determine the base name of the EXE astring exename; @@ -208,7 +208,7 @@ int cli_frontend::execute(int argc, char **argv) m_options.parse_standard_inis(option_errors); } if (option_errors) - osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr()); + osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().c_str()); // if we can't find it, give an appropriate error const game_driver *system = m_options.system(); @@ -226,7 +226,7 @@ int cli_frontend::execute(int argc, char **argv) catch (emu_fatalerror &fatal) { astring string(fatal.string()); - osd_printf_error("%s\n", string.trimspace().cstr()); + osd_printf_error("%s\n", string.trimspace().c_str()); m_result = (fatal.exitcode() != 0) ? fatal.exitcode() : MAMERR_FATALERROR; // if a game was specified, wasn't a wildcard, and our error indicates this was the @@ -328,7 +328,7 @@ void cli_frontend::listsource(const char *gamename) // iterate through drivers and output the info astring filename; while (drivlist.next()) - osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(filename, drivlist.driver().source_file).cstr()); + osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(filename, drivlist.driver().source_file).c_str()); } @@ -418,7 +418,7 @@ void cli_frontend::listbrothers(const char *gamename) while (drivlist.next()) { int clone_of = drivlist.clone(); - osd_printf_info("%-16s %-16s %-16s\n", core_filename_extract_base(filename, drivlist.driver().source_file).cstr(), drivlist.driver().name, (clone_of == -1 ? "" : drivlist.driver(clone_of).name)); + osd_printf_info("%-16s %-16s %-16s\n", core_filename_extract_base(filename, drivlist.driver().source_file).c_str(), drivlist.driver().name, (clone_of == -1 ? "" : drivlist.driver(clone_of).name)); } } @@ -726,14 +726,14 @@ void cli_frontend::listmedia(const char *gamename) paren_shortname.format("(%s)", imagedev->brief_instance_name()); // output the line, up to the list of extensions - printf("%-13s%-12s%-8s ", first ? drivlist.driver().name : "", imagedev->instance_name(), paren_shortname.cstr()); + printf("%-13s%-12s%-8s ", first ? drivlist.driver().name : "", imagedev->instance_name(), paren_shortname.c_str()); // get the extensions and print them astring extensions(imagedev->file_extensions()); for (int start = 0, end = extensions.chr(0, ','); ; start = end + 1, end = extensions.chr(start, ',')) { astring curext(extensions, start, (end == -1) ? extensions.len() - start : end - start); - printf(".%-5s", curext.cstr()); + printf(".%-5s", curext.c_str()); if (end == -1) break; } @@ -782,7 +782,7 @@ void cli_frontend::verifyroms(const char *gamename) // output the summary of the audit astring summary_string; auditor.summarize(drivlist.driver().name,&summary_string); - osd_printf_info("%s", summary_string.cstr()); + osd_printf_info("%s", summary_string.c_str()); // output the name of the driver and its clone osd_printf_info("romset %s ", drivlist.driver().name); @@ -842,7 +842,7 @@ void cli_frontend::verifyroms(const char *gamename) // output the summary of the audit astring summary_string; auditor.summarize(dev->shortname(),&summary_string); - osd_printf_info("%s", summary_string.cstr()); + osd_printf_info("%s", summary_string.c_str()); // display information about what we discovered osd_printf_info("romset %s ", dev->shortname()); @@ -880,7 +880,7 @@ void cli_frontend::verifyroms(const char *gamename) { astring temptag("_"); temptag.cat(option->name()); - device_t *dev = const_cast(config).device_add(&config.root_device(), temptag.cstr(), option->devtype(), 0); + device_t *dev = const_cast(config).device_add(&config.root_device(), temptag.c_str(), option->devtype(), 0); // notify this device and all its subdevices that they are now configured device_iterator subiter(*dev); @@ -907,7 +907,7 @@ void cli_frontend::verifyroms(const char *gamename) // output the summary of the audit astring summary_string; auditor.summarize(dev->shortname(),&summary_string); - osd_printf_info("%s", summary_string.cstr()); + osd_printf_info("%s", summary_string.c_str()); // display information about what we discovered osd_printf_info("romset %s ", dev->shortname()); @@ -938,7 +938,7 @@ void cli_frontend::verifyroms(const char *gamename) } } - const_cast(config).device_remove(&config.root_device(), temptag.cstr()); + const_cast(config).device_remove(&config.root_device(), temptag.c_str()); } } } @@ -1004,7 +1004,7 @@ void cli_frontend::verifysamples(const char *gamename) // output the summary of the audit astring summary_string; auditor.summarize(drivlist.driver().name,&summary_string); - osd_printf_info("%s", summary_string.cstr()); + osd_printf_info("%s", summary_string.c_str()); // output the name of the driver and its clone osd_printf_info("sampleset %s ", drivlist.driver().name); @@ -1322,7 +1322,7 @@ void cli_frontend::verifysoftware(const char *gamename) // output the summary of the audit astring summary_string; auditor.summarize(swinfo->shortname(), &summary_string); - osd_printf_info("%s", summary_string.cstr()); + osd_printf_info("%s", summary_string.c_str()); // display information about what we discovered osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname()); @@ -1444,7 +1444,7 @@ void cli_frontend::verifysoftlist(const char *gamename) // output the summary of the audit astring summary_string; auditor.summarize(swinfo->shortname(), &summary_string); - osd_printf_info("%s", summary_string.cstr()); + osd_printf_info("%s", summary_string.c_str()); // display information about what we discovered osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname()); @@ -1556,7 +1556,7 @@ void cli_frontend::execute_commands(const char *exename) astring option_errors; m_options.parse_standard_inis(option_errors); if (option_errors) - osd_printf_error("%s\n", option_errors.cstr()); + osd_printf_error("%s\n", option_errors.c_str()); // createconfig? if (strcmp(m_options.command(), CLICOMMAND_CREATECONFIG) == 0) @@ -1779,7 +1779,7 @@ void media_identifier::identify_file(const char *name) { // output the name astring basename; - osd_printf_info("%-20s", core_filename_extract_base(basename, name).cstr()); + osd_printf_info("%-20s", core_filename_extract_base(basename, name).c_str()); m_total++; // attempt to open as a CHD; fail if not @@ -1855,7 +1855,7 @@ void media_identifier::identify_data(const char *name, const UINT8 *data, int le // output the name m_total++; astring basename; - osd_printf_info("%-20s", core_filename_extract_base(basename, name).cstr()); + osd_printf_info("%-20s", core_filename_extract_base(basename, name).c_str()); // see if we can find a match in the ROMs int found = find_by_hash(hashes, length); diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c index 0c2c638cf19..0c61c2a66ed 100644 --- a/src/emu/cpu/drcbex64.c +++ b/src/emu/cpu/drcbex64.c @@ -655,7 +655,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U if (device.machine().options().drc_log_native()) { astring filename("drcbex64_", device.shortname(), ".asm"); - m_log = x86log_create_context(filename.cstr()); + m_log = x86log_create_context(filename.c_str()); } } @@ -799,7 +799,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT3 { astring dasm; inst.disasm(dasm, &m_drcuml); - x86log_add_comment(m_log, dst, "%s", dasm.cstr()); + x86log_add_comment(m_log, dst, "%s", dasm.c_str()); } // extract a blockname diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c index 2e0dd7704d4..ff9e49576e0 100644 --- a/src/emu/cpu/drcbex86.c +++ b/src/emu/cpu/drcbex86.c @@ -569,7 +569,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, U if (device.machine().options().drc_log_native()) { astring filename("drcbex86_", device.shortname(), ".asm"); - m_log = x86log_create_context(filename.cstr()); + m_log = x86log_create_context(filename.c_str()); } } @@ -782,7 +782,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT3 { astring dasm; inst.disasm(dasm, &m_drcuml); - x86log_add_comment(m_log, dst, "%s", dasm.cstr()); + x86log_add_comment(m_log, dst, "%s", dasm.c_str()); } // extract a blockname diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c index a261a9dfaad..e6596f3c9bd 100644 --- a/src/emu/cpu/drcuml.c +++ b/src/emu/cpu/drcuml.c @@ -130,7 +130,7 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int if (device.machine().options().drc_log_uml()) { astring filename("drcuml_", m_device.shortname(), ".asm"); - m_umllog = fopen(filename.cstr(), "w"); + m_umllog = fopen(filename.c_str(), "w"); } } @@ -490,12 +490,12 @@ void drcuml_block::disassemble() // include the first accumulated comment with this line if (firstcomment != -1) { - m_drcuml.log_printf("\t%-50.50s; %s\n", dasm.cstr(), get_comment_text(m_inst[firstcomment], comment)); + m_drcuml.log_printf("\t%-50.50s; %s\n", dasm.c_str(), get_comment_text(m_inst[firstcomment], comment)); firstcomment++; flushcomments = TRUE; } else - m_drcuml.log_printf("\t%s\n", dasm.cstr()); + m_drcuml.log_printf("\t%s\n", dasm.c_str()); } // flush any comments pending diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c index 29d14690d7b..a45ee26015c 100644 --- a/src/emu/cpu/dsp16/dsp16.c +++ b/src/emu/cpu/dsp16/dsp16.c @@ -237,7 +237,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring m_auc & 0x10 ? '0':'.', m_auc & 0x08 ? '1':'.', m_auc & 0x04 ? '0':'.', - alignString.cstr()); + alignString.c_str()); break; } @@ -274,7 +274,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring } string.printf("%c%s%c%c%c%c%c%c%c%c%c%c%c%c%c", m_pioc & 0x8000 ? 'I':'.', - strobeString.cstr(), + strobeString.c_str(), m_pioc & 0x1000 ? 'O':'I', m_pioc & 0x0800 ? 'O':'I', m_pioc & 0x0400 ? 'S':'.', @@ -305,7 +305,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring } string.printf("%c%s%c%c%c%c%c%c%c", m_sioc & 0x0200 ? 'I':'O', - clkString.cstr(), + clkString.c_str(), m_sioc & 0x0040 ? 'L':'M', m_sioc & 0x0020 ? 'I':'O', m_sioc & 0x0010 ? 'I':'O', diff --git a/src/emu/cpu/dsp16/dsp16dis.c b/src/emu/cpu/dsp16/dsp16dis.c index 6b69cdf58ab..7db21ec7bf6 100644 --- a/src/emu/cpu/dsp16/dsp16dis.c +++ b/src/emu/cpu/dsp16/dsp16dis.c @@ -270,7 +270,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 F1 = (op & 0x01e0) >> 5; astring yString = disasmYField(Y); astring fString = disasmF1Field(F1, D, S); - sprintf(buffer, "%s, %s", fString.cstr(), yString.cstr()); + sprintf(buffer, "%s, %s", fString.c_str(), yString.c_str()); break; } case 0x04: case 0x1c: @@ -285,7 +285,7 @@ CPU_DISASSEMBLE( dsp16a ) astring fString = disasmF1Field(F1, D, S); astring aString = (opcode == 0x1c) ? "a0" : "a1"; astring xString = (X) ? "" : "l"; - sprintf(buffer, "%s = %s%s, %s", yString.cstr(), aString.cstr(), xString.cstr(), fString.cstr()); + sprintf(buffer, "%s = %s%s, %s", yString.c_str(), aString.c_str(), xString.c_str(), fString.c_str()); break; } case 0x16: @@ -297,7 +297,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 F1 = (op & 0x01e0) >> 5; astring yString = disasmYField(Y); astring fString = disasmF1Field(F1, D, S); - sprintf(buffer, "%s, x = %s", fString.cstr(), yString.cstr()); + sprintf(buffer, "%s, x = %s", fString.c_str(), yString.c_str()); break; } case 0x17: @@ -311,7 +311,7 @@ CPU_DISASSEMBLE( dsp16a ) astring yString = disasmYField(Y); astring fString = disasmF1Field(F1, D, S); astring xString = (X ? "y" : "y1"); - sprintf(buffer, "%s, %s = %s", fString.cstr(), xString.cstr(), yString.cstr()); + sprintf(buffer, "%s, %s = %s", fString.c_str(), xString.c_str(), yString.c_str()); break; } case 0x1f: @@ -325,7 +325,7 @@ CPU_DISASSEMBLE( dsp16a ) astring yString = disasmYField(Y); astring fString = disasmF1Field(F1, D, S); astring xString = (X ? "*pt++i" : "*pt++"); - sprintf(buffer, "%s, y = %s, x = %s", fString.cstr(), yString.cstr(), xString.cstr()); + sprintf(buffer, "%s, y = %s, x = %s", fString.c_str(), yString.c_str(), xString.c_str()); break; } case 0x19: case 0x1b: @@ -339,7 +339,7 @@ CPU_DISASSEMBLE( dsp16a ) astring fString = disasmF1Field(F1, D, S); astring xString = (X ? "*pt++i" : "*pt++"); astring aString = (opcode == 0x19) ? "a0" : "a1"; - sprintf(buffer, "%s, y = %s, x = %s", fString.cstr(), aString.cstr(), xString.cstr()); + sprintf(buffer, "%s, y = %s, x = %s", fString.c_str(), aString.c_str(), xString.c_str()); if (Y != 0x00) sprintf(buffer, "UNKNOWN"); break; } @@ -354,7 +354,7 @@ CPU_DISASSEMBLE( dsp16a ) astring yString = disasmYField(Y); astring xString = (X ? "y" : "y1"); astring fString = disasmF1Field(F1, D, S); - sprintf(buffer, "%s, %s = %s", fString.cstr(), yString.cstr(), xString.cstr()); + sprintf(buffer, "%s, %s = %s", fString.c_str(), yString.c_str(), xString.c_str()); break; } @@ -369,7 +369,7 @@ CPU_DISASSEMBLE( dsp16a ) astring yString = disasmYField(Y); astring atString = (aT ? "a0" : "a1"); astring fString = disasmF1Field(F1, aT, S); - sprintf(buffer, "%s, %s = %s", fString.cstr(), atString.cstr(), yString.cstr()); + sprintf(buffer, "%s, %s = %s", fString.c_str(), atString.c_str(), yString.c_str()); break; } @@ -385,7 +385,7 @@ CPU_DISASSEMBLE( dsp16a ) astring zString = disasmZField(Z); astring xString = (X ? "y" : "y1"); astring fString = disasmF1Field(F1, D, S); - sprintf(buffer, "%s, %s <=> %s", fString.cstr(), xString.cstr(), zString.cstr()); + sprintf(buffer, "%s, %s <=> %s", fString.c_str(), xString.c_str(), zString.c_str()); break; } case 0x1d: @@ -399,7 +399,7 @@ CPU_DISASSEMBLE( dsp16a ) astring zString = disasmZField(Z); astring xString = (X ? "*pt++i" : "*pt++"); astring fString = disasmF1Field(F1, D, S); - sprintf(buffer, "%s, %s <=> y, x = %s", fString.cstr(), zString.cstr(), xString.cstr()); + sprintf(buffer, "%s, %s <=> y, x = %s", fString.c_str(), zString.c_str(), xString.c_str()); break; } @@ -416,7 +416,7 @@ CPU_DISASSEMBLE( dsp16a ) astring atString = (aT ? "a0" : "a1"); atString += X ? "" : "1"; // TODO: Figure out unclear wording. astring fString = disasmF1Field(F1, aT, S); - sprintf(buffer, "%s, %s <=> %s", fString.cstr(), zString.cstr(), atString.cstr()); + sprintf(buffer, "%s, %s <=> %s", fString.c_str(), zString.c_str(), atString.c_str()); break; } @@ -431,8 +431,8 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 F2 = (op & 0x01e0) >> 5; astring fString = disasmF2Field(F2, D, S); astring conString = disasmCONField(CON); - if (op & 0x0800) sprintf(buffer, "if %s : %s", conString.cstr(), fString.cstr()); - else sprintf(buffer, "ifc %s : %s", conString.cstr(), fString.cstr()); + if (op & 0x0800) sprintf(buffer, "if %s : %s", conString.c_str(), fString.c_str()); + else sprintf(buffer, "ifc %s : %s", conString.c_str(), fString.c_str()); break; } @@ -458,7 +458,7 @@ CPU_DISASSEMBLE( dsp16a ) // goto B const UINT8 B = (op & 0x0700) >> 8; astring bString = disasmBField(B); - sprintf(buffer, "%s", bString.cstr()); + sprintf(buffer, "%s", bString.c_str()); break; } @@ -468,7 +468,7 @@ CPU_DISASSEMBLE( dsp16a ) // if CON [goto/call/return] const UINT8 CON = (op & 0x001f); astring conString = disasmCONField(CON); - sprintf(buffer, "if %s:", conString.cstr()); + sprintf(buffer, "if %s:", conString.c_str()); // TODO: Test for invalid ops // icall if (op == 0xd40e) sprintf(buffer, "icall"); @@ -482,7 +482,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 R = (op & 0x03f0) >> 4; const UINT8 S = (op & 0x1000) >> 12; astring rString = disasmRField(R); - sprintf(buffer, "%s = %s", rString.cstr(), (S ? "a1" : "a0")); + sprintf(buffer, "%s = %s", rString.c_str(), (S ? "a1" : "a0")); break; } case 0x08: @@ -491,7 +491,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 R = (op & 0x03f0) >> 4; const UINT8 aT = (op & 0x0400) >> 10; astring rString = disasmRField(R); - sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.cstr()); + sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.c_str()); break; } case 0x0f: @@ -501,7 +501,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 R = (op & 0x03f0) >> 4; astring yString = disasmYField(Y); astring rString = disasmRField(R); - sprintf(buffer, "%s = %s", rString.cstr(), yString.cstr()); + sprintf(buffer, "%s = %s", rString.c_str(), yString.c_str()); // TODO: Special case the R == [y, y1, or x] case break; } @@ -513,7 +513,7 @@ CPU_DISASSEMBLE( dsp16a ) astring yString = disasmYField(Y); astring rString = disasmRField(R); // TODO: page 3-31 "special function encoding" - sprintf(buffer, "%s = %s", yString.cstr(), rString.cstr()); + sprintf(buffer, "%s = %s", yString.c_str(), rString.c_str()); break; } case 0x0d: @@ -523,7 +523,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 R = (op & 0x03f0) >> 4; astring zString = disasmZField(Z); astring rString = disasmRField(R); - sprintf(buffer, "%s <=> %s", zString.cstr(), rString.cstr()); + sprintf(buffer, "%s <=> %s", zString.c_str(), rString.c_str()); break; } @@ -533,7 +533,7 @@ CPU_DISASSEMBLE( dsp16a ) // R = N const UINT8 R = (op & 0x03f0) >> 4; astring rString = disasmRField(R); - sprintf(buffer, "%s = 0x%04x", rString.cstr(), op2); + sprintf(buffer, "%s = 0x%04x", rString.c_str(), op2); opSize = 2; break; } @@ -545,7 +545,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT16 M = (op & 0x01ff); const UINT8 R = (op & 0x0e00) >> 9; astring rString = disasmRImmediateField(R); - sprintf(buffer, "%s = 0x%04x", rString.cstr(), M); + sprintf(buffer, "%s = 0x%04x", rString.c_str(), M); break; } diff --git a/src/emu/cpu/dsp56k/dsp56dsm.c b/src/emu/cpu/dsp56k/dsp56dsm.c index 1321b92c851..4a9aead9d67 100644 --- a/src/emu/cpu/dsp56k/dsp56dsm.c +++ b/src/emu/cpu/dsp56k/dsp56dsm.c @@ -21,7 +21,7 @@ CPU_DISASSEMBLE( dsp56k ) // Decode and disassemble. DSP56K::Opcode op(w0, w1); - sprintf(buffer, "%s", op.disassemble().cstr()); + sprintf(buffer, "%s", op.disassemble().c_str()); const unsigned size = op.size(); return (size | DASMFLAG_SUPPORTED); diff --git a/src/emu/cpu/dsp56k/inst.h b/src/emu/cpu/dsp56k/inst.h index 533aee475c1..bad517ab171 100644 --- a/src/emu/cpu/dsp56k/inst.h +++ b/src/emu/cpu/dsp56k/inst.h @@ -204,7 +204,7 @@ public: void disassemble(astring& retString) const { char temp[32]; - sprintf(temp, "#$%x,%s", m_immediate, regIdAsString(m_destination).cstr()); + sprintf(temp, "#$%x,%s", m_immediate, regIdAsString(m_destination).c_str()); retString = "andi " + astring(temp); // NEW // sprintf(opcode_str, "and(i)"); } @@ -438,7 +438,7 @@ public: sprintf(temp, "#$%x", m_iVal); astring source = temp; - sprintf(temp, "X:(%s)", regIdAsString(m_r).cstr()); + sprintf(temp, "X:(%s)", regIdAsString(m_r).c_str()); astring destination = temp; retString = m_opcode + " " + source + "," + destination; @@ -1138,7 +1138,7 @@ public: astring destination = temp; // NEW // sprintf(temp, "X:(R%d),$%02x", Rnum, pc + 2 + word1); - sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr()); + sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str()); astring source = temp; retString = "do " + source + "," + destination; @@ -3042,7 +3042,7 @@ public: void disassemble(astring& retString) const { char temp[32]; - sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr()); + sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str()); retString = "rep " + astring(temp); } void evaluate(dsp56k_core* cpustate) {} diff --git a/src/emu/cpu/dsp56k/pmove.h b/src/emu/cpu/dsp56k/pmove.h index e6b017280b6..2a475975542 100644 --- a/src/emu/cpu/dsp56k/pmove.h +++ b/src/emu/cpu/dsp56k/pmove.h @@ -158,9 +158,9 @@ public: if (r == iR3) return false; char temp[32]; - sprintf(temp, "X:%s,%s", ea1.cstr(), regIdAsString(D1).cstr()); + sprintf(temp, "X:%s,%s", ea1.c_str(), regIdAsString(D1).c_str()); parallelMove = temp; - sprintf(temp, "X:%s,%s", ea2.cstr(), regIdAsString(D2).cstr()); + sprintf(temp, "X:%s,%s", ea2.c_str(), regIdAsString(D2).c_str()); parallelMove2 = temp; return true; @@ -253,8 +253,8 @@ public: decode_RR_table(BITSn(word0,0x00c0), r); decode_DD_table(BITSn(word0,0x0030), S); - sprintf(parallel_move_str, "%s,X:(R%d)+N%d", regIdAsString(Dnot).cstr(), regIDAsNum(r), regIDAsNum(r)); - sprintf(parallel_move_str2, "%s,%s", regIdAsString(S).cstr(), regIdAsString(Dnot).cstr()); + sprintf(parallel_move_str, "%s,X:(R%d)+N%d", regIdAsString(Dnot).c_str(), regIDAsNum(r), regIDAsNum(r)); + sprintf(parallel_move_str2, "%s,%s", regIdAsString(S).c_str(), regIdAsString(Dnot).c_str()); pms = parallel_move_str; pms2 = parallel_move_str2; return true; diff --git a/src/emu/cpu/dsp56k/tables.c b/src/emu/cpu/dsp56k/tables.c index 1cf6e556afb..36af446cb96 100644 --- a/src/emu/cpu/dsp56k/tables.c +++ b/src/emu/cpu/dsp56k/tables.c @@ -574,8 +574,8 @@ void assemble_D_from_P_table(UINT16 P, UINT16 ppppp, astring& D) break; case 0x1: assemble_address_from_IO_short_address(ppppp, fullAddy); - sprintf(temp, "X:<<$%s", fullAddy.cstr()); - // NEW // sprintf(temp, "X:$%s", fullAddy.cstr()); + sprintf(temp, "X:<<$%s", fullAddy.c_str()); + // NEW // sprintf(temp, "X:$%s", fullAddy.c_str()); break; } D = temp; @@ -585,7 +585,7 @@ void assemble_arguments_from_W_table(UINT16 W, char ma, const reg_id& SD, const astring& source, astring& destination) { char temp[32]; - sprintf(temp, "%c:%s", ma, ea.cstr()); + sprintf(temp, "%c:%s", ma, ea.c_str()); switch(W) { case 0x0: source = regIdAsString(SD); destination = temp; break; @@ -597,7 +597,7 @@ void assemble_arguments_from_W_table(UINT16 W, char ma, const astring& SD, const astring& source, astring& destination) { char temp[32]; - sprintf(temp, "%c:%s", ma, ea.cstr()); + sprintf(temp, "%c:%s", ma, ea.c_str()); switch(W) { case 0x0: source = SD; destination = temp; break; diff --git a/src/emu/cpu/mcs96/mcs96.c b/src/emu/cpu/mcs96/mcs96.c index e180a69a9ea..52e3c5efe5e 100644 --- a/src/emu/cpu/mcs96/mcs96.c +++ b/src/emu/cpu/mcs96/mcs96.c @@ -253,7 +253,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, int delta = oprom[2]; if(delta & 0x80) delta -= 0x100; - sprintf(buffer, " %s, %04x", regname(oprom[1]).cstr(), (pc+3+delta) & 0xffff); + sprintf(buffer, " %s, %04x", regname(oprom[1]).c_str(), (pc+3+delta) & 0xffff); flags |= 3; break; } @@ -262,23 +262,23 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, int delta = oprom[2]; if(delta & 0x80) delta -= 0x100; - sprintf(buffer, " %d, %s, %04x", oprom[0] & 7, regname(oprom[1]).cstr(), (pc+3+delta) & 0xffff); + sprintf(buffer, " %d, %s, %04x", oprom[0] & 7, regname(oprom[1]).c_str(), (pc+3+delta) & 0xffff); flags |= 3; break; } case DASM_direct_1: - sprintf(buffer, " %s", regname(oprom[1]).cstr()); + sprintf(buffer, " %s", regname(oprom[1]).c_str()); flags |= 2; break; case DASM_direct_2: - sprintf(buffer, " %s, %s", regname(oprom[2]).cstr(), regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %s", regname(oprom[2]).c_str(), regname(oprom[1]).c_str()); flags |= 3; break; case DASM_direct_3: - sprintf(buffer, " %s, %s, %s", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %s, %s", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]).c_str()); flags |= 4; break; @@ -288,20 +288,20 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, break; case DASM_immed_2b: - sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]); + sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]); flags |= 3; break; case DASM_immed_or_reg_2b: if(oprom[1] >= 0x10) - sprintf(buffer, " %s, %s", regname(oprom[2]).cstr(), regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %s", regname(oprom[2]).c_str(), regname(oprom[1]).c_str()); else - sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]); + sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]); flags |= 3; break; case DASM_immed_3b: - sprintf(buffer, " %s, %s, #%02x", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), oprom[1]); + sprintf(buffer, " %s, %s, #%02x", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), oprom[1]); flags |= 4; break; @@ -311,46 +311,46 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, break; case DASM_immed_2w: - sprintf(buffer, " %s, #%02x%02x", regname(oprom[3]).cstr(), oprom[2], oprom[1]); + sprintf(buffer, " %s, #%02x%02x", regname(oprom[3]).c_str(), oprom[2], oprom[1]); flags |= 4; break; case DASM_immed_3w: - sprintf(buffer, " %s, %s, #%02x%02x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), oprom[2], oprom[1]); + sprintf(buffer, " %s, %s, #%02x%02x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), oprom[2], oprom[1]); flags |= 5; break; case DASM_indirect_1n: - sprintf(buffer, " [%s]", regname(oprom[1]).cstr()); + sprintf(buffer, " [%s]", regname(oprom[1]).c_str()); flags |= 2; break; case DASM_indirect_1: if(oprom[1] & 0x01) { - sprintf(buffer, " [%s]+", regname(oprom[1]-1).cstr()); + sprintf(buffer, " [%s]+", regname(oprom[1]-1).c_str()); flags |= 2; } else { - sprintf(buffer, " [%s]", regname(oprom[1]).cstr()); + sprintf(buffer, " [%s]", regname(oprom[1]).c_str()); flags |= 2; } break; case DASM_indirect_2: if(oprom[1] & 0x01) { - sprintf(buffer, " %s, [%s]+", regname(oprom[2]).cstr(), regname(oprom[1]-1).cstr()); + sprintf(buffer, " %s, [%s]+", regname(oprom[2]).c_str(), regname(oprom[1]-1).c_str()); flags |= 3; } else { - sprintf(buffer, " %s, [%s]", regname(oprom[2]).cstr(), regname(oprom[1]).cstr()); + sprintf(buffer, " %s, [%s]", regname(oprom[2]).c_str(), regname(oprom[1]).c_str()); flags |= 3; } break; case DASM_indirect_3: if(oprom[1] & 0x01) { - sprintf(buffer, " %s, %s, [%s]+", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]-1).cstr()); + sprintf(buffer, " %s, %s, [%s]+", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]-1).c_str()); flags |= 4; } else { - sprintf(buffer, " %s, %s, [%s]", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %s, [%s]", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]).c_str()); flags |= 4; } break; @@ -360,7 +360,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, if(oprom[1] == 0x01) sprintf(buffer, " %02x%02x", oprom[3], oprom[2]); else - sprintf(buffer, " %02x%02x[%s]", oprom[3], oprom[2], regname(oprom[1]-1).cstr()); + sprintf(buffer, " %02x%02x[%s]", oprom[3], oprom[2], regname(oprom[1]-1).c_str()); flags |= 4; } else { int delta = oprom[2]; @@ -373,9 +373,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, sprintf(buffer, " %02x", delta); } else { if(delta < 0) - sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).cstr()); + sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).c_str()); else - sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).cstr()); + sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).c_str()); } flags |= 3; } @@ -384,9 +384,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, case DASM_indexed_2: if(oprom[1] & 0x01) { if(oprom[1] == 0x01) - sprintf(buffer, " %s, %02x%02x", regname(oprom[4]).cstr(), oprom[3], oprom[2]); + sprintf(buffer, " %s, %02x%02x", regname(oprom[4]).c_str(), oprom[3], oprom[2]); else - sprintf(buffer, " %s, %02x%02x[%s]", regname(oprom[4]).cstr(), oprom[3], oprom[2], regname(oprom[1]-1).cstr()); + sprintf(buffer, " %s, %02x%02x[%s]", regname(oprom[4]).c_str(), oprom[3], oprom[2], regname(oprom[1]-1).c_str()); flags |= 5; } else { int delta = oprom[2]; @@ -394,14 +394,14 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, delta -= 0x100; if(oprom[1] == 0x00) { if(delta < 0) - sprintf(buffer, " %s, %04x", regname(oprom[3]).cstr(), delta & 0xffff); + sprintf(buffer, " %s, %04x", regname(oprom[3]).c_str(), delta & 0xffff); else - sprintf(buffer, " %s, %02x", regname(oprom[3]).cstr(), delta); + sprintf(buffer, " %s, %02x", regname(oprom[3]).c_str(), delta); } else { if(delta < 0) - sprintf(buffer, " %s, -%02x[%s]", regname(oprom[3]).cstr(), -delta, regname(oprom[1]).cstr()); + sprintf(buffer, " %s, -%02x[%s]", regname(oprom[3]).c_str(), -delta, regname(oprom[1]).c_str()); else - sprintf(buffer, " %s, %02x[%s]", regname(oprom[3]).cstr(), delta, regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %02x[%s]", regname(oprom[3]).c_str(), delta, regname(oprom[1]).c_str()); } flags |= 4; } @@ -410,9 +410,9 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, case DASM_indexed_3: if(oprom[1] & 0x01) { if(oprom[1] == 0x01) - sprintf(buffer, " %s, %s, %02x%02x", regname(oprom[5]).cstr(), regname(oprom[4]).cstr(), oprom[3], oprom[2]); + sprintf(buffer, " %s, %s, %02x%02x", regname(oprom[5]).c_str(), regname(oprom[4]).c_str(), oprom[3], oprom[2]); else - sprintf(buffer, " %s, %s, %02x%02x[%s]", regname(oprom[5]).cstr(), regname(oprom[4]).cstr(), oprom[3], oprom[2], regname(oprom[1]-1).cstr()); + sprintf(buffer, " %s, %s, %02x%02x[%s]", regname(oprom[5]).c_str(), regname(oprom[4]).c_str(), oprom[3], oprom[2], regname(oprom[1]-1).c_str()); flags |= 6; } else { int delta = oprom[2]; @@ -420,14 +420,14 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, delta -= 0x100; if(oprom[1] == 0x00) { if(delta < 0) - sprintf(buffer, " %s, %s, %04x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta & 0xffff); + sprintf(buffer, " %s, %s, %04x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta & 0xffff); else - sprintf(buffer, " %s, %s, %02x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta); + sprintf(buffer, " %s, %s, %02x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta); } else { if(delta < 0) - sprintf(buffer, " %s, %s, -%02x[%s]", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), -delta, regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %s, -%02x[%s]", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), -delta, regname(oprom[1]).c_str()); else - sprintf(buffer, " %s, %s, %02x[%s]", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta, regname(oprom[1]).cstr()); + sprintf(buffer, " %s, %s, %02x[%s]", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta, regname(oprom[1]).c_str()); } flags |= 5; } diff --git a/src/emu/cpu/score/score.c b/src/emu/cpu/score/score.c index a50ffd21562..cb2d8e26742 100644 --- a/src/emu/cpu/score/score.c +++ b/src/emu/cpu/score/score.c @@ -83,13 +83,13 @@ void score7_cpu_device::device_start() astring tmp_string; for(int i=0; i<0x20; i++) - state_add(SCORE_GPR + i, tmp_string.format("r%d", i).cstr(), m_gpr[i]).callimport().callexport().formatstr("%08X"); + state_add(SCORE_GPR + i, tmp_string.format("r%d", i).c_str(), m_gpr[i]).callimport().callexport().formatstr("%08X"); for(int i=0; i<0x20; i++) - state_add(SCORE_CR + i, tmp_string.format("cr%d", i).cstr(), m_cr[i]).callimport().callexport().formatstr("%08X"); + state_add(SCORE_CR + i, tmp_string.format("cr%d", i).c_str(), m_cr[i]).callimport().callexport().formatstr("%08X"); for(int i=0; i<3; i++) - state_add(SCORE_SR + i, tmp_string.format("sr%d", i).cstr(), m_sr[i]).callimport().callexport().formatstr("%08X"); + state_add(SCORE_SR + i, tmp_string.format("sr%d", i).c_str(), m_sr[i]).callimport().callexport().formatstr("%08X"); state_add(SCORE_CEH, "ceh", REG_CEH).callimport().callexport().formatstr("%08X"); state_add(SCORE_CEL, "cel", REG_CEL).callimport().callexport().formatstr("%08X"); diff --git a/src/emu/cpu/uml.c b/src/emu/cpu/uml.c index 33147b912dd..86748604f6c 100644 --- a/src/emu/cpu/uml.c +++ b/src/emu/cpu/uml.c @@ -743,7 +743,7 @@ void uml::instruction::simplify() astring disasm1, disasm2; orig.disasm(disasm1, block->drcuml); inst->disasm(disasm2, block->drcuml); - osd_printf_debug("Simplified: %-50.50s -> %s\n", disasm1.cstr(), disasm2.cstr()); + osd_printf_debug("Simplified: %-50.50s -> %s\n", disasm1.c_str(), disasm2.c_str()); } */ diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 51c4ccfa95f..6d5771430eb 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -1044,7 +1044,7 @@ static void execute_ignore(running_machine &machine, int ref, int params, const /* special message for none */ if (!buffer) buffer.printf("Not currently ignoring any devices"); - debug_console_printf(machine, "%s\n", buffer.cstr()); + debug_console_printf(machine, "%s\n", buffer.c_str()); } /* otherwise clear the ignore flag on all requested CPUs */ @@ -1109,7 +1109,7 @@ static void execute_observe(running_machine &machine, int ref, int params, const /* special message for none */ if (!buffer) buffer.printf("Not currently observing any devices"); - debug_console_printf(machine, "%s\n", buffer.cstr()); + debug_console_printf(machine, "%s\n", buffer.c_str()); } /* otherwise set the ignore flag on all requested CPUs */ @@ -1332,7 +1332,7 @@ static void execute_bplist(running_machine &machine, int ref, int params, const buffer.catprintf(" if %s", bp->condition()); if (astring(bp->action()) != astring("")) buffer.catprintf(" do %s", bp->action()); - debug_console_printf(machine, "%s\n", buffer.cstr()); + debug_console_printf(machine, "%s\n", buffer.c_str()); printed++; } } @@ -1502,7 +1502,7 @@ static void execute_wplist(running_machine &machine, int ref, int params, const buffer.catprintf(" if %s", wp->condition()); if (astring(wp->action()) != astring("")) buffer.catprintf(" do %s", wp->action()); - debug_console_printf(machine, "%s\n", buffer.cstr()); + debug_console_printf(machine, "%s\n", buffer.c_str()); printed++; } } @@ -1641,7 +1641,7 @@ static void execute_rplist(running_machine &machine, int ref, int params, const buffer.catprintf("if %s", rp->condition()); if (rp->action() != NULL) buffer.catprintf(" do %s", rp->action()); - debug_console_printf(machine, "%s\n", buffer.cstr()); + debug_console_printf(machine, "%s\n", buffer.c_str()); printed++; } } @@ -2605,7 +2605,7 @@ static void execute_trace_internal(running_machine &machine, int ref, int params /* do it */ cpu->debug()->trace(f, trace_over, action); if (f) - debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename.cstr()); + debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename.c_str()); else debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag()); } @@ -3100,9 +3100,9 @@ static void execute_dumpkbd(running_machine &machine, int ref, int params, const // and output it as appropriate if (file != NULL) - fprintf(file, "%s\n", buffer.cstr()); + fprintf(file, "%s\n", buffer.c_str()); else - debug_console_printf(machine, "%s\n", buffer.cstr()); + debug_console_printf(machine, "%s\n", buffer.c_str()); // cleanup if (file != NULL) diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 221a4585d87..1ed4aabcb2a 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -3061,7 +3061,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre } else buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc); - debug_console_printf(space.machine(), "%s\n", buffer.cstr()); + debug_console_printf(space.machine(), "%s\n", buffer.c_str()); space.device().debug()->compute_debug_flags(); } break; @@ -3495,7 +3495,7 @@ void device_debug::tracer::update(offs_t pc) buffer.cat(dasm); // output the result - fprintf(&m_file, "%s\n", buffer.cstr()); + fprintf(&m_file, "%s\n", buffer.c_str()); // do we need to step the trace over this instruction? if (m_trace_over && (dasmresult & DASMFLAG_SUPPORTED) != 0 && (dasmresult & DASMFLAG_STEP_OVER) != 0) diff --git a/src/emu/debug/dvbpoints.c b/src/emu/debug/dvbpoints.c index a40ab25796a..4edd18ebebc 100644 --- a/src/emu/debug/dvbpoints.c +++ b/src/emu/debug/dvbpoints.c @@ -134,7 +134,7 @@ void debug_view_breakpoints::enumerate_sources() { astring name; name.printf("%s '%s'", dasm->device().name(), dasm->device().tag()); - m_source_list.append(*global_alloc(debug_view_source(name.cstr(), &dasm->device()))); + m_source_list.append(*global_alloc(debug_view_source(name.c_str(), &dasm->device()))); } // reset the source to a known good entry @@ -196,7 +196,7 @@ void debug_view_breakpoints::pad_astring_to_length(astring& str, int len) buffer.expand(diff); for (int i = 0; i < diff; i++) buffer.catprintf(" "); - str.catprintf("%s", buffer.cstr()); + str.catprintf("%s", buffer.c_str()); } } diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c index ba26d8bbfe4..77afdcc43cf 100644 --- a/src/emu/debug/dvstate.c +++ b/src/emu/debug/dvstate.c @@ -291,13 +291,13 @@ void debug_view_state::view_update() len += m_divider - 1 - curitem->m_symbol.len(); } - memcpy(&temp[len], curitem->m_symbol.cstr(), curitem->m_symbol.len()); + memcpy(&temp[len], curitem->m_symbol.c_str(), curitem->m_symbol.len()); len += curitem->m_symbol.len(); temp[len++] = ' '; temp[len++] = ' '; - memcpy(&temp[len], valstr.cstr(), curitem->m_vallen); + memcpy(&temp[len], valstr.c_str(), curitem->m_vallen); len += curitem->m_vallen; temp[len++] = ' '; diff --git a/src/emu/debug/dvwpoints.c b/src/emu/debug/dvwpoints.c index 96303c89afc..8a03b4a5501 100644 --- a/src/emu/debug/dvwpoints.c +++ b/src/emu/debug/dvwpoints.c @@ -156,7 +156,7 @@ void debug_view_watchpoints::enumerate_sources() { astring name; name.printf("%s '%s'", dasm->device().name(), dasm->device().tag()); - m_source_list.append(*global_alloc(debug_view_source(name.cstr(), &dasm->device()))); + m_source_list.append(*global_alloc(debug_view_source(name.c_str(), &dasm->device()))); } // reset the source to a known good entry @@ -220,7 +220,7 @@ void debug_view_watchpoints::pad_astring_to_length(astring& str, int len) buffer.expand(diff); for (int i = 0; i < diff; i++) buffer.catprintf(" "); - str.catprintf("%s", buffer.cstr()); + str.catprintf("%s", buffer.c_str()); } } diff --git a/src/emu/debug/express.c b/src/emu/debug/express.c index 02f1e5ff456..176cf8d0f19 100644 --- a/src/emu/debug/express.c +++ b/src/emu/debug/express.c @@ -287,7 +287,7 @@ void integer_symbol_entry::set_value(UINT64 newvalue) if (m_setter != NULL) (*m_setter)(m_table, m_ref, newvalue); else - throw emu_fatalerror("Symbol '%s' is read-only", m_name.cstr()); + throw emu_fatalerror("Symbol '%s' is read-only", m_name.c_str()); } @@ -347,7 +347,7 @@ bool function_symbol_entry::is_lval() const UINT64 function_symbol_entry::value() const { - throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.cstr()); + throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.c_str()); } @@ -357,7 +357,7 @@ UINT64 function_symbol_entry::value() const void function_symbol_entry::set_value(UINT64 newvalue) { - throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.cstr()); + throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.c_str()); } @@ -368,9 +368,9 @@ void function_symbol_entry::set_value(UINT64 newvalue) UINT64 function_symbol_entry::execute(int numparams, const UINT64 *paramlist) { if (numparams < m_minparams) - throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.cstr(), m_minparams); + throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.c_str(), m_minparams); if (numparams > m_maxparams) - throw emu_fatalerror("Function '%s' accepts no more than %d parameters", m_name.cstr(), m_maxparams); + throw emu_fatalerror("Function '%s' accepts no more than %d parameters", m_name.c_str(), m_maxparams); return (*m_execute)(m_table, m_ref, numparams, paramlist); } @@ -927,15 +927,15 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& // if we have an 0x prefix, we must be a hex value if (buffer[0] == '0' && buffer[1] == 'x') - return parse_number(token, buffer.cstr() + 2, 16, expression_error::INVALID_NUMBER); + return parse_number(token, buffer.c_str() + 2, 16, expression_error::INVALID_NUMBER); // if we have a # prefix, we must be a decimal value if (buffer[0] == '#') - return parse_number(token, buffer.cstr() + 1, 10, expression_error::INVALID_NUMBER); + return parse_number(token, buffer.c_str() + 1, 10, expression_error::INVALID_NUMBER); // if we have a $ prefix, we are a hex value if (buffer[0] == '$') - return parse_number(token, buffer.cstr() + 1, 16, expression_error::INVALID_NUMBER); + return parse_number(token, buffer.c_str() + 1, 16, expression_error::INVALID_NUMBER); // check for a symbol match symbol_entry *symbol = m_symtable->find_deep(buffer); diff --git a/src/emu/digfx.c b/src/emu/digfx.c index 46282fdf382..8e7c8059727 100644 --- a/src/emu/digfx.c +++ b/src/emu/digfx.c @@ -327,7 +327,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con UINT32 region_length = valid.region_length(gfxregion); if (region_length == 0) - osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.cstr()); + osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.c_str()); // if we have a valid region, and we're not using auto-sizing, check the decode against the region length else if (!IS_FRAC(layout.total)) diff --git a/src/emu/diimage.c b/src/emu/diimage.c index 385bc883647..92eff0e159f 100644 --- a/src/emu/diimage.c +++ b/src/emu/diimage.c @@ -236,7 +236,7 @@ static const char *const messages[] = const char *device_image_interface::error() { - return (m_err_message) ? m_err_message.cstr() : messages[m_err]; + return (m_err_message) ? m_err_message.c_str() : messages[m_err]; } @@ -295,7 +295,7 @@ bool device_image_interface::try_change_working_directory(const char *subdir) bool success = FALSE; bool done = FALSE; - directory = osd_opendir(m_working_directory.cstr()); + directory = osd_opendir(m_working_directory.c_str()); if (directory != NULL) { while(!done && (entry = osd_readdir(directory)) != NULL) @@ -536,7 +536,7 @@ bool device_image_interface::uses_file_extension(const char *file_extension) con /* find the extensions */ astring extensions(file_extensions()); - char *ext = strtok((char*)extensions.cstr(),","); + char *ext = strtok((char*)extensions.c_str(),","); while (ext != NULL) { if (!core_stricmp(ext, file_extension)) @@ -823,17 +823,17 @@ bool device_image_interface::load_software(software_list_device &swlist, const c // - if we are not using lists, we have regiontag only; // - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname // try to load from list/setname - if ((m_mame_file == NULL) && (tag2.cstr() != NULL)) - filerr = common_process_file(device().machine().options(), tag2.cstr(), has_crc, crc, romp, &m_mame_file); + if ((m_mame_file == NULL) && (tag2.c_str() != NULL)) + filerr = common_process_file(device().machine().options(), tag2.c_str(), has_crc, crc, romp, &m_mame_file); // try to load from list/parentname - if ((m_mame_file == NULL) && (tag3.cstr() != NULL)) - filerr = common_process_file(device().machine().options(), tag3.cstr(), has_crc, crc, romp, &m_mame_file); + if ((m_mame_file == NULL) && (tag3.c_str() != NULL)) + filerr = common_process_file(device().machine().options(), tag3.c_str(), has_crc, crc, romp, &m_mame_file); // try to load from setname - if ((m_mame_file == NULL) && (tag4.cstr() != NULL)) - filerr = common_process_file(device().machine().options(), tag4.cstr(), has_crc, crc, romp, &m_mame_file); + if ((m_mame_file == NULL) && (tag4.c_str() != NULL)) + filerr = common_process_file(device().machine().options(), tag4.c_str(), has_crc, crc, romp, &m_mame_file); // try to load from parentname - if ((m_mame_file == NULL) && (tag5.cstr() != NULL)) - filerr = common_process_file(device().machine().options(), tag5.cstr(), has_crc, crc, romp, &m_mame_file); + if ((m_mame_file == NULL) && (tag5.c_str() != NULL)) + filerr = common_process_file(device().machine().options(), tag5.c_str(), has_crc, crc, romp, &m_mame_file); warningcount += verify_length_and_hash(m_mame_file,ROM_GETNAME(romp),ROM_GETLENGTH(romp),hash_collection(ROM_GETHASHDATA(romp))); diff --git a/src/emu/disound.c b/src/emu/disound.c index 1c088021d82..2e9b2cca36b 100644 --- a/src/emu/disound.c +++ b/src/emu/disound.c @@ -238,14 +238,14 @@ void device_sound_interface::interface_validity_check(validity_checker &valid) c for (const sound_route *route = first_route(); route != NULL; route = route->next()) { // find a device with the requested tag - const device_t *target = device().siblingdevice(route->m_target.cstr()); + const device_t *target = device().siblingdevice(route->m_target.c_str()); if (target == NULL) - osd_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.cstr()); + osd_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.c_str()); // if it's not a speaker or a sound device, error const device_sound_interface *sound; if (target != NULL && target->type() != SPEAKER && !target->interface(sound)) - osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.cstr(), target->name()); + osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.c_str(), target->name()); } } @@ -318,13 +318,13 @@ void device_sound_interface::interface_post_start() int streamoutputnum; sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum); if (outputstream == NULL) - fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.cstr(), outputnum); + fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.c_str(), outputnum); // find the input stream to connect to int streaminputnum; sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum); if (inputstream == NULL) - fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d\n", route->m_target.cstr(), outputnum, m_device.tag(), inputnum - 1); + fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d\n", route->m_target.c_str(), outputnum, m_device.tag(), inputnum - 1); // set the input inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain); diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index 52ca361a7db..8a5b3a20fb0 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -532,7 +532,7 @@ bool emu_options::parse_one_ini(const char *basename, int priority, astring *err // append errors if requested if (error && error_string != NULL) - error_string->catprintf("While parsing %s:\n%s\n", file.fullpath(), error.cstr()); + error_string->catprintf("While parsing %s:\n%s\n", file.fullpath(), error.c_str()); return result; } @@ -544,7 +544,7 @@ const char *emu_options::main_value(astring &buffer, const char *name) const int pos = buffer.chr(0, ','); if (pos != -1) buffer = buffer.substr(0, pos); - return buffer.cstr(); + return buffer.c_str(); } const char *emu_options::sub_value(astring &buffer, const char *name, const char *subname) const @@ -561,5 +561,5 @@ const char *emu_options::sub_value(astring &buffer, const char *name, const char } else buffer.reset(); - return buffer.cstr(); + return buffer.c_str(); } diff --git a/src/emu/emupal.c b/src/emu/emupal.c index 0831d50a712..617d594ff66 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -409,7 +409,7 @@ void palette_device::device_start() { // find the extended (split) memory, if present astring tag_ext(tag(), "_ext"); - const memory_share *share_ext = memshare(tag_ext.cstr()); + const memory_share *share_ext = memshare(tag_ext.c_str()); // make sure we have specified a format assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified"); diff --git a/src/emu/fileio.c b/src/emu/fileio.c index cc4ff44ff2a..646825ae13e 100644 --- a/src/emu/fileio.c +++ b/src/emu/fileio.c @@ -845,16 +845,16 @@ file_error emu_file::attempt__7zped() int fileno = -1; // see if we can find a file with the right name and (if available) crc - if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), true, true); + if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), true, true); // if that failed, look for a file with the right crc, but the wrong filename if (fileno==-1) - if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), true, false); + if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), true, false); // if that failed, look for a file with the right name; reporting a bad checksum // is more helpful and less confusing than reporting "rom not found" if (fileno==-1) - fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), false, true); + fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), false, true); if (fileno != -1) { diff --git a/src/emu/image.c b/src/emu/image.c index 943ab30e4fe..1ca389f61cd 100644 --- a/src/emu/image.c +++ b/src/emu/image.c @@ -232,8 +232,8 @@ void image_device_init(running_machine &machine) fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s", image->device().name(), - image_basename.cstr(), - image_err.cstr()); + image_basename.c_str(), + image_err.c_str()); } } } @@ -280,7 +280,7 @@ void image_postdevice_init(running_machine &machine) fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s", image->device().name(), - image_err.cstr()); + image_err.c_str()); } } diff --git a/src/emu/imagedev/cassette.c b/src/emu/imagedev/cassette.c index 4c6cbfe3520..60f5b0f4f57 100644 --- a/src/emu/imagedev/cassette.c +++ b/src/emu/imagedev/cassette.c @@ -280,7 +280,7 @@ bool cassette_image_device::call_load() fname = m_mame_file->filename(); int loc = fname.rchr(0,'.'); if (loc!=-1) { - extension = fname.substr(loc + 1,fname.len()-loc).cstr(); + extension = fname.substr(loc + 1,fname.len()-loc).c_str(); } else { extension = ""; } diff --git a/src/emu/imagedev/diablo.c b/src/emu/imagedev/diablo.c index 4fefea270c4..49d68cc62d6 100644 --- a/src/emu/imagedev/diablo.c +++ b/src/emu/imagedev/diablo.c @@ -173,7 +173,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file astring fname(name, ".dif"); /* try to open the diff */ - //printf("Opening differencing image file: %s\n", fname.cstr()); + //printf("Opening differencing image file: %s\n", fname.c_str()); emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE); file_error filerr = diff_file.open(fname); if (filerr == FILERR_NONE) @@ -181,12 +181,12 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file astring fullpath(diff_file.fullpath()); diff_file.close(); - //printf("Opening differencing image file: %s\n", fullpath.cstr()); + //printf("Opening differencing image file: %s\n", fullpath.c_str()); return diff_chd.open(fullpath, true, &source); } /* didn't work; try creating it instead */ - //printf("Creating differencing image: %s\n", fname.cstr()); + //printf("Creating differencing image: %s\n", fname.c_str()); diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); filerr = diff_file.open(fname); if (filerr == FILERR_NONE) @@ -195,7 +195,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file diff_file.close(); /* create the CHD */ - //printf("Creating differencing image file: %s\n", fullpath.cstr()); + //printf("Creating differencing image file: %s\n", fullpath.c_str()); chd_codec_type compression[4] = { CHD_CODEC_NONE }; chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source); if (err != CHDERR_NONE) diff --git a/src/emu/imagedev/harddriv.c b/src/emu/imagedev/harddriv.c index 39df8d250a4..6960662dc64 100644 --- a/src/emu/imagedev/harddriv.c +++ b/src/emu/imagedev/harddriv.c @@ -179,7 +179,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file astring fname(name, ".dif"); /* try to open the diff */ - //printf("Opening differencing image file: %s\n", fname.cstr()); + //printf("Opening differencing image file: %s\n", fname.c_str()); emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE); file_error filerr = diff_file.open(fname); if (filerr == FILERR_NONE) @@ -187,12 +187,12 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file astring fullpath(diff_file.fullpath()); diff_file.close(); - //printf("Opening differencing image file: %s\n", fullpath.cstr()); + //printf("Opening differencing image file: %s\n", fullpath.c_str()); return diff_chd.open(fullpath, true, &source); } /* didn't work; try creating it instead */ - //printf("Creating differencing image: %s\n", fname.cstr()); + //printf("Creating differencing image: %s\n", fname.c_str()); diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); filerr = diff_file.open(fname); if (filerr == FILERR_NONE) @@ -201,7 +201,7 @@ static chd_error open_disk_diff(emu_options &options, const char *name, chd_file diff_file.close(); /* create the CHD */ - //printf("Creating differencing image file: %s\n", fullpath.cstr()); + //printf("Creating differencing image file: %s\n", fullpath.c_str()); chd_codec_type compression[4] = { CHD_CODEC_NONE }; chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source); if (err != CHDERR_NONE) diff --git a/src/emu/info.c b/src/emu/info.c index 4b64a0647ba..54cd2734c34 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -197,7 +197,7 @@ void info_xml_creator::output(FILE *out) dtd.replace(0,"__XML_ROOT__", emulator_info::get_xml_root()); dtd.replace(0,"__XML_TOP__", emulator_info::get_xml_top()); - fprintf(m_output, "%s\n\n", dtd.cstr()); + fprintf(m_output, "%s\n\n", dtd.c_str()); // top-level tag fprintf(m_output, "<%s build=\"%s\" debug=\"" @@ -343,7 +343,7 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag) fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname())); astring src(device.source()); src.replace("../",""); - fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.cstr())); + fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.c_str())); fprintf(m_output, " isdevice=\"yes\""); fprintf(m_output, " runnable=\"no\""); output_sampleof(); @@ -404,7 +404,7 @@ void info_xml_creator::output_devices() { astring temptag("_"); temptag.cat(option->name()); - device_t *dev = const_cast(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), option->devtype(), 0); + device_t *dev = const_cast(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.c_str(), option->devtype(), 0); // notify this device and all its subdevices that they are now configured device_iterator subiter(*dev); @@ -413,9 +413,9 @@ void info_xml_creator::output_devices() device->config_complete(); if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE) - output_one_device(*dev, temptag.cstr()); + output_one_device(*dev, temptag.c_str()); - const_cast(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.cstr()); + const_cast(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.c_str()); } } } @@ -582,7 +582,7 @@ void info_xml_creator::output_rom(device_t &device) output.cat("/>\n"); - fprintf(m_output, "%s", output.cstr()); + fprintf(m_output, "%s", output.c_str()); } } } @@ -1085,7 +1085,7 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char * // output the switch name information astring normalized_field_name(xml_normalize_string(field->name())); astring normalized_newtag(xml_normalize_string(newtag)); - output.catprintf("\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.cstr(), normalized_newtag.cstr(), field->mask()); + output.catprintf("\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.c_str(), normalized_newtag.c_str(), field->mask()); // loop over settings for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next()) @@ -1096,7 +1096,7 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char * // terminate the switch entry output.catprintf("\t\t\n", outertag); - fprintf(m_output, "%s", output.cstr()); + fprintf(m_output, "%s", output.c_str()); } } @@ -1240,7 +1240,7 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag) astring extensions(imagedev->file_extensions()); - char *ext = strtok((char *)extensions.cstr(), ","); + char *ext = strtok((char *)extensions.c_str(), ","); while (ext != NULL) { fprintf(m_output, "\t\t\t(strcopy.cstr()); + char *str = const_cast(strcopy.c_str()); while (1) { // trim any leading spaces diff --git a/src/emu/ioport.c b/src/emu/ioport.c index 3487241fa83..25da324ee38 100644 --- a/src/emu/ioport.c +++ b/src/emu/ioport.c @@ -2482,7 +2482,7 @@ time_t ioport_manager::initialize() astring errors; m_portlist.append(*device, errors); if (errors) - osd_printf_error("Input port errors:\n%s", errors.cstr()); + osd_printf_error("Input port errors:\n%s", errors.c_str()); } // renumber player numbers for controller ports @@ -3703,9 +3703,9 @@ void ioport_configurer::port_modify(const char *tag) m_owner.subtag(fulltag, tag); // find the existing port - m_curport = m_portlist.find(fulltag.cstr()); + m_curport = m_portlist.find(fulltag.c_str()); if (m_curport == NULL) - throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr()); + throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.c_str()); // bump the modification count, and reset current field/setting m_curport->m_modcount++; diff --git a/src/emu/luaengine.c b/src/emu/luaengine.c index f31e7c4550d..12be9947cae 100644 --- a/src/emu/luaengine.c +++ b/src/emu/luaengine.c @@ -1044,7 +1044,7 @@ void lua_engine::periodic_check() osd_lock_acquire(lock); if (msg.ready == 1) { lua_settop(m_lua_state, 0); - int status = luaL_loadbuffer(m_lua_state, msg.text.cstr(), strlen(msg.text.cstr()), "=stdin"); + int status = luaL_loadbuffer(m_lua_state, msg.text.c_str(), strlen(msg.text.c_str()), "=stdin"); if (incomplete(status)==0) /* cannot try to add lines? */ { if (status == LUA_OK) status = docall(0, LUA_MULTRET); diff --git a/src/emu/machine.c b/src/emu/machine.c index f87e597de5d..ca3c7a6c531 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -592,7 +592,7 @@ astring running_machine::get_statename(const char *option) // copy the device name to an astring astring devname_str; devname_str.cpysubstr(statename_str, pos + 3, end - pos - 3); - //printf("check template: %s\n", devname_str.cstr()); + //printf("check template: %s\n", devname_str.c_str()); // verify that there is such a device for this system image_interface_iterator iter(root_device()); @@ -600,7 +600,7 @@ astring running_machine::get_statename(const char *option) { // get the device name astring tempdevname(image->brief_instance_name()); - //printf("check device: %s\n", tempdevname.cstr()); + //printf("check device: %s\n", tempdevname.c_str()); if (devname_str.cmp(tempdevname) == 0) { @@ -612,7 +612,7 @@ astring running_machine::get_statename(const char *option) // setup snapname and remove the %d_ statename_str.replace(0, devname_str, filename); statename_str.del(pos, 3); - //printf("check image: %s\n", filename.cstr()); + //printf("check image: %s\n", filename.c_str()); name_found = 1; } @@ -651,7 +651,7 @@ void running_machine::set_saveload_filename(const char *filename) // take into account the statename option const char *stateopt = options().state_name(); astring statename = get_statename(stateopt); - m_saveload_pending_file.cpy(statename.cstr()).cat(PATH_SEPARATOR).cat(filename).cat(".sta"); + m_saveload_pending_file.cpy(statename.c_str()).cat(PATH_SEPARATOR).cat(filename).cat(".sta"); } } diff --git a/src/emu/machine/fdc_pll.c b/src/emu/machine/fdc_pll.c index 80819c16164..a035a9c868b 100644 --- a/src/emu/machine/fdc_pll.c +++ b/src/emu/machine/fdc_pll.c @@ -60,7 +60,7 @@ int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const att #if 0 if(!edge.is_never()) - fprintf(stderr, "ctime=%s, transition_time=%s, next=%s, pha=%s\n", tts(ctime).cstr(), tts(edge).cstr(), tts(next).cstr(), tts(phase_adjust).cstr()); + fprintf(stderr, "ctime=%s, transition_time=%s, next=%s, pha=%s\n", tts(ctime).c_str(), tts(edge).c_str(), tts(next).c_str(), tts(phase_adjust).c_str()); #endif if(next > limit) diff --git a/src/emu/machine/hdc9234.c b/src/emu/machine/hdc9234.c index fd1857414c7..06572bbfd70 100644 --- a/src/emu/machine/hdc9234.c +++ b/src/emu/machine/hdc9234.c @@ -572,7 +572,7 @@ void hdc9234_device::wait_time(emu_timer *tm, int microsec, int next_substate) void hdc9234_device::wait_time(emu_timer *tm, const attotime &delay, int param) { - if (TRACE_DELAY) logerror("%s: [%s] Delaying by %4.2f microsecs\n", tag(), ttsn().cstr(), delay.as_double()*1000000); + if (TRACE_DELAY) logerror("%s: [%s] Delaying by %4.2f microsecs\n", tag(), ttsn().c_str(), delay.as_double()*1000000); tm->adjust(delay); m_substate = param; } @@ -1784,7 +1784,7 @@ astring hdc9234_device::ttsn() */ void hdc9234_device::live_start(int state) { - if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().cstr(), state); + if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().c_str(), state); m_live_state.time = machine().time(); m_live_state.state = state; m_live_state.next_state = -1; @@ -1828,9 +1828,9 @@ void hdc9234_device::live_run_until(attotime limit) if (TRACE_LIVE) { if (limit == attotime::never) - logerror("%s: [%s] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).cstr(), m_live_state.state, fm_mode()? "FM":"MFM"); + logerror("%s: [%s] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); else - logerror("%s: [%s] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).cstr(), tts(limit).cstr(), m_live_state.state, fm_mode()? "FM":"MFM"); + logerror("%s: [%s] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); } if (limit == attotime::never) @@ -1862,7 +1862,7 @@ void hdc9234_device::live_run_until(attotime limit) if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM) { - logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).cstr(), tts(limit).cstr()); + logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str()); m_last_live_state = m_live_state.state; } @@ -1871,11 +1871,11 @@ void hdc9234_device::live_run_until(attotime limit) if (read_one_bit(limit)) { - if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str()); return; } - // logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).cstr()); - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg, + // logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).c_str()); + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); // [1] p. 9: The ID field sync mark must be found within 33,792 byte times @@ -1890,7 +1890,7 @@ void hdc9234_device::live_run_until(attotime limit) // MFM case if (m_live_state.shift_reg == 0x4489) { - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); m_live_state.crc = 0x443b; m_live_state.data_separator_phase = false; m_live_state.bit_counter = 0; @@ -1921,14 +1921,14 @@ void hdc9234_device::live_run_until(attotime limit) if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_IDAM) { - logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).cstr()); + logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } // Beyond time limit? if (read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); if (m_live_state.bit_count_total > 33792*16) @@ -1950,12 +1950,12 @@ void hdc9234_device::live_run_until(attotime limit) m_live_state.state = SEARCH_IDAM; } else - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); // Continue break; } - if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg); + if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg); // Check for ident field (fe, ff, fd, fc) if ((m_live_state.data_reg & 0xfc) != 0xfc) @@ -1976,7 +1976,7 @@ void hdc9234_device::live_run_until(attotime limit) case READ_ID_FIELDS_INTO_REGS: if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS) { - logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).cstr()); + logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2017,7 +2017,7 @@ void hdc9234_device::live_run_until(attotime limit) case SEARCH_DAM: if (TRACE_LIVE && m_last_live_state != SEARCH_DAM) { - logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).cstr()); + logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2026,7 +2026,7 @@ void hdc9234_device::live_run_until(attotime limit) if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); if (!fm_mode()) @@ -2040,7 +2040,7 @@ void hdc9234_device::live_run_until(attotime limit) if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489) { - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); m_live_state.crc = 0x443b; m_live_state.data_separator_phase = false; m_live_state.bit_counter = 0; @@ -2074,14 +2074,14 @@ void hdc9234_device::live_run_until(attotime limit) case READ_TWO_MORE_A1_DAM: { if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_DAM) { - logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).cstr()); + logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); // Repeat until we have collected 16 bits @@ -2098,12 +2098,12 @@ void hdc9234_device::live_run_until(attotime limit) return; } else - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); // Continue break; } - if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg); + if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg); if ((m_live_state.data_reg & 0xff) == 0xf8) { @@ -2133,7 +2133,7 @@ void hdc9234_device::live_run_until(attotime limit) { if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA) { - logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).cstr()); + logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2158,7 +2158,7 @@ void hdc9234_device::live_run_until(attotime limit) // Repeat until we have collected 16 bits if (m_live_state.bit_counter & 15) break; - if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg, m_live_state.crc); + if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc); int slot = (m_live_state.bit_counter >> 4)-1; if (slot < calc_sector_size()) @@ -2179,7 +2179,7 @@ void hdc9234_device::live_run_until(attotime limit) } else { - if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).c_str()); wait_for_realtime(IDLE); } return; @@ -2191,7 +2191,7 @@ void hdc9234_device::live_run_until(attotime limit) case READ_SECTOR_DATA1: if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA1) { - logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).cstr()); + logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2237,7 +2237,7 @@ void hdc9234_device::live_run_until(attotime limit) // 5. Write the CRC bytes if (TRACE_LIVE) - logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).cstr()); + logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str()); skip_on_track(m_gap2_size, WRITE_DAM_SYNC); break; @@ -2554,14 +2554,14 @@ void hdc9234_device::live_run_until(attotime limit) // The pause is implemented by doing dummy reads on the floppy if (read_one_bit(limit)) { - if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).cstr(), tts(limit).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str()); return; } // Repeat until we have collected 16 bits if ((m_live_state.bit_counter & 15)==0) { - if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).cstr(), m_live_state.data_reg, m_live_state.repeat); + if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat); wait_for_realtime(READ_TRACK_NEXT_BYTE); return; } @@ -2636,7 +2636,7 @@ void hdc9234_device::live_sync() if(m_live_state.time > machine().time()) { // If so, we must roll back to the last checkpoint - if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().cstr(), tts(m_live_state.time).cstr()); + if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); rollback(); // and replay until we reach the machine time live_run_until(machine().time()); @@ -2647,7 +2647,7 @@ void hdc9234_device::live_sync() { // We are behind machine time, so we will never get back to that // time, thus we can commit that position - if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().cstr(), tts(m_live_state.time).cstr()); + if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); // Write on floppy image m_pll.commit(m_floppy, m_live_state.time); @@ -2672,7 +2672,7 @@ void hdc9234_device::live_abort() { if (!m_live_state.time.is_never() && m_live_state.time > machine().time()) { - if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().cstr(), tts(m_live_state.time).cstr()); + if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().c_str(), tts(m_live_state.time).c_str()); rollback(); live_run_until(machine().time()); } @@ -2735,7 +2735,7 @@ void hdc9234_device::wait_for_realtime(int state) { m_live_state.next_state = state; m_timer->adjust(m_live_state.time - machine().time()); - if (TRACE_LIVE) logerror("%s: [%s] Waiting for real time [%s] to catch up\n", tag(), tts(m_live_state.time).cstr(), tts(machine().time()).cstr()); + if (TRACE_LIVE) logerror("%s: [%s] Waiting for real time [%s] to catch up\n", tag(), tts(m_live_state.time).c_str(), tts(machine().time()).c_str()); } /* @@ -2858,7 +2858,7 @@ void hdc9234_device::encode_byte(UINT8 byte) m_live_state.bit_counter = 16; m_live_state.last_data_bit = raw & 1; m_live_state.shift_reg = m_live_state.shift_reg_save = raw; - if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).cstr(), byte, raw); + if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), byte, raw); checkpoint(); } @@ -2872,7 +2872,7 @@ void hdc9234_device::encode_raw(UINT16 raw) m_live_state.bit_counter = 16; m_live_state.shift_reg = m_live_state.shift_reg_save = raw; m_live_state.last_data_bit = raw & 1; - if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).cstr(), get_data_from_encoding(raw), raw); + if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), get_data_from_encoding(raw), raw); checkpoint(); } @@ -2960,7 +2960,7 @@ WRITE8_MEMBER( hdc9234_device::write ) { if (m_executing) { - logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().cstr(), current_command(), data); + logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().c_str(), current_command(), data); } else { @@ -3169,7 +3169,7 @@ void hdc9234_device::auxbus_in(UINT8 data) void hdc9234_device::index_callback(int level) { - if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().cstr(), level); + if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().c_str(), level); // Synchronize our position on the track live_sync(); @@ -3182,7 +3182,7 @@ void hdc9234_device::index_callback(int level) if (m_event_line == INDEX_LINE && level == m_line_level && m_state_after_line != UNDEF) { - if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().cstr(), level); + if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().c_str(), level); m_substate = m_state_after_line; m_state_after_line = UNDEF; if (m_stopwrite) @@ -3197,7 +3197,7 @@ void hdc9234_device::index_callback(int level) void hdc9234_device::ready_callback(int level) { - if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().cstr(), level); + if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().c_str(), level); // Set the interrupt status flag set_bits(m_register_r[INT_STATUS], ST_RDYCHNG, true); @@ -3222,7 +3222,7 @@ void hdc9234_device::ready_callback(int level) void hdc9234_device::seek_complete_callback(int level) { - if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().cstr(), level); + if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().c_str(), level); // Synchronize our position on the track live_sync(); @@ -3323,7 +3323,7 @@ WRITE_LINE_MEMBER( hdc9234_device::dmaack ) { if (state==ASSERT_LINE) { - if (TRACE_DMA) logerror("%s: [%s] DMA acknowledged\n", tag(), ttsn().cstr()); + if (TRACE_DMA) logerror("%s: [%s] DMA acknowledged\n", tag(), ttsn().c_str()); set_bits(m_register_r[INT_STATUS], ST_OVRUN, false); } } diff --git a/src/emu/machine/ram.c b/src/emu/machine/ram.c index 110587f8908..5a82254d994 100644 --- a/src/emu/machine/ram.c +++ b/src/emu/machine/ram.c @@ -162,7 +162,7 @@ void ram_device::device_validity_check(validity_checker &valid) const else output.catprintf(").\n"); - osd_printf_error("%s", output.cstr()); + osd_printf_error("%s", output.c_str()); osd_printf_warning("Setting value to default %s\n",m_default_size); astring error; diff --git a/src/emu/machine/upd765.c b/src/emu/machine/upd765.c index 5ee2370b837..214e10f8614 100644 --- a/src/emu/machine/upd765.c +++ b/src/emu/machine/upd765.c @@ -676,7 +676,7 @@ void upd765_family_device::live_run(attotime limit) if(read_one_bit(limit)) return; #if 0 - fprintf(stderr, "%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + fprintf(stderr, "%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -707,7 +707,7 @@ void upd765_family_device::live_run(attotime limit) if(read_one_bit(limit)) return; #if 0 - fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -747,7 +747,7 @@ void upd765_family_device::live_run(attotime limit) int slot = (cur_live.bit_counter >> 4)-1; if(0) - fprintf(stderr, "%s: slot=%d data=%02x crc=%04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc); + fprintf(stderr, "%s: slot=%d data=%02x crc=%04x\n", tts(cur_live.tm).c_str(), slot, cur_live.data_reg, cur_live.crc); cur_live.idbuf[slot] = cur_live.data_reg; if(slot == 5) { live_delay(IDLE); @@ -760,7 +760,7 @@ void upd765_family_device::live_run(attotime limit) if(read_one_bit(limit)) return; #if 0 - fprintf(stderr, "%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + fprintf(stderr, "%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -806,7 +806,7 @@ void upd765_family_device::live_run(attotime limit) if(read_one_bit(limit)) return; #if 0 - fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -1117,7 +1117,7 @@ void upd765_family_device::live_run(attotime limit) break; default: - logerror("%s: Unknown live state %d\n", tts(cur_live.tm).cstr(), cur_live.state); + logerror("%s: Unknown live state %d\n", tts(cur_live.tm).c_str(), cur_live.state); return; } } @@ -1711,7 +1711,7 @@ void upd765_family_device::read_data_continue(floppy_info &fi) return; default: - logerror("%s: read sector unknown sub-state %d\n", ttsn().cstr(), fi.sub_state); + logerror("%s: read sector unknown sub-state %d\n", ttsn().c_str(), fi.sub_state); return; } } @@ -1837,7 +1837,7 @@ void upd765_family_device::write_data_continue(floppy_info &fi) return; default: - logerror("%s: write sector unknown sub-state %d\n", ttsn().cstr(), fi.sub_state); + logerror("%s: write sector unknown sub-state %d\n", ttsn().c_str(), fi.sub_state); return; } } @@ -2007,7 +2007,7 @@ void upd765_family_device::read_track_continue(floppy_info &fi) return; default: - logerror("%s: read track unknown sub-state %d\n", ttsn().cstr(), fi.sub_state); + logerror("%s: read track unknown sub-state %d\n", ttsn().c_str(), fi.sub_state); return; } } @@ -2080,7 +2080,7 @@ void upd765_family_device::format_track_continue(floppy_info &fi) return; default: - logerror("%s: format track unknown sub-state %d\n", ttsn().cstr(), fi.sub_state); + logerror("%s: format track unknown sub-state %d\n", ttsn().c_str(), fi.sub_state); return; } } @@ -2159,7 +2159,7 @@ void upd765_family_device::read_id_continue(floppy_info &fi) return; default: - logerror("%s: read id unknown sub-state %d\n", ttsn().cstr(), fi.sub_state); + logerror("%s: read id unknown sub-state %d\n", ttsn().c_str(), fi.sub_state); return; } } @@ -2287,7 +2287,7 @@ void upd765_family_device::index_callback(floppy_image_device *floppy, int state break; default: - logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().cstr(), fi.sub_state); + logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().c_str(), fi.sub_state); break; } @@ -2335,7 +2335,7 @@ void upd765_family_device::general_continue(floppy_info &fi) break; default: - logerror("%s: general_continue on unknown main-state %d\n", ttsn().cstr(), fi.main_state); + logerror("%s: general_continue on unknown main-state %d\n", ttsn().c_str(), fi.main_state); break; } } diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index ced6475e82d..6205f92f973 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -383,7 +383,7 @@ void wd_fdc_t::seek_continue() return; default: - logerror("%s: seek unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: seek unknown sub-state %d\n", ttsn().c_str(), sub_state); return; } } @@ -505,7 +505,7 @@ void wd_fdc_t::read_sector_continue() break; default: - logerror("%s: read sector unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: read sector unknown sub-state %d\n", ttsn().c_str(), sub_state); return; } } @@ -584,7 +584,7 @@ void wd_fdc_t::read_track_continue() return; default: - logerror("%s: read track unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: read track unknown sub-state %d\n", ttsn().c_str(), sub_state); return; } } @@ -659,7 +659,7 @@ void wd_fdc_t::read_id_continue() return; default: - logerror("%s: read id unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: read id unknown sub-state %d\n", ttsn().c_str(), sub_state); return; } } @@ -763,12 +763,12 @@ void wd_fdc_t::write_track_continue() sprintf(buf, "%02x", format_last_byte); format_description_string += buf; } - if (TRACE_DESC) logerror("%s: track description %s\n", tag(), format_description_string.cstr()); + if (TRACE_DESC) logerror("%s: track description %s\n", tag(), format_description_string.c_str()); command_end(); return; default: - logerror("%s: write track unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: write track unknown sub-state %d\n", ttsn().c_str(), sub_state); return; } } @@ -867,7 +867,7 @@ void wd_fdc_t::write_sector_continue() break; default: - logerror("%s: write sector unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: write sector unknown sub-state %d\n", ttsn().c_str(), sub_state); return; } } @@ -898,7 +898,7 @@ void wd_fdc_t::interrupt_start() } if(command & 0x03) { - logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().cstr(), command); + logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().c_str(), command); } } @@ -932,7 +932,7 @@ void wd_fdc_t::general_continue() write_sector_continue(); break; default: - logerror("%s: general_continue on unknown main-state %d\n", ttsn().cstr(), main_state); + logerror("%s: general_continue on unknown main-state %d\n", ttsn().c_str(), main_state); break; } } @@ -963,7 +963,7 @@ void wd_fdc_t::do_generic() default: if(cur_live.tm.is_never()) - logerror("%s: do_generic on unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: do_generic on unknown sub-state %d\n", ttsn().c_str(), sub_state); break; } } @@ -1285,7 +1285,7 @@ void wd_fdc_t::index_callback(floppy_image_device *floppy, int state) break; default: - logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().cstr(), sub_state); + logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().c_str(), sub_state); break; } @@ -1360,12 +1360,12 @@ void wd_fdc_t::live_sync() { if(!cur_live.tm.is_never()) { if(cur_live.tm > machine().time()) { - if (TRACE_SYNC) logerror("%s: Rolling back and replaying (%s)\n", ttsn().cstr(), tts(cur_live.tm).cstr()); + if (TRACE_SYNC) logerror("%s: Rolling back and replaying (%s)\n", ttsn().c_str(), tts(cur_live.tm).c_str()); rollback(); live_run(machine().time()); pll_commit(floppy, cur_live.tm); } else { - if (TRACE_SYNC) logerror("%s: Committing (%s)\n", ttsn().cstr(), tts(cur_live.tm).cstr()); + if (TRACE_SYNC) logerror("%s: Committing (%s)\n", ttsn().c_str(), tts(cur_live.tm).c_str()); pll_commit(floppy, cur_live.tm); if(cur_live.next_state != -1) { cur_live.state = cur_live.next_state; @@ -1485,7 +1485,7 @@ void wd_fdc_t::live_run(attotime limit) } } - // fprintf(stderr, "%s: live_run(%s)\n", ttsn().cstr(), tts(limit).cstr()); + // fprintf(stderr, "%s: live_run(%s)\n", ttsn().c_str(), tts(limit).c_str()); for(;;) { switch(cur_live.state) { @@ -1493,7 +1493,7 @@ void wd_fdc_t::live_run(attotime limit) if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -1526,7 +1526,7 @@ void wd_fdc_t::live_run(attotime limit) if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -1568,7 +1568,7 @@ void wd_fdc_t::live_run(attotime limit) if(cur_live.bit_counter & 15) break; int slot = (cur_live.bit_counter >> 4)-1; - // fprintf(stderr, "%s: slot[%d] = %02x crc = %04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc); + // fprintf(stderr, "%s: slot[%d] = %02x crc = %04x\n", tts(cur_live.tm).c_str(), slot, cur_live.data_reg, cur_live.crc); cur_live.idbuf[slot] = cur_live.data_reg; if(slot == 5) { live_delay(IDLE); @@ -1609,7 +1609,7 @@ void wd_fdc_t::live_run(attotime limit) if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -1656,7 +1656,7 @@ void wd_fdc_t::live_run(attotime limit) if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg, + if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg, (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) | (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) | (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) | @@ -1954,7 +1954,7 @@ void wd_fdc_t::live_run(attotime limit) break; default: - logerror("%s: Unknown sub state %d in WRITE_BYTE_DONE\n", tts(cur_live.tm).cstr(), sub_state); + logerror("%s: Unknown sub state %d in WRITE_BYTE_DONE\n", tts(cur_live.tm).c_str(), sub_state); live_abort(); return; } @@ -2017,7 +2017,7 @@ void wd_fdc_t::live_run(attotime limit) break; default: - logerror("%s: Unknown live state %d\n", tts(cur_live.tm).cstr(), cur_live.state); + logerror("%s: Unknown live state %d\n", tts(cur_live.tm).c_str(), cur_live.state); return; } } @@ -2186,12 +2186,12 @@ int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_dev /* if (TRACE_TRANSITION) if(!when.is_never()) - logerror("transition_time=%s\n", tts(when).cstr()); + logerror("transition_time=%s\n", tts(when).c_str()); */ for(;;) { // if (TRACE_TRANSITION) logerror("slot=%2d, counter=%03x\n", slot, counter); attotime etime = ctime+delays[slot]; - // if (TRACE_TRANSITION) logerror("etime=%s\n", tts(etime).cstr()); + // if (TRACE_TRANSITION) logerror("etime=%s\n", tts(etime).c_str()); if(etime > limit) return -1; if(transition_time == 0xffff && !when.is_never() && etime >= when) diff --git a/src/emu/mame.c b/src/emu/mame.c index b2df26d661b..9632ab04a79 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -285,15 +285,15 @@ void CLIB_DECL popmessage(const char *format, ...) va_end(arg); // pop it in the UI - machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.cstr()); + machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.c_str()); /* // also write to error.log - logerror("popmessage: %s\n", temp.cstr()); + logerror("popmessage: %s\n", temp.c_str()); #ifdef MAME_DEBUG // and to command-line in a DEBUG build - osd_printf_info("popmessage: %s\n", temp.cstr()); + osd_printf_info("popmessage: %s\n", temp.c_str()); #endif */ } diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c index 66563827b45..9a87c269328 100644 --- a/src/emu/mconfig.c +++ b/src/emu/mconfig.c @@ -129,7 +129,7 @@ device_t *machine_config::device_add(device_t *owner, const char *tag, device_ty break; if (!curdevice) throw emu_fatalerror("Could not find %s when looking up path for device %s\n", - part.cstr(), orig_tag); + part.c_str(), orig_tag); owner = curdevice; tag = next+1; } diff --git a/src/emu/memory.c b/src/emu/memory.c index 2d2023ad12b..96f2fe2eb3a 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -1836,9 +1836,9 @@ void address_space::prepare_map() { // if we can't find it, add it to our map astring fulltag; - if (manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr()) == NULL) + if (manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str()) == NULL) { - VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.cstr(), entry->m_byteend + 1 - entry->m_bytestart)); + VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.c_str(), entry->m_byteend + 1 - entry->m_bytestart)); memory_share *share = global_alloc(memory_share(m_map->m_databits, entry->m_byteend + 1 - entry->m_bytestart, endianness())); manager().m_sharelist.append(fulltag, *share); } @@ -1880,7 +1880,7 @@ void address_space::prepare_map() entry->m_devbase.subtag(fulltag, entry->m_region); // set the memory address - entry->m_memory = machine().root_device().memregion(fulltag.cstr())->base() + entry->m_rgnoffs; + entry->m_memory = machine().root_device().memregion(fulltag.c_str())->base() + entry->m_rgnoffs; } } @@ -2154,7 +2154,7 @@ address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, of if (entry->m_memory == NULL && entry->m_share != NULL) { astring fulltag; - memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr()); + memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str()); if (share != NULL && share->ptr() != NULL) { entry->m_memory = share->ptr(); @@ -2177,7 +2177,7 @@ address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, of if (entry->m_memory != NULL && entry->m_share != NULL) { astring fulltag; - memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr()); + memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str()); if (share != NULL && share->ptr() == NULL) { share->set_ptr(entry->m_memory); @@ -2613,7 +2613,7 @@ bool address_space::needs_backing_store(const address_map_entry *entry) if (entry->m_share != NULL) { astring fulltag; - memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr()); + memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str()); if (share != NULL && share->ptr() == NULL) return true; } @@ -4022,7 +4022,7 @@ void memory_bank::set_entry(int entrynum) if (entrynum < 0 || entrynum >= m_entry.count()) throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum); if (m_entry[entrynum].m_raw == NULL) - throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.cstr(), entrynum); + throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.c_str(), entrynum); // set both raw and decrypted values m_curentry = entrynum; diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c index 72e8838f7f3..fe52fa8216f 100644 --- a/src/emu/rendlay.c +++ b/src/emu/rendlay.c @@ -1328,9 +1328,9 @@ void layout_element::component::load_bitmap() // log an error if (!m_alphafile[0]) - osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].cstr()); + osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].c_str()); else - osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].cstr(), m_alphafile[0].cstr()); + osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].c_str(), m_alphafile[0].c_str()); } } diff --git a/src/emu/romload.c b/src/emu/romload.c index f7c59bf2a5f..d18896734ba 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -441,13 +441,13 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp, bool is_chd_error = (is_chd && chderr != CHDERR_FILE_NOT_FOUND); if (is_chd_error) - romdata->errorstring.catprintf("%s CHD ERROR: %s\n", name.cstr(), chd_file::error_string(chderr)); + romdata->errorstring.catprintf("%s CHD ERROR: %s\n", name.c_str(), chd_file::error_string(chderr)); /* optional files are okay */ if (ROM_ISOPTIONAL(romp)) { if (!is_chd_error) - romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", name.cstr(), tried_file_names.cstr()); + romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", name.c_str(), tried_file_names.c_str()); romdata->warnings++; } @@ -455,7 +455,7 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp, else if (hash_collection(ROM_GETHASHDATA(romp)).flag(hash_collection::FLAG_NO_DUMP)) { if (!is_chd_error) - romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name.cstr(), tried_file_names.cstr()); + romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name.c_str(), tried_file_names.c_str()); romdata->knownbad++; } @@ -463,7 +463,7 @@ static void handle_missing_file(romload_private *romdata, const rom_entry *romp, else { if (!is_chd_error) - romdata->errorstring.catprintf("%s NOT FOUND%s\n", name.cstr(), tried_file_names.cstr()); + romdata->errorstring.catprintf("%s NOT FOUND%s\n", name.c_str(), tried_file_names.c_str()); romdata->errors++; } } @@ -560,7 +560,7 @@ static void display_rom_load_results(romload_private *romdata, bool from_list) if (romdata->errors != 0) { /* create the error message and exit fatally */ - osd_printf_error("%s", romdata->errorstring.cstr()); + osd_printf_error("%s", romdata->errorstring.c_str()); fatalerror_exitcode(romdata->machine(), MAMERR_MISSING_FILES, "Required files are missing, the %s cannot be run.",emulator_info::get_gamenoun()); } @@ -570,7 +570,7 @@ static void display_rom_load_results(romload_private *romdata, bool from_list) romdata->errorstring.cat("WARNING: the "); romdata->errorstring.cat(emulator_info::get_gamenoun()); romdata->errorstring.cat(" might not run correctly."); - osd_printf_warning("%s\n", romdata->errorstring.cstr()); + osd_printf_warning("%s\n", romdata->errorstring.c_str()); } } @@ -677,7 +677,7 @@ static int open_rom_file(romload_private *romdata, const char *regiontag, const } // prepare locations where we have to load from: list/parentname & list/clonename - astring swlist(tag1.cstr()); + astring swlist(tag1.c_str()); tag2.cpy(swlist.cat(tag4)); if (has_parent) { @@ -695,33 +695,33 @@ static int open_rom_file(romload_private *romdata, const char *regiontag, const if (!is_list) { tried_file_names += " " + tag1; - filerr = common_process_file(romdata->machine().options(), tag1.cstr(), has_crc, crc, romp, &romdata->file); + filerr = common_process_file(romdata->machine().options(), tag1.c_str(), has_crc, crc, romp, &romdata->file); } else { // try to load from list/setname - if ((romdata->file == NULL) && (tag2.cstr() != NULL)) + if ((romdata->file == NULL) && (tag2.c_str() != NULL)) { tried_file_names += " " + tag2; - filerr = common_process_file(romdata->machine().options(), tag2.cstr(), has_crc, crc, romp, &romdata->file); + filerr = common_process_file(romdata->machine().options(), tag2.c_str(), has_crc, crc, romp, &romdata->file); } // try to load from list/parentname - if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL)) + if ((romdata->file == NULL) && has_parent && (tag3.c_str() != NULL)) { tried_file_names += " " + tag3; - filerr = common_process_file(romdata->machine().options(), tag3.cstr(), has_crc, crc, romp, &romdata->file); + filerr = common_process_file(romdata->machine().options(), tag3.c_str(), has_crc, crc, romp, &romdata->file); } // try to load from setname - if ((romdata->file == NULL) && (tag4.cstr() != NULL)) + if ((romdata->file == NULL) && (tag4.c_str() != NULL)) { tried_file_names += " " + tag4; - filerr = common_process_file(romdata->machine().options(), tag4.cstr(), has_crc, crc, romp, &romdata->file); + filerr = common_process_file(romdata->machine().options(), tag4.c_str(), has_crc, crc, romp, &romdata->file); } // try to load from parentname - if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL)) + if ((romdata->file == NULL) && has_parent && (tag5.c_str() != NULL)) { tried_file_names += " " + tag5; - filerr = common_process_file(romdata->machine().options(), tag5.cstr(), has_crc, crc, romp, &romdata->file); + filerr = common_process_file(romdata->machine().options(), tag5.c_str(), has_crc, crc, romp, &romdata->file); } } } @@ -1078,7 +1078,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ } // prepare locations where we have to load from: list/parentname (if any) & list/clonename - astring swlist(tag1.cstr()); + astring swlist(tag1.c_str()); tag2.cpy(swlist.cat(tag4)); if (has_parent) { @@ -1098,22 +1098,22 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ else { // try to load from list/setname - if ((filerr != FILERR_NONE) && (tag2.cstr() != NULL)) - filerr = common_process_file(options, tag2.cstr(), ".chd", romp, image_file); + if ((filerr != FILERR_NONE) && (tag2.c_str() != NULL)) + filerr = common_process_file(options, tag2.c_str(), ".chd", romp, image_file); // try to load from list/parentname (if any) - if ((filerr != FILERR_NONE) && has_parent && (tag3.cstr() != NULL)) - filerr = common_process_file(options, tag3.cstr(), ".chd", romp, image_file); + if ((filerr != FILERR_NONE) && has_parent && (tag3.c_str() != NULL)) + filerr = common_process_file(options, tag3.c_str(), ".chd", romp, image_file); // try to load from setname - if ((filerr != FILERR_NONE) && (tag4.cstr() != NULL)) - filerr = common_process_file(options, tag4.cstr(), ".chd", romp, image_file); + if ((filerr != FILERR_NONE) && (tag4.c_str() != NULL)) + filerr = common_process_file(options, tag4.c_str(), ".chd", romp, image_file); // try to load from parentname (if any) - if ((filerr != FILERR_NONE) && has_parent && (tag5.cstr() != NULL)) - filerr = common_process_file(options, tag5.cstr(), ".chd", romp, image_file); + if ((filerr != FILERR_NONE) && has_parent && (tag5.c_str() != NULL)) + filerr = common_process_file(options, tag5.c_str(), ".chd", romp, image_file); // only for CHD we also try to load from list/ - if ((filerr != FILERR_NONE) && (tag1.cstr() != NULL)) + if ((filerr != FILERR_NONE) && (tag1.c_str() != NULL)) { tag1.del(tag1.len() - 1, 1); // remove the PATH_SEPARATOR - filerr = common_process_file(options, tag1.cstr(), ".chd", romp, image_file); + filerr = common_process_file(options, tag1.c_str(), ".chd", romp, image_file); } } } @@ -1182,7 +1182,7 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd astring fname(ROM_GETNAME(romp), ".dif"); /* try to open the diff */ - LOG(("Opening differencing image file: %s\n", fname.cstr())); + LOG(("Opening differencing image file: %s\n", fname.c_str())); emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE); file_error filerr = diff_file.open(fname); if (filerr == FILERR_NONE) @@ -1190,12 +1190,12 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd astring fullpath(diff_file.fullpath()); diff_file.close(); - LOG(("Opening differencing image file: %s\n", fullpath.cstr())); + LOG(("Opening differencing image file: %s\n", fullpath.c_str())); return diff_chd.open(fullpath, true, &source); } /* didn't work; try creating it instead */ - LOG(("Creating differencing image: %s\n", fname.cstr())); + LOG(("Creating differencing image: %s\n", fname.c_str())); diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); filerr = diff_file.open(fname); if (filerr == FILERR_NONE) @@ -1204,7 +1204,7 @@ static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd diff_file.close(); /* create the CHD */ - LOG(("Creating differencing image file: %s\n", fullpath.cstr())); + LOG(("Creating differencing image file: %s\n", fullpath.c_str())); chd_codec_type compression[4] = { CHD_CODEC_NONE }; chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source); if (err != CHDERR_NONE) @@ -1239,7 +1239,7 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag astring filename(ROM_GETNAME(romp), ".chd"); /* first open the source drive */ - LOG(("Opening disk image: %s\n", filename.cstr())); + LOG(("Opening disk image: %s\n", filename.c_str())); err = chd_error(open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, chd->orig_chd(), locationtag)); if (err != CHDERR_NONE) { @@ -1255,13 +1255,13 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag /* verify the hash */ if (hashes != acthashes) { - romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.cstr()); + romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.c_str()); dump_wrong_and_correct_checksums(romdata, hashes, acthashes); romdata->warnings++; } else if (hashes.flag(hash_collection::FLAG_BAD_DUMP)) { - romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.cstr()); + romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.c_str()); romdata->knownbad++; } @@ -1272,7 +1272,7 @@ static void process_disk_entries(romload_private *romdata, const char *regiontag err = open_disk_diff(romdata->machine().options(), romp, chd->orig_chd(), chd->diff_chd()); if (err != CHDERR_NONE) { - romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_file::error_string(err)); + romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.c_str(), chd_file::error_string(err)); romdata->errors++; global_free(chd); continue; @@ -1385,7 +1385,7 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c UINT32 regionlength = ROMREGION_GETLENGTH(region); device.subtag(regiontag, ROMREGION_GETTAG(region)); - LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength)); + LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength)); /* the first entry must be a region */ assert(ROMENTRY_ISREGION(region)); @@ -1439,7 +1439,7 @@ void load_software_part_region(device_t &device, software_list_device &swlist, c for (region = start_region; region != NULL; region = rom_next_region(region)) { device.subtag(regiontag, ROMREGION_GETTAG(region)); - region_post_process(romdata, regiontag.cstr(), ROMREGION_ISINVERTED(region)); + region_post_process(romdata, regiontag.c_str(), ROMREGION_ISINVERTED(region)); } /* display the results and exit */ @@ -1463,7 +1463,7 @@ static void process_region_list(romload_private *romdata) UINT32 regionlength = ROMREGION_GETLENGTH(region); rom_region_name(regiontag, *device, region); - LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength)); + LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength)); /* the first entry must be a region */ assert(ROMENTRY_ISREGION(region)); @@ -1548,7 +1548,7 @@ void rom_init(running_machine &machine) } else { specbios = romdata->machine().options().sub_value(temp,device->owner()->tag()+1,"bios"); if (strlen(specbios) == 0) { - specbios = device->default_bios_tag().cstr(); + specbios = device->default_bios_tag().c_str(); } } determine_bios_rom(romdata, device, specbios); diff --git a/src/emu/save.c b/src/emu/save.c index 2c962bf04aa..6344027d8e9 100644 --- a/src/emu/save.c +++ b/src/emu/save.c @@ -179,7 +179,7 @@ void save_manager::save_memory(device_t *device, const char *module, const char // error if we are equal if (entry->m_name == totalname) - fatalerror("Duplicate save state registration entry (%s)\n", totalname.cstr()); + fatalerror("Duplicate save state registration entry (%s)\n", totalname.c_str()); } // insert us into the list @@ -333,7 +333,7 @@ UINT32 save_manager::signature() const for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next()) { // add the entry name to the CRC - crc = crc32(crc, (UINT8 *)entry->m_name.cstr(), entry->m_name.len()); + crc = crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.len()); // add the type and size to the CRC UINT32 temp[2]; @@ -353,7 +353,7 @@ UINT32 save_manager::signature() const void save_manager::dump_registry() const { for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next()) - LOG(("%s: %d x %d\n", entry->m_name.cstr(), entry->m_typesize, entry->m_typecount)); + LOG(("%s: %d x %d\n", entry->m_name.c_str(), entry->m_typesize, entry->m_typecount)); } diff --git a/src/emu/schedule.c b/src/emu/schedule.c index d0d28af80e4..445d9c9c408 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -757,11 +757,11 @@ void device_scheduler::rebuild_execute_list() { device_t *device = machine().device(machine().config().m_perfect_cpu_quantum); if (device == NULL) - fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.cstr()); + fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.c_str()); device_execute_interface *exec; if (!device->interface(exec)) - fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.cstr()); + fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.c_str()); min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum); } diff --git a/src/emu/screen.c b/src/emu/screen.c index cf2ddcff320..44fee2e560c 100644 --- a/src/emu/screen.c +++ b/src/emu/screen.c @@ -1058,5 +1058,5 @@ void screen_device::load_effect_overlay(const char *filename) if (m_screen_overlay_bitmap.valid()) m_container->set_overlay(&m_screen_overlay_bitmap); else - osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.cstr()); + osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.c_str()); } diff --git a/src/emu/softlist.c b/src/emu/softlist.c index 9ef5f0cba65..755650d794f 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -500,7 +500,7 @@ void software_list_device::device_validity_check(validity_checker &valid) const { // add to the global map whenever we check a list so we don't re-check // it in the future - if (valid.already_checked(astring("softlist/", m_list_name.cstr()))) + if (valid.already_checked(astring("softlist/", m_list_name.c_str()))) return; // do device validation only in case of validate command @@ -565,7 +565,7 @@ void software_list_device::internal_validity_check(validity_checker &valid) } // check for duplicate descriptions - if (descriptions.add(astring(swinfo->longname()).makelower().cstr(), swinfo, false) == TMERR_DUPLICATE) + if (descriptions.add(astring(swinfo->longname()).makelower().c_str(), swinfo, false) == TMERR_DUPLICATE) osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo->longname(), swinfo->shortname()); bool is_clone = false; diff --git a/src/emu/sound/disc_inp.inc b/src/emu/sound/disc_inp.inc index a46d7d17790..36af37c6583 100644 --- a/src/emu/sound/disc_inp.inc +++ b/src/emu/sound/disc_inp.inc @@ -63,7 +63,7 @@ DISCRETE_RESET(dss_adjustment) double min, max; astring fulltag; - m_port = m_device->machine().root_device().ioport(m_device->siblingtag(fulltag, (const char *)this->custom_data()).cstr()); + m_port = m_device->machine().root_device().ioport(m_device->siblingtag(fulltag, (const char *)this->custom_data()).c_str()); if (m_port == NULL) fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag\n", this->index()); diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c index 4ff03820310..eaae73d871f 100644 --- a/src/emu/tilemap.c +++ b/src/emu/tilemap.c @@ -1786,7 +1786,7 @@ void tilemap_device::device_start() // look for an extension entry astring tag_ext(tag(), "_ext"); - share = memshare(tag_ext.cstr()); + share = memshare(tag_ext.c_str()); if (share != NULL) m_extmem.set(*share, m_bytes_per_entry); } diff --git a/src/emu/ui/barcode.c b/src/emu/ui/barcode.c index 3b9f429c8db..4cba5554499 100644 --- a/src/emu/ui/barcode.c +++ b/src/emu/ui/barcode.c @@ -118,7 +118,7 @@ void ui_menu_barcode_reader::handle() machine().ui().popup_time(5, "Barcode length invalid!"); else { - current_device()->write_code(tmp_file.cstr(), tmp_file.len()); + current_device()->write_code(tmp_file.c_str(), tmp_file.len()); // if sending was successful, reset char buffer if (m_barcode_buffer[0] != '\0') memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer)); diff --git a/src/emu/ui/devopt.c b/src/emu/ui/devopt.c index 3256ae030a3..775e7f64410 100644 --- a/src/emu/ui/devopt.c +++ b/src/emu/ui/devopt.c @@ -29,7 +29,7 @@ ui_menu_device_config::ui_menu_device_config(running_machine &machine, render_co device_iterator deviter(machine.config().root_device()); for (device_t *device = deviter.first(); device != NULL; device = deviter.next()) { - if (strcmp(device->tag(), tmp_tag.cstr()) == 0) + if (strcmp(device->tag(), tmp_tag.c_str()) == 0) { m_mounted = true; break; @@ -176,7 +176,7 @@ void ui_menu_device_config::populate() } if (bios) - string.catprintf("* BIOS settings:\n %d options [default: %s]\n", bios, bios_str.cstr()); + string.catprintf("* BIOS settings:\n %d options [default: %s]\n", bios, bios_str.c_str()); } int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0; diff --git a/src/emu/ui/inputmap.c b/src/emu/ui/inputmap.c index 4150bfc9649..b4f9cf06aeb 100644 --- a/src/emu/ui/inputmap.c +++ b/src/emu/ui/inputmap.c @@ -414,7 +414,7 @@ void ui_menu_input::populate_and_sort(input_item_data *itemlist) item = itemarray[curitem]; assert(nameformat[item->type] != NULL); - if (item->owner_name && strcmp(item->owner_name, prev_owner.cstr()) != 0) + if (item->owner_name && strcmp(item->owner_name, prev_owner.c_str()) != 0) { if (first_entry) first_entry = false; @@ -568,7 +568,7 @@ void ui_menu_settings::populate() flags |= MENU_FLAG_RIGHT_ARROW; /* add the menu item */ - if (strcmp(field->device().tag(), prev_owner.cstr()) != 0) + if (strcmp(field->device().tag(), prev_owner.c_str()) != 0) { if (first_entry) first_entry = false; @@ -872,7 +872,7 @@ void ui_menu_analog::populate() analog_item_data *data; UINT32 flags = 0; astring name; - if (strcmp(field->device().tag(), prev_owner.cstr()) != 0) + if (strcmp(field->device().tag(), prev_owner.c_str()) != 0) { if (first_entry) first_entry = false; @@ -895,7 +895,7 @@ void ui_menu_analog::populate() { default: case ANALOG_ITEM_KEYSPEED: - text.printf("%s Digital Speed", name.cstr()); + text.printf("%s Digital Speed", name.c_str()); subtext.printf("%d", settings.delta); data->min = 0; data->max = 255; @@ -904,7 +904,7 @@ void ui_menu_analog::populate() break; case ANALOG_ITEM_CENTERSPEED: - text.printf("%s Autocenter Speed", name.cstr()); + text.printf("%s Autocenter Speed", name.c_str()); subtext.printf("%d", settings.centerdelta); data->min = 0; data->max = 255; @@ -913,7 +913,7 @@ void ui_menu_analog::populate() break; case ANALOG_ITEM_REVERSE: - text.printf("%s Reverse", name.cstr()); + text.printf("%s Reverse", name.c_str()); subtext.cpy(settings.reverse ? "On" : "Off"); data->min = 0; data->max = 1; @@ -922,7 +922,7 @@ void ui_menu_analog::populate() break; case ANALOG_ITEM_SENSITIVITY: - text.printf("%s Sensitivity", name.cstr()); + text.printf("%s Sensitivity", name.c_str()); subtext.printf("%d", settings.sensitivity); data->min = 1; data->max = 255; diff --git a/src/emu/ui/mainmenu.c b/src/emu/ui/mainmenu.c index 9809833a506..be8ca14f9a3 100644 --- a/src/emu/ui/mainmenu.c +++ b/src/emu/ui/mainmenu.c @@ -56,7 +56,7 @@ void ui_menu_main::populate() item_append("Input (general)", NULL, 0, (void *)INPUT_GROUPS); menu_text.printf("Input (this %s)",emulator_info::get_capstartgamenoun()); - item_append(menu_text.cstr(), NULL, 0, (void *)INPUT_SPECIFIC); + item_append(menu_text.c_str(), NULL, 0, (void *)INPUT_SPECIFIC); /* add optional input-related menus */ if (machine().ioport().has_analog()) @@ -66,7 +66,7 @@ void ui_menu_main::populate() if (machine().ioport().has_configs()) { menu_text.printf("%s Configuration",emulator_info::get_capstartgamenoun()); - item_append(menu_text.cstr(), NULL, 0, (void *)SETTINGS_DRIVER_CONFIG); + item_append(menu_text.c_str(), NULL, 0, (void *)SETTINGS_DRIVER_CONFIG); } /* add bookkeeping menu */ @@ -74,7 +74,7 @@ void ui_menu_main::populate() /* add game info menu */ menu_text.printf("%s Information",emulator_info::get_capstartgamenoun()); - item_append(menu_text.cstr(), NULL, 0, (void *)GAME_INFO); + item_append(menu_text.c_str(), NULL, 0, (void *)GAME_INFO); image_interface_iterator imgiter(machine().root_device()); if (imgiter.first() != NULL) @@ -135,7 +135,7 @@ void ui_menu_main::populate() /* add reset and exit menus */ menu_text.printf("Select New %s",emulator_info::get_capstartgamenoun()); - item_append(menu_text.cstr(), NULL, 0, (void *)SELECT_GAME); + item_append(menu_text.c_str(), NULL, 0, (void *)SELECT_GAME); } ui_menu_main::~ui_menu_main() diff --git a/src/emu/ui/menu.c b/src/emu/ui/menu.c index 9089da8b446..1ae7c2d2145 100644 --- a/src/emu/ui/menu.c +++ b/src/emu/ui/menu.c @@ -185,7 +185,7 @@ void ui_menu::reset(ui_menu_reset_options options) // add an item to return if (parent == NULL) - item_append(backtext.cstr(), NULL, 0, NULL); + item_append(backtext.c_str(), NULL, 0, NULL); else if (parent->is_special_main_menu()) item_append("Exit", NULL, 0, NULL); else diff --git a/src/emu/ui/miscmenu.c b/src/emu/ui/miscmenu.c index 1691ada22b8..75f801d394b 100644 --- a/src/emu/ui/miscmenu.c +++ b/src/emu/ui/miscmenu.c @@ -128,7 +128,7 @@ void ui_menu_bios_selection::handle() astring value; astring temp; value.printf("%s,bios=%d",machine().options().main_value(temp,dev->owner()->tag()+1),val-1); - machine().options().set_value(dev->owner()->tag()+1, value.cstr(), OPTION_PRIORITY_CMDLINE, error); + machine().options().set_value(dev->owner()->tag()+1, value.c_str(), OPTION_PRIORITY_CMDLINE, error); assert(!error); } reset(UI_MENU_RESET_REMEMBER_REF); diff --git a/src/emu/ui/selgame.c b/src/emu/ui/selgame.c index 19e83a7dd54..e7163c5d0e8 100644 --- a/src/emu/ui/selgame.c +++ b/src/emu/ui/selgame.c @@ -330,7 +330,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott tempbuf[1].printf("%s, %-.100s", driver->year, driver->manufacturer); // next line source path - tempbuf[2].printf("Driver: %-.100s", core_filename_extract_base(tempbuf[3], driver->source_file).cstr()); + tempbuf[2].printf("Driver: %-.100s", core_filename_extract_base(tempbuf[3], driver->source_file).c_str()); // next line is overall driver status if (driver->flags & GAME_NOT_WORKING) diff --git a/src/emu/ui/swlist.c b/src/emu/ui/swlist.c index a2b6b7e46c5..5917b552ea4 100644 --- a/src/emu/ui/swlist.c +++ b/src/emu/ui/swlist.c @@ -87,7 +87,7 @@ void ui_menu_software_parts::populate() menu_part_name.cat(" (").cat(swpart->feature("part_id")).cat(")"); entry->type = T_ENTRY; entry->part = swpart; - item_append(m_info->shortname(), menu_part_name.cstr(), 0, entry); + item_append(m_info->shortname(), menu_part_name.c_str(), 0, entry); } } } diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c index 8d119e131f6..80a61aeb02b 100644 --- a/src/emu/ui/ui.c +++ b/src/emu/ui/ui.c @@ -360,7 +360,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer) { astring warning; warning.cpy("This driver requires images to be loaded in the following device(s): ").cat(messagebox_text.substr(0, messagebox_text.len() - 2)); - ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.cstr()); + ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.c_str()); } break; } @@ -1134,7 +1134,7 @@ astring &ui_manager::game_info_astring(astring &string) { // print description, manufacturer, and CPU: astring tempstr; - string.printf("%s\n%s %s\nDriver: %s\n\nCPU:\n", machine().system().description, machine().system().year, machine().system().manufacturer, core_filename_extract_base(tempstr, machine().system().source_file).cstr()); + string.printf("%s\n%s %s\nDriver: %s\n\nCPU:\n", machine().system().description, machine().system().year, machine().system().manufacturer, core_filename_extract_base(tempstr, machine().system().source_file).c_str()); // loop over all CPUs execute_interface_iterator execiter(machine().root_device()); @@ -1761,8 +1761,8 @@ UINT32 ui_manager::handler_confirm_quit(running_machine &machine, render_contain "Are you sure you want to quit?\n\n" "Press ''%s'' to quit,\n" "Press ''%s'' to return to emulation.", - ui_select_text.cstr(), - ui_cancel_text.cstr()); + ui_select_text.c_str(), + ui_cancel_text.c_str()); machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR); machine.pause(); diff --git a/src/emu/validity.c b/src/emu/validity.c index 4ad2453da32..df0e6e30e34 100644 --- a/src/emu/validity.c +++ b/src/emu/validity.c @@ -203,12 +203,12 @@ void validity_checker::check_all() if (m_errors > 0) { m_error_text.replace("\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.cstr()); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.c_str()); } if (m_warnings > 0) { m_warning_text.replace("\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.cstr()); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.c_str()); } output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n"); } @@ -299,16 +299,16 @@ void validity_checker::validate_one(const game_driver &driver) if (m_errors > start_errors || m_warnings > start_warnings) { astring tempstr; - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Driver %s (file %s): %d errors, %d warnings\n", driver.name, core_filename_extract_base(tempstr, driver.source_file).cstr(), m_errors - start_errors, m_warnings - start_warnings); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Driver %s (file %s): %d errors, %d warnings\n", driver.name, core_filename_extract_base(tempstr, driver.source_file).c_str(), m_errors - start_errors, m_warnings - start_warnings); if (m_errors > start_errors) { m_error_text.replace("\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.cstr()); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.c_str()); } if (m_warnings > start_warnings) { m_warning_text.replace("\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.cstr()); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.c_str()); } output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n"); } @@ -523,14 +523,14 @@ void validity_checker::validate_driver() if (m_names_map.add(m_current_driver->name, m_current_driver, false) == TMERR_DUPLICATE) { const game_driver *match = m_names_map.find(m_current_driver->name); - osd_printf_error("Driver name is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).cstr(), match->name); + osd_printf_error("Driver name is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).c_str(), match->name); } // check for duplicate descriptions if (m_descriptions_map.add(m_current_driver->description, m_current_driver, false) == TMERR_DUPLICATE) { const game_driver *match = m_descriptions_map.find(m_current_driver->description); - osd_printf_error("Driver description is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).cstr(), match->name); + osd_printf_error("Driver description is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).c_str(), match->name); } // determine if we are a clone @@ -645,7 +645,7 @@ void validity_checker::validate_roms() // attempt to add it to the map, reporting duplicates as errors current_length = ROMREGION_GETLENGTH(romp); if (m_region_map.add(fulltag, current_length, false) == TMERR_DUPLICATE) - osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.cstr()); + osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.c_str()); } // If this is a system bios, make sure it is using the next available bios number @@ -883,7 +883,7 @@ void validity_checker::validate_inputs() // report any errors during construction if (errorbuf) - osd_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr()); + osd_printf_error("I/O port error during construction:\n%s\n", errorbuf.c_str()); // do a first pass over ports to add their names and find duplicates for (ioport_port *port = portlist.first(); port != NULL; port = port->next()) @@ -1010,7 +1010,7 @@ void validity_checker::validate_devices() { astring temptag("_"); temptag.cat(option->name()); - device_t *dev = const_cast(*m_current_config).device_add(&m_current_config->root_device(), temptag.cstr(), option->devtype(), 0); + device_t *dev = const_cast(*m_current_config).device_add(&m_current_config->root_device(), temptag.c_str(), option->devtype(), 0); // notify this device and all its subdevices that they are now configured device_iterator subiter(*dev); @@ -1023,7 +1023,7 @@ void validity_checker::validate_devices() osd_printf_error("Device '%s' is slot cart device but does not have short name defined\n",dev->name()); } - const_cast(*m_current_config).device_remove(&m_current_config->root_device(), temptag.cstr()); + const_cast(*m_current_config).device_remove(&m_current_config->root_device(), temptag.c_str()); } } diff --git a/src/emu/video.c b/src/emu/video.c index f332e75eac7..aa2bd696b6a 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -1158,7 +1158,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) // copy the device name to an astring astring snapdevname; snapdevname.cpysubstr(snapstr, pos + 3, end - pos - 3); - //printf("check template: %s\n", snapdevname.cstr()); + //printf("check template: %s\n", snapdevname.c_str()); // verify that there is such a device for this system image_interface_iterator iter(machine().root_device()); @@ -1166,7 +1166,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) { // get the device name astring tempdevname(image->brief_instance_name()); - //printf("check device: %s\n", tempdevname.cstr()); + //printf("check device: %s\n", tempdevname.c_str()); if (snapdevname.cmp(tempdevname) == 0) { @@ -1181,7 +1181,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) // setup snapname and remove the %d_ snapstr.replace(0, snapdevname, filename); snapstr.del(pos, 3); - //printf("check image: %s\n", filename.cstr()); + //printf("check image: %s\n", filename.c_str()); name_found = 1; } @@ -1215,7 +1215,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) for (int seq = 0; ; seq++) { // build up the filename - fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).cstr()); + fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).c_str()); // try to open the file; stop when we fail file_error filerr = file.open(fname); diff --git a/src/emu/webengine.c b/src/emu/webengine.c index bc7c5fa39e8..4ea56689d94 100644 --- a/src/emu/webengine.c +++ b/src/emu/webengine.c @@ -455,7 +455,7 @@ int web_engine::begin_request_handler(struct mg_connection *conn) mg_send_header(conn, "Cache-Control", "no-cache, no-store, must-revalidate"); mg_send_header(conn, "Pragma", "no-cache"); mg_send_header(conn, "Expires", "0"); - mg_send_file(conn, fullpath.cstr(), NULL); + mg_send_file(conn, fullpath.c_str(), NULL); return MG_MORE; // It is important to return MG_MORE after mg_send_file! } return 0; diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c index 6f29d3b88a8..b3158257691 100644 --- a/src/ldplayer/ldplayer.c +++ b/src/ldplayer/ldplayer.c @@ -371,7 +371,7 @@ void ldplayer_state::machine_reset() timer_set(attotime::zero, TIMER_ID_AUTOPLAY); // indicate the name of the file we opened - popmessage("Opened %s\n", m_filename.cstr()); + popmessage("Opened %s\n", m_filename.c_str()); } diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h index 0851aa0c006..14f26cb3990 100644 --- a/src/lib/util/astring.h +++ b/src/lib/util/astring.h @@ -74,7 +74,7 @@ public: // C string conversion operators and helpers operator const char *() const { return m_text; } - const char *cstr() const { return m_text; } + const char *c_str() const { return m_text; } // buffer management astring &reset() { return cpy(""); } @@ -86,19 +86,19 @@ public: // copy helpers astring &cpy(const char *src, int count); astring &cpysubstr(const astring &src, int start, int count = -1); - astring &cpy(const astring &src) { return cpy(src.cstr(), src.len()); } + astring &cpy(const astring &src) { return cpy(src.c_str(), src.len()); } astring &cpy(const char *src) { return cpy(src, strlen(src)); } // insertion helpers astring &ins(int insbefore, const char *src, int count); astring &inssubstr(int insbefore, const astring &src, int start, int count = -1); - astring &ins(int insbefore, const astring &src) { return ins(insbefore, src.cstr(), src.len()); } + astring &ins(int insbefore, const astring &src) { return ins(insbefore, src.c_str(), src.len()); } astring &ins(int insbefore, const char *src) { return ins(insbefore, src, strlen(src)); } // concatenation helpers (== insert at end) astring &cat(const char *src, int count) { return ins(-1, src, count); } astring &catsubstr(const astring &src, int start, int count = -1) { return inssubstr(-1, src, start, count); } - astring &cat(const astring &src) { return ins(-1, src.cstr(), src.len()); } + astring &cat(const astring &src) { return ins(-1, src.c_str(), src.len()); } astring &cat(const char *src) { return ins(-1, src, strlen(src)); } astring &cat(char ch) { return ins(-1, &ch, 1); } @@ -117,13 +117,13 @@ public: // comparison helpers int cmp(const char *str2, int count) const; int cmpsubstr(const astring &str2, int start, int count = -1) const; - int cmp(const astring &str2) const { return cmp(str2.cstr(), str2.len()); } + int cmp(const astring &str2) const { return cmp(str2.c_str(), str2.len()); } int cmp(const char *str2) const { return cmp(str2, strlen(str2)); } // case-insensitive comparison helpers int icmp(const char *str2, int count) const; int icmpsubstr(const astring &str2, int start, int count = -1) const; - int icmp(const astring &str2) const { return icmp(str2.cstr(), str2.len()); } + int icmp(const astring &str2) const { return icmp(str2.c_str(), str2.len()); } int icmp(const char *str2) const { return icmp(str2, strlen(str2)); } // character searching helpers diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index 90024420555..e747261c74f 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -164,7 +164,7 @@ cdrom_file *cdrom_open(const char *inputfile) file_error filerr = core_fopen(file->track_info.track[i].fname, OPEN_FLAG_READ, &file->fhandle[i]); if (filerr != FILERR_NONE) { - fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.cstr()); + fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.c_str()); cdrom_close(file); return NULL; } diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h index 7f2196267ab..a04b8cff2ff 100644 --- a/src/lib/util/chd.h +++ b/src/lib/util/chd.h @@ -352,7 +352,7 @@ public: chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen); chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags); chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags = CHD_MDFLAGS_CHECKSUM); - chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const astring &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.cstr(), input.len() + 1, flags); } + chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const astring &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.c_str(), input.len() + 1, flags); } chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const dynamic_buffer &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input, input.count(), flags); } chd_error delete_metadata(chd_metadata_tag metatag, UINT32 metaindex); chd_error clone_all_metadata(chd_file &source); diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c index 0e6077dd70f..244c900bc28 100644 --- a/src/lib/util/chdcd.c +++ b/src/lib/util/chdcd.c @@ -695,7 +695,7 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_ #if 0 for(i=0; i < numtracks; i++) { - printf("%s %d %d %d (true %d)\n", outinfo.track[i].fname.cstr(), outtoc.tracks[i].frames, outtoc.tracks[i].padframes, outtoc.tracks[i].physframeofs, outtoc.tracks[i].frames - outtoc.tracks[i].padframes); + printf("%s %d %d %d (true %d)\n", outinfo.track[i].fname.c_str(), outtoc.tracks[i].frames, outtoc.tracks[i].padframes, outtoc.tracks[i].physframeofs, outtoc.tracks[i].frames - outtoc.tracks[i].padframes); } #endif @@ -771,7 +771,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i wavlen = parse_wav_sample(lastfname, &wavoffs); if (!wavlen) { - printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.cstr()); + printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.c_str()); return CHDERR_INVALID_DATA; } } @@ -812,7 +812,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i outinfo.track[trknum].fname.cpy(lastfname); // default filename to the last one -// printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.cstr(), outinfo.track[trknum].offset); +// printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset); cdrom_convert_type_string_to_track_info(token, &outtoc.tracks[trknum]); if (outtoc.tracks[trknum].datasize == 0) @@ -927,10 +927,10 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i /* if we have the same filename as the last track, do it that way */ if (trknum != 0 && outinfo.track[trknum].fname == outinfo.track[trknum-1].fname) { - tlen = get_file_size(outinfo.track[trknum].fname.cstr()); + tlen = get_file_size(outinfo.track[trknum].fname.c_str()); if (tlen == 0) { - printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.cstr()); + printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str()); return CHDERR_FILE_NOT_FOUND; } outinfo.track[trknum].offset = outinfo.track[trknum-1].offset + outtoc.tracks[trknum-1].frames * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize); @@ -941,7 +941,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i tlen = get_file_size(outinfo.track[trknum].fname); if (tlen == 0) { - printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.cstr()); + printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str()); return CHDERR_FILE_NOT_FOUND; } tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); @@ -976,7 +976,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i tlen = get_file_size(outinfo.track[trknum].fname); if (tlen == 0) { - printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.cstr()); + printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.c_str()); return CHDERR_FILE_NOT_FOUND; } tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); diff --git a/src/lib/util/options.c b/src/lib/util/options.c index ba580c9ee3a..dc3f69933fc 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -364,7 +364,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri // can only have one command if (m_command) { - error_string.catprintf("Error: multiple commands specified -%s and %s\n", m_command.cstr(), curarg); + error_string.catprintf("Error: multiple commands specified -%s and %s\n", m_command.c_str(), curarg); return false; } m_command = curentry->name(); @@ -635,14 +635,14 @@ bool core_options::set_value(const char *name, int value, int priority, astring { astring tempstr; tempstr.printf("%d", value); - return set_value(name, tempstr.cstr(), priority, error_string); + return set_value(name, tempstr.c_str(), priority, error_string); } bool core_options::set_value(const char *name, float value, int priority, astring &error_string) { astring tempstr; tempstr.printf("%f", value); - return set_value(name, tempstr.cstr(), priority, error_string); + return set_value(name, tempstr.c_str(), priority, error_string); } @@ -752,7 +752,7 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch case OPTION_BOOLEAN: if (sscanf(data, "%d", &ival) != 1 || ival < 0 || ival > 1) { - error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value()); + error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; } break; @@ -761,12 +761,12 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch case OPTION_INTEGER: if (sscanf(data, "%d", &ival) != 1) { - error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value()); + error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; } if (curentry.has_range() && (ival < atoi(curentry.minimum()) || ival > atoi(curentry.maximum()))) { - error_string.catprintf("Out-of-range integer value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.cstr(), curentry.minimum(), curentry.maximum(), curentry.value()); + error_string.catprintf("Out-of-range integer value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.c_str(), curentry.minimum(), curentry.maximum(), curentry.value()); return false; } break; @@ -775,12 +775,12 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch case OPTION_FLOAT: if (sscanf(data, "%f", &fval) != 1) { - error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value()); + error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; } if (curentry.has_range() && (fval < atof(curentry.minimum()) || fval > atof(curentry.maximum()))) { - error_string.catprintf("Out-of-range float value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.cstr(), curentry.minimum(), curentry.maximum(), curentry.value()); + error_string.catprintf("Out-of-range float value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.c_str(), curentry.minimum(), curentry.maximum(), curentry.value()); return false; } break; diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 8c1f80bea93..941d3c7df70 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -75,7 +75,7 @@ public: public: // getters entry *next() const { return m_next; } - const char *name(int index = 0) const { return (index < ARRAY_LENGTH(m_name) && m_name[index]) ? m_name[index].cstr() : NULL; } + const char *name(int index = 0) const { return (index < ARRAY_LENGTH(m_name) && m_name[index]) ? m_name[index].c_str() : NULL; } const char *description() const { return m_description; } const char *value() const { return m_data; } const char *default_value() const { return m_defdata; } diff --git a/src/mame/drivers/bfm_sc45_helper.c b/src/mame/drivers/bfm_sc45_helper.c index 1ccb5d75417..791c4f17ec7 100644 --- a/src/mame/drivers/bfm_sc45_helper.c +++ b/src/mame/drivers/bfm_sc45_helper.c @@ -237,7 +237,7 @@ int find_input_strings(running_machine &machine) - sc45helperlog("%s", tempstring.cstr()); + sc45helperlog("%s", tempstring.c_str()); sc45helperlog("\n"); @@ -316,48 +316,48 @@ int find_input_strings(running_machine &machine) if (ignoreports[i][j] > 0) { - printf(" PORT_BIT( 0x%04x, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_%d_%d ) PORT_NAME(\"%s\")\n", 1 << j, i,j/*ignoreports[i][j]*/, sc4inputs[i][j].name.cstr()); + printf(" PORT_BIT( 0x%04x, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_%d_%d ) PORT_NAME(\"%s\")\n", 1 << j, i,j/*ignoreports[i][j]*/, sc4inputs[i][j].name.c_str()); buttons_used++; } else if (ignoreports[i][j] == -3) { - printf(" // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -2) { - printf(" // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -1) { - printf(" // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -4) { - printf(" // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -5) { - printf(" // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -6) { - printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -7) { - printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -8) { - printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -9) { - printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.c_str()); } else if (ignoreports[i][j] == -10) { - printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.cstr()); + printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.c_str()); } buttons_used++; } @@ -390,7 +390,7 @@ void set_clickable_temp(running_machine &machine, const astring &teststring, int { for (int x = 0; x < 16; x++) { - if (!strcmp(teststring.cstr(), lamps[y][x].lampname_alt.cstr())) + if (!strcmp(teststring.c_str(), lamps[y][x].lampname_alt.c_str())) { lamps[y][x].clickport = clickport; lamps[y][x].clickmask = clickmask; @@ -507,7 +507,7 @@ int find_lamp_strings(running_machine &machine) fatalerror("duplicate lamp?\n"); } - //sc45helperlog("%s", tempstring.cstr()); + //sc45helperlog("%s", tempstring.c_str()); //sc45helperlog("\n"); @@ -521,7 +521,7 @@ int find_lamp_strings(running_machine &machine) //sc45helperlog("---ROW %02d---\n", y); for (int x = 0; x < 16; x++) { - sc45helperlog("\n", d, lamps[y][x].lampname.cstr()); + sc45helperlog("\n", d, lamps[y][x].lampname.c_str()); d++; } } @@ -536,7 +536,7 @@ int find_lamp_strings(running_machine &machine) for (int x = 0; x < 6; x++) { - sc45helperlog("\n", realy,x,sc4inputs[realy][x].name.cstr()); + sc45helperlog("\n", realy,x,sc4inputs[realy][x].name.c_str()); } } @@ -593,11 +593,11 @@ int find_lamp_strings(running_machine &machine) { lamps[y][x].lampname_alt = lamps[y][x].lampname; - if (!strcmp(lamps[y][x].lampname_alt.cstr(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2"; - if (!strcmp(lamps[y][x].lampname_alt.cstr(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3"; - if (!strcmp(lamps[y][x].lampname_alt.cstr(), "chg stake")) lamps[y][x].lampname_alt = "chnge stk"; - if (!strcmp(lamps[y][x].lampname_alt.cstr(), "canc/coll")) lamps[y][x].lampname_alt = "cancel"; - if (!strcmp(lamps[y][x].lampname_alt.cstr(), "start")) lamps[y][x].lampname_alt = "strt exch"; + if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2"; + if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3"; + if (!strcmp(lamps[y][x].lampname_alt.c_str(), "chg stake")) lamps[y][x].lampname_alt = "chnge stk"; + if (!strcmp(lamps[y][x].lampname_alt.c_str(), "canc/coll")) lamps[y][x].lampname_alt = "cancel"; + if (!strcmp(lamps[y][x].lampname_alt.c_str(), "start")) lamps[y][x].lampname_alt = "strt exch"; } } @@ -625,7 +625,7 @@ int find_lamp_strings(running_machine &machine) { for (int x = 0; x < 16; x++) { - if (!strcmp(tempname2, lamps[y][x].lampname_alt.cstr())) + if (!strcmp(tempname2, lamps[y][x].lampname_alt.c_str())) { //sc45helperlog("%s found\n", tempname2); lamps[y][x].draw_label = false; @@ -640,7 +640,7 @@ int find_lamp_strings(running_machine &machine) } else { - //printf("%s:%s:\n", tempname2, lamps[y][x].lampname_alt.cstr()); + //printf("%s:%s:\n", tempname2, lamps[y][x].lampname_alt.c_str()); } } @@ -679,8 +679,8 @@ int find_lamp_strings(running_machine &machine) //sc45helperlog("---ROW %02d---\n", y); for (int x = 0; x < 16; x++) { - if (lamps[y][x].clickport== -1) sc45helperlog("\n", d, lamps[y][x].lamptypename.cstr(), lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height); - else sc45helperlog("\n", d, lamps[y][x].lamptypename.cstr(), lamps[y][x].clickport, lamps[y][x].clickmask, lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height); + if (lamps[y][x].clickport== -1) sc45helperlog("\n", d, lamps[y][x].lamptypename.c_str(), lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height); + else sc45helperlog("\n", d, lamps[y][x].lamptypename.c_str(), lamps[y][x].clickport, lamps[y][x].clickmask, lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height); if (lamps[y][x].draw_label == false) sc45helperlog("", title); - core_fwrite(file, modified.cstr(), modified.len()); + core_fwrite(file, modified.c_str(), modified.len()); /* return the file */ return file; @@ -587,7 +587,7 @@ static void output_footer_and_close_file(core_file *file, astring &templatefile, { astring modified(templatefile); modified.replace(0, "", title); - core_fwrite(file, modified.cstr(), modified.len()); + core_fwrite(file, modified.c_str(), modified.len()); core_fclose(file); } @@ -686,11 +686,11 @@ static void output_report(astring &dirname, astring &tempheader, astring &tempfo *buckettailptr[bucknum] = NULL; /* output header */ - tempname.printf("%s" PATH_SEPARATOR "%s", dirname.cstr(), "index.html"); + tempname.printf("%s" PATH_SEPARATOR "%s", dirname.c_str(), "index.html"); indexfile = create_file_and_output_header(tempname, tempheader, title); if (indexfile == NULL) { - fprintf(stderr, "Error creating file '%s'\n", tempname.cstr()); + fprintf(stderr, "Error creating file '%s'\n", tempname.c_str()); return; } @@ -843,14 +843,14 @@ static int generate_png_diff(const summary_file *curfile, astring &destdir, cons int starty; /* generate the common source filename */ - dstfilename.printf("%s" PATH_SEPARATOR "%s", destdir.cstr(), destname); + dstfilename.printf("%s" PATH_SEPARATOR "%s", destdir.c_str(), destname); srcimgname.printf("snap" PATH_SEPARATOR "%s" PATH_SEPARATOR "final.png", curfile->name); /* open and load all unique bitmaps */ for (listnum = 0; listnum < list_count; listnum++) if (curfile->matchbitmap[listnum] == listnum) { - tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.cstr()); + tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.c_str()); /* open the source image */ filerr = core_fopen(tempname, OPEN_FLAG_READ, &file); @@ -961,11 +961,11 @@ static void create_linked_file(astring &dirname, const summary_file *curfile, co /* output header */ title.printf("%s Regressions (%s)", curfile->name, curfile->source); - linkname.printf("%s" PATH_SEPARATOR "%s", dirname.cstr(), filename.cstr()); + linkname.printf("%s" PATH_SEPARATOR "%s", dirname.c_str(), filename.c_str()); linkfile = create_file_and_output_header(linkname, tempheader, title); if (linkfile == NULL) { - fprintf(stderr, "Error creating file '%s'\n", filename.cstr()); + fprintf(stderr, "Error creating file '%s'\n", filename.c_str()); return; } @@ -1002,7 +1002,7 @@ static void create_linked_file(astring &dirname, const summary_file *curfile, co { core_fprintf(linkfile, "\t

\n"); core_fprintf(linkfile, "\tErrors:\n"); - core_fprintf(linkfile, "\t

%s
\n", curfile->text[listnum].cstr()); + core_fprintf(linkfile, "\t
%s
\n", curfile->text[listnum].c_str()); core_fprintf(linkfile, "\t

\n"); } } diff --git a/src/tools/split.c b/src/tools/split.c index 02e546fce14..ec4a5434fcc 100644 --- a/src/tools/split.c +++ b/src/tools/split.c @@ -123,16 +123,16 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi filerr = core_fopen(splitfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile); if (filerr != FILERR_NONE) { - fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.cstr()); + fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.c_str()); goto cleanup; } // write the basics out - core_fprintf(splitfile, "splitfile=%s\n", basefilename.cstr()); + core_fprintf(splitfile, "splitfile=%s\n", basefilename.c_str()); core_fprintf(splitfile, "splitsize=%d\n", splitsize); - printf("Split file is '%s'\n", splitfilename.cstr()); - printf("Splitting file %s into chunks of %dMB...\n", basefilename.cstr(), splitsize / (1024 * 1024)); + printf("Split file is '%s'\n", splitfilename.c_str()); + printf("Splitting file %s into chunks of %dMB...\n", basefilename.c_str(), splitsize / (1024 * 1024)); // now iterate until done for (partnum = 0; partnum < 1000; partnum++) @@ -150,7 +150,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi compute_hash_as_string(computedhash, splitbuffer, length); // write that info to the split file - core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.cstr(), basefilename.cstr(), partnum); + core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.c_str(), basefilename.c_str(), partnum); // compute the full filename for this guy outfilename.printf("%s.%03d", basename, partnum); @@ -160,11 +160,11 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi if (filerr != FILERR_NONE) { printf("\n"); - fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.cstr()); + fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.c_str()); goto cleanup; } - printf(" writing %s.%03d...", basefilename.cstr(), partnum); + printf(" writing %s.%03d...", basefilename.c_str(), partnum); // write the data actual = core_fwrite(outfile, splitbuffer, length); @@ -273,7 +273,7 @@ static int join_file(const char *filename, const char *outname, int write_output { core_fclose(outfile); outfile = NULL; - fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.cstr()); + fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.c_str()); goto cleanup; } @@ -281,12 +281,12 @@ static int join_file(const char *filename, const char *outname, int write_output filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile); if (filerr != FILERR_NONE) { - fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.cstr()); + fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.c_str()); goto cleanup; } } - printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.cstr()); + printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.c_str()); // now iterate through each file while (core_fgets(buffer, sizeof(buffer), splitfile)) @@ -302,7 +302,7 @@ static int join_file(const char *filename, const char *outname, int write_output expectedhash.cpy(buffer + 5, SHA1_DIGEST_SIZE * 2); infilename.cpy(buffer + 5 + SHA1_DIGEST_SIZE * 2 + 6).trimspace(); - printf(" Reading file '%s'...", infilename.cstr()); + printf(" Reading file '%s'...", infilename.c_str()); // read the file's contents infilename.ins(0, basepath); @@ -310,7 +310,7 @@ static int join_file(const char *filename, const char *outname, int write_output if (filerr != FILERR_NONE) { printf("\n"); - fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.cstr()); + fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.c_str()); goto cleanup; } @@ -321,7 +321,7 @@ static int join_file(const char *filename, const char *outname, int write_output if (computedhash != expectedhash) { printf("\n"); - fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n Expected: %s\n Computed: %s\n", infilename.cstr(), expectedhash.cstr(), computedhash.cstr()); + fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n Expected: %s\n Computed: %s\n", infilename.c_str(), expectedhash.c_str(), computedhash.c_str()); goto cleanup; } diff --git a/src/tools/src2html.c b/src/tools/src2html.c index 5ebe31ee71f..2f6d1a6ca6a 100644 --- a/src/tools/src2html.c +++ b/src/tools/src2html.c @@ -332,7 +332,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // create an index file astring indexname; - indexname.printf("%s%c%s", dstdir.cstr(), PATH_SEPARATOR[0], "index.html"); + indexname.printf("%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], "index.html"); core_file *indexfile = create_file_and_output_header(indexname, tempheader, srcdir_subpath); // output the directory navigation @@ -402,7 +402,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // build the source filename astring srcfile; - srcfile.printf("%s%c%s", srcdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr()); + srcfile.printf("%s%c%s", srcdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); // if we have a file, output it astring dstfile; @@ -420,9 +420,9 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // if we got a valid file, process it if (type != FILE_TYPE_INVALID) { - dstfile.printf("%s%c%s.html", dstdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr()); + dstfile.printf("%s%c%s.html", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); if (indexfile != NULL) - core_fprintf(indexfile, "\t
  • %s
  • \n", curlist->name.cstr(), curlist->name.cstr()); + core_fprintf(indexfile, "\t
  • %s
  • \n", curlist->name.c_str(), curlist->name.c_str()); result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile, srcdir == dstdir, tempheader, tempfooter); } } @@ -430,9 +430,9 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // if we have a directory, recurse else { - dstfile.printf("%s%c%s", dstdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr()); + dstfile.printf("%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); if (indexfile != NULL) - core_fprintf(indexfile, "\t
  • %s/
  • \n", curlist->name.cstr(), curlist->name.cstr()); + core_fprintf(indexfile, "\t
  • %s/
  • \n", curlist->name.c_str(), curlist->name.c_str()); result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile, tempheader, tempfooter); } } @@ -467,7 +467,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & astring srcfile_subpath; normalized_subpath(srcfile_subpath, srcfile, srcrootlen + 1); - fprintf(stderr, "Processing %s\n", srcfile_subpath.cstr()); + fprintf(stderr, "Processing %s\n", srcfile_subpath.c_str()); // set some defaults bool color_quotes = false; @@ -519,7 +519,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & core_file *src; if (core_fopen(srcfile, OPEN_FLAG_READ, &src) != FILERR_NONE) { - fprintf(stderr, "Unable to read file '%s'\n", srcfile.cstr()); + fprintf(stderr, "Unable to read file '%s'\n", srcfile.c_str()); return 1; } @@ -527,7 +527,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & core_file *dst = create_file_and_output_header(dstfile, tempheader, srcfile_subpath); if (dst == NULL) { - fprintf(stderr, "Unable to write file '%s'\n", dstfile.cstr()); + fprintf(stderr, "Unable to write file '%s'\n", dstfile.c_str()); core_fclose(src); return 1; } @@ -659,7 +659,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & astring target; if (find_include_file(target, srcrootlen, dstrootlen, srcfile, dstfile, filename)) { - dstline.catprintf("", target.cstr()); + dstline.catprintf("", target.c_str()); quotes_are_linked = true; } } @@ -738,8 +738,8 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp // print a header astring modified(templatefile); - modified.replace(0, "", path.cstr()); - core_fwrite(file, modified.cstr(), modified.len()); + modified.replace(0, "", path.c_str()); + core_fwrite(file, modified.c_str(), modified.len()); // return the file return file; @@ -754,8 +754,8 @@ 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 &path) { astring modified(templatefile); - modified.replace(0, "", path.cstr()); - core_fwrite(file, modified.cstr(), modified.len()); + modified.replace(0, "", path.c_str()); + core_fwrite(file, modified.c_str(), modified.len()); core_fclose(file); } @@ -807,7 +807,7 @@ static void output_path_as_links(core_file *file, astring &path, bool end_is_dir core_fprintf(file, "%s/", substr.cstr()); + core_fprintf(file, "index.html\">%s/", substr.c_str()); lastslash = slashindex + 1; } @@ -815,11 +815,11 @@ static void output_path_as_links(core_file *file, astring &path, bool end_is_dir // and a final link to the current directory astring substr(path, lastslash, -1); if (end_is_directory) - core_fprintf(file, "%s", substr.cstr()); + core_fprintf(file, "%s", substr.c_str()); else if (link_to_file) - core_fprintf(file, "%s", substr.cstr(), substr.cstr()); + core_fprintf(file, "%s", substr.c_str(), substr.c_str()); else - core_fprintf(file, "%s", substr.cstr(), substr.cstr()); + core_fprintf(file, "%s", substr.c_str(), substr.c_str()); } From 687d45b43f7580c6226499ac2b71475da140018e Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 11 Apr 2015 15:39:24 +0200 Subject: [PATCH 3/4] bonus typofix --- src/mame/drivers/sfbonus.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c index 820cd4ccd8c..5ce09859b1c 100644 --- a/src/mame/drivers/sfbonus.c +++ b/src/mame/drivers/sfbonus.c @@ -462,7 +462,7 @@ public: TILE_GET_INFO_MEMBER(get_sfbonus_reel4_tile_info); virtual void machine_reset(); virtual void video_start(); - void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int catagory); + void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category); UINT32 screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -929,7 +929,7 @@ void sfbonus_state::video_start() } -void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int catagory) +void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category) { int zz; int i; @@ -1021,38 +1021,38 @@ void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, if (rowenable2==0) { - m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),3); + m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),3); } if (rowenable==0) { - m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),3); + m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),3); } if (rowenable2==0x1) { - m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),2); + m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),2); } if (rowenable==0x1) { - m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),2); + m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),2); } if (rowenable2==0x2) { - m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),1); + m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),1); } if (rowenable==0x2) { - m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),1); + m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),1); } if (rowenable2==0x3) { - m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),4); + m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),4); } if (rowenable==0x3) { - m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),4); + m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),4); } From ae3fc8b6d9b1812d1ea537338887d8021428d1d8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 11 Apr 2015 15:50:05 +0200 Subject: [PATCH 4/4] removed non-existing file (nw) --- scripts/src/lib.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index d9fb4a41ed6..557e9e7316c 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -17,7 +17,6 @@ project "utils" files { MAME_DIR .. "src/lib/util/bitstream.h", MAME_DIR .. "src/lib/util/coretmpl.h", - MAME_DIR .. "src/lib/util/simple_set.h", MAME_DIR .. "src/lib/util/astring.c", MAME_DIR .. "src/lib/util/astring.h", MAME_DIR .. "src/lib/util/avhuff.c",