Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Reload this Page Research Pokémon Pinball Disassembly

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #1    
Old March 8th, 2015 (12:16 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

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!

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote

Relevant Advertising!

  #2    
Old March 18th, 2015 (5:43 PM).
PokéMew's Avatar
PokéMew PokéMew is online now
Pokémon Fuchsia
Silver Tier
 
Join Date: Sep 2013
Location: Refresh
Gender: Male
Nature: Modest
Posts: 484
Send a message via Skype™ to PokéMew

This is cool

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

Reply With Quote
  #3    
Old March 18th, 2015 (8:21 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Quote originally posted by PokéMew:
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.

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #4    
Old September 8th, 2015 (8:02 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

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:

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #5    
Old September 24th, 2015 (8:26 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

I've started writing a tool that will edit stage tiles and collision maps. Here's an early screenshot of the collision mask functionality:

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #6    
Old September 25th, 2015 (1:25 AM).
Ephraim225's Avatar
Ephraim225 Ephraim225 is offline
Freaky Frillish Guy
 
Join Date: Jul 2013
Location: In America
Gender: Male
Nature: Modest
Posts: 128

Oh god I can finally un-suckify the Red Field. Great work!

__________________
Reply With Quote
  #7    
Old September 25th, 2015 (5:09 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Quote originally posted by Ephraim225:
Oh god I can finally un-suckify the Red Field. Great work!
Seriously. The Bellsprout entrance is way too hard to get into.

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #8    
Old September 26th, 2015 (1:06 AM).
PmHacks PmHacks is offline
 
Join Date: Feb 2004
Gender:
Posts: 28

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.

Reply With Quote
  #9    
Old October 6th, 2015 (7:44 AM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

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

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #10    
Old October 26th, 2015 (4:22 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

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:

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #11    
Old October 28th, 2015 (7:30 PM).
PokeGlitch's Avatar
PokeGlitch PokeGlitch is offline
 
Join Date: Feb 2004
Gender:
Posts: 220

Quote originally posted by ShantyTown:
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...

__________________


Currently hacking Red - Pokemon TRE2: Team Rocket Edition

PokeTRE.com

Reply With Quote
  #12    
Old October 31st, 2015 (12:44 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Here's a fun animated gif showing the ROM coverage of pokepinball over time: http://i.imgur.com/ZR6a7EW.gif

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #13    
Old November 1st, 2015 (3:50 PM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 23
Gender: Male
Nature: Hardy
Posts: 889

Quote originally posted by PokeGlitch:
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

__________________
POKEMON RUBY RENEV - http://www.pokecommunity.com/showthread.php?t=341964

My FC is 2080-0646-1641
IGN - Ketrab
Reply With Quote
  #14    
Old November 1st, 2015 (4:16 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Quote originally posted by AtecainCorp.:
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.

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #15    
Old November 1st, 2015 (5:41 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Actually, I just tested it, and it sounds pretty good:

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #16    
Old November 2nd, 2015 (12:34 AM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 23
Gender: Male
Nature: Hardy
Posts: 889

Quote originally posted by ShantyTown:
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.

__________________
POKEMON RUBY RENEV - http://www.pokecommunity.com/showthread.php?t=341964

My FC is 2080-0646-1641
IGN - Ketrab
Reply With Quote
  #17    
Old November 2nd, 2015 (8:06 AM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Quote originally posted by AtecainCorp.:
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.

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #18    
Old November 2nd, 2015 (8:12 AM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 23
Gender: Male
Nature: Hardy
Posts: 889

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.

__________________
POKEMON RUBY RENEV - http://www.pokecommunity.com/showthread.php?t=341964

My FC is 2080-0646-1641
IGN - Ketrab
Reply With Quote
  #19    
Old January 20th, 2016 (7:34 AM).
AlejaKaiser AlejaKaiser is offline
 
Join Date: Jan 2013
Gender: Male
Posts: 7

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!

Reply With Quote
  #20    
Old January 22nd, 2016 (9:33 PM).
ShantyTown's Avatar
ShantyTown ShantyTown is offline
Forever Young
 
Join Date: Aug 2013
Gender: Male
Posts: 304

Quote originally posted by AlejaKaiser:
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.

__________________
Check out my three Gen 1 hacks: , Red Battle Factory, & Thief Red

Pokémon Pinball disassembly: https://github.com/huderlem/pokepinball

Reply With Quote
  #21    
Old January 23rd, 2016 (2:19 AM).
AlejaKaiser AlejaKaiser is offline
 
Join Date: Jan 2013
Gender: Male
Posts: 7

Well, I'll re-skin and change some Pokémon (Digimon) locations and evolution line, for example, if I had re-skined Charmander as Agumon (Or Koromon) I just can evolve twice, so I can't get a WarGreymon from this Digimon, Right? I will try understand all but it's hard to me because English isn't my primary language '

Thanks @ShantyTown for all

Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 1:58 PM.