Improve sound quality of GBA games
Moderator: Moderators
I'm not exactly sure how the original GSF rippers did it, but I think you just zero out large sections of the ROM, until you're just left with the instrument samples, music patterns, and player code.
Instrument samples are easy enough to find.
Instrument samples are easy enough to find.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Look at a ROM in a tile editor such as 8TED in 1-bit, Virtual Boy, GBA, and Mode 7 formats. (Those are the formats that GBA games most often use.) If it looks like tile data, it's not music data now, is it?
If you know ARM assembly language, I'd recommend finding a debugging GBA emulator and using RAM write breakpoints, similarly to how NSFs are ripped. The procedure should look something like this:
If you know ARM assembly language, I'd recommend finding a debugging GBA emulator and using RAM write breakpoints, similarly to how NSFs are ripped. The procedure should look something like this:
- Watch writes to the source address registers for DMA channels 1 and 2 to see when it sets up the audio FIFO. This will give you the address of the audio ring buffer.
- Watch writes to the ring buffer. This will give you the address of the mixer code, which usually runs in IWRAM and is compiled as 32-bit ARM instructions (not 16-bit Thumb). The high nibble of each ARM instruction is a branch before every instruction, and $E0000000-$EFFFFFFF is the code for not taken. (In a tile editor, this will appear as vertical lines running through garbage tiles.)
- Watch writes to the address of the mixer code so you can find the piece of init code that copies the mixer into IWRAM and find the source address. You will need the mixer code and the init code in the final ROM.
- While the mixer is running, watch reads from ROM ($08000000-$09FFFFFF) for sample data, and trace through it to find the voice state data structure in RAM that holds the source address, volume, playback rate, etc.
- While not in the mixer, watch the voice state; this is the sound effect and music player.
- Follow the 'bx lr' (return from subroutine) instructions until you reach something that looks like it gets called once per frame or once per IRQ.
I already know how to localize all music/sample data (see in my doccument, which is now on romhacking.net). But not code. Although I suspect it to be right before the music data, yet I have no idea to know where it starts.I'm not exactly sure how the original GSF rippers did it, but I think you just zero out large sections of the ROM, until you're just left with the instrument samples, music patterns, and player code.
I don't.If you know ARM assembly language
Useless, lumbering half-wits don't scare us.
OK tepples I tried doing what you said. Localizing the audio buffer is easy with Visual Boy Advance. However, I'm stuck here.
I spend hours looking for various GBA emulators, and none seems to allow breakpoints. So I have no way to localize code that write to the audio buffer(s). Maybe I should try and contact Cait Sith 2 about that (and have 90% of chances to never get any answer) ?
PS : Is there a way to tell how many CPU% is used in an emulator ? Would be useful to know if there is actually room for better sound quality in some games.
I spend hours looking for various GBA emulators, and none seems to allow breakpoints. So I have no way to localize code that write to the audio buffer(s). Maybe I should try and contact Cait Sith 2 about that (and have 90% of chances to never get any answer) ?
PS : Is there a way to tell how many CPU% is used in an emulator ? Would be useful to know if there is actually room for better sound quality in some games.
Useless, lumbering half-wits don't scare us.
I'm working on a program that does stuff with GBA music...

Here's a screenshot of the program reading data out of Shining Force Advance. I'm getting some weird stuff, like a key split instrument containing other key split instruments.

Here's a screenshot of the program reading data out of Shining Force Advance. I'm getting some weird stuff, like a key split instrument containing other key split instruments.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
OK Folks,
I just revive this thread to make publicity for my new Java tool here :
http://www.romhacking.net/utilities/881/
It allows to play GBA music using exclusively MIDIs and SoundFonts, without even emulating the GBA, and the quality can be clearly superior.
I just revive this thread to make publicity for my new Java tool here :
http://www.romhacking.net/utilities/881/
It allows to play GBA music using exclusively MIDIs and SoundFonts, without even emulating the GBA, and the quality can be clearly superior.
Useless, lumbering half-wits don't scare us.
The executables ones are the ones mentionned in the readme.txt files, the other ones are the libraries.
Basically you'd only need to execute GBAMusRiper really. Exact instructions are given in the readme.txt files about how to run them from command line.
And I have no idea how .jar files works... but I think this if for java programs that have a graphical interface (mines doesn't have any).
Basically you'd only need to execute GBAMusRiper really. Exact instructions are given in the readme.txt files about how to run them from command line.
And I have no idea how .jar files works... but I think this if for java programs that have a graphical interface (mines doesn't have any).
Useless, lumbering half-wits don't scare us.
Almost works ?
I'll assume it reads MIDIs fine but probably it uses your default MIDI synth indead of the sound fonts, which makes it sound like crap.
You'll need something like BASSMIDI driver to use sound fonts with any random PC.
Some old PCs with high quality sound carts can also natively use Sound Fonts (with a program that came with the sound cart), but modern PCs tends to have only simple sound cards on the motherboards without any advanced features (since everyone uses SoftSynths nowdays), therfore BASSMIDI is the way to go.
I'll assume it reads MIDIs fine but probably it uses your default MIDI synth indead of the sound fonts, which makes it sound like crap.
You'll need something like BASSMIDI driver to use sound fonts with any random PC.
Some old PCs with high quality sound carts can also natively use Sound Fonts (with a program that came with the sound cart), but modern PCs tends to have only simple sound cards on the motherboards without any advanced features (since everyone uses SoftSynths nowdays), therfore BASSMIDI is the way to go.
Useless, lumbering half-wits don't scare us.
VLC actually does not use the system MIDI at all. It requires you to pick a soundfont file before it will play anything.
But after I do that, some instruments play correctly, and others do not.
VLC seems to be powered by "FluidSynth".
But after I do that, some instruments play correctly, and others do not.
VLC seems to be powered by "FluidSynth".
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
XMPlay (with the MIDI plug-in) supposedly also plays MIDIs with SoundFonts, but I haven't personally tried it yet.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi