Page 1 of 2

Gamecube chiptune player

Posted: Sun Mar 30, 2014 12:22 pm
by mic_
I'm not sure if the Gamecube really qualifies as "retro" - but hey, it was released the same year as the Gameboy Advance.

In any case, I recently got an SD Media Launcher so that I can run my own code on the Gamecube, so I decided to write something. And what better to write than a chiptune player? :P

Here's the result:

Image

Download the DOL file if you want to run it on your own Gamecube (it also works quite well in Dolphin).
Or watch a YouTube video captured from my PAL Gamecube.

All the emulation code (6510, SID, YM2149) is my own. Audio is generated at 44.1 kHz mono and output using libasnd.

The UI is done in just about the least efficient way possible: I keep an offscreen 24-bit RGB buffer in RAM that I draw into. I then convert this buffer to the native framebuffer format (YUV 4:2:2) for every frame. It works well enough for what I needed, though.

Re: Gamecube chiptune player

Posted: Mon Mar 31, 2014 9:52 am
by MottZilla
Pretty cool. Are you planning to write more GameCube homebrew? I'd say it's getting to be retro or considered so.

I've thought about writing GameCube homebrew before, but I never looked into what tools and what if any libraries were available. I'm guessing SDL might have been ported? Though I prefer Allegro.

Re: Gamecube chiptune player

Posted: Mon Mar 31, 2014 11:12 am
by mic_
There's something called cubeSDL, but I haven't checked it out myself. I don't know if Allegro is available. The only thing I can find when I do a web search is a bunch of polish-language pages :P

devkitPro includes a bunch of examples for various areas (graphics, audio, accessing SD cards, etc), so I just took one of the example projects and started adding my own stuff to it. Then it was as simple as running "make" and opening the resulting DOL in Dolphin.
I'm not sure what kind of debugging support there is, though. Dolphin appears to be geared more towards gaming. The Gamecube does at least seem to have some kind of memory protection enabled, because I managed to trigger some sort of exception handler early on during development that threw up a register dump on screen out of pure digust with what my program was doing.

Re: Gamecube chiptune player

Posted: Tue Apr 01, 2014 9:27 pm
by MottZilla
If I ever get around to it, I should look at this devkitPro with the examples. The GameCube seems like a reasonably capable system for alot of types of games. I suppose you could run a whole game off the SD card, loading whatever you needed into RAM as needed.

Re: Gamecube chiptune player

Posted: Tue Apr 01, 2014 9:39 pm
by tepples
And that really wouldn't be too different from how real games for FDS, GameCube, DS, and Wii work.

Re: Gamecube chiptune player

Posted: Thu Apr 03, 2014 11:36 pm
by B00daW
Possible to make a Wii port of this? Would be very useful.

Re: Gamecube chiptune player

Posted: Fri Apr 04, 2014 12:54 am
by lidnariq
I've definitely booted gamecube .dol files directly on the wii using wiixplorer. I think I've done it using the homebrew channel netboot, too, but it's been long enough that I'm not certain.

Downside, I guess, is that you have to use the gamecube controller to control it.

Re: Gamecube chiptune player

Posted: Fri Apr 04, 2014 2:07 am
by mic_
Possible to make a Wii port of this? Would be very useful.
That's sort of the idea (that's where the 'W' in the name comes from). I might not add wiimote support though (i.e. you'd need a Gamecube controller). The only thing I'm unsure of right now is whether it's possible to write straight into the framebuffer on the Wii, or if I'll need to change how I display the GUI.

Re: Gamecube chiptune player

Posted: Fri Apr 04, 2014 9:28 pm
by B00daW
A lot of the Wii's these days don't have GameCube ports anymore and unless you do a lot of searching it's not easy to find one that does have them.

Re: Gamecube chiptune player

Posted: Fri Apr 04, 2014 9:42 pm
by tepples
Nintendo introduced the "Wii Family Edition", the first Wii revision outside Korea not to include GameCube support, in the fourth quarter of 2011. This means the first five years of used Wii consoles have GameCube support. The second Wii without GameCube support is the Wii mini, but that doesn't have an SD slot anyway so there's no way I can think of to run homebrew on it.

Re: Gamecube chiptune player

Posted: Sat Apr 05, 2014 3:26 pm
by mikejmoffitt
B00daW wrote:A lot of the Wii's these days don't have GameCube ports anymore and unless you do a lot of searching it's not easy to find one that does have them.
Perhaps where you live, but I can easily get a used Wii around here for $30 or so with gamecube ports. I still haven't seen in person one without them yet.

Re: Gamecube chiptune player

Posted: Sun Apr 06, 2014 11:13 am
by mic_
I've updated the player with support for NSF (2A03 only) and VGM (SN76489 only) files. The number of panels in the GUI is static, so I only visualize the volume for the first 3 channels. However, the visual keyboard also shows the DMC channel, as well as the SN76489 noise channel when it's configured to output a square wave.

I've made a couple of additions to the controls as well: up/down on the analog stick can be used to scroll faster through the song list, and Z can be used to switch to solo mode (press repeatedly to select which channel to output).

Download the DOL here.
Watch a capture on youtube here.

Re: Gamecube chiptune player

Posted: Sat Apr 12, 2014 6:26 am
by mic_
Support for GBS files has been added. It's still a bit buggy (in particular, I believe there's a problem with the envelope generators), and it currently doesn't emulate the sweep unit.

Download the DOL here.
Watch a capture on youtube here.

Re: Gamecube chiptune player

Posted: Tue Apr 15, 2014 10:51 am
by mic_
The player now supports VRC6 and Sunsoft-5B audio (though not both at the same time). The S5B emulation is still a bit buggy, and my mixing of the expansion audio channels is probably not all that accurate.

Download the DOL here.
Watch a capture on youtube here.

Re: Gamecube chiptune player

Posted: Tue Apr 15, 2014 3:18 pm
by mikejmoffitt
mic_ wrote:The player now supports VRC6 and Sunsoft-5B audio (though not both at the same time). The S5B emulation is still a bit buggy, and my mixing of the expansion audio channels is probably not all that accurate.

Download the DOL here.
Watch a capture on youtube here.
If it would help, I can make some reference recordings of Akumajou Dracula and Gimmick! for native VRC6 and 5B sound. So far every emulator I've tried has poorly done the mixing and a lot of things do not sound right.