Previous 15994 Revisions Next

r14522 Sunday 19th February, 2012 at 13:24:09 UTC by Miodrag Milanović
Sync with MAME r15444 (no whatsnew)
[src/emu]audit.c clifront.c emu.h emualloc.c info.c
[src/emu/imagedev]chd_cd.c harddriv.c
[src/emu/sound]samples.c samples.h votrax.c votrax.h
[src/lib/util]chd.c coretmpl.h flac.c flac.h hashing.h
[src/mame]mame.c mame.lst
[src/mame/audio]8080bw.c astrof.c blockade.c carnival.c cclimber.c cinemat.c circus.c depthch.c gorf.c gottlieb.c gotya.c gridlee.c invinco.c meadows.c mw8080bw.c polyplay.c pulsar.c segag80r.c segag80v.c senjyo.c snk6502.c spacefb.c suna8.c targ.c turbo.c vicdual.c wow.c zaxxon.c
[src/mame/drivers]8080bw.c aristmk4.c astinvad.c astrocde.c astrof.c balsente.c bfm_sc2.c bfm_sc4.c blockade.c by17.c cclimber.c chinagat.c circus.c cosmic.c cps1.c dai3wksi.c ddragon.c deadang.c dynax.c equites.c esh.c firetrap.c galaga.c galaxian.c galaxold.c galdrvr.c gaplus.c goldnpkr.c goldstar.c gottlieb.c gotya.c gridlee.c itgamble.c jaguar.c jpmimpct.c m10.c m63.c magicard.c maygayep.c mcr.c meadows.c meritm.c mil4000.c moo.c mw18w.c namcos10.c namcos23.c naomi.c ninjakd2.c pacman.c pluto5.c polyplay.c rallyx.c safarir.c sderby.c segag80v.c senjyo.c snk6502.c starcrus.c stfight.c suna8.c superqix.c tankbatt.c thepit.c thief.c tmnt.c tnzs.c triplhnt.c vamphalf.c whitestar.c williams.c
[src/mame/includes]astrof.h circus.h cosmic.h gotya.h m10.h mw8080bw.h rallyx.h tmnt.h
[src/mame/machine]gaplus.c mw8080bw.c naomigd.c xevious.c
[src/mame/video]starcrus.c
[src/mess/drivers]votrtnt.c
[src/osd/windows]windows.mak winfile.c winfile.h winptty.c*

src/mame/mame.c
r14521r14522
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************/
11
1112#include "emu.h"
1213
1314#define APPNAME               "MAME"
src/mame/mame.lst
r14521r14522
45254525vf2         // 1995.09 Virtua Fighter 2.1
45264526skytargt      // 1995.10 Sky Target
45274527manxtt         // 1995.11 Manx T.T.
4528doaa         // 1996.11 Dead or Alive
4528doaa         // 1996.11 Dead or Alive (Model 2A)
45294529motoraid      // 1997.10 Motor Raid
45304530zeroguna      // 1997.12 Zero Gunner
45314531zerogunaj      // 1997.12 Zero Gunner (Japan)
r14521r14522
49934993kingrt66      // 2002.02 The King of Route 66 (Rev A)
49944994initd         // 2002.03 Initial D Arcade Stage (Japan) (Rev B)
49954995            // 2002.06 World Club Champion Football Serie A 2001-2002
4996            // 2002.07 Soul Surfer
4996soulsurf      // 2002.07 Soul Surfer
49974997vf4evoct      // 2002.08 Virtua Fighter 4 Evolution (cartridge)
49984998vf4evoa         // 2002.08 Virtua Fighter 4 Evolution
49994999            // 2002.11 World Club Champion Football Serie A 2001-2002 Ver.1.2
r14521r14522
50115011            // 2004.01 Initial D Arcade Stage Ver. 3 (export)
50125012initdv3j      // 2004.01 Initial D Arcade Stage Ver. 3 (Japan) (Rev C)
50135013initdv3jb      // 2004.01 Initial D Arcade Stage Ver. 3 (Japan) (Rev B)
5014initdv3e      // 2004.01 Initial D Arcade Stage Ver. 3 (Export)
50145015            // 2004.06 World Club Champion Football Serie A 2002-2003 Ver.2
50155016            // 2004.07 Virtua Fighter 4 Final Tuned
50165017vf4tuneda      // 2004.09 Virtua Fighter 4 Final Tuned (Rev A)
r14521r14522
1206312064sc2wwcl      // Wild West Club (Bellfruit)
1206412065sc2dick      // Spotted Dick (Global)
1206512066sc2pick      // Pick Of The Bunch (Global)
12066sc2rock      // How Bigs Your Rock (Global)
12067sc2rock      // How Big's Your Rock? (Global)
1206712068sc2call      // It's Your Call (Glonal)
1206812069sc2prom      // Along The Prom
1206912070sc2payr      // Pay Roll (Mazooma)
r14521r14522
1353213533sc4quartk   //
1353313534sc4quartl   //
1353413535sc4quartm   //
13535sc4qmodo   // Quazzi Mo Dough (Qps)
13536sc4qmodo   // Quazzi Mo' Dough (Qps)
1353613537sc4qmodoa   //
1353713538sc4qmodob   //
1353813539sc4qmodoc   //
r14521r14522
1716717168ep_xspot   // X Marks The Spot (Maygay)
1716817169ep_braid   // Bank Raid (Unk)
1716917170ep_bathl   // Bat Outa Hell (Global)
17170ep_beavr   // Beaver Las Vegas (Global)
17171ep_beavr   // Casino Beaver Las Vegas (Global)
1717117172ep_beavra   //
1717217173ep_bvrcl   // Beaver Las Vegas Club (Global)
1717317174ep_bvruc   // Beaver Uncovered (Global)
r14521r14522
1720317204ep_monrt   // Money Returns Club, The (Global)
1720417205ep_monsh   // Moonshine Club, The (Unk)
1720517206ep_mummy   // Mummy Talks (Impulse)
17206ep_pkni      // Phoenix Knights (Global)
17207ep_pkni      // The Phoenix Knights (Global)
1720717208ep_redl      // Red Line (Unk)
1720817209ep_rchik   // Rich Chics Club (Unk)
1720917210ep_royrc   // Royal Roulette Club (Unk)
r14521r14522
1722017221ep_utncl   // Utter Nutter Club (Global)
1722117222ep_wleek   // Weakest Leek Club (Global)
1722217223ep_wud      // What's Up Doc (Global)
17223ep_milhr   // Who Wants To Be A Millionhare (Global)
17224ep_milhr   // Who Wants To Be A Millionhare? (Global)
1722417225ep_mlhrc   // Who Whats To Be A Millionhare Club (Global)
1722517226ep_wf      // Wildfire (Global)
1722617227ep_bbars   // Balloon Bars (Maygay)
r14521r14522
1900419005hb_gldwn   // Golden Winner (Fairgames)
1900519006hb_jailb   // Jail Break (Qps)
1900619007hb_jkrwl   // Jokers Wild (Fairgames)
19007hb_mrmon   // Mr Money (Qps)
19008hb_mrmon   // Mr. Money (Qps)
1900819009hb_rhv      // Red Hot Voucher (Qps)
1900919010hb_ringb   // Ring A Bell (Jpm)
1901019011hb_rckrl   // Rock 'n' Roll (Qps)
19011hb_ydd      // Yabba Dabba Dough (Qps)
19012hb_ydd      // Yabba-Dabba-Dough (Qps)
1901219013
1901319014/* Summit Coin */
1901419015
src/mame/audio/suna8.c
r14521r14522
1616   suna8_state *state = device->machine().driver_data<suna8_state>();
1717   if( data )
1818   {
19      samples_device *samples = downcast<samples_device *>(device);
1920      if( ~data & 0x10 )
2021      {
21         sample_start_raw(device, 0, &state->m_samplebuf[0x800*state->m_sample], 0x0800, 4000, 0);
22         samples->start_raw(0, &state->m_samplebuf[0x800*state->m_sample], 0x0800, 4000);
2223      }
2324      else if( ~data & 0x08 )
2425      {
2526         state->m_sample &= 3;
26         sample_start_raw(device, 0, &state->m_samplebuf[0x800*(state->m_sample+7)], 0x0800, 4000, 0);
27         samples->start_raw(0, &state->m_samplebuf[0x800*(state->m_sample+7)], 0x0800, 4000);
2728      }
2829   }
2930}
r14521r14522
3536   {
3637      if(( state->m_sample != 0 ) && ( ~data & 0x30 ))   // don't play state->m_sample zero when the bit is active
3738      {
38         sample_start_raw(device, 0, &state->m_samplebuf[0x800*state->m_sample], 0x0800, 4000, 0);
39         samples_device *samples = downcast<samples_device *>(device);
40         samples->start_raw(0, &state->m_samplebuf[0x800*state->m_sample], 0x0800, 4000);
3941      }
4042   }
4143}
r14521r14522
4850
4951SAMPLES_START( suna8_sh_start )
5052{
51   suna8_state *state = device->machine().driver_data<suna8_state>();
52   running_machine &machine = device->machine();
53   suna8_state *state = device.machine().driver_data<suna8_state>();
54   running_machine &machine = device.machine();
5355   int i, len = machine.region("samples")->bytes();
5456   UINT8 *ROM = machine.region("samples")->base();
5557
src/mame/audio/spacefb.c
r14521r14522
3535WRITE8_HANDLER( spacefb_port_1_w )
3636{
3737   spacefb_state *state = space->machine().driver_data<spacefb_state>();
38   device_t *samples = space->machine().device("samples");
38   samples_device *samples = space->machine().device<samples_device>("samples");
3939
4040   cputag_set_input_line(space->machine(), "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
4141
4242   /* enemy killed */
43   if (!(data & 0x01) && (state->m_sound_latch & 0x01))  sample_start(samples, 0,0,0);
43   if (!(data & 0x01) && (state->m_sound_latch & 0x01))  samples->start(0,0);
4444
4545   /* ship fire */
46   if (!(data & 0x40) && (state->m_sound_latch & 0x40))  sample_start(samples, 1,1,0);
46   if (!(data & 0x40) && (state->m_sound_latch & 0x40))  samples->start(1,1);
4747
4848   /*
4949     *  Explosion Noise
r14521r14522
5757   {
5858      if (data & 0x80)
5959         /* play decaying noise */
60         sample_start(samples, 2,3,0);
60         samples->start(2,3);
6161      else
6262         /* start looping noise */
63         sample_start(samples, 2,2,1);
63         samples->start(2,2, true);
6464   }
6565
6666   state->m_sound_latch = data;
r14521r14522
9191   MCFG_SOUND_ADD("dac", DAC, 0)
9292   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
9393
94   MCFG_SOUND_ADD("samples", SAMPLES, 0)
95   MCFG_SOUND_CONFIG(spacefb_samples_interface)
94   MCFG_SAMPLES_ADD("samples", spacefb_samples_interface)
9695   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
9796MACHINE_CONFIG_END
src/mame/audio/turbo.c
r14521r14522
1919 *
2020 *************************************/
2121
22static void turbo_update_samples(turbo_state *state, device_t *samples)
22static void turbo_update_samples(turbo_state *state, samples_device *samples)
2323{
2424   /* accelerator sounds */
2525   /* BSEL == 3 --> off */
2626   /* BSEL == 2 --> standard */
2727   /* BSEL == 1 --> tunnel */
2828   /* BSEL == 0 --> ??? */
29   if (state->m_turbo_bsel == 3 && sample_playing(samples, 5))
30      sample_stop(samples, 5);
31   else if (state->m_turbo_bsel != 3 && !sample_playing(samples, 5))
32      sample_start(samples, 5, 7, TRUE);
33   if (sample_playing(samples, 5))
34      sample_set_freq(samples, 5, sample_get_base_freq(samples, 5) * ((state->m_turbo_accel & 0x3f) / 5.25 + 1));
29   if (state->m_turbo_bsel == 3 && samples->playing(5))
30      samples->stop(5);
31   else if (state->m_turbo_bsel != 3 && !samples->playing(5))
32      samples->start(5, 7, true);
33   if (samples->playing(5))
34      samples->set_frequency(5, samples->base_frequency(5) * ((state->m_turbo_accel & 0x3f) / 5.25 + 1));
3535}
3636
3737
r14521r14522
7272WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
7373{
7474#if (!DISCRETE_TEST)
75   device_t *samples = device->machine().device("samples");
75   samples_device *samples = device->machine().device<samples_device>("samples");
7676#endif
7777   turbo_state *state = device->machine().driver_data<turbo_state>();
7878   UINT8 diff = data ^ state->m_sound_state[0];
r14521r14522
8181#if (!DISCRETE_TEST)
8282
8383   /* /CRASH.S: channel 0 */
84   if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 5, FALSE);
84   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 5);
8585
8686   /* /TRIG1: channel 1 */
87   if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, 0, FALSE);
87   if ((diff & 0x02) && !(data & 0x02)) samples->start(1, 0);
8888
8989   /* /TRIG2: channel 1 */
90   if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 1, 1, FALSE);
90   if ((diff & 0x04) && !(data & 0x04)) samples->start(1, 1);
9191
9292   /* /TRIG3: channel 1 */
93   if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 1, 2, FALSE);
93   if ((diff & 0x08) && !(data & 0x08)) samples->start(1, 2);
9494
9595   /* /TRIG4: channel 1 */
96   if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 1, 3, FALSE);
96   if ((diff & 0x10) && !(data & 0x10)) samples->start(1, 3);
9797
9898   /* OSEL0 */
9999   state->m_turbo_osel = (state->m_turbo_osel & 6) | ((data >> 5) & 1);
100100
101101   /* /SLIP: channel 2 */
102   if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 2, 4, FALSE);
102   if ((diff & 0x40) && !(data & 0x40)) samples->start(2, 4);
103103
104104   /* /CRASH.L: channel 3 */
105   if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 3, 5, FALSE);
105   if ((diff & 0x80) && !(data & 0x80)) samples->start(3, 5);
106106
107107   /* update any samples */
108108   turbo_update_samples(state, samples);
r14521r14522
122122
123123WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
124124{
125   device_t *samples = device->machine().device("samples");
125   samples_device *samples = device->machine().device<samples_device>("samples");
126126   turbo_state *state = device->machine().driver_data<turbo_state>();
127127   UINT8 diff = data ^ state->m_sound_state[1];
128128   state->m_sound_state[1] = data;
r14521r14522
132132   output_set_value("tachometer", state->m_turbo_accel);
133133
134134   /* /AMBU: channel 4 */
135   if ((diff & 0x40) && !(data & 0x40) && !sample_playing(samples, 4)) sample_start(samples, 4, 8, TRUE);
136   if ((diff & 0x40) &&  (data & 0x40)) sample_stop(samples, 4);
135   if ((diff & 0x40) && !(data & 0x40) && !samples->playing(4)) samples->start(4, 8, true);
136   if ((diff & 0x40) &&  (data & 0x40)) samples->stop(4);
137137
138138   /* /SPIN: channel 2 */
139   if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 2, 6, FALSE);
139   if ((diff & 0x80) && !(data & 0x80)) samples->start(2, 6);
140140
141141   /* update any samples */
142142   turbo_update_samples(state, samples);
r14521r14522
145145
146146WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
147147{
148   device_t *samples = device->machine().device("samples");
148   samples_device *samples = device->machine().device<samples_device>("samples");
149149   turbo_state *state = device->machine().driver_data<turbo_state>();
150150
151151   /* OSEL1-2 */
r14521r14522
200200   MCFG_SPEAKER_ADD("lspeaker", -0.2, 0.0, 1.0)   /* left */
201201   MCFG_SPEAKER_ADD("rspeaker", 0.2, 0.0, 1.0)      /* right */
202202
203   MCFG_SOUND_ADD("samples", SAMPLES, 0)
204   MCFG_SOUND_CONFIG(turbo_samples_interface)
203   MCFG_SAMPLES_ADD("samples", turbo_samples_interface)
205204
206205   /* channel 0 = CRASH.S -> CRASH.S/SM */
207206   MCFG_SOUND_ROUTE(0, "fspeaker", 0.25)
r14521r14522
304303}
305304
306305
307INLINE void subroc3d_update_volume(device_t *samples, int leftchan, UINT8 dis, UINT8 dir)
306INLINE void subroc3d_update_volume(samples_device *samples, int leftchan, UINT8 dis, UINT8 dir)
308307{
309308   float volume = (float)(15 - dis) / 16.0f;
310309   float lvol, rvol;
r14521r14522
319318      lvol = rvol = 0;
320319
321320   /* if the sample is playing, adjust it */
322   sample_set_volume(samples, leftchan + 0, lvol);
323   sample_set_volume(samples, leftchan + 1, rvol);
321   samples->set_volume(leftchan + 0, lvol);
322   samples->set_volume(leftchan + 1, rvol);
324323}
325324
326325
327326WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
328327{
329   device_t *samples = device->machine().device("samples");
328   samples_device *samples = device->machine().device<samples_device>("samples");
330329   turbo_state *state = device->machine().driver_data<turbo_state>();
331330   UINT8 diff = data ^ state->m_sound_state[1];
332331   state->m_sound_state[1] = data;
r14521r14522
336335   {
337336      state->m_subroc3d_mdis = state->m_sound_state[0] & 0x0f;
338337      state->m_subroc3d_mdir = (state->m_sound_state[0] >> 4) & 0x07;
339      if (!sample_playing(samples, 0))
338      if (!samples->playing(0))
340339      {
341         sample_start(samples, 0, 0, TRUE);
342         sample_start(samples, 1, 0, TRUE);
340         samples->start(0, 0, true);
341         samples->start(1, 0, true);
343342      }
344343      subroc3d_update_volume(samples, 0, state->m_subroc3d_mdis, state->m_subroc3d_mdir);
345344   }
r14521r14522
349348   {
350349      state->m_subroc3d_tdis = state->m_sound_state[0] & 0x0f;
351350      state->m_subroc3d_tdir = (state->m_sound_state[0] >> 4) & 0x07;
352      if (!sample_playing(samples, 2))
351      if (!samples->playing(2))
353352      {
354         sample_start(samples, 2, 1, TRUE);
355         sample_start(samples, 3, 1, TRUE);
353         samples->start(2, 1, true);
354         samples->start(3, 1, true);
356355      }
357356      subroc3d_update_volume(samples, 2, state->m_subroc3d_tdis, state->m_subroc3d_tdir);
358357   }
r14521r14522
362361   {
363362      state->m_subroc3d_fdis = state->m_sound_state[0] & 0x0f;
364363      state->m_subroc3d_fdir = (state->m_sound_state[0] >> 4) & 0x07;
365      if (!sample_playing(samples, 4))
364      if (!samples->playing(4))
366365      {
367         sample_start(samples, 4, 2, TRUE);
368         sample_start(samples, 5, 2, TRUE);
366         samples->start(4, 2, true);
367         samples->start(5, 2, true);
369368      }
370369      subroc3d_update_volume(samples, 4, state->m_subroc3d_fdis, state->m_subroc3d_fdir);
371370   }
r14521r14522
382381
383382WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
384383{
385   device_t *samples = device->machine().device("samples");
384   samples_device *samples = device->machine().device<samples_device>("samples");
386385   turbo_state *state = device->machine().driver_data<turbo_state>();
387386   UINT8 diff = data ^ state->m_sound_state[2];
388387   state->m_sound_state[2] = data;
r14521r14522
390389   /* /FIRE TRIG */
391390   /* FIRE SELECT */
392391   if ((diff & 0x01) && (data & 0x01))
393      sample_start(samples, 8, (data & 0x02) ? 6 : 5, FALSE);
392      samples->start(8, (data & 0x02) ? 6 : 5);
394393
395394   /* /SHIP EXP TRIG -> MY SHIP EXP: channel 9 */
396395   if ((diff & 0x04) && (data & 0x04))
397      sample_start(samples, 9, 7, FALSE);
396      samples->start(9, 7);
398397
399398   /* /HIT TRIG -> HIT.L/R: channels 6+7 */
400399   if ((diff & 0x08) && (data & 0x08))
401400   {
402      sample_start(samples, 6, (state->m_sound_state[0] & 0x80) ? 4 : 3, FALSE);
403      sample_start(samples, 7, (state->m_sound_state[0] & 0x80) ? 4 : 3, FALSE);
401      samples->start(6, (state->m_sound_state[0] & 0x80) ? 4 : 3);
402      samples->start(7, (state->m_sound_state[0] & 0x80) ? 4 : 3);
404403   }
405404
406405   /* /ALARM TRIG -> ALARM.M: channel 10 */
407406   /* ALARM SELECT */
408407   if ((diff & 0x10) && (data & 0x10))
409      sample_start(samples, 10, (data & 0x20) ? 10 : 9, FALSE);
408      samples->start(10, (data & 0x20) ? 10 : 9);
410409
411410   /* /PROLOGUE */
412   if (!sample_playing(samples, 11))
413      sample_start(samples, 11, 8, TRUE);
414   sample_set_volume(samples, 11, (data & 0x40) ? 0 : 1.0);
411   if (!samples->playing(11))
412      samples->start(11, 8, true);
413   samples->set_volume(11, (data & 0x40) ? 0 : 1.0);
415414
416415   /* /GAME START */
417416   device->machine().sound().system_mute(data & 0x80);
r14521r14522
453452MACHINE_CONFIG_FRAGMENT( subroc3d_samples )
454453   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
455454
456   MCFG_SOUND_ADD("samples", SAMPLES, 0)
457   MCFG_SOUND_CONFIG(subroc3d_samples_interface)
455   MCFG_SAMPLES_ADD("samples", subroc3d_samples_interface)
458456
459457   /* MISSILE in channels 0 and 1 */
460458   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
r14521r14522
497495 *
498496 *************************************/
499497
500static void buckrog_update_samples(turbo_state *state, device_t *samples)
498static void buckrog_update_samples(turbo_state *state, samples_device *samples)
501499{
502500   /* accelerator sounds */
503   if (sample_playing(samples, 5))
504      sample_set_freq(samples, 5, sample_get_base_freq(samples, 5) * (state->m_buckrog_myship / 100.25 + 1));
501   if (samples->playing(5))
502      samples->set_frequency(5, samples->base_frequency(5) * (state->m_buckrog_myship / 100.25 + 1));
505503}
506504
507505
508506WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
509507{
510   device_t *samples = device->machine().device("samples");
508   samples_device *samples = device->machine().device<samples_device>("samples");
511509   turbo_state *state = device->machine().driver_data<turbo_state>();
512510   UINT8 diff = data ^ state->m_sound_state[0];
513511   state->m_sound_state[0] = data;
514512
515513   /* clock HIT DIS from bits 0-2 */
516514   if ((diff & 0x10) && (data & 0x10))
517      sample_set_volume(samples, 3, (float)(/*7 - */(data & 7)) / 7.0f);
515      samples->set_volume(3, (float)(/*7 - */(data & 7)) / 7.0f);
518516
519517   /* clock ACC from bits 0-3 */
520518   if ((diff & 0x20) && (data & 0x20))
r14521r14522
524522   }
525523
526524   /* /ALARM0: channel 0 */
527   if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 0, 0, FALSE);
525   if ((diff & 0x40) && !(data & 0x40)) samples->start(0, 0);
528526
529527   /* /ALARM1: channel 0 */
530   if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 0, 1, FALSE);
528   if ((diff & 0x80) && !(data & 0x80)) samples->start(0, 1);
531529}
532530
533531
534532WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
535533{
536   device_t *samples = device->machine().device("samples");
534   samples_device *samples = device->machine().device<samples_device>("samples");
537535   turbo_state *state = device->machine().driver_data<turbo_state>();
538536   UINT8 diff = data ^ state->m_sound_state[1];
539537   state->m_sound_state[1] = data;
540538
541539   /* /ALARM3: channel 0 */
542   if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 2, FALSE);
540   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 2);
543541
544542   /* /ALARM4: channel 0 */
545   if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 0, 3, FALSE);
543   if ((diff & 0x02) && !(data & 0x02)) samples->start(0, 3);
546544
547545   /* /FIRE: channel 1 */
548   if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 1, 5, FALSE);
546   if ((diff & 0x04) && !(data & 0x04)) samples->start(1, 5);
549547
550548   /* /EXP: channel 2 */
551   if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 2, 4, FALSE);
549   if ((diff & 0x08) && !(data & 0x08)) samples->start(2, 4);
552550
553551   /* /HIT: channel 3 */
554552   if ((diff & 0x10) && !(data & 0x10))
555553   {
556      sample_start(samples, 3, 7, FALSE);
554      samples->start(3, 7);
557555      buckrog_update_samples(state, samples);
558556   }
559557
560558   /* /REBOUND: channel 4 */
561   if ((diff & 0x20) && !(data & 0x20)) sample_start(samples, 4, 6, FALSE);
559   if ((diff & 0x20) && !(data & 0x20)) samples->start(4, 6);
562560
563561   /* SHIP: channel 5 */
564   if ((diff & 0x40) &&  (data & 0x40) && !sample_playing(samples, 5))
562   if ((diff & 0x40) &&  (data & 0x40) && !samples->playing(5))
565563   {
566      sample_start(samples, 5, 8, TRUE);
564      samples->start(5, 8, true);
567565      buckrog_update_samples(state, samples);
568566   }
569   if ((diff & 0x40) && !(data & 0x40) &&  sample_playing(samples, 5)) sample_stop(samples, 5);
567   if ((diff & 0x40) && !(data & 0x40) &&  samples->playing(5)) samples->stop(5);
570568
571569   /* GAME ON */
572570   device->machine().sound().system_enable(data & 0x80);
r14521r14522
607605
608606MACHINE_CONFIG_FRAGMENT( buckrog_samples )
609607   MCFG_SPEAKER_STANDARD_MONO("mono")
610   MCFG_SOUND_ADD("samples", SAMPLES, 0)
611   MCFG_SOUND_CONFIG(buckrog_samples_interface)
608   MCFG_SAMPLES_ADD("samples", buckrog_samples_interface)
612609   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
613610MACHINE_CONFIG_END
614611
src/mame/audio/gorf.c
r14521r14522
112112READ8_HANDLER( gorf_speech_r )
113113{
114114   astrocde_state *state = space->machine().driver_data<astrocde_state>();
115   device_t *samples = space->machine().device("samples");
115   samples_device *samples = space->machine().device<samples_device>("samples");
116116   int Phoneme, Intonation;
117117   int i = 0;
118118   UINT8 data = offset >> 8;
r14521r14522
126126   logerror("Date : %d Speech : %s at intonation %d\n",Phoneme, PhonemeTable[Phoneme],Intonation);
127127
128128   if(Phoneme==63) {
129      sample_stop(samples, 0);
129      samples->stop(0);
130130      if (strlen(state->m_totalword)>2) logerror("Clearing sample %s\n",state->m_totalword);
131131      state->m_totalword[0] = 0;               /* Clear the total word stack */
132132      return data;
r14521r14522
139139      if (state->m_plural != 0) {
140140         logerror("found a possible plural at %d\n",state->m_plural-1);
141141         if (!strcmp("S",state->m_totalword)) {         /* Plural check */
142            sample_start(samples, 0, num_samples-2, 0);      /* play the sample at position of word */
143            sample_set_freq(samples, 0, 11025);    /* play at correct rate */
142            samples->start(0, num_samples-2);      /* play the sample at position of word */
143            samples->set_frequency(0, 11025);    /* play at correct rate */
144144            state->m_totalword[0] = 0;               /* Clear the total word stack */
145145            state->m_oldword[0] = 0;               /* Clear the total word stack */
146146            return data;
r14521r14522
162162         } else {
163163            state->m_plural=0;
164164         }
165         sample_start(samples, 0, i, 0);                      /* play the sample at position of word */
166         sample_set_freq(samples, 0, 11025);       /* play at correct rate */
165         samples->start(0, i);                      /* play the sample at position of word */
166         samples->set_frequency(0, 11025);       /* play at correct rate */
167167         logerror("Playing sample %d",i);
168168         state->m_totalword[0] = 0;               /* Clear the total word stack */
169169         return data;
r14521r14522
177177
178178CUSTOM_INPUT( gorf_speech_status_r )
179179{
180   device_t *samples = field.machine().device("samples");
181   return !sample_playing(samples, 0);
180   samples_device *samples = field.machine().device<samples_device>("samples");
181   return !samples->playing(0);
182182}
src/mame/audio/senjyo.c
r14521r14522
5252   samples_device *samples = space->machine().device<samples_device>("samples");
5353
5454   state->m_single_volume = data & 0x0f;
55   sample_set_volume(samples, 0, state->m_single_volume / 15.0);
55   samples->set_volume(0, state->m_single_volume / 15.0);
5656}
5757
5858
5959static TIMER_CALLBACK( senjyo_sh_update )
6060{
61   device_t *samples = machine.device("samples");
61   samples_device *samples = machine.device<samples_device>("samples");
6262   senjyo_state *state = machine.driver_data<senjyo_state>();
6363
6464   /* ctc2 timer single tone generator frequency */
r14521r14522
6969   else
7070      state->m_single_rate = 0;
7171
72   sample_set_freq(samples, 0, state->m_single_rate);
72   samples->set_frequency(0, state->m_single_rate);
7373}
7474
7575
7676SAMPLES_START( senjyo_sh_start )
7777{
78   running_machine &machine = device->machine();
78   running_machine &machine = device.machine();
7979   senjyo_state *state = machine.driver_data<senjyo_state>();
8080   int i;
8181
r14521r14522
8787   /* CTC2 single tone generator */
8888   state->m_single_rate = 1000;
8989   state->m_single_volume = 0;
90   sample_set_volume(device, 0, state->m_single_volume / 15.0);
91   sample_start_raw(device, 0, state->m_single_data, SINGLE_LENGTH, state->m_single_rate, 1);
90   device.set_volume(0, state->m_single_volume / 15.0);
91   device.start_raw(0, state->m_single_data, SINGLE_LENGTH, state->m_single_rate, true);
9292
9393   machine.scheduler().timer_pulse(machine.primary_screen->frame_period(), FUNC(senjyo_sh_update));
9494}
src/mame/audio/depthch.c
r14521r14522
1313#define OUT_PORT_1_SONAR        0x08
1414
1515
16#define PLAY(samp,id,loop)      sample_start( samp, id, id, loop )
17#define STOP(samp,id)           sample_stop( samp, id )
16#define PLAY(samp,id,loop)      samp->start( id, id, loop )
17#define STOP(samp,id)           samp->stop( id )
1818
1919
2020/* sample file names */
r14521r14522
3737
3838
3939MACHINE_CONFIG_FRAGMENT( depthch_audio )
40   MCFG_SOUND_ADD("samples", SAMPLES, 0)
41   MCFG_SOUND_CONFIG(depthch_samples_interface)
40   MCFG_SAMPLES_ADD("samples", depthch_samples_interface)
4241   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
4342MACHINE_CONFIG_END
4443
r14521r14522
5655WRITE8_HANDLER( depthch_audio_w )
5756{
5857   static int port1State = 0;
59   device_t *samples = space->machine().device("samples");
58   samples_device *samples = space->machine().device<samples_device>("samples");
6059   int bitsChanged;
6160   int bitsGoneHigh;
6261   int bitsGoneLow;
src/mame/audio/carnival.c
r14521r14522
7575#define PSG_BC_LATCH_ADDRESS    ( MUSIC_PORT2_PSG_BDIR | MUSIC_PORT2_PSG_BC1 )
7676
7777
78#define PLAY(samp,id,loop)      sample_start( samp, id, id, loop )
79#define STOP(samp,id)           sample_stop( samp, id )
78#define PLAY(samp,id,loop)      samp->start( id, id, loop )
79#define STOP(samp,id)           samp->stop( id )
8080
8181
8282/* sample file names */
r14521r14522
127127WRITE8_HANDLER( carnival_audio_1_w )
128128{
129129   static int port1State = 0;
130   device_t *samples = space->machine().device("samples");
130   samples_device *samples = space->machine().device<samples_device>("samples");
131131   int bitsChanged;
132132   int bitsGoneHigh;
133133   int bitsGoneLow;
r14521r14522
206206
207207WRITE8_HANDLER( carnival_audio_2_w )
208208{
209   device_t *samples = space->machine().device("samples");
209   samples_device *samples = space->machine().device<samples_device>("samples");
210210   int bitsChanged;
211211   int bitsGoneHigh;
212212   int bitsGoneLow;
r14521r14522
306306   MCFG_SOUND_ADD("psg", AY8910, PSG_CLOCK)
307307   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
308308
309   MCFG_SOUND_ADD("samples", SAMPLES, 0)
310   MCFG_SOUND_CONFIG(carnival_samples_interface)
309   MCFG_SAMPLES_ADD("samples", carnival_samples_interface)
311310   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
312311MACHINE_CONFIG_END
src/mame/audio/blockade.c
r14521r14522
4444
4545WRITE8_HANDLER( blockade_env_on_w )
4646{
47   device_t *samples = space->machine().device("samples");
47   samples_device *samples = space->machine().device<samples_device>("samples");
4848   if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n");
49   sample_start(samples, 0,0,0);
49   samples->start(0,0);
5050   return;
5151}
5252
src/mame/audio/gridlee.c
r14521r14522
2424
2525   /* sound streaming variables */
2626   sound_stream *m_stream;
27   device_t *m_samples;
27   samples_device *m_samples;
2828   double m_freq_to_step;
2929   UINT8 m_sound_data[24];
3030};
r14521r14522
7474   /* allocate the stream */
7575   state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, machine.sample_rate(), NULL, gridlee_stream_update);
7676
77   state->m_samples = device->machine().device("samples");
77   state->m_samples = device->machine().device<samples_device>("samples");
7878
7979   state->m_freq_to_step = (double)(1 << 24) / (double)machine.sample_rate();
8080}
r14521r14522
102102{
103103   gridlee_sound_state *state = get_safe_token(device);
104104   UINT8 *sound_data = state->m_sound_data;
105   device_t *samples = state->m_samples;
105   samples_device *samples = state->m_samples;
106106
107107   state->m_stream->update();
108108
r14521r14522
110110   {
111111      case 0x04:
112112         if (data == 0xef && sound_data[offset] != 0xef)
113            sample_start(samples, 4, 1, 0);
113            samples->start(4, 1);
114114         else if (data != 0xef && sound_data[offset] == 0xef)
115            sample_stop(samples, 4);
115            samples->stop(4);
116116//          if (!(data & 0x01) && (sound_data[offset] & 0x01))
117//              sample_start(samples, 5, 1, 0);
117//              samples->start(5, 1);
118118//          else if ((data & 0x01) && !(sound_data[offset] & 0x01))
119//              sample_stop(samples, 5);
119//              samples->stop(5);
120120         break;
121121
122122      case 0x0c:
r14521r14522
124124      case 0x0e:
125125      case 0x0f:
126126         if ((data & 1) && !(sound_data[offset] & 1))
127            sample_start(samples, offset - 0x0c, 1 - sound_data[offset - 4], 0);
127            samples->start(offset - 0x0c, 1 - sound_data[offset - 4]);
128128         else if (!(data & 1) && (sound_data[offset] & 1))
129            sample_stop(samples, offset - 0x0c);
129            samples->stop(offset - 0x0c);
130130         break;
131131
132132      case 0x08+0x08:
src/mame/audio/segag80r.c
r14521r14522
190190   MCFG_SOUND_START(astrob)
191191
192192   /* sound hardware */
193   MCFG_SOUND_ADD("samples", SAMPLES, 0)
194   MCFG_SOUND_CONFIG(astrob_samples_interface)
193   MCFG_SAMPLES_ADD("samples", astrob_samples_interface)
195194   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
196195MACHINE_CONFIG_END
197196
r14521r14522
225224   {
226225      120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f
227226   };
228   device_t *samples = space->machine().device("samples");
227   samples_device *samples = space->machine().device<samples_device>("samples");
229228   float freq_factor;
230229
231230   UINT8 diff = data ^ state->m_sound_state[offset];
r14521r14522
235234   {
236235      case 0:
237236         /* INVADER-1: channel 0 */
238         if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, (data & 0x80) ? 0 : 1, TRUE);
239         if ((data & 0x01) && sample_playing(samples, 0)) sample_stop(samples, 0);
237         if ((diff & 0x01) && !(data & 0x01)) samples->start(0, (data & 0x80) ? 0 : 1, true);
238         if ((data & 0x01) && samples->playing(0)) samples->stop(0);
240239
241240         /* INVADER-2: channel 1 */
242         if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, (data & 0x80) ? 2 : 3, TRUE);
243         if ((data & 0x02) && sample_playing(samples, 1)) sample_stop(samples, 1);
241         if ((diff & 0x02) && !(data & 0x02)) samples->start(1, (data & 0x80) ? 2 : 3, true);
242         if ((data & 0x02) && samples->playing(1)) samples->stop(1);
244243
245244         /* INVADER-3: channel 2 */
246         if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 2, (data & 0x80) ? 4 : 5, TRUE);
247         if ((data & 0x04) && sample_playing(samples, 2)) sample_stop(samples, 2);
245         if ((diff & 0x04) && !(data & 0x04)) samples->start(2, (data & 0x80) ? 4 : 5, true);
246         if ((data & 0x04) && samples->playing(2)) samples->stop(2);
248247
249248         /* INVADER-4: channel 3 */
250         if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 3, (data & 0x80) ? 6 : 7, TRUE);
251         if ((data & 0x08) && sample_playing(samples, 3)) sample_stop(samples, 3);
249         if ((diff & 0x08) && !(data & 0x08)) samples->start(3, (data & 0x80) ? 6 : 7, true);
250         if ((data & 0x08) && samples->playing(3)) samples->stop(3);
252251
253252         /* ASTROIDS: channel 4 */
254         if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 4, 8, TRUE);
255         if ((data & 0x10) && sample_playing(samples, 4)) sample_stop(samples, 4);
253         if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 8, true);
254         if ((data & 0x10) && samples->playing(4)) samples->stop(4);
256255
257256         /* MUTE */
258257         space->machine().sound().system_mute(data & 0x20);
259258
260259         /* REFILL: channel 5 */
261         if (!(data & 0x40) && !sample_playing(samples, 5)) sample_start(samples, 5, 9, FALSE);
262         if ( (data & 0x40) && sample_playing(samples, 5))  sample_stop(samples, 5);
260         if (!(data & 0x40) && !samples->playing(5)) samples->start(5, 9);
261         if ( (data & 0x40) && samples->playing(5))  samples->stop(5);
263262
264263         /* WARP: changes which sample is played for the INVADER samples above */
265264         if (diff & 0x80)
266265         {
267            if (sample_playing(samples, 0)) sample_start(samples, 0, (data & 0x80) ? 0 : 1, TRUE);
268            if (sample_playing(samples, 1)) sample_start(samples, 1, (data & 0x80) ? 2 : 3, TRUE);
269            if (sample_playing(samples, 2)) sample_start(samples, 2, (data & 0x80) ? 4 : 5, TRUE);
270            if (sample_playing(samples, 3)) sample_start(samples, 3, (data & 0x80) ? 6 : 7, TRUE);
266            if (samples->playing(0)) samples->start(0, (data & 0x80) ? 0 : 1, true);
267            if (samples->playing(1)) samples->start(1, (data & 0x80) ? 2 : 3, true);
268            if (samples->playing(2)) samples->start(2, (data & 0x80) ? 4 : 5, true);
269            if (samples->playing(3)) samples->start(3, (data & 0x80) ? 6 : 7, true);
271270         }
272271         break;
273272
274273      case 1:
275274         /* LASER #1: channel 6 */
276         if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 6, 10, FALSE);
275         if ((diff & 0x01) && !(data & 0x01)) samples->start(6, 10);
277276
278277         /* LASER #2: channel 7 */
279         if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 7, 11, FALSE);
278         if ((diff & 0x02) && !(data & 0x02)) samples->start(7, 11);
280279
281280         /* SHORT EXPL: channel 8 */
282         if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 8, 12, FALSE);
281         if ((diff & 0x04) && !(data & 0x04)) samples->start(8, 12);
283282
284283         /* LONG EXPL: channel 8 */
285         if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 8, 13, FALSE);
284         if ((diff & 0x08) && !(data & 0x08)) samples->start(8, 13);
286285
287286         /* ATTACK RATE */
288287         if ((diff & 0x10) && !(data & 0x10)) state->m_sound_rate = (state->m_sound_rate + 1) % 10;
r14521r14522
291290         if (!(data & 0x20)) state->m_sound_rate = 0;
292291
293292         /* BONUS: channel 9 */
294         if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 9, 14, FALSE);
293         if ((diff & 0x40) && !(data & 0x40)) samples->start(9, 14);
295294
296295         /* SONAR: channel 10 */
297         if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 10, 15, FALSE);
296         if ((diff & 0x80) && !(data & 0x80)) samples->start(10, 15);
298297         break;
299298   }
300299
r14521r14522
308307
309308   /* adjust the sample rate of invader sounds based the sound_rate */
310309   /* this is an approximation */
311   if (sample_playing(samples, 0)) sample_set_freq(samples, 0, sample_get_base_freq(samples, 0) * freq_factor);
312   if (sample_playing(samples, 1)) sample_set_freq(samples, 1, sample_get_base_freq(samples, 1) * freq_factor);
313   if (sample_playing(samples, 2)) sample_set_freq(samples, 2, sample_get_base_freq(samples, 2) * freq_factor);
314   if (sample_playing(samples, 3)) sample_set_freq(samples, 3, sample_get_base_freq(samples, 3) * freq_factor);
310   if (samples->playing(0)) samples->set_frequency(0, samples->base_frequency(0) * freq_factor);
311   if (samples->playing(1)) samples->set_frequency(1, samples->base_frequency(1) * freq_factor);
312   if (samples->playing(2)) samples->set_frequency(2, samples->base_frequency(2) * freq_factor);
313   if (samples->playing(3)) samples->set_frequency(3, samples->base_frequency(3) * freq_factor);
315314}
316315
317316
r14521r14522
422421   /* sound hardware */
423422   MCFG_SOUND_START(sega005)
424423
425   MCFG_SOUND_ADD("samples", SAMPLES, 0)
426   MCFG_SOUND_CONFIG(sega005_samples_interface)
424   MCFG_SAMPLES_ADD("samples", sega005_samples_interface)
427425   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
428426
429427   MCFG_SOUND_ADD("005", SEGA005, 0)
r14521r14522
459457static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
460458{
461459   segag80r_state *state = device->machine().driver_data<segag80r_state>();
462   device_t *samples = device->machine().device("samples");
460   samples_device *samples = device->machine().device<samples_device>("samples");
463461   UINT8 diff = data ^ state->m_sound_state[0];
464462   state->m_sound_state[0] = data;
465463
466464   /* LARGE EXPL: channel 0 */
467   if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 0, FALSE);
465   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 0);
468466
469467   /* SMALL EXPL: channel 1 */
470   if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, 1, FALSE);
468   if ((diff & 0x02) && !(data & 0x02)) samples->start(1, 1);
471469
472470   /* DROP BOMB: channel 2 */
473   if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 2, 2, FALSE);
471   if ((diff & 0x04) && !(data & 0x04)) samples->start(2, 2);
474472
475473   /* SHOOT PISTOL: channel 3 */
476   if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 3, 3, FALSE);
474   if ((diff & 0x08) && !(data & 0x08)) samples->start(3, 3);
477475
478476   /* MISSILE: channel 4 */
479   if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 4, 4, FALSE);
477   if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 4);
480478
481479   /* HELICOPTER: channel 5 */
482   if ((diff & 0x20) && !(data & 0x20) && !sample_playing(samples, 5)) sample_start(samples, 5, 5, TRUE);
483   if ((diff & 0x20) &&  (data & 0x20)) sample_stop(samples, 5);
480   if ((diff & 0x20) && !(data & 0x20) && !samples->playing(5)) samples->start(5, 5, true);
481   if ((diff & 0x20) &&  (data & 0x20)) samples->stop(5);
484482
485483   /* WHISTLE: channel 6 */
486   if ((diff & 0x40) && !(data & 0x40) && !sample_playing(samples, 6)) sample_start(samples, 6, 6, TRUE);
487   if ((diff & 0x40) &&  (data & 0x40)) sample_stop(samples, 6);
484   if ((diff & 0x40) && !(data & 0x40) && !samples->playing(6)) samples->start(6, 6, true);
485   if ((diff & 0x40) &&  (data & 0x40)) samples->stop(6);
488486}
489487
490488
r14521r14522
664662   /* sound hardware */
665663   MCFG_SOUND_START(spaceod)
666664
667   MCFG_SOUND_ADD("samples", SAMPLES, 0)
668   MCFG_SOUND_CONFIG(spaceod_samples_interface)
665   MCFG_SAMPLES_ADD("samples", spaceod_samples_interface)
669666   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
670667MACHINE_CONFIG_END
671668
r14521r14522
694691WRITE8_HANDLER( spaceod_sound_w )
695692{
696693   segag80r_state *state = space->machine().driver_data<segag80r_state>();
697   device_t *samples = space->machine().device("samples");
694   samples_device *samples = space->machine().device<samples_device>("samples");
698695   UINT8 diff = data ^ state->m_sound_state[offset];
699696   state->m_sound_state[offset] = data;
700697
r14521r14522
702699   {
703700      case 0:
704701         /* BACK G: channel 0 */
705         if ((diff & 0x01) && !(data & 0x01) && !sample_playing(samples, 0)) sample_start(samples, 0, 7, TRUE);
706         if ((diff & 0x01) &&  (data & 0x01)) sample_stop(samples, 0);
702         if ((diff & 0x01) && !(data & 0x01) && !samples->playing(0)) samples->start(0, 7, true);
703         if ((diff & 0x01) &&  (data & 0x01)) samples->stop(0);
707704
708705         /* SHORT EXP: channel 1 */
709         if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 1, 2, FALSE);
706         if ((diff & 0x04) && !(data & 0x04)) samples->start(1, 2);
710707
711708         /* ACCELERATE: channel 2 */
712         if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 2, 8, FALSE);
709         if ((diff & 0x10) && !(data & 0x10)) samples->start(2, 8);
713710
714711         /* BATTLE STAR: channel 3 */
715         if ((diff & 0x20) && !(data & 0x20)) sample_start(samples, 3, 10, FALSE);
712         if ((diff & 0x20) && !(data & 0x20)) samples->start(3, 10);
716713
717714         /* D BOMB: channel 4 */
718         if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 4, 1, FALSE);
715         if ((diff & 0x40) && !(data & 0x40)) samples->start(4, 1);
719716
720717         /* LONG EXP: channel 5 */
721         if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 5, 3, FALSE);
718         if ((diff & 0x80) && !(data & 0x80)) samples->start(5, 3);
722719         break;
723720
724721      case 1:
725722         /* SHOT: channel 6 */
726         if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 6, 0, FALSE);
723         if ((diff & 0x01) && !(data & 0x01)) samples->start(6, 0);
727724
728725         /* BONUS UP: channel 7 */
729         if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 7, 6, FALSE);
726         if ((diff & 0x02) && !(data & 0x02)) samples->start(7, 6);
730727
731728         /* WARP: channel 8 */
732         if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 8, 4, FALSE);
729         if ((diff & 0x08) && !(data & 0x08)) samples->start(8, 4);
733730
734731         /* APPEARANCE UFO: channel 9 */
735         if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 9, 5, FALSE);
732         if ((diff & 0x40) && !(data & 0x40)) samples->start(9, 5);
736733
737734         /* BLACK HOLE: channel 10 */
738         if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 10, 9, FALSE);
735         if ((diff & 0x80) && !(data & 0x80)) samples->start(10, 9);
739736         break;
740737   }
741738}
r14521r14522
841838   /* sound hardware */
842839   MCFG_SOUND_START(monsterb)
843840
844   MCFG_SOUND_ADD("samples", SAMPLES, 0)
845   MCFG_SOUND_CONFIG(monsterb_samples_interface)
841   MCFG_SAMPLES_ADD("samples", monsterb_samples_interface)
846842   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
847843
848844   MCFG_SOUND_ADD("music", TMS36XX, 247)
r14521r14522
902898static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
903899{
904900   segag80r_state *state = device->machine().driver_data<segag80r_state>();
905   device_t *samples = device->machine().device("samples");
901   samples_device *samples = device->machine().device<samples_device>("samples");
906902   UINT8 diff = data ^ state->m_sound_state[1];
907903   state->m_sound_state[1] = data;
908904
909905   /* SHOT: channel 0 */
910   if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 0, FALSE);
906   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 0);
911907
912908   /* DIVE: channel 1 */
913   if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, 1, FALSE);
909   if ((diff & 0x02) && !(data & 0x02)) samples->start(1, 1);
914910
915911    /* TODO: D7 on Port B might affect TMS3617 output (mute?) */
916912}
src/mame/audio/segag80v.c
r14521r14522
137137
138138WRITE8_HANDLER( elim1_sh_w )
139139{
140   device_t *samples = space->machine().device("samples");
140   samples_device *samples = space->machine().device<samples_device>("samples");
141141   data ^= 0xff;
142142
143143   /* Play fireball sample */
144144   if (data & 0x02)
145      sample_start (samples, 0, 0, 0);
145      samples->start(0, 0);
146146
147147   /* Play explosion samples */
148148   if (data & 0x04)
149      sample_start (samples, 1, 10, 0);
149      samples->start(1, 10);
150150   if (data & 0x08)
151      sample_start (samples, 1, 9, 0);
151      samples->start(1, 9);
152152   if (data & 0x10)
153      sample_start (samples, 1, 8, 0);
153      samples->start(1, 8);
154154
155155   /* Play bounce sample */
156156   if (data & 0x20)
157157   {
158      if (sample_playing(samples, 2))
159         sample_stop (samples, 2);
160      sample_start (samples, 2, 1, 0);
158      if (samples->playing(2))
159         samples->stop(2);
160      samples->start(2, 1);
161161   }
162162
163163   /* Play lazer sample */
164164   if (data & 0xc0)
165165   {
166      if (sample_playing(samples, 3))
167         sample_stop (samples, 3);
168      sample_start (samples, 3, 5, 0);
166      if (samples->playing(3))
167         samples->stop(3);
168      samples->start(3, 5);
169169   }
170170}
171171
172172WRITE8_HANDLER( elim2_sh_w )
173173{
174   device_t *samples = space->machine().device("samples");
174   samples_device *samples = space->machine().device<samples_device>("samples");
175175   data ^= 0xff;
176176
177177   /* Play thrust sample */
178178   if (data & 0x0f)
179      sample_start (samples, 4, 6, 0);
179      samples->start(4, 6);
180180   else
181      sample_stop (samples, 4);
181      samples->stop(4);
182182
183183   /* Play skitter sample */
184184   if (data & 0x10)
185      sample_start (samples, 5, 2, 0);
185      samples->start(5, 2);
186186
187187   /* Play eliminator sample */
188188   if (data & 0x20)
189      sample_start (samples, 6, 3, 0);
189      samples->start(6, 3);
190190
191191   /* Play electron samples */
192192   if (data & 0x40)
193      sample_start (samples, 7, 7, 0);
193      samples->start(7, 7);
194194   if (data & 0x80)
195      sample_start (samples, 7, 4, 0);
195      samples->start(7, 4);
196196}
197197
198198
199199WRITE8_HANDLER( zektor1_sh_w )
200200{
201   device_t *samples = space->machine().device("samples");
201   samples_device *samples = space->machine().device<samples_device>("samples");
202202
203203   data ^= 0xff;
204204
205205   /* Play fireball sample */
206206   if (data & 0x02)
207                sample_start (samples, 0, 0, 0);
207                samples->start(0, 0);
208208
209209   /* Play explosion samples */
210210   if (data & 0x04)
211                sample_start (samples, 1, 10, 0);
211                samples->start(1, 10);
212212   if (data & 0x08)
213                  sample_start (samples, 1, 9, 0);
213                  samples->start(1, 9);
214214   if (data & 0x10)
215                  sample_start (samples, 1, 8, 0);
215                  samples->start(1, 8);
216216
217217   /* Play bounce sample */
218218   if (data & 0x20)
219219   {
220                if (sample_playing(samples, 2))
221                        sample_stop (samples, 2);
222                sample_start (samples, 2, 1, 0);
220                if (samples->playing(2))
221                        samples->stop(2);
222                samples->start(2, 1);
223223   }
224224
225225   /* Play lazer sample */
226226   if (data & 0xc0)
227227   {
228      if (sample_playing(samples, 3))
229         sample_stop (samples, 3);
230                sample_start (samples, 3, 5, 0);
228      if (samples->playing(3))
229         samples->stop(3);
230                samples->start(3, 5);
231231   }
232232}
233233
234234WRITE8_HANDLER( zektor2_sh_w )
235235{
236   device_t *samples = space->machine().device("samples");
236   samples_device *samples = space->machine().device<samples_device>("samples");
237237   data ^= 0xff;
238238
239239   /* Play thrust sample */
240240   if (data & 0x0f)
241            sample_start (samples, 4, 6, 0);
241            samples->start(4, 6);
242242   else
243      sample_stop (samples, 4);
243      samples->stop(4);
244244
245245   /* Play skitter sample */
246246   if (data & 0x10)
247                sample_start (samples, 5, 2, 0);
247                samples->start(5, 2);
248248
249249   /* Play eliminator sample */
250250   if (data & 0x20)
251                sample_start (samples, 6, 3, 0);
251                samples->start(6, 3);
252252
253253   /* Play electron samples */
254254   if (data & 0x40)
255                sample_start (samples, 7, 40, 0);
255                samples->start(7, 40);
256256   if (data & 0x80)
257                sample_start (samples, 7, 41, 0);
257                samples->start(7, 41);
258258}
259259
260260
261261
262262WRITE8_HANDLER( spacfury1_sh_w )
263263{
264   device_t *samples = space->machine().device("samples");
264   samples_device *samples = space->machine().device<samples_device>("samples");
265265   data ^= 0xff;
266266
267267   /* craft growing */
268268   if (data & 0x01)
269      sample_start (samples, 1, 0, 0);
269      samples->start(1, 0);
270270
271271   /* craft moving */
272272   if (data & 0x02)
273273   {
274      if (!sample_playing(samples, 2))
275         sample_start (samples, 2, 1, 1);
274      if (!samples->playing(2))
275         samples->start(2, 1, true);
276276   }
277277   else
278      sample_stop (samples, 2);
278      samples->stop(2);
279279
280280   /* Thrust */
281281   if (data & 0x04)
282282   {
283      if (!sample_playing(samples, 3))
284         sample_start (samples, 3, 4, 1);
283      if (!samples->playing(3))
284         samples->start(3, 4, true);
285285   }
286286   else
287      sample_stop (samples, 3);
287      samples->stop(3);
288288
289289   /* star spin */
290290   if (data & 0x40)
291      sample_start (samples, 4, 8, 0);
291      samples->start(4, 8);
292292
293293   /* partial warship? */
294294   if (data & 0x80)
295      sample_start (samples, 4, 9, 0);
295      samples->start(4, 9);
296296
297297}
298298
299299WRITE8_HANDLER( spacfury2_sh_w )
300300{
301   device_t *samples = space->machine().device("samples");
301   samples_device *samples = space->machine().device<samples_device>("samples");
302302   data ^= 0xff;
303303
304304   /* craft joining */
305305   if (data & 0x01)
306      sample_start (samples, 5, 2, 0);
306      samples->start(5, 2);
307307
308308   /* ship firing */
309309   if (data & 0x02)
310310   {
311      if (sample_playing(samples, 6))
312         sample_stop(samples, 6);
313      sample_start(samples, 6, 3, 0);
311      if (samples->playing(6))
312         samples->stop(6);
313      samples->start(6, 3);
314314
315315   }
316316
317317   /* fireball */
318318   if (data & 0x04)
319      sample_start (samples, 7, 6, 0);
319      samples->start(7, 6);
320320
321321   /* small explosion */
322322   if (data & 0x08)
323      sample_start (samples, 7, 6, 0);
323      samples->start(7, 6);
324324   /* large explosion */
325325   if (data & 0x10)
326      sample_start (samples, 7, 5, 0);
326      samples->start(7, 5);
327327
328328   /* docking bang */
329329   if (data & 0x20)
330      sample_start (samples, 0, 7, 0);
330      samples->start(0, 7);
331331
332332}
333333
src/mame/audio/gottlieb.c
r14521r14522
3131
3232static void gottlieb1_sh_w(device_t *riot, UINT8 data);
3333static void gottlieb2_sh_w(address_space *space, UINT8 data);
34static void trigger_sample(device_t *samples, UINT8 data);
34static void trigger_sample(samples_device *samples, UINT8 data);
3535
3636
3737
r14521r14522
6262
6363static void gottlieb1_sh_w(device_t *riot, UINT8 data)
6464{
65   device_t *samples = riot->machine().device("samples");
65   samples_device *samples = riot->machine().device<samples_device>("samples");
6666   int pa7 = (data & 0x0f) != 0xf;
6767   int pa0_5 = ~data & 0x3f;
6868
r14521r14522
112112 *
113113 *************************************/
114114
115static void play_sample(device_t *samples, const char *phonemes)
115static void play_sample(samples_device *samples, const char *phonemes)
116116{
117117   if (strcmp(phonemes, "[0] HEH3LOOW     AH1EH3I3YMTERI2NDAHN") == 0)     /* Q-Bert - Hello, I am turned on */
118      sample_start(samples, 0, 42, 0);
118      samples->start(0, 42);
119119   else if (strcmp(phonemes, "[0]BAH1EH1Y") == 0)                       /* Q-Bert - Bye, bye */
120      sample_start(samples, 0, 43, 0);
120      samples->start(0, 43);
121121   else if (strcmp(phonemes, "[0]A2YHT LEH2FTTH") == 0)                 /* Reactor - Eight left */
122      sample_start(samples, 0, 0, 0);
122      samples->start(0, 0);
123123   else if (strcmp(phonemes, "[0]SI3KS DTYN LEH2FTTH") == 0)              /* Reactor - Sixteen left */
124      sample_start(samples, 0, 1, 0);
124      samples->start(0, 1);
125125   else if (strcmp(phonemes, "[0]WO2RNYNG KO2R UH1NSDTABUH1L") == 0)        /* Reactor - Warning core unstable */
126      sample_start(samples, 0, 5, 0);
126      samples->start(0, 5);
127127   else if (strcmp(phonemes, "[0]CHAMBERR   AE1EH2KTI1VA1I3DTEH1DT ") == 0) /* Reactor - Chamber activated */
128      sample_start(samples, 0, 7, 0);
128      samples->start(0, 7);
129129}
130130
131131
132static void trigger_sample(device_t *samples, UINT8 data)
132static void trigger_sample(samples_device *samples, UINT8 data)
133133{
134134   gottlieb_state *state = samples->machine().driver_data<gottlieb_state>();
135135   /* Reactor samples */
r14521r14522
141141         case 56:
142142         case 57:
143143         case 59:
144            sample_start(samples, 0, data - 53, 0);
144            samples->start(0, data - 53);
145145            break;
146146
147147         case 31:
r14521r14522
151151         case 39:
152152            state->m_score_sample++;
153153            if (state->m_score_sample < 20)
154               sample_start(samples, 0, state->m_score_sample, 0);
154               samples->start(0, state->m_score_sample);
155155            break;
156156      }
157157   }
r14521r14522
166166         case 19:
167167         case 20:
168168         case 21:
169            sample_start(samples, 0, (data - 17) * 8 + state->m_random_offset, 0);
169            samples->start(0, (data - 17) * 8 + state->m_random_offset);
170170            state->m_random_offset = (state->m_random_offset + 1) & 7;
171171            break;
172172
173173         case 22:
174            sample_start(samples, 0,40,0);
174            samples->start(0,40);
175175            break;
176176
177177         case 23:
178            sample_start(samples, 0,41,0);
178            samples->start(0,41);
179179            break;
180180      }
181181   }
r14521r14522
185185#ifdef UNUSED_FUNCTION
186186void gottlieb_knocker(running_machine &machine)
187187{
188   device_t *samples = space->machine().device("samples");
188   samples_device *samples = space->machine().device<samples_device>("samples");
189189   if (!strcmp(machine.system().name,"reactor"))   /* reactor */
190190   {
191191   }
192192   else if (samples != NULL)   /* qbert */
193      sample_start(samples, 0,44,0);
193      samples->start(0,44);
194194}
195195#endif
196196
r14521r14522
234234   {
235235      if (state->m_votrax_queuepos > 1)
236236      {
237         device_t *samples = space->machine().device("samples");
237         samples_device *samples = space->machine().device<samples_device>("samples");
238238         int last = -1;
239239         int i;
240240         char phonemes[200];
src/mame/audio/8080bw.c
r14521r14522
3838
3939   sn76477_enable_w(state->m_sn, !(data & 0x01));         /* SAUCER SOUND */
4040
41   if (rising_bits & 0x02) sample_start(state->m_samples, 0, 0, 0);      /* MISSLE SOUND */
42   if (rising_bits & 0x04) sample_start(state->m_samples, 1, 1, 0);      /* EXPLOSION */
43   if (rising_bits & 0x08) sample_start(state->m_samples, 2, 2, 0);      /* INVADER HIT */
44   if (rising_bits & 0x10) sample_start(state->m_samples, 5, 8, 0);      /* BONUS MISSILE BASE */
41   if (rising_bits & 0x02) state->m_samples->start(0, 0);      /* MISSLE SOUND */
42   if (rising_bits & 0x04) state->m_samples->start(1, 1);      /* EXPLOSION */
43   if (rising_bits & 0x08) state->m_samples->start(2, 2);      /* INVADER HIT */
44   if (rising_bits & 0x10) state->m_samples->start(5, 8);      /* BONUS MISSILE BASE */
4545
4646   state->m_screen_red = data & 0x04;
4747
r14521r14522
6363   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
6464   UINT8 rising_bits = data & ~state->m_port_2_last_extra;
6565
66   if (rising_bits & 0x01) sample_start(state->m_samples, 4, 3, 0);      /* FLEET */
67   if (rising_bits & 0x02) sample_start(state->m_samples, 4, 4, 0);      /* FLEET */
68   if (rising_bits & 0x04) sample_start(state->m_samples, 4, 5, 0);      /* FLEET */
69   if (rising_bits & 0x08) sample_start(state->m_samples, 4, 6, 0);      /* FLEET */
70   if (rising_bits & 0x10) sample_start(state->m_samples, 3, 7, 0);      /* SAUCER HIT */
66   if (rising_bits & 0x01) state->m_samples->start(4, 3);      /* FLEET */
67   if (rising_bits & 0x02) state->m_samples->start(4, 4);      /* FLEET */
68   if (rising_bits & 0x04) state->m_samples->start(4, 5);      /* FLEET */
69   if (rising_bits & 0x08) state->m_samples->start(4, 6);      /* FLEET */
70   if (rising_bits & 0x10) state->m_samples->start(3, 7);      /* SAUCER HIT */
7171
7272   state->m_c8080bw_flip_screen = data & 0x20;
7373
r14521r14522
8888
8989   sn76477_enable_w(state->m_sn, !(data & 0x01));         /* Saucer Sound */
9090
91   if (rising_bits & 0x02) sample_start(state->m_samples, 0, 0, 0);      /* Shot Sound */
92   if (rising_bits & 0x04) sample_start(state->m_samples, 1, 1, 0);      /* Base Hit */
93   if (rising_bits & 0x08) sample_start(state->m_samples, 2, 2, 0);      /* Invader Hit */
91   if (rising_bits & 0x02) state->m_samples->start(0, 0);      /* Shot Sound */
92   if (rising_bits & 0x04) state->m_samples->start(1, 1);      /* Base Hit */
93   if (rising_bits & 0x08) state->m_samples->start(2, 2);      /* Invader Hit */
9494
9595   speaker_level_w(state->m_speaker, (data & 0x10) ? 1 : 0);      /* Various bitstream tunes */
9696
r14521r14522
130130   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
131131   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
132132
133   if (rising_bits & 0x01) sample_start(state->m_samples, 0, 3, 0);      /* Thrust */
134   if (rising_bits & 0x02) sample_start(state->m_samples, 1, 2, 0);      /* Shot Sound */
135   if (rising_bits & 0x04) sample_start(state->m_samples, 0, 1, 0);      /* Death */
136   if (rising_bits & 0x08) sample_start(state->m_samples, 1, 0, 0);      /* Alien Hit */
137   if (rising_bits & 0x10) sample_start(state->m_samples, 2, 5, 0);      /* Bonus Ship (not confirmed) */
133   if (rising_bits & 0x01) state->m_samples->start(0, 3);      /* Thrust */
134   if (rising_bits & 0x02) state->m_samples->start(1, 2);      /* Shot Sound */
135   if (rising_bits & 0x04) state->m_samples->start(0, 1);      /* Death */
136   if (rising_bits & 0x08) state->m_samples->start(1, 0);      /* Alien Hit */
137   if (rising_bits & 0x10) state->m_samples->start(2, 5);      /* Bonus Ship (not confirmed) */
138138
139139   space->machine().sound().system_enable(data & 0x20);
140140
r14521r14522
148148   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
149149   UINT8 rising_bits = data & ~state->m_port_2_last_extra;
150150
151   if (rising_bits & 0x01) sample_start(state->m_samples, 1, 8, 0);      /* Footstep high tone */
152   if (rising_bits & 0x02) sample_start(state->m_samples, 1, 7, 0);      /* Footstep low tone */
153   if (rising_bits & 0x04) sample_start(state->m_samples, 1, 4, 0);      /* Bonus when counting men saved */
151   if (rising_bits & 0x01) state->m_samples->start(1, 8);      /* Footstep high tone */
152   if (rising_bits & 0x02) state->m_samples->start(1, 7);      /* Footstep low tone */
153   if (rising_bits & 0x04) state->m_samples->start(1, 4);      /* Bonus when counting men saved */
154154
155155   speaker_level_w(state->m_speaker, (data & 0x08) ? 1 : 0);      /* Bitstream tunes - endlevel and bonus1 */
156156
157   if (rising_bits & 0x10) sample_start(state->m_samples, 3, 6, 0);      /* Shooting Star and Rescue Ship sounds */
158   if ((~data & 0x10) && (state->m_port_2_last_extra & 0x10)) sample_stop (state->m_samples, 3);   /* This makes the rescue ship sound beep on and off */
157   if (rising_bits & 0x10) state->m_samples->start(3, 6);      /* Shooting Star and Rescue Ship sounds */
158   if ((~data & 0x10) && (state->m_port_2_last_extra & 0x10)) state->m_samples->stop(3);   /* This makes the rescue ship sound beep on and off */
159159
160160   state->m_c8080bw_flip_screen = data & 0x20;
161161
r14521r14522
188188   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
189189   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
190190
191   if (rising_bits & 0x01) sample_start(state->m_samples, 1, 2, 0);      /* Hit a balloon */
192   if (rising_bits & 0x02) sample_start(state->m_samples, 2, 0, 0);      /* Shot Sound */
193   if (rising_bits & 0x04) sample_start(state->m_samples, 2, 1, 0);      /* Base Hit */
194   if (rising_bits & 0x08) sample_start(state->m_samples, 1, 7, 0);      /* Hit a Bomb */
195   if (rising_bits & 0x10) sample_start(state->m_samples, 3, 8, 0);      /* Bonus Base at 1500 points */
191   if (rising_bits & 0x01) state->m_samples->start(1, 2);      /* Hit a balloon */
192   if (rising_bits & 0x02) state->m_samples->start(2, 0);      /* Shot Sound */
193   if (rising_bits & 0x04) state->m_samples->start(2, 1);      /* Base Hit */
194   if (rising_bits & 0x08) state->m_samples->start(1, 7);      /* Hit a Bomb */
195   if (rising_bits & 0x10) state->m_samples->start(3, 8);      /* Bonus Base at 1500 points */
196196
197197   space->machine().sound().system_enable(data & 0x20);
198198
r14521r14522
206206   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
207207   UINT8 rising_bits = data & ~state->m_port_2_last_extra;
208208
209   if (data & 0x01) sample_start(state->m_samples, 0, 7, 0);      /* Indicates plane will drop bombs */
210   if (data & 0x04) sample_start(state->m_samples, 0, 4, 0);      /* Plane is dropping new balloons at start of level */
211   if (rising_bits & 0x10) sample_start(state->m_samples, 2, 2, 0);      /* Balloon hit and bomb drops */
209   if (data & 0x01) state->m_samples->start(0, 7);      /* Indicates plane will drop bombs */
210   if (data & 0x04) state->m_samples->start(0, 4);      /* Plane is dropping new balloons at start of level */
211   if (rising_bits & 0x10) state->m_samples->start(2, 2);      /* Balloon hit and bomb drops */
212212
213213   state->m_c8080bw_flip_screen = data & 0x20;
214214
r14521r14522
265265   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
266266   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
267267
268   if (rising_bits & 0x01) sample_start(state->m_samples, 1, 7, 0);      /* Death */
269   if (rising_bits & 0x02) sample_start(state->m_samples, 0, 1, 0);      /* Shot Sound */
270   if (rising_bits & 0x04) sample_start(state->m_samples, 2, 3, 0);      /* Move */
271   if (rising_bits & 0x08) sample_start(state->m_samples, 3, 2, 0);      /* Hit */
268   if (rising_bits & 0x01) state->m_samples->start(1, 7);      /* Death */
269   if (rising_bits & 0x02) state->m_samples->start(0, 1);      /* Shot Sound */
270   if (rising_bits & 0x04) state->m_samples->start(2, 3);      /* Move */
271   if (rising_bits & 0x08) state->m_samples->start(3, 2);      /* Hit */
272272
273273   space->machine().sound().system_enable(data & 0x20);
274274
r14521r14522
282282   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
283283   UINT8 rising_bits = data & ~state->m_port_2_last_extra;
284284
285   if (rising_bits & 0x01) sample_start(state->m_samples, 4, 0, 0);      /* Bird dropped an egg, Lasso used */
286   if (rising_bits & 0x02) sample_start(state->m_samples, 4, 2, 0);      /* Egg hatches, egg shot */
287   if (rising_bits & 0x08) sample_start(state->m_samples, 5, 0, 0);      /* Grabber, Lasso caught something */
288   if (rising_bits & 0x10) sample_start(state->m_samples, 3, 7, 0);      /* Lasso sound */
285   if (rising_bits & 0x01) state->m_samples->start(4, 0);      /* Bird dropped an egg, Lasso used */
286   if (rising_bits & 0x02) state->m_samples->start(4, 2);      /* Egg hatches, egg shot */
287   if (rising_bits & 0x08) state->m_samples->start(5, 0);      /* Grabber, Lasso caught something */
288   if (rising_bits & 0x10) state->m_samples->start(3, 7);      /* Lasso sound */
289289
290290   state->m_port_2_last_extra = data;
291291}
r14521r14522
954954   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
955955   UINT8 rising_bits = data & ~state->m_port_3_last_extra;
956956
957   if (rising_bits & 0x02) sample_start(state->m_samples, 4, 0, 0);   /* Steering */
958   if (rising_bits & 0x04) sample_start(state->m_samples, 0, 1, 0);   /* Collision */
959   if (rising_bits & 0x10) sample_start(state->m_samples, 1, 8, 0);   /* Computer car is starting to move */
957   if (rising_bits & 0x02) state->m_samples->start(4, 0);   /* Steering */
958   if (rising_bits & 0x04) state->m_samples->start(0, 1);   /* Collision */
959   if (rising_bits & 0x10) state->m_samples->start(1, 8);   /* Computer car is starting to move */
960960
961961   state->m_port_3_last_extra = data;
962962}
r14521r14522
980980   switch (data)
981981   {
982982      case 0x06:
983         sample_start(state->m_samples, 1, 0, 0);            /* Shoot */
983         state->m_samples->start(1, 0);            /* Shoot */
984984         break;
985985
986986      case 0x14:
987         sample_start(state->m_samples, 2, 2, 0);            /* Hit Alien */
987         state->m_samples->start(2, 2);            /* Hit Alien */
988988         break;
989989
990990      case 0x16:
991         sample_start(state->m_samples, 2, 5, 0);            /* Hit Asteroid */
991         state->m_samples->start(2, 5);            /* Hit Asteroid */
992992         break;
993993
994994      case 0x1e:
995         sample_start(state->m_samples, 3, 1, 0);            /* Death (followed by 0x0a byte), also bit 4 of port 5 */
995         state->m_samples->start(3, 1);            /* Death (followed by 0x0a byte), also bit 4 of port 5 */
996996         break;
997997
998998      case 0x18:                  /* Fuel Low */
999999      case 0x30:                  /* Fuel bar filling up */
1000         sample_start(state->m_samples, 4, 7, 0);
1000         state->m_samples->start(4, 7);
10011001         break;
10021002
10031003      case 0x02:                  /* Coin */
r14521r14522
10071007         break;
10081008
10091009      case 0x3a:                  /* Thrust, Docking, extra ship? */
1010         sample_start(state->m_samples, 0, 8, 0);
1010         state->m_samples->start(0, 8);
10111011         break;
10121012   }
10131013}
r14521r14522
10231023   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
10241024   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
10251025
1026   if (rising_bits & 0x01) sample_start(state->m_samples, 0, 6, 0);      /* Walking, get money */
1026   if (rising_bits & 0x01) state->m_samples->start(0, 6);      /* Walking, get money */
10271027
10281028   sn76477_enable_w(state->m_sn, data & 0x02 ? 0:1);         /* Helicopter */
10291029
1030   if (rising_bits & 0x04) sample_start(state->m_samples, 0, 7, 0);      /* Translocate */
1031   if (rising_bits & 0x08) sample_start(state->m_samples, 0, 1, 0);      /* Jail */
1032   if (rising_bits & 0x10) sample_start(state->m_samples, 3, 8, 0);      /* Bonus Man */
1030   if (rising_bits & 0x04) state->m_samples->start(0, 7);      /* Translocate */
1031   if (rising_bits & 0x08) state->m_samples->start(0, 1);      /* Jail */
1032   if (rising_bits & 0x10) state->m_samples->start(3, 8);      /* Bonus Man */
10331033
10341034   state->m_port_1_last_extra = data;
10351035}
r14521r14522
10391039   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
10401040   UINT8 rising_bits = data & ~state->m_port_2_last_extra;
10411041
1042   if (rising_bits & 0x01) sample_start(state->m_samples, 0, 3, 0);      /* Lands on top of building, wife kicks man */
1043   if (rising_bits & 0x02) sample_start(state->m_samples, 1, 2, 0);      /* deposit money, start intermission, end game */
1044   if (rising_bits & 0x04) sample_start(state->m_samples, 2, 5, 0);      /* deposit money, start intermission, Slides down rope */
1045   if (rising_bits & 0x08) sample_start(state->m_samples, 3, 0, 0);      /* start intermission, end game */
1046   //if (rising_bits & 0x10) sample_start(state->m_samples, 3, 9, 0);        /* Dog barking */
1042   if (rising_bits & 0x01) state->m_samples->start(0, 3);      /* Lands on top of building, wife kicks man */
1043   if (rising_bits & 0x02) state->m_samples->start(1, 2);      /* deposit money, start intermission, end game */
1044   if (rising_bits & 0x04) state->m_samples->start(2, 5);      /* deposit money, start intermission, Slides down rope */
1045   if (rising_bits & 0x08) state->m_samples->start(3, 0);      /* start intermission, end game */
1046   //if (rising_bits & 0x10) state->m_samples->start(3, 9);        /* Dog barking */
10471047
10481048   state->m_color_map = data & 0x40;
10491049
r14521r14522
10681068   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
10691069   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
10701070
1071   if (rising_bits & 0x02) sample_start(state->m_samples, 1, 6, 0);      /* Ran over a dot */
1072   if (rising_bits & 0x10) sample_start(state->m_samples, 0, 1, 0);      /* Death */
1071   if (rising_bits & 0x02) state->m_samples->start(1, 6);      /* Ran over a dot */
1072   if (rising_bits & 0x10) state->m_samples->start(0, 1);      /* Death */
10731073
10741074   state->m_port_1_last_extra = data;
10751075}
r14521r14522
10961096   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
10971097   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
10981098
1099   if (rising_bits & 0x01) sample_start(state->m_samples, 0, 3, 0);         /* Game Over */
1100   if (rising_bits & 0x02) sample_start(state->m_samples, 2, 0, 0);         /* Bird dead */
1101   if (rising_bits & 0x04) sample_start(state->m_samples, 0, 1, 0);         /* Rifle being fired */
1102   if (rising_bits & 0x08) sample_start(state->m_samples, 1, 2, 0);         /* Man dead */
1103   if (rising_bits & 0x10) sample_start(state->m_samples, 5, 8, 0);         /* Bonus Man? */
1099   if (rising_bits & 0x01) state->m_samples->start(0, 3);         /* Game Over */
1100   if (rising_bits & 0x02) state->m_samples->start(2, 0);         /* Bird dead */
1101   if (rising_bits & 0x04) state->m_samples->start(0, 1);         /* Rifle being fired */
1102   if (rising_bits & 0x08) state->m_samples->start(1, 2);         /* Man dead */
1103   if (rising_bits & 0x10) state->m_samples->start(5, 8);         /* Bonus Man? */
11041104
11051105   space->machine().sound().system_enable(data & 0x20);
11061106
r14521r14522
11121112   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
11131113   UINT8 rising_bits = data & ~state->m_port_2_last_extra;
11141114
1115   if (rising_bits & 0x01) sample_start(state->m_samples, 1, 6, 0);         /* Ready? , Game Over */
1116   if (rising_bits & 0x04) sample_start(state->m_samples, 3, 7, 0);         /* Big bird dead */
1115   if (rising_bits & 0x01) state->m_samples->start(1, 6);         /* Ready? , Game Over */
1116   if (rising_bits & 0x04) state->m_samples->start(3, 7);         /* Big bird dead */
11171117
11181118   sn76477_enable_w(state->m_sn, data & 0x08 ? 0:1);            /* Big bird */
11191119
1120   if (rising_bits & 0x10) sample_start(state->m_samples, 2, 7, 0);         /* Game Over */
1120   if (rising_bits & 0x10) state->m_samples->start(2, 7);         /* Game Over */
11211121
11221122   state->m_c8080bw_flip_screen = data & 0x20;
11231123
r14521r14522
11361136   _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
11371137   UINT8 rising_bits = data & ~state->m_port_1_last_extra;
11381138
1139   if (rising_bits & 0x01) sample_start(state->m_samples, 4, 4, 0);         /* Fleet move */
1140   if (rising_bits & 0x02) sample_start(state->m_samples, 5, 8, 0);         /* Extra Tank */
1139   if (rising_bits & 0x01) state->m_samples->start(4, 4);         /* Fleet move */
1140   if (rising_bits & 0x02) state->m_samples->start(5, 8);         /* Extra Tank */
11411141
11421142   sn76477_enable_w(state->m_sn, data & 0x04 ? 0:1);            /* UFO */
11431143
r14521r14522
11511151   switch (data)
11521152   {
11531153      case 0x23:
1154         sample_start(state->m_samples, 2, 2, 0);            /* Hit */
1154         state->m_samples->start(2, 2);            /* Hit */
11551155         break;
11561156
11571157      case 0x2b:
1158         sample_start(state->m_samples, 0, 0, 0);            /* Shoot */
1158         state->m_samples->start(0, 0);            /* Shoot */
11591159         break;
11601160
11611161      case 0xa3:
1162         sample_start(state->m_samples, 3, 7, 0);            /* Hit UFO */
1162         state->m_samples->start(3, 7);            /* Hit UFO */
11631163         break;
11641164
11651165      case 0xab:
1166         sample_start(state->m_samples, 1, 1, 0);            /* Death */
1166         state->m_samples->start(1, 1);            /* Death */
11671167         break;
11681168   }
11691169}
src/mame/audio/targ.c
r14521r14522
4545
4646
4747
48static void adjust_sample(device_t *samples, UINT8 freq)
48static void adjust_sample(samples_device *samples, UINT8 freq)
4949{
5050   tone_freq = freq;
5151
5252   if ((tone_freq == 0xff) || (tone_freq == 0x00))
53      sample_set_volume(samples, 3, 0);
53      samples->set_volume(3, 0);
5454   else
5555   {
56      sample_set_freq(samples, 3, 1.0 * max_freq / (0xff - tone_freq));
57      sample_set_volume(samples, 3, tone_active);
56      samples->set_frequency(3, 1.0 * max_freq / (0xff - tone_freq));
57      samples->set_volume(3, tone_active);
5858   }
5959}
6060
6161
6262WRITE8_HANDLER( targ_audio_1_w )
6363{
64   device_t *samples = space->machine().device("samples");
64   samples_device *samples = space->machine().device<samples_device>("samples");
6565
6666   /* CPU music */
6767   if ((data & 0x01) != (port_1_last & 0x01))
6868      dac_data_w(space->machine().device("dac"),(data & 0x01) * 0xff);
6969
7070   /* shot */
71   if (FALLING_EDGE(0x02) && !sample_playing(samples, 0))  sample_start(samples, 0,1,0);
72   if (RISING_EDGE(0x02)) sample_stop(samples, 0);
71   if (FALLING_EDGE(0x02) && !samples->playing(0))  samples->start(0,1);
72   if (RISING_EDGE(0x02)) samples->stop(0);
7373
7474   /* crash */
7575   if (RISING_EDGE(0x20))
7676   {
7777      if (data & 0x40)
78         sample_start(samples, 1,2,0);
78         samples->start(1,2);
7979      else
80         sample_start(samples, 1,0,0);
80         samples->start(1,0);
8181   }
8282
8383   /* Sspec */
8484   if (data & 0x10)
85      sample_stop(samples, 2);
85      samples->stop(2);
8686   else
8787   {
8888      if ((data & 0x08) != (port_1_last & 0x08))
8989      {
9090         if (data & 0x08)
91            sample_start(samples, 2,3,1);
91            samples->start(2,3,true);
9292         else
93            sample_start(samples, 2,4,1);
93            samples->start(2,4,true);
9494      }
9595   }
9696
r14521r14522
114114{
115115   if ((data & 0x01) && !(port_2_last & 0x01))
116116   {
117      device_t *samples = space->machine().device("samples");
117      samples_device *samples = space->machine().device<samples_device>("samples");
118118      UINT8 *prom = space->machine().region("targ")->base();
119119
120120      tone_pointer = (tone_pointer + 1) & 0x0f;
r14521r14522
128128
129129WRITE8_HANDLER( spectar_audio_2_w )
130130{
131   device_t *samples = space->machine().device("samples");
131   samples_device *samples = space->machine().device<samples_device>("samples");
132132   adjust_sample(samples, data);
133133}
134134
r14521r14522
147147
148148static void common_audio_start(running_machine &machine, int freq)
149149{
150   device_t *samples = machine.device("samples");
150   samples_device *samples = machine.device<samples_device>("samples");
151151   max_freq = freq;
152152
153153   tone_freq = 0;
154154   tone_active = 0;
155155
156   sample_set_volume(samples, 3, 0);
157   sample_start_raw(samples, 3, sine_wave, 32, 1000, 1);
156   samples->set_volume(3, 0);
157   samples->start_raw(3, sine_wave, 32, 1000, true);
158158
159159   state_save_register_global(machine, port_1_last);
160160   state_save_register_global(machine, port_2_last);
r14521r14522
165165
166166static SAMPLES_START( spectar_audio_start )
167167{
168   running_machine &machine = device->machine();
169   common_audio_start(machine, SPECTAR_MAXFREQ);
168   common_audio_start(device.machine(), SPECTAR_MAXFREQ);
170169}
171170
172171
173172static SAMPLES_START( targ_audio_start )
174173{
175   running_machine &machine = device->machine();
174   running_machine &machine = device.machine();
176175   common_audio_start(machine, TARG_MAXFREQ);
177176
178177   tone_pointer = 0;
r14521r14522
201200
202201   MCFG_SPEAKER_STANDARD_MONO("mono")
203202
204   MCFG_SOUND_ADD("samples", SAMPLES, 0)
205   MCFG_SOUND_CONFIG(spectar_samples_interface)
203   MCFG_SAMPLES_ADD("samples", spectar_samples_interface)
206204   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
207205
208206   MCFG_SOUND_ADD("dac", DAC, 0)
r14521r14522
214212
215213   MCFG_SPEAKER_STANDARD_MONO("mono")
216214
217   MCFG_SOUND_ADD("samples", SAMPLES, 0)
218   MCFG_SOUND_CONFIG(targ_samples_interface)
215   MCFG_SAMPLES_ADD("samples", targ_samples_interface)
219216   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
220217
221218   MCFG_SOUND_ADD("dac", DAC, 0)
src/mame/audio/invinco.c
r14521r14522
1515#define OUT_PORT_2_SHIPHIT      0x80
1616
1717
18#define PLAY(samp,id,loop)      sample_start( samp, id, id, loop )
19#define STOP(samp,id)           sample_stop( samp, id )
18#define PLAY(samp,id,loop)      samp->start( id, id, loop )
19#define STOP(samp,id)           samp->stop( id )
2020
2121
2222/* sample file names */
r14521r14522
4343
4444
4545MACHINE_CONFIG_FRAGMENT( invinco_audio )
46   MCFG_SOUND_ADD("samples", SAMPLES, 0)
47   MCFG_SOUND_CONFIG(invinco_samples_interface)
46   MCFG_SAMPLES_ADD("samples", invinco_samples_interface)
4847   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
4948MACHINE_CONFIG_END
5049
r14521r14522
6665WRITE8_HANDLER( invinco_audio_w )
6766{
6867   static int port2State = 0;
69   device_t *samples = space->machine().device("samples");
68   samples_device *samples = space->machine().device<samples_device>("samples");
7069   int bitsChanged;
7170   //int bitsGoneHigh;
7271   int bitsGoneLow;
src/mame/audio/pulsar.c
r14521r14522
2828#define OUT_PORT_2_MOVMAZE      0x10
2929
3030
31#define PLAY(samp,id,loop)           sample_start( samp, id, id, loop )
32#define STOP(samp,id)                sample_stop( samp, id )
31#define PLAY(samp,id,loop)           samp->start( id, id, loop )
32#define STOP(samp,id)                samp->stop( id )
3333
3434
3535/* sample file names */
r14521r14522
6060
6161
6262MACHINE_CONFIG_FRAGMENT( pulsar_audio )
63   MCFG_SOUND_ADD("samples", SAMPLES, 0)
64   MCFG_SOUND_CONFIG(pulsar_samples_interface)
63   MCFG_SAMPLES_ADD("samples", pulsar_samples_interface)
6564   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
6665MACHINE_CONFIG_END
6766
r14521r14522
8887
8988WRITE8_HANDLER( pulsar_audio_1_w )
9089{
91   device_t *samples = space->machine().device("samples");
90   samples_device *samples = space->machine().device<samples_device>("samples");
9291   int bitsChanged;
9392   //int bitsGoneHigh;
9493   int bitsGoneLow;
r14521r14522
139138
140139WRITE8_HANDLER( pulsar_audio_2_w )
141140{
142   device_t *samples = space->machine().device("samples");
141   samples_device *samples = space->machine().device<samples_device>("samples");
143142   static int port2State = 0;
144143   int bitsChanged;
145144   int bitsGoneHigh;
r14521r14522
159158
160159   if ( bitsGoneLow & OUT_PORT_2_GATE )
161160   {
162      sample_start( samples, SND_CLANG, SND_GATE, 0 );
161      samples->start(SND_CLANG, SND_GATE);
163162   }
164163   if ( bitsGoneHigh & OUT_PORT_2_GATE )
165164   {
src/mame/audio/wow.c
r14521r14522
103103READ8_HANDLER( wow_speech_r )
104104{
105105   astrocde_state *state = space->machine().driver_data<astrocde_state>();
106   device_t *samples = space->machine().device("samples");
106   samples_device *samples = space->machine().device<samples_device>("samples");
107107   int Phoneme/*, Intonation*/;
108108   int i = 0;
109109   UINT8 data = offset >> 8;
r14521r14522
117117   //logerror("Data : %d Speech : %s at intonation %d\n",Phoneme, PhonemeTable[Phoneme],Intonation);
118118
119119   if(Phoneme==63) {
120      sample_stop(samples, 0);
120      samples->stop(0);
121121      //logerror("Clearing sample %s\n",state->m_totalword);
122122      state->m_totalword[0] = 0;               /* Clear the total word stack */
123123      return data;
r14521r14522
132132      if (state->m_plural != 0) {
133133         //logerror("found a possible plural at %d\n",state->m_plural-1);
134134         if (!strcmp("S",state->m_totalword)) {         /* Plural check */
135            sample_start(samples, 0, num_samples-2, 0);      /* play the sample at position of word */
136            sample_set_freq(samples, 0, 11025);    /* play at correct rate */
135            samples->start(0, num_samples-2);      /* play the sample at position of word */
136            samples->set_frequency(0, 11025);    /* play at correct rate */
137137            state->m_totalword[0] = 0;               /* Clear the total word stack */
138138            state->m_oldword[0] = 0;               /* Clear the total word stack */
139139            return data;
r14521r14522
156156         } else {
157157            state->m_plural=0;
158158         }
159         sample_start(samples, 0, i, 0);                      /* play the sample at position of word */
160         sample_set_freq(samples, 0, 11025);         /* play at correct rate */
159         samples->start(0, i);                      /* play the sample at position of word */
160         samples->set_frequency(0, 11025);         /* play at correct rate */
161161         //logerror("Playing sample %d\n",i);
162162         state->m_totalword[0] = 0;               /* Clear the total word stack */
163163         return data;
r14521r14522
171171
172172CUSTOM_INPUT( wow_speech_status_r )
173173{
174   device_t *samples = field.machine().device("samples");
175   return !sample_playing(samples, 0);
174   samples_device *samples = field.machine().device<samples_device>("samples");
175   return !samples->playing(0);
176176}
src/mame/audio/cinemat.c
r14521r14522
143143
144144static void spacewar_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
145145{
146   device_t *samples = machine.device("samples");
146   samples_device *samples = machine.device<samples_device>("samples");
147147
148148   /* Explosion - rising edge */
149149   if (SOUNDVAL_RISING_EDGE(0x01))
150      sample_start(samples, 0, (machine.rand() & 1) ? 0 : 6, 0);
150      samples->start(0, (machine.rand() & 1) ? 0 : 6);
151151
152152   /* Fire sound - rising edge */
153153   if (SOUNDVAL_RISING_EDGE(0x02))
154      sample_start(samples, 1, (machine.rand() & 1) ? 1 : 7, 0);
154      samples->start(1, (machine.rand() & 1) ? 1 : 7);
155155
156156   /* Player 1 thrust - 0=on, 1=off */
157157   if (SOUNDVAL_FALLING_EDGE(0x04))
158      sample_start(samples, 3, 3, 1);
158      samples->start(3, 3, true);
159159   if (SOUNDVAL_RISING_EDGE(0x04))
160      sample_stop(samples, 3);
160      samples->stop(3);
161161
162162   /* Player 2 thrust - 0=on, 1-off */
163163   if (SOUNDVAL_FALLING_EDGE(0x08))
164      sample_start(samples, 4, 4, 1);
164      samples->start(4, 4, true);
165165   if (SOUNDVAL_RISING_EDGE(0x08))
166      sample_stop(samples, 4);
166      samples->stop(4);
167167
168168   /* Mute - 0=off, 1=on */
169169   if (SOUNDVAL_FALLING_EDGE(0x10))
170      sample_start(samples, 2, 2, 1);   /* play idle sound */
170      samples->start(2, 2, true);   /* play idle sound */
171171   if (SOUNDVAL_RISING_EDGE(0x10))
172172   {
173173        int i;
r14521r14522
175175      /* turn off all but the idle sound */
176176      for (i = 0; i < 5; i++)
177177         if (i != 2)
178            sample_stop(samples, i);
178            samples->stop(i);
179179
180180      /* Pop when board is shut off */
181      sample_start(samples, 2, 5, 0);
181      samples->start(2, 5);
182182   }
183183}
184184
r14521r14522
193193
194194   MCFG_SPEAKER_STANDARD_MONO("mono")
195195
196   MCFG_SOUND_ADD("samples", SAMPLES, 0)
197   MCFG_SOUND_CONFIG(spacewar_samples_interface)
196   MCFG_SAMPLES_ADD("samples", spacewar_samples_interface)
198197   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
199198MACHINE_CONFIG_END
200199
r14521r14522
223222
224223static void barrier_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
225224{
226   device_t *samples = machine.device("samples");
225   samples_device *samples = machine.device<samples_device>("samples");
227226
228227   /* Player die - rising edge */
229228   if (SOUNDVAL_RISING_EDGE(0x01))
230      sample_start(samples, 0, 0, 0);
229      samples->start(0, 0);
231230
232231   /* Player move - falling edge */
233232   if (SOUNDVAL_FALLING_EDGE(0x02))
234      sample_start(samples, 1, 1, 0);
233      samples->start(1, 1);
235234
236235   /* Enemy move - falling edge */
237236   if (SOUNDVAL_FALLING_EDGE(0x04))
238      sample_start(samples, 2, 2, 0);
237      samples->start(2, 2);
239238}
240239
241240static MACHINE_RESET( barrier )
r14521r14522
249248
250249   MCFG_SPEAKER_STANDARD_MONO("mono")
251250
252   MCFG_SOUND_ADD("samples", SAMPLES, 0)
253   MCFG_SOUND_CONFIG(barrier_samples_interface)
251   MCFG_SAMPLES_ADD("samples", barrier_samples_interface)
254252   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
255253MACHINE_CONFIG_END
256254
r14521r14522
278276static void speedfrk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
279277{
280278   cinemat_state *state = machine.driver_data<cinemat_state>();
281   device_t *samples = machine.device("samples");
279   samples_device *samples = machine.device<samples_device>("samples");
282280
283281   /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
284282   if (SOUNDVAL_FALLING_EDGE(0x08))
r14521r14522
292290
293291   /* off-road - 1=on, 0=off */
294292   if (SOUNDVAL_RISING_EDGE(0x10))
295      sample_start(samples, 0, 0, 1);
293      samples->start(0, 0, true);
296294   if (SOUNDVAL_FALLING_EDGE(0x10))
297      sample_stop(samples, 0);
295      samples->stop(0);
298296
299297    /* start LED is controlled by bit 0x02 */
300298    set_led_status(machine, 0, ~sound_val & 0x02);
r14521r14522
311309
312310   MCFG_SPEAKER_STANDARD_MONO("mono")
313311
314   MCFG_SOUND_ADD("samples", SAMPLES, 0)
315   MCFG_SOUND_CONFIG(speedfrk_samples_interface)
312   MCFG_SAMPLES_ADD("samples", speedfrk_samples_interface)
316313   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
317314MACHINE_CONFIG_END
318315
r14521r14522
344341
345342static void starhawk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
346343{
347   device_t *samples = machine.device("samples");
344   samples_device *samples = machine.device<samples_device>("samples");
348345
349346   /* explosion - falling edge */
350347   if (SOUNDVAL_FALLING_EDGE(0x01))
351      sample_start(samples, 0, 0, 0);
348      samples->start(0, 0);
352349
353350   /* right laser - falling edge */
354351   if (SOUNDVAL_FALLING_EDGE(0x02))
355      sample_start(samples, 1, 1, 0);
352      samples->start(1, 1);
356353
357354   /* left laser - falling edge */
358355   if (SOUNDVAL_FALLING_EDGE(0x04))
359      sample_start(samples, 2, 2, 0);
356      samples->start(2, 2);
360357
361358   /* K - 0=on, 1=off */
362359   if (SOUNDVAL_FALLING_EDGE(0x08))
363      sample_start(samples, 3, 3, 1);
360      samples->start(3, 3, true);
364361   if (SOUNDVAL_RISING_EDGE(0x08))
365      sample_stop(samples, 3);
362      samples->stop(3);
366363
367364   /* master - 0=on, 1=off */
368365   if (SOUNDVAL_FALLING_EDGE(0x10))
369      sample_start(samples, 4, 4, 1);
366      samples->start(4, 4, true);
370367   if (SOUNDVAL_RISING_EDGE(0x10))
371      sample_stop(samples, 4);
368      samples->stop(4);
372369
373370   /* K exit - 1=on, 0=off */
374371   if (SOUNDVAL_RISING_EDGE(0x80))
375      sample_start(samples, 3, 5, 1);
372      samples->start(3, 5, true);
376373   if (SOUNDVAL_FALLING_EDGE(0x80))
377      sample_stop(samples, 3);
374      samples->stop(3);
378375}
379376
380377static MACHINE_RESET( starhawk )
r14521r14522
388385
389386   MCFG_SPEAKER_STANDARD_MONO("mono")
390387
391   MCFG_SOUND_ADD("samples", SAMPLES, 0)
392   MCFG_SOUND_CONFIG(starhawk_samples_interface)
388   MCFG_SAMPLES_ADD("samples", starhawk_samples_interface)
393389   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
394390MACHINE_CONFIG_END
395391
r14521r14522
421417
422418static void sundance_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
423419{
424   device_t *samples = machine.device("samples");
420   samples_device *samples = machine.device<samples_device>("samples");
425421
426422   /* bong - falling edge */
427423   if (SOUNDVAL_FALLING_EDGE(0x01))
428      sample_start(samples, 0, 0, 0);
424      samples->start(0, 0);
429425
430426   /* whoosh - falling edge */
431427   if (SOUNDVAL_FALLING_EDGE(0x02))
432      sample_start(samples, 1, 1, 0);
428      samples->start(1, 1);
433429
434430   /* explosion - falling edge */
435431   if (SOUNDVAL_FALLING_EDGE(0x04))
436      sample_start(samples, 2, 2, 0);
432      samples->start(2, 2);
437433
438434   /* ping - falling edge */
439435   if (SOUNDVAL_FALLING_EDGE(0x08))
440      sample_start(samples, 3, 3, 0);
436      samples->start(3, 3);
441437
442438   /* ping - falling edge */
443439   if (SOUNDVAL_FALLING_EDGE(0x10))
444      sample_start(samples, 4, 4, 0);
440      samples->start(4, 4);
445441
446442   /* hatch - falling edge */
447443   if (SOUNDVAL_FALLING_EDGE(0x80))
448      sample_start(samples, 5, 5, 0);
444      samples->start(5, 5);
449445}
450446
451447static MACHINE_RESET( sundance )
r14521r14522
459455
460456   MCFG_SPEAKER_STANDARD_MONO("mono")
461457
462   MCFG_SOUND_ADD("samples", SAMPLES, 0)
463   MCFG_SOUND_CONFIG(sundance_samples_interface)
458   MCFG_SAMPLES_ADD("samples", sundance_samples_interface)
464459   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
465460MACHINE_CONFIG_END
466461
r14521r14522
496491   /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
497492   if (SOUNDVAL_FALLING_EDGE(0x10))
498493   {
499      device_t *samples = machine.device("samples");
494      samples_device *samples = machine.device<samples_device>("samples");
500495
501496      /* update the shift register (actually just a simple mux) */
502497      state->m_current_shift = (state->m_current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7));
503498
504499      /* explosion - falling edge */
505500      if (SHIFTREG_FALLING_EDGE(0x01))
506         sample_start(samples, 0, 0, 0);
501         samples->start(0, 0);
507502
508503      /* rumble - 0=on, 1=off */
509504      if (SHIFTREG_FALLING_EDGE(0x02))
510         sample_start(samples, 1, 1, 1);
505         samples->start(1, 1, true);
511506      if (SHIFTREG_RISING_EDGE(0x02))
512         sample_stop(samples, 1);
507         samples->stop(1);
513508
514509      /* laser - 0=on, 1=off */
515510      if (SHIFTREG_FALLING_EDGE(0x04))
516         sample_start(samples, 2, 2, 1);
511         samples->start(2, 2, true);
517512      if (SHIFTREG_RISING_EDGE(0x04))
518         sample_stop(samples, 2);
513         samples->stop(2);
519514
520515      /* shield - 0=on, 1=off */
521516      if (SHIFTREG_FALLING_EDGE(0x08))
522         sample_start(samples, 3, 3, 1);
517         samples->start(3, 3, true);
523518      if (SHIFTREG_RISING_EDGE(0x08))
524         sample_stop(samples, 3);
519         samples->stop(3);
525520
526521      /* bounce - falling edge */
527522      if (SHIFTREG_FALLING_EDGE(0x10))
528         sample_start(samples, 4, 4, 0);
523         samples->start(4, 4);
529524
530525      /* hyperspace - falling edge */
531526      if (SHIFTREG_FALLING_EDGE(0x20))
532         sample_start(samples, 5, 5, 0);
527         samples->start(5, 5);
533528
534529      /* LED */
535530      set_led_status(machine, 0, state->m_current_shift & 0x40);
r14521r14522
550545
551546   MCFG_SPEAKER_STANDARD_MONO("mono")
552547
553   MCFG_SOUND_ADD("samples", SAMPLES, 0)
554   MCFG_SOUND_CONFIG(tailg_samples_interface)
548   MCFG_SAMPLES_ADD("samples", tailg_samples_interface)
555549   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
556550MACHINE_CONFIG_END
557551
r14521r14522
582576
583577static void warrior_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
584578{
585   device_t *samples = machine.device("samples");
579   samples_device *samples = machine.device<samples_device>("samples");
586580
587581   /* normal level - 0=on, 1=off */
588582   if (SOUNDVAL_FALLING_EDGE(0x01))
589      sample_start(samples, 0, 0, 1);
583      samples->start(0, 0, true);
590584   if (SOUNDVAL_RISING_EDGE(0x01))
591      sample_stop(samples, 0);
585      samples->stop(0);
592586
593587   /* hi level - 0=on, 1=off */
594588   if (SOUNDVAL_FALLING_EDGE(0x02))
595      sample_start(samples, 1, 1, 1);
589      samples->start(1, 1, true);
596590   if (SOUNDVAL_RISING_EDGE(0x02))
597      sample_stop(samples, 1);
591      samples->stop(1);
598592
599593   /* explosion - falling edge */
600594   if (SOUNDVAL_FALLING_EDGE(0x04))
601      sample_start(samples, 2, 2, 0);
595      samples->start(2, 2);
602596
603597   /* fall - falling edge */
604598   if (SOUNDVAL_FALLING_EDGE(0x08))
605      sample_start(samples, 3, 3, 0);
599      samples->start(3, 3);
606600
607601   /* appear - falling edge */
608602   if (SOUNDVAL_FALLING_EDGE(0x10))
609      sample_start(samples, 4, 4, 0);
603      samples->start(4, 4);
610604}
611605
612606static MACHINE_RESET( warrior )
r14521r14522
620614
621615   MCFG_SPEAKER_STANDARD_MONO("mono")
622616
623   MCFG_SOUND_ADD("samples", SAMPLES, 0)
624   MCFG_SOUND_CONFIG(warrior_samples_interface)
617   MCFG_SAMPLES_ADD("samples", warrior_samples_interface)
625618   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
626619MACHINE_CONFIG_END
627620
r14521r14522
655648static void armora_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
656649{
657650   cinemat_state *state = machine.driver_data<cinemat_state>();
658   device_t *samples = machine.device("samples");
651   samples_device *samples = machine.device<samples_device>("samples");
659652
660653   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
661654   if (SOUNDVAL_RISING_EDGE(0x10))
r14521r14522
668661
669662      /* lo explosion - falling edge */
670663      if (SHIFTREG_FALLING_EDGE(0x10))
671         sample_start(samples, 0, 0, 0);
664         samples->start(0, 0);
672665
673666      /* jeep fire - falling edge */
674667      if (SHIFTREG_FALLING_EDGE(0x20))
675         sample_start(samples, 1, 1, 0);
668         samples->start(1, 1);
676669
677670      /* hi explosion - falling edge */
678671      if (SHIFTREG_FALLING_EDGE(0x40))
679         sample_start(samples, 2, 2, 0);
672         samples->start(2, 2);
680673
681674      /* tank fire - falling edge */
682675      if (SHIFTREG_FALLING_EDGE(0x80))
683         sample_start(samples, 3, 3, 0);
676         samples->start(3, 3);
684677
685678      /* remember the previous value */
686679      state->m_last_shift = state->m_current_shift;
r14521r14522
689682   /* tank sound - 0=on, 1=off */
690683   /* still not totally correct - should be multiple speeds based on remaining bits in shift reg */
691684   if (SOUNDVAL_FALLING_EDGE(0x02))
692      sample_start(samples, 4, 4, 1);
685      samples->start(4, 4, true);
693686   if (SOUNDVAL_RISING_EDGE(0x02))
694      sample_stop(samples, 4);
687      samples->stop(4);
695688
696689   /* beep sound - 0=on, 1=off */
697690   if (SOUNDVAL_FALLING_EDGE(0x04))
698      sample_start(samples, 5, 5, 1);
691      samples->start(5, 5, true);
699692   if (SOUNDVAL_RISING_EDGE(0x04))
700      sample_stop(samples, 5);
693      samples->stop(5);
701694
702695   /* chopper sound - 0=on, 1=off */
703696   if (SOUNDVAL_FALLING_EDGE(0x08))
704      sample_start(samples, 6, 6, 1);
697      samples->start(6, 6, true);
705698   if (SOUNDVAL_RISING_EDGE(0x08))
706      sample_stop(samples, 6);
699      samples->stop(6);
707700}
708701
709702static MACHINE_RESET( armora )
r14521r14522
717710
718711   MCFG_SPEAKER_STANDARD_MONO("mono")
719712
720   MCFG_SOUND_ADD("samples", SAMPLES, 0)
721   MCFG_SOUND_CONFIG(armora_samples_interface)
713   MCFG_SAMPLES_ADD("samples", armora_samples_interface)
722714   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
723715MACHINE_CONFIG_END
724716
r14521r14522
758750static void ripoff_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
759751{
760752   cinemat_state *state = machine.driver_data<cinemat_state>();
761   device_t *samples = machine.device("samples");
753   samples_device *samples = machine.device<samples_device>("samples");
762754
763755   /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
764756   if (SOUNDVAL_RISING_EDGE(0x02))
r14521r14522
769761   {
770762      /* background - 0=on, 1=off, selected by bits 0x38 */
771763      if ((((state->m_current_shift ^ state->m_last_shift) & 0x38) && !(state->m_current_shift & 0x04)) || SHIFTREG_FALLING_EDGE(0x04))
772         sample_start(samples, 5, 5 + ((state->m_current_shift >> 5) & 7), 1);
764         samples->start(5, 5 + ((state->m_current_shift >> 5) & 7), true);
773765      if (SHIFTREG_RISING_EDGE(0x04))
774         sample_stop(samples, 5);
766         samples->stop(5);
775767
776768      /* beep - falling edge */
777769      if (SHIFTREG_FALLING_EDGE(0x02))
778         sample_start(samples, 0, 0, 0);
770         samples->start(0, 0);
779771
780772      /* motor - 0=on, 1=off */
781773      if (SHIFTREG_FALLING_EDGE(0x01))
782         sample_start(samples, 1, 1, 1);
774         samples->start(1, 1, true);
783775      if (SHIFTREG_RISING_EDGE(0x01))
784         sample_stop(samples, 1);
776         samples->stop(1);
785777
786778      /* remember the previous value */
787779      state->m_last_shift = state->m_current_shift;
r14521r14522
789781
790782   /* torpedo - falling edge */
791783   if (SOUNDVAL_FALLING_EDGE(0x08))
792      sample_start(samples, 2, 2, 0);
784      samples->start(2, 2);
793785
794786   /* laser - falling edge */
795787   if (SOUNDVAL_FALLING_EDGE(0x10))
796      sample_start(samples, 3, 3, 0);
788      samples->start(3, 3);
797789
798790   /* explosion - falling edge */
799791   if (SOUNDVAL_FALLING_EDGE(0x80))
800      sample_start(samples, 4, 4, 0);
792      samples->start(4, 4);
801793}
802794
803795static MACHINE_RESET( ripoff )
r14521r14522
811803
812804   MCFG_SPEAKER_STANDARD_MONO("mono")
813805
814   MCFG_SOUND_ADD("samples", SAMPLES, 0)
815   MCFG_SOUND_CONFIG(ripoff_samples_interface)
806   MCFG_SAMPLES_ADD("samples", ripoff_samples_interface)
816807   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
817808MACHINE_CONFIG_END
818809
r14521r14522
847838static void starcas_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
848839{
849840   cinemat_state *state = machine.driver_data<cinemat_state>();
850   device_t *samples = machine.device("samples");
841   samples_device *samples = machine.device<samples_device>("samples");
851842   UINT32 target_pitch;
852843
853844   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r14521r14522
859850   {
860851      /* fireball - falling edge */
861852      if (SHIFTREG_FALLING_EDGE(0x80))
862         sample_start(samples, 0, 0, 0);
853         samples->start(0, 0);
863854
864855      /* shield hit - falling edge */
865856      if (SHIFTREG_FALLING_EDGE(0x40))
866         sample_start(samples, 1, 1, 0);
857         samples->start(1, 1);
867858
868859      /* star sound - 0=off, 1=on */
869860      if (SHIFTREG_RISING_EDGE(0x20))
870         sample_start(samples, 2, 2, 1);
861         samples->start(2, 2, true);
871862      if (SHIFTREG_FALLING_EDGE(0x20))
872         sample_stop(samples, 2);
863         samples->stop(2);
873864
874865      /* thrust sound - 1=off, 0=on*/
875866      if (SHIFTREG_FALLING_EDGE(0x10))
876         sample_start(samples, 3, 3, 1);
867         samples->start(3, 3, true);
877868      if (SHIFTREG_RISING_EDGE(0x10))
878         sample_stop(samples, 3);
869         samples->stop(3);
879870
880871      /* drone - 1=off, 0=on */
881872      if (SHIFTREG_FALLING_EDGE(0x08))
882         sample_start(samples, 4, 4, 1);
873         samples->start(4, 4, true);
883874      if (SHIFTREG_RISING_EDGE(0x08))
884         sample_stop(samples, 4);
875         samples->stop(4);
885876
886877      /* latch the drone pitch */
887878      target_pitch = (state->m_current_shift & 7) + ((state->m_current_shift & 2) << 2);
r14521r14522
894885                state->m_current_pitch -= 225;
895886            if (state->m_current_pitch < target_pitch)
896887                state->m_current_pitch += 150;
897            sample_set_freq(samples, 4, state->m_current_pitch);
888            samples->set_frequency(4, state->m_current_pitch);
898889            state->m_last_frame = machine.primary_screen->frame_number();
899890        }
900891
r14521r14522
904895
905896   /* loud explosion - falling edge */
906897   if (SOUNDVAL_FALLING_EDGE(0x02))
907      sample_start(samples, 5, 5, 0);
898      samples->start(5, 5);
908899
909900   /* soft explosion - falling edge */
910901   if (SOUNDVAL_FALLING_EDGE(0x04))
911      sample_start(samples, 6, 6, 0);
902      samples->start(6, 6);
912903
913904   /* player fire - falling edge */
914905   if (SOUNDVAL_FALLING_EDGE(0x08))
915      sample_start(samples, 7, 7, 0);
906      samples->start(7, 7);
916907}
917908
918909static MACHINE_RESET( starcas )
r14521r14522
926917
927918   MCFG_SPEAKER_STANDARD_MONO("mono")
928919
929   MCFG_SOUND_ADD("samples", SAMPLES, 0)
930   MCFG_SOUND_CONFIG(starcas_samples_interface)
920   MCFG_SAMPLES_ADD("samples", starcas_samples_interface)
931921   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
932922MACHINE_CONFIG_END
933923
r14521r14522
962952static void solarq_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
963953{
964954   cinemat_state *state = machine.driver_data<cinemat_state>();
965   device_t *samples = machine.device("samples");
955   samples_device *samples = machine.device<samples_device>("samples");
966956
967957   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
968958   if (SOUNDVAL_RISING_EDGE(0x10))
r14521r14522
976966
977967      /* loud explosion - falling edge */
978968      if (SHIFTREG_FALLING_EDGE(0x80))
979         sample_start(samples, 0, 0, 0);
969         samples->start(0, 0);
980970
981971      /* soft explosion - falling edge */
982972      if (SHIFTREG_FALLING_EDGE(0x40))
983         sample_start(samples, 1, 1, 0);
973         samples->start(1, 1);
984974
985975      /* thrust - 0=on, 1=off */
986976      if (SHIFTREG_FALLING_EDGE(0x20))
987977      {
988978         state->m_target_volume = 1.0;
989         if (!sample_playing(samples, 2))
990            sample_start(samples, 2, 2, 1);
979         if (!samples->playing(2))
980            samples->start(2, 2, true);
991981      }
992982      if (SHIFTREG_RISING_EDGE(0x20))
993983         state->m_target_volume = 0;
994984
995985      /* ramp the thrust volume */
996        if (sample_playing(samples, 2) && machine.primary_screen->frame_number() > state->m_last_frame)
986        if (samples->playing(2) && machine.primary_screen->frame_number() > state->m_last_frame)
997987        {
998988            if (state->m_current_volume > state->m_target_volume)
999989                state->m_current_volume -= 0.078f;
1000990            if (state->m_current_volume < state->m_target_volume)
1001991                state->m_current_volume += 0.078f;
1002992            if (state->m_current_volume > 0)
1003                sample_set_volume(samples, 2, state->m_current_volume);
993                samples->set_volume(2, state->m_current_volume);
1004994            else
1005                sample_stop(samples, 2);
995                samples->stop(2);
1006996            state->m_last_frame = machine.primary_screen->frame_number();
1007997        }
1008998
1009999      /* fire - falling edge */
10101000      if (SHIFTREG_FALLING_EDGE(0x10))
1011         sample_start(samples, 3, 3, 0);
1001         samples->start(3, 3);
10121002
10131003      /* capture - falling edge */
10141004      if (SHIFTREG_FALLING_EDGE(0x08))
1015         sample_start(samples, 4, 4, 0);
1005         samples->start(4, 4);
10161006
10171007      /* nuke - 1=on, 0=off */
10181008      if (SHIFTREG_RISING_EDGE(0x04))
1019         sample_start(samples, 5, 5, 1);
1009         samples->start(5, 5, true);
10201010      if (SHIFTREG_FALLING_EDGE(0x04))
1021         sample_stop(samples, 5);
1011         samples->stop(5);
10221012
10231013      /* photon - falling edge */
10241014      if (SHIFTREG_FALLING_EDGE(0x02))
1025         sample_start(samples, 6, 6, 0);
1015         samples->start(6, 6);
10261016
10271017      /* remember the previous value */
10281018      state->m_last_shift = state->m_current_shift;
r14521r14522
10351025
10361026      /* start/stop the music sample on the high bit */
10371027      if (SHIFTREG2_RISING_EDGE(0x8000))
1038         sample_start(samples, 7, 7, 1);
1028         samples->start(7, 7, true);
10391029      if (SHIFTREG2_FALLING_EDGE(0x8000))
1040         sample_stop(samples, 7);
1030         samples->stop(7);
10411031
10421032      /* set the frequency */
10431033      freq = 56818.181818 / (4096 - (state->m_current_shift & 0xfff));
1044      sample_set_freq(samples, 7, 44100 * freq / 1050);
1034      samples->set_frequency(7, 44100 * freq / 1050);
10451035
10461036      /* set the volume */
10471037      vol = (~state->m_current_shift >> 12) & 7;
1048      sample_set_volume(samples, 7, vol / 7.0);
1038      samples->set_volume(7, vol / 7.0);
10491039
10501040      /* remember the previous value */
10511041      state->m_last_shift2 = state->m_current_shift;
r14521r14522
10631053
10641054   MCFG_SPEAKER_STANDARD_MONO("mono")
10651055
1066   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1067   MCFG_SOUND_CONFIG(solarq_samples_interface)
1056   MCFG_SAMPLES_ADD("samples", solarq_samples_interface)
10681057   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
10691058MACHINE_CONFIG_END
10701059
r14521r14522
11031092static void boxingb_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
11041093{
11051094   cinemat_state *state = machine.driver_data<cinemat_state>();
1106   device_t *samples = machine.device("samples");
1095   samples_device *samples = machine.device<samples_device>("samples");
11071096
11081097   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
11091098   if (SOUNDVAL_RISING_EDGE(0x10))
r14521r14522
11171106
11181107      /* soft explosion - falling edge */
11191108      if (SHIFTREG_FALLING_EDGE(0x80))
1120         sample_start(samples, 0, 0, 0);
1109         samples->start(0, 0);
11211110
11221111      /* loud explosion - falling edge */
11231112      if (SHIFTREG_FALLING_EDGE(0x40))
1124         sample_start(samples, 1, 1, 0);
1113         samples->start(1, 1);
11251114
11261115      /* chirping birds - 0=on, 1=off */
11271116      if (SHIFTREG_FALLING_EDGE(0x20))
1128         sample_start(samples, 2, 2, 0);
1117         samples->start(2, 2);
11291118      if (SHIFTREG_RISING_EDGE(0x20))
1130         sample_stop(samples, 2);
1119         samples->stop(2);
11311120
11321121      /* egg cracking - falling edge */
11331122      if (SHIFTREG_FALLING_EDGE(0x10))
1134         sample_start(samples, 3, 3, 0);
1123         samples->start(3, 3);
11351124
11361125      /* bug pushing A - rising edge */
11371126      if (SHIFTREG_RISING_EDGE(0x08))
1138         sample_start(samples, 4, 4, 0);
1127         samples->start(4, 4);
11391128
11401129      /* bug pushing B - rising edge */
11411130      if (SHIFTREG_RISING_EDGE(0x04))
1142         sample_start(samples, 5, 5, 0);
1131         samples->start(5, 5);
11431132
11441133      /* bug dying - falling edge */
11451134      if (SHIFTREG_FALLING_EDGE(0x02))
1146         sample_start(samples, 6, 6, 0);
1135         samples->start(6, 6);
11471136
11481137      /* beetle on screen - falling edge */
11491138      if (SHIFTREG_FALLING_EDGE(0x01))
1150         sample_start(samples, 7, 7, 0);
1139         samples->start(7, 7);
11511140
11521141      /* remember the previous value */
11531142      state->m_last_shift = state->m_current_shift;
r14521r14522
11601149
11611150      /* start/stop the music sample on the high bit */
11621151      if (SHIFTREG2_RISING_EDGE(0x8000))
1163         sample_start(samples, 8, 8, 1);
1152         samples->start(8, 8, true);
11641153      if (SHIFTREG2_FALLING_EDGE(0x8000))
1165         sample_stop(samples, 8);
1154         samples->stop(8);
11661155
11671156      /* set the frequency */
11681157      freq = 56818.181818 / (4096 - (state->m_current_shift & 0xfff));
1169      sample_set_freq(samples, 8, 44100 * freq / 1050);
1158      samples->set_frequency(8, 44100 * freq / 1050);
11701159
11711160      /* set the volume */
11721161      vol = (~state->m_current_shift >> 12) & 3;
1173      sample_set_volume(samples, 8, vol / 3.0);
1162      samples->set_volume(8, vol / 3.0);
11741163
11751164        /* cannon - falling edge */
11761165        if (SHIFTREG2_RISING_EDGE(0x4000))
1177           sample_start(samples, 9, 9, 0);
1166           samples->start(9, 9);
11781167
11791168      /* remember the previous value */
11801169      state->m_last_shift2 = state->m_current_shift;
r14521r14522
11821171
11831172   /* bounce - rising edge */
11841173   if (SOUNDVAL_RISING_EDGE(0x04))
1185      sample_start(samples, 10, 10, 0);
1174      samples->start(10, 10);
11861175
11871176   /* bell - falling edge */
11881177   if (SOUNDVAL_RISING_EDGE(0x08))
1189      sample_start(samples, 11, 11, 0);
1178      samples->start(11, 11);
11901179}
11911180
11921181static MACHINE_RESET( boxingb )
r14521r14522
12001189
12011190   MCFG_SPEAKER_STANDARD_MONO("mono")
12021191
1203   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1204   MCFG_SOUND_CONFIG(boxingb_samples_interface)
1192   MCFG_SAMPLES_ADD("samples", boxingb_samples_interface)
12051193   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
12061194MACHINE_CONFIG_END
12071195
r14521r14522
12361224static void wotw_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
12371225{
12381226   cinemat_state *state = machine.driver_data<cinemat_state>();
1239   device_t *samples = machine.device("samples");
1227   samples_device *samples = machine.device<samples_device>("samples");
12401228   UINT32 target_pitch;
12411229
12421230   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r14521r14522
12481236   {
12491237      /* fireball - falling edge */
12501238      if (SHIFTREG_FALLING_EDGE(0x80))
1251         sample_start(samples, 0, 0, 0);
1239         samples->start(0, 0);
12521240
12531241      /* shield hit - falling edge */
12541242      if (SHIFTREG_FALLING_EDGE(0x40))
1255         sample_start(samples, 1, 1, 0);
1243         samples->start(1, 1);
12561244
12571245      /* star sound - 0=off, 1=on */
12581246      if (SHIFTREG_RISING_EDGE(0x20))
1259         sample_start(samples, 2, 2, 1);
1247         samples->start(2, 2, true);
12601248      if (SHIFTREG_FALLING_EDGE(0x20))
1261         sample_stop(samples, 2);
1249         samples->stop(2);
12621250
12631251      /* thrust sound - 1=off, 0=on*/
12641252      if (SHIFTREG_FALLING_EDGE(0x10))
1265         sample_start(samples, 3, 3, 1);
1253         samples->start(3, 3, true);
12661254      if (SHIFTREG_RISING_EDGE(0x10))
1267         sample_stop(samples, 3);
1255         samples->stop(3);
12681256
12691257      /* drone - 1=off, 0=on */
12701258      if (SHIFTREG_FALLING_EDGE(0x08))
1271         sample_start(samples, 4, 4, 1);
1259         samples->start(4, 4, true);
12721260      if (SHIFTREG_RISING_EDGE(0x08))
1273         sample_stop(samples, 4);
1261         samples->stop(4);
12741262
12751263      /* latch the drone pitch */
12761264      target_pitch = (state->m_current_shift & 7) + ((state->m_current_shift & 2) << 2);
r14521r14522
12831271                state->m_current_pitch -= 300;
12841272            if (state->m_current_pitch < target_pitch)
12851273                state->m_current_pitch += 200;
1286            sample_set_freq(samples, 4, state->m_current_pitch);
1274            samples->set_frequency(4, state->m_current_pitch);
12871275            state->m_last_frame = machine.primary_screen->frame_number();
12881276        }
12891277
r14521r14522
12931281
12941282   /* loud explosion - falling edge */
12951283   if (SOUNDVAL_FALLING_EDGE(0x02))
1296      sample_start(samples, 5, 5, 0);
1284      samples->start(5, 5);
12971285
12981286   /* soft explosion - falling edge */
12991287   if (SOUNDVAL_FALLING_EDGE(0x04))
1300      sample_start(samples, 6, 6, 0);
1288      samples->start(6, 6);
13011289
13021290   /* player fire - falling edge */
13031291   if (SOUNDVAL_FALLING_EDGE(0x08))
1304      sample_start(samples, 7, 7, 0);
1292      samples->start(7, 7);
13051293}
13061294
13071295static MACHINE_RESET( wotw )
r14521r14522
13151303
13161304   MCFG_SPEAKER_STANDARD_MONO("mono")
13171305
1318   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1319   MCFG_SOUND_CONFIG(wotw_samples_interface)
1306   MCFG_SAMPLES_ADD("samples", wotw_samples_interface)
13201307   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
13211308MACHINE_CONFIG_END
13221309
r14521r14522
13511338static void wotwc_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
13521339{
13531340   cinemat_state *state = machine.driver_data<cinemat_state>();
1354   device_t *samples = machine.device("samples");
1341   samples_device *samples = machine.device<samples_device>("samples");
13551342   UINT32 target_pitch;
13561343
13571344   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r14521r14522
13631350   {
13641351      /* fireball - falling edge */
13651352      if (SHIFTREG_FALLING_EDGE(0x80))
1366         sample_start(samples, 0, 0, 0);
1353         samples->start(0, 0);
13671354
13681355      /* shield hit - falling edge */
13691356      if (SHIFTREG_FALLING_EDGE(0x40))
1370         sample_start(samples, 1, 1, 0);
1357         samples->start(1, 1);
13711358
13721359      /* star sound - 0=off, 1=on */
13731360      if (SHIFTREG_RISING_EDGE(0x20))
1374         sample_start(samples, 2, 2, 1);
1361         samples->start(2, 2, true);
13751362      if (SHIFTREG_FALLING_EDGE(0x20))
1376         sample_stop(samples, 2);
1363         samples->stop(2);
13771364
13781365      /* thrust sound - 1=off, 0=on*/
13791366      if (SHIFTREG_FALLING_EDGE(0x10))
1380         sample_start(samples, 3, 3, 1);
1367         samples->start(3, 3, true);
13811368      if (SHIFTREG_RISING_EDGE(0x10))
1382         sample_stop(samples, 3);
1369         samples->stop(3);
13831370
13841371      /* drone - 1=off, 0=on */
13851372      if (SHIFTREG_FALLING_EDGE(0x08))
1386         sample_start(samples, 4, 4, 1);
1373         samples->start(4, 4, true);
13871374      if (SHIFTREG_RISING_EDGE(0x08))
1388         sample_stop(samples, 4);
1375         samples->stop(4);
13891376
13901377      /* latch the drone pitch */
13911378      target_pitch = (state->m_current_shift & 7) + ((state->m_current_shift & 2) << 2);
r14521r14522
13981385                state->m_current_pitch -= 300;
13991386            if (state->m_current_pitch < target_pitch)
14001387                state->m_current_pitch += 200;
1401            sample_set_freq(samples, 4, state->m_current_pitch);
1388            samples->set_frequency(4, state->m_current_pitch);
14021389            state->m_last_frame = machine.primary_screen->frame_number();
14031390        }
14041391
r14521r14522
14081395
14091396   /* loud explosion - falling edge */
14101397   if (SOUNDVAL_FALLING_EDGE(0x02))
1411      sample_start(samples, 5, 5, 0);
1398      samples->start(5, 5);
14121399
14131400   /* soft explosion - falling edge */
14141401   if (SOUNDVAL_FALLING_EDGE(0x04))
1415      sample_start(samples, 6, 6, 0);
1402      samples->start(6, 6);
14161403
14171404   /* player fire - falling edge */
14181405   if (SOUNDVAL_FALLING_EDGE(0x08))
1419      sample_start(samples, 7, 7, 0);
1406      samples->start(7, 7);
14201407}
14211408
14221409static MACHINE_RESET( wotwc )
r14521r14522
14301417
14311418   MCFG_SPEAKER_STANDARD_MONO("mono")
14321419
1433   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1434   MCFG_SOUND_CONFIG(wotwc_samples_interface)
1420   MCFG_SAMPLES_ADD("samples", wotwc_samples_interface)
14351421   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
14361422MACHINE_CONFIG_END
14371423
src/mame/audio/zaxxon.c
r14521r14522
9898
9999
100100MACHINE_CONFIG_FRAGMENT( zaxxon_samples )
101   MCFG_SOUND_ADD("samples", SAMPLES, 0)
102   MCFG_SOUND_CONFIG(zaxxon_samples_interface)
101   MCFG_SAMPLES_ADD("samples", zaxxon_samples_interface)
103102   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
104103MACHINE_CONFIG_END
105104
r14521r14522
114113WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
115114{
116115   zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
117   device_t *samples = device->machine().device("samples");
116   samples_device *samples = device->machine().device<samples_device>("samples");
118117   UINT8 diff = data ^ state->m_sound_state[0];
119118   state->m_sound_state[0] = data;
120119
121120   /* PLAYER SHIP A/B: volume */
122   sample_set_volume(samples, 10, 0.5 + 0.157 * (data & 0x03));
123   sample_set_volume(samples, 11, 0.5 + 0.157 * (data & 0x03));
121   samples->set_volume(10, 0.5 + 0.157 * (data & 0x03));
122   samples->set_volume(11, 0.5 + 0.157 * (data & 0x03));
124123
125124   /* PLAYER SHIP C: channel 10 */
126   if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 10, 10, TRUE);
127   if ((diff & 0x04) &&  (data & 0x04)) sample_stop(samples, 10);
125   if ((diff & 0x04) && !(data & 0x04)) samples->start(10, 10, true);
126   if ((diff & 0x04) &&  (data & 0x04)) samples->stop(10);
128127
129128   /* PLAYER SHIP D: channel 11 */
130   if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 11, 11, TRUE);
131   if ((diff & 0x08) &&  (data & 0x08)) sample_stop(samples, 11);
129   if ((diff & 0x08) && !(data & 0x08)) samples->start(11, 11, true);
130   if ((diff & 0x08) &&  (data & 0x08)) samples->stop(11);
132131
133132   /* HOMING MISSILE: channel 0 */
134   if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 0, 0, TRUE);
135   if ((diff & 0x10) &&  (data & 0x10)) sample_stop(samples, 0);
133   if ((diff & 0x10) && !(data & 0x10)) samples->start(0, 0, true);
134   if ((diff & 0x10) &&  (data & 0x10)) samples->stop(0);
136135
137136   /* BASE MISSILE: channel 1 */
138   if ((diff & 0x20) && !(data & 0x20)) sample_start(samples, 1, 1, FALSE);
137   if ((diff & 0x20) && !(data & 0x20)) samples->start(1, 1);
139138
140139   /* LASER: channel 2 */
141   if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 2, 2, TRUE);
142   if ((diff & 0x40) &&  (data & 0x40)) sample_stop(samples, 2);
140   if ((diff & 0x40) && !(data & 0x40)) samples->start(2, 2, true);
141   if ((diff & 0x40) &&  (data & 0x40)) samples->stop(2);
143142
144143   /* BATTLESHIP: channel 3 */
145   if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 3, 3, TRUE);
146   if ((diff & 0x80) &&  (data & 0x80)) sample_stop(samples, 3);
144   if ((diff & 0x80) && !(data & 0x80)) samples->start(3, 3, true);
145   if ((diff & 0x80) &&  (data & 0x80)) samples->stop(3);
147146}
148147
149148
150149WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
151150{
152151   zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
153   device_t *samples = device->machine().device("samples");
152   samples_device *samples = device->machine().device<samples_device>("samples");
154153   UINT8 diff = data ^ state->m_sound_state[1];
155154   state->m_sound_state[1] = data;
156155
157156   /* S-EXP: channel 4 */
158   if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 4, 4, FALSE);
157   if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 4);
159158
160159   /* M-EXP: channel 5 */
161   if ((diff & 0x20) && !(data & 0x20) && !sample_playing(samples, 5)) sample_start(samples, 5, 5, FALSE);
160   if ((diff & 0x20) && !(data & 0x20) && !samples->playing(5)) samples->start(5, 5);
162161
163162   /* CANNON: channel 6 */
164   if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 6, 6, FALSE);
163   if ((diff & 0x80) && !(data & 0x80)) samples->start(6, 6);
165164}
166165
167166
168167WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
169168{
170169   zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
171   device_t *samples = device->machine().device("samples");
170   samples_device *samples = device->machine().device<samples_device>("samples");
172171   UINT8 diff = data ^ state->m_sound_state[2];
173172   state->m_sound_state[2] = data;
174173
175174   /* SHOT: channel 7 */
176   if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 7, 7, FALSE);
175   if ((diff & 0x01) && !(data & 0x01)) samples->start(7, 7);
177176
178177   /* ALARM2: channel 8 */
179   if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 8, 8, FALSE);
178   if ((diff & 0x04) && !(data & 0x04)) samples->start(8, 8);
180179
181180   /* ALARM3: channel 9 */
182   if ((diff & 0x08) && !(data & 0x08) && !sample_playing(samples, 9)) sample_start(samples, 9, 9, FALSE);
181   if ((diff & 0x08) && !(data & 0x08) && !samples->playing(9)) samples->start(9, 9);
183182}
184183
185184
r14521r14522
210209
211210
212211MACHINE_CONFIG_FRAGMENT( congo_samples )
213   MCFG_SOUND_ADD("samples", SAMPLES, 0)
214   MCFG_SOUND_CONFIG(congo_samples_interface)
212   MCFG_SAMPLES_ADD("samples", congo_samples_interface)
215213   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
216214MACHINE_CONFIG_END
217215
r14521r14522
226224WRITE8_DEVICE_HANDLER( congo_sound_b_w )
227225{
228226   zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
229   device_t *samples = device->machine().device("samples");
227   samples_device *samples = device->machine().device<samples_device>("samples");
230228   UINT8 diff = data ^ state->m_sound_state[1];
231229   state->m_sound_state[1] = data;
232230
233231   /* bit 7 = mute */
234232
235233   /* GORILLA: channel 0 */
236   if ((diff & 0x02) && !(data & 0x02) && !sample_playing(samples, 0)) sample_start(samples, 0, 0, FALSE);
234   if ((diff & 0x02) && !(data & 0x02) && !samples->playing(0)) samples->start(0, 0);
237235}
238236
239237
240238WRITE8_DEVICE_HANDLER( congo_sound_c_w )
241239{
242240   zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
243   device_t *samples = device->machine().device("samples");
241   samples_device *samples = device->machine().device<samples_device>("samples");
244242   UINT8 diff = data ^ state->m_sound_state[2];
245243   state->m_sound_state[2] = data;
246244
247245   /* BASS DRUM: channel 1 */
248   if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 1, 1, FALSE);
249   if ((diff & 0x01) &&  (data & 0x01)) sample_stop(samples, 1);
246   if ((diff & 0x01) && !(data & 0x01)) samples->start(1, 1);
247   if ((diff & 0x01) &&  (data & 0x01)) samples->stop(1);
250248
251249   /* CONGA (LOW): channel 2 */
252   if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 2, 2, FALSE);
253   if ((diff & 0x02) &&  (data & 0x02)) sample_stop(samples, 2);
250   if ((diff & 0x02) && !(data & 0x02)) samples->start(2, 2);
251   if ((diff & 0x02) &&  (data & 0x02)) samples->stop(2);
254252
255253   /* CONGA (HIGH): channel 3 */
256   if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 3, 3, FALSE);
257   if ((diff & 0x04) &&  (data & 0x04)) sample_stop(samples, 3);
254   if ((diff & 0x04) && !(data & 0x04)) samples->start(3, 3);
255   if ((diff & 0x04) &&  (data & 0x04)) samples->stop(3);
258256
259257   /* RIM: channel 4 */
260   if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 4, 4, FALSE);
261   if ((diff & 0x08) &&  (data & 0x08)) sample_stop(samples, 4);
258   if ((diff & 0x08) && !(data & 0x08)) samples->start(4, 4);
259   if ((diff & 0x08) &&  (data & 0x08)) samples->stop(4);
262260}
src/mame/audio/circus.c
r14521r14522
193193               break;
194194
195195            case 2 : /* Circus = Pop; Rip Cord = Splash */
196               sample_start(state->m_samples, 0, 0, 0);
196               state->m_samples->start(0, 0);
197197               break;
198198
199199            case 3 : /* Normal Video */
200200               break;
201201
202202            case 4 : /* Circus = Miss; Rip Cord = Scream */
203               sample_start(state->m_samples, 1, 1, 0);
203               state->m_samples->start(1, 1);
204204               break;
205205
206206            case 5 : /* Invert Video */
207207               break;
208208
209209            case 6 : /* Circus = Bounce; Rip Cord = Chute Open */
210               sample_start(state->m_samples, 2, 2, 0);
210               state->m_samples->start(2, 2);
211211               break;
212212
213213            case 7 : /* Circus = not used; Rip Cord = Whistle */
214214               if (state->m_game_id == 4)
215                  sample_start(state->m_samples, 3, 3, 0);
215                  state->m_samples->start(3, 3);
216216               break;
217217         }
218218         break;
r14521r14522
221221         discrete_sound_w(state->m_discrete, ROBOTBWL_MUSIC_BIT, data & 0x08);   /* Footsteps */
222222
223223         if (data & 0x40)   /* Hit */
224            sample_start(state->m_samples, 0, 0, 0);
224            state->m_samples->start(0, 0);
225225
226226         if (data & 0x20)   /* Roll */
227            sample_start(state->m_samples, 1, 1, 0);
227            state->m_samples->start(1, 1);
228228
229229         if (data & 0x10)   /* Ball Drop */
230            sample_start(state->m_samples, 2, 2, 0);
230            state->m_samples->start(2, 2);
231231
232232         if (data & 0x02)   /* Demerit */
233            sample_start(state->m_samples, 3, 3, 0);
233            state->m_samples->start(3, 3);
234234
235235         if (data & 0x01)   /* Reward */
236            sample_start(state->m_samples, 4, 4, 0);
236            state->m_samples->start(4, 4);
237237
238238         // if (data & 0x04) /* Invert */
239239         break;
r14521r14522
251251               break;
252252
253253            case 2 : /* Crash */
254               sample_start(state->m_samples, 0, 0, 0);
254               state->m_samples->start(0, 0);
255255               break;
256256
257257            case 3 : /* Normal Video and Beep */
src/mame/audio/astrof.c
r14521r14522
3838   UINT8 rising_bits = data & ~state->m_port_1_last;
3939
4040   if (state->m_astrof_death_playing)
41      state->m_astrof_death_playing = sample_playing(state->m_samples, CHANNEL_EXPLOSION);
41      state->m_astrof_death_playing = state->m_samples->playing(CHANNEL_EXPLOSION);
4242
4343   if (state->m_astrof_bosskill_playing)
44      state->m_astrof_bosskill_playing = sample_playing(state->m_samples, CHANNEL_EXPLOSION);
44      state->m_astrof_bosskill_playing = state->m_samples->playing(CHANNEL_EXPLOSION);
4545
4646   /* D2 - explosion */
4747   if (rising_bits & 0x04)
r14521r14522
5555   if ((data & 0x08) && (~state->m_port_1_last & 0x08))
5656   {
5757      int sample = SAMPLE_WAVE + (data & 3);
58      sample_start(state->m_samples, CHANNEL_WAVE, sample, 1);
58      state->m_samples->start(CHANNEL_WAVE, sample, 1);
5959   }
6060
6161   if ((~data & 0x08) && (state->m_port_1_last & 0x08))
62      sample_stop(state->m_samples, CHANNEL_WAVE);
62      state->m_samples->stop(CHANNEL_WAVE);
6363
6464   /* D4 - boss laser */
6565   if ((rising_bits & 0x10) && !state->m_astrof_bosskill_playing)
66      sample_start(state->m_samples, CHANNEL_BOSSFIRE, SAMPLE_BOSSFIRE, 0);
66      state->m_samples->start(CHANNEL_BOSSFIRE, SAMPLE_BOSSFIRE, 0);
6767
6868   /* D5 - fire */
6969   if ((rising_bits & 0x20) && !state->m_astrof_bosskill_playing)
70      sample_start(state->m_samples, CHANNEL_FIRE, SAMPLE_FIRE, 0);
70      state->m_samples->start(CHANNEL_FIRE, SAMPLE_FIRE, 0);
7171
7272   /* D6 - don't know. Probably something to do with the explosion sounds */
7373
r14521r14522
9595      {
9696         if (!state->m_astrof_bosskill_playing)
9797         {
98            sample_start(state->m_samples, CHANNEL_EXPLOSION, SAMPLE_BOSSKILL, 0);
98            state->m_samples->start(CHANNEL_EXPLOSION, SAMPLE_BOSSKILL, 0);
9999            state->m_astrof_bosskill_playing = 1;
100100         }
101101      }
102102      else if (data & 0x02)
103         sample_start(state->m_samples, CHANNEL_EXPLOSION, SAMPLE_BOSSHIT, 0);
103         state->m_samples->start(CHANNEL_EXPLOSION, SAMPLE_BOSSHIT, 0);
104104      else if (data & 0x01)
105         sample_start(state->m_samples, CHANNEL_EXPLOSION, SAMPLE_EKILLED, 0);
105         state->m_samples->start(CHANNEL_EXPLOSION, SAMPLE_EKILLED, 0);
106106      else
107107      {
108108         if (!state->m_astrof_death_playing)
109109         {
110            sample_start(state->m_samples, CHANNEL_EXPLOSION, SAMPLE_DEATH, 0);
110            state->m_samples->start(CHANNEL_EXPLOSION, SAMPLE_DEATH, 0);
111111            state->m_astrof_death_playing = 1;
112112         }
113113      }
r14521r14522
117117
118118   /* D3 - low fuel warning */
119119   if (rising_bits & 0x08)
120      sample_start(state->m_samples, CHANNEL_FUEL, SAMPLE_FUEL, 0);
120      state->m_samples->start(CHANNEL_FUEL, SAMPLE_FUEL, 0);
121121
122122   state->m_port_2_last = data;
123123}
r14521r14522
151151
152152MACHINE_CONFIG_FRAGMENT( astrof_audio )
153153   MCFG_SPEAKER_STANDARD_MONO("mono")
154   MCFG_SOUND_ADD("samples", SAMPLES, 0)
155   MCFG_SOUND_CONFIG(astrof_samples_interface)
154   MCFG_SAMPLES_ADD("samples", astrof_samples_interface)
156155   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
157156MACHINE_CONFIG_END
158157
src/mame/audio/snk6502.c
r14521r14522
4949   INT32 m_tone_clock;
5050   sound_stream * m_tone_stream;
5151
52   device_t *m_samples;
52   samples_device *m_samples;
5353   UINT8 *m_ROM;
5454   int m_Sound0StopOnRollover;
5555   UINT8 m_LastPort1;
r14521r14522
653653{
654654   snk6502_sound_state *state = get_safe_token(device);
655655
656   state->m_samples = device->machine().device("samples");
656   state->m_samples = device->machine().device<samples_device>("samples");
657657   state->m_ROM = device->machine().region("snk6502")->base();
658658
659659   // adjusted
r14521r14522
695695{
696696   device_t *device = space->machine().device("snk6502");
697697   snk6502_sound_state *state = get_safe_token(device);
698   device_t *samples = state->m_samples;
698   samples_device *samples = state->m_samples;
699699   TONE *tone_channels = state->m_tone_channels;
700700
701701   switch (offset)
r14521r14522
715715        */
716716
717717      if ((~data & 0x01) && (state->m_LastPort1 & 0x01))
718         sample_start(samples, 0, 0, 0);
718         samples->start(0, 0);
719719      if ((~data & 0x02) && (state->m_LastPort1 & 0x02))
720         sample_start(samples, 1, 1, 0);
720         samples->start(1, 1);
721721      if ((~data & 0x04) && (state->m_LastPort1 & 0x04))
722         sample_start(samples, 2, 2, 0);
722         samples->start(2, 2);
723723      if ((~data & 0x08) && (state->m_LastPort1 & 0x08))
724         sample_start(samples, 3, 3, 0);
724         samples->start(3, 3);
725725
726726      if ((data & 0x80) && (~state->m_LastPort1 & 0x80))
727727      {
r14521r14522
765765{
766766   device_t *device = space->machine().device("snk6502");
767767   snk6502_sound_state *state = get_safe_token(device);
768   device_t *samples = state->m_samples;
768   samples_device *samples = state->m_samples;
769769   TONE *tone_channels = state->m_tone_channels;
770770
771771   switch (offset)
r14521r14522
782782
783783      /* bit 2 = analog sound trigger */
784784      if (data & 0x04 && !(state->m_LastPort1 & 0x04))
785         sample_start(samples, 0, 1, 0);
785         samples->start(0, 1);
786786
787787      if (data & 0x08)
788788      {
r14521r14522
832832{
833833   device_t *device = space->machine().device("snk6502");
834834   snk6502_sound_state *state = get_safe_token(device);
835   device_t *samples = state->m_samples;
835   samples_device *samples = state->m_samples;
836836   TONE *tone_channels = state->m_tone_channels;
837837
838838   switch (offset)
r14521r14522
860860      /* play noise samples requested by sound command byte */
861861      /* SHOT A */
862862      if (data & 0x20 && !(state->m_LastPort1 & 0x20))
863         sample_start(samples, 1, 0, 0);
863         samples->start(1, 0);
864864      else if (!(data & 0x20) && state->m_LastPort1 & 0x20)
865         sample_stop(samples, 1);
865         samples->stop(1);
866866
867867      /* BOMB */
868868      if (data & 0x80 && !(state->m_LastPort1 & 0x80))
869         sample_start(samples, 2, 1, 0);
869         samples->start(2, 1);
870870
871871      if (data & 0x08)
872872      {
r14521r14522
10861086
10871087   device_t *device = machine.device("snk6502");
10881088   snk6502_sound_state *state = get_safe_token(device);
1089   device_t *samples = state->m_samples;
1089   samples_device *samples = state->m_samples;
10901090
10911091   if ((data & HD38880_CTP) && (data & HD38880_CMV))
10921092   {
r14521r14522
11001100         case HD38880_START:
11011101            logerror("speech: START\n");
11021102
1103            if (state->m_hd38880_data_bytes == 5 && !sample_playing(samples, 0))
1103            if (state->m_hd38880_data_bytes == 5 && !samples->playing(0))
11041104            {
11051105               int i;
11061106
r14521r14522
11081108               {
11091109                  if (table[i] && table[i] == state->m_hd38880_addr)
11101110                  {
1111                     sample_start(samples, 0, start + i, 0);
1111                     samples->start(0, start + i);
11121112                     break;
11131113                  }
11141114               }
r14521r14522
11201120            break;
11211121
11221122         case HD38880_STOP:
1123            sample_stop(samples, 0);
1123            samples->stop(0);
11241124            logerror("speech: STOP\n");
11251125            break;
11261126
src/mame/audio/polyplay.c
r14521r14522
2020
2121SAMPLES_START( polyplay_sh_start )
2222{
23   polyplay_state *state = device->machine().driver_data<polyplay_state>();
23   polyplay_state *state = device.machine().driver_data<polyplay_state>();
2424   int i;
2525
2626   for (i = 0; i < SAMPLE_LENGTH / 2; i++) {
r14521r14522
4949void polyplay_play_channel1(running_machine &machine, int data)
5050{
5151   polyplay_state *state = machine.driver_data<polyplay_state>();
52   device_t *samples = machine.device("samples");
52   samples_device *samples = machine.device<samples_device>("samples");
5353   if (data) {
5454      state->m_freq1 = 2457600 / 16 / data / 8;
55      sample_set_volume(samples, 0, state->m_channel_playing1 * 1.0);
56      sample_start_raw(samples, 0, state->m_backgroundwave, ARRAY_LENGTH(state->m_backgroundwave), sizeof(state->m_backgroundwave)*state->m_freq1,1);
55      samples->set_volume(0, state->m_channel_playing1 * 1.0);
56      samples->start_raw(0, state->m_backgroundwave, ARRAY_LENGTH(state->m_backgroundwave), sizeof(state->m_backgroundwave)*state->m_freq1,true);
5757   }
5858   else {
59      sample_stop(samples, 0);
60      sample_stop(samples, 1);
59      samples->stop(0);
60      samples->stop(1);
6161   }
6262}
6363
6464void polyplay_play_channel2(running_machine &machine, int data)
6565{
6666   polyplay_state *state = machine.driver_data<polyplay_state>();
67   device_t *samples = machine.device("samples");
67   samples_device *samples = machine.device<samples_device>("samples");
6868   if (data) {
6969      state->m_freq2 = 2457600 / 16 / data / 8;
70      sample_set_volume(samples, 1, state->m_channel_playing2 * 1.0);
71      sample_start_raw(samples, 1, state->m_backgroundwave, ARRAY_LENGTH(state->m_backgroundwave), sizeof(state->m_backgroundwave)*state->m_freq2,1);
70      samples->set_volume(1, state->m_channel_playing2 * 1.0);
71      samples->start_raw(1, state->m_backgroundwave, ARRAY_LENGTH(state->m_backgroundwave), sizeof(state->m_backgroundwave)*state->m_freq2,true);
7272   }
7373   else {
74      sample_stop(samples, 0);
75      sample_stop(samples, 1);
74      samples->stop(0);
75      samples->stop(1);
7676   }
7777}
src/mame/audio/cclimber.c
r14521r14522
1515
1616static SAMPLES_START( cclimber_sh_start )
1717{
18   running_machine &machine = device->machine();
18   running_machine &machine = device.machine();
1919   samplebuf = 0;
2020   if (machine.region("samples")->base())
2121      samplebuf = auto_alloc_array(machine, INT16, 2 * machine.region("samples")->bytes());
r14521r14522
2727   int len;
2828   int romlen = machine.region("samples")->bytes();
2929   const UINT8 *rom = machine.region("samples")->base();
30   device_t *samples = machine.device("samples");
30   samples_device *samples = machine.device<samples_device>("samples");
3131
3232
3333   if (!rom) return;
r14521r14522
4747      len++;
4848   }
4949
50   sample_start_raw(samples,0,samplebuf,2 * len,freq,0);
50   samples->start_raw(0,samplebuf,2 * len,freq);
5151}
5252
5353
src/mame/audio/gotya.c
r14521r14522
4646
4747   if (data == 0)
4848   {
49      sample_stop(state->m_samples, 0);
49      state->m_samples->stop(0);
5050      state->m_theme_playing = 0;
5151      return;
5252   }
r14521r14522
6262            return;
6363         }
6464
65         sample_start(state->m_samples, gotya_samples[sample_number].channel, sample_number, gotya_samples[sample_number].looping);
65         state->m_samples->start(gotya_samples[sample_number].channel, sample_number, gotya_samples[sample_number].looping);
6666
6767         if (gotya_samples[sample_number].channel == 0)
6868         {
src/mame/audio/vicdual.c
r14521r14522
120120
121121
122122MACHINE_CONFIG_FRAGMENT( frogs_audio )
123   MCFG_SOUND_ADD("samples", SAMPLES, 0)
124   MCFG_SOUND_CONFIG(frogs_samples_interface)
123   MCFG_SAMPLES_ADD("samples", frogs_samples_interface)
125124   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
126125
127126   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
r14521r14522
132131
133132static TIMER_CALLBACK( frogs_croak_callback )
134133{
135   device_t *samples = machine.device("samples");
136   sample_stop(samples, 2);
134   samples_device *samples = machine.device<samples_device>("samples");
135   samples->stop(2);
137136}
138137
139138
r14521r14522
145144
146145WRITE8_HANDLER( frogs_audio_w )
147146{
148   device_t *samples = space->machine().device("samples");
147   samples_device *samples = space->machine().device<samples_device>("samples");
149148   device_t *discrete = space->machine().device("discrete");
150149   static int last_croak = 0;
151150   static int last_buzzz = 0;
r14521r14522
160159//  discrete_sound_w(discrete, FROGS_SPLASH_EN, data & 0x80);
161160
162161   if (data & 0x01)
163      sample_start (samples, 3, 3, 0);   // Hop
162      samples->start(3, 3);   // Hop
164163   if (data & 0x02)
165      sample_start (samples, 0, 0, 0);   // Boing
164      samples->start(0, 0);   // Boing
166165   if (new_croak)
167      sample_start (samples, 2, 2, 0);   // Croak
166      samples->start(2, 2);   // Croak
168167   else
169168   {
170169      if (last_croak)
r14521r14522
187186         * 12 seconds.
188187         */
189188      if (!last_buzzz)
190         sample_start (samples, 1, 1, 1);   // Buzzz
189         samples->start(1, 1, true);   // Buzzz
191190   }
192191   else
193      sample_stop(samples, 1);
192      samples->stop(1);
194193   if (data & 0x80)
195      sample_start (samples, 4, 4, 0);   // Splash
194      samples->start(4, 4);   // Splash
196195
197196   last_croak = new_croak;
198197   last_buzzz = new_buzzz;
src/mame/audio/meadows.c
r14521r14522
3030/************************************/
3131SAMPLES_START( meadows_sh_start )
3232{
33   meadows_state *state = device->machine().driver_data<meadows_state>();
33   meadows_state *state = device.machine().driver_data<meadows_state>();
3434   state->m_0c00 = state->m_0c01 = state->m_0c02 = state->m_0c03 = 0;
3535   state->m_dac = 0;
3636   state->m_dac_enable = 0;
r14521r14522
3838   state->m_freq1 = state->m_freq2 = 1000;
3939   state->m_latched_0c01 = state->m_latched_0c02 = state->m_latched_0c03 = 0;
4040
41   sample_set_volume(device,0,0);
42   sample_start_raw(device,0,waveform,ARRAY_LENGTH(waveform),state->m_freq1,1);
43   sample_set_volume(device,1,0);
44   sample_start_raw(device,1,waveform,ARRAY_LENGTH(waveform),state->m_freq2,1);
41   device.set_volume(0,0);
42   device.start_raw(0,waveform,ARRAY_LENGTH(waveform),state->m_freq1,true);
43   device.set_volume(1,0);
44   device.start_raw(1,waveform,ARRAY_LENGTH(waveform),state->m_freq2,true);
4545}
4646
4747/************************************/
r14521r14522
5050void meadows_sh_update(running_machine &machine)
5151{
5252   meadows_state *state = machine.driver_data<meadows_state>();
53   device_t *samples = machine.device("samples");
53   samples_device *samples = machine.device<samples_device>("samples");
5454   int preset, amp;
5555
5656   if (state->m_latched_0c01 != state->m_0c01 || state->m_latched_0c03 != state->m_0c03)
r14521r14522
6767         state->m_freq1 = BASE_CTR1 / (preset + 1);
6868      else amp = 0;
6969      logerror("meadows ctr1 channel #%d preset:%3d freq:%5d amp:%d\n", state->m_channel, preset, state->m_freq1, amp);
70      sample_set_freq(samples, 0, state->m_freq1 * sizeof(waveform)/2);
71      sample_set_volume(samples, 0,amp/255.0);
70      samples->set_frequency(0, state->m_freq1 * sizeof(waveform)/2);
71      samples->set_volume(0,amp/255.0);
7272   }
7373
7474   if (state->m_latched_0c02 != state->m_0c02 || state->m_latched_0c03 != state->m_0c03)
r14521r14522
8585      }
8686      else amp = 0;
8787      logerror("meadows ctr2 channel #%d preset:%3d freq:%5d amp:%d\n", state->m_channel+1, preset, state->m_freq2, amp);
88      sample_set_freq(samples, 1, state->m_freq2 * sizeof(waveform));
89      sample_set_volume(samples, 1,amp/255.0);
88      samples->set_frequency(1, state->m_freq2 * sizeof(waveform));
89      samples->set_volume(1,amp/255.0);
9090   }
9191
9292   if (state->m_latched_0c03 != state->m_0c03)
src/mame/audio/mw8080bw.c
r14521r14522
157157   MCFG_SOUND_START(samples)
158158
159159   MCFG_SPEAKER_STANDARD_MONO("mono")
160   MCFG_SOUND_ADD("samples", SAMPLES, 0)
161   MCFG_SOUND_CONFIG(seawolf_samples_interface)
160   MCFG_SAMPLES_ADD("samples", seawolf_samples_interface)
162161   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6)
163162MACHINE_CONFIG_END
164163
r14521r14522
169168   UINT8 rising_bits = data & ~state->m_port_1_last;
170169
171170   /* if (data & 0x01)  enable SHIP HIT sound */
172   if (rising_bits & 0x01) sample_start(state->m_samples, 0, 0, 0);
171   if (rising_bits & 0x01) state->m_samples->start(0, 0);
173172
174173   /* if (data & 0x02)  enable TORPEDO sound */
175   if (rising_bits & 0x02) sample_start(state->m_samples, 1, 1, 0);
174   if (rising_bits & 0x02) state->m_samples->start(1, 1);
176175
177176   /* if (data & 0x04)  enable DIVE sound */
178   if (rising_bits & 0x04) sample_start(state->m_samples, 2, 2, 0);
177   if (rising_bits & 0x04) state->m_samples->start(2, 2);
179178
180179   /* if (data & 0x08)  enable SONAR sound */
181   if (rising_bits & 0x08) sample_start(state->m_samples, 3, 3, 0);
180   if (rising_bits & 0x08) state->m_samples->start(3, 3);
182181
183182   /* if (data & 0x10)  enable MINE HIT sound */
184   if (rising_bits & 0x10) sample_start(state->m_samples, 4, 4, 0);
183   if (rising_bits & 0x10) state->m_samples->start(4, 4);
185184
186185   coin_counter_w(space->machine(), 0, (data >> 5) & 0x01);
187186
r14521r14522
219218
220219   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
221220
222   MCFG_SOUND_ADD("samples1", SAMPLES, 0)
223   MCFG_SOUND_CONFIG(gunfight_samples_interface)
221   MCFG_SAMPLES_ADD("samples1", gunfight_samples_interface)
224222   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
225223
226   MCFG_SOUND_ADD("samples2", SAMPLES, 0)
227   MCFG_SOUND_CONFIG(gunfight_samples_interface)
224   MCFG_SAMPLES_ADD("samples2", gunfight_samples_interface)
228225   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
229226MACHINE_CONFIG_END
230227
r14521r14522
245242
246243   case 0x01:
247244      /* enable LEFT SHOOT sound (left speaker) */
248      sample_start(state->m_samples1, 0, 0, 0);
245      state->m_samples1->start(0, 0);
249246      break;
250247
251248   case 0x02:
252249      /* enable RIGHT SHOOT sound (right speaker) */
253      sample_start(state->m_samples2, 0, 0, 0);
250      state->m_samples2->start(0, 0);
254251      break;
255252
256253   case 0x03:
257254      /* enable LEFT HIT sound (left speaker) */
258      sample_start(state->m_samples1, 0, 1, 0);
255      state->m_samples1->start(0, 1);
259256      break;
260257
261258   case 0x04:
262259      /* enable RIGHT HIT sound (right speaker) */
263      sample_start(state->m_samples2, 0, 1, 0);
260      state->m_samples2->start(0, 1);
264261      break;
265262
266263   default:
r14521r14522
15771574
15781575   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
15791576
1580   MCFG_SOUND_ADD("samples1", SAMPLES, 0)
1581   MCFG_SOUND_CONFIG(gmissile_samples_interface)
1577   MCFG_SAMPLES_ADD("samples1", gmissile_samples_interface)
15821578   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.9)
15831579
1584   MCFG_SOUND_ADD("samples2", SAMPLES, 0)
1585   MCFG_SOUND_CONFIG(gmissile_samples_interface)
1580   MCFG_SAMPLES_ADD("samples2", gmissile_samples_interface)
15861581   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.9)
15871582MACHINE_CONFIG_END
15881583
r14521r14522
16031598   space->machine().sound().system_enable((data >> 3) & 0x01);
16041599
16051600   /* if (data & 0x10)  enable RIGHT MISSILE sound (goes to right speaker) */
1606   if (rising_bits & 0x10) sample_start(state->m_samples2, 0, 0, 0);
1601   if (rising_bits & 0x10) state->m_samples2->start(0, 0);
16071602
16081603   /* if (data & 0x20)  enable LEFT EXPLOSION sound (goes to left speaker) */
16091604   output_set_value("L_EXP_LIGHT", (data >> 5) & 0x01);
1610   if (rising_bits & 0x20) sample_start(state->m_samples1, 0, 1, 0);
1605   if (rising_bits & 0x20) state->m_samples1->start(0, 1);
16111606
16121607   /* if (data & 0x40)  enable LEFT MISSILE sound (goes to left speaker) */
1613   if (rising_bits & 0x40) sample_start(state->m_samples1, 0, 0, 0);
1608   if (rising_bits & 0x40) state->m_samples1->start(0, 0);
16141609
16151610   /* if (data & 0x80)  enable RIGHT EXPLOSION sound (goes to right speaker) */
16161611   output_set_value("R_EXP_LIGHT", (data >> 7) & 0x01);
1617   if (rising_bits & 0x80) sample_start(state->m_samples2, 0, 1, 0);
1612   if (rising_bits & 0x80) state->m_samples2->start(0, 1);
16181613
16191614   state->m_port_1_last = data;
16201615}
r14521r14522
16761671
16771672   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
16781673
1679   MCFG_SOUND_ADD("samples1", SAMPLES, 0)
1680   MCFG_SOUND_CONFIG(m4_samples_interface)
1674   MCFG_SAMPLES_ADD("samples1", m4_samples_interface)
16811675   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1)
16821676
1683   MCFG_SOUND_ADD("samples2", SAMPLES, 0)
1684   MCFG_SOUND_CONFIG(m4_samples_interface)
1677   MCFG_SAMPLES_ADD("samples2", m4_samples_interface)
16851678   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1)
16861679MACHINE_CONFIG_END
16871680
r14521r14522
16981691   space->machine().sound().system_enable((data >> 3) & 0x01);
16991692
17001693   /* if (data & 0x10)  enable LEFT PLAYER SHOT sound (goes to left speaker) */
1701   if (rising_bits & 0x10) sample_start(state->m_samples1, 0, 0, 0);
1694   if (rising_bits & 0x10) state->m_samples1->start(0, 0);
17021695
17031696   /* if (data & 0x20)  enable RIGHT PLAYER SHOT sound (goes to right speaker) */
1704   if (rising_bits & 0x20) sample_start(state->m_samples2, 0, 0, 0);
1697   if (rising_bits & 0x20) state->m_samples2->start(0, 0);
17051698
17061699   /* if (data & 0x40)  enable LEFT PLAYER EXPLOSION sound via 300K res (goes to left speaker) */
1707   if (rising_bits & 0x40) sample_start(state->m_samples1, 1, 1, 0);
1700   if (rising_bits & 0x40) state->m_samples1->start(1, 1);
17081701
17091702   /* if (data & 0x80)  enable RIGHT PLAYER EXPLOSION sound via 300K res (goes to right speaker) */
1710   if (rising_bits & 0x80) sample_start(state->m_samples2, 1, 1, 0);
1703   if (rising_bits & 0x80) state->m_samples2->start(1, 1);
17111704
17121705   state->m_port_1_last = data;
17131706}
r14521r14522
17191712   UINT8 rising_bits = data & ~state->m_port_2_last;
17201713
17211714   /* if (data & 0x01)  enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */
1722   if (rising_bits & 0x01) sample_start(state->m_samples1, 1, 1, 0);
1715   if (rising_bits & 0x01) state->m_samples1->start(1, 1);
17231716
17241717   /* if (data & 0x02)  enable RIGHT PLAYER EXPLOSION sound via 510K res (goes to right speaker) */
1725   if (rising_bits & 0x02) sample_start(state->m_samples2, 1, 1, 0);
1718   if (rising_bits & 0x02) state->m_samples2->start(1, 1);
17261719
17271720   /* if (data & 0x04)  enable LEFT TANK MOTOR sound (goes to left speaker) */
17281721
r14521r14522
19381931
19391932   MCFG_SPEAKER_STANDARD_MONO("mono")
19401933
1941   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1942   MCFG_SOUND_CONFIG(clowns_samples_interface)
1934   MCFG_SAMPLES_ADD("samples", clowns_samples_interface)
19431935   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
19441936
19451937   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
r14521r14522
19741966
19751967   discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
19761968
1977   if (rising_bits & 0x20) sample_start(state->m_samples, 0, 0, 0);  /* springboard miss */
1969   if (rising_bits & 0x20) state->m_samples->start(0, 0);  /* springboard miss */
19781970
19791971   /* D6 and D7 are not connected */
19801972
r14521r14522
33413333   MCFG_SOUND_START(samples)
33423334
33433335   MCFG_SPEAKER_STANDARD_MONO("mono")
3344   MCFG_SOUND_ADD("samples", SAMPLES, 0)
3345   MCFG_SOUND_CONFIG(phantom2_samples_interface)
3336   MCFG_SAMPLES_ADD("samples", phantom2_samples_interface)
33463337   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
33473338MACHINE_CONFIG_END
33483339
r14521r14522
33533344   UINT8 rising_bits = data & ~state->m_port_1_last;
33543345
33553346   /* if (data & 0x01)  enable PLAYER SHOT sound */
3356   if (rising_bits & 0x01) sample_start(state->m_samples, 0, 0, 0);
3347   if (rising_bits & 0x01) state->m_samples->start(0, 0);
33573348
33583349   /* if (data & 0x02)  enable ENEMY SHOT sound */
33593350
r14521r14522
33783369   /* D0-D2 are not connected */
33793370
33803371   /* if (data & 0x08)  enable EXPLOSION sound */
3381   if (rising_bits & 0x08) sample_start(state->m_samples, 1, 1, 0);
3372   if (rising_bits & 0x08) state->m_samples->start(1, 1);
33823373
33833374   output_set_value("EXPLAMP", (data >> 4) & 0x01);
33843375
r14521r14522
36283619   MCFG_SOUND_CONFIG(invaders_sn76477_interface)
36293620   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
36303621
3631   MCFG_SOUND_ADD("samples", SAMPLES, 0)
3632   MCFG_SOUND_CONFIG(invaders_samples_interface)
3622   MCFG_SAMPLES_ADD("samples", invaders_samples_interface)
36333623   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
36343624MACHINE_CONFIG_END
36353625
src/mame/machine/xevious.c
r14521r14522
159159   if( (battles_sound_played == 0) && (data == 0xFF) ){
160160      samples_device *samples = space->machine().device<samples_device>("samples");
161161      if( customio[0] == 0x40 ){
162         sample_start (samples, 0, 0, 0);
162         samples->start(0, 0);
163163      }
164164      else{
165         sample_start (samples, 0, 1, 0);
165         samples->start(0, 1);
166166      }
167167   }
168168   battles_sound_played = data;
src/mame/machine/gaplus.c
r14521r14522
2121WRITE8_HANDLER( gaplus_customio_3_w )
2222{
2323   gaplus_state *state = space->machine().driver_data<gaplus_state>();
24   device_t *samples = space->machine().device("samples");
24   samples_device *samples = space->machine().device<samples_device>("samples");
2525   if ((offset == 0x09) && (data >= 0x0f))
26      sample_start(samples,0,0,0);
26      samples->start(0,0);
2727
2828   state->m_customio_3[offset] = data;
2929}
src/mame/machine/naomigd.c
r14521r14522
398398   const UINT8 *picdata = machine().region(pic_tag)->base();
399399
400400   if(picdata) {
401      if(machine().region(pic_tag)->bytes() == 0x4000) {
401      if(machine().region(pic_tag)->bytes() >= 0x4000) {
402402         printf("Real PIC binary found\n");
403403         for(int i=0;i<7;i++)
404404            name[i] = picdata[0x7c0+i*2];
src/mame/machine/mw8080bw.c
r14521r14522
101101   mw8080bw_create_interrupt_timer(machine);
102102
103103   state->m_maincpu = machine.device("maincpu");
104   state->m_samples = machine.device("samples");
105   state->m_samples1 = machine.device("samples1");
106   state->m_samples2 = machine.device("samples2");
104   state->m_samples = machine.device<samples_device>("samples");
105   state->m_samples1 = machine.device<samples_device>("samples1");
106   state->m_samples2 = machine.device<samples_device>("samples2");
107107   state->m_sn = machine.device("snsnd");
108108   state->m_sn1 = machine.device("sn1");
109109   state->m_sn2 = machine.device("sn2");
src/mame/includes/m10.h
r14521r14522
44
55****************************************************************************/
66
7#include "sound/samples.h"
78
89#define IREMM10_MASTER_CLOCK      (12500000)
910
r14521r14522
5960   device_t *m_maincpu;
6061   device_t *m_ic8j1;
6162   device_t *m_ic8j2;
62   device_t *m_samples;
63   samples_device *m_samples;
6364};
6465
6566
src/mame/includes/astrof.h
r14521r14522
44
55****************************************************************************/
66
7#include "sound/samples.h"
8
79class astrof_state : public driver_device
810{
911public:
r14521r14522
3335
3436   /* devices */
3537   device_t *m_maincpu;
36   device_t *m_samples;   // astrof & abattle
38   samples_device *m_samples;   // astrof & abattle
3739   device_t *m_sn;   // tomahawk
3840};
3941
src/mame/includes/mw8080bw.h
r14521r14522
6868   /* devices */
6969   device_t *m_maincpu;
7070   device_t *m_mb14241;
71   device_t *m_samples;
72   device_t *m_samples1;
73   device_t *m_samples2;
71   samples_device *m_samples;
72   samples_device *m_samples1;
73   samples_device *m_samples2;
7474   device_t *m_sn1;
7575   device_t *m_sn2;
7676   device_t *m_sn;
src/mame/includes/cosmic.h
r14521r14522
44
55*************************************************************************/
66
7#include "sound/samples.h"
8
79#define COSMICG_MASTER_CLOCK     XTAL_9_828MHz
810#define Z80_MASTER_CLOCK         XTAL_10_816MHz
911
r14521r14522
3638   UINT32         m_pixel_clock;
3739
3840   /* devices */
39   device_t *m_samples;
41   samples_device *m_samples;
4042   device_t *m_dac;
4143};
4244
src/mame/includes/tmnt.h
r14521r14522
1#include "sound/samples.h"
12
23class tmnt_state : public driver_device
34{
r14521r14522
5455   device_t *m_k053936;
5556   device_t *m_k054000;
5657   device_t *m_upd;
57   device_t *m_samples;
58   samples_device *m_samples;
5859
5960   /* memory buffers */
6061   INT16      m_sampledata[0x40000];
src/mame/includes/rallyx.h
r14521r14522
1#include "sound/samples.h"
2
13struct jungler_star
24{
35   int x, y, color;
r14521r14522
3335
3436   /* devices */
3537   cpu_device *m_maincpu;
36   device_t *m_samples;
38   samples_device *m_samples;
3739
3840   UINT8    m_main_irq_mask;
3941};
src/mame/includes/gotya.h
r14521r14522
1#include "sound/samples.h"
12
23class gotya_state : public driver_device
34{
r14521r14522
2021   int      m_theme_playing;
2122
2223   /* devices */
23   device_t *m_samples;
24   samples_device *m_samples;
2425};
2526
2627
src/mame/includes/circus.h
r14521r14522
1717
1818   /* devices */
1919   device_t *m_maincpu;
20   device_t *m_samples;
20   samples_device *m_samples;
2121   device_t *m_discrete;
2222
2323   /* game id */
src/mame/video/starcrus.c
r14521r14522
3030WRITE8_HANDLER( starcrus_ship_parm_1_w )
3131{
3232   starcrus_state *state = space->machine().driver_data<starcrus_state>();
33   device_t *samples = space->machine().device("samples");
33   samples_device *samples = space->machine().device<samples_device>("samples");
3434
3535   state->m_s1_sprite = data&0x1f;
3636   state->m_engine1_on = ((data&0x20)>>5)^0x01;
r14521r14522
4040      if (state->m_engine_sound_playing == 0)
4141      {
4242         state->m_engine_sound_playing = 1;
43         sample_start(samples, 0, 0, 1);   /* engine sample */
43         samples->start(0, 0, true);   /* engine sample */
4444      }
4545   }
4646   else
r14521r14522
4848      if (state->m_engine_sound_playing == 1)
4949      {
5050         state->m_engine_sound_playing = 0;
51         sample_stop(samples, 0);
51         samples->stop(0);
5252      }
5353   }
5454}
r14521r14522
5656WRITE8_HANDLER( starcrus_ship_parm_2_w )
5757{
5858   starcrus_state *state = space->machine().driver_data<starcrus_state>();
59   device_t *samples = space->machine().device("samples");
59   samples_device *samples = space->machine().device<samples_device>("samples");
6060
6161   state->m_s2_sprite = data&0x1f;
6262   set_led_status(space->machine(), 2,~data & 0x80);         /* game over lamp */
r14521r14522
6868      if (state->m_engine_sound_playing == 0)
6969      {
7070         state->m_engine_sound_playing = 1;
71         sample_start(samples, 0, 0, 1);   /* engine sample */
71         samples->start(0, 0, true);   /* engine sample */
7272      }
7373   }
7474   else
r14521r14522
7676      if (state->m_engine_sound_playing == 1)
7777      {
7878         state->m_engine_sound_playing = 0;
79         sample_stop(samples, 0);
79         samples->stop(0);
8080      }
8181   }
8282
r14521r14522
8585WRITE8_HANDLER( starcrus_proj_parm_1_w )
8686{
8787   starcrus_state *state = space->machine().driver_data<starcrus_state>();
88   device_t *samples = space->machine().device("samples");
88   samples_device *samples = space->machine().device<samples_device>("samples");
8989
9090   state->m_p1_sprite = data&0x0f;
9191   state->m_launch1_on = ((data&0x20)>>5)^0x01;
r14521r14522
9696      if (state->m_explode_sound_playing == 0)
9797      {
9898         state->m_explode_sound_playing = 1;
99         sample_start(samples, 1,1,1);   /* explosion initial sample */
99         samples->start(1,1, true);   /* explosion initial sample */
100100      }
101101   }
102102   else
r14521r14522
104104      if (state->m_explode_sound_playing == 1)
105105      {
106106         state->m_explode_sound_playing = 0;
107         sample_start(samples, 1,2,0);   /* explosion ending sample */
107         samples->start(1,2);   /* explosion ending sample */
108108      }
109109   }
110110
r14521r14522
113113      if (state->m_launch1_sound_playing == 0)
114114      {
115115         state->m_launch1_sound_playing = 1;
116         sample_start(samples, 2,3,0);   /* launch sample */
116         samples->start(2,3);   /* launch sample */
117117      }
118118   }
119119   else
r14521r14522
125125WRITE8_HANDLER( starcrus_proj_parm_2_w )
126126{
127127   starcrus_state *state = space->machine().driver_data<starcrus_state>();
128   device_t *samples = space->machine().device("samples");
128   samples_device *samples = space->machine().device<samples_device>("samples");
129129
130130   state->m_p2_sprite = data&0x0f;
131131   state->m_launch2_on = ((data&0x20)>>5)^0x01;
r14521r14522
136136      if (state->m_explode_sound_playing == 0)
137137      {
138138         state->m_explode_sound_playing = 1;
139         sample_start(samples, 1,1,1);   /* explosion initial sample */
139         samples->start(1,1, true);   /* explosion initial sample */
140140      }
141141   }
142142   else
r14521r14522
144144      if (state->m_explode_sound_playing == 1)
145145      {
146146         state->m_explode_sound_playing = 0;
147         sample_start(samples, 1,2,0);   /* explosion ending sample */
147         samples->start(1,2);   /* explosion ending sample */
148148      }
149149   }
150150
r14521r14522
153153      if (state->m_launch2_sound_playing == 0)
154154      {
155155         state->m_launch2_sound_playing = 1;
156         sample_start(samples, 3,3,0);   /* launch sample */
156         samples->start(3,3);   /* launch sample */
157157      }
158158   }
159159   else
src/mame/drivers/magicard.c
r14521r14522
760760
761761ROM_START( magicardj )
762762   ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */
763   ROM_LOAD16_WORD_SWAP( "27c4002.ic21", 0x00000, 0x80000, CRC(ab2ed583) SHA1(a2d7148b785a8dfce8cff3b15ada293d65561c98) )
763   ROM_LOAD16_WORD_SWAP( "27c4002j.ic21", 0x00000, 0x80000, CRC(ab2ed583) SHA1(a2d7148b785a8dfce8cff3b15ada293d65561c98) )
764764
765765   ROM_REGION( 0x0100, "pic16f84", 0 ) /* protected */
766766   ROM_LOAD("pic16f84.ic29",   0x0000, 0x0100, BAD_DUMP CRC(0d968558) SHA1(b376885ac8452b6cbf9ced81b1080bfd570d9b91) )
src/mame/drivers/thief.c
r14521r14522
5959   kTalkTrack, kCrashTrack
6060};
6161
62static void tape_set_audio( device_t *samples, int track, int bOn )
62static void tape_set_audio( samples_device *samples, int track, int bOn )
6363{
64   sample_set_volume(samples, track, bOn ? 1.0 : 0.0 );
64   samples->set_volume(track, bOn ? 1.0 : 0.0 );
6565}
6666
67static void tape_set_motor( device_t *samples, int bOn )
67static void tape_set_motor( samples_device *samples, int bOn )
6868{
6969   if( bOn )
7070   {
7171      /* If talk track is not playing, start it. */
72      if (! sample_playing(samples,  kTalkTrack ))
73         sample_start( samples, 0, kTalkTrack, 1 );
72      if (! samples->playing( kTalkTrack ))
73         samples->start( 0, kTalkTrack, true );
7474
7575      /* Resume playback of talk track. */
76      sample_set_pause( samples, kTalkTrack, 0);
76      samples->pause( kTalkTrack, false);
7777
7878
7979      /* If crash track is not playing, start it. */
80      if (! sample_playing(samples,  kCrashTrack ))
81         sample_start( samples, 1, kCrashTrack, 1 );
80      if (! samples->playing( kCrashTrack ))
81         samples->start( 1, kCrashTrack, true );
8282
8383      /* Resume playback of crash track. */
84      sample_set_pause( samples, kCrashTrack, 0);
84      samples->pause( kCrashTrack, false);
8585   }
8686   else
8787   {
8888      /* Pause both the talk and crash tracks. */
89      sample_set_pause( samples, kTalkTrack, 1 );
90      sample_set_pause( samples, kCrashTrack, 1 );
89      samples->pause( kTalkTrack, true );
90      samples->pause( kCrashTrack, true );
9191   }
9292}
9393
r14521r14522
113113      break;
114114
115115   case 0x08: /* talk track on */
116      tape_set_audio( device, kTalkTrack, 1 );
116      tape_set_audio( downcast<samples_device *>(device), kTalkTrack, 1 );
117117      break;
118118
119119   case 0x09: /* talk track off */
120      tape_set_audio( device, kTalkTrack, 0 );
120      tape_set_audio( downcast<samples_device *>(device), kTalkTrack, 0 );
121121      break;
122122
123123   case 0x0a: /* motor on */
124      tape_set_motor( device, 1 );
124      tape_set_motor( downcast<samples_device *>(device), 1 );
125125      break;
126126
127127   case 0x0b: /* motor off */
128      tape_set_motor( device, 0 );
128      tape_set_motor( downcast<samples_device *>(device), 0 );
129129      break;
130130
131131   case 0x0c: /* crash track on */
132      tape_set_audio( device, kCrashTrack, 1 );
132      tape_set_audio( downcast<samples_device *>(device), kCrashTrack, 1 );
133133      break;
134134
135135   case 0x0d: /* crash track off */
136      tape_set_audio( device, kCrashTrack, 0 );
136      tape_set_audio( downcast<samples_device *>(device), kCrashTrack, 0 );
137137      break;
138138   }
139139}
r14521r14522
465465   MCFG_SOUND_ADD("ay2", AY8910, 4000000/4)
466466   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
467467
468   MCFG_SOUND_ADD("samples", SAMPLES, 0)
469   MCFG_SOUND_CONFIG(sharkatt_samples_interface)
468   MCFG_SAMPLES_ADD("samples", sharkatt_samples_interface)
470469   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
471470MACHINE_CONFIG_END
472471
r14521r14522
502501   MCFG_SOUND_ADD("ay2", AY8910, 4000000/4)
503502   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
504503
505   MCFG_SOUND_ADD("samples", SAMPLES, 0)
506   MCFG_SOUND_CONFIG(thief_samples_interface)
504   MCFG_SAMPLES_ADD("samples", thief_samples_interface)
507505   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
508506MACHINE_CONFIG_END
509507
r14521r14522
539537   MCFG_SOUND_ADD("ay2", AY8910, 4000000/4)
540538   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
541539
542   MCFG_SOUND_ADD("samples", SAMPLES, 0)
543   MCFG_SOUND_CONFIG(natodef_samples_interface)
540   MCFG_SAMPLES_ADD("samples", natodef_samples_interface)
544541   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
545542MACHINE_CONFIG_END
546543
src/mame/drivers/gaplus.c
r14521r14522
606606   MCFG_SOUND_CONFIG(namco_config)
607607   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
608608
609   MCFG_SOUND_ADD("samples", SAMPLES, 0)
610   MCFG_SOUND_CONFIG(gaplus_samples_interface)
609   MCFG_SAMPLES_ADD("samples", gaplus_samples_interface)
611610   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
612611MACHINE_CONFIG_END
613612
src/mame/drivers/balsente.c
r14521r14522
18301830   ROM_LOAD( "cd01.u4a",  0x20000, 0x4000, CRC(75e9b51a) SHA1(dbe575d37836245746ea85ffe85e8e6665ec37ea) )
18311831   ROM_LOAD( "cd23.u3a",  0x24000, 0x4000, CRC(0a32e0a5) SHA1(dedbe08aed483bae27e1a607334e24cdfcb2f851) )
18321832   ROM_LOAD( "cd45.u2a",  0x28000, 0x4000, CRC(9bb292fe) SHA1(6fc7abcc110c2cf7399d11a478cfdadb3439b6ab) )
1833   ROM_LOAD( "cd6ef.u1a", 0x2c000, 0x4000, CRC(c77d2302) SHA1(2b0956a7d6bdff5e4f77084149a9528fb07154dc) )
1833   ROM_LOAD( "ns2_cd6ef.u1a", 0x2c000, 0x4000, CRC(c77d2302) SHA1(2b0956a7d6bdff5e4f77084149a9528fb07154dc) )
18341834
18351835   SOUNDBOARD_ROMS
18361836
src/mame/drivers/cclimber.c
r14521r14522
10231023   MCFG_SOUND_CONFIG(cclimber_ay8910_interface)
10241024   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10251025
1026   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1027   MCFG_SOUND_CONFIG(cclimber_samples_interface)
1026   MCFG_SAMPLES_ADD("samples", cclimber_samples_interface)
10281027   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10291028MACHINE_CONFIG_END
10301029
src/mame/drivers/chinagat.c
r14521r14522
764764   ROM_LOAD( "23ja-0.100", 0x60000, 0x20000, CRC(f678594f) SHA1(4bdcf9407543925f4630a8c7f1f48b85f76343a9) )   /* 0,1 */
765765
766766   ROM_REGION(0x40000, "gfx3", 0 )   /* Background */
767   ROM_LOAD( "a-13", 0x00000, 0x10000, NO_DUMP )
768   ROM_LOAD( "a-12", 0x10000, 0x10000, NO_DUMP )
769   ROM_LOAD( "a-15", 0x20000, 0x10000, NO_DUMP )
770   ROM_LOAD( "a-14", 0x30000, 0x10000, NO_DUMP )
767   ROM_LOAD( "saiyugou_a-13", 0x00000, 0x10000, NO_DUMP )
768   ROM_LOAD( "saiyugou_a-12", 0x10000, 0x10000, NO_DUMP )
769   ROM_LOAD( "saiyugou_a-15", 0x20000, 0x10000, NO_DUMP )
770   ROM_LOAD( "saiyugou_a-14", 0x30000, 0x10000, NO_DUMP )
771771
772772   ROM_REGION(0x40000, "oki", 0 )   /* ADPCM */
773773   ROM_LOAD( "23j1-0.53", 0x00000, 0x20000, CRC(f91f1001) SHA1(378402a3c966cabd61e9662ae5decd66672a228b) )
src/mame/drivers/namcos10.c
r14521r14522
612612   ROM_FILL( 0x0000000, 0x400000, 0x55 )
613613
614614   ROM_REGION( 0x2100000, "user2", 0 ) /* main prg */
615   ROM_LOAD( "0.8e",         0x0000000, 0x1080000, CRC(31b39221) SHA1(7fcb14aaa26c531928a6cd704e746d0e3ae3e031) )
616   ROM_LOAD( "1.8d",         0x1080000, 0x1080000, CRC(82d2cfb5) SHA1(4b5e713a55e74a7b32b1b9b5811892df2df86256) )
615   ROM_LOAD( "gnn2a.8e",         0x0000000, 0x1080000, CRC(31b39221) SHA1(7fcb14aaa26c531928a6cd704e746d0e3ae3e031) )
616   ROM_LOAD( "gnn2a.8d",         0x1080000, 0x1080000, CRC(82d2cfb5) SHA1(4b5e713a55e74a7b32b1b9b5811892df2df86256) )
617617ROM_END
618618
619619ROM_START( gunbalina )
r14521r14522
621621   ROM_FILL( 0x0000000, 0x400000, 0x55 )
622622
623623   ROM_REGION( 0x2100000, "user2", 0 ) /* main prg */
624   ROM_LOAD( "0.8e",         0x0000000, 0x1080000, CRC(981b03d4) SHA1(1c55458f1b2964afe2cf4e9d84548c0699808e9f) )
625   ROM_LOAD( "1.8d",         0x1080000, 0x1080000, CRC(6cd343e0) SHA1(dcec44abae1504025895f42fe574549e5010f7d5) )
624   ROM_LOAD( "gnn1a.8e",         0x0000000, 0x1080000, CRC(981b03d4) SHA1(1c55458f1b2964afe2cf4e9d84548c0699808e9f) )
625   ROM_LOAD( "gnn1a.8d",         0x1080000, 0x1080000, CRC(6cd343e0) SHA1(dcec44abae1504025895f42fe574549e5010f7d5) )
626626ROM_END
627627
628628ROM_START( chocovdr )
src/mame/drivers/suna8.c
r14521r14522
15311531   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
15321532   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
15331533
1534   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1535   MCFG_SOUND_CONFIG(suna8_samples_interface)
1534   MCFG_SAMPLES_ADD("samples", suna8_samples_interface)
15361535   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
15371536   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
15381537MACHINE_CONFIG_END
r14521r14522
15951594   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.90)
15961595   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90)
15971596
1598   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1599   MCFG_SOUND_CONFIG(suna8_samples_interface)
1597   MCFG_SAMPLES_ADD("samples", suna8_samples_interface)
16001598   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
16011599   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
16021600MACHINE_CONFIG_END
r14521r14522
17671765   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
17681766   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
17691767
1770   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1771   MCFG_SOUND_CONFIG(suna8_samples_interface)
1768   MCFG_SAMPLES_ADD("samples", suna8_samples_interface)
17721769   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
17731770   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
17741771MACHINE_CONFIG_END
r14521r14522
18151812   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
18161813   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
18171814
1818   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1819   MCFG_SOUND_CONFIG(suna8_samples_interface)
1815   MCFG_SAMPLES_ADD("samples", suna8_samples_interface)
18201816   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
18211817   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
18221818MACHINE_CONFIG_END
src/mame/drivers/cosmic.c
r14521r14522
4848      int count;
4949      if (data == 0)
5050         for (count = 0; count < 9; count++)
51            sample_stop(state->m_samples, count);
51            state->m_samples->stop(count);
5252
5353      state->m_sound_enabled = data;
5454   }
r14521r14522
5757   {
5858      switch (offset)
5959      {
60      case 0:   if (data) sample_start(state->m_samples, 0, 0, 0); break;   /* Walk */
61      case 1:   if (data) sample_start(state->m_samples, 0, 5, 0); break;   /* Enemy Die 1 */
60      case 0:   if (data) state->m_samples->start(0, 0); break;   /* Walk */
61      case 1:   if (data) state->m_samples->start(0, 5); break;   /* Enemy Die 1 */
6262      case 2:   if (data)                           /* Drop 1 */
6363            {
64               if (!sample_playing(state->m_samples, 1))
64               if (!state->m_samples->playing(1))
6565               {
66                  sample_stop(state->m_samples, 2);
67                  sample_start(state->m_samples, 1, 3, 0);
66                  state->m_samples->stop(2);
67                  state->m_samples->start(1, 3);
6868               }
6969            }
7070            else
71               sample_stop(state->m_samples, 1);
71               state->m_samples->stop(1);
7272            break;
7373
74      case 3:   if (data && !sample_playing(state->m_samples, 6))         /* Oxygen */
75               sample_start(state->m_samples, 6, 9, 1);
74      case 3:   if (data && !state->m_samples->playing(6))         /* Oxygen */
75               state->m_samples->start(6, 9, true);
7676            break;
7777
7878      case 4:   break;                              /* Drop 2 */
79      case 5:   if (data) sample_start(state->m_samples, 0, 5, 0); break;   /* Enemy Die 2 (use same sample as 1) */
80      case 6:   if (data && !sample_playing(state->m_samples, 1) && !sample_playing(state->m_samples, 3))   /* Hang */
81               sample_start(state->m_samples, 2, 2, 0);
79      case 5:   if (data) state->m_samples->start(0, 5); break;   /* Enemy Die 2 (use same sample as 1) */
80      case 6:   if (data && !state->m_samples->playing(1) && !state->m_samples->playing(3))   /* Hang */
81               state->m_samples->start(2, 2);
8282            break;
8383
8484      case 7:   if (data)                           /* Escape */
8585            {
86               sample_stop(state->m_samples, 2);
87               sample_start(state->m_samples, 3, 4, 0);
86               state->m_samples->stop(2);
87               state->m_samples->start(3, 4);
8888            }
8989            else
90               sample_stop(state->m_samples, 3);
90               state->m_samples->stop(3);
9191            break;
9292
93      case 8:   if (data) sample_start(state->m_samples, 0, 1, 0); break;   /* Stairs */
93      case 8:   if (data) state->m_samples->start(0, 1); break;   /* Stairs */
9494      case 9:   if (data)                           /* Extend */
95               sample_start(state->m_samples, 4, 8, 0);
95               state->m_samples->start(4, 8);
9696            else
97               sample_stop(state->m_samples, 4);
97               state->m_samples->stop(4);
9898            break;
9999
100100      case 10:   dac_data_w(state->m_dac, data); break;/* Bonus */
101      case 15:   if (data) sample_start(state->m_samples, 0, 6, 0); break;   /* Player Die */
102      case 16:   if (data) sample_start(state->m_samples, 5, 7, 0); break;   /* Enemy Laugh */
103      case 17:   if (data) sample_start(state->m_samples, 0, 10, 0); break;   /* Coin - Not triggered by software */
101      case 15:   if (data) state->m_samples->start(0, 6); break;   /* Player Die */
102      case 16:   if (data) state->m_samples->start(5, 7); break;   /* Enemy Laugh */
103      case 17:   if (data) state->m_samples->start(0, 10); break;   /* Coin - Not triggered by software */
104104      }
105105   }
106106
r14521r14522
126126      state->m_sound_enabled = data;
127127      if (data == 0)
128128         for (count = 0; count < 9; count++)
129            sample_stop(state->m_samples, count);
129            state->m_samples->stop(count);
130130   }
131131
132132   if (state->m_sound_enabled)
r14521r14522
138138      /* be used for anything. It is implemented for sake of */
139139      /* completness. Maybe it plays a tune if you win ?     */
140140      case 1:   dac_data_w(state->m_dac, -data); break;
141      case 2:   if (data) sample_start(state->m_samples, 0, state->m_march_select, 0); break;   /* March Sound */
141      case 2:   if (data) state->m_samples->start(0, state->m_march_select); break;   /* March Sound */
142142      case 3:   state->m_march_select = (state->m_march_select & 0xfe) | data; break;
143143      case 4:   state->m_march_select = (state->m_march_select & 0xfd) | (data << 1); break;
144144      case 5:   state->m_march_select = (state->m_march_select & 0xfb) | (data << 2); break;
145145
146146      case 6:   if (data)                     /* Killer Attack (crawly thing at bottom of screen) */
147               sample_start(state->m_samples, 1, 8, 1);
147               state->m_samples->start(1, 8, true);
148148            else
149               sample_stop(state->m_samples, 1);
149               state->m_samples->stop(1);
150150            break;
151151
152152      case 7:   if (data)                        /* Bonus Chance & Got Bonus */
153153            {
154               sample_stop(state->m_samples, 4);
155               sample_start(state->m_samples, 4, 10, 0);
154               state->m_samples->stop(4);
155               state->m_samples->start(4, 10);
156156            }
157157            break;
158158
159159      case 8:   if (data)
160160            {
161               if (!sample_playing(state->m_samples, 4)) sample_start(state->m_samples, 4, 9, 1);
161               if (!state->m_samples->playing(4)) state->m_samples->start(4, 9, true);
162162            }
163163            else
164               sample_stop(state->m_samples, 4);
164               state->m_samples->stop(4);
165165            break;
166166
167      case 9:   if (data) sample_start(state->m_samples, 3, 11, 0); break;   /* Got Ship */
167      case 9:   if (data) state->m_samples->start(3, 11); break;   /* Got Ship */
168168//      case 11: watchdog_reset_w(0, 0); break;             /* Watchdog */
169      case 13:   if (data) sample_start(state->m_samples, 8, 13 - state->m_gun_die_select, 0); break;  /* Got Monster / Gunshot */
169      case 13:   if (data) state->m_samples->start(8, 13 - state->m_gun_die_select); break;  /* Got Monster / Gunshot */
170170      case 14:   state->m_gun_die_select = data; break;
171      case 15:   if (data) sample_start(state->m_samples, 5, 14, 0); break;   /* Coin Extend (extra base) */
171      case 15:   if (data) state->m_samples->start(5, 14); break;   /* Coin Extend (extra base) */
172172      }
173173   }
174174
r14521r14522
188188      int count;
189189      if (data == 0)
190190         for (count = 0; count < 12; count++)
191            sample_stop(state->m_samples, count);
191            state->m_samples->stop(count);
192192      else
193193      {
194         sample_start(state->m_samples, 0, 0, 1); /*Background Noise*/
194         state->m_samples->start(0, 0, true); /*Background Noise*/
195195      }
196196
197197      state->m_sound_enabled = data;
r14521r14522
201201   {
202202      switch (offset)
203203      {
204      case 0:   if (data) sample_start(state->m_samples, 1, 2, 0); break; /*Dive Bombing Type A*/
204      case 0:   if (data) state->m_samples->start(1, 2); break; /*Dive Bombing Type A*/
205205
206206      case 2:   /*Dive Bombing Type B (Main Control)*/
207207         if (data)
r14521r14522
209209            switch (state->m_dive_bomb_b_select)
210210            {
211211            case 2:
212               if (sample_playing(state->m_samples, 2))
212               if (state->m_samples->playing(2))
213213               {
214                  sample_stop(state->m_samples, 2);
215                  sample_start(state->m_samples, 2, 3, 0); break;
214                  state->m_samples->stop(2);
215                  state->m_samples->start(2, 3); break;
216216               }
217217               else
218                  sample_start(state->m_samples, 2, 3, 0); break;
218                  state->m_samples->start(2, 3); break;
219219
220220            case 3:
221               if (sample_playing(state->m_samples, 3))
221               if (state->m_samples->playing(3))
222222               {
223                  sample_stop(state->m_samples, 3);
224                  sample_start(state->m_samples, 3, 4, 0); break;
223                  state->m_samples->stop(3);
224                  state->m_samples->start(3, 4); break;
225225               }
226226               else
227                  sample_start(state->m_samples, 3, 4, 0); break;
227                  state->m_samples->start(3, 4); break;
228228
229229            case 4:
230               if (sample_playing(state->m_samples, 4))
230               if (state->m_samples->playing(4))
231231               {
232                  sample_stop(state->m_samples, 4);
233                  sample_start(state->m_samples, 4, 5, 0); break;
232                  state->m_samples->stop(4);
233                  state->m_samples->start(4, 5); break;
234234               }
235235               else
236                  sample_start(state->m_samples, 4, 5, 0); break;
236                  state->m_samples->start(4, 5); break;
237237
238238            case 5:
239               if (sample_playing(state->m_samples, 5))
239               if (state->m_samples->playing(5))
240240               {
241                  sample_stop(state->m_samples, 5);
242                  sample_start(state->m_samples, 5, 6, 0); break;
241                  state->m_samples->stop(5);
242                  state->m_samples->start(5, 6); break;
243243               }
244244               else
245                  sample_start(state->m_samples, 5, 6, 0); break;
245                  state->m_samples->start(5, 6); break;
246246
247247            case 6:
248               if (sample_playing(state->m_samples, 6))
248               if (state->m_samples->playing(6))
249249               {
250                  sample_stop(state->m_samples, 6);
251                  sample_start(state->m_samples, 6, 7, 0); break;
250                  state->m_samples->stop(6);
251                  state->m_samples->start(6, 7); break;
252252               }
253253               else
254                  sample_start(state->m_samples, 6, 7, 0); break;
254                  state->m_samples->start(6, 7); break;
255255
256256            case 7:
257               if (sample_playing(state->m_samples, 7))
257               if (state->m_samples->playing(7))
258258               {
259                  sample_stop(state->m_samples, 7);
260                  sample_start(state->m_samples, 7, 8, 0); break;
259                  state->m_samples->stop(7);
260                  state->m_samples->start(7, 8); break;
261261               }
262262               else
263                  sample_start(state->m_samples, 7, 8, 0); break;
263                  state->m_samples->start(7, 8); break;
264264            }
265265         }
266266
r14521r14522
287287         break;
288288
289289
290      case 6:   if (data) sample_start(state->m_samples, 8, 9, 0); break; /*Fire Control*/
290      case 6:   if (data) state->m_samples->start(8, 9); break; /*Fire Control*/
291291
292      case 7:   if (data) sample_start(state->m_samples, 9, 10, 0); break; /*Small Explosion*/
292      case 7:   if (data) state->m_samples->start(9, 10); break; /*Small Explosion*/
293293
294      case 8:   if (data) sample_start(state->m_samples, 10, 11, 0); break; /*Loud Explosion*/
294      case 8:   if (data) state->m_samples->start(10, 11); break; /*Loud Explosion*/
295295
296296      case 9:
297297         if (data)
298            sample_start(state->m_samples, 11, 1, 1);
298            state->m_samples->start(11, 1, true);
299299         else
300            sample_stop(state->m_samples, 11);
300            state->m_samples->stop(11);
301301         break; /*Extend Sound control*/
302302
303      case 12:   if (data) sample_start(state->m_samples, 11,12, 0); break; /*Insert Coin*/
303      case 12:   if (data) state->m_samples->start(11,12); break; /*Insert Coin*/
304304      }
305305   }
306306
r14521r14522
965965{
966966   cosmic_state *state = machine.driver_data<cosmic_state>();
967967
968   state->m_samples = machine.device("samples");
968   state->m_samples = machine.device<samples_device>("samples");
969969   state->m_dac = machine.device("dac");
970970
971971   state->save_item(NAME(state->m_sound_enabled));
r14521r14522
10351035   /* sound hardware */
10361036   MCFG_SPEAKER_STANDARD_MONO("mono")
10371037
1038   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1039   MCFG_SOUND_CONFIG(panic_samples_interface)
1038   MCFG_SAMPLES_ADD("samples", panic_samples_interface)
10401039   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
10411040
10421041   MCFG_SOUND_ADD("dac", DAC, 0)
r14521r14522
10611060   /* sound hardware */
10621061   MCFG_SPEAKER_STANDARD_MONO("mono")
10631062
1064   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1065   MCFG_SOUND_CONFIG(cosmica_samples_interface)
1063   MCFG_SAMPLES_ADD("samples", cosmica_samples_interface)
10661064   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
10671065
10681066   MCFG_SOUND_ADD("dac", DAC, 0)
r14521r14522
10991097   /* sound hardware */
11001098   MCFG_SPEAKER_STANDARD_MONO("mono")
11011099
1102   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1103   MCFG_SOUND_CONFIG(cosmicg_samples_interface)
1100   MCFG_SAMPLES_ADD("samples", cosmicg_samples_interface)
11041101   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
11051102
11061103   MCFG_SOUND_ADD("dac", DAC, 0)
src/mame/drivers/jpmimpct.c
r14521r14522
44194419   ROM_REGION( 0x1000000, "altrevs", 0 )
44204420   ROM_LOAD16_BYTE( "thbi-2_1.bin", 0x000000, 0x020000, CRC(a1ca874a) SHA1(0a12f387a9a3e261c1017922b8d6a652c696855a) )
44214421   ROM_LOAD16_BYTE( "thbi-2_2.bin", 0x000000, 0x020000, CRC(65320620) SHA1(3db5ccf4e69d85bb8b0270b12674c64ff674834c) )
4422   ROM_LOAD16_BYTE( "thbi-2a1.bin", 0x000000, 0x020000, CRC(f30e472b) SHA1(e30b4c5c04f31ebf677af5f7924efc8836e6a91f) )
4422   ROM_LOAD16_BYTE( "thbib-2a1.bin",0x000000, 0x020000, CRC(f30e472b) SHA1(e30b4c5c04f31ebf677af5f7924efc8836e6a91f) )
44234423   ROM_LOAD16_BYTE( "thbi-2n1.bin", 0x000000, 0x020000, CRC(90fc3f8e) SHA1(6b3e50482e8b779ad0cad8509ba76efd055d6987) )
4424   ROM_LOAD16_BYTE( "thbi-2p1.bin", 0x000000, 0x020000, CRC(4a54d372) SHA1(bd7924eaeab185f097283c14b3bb197403853050) )
4424   ROM_LOAD16_BYTE( "thbib-2p1.bin",0x000000, 0x020000, CRC(4a54d372) SHA1(bd7924eaeab185f097283c14b3bb197403853050) )
44254425   ROM_LOAD16_BYTE( "thbi-2w1.bin", 0x000000, 0x020000, CRC(c3a7f6c2) SHA1(c72a05ed21801401d5aec610d30482560b00baee) )
4426   ROM_LOAD16_BYTE( "thbi-3a1.bin", 0x000000, 0x020000, CRC(be79183d) SHA1(13936aafbb5420748d74b531cbef0a1c39f9be5d) )
4426   ROM_LOAD16_BYTE( "thbib-3a1.bin",0x000000, 0x020000, CRC(be79183d) SHA1(13936aafbb5420748d74b531cbef0a1c39f9be5d) )
44274427   ROM_LOAD16_BYTE( "thbi-3n1.bin", 0x000000, 0x020000, CRC(dd8b6098) SHA1(79d2fcf128fbfe14bd62cc649825fefc10d386a5) )
4428   ROM_LOAD16_BYTE( "thbi-3p1.bin", 0x000000, 0x020000, CRC(07238c64) SHA1(8653eb78537c22a89bcd90e69ddc226dd25dbd76) )
4428   ROM_LOAD16_BYTE( "thbib-3p1.bin",0x000000, 0x020000, CRC(07238c64) SHA1(8653eb78537c22a89bcd90e69ddc226dd25dbd76) )
44294429   ROM_LOAD16_BYTE( "thbi2np1.bin", 0x000000, 0x020000, CRC(7b626bb6) SHA1(ed8eefb2207f908b0c5bc3f315d014faccdfb493) )
44304430   ROM_LOAD16_BYTE( "thbi3np1.bin", 0x000000, 0x020000, CRC(361534a0) SHA1(e2ad00f1698a69b71084dba99b75f40a5f59aa20) )
44314431
src/mame/drivers/by17.c
r14521r14522
128128ROM_START(nightr20)
129129   ROM_REGION(0x10000, "maincpu", 0)
130130   ROM_LOAD( "721-21_1.716", 0x1000, 0x0800, CRC(237c4060) SHA1(4ce3dba9189fe7666fc76a2c8ee7fff9b12d4c00))
131   ROM_LOAD( "720-20_6.716", 0x1800, 0x0800, CRC(0c17aa4d) SHA1(729e61a29691857112579efcdb96a35e8e5b1279))
131   ROM_LOAD( "rev20_720-20_6.716", 0x1800, 0x0800, CRC(0c17aa4d) SHA1(729e61a29691857112579efcdb96a35e8e5b1279))
132132   ROM_RELOAD( 0xf800, 0x0800)
133133ROM_END
134134
src/mame/drivers/itgamble.c
r14521r14522
519519   ROM_LOAD( "4a.ic18", 0x000000, 0x80000, CRC(5decae2d) SHA1(d918aad0e2a1249b18677833f743c92fb678050a) )
520520   ROM_LOAD( "5a.ic17", 0x080000, 0x80000, CRC(8f1bbbf3) SHA1(5efcf77674f8737fc1b98881acebacb26b10adc1) )
521521   ROM_LOAD( "2a.ic20", 0x100000, 0x40000, CRC(f9bffb07) SHA1(efba175189d99a4548739a72f8a1f03c2782a3d0) )
522   ROM_LOAD( "3a.ic19", 0x140000, 0x80000, CRC(56c8a73d) SHA1(49b44e5604cd8675d8f9770e5fb68dad4394e11d) ) /* identical halves */
522   ROM_LOAD( "euro2k2a_3a.ic19", 0x140000, 0x80000, CRC(56c8a73d) SHA1(49b44e5604cd8675d8f9770e5fb68dad4394e11d) ) /* identical halves */
523523
524524   ROM_REGION( 0x40000, "oki", 0 ) /* M6295 samples */
525   ROM_LOAD( "1.ic25", 0x00000, 0x40000, CRC(4fe79e43) SHA1(7c154cb00e9b64fbdcc218280f2183b816cef20b) )
525   ROM_LOAD( "euro2k2a_1.ic25", 0x00000, 0x40000, CRC(4fe79e43) SHA1(7c154cb00e9b64fbdcc218280f2183b816cef20b) )
526526ROM_END
527527
528528
src/mame/drivers/namcos23.c
r14521r14522
967967      J104            - 6 pin connector joined with a cable to J6 on the V198 EMI PCB. This cable is the I/O connection to/from the main board.
968968      J105            - 110VAC power input
969969      J106            - DC variable power output to feed-back motor
970 
971 
972Namco Gorgon-based games
973------------------------
970974
975Rapid River, Final Furlong (both Namco, 1997)
976
977These games run on hardware called "GORGON". It appears to have similar
978capabilities to System 23 but like Super System 22 has sprites also.
979(System 23 doesn't have sprites). The PCBs are about two times larger
980than System 23.
981
982The system comprises Main PCB, ROM PCB and I/O PCB all located inside
983a metal box with 3 separate power supplies for 5V, 12V and 3.3V. Main
984input power is 115V.
985Rapid River is controlled by rotating a paddle (for thrust) and turning it
986sideways (moves left/right).
987The rotation action is done with a 5K potentiometer whereby the thrust
988is achieved by moving the pot from full left to full right continuously.
989The left/right turning movement is just another 5K potentiometer connected
990to the column of the paddle center shaft.
991There are also some buttons just for test mode, including SELECT, UP & DOWN
992The player's seat has movement controlled by a compressor and several
993potentiometers. On bootup, the system tests the seat movement and displays
994a warning if it's not working. Pressing START allows the game to continue
995and function normally without the seat movement.
996
997The other game on this system (Final Furlong) and is a horse racing game.
998To control the horse you rock it forwards and backwards continually (it's very tiring
999to play this game).
1000This would activate possibly one or two 5K potentiometers inside the horse body.
1001Just like a real horse you need to control the speed so your horse lasts the entire race.
1002If you rock too much, a message on screen says 'Too Fast'. To steer the horse turn the
1003head sideways using the reins. There would be another 5K potentiometer in the head
1004to activate the turning direction.
1005
1006
1007Main PCB
1008--------
1009
10108664960102 (8664970102) GORGON MAIN PCB
1011|------------------------------------------------------------------------------------------------------|
1012|                                   J4                       J5                         J6             |
1013|                              |---------|           |---------| |------| |---------|                  |
1014|         |---------| |------| |         |           |         | |C401  | |         |HM534251 HM534251 |
1015| CXD1178Q|         | |C381  | |  C374   |  |------| |  C417   | |      | |  304    |HM534251 HM534251 |
1016|         |  C404   | |      | |         |  |C435  | |         | |------| |         |HM534251 HM534251 |
1017|         |         | |------| |         |  |      | |         | |------| |         |                  |
1018|         |         |          |---------|  |------| |---------| |C400  | |---------|                  |
1019|         |---------|     |---------|       |------|             |      | |---------|                  |
1020|                         |         |       |C435  |    341256   |------| |         |HM534251 HM534251 |
1021|                         |  C397   |       |      |             |------| |  304    |HM534251 HM534251 |
1022|  341256 341256  341256  |         |       |------|    341256   |C401  | |         |HM534251 HM534251 |
1023|  M5M51008       341256  |         |     |---------|            |      | |         |                  |
1024|                         |---------|     |         | |------|   |------| |---------|                  |
1025|  M5M51008       341256         |------| |  C403   | |C406  |   |------| |---------|                  |
1026|ADM485              |---------| |C379  | |         | |      |   |C400  | |         |HM534251 HM534251 |
1027|                    |         | |      | |         | |------|   |      | |  304    |HM534251 HM534251 |
1028|    M5M51008        |  C300   | |------| |---------|            |------| |         |HM534251 HM534251 |
1029|                    |         | LH540204  LH540204              |------| |         |                  |
1030|    M5M51008        |         |341256                 |------|  |C401  | |---------|                  |
1031|J1   HCPL0611       |---------|341256                 |C407  |  |      | |---------|                  |
1032|         DS8921                  PST575  PST575       |      |  |------| |         |                  |
1033|  DS8921                                              |------|  |------| |  304    |HM534251 HM534251 |
1034|                 M5M51008                                       |C400  | |         |HM534251 HM534251 |
1035|       CY7C128             CY2291S                              |      | |         |                  |
1036|         |------|M5M51008  14.31818MHz                          |------| |---------|                  |
1037|         |C422  |          J9           M5M5256                 |------| |---------|         3V_BATT  |
1038|         |      |341256                                         |C400  | |         |                  |
1039|         |------|341256                                         |      | |  C399   |341256  LEDS(8)   |
1040|                                   |------|      |--------|     |------| |         |341256            |
1041|                                   |C352  |      |ALTERA  |     |------| |         |                  |
1042|  ADM485        DSW1(2)   |------| |      |      |EPM7128 |     |C401  | |---------| DSW3(2)   DSW5(8)|
1043|    2061ASC               |C416  | |------|      |        |     |      |     |---------| |---------|  |
1044|      14.7456MHz          |      |               |--------|     |------|     |         | |NKK      |  |
1045|PAL             |-----|   |------|    |------|                   D4516161    |  C413   | |NR4650   |  |
1046|                |H8/  |               |C361  |                   D4516161    |         | |LQF-13B  |  |
1047|                |3002 |               |      |LC321664                       |         | |         |  |
1048|  J10           |-----|               |------|    J8                         |---------| |---------|  |
1049|------------------------------------------------------------------------------------------------------|
1050Notes:
1051     NKK NR4650 - R4600-based 64bit RISC CPU (Main CPU, QFP208, clock input source = CY2291S)
1052     H8/3002  - Hitachi H8/3002 HD6413002F17 (Sound CPU, QFP100, running at 14.7456MHz)
1053     EPM7128  - Altera EPM7128 FPGA labelled 'GOR-M1' (PLCC84)
1054     PAL      - PALCE16V8H stamped 'GOR-M3' (PLCC20)
1055     HM534251 - Hitachi HM534251 256k x4 Dynamic Video RAM (SOJ28)
1056     N341256  - NKK 32k x8 SRAM (SOJ28)
1057     M5M5256  - Mitsubishi 32k x8 SRAM (SOP28)
1058     D4516161 - NEC uPD4516161AG5-A80 1M x16 (16MBit) SDRAM (SSOP50)
1059     LC321664 - Sanyo 64k x16 EDO DRAM (SOJ40)
1060     M5M51008 - Mitsubishi 128k x8 SRAM (SOP32)
1061     CY7C128  - Cypress 2k x8 SRAM (SOJ28)
1062     LH540204 - Sharp CMOS 4096 x 9 Asynchronous FIFO (PLCC32)
1063     2061ASC-1- IC Designs 2061ASC-1 programmable clock generator (SOIC16)
1064     DS8921   - Dallas Semiconductor DS8921 RS-422/423 Differential Line Driver and Receiver Pair (SOIC8)
1065     HCPL0611 - Fairchild HCPL0611 High Speed 10MBits/sec Logic Gate Optocoupler (SOIC8)
1066     ADM485   - Analog Devices ADM485 5V Low Power EIA RS-485 Transceiver (SOIC8)
1067     PST575   - System Reset IC (SOIC8)
1068     CXD1178Q - Sony CXD1178Q 8-bit RGB 3-channel D/A converter (QFP48)
1069     J1       - 64 pin connector for connection of I/O board
1070     J4/J5/J6 \
1071     J8/J9    / Custom NAMCO connectors for connection of MEM(M1) PCB
1072     J10      - Custom NAMCO connector for MSPM(FR) PCB
1073
1074
1075     Namco Custom ICs
1076     ----------------
1077     C300 (QFP160)
1078     304  (x4, QFP120)
1079     C352 (QFP100)
1080     C361 (QFP120)
1081     C374 (QFP160)
1082     C379 (QFP64)
1083     C381 (QFP144)
1084     C397 (QFP160)
1085     C399 (QFP160)
1086     C400 (QFP100)
1087     C401 (x4, QFP64)
1088     C403 (QFP136)
1089     C404 (QFP208)
1090     C406 (QFP120)
1091     C407 (QFP64)
1092     C413 (QFP208)
1093     C416 (QFP176)
1094     C417 (QFP208)
1095     C422 (QFP64)
1096     C435 (x2, TQFP144)
1097
1098
1099Program ROM PCB
1100---------------
1101
1102MSPM(FR) PCB 8699015200 (8699015100)
1103|--------------------------|
1104|            J1            |
1105|                          |
1106|  IC3               IC1   |
1107|                          |
1108|                          |
1109|                    IC2   |
1110|--------------------------|
1111Notes:
1112     J1 -  Connector to plug into Main PCB
1113     IC1 \
1114     IC2 / Main Program  (Fujitsu 29F016 16MBit FlashROM, TSOP48)
1115     IC3 - Sound Program (Fujitsu 29F400T 4MBit FlashROM, TSOP48)
1116
1117     Games that use this PCB include...
1118
1119     Game           Code and revision
1120     --------------------------------
1121     Rapid River    RD2 Ver.C
1122     Rapid River    RD3 Ver.C
1123     Final Furlong  FF2 Ver.A
1124
1125ROM PCB
1126-------
1127
1128MEM(M1) PCB
11298664960202 (8664970202)
1130|--------------------------------------------------------|
1131|    J2(TEXTURE)        J3(POINT)           J5(SPRITE)   |
1132| PAL1                                                   |
1133|                                                        |
1134|                                                        |
1135|                                                        |
1136| CCRL.11A                                               |
1137|      CCRL.11E  PT3L.12J PT3H.12L  SPRLL.12P SPRLL.12T  |
1138| CCRH.11B                                               |
1139|      CCRH.11F                                          |
1140|                PT2L.11J PT2H.11L  SPRLM.11P SPRLM.11T  |
1141|                                                        |
1142|                                                        |
1143|                PT1L.10J PT1H.10L  SPRUM.10P SPRUM.10T  |
1144|   PAL2        PAL3                                     |
1145|                                                        |
1146|                PT0L.9J  PT0H.9L   SPRUU.9P  SPRUU.9T   |
1147|                                   JP7       JP9        |
1148|                                   JP6       JP8        |
1149| CGLL.8B     CGLL.8F                                    |
1150|                                                        |
1151|                                                        |
1152| CGLM.7B     CGLM.7F                                    |
1153|      JP2    JP4                                        |
1154|      JP1    JP3                                        |
1155| CGUM.6B     CGUM.6F                                    |
1156|                                          J1(WAVE)      |
1157|                                                        |
1158| CGUU.5B     CGUU.5F                      WAVEH.3S      |
1159|                                                        |
1160|                    MTBH.5J               WAVEL.2S      |
1161|                    MTAH.3J                      JP5    |
1162|                    MTBL.2J                             |
1163|                    MTAL.1J    KEYCUS                   |
1164|                                                        |
1165|                    J4(MOTION)                          |
1166|--------------------------------------------------------|
1167Notes:
1168     PAL1 - PALCE16V8H stamped 'SS22M1' (PLCC20)
1169     PAL2 - PALCE20V8H stamped 'SS22M2' (PLCC32)
1170     PAL3 - PALCE20V8H stamped 'SS22M2' (PLCC32)
1171     KEYCUS - for Rapid River: MACH211 CPLD stamped 'KC012' (PLCC44)
1172     KEYCUS - for Final Furlong: MACH211 CPLD stamped 'KC011' (PLCC44)
1173     J1->J5 - Custom NAMCO connectors for joining ROM PCB to Main PCB
1174     JP1/JP2 \
1175     JP3/JP4 |
1176     JP5     | Jumpers to set ROM sizes (32M/64M)
1177     JP6/JP7 |
1178     JP8/JP9 /
1179
1180     ROMs
1181     ----
1182          PT*  - Point ROMs, sizes configurable to either 16M or 32M (SOP44)
1183          MT*  - Motion ROMs, sizes configurable to either 32M or 64M (SOP44)
1184          CG*  - Texture ROMs, sizes configurable to either 32M or 64M (SOP44)
1185          CCR* - Texture Tilemap ROMs, sizes fixed at 16M (SOP44)
1186          SPR* - Sprite ROMs, sizes configurable to either 32M or 64M (SOP44)
1187          WAVE*- Wave ROMs, sizes configurable to either 32M or 64M (SOP44)
1188
1189I/O PCB
1190-------
1191
1192V187 ASCA-2A PCB
11932477960102 (2477970102)
1194|--------------------------------------------------------|
1195|                   J105                                 |
1196|                           |-------|        14.7456MHz  |
1197|   J104                    |ALTERA |    ADM485   PST592 |
1198|                           |EPM7064|     |-------|      |
1199|                           |       |     |       |      |
1200|                           |-------|     | C78   |      |
1201|     LC78815                             |       |      |
1202|                                         |-------|      |
1203|     MB87078                              |---|         |
1204| LA4705                                   |IC1| 62256   |
1205|                                          |---|         |
1206|         J101                J102                       |
1207|--------------------------------------------------------|
1208Notes:
1209     IC1  - Atmel AT29C020 2MBit EEPROM labelled 'ASCA1 I/O-A' (PLCC32)
1210     C78  - Namco Custom MCU, positively identified as a Hitachi H8/3334 (PLCC84)
1211     EPM7064 - Altera EPM7064LC68-15 PLD, labelled 'ASCA DR0' (PLCC68)
1212     PST592 - System Reset IC (SOIC4)
1213     ADM485 - Analog Devices +ADM485 5V Low Power EIA RS-485 Transceiver (SOIC8)
1214     MB87078 - Fujitsu MB87078 Electronic Volume Control IC (SOIC24)
1215     LC78815 - Sanyo LM78815 2-Channel 16-Bit D/A Converter (SOIC20)
1216     J101 - 34 pin flat cable connector for filter board
1217     J102 - 50 pin flat cable connector for filter board
1218     J104 - 8 pin power connector (+5V, +12V, +3.3V)
1219     J105 - 64 pin connector for connection of Main PCB
1220
9711221*/
9721222
9731223#include "emu.h"
src/mame/drivers/ninjakd2.c
r14521r14522
226226
227227static SAMPLES_START( ninjakd2_init_samples )
228228{
229   ninjakd2_state *state = device->machine().driver_data<ninjakd2_state>();
230   running_machine &machine = device->machine();
229   ninjakd2_state *state = device.machine().driver_data<ninjakd2_state>();
230   running_machine &machine = device.machine();
231231   const UINT8* const rom = machine.region("pcm")->base();
232232   const int length = machine.region("pcm")->bytes();
233233   INT16* sampledata = auto_alloc_array(machine, INT16, length);
r14521r14522
244244static WRITE8_HANDLER( ninjakd2_pcm_play_w )
245245{
246246   ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
247   device_t *samples = space->machine().device("pcm");
247   samples_device *samples = space->machine().device<samples_device>("pcm");
248248   const UINT8* const rom = space->machine().region("pcm")->base();
249249
250250   // only Ninja Kid II uses this
r14521r14522
262262         ++end;
263263
264264      if (end - start)
265         sample_start_raw(samples, 0, &state->m_sampledata[start], end - start, NE555_FREQUENCY, 0);
265         samples->start_raw(0, &state->m_sampledata[start], end - start, NE555_FREQUENCY);
266266      else
267         sample_stop(samples, 0);
267         samples->stop(0);
268268   }
269269}
270270
r14521r14522
979979   MCFG_SOUND_ROUTE(2, "mono", 0.10)
980980   MCFG_SOUND_ROUTE(3, "mono", 0.50)
981981
982   MCFG_SOUND_ADD("pcm", SAMPLES, 0)
983   MCFG_SOUND_CONFIG(ninjakd2_samples_interface)
982   MCFG_SAMPLES_ADD("pcm", ninjakd2_samples_interface)
984983   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
985984MACHINE_CONFIG_END
986985
src/mame/drivers/jaguar.c
r14521r14522
21572157
21582158ROM_START( freezeat2 )
21592159   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2160   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) )
2161   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) )
2162   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(416d26ed) SHA1(11cf3b88415a8a5d0bb8e1df08603a85202186ef) )
2163   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(d6a5dbc8) SHA1(0e2176c35cbc59b2a5283366210409d0e930bac7) )
2160   ROM_LOAD32_BYTE( "961018_prog.hh",              0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) )
2161   ROM_LOAD32_BYTE( "961018_prog.hl",              0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) )
2162   ROM_LOAD32_BYTE( "961018_prog.lh",              0x000002, 0x040000, CRC(416d26ed) SHA1(11cf3b88415a8a5d0bb8e1df08603a85202186ef) )
2163   ROM_LOAD32_BYTE( "961018_prog.ll",              0x000003, 0x040000, CRC(d6a5dbc8) SHA1(0e2176c35cbc59b2a5283366210409d0e930bac7) )
21642164
21652165   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2166   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(99d0dc75) SHA1(b32126eea70c7584d1c34a6ca33282fbaf4b03aa), ROM_SKIP(7) )
2167   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(2dfdfe62) SHA1(e0554d36ef5cf4b6ce171857ea4f2737f11286a5), ROM_SKIP(7) )
2168   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(722aee2a) SHA1(bc79433131bed5b08453d1b80324a28a552783de), ROM_SKIP(7) )
2169   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(919e31b4) SHA1(3807d4629d8277c780dba888c23d17ba47803f27), ROM_SKIP(7) )
2170   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(a957ac95) SHA1(ddfaca994c06976bee8b123857904e64f40b7f31), ROM_SKIP(7) )
2171   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(a147ec66) SHA1(6291008158d581b81e025ed34ff0950983c12c67), ROM_SKIP(7) )
2172   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(206d2f38) SHA1(6aca89df26d3602ff1da3c23f19e0782439623ff), ROM_SKIP(7) )
2173   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(06559831) SHA1(b2c022457425d7900337cfa2fd1622336c0c0bc5), ROM_SKIP(7) )
2174   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(30c624d2) SHA1(4ced77d1663169d0cb37d6728ec52e67f05064c5), ROM_SKIP(7) )
2175   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(049cd60f) SHA1(8a7615a76b57a4e6ef5d95a5ee6c56086671dbb6), ROM_SKIP(7) )
2176   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(d6aaf3bf) SHA1(1c597bdc0e61fd0941cff5a8a93f24f108bd0daa), ROM_SKIP(7) )
2177   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(7d6ebc69) SHA1(668769297f75f9c367bc5cde26419ed092fc9dd8), ROM_SKIP(7) )
2178   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(6e5fee1f) SHA1(1eca79c8d395f881d0a05f10073998fcae70c3b1), ROM_SKIP(7) )
2179   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(a8b1e9b4) SHA1(066285928e574e656510b90bc212a8d86660bd07), ROM_SKIP(7) )
2180   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(c90080e6) SHA1(a764bdd6b4e9e727f7468a53424a9211ec5fd5a8), ROM_SKIP(7) )
2181   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) )
2166   ROMX_LOAD( "fish961018_gr0.63-56", 0x000000, 0x100000, CRC(99d0dc75) SHA1(b32126eea70c7584d1c34a6ca33282fbaf4b03aa), ROM_SKIP(7) )
2167   ROMX_LOAD( "fish961018_gr0.55-48", 0x000001, 0x100000, CRC(2dfdfe62) SHA1(e0554d36ef5cf4b6ce171857ea4f2737f11286a5), ROM_SKIP(7) )
2168   ROMX_LOAD( "fish961018_gr0.47-40", 0x000002, 0x100000, CRC(722aee2a) SHA1(bc79433131bed5b08453d1b80324a28a552783de), ROM_SKIP(7) )
2169   ROMX_LOAD( "fish961018_gr0.39-32", 0x000003, 0x100000, CRC(919e31b4) SHA1(3807d4629d8277c780dba888c23d17ba47803f27), ROM_SKIP(7) )
2170   ROMX_LOAD( "fish961018_gr0.31-24", 0x000004, 0x100000, CRC(a957ac95) SHA1(ddfaca994c06976bee8b123857904e64f40b7f31), ROM_SKIP(7) )
2171   ROMX_LOAD( "fish961018_gr0.23-16", 0x000005, 0x100000, CRC(a147ec66) SHA1(6291008158d581b81e025ed34ff0950983c12c67), ROM_SKIP(7) )
2172   ROMX_LOAD( "fish961018_gr0.15-08", 0x000006, 0x100000, CRC(206d2f38) SHA1(6aca89df26d3602ff1da3c23f19e0782439623ff), ROM_SKIP(7) )
2173   ROMX_LOAD( "fish961018_gr0.07-00", 0x000007, 0x100000, CRC(06559831) SHA1(b2c022457425d7900337cfa2fd1622336c0c0bc5), ROM_SKIP(7) )
2174   ROMX_LOAD( "fish961018_gr1.63-56", 0x800000, 0x100000, CRC(30c624d2) SHA1(4ced77d1663169d0cb37d6728ec52e67f05064c5), ROM_SKIP(7) )
2175   ROMX_LOAD( "fish961018_gr1.55-48", 0x800001, 0x100000, CRC(049cd60f) SHA1(8a7615a76b57a4e6ef5d95a5ee6c56086671dbb6), ROM_SKIP(7) )
2176   ROMX_LOAD( "fish961018_gr1.47-40", 0x800002, 0x100000, CRC(d6aaf3bf) SHA1(1c597bdc0e61fd0941cff5a8a93f24f108bd0daa), ROM_SKIP(7) )
2177   ROMX_LOAD( "fish961018_gr1.39-32", 0x800003, 0x100000, CRC(7d6ebc69) SHA1(668769297f75f9c367bc5cde26419ed092fc9dd8), ROM_SKIP(7) )
2178   ROMX_LOAD( "fish961018_gr1.31-24", 0x800004, 0x100000, CRC(6e5fee1f) SHA1(1eca79c8d395f881d0a05f10073998fcae70c3b1), ROM_SKIP(7) )
2179   ROMX_LOAD( "fish961018_gr1.23-16", 0x800005, 0x100000, CRC(a8b1e9b4) SHA1(066285928e574e656510b90bc212a8d86660bd07), ROM_SKIP(7) )
2180   ROMX_LOAD( "fish961018_gr1.15-08", 0x800006, 0x100000, CRC(c90080e6) SHA1(a764bdd6b4e9e727f7468a53424a9211ec5fd5a8), ROM_SKIP(7) )
2181   ROMX_LOAD( "fish961018_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) )
21822182ROM_END
21832183
21842184ROM_START( freezeat3 )
21852185   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2186   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) )
2187   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) )
2188   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(948cf20c) SHA1(86c757aa3c849ef5ba94ed4d5dbf10e833dab6bd) )
2189   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(5f44969e) SHA1(32345d7c56a3a890e71f8c71f25414d442b60af8) )
2186   ROM_LOAD32_BYTE( "961007_prog.hh",              0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) )
2187   ROM_LOAD32_BYTE( "961007_prog.hl",              0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) )
2188   ROM_LOAD32_BYTE( "961007_prog.lh",              0x000002, 0x040000, CRC(948cf20c) SHA1(86c757aa3c849ef5ba94ed4d5dbf10e833dab6bd) )
2189   ROM_LOAD32_BYTE( "961007_prog.ll",              0x000003, 0x040000, CRC(5f44969e) SHA1(32345d7c56a3a890e71f8c71f25414d442b60af8) )
21902190
21912191   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2192   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
2193   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
2194   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
2195   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
2196   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
2197   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
2198   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
2199   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
2200   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(ead678c9) SHA1(f83d467f6685965b6176b10adbd4e35ef808baf3), ROM_SKIP(7) )
2201   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(3591e752) SHA1(df242d2f724edfd78f7191f0ba7a8cde2c09b25f), ROM_SKIP(7) )
2202   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e29a7a6c) SHA1(0bfb26076b390492eed81d4c4f0852c64fdccfce), ROM_SKIP(7) )
2203   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(e980f957) SHA1(78e8ef07f443ce7991a46005627d5802d36d731c), ROM_SKIP(7) )
2204   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(d90c5221) SHA1(7a330f39f3751d58157f872d92c3c2b91fe60d14), ROM_SKIP(7) )
2205   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(9be0d4de) SHA1(9bb67a1f1db77483e896fed7096c1e23c153ede4), ROM_SKIP(7) )
2206   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(122248af) SHA1(80dd5486106d475bd9f6d78919ebeb176e7becff), ROM_SKIP(7) )
2207   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) )
2192   ROMX_LOAD( "fish961007_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
2193   ROMX_LOAD( "fish961007_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
2194   ROMX_LOAD( "fish961007_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
2195   ROMX_LOAD( "fish961007_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
2196   ROMX_LOAD( "fish961007_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
2197   ROMX_LOAD( "fish961007_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
2198   ROMX_LOAD( "fish961007_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
2199   ROMX_LOAD( "fish961007_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
2200   ROMX_LOAD( "fish961007_gr1.63-56", 0x800000, 0x100000, CRC(ead678c9) SHA1(f83d467f6685965b6176b10adbd4e35ef808baf3), ROM_SKIP(7) )
2201   ROMX_LOAD( "fish961007_gr1.55-48", 0x800001, 0x100000, CRC(3591e752) SHA1(df242d2f724edfd78f7191f0ba7a8cde2c09b25f), ROM_SKIP(7) )
2202   ROMX_LOAD( "fish961007_gr1.47-40", 0x800002, 0x100000, CRC(e29a7a6c) SHA1(0bfb26076b390492eed81d4c4f0852c64fdccfce), ROM_SKIP(7) )
2203   ROMX_LOAD( "fish961007_gr1.39-32", 0x800003, 0x100000, CRC(e980f957) SHA1(78e8ef07f443ce7991a46005627d5802d36d731c), ROM_SKIP(7) )
2204   ROMX_LOAD( "fish961007_gr1.31-24", 0x800004, 0x100000, CRC(d90c5221) SHA1(7a330f39f3751d58157f872d92c3c2b91fe60d14), ROM_SKIP(7) )
2205   ROMX_LOAD( "fish961007_gr1.23-16", 0x800005, 0x100000, CRC(9be0d4de) SHA1(9bb67a1f1db77483e896fed7096c1e23c153ede4), ROM_SKIP(7) )
2206   ROMX_LOAD( "fish961007_gr1.15-08", 0x800006, 0x100000, CRC(122248af) SHA1(80dd5486106d475bd9f6d78919ebeb176e7becff), ROM_SKIP(7) )
2207   ROMX_LOAD( "fish961007_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) )
22082208ROM_END
22092209
22102210ROM_START( freezeat4 )
22112211   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2212   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) )
2213   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) )
2214   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(9d99c794) SHA1(f443f05a5979db66d61ef4174f0369a1cf4b7793) )
2215   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(e03700e0) SHA1(24d41750f02ee7e8fb379e517751b661400aa521) )
2212   ROM_LOAD32_BYTE( "961003_prog.hh",              0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) )
2213   ROM_LOAD32_BYTE( "961003_prog.hl",              0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) )
2214   ROM_LOAD32_BYTE( "961003_prog.lh",              0x000002, 0x040000, CRC(9d99c794) SHA1(f443f05a5979db66d61ef4174f0369a1cf4b7793) )
2215   ROM_LOAD32_BYTE( "961003_prog.ll",              0x000003, 0x040000, CRC(e03700e0) SHA1(24d41750f02ee7e8fb379e517751b661400aa521) )
22162216
22172217   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2218   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
2219   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
2220   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
2221   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
2222   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
2223   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
2224   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
2225   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
2226   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(c91b6ee4) SHA1(58d2d6b1b9847150b8b3e358842c4a097ef91475), ROM_SKIP(7) )
2227   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(65528e55) SHA1(18020cababed379f77149b7e89e80b294766df31), ROM_SKIP(7) )
2228   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(8fe4187f) SHA1(c9ceec40688617e1251142465d0e608f80a83e40), ROM_SKIP(7) )
2229   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(fdf05a42) SHA1(849e224b68be2fb396ee4cb4729517470af7c282), ROM_SKIP(7) )
2230   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(bb2cd741) SHA1(ac55a54c702d222cb1b9bb480b0f7a71bc315878), ROM_SKIP(7) )
2231   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ea8c5984) SHA1(eca1619c17dfac154a2024ec49b4b4f9f06a50c9), ROM_SKIP(7) )
2232   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(0b00c816) SHA1(879b0e9d92fe737d740c348dc1cc376c8abfbdb8), ROM_SKIP(7) )
2233   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) )
2218   ROMX_LOAD( "fish961003_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) )
2219   ROMX_LOAD( "fish961003_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) )
2220   ROMX_LOAD( "fish961003_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) )
2221   ROMX_LOAD( "fish961003_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) )
2222   ROMX_LOAD( "fish961003_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) )
2223   ROMX_LOAD( "fish961003_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) )
2224   ROMX_LOAD( "fish961003_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) )
2225   ROMX_LOAD( "fish961003_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) )
2226   ROMX_LOAD( "fish961003_gr1.63-56", 0x800000, 0x100000, CRC(c91b6ee4) SHA1(58d2d6b1b9847150b8b3e358842c4a097ef91475), ROM_SKIP(7) )
2227   ROMX_LOAD( "fish961003_gr1.55-48", 0x800001, 0x100000, CRC(65528e55) SHA1(18020cababed379f77149b7e89e80b294766df31), ROM_SKIP(7) )
2228   ROMX_LOAD( "fish961003_gr1.47-40", 0x800002, 0x100000, CRC(8fe4187f) SHA1(c9ceec40688617e1251142465d0e608f80a83e40), ROM_SKIP(7) )
2229   ROMX_LOAD( "fish961003_gr1.39-32", 0x800003, 0x100000, CRC(fdf05a42) SHA1(849e224b68be2fb396ee4cb4729517470af7c282), ROM_SKIP(7) )
2230   ROMX_LOAD( "fish961003_gr1.31-24", 0x800004, 0x100000, CRC(bb2cd741) SHA1(ac55a54c702d222cb1b9bb480b0f7a71bc315878), ROM_SKIP(7) )
2231   ROMX_LOAD( "fish961003_gr1.23-16", 0x800005, 0x100000, CRC(ea8c5984) SHA1(eca1619c17dfac154a2024ec49b4b4f9f06a50c9), ROM_SKIP(7) )
2232   ROMX_LOAD( "fish961003_gr1.15-08", 0x800006, 0x100000, CRC(0b00c816) SHA1(879b0e9d92fe737d740c348dc1cc376c8abfbdb8), ROM_SKIP(7) )
2233   ROMX_LOAD( "fish961003_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) )
22342234ROM_END
22352235
22362236ROM_START( freezeat5 )
22372237   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2238   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) )
2239   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) )
2240   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(3ddacd80) SHA1(79f9650531847eefd83908b6ea1e8362688b377c) )
2241   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(95ebefb0) SHA1(b88b12adabd7b0902c3a78919bcec8d9a2b04168) )
2238   ROM_LOAD32_BYTE( "960920_prog.hh",              0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) )
2239   ROM_LOAD32_BYTE( "960920_prog.hl",              0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) )
2240   ROM_LOAD32_BYTE( "960920_prog.lh",              0x000002, 0x040000, CRC(3ddacd80) SHA1(79f9650531847eefd83908b6ea1e8362688b377c) )
2241   ROM_LOAD32_BYTE( "960920_prog.ll",              0x000003, 0x040000, CRC(95ebefb0) SHA1(b88b12adabd7b0902c3a78919bcec8d9a2b04168) )
22422242
22432243   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2244   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(404a10c3) SHA1(8e353ac7608bd54f0fea610c85166ad14f2faadb), ROM_SKIP(7) )
2245   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(0b262f2f) SHA1(2a963cb5c3344091406d090edfdda498709c6aa6), ROM_SKIP(7) )
2246   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(43f86d26) SHA1(b31d36b11052514b5bcd5bf8e400457ca572c306), ROM_SKIP(7) )
2247   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(5cf0228f) SHA1(7a8c59cf9a7744e9f332db5f661f507323375968), ROM_SKIP(7) )
2248   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7a24ff98) SHA1(db9e0e8bb417f187267a6e4fc1e66ff060ee4096), ROM_SKIP(7) )
2249   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(ea163c93) SHA1(d07ed26191d36497c56b15774625a49ecb958386), ROM_SKIP(7) )
2250   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d364534f) SHA1(153908bb8929a898945f768f8bc3d853c6aeaceb), ROM_SKIP(7) )
2251   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(7ba4cb0d) SHA1(16bd487123f499b7080596dc76253081179a0f66), ROM_SKIP(7) )
2252   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(0e1fc4a9) SHA1(a200bb0af5f1e2c3f8d221ae4e9ba55b9dfb8550), ROM_SKIP(7) )
2253   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(b696b875) SHA1(16dc4d5cee3f08360cf19926584419c21d781f45), ROM_SKIP(7) )
2254   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e78d9302) SHA1(f8b5ed992c433d63677edbeafd3e465b1d42b455), ROM_SKIP(7) )
2255   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(9b50374c) SHA1(d8af3c9d8e0459e24b974cdf2e75c7c39582912f), ROM_SKIP(7) )
2256   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(b6a19b7e) SHA1(5668b27db4dade8efb1524b8ecd1fe78498e8460), ROM_SKIP(7) )
2257   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ff835b67) SHA1(19da2de1d067069871c33c8b25fd2eac2d03f627), ROM_SKIP(7) )
2258   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(8daf6995) SHA1(2f44031378b5fb1ba1f80a966dbe902316dc6fe8), ROM_SKIP(7) )
2259   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) )
2244   ROMX_LOAD( "fish960920_gr0.63-56", 0x000000, 0x100000, CRC(404a10c3) SHA1(8e353ac7608bd54f0fea610c85166ad14f2faadb), ROM_SKIP(7) )
2245   ROMX_LOAD( "fish960920_gr0.55-48", 0x000001, 0x100000, CRC(0b262f2f) SHA1(2a963cb5c3344091406d090edfdda498709c6aa6), ROM_SKIP(7) )
2246   ROMX_LOAD( "fish960920_gr0.47-40", 0x000002, 0x100000, CRC(43f86d26) SHA1(b31d36b11052514b5bcd5bf8e400457ca572c306), ROM_SKIP(7) )
2247   ROMX_LOAD( "fish960920_gr0.39-32", 0x000003, 0x100000, CRC(5cf0228f) SHA1(7a8c59cf9a7744e9f332db5f661f507323375968), ROM_SKIP(7) )
2248   ROMX_LOAD( "fish960920_gr0.31-24", 0x000004, 0x100000, CRC(7a24ff98) SHA1(db9e0e8bb417f187267a6e4fc1e66ff060ee4096), ROM_SKIP(7) )
2249   ROMX_LOAD( "fish960920_gr0.23-16", 0x000005, 0x100000, CRC(ea163c93) SHA1(d07ed26191d36497c56b15774625a49ecb958386), ROM_SKIP(7) )
2250   ROMX_LOAD( "fish960920_gr0.15-08", 0x000006, 0x100000, CRC(d364534f) SHA1(153908bb8929a898945f768f8bc3d853c6aeaceb), ROM_SKIP(7) )
2251   ROMX_LOAD( "fish960920_gr0.07-00", 0x000007, 0x100000, CRC(7ba4cb0d) SHA1(16bd487123f499b7080596dc76253081179a0f66), ROM_SKIP(7) )
2252   ROMX_LOAD( "fish960920_gr1.63-56", 0x800000, 0x100000, CRC(0e1fc4a9) SHA1(a200bb0af5f1e2c3f8d221ae4e9ba55b9dfb8550), ROM_SKIP(7) )
2253   ROMX_LOAD( "fish960920_gr1.55-48", 0x800001, 0x100000, CRC(b696b875) SHA1(16dc4d5cee3f08360cf19926584419c21d781f45), ROM_SKIP(7) )
2254   ROMX_LOAD( "fish960920_gr1.47-40", 0x800002, 0x100000, CRC(e78d9302) SHA1(f8b5ed992c433d63677edbeafd3e465b1d42b455), ROM_SKIP(7) )
2255   ROMX_LOAD( "fish960920_gr1.39-32", 0x800003, 0x100000, CRC(9b50374c) SHA1(d8af3c9d8e0459e24b974cdf2e75c7c39582912f), ROM_SKIP(7) )
2256   ROMX_LOAD( "fish960920_gr1.31-24", 0x800004, 0x100000, CRC(b6a19b7e) SHA1(5668b27db4dade8efb1524b8ecd1fe78498e8460), ROM_SKIP(7) )
2257   ROMX_LOAD( "fish960920_gr1.23-16", 0x800005, 0x100000, CRC(ff835b67) SHA1(19da2de1d067069871c33c8b25fd2eac2d03f627), ROM_SKIP(7) )
2258   ROMX_LOAD( "fish960920_gr1.15-08", 0x800006, 0x100000, CRC(8daf6995) SHA1(2f44031378b5fb1ba1f80a966dbe902316dc6fe8), ROM_SKIP(7) )
2259   ROMX_LOAD( "fish960920_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) )
22602260ROM_END
22612261
22622262ROM_START( freezeat6 )
22632263   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
2264   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) )
2265   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) )
2266   ROM_LOAD32_BYTE( "prog.lh",              0x000002, 0x040000, CRC(ce387e72) SHA1(021a274da0b828550a47c3778e1059d4e759693a) )
2267   ROM_LOAD32_BYTE( "prog.ll",              0x000003, 0x040000, CRC(9b307b7c) SHA1(71b696802fe7c867525d2626351dcfacedabd696) )
2264   ROM_LOAD32_BYTE( "960907_prog.hh",              0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) )
2265   ROM_LOAD32_BYTE( "960907_prog.hl",              0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) )
2266   ROM_LOAD32_BYTE( "960907_prog.lh",              0x000002, 0x040000, CRC(ce387e72) SHA1(021a274da0b828550a47c3778e1059d4e759693a) )
2267   ROM_LOAD32_BYTE( "960907_prog.ll",              0x000003, 0x040000, CRC(9b307b7c) SHA1(71b696802fe7c867525d2626351dcfacedabd696) )
22682268
22692269   ROM_REGION32_BE( 0x1000000, "user2", 0 )   /* 16MB for 64-bit ROM data */
2270   ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(293a3308) SHA1(e4c88759c3b8f8a359db83817dbd0428350b4f7e), ROM_SKIP(7) )
2271   ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(18bb4bdf) SHA1(1f6c49b3b5946390fa7582b531f8d9af3baa2567), ROM_SKIP(7) )
2272   ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(1faedcc6) SHA1(1e4ecbe4553fb3ebfbd03bd7e16066ccb531d00b), ROM_SKIP(7) )
2273   ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(536bc349) SHA1(06d7ac38b2c8cdc85e2cb531bba9c836e50c8247), ROM_SKIP(7) )
2274   ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(813d4a31) SHA1(e024f9da2f15a482d8142870baf487297b995ed9), ROM_SKIP(7) )
2275   ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(f881514b) SHA1(a694f90621e2c1569a6a5ed8920838ba5506f72e), ROM_SKIP(7) )
2276   ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d7634655) SHA1(d7ac83c0fa5d0ec57d096d4d704fe99ee8160e09), ROM_SKIP(7) )
2277   ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3fca32a3) SHA1(22753a9678e04d9355238e013e58d9f45315579d), ROM_SKIP(7) )
2278   ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(a2b89d3a) SHA1(9cfcd0b88dea192ba39efcdccc78d1a0fd8f3388), ROM_SKIP(7) )
2279   ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(766822a8) SHA1(2c9b14542a5467c1a3451559ea296da09c2cfdb9), ROM_SKIP(7) )
2280   ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(112b519c) SHA1(f0e1ed1b8ad271fa9708f513b11d5cca6e550668), ROM_SKIP(7) )
2281   ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(435b5d37) SHA1(ecb6e7271d993f8e315b85e69166838e66dd41a8), ROM_SKIP(7) )
2282   ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(2637ae7f) SHA1(5e0bd0e08d8c1eaae725b4d55030c2698abd46e7), ROM_SKIP(7) )
2283   ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(e732f1bf) SHA1(a228aee0cc36a0089716f20bfa75d87750692adb), ROM_SKIP(7) )
2284   ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(7d4e2d9e) SHA1(4cb9b754b7585df4cae6bdd7085a57729d53e643), ROM_SKIP(7) )
2285   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(8ea036af) SHA1(1f9baec6712e0ba0e8a744529e41799217760194), ROM_SKIP(7) )
2270   ROMX_LOAD( "fish960907_gr0.63-56", 0x000000, 0x100000, CRC(293a3308) SHA1(e4c88759c3b8f8a359db83817dbd0428350b4f7e), ROM_SKIP(7) )
2271   ROMX_LOAD( "fish960907_gr0.55-48", 0x000001, 0x100000, CRC(18bb4bdf) SHA1(1f6c49b3b5946390fa7582b531f8d9af3baa2567), ROM_SKIP(7) )
2272   ROMX_LOAD( "fish960907_gr0.47-40", 0x000002, 0x100000, CRC(1faedcc6) SHA1(1e4ecbe4553fb3ebfbd03bd7e16066ccb531d00b), ROM_SKIP(7) )
2273   ROMX_LOAD( "fish960907_gr0.39-32", 0x000003, 0x100000, CRC(536bc349) SHA1(06d7ac38b2c8cdc85e2cb531bba9c836e50c8247), ROM_SKIP(7) )
2274   ROMX_LOAD( "fish960907_gr0.31-24", 0x000004, 0x100000, CRC(813d4a31) SHA1(e024f9da2f15a482d8142870baf487297b995ed9), ROM_SKIP(7) )
2275   ROMX_LOAD( "fish960907_gr0.23-16", 0x000005, 0x100000, CRC(f881514b) SHA1(a694f90621e2c1569a6a5ed8920838ba5506f72e), ROM_SKIP(7) )
2276   ROMX_LOAD( "fish960907_gr0.15-08", 0x000006, 0x100000, CRC(d7634655) SHA1(d7ac83c0fa5d0ec57d096d4d704fe99ee8160e09), ROM_SKIP(7) )
2277   ROMX_LOAD( "fish960907_gr0.07-00", 0x000007, 0x100000, CRC(3fca32a3) SHA1(22753a9678e04d9355238e013e58d9f45315579d), ROM_SKIP(7) )
2278   ROMX_LOAD( "fish960907_gr1.63-56", 0x800000, 0x100000, CRC(a2b89d3a) SHA1(9cfcd0b88dea192ba39efcdccc78d1a0fd8f3388), ROM_SKIP(7) )
2279   ROMX_LOAD( "fish960907_gr1.55-48", 0x800001, 0x100000, CRC(766822a8) SHA1(2c9b14542a5467c1a3451559ea296da09c2cfdb9), ROM_SKIP(7) )
2280   ROMX_LOAD( "fish960907_gr1.47-40", 0x800002, 0x100000, CRC(112b519c) SHA1(f0e1ed1b8ad271fa9708f513b11d5cca6e550668), ROM_SKIP(7) )
2281   ROMX_LOAD( "fish960907_gr1.39-32", 0x800003, 0x100000, CRC(435b5d37) SHA1(ecb6e7271d993f8e315b85e69166838e66dd41a8), ROM_SKIP(7) )
2282   ROMX_LOAD( "fish960907_gr1.31-24", 0x800004, 0x100000, CRC(2637ae7f) SHA1(5e0bd0e08d8c1eaae725b4d55030c2698abd46e7), ROM_SKIP(7) )
2283   ROMX_LOAD( "fish960907_gr1.23-16", 0x800005, 0x100000, CRC(e732f1bf) SHA1(a228aee0cc36a0089716f20bfa75d87750692adb), ROM_SKIP(7) )
2284   ROMX_LOAD( "fish960907_gr1.15-08", 0x800006, 0x100000, CRC(7d4e2d9e) SHA1(4cb9b754b7585df4cae6bdd7085a57729d53e643), ROM_SKIP(7) )
2285   ROMX_LOAD( "fish960907_gr1.07-00", 0x800007, 0x100000, CRC(8ea036af) SHA1(1f9baec6712e0ba0e8a744529e41799217760194), ROM_SKIP(7) )
22862286ROM_END
22872287
22882288
src/mame/drivers/naomi.c
r14521r14522
68526852   ROM_LOAD("gds-0032_pic", 0x00, 0x50, NO_DUMP ) // PIC was missing
68536853ROM_END
68546854
6855ROM_START( initdv3e )
6856   NAOMI2_BIOS
6857   NAOMI_DEFAULT_EEPROM
6858
6859   DISK_REGION( "gdrom" )
6860   DISK_IMAGE_READONLY( "gds-0033", 0,  SHA1(8908238a0211c6343ce6f3f27729e33c4e276d35) )
6861
6862   ROM_REGION( 0x4300, "pic", ROMREGION_ERASEFF)
6863   //PIC16C622A (317-0384-COM)
6864    ROM_LOAD( "317-0384-com.pic", 0x000000, 0x004300, CRC(081ccd51) SHA1(598b3bd9e8b16f5954d15738c1ca55703609b690) )
6865ROM_END
6866
68556867/*
68566868Title   THE_MAZE_OF_THE_KINGS
68576869Media ID    E3D0
r14521r14522
70447056   ROM_LOAD( "mpr-23818.ic20", 0xa000000, 0x800000, CRC(be902c2b) SHA1(1f1aa6933da528bdcef45942a0caa33cb24e7ddd) )
70457057ROM_END
70467058
7059ROM_START( soulsurf )
7060   NAOMI2_BIOS
7061   NAOMI_DEFAULT_EEPROM
7062
7063    ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF)
7064    // Cart has a Sega factory EPROM sticker stating "EPR-23838C" and a Sega factory sticker stating "Rev. A".  Seriously.
7065    ROM_LOAD( "epr-23838c.ic22", 0x000000, 0x400000, CRC(5e5fb00f) SHA1(c5e81ebead9072cc08f09d1715d609cb0f7631ba) )
7066    ROM_RELOAD( 0x400000, 0x400000)
7067    ROM_LOAD( "ssf01.ic1s",   0x0800000, 0x800000, CRC(4f12f789) SHA1(7b79b687fc61e2e981b9e5e8e0939c4ad24a98f0) )
7068    ROM_LOAD( "ssf02.ic2s",   0x1000000, 0x800000, CRC(a255d41a) SHA1(3e932527eb68edf3e8538c1ad264a1c599f6a9d5) )
7069    ROM_LOAD( "ssf03.ic3s",   0x1800000, 0x800000, CRC(0f8d6577) SHA1(afaf440e667bacc941c0a5418a0e3b0f2bb725b7) )
7070    ROM_LOAD( "ssf04.ic4s",   0x2000000, 0x800000, CRC(bdf25bd0) SHA1(f79b1fdba9c48969c49617c43c1919637adb13ba) )
7071    ROM_LOAD( "ssf05.ic5s",   0x2800000, 0x800000, CRC(a74b3bb4) SHA1(0ce7cef849061a9af7a61d69dc633f6971a3a63d) )
7072    ROM_LOAD( "ssf06.ic6s",   0x3000000, 0x800000, CRC(3cd1f5d5) SHA1(77573c3a60af64e6e6a0eb85d5b8176ed98b0723) )
7073    ROM_LOAD( "ssf07.ic7s",   0x3800000, 0x800000, CRC(00d240f5) SHA1(43010fc596f2cdffdff35a6122f2ab02a5251bc0) )
7074    ROM_LOAD( "ssf08.ic8s",   0x4000000, 0x800000, CRC(d4907fa1) SHA1(79b1c771819f6e4baa048010bfb940a45370eba2) )
7075    ROM_LOAD( "ssf09.ic9s",   0x4800000, 0x800000, CRC(6327d49e) SHA1(a10e3c27f70dbf18e63cf51962b6a79a52eba26c) )
7076    ROM_LOAD( "ssf10.ic10s",  0x5000000, 0x800000, CRC(7975dc80) SHA1(81bda50968f0153a0c4432d8d81e817c1e82e5b2) )
7077    ROM_LOAD( "ssf11.ic11s",  0x5800000, 0x800000, CRC(a242f682) SHA1(435ea5bb1b3667f9ef3d7de081b15f4e8e6a0d01) )
7078    ROM_LOAD( "ssf12.ic12s",  0x6000000, 0x800000, CRC(45fa259e) SHA1(8d7e708e7a2cbc2d60b68715dd79bac28d894d4c) )
7079    ROM_LOAD( "ssf13.ic13s",  0x6800000, 0x800000, CRC(e9578063) SHA1(618f66d01f6bdacbf2a3242774a316b130594e02) )
7080    ROM_LOAD( "ssf14.ic14s",  0x7000000, 0x800000, CRC(2edc1311) SHA1(bceb54dd29012580e2e6f15f16c6b31195010153) )
7081    ROM_LOAD( "ssf15.ic15s",  0x7800000, 0x800000, CRC(416db320) SHA1(34536716a35260d9457703704bb9174fb1616d60) )
7082    ROM_LOAD( "ssf16.ic16s",  0x8000000, 0x800000, CRC(2530cc04) SHA1(6425c031e5a129a3c9451bc694b5da8553f154c2) )
7083    ROM_LOAD( "ssf17.ic17s",  0x8800000, 0x800000, CRC(9e6afcc2) SHA1(4fb69d834ea12c82e897af47a22dcc47f3c83768) )
7084    ROM_LOAD( "ssf18.ic18s",  0x9000000, 0x800000, CRC(854ed5e5) SHA1(e445599f6a9e9d05c279259307edc08bce5d6d1f) )
7085    ROM_LOAD( "ssf19.ic19s",  0x9800000, 0x800000, CRC(4f8ec86a) SHA1(406ab9eeccd99fa5515d4a2c229c8db1a5cb8f83) )
7086    ROM_LOAD( "ssf20.ic20s",  0xa000000, 0x800000, CRC(c90b960d) SHA1(66e9f09d1f7f6a991371574a2e095c0e22fb7031) )
7087    ROM_LOAD( "ssf21.ic21s",  0xa800000, 0x800000, CRC(1477c064) SHA1(87fb8d8a91d6bed70b246a8df88fa77fbf3db443) )
7088ROM_END
7089
70477090/*
70487091    Tests IC1 like gram2000 if actel_id is 0xffff, see ROM_COPY
70497092*/
r14521r14522
74817524   AW_BIOS
74827525
74837526   ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE)
7484   ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(27aab918) SHA1(41c5ddd8bd4c91481750606ab44aa115b5fe01d0) )
7527   ROM_LOAD( "ax2201en_p01.ic18", 0x0000000, 0x0800000, CRC(27aab918) SHA1(41c5ddd8bd4c91481750606ab44aa115b5fe01d0) )
74857528   ROM_LOAD( "ax2201m01.ic11", 0x1000000, 0x1000000, CRC(22ea665b) SHA1(292c92c9ae43eea2d1c27cedfb89c3956b8dea32) )
74867529   ROM_LOAD( "ax2202m01.ic12", 0x2000000, 0x1000000, CRC(7fad1bea) SHA1(89f3f88af48973a4685955d86ef97a1487b8e7a8) )
74877530   ROM_LOAD( "ax2203m01.ic13", 0x3000000, 0x1000000, CRC(78986ca4) SHA1(5a6c8c12955573f33361d2c6f20f85de35ac7bae) )
r14521r14522
74977540   AW_BIOS
74987541
74997542   ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE)
7500       ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(ecc4a5c7) SHA1(97c2ef2be95b39bc978474a8243740df50255a8b) )
7501       /* these are taken from the above set, game *seems* to work fine with these ... */
7543   ROM_LOAD( "ax2201jp_p01.ic18", 0x0000000, 0x0800000, CRC(ecc4a5c7) SHA1(97c2ef2be95b39bc978474a8243740df50255a8b) )
7544
7545   /* these are taken from the above set, game *seems* to work fine with these ... */
75027546   ROM_LOAD( "ax2201m01.ic11", 0x1000000, 0x1000000, CRC(22ea665b) SHA1(292c92c9ae43eea2d1c27cedfb89c3956b8dea32) )
75037547   ROM_LOAD( "ax2202m01.ic12", 0x2000000, 0x1000000, CRC(7fad1bea) SHA1(89f3f88af48973a4685955d86ef97a1487b8e7a8) )
75047548   ROM_LOAD( "ax2203m01.ic13", 0x3000000, 0x1000000, CRC(78986ca4) SHA1(5a6c8c12955573f33361d2c6f20f85de35ac7bae) )
r14521r14522
78117855/* 0062 */ GAME( 2002, clubkrte, naomi2,   naomi2,   naomi,    naomi2,   ROT0, "Sega", "Club Kart: European Session (Rev D)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
78127856/* 0080 */ GAME( 2002, vf4cart,  naomi2,   naomi2m2, naomi,    naomi2,   ROT0, "Sega", "Virtua Fighter 4 (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
78137857/* 0087 */ GAME( 2002, kingrt66, naomi2,   naomi2,   naomi,    naomi2,   ROT0, "Sega", "King of Route 66 (Rev A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
7814// 0095 Soul Surfer
7858/* 0095 */ GAME( 2002, soulsurf, naomi2,   naomi2,   naomi,    naomi2,   ROT0, "Sega", "Soul Surfer (Rev A)", GAME_FLAGS )
78157859/* 0106 */ GAME( 2002, vf4evoct, naomi2,   naomi2m1, naomi,    vf4evoct, ROT0, "Sega", "Virtua Fighter 4 Evolution (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
78167860// 0129 Club Kart Prize
78177861
r14521r14522
79047948// 0032A Initial D Arcade Stage Ver. 3 (Japan) (Rev A)
79057949/* 0032B */ GAME( 2004, initdv3jb, initdv3j, naomigd, naomi,    naomi2,   ROT0, "Sega", "Initial D Arcade Stage Ver. 3 (Japan) (Rev. B) (GDS-0032B)", GAME_FLAGS )
79067950/* 0032C */ GAME( 2004, initdv3j,  naomi2,   naomi2gd,naomi,    naomi2,   ROT0, "Sega", "Initial D Arcade Stage Ver. 3 (Japan) (Rev. C) (GDS-0032C)", GAME_FLAGS )
7907// 0033 Initial D Arcade Stage Ver. 3 (Export)
7951/* 0033 */ GAME( 2004, initdv3e,  naomi2,   naomi2gd,naomi,    naomi2,   ROT0, "Sega", "Initial D Arcade Stage Ver. 3 (Export) (GDS-0033)", GAME_FLAGS )
79087952// 0034
79097953// 0035
79107954// 0036  Virtua Fighter 4 Final Tuned
src/mame/drivers/vamphalf.c
r14521r14522
1818    Date Quiz Go Go Episode 2       (c) 2000 SemiCom
1919    Mission Craft                   (c) 2000 Sun                (version 2.4)
2020    Mr. Dig                         (c) 2000 Sun
21    Diet Family                     (c) 2001 SemiCom
2122    Final Godori                    (c) 2001 SemiCom            (version 2.20.5915)
2223    Wyvern Wings                    (c) 2001 SemiCom
2324    Mr. Kicker                      (c) 2001 SemiCom [1]
r14521r14522
4344   Red Wyvern - A semi-sequel or update?
4445 Same time era, but unknown hardware:
4546   Gaia The last Choice of the Earth (c) 1998 (might be Byron Future Assault type hardware)
46   Diet Family (c) 2001
4747   Choice III: Joker's Dream (c) 2001
4848
4949TODO:
r14521r14522
22842284   return state->m_wram[(0x00a99c / 2)+offset];
22852285}
22862286
2287static READ16_HANDLER( dtfamily_speedup_r ) /* WRONG!! Speed up */
2287static READ16_HANDLER( dtfamily_speedup_r )
22882288{
22892289   vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
22902290
2291   if (cpu_get_pc(&space->device()) == 0x130c2)
2291   int pc = cpu_get_pc(&space->device());
2292
2293   if (pc == 0x12fa6)
22922294      device_spin_until_interrupt(&space->device());
22932295
2294   return state->m_wram[0x780d8 / 2];
2296   return state->m_wram[0xcc2a8 / 2];
22952297
22962298}
22972299
r14521r14522
24492451static DRIVER_INIT( dtfamily )
24502452{
24512453   vamphalf_state *state = machine.driver_data<vamphalf_state>();
2452   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x780d8, 0x780d9, FUNC(dtfamily_speedup_r) ); /* WRONG!! */
2454   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xcc2a8, 0xcc2a9, FUNC(dtfamily_speedup_r) );
24532455
24542456   state->m_palshift = 0;
24552457   state->m_flip_bit = 1;
src/mame/drivers/rallyx.c
r14521r14522
218218   rallyx_state *state = space->machine().driver_data<rallyx_state>();
219219
220220   if (data == 0 && state->m_last_bang != 0)
221      sample_start(state->m_samples, 0, 0, 0);
221      state->m_samples->start(0, 0);
222222
223223   state->m_last_bang = data;
224224}
r14521r14522
880880   rallyx_state *state = machine.driver_data<rallyx_state>();
881881
882882   state->m_maincpu = machine.device<cpu_device>("maincpu");
883   state->m_samples = machine.device("samples");
883   state->m_samples = machine.device<samples_device>("samples");
884884
885885   state->save_item(NAME(state->m_last_bang));
886886   state->save_item(NAME(state->m_stars_enable));
r14521r14522
944944   MCFG_SOUND_CONFIG(namco_config)
945945   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
946946
947   MCFG_SOUND_ADD("samples", SAMPLES, 0)
948   MCFG_SOUND_CONFIG(rallyx_samples_interface)
947   MCFG_SAMPLES_ADD("samples", rallyx_samples_interface)
949948   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
950949MACHINE_CONFIG_END
951950
src/mame/drivers/gridlee.c
r14521r14522
451451   MCFG_SOUND_ADD("gridlee", GRIDLEE, 0)
452452   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
453453
454   MCFG_SOUND_ADD("samples", SAMPLES, 0)
455   MCFG_SOUND_CONFIG(gridlee_samples_interface)
454   MCFG_SAMPLES_ADD("samples", gridlee_samples_interface)
456455   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
457456MACHINE_CONFIG_END
458457
src/mame/drivers/dai3wksi.c
r14521r14522
197197static WRITE8_HANDLER( dai3wksi_audio_1_w )
198198{
199199   dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
200   device_t *samples = space->machine().device("samples");
200   samples_device *samples = space->machine().device<samples_device>("samples");
201201   UINT8 rising_bits = data & ~state->m_port_last1;
202202
203203   state->m_enabled_sound = data & 0x80;
r14521r14522
205205   if ((rising_bits & 0x20) && state->m_enabled_sound)
206206   {
207207      if (data & 0x04)
208         sample_start(samples, CHANNEL_SOUND5, SAMPLE_SOUND5, 0);
208         samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5);
209209      else
210         sample_start(samples, CHANNEL_SOUND5, SAMPLE_SOUND5, 1);
210         samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5, true);
211211   }
212212   if (!(data & 0x20) && (state->m_port_last1 & 0x20))
213      sample_stop(samples, CHANNEL_SOUND5);
213      samples->stop(CHANNEL_SOUND5);
214214
215215   state->m_port_last1 = data;
216216}
r14521r14522
218218static WRITE8_HANDLER( dai3wksi_audio_2_w )
219219{
220220   dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
221   device_t *samples = space->machine().device("samples");
221   samples_device *samples = space->machine().device<samples_device>("samples");
222222   UINT8 rising_bits = data & ~state->m_port_last2;
223223
224224   state->m_dai3wksi_flipscreen = data & 0x10;
r14521r14522
227227
228228   if (state->m_enabled_sound)
229229   {
230      if (rising_bits & 0x01) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND1, 0);
231      if (rising_bits & 0x02) sample_start(samples, CHANNEL_SOUND2, SAMPLE_SOUND2, 0);
232      if (rising_bits & 0x08) sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND4, 0);
230      if (rising_bits & 0x01) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1);
231      if (rising_bits & 0x02) samples->start(CHANNEL_SOUND2, SAMPLE_SOUND2);
232      if (rising_bits & 0x08) samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4);
233233      if (rising_bits & 0x04)
234234      {
235235         if (!state->m_sound3_counter)
236            sample_start(samples, CHANNEL_SOUND3, SAMPLE_SOUND3_1, 0);
236            samples->start(CHANNEL_SOUND3, SAMPLE_SOUND3_1);
237237         else
238            sample_start(samples, CHANNEL_SOUND3, SAMPLE_SOUND3_2, 0);
238            samples->start(CHANNEL_SOUND3, SAMPLE_SOUND3_2);
239239
240240         state->m_sound3_counter ^= 1;
241241      }
r14521r14522
247247static WRITE8_HANDLER( dai3wksi_audio_3_w )
248248{
249249   dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
250   device_t *samples = space->machine().device("samples");
250   samples_device *samples = space->machine().device<samples_device>("samples");
251251
252252   if (state->m_enabled_sound)
253253   {
254254      if (data & 0x40)
255         sample_start(samples, CHANNEL_SOUND6, SAMPLE_SOUND6_1, 0);
255         samples->start(CHANNEL_SOUND6, SAMPLE_SOUND6_1);
256256      else if (data & 0x80)
257         sample_start(samples, CHANNEL_SOUND6, SAMPLE_SOUND6_2, 0);
257         samples->start(CHANNEL_SOUND6, SAMPLE_SOUND6_2);
258258   }
259259}
260260
r14521r14522
607607   MCFG_SPEAKER_STANDARD_MONO("mono")
608608
609609#if (USE_SAMPLES)
610   MCFG_SOUND_ADD("samples", SAMPLES, 0)
611   MCFG_SOUND_CONFIG(dai3wksi_samples_interface)
610   MCFG_SAMPLES_ADD("samples", dai3wksi_samples_interface)
612611   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
613612#else
614613   MCFG_SOUND_ADD("ic76", SN76477, 0)
src/mame/drivers/galdrvr.c
r14521r14522
47914791
47924792   ROM_REGION( 0x2000, "samples", 0 )   /* samples */
47934793   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
4794   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
4794   ROM_LOAD( "my06e",        0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
47954795ROM_END
47964796
47974797ROM_START( mshuttle2 )
r14521r14522
47994799   ROM_LOAD( "my05",         0x0000, 0x1000, CRC(83574af1) SHA1(d69c2a0538a49d6c72c3346ac4e3959d91da6c98) )
48004800   ROM_LOAD( "my04",         0x1000, 0x1000, CRC(1cfae2c8) SHA1(6c7eeee70e91b8498c41525dcc60f8086cff8da7) )
48014801   ROM_LOAD( "my03",         0x2000, 0x1000, CRC(c8b8a368) SHA1(140ba60f55285d1e9f7a262634f5ce5c3470ab71) )
4802   ROM_LOAD( "my02",         0x3000, 0x1000, CRC(9804061c) SHA1(d5147e827c5a851f6baadea4a0a3b1deb19dda16) )
4803   ROM_LOAD( "my01",         0x4000, 0x1000, CRC(ca746a61) SHA1(259b1556b0646bf0108b1e3ffbd77bf7238350b0) )
4802   ROM_LOAD( "my02-2",         0x3000, 0x1000, CRC(9804061c) SHA1(d5147e827c5a851f6baadea4a0a3b1deb19dda16) )
4803   ROM_LOAD( "my01-2",         0x4000, 0x1000, CRC(ca746a61) SHA1(259b1556b0646bf0108b1e3ffbd77bf7238350b0) )
48044804
48054805   ROM_REGION( 0x4000, "gfx1", 0 )
48064806   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
4807   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
4807   ROM_LOAD( "my11-2",         0x1000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
48084808   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
48094809   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
48104810
src/mame/drivers/meritm.c
r14521r14522
15781578   ROM_RELOAD(                     0x380000, 0x80000)
15791579
15801580   ROM_REGION( 0x1000, "user2", 0 ) // PALs
1581   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(f31864ff) SHA1(ff44820379a350e7bd788ffb6926612b3483e114) )
1582   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(ad4fddaa) SHA1(10c1575dcaa5ca4af5dc630d84f43a9ed1cb3ace) )
1581   ROM_LOAD( "super_sc3943.u20",     0x000, 0x117, CRC(f31864ff) SHA1(ff44820379a350e7bd788ffb6926612b3483e114) )
1582   ROM_LOAD( "super_sc3944-0a.u19",  0x000, 0x2dd, CRC(ad4fddaa) SHA1(10c1575dcaa5ca4af5dc630d84f43a9ed1cb3ace) )
15831583   ROM_LOAD( "sc3980.u40",     0x000, 0x117, CRC(ee0cdab5) SHA1(216fef50a8a0f6a33b704d3501a4c5c3cbac2bad) )
15841584   ROM_LOAD( "sc3981-0a.u51",  0x000, 0x117, CRC(4fc750d0) SHA1(d09ff7a8c66aeb5c49e9fec84bd1521e3f5d8d0a) )
15851585ROM_END
src/mame/drivers/m63.c
r14521r14522
154154   device_t *m_soundcpu;
155155   device_t *m_ay1;
156156   device_t *m_ay2;
157   device_t *m_samples;
157   samples_device *m_samples;
158158};
159159
160160
r14521r14522
433433   m63_state *state = space->machine().driver_data<m63_state>();
434434
435435   if (data & 1)
436      sample_start_raw(state->m_samples, 0, state->m_samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0);
436      state->m_samples->start_raw(0, state->m_samplebuf + ((data & 0xf0) << 8), 0x2000, 8000);
437437}
438438
439439static WRITE8_HANDLER( nmi_mask_w )
r14521r14522
687687
688688static SAMPLES_START( fghtbskt_sh_start )
689689{
690   running_machine &machine = device->machine();
690   running_machine &machine = device.machine();
691691   m63_state *state = machine.driver_data<m63_state>();
692692   int i, len = machine.region("samples")->bytes();
693693   UINT8 *ROM = machine.region("samples")->base();
r14521r14522
719719   state->m_soundcpu = machine.device("soundcpu");
720720   state->m_ay1 = machine.device("ay1");
721721   state->m_ay2 = machine.device("ay2");
722   state->m_samples = machine.device("samples");
722   state->m_samples = machine.device<samples_device>("samples");
723723
724724   state->save_item(NAME(state->m_pal_bank));
725725   state->save_item(NAME(state->m_fg_flag));
r14521r14522
832832   MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8)
833833   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
834834
835   MCFG_SOUND_ADD("samples", SAMPLES, 0)
836   MCFG_SOUND_CONFIG(fghtbskt_samples_interface)
835   MCFG_SAMPLES_ADD("samples", fghtbskt_samples_interface)
837836   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
838837MACHINE_CONFIG_END
839838
src/mame/drivers/snk6502.c
r14521r14522
856856   MCFG_SOUND_ADD("snk6502", SNK6502, 0)
857857   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
858858
859   MCFG_SOUND_ADD("samples", SAMPLES, 0)
860   MCFG_SOUND_CONFIG(sasuke_samples_interface)
859   MCFG_SAMPLES_ADD("samples", sasuke_samples_interface)
861860   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
862861
863862   MCFG_SOUND_ADD("sn76477.1", SN76477, 0)
r14521r14522
884883   MCFG_GFXDECODE(satansat)
885884
886885   // sound hardware
887   MCFG_SOUND_REPLACE("samples", SAMPLES, 0)
888   MCFG_SOUND_CONFIG(vanguard_samples_interface)
886   MCFG_SAMPLES_REPLACE("samples", vanguard_samples_interface)
889887   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
890888
891889   MCFG_SOUND_REPLACE("sn76477.1", SN76477, 0)
r14521r14522
929927   MCFG_SOUND_ADD("snk6502", SNK6502, 0)
930928   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
931929
932   MCFG_SOUND_ADD("samples", SAMPLES, 0)
933   MCFG_SOUND_CONFIG(vanguard_samples_interface)
930   MCFG_SAMPLES_ADD("samples", vanguard_samples_interface)
934931   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
935932
936933   MCFG_SOUND_ADD("sn76477.1", SN76477, 0)
r14521r14522
948945   MCFG_CPU_PROGRAM_MAP(fantasy_map)
949946
950947   // sound hardware
951   MCFG_SOUND_REPLACE("samples", SAMPLES, 0)
952   MCFG_SOUND_CONFIG(fantasy_samples_interface)
948   MCFG_SAMPLES_REPLACE("samples", fantasy_samples_interface)
953949   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
954950
955951   MCFG_SOUND_REPLACE("sn76477.1", SN76477, 0)
src/mame/drivers/polyplay.c
r14521r14522
300300   /* sound hardware */
301301   MCFG_SPEAKER_STANDARD_MONO("mono")
302302
303   MCFG_SOUND_ADD("samples", SAMPLES, 0)
304   MCFG_SOUND_CONFIG(polyplay_samples_interface)
303   MCFG_SAMPLES_ADD("samples", polyplay_samples_interface)
305304   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
306305MACHINE_CONFIG_END
307306
src/mame/drivers/aristmk4.c
r14521r14522
266266
267267   int m_rtc_address_strobe;
268268   int m_rtc_data_strobe;
269   device_t *m_samples;
269   samples_device *m_samples;
270270   UINT8 *m_shapeRomPtr;
271271   UINT8 m_shapeRom[0xc000];
272272   UINT8 *m_mkiv_vram;
r14521r14522
577577      if(emet[i])
578578      {
579579      //logerror("Mechanical meter %d pulse: %02d\n",i+1, emet[i]);
580      sample_start(state->m_samples,i,0, FALSE); // pulse sound for mechanical meters
580      state->m_samples->start(i,0); // pulse sound for mechanical meters
581581      }
582582   }
583583}
r14521r14522
16171617{
16181618   aristmk4_state *state = machine.driver_data<aristmk4_state>();
16191619
1620   state->m_samples = machine.device("samples");
1620   state->m_samples = machine.device<samples_device>("samples");
16211621   state_save_register_global_pointer(machine, state->m_nvram, 0x1000); // state->m_nvram
16221622}
16231623
r14521r14522
17011701   MCFG_SOUND_CONFIG(ay8910_config2)
17021702   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
17031703
1704   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1705   MCFG_SOUND_CONFIG(meter_samples_interface)
1704   MCFG_SAMPLES_ADD("samples", meter_samples_interface)
17061705   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
17071706
17081707MACHINE_CONFIG_END
src/mame/drivers/superqix.c
r14521r14522
110110
111111static SAMPLES_START( pbillian_sh_start )
112112{
113   superqix_state *state = device->machine().driver_data<superqix_state>();
114   running_machine &machine = device->machine();
113   superqix_state *state = device.machine().driver_data<superqix_state>();
114   running_machine &machine = device.machine();
115115   UINT8 *src = machine.region("samples")->base();
116116   int i, len = machine.region("samples")->bytes();
117117
r14521r14522
124124static WRITE8_HANDLER( pbillian_sample_trigger_w )
125125{
126126   superqix_state *state = space->machine().driver_data<superqix_state>();
127   device_t *samples = space->machine().device("samples");
127   samples_device *samples = space->machine().device<samples_device>("samples");
128128   UINT8 *src = space->machine().region("samples")->base();
129129   int len = space->machine().region("samples")->bytes();
130130   int start,end;
r14521r14522
135135   while (end < len && src[end] != 0xff)
136136      end++;
137137
138   sample_start_raw(samples, 0, state->m_samplebuf + start, end - start, 5000, 0); // 5khz ?
138   samples->start_raw(0, state->m_samplebuf + start, end - start, 5000); // 5khz ?
139139}
140140
141141
r14521r14522
10701070   MCFG_SOUND_CONFIG(pbillian_ay8910_interface)
10711071   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
10721072
1073   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1074   MCFG_SOUND_CONFIG(pbillian_samples_interface)
1073   MCFG_SAMPLES_ADD("samples", pbillian_samples_interface)
10751074   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10761075MACHINE_CONFIG_END
10771076
r14521r14522
11051104   MCFG_SOUND_CONFIG(hotsmash_ay8910_interface)
11061105   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
11071106
1108   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1109   MCFG_SOUND_CONFIG(pbillian_samples_interface)
1107   MCFG_SAMPLES_ADD("samples", pbillian_samples_interface)
11101108   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
11111109MACHINE_CONFIG_END
11121110
src/mame/drivers/astinvad.c
r14521r14522
6161   device_t *m_maincpu;
6262   device_t *m_ppi8255_0;
6363   device_t *m_ppi8255_1;
64   device_t *m_samples;
64   samples_device *m_samples;
6565};
6666
6767
r14521r14522
230230   state->m_maincpu = machine.device("maincpu");
231231   state->m_ppi8255_0 = machine.device("ppi8255_0");
232232   state->m_ppi8255_1 = machine.device("ppi8255_1");
233   state->m_samples = machine.device("samples");
233   state->m_samples = machine.device<samples_device>("samples");
234234
235235   state->m_int_timer = machine.scheduler().timer_alloc(FUNC(kamizake_int_gen));
236236   state->m_int_timer->adjust(machine.primary_screen->time_until_pos(128), 128);
r14521r14522
256256   astinvad_state *state = machine.driver_data<astinvad_state>();
257257
258258   state->m_maincpu = machine.device("maincpu");
259   state->m_samples = machine.device("samples");
259   state->m_samples = machine.device<samples_device>("samples");
260260
261261   state->save_item(NAME(state->m_screen_flip));
262262   state->save_item(NAME(state->m_sound_state));
r14521r14522
327327   int bits_gone_hi = data & ~state->m_sound_state[0];
328328   state->m_sound_state[0] = data;
329329
330   if (bits_gone_hi & 0x01) sample_start(state->m_samples, 0, SND_UFO, 1);
331   if (!(data & 0x01))      sample_stop(state->m_samples, 0);
332   if (bits_gone_hi & 0x02) sample_start(state->m_samples, 1, SND_SHOT, 0);
333   if (bits_gone_hi & 0x04) sample_start(state->m_samples, 2, SND_BASEHIT, 0);
334   if (bits_gone_hi & 0x08) sample_start(state->m_samples, 3, SND_INVADERHIT, 0);
330   if (bits_gone_hi & 0x01) state->m_samples->start(0, SND_UFO, true);
331   if (!(data & 0x01))      state->m_samples->stop(0);
332   if (bits_gone_hi & 0x02) state->m_samples->start(1, SND_SHOT);
333   if (bits_gone_hi & 0x04) state->m_samples->start(2, SND_BASEHIT);
334   if (bits_gone_hi & 0x08) state->m_samples->start(3, SND_INVADERHIT);
335335
336336   device->machine().sound().system_enable(data & 0x20);
337337   state->m_screen_red = data & 0x04;
r14521r14522
344344   int bits_gone_hi = data & ~state->m_sound_state[1];
345345   state->m_sound_state[1] = data;
346346
347   if (bits_gone_hi & 0x01) sample_start(state->m_samples, 5, SND_FLEET1, 0);
348   if (bits_gone_hi & 0x02) sample_start(state->m_samples, 5, SND_FLEET2, 0);
349   if (bits_gone_hi & 0x04) sample_start(state->m_samples, 5, SND_FLEET3, 0);
350   if (bits_gone_hi & 0x08) sample_start(state->m_samples, 5, SND_FLEET4, 0);
351   if (bits_gone_hi & 0x10) sample_start(state->m_samples, 4, SND_UFOHIT, 0);
347   if (bits_gone_hi & 0x01) state->m_samples->start(5, SND_FLEET1);
348   if (bits_gone_hi & 0x02) state->m_samples->start(5, SND_FLEET2);
349   if (bits_gone_hi & 0x04) state->m_samples->start(5, SND_FLEET3);
350   if (bits_gone_hi & 0x08) state->m_samples->start(5, SND_FLEET4);
351   if (bits_gone_hi & 0x10) state->m_samples->start(4, SND_UFOHIT);
352352
353353   state->m_screen_flip = (input_port_read(device->machine(), "CABINET") & data & 0x20) ? 0xff : 0x00;
354354}
r14521r14522
360360   int bits_gone_hi = data & ~state->m_sound_state[0];
361361   state->m_sound_state[0] = data;
362362
363   if (bits_gone_hi & 0x01) sample_start(state->m_samples, 1, SND_SHOT, 0);
364   if (bits_gone_hi & 0x02) sample_start(state->m_samples, 2, SND_BASEHIT, 0);
365   if (bits_gone_hi & 0x04) sample_start(state->m_samples, 4, SND_UFOHIT, 0);
366   if (bits_gone_hi & 0x08) sample_start(state->m_samples, 0, SND_UFO, 1);
367   if (!(data & 0x08))      sample_stop(state->m_samples, 0);
363   if (bits_gone_hi & 0x01) state->m_samples->start(1, SND_SHOT);
364   if (bits_gone_hi & 0x02) state->m_samples->start(2, SND_BASEHIT);
365   if (bits_gone_hi & 0x04) state->m_samples->start(4, SND_UFOHIT);
366   if (bits_gone_hi & 0x08) state->m_samples->start(0, SND_UFO, true);
367   if (!(data & 0x08))      state->m_samples->stop(0);
368368
369   if (bits_gone_hi & 0x10) sample_start(state->m_samples, 5, SND_FLEET1, 0);
370   if (bits_gone_hi & 0x20) sample_start(state->m_samples, 5, SND_FLEET2, 0);
371   if (bits_gone_hi & 0x40) sample_start(state->m_samples, 5, SND_FLEET3, 0);
372   if (bits_gone_hi & 0x80) sample_start(state->m_samples, 5, SND_FLEET4, 0);
369   if (bits_gone_hi & 0x10) state->m_samples->start(5, SND_FLEET1);
370   if (bits_gone_hi & 0x20) state->m_samples->start(5, SND_FLEET2);
371   if (bits_gone_hi & 0x40) state->m_samples->start(5, SND_FLEET3);
372   if (bits_gone_hi & 0x80) state->m_samples->start(5, SND_FLEET4);
373373}
374374
375375
r14521r14522
381381
382382   space->machine().sound().system_enable(data & 0x02);
383383
384   if (bits_gone_hi & 0x04) sample_start(state->m_samples, 3, SND_INVADERHIT, 0);
384   if (bits_gone_hi & 0x04) state->m_samples->start(3, SND_INVADERHIT);
385385
386386   state->m_screen_flip = (input_port_read(space->machine(), "CABINET") & data & 0x80) ? 0xff : 0x00;
387387}
r14521r14522
605605   /* sound hardware */
606606   MCFG_SPEAKER_STANDARD_MONO("mono")
607607
608   MCFG_SOUND_ADD("samples", SAMPLES, 0)
609   MCFG_SOUND_CONFIG(astinvad_samples_interface)
608   MCFG_SAMPLES_ADD("samples", astinvad_samples_interface)
610609   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
611610MACHINE_CONFIG_END
612611
r14521r14522
642641   /* sound hardware */
643642   MCFG_SPEAKER_STANDARD_MONO("mono")
644643
645   MCFG_SOUND_ADD("samples", SAMPLES, 0)
646   MCFG_SOUND_CONFIG(astinvad_samples_interface)
644   MCFG_SAMPLES_ADD("samples", astinvad_samples_interface)
647645   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
648646MACHINE_CONFIG_END
649647
src/mame/drivers/esh.c
r14521r14522
346346   /* Main program CPU */
347347   ROM_REGION( 0x4000, "maincpu", 0 )
348348   ROM_LOAD( "is1.h8", 0x0000, 0x2000, CRC(114c912b) SHA1(7c033a102d046199f3e2c6787579dac5b5295d50) )
349   ROM_LOAD( "is2.f8", 0x2000, 0x2000, CRC(7a562f49) SHA1(acfa49b3b3d96b001a5dbdee39cbb0ca80be1763) )
349   ROM_LOAD( "esha_is2.f8", 0x2000, 0x2000, CRC(7a562f49) SHA1(acfa49b3b3d96b001a5dbdee39cbb0ca80be1763) )
350350
351351   /* Tiles */
352352   ROM_REGION( 0x3000, "gfx1", 0 )
src/mame/drivers/gottlieb.c
r14521r14522
19071907   MCFG_DEVICE_REMOVE("nvram")
19081908
19091909   /* sound hardware */
1910   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1911   MCFG_SOUND_CONFIG(reactor_samples_interface)
1910   MCFG_SAMPLES_ADD("samples", reactor_samples_interface)
19121911   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
19131912MACHINE_CONFIG_END
19141913
r14521r14522
19161915static MACHINE_CONFIG_DERIVED( qbert, gottlieb1 )
19171916
19181917   /* video hardware */
1919   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1920   MCFG_SOUND_CONFIG(qbert_samples_interface)
1918   MCFG_SAMPLES_ADD("samples", qbert_samples_interface)
19211919   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
19221920MACHINE_CONFIG_END
19231921
src/mame/drivers/maygayep.c
r14521r14522
46554655
46564656GAME( 199?, ep_braid   ,  0,        maygayep,  maygayep,  0,  ROT0, "Extreme",        "Bank Raid (Extreme) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46574657GAME( 199?, ep_bathl   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Bat Outa Hell (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
4658GAME( 199?, ep_beavr   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Beaver Las Vegas (Global) (EPOCH, set 1)",        GAME_IS_SKELETON_MECHANICAL )
4659GAME( 199?, ep_beavra   ,  ep_beavr, maygayep,  maygayep,  0,  ROT0, "Global",        "Beaver Las Vegas (Global) (EPOCH, set 2)",        GAME_IS_SKELETON_MECHANICAL )
4658GAME( 199?, ep_beavr   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Casino Beaver Las Vegas (Global) (EPOCH, set 1)",        GAME_IS_SKELETON_MECHANICAL )
4659GAME( 199?, ep_beavra   ,  ep_beavr, maygayep,  maygayep,  0,  ROT0, "Global",        "Casino Beaver Las Vegas (Global) (EPOCH, set 2)",        GAME_IS_SKELETON_MECHANICAL )
46604660GAME( 199?, ep_bvrcl   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Beaver Las Vegas Club (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46614661GAME( 199?, ep_bvruc   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Beaver Uncovered (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46624662GAME( 199?, ep_bjclb   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Blackjack Club, The (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
r14521r14522
46914691GAME( 199?, ep_monrt   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Money Returns Club, The (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46924692GAME( 199?, ep_monsh   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "The Moonshine Club (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46934693GAME( 199?, ep_mummy   ,  0,        maygayep,  maygayep,  0,  ROT0, "Impulse",        "Mummy Talks (Impulse) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
4694GAME( 199?, ep_pkni      ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Phoenix Knights (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
4694GAME( 199?, ep_pkni      ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "The Phoenix Knights (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46954695GAME( 199?, ep_redl      ,  0,        maygayep,  maygayep,  0,  ROT0, "Extreme",        "Red Line (Extreme) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46964696GAME( 199?, ep_rchik   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Rich Chics Club (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
46974697GAME( 199?, ep_royrc   ,  0,        maygayep,  maygayep,  0,  ROT0, "Impulse",        "Royal Roulette Club (Impulse) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
r14521r14522
47084708GAME( 199?, ep_utncl   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Utter Nutter Club (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
47094709GAME( 199?, ep_wleek   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Weakest Leek Club (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
47104710GAME( 199?, ep_wud      ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "What's Up Doc (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
4711GAME( 199?, ep_milhr   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Who Wants To Be A Millionhare (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
4711GAME( 199?, ep_milhr   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Who Wants To Be A Millionhare? (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
47124712GAME( 199?, ep_mlhrc   ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Who Whats To Be A Millionhare Club (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
47134713GAME( 199?, ep_wf      ,  0,        maygayep,  maygayep,  0,  ROT0, "Global",        "Wildfire (Global) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
47144714GAME( 199?, ep_bbars   ,  0,        maygayep,  maygayep,  0,  ROT0, "Maygay",        "Balloon Bars (Maygay) (EPOCH)",        GAME_IS_SKELETON_MECHANICAL )
src/mame/drivers/ddragon.c
r14521r14522
14891489
14901490ROM_START( ddragonb2 )
14911491   ROM_REGION( 0x30000, "maincpu", 0 )   /* 64k for code + bankswitched memory */
1492   ROM_LOAD( "4.bin",        0x08000, 0x08000, CRC(668dfa19) SHA1(9b2ff1b66eeba0989e4ed850b7df1f5719ba5572) )
1493   ROM_LOAD( "5.bin",        0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */
1494   ROM_LOAD( "6.bin",        0x18000, 0x08000, CRC(3bdea613) SHA1(d9038c80646a6ce3ea61da222873237b0383680e) ) /* banked at 0x4000-0x8000 */
1495   ROM_LOAD( "7.bin",        0x20000, 0x08000, CRC(728f87b9) SHA1(d7442be24d41bb9fc021587ef44ae5b830e4503d) ) /* banked at 0x4000-0x8000 */
1492   ROM_LOAD( "b2_4.bin",     0x08000, 0x08000, CRC(668dfa19) SHA1(9b2ff1b66eeba0989e4ed850b7df1f5719ba5572) )
1493   ROM_LOAD( "b2_5.bin",     0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */
1494   ROM_LOAD( "b2_6.bin",     0x18000, 0x08000, CRC(3bdea613) SHA1(d9038c80646a6ce3ea61da222873237b0383680e) ) /* banked at 0x4000-0x8000 */
1495   ROM_LOAD( "b2_7.bin",     0x20000, 0x08000, CRC(728f87b9) SHA1(d7442be24d41bb9fc021587ef44ae5b830e4503d) ) /* banked at 0x4000-0x8000 */
14961496
14971497   ROM_REGION( 0x10000, "sub", 0 ) /* sprite cpu */
14981498   ROM_LOAD( "63701.bin",    0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) )
r14521r14522
15011501   ROM_LOAD( "b2_3.bin",     0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) )
15021502
15031503   ROM_REGION( 0x08000, "gfx1", 0 )
1504   ROM_LOAD( "8.bin",        0x00000, 0x08000, CRC(7a8b8db4) SHA1(8368182234f9d4d763d4714fd7567a9e31b7ebeb) )   /* chars */
1504   ROM_LOAD( "b2_8.bin",     0x00000, 0x08000, CRC(7a8b8db4) SHA1(8368182234f9d4d763d4714fd7567a9e31b7ebeb) )   /* chars */
15051505
15061506   ROM_REGION( 0x80000, "gfx2", 0 )
15071507   ROM_LOAD( "11.bin",       0x00000, 0x10000, CRC(574face3) SHA1(481fe574cb79d0159a65ff7486cbc945d50538c5) )   /* sprites */
r14521r14522
15371537 */
15381538ROM_START( ddragon6809 )
15391539   ROM_REGION( 0x30000, "maincpu", 0 )   /* 64k for code + bankswitched memory */
1540   ROM_LOAD( "16.bin",   0x08000, 0x08000, CRC(f4c72690) SHA1(c70d032355acf3f7f6586b6e57a94f80e099bf1a) )
1541   ROM_LOAD( "17.bin",   0x10000, 0x08000, CRC(6489d637) SHA1(fd17fd870e9386a3e3bdd56c8d731c73d8c70b88) ) /* banked at 0x4000-0x8000 */
1542   ROM_LOAD( "18.bin",   0x18000, 0x08000, CRC(154d50c4) SHA1(4ffdd29406b6c6b552344f820f83715b1c7727d1) ) /* banked at 0x4000-0x8000 */
1543   ROM_LOAD( "19.bin",   0x20000, 0x08000, CRC(090e2baf) SHA1(29b775c59c7a4d30a33e3d10e736cd1a83baf3bb) ) /* banked at 0x4000-0x8000 */
1540   ROM_LOAD( "6809_16.bin",   0x08000, 0x08000, CRC(f4c72690) SHA1(c70d032355acf3f7f6586b6e57a94f80e099bf1a) )
1541   ROM_LOAD( "6809_17.bin",   0x10000, 0x08000, CRC(6489d637) SHA1(fd17fd870e9386a3e3bdd56c8d731c73d8c70b88) ) /* banked at 0x4000-0x8000 */
1542   ROM_LOAD( "6809_18.bin",   0x18000, 0x08000, CRC(154d50c4) SHA1(4ffdd29406b6c6b552344f820f83715b1c7727d1) ) /* banked at 0x4000-0x8000 */
1543   ROM_LOAD( "6809_19.bin",   0x20000, 0x08000, CRC(090e2baf) SHA1(29b775c59c7a4d30a33e3d10e736cd1a83baf3bb) ) /* banked at 0x4000-0x8000 */
15441544
15451545   ROM_REGION( 0x10000, "sub", 0 ) /* sprite cpu */
1546   ROM_LOAD( "20.bin",    0x8000, 0x8000, CRC(67e3b4f1) SHA1(4945d76b0694299f2f4739ebfba98da6d96fe4cb) )
1546   ROM_LOAD( "6809_20.bin",   0x8000, 0x8000, CRC(67e3b4f1) SHA1(4945d76b0694299f2f4739ebfba98da6d96fe4cb) )
15471547
15481548   ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
15491549   ROM_LOAD( "21.bin",      0x08000, 0x08000, CRC(4437fc51) SHA1(fffcf2bec50d0b79861904b4abc607206b7794e6) )
r14521r14522
15521552   ROM_REGION( 0x08000, "gfx1", ROMREGION_ERASEFF )
15531553
15541554   ROM_REGION( 0x08000, "chars", 0 )
1555   ROM_LOAD( "13.bin",        0x00000, 0x08000, CRC(b5a54537) SHA1(a6157cde4f9738565008d11a4a6d8576ae3abfef) )   /* chars */
1555   ROM_LOAD( "6809_13.bin",   0x00000, 0x08000, CRC(b5a54537) SHA1(a6157cde4f9738565008d11a4a6d8576ae3abfef) )   /* chars */
15561556
15571557   ROM_REGION( 0x80000, "gfx2", 0 )
15581558   ROM_LOAD( "22.bin",        0x00000, 0x08000, CRC(fe08ef61) SHA1(50404936934dc61f3553add4d4b918529b3b5ef3) )
r14521r14522
15641564   ROM_LOAD( "28.bin",        0x30000, 0x08000, CRC(51b8a217) SHA1(60c067cd7272f856e29cdb64312535236656891a) )
15651565   ROM_LOAD( "29.bin",        0x38000, 0x08000, CRC(e4ec2394) SHA1(43376ce2a07c1fc3053f7ac9b750e944d289105b) )
15661566   ROM_LOAD( "6809_1.bin",    0x40000, 0x08000, CRC(2485a71d) SHA1(3e987a2f3e9a59da5fdc7bb779a43736ca67aac7) )
1567   ROM_LOAD( "2.bin",         0x48000, 0x08000, CRC(6940120d) SHA1(bbe94f095ef983f54658c936f916ba6a72a84ead) )
1568   ROM_LOAD( "3.bin",         0x50000, 0x08000, CRC(c67aac12) SHA1(aab535507e3889bf1bdc2f4fe4828a70a350ba63) )
1569   ROM_LOAD( "4.bin",         0x58000, 0x08000, CRC(941dcd08) SHA1(266dee264f28affe8c3f57fe569929817ae16508) )
1570   ROM_LOAD( "5.bin",         0x60000, 0x08000, CRC(42d36bc3) SHA1(080cbc3ffda8ab26dc65a8e9eaf948c509d064b3) )
1571   ROM_LOAD( "6.bin",         0x68000, 0x08000, CRC(d5d19a8d) SHA1(c4b044dd12d6468c0ad114644f01813d4fe9a673) )
1572   ROM_LOAD( "7.bin",         0x70000, 0x08000, CRC(d4e350cd) SHA1(78ed2baa8c52b766f998091e7ce9e1a2941352e7) )
1573   ROM_LOAD( "8.bin",         0x78000, 0x08000, CRC(204fdb7d) SHA1(f75b1bc6f65e7a33927cd451267fcd7e2aa44f7e) )
1567   ROM_LOAD( "6809_2.bin",    0x48000, 0x08000, CRC(6940120d) SHA1(bbe94f095ef983f54658c936f916ba6a72a84ead) )
1568   ROM_LOAD( "6809_3.bin",    0x50000, 0x08000, CRC(c67aac12) SHA1(aab535507e3889bf1bdc2f4fe4828a70a350ba63) )
1569   ROM_LOAD( "6809_4.bin",    0x58000, 0x08000, CRC(941dcd08) SHA1(266dee264f28affe8c3f57fe569929817ae16508) )
1570   ROM_LOAD( "6809_5.bin",    0x60000, 0x08000, CRC(42d36bc3) SHA1(080cbc3ffda8ab26dc65a8e9eaf948c509d064b3) )
1571   ROM_LOAD( "6809_6.bin",    0x68000, 0x08000, CRC(d5d19a8d) SHA1(c4b044dd12d6468c0ad114644f01813d4fe9a673) )
1572   ROM_LOAD( "6809_7.bin",    0x70000, 0x08000, CRC(d4e350cd) SHA1(78ed2baa8c52b766f998091e7ce9e1a2941352e7) )
1573   ROM_LOAD( "6809_8.bin",    0x78000, 0x08000, CRC(204fdb7d) SHA1(f75b1bc6f65e7a33927cd451267fcd7e2aa44f7e) )
15741574
15751575   ROM_REGION( 0x40000, "gfx3", 0 )
1576   ROM_LOAD( "9.bin",         0x00000, 0x10000, CRC(736eff0f) SHA1(ae2ec2d5c8ab1db579a08256d874426dc5d889c6) )
1576   ROM_LOAD( "6809_9.bin",    0x00000, 0x10000, CRC(736eff0f) SHA1(ae2ec2d5c8ab1db579a08256d874426dc5d889c6) )
15771577   ROM_LOAD( "6809_10.bin",   0x10000, 0x10000, CRC(a670d088) SHA1(27e7b49645753dd039f104c3e0a7e6513a98710d) )
1578   ROM_LOAD( "11.bin",        0x20000, 0x10000, CRC(4171b70d) SHA1(dc300c9bca6481417e97ad03c973e47389f261c1) )
1579   ROM_LOAD( "12.bin",        0x30000, 0x10000, CRC(5f6a6d6f) SHA1(7d546a226cda81c28e7ccfb4c5daebc65072198d) )
1578   ROM_LOAD( "6809_11.bin",   0x20000, 0x10000, CRC(4171b70d) SHA1(dc300c9bca6481417e97ad03c973e47389f261c1) )
1579   ROM_LOAD( "6809_12.bin",   0x30000, 0x10000, CRC(5f6a6d6f) SHA1(7d546a226cda81c28e7ccfb4c5daebc65072198d) )
15801580
15811581   ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples  */
1582   ROM_LOAD( "14.bin",        0x00000, 0x08000, CRC(678f8657) SHA1(2652fdc6719d2c889ca87802f6e2cefae59fc2eb) )
1583   ROM_LOAD( "15.bin",        0x10000, 0x08000, CRC(10f21dea) SHA1(739cf649f91490384297a81a2cc9855acb58a1c0) )
1582   ROM_LOAD( "6809_14.bin",   0x00000, 0x08000, CRC(678f8657) SHA1(2652fdc6719d2c889ca87802f6e2cefae59fc2eb) )
1583   ROM_LOAD( "6809_15.bin",   0x10000, 0x08000, CRC(10f21dea) SHA1(739cf649f91490384297a81a2cc9855acb58a1c0) )
15841584ROM_END
15851585
15861586/*
src/mame/drivers/goldnpkr.c
r14521r14522
36293629   ROM_LOAD( "wc3050.a5",   0x4000, 0x2000, CRC(6f35b9c4) SHA1(df86687164f18f2bfe71e73cccd28fe4117e748c) )    /* text layer, alt gfx */
36303630
36313631   ROM_REGION( 0x6000, "gfx2", 0 )
3632   ROM_LOAD( "wc_cdh1.a2",   0x0000, 0x2000, CRC(10b34856) SHA1(52e4cc81b36b4c807b1d4471c0f7bea66108d3fd) )    /* cards deck gfx, bitplane1 */
3633   ROM_LOAD( "wc_cdh2.a4",   0x2000, 0x2000, CRC(5fc965ef) SHA1(d9ecd7e9b4915750400e76ca604bec8152df1fe4) )    /* cards deck gfx, bitplane2 */
3632   ROM_LOAD( "wch1.a2",   0x0000, 0x2000, CRC(10b34856) SHA1(52e4cc81b36b4c807b1d4471c0f7bea66108d3fd) )    /* cards deck gfx, bitplane1 */
3633   ROM_LOAD( "wch2.a4",   0x2000, 0x2000, CRC(5fc965ef) SHA1(d9ecd7e9b4915750400e76ca604bec8152df1fe4) )    /* cards deck gfx, bitplane2 */
36343634   ROM_COPY( "gfx1",   0x4800, 0x4000, 0x0800 )    /* cards deck gfx, bitplane3. found in the 2nd quarter of the text layer rom */
36353635
36363636   ROM_REGION( 0x0100, "proms", 0 )
r14521r14522
36983698
36993699ROM_START( witchgme )
37003700   ROM_REGION( 0x10000, "maincpu", 0 )   /* Video Klein */
3701   ROM_LOAD( "hn58c256p.box",   0x0000, 0x8000, CRC(26c334cb) SHA1(d8368835c88668f09560f6096148a6e528806f65) )
3701   ROM_LOAD( "hn58c256p.box12t1",   0x0000, 0x8000, CRC(26c334cb) SHA1(d8368835c88668f09560f6096148a6e528806f65) )
37023702
37033703   ROM_REGION( 0x3000, "gfx2", 0 )
37043704   ROM_LOAD( "1.2a",   0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )  /* cards deck gfx, bitplane1 */
r14521r14522
37283728
37293729   ROM_REGION( 0x3000, "gfx1", 0 )
37303730   ROM_FILL(          0x0000, 0x2000, 0 ) /* filling the R-G bitplanes */
3731   ROM_LOAD( "wc4_bad.7a",    0x2000, 0x1000, BAD_DUMP CRC(3bf07c44) SHA1(f6e859b142b7d4585b89ca609d8bc85c84fe2b09) )    /* text chars, corrupt */
3731   ROM_LOAD( "wc4.7a_bad",    0x2000, 0x1000, BAD_DUMP CRC(3bf07c44) SHA1(f6e859b142b7d4585b89ca609d8bc85c84fe2b09) )    /* text chars, corrupt */
37323732   ROM_COPY( "gfx1",    0x2800, 0x2000, 0x0800 )   /* srctag, srcoffs, offset, length */
37333733
37343734   ROM_REGION( 0x3000, "gfx2", 0 )
3735   ROM_LOAD( "wc_cdk1.2a",   0x0000, 0x1000, CRC(f59c6fd2) SHA1(bea4b6043728311ca9fff36e2d7e24254af5b97a) )    /* cards deck gfx, bitplane1 */
3735   ROM_LOAD( "wck1.2a",   0x0000, 0x1000, CRC(f59c6fd2) SHA1(bea4b6043728311ca9fff36e2d7e24254af5b97a) )    /* cards deck gfx, bitplane1 */
37363736   ROM_LOAD( "wc2.4a",   0x1000, 0x1000, CRC(40e426af) SHA1(7e7cb30dafc96bcb87a05d3e0ef5c2d426ed6a74) )    /* cards deck gfx, bitplane2 */
37373737   ROM_LOAD( "wc3.5a",   0x2000, 0x1000, CRC(232374f3) SHA1(b75907edbf769b8c46fb1ebdb301c325c556e6c2) )    /* cards deck gfx, bitplane3 */
37383738
r14521r14522
41844184   ROM_LOAD( "fw4.7a",   0x1000, 0x0800, CRC(f0517b0d) SHA1(474bcf429f2539ff1f3d7d32d259c5973ccb0234) )  /* text layer */
41854185
41864186   ROM_REGION( 0x1800, "gfx2", 0 )
4187   ROM_LOAD( "fw1.2a",   0x0000, 0x0800, BAD_DUMP CRC(229cedde) SHA1(5b6d0b900714924c7a2390151ee65f36bdb02e8b) )  /* cards deck gfx, bitplane1 */
4187   ROM_LOAD( "fw1.2a_bad",   0x0000, 0x0800, BAD_DUMP CRC(229cedde) SHA1(5b6d0b900714924c7a2390151ee65f36bdb02e8b) )  /* cards deck gfx, bitplane1 */
41884188   ROM_IGNORE(                 0x0800)
4189   ROM_LOAD( "fw2.4a",   0x0800, 0x0800, BAD_DUMP CRC(9ad3c578) SHA1(a69385a807e3270d90040c44721bfff21e95706a) )  /* cards deck gfx, bitplane2 */
4190   ROM_LOAD( "fw3.5a",   0x1000, 0x0800, BAD_DUMP CRC(87abebe5) SHA1(5950082b563718476576dbc9f45439019209493e) )  /* cards deck gfx, bitplane3 */
4189   ROM_LOAD( "fw2.4a_bad",   0x0800, 0x0800, BAD_DUMP CRC(9ad3c578) SHA1(a69385a807e3270d90040c44721bfff21e95706a) )  /* cards deck gfx, bitplane2 */
4190   ROM_LOAD( "fw3.5a_bad",   0x1000, 0x0800, BAD_DUMP CRC(87abebe5) SHA1(5950082b563718476576dbc9f45439019209493e) )  /* cards deck gfx, bitplane3 */
41914191
41924192   ROM_REGION( 0x0100, "proms", 0 )
41934193   ROM_LOAD( "n82s137f.box",   0x0000, 0x0100, BAD_DUMP CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) )
r14521r14522
46564656
46574657ROM_START( wldwitch )
46584658   ROM_REGION( 0x10000, "maincpu", 0 )   /* Video Klein */
4659   ROM_LOAD( "hn58c256p.box",   0x8000, 0x8000, CRC(1de736a7) SHA1(e714a97999555fe0107390c8c9c2c3c1e822809a) )
4659   ROM_LOAD( "hn58c256p.box163",   0x8000, 0x8000, CRC(1de736a7) SHA1(e714a97999555fe0107390c8c9c2c3c1e822809a) )
46604660
46614661   ROM_REGION( 0x18000, "temp", 0 )
46624662   ROM_LOAD( "03.a3",   0x00000, 0x8000, CRC(ae474414) SHA1(6dee760cee18e125791c17b562ca8aabe1f4593e) )
src/mame/drivers/moo.c
r14521r14522
692692   ROM_REGION( 0x180000, "maincpu", 0 )
693693   /* main program */
694694   ROM_LOAD16_BYTE( "151_b01",    0x000000,  0x40000, CRC(fb2fa298) SHA1(f03b24681a2b329ba797fd2780ac9a3cf862ebcb) ) /* Version UAB? */
695   ROM_LOAD16_BYTE( "151_ua_b02", 0x000001,  0x40000, CRC(3d9f4d59) SHA1(db47044bd4935fce94ec659242c9819c30eb6d0f) )
695   ROM_LOAD16_BYTE( "151_uaa_b02", 0x000001,  0x40000, CRC(3d9f4d59) SHA1(db47044bd4935fce94ec659242c9819c30eb6d0f) )
696696
697697   /* data */
698698   ROM_LOAD16_BYTE( "151a03", 0x100000,  0x40000, CRC(c896d3ea) SHA1(ea83c63e2c3dbc4f1e1d49f1852a78ffc1f0ea4b) )
src/mame/drivers/sderby.c
r14521r14522
704704
705705ROM_START( croupiera )
706706   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
707   ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(1677a2de) SHA1(4dcbb3c1ce9b65e06ba7e0cffa00c0c8016538f5))
708   ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(11acaac2) SHA1(19e7bbbf4356fc9a866f9f36d0568c42d6a36c07))
707   ROM_LOAD16_BYTE( "2a.bin", 0x00000, 0x20000, CRC(1677a2de) SHA1(4dcbb3c1ce9b65e06ba7e0cffa00c0c8016538f5))
708   ROM_LOAD16_BYTE( "3a.bin", 0x00001, 0x20000, CRC(11acaac2) SHA1(19e7bbbf4356fc9a866f9f36d0568c42d6a36c07))
709709
710710   ROM_REGION( 0x080000, "oki", 0 ) /* samples are ok */
711711   ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(6673de85) SHA1(df390cd6268efc0e743a9020f19bc0cbeb757cfa))
src/mame/drivers/mcr.c
r14521r14522
413413
414414static WRITE8_HANDLER( journey_op4_w )
415415{
416   device_t *samples = space->machine().device("samples");
416   samples_device *samples = space->machine().device<samples_device>("samples");
417417
418418   /* if we're not playing the sample yet, start it */
419   if (!sample_playing(samples, 0))
420      sample_start(samples, 0, 0, 1);
419   if (!samples->playing(0))
420      samples->start(0, 0, true);
421421
422422   /* bit 0 turns cassette on/off */
423   sample_set_pause(samples, 0, ~data & 1);
423   samples->pause(0, ~data & 1);
424424}
425425
426426
r14521r14522
433433
434434static WRITE8_HANDLER( twotiger_op4_w )
435435{
436   device_t *samples = space->machine().device("samples");
436   samples_device *samples = space->machine().device<samples_device>("samples");
437437
438438   for (int i = 0; i < 2; i++)
439439   {
440440      /* play tape, and loop it */
441      if (!sample_playing(samples, i))
442         sample_start(samples, i, i, 1);
441      if (!samples->playing(i))
442         samples->start(i, i, true);
443443
444444      /* bit 1 turns cassette on/off */
445      sample_set_pause(samples, i, ~data & 2);
445      samples->pause(i, ~data & 2);
446446   }
447447
448448   // bit 2: lamp control?
r14521r14522
16601660static MACHINE_CONFIG_DERIVED( mcr_90010_tt, mcr_90010 )
16611661
16621662   /* sound hardware */
1663   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1664   MCFG_SOUND_CONFIG(twotiger_samples_interface)
1663   MCFG_SAMPLES_ADD("samples", twotiger_samples_interface)
16651664   MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
16661665   MCFG_SOUND_ROUTE(1, "rspeaker", 0.25)
16671666MACHINE_CONFIG_END
r14521r14522
16741673   MCFG_PALETTE_LENGTH(128)
16751674
16761675   /* sound hardware */
1677   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1678   MCFG_SOUND_CONFIG(journey_samples_interface)
1676   MCFG_SAMPLES_ADD("samples", journey_samples_interface)
16791677   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
16801678   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25)
16811679MACHINE_CONFIG_END
src/mame/drivers/thepit.c
r14521r14522
834834   ROM_LOAD( "bl-ic33.bin",  0x4000, 0x1000, CRC(1f3c78ee) SHA1(961b6ba8d08ddcbeda52b98a2f181f37beed5fb1) )
835835
836836   ROM_REGION( 0x10000, "audiocpu", 0 )
837   ROM_LOAD( "ic30.bin",     0x0000, 0x0800, CRC(1b18faee) SHA1(b4002e2fdaa6bb966da4faa46ac56751a3841f5f) )
838   ROM_LOAD( "ic31.bin",     0x0800, 0x0800, CRC(76cf4394) SHA1(5dc13bd5fc92ce4ce12bab60576292a6028891c3) )
837   ROM_LOAD( "bl-ic30.bin",  0x0000, 0x0800, CRC(1b18faee) SHA1(b4002e2fdaa6bb966da4faa46ac56751a3841f5f) )
838   ROM_LOAD( "bl-ic31.bin",  0x0800, 0x0800, CRC(76cf4394) SHA1(5dc13bd5fc92ce4ce12bab60576292a6028891c3) )
839839
840840   ROM_REGION( 0x1800, "gfx1", 0 ) /* chars and sprites */
841   ROM_LOAD( "ic9.bin",      0x0000, 0x0800, CRC(394676a2) SHA1(5bd26d717e25b7c192af8173db9ae18371dbcfbe) )
841   ROM_LOAD( "bl-ic9.bin",   0x0000, 0x0800, CRC(394676a2) SHA1(5bd26d717e25b7c192af8173db9ae18371dbcfbe) )
842842   ROM_LOAD( "ic10.bin",     0x1000, 0x0800, CRC(a38d708d) SHA1(6632392cece34332a2a4427ec14d95f201319c67) )
843843
844844   ROM_REGION( 0x0020, "proms", 0 )
src/mame/drivers/senjyo.c
r14521r14522
586586   MCFG_SOUND_ADD("sn3", SN76496, 2000000)
587587   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
588588
589   MCFG_SOUND_ADD("samples", SAMPLES, 0)
590   MCFG_SOUND_CONFIG(senjyo_samples_interface)
589   MCFG_SAMPLES_ADD("samples", senjyo_samples_interface)
591590   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
592591MACHINE_CONFIG_END
593592
src/mame/drivers/deadang.c
r14521r14522
316316
317317ROM_START( leadang )
318318   ROM_REGION( 0x100000, "maincpu", 0 ) /* v20 main cpu */
319   ROM_LOAD16_BYTE("2.18h",   0x0c0000, 0x10000, CRC(611247e0) SHA1(1b9ad50f67ba3a3a9e5a0d6e33f4d4be2fc20446) )
320   ROM_LOAD16_BYTE("4.22h",   0x0c0001, 0x10000, CRC(348c1201) SHA1(277dd77dcbc950299de0fd56a4f66db8f90752ad) )
321   ROM_LOAD16_BYTE("1.18f",   0x0e0000, 0x10000, CRC(fb952d71) SHA1(c6578cddf019872e6005c3a9e8e3e024d17d8c6e) )
319   ROM_LOAD16_BYTE("2(__leadang).18h",   0x0c0000, 0x10000, CRC(611247e0) SHA1(1b9ad50f67ba3a3a9e5a0d6e33f4d4be2fc20446) )
320   ROM_LOAD16_BYTE("4(__leadang).22h",   0x0c0001, 0x10000, CRC(348c1201) SHA1(277dd77dcbc950299de0fd56a4f66db8f90752ad) )
321   ROM_LOAD16_BYTE("1(__leadang).18f",   0x0e0000, 0x10000, CRC(fb952d71) SHA1(c6578cddf019872e6005c3a9e8e3e024d17d8c6e) )
322322   ROM_LOAD16_BYTE("3.22f",   0x0e0001, 0x10000, CRC(2271c6df) SHA1(774a92bb698606e58d0c74ea07d7eaecf766dddf) )
323323
324324   ROM_REGION( 0x100000, "sub", 0 ) /* v20 sub cpu */
src/mame/drivers/bfm_sc2.c
r14521r14522
54775477// custom Global sound system?
54785478GAME( 199?, sc2dick      , 0         ,  scorpion2      , drwho      , drwho      , 0,       "Global",   "Spotted Dick (Global) (Scorpion 2/3)", GAME_FLAGS)
54795479GAME( 199?, sc2pick      , 0         ,  scorpion2      , drwho      , drwho      , 0,       "Global",   "Pick Of The Bunch (Global) (Scorpion 2/3)", GAME_FLAGS)
5480GAME( 199?, sc2rock      , 0         ,  scorpion2      , drwho      , drwho      , 0,       "Global",   "How Big's Your Rock (Global) (Scorpion 2/3)", GAME_FLAGS)
5480GAME( 199?, sc2rock      , 0         ,  scorpion2      , drwho      , drwho      , 0,       "Global",   "How Big's Your Rock? (Global) (Scorpion 2/3)", GAME_FLAGS)
54815481GAME( 199?, sc2call      , 0         ,  scorpion2      , drwho      , drwho      , 0,       "Global",   "It's Your Call (Global) (Scorpion 2/3)", GAME_FLAGS)
54825482
54835483GAME( 199?, sc2payr      , 0         ,  scorpion2      , drwho      , drwho      , 0,       "BFM/Mazooma",   "Pay Roll Casino (Bellfruit/Mazooma) (Scorpion 2/3)", GAME_FLAGS)
src/mame/drivers/dynax.c
r14521r14522
66846684   ROM_LOAD( "mc0.u11",          0x00000, 0x40000, CRC(8488a3ab) SHA1(f367a2dcc65410929db595b3c442d310d50a4940) )
66856685   ROM_RELOAD(                   0x10000, 0x40000 )
66866686   // tenkai internal rom is incompatible with the code of this set
6687   ROM_LOAD( "tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP )
6687   ROM_LOAD( "tenkai2b_tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP )
66886688
66896689   ROM_REGION( 0x100000, "gfx1", 0 )   // blitter data
66906690   ROM_LOAD( "mc1.u8",  0x000000, 0x100000, CRC(786698e3) SHA1(9ddf4e31f454fb3c7969b1433771e95a976de741) )
r14521r14522
68996899   ROM_RELOAD(                   0x10000, 0x40000 )
69006900   ROM_RELOAD(                   0x50000, 0x40000 )
69016901   // tenkai internal rom is incompatible with the code of this set
6902   ROM_LOAD( "tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP )
6902   ROM_LOAD( "tenkaid_tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP )
69036903
69046904   ROM_REGION( 0x100000, "gfx1", 0 )   // blitter data
69056905   ROM_LOAD( "tydg002.u8",  0x00000, 0x80000, CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) )
src/mame/drivers/astrof.c
r14521r14522
501501   astrof_set_video_control_2(machine, 0xff);
502502
503503   state->m_maincpu = machine.device("maincpu");
504   state->m_samples = machine.device("samples");
504   state->m_samples = machine.device<samples_device>("samples");
505505
506506   /* register for state saving */
507507   state->save_item(NAME(state->m_red_on));
src/mame/drivers/mil4000.c
r14521r14522
436436
437437ROM_START( mil4000b )
438438   ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code
439   ROM_LOAD16_BYTE( "27.u75", 0x000001, 0x20000, CRC(a5ca8a1e) SHA1(c42244e27031175c37e83995f548d960708eabab) )
440   ROM_LOAD16_BYTE( "28.u76", 0x000000, 0x20000, CRC(5bf4e681) SHA1(818d0ec1b2cc544334b0349ae15fd53ff32ef8c1) )
439   ROM_LOAD16_BYTE( "b27.u75", 0x000001, 0x20000, CRC(a5ca8a1e) SHA1(c42244e27031175c37e83995f548d960708eabab) )
440   ROM_LOAD16_BYTE( "b28.u76", 0x000000, 0x20000, CRC(5bf4e681) SHA1(818d0ec1b2cc544334b0349ae15fd53ff32ef8c1) )
441441
442442   ROM_REGION( 0xa0000, "gfx1", 0 ) // 5bpp?
443443   ROM_LOAD( "2.u36",   0x000000, 0x20000, CRC(bb4fcfde) SHA1(7e19722ce42b9ec86faac32a526429b0e56639b5) )
src/mame/drivers/goldstar.c
r14521r14522
79797979ROM_START( lucky8a )
79807980   ROM_REGION( 0x8000, "maincpu", 0 )
79817981   // we have to patch this, it might be bad
7982   ROM_LOAD( "1", 0x0000, 0x8000, BAD_DUMP CRC(554cddff) SHA1(8a0678993c7010f70adc9e9443b51cf5929bf110) )
7982   ROM_LOAD( "1_bad", 0x0000, 0x8000, BAD_DUMP CRC(554cddff) SHA1(8a0678993c7010f70adc9e9443b51cf5929bf110) )
79837983
79847984   ROM_REGION( 0x18000, "gfx1", 0 )
7985   ROM_LOAD( "6",  0x00000, 0x8000, CRC(59026af3) SHA1(3d7f7e78968ca26275635aeaa0e994468a3da575) )
7986   ROM_LOAD( "7",  0x08000, 0x8000, CRC(67a073c1) SHA1(36194d57d0dc0601fa1fdf2e6806f11b2ea6da36) )
7987   ROM_LOAD( "8",  0x10000, 0x8000, CRC(80b35f06) SHA1(561d257d7bc8976cfa08f36d84961f1263509b5b) )
7985   ROM_LOAD( "6a",  0x00000, 0x8000, CRC(59026af3) SHA1(3d7f7e78968ca26275635aeaa0e994468a3da575) )
7986   ROM_LOAD( "7a",  0x08000, 0x8000, CRC(67a073c1) SHA1(36194d57d0dc0601fa1fdf2e6806f11b2ea6da36) )
7987   ROM_LOAD( "8a",  0x10000, 0x8000, CRC(80b35f06) SHA1(561d257d7bc8976cfa08f36d84961f1263509b5b) )
79887988
79897989   ROM_REGION( 0x8000, "gfx2", 0 )
7990   ROM_LOAD( "2",   0x0000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) )
7991   ROM_LOAD( "3",   0x2000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) )
7992   ROM_LOAD( "4",   0x4000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) )
7993   ROM_LOAD( "5",   0x6000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) )
7990   ROM_LOAD( "2a",  0x0000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) )
7991   ROM_LOAD( "3a",  0x2000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) )
7992   ROM_LOAD( "4a",  0x4000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) )
7993   ROM_LOAD( "5a",  0x6000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) )
79947994
79957995   ROM_REGION( 0x200, "proms", 0 )
79967996   ROM_LOAD( "prom3", 0x0000, 0x0100, CRC(23e81049) SHA1(78071dae70fad870e972d944642fb3a2374be5e4) )
src/mame/drivers/whitestar.c
r14521r14522
29752975   ROM_REGION(0x010000, "soundcpu", 0)
29762976   ROM_LOAD("ctcu7d.bin", 0x0000, 0x10000, CRC(92bfe454) SHA1(8182f7ac84addf8bdb7976a85c801edf3424d16b))
29772977   ROM_REGION(0x1000000, "bsmt", 0)
2978   ROM_LOAD("ctcu17.bin", 0x000000, 0x80000, CRC(7ee35d17) SHA1(f2c9b70285926fc782a2e1289532395cd8dbf999))
2979   ROM_LOAD("ctcu21.bin", 0x080000, 0x80000, CRC(84dd40ac) SHA1(c9327b95f1730a3aa741540c28078f214af214b8))
2978   ROM_LOAD("ctcdxu17.bin", 0x000000, 0x80000, CRC(7ee35d17) SHA1(f2c9b70285926fc782a2e1289532395cd8dbf999))
2979   ROM_LOAD("ctcdxu21.bin", 0x080000, 0x80000, CRC(84dd40ac) SHA1(c9327b95f1730a3aa741540c28078f214af214b8))
29802980ROM_END
29812981
29822982/*-------------------------------------------------------------------
src/mame/drivers/bfm_sc4.c
r14521r14522
2472724727GAME( 200?, sc4quartm   ,sc4quart,   sc4, sc4, sc4, ROT0, "Mazooma","Quaterback (PR2064) (German) (Mazooma) (Scorpion 4) (set 8)", GAME_IS_SKELETON_MECHANICAL )
2472824728
2472924729// QUAZZI MO' DOUGH..........QUAZZSND.......  (no standard header)
24730GAME( 200?, sc4qmodo   ,0,         sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo Dough (Qps) (Scorpion 4) (set 1)", GAME_IS_SKELETON_MECHANICAL )
24731GAME( 200?, sc4qmodoa   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo Dough (Qps) (Scorpion 4) (set 2)", GAME_IS_SKELETON_MECHANICAL )
24732GAME( 200?, sc4qmodob   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo Dough (Qps) (Scorpion 4) (set 3)", GAME_IS_SKELETON_MECHANICAL )
24733GAME( 200?, sc4qmodoc   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo Dough (Qps) (Scorpion 4) (set 4)", GAME_IS_SKELETON_MECHANICAL )
24734GAME( 200?, sc4qmodod   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo Dough (Qps) (Scorpion 4) (set 5)", GAME_IS_SKELETON_MECHANICAL )
24730GAME( 200?, sc4qmodo   ,       0,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo' Dough (Qps) (Scorpion 4) (set 1)", GAME_IS_SKELETON_MECHANICAL )
24731GAME( 200?, sc4qmodoa   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo' Dough (Qps) (Scorpion 4) (set 2)", GAME_IS_SKELETON_MECHANICAL )
24732GAME( 200?, sc4qmodob   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo' Dough (Qps) (Scorpion 4) (set 3)", GAME_IS_SKELETON_MECHANICAL )
24733GAME( 200?, sc4qmodoc   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo' Dough (Qps) (Scorpion 4) (set 4)", GAME_IS_SKELETON_MECHANICAL )
24734GAME( 200?, sc4qmodod   ,sc4qmodo,   sc4, sc4, sc4, ROT0, "Qps","Quazzi Mo' Dough (Qps) (Scorpion 4) (set 5)", GAME_IS_SKELETON_MECHANICAL )
2473524735
2473624736
2473724737GAME( 200?, sc4quidr   ,0,         sc4, sc4, sc4, ROT0, "Qps","Quid Rock (Qps) (Scorpion 4) (set 1)", GAME_IS_SKELETON_MECHANICAL )
src/mame/drivers/cps1.c
r14521r14522
1014710147
1014810148   ROM_REGION( 0x800000, "gfx", 0 )
1014910149   ROMX_LOAD( "rcm_01.3a",  0x000000, 0x80000, CRC(6ecdf13f) SHA1(2a8fe06bf5011e3f990f90d9224f91d8631ec0cc) , ROM_GROUPWORD | ROM_SKIP(6) )
10150   ROMX_LOAD( "rcm_03.5a",  0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) )
10151   ROMX_LOAD( "rcm_02.4a",  0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) )
10150   ROMX_LOAD( "rcm_02.4a",  0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_03.5a
10151   ROMX_LOAD( "rcm_03.5a",  0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_02.4a
1015210152   ROMX_LOAD( "rcm_04.6a",  0x000006, 0x80000, CRC(54e622ff) SHA1(36f6297e3d410f041be5e582919478b0d52520ca) , ROM_GROUPWORD | ROM_SKIP(6) )
1015310153   ROMX_LOAD( "rcm_05.7a",  0x200000, 0x80000, CRC(5dd131fd) SHA1(1a7fc8cf38901245d40901996e946e7ad9c0e0c5) , ROM_GROUPWORD | ROM_SKIP(6) )
10154   ROMX_LOAD( "rcm_07.9a",  0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) )
10155   ROMX_LOAD( "rcm_06.8a",  0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) )
10154   ROMX_LOAD( "rcm_06.8a",  0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_07.9a
10155   ROMX_LOAD( "rcm_07.9a",  0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_06.8a
1015610156   ROMX_LOAD( "rcm_08.10a", 0x200006, 0x80000, CRC(fbff64cf) SHA1(f0cb531ef195dc1dcd224a208906a62fb5d199a1) , ROM_GROUPWORD | ROM_SKIP(6) )
1015710157   ROMX_LOAD( "rcm_10.3c",  0x400000, 0x80000, CRC(4dc8ada9) SHA1(776c2b3ef24c2b8f390c05a9c6728b14ceec696e) , ROM_GROUPWORD | ROM_SKIP(6) )
10158   ROMX_LOAD( "rcm_12.5c",  0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) )
10159   ROMX_LOAD( "rcm_11.4c",  0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) )
10158   ROMX_LOAD( "rcm_11.4c",  0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_12.5c
10159   ROMX_LOAD( "rcm_12.5c",  0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_11.4c
1016010160   ROMX_LOAD( "rcm_13.6c",  0x400006, 0x80000, CRC(5069d4a9) SHA1(b832b98be94371af52bd4bb911e18ec57430a7db) , ROM_GROUPWORD | ROM_SKIP(6) )
1016110161   ROMX_LOAD( "rcm_14.7c",  0x600000, 0x80000, CRC(303be3bd) SHA1(1e5c3fd71966ea9f457840c40582795b501c323e) , ROM_GROUPWORD | ROM_SKIP(6) )
10162   ROMX_LOAD( "rcm_16.9c",  0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) )
10163   ROMX_LOAD( "rcm_15.8c",  0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) )
10162   ROMX_LOAD( "rcm_15.8c",  0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_16_9c
10163   ROMX_LOAD( "rcm_16.9c",  0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) )   // Dumped as rcm_15_8c
1016410164   ROMX_LOAD( "rcm_17.10c", 0x600006, 0x80000, CRC(92371042) SHA1(c55833cbaddcc986edd23c009a3e3c7ff09c2708) , ROM_GROUPWORD | ROM_SKIP(6) )
1016510165
1016610166   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
r14521r14522
1019710197
1019810198   ROM_REGION( 0x800000, "gfx", 0 )
1019910199   ROMX_LOAD( "rcm_01.3a",  0x000000, 0x80000, CRC(6ecdf13f) SHA1(2a8fe06bf5011e3f990f90d9224f91d8631ec0cc) , ROM_GROUPWORD | ROM_SKIP(6) )
10200   ROMX_LOAD( "rcm_02.4a",  0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_03.5a
10201   ROMX_LOAD( "rcm_03.5a",  0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_02.4a
10200   ROMX_LOAD( "rcm_02.4a",  0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) )
10201   ROMX_LOAD( "rcm_03.5a",  0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) )
1020210202   ROMX_LOAD( "rcm_04.6a",  0x000006, 0x80000, CRC(54e622ff) SHA1(36f6297e3d410f041be5e582919478b0d52520ca) , ROM_GROUPWORD | ROM_SKIP(6) )
1020310203   ROMX_LOAD( "rcm_05.7a",  0x200000, 0x80000, CRC(5dd131fd) SHA1(1a7fc8cf38901245d40901996e946e7ad9c0e0c5) , ROM_GROUPWORD | ROM_SKIP(6) )
10204   ROMX_LOAD( "rcm_06.8a",  0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_07.9a
10205   ROMX_LOAD( "rcm_07.9a",  0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_06.8a
10204   ROMX_LOAD( "rcm_06.8a",  0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) )
10205   ROMX_LOAD( "rcm_07.9a",  0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) )
1020610206   ROMX_LOAD( "rcm_08.10a", 0x200006, 0x80000, CRC(fbff64cf) SHA1(f0cb531ef195dc1dcd224a208906a62fb5d199a1) , ROM_GROUPWORD | ROM_SKIP(6) )
1020710207   ROMX_LOAD( "rcm_10.3c",  0x400000, 0x80000, CRC(4dc8ada9) SHA1(776c2b3ef24c2b8f390c05a9c6728b14ceec696e) , ROM_GROUPWORD | ROM_SKIP(6) )
10208   ROMX_LOAD( "rcm_11.4c",  0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_12.5c
10209   ROMX_LOAD( "rcm_12.5c",  0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_11.4c
10208   ROMX_LOAD( "rcm_11.4c",  0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) )
10209   ROMX_LOAD( "rcm_12.5c",  0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) )
1021010210   ROMX_LOAD( "rcm_13.6c",  0x400006, 0x80000, CRC(5069d4a9) SHA1(b832b98be94371af52bd4bb911e18ec57430a7db) , ROM_GROUPWORD | ROM_SKIP(6) )
1021110211   ROMX_LOAD( "rcm_14.7c",  0x600000, 0x80000, CRC(303be3bd) SHA1(1e5c3fd71966ea9f457840c40582795b501c323e) , ROM_GROUPWORD | ROM_SKIP(6) )
10212   ROMX_LOAD( "rcm_15.8c",  0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_16.9c
10213   ROMX_LOAD( "rcm_16.9c",  0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_15.8c
10212   ROMX_LOAD( "rcm_15.8c",  0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) )
10213   ROMX_LOAD( "rcm_16.9c",  0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) )
1021410214   ROMX_LOAD( "rcm_17.10c", 0x600006, 0x80000, CRC(92371042) SHA1(c55833cbaddcc986edd23c009a3e3c7ff09c2708) , ROM_GROUPWORD | ROM_SKIP(6) )
1021510215
1021610216   ROM_REGION( 0x28000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
r14521r14522
1024710247
1024810248   ROM_REGION( 0x800000, "gfx", 0 )
1024910249   ROMX_LOAD( "rcm_01.3a",  0x000000, 0x80000, CRC(6ecdf13f) SHA1(2a8fe06bf5011e3f990f90d9224f91d8631ec0cc) , ROM_GROUPWORD | ROM_SKIP(6) )
10250   ROMX_LOAD( "rcm_02.4a",  0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_03.5a
10251   ROMX_LOAD( "rcm_03.5a",  0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_02.4a
10250   ROMX_LOAD( "rcm_02.4a",  0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) )
10251   ROMX_LOAD( "rcm_03.5a",  0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) )
1025210252   ROMX_LOAD( "rcm_04.6a",  0x000006, 0x80000, CRC(54e622ff) SHA1(36f6297e3d410f041be5e582919478b0d52520ca) , ROM_GROUPWORD | ROM_SKIP(6) )
1025310253   ROMX_LOAD( "rcm_05.7a",  0x200000, 0x80000, CRC(5dd131fd) SHA1(1a7fc8cf38901245d40901996e946e7ad9c0e0c5) , ROM_GROUPWORD | ROM_SKIP(6) )
10254   ROMX_LOAD( "rcm_06.8a",  0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_07.9a
10255   ROMX_LOAD( "rcm_07.9a",  0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_06.8a
10254   ROMX_LOAD( "rcm_06.8a",  0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) )
10255   ROMX_LOAD( "rcm_07.9a",  0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) )
1025610256   ROMX_LOAD( "rcm_08.10a", 0x200006, 0x80000, CRC(fbff64cf) SHA1(f0cb531ef195dc1dcd224a208906a62fb5d199a1) , ROM_GROUPWORD | ROM_SKIP(6) )
1025710257   ROMX_LOAD( "rcm_10.3c",  0x400000, 0x80000, CRC(4dc8ada9) SHA1(776c2b3ef24c2b8f390c05a9c6728b14ceec696e) , ROM_GROUPWORD | ROM_SKIP(6) )
10258   ROMX_LOAD( "rcm_11.4c",  0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_12.5c
10259   ROMX_LOAD( "rcm_12.5c",  0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_11.4c
10258   ROMX_LOAD( "rcm_11.4c",  0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) )
10259   ROMX_LOAD( "rcm_12.5c",  0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) )
1026010260   ROMX_LOAD( "rcm_13.6c",  0x400006, 0x80000, CRC(5069d4a9) SHA1(b832b98be94371af52bd4bb911e18ec57430a7db) , ROM_GROUPWORD | ROM_SKIP(6) )
1026110261   ROMX_LOAD( "rcm_14.7c",  0x600000, 0x80000, CRC(303be3bd) SHA1(1e5c3fd71966ea9f457840c40582795b501c323e) , ROM_GROUPWORD | ROM_SKIP(6) )
10262   ROMX_LOAD( "rcm_15.8c",  0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_16.9c
10263   ROMX_LOAD( "rcm_16.9c",  0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) )   // == rcm_15.8c
10262   ROMX_LOAD( "rcm_15.8c",  0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) )
10263   ROMX_LOAD( "rcm_16.9c",  0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) )
1026410264   ROMX_LOAD( "rcm_17.10c", 0x600006, 0x80000, CRC(92371042) SHA1(c55833cbaddcc986edd23c009a3e3c7ff09c2708) , ROM_GROUPWORD | ROM_SKIP(6) )
1026510265
1026610266   ROM_REGION( 0x28000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
src/mame/drivers/starcrus.c
r14521r14522
159159   /* sound hardware */
160160   MCFG_SPEAKER_STANDARD_MONO("mono")
161161
162   MCFG_SOUND_ADD("samples", SAMPLES, 0)
163   MCFG_SOUND_CONFIG(starcrus_samples_interface)
162   MCFG_SAMPLES_ADD("samples", starcrus_samples_interface)
164163   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
165164MACHINE_CONFIG_END
166165
src/mame/drivers/galaxian.c
r14521r14522
22062206   MCFG_SOUND_CONFIG(cclimber_ay8910_interface)
22072207   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
22082208
2209   MCFG_SOUND_ADD("samples", SAMPLES, 0)
2210   MCFG_SOUND_CONFIG(cclimber_samples_interface)
2209   MCFG_SAMPLES_ADD("samples", cclimber_samples_interface)
22112210   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
22122211MACHINE_CONFIG_END
22132212
src/mame/drivers/blockade.c
r14521r14522
498498   /* sound hardware */
499499   MCFG_SPEAKER_STANDARD_MONO("mono")
500500
501   MCFG_SOUND_ADD("samples", SAMPLES, 0)
502   MCFG_SOUND_CONFIG(blockade_samples_interface)
501   MCFG_SAMPLES_ADD("samples", blockade_samples_interface)
503502   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
504503
505504   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
src/mame/drivers/tmnt.c
r14521r14522
264264   /* bit 2 plays the title music */
265265   if (data & 0x04)
266266   {
267      if (!sample_playing(state->m_samples, 0))
268         sample_start_raw(state->m_samples, 0, state->m_sampledata, 0x40000, 20000, 0);
267      if (!state->m_samples->playing(0))
268         state->m_samples->start_raw(0, state->m_sampledata, 0x40000, 20000);
269269   }
270270   else
271      sample_stop(state->m_samples, 0);
271      state->m_samples->stop(0);
272272   state->m_tmnt_soundlatch = data;
273273}
274274
r14521r14522
285285
286286static SAMPLES_START( tmnt_decode_sample )
287287{
288   running_machine &machine = device->machine();
288   running_machine &machine = device.machine();
289289   tmnt_state *state = machine.driver_data<tmnt_state>();
290290   int i;
291291   UINT8 *source = machine.region("title")->base();
r14521r14522
22352235   state->m_k053260 = machine.device("k053260");
22362236   state->m_k054539 = machine.device("k054539");
22372237   state->m_upd = machine.device("upd");
2238   state->m_samples = machine.device("samples");
2238   state->m_samples = machine.device<samples_device>("samples");
22392239   state->m_k052109 = machine.device("k052109");
22402240   state->m_k051960 = machine.device("k051960");
22412241   state->m_k053245 = machine.device("k053245");
r14521r14522
24132413   MCFG_SOUND_ADD("upd", UPD7759, XTAL_640kHz)
24142414   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
24152415
2416   MCFG_SOUND_ADD("samples", SAMPLES, 0)
2417   MCFG_SOUND_CONFIG(tmnt_samples_interface)
2416   MCFG_SAMPLES_ADD("samples", tmnt_samples_interface)
24182417   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
24192418MACHINE_CONFIG_END
24202419
src/mame/drivers/pluto5.c
r14521r14522
533533GAME( 200?, hb_gldwn   ,0,         pluto5, pluto5, hb, ROT0, "Fairgames","Golden Winner (Fairgames)", GAME_IS_SKELETON_MECHANICAL )
534534GAME( 200?, hb_jailb   ,0,         pluto5, pluto5, hb, ROT0, "Qps","Jail Break (Qps)", GAME_IS_SKELETON_MECHANICAL )
535535GAME( 200?, hb_jkrwl   ,0,         pluto5, pluto5, hb, ROT0, "Fairgames","Jokers Wild (Fairgames)", GAME_IS_SKELETON_MECHANICAL )
536GAME( 200?, hb_mrmon   ,0,         pluto5, pluto5, hb, ROT0, "Qps","Mr Money (Qps)", GAME_IS_SKELETON_MECHANICAL )
536GAME( 200?, hb_mrmon   ,0,         pluto5, pluto5, hb, ROT0, "Qps","Mr. Money (Qps)", GAME_IS_SKELETON_MECHANICAL )
537537GAME( 200?, hb_rhv      ,0,         pluto5, pluto5, hb, ROT0, "Qps","Red Hot Voucher (Qps)", GAME_IS_SKELETON_MECHANICAL )
538538GAME( 200?, hb_ringb   ,0,         pluto5, pluto5, hb, ROT0, "Jpm","Ring A Bell (Jpm)", GAME_IS_SKELETON_MECHANICAL )
539539GAME( 200?, hb_rckrl   ,0,         pluto5, pluto5, hb, ROT0, "Qps","Rock 'n' Roll (Qps)", GAME_IS_SKELETON_MECHANICAL )
540GAME( 200?, hb_ydd      ,0,         pluto5, pluto5, hb, ROT0, "Qps","Yabba Dabba Dough (Qps)", GAME_IS_SKELETON_MECHANICAL )
540GAME( 200?, hb_ydd      ,0,         pluto5, pluto5, hb, ROT0, "Qps","Yabba-Dabba-Dough (Qps)", GAME_IS_SKELETON_MECHANICAL )
src/mame/drivers/galaxold.c
r14521r14522
25602560   ROM_CONTINUE(              0x0000, 0x0400)
25612561   ROM_CONTINUE(              0x1800, 0x0400)
25622562   ROM_CONTINUE(              0x2800, 0x0400)
2563   ROM_LOAD( "ck3.bin",       0x3400, 0x0400, CRC(65157cde) SHA1(572b9bd56894600e21220356d0bf193c7920672c) )
2563   ROM_LOAD( "g_ck3.bin",     0x3400, 0x0400, CRC(65157cde) SHA1(572b9bd56894600e21220356d0bf193c7920672c) )
25642564   ROM_CONTINUE(              0x4c00, 0x0400)
25652565   ROM_CONTINUE(              0x5000, 0x0400)
25662566   ROM_CONTINUE(              0x0400, 0x0400)
2567   ROM_LOAD( "ck4.bin",       0x2000, 0x0400, CRC(43827bc6) SHA1(a2ca9afff0dd1bdcfc3a6ead9ff30b7c91caa7ea) )
2567   ROM_LOAD( "g_ck4.bin",     0x2000, 0x0400, CRC(43827bc6) SHA1(a2ca9afff0dd1bdcfc3a6ead9ff30b7c91caa7ea) )
25682568   ROM_CONTINUE(              0x3800, 0x0400)
25692569   ROM_CONTINUE(              0x1000, 0x0400)
25702570   ROM_CONTINUE(              0x4000, 0x0400)
2571   ROM_LOAD( "ck5.bin",       0x0800, 0x0400, CRC(a74ed96e) SHA1(1e845d693a728fea9d52953b5493ec98fdec63e3) )
2571   ROM_LOAD( "g_ck5.bin",     0x0800, 0x0400, CRC(a74ed96e) SHA1(1e845d693a728fea9d52953b5493ec98fdec63e3) )
25722572   ROM_CONTINUE(              0x5400, 0x0400)  // fill
25732573   ROM_CONTINUE(              0x2c00, 0x0400)
25742574   ROM_CONTINUE(              0x1400, 0x0400)
2575   ROM_LOAD( "ck7.bin",       0x3000, 0x0400, CRC(2c4d8129) SHA1(ab1708ff72ee027106fe8da0caea03a796b3212b) )
2575   ROM_LOAD( "g_ck7.bin",     0x3000, 0x0400, CRC(2c4d8129) SHA1(ab1708ff72ee027106fe8da0caea03a796b3212b) )
25762576   ROM_CONTINUE(              0x3c00, 0x0400)
25772577
25782578   ROM_REGION( 0x2000, "gfx1", 0 )
src/mame/drivers/tnzs.c
r14521r14522
632632
633633static SAMPLES_START( kageki_init_samples )
634634{
635   running_machine &machine = device->machine();
635   running_machine &machine = device.machine();
636636   tnzs_state *state = machine.driver_data<tnzs_state>();
637637   UINT8 *scan, *src;
638638   INT16 *dest;
r14521r14522
717717   }
718718   else
719719   {
720      samples_device *samples = downcast<samples_device *>(device);
720721      if (data > MAX_SAMPLES)
721722      {
722723         // stop samples
723         sample_stop(device, 0);
724         samples->stop(0);
724725         sprintf(mess, "VOICE:%02X STOP", data);
725726      }
726727      else
727728      {
728729         // play samples
729         sample_start_raw(device, 0, state->m_sampledata[data], state->m_samplesize[data], 7000, 0);
730         samples->start_raw(0, state->m_sampledata[data], state->m_samplesize[data], 7000);
730731         sprintf(mess, "VOICE:%02X PLAY", data);
731732      }
732733   //  popmessage(mess);
r14521r14522
18181819   MCFG_SOUND_ROUTE(2, "mono", 0.15)
18191820   MCFG_SOUND_ROUTE(3, "mono", 0.35)
18201821
1821   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1822   MCFG_SOUND_CONFIG(tnzs_samples_interface)
1822   MCFG_SAMPLES_ADD("samples", tnzs_samples_interface)
18231823   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
18241824MACHINE_CONFIG_END
18251825
src/mame/drivers/segag80v.c
r14521r14522
927927static MACHINE_CONFIG_DERIVED( elim2, g80v_base )
928928
929929   /* custom sound board */
930   MCFG_SOUND_ADD("samples", SAMPLES, 0)
931   MCFG_SOUND_CONFIG(elim2_samples_interface)
930   MCFG_SAMPLES_ADD("samples", elim2_samples_interface)
932931   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
933932MACHINE_CONFIG_END
934933
r14521r14522
936935static MACHINE_CONFIG_DERIVED( spacfury, g80v_base )
937936
938937   /* custom sound board */
939   MCFG_SOUND_ADD("samples", SAMPLES, 0)
940   MCFG_SOUND_CONFIG(spacfury_samples_interface)
938   MCFG_SAMPLES_ADD("samples", spacfury_samples_interface)
941939   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
942940
943941   /* speech board */
r14521r14522
948946static MACHINE_CONFIG_DERIVED( zektor, g80v_base )
949947
950948   /* custom sound board */
951   MCFG_SOUND_ADD("samples", SAMPLES, 0)
952   MCFG_SOUND_CONFIG(zektor_samples_interface)
949   MCFG_SAMPLES_ADD("samples", zektor_samples_interface)
953950   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
954951
955952   MCFG_SOUND_ADD("aysnd", AY8910, CPU_CLOCK/2/2)
src/mame/drivers/astrocde.c
r14521r14522
205205static WRITE8_HANDLER( seawolf2_sound_1_w )  // Port 40
206206{
207207   astrocde_state *state = space->machine().driver_data<astrocde_state>();
208   device_t *samples = space->machine().device("samples");
208   samples_device *samples = space->machine().device<samples_device>("samples");
209209   UINT8 rising_bits = data & ~state->m_port_1_last;
210210   state->m_port_1_last = data;
211211
212   if (rising_bits & 0x01) sample_start(samples, 1, 1, 0);  /* Left Torpedo */
213   if (rising_bits & 0x02) sample_start(samples, 0, 0, 0);  /* Left Ship Hit */
214   if (rising_bits & 0x04) sample_start(samples, 4, 4, 0);  /* Left Mine Hit */
215   if (rising_bits & 0x08) sample_start(samples, 6, 1, 0);  /* Right Torpedo */
216   if (rising_bits & 0x10) sample_start(samples, 5, 0, 0);  /* Right Ship Hit */
217   if (rising_bits & 0x20) sample_start(samples, 9, 4, 0);  /* Right Mine Hit */
212   if (rising_bits & 0x01) samples->start(1, 1);  /* Left Torpedo */
213   if (rising_bits & 0x02) samples->start(0, 0);  /* Left Ship Hit */
214   if (rising_bits & 0x04) samples->start(4, 4);  /* Left Mine Hit */
215   if (rising_bits & 0x08) samples->start(6, 1);  /* Right Torpedo */
216   if (rising_bits & 0x10) samples->start(5, 0);  /* Right Ship Hit */
217   if (rising_bits & 0x20) samples->start(9, 4);  /* Right Mine Hit */
218218}
219219
220220
221221static WRITE8_HANDLER( seawolf2_sound_2_w )  // Port 41
222222{
223223   astrocde_state *state = space->machine().driver_data<astrocde_state>();
224   device_t *samples = space->machine().device("samples");
224   samples_device *samples = space->machine().device<samples_device>("samples");
225225   UINT8 rising_bits = data & ~state->m_port_2_last;
226226   state->m_port_2_last = data;
227227
228   sample_set_volume(samples, 0, (data & 0x80) ? 1.0 : 0.0);
229   sample_set_volume(samples, 1, (data & 0x80) ? 1.0 : 0.0);
230   sample_set_volume(samples, 3, (data & 0x80) ? 1.0 : 0.0);
231   sample_set_volume(samples, 4, (data & 0x80) ? 1.0 : 0.0);
232   sample_set_volume(samples, 5, (data & 0x80) ? 1.0 : 0.0);
233   sample_set_volume(samples, 6, (data & 0x80) ? 1.0 : 0.0);
234   sample_set_volume(samples, 8, (data & 0x80) ? 1.0 : 0.0);
235   sample_set_volume(samples, 9, (data & 0x80) ? 1.0 : 0.0);
228   samples->set_volume(0, (data & 0x80) ? 1.0 : 0.0);
229   samples->set_volume(1, (data & 0x80) ? 1.0 : 0.0);
230   samples->set_volume(3, (data & 0x80) ? 1.0 : 0.0);
231   samples->set_volume(4, (data & 0x80) ? 1.0 : 0.0);
232   samples->set_volume(5, (data & 0x80) ? 1.0 : 0.0);
233   samples->set_volume(6, (data & 0x80) ? 1.0 : 0.0);
234   samples->set_volume(8, (data & 0x80) ? 1.0 : 0.0);
235   samples->set_volume(9, (data & 0x80) ? 1.0 : 0.0);
236236
237237   /* dive panning controlled by low 3 bits */
238   sample_set_volume(samples, 2, (float)(~data & 0x07) / 7.0);
239   sample_set_volume(samples, 7, (float)(data & 0x07) / 7.0);
238   samples->set_volume(2, (float)(~data & 0x07) / 7.0);
239   samples->set_volume(7, (float)(data & 0x07) / 7.0);
240240
241241   if (rising_bits & 0x08)
242242   {
243      sample_start(samples, 2, 2, 0);
244      sample_start(samples, 7, 2, 0);
243      samples->start(2, 2);
244      samples->start(7, 2);
245245   }
246   if (rising_bits & 0x10) sample_start(samples, 8, 3, 0);  /* Right Sonar */
247   if (rising_bits & 0x20) sample_start(samples, 3, 3, 0);  /* Left Sonar */
246   if (rising_bits & 0x10) samples->start(8, 3);  /* Right Sonar */
247   if (rising_bits & 0x20) samples->start(3, 3);  /* Left Sonar */
248248
249249   coin_counter_w(space->machine(), 0, data & 0x40);    /* Coin Counter */
250250}
r14521r14522
13701370   /* sound hardware */
13711371   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
13721372
1373   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1374   MCFG_SOUND_CONFIG(seawolf2_samples_interface)
1373   MCFG_SAMPLES_ADD("samples", seawolf2_samples_interface)
13751374   MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
13761375   MCFG_SOUND_ROUTE(1, "lspeaker", 0.25)
13771376   MCFG_SOUND_ROUTE(2, "lspeaker", 0.25)
r14521r14522
14211420   /* sound hardware */
14221421   MCFG_SPEAKER_ADD("center", 0.0, 0.0, 1.0)
14231422
1424   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1425   MCFG_SOUND_CONFIG(wow_samples_interface)
1423   MCFG_SAMPLES_ADD("samples", wow_samples_interface)
14261424   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "center", 0.85)
14271425MACHINE_CONFIG_END
14281426
r14521r14522
14481446   MCFG_SOUND_ADD("astrocade2",  ASTROCADE, ASTROCADE_CLOCK/4)
14491447   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lower", 1.0)
14501448
1451   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1452   MCFG_SOUND_CONFIG(gorf_samples_interface)
1449   MCFG_SAMPLES_ADD("samples", gorf_samples_interface)
14531450   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "upper", 0.85)
14541451MACHINE_CONFIG_END
14551452
src/mame/drivers/galaga.c
r14521r14522
18541854   /* sound hardware */
18551855   MCFG_DEVICE_REMOVE("discrete")
18561856
1857   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1858   MCFG_SOUND_CONFIG(battles_samples_interface)
1857   MCFG_SAMPLES_ADD("samples", battles_samples_interface)
18591858   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
18601859MACHINE_CONFIG_END
18611860
src/mame/drivers/8080bw.c
r14521r14522
806806   /* sound hardware */
807807   MCFG_SPEAKER_STANDARD_MONO("mono")
808808
809   MCFG_SOUND_ADD("samples", SAMPLES, 0)
810   MCFG_SOUND_CONFIG(lrescue_samples_interface)
809   MCFG_SAMPLES_ADD("samples", lrescue_samples_interface)
811810   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
812811
813812   /* extra audio channel */
r14521r14522
25492548   ROM_LOAD( "sv06.41",     0x1c00, 0x0400, CRC(2c68e0b4) SHA1(a5e5357120102ad32792bf3ef6362f45b7ba7070) )
25502549
25512550   ROM_REGION( 0x0800, "proms", 0 )      /* color maps player 1/player 2 */
2552   ROM_LOAD( "cv01.1",      0x0000, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) )
2553   ROM_LOAD( "cv02.2",      0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) )
2551   ROM_LOAD( "sv01.1",      0x0000, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) )
2552   ROM_LOAD( "sv02.2",      0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) )
25542553ROM_END
25552554
25562555ROM_START( sisv2 )
r14521r14522
25632562   ROM_LOAD( "sv14.41",     0x1c00, 0x0400, CRC(58730370) SHA1(13dc806bcecd2d6089a85dd710ac2869413f7475) )
25642563
25652564   ROM_REGION( 0x0800, "proms", 0 )      /* color maps player 1/player 2 */
2566   ROM_LOAD( "cv01.1",      0x0000, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) )
2567   ROM_LOAD( "cv02.2",      0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) )
2565   ROM_LOAD( "sv01.1",      0x0000, 0x0400, CRC(aac24f34) SHA1(ad110e776547fb48baac568bb50d61854537ca34) )
2566   ROM_LOAD( "sv02.2",      0x0400, 0x0400, CRC(2bdf83a0) SHA1(01ffbd43964c41987e7d44816271308f9a70802b) )
25682567ROM_END
25692568
25702569ROM_START( spceking )
r14521r14522
26442643   ROM_REGION( 0x10000, "maincpu", 0 )
26452644   ROM_LOAD( "pv01_bad",    0x0000, 0x0800, BAD_DUMP CRC(2931a033) SHA1(b04ccde4a4a04b37aa65edc4af4e53a8c1f03dfe) ) // chunk of garbage in prg area $500-$600, the rest of rom contents is same as parent
26462645   ROM_LOAD( "pv01",        0x0000, 0x0800, CRC(7288a511) SHA1(ff617872784c28ed03591aefa9f0519e5651701f) ) // so let's load the parent rom instead
2647   ROM_LOAD( "pv02",        0x0800, 0x0800, CRC(420c7c35) SHA1(b51265f4d9e5a8cf9d53099a97cadd25ea0b34ce) )
2648   ROM_LOAD( "pv03",        0x1000, 0x0800, CRC(dffd04b9) SHA1(d51a0f27e90b0a49cf2d57ec82a863dcae9f3ea4) )
2649   ROM_LOAD( "pv04",        0x1800, 0x0800, CRC(b0626aff) SHA1(b7de6c21030732bd0479228f057ca4c87b913b0a) )
2650   ROM_LOAD( "pv05",        0x4000, 0x0800, CRC(84c70bb8) SHA1(75fef3ee6da3e7e01a257629016bc10a23691d62) )
2646   ROM_LOAD( "br_pv02",     0x0800, 0x0800, CRC(420c7c35) SHA1(b51265f4d9e5a8cf9d53099a97cadd25ea0b34ce) )
2647   ROM_LOAD( "br_pv03",     0x1000, 0x0800, CRC(dffd04b9) SHA1(d51a0f27e90b0a49cf2d57ec82a863dcae9f3ea4) )
2648   ROM_LOAD( "br_pv04",     0x1800, 0x0800, CRC(b0626aff) SHA1(b7de6c21030732bd0479228f057ca4c87b913b0a) )
2649   ROM_LOAD( "br_pv05",     0x4000, 0x0800, CRC(84c70bb8) SHA1(75fef3ee6da3e7e01a257629016bc10a23691d62) )
26512650
26522651   ROM_REGION( 0x0800, "proms", 0 )      /* color maps player 1/player 2 (taken from parent set) */
26532652   ROM_LOAD( "pv06.1",   0x0000, 0x0400, CRC(a732810b) SHA1(a5fabffa73ca740909e23b9530936f9274dff356) )
src/mame/drivers/gotya.c
r14521r14522
178178{
179179   gotya_state *state = machine.driver_data<gotya_state>();
180180
181   state->m_samples = machine.device("samples");
181   state->m_samples = machine.device<samples_device>("samples");
182182
183183   state->save_item(NAME(state->m_scroll_bit_8));
184184   state->save_item(NAME(state->m_theme_playing));
r14521r14522
219219   /* sound hardware */
220220   MCFG_SPEAKER_STANDARD_MONO("mono")
221221
222   MCFG_SOUND_ADD("samples", SAMPLES, 0)
223   MCFG_SOUND_CONFIG(gotya_samples_interface)
222   MCFG_SAMPLES_ADD("samples", gotya_samples_interface)
224223   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
225224MACHINE_CONFIG_END
226225
src/mame/drivers/meadows.c
r14521r14522
675675   MCFG_SOUND_ADD("dac", DAC, 0)
676676   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
677677
678   MCFG_SOUND_ADD("samples", SAMPLES, 0)
679   MCFG_SOUND_CONFIG(meadows_samples_interface)
678   MCFG_SAMPLES_ADD("samples", meadows_samples_interface)
680679   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
681680MACHINE_CONFIG_END
682681
r14521r14522
737736   MCFG_SOUND_ADD("dac", DAC, 0)
738737   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
739738
740   MCFG_SOUND_ADD("samples", SAMPLES, 0)
741   MCFG_SOUND_CONFIG(meadows_samples_interface)
739   MCFG_SAMPLES_ADD("samples", meadows_samples_interface)
742740   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
743741
744742   /* audio hardware */
745   MCFG_SOUND_ADD("samples2", SAMPLES, 0)
746   MCFG_SOUND_CONFIG(bowl3d_samples_interface)
743   MCFG_SAMPLES_ADD("samples2", bowl3d_samples_interface)
747744   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
748745MACHINE_CONFIG_END
749746
src/mame/drivers/firetrap.c
r14521r14522
916916
917917   ROM_REGION( 0x20000, "gfx4", 0 )   /* sprites */
918918   ROM_LOAD( "fi-17.17h",    0x00000, 0x8000, CRC(0de055d7) SHA1(ef763237c317545520c659f438b572b11c342d5a) )
919   ROM_LOAD( "fi-14.13h",    0x08000, 0x8000, CRC(869219da) SHA1(9ab2439d6d1c62fce24c4f78ac7887f34c86cd75) )
919   ROM_LOAD( "fi-14(__bootleg).13h",  0x08000, 0x8000, CRC(869219da) SHA1(9ab2439d6d1c62fce24c4f78ac7887f34c86cd75) )
920920   ROM_LOAD( "fi-15.14h",    0x10000, 0x8000, CRC(6b65812e) SHA1(209e07b2fced6b033c6d5398a998374588a35f46) )
921921   ROM_LOAD( "fi-16.15h",    0x18000, 0x8000, CRC(3e27f77d) SHA1(9ceccb1f56a8d0e05f6dea45d102690a1370624e) )
922922
src/mame/drivers/safarir.c
r14521r14522
6666   UINT8 *m_bg_scroll;
6767   UINT8 m_port_last;
6868   UINT8 m_port_last2;
69   device_t *m_samples;
69   samples_device *m_samples;
7070};
7171
7272
r14521r14522
235235static WRITE8_HANDLER( safarir_audio_w )
236236{
237237   safarir_state *state = space->machine().driver_data<safarir_state>();
238   device_t *samples = state->m_samples;
238   samples_device *samples = state->m_samples;
239239   UINT8 rising_bits = data & ~state->m_port_last;
240240
241   if (rising_bits == 0x12) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND1_1, 0);
242   if (rising_bits == 0x02) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND1_2, 0);
243   if (rising_bits == 0x95) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND6, 0);
241   if (rising_bits == 0x12) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_1);
242   if (rising_bits == 0x02) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_2);
243   if (rising_bits == 0x95) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6);
244244
245   if (rising_bits == 0x04 && (data == 0x15 || data ==0x16)) sample_start(samples, CHANNEL_SOUND2, SAMPLE_SOUND2, 0);
245   if (rising_bits == 0x04 && (data == 0x15 || data ==0x16)) samples->start(CHANNEL_SOUND2, SAMPLE_SOUND2);
246246
247   if (data == 0x5f && (rising_bits == 0x49 || rising_bits == 0x5f)) sample_start(samples, CHANNEL_SOUND3, SAMPLE_SOUND3, 1);
248   if (data == 0x00 || rising_bits == 0x01) sample_stop(samples, CHANNEL_SOUND3);
247   if (data == 0x5f && (rising_bits == 0x49 || rising_bits == 0x5f)) samples->start(CHANNEL_SOUND3, SAMPLE_SOUND3, true);
248   if (data == 0x00 || rising_bits == 0x01) samples->stop(CHANNEL_SOUND3);
249249
250250   if (data == 0x13)
251251   {
252252      if ((rising_bits == 0x13 && state->m_port_last != 0x04) || (rising_bits == 0x01 && state->m_port_last == 0x12))
253253      {
254         sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND7, 0);
254         samples->start(CHANNEL_SOUND4, SAMPLE_SOUND7);
255255      }
256      else if (rising_bits == 0x03 && state->m_port_last2 == 0x15 && !sample_playing(samples, CHANNEL_SOUND4))
256      else if (rising_bits == 0x03 && state->m_port_last2 == 0x15 && !samples->playing(CHANNEL_SOUND4))
257257      {
258         sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND4_1, 0);
258         samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4_1);
259259      }
260260   }
261   if (data == 0x53 && state->m_port_last == 0x55) sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND4_2, 0);
261   if (data == 0x53 && state->m_port_last == 0x55) samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4_2);
262262
263   if (data == 0x1f && rising_bits == 0x1f) sample_start(samples, CHANNEL_SOUND5, SAMPLE_SOUND5_1, 0);
264   if (data == 0x14 && (rising_bits == 0x14 || rising_bits == 0x04)) sample_start(samples, CHANNEL_SOUND5, SAMPLE_SOUND5_2, 0);
263   if (data == 0x1f && rising_bits == 0x1f) samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5_1);
264   if (data == 0x14 && (rising_bits == 0x14 || rising_bits == 0x04)) samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5_2);
265265
266   if (data == 0x07 && rising_bits == 0x07 && !sample_playing(samples, CHANNEL_SOUND6))
267      sample_start(samples, CHANNEL_SOUND6, SAMPLE_SOUND8, 0);
266   if (data == 0x07 && rising_bits == 0x07 && !samples->playing(CHANNEL_SOUND6))
267      samples->start(CHANNEL_SOUND6, SAMPLE_SOUND8);
268268
269269   state->m_port_last2 = state->m_port_last;
270270   state->m_port_last = data;
r14521r14522
298298
299299static MACHINE_CONFIG_FRAGMENT( safarir_audio )
300300   MCFG_SPEAKER_STANDARD_MONO("mono")
301   MCFG_SOUND_ADD("samples", SAMPLES, 0)
302   MCFG_SOUND_CONFIG(safarir_samples_interface)
301   MCFG_SAMPLES_ADD("samples", safarir_samples_interface)
303302   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
304303MACHINE_CONFIG_END
305304
r14521r14522
319318   state->m_ram_2 = auto_alloc_array(machine, UINT8, state->m_ram_size);
320319   state->m_port_last = 0;
321320   state->m_port_last2 = 0;
322   state->m_samples = machine.device("samples");
321   state->m_samples = machine.device<samples_device>("samples");
323322
324323   /* setup for save states */
325324   state->save_pointer(NAME(state->m_ram_1), state->m_ram_size);
src/mame/drivers/equites.c
r14521r14522
476476static WRITE8_DEVICE_HANDLER( equites_8910porta_w )
477477{
478478   equites_state *state = device->machine().driver_data<equites_state>();
479   samples_device *samples = downcast<samples_device *>(device);
479480
480481   // bongo 1
481   sample_set_volume(device, 0, ((data & 0x30) >> 4) * 0.33);
482   samples->set_volume(0, ((data & 0x30) >> 4) * 0.33);
482483   if (data & ~state->m_ay_port_a & 0x80)
483      sample_start(device, 0, 0, 0);
484      samples->start(0, 0);
484485
485486   // bongo 2
486   sample_set_volume(device, 1, (data & 0x03) * 0.33);
487   samples->set_volume(1, (data & 0x03) * 0.33);
487488   if (data & ~state->m_ay_port_a & 0x08)
488      sample_start(device, 1, 1, 0);
489      samples->start(1, 1);
489490
490491   state->m_ay_port_a = data;
491492
r14521r14522
497498static WRITE8_DEVICE_HANDLER( equites_8910portb_w )
498499{
499500   equites_state *state = device->machine().driver_data<equites_state>();
501   samples_device *samples = downcast<samples_device *>(device);
500502#if POPDRUMKIT
501503if (data & ~state->m_ay_port_b & 0x08) state->m_cymbal++;
502504if (data & ~state->m_ay_port_b & 0x04) state->m_hihat++;
503505#endif
504506
505507   // bongo 3
506   sample_set_volume(device, 2, ((data & 0x30)>>4) * 0.33);
508   samples->set_volume(2, ((data & 0x30)>>4) * 0.33);
507509   if (data & ~state->m_ay_port_b & 0x80)
508      sample_start(device, 2, 2, 0);
510      samples->start(2, 2);
509511
510512   // FIXME I'm just enabling the MSM5232 Noise Output for now. Proper emulation
511513   // of the analog circuitry should be done instead.
r14521r14522
11931195   MCFG_SOUND_ADD("dac2", DAC, 0)
11941196   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
11951197
1196   MCFG_SOUND_ADD("samples", SAMPLES, 0)
1197   MCFG_SOUND_CONFIG(alphamc07_samples_interface)
1198   MCFG_SAMPLES_ADD("samples", alphamc07_samples_interface)
11981199   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
11991200MACHINE_CONFIG_END
12001201
src/mame/drivers/stfight.c
r14521r14522
599599
600600ROM_START( empcityj )
601601   ROM_REGION( 2*0x18000, "maincpu", 0 )   /* 96k for code + 96k for decrypted opcodes */
602   ROM_LOAD( "1.bin",      0x00000, 0x8000, CRC(8162331c) SHA1(f2fdf5fbc52d4ea692fb87fa049c48935a73d67b) )
603   ROM_LOAD( "2.bin",      0x10000, 0x8000, CRC(960edea6) SHA1(fd19475e841defe42625a94c40c6390b7e6e7682) )   /* bank switched */
602   ROM_LOAD( "ec_1.bin",   0x00000, 0x8000, CRC(8162331c) SHA1(f2fdf5fbc52d4ea692fb87fa049c48935a73d67b) )
603   ROM_LOAD( "ec_2.bin",   0x10000, 0x8000, CRC(960edea6) SHA1(fd19475e841defe42625a94c40c6390b7e6e7682) )   /* bank switched */
604604
605605   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for the second CPU */
606606   ROM_LOAD( "ec_04.rom",  0x0000,  0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) )
src/mame/drivers/mw18w.c
r14521r14522
192192
193193ROM_START(18w2)
194194   ROM_REGION(0x10000, "maincpu", 0)
195   ROM_LOAD( "18w_b1.rom1", 0x0000, 0x0800, CRC(cbc0fb2c) SHA1(66b14f0d76baebbd64e8ed107e536ad811d55273))
195   ROM_LOAD( "18w2_b1.rom1",0x0000, 0x0800, CRC(cbc0fb2c) SHA1(66b14f0d76baebbd64e8ed107e536ad811d55273))
196196   ROM_LOAD( "18w_b2.rom2", 0x0800, 0x0800, CRC(efbadee8) SHA1(834eaf8ca50544123de7529b90b828cf46b1c001))
197197   ROM_LOAD( "18w_b3.rom3", 0x1000, 0x0800, CRC(214606f6) SHA1(9a9dc20259b4462661c6be410d98d2be54657a0e))
198198   ROM_LOAD( "18w_b4.rom4", 0x1800, 0x0800, CRC(e88ad6a9) SHA1(ac010aa7e0288197ff9342801522623b64dd2a47))
src/mame/drivers/circus.c
r14521r14522
266266   circus_state *state = machine.driver_data<circus_state>();
267267
268268   state->m_maincpu = machine.device("maincpu");
269   state->m_samples = machine.device("samples");
269   state->m_samples = machine.device<samples_device>("samples");
270270   state->m_discrete = machine.device("discrete");
271271
272272   state->save_item(NAME(state->m_clown_x));
r14521r14522
311311   /* sound hardware */
312312   MCFG_SPEAKER_STANDARD_MONO("mono")
313313
314   MCFG_SOUND_ADD("samples", SAMPLES, 0)
315   MCFG_SOUND_CONFIG(circus_samples_interface)
314   MCFG_SAMPLES_ADD("samples", circus_samples_interface)
316315   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
317316
318317   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
r14521r14522
348347   /* sound hardware */
349348   MCFG_SPEAKER_STANDARD_MONO("mono")
350349
351   MCFG_SOUND_ADD("samples", SAMPLES, 0)
352   MCFG_SOUND_CONFIG(robotbwl_samples_interface)
350   MCFG_SAMPLES_ADD("samples", robotbwl_samples_interface)
353351   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
354352
355353   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
r14521r14522
392390   /* sound hardware */
393391   MCFG_SPEAKER_STANDARD_MONO("mono")
394392
395   MCFG_SOUND_ADD("samples", SAMPLES, 0)
396   MCFG_SOUND_CONFIG(crash_samples_interface)
393   MCFG_SAMPLES_ADD("samples", crash_samples_interface)
397394   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
398395
399396   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
r14521r14522
428425   /* sound hardware */
429426   MCFG_SPEAKER_STANDARD_MONO("mono")
430427
431   MCFG_SOUND_ADD("samples", SAMPLES, 0)
432   MCFG_SOUND_CONFIG(ripcord_samples_interface)
428   MCFG_SAMPLES_ADD("samples", ripcord_samples_interface)
433429   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
434430
435431   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
src/mame/drivers/pacman.c
r14521r14522
36353635
36363636ROM_START( popeyeman )
36373637   ROM_REGION( 0x10000, "maincpu", 0 )
3638   ROM_LOAD( "1.6e",   0x0000, 0x0800, CRC(9d027c4a) SHA1(88e094880057451a75cdc2ce9477403021813982) )
3639   ROM_LOAD( "5.6k",   0x0800, 0x0800, CRC(194c7189) SHA1(fd423bac2810015313841c7b935054565390fbd0) )
3640   ROM_LOAD( "2.6f",   0x1000, 0x0800, CRC(5ba228bb) SHA1(b0e902cdf98bee72d6ec8069eec96adce3245074) )
3641   ROM_LOAD( "6.6m",   0x1800, 0x0800, CRC(baf5461e) SHA1(754586a6449fd54a342f260e572c1cd60ab70815) )
3642   ROM_LOAD( "3.6h",   0x2000, 0x0800, CRC(08419c4a) SHA1(7e5001adad401080c788737c1d2349f218750442) )
3643   ROM_LOAD( "7.6n",   0x2800, 0x0800, CRC(ab74b51f) SHA1(1bce8933ed7807eb7aca9670df8994f8d1a8b5b7) )
3644   ROM_LOAD( "4.6j",   0x3000, 0x0800, CRC(5039b082) SHA1(086a6ac4742734167d283b1121fce29d8ac4a6cd) )
3645   ROM_LOAD( "8.6p",   0x3800, 0x0800, CRC(931770d7) SHA1(78fcf88e07ec5126c12c3297b62ca388809e947c) )
3638   ROM_LOAD( "pop1.6e",      0x0000, 0x0800, CRC(9d027c4a) SHA1(88e094880057451a75cdc2ce9477403021813982) )
3639   ROM_LOAD( "pop5.6k",      0x0800, 0x0800, CRC(194c7189) SHA1(fd423bac2810015313841c7b935054565390fbd0) )
3640   ROM_LOAD( "pop2.6f",      0x1000, 0x0800, CRC(5ba228bb) SHA1(b0e902cdf98bee72d6ec8069eec96adce3245074) )
3641   ROM_LOAD( "pop6.6m",      0x1800, 0x0800, CRC(baf5461e) SHA1(754586a6449fd54a342f260e572c1cd60ab70815) )
3642   ROM_LOAD( "pop3.6h",      0x2000, 0x0800, CRC(08419c4a) SHA1(7e5001adad401080c788737c1d2349f218750442) )
3643   ROM_LOAD( "pop7.6n",      0x2800, 0x0800, CRC(ab74b51f) SHA1(1bce8933ed7807eb7aca9670df8994f8d1a8b5b7) )
3644   ROM_LOAD( "pop4.6j",      0x3000, 0x0800, CRC(5039b082) SHA1(086a6ac4742734167d283b1121fce29d8ac4a6cd) )
3645   ROM_LOAD( "pop8.6p",      0x3800, 0x0800, CRC(931770d7) SHA1(78fcf88e07ec5126c12c3297b62ca388809e947c) )
36463646
36473647   ROM_REGION( 0x2000, "gfx1", 0 )
3648   ROM_LOAD( "9.5e",   0x0000, 0x0800, CRC(b569c4c1) SHA1(34a09bcb6eb08375cd5e9ce0aa66b23d60489f92) )
3649   ROM_LOAD( "11.5h",  0x0800, 0x0800, CRC(3591b89d) SHA1(79bb456be6c39c1ccd7d077fbe181523131fb300) )
3650   ROM_LOAD( "10.5f",   0x1000, 0x0800, CRC(014fb5a4) SHA1(7779f0f0d11027adf3b9175af26d53f1e3a54f29) )
3651   ROM_LOAD( "12.5j",   0x1800, 0x0800, CRC(21b91c64) SHA1(4818194ecc18b5df159f3799ea93c911fd4b9556) )
3648   ROM_LOAD( "pop9.5e",      0x0000, 0x0800, CRC(b569c4c1) SHA1(34a09bcb6eb08375cd5e9ce0aa66b23d60489f92) )
3649   ROM_LOAD( "pop11.5h",     0x0800, 0x0800, CRC(3591b89d) SHA1(79bb456be6c39c1ccd7d077fbe181523131fb300) )
3650   ROM_LOAD( "pop10.5f",     0x1000, 0x0800, CRC(014fb5a4) SHA1(7779f0f0d11027adf3b9175af26d53f1e3a54f29) )
3651   ROM_LOAD( "pop12.5j",     0x1800, 0x0800, CRC(21b91c64) SHA1(4818194ecc18b5df159f3799ea93c911fd4b9556) )
36523652
36533653   ROM_REGION( 0x0120, "proms", 0 )
36543654   ROM_LOAD( "82s123.7f",    0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) )
r14521r14522
37313731
37323732ROM_START( pacheart )
37333733   ROM_REGION( 0x10000, "maincpu", 0 )
3734   ROM_LOAD( "1.6e",        0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) )
3734   ROM_LOAD( "pacheart1.6e", 0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) )
37353735   ROM_LOAD( "pacheart.pg2", 0x0800, 0x0800, CRC(b9152a38) SHA1(b6be2cb6bc7dd123503eb6bf1165dd1c99456813) )
3736   ROM_LOAD( "2.6f",        0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) )
3736   ROM_LOAD( "pacheart2.6f", 0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) )
37373737   ROM_LOAD( "pacheart.pg4", 0x1800, 0x0800, CRC(842d6574) SHA1(40e32d09cc8d701eb318716493a68cf3f95d3d6d) )
3738   ROM_LOAD( "3.6h",         0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) )
3739   ROM_LOAD( "7.6n",         0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) )
3738   ROM_LOAD( "pacheart3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) )
3739   ROM_LOAD( "pacheart7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) )
37403740   ROM_LOAD( "pacheart.pg7", 0x3000, 0x0800, CRC(f5265c10) SHA1(9a320790d7a03fd6192a92d30b3e9c754bbc6a9d) )
37413741   ROM_LOAD( "pacheart.pg8", 0x3800, 0x0800, CRC(1a21a381) SHA1(d5367a327d19fb57ba5e484bd4fda1b10953c040) )
37423742
r14521r14522
37573757
37583758ROM_START( bucaner )
37593759   ROM_REGION( 0x10000, "maincpu", 0 )
3760   ROM_LOAD( "1.6e", 0x0000, 0x0800, CRC(2c0fa0ab) SHA1(37680e4502771ae69d51d07ce43f65b9b2dd2a49) )
3761   ROM_LOAD( "5.6k", 0x0800, 0x0800, CRC(afeca2f1) SHA1(1e6d6c75eeb3a354ce2dc88da62caf9e7d53d0cb) )
3762   ROM_LOAD( "2.6f", 0x1000, 0x0800, CRC(6b53ada9) SHA1(a905688b389bfbc6792965d8f3d5bb1b9f0f4ec6) )
3763   ROM_LOAD( "6.6m", 0x1800, 0x0800, CRC(35f3ca84) SHA1(3da7336caa0742ea79f1e0e8f6b80f8560507a33) )
3764   ROM_LOAD( "3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) )
3765   ROM_LOAD( "7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) )
3766   ROM_LOAD( "4.6j", 0x3000, 0x0800, CRC(292de161) SHA1(09b439c301d7bedb76c1590e937e9d8d5e24a048) )
3767   ROM_LOAD( "8.6p", 0x3800, 0x0800, CRC(884af858) SHA1(bad8b0dfdaf221dff0f84928f20873b01a168be5) )
3760   ROM_LOAD( "buc1.6e",      0x0000, 0x0800, CRC(2c0fa0ab) SHA1(37680e4502771ae69d51d07ce43f65b9b2dd2a49) )
3761   ROM_LOAD( "buc5.6k",      0x0800, 0x0800, CRC(afeca2f1) SHA1(1e6d6c75eeb3a354ce2dc88da62caf9e7d53d0cb) )
3762   ROM_LOAD( "buc2.6f",      0x1000, 0x0800, CRC(6b53ada9) SHA1(a905688b389bfbc6792965d8f3d5bb1b9f0f4ec6) )
3763   ROM_LOAD( "buc6.6m",      0x1800, 0x0800, CRC(35f3ca84) SHA1(3da7336caa0742ea79f1e0e8f6b80f8560507a33) )
3764   ROM_LOAD( "buc3.6h",      0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) )
3765   ROM_LOAD( "buc7.6n",      0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) )
3766   ROM_LOAD( "buc4.6j",      0x3000, 0x0800, CRC(292de161) SHA1(09b439c301d7bedb76c1590e937e9d8d5e24a048) )
3767   ROM_LOAD( "buc8.6p",      0x3800, 0x0800, CRC(884af858) SHA1(bad8b0dfdaf221dff0f84928f20873b01a168be5) )
37683768
37693769   ROM_REGION( 0x2000, "gfx1", 0 )
3770   ROM_LOAD( "9.5e",  0x0000, 0x0800, CRC(4060c077) SHA1(78d4aa5243246f73533fc0886438dc1fa6f7ebe5) )
3771   ROM_LOAD( "11.5h", 0x0800, 0x0800, CRC(e3861283) SHA1(61cf8ed24902910e98438d9e2e2745f226ad2a13) )
3772   ROM_LOAD( "10.5f", 0x1000, 0x0800, CRC(09f66dec) SHA1(2d3649341fed19bac15ec274f7d747de46a3edb2) )
3773   ROM_LOAD( "12.5j", 0x1800, 0x0800, CRC(653314e7) SHA1(c466a421917b3502e9115ebda1b2d11f7f586de8) )
3770   ROM_LOAD( "buc9.5e",      0x0000, 0x0800, CRC(4060c077) SHA1(78d4aa5243246f73533fc0886438dc1fa6f7ebe5) )
3771   ROM_LOAD( "buc11.5h",     0x0800, 0x0800, CRC(e3861283) SHA1(61cf8ed24902910e98438d9e2e2745f226ad2a13) )
3772   ROM_LOAD( "buc10.5f",     0x1000, 0x0800, CRC(09f66dec) SHA1(2d3649341fed19bac15ec274f7d747de46a3edb2) )
3773   ROM_LOAD( "buc12.5j",     0x1800, 0x0800, CRC(653314e7) SHA1(c466a421917b3502e9115ebda1b2d11f7f586de8) )
37743774
37753775   ROM_REGION( 0x0120, "proms", 0 )
37763776   ROM_LOAD( "82s123.7f",    0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) )
r14521r14522
37833783
37843784ROM_START( joyman )
37853785   ROM_REGION( 0x10000, "maincpu", 0 )
3786   ROM_LOAD( "1.6e",         0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) )
3787   ROM_LOAD( "5.6k",         0x0800, 0x0800, CRC(ab9c8f29) SHA1(3753b8609c30d85d89acf745cf9303b77be440fd) )
3788   ROM_LOAD( "2.6f",         0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) )
3789   ROM_LOAD( "6.6m",         0x1800, 0x0800, CRC(b3c8d32e) SHA1(8b336fca1300820308cd5c4efc60bf2ba4199302) )
3790   ROM_LOAD( "3.6h",         0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) )
3791   ROM_LOAD( "7.6n",         0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) )
3792   ROM_LOAD( "4.6j",         0x3000, 0x0800, CRC(00b553f8) SHA1(57f2e4a6da9f00935fead447b2123a8b95e5d672) )
3793   ROM_LOAD( "8.6p",         0x3800, 0x0800, CRC(5d5ce992) SHA1(ced7ed39cfc7ec7b2c0459e275577976109ee82f) )
3786   ROM_LOAD( "joy1.6e",      0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) )
3787   ROM_LOAD( "joy5.6k",      0x0800, 0x0800, CRC(ab9c8f29) SHA1(3753b8609c30d85d89acf745cf9303b77be440fd) )
3788   ROM_LOAD( "joy2.6f",      0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) )
3789   ROM_LOAD( "joy6.6m",      0x1800, 0x0800, CRC(b3c8d32e) SHA1(8b336fca1300820308cd5c4efc60bf2ba4199302) )
3790   ROM_LOAD( "joy3.6h",      0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) )
3791   ROM_LOAD( "joy7.6n",      0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) )
3792   ROM_LOAD( "joy4.6j",      0x3000, 0x0800, CRC(00b553f8) SHA1(57f2e4a6da9f00935fead447b2123a8b95e5d672) )
3793   ROM_LOAD( "joy8.6p",      0x3800, 0x0800, CRC(5d5ce992) SHA1(ced7ed39cfc7ec7b2c0459e275577976109ee82f) )
37943794
37953795   ROM_REGION( 0x2000, "gfx1", 0 )
3796   ROM_LOAD( "9.5e",  0x0000, 0x0800, CRC(39b557bc) SHA1(0f602ec84cb25fced89699e430b95b5ae93c83bd) )
3797   ROM_LOAD( "11.5h", 0x0800, 0x0800, CRC(33e0289e) SHA1(c1b910bdc61e560a8c34298deb11401f718e7330) )
3798   ROM_LOAD( "10.5f", 0x1000, 0x0800, CRC(338771a6) SHA1(7cd68cc428986255d0de29aae894900519e7fda5) )
3799   ROM_LOAD( "12.5j", 0x1800, 0x0800, CRC(f4f0add5) SHA1(d71c54ef55a755ec1316623d183b4f615ef7c055) )
3796   ROM_LOAD( "joy9.5e",      0x0000, 0x0800, CRC(39b557bc) SHA1(0f602ec84cb25fced89699e430b95b5ae93c83bd) )
3797   ROM_LOAD( "joy11.5h",     0x0800, 0x0800, CRC(33e0289e) SHA1(c1b910bdc61e560a8c34298deb11401f718e7330) )
3798   ROM_LOAD( "joy10.5f",     0x1000, 0x0800, CRC(338771a6) SHA1(7cd68cc428986255d0de29aae894900519e7fda5) )
3799   ROM_LOAD( "joy12.5j",     0x1800, 0x0800, CRC(f4f0add5) SHA1(d71c54ef55a755ec1316623d183b4f615ef7c055) )
38003800
38013801   ROM_REGION( 0x0120, "proms", 0 )
38023802   ROM_LOAD( "82s123.7f",    0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) )
r14521r14522
45984598 roms marked with a comment were in the set but we're not using them */
45994599ROM_START( eyeszacb )
46004600   ROM_REGION( 0x10000, "maincpu", 0 )
4601/**/ROM_LOAD( "11.bin",          0x0000, 0x0800, CRC(69c1602a) SHA1(47b0935406b7ee2f414de58da1d4e81c6277a0c2) ) // "no diagnostics, bad custom??" (unused)
4602   ROM_LOAD( "1.bin",           0x0000, 0x0800, CRC(a4a9d7a0) SHA1(f0b807d2fa347e50df52971aa7539a88f342bad6) )
4603   ROM_LOAD( "5.bin",           0x0800, 0x0800, CRC(c32b3f73) SHA1(80d2e987f0318b984e5c7c4d0b5faa262eebeca4) )
4604   ROM_LOAD( "2.bin",           0x1000, 0x0800, CRC(195b9473) SHA1(62eb16af38cc9004787dc55433ed3db11af44a4b) )
4605   ROM_LOAD( "6.bin",           0x1800, 0x0800, CRC(292886cb) SHA1(e77c3724c7cd8cd95014194ba4bb2f7e04afb0dd) )
4601        ROM_LOAD( "zacb_11.bin",  0x0000, 0x0800, CRC(69c1602a) SHA1(47b0935406b7ee2f414de58da1d4e81c6277a0c2) ) // "no diagnostics, bad custom??" (unused)
4602   ROM_LOAD( "zacb_1.bin",   0x0000, 0x0800, CRC(a4a9d7a0) SHA1(f0b807d2fa347e50df52971aa7539a88f342bad6) )
4603   ROM_LOAD( "zacb_5.bin",   0x0800, 0x0800, CRC(c32b3f73) SHA1(80d2e987f0318b984e5c7c4d0b5faa262eebeca4) )
4604   ROM_LOAD( "zacb_2.bin",   0x1000, 0x0800, CRC(195b9473) SHA1(62eb16af38cc9004787dc55433ed3db11af44a4b) )
4605   ROM_LOAD( "zacb_6.bin",   0x1800, 0x0800, CRC(292886cb) SHA1(e77c3724c7cd8cd95014194ba4bb2f7e04afb0dd) )
46064606//  ROM_LOAD( "33.bin",          0x2000, 0x0800, CRC(df983e1d) SHA1(7c06fc69b7d0424f7b9348649d5587ff4d6dfc2d) ) // alt rom with copyright removed (unused)
4607   ROM_LOAD( "3.bin",           0x2000, 0x0800, CRC(ff94b015) SHA1(6d8f43db3c98cadb35f70e3bff788e653dc132cd) )
4608   ROM_LOAD( "7.bin",           0x2800, 0x0800, CRC(9271c58c) SHA1(e6b8f1807c5852ae4e822d80719a4e8f8b036c31) )
4609   ROM_LOAD( "4.bin",           0x3000, 0x0800, CRC(965cf32b) SHA1(68cc573a24c74f2ab417d0330fc9523e77fda961) )
4610   ROM_LOAD( "8.bin",           0x3800, 0x0800, CRC(c254e92e) SHA1(023b45403ebc69c29516d77950dc69f05a1a130c) )
4607   ROM_LOAD( "zacb_3.bin",   0x2000, 0x0800, CRC(ff94b015) SHA1(6d8f43db3c98cadb35f70e3bff788e653dc132cd) )
4608   ROM_LOAD( "zacb_7.bin",   0x2800, 0x0800, CRC(9271c58c) SHA1(e6b8f1807c5852ae4e822d80719a4e8f8b036c31) )
4609   ROM_LOAD( "zacb_4.bin",   0x3000, 0x0800, CRC(965cf32b) SHA1(68cc573a24c74f2ab417d0330fc9523e77fda961) )
4610   ROM_LOAD( "zacb_8.bin",   0x3800, 0x0800, CRC(c254e92e) SHA1(023b45403ebc69c29516d77950dc69f05a1a130c) )
46114611
46124612   ROM_REGION( 0x2000, "gfx1", 0 )
46134613   ROM_LOAD( "x.bin",           0x0000, 0x0800, CRC(59dce22e) SHA1(81eaef3e4d8299b5133b62d04460abfa519696f5) )
src/mame/drivers/williams.c
r14521r14522
23972397
23982398ROM_START( blastero )
23992399   ROM_REGION( 0x54000, "maincpu", 0 )
2400   ROM_LOAD( "16.ic39",     0x0d000, 0x1000, CRC(2db032d2) SHA1(287769361639695b1c1ceae0fe6899d83b4575d5) )
2401   ROM_LOAD( "13.ic27",     0x0e000, 0x2000, CRC(c99213c7) SHA1(d1c1549c053de3d862d8ef3ebca02811ed289464) )
2400   ROM_LOAD( "o_16.ic39",   0x0d000, 0x1000, CRC(2db032d2) SHA1(287769361639695b1c1ceae0fe6899d83b4575d5) )
2401   ROM_LOAD( "o_13.ic27",   0x0e000, 0x2000, CRC(c99213c7) SHA1(d1c1549c053de3d862d8ef3ebca02811ed289464) )
24022402
2403   ROM_LOAD( "11.ic25",     0x10000, 0x2000, CRC(bc2d7eda) SHA1(831e9ecb75b143f9770eab1939136092a29e64f7) )
2404   ROM_LOAD( "12.ic26",     0x12000, 0x2000, CRC(8a215017) SHA1(ee9233134907c03f7a1221d9daa84fe047c2db94) )
2405   ROM_LOAD( "17.ic41",     0x14000, 0x1000, CRC(b308f0e5) SHA1(262e25be40dff66e65a0fe34c9d013a750b90876) )
2403   ROM_LOAD( "o_11.ic25",   0x10000, 0x2000, CRC(bc2d7eda) SHA1(831e9ecb75b143f9770eab1939136092a29e64f7) )
2404   ROM_LOAD( "o_12.ic26",   0x12000, 0x2000, CRC(8a215017) SHA1(ee9233134907c03f7a1221d9daa84fe047c2db94) )
2405   ROM_LOAD( "o_17.ic41",   0x14000, 0x1000, CRC(b308f0e5) SHA1(262e25be40dff66e65a0fe34c9d013a750b90876) )
24062406
24072407   ROM_LOAD( "15.ic38",     0x18000, 0x4000, CRC(1ad146a4) SHA1(5ab3d9618023b59bc329a9eeef986901867a639b) )
24082408   ROM_LOAD( "8.ic20",      0x1c000, 0x4000, CRC(f110bbb0) SHA1(314dea232a3706509399348c7415f933c64cea1b) )
r14521r14522
24112411   ROM_LOAD( "6.ic13",      0x28000, 0x4000, CRC(47fc007e) SHA1(3a80b9b7ae460e9732f7c1cdd465a5b06ded970f) )
24122412   ROM_LOAD( "5.ic11",      0x2c000, 0x4000, CRC(15c1b94d) SHA1(5d97628541eb8933870c3ffd3646b7aaf8af6af5) )
24132413   ROM_LOAD( "14.ic35",     0x30000, 0x4000, CRC(aea6b846) SHA1(04cb4b5eb000471a0cec377a5236ac8c83529528) )
2414   ROM_LOAD( "7.ic15",      0x34000, 0x4000, CRC(a1c4db77) SHA1(7a878d44b6ca7444ecbb6c8f75e5e91de149daf3) )
2414   ROM_LOAD( "o_7.ic15",    0x34000, 0x4000, CRC(a1c4db77) SHA1(7a878d44b6ca7444ecbb6c8f75e5e91de149daf3) )
24152415   ROM_LOAD( "1.ic1",       0x38000, 0x4000, CRC(8d0ea9e7) SHA1(34f8e2e99748bed29285f7e4929bb920960ab03e) )
24162416   ROM_LOAD( "2.ic3",       0x3c000, 0x4000, CRC(03c4012c) SHA1(53f0adc91e5f1ac58b08b3a6d2de8de5a40bebab) )
2417   ROM_LOAD( "4.ic7",       0x40000, 0x4000, CRC(39d2a32c) SHA1(33707877e841ef86a11b47ffabddce7f3d2a7030) )
2418   ROM_LOAD( "3.ic6",       0x44000, 0x4000, CRC(054c9f1c) SHA1(c21e3493f1ae506ab9fd28ed9ecc67d3305e9d7a) )
2417   ROM_LOAD( "o_4.ic7",     0x40000, 0x4000, CRC(39d2a32c) SHA1(33707877e841ef86a11b47ffabddce7f3d2a7030) )
2418   ROM_LOAD( "o_3.ic6",     0x44000, 0x4000, CRC(054c9f1c) SHA1(c21e3493f1ae506ab9fd28ed9ecc67d3305e9d7a) )
24192419
24202420   ROM_REGION( 0x10000, "soundcpu", 0 )
24212421   ROM_LOAD( "18.sb13",      0xf000, 0x1000, CRC(c33a3145) SHA1(6ffe2da7b70c0b576fbc1790a33eecdbb9ee3d02) )
src/mame/drivers/triplhnt.c
r14521r14522
3636static void triplhnt_update_misc(running_machine &machine, int offset)
3737{
3838   triplhnt_state *state = machine.driver_data<triplhnt_state>();
39   device_t *samples = machine.device("samples");
39   samples_device *samples = machine.device<samples_device>("samples");
4040   device_t *discrete = machine.device("discrete");
4141   UINT8 is_witch_hunt;
4242   UINT8 bit = offset >> 1;
r14521r14522
8080   bit = ~state->m_misc_flags & 0x40;
8181
8282   /* if we're not playing the sample yet, start it */
83   if (!sample_playing(samples, 0))
84      sample_start(samples, 0, 0, 1);
85   if (!sample_playing(samples, 1))
86      sample_start(samples, 1, 1, 1);
83   if (!samples->playing(0))
84      samples->start(0, 0, true);
85   if (!samples->playing(1))
86      samples->start(1, 1, true);
8787
8888   /* bit 6 turns cassette on/off */
89   sample_set_pause(samples, 0,  is_witch_hunt || bit);
90   sample_set_pause(samples, 1, !is_witch_hunt || bit);
89   samples->pause(0,  is_witch_hunt || bit);
90   samples->pause(1, !is_witch_hunt || bit);
9191}
9292
9393
r14521r14522
334334   /* sound hardware */
335335   MCFG_SPEAKER_STANDARD_MONO("mono")
336336
337   MCFG_SOUND_ADD("samples", SAMPLES, 0)
338   MCFG_SOUND_CONFIG(triplhnt_samples_interface)
337   MCFG_SAMPLES_ADD("samples", triplhnt_samples_interface)
339338   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
340339
341340   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
src/mame/drivers/tankbatt.c
r14521r14522
9898   state->m_sound_enable = !data;
9999
100100   /* hack - turn off the engine noise if the normal game nmi's are disabled */
101   if (data) sample_stop (space->machine().device("samples"), 2);
101   if (data) space->machine().device<samples_device>("samples")->stop(2);
102102}
103103
104104static WRITE8_HANDLER( tankbatt_demo_interrupt_enable_w )
r14521r14522
112112   tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
113113   if (state->m_sound_enable)
114114   {
115      device_t *samples = space->machine().device("samples");
116      sample_start (samples, 1, 3, 0);
115      samples_device *samples = space->machine().device<samples_device>("samples");
116      samples->start(1, 3);
117117   }
118118}
119119
120120static WRITE8_HANDLER( tankbatt_sh_engine_w )
121121{
122122   tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
123   device_t *samples = space->machine().device("samples");
123   samples_device *samples = space->machine().device<samples_device>("samples");
124124   if (state->m_sound_enable)
125125   {
126126      if (data)
127         sample_start (samples, 2, 2, 1);
127         samples->start(2, 2, true);
128128      else
129         sample_start (samples, 2, 1, 1);
129         samples->start(2, 1, true);
130130   }
131   else sample_stop (samples, 2);
131   else samples->stop(2);
132132}
133133
134134static WRITE8_HANDLER( tankbatt_sh_fire_w )
r14521r14522
136136   tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
137137   if (state->m_sound_enable)
138138   {
139      device_t *samples = space->machine().device("samples");
140      sample_start (samples, 0, 0, 0);
139      samples_device *samples = space->machine().device<samples_device>("samples");
140      samples->start(0, 0);
141141   }
142142}
143143
r14521r14522
311311   /* sound hardware */
312312   MCFG_SPEAKER_STANDARD_MONO("mono")
313313
314   MCFG_SOUND_ADD("samples", SAMPLES, 0)
315   MCFG_SOUND_CONFIG(tankbatt_samples_interface)
314   MCFG_SAMPLES_ADD("samples", tankbatt_samples_interface)
316315   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
317316MACHINE_CONFIG_END
318317
src/mame/drivers/m10.c
r14521r14522
199199   state->m_maincpu = machine.device("maincpu");
200200   state->m_ic8j1 = machine.device("ic8j1");
201201   state->m_ic8j2 = machine.device("ic8j2");
202   state->m_samples = machine.device("samples");
202   state->m_samples = machine.device<samples_device>("samples");
203203
204204   state->save_item(NAME(state->m_bottomline));
205205   state->save_item(NAME(state->m_flip));
r14521r14522
266266         break;
267267      case 0x01:
268268         /* MISSILE sound */
269         sample_start(state->m_samples, 0, 0, 0);
269         state->m_samples->start(0, 0);
270270         break;
271271      case 0x02:
272272         /* EXPLOSION sound */
273         sample_start(state->m_samples, 1, 1, 0);
273         state->m_samples->start(1, 1);
274274         break;
275275      case 0x03:
276276         /* INVADER HIT sound */
277         sample_start(state->m_samples, 2, 2, 0);
277         state->m_samples->start(2, 2);
278278         break;
279279      case 0x04:
280280         /* BONUS BASE sound */
281         sample_start(state->m_samples, 3, 8, 0);
281         state->m_samples->start(3, 8);
282282         break;
283283      case 0x05:
284284         /* FLEET MOVE sound */
285         sample_start(state->m_samples, 3, 3, 0);
285         state->m_samples->start(3, 3);
286286         break;
287287      case 0x06:
288288         /* SAUCER HIT SOUND */
289         sample_start(state->m_samples, 2, 7, 0);
289         state->m_samples->start(2, 7);
290290         break;
291291      default:
292292         popmessage("Unknown sound M10: %02x\n", data & 0x07);
r14521r14522
294294   }
295295   /* UFO SOUND */
296296   if (data & 0x08)
297      sample_stop(state->m_samples, 4);
297      state->m_samples->stop(4);
298298   else
299      sample_start(state->m_samples, 4, 9, 1);
299      state->m_samples->start(4, 9, true);
300300
301301}
302302
r14521r14522
403403   // audio control!
404404   /* MISSILE sound */
405405   if (raising_bits & 0x01)
406      sample_start(state->m_samples, 0, 0, 0);
406      state->m_samples->start(0, 0);
407407
408408   /* EXPLOSION sound */
409409   if (raising_bits & 0x02)
410      sample_start(state->m_samples, 1, 1, 0);
410      state->m_samples->start(1, 1);
411411
412412   /* Rapidly falling parachute */
413413   if (raising_bits & 0x04)
414      sample_start(state->m_samples, 3, 8, 0);
414      state->m_samples->start(3, 8);
415415
416416   /* Background sound ? */
417417   if (data & 0x10)
418      sample_start(state->m_samples, 4, 9, 1);
418      state->m_samples->start(4, 9, true);
419419   else
420      sample_stop(state->m_samples, 4);
420      state->m_samples->stop(4);
421421
422422}
423423
r14521r14522
446446#endif
447447   /* DOT sound */
448448   if (falling_bits & 0x40)
449      sample_start(state->m_samples, 0, 0, 0);
449      state->m_samples->start(0, 0);
450450#if 0
451451   if (raising_bits & 0x40)
452      sample_stop(state->m_samples, 0);
452      state->m_samples->stop(0);
453453#endif
454454
455455   /* EXPLOSION sound */
456456   if (falling_bits & 0x08)
457      sample_start(state->m_samples, 1, 1, 0);
457      state->m_samples->start(1, 1);
458458#if 0
459459   if (raising_bits & 0x08)
460      sample_stop(state->m_samples, 1);
460      state->m_samples->stop(1);
461461#endif
462462
463463   /* player changes lane */
464464   if (falling_bits & 0x10)
465      sample_start(state->m_samples, 3, 3, 0);
465      state->m_samples->start(3, 3);
466466#if 0
467467   if (raising_bits & 0x10)
468      sample_stop(state->m_samples, 3);
468      state->m_samples->stop(3);
469469#endif
470470
471471   /* computer car changes lane */
472472   if (falling_bits & 0x20)
473      sample_start(state->m_samples, 4, 4, 0);
473      state->m_samples->start(4, 4);
474474#if 0
475475   if (raising_bits & 0x20)
476      sample_stop(state->m_samples, 4);
476      state->m_samples->stop(4);
477477#endif
478478
479479   state->m_last = data;
r14521r14522
863863   /* sound hardware */
864864   MCFG_SPEAKER_STANDARD_MONO("mono")
865865
866   MCFG_SOUND_ADD("samples", SAMPLES, 0)
867   MCFG_SOUND_CONFIG(m10_samples_interface)
866   MCFG_SAMPLES_ADD("samples", m10_samples_interface)
868867   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
869868
870869MACHINE_CONFIG_END
r14521r14522
903902   /* sound hardware */
904903   MCFG_SPEAKER_STANDARD_MONO("mono")
905904
906   MCFG_SOUND_ADD("samples", SAMPLES, 0)
907   MCFG_SOUND_CONFIG(m10_samples_interface)
905   MCFG_SAMPLES_ADD("samples", m10_samples_interface)
908906   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
909907
910908MACHINE_CONFIG_END
src/osd/windows/winptty.c
r0r14522
1#define WIN32_LEAN_AND_MEAN
2
3#include <windows.h>
4
5#include "winfile.h"
6#include "strconv.h"
7#include "winutil.h"
8
9const char *winfile_ptty_identifier = "\\\\.\\pipe\\";
10
11file_error win_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize)
12{
13   TCHAR *t_name;
14   HANDLE pipe;
15
16   if((t_name = tstring_from_utf8(path)) == NULL)
17      return FILERR_OUT_OF_MEMORY;
18
19   pipe = CreateNamedPipe(t_name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 1, 32, 32, 0, NULL);
20
21   if(pipe == INVALID_HANDLE_VALUE)
22      return FILERR_ACCESS_DENIED;
23
24   (*file)->handle = pipe;
25   *filesize = 0;
26   osd_free(t_name);
27   return FILERR_NONE;
28}
29
30file_error win_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
31{
32   BOOL res;
33   DWORD bytes_read;
34
35   res = ReadFile(file->handle, buffer, count, &bytes_read, NULL);
36   if(res == FALSE)
37      return win_error_to_file_error(GetLastError());
38
39   if(actual != NULL)
40      *actual = bytes_read;
41
42   return FILERR_NONE;
43}
44
45file_error win_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
46{
47   BOOL res;
48   DWORD bytes_wrote;
49
50   res = WriteFile(file->handle, buffer, count, &bytes_wrote, NULL);
51   if(res == FALSE)
52      return win_error_to_file_error(GetLastError());
53
54   if(actual != NULL)
55      *actual = bytes_wrote;
56
57   return FILERR_NONE;
58}
59
60file_error win_close_ptty(osd_file *file)
61{
62   FlushFileBuffers(file->handle);
63   DisconnectNamedPipe(file->handle);
64   CloseHandle(file->handle);
65   osd_free(file);
66   return FILERR_NONE;
67}
src/osd/windows/windows.mak
r14521r14522
281281   $(WINOBJ)/winutil.o \
282282   $(WINOBJ)/winclip.o \
283283   $(WINOBJ)/winsocket.o \
284   $(WINOBJ)/winwork.o
284   $(WINOBJ)/winwork.o \
285   $(WINOBJ)/winptty.o
285286
286287
287288
src/osd/windows/winfile.c
r14521r14522
7272   return (_strnicmp(path, "\\\\.\\physicaldrive", 17) == 0);
7373}
7474
75extern const char *winfile_ptty_identifier;
7576
7677
7778//============================================================
r14521r14522
110111      goto error;
111112   }
112113
114   if (strncmp(path, winfile_ptty_identifier, strlen(winfile_ptty_identifier)) == 0)
115   {
116      (*file)->type = WINFILE_PTTY;
117      filerr = win_open_ptty(path, openflags, file, filesize);
118      goto error;
119   }
120
113121   (*file)->type = WINFILE_FILE;
114122
115123   // convert the path into something Windows compatible
r14521r14522
214222      case WINFILE_SOCKET:
215223         return win_read_socket(file, buffer, offset, length, actual);
216224         break;
225      case WINFILE_PTTY:
226         return win_read_ptty(file, buffer, offset, length, actual);
227         break;
217228
218229   }
219230   return FILERR_NONE;
r14521r14522
250261      case WINFILE_SOCKET:
251262         return win_write_socket(file, buffer, offset, length, actual);
252263         break;
264      case WINFILE_PTTY:
265         return win_write_ptty(file, buffer, offset, length, actual);
266         break;
253267
254268   }
255269   return FILERR_NONE;
r14521r14522
272286      case WINFILE_SOCKET:
273287         return win_close_socket(file);
274288         break;
289      case WINFILE_PTTY:
290         return win_close_ptty(file);
275291   }
276292   return FILERR_NONE;
277293}
src/osd/windows/winfile.h
r14521r14522
1515enum
1616{
1717   WINFILE_FILE = 0,
18   WINFILE_SOCKET
18   WINFILE_SOCKET,
19   WINFILE_PTTY
1920};
2021
2122//============================================================
r14521r14522
4344file_error win_write_socket(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual);
4445file_error win_close_socket(osd_file *file);
4546
47file_error win_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize);
48file_error win_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual);
49file_error win_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual);
50file_error win_close_ptty(osd_file *file);
51
4652file_error win_error_to_mame_file_error(DWORD error);
4753
4854#endif //__WINFILE__
src/emu/emu.h
r14521r14522
6767#include "hash.h"
6868#include "fileio.h" // remove me once NVRAM is implemented as device
6969#include "delegate.h"
70//#include "cothread.h"
7170
7271// memory and address spaces
7372#include "memory.h"
src/emu/emualloc.c
r14521r14522
191191
192192void free_file_line(void *memory, const char *file, int line)
193193{
194   // ignore NULL frees/deletes
195   if (memory == NULL)
196      return;
197
194198   // find the memory entry
195199   memory_entry *entry = memory_entry::find(memory);
196200
src/emu/sound/votrax.c
r14521r14522
1/**************************************************************************
1/***************************************************************************
22
3    Votrax SC-01 Emulator
3    votrax.c
44
5    Mike@Dissfulfils.co.uk
5    Hacked up votrax simulator that maps to samples, until a real one
6    is written.
67
7**************************************************************************
8****************************************************************************
89
9DEVICE_START(votrax)- Start emulation, load samples from Votrax subdirectory
10votrax_w         - Write data to votrax port
11votrax_status_r  - Return busy status (-1 = busy)
10    Copyright Aaron Giles
11    All rights reserved.
1212
13If you need to alter the base frequency (i.e. Qbert) then just alter
14the variable VotraxBaseFrequency, this is defaulted to 8000
13    Redistribution and use in source and binary forms, with or without
14    modification, are permitted provided that the following conditions are
15    met:
1516
16**************************************************************************/
17        * Redistributions of source code must retain the above copyright
18          notice, this list of conditions and the following disclaimer.
19        * Redistributions in binary form must reproduce the above copyright
20          notice, this list of conditions and the following disclaimer in
21          the documentation and/or other materials provided with the
22          distribution.
23        * Neither the name 'MAME' nor the names of its contributors may be
24          used to endorse or promote products derived from this software
25          without specific prior written permission.
1726
27    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
28    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37    POSSIBILITY OF SUCH DAMAGE.
38
39***************************************************************************/
40
1841#include "emu.h"
19#include "samples.h"
2042#include "votrax.h"
2143
2244
23typedef struct _votrax_state votrax_state;
24struct _votrax_state
25{
26   device_t *device;
27   int      stream;
28   int      frequency;      /* Some games (Qbert) change this */
29   int    volume;
30   sound_stream *   channel;
3145
32   loaded_sample *sample;
33   UINT32      pos;
34   UINT32      frac;
35   UINT32      step;
46//**************************************************************************
47//  GLOBAL VARIABLES
48//**************************************************************************
3649
37   loaded_samples *samples;
38};
50// device type definition
51const device_type VOTRAX = &device_creator<votrax_device>;
3952
40INLINE votrax_state *get_safe_token(device_t *device)
53const char *const votrax_device::s_phoneme_table[64] =
4154{
42   assert(device != NULL);
43   assert(device->type() == VOTRAX);
44   return (votrax_state *)downcast<legacy_device_base *>(device)->token();
45}
46
47#define FRAC_BITS      24
48#define FRAC_ONE      (1 << FRAC_BITS)
49#define FRAC_MASK      (FRAC_ONE - 1)
50
51
52/****************************************************************************
53 * 64 Phonemes - currently 1 sample per phoneme, will be combined sometime!
54 ****************************************************************************/
55
56static const char *const VotraxTable[65] =
57{
58 "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH",
59 "AH2","I3" ,"I2" ,"I1" ,"M"  ,"N"  ,"B"  ,"V",
60 "CH" ,"SH" ,"Z"  ,"AW1","NG" ,"AH1","OO1","OO",
61 "L"  ,"K"  ,"J"  ,"H"  ,"G"  ,"F"  ,"D"  ,"S",
62 "A"  ,"AY" ,"Y1" ,"UH3","AH" ,"P"  ,"O"  ,"I",
63 "U"  ,"Y"  ,"T"  ,"R"  ,"E"  ,"W"  ,"AE" ,"AE1",
64 "AW2","UH2","UH1","UH" ,"O2" ,"O1" ,"IU" ,"U1",
65 "THV","TH" ,"ER" ,"EH" ,"E1" ,"AW" ,"PA1","STOP",
66 0
55   "EH3",   "EH2",   "EH1",   " "/*PA0*/"DT",   "A1",    "A2",     "ZH",
56   "AH2",   "I3",    "I2",    "I1",    "M",     "N",     "B",      "V",
57   "CH",    "SH",    "Z",     "AW1",   "NG",    "AH1",   "OO1",    "OO",
58   "L",     "K",     "J",     "H",     "G",     "F",     "D",      "S",
59   "A",     "AY",    "Y1",    "UH3",   "AH",    "P",     "O",      "I",
60   "U",     "Y",     "T",     "R",     "E",     "W",     "AE",     "AE1",
61   "AW2",   "UH2",   "UH1",   "UH",    "O2",    "O1",    "IU",     "U1",
62   "THV",   "TH",    "ER",    "EH",    "E1",    "AW",    " "/*PA1*/, "."/*STOP*/
6763};
6864
69static STREAM_UPDATE( votrax_update_sound )
70{
71   votrax_state *info = (votrax_state*) param;
72   stream_sample_t *buffer = outputs[0];
7365
74   if (info->sample)
75   {
76      /* load some info locally */
77      UINT32 pos = info->pos;
78      UINT32 frac = info->frac;
79      UINT32 step = info->step;
80      UINT32 length = info->sample->length;
81      INT16 *sample = info->sample->data;
8266
83      while (length--)
84      {
85         /* do a linear interp on the sample */
86         INT32 sample1 = sample[pos];
87         INT32 sample2 = sample[(pos + 1) % length];
88         INT32 fracmult = frac >> (FRAC_BITS - 14);
89         *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14;
67//**************************************************************************
68//  LIVE DEVICE
69//**************************************************************************
9070
91         /* advance */
92         frac += step;
93         pos += frac >> FRAC_BITS;
94         frac = frac & ((1 << FRAC_BITS) - 1);
71//-------------------------------------------------
72//  votrax_device - constructor
73//-------------------------------------------------
9574
96         /* handle looping/ending */
97         if (pos >= length)
98         {
99            info->sample = NULL;
100            break;
101         }
102      }
103
104      /* push position back out */
105      info->pos = pos;
106      info->frac = frac;
107   }
75votrax_device::votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
76   : samples_device(mconfig, VOTRAX, "VOTRAX SC-01", tag, owner, clock)
77{
10878}
10979
11080
111static DEVICE_START( votrax )
112{
113   votrax_state *votrax = get_safe_token(device);
81//-------------------------------------------------
82//  static_set_interface - configuration helper
83//  to set the interface
84//-------------------------------------------------
11485
115   votrax->device = device;
116   votrax->samples = readsamples(device->machine(),VotraxTable,"votrax");
117   votrax->frequency = 8000;
118   votrax->volume = 230;
119
120   votrax->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), votrax, votrax_update_sound);
121
122   votrax->sample = NULL;
123   votrax->step = 0;
86void votrax_device::static_set_interface(device_t &device, const votrax_interface &interface)
87{
88   votrax_device &samples = downcast<votrax_device &>(device);
89   static_cast<votrax_interface &>(samples) = interface;
12490}
12591
12692
127WRITE8_DEVICE_HANDLER( votrax_w )
128{
129   votrax_state *info = get_safe_token(device);
130   int Phoneme,Intonation;
13193
132   info->channel->update();
94//**************************************************************************
95//  READ/WRITE HANDLERS
96//**************************************************************************
13397
134    Phoneme = data & 0x3F;
135    Intonation = data >> 6;
98//-------------------------------------------------
99//  write - handle a write to the control register
100//-------------------------------------------------
136101
137   logerror("Speech : %s at intonation %d\n",VotraxTable[Phoneme],Intonation);
138
139    if(Phoneme==63)
140       info->sample = NULL;
141
142    if(info->samples->sample[Phoneme].data)
102WRITE8_MEMBER( votrax_device::write )
103{
104   // append to the current string
105   m_current.cat(s_phoneme_table[data & 0x3f]);
106   
107   // look for a match in our sample table
108   for (int index = 0; m_votrax_map[index].phoneme != NULL; index++)
109      if (m_current.find(m_votrax_map[index].phoneme) != -1)
110      {
111         // if we found it, play the corresponding sample and flush the buffer
112         start(0, index);
113         m_current.replace(m_votrax_map[index].phoneme, "");
114         m_current.trimspace();
115         if (m_current.len() > 0)
116            mame_printf_warning("Votrax missed partial match: %s\n", m_current.cstr());
117         m_current.reset();
118         return;
119      }
120   
121   // if we got a stop and didn't find a match, print it
122   if ((data & 0x3f) == 0x3f)
143123   {
144      info->sample = &info->samples->sample[Phoneme];
145      info->pos = 0;
146      info->frac = 0;
147      info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine().sample_rate();
148      info->channel->set_output_gain(0, (info->volume + (8*Intonation)*100/255) / 100.0);
124      mame_printf_warning("Votrax missed match: %s\n", m_current.cstr());
125      m_current.reset();
149126   }
150127}
151128
152int votrax_status_r(device_t *device)
129
130//-------------------------------------------------
131//  status - read the status line
132//-------------------------------------------------
133
134READ_LINE_MEMBER( votrax_device::status )
153135{
154   votrax_state *info = get_safe_token(device);
155   info->channel->update();
156    return (info->sample != NULL);
136   // is this correct, or is it really a ready line and should be inverted?
137   return (m_current.len() > 0 || playing(0)) ? ASSERT_LINE : CLEAR_LINE;
157138}
158139
159140
160141
161/**************************************************************************
162 * Generic get_info
163 **************************************************************************/
142//**************************************************************************
143//  DEVICE INTERFACE
144//**************************************************************************
164145
165DEVICE_GET_INFO( votrax )
146//-------------------------------------------------
147//  device_start - handle device startup
148//-------------------------------------------------
149
150void votrax_device::device_start()
166151{
167   switch (state)
168   {
169      /* --- the following bits of info are returned as 64-bit signed integers --- */
170      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(votrax_state);          break;
152   // build up a samples list
153   for (const votrax_map *curmap = m_votrax_map; curmap->phoneme != NULL; curmap++)
154      m_sample_list.append((curmap->samplename != NULL) ? curmap->samplename : "");
171155
172      /* --- the following bits of info are returned as pointers to data or functions --- */
173      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( votrax );         break;
174      case DEVINFO_FCT_STOP:                     /* Nothing */                           break;
175      case DEVINFO_FCT_RESET:                     /* Nothing */                           break;
176
177      /* --- the following bits of info are returned as NULL-terminated strings --- */
178      case DEVINFO_STR_NAME:                     strcpy(info->s, "Votrax SC-01");            break;
179      case DEVINFO_STR_FAMILY:               strcpy(info->s, "Votrax speech");            break;
180      case DEVINFO_STR_VERSION:               strcpy(info->s, "1.0");                     break;
181      case DEVINFO_STR_SOURCE_FILE:                  strcpy(info->s, __FILE__);                  break;
182      case DEVINFO_STR_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
183   }
156   // create the samples interface
157   m_channels = 1;
158   m_names = m_sample_list;
159   m_start = NULL;
160   
161   // let the samples device do the rest
162   samples_device::device_start();
184163}
185
186
187DEFINE_LEGACY_SOUND_DEVICE(VOTRAX, votrax);
src/emu/sound/votrax.h
r14521r14522
1/***************************************************************************
2
3    votrax.h
4
5    Hacked up votrax simulator that maps to samples, until a real one
6    is written.
7
8****************************************************************************
9
10    Copyright Aaron Giles
11    All rights reserved.
12
13    Redistribution and use in source and binary forms, with or without
14    modification, are permitted provided that the following conditions are
15    met:
16
17        * Redistributions of source code must retain the above copyright
18          notice, this list of conditions and the following disclaimer.
19        * Redistributions in binary form must reproduce the above copyright
20          notice, this list of conditions and the following disclaimer in
21          the documentation and/or other materials provided with the
22          distribution.
23        * Neither the name 'MAME' nor the names of its contributors may be
24          used to endorse or promote products derived from this software
25          without specific prior written permission.
26
27    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
28    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37    POSSIBILITY OF SUCH DAMAGE.
38
39***************************************************************************/
40
141#pragma once
242
343#ifndef __VOTRAX_H__
r14521r14522
343#define __VOTRAX_H__
444
5#include "devlegcy.h"
45#include "sound/samples.h"
646
7WRITE8_DEVICE_HANDLER( votrax_w );
8int votrax_status_r(device_t *device);
947
10DECLARE_LEGACY_SOUND_DEVICE(VOTRAX, votrax);
48//**************************************************************************
49//  INTERFACE CONFIGURATION MACROS
50//**************************************************************************
1151
52#define MCFG_VOTRAX_ADD(_tag, _clock, _interface) \
53   MCFG_DEVICE_ADD(_tag, VOTRAX, 0) \
54   votrax_device::static_set_interface(*device, _interface);
55
56
57
58//**************************************************************************
59//  TYPE DEFINITIONS
60//**************************************************************************
61
62// ======================> votrax_interface sample
63
64struct votrax_map
65{
66   const char *phoneme;
67   const char *samplename;
68};
69
70struct votrax_interface
71{
72   votrax_map const *m_votrax_map;      // array of map entries
73};
74
75
76// ======================> votrax_device
77
78class votrax_device :    public samples_device,
79                  public votrax_interface
80{
81public:
82   // construction/destruction
83   votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
84
85   // static configuration helpers
86   static void static_set_interface(device_t &device, const votrax_interface &interface);
87
88   // writers
89   DECLARE_WRITE8_MEMBER( write );
90   DECLARE_READ_LINE_MEMBER( status );
91   
92protected:
93   // device-level overrides
94   virtual void device_start();
95
96private:
97   // internal state
98   astring                  m_current;
99   dynamic_array<const char *>   m_sample_list;
100
101   static const char *const s_phoneme_table[64];
102};
103
104
105
106//**************************************************************************
107//  GLOBAL VARIABLES
108//**************************************************************************
109
110// device type definition
111extern const device_type VOTRAX;
112
113
12114#endif /* __VOTRAX_H__ */
src/emu/sound/samples.c
r14521r14522
1/* samples.c
1/***************************************************************************
22
3 Playback of pre-recorded samples. Used for high-level simulation of discrete sound circuits
4 where proper low-level simulation isn't available.  Also used for tape loops and similar.
3    samples.c
54
6 Current limitations
7  - Only supports single channel samples!
5    Sound device for sample playback.
86
9 Considerations
10  - Maybe this should be part of the presentation layer (artwork etc.) with samples specified
11    in .lay files instead of in drivers?
7****************************************************************************
128
13*/
9   Playback of pre-recorded samples. Used for high-level simulation of
10   discrete sound circuits where proper low-level simulation isn't
11   available.  Also used for tape loops and similar.
1412
13   Current limitations
14     - Only supports single channel samples!
1515
16#include "emu.h"
17#include "emuopts.h"
18#include "samples.h"
19#include "../../lib/libflac/include/flac/all.h"
16   Considerations
17     - Maybe this should be part of the presentation layer
18       (artwork etc.) with samples specified in .lay files instead of
19       in drivers?
2020
21typedef struct _sample_channel sample_channel;
22struct _sample_channel
23{
24   sound_stream *stream;
25   const INT16 *source;
26   INT32      source_length;
27   INT32      source_num;
28   UINT32      pos;
29   UINT32      frac;
30   UINT32      step;
31   UINT32      basefreq;
32   UINT8      loop;
33   UINT8      paused;
34};
21****************************************************************************
3522
23    Copyright Aaron Giles
24    All rights reserved.
3625
37typedef struct _samples_info samples_info;
38struct _samples_info
39{
40   device_t *device;
41   int         numchannels;   /* how many channels */
42   sample_channel *channel;/* array of channels */
43   loaded_samples *samples;/* array of samples */
44};
26    Redistribution and use in source and binary forms, with or without
27    modification, are permitted provided that the following conditions are
28    met:
4529
30        * Redistributions of source code must retain the above copyright
31          notice, this list of conditions and the following disclaimer.
32        * Redistributions in binary form must reproduce the above copyright
33          notice, this list of conditions and the following disclaimer in
34          the documentation and/or other materials provided with the
35          distribution.
36        * Neither the name 'MAME' nor the names of its contributors may be
37          used to endorse or promote products derived from this software
38          without specific prior written permission.
4639
47INLINE samples_info *get_safe_token(device_t *device)
48{
49   assert(device != NULL);
50   assert(device->type() == SAMPLES);
51   return (samples_info *)downcast<legacy_device_base *>(device)->token();
52}
40    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
41    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
42    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
44    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
45    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
46    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
49    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
50    POSSIBILITY OF SUCH DAMAGE.
5351
52***************************************************************************/
5453
54#include "emu.h"
55#include "emuopts.h"
56#include "samples.h"
57#include "flac.h"
5558
56#define FRAC_BITS      24
57#define FRAC_ONE      (1 << FRAC_BITS)
58#define FRAC_MASK      (FRAC_ONE - 1)
59#define MAX_CHANNELS    100
6059
61struct flac_reader
62{
63   UINT8* rawdata;
64   INT16* write_data;
65   int position;
66   int length;
67   int decoded_size;
68   int sample_rate;
69   int channels;
70   int bits_per_sample;
71   int total_samples;
72   int write_position;
73} flacread;
60//**************************************************************************
61//  GLOBAL VARIABLES
62//**************************************************************************
7463
75static flac_reader* flacreadptr;
64// device type definition
65const device_type SAMPLES = &device_creator<samples_device>;
7666
77void my_error_callback(const FLAC__StreamDecoder * decoder, FLAC__StreamDecoderErrorStatus status, void * client_data)
78{
79   fatalerror("FLAC error Callback\n");
80}
8167
82void my_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
83{
8468
85   flac_reader* flacrd =  ((flac_reader*)client_data);
69//**************************************************************************
70//  LIVE DEVICE
71//**************************************************************************
8672
87   if (metadata->type==0)
88   {
89      const FLAC__StreamMetadata_StreamInfo *streaminfo = &(metadata->data.stream_info);
73//-------------------------------------------------
74//  samples_device - constructors
75//-------------------------------------------------
9076
91      flacrd->sample_rate = streaminfo->sample_rate;
92      flacrd->channels = streaminfo->channels;
93      flacrd->bits_per_sample = streaminfo->bits_per_sample;
94      flacrd->total_samples = streaminfo->total_samples;
95   }
77samples_device::samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
78   : device_t(mconfig, SAMPLES, "Samples", tag, owner, clock),
79     device_sound_interface(mconfig, *this)
80{
9681}
9782
83samples_device::samples_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
84   : device_t(mconfig, type, name, tag, owner, clock),
85     device_sound_interface(mconfig, *this)
86{
87}
9888
9989
90//-------------------------------------------------
91//  static_set_interface - configuration helper
92//  to set the interface
93//-------------------------------------------------
10094
101FLAC__StreamDecoderReadStatus my_read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
95void samples_device::static_set_interface(device_t &device, const samples_interface &interface)
10296{
103   flac_reader* flacrd =  ((flac_reader*)client_data);
97   samples_device &samples = downcast<samples_device &>(device);
98   static_cast<samples_interface &>(samples) = interface;
99}
104100
105   if(*bytes > 0)
106   {
107      if (*bytes <=  flacrd->length)
108      {
109         memcpy(buffer, flacrd->rawdata+flacrd->position, *bytes);
110         flacrd->position+=*bytes;
111         flacrd->length-=*bytes;
112         return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
113      }
114      else
115      {
116         memcpy(buffer, flacrd->rawdata+flacrd->position,  flacrd->length);
117          flacrd->position+= flacrd->length;
118         flacrd->length = 0;
119101
120         return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
121      }
122   }
123   else
124   {
125      return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
126   }
127102
128   if ( flacrd->length==0)
129   {
130      return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
131   }
103//**************************************************************************
104//  PUBLIC INTERFACE
105//**************************************************************************
132106
133   return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
107//-------------------------------------------------
108//  start - start playing a loaded sample
109//-------------------------------------------------
134110
135}
136
137FLAC__StreamDecoderWriteStatus my_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data)
111void samples_device::start(UINT8 channel, UINT32 samplenum, bool loop)
138112{
139   flac_reader* flacrd =  ((flac_reader*)client_data);
113   // if samples are disabled, just return quietly
114   if (m_sample.count() == 0)
115      return;
140116
141   flacrd->decoded_size += frame->header.blocksize;
117    assert(samplenum < m_sample.count());
118    assert(channel < m_channels);
142119
143   for (int i=0;i<frame->header.blocksize;i++)
144   {
145      flacrd->write_data[i+flacrd->write_position] = buffer[0][i];
146   }
120   // force an update before we start
121    channel_t &chan = m_channel[channel];
122   chan.stream->update();
147123
148   flacrd->write_position +=  frame->header.blocksize;
149
150   return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
124   // update the parameters
125   loaded_sample &sample = m_sample[samplenum];
126   chan.source = sample.data;
127   chan.source_length = sample.length;
128   chan.source_num = (sample.data.count() > 0) ? samplenum : -1;
129   chan.pos = 0;
130   chan.frac = 0;
131   chan.basefreq = sample.frequency;
132   chan.step = (INT64(chan.basefreq) << FRAC_BITS) / machine().sample_rate();
133   chan.loop = loop;
151134}
152135
153136
137//-------------------------------------------------
138//  start_raw - start playing an externally
139//  provided sample
140//-------------------------------------------------
154141
155
156
157
158/*-------------------------------------------------
159    read_wav_sample - read a WAV file as a sample
160-------------------------------------------------*/
161
162static int read_wav_sample(running_machine &machine, emu_file &file, loaded_sample *sample, char* filename)
142void samples_device::start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop)
163143{
164   unsigned long offset = 0;
165   UINT32 length, rate, filesize;
166   UINT16 bits, temp16;
167   char buf[32];
168   UINT32 sindex;
169   int type = 0;
144    assert(channel < m_channels);
170145
171   /* read the core header and make sure it's a WAVE file */
172   offset += file.read(buf, 4);
173   if (offset < 4)
174   {
175      mame_printf_warning("unable to read %s, 0-byte file?\n", filename);
176      return 0;
177   }
178   if (memcmp(&buf[0], "RIFF", 4) == 0)
179      type = 1;
180   else if (memcmp(&buf[0], "fLaC", 4) == 0)
181      type = 2;
182   else
183   {
184      mame_printf_warning("unable to read %s, corrupt file?\n", filename);
185      return 0;
186   }
146   // force an update before we start
147    channel_t &chan = m_channel[channel];
148   chan.stream->update();
187149
188   if (type==1)
189   {
190      /* get the total size */
191      offset += file.read(&filesize, 4);
192      if (offset < 8)
193         return 0;
194      filesize = LITTLE_ENDIANIZE_INT32(filesize);
150   // update the parameters
151   chan.source = sampledata;
152   chan.source_length = samples;
153   chan.source_num = -1;
154   chan.pos = 0;
155   chan.frac = 0;
156   chan.basefreq = frequency;
157   chan.step = (INT64(chan.basefreq) << FRAC_BITS) / machine().sample_rate();
158   chan.loop = loop;
159}
195160
196      /* read the RIFF file type and make sure it's a WAVE file */
197      offset += file.read(buf, 4);
198      if (offset < 12)
199         return 0;
200      if (memcmp(&buf[0], "WAVE", 4) != 0)
201         return 0;
202161
203      /* seek until we find a format tag */
204      while (1)
205      {
206         offset += file.read(buf, 4);
207         offset += file.read(&length, 4);
208         length = LITTLE_ENDIANIZE_INT32(length);
209         if (memcmp(&buf[0], "fmt ", 4) == 0)
210            break;
162//-------------------------------------------------
163//  set_frequency - set the playback frequency of
164//  a sample
165//-------------------------------------------------
211166
212         /* seek to the next block */
213         file.seek(length, SEEK_CUR);
214         offset += length;
215         if (offset >= filesize)
216            return 0;
217      }
167void samples_device::set_frequency(UINT8 channel, UINT32 freq)
168{
169    assert(channel < m_channels);
218170
219      /* read the format -- make sure it is PCM */
220      offset += file.read(&temp16, 2);
221      temp16 = LITTLE_ENDIANIZE_INT16(temp16);
222      if (temp16 != 1)
223         return 0;
171   // force an update before we start
172    channel_t &chan = m_channel[channel];
173   chan.stream->update();
174   chan.step = (INT64(freq) << FRAC_BITS) / machine().sample_rate();
175}
224176
225      /* number of channels -- only mono is supported */
226      offset += file.read(&temp16, 2);
227      temp16 = LITTLE_ENDIANIZE_INT16(temp16);
228      if (temp16 != 1)
229         return 0;
230177
231      /* sample rate */
232      offset += file.read(&rate, 4);
233      rate = LITTLE_ENDIANIZE_INT32(rate);
178//-------------------------------------------------
179//  set_volume - set the playback volume of a
180//  sample
181//-------------------------------------------------
234182
235      /* bytes/second and block alignment are ignored */
236      offset += file.read(buf, 6);
183void samples_device::set_volume(UINT8 channel, float volume)
184{
185    assert(channel < m_channels);
237186
238      /* bits/sample */
239      offset += file.read(&bits, 2);
240      bits = LITTLE_ENDIANIZE_INT16(bits);
241      if (bits != 8 && bits != 16)
242         return 0;
187   // force an update before we start
188    channel_t &chan = m_channel[channel];
189   chan.stream->set_output_gain(0, volume);
190}
243191
244      /* seek past any extra data */
245      file.seek(length - 16, SEEK_CUR);
246      offset += length - 16;
247192
248      /* seek until we find a data tag */
249      while (1)
250      {
251         offset += file.read(buf, 4);
252         offset += file.read(&length, 4);
253         length = LITTLE_ENDIANIZE_INT32(length);
254         if (memcmp(&buf[0], "data", 4) == 0)
255            break;
193//-------------------------------------------------
194//  pause - pause playback on a channel
195//-------------------------------------------------
256196
257         /* seek to the next block */
258         file.seek(length, SEEK_CUR);
259         offset += length;
260         if (offset >= filesize)
261            return 0;
262      }
197void samples_device::pause(UINT8 channel, bool pause)
198{
199    assert(channel < m_channels);
263200
264      /* if there was a 0 length data block, we're done */
265      if (length == 0)
266         return 0;
201   // force an update before we start
202    channel_t &chan = m_channel[channel];
203   chan.paused = pause;
204}
267205
268      /* fill in the sample data */
269      sample->length = length;
270      sample->frequency = rate;
271206
272      /* read the data in */
273      if (bits == 8)
274      {
275         unsigned char *tempptr;
276         int sindex;
207//-------------------------------------------------
208//  stop - stop playback on a channel
209//-------------------------------------------------
277210
278         sample->data = auto_alloc_array(machine, INT16, length);
279         file.read(sample->data, length);
211void samples_device::stop(UINT8 channel)
212{
213    assert(channel < m_channels);
280214
281         /* convert 8-bit data to signed samples */
282         tempptr = (unsigned char *)sample->data;
283         for (sindex = length - 1; sindex >= 0; sindex--)
284            sample->data[sindex] = (INT8)(tempptr[sindex] ^ 0x80) * 256;
215   // force an update before we start
216    channel_t &chan = m_channel[channel];
217    chan.source = NULL;
218    chan.source_num = -1;
219}
285220
286      }
287      else
288      {
289         /* 16-bit data is fine as-is */
290         sample->data = auto_alloc_array(machine, INT16, length/2);
291         file.read(sample->data, length);
292221
293            sample->length /= 2;
294         if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE)
295            for (sindex = 0; sindex < sample->length; sindex++)
296               sample->data[sindex] = LITTLE_ENDIANIZE_INT16(sample->data[sindex]);
297      }
298   }
299   else
300   {
301      int length;
222//-------------------------------------------------
223//  stop_all - stop playback on all channels
224//-------------------------------------------------
302225
303      file.seek(0, SEEK_END);
304      length = file.tell();
305      file.seek(0, 0);
226void samples_device::stop_all()
227{
228   // just iterate over channels and stop them
229   for (UINT8 channel = 0; channel < m_channels; channel++)
230      stop(channel);
231}
306232
307      flacread.rawdata = auto_alloc_array(machine, UINT8, length);
308      flacread.length = length;
309      flacread.position = 0;
310      flacread.decoded_size = 0;
311233
312      flacreadptr = &flacread;
234//-------------------------------------------------
235//  base_frequency - return the base frequency of
236//  a channel being played
237//-------------------------------------------------
313238
314      file.read(flacread.rawdata, length);
239UINT32 samples_device::base_frequency(UINT8 channel) const
240{
241    assert(channel < m_channels);
315242
316      FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new();
243   // force an update before we start
244    const channel_t &chan = m_channel[channel];
245   chan.stream->update();
246   return chan.basefreq;
247}
317248
318      if (!decoder)
319         fatalerror("Fail FLAC__stream_decoder_new\n");
320249
321      if(FLAC__stream_decoder_init_stream(
322         decoder,
323         my_read_callback,
324         NULL, //my_seek_callback,      // or NULL
325         NULL, //my_tell_callback,      // or NULL
326         NULL, //my_length_callback,    // or NULL
327         NULL, //my_eof_callback,       // or NULL
328         my_write_callback,
329         my_metadata_callback, //my_metadata_callback,  // or NULL
330         my_error_callback,
331         (void*)flacreadptr /*my_client_data*/ ) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
332         fatalerror("Fail FLAC__stream_decoder_init_stream\n");
250//-------------------------------------------------
251//  playing - return true if a sample is still
252//   playing on the given channel
253//-------------------------------------------------
333254
334      if (FLAC__stream_decoder_process_until_end_of_metadata(decoder) != FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM)
335         fatalerror("Fail FLAC__stream_decoder_process_until_end_of_metadata\n");
255bool samples_device::playing(UINT8 channel) const
256{
257    assert(channel < m_channels);
336258
337      if (flacread.channels != 1) // only Mono supported
338         fatalerror("Only MONO samples are supported\n");
259   // force an update before we start
260    const channel_t &chan = m_channel[channel];
261   chan.stream->update();
262   return (chan.source != NULL);
263}
339264
340265
341      sample->data = auto_alloc_array(machine, INT16, flacread.total_samples*2);
342      flacread.write_position = 0;
343      flacread.write_data = sample->data;
344266
345      if (FLAC__stream_decoder_process_until_end_of_stream (decoder) != FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM)
346      {
347         fatalerror("Fail FLAC__stream_decoder_process_until_end_of_stream\n");
348      }
267//**************************************************************************
268//  DEVICE INTERFACE
269//**************************************************************************
349270
350      if (FLAC__stream_decoder_finish (decoder) != true)
351         fatalerror("Fail FLAC__stream_decoder_finish\n");
271//-------------------------------------------------
272//  device_start - handle device startup
273//-------------------------------------------------
352274
353      FLAC__stream_decoder_delete(decoder);
275void samples_device::device_start()
276{
277   // read audio samples
278   load_samples();
354279
355      /* fill in the sample data */
280   // allocate channels
281   m_channel.resize(m_channels);
282   for (int channel = 0; channel < m_channels; channel++)
283   {
284      // initialize channel
285      channel_t &chan = m_channel[channel];
286       chan.stream = stream_alloc(0, 1, machine().sample_rate());
287      chan.source = NULL;
288      chan.source_num = -1;
289      chan.step = 0;
290      chan.loop = 0;
291      chan.paused = 0;
356292
357      sample->frequency = flacread.sample_rate;
358      sample->length = flacread.total_samples * (flacread.bits_per_sample/8);
359
360      if (flacread.bits_per_sample == 8)
361      {
362         for (sindex = 0; sindex <= sample->length; sindex++)
363            sample->data[sindex] = ((sample->data[sindex])&0xff)*256;
364      }
365      else // don't need to process 16-bit samples?
366      {
367         sample->length = sample->length /2; //??
368      }
293      // register with the save state system
294        save_item(NAME(chan.source_length), channel);
295        save_item(NAME(chan.source_num), channel);
296        save_item(NAME(chan.pos), channel);
297        save_item(NAME(chan.frac), channel);
298        save_item(NAME(chan.step), channel);
299        save_item(NAME(chan.loop), channel);
300        save_item(NAME(chan.paused), channel);
369301   }
370302
371   return 1;
303   // initialize any custom handlers
304   if (m_start != NULL)
305      (*m_start)(*this);
372306}
373307
374308
375/*-------------------------------------------------
376    readsamples - load all samples
377-------------------------------------------------*/
309//-------------------------------------------------
310//  device_reset - handle device reset
311//-------------------------------------------------
378312
379loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *basename)
313void samples_device::device_reset()
380314{
381   loaded_samples *samples;
382   int skipfirst = 0;
383   int i;
315   stop_all();
316}
384317
385   /* if the user doesn't want to use samples, bail */
386   if (!machine.options().samples())
387      return NULL;
388   if (samplenames == 0 || samplenames[0] == 0)
389      return NULL;
390318
391   /* if a name begins with '*', we will also look under that as an alternate basename */
392   if (samplenames[0][0] == '*')
393      skipfirst = 1;
319//-------------------------------------------------
320//  device_post_load - handle updating after a
321//   restore
322//-------------------------------------------------
394323
395   /* count the samples */
396   for (i = 0; samplenames[i+skipfirst] != 0; i++) ;
397   if (i == 0)
398      return NULL;
399
400   /* allocate the array */
401   samples = (loaded_samples *)auto_alloc_array_clear(machine, UINT8, sizeof(loaded_samples) + (i-1) * sizeof(loaded_sample));
402   samples->total = i;
403
404   /* load the samples */
405   for (i = 0; i < samples->total; i++)
406      if (samplenames[i+skipfirst][0])
324void samples_device::device_post_load()
325{
326   // loop over channels
327   for (int channel = 0; channel < m_channels; channel++)
328   {
329      // attach any samples that were loaded and playing
330      channel_t &chan = m_channel[channel];
331      if (chan.source_num >= 0 && chan.source_num < m_sample.count())
407332      {
408         emu_file file(machine.options().sample_path(), OPEN_FLAG_READ);
409         file_error filerr = FILERR_NOT_FOUND;
333         loaded_sample &sample = m_sample[chan.source_num];
334         chan.source = sample.data;
335         chan.source_length = sample.length;
336         if (sample.data == NULL)
337            chan.source_num = -1;
338      }
410339
411         char filename[512];
412
413         if (filerr != FILERR_NONE)
340      // validate the position against the length in case the sample is smaller
341      if (chan.source != NULL && chan.pos >= chan.source_length)
342      {
343         if (chan.loop)
344            chan.pos %= chan.source_length;
345         else
414346         {
415            // first try opening samples as .flac
416            sprintf(filename, "%s.flac", samplenames[i+skipfirst]);
417
418            filerr = file.open(basename, PATH_SEPARATOR, filename);
419            // try parent sample set
420            if (filerr != FILERR_NONE && skipfirst)
421               filerr = file.open(samplenames[0] + 1, PATH_SEPARATOR, filename);
347            chan.source = NULL;
348            chan.source_num = -1;
422349         }
423
424         if (filerr != FILERR_NONE)
425         {
426            // .wav fallback
427            sprintf(filename, "%s.wav", samplenames[i+skipfirst]);
428
429            filerr = file.open(basename, PATH_SEPARATOR, filename);
430            // try parent sample set
431            if (filerr != FILERR_NONE && skipfirst)
432               filerr = file.open(samplenames[0] + 1, PATH_SEPARATOR, filename);
433         }
434
435
436         if (filerr == FILERR_NONE)
437            read_wav_sample(machine, file, &samples->sample[i], filename);
438
439         if (filerr == FILERR_NOT_FOUND)
440            mame_printf_warning("sample '%s' NOT FOUND\n", samplenames[i+skipfirst]);
441
442350      }
443
444   return samples;
351   }
445352}
446353
447354
355//-------------------------------------------------
356//  sound_stream_update - update a sound stream
357//-------------------------------------------------
448358
449
450/* Start one of the samples loaded from disk. Note: channel must be in the range */
451/* 0 .. Samplesinterface->channels-1. It is NOT the discrete channel to pass to */
452/* mixer_play_sample() */
453void sample_start(device_t *device,int channel,int samplenum,int loop)
359void samples_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
454360{
455    samples_info *info = get_safe_token(device);
456    sample_channel *chan;
457    loaded_sample *sample;
361   // find the channel with this stream
362   for (int channel = 0; channel < m_channels; channel++)
363      if (&stream == m_channel[channel].stream)
364      {
365         channel_t &chan = m_channel[channel];
366         stream_sample_t *buffer = outputs[0];
458367
459   /* if samples are disabled, just return quietly */
460   if (info->samples == NULL)
461      return;
368         // process if we still have a source and we're not paused
369         if (chan.source != NULL && !chan.paused)
370         {
371            // load some info locally
372            UINT32 pos = chan.pos;
373            UINT32 frac = chan.frac;
374            UINT32 step = chan.step;
375            const INT16 *sample = chan.source;
376            UINT32 sample_length = chan.source_length;
462377
463    assert( samplenum < info->samples->total );
464    assert( channel < info->numchannels );
378            while (samples--)
379            {
380               // do a linear interp on the sample
381               INT32 sample1 = sample[pos];
382               INT32 sample2 = sample[(pos + 1) % sample_length];
383               INT32 fracmult = frac >> (FRAC_BITS - 14);
384               *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14;
465385
466    chan = &info->channel[channel];
386               // advance
387               frac += step;
388               pos += frac >> FRAC_BITS;
389               frac = frac & ((1 << FRAC_BITS) - 1);
467390
468   /* force an update before we start */
469   chan->stream->update();
391               // handle looping/ending
392               if (pos >= sample_length)
393               {
394                  if (chan.loop)
395                     pos %= sample_length;
396                  else
397                  {
398                     chan.source = NULL;
399                     chan.source_num = -1;
400                     if (samples > 0)
401                        memset(buffer, 0, samples * sizeof(*buffer));
402                     samples = 0;
403                     break;
404                  }
405               }
406            }
470407
471   /* update the parameters */
472   sample = &info->samples->sample[samplenum];
473   chan->source = sample->data;
474   chan->source_length = sample->length;
475   chan->source_num = sample->data ? samplenum : -1;
476   chan->pos = 0;
477   chan->frac = 0;
478   chan->basefreq = sample->frequency;
479   chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate();
480   chan->loop = loop;
408            // push position back out
409            chan.pos = pos;
410            chan.frac = frac;
411         }
412         else
413            memset(buffer, 0, samples * sizeof(*buffer));
414         break;
415      }
481416}
482417
483418
484void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop)
485{
486    samples_info *info = get_safe_token(device);
487    sample_channel *chan;
488419
489    assert( channel < info->numchannels );
420//**************************************************************************
421//  INTERNAL HELPERS
422//**************************************************************************
490423
491    chan = &info->channel[channel];
424//-------------------------------------------------
425//  read_sample - read a WAV or FLAC file as a
426//  sample
427//-------------------------------------------------
492428
493   /* force an update before we start */
494   chan->stream->update();
495
496   /* update the parameters */
497   chan->source = sampledata;
498   chan->source_length = samples;
499   chan->source_num = -1;
500   chan->pos = 0;
501   chan->frac = 0;
502   chan->basefreq = frequency;
503   chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate();
504   chan->loop = loop;
505}
506
507
508void sample_set_freq(device_t *device,int channel,int freq)
429bool samples_device::read_sample(emu_file &file, loaded_sample &sample)
509430{
510    samples_info *info = get_safe_token(device);
511    sample_channel *chan;
431   // read the core header and make sure it's a proper file
432   UINT8 buf[4];
433   UINT32 offset = file.read(buf, 4);
434   if (offset < 4)
435   {
436      mame_printf_warning("Unable to read %s, 0-byte file?\n", file.filename());
437      return false;
438   }
439   
440   // look for the appropriate RIFF tag
441   if (memcmp(&buf[0], "RIFF", 4) == 0)
442      return read_wav_sample(file, sample);
443   else if (memcmp(&buf[0], "fLaC", 4) == 0)
444      return read_flac_sample(file, sample);
512445
513    assert( channel < info->numchannels );
514
515    chan = &info->channel[channel];
516
517   /* force an update before we start */
518   chan->stream->update();
519
520   chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine().sample_rate();
446   // if nothing appropriate, emit a warning
447   mame_printf_warning("Unable to read %s, corrupt file?\n", file.filename());
448   return false;
521449}
522450
523451
524void sample_set_volume(device_t *device,int channel,float volume)
525{
526    samples_info *info = get_safe_token(device);
527    sample_channel *chan;
452//-------------------------------------------------
453//  read_wav_sample - read a WAV file as a sample
454//-------------------------------------------------
528455
529    assert( channel < info->numchannels );
530
531    chan = &info->channel[channel];
532
533   chan->stream->set_output_gain(0, volume);
534}
535
536
537void sample_set_pause(device_t *device,int channel,int pause)
456bool samples_device::read_wav_sample(emu_file &file, loaded_sample &sample)
538457{
539    samples_info *info = get_safe_token(device);
540    sample_channel *chan;
458printf("Reading %s as WAV\n", file.filename());
459   // we already read the opening 'WAVE' header
460   UINT32 offset = 4;
461   
462   // get the total size
463   UINT32 filesize;
464   offset += file.read(&filesize, 4);
465   if (offset < 8)
466      return false;
467   filesize = LITTLE_ENDIANIZE_INT32(filesize);
541468
542    assert( channel < info->numchannels );
469   // read the RIFF file type and make sure it's a WAVE file
470   char buf[32];
471   offset += file.read(buf, 4);
472   if (offset < 12)
473      return false;
474   if (memcmp(&buf[0], "WAVE", 4) != 0)
475      return false;
543476
544    chan = &info->channel[channel];
477   // seek until we find a format tag
478   UINT32 length;
479   while (1)
480   {
481      offset += file.read(buf, 4);
482      offset += file.read(&length, 4);
483      length = LITTLE_ENDIANIZE_INT32(length);
484      if (memcmp(&buf[0], "fmt ", 4) == 0)
485         break;
545486
546   /* force an update before we start */
547   chan->stream->update();
487      // seek to the next block
488      file.seek(length, SEEK_CUR);
489      offset += length;
490      if (offset >= filesize)
491         return false;
492   }
548493
549   chan->paused = pause;
550}
494   // read the format -- make sure it is PCM
495   UINT16 temp16;
496   offset += file.read(&temp16, 2);
497   temp16 = LITTLE_ENDIANIZE_INT16(temp16);
498   if (temp16 != 1)
499      return false;
551500
501   // number of channels -- only mono is supported
502   offset += file.read(&temp16, 2);
503   temp16 = LITTLE_ENDIANIZE_INT16(temp16);
504   if (temp16 != 1)
505      return false;
552506
553void sample_stop(device_t *device,int channel)
554{
555    samples_info *info = get_safe_token(device);
556    sample_channel *chan;
507   // sample rate
508   UINT32 rate;
509   offset += file.read(&rate, 4);
510   rate = LITTLE_ENDIANIZE_INT32(rate);
557511
558    assert( channel < info->numchannels );
512   // bytes/second and block alignment are ignored
513   offset += file.read(buf, 6);
559514
560    chan = &info->channel[channel];
515   // bits/sample
516   UINT16 bits;
517   offset += file.read(&bits, 2);
518   bits = LITTLE_ENDIANIZE_INT16(bits);
519   if (bits != 8 && bits != 16)
520      return false;
561521
562    /* force an update before we start */
563    chan->stream->update();
564    chan->source = NULL;
565    chan->source_num = -1;
566}
522   // seek past any extra data
523   file.seek(length - 16, SEEK_CUR);
524   offset += length - 16;
567525
526   // seek until we find a data tag
527   while (1)
528   {
529      offset += file.read(buf, 4);
530      offset += file.read(&length, 4);
531      length = LITTLE_ENDIANIZE_INT32(length);
532      if (memcmp(&buf[0], "data", 4) == 0)
533         break;
568534
569int sample_get_base_freq(device_t *device,int channel)
570{
571    samples_info *info = get_safe_token(device);
572    sample_channel *chan;
535      // seek to the next block
536      file.seek(length, SEEK_CUR);
537      offset += length;
538      if (offset >= filesize)
539         return false;
540   }
573541
574    assert( channel < info->numchannels );
542   // if there was a 0 length data block, we're done
543   if (length == 0)
544      return false;
575545
576    chan = &info->channel[channel];
546   // fill in the sample data
547   sample.length = length / 2;
548   sample.frequency = rate;
577549
578   /* force an update before we start */
579   chan->stream->update();
580   return chan->basefreq;
581}
582
583
584int sample_playing(device_t *device,int channel)
585{
586    samples_info *info = get_safe_token(device);
587    sample_channel *chan;
588
589    assert( channel < info->numchannels );
590
591    chan = &info->channel[channel];
592
593   /* force an update before we start */
594   chan->stream->update();
595   return (chan->source != NULL);
596}
597
598
599static STREAM_UPDATE( sample_update_sound )
600{
601   sample_channel *chan = (sample_channel *)param;
602   stream_sample_t *buffer = outputs[0];
603
604   if (chan->source && !chan->paused)
550   // read the data in
551   if (bits == 8)
605552   {
606      /* load some info locally */
607      UINT32 pos = chan->pos;
608      UINT32 frac = chan->frac;
609      UINT32 step = chan->step;
610      const INT16 *sample = chan->source;
611      UINT32 sample_length = chan->source_length;
553      sample.data.resize(length);
554      file.read(sample.data, length);
612555
613      while (samples--)
614      {
615         /* do a linear interp on the sample */
616         INT32 sample1 = sample[pos];
617         INT32 sample2 = sample[(pos + 1) % sample_length];
618         INT32 fracmult = frac >> (FRAC_BITS - 14);
619         *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14;
620
621         /* advance */
622         frac += step;
623         pos += frac >> FRAC_BITS;
624         frac = frac & ((1 << FRAC_BITS) - 1);
625
626         /* handle looping/ending */
627         if (pos >= sample_length)
628         {
629            if (chan->loop)
630               pos %= sample_length;
631            else
632            {
633               chan->source = NULL;
634               chan->source_num = -1;
635               if (samples > 0)
636                  memset(buffer, 0, samples * sizeof(*buffer));
637               break;
638            }
639         }
640      }
641
642      /* push position back out */
643      chan->pos = pos;
644      chan->frac = frac;
556      // convert 8-bit data to signed samples
557      UINT8 *tempptr = reinterpret_cast<UINT8 *>(&sample.data[0]);
558      for (UINT32 sindex = length - 1; sindex >= 0; sindex--)
559         sample.data[sindex] = INT8(tempptr[sindex] ^ 0x80) * 256;
645560   }
646561   else
647      memset(buffer, 0, samples * sizeof(*buffer));
648}
649
650
651static void samples_postload(samples_info *info)
652{
653   int i;
654
655   /* loop over channels */
656   for (i = 0; i < info->numchannels; i++)
657562   {
658      sample_channel *chan = &info->channel[i];
563      // 16-bit data is fine as-is
564      sample.data.resize(length / 2);
565      file.read(sample.data, length);
659566
660      /* attach any samples that were loaded and playing */
661      if (chan->source_num >= 0 && chan->source_num < info->samples->total)
662      {
663         loaded_sample *sample = &info->samples->sample[chan->source_num];
664         chan->source = sample->data;
665         chan->source_length = sample->length;
666         if (!sample->data)
667            chan->source_num = -1;
668      }
669
670      /* validate the position against the length in case the sample is smaller */
671      if (chan->source && chan->pos >= chan->source_length)
672      {
673         if (chan->loop)
674            chan->pos %= chan->source_length;
675         else
676         {
677            chan->source = NULL;
678            chan->source_num = -1;
679         }
680      }
567      // swap high/low on big-endian systems
568      if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE)
569         for (UINT32 sindex = 0; sindex < sample.length; sindex++)
570            sample.data[sindex] = LITTLE_ENDIANIZE_INT16(sample.data[sindex]);
681571   }
572   return true;
682573}
683574
684575
685static DEVICE_START( samples )
576//-------------------------------------------------
577//  read_flac_sample - read a FLAC file as a sample
578//-------------------------------------------------
579
580bool samples_device::read_flac_sample(emu_file &file, loaded_sample &sample)
686581{
687   int i;
688   const samples_interface *intf = (const samples_interface *)device->static_config();
689   samples_info *info = get_safe_token(device);
582printf("Reading %s as FLAC\n", file.filename());
583   // seek back to the start of the file
584   file.seek(0, SEEK_SET);
690585
691   info->device = device;
586   // create the FLAC decoder and fill in the sample data
587   flac_decoder decoder(file);
588   sample.length = decoder.total_samples();
589   sample.frequency = decoder.sample_rate();
692590
693   /* read audio samples */
694   if (intf->samplenames)
695      info->samples = readsamples(device->machine(), intf->samplenames,device->machine().system().name);
696
697   /* allocate channels */
698   info->numchannels = intf->channels;
699   assert(info->numchannels < MAX_CHANNELS);
700   info->channel = auto_alloc_array(device->machine(), sample_channel, info->numchannels);
701   for (i = 0; i < info->numchannels; i++)
702   {
703       info->channel[i].stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), &info->channel[i], sample_update_sound);
704
705      info->channel[i].source = NULL;
706      info->channel[i].source_num = -1;
707      info->channel[i].step = 0;
708      info->channel[i].loop = 0;
709      info->channel[i].paused = 0;
710
711      /* register with the save state system */
712        device->save_item(NAME(info->channel[i].source_length), i);
713        device->save_item(NAME(info->channel[i].source_num), i);
714        device->save_item(NAME(info->channel[i].pos), i);
715        device->save_item(NAME(info->channel[i].frac), i);
716        device->save_item(NAME(info->channel[i].step), i);
717        device->save_item(NAME(info->channel[i].loop), i);
718        device->save_item(NAME(info->channel[i].paused), i);
719   }
720   device->machine().save().register_postload(save_prepost_delegate(FUNC(samples_postload), info));
721
722   /* initialize any custom handlers */
723   if (intf->start)
724      (*intf->start)(device);
591   // error if more than 1 channel or not 16bpp
592   if (decoder.channels() != 1)
593      return false;
594   if (decoder.bits_per_sample() != 16)
595      return false;
596   
597   // resize the array and read
598   sample.data.resize(sample.length);
599   if (!decoder.decode_interleaved(sample.data, sample.length))
600      return false;
601   
602   // finish up and clean up
603   decoder.finish();
604   return true;
725605}
726606
727607
608//-------------------------------------------------
609//  load_samples - load all the samples in our
610//  attached interface
611//-------------------------------------------------
728612
729/**************************************************************************
730 * Generic get_info
731 **************************************************************************/
732
733DEVICE_GET_INFO( samples )
613void samples_device::load_samples()
734614{
735   switch (state)
736   {
737      /* --- the following bits of info are returned as 64-bit signed integers --- */
738      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(samples_info);         break;
615   // if the user doesn't want to use samples, bail
616   if (!machine().options().samples())
617      return;
618   
619   // iterate over ourself
620   const char *basename = machine().basename();
621   samples_iterator iter(*this);
622   const char *altbasename = iter.altbasename();
739623
740      /* --- the following bits of info are returned as pointers to data or functions --- */
741        case DEVINFO_FCT_START:                         info->start = DEVICE_START_NAME( samples );      break;
742        case DEVINFO_FCT_STOP:                          /* Nothing */                                 break;
743        case DEVINFO_FCT_RESET:                         /* Nothing */                                 break;
624   // pre-size the array
625   m_sample.resize(iter.count());
744626
745      /* --- the following bits of info are returned as NULL-terminated strings --- */
746        case DEVINFO_STR_NAME:                          strcpy(info->s, "Samples");                    break;
747        case DEVINFO_STR_FAMILY:                   strcpy(info->s, "Big Hack");                    break;
748        case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.1");                         break;
749        case DEVINFO_STR_SOURCE_FILE:                     strcpy(info->s, __FILE__);                          break;
750        case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
627   // load the samples
628   int index = 0;
629   for (const char *samplename = iter.first(); samplename != NULL; index++, samplename = iter.next())
630   {
631printf("Sample %d = %s\n", index, samplename);
632      // attempt to open as FLAC first
633      emu_file file(machine().options().sample_path(), OPEN_FLAG_READ);
634      file_error filerr = file.open(basename, PATH_SEPARATOR, samplename, ".flac");
635      if (filerr != FILERR_NONE && altbasename != NULL)
636         filerr = file.open(altbasename, PATH_SEPARATOR, samplename, ".flac");
637     
638      // if not, try as WAV
639      if (filerr != FILERR_NONE)
640         filerr = file.open(basename, PATH_SEPARATOR, samplename, ".wav");
641      if (filerr != FILERR_NONE && altbasename != NULL)
642         filerr = file.open(altbasename, PATH_SEPARATOR, samplename, ".wav");
643
644      // if opened, read it
645      if (filerr == FILERR_NONE)
646         read_sample(file, m_sample[index]);
647      else if (filerr == FILERR_NOT_FOUND)
648         mame_printf_warning("Sample '%s' NOT FOUND\n", samplename);
751649   }
752650}
753
754
755DEFINE_LEGACY_SOUND_DEVICE(SAMPLES, samples);
src/emu/sound/samples.h
r14521r14522
1/***************************************************************************
2
3    samples.h
4
5    Sound device for sample playback.
6
7****************************************************************************
8
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
38***************************************************************************/
39
140#pragma once
241
342#ifndef __SAMPLES_H__
r14521r14522
342#define __SAMPLES_H__
443
5#include "devlegcy.h"
644
7typedef struct _loaded_sample loaded_sample;
8struct _loaded_sample
45//**************************************************************************
46//  INTERFACE CONFIGURATION MACROS
47//**************************************************************************
48
49#define MCFG_SAMPLES_ADD(_tag, _interface) \
50   MCFG_DEVICE_ADD(_tag, SAMPLES, 0) \
51   samples_device::static_set_interface(*device, _interface);
52
53#define MCFG_SAMPLES_REPLACE(_tag, _interface) \
54   MCFG_DEVICE_REPLACE(_tag, SAMPLES, 0) \
55   samples_device::static_set_interface(*device, _interface);
56
57
58#define SAMPLES_START(name) void name(samples_device &device)
59
60
61
62//**************************************************************************
63//  TYPE DEFINITIONS
64//**************************************************************************
65
66class samples_device;
67
68
69// ======================> samples_interface sample
70
71struct samples_interface
972{
10    int         length;         /* length in samples */
11    int         frequency;      /* frequency of the sample */
12    INT16 *     data;           /* 16-bit signed data */
73    UINT8      m_channels;         // number of discrete audio channels needed
74    const char *const *m_names;      // array of sample names
75    void        (*m_start)(samples_device &device); // optional callback
1376};
1477
15typedef struct _loaded_samples loaded_samples;
16struct _loaded_samples
78
79// ======================> samples_device
80
81class samples_device :    public device_t,
82                  public device_sound_interface,
83                  public samples_interface
1784{
18    int         total;          /* number of samples */
19    loaded_sample sample[1]; /* array of samples */
85public:
86   // construction/destruction
87   samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
88
89   // static configuration helpers
90   static void static_set_interface(device_t &device, const samples_interface &interface);
91
92   // getters
93   bool playing(UINT8 channel) const;
94   UINT32 base_frequency(UINT8 channel) const;
95
96   // start/stop helpers
97   void start(UINT8 channel, UINT32 samplenum, bool loop = false);
98   void start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop = false);
99   void pause(UINT8 channel, bool pause = true);
100   void stop(UINT8 channel);
101   void stop_all();
102   
103   // dynamic control
104   void set_frequency(UINT8 channel, UINT32 frequency);
105   void set_volume(UINT8 channel, float volume);
106   
107protected:
108   // subclasses can do it this way
109   samples_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
110
111   // device-level overrides
112   virtual void device_start();
113   virtual void device_reset();
114   virtual void device_post_load();
115
116   // device_sound_interface overrides
117   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
118
119private:
120   // internal classes
121   struct loaded_sample
122   {
123      // shouldn't need a copy, but in case it happens, catch it here
124      loaded_sample &operator=(const loaded_sample &rhs) { assert(false); return *this; }
125   
126       UINT32         length;         // length in samples
127       UINT32         frequency;      // frequency of the sample
128       dynamic_array<INT16> data;      // 16-bit signed data
129   };
130
131   struct channel_t
132   {
133      sound_stream *   stream;
134      const INT16 *   source;
135      INT32         source_length;
136      INT32         source_num;
137      UINT32         pos;
138      UINT32         frac;
139      UINT32         step;
140      UINT32         basefreq;
141      bool         loop;
142      bool         paused;
143   };
144   
145   // internal helpers
146   bool read_sample(emu_file &file, loaded_sample &sample);
147   bool read_wav_sample(emu_file &file, loaded_sample &sample);
148   bool read_flac_sample(emu_file &file, loaded_sample &sample);
149   void load_samples();
150
151   // internal state
152   dynamic_array<channel_t>      m_channel;
153   dynamic_array<loaded_sample>   m_sample;
154
155   // internal constants
156   static const UINT8 FRAC_BITS = 24;
157   static const UINT32 FRAC_ONE = 1 << FRAC_BITS;
158   static const UINT32 FRAC_MASK = FRAC_ONE - 1;
20159};
21160
22typedef struct _samples_interface samples_interface;
23struct _samples_interface
161// iterator, since lots of people are interested in these devices
162typedef device_type_iterator<&device_creator<samples_device>, samples_device> samples_device_iterator;
163
164
165// ======================> samples_iterator
166
167class samples_iterator
24168{
25    int         channels;   /* number of discrete audio channels needed */
26    const char *const *samplenames;
27    void        (*start)(device_t *device);
169public:
170   // construction/destruction
171   samples_iterator(samples_interface &intf)
172      : m_intf(intf),
173        m_current(-1) { }
174       
175   // getters
176   const char *altbasename() const { return (m_intf.m_names != NULL && m_intf.m_names[0] != NULL && m_intf.m_names[0][0] == '*') ? &m_intf.m_names[0][1] : NULL; }
177
178   // iteration
179   const char *first()
180   {
181      if (m_intf.m_names == NULL || m_intf.m_names[0] == NULL)
182         return NULL;
183      m_current = 0;
184      if (m_intf.m_names[0][0] == '*')
185         m_current++;
186      return m_intf.m_names[m_current++];
187   }
188
189   const char *next()
190   {
191      if (m_current == -1 || m_intf.m_names[m_current] == NULL)
192         return NULL;
193      return m_intf.m_names[m_current++];
194   }
195   
196   // counting
197   int count()
198   {
199      int save = m_current;
200      int result = 0;
201      for (const char *scan = first(); scan != NULL; scan = next())
202         result++;
203      m_current = save;
204      return result;
205   }
206
207private:
208   // internal state
209   samples_interface &      m_intf;
210   int                  m_current;
28211};
29212
30#define SAMPLES_START(name) void name(device_t *device)
31213
32214
33void sample_start(device_t *device,int channel,int samplenum,int loop);
34void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop);
35void sample_set_freq(device_t *device,int channel,int freq);
36void sample_set_volume(device_t *device,int channel,float volume);
37void sample_set_pause(device_t *device,int channel,int pause);
38void sample_stop(device_t *device,int channel);
39int sample_get_base_freq(device_t *device,int channel);
40int sample_playing(device_t *device,int channel);
215//**************************************************************************
216//  GLOBAL VARIABLES
217//**************************************************************************
41218
42/* helper function that reads samples from disk - this can be used by other */
43/* drivers as well (e.g. a sound chip emulator needing drum samples) */
44loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *name);
219// device type definition
220extern const device_type SAMPLES;
45221
46DECLARE_LEGACY_SOUND_DEVICE(SAMPLES, samples);
47222
48typedef device_type_iterator<&legacy_device_creator<samples_device>, samples_device> samples_device_iterator;
49
50#endif /* __SAMPLES_H__ */
223#endif
src/emu/clifront.c
r14521r14522
567567      first = false;
568568      mame_printf_info("Samples required for driver \"%s\".\n", drivlist.driver().name);
569569
570      // iterate over samples devices
570      // iterate over samples devices and print the samples from each one
571571      for (samples_device *device = iter.first(); device != NULL; device = iter.next())
572572      {
573         // if the list is legit, walk it and print the sample info
574         const char *const *samplenames = reinterpret_cast<const samples_interface *>(device->static_config())->samplenames;
575         if (samplenames != NULL)
576            for (int sampnum = 0; samplenames[sampnum] != NULL; sampnum++)
577               if (samplenames[sampnum][0] != '*')
578                  mame_printf_info("%s\n", samplenames[sampnum]);
573         samples_iterator sampiter(*device);
574         for (const char *samplename = sampiter.first(); samplename != NULL; samplename = sampiter.next())
575            mame_printf_info("%s\n", samplename);
579576      }
580577   }
581578}
src/emu/imagedev/harddriv.c
r14521r14522
2020#include "harddriv.h"
2121
2222
23static const char *const error_strings[] =
24{
25   "no error",
26   "no drive interface",
27   "out of memory",
28   "file not open",
29   "file already open",
30   "invalid file",
31   "invalid parameter",
32   "invalid data",
33   "file not found",
34   "requires parent",
35   "file not writeable",
36   "read error",
37   "write error",
38   "codec error",
39   "invalid parent",
40   "hunk out of range",
41   "decompression error",
42   "compression error",
43   "can't create file",
44   "can't verify file",
45   "operation not supported",
46   "can't find metadata",
47   "invalid metadata size",
48   "unsupported CHD version",
49   "verify incomplete",
50   "invalid metadata",
51   "invalid state",
52   "operation pending",
53   "unsupported format",
54   "unknown compression",
55   "error walking_parent",
56   "error compressing"
57};
58
59static const char *chd_get_error_string(int chderr)
60{
61   if ((chderr < 0 ) || (chderr >= ARRAY_LENGTH(error_strings)))
62      return NULL;
63   return error_strings[chderr];
64}
65
66
67
6823static OPTION_GUIDE_START(hd_option_guide)
6924   OPTION_INT('C', "cylinders",      "Cylinders")
7025   OPTION_INT('H', "heads",         "Heads")
r14521r14522
270225         m_chd = NULL;
271226      }
272227      printf("%d\n",err);
273      seterror(IMAGE_ERROR_UNSPECIFIED, chd_get_error_string(err));
274      printf("%s\n",chd_get_error_string(err));
228      seterror(IMAGE_ERROR_UNSPECIFIED, chd_file::error_string(err));
229      printf("%s\n",chd_file::error_string(err));
275230   }
276231   return err ? IMAGE_INIT_FAIL : IMAGE_INIT_PASS;
277232}
src/emu/imagedev/chd_cd.c
r14521r14522
1111#include "chd_cd.h"
1212
1313
14static const char *const error_strings[] =
15{
16   "no error",
17   "no drive interface",
18   "out of memory",
19   "file not open",
20   "file already open",
21   "invalid file",
22   "invalid parameter",
23   "invalid data",
24   "file not found",
25   "requires parent",
26   "file not writeable",
27   "read error",
28   "write error",
29   "codec error",
30   "invalid parent",
31   "hunk out of range",
32   "decompression error",
33   "compression error",
34   "can't create file",
35   "can't verify file",
36   "operation not supported",
37   "can't find metadata",
38   "invalid metadata size",
39   "unsupported CHD version",
40   "verify incomplete",
41   "invalid metadata",
42   "invalid state",
43   "operation pending",
44   "unsupported format",
45   "unknown compression",
46   "error walking_parent",
47   "error compressing"
48};
49
50static const char *chd_get_error_string(int chderr)
51{
52   if ((chderr < 0 ) || (chderr >= ARRAY_LENGTH(error_strings)))
53      return NULL;
54   return error_strings[chderr];
55}
56
57
5814static OPTION_GUIDE_START(cd_option_guide)
5915   OPTION_INT('K', "hunksize",         "Hunk Bytes")
6016OPTION_GUIDE_END
r14521r14522
164120   if ( chd && chd == &m_self_chd )
165121      m_self_chd.close( );
166122   if ( err )
167      seterror( IMAGE_ERROR_UNSPECIFIED, chd_get_error_string( err ) );
123      seterror( IMAGE_ERROR_UNSPECIFIED, chd_file::error_string( err ) );
168124   return IMAGE_INIT_FAIL;
169125}
170126
src/emu/info.c
r14521r14522
410410   samples_device_iterator iter(m_drivlist.config().root_device());
411411   for (samples_device *device = iter.first(); device != NULL; device = iter.next())
412412   {
413      const char *const *samplenames = ((const samples_interface *)device->static_config())->samplenames;
414      if (samplenames != NULL)
413      samples_iterator sampiter(*device);
414      if (sampiter.altbasename() != NULL)
415      {
416         fprintf(m_output, " sampleof=\"%s\"", xml_normalize_string(sampiter.altbasename()));
415417
416         // iterate over sample names
417         for (int sampnum = 0; samplenames[sampnum] != NULL; sampnum++)
418         {
419            // only output sampleof if different from the game name
420            const char *cursampname = samplenames[sampnum];
421            if (cursampname[0] == '*' && strcmp(cursampname + 1, m_drivlist.driver().name) != 0)
422               fprintf(m_output, " sampleof=\"%s\"", xml_normalize_string(cursampname + 1));
423
424            // must stop here, as there can only be one attribute of the same name
425            return;
426         }
418         // must stop here, as there can only be one attribute of the same name
419         return;
420      }
427421   }
428422}
429423
r14521r14522
563557{
564558   // iterate over sample devices
565559   samples_device_iterator iter(m_drivlist.config().root_device());
566   for (const device_t *device = iter.first(); device != NULL; device = iter.next())
560   for (samples_device *device = iter.first(); device != NULL; device = iter.next())
567561   {
568      const char *const *samplenames = ((const samples_interface *)device->static_config())->samplenames;
569      if (samplenames != NULL)
562      samples_iterator sampiter(*device);
563      tagmap_t<int> already_printed;
564      for (const char *samplename = sampiter.first(); samplename != NULL; samplename = sampiter.next())
565      {
566         // filter out duplicates
567         if (already_printed.add(samplename, 1) == TMERR_DUPLICATE)
568            continue;
570569
571         // iterate over sample names
572         for (int sampnum = 0; samplenames[sampnum] != NULL; sampnum++)
573         {
574            // ignore the special '*' samplename
575            const char *cursampname = samplenames[sampnum];
576            if (sampnum == 0 && cursampname[0] == '*')
577               continue;
578
579            // filter m_output duplicates
580            int dupnum;
581            for (dupnum = 0; dupnum < sampnum; dupnum++)
582               if (strcmp(samplenames[dupnum], cursampname) == 0)
583                  break;
584            if (dupnum < sampnum)
585               continue;
586
587            // output the sample name
588            fprintf(m_output, "\t\t<sample name=\"%s\"/>\n", xml_normalize_string(cursampname));
589         }
570         // output the sample name
571         fprintf(m_output, "\t\t<sample name=\"%s\"/>\n", xml_normalize_string(samplename));
572      }
590573   }
591574}
592575
src/emu/audit.c
r14521r14522
236236   samples_device_iterator iter(m_enumerator.config().root_device());
237237   for (samples_device *device = iter.first(); device != NULL; device = iter.next())
238238   {
239      const samples_interface *intf = reinterpret_cast<const samples_interface *>(device->static_config());
240      if (intf->samplenames != NULL)
241      {
242         // by default we just search using the driver name
243         astring searchpath(m_enumerator.driver().name);
239      // by default we just search using the driver name
240      astring searchpath(m_enumerator.driver().name);
244241
245         // iterate over samples in this entry
246         for (int sampnum = 0; intf->samplenames[sampnum] != NULL; sampnum++)
247         {
248            // starred entries indicate an additional searchpath
249            if (intf->samplenames[sampnum][0] == '*')
250            {
251               searchpath.cat(";").cat(&intf->samplenames[sampnum][1]);
252               continue;
253            }
242      // add the alternate path if present
243      samples_iterator iter(*device);
244      if (iter.altbasename() != NULL)
245         searchpath.cat(";").cat(iter.altbasename());
254246
255            required++;
247      // iterate over samples in this entry
248      for (const char *samplename = iter.first(); samplename != NULL; samplename = iter.next())
249      {
250         required++;
256251
257            // create a new record
258            audit_record &record = m_record_list.append(*global_alloc(audit_record(intf->samplenames[sampnum], audit_record::MEDIA_SAMPLE)));
252         // create a new record
253         audit_record &record = m_record_list.append(*global_alloc(audit_record(samplename, audit_record::MEDIA_SAMPLE)));
259254
260            // look for the files
261            emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
262            path_iterator path(searchpath);
263            astring curpath;
264            while (path.next(curpath, intf->samplenames[sampnum]))
265            {
266               astring wholepath;
267               wholepath = curpath + ".flac";
255         // look for the files
256         emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
257         path_iterator path(searchpath);
258         astring curpath;
259         while (path.next(curpath, samplename))
260         {
261            // attempt to access the file (.flac) or (.wav)
262            file_error filerr = file.open(curpath, ".flac");
263            if (filerr != FILERR_NONE)
264               filerr = file.open(curpath, ".wav");
268265
269               // attempt to access the file (.flac)
270               file_error filerr = file.open(wholepath);
271
272               if (filerr != FILERR_NONE)
273               {
274                  wholepath = curpath + ".wav";
275                  // try again with .wav
276                  filerr = file.open(wholepath);
277               }
278
279               if (filerr == FILERR_NONE)
280               {
281                  record.set_status(audit_record::STATUS_GOOD, audit_record::SUBSTATUS_GOOD);
282                  found++;
283               }
284               else
285                  record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND);
266            if (filerr == FILERR_NONE)
267            {
268               record.set_status(audit_record::STATUS_GOOD, audit_record::SUBSTATUS_GOOD);
269               found++;
286270            }
271            else
272               record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND);
287273         }
288274      }
289275   }
src/lib/util/chd.c
r14521r14522
13841384      case CHDERR_NONE:                  return "no error";
13851385      case CHDERR_NO_INTERFACE:            return "no drive interface";
13861386      case CHDERR_OUT_OF_MEMORY:            return "out of memory";
1387      case CHDERR_NOT_OPEN:               return "file not open";
1388      case CHDERR_ALREADY_OPEN:            return "file already open";
13871389      case CHDERR_INVALID_FILE:            return "invalid file";
13881390      case CHDERR_INVALID_PARAMETER:         return "invalid parameter";
13891391      case CHDERR_INVALID_DATA:            return "invalid data";
r14521r14522
14081410      case CHDERR_INVALID_STATE:            return "invalid state";
14091411      case CHDERR_OPERATION_PENDING:         return "operation pending";
14101412      case CHDERR_UNSUPPORTED_FORMAT:         return "unsupported format";
1413      case CHDERR_UNKNOWN_COMPRESSION:      return "unknown compression type";
1414      case CHDERR_WALKING_PARENT:            return "currently examining parent";
1415      case CHDERR_COMPRESSING:            return "currently compressing";
14111416      default:                        return "undocumented error";
14121417   }
14131418}
src/lib/util/flac.c
r14521r14522
367367bool flac_decoder::reset()
368368{
369369   m_compressed_offset = 0;
370   if (FLAC__stream_decoder_init_stream(m_decoder, &flac_decoder::read_callback_static, NULL, &flac_decoder::tell_callback_static, NULL, NULL, &flac_decoder::write_callback_static, NULL, &flac_decoder::error_callback_static, this) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
370   if (FLAC__stream_decoder_init_stream(m_decoder,
371            &flac_decoder::read_callback_static,
372            NULL,
373            &flac_decoder::tell_callback_static,
374            NULL,
375            NULL,
376            &flac_decoder::write_callback_static,
377            &flac_decoder::metadata_callback_static,
378            &flac_decoder::error_callback_static, this) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
371379      return false;
372380   return FLAC__stream_decoder_process_until_end_of_metadata(m_decoder);
373381}
r14521r14522
563571
564572
565573//-------------------------------------------------
574//  metadata_callback - handle STREAMINFO metadata
575//-------------------------------------------------
576
577void flac_decoder::metadata_callback_static(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
578{
579   // ignore all but STREAMINFO metadata
580   if (metadata->type != FLAC__METADATA_TYPE_STREAMINFO)
581      return;
582   
583   // parse out the data we care about
584   flac_decoder *fldecoder = reinterpret_cast<flac_decoder *>(client_data);
585   fldecoder->m_sample_rate = metadata->data.stream_info.sample_rate;
586   fldecoder->m_bits_per_sample = metadata->data.stream_info.bits_per_sample;
587   fldecoder->m_channels = metadata->data.stream_info.channels;
588}
589
590
591//-------------------------------------------------
566592//  tell_callback - handle requests to find out
567593//  where in the input stream we are
568594//-------------------------------------------------
src/lib/util/flac.h
r14521r14522
121121   ~flac_decoder();
122122   
123123   // getters (valid after reset)
124   UINT32 sample_rate() const { return FLAC__stream_decoder_get_sample_rate(m_decoder); }
125   UINT8 channels() const { return FLAC__stream_decoder_get_channels(m_decoder); }
126   UINT32 block_size() const { return FLAC__stream_decoder_get_blocksize(m_decoder); }
124   UINT32 sample_rate() const { return m_sample_rate; }
125   UINT8 channels() const { return m_channels; }
126   UINT8 bits_per_sample() const { return m_bits_per_sample; }
127   UINT32 total_samples() const { return FLAC__stream_decoder_get_total_samples(m_decoder); }
127128   FLAC__StreamDecoderState state() const { return FLAC__stream_decoder_get_state(m_decoder); }
128129   const char *state_string() const { return FLAC__stream_decoder_get_resolved_state_string(m_decoder); }
129130   
r14521r14522
144145   // internal helpers
145146   static FLAC__StreamDecoderReadStatus read_callback_static(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
146147   FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes);
148   static void metadata_callback_static(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
147149   static FLAC__StreamDecoderTellStatus tell_callback_static(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
148150   static FLAC__StreamDecoderWriteStatus write_callback_static(const FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
149151   FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]);
r14521r14522
152154   // output state
153155   FLAC__StreamDecoder *   m_decoder;            // actual encoder
154156   core_file *            m_file;               // output file
157   UINT32               m_sample_rate;         // decoded sample rate
158   UINT8               m_channels;            // decoded number of channels
159   UINT8               m_bits_per_sample;      // decoded bits per sample
155160   UINT32               m_compressed_offset;   // current offset in compressed data
156161   const FLAC__byte *      m_compressed_start;      // start of compressed data
157162   UINT32               m_compressed_length;   // length of compressed data
src/lib/util/hashing.h
r14521r14522
4444
4545#include "osdcore.h"
4646#include "astring.h"
47//#include "zlib.h"
4847#include "md5.h"
4948#include "sha1.h"
5049
src/lib/util/coretmpl.h
r14521r14522
7676   
7777   // helpers
7878   void append(const _ElementType &element) { if (m_count == m_allocated) expand_internal((m_allocated == 0) ? 16 : (m_allocated << 1), true); m_array[m_count++] = element; }
79   void reset() { if (m_array) delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
79   void reset() { delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
8080   void resize(int count, bool keepdata = false) { if (count > m_allocated) expand_internal(count, keepdata); m_count = count; }
8181
8282private:
r14521r14522
8989      if (keepdata)
9090         for (int index = 0; index < m_count; index++)
9191            newarray[index] = m_array[index];
92      if (m_array) delete[] m_array;
92      delete[] m_array;
9393      m_array = newarray;
9494   }
9595
src/mess/drivers/votrtnt.c
r14521r14522
6363   required_device<cpu_device> m_maincpu;
6464   required_device<device_t> m_terminal;
6565   //required_device<device_t> m_acia;
66   required_device<device_t> m_votrax;
66   required_device<votrax_device> m_votrax;
6767   DECLARE_READ8_MEMBER( votrtnt_acia_status_r );
6868   DECLARE_READ8_MEMBER( votrtnt_acia_data_r );
6969   DECLARE_WRITE8_MEMBER( votrtnt_votrax_w );
r14521r14522
8787{
8888   data &= 0x3f;  // intonation bits are grounded
8989   //printf("%X ",data);
90   votrax_w(m_votrax, 0, data);
90   m_votrax->write(space, 0, data);
9191}
9292
9393
r14521r14522
147147static TIMER_DEVICE_CALLBACK( votrtnt_poll_votrax )
148148{
149149   votrtnt_state *state = timer.machine().driver_data<votrtnt_state>();
150   UINT8 status = votrax_status_r(state->m_votrax);
150   UINT8 status = state->m_votrax->status();
151151   //printf("%X ",status);
152152   device_set_input_line(timer.machine().device("maincpu"), INPUT_LINE_IRQ0, status ? ASSERT_LINE : CLEAR_LINE);
153153}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team