Computing Pi on a NES

Today’s link is to a madperson who explains how to compute digits of pi on a NES’s 6502 to an arbitrary length. As you do. Along the way it explains how to multiply and divide in binary on a processor without hardware support. It’s around nine minutes long, but if you want a machine to get to the end of pi it’ll probably take a tad bit longer.

We link to such a variety of things here. Sometimes we post light videos where someone has Kirby do funny things. Sometimes we show explainers that explain how to do arithmetic on old processors. I presume that you’ll take from these what you want, and leave the rest to the crazy people, by definition the people who are not you. I understand.

Youtube Series: Inside the Famicom

It’s only two episodes in, but this series from the Youtube channel What’s Ken Making is already really interesting, with episodes averaging at around 16 minutes each. The first part is titled “The Design of a Legend,” which doesn’t really grab me much, but the second is about the main processor, “The 6502 CPU,” which Ken admits near the start isn’t exactly accurate. The Famicom/NES’s processor isn’t precisely a MOS 6502; it’s a Ricoh 2A03 in NTSC territories, and a 2A07 in others. The 2A03 is licensed from MOS, but lacks the original’s Binary-Coded Decimal mode, and includes the Famicom/NES’s sound hardware on-die.

Episode 1 (15 minutes):

Episode 2 (17 minutes):

That removed BCD feature. Why? The video notes that the circuits are right there within the chip, but have been disabled by having five necessary traces severed. The video notes that the 6502’s BCD functionality was actually patented by MOS, and asks, was the feature disabled because of patent issues? Was Ricoh trying to avoid paying royalties?

Reverse Engineering the 6502

This is a 52-minute talk from 2010, from the 27th Chaos Communication Congress in Berlin, Germany (the talk is in English), presented by Michael Steil of Visual 6502, which successfully reverse engineered the venerable 6502 microprocessor, a chip used, in one capacity or another, in one form, or another, in all the Apple, Commodore and Atari microcomputers, the BBC Micro, the Atari 5200, in a modified from the Atari 2600 the NES, and countless arcade games, as well as in other places.

The talk is intended for a technical audience… literally. When the speaker asks who in the audience has coded in assembly before, practically everyone raises their hands. It’s recognized that we at Set Side B veer wildly between the most surface-level populist material and in-depth treatments for those with gigantic capacities for technical discussion and the attention span of a Galapagos Giant Tortoise. We like to think this is charming, and will listen eagerly if you tell us that you agree.

Anyway, here is that talk. I already mentioned that it’s 53 minutes. If that’s too long, there’s a speed-up function on Youtube. If that’s too technical, well, I don’t know how to help there. Maybe a read through pagetable.com’s documentation on the 6502. Oops! I’ve made it worse, haven’t I. Well, if you like, you might console yourself that the 6502 is really a simple processor to learn to code in. I’ve done it myself! There’s no memory management, there’s only three general-purpose registers, the stack is fixed in place, and all opcodes are one byte. It’s so simple that an extremely motivated child could learn it. Guess how I know?

27c3: Reverse Engineering the MOS 6502 CPU (Youtube, 53 minutes)

Here’s a description of the talk from the conference web site.

Hardcore Gaming 101 Covers Snake’s Revenge

Hardcore Gaming 101 is one of the most important game history sites on the internet, and site creator Kurt Kalata writes on a wide variety of games for consoles and computers alike. Recently they’ve been on a Metal Gear kick, and that means covering the black sheep of the series, Snake’s Revenge.

Snake’s Revenge is the forgotten Metal Gear game, an NES sequel made without Hideo Kojima input, to the NES port of Metal Gear that he also had nothing to do with. It has a reputation for being terrible, but that’s really unmerited. As Kurt Kalata notes, while it has its flaws, is ignored by later Metal Gear games, and it has a story based on the manual scenario for Metal Gear written by Konami’s crazy American writing staff*, it’s technically proficient and has good music.

Yep, it’s the Metal Gear with side-view segments.

You can, and should read it for yourself, here.

* The American manual for NES Life Force says that the evil planet-eating monster Zelos was the proud progeny of “Ma and Pa Deltoid.” In the description of Dracula’s Heart in the manual for Castlevania II, it warns: “Careful! The heart attacks.” These were not means isolated occurrences from Konami’s US staff.

Sharopolis Looks Into NES Technical Feats

Youtuber Sharopolis has a 20-minute video up examining several specific NES games and how some unexpected tricks were pulled off in each: Rescue: The Embassy Mission, Crash and the Boys Street Challenge, Castlevania III and Jurassic Park. I love learning about how developers overcame hardware limitations, and if you’re reading this, I’d wager there’s a good chance you do too!

Sundry Sunday: Gyruss Themes

Sundry Sunday is our weekly feature of fun gaming culture finds and videos, from across the years and even decades.

While there are examples of excellent music from the classic era of arcades (Frogger comes immediately to mind), I don’t think there is much that can equal that of Gyruss’ arrangement of Bach’s Tocatta and Fugue in D Minor. Here it is, isolated from the rest of the game’s soundtrack, from Youtube uploader StyleK226 (1 1/2 minues):

