summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2017-06-20 09:11:29 -0500
committer cracyc <cracyc@users.noreply.github.com>2017-06-20 09:11:29 -0500
commita21cd131a5fcdd9f0867fcbd979125750df2ddbe (patch)
tree709b9f349402ce85eab665651f8952371fac7aeb
parentc579e0a71afcaefd300b10e0277e89032c8095b4 (diff)
plugins/cheat: fix (nw)
-rw-r--r--plugins/cheat/cheat_simple.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/cheat/cheat_simple.lua b/plugins/cheat/cheat_simple.lua
index c10c0a6ac41..d7e9277457e 100644
--- a/plugins/cheat/cheat_simple.lua
+++ b/plugins/cheat/cheat_simple.lua
@@ -25,7 +25,7 @@ local codefuncs = {}
local function prepare_rom_cheat(desc, region, addr, val, size, banksize, comp)
local cheat = { desc = desc, region = { rom = region } }
- cheat.script = { off = "if on then rom:write_u8(addr, save) end" }
+ cheat.script = { off = "if on then rom:write_u" .. size .. "(addr, save) end" }
if banksize and comp then
local rom = manager:machine():memory().regions[region]
local bankaddr = addr & (banksize - 1)
@@ -47,7 +47,7 @@ local function prepare_rom_cheat(desc, region, addr, val, size, banksize, comp)
on = true
addr = %d
save = rom:read_u%d(addr)
- rom:write_u8(addr, %d)]], addr, size, val)
+ rom:write_u%d(addr, %d)]], addr, size, size, val)
return cheat
end