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 - Logging FM and PSG

Reply to topic
Author Message
Dave
  • Guest
Reply with quote
Logging FM and PSG
Post Posted: Sun Aug 05, 2001 2:39 pm
Is there currently a format similar to GYM which logs YM2413 signals and PSG signals so they can be played in WinAMP?
I have found the KSS file format, which looks like a partial sound rip. Are there any others?
 
  • Joined: 28 Sep 1999
  • Posts: 1141
Reply with quote
Post Posted: Sun Aug 05, 2001 6:17 pm
Quote
> Is there currently a format similar to GYM which logs YM2413 signals and PSG signals so they can be played in WinAMP?
> I have found the KSS file format, which looks like a partial sound rip. Are there any others?

Yes I made a up a format based on GYM called SSL, which supports the GYM commands and then additionally the Game Gear stereo control and the SMS YM2413 chip.
Here's the documentation from the SMS Plus readme:

"Sound Logging
-------------

You can log sound output to a file with the extension SSL.
Currently there is a limit of 100 music logs generated per game.

The format of this file is fully compatible with GYM files generated by
emulators such as genecyst and Megasis.

Players and tools that work with GYM files should work with SSL files,
providing they ignore invalid bytes in the music stream - note this
is only for PSG sound, and additional features such as PSG stereo control
and YM2413 FM sound are not supported in a GYM utility.

Format of an SSL file: (taken from genecyst's readme)

while (!EOF)
switch (readbyte()) // readbyte() reads the next byte from the file
{
case 0: 1/60th of a second has elapsed;
case 1: ymport=0; ymreg=readbyte(); ymdata=readbyte();
case 2: ymport=1; ymreg=readbyte(); ymdata=readbyte();
case 3: write readbyte() to psg port
case 4: psg_stereo=readbyte();
case 5: ym2413_reg_latch=readbyte();
case 6: ym2413_data_port=readbyte();
}

The format of the PSG stereo byte in case 4 is:

bit 0 : Left speaker noise enable
bit 1 : Left speaker tone #3 enable
bit 2 : Left speaker tone #2 enable
bit 3 : Left speaker tone #1 enable
bit 4 : Right speaker noise enable
bit 5 : Right speaker tone #3 enable
bit 6 : Right speaker tone #2 enable
bit 7 : Right speaker tone #1 enable"


It's not really GYM compatible, as I later realized. But the concept is the same as GYM, and it works quite well.
Commands 1 and 2 are still in there for YM2612 support, at the time I devised this format, I had heard that Phantasy Star MD on the Genesis used YM2612 sound, which it doesn't. But that did give me a reason to support it.

There aren't any players yet - I haven't finished the DOS standalone one, though I did release an SSL music player that runs on the Genesis, for use in demos/games.

And you're right about KSS, it's the music data+player ripped from a game.


  View user's profile Send private message Visit poster's website
Consolemu
  • Guest
Reply with quote
Yay!!!!!!!!!!!
Post Posted: Mon Aug 06, 2001 5:00 pm
Finally some attention is being payed to SSL besides myself. Mabye some really great things are going to happen since I haven't been able to do great things (too busy).

Chris :o)
 
Dave
  • Guest
Reply with quote
Re: Yay!!!!!!!!!!!
Post Posted: Mon Aug 06, 2001 9:00 pm
Quote
> Finally some attention is being payed to SSL besides myself. Mabye some really great things are going to happen since I haven't been able to do great things (too busy).

... actually I'd prefer to do some cycle accurate logging (e.g. for voices), which SSL doesn't do, sorry 'bout that :(
maybe you could join me in supporting a cycle-accurate format?

should be pretty similar to GYM and SSL. i'll post some info later: screenshots for opi first
 
Consolemu
  • Guest
Reply with quote
Re: Yay!!!!!!!!!!!
Post Posted: Mon Aug 06, 2001 10:30 pm
That's cool...but would voices really be needed? Besides, only a handful of older Master System games use voices in them (Shinobi, Space Harrier, Afterburner, Alex Kidd 2) and those games use only 1 to 3 samples in them. But, I'm not for pushing back progression. That would be a cool thing to add. I just want to see a working and flexible music format someday. Very soon I hope. And the way SSL is now, it's fairly flexible, easy enough to log/create/read, and it's filesizes are adequate. I was hoping that there could be a SSL collection as well; similar to the way Zophar.net has it's musical collections. Who knows, mabye if we had a great player and lots of contributions Zophar would create a dedicated upload/download/contribution page for it. I personally managed to create a SSL player (PSG only), but it was coded in Visual Basic....so it's very, very slow. It uses DirectX and it's still slow. I had plans to convert some of the routines in C/Asm in DLL to try to speed things up but never sat down and organized/did everything. But, enough of my babbling...If you feel voices are important then talk with Charles and add it into the format. It's only going to make things better.

