diff options
| author | 2016-08-30 15:53:27 +1000 | |
|---|---|---|
| committer | 2016-08-30 15:53:27 +1000 | |
| commit | f5356a62de25fa69d8299f3f5f4cc1dd80d6c1d7 (patch) | |
| tree | 58fb91798c0c0335e53db2d3f9dc09bf226d72c6 /plugins/cheat | |
| parent | 234e91f9fbdd5add24c551048df017573116fb0a (diff) | |
srcclean on lua plugins, too
Diffstat (limited to 'plugins/cheat')
| -rw-r--r-- | plugins/cheat/conv_cheat.lua | 8 | ||||
| -rw-r--r-- | plugins/cheat/init.lua | 26 | ||||
| -rw-r--r-- | plugins/cheat/xml_conv.lua | 10 |
3 files changed, 22 insertions, 22 deletions
diff --git a/plugins/cheat/conv_cheat.lua b/plugins/cheat/conv_cheat.lua index 6f583a0178a..1574a9c0f12 100644 --- a/plugins/cheat/conv_cheat.lua +++ b/plugins/cheat/conv_cheat.lua @@ -2,10 +2,10 @@ xml = require("xml_conv") json = dofile("../json/init.lua") function readAll(file) - local f = io.open(file, "rb") - local content = f:read("*all") - f:close() - return content + local f = io.open(file, "rb") + local content = f:read("*all") + f:close() + return content end print(json.stringify(xml.conv_cheat(readAll(arg[1])), {indent = true})) diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 303ffad6ffd..7b85697fc48 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -11,7 +11,7 @@ -- "item" [{ -- "value": "itemval(index*stepval+minval)", -- "text": "text" --- }, +-- }, -- ... ] -- }, -- "space": { @@ -171,17 +171,17 @@ function cheat.startplugin() local function parse_cheat(cheat) cheat.cheat_env = { draw_text = draw_text, - draw_line = draw_line, - draw_box = draw_box, - tobcd = tobcd, - frombcd = frombcd, - pairs = pairs, - ipairs = ipairs, - outputs = manager:machine():outputs(), - time = time, - table = - { insert = table.insert, - remove = table.remove } } + draw_line = draw_line, + draw_box = draw_box, + tobcd = tobcd, + frombcd = frombcd, + pairs = pairs, + ipairs = ipairs, + outputs = manager:machine():outputs(), + time = time, + table = + { insert = table.insert, + remove = table.remove } } cheat.enabled = false -- verify scripts are valid first if not cheat.script then @@ -351,7 +351,7 @@ function cheat.startplugin() end end elseif index == 3 then - for num, cheat in pairs(cheats) do + for num, cheat in pairs(cheats) do if cheat.enabled and cheat.script.off then cheat.script.off() end diff --git a/plugins/cheat/xml_conv.lua b/plugins/cheat/xml_conv.lua index b53f3a92452..0a35f9875f9 100644 --- a/plugins/cheat/xml_conv.lua +++ b/plugins/cheat/xml_conv.lua @@ -55,7 +55,7 @@ function xml.conv_cheat(data) data = xml_parse(data) local function convert_expr(data) local write = false - + local function convert_memref(cpu, phys, space, width, addr, rw) local mod = "" local count @@ -223,16 +223,16 @@ function xml.conv_cheat(data) end end if next(spaces) then - data["cheat"][count]["space"] = {} + data["cheat"][count]["space"] = {} for name, space in pairs(spaces) do - data["cheat"][count]["space"] = {} + data["cheat"][count]["space"] = {} data["cheat"][count]["space"][name] = { type = space["type"], tag = space["tag"] } end end if next(regions) then - data["cheat"][count]["region"] = {} + data["cheat"][count]["region"] = {} for name, region in pairs(regions) do - data["cheat"][count]["region"] = {} + data["cheat"][count]["region"] = {} data["cheat"][count]["region"][name] = region end end |
