diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 86d36af052e..8d1b542593b 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -66,6 +66,7 @@ function cheat.startplugin() local cheats = {} local output = {} local line = 0 + local start_time = 0 local function load_cheats() local filename = emu.romname() @@ -146,6 +147,11 @@ function cheat.startplugin() return result end + local function time() + return emu.time() - start_time + end + + local function parse_cheat(cheat) cheat.cheat_env = { draw_text = draw_text, draw_line = draw_line, @@ -154,6 +160,7 @@ function cheat.startplugin() frombcd = frombcd, pairs = pairs, ipairs = ipairs, + time = time, table = { insert = table.insert, remove = table.remove } } @@ -422,6 +429,7 @@ function cheat.startplugin() end, "Cheat") emu.register_start(function() + start_time = emu.time() cheats = load_cheats() for num, cheat in pairs(cheats) do parse_cheat(cheat)