Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - gym2vgm becomes gymsslcym2vgm

Reply to topic
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13239
  • Location: London
Reply with quote
gym2vgm becomes gymsslcym2vgm
Post Posted: Sat Apr 06, 2002 7:48 pm
I minimally changed Dave's gym2vgm code to do this. I didn't bring it to this computer yet (and using MAME's YM2151 isn't working yet) but it seems OK, in line with the Callus readme specs. So anyone else needn't bother too much I suppose.

Maxim
  View user's profile Send private message Visit poster's website
Consolemu
  • Guest
Reply with quote
Finally :o)
Post Posted: Sat Apr 06, 2002 7:53 pm
Good to hear that someone's taken the time to add SSL support to something. I would've done it myself but I'm ignorant of things. Nah, more like I been lazy as usual.

Thanks Maxim,

Chris :o)
 
  • Joined: 06 Mar 2002
  • Posts: 49
Reply with quote
Post Posted: Sun Apr 07, 2002 3:34 pm
Quote
> I minimally changed Dave's gym2vgm code to do this. I didn't bring it to this computer yet (and using MAME's YM2151 isn't working yet) but it seems OK, in line with the Callus readme specs. So anyone else needn't bother too much I suppose.

Did the MAME core for YM2612 work OK, or did you chuck my mods in the bin and do it yourself? I couldn't get the YM2151 to work either. I think it got damaged while being pulled from MAME. The code's all there, so you should be able to fix it.

Thanks for rendering my CYM2VGM obsolete before it was released! I'm really upset about those ten wasted minutes that I could have spent... erm... doing nothing! Now to find another obscure logging format to convert...
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13239
  • Location: London
Reply with quote
Post Posted: Mon Apr 08, 2002 7:19 am
Quote
> Did the MAME core for YM2612 work OK, or did you chuck my mods in the bin and do it yourself?

I took your mods and tweaked them a bit.

Quote
> I couldn't get the YM2151 to work either. I think it got damaged while being pulled from MAME. The code's all there, so you should be able to fix it.

Yes, enabling YM2151 gives a scary heap of compile errors. It's on the list...

Quote
> Thanks for rendering my CYM2VGM obsolete before it was released! I'm really upset about those ten wasted minutes that I could have spent... erm... doing nothing! Now to find another obscure logging format to convert...

I'd love to see something that would (approximately) convert from a different format, for example NES to SMS, although it seems there isn't a logging NES format.

Maxim
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13239
  • Location: London
Reply with quote
Binary and source
Post Posted: Mon Apr 08, 2002 7:21 am
http://www.smspower.org/maxim/forumstuff/gym&ssl&cym2vgm.zip

If anyone's tinkering. The 2612 plugin will heppen soonish, 2151 might take a bit longer due to some problems.

Maxim
  View user's profile Send private message Visit poster's website
  • Joined: 06 Mar 2002
  • Posts: 49
Reply with quote
Re: YM2151 problems
Post Posted: Fri Apr 12, 2002 12:00 pm
Quote
> 2151 might take a bit longer due to some problems.

I've been tinkering with this a bit. Searching through MAME's source (version 0.58), I found no reference to many of the missing functions that were stopping the YM2151 emulation compiling. I think that the MAME team discontinued the 2151 emulator in FM.C ages ago, so it no longer works. I did fing a separate YM2151 emulator (YM2151.C), and I've got it to compile, but all I get is silence (and the occasional buzzing noise).

Maybe it's just that I don't understand the CYM format properly (it took me ages to get GYM logs working properly). How it the data for the YM2151 stored in a VGM, and how is that data written to the chip. I've tried YM2151WriteReg(0, b1, b2), but that doesn;t work. Is it like the YM2612?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13239
  • Location: London
Reply with quote
Re: YM2151 problems
Post Posted: Fri Apr 12, 2002 12:28 pm
Quote
> I've been tinkering with this a bit. Searching through MAME's source (version 0.58), I found no reference to many of the missing functions that were stopping the YM2151 emulation compiling. I think that the MAME team discontinued the 2151 emulator in FM.C ages ago, so it no longer works. I did fing a separate YM2151 emulator (YM2151.C), and I've got it to compile, but all I get is silence (and the occasional buzzing noise).

