Committing host version that works with all hardware versions that
shipped to NESmaker Kickstarter backers. inlretro.exe -s scripts\inlretro2.lua -c NES -m mapper30v2 -x 512 -p romname.nes
This commit is contained in:
parent
ca604c08b6
commit
20cf2a81e5
|
|
@ -249,7 +249,7 @@ local function io( opcode, operand, misc, data )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- external call for nes dictionary
|
-- external call for nes dictionary
|
||||||
local function nes( opcode, operand, misc, data )
|
local function nes( opcode, operand, misc, data, test_opcode )
|
||||||
|
|
||||||
assert ( op_nes[opcode] , "\nERROR undefined opcode: " .. opcode .. " must be defined in shared_dict_nes.h")
|
assert ( op_nes[opcode] , "\nERROR undefined opcode: " .. opcode .. " must be defined in shared_dict_nes.h")
|
||||||
|
|
||||||
|
|
@ -277,6 +277,16 @@ local function nes( opcode, operand, misc, data )
|
||||||
end
|
end
|
||||||
--print("error:", error_code, "data_len:", data_len)
|
--print("error:", error_code, "data_len:", data_len)
|
||||||
|
|
||||||
|
--hack to test if running old firmware version for NESmaker legacy compatability
|
||||||
|
if test_opcode then
|
||||||
|
--just want to report if opcode succeeded or not
|
||||||
|
if error_code == err_codes["SUCCESS"] then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
assert ( (error_code == err_codes["SUCCESS"]), "\n ERROR!!! problem with opcode: " .. opcode .. " operand: " .. operand .. " misc: " .. misc .. " device error code: " .. error_code)
|
assert ( (error_code == err_codes["SUCCESS"]), "\n ERROR!!! problem with opcode: " .. opcode .. " operand: " .. operand .. " misc: " .. misc .. " device error code: " .. error_code)
|
||||||
|
|
||||||
if data_len and data_len ~= (wLength - RETURN_LEN_IDX) then
|
if data_len and data_len ~= (wLength - RETURN_LEN_IDX) then
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ function nes_exec(process_opts, console_opts)
|
||||||
easynsf = require "scripts.nes.easyNSF",
|
easynsf = require "scripts.nes.easyNSF",
|
||||||
fme7 = require "scripts.nes.fme7",
|
fme7 = require "scripts.nes.fme7",
|
||||||
mapper30 = require "scripts.nes.mapper30",
|
mapper30 = require "scripts.nes.mapper30",
|
||||||
|
mapper30v2 = require "scripts.nes.mapper30v2",
|
||||||
mmc1 = require "scripts.nes.mmc1",
|
mmc1 = require "scripts.nes.mmc1",
|
||||||
mmc3 = require "scripts.nes.mmc3",
|
mmc3 = require "scripts.nes.mmc3",
|
||||||
mmc4 = require "scripts.nes.mmc4",
|
mmc4 = require "scripts.nes.mmc4",
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ local dict = require "scripts.app.dict"
|
||||||
local nes = require "scripts.app.nes"
|
local nes = require "scripts.app.nes"
|
||||||
local dump = require "scripts.app.dump"
|
local dump = require "scripts.app.dump"
|
||||||
local flash = require "scripts.app.flash"
|
local flash = require "scripts.app.flash"
|
||||||
|
local time = require "scripts.app.time"
|
||||||
|
|
||||||
-- file constants
|
-- file constants
|
||||||
|
|
||||||
|
|
@ -61,8 +62,8 @@ local function process(process_opts, console_opts)
|
||||||
local file
|
local file
|
||||||
-- TODO: Cleanup needed here, support chrrom, make this look more like other mapper scripts.
|
-- TODO: Cleanup needed here, support chrrom, make this look more like other mapper scripts.
|
||||||
local size = console_opts["prg_rom_size_kb"]
|
local size = console_opts["prg_rom_size_kb"]
|
||||||
--local filetype = "nes"
|
local filetype = "nes"
|
||||||
local filetype = "bin"
|
--local filetype = "bin"
|
||||||
|
|
||||||
--initialize device i/o for NES
|
--initialize device i/o for NES
|
||||||
dict.io("IO_RESET")
|
dict.io("IO_RESET")
|
||||||
|
|
@ -203,7 +204,10 @@ local function process(process_opts, console_opts)
|
||||||
|
|
||||||
|
|
||||||
--flash cart
|
--flash cart
|
||||||
flash.write_file( file, size, "MAP30", "PRGROM", true )
|
print("\nFLASHING the PRG-ROM, will take ~20sec please wait...")
|
||||||
|
time.start()
|
||||||
|
flash.write_file( file, size, "MAP30", "PRGROM", false )
|
||||||
|
time.report(size)
|
||||||
--close file
|
--close file
|
||||||
assert(file:close())
|
assert(file:close())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ local files = require "scripts.app.files"
|
||||||
local ciccom = require "scripts.app.ciccom"
|
local ciccom = require "scripts.app.ciccom"
|
||||||
local time = require "scripts.app.time"
|
local time = require "scripts.app.time"
|
||||||
local swim = require "scripts.app.swim"
|
local swim = require "scripts.app.swim"
|
||||||
|
local mapper30_legacy = require "scripts.nes.mapper30"
|
||||||
|
|
||||||
-- file constants & variables
|
-- file constants & variables
|
||||||
local mapname = "MAP30"
|
local mapname = "MAP30"
|
||||||
|
|
@ -390,6 +391,24 @@ local function flash_prgrom(file, rom_size_KB, debug)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function is_old_firmware( debug )
|
||||||
|
|
||||||
|
if debug then print("checking for old firmware") end
|
||||||
|
|
||||||
|
--check if CIRAM_A10_MIRRORING opcode is present
|
||||||
|
--this was cut from later versions
|
||||||
|
local rv
|
||||||
|
rv = dict.nes("CIRAM_A10_MIRROR", nil, nil, nil, true)
|
||||||
|
|
||||||
|
if debug then
|
||||||
|
if rv then print("old firmware sensed, running legacy mode")
|
||||||
|
else print("later firmware sensed, running default scripts")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return rv
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--Cart should be in reset state upon calling this function
|
--Cart should be in reset state upon calling this function
|
||||||
--this function processes all user requests for this specific board/mapper
|
--this function processes all user requests for this specific board/mapper
|
||||||
|
|
@ -408,8 +427,15 @@ local function process(process_opts, console_opts)
|
||||||
-- TODO: Cleanup needed here, support chrrom, make this look more like other mapper scripts.
|
-- TODO: Cleanup needed here, support chrrom, make this look more like other mapper scripts.
|
||||||
local prg_size = console_opts["prg_rom_size_kb"]
|
local prg_size = console_opts["prg_rom_size_kb"]
|
||||||
|
|
||||||
--local filetype = "nes"
|
local filetype = "nes"
|
||||||
local filetype = "bin"
|
--local filetype = "bin"
|
||||||
|
|
||||||
|
if is_old_firmware(true) then
|
||||||
|
--call legacy mapper30 script
|
||||||
|
--local mapper30_legacy = require "scripts.nes.mapper30"
|
||||||
|
mapper30_legacy.process(process_opts, console_opts)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
--initialize device i/o for NES
|
--initialize device i/o for NES
|
||||||
dict.io("IO_RESET")
|
dict.io("IO_RESET")
|
||||||
|
|
@ -437,8 +463,8 @@ local function process(process_opts, console_opts)
|
||||||
if not rv then return end
|
if not rv then return end
|
||||||
|
|
||||||
--test software mirroring switch
|
--test software mirroring switch
|
||||||
rv = test_soft_mir_switch()
|
--rv = test_soft_mir_switch()
|
||||||
if not rv then return end
|
--if not rv then return end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
@ -532,7 +558,6 @@ local function process(process_opts, console_opts)
|
||||||
|
|
||||||
--verify flashfile is on the cart
|
--verify flashfile is on the cart
|
||||||
if verify then
|
if verify then
|
||||||
--for now let's just dump the file and verify manually
|
|
||||||
|
|
||||||
file = assert(io.open(verifyfile, "wb"))
|
file = assert(io.open(verifyfile, "wb"))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue