• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Pokémon Pinball Disassembly

330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
Hi, everyone. I've been working on a full disassembly of Pokémon Pinball (GBC), and a lot of progress has been made on it. It's not as complicated as the traditional Pokémon games, so I think it won't be hard to get the entire ROM disassembled and reasonably well-labeled.

Check out its GitHub repository here: https://github.com/huderlem/pokepinball

Feel free to help out if you're interested in this project!
 

PokéMew1

Pokémon Fuchsia
484
Posts
10
Years
This is cool :)

I used to play Pokémon Pinball all the time, can't wait to see further progress!
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
This is cool :)

I used to play Pokémon Pinball all the time, can't wait to see further progress!

I put way too much time into it as a kid, too! I'm pushing a commit or two to the repository every day. At this point I've pretty much all of the routines that aren't part of the actual Pinball gameplay, meaning all of the menus, pokedex, high scores, etc. are all dumped. Most need labeling and documentation, though.

Currently, I'm dumping the actual Pinball gameplay routines bit by bit.
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
At this point, all of the code in the game has been dumped, including lots of data/graphics. Many routines have been labeled, as well as a good chunk of RAM addresses. I'm always looking for people to help. Eventually, I'd like to make a "Pokemon Pinball Gold & Silver" hack using this disassembly.

Here's a video of adding Chikorita to the game, using the disassembly:
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
I've started writing a tool that will edit stage tiles and collision maps. Here's an early screenshot of the collision mask functionality:

vNAjkzj.png
 
28
Posts
20
Years
  • Seen Sep 4, 2020
This project made me discover there was a gba remake of this game and so I've started a disassembly project for that. Not sure if I'll finish it but still its an interesting game and I loved playing the gbc one as a child, so I hope you complete the gbc disassembly.
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
Some recent progress on the disassembly:

I've been slowly going through all of the unlabeled static pointers and dumping/labeling the data they point to. This is basically "the plan" until everything has been labeled. Unfortunately, there are still about 800 unlabeled pointers.

I also discovered that each pokemon has its own collision mask when trying to catch it in Catch'em mode. I expected all of the pokemon to simply share a circular collision mask. If you want to take a look, you can find those here: https://github.com/huderlem/pokepinball/tree/master/data/collision/mon_masks
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
In Pokemon Pinball, there is a bonus reward where two Pikachus can save your ball in the bottom corners of the stage. When they are in the act of propelling the ball upward, a raw audio clip is played that sounds like "Piiiiii-Kaaaaaaa". It turns out that both Pokemon Pinball and Pokemon Yellow Version share the same code that plays audio clips. Additionally, Pokemon Pinball borrows two Pikachu sound clips from Yellow Version.

In the ROM, the actual sound data is stored as 1-bit pcm. "pcm" stands for pulse-code-modulation, which is a fancy way of saying "sound wave amplitudes". Since the pcm is only 1-bit, each sample in wave is either maximum or minimum amplitude--"on or off". Of course, this results in a very low-quality sound. That's okay, because the GameBoy wasn't designed to play pcm audio.

Then how does Pokemon Pinball/Yellow play the pcm data? The playback routine writes volume data to the GameBoy's wave channel (channel 3). The logic goes like this:
  1. Read single 1-bit pcm sample
  2. Write either 100% or 0% volume to the wave channel
  3. Wait a set number of CPU cycles
  4. Repeat until the pcm data is over

Now that we know the audio's data structure (1-bit pcm) and how the game interprets that data, we should be able to do two things:
  1. Convert the 1-bit pcm data from the game into a .wav file
  2. Convert an arbitrary .wav file into 1-bit pcm data tha the game can understand

Converting 1-bit pcm data into a .wav file is trivial, and it turns out converting a .wav into a 1-bit pcm stream is also pretty straightforward. This allows us to use .wav files in the pokepinball and pokeyellow projects. At compile time, the .wav files are converted into the 1-bit pcm format using a python script.

Here are the .wav files ripped from the games:
https://github.com/pret/pokeyellow/tree/master/audio/pikachu_cries
https://github.com/pret/pokepinball/tree/master/audio/sound_clips

This also allows you to replace any of Pikachu's cries in Pokemon Yellow, for example, with your own recorded voice. Here's me testing that out:
 
228
Posts
20
Years
  • Seen Jun 28, 2023
In Pokemon Pinball, there is a bonus reward where two Pikachus can save your ball in the bottom corners of the stage. When they are in the act of propelling the ball upward, a raw audio clip is played that sounds like "Piiiiii-Kaaaaaaa". It turns out that both Pokemon Pinball and Pokemon Yellow Version share the same code that plays audio clips. Additionally, Pokemon Pinball borrows two Pikachu sound clips from Yellow Version.

