mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
plugins/cheat[find]: fix memshares (nw)
This commit is contained in:
parent
6be0b400ae
commit
9f12058484
@ -37,6 +37,10 @@
|
||||
-- "varname": "tag",
|
||||
-- ...
|
||||
-- },
|
||||
-- "share": {
|
||||
-- "varname": "tag",
|
||||
-- ...
|
||||
-- },
|
||||
-- "script": {
|
||||
-- "on|off|run|change": "script",
|
||||
-- ...
|
||||
@ -481,6 +485,16 @@ function cheat.startplugin()
|
||||
cheat.cheat_env[name] = emu.item(ram.items["0/m_pointer"])
|
||||
end
|
||||
end
|
||||
if cheat.share then
|
||||
for name, tag in pairs(cheat.share) do
|
||||
local share = manager:machine():memory().shares[tag]
|
||||
if not share then
|
||||
cheat_error(cheat, "missing share " .. share)
|
||||
return
|
||||
end
|
||||
cheat.cheat_env[name] = share
|
||||
end
|
||||
end
|
||||
local param = cheat.parameter
|
||||
if not param then
|
||||
return
|
||||
|
@ -713,6 +713,9 @@ function cheatfind.startplugin()
|
||||
if getmetatable(dev.space).__name:match("device_t") then
|
||||
cheat.ram = { ram = dev.tag }
|
||||
cheat.script.run = "ram:write(" .. match.addr .. "," .. match.newval .. ")"
|
||||
elseif getmetatable(dev.space).__name:match("memory_share") then
|
||||
cheat.share = { share = dev.tag }
|
||||
cheat.script.run = "share:write_" .. wid .. "(" .. match.addr .. "," .. match.newval .. ")"
|
||||
else
|
||||
cheat.space = { cpu = { tag = dev.tag, type = dev.sname } }
|
||||
cheat.script.run = "cpu:write_" .. wid .. "(" .. match.addr .. "," .. match.newval .. ")"
|
||||
|
Loading…
Reference in New Issue
Block a user