diff options
Diffstat (limited to 'src/frontend/mame/cheat.cpp')
-rw-r--r-- | src/frontend/mame/cheat.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp index 38676366a61..e007f0d8372 100644 --- a/src/frontend/mame/cheat.cpp +++ b/src/frontend/mame/cheat.cpp @@ -138,7 +138,7 @@ inline std::string number_and_format::format() const // cheat_parameter - constructor //------------------------------------------------- -cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, util::xml::data_node const ¶mnode) +cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, std::string const &filename, util::xml::data_node const ¶mnode) : m_minval(number_and_format(paramnode.get_attribute_int("min", 0), paramnode.get_attribute_int_format("min"))) , m_maxval(number_and_format(paramnode.get_attribute_int("max", 0), paramnode.get_attribute_int_format("max"))) , m_stepval(number_and_format(paramnode.get_attribute_int("step", 1), paramnode.get_attribute_int_format("step"))) @@ -320,7 +320,7 @@ constexpr int cheat_script::script_entry::MAX_ARGUMENTS; cheat_script::cheat_script( cheat_manager &manager, symbol_table &symbols, - char const *filename, + std::string const &filename, util::xml::data_node const &scriptnode) : m_state(SCRIPT_STATE_RUN) { @@ -398,7 +398,7 @@ void cheat_script::save(emu_file &cheatfile) const cheat_script::script_entry::script_entry( cheat_manager &manager, symbol_table &symbols, - char const *filename, + std::string const &filename, util::xml::data_node const &entrynode, bool isaction) : m_condition(&symbols) @@ -574,7 +574,7 @@ void cheat_script::script_entry::save(emu_file &cheatfile) const // has the correct number and type of arguments //------------------------------------------------- -void cheat_script::script_entry::validate_format(const char *filename, int line) +void cheat_script::script_entry::validate_format(std::string const &filename, int line) { // first count arguments int argsprovided(0); @@ -608,7 +608,7 @@ void cheat_script::script_entry::validate_format(const char *filename, int line) cheat_script::script_entry::output_argument::output_argument( cheat_manager &manager, symbol_table &symbols, - char const *filename, + std::string const &filename, util::xml::data_node const &argnode) : m_expression(&symbols) , m_count(0) @@ -677,7 +677,7 @@ void cheat_script::script_entry::output_argument::save(emu_file &cheatfile) cons // cheat_entry - constructor //------------------------------------------------- -cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, util::xml::data_node const &cheatnode) +cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, std::string const &filename, util::xml::data_node const &cheatnode) : m_manager(manager) , m_symbols(&manager.machine(), &globaltable) , m_state(SCRIPT_STATE_OFF) @@ -1170,7 +1170,7 @@ void cheat_manager::reload() // have the same shortname if (image.loaded_through_softlist()) { - load_cheats(string_format("%s%s%s", image.software_list_name(), PATH_SEPARATOR, image.basename()).c_str()); + load_cheats(string_format("%s" PATH_SEPARATOR "%s", image.software_list_name(), image.basename())); break; } // else we are loading outside the software list, try to load machine_basename/crc32.xml @@ -1179,7 +1179,7 @@ void cheat_manager::reload() uint32_t crc = image.crc(); if (crc != 0) { - load_cheats(string_format("%s%s%08X", machine().basename(), PATH_SEPARATOR, crc).c_str()); + load_cheats(string_format("%s" PATH_SEPARATOR "%08X", machine().basename(), crc)); break; } } @@ -1201,11 +1201,11 @@ void cheat_manager::reload() // memory to the given filename //------------------------------------------------- -bool cheat_manager::save_all(const char *filename) +bool cheat_manager::save_all(std::string const &filename) { // open the file with the proper name emu_file cheatfile(machine().options().cheat_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - osd_file::error const filerr(cheatfile.open(filename, ".xml")); + osd_file::error const filerr(cheatfile.open(filename + ".xml")); // if that failed, return nothing if (filerr != osd_file::error::NONE) @@ -1392,19 +1392,19 @@ void cheat_manager::frame_update() // and create the cheat entry list //------------------------------------------------- -void cheat_manager::load_cheats(const char *filename) +void cheat_manager::load_cheats(std::string const &filename) { std::string searchstr(machine().options().cheat_path()); std::string curpath; for (path_iterator path(searchstr); path.next(curpath); ) { - searchstr.append(";").append(curpath).append(PATH_SEPARATOR).append("cheat"); + searchstr.append(";").append(curpath).append(PATH_SEPARATOR "cheat"); } emu_file cheatfile(std::move(searchstr), OPEN_FLAG_READ); try { // loop over all instrances of the files found in our search paths - for (osd_file::error filerr = cheatfile.open(filename, ".xml"); filerr == osd_file::error::NONE; filerr = cheatfile.open_next()) + for (osd_file::error filerr = cheatfile.open(filename + ".xml"); filerr == osd_file::error::NONE; filerr = cheatfile.open_next()) { osd_printf_verbose("Loading cheats file from %s\n", cheatfile.fullpath()); |