YM player for the 32X

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Post Reply
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

YM player for the 32X

Post by mic_ » Sun Apr 21, 2013 6:39 pm

I recently wrote an YM player for the Neo Geo pocket Color (which turned out pretty ok), and that made me think "Hey, that should be pretty easy to do on the 32X since it's a gazillion times faster".

So I took one of ChillyWilly's mod player demos, threw out everything that was mod/xm-specific, and quickly wrote a rudimentary YM/AY emulator in pure C. Et voilà: youtube video (the audio in this clip is a bit loud, so turn the volume down a bit if you're using headphones).

The ROM is here in case you want to try it out yourself. I had no luck with any of the emulators I tried, but it works fine on a real 32X.

Chilly Willy
Very interested
Posts: 2767
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Apr 21, 2013 10:38 pm

Very nice! Yes the SH2 is way more than needed for perfect YM emulation - you could probably run it at 44kHz without a hitch. More work would be a PC FM chip emulation... probably doable in good assembly, but a lot of work.

The rom works fine in Gens/GS r7 with my PWM patches. If you run linux, I highly suggest having this.

Gens/GS r7 with CW's PWM changes:
http://www.mediafire.com/download.php?wwkcni66o61mot6

That's source and 32-bit x86 binary. For 64-bit, you can recompile it or run the 32-bit binary with 32-bit compatibility libraries.

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Apr 22, 2013 8:19 am

I use Windows XP at home. An old version of Kega Fusion (3.50-ish) did at least output some sound, although heavily distorted. Fusion 3.64 gave me no sound at all, and neither did Gens KMod. It's not that much work to test on HW, just a bit tedious to take the cart out of the system to put a new ROM on it, and then back again :P

I'm hoping that I can improve on the YM emulation quality at some point. There are inaccuracies in how I emulate the envelope generator, and the mixing is probably a bit off as well.
It would also be cool to add support for Future Composer songs (completely different format, but the sound is similar in style).

Chilly Willy
Very interested
Posts: 2767
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Apr 22, 2013 5:13 pm

I have Kega 3.63x installed - it doesn't quite handle the PWM correctly. Supposedly, 3.64 handles PWM correctly, but I also have never been able to get it to make any sound. The audio is always disabled when I run it, no matter what I do. :cry:

I'm not sure if Gens/GS can be compiled in cygwin or mingw, but the readme says you can build it with mingw+msys.

Mamizou
Interested
Posts: 25
Joined: Thu Apr 19, 2012 4:50 pm
Contact:

Post by Mamizou » Tue Apr 23, 2013 7:54 am

Chilly Willy wrote:For 64-bit, you can recompile it or run the 32-bit binary with 32-bit compatibility libraries.
When I do './configure' it dies with 'configure: error: 64-bit is currently not supported.' I guess you have actual 64-bit compiling disabled because of the 32-bit asm?

Anyway, the demo works in the patched Gens, although a little fuzzy. Start makes it 'pause' and 'resume', but doesn't actually pause or resume the song.

Chilly Willy
Very interested
Posts: 2767
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Apr 23, 2013 5:33 pm

Momiji wrote:
Chilly Willy wrote:For 64-bit, you can recompile it or run the 32-bit binary with 32-bit compatibility libraries.
When I do './configure' it dies with 'configure: error: 64-bit is currently not supported.' I guess you have actual 64-bit compiling disabled because of the 32-bit asm?

Anyway, the demo works in the patched Gens, although a little fuzzy. Start makes it 'pause' and 'resume', but doesn't actually pause or resume the song.
Not me, I just did the PWM patches. But that does ring a bell. They're working on an all new version of Gens/GS which will add 64-bit native support. In the meantime, you need to run the 32-bit binary using the compatibility libraries.

All that said, real hardware will sound better than the emulator. The emulator just handles PWM well enough that you don't immediately quit and complain about how bad it sounds. :)

It's not bad, but it's not as good as it could be. I'm leaving that for the update to Gens/GS they're working on.

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Tue Apr 23, 2013 6:37 pm

Anyway, the demo works in the patched Gens, although a little fuzzy. Start makes it 'pause' and 'resume', but doesn't actually pause or resume the song.
Since releasing that first version I've implemented a crude bandpass filter which helps reduce some unwanted noise. I could probably also up the sample rate a bit.

As far as the controls go, I didn't even think of the possibility that someone would try pushing the buttons :P They're not supposed to do anything, but I might have forgot some code in there that does random things when you press a button.

Chilly Willy
Very interested
Posts: 2767
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Apr 23, 2013 8:09 pm

mic_ wrote:As far as the controls go, I didn't even think of the possibility that someone would try pushing the buttons :P They're not supposed to do anything, but I might have forgot some code in there that does random things when you press a button.
:lol:

Ain't that just like a user... pressing buttons and whatnot!

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Sun Nov 10, 2013 3:51 pm

I've released an updated version of my YM player, which now includes multiple songs and a TOS/GEM-inspired UI:

Image

Latest ROM
YouTube video

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Sun Nov 24, 2013 9:56 am

I released an updated version earlier this week. There's improved emulation, an updated UI, and more songs:

Image

ROM + source code
YouTube video

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Sun Nov 24, 2013 5:29 pm

Don't make me buy a 32X dude :P

Isn't there something you want to do for MD or SCD ? :wink:
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Nov 25, 2013 8:41 am

Isn't there something you want to do for MD or SCD ?
I don't have a MegaCD, so that takes care of that :P

As for the MD; maybe, but not right now.

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Sun Dec 15, 2013 7:33 pm

which I had a 32X :)
It might be interesting to only emulate the AY3 8910 or YM2149 hardware envelope on the MD to mess with the PSG volume register the same you can do with buzzers on the AY or YM2149...
To bad we cannot use the YM2612 SSG to output into the PSG directly because it is exactly that envelope!

Post Reply