S98 conversion to VGM & YM2149
Technical discussion about the VGM format, and all the software you need to handle VGM files.
Moderator: Staff
S98 conversion to VGM & YM2149
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.
Re: S98 conversion to VGM & YM2149
YM2149 is exactly like the SSG part of YM2203, if that helps.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.
- Sonic of 8! Offline
- Posts: 419
- Joined: 2011-12-13, 17:31:14
- ValleyBell Offline
- Posts: 4791
- Joined: 2011-12-01, 20:20:07
- Location: Germany
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:
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;
WTF couldn't they just use a switch structure? o_O
Sik is pronounced like "seek", not like "sick".
http://www.mdscene.net/
http://www.mdscene.net/
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.
- ValleyBell Offline
- Posts: 4791
- Joined: 2011-12-01, 20:20:07
- Location: Germany
Also known as nineko.
- ValleyBell Offline
- Posts: 4791
- Joined: 2011-12-01, 20:20:07
- Location: Germany
Just found it:
So a switch structure is out of question, because it works only with numeric constants.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);
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
Oh, and it doesn't write tags for now but write loop points^^
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. :/tails_ wrote:
And so, I finished first version of S98 -> VGM converter. It's slow and written in pascal :U
good to hear that you have s98->vgm conversion happening on your own in the meantime!
- dissident93 Offline
- Posts: 204
- Joined: 2012-02-17, 5:54:01
- Location: USA