In the ROM, the actual sound data is stored as 1-bit pcm. "pcm" stands for pulse-code-modulation, which is a fancy way of saying "sound wave amplitudes". Since the pcm is only 1-bit, each sample in wave is either maximum or minimum amplitude--"on or off". Of course, this results in a very low-quality sound. That's okay, because the GameBoy wasn't designed to play pcm audio.

Then how does Pokemon Pinball/Yellow play the pcm data? The playback routine writes volume data to the GameBoy's wave channel (channel 3). The logic goes like this:
  1. Read single 1-bit pcm sample
  2. Write either 100% or 0% volume to the wave channel
  3. Wait a set number of CPU cycles
  4. Repeat until the pcm data is over

Now that we know the audio's data structure (1-bit pcm) and how the game interprets that data, we should be able to do two things:
  1. Convert the 1-bit pcm data from the game into a .wav file
  2. Convert an arbitrary .wav file into 1-bit pcm data tha the game can understand

Converting 1-bit pcm data into a .wav file is trivial, and it turns out converting a .wav into a 1-bit pcm stream is also pretty straightforward. This allows us to use .wav files in the pokepinball and pokeyellow projects. At compile time, the .wav files are converted into the 1-bit pcm format using a python script.

Here are the .wav files ripped from the games:
https://github.com/pret/pokeyellow/tree/master/audio/pikachu_cries
https://github.com/pret/pokepinball/tree/master/audio/sound_clips

This also allows you to replace any of Pikachu's cries in Pokemon Yellow, for example, with your own recorded voice. Here's me testing that out:

That's pretty cool, good find. But you are right about the low quality. It might be a good replacement for the Pokemon cries, at least. The originals always seemed off for me anyway...
 

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
That's pretty cool, good find. But you are right about the low quality. It might be a good replacement for the Pokemon cries, at least. The originals always seemed off for me anyway...

I wonder that your technique can work on GSC roms also... I mean to imput oryginal cries from Generation III to VI on the place of oryginals. I know it would been in very low quality. But Why not to heard Xerneas cry in Pokemon Gold hack XD
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
I wonder that your technique can work on GSC roms also... I mean to imput oryginal cries from Generation III to VI on the place of oryginals. I know it would been in very low quality. But Why not to heard Xerneas cry in Pokemon Gold hack XD

It would definitely work. You'd just need to copy the audio playback function from pokepinball or pokeyellow. That being said, raw 1-bit audio data takes up a lot of space. You would only be able to fit about 4 cries in a single ROM bank. Also, I believe that the audio really won't be high enough quality for cries... But someone should try it out, just to see how it sounds.
 

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
Actually, I just tested it, and it sounds pretty good:

That was amazing.... I know that someone found method to make 8mb gbc rom.
This and your findings <With my idea which start Cries portings> Can start new era in GBC and GB hacking.

If the Yellow cry engine can be expanded for all Pokemons. It would be great to make Oryginal cries for further than Kanto and Johto pokemons actual cries in game.
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
That was amazing.... I know that someone found method to make 8mb gbc rom.
This and your findings <With my idea which start Cries portings> Can start new era in GBC and GB hacking.

If the Yellow cry engine can be expanded for all Pokemons. It would be great to make Oryginal cries for further than Kanto and Johto pokemons actual cries in game.
I wouldn't call this a "new era"...

I know some people want to try and recreate future-gen pokemon cries with the normal method that all of the cries are implemented. While that would be ideal, it would also take a lot longer and be more difficult than using raw audio data, like the video above.
 

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
But by raw media... I wonder how would work Arceus cry. Since Arceus Cry is problematic in GBA games... So IDK how it would work with this method. If it would work. It would be great to make table of cries like gen 3 games.
 
10
Posts
11
Years
  • Seen Sep 24, 2020
Wow dude, this its so nice. It's this game easier to hack than GBA pinball? I like to hack one of this pinball to make a Digimon Pinball so Im so happy to see at least I could do the hack on the GBC game :)

Good luck with your research!
 
330
Posts
10
Years
  • Age 32
  • Seen Nov 24, 2023
Wow dude, this its so nice. It's this game easier to hack than GBA pinball? I like to hack one of this pinball to make a Digimon Pinball so Im so happy to see at least I could do the hack on the GBC game :)

Good luck with your research!

I would say "yes", this game is easier to hack than GBA pinball because this disassembly exists! :)

If you just want to re-skin the game as Digimon, it wouldn't be difficult, since the disassembly converts regular .png files to build the ROM.
 
Back
Top