Chris :o)

btw, Dega is really comming up fast. For you to move from Final Burn (CPS2) to the Master System shows that you are a master system fan. heh
 
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 7748
  • Location: Paris, France
Reply with quote
Re: Yay!!!!!!!!!!!
Post Posted: Tue Aug 07, 2001 10:29 pm
Quote
>> Finally some attention is being payed to SSL besides myself. Mabye some really great things are going to happen since I haven't been able to do great things (too busy).
> ... actually I'd prefer to do some cycle accurate logging (e.g. for voices), which SSL doesn't do, sorry 'bout that :(
> maybe you could join me in supporting a cycle-accurate format?

I'm in.
Simply adding a new code followed by number of cycle ?
  View user's profile Send private message Visit poster's website
Dave
  • Guest
Reply with quote
prelim info... test streams soon i hope
Post Posted: Wed Aug 08, 2001 7:15 pm
Quote
> >> Finally some attention is being payed to SSL besides myself. Mabye some really great things are going to happen since I haven't been able to do great things (too busy).
> > ... actually I'd prefer to do some cycle accurate logging (e.g. for voices), which SSL doesn't do, sorry 'bout that :(
> > maybe you could join me in supporting a cycle-accurate format?

> I'm in.
> Simply adding a new code followed by number of cycle ?

No, also adding a 0x200 'ignored' area at the start because what I want to do is make a YM2413/YM2151/YM2612/PSG framework suitable for Genesis and SMS (maybe Stef would like to add it to Gens?), and also have a Z80 stub in the file to play the tune on a real SMS.

(Same thing if someone wanted to do one for the Genesis or Capcom hardware or something).
Because the 68000 has a 0x200 interrupt table at the start, and the z80 starts at address 0, we need to have some space for jumping to the start address.


Current wip (everything in in Big-endian order=68000 byte order, which is not Intel byte order)

0x000-0x1ff (ignored: will be start of z80/68000 program)
0x200 Version number 0x0100
0x202 Offset in file to sound Data start (0x220 at the moment since we have no z80 stub programs, BUT REMEMBER NOT TO ASSUME 0x220 in a player!)
0x206 Cycles per second (3579540 as far as we are concerned)
0x208-0x21f padding (must be 00, take care in z80/68000 programs)
0x220-?? (ignored: will be end of z80/68000 program)
(but since we have no programs yet)

0x220-end of file, PSG/YM write data:

0x41 nn nn nn nn (wait n cycles)
0x50 dd (PSG write value dd)
0x51 aa dd (YM2151, ignore)
0x52 aa dd (YM2413, write value dd to register aa)
0x53 aa dd (YM2612, ignore)
0x5? aa dd (reserved for other chips/future, ignore)

The reason I'm using 0x41, is then is comes out as nice ASCII characters in a HEX editor, so you can see at a glance what a file has.

Okay... just did a test, After Burner with FM for 20minutes. The file size is:
1166kb Hmmmm. 169k compressed.
Not brilliant, maybe I should make .dym.gz the default.
What is .GYM like?
 
Dave
  • Guest
Reply with quote
two important additions
Post Posted: Wed Aug 08, 2001 7:31 pm

0x3n nn nn 20-bit Short Wait (wait n cycles)
0x41 nn nn nn nn 32-bit Long wait (wait n cycles)

Because so many games update once per frame, which is slightly more than 0xffff but less than 0xfffff. Should compress things a bit.

0x66 (end of stream) Needed for z80 Dym players, because there is no end of file concept in a rom.

 
trzy
  • Guest
Reply with quote
The 68000's vector table is 0x400 bytes, not 0x200 *nt*
Post Posted: Wed Aug 08, 2001 7:41 pm
Quote
>
 
Reply to topic



Back to the top of this page

Back to SMS Power!