Previous 199869 Revisions Next

r37157 Monday 13th April, 2015 at 10:25:21 UTC by Miodrag Milanović
updated astring constructors to have just one string param, to be more like std::string (nw)
[src/emu]audit.c clifront.c diimage.c emuopts.c emupal.c fileio.c machine.c render.c romload.c save.h softlist.c tilemap.c video.c webengine.c
[src/emu/cpu]drcbex64.c drcbex86.c drcuml.c
[src/emu/imagedev]diablo.c harddriv.c
[src/emu/ui]imgcntrl.c
[src/lib/util]astring.h options.c
[src/mame/drivers]snowbros.c
[src/mame/includes]snowbros.h
[src/osd/modules/debugger/win]disasmwininfo.c logwininfo.c memorywininfo.c
[src/osd/modules/render/d3d]d3dhlsl.c

trunk/src/emu/audit.c
r245668r245669
6464      for (const rom_entry *region = rom_first_region(*device); region != NULL; region = rom_next_region(region))
6565      {
6666// temporary hack: add the driver path & region name
67astring combinedpath(device->searchpath(), ";", driverpath);
67astring combinedpath = astring(device->searchpath()).cat(";").cat(driverpath);
6868if (device->shortname())
6969   combinedpath.cat(";").cat(device->shortname());
7070m_searchpath = combinedpath.c_str();
r245668r245669
188188   // store validation for later
189189   m_validation = validation;
190190
191   astring combinedpath(swinfo->shortname(), ";", list_name, PATH_SEPARATOR, swinfo->shortname());
192   astring locationtag(list_name, "%", swinfo->shortname(), "%");
191   astring combinedpath(swinfo->shortname());
192   combinedpath.cat(";");
193   combinedpath.cat(list_name);
194   combinedpath.cat(PATH_SEPARATOR);
195   combinedpath.cat(swinfo->shortname());
196   astring locationtag(list_name);
197   locationtag.cat("%");
198   locationtag.cat(swinfo->shortname());
199   locationtag.cat("%");
193200   if (swinfo->parentname() != NULL)
194201   {
195202      locationtag.cat(swinfo->parentname());
trunk/src/emu/clifront.c
r245668r245669
16861686      for (const osd_directory_entry *entry = osd_readdir(directory); entry != NULL; entry = osd_readdir(directory))
16871687         if (entry->type == ENTTYPE_FILE)
16881688         {
1689            astring curfile(filename, PATH_SEPARATOR, entry->name);
1689            astring curfile = astring(filename).cat(PATH_SEPARATOR).cat(entry->name);
16901690            identify(curfile.c_str());
16911691         }
16921692
trunk/src/emu/cpu/drcbex64.c
r245668r245669
654654   // create the log
655655   if (device.machine().options().drc_log_native())
656656   {
657      astring filename("drcbex64_", device.shortname(), ".asm");
657      astring filename = astring("drcbex64_").cat(device.shortname()).cat(".asm");
658658      m_log = x86log_create_context(filename.c_str());
659659   }
660660}
trunk/src/emu/cpu/drcbex86.c
r245668r245669
568568   // create the log
569569   if (device.machine().options().drc_log_native())
570570   {
571      astring filename("drcbex86_", device.shortname(), ".asm");
571      astring filename = astring("drcbex86_").cat(device.shortname()).cat(".asm");
572572      m_log = x86log_create_context(filename.c_str());
573573   }
574574}
trunk/src/emu/cpu/drcuml.c
r245668r245669
129129   // if we're to log, create the logfile
130130   if (device.machine().options().drc_log_uml())
131131   {
132      astring filename("drcuml_", m_device.shortname(), ".asm");
132      astring filename = astring("drcuml_").cat(m_device.shortname()).cat(".asm");
133133      m_umllog = fopen(filename.c_str(), "w");
134134   }
135135}
trunk/src/emu/diimage.c
r245668r245669
499499-------------------------------------------------*/
500500void device_image_interface::battery_load(void *buffer, int length, int fill)
501501{
502   astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext.c_str(), ".nv");
502   astring fname = astring(device().machine().system().name).cat(PATH_SEPARATOR).cat(m_basename_noext.c_str()).cat(".nv");
503503   image_battery_load_by_name(device().machine().options(), fname.c_str(), buffer, length, fill);
504504}
505505
506506void device_image_interface::battery_load(void *buffer, int length, void *def_buffer)
507507{
508   astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext.c_str(), ".nv");
508   astring fname = astring(device().machine().system().name).cat(PATH_SEPARATOR).cat(m_basename_noext.c_str()).cat(".nv");
509509   image_battery_load_by_name(device().machine().options(), fname.c_str(), buffer, length, def_buffer);
510510}
511511
r245668r245669
517517-------------------------------------------------*/
518518void device_image_interface::battery_save(const void *buffer, int length)
519519{
520   astring fname(device().machine().system().name, PATH_SEPARATOR, m_basename_noext.c_str(), ".nv");
520   astring fname = astring(device().machine().system().name).cat(PATH_SEPARATOR).cat(m_basename_noext.c_str()).cat(".nv");
521521
522522   image_battery_save_by_name(device().machine().options(), fname.c_str(), buffer, length);
523523}
trunk/src/emu/emuopts.c
r245668r245669
549549
550550const char *emu_options::sub_value(astring &buffer, const char *name, const char *subname) const
551551{
552   astring tmp(",", subname, "=");
552   astring tmp = astring(",").cat(subname).cat("=");
553553   buffer = value(name);
554554   int pos = buffer.find(0, tmp.c_str());
555555   if (pos != -1)
trunk/src/emu/emupal.c
r245668r245669
408408   if (share != NULL)
409409   {
410410      // find the extended (split) memory, if present
411      astring tag_ext(tag(), "_ext");
411      astring tag_ext = astring(tag()).cat("_ext");
412412      const memory_share *share_ext = memshare(tag_ext.c_str());
413413
414414      // make sure we have specified a format
trunk/src/emu/fileio.c
r245668r245669
281281file_error emu_file::open(const char *name1, const char *name2)
282282{
283283   // concatenate the strings and do a standard open
284   astring name(name1, name2);
284   astring name = astring(name1).cat(name2);
285285   return open(name.c_str());
286286}
287287
288288file_error emu_file::open(const char *name1, const char *name2, const char *name3)
289289{
290290   // concatenate the strings and do a standard open
291   astring name(name1, name2, name3);
291   astring name = astring(name1).cat(name2).cat(name3);
292292   return open(name.c_str());
293293}
294294
295295file_error emu_file::open(const char *name1, const char *name2, const char *name3, const char *name4)
296296{
297297   // concatenate the strings and do a standard open
298   astring name(name1, name2, name3, name4);
298   astring name = astring(name1).cat(name2).cat(name3).cat(name4);
299299   return open(name.c_str());
300300}
301301
r245668r245669
314314file_error emu_file::open(const char *name1, const char *name2, UINT32 crc)
315315{
316316   // concatenate the strings and do a standard open
317   astring name(name1, name2);
317   astring name = astring(name1).cat(name2);
318318   return open(name.c_str(), crc);
319319}
320320
321321file_error emu_file::open(const char *name1, const char *name2, const char *name3, UINT32 crc)
322322{
323323   // concatenate the strings and do a standard open
324   astring name(name1, name2, name3);
324   astring name = astring(name1).cat(name2).cat(name3);
325325   return open(name.c_str(), crc);
326326}
327327
328328file_error emu_file::open(const char *name1, const char *name2, const char *name3, const char *name4, UINT32 crc)
329329{
330330   // concatenate the strings and do a standard open
331   astring name(name1, name2, name3, name4);
331   astring name = astring(name1).cat(name2).cat(name3).cat(name4);
332332   return open(name.c_str(), crc);
333333}
334334
trunk/src/emu/imagedev/diablo.c
r245668r245669
170170
171171static chd_error open_disk_diff(emu_options &options, const char *name, chd_file &source, chd_file &diff_chd)
172172{
173   astring fname(name, ".dif");
173   astring fname = astring(name).cat(".dif");
174174
175175   /* try to open the diff */
176176   //printf("Opening differencing image file: %s\n", fname.c_str());
trunk/src/emu/imagedev/harddriv.c
r245668r245669
176176
177177static chd_error open_disk_diff(emu_options &options, const char *name, chd_file &source, chd_file &diff_chd)
178178{
179   astring fname(name, ".dif");
179   astring fname = astring(name).cat(".dif");
180180
181181   /* try to open the diff */
182182   //printf("Opening differencing image file: %s\n", fname.c_str());
trunk/src/emu/machine.c
r245668r245669
206206   else if (strlen(options().autoboot_command())!=0) {
207207      astring cmd = astring(options().autoboot_command());
208208      cmd.replace("'","\\'");
209      astring val = astring("emu.keypost('", cmd.c_str(), "')").c_str();
209      astring val = astring("emu.keypost('").cat(cmd.c_str()).cat("')").c_str();
210210      manager().lua()->load_string(val.c_str());
211211   }
212212}
trunk/src/emu/render.c
r245668r245669
15711571   else
15721572   {
15731573      // build the path and optionally prepend the directory
1574      astring fname(filename, ".lay");
1574      astring fname = astring(filename).cat(".lay");
15751575      if (dirname != NULL)
15761576         fname.ins(0, PATH_SEPARATOR).ins(0, dirname);
15771577
trunk/src/emu/romload.c
r245668r245669
11791179
11801180static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd_file &source, chd_file &diff_chd)
11811181{
1182   astring fname(ROM_GETNAME(romp), ".dif");
1182   astring fname = astring(ROM_GETNAME(romp)).cat(".dif");
11831183
11841184   /* try to open the diff */
11851185   LOG(("Opening differencing image file: %s\n", fname.c_str()));
r245668r245669
12361236         chd_error err;
12371237
12381238         /* make the filename of the source */
1239         astring filename(ROM_GETNAME(romp), ".chd");
1239         astring filename = astring(ROM_GETNAME(romp)).cat(".chd");
12401240
12411241         /* first open the source drive */
12421242         LOG(("Opening disk image: %s\n", filename.c_str()));
trunk/src/emu/save.h
r245668r245669
267267template<>
268268inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, attotime &value, const char *name)
269269{
270   astring tempstr(name, ".attoseconds");
270   astring tempstr = astring(name).cat(".attoseconds");
271271   save_memory(device, module, tag, index, tempstr.c_str(), &value.attoseconds, sizeof(value.attoseconds));
272272   tempstr.cpy(name).cat(".seconds");
273273   save_memory(device, module, tag, index, tempstr.c_str(), &value.seconds, sizeof(value.seconds));
trunk/src/emu/softlist.c
r245668r245669
149149      return true;
150150
151151   // copy the comma-delimited strings and ensure they end with a final comma
152   astring comp(compatibility, ",");
153   astring filt(filter, ",");
152   astring comp = astring(compatibility).cat(",");
153   astring filt = astring(filter).cat(",");
154154
155155   // iterate over filter items and see if they exist in the compatibility list; if so, return true
156156   for (int start = 0, end = filt.chr(start, ','); end != -1; start = end + 1, end = filt.chr(start, ','))
r245668r245669
175175      return true;
176176
177177   // copy the comma-delimited interface list and ensure it ends with a final comma
178   astring interfaces(interface_list, ",");
178   astring interfaces = astring(interface_list).cat(",");
179179
180180   // then add a comma to the end of our interface and return true if we find it in the list string
181   astring our_interface(m_interface, ",");
181   astring our_interface = astring(m_interface).cat(",");
182182   return (interfaces.find(0, our_interface.c_str()) != -1);
183183}
184184
r245668r245669
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.c_str()).c_str()))
503   if (valid.already_checked(astring("softlist/").cat(m_list_name.c_str()).c_str()))
504504      return;
505505
506506   // do device validation only in case of validate command
trunk/src/emu/tilemap.c
r245668r245669
17851785      m_basemem.set(*share, m_bytes_per_entry);
17861786
17871787      // look for an extension entry
1788      astring tag_ext(tag(), "_ext");
1788      astring tag_ext = astring(tag()).cat("_ext");
17891789      share = memshare(tag_ext.c_str());
17901790      if (share != NULL)
17911791         m_extmem.set(*share, m_bytes_per_entry);
trunk/src/emu/ui/imgcntrl.c
r245668r245669
132132
133133void ui_menu_control_device_image::load_software_part()
134134{
135   astring temp_name(sld->list_name(), ":", swi->shortname(), ":", swp->name());
135   astring temp_name = astring(sld->list_name()).cat(":").cat(swi->shortname()).cat(":").cat(swp->name());
136136
137137   driver_enumerator drivlist(machine().options(), machine().options().system_name());
138138   media_auditor auditor(drivlist);
trunk/src/emu/video.c
r245668r245669
308308   create_snapshot_bitmap(screen);
309309
310310   // add two text entries describing the image
311   astring text1(emulator_info::get_appname(), " ", build_version);
312   astring text2(machine().system().manufacturer, " ", machine().system().description);
311   astring text1 = astring(emulator_info::get_appname()).cat(" ").cat(build_version);
312   astring text2 = astring(machine().system().manufacturer).cat(" ").cat(machine().system().description);
313313   png_info pnginfo = { 0 };
314314   png_add_text(&pnginfo, "Software", text1.c_str());
315315   png_add_text(&pnginfo, "System", text2.c_str());
r245668r245669
12781278         png_info pnginfo = { 0 };
12791279         if (m_mng_frame == 0)
12801280         {
1281            astring text1(emulator_info::get_appname(), " ", build_version);
1282            astring text2(machine().system().manufacturer, " ", machine().system().description);
1281            astring text1 = astring(emulator_info::get_appname()).cat(" ").cat(build_version);
1282            astring text2 = astring(machine().system().manufacturer).cat(" ").cat(machine().system().description);
12831283            png_add_text(&pnginfo, "Software", text1.c_str());
12841284            png_add_text(&pnginfo, "System", text2.c_str());
12851285         }
trunk/src/emu/webengine.c
r245668r245669
260260// This function will be called by mongoose on every new request.
261261int web_engine::begin_request_handler(struct mg_connection *conn)
262262{
263   astring file_path(mg_get_option(m_server, "document_root"), PATH_SEPARATOR, conn->uri);
263   astring file_path = astring(mg_get_option(m_server, "document_root")).cat(PATH_SEPARATOR).cat(conn->uri);
264264   if (filename_endswith(file_path.c_str(), ".lp"))
265265   {
266266      FILE *fp = NULL;
trunk/src/lib/util/astring.h
r245668r245669
3434   // construction with copy
3535   astring(const char *string) { init(); if(string) cpy(string); }
3636   astring(const char *string, int length) { init().cpy(string, length); }
37   astring(const char *str1, const char *str2) { init().cpy(str1).cat(str2); }
38   astring(const char *str1, const char *str2, const char *str3) { init().cpy(str1).cat(str2).cat(str3); }
39   astring(const char *str1, const char *str2, const char *str3, const char *str4) { init().cpy(str1).cat(str2).cat(str3).cat(str4); }
40   astring(const char *str1, const char *str2, const char *str3, const char *str4, const char *str5) { init().cpy(str1).cat(str2).cat(str3).cat(str4).cat(str5); }
4137   astring(const astring &string) { init().cpy(string); }
4238   astring(const astring &string, int start, int count = -1) { init().cpysubstr(string, start, count); }
4339
trunk/src/lib/util/options.c
r245668r245669
687687
688688         // for boolean options add a "no" variant as well
689689         if (newentry.type() == OPTION_BOOLEAN)
690            m_entrymap.add(astring("no", newentry.name(name)).c_str(), &newentry);
690            m_entrymap.add(astring("no").cat(newentry.name(name)).c_str(), &newentry);
691691      }
692692}
693693
trunk/src/mame/drivers/snowbros.c
r245668r245669
22902290   ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
22912291   ROM_LOAD16_BYTE( "u52",  0x00001, 0x40000, CRC(63fd8a9b) SHA1(53054d8072322842c32625ab38e7d62dc0e75627) )
22922292   ROM_LOAD16_BYTE( "u74",  0x00000, 0x40000, CRC(3edb17ce) SHA1(0c6ea239f57eca114d75c173b77b2c8ef43d63a2) )
2293   ROM_LOAD( "hackprot", 0x7fe00, 0x200 , CRC(2c685396) SHA1(c3bc7940bb2b4394a6b6663b92a656995f6011fe) ) // hack, decrypted data from 3in1semi
22942293
22952294   ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
22962295   ROM_LOAD( "u35", 0x00000, 0x10000 , CRC(79e965b4) SHA1(268df67ec6ea828ae01a6e4d2da9ad2a08a837f1) )
r245668r245669
29142913   m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::_3in1_read),this));
29152914}
29162915
2917DRIVER_INIT_MEMBER(snowbros_state,mcheonru_hack)
2918{
2919   m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::_3in1_read),this));
2920   
2921   UINT16 *HCROM = (UINT16*)memregion("maincpu")->base();
2922
2923   HCROM[0x68/ 2] = 0x0007;
2924   HCROM[0x6a/ 2] = 0xfe00;
2925   HCROM[0x6c/ 2] = 0x0007;
2926   HCROM[0x6e/ 2] = 0xff1a;
2927   HCROM[0x70/ 2] = 0x0007;
2928   HCROM[0x72/ 2] = 0xff4c;
2929
2930}
2931
29322916READ16_MEMBER(snowbros_state::cookbib3_read)
29332917{
29342918   return 0x2a2a;
r245668r245669
30072991GAME( 1997, suhosong, 0,        semiprot,     suhosong, driver_device,  0,        ROT0, "SemiCom",              "Su Ho Seong", GAME_SUPPORTS_SAVE )
30082992GAME( 1997, twinkle,  0,        semiprot,     twinkle,  driver_device,  0,        ROT0, "SemiCom",              "Twinkle", GAME_SUPPORTS_SAVE )
30092993GAME( 1998, 3in1semi, 0,        semiprot,     moremore, snowbros_state, 3in1semi, ROT0, "SemiCom",              "XESS - The New Revolution (SemiCom 3-in-1)", GAME_SUPPORTS_SAVE )
3010GAME( 1999, mcheonru, 0,        semiprot,     moremore, snowbros_state, mcheonru_hack, ROT0, "SemiCom",              "Ma Cheon Ru", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2994GAME( 1999, mcheonru, 0,        semiprot,     moremore, snowbros_state, 3in1semi, ROT0, "SemiCom",              "Ma Cheon Ru", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
30112995GAME( 1999, moremore, 0,        semiprot,     moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit",       "More More", GAME_SUPPORTS_SAVE )
30122996GAME( 1999, moremorp, 0,        semiprot,     moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit",       "More More Plus", GAME_SUPPORTS_SAVE )
30132997// This is very similar to the SemiCom titles, but unprotected.
trunk/src/mame/includes/snowbros.h
r245668r245669
5050   DECLARE_WRITE16_MEMBER(sb3_sound_w);
5151   DECLARE_READ16_MEMBER(toto_read);
5252
53   DECLARE_DRIVER_INIT(mcheonru_hack);
54
5553   DECLARE_DRIVER_INIT(pzlbreak);
5654   DECLARE_DRIVER_INIT(moremorp);
5755   DECLARE_DRIVER_INIT(snowbro3);
trunk/src/osd/modules/debugger/win/disasmwininfo.c
r245668r245669
145145
146146void disasmwin_info::update_caption()
147147{
148   win_set_window_text_utf8(window(), astring("Disassembly: ", m_views[0]->source_name()).c_str());
148   win_set_window_text_utf8(window(), astring("Disassembly: ").cat(m_views[0]->source_name()).c_str());
149149}
trunk/src/osd/modules/debugger/win/logwininfo.c
r245668r245669
1212
1313
1414logwin_info::logwin_info(debugger_windows_interface &debugger) :
15   debugwin_info(debugger, false, astring("Errorlog: ", debugger.machine().system().description, " [", debugger.machine().system().name, "]").c_str(), NULL)
15   debugwin_info(debugger, false, astring("Errorlog: ").cat(debugger.machine().system().description).cat(" [").cat(debugger.machine().system().name).cat("]").c_str(), NULL)
1616{
1717   if (!window())
1818      return;
trunk/src/osd/modules/debugger/win/memorywininfo.c
r245668r245669
275275
276276void memorywin_info::update_caption()
277277{
278   win_set_window_text_utf8(window(), astring("Memory: ", m_views[0]->source_name()).c_str());
278   win_set_window_text_utf8(window(), astring("Memory: ").cat(m_views[0]->source_name()).c_str());
279279}
trunk/src/osd/modules/render/d3d/d3dhlsl.c
r245668r245669
370370            return;
371371
372372         // add two text entries describing the image
373         astring text1(emulator_info::get_appname(), " ", build_version);
374         astring text2(machine->system().manufacturer, " ", machine->system().description);
373         astring text1 = astring(emulator_info::get_appname()).cat(" ").cat(build_version);
374         astring text2 = astring(machine->system().manufacturer).cat(" ").cat(machine->system().description);
375375         png_info pnginfo = { 0 };
376376         png_add_text(&pnginfo, "Software", text1.c_str());
377377         png_add_text(&pnginfo, "System", text2.c_str());


Previous 199869 Revisions Next


© 1997-2024 The MAME Team