MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

BPzeBanshee
MAME Fan
Reged: 07/22/12
Posts: 19
Send PM


Setting sound chip volume off within the driver?
#332166 - 09/22/14 04:28 PM


Got my sample hack for Seibu SPI running again from scratch after leaving it for some time, and have run into one last annoying hurdle - when writing to flash on first run (the infamous 999 countdown timer) *something* is triggering a small jingle to play. Any interruptions to what's being passed through the fifo/z80 system leads to errors. I attempted using what I knew the game passed as stop commands for music but that didn't work.

Is there a way to call a device directly to switch off volume in MAME like perhaps a machine().device("ymf271").mute()? I'm thinking there must be a simpler way to intercept or otherwise render the annoying poorly-emulated jingle unaudible, but I'm having trouble finding any kind of example for it. Someone suggested some esq device in MESS ages ago but I couldn't make any sense of it at the time.



Robbbert
Sir
Reged: 08/21/04
Posts: 3203
Loc: A long way from you
Send PM


Re: Setting sound chip volume off within the driver? new [Re: BPzeBanshee]
#332244 - 09/24/14 07:11 AM



> Is there a way to call a device directly to switch off volume in MAME like perhaps a
> machine().device("ymf271").mute()? I'm thinking there must be a simpler way to
> intercept or otherwise render the annoying poorly-emulated jingle unaudible, but I'm
> having trouble finding any kind of example for it. Someone suggested some esq device
> in MESS ages ago but I couldn't make any sense of it at the time.

set_output_gain(0, vol);

example: in hankin.c, m_dac->set_output_gain(0, vol);



BPzeBanshee
MAME Fan
Reged: 07/22/12
Posts: 19
Send PM


Re: Setting sound chip volume off within the driver? new [Re: Robbbert]
#332249 - 09/24/14 10:58 AM


Thanks Robbbert! That helped put me in the right direction and was able to find a solution without butchering any more code.

Unlike the DAC in hankin.c the ymf271 wasn't set up to be directly handled, so there wasn't a "m_ymf" to deal with and attempting to add it in made everything go haywire. Instead I had to add a bit of machine().device line to it similar to some drivers I found that used such lines for setting base addresses and other stuff I , the end result being (with lessthan/morethan signs around ymf271_device):

machine().device(ymf271_device)("ymf")->set_output_gain(0,0);
machine().device(ymf271_device)("ymf")->set_output_gain(1,0);

Seems a little complicated but it does function correctly and will only ever be used under that circumstance.

Edited by BPzeBanshee (09/24/14 11:00 AM)


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 92 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2887