summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-04-23 13:51:08 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-04-23 13:51:08 -0500
commit9c81ead8b05677438b4a871c03f0a7101930b712 (patch)
tree1c678ec75a4702d1ec328ab1a284528b2d977544
parenta9910b679d3afa7cefecc3daa9eea85f7149ca7b (diff)
plugins/cheat: make ram work properly (nw)
-rw-r--r--plugins/cheat/init.lua13
-rw-r--r--plugins/cheatfind/init.lua2
2 files changed, 6 insertions, 9 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua
index af8f7b0751f..5b1ac42a1f7 100644
--- a/plugins/cheat/init.lua
+++ b/plugins/cheat/init.lua
@@ -217,8 +217,7 @@ function cheat.startplugin()
end
if cheat.screen then
for name, screen in pairs(cheat.screen) do
- local scr
- scr = manager:machine().screens[screen]
+ local scr = manager:machine().screens[screen]
if not scr then
local tag
tag, scr = next(manager:machine().screens) -- get any screen
@@ -228,8 +227,7 @@ function cheat.startplugin()
end
if cheat.region then
for name, region in pairs(cheat.region) do
- local mem
- mem = manager:machine():memory().regions[region]
+ local mem = manager:machine():memory().regions[region]
if not mem then
emu.print_verbose("error loading cheat script: " .. cheat.desc)
cheat = { desc = cheat.desc .. " error" }
@@ -239,15 +237,14 @@ function cheat.startplugin()
end
end
if cheat.ram then
- for name, ram in pairs(cheat.ram) do
- local ram
- ram = manager:machine().devices[ram]
+ for name, tag in pairs(cheat.ram) do
+ local ram = manager:machine().devices[tag]
if not ram then
emu.print_verbose("error loading cheat script: " .. cheat.desc)
cheat = { desc = cheat.desc .. " error" }
return
end
- cheat.cheat_env[name] = emu.item(ram.items["0/pointer"])
+ cheat.cheat_env[name] = emu.item(ram.items["0/m_pointer"])
end
end
local param = cheat.parameter
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua
index 2fe4072e668..c2f56c531e2 100644
--- a/plugins/cheatfind/init.lua
+++ b/plugins/cheatfind/init.lua
@@ -476,7 +476,7 @@ function cheatfind.startplugin()
end
if dev.space.shortname then
- cheat.ram = dev.tag
+ cheat.ram = { ram = dev.tag }
cheat.script.on = "ram:write(" .. match.addr .. "," .. match.newval .. ")"
else
cheat.space = { cpu = { tag = dev.tag, type = "program" } }