JeffRuLz/Celeste-Classic-GBA

Amazing!

gabrielmadruga opened this issue · 4 comments

This is incredible!
Did you write somewhere about the process to make this?
I'm especially curious about how you extracted the music from the Pico-8 source.

My process was I combed through the code for the pico-8 version and rewrote it into C, making accommodations for syntax changes and the GBA hardware. Easier said than done.

For the music and sound effects, pico-8 has an export function that will generate wav files from a cart.
https://pico-8.fandom.com/wiki/Export

Thanks for the reply, Jeff.
Some time ago, I did something similar with TypeScript (simplest I could do it). At first, the translation was almost one-to-one, but then I switched to a more imperative style because my plan was to try my luck with C later on, maybe play with WebAssembly and stuff—mostly as a learning experience in game dev.

I got everything working except for the music. One of the reasons is I don't know a lot about audio programming, and exporting it gives you a WAV file, which (I think) has the wrong duration. So looping or starting at a specific time has to be done manually.

I see you have some .xm files (I don't know much about them), so it seems it was a little involved for you too. Did you use a tracker?

Pico-8 exports the music in chunks as they appear in the audio editor. I did use a tracker (Anvil Studio I think) to reconstruct the music into a format supported by maxmod. The .wav files were imported as samples.
It's a really inefficient way to do it but at the time I just wanted it to work, I didn't expect the project to get this popular.

Ideally you would write an audio engine that imitates the pico-8 but last I checked there isn't a lot of documentation on it. (I would like to do that in the future but I don't know much about audio programming either.)
I would suggest looking at a pico-8 emulator. This seems to be a good start:
https://github.com/jtothebell/fake-08/blob/master/source/Audio.h

Thanks, Jeff! Closing this to avoid cluttering the repository.