Commit: d4f326f0db87eba82223d14b5727b6ab43e928be Parent: aa37a4b1de7c6f1bf74ecd39933ddc5188d1296e Author: Vi Grey Date: 2023-08-08 02:40 UTC Summary: User NES_MMC1_WR instead of NES_CPU_WR for dw host/scripts/nes/dragonwarrior.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/host/scripts/nes/dragonwarrior.lua b/host/scripts/nes/dragonwarrior.lua index f7ae797..7d3d4af 100644 --- a/host/scripts/nes/dragonwarrior.lua +++ b/host/scripts/nes/dragonwarrior.lua @@ -4,19 +4,19 @@ local dragonwarrior = {} -- import required modules local dict = require "scripts.app.dict" +-- Reset MMC1 mapper +local function init_mapper() + dict.nes("NES_CPU_WR", 0x8000, 0x80) +end + -- Disable Dragon Warrior cartridge SRAM for safety (Maybe not needed?) local function disable_sram() - dict.nes("NES_CPU_WR", 0xE000, 0x80) + dict.nes("NES_MMC1_WR", 0xE000, 0x80) end -- Enable Dragon Warrior cartridge SRAM local function enable_sram() - dict.nes("NES_CPU_WR", 0xE000, 0x00) -end - --- Set the mirroring of -local function set_mirror_vert() - dict.nes("NES_CPU_WR", 0x8000, 0x02) + dict.nes("NES_MMC1_WR", 0xE000, 0x00) end -- Get 8KB SRAM Data from cartridge and returns that data @@ -153,6 +153,7 @@ local function process(process_opts, console_opts) if dumpram then print("\nDumping WRAM...") file = assert(io.open(ramdumpfile, "wb")) + init_mapper() enable_sram() local content = read_sram(file) disable_sram()