Previous 199869 Revisions Next

r37111 Saturday 11th April, 2015 at 14:16:55 UTC by Vasantha Crabb
Merge branch 'master' of https://github.com/mamedev/mame
[src/emu]addrmap.c cheat.c clifront.c digfx.c diimage.c disound.c emuopts.c emupal.c fileio.c image.c info.c input.c ioport.c luaengine.c machine.c mame.c mconfig.c memory.c rendlay.c romload.c save.c schedule.c screen.c softlist.c tilemap.c validity.c video.c webengine.c
[src/emu/bus/a7800]a78_slot.c
[src/emu/bus/gba]gba_slot.c
[src/emu/bus/intv]slot.c
[src/emu/bus/megadrive]md_slot.c
[src/emu/bus/msx_slot]cartridge.c
[src/emu/bus/nes]nes_ines.inc
[src/emu/cpu]drcbex64.c drcbex86.c drcuml.c uml.c
[src/emu/cpu/dsp16]dsp16.c dsp16dis.c
[src/emu/cpu/dsp56k]dsp56dsm.c inst.h pmove.h tables.c
[src/emu/cpu/mcs96]mcs96.c
[src/emu/cpu/score]score.c
[src/emu/debug]debugcmd.c debugcpu.c dvbpoints.c dvstate.c dvwpoints.c express.c
[src/emu/imagedev]cassette.c diablo.c harddriv.c
[src/emu/machine]fdc_pll.c hdc9234.c ram.c upd765.c wd_fdc.c
[src/emu/sound]disc_inp.inc
[src/emu/ui]barcode.c devopt.c inputmap.c mainmenu.c menu.c miscmenu.c selgame.c swlist.c ui.c
[src/ldplayer]ldplayer.c
[src/lib/util]astring.h cdrom.c chd.h chdcd.c options.c options.h
[src/mame/drivers]bfm_sc45_helper.c sfbonus.c
[src/mame/machine]315-5881_crypt.c naomim1.c
[src/mess/drivers]aim65.c hh_hmcs40.c hh_tms1k.c hh_ucom4.c pegasus.c
[src/mess/machine]spec_snqk.c thomson.c
[src/mess/machine/ti99]gromport.c gromport.h
[src/osd/modules/debugger/qt]deviceinformationwindow.c mainwindow.c
[src/osd/modules/font]font_osx.c font_sdl.c
[src/osd/modules/lib]osdobj_common.c osdobj_common.h
[src/osd/modules/render/d3d]d3dhlsl.c
[src/osd/sdl]input.c sdlmain.c
[src/tools]chdman.c nltool.c pngcmp.c regrep.c split.c src2html.c

