Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-03-08 20:23:07

ShantyTown
Member
Registered: 2013-12-04
Post 217/344

Pokémon Pinball Disassembly

I've been working on a Pokémon Pinball (GBC) disassembly project, and a lot of progress has been made on it.  The GitHub repository is here: https://github.com/huderlem/pokepinball

Feel free to join in.  I'm finding it pretty easy going because the game is a lot less complex than a traditional pokemon RPG game.

Special thanks to Danny-E 33 for cleaning some stuff up early and yenatch for the music.

Offline

#2 2015-03-08 23:07:49

Chamber_
Member
Registered: 2013-12-31
Post 115/119

Re: Pokémon Pinball Disassembly

I would like to do one TCG. I see more strategy.

Offline

#4 2015-07-18 23:25:22

ShantyTown
Member
Registered: 2013-12-04
Post 237/344

Re: Pokémon Pinball Disassembly

I think I just hit a milestone for the pokepinball disassembly. All known routines in the game have been dumped.  main.asm clocks out at roughly 42,000 lines.  The next general step is to label/dump the graphics-related data that are hardcoded in the routines.

Offline

#5 2015-07-19 05:53:37

Danny-E 33
Administrator
Registered: 2012-06-09
Post 880/1,119

Re: Pokémon Pinball Disassembly

That's impressive. I will probably see what I can contribute soon. Feel free to contribute the the tcg disassembly. I haven't touched it in a while, just because i finished what I was mostly interested in; music, cards, decks, text and graphics. And I get bored with just dumping asm.

Offline

#6 2015-07-19 16:23:08

ShantyTown
Member
Registered: 2013-12-04
Post 238/344

Re: Pokémon Pinball Disassembly

Yeah, dumping the routines is pretty bland...but necessary.  I'll look into the tcg project in the future, but not in the short term because I'm not super familiar with the game.

Offline

#7 2015-09-07 21:17:54

ShantyTown
Member
Registered: 2013-12-04
Post 243/344

Re: Pokémon Pinball Disassembly

Here's something fun: https://youtu.be/wL2qeDQjozQ

Eventually, I think it would be cool to make a "Pokemon Pinball Gen 2" game.

Offline

#8 2015-09-20 03:47:46

ShantyTown
Member
Registered: 2013-12-04
Post 244/344

Re: Pokémon Pinball Disassembly

Fun fact:

The Pokedex entries appear in the exact same order with the exact same text as Red/Blue version (Rhydon, Kangaskhan, Nidoran_M, Clefairy, and so on).  I think the data was literally copy-pasted from whatever text file they were using for Red/Blue development.

It's not that interesting... but it's fun to stumble upon this kind of thing.

Last edited by ShantyTown (2015-09-20 03:49:28)

Offline

#9 2015-09-25 04:25:18

ShantyTown
Member
Registered: 2013-12-04
Post 245/344

Re: Pokémon Pinball Disassembly

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

Offline

#10 2015-10-06 15:47:15

ShantyTown
Member
Registered: 2013-12-04
Post 246/344

Re: Pokémon Pinball Disassembly

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 … /mon_masks

Offline

#11 2015-10-27 00:24:53

ShantyTown
Member
Registered: 2013-12-04
Post 249/344

Re: Pokémon Pinball Disassembly

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 … achu_cries
https://github.com/pret/pokepinball/tre … ound_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:
https://www.youtube.com/watch?v=pChFdI2NnjQ

Offline

#12 2015-10-27 00:31:11

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,091/3,578

Re: Pokémon Pinball Disassembly

Oh wow, that's really impressive! I was always curious how Yellow managed to pull that off. I forgot Pinball did it too.

Offline

#13 2015-10-31 20:43:39

ShantyTown
Member
Registered: 2013-12-04
Post 250/344

Re: Pokémon Pinball Disassembly

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

Offline

#14 2015-11-01 22:49:58

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,145/1,199
Website

Re: Pokémon Pinball Disassembly

ShantyTown wrote:

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

That needs some defragmentation :P


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#15 2015-11-15 06:58:02

ShantyTown
Member
Registered: 2013-12-04
Post 251/344

Re: Pokémon Pinball Disassembly

I changed the Pokedex so that it shows you the ball that you caught the pokemon with:
c7PmJCI.gif

Pokemon seen/owned flags are just stored as flags, so I had to update the logic for that data to store the pokeball type when capturing a pokemon.

Offline

#16 2015-11-15 15:57:32

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,172/3,578

Re: Pokémon Pinball Disassembly

That's actually really cool

Offline

#17 2017-06-19 18:24:29

ShantyTown
Member
Registered: 2013-12-04
Post 343/344

Re: Pokémon Pinball Disassembly

This disassembly is nearing "completion", meaning there are only 19 INCBINs from baserom.gbc remaining.  I've been working pretty hard on that recently--I think there were ~300 INCBINs 3 months ago.  Once the baserom.gbc dependency is removed, I'll work on taking moving stuff out of main.asm, since it's currently 53,000 lines long.  After that, I'll probably make some fun hacks with it to weed out any possibly-missed hardcoded pointers.

Offline

#18 2017-06-21 05:34:42

ShantyTown
Member
Registered: 2013-12-04
Post 344/344

Re: Pokémon Pinball Disassembly

The disassembly is now "complete", meaning there are no more INCBINs from baserom.gbc!

Offline

Board footer

Powered by FluxBB