summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheat/cheat_xml.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/cheat/cheat_xml.lua')
-rw-r--r--plugins/cheat/cheat_xml.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/cheat/cheat_xml.lua b/plugins/cheat/cheat_xml.lua
index a14aee034cb..fa24bc30079 100644
--- a/plugins/cheat/cheat_xml.lua
+++ b/plugins/cheat/cheat_xml.lua
@@ -126,9 +126,10 @@ function xml.conv_cheat(data)
data = data:gsub("%f[%w]lshift%f[%W]", "<<")
data = data:gsub("(%w-)%+%+", "%1 = %1 + 1")
data = data:gsub("%f[%w](%x+)%f[%W]", "0x%1")
- data = data:gsub("([%w_:]-)%.(p?)([pmrodi3])([bwdq])@(%w+) *(=*)", convert_memref)
+ -- 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)
repeat
- data, count = data:gsub("([%w_:]-)%.(p?)([pmrodi3])([bwdq])@(%b()) *(=*)", convert_memref)
+ data, count = data:gsub("([%w_:]-)%.(p?)0?x?([pmrodi3])([bwdq])@(%b()) *(=*)", convert_memref)
until count == 0
if write then
data = data .. ")"