Gameboy Advance NSF player

Discussion of development of software for any "obsolete" computer or video game system.
Post Reply
mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Gameboy Advance NSF player

Post by mic_ » Tue Feb 04, 2020 12:28 am

Link to the .GBA file
Link to source code

This is a small project I've been working on off and on for a while.
I wanted to write an NSF player where everything was emulated on the GBA's ARM CPU, rather than relying on the DMG/CGB-compatible sound channels for some kind of HLE.
I also wanted to experiment with band-limited synthesis. So for the two pulse wave channels I'm using a band-limited wavetable synthesis approach, with 2 wavetable entries per octave. The other 3 channels are still not band-limited in any way though, with all the problems that that leads to. The noise channel in particular sounds atrocious. Also, the sweep generators are currently not working correctly.

Screenshot:
Image

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Re: Gameboy Advance NSF player

Post by mic_ » Wed Feb 05, 2020 10:39 am

Also, the sweep generators are currently not working correctly.
I think I've fixed that now. I had forgotten to write back the updated divider's period after decrementing it.

User avatar
Bregalad
Posts: 7952
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: Gameboy Advance NSF player

Post by Bregalad » Thu Feb 06, 2020 6:25 am

Very cool ! This remains me of the NSF player for the SNES which had very cool vizalisation, but only sounded good in ZSNES and if you disabled interpolation.

Why did you target the GBA in particular ?
Do you plan to support other systems such as the GBC or the SPC700 ?
Which sample rate do you use on the GBA ?

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Re: Gameboy Advance NSF player

Post by mic_ » Thu Feb 06, 2020 7:27 am

This remains me of the NSF player for the SNES which had very cool vizalisation
If you're thinking of Memblers' NSF player, then yes, it was really cool.
Why did you target the GBA in particular ?
It's one of a few systems that are powerful enough for this to be doable, but not so powerful that it becomes trivial. I originally considered doing this project for the DS and include VRC6 support. Maybe I'll still do that eventually, but I settled for the GBA and the 5 standard channels for now.
Do you plan to support other systems such as the GBC or the SPC700 ?
I'm doubtful about the SPC due to the relatively large number of channels. GBS playback should be doable, especially since you wouldn't have to emulate the sound processor. If I ever do that it's probably going to be a completely separate project though - to avoid bloating this one with too much stuff.
Which sample rate do you use on the GBA ?
32768 Hz, since that is the native sample rate of the GBA sound hardware AFAIK.

lidnariq
Posts: 9706
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Gameboy Advance NSF player

Post by lidnariq » Thu Feb 06, 2020 11:18 am

mic_ wrote:
Thu Feb 06, 2020 7:27 am
Which sample rate do you use on the GBA ?
32768 Hz, since that is the native sample rate of the GBA sound hardware AFAIK.
GBA output stage can run at 215Hz and 9 bits - which is the only rate where the full 8bits of the DirectSound channels are preserved - but also 216 and 8, 217 and 7, or 218 and 6. The higher rates will reduce sounds of aliasing in the native PSG channels, at the cost of reducing bit depth available to the DirectSound channels.

Post Reply