Thursday, November 19, 2015

Atari Hardware Explained

The Atari 2600 is a very compact system, even though this may not be reflected in the standard woodgrain case in which it is housed.  Inside each system are three chips, the CPU, the Television Interface Adapter (TIA) and the RAM, Input, Output & Timer (RIOT).  These three chips work together along with a cartridge, switches and a controller to display games to a TV.  Lets discuss how the design of these chips influences the games that were produced.

CPU

First, lets start with the CPU, which is a MOS 6507 (a.k.a. C010745).  The 6507 is a budget version of the 6502 an in the Atari 2600 it runs at 1.19MHz (1/3 of the NTSC color clock frequency).  It is a fully-functional 6502 in a 28-pin package.  The full 6502 comes in a 40-pin package.  As a result of the size reduction there is no support for hardware interrupts and the 6507 only has 13 (of a maximum of 16) address lines.  This limits the amount of addressable memory that the CPU can access directly to 8KB (kilobytes).  Unlike the NES's 6502 variant, the 6507 has a functional binary-coded decimal mode.  The TIA is connected to the CPU's RDY line, so it can halt the processor.

RIOT

Next comes the RIOT chip, which is an MOS 6532 Peripheral Interface Adapter (a.k.a. C010750).  This 40-pin chip contains a programmable timer, 128 bytes of RAM and two 8-bit parallel input and output ports.  It has 9 registers, some of which are read only, some write and some can do both.  The timer counts down an 8-bit value by one of four orders of magnitude.  128 bytes of RAM substantially limits the complexity of games because that is where all a program's variables must live.  In addition, this RAM is also used by the stack.  The stack is vital for subroutines, which can be many in a game.  On the plus side, the RAM is located in the 6507's zero page, so accessing it will be fast.

One of the I/O ports is exclusively used for input from the five switches on the console, one bit for each switch.  Each bit of the second I/O port can be set to be an input or an output.  As an input, it reads the four directions from each joystick (one direction per bit), the paddle button from each of the four paddles or the position of the driving controller.  As an output, it strobes the keyboard controllers.  This I/O port can also be used to write to and read from more modern port peripherals like the AtariVox.

TIA - Input and Sound

Finally we come to the TIA, the most complex chip in the system.  This is a custom 40-pin Atari chip C010444D which Atari strangely never got around to patenting, leading to cloned chips from Mattel and Coleco later in the 2600's life.  It was never an off-the-shelf chip, unlike the 6507 and 6532.  The TIA handles all graphics and interfacing with the TV, all sound and handles the remainder of the inputs.  It is also mapped into the zero page of the 2600's memory map.  It contains 45 write-only registers and 14 read-only registers.  Let's discuss its features in inverse order of complexity.

The TIA has four input ports, each dedicated to the input from a single paddle.  Paddles are read in a way similar to how a joystick is on the IBM PC.  A write to a certain register discharges the a capacitor and the position of a connected potentiomer dictates how long it takes to charge the capacitor.  The length of time it takes the capacitor to charge dictates the position of the paddle.  These registers also are used to read the keyboard controllers.  Essentially the keyboard controllers act like paddles set to a specified resistance value.  It also has two ports for reading the state of the joystick switches or the driving controller buttons.

Sound on the 2600 is geared more toward creating interesting sound effect than music.  Each of the two audio channels can emit a pure square wave tone, but there are only five bits to divide the frequency. The range of the 2600 is from 30,000Hz (divide by 1) to 937.5Hz (divide by 32).  Even the less than impressive TI SN 76489/96 has 11-bits of frequency control.  There are 4-bits of volume control, but the 2600 is just not very musical.  Even so, some games like Gyruss, Mountain King and Supercharger Frogger have impressive music.  The noise is based off a polynomial counter tweaked by various settings. There are 16 combinations (10 unique) of tone and noise to choose from in the 2600, and they are much more geared to sound effects.  You can hear what each selection and frequency sounds like here : http://www.randomterrain.com/atari-2600-memories-batari-basic-music-toy.html

TIA - Graphics

Most of the CPU's time is spent drawing the graphics, line by line.  The 2600 does not have a frame buffer and it does not have dedicated video memory.  More modern game consoles write the graphics data into a frame buffer and into sprite memory and let the video display chip take care of drawing it to the screen.

