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.

Romhack Thursday: Winner of QLDC2023

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

Super Mario World is one of the most hacked games of all. There’s a whole website devoted to hacking it, SMWCentral. They do have Yoshi’s Island and Super Mario 64 hacks too, but SMW is the main attraction.

They’ve done a bunch of contests over the years, where different members compete in judged hacking competitions to make hacks to various criteria. In April they wrapped up their second “Questionable Level Design Contest,” QLDC. And the gimmick of the winner is… pretty special.

Please overlooked the glitchy title screen. In this one, the presentation isn’t the main attraction.

A long walkway to the right from the starting location.

What? Is this a troll hack? One that just makes you run everywhere and nothing ever really happens?

Hmm. This screen looks like it’s full of levels, but none of the circles or houses work. The object is to get to that red pipe.

You hold X or Y to run, or, as this screen mentions, don’t hold X or Y to not run. That Pirhana Plant is animated, and if you run into it while it’s in your way, you have to restart the screen. A fun gimmick, sure, but we’re just getting started.

In case you haven’t cottoned to the gimmick yet–there is no actual level. The whole game is played on a series of connected map screens. You’d think not a lot would be possible, but in this hack, Mario can actually “jump” on enemies if his feet touch them. On this screen, Bullet Bills enter from the right, and you have to use the curved paths, along with judicious running, to “stomp” them with the right timing. When you reach the OFF circles to the right you clear the green blocks, and then have to work your way back left to get to the pipe.

And on this screen, the Thwimps jump back and forth, and you have to avoid them as you pass around the screen. If you touch an enemy you don’t “die” so much as get sent back to the start.

Then you get to this screen, which is a remake of a portion of the first level, and you wonder how far they’re willing to go with this gimmick.

As it turns out, they’re (“they” being Faro and MM102) not even close to being done. This level introduces these Stars that, when you press A on them, cause Mario to do a spin jump. This jump, however, actually activates the standard SMW platforming engine. Mario can move around as if he were in a level. Here you have to use that jump to bounce off the Big Boo and land on the other Star, which puts you back into map travel mode and lets you go to the pipe. The following levels make extensive use of this feature, and there’s lots left to explore.

The creators made a playthrough video, embedded below (it’s about nine minutes), but they suggest that you try the hack yourself first. You can do what you want, but it’s a joy discovering how they unveil progressively crazier gimmicks as you go. Consider trying it our yourself first, if you have the mind and means.

Patch for “My QUDC Level” in BPS format (SMWCentral, use flips.exe to patch an unmodified Super Mario World ROM-you’re on your own for obtaining that, of course)

News 1/24/22: Pokemon Collecting, Universal Mario World, Commodore 64 of Theseus

“We scour the Earth web for indie, retro, and niche gaming news so you don’t have to, drebnar!” – your faithful reporter

Let’s make it quick this week-

Oli Welsh at Polygon tells us what we already knew, that No Zelda Game is Closer to Breath of the Wild Than The 1986 Original. We can’t recommend it whole-heartedly though because it gets in some digs on the older game, saying it’s nowhere near as much fun as Link to the Past, a statement I disagree with.

Hope Bellingham at GamesRadar tells us that U.S. Customs wrecked a sealed-in-box copy of Pokemon Yellow valued at over $10,000. I rather disagree with that valuation too. I thought all the misguided young people were losing their money in crypto these days? (Note: GamesRadar is one of those sites that waits until you start reading an article then puts up a blocking box begging you to subscribe. Hint to GamesRadar: NO, and if I were interested in subscribing my generous impulse would have been destroyed by your prompt!)

Image from The Guardian, probably ultimately from a promotional photograph

At the Guardian, the very British-named Oliver Wainwright reviews Super Mario World, not the game but the theme park in California, a part of Universal Studios Hollywood. The verdict: 8/10, good graphics, some replay value. I’ve been in a melancholy frame of mind as of late, so seeing those brightly-painted dioramas makes me wonder what they’ll look like in twenty years, when Universal Studios’ attentions have drifted to another big thing. Nothing ages quite as badly as a happy prop painted in primary colors.

I said I was going to make this quick, let’s keep moving. Maya Posch at hackaday talks about a project to build a Commodore 64 using new parts.

Ollie Reynolds found some Donkey Kong design documents on Twitter, from the days when it was planned to be a Popeye game. He found them retweeted by blogfriend Mike Mika of Digital Eclipse, who in turn found them looking through Mario history site Forest of Illusion.