chronosv2
New member
Hey there folks. Recently I obtained a flasher from Infinite NES Lives and went to use it with NESmaker, only to find things weren't working as expected.
Well, there's a reason for this: The firmware in the latest flashers is different from the ones that were used back when NESMaker was tested with the flasher. If you got a flasher earlier on, you probably have firmware that lets it just work. If you're a recent adopter of a dumper/flasher board, though, you may have been surprised by an error mentioning an opcode. I wasn't sure what was going on at first, but I was bound and determined to get it to work so I started tinkering. After downloading the latest flasher software I found it was configured to test N64 cartridge functionality. I edited the configuration and managed to get the cartridge to flash, only to be greeted by a grey screen both in emulator and on the console. Something was still wrong, and for the life of me I couldn't figure it out. So I gave up for a couple days, hoping 4.1 would come out and the problem would be solved. Seeing as 4.1 is currently delayed a bit I decided this morning I'd pick it up again and figure it out, and figure it out I did: As it turns out there's code in the flasher to skip the iNES header (the part of the file that tells an emulator how to run it) that works when it's passed a .nes file -- except the configuration was currently hard-coded to expect .bin files, so the first 16 bytes of my cartridge were an iNES header, which the console obviously doesn't have a function for and crashed. Knowing what was wrong I set out to find the errant code and fix it and here are the steps I took to get it working.
Note that this is somewhat advanced.
In your flasher package, your flasher should have been protected with bubble wrap and some cardboard. On my bit of cardboard I saw that my firmware version was written on it: 2.3.1. If you find you have this version (or any "2.3.x" version) read on -- otherwise you might need to get help from INL directly.
Here's the flasher I got for reference:
Firstly, we need the latest version of the dumper/flasher software.
You can get that from the INL GitLab project page here: https://gitlab.com/InfiniteNesLives/INL-retro-progdump
In the top right corner of the project's page you'll see three buttons: History, Find file, and a button showing a cloud with a down arrow. Click that cloud/arrow button and click Download Zip.
Once the zip is done downloading we'll need a few things from that file:
We need to unzip the WindowsDriverPackage folder to update our drivers, and we'll need the host and shared folders, because that's where the flasher software lives.
So let's unzip those to a temporary location, say in a "Flasher" folder inside your downloads folder. So then you'll have Downloads\Flasher with 3 folders:
Downloads\Flasher\WindowsDriverPackage
Downloads\Flasher\host
Downloads\Flasher\shared
Open the WindowsDriverPackage folder and update your drivers using InstallDriver.exe.
Next BACKUP the old host and shared folders in the NESmaker\flasher\INL-retro-progdump_map30 folder. We're going to be overwriting them and it's always smart to have the original files just in case something breaks.
Now copy the new host and shared folders over the old ones, replacing files if requested to.
From there we need to make a few edits to some files to make the flasher cooperate with NESMaker.
From this point on if you are not using a text editor with line numbers I highly recommend you download Notepad++, as line numbers will make this process a lot easier. Alternatively I will include the before and after versions of the line so you can search for the before version using your text editor's find function.
Make the following changes in NESmaker\flasher\INL-retro-progdump_map30\host\scripts\inlretro.lua :
Line 73:
Remove the "--" at the start.
Line 100:
Add "--" at the start.
Line 105:
Remove the "--" at the start.
Line 108:
Add "--" at the start.
Lines 121-123:
Change read to false, erase and program to true.
Line 128:
Change "ignore/flash.bin" to "game.nes"
Lines 138-140
Change mirror from "nil" to "V"
prg_rom_size_kb from "256 * 128" to "16 * 32"
chr_rom_size_kb from "8" to "0"
The change to chr_rom_size_kb may not be needed but I did it anyway since our boards use CHR-RAM, not CHR-ROM.
Save and close that file.
Make the following changes in NESmaker\flasher\INL-retro-progdump_map30\host\scripts\nes\mapper30v2.lua :
Line 412:
Add "--" at the start, place your cursor at the end of the line and hit enter to add a new line. Add the following line after the line you just commented out with "--":
When you're done line 412 and 413 should contain
This will change the software to check if the file is a .nes (ROM with iNES Header) or .bin (raw binary, no iNES header) file.
Once you're done doing this as long as the game being compiled is copied over "game.nes" (which it should be as that's how NESMaker works) the game should compile and flash onto the cartridge as expected.
I hope anyone stuck as I was finds this helpful, and happy cart-flashing!
Well, there's a reason for this: The firmware in the latest flashers is different from the ones that were used back when NESMaker was tested with the flasher. If you got a flasher earlier on, you probably have firmware that lets it just work. If you're a recent adopter of a dumper/flasher board, though, you may have been surprised by an error mentioning an opcode. I wasn't sure what was going on at first, but I was bound and determined to get it to work so I started tinkering. After downloading the latest flasher software I found it was configured to test N64 cartridge functionality. I edited the configuration and managed to get the cartridge to flash, only to be greeted by a grey screen both in emulator and on the console. Something was still wrong, and for the life of me I couldn't figure it out. So I gave up for a couple days, hoping 4.1 would come out and the problem would be solved. Seeing as 4.1 is currently delayed a bit I decided this morning I'd pick it up again and figure it out, and figure it out I did: As it turns out there's code in the flasher to skip the iNES header (the part of the file that tells an emulator how to run it) that works when it's passed a .nes file -- except the configuration was currently hard-coded to expect .bin files, so the first 16 bytes of my cartridge were an iNES header, which the console obviously doesn't have a function for and crashed. Knowing what was wrong I set out to find the errant code and fix it and here are the steps I took to get it working.
Note that this is somewhat advanced.
In your flasher package, your flasher should have been protected with bubble wrap and some cardboard. On my bit of cardboard I saw that my firmware version was written on it: 2.3.1. If you find you have this version (or any "2.3.x" version) read on -- otherwise you might need to get help from INL directly.
Here's the flasher I got for reference:
Firstly, we need the latest version of the dumper/flasher software.
You can get that from the INL GitLab project page here: https://gitlab.com/InfiniteNesLives/INL-retro-progdump
In the top right corner of the project's page you'll see three buttons: History, Find file, and a button showing a cloud with a down arrow. Click that cloud/arrow button and click Download Zip.
Once the zip is done downloading we'll need a few things from that file:
We need to unzip the WindowsDriverPackage folder to update our drivers, and we'll need the host and shared folders, because that's where the flasher software lives.
So let's unzip those to a temporary location, say in a "Flasher" folder inside your downloads folder. So then you'll have Downloads\Flasher with 3 folders:
Downloads\Flasher\WindowsDriverPackage
Downloads\Flasher\host
Downloads\Flasher\shared
Open the WindowsDriverPackage folder and update your drivers using InstallDriver.exe.
Next BACKUP the old host and shared folders in the NESmaker\flasher\INL-retro-progdump_map30 folder. We're going to be overwriting them and it's always smart to have the original files just in case something breaks.
Now copy the new host and shared folders over the old ones, replacing files if requested to.
From there we need to make a few edits to some files to make the flasher cooperate with NESMaker.
From this point on if you are not using a text editor with line numbers I highly recommend you download Notepad++, as line numbers will make this process a lot easier. Alternatively I will include the before and after versions of the line so you can search for the before version using your text editor's find function.
Make the following changes in NESmaker\flasher\INL-retro-progdump_map30\host\scripts\inlretro.lua :
Line 73:
Code:
--local curcart = require "scripts.nes.mapper30v2" --has things required by v2.3.1
Code:
local curcart = require "scripts.nes.mapper30v2" --has things required by v2.3.1
Line 100:
Code:
local curcart = require "scripts.n64.basic"
Code:
--local curcart = require "scripts.n64.basic"
Line 105:
Code:
--local cart_console = "NES" --includes Famicom
Code:
local cart_console = "NES" --includes Famicom
Line 108:
Code:
local cart_console = "N64"
Code:
--local cart_console = "N64"
Lines 121-123:
Code:
read = true,
erase = false,
program = false,
Code:
read = false,
erase = true,
program = true,
Line 128:
Code:
flash_filename = "ignore/flash.bin",
Code:
flash_filename = "game.nes",
Lines 138-140
Code:
mirror = nil, -- Only used by latest INL discrete flash boards, set to "H" or "V" to change board mirroring
prg_rom_size_kb = 256 * 128, -- Size of NES PRG-ROM in KByte
chr_rom_size_kb = 8, -- Size of NES CHR-ROM in KByte
prg_rom_size_kb from "256 * 128" to "16 * 32"
chr_rom_size_kb from "8" to "0"
The change to chr_rom_size_kb may not be needed but I did it anyway since our boards use CHR-RAM, not CHR-ROM.
Code:
mirror = "V", -- Only used by latest INL discrete flash boards, set to "H" or "V" to change board mirroring
prg_rom_size_kb = 32 * 16, -- Size of NES PRG-ROM in KByte
chr_rom_size_kb = 0, -- Size of NES CHR-ROM in KByte
Save and close that file.
Make the following changes in NESmaker\flasher\INL-retro-progdump_map30\host\scripts\nes\mapper30v2.lua :
Line 412:
Code:
local filetype = "bin"
Code:
local filetype = string.sub(flashfile, string.len(flashfile)-2)
When you're done line 412 and 413 should contain
Code:
--local filetype = "bin"
local filetype = string.sub(flashfile, string.len(flashfile)-2)
This will change the software to check if the file is a .nes (ROM with iNES Header) or .bin (raw binary, no iNES header) file.
Once you're done doing this as long as the game being compiled is copied over "game.nes" (which it should be as that's how NESMaker works) the game should compile and flash onto the cartridge as expected.
I hope anyone stuck as I was finds this helpful, and happy cart-flashing!