2.3.x Firmware Flasher? Here's how I got flashing to work.

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
Post Reply
User avatar
chronosv2
Posts: 256
Joined: Wed Aug 08, 2018 9:30 pm
Location: KY, USA
Contact:

2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by chronosv2 » Thu Dec 27, 2018 6:50 pm

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:
1222181026.png
1222181026.png (737.11 KiB) Viewed 5600 times
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: Select all

--local curcart = require "scripts.nes.mapper30v2"	--has things required by v2.3.1
Remove the "--" at the start.

Code: Select all

local curcart = require "scripts.nes.mapper30v2"	--has things required by v2.3.1
Line 100:

Code: Select all

local curcart = require "scripts.n64.basic"
Add "--" at the start.

Code: Select all

--local curcart = require "scripts.n64.basic"
Line 105:

Code: Select all

--local cart_console = "NES" 	--includes Famicom
Remove the "--" at the start.

Code: Select all

local cart_console = "NES" 	--includes Famicom
Line 108:

Code: Select all

local cart_console = "N64"
Add "--" at the start.

Code: Select all

--local cart_console = "N64"

Lines 121-123:

Code: Select all

read = true,
erase = false,
program = false,
Change read to false, erase and program to true.

Code: Select all

read = false,
erase = true,
program = true,
Line 128:

Code: Select all

flash_filename = "ignore/flash.bin",
Change "ignore/flash.bin" to "game.nes"

Code: Select all

flash_filename = "game.nes",
Lines 138-140

Code: Select all

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
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.

Code: Select all

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: Select all

local filetype = "bin"
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 "--":

Code: Select all

local filetype = string.sub(flashfile, string.len(flashfile)-2)
When you're done line 412 and 413 should contain

Code: Select all

--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!
ASM/C# Coder -- Computer + Coffee = Code
ASM Tutorial Series
My NES development projects have, for the time being, stagnated. I apologize for the inconvenience.
User avatar
Redherring32
Posts: 455
Joined: Sat Aug 11, 2018 2:48 pm
Location: Usa

Re: 2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by Redherring32 » Thu Dec 27, 2018 8:19 pm

Unfortunately, most of the issues are from the "mini flasher".
My current WIP game: Shadow: An Adventure In Monochrome, you can also find me over at the Community Discord.

Open Source NES Motherboard
User avatar
dale_coop
Posts: 5408
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: 2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by dale_coop » Thu Dec 27, 2018 10:31 pm

Thanks, chronosv2. I will give it a try with this updated version of the flasher.
I have almost the same board than yours (except mine has just the NES port).
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
My son's game: KUBO 3
User avatar
Artix
Posts: 19
Joined: Wed Nov 21, 2018 3:41 am
Location: Tampa, Floridas
Contact:

Re: 2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by Artix » Sun Dec 30, 2018 9:26 am

Chronosv2,

Thank you! (X 9001)

I have spent hours banging my head against my keyboard trying to get any part of the ROM Flasher working. I followed you instructions, and it worked! Tonight I had the incredible experience of playing my project for the first time on my childhood NES. Thank you for taking the time to make your detailed, and perfect post. You are awesome!!

To anyone else running WINDOWS and having problems getting their NES Cartridge maker working who were as completely bewildered as I was to the process... here are important things I learned:

