plugins/cheatfind: oops (nw)
parent
009929f37f
commit
56ea65ede2
|
@ -389,7 +389,7 @@ function cheatfind.startplugin()
|
||||||
if file then
|
if file then
|
||||||
file:write(string.format(cheat_save.json, desc))
|
file:write(string.format(cheat_save.json, desc))
|
||||||
file:close()
|
file:close()
|
||||||
if not devtable[devcur].space.shortname then -- no xml or simple for ram_device cheat
|
if not getmetatable(devtable[devcur].space).__name:match("device_t") then -- no xml or simple for ram_device cheat
|
||||||
file = io.open(filename .. ".xml", "w")
|
file = io.open(filename .. ".xml", "w")
|
||||||
file:write(string.format(cheat_save.xml, desc))
|
file:write(string.format(cheat_save.xml, desc))
|
||||||
file:close()
|
file:close()
|
||||||
|
@ -399,7 +399,7 @@ function cheatfind.startplugin()
|
||||||
manager:machine():popmessage(string.format(_("Cheat written to %s and added to cheat.simple"), cheat_save.filename))
|
manager:machine():popmessage(string.format(_("Cheat written to %s and added to cheat.simple"), cheat_save.filename))
|
||||||
end
|
end
|
||||||
written = true
|
written = true
|
||||||
elseif not devtable[devcur].space.shortname then
|
elseif not getmetatable(devtable[devcur].space).__name:match("device_t") then
|
||||||
file = io.open(cheat_save.path .. "/cheat.simple", "a")
|
file = io.open(cheat_save.path .. "/cheat.simple", "a")
|
||||||
if file then
|
if file then
|
||||||
file:write(string.format(cheat_save.simple, desc))
|
file:write(string.format(cheat_save.simple, desc))
|
||||||
|
@ -680,7 +680,7 @@ function cheatfind.startplugin()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if dev.space.shortname then
|
if getmetatable(dev.space).__name:match("device_t") then
|
||||||
cheat.ram = { ram = dev.tag }
|
cheat.ram = { ram = dev.tag }
|
||||||
cheat.script.run = "ram:write(" .. match.addr .. "," .. match.newval .. ")"
|
cheat.script.run = "ram:write(" .. match.addr .. "," .. match.newval .. ")"
|
||||||
else
|
else
|
||||||
|
@ -720,7 +720,7 @@ function cheatfind.startplugin()
|
||||||
else
|
else
|
||||||
local func = "return space:read"
|
local func = "return space:read"
|
||||||
local env = { space = devtable[devcur].space }
|
local env = { space = devtable[devcur].space }
|
||||||
if not dev.space.shortname then
|
if not getmetatable(dev.space).__name:match("device_t") then
|
||||||
func = func .. "_" .. wid
|
func = func .. "_" .. wid
|
||||||
end
|
end
|
||||||
func = func .. "(" .. match.addr .. ")"
|
func = func .. "(" .. match.addr .. ")"
|
||||||
|
|
Loading…
Reference in New Issue