diff options
author | 2021-01-01 01:31:12 +1100 | |
---|---|---|
committer | 2021-01-01 01:31:12 +1100 | |
commit | 525f744b38f03e672eaac4d9fd7946c08b5e2221 (patch) | |
tree | 9563914c13d2ca4265e2b6c21f666c7ca05e7786 /plugins | |
parent | 9c961d992a793e78a475e50176376cace6f3be3e (diff) |
plugins/cheat: Migrate remaining XML cheat code for Lua API changes.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/cheat/cheat_xml.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/cheat/cheat_xml.lua b/plugins/cheat/cheat_xml.lua index d9032814f30..2c7e09dca41 100644 --- a/plugins/cheat/cheat_xml.lua +++ b/plugins/cheat/cheat_xml.lua @@ -76,7 +76,7 @@ function xml.conv_cheat(data) local function convert_memref(cpu, phys, space, width, addr, rw) -- debug expressions address spaces by index not by name local function get_space_name(index) - local prefix = cpu:sub(1,1) + local prefix = cpu:sub(1, 1) if prefix == ":" then return cpu_spaces[cpu][index] else @@ -85,7 +85,6 @@ function xml.conv_cheat(data) end local mod = "" - local count if space == "p" then fullspace = get_space_name(0) elseif space == "d" then @@ -94,11 +93,11 @@ function xml.conv_cheat(data) fullspace = get_space_name(2) elseif space == "r" then fullspace = get_space_name(0) - mod = "direct_" + mod = "_direct" space = "p" elseif space == "o" then fullspace = get_space_name(3) - mod = "direct_" + mod = "_direct" space = "o" end if width == "b" then @@ -122,14 +121,15 @@ function xml.conv_cheat(data) else spaces[cpuname .. space] = { tag = ":" .. cpu, type = fullspace } if phys ~= "p" and mod == "" then - mod = "log_" + mod = "v" end end + local ret if rw == "=" then write = true - ret = cpuname .. space .. ":" .. "write_" .. mod .. width .. "(" .. addr .. "," + ret = string.format("%s%s:write%s_%s(%s,", cpuname, space, mod, width, addr) else - ret = cpuname .. space .. ":" .. "read_" .. mod .. width .. "(" .. addr .. ")" + ret = string.format("%s%s:read%s_%s(%s)", cpuname, space, mod, width, addr) end if rw == "==" then ret = ret .. "==" @@ -161,6 +161,7 @@ function xml.conv_cheat(data) data = data:gsub("%f[%w](%x+)%f[%W]", "0x%1") -- 0?x? avoids an issue where db (data region byte) is interepeted as a hex number data = data:gsub("([%w_:]-)%.(p?)0?x?([pmrodi3])([bwdq])@(%w+) *(=*)", convert_memref) + local count repeat data, count = data:gsub("([%w_:]-)%.(p?)0?x?([pmrodi3])([bwdq])@(%b()) *(=*)", convert_memref) until count == 0 |