From 6bf76d04531db85e170682f308263938b086c524 Mon Sep 17 00:00:00 2001 From: cracyc Date: Fri, 19 Feb 2021 12:32:25 -0600 Subject: [PATCH] plugins/cheatfind: fix watch and write --- plugins/cheatfind/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua index 9ac4db42e21..a1fff20150a 100644 --- a/plugins/cheatfind/init.lua +++ b/plugins/cheatfind/init.lua @@ -900,7 +900,7 @@ function cheatfind.startplugin() pokevalue = 65535 end - local cheat = { desc = string.format(_("Test Cheat %08X:%02X"), match.addr, pokevalue), script = {} } + local cheat = { desc = string.format(_("Test Cheat %08X_%02X"), match.addr, pokevalue), script = {} } if wid == "2" then wid = "u16" @@ -974,9 +974,12 @@ function cheatfind.startplugin() return true else local func = "return space:read" - local env = { space = devtable[devcur].space } + local env = {} if not getmetatable(dev.space).__name:match("device_t") then + env.space = devtable[devcur].space; func = func .. "_" .. wid + else + env.space = emu.item(dev.space.items["0/m_pointer"]) end func = func .. "(" .. match.addr .. ")" watches[#watches + 1] = { addr = match.addr, func = load(func, func, "t", env), format = form }