Reprogramming Super Mario World from Inside The Game

[SethBling] recently set a world record speed run of the classic Super Nintendo game Super Mario World on the original SNES hardware. He managed to beat the game in five minutes and 59.6 seconds. How is this possible? He actually reprogrammed the game by moving specific objects to very specific places and then executing a glitch. This method of beating the game was originally discovered by Twitch user [Jeffw356] but it was performed on an emulator. [SethBling] was able to prove that this “credits warp” glitch works on the original hardware.

If you watch the video below, you’ll see [SethBling] visit one of the first available levels in the game. He then proceeds to move certain objects in the game to very specific places. What he’s doing here is manipulating the game’s X coordinate table for the sprites. By moving objects to specific places, he’s manipulating a section of the game’s memory to hold specific values and a specific order. It’s a meticulous process that likely took a lot of practice to get right.

Once the table was setup properly, [SethBling] needed a way to get the SNES to execute the X table as CPU instructions. In Super Mario World, there are special items that Mario can obtain that act as a power up. For example, the mushroom will make him grow in size. Each sprite in the game has a flag to tell the SNES that the item is able to act as a power up. Mario can either collect the power up by himself, or he can use his friendly dinosaur Yoshi to eat the power up, which will also apply the item’s effects to Mario.

The next part of the speed run involves something called the item swap glitch. In the game, Mario can collect coins himself, or Yoshi can also collect them by eating them. A glitch exists where Yoshi can start eating a coin, but Mario jumps off of Yoshi and collects the coin himself simultaneously. The result is that the game knows there is something inside of Yoshi’s mouth but it doesn’t know what. So he ends up holding an empty sprite with no properties. The game just knows that it’s whatever sprite is in sprite slot X.

Now comes the actual item swap. There is an enemy in the game called Chargin’ Chuck. This sprite happens to have the flag set as though it’s a power up. Normally this doesn’t matter because it also has a set flag to tell the game that it cannot be eaten by Yoshi. Also, Chuck is an enemy so it actually hurts Mario rather than act as a power up. So under normal circumstances, this sprite will never actually act as a power up. The developers never programmed the game to properly handle this scenario, because it was supposed to be impossible.

If the coin glitch is performed in a specific location within the level, a Chargin’ Chuck will spawn just after the coin is collected. When the Chuck spawns, it will take that empty sprite slot and suddenly the game believes that Yoshi is holding the Chuck in his mouth. This triggers the power up condition, which as we already know was never programmed into the game. The code ends up jumping to an area of memory that doesn’t contain normal game instructions.

The result of all of this manipulation and glitching is that all of the values in the sprite X coordinate table are executed as CPU instructions. [SethBling] setup this table to hold values that tell the game to jump to the end credits. The console executes them and does as commanded, and the game is over just a few minutes after it began. The video below shows the speed run but doesn’t get too far into the technical details, but you can read more about it here.

This isn’t the first time we’ve seen this type of hack. Speed runs have been performed on Pokemon with very similar techniques. Another hacker managed to program and execute a version of single player pong all from within Pokemon Blue. We can’t wait to see what these game hackers come up with next. Continue reading “Reprogramming Super Mario World from Inside The Game”

Super Mario on a Human-Machine-Interface!

super mario

Getting Super Mario to work on your TI-83 calculator is almost a rite of passage for young geeks, so we really liked this project where [Chad Boughton] managed to get it running on a PLC’s HMI screen instead!

He’s using a Danfoss DP600LX microcontroller with an HMI display along with a CAN bus joystick. This kind of equipment is typically used to control hydraulic systems, as well as display sensor data — [Chad] was curious to see if he could do animation with it as well — it looks like he’s succeeded! The funny thing is we’ve seen those “joysticks” before and it’s cool to see them used for something like this — like [Chad] said, they’re normally used for actuating hydraulic and pneumatic cylinders.

Stick around after the break to see Mario eat some mushrooms.

Continue reading “Super Mario on a Human-Machine-Interface!”

Mario Doorbell Guaranteed To Drive A-You A-Crazy

marioDoorbell

Is your doorbell not exciting enough for your guests? [Joe] wanted to provide a little entertainment for his visitors, so he redesigned his doorbell with a Mario theme.

Whenever someone presses the button—which carries the Mario coin image—the segment display increments and the Mario coin sound plays. To add variety, the life-up sound plays at every 10 coins and the mushroom upgrade sound plays upon reaching 100. [Joe] tried putting the life-up sound at its appropriate 100’s place and the mushroom sound at every 10, but he decided the brevity of life-up was more tolerable in the 10’s slot.

