Author Topic: Reprogramming Pokemon Yellow  (Read 697 times)

0 Members and 1 Guest are viewing this topic.

Offline Captain Jack Harkness

  • Petter, Brony, and All-Around Cartoon Addict
  • The Beast
  • *****
  • Posts: 2868
  • Gender: Male
  • Or as a friend calls him, Captain Jack Hotness!
Reprogramming Pokemon Yellow
« on: December 06, 2012, 03:33:01 am »
So you're probably looking at the title and asking "What the fuck?"

Well, let's just say that the people who make TAS movies are conducting a very exacting science.  Those TAS makers who corrupt memory especially so.  However, one TASer took this a step further recently.

Here's a video:

<a href="" target="_blank"></a>

Here's a video showing button presses:

<a href="" target="_blank"></a>

So what the fuck's going on?

I call a program that allows you to write any other program a "bootstrapping program". So, the goal is to somehow get a bootstrapping program into pokemon yellow and then force yellow to run that program instead of its own.

After gathering these items, I deposit them in the appropriate order into the item PC to spell out my bootstrapping program. Writing a full bootstrap program in one go using only items turned out to be too hard, so I split the process up into three parts. The program that I actually construct using items is very limited. It reads only from the A, B, start, and select buttons, and writes 4 bits each frame starting at a fixed point in memory. After it writes 200 or so bytes, it jumps directly to what it just wrote. In my run, I use this program to write another bootstrapping program that can write any number of bytes to any location in memory, and then jump to any location in memory. This new program can also write 8 bits per frame by using all the buttons. Using this new bootstrap program, I write a final bootstrapping program that does everything the previous bootstrapping program does except it also displays the bytes it is writing to memory on the screen.

That's some pretty involved shit, no?  The TAS is actually rewriting the game's RAM, and that's being used to actually write a program for the Gameboy.

The final payload program is multiple programs. I created a reduced form of MIDI and implemented it in gameboy machine language. Then I translated a midi file from into this reduced MIDI language. The payload program contains both the music data and the MIDI interpreter to play that data. The picture works in a similar way. There is code to translate a png file into a form that can be displayed on a gameboy, and other code to actually display that image. Both the image and the display code are also written by the final bootstrapping program. Even though my final payload is rather simple, you can write any program at all as the payload. The source for the sound and image displaying code is at

This entire project is open source and I encourage anyone who wants to take the code and play around!

(click to show/hide)
« Last Edit: December 06, 2012, 03:52:31 am by B-Man »
My friend's blog.  Check it out!

I blame/credit The Doctor with inspiring my name change.