Skip to content

S98 conversion to VGM & YM2149

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

S98 conversion to VGM & YM2149

Post by neologix »

so tails_ asked me abt possible handling of s98-supported chips on irc; the only one that doesn't seem explicitly listed in vgmspec161 is ym2149, but otherwise everything else seems to be supported. it seems like s98-to-vgm conversion would be good to add to vgmtool, but i need confirmation of what to do w/ym2149 first, and if ym2149 is either already planned for the next vgm expansion or if it can be handled by one of the existing chips.
  • User avatar
  • Knurek Offline
  • Posts: 84
  • Joined: 2011-12-30, 1:01:56

Re: S98 conversion to VGM & YM2149

Post by Knurek »

neologix wrote:so tails_ asked me abt possible handling of s98-supported chips on irc; the only one that doesn't seem explicitly listed in vgmspec161 is ym2149, but otherwise everything else seems to be supported.
YM2149 is exactly like the SSG part of YM2203, if that helps.

Post by Sonic of 8! »

SSG is also in YM2608 and YM2610.
オモいカルチャーをオモチャーと言う - 細野晴臣
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

after some research, it seems one can use the ay-3-8910 capabilities in vgm to cover ym2149; i still don't know how, tho.

Post by Kaminari »

Isn't the YM2149 just a different form factor of the AY-3?
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Yes, it's an AY8910. The VGM header has a AY Type value which allows you and me to change the exact type.

To quote the MAME VGM source code:

Code: Select all

	if (device->type() == AY8910)
		chp_tp_vgm = 0x00;
	else if (device->type() == AY8912)
		chp_tp_vgm = 0x01;
	else if (device->type() == AY8913)
		chp_tp_vgm = 0x02;
	else if (device->type() == AY8930)
		chp_tp_vgm = 0x03;
	else if (device->type() == AY8914)
		chp_tp_vgm = 0x04;
	else if (device->type() == YM2149)
		chp_tp_vgm = 0x10;
	else if (device->type() == YM3439)
		chp_tp_vgm = 0x11;
	else if (device->type() == YMZ284)
		chp_tp_vgm = 0x12;
	else if (device->type() == YMZ294)
		chp_tp_vgm = 0x13;
	else if (device->type() == YM2203)
		chp_tp_vgm = 0x20;
	else if (device->type() == YM2608)
		chp_tp_vgm = 0x21;
	else if (device->type() == YM2610 ||
		device->type() == YM2610B)
		chp_tp_vgm = 0x22;
  • User avatar
  • Sik Offline
  • Not a musician
    Not a musician
  • Posts: 75
  • Joined: 2011-12-12, 12:43:15

Post by Sik »

WTF couldn't they just use a switch structure? o_O
Sik is pronounced like "seek", not like "sick".
http://www.mdscene.net/
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

Sik, the Mame team spends most of the time by making ROMs incompatible every other release, you can't expect them to write good code at the same time.
Also known as nineko.
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Actually, that code was written by me.
Yes, I could've used switch maybe, but I wrote that within a few minutes and didn't want to care about the exact data type of device->type().
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

:oops:
Also known as nineko.
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Just found it:
MAME\src\emu\device.h wrote:// a device_type is simply a pointer to its alloc function
typedef device_t *(*device_type)(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
So a switch structure is out of question, because it works only with numeric constants.
  • User avatar
  • tails_ Offline
  • Posts: 170
  • Joined: 2012-03-18, 16:59:23
  • Location: Tomsk, Russia
  • Contact:

Post by tails_ »

:bump:
And so, I finished first version of S98 -> VGM converter. It's slow and written in pascal :U
http://www.mediafire.com/?a9gahdyfash1paa

So far there are 3 issues because of VGM format and 2 (or more?) because of my dumbness.

VGM issues:
1. Chip panning won't work so, all exotic devices like AMD98 and Sound Orchestra will sound in mono (might be added in 1.70 version)
2. Chip volume won't work -- this is post critical for PC88/PC98 music because PSG becomes damn loud (this also might be added in 1.70 version)
3. Devices that use 3 chips of same type won't be converted correctly. This is primary problem for AMD98 device 'coz it use 3 YM2149 chips (will be fixed in some version of VGM?)

And my problems:
1. Any S98 that use 2 or more chips of the same type will be converted to something weird :U. This is because of the way I wrote code and this is the second thing I plan to fix.
2. Only YM2608 ADPCM sound is supported and there's no detection if song actually write stuff to ADPCM control register to load data to RAM, I just add data block setting ram size to 256K at the beginning of dump data.

Usage: S982 <infile>, or you can open program and throw file to command prompt and it will create VGM file with infile name (infile.s98.vgm).

Huge thanks to ValleyBell for suggestions and stuff :roll:

Oh, and it doesn't write tags for now but write loop points^^
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

tails_ wrote::bump:
And so, I finished first version of S98 -> VGM converter. It's slow and written in pascal :U
sorry i dropped the ball lately re vgmtool development; got a new job a couple of wks ago and it's really eaten into my free time. my web vgm player is waiting for me to get back to it as well. :/

good to hear that you have s98->vgm conversion happening on your own in the meantime!
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

I heard that S98 format lacks in quality as compared to whatever format HOOT uses. I'll have to check it out though. hmm.

Post by Kaminari »

S98 is useful as an intermediate format, since it's supported by quite a few Japanese emulators (a bit like DRO in DOSBox). Being able to convert S98 to VGM could be very convenient. Hoot is a great standalone "ROM" player, but it's not portable.
Post Reply