Gameboy Advance SID player
Gameboy Advance SID player
YouTube video
I felt like doing some ARM assembly coding, so I decided to write a SID player for the GBA.
Porting the 6510 emulator I wrote for the SuperH-2 was pretty easy since it uses a lot of macros and the ARM and SuperH-2 have the same number of registers, but for the 6581 I had to start from scratch. It took a while to sort out all the bugs (the most serious ones anyway - it's still buggy), but now I've reached the point where it kind of works.
I felt like doing some ARM assembly coding, so I decided to write a SID player for the GBA.
Porting the 6510 emulator I wrote for the SuperH-2 was pretty easy since it uses a lot of macros and the ARM and SuperH-2 have the same number of registers, but for the 6581 I had to start from scratch. It took a while to sort out all the bugs (the most serious ones anyway - it's still buggy), but now I've reached the point where it kind of works.
Re: Gameboy Advance SID player
Would the 6502-minus-decimal-mode emulator from PocketNES work as well? Or do SIDs actually use decimal mode?
Re: Gameboy Advance SID player
Sounds pretty good so far! Definitely a big improvement over the GBA SID player(s?) I heard back when GBA homebrew was still a brand new thing.
(Do I win anything for recognizing the tune? )
(Do I win anything for recognizing the tune? )
Re: Gameboy Advance SID player
It would probably work. The question is if it would gain me anything. Unless PocketNES' 6502 emulator does dynamic recompilation (and does it well) I don't really see how it could be much faster than what I've already got.Would the 6502-minus-decimal-mode emulator from PocketNES work as well?
Another aspect of it is that, if my measurements are to be trusted, the 6510 emulation only takes up about 6% of the GBA's CPU time. The 6581 (SID) emulation is what consumes the bulk of the time.
Revenant: you win a virtual tip of the hat.
-
- Posts: 3140
- Joined: Wed May 19, 2010 6:12 pm
Re: Gameboy Advance SID player
Does this use antialiasing?
Re: Gameboy Advance SID player
Nope, samples are generated at 19973 Hz without any filtering. Though, AFAIK the GBA itself resamples the audio to 32768 Hz before outputting it, and I don't know the details of how it does the resampling.
Re: Gameboy Advance SID player
Alright, I've got an actual ROM release of my SID player now: download
And here's a video of it running on my Gameboy Player + Gamecube.
I've been working on optimizing the 6581 emulation, and tried upping the sample rate 21845 Hz, but I started getting buffer underflows in some songs so I decided to keep the old sample rate (the average processing time is fairly low, it's the worst-case times that are causing the problems).
And here's a video of it running on my Gameboy Player + Gamecube.
I've been working on optimizing the 6581 emulation, and tried upping the sample rate 21845 Hz, but I started getting buffer underflows in some songs so I decided to keep the old sample rate (the average processing time is fairly low, it's the worst-case times that are causing the problems).
Re: Gameboy Advance SID player
Surely there's some range between 768cy and 840cy per sample?
Re: Gameboy Advance SID player
Yeah. After looking at it some more I don't think it's a performance issue though. I did some measurements on the lastest code by reading the VCOUNT register, and the worst-case numbers I got was a total of ~51% of the GBA's CPU time spent on emulating the 6510 and 6581.
I tried increasing the sample rate all the way up to 32768 Hz, and it runs just fine
I tried increasing the sample rate all the way up to 32768 Hz, and it runs just fine
Re: Gameboy Advance SID player
The source code is now available on github. I noticed that the Nag Champa tune crashes after a while (oops), so I guess I still have a bug somewhere that I'm going to have to look into.
Re: Gameboy Advance SID player
Here's a new ROM where I've fixed the bugs I mentioned in my previous post, and which generates samples at 32768 Hz.