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
_G._ = emu.lang_translate
_G.emu.plugin = {} -- table to contain plugin interfaces
-- substitute environment variables in the plugins path from options
local dirs = lfs.env_replace(manager:options().entries.pluginspath:value())

View File

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

View File

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