summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheat/cheat_simple.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/cheat/cheat_simple.lua')
-rw-r--r--plugins/cheat/cheat_simple.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/cheat/cheat_simple.lua b/plugins/cheat/cheat_simple.lua
index 9640cf22bc6..f65cc9e46b7 100644
--- a/plugins/cheat/cheat_simple.lua
+++ b/plugins/cheat/cheat_simple.lua
@@ -48,7 +48,7 @@ local function prepare_rom_cheat(desc, region, addr, val, size, banksize, comp)
end
if banksize and comp then
- local rom = manager:machine():memory().regions[region]
+ local rom = manager.machine.memory.regions[region]
local bankaddr = addr & (banksize - 1)
addr = nil
if not rom then
@@ -92,7 +92,7 @@ function codefuncs.nes_gg(desc, code)
if #code == 6 then
addr = ((value >> 4) & 7) | ((value >> 8) & 0x78) | ((value >> 12) & 0x80) | ((value << 8) & 0x700) | ((value << 4) & 0x7800)
newval = ((value >> 20) & 7) | (value & 8) | ((value >> 12) & 0x70) | ((value >> 16) & 0x80)
- if manager:machine():memory().regions[":nes_slot:cart:prg_rom"].size > 32768 then
+ if manager.machine.memory.regions[":nes_slot:cart:prg_rom"].size > 32768 then
emu.print_verbose("warning: gamegenie 6 char code with banked rom " .. desc)
end
return prepare_rom_cheat(desc, ":nes_slot:cart:prg_rom", addr, newval, 8)
@@ -130,7 +130,7 @@ local function snes_prepare_cheat(desc, addr, val)
if ((bank <= 0x3f) and (offset < 0x2000)) or ((bank & 0xfe) == 0x7e) then
return prepare_ram_cheat(desc, ":maincpu", addr, val, 8)
end
- if (manager:machine().devices[":maincpu"].spaces["program"]:read_u8(0xffd5) & 1) == 1 then --hirom
+ if (manager.machine.devices[":maincpu"].spaces["program"]:read_u8(0xffd5) & 1) == 1 then --hirom
if (bank & 0x7f) <= 0x3f and offset >= 0x8000 then
-- direct map
elseif (bank & 0x7f) >= 0x40 and (bank & 0x7f) <= 0x7d then
@@ -309,7 +309,7 @@ function simple.conv_cheat(data)
end
offset = tonumber(offset, 16)
val = tonumber(val, 16)
- if manager:machine().devices[cputag] then
+ if manager.machine.devices[cputag] then
cheat = prepare_ram_cheat(desc, cputag, offset, val, size)
else
cheat = prepare_rom_cheat(desc, cputag, offset, val, size)