Thursday, November 2, 2017

Analogue Nt Mini - Jailbreak Firmware as a NES Flashcart and Dumper

In the first part of my series on the Analogue Nt Mini, I gave my thoughts on my first impressions of the device.  In this article, I will continue by diving into the features of the firmware that allow you to play NES games on your Nt Mini.  The jailbreak software adds many features to your Nt Mini, but here we will concentrate solely on the NES features.  Features related to other systems will be covered in another blog entry or two.


In order to play ROMs on the Nt Mini, you will need an SD card and the unofficial jailbreak firmware.  You can find it and the instructions on how to jailbreak the firmware here : http://atariage.com/forums/topic/242970-fpga-based-videogame-system/  It is really easy to jailbreak the firmware and the jailbreak firmware comes from the enginner behind the Nt Mini, so it is safe and will not void your warranty.  If you stick an SD card in the slot and turn the Nt Mini on, it will automatically perform the firmware upgrade and your console will be out of action for approximately three minutes.  Let the Nt Mini do its thing and do not panic (as I did initially) if you see the LEDs stop flashing for a while.  

Once you have updated, you will now have a Cores and a CopyNES option added to the main menu.  Navigating through the menu will be a bit different compared to the non-jailbroken firmware.  To start a ROM, go to the Core option, then select NES/Famicom and then the file browser will give you a list of files and folders in the \NES from which you can select.  

The time it takes to open a directory is directly proportional to the number of files in it.  If you want a quick loading time, keep the number of files in a directory in the double digits.  I like to alphabetize my NES ROMs so that I can get about 50-60 per folder.  Like the EverDrive, the Nt Mini will sort files alphabetically, but unlike the EverDrive there is no way to disable this function.  The file menu can display up to 30 characters for a file or a directory name, so if you want to distinguish between similarly titled ROMs, keep the names short.  

The time it takes to load a game can vary greatly depending on the size of the game and the mapper it uses.  A large game like Kirby's Adventure will take approximately six seconds to load.  There are certain mappers that require the loading of a second core.  MMC5 games need the second core, for example.  A game like Castlevania III takes approximately twenty-four seconds to load, even though it is not quite as large as Kirby's Adventure.  The first or standard NES core requires no additional time to load beyond the few seconds it takes to boot the console from its powered-down state.

The Nt Mini has several advantages over the previous NES Flashcarts, the NES PowerPak and EverDrive N8.  The most significant advantage is that it can run larger games.  The previous carts could run games no larger than 1MB of combined PRG and CHR ROM.  The Nt Mini can run 2MB combined games, so Action 52 and the Chinese hacks of Final Fantasy VII and Pokemon Yellow (and their translations) are now playable.  Large MMC5 hacks like Zelda: The Legend of Link, Super Mario All-Stars NES and Rockman 4: Minus Infinity also become playable with the Nt Mini (but see below).  

The Nt Mini can run the NES PowerPak and EverDrive N8 through the Run Cartridge option.  Both devices work well, although kevtris has stated that getting the EverDrive to work was extremely difficult due to the ways it likes to push the NES hardware to achieve fast loading performance.  The EverDrive will crash if you switch from analog to digital video or vice-versa, the PowerPak will not.  The EverDrive will also crash if you use the input feature on your monitor to change inputs, because to the Nt Mini this is a signal to switch to analog video mode.  

The only significant weakness of the Nt Mini's flash cart feature at present is its complete inability to run Famicom Disk System ROM games.  Kevtris has not yet found the time to implement the disk drive and memory loading portion of the device, even though the audio portion is present.  The Nt Mini will run games from a real Famicom Disk System, through a PowerPak or an EverDrive.  You can use the Nt Mini's FDS audio recreation, the FDS audio as it comes from the RAM Adapter or through the PowerPak or EverDrive.  I had no difficulty using an FDSStick with my RAM Adapter in the Nt Mini but one or two people complained of issues.  

