Project : convert yamaha YMxxx FM to saturn scsp FM

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,272
Points
83
Age
43
I posted assembly source for the demo that used it here: http://www.hyakushiki.net/thedung.zip

But at the time (2013) it didn't work in any emulator, only by transferring it to the Saturn with Saturn USB. Is there an emulator that handles FM sound now? If so then I could try to make a simpler program to demonstrate FM sound.
Congrats for this demo, i'll try to recompile it and test it :) nobody here knew you did such work including a FM driver !
 

DamageX

New Member
Joined
Dec 8, 2005
Messages
22
Points
3
I just found out that KbMedia player with AOSSF plugin can handle SCSP FM synth. I thought it didn't because last time I tried to make an .SSF it didn't work right for some reason. Go figure.

So I put together a quick and dirty YM-2203 player using my compiler. It's woefully incomplete but it sounds like FM when played in KbM or using Saturn USB.


edit: re-uploaded the archive because a couple files were missing (oops)
 
Last edited:
  • Wow
Reactions: vbt

DamageX

New Member
Joined
Dec 8, 2005
Messages
22
Points
3
Here is a preliminary release of the (dual) YM-2203 player for Saturn, if anyone wants to try it.

This is a demonstration program. Press A to start playing a VGM, B to stop, C to play the other VGM. Up/down/left/right shows different register dumps on the screen (OPN or SCSP). The 1943 arcade track uses two OPNs, but doesn't use the SSG portion so I don't know if both of those are working. The noise generator is not emulated in any case.

This is the bare 68K driver. The sequence for starting a VGM is like this:
1) load driver at $5A00000
2) wait until the word at $25A0010C is 0 (this is the status word, 1 means busy)
3) read the dword at $25A00100 to find out the end address of the driver. Be sure to add $5A00000 to obtain the SH2 address.
4) write a VGM file to a free area in sound RAM (after the address calculated in step 3)
5) write the address (dword) of the VGM file to $5A00104 (subtract $5A00000 or mask off the upper bits first so it becomes a 68000 address)
6) write a word=1 to $5A00108

to stop: wait for the status word, then write a word=2 to $5A00108

Hopefully I got the instructions correct :) The source code is also here, of course it is written in NOWUT
 

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,272
Points
83
Age
43
1583682490725.png

1943 is on the way, next step is using your VGM driver

EDIT : driver loaded :

1583699536552.png
 
Last edited:

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,272
Points
83
Age
43
I did that :
Code:
//-------------------------------------------------------------------------------------------------------------------------------------
void DrvInitDamageXsound()
{
// init controller port
    *(UINT8 *)(0x2010007F)=0;
    *(UINT8 *)(0x2010007D)=3;
    *(UINT8 *)(0x20100079)=96;
    *(UINT8 *)(0x2010007B)=96;

// turn off the 68000
    *(UINT8 *)(0x2010001F)=7;
    for(int w=0;w<500;w++)
    {
        asm("nop\n"); // waste time
    }
    *(UINT16 *)(0x5B00400)=0x20F;

    for(int w=0;w<500;w++)
    {
        asm("nop\n"); // waste time
    }

    *(UINT16 *)(0x5B00402)=0x3F;

    for(int w=0;w<500;w++)
    {
        asm("nop\n"); // waste time
    }

    GFS_Load(GFS_NameToId("VGM68.BIN"),0,(void *)0x5A00000,4640);

// turn on the 68000
    *(UINT8 *)(0x2010001F)=6;

    while(*(UINT16 *)(0x25A0010C)!=0)
    {
        for(int w=0;w<500;w++)
        {
            asm("nop\n"); // waste time
        }
    }

    UINT32 end = *(UINT32 *)(0x25A00100);

    GFS_Load(GFS_NameToId("02.VGM"),0,(void *)(0x5A00000+end),14952);

//   memcpy((UINT16 *)(0x25A00104),(UINT16 *)(0x25A00100),sizeof(UINT16));//
*(UINT32 *)(0x25A00104)=end;
    *(UINT16 *)(0x25A00108)=1;
and it works !!! but it doesn't play all
super good job @DamageX !
 
Last edited:

vbt

Staff member
Joined
Dec 16, 2001
Messages
5,272
Points
83
Age
43
The other VGM files were the same indeed. I couldn't reproduce any problems. Are you loading them all at 4-byte aligned boundaries?

How about this build?
This one is working well, now i think, in some cases it stops because i don't have the sfx, i continue on 1943, we must beat capcom generations

Should i do a version of Rockin'-b Sound player with your Driver ?

with vgm,mdx support

1584747745380.png
 
Last edited:
Top