Hacker News new | past | comments | ask | show | jobs | submit login
Through the Warp Zone: Hacking Super Mario Brothers to unlock new worlds (emily.st)
171 points by emilyst on May 5, 2014 | hide | past | favorite | 36 comments



Exploiting glitches in-game on real hardware is always cool, but not always ... convenient. ;)

This sorta reminds me of a story about Intellivision's hit game "ASTROSMASH!" (http://en.wikipedia.org/wiki/Astrosmash).

The game was originally meant to be a clone of Asteroids called "Meteor!", but Mattel cancelled the clone due to legal concerns. But there was still room on the cart, which the developer had been using to develop his own unique game called "Avalanche". This is what eventually became ASTROSMASH (my favorite game as an 8 yearold who never got that NES...)

The legend was that the code for the original Asteroids clone was still on the cart; people claimed that pressing the reset button on the console rapidly would cause the game to glitch into Meteor instead of Astrosmash, but I could never make it work as a kid.

Years later, I got my hands on an intellivision emulator that had really nice disassembler/assembler included (http://spatula-city.org/~im14u2c/intv/). By then I had also read online that the developer simply put a JMP instruction at the beginning of the cart to skip over the original "Meteor" code.

Sure enough, I found a ROM for ASTROSMASH, disassembled it, found the JMP in question and modified the assembly, reassembled, and suddenly I was playing "Meteor!"

Either way, it's a good thing that Mattel trashed the Asteroids clone; ASTROSMASH turned out to be a much better game!


If you're interested in doing this yourself, you don't need a separate hex editor; FCEUX has one built in:

http://www.fceux.com/web/home.html

Hex value watching and editing is a valued tool in the time attack community. If you advance frame by frame and watch certain values, you can see patterns showing when an enemy will attack, an item will drop, etc. Time attackers use it to minimize the time spent waiting for enemies, or finding which character actions affect level or enemy patterns.

http://tasvideos.org/Glossary.html#HexEdit

http://tasvideos.org/InputFileEditing.html


emacs also has a hex editor built in called hexl mode. To use it just use C-x C-f to open a file and then use M-x hexl-mode.

https://www.gnu.org/software/emacs/manual/html_node/emacs/Ed...


I bet someone could make it into a Gameshark code.


For anyone dying to know what world 9 is like, found this on youtube:

https://www.youtube.com/watch?v=FcDfPXsgqQ0

Looks like someone game genie'd it back in 2008


That's crazy.

I'm so confused as to how an invalid level value would generate a level with all sorts of bizarre, invalid combinations... yet still be completely playable, without crashing or anything.


In 2011 I wrote an emulator for the LatticeMico32 processor [1]. After it was written, I decided to play the chaos monkey game and change some instructions, like reversing "less than" and "greater than", just for kicks. So the code I was actually running would be the equivalent of taking a program and replacing all > with < (and vice-versa). Much to my surprise, some emulated code still worked. It mostly did the wrong thing, but the fact that the code worked, printing stuff in the screen and all, still baffles me.

[1] http://www.ubercomp.com/jslm32/src/


It can and does crash a bit, as noted on that video.


9-2 looks like Flappy, a couple decades earlier.


Of course, back then, in the 1980's, there was no publically available internet.

Knowledge of minus world was spread purely through word of mouth. We used our meat based networking protocols.

What barbaric times those were.


My friends and I had a stack of hand drawn maps of Metroid on graph paper that we traded back and forth. Not as convenient as sharing them on the internet, but somehow more gratifying.


Well, there were magazines. Nintendo Power started pretty late in the 80s, but it was also I think the first place I heard about the minus worlds.


Hey, I was the guy that submitted the trick to Nintendo Power! A friend of a friend showed it to me after school and I immediately mailed it in to the magazine. Nintendo Power Agent #826.


I heard about it before nintendo power existed.


Ok. To be clear, there were video game magazines before Nintendo Power (C&VG, for eg. Also, more obscure, but Nintendo's own predecessor the Nintendo Fun Club newsletter) and they played a significant role in spreading this info. The kid with the magazine sub was king of the playground, basically.

I was just stating my experience there.


I remember printing off hundreds of pages of video game cheat codes/walkthroughs on the internet at the local university's computer lab in 1995. That was the first time that I got free information from the internet that I would have otherwise had to pay for. Before that, the only place to look that stuff up was in magazines like Electronic Gaming Monthly. Hell, Nintendo had a paid hotline for cheats.


I remember when one of my cousins was hospitalized, we gave him a Mortal Kombat move list Booklet as a "Get well soon" gift :D

Back in the day, figuring out all the moves in a fighting was a meta-game on its own.


Coincidentally also on the front page right now - realtime hex editing with NES hardware:

https://news.ycombinator.com/item?id=7700990


The Japanese Famicom didn't have a CIC lockout chip, which let you hotswap games and then soft reset, preserving all of the RAM (a power cycle doesn't decay all RAM instantly, but it deteriorates rapidly.)

People would play Mario, then swap in certain games (mostly Tennis), then swap back to Mario, and then try the trick where you hold select or whatever to resume at the level you last died at.

Depending upon the contents of RAM based on what the other game wrote there, it would warp you to all of these corrupted worlds.


Love that people are still hacking NES. There are numerous other glitches in the original NES, such as being able to jump on the turtle in 3-2 (or 3-1 I forget) to get 99 lives (go over 100 and you die.

Also at this point, can't someone from Nintendo just open source the code for nostalgic purposes :)


What you get from disassembling a NES ROM (or, really, software for any 8-bit computer) is not much different from what went in originally, except (maybe) there were some comments.

It's very unlikely that the original assembly source exists anymore, or even that it was kept much later than the game's release. It's not until very, very recently that game companies started to think that the original source and assets for a game would have enough value to be worth the cost of archiving. Even games from the PlayStation 2 era routinely have to be rewritten from scratch with new assets when re-released on later consoles.

In my experience, most of the game source code that survived from the early years of personal computing is for games written in BASIC, which would have been distributed as source. There's a few exceptions like for Jordan Mechner's games, but that just goes hand-in-hand with his famously detailed records of his development process.


While I agree that the original source code for the game is probably long gone, I think we can settle for having a disassembled version of it. As you pointed out, the game was most likely in handwritten assembly, so the assembly output probably isn't much different. The most useful part would have been the comments, which it turns out there were some very dedicated people that went through the entire disassembly and annotated the source code like this one by doppleganger http://www.romhacking.net/documents/344/ and this one where movax tried to make the assembly more natural http://www.romhacking.net/documents/635/

There are several really cool things you can find on here about older games including a detailed explaination of the minus one world http://www.romhacking.net/documents/343/ where doppelganger covers exactly why the game does what it does.


A small correction: You die if you go over 127 lives. This is due to the fact that the game uses 8 bit signed integers to store the number of lives. You don't die immediately either, but when you do die normally, you get a game over because the game detects that you have less than zero lives remaining.


thank you for this. I always thought it was 100. When I was 12 I never bothered to count the symbols "crown + moon = 88" for instance :)


acmlm is well noted for this, as well as speedrunning various games (mostly Dr. Mario and A Link to the Past). Google his name for more info or watch his stream (usually late at night US time) - www.twitch.tv/acmlm


This was really sweet. A somewhat inconsequential hack but incredibly touching writing about it. I love this kind of video game writing.


Very awesome. Thanks for that. I really want to get this running on my big tele and start exploring!


That font is honestly nearly unreadable on Firefox. Font is too thin.


I can believe it, but reading on a retina iPad mini, I was actually struck by how nice it looked!

I think now that A-grade browsers are generally equal in most basic respects, we often forget to test things that might seem inconsequential and not worth testing, like font-weights.


I actually did a bit of testing, including grabbing VMs of various versions of Windows to see how things looked on XP, 7, and 8.1. It remained quite readable in my testing.


Now that I'm back on a desktop computer, I'm looking and it does look pretty good to my eyes, but I could see how it might be too thin for some people.


I tweaked the weights a bit. Hopefully it's a little easier now.


I don't understand the downvotes, it actually is a little annoying on the eyes in FF


Turn javascript off and you'll have a nice readable font ;)


Chrome on Win8.

Font is readable, but pretty thin. A little straining on the eyes.


The very poor contrast doesn't help the situation, either.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: