diff options
author | cracyc <cracyc@users.noreply.github.com> | 2021-02-19 12:32:25 -0600 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2021-02-19 12:32:25 -0600 |
commit | 6bf76d04531db85e170682f308263938b086c524 (patch) | |
tree | f9d3d175095e286ea7dea4ad3ebfafb2bc80ef11 | |
parent | 21928ae5b74d0f5e750f5018c88e4fb4863d8e92 (diff) |
plugins/cheatfind: fix watch and write
-rw-r--r-- | plugins/cheatfind/init.lua | 7 |
1 files 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 } |