One issue with the Nt Mini is that you have to pay more attention to your mapper headers than you may have had to with the PowerPak and EverDrive.  kevtris originally proposed the NES 2.0 header standard to account for differences in games that were unable to be distinguished in the old iNES 1.0 standard.  While the NES 2.0 standard has gone beyond his original proposal, the Nt Mini will recognize his original NES 2.0 assignments as given in the NES Release Notes.txt found in the jailbreak firmware.  There are a number of games that will not work properly unless you use the proper mapper number, and for NES 2.0, submapper number.  I have fixed many games with kevtris' guidance.  Don't expect kevtris' flashcart to run games with hardware not found in existing carts like the ancient and first Final Fantasy II translation which requires a  UNROM with battery backed S-RAM.  

Unfortunately, the No-Intro ROMs may be the gold standard for ROM dumping, but its handling of NES headers is slipshod.  No-Intro will give you a checksum of the ROMs found on a cartridge but does not address whether the 16-byte header attached to the ROMs is correct. If you need to fix a header, you can often use Nestopia UE and its database to point you in the right direction.  The NES Cart Database can be helpful, as can the NESDev wiki and my own "Canonical Famicom 3rd Party Licensed Mappers NES 2.0" spreadsheet found here : http://forums.nesdev.com/viewtopic.php?f=2&t=15803&p=199438

There is a ROM compiler named Smokemonster who has published many game packs containing proper ROMs.  Smokemonster made a ROM pack specifically for the Nt Mini, and while it is a good start, it does not contain many of the fixes described below to get certain games running correctly.  He tends to pack about 240 ROMs per directory, leading to longer file browsing times.  The file names are standard GoodNES or No-Intro names, many of which will overwhelm the 30-character per line limit of the Nt Mini's file browser.  

The Nt Mini supports a ton of mappers that the other flashcarts do not.  It also supports dipswitches for games that need them.  It does not have any save state functionality.  Unlike with cartridges, the Nt Mini will detect games which require expansion audio and will provide the expansion audio when the ROM loads.  With real cartridges you must turn the expansion audio on manually.  

Kevtris' mapper emulation is not always perfect.  MMC5 has some glitches but is superior to any other flash cart implementation.  RAMBO-1's IRQ's behavior is not correct in certain games because it is not known how exactly the IRQ counter works.  It is no worse than any other flashcart, however.  A few mappers or games were overlooked, but nothing terribly important :

Cartridges with Extra Hardware

Study Box – No cassette deck support (will never work)

Karaoke Studio + Karaoke Studio Senyou Cassette Vol. 1 & Karaoke Studio + Karaoke Studio Senyou Cassette Vol. 2 – Use Mapper 188, Submapper 1 (Karaoke Studio games require a microphone built into the game cartridge to work)

Datach Joint ROM System - Included a built-in barcode reader

Games that are not Working

Ancient Kings of Bandit China & Uncharted Waters – Too glitchy to play (MMC5)

Famicom Jump II: Saikyou no 7 Nin – Does not work either with Mapper 16 or 153

Hard Drivin' Proto – Too Glitchy to Play (Mapper 64)

Ice Climber VS Hack – Loads to blank screen, but works when loaded through an EverDrive.  Alternatively, you can run the FDS game, which is also a port of the arcade Vs. Ice Climber.

Mike Tyson's Punch-Out PlayChoice 10 Version – Crashes after first winning bout

Kaijuu Monogatari - Loads to a Blue Screen

Kaiketsu Yanchamaru 3: Taiketsu! Zouringen - Flashes and flickers constantly, a mapper hack here may fix it : http://thegaminguniverse.org/ninjagaiden4/mottzilla/

Games with Issues

Skull 'n Crossbones – Garbage scanline, menu selection box off by one line (Mapper 64)

Shin 4 Nin Uchi Mahjong: Yakuman Tengoku – Incorrect MMC5 PCM

Zelda – Legend of Link (both 2014 and 2017 versions) – Will not save correctly, I believe the older version was tested on real hardware. Another hack, Super Mario Bros. All-Stars NES, from the same hacker, "infidelity", also gave me save issues.

Famicom Disk System Audio – Missing certain sounds like door opening in Metroid. This is an issue in the most recent firmware.

Famicom games with speech chips require original cartridges to hear the speech.

Lagrange Point - Minor sound issue with VRC7 sound (release bit not implemented)