1. I wanted to make a NES Cartridge
2. I missed the Kickstarter... and bought the NES Maker software from the website.
3. I bought a "blank" NES Cartridge & USB ROM Flasher from INL (Infinite NES Lives) on their website at https://www.infiniteneslives.com/nesmaker.php
4. It did not come with any instructions O_O
5. On the back it read INL Retro Programmer Dumper v2.0 -- which was the only way I knew what it was X_X
6. You have to install drivers for it. But there are no clear instructions on the website...
7. There are instructions buried beneath 2 sub-folders of the NES MAKER. First, go to the /Flasher/ directory. It contains two more directories. Inside the INL_KazzoFlasherDrivePackage you will find the drivers and the instructions. Note that these are out of date and you should follow Chronosv2's instructions above to get the correct ones. The other director, INL-retro-progdump_map30, is the one that actually does all the work when it is time to make a NES cartridge-- this directory contains an important Readme.txt for getting the ROM Flasher to Work.
8. I faced a lot of challenges installing the drivers. For example, there was no InstallDriver.exe file in my folder. The instructions said to create one by running dpscat.exe and then the re-pack-files.cmd file. This requires downloading and installing a compression program called 7-Zip. But I only got the bad switch parameter error message. Ultimately, I followed Chronosv2's instructions above.... I manually ran the dpinst64.exe file to install the 64 bit drivers.
9. If you find the drivers are unsigned, then this helpful video shows how to install unsigned drivers on windows 10: )
8. There are a lot of things you need to set up to get it to work. The instructions are currently a weeeeee bit complicated, and sometimes... do not work (mostly a result of hardware and software changes since it was written). This is the glorious honor & burden of being a part of Beta. What is hard now will undoubtedly become easy in the future.
9. You need to install a C++ compiler program called MinGW. The instructions NESmaker_4_0_11_Platformula\Flasher\INL-retro-progdump_map30\Readme.txt give instructions on what parts you need to install
10. To make it work with NES Maker, you have to edit the PATHS parameters in your System Properties / Advanced / Environment Variables thingy. Easy to do after you spent 30 minutes trying to figure out where it is in Windows 10 X_X. You just have to click the "new" button to add a new one to the list. I remember PATHS from when I was a kid using MS DOS. Adding directories to this tells your computer that "any time someone tries to run a program, see if that program happens to exist in this directory and then just run it."
12. You will also need to install and setup LUA. The things they talk about in the ReadMe.txt file are actually things you have to type in to a command prompt to set up. You can open a command prompt by typing cmd into your windows programs search bar-- it will show up as the program "Command Prompt". If you made your LUA directory c:/lua like I did, you can type "cd c:/lua" into the command prompt and it will take you straight to that directory. Then you can type in all of the commands from the Readme.txt
13. You also need to install WinAVR. This software has not been updated in over 6 years and I read some scary comments about it messing up their PATHS. When you install it you can uncheck the box that has it modify PATHS... then you can just do it manually like you did for the other program. Again, all of the instructions for doing these steps are in NESmaker_4_0_11_Platformula\Flasher\INL-retro-progdump_map30\Readme.txt
14. Finally, I was sure my NES Cartridge maker was hooked up and working because I opened my Device Manager and saw it listed under "libusb-win32 usb devices" as INL Retro-Prog.
15. Then it magically worked.
16. Seeing your game running on your NES is a legit life achievement.

Battle on!
Artix
User avatar
dale_coop
Posts: 5408
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: 2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by dale_coop » Sun Dec 30, 2018 11:42 am

I realize I might just have been very lucky, the process was very easy for me... I just did a right on my kazzo-usb in the device manager, updated drivers with the ones from the flasher/drivers folder from NESMaker.
And I could directly make my cart from NESMaker.

PS1: I have not the new model. Mine is bigger (like chronosv2 one).
PS2: INL provide a new flasher folder (zipped) for the ones who have the new (small) dumper/flasher... here: https://www.dropbox.com/s/oj2n2wvach8dg ... r.zip?dl=0
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
My son's game: KUBO 3
User avatar
chronosv2
Posts: 256
Joined: Wed Aug 08, 2018 9:30 pm
Location: KY, USA
Contact:

Re: 2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by chronosv2 » Sun Dec 30, 2018 2:05 pm

I'm glad people are getting their flashers to work, and I'm glad my instructions are proving to be helpful.

I think Firmware 2.3.1 is functionally incompatible with earlier versions, and a lot of the work INL have been doing with the cartridge lately involves dumping data from carts on all the supported ports, so the GitLab project shows things as they last committed them from that testing. That's why the LUA files I point out need to be changed the way I did -- they were testing it with N64 cartridges so they had it set to dump data from those, and in the Mapper30v2 file they were doing lots of their testing with .bin cartridge images so that's why it was set to just treat files as bin. I'm really actually quite glad that through all my tinkering I didn't damage my cart or my NES testing the flasher because the system was trying to load code from the iNES Header -- which isn't code, it's data at the start of the cartridge to tell emulators how to run it! (Though I guess an invalid command would be more likely to make the system lock up than do any actual damage.

I'm going to download the new driver/flasher package Dale shared and compare it with what I downloaded and edited-- it'd be really cool if most of the changes I've made are already made there. That would make everyone's work a ton easier!

Edit: Looks like the updated ZIP sets the new version of the flasher software to flash for 2.3.1 boards, but has the Mapper30v2.lua file hard-coded to specifically treat files as .NES, which is fine since that's what NESMaker exports. My edits were designed so that if you, for whatever reason, had a .bin to flash from outside of NESMaker you could do that too.

Still nice to see that there should be an easier solution out there than mine now with that zip file!
ASM/C# Coder -- Computer + Coffee = Code
ASM Tutorial Series
My NES development projects have, for the time being, stagnated. I apologize for the inconvenience.
User avatar
marp
Posts: 38
Joined: Wed Feb 13, 2019 12:46 pm
Location: Sweden
Contact:

Re: 2.3.x Firmware Flasher? Here's how I got flashing to work.

Post by marp » Thu May 02, 2019 9:00 am

I have a v1.2 flasher from 2014, haven't received my kickstarter one yet =(. But this thread saved my day understanding the settings and together with a firmware update made it work. Thank you so much! =)
Post Reply