The MAME FM emulation has changed a lot between 0.36(ish) which most of the "lifted" cores are from, and today. I suspect it's got a lot better, it's just also got a lot more complicated and intertwined with a million other files.

Quote
> Maybe it's just that I don't understand the CYM format properly (it took me ages to get GYM logs working properly).

CYM:

Read a byte.
If it's zero then wait 1/60s.
If it's non-zero, it's a port number and the next buyte is the data.

Converting to VGM:
Read a byte.
If it's zero then write 0x62.
If it's non-zero, write 0x54, then the value, then the next byte's value.

I'm 99% sure my convertor is correct.

Quote
> How it the data for the YM2151 stored in a VGM, and how is that data written to the chip. I've tried YM2151WriteReg(0, b1, b2), but that doesn;t work. Is it like the YM2612?

The mame_fm.* files you (and I) used do have the YM2151 in, it's just given a different name (OPM). As I understand it, the YM2151 interface is very dimilar to the YM2612, in that you have to do
YM2151Write(0,0,b1);
YM2151Write(0,1,b2);
If you look at the source you can see it looks as bit 0 to see if it's an address or data byte. It seems a strange way to do it :/

I'm pretty sure that, if I could get the YM2151 code to compile after defining it in, it'd be OK.

Maxim
  View user's profile Send private message Visit poster's website
  • Joined: 06 Mar 2002
  • Posts: 49
Reply with quote
Re: YM2151 problems
Post Posted: Fri Apr 12, 2002 12:47 pm
YM2151 emulation in the MAME FM core from the version I got it from (about 0.5x) IS broken.

The alternate core (in YM2151.C) works PERFECTLY. We do use YM2151WriteReg(0, b1, b2) to write to the chip (which I guessed from looking at the source).

The silence was caused by one interface problem and a bug in your converter. Your CYM2VGM converter appears to be broken in two places (or at least the version I downloaded is).

1. The FM clock appears to be 3579545 instead of 7xxxxxx.

2. In ConvertFile() you have something like:

int Code=0;
Code=getc(InGym); // 0=1/60 sec, >0=FM write
if (Code==0)
{
putc(0x62,OutVgm);
SamTotal+=735;
continue;
}

// Copy FM writes across
{
int a=0,d=0;
a=Code; d=getc(InGym);
putc(0x54,OutVgm); putc(a,OutVgm); putc(d,OutVgm);
}

That chunk of code should read more like:

int Code = getc(InGym);
if(!Code)
{
putc(0x62, OutVgm);
SamTotal+=735;
}
else
{
int d = getc(InGym);
putc(0x54,OutVgm); putc(a,OutVgm); putc(d,OutVgm);
}

You were reading the register number twice, and the VGM was corrupted. Stupid typo, really. Anyway, I'll post the source on my website soon (unless you want me to mail it or something).
  View user's profile Send private message
  • Joined: 06 Mar 2002
  • Posts: 49
Reply with quote
Re: YM2151 in_vgm
Post Posted: Fri Apr 12, 2002 1:07 pm
It's up. Same page as before. See what you think. mame_ym2612.c is a stripped-down version of mame_fm.c but mame_fm.c should still work perfectly (and allow us to add even more FM chips later).

  View user's profile Send private message
  • Joined: 06 Mar 2002
  • Posts: 49
Reply with quote
Re: YM2151 in_vgm
Post Posted: Sat Apr 13, 2002 7:02 am
Quote
> mame_ym2612.c is a stripped-down version of mame_fm.c

And is incompatible with mame_ym2151.c because they BOTH use functions with the same name but different parabater types, and they are all inlined, and MSVC screwed up big time. I've fixed it and re-uploaded it
  View user's profile Send private message
  • Joined: 19 May 2010
  • Posts: 17
  • Location: Finland
Reply with quote
cym2vgm / gym2vgm
Post Posted: Thu Apr 23, 2020 9:34 pm
Hi,

Is there cym2vgm C code still available somewhere ? I would need command line version for Mac, to convert cym to vgm or WAV, and also gym, if possible.

Thanks ! :)

-Jukka
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!