summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cheat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cheat.cpp')
-rw-r--r--src/emu/cheat.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/emu/cheat.cpp b/src/emu/cheat.cpp
index c055ba5bdb2..16291063985 100644
--- a/src/emu/cheat.cpp
+++ b/src/emu/cheat.cpp
@@ -1043,9 +1043,6 @@ cheat_manager::cheat_manager(running_machine &machine)
if (!machine.options().cheat())
return;
- m_output.resize(UI_TARGET_FONT_ROWS*2);
- m_justify.resize(UI_TARGET_FONT_ROWS*2);
-
// request a callback
machine.add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(cheat_manager::frame_update), this));
@@ -1212,7 +1209,7 @@ bool cheat_manager::save_all(const char *filename)
void cheat_manager::render_text(render_container &container)
{
// render any text and free it along the way
- for (int linenum = 0; linenum < m_output.size(); linenum++)
+ for (int linenum = 0; linenum < ARRAY_LENGTH(m_output); linenum++)
if (!m_output[linenum].empty())
{
// output the text
@@ -1340,7 +1337,7 @@ void cheat_manager::frame_update()
// set up for accumulating output
m_lastline = 0;
m_numlines = floor(1.0f / machine().ui().get_line_height());
- m_numlines = MIN(m_numlines, m_output.size());
+ m_numlines = MIN(m_numlines, ARRAY_LENGTH(m_output));
for (auto & elem : m_output)
elem.clear();
@@ -1361,14 +1358,7 @@ void cheat_manager::frame_update()
void cheat_manager::load_cheats(const char *filename)
{
xml_data_node *rootnode = nullptr;
- std::string searchstr(machine().options().cheat_path());
- path_iterator path(searchstr.c_str());
- std::string curpath;
- while (path.next(curpath))
- {
- searchstr.append(";").append(curpath).append(PATH_SEPARATOR).append("cheat");
- }
- emu_file cheatfile(searchstr.c_str(), OPEN_FLAG_READ);
+ emu_file cheatfile(machine().options().cheat_path(), OPEN_FLAG_READ);
try
{
// open the file with the proper name