Donkey Kong Arcade Hack - An excellent port in progress of the arcade Donkey Kong to NES hardware which only supports the vertical screen mode, does not work through the Nt Mini's built-in flash cart.  It works with the PowerPak and EverDrive N8 and almost all flickering can be eliminated with the Nt Mini's 16-sprites per line option.  

Game Fixes

Cybernoid - Bus conflict glitches screen if you try to change to music, use the fix found here : http://nerdlypleasures.blogspot.com/2016/03/nes-powerpak-and-everdrive-n8-mapper.html, This game will glitch on an EverDrive but not a PowerPak.

Galaxian – Use the overdumped ROM

Goonies Vs. & VS. Castlevania Hacks – Set mirroring to vertical in the header

VS. TKO Boxing Hack – Set Mapper to 206 and mirroring to vertical in the header

Nintendo World Championships 1990 – Set Dip #2 in the Core Settings to get the official time, use the following page to get other times : http://kevtris.org/mappers/nes_custom/NES_EVENT.html (Dip ##4-7 are not used for this game)

PlayChoice-10 – Delete last 8,192 bytes in the ROM (which makes most PC-10 ROMs identical to their cartridge releases)

Captain Planet, Dirty Harry, Infiltrator, The Last Starfighter, Mad Max, Paperboy - If you can't seem to get any input in these games, plug in a microphone or turn the microphone sensitivity all the way down in the settings.  These games expect the controller port to return a specific value and the microphone interferes with the value they want.

Huge Insect will display moving graphical garbage on the right side of the screen where the aliens are positioned.  This is an issue with uninitialized VRAM, so it will appear on real hardware with a real cartridge, because real NESes and Famicoms do not initialize their VRAM to known values on startup.  Real cartridges of Huge Insect are very hard to find and were not widely released to the general public.  TheRedEye coaxed Sachen/Thin Chen to release a few batches of cartridges before it went out of business, and the game has a prototype quality.  The situation is not dissimilar to Cheetamen 2.  The EverDrive and PowerPak initialize RAM before starting a game to values that will result in the garbage not being seen when run through those cartridges.  You can eliminate the glitches by running another game which clears all VRAM but does not use the second half of the VRAM before running Huge Insect.  I found the NTF2 Test Cartridge will work.

Terminator 2 may not display the copyright screen when booted up, it starts at the title screen.  The EverDrive also will not display the copyright screen, but the PowerPak will.  This game relies on random values in RAM on startup to display the copyright screen.  For a similar reason, Minna no Taabou no Nakayoshi Daisakusen will fail to load on an EverDrive but will load on a PowerPak.  Although these games load on a PowerPak, I do not own the real cartridges, so whether they work on the Nt Mini on their own is an open question.  These can be fixed by running another game that will set the RAM to values that these games expect immediately before running these games.  I found Xexyz to be reliable for this purpose.

Mapper 185 Games - See here to fix these games to get them working on the Nt Mini : http://forums.nesdev.com/viewtopic.php?f=9&t=16722

Mapper Fixes

Death Race - Use Mapper 144

Startropics & Zoda's Revenge: StarTropics II - Use Mapper 4, Submapper 1

Datach Joint ROM Games – Use Mapper 157

Holy Diver – Use Mapper 78, Submapper 3

Major League – Use Mapper 32, Submapper 1

Tatakae!! Ramen Man: Sakuretsu Choujin 102 Gei & The Money Game – Use Mapper 155

Mindseeker – Use Mapper 19, Submapper 1

Quattro Adventure, Quattro Sports – Use Mapper 232, Submapper 1 (not 233 as stated in the NES Release Notes.txt)

Dragon Ball Z: Kyoushuu! Saiyajin, Magical Taruruuto-kun: Fantastic World!!, Magical Taruruuto-kun 2: Mahou Daibouken & SD Gundam Gaiden: Knight Gundam Monogatari – Use Mapper 159

The Best Play Pro Yakyuu Special & "Final Fantasy I & II" – Use Mapper 1, Submapper 4

Dragon Warrior III, Dragon Warrior/Quest IV, Ninjara Hoi! - Use Mapper 1, Submapper 1

