trunk/src/emu/audit.c
| r245668 | r245669 | |
| 64 | 64 | for (const rom_entry *region = rom_first_region(*device); region != NULL; region = rom_next_region(region)) |
| 65 | 65 | { |
| 66 | 66 | // temporary hack: add the driver path & region name |
| 67 | | astring combinedpath(device->searchpath(), ";", driverpath); |
| 67 | astring combinedpath = astring(device->searchpath()).cat(";").cat(driverpath); |
| 68 | 68 | if (device->shortname()) |
| 69 | 69 | combinedpath.cat(";").cat(device->shortname()); |
| 70 | 70 | m_searchpath = combinedpath.c_str(); |
| r245668 | r245669 | |
| 188 | 188 | // store validation for later |
| 189 | 189 | m_validation = validation; |
| 190 | 190 | |
| 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("%"); |
| 193 | 200 | if (swinfo->parentname() != NULL) |
| 194 | 201 | { |
| 195 | 202 | locationtag.cat(swinfo->parentname()); |
trunk/src/emu/diimage.c
| r245668 | r245669 | |
| 499 | 499 | -------------------------------------------------*/ |
| 500 | 500 | void device_image_interface::battery_load(void *buffer, int length, int fill) |
| 501 | 501 | { |
| 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"); |
| 503 | 503 | image_battery_load_by_name(device().machine().options(), fname.c_str(), buffer, length, fill); |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | void device_image_interface::battery_load(void *buffer, int length, void *def_buffer) |
| 507 | 507 | { |
| 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"); |
| 509 | 509 | image_battery_load_by_name(device().machine().options(), fname.c_str(), buffer, length, def_buffer); |
| 510 | 510 | } |
| 511 | 511 | |
| r245668 | r245669 | |
| 517 | 517 | -------------------------------------------------*/ |
| 518 | 518 | void device_image_interface::battery_save(const void *buffer, int length) |
| 519 | 519 | { |
| 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"); |
| 521 | 521 | |
| 522 | 522 | image_battery_save_by_name(device().machine().options(), fname.c_str(), buffer, length); |
| 523 | 523 | } |
trunk/src/emu/fileio.c
| r245668 | r245669 | |
| 281 | 281 | file_error emu_file::open(const char *name1, const char *name2) |
| 282 | 282 | { |
| 283 | 283 | // concatenate the strings and do a standard open |
| 284 | | astring name(name1, name2); |
| 284 | astring name = astring(name1).cat(name2); |
| 285 | 285 | return open(name.c_str()); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | file_error emu_file::open(const char *name1, const char *name2, const char *name3) |
| 289 | 289 | { |
| 290 | 290 | // concatenate the strings and do a standard open |
| 291 | | astring name(name1, name2, name3); |
| 291 | astring name = astring(name1).cat(name2).cat(name3); |
| 292 | 292 | return open(name.c_str()); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | file_error emu_file::open(const char *name1, const char *name2, const char *name3, const char *name4) |
| 296 | 296 | { |
| 297 | 297 | // 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); |
| 299 | 299 | return open(name.c_str()); |
| 300 | 300 | } |
| 301 | 301 | |
| r245668 | r245669 | |
| 314 | 314 | file_error emu_file::open(const char *name1, const char *name2, UINT32 crc) |
| 315 | 315 | { |
| 316 | 316 | // concatenate the strings and do a standard open |
| 317 | | astring name(name1, name2); |
| 317 | astring name = astring(name1).cat(name2); |
| 318 | 318 | return open(name.c_str(), crc); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | file_error emu_file::open(const char *name1, const char *name2, const char *name3, UINT32 crc) |
| 322 | 322 | { |
| 323 | 323 | // concatenate the strings and do a standard open |
| 324 | | astring name(name1, name2, name3); |
| 324 | astring name = astring(name1).cat(name2).cat(name3); |
| 325 | 325 | return open(name.c_str(), crc); |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | file_error emu_file::open(const char *name1, const char *name2, const char *name3, const char *name4, UINT32 crc) |
| 329 | 329 | { |
| 330 | 330 | // 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); |
| 332 | 332 | return open(name.c_str(), crc); |
| 333 | 333 | } |
| 334 | 334 | |
trunk/src/emu/romload.c
| r245668 | r245669 | |
| 1179 | 1179 | |
| 1180 | 1180 | static chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd_file &source, chd_file &diff_chd) |
| 1181 | 1181 | { |
| 1182 | | astring fname(ROM_GETNAME(romp), ".dif"); |
| 1182 | astring fname = astring(ROM_GETNAME(romp)).cat(".dif"); |
| 1183 | 1183 | |
| 1184 | 1184 | /* try to open the diff */ |
| 1185 | 1185 | LOG(("Opening differencing image file: %s\n", fname.c_str())); |
| r245668 | r245669 | |
| 1236 | 1236 | chd_error err; |
| 1237 | 1237 | |
| 1238 | 1238 | /* make the filename of the source */ |
| 1239 | | astring filename(ROM_GETNAME(romp), ".chd"); |
| 1239 | astring filename = astring(ROM_GETNAME(romp)).cat(".chd"); |
| 1240 | 1240 | |
| 1241 | 1241 | /* first open the source drive */ |
| 1242 | 1242 | LOG(("Opening disk image: %s\n", filename.c_str())); |
trunk/src/emu/save.h
| r245668 | r245669 | |
| 267 | 267 | template<> |
| 268 | 268 | inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, attotime &value, const char *name) |
| 269 | 269 | { |
| 270 | | astring tempstr(name, ".attoseconds"); |
| 270 | astring tempstr = astring(name).cat(".attoseconds"); |
| 271 | 271 | save_memory(device, module, tag, index, tempstr.c_str(), &value.attoseconds, sizeof(value.attoseconds)); |
| 272 | 272 | tempstr.cpy(name).cat(".seconds"); |
| 273 | 273 | save_memory(device, module, tag, index, tempstr.c_str(), &value.seconds, sizeof(value.seconds)); |
trunk/src/emu/softlist.c
| r245668 | r245669 | |
| 149 | 149 | return true; |
| 150 | 150 | |
| 151 | 151 | // 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(","); |
| 154 | 154 | |
| 155 | 155 | // iterate over filter items and see if they exist in the compatibility list; if so, return true |
| 156 | 156 | for (int start = 0, end = filt.chr(start, ','); end != -1; start = end + 1, end = filt.chr(start, ',')) |
| r245668 | r245669 | |
| 175 | 175 | return true; |
| 176 | 176 | |
| 177 | 177 | // 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(","); |
| 179 | 179 | |
| 180 | 180 | // 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(","); |
| 182 | 182 | return (interfaces.find(0, our_interface.c_str()) != -1); |
| 183 | 183 | } |
| 184 | 184 | |
| r245668 | r245669 | |
| 500 | 500 | { |
| 501 | 501 | // add to the global map whenever we check a list so we don't re-check |
| 502 | 502 | // 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())) |
| 504 | 504 | return; |
| 505 | 505 | |
| 506 | 506 | // do device validation only in case of validate command |
trunk/src/emu/video.c
| r245668 | r245669 | |
| 308 | 308 | create_snapshot_bitmap(screen); |
| 309 | 309 | |
| 310 | 310 | // 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); |
| 313 | 313 | png_info pnginfo = { 0 }; |
| 314 | 314 | png_add_text(&pnginfo, "Software", text1.c_str()); |
| 315 | 315 | png_add_text(&pnginfo, "System", text2.c_str()); |
| r245668 | r245669 | |
| 1278 | 1278 | png_info pnginfo = { 0 }; |
| 1279 | 1279 | if (m_mng_frame == 0) |
| 1280 | 1280 | { |
| 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); |
| 1283 | 1283 | png_add_text(&pnginfo, "Software", text1.c_str()); |
| 1284 | 1284 | png_add_text(&pnginfo, "System", text2.c_str()); |
| 1285 | 1285 | } |
trunk/src/lib/util/astring.h
| r245668 | r245669 | |
| 34 | 34 | // construction with copy |
| 35 | 35 | astring(const char *string) { init(); if(string) cpy(string); } |
| 36 | 36 | 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); } |
| 41 | 37 | astring(const astring &string) { init().cpy(string); } |
| 42 | 38 | astring(const astring &string, int start, int count = -1) { init().cpysubstr(string, start, count); } |
| 43 | 39 | |
trunk/src/mame/drivers/snowbros.c
| r245668 | r245669 | |
| 2290 | 2290 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 2291 | 2291 | ROM_LOAD16_BYTE( "u52", 0x00001, 0x40000, CRC(63fd8a9b) SHA1(53054d8072322842c32625ab38e7d62dc0e75627) ) |
| 2292 | 2292 | 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 |
| 2294 | 2293 | |
| 2295 | 2294 | ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */ |
| 2296 | 2295 | ROM_LOAD( "u35", 0x00000, 0x10000 , CRC(79e965b4) SHA1(268df67ec6ea828ae01a6e4d2da9ad2a08a837f1) ) |
| r245668 | r245669 | |
| 2914 | 2913 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::_3in1_read),this)); |
| 2915 | 2914 | } |
| 2916 | 2915 | |
| 2917 | | DRIVER_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 | | |
| 2932 | 2916 | READ16_MEMBER(snowbros_state::cookbib3_read) |
| 2933 | 2917 | { |
| 2934 | 2918 | return 0x2a2a; |
| r245668 | r245669 | |
| 3007 | 2991 | GAME( 1997, suhosong, 0, semiprot, suhosong, driver_device, 0, ROT0, "SemiCom", "Su Ho Seong", GAME_SUPPORTS_SAVE ) |
| 3008 | 2992 | GAME( 1997, twinkle, 0, semiprot, twinkle, driver_device, 0, ROT0, "SemiCom", "Twinkle", GAME_SUPPORTS_SAVE ) |
| 3009 | 2993 | GAME( 1998, 3in1semi, 0, semiprot, moremore, snowbros_state, 3in1semi, ROT0, "SemiCom", "XESS - The New Revolution (SemiCom 3-in-1)", GAME_SUPPORTS_SAVE ) |
| 3010 | | GAME( 1999, mcheonru, 0, semiprot, moremore, snowbros_state, mcheonru_hack, ROT0, "SemiCom", "Ma Cheon Ru", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2994 | GAME( 1999, mcheonru, 0, semiprot, moremore, snowbros_state, 3in1semi, ROT0, "SemiCom", "Ma Cheon Ru", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 3011 | 2995 | GAME( 1999, moremore, 0, semiprot, moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit", "More More", GAME_SUPPORTS_SAVE ) |
| 3012 | 2996 | GAME( 1999, moremorp, 0, semiprot, moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit", "More More Plus", GAME_SUPPORTS_SAVE ) |
| 3013 | 2997 | // This is very similar to the SemiCom titles, but unprotected. |