From f5191c86057fe4c1486a0f7733af0e01ef4b00b5 Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 2 May 2018 08:56:00 -0500 Subject: [PATCH] plugins/cheat: oops (nw) --- plugins/cheat/cheat_xml.lua | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/plugins/cheat/cheat_xml.lua b/plugins/cheat/cheat_xml.lua index cb849fe0b07..990e5fe64d8 100644 --- a/plugins/cheat/cheat_xml.lua +++ b/plugins/cheat/cheat_xml.lua @@ -54,22 +54,21 @@ local function xml_parse(data) return xml_table end -local cpu_spaces = {} - -for tag, device in pairs(manager:machine().devices) do - local sp - for name, space in pairs(device.spaces) do - if not sp then - sp = {} - cpu_spaces[tag] = sp - end - sp[space.index] = space.name - end -end - function xml.conv_cheat(data) local spaces, regions, output data = xml_parse(data) + local cpu_spaces = {} + + for tag, device in pairs(manager:machine().devices) do + local sp + for name, space in pairs(device.spaces) do + if not sp then + sp = {} + cpu_spaces[tag] = sp + end + sp[space.index] = space.name + end + end local function convert_expr(data) local write = false