Wikipedia tells us that the arcade arrangement is reminiscent of a version of the song from the British band Sky, titled just “Toccata” (4 1/2 minutes):

If you only know Gyruss from the NES port, you might be surprised that it’s an almost entirely different arrangement from the arcade version! Maybe it was changed because of the similarity to Sky’s version. Some people prefer that one, it’s got a bit more variety, although I think the arcade’s is a bit better. Judge for yourself (3 minutes):

The Toccata is only used for the intro and the first warp on each planet, which is a bit of a shame, the rest of the music isn’t bad, but it’s not Bach. In Japan, Gyruss was a Famicom Disk System game. The FDS had extra sound hardware, and the result is an upgraded version of the NES soundtrack (14 minutes in all):

There’s been a number of fan versions of the Gyruss soundtrack, although most of them seem to be inspired by the NES port rather than the arcade original. Here’s a metal medley of that particular musical mutation (3 minutes):

As commenter @Fordi says, “What I love is that Intro / Stage 1 is a genre cover (metal) of a game’s adaptation (Gyruss) of a genre cover (Sky – Toccata) of classical music (Toccata and Fugue in Dm).”

Chrontendo 64

Dr. Sparkle is back with the 64th installment (Youtube, 55 minutes) of his quest to review every NES and Famicom game. He’s pretty far in! In about ten episodes, he figures he’ll reach the launch of the Super Famicom, which won’t be the end of his journey but will probably mean he’s in the home stretch.

In the meantime, ten games from 1990 are in this episode. They are:

Puss ‘n’ Boots: Pero’s Great Adventure – Technically a retread of a previously-covered Japanese game, this version has substantial differences so Dr. Sparkle decided to cover its U.S. version separately. A very easy game until the last stage where it jumps in difficulty, and then the final boss is absurdly hard. Dr. S expresses confusion why a game made to be so easy that it’s obviously intended for young children would become nearly impossible right at the last second. Personally, I suspect it was done because NES game publishers were terrified of the game rental market.

Wit’s: A Japan-only release, this is basically a de-luxe version of Snake, where your enemies have special abilities that you have to account for. Suprisingly, it’s an arcade port!

Captain Tsubasa Vol. II: Super Striker: A weird RPG take on Soccer, published by Tecmo and based on a manga and anime series. Instead of controlling a player or players completely in real time, the action pauses frequently and asks you what to do. The main screen is mostly animations down on the soccer field. It’s a unique take on soccer, but it’s not the only one: this is the second game to play like this on the Famicom. The Captain Tsubasa game series continues even today: the most recent releases, Dr. Sparkle tells us, are on PS4 and Nintendo Switch, although I don’t know if they take the menu-based RPG approach.

Jyuouki: This is simply a licensed Famicom port of Sega’s Altered Beast, and a pretty bad one at that.

Mahjong G-Men: Nichibutsu Mahjong III: Yet another Mahjong game, although with some interesting features, if you’re into Mahjong. That’s not Mahjong Solitaire, a.k.a. Shanghai, the Activision (and formerly PLATO) computer game where you remove tiles in matching pairs from a tableaux, but the Chinese Rummy-like game using tiles instead of cards. It also has a weird Tetris-like subgame involving Mahjong tiles.

The Pennant League: Home Run Nighter ’90: Yet another Famicom baseball game.

Dr. Mario: The classic Nintendo puzzle game! I always thought it was a bit inferior to Tetris, but then most games are, and that didn’t stop me from playing a ton of it long ago.

Pictionary: Based on the board game, and coming from infamous American NES publisher LJN. Dr. Sparkle is a bit harsh on developer Software Creations, but I think this effort looks pretty well-made to me. It’s not a classic, and it’s actually not really so much Pictionary as a kind of variation on the theme, where players play mini-games to reveal parts of a drawing and then try to guess what the drawing is of. It looks much like one of Rare’s many game show and board game adaptations and creations, and in fact if it weren’t for the Software Creations credit I’d have assumed that Rare made it.

Bigfoot: From Acclaim and developed by Beam Software. It’s fairly well polished for a Beam Software title, but has some weird ideas to it, including a weird control scheme for the events that involves tapping left and right on the control pad. I think the idea has a bit of merit, but that it was probably the wrong place to use it. A Bigfoot game would mostly be bought or given to kids, who would be the absolute last demographic you should expect to master a non-standard control scheme. I’m not one of those people who thinks making a game that goes about its play differently than most other games is always a terrible idea (see: most of what I’ve ever written about roguelikes), and I can kind of see why they did it, trying to make a race game that’s more than just holding to the right. It probably could have used a bit more iteration though.