Atari 2600 graphics have to be fed into the TIA each and every line that the TV draws.  Whatever time is left over during horizontal blanking (the time it takes for the TV's electron beam to return from the right side of the screen to the left) is spent on setting up the graphics for the next line.  This is what is called racing the beam.  The vertical blanking period, (the time it takes for the beam to return to the top left portion of the screen from the bottom right) is typically used for game logic, sound and input reading.

The Atari 2600 is capable of displaying 128 colors, 8 of which are solely grayscale from black to white.  The remainder are spread across the NTSC color wheel with a great variety of variation.  The horizontal resolution of the Atari 2600 is always 160 pixels.  The vertical resolution of the Atari 2600 is not fixed but typically is 192 lines.  It is up to the programmer to start the vertical retrace period.

The graphics are made up of seven elements, a background color, a playfield, two players, two missiles and a ball object.  The background and the playfield make up what would be known in later consoles as the background graphics and the player, missile and ball objects would later be known as the sprite graphics.

Combat - Note the reflected playfield and the two players.  Each player fires a missle with the same color
The background color a single color that is set for the entire TV area, unless changed on a particular scanline.  When the color is changed it can be masked by the playfield.  Air-Sea Battle has frequent changes of the background color.

The playfield consists of 20 bits per line.  If a bit is on, the playfield color is displayed.  If the color is off, then the background color is displayed.  Each bit of the playfield is four pixels wide, giving the backgrounds to Atari 2600 games a characteristic low resolution look.  Additionally, those 20-bits only cover the left side of the screen, so the right side of the screen displays a duplicate or a mirror image of the left side of the screen.  This tends to give the backgrounds a symmetrical look in many Atari 2600 games.

Combat - Note the second copy of Player 2, the repeated playfield and that the playfield has priority over the players
When you see counters or scores on the top of the screen, these are usually playfield graphics.  But as I mentioned, there is only enough room in the playfield registers for half the screen, so what happens when one side's 0 turns into a 1?  You can time your writes to the playfield registers in mid scanline so you get a different playfield on the right side as opposed to the left side.  You can also set the colors of each side to the colors of the player 1 and player 2 objects.

Video Olympics - The ball object is used, and the scores are playfield bits changed in midscanline
The ball object is a one pixel object that can be placed anywhere on a scanline.  It uses the same color as the playfield on the same scanline.  The ball was intended to make Pong games like Video Olympics possible on the 2600.

The player objects are up to eight pixels wide, with a 1 bit showing the player color and a 0 bit showing a background or playfield color.  Two players, two colors.  Each player has a one pixel missile object associated with it which is the same color as the player.  Each player and missle object can also be placed anywhere on a scanline.  Multi-colored objects are accomplished by changing the color of the player object each line.  These graphics are best suited for Tank-line games like Combat.

Space Invaders - The player cannon is stretched, and each invader is a player copied twice, the copy is removed when shot
Ball and missile objects can be stretched to 2, 4 or 8 pixels.  Each player object can have one or two additional copies spaced at set intervals.  This is what makes Space Invaders possible.  The player can be stretched 2x or 3x horizontally and be reflected (to face left instead of right).  Players and missiles are typically displayed over the playfield graphics, but can be set to have the playfield graphics displayed over them.

In many games like Space Invaders and Ms. Pac Man, you will see a serrated series of lines across the left border of the screen.  These lines are used to delay the start of the graphics drawing, giving the programmer more time to write graphics to the next line.  In the 2600, you always have to be one line ahead of the raster. In fact, the standard Activision practice was to blank out the entire left column of the screen for 8 pixels or so.

Pitfall - Player, missile, ball and playfield graphics all combine on various scanlines to make a complex background
In Video Checkers, there are four pieces per row, three of which are provided by a player object and one provided by a stretched missile object.  Lucky for Atari standard checkers is played with a maximum of four pieces per row.  However, the same effect is insufficient for Chess.  Atari used a Venetian Blinds effect used in Video Chess.  This is necessary because each player object can only draw three objects on a line, and you need eight in chess.  So in Video Chess, they alternated the drawing of the chess pieces every other line. This eliminated flickering.  They also had to alter the player graphics in mid-frame in order to make the king's row pieces distinct for each side.

Yar's Revenge - The Neutral Zone is a visual representation of the game's code
Color cycling was one of the hallmarks of Atari graphics, from the Chalice in Adventure to the Neutral Zone in Yar's Revenge.  The color registers are often updated many times per second.  In Yar's Revenge, the bit pattern of the code in ROM was used to give a pseudo-random appearance to the Neutral Zone.  Color cycling was also done for many of the early 2600 games because this was believed to reduce screen burn-in if the TV and the 2600 were left on.

Video Checkers - Each Player has two copies and stretched missiles make up the fourth checker on each row
Scrolling the screen was uncommon on the 2600 because there were no scrolling registers, everything had to be done in software.  Vertical scrolling was easier due to the line-based nature of Atari graphics and because the programmer could tell the TIA when to stop drawing scanlines.  Raiders of the Lost Ark, Jr. Pac-Man and Haunted House all have vertical scrolling.  Horizontal scrolling was a bit trickier, but it could be done.  Mountain King, Stargate/Defender II and Dragonstomper all do it well.

Video Checkers - Each piece is a Player object is staggered compared to the next and drawn every other line.  The background is very large to give the programmer more time to update the individual pixel patterns without flickering
There are hardware collision registers for each combination between the six objects.  Reading a register will tell you if there was an intersection between player 1 and missile 2, for example.  While this saves the programmer from having to determine the collision by having to compare the position values of the two characters, it can also lead to too-strict hit control.  If a missile hit a non-visible player pixel, it will still register a hit.

The Stella emulator can turn on and off each of the objects at will.  If you ever wonder how so few objects can make up the screen, try turning off some.  Collisions can be disabled as well, people tend to use this to cheat.

Cartridges and Memory

Standard Atari 2600 Cartridges contain a 2KB or 4KB ROM chip.  4KB is the maximum amount of ROM the 2600 can address without any bankswitching hardware.  To address more ROM, you had to include additional hardware in the cartridge to handle the swapping.  Most bankswitching schemes reserve certain addresses.  When you write a value to the reserved address, it swaps in another 4KB section of the ROM. Some schemes are more complicated, but this is the general idea.

Asteroids was the first commercially released game to use more than 4KB.  Approximately 20% of Atari 2600 games used more than 4KB of ROM, and almost none used more than 16KB.  However, most Atari 2600 games did not have title screens because they always require precious space in ROM to program.  The title on the cartridge should have been enough for everybody, or so the thinking went.  Also, if you wanted to know what the differences between the various game options are, you have to look in the manual or figure it out through observation.  There was no space for the game itself to explain options.

Some Atari 2600 Cartridges also include additional RAM, usually 128 or 256 bytes.  This RAM is mapped somewhere into the cartridge space and one set of 128 or 256 byte addresses is used for reading and a second set is used for writing.  This is because there is no read/write line sent to the cartridge slot.

The most unique game device for the 2600 was the Starpath Supercharger, which transferred binary data played on cassette tapes to a large cartridge which contained 6KB of RAM and a ADC.  I have discussed this device's operation in more detail elsewhere : http://nerdlypleasures.blogspot.com/2014/06/arcadiastarpath-supercharger-cassette.html

The B&W switch on the 2600 does nothing if the program ignores it.  If the program responds to the B&W switch as it was meant to be used, it will set the graphics to use colors that will show up better on a B&W TV.  B&W TVs only understand the eight levels of luminance the Atari 2600 provides.  However, there is nothing special about the B&W switch or any of the other non-power switches, and the B&W switch was used for other purposes on occasion : http://nerdlypleasures.blogspot.com/2015/03/the-forgotten-switch-atari-2600s-b.html

Enhancements

The TIA contains two audio channels that operate identically but are mixed together outside the chip.  The 2600 was originally planned to be a stereo console with two speakers installed in the 2600's case, but this idea was scrapped as being too costly.  Some of the earliest games (Combat) and a few homebrews (Medieval Mayhem) support stereo audio, but you have to modify your system to hear stereo audio.

The Atari 2600 outputs RF video only, which is less than desirable in the year 2015 for many people.  The chip outputs the color, c-sync and three luminance levels on separate lines.  The luminance levels are mixed and balanced with an R2R network and mixed with the other signals and sent to the RF modulator.  Composite and S-Video mods have existed for years.  However, S-Video is the best you can get from the TIA without substantial additional hardware.

There is an Atari 2600RGB adapter which will provide RGB video. It requires removing the TIA chip and inserting it into a custom board.  The board has an FPGA that will take the values in the color registers and translate them into RGB values.  It will also provide S-Video and Composite Video output.  Because there are only six graphical objects and the background color and four color palettes to keep track of, the FPGA can keep track of this by snooping on writes to these color palette registers.  In order to keep track of the objects as the pixels are displayed, each set of objects is assigned a different black and white palette and intercepts all writes to the palette registers.

Because of the non-standardized method (every game can do it differently) the 2600 uses to indicate that it is time to do vertical blank to the TV, some games may have some trouble when upscaled with an X-RGB Mini Framemeister. The original Warlords is one such game and there is a patch available.

Sunday, November 15, 2015

Will the Real Successor to the Pitfall Legacy on the NES Stand Up?

There never was a game called Pitfall III.  David Crane programmed the original Pitfall for the Atari 2600 in 1982 while working for Activision, a company he co-founded.  Two years later he released Pitfall II: Lost Caverns for the Atari 2600.  Thereafter came the great Video Game Crash and Crane left Activision in 1986 to co-found Absolute Entertainment.  While there would be other games in the Pitfall series, this blog entry will discuss three games released or were to be released during the third generation of home video game consoles would could compete for the right to be called the successor to the Pitfall Legacy.

In the Beginning: Pitfall and Pitfall II: Lost Caverns

Pitfall essentially made David Crane as close to a household name as video games got before the Crash and cemented his reputation as a game designer worthy to be inducted into The Academy of Interactive Arts & Sciences' Hall of Fame.  This game was a massive success in its day, selling over four million copies and ported over to all the major consoles and many of the popular home computing platforms of the day.

Starting Screen with Stationary Log
Pitfall is one of the first platforming and side-scrolling games, even though the Atari 2600 hardware did not accommodate scrolling and this game only used static screens.  This game was inspired by Raiders of the Lost Ark and invited players to explore a large, non-randomized world.  In fact, Pitfall is actually far more popular than the official 2600 Raiders adaptation because Crane was able to pare the exploration concept to the basics while still maintaining a sense of fun.  You can just pick up and play Pitfall, Raiders requires reading the manual and a lot of trial and error in order to make any sense out of it.

Swinging over a crocodile lake
There are many dangers in Pitfall : tar pits, lakes (both of which can expand and retract from what appears to be solid ground), crocodiles, scorpions, snakes and campfires that can kill your character, Pitfall Harry.  Logs can steal points if you collide with them, vines can allow you to cross over dangers, you can jump on the crocodile's heads to get over water, ladders and holes allow you to go underground and the underground passages allow you to "warp" a few screens, if there is no brick wall in the way to block you.  Multi-colored "sprites", a relatively detailed background and catchy sound effects and jingles make the game a visual and aural treat for the 2600.

Swinging over a tar pit and rolling logs
Finally, there is plenty of challenge in that you have to locate 20 treasures strewn across 256 screens in 20 minutes with 3 lives.  You will need to map and plan carefully and identify useful warp passages if you want a good chance of finishing the game.  Important to note that unlike most other Atari 2600 games this game will end (it just stops) if you find the twentieth treasure.

Camping out
One other important theme to note here is that Pitfall Harry has no way to kill any of the enemies which he encounters.  In Pitfall, you have to jump over or otherwise avoid all obstacles, including animals.  This aspect will be maintained in the other games Crane designed and discussed in this article.  Ultimately finding non-violent solutions is a recurrent theme throughout almost all the games Crane has designed.

I forgot to bring my tambourine
Two years after Pitfall, Crane released his sequel, Pitfall II: Lost Caverns.  He did not reinvent the wheel or take the series into a radical new direction.  Some sprites and mechanics were taken from the previous game and the two games are visually similar.  However, he expanded the concept by taking the basic exploration theme of the original game (which only used the horizontal plane) and expanded it into the vertical plane.  There are eight horizontal screens and twenty-seven vertical depth levels which you can explore.  In other words instead of having 255 screens stacked together horizontally, you have a grid of 8x~8 screens, adding an extra dimension to the world.

Starting Screen with Checkpoint and Eventual Goal
Now Pitfall Harry can swim in water and has checkpoints to start at if he is "killed". You do not die in this game, you just get sent back to the last checkpoint.  Nor is there a time limit.  There are several new enemies, like electric eels, frogs, vultures, bats, the rat and the return of the scorpions.  The  vultures and bats travel in a repeating pattern across the screen.  In addition, each time you enter the screen they may start from a different position than the previous time you entered the screen.  This makes it hard judge when you can run underneath them, but you have to run past them to make progress in many areas.  At one point you will need to catch a balloon to progress further in the game.  

Bat and Rat
You can find typical gold brick treasures for points, but the object of the game is to find your pet Quickclaw, your girlfriend Rhonda and a diamond ring.  The game ends when you obtain all three with Harry doing some victory jumps before the game stops.  You loose points by colliding with enemies or falling and landing after a certain height.  The screen scrolls vertically as you descend and explore the "lost caverns".  The look of the game is still very much in line with Pitfall, and like Pitfall, the only thing you can do is climb and descend ladders, walk left and right or jump.

Scorpion, Swimming and Treasure
Crane designed a special hardware chip for the cartridge called the DPC.  Because of this chip, Pitfall II was undoubtedly the most complex cartridge ever to be released on the Atari 2600 during its lifetime.  The DPC chip allows bankswitching up to 10KB of ROM (Atari carts are only 2K or 4K without bankswitching; Pitfall is a 4K game), a hardware random number generator, hardware to assist with graphics processing and hardware to generate the data to feed into the internal 2600 audio to create three additional channels of sound.  There was not enough space to put the Adventurer's Edition second quest into the 2600 original that was present in the Atari 5200, 8-bit and Commodore 64 versions of the game.

Watertfall and Electric Eel
Frogs, Ladders and Multiple Levels
Thanks to the DPC chip, Pitfall 2 has music playing throughout.  There are four pieces of music, the treasure theme, the return to checkpoint theme, the default theme and the balloon theme.  This music plays according to what happens during the game.  Multi-channel music as heard in Pitfall 2 is difficult to pull off on the 2600, but when coupled with an advanced game engine like Pitfall 2's, it needed hardware assistance.

Multi-level Madness
Vultures
A Boy and his Blob


Title Screen
Start Screen
The 2600 was too long in the tooth when David Crane was developing A Boy and his Blob, the 7800 and the Sega Master System did not have the market share and the Commodore 64 was dying in the US.  Having left Activision, he had no more right to create a Pitfall sequel than I would.  He ended up creating A Boy and his Blob for the dominant platform of the day, the NES.  A Boy and His Blob to me feels like Pitfall III and in addition to having its creator at the helm, let me explain the design similarities between this game and its Pitfall predecessors.

No money, no healthy food

A subtle way to inject the production team into the game
The Boy in the title is less capable than Pitfall Harry, he can only move/run left and right, he cannot jump unaided.  However, he has a companion, the Blob, which functions as a puzzle solving device.  Using different flavored jelly beans, the Blob can do different things.  Need a ladder, feed him the licorice jelly bean.  Want to drop down to the next level, turn the Blob into a hole with the punch jelly bean (you can do this multiple times for one bean).  While you have 15 flavors to choose from, your supply of jelly beans is limited and you need to use them wisely.  The Blob and jelly bean mechanic represents an evolution over using the character's own abilities to get past obstacles.

Treasure and Subway Serpent
Don't try this in real life
Like Pitfall 2, this game requires exploration of caverns beneath the surface.  Similarly, the game is structured in a grid of non-scrolling horizontal screens.  Unlike Pitfall 2, the screens do not scroll vertically, despite the superior NES hardware.  I do not believe this was done because David Crane could not figure out NES scrolling but because the levels were so vast and less structured than Pitfall 2 that it would have made map making much more difficult.

Cinnamon & Spice
The caverns have many dangers, including subway serpents, falling rocks, spider webs and stalactites and stalagmites in the water.  However, unlike Pitfall 2, the omnipresent danger is death by falling.  If you fall more than one and a half screens (without a device that can ease your fall), you die.  You start off with five lives in this game and no continues.  Also, your Boy moves a lot looser than Pitfall Harry, so you may run into something you cannot avoid and cannot turn back quickly enough to lose a life.  You cannot swim but the Blob can help you with that.  Finally, if you lose a life you will start at the point where you found your last treasure similar to Pitfall 2's checkpoints.

That Blob is very strong
But running under those subway serpents is still tricky
Mind your height
The goal of the first half of the game is to find treasures and escape the caverns.  There are 22 treasures located in different areas of the underground caverns, similar to Pitfall 2.  At the bottom of the caverns you will find an underground lake just like in Pitfall 2.  These treasures allow you to buy vitamins that you will need on the Blob's home planet, Blobolonia.  The second half of the game is a shorter experience where you have to dodge more enemies and defeat the evil, sweets-loving emperor.  Ultimately, gameplay is the key focus of this game.  The graphics are drab and backgrounds are mostly black underneath the subway.  It is quite easy to get lost because screens often look alike.  Music is limited to one basic piece of music for the game (in addition to the title screen music) and a few sound effects and ditties that play at certain times.

You will need to do this very often
Super Pitfall

Title Screen
I am aware that there is a game for the NES called Super Pitfall, but that is an abomination that David Crane had nothing to do with.  It is a port of a Japanese PC-8801 game by Pony Canon where is was called Super Pit Fall. Post-founders-era Activision licensed the title and published it as one of its first NES games. Activision may hold the rights to the Pitfall brand, but that does not mean it earns a place here considering its pedigree.

Spider and Bat Enemies and Water
Super Pitfall is a stripped down port from programmers who did not quite get the NES.  Scrolling is choppy, graphics are barely NES-worthy, the music is a 15-second piece intended to give you an idea of what hell feels like and there is quite a pause as the level loads.  You can now duck and shoot a gun with limited ammo and there are a couple of bosses, which pretty much sums up the evolution of this game over Pitfall 2.  Hit detection is unfair.  Even the manual states that the gun will feel useless at times, which is refreshingly honest. You can see glitches with sprites not infrequently.  The gun mechanic does introduce an element foreign to Crane's Pitfall games.  Also, items are invisible, so you have to jump in certain places to make them appear.  The game is filled with cheap deaths, in fact if you go down the first ladder in the game you will almost certainly die.

Bats and Frogs
Like Pitfall 2, you have to obtain the diamond, the pet and the girlfriend to win the game, but there are more obstacles to overcome. The world is huge (270+ screens) but you only have three lives and no continues, so it will be difficult to get a feel for it.

Waterfalls, Spikes and Treasure
Super Pitfall 2


Title Screen
There was going to be a game called Super Pitfall 2 released for the NES, but was canceled.  There is a prototype ROM floating about.  Super Pitfall 2 was a port of another Japanese game, this one a Famicom game called Atlantis no Nazo (Mystery of Atlantis) by Sunsoft.  The prototype appears to differ from the Japanese original only in its title screen.

1st Zone
Unlike Super Pitfall, Super Pitfall 2 is competently programmed.  Sunsoft was willing to hire competent programmers, Pony not so much.  The graphics are still bland but the music is pretty decent and the control is not quite as frustrating.  Your weapon is a bomb that you can throw, but it detonates when it wants to and can kill you if you are in its (short) blast radius.  The jumping could use more polish (you cannot change your trajectory in mid jump like Castlevania) and the game will get frustrating very quickly.  The bats dropping guano as a weapon is a nice touch.  The shell crabs will hide in their shells if they perceive a bomb coming, so killing them is a bit tricky.  Still, the violent solution is out of place in Crane's Pitfall games.  

2nd Zone
Ultimately, Super Pitfall 2 is really a horizontal side scroller.  The level progression is fairly linear and it does not feel like a Pitfall game at all.  You can find doors that will take you to a small portion of a later zone, but the game is still linear.  Even Super Pitfall was better at conveying an open world.  Pitfall's influence on the game is still present.  The enemies appear to be mostly of the natural variety and there are treasure chests you can open for points.  Between its lack of a real Pitfall feel and its rather long-in-the-tooth status for 1989 when Activision was considering porting it, it is no surprise that it eventually went unreleased.  An optimist may wish to believe that Activision saw that its former founder had released a Pitfall-like game in the same year and did not want to compete with him, but my idea is probably the more likely reason.

3rd Zone

Wednesday, November 11, 2015

IBM PC Floppy Disks - A Deeper Look at Disk Formats and Copy Protection

I.  Overview of Low-Level Floppy Disk Structure

I am going to be using a standard 360KB floppy disk as an example here.  A standard MS-DOS format command formats a 360KB floppy disk with 40 cylinders, 9 sectors per cylinder and 512 bytes per sector.  I distinguish between cylinders, which use both sides of the disk, from tracks, which only use one side of the disk.  Thus you get a total disk size of 368,640 bytes.  However, that is the space available for data bytes and a standard disk dump just dumps the data sectors.  In between the data there is extra data allowing the disk drive to find the right data.

Each sector has a Sector ID field and Sector Data field.  Between the Sector ID field and the Sector Data field are two kinds of bytes.  Before the Sector ID field there will be Gap bytes.  These Gap bytes, typically hex 4E, are used to compensate between slight differences between the drive that originally wrote the disk and the drive that is currently writing the disk.  Without some tolerance, the Sector fields may overwrite each other.  After the Gap bytes come the Sync bytes, which help tell the drive that there will be a Sector ID field or a Sector Data fields coming up next.  Sync bytes follow a pattern of 00s followed by three A1s.  This area is missing the normal clocks and does not follow proper MFM encoding rules so the drive controller can figure out that this is not real data and the real data is coming up.  The A1s are also called the Sync mark.  Gap bytes and Sync bytes precede both the Sector ID field and the Sector Data field.  

The Sector ID begins with an FE byte as an Address mark.  Then it continues with track number (00-27), the side number (00-01), the sector number (01-09) and finally the size ID byte (00-06).  Unlike everything else, sector numbers use a convention starting with 01, not 00.  The size ID byte tells the system how large the follwing Sector Data field is and is interpreted as follows :

Size ID Byte   Actual Size in Bytes
00             128
01             256
02             512
03             1024
04             2048
05             4096
06             8192

The only sector size the standard DOS FORMAT command will use is a 512 byte sector size.  This applies to all standard 5.25" and 3.5" disks and drives, whether double density (160KB, 180KB, 320KB, 360KB & 720KB), high density (1.2MB and 1.44MB) or extra high density (2.88MB).  You can use third party utilities to format disks with other sector sizes, but DOS will not read them.  Note that a track on a 360KB disk cannot really fit 8192 data bytes.  I have never come across a disk that has had more than 10 x 512 byte sectors.

The next two bytes form a 16-bit Cyclic Redundancy Check (CRC) value.  The CRC value verifies that the information contained in the sector ID field is correct.  Sometimes there may be some junk bytes between the CRC value and the next sequence of Gap bytes.  

As stated above, after more Gap bytes and Sync bytes comes the Sector Data field.  The sector data field begins with an FB byte as an Address mark.  Then comes the actual data, the bytes you see with a standard disk dump.  Finally comes the 16-bit CRC value.  

A Sector ID field, without the Address Mark and CRC Value, is 4 bytes large.  A Sector Data field without the Address Mark and CRC Value, is typically 512 bytes large, otherwise the size is whatever the Size ID Byte indicates.  Gap Bytes and Sync Bytes do not have a set size.

For standard DOS compatible 160KB, 180KB, 320KB and 720KB disks, the only thing that changes is the track number, side number and sector number.  160KB and 180KB disks only use 1 side of the disk, 160KB and 320KB disks only use 8 sectors, and 720KB and larger disks use 80 tracks.  High density disks use 15 (1.2MB), 18 (1.44MB) or 36 (2.88MB) sectors per track.  

In a hex viewer, a full sector dump might look like this :

4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E
00 00 00 00 00 00 00 00 00 00 00 00 00 A1 A1 A1
FE 04 01 06 02 xx xx 4E 4E 4E 4E 4E 4E 4E 4E 4E
4E 4E 4E 4E 4E 4E 4E 00 00 00 00 00 00 00 00 00
00 00 00 00 A1 A1 A1 FB 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 55 53 45 52 44 41 54 41
55 53 45 52 44 41 54 41 xx xx

Green = Gap Bytes
Red = Sync Bytes
Blue = Address Mark Bytes
Magenta = CRC Bytes
Black = ID and Data fields

The hex values in the data field repeat the ASCII for USERDATA over 64 times.  

II.  Floppy Disk Encoding

A floppy disk is a magnetic storage mechanism.  Data is encoded through a flux reversal, the change in the polarity of a magnetic field from north to south and south to north.  A flux reversal could signify a 0 or a 1 bit. We start with the proposition that a 0 is represented by no flux reversal and a 1 is represented by a flux reversal.  However, this scheme is not workable because it becomes too difficult to keep track of the bits when there is a prolonged period with no flux reversals.  

Thus the Frequency Modulation (FM) method was first used.  In this method, a 0 bit is encoded by a flux reversal followed by a no flux reversal, and a 1 bit is encoded by two flux reversals.   Thus for there will be at least one flux reversal for every two pulses of the clock.  This method is used in the earliest floppy disk controllers, but for home computers only the Atari 8-bit drives used it.  These disk drives were called single density.  The IBM PC floppy disk controllers that use an NEC uDP765 or 100% compatible like the Intel 8272 support FM encoding.  Later floppy disk controllers lose that functionality.

This system was easy to implement, but not very efficient.  The next improvement was the Modified Frequency Modulation (MFM) method.  In this method, a 0 bit preceded by a 0 bit would be encoded by flux reversal then no flux reversal.  A 0 bit preceded by a 1 bit would be two clocks of no flux reversal.  A 1 bit would be no flux reversal followed by a flux reversal.  On average this only requires half the flux reversals per bit as in the FM scheme.  The fewer flux reversals needed, the more data can be stored on a disk.  The disks that supported this system were called double density.  All IBM PC compatible floppy disk controllers use the MFM encoding scheme, as did the earliest hard disk drives.  

The data line of a floppy disk does not operate in a vacuum.  There is a relationship between the MFM clock bits and the MFM data bits.  Both are present on the Write Data and Read Data lines.  There are two data bits for every clock bit.  Normally the two are in sync, meaning that the clock bits correspond exactly to the MFM data bits.  But there is one time when they intentionally are not, the Sync bytes.  How this happens is as follows :

In MFM encoding, there will never be more than three 0 bits between a 1 bit.  However, with this limitation is more liberal than how the bits are actually represented in MFM.  The A1 in the Sync bytes does not follow the appropriate clock and data bit pattern. A1 should be encoded as data bits 100010010101001 and clocking bits 0 0 0 1 1 1 0 and is encoded that way in a Sector Data field (there is no reason for it to appear in a Sector ID field).  However, to put the A1 out of sync, the following pattern is produced by the clocking bits : 0 0 0 1 0 1 0.  The resulting fifth bit is not as it should be, instead it appears as 100010010001001, with the fifth bit being different.  This error signals to the disk controller that this is a Sync byte.  

III.  Copy Protection

Copy protection methods on the IBM PC platform ultimately generally work within this scheme.  Other systems like the Apple II, Commodore 64, Atari ST and Commodore Amiga have controller hardware that allows far more sophisticated protection methods to be used.  The PC disk controller will not tolerate the more bizarre methods like half tracks, fat tracks, spiral stream, offset tracks or varying bitrate speeds.  

The simplest methods are to use non-standard sector sizes, sector numbers or tracks.  This is good enough to bypass DISKCOPY and FORMAT, but any utility that uses the PC BIOS can format a disk with non standard.  Each track and sector within the track can have differing sector sizes.  

Another simple method is to use the write protection tab/notch on a disk.  If a program expects the disk to be write protected, it may try to write a destructive sequence of bytes to the disk.  Of course, the original disk should have no tab or notch.  Be wary if you see a disk notched roughly via scissors or with a hole punch.

A common method is to intentionally write a disk with erroneous CRC bytes.  A standard IBM PC Diskette Adapter can read, but not write erroneous CRCs.  Of course, sectors with data that cannot be reliably read will also return CRC errors.  It is then up to the person de-protecting the diskette to figure out whether the error is intentional or unintentional.  

Another method is to check that the exact number of Gap and Sync Bytes are on the disk.  If the original disk was written with 16 of each and the copy only has 15, that is a way to detect the copy.  The program could instead read data from the Gap bytes, like an encryption key.  The PC disk controller's read track command would read the Gap bytes.

A method used the Sync bytes to let sectors overlap.  The disk can play with the sector ID sizes to make no sense physically, like having sector 1 with an ID of 8192 bytes and then fitting the other sectors "within" sector 1.  This protection can often be fooled by writing the image to a high density disk, which allows for 15 or 18 sectors per track.  Of course, high density disk controllers were far from ubiquitous in the 1980s when most of these games were released.

A devious method used weak bits.  In this case, the game would read an area on the disk where the flux transitions have not been written with sufficient magnetic force to make the transitions able to be read reliably.  The game would not expect the same result to be returned from multiple reads of a sector.  If the same results were always read back, the game would fail to work, thinking it was being run on a copy.  Unfortunately, if the disk was damaged unintentionally or the flux transitions have lost their force with age, a flux copier like an Option Board,Deluxe Option Board, a Kryoflux or a Super Card Pro may misinterpret this and make a bad copy.

IV.  Known Protection Schemes used in Games :

Cops Copylock II

The Rising Dynasty (HD media used)

Electronic Arts IBM Interlock

Used by Electronic Arts booters, involves 96 interleaved sector IDs, typically at track 15, side 0.  They also use 200KB and 400KB disk sizes with 10 sectors per track.

Amnesia
Archon: The Light and the Dark
Hard Hat Mack
Marble Madness
Murder on the Zinderneuf
One-on-One
Pinball Construction Set
Seven Cities of Gold, The
Super Boulder Dash
Timothy Leary's Mind Mirror
Will Harvey's Music Construction Set

Formaster Copylock

Contains a sector with errors, usually at at sector 20, side 0, sector 5.  The sector ID is marked as having 256 bytes, but actually has 512 bytes, fooling copiers like TeleDisk.  Used mostly by Sierra.  This protection will probably fail at speeds greater than an AT (8MHz 80286)

B.C.'s Quest for Tires (regular version)
Blockbuster (Second release)
Computer Baseball
Crossfire (IBM PCjr floppy disk version)
Gato (Versions 1.0-1.3)
Hardball (Disk 2/EGA Disk, early version only)
King's Quest (IBM PC-CGA version)
Mr. Cool
Paperboy (Second release)
Pinball Wizard
Oil's Well
Quink
Sierra Championship Boxing (1984 version)
Top Gun
Troll's Tale
Ultima II (1983, 1984 versions)
Ultima III (1984, 1985 versions)
Wizard and the Princess, The (IBM PCjr version)

H.L.S. Duplication

Accolade and Epyx used this type of protection.  There is an additional sector ID field in one of the sectors.

Ajax
Bad Dudes
Boot Camp
California Games
Gauntlet (later version)
Grand Prix Circuit (early version only)
Hardball (Disk 1 only)
Mini-Putt
Rush 'n' Attack
Test Drive
Test Drive II

Microprose Protection 1
Protection is found on track 4, side 0.  Uses overlapping sectors.

Gunship (certain versions)
Sid Meier's Pirates

Microprose Protection 2
Protection is found on tracks 38-39, side 0.  Uses overlapping sectors.

Airborne Ranger
Dr.Doom's Revenge
F-15 Strike Eagle II
F-19 Stealth Fighter
M1 Tank Platoon
Sid Meier's Pirates (432.02 and above)
Red Storm Rising
Rick Dangerous
Savage
Stunt Track Racer
Sword of the Samurai
X-Men

Mindscape DEM
This protection will probably fail at 386 speeds (16MHz and above)

Inflitrator 2
Italy '90
Paperboy (early version)

Minder03
Used by Prism Software

Pipe Dream (European version, U.S. version by LucasFilm Games used a Codewheel)

Non-standard Sector Sizes
Probably the earliest method of copy protection.  Self-explanatory, can easily be copied with TeleDisk.

Adventure in Serenia
Agent USA
Arkanoid (Imagine version) & Super Tennis
Below the Root
Gremlins
Jungle Hunt
King's Quest (IBM PCjr. version)
Microsoft Flight Simulator v1.00
Sid Meiers' Pirates! v432.03
Pitstop II
Trains (DOS version)
World Games

On-Line Systems Protection #1

Frogger
Ulysses and the Golden Fleece

Origin Systems OSI-1

Used by all Origin Systems games with an EXE executable.

Ultima I: The First Age of Darkness
Ultima II: Revenge of the Enchantress (Ultima Trilogy version only)
Ultima IV: Quest of the Avatar
Ultima V: Warriors of Destiny

Rob Northern Copylock

Uses weak bits and calculates the entropy expected.  Encrypts the actual executable and stores a 32-bit decryption number on a bad sector.

Frank Bruno's Boxing (Compilation version)
Lemmings
Oh No! More Lemmings (comes in disk-based and document-based versions)
Paperboy (later version)
Xenon II

Sector ID Duplication
Sierra used this for the versions of their games distributed under Tandy's label prior to 1985.  In this scheme, there are multiple sectors with identical Sector IDs, but different data.  Subsequent read sector commands will read the later sectors.

BC's Quest for Tires (Tandy version)
King's Quest (Tandy version)

Softguard 2.x/3.x with original loader

Found mostly in Taito games.  Works like Sierra's version, but with a different loader that is harder to decrypt.  The file CMLxxxx.FCL will be present.

Arkanoid
Arkanoid II: Revenge of DOH
Bubble Bobble
Operation Wolf
Puzznic
QIX
Rambo III
Rastan
Renegade
Sky Shark
Ultima II (1985 version)

Softguard 2.0.3 with Sierra's Loader

This protection was used in Sierra's games.  It relied on a track with non-standard sector sizes, overlapping sectors, CRC errors in the sector data field   There is a hidden file called CPC.COM on the first disk that checks for the protection.  All these games could be installed to a hard drive, but required the first disk, the key disk, to be inserted in a floppy drive.  Police Quest: In Pursuit of the Death Angel, was the only AGI version 2 game that never seemed to be protected.  This protection was applied to both booter and DOS games.

3-D Helicopter Simulator
Black Cauldron, The (AGI version 2)
Donald Duck's Playground
King's Quest I: Quest for the Crown (AGI version 2)
King's Quest II:  Romancing the Throne (AGI version 2)
King's Quest III: To Heir is Human
Leisure Suit Larry in the Land of the Lounge Lizards (AGI version)
Mixed-Up Mother Goose (AGI version)
Sierra Championship Boxing
Space Quest: The Sarien Encounter (AGI version)
Space Quest II: Vohaul's Revenge
Thexder

Weak Bits Generic Implementation
Typically done by using more than three 0 bits following a 1 bit in violation of MFM encoding rules.

After Burner
Block Buster
Blood Money
Bop'N' Wresting
Boulder Dash II
Gauntlet (Early version)
Ghosts 'n Goblins
Harrier Combat
Horror Zombines From The Crypt
Lemmings 2: The Tribes (used HD media)
Outrun
Rick Dangerous II
Shadow Gate
Shinobi
Space Harrier

Waydisk Minder
This protection will probably fail at greater than IBM AT (8MHz 286) speeds

4 Soccer Simulators
AM, FM Tivia Vol. 2
Arac
Boulder Dash 2
Football Manager
Frank Bruno's Boxing
World Championship Soccer

XELOK/XEMAG

Used mainly by Broderbund.  Has 16 sectors instead of 8 on track 9, side 0.

Oo-Topos
Ultima III (Ultima Trilogy version)
Sargon 3

V.  Hardware Based Backup Methods

There are several programs that rely purely on the floppy disk controller to try to make a working backup, including Teledisk, ImageDisk, CopyIIPC & Snatchit.  None of them is a perfect solution.  TeleDisk did not take every PC protection method into account, but its great to write images with non-standard sector sizes.  ImageDisk is a newer program and doesn't have that many disk images available for it, but it too is bound by the limitations of the PC disk controller.  CopyIIPC and Snatchit only work on 100% compatible IBM PCs (no Tandy 1000s or PCjr.s), do not work at high 386 speeds or faster and potentially will modify the data on the disk image to crack the program.

The closest thing that was available back in the 1980s that could copy anything was Central Point Software's Deluxe Option Board.  This was a hardware ISA card that intercepted the signals between the disk drive and disk controller.  Because it operated on the flux transition level, it could theoretically copy anything from a double density disk.   It could write bad CRCs, overlapping sectors, interleaved sectors and data in the gap bytes.  This board used a program called TransCopy.  TransCopy could save an image of a disk for future rewriting.  360KB disks would have an image that would be 1,088KB in size.

TransCopy was not without its flaws.  The non-Deluxe Option Board could only work with TransCopy versions 4.x or earlier.  TransCopy versions below 5.x would not copy 80 track disks, inlcuding 720KB disks.  TransCopy images made with version 5.x would not work with earlier TransCopy versions.  TransCopy would also be crippled so that it would not work with certain protections, depending on which company was threatening CPS with litigation at the time.  You would need to hope that an earlier version of TransCopy would work.  Copy Copylock II will not be able to written back with an Option Board or Deluxe Option Board.

The modern equivalent of the TransCopy board are the Kryoflux and SuperCard Pro.  In the PC context, KryoFlux will create raw stream files of each track.  There are utilities that can convert these raw stream files to TransCopy or TeleDisk formats.  It can now write back raw stream files, so you no longer need to send your disk to the SPS and get an IPF file.  However, writing back raw stream files is not fully reliable because it does not account for fluctuations in drive rotation speed and imperfections in the signal, possibly leading to signal loss similar to copying analog tapes.  There are unsupported utilities to make your own IPF files, but it appears that unless you know the stream format well, you may not be able to write back a working disk. SuperCard Pro does the same thing but contains everything in one file.  The two formats require conversion. 

HDMIfy your Old Consoles - Console Specific HDMI Upgrades

If you want high quality input from classic consoles to a modern flat screen TV, you need to use an HDMI converter like the X-RGB Mini Framemeister.  This converter will take high quality RGB or Component video signals and convert them to HDMI-compatible 720p or 1080p with excellent results and minimal lag. I played with a Framemeister some months ago, and wrote up my impressions of the device here : http://nerdlypleasures.blogspot.com/2015/05/fun-with-framemeister.html  Unfortunately, some classic consoles have difficulty displaying high quality video signals due to their lack of high quality video outputs.  Some enterprising individuals have made mod boards that will directly convert the video to HDMI with less lag than a Framemeister, more features and more reliable results.  Here are the projects that, as of the date of this writing, actually have been released in some form to the public.

NES - HiDef NES Mod & the AVS

The NES is one of the most important of the post-crash consoles and one of the few without a native RGB solution.  There has been a NESRGB mod board released for two years now, which works wonders with a Framemeister.  Before that people harvested 2C03 chips from Playchoice-10 PCBs and made do with the differences in the color palette, compatibility issues with color emphasis and sometimes video jailbars.

Kevtris' HiDefNES mod has already been mentioned in this blog, and it adds a whole host of features over the NESRGB + Framemeister solution.  I lay them out in detail here : http://nerdlypleasures.blogspot.com/2015/07/analogue-nt-nes-as-luxury-retro-console.html
It is the board found in the Analogue Nt HDMI version and has been sold in pre-modded systems on ebay and on the http://www.game-tech.us/ website.  The kit will be available for purchase so you can attempt to mod it yourself.  However, it requires desoldering both the CPU and PPU without destroying either chip or the PCB, so it is not a beginner mod.  Virtually all the compatibility issues with the HiDefNES mod and certain MMC5 games and the EverDrive N8 have been eliminated through a firmware update, so now is the time to consider taking the plunge.

The only obvious issue is that its FDS audio emulation is less than perfect.  The mod will not work in an original Famicom, a Famicom Twin or an AV Famicom with laser-marked CPU and PPU chips.

The basic principle of how the HiDefNES obtains the color values of each background and sprite pixel is the same as used in the NESRGB.  See here for my explanation : http://nerdlypleasures.blogspot.com/2015/06/nes-hardware-explained.html
There is now a 2600RGB board for the Atari 2600.  The 2600RGB board uses similar principles to discover the colors of 2600 pixels as the NESRGB board does for NES pixels.  Theoretically, it is quite possible for someone to develop an HDMI mod for the 2600.

bunnyboy, who runs the RetroUSB site, has displayed his AVS replica console at the 2015 Portland Retro Gaming Expo. His AVS has a 72-pin and a 60-pin connector for NES and Famicom games, and is designed as a front loader for the former and a top loader for the latter.  It uses a completely new board and an FPGA chip to provide hardware emulation for the NES.  It only outputs HDMI video and has separate power and reset buttons in the shape of NES front loader buttons.  It has built in four NES controller ports that can be set to function as a NES Four Score or Famicom 4-player adapter.  It also has a 15-pin Famicom expansion port for Famicom peripherals.

Because the console only supports HDMI output, it will not work with any Zapper or compatible Light Gun device and it will not work with the Famicom 3-D Glasses.  The FPGA inside the console does not emulate any cartridge hardware or expansion audio.  Expansion audio from Famicom cartridges is digitized and then mixed with the internal audio.  However, because the AVS uses an FPGA, it can load updated firmware to fix any compatibility issues.  Reports from the Portland Retro Gaming Expo were very positive, one person said the system ran Micro Machines correctly, which is a hard game to get right.  bunnyboy is also designing wireless RF controller without lag to go with the console via an controller port adapter.

The console can only be powered through its USB port.  The console has a scoreboard reporting function via the USB port, it will save high scores for certain known games and report them to NintendoAge.  The idea is that you play a supported game, the high score is saved and then you plug in the system to your PC and it send the score to NintendoAge.  The AVS only supports 720p while the HiDefNES can do either 720p or 1080p.  The AVS is not for sale at the moment, but bunnyboy is aiming for a just under $200 price point.  The best place for updates seems to be here : http://nintendoage.com/forum/messageview.cfm?catid=7&threadid=92557

N64 - Ultra HDMI

No N64 natively outputs RGB, but some early consoles can be modded with a simple amplifier board. Most consoles, however, have a video encoder chip that only outputs composite and s-video.  These consoles require the N64RGB board.  This board acts like a custom DAC, taking the digital signals from the N64 and turning them into analog RGB video.  This will make it truly Framemeister worthy, although the s-video output from the N64 is pretty good compared to composite video.  PAL N64s need a special cable to boost the S-Video signal from the console, NTSC N64s can use standard Nintendo or 3rd Party cables.

Today, if you want to bypass the Framemeister option, you can have an UltraHDMI board installed in your system.  It works with NTSC and PAL framerates (up to 1080p for both) and not unlike the HiDefNES it comes with filters.  The Ultra HDMI filters can simulate a CRT TV.  Without the filters the lag is truly negligible, with them there is about a frame of lag.  It supports all standard digital SD and HD resolutions, as shown here : http://ultrahdmi.retroactive.be/

The mod is very involved because you have to solder a flexible mylar-like ribbon cable to the finely spaced pins of the surface mounted graphics chip, the Reality Co-Processor (RCP).  The RCP sends out 7-bit digital RGB values along with sync information.  This allows for direct digital to digital conversion to the 8-bit RGB values HDMI supports without quality loss.    The kit uses a mini-HDMI cable and only needs a small hole cut into the back of the N64.  Because the mod is very tricky and not for the beginner, the board and kit is being sold only experienced mod kit installers.  If you want your N64 modded with the Ultra HDMI, you need to send it to someone.  This site is authorized to perform the mod : http://www.badassconsoles.com/ultrahdmi/

Game Boy - hdmyboy

In one sense, it is not too difficult to obtain a good quality HDMI image from a Gameboy.  You use a Super Gameboy or a Super Gameboy 2 (for accurate speed) on a SNES that supports RGB and send the video and audio through a Framemeister.  Alternatively, you can use a Game Boy Player and a Gamecube with the component video cables through the Framemeister, but that requires running custom software to make the Game Boy Player output at a true 240p speed.

Some time ago, there was a Kickstarter for a product called the hdmyboy.  The campaign is archived here : https://www.kickstarter.com/projects/507669971/hdmyboy-a-full-hd-power-up-for-your-game-boy-class
This is a fully assembled kit that you insert between the two halves of a DMG-01 Game Boy.  It adds half an inch or so to the height of the console when laid flat. It has an HDMI cable port and can support 720p or (preferred) 1080p.

Unlike the NES and N64 mods, this mod is easy to install.  It requires no soldering.  All you have to do is unscrew the shell, remove the ribbon cable that attaches the LCD PCB to the CPU PCB and insert that ribbon cable into the hdmyboy.  The hdmyboy comes with a NES controller attached internally so you can control your Game Boy.  It essentially becomes a consolized Game Boy at this point.

The Game Boy's LCD can only support four shades of one color, its video signal is fundamentally 2-bit digital monochrome signal with sync information.  This information, along with mono audio, is available through the ribbon cable.  The hdmyboy converts the digital video and the analog audio and sends it through the HDMI cable to the TV.  The hdmyboy only supports mono audio because only a mono audio signal is necessary for the single speaker connected to the LCD PCB.

Unfortunately the Kickstarter campaign was not successful.  However, the hdmyboy team still has some prototypes left here : http://www.hdmyboy.com/play/.  They are very expensive however, (a bit too expensive for what it does) but should represent the best solution to obtain true Game Boy output without using an emulator.  If they try another Kickstarter campaign again, then hopefully more people would be willing to contribute and get the price of this fine idea down.

Given a 1080p display, the hdmyboy can by default do 7x nearest neighbor scaling to give razor sharp graphics at the Game Boy's original aspect ratio.  It can also do 12:7 scaling to give razor sharp widescreen graphics and occupy almost the whole screen if you prefer.  Like the Super Game Boy it has 32 color palettes available to colorize the graphics.  While the Game Boy's sprite and background tiles have 10 valid palette selections to choose from, the Super Game Boy (unless the game is enhanced) and hdmyboy only apply colors based on the actual color value of the outputted pixel.

Sunday, November 1, 2015

Weapons in Mega Man 1, 2 & 3

The classic Mega Man games have always had a non-linear progression as a hallmark of the series.  Instead of following a set path from beginning to end, you begin the game by choosing which level you will tackle in any order.  Some levels may be easier than others.  Each level has a Robot Master at the end which you must fight and defeat to beat the stage.  When you beat a Robot Master, you will acquire his weapon for use in other stages.  Each Robot Master weapon has its own energy meter and its own attack.  One or more of the other Robot Masters will be weak to that attack.

Prior to Mega Man 4 (and Mega Man III for the Game Boy), which added the Mega Buster charged shot to the series, the weapons were very important in the Mega Man series.  However, not all were created equal.  In this blog entry, I would like to give my impressions of the weapons in each of the first three Mega Man games for the NES and discuss the Robot Master weaknesses.  Let's delve into the central design mechanic of the Mega Man series from the beginning :


The designers of Mega Man intended the Robot Masters to each be weak against a specific weapon taken from another Robot Master and stronger or invulnerable to others.  This rock-paper-scissors design would remain throughout the series.  Mega Man and each Robot Master has 28 units of life energy.  A weak attack may only take one unit, but a strong attack could take four or ten or fourteen.  Mega Man's Arm Cannon would always take at least one unit for a successful hit, regardless of enemy.


In the original Mega Man, each weakness had an easy to understand rationale.

Cut Man is weak against Guts Man's weapon*
Rationale : Rock blunts scissors

Guts Man is weak against Bomb Man's weapon
Rationale : Bomb blasts rock

Bomb Man is weak against Fire Man's weapon
Rationale : Fire detonates explosives

Fire Man is weak against Ice Man's weapon
Rationale : Ice/water extinguishes fire

Ice Man is weak against Elec Man's weapon
Rationale : Ice/water conducts electricity

Elec Man is weak against Cut Man's weapon
Rationale : Electricity cannot flow once its circuit is cut

* - Unlike every other canonical Mega Man game, the Robot Masters weapons are not named in the game or manual.  The manual also refers to the Robot Masters as one word, "Cutman", and identifies their and Mega Man's creator as "Dr. Wright."  In the sequel it was firmly established as Dr. Light.  Sometimes, the games refers to "Dr. Wiley" or "DR. WILeY", but the accepted spelling of the villain's last name is "Dr. Wily."

Not all of these weapons are equally useful.  Guts Man's weapon only works when there are rocks around to pick up.  Bomb Man's weapon does not travel far and does not deal damage instantly, so it is usually limited in its application.  Is it any wonder that these two weapons are nowhere to be found in the Gameboy game? Ice Man's weapon usually only freezes enemies and is useless against most Robot Masters.  Fire Man, Cut Man and Elec Man's weapons are much more general purpose weapons.  The latter two can cause even more damage to a boss by the select/pause button exploit.

Some Robot Masters were made easier to defeat with the Arm Cannon than others, after all, the player had to find a way to break into this weakness loop.  Most players usually start with Bomb Man or Cut Man.  The Arm Cannon takes two units from Bomb Man and three from Cut Man, but Cut Man has to be fought in closer quarters and is more aggressive of the two Robot Masters.  Guts Man and Fire Man can also be beaten with a little practice and a full health meter.  Ice Man is more difficult because you have to follow his pattern very precisely and his projectile attack hits for a lot of damage.  Elec Man is by far the hardest of the Robot Masters to defeat because he is aggressive and so fast that his patterns are harder to memorize.

There is a special item you can obtain in this game called the Magnet Beam.  It allows you to construct temporary platforms which you can use to walk or ascend the screen.  It is behind three moveable blocks in Elec Man's stage.  It is necessary in Dr. Wily's stages and extremely useful in Ice Man's stage.  It is also very useful in Guts Man's stage, but you need Guts Man's weapon to move the blocks.  Alternatively, you can defeat Elec Man and go back to his stage to retrieve the Magnet Beam using Elec Man's weapon to destroy the blocks.  Mega Man allows you to revisit stages, but Mega Man 2 and 3 do not.


Now let us turn to Mega Man 2.  Mega Man 2 introduced the standard eight basic Robot Masters. However, they no longer are as grounded in basic concepts like their predecessors.


Metal Man is weak against Quick Boomerang
Wood Man is weak against Atomic Fire
Bubble Man is weak against Metal Blade
Air Man is weak against Leaf Shield
Crash Man is weak against Air Shooter
Heat Man is weak against Bubble Lead
Flash Man is weak against Metal Blade
Quick Man is weak against Time Stopper

The following assumes you are playing on the "Difficult" difficulty level, which is the only difficulty level in the original Japanese version.  In addition to the above, Metal Man is even weaker to his own weapon than to anything else.  The Time Stopper will only take half of Quick Man's life and thereafter the Crash Bomber is the weapon that will damage him the most.  As you may have noticed, Flash Man and Bubble Man share the same weakness. The Atomic Fire weapon can damage many of the Robot Masters more than the other weapons, but the fully charged shot takes half of its energy meter.  You can only defeat Wood Man using the Atomic Fire weapon alone.

Some of these pairings make some sense.  Time Stopper is a natural assumption to use against Quick Man.  Bubble Lead, a water-type attack, makes sense against Heat Man.  Moreover, Heat Man's attack pattern practically invites you to use Bubble Lead whereas Crash Man's pattern does not.  Fire burns wood, so Wood Man's weakness makes sense.  If you want to go out on a limb, I suppose you could say that the Leaf Shield can block the air intake of Air Man, who has a big fan in his chest.  The Metal Blades can cut through the swim gear of Bubble Man.  But why should Metal Man be weak against the Quick Boomerangs?  Why should Crash Man be so weak to the Air Shooter?  I don't really see the particular connection between Flash Man and the Metal Blades.

You may note some similarities between some of the weapons in Mega Man and Mega Man II.  The Quick Boomerang has an attack pattern nearly identical to Cut Man's weapon.  Fire Man and Atomic Fire have similar weapon properties, as do Bubble Lead and Ice Man's weapon.  Crash Man's bombs serve a similar function to Guts Man and Elec Man's weapons.

Weapons are more unbalanced in Mega Man 2 than in Mega Man.  The Metal Blade is easily the best weapon in the game, its fast, can shoot in eight directions, damage most enemies and takes quite a while to run out of energy.  The Quick Boomerang can be useful and lasts a while, but its range is short.  The Bubble Lead weapon has occasional uses.  The Time Stopper runs down its energy quickly and is best suited to Quick Man's stage and Quick Man itself.  Crash Bomber is best used for destroying barriers and is the only weapon that will work against the boss in Dr. Wily's castle, stage 4.  Heat Man's weapon is slow to fire and a fully charged shot takes half the energy meter, so it is usually reserved for Wood Man and Dr. Wily's first form.  Air Man's weapon is usually useless except against Crash Man and drains quickly.  Wood Man's weapon is almost certainly the most useless in the game, when does a skilled player need its protection and it is a pretty weak attack.  Even Air Man may go down faster to the Arm Cannon than to the Leaf Shield because his air jets can block the shield.

There are three acquirable Items in this game.  You acquire an Item by beating one of the Robot Masters.  Item-1 creates up to three temporary platforms which hover upwards for a short distance.  Item-2 allows you to travel across the screen in a flying platform.  Item-3 allows you to climb walls.  All three are necessary for Dr. Wily's Castle.  Items 1 and 2 are especially useful in Heat Man's stage to pass the areas with the disappearing blocks easily.

Although I do not find the original Mega Man to be overly difficult (anymore), Mega Man 2 added a password system and you could collect up to four disposable Energy Tanks that could refill your health meter at any time.  These two additions made the game much more forgiving.  For non-Japanese audiences, a Normal mode was added to make the game much easier to beat.  In Normal mode, everything takes twice as much damage from your weapons and the enemies give better item drops.  Mega Man 2's Difficult mode is the only mode in the Japanese version.


Finally, I will talk about Mega Man 3.  Mega Man 3 built on Mega Man 2's success and is a great game in its own right.  Nothing has changed on the weapons front.  Its weapons, however, leave even more to be desired.


Top Man is weak against Hard Knuckle
Shadow Man is weak against Top Spin
Gemini Man is weak against Search Snake
Needle Man is weak against Gemini Laser
Snake Man is weak against Needle Cannon
Spark Man is weak against Shadow Blade
Magnet Man is weak against Spark Shock
Hard Man is weak against Magnet Missile

Magnet Man is equally weak against Shadow Blade.  Shadow Man is also very weak against his own weapon.  Except for Hard Man and Spark Man, the logic of the weaknesses of the Robot Masters here is beyond me.

The best weapon in the game is the Shadow Blade.  It can fire in five directions, has good speed, decent range and comes back to you.  Essentially it is a more balanced version of the Metal Blade.  Needle Cannon is also pretty good, it fires fast and lasts a while.  Spark Shock is also fast and travels far.  Search Snake is pretty limited in its usefulness and often really weak, the Gemini Laser is slow to travel, you can only have one shot out at a time and it takes several ricochets off walls for each shot to expire.  Note that Search Snake has a slightly improved attack pattern over Bubble Lead. The Magnet Missiles exhaust themselves too quickly to be of much use.  Hard Knuckle is so slow that it is really only useful to break down barriers and in boss fights, like Crash Bomber.

Top Spin takes the prize here as the worst weapon in the first three Mega Man games.  It is worse than the Leaf Shield, the Air Cannon, Bomb Man and Guts Man's weapons.  There are three issues with the Top Spin.  First, you have to be right next to the enemy to register a hit, leaving you prone to being hit in return.  Second, the amount of damage it does is very variable.  Third, it drains really quickly.  You can spin against Shadow Man until Top Spin's energy is depleted and still not defeat it.  The second time around, you will almost certainly use another weapon against Shadow Man.  While there is one boss in Dr. Wily's castle that is vulnerable to the Top Spin, it is also vulnerable to another weapon, fortunately.

Mega Man's companion/helper Rush is introduced in this game.  Rush is a robot dog who can perform three abilities.  The first ability is the Rush Coil and is present when you begin the game.  It acts like a spring to allow you to jump high. The second is the Rush Marine and the third is the Rush Jet.  The Rush Marine allows you to travel freely in water and is useful in Gemini Man's stage.  The Rush Jet allows you to travel freely in the air and makes Magnet Man's stage a piece of cake as well as any other area with a lot of pits.

Mega Man 3 allows you to collect up to nine Energy Tanks.  There are some levels where you can get more than one Energy Tank or get one early in the level so you can collect them quickly.  Additionally, the slide move makes its first appearance.  With it, you can usually slide under any Robot Master who jumps and get away from them quickly.  This makes using a Robot Master weapon a little less necessary in many instances.

Dr. Wily's Revenge

The Game Boy game is something like a remake or adaptation of the original game with elements of the sequel thrown in.  The original Mega Man had six stages and four smaller parts to Dr. Wily's stage.  For the small screen, some cuts had to be made.  Gone are Bomb Man and Guts Man and their stages.  Dr. Wily's Castle and Space Ship are longer than any Robot Master's stage.  The game is six stages long, but the last two stages are quite difficult.  The health and energy meters were decreased from 28 to 19 units.


Cut Man, Fire Man, Ice Man and Elec Man are the Robot Masters you can choose from in this game.  Fire Man's attack has been simplified.  Elec Man has become much less aggressive and his attacks do far less damage, making him the usual Robot Master to start out with.  Their weakness have not changed from the NES game, but the best weapon to use against Cut Man is Fire Storm.  Their weapons are essentially the same as in the NES game.

When you get to the end of Dr. Wily's Castle, you will see teleporters you can take in any order to fight Bubble Man, Heat Man, Flash Man and Quick Man from Mega Man 2.  Their weaknesses have not changed, but the Metal Blade does not exist in this game, so you are intended use Atomic Fire against Flash Man.  They really are not particularly weak to any of the weapons from the first set of Robot Masters.  The only major change is that Heat Man's weapon does not take up as much energy for a charged shot.  It can also destroy the barriers on Dr. Wily's Space Ship.

Once you defeat the second four Robot Masters, you must fight Enker, who only is affected by the Arm Cannon. Enker gives up the Mirror Buster, which reflects enemy shots. Unfortunately, once you obtain their weapons, you have only one stage to use them.  The final password only allows you to continue before Dr. Wily's Castle, so if you want to try to beat the game again you have to fight the Mega Man 2 Robot Masters again.

There is one item that can be acquired in this game, the Carry item.  You obtain it after you defeat the final Robot Master of the initial four.  It creates a platform to the side or underneath you for a short period of time.  Only one can be active at a time, but you can use it to save yourself from a deadly fall or spikes or to reach areas where you cannot jump to unaided.  You cannot change to a weapon while it is active, but you can conserve its energy by leaving the screen it is on.


Capcom used Arabic numerals to designate the NES games and Roman numerals (and the subtitle above) to designate Game Boy games on their respective boxes in order to tell them apart.  I will do the same for this article.


Mega Man II gives the other half of the Robot Master contingent from Mega Man 2: Air Man, Crash Man, Metal Man and Wood Man.  After you get to the end of Dr. Wily's Castle, you will be able to go through teleporters for new stages for half of the contingent of Mega Man 3: Needle Man, Top Man, Magnet Man and Hard Man.  After you beat them and acquire their powers, you will fight Quint and obtain his power, the Sakugarne, which is a pogo-stick.  Then it is onto the final stage, Dr. Wily's Space Ship.  Other than actual stages instead of arenas for the second set of Robot Masters, not much has changed from its predecessor.

Rush, Energy Tanks and the slide move make their Game Boy introduction.  Rush transforms into the Coil, Jet and Marine.  You can obtain up to four Energy Tanks in Mega Man II.

I should talk about Robot Master weaknesses in this game, but this game is so poorly done that you can beat them all with the Arm Cannon.  The Robot Master's attacks and patterns are fairly simplistic and do not usually do much damage.  Quint is a joke and Dr. Wily's final forms won't cause you grief, unlike the previous game.  The music stinks as well.  Considering that the engine from the previous game was quite robust, the lack of inspiration in this game is appalling.

Okay, so in this game, Metal Man is now vulnerable to Crash Bomber.  On the other hand, Crash Man is not nearly as vulnerable to the Air Shooter, but it remains the best weapon to use against it.  Neither Shadow Man nor Spark Man are present, so Magnet Man is now vulnerable to Needle Cannon.  Similarly, Gemini Man is not present, so Needle Man is now vulnerable to Top Spin.