Tuesday, June 30, 2015

Disappointing Use of Licenses in NES Games

Often, when a video game relied on a licensed character or movie, the results often were terrible.  It is as if so much of the budget was taken up by the licensing fees that there was nothing left over to make a good game or hire good programmers.  Most games based off movies are garbage on the NES, no one particularly enjoys having to play through Total Recall, Predator or Hudson Hawk.  Many of those games were released by LJN or Acclaim, but picking on them is rather like picking the low hanging fruit.

Instead, I am going to focus on games from developers or publishers with a proven record of good games.  My criteria for this blog entry is that the license has to come from another type of media, whether a film, a TV series, a cartoon, a toy line, a comic book or a novel

Konami :

Monster in My Pocket
This is a decent game, but when dealing with Konami, decent just doesn't cut it.  While you have two characters you can play as, they aren't really all that different.  This side scroller does not have any substantial flaws, but there is nothing especially memorable about it.

Star Trek 25th Anniversary
When I play this game, I get the feeling like it so wants to be the PC game of the same name.  This is not surprising because Interplay was responsible for both.  The NES game takes some elements of the classic PC adventure game like having crew members on the away team with different strengths and each officer on the bridge having his or her own position.  However, the top down exploration stages with constantly respawning hidden enemies and maze-like environments does not feel very Star Trek 25th-Anniversary like to me.

Teenage Mutant Ninja Turtles
Where do I begin?  TMNT may have sold well but only because the Turtles craze was just beginning to establish itself.  This game does have a certain Konami polish to the graphics and music, but the game is way too unfair.  Enemies constantly respawn, there is laughable recovery time after being hit, the turtles have a huge hit area and except for Donatello their weapons do pathetic damage to their enemies.  There are tricky jumps and the play control is a tad too loose.  Flicker is all over the place.

The next two TMNT games for the NES are much better than this.  I always get the feeling that with this first game, Konami really did not "get" the Turtles.  While most of the elements that had been established by 1987 were there, the resulting game did not feel like an adaptation of the cartoon series, which was the catalyst and the focus of the phenomenon for the next several years.  The moody music and outlandish enemy designs feel like they came more from the original comic than the cartoon.

I understand that the developers had little to work with, only elements from the comic book and season one of the animated cartoon were available as reference materials.  However, the arcade game of Teenage Mutant Ninja Turtles was also released in 1989 and does not feature any material beyond season one, yet that game was able to capture the spirit of the franchise admirably.  Looks like Konami gave the NES game to the "B Team".

Top Gun I & II
Most NES flying games are not especially memorable, and these are no exception.  One of the main problems are the endless hordes of indistinguishable enemies.  The NES simply did not have the horsepower for anything more than rail-shooters, so these games don't offer you any real freedom.  The first game has some of the most annoying landing sequences ever found in a video game and you cannot seem to turn fast enough to attack enemies.  The second game overcompensates by having too sensitive controls and enemies that fly by too fast to hit.

Sunsoft :

Fester's Quest
While Sunsoft appeared to adapt the overhead view of Blaster Master for this game, that was about the only smart thing they did with the title.  The Addams' Family is little seen and the Addams Family Mansion is reached only far into the game.  The enemies constantly respawn and your gun and whip do little damage.  A turbo controller is required to really play.  Instead of losing gun or whip power when you get like Blaster Master, you lose it by touching gun and whip downgrades, which become more common as you power them up and are surprisingly easy to touch.  Fester moves slowly, and if he gets hit by the flies, his movement rate gets far worse until he finds some shocks.  You have a tiny lifebar and the bosses take a long time to beat.  You find bosses in these buildings with featureless 3-D Mazes, something I always hated on the NES.  There is almost nothing of the quirky macabre humor which the Addams Family was known for.

This was a port of a Commodore 64 game, and while its not as bad as the port of Myth to Conan, the original game just isn't that good.  The game is essentially a collection of mini-games, and usually in 8-bit land the sum is not the greater of its parts when it comes to different gameplay styles being combined in a cartridge.  The first stage is a maze of finding objects, but most of the time you are simply trying to avoid dead ends.  You are easy to hit, there are hard to see traps and bullets, and enemies can be unavoidable.  The music is appropriately moody, but the backgrounds just appear to be shades of brown.  The second stage is something like a 3-D maze, but at least it has something like a map.  I never bothered to get past the second stage.

Capcom :

Disney's Adventures in the Magic Kingdom
As with Platoon, noted above, this is another collection of mini-games.  The platforming in the Haunted Mansion is passable, but Space Mountain feels like Dragon's Lair with the "press the right button at the right time mechanic."