Snake Rattle ‘n’ Roll: A game from Rare that they actually put a lot of effort into, and it shows. And some people really like it, it’s definitely got a cult following. Dr. S isn’t part of it, due to the difficulty of getting used to SRnR’s isometric style. I think what happened was, they had these routines laying around that they used in implementing NES Marble Madness, and decided to do another game that controlled in that kind of way. I think the game was poorly suited to a digital control pad; if it were controlled with an analog stick, or at least a digital control where diagonal movement is easier, I think it’s possible that some people who hate Snake Rattle ‘n’ Roll might be able to enjoy it better.

Anyway, here is the whole episode, start to finish:

A Guided Tour of the NES

This tab has been open on my browser for literally months, so I’m finally excising it from the bar….

A while back the site HackADay did a teardown of the NES, going through how to take it apart and reassemble it, and going through some of the elements of its assembly. It doesn’t go into a lot of detail, but that lets it be fairly short, at only nine minutes.

NES Hardware Explained (HackADay post, Youtube video)

More From Displaced Gamers on Dr. Jekyll and Mr Hyde

We presented Displaced Gamers’/Behind the Code’s video on the jankiness of kusoge disgrace Dr. Jekyll and Mr. Hyde back on Saturday. They did another video on that game, that delves into why the game’s frame rate is so inconsistent. In summary, its engine throttles its framerate in a terrible way, using long delay loops. It’s a pretty awful idea! It’s 19 1/2 minutes long. The video claims it’s even geekier than their first video on the game, but I think it’s actually slightly less technical, at least it doesn’t fill the screen with as much 6502 assembly code.

Another fact about J&H: the Japanese version had two full levels that were cut from the U.S. version, which replaced them with replays of other levels. It made a bad game even worse!

Now, because of Behind The Code, you know more about the Dr. Jekyll and Mr. Hyde game than many much better NES titles. Congratulations!

Behind the Code: Dr Jekyll and Mr. Hyde

For some reason there’s been a lot of Youtube videos lately that fit our eclectic purview, so here’s a code-heavy dive into infamous NES disasterpiece Dr. Jekyll and Mr. Hyde.

It’s 19 minutes long, and is even geekier than is usual for us, going into a disassembly of the game’s machine code in its quest to make the game marginally less awful.

As long as we’re on the topic, here’s Jeremy Parish’s NES Works episode on Dr. J & Hyde, which is also 19 minutes, and also covers the somewhat better (but not hugely so) game Amagon:

While we’re on the subject, did you know that Jekyll & Hyde has a secret ending? Both endings are shown here (4 minutes):

The “bad” ending is the normal one, and shorter, but is arguably a happier conclusion to the story. To get it, all you have to do is get to the end of Stage 6 with Jekyll. That’s all.

To get the other ending, get to Stage 6 with Jekyll, then turn into Hyde and get to the end of his version of the stage. Usually, if Hyde gets as far into his level as Jekyll has gotten into his, he’s struck by lightning and dies. But in this level he’ll be allowed to reach the end of his version of the level for some reason, where there’s a boss! Beat it, and when you return to Jekyll’s world the enemies will be gone, and he’ll be free to finish the level without harassment. However, ending events will be different….

Mega Man’s Score System

Looks like we’re on another Youtube binge, ayup ayup. This time it’s another hopeful video constructor asking us to consider the oddity of the score system in the original Mega Man (a.k.a. Rockman).

When you post as many Youtube videos as I do, it’s easy to form opinions about their style. That of “TheRetroDude,” as he styles himself, is interesting, it’s still hyper-edited in the way that so many Youtubers loathsomely adopt, but it’s not nearly as distracting as those. He keeps the volume down, as well as the number of swoopy objects tearing around the screen like a toddler newly introduced to Toblerone.

He has good points about how extraneous the game’s scoring system is too, although his misgivings could be laid against many other games. In Super Mario Bros, score is mostly a spacer before toppled turtles start giving extra lives. I think that score isn’t a bad addition to a game as long as it’s implemented thoughtfully, yet for too long it hasn’t been. Even in the NES days it was included to give players a short term goal to aim for, when they didn’t really need it.

What would a good scoring system look like, one that rewarded skill? Well–

  • Losing a life would reset score to that at the last passed checkpoint, eliminating point pressing from lives.
  • Extra lives at game end would be worth a bonus each.
  • Game timers are worth a small, yet substantial, award at level end, to prioritize fast play over slow.
  • Awards should be given for score, most typically extra lives, but others are possible too.
  • Replaying levels, and other means of “minting points,” earning arbitrary scores, should be ruthlessly eliminated. If the player can replay levels indefinitely then think about if your game really needs a score, and if it does, don’t allow players to earn more points from replaying them without costing them the points from that last pass.

Two games that come to mind that do scores well are:

  • ZANAC on the NES, being a scrolling shooter without checkpointing score is generally fair, although it is possible to warp backwards does break the no-replay rule, and
  • Star Fox 64, which only adds a level’s score to the player’s total at its end. SF64 is a game obviously designed around score attacks.

Where was I? Oh! Here is that video about Mega Man’s scoring system.

Mega Man 1’s Really Weird Score System (Youtube, 9 minutes)