The project was divided into two components. The door button has a PIC16F628A microcontroller with a dual 7-segment LED display, a button, and a homemade circuit board. All this lives in a simple box covered by a Yoshi’s Island-themed decal. The button’s board connects to a separate ringer board—based around a PIC16F87—with a MCP4822 DAC and a 25LC1024 EEPROM. Button presses on the first board prompt a request for a sound clip read on the EEPROM. Keep clicking for a demo video below.

Continue reading “Mario Doorbell Guaranteed To Drive A-You A-Crazy”

Mario plays piano with a little help from Raspberry Pi

mario-piano

[David] has created his own live robot band to play live versions of the music and sound effects of NES games. Most of us who grew up in the 80’s and 90’s have the music of Nintendo games burned into our brains. While there have been some amazing remixes created over the years, [David] has managed to do something truly unique. Armed with an emulator, some software prowess, and a pair of Raspberry Pis, [Dave] created a system that plays game music and sound effects on analog instruments. A Yamaha Disklavier player piano handles most of the work through a connection to a Raspberry Pi. Percussion is handled by a second Pi.  Snare drum, wood block, and tambourine are all actuated by a custom solenoid setup.

The conversion process all happens on the fly as the game is played. [Dave] says the process has about ½ second of lag when played live, but we’re sure that could be fixed with some software tweaks. Continue reading “Mario plays piano with a little help from Raspberry Pi”

Teaching a computer to play Mario… seemingly through voodoo

computer-learning-mario

Some people know [Tom Murphy] as [Dr. Tom Murphy VII Ph.D.] and this hack makes it obvious that he earned those accolades. He decided to see if he could teach a computer to win at Super Mario Bros. But he went about it in a way that we’d bet is different that 99.9% of readers would first think of. The game doesn’t care about Mario, power-ups, or really even about enemies. It’s simply looking at the metrics which indicate you’re doing well at the game, namely score and world/level.

The link above includes his whitepaper, but we think you’ll want to watch the 16-minute video (after the break) before trying to tackle that. In the clip he explains the process in laymen’s terms which so far is the only part we really understand (hence the reference to voodoo in the title). His program uses heuristics to assemble a set of evolving controller inputs to drive the scores ever higher. In other words, instead of following in the footstep of Minesweeper solvers or Bejeweled Blitz bots which play as a human would by observing the game space, his software plays the game over and over, learning what combinations of controller inputs result in success and which do not. The image to the right is a graph of it’s learning progress. Makes total sense, huh?

Continue reading “Teaching a computer to play Mario… seemingly through voodoo”

Booting a 1989 Mac with Mario

As a new recruit to the 68k Macintosh Liberation Army, [dougg3] is really showing off his hardware hacking ability. He came up with a replacement ROM SIMM for his Mac IIci and made it play the Mario theme on boot instead of the normal chimes.

Swapping out the ROM in these old macs isn’t an uncommon procedure. On some 68k machines, there’s a SIMM slot to either replace or expand the soldered ROM. In fact, it’s fairly common to take the ROM SIMM out of a IIsi and put it in the king of kings computer to make an SE/30 32-bit clean. We’ve never seen a re-writable ROM SIMM for these old macs, so we’re pretty sure [dougg3] just spared a Mac IIsi from the dumpster.

Now that the entire 68k Liberation Army is clamoring for one of [dougg3]’s re-writable ROMs (we’ve got cash), the question of what to do with it comes up. Of course, SE/30s can now be 32-bit clean without installing MODE32 and new startup chimes can be added. We’d really like to see some hard-core ROM hacking going on, like installing a 68060 in a Quadra 950.

Continue reading “Booting a 1989 Mac with Mario”

No quarters required for this sidescrolling game in a box

teagduino_game_in_a_box

[Adam] from Teague Labs wrote in to share a new gadget they built to help demonstrate the capabilities of the Teagueduino. Their table top video game in a box was made with a bunch of electronic components they had sitting around, as well as soda straws, plenty of painter’s tape, and some popscicle sticks.

When someone pulls the string on the front of the box, a servo opens it automatically, and a second servo starts spinning the game reel. As the reel moves, the player is presented with a set of obstacles to dodge, guiding the “hero” via a knob-controlled servo. A hall sensor attached to the back of the character is tripped when passing over any of the obstacles, which are attached to the reel with magnetic tape. When the hero collides with an obstacle, the game ends and proceeds to close itself, much to the chagrin of the player.

As you can see in the video below, it’s a pretty entertaining and challenging game.

Looking to make one of your own? Swing by the Teagueduino site to grab the game’s code and be sure to share your creations with us in the comments.

Continue reading “No quarters required for this sidescrolling game in a box”