diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index b77ee97fc46..af8f7b0751f 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -73,8 +73,7 @@ function cheat.startplugin() local filename = emu.romname() local json = require("json") local newcheats = {} - local path = manager:machine():options().entries.cheatpath:value():gsub("([^;]+)", "%1;%1/cheat") - local file = emu.file(path, 1) + local file = emu.file(manager:machine():options().entries.cheatpath:value():gsub("([^;]+)", "%1;%1/cheat") , 1) if emu.softname() ~= "" then for name, image in pairs(manager:machine().images) do if image:exists() and image:software_list_name() ~= "" then @@ -116,7 +115,7 @@ function cheat.startplugin() return end if type(x) == "string" then - y = y * manager:machine():ui():get_line_height() + y = y * mame_manager:ui():get_line_height() end output[#output + 1] = { type = "text", scr = screen, x = x, y = y, str = str, color = color } end diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua index 067b272dc1c..498ffce144f 100644 --- a/plugins/cheatfind/init.lua +++ b/plugins/cheatfind/init.lua @@ -512,7 +512,7 @@ function cheatfind.startplugin() emu.register_menu(menu_callback, menu_populate, "Cheat Finder") emu.register_frame_done(function () local tag, screen = next(manager:machine().screens) - local height = manager:machine():ui():get_line_height() + local height = mame_manager:ui():get_line_height() for num, watch in ipairs(watches) do screen:draw_text("left", num * height, string.format("%08x %08x", watch.addr, watch.func())) end diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 95245c2db73..1e4f58ef08f 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -2176,6 +2176,7 @@ void lua_engine::initialize() .beginClass ("mame_manager") .addFunction ("plugins", &mame_machine_manager::plugins) .addFunction ("cheat", &mame_machine_manager::cheat) + .addFunction ("ui", &mame_machine_manager::ui) .endClass () .beginClass ("lua_machine") .addCFunction ("popmessage", &lua_machine::l_popmessage) @@ -2189,7 +2190,6 @@ void lua_engine::initialize() .addFunction ("load", &running_machine::schedule_load) .addFunction ("system", &running_machine::system) .addFunction ("video", &running_machine::video) - .addFunction ("ui", &running_machine::ui) .addFunction ("render", &running_machine::render) .addFunction ("ioport", &running_machine::ioport) .addFunction ("parameters", &running_machine::parameters)