On Super Mario World’s Score Display

Awesome Mario trivia blog Supper Mario Broth noted on Mastodon that Super Mario World is extremely inefficient in displaying Mario’s score.

There is more information on SWMspeedruns.com, but in brief, SMW stores the player’s score as a 24-bit value as hexadecimal digits, and converts that value to decimal when it’s time to display it. There is no good way to do that that doesn’t involve figuring out the entire arithmetic, but Super Mario World does it particularly slowly: it starts with a copy of the score, then sees if it’s over 1,000,000. If it is, it increases the millions digit of the displayed score by 1, subtracts a million from the work value, then repeats. When it runs out of millions it repeats with the hundred-thousands, and repeats until it finishes with the tens. At least it doesn’t try it with the 1s, seeing as how nothing in the game awards single points!

In a worse-case scenario, with a score of 9,999,990, the code goes through this whole process every frame, consuming up to 8% of the time available for game logic.

What could the game have done to accomplish this better? It could have found out how many of each digit there was once instead of looping and incrementing. It could only figure out the score when the value changes. Or it could save the value as the digits themselves in decimal, just increment them by the right values when its needed, and then copy that figure to the screen. That’s largely what 8-bit games would do.

Even worse, if Luigi is the active character, the game does this twice: it figures out and prints Mario’s score, then it does it again for Luigi’s score, placing it onscreen in the same place.

While printing the score is just one thing the game does each frame, the effect is great enough that complex scores can lag the game, enough that speedrunners take the score into account to avoid it.

This adds to the evidence that Super Mario World development was rushed. It’s already known that a lot of the code in SMW is buggy, allowing for some truly heroic exploits like programming a text editor in SRAM purely by manipulating objects in an early level.

Super Play Magazine’s Top 100 SNES Games

Lists of the best games for various platforms has been a fixture on the internet since it was opened up to the general public. Every big gaming site, those still with us and those gone (R.I.P. Joystiq) feel the urge to make them periodically. After all, they combine several popular article themes: they’re listicles, they’re about video games, and they make definite-seeming yet inherently subjective statements about things that geeks have over-strong opinions about. They’re the ideal hit-getters for pop culture sites really, whether they focus on games or not.

Even in print, these lists weren’t rare things. Super Play Magazine, from the UK, did such a list in April of 1996, which was reproduced in HTML text by the site RVGFanatic in 2010.

Why would such a list interest us now? Well, most of these lists have a strongly US-focused vibe, and the UK had a somewhat different scene than we (me being American) did. So there are a number of very interesting games on the list that generally don’t appear in other places, including a few Japanese ones. And they included SNES Rampart, so I’m automatically kindly disposed to it.

Of particular note, besides Rampart: three Parodius entries, two Micro Machines games, Pop’n Twinbee, Cool Spot, Samurai Spirits, Hebereke’s Popoitto, Spike McFang, SNES Side Pocket, Xandra’s Big Adventure, Pugsley’s Scavanger Hunt, NFL Quarterback, World League Basketball (made by HAL!), The Chaos Engine, Street Racer, Super Smash T.V., Lemmings II: The Tribes (but not Sunsoft’s excellent SNES port of original Lemmings?!), Sensible Soccer, R-Type III, U.N. Squadron, SNES Civilization, Out To Lunch (I hadn’t even heard of this before!), Mickey’s Magical Quest, Cannon Fodder, Plok (the Pickford Bros. rule) and Equinox (also Pickford-made, and also highly underrated).

Super Play Magazine’s Top 100 SNES Video Games (RVGFanantic)

Satellablog: New Dumps!

Satellablog is a blog dedicated to preserving content from one of the least-documented portions of Nintendo video game history, that short period in their life where they distributed software via satellite broadcast, over the St. GIGA service.

Bounty Sword, Satellaview version
(Images from Satellablog)

Most of this stuff only exists, maybe, in company archives deep in the halls of Nintendo, and the data from the last broadcasts saved on aging flash memory cartridges held by subscribers. It is believed that all of the dumps that have been made available have come from those cartridges, and Satellaview is dedicated to finding them and making them available.

Elfaria II demo

There are a number of interesting finds in this batch, including lost Dezaemon shooters, a cut-down version of Super Famicom RTS Bounty Sword, a non-playable demo of Elfaria II. But the most surprising thing in the collection is a number of dumps of a Satellaview version of Nintendo’s website circa 1999, one of the last things they made available over Satellaview! I had no idea that the service survived that long!

Satellablog: The biggest batch so far (Part 1)

Romhack Thursday: Gradius III using the SA-1 chip

