mirror of
https://github.com/holub/mame
synced 2025-07-02 08:39:21 +03:00
plugins/cheat: create temp[0-9] in case xml script doesn't (nw)
This commit is contained in:
parent
d88bdb6869
commit
ea484da9a8
@ -158,18 +158,22 @@ function cheat.startplugin()
|
||||
script = load(script, cheat.desc .. name, "t", cheat.cheat_env)
|
||||
if not script then
|
||||
print("error loading cheat script: " .. cheat.desc)
|
||||
cheat = nil
|
||||
cheat = { desc = cheat.desc .. "error" }
|
||||
return
|
||||
end
|
||||
cheat.script[name] = script
|
||||
end
|
||||
-- initialize temp[0-9] for backward compatbility reasons
|
||||
for i = 0, 9 do
|
||||
cheat.cheat_env["temp" .. i] = 0
|
||||
end
|
||||
if cheat.space then
|
||||
for name, space in pairs(cheat.space) do
|
||||
local cpu, mem
|
||||
cpu = manager:machine().devices[space.tag]
|
||||
if not cpu then
|
||||
print("error loading cheat script: " .. cheat.desc)
|
||||
cheat = nil
|
||||
cheat = { desc = cheat.desc .. "error" }
|
||||
return
|
||||
end
|
||||
if space.type then
|
||||
@ -179,7 +183,7 @@ function cheat.startplugin()
|
||||
end
|
||||
if not mem then
|
||||
print("error loading cheat script: " .. cheat.desc)
|
||||
cheat = nil
|
||||
cheat = { desc = cheat.desc .. "error" }
|
||||
return
|
||||
end
|
||||
cheat.cheat_env[name] = mem
|
||||
|
Loading…
Reference in New Issue
Block a user