Genghis Khan, Nobunaga's Ambition, Romance of the Three Kingdoms, Aoki Ookami to Shiroki Mejika: Genghis Khan, Nobunaga no Yabou: Zenkokuban, Sangokushi - Use Mapper 1, Submapper 2

Core Issues

An FPGA is only as useful as the person who programs it.  An FPGA cannot magically implement another complex chip, the functionality must be recreated.  The logic on an FPGA, which is CMOS, cannot implement the functionality of an NMOS part like the NES CPU or PPU on a 1-to-1 basis.   Not unlike an emulator, an FPGA recreation is only as accurate as the programmer can manipulate the logic.

Micro Machines requires functionality only found in NES PPUs that are rev. G or H.  This game will run and is quite playable on the Nt Mini but will display a flickering horizontal line on the right side of the title screen.  Famicoms and early NESes with a PPU of rev. E or below will show far more flicker and jumpy graphics on most of the menu screens.

Burai Fighter, U.S. version, will not display the lower half of the status bar.  The Japanese version will display the full status bar.  Young Indiana Jones will flash a frame of graphical garbage when the cannonballs fall to the ground in stage 1-2.  This is caused by a read or write to a particular PPU register ($2007) outside of rendering.

The PAL NES core has very distracting flickering that can cause color graphics to appear in B&W through the composite and S-Video modes.  It did not in jailbreak v1.7, so use that firmware if you want to play PAL games using these connections.

The NES core in HDMI, RGB and Component video have an issue where the first column of pixels on the left side have a blended color between the tile and the background color.  This does not appear in the S-Video or Composite modes.  You may not immediately see it because the default settings crop 1 pixel column on all sides.  You can see it in games that disable the left 8-pixels on the screen like Zelda 2, Super Mario Bros. 3 and Kirby's Adventure because then the 9th pixel column will show the blending.

The above are issues with the Core, not the mappers.  Given the near-flawless recreation otherwise, these are not big issues.

CopyNES

CopyNES functionality is included in the Nt Mini, and unlike the CopyNES board that installed inside NESes, the Nt Mini will work with an EverDrive.  CopyNES requires you to know the mapper of the game you wish to dump.  The best place to identify the mapper used is the NES Cart Database : http://bootgod.dyndns.org:7777/  100% of US and 80% of Japanese licensed games can be found here and PAL is also well-covered.  If you are trying to dump a PAL game which had an NTSC release, almost always the NTSC mapper will be used.  If you can't find your game in the database, look for a similar game released by the same company.  Dumping homebrews may involve a good deal of trial and error.  Each mapper will have a script file containing 6502 machine code telling the CPU to dump each bank of data.  If you can't find a script file, then you will need to write a script or find someone to write one for you.

Next Time

In the next segment on the Analogue Nt Mini, we will explore its ability to recreate other systems with the jailbreak firmware.  The jailbreak firmware includes well-known consoles like the Atari 2600 and Game Boy as well as obscure consoles like the Arcadia 2001.  We will explore their features and quirks.

5 comments:

Anonymous said...

Try playing (and saving) with that Super Mario Bros. All-Stars NES hack a few more times. I've found that it saves correctly sometimes, but wipes out all the saves other times, but maybe I just had bad luck.

Great Hierophant said...

I played that hack a little more and got glitches. I'm not sure if its the Nt Mini or the hack, but those two things don't like each other.

Anonymous said...

You forget to mention the lack of the FDS (and expansion audio?) low-pass filter due to hardware limitations.

Anonymous said...

Does this CMOS vs NMOS thing really matter that much? I think it's more interesting that you can even create drop-in replacement for CPUs using FPGAs: https://www.reddit.com/r/fpgagaming/comments/71neod/prince_of_persia_running_on_the_mcl86/

11numbers said...

I happen to own a PowerPak and a real Terminator 2 so I gave it a try. I first inserted the PowerPak, ran Terminator 2 and did see the copyright screen. Then immediately inserted Terminator 2, restarted, saw the copyright. Power cycled the NT Mini, ran Terminator 2 and got no copyright screen. I hope this was somewhat helpful.