diff options
author | cracyc <cracyc@users.noreply.github.com> | 2016-11-02 12:14:39 -0500 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2016-11-02 12:16:10 -0500 |
commit | bfc49b0974e4d040122dc8e546992d0ebdc418aa (patch) | |
tree | 14384314d7a5dc49aedbdf11d7e9c1b4270f9ad4 /plugins | |
parent | 431f8d361140dff4b2990a0845d8958281c90162 (diff) |
luaengine: bugfixes (nw)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/cheatfind/init.lua | 2 | ||||
-rw-r--r-- | plugins/data/data_hiscore.lua | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua index 5649113b265..5b52062a80b 100644 --- a/plugins/cheatfind/init.lua +++ b/plugins/cheatfind/init.lua @@ -52,7 +52,7 @@ function cheatfind.startplugin() -- save data block function cheat.save(space, start, size) local data = { block = "", start = start, size = size, space = space } - if space.shortname then + if getmetatable(space).__name:match("device_t") then if space:shortname() == "ram" then data.block = emu.item(space.items["0/m_pointer"]):read_block(start, size) if not data.block then diff --git a/plugins/data/data_hiscore.lua b/plugins/data/data_hiscore.lua index 3e46fabe50a..5f2214d814d 100644 --- a/plugins/data/data_hiscore.lua +++ b/plugins/data/data_hiscore.lua @@ -654,13 +654,15 @@ function dat.check(set, softlist) local newbytes = {} if skip == "odd" then for i = 1, #bytes, 2 do - val = bytes[i]:byte(1) - newbytes[(i+1)/2] = string.char(((val & 0x0f) << 4) | (val & 0x0f)) + val1 = bytes[i]:byte(1) + val2 = bytes[i+1]:byte(1) + newbytes[(i+1)/2] = string.char(((val1 & 0x0f) << 4) | (val2 & 0x0f)) end elseif skip == "even" then for i = 1, #bytes, 2 do - val = bytes[i]:byte(1) - newbytes[(i+1)/2] = string.char((val & 0xf0) | ((val & 0xf0) >> 4)) + val1 = bytes[i]:byte(1) + val2 = bytes[i+1]:byte(1) + newbytes[(i+1)/2] = string.char((val1 & 0xf0) | ((val2 & 0xf0) >> 4)) end end return newbytes |