plugins: add emu.plugin table to contain plugin exported interfaces

This commit is contained in:
cracyc 2020-09-13 10:00:00 -05:00
parent 9b58257492
commit 9c4d1457da
3 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ function lfs.env_replace(str)
end end
_G._ = emu.lang_translate _G._ = emu.lang_translate
_G.emu.plugin = {} -- table to contain plugin interfaces
-- substitute environment variables in the plugins path from options -- substitute environment variables in the plugins path from options
local dirs = lfs.env_replace(manager:options().entries.pluginspath:value()) local dirs = lfs.env_replace(manager:options().entries.pluginspath:value())

View File

@ -897,7 +897,7 @@ function cheat.startplugin()
return list return list
end end
_G.ce = ce _G.emu.plugin.cheat = ce
end end

View File

@ -251,7 +251,7 @@ function cheatfind.startplugin()
return cheat.compnext(newdata, olddata, oldmatch, oper, format, val, bcd, step) return cheat.compnext(newdata, olddata, oldmatch, oper, format, val, bcd, step)
end end
_G.cf = cheat _G.emu.plugin.cheatfind = cheat
local devtable = {} local devtable = {}
local devsel = 1 local devsel = 1
local devcur = 1 local devcur = 1
@ -937,10 +937,10 @@ function cheatfind.startplugin()
cheat.script.run = "cpu:write_" .. wid .. "(" .. match.addr .. "," .. pokevalue .. ")" cheat.script.run = "cpu:write_" .. wid .. "(" .. match.addr .. "," .. pokevalue .. ")"
end end
if match.mode == 1 then if match.mode == 1 then
if not _G.ce then if not emu.plugin.cheat then
manager:machine():popmessage(_("Cheat engine not available")) manager:machine():popmessage(_("Cheat engine not available"))
else else
_G.ce.inject(cheat) emu.plugin.cheat.inject(cheat)
end end
elseif match.mode == 2 then elseif match.mode == 2 then
cheat_save = {} cheat_save = {}