On Romhack Thursdays, we bring you interesting finds from the world of game modifications.

First, I’d like to fill you in a bit on the world of supplemental chips included in cartridges.

The greatest advantage of cartridges as a software distribution medium is that you can include extra hardware in the cart that extends the capabilities of the system. The inclusions, ranging from a few extra logic gates controlling banking to static save RAM and batteries to supplemental microchips to entire coprocessors, goes back to at least the Atari VCS/2600, where they played a major role in extending that console’s lifespan. The VCS only had 128 bytes of RAM, a ROM address space of a mere 4 KB, and didn’t even have lines going out to the cartridge for writing to external memory. In spite of these fairly dire limits, regularly games for the system would far surpass what was expected by its creators, culminating in the DPC chip used in Pitfall II.

It’s not true that you can do anything with extra hardware in a cart, but you can push the limits quite far. The inclusion of extra circuitry in the cartridge is what allows Champ Games to make their amazing Atari arcade ports (such as Mappy and Scramble).

After the VCS/2600 fell out of popularity the NES came along, and extra chips of this sort became almost mandatory. The tales of Nintendo being hampered by the chip shortage at the time of the NES’s popularity limiting production are true, but are also somewhat self-inflicted. Legions of popular games required at least a MMC1, a chip that could have been included in the base console, or supplied in an add-on peripheral like a pass-through cartridge. But instead Nintendo chose to include one with every game that required it, and also MMC3s, some MMC5s, and a handful of other chips.

Then the SNES came along, and more extra chips entered the picture, most notably the DSP, the SA-1, and most famously the SuperFX. The SA-1, basically a coprocessor for the machine’s overworked Ricoh 5A22, a variant of the WDC 65C812, which was itself a 16-bit version of the venerable MOS 6502, is our focus here.

Extra chips in SNES carts weren’t nearly as essential as they were for most NES games, but there were still a good number of them. In the early days of the SNES extra chips like these were not hugely common, although a DSP was used even in one of the system’s launch games, Pilotwings. On the other hand F-Zero, a game remembered fondly for its great sense of speed, didn’t use any special chips.

The SA-1 was one of the more powerful of these chips. It was basically a second 65C812-type chip running at triple the main CPU’s clock speed, with a small amount of dedicated memory and some other minor features. Most famously it was used in Super Mario RPG, but it was also used in both of the SNES Kirby games.

The SA-1 wasn’t used in that many games, and it wasn’t even available for use, I think, in the system’s early days, which was a shame. The power of the SA-1 was quite great, if used correctly. SNES hacker Vitor Vilela has made a growing number of hacks that recode classic SNES games to use its calculatory prowess, and the difference is often quite dramatic.

There’s a lot of stuff there on his Github page that I’m going to save to present later, but one of their earlier projects, and one of the best I’d say, is his conversion of SNES Gradius III to use the SA-1. Gradius III is probably the SNES game in which slowdown is the biggest problem, it is not hard at all to get Gradius III into a state where the game slows down to half speed, or even one-third speed, simply by loading up on Options and powerups. As a difficult game where slowdown makes it much easier (and it may have been designed around it), and as a SNES launch title with great graphics and sound, it’s still playable without the SA-1, but you can nearly hear the processor creaking under the weight of all those projectiles and effects.

With the SA-1, all of that slowdown is just gone. It makes the game a fair bit harder, but also a lot more fun to play. See for yourself:

And now, look on in horror at a deathless playthrough of Gradius III with this hack:

Guide to the SNES Architecture

Image from the site

Rodrigo Copetti has an interesting rundown of the architecture to the Super Nintendo Entertainment System! It’s an interesting system over all. In clock speed it’s really not that much faster than an NES, but it has vastly superior graphic and sound capabilities, plus so much more addressing space that the phenomenon of mappers that ruled nearly every NES game worth talking about (except maybe Super Mario Bros. and Tetris) was completely absent. The SNES did have frequently-used add-on chips, but they tended more to take the form of co-processors to take some of the load off of the machine’s relatively slow CPU.

Super Nintendo Architecture: A Practical Analysis by Rodrigo Copetti

Kimimi: Bounty Sword and Wild Card

Kimimi the Game-Eating She Monster (great handle!) has a knack for finding awesome Japanese games that Western shores missed 0ut on, and one such game is Bounty Sword, a Super Famicom JRPG with real-time combat, muted colors, and let’s not forget a fairy playing the role of player cursor. It’s worth your time to read, and maybe to contribute to her Ko-Fi!

Since I wrote that, she’s posted a review of another extremely interesting Squaresoft game, for the WonderSwan, Wild Card!