Popular YouTube speedrunner and Minecraft builder Sethbling has manually injected the source code of the mobile phenomenon Flappy Bird and injected it into unused file space in Super Mario World for the Super Nintendo Entertainment System (SNES).
Sethbling achieved this on a standard, unmodified SNES and an unmodified copy of Super Mario World. There is no software or external hacking hardware used for this, just a keen use of exploits and a whole lot of patience.
He completed the glitch in about an hour and a half in a live broadcast on Twitch. He told his viewers that if he was able to complete the glitch flawlessly, it would take about an hour. But if he made even the smallest error in his manual coding, the entire game could crash.
Sethbling describes the steps of his code injection as one big series of glitches.
“I used a series of Super Mario World glitches to inject 331 bytes of processor instructions into system RAM,” he said. “This kind of thing has been done before by feeding pre-recorded controller inputs into a console from a computer, no human has completed this kind of exploit until now.”
Sethbling exploited a glitch called “Powerup Incrementation”, which forces the game’s code to change based on Mario’s Current powerup, measured from zero to three. Once reaching powerup level three, the glitch allowed Sethbling to reach normally unattainable power-up states.
“Whenever you collect a powerup, the game looks up a memory address containing some code to run based on your current powerup,” he said. “When you have an invalid powerup state like this, it can start running code from places other than the game cartridge.”
Sethbling used Yoshi to spit out red shells at specific X coordinates across the level, thus injecting a series of processor instructions into the game. He then executed the command by collecting a 1-UP mushroom.
It’s all very confusing, but basically by manipulating exploits in the game’s code, Sethbling was able to manually write the entire code of Flappy Bird within Super Mario World.
Upon injecting the final byte of Flappy Bird’s code, the game stopped running Super Mario World’s code and started running the one Sethbling inputted.
“It took about an hour to complete the whole code injection. In the end, I’m really proud of this project and grateful p4plus2 and MrCheeze for all the help they provided,” Sethbling said.