Capcom made six games based off Disney TV franchises, and five of them (Ducktales 1 & 2, Chip 'N Dale 1 & 2, Darkwing Duck) were great.  This one, while a decent game, is not great.  Its a shump and has a certain amount of distinctiveness in that there are horizontal and vertical scrolling portions in the same level and that you can fly forwards and backwards.  However, the chief issue is that the scale is wrong, the characters and enemies are too small to be really distinctive.  Also, your character moves too slowly and his default gun is hard to aim diagonally, does little damage and upgrades are not plentiful.

Pony Canon/FCI :

Advanced Dungeons and Dragons : Heroes of the Lance
Pony Canon/FCI could usually be counted on for reliable, if not spectacular ports of PC games, but this one is where they utterly failed to release a playable game.  Heroes of the Lance is based off the Dragonlance Saga series of novels and AD&D campaign setting from TSR  The object of the game is to take a party of eight heroes into a dungeon to recover a magic item.  It was released first for PCs and then got a NES port.  Whatever virtues the underlying game had, and they seem pretty sparse, were totally lost in translation.

This game has virtually no redeeming features.  The in-game graphics suffer from being too small in relation to the background.  The status menu takes up half the screen.  The character sprites have so little detail and the backgrounds are just drab gray and black.  The music is the same monotonous piece that seems to play throughout the game.  There are only three types of enemies when you first start, a fighter, a dwarf and a lizard-creature.  The latter two are both unfair, the dwarf attacks lower than you normally do, making him hard to hit.  The lizard creature shoots projectiles at chest height and impossible to dodge.  By the time you close in to melee with him, one of your characters may be dead.  The control scheme and hit detection must have been devised in Hell, the very act of attacking is a chore.  When you close into attack range, you can hold down the B button to attack, but it rarely registers a hit on a monster regardless of how close you are.  Your characters move and attack so slowly.  You can run by holding down a directional.  Jumping across chasms is pretty much accomplished by luck.

This game has battery backed memory for saving games, but considering how awful this game is, it is a waste.  There were far many better games more deserving of a battery save than this piece of garbage.

Kemco :

The Bugs Bunny Crazy Castle
This originally was a Roger Rabbit game when it first appeared on the Famicom Disk System, but Kemco only held the license in Japan so it did a graphics makeover using Bugs Bunny and Looney Tunes characters when it was released.  This game is very monotonous, with the same music playing over and over and very few environment changes.  Weirdly, most of the enemies are differently colored Sylvesters with occasional appearances of Yosemite Sam, Daffy Duck and Wile E. Coyote.  However, in the original game, the Sylvesters were the Weasels, of which there were four in the movie.   You cannot really stop yourself going in and out of doors and down an incline or scroll the screen to see what is just outside your view, leading to many cheap deaths.

The Bugs Bunny Birthday Blowout
This game is more ambitious than Kemco's previous offering, but its far easier than you would expect.

Superman never had a great reputation for spawning great video games, and this one is almost as bad as the N64 title.  Super-deformed characters and pastel graphics remind me of the Atari 2600 title, which was no classic.  The music is nothing you will be humming in the shower either.  Superman in this game can use several powers, but for only a very limited number of times unless you find a way to replenish each special power bar.  He default attack is a punch, but the punch has no animation that tells the player the range of the attack.  How close do you have to be to an enemy?  It is hard to say.  Of course, the enemies you first encounter shoot at you, and as either Clark Kent or Superman you are quite vulnerable to bullets.  You jump almost to the top of the screen as either Clark or Superman. It does not take too much punishment to kill Superman, enemies can damage you even by touching and when they die they will often release an item that will reduce your life.  The game gives you virtually no guidance on what you need to do.

Data East :

Captain America and the Avengers
As far as superhero games go on the NES, this may be the best of the bunch that is not part of the Batman franchise.  You can play as Captain America or Hawkeye, but the two are not really that different.  Captain America has a more limited range than Hawkeye shield comes flying back and he jump higher, but otherwise there is little else to distinguish the two.  The main issue is that the play control is stiff.  Graphics are okay, but the music is bland.  Compared to X-Men, Silver Surfer and Spider-Man, this is probably the high water mark for Marvel Comics-based NES games, but that is damning with faint praise.

Taito :

Indiana Jones and the Last Crusade
Weirdly, both Taito and Ubisoft released games based off the film Indiana Jones and the Last Crusade.  They could not be more completely different.  Ubisoft's version was atrocious and looks like a port from the ZX Spectrum.  However, Ubisoft doesn't have a reputation for NES classics, Taito does, but not judging by this game.  The graphics are small and hard to distinghuish.  The game is very monochromatic with brown and gray hues throughout.  Trying to digitize real life photographic images never works on the NES, the palette color restrictions make it almost impossible to do well.  The music, after a passable rendition of John Williams' music from the film, but otherwise it is pretty nondescript.

The gameplay reminds me of the PC game Bruce Lee, where you run back and forth trying to avoid bad guys, but having to fight them if you cannot.  In fact, the Cross of Coronado level requires you to beat a certain number of them before you can acquire the cross.  Fighting bad guys is just a button mash and many of them take lots of hits and inflict lots of hits on you.  There are also overhead racing sequences like Spy Hunter and a timed puzzle with the move the blocks with one empty block.  You are quickly given choices of what you can do, but in order to complete the game, you have to beat all stages.

Rare :

Who Framed Roger Rabbit?
Rare is known for some good NES games, although all its games during this period were published by third parties.  Unfortunately, Roger Rabbit's official NES game is no better than what was done with Bugs Bunny's Crazy Castle.  Roger Rabbit is an adventure game where you collect items to overcome obstacles and there are lots of items to collect.  The most important objects are the four pieces of Marvin Acme's Will, scattered across four areas of Los Angeles.  Most items unfortunately only have a limited number of uses and replacements are hard to come by.  That is because almost all the items in the game are completely randomized when you start a new game.  You can go around the four areas of the game world and talk to people, but most are unhelpful.  You have to protect Roger, who is otherwise useless, from the Weasels.

Some items allow you bypass obstacles, rattles get you past rattlesnakes, a rose lets you talk to Jessica Rabbit, and TNT and a Detonator lets you break the barrier to the Toontown tunnel.  Others like the gun and exploding cigars, are more useful as weapons.  You shouldn't go into caves without a flashlight, rattles and spring boots.  You can find and ride Benny the Cab, which is far faster than walking across L.A. If you encounter weasels, you have a limited amount of time to select the punchline to a joke or they capture Roger and you lose a life.  You also lose a life if you get run over, fall into a pit or get bumped too many times and lose your sense of humor.

The graphics and music for the game is pretty appropriate.  Unfortunately, you will have a hard time from keeping from bumping into things like cats and dogs.  They can bump you while you are searching drawers and desks for items or talking to people and you cannot move to avoid them while you search or talk  Also, defeating Judge Doom at the end of the game will have you throwing your controller at the screen.

Mostly, this game is about constant searching, everywhere, for everything.  There is little sense of progression, just doing the same thing over and over and over again.  It takes seemingly forever to search desks and cabinets, and the game has lots and lots of them. The people can sometimes tell you if the building has items in it. The maps reuse the same tiles over and over, making it easy to get lost.  The items are mostly randomized, which may have worked in Atari's Adventure when there were only six, but not when you need to collect almost two dozen.  Finally, the game gives you three lives and two continues, but when you lose those continues, you have to start over from the beginning.   The game has a 22 digit password, but as a final kick in the teeth, you have ONLY 45 SECONDS to write it down.

Saturday, June 27, 2015

NES Hardware Explained

Hardware :

The basic Famicom/NES consists of a 40-pin Central Processing Unit (CPU), a 40-pin Picture Processing Unit (PPU), two 2KB Static RAMs, and six standard logic chips.  The front loader NES also contains a lockout chip and an extra standard logic chip, but they are not integral to the console's function except as a security measure.  Every NES has 2x7pin controller ports, a power button and a reset button and an RF modulator.  Front loaders also have composite video and (mono) audio outputs.  A very few rare Top Loaders have a Nintendo Multi-out port instead of an RF modulator.  The last top loaders with improved picture quality (RF or Nintendo Multi-out) use a newer motherboard that consolidates three of the standard logic chips into a Nintendo custom chip.

There were also rare devices that Nintendo released that used NES cartridges.  These include the Sharp Nintendo Television, which was a 13 or 19" TV on top of a front loading NES.  There also was the M82 Demonstration Unit that could hold 12 NES cartridges and allow for timed play in stores.

The NES power adapter is a step down converter that converts 120VAC or 240VAC into 9VAC and 1.3A.  AC to DC conversion is done inside the console.  A DC power adapter with a suitable plug can also be used so long as the step down specs are met.  Polarity of the AC adapter's connector is irrelevant.

The RF switch is an autoswitching type, meaning that there is no TV/Game switch on it as there were with older consoles.  When the NES turns on, it sends a signal of sufficient strength to automatically switch from the TV video signal to the NES video signal.  You can use a TV/Game switch if that is all you have available.

Specifications :

CPU - 2A03 running at 1.79MHz (NTSC) or 2C0 7  running at 1.66MHz (PAL).  The 2A03 contains a full 6502 CPU core with all unofficial opcodes but with a disabled decimal mode.

CPU Internal Memory - 19 Audio Processing Unit (APU) Registers, 2 I/O Registers, 1 Sprite DMA register

CPU External Memory - 2KB CPU RAM in the console + 32KB ROM and 8KB (optional) RAM in cartridge*

PPU - 2C02 running at 5.37MHz (NTSC) or 2C07 running at 5.32MHz (PAL).  The PPU can access 2 sets of 256 tiles for background and sprite graphics.  It can assign up to three distinct colors for a background or sprite tile.  Each set of 16x16 background tiles displayed on the screen must share the same palette settings.  The PPU is capable of scrolling horizontally and vertically by one pixel for smooth scrolling.

PPU Internal Memory - 8 Control Registers + 256 bytes + 32 bytes + 25 bytes

PPU External Memory - 2KB PPU RAM in the console + 8KB ROM and/or RAM in cartridge*

* - Limits without bankswitching hardware

PPU Resolution and Frame Rate : 256x240@60.0988fps (NTSC)/50fps (PAL), 224 lines typically viewable

Number of Colors in Palette : 54 distinct entries (out of 64) x 8 combinations of color emphasis bits = 432 colors

Number of Colors on-screen : 25 (1 Universal Background Color + 12 Background Palette Colors + 12 Sprite Colors)

Number of Sprites : 64 at 8x8 resolution or up to 32 at 8x16 resolution

Number of Sprites per Line : 8

Number of Audio Channels : 5 (2 x Pulse, Triangle, Noise, PCM)

APU Features : Variable duty-cycle rectangular waves (12.5%, 25/75%, 50%) for the two pulse channels, independent timers for all channels and length counters (automatic shut off) for first four channels, frame counter, volume envelope for pulse and noise channels, sweep unit for pulse channels, short and long noise mode (short mode only available on 2A03E or higher CPU revisions), 7-bit PCM samples or 1-bit Delta Modulation, internal mixer for the two pulse channels on one output pin and the triangle, noise and PCM on another output pin.  

Standard Controller : 4-way directional pad and 4 buttons, digital latched serial bitstream interface

Cartridge Features :

Number of Games with extra Work RAM : 89

Number of Games with battery backed Work RAM : 54 (out of 89)

Number of Games with extra CHR-RAM - 3

Smallest NES Cartridge Size : 24KB

Typical Cartridge Sizes : 24KB, 32KB, 40KB, 48K, 64KB, 96KB, 128KB, 160KB, 192KB, 256KB, 320KB, 384KB, 512KB

Median Cartridge Size : 256KB

Largest NES Cartridge Size : 768KB Licensed, 2MB Unlicensed

Most Common Memory Controller hardware : MMC1

Number of games using hardwired Horizontal Mirroring - 86

Number of games using hardwired Vertical Mirroring - 209

Number of games using hardwired One Screen Mirroring - 32

Licensed Game PCB Manufacturers : Nintendo, Konami (14 games), Acclaim (15 games), Virgin Games (1 games), Sunsoft (1 games).

Graphics Basics :

The NES uses a complex scheme to draw graphics.  The 2KB of internal PPU RAM holds two name tables and the attribute tables for the background graphics.  Each byte entry in a 32x30 name table points to an 8x8 graphics tile in CHR ROM or CHR RAM in the cartridge and tells the PPU to display that tile at a certain place on the screen.  Each byte entry in the attribute table selects the background palette entries that each set of 16x16 tiles will use.  There are four sets of palette entries consisting of three colors chosen from the 54 colors the NES usually displays and the universal background color.  This creates the background graphics.

The PPU RAM has space for two name tables and attribute tables.  The typical use for two sets of background graphics is to aid in scrolling.  One of the more impressive capabilities of the NES compared to earlier consoles is that it can scroll smoothly one column or line of pixels at a time, even though its graphics are tile based.  Many NES cartridges can be wired so that the graphics pages can be mirrored horizontally or mirrored vertically.  When the pages are mirrored vertically, scrolling the game horizontally becomes easier. Likewise, when the pages are mirrored horizontally, scrolling the game vertically becomes easier.  Games that scroll both horizontally and vertically like Metroid or scroll diagonally like Bionic Commando typically have hardware to allow for fast mirroring changes in software.  Two games add an extra 2KB of PPU RAM on the cartridge to allow for four pages of background graphics.

Sprites are controlled by a special 256 byte memory area internal to the PPU called Object Attribute Memory (OAM).  Each 8x8 sprite uses 4 bytes of the memory area, and the bytes select the tile to be displayed from the cartridge's CHR ROM or CHR RAM to represent the sprite, the X and Y coordinates on the screen where the sprite is to be displayed, which of the 4 palettes of 3 color the sprite will choose for color and whether the sprite is to be flipped horizontally or vertically.  Each sprite palette has a transparency color by which you can see the background graphics through clear pixels.  Typically, the CPU writes the values for all 64 sprites at a time.  There is also a special buffer that is not accessible by the CPU of 32 bytes which represent the data for the 8 sprites allowed on a line at a time.  When there are more than 8 sprites on a line, the PPU cannot display them all, resulting in flickering.

How the CPU Controls the System :

The NES is almost unique among consoles up to that point because it uses a dual bus design.  The CPU has its own address and data bus to its internal RAM and the cartridge PRG ROM and (if any) PRG RAM.  The PPU has a separate address and data bus to access its internal RAM and the cartridge CHR ROM or CHR RAM.  The CPU reads and writes data to memory locations in its memory map assigned to the APU and PPU.  These locations correspond to the APU and PPU registers and the input from the controllers.

Even though the PPU has its own address and data bus, it is told what to do by the CPU, it does not have its own specialized instruction set like a true coprocessor.  The CPU can read and write to memory anywhere in the PPU's memory addressing space.  When a cartridge uses CHR RAM instead of CHR ROM, it is up to the CPU to write the graphics data to fill the CHR RAM with graphics patterns.  This adds some flexibility at the cost of some speed and about 200 games use CHR RAM instead of CHR ROM (a couple use both).

Bankswitching Basics :

The NES's CPU can only handle 32KB of ROM at a time.  Similarly, the NES's PPU can only handle 8KB of ROM or RAM at a time.  Soon after the NES was introduced, ROM sizes on cartridges expanded beyond the combined 40KB that the NES was capable of accessing.  The NES had to use extra hardware inside the cartridge to switch in and out areas of ROM outside the 32KB and 8KB addressing limits.  With simple logic chips, it was possible to bankswitch additional PRG ROM, CHR ROM or both.  Typically, for PRG ROM, there would be a fixed 16KB bank and a switchable 16KB bank, with the game's kernel being held in the fixed bank.  Thus, for a game with a 128KB PRG ROM, there were 7 switchable banks.  This allowed for larger, more complex games with more music.  With CHR ROM, the simple schemes would switch the whole 8KB at a time.  A game with 32KB of CHR ROM could have 8 tilesets instead of the usual 2.  Games did not typically bankswitch CHR RAM or PRG RAM, but exceptions exist.

Adding extra logic chips made cartridges more difficult to manufacture and could have overwhelmed Nintendo's manufacturing capacities.  Nintendo created VLSI memory mapping controller chips to consolidate the functions of many simple logic chips into one chip.  The first of these was called the MMC1, and it allowed for bankswitching PRG ROM and CHR ROM, allowing for PRG ROM and PRG RAM to coexist and allowing the mirroring to be changed by the MMC1 at will.  By adding a battery to the PRG RAM, games could be saved after the console had been powered off, this is how The Legend of Zelda works.  Eventually more complex MMCs would be released, many of which only saw use in a handful of games.  MMC1 is the most common VLSI controller and can typically handle 256KB of PRG ROM and 128KB of CHR ROM and 8KB of PRG RAM.  There are NES MMC1 games that sacrifice CHR ROM bankswitching to bankswitch 512KB of PRG ROM or 16KB of PRG RAM.

The success of the NES increased the demand for more complex MMCs.  Nintendo released the MMC3 chip, which was found in games like Super Mario Bros. 3 and almost as many games as the MMC1.  The MMC3 could do all the MMC1 and more, it could bankswitch PRG ROM and CHR ROM in smaller memory slices, it could be accessed faster than MMC1, address more ROM and it had a scanline IRQ counter for easily splitting the screen between a main action area and a status bar.  It also provides for much better memory protection so you do not have to hold in reset as you turn the power off as you would on MMC1 games.  The maximum amount of memory the MMC3 can handle is 512KB of PRG ROM and 256KB of CHR ROM and 8KB of PRG RAM.

There is an extremely advanced MMC Nintendo released late in the NES's life called the MMC5.  In addition to even more flexible bankswitching and more sophisticated scanline IRQ counter compared to the MMC3, it can access 1MB of PRG ROM, 64KB of PRG RAM and 1MB of CHR ROM.  That was huge, the largest MMC5 NES cartridge only used 640KB.  It also added two pulse and a PCM sound channel, which was never used on the NES because there was no wiring to mix the cartridge audio with the internal audio.  It also could implement a vertical split screen scrolling mode, also probably never used in a NES cart.   It also had an 8-bit hardware multiplier. Finally, it had 1KB embedded into its chip that could be used for a third name table and attribute table, or be used to allow each background tile to independently select its palette entries.

When NES emulation became popular, various bankswitching methods was given "mapper" numbers.  As more and more games became emulated, the number kept expanding.  Here is the current mapper list and number of games using each mapper for all NTSC Licensed and Unlicensed games released during the NES's lifetime in the US :

Mapper 0 - 57

Mapper 1 MMC1 - 220

Mapper 2 - 90

Mapper 3 - 63

Mapper 4 MMC3 - 187

Mapper 4 Acclaim MMC3 - 12

Mapper 4 MMC6 - 2

Mapper 5 MMC5 - 8

Mapper 7 - 32

Mapper 9 MMC2 - 2

Mapper 13 - 1

Mapper 64 RAMBO-1 - 5

Mapper 68 Sunsoft-4/Tengen 337007 - 1

Mapper 69 Sunsoft FME-7 - 1

Mapper 206 Namco 109 - 4

Mapper 206 Namco 109/MIMIC-1 - 10

Mapper 11 - 30

Mapper 34 Nintendo - 1

Mapper 34 SEI/AVE - 1

Mapper 41 - 1

Mapper 37 MMC3 - 1

Mapper 47 MMC3 - 1

Mapper 71 - 15

Mapper 79 - 15

Mapper 118 MMC3 - 3

Mapper 119 MMC3 - 2

Mapper 144 - 1

Mapper 158 RAMBO-1 - 1

Mapper 168 - 1

Mapper 228 - 2

Mapper 232 - 5

Mapper 234 - 1

The numbers may change for Europe, but no new major memory controller hardware schemes were introduced there during the NES's lifetime.

CPU/PPU Revisions :

2A03E & 2C02E-0 : Used on early NES front loaders with PCBs labeled NES-CPU-04 and maybe NES-CPU-05.

2A03G & 2C02G-0 : Used on all other NES front loaders and many top loaders, Sharp Nintendo Televisions and NES Top Loaders with the original PCB design.  By far the most common combination in a NES.

2A03H & 2C02H-0 : Used on NES Top Loaders.

There are no known compatibility issues among these chips.  (The same cannot be said for Famicoms with CPUs and PPUs earlier than the 2A03E/2C02E-0 or the Famicom Titler or Sharp C1 TVs using the 2C03 or 2C05 PPUs.)

Console Generic Logic Chips :

74HC368 x 2*
2KBx8 SRAM 100ns x 2
74HCU04 (Front Loader only)
3913A CIC (Nintendo security chip, Front Loader only)

* - These three chips are consolidated into a Nintendo chip labeled BU3266S or BU3270S in the Top Loaders with the redesigned PCB.

Video and Audio Capabilities :

The audio output comes from two CPU pins.  On one pins, there are the two square wave channels, on the other channel are the triangle, noise and PCM channels.  These two signals are mixed together via resistors and then sent to the audio line output.  The NES can be modded for stereo by bypassing the external mixers, but the result will usually sound unbalanced since most of the music will come from one speaker and most of the sound effects from the other speaker.

The NES's PPU generates composite video internally and outputs it on a single pin.  This pin is amplified and sent to an RF modulator or RCA jacks for composite video output.  S-Video, Component Video and RGB Video are not possible with a 2C02 PPU without a substantial modification.

There are two available mods to improve the NES video.  First is the 2C03 PPU mod.  This mod requires taking a Nintendo 2C03 PPU chip from a Playchoice-10 arcade board and replacing the 2C02 from a NES with it.  This mod has been around for a very long time and for many years it was the only mod to obtain RGB from the NES.  You do not have to keep the 2C02, so it is a bit easier than the later mod, which requires you to desolder the PPU without destroying it or the PCB.  However, 2C03 chips are very, very expensive.  You will need to build an RGB amplifier for the three signals.  It also has a tendency to show jailbars in the video output.  Finally, it is incompatible with at least seven NES games and will show unintended graphical anomalies in many more.  Compare the NTSC palette with the RGB palette :

NTSC 2C02 PPU Palette

RGB 2C03 PPU Palette

The newer mod is the NESRGB board, and it is much cheaper and does not have any major compatibility issues.  It also allows for S-Video output and can also allow the original composite signal from the 2C02.  Component video can be added with a small board.

How the NESRGB Works :

The NES has a 16 color palette for all background tiles and another 16 color palette for all sprite tiles.  In simple terms, each of the 16 indexes in either palette corresponds to one of the 64 colors available on the NES.  Each active picture pixel the NES outputs will have its color determined by an entry in one of those two 16 color palettes.  There is also a universal background color.

There are four pins on a 2C02 PPU that are not used in a stock NES.  They are called EXT0-EXT3.  They can be set to input or output and are grounded on a NES or a Famicom, which is set to the input mode by default.  In output mode, these pins will output the palette entry for every pixel the NES displays.  The output is 4-bit and is digital, giving the nucleus of the necessary information to accurately capture the screen output digitally and losslessly.

This is where the NESRGB comes in.  It sits on the PPU bus and does several things.  First, it tells the PPU to put the EXT pins into output mode and prevents games from telling the PPU to do otherwise.  Second, it sits on the PPU's address and data bus to discover the values the CPU is writing into the palette entries.  This allows it to assign colors to the palette entries in its own output.  Third, it reads the EXT pins to determine the color of the pixels by the palette indexes being output by the pins.  However, because the EXT pins only output a 4-bit value, the NESRGB cannot tell whether the palette entry is from the background palettes or the sprite palettes.

In order to derive the 5th bit, which distinguishes the background from the sprite palettes, the NESRGB board will analyze the composite video output.  If this did not occur, the backgrounds or the sprites would have the wrong colors because only one palette would be used.

From the composite output signal, the blanking and sync information are also derived, just like a Framemeister.  NESRGB combines this with its digitized palette entries and then converts the signal into analog RGB and S-Video.  NESRGB offers three palette choices, composite, RGB and improved.  If no palette is selected, then the NESRGB operates merely as a passthrough for the original composite video signal.  If there is a palette selected, then the original composite video is not available.  This is because the NESRGB sends special palette color entries to the real PPU, all background palettes are black and all sprite palettes are white.  This allows it to easily compare background and sprite pixels by analyzing the PPU's video output signal.  Remember, the EXT pins are outputting palette indexes, not palette color data.

Lockout Chips :

The NES was officially released in many, many countries.  One of the lockout chip's functions was to keep people from importing cartridges from another region.  There were four lockout chips produced :

3193A/6113A/6113B1 - Used in US, Canada and Brazil
3195A - Used in PAL-B territories (France, Spain, Federal Republic of Germany, Norway, Sweden, Finland, Denmark, The Netherlands, Belgium, Luxembourg, Austria, Greece) and South Korea
3196A - Used in Hong Kong, Asian territories
3197A - Used in PAL-A territories (United Kingdom, Italy, Australia)
3198A - Used by the Famicom Box (a pay-to-play system Nintendo released for Japanese hotels).

The lockout chip can be disabled by removing pin 4 and connecting it to ground.

Sound Overview :

The NES uses the same basic approach to sound generation as other Programmable Sound Generator devices like the AY-3-891x/Yamaha YM-2149, the TI SN76496, the Atari POKEY and the Phillips SAA-1099.  At the heart of these chips is a square wave, an electrical signal that rises and falls at equal intervals (the period) a certain number of times per second.  These chips can control the frequency of the period, which is given in terms of hertz.  Hertz can be equated into notes on a musical scale, so a square wave running at a frequency of 256Hz will sound like a middle C.  These chips can also modify the volume of the waveform either directly and some can through an ASDR envelope.

The NES can output two square waves, but unlike any of the above sound chips, can change the period so that the time spent at the high and low ends is not equal.  Thus it becomes a rectangular wave.  Unlike the Commodore 64, the NES has no difficulty producing strong, distinct rectangular waves.  Both of these rectangular wave channels have the same features.  A rectangular wave has a high pitched but somewhat hollow sound and typically is used as the main musical instrument in the NES.  All these features make it far more suitable for sound effects than the earlier chips.

The third sound channel is a triangle wave, and instead of rising nearly-instantly to the high point, it gets there in steps.  The period cannot be changed.  The triangle wave is usually a softer sound and is often found acting as the bass line in NES music.

The fourth sound channel is the noise channel.  Noise is generated by outputting a long semi-random series of 0s and 1s at a particular frequency.  The resulting waveform looks like random spikes.  Noise is typically used for sound effects in the older chips, but the NES put it to good use for percussion when there was not sufficient space for samples.

The fifth and last sound channel is for playing samples.  It was seldom used in the early years of NES cartridges because sound samples take up a lot of space.  This channel plays sound in two different ways.  First, it can accept a 7-bit value sent directly to the channel.  The second is through delta modulation, whereby a single bit is sent to the channel output over a period of time.  A 1 bit indicates an increase in volume, and without further 1 bits, the signal will decay and fall silent.  DPCM samples take up less space but the quality is lower than the 7-bit PCM.

Unlike the Famicom, the NES does not send its internal audio to the cartridge connector for mixing with any cartridge audio hardware.  Instead, audio could be mixed via the expansion port, but no product was ever released that did that.  Therefore, expansion audio just does not exist on the NES unless Famicom cartridges are being used.  

Sunday, June 21, 2015

Types of NES Passwords

In the NES era, more and more games were being released that were not likely to be finished in a single setting.  Adventure games with huge worlds and innumerable secrets were more and more common.  While the NES did not invent password saving in console games (Survival Island for the Atari 2600 Supercharger may have that distinction), it certainly popularized it.  Cartridge games thereafter (including many Game Boy Advance games) would have to choose between no saving, saving via battery backed memory, rewritable flash memory or EEPROM and the middle ground, passwords.

For the NES, most games that supported anything other than restarting from the beginning after a reset or power down used a password save.  Here are some examples of some passwords :

Simple Passwords :

Bubble Bobble allows the player to select a level via a password.  Each level is assigned a particular 5 character code, and there are different codes for Bubble Bobble (the first time through) and Super Bubble Bobble (the second time through).   If you look at the passwords, you will see a pattern emerge as the level number is incremented by one.

WURM: Journey to the Center of the Earth is even more simple, the passwords are arbitrarily assigned to each act and never change.

Little Sampson's passwords just save the the level you last beat like WURM, but do not save the extra health or the potions you may find.

Character Based Passwords :

Metroid/Kid Icarus
64 characters x 24 spaces

Metroid and Kid Icarus use an identical password system from the player's perspective.  The passwords are 24 characters long and each password space can select from 64 characters.  Typically you will often see that passwords use a number of characters and spaces that correspond to a power of two (32 or 64 characters) or near a power of two (24, 48).  In these games' cases, they use A-Z, a-z and 0-9 and a few punctuation marks to make 64.

With 64 characters, you can store the state of six bits.  4 such characters in a row gives you 24 bits or 3 bytes, something the 8-bit NES CPU can easily manage.  Thus, with 24 characters, you can store 18 bytes.  With these complicated games, almost every bit has some in-game meaning.

Nintendo did not want to make it easy for players to crack their passwords, so they implemented bit shifting and checksums so that random passwords would not be easily accepted and that the password would not necessarily be almost the same every time, even if you made no progress in the game.

Ironically, Metroid and Kid Icarus ended up using boards with an extra memory chip.  The only difference between a Metroid PCB and a Legend of Zelda PCB is that the latter has a battery and the extra passive components required for battery-backed saving.  It would seem that the original intent was that Metroid and Kid Icarus would have used a board without the extra RAM chip, but late in the porting process from the Famicom Disk System to cartridge, it was discovered that these games required the extra RAM.

Here are other examples of games with similar passwords :

The Goonies 2
48 characters x 14 spaces
Even though this game only uses 48 characters, each bit still represents 6 bits of information, even if not all those bits can be realized

The Guardian Legend/Rambo
64 characters x 32 spaces
These games have an RPG-like experience system, so saving large numbers becomes important.

Wizards and Warriors II
26 characters x 12 spaces
Uses only A-Z, but you still treat it has a a 5-bit value.

Grid-Based Passwords :

Mega Man 2/Mega Man 6
2 characters x 25 spaces
Grid-based passwords are not really that much different  from character based passwords and often much simpler.  Mega Man 2 & 6 uses a dot within a 5x5 grid.  Thus each grid space can be occupied by a dot or not, giving 1 bit for each grid.  This password saves 25 bits of information, or just over 3 bytes.

Mega Man 3/5
3 characters x 36 spaces
Only slightly more complicated because there can be one of two colored dots and a 6x6 grid.  Each grid must store 2 bits

Castlevania III
4 characters x 16 spaces
Each cell can have three symbols (whip, heart, cross) or be blank, so each cell still stores 2 bits.  This password is slightly more complicated because the player's name will have an effect on the symbols.

Split Passwords :

Swords and Serpents
32 characters x 20 spaces x 5 passwords
Swords and Serpents may have the longest passwords of any NES game.  Each of the four characters have his or her own password and the world state is stored in the fifth password.  The character's names have an effect on their passwords as well.

River City Ransom :
63 characters x 33 spaces x 2 passwords
In RCR, each player has a separate password, so the burden of writing down the password is less onerous in a one-player only game.  Unlike Swords and Serpents, there is no game world password.

Long Japanese Passwords :

Dragon Quest
64 characters x 20 spaces
Dragon Quest II
64 characters x 52 spaces

In Japan, all four of the Famicom Dragon Quest games were huge, giving Enix (later Square/Enix) a guaranteed success.  Even the remakes sell over a million copies.  In the beginning, things were much more humble and the first two Dragon Quest games required the player to enter passwords to continue their game.  As the series became more successful and the games larger, Enix ponied up for the extra cost of a battery-backed memory cartridge for III and IV.  When released overseas, Nintendo oversaw the localization of the first game and retrofitted it to use a battery backed save.  Enix did the same when they ported over II.

Maniac Mansion Japanese Version
66 characters x 104 spaces

Maniac Mansion was first released in Japan and ported by Jaleco.  The resulting game may use the longest password of any Famicom or NES game.  Maniac Mansion was ported from home computers and space was not quite as precious as it was on a cartridge.  The SCUMM engine did not necessarily seem to save a game efficiently.  Even though the Japanese version pretty much scraps the SCUMM engine, the same variables needed to be saved.  Each character stores 7 bits and this saves 91 bytes worth of information.

How long would a password for The Legend of Zelda have been?

The Legend of Zelda stored far more information about the game than any game before it.  Consider what it saves of each of its three save slots :

1.  The Character's Statistics

Player name -  1-8 characters
Number of deaths - 0-255
Life Meter - 3-16 Hearts
Rupees - 0-255
Keys - 0-9
Bombs - 0-16
Items : Wooden Sword, Boomerang, Magic Boomerang, Bow, Arrow, Silver Arrow, Food, Large Shield, White Sword, Magic Sword, Raft, Stepladder, Magic Key, Magic Wand, Spell Book, Blue Candle, Red Candle, Blue Ring, Red Ring, Whistle, Red Potion, Blue Potion, Letter, Power Bracelet
Quest Number - 1 or 2

Based on the above, I would estimate it takes 16 bytes to save your character's attributes.

2.  The Overworld

The Overworld is on an 8x16 grid, and the all the Underworld screens are on a 16x16 grid.

For every Overworld screen, two types of information are saved.  First is the number of enemies remaining.  If there is one or more of the enemies on the screen, not including Zoras or Ghosts, the same will save that number, but not the type.  I do not recall any screen with more than six enemies.  Second are the permanent alterations to the screen caused by blasting a door into a rock with a bomb or burning a tree with one of the candle or by uncovering a warp stairwell.  There is no more than one such secret on any given screen.  One byte per screen should be sufficient, so this is 128 bytes.

Third are the people inside the caves/stairwells.  These include the "It's a Secret to Everybody" Moblins, the old man who makes you pay for his door, and whether the old woman has seen the letter.  There are about twenty instances in the First Quest, so that is another 3 bytes.

3.  The Underworld

For the Underworld, there are several pieces of information stored:
Hungry Goriya fed - 1 in First Quest
Bomb guy paid? - 2
Triforce Taken? - 8
Compass and map for each level - 18
Boss monsters for each level defeated - about 32 in the First Quest
Room item taken? - Only one item per room unless its a 10 rupee room, which can be a key, a bomb or money - approximately 128 instances
Opened locked door or bombable wall uncovered? - Up to four per screen, approximately 128 instances

Approximately 40 bytes are required to save the Underworld state.

In total, approximately 187 bytes are required for Zelda's save.  That is more than double the bytes required for Maniac Mansion Japanese Version.  So, assuming a 64 character system like Metroid and Kid Icarus, you would need about a 250 space password to restore your game.  Obviously that was not going to work, so either the Disk System or a battery-backed saving system had to be used overseas, and Nintendo chose the latter.

Saturday, June 20, 2015

Nintendo's PlayChoice-10 - The Arcade Advertisement

Nintendo created the PlayChoice-10 arcade cabinets in order to show off its NES games.  These cabinets would let you select a game from a menu with up to ten slots and let you play any of the games for a certain amount of time, typically 300 seconds per quarter.  In this blog entry, I will be talking about notable aspects of this system.

Game List :

This site http://playchoice.riemen.net/ and Wikipedia includes Shatterhand and RBI Baseball in the canonical list of PlayChoice-10 games, but there are no pictures of their PCBs and their ROMs are not in GoodNES or MAME.  MAME has an entry for a prototype of Bases Loaded, but the prototype does not include the instruction ROM.  Here is a list of games that have been verified to have been released for the PlayChoice-10 units :

Game Title Publisher/Developer
NES Release Date
1942 Capcom 11/01/86
Balloon Fight Nintendo 06/01/86
Baseball Nintendo 10/01/85
Baseball Stars SNK 07/01/89
Captain Skyhawk Milton Bradley/Rare 06/01/90
Castlevania Konami 05/01/87
Chip 'n Dale's Rescue Rangers Capcom 06/01/90
Contra Konami 02/01/88
Double Dragon Technos 06/01/88
Double Dribble Konami 09/01/87
Dr. Mario Nintendo 10/01/90
Duck Hunt Nintendo 10/01/85
Excitebike Nintendo 10/01/85
Fester's Quest Sunsoft 09/01/89
Gauntlet Tengen 06/01/88
Golf Nintendo 10/01/85
Goonies Konami Not Released
Gradius Konami 12/01/86
Hogans Alley Nintendo 10/01/85
Kung Fu Nintendo/Irem 10/01/85
Mario Bros Nintendo 06/01/86
Mario Open Golf Nintendo 09/01/91
Mega Man 3 Capcom 11/01/90
Metroid Nintendo 07/01/87
Mike Tyson's Punch-Out!!! Nintendo 10/01/87
Ninja Gaiden Tecmo 03/01/89
Ninja Gaiden 2 Tecmo 05/01/90
Ninja Gaiden 3 Tecmo 08/01/91
Nintendo World Cup Technos 12/01/90
Pinbot Nintendo/Rare 04/01/90
Power Blade Taito 03/01/91
Pro Wrestling Nintendo 03/01/87
R.C. Pro Am Nintendo/Rare 02/01/88
Rad Racer Square 10/01/87
Rad Racer II Square 06/01/90
Rockin' Kats Atlus 09/01/91
Rush 'n Attack Konami 04/01/87
Rygar Tecmo 07/01/87
Solar Jetman Tradewest/Rare 09/01/90
Super C Konami 04/01/90
Super Mario Bros Nintendo 10/01/85
Super Mario Bros 2 Nintendo 10/01/88
Super Mario Bros 3 Nintendo 02/01/90
Tecmo Bowl Tecmo 02/01/89
Teenage Mutant Ninja Turtles Ultra Games/Konami 06/01/89
Teenage Mutant Ninja Turtles II : The Arcade Game Ultra Games/Konami 12/01/90
Tennis Nintendo 10/01/85
Track & Field Konami 04/01/87
Trojan Capcom 02/01/87
Volleyball Nintendo 03/01/87
Wild Gunman Nintendo 10/01/85
Yo Noid Capcom 11/01/90

Statistics and Game Choice :

The statistics for these 52 titles (less than 10% of the NES's licensed library) are interesting.  Nintendo leads the pack with 18 (or 21) titles, followed by Konami/Ultra with 10 titles and Tecmo and Capcom with 5 a piece.  Capcom was far more prolific than Tecmo with NES cartridge releases, but Capcom appeared to be rather conservative when it came to Nintendo's less mainstream hardware like the arcade machines and the Famicom Disk System and advanced cartridge memory mapping hardware.

Even though it was not a publisher, Rare has 4 games on this list to its credit.  Half of Square's non-Japanese NES library is here.  There are no titles from NES stalwarts Bandai or Jaleco (unless Shatterhand was really released) and no entries from Namco.  Atlus was not a very prolific publisher, but it has an entry.  Tengen also has an entry, perhaps two if you count RBI Baseball (which is really a Namco game).  Gauntlet was originally released as a licensed cartridge before Tengen/Atari Games went the unlicensed route.

Interestingly, Metroid and Rygar are on this list. These Metroidvania games are not typically well-suited to the arcade, which lends itself to fast-paced games.  They also tend to take longer to beat than your average arcade game unless you know where to go already.  TMNT is similar in that it is as much of an exploration as an action game.  TMNT was incredibly popular and Metroid was no slouch in the sales either.  Sports games were also popular on the NES, thus they had a decent share of the total.

Most of the games on this list are very well-known and not particularly hard to find in cartridge format. There are a few more obscure titles like Yo Noid, Power Blade and Solar Jetman, but nothing particularly exotic.

Except for the Black Box NES games, which are products of their time, most of the games included on the Playchoice 10 are very good.  There are classics like Castlevania, Contra and Super C, Mega Man 3, Metroid, Mike Tyson's Punch-Out!!, the first two Ninja Gaiden games, all three Super Mario Bros and Tecmo Bowl.  Most of the rest of these choices are solid, with really only Fester's Quest and TMNT being the high profile games that just aren't very good.

Interesting PlayChoice-10 Versions :

Double Dragon - No Tradewest logo on title screen.

Gradius - Has the old Konami logo on title screen and no Licensed by Nintendo of America text, which would suggest that it is identical to the Famicom cartridge.  1942 by Capcom also does not have the Licensed by Nintendo text, but neither does the NES cartridge version either.

The Goonies - This game was never released in a home cartridge outside Japan, so this and perhaps Vs. The Goonies is the only exposure western NES fans had to the game.  The Goonies II was released fairly early in the NES's life, which made its predecessor look rather simple.

Mike Tyson's Punch-Out!!! - This game's PlayChoice-10 board is unique because it has battery on PCB and an SRAM chip which the cartridge editions never had.  This extra hardware allows the game to save the time and round where you beat each fighter.  There is a special screen where you can enter your initials when you start a new game and you see your time in relation to others when you beat an opponent.  Some other NES sports games did have battery backups, but typically they stored more information than just high scores or best times.

Some other material from the cartridge versions has been cut, there are no crowd noises when the game loads and the training cutscenes between circuits cut all animation, only showing the password.

Mario's Open Golf - This is the PlayChoice-10 version of NES Open Tournament Golf.  There is no save battery, so the Club House option where all the stored settings can be accessed, has been removed from the main menu.

Rad Racer - No Anaglyph 3D mode, pressing select does nothing other than make noise.

Arcade Cousins :

Many of the PlayChoice-10 games were arcade ports and must have paled in comparison if the real arcade machine was present in that arcade.  1942, Double Dragon, Gauntlet Gradius and TMNT II would have looked very weak next to their popular arcade counterparts.  The two Contra games, Kung Fu (as Kung Fu Master) Rush 'n Attack and Trojan also came from arcade machines.  Rygar had an arcade namesake and Castlevania had a loose arcade translation, but they were quite different from the PlayChoice-10 games. Obviously, Pin Bot would pale in comparison to a real Pin Bot pinball table, widely recognized as a classic table.

Nintendo also had several standalone Vs. System arcade cabinet machines.  Balloon Fight, Baseball, Castlevania, Dr. Mario, Duck Hunt, Excitebike, Golf, The Goonies, Gradius, Hogan's Alley, Super Mario Bros and Volleyball all had a Vs. System equivalent.  For the early games, the Vs. System versions would often have new features and more graphics compared to the PlayChoice-10 or NES versions.  The Vs. System versions were always harder.

Note that the PlayChoice-10 has a reasonable selection of games throughout the NES's lifespan.  The biggest years of the NES, 1987-1991, are very well represented.  By contrast, the Vs. System had very few games released for it that were released on the NES or Famicom after 1987.  Of course, the PlayChoice-10 had several advantages over the Vs. System.  The PlayChoice-10 PCB could hold ten games, a Vs. System Board could hold a maximum of two.  The PlayChoice-10 offered arcade owners a lot more bang for their buck.

Other Official Previewing Options :

People coming into an arcade would look at a PlayChoice-10 machine and knew it was an arcade NES.  Perhaps they owned some of the games on the menu.  The PlayChoice-10 was intended to give gamers a preview of all the hot new games that were going to be released.  It was an effective advertisement, but because video game rentals became hugely popular in the NES era, it was not as effective as it otherwise may have been.

At World of Nintendo kiosks in malls around the country, Nintendo fans could also sample new NES games from M82 Demo Units without having to pay for time (although the console would eventually reset).  The M82 could hold 12 standard NES cartridges and used a button to select the game and output to a composite monitor.  The Famicom had similar units like the Famicom Box and Famicom Station which used 72-pin cartridges.  Unlike the PlayChoice-10's arcade controls, the M82 used standard NES controllers, so you knew exactly what kind of experience you were going to get.

Instructions :

The PlayChoice-10 cabinets usually used a dual monitor setup like the arcade Punch-Out cabinet. In fact, Nintendo sold a conversion kit to convert Punch-Out or Super Punch-Out into a PlayChoice-10 machine.  These conversions would have two screens of equal size, but there are also dedicated PlayChoice-10 cabinets where the instruction screen monitor is much smaller than the game display monitor.

The lower screen plays the game, the upper screen shows the menu for the machine and, once a game is selected, the instructions are shown and the time remaining for the quarters you entered.  Each game has from one to three screens of instructions.  Pro Wrestling and Metroid use three, but most other games can get the message across in one or two screens.  Ironically, because Pro Wrestling does not tell you which wrestlers use which special moves, it is perhaps one of the least helpful of instruction screens.  Metroid gives you a partial world map (Brinstar and some of Norfair) to help you out.

PlayChoice-10 cabinets also came in an upright and more compact countertop single screen versions.  In these machines, the menu and instructions share the screen with the game.  First you see the menu screen, and when you insert your quarter, you see the time countdown from a 4-digit LED display above the monitor.  You can proceed to play the game.  By pressing the game enter button again you can see the instructions.  This apparently overrides the video from the game or halts the 2A03E CPU's execution.  Hold down enter for two seconds to go back to the game.

Hardware :

The PlayChoice-10 machine uses a standard NES 2A03E CPU but has an RGB 2C03B PPU.  The 2C03 outputs pure analog RGB and has a palette which corresponds roughly to the NTSC-based 2C02G-0 PPU palette.  It does not need to use any color-fringing filtering which gives the NES its 3-line zig-zag pattern with colored straight edges.  The resulting output is much sharper than the home console, but the colors are more garish.  It also loses two gray entries, so games like Paperboy 1 & 2 will be hard to play because you cannot see where the sidewalk ends and the road begins.  Finally, it handles the color emphasis bits in a way that typically turns games that use those bits (The Immortal, Magician) totally white, making them impossible to play.  The PlayChoice-10 also has a Z-80 CPU and additional video display hardware to handle the menu/instruction monitor and the coin mechanism and the countdown timer.

The games themselves come on naked PCBs and connect to the main PCB via a 3 x 32 pin BERG-style connector.  Part of the reason for this large number of pins is because every game has an additional 8KB ROM which contains the game's instructions and a 64-bit serial PROM containing the game's name which also acts as the security device.

The main game hardware is almost always standard and can be found on a NES or Famicom cartridge.  Mappers encompassed are 0, 1, 2, 3, 4, 7, 9, 87, 119 and 206, which are used by good 90% of licensed game.  Some games use Mask ROMs and EPROMs, others just one or the other.  Older PlayChoice-10 PCBs may need a mod to make them compatible with Mapper 4 games, which is an issue with other Nintendo game selecting devices.  With an EPROM burner and some tinkering, almost any licensed NES US game (that was any good and you would want to stand up and play for less than an hour) could be made to play in this machine.

Thursday, June 18, 2015

Cleaning Saved Information from Famicom Disk System Game Dumps

A lot of Famicom Disk System games save some information to disk.   Often this information may be custom levels designed with an in-game level editor, the top scores or the fastest times or the levels beaten.  The more ambitious adventure and RPG games would typically offer three save slots to store the player's progress during the game.  The use of magnetic media, the Disk Cards, allowed any Famicom Disk System game to save information to the disk.  When games are dumped, any information saved will come with them. While this will not diminish the playability of a game, it still cosmetically very unappealing to see "Diskdude" all over the high score lists or hacked games on the file select screen.

Unfortunately, for most games there is no way to restore the game to a pristine, never-played state within the game itself. I have always wanted a tool or utility that could take these disk images and do just that, but since none exists I decided to investigate the images and try to fix them myself. Restoring a Famicom Disk System game to a pristine state is often times more involved than just deleting or zeroing out the last file. The resulting disk image has to work after it has been "cleansed". I used Nestopia UE 1.46 and FDSExplorer 1.63 and my favorite hex editor.  A hex to decimal calculator will also come in handy.

Famicom Disk System games come on one or two disks.  A game on a single disk can use one or both sides of the disk, two disk games always use four sides.  The sides are labeled Side A and Side B.  The Disk System's drive was single sided, so the user had to physically eject the disk, remove it from the drive, turn it over and insert the disk.  The disk drive can automatically sense when a disk has been inserted and inform the rest of the system.  

A straight dump of each side of a Famicom Disk Card will have a size of exactly 65500 bytes.  Each subsequent disk side dump is appended to the previous side, so two disk side games will be 131,000 and four disk side games 262,000.   Modern Famicom Disk System game dumps use an .fds file extension.  They can come with an extra 16-byte header for emulators and flash carts.  This header looks like this :

46 44 53 1A 0x 00 00 00 00 00 00 00 00 00 00 00

x = number of disk sides, typically 1, 2 or 4.

The first three bytes show FDS in ASCII and the fourth byte is also used as the MS-DOS End of File byte.  The header is extremely basic and is designed to inform an emulator that the file loaded is a true FDS disk image and how many disk sides the game has.  While this could have been discerned by the file extension and file size, the FDS image format was created in the days of Nesticle, an MS-DOS based NES emulator.  MS-DOS files used 8.3 character/extension file names, so the likelihood that files could be confused was much greater.

Famicom Disk System games have a simple file system.  Each file on the disk has a name using up to eight characters, a file number (0-x), an ID number (ditto), a size (up to 32KB) and a type.  The three types are Nametable, CHR and PRG.  CHR stores graphics tiles, PRG stores code and the Nametable is always the first file on Side A and is used for the Copyright text at the beginning.  If the text is not exact, the disk will load no further.  Save games are always stored in a PRG type file.  

What made this much easier was the fact that Famicom Disk System games always seem to save to the last file on a disk's side. Later in the Disk System's life, (1988) Nintendo used a new drive controller chip that limited the disk drive to writing only to the last file on a disk. The earlier convention became a rule. 

Sometimes the save file has an obvious name and is so small it could be nothing else, but for other games it is not so obvious. So the first thing I had to do was to observe which side was being written. Nestopia tells you when a disk is being read or written, so I just played until there was a save. Metroid was almost unique among the games I looked at because it saves information to both sides. 

Once I figured out which side was being saved, I opened the disk image in FDSExplorer and looked at the file. For games with three save slots, I simply deleted two and made a third with a file name that was easy to find like ABCDEFGH. With a little deductive reasoning (i.e. looking at the hex patterns and logical reasoning) I could figure out how the file could be corrected so that no save games would be present at startup. Dr. Chaos did not follow the typical rule about writing changes to all files after starting a new game, but its save file is really simple and my image came with one unused file.

On a couple of occasions, I discovered that my image was pristine but the game actually created a file once there was saving. FDSExplorer makes it easy to delete the last file in these cases, but you have to verify that the game creates a file before you delete it. I made it a point to alter no more bytes than was necessary to make the game appear to look pristine. Whether it would actually correspond byte by byte to a pristine, error-less dump of a sealed Disk Card is an issue that may never be known for some games, but for other games the changes are so obvious and minor that it can hardly be doubted that this is how they should have appeared. 

Nintendo, for its own first-party games, eventually began to store a backup of a pristine save file elsewhere on the disk.  That way, if the save file became corrupted after a write, the game could try to restore the save file so the user could continue to play the game.  Hikari Shinwa - Palutena no Kagami is an example of such a game.

Some games will allow you to restore the game to a pristine state via an in-game function.  They are detailed below.

Here is a list of the games and what I did to make them "pure". 

Akumajou Dracula (all versions) (Konami, 1986)
Information Saved - Three slots, last stage completed and number of continues
Fix : Side A - Zero out last file
NES/Famicom Port : Castlevania/Akumajou Dracula

All Night Nippon Super Mario Bros. (Nintendo 1986)
Information Saved - Number of times you have beaten the game
Fix : Side A - Zero out last file
NES/Famicom Original : Super Mario Bros.

Bubble Bobble (Taito, 1987)
Information Saved - Allows you to select a starting level up to the last level you completed
Fix : Side A - Game creates a save file when you save your level progress, delete file with FDS Explorer
NES Port : Bubble Bobble

Clu Clu Land - Welcome to New Clu Clu Land (Nintendo, 1992)
Information Saved - High scores
Fix : Side A - In the last file, this pattern must repeat ten times : 14 EF EF EF 24 00 00 00
NES/Famicom Connection : Clu Clu Land

Dr. Chaos (Pony Canon, 1987)
Information Saved - Three slots, progress through game
Fix : Side A - Zero out last file, except for the last eight bytes, should say DR.CHAOS in ASCII
NES Port : Dr. Chaos (NTSC Only)

Dracula II - Noroi no Fuuin (Konami, 1987)
Information Saved - Allows you to select a starting level up to the last level you completedtime taken in game
Fix : Side A - Zero out last file
NES Port : Castlevania II : Simon's Quest

Eggerland (HAL Laboratory, 1987)
Information Saved - Rooms completed
Fix : Side B - Start a new game, commit suicide until you see the Game Over screen, then save.
NES/Famicom Connection : Adventures of Lolo 1, 2 & 3, Eggerland - Meikyuu no Fukkatsu

Eggerland - Souzouhe no Tabidachi (HAL Laboratory, 1988)
Information Saved - Allows you to select a starting level up to the last level you completed, saves levels you build with the construction editor in the game.
Fix : Side B - Zero out the last byte in the last file and remove all tiles for all construction levels using the in-game utility, then save.
NES/Famicom Connection : Adventures of Lolo 1, 2 & 3, Eggerland - Meikyuu no Fukkatsu

Hao-Kun no Fushigina Tabi (DOG, 1987)
Information Saved - Three slots, progress through game
Fix : Side A - Delete all three save files in the main menu, then create file one. Immediately close the FDS image in Nestopia. Replace the first seven bytes in the last file with 00 5F 5F 5F 5F 5F 5F.
NES Port : Mystery Quest (NTSC Only)

Hikari Shinwa - Palutena no Kagami (Nintendo, 1986)
Information Saved - Three slots, progress through game, time taken to beat game, high scores
Fix : Side A - Copy hex from REG BACK and paste into REG.SAVE
NES Port : Kid Icarus

Kaettekita Mario Bros. (Nintendo, 1988)
Information Saved - Name, age and gender of players controlling Mario and Luigi, High Scores
Fix : Side A - Rename characters to the default, use hiragana for Mario and Luigi, set the ages to 00 and the gender to male (おとこ). Mario is まりお and Luigi is るいーじ in Nintendo's preferred hiragana spelling.
Side B - Copy over all bytes in file 9 to file 10
NES Port : Mario Bros. Classic Series (PAL Only)
NES/Famicom Connection : Mario Bros.

Knight Move (Nintendo, 1990)
Information Saved - High Scores
Fix : Side A - Save file is split into four sections of 48 bytes. The game uses the first and last section for saving the scores, so copy the second or third section to the first and fourth section. 
NES/Famicom Connection : Tetris/Tetris (designed by Alexey Pajitnov)

Legend of Zelda 2, The - Link no Bouken (Nintendo, 1987)
Information Saved - Three slots, progress through game, number of deaths
Fix : Side A - Kill all save files on the file select screen, the game will reset each slot as after it is killed. The No-Intro dumps for the Legend of Zelda 2 for the FDS will not allow you to see or take any items like heart containers and magic jars for their first save slot.  This can be easily fixed by entering a new name for the first save slot, then killing the the name and entering it again.  
NES Port : Zelda II -  The Adventure of Link

Metroid (all versions) (Nintendo, 1986)
Information Saved - Three slots, progress through game, time taken in game, ending earned for last game.
Fix : Side B - Create a new character for file one, then start the game. Immediately close the FDS image in Nestopia. Do the same for file two and three. Do NOT save the game. This causes the game to reset the save information for the world for the three files because the game will write to side B when you create a new character.  Side A - Overwrite the first three bytes with 80 and the next forty eight bytes with FF. Zero out the rest of the file. This deletes character information.
NES Port : Metroid

Nazo no Kabe - Block Kuzushi (Konami, 1986)
Information Saved - Allows you to select a starting level up to the last level you completed
Fix : Side A - Delete all three save files, then create file one. Start the game, lose all your balls, then save and quit. In the last file, replace the first sixteen bytes with the second sixteen bytes. These two sets of bytes should be identical to the third set of sixteen bytes. The last sixteen bytes of the file should be 00.
NES Port : Crackout (PAL Only)

Nazo no Murasamejou (Nintendo, 1986)
Information Saved - Three slots, progress through game
Fix : Side A - Kill all save files on the file select screen, the game will reset each slot as after it is killed.
NES/Famicom Connection : The Legend of Zelda/Zelda no Densetsu 1 - The Hyrule Fantasy (engine)

Section-Z (Capcom, 1987)
Information Saved - Three slots, progress through game
Fix : Side A - Delete all three character saves in the game menu, then create file one. Start the game, get killed, then save and quit. In the last file, replace the first twenty three bytes with the second twenty three bytes. These two sets of bytes should be identical to the third set of twenty three bytes. The last four bytes of the file should be 00.
NES Port : Section Z

Super Mario Bros. 2 (Nintendo 1986)
Information Saved - Number of times you have beaten the game
Fix : Side A - Zero out last file
NES/Famicom Connection : Super Mario Bros. 1, 3

Vs. Excitebike (Nintendo, 1988)
Information Saved - Race times and data for custom tracks 4-7 designed with built in construction editor.
Fix : Side A - Delete the last file
NES/Famicom Connection : Excitebike

Winter Games (Pony Canon, 1987)
Information Saved - Records for each event
Fix : Side B - Zero out last file
NES Port : Winter Games (NTSC Only)

Wrecking Crew (Nintendo, 1989)
Information Saved - Custom level designs for phases 1-4 designed with built in construction editor.
Fix : Side A - Delete all objects on each of the four phases ofthe design part, then save.
NES/Famicom Original : Wrecking Crew

Yume Koujou Doki Doki Panic (Nintendo/Fuji Television, 1987)
Information Saved - Worlds completed by each character.
Fix : Side A - Zero out first four bytes in last file
NES/Famicom Port : Super Mario Bros. 2/Super Mario Bros. USA

Zelda no Densetsu - The Hyrule Fantasy (Prototype and final) (Nintendo, 1986)
Information Saved - Three slots, progress through game, second quest, number of deaths
Fix : Side B - Kill all save files on the file select screen, the game will reset each slot as after it is killed.
NES/Famicom Port : The Legend of Zelda/Zelda no Densetsu 1 - The Hyrule Fantasy

Further notes :

There are many, many other FDS games that save information to disk.  I have only given a sample of the games which either have a NES port, are part of an NES series or substantially related to an NES game. Many Famicom Disk System games are Japanese-text heavy, which can make it more difficult to purify the image.

Nestopia does not save to the disk image by default, but can in its options menu. You should also change the option so that you can see the status Reading Disk/Writing Disk in Nestopia's status bar.  Always make backups when experimenting. Nestopia saves to an image when the image is closed or the user quits Nestopia. 

Unfortunately, FDSExplorer does not allow you to edit files inside a disk image directly, it is easiest to use a Hex Editor and search for the bytes you wish to alter. 

This list really only scratches the surface, but I wanted to focus on games that were ported in some way or form on or related to a NES cartridge. Since my Japanese is "a little rusty", I did not want to tackle the more Japanese text-heavy games.

Saturday, June 13, 2015

The Blog at 200 Posts

Blog Stats

According to Blogger, this blog has had almost 220,000 page views.  So far I have published 205 posts, not including posts that I have removed because they were not up to snuff.

Many of my most popular posts tend to be about flash carts.  Those are some expensive posts!  People have been generous enough to lend me hardware.  The Framemeister and Turbo CD posts would not have happened otherwise.  This is expensive hardware, and requires me to treat it respectfully and return it when I am done.  I would like to thank anyone who has ever donated anything to me for review.

The trouble with flash carts is that once you buy one, in a year they release a more advanced one.  The Mega Everdrive has a v.2 which adds support for battery backed saving.  With the v.2 you will not longer need to reset in order to retain your save in Phantasy Star II or Sonic the Hedgehog 3.  Of course, when you have a v.1, an upgrade feels like a necessity but is more of a luxury.

As some of the more dedicated readers of this blog may have noticed, the number of blog entries has increased dramatically over the past two years.  When I started this blog in 2010, it took over four years to publish 100 posts.  In just over a year, I have passed the 200 mark.  With this increase in content has come an increase in pageviews.  I now get 10,000 page views a month.  While most of my readers are based in the United States, I have a sizable number of pageviews from Germany, the United Kingdom, France and Russia.

Video is not for me

I tried putting up a Youtube channel and did make some videos showing off some of my vintage hardware but took all the videos down.  I'm no good with video, I simply do not have the equipment for it.  My smartphone camera just is not up to the task of taking professional video and none is.  I do not have any devices to capture video directly from my consoles or computers.  I do not even have a good quality condenser microphone.  I tried using written captions but that took forever.  Nor do I have proper lighting, so my videos always look grainy.  Moreover, I do not have access to good free video editing software or the training I need to make effective video edits.  My particular talent, to the extent I have one, is with the written word. This does not mean that I would never post a video, but I generally would keep them short and blog oriented.  I have made audio recordings, something that can be done easily with Audacity.  Even though hosting the clips on Soundcloud is cumbersome, it works well enough.

Favorite Youtube Channels

Although I watch many Youtube channels fairly consistently as they pertain to retrogaming and retro PC and console hardware, there are a few channels dedicated to the PC side of things which deserve a special mention.  The number of people seriously interested in vintage PC gaming and hardware is rather small compared to the Atari 2600 or the NES or the Genesis or the SNES.  There are a few well-produced channels focusing on vintage PC gaming which I believe are worth noting.  While I like AVGN's stuff, he has 1.8 million subscribers and does not need my endorsement.  These guys and girl do :

1.  Ancient DOS Games : https://www.youtube.com/user/Pixelmusement

Ancient DOS Games (ADG) is run by Kris Asick, who has been running the ADG series since 2010.  Kris' background is in game design.  He has had games published and he knows how to program.  He approaches his reviews focusing on the game design, highlighting what works and what doesn't.  He also gives advice on how to set up games in DOSBox and tells you where you can find these games.  I really hope GoG supports him on Patreon.  In his canonical series, he has reviewed some 164 DOS games.  His reviews include well-known classics like King's Quest and System Shock, crap console to PC ports like Mega Man and Mega Man III, edutainment titles like 3-D Body Adventure and Math Rescue, and obscure games like Thor's Hammer and Moraff's World.

Prior to 2013, Kris hosted his videos on blip.tv  A bit later than most he saw that the handwriting was on the wall as far as blip's long-term viability (Flash has no place in the tablet-centric world of this decade) and began uploading his old videos to Youtube.  Now he has fully transferred his whole series where I hope a much wider audience can find and enjoy them.

2.  Lazy Game Reviews : https://www.youtube.com/user/phreakindee

Clint Basinger, (no relation to Kim), has been making game and hardware reviews and videos and posting them to his Youtube channel, Lazy Game Reviews, since 2008.  Clint is as engaging as he is knowledgeable, and unlike many other people who focus on all things DOS, he actually has a very respectable collection of hardware and is not afraid to show it.  His PC software collection would inspire almost anyone with envy.  He also captures footage from real hardware, which is very special in this day and age.  There are also reviews of non-IBM PC hardware and even console hardware.  Clint can be trusted to give a concise talk about the subject of his video.

Clint has recently been doing Let's Plays with Kris and PushingUpRoses, and is a huge Sims and SimCity fan.  He has many, many videos of both these series, but I have no interest in the Sims and little interest in SimCity past SimCity 2000. He has taken his knowledge of the history of the PCs and has made videos on various interesting stories from its history.

3.  Pushing Up Roses : https://www.youtube.com/user/pushinguproses

Did you know that women used to play DOS games?  Like every other type of video gaming, PC gaming was typically a male-focused interest.  However, many women did play DOS games back in the day, I know one very well.  Certain categories of DOS games, like point and click adventure games and puzzle games had a much stronger appeal toward women than the sidescrollers and the shoot-em-ups of NES, Genesis and SNES or Wolfenstein 3-D and DOOM on the PC.  Pioneering women like Roberta Williams, Lori Ann Cole, Jane Jensen and Lorelei Shannon made their mark in the adventure game genre and have indisputable classic series to their names.  (Is it a coincidence that all three of these game designers made their mark at Sierra?)

Only a very few female fans only a very few have been known to venture into vintage DOS gaming (its so annoying to feel like you are constantly being hit on.)  One of those who have is PushingUpRoses.  She has reviewed many DOS games and always brings a fresh and often times rather feisty perspective to the table.  She also does Let's Play videos of DOS games, sometimes with LGR.  I tend to avoid these because I don't like spoilers, even if I probably won't get a chance to really play the game for the next five years.

Quest Studios RIP?

On a sadder note, the once mighty Quest Studios site has gone down.  It hosted an extensive Sierra sound track library, both recordings and MIDI files take directly from the games.  It also had many arrangements of Sierra tunes and a lot of information about the MT-32 and MIDI utilities for it and other old sound cards. This was the site where I first really understood what an MT-32 was and why it was so special.

The site had been merely maintained for years, but it was on its the forums that ignited an interest in retro PC hardware.  In its day it was the place where new discoveries were made.  On that forum, the differences between the generations of MT-32 hardware became generally known.   I made many a trade using that forum as well as my best online friend.

However, by 2012 the forums were not seeing much action, most of the interest in vintage hardware having gone to VOGONS and the trading gone to Amibay.  The forum's software was not updated, leading to a mostly-broken search function.  Links on the main site to files started to break and repairs were not quick to come.  In late April of 2015, the site was hacked, causing people who followed a Google link to be redirected.  The hack looked simple and at first seemed to be repaired, but searching the site or forum using Google saw the user encounter the hack again.  The ISP recommended that they upgrade their hosting software, but that may not have worked with the site files compromised.  The other alternative was to reload the existing clean SMF software, then upgrade.  While this may or may not be done, the site has been taken down in the meantime.  The site owners are older and may not feel it is worth the trouble to put it back up. All that remains currently is a simple placeholder page directing the user to the owner's Youtube channel, with no Sierra or vintage hardware content to be seen.

MobyGames : New Management but No Interest

I knew that Trixter had founded MobyGames way back in 1999, but it never really sunk in that he had not been actively administering the site for years.  I contributed a few screenshots and reviews here and there, but I was not going to win any contribution awards.  Then in September of 2013 the site received a massive resdesign that essentially destroyed most of its usefulness.

Fortunately, this state of affairs lasted for less than three months.  In December of 2013, a redesign was launched which has persisted with some minor changes to the present day.  However, I have never felt the desire to contribute to the site since the bad redesign.  The pre-September 2013 design was not particularly friendly to portable computing, but the bad redesign satisfied neither the traditional desktop or the tablet/smartphone crowd.   The December 2013 redesign can be lived with and I often go to MobyGames for research or because I need screenshots and am too lazy to take them myself.

Before the redesigns, I found the contribution approval system to be slow and fickle.  I had trivia or even whole games waiting for over a year for some action.  There were screenshots that needed review by someone higher up the chain.  Of course, when you are an expert, it is very annoying to have to wait for a second opinion from someone who is unlikely to be as well-informed.