trunk/src/emu/addrmap.c
r245622r245623
494494         owner.subtag(tag, entry->m_read.m_tag);
495495         device_t *mapdevice = machine.device(tag);
496496         if (mapdevice == NULL) {
497            throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag.cstr(), m_spacenum, device.basetag());
497            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());
498498         }
499499         // Grab the submap
500500         address_map submap(*mapdevice, entry);
trunk/src/emu/bus/a7800/a78_slot.c
r245622r245623
812812   logerror( "==============\n\n" );
813813   logerror( "\tTitle:           %.32s\n", head_title);
814814   logerror( "\tLength:          0x%X [real 0x%X]\n", head_length, len);
815   logerror( "\tMapper:          %s [0x%X]\n", cart_mapper.cstr(), head_mapper);
815   logerror( "\tMapper:          %s [0x%X]\n", cart_mapper.c_str(), head_mapper);
816816   logerror( "\t\tPOKEY:           %s\n", BIT(head_mapper, 0) ? "Yes" : "No");
817817   logerror( "\t\tSC Bankswitch:   %s\n", BIT(head_mapper, 1) ? "Yes" : "No");
818818   logerror( "\t\tRAM at $4000:    %s\n", BIT(head_mapper, 2) ? "Yes" : "No");
r245622r245623
827827   }
828828   else
829829      logerror( "\n");
830   logerror( "\tController 1:    0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr());
831   logerror( "\tController 2:    0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr());
830   logerror( "\tController 1:    0x%.2X [%s]\n", head_ctrl1, ctrl1.c_str());
831   logerror( "\tController 2:    0x%.2X [%s]\n", head_ctrl2, ctrl2.c_str());
832832   logerror( "\tVideo:           %s\n", (head_ispal) ? "PAL" : "NTSC");
833833}
trunk/src/emu/bus/gba/gba_slot.c
r245622r245623
307307      else if (!memcmp(&ROM[i], "SIIRTC_V", 8))
308308         chip |= GBA_CHIP_RTC;
309309   }
310   osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).cstr());
310   osd_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).c_str());
311311
312312   // 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
313313   if (gba_chip_has_conflict(chip))
r245622r245623
364364      chip &= ~GBA_CHIP_RTC;
365365   }
366366
367   osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).cstr());
367   osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).c_str());
368368
369369   switch (chip)
370370   {
trunk/src/emu/bus/intv/slot.c
r245622r245623
328328      }
329329      else
330330      {
331         sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
331         sscanf(extrainfo.c_str() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
332332               &rom[3], &ram, &extra);
333333         //printf("extrainfo: %d %d %d %d %d %d %d \n", mapper, rom[0], rom[1], rom[2], rom[3], ram, extra);
334334
r245622r245623
483483
484484         if (hashfile_extrainfo(*this, extrainfo))
485485         {
486            sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
486            sscanf(extrainfo.c_str() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
487487                  &rom[3], &ram, &extra);
488488
489489            if (ram)
trunk/src/emu/bus/megadrive/md_slot.c
r245622r245623
10821082   }
10831083   logerror("Checksum: %X\n", checksum);
10841084   logerror(" - Calculated Checksum: %X\n", csum);
1085   logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.cstr());
1085   logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.c_str());
10861086   logerror("Modem: %.12s\n", modem);
10871087   logerror("Memo: %.40s\n", memo);
1088   logerror("Country: %.16s\n%s", country, reg.cstr());
1088   logerror("Country: %.16s\n%s", country, reg.c_str());
10891089   logerror("ROM Start:  0x%.8X\n", rom_start);
10901090   logerror("ROM End:    0x%.8X\n", rom_end);
10911091   logerror("RAM Start:  0x%.8X\n", ram_start);
trunk/src/emu/bus/msx_slot/cartridge.c
r245622r245623
290290      if (hashfile_extrainfo(*this, extrainfo))
291291      {
292292         int extrainfo_type = -1;
293         if (1 == sscanf(extrainfo.cstr(), "%d", &extrainfo_type))
293         if (1 == sscanf(extrainfo.c_str(), "%d", &extrainfo_type))
294294         {
295295            static const struct { int extrainfo; int mapper; } extrainfo_map[] = {
296296               //{ 0, NOMAPPER },
trunk/src/emu/bus/nes/nes_ines.inc
r245622r245623
392392      }
393393      else
394394      {
395         logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.cstr());
395         logerror("NES: [%s], Invalid mapinfo found\n", mapinfo.c_str());
396396      }
397397   }
398398   else
trunk/src/emu/cheat.c
r245622r245623
540540   // output an output
541541   else
542542   {
543      cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.cstr());
543      cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.c_str());
544544      if (!m_condition.is_empty())
545545         cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
546546      if (m_line != 0)
r245622r245623
588588
589589      // look for a valid type
590590      if (strchr("cdiouxX", *p) == NULL)
591         throw emu_fatalerror("%s.xml(%d): invalid format specification \"%s\"\n", filename, line, m_format.cstr());
591         throw emu_fatalerror("%s.xml(%d): invalid format specification \"%s\"\n", filename, line, m_format.c_str());
592592      argscounted++;
593593
594594      // look for the next one
r245622r245623
597597
598598   // did we match?
599599   if (argscounted < argsprovided)
600      throw emu_fatalerror("%s.xml(%d): too many arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.cstr());
600      throw emu_fatalerror("%s.xml(%d): too many arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str());
601601   if (argscounted > argsprovided)
602      throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.cstr());
602      throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str());
603603}
604604
605605
r245622r245623
782782   bool has_scripts = (m_off_script != NULL || m_on_script != NULL || m_run_script != NULL || m_change_script != NULL);
783783
784784   // output the cheat tag
785   cheatfile.printf("\t<cheat desc=\"%s\"", m_description.cstr());
785   cheatfile.printf("\t<cheat desc=\"%s\"", m_description.c_str());
786786   if (m_numtemp != DEFAULT_TEMP_VARIABLES)
787787      cheatfile.printf(" tempvariables=\"%d\"", m_numtemp);
788788   if (!m_comment && m_parameter == NULL && !has_scripts)
r245622r245623
793793
794794      // save the comment
795795      if (m_comment)
796         cheatfile.printf("\t\t<comment><![CDATA[\n%s\n\t\t]]></comment>\n", m_comment.cstr());
796         cheatfile.printf("\t\t<comment><![CDATA[\n%s\n\t\t]]></comment>\n", m_comment.c_str());
797797
798798      // output the parameter, if present
799799      if (m_parameter != NULL)
r245622r245623
832832   {
833833      execute_on_script();
834834      changed = true;
835      popmessage("Activated %s", m_description.cstr());
835      popmessage("Activated %s", m_description.c_str());
836836   }
837837
838838   // if we're a oneshot parameter cheat and we're active, execute the "state change" script and indicate change
r245622r245623
840840   {
841841      execute_change_script();
842842      changed = true;
843      popmessage("Activated\n %s = %s", m_description.cstr(), m_parameter->text());
843      popmessage("Activated\n %s = %s", m_description.c_str(), m_parameter->text());
844844   }
845845
846846   return changed;
trunk/src/emu/clifront.c
r245622r245623
153153                                    val.printf("%s:%s:%s", swlistdev->list_name(), m_options.software_name(), swpart->name());
154154
155155                                    // call this in order to set slot devices according to mounting
156                                    m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.cstr());
156                                    m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.c_str());
157157                                    break;
158158                                 }
159159                              }
r245622r245623
184184            throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
185185
186186         // otherwise, error on the options
187         throw emu_fatalerror(MAMERR_INVALID_CONFIG, "%s", option_errors.trimspace().cstr());
187         throw emu_fatalerror(MAMERR_INVALID_CONFIG, "%s", option_errors.trimspace().c_str());
188188      }
189189      if (option_errors)
190         osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr());
190         osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().c_str());
191191
192192      // determine the base name of the EXE
193193      astring exename;
r245622r245623
208208            m_options.parse_standard_inis(option_errors);
209209         }
210210         if (option_errors)
211            osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr());
211            osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().c_str());
212212
213213         // if we can't find it, give an appropriate error
214214         const game_driver *system = m_options.system();
r245622r245623
226226   catch (emu_fatalerror &fatal)
227227   {
228228      astring string(fatal.string());
229      osd_printf_error("%s\n", string.trimspace().cstr());
229      osd_printf_error("%s\n", string.trimspace().c_str());
230230      m_result = (fatal.exitcode() != 0) ? fatal.exitcode() : MAMERR_FATALERROR;
231231
232232      // if a game was specified, wasn't a wildcard, and our error indicates this was the
r245622r245623
328328   // iterate through drivers and output the info
329329   astring filename;
330330   while (drivlist.next())
331      osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(filename, drivlist.driver().source_file).cstr());
331      osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(filename, drivlist.driver().source_file).c_str());
332332}
333333
334334
r245622r245623
418418   while (drivlist.next())
419419   {
420420      int clone_of = drivlist.clone();
421      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));
421      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));
422422   }
423423}
424424
r245622r245623
726726         paren_shortname.format("(%s)", imagedev->brief_instance_name());
727727
728728         // output the line, up to the list of extensions
729         printf("%-13s%-12s%-8s   ", first ? drivlist.driver().name : "", imagedev->instance_name(), paren_shortname.cstr());
729         printf("%-13s%-12s%-8s   ", first ? drivlist.driver().name : "", imagedev->instance_name(), paren_shortname.c_str());
730730
731731         // get the extensions and print them
732732         astring extensions(imagedev->file_extensions());
733733         for (int start = 0, end = extensions.chr(0, ','); ; start = end + 1, end = extensions.chr(start, ','))
734734         {
735735            astring curext(extensions, start, (end == -1) ? extensions.len() - start : end - start);
736            printf(".%-5s", curext.cstr());
736            printf(".%-5s", curext.c_str());
737737            if (end == -1)
738738               break;
739739         }
r245622r245623
782782         // output the summary of the audit
783783         astring summary_string;
784784         auditor.summarize(drivlist.driver().name,&summary_string);
785         osd_printf_info("%s", summary_string.cstr());
785         osd_printf_info("%s", summary_string.c_str());
786786
787787         // output the name of the driver and its clone
788788         osd_printf_info("romset %s ", drivlist.driver().name);
r245622r245623
842842                     // output the summary of the audit
843843                     astring summary_string;
844844                     auditor.summarize(dev->shortname(),&summary_string);
845                     osd_printf_info("%s", summary_string.cstr());
845                     osd_printf_info("%s", summary_string.c_str());
846846
847847                     // display information about what we discovered
848848                     osd_printf_info("romset %s ", dev->shortname());
r245622r245623
880880            {
881881               astring temptag("_");
882882               temptag.cat(option->name());
883               device_t *dev = const_cast<machine_config &>(config).device_add(&config.root_device(), temptag.cstr(), option->devtype(), 0);
883               device_t *dev = const_cast<machine_config &>(config).device_add(&config.root_device(), temptag.c_str(), option->devtype(), 0);
884884
885885               // notify this device and all its subdevices that they are now configured
886886               device_iterator subiter(*dev);
r245622r245623
907907                           // output the summary of the audit
908908                           astring summary_string;
909909                           auditor.summarize(dev->shortname(),&summary_string);
910                           osd_printf_info("%s", summary_string.cstr());
910                           osd_printf_info("%s", summary_string.c_str());
911911
912912                           // display information about what we discovered
913913                           osd_printf_info("romset %s ", dev->shortname());
r245622r245623
938938                  }
939939               }
940940
941               const_cast<machine_config &>(config).device_remove(&config.root_device(), temptag.cstr());
941               const_cast<machine_config &>(config).device_remove(&config.root_device(), temptag.c_str());
942942            }
943943         }
944944      }
r245622r245623
10041004         // output the summary of the audit
10051005         astring summary_string;
10061006         auditor.summarize(drivlist.driver().name,&summary_string);
1007         osd_printf_info("%s", summary_string.cstr());
1007         osd_printf_info("%s", summary_string.c_str());
10081008
10091009         // output the name of the driver and its clone
10101010         osd_printf_info("sampleset %s ", drivlist.driver().name);
r245622r245623
13221322                        // output the summary of the audit
13231323                        astring summary_string;
13241324                        auditor.summarize(swinfo->shortname(), &summary_string);
1325                        osd_printf_info("%s", summary_string.cstr());
1325                        osd_printf_info("%s", summary_string.c_str());
13261326
13271327                        // display information about what we discovered
13281328                        osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname());
r245622r245623
14441444                     // output the summary of the audit
14451445                     astring summary_string;
14461446                     auditor.summarize(swinfo->shortname(), &summary_string);
1447                     osd_printf_info("%s", summary_string.cstr());
1447                     osd_printf_info("%s", summary_string.c_str());
14481448
14491449                     // display information about what we discovered
14501450                     osd_printf_info("romset %s:%s ", swlistdev->list_name(), swinfo->shortname());
r245622r245623
15561556   astring option_errors;
15571557   m_options.parse_standard_inis(option_errors);
15581558   if (option_errors)
1559      osd_printf_error("%s\n", option_errors.cstr());
1559      osd_printf_error("%s\n", option_errors.c_str());
15601560
15611561   // createconfig?
15621562   if (strcmp(m_options.command(), CLICOMMAND_CREATECONFIG) == 0)
r245622r245623
17791779   {
17801780      // output the name
17811781      astring basename;
1782      osd_printf_info("%-20s", core_filename_extract_base(basename, name).cstr());
1782      osd_printf_info("%-20s", core_filename_extract_base(basename, name).c_str());
17831783      m_total++;
17841784
17851785      // attempt to open as a CHD; fail if not
r245622r245623
18551855   // output the name
18561856   m_total++;
18571857   astring basename;
1858   osd_printf_info("%-20s", core_filename_extract_base(basename, name).cstr());
1858   osd_printf_info("%-20s", core_filename_extract_base(basename, name).c_str());
18591859
18601860   // see if we can find a match in the ROMs
18611861   int found = find_by_hash(hashes, length);
trunk/src/emu/cpu/drcbex64.c
r245622r245623
655655   if (device.machine().options().drc_log_native())
656656   {
657657      astring filename("drcbex64_", device.shortname(), ".asm");
658      m_log = x86log_create_context(filename.cstr());
658      m_log = x86log_create_context(filename.c_str());
659659   }
660660}
661661
r245622r245623
799799      {
800800         astring dasm;
801801         inst.disasm(dasm, &m_drcuml);
802         x86log_add_comment(m_log, dst, "%s", dasm.cstr());
802         x86log_add_comment(m_log, dst, "%s", dasm.c_str());
803803      }
804804
805805      // extract a blockname
trunk/src/emu/cpu/drcbex86.c
r245622r245623
569569   if (device.machine().options().drc_log_native())
570570   {
571571      astring filename("drcbex86_", device.shortname(), ".asm");
572      m_log = x86log_create_context(filename.cstr());
572      m_log = x86log_create_context(filename.c_str());
573573   }
574574}
575575
r245622r245623
782782      {
783783         astring dasm;
784784         inst.disasm(dasm, &m_drcuml);
785         x86log_add_comment(m_log, dst, "%s", dasm.cstr());
785         x86log_add_comment(m_log, dst, "%s", dasm.c_str());
786786      }
787787
788788      // extract a blockname
trunk/src/emu/cpu/drcuml.c
r245622r245623
130130   if (device.machine().options().drc_log_uml())
131131   {
132132      astring filename("drcuml_", m_device.shortname(), ".asm");
133      m_umllog = fopen(filename.cstr(), "w");
133      m_umllog = fopen(filename.c_str(), "w");
134134   }
135135}
136136
r245622r245623
490490         // include the first accumulated comment with this line
491491         if (firstcomment != -1)
492492         {
493            m_drcuml.log_printf("\t%-50.50s; %s\n", dasm.cstr(), get_comment_text(m_inst[firstcomment], comment));
493            m_drcuml.log_printf("\t%-50.50s; %s\n", dasm.c_str(), get_comment_text(m_inst[firstcomment], comment));
494494            firstcomment++;
495495            flushcomments = TRUE;
496496         }
497497         else
498            m_drcuml.log_printf("\t%s\n", dasm.cstr());
498            m_drcuml.log_printf("\t%s\n", dasm.c_str());
499499      }
500500
501501      // flush any comments pending
trunk/src/emu/cpu/dsp16/dsp16.c
r245622r245623
237237                     m_auc & 0x10 ? '0':'.',
238238                     m_auc & 0x08 ? '1':'.',
239239                     m_auc & 0x04 ? '0':'.',
240                     alignString.cstr());
240                     alignString.c_str());
241241         break;
242242      }
243243
r245622r245623
274274         }
275275         string.printf("%c%s%c%c%c%c%c%c%c%c%c%c%c%c%c",
276276                     m_pioc & 0x8000 ? 'I':'.',
277                     strobeString.cstr(),
277                     strobeString.c_str(),
278278                     m_pioc & 0x1000 ? 'O':'I',
279279                     m_pioc & 0x0800 ? 'O':'I',
280280                     m_pioc & 0x0400 ? 'S':'.',
r245622r245623
305305         }
306306         string.printf("%c%s%c%c%c%c%c%c%c",
307307                     m_sioc & 0x0200 ? 'I':'O',
308                     clkString.cstr(),
308                     clkString.c_str(),
309309                     m_sioc & 0x0040 ? 'L':'M',
310310                     m_sioc & 0x0020 ? 'I':'O',
311311                     m_sioc & 0x0010 ? 'I':'O',
trunk/src/emu/cpu/dsp16/dsp16dis.c
r245622r245623
270270         const UINT8 F1 = (op & 0x01e0) >> 5;
271271         astring yString = disasmYField(Y);
272272         astring fString = disasmF1Field(F1, D, S);
273         sprintf(buffer, "%s, %s", fString.cstr(), yString.cstr());
273         sprintf(buffer, "%s, %s", fString.c_str(), yString.c_str());
274274         break;
275275      }
276276      case 0x04: case 0x1c:
r245622r245623
285285         astring fString = disasmF1Field(F1, D, S);
286286         astring aString = (opcode == 0x1c) ? "a0" : "a1";
287287         astring xString = (X) ? "" : "l";
288         sprintf(buffer, "%s = %s%s, %s", yString.cstr(), aString.cstr(), xString.cstr(), fString.cstr());
288         sprintf(buffer, "%s = %s%s, %s", yString.c_str(), aString.c_str(), xString.c_str(), fString.c_str());
289289         break;
290290      }
291291      case 0x16:
r245622r245623
297297         const UINT8 F1 = (op & 0x01e0) >> 5;
298298         astring yString = disasmYField(Y);
299299         astring fString = disasmF1Field(F1, D, S);
300         sprintf(buffer, "%s, x = %s", fString.cstr(), yString.cstr());
300         sprintf(buffer, "%s, x = %s", fString.c_str(), yString.c_str());
301301         break;
302302      }
303303      case 0x17:
r245622r245623
311311         astring yString = disasmYField(Y);
312312         astring fString = disasmF1Field(F1, D, S);
313313         astring xString = (X ? "y" : "y1");
314         sprintf(buffer, "%s, %s = %s", fString.cstr(), xString.cstr(), yString.cstr());
314         sprintf(buffer, "%s, %s = %s", fString.c_str(), xString.c_str(), yString.c_str());
315315         break;
316316      }
317317      case 0x1f:
r245622r245623
325325         astring yString = disasmYField(Y);
326326         astring fString = disasmF1Field(F1, D, S);
327327         astring xString = (X ? "*pt++i" : "*pt++");
328         sprintf(buffer, "%s, y = %s, x = %s", fString.cstr(), yString.cstr(), xString.cstr());
328         sprintf(buffer, "%s, y = %s, x = %s", fString.c_str(), yString.c_str(), xString.c_str());
329329         break;
330330      }
331331      case 0x19: case 0x1b:
r245622r245623
339339         astring fString = disasmF1Field(F1, D, S);
340340         astring xString = (X ? "*pt++i" : "*pt++");
341341         astring aString = (opcode == 0x19) ? "a0" : "a1";
342         sprintf(buffer, "%s, y = %s, x = %s", fString.cstr(), aString.cstr(), xString.cstr());
342         sprintf(buffer, "%s, y = %s, x = %s", fString.c_str(), aString.c_str(), xString.c_str());
343343         if (Y != 0x00) sprintf(buffer, "UNKNOWN");
344344         break;
345345      }
r245622r245623
354354         astring yString = disasmYField(Y);
355355         astring xString = (X ? "y" : "y1");
356356         astring fString = disasmF1Field(F1, D, S);
357         sprintf(buffer, "%s, %s = %s", fString.cstr(), yString.cstr(), xString.cstr());
357         sprintf(buffer, "%s, %s = %s", fString.c_str(), yString.c_str(), xString.c_str());
358358         break;
359359      }
360360
r245622r245623
369369         astring yString = disasmYField(Y);
370370         astring atString = (aT ? "a0" : "a1");
371371         astring fString = disasmF1Field(F1, aT, S);
372         sprintf(buffer, "%s, %s = %s", fString.cstr(), atString.cstr(), yString.cstr());
372         sprintf(buffer, "%s, %s = %s", fString.c_str(), atString.c_str(), yString.c_str());
373373         break;
374374      }
375375
r245622r245623
385385         astring zString = disasmZField(Z);
386386         astring xString = (X ? "y" : "y1");
387387         astring fString = disasmF1Field(F1, D, S);
388         sprintf(buffer, "%s, %s <=> %s", fString.cstr(), xString.cstr(), zString.cstr());
388         sprintf(buffer, "%s, %s <=> %s", fString.c_str(), xString.c_str(), zString.c_str());
389389         break;
390390      }
391391      case 0x1d:
r245622r245623
399399         astring zString = disasmZField(Z);
400400         astring xString = (X ? "*pt++i" : "*pt++");
401401         astring fString = disasmF1Field(F1, D, S);
402         sprintf(buffer, "%s, %s <=> y, x = %s", fString.cstr(), zString.cstr(), xString.cstr());
402         sprintf(buffer, "%s, %s <=> y, x = %s", fString.c_str(), zString.c_str(), xString.c_str());
403403         break;
404404      }
405405
r245622r245623
416416         astring atString = (aT ? "a0" : "a1");
417417         atString += X ? "" : "1";   // TODO: Figure out unclear wording.
418418         astring fString = disasmF1Field(F1, aT, S);
419         sprintf(buffer, "%s, %s <=> %s", fString.cstr(), zString.cstr(), atString.cstr());
419         sprintf(buffer, "%s, %s <=> %s", fString.c_str(), zString.c_str(), atString.c_str());
420420         break;
421421      }
422422
r245622r245623
431431         const UINT8 F2 = (op & 0x01e0) >> 5;
432432         astring fString = disasmF2Field(F2, D, S);
433433         astring conString = disasmCONField(CON);
434         if (op & 0x0800) sprintf(buffer,  "if %s : %s", conString.cstr(), fString.cstr());
435         else             sprintf(buffer, "ifc %s : %s", conString.cstr(), fString.cstr());
434         if (op & 0x0800) sprintf(buffer,  "if %s : %s", conString.c_str(), fString.c_str());
435         else             sprintf(buffer, "ifc %s : %s", conString.c_str(), fString.c_str());
436436         break;
437437      }
438438
r245622r245623
458458         // goto B
459459         const UINT8 B = (op & 0x0700) >> 8;
460460         astring bString = disasmBField(B);
461         sprintf(buffer, "%s", bString.cstr());
461         sprintf(buffer, "%s", bString.c_str());
462462         break;
463463      }
464464
r245622r245623
468468         // if CON [goto/call/return]
469469         const UINT8 CON = (op & 0x001f);
470470         astring conString = disasmCONField(CON);
471         sprintf(buffer, "if %s:", conString.cstr());
471         sprintf(buffer, "if %s:", conString.c_str());
472472         // TODO: Test for invalid ops
473473         // icall
474474         if (op == 0xd40e) sprintf(buffer, "icall");
r245622r245623
482482         const UINT8 R = (op & 0x03f0) >> 4;
483483         const UINT8 S = (op & 0x1000) >> 12;
484484         astring rString = disasmRField(R);
485         sprintf(buffer, "%s = %s", rString.cstr(), (S ? "a1" : "a0"));
485         sprintf(buffer, "%s = %s", rString.c_str(), (S ? "a1" : "a0"));
486486         break;
487487      }
488488      case 0x08:
r245622r245623
491491         const UINT8 R  = (op & 0x03f0) >> 4;
492492         const UINT8 aT = (op & 0x0400) >> 10;
493493         astring rString = disasmRField(R);
494         sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.cstr());
494         sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.c_str());
495495         break;
496496      }
497497      case 0x0f:
r245622r245623
501501         const UINT8 R = (op & 0x03f0) >> 4;
502502         astring yString = disasmYField(Y);
503503         astring rString = disasmRField(R);
504         sprintf(buffer, "%s = %s", rString.cstr(), yString.cstr());
504         sprintf(buffer, "%s = %s", rString.c_str(), yString.c_str());
505505         // TODO: Special case the R == [y, y1, or x] case
506506         break;
507507      }
r245622r245623
513513         astring yString = disasmYField(Y);
514514         astring rString = disasmRField(R);
515515         // TODO: page 3-31 "special function encoding"
516         sprintf(buffer, "%s = %s", yString.cstr(), rString.cstr());
516         sprintf(buffer, "%s = %s", yString.c_str(), rString.c_str());
517517         break;
518518      }
519519      case 0x0d:
r245622r245623
523523         const UINT8 R = (op & 0x03f0) >> 4;
524524         astring zString = disasmZField(Z);
525525         astring rString = disasmRField(R);
526         sprintf(buffer, "%s <=> %s", zString.cstr(), rString.cstr());
526         sprintf(buffer, "%s <=> %s", zString.c_str(), rString.c_str());
527527         break;
528528      }
529529
r245622r245623
533533         // R = N
534534         const UINT8 R = (op & 0x03f0) >> 4;
535535         astring rString = disasmRField(R);
536         sprintf(buffer, "%s = 0x%04x", rString.cstr(), op2);
536         sprintf(buffer, "%s = 0x%04x", rString.c_str(), op2);
537537         opSize = 2;
538538         break;
539539      }
r245622r245623
545545         const UINT16 M = (op & 0x01ff);
546546         const UINT8  R = (op & 0x0e00) >> 9;
547547         astring rString = disasmRImmediateField(R);
548         sprintf(buffer, "%s = 0x%04x", rString.cstr(), M);
548         sprintf(buffer, "%s = 0x%04x", rString.c_str(), M);
549549         break;
550550      }
551551
trunk/src/emu/cpu/dsp56k/dsp56dsm.c
r245622r245623
2121
2222   // Decode and disassemble.
2323   DSP56K::Opcode op(w0, w1);
24   sprintf(buffer, "%s", op.disassemble().cstr());
24   sprintf(buffer, "%s", op.disassemble().c_str());
2525
2626   const unsigned size = op.size();
2727   return (size | DASMFLAG_SUPPORTED);
trunk/src/emu/cpu/dsp56k/inst.h
r245622r245623
204204   void disassemble(astring& retString) const
205205   {
206206      char temp[32];
207      sprintf(temp, "#$%x,%s", m_immediate, regIdAsString(m_destination).cstr());
207      sprintf(temp, "#$%x,%s", m_immediate, regIdAsString(m_destination).c_str());
208208      retString = "andi " + astring(temp);
209209      // NEW // sprintf(opcode_str, "and(i)");
210210   }
r245622r245623
438438      sprintf(temp, "#$%x", m_iVal);
439439      astring source = temp;
440440
441      sprintf(temp, "X:(%s)", regIdAsString(m_r).cstr());
441      sprintf(temp, "X:(%s)", regIdAsString(m_r).c_str());
442442      astring destination = temp;
443443
444444      retString = m_opcode + " " + source + "," + destination;
r245622r245623
11381138      astring destination = temp;
11391139      // NEW // sprintf(temp, "X:(R%d),$%02x", Rnum, pc + 2 + word1);
11401140
1141      sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr());
1141      sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str());
11421142      astring source = temp;
11431143
11441144      retString = "do " + source + "," + destination;
r245622r245623
30423042   void disassemble(astring& retString) const
30433043   {
30443044      char temp[32];
3045      sprintf(temp, "X:(%s)", regIdAsString(m_source).cstr());
3045      sprintf(temp, "X:(%s)", regIdAsString(m_source).c_str());
30463046      retString = "rep " + astring(temp);
30473047   }
30483048   void evaluate(dsp56k_core* cpustate) {}
trunk/src/emu/cpu/dsp56k/pmove.h
r245622r245623
158158      if (r == iR3) return false;
159159
160160      char temp[32];
161      sprintf(temp,  "X:%s,%s", ea1.cstr(), regIdAsString(D1).cstr());
161      sprintf(temp,  "X:%s,%s", ea1.c_str(), regIdAsString(D1).c_str());
162162      parallelMove = temp;
163      sprintf(temp, "X:%s,%s", ea2.cstr(), regIdAsString(D2).cstr());
163      sprintf(temp, "X:%s,%s", ea2.c_str(), regIdAsString(D2).c_str());
164164      parallelMove2 = temp;
165165
166166      return true;
r245622r245623
253253      decode_RR_table(BITSn(word0,0x00c0), r);
254254      decode_DD_table(BITSn(word0,0x0030), S);
255255
256      sprintf(parallel_move_str,  "%s,X:(R%d)+N%d", regIdAsString(Dnot).cstr(), regIDAsNum(r), regIDAsNum(r));
257      sprintf(parallel_move_str2, "%s,%s", regIdAsString(S).cstr(), regIdAsString(Dnot).cstr());
256      sprintf(parallel_move_str,  "%s,X:(R%d)+N%d", regIdAsString(Dnot).c_str(), regIDAsNum(r), regIDAsNum(r));
257      sprintf(parallel_move_str2, "%s,%s", regIdAsString(S).c_str(), regIdAsString(Dnot).c_str());
258258      pms = parallel_move_str;
259259      pms2 = parallel_move_str2;
260260      return true;
trunk/src/emu/cpu/dsp56k/tables.c
r245622r245623
574574         break;
575575      case 0x1:
576576         assemble_address_from_IO_short_address(ppppp, fullAddy);
577         sprintf(temp, "X:<<$%s", fullAddy.cstr());
578         // NEW // sprintf(temp, "X:$%s", fullAddy.cstr());
577         sprintf(temp, "X:<<$%s", fullAddy.c_str());
578         // NEW // sprintf(temp, "X:$%s", fullAddy.c_str());
579579         break;
580580   }
581581   D = temp;
r245622r245623
585585                              astring& source, astring& destination)
586586{
587587   char temp[32];
588   sprintf(temp, "%c:%s", ma, ea.cstr());
588   sprintf(temp, "%c:%s", ma, ea.c_str());
589589   switch(W)
590590   {
591591      case 0x0: source = regIdAsString(SD); destination = temp; break;
r245622r245623
597597                              astring& source, astring& destination)
598598{
599599   char temp[32];
600   sprintf(temp, "%c:%s", ma, ea.cstr());
600   sprintf(temp, "%c:%s", ma, ea.c_str());
601601   switch(W)
602602   {
603603      case 0x0: source = SD;   destination = temp; break;
trunk/src/emu/cpu/mcs96/mcs96.c
r245622r245623
253253      int delta = oprom[2];
254254      if(delta & 0x80)
255255         delta -= 0x100;
256      sprintf(buffer, " %s, %04x", regname(oprom[1]).cstr(), (pc+3+delta) & 0xffff);
256      sprintf(buffer, " %s, %04x", regname(oprom[1]).c_str(), (pc+3+delta) & 0xffff);
257257      flags |= 3;
258258      break;
259259   }
r245622r245623
262262      int delta = oprom[2];
263263      if(delta & 0x80)
264264         delta -= 0x100;
265      sprintf(buffer, " %d, %s, %04x", oprom[0] & 7, regname(oprom[1]).cstr(), (pc+3+delta) & 0xffff);
265      sprintf(buffer, " %d, %s, %04x", oprom[0] & 7, regname(oprom[1]).c_str(), (pc+3+delta) & 0xffff);
266266      flags |= 3;
267267      break;
268268   }
269269
270270   case DASM_direct_1:
271      sprintf(buffer, " %s", regname(oprom[1]).cstr());
271      sprintf(buffer, " %s", regname(oprom[1]).c_str());
272272      flags |= 2;
273273      break;
274274
275275   case DASM_direct_2:
276      sprintf(buffer, " %s, %s", regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
276      sprintf(buffer, " %s, %s", regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
277277      flags |= 3;
278278      break;
279279
280280   case DASM_direct_3:
281      sprintf(buffer, " %s, %s, %s", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
281      sprintf(buffer, " %s, %s, %s", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
282282      flags |= 4;
283283      break;
284284
r245622r245623
288288      break;
289289
290290   case DASM_immed_2b:
291      sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]);
291      sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]);
292292      flags |= 3;
293293      break;
294294
295295   case DASM_immed_or_reg_2b:
296296      if(oprom[1] >= 0x10)
297         sprintf(buffer, " %s, %s", regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
297         sprintf(buffer, " %s, %s", regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
298298      else
299         sprintf(buffer, " %s, #%02x", regname(oprom[2]).cstr(), oprom[1]);
299         sprintf(buffer, " %s, #%02x", regname(oprom[2]).c_str(), oprom[1]);
300300      flags |= 3;
301301      break;
302302
303303   case DASM_immed_3b:
304      sprintf(buffer, " %s, %s, #%02x", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), oprom[1]);
304      sprintf(buffer, " %s, %s, #%02x", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), oprom[1]);
305305      flags |= 4;
306306      break;
307307
r245622r245623
311311      break;
312312
313313   case DASM_immed_2w:
314      sprintf(buffer, " %s, #%02x%02x", regname(oprom[3]).cstr(), oprom[2], oprom[1]);
314      sprintf(buffer, " %s, #%02x%02x", regname(oprom[3]).c_str(), oprom[2], oprom[1]);
315315      flags |= 4;
316316      break;
317317
318318   case DASM_immed_3w:
319      sprintf(buffer, " %s, %s, #%02x%02x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), oprom[2], oprom[1]);
319      sprintf(buffer, " %s, %s, #%02x%02x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), oprom[2], oprom[1]);
320320      flags |= 5;
321321      break;
322322
323323   case DASM_indirect_1n:
324      sprintf(buffer, " [%s]", regname(oprom[1]).cstr());
324      sprintf(buffer, " [%s]", regname(oprom[1]).c_str());
325325      flags |= 2;
326326      break;
327327
328328   case DASM_indirect_1:
329329      if(oprom[1] & 0x01) {
330         sprintf(buffer, " [%s]+", regname(oprom[1]-1).cstr());
330         sprintf(buffer, " [%s]+", regname(oprom[1]-1).c_str());
331331         flags |= 2;
332332      } else {
333         sprintf(buffer, " [%s]", regname(oprom[1]).cstr());
333         sprintf(buffer, " [%s]", regname(oprom[1]).c_str());
334334         flags |= 2;
335335      }
336336      break;
337337
338338   case DASM_indirect_2:
339339      if(oprom[1] & 0x01) {
340         sprintf(buffer, " %s, [%s]+", regname(oprom[2]).cstr(), regname(oprom[1]-1).cstr());
340         sprintf(buffer, " %s, [%s]+", regname(oprom[2]).c_str(), regname(oprom[1]-1).c_str());
341341         flags |= 3;
342342      } else {
343         sprintf(buffer, " %s, [%s]", regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
343         sprintf(buffer, " %s, [%s]", regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
344344         flags |= 3;
345345      }
346346      break;
347347
348348   case DASM_indirect_3:
349349      if(oprom[1] & 0x01) {
350         sprintf(buffer, " %s, %s, [%s]+", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]-1).cstr());
350         sprintf(buffer, " %s, %s, [%s]+", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]-1).c_str());
351351         flags |= 4;
352352      } else {
353         sprintf(buffer, " %s, %s, [%s]", regname(oprom[3]).cstr(), regname(oprom[2]).cstr(), regname(oprom[1]).cstr());
353         sprintf(buffer, " %s, %s, [%s]", regname(oprom[3]).c_str(), regname(oprom[2]).c_str(), regname(oprom[1]).c_str());
354354         flags |= 4;
355355      }
356356      break;
r245622r245623
360360         if(oprom[1] == 0x01)
361361            sprintf(buffer, " %02x%02x", oprom[3], oprom[2]);
362362         else
363            sprintf(buffer, " %02x%02x[%s]", oprom[3], oprom[2], regname(oprom[1]-1).cstr());
363            sprintf(buffer, " %02x%02x[%s]", oprom[3], oprom[2], regname(oprom[1]-1).c_str());
364364         flags |= 4;
365365      } else {
366366         int delta = oprom[2];
r245622r245623
373373               sprintf(buffer, " %02x", delta);
374374         } else {
375375            if(delta < 0)
376               sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).cstr());
376               sprintf(buffer, " -%02x[%s]", -delta, regname(oprom[1]).c_str());
377377            else
378               sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).cstr());
378               sprintf(buffer, " %02x[%s]", delta, regname(oprom[1]).c_str());
379379         }
380380         flags |= 3;
381381      }
r245622r245623
384384   case DASM_indexed_2:
385385      if(oprom[1] & 0x01) {
386386         if(oprom[1] == 0x01)
387            sprintf(buffer, " %s, %02x%02x", regname(oprom[4]).cstr(), oprom[3], oprom[2]);
387            sprintf(buffer, " %s, %02x%02x", regname(oprom[4]).c_str(), oprom[3], oprom[2]);
388388         else
389            sprintf(buffer, " %s, %02x%02x[%s]", regname(oprom[4]).cstr(), oprom[3], oprom[2], regname(oprom[1]-1).cstr());
389            sprintf(buffer, " %s, %02x%02x[%s]", regname(oprom[4]).c_str(), oprom[3], oprom[2], regname(oprom[1]-1).c_str());
390390         flags |= 5;
391391      } else {
392392         int delta = oprom[2];
r245622r245623
394394            delta -= 0x100;
395395         if(oprom[1] == 0x00) {
396396            if(delta < 0)
397               sprintf(buffer, " %s, %04x", regname(oprom[3]).cstr(), delta & 0xffff);
397               sprintf(buffer, " %s, %04x", regname(oprom[3]).c_str(), delta & 0xffff);
398398            else
399               sprintf(buffer, " %s, %02x", regname(oprom[3]).cstr(), delta);
399               sprintf(buffer, " %s, %02x", regname(oprom[3]).c_str(), delta);
400400         } else {
401401            if(delta < 0)
402               sprintf(buffer, " %s, -%02x[%s]", regname(oprom[3]).cstr(), -delta, regname(oprom[1]).cstr());
402               sprintf(buffer, " %s, -%02x[%s]", regname(oprom[3]).c_str(), -delta, regname(oprom[1]).c_str());
403403            else
404               sprintf(buffer, " %s, %02x[%s]", regname(oprom[3]).cstr(), delta, regname(oprom[1]).cstr());
404               sprintf(buffer, " %s, %02x[%s]", regname(oprom[3]).c_str(), delta, regname(oprom[1]).c_str());
405405         }
406406         flags |= 4;
407407      }
r245622r245623
410410   case DASM_indexed_3:
411411      if(oprom[1] & 0x01) {
412412         if(oprom[1] == 0x01)
413            sprintf(buffer, " %s, %s, %02x%02x", regname(oprom[5]).cstr(),  regname(oprom[4]).cstr(), oprom[3], oprom[2]);
413            sprintf(buffer, " %s, %s, %02x%02x", regname(oprom[5]).c_str(),  regname(oprom[4]).c_str(), oprom[3], oprom[2]);
414414         else
415            sprintf(buffer, " %s, %s, %02x%02x[%s]", regname(oprom[5]).cstr(), regname(oprom[4]).cstr(), oprom[3], oprom[2], regname(oprom[1]-1).cstr());
415            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());
416416         flags |= 6;
417417      } else {
418418         int delta = oprom[2];
r245622r245623
420420            delta -= 0x100;
421421         if(oprom[1] == 0x00) {
422422            if(delta < 0)
423               sprintf(buffer, " %s, %s, %04x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta & 0xffff);
423               sprintf(buffer, " %s, %s, %04x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta & 0xffff);
424424            else
425               sprintf(buffer, " %s, %s, %02x", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta);
425               sprintf(buffer, " %s, %s, %02x", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta);
426426         } else {
427427            if(delta < 0)
428               sprintf(buffer, " %s, %s, -%02x[%s]", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), -delta, regname(oprom[1]).cstr());
428               sprintf(buffer, " %s, %s, -%02x[%s]", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), -delta, regname(oprom[1]).c_str());
429429            else
430               sprintf(buffer, " %s, %s, %02x[%s]", regname(oprom[4]).cstr(), regname(oprom[3]).cstr(), delta, regname(oprom[1]).cstr());
430               sprintf(buffer, " %s, %s, %02x[%s]", regname(oprom[4]).c_str(), regname(oprom[3]).c_str(), delta, regname(oprom[1]).c_str());
431431         }
432432         flags |= 5;
433433      }
trunk/src/emu/cpu/score/score.c
r245622r245623
8383   astring tmp_string;
8484
8585   for(int i=0; i<0x20; i++)
86      state_add(SCORE_GPR + i, tmp_string.format("r%d", i).cstr(), m_gpr[i]).callimport().callexport().formatstr("%08X");
86      state_add(SCORE_GPR + i, tmp_string.format("r%d", i).c_str(), m_gpr[i]).callimport().callexport().formatstr("%08X");
8787
8888   for(int i=0; i<0x20; i++)
89      state_add(SCORE_CR + i, tmp_string.format("cr%d", i).cstr(), m_cr[i]).callimport().callexport().formatstr("%08X");
89      state_add(SCORE_CR + i, tmp_string.format("cr%d", i).c_str(), m_cr[i]).callimport().callexport().formatstr("%08X");
9090
9191   for(int i=0; i<3; i++)
92      state_add(SCORE_SR + i, tmp_string.format("sr%d", i).cstr(), m_sr[i]).callimport().callexport().formatstr("%08X");
92      state_add(SCORE_SR + i, tmp_string.format("sr%d", i).c_str(), m_sr[i]).callimport().callexport().formatstr("%08X");
9393
9494   state_add(SCORE_CEH, "ceh", REG_CEH).callimport().callexport().formatstr("%08X");
9595   state_add(SCORE_CEL, "cel", REG_CEL).callimport().callexport().formatstr("%08X");
trunk/src/emu/cpu/uml.c
r245622r245623
743743           astring disasm1, disasm2;
744744           orig.disasm(disasm1, block->drcuml);
745745           inst->disasm(disasm2, block->drcuml);
746           osd_printf_debug("Simplified: %-50.50s -> %s\n", disasm1.cstr(), disasm2.cstr());
746           osd_printf_debug("Simplified: %-50.50s -> %s\n", disasm1.c_str(), disasm2.c_str());
747747       }
748748   */
749749
trunk/src/emu/debug/debugcmd.c
r245622r245623
10441044      /* special message for none */
10451045      if (!buffer)
10461046         buffer.printf("Not currently ignoring any devices");
1047      debug_console_printf(machine, "%s\n", buffer.cstr());
1047      debug_console_printf(machine, "%s\n", buffer.c_str());
10481048   }
10491049
10501050   /* otherwise clear the ignore flag on all requested CPUs */
r245622r245623
11091109      /* special message for none */
11101110      if (!buffer)
11111111         buffer.printf("Not currently observing any devices");
1112      debug_console_printf(machine, "%s\n", buffer.cstr());
1112      debug_console_printf(machine, "%s\n", buffer.c_str());
11131113   }
11141114
11151115   /* otherwise set the ignore flag on all requested CPUs */
r245622r245623
13321332               buffer.catprintf(" if %s", bp->condition());
13331333            if (astring(bp->action()) != astring(""))
13341334               buffer.catprintf(" do %s", bp->action());
1335            debug_console_printf(machine, "%s\n", buffer.cstr());
1335            debug_console_printf(machine, "%s\n", buffer.c_str());
13361336            printed++;
13371337         }
13381338      }
r245622r245623
15021502                  buffer.catprintf(" if %s", wp->condition());
15031503               if (astring(wp->action()) != astring(""))
15041504                  buffer.catprintf(" do %s", wp->action());
1505               debug_console_printf(machine, "%s\n", buffer.cstr());
1505               debug_console_printf(machine, "%s\n", buffer.c_str());
15061506               printed++;
15071507            }
15081508         }
r245622r245623
16411641            buffer.catprintf("if %s", rp->condition());
16421642            if (rp->action() != NULL)
16431643               buffer.catprintf(" do %s", rp->action());
1644            debug_console_printf(machine, "%s\n", buffer.cstr());
1644            debug_console_printf(machine, "%s\n", buffer.c_str());
16451645            printed++;
16461646         }
16471647      }
r245622r245623
26052605   /* do it */
26062606   cpu->debug()->trace(f, trace_over, action);
26072607   if (f)
2608      debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename.cstr());
2608      debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename.c_str());
26092609   else
26102610      debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag());
26112611}
r245622r245623
31003100
31013101   // and output it as appropriate
31023102   if (file != NULL)
3103      fprintf(file, "%s\n", buffer.cstr());
3103      fprintf(file, "%s\n", buffer.c_str());
31043104   else
3105      debug_console_printf(machine, "%s\n", buffer.cstr());
3105      debug_console_printf(machine, "%s\n", buffer.c_str());
31063106
31073107   // cleanup
31083108   if (file != NULL)
trunk/src/emu/debug/debugcpu.c
r245622r245623
30593059            }
30603060            else
30613061               buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc);
3062            debug_console_printf(space.machine(), "%s\n", buffer.cstr());
3062            debug_console_printf(space.machine(), "%s\n", buffer.c_str());
30633063            space.device().debug()->compute_debug_flags();
30643064         }
30653065         break;
r245622r245623
34933493   buffer.cat(dasm);
34943494
34953495   // output the result
3496   fprintf(&m_file, "%s\n", buffer.cstr());
3496   fprintf(&m_file, "%s\n", buffer.c_str());
34973497
34983498   // do we need to step the trace over this instruction?
34993499   if (m_trace_over && (dasmresult & DASMFLAG_SUPPORTED) != 0 && (dasmresult & DASMFLAG_STEP_OVER) != 0)
trunk/src/emu/debug/dvbpoints.c
r245622r245623
134134   {
135135      astring name;
136136      name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
137      m_source_list.append(*global_alloc(debug_view_source(name.cstr(), &dasm->device())));
137      m_source_list.append(*global_alloc(debug_view_source(name.c_str(), &dasm->device())));
138138   }
139139
140140   // reset the source to a known good entry
r245622r245623
196196      buffer.expand(diff);
197197      for (int i = 0; i < diff; i++)
198198         buffer.catprintf(" ");
199      str.catprintf("%s", buffer.cstr());
199      str.catprintf("%s", buffer.c_str());
200200   }
201201}
202202
trunk/src/emu/debug/dvstate.c
r245622r245623
291291            len += m_divider - 1 - curitem->m_symbol.len();
292292         }
293293
294         memcpy(&temp[len], curitem->m_symbol.cstr(), curitem->m_symbol.len());
294         memcpy(&temp[len], curitem->m_symbol.c_str(), curitem->m_symbol.len());
295295         len += curitem->m_symbol.len();
296296
297297         temp[len++] = ' ';
298298         temp[len++] = ' ';
299299
300         memcpy(&temp[len], valstr.cstr(), curitem->m_vallen);
300         memcpy(&temp[len], valstr.c_str(), curitem->m_vallen);
301301         len += curitem->m_vallen;
302302
303303         temp[len++] = ' ';
trunk/src/emu/debug/dvwpoints.c
r245622r245623
156156   {
157157      astring name;
158158      name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
159      m_source_list.append(*global_alloc(debug_view_source(name.cstr(), &dasm->device())));
159      m_source_list.append(*global_alloc(debug_view_source(name.c_str(), &dasm->device())));
160160   }
161161
162162   // reset the source to a known good entry
r245622r245623
220220      buffer.expand(diff);
221221      for (int i = 0; i < diff; i++)
222222         buffer.catprintf(" ");
223      str.catprintf("%s", buffer.cstr());
223      str.catprintf("%s", buffer.c_str());
224224   }
225225}
226226
trunk/src/emu/debug/express.c
r245622r245623
287287   if (m_setter != NULL)
288288      (*m_setter)(m_table, m_ref, newvalue);
289289   else
290      throw emu_fatalerror("Symbol '%s' is read-only", m_name.cstr());
290      throw emu_fatalerror("Symbol '%s' is read-only", m_name.c_str());
291291}
292292
293293
r245622r245623
347347
348348UINT64 function_symbol_entry::value() const
349349{
350   throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.cstr());
350   throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.c_str());
351351}
352352
353353
r245622r245623
357357
358358void function_symbol_entry::set_value(UINT64 newvalue)
359359{
360   throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.cstr());
360   throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.c_str());
361361}
362362
363363
r245622r245623
368368UINT64 function_symbol_entry::execute(int numparams, const UINT64 *paramlist)
369369{
370370   if (numparams < m_minparams)
371      throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.cstr(), m_minparams);
371      throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.c_str(), m_minparams);
372372   if (numparams > m_maxparams)
373      throw emu_fatalerror("Function '%s' accepts no more than %d parameters", m_name.cstr(), m_maxparams);
373      throw emu_fatalerror("Function '%s' accepts no more than %d parameters", m_name.c_str(), m_maxparams);
374374   return (*m_execute)(m_table, m_ref, numparams, paramlist);
375375}
376376
r245622r245623
927927
928928   // if we have an 0x prefix, we must be a hex value
929929   if (buffer[0] == '0' && buffer[1] == 'x')
930      return parse_number(token, buffer.cstr() + 2, 16, expression_error::INVALID_NUMBER);
930      return parse_number(token, buffer.c_str() + 2, 16, expression_error::INVALID_NUMBER);
931931
932932   // if we have a # prefix, we must be a decimal value
933933   if (buffer[0] == '#')
934      return parse_number(token, buffer.cstr() + 1, 10, expression_error::INVALID_NUMBER);
934      return parse_number(token, buffer.c_str() + 1, 10, expression_error::INVALID_NUMBER);
935935
936936   // if we have a $ prefix, we are a hex value
937937   if (buffer[0] == '$')
938      return parse_number(token, buffer.cstr() + 1, 16, expression_error::INVALID_NUMBER);
938      return parse_number(token, buffer.c_str() + 1, 16, expression_error::INVALID_NUMBER);
939939
940940   // check for a symbol match
941941   symbol_entry *symbol = m_symtable->find_deep(buffer);
trunk/src/emu/digfx.c
r245622r245623
327327
328328         UINT32 region_length = valid.region_length(gfxregion);
329329         if (region_length == 0)
330            osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.cstr());
330            osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.c_str());
331331
332332         // if we have a valid region, and we're not using auto-sizing, check the decode against the region length
333333         else if (!IS_FRAC(layout.total))
trunk/src/emu/diimage.c
r245622r245623
236236
237237const char *device_image_interface::error()
238238{
239   return (m_err_message) ? m_err_message.cstr() : messages[m_err];
239   return (m_err_message) ? m_err_message.c_str() : messages[m_err];
240240}
241241
242242
r245622r245623
295295   bool success = FALSE;
296296   bool done = FALSE;
297297
298   directory = osd_opendir(m_working_directory.cstr());
298   directory = osd_opendir(m_working_directory.c_str());
299299   if (directory != NULL)
300300   {
301301      while(!done && (entry = osd_readdir(directory)) != NULL)
r245622r245623
536536
537537   /* find the extensions */
538538   astring extensions(file_extensions());
539   char *ext = strtok((char*)extensions.cstr(),",");
539   char *ext = strtok((char*)extensions.c_str(),",");
540540   while (ext != NULL)
541541   {
542542      if (!core_stricmp(ext, file_extension))
r245622r245623
823823            // - if we are not using lists, we have regiontag only;
824824            // - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
825825            // try to load from list/setname
826            if ((m_mame_file == NULL) && (tag2.cstr() != NULL))
827               filerr = common_process_file(device().machine().options(), tag2.cstr(), has_crc, crc, romp, &m_mame_file);
826            if ((m_mame_file == NULL) && (tag2.c_str() != NULL))
827               filerr = common_process_file(device().machine().options(), tag2.c_str(), has_crc, crc, romp, &m_mame_file);
828828            // try to load from list/parentname
829            if ((m_mame_file == NULL) && (tag3.cstr() != NULL))
830               filerr = common_process_file(device().machine().options(), tag3.cstr(), has_crc, crc, romp, &m_mame_file);
829            if ((m_mame_file == NULL) && (tag3.c_str() != NULL))
830               filerr = common_process_file(device().machine().options(), tag3.c_str(), has_crc, crc, romp, &m_mame_file);
831831            // try to load from setname
832            if ((m_mame_file == NULL) && (tag4.cstr() != NULL))
833               filerr = common_process_file(device().machine().options(), tag4.cstr(), has_crc, crc, romp, &m_mame_file);
832            if ((m_mame_file == NULL) && (tag4.c_str() != NULL))
833               filerr = common_process_file(device().machine().options(), tag4.c_str(), has_crc, crc, romp, &m_mame_file);
834834            // try to load from parentname
835            if ((m_mame_file == NULL) && (tag5.cstr() != NULL))
836               filerr = common_process_file(device().machine().options(), tag5.cstr(), has_crc, crc, romp, &m_mame_file);
835            if ((m_mame_file == NULL) && (tag5.c_str() != NULL))
836               filerr = common_process_file(device().machine().options(), tag5.c_str(), has_crc, crc, romp, &m_mame_file);
837837
838838            warningcount += verify_length_and_hash(m_mame_file,ROM_GETNAME(romp),ROM_GETLENGTH(romp),hash_collection(ROM_GETHASHDATA(romp)));
839839
trunk/src/emu/disound.c
r245622r245623
238238   for (const sound_route *route = first_route(); route != NULL; route = route->next())
239239   {
240240      // find a device with the requested tag
241      const device_t *target = device().siblingdevice(route->m_target.cstr());
241      const device_t *target = device().siblingdevice(route->m_target.c_str());
242242      if (target == NULL)
243         osd_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.cstr());
243         osd_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.c_str());
244244
245245      // if it's not a speaker or a sound device, error
246246      const device_sound_interface *sound;
247247      if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
248         osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.cstr(), target->name());
248         osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.c_str(), target->name());
249249   }
250250}
251251
r245622r245623
318318                  int streamoutputnum;
319319                  sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum);
320320                  if (outputstream == NULL)
321                     fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.cstr(), outputnum);
321                     fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.c_str(), outputnum);
322322
323323                  // find the input stream to connect to
324324                  int streaminputnum;
325325                  sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
326326                  if (inputstream == NULL)
327                     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);
327                     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);
328328
329329                  // set the input
330330                  inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);
trunk/src/emu/emuopts.c
r245622r245623
532532
533533   // append errors if requested
534534   if (error && error_string != NULL)
535      error_string->catprintf("While parsing %s:\n%s\n", file.fullpath(), error.cstr());
535      error_string->catprintf("While parsing %s:\n%s\n", file.fullpath(), error.c_str());
536536
537537   return result;
538538}
r245622r245623
544544   int pos = buffer.chr(0, ',');
545545   if (pos != -1)
546546      buffer = buffer.substr(0, pos);
547   return buffer.cstr();
547   return buffer.c_str();
548548}
549549
550550const char *emu_options::sub_value(astring &buffer, const char *name, const char *subname) const
r245622r245623
561561   }
562562   else
563563      buffer.reset();
564   return buffer.cstr();
564   return buffer.c_str();
565565}
trunk/src/emu/emupal.c
r245622r245623
409409   {
410410      // find the extended (split) memory, if present
411411      astring tag_ext(tag(), "_ext");
412      const memory_share *share_ext = memshare(tag_ext.cstr());
412      const memory_share *share_ext = memshare(tag_ext.c_str());
413413
414414      // make sure we have specified a format
415415      assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified");
trunk/src/emu/fileio.c
r245622r245623
845845      int fileno = -1;
846846
847847      // see if we can find a file with the right name and (if available) crc
848      if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), true, true);
848      if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), true, true);
849849
850850      // if that failed, look for a file with the right crc, but the wrong filename
851851      if (fileno==-1)
852         if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), true, false);
852         if (m_openflags & OPEN_FLAG_HAS_CRC) fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), true, false);
853853
854854      // if that failed, look for a file with the right name; reporting a bad checksum
855855      // is more helpful and less confusing than reporting "rom not found"
856856      if (fileno==-1)
857         fileno = _7z_search_crc_match(_7z, m_crc, filename.cstr(), filename.len(), false, true);
857         fileno = _7z_search_crc_match(_7z, m_crc, filename.c_str(), filename.len(), false, true);
858858
859859      if (fileno != -1)
860860      {
trunk/src/emu/image.c
r245622r245623
232232
233233            fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
234234               image->device().name(),
235               image_basename.cstr(),
236               image_err.cstr());
235               image_basename.c_str(),
236               image_err.c_str());
237237         }
238238      }
239239   }
r245622r245623
280280
281281            fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
282282               image->device().name(),
283               image_err.cstr());
283               image_err.c_str());
284284         }
285285   }
286286
trunk/src/emu/imagedev/cassette.c
r245622r245623
280280            fname = m_mame_file->filename();
281281            int loc = fname.rchr(0,'.');
282282            if (loc!=-1) {
283               extension = fname.substr(loc + 1,fname.len()-loc).cstr();
283               extension = fname.substr(loc + 1,fname.len()-loc).c_str();
284284            } else {
285285               extension = "";
286286            }
trunk/src/emu/imagedev/diablo.c
r245622r245623
173173   astring fname(name, ".dif");
174174
175175   /* try to open the diff */
176   //printf("Opening differencing image file: %s\n", fname.cstr());
176   //printf("Opening differencing image file: %s\n", fname.c_str());
177177   emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
178178   file_error filerr = diff_file.open(fname);
179179   if (filerr == FILERR_NONE)
r245622r245623
181181      astring fullpath(diff_file.fullpath());
182182      diff_file.close();
183183
184      //printf("Opening differencing image file: %s\n", fullpath.cstr());
184      //printf("Opening differencing image file: %s\n", fullpath.c_str());
185185      return diff_chd.open(fullpath, true, &source);
186186   }
187187
188188   /* didn't work; try creating it instead */
189   //printf("Creating differencing image: %s\n", fname.cstr());
189   //printf("Creating differencing image: %s\n", fname.c_str());
190190   diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
191191   filerr = diff_file.open(fname);
192192   if (filerr == FILERR_NONE)
r245622r245623
195195      diff_file.close();
196196
197197      /* create the CHD */
198      //printf("Creating differencing image file: %s\n", fullpath.cstr());
198      //printf("Creating differencing image file: %s\n", fullpath.c_str());
199199      chd_codec_type compression[4] = { CHD_CODEC_NONE };
200200      chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
201201      if (err != CHDERR_NONE)
trunk/src/emu/imagedev/harddriv.c
r245622r245623
179179   astring fname(name, ".dif");
180180
181181   /* try to open the diff */
182   //printf("Opening differencing image file: %s\n", fname.cstr());
182   //printf("Opening differencing image file: %s\n", fname.c_str());
183183   emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
184184   file_error filerr = diff_file.open(fname);
185185   if (filerr == FILERR_NONE)
r245622r245623
187187      astring fullpath(diff_file.fullpath());
188188      diff_file.close();
189189
190      //printf("Opening differencing image file: %s\n", fullpath.cstr());
190      //printf("Opening differencing image file: %s\n", fullpath.c_str());
191191      return diff_chd.open(fullpath, true, &source);
192192   }
193193
194194   /* didn't work; try creating it instead */
195   //printf("Creating differencing image: %s\n", fname.cstr());
195   //printf("Creating differencing image: %s\n", fname.c_str());
196196   diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
197197   filerr = diff_file.open(fname);
198198   if (filerr == FILERR_NONE)
r245622r245623
201201      diff_file.close();
202202
203203      /* create the CHD */
204      //printf("Creating differencing image file: %s\n", fullpath.cstr());
204      //printf("Creating differencing image file: %s\n", fullpath.c_str());
205205      chd_codec_type compression[4] = { CHD_CODEC_NONE };
206206      chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
207207      if (err != CHDERR_NONE)
trunk/src/emu/info.c
r245622r245623
197197   dtd.replace(0,"__XML_ROOT__", emulator_info::get_xml_root());
198198   dtd.replace(0,"__XML_TOP__", emulator_info::get_xml_top());
199199
200   fprintf(m_output, "%s\n\n", dtd.cstr());
200   fprintf(m_output, "%s\n\n", dtd.c_str());
201201
202202   // top-level tag
203203   fprintf(m_output, "<%s build=\"%s\" debug=\""
r245622r245623
343343   fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
344344   astring src(device.source());
345345   src.replace("../","");
346   fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.cstr()));
346   fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.c_str()));
347347   fprintf(m_output, " isdevice=\"yes\"");
348348   fprintf(m_output, " runnable=\"no\"");
349349   output_sampleof();
r245622r245623
404404         {
405405            astring temptag("_");
406406            temptag.cat(option->name());
407            device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), option->devtype(), 0);
407            device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.c_str(), option->devtype(), 0);
408408
409409            // notify this device and all its subdevices that they are now configured
410410            device_iterator subiter(*dev);
r245622r245623
413413                  device->config_complete();
414414
415415            if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE)
416               output_one_device(*dev, temptag.cstr());
416               output_one_device(*dev, temptag.c_str());
417417
418            const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.cstr());
418            const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.c_str());
419419         }
420420      }
421421   }
r245622r245623
582582
583583            output.cat("/>\n");
584584
585            fprintf(m_output, "%s", output.cstr());
585            fprintf(m_output, "%s", output.c_str());
586586         }
587587      }
588588}
r245622r245623
10851085            // output the switch name information
10861086            astring normalized_field_name(xml_normalize_string(field->name()));
10871087            astring normalized_newtag(xml_normalize_string(newtag));
1088            output.catprintf("\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.cstr(), normalized_newtag.cstr(), field->mask());
1088            output.catprintf("\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.c_str(), normalized_newtag.c_str(), field->mask());
10891089
10901090            // loop over settings
10911091            for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
r245622r245623
10961096            // terminate the switch entry
10971097            output.catprintf("\t\t</%s>\n", outertag);
10981098
1099            fprintf(m_output, "%s", output.cstr());
1099            fprintf(m_output, "%s", output.c_str());
11001100         }
11011101}
11021102
r245622r245623
12401240
12411241         astring extensions(imagedev->file_extensions());
12421242
1243         char *ext = strtok((char *)extensions.cstr(), ",");
1243         char *ext = strtok((char *)extensions.c_str(), ",");
12441244         while (ext != NULL)
12451245         {
12461246            fprintf(m_output, "\t\t\t<extension");
trunk/src/emu/input.c
r245622r245623
531531
532532const char *joystick_map::to_string(astring &string) const
533533{
534   string.printf("%s\n", m_origstring.cstr());
534   string.printf("%s\n", m_origstring.c_str());
535535   for (int rownum = 0; rownum < 9; rownum++)
536536   {
537537      string.catprintf("  ");
r245622r245623
15791579
15801580   // first token should be the devclass
15811581   int curtok = 0;
1582   input_device_class devclass = input_device_class((*devclass_token_table)[token[curtok++].cstr()]);
1582   input_device_class devclass = input_device_class((*devclass_token_table)[token[curtok++].c_str()]);
15831583   if (devclass == ~0)
15841584      return INPUT_CODE_INVALID;
15851585
r245622r245623
15941594      return INPUT_CODE_INVALID;
15951595
15961596   // next token is the item ID
1597   input_item_id itemid = input_item_id((*itemid_token_table)[token[curtok].cstr()]);
1597   input_item_id itemid = input_item_id((*itemid_token_table)[token[curtok].c_str()]);
15981598   bool standard = (itemid != ~0);
15991599
16001600   // if we're a standard code, default the itemclass based on it
r245622r245623
16321632   input_item_modifier modifier = ITEM_MODIFIER_NONE;
16331633   if (curtok < numtokens)
16341634   {
1635      modifier = input_item_modifier((*modifier_token_table)[token[curtok].cstr()]);
1635      modifier = input_item_modifier((*modifier_token_table)[token[curtok].c_str()]);
16361636      if (modifier != ~0)
16371637         curtok++;
16381638      else
r245622r245623
16421642   // if we have another token, it is the item class
16431643   if (curtok < numtokens)
16441644   {
1645      UINT32 temp = (*itemclass_token_table)[token[curtok].cstr()];
1645      UINT32 temp = (*itemclass_token_table)[token[curtok].c_str()];
16461646      if (temp != ~0)
16471647      {
16481648         curtok++;
r245622r245623
20202020
20212021   // loop until we're done
20222022   astring strcopy = string;
2023   char *str = const_cast<char *>(strcopy.cstr());
2023   char *str = const_cast<char *>(strcopy.c_str());
20242024   while (1)
20252025   {
20262026      // trim any leading spaces
trunk/src/emu/ioport.c
r245622r245623
24822482      astring errors;
24832483      m_portlist.append(*device, errors);
24842484      if (errors)
2485         osd_printf_error("Input port errors:\n%s", errors.cstr());
2485         osd_printf_error("Input port errors:\n%s", errors.c_str());
24862486   }
24872487
24882488   // renumber player numbers for controller ports
r245622r245623
37033703   m_owner.subtag(fulltag, tag);
37043704
37053705   // find the existing port
3706   m_curport = m_portlist.find(fulltag.cstr());
3706   m_curport = m_portlist.find(fulltag.c_str());
37073707   if (m_curport == NULL)
3708      throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr());
3708      throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.c_str());
37093709
37103710   // bump the modification count, and reset current field/setting
37113711   m_curport->m_modcount++;
trunk/src/emu/luaengine.c
r245622r245623
10441044   osd_lock_acquire(lock);
10451045   if (msg.ready == 1) {
10461046   lua_settop(m_lua_state, 0);
1047   int status = luaL_loadbuffer(m_lua_state, msg.text.cstr(), strlen(msg.text.cstr()), "=stdin");
1047   int status = luaL_loadbuffer(m_lua_state, msg.text.c_str(), strlen(msg.text.c_str()), "=stdin");
10481048   if (incomplete(status)==0)  /* cannot try to add lines? */
10491049   {
10501050      if (status == LUA_OK) status = docall(0, LUA_MULTRET);
trunk/src/emu/machine.c
r245622r245623
592592         // copy the device name to an astring
593593         astring devname_str;
594594         devname_str.cpysubstr(statename_str, pos + 3, end - pos - 3);
595         //printf("check template: %s\n", devname_str.cstr());
595         //printf("check template: %s\n", devname_str.c_str());
596596
597597         // verify that there is such a device for this system
598598         image_interface_iterator iter(root_device());
r245622r245623
600600         {
601601            // get the device name
602602            astring tempdevname(image->brief_instance_name());
603            //printf("check device: %s\n", tempdevname.cstr());
603            //printf("check device: %s\n", tempdevname.c_str());
604604
605605            if (devname_str.cmp(tempdevname) == 0)
606606            {
r245622r245623
612612                  // setup snapname and remove the %d_
613613                  statename_str.replace(0, devname_str, filename);
614614                  statename_str.del(pos, 3);
615                  //printf("check image: %s\n", filename.cstr());
615                  //printf("check image: %s\n", filename.c_str());
616616
617617                  name_found = 1;
618618               }
r245622r245623
651651      // take into account the statename option
652652      const char *stateopt = options().state_name();
653653      astring statename = get_statename(stateopt);
654      m_saveload_pending_file.cpy(statename.cstr()).cat(PATH_SEPARATOR).cat(filename).cat(".sta");
654      m_saveload_pending_file.cpy(statename.c_str()).cat(PATH_SEPARATOR).cat(filename).cat(".sta");
655655   }
656656}
657657
trunk/src/emu/machine/fdc_pll.c
r245622r245623
6060
6161#if 0
6262   if(!edge.is_never())
63      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());
63      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());
6464#endif
6565
6666   if(next > limit)
trunk/src/emu/machine/hdc9234.c
r245622r245623
572572
573573void hdc9234_device::wait_time(emu_timer *tm, const attotime &delay, int param)
574574{
575   if (TRACE_DELAY) logerror("%s: [%s] Delaying by %4.2f microsecs\n", tag(), ttsn().cstr(), delay.as_double()*1000000);
575   if (TRACE_DELAY) logerror("%s: [%s] Delaying by %4.2f microsecs\n", tag(), ttsn().c_str(), delay.as_double()*1000000);
576576   tm->adjust(delay);
577577   m_substate = param;
578578}
r245622r245623
17841784*/
17851785void hdc9234_device::live_start(int state)
17861786{
1787   if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().cstr(), state);
1787   if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().c_str(), state);
17881788   m_live_state.time = machine().time();
17891789   m_live_state.state = state;
17901790   m_live_state.next_state = -1;
r245622r245623
18281828   if (TRACE_LIVE)
18291829   {
18301830      if (limit == attotime::never)
1831         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");
1831         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");
18321832      else
1833         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");
1833         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");
18341834   }
18351835
18361836   if (limit == attotime::never)
r245622r245623
18621862
18631863         if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM)
18641864         {
1865            logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).cstr(), tts(limit).cstr());
1865            logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str());
18661866            m_last_live_state = m_live_state.state;
18671867         }
18681868
r245622r245623
18711871
18721872         if (read_one_bit(limit))
18731873         {
1874            if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).cstr());
1874            if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str());
18751875            return;
18761876         }
1877         // logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).cstr());
1878         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
1877         // logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).c_str());
1878         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
18791879            get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
18801880
18811881         // [1] p. 9: The ID field sync mark must be found within 33,792 byte times
r245622r245623
18901890            // MFM case
18911891            if (m_live_state.shift_reg == 0x4489)
18921892            {
1893               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
1893               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
18941894               m_live_state.crc = 0x443b;
18951895               m_live_state.data_separator_phase = false;
18961896               m_live_state.bit_counter = 0;
r245622r245623
19211921
19221922         if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_IDAM)
19231923         {
1924            logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).cstr());
1924            logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str());
19251925            m_last_live_state = m_live_state.state;
19261926         }
19271927
19281928         // Beyond time limit?
19291929         if (read_one_bit(limit)) return;
19301930
1931         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
1931         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
19321932               get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
19331933
19341934         if (m_live_state.bit_count_total > 33792*16)
r245622r245623
19501950               m_live_state.state = SEARCH_IDAM;
19511951            }
19521952            else
1953               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
1953               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
19541954            // Continue
19551955            break;
19561956         }
19571957
1958         if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg);
1958         if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
19591959
19601960         // Check for ident field (fe, ff, fd, fc)
19611961         if ((m_live_state.data_reg & 0xfc) != 0xfc)
r245622r245623
19761976      case READ_ID_FIELDS_INTO_REGS:
19771977         if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS)
19781978         {
1979            logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).cstr());
1979            logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str());
19801980            m_last_live_state = m_live_state.state;
19811981         }
19821982
r245622r245623
20172017      case SEARCH_DAM:
20182018         if (TRACE_LIVE && m_last_live_state != SEARCH_DAM)
20192019         {
2020            logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).cstr());
2020            logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str());
20212021            m_last_live_state = m_live_state.state;
20222022         }
20232023
r245622r245623
20262026         if(read_one_bit(limit))
20272027            return;
20282028
2029         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
2029         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
20302030               get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
20312031
20322032         if (!fm_mode())
r245622r245623
20402040
20412041            if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489)
20422042            {
2043               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
2043               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
20442044               m_live_state.crc = 0x443b;
20452045               m_live_state.data_separator_phase = false;
20462046               m_live_state.bit_counter = 0;
r245622r245623
20742074      case READ_TWO_MORE_A1_DAM: {
20752075         if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_DAM)
20762076         {
2077            logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).cstr());
2077            logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str());
20782078            m_last_live_state = m_live_state.state;
20792079         }
20802080
20812081         if(read_one_bit(limit))
20822082            return;
20832083
2084         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).cstr(), m_live_state.shift_reg,
2084         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
20852085            get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
20862086
20872087         // Repeat until we have collected 16 bits
r245622r245623
20982098               return;
20992099            }
21002100            else
2101               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).cstr());
2101               if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
21022102            // Continue
21032103            break;
21042104         }
21052105
2106         if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).cstr(), m_live_state.data_reg);
2106         if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
21072107
21082108         if ((m_live_state.data_reg & 0xff) == 0xf8)
21092109         {
r245622r245623
21332133      {
21342134         if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA)
21352135         {
2136            logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).cstr());
2136            logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str());
21372137            m_last_live_state = m_live_state.state;
21382138         }
21392139
r245622r245623
21582158         // Repeat until we have collected 16 bits
21592159         if (m_live_state.bit_counter & 15) break;
21602160
2161         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);
2161         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);
21622162         int slot = (m_live_state.bit_counter >> 4)-1;
21632163
21642164         if (slot < calc_sector_size())
r245622r245623
21792179               }
21802180               else
21812181               {
2182                  if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).cstr());
2182                  if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).c_str());
21832183                  wait_for_realtime(IDLE);
21842184               }
21852185               return;
r245622r245623
21912191      case READ_SECTOR_DATA1:
21922192         if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA1)
21932193         {
2194            logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).cstr());
2194            logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).c_str());
21952195            m_last_live_state = m_live_state.state;
21962196         }
21972197
r245622r245623
22372237         // 5. Write the CRC bytes
22382238
22392239         if (TRACE_LIVE)
2240            logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).cstr());
2240            logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str());
22412241
22422242         skip_on_track(m_gap2_size, WRITE_DAM_SYNC);
22432243         break;
r245622r245623
25542554         // The pause is implemented by doing dummy reads on the floppy
25552555         if (read_one_bit(limit))
25562556         {
2557            if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).cstr(), tts(limit).cstr());
2557            if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str());
25582558            return;
25592559         }
25602560
25612561         // Repeat until we have collected 16 bits
25622562         if ((m_live_state.bit_counter & 15)==0)
25632563         {
2564            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);
2564            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);
25652565            wait_for_realtime(READ_TRACK_NEXT_BYTE);
25662566            return;
25672567         }
r245622r245623
26362636      if(m_live_state.time > machine().time())
26372637      {
26382638         // If so, we must roll back to the last checkpoint
2639         if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().cstr(), tts(m_live_state.time).cstr());
2639         if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
26402640         rollback();
26412641         // and replay until we reach the machine time
26422642         live_run_until(machine().time());
r245622r245623
26472647      {
26482648         // We are behind machine time, so we will never get back to that
26492649         // time, thus we can commit that position
2650         if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().cstr(), tts(m_live_state.time).cstr());
2650         if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
26512651         // Write on floppy image
26522652         m_pll.commit(m_floppy, m_live_state.time);
26532653
r245622r245623
26722672{
26732673   if (!m_live_state.time.is_never() && m_live_state.time > machine().time())
26742674   {
2675      if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().cstr(), tts(m_live_state.time).cstr());
2675      if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().c_str(), tts(m_live_state.time).c_str());
26762676      rollback();
26772677      live_run_until(machine().time());
26782678   }
r245622r245623
27352735{
27362736   m_live_state.next_state = state;
27372737   m_timer->adjust(m_live_state.time - machine().time());
2738   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());
2738   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());
27392739}
27402740
27412741/*
r245622r245623
28582858   m_live_state.bit_counter = 16;
28592859   m_live_state.last_data_bit = raw & 1;
28602860   m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
2861   if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).cstr(), byte, raw);
2861   if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), byte, raw);
28622862   checkpoint();
28632863}
28642864
r245622r245623
28722872   m_live_state.bit_counter = 16;
28732873   m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
28742874   m_live_state.last_data_bit = raw & 1;
2875   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);
2875   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);
28762876   checkpoint();
28772877}
28782878
r245622r245623
29602960   {
29612961      if (m_executing)
29622962      {
2963         logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().cstr(), current_command(), data);
2963         logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().c_str(), current_command(), data);
29642964      }
29652965      else
29662966      {
r245622r245623
31693169
31703170void hdc9234_device::index_callback(int level)
31713171{
3172   if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().cstr(), level);
3172   if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().c_str(), level);
31733173
31743174   // Synchronize our position on the track
31753175   live_sync();
r245622r245623
31823182
31833183   if (m_event_line == INDEX_LINE && level == m_line_level && m_state_after_line != UNDEF)
31843184   {
3185      if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().cstr(), level);
3185      if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().c_str(), level);
31863186      m_substate = m_state_after_line;
31873187      m_state_after_line = UNDEF;
31883188      if (m_stopwrite)
r245622r245623
31973197
31983198void hdc9234_device::ready_callback(int level)
31993199{
3200   if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().cstr(), level);
3200   if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().c_str(), level);
32013201
32023202   // Set the interrupt status flag
32033203   set_bits(m_register_r[INT_STATUS], ST_RDYCHNG, true);
r245622r245623
32223222
32233223void hdc9234_device::seek_complete_callback(int level)
32243224{
3225   if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().cstr(), level);
3225   if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().c_str(), level);
32263226
32273227   // Synchronize our position on the track
32283228   live_sync();
r245622r245623
33233323{
33243324   if (state==ASSERT_LINE)
33253325   {
3326      if (TRACE_DMA) logerror("%s: [%s] DMA acknowledged\n", tag(), ttsn().cstr());
3326      if (TRACE_DMA) logerror("%s: [%s] DMA acknowledged\n", tag(), ttsn().c_str());
33273327      set_bits(m_register_r[INT_STATUS], ST_OVRUN, false);
33283328   }
33293329}
trunk/src/emu/machine/ram.c
r245622r245623
162162      else
163163         output.catprintf(").\n");
164164
165      osd_printf_error("%s", output.cstr());
165      osd_printf_error("%s", output.c_str());
166166
167167      osd_printf_warning("Setting value to default %s\n",m_default_size);
168168      astring error;
trunk/src/emu/machine/upd765.c
r245622r245623
676676         if(read_one_bit(limit))
677677            return;
678678#if 0
679         fprintf(stderr, "%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
679         fprintf(stderr, "%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
680680               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
681681               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
682682               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
707707         if(read_one_bit(limit))
708708            return;
709709#if 0
710         fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
710         fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
711711               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
712712               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
713713               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
747747         int slot = (cur_live.bit_counter >> 4)-1;
748748
749749         if(0)
750            fprintf(stderr, "%s: slot=%d data=%02x crc=%04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc);
750            fprintf(stderr, "%s: slot=%d data=%02x crc=%04x\n", tts(cur_live.tm).c_str(), slot, cur_live.data_reg, cur_live.crc);
751751         cur_live.idbuf[slot] = cur_live.data_reg;
752752         if(slot == 5) {
753753            live_delay(IDLE);
r245622r245623
760760         if(read_one_bit(limit))
761761            return;
762762#if 0
763         fprintf(stderr, "%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
763         fprintf(stderr, "%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
764764               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
765765               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
766766               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
806806         if(read_one_bit(limit))
807807            return;
808808#if 0
809         fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
809         fprintf(stderr, "%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
810810               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
811811               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
812812               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
11171117         break;
11181118
11191119      default:
1120         logerror("%s: Unknown live state %d\n", tts(cur_live.tm).cstr(), cur_live.state);
1120         logerror("%s: Unknown live state %d\n", tts(cur_live.tm).c_str(), cur_live.state);
11211121         return;
11221122      }
11231123   }
r245622r245623
17111711         return;
17121712
17131713      default:
1714         logerror("%s: read sector unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
1714         logerror("%s: read sector unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
17151715         return;
17161716      }
17171717   }
r245622r245623
18371837         return;
18381838
18391839      default:
1840         logerror("%s: write sector unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
1840         logerror("%s: write sector unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
18411841         return;
18421842      }
18431843   }
r245622r245623
20072007         return;
20082008
20092009      default:
2010         logerror("%s: read track unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
2010         logerror("%s: read track unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
20112011         return;
20122012      }
20132013   }
r245622r245623
20802080         return;
20812081
20822082      default:
2083         logerror("%s: format track unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
2083         logerror("%s: format track unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
20842084         return;
20852085      }
20862086   }
r245622r245623
21592159         return;
21602160
21612161      default:
2162         logerror("%s: read id unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
2162         logerror("%s: read id unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
21632163         return;
21642164      }
21652165   }
r245622r245623
22872287         break;
22882288
22892289      default:
2290         logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().cstr(), fi.sub_state);
2290         logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().c_str(), fi.sub_state);
22912291         break;
22922292      }
22932293
r245622r245623
23352335      break;
23362336
23372337   default:
2338      logerror("%s: general_continue on unknown main-state %d\n", ttsn().cstr(), fi.main_state);
2338      logerror("%s: general_continue on unknown main-state %d\n", ttsn().c_str(), fi.main_state);
23392339      break;
23402340   }
23412341}
trunk/src/emu/machine/wd_fdc.c
r245622r245623
383383         return;
384384
385385      default:
386         logerror("%s: seek unknown sub-state %d\n", ttsn().cstr(), sub_state);
386         logerror("%s: seek unknown sub-state %d\n", ttsn().c_str(), sub_state);
387387         return;
388388      }
389389   }
r245622r245623
505505         break;
506506
507507      default:
508         logerror("%s: read sector unknown sub-state %d\n", ttsn().cstr(), sub_state);
508         logerror("%s: read sector unknown sub-state %d\n", ttsn().c_str(), sub_state);
509509         return;
510510      }
511511   }
r245622r245623
584584         return;
585585
586586      default:
587         logerror("%s: read track unknown sub-state %d\n", ttsn().cstr(), sub_state);
587         logerror("%s: read track unknown sub-state %d\n", ttsn().c_str(), sub_state);
588588         return;
589589      }
590590   }
r245622r245623
659659         return;
660660
661661      default:
662         logerror("%s: read id unknown sub-state %d\n", ttsn().cstr(), sub_state);
662         logerror("%s: read id unknown sub-state %d\n", ttsn().c_str(), sub_state);
663663         return;
664664      }
665665   }
r245622r245623
763763               sprintf(buf, "%02x", format_last_byte);
764764            format_description_string += buf;
765765         }
766         if (TRACE_DESC) logerror("%s: track description %s\n", tag(), format_description_string.cstr());
766         if (TRACE_DESC) logerror("%s: track description %s\n", tag(), format_description_string.c_str());
767767         command_end();
768768         return;
769769
770770      default:
771         logerror("%s: write track unknown sub-state %d\n", ttsn().cstr(), sub_state);
771         logerror("%s: write track unknown sub-state %d\n", ttsn().c_str(), sub_state);
772772         return;
773773      }
774774   }
r245622r245623
867867         break;
868868
869869      default:
870         logerror("%s: write sector unknown sub-state %d\n", ttsn().cstr(), sub_state);
870         logerror("%s: write sector unknown sub-state %d\n", ttsn().c_str(), sub_state);
871871         return;
872872      }
873873   }
r245622r245623
898898   }
899899
900900   if(command & 0x03) {
901      logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().cstr(), command);
901      logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().c_str(), command);
902902   }
903903}
904904
r245622r245623
932932      write_sector_continue();
933933      break;
934934   default:
935      logerror("%s: general_continue on unknown main-state %d\n", ttsn().cstr(), main_state);
935      logerror("%s: general_continue on unknown main-state %d\n", ttsn().c_str(), main_state);
936936      break;
937937   }
938938}
r245622r245623
963963
964964   default:
965965      if(cur_live.tm.is_never())
966         logerror("%s: do_generic on unknown sub-state %d\n", ttsn().cstr(), sub_state);
966         logerror("%s: do_generic on unknown sub-state %d\n", ttsn().c_str(), sub_state);
967967      break;
968968   }
969969}
r245622r245623
12851285      break;
12861286
12871287   default:
1288      logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().cstr(), sub_state);
1288      logerror("%s: Index pulse on unknown sub-state %d\n", ttsn().c_str(), sub_state);
12891289      break;
12901290   }
12911291
r245622r245623
13601360{
13611361   if(!cur_live.tm.is_never()) {
13621362      if(cur_live.tm > machine().time()) {
1363         if (TRACE_SYNC) logerror("%s: Rolling back and replaying (%s)\n", ttsn().cstr(), tts(cur_live.tm).cstr());
1363         if (TRACE_SYNC) logerror("%s: Rolling back and replaying (%s)\n", ttsn().c_str(), tts(cur_live.tm).c_str());
13641364         rollback();
13651365         live_run(machine().time());
13661366         pll_commit(floppy, cur_live.tm);
13671367      } else {
1368         if (TRACE_SYNC) logerror("%s: Committing (%s)\n", ttsn().cstr(), tts(cur_live.tm).cstr());
1368         if (TRACE_SYNC) logerror("%s: Committing (%s)\n", ttsn().c_str(), tts(cur_live.tm).c_str());
13691369         pll_commit(floppy, cur_live.tm);
13701370         if(cur_live.next_state != -1) {
13711371            cur_live.state = cur_live.next_state;
r245622r245623
14851485      }
14861486   }
14871487
1488   //  fprintf(stderr, "%s: live_run(%s)\n", ttsn().cstr(), tts(limit).cstr());
1488   //  fprintf(stderr, "%s: live_run(%s)\n", ttsn().c_str(), tts(limit).c_str());
14891489
14901490   for(;;) {
14911491      switch(cur_live.state) {
r245622r245623
14931493         if(read_one_bit(limit))
14941494            return;
14951495
1496         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
1496         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
14971497               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
14981498               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
14991499               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
15261526         if(read_one_bit(limit))
15271527            return;
15281528
1529         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
1529         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
15301530               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
15311531               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
15321532               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
15681568         if(cur_live.bit_counter & 15)
15691569            break;
15701570         int slot = (cur_live.bit_counter >> 4)-1;
1571         //          fprintf(stderr, "%s: slot[%d] = %02x  crc = %04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc);
1571         //          fprintf(stderr, "%s: slot[%d] = %02x  crc = %04x\n", tts(cur_live.tm).c_str(), slot, cur_live.data_reg, cur_live.crc);
15721572         cur_live.idbuf[slot] = cur_live.data_reg;
15731573         if(slot == 5) {
15741574            live_delay(IDLE);
r245622r245623
16091609         if(read_one_bit(limit))
16101610            return;
16111611
1612         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
1612         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d.%x\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
16131613               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
16141614               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
16151615               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
16561656         if(read_one_bit(limit))
16571657            return;
16581658
1659         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).cstr(), cur_live.shift_reg,
1659         if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x counter=%d\n", tts(cur_live.tm).c_str(), cur_live.shift_reg,
16601660               (cur_live.shift_reg & 0x4000 ? 0x80 : 0x00) |
16611661               (cur_live.shift_reg & 0x1000 ? 0x40 : 0x00) |
16621662               (cur_live.shift_reg & 0x0400 ? 0x20 : 0x00) |
r245622r245623
19541954            break;
19551955
19561956         default:
1957            logerror("%s: Unknown sub state %d in WRITE_BYTE_DONE\n", tts(cur_live.tm).cstr(), sub_state);
1957            logerror("%s: Unknown sub state %d in WRITE_BYTE_DONE\n", tts(cur_live.tm).c_str(), sub_state);
19581958            live_abort();
19591959            return;
19601960         }
r245622r245623
20172017         break;
20182018
20192019      default:
2020         logerror("%s: Unknown live state %d\n", tts(cur_live.tm).cstr(), cur_live.state);
2020         logerror("%s: Unknown live state %d\n", tts(cur_live.tm).c_str(), cur_live.state);
20212021         return;
20222022      }
20232023   }
r245622r245623
21862186
21872187   /* if (TRACE_TRANSITION)
21882188       if(!when.is_never())
2189           logerror("transition_time=%s\n", tts(when).cstr());
2189           logerror("transition_time=%s\n", tts(when).c_str());
21902190   */
21912191   for(;;) {
21922192      // if (TRACE_TRANSITION) logerror("slot=%2d, counter=%03x\n", slot, counter);
21932193      attotime etime = ctime+delays[slot];
2194      // if (TRACE_TRANSITION) logerror("etime=%s\n", tts(etime).cstr());
2194      // if (TRACE_TRANSITION) logerror("etime=%s\n", tts(etime).c_str());
21952195      if(etime > limit)
21962196         return -1;
21972197      if(transition_time == 0xffff && !when.is_never() && etime >= when)
trunk/src/emu/mame.c
r245622r245623
285285      va_end(arg);
286286
287287      // pop it in the UI
288      machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.cstr());
288      machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.c_str());
289289
290290      /*
291291      // also write to error.log
292      logerror("popmessage: %s\n", temp.cstr());
292      logerror("popmessage: %s\n", temp.c_str());
293293
294294#ifdef MAME_DEBUG
295295      // and to command-line in a DEBUG build
296      osd_printf_info("popmessage: %s\n", temp.cstr());
296      osd_printf_info("popmessage: %s\n", temp.c_str());
297297#endif
298298      */
299299   }
trunk/src/emu/mconfig.c
r245622r245623
129129            break;
130130      if (!curdevice)
131131         throw emu_fatalerror("Could not find %s when looking up path for device %s\n",
132                           part.cstr(), orig_tag);
132                           part.c_str(), orig_tag);
133133      owner = curdevice;
134134      tag = next+1;
135135   }
trunk/src/emu/memory.c
r245622r245623
18361836      {
18371837         // if we can't find it, add it to our map
18381838         astring fulltag;
1839         if (manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr()) == NULL)
1839         if (manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str()) == NULL)
18401840         {
1841            VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.cstr(), entry->m_byteend + 1 - entry->m_bytestart));
1841            VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.c_str(), entry->m_byteend + 1 - entry->m_bytestart));
18421842            memory_share *share = global_alloc(memory_share(m_map->m_databits, entry->m_byteend + 1 - entry->m_bytestart, endianness()));
18431843            manager().m_sharelist.append(fulltag, *share);
18441844         }
r245622r245623
18801880         entry->m_devbase.subtag(fulltag, entry->m_region);
18811881
18821882         // set the memory address
1883         entry->m_memory = machine().root_device().memregion(fulltag.cstr())->base() + entry->m_rgnoffs;
1883         entry->m_memory = machine().root_device().memregion(fulltag.c_str())->base() + entry->m_rgnoffs;
18841884      }
18851885   }
18861886
r245622r245623
21542154      if (entry->m_memory == NULL && entry->m_share != NULL)
21552155      {
21562156         astring fulltag;
2157         memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr());
2157         memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str());
21582158         if (share != NULL && share->ptr() != NULL)
21592159         {
21602160            entry->m_memory = share->ptr();
r245622r245623
21772177      if (entry->m_memory != NULL && entry->m_share != NULL)
21782178      {
21792179         astring fulltag;
2180         memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr());
2180         memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str());
21812181         if (share != NULL && share->ptr() == NULL)
21822182         {
21832183            share->set_ptr(entry->m_memory);
r245622r245623
26132613   if (entry->m_share != NULL)
26142614   {
26152615      astring fulltag;
2616      memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).cstr());
2616      memory_share *share = manager().m_sharelist.find(entry->m_devbase.subtag(fulltag, entry->m_share).c_str());
26172617      if (share != NULL && share->ptr() == NULL)
26182618         return true;
26192619   }
r245622r245623
40224022   if (entrynum < 0 || entrynum >= m_entry.count())
40234023      throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
40244024   if (m_entry[entrynum].m_raw == NULL)
4025      throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.cstr(), entrynum);
4025      throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.c_str(), entrynum);
40264026
40274027   // set both raw and decrypted values
40284028   m_curentry = entrynum;
trunk/src/emu/rendlay.c
r245622r245623
13281328
13291329      // log an error
13301330      if (!m_alphafile[0])
1331         osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].cstr());
1331         osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].c_str());
13321332      else
1333         osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].cstr(), m_alphafile[0].cstr());
1333         osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].c_str(), m_alphafile[0].c_str());
13341334   }
13351335}
13361336
trunk/src/emu/romload.c
r245622r245623
441441
442442   bool is_chd_error = (is_chd && chderr != CHDERR_FILE_NOT_FOUND);
443443   if (is_chd_error)
444      romdata->errorstring.catprintf("%s CHD ERROR: %s\n", name.cstr(), chd_file::error_string(chderr));
444      romdata->errorstring.catprintf("%s CHD ERROR: %s\n", name.c_str(), chd_file::error_string(chderr));
445445
446446   /* optional files are okay */
447447   if (ROM_ISOPTIONAL(romp))
448448   {
449449      if (!is_chd_error)
450         romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", name.cstr(), tried_file_names.cstr());
450         romdata->errorstring.catprintf("OPTIONAL %s NOT FOUND%s\n", name.c_str(), tried_file_names.c_str());
451451      romdata->warnings++;
452452   }
453453
r245622r245623
455455   else if (hash_collection(ROM_GETHASHDATA(romp)).flag(hash_collection::FLAG_NO_DUMP))
456456   {
457457      if (!is_chd_error)
458         romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name.cstr(), tried_file_names.cstr());
458         romdata->errorstring.catprintf("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name.c_str(), tried_file_names.c_str());
459459      romdata->knownbad++;
460460   }
461461
r245622r245623
463463   else
464464   {
465465      if (!is_chd_error)
466         romdata->errorstring.catprintf("%s NOT FOUND%s\n", name.cstr(), tried_file_names.cstr());
466         romdata->errorstring.catprintf("%s NOT FOUND%s\n", name.c_str(), tried_file_names.c_str());
467467      romdata->errors++;
468468   }
469469}
r245622r245623
560560   if (romdata->errors != 0)
561561   {
562562      /* create the error message and exit fatally */
563      osd_printf_error("%s", romdata->errorstring.cstr());
563      osd_printf_error("%s", romdata->errorstring.c_str());
564564      fatalerror_exitcode(romdata->machine(), MAMERR_MISSING_FILES, "Required files are missing, the %s cannot be run.",emulator_info::get_gamenoun());
565565   }
566566
r245622r245623
570570      romdata->errorstring.cat("WARNING: the ");
571571      romdata->errorstring.cat(emulator_info::get_gamenoun());
572572      romdata->errorstring.cat(" might not run correctly.");
573      osd_printf_warning("%s\n", romdata->errorstring.cstr());
573      osd_printf_warning("%s\n", romdata->errorstring.c_str());
574574   }
575575}
576576
r245622r245623
677677         }
678678
679679         // prepare locations where we have to load from: list/parentname & list/clonename
680         astring swlist(tag1.cstr());
680         astring swlist(tag1.c_str());
681681         tag2.cpy(swlist.cat(tag4));
682682         if (has_parent)
683683         {
r245622r245623
695695      if (!is_list)
696696      {
697697         tried_file_names += " " + tag1;
698         filerr = common_process_file(romdata->machine().options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
698         filerr = common_process_file(romdata->machine().options(), tag1.c_str(), has_crc, crc, romp, &romdata->file);
699699      }
700700      else
701701      {
702702         // try to load from list/setname
703         if ((romdata->file == NULL) && (tag2.cstr() != NULL))
703         if ((romdata->file == NULL) && (tag2.c_str() != NULL))
704704         {
705705            tried_file_names += " " + tag2;
706            filerr = common_process_file(romdata->machine().options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
706            filerr = common_process_file(romdata->machine().options(), tag2.c_str(), has_crc, crc, romp, &romdata->file);
707707         }
708708         // try to load from list/parentname
709         if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL))
709         if ((romdata->file == NULL) && has_parent && (tag3.c_str() != NULL))
710710         {
711711            tried_file_names += " " + tag3;
712            filerr = common_process_file(romdata->machine().options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
712            filerr = common_process_file(romdata->machine().options(), tag3.c_str(), has_crc, crc, romp, &romdata->file);
713713         }
714714         // try to load from setname
715         if ((romdata->file == NULL) && (tag4.cstr() != NULL))
715         if ((romdata->file == NULL) && (tag4.c_str() != NULL))
716716         {
717717            tried_file_names += " " + tag4;
718            filerr = common_process_file(romdata->machine().options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
718            filerr = common_process_file(romdata->machine().options(), tag4.c_str(), has_crc, crc, romp, &romdata->file);
719719         }
720720         // try to load from parentname
721         if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL))
721         if ((romdata->file == NULL) && has_parent && (tag5.c_str() != NULL))
722722         {
723723            tried_file_names += " " + tag5;
724            filerr = common_process_file(romdata->machine().options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
724            filerr = common_process_file(romdata->machine().options(), tag5.c_str(), has_crc, crc, romp, &romdata->file);
725725         }
726726      }
727727   }
r245622r245623
10781078         }
10791079
10801080         // prepare locations where we have to load from: list/parentname (if any) & list/clonename
1081         astring swlist(tag1.cstr());
1081         astring swlist(tag1.c_str());
10821082         tag2.cpy(swlist.cat(tag4));
10831083         if (has_parent)
10841084         {
r245622r245623
10981098      else
10991099      {
11001100         // try to load from list/setname
1101         if ((filerr != FILERR_NONE) && (tag2.cstr() != NULL))
1102            filerr = common_process_file(options, tag2.cstr(), ".chd", romp, image_file);
1101         if ((filerr != FILERR_NONE) && (tag2.c_str() != NULL))
1102            filerr = common_process_file(options, tag2.c_str(), ".chd", romp, image_file);
11031103         // try to load from list/parentname (if any)
1104         if ((filerr != FILERR_NONE) && has_parent && (tag3.cstr() != NULL))
1105            filerr = common_process_file(options, tag3.cstr(), ".chd", romp, image_file);
1104         if ((filerr != FILERR_NONE) && has_parent && (tag3.c_str() != NULL))
1105            filerr = common_process_file(options, tag3.c_str(), ".chd", romp, image_file);
11061106         // try to load from setname
1107         if ((filerr != FILERR_NONE) && (tag4.cstr() != NULL))
1108            filerr = common_process_file(options, tag4.cstr(), ".chd", romp, image_file);
1107         if ((filerr != FILERR_NONE) && (tag4.c_str() != NULL))
1108            filerr = common_process_file(options, tag4.c_str(), ".chd", romp, image_file);
11091109         // try to load from parentname (if any)
1110         if ((filerr != FILERR_NONE) && has_parent && (tag5.cstr() != NULL))
1111            filerr = common_process_file(options, tag5.cstr(), ".chd", romp, image_file);
1110         if ((filerr != FILERR_NONE) && has_parent && (tag5.c_str() != NULL))
1111            filerr = common_process_file(options, tag5.c_str(), ".chd", romp, image_file);
11121112         // only for CHD we also try to load from list/
1113         if ((filerr != FILERR_NONE) && (tag1.cstr() != NULL))
1113         if ((filerr != FILERR_NONE) && (tag1.c_str() != NULL))
11141114         {
11151115            tag1.del(tag1.len() - 1, 1);    // remove the PATH_SEPARATOR
1116            filerr = common_process_file(options, tag1.cstr(), ".chd", romp, image_file);
1116            filerr = common_process_file(options, tag1.c_str(), ".chd", romp, image_file);
11171117         }
11181118      }
11191119   }
r245622r245623
11821182   astring fname(ROM_GETNAME(romp), ".dif");
11831183
11841184   /* try to open the diff */
1185   LOG(("Opening differencing image file: %s\n", fname.cstr()));
1185   LOG(("Opening differencing image file: %s\n", fname.c_str()));
11861186   emu_file diff_file(options.diff_directory(), OPEN_FLAG_READ | OPEN_FLAG_WRITE);
11871187   file_error filerr = diff_file.open(fname);
11881188   if (filerr == FILERR_NONE)
r245622r245623
11901190      astring fullpath(diff_file.fullpath());
11911191      diff_file.close();
11921192
1193      LOG(("Opening differencing image file: %s\n", fullpath.cstr()));
1193      LOG(("Opening differencing image file: %s\n", fullpath.c_str()));
11941194      return diff_chd.open(fullpath, true, &source);
11951195   }
11961196
11971197   /* didn't work; try creating it instead */
1198   LOG(("Creating differencing image: %s\n", fname.cstr()));
1198   LOG(("Creating differencing image: %s\n", fname.c_str()));
11991199   diff_file.set_openflags(OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
12001200   filerr = diff_file.open(fname);
12011201   if (filerr == FILERR_NONE)
r245622r245623
12041204      diff_file.close();
12051205
12061206      /* create the CHD */
1207      LOG(("Creating differencing image file: %s\n", fullpath.cstr()));
1207      LOG(("Creating differencing image file: %s\n", fullpath.c_str()));
12081208      chd_codec_type compression[4] = { CHD_CODEC_NONE };
12091209      chd_error err = diff_chd.create(fullpath, source.logical_bytes(), source.hunk_bytes(), compression, source);
12101210      if (err != CHDERR_NONE)
r245622r245623
12391239         astring filename(ROM_GETNAME(romp), ".chd");
12401240
12411241         /* first open the source drive */
1242         LOG(("Opening disk image: %s\n", filename.cstr()));
1242         LOG(("Opening disk image: %s\n", filename.c_str()));
12431243         err = chd_error(open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, chd->orig_chd(), locationtag));
12441244         if (err != CHDERR_NONE)
12451245         {
r245622r245623
12551255         /* verify the hash */
12561256         if (hashes != acthashes)
12571257         {
1258            romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.cstr());
1258            romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.c_str());
12591259            dump_wrong_and_correct_checksums(romdata, hashes, acthashes);
12601260            romdata->warnings++;
12611261         }
12621262         else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
12631263         {
1264            romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.cstr());
1264            romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.c_str());
12651265            romdata->knownbad++;
12661266         }
12671267
r245622r245623
12721272            err = open_disk_diff(romdata->machine().options(), romp, chd->orig_chd(), chd->diff_chd());
12731273            if (err != CHDERR_NONE)
12741274            {
1275               romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_file::error_string(err));
1275               romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.c_str(), chd_file::error_string(err));
12761276               romdata->errors++;
12771277               global_free(chd);
12781278               continue;
r245622r245623
13851385      UINT32 regionlength = ROMREGION_GETLENGTH(region);
13861386
13871387      device.subtag(regiontag, ROMREGION_GETTAG(region));
1388      LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
1388      LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength));
13891389
13901390      /* the first entry must be a region */
13911391      assert(ROMENTRY_ISREGION(region));
r245622r245623
14391439   for (region = start_region; region != NULL; region = rom_next_region(region))
14401440   {
14411441      device.subtag(regiontag, ROMREGION_GETTAG(region));
1442      region_post_process(romdata, regiontag.cstr(), ROMREGION_ISINVERTED(region));
1442      region_post_process(romdata, regiontag.c_str(), ROMREGION_ISINVERTED(region));
14431443   }
14441444
14451445   /* display the results and exit */
r245622r245623
14631463         UINT32 regionlength = ROMREGION_GETLENGTH(region);
14641464
14651465         rom_region_name(regiontag, *device, region);
1466         LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
1466         LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength));
14671467
14681468         /* the first entry must be a region */
14691469         assert(ROMENTRY_ISREGION(region));
r245622r245623
15481548         } else {
15491549            specbios = romdata->machine().options().sub_value(temp,device->owner()->tag()+1,"bios");
15501550            if (strlen(specbios) == 0) {
1551               specbios = device->default_bios_tag().cstr();
1551               specbios = device->default_bios_tag().c_str();
15521552            }
15531553         }
15541554         determine_bios_rom(romdata, device, specbios);
trunk/src/emu/save.c
r245622r245623
179179
180180      // error if we are equal
181181      if (entry->m_name == totalname)
182         fatalerror("Duplicate save state registration entry (%s)\n", totalname.cstr());
182         fatalerror("Duplicate save state registration entry (%s)\n", totalname.c_str());
183183   }
184184
185185   // insert us into the list
r245622r245623
333333   for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
334334   {
335335      // add the entry name to the CRC
336      crc = crc32(crc, (UINT8 *)entry->m_name.cstr(), entry->m_name.len());
336      crc = crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.len());
337337
338338      // add the type and size to the CRC
339339      UINT32 temp[2];
r245622r245623
353353void save_manager::dump_registry() const
354354{
355355   for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
356      LOG(("%s: %d x %d\n", entry->m_name.cstr(), entry->m_typesize, entry->m_typecount));
356      LOG(("%s: %d x %d\n", entry->m_name.c_str(), entry->m_typesize, entry->m_typecount));
357357}
358358
359359
trunk/src/emu/schedule.c
r245622r245623
757757      {
758758         device_t *device = machine().device(machine().config().m_perfect_cpu_quantum);
759759         if (device == NULL)
760            fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.cstr());
760            fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.c_str());
761761
762762         device_execute_interface *exec;
763763         if (!device->interface(exec))
764            fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.cstr());
764            fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.c_str());
765765
766766         min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum);
767767      }
trunk/src/emu/screen.c
r245622r245623
10581058   if (m_screen_overlay_bitmap.valid())
10591059      m_container->set_overlay(&m_screen_overlay_bitmap);
10601060   else
1061      osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.cstr());
1061      osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.c_str());
10621062}
trunk/src/emu/softlist.c
r245622r245623
500500{
501501   // add to the global map whenever we check a list so we don't re-check
502502   // it in the future
503   if (valid.already_checked(astring("softlist/", m_list_name.cstr())))
503   if (valid.already_checked(astring("softlist/", m_list_name.c_str())))
504504      return;
505505
506506   // do device validation only in case of validate command
r245622r245623
565565      }
566566
567567      // check for duplicate descriptions
568      if (descriptions.add(astring(swinfo->longname()).makelower().cstr(), swinfo, false) == TMERR_DUPLICATE)
568      if (descriptions.add(astring(swinfo->longname()).makelower().c_str(), swinfo, false) == TMERR_DUPLICATE)
569569         osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo->longname(), swinfo->shortname());
570570
571571      bool is_clone = false;
trunk/src/emu/sound/disc_inp.inc
r245622r245623
6363   double min, max;
6464
6565   astring fulltag;
66   m_port = m_device->machine().root_device().ioport(m_device->siblingtag(fulltag, (const char *)this->custom_data()).cstr());
66   m_port = m_device->machine().root_device().ioport(m_device->siblingtag(fulltag, (const char *)this->custom_data()).c_str());
6767   if (m_port == NULL)
6868      fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag\n", this->index());
6969
trunk/src/emu/tilemap.c
r245622r245623
17861786
17871787      // look for an extension entry
17881788      astring tag_ext(tag(), "_ext");
1789      share = memshare(tag_ext.cstr());
1789      share = memshare(tag_ext.c_str());
17901790      if (share != NULL)
17911791         m_extmem.set(*share, m_bytes_per_entry);
17921792   }
trunk/src/emu/ui/barcode.c
r245622r245623
118118                  machine().ui().popup_time(5, "Barcode length invalid!");
119119               else
120120               {
121                  current_device()->write_code(tmp_file.cstr(), tmp_file.len());
121                  current_device()->write_code(tmp_file.c_str(), tmp_file.len());
122122                  // if sending was successful, reset char buffer
123123                  if (m_barcode_buffer[0] != '\0')
124124                     memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer));
trunk/src/emu/ui/devopt.c
r245622r245623
2929   device_iterator deviter(machine.config().root_device());
3030   for (device_t *device = deviter.first(); device != NULL; device = deviter.next())
3131   {
32      if (strcmp(device->tag(), tmp_tag.cstr()) == 0)
32      if (strcmp(device->tag(), tmp_tag.c_str()) == 0)
3333      {
3434         m_mounted = true;
3535         break;
r245622r245623
176176      }
177177
178178      if (bios)
179         string.catprintf("* BIOS settings:\n  %d options    [default: %s]\n", bios, bios_str.cstr());
179         string.catprintf("* BIOS settings:\n  %d options    [default: %s]\n", bios, bios_str.c_str());
180180   }
181181
182182   int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0;
trunk/src/emu/ui/inputmap.c
r245622r245623
414414      item = itemarray[curitem];
415415      assert(nameformat[item->type] != NULL);
416416
417      if (item->owner_name && strcmp(item->owner_name, prev_owner.cstr()) != 0)
417      if (item->owner_name && strcmp(item->owner_name, prev_owner.c_str()) != 0)
418418      {
419419         if (first_entry)
420420            first_entry = false;
r245622r245623
568568               flags |= MENU_FLAG_RIGHT_ARROW;
569569
570570            /* add the menu item */
571            if (strcmp(field->device().tag(), prev_owner.cstr()) != 0)
571            if (strcmp(field->device().tag(), prev_owner.c_str()) != 0)
572572            {
573573               if (first_entry)
574574                  first_entry = false;
r245622r245623
872872                  analog_item_data *data;
873873                  UINT32 flags = 0;
874874                  astring name;
875                  if (strcmp(field->device().tag(), prev_owner.cstr()) != 0)
875                  if (strcmp(field->device().tag(), prev_owner.c_str()) != 0)
876876                  {
877877                     if (first_entry)
878878                        first_entry = false;
r245622r245623
895895                  {
896896                     default:
897897                     case ANALOG_ITEM_KEYSPEED:
898                        text.printf("%s Digital Speed", name.cstr());
898                        text.printf("%s Digital Speed", name.c_str());
899899                        subtext.printf("%d", settings.delta);
900900                        data->min = 0;
901901                        data->max = 255;
r245622r245623
904904                        break;
905905
906906                     case ANALOG_ITEM_CENTERSPEED:
907                        text.printf("%s Autocenter Speed", name.cstr());
907                        text.printf("%s Autocenter Speed", name.c_str());
908908                        subtext.printf("%d", settings.centerdelta);
909909                        data->min = 0;
910910                        data->max = 255;
r245622r245623
913913                        break;
914914
915915                     case ANALOG_ITEM_REVERSE:
916                        text.printf("%s Reverse", name.cstr());
916                        text.printf("%s Reverse", name.c_str());
917917                        subtext.cpy(settings.reverse ? "On" : "Off");
918918                        data->min = 0;
919919                        data->max = 1;
r245622r245623
922922                        break;
923923
924924                     case ANALOG_ITEM_SENSITIVITY:
925                        text.printf("%s Sensitivity", name.cstr());
925                        text.printf("%s Sensitivity", name.c_str());
926926                        subtext.printf("%d", settings.sensitivity);
927927                        data->min = 1;
928928                        data->max = 255;
trunk/src/emu/ui/mainmenu.c
r245622r245623
5656   item_append("Input (general)", NULL, 0, (void *)INPUT_GROUPS);
5757
5858   menu_text.printf("Input (this %s)",emulator_info::get_capstartgamenoun());
59   item_append(menu_text.cstr(), NULL, 0, (void *)INPUT_SPECIFIC);
59   item_append(menu_text.c_str(), NULL, 0, (void *)INPUT_SPECIFIC);
6060
6161   /* add optional input-related menus */
6262   if (machine().ioport().has_analog())
r245622r245623
6666   if (machine().ioport().has_configs())
6767   {
6868      menu_text.printf("%s Configuration",emulator_info::get_capstartgamenoun());
69      item_append(menu_text.cstr(), NULL, 0, (void *)SETTINGS_DRIVER_CONFIG);
69      item_append(menu_text.c_str(), NULL, 0, (void *)SETTINGS_DRIVER_CONFIG);
7070   }
7171
7272   /* add bookkeeping menu */
r245622r245623
7474
7575   /* add game info menu */
7676   menu_text.printf("%s Information",emulator_info::get_capstartgamenoun());
77   item_append(menu_text.cstr(), NULL, 0, (void *)GAME_INFO);
77   item_append(menu_text.c_str(), NULL, 0, (void *)GAME_INFO);
7878
7979   image_interface_iterator imgiter(machine().root_device());
8080   if (imgiter.first() != NULL)
r245622r245623
135135
136136   /* add reset and exit menus */
137137   menu_text.printf("Select New %s",emulator_info::get_capstartgamenoun());
138   item_append(menu_text.cstr(), NULL, 0, (void *)SELECT_GAME);
138   item_append(menu_text.c_str(), NULL, 0, (void *)SELECT_GAME);
139139}
140140
141141ui_menu_main::~ui_menu_main()
trunk/src/emu/ui/menu.c
r245622r245623
185185
186186   // add an item to return
187187   if (parent == NULL)
188      item_append(backtext.cstr(), NULL, 0, NULL);
188      item_append(backtext.c_str(), NULL, 0, NULL);
189189   else if (parent->is_special_main_menu())
190190      item_append("Exit", NULL, 0, NULL);
191191   else
trunk/src/emu/ui/miscmenu.c
r245622r245623
128128            astring value;
129129            astring temp;
130130            value.printf("%s,bios=%d",machine().options().main_value(temp,dev->owner()->tag()+1),val-1);
131            machine().options().set_value(dev->owner()->tag()+1, value.cstr(), OPTION_PRIORITY_CMDLINE, error);
131            machine().options().set_value(dev->owner()->tag()+1, value.c_str(), OPTION_PRIORITY_CMDLINE, error);
132132            assert(!error);
133133         }
134134         reset(UI_MENU_RESET_REMEMBER_REF);
trunk/src/emu/ui/selgame.c
r245622r245623
330330      tempbuf[1].printf("%s, %-.100s", driver->year, driver->manufacturer);
331331
332332      // next line source path
333      tempbuf[2].printf("Driver: %-.100s", core_filename_extract_base(tempbuf[3], driver->source_file).cstr());
333      tempbuf[2].printf("Driver: %-.100s", core_filename_extract_base(tempbuf[3], driver->source_file).c_str());
334334
335335      // next line is overall driver status
336336      if (driver->flags & GAME_NOT_WORKING)
trunk/src/emu/ui/swlist.c
r245622r245623
8787            menu_part_name.cat(" (").cat(swpart->feature("part_id")).cat(")");
8888         entry->type = T_ENTRY;
8989         entry->part = swpart;
90         item_append(m_info->shortname(), menu_part_name.cstr(), 0, entry);
90         item_append(m_info->shortname(), menu_part_name.c_str(), 0, entry);
9191      }
9292   }
9393}
trunk/src/emu/ui/ui.c
r245622r245623
360360            {
361361               astring warning;
362362               warning.cpy("This driver requires images to be loaded in the following device(s): ").cat(messagebox_text.substr(0, messagebox_text.len() - 2));
363               ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.cstr());
363               ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.c_str());
364364            }
365365            break;
366366      }
r245622r245623
11341134{
11351135   // print description, manufacturer, and CPU:
11361136   astring tempstr;
1137   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());
1137   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());
11381138
11391139   // loop over all CPUs
11401140   execute_interface_iterator execiter(machine().root_device());
r245622r245623
17611761      "Are you sure you want to quit?\n\n"
17621762      "Press ''%s'' to quit,\n"
17631763      "Press ''%s'' to return to emulation.",
1764      ui_select_text.cstr(),
1765      ui_cancel_text.cstr());
1764      ui_select_text.c_str(),
1765      ui_cancel_text.c_str());
17661766
17671767   machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
17681768   machine.pause();
trunk/src/emu/validity.c
r245622r245623
203203      if (m_errors > 0)
204204      {
205205         m_error_text.replace("\n", "\n   ");
206         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n   %s", m_error_text.cstr());
206         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n   %s", m_error_text.c_str());
207207      }
208208      if (m_warnings > 0)
209209      {
210210         m_warning_text.replace("\n", "\n   ");
211         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n   %s", m_warning_text.cstr());
211         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n   %s", m_warning_text.c_str());
212212      }
213213      output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n");
214214   }
r245622r245623
299299   if (m_errors > start_errors || m_warnings > start_warnings)
300300   {
301301      astring tempstr;
302      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);
302      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);
303303      if (m_errors > start_errors)
304304      {
305305         m_error_text.replace("\n", "\n   ");
306         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n   %s", m_error_text.cstr());
306         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n   %s", m_error_text.c_str());
307307      }
308308      if (m_warnings > start_warnings)
309309      {
310310         m_warning_text.replace("\n", "\n   ");
311         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n   %s", m_warning_text.cstr());
311         output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n   %s", m_warning_text.c_str());
312312      }
313313      output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n");
314314   }
r245622r245623
523523   if (m_names_map.add(m_current_driver->name, m_current_driver, false) == TMERR_DUPLICATE)
524524   {
525525      const game_driver *match = m_names_map.find(m_current_driver->name);
526      osd_printf_error("Driver name is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).cstr(), match->name);
526      osd_printf_error("Driver name is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).c_str(), match->name);
527527   }
528528
529529   // check for duplicate descriptions
530530   if (m_descriptions_map.add(m_current_driver->description, m_current_driver, false) == TMERR_DUPLICATE)
531531   {
532532      const game_driver *match = m_descriptions_map.find(m_current_driver->description);
533      osd_printf_error("Driver description is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).cstr(), match->name);
533      osd_printf_error("Driver description is a duplicate of %s(%s)\n", core_filename_extract_base(tempstr, match->source_file).c_str(), match->name);
534534   }
535535
536536   // determine if we are a clone
r245622r245623
645645            // attempt to add it to the map, reporting duplicates as errors
646646            current_length = ROMREGION_GETLENGTH(romp);
647647            if (m_region_map.add(fulltag, current_length, false) == TMERR_DUPLICATE)
648               osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.cstr());
648               osd_printf_error("Multiple ROM_REGIONs with the same tag '%s' defined\n", fulltag.c_str());
649649         }
650650
651651         // If this is a system bios, make sure it is using the next available bios number
r245622r245623
883883
884884      // report any errors during construction
885885      if (errorbuf)
886         osd_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr());
886         osd_printf_error("I/O port error during construction:\n%s\n", errorbuf.c_str());
887887
888888      // do a first pass over ports to add their names and find duplicates
889889      for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
r245622r245623
10101010      {
10111011         astring temptag("_");
10121012         temptag.cat(option->name());
1013         device_t *dev = const_cast<machine_config &>(*m_current_config).device_add(&m_current_config->root_device(), temptag.cstr(), option->devtype(), 0);
1013         device_t *dev = const_cast<machine_config &>(*m_current_config).device_add(&m_current_config->root_device(), temptag.c_str(), option->devtype(), 0);
10141014
10151015         // notify this device and all its subdevices that they are now configured
10161016         device_iterator subiter(*dev);
r245622r245623
10231023               osd_printf_error("Device '%s' is slot cart device but does not have short name defined\n",dev->name());
10241024         }
10251025
1026         const_cast<machine_config &>(*m_current_config).device_remove(&m_current_config->root_device(), temptag.cstr());
1026         const_cast<machine_config &>(*m_current_config).device_remove(&m_current_config->root_device(), temptag.c_str());
10271027      }
10281028   }
10291029
trunk/src/emu/video.c
r245622r245623
11581158         // copy the device name to an astring
11591159         astring snapdevname;
11601160         snapdevname.cpysubstr(snapstr, pos + 3, end - pos - 3);
1161         //printf("check template: %s\n", snapdevname.cstr());
1161         //printf("check template: %s\n", snapdevname.c_str());
11621162
11631163         // verify that there is such a device for this system
11641164         image_interface_iterator iter(machine().root_device());
r245622r245623
11661166         {
11671167            // get the device name
11681168            astring tempdevname(image->brief_instance_name());
1169            //printf("check device: %s\n", tempdevname.cstr());
1169            //printf("check device: %s\n", tempdevname.c_str());
11701170
11711171            if (snapdevname.cmp(tempdevname) == 0)
11721172            {
r245622r245623
11811181                  // setup snapname and remove the %d_
11821182                  snapstr.replace(0, snapdevname, filename);
11831183                  snapstr.del(pos, 3);
1184                  //printf("check image: %s\n", filename.cstr());
1184                  //printf("check image: %s\n", filename.c_str());
11851185
11861186                  name_found = 1;
11871187               }
r245622r245623
12151215      for (int seq = 0; ; seq++)
12161216      {
12171217         // build up the filename
1218         fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).cstr());
1218         fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).c_str());
12191219
12201220         // try to open the file; stop when we fail
12211221         file_error filerr = file.open(fname);
trunk/src/emu/webengine.c
r245622r245623
455455      mg_send_header(conn, "Cache-Control", "no-cache, no-store, must-revalidate");
456456      mg_send_header(conn, "Pragma", "no-cache");
457457      mg_send_header(conn, "Expires", "0");
458      mg_send_file(conn, fullpath.cstr(), NULL);
458      mg_send_file(conn, fullpath.c_str(), NULL);
459459      return MG_MORE; // It is important to return MG_MORE after mg_send_file!
460460   }
461461   return 0;
trunk/src/ldplayer/ldplayer.c
r245622r245623
371371   timer_set(attotime::zero, TIMER_ID_AUTOPLAY);
372372
373373   // indicate the name of the file we opened
374   popmessage("Opened %s\n", m_filename.cstr());
374   popmessage("Opened %s\n", m_filename.c_str());
375375}
376376
377377
trunk/src/lib/util/astring.h
r245622r245623
7474
7575   // C string conversion operators and helpers
7676   operator const char *() const { return m_text; }
77   const char *cstr() const { return m_text; }
77   const char *c_str() const { return m_text; }
7878
7979   // buffer management
8080   astring &reset() { return cpy(""); }
r245622r245623
8686   // copy helpers
8787   astring &cpy(const char *src, int count);
8888   astring &cpysubstr(const astring &src, int start, int count = -1);
89   astring &cpy(const astring &src) { return cpy(src.cstr(), src.len()); }
89   astring &cpy(const astring &src) { return cpy(src.c_str(), src.len()); }
9090   astring &cpy(const char *src) { return cpy(src, strlen(src)); }
9191
9292   // insertion helpers
9393   astring &ins(int insbefore, const char *src, int count);
9494   astring &inssubstr(int insbefore, const astring &src, int start, int count = -1);
95   astring &ins(int insbefore, const astring &src) { return ins(insbefore, src.cstr(), src.len()); }
95   astring &ins(int insbefore, const astring &src) { return ins(insbefore, src.c_str(), src.len()); }
9696   astring &ins(int insbefore, const char *src) { return ins(insbefore, src, strlen(src)); }
9797
9898   // concatenation helpers (== insert at end)
9999   astring &cat(const char *src, int count) { return ins(-1, src, count); }
100100   astring &catsubstr(const astring &src, int start, int count = -1) { return inssubstr(-1, src, start, count); }
101   astring &cat(const astring &src) { return ins(-1, src.cstr(), src.len()); }
101   astring &cat(const astring &src) { return ins(-1, src.c_str(), src.len()); }
102102   astring &cat(const char *src) { return ins(-1, src, strlen(src)); }
103103   astring &cat(char ch) { return ins(-1, &ch, 1); }
104104
r245622r245623
117117   // comparison helpers
118118   int cmp(const char *str2, int count) const;
119119   int cmpsubstr(const astring &str2, int start, int count = -1) const;
120   int cmp(const astring &str2) const { return cmp(str2.cstr(), str2.len()); }
120   int cmp(const astring &str2) const { return cmp(str2.c_str(), str2.len()); }
121121   int cmp(const char *str2) const { return cmp(str2, strlen(str2)); }
122122
123123   // case-insensitive comparison helpers
124124   int icmp(const char *str2, int count) const;
125125   int icmpsubstr(const astring &str2, int start, int count = -1) const;
126   int icmp(const astring &str2) const { return icmp(str2.cstr(), str2.len()); }
126   int icmp(const astring &str2) const { return icmp(str2.c_str(), str2.len()); }
127127   int icmp(const char *str2) const { return icmp(str2, strlen(str2)); }
128128
129129   // character searching helpers
trunk/src/lib/util/cdrom.c
r245622r245623
164164      file_error filerr = core_fopen(file->track_info.track[i].fname, OPEN_FLAG_READ, &file->fhandle[i]);
165165      if (filerr != FILERR_NONE)
166166      {
167         fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.cstr());
167         fprintf(stderr, "Unable to open file: %s\n", file->track_info.track[i].fname.c_str());
168168         cdrom_close(file);
169169         return NULL;
170170      }
trunk/src/lib/util/chd.h
r245622r245623
352352   chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen);
353353   chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags);
354354   chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags = CHD_MDFLAGS_CHECKSUM);
355   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); }
355   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); }
356356   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); }
357357   chd_error delete_metadata(chd_metadata_tag metatag, UINT32 metaindex);
358358   chd_error clone_all_metadata(chd_file &source);
trunk/src/lib/util/chdcd.c
r245622r245623
695695   #if 0
696696   for(i=0; i < numtracks; i++)
697697   {
698      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);
698      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);
699699   }
700700   #endif
701701
r245622r245623
771771               wavlen = parse_wav_sample(lastfname, &wavoffs);
772772               if (!wavlen)
773773               {
774                  printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.cstr());
774                  printf("ERROR: couldn't read [%s] or not a valid .WAV\n", lastfname.c_str());
775775                  return CHDERR_INVALID_DATA;
776776               }
777777            }
r245622r245623
812812
813813            outinfo.track[trknum].fname.cpy(lastfname); // default filename to the last one
814814
815//              printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.cstr(), outinfo.track[trknum].offset);
815//              printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset);
816816
817817            cdrom_convert_type_string_to_track_info(token, &outtoc.tracks[trknum]);
818818            if (outtoc.tracks[trknum].datasize == 0)
r245622r245623
927927            /* if we have the same filename as the last track, do it that way */
928928            if (trknum != 0 && outinfo.track[trknum].fname == outinfo.track[trknum-1].fname)
929929            {
930               tlen = get_file_size(outinfo.track[trknum].fname.cstr());
930               tlen = get_file_size(outinfo.track[trknum].fname.c_str());
931931               if (tlen == 0)
932932               {
933                  printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.cstr());
933                  printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str());
934934                  return CHDERR_FILE_NOT_FOUND;
935935               }
936936               outinfo.track[trknum].offset = outinfo.track[trknum-1].offset + outtoc.tracks[trknum-1].frames * (outtoc.tracks[trknum-1].datasize + outtoc.tracks[trknum-1].subsize);
r245622r245623
941941               tlen = get_file_size(outinfo.track[trknum].fname);
942942               if (tlen == 0)
943943               {
944                  printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.cstr());
944                  printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum-1].fname.c_str());
945945                  return CHDERR_FILE_NOT_FOUND;
946946               }
947947               tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
r245622r245623
976976               tlen = get_file_size(outinfo.track[trknum].fname);
977977               if (tlen == 0)
978978               {
979                  printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.cstr());
979                  printf("ERROR: couldn't find bin file [%s]\n", outinfo.track[trknum].fname.c_str());
980980                  return CHDERR_FILE_NOT_FOUND;
981981               }
982982               tlen /= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);
trunk/src/lib/util/options.c
r245622r245623
364364         // can only have one command
365365         if (m_command)
366366         {
367            error_string.catprintf("Error: multiple commands specified -%s and %s\n", m_command.cstr(), curarg);
367            error_string.catprintf("Error: multiple commands specified -%s and %s\n", m_command.c_str(), curarg);
368368            return false;
369369         }
370370         m_command = curentry->name();
r245622r245623
635635{
636636   astring tempstr;
637637   tempstr.printf("%d", value);
638   return set_value(name, tempstr.cstr(), priority, error_string);
638   return set_value(name, tempstr.c_str(), priority, error_string);
639639}
640640
641641bool core_options::set_value(const char *name, float value, int priority, astring &error_string)
642642{
643643   astring tempstr;
644644   tempstr.printf("%f", value);
645   return set_value(name, tempstr.cstr(), priority, error_string);
645   return set_value(name, tempstr.c_str(), priority, error_string);
646646}
647647
648648
r245622r245623
752752      case OPTION_BOOLEAN:
753753         if (sscanf(data, "%d", &ival) != 1 || ival < 0 || ival > 1)
754754         {
755            error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value());
755            error_string.catprintf("Illegal boolean value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value());
756756            return false;
757757         }
758758         break;
r245622r245623
761761      case OPTION_INTEGER:
762762         if (sscanf(data, "%d", &ival) != 1)
763763         {
764            error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value());
764            error_string.catprintf("Illegal integer value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value());
765765            return false;
766766         }
767767         if (curentry.has_range() && (ival < atoi(curentry.minimum()) || ival > atoi(curentry.maximum())))
768768         {
769            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());
769            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());
770770            return false;
771771         }
772772         break;
r245622r245623
775775      case OPTION_FLOAT:
776776         if (sscanf(data, "%f", &fval) != 1)
777777         {
778            error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.cstr(), curentry.value());
778            error_string.catprintf("Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value());
779779            return false;
780780         }
781781         if (curentry.has_range() && (fval < atof(curentry.minimum()) || fval > atof(curentry.maximum())))
782782         {
783            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());
783            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());
784784            return false;
785785         }
786786         break;
trunk/src/lib/util/options.h
r245622r245623
7575   public:
7676      // getters
7777      entry *next() const { return m_next; }
78      const char *name(int index = 0) const { return (index < ARRAY_LENGTH(m_name) && m_name[index]) ? m_name[index].cstr() : NULL; }
78      const char *name(int index = 0) const { return (index < ARRAY_LENGTH(m_name) && m_name[index]) ? m_name[index].c_str() : NULL; }
7979      const char *description() const { return m_description; }
8080      const char *value() const { return m_data; }
8181      const char *default_value() const { return m_defdata; }
trunk/src/mame/drivers/bfm_sc45_helper.c
r245622r245623
237237
238238
239239
240               sc45helperlog("%s", tempstring.cstr());
240               sc45helperlog("%s", tempstring.c_str());
241241
242242               sc45helperlog("\n");
243243
r245622r245623
316316
317317            if (ignoreports[i][j] > 0)
318318            {
319               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());
319               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());
320320               buttons_used++;
321321            }
322322            else if (ignoreports[i][j] == -3)
323323            {
324               printf("    // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.cstr());
324               printf("    // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.c_str());
325325            }
326326            else if (ignoreports[i][j] == -2)
327327            {
328               printf("    // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.cstr());
328               printf("    // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.c_str());
329329            }
330330            else if (ignoreports[i][j] == -1)
331331            {
332               printf("    // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.cstr());
332               printf("    // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.c_str());
333333            }
334334            else if (ignoreports[i][j] == -4)
335335            {
336               printf("    // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.cstr());
336               printf("    // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.c_str());
337337            }
338338            else if (ignoreports[i][j] == -5)
339339            {
340               printf("    // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr());
340               printf("    // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.c_str());
341341            }
342342            else if (ignoreports[i][j] == -6)
343343            {
344               printf("    // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.cstr());
344               printf("    // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.c_str());
345345            }
346346            else if (ignoreports[i][j] == -7)
347347            {
348               printf("    // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.cstr());
348               printf("    // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.c_str());
349349            }
350350            else if (ignoreports[i][j] == -8)
351351            {
352               printf("    // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr());
352               printf("    // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.c_str());
353353            }
354354            else if (ignoreports[i][j] == -9)
355355            {
356               printf("    // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.cstr());
356               printf("    // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.c_str());
357357            }
358358            else if (ignoreports[i][j] == -10)
359359            {
360               printf("    // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.cstr());
360               printf("    // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.c_str());
361361            }
362362            buttons_used++;
363363         }
r245622r245623
390390   {
391391      for (int x = 0; x < 16; x++)
392392      {
393         if (!strcmp(teststring.cstr(), lamps[y][x].lampname_alt.cstr()))
393         if (!strcmp(teststring.c_str(), lamps[y][x].lampname_alt.c_str()))
394394         {
395395            lamps[y][x].clickport = clickport;
396396            lamps[y][x].clickmask = clickmask;
r245622r245623
507507            fatalerror("duplicate lamp?\n");
508508         }
509509
510         //sc45helperlog("%s", tempstring.cstr());
510         //sc45helperlog("%s", tempstring.c_str());
511511
512512         //sc45helperlog("\n");
513513
r245622r245623
521521      //sc45helperlog("---ROW %02d---\n", y);
522522      for (int x = 0; x < 16; x++)
523523      {
524         sc45helperlog("<element name=\"lamplabelel%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", d, lamps[y][x].lampname.cstr());
524         sc45helperlog("<element name=\"lamplabelel%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", d, lamps[y][x].lampname.c_str());
525525         d++;
526526      }
527527   }
r245622r245623
536536
537537      for (int x = 0; x < 6; x++)
538538      {
539         sc45helperlog("<element name=\"inputlabel%d-%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", realy,x,sc4inputs[realy][x].name.cstr());
539         sc45helperlog("<element name=\"inputlabel%d-%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", realy,x,sc4inputs[realy][x].name.c_str());
540540
541541      }
542542   }
r245622r245623
593593      {
594594         lamps[y][x].lampname_alt = lamps[y][x].lampname;
595595
596         if (!strcmp(lamps[y][x].lampname_alt.cstr(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2";
597         if (!strcmp(lamps[y][x].lampname_alt.cstr(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3";
598         if (!strcmp(lamps[y][x].lampname_alt.cstr(), "chg stake")) lamps[y][x].lampname_alt = "chnge stk";
599         if (!strcmp(lamps[y][x].lampname_alt.cstr(), "canc/coll")) lamps[y][x].lampname_alt = "cancel";
600         if (!strcmp(lamps[y][x].lampname_alt.cstr(), "start")) lamps[y][x].lampname_alt = "strt exch";
596         if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold2/hi")) lamps[y][x].lampname_alt = "hold2";
597         if (!strcmp(lamps[y][x].lampname_alt.c_str(), "hold3/lo")) lamps[y][x].lampname_alt = "hold3";
598         if (!strcmp(lamps[y][x].lampname_alt.c_str(), "chg stake")) lamps[y][x].lampname_alt = "chnge stk";
599         if (!strcmp(lamps[y][x].lampname_alt.c_str(), "canc/coll")) lamps[y][x].lampname_alt = "cancel";
600         if (!strcmp(lamps[y][x].lampname_alt.c_str(), "start")) lamps[y][x].lampname_alt = "strt exch";
601601
602602      }
603603   }
r245622r245623
625625         {
626626            for (int x = 0; x < 16; x++)
627627            {
628               if (!strcmp(tempname2, lamps[y][x].lampname_alt.cstr()))
628               if (!strcmp(tempname2, lamps[y][x].lampname_alt.c_str()))
629629               {
630630                  //sc45helperlog("%s found\n", tempname2);
631631                  lamps[y][x].draw_label = false;
r245622r245623
640640               }
641641               else
642642               {
643                  //printf("%s:%s:\n", tempname2, lamps[y][x].lampname_alt.cstr());
643                  //printf("%s:%s:\n", tempname2, lamps[y][x].lampname_alt.c_str());
644644               }
645645
646646            }
r245622r245623
679679      //sc45helperlog("---ROW %02d---\n", y);
680680      for (int x = 0; x < 16; x++)
681681      {
682         if (lamps[y][x].clickport== -1) sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\"/></bezel>\n", d, lamps[y][x].lamptypename.cstr(), lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
683         else sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\" inputtag=\"IN-%d\" inputmask=\"0x%02x\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" /></bezel>\n", d, lamps[y][x].lamptypename.cstr(), lamps[y][x].clickport, lamps[y][x].clickmask, lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
682         if (lamps[y][x].clickport== -1) sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\"/></bezel>\n", d, lamps[y][x].lamptypename.c_str(), lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
683         else sc45helperlog("<bezel name=\"lamp%d\" element=\"%s\" state=\"0\" inputtag=\"IN-%d\" inputmask=\"0x%02x\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" /></bezel>\n", d, lamps[y][x].lamptypename.c_str(), lamps[y][x].clickport, lamps[y][x].clickmask, lamps[y][x].x, lamps[y][x].y, lamps[y][x].width, lamps[y][x].height);
684684
685685         if (lamps[y][x].draw_label == false) sc45helperlog("<!-- Label not drawn\n");
686686         sc45helperlog("<bezel name=\"lamplabel%d\" element=\"lamplabelel%d\"><bounds x=\"%d\" y=\"%d\" width=\"%d\" height=\"10\" /></bezel>\n", d,d, lamps[y][x].x, lamps[y][x].y-10, lamps[y][x].width);
r245622r245623
905905            tempstring.cat("PND");
906906         }
907907
908         sc45helperlog("%s", tempstring.cstr());
908         sc45helperlog("%s", tempstring.c_str());
909909
910910
911911
trunk/src/mame/drivers/sfbonus.c
r245622r245623
462462   TILE_GET_INFO_MEMBER(get_sfbonus_reel4_tile_info);
463463   virtual void machine_reset();
464464   virtual void video_start();
465   void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int catagory);
465   void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category);
466466   UINT32 screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
467467};
468468
r245622r245623
929929
930930}
931931
932void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int catagory)
932void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category)
933933{
934934   int zz;
935935   int i;
r245622r245623
10211021
10221022      if (rowenable2==0)
10231023      {
1024         m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),3);
1024         m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),3);
10251025      }
10261026      if (rowenable==0)
10271027      {
1028         m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),3);
1028         m_reel_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),3);
10291029      }
10301030
10311031      if (rowenable2==0x1)
10321032      {
1033         m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),2);
1033         m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),2);
10341034      }
10351035      if (rowenable==0x1)
10361036      {
1037         m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),2);
1037         m_reel2_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),2);
10381038      }
10391039
10401040      if (rowenable2==0x2)
10411041      {
1042         m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),1);
1042         m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),1);
10431043      }
10441044      if (rowenable==0x2)
10451045      {
1046         m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),1);
1046         m_reel3_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),1);
10471047      }
10481048
10491049      if (rowenable2==0x3)
10501050      {
1051         m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),4);
1051         m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),4);
10521052      }
10531053      if (rowenable==0x3)
10541054      {
1055         m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(catagory),4);
1055         m_reel4_tilemap->draw(screen, *m_temp_reel_bitmap, clip, TILEMAP_DRAW_CATEGORY(category),4);
10561056      }
10571057
10581058
trunk/src/mame/machine/315-5881_crypt.c
r245622r245623
4747
4848   astring skey = parameter("key");
4949   if(skey)
50      key = strtoll(skey.cstr(), 0, 16);
50      key = strtoll(skey.c_str(), 0, 16);
5151   else
5252   {
5353      logerror("%s: Warning: key not provided\n", tag());
trunk/src/mame/machine/naomim1.c
r245622r245623
3232
3333   astring skey = parameter("key");
3434   if(skey)
35      key = strtoll(skey.cstr(), 0, 16);
35      key = strtoll(skey.c_str(), 0, 16);
3636   else
3737   {
3838      logerror("%s: Warning: key not provided\n", tag());
trunk/src/mess/drivers/aim65.c
r245622r245623
159159      astring errmsg;
160160      errmsg.printf("Attempted to load file with wrong extension\nSocket '%s' only accepts files with '.%s' extension",
161161                  slot_tag, slot_tag);
162      image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
162      image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.c_str());
163163      return IMAGE_INIT_FAIL;
164164   }
165165
trunk/src/mess/drivers/hh_hmcs40.c
r245622r245623
1919 @27      HD38800A  1981, Bandai Packri Monster (DM-21Z)
2020 *51      HD38800A  1981, Actronics(Hanzawa) Twinvader
2121 @70      HD38800A  1982, Coleco Galaxian
22 @73      HD38800A  1982, Mattel Star Hawk
2223 
2324 @23      HD38800B  1982, Tomy Kingman (THF-01II)
2425 *24      HD38800B  1982, Actronics(Hanzawa) Wanted G-Man
r245622r245623
4344
4445***************************************************************************/
4546
47
48
49
50
51/***************************************************************************
52
53  Mattel Star Hawk (manufactured in Japan)
54  * PCBs are labeled Kaken, PT-317B
55  * Hitachi HD38800A73 MCU
56  * cyan/red VFD display Futaba DM-41ZK, with partial color overlay
57
58  NOTE!: MESS external artwork is recommended
59
60***************************************************************************/
61
62
63
64
65
66
4667#include "emu.h"
4768#include "cpu/hmcs40/hmcs40.h"
4869#include "sound/speaker.h"
r245622r245623
287308/***************************************************************************
288309
289310  Bambino Basketball - Dribble Away (manufactured in Japan)
290  * boards are labeled Emix Corp. ET-05
311  * PCBs are labeled Emix Corp. ET-05
291312  * Hitachi HD38750A08 MCU
292313  * green VFD display Emix-106, with bezel overlay
293314
r245622r245623
399420/***************************************************************************
400421
401422  Bandai Packri Monster (manufactured in Japan)
402  * board label DM-21ZA2
423  * PCB label DM-21ZA2
403424  * Hitachi HD38800A27 MCU
404425  * cyan/red/green VFD display Futaba DM-21ZK 2B, with bezel overlay
405426
r245622r245623
731752/***************************************************************************
732753
733754  Coleco Donkey Kong (manufactured in Taiwan)
734  * board label Coleco Rev C 75790 DK
755  * PCB label Coleco Rev C 75790 DK
735756  * Hitachi HD38820A45 MCU
736757  * cyan/red VFD display Futaba DM-47ZK 2K, with color overlay
737758
r245622r245623
859880/***************************************************************************
860881
861882  Coleco Galaxian (manufactured in Taiwan)
862  * board label Coleco Rev A 75718
883  * PCB label Coleco Rev A 75718
863884  * Hitachi HD38800A70 MCU
864885  * cyan/red VFD display Futaba DM-36Z 2H, with color overlay
865886
r245622r245623
976997/***************************************************************************
977998
978999  Coleco Pac-Man (manufactured in Taiwan)
979  * board label Coleco 75690
1000  * PCB label Coleco 75690
9801001  * Hitachi HD38820A28/29 MCU
9811002  * cyan/red VFD display Futaba DM-34Z 2A, with color overlay
9821003
r245622r245623
10971118/***************************************************************************
10981119
10991120  Coleco Ms. Pac-Man (manufactured in Taiwan)
1100  * board label Coleco 911171
1121  * PCB label Coleco 911171
11011122  * Hitachi HD38820A61 MCU
11021123  * cyan/red VFD display Futaba DM-60Z 3I, with color overlay
11031124
r245622r245623
15011522/***************************************************************************
15021523
15031524  Tomy Kingman (manufactured in Japan)
1504  * boards are labeled THF-01II 2E138E01/2E128E02
1525  * PCBs are labeled THF-01II 2E138E01/2E128E02
15051526  * Hitachi HD38800B23 MCU
15061527  * cyan/red/blue VFD display Futaba DM-65ZK 3A
15071528
r245622r245623
16221643/***************************************************************************
16231644
16241645  Tomy(tronic) Tron (manufactured in Japan)
1625  * boards are labeled THN-02 2E114E07
1646  * PCBs are labeled THN-02 2E114E07
16261647  * Hitachi HD38800A88 MCU
1627  * cyan/red/green VFD display NEC FIP10AM24T
1648  * cyan/red/green VFD display NEC FIP10AM24T no. 2-8 1
16281649
16291650  NOTE!: MESS external artwork is recommended
16301651
trunk/src/mess/drivers/hh_tms1k.c
r245622r245623
2626 *MP2139   TMS1370? 1982, Gakken Galaxy Invader 1000
2727 *MP2788   ?        1980, Bandai Flight Time (? note: VFD-capable)
2828 @MP3226   TMS1000  1978, Milton Bradley Simon
29 *MP3301   TMS1000  1979, Milton Bradley Bigtrak
29 *MP3301   TMS1000  1979, Milton Bradley Big Trak
3030 *MP3320A  TMS1000  1979, Coleco Head to Head Basketball
3131  MP3403   TMS1100  1978, Marx Electronic Bowling -> elecbowl.c
3232 @MP3404   TMS1100  1978, Parker Brothers Merlin
r245622r245623
918918/***************************************************************************
919919
920920  Entex Electronic Baseball 2
921  * boards are labeled: ZENY
921  * PCBs are labeled: ZENY
922922  * TMS1000 MCU, MP0923 (die labeled MP0923)
923923  * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound
924924
r245622r245623
10451045/***************************************************************************
10461046
10471047  Entex Electronic Baseball 3
1048  * boards are labeled: ZENY
1048  * PCBs are labeled: ZENY
10491049  * TMS1100NLL 6007 MP1204 (die labeled MP1204)
10501050  * 2*SN75492N LED display driver
10511051  * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound
trunk/src/mess/drivers/hh_ucom4.c
r245622r245623
1212 @031     uPD553C  1979, Bambino Superstar Football (ET-03)
1313 *042     uPD552C  1979, Tomy Space Attack
1414 @048     uPD552C  1980, Tomy Tennis (TN-04)
15 @049     uPD553C  1979, Mego Mini-Vid Break Free
1516 @055     uPD553C  1980, Bambino Laser Fight (ET-12)
1617 *085     uPD650C  1980, Roland TR-808
1718 *102     uPD553C  1981, Bandai Block Out
r245622r245623
1920 *128     uPD650C  1982, Roland TR-606
2021  133     uPD650C  1982, Roland TB-303 -> tb303.c
2122 @160     uPD553C  1982, Tomy Pac Man (TN-08)
23 @192     uPD553C  1982, Tomy Scramble (TN-10)
2224 @202     uPD553C  1982, Epoch Astro Command
2325 @206     uPD553C  1982, Epoch Dracula
24 *209     uPD553C  1982, Tomy Caveman (TN-12)
26 @209     uPD553C  1982, Tomy Caveman (TN-12)
2527 @258     uPD553C  1984, Tomy Alien Chase (TN-16)
2628
2729  (* denotes not yet emulated by MESS, @ denotes it's in this driver)
2830
2931***************************************************************************/
3032
33
34
35
36/***************************************************************************
37
38  Mego Mini-Vid Break Free (manufactured in Japan)
39  * PCB label Mego 79 rev F
40  * NEC uCOM-43 MCU, labeled D553C 031
41  * cyan VFD display Futaba DM-4.5 91
42
43  NOTE!: MESS external artwork is recommended
44
45***************************************************************************/
46
47
48/***************************************************************************
49
50  Tomy(tronic) Caveman (manufactured in Japan)
51  * PCBs are labeled TN-12 2E114E03
52  * NEC uCOM-43 MCU, labeled D553C 209
53  * cyan/red/green VFD display NEC FIP8AM20T no. 2-42
54
55  NOTE!: MESS external artwork is recommended
56
57***************************************************************************/
58
59
60/***************************************************************************
61
62  Tomy(tronic) Scramble (manufactured in Japan)
63  * PCBs are labeled TN-10 2E114E01
64  * NEC uCOM-43 MCU, labeled D553C 192
65  * cyan/red/green VFD display NEC FIP10CM20T no. 2-41
66
67  NOTE!: MESS external artwork is recommended
68
69***************************************************************************/
70
71
3172#include "emu.h"
3273#include "cpu/ucom4/ucom4.h"
3374#include "sound/speaker.h"
r245622r245623
515556  Epoch Astro Command (manufactured in Japan)
516557  * PCB label 96111
517558  * NEC uCOM-43 MCU, labeled D553C 202
518  * cyan/red VFD display NEC FIP9AM20T NO.42, with color overlay
559  * cyan/red VFD display NEC FIP9AM20T no. 42-42, with color overlay (FIP=fluorescent indicator panel)
519560
520561  known releases:
521562  - Japan: Astro Command
r245622r245623
624665  Epoch Dracula (manufactured in Japan)
625666  * PCB label 96121
626667  * NEC uCOM-43 MCU, labeled D553C 206
627  * cyan/red/green VFD display NEC FIP8BM20T (FIP=fluorescent indicator panel)
668  * cyan/red/green VFD display NEC FIP8BM20T no. 2-42
628669
629670  known releases:
630671  - Japan: Dracula House, yellow case
r245622r245623
717758/***************************************************************************
718759
719760  Tomy(tronic) Tennis (manufactured in Japan)
720  * board labeled TOMY TN-04 TENNIS
761  * PCB labeled TOMY TN-04 TENNIS
721762  * NEC uCOM-44 MCU, labeled D552C 048
722  * VFD display NEC FIP11AM15T
763  * VFD display NEC FIP11AM15T tube no. 0F
723764
724765  The initial release of this game was in 1979, known as Pro-Tennis,
725766  it has a D553 instead of D552, with just a little over 50% ROM used.
r245622r245623
876917/***************************************************************************
877918
878919  Tomy(tronic) Pac-Man (manufactured in Japan)
879  * boards are labeled TN-08 2E108E01
920  * PCBs are labeled TN-08 2E108E01
880921  * NEC uCOM-43 MCU, labeled D553C 160
881  * cyan/red/green VFD display NEC FIP8AM18T
922  * cyan/red/green VFD display NEC FIP8AM18T no. 2-21
882923  * bright yellow round casing
883924
884925  known releases:
r245622r245623
9841025/***************************************************************************
9851026
9861027  Tomy Alien Chase (manufactured in Japan)
987  * boards are labeled TN-16 2E121B01
1028  * PCBs are labeled TN-16 2E121B01
9881029  * NEC uCOM-43 MCU, labeled D553C 258
9891030  * red/green VFD display NEC FIP9AM24T, with color overlay, 2-sided*
9901031
trunk/src/mess/drivers/pegasus.c
r245622r245623
427427      {
428428         astring errmsg;
429429         errmsg.printf("Attempted to load a file that does not work in this socket.\nPlease check \"Usage\" field in the software list for the correct socket(s) to use.");
430         image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
430         image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.c_str());
431431         return IMAGE_INIT_FAIL;
432432      }
433433   }
trunk/src/mess/machine/spec_snqk.c
r245622r245623
6464      tempstring.catprintf(exec_format, exec);
6565   }
6666
67   machine.ui().popup_time(10, "%s", tempstring.cstr());
67   machine.ui().popup_time(10, "%s", tempstring.c_str());
6868}
6969
7070/*******************************************************************
trunk/src/mess/machine/thomson.c
r245622r245623
377377   {
378378      astring errmsg;
379379      errmsg.printf("Invalid cartridge size %u", size);
380      image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.cstr());
380      image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.c_str());
381381      return IMAGE_INIT_FAIL;
382382   }
383383
r245622r245623
15181518   {
15191519      astring errmsg;
15201520      errmsg.printf("Invalid cartridge size %" I64FMT "d", size);
1521      image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.cstr());
1521      image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.c_str());
15221522      return IMAGE_INIT_FAIL;
15231523   }
15241524
trunk/src/mess/machine/ti99/gromport.c
r245622r245623
12271227{
12281228   // File name is in m_basename
12291229   // return true = error
1230   if (VERBOSE>8) LOG("cartridge_device: loading %s in slot %s\n", m_basename.cstr(), tag());
1230   if (VERBOSE>8) LOG("cartridge_device: loading %s in slot %s\n", m_basename.c_str(), tag());
12311231
12321232   if (m_softlist)
12331233   {
r245622r245623
22862286            throw rpk_exception(RPK_INVALID_RAM_SPEC, "<ram type='persistent'> must have a 'file' attribute");
22872287         }
22882288         astring ram_pathname(system_name, PATH_SEPARATOR, ram_filename);
2289         ram_pname = core_strdup(ram_pathname.cstr());
2289         ram_pname = core_strdup(ram_pathname.c_str());
22902290         // load, and fill rest with 00
22912291         if (VERBOSE>6) LOG("gromport/RPK: Loading NVRAM contents from '%s'\n", ram_pname);
22922292         image_battery_load_by_name(options, ram_pname, contents, length, 0x00);
trunk/src/mess/machine/ti99/gromport.h
r245622r245623
510510   {
511511      if (m_detail==NULL) return error_text[(int)m_err];
512512      astring errormsg(error_text[(int)m_err], ": ", m_detail);
513      return core_strdup(errormsg.cstr());
513      return core_strdup(errormsg.c_str());
514514   }
515515
516516private:
trunk/src/osd/modules/debugger/qt/deviceinformationwindow.c
r245622r245623
114114{
115115   WindowQtConfig::applyToQWidget(widget);
116116   DeviceInformationWindow* window = dynamic_cast<DeviceInformationWindow*>(widget);
117   window->set_device(m_device_tag.cstr());
117   window->set_device(m_device_tag.c_str());
118118}
119119
120120
trunk/src/osd/modules/debugger/qt/mainwindow.c
r245622r245623
138138   // Window title
139139   astring title;
140140   title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag());
141   setWindowTitle(title.cstr());
141   setWindowTitle(title.c_str());
142142}
143143
144144
r245622r245623
466466      astring menuName;
467467      menuName.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]");
468468
469      QMenu* interfaceMenu = imagesMenu->addMenu(menuName.cstr());
469      QMenu* interfaceMenu = imagesMenu->addMenu(menuName.c_str());
470470      interfaceMenu->setObjectName(img->device().name());
471471
472472      QAction* mountAct = new QAction("Mount...", interfaceMenu);
trunk/src/osd/modules/font/font_osx.c
r245622r245623
5454   }
5555
5656   CTFontRef ct_font = NULL;
57   CFStringRef const font_name = CFStringCreateWithCString(NULL, name.cstr(), kCFStringEncodingUTF8);
57   CFStringRef const font_name = CFStringCreateWithCString(NULL, name.c_str(), kCFStringEncodingUTF8);
5858   if (font_name != NULL)
5959   {
6060      CTFontDescriptorRef const font_descriptor = CTFontDescriptorCreateWithNameAndSize(font_name, 0.0);
r245622r245623
6868
6969   if (!ct_font)
7070   {
71      osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.cstr());
71      osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.c_str());
7272      return false;
7373   }
7474
trunk/src/osd/modules/font/font_sdl.c
r245622r245623
7272
7373   if (!font)
7474   {
75      osd_printf_verbose("Searching font %s in -%s\n", name.cstr(), OPTION_FONTPATH);
75      osd_printf_verbose("Searching font %s in -%s\n", name.c_str(), OPTION_FONTPATH);
7676      //emu_file file(options().font_path(), OPEN_FLAG_READ);
7777      emu_file file(font_path, OPEN_FLAG_READ);
7878      if (file.open(name) == FILERR_NONE)
r245622r245623
8080         astring full_name = file.fullpath();
8181         font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
8282         if (font)
83            osd_printf_verbose("Found font %s\n", full_name.cstr());
83            osd_printf_verbose("Found font %s\n", full_name.c_str());
8484      }
8585   }
8686
r245622r245623
9696   {
9797      if (!BDF_Check_Magic(name))
9898      {
99         osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.cstr());
99         osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.c_str());
100100      }
101101      return NULL;
102102   }
r245622r245623
195195      if (memcmp(buffer, magic, 5))
196196         return NULL;
197197   }
198   return TTF_OpenFont(name.cstr(), POINT_SIZE);
198   return TTF_OpenFont(name.c_str(), POINT_SIZE);
199199}
200200
201201bool osd_font_sdl::BDF_Check_Magic(astring name)
r245622r245623
227227   config = FcConfigGetCurrent();
228228   pat = FcPatternCreate();
229229   os = FcObjectSetCreate();
230   FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
230   FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.c_str());
231231
232232   // try and get a font with the requested styles baked-in
233233   if (bold)
r245622r245623
287287      FcFontSetDestroy(fontset);
288288
289289      pat = FcPatternCreate();
290      FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
290      FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.c_str());
291291      FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
292292      FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
293293      fontset = FcFontList(config, pat, os);
trunk/src/osd/modules/lib/osdobj_common.c
r245622r245623
260260      new_option_value.cat(t);
261261   }
262262   // TODO: core_strdup() is leaked
263   m_options.set_description(key, core_strdup(current_value.cat(new_option_value).cstr()));
263   m_options.set_description(key, core_strdup(current_value.cat(new_option_value).c_str()));
264264}
265265
266266
trunk/src/osd/modules/lib/osdobj_common.h
r245622r245623
245245         opt_val = "";
246246      else if (!m_mod_man.type_has_name(opt_name, opt_val))
247247      {
248         osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val.cstr(), opt_name.cstr());
248         osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val.c_str(), opt_name.c_str());
249249         opt_val = "";
250250      }
251251      return m_mod_man.select_module(opt_name, opt_val);
trunk/src/osd/modules/render/d3d/d3dhlsl.c
r245622r245623
34893489      for (int seq = 0; ; seq++)
34903490      {
34913491         // build up the filename
3492         fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d_%d", seq, idx).cstr());
3492         fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d_%d", seq, idx).c_str());
34933493
34943494         // try to open the file; stop when we fail
34953495         file_error filerr = file.open(fname);
trunk/src/osd/sdl/input.c
r245622r245623
742742
743743      devinfo->joystick.device = joy;
744744
745      osd_printf_verbose("Joystick: %s\n", devinfo->name.cstr());
745      osd_printf_verbose("Joystick: %s\n", devinfo->name.c_str());
746746      osd_printf_verbose("Joystick:   ...  %d axes, %d buttons %d hats %d balls\n", SDL_JoystickNumAxes(joy), SDL_JoystickNumButtons(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumBalls(joy));
747747      osd_printf_verbose("Joystick:   ...  Physical id %d mapped to logical id %d\n", physical_stick, stick + 1);
748748
r245622r245623
758758         else
759759            itemid = ITEM_ID_OTHER_AXIS_ABSOLUTE;
760760
761         sprintf(tempname, "A%d %s", axis, devinfo->name.cstr());
761         sprintf(tempname, "A%d %s", axis, devinfo->name.c_str());
762762         devinfo->device->add_item(tempname, itemid, generic_axis_get_state, &devinfo->joystick.axes[axis]);
763763      }
764764
r245622r245623
809809         else
810810            itemid = ITEM_ID_OTHER_AXIS_RELATIVE;
811811
812         sprintf(tempname, "R%d %s", ball * 2, devinfo->name.cstr());
812         sprintf(tempname, "R%d %s", ball * 2, devinfo->name.c_str());
813813         devinfo->device->add_item(tempname, (input_item_id) itemid, generic_axis_get_state, &devinfo->joystick.balls[ball * 2]);
814         sprintf(tempname, "R%d %s", ball * 2 + 1, devinfo->name.cstr());
814         sprintf(tempname, "R%d %s", ball * 2 + 1, devinfo->name.c_str());
815815         devinfo->device->add_item(tempname, (input_item_id) (itemid + 1), generic_axis_get_state, &devinfo->joystick.balls[ball * 2 + 1]);
816816      }
817817   }
r245622r245623
869869         continue;
870870
871871      // add the axes
872      sprintf(defname, "X %s", devinfo->name.cstr());
872      sprintf(defname, "X %s", devinfo->name.c_str());
873873      devinfo->device->add_item(defname, ITEM_ID_XAXIS, generic_axis_get_state, &devinfo->mouse.lX);
874      sprintf(defname, "Y %s", devinfo->name.cstr());
874      sprintf(defname, "Y %s", devinfo->name.c_str());
875875      devinfo->device->add_item(defname, ITEM_ID_YAXIS, generic_axis_get_state, &devinfo->mouse.lY);
876876
877877      for (button = 0; button < 4; button++)
r245622r245623
886886
887887      if (0 && mouse_enabled)
888888         SDL_SetRelativeMouseMode(index, SDL_TRUE);
889      osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.cstr());
889      osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.c_str());
890890   }
891891   osd_printf_verbose("Mouse: End initialization\n");
892892}
r245622r245623
903903
904904   // SDL 1.2 has only 1 mouse - 1.3+ will also change that, so revisit this then
905905   devinfo = generic_device_alloc(&mouse_list, "System mouse");
906   devinfo->device = machine.input().device_class(DEVICE_CLASS_MOUSE).add_device(devinfo->name.cstr(), devinfo);
906   devinfo->device = machine.input().device_class(DEVICE_CLASS_MOUSE).add_device(devinfo->name.c_str(), devinfo);
907907
908908   mouse_enabled = machine.options().mouse();
909909
r245622r245623
919919      devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->mouse.buttons[button]);
920920   }
921921
922   osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.cstr());
922   osd_printf_verbose("Mouse: Registered %s\n", devinfo->name.c_str());
923923   osd_printf_verbose("Mouse: End initialization\n");
924924}
925925#endif
r245622r245623
11261126      }
11271127
11281128
1129      sprintf(defname, "X %s", devinfo->name.cstr());
1129      sprintf(defname, "X %s", devinfo->name.c_str());
11301130      devinfo->device->add_item(defname, ITEM_ID_XAXIS, generic_axis_get_state, &devinfo->lightgun.lX);
1131      sprintf(defname, "Y %s", devinfo->name.cstr());
1131      sprintf(defname, "Y %s", devinfo->name.c_str());
11321132      devinfo->device->add_item(defname, ITEM_ID_YAXIS, generic_axis_get_state, &devinfo->lightgun.lY);
11331133
11341134
r245622r245623
13251325         devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)]);
13261326      }
13271327
1328      osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.cstr());
1328      osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.c_str());
13291329   }
13301330   osd_printf_verbose("Keyboard: End initialization\n");
13311331}
r245622r245623
13461346   // SDL 1.2 only has 1 keyboard (1.3+ will have multiple, this must be revisited then)
13471347   // add it now
13481348   devinfo = generic_device_alloc(&keyboard_list, "System keyboard");
1349   devinfo->device = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device(devinfo->name.cstr(), devinfo);
1349   devinfo->device = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device(devinfo->name.c_str(), devinfo);
13501350
13511351   // populate it
13521352   for (keynum = 0; sdl_key_trans_table[keynum].mame_key != ITEM_ID_INVALID; keynum++)
r245622r245623
13631363      devinfo->device->add_item(defname, itemid, generic_button_get_state, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)]);
13641364   }
13651365
1366   osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.cstr());
1366   osd_printf_verbose("Keyboard: Registered %s\n", devinfo->name.c_str());
13671367   osd_printf_verbose("Keyboard: End initialization\n");
13681368}
13691369#endif
r245622r245623
17421742      case SDL_KEYDOWN:
17431743#ifdef SDL2_MULTIAPI
17441744         devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[event.key.which]);
1745         //printf("Key down %d %d %s => %d %s (scrlock keycode is %d)\n", event.key.which, event.key.keysym.scancode, devinfo->name.cstr(), OSD_SDL_INDEX_KEYSYM(&event.key.keysym), sdl_key_trans_table[event.key.keysym.scancode].mame_key_name, KEYCODE_SCRLOCK);
1745         //printf("Key down %d %d %s => %d %s (scrlock keycode is %d)\n", event.key.which, event.key.keysym.scancode, devinfo->name.c_str(), OSD_SDL_INDEX_KEYSYM(&event.key.keysym), sdl_key_trans_table[event.key.keysym.scancode].mame_key_name, KEYCODE_SCRLOCK);
17461746#else
17471747         devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]);
17481748#endif
r245622r245623
18411841         devinfo = generic_device_find_index(mouse_list, mouse_map.logical[0]);
18421842#endif
18431843         devinfo->mouse.buttons[event.button.button-1] = 0x80;
1844         //printf("But down %d %d %d %d %s\n", event.button.which, event.button.button, event.button.x, event.button.y, devinfo->name.cstr());
1844         //printf("But down %d %d %d %d %s\n", event.button.which, event.button.button, event.button.x, event.button.y, devinfo->name.c_str());
18451845         if (event.button.button == 1)
18461846         {
18471847            // FIXME Move static declaration
r245622r245623
18991899#endif
19001900#if (SDLMAME_SDL2)
19011901         // FIXME: may apply to 1.2 as well ...
1902         //printf("Motion %d %d %d %s\n", event.motion.which, event.motion.x, event.motion.y, devinfo->name.cstr());
1902         //printf("Motion %d %d %d %s\n", event.motion.which, event.motion.x, event.motion.y, devinfo->name.c_str());
19031903         devinfo->mouse.lX += event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
19041904         devinfo->mouse.lY += event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
19051905#else
trunk/src/osd/sdl/sdlmain.c
r245622r245623
212212   astring ini_path(INI_PATH);
213213   add_entries(sdl_options::s_option_entries);
214214   ini_path.replace(0, "APP_NAME", emulator_info::get_appname_lower());
215   set_default_value(SDLOPTION_INIPATH, ini_path.cstr());
215   set_default_value(SDLOPTION_INIPATH, ini_path.c_str());
216216}
217217
218218//============================================================
trunk/src/tools/chdman.c
r245622r245623
327327               m_lastfile = m_info.track[tracknum].fname;
328328               file_error filerr = core_fopen(m_lastfile, OPEN_FLAG_READ, &m_file);
329329               if (filerr != FILERR_NONE)
330                  report_error(1, "Error opening input file (%s)'", m_lastfile.cstr());
330                  report_error(1, "Error opening input file (%s)'", m_lastfile.c_str());
331331            }
332332
333333            // iterate over frames
r245622r245623
351351                     core_fseek(m_file, src_frame_start, SEEK_SET);
352352                     UINT32 count = core_fread(m_file, dest, bytesperframe);
353353                     if (count != bytesperframe)
354                        report_error(1, "Error reading input file (%s)'", m_lastfile.cstr());
354                        report_error(1, "Error reading input file (%s)'", m_lastfile.c_str());
355355                  }
356356
357357                  // swap if appropriate
r245622r245623
940940   {
941941      chd_error err = input_parent_chd.open(*input_chd_parent_str);
942942      if (err != CHDERR_NONE)
943         report_error(1, "Error opening parent CHD file (%s): %s", input_chd_parent_str->cstr(), chd_file::error_string(err));
943         report_error(1, "Error opening parent CHD file (%s): %s", input_chd_parent_str->c_str(), chd_file::error_string(err));
944944   }
945945
946946   // process input file
r245622r245623
949949   {
950950      chd_error err = input_chd.open(*input_chd_str, writeable, input_parent_chd.opened() ? &input_parent_chd : NULL);
951951      if (err != CHDERR_NONE)
952         report_error(1, "Error opening CHD file (%s): %s", input_chd_str->cstr(), chd_file::error_string(err));
952         report_error(1, "Error opening CHD file (%s): %s", input_chd_str->c_str(), chd_file::error_string(err));
953953   }
954954}
955955
r245622r245623
10281028   {
10291029      chd_error err = output_parent_chd.open(*output_chd_parent_str);
10301030      if (err != CHDERR_NONE)
1031         report_error(1, "Error opening parent CHD file (%s): %s", output_chd_parent_str->cstr(), chd_file::error_string(err));
1031         report_error(1, "Error opening parent CHD file (%s): %s", output_chd_parent_str->c_str(), chd_file::error_string(err));
10321032   }
10331033
10341034   // process output file
r245622r245623
10831083   {
10841084      astring name(*compression_str, start, (end == -1) ? -1 : end - start);
10851085      if (name.len() != 4)
1086         report_error(1, "Invalid compressor '%s' specified", name.cstr());
1086         report_error(1, "Invalid compressor '%s' specified", name.c_str());
10871087      chd_codec_type type = CHD_MAKE_TAG(name[0], name[1], name[2], name[3]);
10881088      if (!chd_codec_list::codec_exists(type))
1089         report_error(1, "Invalid compressor '%s' specified", name.cstr());
1089         report_error(1, "Invalid compressor '%s' specified", name.c_str());
10901090      compression[index++] = type;
10911091      if (end == -1)
10921092         break;
r245622r245623
12581258      }
12591259
12601260      // output TRACK entry
1261      core_fprintf(file, "  TRACK %02d %s\n", tracknum + 1, tempstr.cstr());
1261      core_fprintf(file, "  TRACK %02d %s\n", tracknum + 1, tempstr.c_str());
12621262
12631263      // output PREGAP tag if pregap sectors are not in the file
12641264      if ((info.pregap > 0) && (info.pgdatasize == 0))
r245622r245623
12961296         modesubmode.format("%s %s", cdrom_get_type_string(info.trktype), cdrom_get_subtype_string(info.subtype));
12971297      else
12981298         modesubmode.format("%s", cdrom_get_type_string(info.trktype));
1299      core_fprintf(file, "TRACK %s\n", modesubmode.cstr());
1299      core_fprintf(file, "TRACK %s\n", modesubmode.c_str());
13001300
13011301      // write out the attributes
13021302      core_fprintf(file, "NO COPY\n");
r245622r245623
13091309      // output pregap
13101310      astring tempstr;
13111311      if (info.pregap > 0)
1312         core_fprintf(file, "ZERO %s %s\n", modesubmode.cstr(), msf_string_from_frames(tempstr, info.pregap));
1312         core_fprintf(file, "ZERO %s %s\n", modesubmode.c_str(), msf_string_from_frames(tempstr, info.pregap));
13131313
13141314      // all tracks but the first one have a file offset
13151315      if (tracknum > 0)
r245622r245623
13401340
13411341   // print filename and version
13421342   astring tempstr;
1343   printf("Input file:   %s\n", params.find(OPTION_INPUT)->cstr());
1343   printf("Input file:   %s\n", params.find(OPTION_INPUT)->c_str());
13441344   printf("File Version: %d\n", input_chd.version());
13451345   if (input_chd.version() < 3)
13461346      report_error(1, "Unsupported version (%d); use an older chdman to upgrade to version 3 or later", input_chd.version());
r245622r245623
15041504      UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_chd.logical_bytes() - offset);
15051505      chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
15061506      if (err != CHDERR_NONE)
1507         report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
1507         report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->c_str(), chd_file::error_string(err));
15081508
15091509      // add to the checksum
15101510      rawsha1.append(buffer, bytes_to_read);
r245622r245623
15681568   {
15691569      file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
15701570      if (filerr != FILERR_NONE)
1571         report_error(1, "Unable to open file (%s)", input_file_str->cstr());
1571         report_error(1, "Unable to open file (%s)", input_file_str->c_str());
15721572   }
15731573
15741574   // process output CHD
r245622r245623
16041604
16051605   // print some info
16061606   astring tempstr;
1607   printf("Output CHD:   %s\n", output_chd_str->cstr());
1607   printf("Output CHD:   %s\n", output_chd_str->c_str());
16081608   if (output_parent.opened())
1609      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
1610   printf("Input file:   %s\n", input_file_str->cstr());
1609      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
1610   printf("Input file:   %s\n", input_file_str->c_str());
16111611   if (input_start != 0 || input_end != core_fsize(input_file))
16121612   {
16131613      printf("Input start:  %s\n", big_int_string(tempstr, input_start));
r245622r245623
16291629      else
16301630         err = chd->create(*output_chd_str, input_end - input_start, hunk_size, unit_size, compression);
16311631      if (err != CHDERR_NONE)
1632         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
1632         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
16331633
16341634      // if we have a parent, copy forward all the metadata
16351635      if (output_parent.opened())
r245622r245623
16651665   {
16661666      file_error filerr = core_fopen(*input_file_str, OPEN_FLAG_READ, &input_file);
16671667      if (filerr != FILERR_NONE)
1668         report_error(1, "Unable to open file (%s)", input_file_str->cstr());
1668         report_error(1, "Unable to open file (%s)", input_file_str->c_str());
16691669   }
16701670
16711671   // process output CHD
r245622r245623
17401740      // load the file
17411741      file_error filerr = core_fload(*ident_str, identdata);
17421742      if (filerr != FILERR_NONE)
1743         report_error(1, "Error reading ident file (%s)", ident_str->cstr());
1743         report_error(1, "Error reading ident file (%s)", ident_str->c_str());
17441744
17451745      // must be at least 14 bytes; extract CHS data from there
17461746      if (identdata.count() < 14)
1747         report_error(1, "Ident file '%s' is invalid (too short)", ident_str->cstr());
1747         report_error(1, "Ident file '%s' is invalid (too short)", ident_str->c_str());
17481748      cylinders = (identdata[3] << 8) | identdata[2];
17491749      heads = (identdata[7] << 8) | identdata[6];
17501750      sectors = (identdata[13] << 8) | identdata[12];
r245622r245623
17751775
17761776   // print some info
17771777   astring tempstr;
1778   printf("Output CHD:   %s\n", output_chd_str->cstr());
1778   printf("Output CHD:   %s\n", output_chd_str->c_str());
17791779   if (output_parent.opened())
1780      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
1780      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
17811781   if (input_file != NULL)
17821782   {
1783      printf("Input file:   %s\n", input_file_str->cstr());
1783      printf("Input file:   %s\n", input_file_str->c_str());
17841784      if (input_start != 0 || input_end != core_fsize(input_file))
17851785      {
17861786         printf("Input start:  %s\n", big_int_string(tempstr, input_start));
r245622r245623
18071807      else
18081808         err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(sector_size), hunk_size, sector_size, compression);
18091809      if (err != CHDERR_NONE)
1810         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
1810         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
18111811
18121812      // add the standard hard disk metadata
18131813      astring metadata;
r245622r245623
18561856   {
18571857      chd_error err = chdcd_parse_toc(*input_file_str, toc, track_info);
18581858      if (err != CHDERR_NONE)
1859         report_error(1, "Error parsing input file (%s: %s)\n", input_file_str->cstr(), chd_file::error_string(err));
1859         report_error(1, "Error parsing input file (%s: %s)\n", input_file_str->c_str(), chd_file::error_string(err));
18601860   }
18611861
18621862   // process output CHD
r245622r245623
18891889
18901890   // print some info
18911891   astring tempstr;
1892   printf("Output CHD:   %s\n", output_chd_str->cstr());
1892   printf("Output CHD:   %s\n", output_chd_str->c_str());
18931893   if (output_parent.opened())
1894      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
1895   printf("Input file:   %s\n", input_file_str->cstr());
1894      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
1895   printf("Input file:   %s\n", input_file_str->c_str());
18961896   printf("Input tracks: %d\n", toc.numtrks);
18971897   printf("Input length: %s\n", msf_string_from_frames(tempstr, origtotalsectors));
18981898   printf("Compression:  %s\n", compression_string(tempstr, compression));
r245622r245623
19101910      else
19111911         err = chd->create(*output_chd_str, UINT64(totalsectors) * UINT64(CD_FRAME_SIZE), hunk_size, CD_FRAME_SIZE, compression);
19121912      if (err != CHDERR_NONE)
1913         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
1913         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
19141914
19151915      // add the standard CD metadata; we do this even if we have a parent because it might be different
19161916      err = cdrom_write_metadata(chd, &toc);
r245622r245623
19471947   {
19481948      avi_error avierr = avi_open(*input_file_str, &input_file);
19491949      if (avierr != AVIERR_NONE)
1950         report_error(1, "Error opening AVI file (%s): %s\n", input_file_str->cstr(), avi_error_string(avierr));
1950         report_error(1, "Error opening AVI file (%s): %s\n", input_file_str->c_str(), avi_error_string(avierr));
19511951   }
19521952   const avi_movie_info *aviinfo = avi_get_movie_info(input_file);
19531953
r245622r245623
19991999
20002000   // print some info
20012001   astring tempstr;
2002   printf("Output CHD:   %s\n", output_chd_str->cstr());
2002   printf("Output CHD:   %s\n", output_chd_str->c_str());
20032003   if (output_parent.opened())
2004      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
2005   printf("Input file:   %s\n", input_file_str->cstr());
2004      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
2005   printf("Input file:   %s\n", input_file_str->c_str());
20062006   if (input_start != 0 && input_end != aviinfo->video_numsamples)
20072007      printf("Input start:  %s\n", big_int_string(tempstr, input_start));
20082008   printf("Input length: %s (%02d:%02d:%02d)\n", big_int_string(tempstr, input_end - input_start),
r245622r245623
20282028      else
20292029         err = chd->create(*output_chd_str, UINT64(input_end - input_start) * hunk_size, hunk_size, info.bytes_per_frame, compression);
20302030      if (err != CHDERR_NONE)
2031         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
2031         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
20322032
20332033      // write the core A/V metadata
20342034      astring metadata;
r245622r245623
21122112
21132113   // print some info
21142114   astring tempstr;
2115   printf("Output CHD:   %s\n", output_chd_str->cstr());
2115   printf("Output CHD:   %s\n", output_chd_str->c_str());
21162116   if (output_parent.opened())
2117      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->cstr());
2118   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->cstr());
2117      printf("Parent CHD:   %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str());
2118   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->c_str());
21192119   if (input_start != 0 || input_end != input_chd.logical_bytes())
21202120   {
21212121      printf("Input start:  %s\n", big_int_string(tempstr, input_start));
r245622r245623
21372137      else
21382138         err = chd->create(*output_chd_str, input_end - input_start, hunk_size, input_chd.unit_bytes(), compression);
21392139      if (err != CHDERR_NONE)
2140         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->cstr(), chd_file::error_string(err));
2140         report_error(1, "Error creating CHD file (%s): %s", output_chd_str->c_str(), chd_file::error_string(err));
21412141
21422142      // clone all the metadata, upgrading where appropriate
21432143      dynamic_buffer metadata;
r245622r245623
22212221
22222222   // print some info
22232223   astring tempstr;
2224   printf("Output File:  %s\n", output_file_str->cstr());
2225   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->cstr());
2224   printf("Output File:  %s\n", output_file_str->c_str());
2225   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->c_str());
22262226   if (input_start != 0 || input_end != input_chd.logical_bytes())
22272227   {
22282228      printf("Input start:  %s\n", big_int_string(tempstr, input_start));
r245622r245623
22362236      // process output file
22372237      file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
22382238      if (filerr != FILERR_NONE)
2239         report_error(1, "Unable to open file (%s)", output_file_str->cstr());
2239         report_error(1, "Unable to open file (%s)", output_file_str->c_str());
22402240
22412241      // copy all data
22422242      dynamic_buffer buffer((TEMP_BUFFER_SIZE / input_chd.hunk_bytes()) * input_chd.hunk_bytes());
r245622r245623
22482248         UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_end - offset);
22492249         chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
22502250         if (err != CHDERR_NONE)
2251            report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
2251            report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->c_str(), chd_file::error_string(err));
22522252
22532253         // write to the output
22542254         UINT32 count = core_fwrite(output_file, buffer, bytes_to_read);
22552255         if (count != bytes_to_read)
2256            report_error(1, "Error writing to file; check disk space (%s)", output_file_str->cstr());
2256            report_error(1, "Error writing to file; check disk space (%s)", output_file_str->c_str());
22572257
22582258         // advance
22592259         offset += bytes_to_read;
r245622r245623
23062306   if (chop != -1)
23072307      default_name.substr(0, chop);
23082308   char basename[128];
2309   strncpy(basename, default_name.cstr(), 127);
2309   strncpy(basename, default_name.c_str(), 127);
23102310   default_name.cat(".bin");
23112311   if (output_bin_file_str == NULL)
23122312      output_bin_file_str = &default_name;
r245622r245623
23142314
23152315   // print some info
23162316   astring tempstr;
2317   printf("Output TOC:   %s\n", output_file_str->cstr());
2318   printf("Output Data:  %s\n", output_bin_file_str->cstr());
2319   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->cstr());
2317   printf("Output TOC:   %s\n", output_file_str->c_str());
2318   printf("Output Data:  %s\n", output_bin_file_str->c_str());
2319   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->c_str());
23202320
23212321   // catch errors so we can close & delete the output file
23222322   core_file *output_bin_file = NULL;
r245622r245623
23372337      // process output file
23382338      file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &output_toc_file);
23392339      if (filerr != FILERR_NONE)
2340         report_error(1, "Unable to open file (%s)", output_file_str->cstr());
2340         report_error(1, "Unable to open file (%s)", output_file_str->c_str());
23412341
23422342      // process output BIN file
23432343      if (mode != MODE_GDI)
23442344      {
23452345         filerr = core_fopen(*output_bin_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
23462346         if (filerr != FILERR_NONE)
2347            report_error(1, "Unable to open file (%s)", output_bin_file_str->cstr());
2347            report_error(1, "Unable to open file (%s)", output_bin_file_str->c_str());
23482348      }
23492349
23502350      // determine total frames
r245622r245623
23842384
23852385            filerr = core_fopen(trackbin_name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file);
23862386            if (filerr != FILERR_NONE)
2387               report_error(1, "Unable to open file (%s)", trackbin_name.cstr());
2387               report_error(1, "Unable to open file (%s)", trackbin_name.c_str());
23882388
23892389            outputoffs = 0;
23902390         }
r245622r245623
24492449               core_fseek(output_bin_file, outputoffs, SEEK_SET);
24502450               UINT32 byteswritten = core_fwrite(output_bin_file, buffer, bufferoffs);
24512451               if (byteswritten != bufferoffs)
2452                  report_error(1, "Error writing frame %d to file (%s): %s\n", frame, output_file_str->cstr(), chd_file::error_string(CHDERR_WRITE_ERROR));
2452                  report_error(1, "Error writing frame %d to file (%s): %s\n", frame, output_file_str->c_str(), chd_file::error_string(CHDERR_WRITE_ERROR));
24532453               outputoffs += bufferoffs;
24542454               bufferoffs = 0;
24552455            }
r245622r245623
25482548
25492549   // print some info
25502550   astring tempstr;
2551   printf("Output File:  %s\n", output_file_str->cstr());
2552   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->cstr());
2551   printf("Output File:  %s\n", output_file_str->c_str());
2552   printf("Input CHD:    %s\n", params.find(OPTION_INPUT)->c_str());
25532553   if (input_start != 0 || input_end != input_chd.hunk_count())
25542554   {
25552555      printf("Input start:  %s\n", big_int_string(tempstr, input_start));
r245622r245623
25632563      // process output file
25642564      avi_error avierr = avi_create(*output_file_str, &info, &output_file);
25652565      if (avierr != AVIERR_NONE)
2566         report_error(1, "Unable to open file (%s)", output_file_str->cstr());
2566         report_error(1, "Unable to open file (%s)", output_file_str->c_str());
25672567
25682568      // create the codec configuration
25692569      avhuff_decompress_config avconfig;
r245622r245623
25922592         if (err != CHDERR_NONE)
25932593         {
25942594            UINT64 filepos = core_ftell(input_chd);
2595            report_error(1, "Error reading hunk %" I64FMT "d at offset %" I64FMT "d from CHD file (%s): %s\n", framenum, filepos, params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
2595            report_error(1, "Error reading hunk %" I64FMT "d at offset %" I64FMT "d from CHD file (%s): %s\n", framenum, filepos, params.find(OPTION_INPUT)->c_str(), chd_file::error_string(err));
25962596         }
25972597
25982598         // write audio
r245622r245623
26002600         {
26012601            avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0);
26022602            if (avierr != AVIERR_NONE)
2603               report_error(1, "Error writing samples for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
2603               report_error(1, "Error writing samples for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->c_str(), avi_error_string(avierr));
26042604         }
26052605
26062606         // write video
r245622r245623
26082608         {
26092609            avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
26102610            if (avierr != AVIERR_NONE)
2611               report_error(1, "Error writing video for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
2611               report_error(1, "Error writing video for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->c_str(), avi_error_string(avierr));
26122612         }
26132613      }
26142614
r245622r245623
26712671   {
26722672      file_error filerr = core_fload(*file_str, file);
26732673      if (filerr != FILERR_NONE)
2674         report_error(1, "Error reading metadata file (%s)", file_str->cstr());
2674         report_error(1, "Error reading metadata file (%s)", file_str->c_str());
26752675   }
26762676
26772677   // make sure we have one or the other
r245622r245623
26872687
26882688   // print some info
26892689   astring tempstr;
2690   printf("Input file:   %s\n", params.find(OPTION_INPUT)->cstr());
2690   printf("Input file:   %s\n", params.find(OPTION_INPUT)->c_str());
26912691   printf("Tag:          %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff);
26922692   printf("Index:        %d\n", index);
26932693   if (text_str != NULL)
2694      printf("Text:         %s\n", text.cstr());
2694      printf("Text:         %s\n", text.c_str());
26952695   else
2696      printf("Data:         %s (%d bytes)\n", file_str->cstr(), file.count());
2696      printf("Data:         %s (%d bytes)\n", file_str->c_str(), file.count());
26972697
26982698   // write the metadata
26992699   chd_error err;
r245622r245623
27362736
27372737   // print some info
27382738   astring tempstr;
2739   printf("Input file:   %s\n", params.find(OPTION_INPUT)->cstr());
2739   printf("Input file:   %s\n", params.find(OPTION_INPUT)->c_str());
27402740   printf("Tag:          %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff);
27412741   printf("Index:        %d\n", index);
27422742
r245622r245623
27952795      {
27962796         file_error filerr = core_fopen(*output_file_str, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file);
27972797         if (filerr != FILERR_NONE)
2798            report_error(1, "Unable to open file (%s)", output_file_str->cstr());
2798            report_error(1, "Unable to open file (%s)", output_file_str->c_str());
27992799
28002800         // output the metadata
28012801         UINT32 count = core_fwrite(output_file, buffer, buffer.count());
28022802         if (count != buffer.count())
2803            report_error(1, "Error writing file (%s)", output_file_str->cstr());
2803            report_error(1, "Error writing file (%s)", output_file_str->c_str());
28042804         core_fclose(output_file);
28052805
28062806         // provide some feedback
28072807         astring tempstr;
2808         printf("File (%s) written, %s bytes\n", output_file_str->cstr(), big_int_string(tempstr, buffer.count()));
2808         printf("File (%s) written, %s bytes\n", output_file_str->c_str(), big_int_string(tempstr, buffer.count()));
28092809      }
28102810
28112811      // flush to stdout
trunk/src/tools/nltool.c
r245622r245623
303303   fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n");
304304   if (!opts.parse_command_line(argc, argv, OPTION_PRIORITY_DEFAULT, aerror))
305305   {
306      fprintf(stderr, "%s\n", aerror.cstr());
306      fprintf(stderr, "%s\n", aerror.c_str());
307307      usage(opts);
308308      return 1;
309309   }
trunk/src/tools/pngcmp.c
r245622r245623
8383   filerr = core_fopen(imgfile1, OPEN_FLAG_READ, &file);
8484   if (filerr != FILERR_NONE)
8585   {
86      printf("Could not open %s (%d)\n", imgfile1.cstr(), filerr);
86      printf("Could not open %s (%d)\n", imgfile1.c_str(), filerr);
8787      goto error;
8888   }
8989
r245622r245623
9292   core_fclose(file);
9393   if (pngerr != PNGERR_NONE)
9494   {
95      printf("Could not read %s (%d)\n", imgfile1.cstr(), pngerr);
95      printf("Could not read %s (%d)\n", imgfile1.c_str(), pngerr);
9696      goto error;
9797   }
9898
r245622r245623
100100   filerr = core_fopen(imgfile2, OPEN_FLAG_READ, &file);
101101   if (filerr != FILERR_NONE)
102102   {
103      printf("Could not open %s (%d)\n", imgfile2.cstr(), filerr);
103      printf("Could not open %s (%d)\n", imgfile2.c_str(), filerr);
104104      goto error;
105105   }
106106
r245622r245623
109109   core_fclose(file);
110110   if (pngerr != PNGERR_NONE)
111111   {
112      printf("Could not read %s (%d)\n", imgfile2.cstr(), pngerr);
112      printf("Could not read %s (%d)\n", imgfile2.c_str(), pngerr);
113113      goto error;
114114   }
115115
r245622r245623
173173      filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file);
174174      if (filerr != FILERR_NONE)
175175      {
176         printf("Could not open %s (%d)\n", outfilename.cstr(), filerr);
176         printf("Could not open %s (%d)\n", outfilename.c_str(), filerr);
177177         goto error;
178178      }
179179      pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL);
180180      core_fclose(file);
181181      if (pngerr != PNGERR_NONE)
182182      {
183         printf("Could not write %s (%d)\n", outfilename.cstr(), pngerr);
183         printf("Could not write %s (%d)\n", outfilename.c_str(), pngerr);
184184         goto error;
185185      }
186186   }
trunk/src/tools/regrep.c
r245622r245623
571571   /* print a header */
572572   astring modified(templatefile);
573573   modified.replace("<!--TITLE-->", title);
574   core_fwrite(file, modified.cstr(), modified.len());
574   core_fwrite(file, modified.c_str(), modified.len());
575575
576576   /* return the file */
577577   return file;
r245622r245623
587587{
588588   astring modified(templatefile);
589589   modified.replace(0, "<!--TITLE-->", title);
590   core_fwrite(file, modified.cstr(), modified.len());
590   core_fwrite(file, modified.c_str(), modified.len());
591591   core_fclose(file);
592592}
593593
r245622r245623
686686      *buckettailptr[bucknum] = NULL;
687687
688688   /* output header */
689   tempname.printf("%s" PATH_SEPARATOR "%s", dirname.cstr(), "index.html");
689   tempname.printf("%s" PATH_SEPARATOR "%s", dirname.c_str(), "index.html");
690690   indexfile = create_file_and_output_header(tempname, tempheader, title);
691691   if (indexfile == NULL)
692692   {
693      fprintf(stderr, "Error creating file '%s'\n", tempname.cstr());
693      fprintf(stderr, "Error creating file '%s'\n", tempname.c_str());
694694      return;
695695   }
696696
r245622r245623
843843   int starty;
844844
845845   /* generate the common source filename */
846   dstfilename.printf("%s" PATH_SEPARATOR "%s", destdir.cstr(), destname);
846   dstfilename.printf("%s" PATH_SEPARATOR "%s", destdir.c_str(), destname);
847847   srcimgname.printf("snap" PATH_SEPARATOR "%s" PATH_SEPARATOR "final.png", curfile->name);
848848
849849   /* open and load all unique bitmaps */
850850   for (listnum = 0; listnum < list_count; listnum++)
851851      if (curfile->matchbitmap[listnum] == listnum)
852852      {
853         tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.cstr());
853         tempname.printf("%s" PATH_SEPARATOR "%s", lists[listnum].dir, srcimgname.c_str());
854854
855855         /* open the source image */
856856         filerr = core_fopen(tempname, OPEN_FLAG_READ, &file);
r245622r245623
961961
962962   /* output header */
963963   title.printf("%s Regressions (%s)", curfile->name, curfile->source);
964   linkname.printf("%s" PATH_SEPARATOR "%s", dirname.cstr(), filename.cstr());
964   linkname.printf("%s" PATH_SEPARATOR "%s", dirname.c_str(), filename.c_str());
965965   linkfile = create_file_and_output_header(linkname, tempheader, title);
966966   if (linkfile == NULL)
967967   {
968      fprintf(stderr, "Error creating file '%s'\n", filename.cstr());
968      fprintf(stderr, "Error creating file '%s'\n", filename.c_str());
969969      return;
970970   }
971971
r245622r245623
10021002      {
10031003         core_fprintf(linkfile, "\t<p>\n");
10041004         core_fprintf(linkfile, "\t<b>Errors:</b>\n");
1005         core_fprintf(linkfile, "\t<pre>%s</pre>\n", curfile->text[listnum].cstr());
1005         core_fprintf(linkfile, "\t<pre>%s</pre>\n", curfile->text[listnum].c_str());
10061006         core_fprintf(linkfile, "\t</p>\n");
10071007      }
10081008   }
trunk/src/tools/split.c
r245622r245623
123123   filerr = core_fopen(splitfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile);
124124   if (filerr != FILERR_NONE)
125125   {
126      fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.cstr());
126      fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.c_str());
127127      goto cleanup;
128128   }
129129
130130   // write the basics out
131   core_fprintf(splitfile, "splitfile=%s\n", basefilename.cstr());
131   core_fprintf(splitfile, "splitfile=%s\n", basefilename.c_str());
132132   core_fprintf(splitfile, "splitsize=%d\n", splitsize);
133133
134   printf("Split file is '%s'\n", splitfilename.cstr());
135   printf("Splitting file %s into chunks of %dMB...\n", basefilename.cstr(), splitsize / (1024 * 1024));
134   printf("Split file is '%s'\n", splitfilename.c_str());
135   printf("Splitting file %s into chunks of %dMB...\n", basefilename.c_str(), splitsize / (1024 * 1024));
136136
137137   // now iterate until done
138138   for (partnum = 0; partnum < 1000; partnum++)
r245622r245623
150150      compute_hash_as_string(computedhash, splitbuffer, length);
151151
152152      // write that info to the split file
153      core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.cstr(), basefilename.cstr(), partnum);
153      core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.c_str(), basefilename.c_str(), partnum);
154154
155155      // compute the full filename for this guy
156156      outfilename.printf("%s.%03d", basename, partnum);
r245622r245623
160160      if (filerr != FILERR_NONE)
161161      {
162162         printf("\n");
163         fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.cstr());
163         fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.c_str());
164164         goto cleanup;
165165      }
166166
167      printf(" writing %s.%03d...", basefilename.cstr(), partnum);
167      printf(" writing %s.%03d...", basefilename.c_str(), partnum);
168168
169169      // write the data
170170      actual = core_fwrite(outfile, splitbuffer, length);
r245622r245623
273273      {
274274         core_fclose(outfile);
275275         outfile = NULL;
276         fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.cstr());
276         fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.c_str());
277277         goto cleanup;
278278      }
279279
r245622r245623
281281      filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile);
282282      if (filerr != FILERR_NONE)
283283      {
284         fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.cstr());
284         fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.c_str());
285285         goto cleanup;
286286      }
287287   }
288288
289   printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.cstr());
289   printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.c_str());
290290
291291   // now iterate through each file
292292   while (core_fgets(buffer, sizeof(buffer), splitfile))
r245622r245623
302302      expectedhash.cpy(buffer + 5, SHA1_DIGEST_SIZE * 2);
303303      infilename.cpy(buffer + 5 + SHA1_DIGEST_SIZE * 2 + 6).trimspace();
304304
305      printf("  Reading file '%s'...", infilename.cstr());
305      printf("  Reading file '%s'...", infilename.c_str());
306306
307307      // read the file's contents
308308      infilename.ins(0, basepath);
r245622r245623
310310      if (filerr != FILERR_NONE)
311311      {
312312         printf("\n");
313         fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.cstr());
313         fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.c_str());
314314         goto cleanup;
315315      }
316316
r245622r245623
321321      if (computedhash != expectedhash)
322322      {
323323         printf("\n");
324         fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n  Expected: %s\n  Computed: %s\n", infilename.cstr(), expectedhash.cstr(), computedhash.cstr());
324         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());
325325         goto cleanup;
326326      }
327327
trunk/src/tools/src2html.c
r245622r245623
332332
333333   // create an index file
334334   astring indexname;
335   indexname.printf("%s%c%s", dstdir.cstr(), PATH_SEPARATOR[0], "index.html");
335   indexname.printf("%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], "index.html");
336336   core_file *indexfile = create_file_and_output_header(indexname, tempheader, srcdir_subpath);
337337
338338   // output the directory navigation
r245622r245623
402402
403403         // build the source filename
404404         astring srcfile;
405         srcfile.printf("%s%c%s", srcdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr());
405         srcfile.printf("%s%c%s", srcdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str());
406406
407407         // if we have a file, output it
408408         astring dstfile;
r245622r245623
420420            // if we got a valid file, process it
421421            if (type != FILE_TYPE_INVALID)
422422            {
423               dstfile.printf("%s%c%s.html", dstdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr());
423               dstfile.printf("%s%c%s.html", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str());
424424               if (indexfile != NULL)
425                  core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", curlist->name.cstr(), curlist->name.cstr());
425                  core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", curlist->name.c_str(), curlist->name.c_str());
426426               result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile, srcdir == dstdir, tempheader, tempfooter);
427427            }
428428         }
r245622r245623
430430         // if we have a directory, recurse
431431         else
432432         {
433            dstfile.printf("%s%c%s", dstdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr());
433            dstfile.printf("%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str());
434434            if (indexfile != NULL)
435               core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", curlist->name.cstr(), curlist->name.cstr());
435               core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", curlist->name.c_str(), curlist->name.c_str());
436436            result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile, tempheader, tempfooter);
437437         }
438438      }
r245622r245623
467467   astring srcfile_subpath;
468468   normalized_subpath(srcfile_subpath, srcfile, srcrootlen + 1);
469469
470   fprintf(stderr, "Processing %s\n", srcfile_subpath.cstr());
470   fprintf(stderr, "Processing %s\n", srcfile_subpath.c_str());
471471
472472   // set some defaults
473473   bool color_quotes = false;
r245622r245623
519519   core_file *src;
520520   if (core_fopen(srcfile, OPEN_FLAG_READ, &src) != FILERR_NONE)
521521   {
522      fprintf(stderr, "Unable to read file '%s'\n", srcfile.cstr());
522      fprintf(stderr, "Unable to read file '%s'\n", srcfile.c_str());
523523      return 1;
524524   }
525525
r245622r245623
527527   core_file *dst = create_file_and_output_header(dstfile, tempheader, srcfile_subpath);
528528   if (dst == NULL)
529529   {
530      fprintf(stderr, "Unable to write file '%s'\n", dstfile.cstr());
530      fprintf(stderr, "Unable to write file '%s'\n", dstfile.c_str());
531531      core_fclose(src);
532532      return 1;
533533   }
r245622r245623
659659                     astring target;
660660                     if (find_include_file(target, srcrootlen, dstrootlen, srcfile, dstfile, filename))
661661                     {
662                        dstline.catprintf("<a href=\"%s\">", target.cstr());
662                        dstline.catprintf("<a href=\"%s\">", target.c_str());
663663                        quotes_are_linked = true;
664664                     }
665665                  }
r245622r245623
738738
739739   // print a header
740740   astring modified(templatefile);
741   modified.replace(0, "<!--PATH-->", path.cstr());
742   core_fwrite(file, modified.cstr(), modified.len());
741   modified.replace(0, "<!--PATH-->", path.c_str());
742   core_fwrite(file, modified.c_str(), modified.len());
743743
744744   // return the file
745745   return file;
r245622r245623
754754static void output_footer_and_close_file(core_file *file, astring &templatefile, astring &path)
755755{
756756   astring modified(templatefile);
757   modified.replace(0, "<!--PATH-->", path.cstr());
758   core_fwrite(file, modified.cstr(), modified.len());
757   modified.replace(0, "<!--PATH-->", path.c_str());
758   core_fwrite(file, modified.c_str(), modified.len());
759759   core_fclose(file);
760760}
761761
r245622r245623
807807      core_fprintf(file, "<a href=\"");
808808      for (int depth = curdepth; depth < srcdepth; depth++)
809809         core_fprintf(file, "../");
810      core_fprintf(file, "index.html\">%s</a>/", substr.cstr());
810      core_fprintf(file, "index.html\">%s</a>/", substr.c_str());
811811
812812      lastslash = slashindex + 1;
813813   }
r245622r245623
815815   // and a final link to the current directory
816816   astring substr(path, lastslash, -1);
817817   if (end_is_directory)
818      core_fprintf(file, "<a href=\"index.html\">%s</a>", substr.cstr());
818      core_fprintf(file, "<a href=\"index.html\">%s</a>", substr.c_str());
819819   else if (link_to_file)
820      core_fprintf(file, "<a href=\"%s\">%s</a>", substr.cstr(), substr.cstr());
820      core_fprintf(file, "<a href=\"%s\">%s</a>", substr.c_str(), substr.c_str());
821821   else
822      core_fprintf(file, "<a href=\"%s.html\">%s</a>", substr.cstr(), substr.cstr());
822      core_fprintf(file, "<a href=\"%s.html\">%s</a>", substr.c_str(), substr.c_str());
823823}
824824
825825


Previous 199869 Revisions Next


© 1997-2024 The MAME Team